Index: /issm/trunk/configure.ac
===================================================================
--- /issm/trunk/configure.ac	(revision 24312)
+++ /issm/trunk/configure.ac	(revision 24313)
@@ -2,5 +2,5 @@
 
 #AUTOCONF
-AC_INIT([Ice Sheet System Model (ISSM)],[4.15],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
+AC_INIT([Ice Sheet System Model (ISSM)],[4.16],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
 AC_CONFIG_AUX_DIR([./aux-config])         #Put config files in aux-config
 AC_CONFIG_MACRO_DIR([m4])                 #m4 macros are located in m4
Index: /issm/trunk/etc/environment.sh
===================================================================
--- /issm/trunk/etc/environment.sh	(revision 24312)
+++ /issm/trunk/etc/environment.sh	(revision 24313)
@@ -1,4 +1,10 @@
-#ISSM_DIR and ISSM_ARCH should have been defined already in your shell settings file (.bashrc, .cshrc, etc ...)
-
+# Modifies path-related envrionment variables based on which external packages 
+# have been installed.
+#
+# ISSM_DIR and ISSM_ARCH should have been defined already in your shell 
+# settings file (i.e. .bashrc, .cshrc).
+
+## Functions
+#
 pathprepend(){ #{{{
 	if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
@@ -22,50 +28,73 @@
 } #}}}
 libpathprepend(){ #{{{
-	if [ -d "$1" ] && [[ ":$LD_LIBRARY_PATH:" != *":$1:"* ]]; then
-		export LD_LIBRARY_PATH="$1:$LD_LIBRARY_PATH"
-	fi
-	if [ -d "$1" ] && [[ ":$LD_RUN_PATH:" != *":$1:"* ]]; then
-		export LD_RUN_PATH="$1:$LD_RUN_PATH"
+	if [ -d "$1" ]; then
+		if [ -z $LD_LIBRARY_PATH ]; then
+			export LD_LIBRARY_PATH="$1"
+		elif [[ ":$LD_LIBRARY_PATH:" != *":$1:"* ]]; then
+			export LD_LIBRARY_PATH="$1:$LD_LIBRARY_PATH"
+		fi
+		if [ -z $LD_RUN_PATH ]; then
+			export LD_RUN_PATH="$1"
+		elif [[ ":$LD_RUN_PATH:" != *":$1:"* ]]; then
+			export LD_RUN_PATH="$1:$LD_RUN_PATH"
+		fi
 	fi
 } #}}}
 libpathappend(){ #{{{
-	if [ -d "$1" ] && [[ ":$LD_LIBRARY_PATH:" != *":$1:"* ]]; then
-		export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$1"
-	fi
-	if [ -d "$1" ] && [[ ":$LD_RUN_PATH:" != *":$1:"* ]]; then
-		export LD_RUN_PATH="$LD_RUN_PATH:$1"
+	if [ -d "$1" ]; then
+		if [ -z $LD_LIBRARY_PATH ]; then
+			export LD_LIBRARY_PATH=$1
+		elif [[ ":$LD_LIBRARY_PATH:" != *":$1:"* ]]; then
+			export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$1"
+		fi
+		if [ -z $LD_RUN_PATH ]; then
+			export LD_RUN_PATH=$1
+		elif [[ ":$LD_RUN_PATH:" != *":$1:"* ]]; then
+			export LD_RUN_PATH="$LD_RUN_PATH:$1"
+		fi
 	fi
 } #}}}
 dylibpathprepend(){ #{{{
-	if [ -d "$1" ] && [[ ":$DYLD_LIBRARY_PATH:" != *":$1:"* ]]; then
-		export DYLD_LIBRARY_PATH="$1:$DYLD_LIBRARY_PATH"
-	fi
-	if [ -d "$1" ] && [[ ":$LD_RUN_PATH:" != *":$1:"* ]]; then
-		export LD_RUN_PATH="$1:$LD_RUN_PATH"
+	if [ -d "$1" ]; then
+		if [ -z $DYLD_LIBRARY_PATH ]; then
+			export DYLD_LIBRARY_PATH=$1
+		elif [[ ":$DYLD_LIBRARY_PATH:" != *":$1:"* ]]; then
+			export DYLD_LIBRARY_PATH="$1:$DYLD_LIBRARY_PATH"
+		fi
+		if [ -z $LD_RUN_PATH ]; then
+			export LD_RUN_PATH=$1
+		elif [[ ":$LD_RUN_PATH:" != *":$1:"* ]]; then
+			export LD_RUN_PATH="$1:$LD_RUN_PATH"
+		fi
 	fi
 } #}}}
 dylibpathappend(){ #{{{
-	if [ -d "$1" ] && [[ ":$DYLD_LIBRARY_PATH:" != *":$1:"* ]]; then
-		export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$1"
-	fi
-	if [ -d "$1" ] && [[ ":$LD_RUN_PATH:" != *":$1:"* ]]; then
-		export LD_RUN_PATH="$LD_RUN_PATH:$1"
-	fi
-} #}}}
-
-#FIXME: during installation packages are installed one by one but environment.sh was sourced
-#before so new packages are NOT in the path.
-#may resource environment.sh with:
-#if [ -z $(echo "$PATH" | grep "$MATLAB_DIR") ]; then export $PATH...; fi
-
-#Windows compilers: 
+	if [ -d "$1" ]; then
+		if [ -z $DYLD_LIBRARY_PATH ]; then
+			export DYLD_LIBRARY_PATH=$1
+		elif [[ ":$DYLD_LIBRARY_PATH:" != *":$1:"* ]]; then
+			export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$1"
+		fi
+		if [ -z $LD_RUN_PATH ]; then
+			export LD_RUN_PATH=$1
+		elif [[ ":$LD_RUN_PATH:" != *":$1:"* ]]; then
+			export LD_RUN_PATH="$LD_RUN_PATH:$1"
+		fi
+	fi
+} #}}}
+
+# FIXME: during installation packages are installed one by one but 
+# environment.sh was sourced before so new packages are NOT in the path. May 
+# source environment.sh again with:
+# 	if [ -z $(echo "$PATH" | grep "$MATLAB_DIR") ]; then export $PATH...; fi
+
+# Windows compilers:
 if [[ "$ISSM_ARCH" == "cygwin-intel" ]]; then
 	source $ISSM_DIR/externalpackages/windows/windows_environment.sh
 fi
 
-#Load ISSM scripts
+# Load ISSM scripts
 pathappend "$ISSM_DIR/scripts"
 
-#GMT 
 GMT_DIR="$ISSM_DIR/externalpackages/gmt/install"
 if [ -d "$GMT_DIR" ]; then
@@ -117,4 +146,7 @@
 VALGRIND_DIR="$ISSM_DIR/externalpackages/valgrind/install"
 pathprepend "$VALGRIND_DIR/bin"
+
+NCO_DIR="$ISSM_DIR/externalpackages/nco/install/bin"
+pathprepend "$NCO_DIR/bin"
 
 CPPCHECK_DIR="$ISSM_DIR/externalpackages/cppcheck/install"
Index: /issm/trunk/examples/LcurveAnalysis/DomainOutline.exp
===================================================================
--- /issm/trunk/examples/LcurveAnalysis/DomainOutline.exp	(revision 24313)
+++ /issm/trunk/examples/LcurveAnalysis/DomainOutline.exp	(revision 24313)
@@ -0,0 +1,10 @@
+## Name:DomainOutline
+## Icon:0
+# Points Count  Value
+5 1.000000
+# X pos Y pos
+0 0
+1000000 0
+1000000 1000000
+0 1000000
+0 0
Index: /issm/trunk/examples/LcurveAnalysis/Front.exp
===================================================================
--- /issm/trunk/examples/LcurveAnalysis/Front.exp	(revision 24313)
+++ /issm/trunk/examples/LcurveAnalysis/Front.exp	(revision 24313)
@@ -0,0 +1,10 @@
+## Name:icefront
+## Icon:0
+# Points Count  Value
+5 1.
+# X pos Y pos
+-1000 900000
+-1000 1100000
+1100000 1100000
+1100000 900000
+-1000 900000
Index: /issm/trunk/examples/LcurveAnalysis/Square.par
===================================================================
--- /issm/trunk/examples/LcurveAnalysis/Square.par	(revision 24313)
+++ /issm/trunk/examples/LcurveAnalysis/Square.par	(revision 24313)
@@ -0,0 +1,24 @@
+%Start defining model parameters here
+
+disp('      creating thickness');
+hmin = 300;
+hmax = 1000;
+ymin = min(md.mesh.y);
+ymax = max(md.mesh.y);
+md.geometry.thickness = hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin);
+md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness;
+md.geometry.surface   = md.geometry.base+md.geometry.thickness;
+
+disp('      creating drag');
+md.friction.coefficient=200*ones(md.mesh.numberofvertices,1);
+md.friction.coefficient(find(md.mask.groundedice_levelset<0.))=0.;
+md.friction.p = ones(md.mesh.numberofelements,1);
+md.friction.q = ones(md.mesh.numberofelements,1);
+
+disp('      creating flow law paramter');
+md.materials.rheology_B=1.8*10^8*ones(md.mesh.numberofvertices,1);
+md.materials.rheology_B(find(md.mesh.x<md.mesh.y))=1.4*10^8;
+md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+
+disp('      creating boundary conditions');
+md=SetIceShelfBC(md,'Front.exp');
Index: /issm/trunk/examples/LcurveAnalysis/runme.m
===================================================================
--- /issm/trunk/examples/LcurveAnalysis/runme.m	(revision 24313)
+++ /issm/trunk/examples/LcurveAnalysis/runme.m	(revision 24313)
@@ -0,0 +1,126 @@
+step=[1];
+if any(step==1)
+	% Generate observations
+	md = model;
+	md = triangle(md,'DomainOutline.exp',100000);
+	md = setmask(md,'all','');
+	md = parameterize(md,'Square.par');
+	md = setflowequation(md,'SSA','all');
+	md.cluster = generic('np',2);
+	md = solve(md,'Stressbalance');
+	plotmodel(md,'axis#all','tight','data',md.materials.rheology_B,'caxis',[ 1.3 1.9]*10^8,'title','"True" B',...
+		'data',md.results.StressbalanceSolution.Vel,'title','"observed velocities"')
+	save model1 md
+end
+if any(step==2)
+	% Modify rheology, now constant
+	loadmodel('model1.mat');
+	md.materials.rheology_B(:) = 1.8*10^8;
+
+	%results of previous run are taken as observations
+	md.inversion=m1qn3inversion();
+	md.inversion.vx_obs  = md.results.StressbalanceSolution.Vx;
+	md.inversion.vy_obs  = md.results.StressbalanceSolution.Vy;
+	md.inversion.vel_obs = md.results.StressbalanceSolution.Vel;
+
+	md = solve(md,'Stressbalance');
+	plotmodel(md,'axis#all','tight','data',md.materials.rheology_B,'caxis',[ 1.3 1.9]*10^8,'title','B first guess',...
+		'data',md.results.StressbalanceSolution.Vel,'title','modeled velocities')
+	save model2 md
+end
+if any(step==3)
+	% Perform L-curve analysis for ice rigidity inversion
+	loadmodel('model2.mat');
+
+	% Set up inversion parameters
+	maxsteps = 20;
+	md.inversion.iscontrol = 1;
+	md.inversion.control_parameters = {'MaterialsRheologyBbar'};
+	md.inversion.maxsteps = maxsteps;
+	md.inversion.cost_functions = [101 502];
+	md.inversion.cost_functions_coefficients = ones(md.mesh.numberofvertices,length(md.inversion.cost_functions));
+	md.inversion.min_parameters = cuffey(273)*ones(md.mesh.numberofvertices,1);
+	md.inversion.max_parameters = cuffey(200)*ones(md.mesh.numberofvertices,1);
+   md.verbose = verbose('solution',false,'control',true);
+	
+	% Starting L-curve analysis:
+	%
+	% J = Jo + alpha*R.
+	% J: total cost function to be minimized.
+	% Jo: sum of the objective cost function(s) (ex.: 101, or 101+102, or 101+102+103).
+	% R: regularization term (ex.: 502).
+	% alpha: weight of the regularization term.
+	%
+	% L-curve analysis is a method to find the best value for alpha.
+	% Basicaly, it loops over different values of alpha. A plot can be generated for each
+	% respective value of Jo and R (R versus Jo).
+	%
+	min_alpha   = 1.e-20;
+	max_alpha   = 1.e-11;
+	nstep_alpha = 30;
+	log_step    = (log10(max_alpha)-log10(min_alpha))/nstep_alpha;
+	log_alphas  = [log10(min_alpha):log_step:log10(max_alpha)];
+	alphas      = 10.^log_alphas;
+	J           = zeros(length(alphas),length(md.inversion.cost_functions)+1);
+	% Loop over the alphas
+	for i=1:length(alphas),
+		disp('------------------------------------------------------------');
+		disp(['      alpha iteration: ' int2str(i) '/' int2str(length(alphas)) ', alpha value: ' num2str(alphas(i))]);
+		disp('------------------------------------------------------------');
+		md.inversion.cost_functions_coefficients(:,end) = alphas(i);
+		md = solve(md,'Stressbalance');
+		J(i,:) = md.results.StressbalanceSolution.J(end,:); % J comes in [Jo, alphaR, J]. In this example: [101, alpha*502, 101+alpha*502]
+	end
+
+	% Plot the L-curve (log-log)
+	Jo = zeros(length(alphas),1);
+	for i=1:size(J,2)-2,
+		Jo = Jo + J(:,i); % sum of the cost functions (no regularization term). In this example, only 101
+	end
+	R  = J(:,end-1)./alphas(:); % only the regularization term
+	
+	% Tip:
+	% A rescale in the axes may be useful to visualize the L-curve.
+	%
+	% Remember: J = Jo + alpha*R
+	%
+	% Apply a linear transformation on the original axis (Jo, R): 
+   %
+	% |   1       alpha | | Jo  |   | Jo + alpha*R |   |    J    |
+	% |                 | |     | = |              | = |         |
+	% | 1/alpha     1   | |  R  |   | Jo/alpha + R |   | J/alpha |
+	%
+	% Then, use:
+	% Jo2 = J(:,end);
+	% R2  = J(:,end)./alphas(:);
+	% loglog(Jo2,R2,... 
+	%
+	loglog(Jo,R,'-s','Color',[.3 .8 .4],'MarkerSize',6,'MarkerFaceColor','m','MarkerEdgeColor','k','LineWidth',2)
+	voffset=0.1*R;
+	hoffset=0.1*Jo;
+	text(Jo+hoffset,R+voffset,[repmat('\alpha = ',length(alphas),1) num2str(alphas(:),'%2.0e')],...
+            'FontSize',10,'HorizontalAlignment','left','VerticalAlignment','Middle')
+	xlabel('$\mathrm{log}(\mathcal{J}_0$)','Interpreter','latex')
+	ylabel('$\mathrm{log}(\mathcal{R})$','Interpreter','latex')
+end
+if any(step==4)
+	%invert for ice rigidity
+	loadmodel('model2.mat');
+
+	%Set up inversion parameters
+	maxsteps = 20;
+	md.inversion.iscontrol = 1;
+	md.inversion.control_parameters = {'MaterialsRheologyBbar'};
+	md.inversion.maxsteps = maxsteps;
+	md.inversion.cost_functions = [101 502];
+	md.inversion.cost_functions_coefficients      = ones(md.mesh.numberofvertices,1);
+	md.inversion.cost_functions_coefficients(:,2) = 4.e-17*ones(md.mesh.numberofvertices,1); % here you can use the best value found for alpha
+	md.inversion.min_parameters    = cuffey(273)*ones(md.mesh.numberofvertices,1);
+	md.inversion.max_parameters    = cuffey(200)*ones(md.mesh.numberofvertices,1);
+
+	%Go solve!
+	md.verbose=verbose(0);
+	md=solve(md,'Stressbalance');
+	plotmodel(md,'axis#all','tight','data',md.results.StressbalanceSolution.MaterialsRheologyBbar,'caxis',[ 1.3 1.9]*10^8,'title','inferred B',...
+		'data',md.results.StressbalanceSolution.Vel,'title','modeled velocities')
+end
Index: /issm/trunk/examples/README.txt
===================================================================
--- /issm/trunk/examples/README.txt	(revision 24312)
+++ /issm/trunk/examples/README.txt	(revision 24313)
@@ -1,6 +1,10 @@
-To run the following examples see the accompanying tutorials that can be found within the
-documentation tab on the ISSM webpage. The tutorials were created to be parallel to lectures given,
-but the tutorials are up to date on their version of ISSM. However within the workshop directory you
-can find the lecture tutorials which will give a more in depth technical overview. If more help is
-needed see the Usermanual also found under the documentation tab. If you don't want to complete the
-tutorials in chronological order make sure to see Jakobshavn to run the download script. 
+To run the following examples, see the accompanying tutorials that can be found within the
+documentation tab on the ISSM webpages: https://issm.jpl.nasa.gov/documentation/tutorials/
+
+The tutorials were created to be parallel to lectures given,
+but the tutorials are up to date on their version of ISSM. If more help is
+needed see the User manual also found under the documentation tab
+(https://issm.jpl.nasa.gov/documentation/).
+
+Make sure to download the required datasets
+see https://issm.jpl.nasa.gov/documentation/tutorials/datasets/)
Index: /issm/trunk/externalpackages/adjoinablempi/install-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/adjoinablempi/install-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/adjoinablempi/install-macosx64.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/adjoinablempi' 'adjoinablempi.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/adjoinablempi' 'adjoinablempi.tar.gz'
 
 #Untar ADOL-C
Index: /issm/trunk/externalpackages/adjoinablempi/install-pleaides-gcc.sh
===================================================================
--- /issm/trunk/externalpackages/adjoinablempi/install-pleaides-gcc.sh	(revision 24312)
+++ /issm/trunk/externalpackages/adjoinablempi/install-pleaides-gcc.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/adjoinablempi' 'adjoinablempi.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/adjoinablempi' 'adjoinablempi.tar.gz'
 
 #Untar ADOL-C
Index: /issm/trunk/externalpackages/adjoinablempi/install-pleaides.sh
===================================================================
--- /issm/trunk/externalpackages/adjoinablempi/install-pleaides.sh	(revision 24312)
+++ /issm/trunk/externalpackages/adjoinablempi/install-pleaides.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/adjoinablempi' 'adjoinablempi.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/adjoinablempi' 'adjoinablempi.tar.gz'
 
 #Untar ADOL-C
Index: /issm/trunk/externalpackages/adjoinablempi/install.sh
===================================================================
--- /issm/trunk/externalpackages/adjoinablempi/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/adjoinablempi/install.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/adjoinablempi' 'adjoinablempi.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/adjoinablempi' 'adjoinablempi.tar.gz'
 
 #Untar ADOL-C
Index: /issm/trunk/externalpackages/adolc/install-withampi-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/adolc/install-withampi-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/adolc/install-withampi-macosx64.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/ADOL-C' 'ADOL-C.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/ADOL-C' 'ADOL-C.tar.gz'
 
 #Untar ADOL-C
Index: /issm/trunk/externalpackages/adolc/install-withampi-pleiades-gcc.sh
===================================================================
--- /issm/trunk/externalpackages/adolc/install-withampi-pleiades-gcc.sh	(revision 24312)
+++ /issm/trunk/externalpackages/adolc/install-withampi-pleiades-gcc.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/ADOL-C' 'ADOL-C.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/ADOL-C' 'ADOL-C.tar.gz'
 
 #Untar ADOL-C
Index: /issm/trunk/externalpackages/adolc/install-withampi-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/adolc/install-withampi-pleiades.sh	(revision 24312)
+++ /issm/trunk/externalpackages/adolc/install-withampi-pleiades.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/ADOL-C' 'ADOL-C.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/ADOL-C' 'ADOL-C.tar.gz'
 
 #Untar ADOL-C
Index: /issm/trunk/externalpackages/adolc/install-withampi.sh
===================================================================
--- /issm/trunk/externalpackages/adolc/install-withampi.sh	(revision 24312)
+++ /issm/trunk/externalpackages/adolc/install-withampi.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/ADOL-C' 'ADOL-C.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/ADOL-C' 'ADOL-C.tar.gz'
 
 #Untar ADOL-C
Index: /issm/trunk/externalpackages/adolc/install.sh
===================================================================
--- /issm/trunk/externalpackages/adolc/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/adolc/install.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/ADOL-C' 'ADOL-C.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/ADOL-C' 'ADOL-C.tar.gz'
 
 #Untar ADOL-C
Index: /issm/trunk/externalpackages/adolc/old/install-2.2.0.sh
===================================================================
--- /issm/trunk/externalpackages/adolc/old/install-2.2.0.sh	(revision 24312)
+++ /issm/trunk/externalpackages/adolc/old/install-2.2.0.sh	(revision 24313)
@@ -11,5 +11,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/ADOL-C-2.2.0.tar.gz' 'ADOL-C-2.2.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/ADOL-C-2.2.0.tar.gz' 'ADOL-C-2.2.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/android/android-ndk/install.sh
===================================================================
--- /issm/trunk/externalpackages/android/android-ndk/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/android/android-ndk/install.sh	(revision 24313)
@@ -15,5 +15,5 @@
 
     # Download from ISSM server
-    $ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/android-ndk-r'${ndk_rev}'-darwin-x86.tar.bz2' 'ndk.tar.bz2'
+    $ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/android-ndk-r'${ndk_rev}'-darwin-x86.tar.bz2' 'ndk.tar.bz2'
 
     # Untar
Index: /issm/trunk/externalpackages/android/android-ndk/installNDK-linux-x86.sh
===================================================================
--- /issm/trunk/externalpackages/android/android-ndk/installNDK-linux-x86.sh	(revision 24312)
+++ /issm/trunk/externalpackages/android/android-ndk/installNDK-linux-x86.sh	(revision 24313)
@@ -15,5 +15,5 @@
 
     # Download from ISSM server
-#    $ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/android-ndk-r'${ndk_rev}'-darwin-x86.tar.bz2' 'ndk.tar.bz2'
+#    $ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/android-ndk-r'${ndk_rev}'-darwin-x86.tar.bz2' 'ndk.tar.bz2'
     # Download from google
 #    if ["$(uname -m)" = "x86_64"]; then
Index: /issm/trunk/externalpackages/android/android-sdk/install.sh
===================================================================
--- /issm/trunk/externalpackages/android/android-sdk/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/android/android-sdk/install.sh	(revision 24313)
@@ -22,5 +22,5 @@
 
 	# Download from ISSM server
-	$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/android-sdk_r'$sdk_rev'-macosx.zip' 'android-sdk_r'${sdk_rev}'-macosx.zip'
+	$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/android-sdk_r'$sdk_rev'-macosx.zip' 'android-sdk_r'${sdk_rev}'-macosx.zip'
 
 	# Install Android SDK and NDK.
Index: /issm/trunk/externalpackages/apr-util/install.sh
===================================================================
--- /issm/trunk/externalpackages/apr-util/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/apr-util/install.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/apr-util-1.4.1.tar.gz' 'apr-util-1.4.1.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/apr-util-1.4.1.tar.gz' 'apr-util-1.4.1.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/apr/install.sh
===================================================================
--- /issm/trunk/externalpackages/apr/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/apr/install.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/apr-1.4.6.tar.gz' 'apr-1.4.6.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/apr-1.4.6.tar.gz' 'apr-1.4.6.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/aspell/install.sh
===================================================================
--- /issm/trunk/externalpackages/aspell/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/aspell/install.sh	(revision 24313)
@@ -21,5 +21,5 @@
 
 	#Download from ISSM server
-	$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/aspell-0.50.5.tar.gz' 'aspell-0.50.5.tar.gz'
+	$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/aspell-0.50.5.tar.gz' 'aspell-0.50.5.tar.gz'
 
 	#Untar 
@@ -48,5 +48,5 @@
 
 	#Download from ISSM server
-	$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/aspell5-en-6.0.0.tar.gz' 'aspell5-en-6.0.0.tar.gz'
+	$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/aspell5-en-6.0.0.tar.gz' 'aspell5-en-6.0.0.tar.gz'
 
 	#Untar 
Index: /issm/trunk/externalpackages/atlas/install.sh
===================================================================
--- /issm/trunk/externalpackages/atlas/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/atlas/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/atlas3.10.0.tar.bz2' 'atlas3.10.0.tar.bz2'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/atlas3.10.0.tar.bz2' 'atlas3.10.0.tar.bz2'
 
 #Untar 
Index: /issm/trunk/externalpackages/autotools/install-win.sh
===================================================================
--- /issm/trunk/externalpackages/autotools/install-win.sh	(revision 24312)
+++ /issm/trunk/externalpackages/autotools/install-win.sh	(revision 24313)
@@ -19,5 +19,5 @@
 
 # Clean up existing assets
-rm -rf install
+rm -rf install src
 
 # Set up for installation
@@ -27,5 +27,4 @@
 # Install m4
 echo " === INSTALLING M4 =="
-rm -rf src
 $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${M4_TARBALL}" $M4_TARBALL
 tar -zxvf $M4_TARBALL
Index: /issm/trunk/externalpackages/autotools/install.sh
===================================================================
--- /issm/trunk/externalpackages/autotools/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/autotools/install.sh	(revision 24313)
@@ -2,22 +2,12 @@
 set -eu
 
+#Version numbers
+M4_VER="1.4.17"
 AUTOCONF_VER="2.69"
-AUTOMAKE_MIN_VER="1.16"
-AUTOMAKE_BUILD_VER="${AUTOMAKE_MIN_VER}.1"
+AUTOMAKE_VER="1.16.1"
 LIBTOOL_VER="2.4.2"
-M4_VER="1.4.17"
 
-AUTOCONF="autoconf-${AUTOCONF_VER}"
-AUTOMAKE="automake-${AUTOMAKE_BUILD_VER}"
-LIBTOOL="libtool-${LIBTOOL_VER}"
-M4="m4-${M4_VER}"
-
-AUTOCONF_TARBALL="${AUTOCONF}.tar.gz"
-AUTOMAKE_TARBALL="${AUTOMAKE}.tar.gz"
-LIBTOOL_TARBALL="${LIBTOOL}.tar.gz"
-M4_TARBALL="${M4}.tar.gz"
-
-# Clean up existing assets
-rm -rf install
+# Clean up existing directories
+rm -rf install src
 
 # Set up for installation
@@ -27,9 +17,7 @@
 # Install m4
 echo " === INSTALLING M4 =="
-rm -rf src
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${M4_TARBALL}" $M4_TARBALL
-tar -zxvf $M4_TARBALL
-rm -f $M4_TARBALL
-mv $M4 src
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/m4-$M4_VER.tar.gz" "m4-$M4_VER.tar.gz"
+tar -zxvf m4-$M4_VER.tar.gz
+mv m4-$M4_VER src
 cd src
 ./configure --prefix="$ISSM_DIR/externalpackages/autotools/install"
@@ -38,40 +26,38 @@
 cd ..
 
-# Install autoconf
+#install autoconf
 echo " === INSTALLING AUTOCONF =="
 rm -rf src
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${AUTOCONF_TARBALL}" $AUTOCONF_TARBALL
-tar -zxvf $AUTOCONF_TARBALL
-rm -f $AUTOCONF_TARBALL
-mv $AUTOCONF src
-cd src
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/autoconf-$AUTOCONF_VER.tar.gz" "autoconf-$AUTOCONF_VER.tar.gz"
+tar -zxvf autoconf-$AUTOCONF_VER.tar.gz
+mv autoconf-$AUTOCONF_VER src
+cd src 
+./configure --prefix="$ISSM_DIR/externalpackages/autotools/install" 
+make
+make install
+cd ..
+
+#install automake
+echo " === INSTALLING AUTOMAKE =="
+rm -rf src
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/automake-$AUTOMAKE_VER.tar.gz" "automake-$AUTOMAKE_VER.tar.gz"
+tar -zxvf  automake-$AUTOMAKE_VER.tar.gz
+mv automake-$AUTOMAKE_VER src
+cd src 
+./configure --prefix="$ISSM_DIR/externalpackages/autotools/install" 
+make
+make install
+cd ..
+
+#install libtool
+echo " === INSTALLING LIBTOOL =="
+rm -rf src
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/libtool-$LIBTOOL_VER.tar.gz" "libtool-$LIBTOOL_VER.tar.gz"
+tar -zxvf  libtool-$LIBTOOL_VER.tar.gz
+rm libtool-$LIBTOOL_VER.tar.gz
+mv libtool-$LIBTOOL_VER src
+cd src 
 ./configure --prefix="$ISSM_DIR/externalpackages/autotools/install"
 make
 make install
 cd ..
-
-# Install automake
-echo " === INSTALLING AUTOMAKE =="
-rm -rf src
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${AUTOMAKE_TARBALL}" $AUTOMAKE_TARBALL
-tar -zxvf $AUTOMAKE_TARBALL
-rm -f $AUTOMAKE_TARBALL
-mv $AUTOMAKE src
-cd src
-./configure --prefix="$ISSM_DIR/externalpackages/autotools/install"
-make
-make install
-cd ..
-
-# Install libtool
-echo " === INSTALLING LIBTOOL =="
-rm -rf src
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${LIBTOOL_TARBALL}" $LIBTOOL_TARBALL
-tar -zxvf $LIBTOOL_TARBALL
-rm -f $LIBTOOL_TARBALL
-mv $LIBTOOL src
-cd src
-./configure --prefix="$ISSM_DIR/externalpackages/autotools/install"
-make
-make install
-cd ..
Index: /issm/trunk/externalpackages/bbftp/install.sh
===================================================================
--- /issm/trunk/externalpackages/bbftp/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/bbftp/install.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/bbftp-client-3.2.0.tar.gz' 'bbftp-client-3.2.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/bbftp-client-3.2.0.tar.gz' 'bbftp-client-3.2.0.tar.gz'
 
 #Create install directories
Index: /issm/trunk/externalpackages/blas/install-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/blas/install-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/blas/install-linux64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/blas.tgz' 'blas.tgz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/blas.tgz' 'blas.tgz'
 
 #Untar 
Index: /issm/trunk/externalpackages/blas/install-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/blas/install-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/blas/install-macosx64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/blas.tgz' 'blas.tgz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/blas.tgz' 'blas.tgz'
 
 #Untar 
Index: /issm/trunk/externalpackages/boost/configs/1.55/ordered_index.hpp.patch
===================================================================
--- /issm/trunk/externalpackages/boost/configs/1.55/ordered_index.hpp.patch	(revision 24313)
+++ /issm/trunk/externalpackages/boost/configs/1.55/ordered_index.hpp.patch	(revision 24313)
@@ -0,0 +1,4 @@
+270c270
+<   reverse_iterator       rbegin(){return make_reverse_iterator(end());}
+---
+>   reverse_iterator       rbegin(){return boost::make_reverse_iterator(end());}
Index: /issm/trunk/externalpackages/boost/install-1.49-linux.sh
===================================================================
--- /issm/trunk/externalpackages/boost/install-1.49-linux.sh	(revision 24312)
+++ /issm/trunk/externalpackages/boost/install-1.49-linux.sh	(revision 24313)
@@ -13,5 +13,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/boost_1_49_0.tar.gz' 'boost_1_49_0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/boost_1_49_0.tar.gz' 'boost_1_49_0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/boost/install-1.49-macosx-snowleopard.sh
===================================================================
--- /issm/trunk/externalpackages/boost/install-1.49-macosx-snowleopard.sh	(revision 24312)
+++ /issm/trunk/externalpackages/boost/install-1.49-macosx-snowleopard.sh	(revision 24313)
@@ -12,5 +12,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/boost_1_49_0.tar.gz' 'boost_1_49_0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/boost_1_49_0.tar.gz' 'boost_1_49_0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/boost/install-1.55-discover.sh
===================================================================
--- /issm/trunk/externalpackages/boost/install-1.55-discover.sh	(revision 24312)
+++ /issm/trunk/externalpackages/boost/install-1.55-discover.sh	(revision 24313)
@@ -13,5 +13,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/boost/install-1.55-linux.sh
===================================================================
--- /issm/trunk/externalpackages/boost/install-1.55-linux.sh	(revision 24312)
+++ /issm/trunk/externalpackages/boost/install-1.55-linux.sh	(revision 24313)
@@ -14,5 +14,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/boost/install-1.55-lonestar.sh
===================================================================
--- /issm/trunk/externalpackages/boost/install-1.55-lonestar.sh	(revision 24312)
+++ /issm/trunk/externalpackages/boost/install-1.55-lonestar.sh	(revision 24313)
@@ -13,5 +13,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
 
 #Untar 
@@ -37,2 +37,6 @@
 mkdir ../install/bin
 cp bjam ../install/bin
+
+cd ../
+
+patch install/include/boost/multi_index/ordered_index.hpp ./configs/1.55/ordered_index.hpp.patch
Index: /issm/trunk/externalpackages/boost/install-1.55-macosx-el_capitan.sh
===================================================================
--- /issm/trunk/externalpackages/boost/install-1.55-macosx-el_capitan.sh	(revision 24312)
+++ /issm/trunk/externalpackages/boost/install-1.55-macosx-el_capitan.sh	(revision 24313)
@@ -2,9 +2,9 @@
 set -eu
 
-#Note of caution:  stop after boostrap phase, and run 
-#bjam --debug-configuration, to figure out which paths boost is using to include 
-#python. make sure everyone of these paths is covered by python. If not, just make 
-#symlinks in externalpackages/python to what boost is expecting. Ther is NO WAY 
-#to get the boost library to include python support without doing that. 
+#Note of caution:  stop after boostrap phase, and run
+#bjam --debug-configuration, to figure out which paths boost is using to include
+#python. make sure everyone of these paths is covered by python. If not, just make
+#symlinks in externalpackages/python to what boost is expecting. Ther is NO WAY
+#to get the boost library to include python support without doing that.
 
 #Some cleanup
@@ -13,7 +13,7 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
 
-#Untar 
+#Untar
 tar -zxvf  boost_1_55_0.tar.gz
 
@@ -29,16 +29,16 @@
 
 #Configure and compile
-cd src 
+cd src
 ./bootstrap.sh \
 	--prefix="$ISSM_DIR/externalpackages/boost/install" \
-	--with-python=python 
+	--with-python=python
 
 #Compile boost
 # Need gcc with iconv installed in a location that has been added to your path
-# export CC=/usr/local/gfortan/bin/gcc 
+# export CC=/usr/local/gfortan/bin/gcc
 # export CXX=/usr/local/gfortran/bin/g++
 ./bjam toolset=darwin link=static install
 
-#put bjam into install also: 
+#put bjam into install also:
 mkdir ../install/bin
 cp bjam ../install/bin
Index: /issm/trunk/externalpackages/boost/install-1.55-macosx-mavericks.sh
===================================================================
--- /issm/trunk/externalpackages/boost/install-1.55-macosx-mavericks.sh	(revision 24312)
+++ /issm/trunk/externalpackages/boost/install-1.55-macosx-mavericks.sh	(revision 24313)
@@ -13,5 +13,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/boost/install-1.55-macosx-snowleopard.sh
===================================================================
--- /issm/trunk/externalpackages/boost/install-1.55-macosx-snowleopard.sh	(revision 24312)
+++ /issm/trunk/externalpackages/boost/install-1.55-macosx-snowleopard.sh	(revision 24313)
@@ -13,5 +13,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/boost/install-1.55-macosx-yosemite.sh
===================================================================
--- /issm/trunk/externalpackages/boost/install-1.55-macosx-yosemite.sh	(revision 24312)
+++ /issm/trunk/externalpackages/boost/install-1.55-macosx-yosemite.sh	(revision 24313)
@@ -13,5 +13,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/boost/install-1.55-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/boost/install-1.55-pleiades.sh	(revision 24312)
+++ /issm/trunk/externalpackages/boost/install-1.55-pleiades.sh	(revision 24313)
@@ -13,5 +13,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/boost/install-1.55-stallo.sh
===================================================================
--- /issm/trunk/externalpackages/boost/install-1.55-stallo.sh	(revision 24313)
+++ /issm/trunk/externalpackages/boost/install-1.55-stallo.sh	(revision 24313)
@@ -0,0 +1,45 @@
+#!/bin/bash
+set -eu
+
+#Note of caution:  stop after boostrap phase, and run 
+#bjam --debug-configuration, to figure out which paths boost is using to include 
+#python. make sure everyone of these paths is covered by python. If not, just make 
+#symlinks in externalpackages/python to what boost is expecting. Ther is NO WAY 
+#to get the boost library to include python support without doing that. 
+
+#Some cleanup
+rm -rf install boost_1_55_0 src
+mkdir install src
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
+
+#Untar 
+tar -zxvf  boost_1_55_0.tar.gz
+
+#Move boost into install directory
+mv boost_1_55_0/* src
+rm -rf boost_1_55_0
+
+patch src/boost/mpl/aux_/config/adl.hpp ./configs/1.55/adl.hpp.patch
+
+#Setting CXXFLAGS to deal with C++11 incompatibility with Matlab's Boost
+#export PATH="/usr/bin":$PATH
+export CXXFLAGS='-std=c++98'
+export CC=mpicc
+export CXX=mpicxx
+
+#Configure and compile
+cd src 
+./bootstrap.sh \
+	--prefix="$ISSM_DIR/externalpackages/boost/install" \
+	--with-python=python3.2 
+
+#Compile boost
+#./bjam install
+./bjam install
+
+#put bjam into install also: 
+mkdir ../install/bin
+cp bjam ../install/bin
+
Index: /issm/trunk/externalpackages/bsdtar/install-win7.sh
===================================================================
--- /issm/trunk/externalpackages/bsdtar/install-win7.sh	(revision 24312)
+++ /issm/trunk/externalpackages/bsdtar/install-win7.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/libarchive-3.0.3.tar.gz' 'libarchive-3.0.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/libarchive-3.0.3.tar.gz' 'libarchive-3.0.3.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/cccl/install-win7.orig.sh
===================================================================
--- /issm/trunk/externalpackages/cccl/install-win7.orig.sh	(revision 24312)
+++ /issm/trunk/externalpackages/cccl/install-win7.orig.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/cccl-0.03.tar.gz' 'cccl-0.03.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/cccl-0.03.tar.gz' 'cccl-0.03.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/chaco/install-macosx64-sierra.sh
===================================================================
--- /issm/trunk/externalpackages/chaco/install-macosx64-sierra.sh	(revision 24312)
+++ /issm/trunk/externalpackages/chaco/install-macosx64-sierra.sh	(revision 24313)
@@ -9,6 +9,6 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/Chaco-2.2.tar.gz' 'Chaco-2.2.tar.gz'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/docs/chaco_guide.pdf' 'chaco_guide.pdf'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Chaco-2.2.tar.gz' 'Chaco-2.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/chaco_guide.pdf' 'chaco_guide.pdf'
 
 # Untar 
Index: /issm/trunk/externalpackages/chaco/install-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/chaco/install-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/chaco/install-macosx64.sh	(revision 24313)
@@ -9,6 +9,6 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/Chaco-2.2.tar.gz' 'Chaco-2.2.tar.gz'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/docs/chaco_guide.pdf' 'chaco_guide.pdf'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Chaco-2.2.tar.gz' 'Chaco-2.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/chaco_guide.pdf' 'chaco_guide.pdf'
 
 # Untar 
Index: /issm/trunk/externalpackages/chaco/install.sh
===================================================================
--- /issm/trunk/externalpackages/chaco/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/chaco/install.sh	(revision 24313)
@@ -9,6 +9,6 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/Chaco-2.2.tar.gz' 'Chaco-2.2.tar.gz'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/docs/chaco_guide.pdf' 'chaco_guide.pdf'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Chaco-2.2.tar.gz' 'Chaco-2.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/chaco_guide.pdf' 'chaco_guide.pdf'
 
 # Untar 
Index: /issm/trunk/externalpackages/cmake/configs/MacOS/High_Sierra/Source/CPack/cmCPackDragNDropGenerator.cxx.patch
===================================================================
--- /issm/trunk/externalpackages/cmake/configs/MacOS/High_Sierra/Source/CPack/cmCPackDragNDropGenerator.cxx.patch	(revision 24313)
+++ /issm/trunk/externalpackages/cmake/configs/MacOS/High_Sierra/Source/CPack/cmCPackDragNDropGenerator.cxx.patch	(revision 24313)
@@ -0,0 +1,9 @@
+--- Source/CPack/cmCPackDragNDropGenerator.cxx_orig	2017-08-29 08:45:50.000000000 +0200
++++ Source/CPack/cmCPackDragNDropGenerator.cxx	2017-08-29 08:46:04.000000000 +0200
+@@ -12,6 +12,7 @@
+ #include <iomanip>
+ #include <map>
+ #include <stdlib.h>
++#include <algorithm>
+
+ #include <CoreFoundation/CoreFoundation.h>
Index: /issm/trunk/externalpackages/cmake/configs/MacOS/High_Sierra/Utilities/cmcurl/CMakeLists.txt.patch
===================================================================
--- /issm/trunk/externalpackages/cmake/configs/MacOS/High_Sierra/Utilities/cmcurl/CMakeLists.txt.patch	(revision 24313)
+++ /issm/trunk/externalpackages/cmake/configs/MacOS/High_Sierra/Utilities/cmcurl/CMakeLists.txt.patch	(revision 24313)
@@ -0,0 +1,11 @@
+--- Utilities/cmcurl/CMakeLists.txt_orig	2017-08-29 08:37:31.000000000 +0200
++++ Utilities/cmcurl/CMakeLists.txt	2017-08-29 08:37:55.000000000 +0200
+@@ -50,7 +50,7 @@
+       )
+   endif()
+   if(NOT OSX_VERSION VERSION_LESS 10.6 AND
+-      CMAKE_C_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
++      CMAKE_C_COMPILER_ID MATCHES "Clang|AppleClang")
+     set(CMAKE_USE_DARWINSSL ON CACHE INTERNAL "enable Apple OS native SSL/TLS")
+   else()
+     set(CMAKE_USE_DARWINSSL OFF CACHE INTERNAL "enable Apple OS native SSL/TLS")
Index: /issm/trunk/externalpackages/cmake/install-macosx64-highsierra.sh
===================================================================
--- /issm/trunk/externalpackages/cmake/install-macosx64-highsierra.sh	(revision 24313)
+++ /issm/trunk/externalpackages/cmake/install-macosx64-highsierra.sh	(revision 24313)
@@ -0,0 +1,28 @@
+#!/bin/bash
+set -eu
+VER="3.14.5"
+
+#Some cleanup
+rm -rf install cmake-$VER.tar.gz
+mkdir install
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/cmake-$VER.tar.gz" "cmake-$VER.tar.gz"
+
+#Untar
+tar -zxvf cmake-$VER.tar.gz
+
+#Move cmake into install directory
+mv cmake-$VER/* install
+rm -rf cmake-$VER
+
+#Compile cmake
+cd install
+./bootstrap --prefix=$ISSM_DIR/externalpackages/cmake/install
+
+if [ $# -eq 0 ]; then
+	make
+else
+	make -j $1;
+fi
+make install
Index: /issm/trunk/externalpackages/cmake/install-macosx64-snowleopard.sh
===================================================================
--- /issm/trunk/externalpackages/cmake/install-macosx64-snowleopard.sh	(revision 24312)
+++ /issm/trunk/externalpackages/cmake/install-macosx64-snowleopard.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/cmake-$VER.tar.gz" "cmake-$VER.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/cmake-$VER.tar.gz" "cmake-$VER.tar.gz"
 
 #Untar 
Index: /issm/trunk/externalpackages/cmake/install.sh
===================================================================
--- /issm/trunk/externalpackages/cmake/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/cmake/install.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/cmake-$VER.tar.gz" "cmake-$VER.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/cmake-$VER.tar.gz" "cmake-$VER.tar.gz"
 
 #Untar 
Index: /issm/trunk/externalpackages/colpack/install.sh
===================================================================
--- /issm/trunk/externalpackages/colpack/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/colpack/install.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/ColPack-1.0.3.tar.gz' 'ColPack-1.0.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/ColPack-1.0.3.tar.gz' 'ColPack-1.0.3.tar.gz'
 
 #install directory
Index: /issm/trunk/externalpackages/cppcheck/install.sh
===================================================================
--- /issm/trunk/externalpackages/cppcheck/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/cppcheck/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/cppcheck-1.48.tar' 'cppcheck-1.48.tar'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/cppcheck-1.48.tar' 'cppcheck-1.48.tar'
 tar -xvf cppcheck-1.48.tar
 
Index: /issm/trunk/externalpackages/curl/install-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/curl/install-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/curl/install-macosx64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/curl-7.39.0.tar.gz' 'curl-7.39.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/curl-7.39.0.tar.gz' 'curl-7.39.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/cvs/install.sh
===================================================================
--- /issm/trunk/externalpackages/cvs/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/cvs/install.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/cvs-1.11.23.tar.gz' 'cvs-1.11.23.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/cvs-1.11.23.tar.gz' 'cvs-1.11.23.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/cython/install-18.sh
===================================================================
--- /issm/trunk/externalpackages/cython/install-18.sh	(revision 24312)
+++ /issm/trunk/externalpackages/cython/install-18.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #download numpy first
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/Cython-0.18.tar.gz' 'cython.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Cython-0.18.tar.gz' 'cython.tar.gz'
 
 #install numpy
Index: /issm/trunk/externalpackages/cython/install-19.2.sh
===================================================================
--- /issm/trunk/externalpackages/cython/install-19.2.sh	(revision 24312)
+++ /issm/trunk/externalpackages/cython/install-19.2.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #download numpy first
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/Cython-0.19.2.tar.gz' 'cython.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Cython-0.19.2.tar.gz' 'cython.tar.gz'
 
 #install numpy
Index: /issm/trunk/externalpackages/cython/install-22.sh
===================================================================
--- /issm/trunk/externalpackages/cython/install-22.sh	(revision 24312)
+++ /issm/trunk/externalpackages/cython/install-22.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #download numpy first
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/Cython-0.22.tar.gz' 'cython.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Cython-0.22.tar.gz' 'cython.tar.gz'
 
 #install numpy
Index: /issm/trunk/externalpackages/cython/install-26.sh
===================================================================
--- /issm/trunk/externalpackages/cython/install-26.sh	(revision 24312)
+++ /issm/trunk/externalpackages/cython/install-26.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #download numpy first
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/Cython-0.26.tar.gz' 'cython.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Cython-0.26.tar.gz' 'cython.tar.gz'
 
 #install numpy
Index: /issm/trunk/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.aurora.patch
===================================================================
--- /issm/trunk/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.aurora.patch	(revision 24313)
+++ /issm/trunk/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.aurora.patch	(revision 24313)
@@ -0,0 +1,38 @@
+54,55c54,55
+< #set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} <flag>"
+< #     CACHE STRING "CXX Flags for my platform" )
+---
+> set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMPICH_IGNORE_CXX_SEEK"
+>      CACHE STRING "CXX Flags for my platform" )
+67a68,78
+> set( DAKOTA_HAVE_MPI ON
+>  CACHE BOOL "Always build with MPI enabled" FORCE)
+> set( MPI_INCLUDE_PATH
+>  "$ENV{ISSM_DIR}/externalpackages/mpich/install/include"
+>  CACHE FILEPATH "Use installed MPI headers" FORCE)
+> set( MPI_LIBRARY
+>  "$ENV{ISSM_DIR}/externalpackages/mpich/install/lib/libmpich.so"
+>  CACHE FILEPATH "Use installed MPI library" FORCE)
+> set( MPI_EXTRA_LIBRARY
+>  "$ENV{ISSM_DIR}/externalpackages/mpich/install/lib/libmpich.so"
+>	CACHE FILEPATH "Use MPI extra libraries" FORCE)
+73,77c73,77
+< #set(BOOST_ROOT
+< #    "path/to/custom/Boost/install/directory"
+< #    CACHE PATH "Use non-standard Boost install" FORCE)
+< #set( Boost_NO_SYSTEM_PATHS TRUE
+< #     CACHE BOOL "Supress search paths other than BOOST_ROOT" FORCE)
+---
+> set(BOOST_ROOT
+>     "$ENV{ISSM_DIR}/externalpackages/boost/install"
+>     CACHE PATH "Use non-standard Boost install" FORCE)
+> set( Boost_NO_SYSTEM_PATHS TRUE
+>      CACHE BOOL "Supress search paths other than BOOST_ROOT" FORCE)
+91,93c91,93
+< #set( CMAKE_INSTALL_PREFIX
+< #     "/path/to/Dakota/installation"
+< #     CACHE PATH "Path to Dakota installation" )
+---
+> set( CMAKE_INSTALL_PREFIX
+>      "$ENV{ISSM_DIR}/externalpackages/dakota/install"
+>      CACHE PATH "Path to Dakota installation" )
Index: /issm/trunk/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.stallo.patch
===================================================================
--- /issm/trunk/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.stallo.patch	(revision 24313)
+++ /issm/trunk/externalpackages/dakota/configs/6.2/BuildDakotaCustom.cmake.stallo.patch	(revision 24313)
@@ -0,0 +1,42 @@
+52,55c52,55
+< #set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} <flag>" 
+< #     CACHE STRING "C Flags my platform" )
+< #set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} <flag>"
+< #     CACHE STRING "CXX Flags for my platform" )
+---
+> set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -L/lib64/libc.so.6 -L/lib64/ -lpthread -ldl -lm" 
+>      CACHE STRING "C Flags my platform" )
+> set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -L/lib64/libc.so.6 -L/lib64/ -lpthread -ldl -lm"
+>      CACHE STRING "CXX Flags for my platform" )
+67a68,78
+> set( DAKOTA_HAVE_MPI ON
+>  CACHE BOOL "Always build with MPI enabled" FORCE)
+> set( MPI_INCLUDE_PATH
+>  "/global/hds/software/cpu/eb3/impi/5.0.3.048-iccifort-2015.3.187-GNU-4.9.3-2.25/include64/"
+>  CACHE FILEPATH "Use installed MPI headers" FORCE)
+> set( MPI_LIBRARY
+>  "/global/hds/software/cpu/eb3/impi/5.0.3.048-iccifort-2015.3.187-GNU-4.9.3-2.25/lib64/libmpi.so"
+>  CACHE FILEPATH "Use installed MPI library" FORCE)
+> set( MPI_EXTRA_LIBRARY
+>  "/global/hds/software/cpu/eb3/impi/5.0.3.048-iccifort-2015.3.187-GNU-4.9.3-2.25/lib64/libmpi.so"
+> CACHE FILEPATH "Use MPI extra libraries" FORCE)
+73,77c84,88
+< #set(BOOST_ROOT
+< #    "path/to/custom/Boost/install/directory"
+< #    CACHE PATH "Use non-standard Boost install" FORCE)
+< #set( Boost_NO_SYSTEM_PATHS TRUE
+< #     CACHE BOOL "Supress search paths other than BOOST_ROOT" FORCE)
+---
+> set(BOOST_ROOT
+>     "$ENV{ISSM_DIR}/externalpackages/boost/install"
+>     CACHE PATH "Use non-standard Boost install" FORCE)
+> set( Boost_NO_SYSTEM_PATHS TRUE
+>      CACHE BOOL "Supress search paths other than BOOST_ROOT" FORCE)
+91,93c102,104
+< #set( CMAKE_INSTALL_PREFIX
+< #     "/path/to/Dakota/installation"
+< #     CACHE PATH "Path to Dakota installation" )
+---
+> set( CMAKE_INSTALL_PREFIX
+>      "$ENV{ISSM_DIR}/externalpackages/dakota/install"
+>      CACHE PATH "Path to Dakota installation" )
Index: /issm/trunk/externalpackages/dakota/configs/6.2/CMakeLists.txt.aurora.patch
===================================================================
--- /issm/trunk/externalpackages/dakota/configs/6.2/CMakeLists.txt.aurora.patch	(revision 24313)
+++ /issm/trunk/externalpackages/dakota/configs/6.2/CMakeLists.txt.aurora.patch	(revision 24313)
@@ -0,0 +1,6 @@
+156c153,155
+< # TODO: Can't this be integrated into the following logic?
+---
+> # TODO: Can't this be integrated into the following logic?
+> set(BLAS_LIBS "-L/opt/intel/composer_xe_2013.5.192/mkl/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -L/usr/lib64/ -lpthread -lm")
+> set(LAPACK_LIBS "-L/opt/intel/composer_xe_2013.5.192/mkl/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -L/usr/lib64/ -lpthread -lm")
Index: /issm/trunk/externalpackages/dakota/configs/6.2/CMakeLists.txt.lonestar.patch
===================================================================
--- /issm/trunk/externalpackages/dakota/configs/6.2/CMakeLists.txt.lonestar.patch	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/configs/6.2/CMakeLists.txt.lonestar.patch	(revision 24313)
@@ -3,4 +3,4 @@
 ---
 > # TODO: Can't this be integrated into the following logic?
-> set(BLAS_LIBS "-L/opt/apps/intel/11.1/mkl/lib/em64t/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -L/usr/lib64/ -lpthread -lm")
-> set(LAPACK_LIBS "-L/opt/apps/intel/11.1/mkl/lib/em64t/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -L/usr/lib64/ -lpthread -lm")
+> set(BLAS_LIBS "-L$TACC_MKL_LIB -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm")
+> set(LAPACK_LIBS "-L$TACC_MKL_LIB -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm")
Index: /issm/trunk/externalpackages/dakota/configs/6.2/CMakeLists.txt.stallo.patch
===================================================================
--- /issm/trunk/externalpackages/dakota/configs/6.2/CMakeLists.txt.stallo.patch	(revision 24313)
+++ /issm/trunk/externalpackages/dakota/configs/6.2/CMakeLists.txt.stallo.patch	(revision 24313)
@@ -0,0 +1,9 @@
+229c229,231
+< option(BUILD_SHARED_LIBS "Build shared libraries?" ON)
+---
+> option(BUILD_SHARED_LIBS "Build shared libraries?" ON)
+> find_package(Threads)
+> 
+237a240,241
+> set(BLAS_LIBS "-Wl,--no-as-needed -L/global/hds/software/cpu/eb3/imkl/11.2.3.187-iimpi-7.3.5-GNU-4.9.3-2.25/mkl/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -L/lib64/libc.so.6 -L/lib64/ -lpthread -lm -ldl")
+> set(LAPACK_LIBS "-Wl,--no-as-needed -L/global/hds/software/cpu/eb3/imkl/11.2.3.187-iimpi-7.3.5-GNU-4.9.3-2.25/mkl/lib/intel64/ -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -L/lib64/libc.so.6 -L/lib64/ -lpthread -lm -ldl")
Index: /issm/trunk/externalpackages/dakota/configs/6.2/DakotaInterface.patch
===================================================================
--- /issm/trunk/externalpackages/dakota/configs/6.2/DakotaInterface.patch	(revision 24313)
+++ /issm/trunk/externalpackages/dakota/configs/6.2/DakotaInterface.patch	(revision 24313)
@@ -0,0 +1,16 @@
+112c112
+<       Cerr << "\nError: failure opening " << ampl_col << std::endl;
+---
+>       Cerr << "\nError: failure opening " << col.c_str() << std::endl;
+121c121
+< 	Cerr << "\nError: failure reading AMPL col file " << ampl_col 
+---
+> 	Cerr << "\nError: failure reading AMPL col file " << col.c_str() 
+129c129
+<       Cerr << "\nError: failure opening " << ampl_row << std::endl;
+---
+>       Cerr << "\nError: failure opening " << row.c_str() << std::endl;
+142c142
+< 	Cerr << "\nError: failure reading AMPL row file " << ampl_row 
+---
+> 	Cerr << "\nError: failure reading AMPL row file " << row.c_str()
Index: /issm/trunk/externalpackages/dakota/configs/6.2/MainEffectsExcelOutput.patch
===================================================================
--- /issm/trunk/externalpackages/dakota/configs/6.2/MainEffectsExcelOutput.patch	(revision 24313)
+++ /issm/trunk/externalpackages/dakota/configs/6.2/MainEffectsExcelOutput.patch	(revision 24313)
@@ -0,0 +1,4 @@
+276c276
+< 	     std::cout << ss << std::endl;
+---
+> 	     std::cout << ss.str() << std::endl;
Index: /issm/trunk/externalpackages/dakota/configs/6.2/NKM_KrigingModel.patch
===================================================================
--- /issm/trunk/externalpackages/dakota/configs/6.2/NKM_KrigingModel.patch	(revision 24313)
+++ /issm/trunk/externalpackages/dakota/configs/6.2/NKM_KrigingModel.patch	(revision 24313)
@@ -0,0 +1,6 @@
+9d8
+< 
+86c85
+< 	      << "has not been implemented." << std::cerr;
+---
+> 	      << "has not been implemented." << std::endl;
Index: /issm/trunk/externalpackages/dakota/install-4.2-altix64-cosmos.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-4.2-altix64-cosmos.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-4.2-altix64-cosmos.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/Dakota_4_3.src.tar.gz' 'Dakota_4_3.src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_4_3.src.tar.gz' 'Dakota_4_3.src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-4.2-discover.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-4.2-discover.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-4.2-discover.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/Dakota_4_3.src.tar.gz' 'Dakota_4_3.src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_4_3.src.tar.gz' 'Dakota_4_3.src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-4.2-linux64-cloud.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-4.2-linux64-cloud.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-4.2-linux64-cloud.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/Dakota_4_3.src.tar.gz' 'Dakota_4_3.src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_4_3.src.tar.gz' 'Dakota_4_3.src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-4.2-linux64-murdo.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-4.2-linux64-murdo.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-4.2-linux64-murdo.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/Dakota_4_3.src.tar.gz' 'Dakota_4_3.src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_4_3.src.tar.gz' 'Dakota_4_3.src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-4.2-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-4.2-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-4.2-macosx64.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/Dakota_4_3.src.tar.gz' 'Dakota_4_3.src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_4_3.src.tar.gz' 'Dakota_4_3.src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-5.2-discover.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.2-discover.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-5.2-discover.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/Dakota_5_2.src.tar.gz' 'Dakota_5_2.src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_5_2.src.tar.gz' 'Dakota_5_2.src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-5.2-linux64-caladan.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.2-linux64-caladan.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-5.2-linux64-caladan.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/Dakota_5_2.src.tar.gz' 'Dakota_5_2.src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_5_2.src.tar.gz' 'Dakota_5_2.src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-5.2-linux64-larsen.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.2-linux64-larsen.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-5.2-linux64-larsen.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/Dakota_5_2.src.tar.gz' 'Dakota_5_2.src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_5_2.src.tar.gz' 'Dakota_5_2.src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-5.2-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.2-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-5.2-macosx64.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/Dakota_5_2.src.tar.gz' 'Dakota_5_2.src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/Dakota_5_2.src.tar.gz' 'Dakota_5_2.src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-5.3.1-linux64-caladan.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.3.1-linux64-caladan.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-5.3.1-linux64-caladan.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-5.3.1-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.3.1-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-5.3.1-linux64.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-5.3.1-lonestar.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.3.1-lonestar.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-5.3.1-lonestar.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-5.3.1-macosx64-snowleopard.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.3.1-macosx64-snowleopard.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-5.3.1-macosx64-snowleopard.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-5.3.1-macosx64-yosemite.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.3.1-macosx64-yosemite.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-5.3.1-macosx64-yosemite.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-5.3.1-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-5.3.1-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-5.3.1-macosx64.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-6.2-aurora.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-aurora.sh	(revision 24313)
+++ /issm/trunk/externalpackages/dakota/install-6.2-aurora.sh	(revision 24313)
@@ -0,0 +1,58 @@
+#!/bin/bash
+set -eu
+
+#Some cleanup
+rm -rf Dakota
+rm -rf src 
+rm -rf build 
+rm -rf install 
+mkdir src build install 
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
+
+#Untar 
+tar -zxvf dakota-6.2-public-src.tar.gz
+
+#Move Dakota to src directory
+mv dakota-6.2.0.src/* src
+rm -rf dakota-6.2.0.src
+
+#Set up Dakota cmake variables and config
+export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
+export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
+export MPIHOME=$ISSM_DIR/externalpackages/mpich/install
+cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
+patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/6.2/BuildDakotaCustom.cmake.aurora.patch
+patch $DAK_SRC/cmake/DakotaDev.cmake configs/6.2/DakotaDev.cmake.patch
+patch $DAK_SRC/CMakeLists.txt configs/6.2/CMakeLists.txt.aurora.patch
+
+#Apply patches
+patch src/src/NonDSampling.cpp configs/6.2/NonDSampling.cpp.patch
+patch src/src/NonDLocalReliability.cpp configs/6.2/NonDLocalReliability.cpp.patch
+patch src/packages/pecos/src/pecos_global_defs.hpp configs/6.2/pecos_global_defs.hpp.patch
+
+#Configure dakota
+cd $DAK_BUILD
+
+cmake -D CMAKE_C_COMPILER=/opt/intel/impi/4.1.3/intel64/bin/mpicc \
+	   -D CMAKE_CXX_COMPILER=/opt/intel/impi/4.1.3/intel64/bin/mpicxx \
+	   -D CMAKE_Fortran_COMPILER=/usr/bin/gfortran \
+		-DHAVE_ACRO=off \
+		-DHAVE_JEGA=off \
+		-C $DAK_SRC/cmake/BuildDakotaCustom.cmake \
+		-C $DAK_SRC/cmake/DakotaDev.cmake \
+		$DAK_SRC
+cd ..
+
+#Compile and install dakota
+cd $DAK_BUILD
+if [ $# -eq 0 ];
+then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+cd ..
Index: /issm/trunk/externalpackages/dakota/install-6.2-intel15-discover.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-intel15-discover.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-6.2-intel15-discover.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-6.2-intel16-discover.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-intel16-discover.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-6.2-intel16-discover.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-6.2-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-6.2-linux64.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-6.2-lonestar.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-lonestar.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-6.2-lonestar.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
 
 #Untar 
@@ -22,5 +22,6 @@
 export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
 export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
-export MPIHOME=/opt/cray/mpt/default/gni/mpich-intel/14.0/
+export MPIHOME=/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/
+
 cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
 patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/6.2/BuildDakotaCustom.cmake.patch
@@ -32,11 +33,15 @@
 patch src/src/NonDLocalReliability.cpp configs/6.2/NonDLocalReliability.cpp.patch
 patch src/packages/pecos/src/pecos_global_defs.hpp configs/6.2/pecos_global_defs.hpp.patch
+patch src/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp configs/6.2/NKM_KrigingModel.patch
+patch src/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp configs/6.2/MainEffectsExcelOutput.patch
+patch src/src/DakotaInterface.cpp configs/6.2/DakotaInterface.patch
 
 #Configure dakota
 cd $DAK_BUILD
 
-cmake -D CMAKE_C_COMPILER=/opt/apps/intel16/cray_mpich/7.3.0/bin/mpicc \
-	   -D CMAKE_CXX_COMPILER=/opt/apps/intel16/cray_mpich/7.3.0/bin/mpicxx \
-	   -D CMAKE_Fortran_COMPILER=/opt/apps/intel16/cray_mpich/7.3.0/bin/mpif77 \
+cmake -D CMAKE_C_COMPILER=mpicc \
+	   -D CMAKE_CXX_COMPILER=mpicxx \
+	   -D CMAKE_Fortran_COMPILER=mpif77 \
+		-D MPIEXEC_EXECUTABLE=/opt/apps/tacc/bin/ibrun \
 		-DHAVE_ACRO=off \
 		-DHAVE_JEGA=off \
Index: /issm/trunk/externalpackages/dakota/install-6.2-macosx64-highsierra.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-macosx64-highsierra.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-6.2-macosx64-highsierra.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-6.2-macosx64-snowleopard.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-macosx64-snowleopard.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-6.2-macosx64-snowleopard.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-6.2-macosx64-yosemite.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-macosx64-yosemite.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-6.2-macosx64-yosemite.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-6.2-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-pleiades.sh	(revision 24312)
+++ /issm/trunk/externalpackages/dakota/install-6.2-pleiades.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/dakota/install-6.2-stallo.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-6.2-stallo.sh	(revision 24313)
+++ /issm/trunk/externalpackages/dakota/install-6.2-stallo.sh	(revision 24313)
@@ -0,0 +1,63 @@
+#!/bin/bash
+set -eu
+
+#Some cleanup
+rm -rf Dakota
+rm -rf src 
+rm -rf build 
+rm -rf install 
+mkdir src build install 
+
+#Download from ISSM server
+#$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/dakota-6.2-public.src.tar.gz' 'dakota-6.2-public-src.tar.gz'
+
+#Untar 
+tar -zxvf dakota-6.2-public-src.tar.gz
+
+#Move Dakota to src directory
+mv dakota-6.2.0.src/* src
+rm -rf dakota-6.2.0.src
+
+#Set up Dakota cmake variables and config
+#export PATH="/usr/bin":$PATH
+export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
+export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
+export MPIHOME=/global/hds/software/cpu/eb3/impi/5.0.3.048-iccifort-2015.3.187-GNU-4.9.3-2.25/
+
+cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
+patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/6.2/BuildDakotaCustom.cmake.stallo.patch
+patch $DAK_SRC/cmake/DakotaDev.cmake configs/6.2/DakotaDev.cmake.patch
+patch $DAK_SRC/CMakeLists.txt configs/6.2/CMakeLists.txt.stallo.patch
+
+#Apply patches
+patch src/src/NonDSampling.cpp configs/6.2/NonDSampling.cpp.patch
+patch src/src/NonDLocalReliability.cpp configs/6.2/NonDLocalReliability.cpp.patch
+patch src/packages/pecos/src/pecos_global_defs.hpp configs/6.2/pecos_global_defs.hpp.patch
+patch src/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp configs/6.2/NKM_KrigingModel.patch
+patch src/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp configs/6.2/MainEffectsExcelOutput.patch
+patch src/src/DakotaInterface.cpp configs/6.2/DakotaInterface.patch
+
+#Configure dakota
+cd $DAK_BUILD
+
+cmake -D CMAKE_C_COMPILER=/global/hds/software/cpu/eb3/impi/5.0.3.048-iccifort-2015.3.187-GNU-4.9.3-2.25/bin64/mpicc \
+	   -D CMAKE_CXX_COMPILER=/global/hds/software/cpu/eb3/impi/5.0.3.048-iccifort-2015.3.187-GNU-4.9.3-2.25/bin64/mpicxx \
+	   -D CMAKE_Fortran_COMPILER=gfortran \
+		-DHAVE_ACRO=off \
+		-DHAVE_JEGA=off \
+		-C $DAK_SRC/cmake/BuildDakotaCustom.cmake \
+		-C $DAK_SRC/cmake/DakotaDev.cmake \
+		$DAK_SRC
+cd ..
+
+#Compile and install dakota
+cd $DAK_BUILD
+if [ $# -eq 0 ];
+then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+cd ..
Index: /issm/trunk/externalpackages/dem/dem.m
===================================================================
--- /issm/trunk/externalpackages/dem/dem.m	(revision 24312)
+++ /issm/trunk/externalpackages/dem/dem.m	(revision 24313)
@@ -1,75 +1,225 @@
-function [h,I]=dem(x,y,z,varargin)
+function varargout=dem(x,y,z,varargin)
 %DEM Shaded relief image plot
+%
 %	DEM(X,Y,Z) plots the Digital Elevation Model defined by X and Y 
 %	coordinate vectors and elevation matrix Z, as a lighted image using
 %	specific "landcolor" and "seacolor" colormaps. DEM uses IMAGESC 
 %	function which is much faster than SURFL when dealing with large 
-%	high-resolution DEM.
-%
-%	DEM(X,Y,Z,OPT) specifies options with OPT = [A,C,SCUT,ZMIN,ZMAX,ZCUT],
-%	where sorted optional scalars are:
-%	  A = azimuth light (in degrees relative to North). Default is A = -45
-%	      for a natural northwestern illumination.
-%	  C = controls contrast, as the exponent of the gradient value. Default
-%	      is C = 1 for linear contrast; use C = 0 to remove lighting, 
-%	      C = 0.5 for moderate lighting, C = 2 or more for strong contrast.
-%	  SCUT = controls lighting scale saturation with a median-style filter
-%	      in % of elements. Default is SCUT = 0.2 (0.2% maximum gradient 
-%	      values is ignored). Use SCUT = 0 for full scale gradient.
-%	  ZMIN,ZMAX = fixes min and max elevation values for colormap. Use NaN
-%	      to keep real min and/or max data values.
-%	  ZCUT = median-style filter to cut extremes values (in % of elements).
-%	      Default is ZCUT = 0.5 to ignore the 0.5% of most min/max 
-%	      elevation values. Use ZCUT = 0 for full scale.
-%	Use OPT=[] to keep default values and define following arguments.
-%
-%	DEM(...,CMAP) uses CMAP colormap instead of default (landcolor, if 
-%	exists or jet). Note that defining CMAP disables the default SEACOLOR
-%	colormap attribution for Z<=0 elevations.
-%
-%	DEM(...,NOVALUE) defines the values that will be replaced by NaN. This 
-%	might be mandatory for DEM that use a value like -99999 or -32768 if 
-%	you don't want a flat image...
-%
-%	DEM(...,SEACOLOR) sets the colormap used for zero and negative values.
-%	Default is seacolor (if exists) or single color [0.7,0.9,1] (a light 
-%	cyan) to simulate sea color. Use [] to apply colormap CMAP on the full
-%	elevation scale.
-%
-%	DEM(...,'interp') interpolates linearly NaN values (fills the gaps).
-%
-%	DEM(...,'lake') detects automaticaly flat areas different from sea 
-%	level (non-zero elevations) and draws them as lake surfaces.
-%
-%	DEM(...,'dec') plots classic basemap-style axis, considering 
-%	coordinates as cartesian (decimal).
-%
-%	DEM(...,'dms') plots geographic basemap-style axis in deg/min/sec,
-%	considering coordinates X as longitude and Y as latitude. Axis aspect 
-%	ratio will be adjusted to approximatively preserve distances (this is  
-%	not a real projection!).
-%
-%	DEM(...,'scale') adds a legend to the right of graph, with elevation 
-%	scale (colormap) and a distance scale if 'dms' option is used.
-%
-%	[H,I]=DEM(...) returns graphic handle H and illuminated image as I, an
-%	MxNx3 matrix (if Z is MxN).
-%
-%	Informations:
-%	 - For optimization purpose, DEM will automatically decimate data to
-%	   limit to a total of 1500x1500 pixels images. To avoid it, use option
-%	   DEM(...,'nodecim') or DEM(...,'decim',N) where N is an integer, but 
-%	   be aware that large grids may require computer ressources and induce  
-%	   disk swap or memory errors.
-%	 - Colormaps are Mx3 RGB matrix so it is easy to modify saturation 
-%	   (CMAP.^N), set darker (CMAP/N), lighter ((N - 1 + CMAP)/N), inverse
-%	    it (flipud(CMAP)), etc...
-%	 - To get free worldwide topographic data (SRTM), see READHGT function.
+%	high-resolution DEM. It produces also high-quality and moderate-size 
+%	Postscript image adapted for publication.
+%
+%	DEM(X,Y,Z,'Param1',Value1,'Param2',Value2,...) specifies options or
+%	parameter/value couple (case insensitive):
+%
+%	[H,I] = DEM(...); returns graphic handle H and optional illuminated 
+%	image as I, a MxNx3 matrix (if Z is MxN and DECIM is 1).
+%
+%	I = DEM(...,'noplot') returns a structure I containing fields x, y, z,
+%	and illuminated image .rgb without producing a graph on current figure.
+%
+%
+%	--- Lighting options ---
+%
+%	'Azimuth',A
+%		Light azimuth in degrees clockwise relative to North. Default is
+%		A = -45 for	a natural northwestern illumination.
+%
+%	'Contrast',C
+%		Light contrast, as the exponent of the gradient value:
+%			C = 1 for linear contrast (default),
+%			C = 0 to remove lighting,
+%			C = 0.5 for moderate lighting,
+%			C = 2 or more for strong contrast.
+%
+%	'LCut',LC
+%		Lighting scale saturation cut with a median-style filter in % of 
+%	    elements, such as LC% of maximum gradient values are ignored:
+%			LC = 0.2 is default, 
+%			LC = 0 for full scale gradient.
+%
+%	'km'
+%		Stands that X and Y coordinates are in km instead of m (default).
+%		This allows correct lighting. Ignored if LATLON option is used.
+%
+%
+%	--- Elevation colorscale options ---
+%
+%	'ZLim',[ZMIN,ZMAX]
+%		Fixes min and max elevation values for colormap. Use NaN to keep 
+%		real min and/or max data values.
+%
+%	'ZCut',ZC
+%		Median-style filter to cut extremes values of Z (in % of elements),
+%		such that ZC% of most min/max elevation values are ignored in the
+%		colormap application:
+%			ZC = 0.5 is default, 
+%			ZC = 0 for full scale.
+%
+%
+%	--- "No Value" elevation options ---
+%
+%	'NoValue',NOVALUE
+%		Defines the values that will be replaced by NaN. Note that values 
+%		equal to minimum of Z class are automatically detected as NaN 
+%		(e.g., -32768 for int16 class).
+%
+%	'NaNColor',[R,G,B]
+%		Sets the RGB color for NaN/NoValue pixels (default is a dark gray).
+%		Note that your must specify a valid 3-scalar vector (between 0 and
+%		1);	color characters like 'w' or 'k' are not allowed, use [1,1,1]
+%		or [0,0,0] instead.
+%
+%	'Interp'
+%		Interpolates linearly all NaN values (fills the gaps using linear 
+%		triangulation), using an optimized algorithm.
+%
+%
+%	--- Colormap options ---
+%
+%	'LandColor',LMAP
+%		Uses LMAP colormap instead of default (landcolor, if exists or 
+%		jet) for Z > 0 elevations.
+%
+%	'SeaColor',SMAP
+%		Sets the colormap used for Z <= 0 elevations. Default is seacolor 
+%		(if exists) or single color [0.7,0.9,1] (a light cyan) to simulate
+%		sea color.
+%
+%	'ColorMap',CMAP
+%		Uses CMAP colormap for full range of elevations, instead of default 
+%		land/sea. This option overwrites LANDCOLOR/SEACOLOR options.
+%
+%	'Lake'
+%		Detects automaticaly flat areas different from sea level (non-zero 
+%		elevations) and colors them as lake surfaces.
+%
+%	'Watermark',N
+%		Makes the whole image lighter by a factor of N.
+%
+%
+%	--- Basemap and scale options ---
+%
+%	'Legend'
+%		Adds legends to the right of graph: elevation scale (colorbar)
+%		and a distance scale (in km).
+%
+%	'Cartesian'
+%		Plots classic basemap-style axis, considering coordinates X and Y 
+%		as cartesian in meters. Use parameter "km' for X/Y in km.
+%
+%	'LatLon'
+%		Plots geographic basemap-style axis in deg/min/sec, considering 
+%		coordinates X as longitude and Y as latitude. Axis aspect ratio 
+%		will be adjusted to approximatively preserve distances (this is  
+%		not a real projection!). This overwrites ZRatio option.
+%
+%	'AxisEqual', 'auto' (default) | 'manual' | 'off'
+%		When 'Cartesian' or 'LatLon' option is used, automatic axes scaling
+%		is applied to respect data aspect ratio. Default mode is 'auto' and
+%		uses AXIS EQUAL and DASPECT functions. The 'manual' mode modifies
+%		axes width or height with respect to the paper size in order to
+%		produce correct data scaling at print (but not necessarily at 
+%		screen). The 'off' mode disables any scaling.
+%
+%	Additionnal options for basemap CARTESIAN or LATLON:
+%
+%	'BorderWidth',BW
+%		Border width of the basemap axis, in % of axis height. Default is
+%		BW = 1%.
+%
+%	'XTick',DX
+%	'YTick',DY
+%		X and Y Tick length (same unit as X and Y). Default is automatic.
+%		Tick labels are every 2 ticks.
+%
+%	'FontSize',FS
+%		Font size for X and Y tick labels. Default is FS = 10.
+%
+%	'FontBold'
+%		Font weight bold for tick labels.
+%
+%	'Position',P
+%		Position of the tick labels: 'southwest' (default), 'southeast',
+%		'northwest','northeast'
+%
+%
+%	--- Decimation options ---
+%
+%	For optimization purpose, DEM will automatically decimate data to limit
+%	to a total of 1500x1500 pixels images. To avoid this, use following
+%	options, but be aware that large grids may require huge computer 
+%	ressources or induce disk swap or memory errors.
+%
+%	'Decim',N
+%		Decimates matrix Z at 1/N times of the original sampling.
+%
+%	'NoDecim'
+%		Forces full resolution of Z, no decimation.
+%
+%
+%
+%	--- Informations ---
+%
+%	Colormaps are Mx3 RGB matrix so it is easy to modify saturation 
+%	(CMAP.^N), set darker (CMAP/N), lighter (1 - 1/N + CMAP/N), inverse
+%	it (flipud(CMAP)), etc...
+%
+%	To get free worldwide topographic data (SRTM), see READHGT function.
+%
+%	For backward compatibility, the former syntax is still accepted:
+%	DEM(X,Y,Z,OPT,CMAP,NOVALUE,SEACOLOR) where OPT = [A,C,LC,ZMIN,ZMAX,ZC],
+%	also option aliases DEC, DMS and SCALE, but there is no argument 
+%	checking. Please prefer the param/value syntax.
 %
 %	Author: François Beauducel <beauducel@ipgp.fr>
-%	Created: 2007-05-17
-%	Updated: 2013-01-05
-
-%	Copyright (c) 2013, François Beauducel, covered by BSD License.
+%	Created: 2007-05-17 in Guadeloupe, French West Indies
+%	Updated: 2016-01-31
+
+%	History:
+%	[2016-04-19] v2.3
+%		- major update (thanks to mas Wiwit)
+%	[2016-01-31] v2.2
+%		- adds option 'Position' for tick labels
+%	[2015-08-22] v2.1
+%		- minor fix (former versions of Matlab compatibility)
+%	[2015-08-19] v2.0
+%		- image is now 100% true color (including the legend colorbar), 
+%	      thus completely independent from the figure colormap
+%	[2014-10-14]
+%		- 'decim' option allows oversampling (negative value)
+%	[2014-06-06]
+%		- improves backward compatibility (adds strjoin subfunction)
+%	[2014-03-18]
+%		- adds new axisequal option
+%	[2013-03-11]
+%		- new options: 'km', 'watermark', 'fontsize', 'bordersize'
+%		- improve legend colorbar
+%		- all options now passed as param/value
+%	[2013-01-14]
+%		- improved light rendering (using surface normals instead of gradient)
+%		- improved 'lake' detection algorithm
+%		- new 'nancolor' option to set NaN color
+%		- adds a length scale with 'dec' option
+%		- minor code improvements
+%	[2013-01-07]
+%		- adds 'interp' option (fill the gaps)
+%		- adds 'seacolor' colormap for negative elevations (bathymetry)
+%	[2013-01-02]
+%		- adds a 'lake' option
+%		- minor bug correction
+%	[2012-09-26]
+%		- now accepts row/column vectors for X and/or Y.
+%	[2012-05-29]
+%		- adds basemap-style axis in decimal or lat/lon modes
+%		- adds elevation and distance scales
+%	[2012-05-18]
+%		- new landcolor.m colormap function
+%		- new arguments to control colormap scaling
+%		- median-style filters for light and colormap
+%	[2012-04-26]
+%		- Optimizations: adds a decimation for large DEM grids.
+
+%
+%	Copyright (c) 2016, François Beauducel, covered by BSD License.
 %	All rights reserved.
 %
@@ -100,80 +250,233 @@
 end
 
-% default OPT arguments
-a = -45;
-c = 1;
-scut = 0.2;
-zmin = NaN;
-zmax = NaN;
-zcut = 0.5;
-grey = 0.2*[1,1,1];
-csea = [];
-fs = 10;	% tick label fontsize
-
-dec = 0;
-dms = 0;
-scale = 0;
-inter = 0;
-lake = 0;
-decimflag = 0;
-decim = 0;
-
-novalue_color = [0,0,0];
-
-if ~isnumeric(x) | ~isnumeric(y) | ~isnumeric(z)
+holdon = ishold;
+
+degkm = 6378*pi/180; % one latitude degree in km
+sea_color = [.7,.9,1]; % default sea color (light cyan)
+grey = 0.2*[1,1,1]; % a dark gray
+
+
+% -------------------------------------------------------------------------
+% --- Manage input arguments
+
+% number of arguments param/value
+nargs = 0;
+
+if ~isnumeric(x) || ~isnumeric(y) || ~isnumeric(z)
 	error('X,Y and Z must be numeric.')
 end
 
-if all(size(x) ~= 1) | all(size(y) ~= 1)
+if all(size(x) ~= 1) || all(size(y) ~= 1)
 	error('X and Y must be vectors, not matrix.')
 end
 
-if length(x) ~= size(z,2) | length(y) ~= size(z,1)
+if length(x) ~= size(z,2) || length(y) ~= size(z,1)
 	error('If Z has a size of [M,N], X must have a length of N, and Y a length of M.')
 end
 
-if nargin > 3
-	dec = any(strcmp(varargin,'dec'));
-	dms = any(strcmp(varargin,'dms'));
-	if dms & any(abs(y) > 91)
-		error('With DMS option Y must be in valid latitudes interval (decimal degrees).')
-	end
-	scale = any(strcmp(varargin,'scale'));
-	inter = any(strcmp(varargin,'interp'));
-	lake = any(strcmp(varargin,'lake'));
-	if any(strcmp(varargin,'nodecim'))
-		decim = 1;
-		decimflag = 1;
-	end
-	kdecim = find(strcmp(varargin,'decim'));
-	if ~isempty(kdecim)
-		decimflag = 1;
-		if (kdecim + 1) <= nargin & isnumeric(varargin{kdecim+1})
-			decim = round(varargin{kdecim+1});
-			decimflag = 2;
-		end
-	end
-end
-nargs = decimflag + dec + dms + scale + lake + inter;
-
-if (nargin - nargs) > 3
+% OPTIONS and PARAM/VALUE arguments
+			
+% AZIMUTH param/value
+[s,az] = checkparam(varargin,'azimuth',@isscalar);
+nargs = nargs + 2;
+if s==0
+	az = -45; % default
+end
+
+% ELEVATION param/value
+[s,el] = checkparam(varargin,'elevation',@isscalar);
+nargs = nargs + 2;
+if s==0
+	el = 0; % default
+end
+
+% CONTRAST param/value
+[s,ct] = checkparam(varargin,'contrast',@isscalar);
+nargs = nargs + 2;
+if s
+	ct = abs(ct);
+else
+	ct = 1; % default
+end
+
+% LCUT param/value
+[s,lcut] = checkparam(varargin,'lcut',@isperc);
+nargs = nargs + 2;
+if s==0
+	lcut = .2; % default
+end
+
+% NOVALUE param/value
+[s,novalue] = checkparam(varargin,'novalue',@isscalar);
+nargs = nargs + 2;
+if s==0
+	% default: min value for integer class / NaN for float
+	S = whos('z');
+	if strfind(S.class,'int')
+		novalue = intmin(S.class);
+	else
+		novalue = NaN;
+	end
+end
+
+% NANCOLOR param/value
+[s,novalue_color] = checkparam(varargin,'nancolor',@isrgb);
+nargs = nargs + 2;
+if s==0
+	novalue_color = grey; % default
+end
+
+% LANDCOLOR param/value
+[s,cland] = checkparam(varargin,'landcolor',@isrgb);
+nargs = nargs + 2;
+if s==0
+	% default: landcolor or jet
+	if exist('landcolor','file')
+		cland = landcolor.^1.3;
+	else
+		cland = jet(256);
+	end
+end
+
+% SEACOLOR param/value
+[s,csea] = checkparam(varargin,'seacolor',@isrgb);
+nargs = nargs + 2;
+if s==0
+	% default: seacolor or single color
+	if exist('seacolor','file')
+		csea = seacolor;
+	else
+		csea = sea_color;
+	end
+end
+
+% COLORMAP param/value
+[s,cmap] = checkparam(varargin,'colormap',@isrgb);
+nargs = nargs + 2;
+if s
+	cland = [];
+	csea = [];
+else
+	% default
+	cmap = cland;
+end
+
+% ZLIM param/value
+[s,zmm] = checkparam(varargin,'zlim',@isvec);
+nargs = nargs + 2;
+if s
+	zmin = min(zmm);
+	zmax = max(zmm);
+else
+	zmin = NaN; % default
+	zmax = NaN; % default
+end
+
+% ZCUT param/value
+[s,zcut] = checkparam(varargin,'zcut',@isperc);
+nargs = nargs + 2;
+if s==0
+	zcut = .5; % default
+end
+
+% ZRATIO param/value
+[s,zratio] = checkparam(varargin,'zratio',@isscalar);
+nargs = nargs + 2;
+if s==0
+	zratio = 1; % default
+end
+
+% WATERMARK param/value
+[s,wmark] = checkparam(varargin,'watermark',@isscalar);
+nargs = nargs + 2;
+if s
+	wmark = abs(wmark);
+else
+	wmark = 0; % default
+end
+
+% DECIM param/value and NODECIM option
+[s,decim] = checkparam(varargin,'decim',@isscalar);
+if s
+	decim = round(decim);
+	nargs = nargs + 2;
+else
+	decim = any(strcmpi(varargin,'nodecim')); % default
+	nargs = nargs + 1;
+end
+
+% FONTSIZE param/value
+[s,fs] = checkparam(varargin,'fontsize',@isscalar);
+nargs = nargs + 2;
+if s==0
+	fs = 10; % default
+end
+
+% BORDERWIDTH param/value
+[s,bw] = checkparam(varargin,'borderwidth',@isperc);
+nargs = nargs + 2;
+if s==0
+	bw = 1; % default
+end
+
+% XTICK param/value
+[s,ddx] = checkparam(varargin,'xtick',@isscalar);
+nargs = nargs + 2;
+if s==0
+	ddx = 0; % default (automatic)
+end
+
+% YTICK param/value
+[s,ddy] = checkparam(varargin,'ytick',@isscalar);
+nargs = nargs + 2;
+if s==0
+	ddy = 0; % default (automatic)
+end
+
+% POSITION param/value
+[s,tpos] = checkparam(varargin,'position',@ischar,{'southwest','southeast','northwest','northeast'});
+nargs = nargs + 2;
+if s==0
+	tpos = 'southwest'; % default
+end
+
+% AXISEQUAL param/value
+[s,axeq] = checkparam(varargin,'axisequal',@ischar,{'auto','manual','off'});
+nargs = nargs + 2;
+if s==0 || ~any(strcmpi(axeq,{'manual','off'}))
+	axeq = 'auto'; % default (automatic)
+end
+
+% CROP param/value
+[s,crop] = checkparam(varargin,'crop',@isvec,4);
+nargs = nargs + 2;
+
+% options without argument value
+km = any(strcmpi(varargin,'km'));
+dec = any(strcmpi(varargin,'cartesian') | strcmpi(varargin,'dec'));
+dms = any(strcmpi(varargin,'latlon') | strcmpi(varargin,'dms'));
+scale = any(strcmpi(varargin,'legend') | strcmpi(varargin,'scale'));
+inter = any(strcmpi(varargin,'interp'));
+lake = any(strcmpi(varargin,'lake'));
+fbold = any(strcmpi(varargin,'fontbold'));
+noplot = any(strcmpi(varargin,'noplot'));
+
+
+% for backward compatibility (former syntax)...
+nargs = nargs + dec + dms + scale + lake + inter + km + fbold + noplot;
+
+if (nargin - nargs) > 3 && ~isempty(varargin{1})
 	opt = varargin{1};
 	if ~isnumeric(opt)
-		error('OPT = [A,C,S,ZMIN,ZMAX] argument must be numeric.');
+		error('OPT = [A,C,S,ZMIN,ZMAX,ZCUT] argument must be numeric.');
 	end
 	if ~isempty(opt)
-		a = opt(1);
+		az = opt(1);
 	end
 	if length(opt) > 1
-		c = opt(2);
-		if c < 0
-			error('C argument must be positive.');
-		end
+		ct = opt(2);
 	end
 	if length(opt) > 2
-		scut = opt(3);
-		if scut < 0 | scut >= 100
-			error('SCUT argument must be a positive percentage.');
-		end
+		lcut = opt(3);
 	end
 	if length(opt) > 4
@@ -183,54 +486,44 @@
 	if length(opt) > 5
 		zcut = opt(6);
-		if zcut < 0 | zcut >= 100
-			error('ZCUT argument must be a positive percentage.');
-		end
-	end
-end
-
-if (nargin - nargs) < 5
-	cmap = [];
-else
+	end
+end
+
+if (nargin - nargs) > 4 && ~isempty(varargin{2})
 	cmap = varargin{2};
-	if ~isnumeric(cmap) | (~isempty(cmap) & (size(cmap,2) ~= 3 | min(cmap(:)) < 0 | max(cmap(:)) > 1))
-		error('CMAP must be a valid colormap (3-column [R,G,B] matrix with 0.0 to 1.0 values).')
-	end
-end
-
-if (nargin - nargs) < 6
-	novalue = NaN;
-else
+	csea = [];
+end
+
+if (nargin - nargs) > 5 && ~isempty(varargin{3})
 	novalue = varargin{3};
-	if ~isnumeric(novalue) | numel(novalue) > 1
-		error('NOVALUE must be scalar.')
-	end
-end
-
-if (nargin - nargs) < 7
-	if isempty(cmap)
-		if exist('seacolor','file')
-			csea = seacolor(256);
-		else
-			csea = [.7,.9,1];
-		end
-	end
-else
+end
+
+if (nargin - nargs) > 6 && ~isempty(varargin{4})
 	csea = varargin{4};
-	if ~isnumeric(csea)
-		error('Unknown option')
-	elseif (~isempty(csea) & (size(csea,2) ~= 3 | min(csea) < 0 | max(csea) > 1))
-		error('SEACOLOR must be a valid [R,G,B] vector with 0.0 to 1.0 values).')
-	end
-end
-
-if isempty(cmap)
-	if exist('landcolor','file')
-		cmap = landcolor.^1.3;
-	else
-		cmap = jet(256);
-	end
-end
-
-
+end
+
+
+% further test of input arguments
+if dms && any(abs(y) > 91)
+	error('With LATLON option Y must be in valid latitudes interval (decimal degrees).')
+end
+
+if km
+	zratio = 1000;
+end
+
+
+% -------------------------------------------------------------------------
+% --- Pre-process DEM data
+
+% crops data if needed
+if numel(crop)==4
+	fprintf('DEM: crops original data from [%g,%g,%g,%g] to [%g,%g,%g,%g]...\n', ...
+		min(x(:)),max(x(:)),min(y(:)),max(y(:)),crop);
+	kx = find(x >= crop(1) & x <= crop(2));
+	ky = find(y >= crop(3) & y <= crop(4));
+	x = x(kx);
+	y = y(ky);
+	z = z(ky,kx);
+end
 
 % decimates data to avoid disk swap/out of memory...
@@ -245,5 +538,5 @@
 	y = y(1:n:end);
 	z = z(1:n:end,1:n:end);
-	fprintf('DEM: on the plot data has been decimated by a factor of %d...\n',n);
+	fprintf('DEM: data has been decimated by a factor of %d...\n',n);
 end
 
@@ -251,74 +544,98 @@
 z(z==novalue) = NaN;
 
+if isempty(csea)
+	k = (z~=0 & ~isnan(z));
+else
+	k = ~isnan(z);
+end
+
+if isnan(zmin)
+	zmin = nmedian(z(k),zcut/100);
+end
+if isnan(zmax)
+	zmax = nmedian(z(k),1 - zcut/100);
+end
+dz = zmax - zmin;
+
+if decim & n < 0
+	xi = linspace(x(1),x(end),-n*length(x));
+	yi = linspace(y(1),y(end),-n*length(y))';
+	[xx,yy] = meshgrid(xi,yi);
+	z = interp2(x,y,z,xx,yy,'*cubic');
+	x = xi;
+	y = yi;
+	fprintf('DEM: data has been oversampled by a factor of %d...\n',-n);
+end
+
 if inter
 	z = fillgap(x,y,z);
 end
 
-if isempty(csea)
-	k = (z~=0 & ~isnan(z));
-else
-	k = ~isnan(z);
-end
-
-if isnan(zmin)
-	zmin = nmedian(z(k),zcut/100);
-end
-if isnan(zmax)
-	zmax = nmedian(z(k),1 - zcut/100);
-end
-dz = zmax - zmin;
+% -------------------------------------------------------------------------
+% --- Process lighting
 
 if dz > 0
 	% builds the colormap: concatenates seacolor and landcolor around 0
-	if ~isempty(csea) & zmin < 0 & zmax > 0
+	if ~isempty(csea)
 		l = size(csea,1);
-		r = size(cmap,1)*abs(zmin)/zmax/l;
-		cmap = cat(1,interp1(1:l,csea,linspace(1,l,round(l*r)),'*linear'),cmap);
+		if zmin < 0 && zmax > 0
+			r = size(cland,1)*abs(zmin)/zmax/l;
+			cmap = cat(1,interp1(1:l,csea,linspace(1,l,ceil(l*r)),'*linear'),cland);
+		elseif zmax <=0
+			cmap = csea;
+		end
 	end
 	
 	% normalisation of Z using CMAP and convertion to RGB
-	I = ind2rgb(uint16((z - zmin)*(length(cmap)/dz)),cmap);
+	I = ind2rgb(uint16(round((z - zmin)*(size(cmap,1) - 1)/dz) + 1),cmap);
 	
-	if c > 0
+	if ct > 0
 		% computes lighting from elevation gradient
-		[fx,fy] = gradient(z,x,y);
-		%fx = filter([1,0,0,0,-1],1,rf(z'))';
-		%fy = filter([1,0,0,0,-1],1,rf(z));
-		fxy = -fx*sind(a) - fy*cosd(a);
-		clear fx fy	% free some memory...
+		%[fx,fy] = gradient(z,x,y);
+		if dms
+			ryz = degkm*1000;
+			rxz = degkm*1000*cosd(mean(y));
+		else
+			rxz = zratio;
+			ryz = zratio;
+		end
+		[xx,yy] = meshgrid(x*rxz,y*ryz);
+		[fx,fy,fz] = surfnorm(xx,yy,z);
+		[ux,uy,uz] = sph2cart((90-az)*pi/180,el*pi/180,1);
+		fxy = fx*ux + fy*uy + fz*uz;
+		clear xx yy fx fy fz	% free some memory...
 		
-		% lake option: zero gradient
-		if lake
-			dx = diff(z,1,2);
-			dy = diff(z,1,1);
-			u1 = ones(size(z,1),1);
-			u2 = ones(1,size(z,2));
-			z(cat(1,u2,dy)==0 & cat(1,dy,u2)==0 & cat(2,dx,u1)==0 & cat(2,u1,dx)==0) = 0;
-			clear dx dy	% free some memory...
-		end
-
 		fxy(isnan(fxy)) = 0;
 
-		% computes maximum absolute gradient (median-style), normalizes, saturates and duplicates in 3-D matrix
-		r = repmat(max(min(fxy/nmedian(abs(fxy),1 - scut/100),1),-1),[1,1,3]);
+		% computes maximum absolute gradient (median-style), normalizes,
+		% saturates and duplicates in 3-D matrix
+		li = 1 - abs(sind(el)); % light amplitude (experimental)
+		r = repmat(max(min(li*fxy/nmedian(abs(fxy),1 - lcut/100),1),-1),[1,1,3]);
+		rp = (1 - abs(r)).^ct;
 	
 		% applies contrast using exponent
-		rp = (1 - abs(r)).^c;
 		I = I.*rp;
 	
 		% lighter for positive gradient
-		k = find(r > 0);
-		I(k) = I(k) + (1 - rp(k));
+		I(r>0) = I(r>0) + (1 - rp(r>0));
 				
 	end
-	
-	% set novalues / NaN to black color
+
+	% set novalues / NaN to nancolor
 	[i,j] = find(isnan(z));
 	if ~isempty(i)
 		I(sub2ind(size(I),repmat(i,1,3),repmat(j,1,3),repmat(1:3,size(i,1),1))) = repmat(novalue_color,size(i,1),1);
 	end
+	
+	% lake option
+	if lake
+		klake = islake(z);
+	else
+		klake = 0;
+	end
+	
 	% set the seacolor for 0 values
 	if ~isempty(csea)
-		[i,j] = find(z==0);
+		[i,j] = find(z==0 | klake);
 		if ~isempty(i)
 			I(sub2ind(size(I),repmat(i,1,3),repmat(j,1,3),repmat(1:3,size(i,1),1))) = repmat(csea(end,:),size(i,1),1);
@@ -326,54 +643,110 @@
 	end
 
-	hh = imagesc(x,y,I);
-else
-	hh = imagesc(x,y,z);
-	colormap(cmap);
-	text(mean(x),mean(y),'SPLASH!','Color','c','FontWeight','bold','HorizontalAlignment','center')
-end
-
-orient tall
-axis xy, axis equal, axis tight
-
+	if wmark
+		I = watermark(I,wmark);
+	end
+	txt = '';
+	
+else
+	
+	I = repmat(shiftdim(sea_color,-1),size(z));
+	cmap = repmat(sea_color,[256,1]);
+	txt = 'Mak Byur!';	% Splash !
+end
+
+% -------------------------------------------------------------------------
+% --- ends the function when 'noplot' option is on
+if noplot
+	varargout{1} = struct('x',x,'y',y,'z',z,'rgb',I);
+	return
+end
+
+% -------------------------------------------------------------------------
+% --- plots the RGB image
+hh = imagesc(x,y,I);
+
+if ~isempty(txt)
+	text(mean(x),mean(y),txt,'Color',sea_color/4, ...
+		'FontWeight','bold','HorizontalAlignment','center')
+end
+
+orient tall; axis xy
+if strcmpi(axeq,'auto')
+	axis equal
+end
+axis tight
 xlim = [min(x),max(x)];
 ylim = [min(y),max(y)];
-zlim = [min(z(:)),max(z(:))];
-
-% axis basemap style
-if dec | dms
+zlim = [min([z(z(:) ~= novalue);zmin]),max([z(z(:) ~= novalue);zmax])];
+
+if dms
+	% approximates X-Y aspect ratio for this latitude (< 20-m precision for 1x1° grid)
+	xyr = cos(mean(y)*pi/180);
+else
+	xyr = 1;
+end
+
+bw0 = max(diff(xlim)*xyr,diff(ylim))/100;
+bwy = bw*bw0; % Y border width = 1%
+bwx = bwy/xyr; % border width (in degree of longitude)
+
+
+% -------------------------------------------------------------------------
+% --- Axis basemap style
+if dec || dms
 	axis off
 
-	if dms
-		% approximates X-Y aspect ratio for this latitude (< 20-m precision for 1x1° grid)
-		xyr = cos(mean(y)*pi/180);
-	else
-		xyr = 1;
-	end
-	set(gca,'DataAspectRatio',[1,xyr,1])
-	bwy = 0.008*diff(ylim); % Y border width = 1%
-	bwx = bwy/xyr; % border width (in degree of longitude)
-
-	% transparent borders
-	patch([xlim(1)-bwx,xlim(2)+bwx,xlim(2)+bwx,xlim(1)-bwx],ylim(1) - bwy*[0,0,1,1],'k','FaceColor','none','clipping','off')
-	patch([xlim(1)-bwx,xlim(2)+bwx,xlim(2)+bwx,xlim(1)-bwx],ylim(2) + bwy*[0,0,1,1],'k','FaceColor','none','clipping','off')
-	patch(xlim(1) - bwx*[0,0,1,1],[ylim(1)-bwy,ylim(2)+bwy,ylim(2)+bwy,ylim(1)-bwy],'k','FaceColor','none','clipping','off')
-	patch(xlim(2) + bwx*[0,0,1,1],[ylim(1)-bwy,ylim(2)+bwy,ylim(2)+bwy,ylim(1)-bwy],'k','FaceColor','none','clipping','off')
-
+	if strcmpi(axeq,'manual')
+		ppos = get(gcf,'PaperPosition');
+		apos = get(gca,'Position');
+		xyf = (xyr*diff(xlim)/apos(3)/ppos(3))/(diff(ylim)/apos(4)/ppos(4));
+		if xyf >= 1
+			set(gca,'Position',[apos(1),apos(2),apos(3),apos(4)/xyf]);
+		else
+			set(gca,'Position',[apos(1),apos(2),apos(3)*xyf,apos(4)]);
+		end
+	end
+	if strcmpi(axeq,'auto')
+		if diff(xlim)*xyr <= diff(ylim)
+			set(gca,'DataAspectRatio',[1,xyr,1])
+		else
+			set(gca,'DataAspectRatio',[1/xyr,1,1])
+		end
+	end
+
+	if bw > 0
+		% transparent borders
+		patch([xlim(1)-bwx,xlim(2)+bwx,xlim(2)+bwx,xlim(1)-bwx],ylim(1) - bwy*[0,0,1,1],'k','FaceColor','none','clipping','off')
+		patch([xlim(1)-bwx,xlim(2)+bwx,xlim(2)+bwx,xlim(1)-bwx],ylim(2) + bwy*[0,0,1,1],'k','FaceColor','none','clipping','off')
+		patch(xlim(1) - bwx*[0,0,1,1],[ylim(1)-bwy,ylim(2)+bwy,ylim(2)+bwy,ylim(1)-bwy],'k','FaceColor','none','clipping','off')
+		patch(xlim(2) + bwx*[0,0,1,1],[ylim(1)-bwy,ylim(2)+bwy,ylim(2)+bwy,ylim(1)-bwy],'k','FaceColor','none','clipping','off')
+	end
 	dlon = {'E','W'};
 	dlat = {'N','S'};
-
-	if dec
-		ddx = dtick(diff(xlim));
-		ddy = dtick(diff(ylim));
+	if fbold
+		fw = 'bold';
 	else
-		ddx = dtick(diff(xlim),1);
-		ddy = dtick(diff(ylim),1);
-	end
-
+		fw = 'normal';
+	end
+	
+	if ddx == 0
+		ddx = dtick(diff(xlim),dms);
+	end
+	if ddy == 0
+		ddy = dtick(diff(ylim),dms);
+	end
 	xtick = (ddx*ceil(xlim(1)/ddx)):ddx:xlim(2);
 	for xt = xtick(1:2:end)
 		dt = ddx - max(0,xt + ddx - xlim(2));
 		patch(repmat(xt + dt*[0,1,1,0]',[1,2]),[ylim(1) - bwy*[0,0,1,1];ylim(2) + bwy*[0,0,1,1]]','k','clipping','off')
-		text(xt,ylim(1) - bwy,deg2dms(xt,dlon,dec),'FontSize',fs,'HorizontalAlignment','center','VerticalAlignment','top');
+		if fs > 0
+			if ~isempty(regexp(tpos,'north','once'))
+				text(xt,ylim(2) + 1.2*bwy,deg2dms(xt,dlon,dec),'FontSize',fs,'FontWeight',fw, ...
+					'HorizontalAlignment','center','VerticalAlignment','bottom');
+			else
+				text(xt,ylim(1) - 1.2*bwy,deg2dms(xt,dlon,dec),'FontSize',fs,'FontWeight',fw, ...
+					'HorizontalAlignment','center','VerticalAlignment','top');
+			end
+		end
 	end
 
@@ -382,50 +755,77 @@
 		dt = ddy - max(0,yt + ddy - ylim(2));
 		patch([xlim(1) - bwx*[0,0,1,1];xlim(2) + bwx*[0,0,1,1]]',repmat(yt + dt*[0,1,1,0]',[1,2]),'k','clipping','off')
-		text(xlim(1) - 1.1*bwx,yt,deg2dms(yt,dlat,dec),'FontSize',fs,'HorizontalAlignment','right','VerticalAlignment','middle');
-	end
-end
-
-% scale legend
+		if fs > 0
+			if ~isempty(regexp(tpos,'east','once'))
+				text(xlim(2) + 1.2*bwx,yt,deg2dms(yt,dlat,dec),'FontSize',fs,'FontWeight',fw, ...
+					'HorizontalAlignment','center','VerticalAlignment','top','rotation',90);
+			else
+				text(xlim(1) - 1.2*bwx,yt,deg2dms(yt,dlat,dec),'FontSize',fs,'FontWeight',fw, ...
+					'HorizontalAlignment','center','VerticalAlignment','bottom','rotation',90);
+			end
+		end
+	end
+end
+
+% -------------------------------------------------------------------------
+% --- Scales legend
 if scale
 	%wsc = diff(xlim)*0.01;
-	wsc = bwx;
-	xsc = xlim(2) + wsc*4;
-
-	% elevation scale (colorbar)
-	zscale = linspace(zlim(1),zlim(2),length(cmap));
+	wsc = bw0;
+	xsc = xlim(2) + wsc*2 + bwx;
+
+	if wmark
+		cmap = watermark(cmap,wmark);
+	end
+
+	% -- elevation scale (colorbar)
+	zscale = linspace(zmin,zmax,length(cmap))';
 	yscale = linspace(0,diff(ylim)/2,length(cmap));
+	ddz = dtick(dz*max(0.5*xyr*diff(xlim)/yscale(end),1));
+	ztick = (ddz*ceil(zscale(1)/ddz)):ddz:zscale(end);
+ 	rgbscale = ind2rgb(uint16(round((zscale - zmin)*(size(cmap,1) - 1)/dz) + 1),cmap);
 	ysc = ylim(1);
-	ddz = dtick(dz*max(0.5*xyr*diff(xlim)/yscale(end),1));
-	ztick = (ddz*ceil(zlim(1)/ddz)):ddz:zlim(2);
-	patch(xsc + repmat(wsc*[-1;1;1;-1],[1,length(cmap)]), ...
-		ysc + [repmat(yscale,[2,1]);repmat(yscale + diff(yscale(1:2)),[2,1])], ...
-		repmat(zscale,[4,1]), ...
-		'EdgeColor','flat','LineWidth',.1,'FaceColor','flat','clipping','off')
-	colormap(cmap)
-	caxis([zmin,zmax])
+	hold on
+	imagesc(xsc + wsc*[-1,1]/2,ysc + yscale,repmat(rgbscale,1,2),'clipping','off');
 	patch(xsc + wsc*[-1,1,1,-1],ysc + yscale(end)*[0,0,1,1],'k','FaceColor','none','Clipping','off')
-	text(xsc + 2*wsc + zeros(size(ztick)),ysc + (ztick - zlim(1))*0.5*diff(ylim)/diff(zlim),num2str(ztick'), ...
-		'HorizontalAlignment','left','VerticalAlignment','middle','FontSize',8)
+	text(xsc + 2*wsc + zeros(size(ztick)),ysc + (ztick - zscale(1))*0.5*diff(ylim)/diff(zscale([1,end])),num2str(ztick'), ...
+		'HorizontalAlignment','left','VerticalAlignment','middle','FontSize',6)
+	% indicates min and max Z values
+	text(xsc,ysc - bwy/2,sprintf('%g m',roundsd(zlim(1),3)),'FontWeight','bold', ...
+		'HorizontalAlignment','left','VerticalAlignment','top','FontSize',6)
+	text(xsc,ysc + .5*diff(ylim) + bwy/2,sprintf('%g m',roundsd(zlim(2),3)),'FontWeight','bold', ...
+		'HorizontalAlignment','left','VerticalAlignment','bottom','FontSize',6)
 	
-	% distance scale (in case of DMS only)
+	% frees axes only if not hold on
+	if ~holdon
+		hold off
+	end
+	
+	% -- distance scale (in km)
 	if dms
-		degkm = 6370*pi/180;
-		dkm = dtick(diff(ylim)*degkm);
-		ysc = ylim(2) - 0.5*dkm/degkm;
-		patch(xsc + wsc*[-1,-1,0,0],ysc + dkm*0.5*[-1,1,1,-1]/degkm,'k','FaceColor',grey,'clipping','off')
-		if dkm > 1
-			skm = sprintf('%g km',dkm);
-		else
-			skm = sprintf('%g m',dkm*1000);
-		end
-		text(xsc,ysc,skm,'rotation',-90,'HorizontalAlignment','center','VerticalAlignment','bottom', ...
-			'Color',grey,'FontWeight','bold')
-	end
-
+		fsc = degkm;
+	else
+		fsc = zratio/1e3;
+	end
+	dkm = dtick(diff(ylim)*fsc);
+	ysc = ylim(2) - 0.5*dkm/fsc;
+	patch(xsc + wsc*[-1,-1,0,0],ysc + dkm*0.5*[-1,1,1,-1]/fsc,'k','FaceColor',grey,'clipping','off')
+	if dkm > 1
+		skm = sprintf('%g km',dkm);
+	else
+		skm = sprintf('%g m',dkm*1000);
+	end
+	text(xsc,ysc,skm,'rotation',-90,'HorizontalAlignment','center','VerticalAlignment','bottom', ...
+			'Color',grey,'FontWeight','bold','FontSize',6)
 end
 
 
 if nargout > 0
-	h = hh;
+	varargout{1} = hh;
+end
+if nargout > 1
+	varargout{2} = I;
+end
+if nargout > 2
+	varargout{3} = z;
 end
 
@@ -455,8 +855,8 @@
 end
 
-if deg & dlim <= 2/60
+if deg && dlim <= 2/60
 	% less than 2 minutes: base 36
 	m = 10^floor(log10(dlim*36))/36;
-elseif deg & dlim <= 2
+elseif deg && dlim <= 2
 	% less than 2 degrees: base 6
 	m = 10^floor(log10(dlim*6))/6;
@@ -485,5 +885,6 @@
 else
 	xa = abs(x) + 1/360000;
-	sd = sprintf('%d%c',floor(xa),176);	% ASCII char 176 is the degree sign
+	%sd = sprintf('%d%c',floor(xa),176);	% ASCII char 176 is the degree sign
+	sd = sprintf('%d°',floor(xa));
 	sm = '';
 	ss = '';
@@ -502,9 +903,10 @@
 end
 
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 function z = fillgap(x,y,z)
 % GRIDDATA is not efficient for large arrays, but has great advantage to be
-% included in Matlab core functions! To optimize interpolation, we
-% reduce the number of relevant data by building a mask of surrounding
+% included in Matlab's core functions! To optimize interpolation, we
+% reduce the amount of relevant data by building a mask of all surrounding
 % pixels of novalue areas... playing with linear index!
 
@@ -529,2 +931,151 @@
 [i,j] = ind2sub(sz,k);
 k2 = sub2ind(fliplr(sz),j,i); % switched i and j: k2 is linear index in row order
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function k = islake(z)
+% ISLAKE mask of zero gradient on 3x3 tiles
+% We use diff matrix in row and column directions, and shift it to build
+% a single vectorized test of surrounding pixels. To do this we must
+% concatenate unit vectors in different combinations...
+
+dx = diff(z,1,2);	% differences in X direction
+dy = diff(z,1,1);	% differences in Y direction
+u1 = ones(size(z,1),1);	% row unit vector 
+u2 = ones(1,size(z,2));	% column unit vector
+u2r = u2(2:end);
+
+% index of the tiles center pixel
+k = ( ...
+	[u2;dy] == 0 & [dy;u2] == 0 & ...
+	[u1,dx] == 0 & [dx,u1] == 0 & ...
+	[u1,[dx(2:end,:);u2r]] == 0 & [[dx(2:end,:);u2r],u1] == 0 & ...
+	[u1,[u2r;dx(1:end-1,:)]] == 0 & [[u2r;dx(1:end-1,:)],u1] == 0 ...
+);
+
+% now extends it to surrounding pixels
+k(1:end-1,:) = (k(1:end-1,:) | k(2:end,:));
+k(2:end,:) = (k(2:end,:) | k(1:end-1,:));
+k(:,1:end-1) = (k(:,1:end-1) | k(:,2:end));
+k(:,2:end) = (k(:,2:end) | k(:,1:end-1));
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function s = isrgb(x,n)
+
+if nargin < 2
+	n = 0;
+end
+if isnumeric(x) && (n == 1 && all(size(x) == [1,3]) || n == 0 && size(x,2) == 3) ...
+		&& all(x(:) >= 0 & x(:) <= 1)
+	s = 1;
+else
+	s = 0;
+end
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function s = isperc(x)
+
+if isnumeric(x) && isscalar(x) && x >= 0 && x <= 100
+	s = 1;
+else
+	s = 0;
+end
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function s = isvec(x,n)
+
+if nargin < 2
+	n = 2;
+end
+if isnumeric(x) && numel(x) == n
+	s = 1;
+else
+	s = 0;
+end
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function y=roundsd(x,n)
+
+og = 10.^(floor(log10(abs(x)) - n + 1));
+y = round(x./og).*og;
+y(x==0) = 0;
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function y = watermark(x,n)
+
+if nargin < 2
+	n = 2;
+end
+
+if n == 0
+    y = x;
+else
+    y = (x/n + 1 - 1/n);
+end
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function [s,v] = checkparam(arg,nam,func,val)
+
+switch func2str(func)
+	case 'isscalar'
+		num = 1;
+		mes = 'scalar value';
+	case 'isperc'
+		num = 1;
+		mes = 'percentage scalar value';
+	case 'isvec'
+		num = 1;
+		if nargin < 4
+			val = 2;
+		end
+		mes = sprintf('%d-element vector',val);
+	case 'isrgb'
+		num = 1;
+		mes = '[R,G,B] vector with 0.0 to 1.0 values';
+	case 'ischar'
+		num = 0;
+		mes = 'string';
+		if nargin > 3
+			mes = sprintf('%s (%s)',mes,strjoin(val,' or '));
+		end
+	otherwise
+		num = 1;
+		mes = 'value';
+end
+
+s = 0;
+v = [];
+k = find(strcmpi(arg,nam));
+if ~isempty(k)
+	if (k + 1) <= length(arg) ...
+			&& (~num || isnumeric(arg{k+1})) ...
+			&& (nargin < 4 && func(arg{k+1}) ...
+				|| (nargin > 3 && (strcmp(func2str(func),'ischar') && ismember(arg{k+1},val)) ...
+					 || strcmp(func2str(func),'isvec') && func(arg{k+1},val)))
+		v = arg{k+1};
+		s = 1;
+	else
+		error('%s option must be followed by a valid %s.',upper(nam),mes)
+	end
+end
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function s=strjoin(c,d)
+%STRJOIN Join cell array of strings
+%(this is for Matlab versions < 2013a backward compatibility)
+
+if nargin < 2
+	d = '';
+end
+n = numel(c);
+ss = cell(2,n);
+ss(1,:) = reshape(c,1,n);
+ss(2,1:n-1) = {d};
+s = [ss{:}];
Index: /issm/trunk/externalpackages/dem/license.txt
===================================================================
--- /issm/trunk/externalpackages/dem/license.txt	(revision 24312)
+++ /issm/trunk/externalpackages/dem/license.txt	(revision 24313)
@@ -1,24 +1,24 @@
-Copyright (c) 2013, François Beauducel
+Copyright (c) 2016, François Beauducel
 All rights reserved.
 
-Redistribution and use in source and binary forms, with or without 
-modification, are permitted provided that the following conditions are 
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
 met:
 
-    * Redistributions of source code must retain the above copyright 
+    * Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright 
-      notice, this list of conditions and the following disclaimer in 
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in
       the documentation and/or other materials provided with the distribution
-      
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.
Index: /issm/trunk/externalpackages/ec2ami/install.sh
===================================================================
--- /issm/trunk/externalpackages/ec2ami/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/ec2ami/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/ec2-api-tools.zip' 'ec2-api-tools.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/ec2-api-tools.zip' 'ec2-api-tools.zip'
 
 #Untar 
Index: /issm/trunk/externalpackages/ec2api/install.sh
===================================================================
--- /issm/trunk/externalpackages/ec2api/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/ec2api/install.sh	(revision 24313)
@@ -7,6 +7,6 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/ec2-api-tools.zip' 'ec2-api-tools.zip'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/docs/ec2-ug.pdf' 'ec2-ug.pdf'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/ec2-api-tools.zip' 'ec2-api-tools.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/ec2-ug.pdf' 'ec2-ug.pdf'
 
 #Untar 
Index: /issm/trunk/externalpackages/emscripten/install.sh
===================================================================
--- /issm/trunk/externalpackages/emscripten/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/emscripten/install.sh	(revision 24313)
@@ -2,24 +2,28 @@
 set -eu
 
-export CC=gcc
-export CXX=g++
 
-#Some cleanup
-rm -rf install
+# Get Emscripten SDK (emsdk) driver if we have not previously installed
+# Emscripten. Otherwise, just get the latest version.
+if [[ ! -d ./emsdk ]]; then
+	# Get the emsdk repo
+	git clone https://github.com/emscripten-core/emsdk.git
 
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/emsdk-portable.tar.gz' 'emsdk-portable.tar.gz'
+	# Create symbolic link
+	ln -s ./emsdk ./install
 
-#Untar and move petsc to install directory
-tar -zxvf  emsdk-portable.tar.gz
-mv emsdk_portable install
+	cd ./emsdk
+else
+	# Fetch the latest version of the emsdk
+	cd ./emsdk
+	git pull
+fi
 
-cd install
+# Download and install the latest SDK tools.
+./emsdk install latest
 
-./emsdk update
-./emsdk install sdk-tag-1.34.12-64bit
-./emsdk activate sdk-tag-1.34.12-64bit
+# Make the "latest" SDK "active" for the current user. (writes ~/.emscripten
+# file)
+./emsdk activate latest
 
-#Related to moving the install path after installation - However, not safe to install in dir named "install" since a failure would not be noticed by jenkins when triggering
-#Not reliable - when executed in subshell without sourcing the install file, this has no effect. Safer to explicitly source for each dependent externalpackage.
-source emsdk_env.sh
+# Activate PATH and other environment variables in the current terminal
+source ./emsdk_env.sh
Index: /issm/trunk/externalpackages/esmf/install.sh
===================================================================
--- /issm/trunk/externalpackages/esmf/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/esmf/install.sh	(revision 24313)
@@ -12,7 +12,7 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/esmf_6_3_0rp1_src.tar.gz' 'esmf_6_3_0rp1_src.tar.gz'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/docs/ESMF_refdoc.pdf' 'ESMF_refdoc.pdf'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/docs/ESMF_usrdoc.pdf' 'ESMF_usrdoc.pdf'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/esmf_6_3_0rp1_src.tar.gz' 'esmf_6_3_0rp1_src.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/ESMF_refdoc.pdf' 'ESMF_refdoc.pdf'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/ESMF_usrdoc.pdf' 'ESMF_usrdoc.pdf'
 
 #Untar 
Index: /issm/trunk/externalpackages/ffmpeg/install-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/ffmpeg/install-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/ffmpeg/install-macosx64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/ffmpeg-1.1.2.tar.gz' 'ffmpeg-1.1.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/ffmpeg-1.1.2.tar.gz' 'ffmpeg-1.1.2.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/findbugs/install.sh
===================================================================
--- /issm/trunk/externalpackages/findbugs/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/findbugs/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/findbugs-1.3.9.tar.gz' 'findbugs-1.3.9.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/findbugs-1.3.9.tar.gz' 'findbugs-1.3.9.tar.gz'
 tar -zxvf findbugs-1.3.9.tar.gz 
 
Index: /issm/trunk/externalpackages/freetype/install.sh
===================================================================
--- /issm/trunk/externalpackages/freetype/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/freetype/install.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/freetype-2.5.0.tar.gz' 'freetype-2.5.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/freetype-2.5.0.tar.gz' 'freetype-2.5.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/fti/install.sh
===================================================================
--- /issm/trunk/externalpackages/fti/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/fti/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/fti-0.9.2.tgz' 'fti-0.9.2.tgz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/fti-0.9.2.tgz' 'fti-0.9.2.tgz'
 
 #Untar 
Index: /issm/trunk/externalpackages/gdal/install-1.10-linux64-nopython.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-1.10-linux64-nopython.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gdal/install-1.10-linux64-nopython.sh	(revision 24313)
@@ -11,5 +11,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/gdal-1.10.0.tar.gz' 'gdal-1.10.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gdal-1.10.0.tar.gz' 'gdal-1.10.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/gdal/install-1.10-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-1.10-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gdal/install-1.10-linux64.sh	(revision 24313)
@@ -11,5 +11,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/gdal-1.10.0.tar.gz' 'gdal-1.10.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gdal-1.10.0.tar.gz' 'gdal-1.10.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/gdal/install-1.10-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-1.10-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gdal/install-1.10-macosx64.sh	(revision 24313)
@@ -11,5 +11,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/gdal-${GDAL_VER}.tar.gz' 'gdal-${GDAL_VER}.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${GDAL_VER}.tar.gz" "gdal-${GDAL_VER}.tar.gz"
 
 # Untar
Index: /issm/trunk/externalpackages/gdal/install-1.11.2-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/gdal/install-1.11.2-macosx64.sh	(revision 24313)
+++ /issm/trunk/externalpackages/gdal/install-1.11.2-macosx64.sh	(revision 24313)
@@ -0,0 +1,38 @@
+#!/bin/bash
+set -eu
+
+GDAL_VER="1.11.2"
+
+# Some cleanup
+rm -rf src
+rm -rf install
+rm -rf gdal-${GDAL_VER}
+mkdir src install
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/gdal-${GDAL_VER}.tar.gz" "gdal-${GDAL_VER}.tar.gz"
+
+# Untar
+tar -zxvf gdal-${GDAL_VER}.tar.gz
+
+# Move gdal into src directory
+mv gdal-${GDAL_VER}/* src
+rm -rf gdal-${GDAL_VER}
+
+# Configure gdal
+# NOTE: Look for libiconv in /usr/lib/ because there seemed to be a conflict with port's library
+cd src
+./configure \
+	--prefix="$ISSM_DIR/externalpackages/gdal/install" \
+	--with-python \
+	--with-netcdf=no \
+	--with-libiconv-prefix="/usr/lib/" \
+	--without-hdf5
+
+#Compile and install gdal
+if [ $# -eq 0 ]; then
+	make
+else
+	make -j $1
+fi
+make install
Index: /issm/trunk/externalpackages/git/install-macosx64-sierra.sh
===================================================================
--- /issm/trunk/externalpackages/git/install-macosx64-sierra.sh	(revision 24312)
+++ /issm/trunk/externalpackages/git/install-macosx64-sierra.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/git-1.7.10.2.tar.gz' 'git-1.7.10.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/git-1.7.10.2.tar.gz' 'git-1.7.10.2.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/git/install.sh
===================================================================
--- /issm/trunk/externalpackages/git/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/git/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/git-1.7.10.2.tar.gz' 'git-1.7.10.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/git-1.7.10.2.tar.gz' 'git-1.7.10.2.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/gmake/install.sh
===================================================================
--- /issm/trunk/externalpackages/gmake/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gmake/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/make-3.82.tar.gz' 'make-3.82.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/make-3.82.tar.gz' 'make-3.82.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/gmp/install-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/gmp/install-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gmp/install-linux64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/gmp-5.0.5.tar.bz2' 'gmp-5.0.5.tar.bz2'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gmp-5.0.5.tar.bz2' 'gmp-5.0.5.tar.bz2'
 
 #Untar 
Index: /issm/trunk/externalpackages/gmsh/install-mac-precompiled.sh
===================================================================
--- /issm/trunk/externalpackages/gmsh/install-mac-precompiled.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gmsh/install-mac-precompiled.sh	(revision 24313)
@@ -13,5 +13,5 @@
 
 # Download Mac precompiled gmsh from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/${GMSH_TARBALL_NAME}.tar.gz" "${GMSH_TARBALL_NAME}.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${GMSH_TARBALL_NAME}.tar.gz" "${GMSH_TARBALL_NAME}.tar.gz"
 
 # Untar gmsh
Index: /issm/trunk/externalpackages/gmsh/install-win64-precompiled.sh
===================================================================
--- /issm/trunk/externalpackages/gmsh/install-win64-precompiled.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gmsh/install-win64-precompiled.sh	(revision 24313)
@@ -13,5 +13,5 @@
 
 # Download Windows 64-bit precompiled gmsh from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/${TARBALL}" "${TARBALL}"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${TARBALL}" "${TARBALL}"
 
 # Untar gmsh
Index: /issm/trunk/externalpackages/gmsh/install.sh
===================================================================
--- /issm/trunk/externalpackages/gmsh/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gmsh/install.sh	(revision 24313)
@@ -2,32 +2,27 @@
 set -eu
 
-#Some cleanup
+VER="3.0.5"
+
+# Cleanup
 rm -rf install src
-mkdir install
+mkdir install src
 
-#Download latest version
-#svn co --username gmsh --password gmsh https://geuz.org/svn/gmsh/trunk src
-#git clone http://gitlab.onelab.info/gmsh/gmsh.git src
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmsh-${VER}-source.tgz" "gmsh-${VER}-source.tgz"
 
-#Set gmsh version
-GMSH_VER="3.0.5"
+# Untar source
+tar -xvzf gmsh-$VER-source.tgz
 
-#Remove tarball if it exists
-rm -f gmsh-$GMSH_VER-source.tgz
+# Move source to src directory
+mv gmsh-$VER-source/* src
+rm -rf gmsh-$VER-source
 
-#Download last stable version that we know works
-wget http://gmsh.info/src/gmsh-$GMSH_VER-source.tgz
+# Configure
+cd install
+cmake ../src \
+	-DCMAKE_INSTALL_PREFIX="$ISSM_DIR/externalpackages/gmsh/install" \
+	-DENABLE_MPI=1
 
-#Untar gmsh
-tar -xvzf gmsh-$GMSH_VER-source.tgz
-
-#Rename gmsh source directory
-mv gmsh-$GMSH_VER-source src
-
-#Configure
-cd install
-cmake ../src -DCMAKE_INSTALL_PREFIX="$ISSM_DIR/externalpackages/gmsh/install" -DENABLE_MPI=1
-
-#Compile and install
+# Compile
 if [ $# -eq 0 ]; then
 	make
@@ -35,3 +30,5 @@
 	make -j $1
 fi
+
+# Install
 make install
Index: /issm/trunk/externalpackages/gmt/install-jenkins.sh
===================================================================
--- /issm/trunk/externalpackages/gmt/install-jenkins.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gmt/install-jenkins.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/gmt-5.1.1.tar.gz' 'gmt-5.1.1.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gmt-5.1.1.tar.gz' 'gmt-5.1.1.tar.gz'
 
 #install directory
Index: /issm/trunk/externalpackages/gmt/install-mac-precompiled.sh
===================================================================
--- /issm/trunk/externalpackages/gmt/install-mac-precompiled.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gmt/install-mac-precompiled.sh	(revision 24313)
@@ -13,5 +13,5 @@
 
 # Download Mac precompiled gmsh from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/${TARBALL}" "${TARBALL}"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${TARBALL}" "${TARBALL}"
 
 # Untar gmt
Index: /issm/trunk/externalpackages/gmt/install-static.sh
===================================================================
--- /issm/trunk/externalpackages/gmt/install-static.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gmt/install-static.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/gmt-5.1.1.tar.gz' 'gmt-5.1.1.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gmt-5.1.1.tar.gz' 'gmt-5.1.1.tar.gz'
 
 #install directory
Index: /issm/trunk/externalpackages/gmt/install-win64-precompiled.sh
===================================================================
--- /issm/trunk/externalpackages/gmt/install-win64-precompiled.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gmt/install-win64-precompiled.sh	(revision 24313)
@@ -13,5 +13,5 @@
 
 # Download Windows 64-bit precompiled gmsh from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/${TARBALL}" "${TARBALL}"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/${TARBALL}" "${TARBALL}"
 
 # Untar gmt
Index: /issm/trunk/externalpackages/gmt/install.sh
===================================================================
--- /issm/trunk/externalpackages/gmt/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gmt/install.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/gmt-5.1.1.tar.gz' 'gmt-5.1.1.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gmt-5.1.1.tar.gz' 'gmt-5.1.1.tar.gz'
 
 #install directory
Index: /issm/trunk/externalpackages/gshhg/install.sh
===================================================================
--- /issm/trunk/externalpackages/gshhg/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gshhg/install.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/gshhg-gmt-2.3.4.tar.gz' 'gshhg-gmt-2.3.4.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gshhg-gmt-2.3.4.tar.gz' 'gshhg-gmt-2.3.4.tar.gz'
 
 #untar: 
Index: /issm/trunk/externalpackages/gsl/install-android.sh
===================================================================
--- /issm/trunk/externalpackages/gsl/install-android.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gsl/install-android.sh	(revision 24313)
@@ -11,5 +11,5 @@
 
     #Download from ISSM server
-    $ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/gsl-1.' 'gsl-1.15.tar.gz'
+    $ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gsl-1.' 'gsl-1.15.tar.gz'
 
     #Untar 
Index: /issm/trunk/externalpackages/gsl/install-greenplanet.sh
===================================================================
--- /issm/trunk/externalpackages/gsl/install-greenplanet.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gsl/install-greenplanet.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/gsl/install-ios.sh
===================================================================
--- /issm/trunk/externalpackages/gsl/install-ios.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gsl/install-ios.sh	(revision 24313)
@@ -25,5 +25,5 @@
 
     #Download from ISSM server
-    $ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/gsl-1.' 'gsl-1.15.tar.gz'
+    $ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gsl-1.' 'gsl-1.15.tar.gz'
 
     #Untar 
Index: /issm/trunk/externalpackages/gsl/install-javascript.sh
===================================================================
--- /issm/trunk/externalpackages/gsl/install-javascript.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gsl/install-javascript.sh	(revision 24313)
@@ -15,5 +15,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/gsl/install-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/gsl/install-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gsl/install-linux64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/gsl/install-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/gsl/install-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gsl/install-macosx64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/gsl/install-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/gsl/install-pleiades.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gsl/install-pleiades.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/gsl/install-walgreen.sh
===================================================================
--- /issm/trunk/externalpackages/gsl/install-walgreen.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gsl/install-walgreen.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/gslib/install.sh
===================================================================
--- /issm/trunk/externalpackages/gslib/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/gslib/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/gslib90_ls.tar.gz' 'gslib90_ls.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/gslib90_ls.tar.gz' 'gslib90_ls.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/h5py/install.sh
===================================================================
--- /issm/trunk/externalpackages/h5py/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/h5py/install.sh	(revision 24313)
@@ -10,5 +10,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/h5py-2.0.1.tar.gz' 'h5py-2.0.1.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/h5py-2.0.1.tar.gz' 'h5py-2.0.1.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/hdf5/install.sh
===================================================================
--- /issm/trunk/externalpackages/hdf5/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/hdf5/install.sh	(revision 24313)
@@ -2,27 +2,30 @@
 set -eu
 
-#Some cleanup
-rm -rf src install hdf5-1.8.9
+VER="1.8.9"
+
+# Cleanup
+rm -rf src install hdf5-${VER}
 mkdir src install
 
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/hdf5-1.8.9.tar.gz' 'hdf5-1.8.9.tar.gz'
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/hdf5-${VER}.tar.gz" "hdf5-${VER}.tar.gz"
 
-#Untar 
-tar -zxvf  hdf5-1.8.9.tar.gz
+# Untar source
+tar -zxvf  hdf5-${VER}.tar.gz
 
-#Move hdf5 to src directory
+# Move source to src directory
 rm -rf src/*
-mv hdf5-1.8.9/* src/
-rm -rf hdf5-1.8.9
+mv hdf5-${VER}/* src/
+rm -rf hdf5-${VER}
 
-# This project uses C code with C++ style comment default C standard used by 
-# GNU's C compiler's default C standard  does not support C++ style comments.
-# As such, we need to specify a standard that does.
+# This project uses C code with C++-style comments. As such, we need to specify
+# a C standard that supports them.
 export CFLAGS='-std=c99'
 
-#Configure and compile
+# Configure, compile, and install
 cd src
-./configure  --prefix="$ISSM_DIR/externalpackages/hdf5/install" 
+./configure \
+	--prefix="$ISSM_DIR/externalpackages/hdf5/install"
+
 if [ $# -eq 0 ]; then
 	make
Index: /issm/trunk/externalpackages/ipython/install.sh
===================================================================
--- /issm/trunk/externalpackages/ipython/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/ipython/install.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/ipython-1.0.0.tar.gz' 'ipython-1.0.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/ipython-1.0.0.tar.gz' 'ipython-1.0.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/javascript/README
===================================================================
--- /issm/trunk/externalpackages/javascript/README	(revision 24313)
+++ /issm/trunk/externalpackages/javascript/README	(revision 24313)
@@ -0,0 +1,3 @@
+This directory contains, at the time of this writing, JavaScript modules used
+on the VESL Web site. Arguably, they should just be kept in that project's SVN
+repository if no one is pulling them from here.
Index: /issm/trunk/externalpackages/javascript/gauge.min.js
===================================================================
--- /issm/trunk/externalpackages/javascript/gauge.min.js	(revision 24313)
+++ /issm/trunk/externalpackages/javascript/gauge.min.js	(revision 24313)
@@ -0,0 +1,1 @@
+(function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q={}.hasOwnProperty,r=function(a,b){function c(){this.constructor=a}for(var d in b)q.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};!function(){var a,b,c,d,e,f,g;for(g=["ms","moz","webkit","o"],c=0,e=g.length;e>c&&(f=g[c],!window.requestAnimationFrame);c++)window.requestAnimationFrame=window[f+"RequestAnimationFrame"],window.cancelAnimationFrame=window[f+"CancelAnimationFrame"]||window[f+"CancelRequestAnimationFrame"];return a=null,d=0,b={},requestAnimationFrame?window.cancelAnimationFrame?void 0:(a=window.requestAnimationFrame,window.requestAnimationFrame=function(c,e){var f;return f=++d,a(function(){return b[f]?void 0:c()},e),f},window.cancelAnimationFrame=function(a){return b[a]=!0}):(window.requestAnimationFrame=function(a,b){var c,d,e,f;return c=(new Date).getTime(),f=Math.max(0,16-(c-e)),d=window.setTimeout(function(){return a(c+f)},f),e=c+f,d},window.cancelAnimationFrame=function(a){return clearTimeout(a)})}(),String.prototype.hashCode=function(){var a,b,c,d,e;if(b=0,0===this.length)return b;for(c=d=0,e=this.length;e>=0?e>d:d>e;c=e>=0?++d:--d)a=this.charCodeAt(c),b=(b<<5)-b+a,b&=b;return b},o=function(a){var b,c;for(b=Math.floor(a/3600),c=Math.floor((a-3600*b)/60),a-=3600*b+60*c,a+="",c+="";c.length<2;)c="0"+c;for(;a.length<2;)a="0"+a;return b=b?b+":":"",b+c+":"+a},m=function(a){return k(a.toFixed(0))},p=function(a,b){var c,d;for(c in b)q.call(b,c)&&(d=b[c],a[c]=d);return a},n=function(a,b){var c,d,e;d={};for(c in a)q.call(a,c)&&(e=a[c],d[c]=e);for(c in b)q.call(b,c)&&(e=b[c],d[c]=e);return d},k=function(a){var b,c,d,e;for(a+="",c=a.split("."),d=c[0],e="",c.length>1&&(e="."+c[1]),b=/(\d+)(\d{3})/;b.test(d);)d=d.replace(b,"$1,$2");return d+e},l=function(a){return"#"===a.charAt(0)?a.substring(1,7):a},j=function(){function a(a,b){null==a&&(a=!0),this.clear=null!=b?b:!0,a&&AnimationUpdater.add(this)}return a.prototype.animationSpeed=32,a.prototype.update=function(a){var b;return null==a&&(a=!1),a||this.displayedValue!==this.value?(this.ctx&&this.clear&&this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),b=this.value-this.displayedValue,Math.abs(b/this.animationSpeed)<=.001?this.displayedValue=this.value:this.displayedValue=this.displayedValue+b/this.animationSpeed,this.render(),!0):!1},a}(),e=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return r(b,a),b.prototype.displayScale=1,b.prototype.setTextField=function(a){return this.textField=a instanceof i?a:new i(a)},b.prototype.setMinValue=function(a,b){var c,d,e,f,g;if(this.minValue=a,null==b&&(b=!0),b){for(this.displayedValue=this.minValue,f=this.gp||[],g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(c.displayedValue=this.minValue);return g}},b.prototype.setOptions=function(a){return null==a&&(a=null),this.options=n(this.options,a),this.textField&&(this.textField.el.style.fontSize=a.fontSize+"px"),this.options.angle>.5&&(this.gauge.options.angle=.5),this.configDisplayScale(),this},b.prototype.configDisplayScale=function(){var a,b,c,d,e;return d=this.displayScale,this.options.highDpiSupport===!1?delete this.displayScale:(b=window.devicePixelRatio||1,a=this.ctx.webkitBackingStorePixelRatio||this.ctx.mozBackingStorePixelRatio||this.ctx.msBackingStorePixelRatio||this.ctx.oBackingStorePixelRatio||this.ctx.backingStorePixelRatio||1,this.displayScale=b/a),this.displayScale!==d&&(e=this.canvas.G__width||this.canvas.width,c=this.canvas.G__height||this.canvas.height,this.canvas.width=e*this.displayScale,this.canvas.height=c*this.displayScale,this.canvas.style.width=e+"px",this.canvas.style.height=c+"px",this.canvas.G__width=e,this.canvas.G__height=c),this},b}(j),i=function(){function a(a){this.el=a}return a.prototype.render=function(a){return this.el.innerHTML=m(a.displayedValue)},a}(),a=function(a){function b(a,b){this.elem=a,this.text=null!=b?b:!1,this.value=1*this.elem.innerHTML,this.text&&(this.value=0)}return r(b,a),b.prototype.displayedValue=0,b.prototype.value=0,b.prototype.setVal=function(a){return this.value=1*a},b.prototype.render=function(){var a;return a=this.text?o(this.displayedValue.toFixed(0)):k(m(this.displayedValue)),this.elem.innerHTML=a},b}(j),b={create:function(b){var c,d,e,f;for(f=[],d=0,e=b.length;e>d;d++)c=b[d],f.push(new a(c));return f}},h=function(a){function b(a){this.gauge=a,this.ctx=this.gauge.ctx,this.canvas=this.gauge.canvas,b.__super__.constructor.call(this,!1,!1),this.setOptions()}return r(b,a),b.prototype.displayedValue=0,b.prototype.value=0,b.prototype.options={strokeWidth:.035,length:.1,color:"#000000"},b.prototype.setOptions=function(a){return null==a&&(a=null),p(this.options,a),this.length=this.canvas.height*this.options.length,this.strokeWidth=this.canvas.height*this.options.strokeWidth,this.maxValue=this.gauge.maxValue,this.minValue=this.gauge.minValue,this.animationSpeed=this.gauge.animationSpeed,this.options.angle=this.gauge.options.angle},b.prototype.render=function(){var a,b,c,d,e,f,g,h,i;return a=this.gauge.getAngle.call(this,this.displayedValue),b=this.canvas.width/2,c=.9*this.canvas.height,h=Math.round(b+this.length*Math.cos(a)),i=Math.round(c+this.length*Math.sin(a)),f=Math.round(b+this.strokeWidth*Math.cos(a-Math.PI/2)),g=Math.round(c+this.strokeWidth*Math.sin(a-Math.PI/2)),d=Math.round(b+this.strokeWidth*Math.cos(a+Math.PI/2)),e=Math.round(c+this.strokeWidth*Math.sin(a+Math.PI/2)),this.ctx.fillStyle=this.options.color,this.ctx.beginPath(),this.ctx.arc(b,c,this.strokeWidth,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.beginPath(),this.ctx.moveTo(f,g),this.ctx.lineTo(h,i),this.ctx.lineTo(d,e),this.ctx.fill()},b}(j),c=function(){function a(a){this.elem=a}return a.prototype.updateValues=function(a){return this.value=a[0],this.maxValue=a[1],this.avgValue=a[2],this.render()},a.prototype.render=function(){var a,b;return this.textField&&this.textField.text(m(this.value)),0===this.maxValue&&(this.maxValue=2*this.avgValue),b=this.value/this.maxValue*100,a=this.avgValue/this.maxValue*100,$(".bar-value",this.elem).css({width:b+"%"}),$(".typical-value",this.elem).css({width:a+"%"})},a}(),g=function(a){function b(a){this.canvas=a,b.__super__.constructor.call(this),this.percentColors=null,"undefined"!=typeof G_vmlCanvasManager&&(this.canvas=window.G_vmlCanvasManager.initElement(this.canvas)),this.ctx=this.canvas.getContext("2d"),this.gp=[new h(this)],this.setOptions(),this.render()}return r(b,a),b.prototype.elem=null,b.prototype.value=[20],b.prototype.maxValue=80,b.prototype.minValue=0,b.prototype.displayedAngle=0,b.prototype.displayedValue=0,b.prototype.lineWidth=40,b.prototype.paddingBottom=.1,b.prototype.percentColors=null,b.prototype.options={colorStart:"#6fadcf",colorStop:void 0,gradientType:0,strokeColor:"#e0e0e0",pointer:{length:.8,strokeWidth:.035},angle:.15,lineWidth:.44,fontSize:40,limitMax:!1},b.prototype.setOptions=function(a){var c,d,e,f;for(null==a&&(a=null),b.__super__.setOptions.call(this,a),this.configPercentColors(),this.lineWidth=this.canvas.height*(1-this.paddingBottom)*this.options.lineWidth,this.radius=this.canvas.height*(1-this.paddingBottom)-this.lineWidth,this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.render(),f=this.gp,d=0,e=f.length;e>d;d++)c=f[d],c.setOptions(this.options.pointer),c.render();return this},b.prototype.configPercentColors=function(){var a,b,c,d,e,f,g;if(this.percentColors=null,void 0!==this.options.percentColors){for(this.percentColors=new Array,f=[],c=d=0,e=this.options.percentColors.length-1;e>=0?e>=d:d>=e;c=e>=0?++d:--d)g=parseInt(l(this.options.percentColors[c][1]).substring(0,2),16),b=parseInt(l(this.options.percentColors[c][1]).substring(2,4),16),a=parseInt(l(this.options.percentColors[c][1]).substring(4,6),16),f.push(this.percentColors[c]={pct:this.options.percentColors[c][0],color:{r:g,g:b,b:a}});return f}},b.prototype.set=function(a){var b,c,d,e,f,g,i;if(a instanceof Array||(a=[a]),a.length>this.gp.length)for(b=c=0,g=a.length-this.gp.length;g>=0?g>c:c>g;b=g>=0?++c:--c)this.gp.push(new h(this));for(b=0,f=!1,d=0,e=a.length;e>d;d++)i=a[d],i>this.maxValue&&(this.maxValue=1.1*this.value,f=!0),this.gp[b].value=i,this.gp[b++].setOptions({maxValue:this.maxValue,angle:this.options.angle});return this.value=a[a.length-1],f&&this.options.limitMax?void 0:AnimationUpdater.run()},b.prototype.getAngle=function(a){return(1+this.options.angle)*Math.PI+(a-this.minValue)/(this.maxValue-this.minValue)*(1-2*this.options.angle)*Math.PI},b.prototype.getColorForPercentage=function(a,b){var c,d,e,f,g,h,i;if(0===a)c=this.percentColors[0].color;else for(c=this.percentColors[this.percentColors.length-1].color,e=f=0,h=this.percentColors.length-1;h>=0?h>=f:f>=h;e=h>=0?++f:--f)if(a<=this.percentColors[e].pct){b===!0?(i=this.percentColors[e-1],d=this.percentColors[e],g=(a-i.pct)/(d.pct-i.pct),c={r:Math.floor(i.color.r*(1-g)+d.color.r*g),g:Math.floor(i.color.g*(1-g)+d.color.g*g),b:Math.floor(i.color.b*(1-g)+d.color.b*g)}):c=this.percentColors[e].color;break}return"rgb("+[c.r,c.g,c.b].join(",")+")"},b.prototype.getColorForValue=function(a,b){var c;return c=(a-this.minValue)/(this.maxValue-this.minValue),this.getColorForPercentage(c,b)},b.prototype.render=function(){var a,b,c,d,e,f,g,h,i;for(i=this.canvas.width/2,d=this.canvas.height*(1-this.paddingBottom),a=this.getAngle(this.displayedValue),this.textField&&this.textField.render(this),this.ctx.lineCap="butt",void 0!==this.options.customFillStyle?b=this.options.customFillStyle(this):null!==this.percentColors?b=this.getColorForValue(this.displayedValue,!0):void 0!==this.options.colorStop?(b=0===this.options.gradientType?this.ctx.createRadialGradient(i,d,9,i,d,70):this.ctx.createLinearGradient(0,0,i,0),b.addColorStop(0,this.options.colorStart),b.addColorStop(1,this.options.colorStop)):b=this.options.colorStart,this.ctx.strokeStyle=b,this.ctx.beginPath(),this.ctx.arc(i,d,this.radius,(1+this.options.angle)*Math.PI,a,!1),this.ctx.lineWidth=this.lineWidth,this.ctx.stroke(),this.ctx.strokeStyle=this.options.strokeColor,this.ctx.beginPath(),this.ctx.arc(i,d,this.radius,a,(2-this.options.angle)*Math.PI,!1),this.ctx.stroke(),g=this.gp,h=[],e=0,f=g.length;f>e;e++)c=g[e],h.push(c.update(!0));return h},b}(e),d=function(a){function b(a){this.canvas=a,b.__super__.constructor.call(this),"undefined"!=typeof G_vmlCanvasManager&&(this.canvas=window.G_vmlCanvasManager.initElement(this.canvas)),this.ctx=this.canvas.getContext("2d"),this.setOptions(),this.render()}return r(b,a),b.prototype.lineWidth=15,b.prototype.displayedValue=0,b.prototype.value=33,b.prototype.maxValue=80,b.prototype.minValue=0,b.prototype.options={lineWidth:.1,colorStart:"#6f6ea0",colorStop:"#c0c0db",strokeColor:"#eeeeee",shadowColor:"#d5d5d5",angle:.35},b.prototype.getAngle=function(a){return(1-this.options.angle)*Math.PI+(a-this.minValue)/(this.maxValue-this.minValue)*(2+this.options.angle-(1-this.options.angle))*Math.PI},b.prototype.setOptions=function(a){return null==a&&(a=null),b.__super__.setOptions.call(this,a),this.lineWidth=this.canvas.height*this.options.lineWidth,this.radius=this.canvas.height/2-this.lineWidth/2,this},b.prototype.set=function(a){return this.value=a,this.value>this.maxValue&&(this.maxValue=1.1*this.value),AnimationUpdater.run()},b.prototype.render=function(){var a,b,c,d,e,f;return a=this.getAngle(this.displayedValue),f=this.canvas.width/2,c=this.canvas.height/2,this.textField&&this.textField.render(this),b=this.ctx.createRadialGradient(f,c,39,f,c,70),b.addColorStop(0,this.options.colorStart),b.addColorStop(1,this.options.colorStop),d=this.radius-this.lineWidth/2,e=this.radius+this.lineWidth/2,this.ctx.strokeStyle=this.options.strokeColor,this.ctx.beginPath(),this.ctx.arc(f,c,this.radius,(1-this.options.angle)*Math.PI,(2+this.options.angle)*Math.PI,!1),this.ctx.lineWidth=this.lineWidth,this.ctx.lineCap="round",this.ctx.stroke(),this.ctx.strokeStyle=b,this.ctx.beginPath(),this.ctx.arc(f,c,this.radius,(1-this.options.angle)*Math.PI,a,!1),this.ctx.stroke()},b}(e),f=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return r(b,a),b.prototype.strokeGradient=function(a,b,c,d){var e;return e=this.ctx.createRadialGradient(a,b,c,a,b,d),e.addColorStop(0,this.options.shadowColor),e.addColorStop(.12,this.options._orgStrokeColor),e.addColorStop(.88,this.options._orgStrokeColor),e.addColorStop(1,this.options.shadowColor),e},b.prototype.setOptions=function(a){var c,d,e,f;return null==a&&(a=null),b.__super__.setOptions.call(this,a),f=this.canvas.width/2,c=this.canvas.height/2,d=this.radius-this.lineWidth/2,e=this.radius+this.lineWidth/2,this.options._orgStrokeColor=this.options.strokeColor,this.options.strokeColor=this.strokeGradient(f,c,d,e),this},b}(d),window.AnimationUpdater={elements:[],animId:null,addAll:function(a){var b,c,d,e;for(e=[],c=0,d=a.length;d>c;c++)b=a[c],e.push(AnimationUpdater.elements.push(b));return e},add:function(a){return AnimationUpdater.elements.push(a)},run:function(){var a,b,c,d,e;for(a=!0,e=AnimationUpdater.elements,c=0,d=e.length;d>c;c++)b=e[c],b.update()&&(a=!1);return a?cancelAnimationFrame(AnimationUpdater.animId):AnimationUpdater.animId=requestAnimationFrame(AnimationUpdater.run)}},"function"==typeof window.define&&null!=window.define.amd?define(function(){return{Gauge:g,Donut:f,BaseDonut:d,TextRenderer:i}}):"undefined"!=typeof module&&null!=module.exports?module.exports={Gauge:g,Donut:f,BaseDonut:d,TextRenderer:i}:(window.Gauge=g,window.Donut=f,window.BaseDonut=d,window.TextRenderer=i)}).call(this);
Index: /issm/trunk/externalpackages/javascript/gl-matrix-min.js
===================================================================
--- /issm/trunk/externalpackages/javascript/gl-matrix-min.js	(revision 24313)
+++ /issm/trunk/externalpackages/javascript/gl-matrix-min.js	(revision 24313)
@@ -0,0 +1,29 @@
+/**
+ * @fileoverview gl-matrix - High performance matrix and vector operations
+ * @author Brandon Jones
+ * @author Colin MacKenzie IV
+ * @version 2.3.2
+ */
+
+/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE. */
+
+!function(t,a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define(a);else{var n=a();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,function(){return function(t){function a(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,a),o.loaded=!0,o.exports}var n={};return a.m=t,a.c=n,a.p="",a(0)}([function(t,a,n){a.glMatrix=n(1),a.mat2=n(2),a.mat2d=n(3),a.mat3=n(4),a.mat4=n(5),a.quat=n(6),a.vec2=n(9),a.vec3=n(7),a.vec4=n(8)},function(t,a){var n={};n.EPSILON=1e-6,n.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,n.RANDOM=Math.random,n.ENABLE_SIMD=!1,n.SIMD_AVAILABLE=n.ARRAY_TYPE===Float32Array&&"SIMD"in this,n.USE_SIMD=n.ENABLE_SIMD&&n.SIMD_AVAILABLE,n.setMatrixArrayType=function(t){n.ARRAY_TYPE=t};var r=Math.PI/180;n.toRadian=function(t){return t*r},t.exports=n},function(t,a,n){var r=n(1),o={};o.create=function(){var t=new r.ARRAY_TYPE(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},o.clone=function(t){var a=new r.ARRAY_TYPE(4);return a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3],a},o.copy=function(t,a){return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t},o.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},o.transpose=function(t,a){if(t===a){var n=a[1];t[1]=a[2],t[2]=n}else t[0]=a[0],t[1]=a[2],t[2]=a[1],t[3]=a[3];return t},o.invert=function(t,a){var n=a[0],r=a[1],o=a[2],l=a[3],u=n*l-o*r;return u?(u=1/u,t[0]=l*u,t[1]=-r*u,t[2]=-o*u,t[3]=n*u,t):null},o.adjoint=function(t,a){var n=a[0];return t[0]=a[3],t[1]=-a[1],t[2]=-a[2],t[3]=n,t},o.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},o.multiply=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=a[3],e=n[0],M=n[1],i=n[2],s=n[3];return t[0]=r*e+l*M,t[1]=o*e+u*M,t[2]=r*i+l*s,t[3]=o*i+u*s,t},o.mul=o.multiply,o.rotate=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=a[3],e=Math.sin(n),M=Math.cos(n);return t[0]=r*M+l*e,t[1]=o*M+u*e,t[2]=r*-e+l*M,t[3]=o*-e+u*M,t},o.scale=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=a[3],e=n[0],M=n[1];return t[0]=r*e,t[1]=o*e,t[2]=l*M,t[3]=u*M,t},o.fromRotation=function(t,a){var n=Math.sin(a),r=Math.cos(a);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t},o.fromScaling=function(t,a){return t[0]=a[0],t[1]=0,t[2]=0,t[3]=a[1],t},o.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},o.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},o.LDU=function(t,a,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,a,n]},t.exports=o},function(t,a,n){var r=n(1),o={};o.create=function(){var t=new r.ARRAY_TYPE(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},o.clone=function(t){var a=new r.ARRAY_TYPE(6);return a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3],a[4]=t[4],a[5]=t[5],a},o.copy=function(t,a){return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],t},o.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},o.invert=function(t,a){var n=a[0],r=a[1],o=a[2],l=a[3],u=a[4],e=a[5],M=n*l-r*o;return M?(M=1/M,t[0]=l*M,t[1]=-r*M,t[2]=-o*M,t[3]=n*M,t[4]=(o*e-l*u)*M,t[5]=(r*u-n*e)*M,t):null},o.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},o.multiply=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=a[3],e=a[4],M=a[5],i=n[0],s=n[1],c=n[2],D=n[3],S=n[4],I=n[5];return t[0]=r*i+l*s,t[1]=o*i+u*s,t[2]=r*c+l*D,t[3]=o*c+u*D,t[4]=r*S+l*I+e,t[5]=o*S+u*I+M,t},o.mul=o.multiply,o.rotate=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=a[3],e=a[4],M=a[5],i=Math.sin(n),s=Math.cos(n);return t[0]=r*s+l*i,t[1]=o*s+u*i,t[2]=r*-i+l*s,t[3]=o*-i+u*s,t[4]=e,t[5]=M,t},o.scale=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=a[3],e=a[4],M=a[5],i=n[0],s=n[1];return t[0]=r*i,t[1]=o*i,t[2]=l*s,t[3]=u*s,t[4]=e,t[5]=M,t},o.translate=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=a[3],e=a[4],M=a[5],i=n[0],s=n[1];return t[0]=r,t[1]=o,t[2]=l,t[3]=u,t[4]=r*i+l*s+e,t[5]=o*i+u*s+M,t},o.fromRotation=function(t,a){var n=Math.sin(a),r=Math.cos(a);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t[4]=0,t[5]=0,t},o.fromScaling=function(t,a){return t[0]=a[0],t[1]=0,t[2]=0,t[3]=a[1],t[4]=0,t[5]=0,t},o.fromTranslation=function(t,a){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=a[0],t[5]=a[1],t},o.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},o.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},t.exports=o},function(t,a,n){var r=n(1),o={};o.create=function(){var t=new r.ARRAY_TYPE(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},o.fromMat4=function(t,a){return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[4],t[4]=a[5],t[5]=a[6],t[6]=a[8],t[7]=a[9],t[8]=a[10],t},o.clone=function(t){var a=new r.ARRAY_TYPE(9);return a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3],a[4]=t[4],a[5]=t[5],a[6]=t[6],a[7]=t[7],a[8]=t[8],a},o.copy=function(t,a){return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],t[6]=a[6],t[7]=a[7],t[8]=a[8],t},o.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},o.transpose=function(t,a){if(t===a){var n=a[1],r=a[2],o=a[5];t[1]=a[3],t[2]=a[6],t[3]=n,t[5]=a[7],t[6]=r,t[7]=o}else t[0]=a[0],t[1]=a[3],t[2]=a[6],t[3]=a[1],t[4]=a[4],t[5]=a[7],t[6]=a[2],t[7]=a[5],t[8]=a[8];return t},o.invert=function(t,a){var n=a[0],r=a[1],o=a[2],l=a[3],u=a[4],e=a[5],M=a[6],i=a[7],s=a[8],c=s*u-e*i,D=-s*l+e*M,S=i*l-u*M,I=n*c+r*D+o*S;return I?(I=1/I,t[0]=c*I,t[1]=(-s*r+o*i)*I,t[2]=(e*r-o*u)*I,t[3]=D*I,t[4]=(s*n-o*M)*I,t[5]=(-e*n+o*l)*I,t[6]=S*I,t[7]=(-i*n+r*M)*I,t[8]=(u*n-r*l)*I,t):null},o.adjoint=function(t,a){var n=a[0],r=a[1],o=a[2],l=a[3],u=a[4],e=a[5],M=a[6],i=a[7],s=a[8];return t[0]=u*s-e*i,t[1]=o*i-r*s,t[2]=r*e-o*u,t[3]=e*M-l*s,t[4]=n*s-o*M,t[5]=o*l-n*e,t[6]=l*i-u*M,t[7]=r*M-n*i,t[8]=n*u-r*l,t},o.determinant=function(t){var a=t[0],n=t[1],r=t[2],o=t[3],l=t[4],u=t[5],e=t[6],M=t[7],i=t[8];return a*(i*l-u*M)+n*(-i*o+u*e)+r*(M*o-l*e)},o.multiply=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=a[3],e=a[4],M=a[5],i=a[6],s=a[7],c=a[8],D=n[0],S=n[1],I=n[2],x=n[3],f=n[4],F=n[5],m=n[6],h=n[7],d=n[8];return t[0]=D*r+S*u+I*i,t[1]=D*o+S*e+I*s,t[2]=D*l+S*M+I*c,t[3]=x*r+f*u+F*i,t[4]=x*o+f*e+F*s,t[5]=x*l+f*M+F*c,t[6]=m*r+h*u+d*i,t[7]=m*o+h*e+d*s,t[8]=m*l+h*M+d*c,t},o.mul=o.multiply,o.translate=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=a[3],e=a[4],M=a[5],i=a[6],s=a[7],c=a[8],D=n[0],S=n[1];return t[0]=r,t[1]=o,t[2]=l,t[3]=u,t[4]=e,t[5]=M,t[6]=D*r+S*u+i,t[7]=D*o+S*e+s,t[8]=D*l+S*M+c,t},o.rotate=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=a[3],e=a[4],M=a[5],i=a[6],s=a[7],c=a[8],D=Math.sin(n),S=Math.cos(n);return t[0]=S*r+D*u,t[1]=S*o+D*e,t[2]=S*l+D*M,t[3]=S*u-D*r,t[4]=S*e-D*o,t[5]=S*M-D*l,t[6]=i,t[7]=s,t[8]=c,t},o.scale=function(t,a,n){var r=n[0],o=n[1];return t[0]=r*a[0],t[1]=r*a[1],t[2]=r*a[2],t[3]=o*a[3],t[4]=o*a[4],t[5]=o*a[5],t[6]=a[6],t[7]=a[7],t[8]=a[8],t},o.fromTranslation=function(t,a){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=a[0],t[7]=a[1],t[8]=1,t},o.fromRotation=function(t,a){var n=Math.sin(a),r=Math.cos(a);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},o.fromScaling=function(t,a){return t[0]=a[0],t[1]=0,t[2]=0,t[3]=0,t[4]=a[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},o.fromMat2d=function(t,a){return t[0]=a[0],t[1]=a[1],t[2]=0,t[3]=a[2],t[4]=a[3],t[5]=0,t[6]=a[4],t[7]=a[5],t[8]=1,t},o.fromQuat=function(t,a){var n=a[0],r=a[1],o=a[2],l=a[3],u=n+n,e=r+r,M=o+o,i=n*u,s=r*u,c=r*e,D=o*u,S=o*e,I=o*M,x=l*u,f=l*e,F=l*M;return t[0]=1-c-I,t[3]=s-F,t[6]=D+f,t[1]=s+F,t[4]=1-i-I,t[7]=S-x,t[2]=D-f,t[5]=S+x,t[8]=1-i-c,t},o.normalFromMat4=function(t,a){var n=a[0],r=a[1],o=a[2],l=a[3],u=a[4],e=a[5],M=a[6],i=a[7],s=a[8],c=a[9],D=a[10],S=a[11],I=a[12],x=a[13],f=a[14],F=a[15],m=n*e-r*u,h=n*M-o*u,d=n*i-l*u,v=r*M-o*e,z=r*i-l*e,p=o*i-l*M,w=s*x-c*I,A=s*f-D*I,R=s*F-S*I,b=c*f-D*x,Y=c*F-S*x,q=D*F-S*f,y=m*q-h*Y+d*b+v*R-z*A+p*w;return y?(y=1/y,t[0]=(e*q-M*Y+i*b)*y,t[1]=(M*R-u*q-i*A)*y,t[2]=(u*Y-e*R+i*w)*y,t[3]=(o*Y-r*q-l*b)*y,t[4]=(n*q-o*R+l*A)*y,t[5]=(r*R-n*Y-l*w)*y,t[6]=(x*p-f*z+F*v)*y,t[7]=(f*d-I*p-F*h)*y,t[8]=(I*z-x*d+F*m)*y,t):null},o.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},o.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},t.exports=o},function(t,a,n){var r=n(1),o={scalar:{},SIMD:{}};o.create=function(){var t=new r.ARRAY_TYPE(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.clone=function(t){var a=new r.ARRAY_TYPE(16);return a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3],a[4]=t[4],a[5]=t[5],a[6]=t[6],a[7]=t[7],a[8]=t[8],a[9]=t[9],a[10]=t[10],a[11]=t[11],a[12]=t[12],a[13]=t[13],a[14]=t[14],a[15]=t[15],a},o.copy=function(t,a){return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],t[6]=a[6],t[7]=a[7],t[8]=a[8],t[9]=a[9],t[10]=a[10],t[11]=a[11],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15],t},o.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.scalar.transpose=function(t,a){if(t===a){var n=a[1],r=a[2],o=a[3],l=a[6],u=a[7],e=a[11];t[1]=a[4],t[2]=a[8],t[3]=a[12],t[4]=n,t[6]=a[9],t[7]=a[13],t[8]=r,t[9]=l,t[11]=a[14],t[12]=o,t[13]=u,t[14]=e}else t[0]=a[0],t[1]=a[4],t[2]=a[8],t[3]=a[12],t[4]=a[1],t[5]=a[5],t[6]=a[9],t[7]=a[13],t[8]=a[2],t[9]=a[6],t[10]=a[10],t[11]=a[14],t[12]=a[3],t[13]=a[7],t[14]=a[11],t[15]=a[15];return t},o.SIMD.transpose=function(t,a){var n,r,o,l,u,e,M,i,s,c;return n=SIMD.Float32x4.load(a,0),r=SIMD.Float32x4.load(a,4),o=SIMD.Float32x4.load(a,8),l=SIMD.Float32x4.load(a,12),u=SIMD.Float32x4.shuffle(n,r,0,1,4,5),e=SIMD.Float32x4.shuffle(o,l,0,1,4,5),M=SIMD.Float32x4.shuffle(u,e,0,2,4,6),i=SIMD.Float32x4.shuffle(u,e,1,3,5,7),SIMD.Float32x4.store(t,0,M),SIMD.Float32x4.store(t,4,i),u=SIMD.Float32x4.shuffle(n,r,2,3,6,7),e=SIMD.Float32x4.shuffle(o,l,2,3,6,7),s=SIMD.Float32x4.shuffle(u,e,0,2,4,6),c=SIMD.Float32x4.shuffle(u,e,1,3,5,7),SIMD.Float32x4.store(t,8,s),SIMD.Float32x4.store(t,12,c),t},o.transpose=r.USE_SIMD?o.SIMD.transpose:o.scalar.transpose,o.scalar.invert=function(t,a){var n=a[0],r=a[1],o=a[2],l=a[3],u=a[4],e=a[5],M=a[6],i=a[7],s=a[8],c=a[9],D=a[10],S=a[11],I=a[12],x=a[13],f=a[14],F=a[15],m=n*e-r*u,h=n*M-o*u,d=n*i-l*u,v=r*M-o*e,z=r*i-l*e,p=o*i-l*M,w=s*x-c*I,A=s*f-D*I,R=s*F-S*I,b=c*f-D*x,Y=c*F-S*x,q=D*F-S*f,y=m*q-h*Y+d*b+v*R-z*A+p*w;return y?(y=1/y,t[0]=(e*q-M*Y+i*b)*y,t[1]=(o*Y-r*q-l*b)*y,t[2]=(x*p-f*z+F*v)*y,t[3]=(D*z-c*p-S*v)*y,t[4]=(M*R-u*q-i*A)*y,t[5]=(n*q-o*R+l*A)*y,t[6]=(f*d-I*p-F*h)*y,t[7]=(s*p-D*d+S*h)*y,t[8]=(u*Y-e*R+i*w)*y,t[9]=(r*R-n*Y-l*w)*y,t[10]=(I*z-x*d+F*m)*y,t[11]=(c*d-s*z-S*m)*y,t[12]=(e*A-u*b-M*w)*y,t[13]=(n*b-r*A+o*w)*y,t[14]=(x*h-I*v-f*m)*y,t[15]=(s*v-c*h+D*m)*y,t):null},o.SIMD.invert=function(t,a){var n,r,o,l,u,e,M,i,s,c,D=SIMD.Float32x4.load(a,0),S=SIMD.Float32x4.load(a,4),I=SIMD.Float32x4.load(a,8),x=SIMD.Float32x4.load(a,12);return u=SIMD.Float32x4.shuffle(D,S,0,1,4,5),r=SIMD.Float32x4.shuffle(I,x,0,1,4,5),n=SIMD.Float32x4.shuffle(u,r,0,2,4,6),r=SIMD.Float32x4.shuffle(r,u,1,3,5,7),u=SIMD.Float32x4.shuffle(D,S,2,3,6,7),l=SIMD.Float32x4.shuffle(I,x,2,3,6,7),o=SIMD.Float32x4.shuffle(u,l,0,2,4,6),l=SIMD.Float32x4.shuffle(l,u,1,3,5,7),u=SIMD.Float32x4.mul(o,l),u=SIMD.Float32x4.swizzle(u,1,0,3,2),e=SIMD.Float32x4.mul(r,u),M=SIMD.Float32x4.mul(n,u),u=SIMD.Float32x4.swizzle(u,2,3,0,1),e=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,u),e),M=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,u),M),M=SIMD.Float32x4.swizzle(M,2,3,0,1),u=SIMD.Float32x4.mul(r,o),u=SIMD.Float32x4.swizzle(u,1,0,3,2),e=SIMD.Float32x4.add(SIMD.Float32x4.mul(l,u),e),s=SIMD.Float32x4.mul(n,u),u=SIMD.Float32x4.swizzle(u,2,3,0,1),e=SIMD.Float32x4.sub(e,SIMD.Float32x4.mul(l,u)),s=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,u),s),s=SIMD.Float32x4.swizzle(s,2,3,0,1),u=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(r,2,3,0,1),l),u=SIMD.Float32x4.swizzle(u,1,0,3,2),o=SIMD.Float32x4.swizzle(o,2,3,0,1),e=SIMD.Float32x4.add(SIMD.Float32x4.mul(o,u),e),i=SIMD.Float32x4.mul(n,u),u=SIMD.Float32x4.swizzle(u,2,3,0,1),e=SIMD.Float32x4.sub(e,SIMD.Float32x4.mul(o,u)),i=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,u),i),i=SIMD.Float32x4.swizzle(i,2,3,0,1),u=SIMD.Float32x4.mul(n,r),u=SIMD.Float32x4.swizzle(u,1,0,3,2),i=SIMD.Float32x4.add(SIMD.Float32x4.mul(l,u),i),s=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,u),s),u=SIMD.Float32x4.swizzle(u,2,3,0,1),i=SIMD.Float32x4.sub(SIMD.Float32x4.mul(l,u),i),s=SIMD.Float32x4.sub(s,SIMD.Float32x4.mul(o,u)),u=SIMD.Float32x4.mul(n,l),u=SIMD.Float32x4.swizzle(u,1,0,3,2),M=SIMD.Float32x4.sub(M,SIMD.Float32x4.mul(o,u)),i=SIMD.Float32x4.add(SIMD.Float32x4.mul(r,u),i),u=SIMD.Float32x4.swizzle(u,2,3,0,1),M=SIMD.Float32x4.add(SIMD.Float32x4.mul(o,u),M),i=SIMD.Float32x4.sub(i,SIMD.Float32x4.mul(r,u)),u=SIMD.Float32x4.mul(n,o),u=SIMD.Float32x4.swizzle(u,1,0,3,2),M=SIMD.Float32x4.add(SIMD.Float32x4.mul(l,u),M),s=SIMD.Float32x4.sub(s,SIMD.Float32x4.mul(r,u)),u=SIMD.Float32x4.swizzle(u,2,3,0,1),M=SIMD.Float32x4.sub(M,SIMD.Float32x4.mul(l,u)),s=SIMD.Float32x4.add(SIMD.Float32x4.mul(r,u),s),c=SIMD.Float32x4.mul(n,e),c=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(c,2,3,0,1),c),c=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(c,1,0,3,2),c),u=SIMD.Float32x4.reciprocalApproximation(c),c=SIMD.Float32x4.sub(SIMD.Float32x4.add(u,u),SIMD.Float32x4.mul(c,SIMD.Float32x4.mul(u,u))),(c=SIMD.Float32x4.swizzle(c,0,0,0,0))?(SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(c,e)),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(c,M)),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(c,i)),SIMD.Float32x4.store(t,12,SIMD.Float32x4.mul(c,s)),t):null},o.invert=r.USE_SIMD?o.SIMD.invert:o.scalar.invert,o.scalar.adjoint=function(t,a){var n=a[0],r=a[1],o=a[2],l=a[3],u=a[4],e=a[5],M=a[6],i=a[7],s=a[8],c=a[9],D=a[10],S=a[11],I=a[12],x=a[13],f=a[14],F=a[15];return t[0]=e*(D*F-S*f)-c*(M*F-i*f)+x*(M*S-i*D),t[1]=-(r*(D*F-S*f)-c*(o*F-l*f)+x*(o*S-l*D)),t[2]=r*(M*F-i*f)-e*(o*F-l*f)+x*(o*i-l*M),t[3]=-(r*(M*S-i*D)-e*(o*S-l*D)+c*(o*i-l*M)),t[4]=-(u*(D*F-S*f)-s*(M*F-i*f)+I*(M*S-i*D)),t[5]=n*(D*F-S*f)-s*(o*F-l*f)+I*(o*S-l*D),t[6]=-(n*(M*F-i*f)-u*(o*F-l*f)+I*(o*i-l*M)),t[7]=n*(M*S-i*D)-u*(o*S-l*D)+s*(o*i-l*M),t[8]=u*(c*F-S*x)-s*(e*F-i*x)+I*(e*S-i*c),t[9]=-(n*(c*F-S*x)-s*(r*F-l*x)+I*(r*S-l*c)),t[10]=n*(e*F-i*x)-u*(r*F-l*x)+I*(r*i-l*e),t[11]=-(n*(e*S-i*c)-u*(r*S-l*c)+s*(r*i-l*e)),t[12]=-(u*(c*f-D*x)-s*(e*f-M*x)+I*(e*D-M*c)),t[13]=n*(c*f-D*x)-s*(r*f-o*x)+I*(r*D-o*c),t[14]=-(n*(e*f-M*x)-u*(r*f-o*x)+I*(r*M-o*e)),t[15]=n*(e*D-M*c)-u*(r*D-o*c)+s*(r*M-o*e),t},o.SIMD.adjoint=function(t,a){var n,r,o,l,u,e,M,i,s,c,D,S,I,n=SIMD.Float32x4.load(a,0),r=SIMD.Float32x4.load(a,4),o=SIMD.Float32x4.load(a,8),l=SIMD.Float32x4.load(a,12);return s=SIMD.Float32x4.shuffle(n,r,0,1,4,5),e=SIMD.Float32x4.shuffle(o,l,0,1,4,5),u=SIMD.Float32x4.shuffle(s,e,0,2,4,6),e=SIMD.Float32x4.shuffle(e,s,1,3,5,7),s=SIMD.Float32x4.shuffle(n,r,2,3,6,7),i=SIMD.Float32x4.shuffle(o,l,2,3,6,7),M=SIMD.Float32x4.shuffle(s,i,0,2,4,6),i=SIMD.Float32x4.shuffle(i,s,1,3,5,7),s=SIMD.Float32x4.mul(M,i),s=SIMD.Float32x4.swizzle(s,1,0,3,2),c=SIMD.Float32x4.mul(e,s),D=SIMD.Float32x4.mul(u,s),s=SIMD.Float32x4.swizzle(s,2,3,0,1),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(e,s),c),D=SIMD.Float32x4.sub(SIMD.Float32x4.mul(u,s),D),D=SIMD.Float32x4.swizzle(D,2,3,0,1),s=SIMD.Float32x4.mul(e,M),s=SIMD.Float32x4.swizzle(s,1,0,3,2),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,s),c),I=SIMD.Float32x4.mul(u,s),s=SIMD.Float32x4.swizzle(s,2,3,0,1),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(i,s)),I=SIMD.Float32x4.sub(SIMD.Float32x4.mul(u,s),I),I=SIMD.Float32x4.swizzle(I,2,3,0,1),s=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(e,2,3,0,1),i),s=SIMD.Float32x4.swizzle(s,1,0,3,2),M=SIMD.Float32x4.swizzle(M,2,3,0,1),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(M,s),c),S=SIMD.Float32x4.mul(u,s),s=SIMD.Float32x4.swizzle(s,2,3,0,1),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(M,s)),S=SIMD.Float32x4.sub(SIMD.Float32x4.mul(u,s),S),S=SIMD.Float32x4.swizzle(S,2,3,0,1),s=SIMD.Float32x4.mul(u,e),s=SIMD.Float32x4.swizzle(s,1,0,3,2),S=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,s),S),I=SIMD.Float32x4.sub(SIMD.Float32x4.mul(M,s),I),s=SIMD.Float32x4.swizzle(s,2,3,0,1),S=SIMD.Float32x4.sub(SIMD.Float32x4.mul(i,s),S),I=SIMD.Float32x4.sub(I,SIMD.Float32x4.mul(M,s)),s=SIMD.Float32x4.mul(u,i),s=SIMD.Float32x4.swizzle(s,1,0,3,2),D=SIMD.Float32x4.sub(D,SIMD.Float32x4.mul(M,s)),S=SIMD.Float32x4.add(SIMD.Float32x4.mul(e,s),S),s=SIMD.Float32x4.swizzle(s,2,3,0,1),D=SIMD.Float32x4.add(SIMD.Float32x4.mul(M,s),D),S=SIMD.Float32x4.sub(S,SIMD.Float32x4.mul(e,s)),s=SIMD.Float32x4.mul(u,M),s=SIMD.Float32x4.swizzle(s,1,0,3,2),D=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,s),D),I=SIMD.Float32x4.sub(I,SIMD.Float32x4.mul(e,s)),s=SIMD.Float32x4.swizzle(s,2,3,0,1),D=SIMD.Float32x4.sub(D,SIMD.Float32x4.mul(i,s)),I=SIMD.Float32x4.add(SIMD.Float32x4.mul(e,s),I),SIMD.Float32x4.store(t,0,c),SIMD.Float32x4.store(t,4,D),SIMD.Float32x4.store(t,8,S),SIMD.Float32x4.store(t,12,I),t},o.adjoint=r.USE_SIMD?o.SIMD.adjoint:o.scalar.adjoint,o.determinant=function(t){var a=t[0],n=t[1],r=t[2],o=t[3],l=t[4],u=t[5],e=t[6],M=t[7],i=t[8],s=t[9],c=t[10],D=t[11],S=t[12],I=t[13],x=t[14],f=t[15],F=a*u-n*l,m=a*e-r*l,h=a*M-o*l,d=n*e-r*u,v=n*M-o*u,z=r*M-o*e,p=i*I-s*S,w=i*x-c*S,A=i*f-D*S,R=s*x-c*I,b=s*f-D*I,Y=c*f-D*x;return F*Y-m*b+h*R+d*A-v*w+z*p},o.SIMD.multiply=function(t,a,n){var r=SIMD.Float32x4.load(a,0),o=SIMD.Float32x4.load(a,4),l=SIMD.Float32x4.load(a,8),u=SIMD.Float32x4.load(a,12),e=SIMD.Float32x4.load(n,0),M=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(e,0,0,0,0),r),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(e,1,1,1,1),o),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(e,2,2,2,2),l),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(e,3,3,3,3),u))));SIMD.Float32x4.store(t,0,M);var i=SIMD.Float32x4.load(n,4),s=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(i,0,0,0,0),r),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(i,1,1,1,1),o),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(i,2,2,2,2),l),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(i,3,3,3,3),u))));SIMD.Float32x4.store(t,4,s);var c=SIMD.Float32x4.load(n,8),D=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(c,0,0,0,0),r),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(c,1,1,1,1),o),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(c,2,2,2,2),l),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(c,3,3,3,3),u))));SIMD.Float32x4.store(t,8,D);var S=SIMD.Float32x4.load(n,12),I=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(S,0,0,0,0),r),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(S,1,1,1,1),o),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(S,2,2,2,2),l),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(S,3,3,3,3),u))));return SIMD.Float32x4.store(t,12,I),t},o.scalar.multiply=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=a[3],e=a[4],M=a[5],i=a[6],s=a[7],c=a[8],D=a[9],S=a[10],I=a[11],x=a[12],f=a[13],F=a[14],m=a[15],h=n[0],d=n[1],v=n[2],z=n[3];return t[0]=h*r+d*e+v*c+z*x,t[1]=h*o+d*M+v*D+z*f,t[2]=h*l+d*i+v*S+z*F,t[3]=h*u+d*s+v*I+z*m,h=n[4],d=n[5],v=n[6],z=n[7],t[4]=h*r+d*e+v*c+z*x,t[5]=h*o+d*M+v*D+z*f,t[6]=h*l+d*i+v*S+z*F,t[7]=h*u+d*s+v*I+z*m,h=n[8],d=n[9],v=n[10],z=n[11],t[8]=h*r+d*e+v*c+z*x,t[9]=h*o+d*M+v*D+z*f,t[10]=h*l+d*i+v*S+z*F,t[11]=h*u+d*s+v*I+z*m,h=n[12],d=n[13],v=n[14],z=n[15],t[12]=h*r+d*e+v*c+z*x,t[13]=h*o+d*M+v*D+z*f,t[14]=h*l+d*i+v*S+z*F,t[15]=h*u+d*s+v*I+z*m,t},o.multiply=r.USE_SIMD?o.SIMD.multiply:o.scalar.multiply,o.mul=o.multiply,o.scalar.translate=function(t,a,n){var r,o,l,u,e,M,i,s,c,D,S,I,x=n[0],f=n[1],F=n[2];return a===t?(t[12]=a[0]*x+a[4]*f+a[8]*F+a[12],t[13]=a[1]*x+a[5]*f+a[9]*F+a[13],t[14]=a[2]*x+a[6]*f+a[10]*F+a[14],t[15]=a[3]*x+a[7]*f+a[11]*F+a[15]):(r=a[0],o=a[1],l=a[2],u=a[3],e=a[4],M=a[5],i=a[6],s=a[7],c=a[8],D=a[9],S=a[10],I=a[11],t[0]=r,t[1]=o,t[2]=l,t[3]=u,t[4]=e,t[5]=M,t[6]=i,t[7]=s,t[8]=c,t[9]=D,t[10]=S,t[11]=I,t[12]=r*x+e*f+c*F+a[12],t[13]=o*x+M*f+D*F+a[13],t[14]=l*x+i*f+S*F+a[14],t[15]=u*x+s*f+I*F+a[15]),t},o.SIMD.translate=function(t,a,n){var r=SIMD.Float32x4.load(a,0),o=SIMD.Float32x4.load(a,4),l=SIMD.Float32x4.load(a,8),u=SIMD.Float32x4.load(a,12),e=SIMD.Float32x4(n[0],n[1],n[2],0);a!==t&&(t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],t[6]=a[6],t[7]=a[7],t[8]=a[8],t[9]=a[9],t[10]=a[10],t[11]=a[11]),r=SIMD.Float32x4.mul(r,SIMD.Float32x4.swizzle(e,0,0,0,0)),o=SIMD.Float32x4.mul(o,SIMD.Float32x4.swizzle(e,1,1,1,1)),l=SIMD.Float32x4.mul(l,SIMD.Float32x4.swizzle(e,2,2,2,2));var M=SIMD.Float32x4.add(r,SIMD.Float32x4.add(o,SIMD.Float32x4.add(l,u)));return SIMD.Float32x4.store(t,12,M),t},o.translate=r.USE_SIMD?o.SIMD.translate:o.scalar.translate,o.scalar.scale=function(t,a,n){var r=n[0],o=n[1],l=n[2];return t[0]=a[0]*r,t[1]=a[1]*r,t[2]=a[2]*r,t[3]=a[3]*r,t[4]=a[4]*o,t[5]=a[5]*o,t[6]=a[6]*o,t[7]=a[7]*o,t[8]=a[8]*l,t[9]=a[9]*l,t[10]=a[10]*l,t[11]=a[11]*l,t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15],t},o.SIMD.scale=function(t,a,n){var r,o,l,u=SIMD.Float32x4(n[0],n[1],n[2],0);return r=SIMD.Float32x4.load(a,0),SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(r,SIMD.Float32x4.swizzle(u,0,0,0,0))),o=SIMD.Float32x4.load(a,4),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(o,SIMD.Float32x4.swizzle(u,1,1,1,1))),l=SIMD.Float32x4.load(a,8),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(l,SIMD.Float32x4.swizzle(u,2,2,2,2))),t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15],t},o.scale=r.USE_SIMD?o.SIMD.scale:o.scalar.scale,o.rotate=function(t,a,n,o){var l,u,e,M,i,s,c,D,S,I,x,f,F,m,h,d,v,z,p,w,A,R,b,Y,q=o[0],y=o[1],E=o[2],g=Math.sqrt(q*q+y*y+E*E);return Math.abs(g)<r.EPSILON?null:(g=1/g,q*=g,y*=g,E*=g,l=Math.sin(n),u=Math.cos(n),e=1-u,M=a[0],i=a[1],s=a[2],c=a[3],D=a[4],S=a[5],I=a[6],x=a[7],f=a[8],F=a[9],m=a[10],h=a[11],d=q*q*e+u,v=y*q*e+E*l,z=E*q*e-y*l,p=q*y*e-E*l,w=y*y*e+u,A=E*y*e+q*l,R=q*E*e+y*l,b=y*E*e-q*l,Y=E*E*e+u,t[0]=M*d+D*v+f*z,t[1]=i*d+S*v+F*z,t[2]=s*d+I*v+m*z,t[3]=c*d+x*v+h*z,t[4]=M*p+D*w+f*A,t[5]=i*p+S*w+F*A,t[6]=s*p+I*w+m*A,t[7]=c*p+x*w+h*A,t[8]=M*R+D*b+f*Y,t[9]=i*R+S*b+F*Y,t[10]=s*R+I*b+m*Y,t[11]=c*R+x*b+h*Y,a!==t&&(t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t)},o.scalar.rotateX=function(t,a,n){var r=Math.sin(n),o=Math.cos(n),l=a[4],u=a[5],e=a[6],M=a[7],i=a[8],s=a[9],c=a[10],D=a[11];return a!==t&&(t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t[4]=l*o+i*r,t[5]=u*o+s*r,t[6]=e*o+c*r,t[7]=M*o+D*r,t[8]=i*o-l*r,t[9]=s*o-u*r,t[10]=c*o-e*r,t[11]=D*o-M*r,t},o.SIMD.rotateX=function(t,a,n){var r=SIMD.Float32x4.splat(Math.sin(n)),o=SIMD.Float32x4.splat(Math.cos(n));a!==t&&(t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]);var l=SIMD.Float32x4.load(a,4),u=SIMD.Float32x4.load(a,8);return SIMD.Float32x4.store(t,4,SIMD.Float32x4.add(SIMD.Float32x4.mul(l,o),SIMD.Float32x4.mul(u,r))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.sub(SIMD.Float32x4.mul(u,o),SIMD.Float32x4.mul(l,r))),t},o.rotateX=r.USE_SIMD?o.SIMD.rotateX:o.scalar.rotateX,o.scalar.rotateY=function(t,a,n){var r=Math.sin(n),o=Math.cos(n),l=a[0],u=a[1],e=a[2],M=a[3],i=a[8],s=a[9],c=a[10],D=a[11];return a!==t&&(t[4]=a[4],t[5]=a[5],t[6]=a[6],t[7]=a[7],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t[0]=l*o-i*r,t[1]=u*o-s*r,t[2]=e*o-c*r,t[3]=M*o-D*r,t[8]=l*r+i*o,t[9]=u*r+s*o,t[10]=e*r+c*o,t[11]=M*r+D*o,t},o.SIMD.rotateY=function(t,a,n){var r=SIMD.Float32x4.splat(Math.sin(n)),o=SIMD.Float32x4.splat(Math.cos(n));a!==t&&(t[4]=a[4],t[5]=a[5],t[6]=a[6],t[7]=a[7],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]);var l=SIMD.Float32x4.load(a,0),u=SIMD.Float32x4.load(a,8);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.sub(SIMD.Float32x4.mul(l,o),SIMD.Float32x4.mul(u,r))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.add(SIMD.Float32x4.mul(l,r),SIMD.Float32x4.mul(u,o))),t},o.rotateY=r.USE_SIMD?o.SIMD.rotateY:o.scalar.rotateY,o.scalar.rotateZ=function(t,a,n){var r=Math.sin(n),o=Math.cos(n),l=a[0],u=a[1],e=a[2],M=a[3],i=a[4],s=a[5],c=a[6],D=a[7];return a!==t&&(t[8]=a[8],t[9]=a[9],t[10]=a[10],t[11]=a[11],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t[0]=l*o+i*r,t[1]=u*o+s*r,t[2]=e*o+c*r,t[3]=M*o+D*r,t[4]=i*o-l*r,t[5]=s*o-u*r,t[6]=c*o-e*r,t[7]=D*o-M*r,t},o.SIMD.rotateZ=function(t,a,n){var r=SIMD.Float32x4.splat(Math.sin(n)),o=SIMD.Float32x4.splat(Math.cos(n));a!==t&&(t[8]=a[8],t[9]=a[9],t[10]=a[10],t[11]=a[11],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]);var l=SIMD.Float32x4.load(a,0),u=SIMD.Float32x4.load(a,4);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.add(SIMD.Float32x4.mul(l,o),SIMD.Float32x4.mul(u,r))),SIMD.Float32x4.store(t,4,SIMD.Float32x4.sub(SIMD.Float32x4.mul(u,o),SIMD.Float32x4.mul(l,r))),t},o.rotateZ=r.USE_SIMD?o.SIMD.rotateZ:o.scalar.rotateZ,o.fromTranslation=function(t,a){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=a[0],t[13]=a[1],t[14]=a[2],t[15]=1,t},o.fromScaling=function(t,a){return t[0]=a[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=a[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.fromRotation=function(t,a,n){var o,l,u,e=n[0],M=n[1],i=n[2],s=Math.sqrt(e*e+M*M+i*i);return Math.abs(s)<r.EPSILON?null:(s=1/s,e*=s,M*=s,i*=s,o=Math.sin(a),l=Math.cos(a),u=1-l,t[0]=e*e*u+l,t[1]=M*e*u+i*o,t[2]=i*e*u-M*o,t[3]=0,t[4]=e*M*u-i*o,t[5]=M*M*u+l,t[6]=i*M*u+e*o,t[7]=0,t[8]=e*i*u+M*o,t[9]=M*i*u-e*o,t[10]=i*i*u+l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},o.fromXRotation=function(t,a){var n=Math.sin(a),r=Math.cos(a);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.fromYRotation=function(t,a){var n=Math.sin(a),r=Math.cos(a);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.fromZRotation=function(t,a){var n=Math.sin(a),r=Math.cos(a);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.fromRotationTranslation=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=a[3],e=r+r,M=o+o,i=l+l,s=r*e,c=r*M,D=r*i,S=o*M,I=o*i,x=l*i,f=u*e,F=u*M,m=u*i;return t[0]=1-(S+x),t[1]=c+m,t[2]=D-F,t[3]=0,t[4]=c-m,t[5]=1-(s+x),t[6]=I+f,t[7]=0,t[8]=D+F,t[9]=I-f,t[10]=1-(s+S),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},o.fromRotationTranslationScale=function(t,a,n,r){var o=a[0],l=a[1],u=a[2],e=a[3],M=o+o,i=l+l,s=u+u,c=o*M,D=o*i,S=o*s,I=l*i,x=l*s,f=u*s,F=e*M,m=e*i,h=e*s,d=r[0],v=r[1],z=r[2];return t[0]=(1-(I+f))*d,t[1]=(D+h)*d,t[2]=(S-m)*d,t[3]=0,t[4]=(D-h)*v,t[5]=(1-(c+f))*v,t[6]=(x+F)*v,t[7]=0,t[8]=(S+m)*z,t[9]=(x-F)*z,t[10]=(1-(c+I))*z,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},o.fromRotationTranslationScaleOrigin=function(t,a,n,r,o){var l=a[0],u=a[1],e=a[2],M=a[3],i=l+l,s=u+u,c=e+e,D=l*i,S=l*s,I=l*c,x=u*s,f=u*c,F=e*c,m=M*i,h=M*s,d=M*c,v=r[0],z=r[1],p=r[2],w=o[0],A=o[1],R=o[2];return t[0]=(1-(x+F))*v,t[1]=(S+d)*v,t[2]=(I-h)*v,t[3]=0,t[4]=(S-d)*z,t[5]=(1-(D+F))*z,t[6]=(f+m)*z,t[7]=0,t[8]=(I+h)*p,t[9]=(f-m)*p,t[10]=(1-(D+x))*p,t[11]=0,t[12]=n[0]+w-(t[0]*w+t[4]*A+t[8]*R),t[13]=n[1]+A-(t[1]*w+t[5]*A+t[9]*R),t[14]=n[2]+R-(t[2]*w+t[6]*A+t[10]*R),t[15]=1,t},o.fromQuat=function(t,a){var n=a[0],r=a[1],o=a[2],l=a[3],u=n+n,e=r+r,M=o+o,i=n*u,s=r*u,c=r*e,D=o*u,S=o*e,I=o*M,x=l*u,f=l*e,F=l*M;return t[0]=1-c-I,t[1]=s+F,t[2]=D-f,t[3]=0,t[4]=s-F,t[5]=1-i-I,t[6]=S+x,t[7]=0,t[8]=D+f,t[9]=S-x,t[10]=1-i-c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},o.frustum=function(t,a,n,r,o,l,u){var e=1/(n-a),M=1/(o-r),i=1/(l-u);return t[0]=2*l*e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*l*M,t[6]=0,t[7]=0,t[8]=(n+a)*e,t[9]=(o+r)*M,t[10]=(u+l)*i,t[11]=-1,t[12]=0,t[13]=0,t[14]=u*l*2*i,t[15]=0,t},o.perspective=function(t,a,n,r,o){var l=1/Math.tan(a/2),u=1/(r-o);return t[0]=l/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(o+r)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*o*r*u,t[15]=0,t},o.perspectiveFromFieldOfView=function(t,a,n,r){var o=Math.tan(a.upDegrees*Math.PI/180),l=Math.tan(a.downDegrees*Math.PI/180),u=Math.tan(a.leftDegrees*Math.PI/180),e=Math.tan(a.rightDegrees*Math.PI/180),M=2/(u+e),i=2/(o+l);return t[0]=M,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=-((u-e)*M*.5),t[9]=(o-l)*i*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},o.ortho=function(t,a,n,r,o,l,u){var e=1/(a-n),M=1/(r-o),i=1/(l-u);return t[0]=-2*e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*M,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*i,t[11]=0,t[12]=(a+n)*e,t[13]=(o+r)*M,t[14]=(u+l)*i,t[15]=1,t},o.lookAt=function(t,a,n,l){var u,e,M,i,s,c,D,S,I,x,f=a[0],F=a[1],m=a[2],h=l[0],d=l[1],v=l[2],z=n[0],p=n[1],w=n[2];return Math.abs(f-z)<r.EPSILON&&Math.abs(F-p)<r.EPSILON&&Math.abs(m-w)<r.EPSILON?o.identity(t):(D=f-z,S=F-p,I=m-w,x=1/Math.sqrt(D*D+S*S+I*I),D*=x,S*=x,I*=x,u=d*I-v*S,e=v*D-h*I,M=h*S-d*D,x=Math.sqrt(u*u+e*e+M*M),x?(x=1/x,u*=x,e*=x,M*=x):(u=0,e=0,M=0),i=S*M-I*e,s=I*u-D*M,c=D*e-S*u,x=Math.sqrt(i*i+s*s+c*c),x?(x=1/x,i*=x,s*=x,c*=x):(i=0,s=0,c=0),t[0]=u,t[1]=i,t[2]=D,t[3]=0,t[4]=e,t[5]=s,t[6]=S,t[7]=0,t[8]=M,t[9]=c,t[10]=I,t[11]=0,t[12]=-(u*f+e*F+M*m),t[13]=-(i*f+s*F+c*m),t[14]=-(D*f+S*F+I*m),t[15]=1,t)},o.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},o.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},t.exports=o},function(t,a,n){var r=n(1),o=n(4),l=n(7),u=n(8),e={};e.create=function(){var t=new r.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},e.rotationTo=function(){var t=l.create(),a=l.fromValues(1,0,0),n=l.fromValues(0,1,0);return function(r,o,u){var M=l.dot(o,u);return-.999999>M?(l.cross(t,a,o),l.length(t)<1e-6&&l.cross(t,n,o),l.normalize(t,t),e.setAxisAngle(r,t,Math.PI),r):M>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(l.cross(t,o,u),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+M,e.normalize(r,r))}}(),e.setAxes=function(){var t=o.create();return function(a,n,r,o){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=o[0],t[4]=o[1],t[7]=o[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],e.normalize(a,e.fromMat3(a,t))}}(),e.clone=u.clone,e.fromValues=u.fromValues,e.copy=u.copy,e.set=u.set,e.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},e.setAxisAngle=function(t,a,n){n=.5*n;var r=Math.sin(n);return t[0]=r*a[0],t[1]=r*a[1],t[2]=r*a[2],t[3]=Math.cos(n),t},e.add=u.add,e.multiply=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=a[3],e=n[0],M=n[1],i=n[2],s=n[3];return t[0]=r*s+u*e+o*i-l*M,t[1]=o*s+u*M+l*e-r*i,t[2]=l*s+u*i+r*M-o*e,t[3]=u*s-r*e-o*M-l*i,t},e.mul=e.multiply,e.scale=u.scale,e.rotateX=function(t,a,n){n*=.5;var r=a[0],o=a[1],l=a[2],u=a[3],e=Math.sin(n),M=Math.cos(n);return t[0]=r*M+u*e,t[1]=o*M+l*e,t[2]=l*M-o*e,t[3]=u*M-r*e,t},e.rotateY=function(t,a,n){n*=.5;var r=a[0],o=a[1],l=a[2],u=a[3],e=Math.sin(n),M=Math.cos(n);return t[0]=r*M-l*e,t[1]=o*M+u*e,t[2]=l*M+r*e,t[3]=u*M-o*e,t},e.rotateZ=function(t,a,n){n*=.5;var r=a[0],o=a[1],l=a[2],u=a[3],e=Math.sin(n),M=Math.cos(n);return t[0]=r*M+o*e,t[1]=o*M-r*e,t[2]=l*M+u*e,t[3]=u*M-l*e,t},e.calculateW=function(t,a){var n=a[0],r=a[1],o=a[2];return t[0]=n,t[1]=r,t[2]=o,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-o*o)),t},e.dot=u.dot,e.lerp=u.lerp,e.slerp=function(t,a,n,r){var o,l,u,e,M,i=a[0],s=a[1],c=a[2],D=a[3],S=n[0],I=n[1],x=n[2],f=n[3];return l=i*S+s*I+c*x+D*f,0>l&&(l=-l,S=-S,I=-I,x=-x,f=-f),1-l>1e-6?(o=Math.acos(l),u=Math.sin(o),e=Math.sin((1-r)*o)/u,M=Math.sin(r*o)/u):(e=1-r,M=r),t[0]=e*i+M*S,t[1]=e*s+M*I,t[2]=e*c+M*x,t[3]=e*D+M*f,t},e.sqlerp=function(){var t=e.create(),a=e.create();return function(n,r,o,l,u,M){return e.slerp(t,r,u,M),e.slerp(a,o,l,M),e.slerp(n,t,a,2*M*(1-M)),n}}(),e.invert=function(t,a){var n=a[0],r=a[1],o=a[2],l=a[3],u=n*n+r*r+o*o+l*l,e=u?1/u:0;
+return t[0]=-n*e,t[1]=-r*e,t[2]=-o*e,t[3]=l*e,t},e.conjugate=function(t,a){return t[0]=-a[0],t[1]=-a[1],t[2]=-a[2],t[3]=a[3],t},e.length=u.length,e.len=e.length,e.squaredLength=u.squaredLength,e.sqrLen=e.squaredLength,e.normalize=u.normalize,e.fromMat3=function(t,a){var n,r=a[0]+a[4]+a[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(a[5]-a[7])*n,t[1]=(a[6]-a[2])*n,t[2]=(a[1]-a[3])*n;else{var o=0;a[4]>a[0]&&(o=1),a[8]>a[3*o+o]&&(o=2);var l=(o+1)%3,u=(o+2)%3;n=Math.sqrt(a[3*o+o]-a[3*l+l]-a[3*u+u]+1),t[o]=.5*n,n=.5/n,t[3]=(a[3*l+u]-a[3*u+l])*n,t[l]=(a[3*l+o]+a[3*o+l])*n,t[u]=(a[3*u+o]+a[3*o+u])*n}return t},e.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},t.exports=e},function(t,a,n){var r=n(1),o={};o.create=function(){var t=new r.ARRAY_TYPE(3);return t[0]=0,t[1]=0,t[2]=0,t},o.clone=function(t){var a=new r.ARRAY_TYPE(3);return a[0]=t[0],a[1]=t[1],a[2]=t[2],a},o.fromValues=function(t,a,n){var o=new r.ARRAY_TYPE(3);return o[0]=t,o[1]=a,o[2]=n,o},o.copy=function(t,a){return t[0]=a[0],t[1]=a[1],t[2]=a[2],t},o.set=function(t,a,n,r){return t[0]=a,t[1]=n,t[2]=r,t},o.add=function(t,a,n){return t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t},o.subtract=function(t,a,n){return t[0]=a[0]-n[0],t[1]=a[1]-n[1],t[2]=a[2]-n[2],t},o.sub=o.subtract,o.multiply=function(t,a,n){return t[0]=a[0]*n[0],t[1]=a[1]*n[1],t[2]=a[2]*n[2],t},o.mul=o.multiply,o.divide=function(t,a,n){return t[0]=a[0]/n[0],t[1]=a[1]/n[1],t[2]=a[2]/n[2],t},o.div=o.divide,o.min=function(t,a,n){return t[0]=Math.min(a[0],n[0]),t[1]=Math.min(a[1],n[1]),t[2]=Math.min(a[2],n[2]),t},o.max=function(t,a,n){return t[0]=Math.max(a[0],n[0]),t[1]=Math.max(a[1],n[1]),t[2]=Math.max(a[2],n[2]),t},o.scale=function(t,a,n){return t[0]=a[0]*n,t[1]=a[1]*n,t[2]=a[2]*n,t},o.scaleAndAdd=function(t,a,n,r){return t[0]=a[0]+n[0]*r,t[1]=a[1]+n[1]*r,t[2]=a[2]+n[2]*r,t},o.distance=function(t,a){var n=a[0]-t[0],r=a[1]-t[1],o=a[2]-t[2];return Math.sqrt(n*n+r*r+o*o)},o.dist=o.distance,o.squaredDistance=function(t,a){var n=a[0]-t[0],r=a[1]-t[1],o=a[2]-t[2];return n*n+r*r+o*o},o.sqrDist=o.squaredDistance,o.length=function(t){var a=t[0],n=t[1],r=t[2];return Math.sqrt(a*a+n*n+r*r)},o.len=o.length,o.squaredLength=function(t){var a=t[0],n=t[1],r=t[2];return a*a+n*n+r*r},o.sqrLen=o.squaredLength,o.negate=function(t,a){return t[0]=-a[0],t[1]=-a[1],t[2]=-a[2],t},o.inverse=function(t,a){return t[0]=1/a[0],t[1]=1/a[1],t[2]=1/a[2],t},o.normalize=function(t,a){var n=a[0],r=a[1],o=a[2],l=n*n+r*r+o*o;return l>0&&(l=1/Math.sqrt(l),t[0]=a[0]*l,t[1]=a[1]*l,t[2]=a[2]*l),t},o.dot=function(t,a){return t[0]*a[0]+t[1]*a[1]+t[2]*a[2]},o.cross=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=n[0],e=n[1],M=n[2];return t[0]=o*M-l*e,t[1]=l*u-r*M,t[2]=r*e-o*u,t},o.lerp=function(t,a,n,r){var o=a[0],l=a[1],u=a[2];return t[0]=o+r*(n[0]-o),t[1]=l+r*(n[1]-l),t[2]=u+r*(n[2]-u),t},o.hermite=function(t,a,n,r,o,l){var u=l*l,e=u*(2*l-3)+1,M=u*(l-2)+l,i=u*(l-1),s=u*(3-2*l);return t[0]=a[0]*e+n[0]*M+r[0]*i+o[0]*s,t[1]=a[1]*e+n[1]*M+r[1]*i+o[1]*s,t[2]=a[2]*e+n[2]*M+r[2]*i+o[2]*s,t},o.bezier=function(t,a,n,r,o,l){var u=1-l,e=u*u,M=l*l,i=e*u,s=3*l*e,c=3*M*u,D=M*l;return t[0]=a[0]*i+n[0]*s+r[0]*c+o[0]*D,t[1]=a[1]*i+n[1]*s+r[1]*c+o[1]*D,t[2]=a[2]*i+n[2]*s+r[2]*c+o[2]*D,t},o.random=function(t,a){a=a||1;var n=2*r.RANDOM()*Math.PI,o=2*r.RANDOM()-1,l=Math.sqrt(1-o*o)*a;return t[0]=Math.cos(n)*l,t[1]=Math.sin(n)*l,t[2]=o*a,t},o.transformMat4=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=n[3]*r+n[7]*o+n[11]*l+n[15];return u=u||1,t[0]=(n[0]*r+n[4]*o+n[8]*l+n[12])/u,t[1]=(n[1]*r+n[5]*o+n[9]*l+n[13])/u,t[2]=(n[2]*r+n[6]*o+n[10]*l+n[14])/u,t},o.transformMat3=function(t,a,n){var r=a[0],o=a[1],l=a[2];return t[0]=r*n[0]+o*n[3]+l*n[6],t[1]=r*n[1]+o*n[4]+l*n[7],t[2]=r*n[2]+o*n[5]+l*n[8],t},o.transformQuat=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=n[0],e=n[1],M=n[2],i=n[3],s=i*r+e*l-M*o,c=i*o+M*r-u*l,D=i*l+u*o-e*r,S=-u*r-e*o-M*l;return t[0]=s*i+S*-u+c*-M-D*-e,t[1]=c*i+S*-e+D*-u-s*-M,t[2]=D*i+S*-M+s*-e-c*-u,t},o.rotateX=function(t,a,n,r){var o=[],l=[];return o[0]=a[0]-n[0],o[1]=a[1]-n[1],o[2]=a[2]-n[2],l[0]=o[0],l[1]=o[1]*Math.cos(r)-o[2]*Math.sin(r),l[2]=o[1]*Math.sin(r)+o[2]*Math.cos(r),t[0]=l[0]+n[0],t[1]=l[1]+n[1],t[2]=l[2]+n[2],t},o.rotateY=function(t,a,n,r){var o=[],l=[];return o[0]=a[0]-n[0],o[1]=a[1]-n[1],o[2]=a[2]-n[2],l[0]=o[2]*Math.sin(r)+o[0]*Math.cos(r),l[1]=o[1],l[2]=o[2]*Math.cos(r)-o[0]*Math.sin(r),t[0]=l[0]+n[0],t[1]=l[1]+n[1],t[2]=l[2]+n[2],t},o.rotateZ=function(t,a,n,r){var o=[],l=[];return o[0]=a[0]-n[0],o[1]=a[1]-n[1],o[2]=a[2]-n[2],l[0]=o[0]*Math.cos(r)-o[1]*Math.sin(r),l[1]=o[0]*Math.sin(r)+o[1]*Math.cos(r),l[2]=o[2],t[0]=l[0]+n[0],t[1]=l[1]+n[1],t[2]=l[2]+n[2],t},o.forEach=function(){var t=o.create();return function(a,n,r,o,l,u){var e,M;for(n||(n=3),r||(r=0),M=o?Math.min(o*n+r,a.length):a.length,e=r;M>e;e+=n)t[0]=a[e],t[1]=a[e+1],t[2]=a[e+2],l(t,t,u),a[e]=t[0],a[e+1]=t[1],a[e+2]=t[2];return a}}(),o.angle=function(t,a){var n=o.fromValues(t[0],t[1],t[2]),r=o.fromValues(a[0],a[1],a[2]);o.normalize(n,n),o.normalize(r,r);var l=o.dot(n,r);return l>1?0:Math.acos(l)},o.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},t.exports=o},function(t,a,n){var r=n(1),o={};o.create=function(){var t=new r.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},o.clone=function(t){var a=new r.ARRAY_TYPE(4);return a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3],a},o.fromValues=function(t,a,n,o){var l=new r.ARRAY_TYPE(4);return l[0]=t,l[1]=a,l[2]=n,l[3]=o,l},o.copy=function(t,a){return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t},o.set=function(t,a,n,r,o){return t[0]=a,t[1]=n,t[2]=r,t[3]=o,t},o.add=function(t,a,n){return t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t[3]=a[3]+n[3],t},o.subtract=function(t,a,n){return t[0]=a[0]-n[0],t[1]=a[1]-n[1],t[2]=a[2]-n[2],t[3]=a[3]-n[3],t},o.sub=o.subtract,o.multiply=function(t,a,n){return t[0]=a[0]*n[0],t[1]=a[1]*n[1],t[2]=a[2]*n[2],t[3]=a[3]*n[3],t},o.mul=o.multiply,o.divide=function(t,a,n){return t[0]=a[0]/n[0],t[1]=a[1]/n[1],t[2]=a[2]/n[2],t[3]=a[3]/n[3],t},o.div=o.divide,o.min=function(t,a,n){return t[0]=Math.min(a[0],n[0]),t[1]=Math.min(a[1],n[1]),t[2]=Math.min(a[2],n[2]),t[3]=Math.min(a[3],n[3]),t},o.max=function(t,a,n){return t[0]=Math.max(a[0],n[0]),t[1]=Math.max(a[1],n[1]),t[2]=Math.max(a[2],n[2]),t[3]=Math.max(a[3],n[3]),t},o.scale=function(t,a,n){return t[0]=a[0]*n,t[1]=a[1]*n,t[2]=a[2]*n,t[3]=a[3]*n,t},o.scaleAndAdd=function(t,a,n,r){return t[0]=a[0]+n[0]*r,t[1]=a[1]+n[1]*r,t[2]=a[2]+n[2]*r,t[3]=a[3]+n[3]*r,t},o.distance=function(t,a){var n=a[0]-t[0],r=a[1]-t[1],o=a[2]-t[2],l=a[3]-t[3];return Math.sqrt(n*n+r*r+o*o+l*l)},o.dist=o.distance,o.squaredDistance=function(t,a){var n=a[0]-t[0],r=a[1]-t[1],o=a[2]-t[2],l=a[3]-t[3];return n*n+r*r+o*o+l*l},o.sqrDist=o.squaredDistance,o.length=function(t){var a=t[0],n=t[1],r=t[2],o=t[3];return Math.sqrt(a*a+n*n+r*r+o*o)},o.len=o.length,o.squaredLength=function(t){var a=t[0],n=t[1],r=t[2],o=t[3];return a*a+n*n+r*r+o*o},o.sqrLen=o.squaredLength,o.negate=function(t,a){return t[0]=-a[0],t[1]=-a[1],t[2]=-a[2],t[3]=-a[3],t},o.inverse=function(t,a){return t[0]=1/a[0],t[1]=1/a[1],t[2]=1/a[2],t[3]=1/a[3],t},o.normalize=function(t,a){var n=a[0],r=a[1],o=a[2],l=a[3],u=n*n+r*r+o*o+l*l;return u>0&&(u=1/Math.sqrt(u),t[0]=n*u,t[1]=r*u,t[2]=o*u,t[3]=l*u),t},o.dot=function(t,a){return t[0]*a[0]+t[1]*a[1]+t[2]*a[2]+t[3]*a[3]},o.lerp=function(t,a,n,r){var o=a[0],l=a[1],u=a[2],e=a[3];return t[0]=o+r*(n[0]-o),t[1]=l+r*(n[1]-l),t[2]=u+r*(n[2]-u),t[3]=e+r*(n[3]-e),t},o.random=function(t,a){return a=a||1,t[0]=r.RANDOM(),t[1]=r.RANDOM(),t[2]=r.RANDOM(),t[3]=r.RANDOM(),o.normalize(t,t),o.scale(t,t,a),t},o.transformMat4=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=a[3];return t[0]=n[0]*r+n[4]*o+n[8]*l+n[12]*u,t[1]=n[1]*r+n[5]*o+n[9]*l+n[13]*u,t[2]=n[2]*r+n[6]*o+n[10]*l+n[14]*u,t[3]=n[3]*r+n[7]*o+n[11]*l+n[15]*u,t},o.transformQuat=function(t,a,n){var r=a[0],o=a[1],l=a[2],u=n[0],e=n[1],M=n[2],i=n[3],s=i*r+e*l-M*o,c=i*o+M*r-u*l,D=i*l+u*o-e*r,S=-u*r-e*o-M*l;return t[0]=s*i+S*-u+c*-M-D*-e,t[1]=c*i+S*-e+D*-u-s*-M,t[2]=D*i+S*-M+s*-e-c*-u,t[3]=a[3],t},o.forEach=function(){var t=o.create();return function(a,n,r,o,l,u){var e,M;for(n||(n=4),r||(r=0),M=o?Math.min(o*n+r,a.length):a.length,e=r;M>e;e+=n)t[0]=a[e],t[1]=a[e+1],t[2]=a[e+2],t[3]=a[e+3],l(t,t,u),a[e]=t[0],a[e+1]=t[1],a[e+2]=t[2],a[e+3]=t[3];return a}}(),o.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},t.exports=o},function(t,a,n){var r=n(1),o={};o.create=function(){var t=new r.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},o.clone=function(t){var a=new r.ARRAY_TYPE(2);return a[0]=t[0],a[1]=t[1],a},o.fromValues=function(t,a){var n=new r.ARRAY_TYPE(2);return n[0]=t,n[1]=a,n},o.copy=function(t,a){return t[0]=a[0],t[1]=a[1],t},o.set=function(t,a,n){return t[0]=a,t[1]=n,t},o.add=function(t,a,n){return t[0]=a[0]+n[0],t[1]=a[1]+n[1],t},o.subtract=function(t,a,n){return t[0]=a[0]-n[0],t[1]=a[1]-n[1],t},o.sub=o.subtract,o.multiply=function(t,a,n){return t[0]=a[0]*n[0],t[1]=a[1]*n[1],t},o.mul=o.multiply,o.divide=function(t,a,n){return t[0]=a[0]/n[0],t[1]=a[1]/n[1],t},o.div=o.divide,o.min=function(t,a,n){return t[0]=Math.min(a[0],n[0]),t[1]=Math.min(a[1],n[1]),t},o.max=function(t,a,n){return t[0]=Math.max(a[0],n[0]),t[1]=Math.max(a[1],n[1]),t},o.scale=function(t,a,n){return t[0]=a[0]*n,t[1]=a[1]*n,t},o.scaleAndAdd=function(t,a,n,r){return t[0]=a[0]+n[0]*r,t[1]=a[1]+n[1]*r,t},o.distance=function(t,a){var n=a[0]-t[0],r=a[1]-t[1];return Math.sqrt(n*n+r*r)},o.dist=o.distance,o.squaredDistance=function(t,a){var n=a[0]-t[0],r=a[1]-t[1];return n*n+r*r},o.sqrDist=o.squaredDistance,o.length=function(t){var a=t[0],n=t[1];return Math.sqrt(a*a+n*n)},o.len=o.length,o.squaredLength=function(t){var a=t[0],n=t[1];return a*a+n*n},o.sqrLen=o.squaredLength,o.negate=function(t,a){return t[0]=-a[0],t[1]=-a[1],t},o.inverse=function(t,a){return t[0]=1/a[0],t[1]=1/a[1],t},o.normalize=function(t,a){var n=a[0],r=a[1],o=n*n+r*r;return o>0&&(o=1/Math.sqrt(o),t[0]=a[0]*o,t[1]=a[1]*o),t},o.dot=function(t,a){return t[0]*a[0]+t[1]*a[1]},o.cross=function(t,a,n){var r=a[0]*n[1]-a[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},o.lerp=function(t,a,n,r){var o=a[0],l=a[1];return t[0]=o+r*(n[0]-o),t[1]=l+r*(n[1]-l),t},o.random=function(t,a){a=a||1;var n=2*r.RANDOM()*Math.PI;return t[0]=Math.cos(n)*a,t[1]=Math.sin(n)*a,t},o.transformMat2=function(t,a,n){var r=a[0],o=a[1];return t[0]=n[0]*r+n[2]*o,t[1]=n[1]*r+n[3]*o,t},o.transformMat2d=function(t,a,n){var r=a[0],o=a[1];return t[0]=n[0]*r+n[2]*o+n[4],t[1]=n[1]*r+n[3]*o+n[5],t},o.transformMat3=function(t,a,n){var r=a[0],o=a[1];return t[0]=n[0]*r+n[3]*o+n[6],t[1]=n[1]*r+n[4]*o+n[7],t},o.transformMat4=function(t,a,n){var r=a[0],o=a[1];return t[0]=n[0]*r+n[4]*o+n[12],t[1]=n[1]*r+n[5]*o+n[13],t},o.forEach=function(){var t=o.create();return function(a,n,r,o,l,u){var e,M;for(n||(n=2),r||(r=0),M=o?Math.min(o*n+r,a.length):a.length,e=r;M>e;e+=n)t[0]=a[e],t[1]=a[e+1],l(t,t,u),a[e]=t[0],a[e+1]=t[1];return a}}(),o.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},t.exports=o}])});
Index: /issm/trunk/externalpackages/javascript/hammer.min.js
===================================================================
--- /issm/trunk/externalpackages/javascript/hammer.min.js	(revision 24313)
+++ /issm/trunk/externalpackages/javascript/hammer.min.js	(revision 24313)
@@ -0,0 +1,6 @@
+/*! Hammer.JS - v2.0.4 - 2014-09-28
+ * http://hammerjs.github.io/
+ *
+ * Copyright (c) 2014 Jorik Tangelder;
+ * Licensed under the MIT license */
+!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(k(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a}function i(a,b){return h(a,b,!0)}function j(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&h(d,c)}function k(a,b){return function(){return a.apply(b,arguments)}}function l(a,b){return typeof a==kb?a.apply(b?b[0]||d:d,b):a}function m(a,b){return a===d?b:a}function n(a,b,c){g(r(b),function(b){a.addEventListener(b,c,!1)})}function o(a,b,c){g(r(b),function(b){a.removeEventListener(b,c,!1)})}function p(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function q(a,b){return a.indexOf(b)>-1}function r(a){return a.trim().split(/\s+/g)}function s(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function t(a){return Array.prototype.slice.call(a,0)}function u(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];s(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function v(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ib.length;){if(c=ib[g],e=c?c+f:b,e in a)return e;g++}return d}function w(){return ob++}function x(a){var b=a.ownerDocument;return b.defaultView||b.parentWindow}function y(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){l(a.options.enable,[a])&&c.handler(b)},this.init()}function z(a){var b,c=a.options.inputClass;return new(b=c?c:rb?N:sb?Q:qb?S:M)(a,A)}function A(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&yb&&d-e===0,g=b&(Ab|Bb)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,B(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function B(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=E(b)),e>1&&!c.firstMultiple?c.firstMultiple=E(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=F(d);b.timeStamp=nb(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=J(h,i),b.distance=I(h,i),C(c,b),b.offsetDirection=H(b.deltaX,b.deltaY),b.scale=g?L(g.pointers,d):1,b.rotation=g?K(g.pointers,d):0,D(c,b);var j=a.element;p(b.srcEvent.target,j)&&(j=b.srcEvent.target),b.target=j}function C(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};(b.eventType===yb||f.eventType===Ab)&&(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function D(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Bb&&(i>xb||h.velocity===d)){var j=h.deltaX-b.deltaX,k=h.deltaY-b.deltaY,l=G(i,j,k);e=l.x,f=l.y,c=mb(l.x)>mb(l.y)?l.x:l.y,g=H(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function E(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:lb(a.pointers[c].clientX),clientY:lb(a.pointers[c].clientY)},c++;return{timeStamp:nb(),pointers:b,center:F(b),deltaX:a.deltaX,deltaY:a.deltaY}}function F(a){var b=a.length;if(1===b)return{x:lb(a[0].clientX),y:lb(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:lb(c/b),y:lb(d/b)}}function G(a,b,c){return{x:b/a||0,y:c/a||0}}function H(a,b){return a===b?Cb:mb(a)>=mb(b)?a>0?Db:Eb:b>0?Fb:Gb}function I(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function J(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function K(a,b){return J(b[1],b[0],Lb)-J(a[1],a[0],Lb)}function L(a,b){return I(b[0],b[1],Lb)/I(a[0],a[1],Lb)}function M(){this.evEl=Nb,this.evWin=Ob,this.allow=!0,this.pressed=!1,y.apply(this,arguments)}function N(){this.evEl=Rb,this.evWin=Sb,y.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function O(){this.evTarget=Ub,this.evWin=Vb,this.started=!1,y.apply(this,arguments)}function P(a,b){var c=t(a.touches),d=t(a.changedTouches);return b&(Ab|Bb)&&(c=u(c.concat(d),"identifier",!0)),[c,d]}function Q(){this.evTarget=Xb,this.targetIds={},y.apply(this,arguments)}function R(a,b){var c=t(a.touches),d=this.targetIds;if(b&(yb|zb)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=t(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return p(a.target,i)}),b===yb)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Ab|Bb)&&delete d[g[e].identifier],e++;return h.length?[u(f.concat(h),"identifier",!0),h]:void 0}function S(){y.apply(this,arguments);var a=k(this.handler,this);this.touch=new Q(this.manager,a),this.mouse=new M(this.manager,a)}function T(a,b){this.manager=a,this.set(b)}function U(a){if(q(a,bc))return bc;var b=q(a,cc),c=q(a,dc);return b&&c?cc+" "+dc:b||c?b?cc:dc:q(a,ac)?ac:_b}function V(a){this.id=w(),this.manager=null,this.options=i(a||{},this.defaults),this.options.enable=m(this.options.enable,!0),this.state=ec,this.simultaneous={},this.requireFail=[]}function W(a){return a&jc?"cancel":a&hc?"end":a&gc?"move":a&fc?"start":""}function X(a){return a==Gb?"down":a==Fb?"up":a==Db?"left":a==Eb?"right":""}function Y(a,b){var c=b.manager;return c?c.get(a):a}function Z(){V.apply(this,arguments)}function $(){Z.apply(this,arguments),this.pX=null,this.pY=null}function _(){Z.apply(this,arguments)}function ab(){V.apply(this,arguments),this._timer=null,this._input=null}function bb(){Z.apply(this,arguments)}function cb(){Z.apply(this,arguments)}function db(){V.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function eb(a,b){return b=b||{},b.recognizers=m(b.recognizers,eb.defaults.preset),new fb(a,b)}function fb(a,b){b=b||{},this.options=i(b,eb.defaults),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.element=a,this.input=z(this),this.touchAction=new T(this,this.options.touchAction),gb(this,!0),g(b.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function gb(a,b){var c=a.element;g(a.options.cssProps,function(a,d){c.style[v(c.style,d)]=b?a:""})}function hb(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var ib=["","webkit","moz","MS","ms","o"],jb=b.createElement("div"),kb="function",lb=Math.round,mb=Math.abs,nb=Date.now,ob=1,pb=/mobile|tablet|ip(ad|hone|od)|android/i,qb="ontouchstart"in a,rb=v(a,"PointerEvent")!==d,sb=qb&&pb.test(navigator.userAgent),tb="touch",ub="pen",vb="mouse",wb="kinect",xb=25,yb=1,zb=2,Ab=4,Bb=8,Cb=1,Db=2,Eb=4,Fb=8,Gb=16,Hb=Db|Eb,Ib=Fb|Gb,Jb=Hb|Ib,Kb=["x","y"],Lb=["clientX","clientY"];y.prototype={handler:function(){},init:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(x(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&o(this.element,this.evEl,this.domHandler),this.evTarget&&o(this.target,this.evTarget,this.domHandler),this.evWin&&o(x(this.element),this.evWin,this.domHandler)}};var Mb={mousedown:yb,mousemove:zb,mouseup:Ab},Nb="mousedown",Ob="mousemove mouseup";j(M,y,{handler:function(a){var b=Mb[a.type];b&yb&&0===a.button&&(this.pressed=!0),b&zb&&1!==a.which&&(b=Ab),this.pressed&&this.allow&&(b&Ab&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:vb,srcEvent:a}))}});var Pb={pointerdown:yb,pointermove:zb,pointerup:Ab,pointercancel:Bb,pointerout:Bb},Qb={2:tb,3:ub,4:vb,5:wb},Rb="pointerdown",Sb="pointermove pointerup pointercancel";a.MSPointerEvent&&(Rb="MSPointerDown",Sb="MSPointerMove MSPointerUp MSPointerCancel"),j(N,y,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Pb[d],f=Qb[a.pointerType]||a.pointerType,g=f==tb,h=s(b,a.pointerId,"pointerId");e&yb&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ab|Bb)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Tb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Ub="touchstart",Vb="touchstart touchmove touchend touchcancel";j(O,y,{handler:function(a){var b=Tb[a.type];if(b===yb&&(this.started=!0),this.started){var c=P.call(this,a,b);b&(Ab|Bb)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}});var Wb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Xb="touchstart touchmove touchend touchcancel";j(Q,y,{handler:function(a){var b=Wb[a.type],c=R.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}),j(S,y,{handler:function(a,b,c){var d=c.pointerType==tb,e=c.pointerType==vb;if(d)this.mouse.allow=!1;else if(e&&!this.mouse.allow)return;b&(Ab|Bb)&&(this.mouse.allow=!0),this.callback(a,b,c)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Yb=v(jb.style,"touchAction"),Zb=Yb!==d,$b="compute",_b="auto",ac="manipulation",bc="none",cc="pan-x",dc="pan-y";T.prototype={set:function(a){a==$b&&(a=this.compute()),Zb&&(this.manager.element.style[Yb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){l(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),U(a.join(" "))},preventDefaults:function(a){if(!Zb){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=q(d,bc),f=q(d,dc),g=q(d,cc);return e||f&&c&Hb||g&&c&Ib?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var ec=1,fc=2,gc=4,hc=8,ic=hc,jc=16,kc=32;V.prototype={defaults:{},set:function(a){return h(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=Y(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=Y(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=Y(a,this),-1===s(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=Y(a,this);var b=s(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(c.options.event+(b?W(d):""),a)}var c=this,d=this.state;hc>d&&b(!0),b(),d>=hc&&b(!0)},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=kc)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(kc|ec)))return!1;a++}return!0},recognize:function(a){var b=h({},a);return l(this.options.enable,[this,b])?(this.state&(ic|jc|kc)&&(this.state=ec),this.state=this.process(b),void(this.state&(fc|gc|hc|jc)&&this.tryEmit(b))):(this.reset(),void(this.state=kc))},process:function(){},getTouchAction:function(){},reset:function(){}},j(Z,V,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(fc|gc),e=this.attrTest(a);return d&&(c&Bb||!e)?b|jc:d||e?c&Ab?b|hc:b&fc?b|gc:fc:kc}}),j($,Z,{defaults:{event:"pan",threshold:10,pointers:1,direction:Jb},getTouchAction:function(){var a=this.options.direction,b=[];return a&Hb&&b.push(dc),a&Ib&&b.push(cc),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Hb?(e=0===f?Cb:0>f?Db:Eb,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Cb:0>g?Fb:Gb,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return Z.prototype.attrTest.call(this,a)&&(this.state&fc||!(this.state&fc)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=X(a.direction);b&&this.manager.emit(this.options.event+b,a),this._super.emit.call(this,a)}}),j(_,Z,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&fc)},emit:function(a){if(this._super.emit.call(this,a),1!==a.scale){var b=a.scale<1?"in":"out";this.manager.emit(this.options.event+b,a)}}}),j(ab,V,{defaults:{event:"press",pointers:1,time:500,threshold:5},getTouchAction:function(){return[_b]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ab|Bb)&&!f)this.reset();else if(a.eventType&yb)this.reset(),this._timer=e(function(){this.state=ic,this.tryEmit()},b.time,this);else if(a.eventType&Ab)return ic;return kc},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===ic&&(a&&a.eventType&Ab?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=nb(),this.manager.emit(this.options.event,this._input)))}}),j(bb,Z,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&fc)}}),j(cb,Z,{defaults:{event:"swipe",threshold:10,velocity:.65,direction:Hb|Ib,pointers:1},getTouchAction:function(){return $.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Hb|Ib)?b=a.velocity:c&Hb?b=a.velocityX:c&Ib&&(b=a.velocityY),this._super.attrTest.call(this,a)&&c&a.direction&&a.distance>this.options.threshold&&mb(b)>this.options.velocity&&a.eventType&Ab},emit:function(a){var b=X(a.direction);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),j(db,V,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return[ac]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),a.eventType&yb&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ab)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||I(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e(function(){this.state=ic,this.tryEmit()},b.interval,this),fc):ic}return kc},failTimeout:function(){return this._timer=e(function(){this.state=kc},this.options.interval,this),kc},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ic&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),eb.VERSION="2.0.4",eb.defaults={domEvents:!1,touchAction:$b,enable:!0,inputTarget:null,inputClass:null,preset:[[bb,{enable:!1}],[_,{enable:!1},["rotate"]],[cb,{direction:Hb}],[$,{direction:Hb},["swipe"]],[db],[db,{event:"doubletap",taps:2},["tap"]],[ab]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var lc=1,mc=2;fb.prototype={set:function(a){return h(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?mc:lc},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&ic)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===mc||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(fc|gc|hc)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof V)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;var b=this.recognizers;return a=this.get(a),b.splice(s(b,a),1),this.touchAction.update(),this},on:function(a,b){var c=this.handlers;return g(r(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this},off:function(a,b){var c=this.handlers;return g(r(a),function(a){b?c[a].splice(s(c[a],b),1):delete c[a]}),this},emit:function(a,b){this.options.domEvents&&hb(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&gb(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},h(eb,{INPUT_START:yb,INPUT_MOVE:zb,INPUT_END:Ab,INPUT_CANCEL:Bb,STATE_POSSIBLE:ec,STATE_BEGAN:fc,STATE_CHANGED:gc,STATE_ENDED:hc,STATE_RECOGNIZED:ic,STATE_CANCELLED:jc,STATE_FAILED:kc,DIRECTION_NONE:Cb,DIRECTION_LEFT:Db,DIRECTION_RIGHT:Eb,DIRECTION_UP:Fb,DIRECTION_DOWN:Gb,DIRECTION_HORIZONTAL:Hb,DIRECTION_VERTICAL:Ib,DIRECTION_ALL:Jb,Manager:fb,Input:y,TouchAction:T,TouchInput:Q,MouseInput:M,PointerEventInput:N,TouchMouseInput:S,SingleTouchInput:O,Recognizer:V,AttrRecognizer:Z,Tap:db,Pan:$,Swipe:cb,Pinch:_,Rotate:bb,Press:ab,on:n,off:o,each:g,merge:i,extend:h,inherit:j,bindFn:k,prefixed:v}),typeof define==kb&&define.amd?define(function(){return eb}):"undefined"!=typeof module&&module.exports?module.exports=eb:a[c]=eb}(window,document,"Hammer");
Index: /issm/trunk/externalpackages/javascript/jquery.min.js
===================================================================
--- /issm/trunk/externalpackages/javascript/jquery.min.js	(revision 24313)
+++ /issm/trunk/externalpackages/javascript/jquery.min.js	(revision 24313)
@@ -0,0 +1,4 @@
+/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;
+if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")
+},cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.ActiveXObject&&m(a).on("unload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});
Index: /issm/trunk/externalpackages/javascript/jsonfn.js
===================================================================
--- /issm/trunk/externalpackages/javascript/jsonfn.js	(revision 24313)
+++ /issm/trunk/externalpackages/javascript/jsonfn.js	(revision 24313)
@@ -0,0 +1,84 @@
+/**
+* JSONfn - javascript (both node.js and browser) plugin to stringify, 
+*          parse and clone objects with Functions, Regexp and Date.
+*  
+* Version - 0.60.00
+* Copyright (c) 2012 - 2015 Vadim Kiryukhin
+* vkiryukhin @ gmail.com
+* http://www.eslinstructor.net/jsonfn/
+* 
+* Licensed under the MIT license ( http://www.opensource.org/licenses/mit-license.php )
+*
+*   USAGE:
+*     browser:
+*         JSONfn.stringify(obj);
+*         JSONfn.parse(str[, date2obj]);
+*         JSONfn.clone(obj[, date2obj]);
+*
+*     nodejs:
+*       var JSONfn = require('path/to/json-fn');
+*       JSONfn.stringify(obj);
+*       JSONfn.parse(str[, date2obj]);
+*       JSONfn.clone(obj[, date2obj]);
+*
+*
+*     @obj      -  Object;
+*     @str      -  String, which is returned by JSONfn.stringify() function; 
+*     @date2obj - Boolean (optional); if true, date string in ISO8061 format
+*                 is converted into a Date object; otherwise, it is left as a String.
+*/
+
+"use strict";
+
+(function (exports) {
+
+  exports.stringify = function (obj) {
+
+    return JSON.stringify(obj, function (key, value) {
+      if (value instanceof Function || typeof value == 'function') {
+        return value.toString();
+      }
+      if (value instanceof RegExp) {
+        return '_PxEgEr_' + value;
+      }
+      return value;
+    });
+  };
+
+  exports.parse = function (str, date2obj) {
+
+    var iso8061 = date2obj ? /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/ : false;
+
+    return JSON.parse(str, function (key, value) {
+      var prefix;
+
+      if (typeof value != 'string') {
+        return value;
+      }
+      if (value.length < 8) {
+        return value;
+      }
+
+      prefix = value.substring(0, 8);
+
+      if (iso8061 && value.match(iso8061)) {
+        return new Date(value);
+      }
+      if (prefix === 'function') {
+        return eval('(' + value + ')');
+      }
+      if (prefix === '_PxEgEr_') {
+        return eval(value.slice(8));
+      }
+
+      return value;
+    });
+  };
+
+  exports.clone = function (obj, date2obj) {
+    return exports.parse(exports.stringify(obj), date2obj);
+  };
+
+}(typeof exports === 'undefined' ? (window.JSONfn = {}) : exports));
+
+
Index: /issm/trunk/externalpackages/javascript/sprintf.js
===================================================================
--- /issm/trunk/externalpackages/javascript/sprintf.js	(revision 24313)
+++ /issm/trunk/externalpackages/javascript/sprintf.js	(revision 24313)
@@ -0,0 +1,190 @@
+function sprintf() {
+  //  discuss at: http://phpjs.org/functions/sprintf/
+  // original by: Ash Searle (http://hexmen.com/blog/)
+  // improved by: Michael White (http://getsprink.com)
+  // improved by: Jack
+  // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
+  // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
+  // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
+  // improved by: Dj
+  // improved by: Allidylls
+  //    input by: Paulo Freitas
+  //    input by: Brett Zamir (http://brett-zamir.me)
+  //   example 1: sprintf("%01.2f", 123.1);
+  //   returns 1: 123.10
+  //   example 2: sprintf("[%10s]", 'monkey');
+  //   returns 2: '[    monkey]'
+  //   example 3: sprintf("[%'#10s]", 'monkey');
+  //   returns 3: '[####monkey]'
+  //   example 4: sprintf("%d", 123456789012345);
+  //   returns 4: '123456789012345'
+  //   example 5: sprintf('%-03s', 'E');
+  //   returns 5: 'E00'
+
+  var regex = /%%|%(\d+\$)?([\-+\'#0 ]*)(\*\d+\$|\*|\d+)?(?:\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g;
+  var a = arguments;
+  var i = 0;
+  var format = a[i++];
+
+  // pad()
+  var pad = function(str, len, chr, leftJustify) {
+    if (!chr) {
+      chr = ' ';
+    }
+    var padding = (str.length >= len) ? '' : new Array(1 + len - str.length >>> 0)
+      .join(chr);
+    return leftJustify ? str + padding : padding + str;
+  };
+
+  // justify()
+  var justify = function(value, prefix, leftJustify, minWidth, zeroPad, customPadChar) {
+    var diff = minWidth - value.length;
+    if (diff > 0) {
+      if (leftJustify || !zeroPad) {
+        value = pad(value, minWidth, customPadChar, leftJustify);
+      } else {
+        value = value.slice(0, prefix.length) + pad('', diff, '0', true) + value.slice(prefix.length);
+      }
+    }
+    return value;
+  };
+
+  // formatBaseX()
+  var formatBaseX = function(value, base, prefix, leftJustify, minWidth, precision, zeroPad) {
+    // Note: casts negative numbers to positive ones
+    var number = value >>> 0;
+    prefix = (prefix && number && {
+      '2'  : '0b',
+      '8'  : '0',
+      '16' : '0x'
+    }[base]) || '';
+    value = prefix + pad(number.toString(base), precision || 0, '0', false);
+    return justify(value, prefix, leftJustify, minWidth, zeroPad);
+  };
+
+  // formatString()
+  var formatString = function(value, leftJustify, minWidth, precision, zeroPad, customPadChar) {
+    if (precision !== null && precision !== undefined) {
+      value = value.slice(0, precision);
+    }
+    return justify(value, '', leftJustify, minWidth, zeroPad, customPadChar);
+  };
+
+  // doFormat()
+  var doFormat = function(substring, valueIndex, flags, minWidth, precision, type) {
+    var number, prefix, method, textTransform, value;
+
+    if (substring === '%%') {
+      return '%';
+    }
+
+    // parse flags
+    var leftJustify = false;
+    var positivePrefix = '';
+    var zeroPad = false;
+    var prefixBaseX = false;
+    var customPadChar = ' ';
+    var flagsl = flags.length;
+    var j;
+    for (j = 0; flags && j < flagsl; j++) {
+      switch (flags.charAt(j)) {
+      case ' ':
+        positivePrefix = ' ';
+        break;
+      case '+':
+        positivePrefix = '+';
+        break;
+      case '-':
+        leftJustify = true;
+        break;
+      case "'":
+        customPadChar = flags.charAt(j + 1);
+        break;
+      case '0':
+        zeroPad = true;
+        customPadChar = '0';
+        break;
+      case '#':
+        prefixBaseX = true;
+        break;
+      }
+    }
+
+    // parameters may be null, undefined, empty-string or real valued
+    // we want to ignore null, undefined and empty-string values
+    if (!minWidth) {
+      minWidth = 0;
+    } else if (minWidth === '*') {
+      minWidth = +a[i++];
+    } else if (minWidth.charAt(0) === '*') {
+      minWidth = +a[minWidth.slice(1, -1)];
+    } else {
+      minWidth = +minWidth;
+    }
+
+    // Note: undocumented perl feature:
+    if (minWidth < 0) {
+      minWidth = -minWidth;
+      leftJustify = true;
+    }
+
+    if (!isFinite(minWidth)) {
+      throw new Error('sprintf: (minimum-)width must be finite');
+    }
+
+    if (!precision) {
+      precision = 'fFeE'.indexOf(type) > -1 ? 6 : (type === 'd') ? 0 : undefined;
+    } else if (precision === '*') {
+      precision = +a[i++];
+    } else if (precision.charAt(0) === '*') {
+      precision = +a[precision.slice(1, -1)];
+    } else {
+      precision = +precision;
+    }
+
+    // grab value using valueIndex if required?
+    value = valueIndex ? a[valueIndex.slice(0, -1)] : a[i++];
+
+    switch (type) {
+    case 's':
+      return formatString(String(value), leftJustify, minWidth, precision, zeroPad, customPadChar);
+    case 'c':
+      return formatString(String.fromCharCode(+value), leftJustify, minWidth, precision, zeroPad);
+    case 'b':
+      return formatBaseX(value, 2, prefixBaseX, leftJustify, minWidth, precision, zeroPad);
+    case 'o':
+      return formatBaseX(value, 8, prefixBaseX, leftJustify, minWidth, precision, zeroPad);
+    case 'x':
+      return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad);
+    case 'X':
+      return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad)
+        .toUpperCase();
+    case 'u':
+      return formatBaseX(value, 10, prefixBaseX, leftJustify, minWidth, precision, zeroPad);
+    case 'i':
+    case 'd':
+      number = +value || 0;
+      // Plain Math.round doesn't just truncate
+      number = Math.round(number - number % 1);
+      prefix = number < 0 ? '-' : positivePrefix;
+      value = prefix + pad(String(Math.abs(number)), precision, '0', false);
+      return justify(value, prefix, leftJustify, minWidth, zeroPad);
+    case 'e':
+    case 'E':
+    case 'f': // Should handle locales (as per setlocale)
+    case 'F':
+    case 'g':
+    case 'G':
+      number = +value;
+      prefix = number < 0 ? '-' : positivePrefix;
+      method = ['toExponential', 'toFixed', 'toPrecision']['efg'.indexOf(type.toLowerCase())];
+      textTransform = ['toString', 'toUpperCase']['eEfFgG'.indexOf(type) % 2];
+      value = prefix + Math.abs(number)[method](precision);
+      return justify(value, prefix, leftJustify, minWidth, zeroPad)[textTransform]();
+    default:
+      return substring;
+    }
+  };
+
+  return format.replace(regex, doFormat);
+}
Index: /issm/trunk/externalpackages/kml/install.sh
===================================================================
--- /issm/trunk/externalpackages/kml/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/kml/install.sh	(revision 24313)
@@ -3,3 +3,3 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/kml_shapefile.zip' 'kml_shapefile.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/kml_shapefile.zip' 'kml_shapefile.zip'
Index: /issm/trunk/externalpackages/lapack/install-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/lapack/install-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/lapack/install-linux64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/lapack-3.4.1.tgz' 'lapack-3.4.1.tgz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/lapack-3.4.1.tgz' 'lapack-3.4.1.tgz'
 
 #Untar 
Index: /issm/trunk/externalpackages/lapack/install-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/lapack/install-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/lapack/install-macosx64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/lapack-3.4.1.tgz' 'lapack-3.4.1.tgz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/lapack-3.4.1.tgz' 'lapack-3.4.1.tgz'
 
 #Untar 
Index: /issm/trunk/externalpackages/latex2rtf/install.sh
===================================================================
--- /issm/trunk/externalpackages/latex2rtf/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/latex2rtf/install.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/latex2rtf-2.0.0.tar.gz' 'latex2rtf-2.0.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/latex2rtf-2.0.0.tar.gz' 'latex2rtf-2.0.0.tar.gz'
 
 #untar 
Index: /issm/trunk/externalpackages/libermate/install.sh
===================================================================
--- /issm/trunk/externalpackages/libermate/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/libermate/install.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/libermate-0.4.tgz' 'libermate-0.4.tgz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/libermate-0.4.tgz' 'libermate-0.4.tgz'
 
 #Untar 
Index: /issm/trunk/externalpackages/libpng/install.sh
===================================================================
--- /issm/trunk/externalpackages/libpng/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/libpng/install.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/libpng-1.5.10.tar.gz' 'libpng-1.5.10.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/libpng-1.5.10.tar.gz' 'libpng-1.5.10.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/m1qn3/install-macosx64-snowleopard.sh
===================================================================
--- /issm/trunk/externalpackages/m1qn3/install-macosx64-snowleopard.sh	(revision 24312)
+++ /issm/trunk/externalpackages/m1qn3/install-macosx64-snowleopard.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/m1qn3-3.3-distrib.tgz' 'm1qn3-3.3-distrib.tgz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/m1qn3-3.3-distrib.tgz' 'm1qn3-3.3-distrib.tgz'
 
 #Untar 
Index: /issm/trunk/externalpackages/m1qn3/install.sh
===================================================================
--- /issm/trunk/externalpackages/m1qn3/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/m1qn3/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/m1qn3-3.3-distrib.tgz' 'm1qn3-3.3-distrib.tgz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/m1qn3-3.3-distrib.tgz' 'm1qn3-3.3-distrib.tgz'
 
 #Untar 
Index: /issm/trunk/externalpackages/m2html/install.sh
===================================================================
--- /issm/trunk/externalpackages/m2html/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/m2html/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/m2html.zip' 'm2html.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/m2html.zip' 'm2html.zip'
 
 #uncompress
Index: /issm/trunk/externalpackages/math77/install.sh
===================================================================
--- /issm/trunk/externalpackages/math77/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/math77/install.sh	(revision 24313)
@@ -7,8 +7,8 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/math77.tar.gz' 'math77.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/math77.tar.gz' 'math77.tar.gz'
 
-#Untar
-tar -zxvf math77.tar.gz
+#Untar 
+tar -zxvf  math77.tar.gz
 
 #Move math77 into src directory
@@ -25,3 +25,3 @@
 	make -j $1
 fi
-make install
+make install 
Index: /issm/trunk/externalpackages/mercurial/install.sh
===================================================================
--- /issm/trunk/externalpackages/mercurial/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mercurial/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mercurial-1.7.3.tar.gz' 'mercurial-1.7.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mercurial-1.7.3.tar.gz' 'mercurial-1.7.3.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/metis/install-4.0-altix64.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-altix64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/metis/install-4.0-altix64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/metis/install-4.0-cosmos.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-cosmos.sh	(revision 24312)
+++ /issm/trunk/externalpackages/metis/install-4.0-cosmos.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/metis/install-4.0-discover.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-discover.sh	(revision 24312)
+++ /issm/trunk/externalpackages/metis/install-4.0-discover.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/metis/install-4.0-greenplanet.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-greenplanet.sh	(revision 24312)
+++ /issm/trunk/externalpackages/metis/install-4.0-greenplanet.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/metis/install-4.0-hoffman2.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-hoffman2.sh	(revision 24312)
+++ /issm/trunk/externalpackages/metis/install-4.0-hoffman2.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/metis/install-4.0-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/metis/install-4.0-linux64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/metis/install-4.0-macosx32.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-macosx32.sh	(revision 24312)
+++ /issm/trunk/externalpackages/metis/install-4.0-macosx32.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/metis/install-4.0-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/metis/install-4.0-macosx64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/metis/install-4.0-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-pleiades.sh	(revision 24312)
+++ /issm/trunk/externalpackages/metis/install-4.0-pleiades.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/metis/install-4.0-win10.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-win10.sh	(revision 24312)
+++ /issm/trunk/externalpackages/metis/install-4.0-win10.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/metis/install-4.0-win32.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-4.0-win32.sh	(revision 24312)
+++ /issm/trunk/externalpackages/metis/install-4.0-win32.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-4.0.tar.gz' 'metis-4.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/metis/install-5.0.1-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/metis/install-5.0.1-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/metis/install-5.0.1-linux64.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/metis-5.0.1.tar.gz' 'metis-5.0.1.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/metis-5.0.1.tar.gz' 'metis-5.0.1.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/modelE/install.sh
===================================================================
--- /issm/trunk/externalpackages/modelE/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/modelE/install.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/modelE_AR5_branch.2012.03.13_10.12.21.tgz' 'modelE_AR5_branch.2012.03.13_10.12.21.tgz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/modelE_AR5_branch.2012.03.13_10.12.21.tgz' 'modelE_AR5_branch.2012.03.13_10.12.21.tgz'
 
 #Untar 
Index: /issm/trunk/externalpackages/modules/install-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/modules/install-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/modules/install-macosx64.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/modules-3.2.9c.tar.gz' 'modules-3.2.9c.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/modules-3.2.9c.tar.gz' 'modules-3.2.9c.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/modules/install.sh
===================================================================
--- /issm/trunk/externalpackages/modules/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/modules/install.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh http://issm.jpl.nasa.gov/files/externalpackages/modules-3.2.9c.tar.gz modules-3.2.9c.tar.gz
+$ISSM_DIR/scripts/DownloadExternalPackage.sh https://issm.ess.uci.edu/files/externalpackages/modules-3.2.9c.tar.gz modules-3.2.9c.tar.gz
 
 #Untar and move python into install directory
Index: /issm/trunk/externalpackages/mpich/install-2_1.4-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-2_1.4-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-2_1.4-linux64.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich2-1.4.tar.gz' 'mpich2-1.4.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich2-1.4.tar.gz' 'mpich2-1.4.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/mpich/install-2_1.4-macosx32.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-2_1.4-macosx32.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-2_1.4-macosx32.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich2-1.4.tar.gz' 'mpich2-1.4.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich2-1.4.tar.gz' 'mpich2-1.4.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/mpich/install-2_1.4-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-2_1.4-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-2_1.4-macosx64.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich2-1.4.tar.gz' 'mpich2-1.4.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich2-1.4.tar.gz' 'mpich2-1.4.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/mpich/install-2_1.4.1-p1-win7.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-2_1.4.1-p1-win7.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-2_1.4.1-p1-win7.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich2-1.4.1p1-win-x86-64.msi' 'mpich2-1.4.1p1-win-x86-64.msi'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich2-1.4.1p1-win-x86-64.msi' 'mpich2-1.4.1p1-win-x86-64.msi'
 
 #once installed, create a symbolic link between the MPICH2 directory 
Index: /issm/trunk/externalpackages/mpich/install-2_1.5-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-2_1.5-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-2_1.5-linux64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich2-1.5.tar.gz' 'mpich2-1.5.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich2-1.5.tar.gz' 'mpich2-1.5.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/mpich/install-2_1.5-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-2_1.5-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-2_1.5-macosx64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich2-1.5.tar.gz' 'mpich2-1.5.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich2-1.5.tar.gz' 'mpich2-1.5.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/mpich/install-2_1.5-walgreen.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-2_1.5-walgreen.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-2_1.5-walgreen.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich2-1.5.tar.gz' 'mpich2-1.5.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich2-1.5.tar.gz' 'mpich2-1.5.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/mpich/install-3.0-cyclone.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-3.0-cyclone.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-3.0-cyclone.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/mpich/install-3.0-linux64-static.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-3.0-linux64-static.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-3.0-linux64-static.sh	(revision 24313)
@@ -11,5 +11,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/mpich/install-3.0-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-3.0-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-3.0-linux64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/mpich/install-3.0-macosx64-gforker.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-3.0-macosx64-gforker.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-3.0-macosx64-gforker.sh	(revision 24313)
@@ -12,5 +12,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/mpich/install-3.0-macosx64-nothreads.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-3.0-macosx64-nothreads.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-3.0-macosx64-nothreads.sh	(revision 24313)
@@ -11,5 +11,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/mpich/install-3.0-macosx64-snowleopard-dakota.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-3.0-macosx64-snowleopard-dakota.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-3.0-macosx64-snowleopard-dakota.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/mpich/install-3.0-macosx64-static.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-3.0-macosx64-static.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-3.0-macosx64-static.sh	(revision 24313)
@@ -7,7 +7,7 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
 
-#Untar
+#Untar 
 tar -zxvf  mpich-3.0.4.tar.gz
 
@@ -19,8 +19,5 @@
 cd src
 ./configure \
-	--prefix="$ISSM_DIR/externalpackages/mpich/install" \
-	--enable-strict=all \
-	--enable-fast \
-	--with-pic
+	--prefix="$ISSM_DIR/externalpackages/mpich/install"
 
 #Compile mpich (this new version supports parallel make)
@@ -30,3 +27,3 @@
 	make -j $1
 fi
-make install
+make install 
Index: /issm/trunk/externalpackages/mpich/install-3.0-macosx64-yosemite-dakota.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-3.0-macosx64-yosemite-dakota.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-3.0-macosx64-yosemite-dakota.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/mpich/install-3.0-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-3.0-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-3.0-macosx64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich-3.0.4.tar.gz' 'mpich-3.0.4.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/mpich/install-3.2-linux64-static.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-3.2-linux64-static.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-3.2-linux64-static.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich-3.2.tar.gz' 'mpich-3.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich-3.2.tar.gz' 'mpich-3.2.tar.gz'
 
 #Untar
Index: /issm/trunk/externalpackages/mpich/install-3.2-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-3.2-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-3.2-linux64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich-3.2.tar.gz' 'mpich-3.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich-3.2.tar.gz' 'mpich-3.2.tar.gz'
 
 #Untar
Index: /issm/trunk/externalpackages/mpich/install-3.2-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/mpich/install-3.2-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mpich/install-3.2-macosx64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mpich-3.2.tar.gz' 'mpich-3.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mpich-3.2.tar.gz' 'mpich-3.2.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/mumps/install-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/mumps/install-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/mumps/install-macosx64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/mumps-4.10.0-p3.tar.gz' 'mumps-4.10.0-p3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/mumps-4.10.0-p3.tar.gz' 'mumps-4.10.0-p3.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/nco/install.sh
===================================================================
--- /issm/trunk/externalpackages/nco/install.sh	(revision 24313)
+++ /issm/trunk/externalpackages/nco/install.sh	(revision 24313)
@@ -0,0 +1,23 @@
+#!/bin/bash
+set -eu
+#you need hdf5 compiled
+
+#Some cleanup
+rm -rf install 
+mkdir install 
+
+git clone https://github.com/nco/nco.git install
+cd install
+git checkout 4.7.9
+
+#Configure and compile
+./configure \
+ --disable-doc \
+ --prefix="$ISSM_DIR/externalpackages/nco/install" 
+
+if [ $# -eq 0 ]; then
+	make
+else
+	make -j $1
+fi
+make install
Index: /issm/trunk/externalpackages/ncview/install.sh
===================================================================
--- /issm/trunk/externalpackages/ncview/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/ncview/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/ncview-1.93g.tar.gz' 'ncview-1.93g.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/ncview-1.93g.tar.gz' 'ncview-1.93g.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/netcdf-cxx/install.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf-cxx/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/netcdf-cxx/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/netcdf-cxx-4.2.tar.gz' 'netcdf-cxx-4.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/netcdf-cxx-4.2.tar.gz' 'netcdf-cxx-4.2.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/netcdf-python/install.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf-python/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/netcdf-python/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/netCDF4-1.0.tar.gz" "netCDF4-1.0.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netCDF4-1.0.tar.gz" "netCDF4-1.0.tar.gz"
 
 #Untar 
Index: /issm/trunk/externalpackages/netcdf/install.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/netcdf/install.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/netcdf-4.3.2.tar.gz" "netcdf-4.3.2.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netcdf-4.3.2.tar.gz" "netcdf-4.3.2.tar.gz"
 
 #Untar 
Index: /issm/trunk/externalpackages/nose/install-linux64-python2.sh
===================================================================
--- /issm/trunk/externalpackages/nose/install-linux64-python2.sh	(revision 24312)
+++ /issm/trunk/externalpackages/nose/install-linux64-python2.sh	(revision 24313)
@@ -5,5 +5,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/nose-1.1.2.tar.gz' 'nose-1.1.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/nose-1.1.2.tar.gz' 'nose-1.1.2.tar.gz'
 tar -zxvf  nose-1.1.2.tar.gz
 mv nose-1.1.2 src
Index: /issm/trunk/externalpackages/nose/install-macosx64-python2.sh
===================================================================
--- /issm/trunk/externalpackages/nose/install-macosx64-python2.sh	(revision 24312)
+++ /issm/trunk/externalpackages/nose/install-macosx64-python2.sh	(revision 24313)
@@ -5,5 +5,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/nose-1.1.2.tar.gz' 'nose-1.1.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/nose-1.1.2.tar.gz' 'nose-1.1.2.tar.gz'
 tar -zxvf  nose-1.1.2.tar.gz
 mv nose-1.1.2 src
Index: /issm/trunk/externalpackages/numpy/install-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/numpy/install-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/numpy/install-linux64.sh	(revision 24313)
@@ -17,5 +17,5 @@
 #export GIT_SSL_NO_VERIFY=true 
 #git clone https://github.com/numpy/numpy.git
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/numpy-1.7.0b2.tar.gz' 'numpy-1.7.0b2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/numpy-1.7.0b2.tar.gz' 'numpy-1.7.0b2.tar.gz'
 
 #install numpy
Index: /issm/trunk/externalpackages/numpy/install-macosx-lion.sh
===================================================================
--- /issm/trunk/externalpackages/numpy/install-macosx-lion.sh	(revision 24312)
+++ /issm/trunk/externalpackages/numpy/install-macosx-lion.sh	(revision 24313)
@@ -15,5 +15,5 @@
 #export GIT_SSL_NO_VERIFY=true 
 #git clone https://github.com/numpy/numpy.git
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/numpy-1.7.0b2.tar.gz' 'numpy-1.7.0b2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/numpy-1.7.0b2.tar.gz' 'numpy-1.7.0b2.tar.gz'
 
 #install numpy
Index: /issm/trunk/externalpackages/numpy/install-macosx-mlion.sh
===================================================================
--- /issm/trunk/externalpackages/numpy/install-macosx-mlion.sh	(revision 24312)
+++ /issm/trunk/externalpackages/numpy/install-macosx-mlion.sh	(revision 24313)
@@ -15,5 +15,5 @@
 #export GIT_SSL_NO_VERIFY=true 
 #git clone https://github.com/numpy/numpy.git
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/numpy-1.7.0b2.tar.gz' 'numpy-1.7.0b2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/numpy-1.7.0b2.tar.gz' 'numpy-1.7.0b2.tar.gz'
 
 #install numpy
Index: /issm/trunk/externalpackages/numpy/install-macosx-snowleopard.sh
===================================================================
--- /issm/trunk/externalpackages/numpy/install-macosx-snowleopard.sh	(revision 24312)
+++ /issm/trunk/externalpackages/numpy/install-macosx-snowleopard.sh	(revision 24313)
@@ -16,5 +16,5 @@
 #export GIT_SSL_NO_VERIFY=true 
 #git clone https://github.com/numpy/numpy.git
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/numpy-1.7.0b2.tar.gz' 'numpy-1.7.0b2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/numpy-1.7.0b2.tar.gz' 'numpy-1.7.0b2.tar.gz'
 
 #install numpy
Index: /issm/trunk/externalpackages/octave/install.sh
===================================================================
--- /issm/trunk/externalpackages/octave/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/octave/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "http://issm.jpl.nasa.gov/files/externalpackages/octave-3.6.2.tar.gz" "octave-3.6.2.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/octave-3.6.2.tar.gz" "octave-3.6.2.tar.gz"
 
 #Untar 
Index: /issm/trunk/externalpackages/oofem/install.sh
===================================================================
--- /issm/trunk/externalpackages/oofem/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/oofem/install.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/oofem-2.0.tar.gz' 'oofem-2.0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/oofem-2.0.tar.gz' 'oofem-2.0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/openssl/install.sh
===================================================================
--- /issm/trunk/externalpackages/openssl/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/openssl/install.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download latest version
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/openssl-0.9.8x.tar.gz' 'openssl-0.9.8x.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/openssl-0.9.8x.tar.gz' 'openssl-0.9.8x.tar.gz'
 
 #Untar
Index: /issm/trunk/externalpackages/pcatool/install.sh
===================================================================
--- /issm/trunk/externalpackages/pcatool/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/pcatool/install.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/pcatool.tar.gz' 'pcatool.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/pcatool.tar.gz' 'pcatool.tar.gz'
 
 #Untar  into install
Index: /issm/trunk/externalpackages/pcre/install.sh
===================================================================
--- /issm/trunk/externalpackages/pcre/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/pcre/install.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/pcre-8.21.tar.gz' 'pcre-8.21.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/pcre-8.21.tar.gz' 'pcre-8.21.tar.gz'
 
 #Untar and move python into install directory
Index: /issm/trunk/externalpackages/petsc/install-3.11-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.11-linux64.sh	(revision 24313)
+++ /issm/trunk/externalpackages/petsc/install-3.11-linux64.sh	(revision 24313)
@@ -0,0 +1,36 @@
+#!/bin/bash
+set -eu
+
+#Some cleanup
+rm -rf install petsc-3.11.0 src
+mkdir install src
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.11.0.tar.gz' 'petsc-3.11.0.tar.gz'
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-3.11.0.tar.gz
+mv petsc-3.11.0/* src/
+rm -rf petsc-3.11.0
+
+#configure
+cd src
+./config/configure.py \
+	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
+	--with-mpi-dir="$ISSM_DIR/externalpackages/mpich/install" \
+	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+	--with-debugging=1 \
+	--with-valgrind=0 \
+	--with-x=0 \
+	--with-ssl=0 \
+	--with-shared-libraries=1 \
+	--download-metis=1 \
+	--download-parmetis=1 \
+	--download-mumps=1 \
+	--download-scalapack=1 \
+	--download-fblaslapack=1 \
+	--with-pic=1
+
+#Compile and intall
+make
+make install
Index: /issm/trunk/externalpackages/petsc/install-3.4-acenet.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.4-acenet.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.4-acenet.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.4-greenplanet.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.4-greenplanet.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.4-greenplanet.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.4-hpc.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.4-hpc.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.4-hpc.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.4-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.4-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.4-linux64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.4-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.4-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.4-macosx64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.4-pleiades-intel2012.0.032-mpt.2.06rp16.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.4-pleiades-intel2012.0.032-mpt.2.06rp16.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.4-pleiades-intel2012.0.032-mpt.2.06rp16.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.4.2.tar.gz' 'petsc-3.4.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.4.2.tar.gz' 'petsc-3.4.2.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.4-pleiades-mpich2-gcc444.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.4-pleiades-mpich2-gcc444.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.4-pleiades-mpich2-gcc444.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.4-pleiades-mpich2-gcc470.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.4-pleiades-mpich2-gcc470.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.4-pleiades-mpich2-gcc470.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.4-pleiades-mpich2.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.4-pleiades-mpich2.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.4-pleiades-mpich2.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.4.2.tar.gz' 'petsc-3.4.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.4.2.tar.gz' 'petsc-3.4.2.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.4-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.4-pleiades.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.4-pleiades.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.4-pleiades2.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.4-pleiades2.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.4-pleiades2.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.4.3.tar.gz' 'petsc-3.4.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.5-greenplanet.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.5-greenplanet.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.5-greenplanet.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.5-hpc.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.5-hpc.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.5-hpc.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.5-linux64-static.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.5-linux64-static.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.5-linux64-static.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.5-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.5-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.5-linux64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.5-macosx64-static.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.5-macosx64-static.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.5-macosx64-static.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.5-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.5-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.5-macosx64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.5-pleiades-intel2012.0.032-mpt.2.06rp16.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.5-pleiades-intel2012.0.032-mpt.2.06rp16.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.5-pleiades-intel2012.0.032-mpt.2.06rp16.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.1.tar.gz' 'petsc-3.5.1.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.5.1.tar.gz' 'petsc-3.5.1.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.5-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.5-pleiades.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.5-pleiades.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.5-win-par.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.5-win-par.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.5-win-par.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.5-win7.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.5-win7.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.5-win7.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-#$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
+#$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.5.3.tar.gz' 'petsc-3.5.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.6-aurora.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.6-aurora.sh	(revision 24313)
+++ /issm/trunk/externalpackages/petsc/install-3.6-aurora.sh	(revision 24313)
@@ -0,0 +1,58 @@
+#!/bin/bash
+set -eu
+
+#Some cleanup
+rm -rf install petsc-3.6.3 src
+mkdir install src
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.6.3.tar.gz' 'petsc-3.6.3.tar.gz'
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-3.6.3.tar.gz
+mv petsc-3.6.3/* src/
+rm -rf petsc-3.6.3
+
+#--with-cc=icc --with-cxx=icpc --with-fc=ifort --with-f77=ifort \
+
+#configure
+cd src
+./config/configure.py \
+	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
+	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+	--with-blas-lapack-dir="/opt/intel/composer_xe_2013.5.192/mkl/lib/intel64/" \
+	--with-mpi-dir="/opt/intel/impi/4.1.3/intel64/" \
+	--known-mpi-shared-libraries=1 \
+	--with-debugging=0 \
+	--with-valgrind=0 \
+	--with-x=0 \
+	--with-ssl=0 \
+	--with-batch=1  \
+	--with-shared-libraries=1 \
+	--download-metis=1 \
+	--download-parmetis=1 \
+	--download-mumps=1 \
+	--download-scalapack=1 
+
+#prepare script to reconfigure petsc
+cat > script.queue << EOF
+#PBS -S /bin/bash
+#PBS -l select=1:ncpus=1:mpiprocs=1 
+#PBS -l walltime=1:00:00
+#PBS -m e
+
+export RUN_DIR=$ISSM_DIR/externalpackages/petsc/src/
+
+source /usr/share/Modules/init/bash
+module load intel/cluster-toolkit-2013.5.192
+
+export PATH="$PATH:.:/opt/intel/impi/4.1.3/intel64/bin/"
+export MPI_GROUP_MAX=64
+cd $RUN_DIR
+mpirun -np 1 ./conftest-arch-linux2-c-opt
+EOF
+
+#print instructions
+echo "== Now: cd src/ "
+echo "== qsub -q debugq script.queue "
+echo "== Then run reconfigure script generated by PETSc and follow instructions"
Index: /issm/trunk/externalpackages/petsc/install-3.6-discover.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.6-discover.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.6-discover.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.6.3.tar.gz' 'petsc-3.6.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.6.3.tar.gz' 'petsc-3.6.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.6-linux64-static.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.6-linux64-static.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.6-linux64-static.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.6.3.tar.gz' 'petsc-3.6.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.6.3.tar.gz' 'petsc-3.6.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.6-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.6-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.6-linux64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.6.3.tar.gz' 'petsc-3.6.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.6.3.tar.gz' 'petsc-3.6.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.6-lonestar.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.6-lonestar.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.6-lonestar.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.6.3.tar.gz' 'petsc-3.6.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.6.3.tar.gz' 'petsc-3.6.3.tar.gz'
 
 #Untar and move petsc to install directory
@@ -20,6 +20,6 @@
 	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
 	--with-blas-lapack-dir="$TACC_MKL_LIB" \
-	--with-mpi-lib="/opt/cray/mpt/default/gni/mpich-intel/14.0/lib/libmpich.so" \
-	--with-mpi-include="/opt/cray/mpt/default/gni/mpich-intel/14.0/include" \
+	--with-mpi-lib="/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/lib/libmpich.so" \
+	--with-mpi-include="/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/include" \
 	--known-mpi-shared-libraries=1 \
 	--with-debugging=0 \
@@ -38,9 +38,8 @@
 #!/bin/bash		 
 #SBATCH -J petscinstall # Job Name
-#SBATCH -n 12 # Requests 12 tasks/node, 12 cores total
+#SBATCH -n 24 # Requests 12 tasks/node, 12 cores total
 #SBATCH -N 1 # Requests 12 tasks/node, 12 cores total
 #SBATCH -p normal # Queue name normal
 #SBATCH -t 00:01:00 # Run time (hh:mm:ss) - 1.5 hours
-set -x # Echo commands, use set echo with csh
 
 ibrun -np 1 ./conftest-arch-linux2-c-opt
Index: /issm/trunk/externalpackages/petsc/install-3.6-macosx64-static.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.6-macosx64-static.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.6-macosx64-static.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.6.3.tar.gz' 'petsc-3.6.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.6.3.tar.gz' 'petsc-3.6.3.tar.gz'
 
 #Untar and move petsc to install directory
@@ -18,18 +18,16 @@
 ./config/configure.py \
 	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
-	--with-single-library=1 \
+	--with-mpi-dir="$ISSM_DIR/externalpackages/mpich/install" \
 	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
-	--with-shared-libraries=1 \
 	--with-debugging=0 \
-	--with-mpi-dir="$ISSM_DIR/externalpackages/mpich/install" \
-	--download-fblaslapack=1 \
+	--with-valgrind=0 \
+	--with-x=0 \
+	--with-ssl=0 \
+	--with-shared-libraries=0 \
 	--download-metis=1 \
 	--download-parmetis=1 \
-	--with-x=0 \
-	--download-scalapack=1 \
 	--download-mumps=1 \
-	--with-ssl=0 \
-	--with-valgrind=0 \
-	--with-pic=1
+	--download-fblaslapack=1 \
+	--download-scalapack=1
 
 #Compile and intall
Index: /issm/trunk/externalpackages/petsc/install-3.6-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.6-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.6-macosx64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.6.3.tar.gz' 'petsc-3.6.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.6.3.tar.gz' 'petsc-3.6.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.6-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.6-pleiades.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.6-pleiades.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.6.3.tar.gz' 'petsc-3.6.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.6.3.tar.gz' 'petsc-3.6.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.6-stallo.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.6-stallo.sh	(revision 24313)
+++ /issm/trunk/externalpackages/petsc/install-3.6-stallo.sh	(revision 24313)
@@ -0,0 +1,59 @@
+#!/bin/bash
+set -eu
+
+#Some cleanup
+rm -rf install petsc-3.6.3 src
+mkdir install src
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.6.3.tar.gz' 'petsc-3.6.3.tar.gz'
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-3.6.3.tar.gz
+mv petsc-3.6.3/* src/
+rm -rf petsc-3.6.3
+
+#configure
+cd src
+./config/configure.py \
+	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
+	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+	--with-blas-lapack-dir="/global/hds/software/cpu/eb3/imkl/11.2.3.187-iimpi-7.3.5-GNU-4.9.3-2.25/mkl/" \
+	--with-mpi-lib="/global/hds/software/cpu/eb3/impi/5.0.3.048-iccifort-2015.3.187-GNU-4.9.3-2.25/lib64/libmpi.so" \
+	--with-mpi-include="/global/hds/software/cpu/eb3/impi/5.0.3.048-iccifort-2015.3.187-GNU-4.9.3-2.25/include64/" \
+	--known-mpi-shared-libraries=1 \
+	--with-debugging=0 \
+	--with-valgrind=0 \
+	--with-x=0 \
+	--with-ssl=0 \
+	--with-batch=1  \
+	--with-shared-libraries=1 \
+	--download-metis=1 \
+	--download-parmetis=1 \
+	--download-mumps=1 \
+	--download-scalapack=1 
+
+#prepare script to reconfigure petsc
+cat > script.queue << EOF
+#!/bin/bash
+#SBATCH -J petscinstall # Job Name
+#SBATCH -N 1
+#SBATCH -n 1
+#SBATCH -t 00:01:00 # Run time (hh:mm:ss) - 1.5 hours
+#SBATCH --qos=devel
+#SBATCH -o petscinstall.outlog
+#SBATCH -e petscinstall.errlog
+
+module purge
+module load CMake/3.3.2-GNU-4.9.3-2.25
+module load Automake/1.15-GNU-4.9.3-2.25
+module load libtool/2.4.6-GNU-4.9.3-2.25
+module load intel/2015b
+
+mpirun -np 1 ./conftest-arch-linux2-c-opt
+EOF
+
+#print instructions
+echo "== Now: cd src/ "
+echo "== sbatch script.queue "
+echo "== Then run reconfigure script generated by PETSc and follow instructions"
Index: /issm/trunk/externalpackages/petsc/install-3.6-win10.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.6-win10.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.6-win10.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.6.2.tar.gz' 'petsc-3.6.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.6.2.tar.gz' 'petsc-3.6.2.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.7-aci.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.7-aci.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.7-aci.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.7.6.tar.gz' 'petsc-3.7.6.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.7.6.tar.gz' 'petsc-3.7.6.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.7-greenplanet.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.7-greenplanet.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.7-greenplanet.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.7.6.tar.gz' 'petsc-3.7.6.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.7.6.tar.gz' 'petsc-3.7.6.tar.gz'
 
 #Untar and move petsc to install directory
@@ -21,6 +21,6 @@
  --prefix="$ISSM_DIR/externalpackages/petsc/install" \
  --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
- --with-blas-lapack-dir="/sopt/Intel/compilers_and_libraries_2016.2.181/linux/mkl/" \
- --with-mpi-dir="/sopt/mpi/openmpi-1.10.2/intel_16.0.2/" \
+ --with-blas-lapack-dir="/sopt/MKL/2018.3/" \
+ --with-mpi-dir="/sopt/OpenMPI/3.1.2/intel-2018.3-slim" \
  --known-mpi-shared-libraries=1 \
  --with-debugging=0 \
@@ -33,10 +33,11 @@
  --download-parmetis=1 \
  --download-scalapack=1 \
- --download-mumps=1 
+ --download-mumps=1 \
+ --with-pic=1
 
 #prepare script to reconfigure petsc
 cat > script.queue << EOF
 #!/bin/bash
-#SBATCH -p c6145
+#SBATCH -p ilg2.3
 #SBATCH -N 1 -n 1
 #SBATCH --mem-per-cpu=1gb
@@ -44,6 +45,6 @@
 #SBATCH --job-name=test
 
-module load compiler/intel/16.0.2
-module load mpi/openmpi/1.10.2/intel_16.0.2
+module load intel/2018.3
+module load openmpi/3.1.2-slim
 
 cd $(echo $ISSM_DIR)/externalpackages/petsc/src/
Index: /issm/trunk/externalpackages/petsc/install-3.7-hpc.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.7-hpc.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.7-hpc.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.7.6.tar.gz' 'petsc-3.7.6.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.7.6.tar.gz' 'petsc-3.7.6.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.7-linux64-static.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.7-linux64-static.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.7-linux64-static.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.7.6.tar.gz' 'petsc-3.7.6.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.7.6.tar.gz' 'petsc-3.7.6.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.7-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.7-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.7-linux64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.7.6.tar.gz' 'petsc-3.7.6.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.7.6.tar.gz' 'petsc-3.7.6.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.7-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.7-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.7-macosx64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.7.6.tar.gz' 'petsc-3.7.6.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.7.6.tar.gz' 'petsc-3.7.6.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.7-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.7-pleiades.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.7-pleiades.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.7.6.tar.gz' 'petsc-3.7.6.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.7.6.tar.gz' 'petsc-3.7.6.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.8-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.8-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.8-linux64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.8.3.tar.gz' 'petsc-3.8.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.8.3.tar.gz' 'petsc-3.8.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.8-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.8-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.8-macosx64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.8.3.tar.gz' 'petsc-3.8.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.8.3.tar.gz' 'petsc-3.8.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.9-aurora.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.9-aurora.sh	(revision 24313)
+++ /issm/trunk/externalpackages/petsc/install-3.9-aurora.sh	(revision 24313)
@@ -0,0 +1,58 @@
+#!/bin/bash
+set -eu
+
+#Some cleanup
+#rm -rf install petsc-3.9.3 src
+#mkdir install src
+#
+##Download from ISSM server
+#$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.9.3.tar.gz' 'petsc-3.9.3.tar.gz'
+#
+##Untar and move petsc to install directory
+#tar -zxvf  petsc-3.9.3.tar.gz
+#mv petsc-3.9.3/* src/
+#rm -rf petsc-3.9.3
+
+#configure
+cd src
+./config/configure.py \
+	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
+	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+	--with-blas-lapack-dir="/opt/intel/composer_xe_2013.5.192/mkl/lib/intel64/" \
+	--with-mpi-dir="/opt/intel/impi/4.1.3/intel64/" \
+	--known-mpi-shared-libraries=1 \
+	--with-debugging=0 \
+	--with-valgrind=0 \
+	--with-x=0 \
+	--with-ssl=0 \
+	--with-batch=1  \
+	--with-shared-libraries=1 \
+	--download-metis=1 \
+	--download-parmetis=1 \
+	--download-mumps=1 \
+	--download-scalapack=1 \
+	--known-64-bit-blas-indices \
+	--COPTFLAGS="-O3" \
+	--FOPTFLAGS="-O3" \
+	--CXXOPTFLAGS="-O3"
+
+#prepare script to reconfigure petsc
+cat > script.queue << EOF
+#PBS -S /bin/bash
+#PBS -l select=1:ncpus=1:mpiprocs=1 
+#PBS -l walltime=0:00:59
+#PBS -m e
+
+source /usr/share/Modules/init/bash
+module load intel/cluster-toolkit-2013.5.192
+
+export PATH="$PATH:.:/opt/intel/impi/4.1.3/intel64/bin/"
+export MPI_GROUP_MAX=64
+cd $ISSM_DIR/externalpackages/petsc/src/
+mpirun -np 1 ./conftest-arch-linux2-c-opt
+EOF
+
+#print instructions
+echo "== Now: cd src/ "
+echo "== qsub -q debugq script.queue "
+echo "== Then run reconfigure script generated by PETSc and follow instructions"
Index: /issm/trunk/externalpackages/petsc/install-3.9-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.9-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.9-linux64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.9.3.tar.gz' 'petsc-3.9.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.9.3.tar.gz' 'petsc-3.9.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.9-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.9-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/petsc/install-3.9-macosx64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.9.3.tar.gz' 'petsc-3.9.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.9.3.tar.gz' 'petsc-3.9.3.tar.gz'
 
 #Untar and move petsc to install directory
Index: /issm/trunk/externalpackages/petsc/install-3.9-sherlock.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.9-sherlock.sh	(revision 24313)
+++ /issm/trunk/externalpackages/petsc/install-3.9-sherlock.sh	(revision 24313)
@@ -0,0 +1,36 @@
+#!/bin/bash
+set -eu
+
+#Some cleanup
+rm -rf install petsc-3.9.3 src
+mkdir install src
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/petsc-lite-3.9.3.tar.gz' 'petsc-3.9.3.tar.gz'
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-3.9.3.tar.gz
+mv petsc-3.9.3/* src/
+rm -rf petsc-3.9.3
+
+#configure
+cd src
+./config/configure.py \
+	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
+	--with-mpi-dir="/share/software/user/restricted/impi/2019/impi/2019.0.117/intel64/" \
+	--with-blas-lapack-dir="/share/software/user/restricted/imkl/2019/mkl/lib/intel64/" \
+	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+	--with-debugging=1 \
+	--with-valgrind=0 \
+	--with-x=0 \
+	--with-ssl=0 \
+	--with-shared-libraries=1 \
+	--download-scalapack=1 \
+	--download-metis=1 \
+	--download-parmetis=1 \
+	--download-mumps=1 \
+	--with-pic=1
+
+#Compile and intall
+make
+make install
Index: /issm/trunk/externalpackages/polygonclipper/install.sh
===================================================================
--- /issm/trunk/externalpackages/polygonclipper/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/polygonclipper/install.sh	(revision 24313)
@@ -6,10 +6,10 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/PolygonClipper.zip' 'PolygonClipper.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/PolygonClipper.zip' 'PolygonClipper.zip'
 
 #install
 mkdir install
 cd install
-cp ../PolygonClipper.zip .
+mv ../PolygonClipper.zip .
 
 #uncompress
@@ -17,3 +17,3 @@
 
 #Make
-mex gpc.c gpc_mexfile.c -O -output PolygonClip
+mex  -compatibleArrayDims gpc.c gpc_mexfile.c -O -output PolygonClip
Index: /issm/trunk/externalpackages/pyclips/install.sh
===================================================================
--- /issm/trunk/externalpackages/pyclips/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/pyclips/install.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/pyclips-1.0.7.348.tar.gz' 'pyclips-1.0.7.348.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/pyclips-1.0.7.348.tar.gz' 'pyclips-1.0.7.348.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/pysvn/install.sh
===================================================================
--- /issm/trunk/externalpackages/pysvn/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/pysvn/install.sh	(revision 24313)
@@ -12,5 +12,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/pysvn-1.7.6.tar.gz' 'pysvn-1.7.6.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/pysvn-1.7.6.tar.gz' 'pysvn-1.7.6.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/python/install-2.7.3-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/python/install-2.7.3-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/python/install-2.7.3-linux64.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh http://issm.jpl.nasa.gov/files/externalpackages/Python-2.7.3.tgz Python-2.7.3.tgz
+$ISSM_DIR/scripts/DownloadExternalPackage.sh https://issm.ess.uci.edu/files/externalpackages/Python-2.7.3.tgz Python-2.7.3.tgz
 
 #Untar and move python into install directory
Index: /issm/trunk/externalpackages/python/install-2.7.3-macosx-snowleopard.sh
===================================================================
--- /issm/trunk/externalpackages/python/install-2.7.3-macosx-snowleopard.sh	(revision 24312)
+++ /issm/trunk/externalpackages/python/install-2.7.3-macosx-snowleopard.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh http://issm.jpl.nasa.gov/files/externalpackages/Python-2.7.3.tgz Python-2.7.3.tgz
+$ISSM_DIR/scripts/DownloadExternalPackage.sh https://issm.ess.uci.edu/files/externalpackages/Python-2.7.3.tgz Python-2.7.3.tgz
 
 #exports
Index: /issm/trunk/externalpackages/python/install-2.7.3-macosx.sh
===================================================================
--- /issm/trunk/externalpackages/python/install-2.7.3-macosx.sh	(revision 24312)
+++ /issm/trunk/externalpackages/python/install-2.7.3-macosx.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh http://issm.jpl.nasa.gov/files/externalpackages/Python-2.7.3.tgz Python-2.7.3.tgz
+$ISSM_DIR/scripts/DownloadExternalPackage.sh https://issm.ess.uci.edu/files/externalpackages/Python-2.7.3.tgz Python-2.7.3.tgz
 
 #Untar and move python into install directory
Index: /issm/trunk/externalpackages/python/install-3.2.2-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/python/install-3.2.2-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/python/install-3.2.2-linux64.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh http://issm.jpl.nasa.gov/files/externalpackages/Python-3.2.2.tgz Python-3.2.2.tgz
+$ISSM_DIR/scripts/DownloadExternalPackage.sh https://issm.ess.uci.edu/files/externalpackages/Python-3.2.2.tgz Python-3.2.2.tgz
 
 #exports
Index: /issm/trunk/externalpackages/python/install-3.2.2-macosx-snowleopard.sh
===================================================================
--- /issm/trunk/externalpackages/python/install-3.2.2-macosx-snowleopard.sh	(revision 24312)
+++ /issm/trunk/externalpackages/python/install-3.2.2-macosx-snowleopard.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh http://issm.jpl.nasa.gov/files/externalpackages/Python-3.2.2.tgz Python-3.2.2.tgz
+$ISSM_DIR/scripts/DownloadExternalPackage.sh https://issm.ess.uci.edu/files/externalpackages/Python-3.2.2.tgz Python-3.2.2.tgz
 
 #exports
Index: /issm/trunk/externalpackages/python/install-3.2.2-macosx.sh
===================================================================
--- /issm/trunk/externalpackages/python/install-3.2.2-macosx.sh	(revision 24312)
+++ /issm/trunk/externalpackages/python/install-3.2.2-macosx.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh http://issm.jpl.nasa.gov/files/externalpackages/Python-3.2.2.tgz Python-3.2.2.tgz
+$ISSM_DIR/scripts/DownloadExternalPackage.sh https://issm.ess.uci.edu/files/externalpackages/Python-3.2.2.tgz Python-3.2.2.tgz
 
 #exports
Index: /issm/trunk/externalpackages/qhull/install.sh
===================================================================
--- /issm/trunk/externalpackages/qhull/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/qhull/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/qhull-2003.1.tar.gz' 'qhull-2003.1.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/qhull-2003.1.tar.gz' 'qhull-2003.1.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/rats/install.sh
===================================================================
--- /issm/trunk/externalpackages/rats/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/rats/install.sh	(revision 24313)
@@ -6,5 +6,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/rats-2.3.tar.gz' 'rats-2.3.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/rats-2.3.tar.gz' 'rats-2.3.tar.gz'
 
 #install directory
Index: /issm/trunk/externalpackages/readline/install.sh
===================================================================
--- /issm/trunk/externalpackages/readline/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/readline/install.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/readline-6.2.2.tar.gz' 'readline-6.2.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/readline-6.2.2.tar.gz' 'readline-6.2.2.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/rose/install.sh
===================================================================
--- /issm/trunk/externalpackages/rose/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/rose/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/rose-0.9.5a-13219.tar.gz' 'rose-0.9.5a-13219.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/rose-0.9.5a-13219.tar.gz' 'rose-0.9.5a-13219.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/satstress/install.sh
===================================================================
--- /issm/trunk/externalpackages/satstress/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/satstress/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/SatStress-0.1.2.tar.gz' 'SatStress-0.1.2.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/SatStress-0.1.2.tar.gz' 'SatStress-0.1.2.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/scotch/install.sh
===================================================================
--- /issm/trunk/externalpackages/scotch/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/scotch/install.sh	(revision 24313)
@@ -11,7 +11,7 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/scotch_5.1.6.tar.gz' 'scotch_5.1.6.tar.gz'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/docs/ptscotch_user5.1.pdf' 'ptscotch_user5.1.pdf'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/docs/scotch_user5.1.pdf' 'scotch_user5.1.pdf'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/scotch_5.1.6.tar.gz' 'scotch_5.1.6.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/ptscotch_user5.1.pdf' 'ptscotch_user5.1.pdf'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/scotch_user5.1.pdf' 'scotch_user5.1.pdf'
 
 # Untar 
Index: /issm/trunk/externalpackages/scotch/install_macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/scotch/install_macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/scotch/install_macosx64.sh	(revision 24313)
@@ -11,7 +11,7 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/scotch_5.1.6.tar.gz' 'scotch_5.1.6.tar.gz'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/docs/ptscotch_user5.1.pdf' 'ptscotch_user5.1.pdf'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/docs/scotch_user5.1.pdf' 'scotch_user5.1.pdf'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/scotch_5.1.6.tar.gz' 'scotch_5.1.6.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/ptscotch_user5.1.pdf' 'ptscotch_user5.1.pdf'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/scotch_user5.1.pdf' 'scotch_user5.1.pdf'
 
 # Untar 
Index: /issm/trunk/externalpackages/semic/install.sh
===================================================================
--- /issm/trunk/externalpackages/semic/install.sh	(revision 24313)
+++ /issm/trunk/externalpackages/semic/install.sh	(revision 24313)
@@ -0,0 +1,68 @@
+#!/bin/bash
+set -eu
+
+#Some cleanup
+rm -rf install src
+mkdir install
+
+#Download latest version
+git clone https://github.com/mkrapp/semic.git src
+
+if which ifort >/dev/null; then
+	FC="ifort"
+	FFLAGS="-traceback -check all" #-O2 is default 
+else
+	FC="gfortran"
+	if [ `uname` == "Darwin" ]; then
+		FC="gfortran -arch x86_64"
+		FFLAGS="-fcheck=all"
+	else
+		FFLAGS=""
+	fi
+fi
+
+#Compile semic module utils.f90
+cd src/
+(
+cat << EOF
+LIB_EXT=a
+FC=$FC
+FFLAGS=$FFLAGS
+install: libutils.\$(LIB_EXT)
+	cp libutils.\$(LIB_EXT) ../install/
+	cp utils.mod ../install/
+OBJECTS= utils.o
+libutils.\$(LIB_EXT): \$(OBJECTS)
+	ar -r libutils.\$(LIB_EXT) \$(OBJECTS) 
+	ranlib libutils.\$(LIB_EXT) 
+%.o: %.f90
+	\$(FC) \$(FFLAGS) -fPIC -c $< -o \$@
+clean: 
+	rm -rf *.o *.\$(LIB_EXT)
+EOF
+) > Makefile
+make
+
+# patch surface_physics
+patch surface_physics.f90 < ../surface_physics.f90.patch
+
+#Compile semic module surface_physics.f90
+(
+cat << EOF
+LIB_EXT=a
+FC=$FC
+FFLAGS=$FFLAGS
+install: libsurface_physics.\$(LIB_EXT)
+	cp libsurface_physics.\$(LIB_EXT) ../install/
+	cp surface_physics.mod ../install/
+OBJECTS= surface_physics.o
+libsurface_physics.\$(LIB_EXT): \$(OBJECTS)
+	ar -r libsurface_physics.\$(LIB_EXT) \$(OBJECTS) 
+	ranlib libsurface_physics.\$(LIB_EXT) 
+%.o: %.f90
+	\$(FC) \$(FFLAGS) -fPIC -c $< -o \$@
+clean: 
+	rm -rf *.o *.\$(LIB_EXT)
+EOF
+) > Makefile
+make
Index: /issm/trunk/externalpackages/semic/surface_physics.f90.patch
===================================================================
--- /issm/trunk/externalpackages/semic/surface_physics.f90.patch	(revision 24313)
+++ /issm/trunk/externalpackages/semic/surface_physics.f90.patch	(revision 24313)
@@ -0,0 +1,15 @@
+--- surface_physics.f90	2018-12-10 08:27:55.000000000 +0100
++++ my_surface_physics.f90	2018-12-10 08:58:14.000000000 +0100
+@@ -775,9 +775,9 @@
+         n_ksub        = par%n_ksub
+ 
+         ! Read parameters from input namelist file
+-        open(7,file=trim(filename))
+-        read(7,nml=surface_physics)
+-        close(7)
++        !open(7,file=trim(filename))
++        !read(7,nml=surface_physics)
++        !close(7)
+ !         write(*,nml=surface_physics)
+ 
+         ! Store local parameter values in output object
Index: /issm/trunk/externalpackages/shapelib/install.sh
===================================================================
--- /issm/trunk/externalpackages/shapelib/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/shapelib/install.sh	(revision 24313)
@@ -9,7 +9,7 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/shapelib-1.2.10.tar.gz' 'shapelib-1.2.10.tar.gz'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/shape_eg_data.zip'  'shape_eg_data.zip'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/docs/shapefile.pdf' 'shapefile.pdf'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/shapelib-1.2.10.tar.gz' 'shapelib-1.2.10.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/shape_eg_data.zip'  'shape_eg_data.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/docs/shapefile.pdf' 'shapefile.pdf'
 
 # Untar 
Index: /issm/trunk/externalpackages/shell2junit/install.sh.old
===================================================================
--- /issm/trunk/externalpackages/shell2junit/install.sh.old	(revision 24312)
+++ /issm/trunk/externalpackages/shell2junit/install.sh.old	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/shell2junit-1.0.0.zip' 'shell2junit-1.0.0.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/shell2junit-1.0.0.zip' 'shell2junit-1.0.0.zip'
 
 #Untar 
Index: /issm/trunk/externalpackages/sqlite/install.sh
===================================================================
--- /issm/trunk/externalpackages/sqlite/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/sqlite/install.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/sqlite-autoconf-3071300.tar.gz' 'sqlite-autoconf-3071300.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/sqlite-autoconf-3071300.tar.gz' 'sqlite-autoconf-3071300.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/svn/install.sh
===================================================================
--- /issm/trunk/externalpackages/svn/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/svn/install.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/subversion-1.6.18.tar.gz' 'subversion-1.6.18.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/subversion-1.6.18.tar.gz' 'subversion-1.6.18.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/swig/install.sh
===================================================================
--- /issm/trunk/externalpackages/swig/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/swig/install.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/swig-2.0.4.tar.gz' 'swig-2.0.4.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/swig-2.0.4.tar.gz' 'swig-2.0.4.tar.gz'
 
 #Untar and move python into install directory
Index: /issm/trunk/externalpackages/tcl/install.sh
===================================================================
--- /issm/trunk/externalpackages/tcl/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/tcl/install.sh	(revision 24313)
@@ -11,5 +11,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/tcl8.5.11.tar.gz' 'tcl8.5.11.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/tcl8.5.11.tar.gz' 'tcl8.5.11.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/tclx/install.sh
===================================================================
--- /issm/trunk/externalpackages/tclx/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/tclx/install.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/tclx8.4.tar.gz' 'tclx8.4.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/tclx8.4.tar.gz' 'tclx8.4.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/tex2im/install.sh
===================================================================
--- /issm/trunk/externalpackages/tex2im/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/tex2im/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/tex2im-1.8.tar.gz' 'tex2im-1.8.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/tex2im-1.8.tar.gz' 'tex2im-1.8.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/tk/install.sh
===================================================================
--- /issm/trunk/externalpackages/tk/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/tk/install.sh	(revision 24313)
@@ -11,5 +11,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/tk8.5.12-src.tar.gz' 'tk8.5.12.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/tk8.5.12-src.tar.gz' 'tk8.5.12.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/topotoolbox/install.sh
===================================================================
--- /issm/trunk/externalpackages/topotoolbox/install.sh	(revision 24313)
+++ /issm/trunk/externalpackages/topotoolbox/install.sh	(revision 24313)
@@ -0,0 +1,3 @@
+#!/bin/bash
+rm -rf install
+svn co https://github.com/wschwanghart/topotoolbox.git/trunk install
Index: /issm/trunk/externalpackages/triangle/install-altix64.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-altix64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/triangle/install-altix64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
 
 #Untar 
Index: /issm/trunk/externalpackages/triangle/install-android.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-android.sh	(revision 24312)
+++ /issm/trunk/externalpackages/triangle/install-android.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
 
 #Untar 
Index: /issm/trunk/externalpackages/triangle/install-discover.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-discover.sh	(revision 24312)
+++ /issm/trunk/externalpackages/triangle/install-discover.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
 
 #Untar 
Index: /issm/trunk/externalpackages/triangle/install-iosarmv7.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-iosarmv7.sh	(revision 24312)
+++ /issm/trunk/externalpackages/triangle/install-iosarmv7.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
 
 #untar
Index: /issm/trunk/externalpackages/triangle/install-iosarmv7s.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-iosarmv7s.sh	(revision 24312)
+++ /issm/trunk/externalpackages/triangle/install-iosarmv7s.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
 
 #untar
Index: /issm/trunk/externalpackages/triangle/install-iosi386.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-iosi386.sh	(revision 24312)
+++ /issm/trunk/externalpackages/triangle/install-iosi386.sh	(revision 24313)
@@ -9,5 +9,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
 
 #untar
Index: /issm/trunk/externalpackages/triangle/install-javascript.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-javascript.sh	(revision 24312)
+++ /issm/trunk/externalpackages/triangle/install-javascript.sh	(revision 24313)
@@ -12,5 +12,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
 
 #Untar 
Index: /issm/trunk/externalpackages/triangle/install-linux64.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-linux64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/triangle/install-linux64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
 
 #Untar 
Index: /issm/trunk/externalpackages/triangle/install-macosx32.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-macosx32.sh	(revision 24312)
+++ /issm/trunk/externalpackages/triangle/install-macosx32.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
 
 #Untar 
Index: /issm/trunk/externalpackages/triangle/install-macosx64-snowleopard.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-macosx64-snowleopard.sh	(revision 24312)
+++ /issm/trunk/externalpackages/triangle/install-macosx64-snowleopard.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
 
 #Untar 
Index: /issm/trunk/externalpackages/triangle/install-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-macosx64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/triangle/install-macosx64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
 
 #Untar 
Index: /issm/trunk/externalpackages/triangle/install-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-pleiades.sh	(revision 24312)
+++ /issm/trunk/externalpackages/triangle/install-pleiades.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
 
 #Untar 
Index: /issm/trunk/externalpackages/triangle/install-win10.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-win10.sh	(revision 24312)
+++ /issm/trunk/externalpackages/triangle/install-win10.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
 
 #Untar 
Index: /issm/trunk/externalpackages/triangle/install-win32.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-win32.sh	(revision 24312)
+++ /issm/trunk/externalpackages/triangle/install-win32.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
 
 #Untar 
Index: /issm/trunk/externalpackages/triangle/install.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/triangle/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/triangle.zip' 'triangle.zip'
 
 #Untar 
Index: /issm/trunk/externalpackages/valgrind/install-altix64.sh
===================================================================
--- /issm/trunk/externalpackages/valgrind/install-altix64.sh	(revision 24312)
+++ /issm/trunk/externalpackages/valgrind/install-altix64.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/valgrind-3.10.0.tar.bz2' 'valgrind-3.10.0.tar.bz2'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/valgrind-3.10.0.tar.bz2' 'valgrind-3.10.0.tar.bz2'
 
 #Untar 
Index: /issm/trunk/externalpackages/valgrind/install-win32.sh
===================================================================
--- /issm/trunk/externalpackages/valgrind/install-win32.sh	(revision 24312)
+++ /issm/trunk/externalpackages/valgrind/install-win32.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/valgrind-3.10.0.tar.bz2' 'valgrind-3.10.0.tar.bz2'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/valgrind-3.10.0.tar.bz2' 'valgrind-3.10.0.tar.bz2'
 
 #Untar 
Index: sm/trunk/externalpackages/vim/addons/vim/syntax/Synchronize.sh
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/syntax/Synchronize.sh	(revision 24312)
+++ 	(revision )
@@ -1,21 +1,0 @@
-#!/bin/bash
-
-#Synchronize Enums
-
-#Get all lines of EnumDefinitions.h which hold Enum 
-cat c.vim | sed "/ISSM's Enums begin/,/vim: ts=8/d" > temp
-echo "\"ISSM's Enums begin" >> temp
-cat ../../../../../src/c/shared/Enum/EnumDefinitions.h | grep -e "[0-9]Enum," -e "[a-z]Enum," -e "[A-Z]Enum," | grep -v StringToEnum | sed -e "s/,//g" | awk '{ printf "syn keyword cConstant " $1 "\n"}' >> temp
-echo "\"ISSM's Enums end" >> temp
-cat c.vim | sed "1,/ISSM's Enums end/d" >> temp
-mv temp c.vim
-
-#Synchronize objects
-cat c.vim | sed "/ISSM's objects begin/,/vim: ts=8/d" > temp
-echo "\"ISSM's objects begin" >> temp
-find ../../../../../src/c/classes -name "*.cpp" -o -name "*.h" | sed -e "s/\// /g" -e "s/\.cpp//" -e "s/\.h//" | awk '{print  $(NF)}' | sort | uniq | awk '{ printf "syn keyword cType " $1 "\n"}'>> temp
-find ../../../../../src/c/analyses -name "*Analysis.h" | sed -e "s/\// /g" -e "s/\.cpp//" -e "s/\.h//" | awk '{print  $(NF)}' | sort | uniq | awk '{ printf "syn keyword cType " $1 "\n"}'>> temp
-echo "\"ISSM's objects end" >> temp
-cat c.vim | sed "1,/ISSM's objects end/d" >> temp
-
-mv temp c.vim
Index: /issm/trunk/externalpackages/vim/addons/vim/syntax/c.vim
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/syntax/c.vim	(revision 24312)
+++ /issm/trunk/externalpackages/vim/addons/vim/syntax/c.vim	(revision 24313)
@@ -400,1284 +400,9 @@
 
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-"   ISSM special syntax                                                                                             "
-"   please try to keep the alphabetical ordering                                                                    "
-"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-"Petsc
-syn keyword	cType		Vec Mat SeqVec SeqMat
-"other ISSM's syntax
-syn keyword	cType		mxArray ErrorException QuadtreeBox
-syn keyword	cType		IssmDouble IssmPDouble
-
-"ISSM's objects begin
-syn keyword cType AdaptiveMeshRefinement
-syn keyword cType AmrBamg
-syn keyword cType BoolInput
-syn keyword cType BoolParam
-syn keyword cType classes
-syn keyword cType Constraint
-syn keyword cType Constraints
-syn keyword cType Contour
-syn keyword cType Contours
-syn keyword cType ControlInput
-syn keyword cType Covertree
-syn keyword cType DatasetInput
-syn keyword cType DataSetParam
-syn keyword cType Definition
-syn keyword cType DependentObject
-syn keyword cType DofIndexing
-syn keyword cType DoubleArrayInput
-syn keyword cType DoubleInput
-syn keyword cType DoubleMatArrayParam
-syn keyword cType DoubleMatParam
-syn keyword cType DoubleParam
-syn keyword cType DoubleTransientMatParam
-syn keyword cType DoubleVecParam
-syn keyword cType Element
-syn keyword cType ElementHook
-syn keyword cType ElementMatrix
-syn keyword cType Elements
-syn keyword cType ElementVector
-syn keyword cType ExponentialVariogram
-syn keyword cType ExternalResult
-syn keyword cType FemModel
-syn keyword cType FileParam
-syn keyword cType Friction
-syn keyword cType Gauss
-syn keyword cType GaussianVariogram
-syn keyword cType gaussobjects
-syn keyword cType GaussPenta
-syn keyword cType GaussSeg
-syn keyword cType GaussTetra
-syn keyword cType GaussTria
-syn keyword cType GenericExternalResult
-syn keyword cType GenericOption
-syn keyword cType GenericParam
-syn keyword cType GiaDeflectionCoreArgs
-syn keyword cType Hook
-syn keyword cType Input
-syn keyword cType Inputs
-syn keyword cType IntInput
-syn keyword cType IntMatParam
-syn keyword cType IntParam
-syn keyword cType IntVecParam
-syn keyword cType IoModel
-syn keyword cType IssmDirectApplicInterface
-syn keyword cType IssmParallelDirectApplicInterface
-syn keyword cType krigingobjects
-syn keyword cType Load
-syn keyword cType Loads
-syn keyword cType Masscon
-syn keyword cType Massconaxpby
-syn keyword cType Massfluxatgate
-syn keyword cType Material
-syn keyword cType Materials
-syn keyword cType Matestar
-syn keyword cType Matice
-syn keyword cType Matlitho
-syn keyword cType Matpar
-syn keyword cType matrixobjects
-syn keyword cType MatrixParam
-syn keyword cType Misfit
-syn keyword cType Moulin
-syn keyword cType Neumannflux
-syn keyword cType Nodalvalue
-syn keyword cType Node
-syn keyword cType Nodes
-syn keyword cType Numberedcostfunction
-syn keyword cType Numericalflux
-syn keyword cType Observation
-syn keyword cType Observations
-syn keyword cType Option
-syn keyword cType Options
-syn keyword cType OptionUtilities
-syn keyword cType Param
-syn keyword cType Parameters
-syn keyword cType Pengrid
-syn keyword cType Penpair
-syn keyword cType Penta
-syn keyword cType PentaInput
-syn keyword cType PentaRef
-syn keyword cType PowerVariogram
-syn keyword cType Profiler
-syn keyword cType Quadtree
-syn keyword cType Regionaloutput
-syn keyword cType Results
-syn keyword cType Riftfront
-syn keyword cType RiftStruct
-syn keyword cType Seg
-syn keyword cType SegInput
-syn keyword cType Segment
-syn keyword cType SegRef
-syn keyword cType SpcDynamic
-syn keyword cType SpcStatic
-syn keyword cType SpcTransient
-syn keyword cType SphericalVariogram
-syn keyword cType StringArrayParam
-syn keyword cType StringParam
-syn keyword cType Tetra
-syn keyword cType TetraInput
-syn keyword cType TetraRef
-syn keyword cType TransientArrayParam
-syn keyword cType TransientInput
-syn keyword cType TransientParam
-syn keyword cType Tria
-syn keyword cType TriaInput
-syn keyword cType TriaRef
-syn keyword cType Update
-syn keyword cType Variogram
-syn keyword cType VectorParam
-syn keyword cType Vertex
-syn keyword cType Vertices
-syn keyword cType AdjointBalancethickness2Analysis
-syn keyword cType AdjointBalancethicknessAnalysis
-syn keyword cType AdjointHorizAnalysis
-syn keyword cType Analysis
-syn keyword cType Balancethickness2Analysis
-syn keyword cType BalancethicknessAnalysis
-syn keyword cType BalancethicknessSoftAnalysis
-syn keyword cType BalancevelocityAnalysis
-syn keyword cType DamageEvolutionAnalysis
-syn keyword cType DepthAverageAnalysis
-syn keyword cType EnthalpyAnalysis
-syn keyword cType EnumToAnalysis
-syn keyword cType EsaAnalysis
-syn keyword cType ExtrapolationAnalysis
-syn keyword cType ExtrudeFromBaseAnalysis
-syn keyword cType ExtrudeFromTopAnalysis
-syn keyword cType FreeSurfaceBaseAnalysis
-syn keyword cType FreeSurfaceTopAnalysis
-syn keyword cType GiaIvinsAnalysis
-syn keyword cType HydrologyDCEfficientAnalysis
-syn keyword cType HydrologyDCInefficientAnalysis
-syn keyword cType HydrologyShreveAnalysis
-syn keyword cType HydrologySommersAnalysis
-syn keyword cType L2ProjectionBaseAnalysis
-syn keyword cType L2ProjectionEPLAnalysis
-syn keyword cType LevelsetAnalysis
-syn keyword cType LoveAnalysis
-syn keyword cType MasstransportAnalysis
-syn keyword cType MeltingAnalysis
-syn keyword cType SealevelriseAnalysis
-syn keyword cType SmbAnalysis
-syn keyword cType SmoothAnalysis
-syn keyword cType StressbalanceAnalysis
-syn keyword cType StressbalanceSIAAnalysis
-syn keyword cType StressbalanceVerticalAnalysis
-syn keyword cType ThermalAnalysis
-syn keyword cType UzawaPressureAnalysis
-"ISSM's objects end
-"ISSM's Enums begin
-syn keyword cConstant FemModelEnum
-syn keyword cConstant ParametersSTARTEnum
-syn keyword cConstant AdolcParamEnum
-syn keyword cConstant FSSolverEnum
-syn keyword cConstant FemModelCommEnum
-syn keyword cConstant WorldCommEnum
-syn keyword cConstant IcecapToEarthCommEnum
-syn keyword cConstant ToMITgcmCommEnum
-syn keyword cConstant NumModelsEnum
-syn keyword cConstant ModelIdEnum
-syn keyword cConstant EarthIdEnum
-syn keyword cConstant SolutionTypeEnum
-syn keyword cConstant AnalysisTypeEnum
-syn keyword cConstant AnalysisCounterEnum
-syn keyword cConstant ConfigurationTypeEnum
-syn keyword cConstant InputToExtrudeEnum
-syn keyword cConstant InputToL2ProjectEnum
-syn keyword cConstant InputToDepthaverageInEnum
-syn keyword cConstant InputToDepthaverageOutEnum
-syn keyword cConstant InputToSmoothEnum
-syn keyword cConstant SmoothThicknessMultiplierEnum
-syn keyword cConstant LevelsetStabilizationEnum
-syn keyword cConstant TimesteppingTypeEnum
-syn keyword cConstant FixedTimesteppingEnum
-syn keyword cConstant AdaptiveTimesteppingEnum
-syn keyword cConstant TimesteppingTimeStepMinEnum
-syn keyword cConstant TimesteppingTimeStepMaxEnum
-syn keyword cConstant AutodiffIsautodiffEnum
-syn keyword cConstant AutodiffNumDependentsEnum
-syn keyword cConstant AutodiffDependentObjectsEnum
-syn keyword cConstant AutodiffNumIndependentsEnum
-syn keyword cConstant AutodiffJacobianEnum
-syn keyword cConstant AutodiffXpEnum
-syn keyword cConstant AutodiffDriverEnum
-syn keyword cConstant AutodiffFosForwardIndexEnum
-syn keyword cConstant AutodiffFovForwardIndicesEnum
-syn keyword cConstant AutodiffFosReverseIndexEnum
-syn keyword cConstant AutodiffKeepEnum
-syn keyword cConstant AutodiffObufsizeEnum
-syn keyword cConstant AutodiffLbufsizeEnum
-syn keyword cConstant AutodiffCbufsizeEnum
-syn keyword cConstant AutodiffTbufsizeEnum
-syn keyword cConstant AutodiffGcTriggerRatioEnum
-syn keyword cConstant AutodiffGcTriggerMaxSizeEnum
-syn keyword cConstant BalancethicknessStabilizationEnum
-syn keyword cConstant BalancethicknessThickeningRateEnum
-syn keyword cConstant BasalforcingsEnum
-syn keyword cConstant BasalforcingsGeothermalfluxEnum
-syn keyword cConstant BasalforcingsGroundediceMeltingRateEnum
-syn keyword cConstant BasalforcingsFloatingiceMeltingRateEnum
-syn keyword cConstant BasalforcingsDeepwaterMeltingRateEnum
-syn keyword cConstant BasalforcingsDeepwaterElevationEnum
-syn keyword cConstant BasalforcingsUpperwaterElevationEnum
-syn keyword cConstant BasalforcingsMeltrateFactorEnum
-syn keyword cConstant BasalforcingsThresholdThicknessEnum
-syn keyword cConstant BasalforcingsUpperdepthMeltEnum
-syn keyword cConstant BasalforcingsMantleconductivityEnum
-syn keyword cConstant BasalforcingsNusseltEnum
-syn keyword cConstant BasalforcingsDtbgEnum
-syn keyword cConstant BasalforcingsPlumeradiusEnum
-syn keyword cConstant BasalforcingsTopplumedepthEnum
-syn keyword cConstant BasalforcingsBottomplumedepthEnum
-syn keyword cConstant BasalforcingsPlumexEnum
-syn keyword cConstant BasalforcingsPlumeyEnum
-syn keyword cConstant BasalforcingsCrustthicknessEnum
-syn keyword cConstant BasalforcingsUppercrustthicknessEnum
-syn keyword cConstant BasalforcingsUppercrustheatEnum
-syn keyword cConstant BasalforcingsLowercrustheatEnum
-syn keyword cConstant FloatingMeltRateEnum
-syn keyword cConstant LinearFloatingMeltRateEnum
-syn keyword cConstant MismipFloatingMeltRateEnum
-syn keyword cConstant MantlePlumeGeothermalFluxEnum
-syn keyword cConstant BasalforcingsPicoEnum
-syn keyword cConstant BasalforcingsPicoNumBasinsEnum
-syn keyword cConstant BasalforcingsPicoBasinIdEnum
-syn keyword cConstant BasalforcingsPicoMaxboxcountEnum
-syn keyword cConstant BasalforcingsPicoBoxIdEnum
-syn keyword cConstant BasalforcingsPicoOverturningCoeffEnum
-syn keyword cConstant BasalforcingsPicoGammaTEnum
-syn keyword cConstant BasalforcingsPicoFarOceantemperatureEnum
-syn keyword cConstant BasalforcingsPicoAverageOverturningEnum
-syn keyword cConstant BasalforcingsPicoAverageSalinityEnum
-syn keyword cConstant BasalforcingsPicoAverageTemperatureEnum
-syn keyword cConstant BasalforcingsPicoBoxAreaEnum
-syn keyword cConstant BasalforcingsPicoIsplumeEnum
-syn keyword cConstant BasalforcingsPicoGroundingLineDepthEnum
-syn keyword cConstant BasalforcingsPicoShelfSlopeEnum
-syn keyword cConstant BasalforcingsPicoSubShelfOceanOverturningEnum
-syn keyword cConstant BasalforcingsPicoSubShelfOceanSalinityEnum
-syn keyword cConstant BasalforcingsPicoSubShelfOceanTempEnum
-syn keyword cConstant DistanceToGroundinglineEnum
-syn keyword cConstant DistanceToCalvingfrontEnum
-syn keyword cConstant BedEnum
-syn keyword cConstant BaseEnum
-syn keyword cConstant ConstantsGEnum
-syn keyword cConstant ConstantsReferencetemperatureEnum
-syn keyword cConstant ConstantsYtsEnum
-syn keyword cConstant DependentObjectEnum
-syn keyword cConstant StressbalanceAbstolEnum
-syn keyword cConstant StressbalanceConvergenceNumStepsEnum
-syn keyword cConstant StressbalanceIsnewtonEnum
-syn keyword cConstant StressbalanceMaxiterEnum
-syn keyword cConstant StressbalancePenaltyFactorEnum
-syn keyword cConstant StressbalanceReltolEnum
-syn keyword cConstant StressbalanceNumRequestedOutputsEnum
-syn keyword cConstant StressbalanceRequestedOutputsEnum
-syn keyword cConstant StressbalanceRestolEnum
-syn keyword cConstant StressbalanceRiftPenaltyThresholdEnum
-syn keyword cConstant StressbalanceShelfDampeningEnum
-syn keyword cConstant StressbalanceFSreconditioningEnum
-syn keyword cConstant StressbalanceViscosityOvershootEnum
-syn keyword cConstant LoadingforceXEnum
-syn keyword cConstant LoadingforceYEnum
-syn keyword cConstant LoadingforceZEnum
-syn keyword cConstant FlowequationIsSIAEnum
-syn keyword cConstant FlowequationIsSSAEnum
-syn keyword cConstant FlowequationIsL1L2Enum
-syn keyword cConstant FlowequationIsHOEnum
-syn keyword cConstant FlowequationIsFSEnum
-syn keyword cConstant FlowequationFeFSEnum
-syn keyword cConstant FlowequationBorderFSEnum
-syn keyword cConstant FrictionAsEnum
-syn keyword cConstant FrictionCoefficientEnum
-syn keyword cConstant FrictionCoefficientcoulombEnum
-syn keyword cConstant FrictionPressureAdjustedTemperatureEnum
-syn keyword cConstant FrictionPEnum
-syn keyword cConstant FrictionQEnum
-syn keyword cConstant FrictionMEnum
-syn keyword cConstant FrictionCEnum
-syn keyword cConstant FrictionLawEnum
-syn keyword cConstant FrictionGammaEnum
-syn keyword cConstant FrictionFEnum
-syn keyword cConstant FrictionWaterLayerEnum
-syn keyword cConstant FrictionEffectivePressureEnum
-syn keyword cConstant FrictionCouplingEnum
-syn keyword cConstant GeometryHydrostaticRatioEnum
-syn keyword cConstant HydrologyModelEnum
-syn keyword cConstant HydrologyNumRequestedOutputsEnum
-syn keyword cConstant HydrologyRequestedOutputsEnum
-syn keyword cConstant HydrologyshreveEnum
-syn keyword cConstant HydrologyshreveStabilizationEnum
-syn keyword cConstant HydrologydcEnum
-syn keyword cConstant HydrologydtEnum
-syn keyword cConstant HydrologyStepsPerStepEnum
-syn keyword cConstant SedimentHeadEnum
-syn keyword cConstant SedimentHeadOldEnum
-syn keyword cConstant SedimentHeadStackedEnum
-syn keyword cConstant SedimentHeadTimeAverageEnum
-syn keyword cConstant SedimentHeadResidualEnum
-syn keyword cConstant EffectivePressureEnum
-syn keyword cConstant EffectivePressureStackedEnum
-syn keyword cConstant EffectivePressureTimeAverageEnum
-syn keyword cConstant EplHeadEnum
-syn keyword cConstant EplHeadOldEnum
-syn keyword cConstant EplHeadStackedEnum
-syn keyword cConstant EplHeadTimeAverageEnum
-syn keyword cConstant EplHeadSlopeXEnum
-syn keyword cConstant EplHeadSlopeYEnum
-syn keyword cConstant EplZigZagCounterEnum
-syn keyword cConstant HydrologydcMaxIterEnum
-syn keyword cConstant HydrologydcRelTolEnum
-syn keyword cConstant HydrologydcSedimentCompressibilityEnum
-syn keyword cConstant HydrologydcSedimentPorosityEnum
-syn keyword cConstant HydrologydcSedimentThicknessEnum
-syn keyword cConstant HydrologydcSedimentTransmitivityEnum
-syn keyword cConstant HydrologydcWaterCompressibilityEnum
-syn keyword cConstant HydrologydcMaskEplactiveNodeEnum
-syn keyword cConstant HydrologydcMaskEplactiveEltEnum
-syn keyword cConstant HydrologydcEplCompressibilityEnum
-syn keyword cConstant HydrologydcEplPorosityEnum
-syn keyword cConstant HydrologydcEplInitialThicknessEnum
-syn keyword cConstant HydrologydcEplColapseThicknessEnum
-syn keyword cConstant HydrologydcEplMaxThicknessEnum
-syn keyword cConstant HydrologydcEplThicknessEnum
-syn keyword cConstant HydrologydcEplThicknessOldEnum
-syn keyword cConstant HydrologydcEplThicknessStackedEnum
-syn keyword cConstant HydrologydcEplThicknessTimeAverageEnum
-syn keyword cConstant HydrologydcEplThickCompEnum
-syn keyword cConstant HydrologydcEplConductivityEnum
-syn keyword cConstant HydrologydcIsefficientlayerEnum
-syn keyword cConstant HydrologydcSedimentlimitFlagEnum
-syn keyword cConstant HydrologydcSedimentlimitEnum
-syn keyword cConstant HydrologydcTransferFlagEnum
-syn keyword cConstant HydrologydcUnconfinedFlagEnum
-syn keyword cConstant HydrologydcLeakageFactorEnum
-syn keyword cConstant HydrologydcPenaltyFactorEnum
-syn keyword cConstant HydrologydcPenaltyLockEnum
-syn keyword cConstant HydrologydcEplflipLockEnum
-syn keyword cConstant HydrologydcBasalMoulinInputEnum
-syn keyword cConstant HydrologySedimentKmaxEnum
-syn keyword cConstant HydrologysommersEnum
-syn keyword cConstant HydrologyHeadEnum
-syn keyword cConstant HydrologyHeadOldEnum
-syn keyword cConstant HydrologyGapHeightEnum
-syn keyword cConstant HydrologyBumpSpacingEnum
-syn keyword cConstant HydrologyBumpHeightEnum
-syn keyword cConstant HydrologyEnglacialInputEnum
-syn keyword cConstant HydrologyMoulinInputEnum
-syn keyword cConstant HydrologyReynoldsEnum
-syn keyword cConstant HydrologyNeumannfluxEnum
-syn keyword cConstant HydrologyRelaxationEnum
-syn keyword cConstant HydrologyBasalFluxEnum
-syn keyword cConstant HydrologyStorageEnum
-syn keyword cConstant DegreeOfChannelizationEnum
-syn keyword cConstant InversionControlParametersEnum
-syn keyword cConstant InversionControlScalingFactorsEnum
-syn keyword cConstant InversionCostFunctionThresholdEnum
-syn keyword cConstant InversionCostFunctionsCoefficientsEnum
-syn keyword cConstant InversionCostFunctionsEnum
-syn keyword cConstant InversionGradientScalingEnum
-syn keyword cConstant InversionIscontrolEnum
-syn keyword cConstant InversionTypeEnum
-syn keyword cConstant InversionIncompleteAdjointEnum
-syn keyword cConstant InversionMaxiterPerStepEnum
-syn keyword cConstant InversionMaxiterEnum
-syn keyword cConstant InversionMaxstepsEnum
-syn keyword cConstant InversionFatolEnum
-syn keyword cConstant InversionFrtolEnum
-syn keyword cConstant InversionGatolEnum
-syn keyword cConstant InversionGrtolEnum
-syn keyword cConstant InversionGttolEnum
-syn keyword cConstant InversionAlgorithmEnum
-syn keyword cConstant InversionNstepsEnum
-syn keyword cConstant InversionDxminEnum
-syn keyword cConstant InversionNumControlParametersEnum
-syn keyword cConstant InversionNumCostFunctionsEnum
-syn keyword cConstant InversionStepThresholdEnum
-syn keyword cConstant InversionThicknessObsEnum
-syn keyword cConstant InversionSurfaceObsEnum
-syn keyword cConstant InversionVxObsEnum
-syn keyword cConstant InversionVyObsEnum
-syn keyword cConstant InversionVzObsEnum
-syn keyword cConstant InversionVelObsEnum
-syn keyword cConstant MaskIceLevelsetEnum
-syn keyword cConstant MaskOceanLevelsetEnum
-syn keyword cConstant MaskLandLevelsetEnum
-syn keyword cConstant MaterialsBetaEnum
-syn keyword cConstant MaterialsHeatcapacityEnum
-syn keyword cConstant MaterialsLatentheatEnum
-syn keyword cConstant MaterialsMeltingpointEnum
-syn keyword cConstant MaterialsMixedLayerCapacityEnum
-syn keyword cConstant MaterialsRheologyBEnum
-syn keyword cConstant MaterialsRheologyBbarEnum
-syn keyword cConstant MaterialsRheologyLawEnum
-syn keyword cConstant MaterialsRheologyNEnum
-syn keyword cConstant MaterialsRheologyEEnum
-syn keyword cConstant MaterialsRheologyEbarEnum
-syn keyword cConstant MaterialsRheologyEcEnum
-syn keyword cConstant MaterialsRheologyEcbarEnum
-syn keyword cConstant MaterialsRheologyEsEnum
-syn keyword cConstant MaterialsRheologyEsbarEnum
-syn keyword cConstant DamageDEnum
-syn keyword cConstant DamageFEnum
-syn keyword cConstant DamageDbarEnum
-syn keyword cConstant DamageLawEnum
-syn keyword cConstant DamageC1Enum
-syn keyword cConstant DamageC2Enum
-syn keyword cConstant DamageC3Enum
-syn keyword cConstant DamageC4Enum
-syn keyword cConstant DamageElementinterpEnum
-syn keyword cConstant DamageHealingEnum
-syn keyword cConstant DamageStressThresholdEnum
-syn keyword cConstant DamageKappaEnum
-syn keyword cConstant DamageStabilizationEnum
-syn keyword cConstant DamageMaxiterEnum
-syn keyword cConstant DamageMaxDamageEnum
-syn keyword cConstant DamageEquivStressEnum
-syn keyword cConstant DamageEvolutionNumRequestedOutputsEnum
-syn keyword cConstant DamageEvolutionRequestedOutputsEnum
-syn keyword cConstant DamageEnum
-syn keyword cConstant NewDamageEnum
-syn keyword cConstant StressIntensityFactorEnum
-syn keyword cConstant CalvingLawEnum
-syn keyword cConstant CalvingCalvingrateEnum
-syn keyword cConstant CalvingMeltingrateEnum
-syn keyword cConstant CalvingHeightAboveFloatationEnum
-syn keyword cConstant CalvingLevermannEnum
-syn keyword cConstant CalvingVonmisesEnum
-syn keyword cConstant CalvingMinthicknessEnum
-syn keyword cConstant CalvingHabEnum
-syn keyword cConstant CalvingCrevasseDepthEnum
-syn keyword cConstant CalvingDev2Enum
-syn keyword cConstant SurfaceCrevasseEnum
-syn keyword cConstant BasalCrevasseEnum
-syn keyword cConstant CrevasseDepthEnum
-syn keyword cConstant WaterheightEnum
-syn keyword cConstant DefaultCalvingEnum
-syn keyword cConstant CalvinglevermannCoeffEnum
-syn keyword cConstant CalvinglevermannMeltingrateEnum
-syn keyword cConstant CalvingdevCoeffEnum
-syn keyword cConstant CalvingratexEnum
-syn keyword cConstant CalvingrateyEnum
-syn keyword cConstant CalvingratexAverageEnum
-syn keyword cConstant CalvingrateyAverageEnum
-syn keyword cConstant CalvingStressThresholdGroundediceEnum
-syn keyword cConstant CalvingStressThresholdFloatingiceEnum
-syn keyword cConstant CalvingMaxEnum
-syn keyword cConstant SigmaVMEnum
-syn keyword cConstant StrainRateparallelEnum
-syn keyword cConstant StrainRateperpendicularEnum
-syn keyword cConstant StrainRateeffectiveEnum
-syn keyword cConstant MaterialsRhoIceEnum
-syn keyword cConstant MaterialsRhoSeawaterEnum
-syn keyword cConstant MaterialsRhoFreshwaterEnum
-syn keyword cConstant MaterialsMuWaterEnum
-syn keyword cConstant MaterialsThermalExchangeVelocityEnum
-syn keyword cConstant MaterialsThermalconductivityEnum
-syn keyword cConstant MaterialsTemperateiceconductivityEnum
-syn keyword cConstant MaterialsLithosphereShearModulusEnum
-syn keyword cConstant MaterialsLithosphereDensityEnum
-syn keyword cConstant MaterialsMantleShearModulusEnum
-syn keyword cConstant MaterialsMantleDensityEnum
-syn keyword cConstant MaterialsEarthDensityEnum
-syn keyword cConstant MeshAverageVertexConnectivityEnum
-syn keyword cConstant MeshLatEnum
-syn keyword cConstant MeshLongEnum
-syn keyword cConstant MeshXEnum
-syn keyword cConstant MeshYEnum
-syn keyword cConstant MeshZEnum
-syn keyword cConstant MeshScaleFactorEnum
-syn keyword cConstant MeshElementsEnum
-syn keyword cConstant MeshNumberofelementsEnum
-syn keyword cConstant MeshNumberoflayersEnum
-syn keyword cConstant MeshNumberofverticesEnum
-syn keyword cConstant MeshVertexonbaseEnum
-syn keyword cConstant MeshVertexonsurfaceEnum
-syn keyword cConstant MeshVertexonboundaryEnum
-syn keyword cConstant MeshElementtypeEnum
-syn keyword cConstant DomainTypeEnum
-syn keyword cConstant DomainDimensionEnum
-syn keyword cConstant Domain2DhorizontalEnum
-syn keyword cConstant Domain2DverticalEnum
-syn keyword cConstant Domain3DEnum
-syn keyword cConstant Domain3DsurfaceEnum
-syn keyword cConstant MasstransportHydrostaticAdjustmentEnum
-syn keyword cConstant MasstransportIsfreesurfaceEnum
-syn keyword cConstant MasstransportMinThicknessEnum
-syn keyword cConstant MasstransportPenaltyFactorEnum
-syn keyword cConstant MasstransportSpcthicknessEnum
-syn keyword cConstant MasstransportStabilizationEnum
-syn keyword cConstant MasstransportNumRequestedOutputsEnum
-syn keyword cConstant MasstransportRequestedOutputsEnum
-syn keyword cConstant QmuIsdakotaEnum
-syn keyword cConstant MassFluxSegmentsEnum
-syn keyword cConstant MassFluxSegmentsPresentEnum
-syn keyword cConstant QmuNumberofpartitionsEnum
-syn keyword cConstant QmuNumberofresponsesEnum
-syn keyword cConstant QmuPartitionEnum
-syn keyword cConstant QmuResponsedescriptorsEnum
-syn keyword cConstant QmuVariabledescriptorsEnum
-syn keyword cConstant SettingsResultsOnNodesEnum
-syn keyword cConstant SettingsIoGatherEnum
-syn keyword cConstant SettingsLowmemEnum
-syn keyword cConstant SettingsOutputFrequencyEnum
-syn keyword cConstant SettingsRecordingFrequencyEnum
-syn keyword cConstant SettingsWaitonlockEnum
-syn keyword cConstant SettingsSolverResidueThresholdEnum
-syn keyword cConstant DebugProfilingEnum
-syn keyword cConstant ProfilingCurrentMemEnum
-syn keyword cConstant ProfilingCurrentFlopsEnum
-syn keyword cConstant ProfilingSolutionTimeEnum
-syn keyword cConstant SteadystateMaxiterEnum
-syn keyword cConstant SteadystateNumRequestedOutputsEnum
-syn keyword cConstant SteadystateReltolEnum
-syn keyword cConstant SteadystateRequestedOutputsEnum
-syn keyword cConstant SurfaceEnum
-syn keyword cConstant ThermalIsenthalpyEnum
-syn keyword cConstant ThermalIsdynamicbasalspcEnum
-syn keyword cConstant ThermalReltolEnum
-syn keyword cConstant ThermalMaxiterEnum
-syn keyword cConstant ThermalPenaltyFactorEnum
-syn keyword cConstant ThermalPenaltyLockEnum
-syn keyword cConstant ThermalPenaltyThresholdEnum
-syn keyword cConstant ThermalSpctemperatureEnum
-syn keyword cConstant ThermalStabilizationEnum
-syn keyword cConstant ThermalNumRequestedOutputsEnum
-syn keyword cConstant ThermalRequestedOutputsEnum
-syn keyword cConstant GiaMantleViscosityEnum
-syn keyword cConstant GiaLithosphereThicknessEnum
-syn keyword cConstant ThicknessEnum
-syn keyword cConstant TimesteppingStartTimeEnum
-syn keyword cConstant TimesteppingFinalTimeEnum
-syn keyword cConstant TimesteppingCflCoefficientEnum
-syn keyword cConstant TimesteppingTimeAdaptEnum
-syn keyword cConstant TimesteppingTimeStepEnum
-syn keyword cConstant TimesteppingInterpForcingsEnum
-syn keyword cConstant TimesteppingCouplingTimeEnum
-syn keyword cConstant TransientIssmbEnum
-syn keyword cConstant TransientIscouplerEnum
-syn keyword cConstant TransientIsoceancouplingEnum
-syn keyword cConstant TransientIsstressbalanceEnum
-syn keyword cConstant TransientIsgroundinglineEnum
-syn keyword cConstant TransientIsmasstransportEnum
-syn keyword cConstant TransientIsthermalEnum
-syn keyword cConstant TransientIsgiaEnum
-syn keyword cConstant TransientIsesaEnum
-syn keyword cConstant TransientIsdamageevolutionEnum
-syn keyword cConstant TransientIshydrologyEnum
-syn keyword cConstant TransientIsmovingfrontEnum
-syn keyword cConstant TransientIsslrEnum
-syn keyword cConstant TransientNumRequestedOutputsEnum
-syn keyword cConstant TransientRequestedOutputsEnum
-syn keyword cConstant BalancethicknessSpcthicknessEnum
-syn keyword cConstant BalancethicknessApparentMassbalanceEnum
-syn keyword cConstant BalancethicknessDiffusionCoefficientEnum
-syn keyword cConstant BalancethicknessOmegaEnum
-syn keyword cConstant BalancethicknessOmega0Enum
-syn keyword cConstant BalancethicknessD0Enum
-syn keyword cConstant SmbEnum
-syn keyword cConstant SmbAnalysisEnum
-syn keyword cConstant SmbSolutionEnum
-syn keyword cConstant SmbNumRequestedOutputsEnum
-syn keyword cConstant SmbRequestedOutputsEnum
-syn keyword cConstant SmbIsInitializedEnum
-syn keyword cConstant SmbDziniEnum
-syn keyword cConstant SmbDiniEnum
-syn keyword cConstant SmbReiniEnum
-syn keyword cConstant SmbGdniniEnum
-syn keyword cConstant SmbGspiniEnum
-syn keyword cConstant SmbECiniEnum
-syn keyword cConstant SmbWiniEnum
-syn keyword cConstant SmbAiniEnum
-syn keyword cConstant SmbTiniEnum
-syn keyword cConstant SmbSizeiniEnum
-syn keyword cConstant SMBforcingEnum
-syn keyword cConstant SmbMassBalanceEnum
-syn keyword cConstant SMBgembEnum
-syn keyword cConstant SmbInitDensityScalingEnum
-syn keyword cConstant SmbTaEnum
-syn keyword cConstant SmbVEnum
-syn keyword cConstant SmbDswrfEnum
-syn keyword cConstant SmbDlwrfEnum
-syn keyword cConstant SmbPEnum
-syn keyword cConstant SmbEAirEnum
-syn keyword cConstant SmbPAirEnum
-syn keyword cConstant SmbTmeanEnum
-syn keyword cConstant SmbCEnum
-syn keyword cConstant SmbTzEnum
-syn keyword cConstant SmbVzEnum
-syn keyword cConstant SmbDtEnum
-syn keyword cConstant SmbDzEnum
-syn keyword cConstant SmbAIdxEnum
-syn keyword cConstant SmbSwIdxEnum
-syn keyword cConstant SmbDenIdxEnum
-syn keyword cConstant SmbZTopEnum
-syn keyword cConstant SmbDzTopEnum
-syn keyword cConstant SmbDzMinEnum
-syn keyword cConstant SmbZYEnum
-syn keyword cConstant SmbZMaxEnum
-syn keyword cConstant SmbZMinEnum
-syn keyword cConstant SmbOutputFreqEnum
-syn keyword cConstant SmbASnowEnum
-syn keyword cConstant SmbAIceEnum
-syn keyword cConstant SmbCldFracEnum
-syn keyword cConstant SmbT0wetEnum
-syn keyword cConstant SmbT0dryEnum
-syn keyword cConstant SmbKEnum
-syn keyword cConstant SmbDEnum
-syn keyword cConstant SmbReEnum
-syn keyword cConstant SmbGdnEnum
-syn keyword cConstant SmbGspEnum
-syn keyword cConstant SmbECEnum
-syn keyword cConstant SmbWEnum
-syn keyword cConstant SmbAEnum
-syn keyword cConstant SmbTEnum
-syn keyword cConstant SmbAValueEnum
-syn keyword cConstant SmbTeValueEnum
-syn keyword cConstant SmbIsgraingrowthEnum
-syn keyword cConstant SmbIsalbedoEnum
-syn keyword cConstant SmbIsshortwaveEnum
-syn keyword cConstant SmbIsthermalEnum
-syn keyword cConstant SmbIsaccumulationEnum
-syn keyword cConstant SmbIsmeltEnum
-syn keyword cConstant SmbIsdensificationEnum
-syn keyword cConstant SmbIsturbulentfluxEnum
-syn keyword cConstant SmbDz_addEnum
-syn keyword cConstant SmbM_addEnum
-syn keyword cConstant SMBpddEnum
-syn keyword cConstant SmbDelta18oEnum
-syn keyword cConstant SmbDelta18oSurfaceEnum
-syn keyword cConstant SmbIsdelta18oEnum
-syn keyword cConstant SmbIssetpddfacEnum
-syn keyword cConstant SmbIsmungsmEnum
-syn keyword cConstant SmbIsd18opdEnum
-syn keyword cConstant SmbPrecipitationsPresentdayEnum
-syn keyword cConstant SmbPrecipitationsLgmEnum
-syn keyword cConstant SmbTemperaturesPresentdayEnum
-syn keyword cConstant SmbTemperaturesLgmEnum
-syn keyword cConstant SmbPrecipitationEnum
-syn keyword cConstant SmbPddfacSnowEnum
-syn keyword cConstant SmbPddfacIceEnum
-syn keyword cConstant SmbDesfacEnum
-syn keyword cConstant SmbS0pEnum
-syn keyword cConstant SmbS0tEnum
-syn keyword cConstant SmbRlapsEnum
-syn keyword cConstant SmbRlapslgmEnum
-syn keyword cConstant SmbPfacEnum
-syn keyword cConstant SmbTdiffEnum
-syn keyword cConstant SmbSealevEnum
-syn keyword cConstant SMBd18opddEnum
-syn keyword cConstant SmbDpermilEnum
-syn keyword cConstant SmbFEnum
-syn keyword cConstant SMBgradientsEnum
-syn keyword cConstant SmbMonthlytemperaturesEnum
-syn keyword cConstant SmbHrefEnum
-syn keyword cConstant SmbSmbrefEnum
-syn keyword cConstant SmbBPosEnum
-syn keyword cConstant SmbBNegEnum
-syn keyword cConstant SMBhenningEnum
-syn keyword cConstant SMBcomponentsEnum
-syn keyword cConstant SmbAccumulationEnum
-syn keyword cConstant SmbEvaporationEnum
-syn keyword cConstant SmbRunoffEnum
-syn keyword cConstant SMBmeltcomponentsEnum
-syn keyword cConstant SmbMeltEnum
-syn keyword cConstant SmbRefreezeEnum
-syn keyword cConstant SMBgcmEnum
-syn keyword cConstant SMBgradientselaEnum
-syn keyword cConstant SmbElaEnum
-syn keyword cConstant SmbBMaxEnum
-syn keyword cConstant SmbBMinEnum
-syn keyword cConstant AdjointpEnum
-syn keyword cConstant AdjointxEnum
-syn keyword cConstant AdjointyEnum
-syn keyword cConstant AdjointzEnum
-syn keyword cConstant BalancethicknessMisfitEnum
-syn keyword cConstant BedSlopeXEnum
-syn keyword cConstant BedSlopeYEnum
-syn keyword cConstant BaseSlopeXEnum
-syn keyword cConstant BaseSlopeYEnum
-syn keyword cConstant BoundaryEnum
-syn keyword cConstant ConvergedEnum
-syn keyword cConstant InternalEnum
-syn keyword cConstant MassFluxEnum
-syn keyword cConstant MeltingOffsetEnum
-syn keyword cConstant MisfitEnum
-syn keyword cConstant PressureEnum
-syn keyword cConstant PressurePicardEnum
-syn keyword cConstant AndroidFrictionCoefficientEnum
-syn keyword cConstant ResetPenaltiesEnum
-syn keyword cConstant SurfaceAbsVelMisfitEnum
-syn keyword cConstant SurfaceAreaEnum
-syn keyword cConstant SurfaceAverageVelMisfitEnum
-syn keyword cConstant SurfaceLogVelMisfitEnum
-syn keyword cConstant SurfaceLogVxVyMisfitEnum
-syn keyword cConstant SurfaceRelVelMisfitEnum
-syn keyword cConstant SurfaceSlopeXEnum
-syn keyword cConstant SurfaceSlopeYEnum
-syn keyword cConstant TemperatureEnum
-syn keyword cConstant TemperaturePicardEnum
-syn keyword cConstant TemperaturePDDEnum
-syn keyword cConstant ThicknessAbsMisfitEnum
-syn keyword cConstant SurfaceAbsMisfitEnum
-syn keyword cConstant OmegaAbsGradientEnum
-syn keyword cConstant EtaDiffEnum
-syn keyword cConstant EtaAbsGradientEnum
-syn keyword cConstant VelEnum
-syn keyword cConstant VelocityEnum
-syn keyword cConstant VxAverageEnum
-syn keyword cConstant VxEnum
-syn keyword cConstant VxPicardEnum
-syn keyword cConstant VyAverageEnum
-syn keyword cConstant VyEnum
-syn keyword cConstant VyPicardEnum
-syn keyword cConstant VzEnum
-syn keyword cConstant VzSSAEnum
-syn keyword cConstant VzHOEnum
-syn keyword cConstant VzPicardEnum
-syn keyword cConstant VzFSEnum
-syn keyword cConstant VxMeshEnum
-syn keyword cConstant VyMeshEnum
-syn keyword cConstant VzMeshEnum
-syn keyword cConstant EnthalpyEnum
-syn keyword cConstant EnthalpyPicardEnum
-syn keyword cConstant ThicknessAbsGradientEnum
-syn keyword cConstant ThicknessAlongGradientEnum
-syn keyword cConstant ThicknessAcrossGradientEnum
-syn keyword cConstant ThicknessPositiveEnum
-syn keyword cConstant IntMatParamEnum
-syn keyword cConstant RheologyBbarAbsGradientEnum
-syn keyword cConstant RheologyBAbsGradientEnum
-syn keyword cConstant DragCoefficientAbsGradientEnum
-syn keyword cConstant TransientInputEnum
-syn keyword cConstant WaterfractionEnum
-syn keyword cConstant WaterfractionDrainageEnum
-syn keyword cConstant WaterfractionDrainageIntegratedEnum
-syn keyword cConstant WatercolumnEnum
-syn keyword cConstant ViscousHeatingEnum
-syn keyword cConstant HydrologyWaterVxEnum
-syn keyword cConstant HydrologyWaterVyEnum
-syn keyword cConstant DrivingStressXEnum
-syn keyword cConstant DrivingStressYEnum
-syn keyword cConstant SigmaNNEnum
-syn keyword cConstant StressTensorEnum
-syn keyword cConstant StressTensorxxEnum
-syn keyword cConstant StressTensorxyEnum
-syn keyword cConstant StressTensorxzEnum
-syn keyword cConstant StressTensoryyEnum
-syn keyword cConstant StressTensoryzEnum
-syn keyword cConstant StressTensorzzEnum
-syn keyword cConstant StressMaxPrincipalEnum
-syn keyword cConstant DeviatoricStressEnum
-syn keyword cConstant DeviatoricStressxxEnum
-syn keyword cConstant DeviatoricStressxyEnum
-syn keyword cConstant DeviatoricStressxzEnum
-syn keyword cConstant DeviatoricStressyyEnum
-syn keyword cConstant DeviatoricStressyzEnum
-syn keyword cConstant DeviatoricStresszzEnum
-syn keyword cConstant DeviatoricStresseffectiveEnum
-syn keyword cConstant LambdaSEnum
-syn keyword cConstant StrainRateEnum
-syn keyword cConstant StrainRatexxEnum
-syn keyword cConstant StrainRatexyEnum
-syn keyword cConstant StrainRatexzEnum
-syn keyword cConstant StrainRateyyEnum
-syn keyword cConstant StrainRateyzEnum
-syn keyword cConstant StrainRatezzEnum
-syn keyword cConstant DivergenceEnum
-syn keyword cConstant MaxDivergenceEnum
-syn keyword cConstant GiaCrossSectionShapeEnum
-syn keyword cConstant GiadWdtEnum
-syn keyword cConstant GiaWEnum
-syn keyword cConstant SaveResultsEnum
-syn keyword cConstant BoolExternalResultEnum
-syn keyword cConstant DoubleExternalResultEnum
-syn keyword cConstant DoubleMatExternalResultEnum
-syn keyword cConstant IntExternalResultEnum
-syn keyword cConstant IntMatExternalResultEnum
-syn keyword cConstant JEnum
-syn keyword cConstant StringExternalResultEnum
-syn keyword cConstant StepEnum
-syn keyword cConstant TimeEnum
-syn keyword cConstant WaterColumnOldEnum
-syn keyword cConstant SurfaceObservationEnum
-syn keyword cConstant WeightsSurfaceObservationEnum
-syn keyword cConstant OutputdefinitionEnum
-syn keyword cConstant Outputdefinition1Enum
-syn keyword cConstant Outputdefinition2Enum
-syn keyword cConstant Outputdefinition3Enum
-syn keyword cConstant Outputdefinition4Enum
-syn keyword cConstant Outputdefinition5Enum
-syn keyword cConstant Outputdefinition6Enum
-syn keyword cConstant Outputdefinition7Enum
-syn keyword cConstant Outputdefinition8Enum
-syn keyword cConstant Outputdefinition9Enum
-syn keyword cConstant Outputdefinition10Enum
-syn keyword cConstant Outputdefinition11Enum
-syn keyword cConstant Outputdefinition12Enum
-syn keyword cConstant Outputdefinition13Enum
-syn keyword cConstant Outputdefinition14Enum
-syn keyword cConstant Outputdefinition15Enum
-syn keyword cConstant Outputdefinition16Enum
-syn keyword cConstant Outputdefinition17Enum
-syn keyword cConstant Outputdefinition18Enum
-syn keyword cConstant Outputdefinition19Enum
-syn keyword cConstant Outputdefinition20Enum
-syn keyword cConstant Outputdefinition21Enum
-syn keyword cConstant Outputdefinition22Enum
-syn keyword cConstant Outputdefinition23Enum
-syn keyword cConstant Outputdefinition24Enum
-syn keyword cConstant Outputdefinition25Enum
-syn keyword cConstant Outputdefinition26Enum
-syn keyword cConstant Outputdefinition27Enum
-syn keyword cConstant Outputdefinition28Enum
-syn keyword cConstant Outputdefinition29Enum
-syn keyword cConstant Outputdefinition30Enum
-syn keyword cConstant Outputdefinition31Enum
-syn keyword cConstant Outputdefinition32Enum
-syn keyword cConstant Outputdefinition33Enum
-syn keyword cConstant Outputdefinition34Enum
-syn keyword cConstant Outputdefinition35Enum
-syn keyword cConstant Outputdefinition36Enum
-syn keyword cConstant Outputdefinition37Enum
-syn keyword cConstant Outputdefinition38Enum
-syn keyword cConstant Outputdefinition39Enum
-syn keyword cConstant Outputdefinition40Enum
-syn keyword cConstant Outputdefinition41Enum
-syn keyword cConstant Outputdefinition42Enum
-syn keyword cConstant Outputdefinition43Enum
-syn keyword cConstant Outputdefinition44Enum
-syn keyword cConstant Outputdefinition45Enum
-syn keyword cConstant Outputdefinition46Enum
-syn keyword cConstant Outputdefinition47Enum
-syn keyword cConstant Outputdefinition48Enum
-syn keyword cConstant Outputdefinition49Enum
-syn keyword cConstant Outputdefinition50Enum
-syn keyword cConstant Outputdefinition51Enum
-syn keyword cConstant Outputdefinition52Enum
-syn keyword cConstant Outputdefinition53Enum
-syn keyword cConstant Outputdefinition54Enum
-syn keyword cConstant Outputdefinition55Enum
-syn keyword cConstant Outputdefinition56Enum
-syn keyword cConstant Outputdefinition57Enum
-syn keyword cConstant Outputdefinition58Enum
-syn keyword cConstant Outputdefinition59Enum
-syn keyword cConstant Outputdefinition60Enum
-syn keyword cConstant Outputdefinition61Enum
-syn keyword cConstant Outputdefinition62Enum
-syn keyword cConstant Outputdefinition63Enum
-syn keyword cConstant Outputdefinition64Enum
-syn keyword cConstant Outputdefinition65Enum
-syn keyword cConstant Outputdefinition66Enum
-syn keyword cConstant Outputdefinition67Enum
-syn keyword cConstant Outputdefinition68Enum
-syn keyword cConstant Outputdefinition69Enum
-syn keyword cConstant Outputdefinition70Enum
-syn keyword cConstant Outputdefinition71Enum
-syn keyword cConstant Outputdefinition72Enum
-syn keyword cConstant Outputdefinition73Enum
-syn keyword cConstant Outputdefinition74Enum
-syn keyword cConstant Outputdefinition75Enum
-syn keyword cConstant Outputdefinition76Enum
-syn keyword cConstant Outputdefinition77Enum
-syn keyword cConstant Outputdefinition78Enum
-syn keyword cConstant Outputdefinition79Enum
-syn keyword cConstant Outputdefinition80Enum
-syn keyword cConstant Outputdefinition81Enum
-syn keyword cConstant Outputdefinition82Enum
-syn keyword cConstant Outputdefinition83Enum
-syn keyword cConstant Outputdefinition84Enum
-syn keyword cConstant Outputdefinition85Enum
-syn keyword cConstant Outputdefinition86Enum
-syn keyword cConstant Outputdefinition87Enum
-syn keyword cConstant Outputdefinition88Enum
-syn keyword cConstant Outputdefinition89Enum
-syn keyword cConstant Outputdefinition90Enum
-syn keyword cConstant Outputdefinition91Enum
-syn keyword cConstant Outputdefinition92Enum
-syn keyword cConstant Outputdefinition93Enum
-syn keyword cConstant Outputdefinition94Enum
-syn keyword cConstant Outputdefinition95Enum
-syn keyword cConstant Outputdefinition96Enum
-syn keyword cConstant Outputdefinition97Enum
-syn keyword cConstant Outputdefinition98Enum
-syn keyword cConstant Outputdefinition99Enum
-syn keyword cConstant Outputdefinition100Enum
-syn keyword cConstant OutputdefinitionListEnum
-syn keyword cConstant MassfluxatgateEnum
-syn keyword cConstant NodalvalueEnum
-syn keyword cConstant RegionaloutputEnum
-syn keyword cConstant VxObsEnum
-syn keyword cConstant VyObsEnum
-syn keyword cConstant NumberedcostfunctionEnum
-syn keyword cConstant AbsoluteEnum
-syn keyword cConstant IncrementalEnum
-syn keyword cConstant AugmentedLagrangianREnum
-syn keyword cConstant AugmentedLagrangianRhopEnum
-syn keyword cConstant AugmentedLagrangianRlambdaEnum
-syn keyword cConstant AugmentedLagrangianRholambdaEnum
-syn keyword cConstant AugmentedLagrangianThetaEnum
-syn keyword cConstant NoneEnum
-syn keyword cConstant AggressiveMigrationEnum
-syn keyword cConstant SoftMigrationEnum
-syn keyword cConstant SubelementMigrationEnum
-syn keyword cConstant SubelementMigration2Enum
-syn keyword cConstant SubelementMigration3Enum
-syn keyword cConstant SubelementMigration4Enum
-syn keyword cConstant ContactEnum
-syn keyword cConstant GroundingOnlyEnum
-syn keyword cConstant MaskGroundediceLevelsetEnum
-syn keyword cConstant AdjointEnum
-syn keyword cConstant ColinearEnum
-syn keyword cConstant ControlSteadyEnum
-syn keyword cConstant FsetEnum
-syn keyword cConstant Gradient1Enum
-syn keyword cConstant Gradient2Enum
-syn keyword cConstant Gradient3Enum
-syn keyword cConstant GradientEnum
-syn keyword cConstant GroundinglineMigrationEnum
-syn keyword cConstant GsetEnum
-syn keyword cConstant IndexEnum
-syn keyword cConstant IndexedEnum
-syn keyword cConstant IntersectEnum
-syn keyword cConstant NodalEnum
-syn keyword cConstant OldGradientEnum
-syn keyword cConstant OutputBufferPointerEnum
-syn keyword cConstant OutputBufferSizePointerEnum
-syn keyword cConstant OutputFilePointerEnum
-syn keyword cConstant ToolkitsFileNameEnum
-syn keyword cConstant RootPathEnum
-syn keyword cConstant OutputFileNameEnum
-syn keyword cConstant InputFileNameEnum
-syn keyword cConstant LockFileNameEnum
-syn keyword cConstant RestartFileNameEnum
-syn keyword cConstant ToolkitsOptionsAnalysesEnum
-syn keyword cConstant ToolkitsOptionsStringsEnum
-syn keyword cConstant QmuErrNameEnum
-syn keyword cConstant QmuInNameEnum
-syn keyword cConstant QmuOutNameEnum
-syn keyword cConstant RegularEnum
-syn keyword cConstant ScaledEnum
-syn keyword cConstant SeparateEnum
-syn keyword cConstant SsetEnum
-syn keyword cConstant DenseEnum
-syn keyword cConstant MpiDenseEnum
-syn keyword cConstant MpiSparseEnum
-syn keyword cConstant SeqEnum
-syn keyword cConstant MpiEnum
-syn keyword cConstant MumpsEnum
-syn keyword cConstant GslEnum
-syn keyword cConstant CuffeyEnum
-syn keyword cConstant BuddJackaEnum
-syn keyword cConstant CuffeyTemperateEnum
-syn keyword cConstant PatersonEnum
-syn keyword cConstant ArrheniusEnum
-syn keyword cConstant LliboutryDuvalEnum
-syn keyword cConstant ExtrapolationVariableEnum
-syn keyword cConstant IceMaskNodeActivationEnum
-syn keyword cConstant LevelsetfunctionSlopeXEnum
-syn keyword cConstant LevelsetfunctionSlopeYEnum
-syn keyword cConstant LevelsetfunctionPicardEnum
-syn keyword cConstant LevelsetReinitFrequencyEnum
-syn keyword cConstant SealevelEnum
-syn keyword cConstant SealevelUmotionEnum
-syn keyword cConstant SealevelNmotionEnum
-syn keyword cConstant SealevelEmotionEnum
-syn keyword cConstant SealevelAbsoluteEnum
-syn keyword cConstant SealevelEustaticEnum
-syn keyword cConstant SealevelInertiaTensorXZEnum
-syn keyword cConstant SealevelInertiaTensorYZEnum
-syn keyword cConstant SealevelInertiaTensorZZEnum
-syn keyword cConstant SealevelObsEnum
-syn keyword cConstant SealevelWeightsEnum
-syn keyword cConstant SealevelriseDeltathicknessEnum
-syn keyword cConstant SealevelriseMaxiterEnum
-syn keyword cConstant SealevelriseReltolEnum
-syn keyword cConstant SealevelriseAbstolEnum
-syn keyword cConstant SealevelriseRigidEnum
-syn keyword cConstant SealevelriseElasticEnum
-syn keyword cConstant SealevelriseRotationEnum
-syn keyword cConstant SealevelriseTidalLoveHEnum
-syn keyword cConstant SealevelriseTidalLoveKEnum
-syn keyword cConstant SealevelriseFluidLoveEnum
-syn keyword cConstant SealevelriseEquatorialMoiEnum
-syn keyword cConstant SealevelrisePolarMoiEnum
-syn keyword cConstant SealevelriseAngularVelocityEnum
-syn keyword cConstant SealevelriseOceanAreaScalingEnum
-syn keyword cConstant SealevelriseStericRateEnum
-syn keyword cConstant SealevelriseGElasticEnum
-syn keyword cConstant SealevelriseUElasticEnum
-syn keyword cConstant SealevelriseHElasticEnum
-syn keyword cConstant SealevelriseTransitionsEnum
-syn keyword cConstant SealevelriseRequestedOutputsEnum
-syn keyword cConstant SealevelriseNumRequestedOutputsEnum
-syn keyword cConstant LoveNfreqEnum
-syn keyword cConstant LoveFrequenciesEnum
-syn keyword cConstant LoveShNmaxEnum
-syn keyword cConstant LoveShNminEnum
-syn keyword cConstant LoveG0Enum
-syn keyword cConstant LoveR0Enum
-syn keyword cConstant LoveMu0Enum
-syn keyword cConstant LoveAllowLayerDeletionEnum
-syn keyword cConstant LoveForcingTypeEnum
-syn keyword cConstant LoveHrEnum
-syn keyword cConstant LoveKrEnum
-syn keyword cConstant LoveLrEnum
-syn keyword cConstant LoveHiEnum
-syn keyword cConstant LoveKiEnum
-syn keyword cConstant LoveLiEnum
-syn keyword cConstant LoveKernelsEnum
-syn keyword cConstant LoveKernelsRealEnum
-syn keyword cConstant LoveKernelsImagEnum
-syn keyword cConstant EsaUmotionEnum
-syn keyword cConstant EsaNmotionEnum
-syn keyword cConstant EsaEmotionEnum
-syn keyword cConstant EsaXmotionEnum
-syn keyword cConstant EsaYmotionEnum
-syn keyword cConstant EsaHemisphereEnum
-syn keyword cConstant EsaStrainratexxEnum
-syn keyword cConstant EsaStrainratexyEnum
-syn keyword cConstant EsaStrainrateyyEnum
-syn keyword cConstant EsaRotationrateEnum
-syn keyword cConstant EsaDeltathicknessEnum
-syn keyword cConstant EsaUElasticEnum
-syn keyword cConstant EsaHElasticEnum
-syn keyword cConstant EsaTransitionsEnum
-syn keyword cConstant EsaRequestedOutputsEnum
-syn keyword cConstant EsaNumRequestedOutputsEnum
-syn keyword cConstant TransientAmrFrequencyEnum
-syn keyword cConstant AmrTypeEnum
-syn keyword cConstant AmrRestartEnum
-syn keyword cConstant AmrNeopzEnum
-syn keyword cConstant AmrLevelMaxEnum
-syn keyword cConstant AmrLagEnum
-syn keyword cConstant AmrBamgEnum
-syn keyword cConstant AmrHminEnum
-syn keyword cConstant AmrHmaxEnum
-syn keyword cConstant AmrFieldEnum
-syn keyword cConstant AmrErrEnum
-syn keyword cConstant AmrKeepMetricEnum
-syn keyword cConstant AmrGradationEnum
-syn keyword cConstant AmrGroundingLineResolutionEnum
-syn keyword cConstant AmrGroundingLineDistanceEnum
-syn keyword cConstant AmrIceFrontResolutionEnum
-syn keyword cConstant AmrIceFrontDistanceEnum
-syn keyword cConstant AmrThicknessErrorResolutionEnum
-syn keyword cConstant AmrThicknessErrorThresholdEnum
-syn keyword cConstant AmrThicknessErrorGroupThresholdEnum
-syn keyword cConstant AmrThicknessErrorMaximumEnum
-syn keyword cConstant AmrDeviatoricErrorResolutionEnum
-syn keyword cConstant AmrDeviatoricErrorThresholdEnum
-syn keyword cConstant AmrDeviatoricErrorGroupThresholdEnum
-syn keyword cConstant AmrDeviatoricErrorMaximumEnum
-syn keyword cConstant DeviatoricStressErrorEstimatorEnum
-syn keyword cConstant ThicknessErrorEstimatorEnum
-syn keyword cConstant ParametersENDEnum
-syn keyword cConstant XYEnum
-syn keyword cConstant XYZEnum
-syn keyword cConstant GenericParamEnum
-syn keyword cConstant BoolInputEnum
-syn keyword cConstant BoolParamEnum
-syn keyword cConstant ContourEnum
-syn keyword cConstant ControlInputEnum
-syn keyword cConstant DatasetInputEnum
-syn keyword cConstant DoubleInputEnum
-syn keyword cConstant DoubleArrayInputEnum
-syn keyword cConstant DataSetParamEnum
-syn keyword cConstant DoubleMatArrayParamEnum
-syn keyword cConstant DoubleMatParamEnum
-syn keyword cConstant DoubleParamEnum
-syn keyword cConstant DoubleVecParamEnum
-syn keyword cConstant ElementEnum
-syn keyword cConstant ElementHookEnum
-syn keyword cConstant HookEnum
-syn keyword cConstant ExternalResultEnum
-syn keyword cConstant FileParamEnum
-syn keyword cConstant InputEnum
-syn keyword cConstant IntInputEnum
-syn keyword cConstant IntParamEnum
-syn keyword cConstant IntVecParamEnum
-syn keyword cConstant TransientParamEnum
-syn keyword cConstant TransientArrayParamEnum
-syn keyword cConstant MaticeEnum
-syn keyword cConstant MatlithoEnum
-syn keyword cConstant MatdamageiceEnum
-syn keyword cConstant MatenhancediceEnum
-syn keyword cConstant MatestarEnum
-syn keyword cConstant MatparEnum
-syn keyword cConstant NodeEnum
-syn keyword cConstant NumericalfluxEnum
-syn keyword cConstant NeumannfluxEnum
-syn keyword cConstant ParamEnum
-syn keyword cConstant MoulinEnum
-syn keyword cConstant PengridEnum
-syn keyword cConstant PenpairEnum
-syn keyword cConstant ProfilerEnum
-syn keyword cConstant MatrixParamEnum
-syn keyword cConstant MassconEnum
-syn keyword cConstant MassconaxpbyEnum
-syn keyword cConstant NodeSIdEnum
-syn keyword cConstant ElementSIdEnum
-syn keyword cConstant VectorParamEnum
-syn keyword cConstant RiftfrontEnum
-syn keyword cConstant SegmentEnum
-syn keyword cConstant SegmentRiftfrontEnum
-syn keyword cConstant SpcDynamicEnum
-syn keyword cConstant SpcStaticEnum
-syn keyword cConstant SpcTransientEnum
-syn keyword cConstant StringArrayParamEnum
-syn keyword cConstant StringParamEnum
-syn keyword cConstant SegEnum
-syn keyword cConstant SegInputEnum
-syn keyword cConstant TriaEnum
-syn keyword cConstant TriaInputEnum
-syn keyword cConstant TetraEnum
-syn keyword cConstant TetraInputEnum
-syn keyword cConstant PentaEnum
-syn keyword cConstant PentaInputEnum
-syn keyword cConstant VertexEnum
-syn keyword cConstant VertexPIdEnum
-syn keyword cConstant VertexSIdEnum
-syn keyword cConstant OptionEnum
-syn keyword cConstant GenericOptionEnum
-syn keyword cConstant AdjointBalancethicknessAnalysisEnum
-syn keyword cConstant AdjointBalancethickness2AnalysisEnum
-syn keyword cConstant AdjointHorizAnalysisEnum
-syn keyword cConstant DefaultAnalysisEnum
-syn keyword cConstant BalancethicknessAnalysisEnum
-syn keyword cConstant BalancethicknessSolutionEnum
-syn keyword cConstant Balancethickness2AnalysisEnum
-syn keyword cConstant Balancethickness2SolutionEnum
-syn keyword cConstant BalancethicknessSoftAnalysisEnum
-syn keyword cConstant BalancethicknessSoftSolutionEnum
-syn keyword cConstant BalancevelocityAnalysisEnum
-syn keyword cConstant BalancevelocitySolutionEnum
-syn keyword cConstant L2ProjectionEPLAnalysisEnum
-syn keyword cConstant L2ProjectionBaseAnalysisEnum
-syn keyword cConstant BedSlopeSolutionEnum
-syn keyword cConstant DamageEvolutionSolutionEnum
-syn keyword cConstant DamageEvolutionAnalysisEnum
-syn keyword cConstant StressbalanceAnalysisEnum
-syn keyword cConstant StressbalanceSIAAnalysisEnum
-syn keyword cConstant StressbalanceSolutionEnum
-syn keyword cConstant StressbalanceVerticalAnalysisEnum
-syn keyword cConstant EnthalpyAnalysisEnum
-syn keyword cConstant HydrologyShreveAnalysisEnum
-syn keyword cConstant HydrologyDCInefficientAnalysisEnum
-syn keyword cConstant HydrologyDCEfficientAnalysisEnum
-syn keyword cConstant HydrologySommersAnalysisEnum
-syn keyword cConstant HydrologySolutionEnum
-syn keyword cConstant MeltingAnalysisEnum
-syn keyword cConstant MasstransportAnalysisEnum
-syn keyword cConstant MasstransportSolutionEnum
-syn keyword cConstant FreeSurfaceBaseAnalysisEnum
-syn keyword cConstant FreeSurfaceTopAnalysisEnum
-syn keyword cConstant ExtrudeFromBaseAnalysisEnum
-syn keyword cConstant ExtrudeFromTopAnalysisEnum
-syn keyword cConstant DepthAverageAnalysisEnum
-syn keyword cConstant SealevelriseSolutionEnum
-syn keyword cConstant SealevelriseAnalysisEnum
-syn keyword cConstant SteadystateSolutionEnum
-syn keyword cConstant SurfaceSlopeSolutionEnum
-syn keyword cConstant SmoothAnalysisEnum
-syn keyword cConstant ThermalAnalysisEnum
-syn keyword cConstant ThermalSolutionEnum
-syn keyword cConstant TransientSolutionEnum
-syn keyword cConstant UzawaPressureAnalysisEnum
-syn keyword cConstant GiaSolutionEnum
-syn keyword cConstant GiaIvinsAnalysisEnum
-syn keyword cConstant EsaSolutionEnum
-syn keyword cConstant EsaAnalysisEnum
-syn keyword cConstant LoveSolutionEnum
-syn keyword cConstant LoveAnalysisEnum
-syn keyword cConstant LevelsetAnalysisEnum
-syn keyword cConstant ExtrapolationAnalysisEnum
-syn keyword cConstant ApproximationEnum
-syn keyword cConstant NoneApproximationEnum
-syn keyword cConstant SIAApproximationEnum
-syn keyword cConstant SSAApproximationEnum
-syn keyword cConstant SSAHOApproximationEnum
-syn keyword cConstant SSAFSApproximationEnum
-syn keyword cConstant L1L2ApproximationEnum
-syn keyword cConstant HOApproximationEnum
-syn keyword cConstant HOFSApproximationEnum
-syn keyword cConstant FSApproximationEnum
-syn keyword cConstant FSvelocityEnum
-syn keyword cConstant FSpressureEnum
-syn keyword cConstant GaussSegEnum
-syn keyword cConstant GaussTriaEnum
-syn keyword cConstant GaussTetraEnum
-syn keyword cConstant GaussPentaEnum
-syn keyword cConstant TriangleInterpEnum
-syn keyword cConstant BilinearInterpEnum
-syn keyword cConstant NearestInterpEnum
-syn keyword cConstant MinVelEnum
-syn keyword cConstant MaxVelEnum
-syn keyword cConstant MinVxEnum
-syn keyword cConstant MaxVxEnum
-syn keyword cConstant MaxAbsVxEnum
-syn keyword cConstant MinVyEnum
-syn keyword cConstant MaxVyEnum
-syn keyword cConstant MaxAbsVyEnum
-syn keyword cConstant MinVzEnum
-syn keyword cConstant MaxVzEnum
-syn keyword cConstant MaxAbsVzEnum
-syn keyword cConstant FloatingAreaEnum
-syn keyword cConstant FloatingAreaScaledEnum
-syn keyword cConstant GroundedAreaEnum
-syn keyword cConstant GroundedAreaScaledEnum
-syn keyword cConstant IceMassEnum
-syn keyword cConstant IceMassScaledEnum
-syn keyword cConstant IceVolumeEnum
-syn keyword cConstant IceVolumeScaledEnum
-syn keyword cConstant IceVolumeAboveFloatationEnum
-syn keyword cConstant IceVolumeAboveFloatationScaledEnum
-syn keyword cConstant TotalFloatingBmbEnum
-syn keyword cConstant TotalFloatingBmbScaledEnum
-syn keyword cConstant TotalGroundedBmbEnum
-syn keyword cConstant TotalGroundedBmbScaledEnum
-syn keyword cConstant TotalSmbEnum
-syn keyword cConstant TotalSmbScaledEnum
-syn keyword cConstant P0Enum
-syn keyword cConstant P0ArrayEnum
-syn keyword cConstant P1Enum
-syn keyword cConstant P1DGEnum
-syn keyword cConstant P1bubbleEnum
-syn keyword cConstant P1bubblecondensedEnum
-syn keyword cConstant P2Enum
-syn keyword cConstant P2bubbleEnum
-syn keyword cConstant P2bubblecondensedEnum
-syn keyword cConstant P2xP1Enum
-syn keyword cConstant P1xP2Enum
-syn keyword cConstant P1xP3Enum
-syn keyword cConstant P1xP4Enum
-syn keyword cConstant P2xP4Enum
-syn keyword cConstant P1P1Enum
-syn keyword cConstant P1P1GLSEnum
-syn keyword cConstant MINIEnum
-syn keyword cConstant MINIcondensedEnum
-syn keyword cConstant TaylorHoodEnum
-syn keyword cConstant LATaylorHoodEnum
-syn keyword cConstant XTaylorHoodEnum
-syn keyword cConstant OneLayerP4zEnum
-syn keyword cConstant CrouzeixRaviartEnum
-syn keyword cConstant LACrouzeixRaviartEnum
-syn keyword cConstant ClosedEnum
-syn keyword cConstant FreeEnum
-syn keyword cConstant OpenEnum
-syn keyword cConstant AirEnum
-syn keyword cConstant IceEnum
-syn keyword cConstant MelangeEnum
-syn keyword cConstant WaterEnum
-syn keyword cConstant DataSetEnum
-syn keyword cConstant ConstraintsEnum
-syn keyword cConstant LoadsEnum
-syn keyword cConstant MaterialsEnum
-syn keyword cConstant NodesEnum
-syn keyword cConstant ContoursEnum
-syn keyword cConstant ParametersEnum
-syn keyword cConstant VerticesEnum
-syn keyword cConstant ResultsEnum
-"ISSM's Enums end
+"ISSM special syntax                                                                                             "
+let enumfile=$ISSM_DIR."/src/c/shared/Enum/Enum.vim"
+if filereadable(enumfile)
+   exec 'source ' . enumfile
+endif
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 
Index: /issm/trunk/externalpackages/vim/addons/vimrc
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vimrc	(revision 24312)
+++ /issm/trunk/externalpackages/vim/addons/vimrc	(revision 24313)
@@ -160,7 +160,7 @@
 " TEX special{{{
 " ----------------------------------------------------------------------
-au BufRead,BufNewFile *.tex,*.html set textwidth=100     "100 caracters max (See gq command)
-au BufRead,BufNewFile *.tex,*.html set formatoptions=cqt "automatic wraping
-au BufRead,BufNewFile *.tex,*.html set wrapmargin=0      "no margin
+au BufRead,BufNewFile *.tex,*.html,*.txt set textwidth=100     "100 caracters max (See gq command)
+au BufRead,BufNewFile *.tex,*.html,*.txt set formatoptions=cqt "automatic wraping
+au BufRead,BufNewFile *.tex,*.html,*.txt set wrapmargin=0      "no margin
 au BufRead,BufNewFile *.cls setfiletype tex
 
@@ -215,5 +215,5 @@
 au BufRead,BufNewFile *.m      iabbr <silent> ER  error('');<Left><Left><Left><C-R>=Eatchar('\s')<CR>
 au BufRead,BufNewFile *.c*     ab VV VecView(ug,PETSC_VIEWER_STDOUT_WORLD);
-au BufRead,BufNewFile *.c*,*.h ab AS _assert_();
+au BufRead,BufNewFile *.c*,*.h ab AS _assert_();<Left><Left><C-R>=Eatchar('\s')<CR>
 au BufRead,BufNewFile *.c*,*.h iab <expr> p0  "printf(\"-------------- file: ".expand('%')." line: %i\\n\",__LINE__);"
 au BufRead,BufNewFile *.c*,*.h iab <expr> pp0 "PetscSynchronizedPrintf(MPI_COMM_WORLD,\"-------------- file: ".expand('%')." line: %i\\n\",__LINE__);\nPetscSynchronizedFlush(MPI_COMM_WORLD);"
Index: /issm/trunk/externalpackages/vim/install.sh
===================================================================
--- /issm/trunk/externalpackages/vim/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/vim/install.sh	(revision 24313)
@@ -8,5 +8,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/vim-7.2.tar.bz2' 'vim-7.2.tar.bz2'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/vim-7.2.tar.bz2' 'vim-7.2.tar.bz2'
 
 #Untar 
Index: /issm/trunk/externalpackages/windows/install.sh
===================================================================
--- /issm/trunk/externalpackages/windows/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/windows/install.sh	(revision 24313)
@@ -3,3 +3,3 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/win7.sdk7.1.exe' 'win7.sdk7.1.exe'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/win7.sdk7.1.exe' 'win7.sdk7.1.exe'
Index: /issm/trunk/externalpackages/xerces/install.sh
===================================================================
--- /issm/trunk/externalpackages/xerces/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/xerces/install.sh	(revision 24313)
@@ -7,5 +7,5 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/xerces-c-src_2_8_0.tar.gz' 'xerces-c-src_2_8_0.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/xerces-c-src_2_8_0.tar.gz' 'xerces-c-src_2_8_0.tar.gz'
 
 #Untar 
Index: /issm/trunk/externalpackages/yams/install.sh
===================================================================
--- /issm/trunk/externalpackages/yams/install.sh	(revision 24312)
+++ /issm/trunk/externalpackages/yams/install.sh	(revision 24313)
@@ -6,7 +6,7 @@
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/yams2-linux.gz' 'yams2-linux.gz'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/yams2-osx.gz' 'yams2-osx.gz'
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'http://issm.jpl.nasa.gov/files/externalpackages/yams2-win.exe' 'yams2-win.exe'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/yams2-linux.gz' 'yams2-linux.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/yams2-osx.gz' 'yams2-osx.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/yams2-win.exe' 'yams2-win.exe'
 
 #loop over the binaries
Index: /issm/trunk/jenkins/jenkins.sh
===================================================================
--- /issm/trunk/jenkins/jenkins.sh	(revision 24312)
+++ /issm/trunk/jenkins/jenkins.sh	(revision 24313)
@@ -1,5 +1,15 @@
 #!/bin/bash
-#This bash script calls the nightlyrun.m matlab file to run our nightly test decks. 
-#It then processes the results and sends an email to the Ice developpers.
+################################################################################
+# This bash script manages installation of ISSM on a given Jenkins node using a
+# configuration file passed as the only argument. This file also contains
+# details about which nightly run tests should be executed after the build has
+# been completed. Finally, results of the build and tests are emailed to the
+# members of the ISSM development team.
+#
+# TODO:
+# - Rename TEMP to something more descriptive (ensure first that other parts of
+#	the build system do not rely on this name)
+# - Investigate refactoring parsing of list of changed files
+################################################################################
 
 echo "Cleaning up execution directory"
@@ -9,6 +19,5 @@
 
 #Server URI
-SERVER='https://ross.ics.uci.edu:8080'
-#SERVER='http://ross.ics.uci.edu:8080'
+SERVER='https://ross.ics.uci.edu/jenkins'
 
 #Get configuration
@@ -24,5 +33,5 @@
 	echo "File $1 not found!" >&2   # Error message to stderr.
 	exit 1
-fi 
+fi
 
 #Defaults (to avoid -eq: unary operator expected)
@@ -37,5 +46,5 @@
 #Get Operating system (OS) name{{{
 OS=$(uname -s)
-if [[ $OS == CYGWIN* ]]; then 
+if [[ $OS == CYGWIN* ]]; then
 	OS="win";
 fi
@@ -54,16 +63,20 @@
 	echo "Current  revision number: $SVN_CURRENT"
 
-	#Get changes from jenkins itself (svn requires credentials)
+	# Get list of changed files
+	#
+
 	#svn --non-interactive --no-auth-cache --trust-server-cert diff -r $SVN_PREVIOUS:$SVN_CURRENT --summarize $ISSM_DIR | awk '{print $NF}' > $ISSM_DIR/TEMP
+
+	# Get list of changes from Jenkins itself as svn requires credentials
 	rm -rf changes
 	wget $SERVER/job/$JOB_NAME/$BUILD_NUMBER/changes > /dev/null 2>&1
 
-	#Process html page and get the list of files that has changed (tricky...)
+	# Process html page and get the list of files that has changed (tricky...)
 	#cat changes | grep '="The file was modified"' | sed -e 's/.*<\/td><td><a>\(.*\)<\/a><\/td><td>.*/\1/' > $ISSM_DIR/TEMP
 	#cat changes | grep 'document_edit' |sed -e 's/document_edit.png/document_edit.png\
 		#/g' | sed -e 's/.*<\/a><\/td><td>\(.*\)<\/td><\/tr>.*/\1/' | grep -v 'document_edit.png' > $ISSM_DIR/TEMP
-	cat changes  | tr " " "\n" | grep trunk |  sed -e 's/.*<a>\(.*\)<\/a>.*/\1/' > $ISSM_DIR/TEMP
-
-	#Print list of files
+	cat changes  | tr " " "\n" | grep trunk | sed -e 's/.*<a>\(.*\)<\/a>.*/\1/' > $ISSM_DIR/TEMP
+
+	# Print list of changed files
 	echo "   "
 	echo "List of updated files"
@@ -71,6 +84,11 @@
 	echo "   "
 
-	#Do we need to reinstall externalpackages?
+	###################################
+	### Determine installation type ###
+	###################################
 	echo "Determining installation type"
+
+	# If the contents of the externalpackages directory were modified in any
+	# way, check for changed external packages
 	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep externalpackages)" ] ; then
 		echo "  -- checking for changed externalpackages... yes";
@@ -81,7 +99,8 @@
 	fi
 
-	#Do we need to reconfigure
+	# If the Makefile or m4 diirectory were changed in any way or if certain
+	# binary files from a previous compilation do not exist, reconfigure
 	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep -e "Makefile.am" -e "m4" )" ] ||
-		[ ! -f "$ISSM_DIR/bin/issm.exe" ] ||
+		[ ! -f "$ISSM_DIR/bin/issm.exe" ] && [ ! -f "$ISSM_DIR/bin/issm-bin.js" ] ||
 		[ "$ISSM_EXTERNALPACKAGES" == "yes" ] ;
 	then
@@ -93,5 +112,5 @@
 	fi
 
-	#Do we need to recompile
+	# If source files were changed in any way, recompile
 	if [ ! -z "$(cat $ISSM_DIR/TEMP | grep -e "\.cpp" -e "\.h" )" ] ||
 		[ "$ISSM_RECONFIGURE" == "yes" ] ;
@@ -103,7 +122,8 @@
 		ISSM_COMPILATION="no"
 	fi
-	#ISSM_COMPILATION="yes"
-	rm $ISSM_DIR/changes
-
+
+	# Cleanup
+	rm changes
+	rm $ISSM_DIR/TEMP
 else
 	echo "Previous revision not found, this must be a fresh install"
@@ -115,4 +135,5 @@
 	ISSM_COMPILATION="yes"
 fi
+
 echo " "
 echo "Recording current svn version: $SVN_REVISION_1"
@@ -121,5 +142,5 @@
 #Install external packages    (ISSM_EXTERNALPACKAGES){{{
 
-#number of packages: 
+#number of packages:
 NUMPACKAGES=$(($(echo $EXTERNALPACKAGES | wc -w )/2))
 
@@ -149,5 +170,5 @@
 
 	#install if requested or if previous install has not been successful
-	if [ "$ISSM_EXTERNALPACKAGES" == "yes" ] || [ ! -d ./install -a ! -d ./install-javascript ] || ([ -d ./install ] && [ ! "$(ls -A ./install)" ]) || ([ -d ./install-javascript ] && [ ! "$(ls -A ./install-javascript)" ]); then
+	if [ "$ISSM_EXTERNALPACKAGES" == "yes" ] || [[ ! -d ./install && ! -d ./install-javascript ]]; then
 		echo "======================================================";
 		echo "       Installing $PACKAGENAME                        ";
@@ -190,5 +211,5 @@
 fi
 
-# Source here to include any newly installed externalpackages on the path. 
+# Source here to include any newly installed externalpackages on the path.
 source $ISSM_DIR/etc/environment.sh
 
@@ -220,10 +241,10 @@
 		make distclean
 		./scripts/automakererun.sh
-		if [ $? -ne 0 ]; then 
+		if [ $? -ne 0 ]; then
 			echo "autoreconf failed!"
 			exit 1
 		fi
 		eval "./configure $ISSM_CONFIG"
-		if [ $? -ne 0 ]; then 
+		if [ $? -ne 0 ]; then
 			echo "ISSM configuration failed (see options below)"
 			echo $ISSM_CONFIG
@@ -243,5 +264,5 @@
 		make
 	fi
-	if [ $? -ne 0 ] && [ $NUMCPUS_INSTALL -gt 1 ]; then 
+	if [ $? -ne 0 ] && [ $NUMCPUS_INSTALL -gt 1 ]; then
 		echo " "
 		echo "Compilation failed, trying to compile with only one thread"
@@ -249,5 +270,5 @@
 		make
 	fi
-	if [ $? -ne 0 ]; then 
+	if [ $? -ne 0 ]; then
 		echo "ISSM_COMPILATION failed!"
 		exit 1
@@ -263,5 +284,5 @@
 #}}}
 
-#Restore CXX/CC to their previous values 
+#Restore CXX/CC to their previous values
 export CXX=$CXX_PREVIOUS
 export CC=$CC_PREVIOUS
@@ -294,4 +315,5 @@
 	end
 	disp('MATLABEXITEDCORRECTLY');
+
 	exit
 EOF
@@ -344,5 +366,5 @@
 done
 
-#filter out windows characters: 
+#filter out windows characters:
 cat matlab_log.log | tr -cd '\11\12\40-\176' > matlab_log.log2 && mv matlab_log.log2 matlab_log.log
 fi
@@ -352,34 +374,38 @@
 # {{{
 if [ $PYTHON_TEST -eq 1 ]; then
-#Launch all tests on different cpus
-export PYTHONSTARTUP=$ISSM_DIR/src/m/dev/devpath.py
-export PYTHONUNBUFFERED=1 #we don't want python to buffer otherwise issm.exe output is not captured
-for (( i=1;i<=$NUMCPUS_RUN;i++ ))
-do
-	cd $ISSM_DIR/test/NightlyRun
-	echo "--------------Running Python test for Rank $i---------------------"
-	./runme.py --output=nightly --rank=$i --numprocs=$NUMCPUS_RUN $PYTHON_NROPTIONS &> $ISSM_DIR/nightlylog/python_log$i.log &
-	echo "--------------Running Python test for Rank $i---------------------"
-done
-
-# concatenate reports
-cd $ISSM_DIR/nightlylog/
-if [ -f python_log.log ]; then
-	rm python_log.log
-fi
-
-for job in `jobs -p`
-do
-echo "Waiting on: $job"
-    wait $job
-done
-
-for (( i=1;i<=$NUMCPUS_RUN;i++ ))
-do
-	echo "This is the concatenation phase for rank: python_log$i.log"
-	cat python_log$i.log >> python_log.log
-done
+	#Launch all tests on different cpus
+	export PYTHONPATH="$ISSM_DIR/src/m/dev"
+	export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
+	export PYTHONUNBUFFERED=1 #we don't want python to buffer otherwise issm.exe output is not captured
+	for (( i=1;i<=$NUMCPUS_RUN;i++ ))
+	do
+		cd $ISSM_DIR/test/NightlyRun
+		echo "--------------Running Python test for Rank $i---------------------"
+		./runme.py --output=nightly --rank=$i --numprocs=$NUMCPUS_RUN $PYTHON_NROPTIONS &> $ISSM_DIR/nightlylog/python_log$i.log &
+		echo "--------------Running Python test for Rank $i---------------------"
+	done
+
+	# concatenate reports
+	cd $ISSM_DIR/nightlylog/
+	if [ -f python_log.log ]; then
+		rm python_log.log
+	fi
+
+	for job in `jobs -p`
+	do
+	echo "Waiting on: $job"
+	    wait $job
+	done
+
+	for (( i=1;i<=$NUMCPUS_RUN;i++ ))
+	do
+		echo "This is the concatenation phase for rank: python_log$i.log"
+		cat python_log$i.log >> python_log.log
+	done
 fi
 # }}}
+
+# Clean up ADOL-C tape files
+rm -f $ISSM_DIR/execution/*/ADOLC-*
 
 # Examples Test
@@ -413,25 +439,25 @@
 				$SED -i.bak 's/steps=\[1\];/steps=\[1:8\];\n\ntry\n/' $FILE
 				$SED -i.bak "s/if any(steps==8)/&${STEP_EIGHT}/" $FILE
-			elif [ "${dir}" == "./IceBridge" ];	
+			elif [ "${dir}" == "./IceBridge" ];
 			then
 				$SED -i.bak 's/steps=\[1\];/steps=\[1:5\];\n\ntry\n/' $FILE
-			elif [ "${dir}" == "./IceflowModels" ];	
+			elif [ "${dir}" == "./IceflowModels" ];
 			then
 				# Almost nothing to this example
 				$SED -i.bak '1 s/^.*$/try\n\n&/' $FILE
-			elif [ "${dir}" == "./ISMIP" ];	
+			elif [ "${dir}" == "./ISMIP" ];
 			then
 				# Eight steps... none of which are implmented in the script...
 				$SED -i.bak '1 s/^.*$/try\n\n&/' $FILE
-			elif [ "${dir}" == "./Inversion" ];	
+			elif [ "${dir}" == "./Inversion" ];
 			then
 				$SED -i.bak 's/steps=\[1\];/steps=\[1:4\];\n\ntry\n/' $FILE
-			elif [ "${dir}" == "./Jakobshavn" ];	
+			elif [ "${dir}" == "./Jakobshavn" ];
 			then
 				$SED -i.bak 's/steps=\[1\];/steps=\[1:4\];\n\ntry\n/' $FILE
-			elif [ "${dir}" == "./Jakobshavn" ];	
+			elif [ "${dir}" == "./Jakobshavn" ];
 			then
 				$SED -i.bak 's/steps=\[1\];/steps=\[1:4\];\n\ntry\n/' $FILE
-			elif [ "${dir}" == "./Pig" ];	
+			elif [ "${dir}" == "./Pig" ];
 			then
 				# Step 6 is needed
@@ -439,5 +465,5 @@
 				$SED -i.bak 's/steps=\[1\];/steps=\[1:7\];\n!mv DomainOutline.bkp DomainOutline.exp;\n\ntry\n/' $FILE
 				$SED -i.bak "s/if any(steps==6)/&${STEP_SIX}/" $FILE
-			elif [ "${dir}" == "./PigSensitivity" ];	
+			elif [ "${dir}" == "./PigSensitivity" ];
 			then
 				# Step 4 is needed
@@ -445,12 +471,12 @@
 				$SED -i.bak 's/steps=\[1\];/steps=\[1:4\];\n\ntry\n/' $FILE
 				$SED -i.bak "s/if any(steps==6)/&${STEP_FOUR}/" $FILE
-			elif [ "${dir}" == "./SquareIceShelf" ];	
+			elif [ "${dir}" == "./SquareIceShelf" ];
 			then
 				# Almost nothing to this example
 				$SED -i.bak '1 s/^.*$/try\n\n&/' $FILE
-			elif [ "${dir}" == "./UncertaintyQuantification" ];	
+			elif [ "${dir}" == "./UncertaintyQuantification" ];
 			then
 				$SED -i.bak 's/steps=\[1\];/steps=\[1:7\];\n\ntry\n/' $FILE
-			elif [ "${dir}" == "./Data" ];	
+			elif [ "${dir}" == "./Data" ];
 			then
 				echo "Data directory is used by examples. No modifications required."
@@ -501,4 +527,5 @@
 	done
 fi
+
 if [ $PYTHON_TEST -eq 1 ]; then
 	#number tests:
@@ -512,5 +539,24 @@
 		juLog  -test=PYTHON-$i -name=Failure -error=FAILURE awk "/starting:$i/{flag=1;next}/finished/{flag=0} flag{print}" python_log.log
 	done
-fi
+
+	# Check that Python did not exit in error
+	pythonExitedInError=`grep -E "Traceback|bad interpreter" python_log.log | wc -l`
+
+	if [ $pythonExitedInError -ne 0 ]
+	then
+		echo "----------Python exited in error!----------"
+		cat python_log.log
+		echo "-----------End of python_log.log-----------"
+
+		# Clean up execution directory
+		rm -rf $ISSM_DIR/execution/*
+
+		exit 1
+	fi
+
+	# Python tests must have run and exited successfully (unless we have missed something)
+	echo "PYTHONEXITEDCORRECTLY"
+fi
+
 if [ $EXAMPLES_TEST -eq 1 ];
 then
@@ -527,3 +573,6 @@
 	done
 fi
+
+# Clean up execution directory
+rm -rf $ISSM_DIR/execution/*
 #}}}
Index: /issm/trunk/jenkins/linux64_ross
===================================================================
--- /issm/trunk/jenkins/linux64_ross	(revision 24312)
+++ /issm/trunk/jenkins/linux64_ross	(revision 24313)
@@ -11,17 +11,16 @@
 	--disable-static \
 	--with-matlab-dir=$MATLAB_PATH \
-	--with-python-dir=/usr \
-	--with-python-numpy-dir=/var/lib/jenkins/.local/lib/python2.7/site-packages/numpy \
-	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+	--with-fortran-lib="-L/usr/lib/gcc/x86_64-linux-gnu/4.9 -lgfortran" \
 	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
 	--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib -lmpi" \
+	--with-metis-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
 	--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
-	--with-metis-dir=$ISSM_DIR/externalpackages/petsc/install \
-	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
-	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install \
-	--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
 	--with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
-	--with-fortran-lib="-L/usr/lib/gcc/x86_64-linux-gnu/4.9 -lgfortran" \
 	--with-m1qn3-dir=$ISSM_DIR/externalpackages/m1qn3/install \
+	--with-semic-dir=$ISSM_DIR/externalpackages/semic/install \
 	--with-numthreads=4 \
 	--enable-development \
@@ -30,5 +29,5 @@
 #PYTHON and MATLAB testing
 MATLAB_TEST=1
-PYTHON_TEST=1
+PYTHON_TEST=0
 
 #-----------------------------------#
@@ -46,4 +45,5 @@
 						hdf5          install.sh
 						netcdf        install.sh
+						semic         install.sh
 						shell2junit   install.sh"
 
@@ -63,4 +63,4 @@
 #by Matlab and runme.m
 #ex: "'id',[101 102 103]"
-PYTHON_NROPTIONS="--exclude_name 'Dakota'"
+PYTHON_NROPTIONS=""
 MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota')]"
Index: /issm/trunk/jenkins/linux64_ross_ad
===================================================================
--- /issm/trunk/jenkins/linux64_ross_ad	(revision 24312)
+++ /issm/trunk/jenkins/linux64_ross_ad	(revision 24313)
@@ -8,5 +8,5 @@
 
 #ISSM CONFIGURATION
-ISSM_CONFIG='--prefix=$ISSM_DIR\
+ISSM_CONFIG='--prefix=$ISSM_DIR \
 				--disable-static \
 				--without-kriging \
@@ -14,13 +14,20 @@
 				--without-GiaIvins \
 				--without-Love \
+				--with-matlab-dir=$MATLAB_PATH \
+				--with-python-dir=/usr \
+				--with-python-numpy-dir=/usr/local/lib/python2.7/dist-packages/numpy \
+				--with-fortran-lib="-L/usr/lib/gcc/x86_64-linux-gnu/4.9 -lgfortran" \
+				--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
+				--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib -lmpi -lmpicxx -lmpifort" \
+				--with-metis-dir=$ISSM_DIR/externalpackages/petsc/install \
+				--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+				--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+				--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
+				--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
 				--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
 				--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install \
-				--with-matlab-dir=$MATLAB_PATH \
-				--with-python-dir=/usr \
-				--with-python-numpy-dir=/var/lib/jenkins/.local/lib/python2.7/site-packages/numpy \
-				--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
-				--with-fortran-lib="-L/usr/lib/gcc/x86_64-linux-gnu/4.9/ -lgfortran" \
+				--with-numthreads=4 \
 				--enable-development \
-				--enable-debugging '
+				--enable-debugging'
 
 #PYTHON and MATLAB testing
@@ -33,4 +40,8 @@
 
 #List of external pakages to be installed and their installation scripts
+#
+# NOTE: The PETSc libraries are compiled but not used as they conflict with
+#		ADOL-C: PETSc is really just being used as an installer for other
+#		external packages.
 EXTERNALPACKAGES="autotools install.sh
 					 cmake install.sh
@@ -46,15 +57,22 @@
 #-----------------#
 
-#number of cpus used in ISSM installation and compilation (one is usually
-#safer as some packages are very sensitive to parallel compilation)
+# Number of CPUs used in ISSM compilation
+#
+# NOTE: One is usually safer as some packages are very sensitive to parallel
+# 		compilation.
+#
 NUMCPUS_INSTALL=5
 
-#number of cpus used in the nightly runs.
+# Number of CPUs used in the nightly runs
 NUMCPUS_RUN=4
 
-#Nightly run options. The matlab routine runme.m will be called
-#as follows: runme($MATLAB_NROPTIONS). The options must be understandable
-#by Matlab and runme.m
-#ex: "'id',[101 102 103]"
-MATLAB_NROPTIONS="'benchmark','adolc','id',[3001:3019]"
-PYTHON_NROPTIONS="--benchmark=adolc -i 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019"
+# Nightly run options
+#
+# See documentation in test/NightlyRun/runme.* for more information.
+#
+# NOTE:
+# - test3010 is skipped because it triggers GEMB module and a subsequent
+#	failure on ampioff configuration (really, likely a segmentation fault)
+#
+MATLAB_NROPTIONS="'benchmark','adolc','id',[3001:3019],'exclude',3010"
+PYTHON_NROPTIONS="--benchmark=adolc -i 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 --exclude=3010"
Index: /issm/trunk/jenkins/linux64_ross_ampi
===================================================================
--- /issm/trunk/jenkins/linux64_ross_ampi	(revision 24312)
+++ /issm/trunk/jenkins/linux64_ross_ampi	(revision 24313)
@@ -8,26 +8,27 @@
 
 #ISSM CONFIGURATION
-ISSM_CONFIG='--prefix=$ISSM_DIR\
+ISSM_CONFIG='--prefix=$ISSM_DIR \
 				--disable-static \
 				--without-kriging \
 				--without-kml \
 				--without-GiaIvins \
+				--without-Love \
+				--with-matlab-dir=$MATLAB_PATH \
+				--with-python-dir=/usr \
+				--with-python-numpy-dir=/usr/local/lib/python2.7/dist-packages/numpy \
+				--with-fortran-lib="-L/usr/lib/gcc/x86_64-linux-gnu/4.9 -lgfortran" \
+				--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
+				--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib -lmpi -lmpicxx -lmpifort" \
+				--with-ampi-dir=$ISSM_DIR/externalpackages/adjoinablempi/install \
+				--with-metis-dir=$ISSM_DIR/externalpackages/petsc/install \
+				--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+				--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+				--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
+				--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
 				--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
 				--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install \
-				--with-ampi-dir=$ISSM_DIR/externalpackages/adjoinablempi/install \
-				--with-matlab-dir=$MATLAB_PATH \
-				--with-python-dir=/usr \
-				--with-python-numpy-dir=/var/lib/jenkins/.local/lib/python2.7/site-packages/numpy \
-				--with-metis-dir=$ISSM_DIR/externalpackages/petsc/install \
-				--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
-				--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib -lmpifort -lmpi" \
-				--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
-				--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
-				--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
-				--with-numthreads=4  \
-				--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
-				--with-fortran-lib="-L/usr/lib/gcc/x86_64-linux-gnu/4.9/ -lgfortran" \
+				--with-numthreads=4 \
 				--enable-development \
-				--enable-debugging '
+				--enable-debugging'
 
 #PYTHON and MATLAB testing
@@ -40,4 +41,8 @@
 
 #List of external pakages to be installed and their installation scripts
+#
+# NOTE: The PETSc libraries are compiled but not used as they conflict with
+#		ADOL-C: PETSc is really just being used as an installer for other
+#		external packages.
 EXTERNALPACKAGES="autotools install.sh
 					 cmake install.sh
@@ -54,15 +59,22 @@
 #-----------------#
 
-#number of cpus used in ISSM installation and compilation (one is usually
-#safer as some packages are very sensitive to parallel compilation)
+# Number of CPUs used in ISSM compilation
+#
+# NOTE: One is usually safer as some packages are very sensitive to parallel
+# 		compilation.
+#
 NUMCPUS_INSTALL=5
 
-#number of cpus used in the nightly runs.
-NUMCPUS_RUN=3
+# Number of CPUs used in the nightly runs
+NUMCPUS_RUN=4
 
-#Nightly run options. The matlab routine runme.m will be called
-#as follows: runme($MATLAB_NROPTIONS). The options must be understandable
-#by Matlab and runme.m
-#ex: "'id',[101 102 103]"
-MATLAB_NROPTIONS="'benchmark','adolc','id',[3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3101, 3102, 3103, 3104, 3105, 3106, 3107, 3108, 3109, 3119]"
-PYTHON_NROPTIONS="--benchmark='adolc' -i 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3101 3102 3103 3104 3105 3106 3107 3108 3109 3119"
+# Nightly run options
+#
+# See documentation in test/NightlyRun/runme.* for more information.
+#
+# NOTE:
+# - test3010 is skipped because it triggers GEMB module and a subsequent
+#	failure on ampioff configuration (really, likely a segmentation fault)
+#
+MATLAB_NROPTIONS="'benchmark','adolc','id',[3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3101, 3102, 3103, 3104, 3105, 3106, 3107, 3108, 3109, 3119],'exclude',3010"
+PYTHON_NROPTIONS="--benchmark=adolc -i 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3101 3102 3103 3104 3105 3106 3107 3108 3109 3119 --exclude=3010"
Index: /issm/trunk/jenkins/linux64_ross_codi
===================================================================
--- /issm/trunk/jenkins/linux64_ross_codi	(revision 24312)
+++ /issm/trunk/jenkins/linux64_ross_codi	(revision 24313)
@@ -26,7 +26,6 @@
 				--with-m1qn3-dir="$ISSM_DIR/externalpackages/m1qn3/install" \
 				--with-codipack-dir="$ISSM_DIR/externalpackages/codipack/install" \
+				--with-medipack-dir="$ISSM_DIR/externalpackages/medipack/install" \
 				--enable-tape-alloc \
-				--with-cxxoptflags="-DAD_TYPE=codi::RealReverse" \
-				--with-adjointmpi-dir="$ISSM_DIR/externalpackages/adjointmpi/install" \
 				--enable-development \
 				--enable-debugging '
@@ -48,5 +47,5 @@
                   gsl         install-linux64.sh
                   m1qn3       install.sh
-                  adjointmpi  install.sh
+                  medipack    install.sh
                   codipack    install.sh
                   shell2junit install.sh"
Index: /issm/trunk/jenkins/linux64_ross_dakota
===================================================================
--- /issm/trunk/jenkins/linux64_ross_dakota	(revision 24312)
+++ /issm/trunk/jenkins/linux64_ross_dakota	(revision 24313)
@@ -12,5 +12,5 @@
 	--with-matlab-dir=$MATLAB_PATH \
 	--with-python-dir=/usr \
-	--with-python-numpy-dir=/home/jenkins/.local/lib/python2.7/site-packages/numpy \
+	--with-python-numpy-dir=/usr/local/lib/python2.7/dist-packages/numpy \
 	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
 	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
@@ -25,4 +25,5 @@
 	--with-boost-dir=$ISSM_DIR/externalpackages/boost/install \
 	--with-fortran-lib="-L/usr/lib/gcc/x86_64-linux-gnu/4.9 -lgfortran" \
+	--with-cxxoptflags="-std=c++11" \
 	--with-m1qn3-dir=$ISSM_DIR/externalpackages/m1qn3/install \
 	--with-numthreads=4 \
@@ -66,3 +67,3 @@
 #ex: "'id',[101 102 103]"
 PYTHON_NROPTIONS="--exclude 243 701 702 435 --include_name 'Dakota'"
-MATLAB_NROPTIONS="'exclude',[243,701,702,435]"
+MATLAB_NROPTIONS="'exclude',[243,701,702,435],'id',[IdFromString('Dakota')]"
Index: /issm/trunk/jenkins/linux64_ross_iceocean
===================================================================
--- /issm/trunk/jenkins/linux64_ross_iceocean	(revision 24312)
+++ /issm/trunk/jenkins/linux64_ross_iceocean	(revision 24313)
@@ -56,4 +56,4 @@
 #by Matlab and runme.m
 #ex: "'id',[101 102 103]"
-MATLAB_NROPTIONS="'benchmark','all','id',[4001 4002]"
+MATLAB_NROPTIONS="'benchmark','all','id',[4001 4002 4003]"
 PYTHON_NROPTIONS=""
Index: /issm/trunk/jenkins/linux64_ross_javascript
===================================================================
--- /issm/trunk/jenkins/linux64_ross_javascript	(revision 24312)
+++ /issm/trunk/jenkins/linux64_ross_javascript	(revision 24313)
@@ -5,15 +5,14 @@
 
 #ISSM CONFIGURATION
-ISSM_CONFIG='--prefix="$ISSM_DIR" \
+ISSM_CONFIG='\
+    --prefix="${ISSM_DIR}" \
     --disable-shared \
     --with-javascript \
-    --with-triangle-dir="$ISSM_DIR/externalpackages/triangle/install-javascript" \
-    --with-gsl-dir="$ISSM_DIR/externalpackages/gsl/install-javascript" \
     --without-Love \
     --without-kml \
     --without-kriging \
-    --with-cxxoptflags="-O2" \
-    CXXFLAGS="-O2" \
-    CFLAGS="-O2"'
+    --with-triangle-dir="${ISSM_DIR}/externalpackages/triangle/install-javascript" \
+    --with-gsl-dir="$ISSM_DIR/externalpackages/gsl/install-javascript"\
+'
 
 #PYTHON and MATLAB testing
@@ -21,4 +20,8 @@
 PYTHON_TEST=0
 JAVASCRIPT_TEST=1
+
+# Environment
+#export EMCC_DEBUG=1 # Uncomment to enable debugging
+export EMCC_CFLAGS="-s ERROR_ON_UNDEFINED_SYMBOLS=0" # Required after v1.38.14
 
 #-----------------------------------#
Index: /issm/trunk/jenkins/linux64_ross_python
===================================================================
--- /issm/trunk/jenkins/linux64_ross_python	(revision 24312)
+++ /issm/trunk/jenkins/linux64_ross_python	(revision 24313)
@@ -4,23 +4,19 @@
 #-------------------------------#
 
-#MATLAB path
-MATLAB_PATH="/usr/local/MATLAB/R2015a"
-
 #ISSM CONFIGURATION
 ISSM_CONFIG='--prefix=$ISSM_DIR \
 	--disable-static \
-	--with-matlab-dir=$MATLAB_PATH \
 	--with-python-dir=/usr \
-	--with-python-numpy-dir=/home/jenkins/.local/lib/python2.7/site-packages/numpy \
-	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+	--with-python-numpy-dir=/usr/local/lib/python2.7/dist-packages/numpy \
+	--with-fortran-lib="-L/usr/lib/gcc/x86_64-linux-gnu/4.9 -lgfortran" \
 	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
 	--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib -lmpi -lmpicxx -lmpifort" \
+	--with-metis-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
 	--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
-	--with-metis-dir=$ISSM_DIR/externalpackages/petsc/install \
-	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
-	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install \
-	--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
 	--with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
-	--with-fortran-lib="-L/usr/lib/gcc/x86_64-linux-gnu/4.9 -lgfortran" \
 	--with-m1qn3-dir=$ISSM_DIR/externalpackages/m1qn3/install \
 	--with-numthreads=4 \
@@ -37,6 +33,7 @@
 
 #List of external packages to be installed and their installation scripts
-EXTERNALPACKAGES="mpich         install-3.2-linux64.sh
+EXTERNALPACKAGES="autotools     install.sh
 						cmake         install.sh
+						mpich         install-3.2-linux64.sh
 						petsc         install-3.7-linux64.sh
 						triangle      install-linux64.sh
@@ -51,8 +48,8 @@
 #number of cpus used in ISSM installation and compilation (one is usually
 #safer as some packages are very sensitive to parallel compilation)
-NUMCPUS_INSTALL=5
+NUMCPUS_INSTALL=10
 
 #number of cpus used in the nightly runs.
-NUMCPUS_RUN=3
+NUMCPUS_RUN=5
 
 #Nightly run options. The matlab routine runme.m will be called
@@ -61,3 +58,3 @@
 #ex: "'id',[101 102 103]"
 PYTHON_NROPTIONS="--exclude_name 'Dakota'"
-MATLAB_NROPTIONS="'exclude',[IdFromString('Dakota')]"
+MATLAB_NROPTIONS=""
Index: /issm/trunk/jenkins/linux64_ross_se
===================================================================
--- /issm/trunk/jenkins/linux64_ross_se	(revision 24312)
+++ /issm/trunk/jenkins/linux64_ross_se	(revision 24313)
@@ -12,5 +12,5 @@
 	--with-matlab-dir=$MATLAB_PATH \
 	--with-python-dir=/usr \
-	--with-python-numpy-dir=/var/lib/jenkins/.local/lib/python2.7/site-packages/numpy \
+	--with-python-numpy-dir=/usr/local/lib/python2.7/dist-packages/numpy \
 	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
 	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
Index: /issm/trunk/jenkins/macosx_pine-island
===================================================================
--- /issm/trunk/jenkins/macosx_pine-island	(revision 24312)
+++ /issm/trunk/jenkins/macosx_pine-island	(revision 24313)
@@ -18,4 +18,5 @@
 	--with-metis-dir=$ISSM_DIR/externalpackages/petsc/install \
 	--with-m1qn3-dir=$ISSM_DIR/externalpackages/m1qn3/install \
+	--with-semic-dir=$ISSM_DIR/externalpackages/semic/install \
 	--with-numthreads=4 \
 	--enable-debugging \
@@ -34,7 +35,8 @@
 						cmake        install.sh
 						mpich        install-3.2-macosx64.sh
-						m1qn3        install.sh
 						petsc        install-3.7-macosx64.sh
 						triangle     install-macosx64.sh
+						m1qn3        install.sh
+						semic        install.sh
 						shell2junit  install.sh"
 
@@ -43,16 +45,21 @@
 #-----------------#
 
-#number of cpus used in ISSM installation and compilation (one is usually
-#safer as some packages are very sensitive to parallel compilation)
+# Number of CPUs used in ISSM compilation
+#
+# NOTE: One is usually safer as some packages are very sensitive to parallel
+# 		compilation.
+#
 NUMCPUS_INSTALL=4
 
-#number of cpus used in the nightly runs.
+# Number of CPUs used in the nightly runs
 NUMCPUS_RUN=4
 
-#Nightly run options. The matlab routine runme.m will be called
-#as follows: runme($MATLAB_NROPTIONS). The options must be understandable
-#by Matlab and runme.m
-#ex: "'id',[101 102 103]"
-##                           FS
+# Nightly run options
+#
+# See documentation in test/NightlyRun/runme.* for more information.
+#
+# NOTE:
+#	- test701.m is skipped because it uses full Stokes equations
+#
+MATLAB_NROPTIONS="'exclude',[701,702,703,435,IdFromString('Dakota')]"
 PYTHON_NROPTIONS="--exclude_name 'Dakota'"
-MATLAB_NROPTIONS="'exclude',[701,702,703,435,IdFromString('Dakota')]"
Index: /issm/trunk/jenkins/macosx_pine-island_dakota
===================================================================
--- /issm/trunk/jenkins/macosx_pine-island_dakota	(revision 24312)
+++ /issm/trunk/jenkins/macosx_pine-island_dakota	(revision 24313)
@@ -23,4 +23,5 @@
 	--with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
 	--with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
+	--with-cxxoptflags="-std=c++11" \
 	--with-numthreads=4 \
 	--enable-debugging \
@@ -63,3 +64,3 @@
 #ex: "'id',[101 102 103]"  ERRORS ARE LARGE FOR: 418 420
 PYTHON_NROPTIONS="--exclude 119 243 514 701 702 703 234 235 418 420 --include_name 'Dakota'"
-MATLAB_NROPTIONS="'exclude',[119,243,514,701,702,703,234,235,418,420]"
+MATLAB_NROPTIONS="'exclude',[119,243,514,701,702,703,234,235,418,420],'id',[IdFromString('Dakota')]"
Index: /issm/trunk/jenkins/macosx_pine-island_dakota_static
===================================================================
--- /issm/trunk/jenkins/macosx_pine-island_dakota_static	(revision 24312)
+++ /issm/trunk/jenkins/macosx_pine-island_dakota_static	(revision 24313)
@@ -13,5 +13,5 @@
 	--with-matlab-dir=$MATLAB_PATH \
 	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
-	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include \
+	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
 	--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib -lmpi -lpmpi -lmpifort -lmpicxx" \
 	--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
@@ -43,6 +43,6 @@
 						petsc        install-3.7-macosx64-static.sh
 						triangle     install-macosx64.sh
-						boost        install-1.55-macosx-el_capitan-static.sh
-						dakota       install-6.2-macosx64-static.sh
+						boost        install-1.55-macosx-el_capitan.sh
+						dakota       install-6.2-macosx64.sh
 						shell2junit  install.sh"
 
@@ -62,4 +62,5 @@
 #by Matlab and runme.m
 #ex: "'id',[101 102 103]"
-#PYTHON_NROPTIONS=""
-#MATLAB_NROPTIONS=""
+##                           bamg mesh   FS
+#PYTHON_NROPTIONS="--exclude_name 'Dakota'"
+#MATLAB_NROPTIONS="'exclude',[243,701,702,703,435,IdFromString('Dakota')]"
Index: /issm/trunk/jenkins/windows
===================================================================
--- /issm/trunk/jenkins/windows	(revision 24312)
+++ /issm/trunk/jenkins/windows	(revision 24313)
@@ -61,4 +61,4 @@
 
 #In Windows, we don't yet have MUMPS, can't do full stokes, so exclude all FS runs. Also exclude all runs with Dakota. And exclude higher order runs that have penalties. And 800+ tests because we don't want to have --with-development since we do the binaries with this version
-MATLAB_NROPTIONS="'exclude',[104,119, 124,125,126, 204, 211, 215, 220, 221, 285, 290, 308, 322, 404, 421, 422, 503, 507, 510, 511, 513, 701, 702, 703, 218, 234, 235, 250, 251, 412, 413, 414, 417, 418, 420, 440,444, 205, 274, 331, 405, 409, 455, 612, 514, 435, 280, 801, 802, 803, 804, 805, 291, 340, 341, 460, 243, 430, 441, 442, 463, 464, 465, 244]"
-PYTHON_NROPTIONS=""
+MATLAB_NROPTIONS="'exclude',[104,119, 124,125,126, 204, 211, 215, 220, 221, 285, 290, 308, 322, 404, 421, 422, 503, 507, 510, 511, 513, 701, 702, 703, 218, 234, 235, 250, 251, 412, 413, 414, 417, 418, 420, 440,444, 205, 274, 331, 405, 409, 455, 612, 514, 435, 280, 801, 802, 803, 804, 805, 291, 340, 341, 460, 243, 430, 441, 442, 463, 464, 465, 244, IdFromString('Dakota')]"
+PYTHON_NROPTIONS="--exclude_name 'Dakota'"
Index: /issm/trunk/m4/analyses.m4
===================================================================
--- /issm/trunk/m4/analyses.m4	(revision 24312)
+++ /issm/trunk/m4/analyses.m4	(revision 24313)
@@ -11,964 +11,534 @@
 
 dnl with-AdjointBalancethickness2{{{
-
 AC_ARG_WITH([AdjointBalancethickness2],
-
 	AS_HELP_STRING([--with-AdjointBalancethickness2 = YES], [compile with AdjointBalancethickness2 capabilities (default is yes)]),
-
 	[ADJOINTBALANCETHICKNESS2=$withval],[ADJOINTBALANCETHICKNESS2=yes])
-
 AC_MSG_CHECKING(for AdjointBalancethickness2 capability compilation)
 
-
 HAVE_ADJOINTBALANCETHICKNESS2=no 
-
 if test "x$ADJOINTBALANCETHICKNESS2" = "xyes"; then
-
 	HAVE_ADJOINTBALANCETHICKNESS2=yes
-
 	AC_DEFINE([_HAVE_ADJOINTBALANCETHICKNESS2_],[1],[with AdjointBalancethickness2 capability])
-
-fi
-
+fi
 AM_CONDITIONAL([ADJOINTBALANCETHICKNESS2], [test x$HAVE_ADJOINTBALANCETHICKNESS2 = xyes])
-
 AC_MSG_RESULT($HAVE_ADJOINTBALANCETHICKNESS2)
-
 dnl }}}
 dnl with-AdjointBalancethickness{{{
-
 AC_ARG_WITH([AdjointBalancethickness],
-
 	AS_HELP_STRING([--with-AdjointBalancethickness = YES], [compile with AdjointBalancethickness capabilities (default is yes)]),
-
 	[ADJOINTBALANCETHICKNESS=$withval],[ADJOINTBALANCETHICKNESS=yes])
-
 AC_MSG_CHECKING(for AdjointBalancethickness capability compilation)
 
-
 HAVE_ADJOINTBALANCETHICKNESS=no 
-
 if test "x$ADJOINTBALANCETHICKNESS" = "xyes"; then
-
 	HAVE_ADJOINTBALANCETHICKNESS=yes
-
 	AC_DEFINE([_HAVE_ADJOINTBALANCETHICKNESS_],[1],[with AdjointBalancethickness capability])
-
-fi
-
+fi
 AM_CONDITIONAL([ADJOINTBALANCETHICKNESS], [test x$HAVE_ADJOINTBALANCETHICKNESS = xyes])
-
 AC_MSG_RESULT($HAVE_ADJOINTBALANCETHICKNESS)
-
 dnl }}}
 dnl with-AdjointHoriz{{{
-
 AC_ARG_WITH([AdjointHoriz],
-
 	AS_HELP_STRING([--with-AdjointHoriz = YES], [compile with AdjointHoriz capabilities (default is yes)]),
-
 	[ADJOINTHORIZ=$withval],[ADJOINTHORIZ=yes])
-
 AC_MSG_CHECKING(for AdjointHoriz capability compilation)
 
-
 HAVE_ADJOINTHORIZ=no 
-
 if test "x$ADJOINTHORIZ" = "xyes"; then
-
 	HAVE_ADJOINTHORIZ=yes
-
 	AC_DEFINE([_HAVE_ADJOINTHORIZ_],[1],[with AdjointHoriz capability])
-
-fi
-
+fi
 AM_CONDITIONAL([ADJOINTHORIZ], [test x$HAVE_ADJOINTHORIZ = xyes])
-
 AC_MSG_RESULT($HAVE_ADJOINTHORIZ)
-
 dnl }}}
 dnl with-Balancethickness2{{{
-
 AC_ARG_WITH([Balancethickness2],
-
 	AS_HELP_STRING([--with-Balancethickness2 = YES], [compile with Balancethickness2 capabilities (default is yes)]),
-
 	[BALANCETHICKNESS2=$withval],[BALANCETHICKNESS2=yes])
-
 AC_MSG_CHECKING(for Balancethickness2 capability compilation)
 
-
 HAVE_BALANCETHICKNESS2=no 
-
 if test "x$BALANCETHICKNESS2" = "xyes"; then
-
 	HAVE_BALANCETHICKNESS2=yes
-
 	AC_DEFINE([_HAVE_BALANCETHICKNESS2_],[1],[with Balancethickness2 capability])
-
-fi
-
+fi
 AM_CONDITIONAL([BALANCETHICKNESS2], [test x$HAVE_BALANCETHICKNESS2 = xyes])
-
 AC_MSG_RESULT($HAVE_BALANCETHICKNESS2)
-
 dnl }}}
 dnl with-Balancethickness{{{
-
 AC_ARG_WITH([Balancethickness],
-
 	AS_HELP_STRING([--with-Balancethickness = YES], [compile with Balancethickness capabilities (default is yes)]),
-
 	[BALANCETHICKNESS=$withval],[BALANCETHICKNESS=yes])
-
 AC_MSG_CHECKING(for Balancethickness capability compilation)
 
-
 HAVE_BALANCETHICKNESS=no 
-
 if test "x$BALANCETHICKNESS" = "xyes"; then
-
 	HAVE_BALANCETHICKNESS=yes
-
 	AC_DEFINE([_HAVE_BALANCETHICKNESS_],[1],[with Balancethickness capability])
-
-fi
-
+fi
 AM_CONDITIONAL([BALANCETHICKNESS], [test x$HAVE_BALANCETHICKNESS = xyes])
-
 AC_MSG_RESULT($HAVE_BALANCETHICKNESS)
-
 dnl }}}
 dnl with-BalancethicknessSoft{{{
-
 AC_ARG_WITH([BalancethicknessSoft],
-
 	AS_HELP_STRING([--with-BalancethicknessSoft = YES], [compile with BalancethicknessSoft capabilities (default is yes)]),
-
 	[BALANCETHICKNESSSOFT=$withval],[BALANCETHICKNESSSOFT=yes])
-
 AC_MSG_CHECKING(for BalancethicknessSoft capability compilation)
 
-
 HAVE_BALANCETHICKNESSSOFT=no 
-
 if test "x$BALANCETHICKNESSSOFT" = "xyes"; then
-
 	HAVE_BALANCETHICKNESSSOFT=yes
-
 	AC_DEFINE([_HAVE_BALANCETHICKNESSSOFT_],[1],[with BalancethicknessSoft capability])
-
-fi
-
+fi
 AM_CONDITIONAL([BALANCETHICKNESSSOFT], [test x$HAVE_BALANCETHICKNESSSOFT = xyes])
-
 AC_MSG_RESULT($HAVE_BALANCETHICKNESSSOFT)
-
 dnl }}}
 dnl with-Balancevelocity{{{
-
 AC_ARG_WITH([Balancevelocity],
-
 	AS_HELP_STRING([--with-Balancevelocity = YES], [compile with Balancevelocity capabilities (default is yes)]),
-
 	[BALANCEVELOCITY=$withval],[BALANCEVELOCITY=yes])
-
 AC_MSG_CHECKING(for Balancevelocity capability compilation)
 
-
 HAVE_BALANCEVELOCITY=no 
-
 if test "x$BALANCEVELOCITY" = "xyes"; then
-
 	HAVE_BALANCEVELOCITY=yes
-
 	AC_DEFINE([_HAVE_BALANCEVELOCITY_],[1],[with Balancevelocity capability])
-
-fi
-
+fi
 AM_CONDITIONAL([BALANCEVELOCITY], [test x$HAVE_BALANCEVELOCITY = xyes])
-
 AC_MSG_RESULT($HAVE_BALANCEVELOCITY)
-
 dnl }}}
 dnl with-DamageEvolution{{{
-
 AC_ARG_WITH([DamageEvolution],
-
 	AS_HELP_STRING([--with-DamageEvolution = YES], [compile with DamageEvolution capabilities (default is yes)]),
-
 	[DAMAGEEVOLUTION=$withval],[DAMAGEEVOLUTION=yes])
-
 AC_MSG_CHECKING(for DamageEvolution capability compilation)
 
-
 HAVE_DAMAGEEVOLUTION=no 
-
 if test "x$DAMAGEEVOLUTION" = "xyes"; then
-
 	HAVE_DAMAGEEVOLUTION=yes
-
 	AC_DEFINE([_HAVE_DAMAGEEVOLUTION_],[1],[with DamageEvolution capability])
-
-fi
-
+fi
 AM_CONDITIONAL([DAMAGEEVOLUTION], [test x$HAVE_DAMAGEEVOLUTION = xyes])
-
 AC_MSG_RESULT($HAVE_DAMAGEEVOLUTION)
-
 dnl }}}
 dnl with-DepthAverage{{{
-
 AC_ARG_WITH([DepthAverage],
-
 	AS_HELP_STRING([--with-DepthAverage = YES], [compile with DepthAverage capabilities (default is yes)]),
-
 	[DEPTHAVERAGE=$withval],[DEPTHAVERAGE=yes])
-
 AC_MSG_CHECKING(for DepthAverage capability compilation)
 
-
 HAVE_DEPTHAVERAGE=no 
-
 if test "x$DEPTHAVERAGE" = "xyes"; then
-
 	HAVE_DEPTHAVERAGE=yes
-
 	AC_DEFINE([_HAVE_DEPTHAVERAGE_],[1],[with DepthAverage capability])
-
-fi
-
+fi
 AM_CONDITIONAL([DEPTHAVERAGE], [test x$HAVE_DEPTHAVERAGE = xyes])
-
 AC_MSG_RESULT($HAVE_DEPTHAVERAGE)
-
 dnl }}}
 dnl with-Enthalpy{{{
-
 AC_ARG_WITH([Enthalpy],
-
 	AS_HELP_STRING([--with-Enthalpy = YES], [compile with Enthalpy capabilities (default is yes)]),
-
 	[ENTHALPY=$withval],[ENTHALPY=yes])
-
 AC_MSG_CHECKING(for Enthalpy capability compilation)
 
-
 HAVE_ENTHALPY=no 
-
 if test "x$ENTHALPY" = "xyes"; then
-
 	HAVE_ENTHALPY=yes
-
 	AC_DEFINE([_HAVE_ENTHALPY_],[1],[with Enthalpy capability])
-
-fi
-
+fi
 AM_CONDITIONAL([ENTHALPY], [test x$HAVE_ENTHALPY = xyes])
-
 AC_MSG_RESULT($HAVE_ENTHALPY)
-
 dnl }}}
 dnl with-Esa{{{
-
 AC_ARG_WITH([Esa],
-
 	AS_HELP_STRING([--with-Esa = YES], [compile with Esa capabilities (default is yes)]),
-
 	[ESA=$withval],[ESA=yes])
-
 AC_MSG_CHECKING(for Esa capability compilation)
 
-
 HAVE_ESA=no 
-
 if test "x$ESA" = "xyes"; then
-
 	HAVE_ESA=yes
-
 	AC_DEFINE([_HAVE_ESA_],[1],[with Esa capability])
-
-fi
-
+fi
 AM_CONDITIONAL([ESA], [test x$HAVE_ESA = xyes])
-
 AC_MSG_RESULT($HAVE_ESA)
-
 dnl }}}
 dnl with-Extrapolation{{{
-
 AC_ARG_WITH([Extrapolation],
-
 	AS_HELP_STRING([--with-Extrapolation = YES], [compile with Extrapolation capabilities (default is yes)]),
-
 	[EXTRAPOLATION=$withval],[EXTRAPOLATION=yes])
-
 AC_MSG_CHECKING(for Extrapolation capability compilation)
 
-
 HAVE_EXTRAPOLATION=no 
-
 if test "x$EXTRAPOLATION" = "xyes"; then
-
 	HAVE_EXTRAPOLATION=yes
-
 	AC_DEFINE([_HAVE_EXTRAPOLATION_],[1],[with Extrapolation capability])
-
-fi
-
+fi
 AM_CONDITIONAL([EXTRAPOLATION], [test x$HAVE_EXTRAPOLATION = xyes])
-
 AC_MSG_RESULT($HAVE_EXTRAPOLATION)
-
 dnl }}}
 dnl with-ExtrudeFromBase{{{
-
 AC_ARG_WITH([ExtrudeFromBase],
-
 	AS_HELP_STRING([--with-ExtrudeFromBase = YES], [compile with ExtrudeFromBase capabilities (default is yes)]),
-
 	[EXTRUDEFROMBASE=$withval],[EXTRUDEFROMBASE=yes])
-
 AC_MSG_CHECKING(for ExtrudeFromBase capability compilation)
 
-
 HAVE_EXTRUDEFROMBASE=no 
-
 if test "x$EXTRUDEFROMBASE" = "xyes"; then
-
 	HAVE_EXTRUDEFROMBASE=yes
-
 	AC_DEFINE([_HAVE_EXTRUDEFROMBASE_],[1],[with ExtrudeFromBase capability])
-
-fi
-
+fi
 AM_CONDITIONAL([EXTRUDEFROMBASE], [test x$HAVE_EXTRUDEFROMBASE = xyes])
-
 AC_MSG_RESULT($HAVE_EXTRUDEFROMBASE)
-
 dnl }}}
 dnl with-ExtrudeFromTop{{{
-
 AC_ARG_WITH([ExtrudeFromTop],
-
 	AS_HELP_STRING([--with-ExtrudeFromTop = YES], [compile with ExtrudeFromTop capabilities (default is yes)]),
-
 	[EXTRUDEFROMTOP=$withval],[EXTRUDEFROMTOP=yes])
-
 AC_MSG_CHECKING(for ExtrudeFromTop capability compilation)
 
-
 HAVE_EXTRUDEFROMTOP=no 
-
 if test "x$EXTRUDEFROMTOP" = "xyes"; then
-
 	HAVE_EXTRUDEFROMTOP=yes
-
 	AC_DEFINE([_HAVE_EXTRUDEFROMTOP_],[1],[with ExtrudeFromTop capability])
-
-fi
-
+fi
 AM_CONDITIONAL([EXTRUDEFROMTOP], [test x$HAVE_EXTRUDEFROMTOP = xyes])
-
 AC_MSG_RESULT($HAVE_EXTRUDEFROMTOP)
-
 dnl }}}
 dnl with-FreeSurfaceBase{{{
-
 AC_ARG_WITH([FreeSurfaceBase],
-
 	AS_HELP_STRING([--with-FreeSurfaceBase = YES], [compile with FreeSurfaceBase capabilities (default is yes)]),
-
 	[FREESURFACEBASE=$withval],[FREESURFACEBASE=yes])
-
 AC_MSG_CHECKING(for FreeSurfaceBase capability compilation)
 
-
 HAVE_FREESURFACEBASE=no 
-
 if test "x$FREESURFACEBASE" = "xyes"; then
-
 	HAVE_FREESURFACEBASE=yes
-
 	AC_DEFINE([_HAVE_FREESURFACEBASE_],[1],[with FreeSurfaceBase capability])
-
-fi
-
+fi
 AM_CONDITIONAL([FREESURFACEBASE], [test x$HAVE_FREESURFACEBASE = xyes])
-
 AC_MSG_RESULT($HAVE_FREESURFACEBASE)
-
 dnl }}}
 dnl with-FreeSurfaceTop{{{
-
 AC_ARG_WITH([FreeSurfaceTop],
-
 	AS_HELP_STRING([--with-FreeSurfaceTop = YES], [compile with FreeSurfaceTop capabilities (default is yes)]),
-
 	[FREESURFACETOP=$withval],[FREESURFACETOP=yes])
-
 AC_MSG_CHECKING(for FreeSurfaceTop capability compilation)
 
-
 HAVE_FREESURFACETOP=no 
-
 if test "x$FREESURFACETOP" = "xyes"; then
-
 	HAVE_FREESURFACETOP=yes
-
 	AC_DEFINE([_HAVE_FREESURFACETOP_],[1],[with FreeSurfaceTop capability])
-
-fi
-
+fi
 AM_CONDITIONAL([FREESURFACETOP], [test x$HAVE_FREESURFACETOP = xyes])
-
 AC_MSG_RESULT($HAVE_FREESURFACETOP)
-
 dnl }}}
 dnl with-GLheightadvection{{{
-
 AC_ARG_WITH([GLheightadvection],
-
 	AS_HELP_STRING([--with-GLheightadvection = YES], [compile with GLheightadvection capabilities (default is yes)]),
-
 	[GLHEIGHTADVECTION=$withval],[GLHEIGHTADVECTION=yes])
-
 AC_MSG_CHECKING(for GLheightadvection capability compilation)
 
-
 HAVE_GLHEIGHTADVECTION=no 
-
 if test "x$GLHEIGHTADVECTION" = "xyes"; then
-
 	HAVE_GLHEIGHTADVECTION=yes
-
 	AC_DEFINE([_HAVE_GLHEIGHTADVECTION_],[1],[with GLheightadvection capability])
-
-fi
-
+fi
 AM_CONDITIONAL([GLHEIGHTADVECTION], [test x$HAVE_GLHEIGHTADVECTION = xyes])
-
 AC_MSG_RESULT($HAVE_GLHEIGHTADVECTION)
-
 dnl }}}
 dnl with-GiaIvins{{{
-
 AC_ARG_WITH([GiaIvins],
-
 	AS_HELP_STRING([--with-GiaIvins = YES], [compile with GiaIvins capabilities (default is yes)]),
-
 	[GIAIVINS=$withval],[GIAIVINS=yes])
-
 AC_MSG_CHECKING(for GiaIvins capability compilation)
 
-
 HAVE_GIAIVINS=no 
-
 if test "x$GIAIVINS" = "xyes"; then
-
 	HAVE_GIAIVINS=yes
-
 	AC_DEFINE([_HAVE_GIAIVINS_],[1],[with GiaIvins capability])
-
-fi
-
+fi
 AM_CONDITIONAL([GIAIVINS], [test x$HAVE_GIAIVINS = xyes])
-
 AC_MSG_RESULT($HAVE_GIAIVINS)
-
 dnl }}}
 dnl with-HydrologyDCEfficient{{{
-
 AC_ARG_WITH([HydrologyDCEfficient],
-
 	AS_HELP_STRING([--with-HydrologyDCEfficient = YES], [compile with HydrologyDCEfficient capabilities (default is yes)]),
-
 	[HYDROLOGYDCEFFICIENT=$withval],[HYDROLOGYDCEFFICIENT=yes])
-
 AC_MSG_CHECKING(for HydrologyDCEfficient capability compilation)
 
-
 HAVE_HYDROLOGYDCEFFICIENT=no 
-
 if test "x$HYDROLOGYDCEFFICIENT" = "xyes"; then
-
 	HAVE_HYDROLOGYDCEFFICIENT=yes
-
 	AC_DEFINE([_HAVE_HYDROLOGYDCEFFICIENT_],[1],[with HydrologyDCEfficient capability])
-
-fi
-
+fi
 AM_CONDITIONAL([HYDROLOGYDCEFFICIENT], [test x$HAVE_HYDROLOGYDCEFFICIENT = xyes])
-
 AC_MSG_RESULT($HAVE_HYDROLOGYDCEFFICIENT)
-
 dnl }}}
 dnl with-HydrologyDCInefficient{{{
-
 AC_ARG_WITH([HydrologyDCInefficient],
-
 	AS_HELP_STRING([--with-HydrologyDCInefficient = YES], [compile with HydrologyDCInefficient capabilities (default is yes)]),
-
 	[HYDROLOGYDCINEFFICIENT=$withval],[HYDROLOGYDCINEFFICIENT=yes])
-
 AC_MSG_CHECKING(for HydrologyDCInefficient capability compilation)
 
-
 HAVE_HYDROLOGYDCINEFFICIENT=no 
-
 if test "x$HYDROLOGYDCINEFFICIENT" = "xyes"; then
-
 	HAVE_HYDROLOGYDCINEFFICIENT=yes
-
 	AC_DEFINE([_HAVE_HYDROLOGYDCINEFFICIENT_],[1],[with HydrologyDCInefficient capability])
-
-fi
-
+fi
 AM_CONDITIONAL([HYDROLOGYDCINEFFICIENT], [test x$HAVE_HYDROLOGYDCINEFFICIENT = xyes])
-
 AC_MSG_RESULT($HAVE_HYDROLOGYDCINEFFICIENT)
-
 dnl }}}
 dnl with-HydrologyShreve{{{
-
 AC_ARG_WITH([HydrologyShreve],
-
 	AS_HELP_STRING([--with-HydrologyShreve = YES], [compile with HydrologyShreve capabilities (default is yes)]),
-
 	[HYDROLOGYSHREVE=$withval],[HYDROLOGYSHREVE=yes])
-
 AC_MSG_CHECKING(for HydrologyShreve capability compilation)
 
-
 HAVE_HYDROLOGYSHREVE=no 
-
 if test "x$HYDROLOGYSHREVE" = "xyes"; then
-
 	HAVE_HYDROLOGYSHREVE=yes
-
 	AC_DEFINE([_HAVE_HYDROLOGYSHREVE_],[1],[with HydrologyShreve capability])
-
-fi
-
+fi
 AM_CONDITIONAL([HYDROLOGYSHREVE], [test x$HAVE_HYDROLOGYSHREVE = xyes])
-
 AC_MSG_RESULT($HAVE_HYDROLOGYSHREVE)
-
+dnl }}}
+dnl with-HydrologyGlaDS{{{
+AC_ARG_WITH([HydrologyGlaDS],
+	AS_HELP_STRING([--with-HydrologyGlaDS = YES], [compile with HydrologyGlaDS capabilities (default is yes)]),
+	[HYDROLOGYGLADS=$withval],[HYDROLOGYGLADS=yes])
+AC_MSG_CHECKING(for HydrologyGlaDS capability compilation)
+
+HAVE_HYDROLOGYGLADS=no 
+if test "x$HYDROLOGYGLADS" = "xyes"; then
+	HAVE_HYDROLOGYGLADS=yes
+	AC_DEFINE([_HAVE_HYDROLOGYGLADS_],[1],[with HydrologyGlaDS capability])
+fi
+AM_CONDITIONAL([HYDROLOGYGLADS], [test x$HAVE_HYDROLOGYGLADS = xyes])
+AC_MSG_RESULT($HAVE_HYDROLOGYGLADS)
 dnl }}}
 dnl with-HydrologyShakti{{{
-
 AC_ARG_WITH([HydrologyShakti],
-
 	AS_HELP_STRING([--with-HydrologyShakti = YES], [compile with HydrologyShakti capabilities (default is yes)]),
-
 	[HYDROLOGYSHAKTI=$withval],[HYDROLOGYSHAKTI=yes])
-
 AC_MSG_CHECKING(for HydrologyShakti capability compilation)
 
-
 HAVE_HYDROLOGYSHAKTI=no 
-
 if test "x$HYDROLOGYSHAKTI" = "xyes"; then
-
 	HAVE_HYDROLOGYSHAKTI=yes
-
 	AC_DEFINE([_HAVE_HYDROLOGYSHAKTI_],[1],[with HydrologyShakti capability])
-
-fi
-
+fi
 AM_CONDITIONAL([HYDROLOGYSHAKTI], [test x$HAVE_HYDROLOGYSHAKTI = xyes])
-
 AC_MSG_RESULT($HAVE_HYDROLOGYSHAKTI)
-
 dnl }}}
 dnl with-HydrologyPism{{{
-
 AC_ARG_WITH([HydrologyPism],
-
 	AS_HELP_STRING([--with-HydrologyPism = YES], [compile with HydrologyPism capabilities (default is yes)]),
-
 	[HYDROLOGYPISM=$withval],[HYDROLOGYPISM=yes])
-
 AC_MSG_CHECKING(for HydrologyPism capability compilation)
 
-
 HAVE_HYDROLOGYPISM=no 
-
 if test "x$HYDROLOGYPISM" = "xyes"; then
-
 	HAVE_HYDROLOGYPISM=yes
-
 	AC_DEFINE([_HAVE_HYDROLOGYPISM_],[1],[with HydrologyPism capability])
-
-fi
-
+fi
 AM_CONDITIONAL([HYDROLOGYPISM], [test x$HAVE_HYDROLOGYPISM = xyes])
-
 AC_MSG_RESULT($HAVE_HYDROLOGYPISM)
-
 dnl }}}
 dnl with-L2ProjectionBase{{{
-
 AC_ARG_WITH([L2ProjectionBase],
-
 	AS_HELP_STRING([--with-L2ProjectionBase = YES], [compile with L2ProjectionBase capabilities (default is yes)]),
-
 	[L2PROJECTIONBASE=$withval],[L2PROJECTIONBASE=yes])
-
 AC_MSG_CHECKING(for L2ProjectionBase capability compilation)
 
-
 HAVE_L2PROJECTIONBASE=no 
-
 if test "x$L2PROJECTIONBASE" = "xyes"; then
-
 	HAVE_L2PROJECTIONBASE=yes
-
 	AC_DEFINE([_HAVE_L2PROJECTIONBASE_],[1],[with L2ProjectionBase capability])
-
-fi
-
+fi
 AM_CONDITIONAL([L2PROJECTIONBASE], [test x$HAVE_L2PROJECTIONBASE = xyes])
-
 AC_MSG_RESULT($HAVE_L2PROJECTIONBASE)
-
 dnl }}}
 dnl with-L2ProjectionEPL{{{
-
 AC_ARG_WITH([L2ProjectionEPL],
-
 	AS_HELP_STRING([--with-L2ProjectionEPL = YES], [compile with L2ProjectionEPL capabilities (default is yes)]),
-
 	[L2PROJECTIONEPL=$withval],[L2PROJECTIONEPL=yes])
-
 AC_MSG_CHECKING(for L2ProjectionEPL capability compilation)
 
-
 HAVE_L2PROJECTIONEPL=no 
-
 if test "x$L2PROJECTIONEPL" = "xyes"; then
-
 	HAVE_L2PROJECTIONEPL=yes
-
 	AC_DEFINE([_HAVE_L2PROJECTIONEPL_],[1],[with L2ProjectionEPL capability])
-
-fi
-
+fi
 AM_CONDITIONAL([L2PROJECTIONEPL], [test x$HAVE_L2PROJECTIONEPL = xyes])
-
 AC_MSG_RESULT($HAVE_L2PROJECTIONEPL)
-
 dnl }}}
 dnl with-Levelset{{{
-
 AC_ARG_WITH([Levelset],
-
 	AS_HELP_STRING([--with-Levelset = YES], [compile with Levelset capabilities (default is yes)]),
-
 	[LEVELSET=$withval],[LEVELSET=yes])
-
 AC_MSG_CHECKING(for Levelset capability compilation)
 
-
 HAVE_LEVELSET=no 
-
 if test "x$LEVELSET" = "xyes"; then
-
 	HAVE_LEVELSET=yes
-
 	AC_DEFINE([_HAVE_LEVELSET_],[1],[with Levelset capability])
-
-fi
-
+fi
 AM_CONDITIONAL([LEVELSET], [test x$HAVE_LEVELSET = xyes])
-
 AC_MSG_RESULT($HAVE_LEVELSET)
-
 dnl }}}
 dnl with-Love{{{
-
 AC_ARG_WITH([Love],
-
 	AS_HELP_STRING([--with-Love = YES], [compile with Love capabilities (default is yes)]),
-
 	[LOVE=$withval],[LOVE=yes])
-
 AC_MSG_CHECKING(for Love capability compilation)
 
-
 HAVE_LOVE=no 
-
 if test "x$LOVE" = "xyes"; then
-
 	HAVE_LOVE=yes
-
 	AC_DEFINE([_HAVE_LOVE_],[1],[with Love capability])
-
-fi
-
+fi
 AM_CONDITIONAL([LOVE], [test x$HAVE_LOVE = xyes])
-
 AC_MSG_RESULT($HAVE_LOVE)
-
 dnl }}}
 dnl with-Masstransport{{{
-
 AC_ARG_WITH([Masstransport],
-
 	AS_HELP_STRING([--with-Masstransport = YES], [compile with Masstransport capabilities (default is yes)]),
-
 	[MASSTRANSPORT=$withval],[MASSTRANSPORT=yes])
-
 AC_MSG_CHECKING(for Masstransport capability compilation)
 
-
 HAVE_MASSTRANSPORT=no 
-
 if test "x$MASSTRANSPORT" = "xyes"; then
-
 	HAVE_MASSTRANSPORT=yes
-
 	AC_DEFINE([_HAVE_MASSTRANSPORT_],[1],[with Masstransport capability])
-
-fi
-
+fi
 AM_CONDITIONAL([MASSTRANSPORT], [test x$HAVE_MASSTRANSPORT = xyes])
-
 AC_MSG_RESULT($HAVE_MASSTRANSPORT)
-
 dnl }}}
 dnl with-Melting{{{
-
 AC_ARG_WITH([Melting],
-
 	AS_HELP_STRING([--with-Melting = YES], [compile with Melting capabilities (default is yes)]),
-
 	[MELTING=$withval],[MELTING=yes])
-
 AC_MSG_CHECKING(for Melting capability compilation)
 
-
 HAVE_MELTING=no 
-
 if test "x$MELTING" = "xyes"; then
-
 	HAVE_MELTING=yes
-
 	AC_DEFINE([_HAVE_MELTING_],[1],[with Melting capability])
-
-fi
-
+fi
 AM_CONDITIONAL([MELTING], [test x$HAVE_MELTING = xyes])
-
 AC_MSG_RESULT($HAVE_MELTING)
-
 dnl }}}
 dnl with-Sealevelrise{{{
-
 AC_ARG_WITH([Sealevelrise],
-
 	AS_HELP_STRING([--with-Sealevelrise = YES], [compile with Sealevelrise capabilities (default is yes)]),
-
 	[SEALEVELRISE=$withval],[SEALEVELRISE=yes])
-
 AC_MSG_CHECKING(for Sealevelrise capability compilation)
 
-
 HAVE_SEALEVELRISE=no 
-
 if test "x$SEALEVELRISE" = "xyes"; then
-
 	HAVE_SEALEVELRISE=yes
-
 	AC_DEFINE([_HAVE_SEALEVELRISE_],[1],[with Sealevelrise capability])
-
-fi
-
+fi
 AM_CONDITIONAL([SEALEVELRISE], [test x$HAVE_SEALEVELRISE = xyes])
-
 AC_MSG_RESULT($HAVE_SEALEVELRISE)
-
 dnl }}}
 dnl with-Smb{{{
-
 AC_ARG_WITH([Smb],
-
 	AS_HELP_STRING([--with-Smb = YES], [compile with Smb capabilities (default is yes)]),
-
 	[SMB=$withval],[SMB=yes])
-
 AC_MSG_CHECKING(for Smb capability compilation)
 
-
 HAVE_SMB=no 
-
 if test "x$SMB" = "xyes"; then
-
 	HAVE_SMB=yes
-
 	AC_DEFINE([_HAVE_SMB_],[1],[with Smb capability])
-
-fi
-
+fi
 AM_CONDITIONAL([SMB], [test x$HAVE_SMB = xyes])
-
 AC_MSG_RESULT($HAVE_SMB)
-
 dnl }}}
 dnl with-Smooth{{{
-
 AC_ARG_WITH([Smooth],
-
 	AS_HELP_STRING([--with-Smooth = YES], [compile with Smooth capabilities (default is yes)]),
-
 	[SMOOTH=$withval],[SMOOTH=yes])
-
 AC_MSG_CHECKING(for Smooth capability compilation)
 
-
 HAVE_SMOOTH=no 
-
 if test "x$SMOOTH" = "xyes"; then
-
 	HAVE_SMOOTH=yes
-
 	AC_DEFINE([_HAVE_SMOOTH_],[1],[with Smooth capability])
-
-fi
-
+fi
 AM_CONDITIONAL([SMOOTH], [test x$HAVE_SMOOTH = xyes])
-
 AC_MSG_RESULT($HAVE_SMOOTH)
-
 dnl }}}
 dnl with-Stressbalance{{{
-
 AC_ARG_WITH([Stressbalance],
-
 	AS_HELP_STRING([--with-Stressbalance = YES], [compile with Stressbalance capabilities (default is yes)]),
-
 	[STRESSBALANCE=$withval],[STRESSBALANCE=yes])
-
 AC_MSG_CHECKING(for Stressbalance capability compilation)
 
-
 HAVE_STRESSBALANCE=no 
-
 if test "x$STRESSBALANCE" = "xyes"; then
-
 	HAVE_STRESSBALANCE=yes
-
 	AC_DEFINE([_HAVE_STRESSBALANCE_],[1],[with Stressbalance capability])
-
-fi
-
+fi
 AM_CONDITIONAL([STRESSBALANCE], [test x$HAVE_STRESSBALANCE = xyes])
-
 AC_MSG_RESULT($HAVE_STRESSBALANCE)
-
 dnl }}}
 dnl with-StressbalanceSIA{{{
-
 AC_ARG_WITH([StressbalanceSIA],
-
 	AS_HELP_STRING([--with-StressbalanceSIA = YES], [compile with StressbalanceSIA capabilities (default is yes)]),
-
 	[STRESSBALANCESIA=$withval],[STRESSBALANCESIA=yes])
-
 AC_MSG_CHECKING(for StressbalanceSIA capability compilation)
 
-
 HAVE_STRESSBALANCESIA=no 
-
 if test "x$STRESSBALANCESIA" = "xyes"; then
-
 	HAVE_STRESSBALANCESIA=yes
-
 	AC_DEFINE([_HAVE_STRESSBALANCESIA_],[1],[with StressbalanceSIA capability])
-
-fi
-
+fi
 AM_CONDITIONAL([STRESSBALANCESIA], [test x$HAVE_STRESSBALANCESIA = xyes])
-
 AC_MSG_RESULT($HAVE_STRESSBALANCESIA)
-
 dnl }}}
 dnl with-StressbalanceVertical{{{
-
 AC_ARG_WITH([StressbalanceVertical],
-
 	AS_HELP_STRING([--with-StressbalanceVertical = YES], [compile with StressbalanceVertical capabilities (default is yes)]),
-
 	[STRESSBALANCEVERTICAL=$withval],[STRESSBALANCEVERTICAL=yes])
-
 AC_MSG_CHECKING(for StressbalanceVertical capability compilation)
 
-
 HAVE_STRESSBALANCEVERTICAL=no 
-
 if test "x$STRESSBALANCEVERTICAL" = "xyes"; then
-
 	HAVE_STRESSBALANCEVERTICAL=yes
-
 	AC_DEFINE([_HAVE_STRESSBALANCEVERTICAL_],[1],[with StressbalanceVertical capability])
-
-fi
-
+fi
 AM_CONDITIONAL([STRESSBALANCEVERTICAL], [test x$HAVE_STRESSBALANCEVERTICAL = xyes])
-
 AC_MSG_RESULT($HAVE_STRESSBALANCEVERTICAL)
-
 dnl }}}
 dnl with-Thermal{{{
-
 AC_ARG_WITH([Thermal],
-
 	AS_HELP_STRING([--with-Thermal = YES], [compile with Thermal capabilities (default is yes)]),
-
 	[THERMAL=$withval],[THERMAL=yes])
-
 AC_MSG_CHECKING(for Thermal capability compilation)
 
-
 HAVE_THERMAL=no 
-
 if test "x$THERMAL" = "xyes"; then
-
 	HAVE_THERMAL=yes
-
 	AC_DEFINE([_HAVE_THERMAL_],[1],[with Thermal capability])
-
-fi
-
+fi
 AM_CONDITIONAL([THERMAL], [test x$HAVE_THERMAL = xyes])
-
 AC_MSG_RESULT($HAVE_THERMAL)
-
 dnl }}}
 dnl with-UzawaPressure{{{
-
 AC_ARG_WITH([UzawaPressure],
-
 	AS_HELP_STRING([--with-UzawaPressure = YES], [compile with UzawaPressure capabilities (default is yes)]),
-
 	[UZAWAPRESSURE=$withval],[UZAWAPRESSURE=yes])
-
 AC_MSG_CHECKING(for UzawaPressure capability compilation)
 
-
 HAVE_UZAWAPRESSURE=no 
-
 if test "x$UZAWAPRESSURE" = "xyes"; then
-
 	HAVE_UZAWAPRESSURE=yes
-
 	AC_DEFINE([_HAVE_UZAWAPRESSURE_],[1],[with UzawaPressure capability])
-
-fi
-
+fi
 AM_CONDITIONAL([UZAWAPRESSURE], [test x$HAVE_UZAWAPRESSURE = xyes])
-
 AC_MSG_RESULT($HAVE_UZAWAPRESSURE)
-
 dnl }}}
 
Index: /issm/trunk/m4/issm_options.m4
===================================================================
--- /issm/trunk/m4/issm_options.m4	(revision 24312)
+++ /issm/trunk/m4/issm_options.m4	(revision 24313)
@@ -227,4 +227,9 @@
 			export CC=icc
 			export CXX=icpc
+		elif test $VENDOR = intel-aurora; then
+			export CC=icc
+			export CXX=icpc
+			export CXXFLAGS=" -O3 -D_INTEL_LINUX_ -DMPICH_IGNORE_CXX_SEEK"
+			export CFLAGS=" -O3 -D_INTEL_LINUX_ -DMPICH_IGNORE_CXX_SEEK"
 		elif test $VENDOR = intel-discover; then
 			export CC=icc
@@ -583,4 +588,8 @@
 	  [PYTHON_ROOT=$withval],[PYTHON_ROOT="no"])
 
+	AC_ARG_WITH([python-version],
+	  AS_HELP_STRING([--with-python-version=DIR], [python forced version.]),
+	  [PYTHON_VERSION=$withval],[PYTHON_VERSION="no"])
+
 	dnl Check whether python is enabled
 	AC_MSG_CHECKING([for python])
@@ -599,10 +608,13 @@
 	dnl python specifics
 	if test "x$HAVE_PYTHON" = "xyes"; then
-		AC_MSG_CHECKING([for python version])
-		dnl Query Python for its version number. Getting [:3] seems to be the
-		dnl best way to do this; it's what "site.py" does in the standard library.
-		PYTHON_VERSION=$($PYTHON_ROOT/bin/python -c "import sys; print sys.version[[:3]]")
-		AC_MSG_RESULT($PYTHON_VERSION)
-
+		if test "x$PYTHON_VERSION" = "xno" ; then
+			AC_MSG_CHECKING([for python version])
+			dnl Query Python for its version number. Getting [:3] seems to be the
+			dnl best way to do this; it's what "site.py" does in the standard library.
+			PYTHON_VERSION=$($PYTHON_ROOT/bin/python -c "import sys; print sys.version[[:3]]")
+			AC_MSG_RESULT($PYTHON_VERSION)
+		else
+			AC_MSG_RESULT([enforced  python version is ]$PYTHON_VERSION)
+		fi
 		dnl recover major
 		PYTHON_MAJOR=${PYTHON_VERSION%.*}
@@ -620,11 +632,17 @@
 		else if test -f "$PYTHON_ROOT/include/python$PYTHON_VERSION/Python.h"; then
 			PYTHONINCL=-I$PYTHON_ROOT/include/python$PYTHON_VERSION
+		else if test -f "$PYTHON_ROOT/include/python$PYTHON_VERSIONm/Python.h"; then
+			PYTHONINCL=-I$PYTHON_ROOT/include/python$PYTHON_VERSIONm
 		else
 			AC_MSG_ERROR([Python.h not found, locate this file and contact ISSM developers]);
 		fi
 		fi
+		fi
 		AC_MSG_RESULT(found)
-
-		PYTHONLIB="-L$PYTHON_ROOT/lib -lpython$PYTHON_VERSION"
+		if test "x$PYTHON_MAJOR" = "x3"; then
+				PYTHONLIB="-L$PYTHON_ROOT/lib -lpython$PYTHON_VERSION""m"
+		else
+				PYTHONLIB="-L$PYTHON_ROOT/lib -lpython$PYTHON_VERSION"
+		fi
 		PYTHONEXT=.so
 		case "${host_os}" in
@@ -1437,4 +1455,5 @@
 		fi
 		HAVE_SCALAPACK=yes
+		#SCALAPACKLIB=-L"$SCALAPACK_ROOT/ -lscalapack-openmpi"
 		SCALAPACKLIB=-L"$SCALAPACK_ROOT/ -lscalapack"
 	else if test "x$SCALAPACKLIB" != "xno"; then
@@ -1479,5 +1498,6 @@
 		  ;;
 		*linux*)
-		  BLASLAPACKLIB=-L"$BLASLAPACK_ROOT/lib -lflapack -lfblas "
+				BLASLAPACKLIB=-L"$BLASLAPACK_ROOT/lib -lflapack -lfblas "
+		#BLASLAPACKLIB=-L"$BLASLAPACK_ROOT/lib -llapack -lblas "
 		  ;;
 		*darwin*)
@@ -1681,4 +1701,31 @@
 	   fi
 		dnl }}}
+	dnl semic{{{
+	AC_ARG_WITH([semic-dir],
+		AS_HELP_STRING([--with-semic-dir=DIR], [Semic root directory.]),
+		[SEMIC_ROOT=$withval],[SEMIC_ROOT="no"])
+
+	dnl Check whether semic is enabled
+	AC_MSG_CHECKING([for semic])
+	if test "x$SEMIC_ROOT" = "xno" ; then
+		HAVE_SEMIC=no
+	else
+		HAVE_SEMIC=yes
+		if ! test -d "$SEMIC_ROOT"; then
+			AC_MSG_ERROR([semic directory provided ($SEMIC_ROOT) does not exist]);
+		fi
+	fi
+	AC_MSG_RESULT($HAVE_SEMIC)
+
+	dnl semic headers and libraries
+	if test "x$HAVE_SEMIC" == "xyes"; then
+		SEMICINCL="-I$SEMIC_ROOT/"
+		AC_DEFINE([_HAVE_SEMIC_],[1],[with semic in ISSM src])
+		SEMICLIB="$SEMIC_ROOT/libsurface_physics.a $SEMIC_ROOT/libutils.a"
+		AC_SUBST([SEMICLIB])
+		AC_SUBST([SEMICINCL])
+	fi
+	AM_CONDITIONAL([SEMIC],[test x$HAVE_SEMIC = xyes])
+	dnl }}}
 dnl spai{{{
 	AC_ARG_WITH([spai-dir],
@@ -2108,4 +2155,6 @@
 	AC_MSG_RESULT($HAVE_KRIGING)
 	dnl }}}
+
+	dnl Analyses
 	AX_ANALYSES_SELECTION
 
@@ -2178,5 +2227,5 @@
 	dnl other options
 	dnl optimization{{{
-	dnl bypass standard optimization -g -O2 ?
+	dnl -- bypass standard optimization -g -O2 -fPIC ?
 	AC_ARG_WITH([cxxoptflags],
 	  AS_HELP_STRING([--with-cxxoptflags = CXXOPTFLAGS], [optimization using CXX flags, ex: --with-cxxoptflags=-march=opteron -O3]),
@@ -2185,5 +2234,4 @@
 	AC_SUBST([CXXOPTFLAGS])
 	AC_MSG_RESULT(done)
-
 	dnl }}}
 	dnl multithreading{{{
@@ -2213,5 +2261,5 @@
 	dnl check that it is an integer
 	if [[ "$NUMTHREADS_VALUE" -eq   "$NUMTHREADS_VALUE" 2> /dev/null ]] ; then
-	 dnl cool we have an integer
+	 dnl cool we have an integer !
 	 :
 	else
Index: /issm/trunk/scripts/BinRead.py
===================================================================
--- /issm/trunk/scripts/BinRead.py	(revision 24312)
+++ /issm/trunk/scripts/BinRead.py	(revision 24313)
@@ -1,204 +1,210 @@
-#! /usr/bin/env python
-
-import os
+#!/usr/bin/env python
+import numpy as np
+from os import environ, path
 import sys
-import numpy
-import math
 import struct
-import argparse
-
-def BinRead(filin,filout='',verbose=0): #{{{
-
-	print "reading binary file."
-	f=open(filin,'rb')
-
-	if filout:
-		sys.stdout=open(filout,'w')
-
-	while True:
-		try:
-			#Step 1: read size of record name
-			recordnamesize=struct.unpack('i',f.read(struct.calcsize('i')))[0]
-		except struct.error as e:
-			print "probable EOF: %s" % e
-			break
-
-		print "============================================================================"
-		if verbose>2:
-			print "\nrecordnamesize = \"%d\"" % (recordnamesize)
-		recordname=struct.unpack('%ds' % recordnamesize,f.read(recordnamesize))[0]
-		print "field: %s" % recordname
-
-		#Step 2: read the data itself.
-		#first read length of record
-		reclen=struct.unpack('i',f.read(struct.calcsize('i')))[0]
-		if verbose>1:
-			print "reclen = %d" % reclen
-
-		#read data code: 
-		code=struct.unpack('i',f.read(struct.calcsize('i')))[0]
-		#print "code = %d (%s)" % (code,CodeToFormat(code))
-		print "Format = %s" % CodeToFormat(code)
-
-		if   code == FormatToCode('Boolean'):
-#			bval=struct.unpack('b',f.read(reclen-struct.calcsize('i')))[0]
-			bval=struct.unpack('i',f.read(reclen-struct.calcsize('i')))[0]
-			print "value = %d" % bval
-
-		elif code == FormatToCode('Integer'):
-			ival=struct.unpack('i',f.read(reclen-struct.calcsize('i')))[0]
-			print "value = %d" % ival
-
-		elif code == FormatToCode('Double'):
-			dval=struct.unpack('d',f.read(reclen-struct.calcsize('i')))[0]
-			print "value = %f" % dval
-
-		elif code == FormatToCode('String'):
-			strlen=struct.unpack('i',f.read(struct.calcsize('i')))[0]
-			if verbose>1:
-				print "strlen = %d" % strlen
-			sval=struct.unpack('%ds' % strlen,f.read(strlen))[0]
-			print "value = '%s'" % sval
-
-		elif code == FormatToCode('BooleanMat'):
-			#read matrix type: 
-			mattype=struct.unpack('i',f.read(struct.calcsize('i')))[0]
-			print "mattype = %d" % mattype
-
-			#now read matrix
-			s=[0,0]
-			s[0]=struct.unpack('i',f.read(struct.calcsize('i')))[0]
-			s[1]=struct.unpack('i',f.read(struct.calcsize('i')))[0]
-			print "size = [%dx%d]" % (s[0],s[1])
-			data=numpy.zeros((s[0],s[1]))
-			for i in xrange(s[0]):
-				for j in xrange(s[1]):
-					data[i][j]=struct.unpack('d',f.read(struct.calcsize('d')))[0]    #get to the "c" convention, hence the transpose
-					if verbose>2: print "data[%d,%d] = %f" % (i,j,data[i][j])
-
-		elif code == FormatToCode('IntMat'):
-			#read matrix type: 
-			mattype=struct.unpack('i',f.read(struct.calcsize('i')))[0]
-			print "mattype = %d" % mattype
-
-			#now read matrix
-			s=[0,0]
-			s[0]=struct.unpack('i',f.read(struct.calcsize('i')))[0]
-			s[1]=struct.unpack('i',f.read(struct.calcsize('i')))[0]
-			print "size = [%dx%d]" % (s[0],s[1])
-			data=numpy.zeros((s[0],s[1]))
-			for i in xrange(s[0]):
-				for j in xrange(s[1]):
-					data[i][j]=struct.unpack('d',f.read(struct.calcsize('d')))[0]    #get to the "c" convention, hence the transpose
-					if verbose>2: print "data[%d,%d] = %f" % (i,j,data[i][j])
-
-		elif code == FormatToCode('DoubleMat'):
-			#read matrix type: 
-			mattype=struct.unpack('i',f.read(struct.calcsize('i')))[0]
-			print "mattype = %d" % mattype
-
-			#now read matrix
-			s=[0,0]
-			s[0]=struct.unpack('i',f.read(struct.calcsize('i')))[0]
-			s[1]=struct.unpack('i',f.read(struct.calcsize('i')))[0]
-			print "size = [%dx%d]" % (s[0],s[1])
-			data=numpy.zeros((s[0],s[1]))
-			for i in xrange(s[0]):
-				for j in xrange(s[1]):
-					data[i][j]=struct.unpack('d',f.read(struct.calcsize('d')))[0]    #get to the "c" convention, hence the transpose
-					if verbose>2: print "data[%d,%d] = %f" % (i,j,data[i][j])
-
-		elif code == FormatToCode('MatArray'):
-			f.seek(reclen-4,1)
-			print "skipping %d bytes for code %d." % (code, reclen-4)
-
-		elif code == FormatToCode('StringArray'):
-			f.seek(reclen-4,1)
-			print "skipping %d bytes for code %d." % (code, reclen-4)
-
-		else:
-			raise TypeError('BinRead error message: data type: %d not supported yet! (%s)' % (code,recordname))
-
-	f.close()
+from argparse import ArgumentParser
+
+
+def BinRead(filin, filout='', verbose=0):  #{{{
+
+    print("reading binary file.")
+    f = open(filin, 'rb')
+
+    if filout:
+        sys.stdout = open(filout, 'w')
+
+    while True:
+        try:
+            #Step 1: read size of record name
+            recordnamesize = struct.unpack('i', f.read(struct.calcsize('i')))[0]
+        except struct.error as e:
+            print("probable EOF: {}".format(e))
+            break
+
+        print("============================================================================ ")
+        if verbose > 2:
+            print("\n recordnamesize = {}".format(recordnamesize))
+        recordname = struct.unpack('{}s'.format(recordnamesize), f.read(recordnamesize))[0]
+        print("field: {}".format(recordname))
+
+        #Step 2: read the data itself.
+        #first read length of record
+        #reclen = struct.unpack('i', f.read(struct.calcsize('i')))[0]
+        reclen = struct.unpack('q', f.read(struct.calcsize('q')))[0]
+        if verbose > 1:
+            print("reclen = {}".format(reclen))
+
+        #read data code:
+        code = struct.unpack('i', f.read(struct.calcsize('i')))[0]
+        print("Format = {} (code {})".format(CodeToFormat(code), code))
+
+        if code == FormatToCode('Boolean'):
+            bval = struct.unpack('i', f.read(reclen - struct.calcsize('i')))[0]
+            print("value = {}".format(bval))
+
+        elif code == FormatToCode('Integer'):
+            ival = struct.unpack('i', f.read(reclen - struct.calcsize('i')))[0]
+            print("value = {}".format(ival))
+
+        elif code == FormatToCode('Double'):
+            dval = struct.unpack('d', f.read(reclen - struct.calcsize('i')))[0]
+            print("value = {}".format(dval))
+
+        elif code == FormatToCode('String'):
+            strlen = struct.unpack('i', f.read(struct.calcsize('i')))[0]
+            if verbose > 1:
+                print("strlen = {}".format(strlen))
+            sval = struct.unpack('{}s'.format(strlen), f.read(strlen))[0]
+            print("value = '{}'".format(sval))
+
+        elif code == FormatToCode('BooleanMat'):
+            #read matrix type:
+            mattype = struct.unpack('i', f.read(struct.calcsize('i')))[0]
+            print("mattype = {}".format(mattype))
+
+            #now read matrix
+            s = [0, 0]
+            s[0] = struct.unpack('i', f.read(struct.calcsize('i')))[0]
+            s[1] = struct.unpack('i', f.read(struct.calcsize('i')))[0]
+            print("size = [{}x{}]".format(s[0], s[1]))
+            data = np.zeros((s[0], s[1]))
+            for i in range(s[0]):
+                for j in range(s[1]):
+                    data[i][j] = struct.unpack('d', f.read(struct.calcsize('d')))[0]    #get to the "c" convention, hence the transpose
+                    if verbose > 2:
+                        print("data[{}, {}] = {}".format(i, j, data[i][j]))
+
+        elif code == FormatToCode('IntMat'):
+            #read matrix type:
+            mattype = struct.unpack('i', f.read(struct.calcsize('i')))[0]
+            print("mattype = {}".format(mattype))
+
+            #now read matrix
+            s = [0, 0]
+            s[0] = struct.unpack('i', f.read(struct.calcsize('i')))[0]
+            s[1] = struct.unpack('i', f.read(struct.calcsize('i')))[0]
+            print("size = [{}x{}]".format(s[0], s[1]))
+            data = np.zeros((s[0], s[1]))
+            for i in range(s[0]):
+                for j in range(s[1]):
+                    data[i][j] = struct.unpack('d', f.read(struct.calcsize('d')))[0]    #get to the "c" convention, hence the transpose
+                    if verbose > 2:
+                        print("data[{}, {}] = {}".format(i, j, data[i][j]))
+
+        elif code == FormatToCode('DoubleMat'):
+            #read matrix type:
+            mattype = struct.unpack('i', f.read(struct.calcsize('i')))[0]
+            print("mattype = {}".format(mattype))
+
+            #now read matrix
+            s = [0, 0]
+            s[0] = struct.unpack('i', f.read(struct.calcsize('i')))[0]
+            s[1] = struct.unpack('i', f.read(struct.calcsize('i')))[0]
+            print("size = [{}x{}]".format(s[0], s[1]))
+            data = np.zeros((s[0], s[1]))
+            for i in range(s[0]):
+                for j in range(s[1]):
+                    data[i][j] = struct.unpack('d', f.read(struct.calcsize('d')))[0]    #get to the "c" convention, hence the transpose
+                    if verbose > 2:
+                        print("data[{}, {}] = {}".format(i, j, data[i][j]))
+
+        elif code == FormatToCode('MatArray'):
+            f.seek(reclen - 4, 1)
+            print("skipping {} bytes for code {}.".format(code, reclen - 4))
+        elif code == FormatToCode('StringArray'):
+            f.seek(reclen - 4, 1)
+            print("skipping {} bytes for code {}.".format(code, reclen - 4))
+
+        else:
+            raise TypeError('BinRead error message: data type: {} not supported yet! ({})'.format(code, recordname))
+
+    f.close()
 #}}}
-def FormatToCode(format): # {{{
-	"""
-	This routine takes the format string, and hardcodes it into an integer, which 
-	is passed along the record, in order to identify the nature of the dataset being 
-	sent.
-	"""
-
-	if format=='Boolean':
-		code=1
-	elif format=='Integer':
-		code=2
-	elif format=='Double':
-		code=3
-	elif format=='String':
-		code=4
-	elif format=='BooleanMat':
-		code=5
-	elif format=='IntMat':
-		code=6
-	elif format=='DoubleMat':
-		code=7
-	elif format=='MatArray':
-		code=8
-	elif format=='StringArray':
-		code=9
-	else:
-		raise InputError('FormatToCode error message: data type not supported yet!')
-
-	return code
+
+
+def FormatToCode(format):  # {{{
+    """
+    This routine takes the format string, and hardcodes it into an integer, which
+    is passed along the record, in order to identify the nature of the dataset being
+    sent.
+    """
+
+    if format == 'Boolean':
+        code = 1
+    elif format == 'Integer':
+        code = 2
+    elif format == 'Double':
+        code = 3
+    elif format == 'String':
+        code = 4
+    elif format == 'BooleanMat':
+        code = 5
+    elif format == 'IntMat':
+        code = 6
+    elif format == 'DoubleMat':
+        code = 7
+    elif format == 'MatArray':
+        code = 8
+    elif format == 'StringArray':
+        code = 9
+    else:
+        raise IOError('FormatToCode error message: data type not supported yet!')
+
+    return code
 # }}}
-def CodeToFormat(code): # {{{
-	"""
-	This routine takes the format string, and hardcodes it into an integer, which 
-	is passed along the record, in order to identify the nature of the dataset being 
-	sent.
-	"""
-
-	if code==1:
-		format='Boolean'
-	elif code==2:
-		format='Integer'
-	elif code==3:
-		format='Double'
-	elif code==4:
-		format='String'
-	elif code==5:
-		format='BooleanMat'
-	elif code==6:
-		format='IntMat'
-	elif code==7:
-		format='DoubleMat'
-	elif code==8:
-		format='MatArray'
-	elif code==9:
-		format='StringArray'
-	else:
-		raise TypeError('FormatToCode error message: code %d not supported yet!' %code)
-
-	return format
+
+
+def CodeToFormat(code):  # {{{
+    """
+    This routine takes the format string, and hardcodes it into an integer, which
+    is passed along the record, in order to identify the nature of the dataset being
+    sent.
+    """
+
+    if code == 1:
+        format = 'Boolean'
+    elif code == 2:
+        format = 'Integer'
+    elif code == 3:
+        format = 'Double'
+    elif code == 4:
+        format = 'String'
+    elif code == 5:
+        format = 'BooleanMat'
+    elif code == 6:
+        format = 'IntMat'
+    elif code == 7:
+        format = 'DoubleMat'
+    elif code == 8:
+        format = 'MatArray'
+    elif code == 9:
+        format = 'StringArray'
+    else:
+        raise TypeError('FormatToCode error message: code {} not supported yet!'.format(code))
+
+    return format
 # }}}
 
-if __name__ == '__main__': #{{{
-	if 'PYTHONSTARTUP' in os.environ:
-		PYTHONSTARTUP=os.environ['PYTHONSTARTUP']
-		print 'PYTHONSTARTUP =',PYTHONSTARTUP
-		if os.path.exists(PYTHONSTARTUP):
-			try:
-				execfile(PYTHONSTARTUP)
-			except Exception as e:
-				print "PYTHONSTARTUP error: ",e
-		else:
-			print "PYTHONSTARTUP file '%s' does not exist." % PYTHONSTARTUP
-
-	parser = argparse.ArgumentParser(description='BinRead - function to read binary input file.')
-	parser.add_argument('-f','--filin', help='name of binary input file', default='')
-	parser.add_argument('-o','--filout', help='optional name of text output file', default='')
-	parser.add_argument('-v','--verbose', help='optional level of output', default=0)
-	args = parser.parse_args()
-
-	BinRead(args.filin, args.filout,args.verbose)
+
+if __name__ == '__main__':  #{{{
+    if 'PYTHONSTARTUP' in environ:
+        PYTHONSTARTUP = environ['PYTHONSTARTUP']
+        print('PYTHONSTARTUP = {}'.format(PYTHONSTARTUP))
+        if path.exists(PYTHONSTARTUP):
+            try:
+                exec(compile(open(PYTHONSTARTUP).read(), PYTHONSTARTUP, 'exec'), globals())
+
+            except Exception as e:
+                print("PYTHONSTARTUP error: ", e)
+        else:
+            print("PYTHONSTARTUP file '{}' does not exist.".format(PYTHONSTARTUP))
+
+    parser = ArgumentParser(description='BinRead - function to read binary input file.')
+    parser.add_argument('-f', '--filin', help='name of binary input file', default='')
+    parser.add_argument('-o', '--filout', help='optional name of text output file', default='')
+    parser.add_argument('-v', '--verbose', help='optional level of output', default=0)
+    args = parser.parse_args()
+
+    BinRead(args.filin, args.filout, args.verbose)
 #}}}
Index: /issm/trunk/scripts/DownloadExternalPackage.py
===================================================================
--- /issm/trunk/scripts/DownloadExternalPackage.py	(revision 24312)
+++ /issm/trunk/scripts/DownloadExternalPackage.py	(revision 24313)
@@ -2,38 +2,34 @@
 # -*- coding: ISO-8859-1 -*-
 
-import os,sys
-import certifi
-import requests
+import os
+import sys
+import urllib
 
 #Check inputs
-if(len(sys.argv)!=3): raise NameError('usage: ./DownloadExternalPackage.py URL localfile')
+if(len(sys.argv) != 3):
+    raise NameError('usage: . / DownloadExternalPackage.py URL localfile')
 
-url=sys.argv[1];
-localFile=sys.argv[2]
+url = sys.argv[1]
+localFile = sys.argv[2]
 
-failureMessage = '''
-===========================================================================
-Unable to download from: %s
-* If URL specified manually - perhaps there is a typo?
-* If your network is disconnected - please reconnect
-* Alternatively, you can download the above URL manually
-===========================================================================
-''' % (url)
+#Remove file if it already exists
+if os.path.exists(localFile):
+    print("File " + localFile + " already exists and will not be downloaded...")
+    sys.exit()
 
-# Remove file if it already exists
-if os.path.exists(localFile):
-	print "File "+ localFile +" already exists and will not be downloaded..."
-	sys.exit()
-
-# Try to download from url
+#Try to download from url
+httpfail = -1
 try:
-	print "Fetching %s" % localFile
-	print "Checking connection"
-	test = requests.get('https://issm.ess.uci.edu/files/externalpackages')
-# 	print requests.certs.where()
-# 	req = requests.get(url)
-# 	print req.headers
-# 	open(localFile, 'wb').write(req.content)
-except Exception, e:
-	print e
-	raise RuntimeError(failureMessage)
+    print("Fetching %s" % localFile)
+    urllib.request(url, localFile)
+    httpfail = 0
+except urllib.error.URLError as e:
+    failureMessage = '''
+   ===========================================================================
+    Unable to download package {} from: {} due to {}
+    * If URL specified manually - perhaps there is a typo?
+    * If your network is disconnected - please reconnect
+    * Alternatively, you can download the above URL manually
+   ===========================================================================
+    '''.format(localFile, url, e)
+    print(failureMessage)
Index: /issm/trunk/scripts/automakererun.sh
===================================================================
--- /issm/trunk/scripts/automakererun.sh	(revision 24312)
+++ /issm/trunk/scripts/automakererun.sh	(revision 24313)
@@ -1,11 +1,13 @@
 #!/bin/sh
-#  this shell script will automatically reconfigure the entire ISSM 
-#  archive.
-
-# As it turns out, the autoreconf script provided by Autotools
-# encompasses the functionality of this script. As such, the 
-# following two lines will replace the remainder of the script.
-# If all goes well, then the script will be shortened in the future.
+#
+# automakererun.sh
+# Remakes GNU Build System files.
+#
+# Currently, a wrapper for Autotools' autoreconf script.
+#
+# Run,
+#	autoreconf --help
+# for more information.
 
 cd $ISSM_DIR
-autoreconf -iv
+autoreconf -ivf
Index: /issm/trunk/scripts/cloc2html.py
===================================================================
--- /issm/trunk/scripts/cloc2html.py	(revision 24312)
+++ /issm/trunk/scripts/cloc2html.py	(revision 24313)
@@ -1,83 +1,105 @@
-#!/usr/bin/env python
+#!/usr/bin/ env python
 # -*- coding: ISO-8859-1 -*-
 #inspired from http://qwiki.stanford.edu/images/d/df/Latex2qwiki.txt
-import sys, re, os
+import re
+import os
 
-ISSM_DIR=os.getenv('ISSM_DIR');
-if(not ISSM_DIR): raise NameError('ISSM_DIR undefined')
+ISSM_DIR = os.getenv('ISSM_DIR')
+if(not ISSM_DIR):
+    raise NameError('ISSM_DIR undefined')
 
-infile  = open('temp','r')
-outfile = open('temp.html','w')
-file_text  = infile.readlines()
+infile = open('temp', 'r')
+outfile = open('temp.html', 'w')
+file_text = infile.readlines()
 
 #write header
-outfile.write('<table width="600px" rules=none border=0 bordercolor="#000000" cellpadding="3" align="center" style="border-collapse:collapse;">\n')
-style_r='style="text-align:right;"'
-style_c='style="text-align:center;"'
-style_l='style="text-align:left;"'
-color = ' bgcolor=#7AA9DD ' #dark blue
-color1 = ' bgcolor=#C6E2FF ' #light blue
-color2 = ' bgcolor=#FFFFFF ' #white
+outfile.write(' < table width = "600px" rules = none border = 0 bordercolor = "#000000" cellpadding = "3" align = "center" style = "border - collapse:collapse;" > \n')
+style_r = 'style="text - align:right;"'
+style_c = 'style="text - align:center;"'
+style_l = 'style="text - align:left;"'
+color = ' bgcolor=#7AA9DD '  #dark blue
+color1 = ' bgcolor=#C6E2FF '  #light blue
+color2 = ' bgcolor=#FFFFFF '  #white
 
-count = 0 
+count = 0
 toggle = 0
 for i in range(len(file_text)):
 
-	#Get current lines except if first line
-	if(i==0): continue
-	line = file_text[i]
+    #Get current lines except if first line
+    if(i == 0):
+        continue
+    line = file_text[i]
 
-	pattern=r"----------------"
-	if (re.search(pattern,line)):
-		count+=1
-		continue
+    pattern = r"----------------"
+    if (re.search(pattern, line)):
+        count += 1
+        continue
 
-	if(count==1):
-		mystr = '<tr>\n'
-		column = 1
-		for i in line.split():
-			if(column==1): mystr += '<th '+color+style_l+'>'+i+'</th>'; column+=1
-			else:          mystr += '<th '+color+style_r+'>'+i+'</th>'
-		mystr += '<th '+color+style_r+'>Total</th>\n</th>\n'
-	elif(count==2):
-		total  = 0
-		column = 1
-		if(toggle): mystr = '<tr>\n<th '+color1+style_l+'>'
-		else:       mystr = '<tr>\n<th '+color2+style_l+'>'
-		for i in line.split():
-			if(not i.isdigit() or (i.isdigit and int(i)==77)):
-				mystr += ' '+i+' '
-			else:
-				if(column==1): mystr += '</th>'
-				if(column>=2): total += int(i)
-				if(toggle): mystr += '<td '+color1+style_r+'>'+i+'</td>'
-				else:       mystr += '<td '+color2+style_r+'>'+i+'</td>'
-				column += 1
-		if(toggle): mystr += '<td '+color1+style_r+'>'+str(total)+'</td>\n</tr>\n'
-		else:       mystr += '<td '+color2+style_r+'>'+str(total)+'</td>\n</tr>\n'
-		toggle = 1 - toggle
-	elif(count==3):
-		total  = 0
-		column = 1
-		if(toggle): mystr = '<tr>\n<th '+color1+style_l+'>'
-		else:       mystr = '<tr>\n<th '+color2+style_l+'>'
-		for i in line.split():
-			if(not i.isdigit()):
-				mystr += ' '+i+' '
-			else:
-				if(column==1): mystr += '</th>'
-				if(column>=2): total += int(i)
-				if(toggle): mystr += '<td '+color1+style_r+'>'+i+'</td>'
-				else:       mystr += '<td '+color2+style_r+'>'+i+'</td>'
-				column += 1
-		if(toggle): mystr += '<td '+color1+style_r+'>'+str(total)+'</td>\n</tr>\n'
-		else:       mystr += '<td '+color2+style_r+'>'+str(total)+'</td>\n</tr>\n'
-	else:
-		continue
+    if(count == 1):
+        mystr = ' < tr > \n'
+        column = 1
+        for i in line.split():
+            if(column == 1):
+                mystr += '<th ' + color + style_l + '>' + i + '</th>'
+                column += 1
+            else:
+                mystr += '<th ' + color + style_r + '>' + i + '</th>'
+        mystr += '<th ' + color + style_r + '>Total</th>\n</th>\n'
+    elif(count == 2):
+        total = 0
+        column = 1
+        if(toggle):
+            mystr = '<tr>\n<th ' + color1 + style_l + '>'
+        else:
+            mystr = '<tr>\n<th ' + color2 + style_l + '>'
+        for i in line.split():
+            if(not i.isdigit() or (i.isdigit and int(i) == 77)):
+                mystr += ' ' + i + ' '
+            else:
+                if(column == 1):
+                    mystr += '</th>'
+                if(column >= 2):
+                    total += int(i)
+                if(toggle):
+                    mystr += '<td ' + color1 + style_r + '>' + i + '</td>'
+                else:
+                    mystr += '<td ' + color2 + style_r + '>' + i + '</td>'
+                column += 1
+        if(toggle):
+            mystr += '<td ' + color1 + style_r + '>' + str(total) + '</td>\n</tr>\n'
+        else:
+            mystr += '<td ' + color2 + style_r + '>' + str(total) + '</td>\n</tr>\n'
+        toggle = 1 - toggle
+    elif(count == 3):
+        total = 0
+        column = 1
+        if(toggle):
+            mystr = '<tr>\n<th ' + color1 + style_l + '>'
+        else:
+            mystr = '<tr>\n<th ' + color2 + style_l + '>'
+        for i in line.split():
+            if(not i.isdigit()):
+                mystr += ' ' + i + ' '
+            else:
+                if(column == 1):
+                    mystr += '</th>'
+                if(column >= 2):
+                    total += int(i)
+                if(toggle):
+                    mystr += '<td ' + color1 + style_r + '>' + i + '</td>'
+                else:
+                    mystr += '<td ' + color2 + style_r + '>' + i + '</td>'
+                column += 1
+        if(toggle):
+            mystr += '<td ' + color1 + style_r + '>' + str(total) + '</td>\n</tr>\n'
+        else:
+            mystr += '<td ' + color2 + style_r + '>' + str(total) + '</td>\n</tr>\n'
+    else:
+        continue
 
-	outfile.write(mystr)
+    outfile.write(mystr)
 
 #write header
-outfile.write('</table>\n')
+outfile.write(' </table>\n')
 
 #close all files
Index: /issm/trunk/scripts/convertmatlabclasses.py
===================================================================
--- /issm/trunk/scripts/convertmatlabclasses.py	(revision 24312)
+++ /issm/trunk/scripts/convertmatlabclasses.py	(revision 24313)
@@ -1,14 +1,19 @@
 #!/usr/bin/env python
 # -*- coding: ISO-8859-1 -*-
-import sys, re, os, shutil
+import sys
+import re
+import os
+import shutil
 
 #get names of all directories to process
-ISSM_DIR=os.getenv('ISSM_DIR');
-if(not ISSM_DIR): raise NameError('ISSM_DIR undefined')
+ISSM_DIR = os.getenv('ISSM_DIR')
+if(not ISSM_DIR):
+    raise NameError('ISSM_DIR undefined')
 newclassesdir = ISSM_DIR + '/src/m/classes/'
 oldclassesdir = ISSM_DIR + '/src/m/oldclasses/'
 
 #make new directory
-if(os.path.exists(oldclassesdir)):shutil.rmtree(oldclassesdir)
+if(os.path.exists(oldclassesdir)):
+    shutil.rmtree(oldclassesdir)
 os.mkdir(oldclassesdir)
 
@@ -16,10 +21,10 @@
 #{{{
 subsasgntext = r'''
-function obj = subsasgn(obj,index,val)
-obj=builtin('subsasgn',obj,index,val);
+function obj = subsasgn(obj, index, val)
+obj = builtin('subsasgn', obj, index, val)
 '''
 subsreftext = r'''
-function obj = subsref(obj,index)
-obj=builtin('subsref',obj,index);
+function obj = subsref(obj, index)
+obj = builtin('subsref', obj, index)
 '''
 #}}}
@@ -28,126 +33,144 @@
 files = os.listdir(newclassesdir)
 for filename in files:
-	newpath = newclassesdir + filename
-	oldpath = oldclassesdir + filename
-	if(filename==".svn"):         continue
-	if(filename.endswith(".m")):  shutil.copy(newpath,oldpath)
-	if(filename.startswith("@")): shutil.copytree(newpath,oldpath)
-	if(filename=="clusters"):
-		files2 = os.listdir(newpath)
-		for filename2 in files2:
-			if(filename2==".svn"): continue
-			newpath = newclassesdir + filename +'/'+ filename2
-			oldpath = oldclassesdir + filename2
-			shutil.copy(newpath,oldpath)
-	if(filename=="model"):
-		shutil.copy(newpath+'/model.m'     ,oldclassesdir+'model.m');
-	if(filename=="qmu"):
-		shutil.copytree(newpath+'/@dakota_method',oldclassesdir+'/@dakota_method')
-		files2 = os.listdir(newpath)
-		for filename2 in files2:
-			if(filename2==".svn"): continue
-			if(filename2=="@dakota_method"): continue
-			newpath = newclassesdir + filename +'/'+ filename2
-			oldpath = oldclassesdir + filename2
-			shutil.copy(newpath,oldpath)
+    newpath = newclassesdir + filename
+    oldpath = oldclassesdir + filename
+    if(filename == ".svn"):
+        continue
+    if(filename.endswith(".m")):
+        shutil.copy(newpath, oldpath)
+    if(filename.startswith("@")):
+        shutil.copytree(newpath, oldpath)
+    if(filename == "clusters"):
+        files2 = os.listdir(newpath)
+        for filename2 in files2:
+            if(filename2 == ".svn"):
+                continue
+            newpath = newclassesdir + filename + '/' + filename2
+            oldpath = oldclassesdir + filename2
+            shutil.copy(newpath, oldpath)
+    if(filename == "model"):
+        shutil.copy(newpath + '/model.m', oldclassesdir + 'model.m')
+    if(filename == "qmu"):
+        shutil.copytree(newpath + '/@dakota_method', oldclassesdir + '/@dakota_method')
+        files2 = os.listdir(newpath)
+        for filename2 in files2:
+            if(filename2 == ".svn"):
+                continue
+            if(filename2 == "@dakota_method"):
+                continue
+            newpath = newclassesdir + filename + '/' + filename2
+            oldpath = oldclassesdir + filename2
+            shutil.copy(newpath, oldpath)
 
 files = os.listdir(oldclassesdir)
 #prepare properties
 #{{{
-propertiesfile = open(oldclassesdir+'/properties.m','w')
-propertiesfile.write("function out=properties(classname)\n");
+propertiesfile = open(oldclassesdir + '/properties.m', 'w')
+propertiesfile.write("function out = properties(classname)\n")
 #}}}
 for file in files:
-	if(not file.endswith(".m")): continue;
-	print "converting " + file + " from new to old Matlab class definition..."
-	infile     = open(oldclassesdir+file,'r')
-	classname  = (re.compile(r"\.m")).sub("",file)
-	dirname    = oldclassesdir+'/@'+classname
-	step       = 0
-	properties = ""
+    if(not file.endswith(".m")):
+        continue
+    print("converting " + file + " from new to old Matlab class definition...")
+    infile = open(oldclassesdir + file, 'r')
+    classname = (re.compile(r"\.m")).sub("", file)
+    dirname = oldclassesdir + '/@' + classname
+    step = 0
+    properties = ""
 
-	#create directory
-	if(not os.path.exists(dirname)):
-		#print "Directory " + dirname + " does not exist, creating...";
-		os.mkdir(dirname)
+    #create directory
+    if(not os.path.exists(dirname)):
+        #print "Directory " + dirname + " does not exist, creating..."
+        os.mkdir(dirname)
 
-	#Process file
-	file_text  = infile.readlines()
-	for i in range(len(file_text)-2):
-		mystr  = file_text[i];
+    #Process file
+    file_text = infile.readlines()
+    for i in range(len(file_text) - 2):
+        mystr = file_text[i]
 
-		if("properties" in mystr and step==0): step  = 1; continue
-		if("methods"    in mystr and step==1): step  = 2; continue
-		if("function "   in mystr and step==2): step += 1; 
+        if("properties" in mystr and step == 0):
+            step = 1
+            continue
+        if("methods" in mystr and step == 1):
+            step = 2
+            continue
+        if("function " in mystr and step == 2):
+            step += 1
 
-		if(step==1):
-			if("end" in mystr): continue
-			property = mystr.lstrip();
-			property = re.sub(r"%.*$","",property);
-			property = re.sub(r"\n","",property);
-			if(len(property)):
-				properties = properties + 'OBJ' + property + ";\n"
+        if(step == 1):
+            if("end" in mystr):
+                continue
+            property = mystr.lstrip()
+            property = re.sub(r"%. * $", "", property)
+            property = re.sub(r"\n", "", property)
+            if(len(property)):
+                properties = properties + 'OBJ' + property + ";\n"
 
-		if("function " in mystr):
+        if("function " in mystr):
 
-			#close previous file
-			if(step>3): outfile.close()
+            #close previous file
+            if(step > 3):
+                outfile.close()
 
-			#get function name
-			mystr2 = (re.compile("=")).sub(" ",mystr); #replaces equal signs by blank space
-			mystr2 = (re.compile("\(")).sub(" ( ",mystr2); #add blank spaces before and after (
-			list=mystr2.split();
-			for j in range(len(list)):
-				word=list[j];
-				if(word=='('): break
-			objectname   = list[1]
-			functionname = list[j-1]
-			objectname = re.sub("\[","",objectname);
-			objectname = re.sub("\]","",objectname);
-			if(functionname == "disp"): functionname = "display"
-			outfile = open(dirname + '/' + functionname + '.m','w')
+            #get function name
+            mystr2 = (re.compile("=")).sub(" ", mystr)  #replaces equal signs by blank space
+            mystr2 = (re.compile(r"\(")).sub(" (", mystr2)  #add blank spaces before and after (
+            list = mystr2.split()
+            for j in range(len(list)):
+                word = list[j]
+                if(word == '('):
+                    break
+            objectname = list[1]
+            functionname = list[j - 1]
+            objectname = re.sub(r"\[", "", objectname)
+            objectname = re.sub(r"\]", "", objectname)
+            if(functionname == "disp"):
+                functionname = "display"
+            outfile = open(dirname + '/' + functionname + '.m', 'w')
 
-			#deal with constructor
-			if(functionname==classname):
+            #deal with constructor
+            if(functionname == classname):
 
-				properties2 = re.sub("OBJ",objectname + '.',properties);
-				#write function declaration
-				outfile.write(mystr)
-				#write properties
-				outfile.write(properties2)
-				#write set class
-				outfile.write(objectname + "=class(" + objectname + ",'" + classname + "');\n")
+                properties2 = re.sub("OBJ", objectname + '.', properties)
+                #write function declaration
+                outfile.write(mystr)
+                #write properties
+                outfile.write(properties2)
+                #write set class
+                outfile.write(objectname + "=class(" + objectname + ", '" + classname + "');\n")
 
-				#update properties list
-				properties2=properties2.split('\n')
-				propertiesfile2 = open(dirname + '/properties.m','w')
-				propertiesfile2.write("function out=properties(obj),\n")
-				propertiesfile2.write('\tout=cell('+str(len(properties2)-1)+',1);\n')
-				propertiesfile.write("if strcmp(classname,'"+ classname +"'),\n")
-				propertiesfile.write('\tout=cell('+str(len(properties2)-1)+',1);\n')
-				for j in range(len(properties2)-1):
-					property = re.sub(r"=.*$","",properties2[j]);
-					property = property.strip()
-					property = re.sub(objectname+'.',"",property);
-					propertiesfile.write('\tout{' + str(j+1) + "}='" + property + "';\n")
-					propertiesfile2.write('\tout{' + str(j+1) + "}='" + property + "';\n")
-				propertiesfile.write('end\n')
-				continue
+                #update properties list
+                properties2 = properties2.split('\n')
+                propertiesfile2 = open(dirname + '/properties.m', 'w')
+                propertiesfile2.write("function out = properties(obj), \n")
+                propertiesfile2.write('\tout = cell(' + str(len(properties2) - 1) + ', 1);\n')
+                propertiesfile.write("if strcmp(classname, '" + classname + "'), \n")
+                propertiesfile.write('\tout = cell(' + str(len(properties2) - 1) + ', 1);\n')
+                for j in range(len(properties2) - 1):
+                    property = re.sub(r"=. * $", "", properties2[j])
+                    property = property.strip()
+                    property = re.sub(objectname + '.', "", property)
+                    propertiesfile.write('\tout{' + str(j + 1) + "} = '" + property + "';\n")
+                    propertiesfile2.write('\tout{' + str(j + 1) + "} = '" + property + "';\n")
+                propertiesfile.write('end\n')
+                continue
 
-		#write file
-		if(step>2): outfile.write(mystr)
+        #write file
+        if(step > 2):
+            outfile.write(mystr)
 
-	#close all files and delete m file
-	if(step>3):outfile.close()
-	infile.close()
-	os.remove(oldclassesdir+file)
+    #close all files and delete m file
+    if(step > 3):
+        outfile.close()
+    infile.close()
+    os.remove(oldclassesdir + file)
 
-	#Add subsref and subsasgn
-	outfile = open(dirname+'/subsasgn.m','w')
-	outfile.write(subsasgntext)
-	outfile.close()
-	outfile = open(dirname+'/subsref.m','w')
-	outfile.write(subsreftext)
-	outfile.close()
+    #Add subsref and subsasgn
+    outfile = open(dirname + '/subsasgn.m', 'w')
+    outfile.write(subsasgntext)
+    outfile.close()
+    outfile = open(dirname + '/subsref.m', 'w')
+    outfile.write(subsreftext)
+    outfile.close()
 
 
Index: /issm/trunk/scripts/mToPy.py
===================================================================
--- /issm/trunk/scripts/mToPy.py	(revision 24312)
+++ /issm/trunk/scripts/mToPy.py	(revision 24313)
@@ -1,52 +1,56 @@
 #!/usr/bin/env python
+import sys
+import os
+import shutil
+import translateToPy
+import mToPy  # touch mToPy to assertain location of installation
 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 #
-program =               'mToPy.py'
-version =               '1.0'
-versionReleaseDate =    '09/24/12'
-origAuthor =            'Mike Pellegrin'
+program = 'mToPy.py'
+version = '1.0'
+versionReleaseDate = '09/24/12'
+origAuthor = 'Mike Pellegrin'
 desc = '\nMain control unit for converting an matlab script file to python'
 #
 #   Note: Output will be put in the same (absolute) location as the input.
 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-#				History
-#	Date		Developer           Modification
+#                History
+#    Date        Developer           Modification
 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-#	09/24/12	Michael Pellegrin	Initial Release         V1.0
+#    09 / 24 / 12    Michael Pellegrin    Initial Release         V1.0
 #
 #
 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
-import sys, os, shutil
-import translateToPy
-import mToPy   # touch mToPy to assertain location of installation
 
-def convert ( inputFile ):
+def convert(inputFile):
     try:
-      if os.path.exists( inputFile + '.m') and os.path.isfile( inputFile + '.m'):
-        checkBackupOutputFile( inputFile )
-        convertMToPy( inputFile )
-      else:
-        print 'Specified input file: ' + inputFile + '.m doesn\'t appear to exist'
+        if os.path.exists(inputFile + '.m') and os.path.isfile(inputFile + '.m'):
+            checkBackupOutputFile(inputFile)
+            convertMToPy(inputFile)
+        else:
+            print('Specified input file: ' + inputFile + '.m doesn\'t appear to exist')
     finally:
-      print ''
+        print('')
 
-def convertMToPy ( inputFileName ):
-    translateToPy.convertToPython ( inputFileName + '.m', inputFileName + '.py' )
 
-def checkBackupOutputFile ( inputFile ):
+def convertMToPy(inputFileName):
+    translateToPy.convertToPython(inputFileName + '.m', inputFileName + '.py')
+
+
+def checkBackupOutputFile(inputFile):
     mFile = inputFile + '.m'
     pyFile = inputFile + '.py'
-    if os.path.exists( pyFile ):
-        i=1
+    if os.path.exists(pyFile):
+        i = 1
         bkupName = pyFile + str(i)
-        while os.path.exists( bkupName ):
-            i+=1
+        while os.path.exists(bkupName):
+            i += 1
             bkupName = pyFile + str(i)
-        os.rename( pyFile, bkupName )
+        os.rename(pyFile, bkupName)
 
     shutil.copyfile(mFile, pyFile)
 
+
 if __name__ == "__main__":
-    convert( sys.argv[1])
-
+    convert(sys.argv[1])
Index: /issm/trunk/scripts/translateToPy.py
===================================================================
--- /issm/trunk/scripts/translateToPy.py	(revision 24312)
+++ /issm/trunk/scripts/translateToPy.py	(revision 24313)
@@ -1,22 +1,24 @@
+
+import codecs
+import unicodedata
+import sys
+import datetime
+import os
 
 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 #
-program =               'translateToPy.py'
-version =               '1.0'
-versionReleaseDate =    '09/24/12'
-origAuthor =            'Mike Pellegrin'
+program = 'translateToPy.py'
+version = '1.0'
+versionReleaseDate = '09/24/12'
+origAuthor = 'Mike Pellegrin'
 desc = '\nMatlab script conversion into python'
 #
 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-#				History
-#	Date		Developer           Modification
-#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-#	09/24/12 Michael Pellegrin	Initial Release     V1.0
+#                History
+#    Date        Developer           Modification
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+#    09 / 24 / 12 Michael Pellegrin    Initial Release     V1.0
 #
 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-import codecs, unicodedata
-import sys, re, datetime, os
-import decimal, operator
 
 
@@ -28,229 +30,228 @@
 
 
-def setupOutputLocation ( outFile ):
+def setupOutputLocation(outFile):
     if outFile != sys.stdout:
-		globals()['outputLocation'] = open( outFile, 'w' ) # clobber
-
-def translateFile ( inputFile ):
-	f = codecs.open( inputFile, encoding='utf-8' )
-	try:
-		for line in f:
-			# print "in: " +line
-
-			asciiLine = unicodedata.normalize('NFKD', line).encode('ascii','ignore')
-			line = asciiLine
-
-			translateLine( line )
-
-	finally:
-		f.close()
-
-def translateLine ( line ):
-
-	if len(line) == 1:	# blank line
-		output( line )
-
-	elif line.split()[0][0] == '%':		# comment line
-		output("# " + line.replace('%','') )
-
-	else:		# needs cleanup.  this is a real-quick-n-dirty implimentation
-		#print line
-		res = line.replace('{','[')
-		res = res.replace('}',']')
-		res = res.replace('model','model()')
-		res = res.replace('SolutionEnum','SolutionEnum()')
-		res = res.replace('StressTensorEnum','StressTensorEnum()')
-		res = res.replace('.par','.py')
-		res = res.replace('=extrude(md,','.extrude(')
-
-		res = res.replace('thickness(pos)','thickness[pos]')
-		res = res.replace('find(md.','numpy.nonzero(md.')
-
-		res = res.replace('\n','')
-
-		# handle inline comments
-		res = res.replace('%','#')
-
-		res = res.replace('...','\\')
-
-		# determine if the m file has mult. line cmd (real quick solution)
-		multCmds = res.split(';')
-		numLines = len( multCmds ) - 2
-		allParts = ''
-		for part in multCmds:
-			allParts += part
-			#allParts += re.sub('^\s+','',part)
-			#allParts += part.strip()
-			if numLines > 0:
-				allParts += '\n'
-				numLines -= 1
-		res = allParts	
-
-		res = res.replace(';','')
-
-
-		res = convertFieldValues( res )
-		#print 'resulting line:' + str(res) + '\n'
-		output(res)
-
-def convertFieldValues ( currentLine ):
-	# before utilizing regex's {starting w/ eg. \([0-9]\) } for special case: ...(#)...
-	# i noticed what i'm looking for is only TransientSolution(*). So, ...
-
-	res = currentLine
-	if 'md.results' in currentLine:
-		res = res.replace('(md.results.','md.results[\'')
-
-		if 'TransientSolution(' in currentLine:		# got a TransientSolution([0-9..]) case
-			res = res.replace('TransientSolution(','TransientSolution\'][')
-			parts = res.split(')')
-			res = parts[0] + '][\'' + parts[1].replace('.','') + '\']' + parts[2]
-
-		else:				# handle the other cases for md.results
-			
-			res = res.replace('Solution.Vx)','Solution\'][1][\'Vx\']')
-			res = res.replace('Solution.Vy)','Solution\'][1][\'Vy\']')
-			res = res.replace('Solution.Vz)','Solution\'][1][\'Vz\']')
-			res = res.replace('Solution.Vel)','Solution\'][1][\'Vel\']')
-
-			res = res.replace('Solution.Pressure)','Solution\'][1][\'Pressure\']')
-
-			res = res.replace('Solution.StressTensorxx)','Solution\'][1][\'StressTensorxx\']')
-			res = res.replace('Solution.StressTensorxy)','Solution\'][1][\'StressTensorxy\']')
-			res = res.replace('Solution.StressTensoryy)','Solution\'][1][\'StressTensoryy\']')
-			res = res.replace('Solution.StressTensorzz)','Solution\'][1][\'StressTensorzz\']')
-			res = res.replace('Solution.StressTensorxz)','Solution\'][1][\'StressTensorxz\']')
-			res = res.replace('Solution.StressTensoryz)','Solution\'][1][\'StressTensoryz\']')
-
-			res = res.replace('Solution.FrictionCoefficient)','Solution\'][1][\'FrictionCoefficient\']')
-			res = res.replace('Solution.SurfaceforcingsMasBalance)','Solution\'][1][\'SurfaceforcingsMasBalance\']')
-			res = res.replace('Solution.MaskElementonfloatingice)','Solution\'][1][\'MaskElementonfloatingice\']')
-			res = res.replace('Solution.J)','Solution\'][1][\'J\']')
-			res = res.replace('Solution.BalancethicknessThickeningRate)','Solution\'][1][\'BalancethicknessThickeningRate\']')
-
-			res = res.replace('Solution.Gradient1)','Solution\'][1][\'Gradient1\']')
-			res = res.replace('Solution.Gradient2)','Solution\'][1][\'Gradient2\']')
-
-			res = res.replace('Solution.MaterialsRheologyZbar)','Solution\'][1][\'MaterialsRheologyZbar\']')
-			res = res.replace('Solution.MaterialsRheologyBbar)','Solution\'][1][\'MaterialsRheologyBbar\']')
-			res = res.replace('Solution.MaterialsRheologyB)','Solution\'][1][\'MaterialsRheologyB\']')
-
-			res = res.replace('Solution.Thickness)','Solution\'][1][\'Thickness\']')
-
-			res = res.replace('Solution.Temperature)','Solution\'][1][\'Temperature\']')
-
-			res = res.replace('Solution.BasalforcingsMeltingRate)','Solution\'][1][\'BasalforcingsMeltingRate\']')
-
-			res = res.replace('Solution.SurfaceSlopeX)','Solution\'][1][\'SurfaceSlopeX\']')
-			res = res.replace('Solution.SurfaceSlopeY)','Solution\'][1][\'SurfaceSlopeY\']')
-			res = res.replace('Solution.SurfaceSlopeZ)','Solution\'][1][\'SurfaceSlopeZ\']')
-
-			res = res.replace('Solution.BedSlopeX)','Solution\'][1][\'BedSlopeX\']')
-			res = res.replace('Solution.BedSlopeY)','Solution\'][1][\'BedSlopeY\']')
-			res = res.replace('Solution.BedSlopeZ)','Solution\'][1][\'BedSlopeZ\']')
-
-			res = res.replace('Solution.Enthalpy)','Solution\'][1][\'Enthalpy\']')
-			res = res.replace('Solution.Waterfraction)','Solution\'][1][\'Waterfraction\']')
-			res = res.replace('Solution.Temperature)','Solution\'][1][\'Temperature\']')
-
-			# special case
-			res = res.replace('.DiagnosticSolution.J','[\'DiagnosticSolution\'][1][\'J\']')
-
-	return res
-
-def output ( line ):
-	numTabs = indentLevel
-	while numTabs:
-		numTabs -= 1
-		print >> outputLocation, '\t',
-	print >> outputLocation, line
-
-def outputTopOfSript( inputFile ):
-
-	global indentLevel
-
-	output("\"\"\"")
-	output("== == == == == == == == == == == == == == == == == == ==")
-	output("Auto generated python script for ISSM:   %s" % (inputFile) )
-	output("Created on %s via %s Ver %s by %s" % ( datetime.date.today(), program, version, os.getlogin()))
-	output("== == == == == == == == == == == == == == == == == == ==")
-	#output("")
-	output(desc)
-	output("%s Author: Michael Pellegrin" % (program))
-	output("%s Date: %s" % (program, versionReleaseDate))
-	output("== == == == == == == == == == == == == == == == == == ==")
-	output("\"\"\"")
-	output("")
+        globals()['outputLocation'] = open(outFile, 'w')  # clobber
+
+
+def translateFile(inputFile):
+    f = codecs.open(inputFile, encoding='utf-8')
+    try:
+        for line in f:
+            # print "in: " + line
+
+            asciiLine = unicodedata.normalize('NFKD', line).encode('ascii', 'ignore')
+            line = asciiLine
+            translateLine(line)
+
+    finally:
+        f.close()
+
+
+def translateLine(line):
+
+    if len(line) == 1:    # blank line
+        output(line)
+
+    elif line.split()[0][0] == '%':        # comment line
+        output("# " + line.replace('%', ''))
+
+    else:        # needs cleanup.  this is a real - quick - n - dirty implimentation
+        #print line
+        res = line.replace('{', '[')
+        res = res.replace('}', ']')
+        res = res.replace('model', 'model()')
+        res = res.replace('SolutionEnum', 'SolutionEnum()')
+        res = res.replace('StressTensorEnum', 'StressTensorEnum()')
+        res = res.replace('.par', '.py')
+        res = res.replace('=extrude(md, ', '.extrude(')
+
+        res = res.replace('thickness(pos)', 'thickness[pos]')
+        res = res.replace('find(md.', 'numpy.nonzero(md.')
+
+        res = res.replace('\n', '')
+
+        # handle inline comments
+        res = res.replace('%', '#')
+
+        res = res.replace('...', '\\')
+
+        # determine if the m file has mult. line cmd (real quick solution)
+        multCmds = res.split(';')
+        numLines = len(multCmds) - 2
+        allParts = ''
+        for part in multCmds:
+            allParts += part
+            #allParts += re.sub('^\s + ', '', part)
+            #allParts += part.strip()
+            if numLines > 0:
+                allParts += '\n'
+                numLines -= 1
+
+        res = allParts
+        res = res.replace(';', '')
+        res = convertFieldValues(res)
+        #print 'resulting line:' + str(res) + '\n'
+        output(res)
+
+
+def convertFieldValues(currentLine):
+    # before utilizing regex's {starting w / eg. \([0 - 9]\) } for special case: ...(#)...
+    # i noticed what i'm looking for is only TransientSolution(* ). So, ...
+
+    res = currentLine
+    if 'md.results' in currentLine:
+        res = res.replace('(md.results.', 'md.results[\'')
+
+        if 'TransientSolution(' in currentLine:        # got a TransientSolution([0 - 9..]) case
+            res = res.replace('TransientSolution(', 'TransientSolution\'][')
+            parts = res.split(')')
+            res = parts[0] + '][\'' + parts[1].replace('.', '') + '\']' + parts[2]
+
+        else:                # handle the other cases for md.results
+
+            res = res.replace('Solution.Vx)', 'Solution\'][1][\'Vx\']')
+            res = res.replace('Solution.Vy)', 'Solution\'][1][\'Vy\']')
+            res = res.replace('Solution.Vz)', 'Solution\'][1][\'Vz\']')
+            res = res.replace('Solution.Vel)', 'Solution\'][1][\'Vel\']')
+
+            res = res.replace('Solution.Pressure)', 'Solution\'][1][\'Pressure\']')
+
+            res = res.replace('Solution.StressTensorxx)', 'Solution\'][1][\'StressTensorxx\']')
+            res = res.replace('Solution.StressTensorxy)', 'Solution\'][1][\'StressTensorxy\']')
+            res = res.replace('Solution.StressTensoryy)', 'Solution\'][1][\'StressTensoryy\']')
+            res = res.replace('Solution.StressTensorzz)', 'Solution\'][1][\'StressTensorzz\']')
+            res = res.replace('Solution.StressTensorxz)', 'Solution\'][1][\'StressTensorxz\']')
+            res = res.replace('Solution.StressTensoryz)', 'Solution\'][1][\'StressTensoryz\']')
+
+            res = res.replace('Solution.FrictionCoefficient)', 'Solution\'][1][\'FrictionCoefficient\']')
+            res = res.replace('Solution.SurfaceforcingsMasBalance)', 'Solution\'][1][\'SurfaceforcingsMasBalance\']')
+            res = res.replace('Solution.MaskElementonfloatingice)', 'Solution\'][1][\'MaskElementonfloatingice\']')
+            res = res.replace('Solution.J)', 'Solution\'][1][\'J\']')
+            res = res.replace('Solution.BalancethicknessThickeningRate)', 'Solution\'][1][\'BalancethicknessThickeningRate\']')
+
+            res = res.replace('Solution.Gradient1)', 'Solution\'][1][\'Gradient1\']')
+            res = res.replace('Solution.Gradient2)', 'Solution\'][1][\'Gradient2\']')
+
+            res = res.replace('Solution.MaterialsRheologyZbar)', 'Solution\'][1][\'MaterialsRheologyZbar\']')
+            res = res.replace('Solution.MaterialsRheologyBbar)', 'Solution\'][1][\'MaterialsRheologyBbar\']')
+            res = res.replace('Solution.MaterialsRheologyB)', 'Solution\'][1][\'MaterialsRheologyB\']')
+
+            res = res.replace('Solution.Thickness)', 'Solution\'][1][\'Thickness\']')
+
+            res = res.replace('Solution.Temperature)', 'Solution\'][1][\'Temperature\']')
+
+            res = res.replace('Solution.BasalforcingsMeltingRate)', 'Solution\'][1][\'BasalforcingsMeltingRate\']')
+
+            res = res.replace('Solution.SurfaceSlopeX)', 'Solution\'][1][\'SurfaceSlopeX\']')
+            res = res.replace('Solution.SurfaceSlopeY)', 'Solution\'][1][\'SurfaceSlopeY\']')
+            res = res.replace('Solution.SurfaceSlopeZ)', 'Solution\'][1][\'SurfaceSlopeZ\']')
+
+            res = res.replace('Solution.BedSlopeX)', 'Solution\'][1][\'BedSlopeX\']')
+            res = res.replace('Solution.BedSlopeY)', 'Solution\'][1][\'BedSlopeY\']')
+            res = res.replace('Solution.BedSlopeZ)', 'Solution\'][1][\'BedSlopeZ\']')
+
+            res = res.replace('Solution.Enthalpy)', 'Solution\'][1][\'Enthalpy\']')
+            res = res.replace('Solution.Waterfraction)', 'Solution\'][1][\'Waterfraction\']')
+            res = res.replace('Solution.Temperature)', 'Solution\'][1][\'Temperature\']')
+
+            # special case
+            res = res.replace('.DiagnosticSolution.J', '[\'DiagnosticSolution\'][1][\'J\']')
+
+    return res
+
+
+def output(line):
+    numTabs = indentLevel
+    while numTabs:
+        numTabs -= 1
+        print('\t', end="", file=outputLocation)
+
+    print(line, end="", file=outputLocation)
+
+
+def outputTopOfSript(inputFile):
+
+    global indentLevel
+
+    output("\"\"\"")
+    output("====================================== ")
+    output("Auto generated python script for ISSM: {}".format(inputFile))
+    output("Created on {} via {} Ver {} by {}".format(datetime.date.today(), program, version, os.getlogin()))
+    output("====================================== ")
+    #output("")
+    output(desc)
+    output("%s Author: Michael Pellegrin" % (program))
+    output("%s Date: %s" % (program, versionReleaseDate))
+    output("====================================== ")
+    output("\"\"\"")
+    output("")
+
 
 def outputBottomOfScript():
 
-	global indentLevel
-
-	output("")
-	
-def genericImports ():
-	output("from MatlabFuncs import *")
-	output("from model import *")
-	output("from EnumDefinitions import *")
-	output("from numpy import *")
-
-def createImports ( inputFile ):
-	genericImports()
-
-	# cycle through eachline to assertain import needs
-	f = codecs.open( inputFile, encoding='utf-8' )
-	try:
-		for line in f:
-			# print "in: " +line
-
-			# toss blank lines
-			if len(line) == 1:
-				continue
-
-			asciiLine = unicodedata.normalize('NFKD', line).encode('ascii','ignore')
-			line = asciiLine
-
-			for il in importList:
-				if line.find(il) != -1:
-					output( "from %s import *" % (il) )
-					importList.remove(il)	# already got it
-
-	finally:
-		output("")
-		f.close()
-
-
-def initImportList ():
-	global importList
-	
-	importList = [ \
-		'triangle'	,\
-		'setmask'	,\
-		'parameterize'	,\
-		'setflowequation'	,\
-		'meshconvert'	,\
-		'solve'	,\
-		#'zeros'					# -> numpy
-		]
-	
-
-
-def convertToPython ( inFile, outFile = sys.stdout ):
-    #print ' in cnvrt to python w/ file:' + inFile
+    global indentLevel
+
+    output("")
+
+
+def genericImports():
+    output("from MatlabFuncs import * ")
+    output("from model import * ")
+    output("from EnumDefinitions import * ")
+    output("from numpy import * ")
+
+
+def createImports(inputFile):
+    genericImports()
+
+    # cycle through eachline to assertain import needs
+    f = codecs.open(inputFile, encoding='utf-8')
+    try:
+        for line in f:
+            # print "in: " + line
+
+            # toss blank lines
+            if len(line) == 1:
+                continue
+
+            asciiLine = unicodedata.normalize('NFKD', line).encode('ascii', 'ignore')
+            line = asciiLine
+
+            for il in importList:
+                if line.find(il) != -1:
+                    output("from %s import * " % (il))
+                    importList.remove(il)    # already got it
+
+    finally:
+        output("")
+        f.close()
+
+
+def initImportList():
+    global importList
+
+    importList = ['triangle',
+                  'setmask',
+                  'parameterize',
+                  'setflowequation',
+                  'meshconvert',
+                  'solve']
+
+
+def convertToPython(inFile, outFile=sys.stdout):
+    #print ' in cnvrt to python w / file:' + inFile
     initImportList()
-    setupOutputLocation( outFile )
-    outputTopOfSript( inFile )
-    createImports( inFile )
-    translateFile( inFile )
+    setupOutputLocation(outFile)
+    outputTopOfSript(inFile)
+    createImports(inFile)
+    translateFile(inFile)
     #    outputBottomOfScript()
 
-	
+
 if __name__ == "__main__":
-    #print ' in main w/ arg:' + sys.argv[1]+' '+sys.argv[2]
-    if len(sys.argv)==2:
-        convertToPython( sys.argv[1], sys.argv[2] )
+    #print ' in main w / arg:' + sys.argv[1] + ' ' + sys.argv[2]
+    if len(sys.argv) == 2:
+        convertToPython(sys.argv[1], sys.argv[2])
     else:
-        convertToPython( sys.argv[1] )
-
-
-
+        convertToPython(sys.argv[1])
Index: /issm/trunk/src/c/Makefile.am
===================================================================
--- /issm/trunk/src/c/Makefile.am	(revision 24312)
+++ /issm/trunk/src/c/Makefile.am	(revision 24313)
@@ -1,3 +1,4 @@
 AM_CPPFLAGS = @NEOPZINCL@ @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @AMPIINCL@ @ADJOINTMPIINCL@ @MEDIPACKINCL@ @MPIINCL@ @METISINCL@ @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@ @BLASLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ @TRIANGLEINCL@ @SPAIINCL@ @HYPREINCL@ @PROMETHEUSINCL@ @SUPERLUINCL@ @SPOOLESINCL@ @PASTIXINCL@ @MLINCL@ @TAOINCL@ @ADIC2INCL@ @ADOLCINCL@ @CODIPACKINCL@ @GSLINCL@ @BOOSTINCL@ @ANDROID_NDKINCL@ @METEOIOINCL@ @SNOWPACKINCL@ @PROJ4INCL@
+AM_FCFLAGS = @SEMICINCL@
 
 AUTOMAKE_OPTIONS = subdir-objects
@@ -53,6 +54,9 @@
 #do not include AmrBamg with AD
 if ADOLC
+issm_sources +=./shared/Numerics/isnan.cpp \
+					./shared/MemOps/MemOps.cpp
 else
 if CODIPACK
+issm_sources +=./shared/Numerics/isnan.cpp
 else
 issm_sources += ./classes/AmrBamg.cpp
@@ -73,5 +77,4 @@
 					./classes/Constraints/SpcTransient.cpp\
 					./classes/DependentObject.cpp\
-					./classes/DofIndexing.cpp\
 					./classes/Contours.cpp\
 					./classes/Vertices.cpp\
@@ -87,4 +90,5 @@
 					./classes/Vertex.cpp\
 					./classes/Hook.cpp\
+					./classes/Radar.cpp\
 					./classes/ExternalResults/Results.cpp\
 					./classes/Elements/Element.cpp\
@@ -111,8 +115,8 @@
 					./classes/Materials/Matlitho.cpp\
 					./classes/Materials/Matestar.cpp\
-					./classes/Materials/Matpar.cpp\
 					./classes/Constraints/Constraints.cpp\
 					./classes/Constraints/SpcStatic.cpp\
 					./classes/Constraints/SpcDynamic.cpp\
+					./classes/Loads/Channel.cpp\
 					./classes/Loads/Loads.cpp\
 					./classes/Loads/Penpair.cpp\
@@ -142,5 +146,4 @@
 					./classes/Params/DataSetParam.cpp\
 					./classes/Profiler.cpp\
-					./shared/MemOps/MemOps.cpp\
 					./shared/Matrix/MatrixUtils.cpp\
 					./shared/io/Disk/pfopen.cpp\
@@ -158,7 +161,7 @@
 					./shared/Numerics/GaussPoints.cpp\
 					./shared/Numerics/cross.cpp\
-					./shared/Numerics/isnan.cpp\
 					./shared/Numerics/cubic.cpp\
 					./shared/Numerics/NewtonSolveDnorm.cpp\
+					./shared/Numerics/ODE1.cpp\
 					./shared/Numerics/extrema.cpp\
 					./shared/Numerics/legendre.cpp\
@@ -172,4 +175,6 @@
 					./shared/Elements/Paterson.cpp\
 					./shared/Elements/Arrhenius.cpp\
+					./shared/Elements/NyeCO2.cpp\
+					./shared/Elements/NyeH2O.cpp\
 					./shared/Elements/LliboutryDuval.cpp \
 					./shared/Elements/PrintArrays.cpp\
@@ -206,5 +211,4 @@
 					./modules/NodesDofx/NodesDofx.cpp\
 					./modules/NodalValuex/NodalValuex.cpp\
-					./modules/VerticesDofx/VerticesDofx.cpp\
 					./modules/VertexCoordinatesx/VertexCoordinatesx.cpp\
 					./modules/OutputResultsx/OutputResultsx.cpp\
@@ -228,4 +232,5 @@
 					./modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp\
 					./modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp\
+					./modules/FrontalForcingsx/FrontalForcingsx.cpp\
 					./modules/ConfigureObjectsx/ConfigureObjectsx.cpp\
 					./modules/SpcNodesx/SpcNodesx.cpp\
@@ -238,5 +243,4 @@
 					./modules/ResetFSBasalBoundaryConditionx/ResetFSBasalBoundaryConditionx.cpp\
 					./modules/Solverx/Solverx.cpp\
-					./modules/VecMergex/VecMergex.cpp\
 					./modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp\
 					./cores/ProcessArguments.cpp\
@@ -292,5 +296,4 @@
 					./cores/control_core.cpp\
 					./cores/controltao_core.cpp\
-					./cores/controlad_core.cpp\
 					./cores/controlm1qn3_core.cpp\
 					./cores/controladm1qn3_core.cpp\
@@ -304,4 +307,5 @@
 					./solutionsequences/solutionsequence_hydro_nonlinear.cpp\
 					./solutionsequences/solutionsequence_shakti_nonlinear.cpp\
+					./solutionsequences/solutionsequence_glads_nonlinear.cpp\
 					./cores/stressbalance_core.cpp\
 					./solutionsequences/solutionsequence_stokescoupling_nonlinear.cpp\
@@ -351,5 +355,4 @@
 					./toolkits/petsc/patches/VecToMPISerial.cpp\
 					./toolkits/petsc/patches/MatToSerial.cpp\
-					./toolkits/petsc/patches/VecMerge.cpp\
 					./toolkits/petsc/patches/NewVec.cpp\
 					./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp\
@@ -438,4 +441,7 @@
 issm_sources += ./analyses/HydrologyPismAnalysis.cpp
 endif
+if HYDROLOGYGLADS
+issm_sources += ./analyses/HydrologyGlaDSAnalysis.cpp
+endif
 if HYDROLOGYDCINEFFICIENT
 issm_sources += ./analyses/HydrologyDCInefficientAnalysis.cpp
@@ -481,4 +487,5 @@
 issm_sources += ./analyses/LevelsetAnalysis.cpp
 issm_sources += ./modules/Calvingx/Calvingx.cpp
+issm_sources += ./modules/KillIcebergsx/KillIcebergsx.cpp
 endif
 if EXTRAPOLATION
@@ -522,4 +529,9 @@
 endif
 #}}}
+#Oceansources  {{{
+if OCEAN
+issm_sources +=  ./modules/OceanExchangeDatax/OceanExchangeDatax.cpp
+endif
+#}}}
 #Slr sources  {{{
 if SEALEVELRISE
@@ -538,5 +550,11 @@
 endif
 #}}}
-
+#SEMIC sources  {{{
+if SEMIC
+if FORTRAN
+issm_sources += ./modules/SurfaceMassBalancex/run_semic.f90
+endif
+endif
+#}}}
 #Wrapper sources
 #Kml sources  {{{
@@ -644,5 +662,5 @@
 if !WINDOWS
 if !STANDALONE_LIBRARIES
-libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(M1QN3LIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB)   $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
+libISSMCore_la_LIBADD = $(PETSCLIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB)   $(ADOLCLIB) $(AMPILIB) $(ADJOINTMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
 if FORTRAN
 libISSMCore_la_LIBADD += $(FLIBS) $(FORTRANLIB)
@@ -726,5 +744,5 @@
 
 #External packages
-LDADD +=  $(NEOPZLIB) $(TAOLIB) $(M1QN3LIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(PETSCLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB)  $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(AMPILIB) $(ADJOINTMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJ4LIB)
+LDADD +=  $(NEOPZLIB) $(TAOLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(SCALAPACKLIB) $(BLACSLIB) $(PETSCLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB)  $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB) $(AMPILIB) $(ADJOINTMPILIB) $(ADOLCLIB) $(MPILIB) $(METEOIOLIB) $(SNOWPACKLIB) $(PROJ4LIB)
 
 if FORTRAN
@@ -756,34 +774,3 @@
 issm_dakota_LDADD= $(LDADD)
 endif
-
-#}}}
-#Automatic differentiation (must be done at the end) {{{
-if ADIC2 
-if !WINDOWS
-lib_LTLIBRARIES += libAD.la libISSMRose.la
-else
-noinst_LTLIBRARIES += libAD.la libISSMRose.la
-endif
-
-#ADIC2 library, for automatic differentiation 
-#libAD_a_SOURCES = ./mini1.ad.c
-libAD_la_SOURCES = 
-libAD_la_CFLAGS = -D_C_ -fPIC $(COPTFLAGS)
-
-#test rose preprocessing 
-%.r2cpp.cpp : %.cpp
-	testTranslator -rose:o $@ -rose:skipfinalCompileStep -DHAVE_CONFIG_H -D_C_ -I. -I../.. $(INCLUDES) $<
-libISSMRose_la_SOURCES = $(libISSMCore_a_SOURCES:.cpp=.r2cpp.cpp)
-libISSMRose_la_CXXFLAGS= -D_C_ $(CXXOPTFLAGS)
-
-#Automatic differentiation rules: 
-%.ad.c: %.c
-	adic2 -mforward  $< --nary
-
-#Executable
-bin_PROGRAMS +=  issmRose.exe
-issmRose_exe_LDADD = ./libISSMRose.a $(LDADD)
-issmRose_exe_SOURCES = main/issm.cpp
-issmRose_exe_CXXFLAGS= $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS) 
-LDADD +=  $(ADIC2LIB) 
-endif #}}}
+#}}}
Index: /issm/trunk/src/c/analyses/AdjointBalancethickness2Analysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 24313)
@@ -12,5 +12,5 @@
 	_error_("not implemented yet");
 }/*}}}*/
-void AdjointBalancethickness2Analysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void AdjointBalancethickness2Analysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 	_error_("not implemented yet");
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/AdjointBalancethickness2Analysis.h
===================================================================
--- /issm/trunk/src/c/analyses/AdjointBalancethickness2Analysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/AdjointBalancethickness2Analysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/AdjointBalancethicknessAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 24313)
@@ -12,5 +12,5 @@
 	_error_("not implemented yet");
 }/*}}}*/
-void AdjointBalancethicknessAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void AdjointBalancethicknessAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 	_error_("not implemented yet");
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/AdjointBalancethicknessAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/AdjointBalancethicknessAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/AdjointBalancethicknessAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/AdjointHorizAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 24313)
@@ -12,5 +12,5 @@
 	   _error_("not implemented yet");
 }/*}}}*/
-void AdjointHorizAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void AdjointHorizAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 	   _error_("not implemented yet");
 }/*}}}*/
@@ -56,4 +56,7 @@
 ElementMatrix* AdjointHorizAnalysis::CreateKMatrixFS(Element* element){/*{{{*/
 
+	/* Check if ice in element */
+	if(!element->IsIceInElement()) return NULL;
+
 	/*Intermediaries */
 	bool        incomplete_adjoint;
@@ -144,4 +147,7 @@
 }/*}}}*/
 ElementMatrix* AdjointHorizAnalysis::CreateKMatrixHO(Element* element){/*{{{*/
+	
+	/* Check if ice in element */
+	if(!element->IsIceInElement()) return NULL;
 
 	/*Intermediaries */
@@ -553,4 +559,7 @@
 					/*Nothing in P vector*/
 					break;
+				case RheologyBInitialguessMisfitEnum:
+					/*Nothing in P vector*/
+					break;
 				default:
 					_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
@@ -788,4 +797,7 @@
 					/*Nothing in P vector*/
 					break;
+				case RheologyBInitialguessMisfitEnum:
+					/*Nothing in P vector*/
+					break;
 				default:
 					_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
@@ -1036,4 +1048,7 @@
 					/*Nothing in P vector*/
 					break;
+				case RheologyBInitialguessMisfitEnum:
+					/*Nothing in P vector*/
+					break;
 				default:
 					_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
@@ -1097,4 +1112,5 @@
 		case RheologyBbarAbsGradientEnum:    GradientJBbarGradient(element,gradient,control_index); break;
 		case RheologyBAbsGradientEnum:       GradientJBGradient(element,gradient,control_index);    break;
+		case RheologyBInitialguessMisfitEnum:  GradientJBinitial(element,gradient,control_index);    break;
 		default: _error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
 	}
@@ -1398,4 +1414,68 @@
 	delete gauss;
 }/*}}}*/
+void           AdjointHorizAnalysis::GradientJBinitial(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+
+	/*Intermediaries*/
+	int      domaintype;
+
+	/*Get basal element*/
+	element->FindParam(&domaintype,DomainTypeEnum);
+	switch(domaintype){
+		case Domain2DhorizontalEnum:
+			break;
+		case Domain2DverticalEnum:
+			break;
+		case Domain3DEnum:
+			break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
+
+	/*Intermediaries*/
+	IssmDouble Jdet,weight;
+	IssmDouble B,B0; 
+	IssmDouble *xyz_list= NULL;
+
+	/*Fetch number of vertices for this finite element*/
+	int numvertices = element->GetNumberOfVertices();
+
+	/*Initialize some vectors*/
+	IssmDouble* basis        = xNew<IssmDouble>(numvertices);
+	IssmDouble* ge           = xNewZeroInit<IssmDouble>(numvertices);
+	int*        vertexpidlist = xNew<int>(numvertices);
+
+	/*Retrieve all inputs we will be needing: */
+	element->GetVerticesCoordinates(&xyz_list);
+	element->GradientIndexing(&vertexpidlist[0],control_index);
+	Input* rheology_input  = element->GetInput(MaterialsRheologyBbarEnum);              _assert_(rheology_input);
+	Input* rheology0_input = element->GetInput(RheologyBInitialguessEnum);              _assert_(rheology0_input);
+	Input* weights_input   = element->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss=element->NewGauss(2);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+		gauss->GaussPoint(ig);
+		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
+		element->NodalFunctionsP1(basis,gauss);
+		weights_input->GetInputValue(&weight,gauss,RheologyBInitialguessMisfitEnum);
+
+		/*Build alpha_complement_list: */
+		rheology_input->GetInputValue(&B,gauss);
+		rheology0_input->GetInputValue(&B0,gauss);
+
+		/*Build gradje_g_gaussian vector (actually -dJ/ddrag): */
+		for(int i=0;i<numvertices;i++){
+			ge[i]+=-weight*Jdet*gauss->weight*basis[i]*(B-B0);
+			_assert_(!xIsNan<IssmDouble>(ge[i]));
+		}
+	}
+	gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
+
+	/*Clean up and return*/
+	xDelete<IssmDouble>(xyz_list);
+	xDelete<IssmDouble>(basis);
+	xDelete<IssmDouble>(ge);
+	xDelete<int>(vertexpidlist);
+	delete gauss;
+}/*}}}*/
 void           AdjointHorizAnalysis::GradientJBHO(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
 	/*Intermediaries*/
@@ -2335,6 +2415,6 @@
 
 	/*Get dof list: */
-	element->GetDofListVelocity(&vdoflist,GsetEnum);
-	element->GetDofListPressure(&pdoflist,GsetEnum);
+	element->GetDofListLocalVelocity(&vdoflist,GsetEnum);
+	element->GetDofListLocalPressure(&pdoflist,GsetEnum);
 
 	/*Use the dof list to index into the solution vector: */
@@ -2401,5 +2481,5 @@
 	else			                          numdof   = numnodes*1;
 	/*Fetch dof list and allocate solution vectors*/
-	element->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
 	IssmDouble* values  = xNew<IssmDouble>(numdof);
 	IssmDouble* lambdax = xNew<IssmDouble>(numnodes);
Index: /issm/trunk/src/c/analyses/AdjointHorizAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/AdjointHorizAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/AdjointHorizAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
@@ -38,4 +38,5 @@
 		void           GradientJBbarFS(Element* element,Vector<IssmDouble>* gradient,int control_index);
 		void           GradientJBbarGradient(Element* element,Vector<IssmDouble>* gradient,int control_index);
+		void           GradientJBinitial(Element* element,Vector<IssmDouble>* gradient,int control_index);
 		void           GradientJBbarL1L2(Element* element,Vector<IssmDouble>* gradient,int control_index);
 		void           GradientJBbarHO(Element* element,Vector<IssmDouble>* gradient,int control_index);
Index: /issm/trunk/src/c/analyses/Analysis.h
===================================================================
--- /issm/trunk/src/c/analyses/Analysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/Analysis.h	(revision 24313)
@@ -36,5 +36,5 @@
 		virtual void CreateConstraints(Constraints* constraints,IoModel* iomodel)=0;
 		virtual void CreateLoads(Loads* loads, IoModel* iomodel)=0;
-		virtual void CreateNodes(Nodes* nodes,IoModel* iomodel)=0;
+		virtual void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false)=0;
 		virtual int  DofsPerNode(int** doflist,int domaintype,int approximation)=0;
 		virtual void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type)=0;
Index: /issm/trunk/src/c/analyses/Balancethickness2Analysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/Balancethickness2Analysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/Balancethickness2Analysis.cpp	(revision 24313)
@@ -15,5 +15,5 @@
 
 }/*}}}*/
-void Balancethickness2Analysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void Balancethickness2Analysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	int finiteelement = P1Enum;
Index: /issm/trunk/src/c/analyses/Balancethickness2Analysis.h
===================================================================
--- /issm/trunk/src/c/analyses/Balancethickness2Analysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/Balancethickness2Analysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/BalancethicknessAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/BalancethicknessAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/BalancethicknessAnalysis.cpp	(revision 24313)
@@ -44,5 +44,5 @@
 
 			/* Add load */
-			loads->AddObject(new Numericalflux(iomodel->loadcounter+i+1,i,i,iomodel,BalancethicknessAnalysisEnum));
+			loads->AddObject(new Numericalflux(i+1,i,i,iomodel));
 		}
 
@@ -51,5 +51,5 @@
 	}
 }/*}}}*/
-void BalancethicknessAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void BalancethicknessAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	int  stabilization;
Index: /issm/trunk/src/c/analyses/BalancethicknessAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/BalancethicknessAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/BalancethicknessAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/BalancethicknessSoftAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/BalancethicknessSoftAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/BalancethicknessSoftAnalysis.cpp	(revision 24313)
@@ -15,5 +15,5 @@
 	   _error_("not implemented yet");
 }/*}}}*/
-void BalancethicknessSoftAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void BalancethicknessSoftAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 	   _error_("not implemented yet");
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/BalancethicknessSoftAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/BalancethicknessSoftAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/BalancethicknessSoftAnalysis.h	(revision 24313)
@@ -16,5 +16,5 @@
 		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
Index: /issm/trunk/src/c/analyses/BalancevelocityAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/BalancevelocityAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/BalancevelocityAnalysis.cpp	(revision 24313)
@@ -15,5 +15,5 @@
 	/*No loads*/
 }/*}}}*/
-void BalancevelocityAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void BalancevelocityAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	/*Check in 3d*/
Index: /issm/trunk/src/c/analyses/BalancevelocityAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/BalancevelocityAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/BalancevelocityAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/DamageEvolutionAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 24313)
@@ -30,5 +30,5 @@
 
 }/*}}}*/
-void DamageEvolutionAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void DamageEvolutionAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	int finiteelement;
@@ -60,4 +60,14 @@
 	iomodel->DeleteData(1,"md.flowequation.element_equation");
 
+   /*First, reset all F to 0 */
+	for(int i=0;i<elements->Size();i++){
+		Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
+		int numvertices = element->GetNumberOfVertices();
+		IssmDouble* values = xNewZeroInit<IssmDouble>(numvertices);
+		element->AddInput(DamageFEnum,values,P1Enum);
+		xDelete<IssmDouble>(values);
+	}
+
+
 	/*What input do I need to run my damage evolution model?*/
 	iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum);
@@ -97,5 +107,7 @@
 		parameters->AddObject(iomodel->CopyConstantObject("md.damage.c2",DamageC2Enum));
 		parameters->AddObject(iomodel->CopyConstantObject("md.damage.c3",DamageC3Enum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.damage.c4",DamageC4Enum));
 		parameters->AddObject(iomodel->CopyConstantObject("md.damage.stress_threshold",DamageStressThresholdEnum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.damage.stress_ubound",DamageStressUBoundEnum));
 		parameters->AddObject(iomodel->CopyConstantObject("md.damage.kappa",DamageKappaEnum));
 		parameters->AddObject(iomodel->CopyConstantObject("md.damage.healing",DamageHealingEnum));
@@ -130,4 +142,89 @@
 	xDelete<IssmDouble>(f);
 }/*}}}*/
+void           DamageEvolutionAnalysis::CreateDamageFInputArctan(Element* element){/*{{{*/
+	IssmDouble c1, c2, stress_threshold, stress_ubound;
+	IssmDouble damage;
+	IssmDouble yts;
+	IssmDouble principalDevStress1, principalDevStress2;
+	IssmDouble tensileStress, compressiveStress;
+	
+	int equivstress, domaintype, dim;
+
+	/*Fetch number of vertices and allocate output*/
+	int numnodes = element->GetNumberOfNodes();
+	IssmDouble* f   = xNew<IssmDouble>(numnodes);
+
+	/*retrieve parameters:*/
+	element->FindParam(&c1,DamageC1Enum);
+	element->FindParam(&c2,DamageC2Enum);
+	element->FindParam(&yts,ConstantsYtsEnum);
+	element->FindParam(&stress_threshold,DamageStressThresholdEnum);
+	element->FindParam(&stress_ubound,DamageStressUBoundEnum);
+	element->FindParam(&domaintype,DomainTypeEnum);
+
+	/*Get problem dimension*/
+	switch(domaintype){
+		case Domain2DhorizontalEnum: dim = 2; break;
+		case Domain3DEnum:           dim = 3; break;
+		default: _error_("not implemented");
+	}
+	/*Compute stress tensor and Stress Max Principal: */
+	element->ComputeDeviatoricStressTensor();
+
+	Input* principalDevStress1_input = element->GetInput(DeviatoricStress1Enum);     _assert_(principalDevStress1_input);
+	Input* principalDevStress2_input = element->GetInput(DeviatoricStress2Enum);     _assert_(principalDevStress2_input);
+
+	Input* damage_input = NULL;
+	if(domaintype==Domain2DhorizontalEnum){
+		damage_input = element->GetInput(DamageDbarEnum); 	_assert_(damage_input);
+	}
+	else{
+		damage_input = element->GetInput(DamageDEnum);   _assert_(damage_input);
+	}
+
+	/*Calculate damage evolution source term */
+	Gauss* gauss=element->NewGauss();
+
+	/* To keep arctan output (bounded by -pi/2 and pi/2) within the specified boundaries */
+	c1 /= (PI/2);
+	c2 /= (PI/2);
+	/* To have per second output with per annum parameters */
+	c1 /= yts;
+	c2 /= yts;
+
+	for (int i=0;i<numnodes;i++){
+		f[i] = 0;
+		
+		gauss->GaussNode(element->GetElementType(),i);
+
+		damage_input->GetInputValue(&damage,gauss);
+		principalDevStress1_input->GetInputValue(&principalDevStress1,gauss);
+		principalDevStress2_input->GetInputValue(&principalDevStress2,gauss);
+
+		tensileStress     = sqrt(1.5*(pow(max(principalDevStress1, 0.), 2) + pow(max(principalDevStress2, 0.), 2)));
+		compressiveStress = sqrt(1.5*(pow(min(principalDevStress1, 0.), 2) + pow(min(principalDevStress2, 0.), 2)));
+
+		/* Calculate principal effective stresses */
+		if(dim==2){
+			f[i] = 0;
+			if(tensileStress > stress_threshold)
+				f[i] += c1*atan((tensileStress/stress_threshold - 1)/(1-damage));
+
+			if(compressiveStress < stress_ubound)
+				f[i] += c2*atan((compressiveStress/stress_ubound - 1)/(1-damage));
+		}
+		else{
+			_error_("Only 2D is implemented.");
+		}
+	}
+
+	/*Add input*/
+	element->AddInput(DamageFEnum,f,element->GetElementType());
+
+	/*Clean up and return*/
+	xDelete<IssmDouble>(f);
+	delete gauss;
+}/*}}}*/
+
 void           DamageEvolutionAnalysis::CreateDamageFInputExp(Element* element){/*{{{*/
 
@@ -191,4 +288,8 @@
 		}
 		else f[i]=0;
+
+		/*Edits from MM*/
+		if(f[i]>10.) f[i]=10.;
+		if(f[i]<-10.) f[i]=-10.;
 	}
 
@@ -358,4 +459,5 @@
 	element->GetVerticesCoordinates(&xyz_list);
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
+	//printf("dt %f\n", dt);
 	element->FindParam(&stabilization,DamageStabilizationEnum);
 	Input* vx_input = element->GetInput(VxEnum); _assert_(vx_input);
@@ -447,5 +549,5 @@
 				D[1*dim+1]=h/2.0*fabs(vy);
 			}
-			else if(dim==3){ 
+			else if(dim==3){
 				element->ElementSizes(&hx,&hy,&hz);
 				vel=sqrt(vx*vx + vy*vy + vz*vz)+1.e-14;
@@ -525,4 +627,7 @@
 			this->CreateDamageFInputExp(element);
 			break;
+		case 3:
+			this->CreateDamageFInputArctan(element);
+			break;
 		default:
 			_error_("not implemented yet");
@@ -560,7 +665,7 @@
 }/*}}}*/
 void           DamageEvolutionAnalysis::GetB(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
-	/*Compute B  matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. 
+	/*Compute B  matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2.
 	 * For node i, Bi can be expressed in the actual coordinate system
-	 * by: 
+	 * by:
 	 *       Bi=[ N ]
 	 *          [ N ]
@@ -588,7 +693,7 @@
 }/*}}}*/
 void           DamageEvolutionAnalysis::GetBprime(IssmDouble* Bprime,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
-	/*Compute B'  matrix. B'=[B1' B2' B3'] where Bi' is of size 3*NDOF2. 
+	/*Compute B'  matrix. B'=[B1' B2' B3'] where Bi' is of size 3*NDOF2.
 	 * For node i, Bi' can be expressed in the actual coordinate system
-	 * by: 
+	 * by:
 	 *       Bi_prime=[ dN/dx ]
 	 *                [ dN/dy ]
@@ -624,19 +729,14 @@
 void           DamageEvolutionAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
 
-	int domaintype;
-	IssmDouble  max_damage;
-	int			*doflist = NULL;
-
-	element->FindParam(&domaintype,DomainTypeEnum);
-
 	/*Fetch number of nodes and dof for this finite element*/
 	int numnodes = element->GetNumberOfNodes();
 
 	/*Fetch dof list and allocate solution vector*/
-	element->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+	int *doflist = NULL;
+	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
 	IssmDouble* newdamage = xNew<IssmDouble>(numnodes);
 
 	/*Get user-supplied max_damage: */
-	element->FindParam(&max_damage,DamageMaxDamageEnum);
+	IssmDouble max_damage = element->FindParam(DamageMaxDamageEnum);
 
 	/*Use the dof list to index into the solution vector: */
@@ -652,4 +752,6 @@
 
 	/*Get all inputs and parameters*/
+	int domaintype;
+	element->FindParam(&domaintype,DomainTypeEnum);
 	if(domaintype==Domain2DhorizontalEnum){
 		element->AddInput(DamageDbarEnum,newdamage,element->GetElementType());
@@ -792,11 +894,7 @@
 void           DamageEvolutionAnalysis::LumpedMassMatrix(Vector<IssmDouble>** pMlff,FemModel* femmodel){/*{{{*/
 
-	/*Intermediaries*/
-	int  configuration_type;
-
 	/*Initialize Lumped mass matrix (actually we just save its diagonal)*/
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
-	int fsize      = femmodel->nodes->NumberOfDofs(configuration_type,FsetEnum);
-	int flocalsize = femmodel->nodes->NumberOfDofsLocal(configuration_type,FsetEnum);
+	int fsize      = femmodel->nodes->NumberOfDofs(FsetEnum);
+	int flocalsize = femmodel->nodes->NumberOfDofsLocal(FsetEnum);
 	Vector<IssmDouble>* Mlff = new Vector<IssmDouble>(flocalsize,fsize);
 
Index: /issm/trunk/src/c/analyses/DamageEvolutionAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/DamageEvolutionAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/DamageEvolutionAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
@@ -23,4 +23,5 @@
 		void           Core(FemModel* femmodel);
 		void           CreateDamageFInput(Element* element);
+		void           CreateDamageFInputArctan(Element* element);
 		void           CreateDamageFInputExp(Element* element);
 		void           CreateDamageFInputPralong(Element* element);
Index: /issm/trunk/src/c/analyses/DepthAverageAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/DepthAverageAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/DepthAverageAnalysis.cpp	(revision 24313)
@@ -10,5 +10,5 @@
 void DepthAverageAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
 }/*}}}*/
-void DepthAverageAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void DepthAverageAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	::CreateNodes(nodes,iomodel,DepthAverageAnalysisEnum,P1Enum);
Index: /issm/trunk/src/c/analyses/DepthAverageAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/DepthAverageAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/DepthAverageAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/EnthalpyAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/EnthalpyAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/EnthalpyAnalysis.cpp	(revision 24313)
@@ -87,5 +87,5 @@
 	/*No loads */
 }/*}}}*/
-void EnthalpyAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void EnthalpyAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	int finiteelement;
@@ -198,6 +198,8 @@
 			iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum);
 			iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum);
-			if (FrictionCoupling==1){
-				iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum);
+			if (FrictionCoupling==3){
+				iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum);}
+			else if(FrictionCoupling==4){
+				iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",EffectivePressureEnum);
 			}
 			break;
@@ -211,6 +213,8 @@
 			iomodel->FetchDataToInput(elements,"md.friction.As",FrictionAsEnum);
 			iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum);
-			if (FrictionCoupling==1){
-				iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum);
+			if (FrictionCoupling==3){
+				iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum);}
+			else if(FrictionCoupling==4){
+				iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",EffectivePressureEnum);
 			}
 			break;
@@ -221,4 +225,5 @@
 			iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum);
 			iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum);
+			iomodel->FindConstant(&FrictionCoupling,"md.friction.coupling");
 			break;
 		case 5:
@@ -240,6 +245,8 @@
 			iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum);
 			iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum);
-			if (FrictionCoupling==1){
-				iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum);
+			if (FrictionCoupling==3){
+				iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum);}
+			else if(FrictionCoupling==4){
+				iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",EffectivePressureEnum);
 			}
 			break;
@@ -268,4 +275,6 @@
 	parameters->AddObject(iomodel->CopyConstantObject("md.thermal.isenthalpy",ThermalIsenthalpyEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.thermal.isdynamicbasalspc",ThermalIsdynamicbasalspcEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.thermal.isdrainicecolumn",ThermalIsdrainicecolumnEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.thermal.watercolumn_upperlimit",ThermalWatercolumnUpperlimitEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.friction.law",FrictionLawEnum));
 
@@ -383,8 +392,8 @@
 	else enthalpy_enum=EnthalpyEnum;
 
-	IssmDouble latentheat = element->GetMaterialParameter(MaterialsLatentheatEnum);
-	IssmDouble rho_ice    = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble rho_water  = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-	IssmDouble beta		 = element->GetMaterialParameter(MaterialsBetaEnum);
+	IssmDouble latentheat = element->FindParam(MaterialsLatentheatEnum);
+	IssmDouble rho_ice    = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble rho_water  = element->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble beta		 = element->FindParam(MaterialsBetaEnum);
 	IssmDouble kappa		 = EnthalpyDiffusionParameterVolume(element,enthalpy_enum);     _assert_(kappa>=0.);
 	IssmDouble kappa_mix;
@@ -405,5 +414,5 @@
 	element->VerticalSegmentIndicesBase(&pairindices,&numsegments);
 	IssmDouble* meltingrate_enthalpy = xNew<IssmDouble>(numsegments);
-	IssmDouble* heating = xNew<IssmDouble>(numsegments);	
+	IssmDouble* heating = xNew<IssmDouble>(numsegments);
 
 	numnodes=element->GetNumberOfNodes();
@@ -417,4 +426,6 @@
 	element->GetInputListOnNodes(basalmeltingrates,BasalforcingsGroundediceMeltingRateEnum);
 
+	IssmDouble watercolumnupperlimit = element->FindParam(ThermalWatercolumnUpperlimitEnum);
+	
 	Gauss* gauss=element->NewGauss();
 	for(is=0;is<numsegments;is++){
@@ -429,6 +440,6 @@
 				for(i=0;i<3;i++) vec_heatflux[i]=0.;
 				break;
-			case 1: case 2: case 3: 
-				// case 1 : cold, wet base: keep at pressure melting point 
+			case 1: case 2: case 3:
+				// case 1 : cold, wet base: keep at pressure melting point
 				// case 2: temperate, thin refreezing base: release spc
 				// case 3: temperate, thin melting base: set spc
@@ -467,5 +478,5 @@
 		nodeup   = pairindices[is*2+1];
 		if(dt!=0.){
-			if(watercolumns[nodedown]+meltingrate_enthalpy[is]*dt<0.){	// prevent too much freeze on			
+			if(watercolumns[nodedown]+meltingrate_enthalpy[is]*dt<0.){	// prevent too much freeze on
 				lambda = -watercolumns[nodedown]/(dt*meltingrate_enthalpy[is]); _assert_(lambda>=0.); _assert_(lambda<1.);
 				watercolumns[nodedown]=0.;
@@ -475,6 +486,7 @@
 			else{
 				basalmeltingrates[nodedown]=meltingrate_enthalpy[is];
-				watercolumns[nodedown]+=dt*meltingrate_enthalpy[is]; 
+				watercolumns[nodedown]+=dt*meltingrate_enthalpy[is];
 			}
+			if(watercolumns[nodedown]>watercolumnupperlimit) watercolumns[nodedown]=watercolumnupperlimit;
 		}
 		else{
@@ -484,5 +496,5 @@
 			else
 				watercolumns[nodedown]+=meltingrate_enthalpy[is];
-		}	
+		}
 		basalmeltingrates[nodedown]*=rho_water/rho_ice; // convert meltingrate from water to ice equivalent
 		_assert_(watercolumns[nodedown]>=0.);
@@ -491,5 +503,5 @@
 	/*feed updated variables back into model*/
 	if(dt!=0.){
-		element->AddInput(enthalpy_enum,enthalpies,element->GetElementType()); 
+		element->AddInput(enthalpy_enum,enthalpies,element->GetElementType());
 		element->AddInput(WatercolumnEnum,watercolumns,element->GetElementType());
 	}
@@ -560,4 +572,5 @@
 	IssmDouble  h,hx,hy,hz,vx,vy,vz;
 	IssmDouble  tau_parameter,diameter;
+	IssmDouble  tau_parameter_anisotropic[2],tau_parameter_hor,tau_parameter_ver;	
 	IssmDouble  D_scalar;
 	IssmDouble* xyz_list = NULL;
@@ -577,9 +590,9 @@
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
 	element->FindParam(&stabilization,ThermalStabilizationEnum);
-	IssmDouble  rho_water           = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  gravity             = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble  thermalconductivity = element->GetMaterialParameter(MaterialsThermalconductivityEnum);
+	IssmDouble  rho_water           = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  gravity             = element->FindParam(ConstantsGEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble  thermalconductivity = element->FindParam(MaterialsThermalconductivityEnum);
 	Input* vx_input  = element->GetInput(VxEnum);     _assert_(vx_input);
 	Input* vy_input  = element->GetInput(VyEnum);     _assert_(vy_input);
@@ -588,5 +601,4 @@
 	Input* vym_input = element->GetInput(VyMeshEnum); _assert_(vym_input);
 	Input* vzm_input = element->GetInput(VzMeshEnum); _assert_(vzm_input);
-	if(stabilization==2) diameter=element->MinEdgeLength(xyz_list);
 
 	/*Enthalpy diffusion parameter*/
@@ -647,5 +659,5 @@
 			for(int i=0;i<3;i++) for(int j=0;j<3;j++) K[i][j] = D_scalar*K[i][j];
 
-			GetBAdvecprime(Bprime,element,xyz_list,gauss); 
+			GetBAdvecprime(Bprime,element,xyz_list,gauss);
 			TripleMultiply(Bprime,3,numnodes,1,
 						&K[0][0],3,3,0,
@@ -653,11 +665,14 @@
 						&Ke->values[0],1);
 		}
+		/*SUPG*/
 		else if(stabilization==2){
 			element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+			diameter=element->MinEdgeLength(xyz_list);			
 			tau_parameter=element->StabilizationParameter(u-um,v-vm,w-wm,diameter,kappa/rho_ice);
 			for(int i=0;i<numnodes;i++){
 				for(int j=0;j<numnodes;j++){
 					Ke->values[i*numnodes+j]+=tau_parameter*D_scalar*
-					  ((u-um)*dbasis[0*numnodes+i]+(v-vm)*dbasis[1*numnodes+i]+(w-wm)*dbasis[2*numnodes+i])*((u-um)*dbasis[0*numnodes+j]+(v-vm)*dbasis[1*numnodes+j]+(w-wm)*dbasis[2*numnodes+j]);
+					  ((u-um)*dbasis[0*numnodes+i]+(v-vm)*dbasis[1*numnodes+i]+(w-wm)*dbasis[2*numnodes+i])*
+					  ((u-um)*dbasis[0*numnodes+j]+(v-vm)*dbasis[1*numnodes+j]+(w-wm)*dbasis[2*numnodes+j]);
 				}
 			}
@@ -671,4 +686,19 @@
 			}
 		}
+		/*anisotropic SUPG*/
+		else if(stabilization==3){
+			element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+			element->ElementSizes(&hx,&hy,&hz);                      
+			element->StabilizationParameterAnisotropic(&tau_parameter_anisotropic[0],u-um,v-vm,w-wm,hx,hy,hz,kappa/rho_ice);
+			tau_parameter_hor=tau_parameter_anisotropic[0];
+			tau_parameter_ver=tau_parameter_anisotropic[1];
+			for(int i=0;i<numnodes;i++){
+				for(int j=0;j<numnodes;j++){
+					Ke->values[i*numnodes+j]+=D_scalar*
+						(sqrt(tau_parameter_hor)*(u-um)*dbasis[0*numnodes+i]+sqrt(tau_parameter_hor)*(v-vm)*dbasis[1*numnodes+i]+sqrt(tau_parameter_ver)*(w-wm)*dbasis[2*numnodes+i])*
+						(sqrt(tau_parameter_hor)*(u-um)*dbasis[0*numnodes+j]+sqrt(tau_parameter_hor)*(v-vm)*dbasis[1*numnodes+j]+sqrt(tau_parameter_ver)*(w-wm)*dbasis[2*numnodes+j]);
+				}
+			}
+		}
 	}
 
@@ -703,10 +733,10 @@
 	element->GetVerticesCoordinatesBase(&xyz_list_base);
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
-	IssmDouble  gravity             = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  rho_water           = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble  mixed_layer_capacity= element->GetMaterialParameter(MaterialsMixedLayerCapacityEnum);
-	IssmDouble  thermal_exchange_vel= element->GetMaterialParameter(MaterialsThermalExchangeVelocityEnum);
+	IssmDouble  gravity             = element->FindParam(ConstantsGEnum);
+	IssmDouble  rho_water           = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble  mixed_layer_capacity= element->FindParam(MaterialsMixedLayerCapacityEnum);
+	IssmDouble  thermal_exchange_vel= element->FindParam(MaterialsThermalExchangeVelocityEnum);
 
 	/* Start  looping on the number of gaussian points: */
@@ -762,5 +792,6 @@
 	IssmDouble  pressure, d1pressure[3], d2pressure;
 	IssmDouble  waterfractionpicard;
-	IssmDouble  kappa,tau_parameter,diameter,kappa_w;
+	IssmDouble  kappa,tau_parameter,diameter,hx,hy,hz,kappa_w;
+	IssmDouble  tau_parameter_anisotropic[2],tau_parameter_hor,tau_parameter_ver;
 	IssmDouble  u,v,w;
 	IssmDouble  scalar_def, scalar_sens ,scalar_transient;
@@ -779,10 +810,10 @@
 	/*Retrieve all inputs and parameters*/
 	element->GetVerticesCoordinates(&xyz_list);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble  thermalconductivity = element->GetMaterialParameter(MaterialsThermalconductivityEnum);
-	IssmDouble  temperateiceconductivity = element->GetMaterialParameter(MaterialsTemperateiceconductivityEnum);
-	IssmDouble  beta                = element->GetMaterialParameter(MaterialsBetaEnum);
-	IssmDouble  latentheat          = element->GetMaterialParameter(MaterialsLatentheatEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble  thermalconductivity = element->FindParam(MaterialsThermalconductivityEnum);
+	IssmDouble  temperateiceconductivity = element->FindParam(MaterialsTemperateiceconductivityEnum);
+	IssmDouble  beta                = element->FindParam(MaterialsBetaEnum);
+	IssmDouble  latentheat          = element->FindParam(MaterialsLatentheatEnum);
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
 	element->FindParam(&stabilization,ThermalStabilizationEnum);
@@ -794,8 +825,4 @@
 	Input* enthalpy_input=NULL;
 	if(reCast<bool,IssmDouble>(dt)){enthalpy_input = element->GetInput(EnthalpyEnum); _assert_(enthalpy_input);}
-	if(stabilization==2){
-		diameter=element->MinEdgeLength(xyz_list);
-		kappa=this->EnthalpyDiffusionParameterVolume(element,EnthalpyPicardEnum); _assert_(kappa>=0.);
-	}
 
 	/* Start  looping on the number of gaussian points: */
@@ -833,5 +860,5 @@
 			if(dt!=0.) scalar_sens=scalar_sens*dt;
 			for(i=0;i<numnodes;i++) pe->values[i]+=scalar_sens*basis[i];
-		}		
+		}
 
 		/* Build transient now */
@@ -841,8 +868,10 @@
 			for(i=0;i<numnodes;i++) pe->values[i]+=scalar_transient*basis[i];
 		}
-
+		
+		/* SUPG */
 		if(stabilization==2){
 			element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
-
+			diameter=element->MinEdgeLength(xyz_list);
+			kappa=this->EnthalpyDiffusionParameterVolume(element,EnthalpyPicardEnum); _assert_(kappa>=0.);
 			vx_input->GetInputValue(&u,gauss);
 			vy_input->GetInputValue(&v,gauss);
@@ -855,4 +884,18 @@
 				for(i=0;i<numnodes;i++) pe->values[i]+=tau_parameter*scalar_transient*(u*dbasis[0*numnodes+i]+v*dbasis[1*numnodes+i]+w*dbasis[2*numnodes+i]);
 			}
+		}
+		/* anisotropic SUPG */
+		else if(stabilization==3){
+			element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+			element->ElementSizes(&hx,&hy,&hz);
+			kappa=this->EnthalpyDiffusionParameterVolume(element,EnthalpyPicardEnum); _assert_(kappa>=0.);
+                        vx_input->GetInputValue(&u,gauss);
+                        vy_input->GetInputValue(&v,gauss);
+                        vz_input->GetInputValue(&w,gauss);
+                        element->StabilizationParameterAnisotropic(&tau_parameter_anisotropic[0],u,v,w,hx,hy,hz,kappa/rho_ice);
+                        tau_parameter_hor=tau_parameter_anisotropic[0];
+                        tau_parameter_ver=tau_parameter_anisotropic[1];
+                        
+                        for(i=0;i<numnodes;i++) pe->values[i]+=scalar_def*(tau_parameter_hor*u*dbasis[0*numnodes+i]+tau_parameter_hor*v*dbasis[1*numnodes+i]+tau_parameter_ver*w*dbasis[2*numnodes+i]);
 		}
 	}
@@ -905,5 +948,5 @@
 	Input* meltingrate_input	 = element->GetInput(BasalforcingsGroundediceMeltingRateEnum);							 _assert_(meltingrate_input);
 	Input* geothermalflux_input = element->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input);
-	IssmDouble  rho_ice			 = element->GetMaterialParameter(MaterialsRhoIceEnum);
+	IssmDouble  rho_ice			 = element->FindParam(MaterialsRhoIceEnum);
 
 	/*Build friction element, needed later: */
@@ -934,7 +977,7 @@
 		switch (state) {
 			case 0: case 1: case 2: case 3:
-				// cold, dry base; cold, wet base; refreezing temperate base; thin temperate base: 
+				// cold, dry base; cold, wet base; refreezing temperate base; thin temperate base:
 				// Apply basal surface forcing.
-				// Interpolated values of enthalpy on gauss nodes may indicate cold base, 
+				// Interpolated values of enthalpy on gauss nodes may indicate cold base,
 				// although one node might have become temperate. So keep heat flux switched on.
 				geothermalflux_input->GetInputValue(&geothermalflux,gauss);
@@ -947,10 +990,10 @@
 				scalar=gauss->weight*Jdet*heatflux;
 				if(dt!=0.) scalar=dt*scalar;
-				for(i=0;i<numnodes;i++) 
+				for(i=0;i<numnodes;i++)
 					pe->values[i]+=scalar*basis[i];
 				break;
 			case 4:
 				// temperate, thick melting base: set grad H*n=0
-				for(i=0;i<numnodes;i++) 
+				for(i=0;i<numnodes;i++)
 					pe->values[i]+=0.;
 				break;
@@ -991,10 +1034,10 @@
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
 	Input*      pressure_input=element->GetInput(PressureEnum); _assert_(pressure_input);
-	IssmDouble  gravity             = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  rho_water           = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble  mixed_layer_capacity= element->GetMaterialParameter(MaterialsMixedLayerCapacityEnum);
-	IssmDouble  thermal_exchange_vel= element->GetMaterialParameter(MaterialsThermalExchangeVelocityEnum);
+	IssmDouble  gravity             = element->FindParam(ConstantsGEnum);
+	IssmDouble  rho_water           = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble  mixed_layer_capacity= element->FindParam(MaterialsMixedLayerCapacityEnum);
+	IssmDouble  thermal_exchange_vel= element->FindParam(MaterialsThermalExchangeVelocityEnum);
 
 	/* Start  looping on the number of gaussian points: */
@@ -1089,5 +1132,5 @@
 		/* Check if ice in element */
 		if(!element->IsIceInElement()) continue;
-		if(!element->IsOnBase()) continue; 
+		if(!element->IsOnBase()) continue;
 
 		numnodes=element->GetNumberOfNodes();
@@ -1130,5 +1173,9 @@
 
 		for(k=0;k<numnodes;k++){
-			waterfractions[k]-=dt*drainage[k];
+			if(dt==0.)
+				waterfractions[k]-=drainage[k];
+			else
+				waterfractions[k]-=dt*drainage[k];
+			
 			element->ThermalToEnthalpy(&enthalpies[k], temperatures[k], waterfractions[k], pressures[k]);
 		}
@@ -1145,14 +1192,12 @@
 IssmDouble     EnthalpyAnalysis::EnthalpyDiffusionParameter(Element* element,IssmDouble enthalpy,IssmDouble pressure){/*{{{*/
 
-	IssmDouble heatcapacity             = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble temperateiceconductivity = element->GetMaterialParameter(MaterialsTemperateiceconductivityEnum);
-	IssmDouble thermalconductivity      = element->GetMaterialParameter(MaterialsThermalconductivityEnum);
-
-	if(enthalpy < PureIceEnthalpy(element,pressure)){
+	IssmDouble heatcapacity             = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble temperateiceconductivity = element->FindParam(MaterialsTemperateiceconductivityEnum);
+	IssmDouble thermalconductivity      = element->FindParam(MaterialsThermalconductivityEnum);
+
+	if(enthalpy < PureIceEnthalpy(element,pressure))
 		return thermalconductivity/heatcapacity;
-	}
-	else{
+	else
 		return temperateiceconductivity/heatcapacity;
-	}
 }/*}}}*/
 IssmDouble     EnthalpyAnalysis::EnthalpyDiffusionParameterVolume(Element* element,int enthalpy_enum){/*{{{*/
@@ -1165,4 +1210,5 @@
 	/*Get pressures and enthalpies on vertices*/
 	int         numvertices = element->GetNumberOfVertices();
+	int         effectiveconductivity_averaging;
 	IssmDouble* pressures   = xNew<IssmDouble>(numvertices);
 	IssmDouble* enthalpies  = xNew<IssmDouble>(numvertices);
@@ -1171,4 +1217,6 @@
 	element->GetInputListOnVertices(pressures,PressureEnum);
 	element->GetInputListOnVertices(enthalpies,enthalpy_enum);
+	element->FindParam(&effectiveconductivity_averaging,MaterialsEffectiveconductivityAveragingEnum);
+
 	for(iv=0;iv<numvertices;iv++){
 		PIE[iv]   = PureIceEnthalpy(element,pressures[iv]);
@@ -1188,8 +1236,7 @@
 	}
 	else{
-		/* return harmonic mean of thermal conductivities, weighted by fraction of cold/temperate ice,
-			cf Patankar 1980, pp44 */
 		kappa_c = EnthalpyDiffusionParameter(element,PureIceEnthalpy(element,0.)-1.,0.);
 		kappa_t = EnthalpyDiffusionParameter(element,PureIceEnthalpy(element,0.)+1.,0.);
+
 		Hc=0.; Ht=0.;
 		for(iv=0; iv<numvertices;iv++){
@@ -1203,6 +1250,21 @@
 		_assert_(lambda>=0.);
 		_assert_(lambda<=1.);
-		kappa  = kappa_c*kappa_t/(lambda*kappa_t+(1.-lambda)*kappa_c); // ==(lambda/kappa_c + (1.-lambda)/kappa_t)^-1
-	}	
+
+		if(effectiveconductivity_averaging==0){
+			/* return arithmetic mean (volume average) of thermal conductivities, weighted by fraction of cold/temperate ice */
+			kappa=kappa_c*lambda+(1.-lambda)*kappa_t;
+		}
+		else if(effectiveconductivity_averaging==1){
+			/* return harmonic mean (reciprocal avarage) of thermal conductivities, weighted by fraction of cold/temperate ice, cf Patankar 1980, pp44 */
+			kappa=kappa_c*kappa_t/(lambda*kappa_t+(1.-lambda)*kappa_c);
+		}
+		else if(effectiveconductivity_averaging==2){
+			/* return geometric mean (power law) of thermal conductivities, weighted by fraction of cold/temperate ice */
+			kappa=pow(kappa_c,lambda)*pow(kappa_t,1.-lambda);
+		}
+		else{
+			_error_("effectiveconductivity_averaging not supported yet");
+		}
+	}
 
 	/*Clean up and return*/
@@ -1214,7 +1276,7 @@
 }/*}}}*/
 void           EnthalpyAnalysis::GetBAdvec(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
-	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1. 
+	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1.
 	 * For node i, Bi' can be expressed in the actual coordinate system
-	 * by: 
+	 * by:
 	 *       Bi_advec =[ h ]
 	 *                 [ h ]
@@ -1243,7 +1305,7 @@
 }/*}}}*/
 void           EnthalpyAnalysis::GetBAdvecprime(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
-	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1. 
+	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1.
 	 * For node i, Bi' can be expressed in the actual coordinate system
-	 * by: 
+	 * by:
 	 *       Biprime_advec=[ dh/dx ]
 	 *                     [ dh/dy ]
@@ -1294,5 +1356,5 @@
 	if(!element->IsIceInElement()) return;
 
-	/* Only update constraints at the base. 
+	/* Only update constraints at the base.
 	 * Floating ice is not affected by basal BC decision chart. */
 	if(!(element->IsOnBase()) || element->IsFloating()) return;
@@ -1334,9 +1396,9 @@
 				break;
 			case 1:
-				// cold, wet base: keep at pressure melting point 
+				// cold, wet base: keep at pressure melting point
 				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
 				break;
 			case 2:
-				// temperate, thin refreezing base: 
+				// temperate, thin refreezing base:
 				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
 				break;
@@ -1365,5 +1427,5 @@
 	if(!element->IsIceInElement()) return;
 
-	/* Only update constraints at the base. 
+	/* Only update constraints at the base.
 	 * Floating ice is not affected by basal BC decision chart.*/
 	if(!(element->IsOnBase()) || element->IsFloating()) return;
@@ -1407,5 +1469,5 @@
 				break;
 			case 1:
-				// cold, wet base: keep at pressure melting point 
+				// cold, wet base: keep at pressure melting point
 				vec_spc->SetValue(element->nodes[i]->Sid(),1.,INS_VAL);
 				break;
@@ -1435,7 +1497,7 @@
 }/*}}}*/
 void           EnthalpyAnalysis::GetBConduct(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
-	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1. 
+	/*Compute B  matrix. B=[B1 B2 B3 B4 B5 B6] where Bi is of size 5*NDOF1.
 	 * For node i, Bi' can be expressed in the actual coordinate system
-	 * by: 
+	 * by:
 	 *       Bi_conduct=[ dh/dx ]
 	 *                  [ dh/dy ]
@@ -1500,5 +1562,5 @@
 	IssmDouble temperature, waterfraction;
 	IssmDouble kappa_w = 0.6; // thermal conductivity of water (in W/m/K)
-	IssmDouble kappa_i = element->GetMaterialParameter(MaterialsThermalconductivityEnum);
+	IssmDouble kappa_i = element->FindParam(MaterialsThermalconductivityEnum);
 	element->EnthalpyToThermal(&temperature, &waterfraction, enthalpy, pressure);
 
@@ -1513,5 +1575,4 @@
 	int         i,rheology_law;
 	IssmDouble  B_average,s_average,T_average=0.,P_average=0.;
-	IssmDouble  n=3.0;
 	int        *doflist   = NULL;
 	IssmDouble *xyz_list  = NULL;
@@ -1521,5 +1582,5 @@
 
 	/*Fetch dof list and allocate solution vector*/
-	element->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
 	IssmDouble* values        = xNew<IssmDouble>(numnodes);
 	IssmDouble* pressure      = xNew<IssmDouble>(numnodes);
@@ -1539,5 +1600,4 @@
 
 	/*Get all inputs and parameters*/
-	if(element->material->ObjectEnum()!=MatestarEnum) n=element->GetMaterialParameter(MaterialsRheologyNEnum);
 	element->GetInputValue(&converged,ConvergedEnum);
 	element->GetInputListOnNodes(&pressure[0],PressureEnum);
@@ -1552,7 +1612,15 @@
 		element->AddInput(TemperatureEnum,temperature,element->GetElementType());
 
+		IssmDouble* n = xNew<IssmDouble>(numnodes);
+		if(element->material->ObjectEnum()==MatestarEnum){
+			for(i=0;i<numnodes;i++) n[i]=3.;
+		}
+		else{
+			element->GetInputListOnNodes(&n[0],MaterialsRheologyNEnum);
+		}
+
 		/*Update Rheology only if converged (we must make sure that the temperature is below melting point
 		 * otherwise the rheology could be negative*/
-		rheology_law=element->GetIntegerMaterialParameter(MaterialsRheologyLawEnum);
+		element->FindParam(&rheology_law,MaterialsRheologyLawEnum);
 		element->GetInputListOnNodes(&surface[0],SurfaceEnum);
 		switch(rheology_law){
@@ -1569,5 +1637,5 @@
 				break;
 			case CuffeyTemperateEnum:
-				for(i=0;i<numnodes;i++) B[i]=CuffeyTemperate(temperature[i], waterfraction[i],n);
+				for(i=0;i<numnodes;i++) B[i]=CuffeyTemperate(temperature[i], waterfraction[i],n[i]);
 				element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
 				break;
@@ -1576,15 +1644,26 @@
 				element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
 				break;
-			case ArrheniusEnum:
+			case NyeH2OEnum:
+				for(i=0;i<numnodes;i++) B[i]=NyeH2O(values[i]);
+				element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
+				break;
+			case NyeCO2Enum:
+				for(i=0;i<numnodes;i++) B[i]=NyeCO2(values[i]);
+				element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
+				break;
+			case ArrheniusEnum:{
 				element->GetVerticesCoordinates(&xyz_list);
-				for(i=0;i<numnodes;i++) B[i]=Arrhenius(temperature[i],surface[i]-xyz_list[i*3+2],n);
+				for(i=0;i<numnodes;i++) B[i]=Arrhenius(temperature[i],surface[i]-xyz_list[i*3+2],n[i]);
 				element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
 				break;
-			case LliboutryDuvalEnum:
-				for(i=0;i<numnodes;i++) B[i]=LliboutryDuval(values[i],pressure[i],n,element->GetMaterialParameter(MaterialsBetaEnum),element->GetMaterialParameter(ConstantsReferencetemperatureEnum),element->GetMaterialParameter(MaterialsHeatcapacityEnum),element->GetMaterialParameter(MaterialsLatentheatEnum)); 
-				element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType()); 
-				break; 
+				}
+			case LliboutryDuvalEnum:{
+				for(i=0;i<numnodes;i++) B[i]=LliboutryDuval(values[i],pressure[i],n[i],element->FindParam(MaterialsBetaEnum),element->FindParam(ConstantsReferencetemperatureEnum),element->FindParam(MaterialsHeatcapacityEnum),element->FindParam(MaterialsLatentheatEnum));
+				element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
+				break;
+				}
 			default: _error_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");
 		}
+		xDelete<IssmDouble>(n);
 	}
 	else{
@@ -1606,10 +1685,11 @@
 	/*Intermediaries*/
 	bool computebasalmeltingrates=true;
-	bool drainicecolumn=true;
+	bool isdrainicecolumn;
 	IssmDouble dt;
 
 	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
-
-	if(drainicecolumn && (dt>0.))	DrainWaterfraction(femmodel);
+	femmodel->parameters->FindParam(&isdrainicecolumn,ThermalIsdrainicecolumnEnum);
+
+	if(isdrainicecolumn)	DrainWaterfraction(femmodel);
 	if(computebasalmeltingrates)	ComputeBasalMeltingrate(femmodel);
 
@@ -1617,6 +1697,6 @@
 IssmDouble     EnthalpyAnalysis::PureIceEnthalpy(Element* element,IssmDouble pressure){/*{{{*/
 
-	IssmDouble heatcapacity         = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble referencetemperature = element->GetMaterialParameter(ConstantsReferencetemperatureEnum);
+	IssmDouble heatcapacity         = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble referencetemperature = element->FindParam(ConstantsReferencetemperatureEnum);
 
 	return heatcapacity*(TMeltingPoint(element,pressure)-referencetemperature);
@@ -1624,6 +1704,6 @@
 IssmDouble     EnthalpyAnalysis::TMeltingPoint(Element* element,IssmDouble pressure){/*{{{*/
 
-	IssmDouble meltingpoint = element->GetMaterialParameter(MaterialsMeltingpointEnum);
-	IssmDouble beta         = element->GetMaterialParameter(MaterialsBetaEnum);
+	IssmDouble meltingpoint = element->FindParam(MaterialsMeltingpointEnum);
+	IssmDouble beta         = element->FindParam(MaterialsBetaEnum);
 
 	return meltingpoint-beta*pressure;
@@ -1635,5 +1715,5 @@
 	IssmDouble*         serial_spc    = NULL;
 
-	spc=new Vector<IssmDouble>(femmodel->nodes->NumberOfNodes(EnthalpyAnalysisEnum));
+	spc=new Vector<IssmDouble>(femmodel->nodes->NumberOfNodes());
 	/*First create a vector to figure out what elements should be constrained*/
 	for(int i=0;i<femmodel->elements->Size();i++){
Index: /issm/trunk/src/c/analyses/EnthalpyAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/EnthalpyAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/EnthalpyAnalysis.h	(revision 24313)
@@ -16,5 +16,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/EnumToAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/EnumToAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/EnumToAnalysis.cpp	(revision 24313)
@@ -77,4 +77,7 @@
 		case HydrologyShreveAnalysisEnum : return new HydrologyShreveAnalysis();
 		#endif
+		#ifdef _HAVE_HYDROLOGYGLADS_
+		case HydrologyGlaDSAnalysisEnum : return new HydrologyGlaDSAnalysis();
+		#endif
 		#ifdef _HAVE_HYDROLOGYSHAKTI_
 		case HydrologyShaktiAnalysisEnum : return new HydrologyShaktiAnalysis();
Index: /issm/trunk/src/c/analyses/EnumToAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/EnumToAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/EnumToAnalysis.h	(revision 24313)
@@ -11,5 +11,5 @@
 		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
Index: /issm/trunk/src/c/analyses/EsaAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/EsaAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/EsaAnalysis.cpp	(revision 24313)
@@ -12,5 +12,5 @@
 	/*No loads*/
 }/*}}}*/
-void EsaAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void EsaAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 	::CreateNodes(nodes,iomodel,EsaAnalysisEnum,P1Enum);
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/EsaAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/EsaAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/EsaAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/ExtrapolationAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/ExtrapolationAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/ExtrapolationAnalysis.cpp	(revision 24313)
@@ -15,5 +15,5 @@
 	return;
 }/*}}}*/
-void ExtrapolationAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void ExtrapolationAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 	int finiteelement=P1Enum;
 	if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
Index: /issm/trunk/src/c/analyses/ExtrapolationAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/ExtrapolationAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/ExtrapolationAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 	void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 	void CreateLoads(Loads* loads, IoModel* iomodel);
-	void CreateNodes(Nodes* nodes,IoModel* iomodel);
+	void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 	int  DofsPerNode(int** doflist,int domaintype,int approximation);
 	void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/ExtrudeFromBaseAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/ExtrudeFromBaseAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/ExtrudeFromBaseAnalysis.cpp	(revision 24313)
@@ -10,5 +10,5 @@
 void ExtrudeFromBaseAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
 }/*}}}*/
-void ExtrudeFromBaseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void ExtrudeFromBaseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	::CreateNodes(nodes,iomodel,ExtrudeFromBaseAnalysisEnum,P1Enum);
Index: /issm/trunk/src/c/analyses/ExtrudeFromBaseAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/ExtrudeFromBaseAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/ExtrudeFromBaseAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/ExtrudeFromTopAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/ExtrudeFromTopAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/ExtrudeFromTopAnalysis.cpp	(revision 24313)
@@ -10,5 +10,5 @@
 void ExtrudeFromTopAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
 }/*}}}*/
-void ExtrudeFromTopAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void ExtrudeFromTopAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	::CreateNodes(nodes,iomodel,ExtrudeFromTopAnalysisEnum,P1Enum);
Index: /issm/trunk/src/c/analyses/ExtrudeFromTopAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/ExtrudeFromTopAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/ExtrudeFromTopAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/FreeSurfaceBaseAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 24313)
@@ -33,12 +33,9 @@
 
 			/*Get node ids*/
-			penpair_ids[0]=iomodel->nodecounter+reCast<int>(vertex_pairing[2*i+0]);
-			penpair_ids[1]=iomodel->nodecounter+reCast<int>(vertex_pairing[2*i+1]);
+			penpair_ids[0]=reCast<int>(vertex_pairing[2*i+0]);
+			penpair_ids[1]=reCast<int>(vertex_pairing[2*i+1]);
 
 			/*Create Load*/
-			loads->AddObject(new Penpair(
-							iomodel->loadcounter+count+1,
-							&penpair_ids[0],
-							FreeSurfaceBaseAnalysisEnum));
+			loads->AddObject(new Penpair(count+1, &penpair_ids[0]));
 			count++;
 		}
@@ -49,5 +46,5 @@
 	iomodel->DeleteData(nodeonbase,"md.mesh.vertexonbase");
 }/*}}}*/
-void FreeSurfaceBaseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void FreeSurfaceBaseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
@@ -110,4 +107,11 @@
 		case BasalforcingsPicoEnum:
 			iomodel->FetchDataToInput(elements,"md.basalforcings.basin_id",BasalforcingsPicoBasinIdEnum);
+			break;
+		case BasalforcingsIsmip6Enum:
+			iomodel->FetchDataToInput(elements,"md.basalforcings.basin_id",BasalforcingsIsmip6BasinIdEnum);
+			break;
+		case BeckmannGoosseFloatingMeltRateEnum:
+			iomodel->FetchDataToInput(elements,"md.basalforcings.ocean_salinity",BasalforcingsOceanSalinityEnum);
+			iomodel->FetchDataToInput(elements,"md.basalforcings.ocean_temp",BasalforcingsOceanTempEnum);
 			break;
 		default:
Index: /issm/trunk/src/c/analyses/FreeSurfaceBaseAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/FreeSurfaceBaseAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/FreeSurfaceBaseAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/FreeSurfaceTopAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/FreeSurfaceTopAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/FreeSurfaceTopAnalysis.cpp	(revision 24313)
@@ -33,12 +33,9 @@
 
 			/*Get node ids*/
-			penpair_ids[0]=iomodel->nodecounter+reCast<int>(vertex_pairing[2*i+0]);
-			penpair_ids[1]=iomodel->nodecounter+reCast<int>(vertex_pairing[2*i+1]);
+			penpair_ids[0]=reCast<int>(vertex_pairing[2*i+0]);
+			penpair_ids[1]=reCast<int>(vertex_pairing[2*i+1]);
 
 			/*Create Load*/
-			loads->AddObject(new Penpair(
-							iomodel->loadcounter+count+1,
-							&penpair_ids[0],
-							FreeSurfaceTopAnalysisEnum));
+			loads->AddObject(new Penpair( count+1, &penpair_ids[0]));
 			count++;
 		}
@@ -49,5 +46,5 @@
 	iomodel->DeleteData(nodeonsurface,"md.mesh.vertexonsurface");
 }/*}}}*/
-void FreeSurfaceTopAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void FreeSurfaceTopAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
Index: /issm/trunk/src/c/analyses/FreeSurfaceTopAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/FreeSurfaceTopAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/FreeSurfaceTopAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/GLheightadvectionAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/GLheightadvectionAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/GLheightadvectionAnalysis.cpp	(revision 24313)
@@ -14,8 +14,10 @@
 	/*No loads*/
 }/*}}}*/
-void GLheightadvectionAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void GLheightadvectionAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	/*First fetch data: */
+	if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
 	::CreateNodes(nodes,iomodel,GLheightadvectionAnalysisEnum,P1Enum);
+	iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
 }/*}}}*/
 int  GLheightadvectionAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
@@ -38,4 +40,5 @@
 		iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum);
 	}
+	iomodel->FetchDataToInput(elements,"md.mesh.vertexonboundary",MeshVertexonboundaryEnum);
 }/*}}}*/
 void GLheightadvectionAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
@@ -51,20 +54,27 @@
 }/*}}}*/
 ElementMatrix* GLheightadvectionAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
-_error_("Not implemented");
+	_error_("Not implemented");
 }/*}}}*/
 ElementMatrix* GLheightadvectionAnalysis::CreateKMatrix(Element* element){/*{{{*/
 
+	/* Spawn basal element */
+	if(!element->IsOnBase()) return NULL;
+	Element* basalelement = element->SpawnBasalElement();
+
 	/* Check if ice in element */
-	if(!element->IsIceInElement()) return NULL;
-	//if(!element->IsFloating()) return NULL;
+	if(!basalelement->IsIceInElement()) return NULL;
 
 	/*Intermediaries */
+	const IssmPDouble yts = 365*24*3600.;
 	int        domaintype,dim;
-	IssmDouble Jdet,D_scalar;
+	IssmDouble Jdet,D_scalar,onboundary;
 	IssmDouble vel,vx,vy;
-	IssmDouble* xyz_list = NULL;
+	IssmDouble* xyz_list      = NULL;
+	Input* vx_input           = NULL;
+	Input* vy_input           = NULL;
+	Input* bc_input           = NULL;
 
 	/*Get problem dimension*/
-	element->FindParam(&domaintype,DomainTypeEnum);
+	basalelement->FindParam(&domaintype,DomainTypeEnum);
 	switch(domaintype){
 		case Domain2DhorizontalEnum: dim = 2; break;
@@ -74,8 +84,8 @@
 
 	/*Fetch number of nodes and dof for this finite element*/
-	int numnodes = element->GetNumberOfNodes();
+	int numnodes = basalelement->GetNumberOfNodes();
 
 	/*Initialize Element vector and other vectors*/
-	ElementMatrix* Ke     = element->NewElementMatrix();
+	ElementMatrix* Ke     = basalelement->NewElementMatrix();
 	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
 	IssmDouble*    dbasis = xNew<IssmDouble>(dim*numnodes);
@@ -84,50 +94,85 @@
 
 	/*Retrieve all inputs and parameters*/
-	element->GetVerticesCoordinates(&xyz_list);
-	//Input* vx_input=element->GetInput(BaseSlopeXEnum); _assert_(vx_input);
-	//Input* vy_input=element->GetInput(BaseSlopeYEnum); _assert_(vy_input);
-   Input* vx_input=element->GetInput(VxEnum); _assert_(vx_input);
-	Input* vy_input=element->GetInput(VyEnum); _assert_(vy_input);
-
-	IssmDouble h = element->CharacteristicLength();
+	basalelement->GetVerticesCoordinates(&xyz_list);
+	switch(domaintype){
+		case Domain2DhorizontalEnum:
+			vx_input=basalelement->GetInput(VxEnum); _assert_(vx_input);
+			vy_input=basalelement->GetInput(VyEnum); _assert_(vy_input);
+		   bc_input=basalelement->GetInput(MeshVertexonboundaryEnum); _assert_(bc_input);
+		break;
+		case Domain3DEnum:
+			vx_input=basalelement->GetInput(VxAverageEnum); _assert_(vx_input);
+			vy_input=basalelement->GetInput(VyAverageEnum); _assert_(vy_input);
+			bc_input=basalelement->GetInput(MeshVertexonboundaryEnum); _assert_(bc_input);
+		break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
+	IssmDouble h = basalelement->CharacteristicLength();
 
 	/* Start  looping on the number of gaussian points: */
-	Gauss* gauss=element->NewGauss(4);
+	Gauss* gauss=basalelement->NewGauss(4);
 	for(int ig=gauss->begin();ig<gauss->end();ig++){
 		gauss->GaussPoint(ig);
 
-		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
-		element->NodalFunctions(basis,gauss);
-		element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
-		GetBprime(Bprime,element,dim,xyz_list,gauss);
-
-		D_scalar=gauss->weight*Jdet;
-
-		/*Diffusion */
-		if(sqrt(vx*vx+vy*vy)<1000./31536000.){
-			IssmPDouble kappa = -10;
+		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
+		basalelement->NodalFunctions(basis,gauss);
+		basalelement->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+		GetBprime(Bprime,basalelement,dim,xyz_list,gauss);
+
+		/*Get velocity*/
+		vx_input->GetInputValue(&vx,gauss);
+		vy_input->GetInputValue(&vy,gauss);
+
+		if(false){
+			/*Streamline diffusion*/
+			vel = sqrt(vx*vx+vy*vy);
+			if(vel<10./yts){
+				vx = 0.; vy = 0.;
+				vel = 30./yts*500000.;
+			}
+
 			for(int i=0;i<numnodes;i++){
 				for(int j=0;j<numnodes;j++){
-					Ke->values[i*numnodes+j] += D_scalar*kappa*(dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]);
+					Ke->values[i*numnodes+j] += gauss->weight*Jdet*(
+								(vx*dbasis[0*numnodes+i] + vy*dbasis[1*numnodes+i])*(vx*dbasis[0*numnodes+j] + vy*dbasis[1*numnodes+j])
+								+ vel/500000.*(dbasis[0*numnodes+i]*dbasis[0*numnodes+j] + dbasis[1*numnodes+i]*dbasis[1*numnodes+j]));
 				}
 			}
 		}
-		/*Advection: */
-		vx_input->GetInputValue(&vx,gauss);
-		vy_input->GetInputValue(&vy,gauss);
-		for(int i=0;i<numnodes;i++){
-			for(int j=0;j<numnodes;j++){
-				Ke->values[i*numnodes+j] += (D_scalar*(vx*dbasis[0*numnodes+j]*basis[i] + vy*dbasis[1*numnodes+j]*basis[i]))*1e-2;
-			}
-		}
-
-		/*Artifficial diffusivity*/
-		vel=sqrt(vx*vx + vy*vy)+1.e-14;
-		D[0][0]=D_scalar*h/(2.*vel)*fabs(vx*vx);  D[0][1]=D_scalar*h/(2.*vel)*fabs(vx*vy);
-		D[1][0]=D_scalar*h/(2.*vel)*fabs(vy*vx);  D[1][1]=D_scalar*h/(2.*vel)*fabs(vy*vy);
-		TripleMultiply(Bprime,dim,numnodes,1,
-					&D[0][0],2,2,0,
-					Bprime,dim,numnodes,0,
-					&Ke->values[0],1);
+		else{
+			D_scalar=gauss->weight*Jdet;
+
+			bc_input->GetInputValue(&onboundary,gauss);
+			if(onboundary>0.){
+				/*We do not want to advect garbage, make sure only diffusion is applied on boundary*/
+				vx = 0.; vy = 0.;
+			}
+
+			/*Diffusion */
+			if(sqrt(vx*vx+vy*vy)<1000./31536000.){
+				IssmPDouble kappa = -10.;
+				for(int i=0;i<numnodes;i++){
+					for(int j=0;j<numnodes;j++){
+						Ke->values[i*numnodes+j] += D_scalar*kappa*(dbasis[0*numnodes+j]*dbasis[0*numnodes+i] + dbasis[1*numnodes+j]*dbasis[1*numnodes+i]);
+					}
+				}
+			}
+
+			/*Advection: */
+			for(int i=0;i<numnodes;i++){
+				for(int j=0;j<numnodes;j++){
+					Ke->values[i*numnodes+j] += (D_scalar*(vx*dbasis[0*numnodes+j]*basis[i] + vy*dbasis[1*numnodes+j]*basis[i]))*1e-2;
+				}
+			}
+
+			/*Artificial diffusivity*/
+			vel=sqrt(vx*vx + vy*vy)+1.e-14;
+			D[0][0]=D_scalar*h/(2.*vel)*fabs(vx*vx);  D[0][1]=D_scalar*h/(2.*vel)*fabs(vx*vy);
+			D[1][0]=D_scalar*h/(2.*vel)*fabs(vy*vx);  D[1][1]=D_scalar*h/(2.*vel)*fabs(vy*vy);
+			TripleMultiply(Bprime,dim,numnodes,1,
+						&D[0][0],2,2,0,
+						Bprime,dim,numnodes,0,
+						&Ke->values[0],1);
+		}
 	}
 
@@ -138,13 +183,13 @@
 	xDelete<IssmDouble>(Bprime);
 	delete gauss;
+	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
 	return Ke;
 
 }/*}}}*/
 ElementVector* GLheightadvectionAnalysis::CreatePVector(Element* element){/*{{{*/
-
 	return NULL;
 }/*}}}*/
 void           GLheightadvectionAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
-	   _error_("not implemented yet");
+	_error_("not implemented yet");
 }/*}}}*/
 void           GLheightadvectionAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
@@ -173,18 +218,16 @@
 	for(int i=0;i<femmodel->elements->Size();i++){
 		Element    *element  = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
-
-		if(!element->IsIceInElement()) continue;
-		int         numnodes = element->GetNumberOfNodes();
-		IssmDouble *mask     = xNew<IssmDouble>(numnodes);
-		IssmDouble *bed      = xNew<IssmDouble>(numnodes);
-		IssmDouble *lset     = xNew<IssmDouble>(numnodes);
+		int         numnodes  = element->GetNumberOfNodes();
+		IssmDouble *mask      = xNew<IssmDouble>(numnodes);
+		IssmDouble *bed       = xNew<IssmDouble>(numnodes);
+		IssmDouble *ls_active = xNew<IssmDouble>(numnodes);
 
 		element->GetInputListOnNodes(&mask[0],MaskGroundediceLevelsetEnum);
 		element->GetInputListOnNodes(&bed[0],BaseEnum);
-		element->GetInputListOnNodes(&lset[0],MaskIceLevelsetEnum);
+		element->GetInputListOnNodes(&ls_active[0],IceMaskNodeActivationEnum);
 
 		for(int in=0;in<numnodes;in++){
 			Node* node=element->GetNode(in);
-			if(mask[in]<0.){
+			if(mask[in]<0. && ls_active[in]==1.){
 				node->Activate();
 			}
@@ -196,5 +239,5 @@
 		xDelete<IssmDouble>(mask);
 		xDelete<IssmDouble>(bed);
-		xDelete<IssmDouble>(lset);
+		xDelete<IssmDouble>(ls_active);
 	}
 
Index: /issm/trunk/src/c/analyses/GLheightadvectionAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/GLheightadvectionAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/GLheightadvectionAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/GiaIvinsAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/GiaIvinsAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/GiaIvinsAnalysis.cpp	(revision 24313)
@@ -12,5 +12,5 @@
 	/*No loads*/
 }/*}}}*/
-void GiaIvinsAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void GiaIvinsAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 	::CreateNodes(nodes,iomodel,GiaIvinsAnalysisEnum,P1Enum);
 }/*}}}*/
Index: /issm/trunk/src/c/analyses/GiaIvinsAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/GiaIvinsAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/GiaIvinsAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 24313)
@@ -61,7 +61,7 @@
 	iomodel->FetchDataToInput(elements,"md.geometry.base",BaseEnum);
 	iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
-	iomodel->FetchDataToInput(elements,"md.initialization.epl_head",EplHeadHydrostepEnum);
-	iomodel->FetchDataToInput(elements,"md.initialization.sediment_head",SedimentHeadHydrostepEnum);
-	iomodel->FetchDataToInput(elements,"md.initialization.epl_thickness",HydrologydcEplThicknessHydrostepEnum);
+	iomodel->FetchDataToInput(elements,"md.initialization.epl_head",EplHeadSubstepEnum);
+	iomodel->FetchDataToInput(elements,"md.initialization.sediment_head",SedimentHeadSubstepEnum);
+	iomodel->FetchDataToInput(elements,"md.initialization.epl_thickness",HydrologydcEplThicknessSubstepEnum);
 	iomodel->FetchDataToInput(elements,"md.hydrology.basal_moulin_input",HydrologydcBasalMoulinInputEnum);
 	if(iomodel->domaintype!=Domain2DhorizontalEnum){
@@ -71,5 +71,5 @@
 }/*}}}*/
 
-void HydrologyDCEfficientAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void HydrologyDCEfficientAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	/*Now, do we really want DC?*/
@@ -128,10 +128,10 @@
 			/*keep only this partition's nodes:*/
 			if(iomodel->my_vertices[i]){
-				loads->AddObject(new Moulin(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCEfficientAnalysisEnum));
+				loads->AddObject(new Moulin(i+1,i,iomodel));
 			}
 		}
 		else if(reCast<int>(iomodel->Data("md.mesh.vertexonbase")[i])){
 			if(iomodel->my_vertices[i]){
-				loads->AddObject(new Moulin(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCEfficientAnalysisEnum));
+				loads->AddObject(new Moulin(i+1,i,iomodel));
 			}
 		}
@@ -198,5 +198,5 @@
 	/*Check that all nodes are active, else return empty matrix*/
 	if(!active_element) {
-	if(domaintype!=Domain2DhorizontalEnum){
+		if(domaintype!=Domain2DhorizontalEnum){
 			basalelement->DeleteMaterials();
 			delete basalelement;
@@ -223,13 +223,12 @@
 	/*Retrieve all inputs and parameters*/
 	basalelement->GetVerticesCoordinates(&xyz_list);
-	//basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
-	basalelement ->FindParam(&dt,HydrologydtEnum);
-
-	Input* epl_thick_input = basalelement->GetInput(HydrologydcEplThicknessHydrostepEnum); _assert_(epl_thick_input);
-	Input* epl_head_input	= basalelement->GetInput(EplHeadHydrostepEnum);  _assert_(epl_head_input);
+	basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
+
+	Input* epl_thick_input = basalelement->GetInput(HydrologydcEplThicknessSubstepEnum); _assert_(epl_thick_input);
+	Input* epl_head_input	= basalelement->GetInput(EplHeadSubstepEnum);  _assert_(epl_head_input);
 	Input* base_input			= basalelement->GetInput(BaseEnum); _assert_(base_input);
 
 	/* Start  looping on the number of gaussian points: */
-	Gauss* gauss					= basalelement->NewGauss(2);
+	Gauss* gauss = basalelement->NewGauss(2);
 	for(int ig=gauss->begin();ig<gauss->end();ig++){
 		gauss           ->GaussPoint(ig);
@@ -320,7 +319,7 @@
 	IssmDouble residual,connectivity;
 
-	IssmDouble		*xyz_list							= NULL;
-	Input*				 old_wh_input					= NULL;
-	Input*				 surface_runoff_input = NULL;
+	IssmDouble		*xyz_list				 = NULL;
+	Input*			 old_wh_input			 = NULL;
+	Input*			 surface_runoff_input = NULL;
 
 	/*Fetch number of nodes and dof for this finite element*/
@@ -334,11 +333,10 @@
 	/*Retrieve all inputs and parameters*/
 	basalelement->GetVerticesCoordinates(&xyz_list);
-	//basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
-	basalelement ->FindParam(&dt,HydrologydtEnum);
+	basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
 	basalelement ->FindParam(&smb_model,SmbEnum);
 
-	Input*	epl_thick_input			 = basalelement->GetInput(HydrologydcEplThicknessHydrostepEnum); _assert_(epl_thick_input);
-	Input*	sed_head_input			 = basalelement->GetInput(SedimentHeadHydrostepEnum); _assert_(sed_head_input);
-	Input*	epl_head_input			 = basalelement->GetInput(EplHeadHydrostepEnum); _assert_(epl_head_input);
+	Input*	epl_thick_input			 = basalelement->GetInput(HydrologydcEplThicknessSubstepEnum); _assert_(epl_thick_input);
+	Input*	sed_head_input			 = basalelement->GetInput(SedimentHeadSubstepEnum); _assert_(sed_head_input);
+	Input*	epl_head_input			 = basalelement->GetInput(EplHeadSubstepEnum); _assert_(epl_head_input);
 	Input*	basal_melt_input		 = basalelement->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(basal_melt_input);
 	Input*	residual_input			 = basalelement->GetInput(SedimentHeadResidualEnum); _assert_(residual_input);
@@ -353,5 +351,5 @@
 
 	/* Start  looping on the number of gaussian points: */
-	Gauss* gauss           = basalelement->NewGauss(2);
+	Gauss* gauss = basalelement->NewGauss(2);
 	for(int ig=gauss->begin();ig<gauss->end();ig++){
 		gauss->GaussPoint(ig);
@@ -383,5 +381,5 @@
 
 	/*	Add residual if necessary*/
-	gauss=basalelement->NewGauss();
+	gauss = basalelement->NewGauss();
 	for(int iv=0;iv<numvertices;iv++){
 		gauss->GaussVertex(iv);
@@ -401,5 +399,5 @@
 
 void HydrologyDCEfficientAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
-	element->GetSolutionFromInputsOneDof(solution,EplHeadHydrostepEnum);
+	element->GetSolutionFromInputsOneDof(solution,EplHeadSubstepEnum);
 }/*}}}*/
 
@@ -410,5 +408,4 @@
 void HydrologyDCEfficientAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
 	/*Intermediaries*/
-	bool     active_element;
 	int      domaintype;
 	Element* basalelement=NULL;
@@ -433,38 +430,18 @@
 
 	/*Fetch dof list and allocate solution vector*/
-	IssmDouble* eplHeads    = xNew<IssmDouble>(numnodes);
-	IssmDouble* basevalue    = xNew<IssmDouble>(numnodes);
-	IssmDouble* initvalue    = xNew<IssmDouble>(numnodes);
-	basalelement->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
-
-	Input* active_element_input=basalelement->GetInput(HydrologydcMaskEplactiveEltEnum); _assert_(active_element_input);
-	active_element_input->GetInputValue(&active_element);
+	basalelement->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+	IssmDouble* eplHeads = xNew<IssmDouble>(numnodes);
 
 	/*Use the dof list to index into the solution vector: */
-	/*If the EPL is not active we revert to the bedrock elevation*/
-
-	if(active_element){
-		for(int i=0;i<numnodes;i++){
-			eplHeads[i]=solution[doflist[i]];
-			if(xIsNan<IssmDouble>(eplHeads[i])) _error_("NaN found in solution vector");
-			if(xIsInf<IssmDouble>(eplHeads[i])) _error_("Inf found in solution vector");
-		}
-	}
-	else{
-		//tradeof between keeping initial condition and not getting to far from head at deactivation
-		basalelement->GetInputListOnVertices(&basevalue[0],BaseEnum);
-		basalelement->GetInputListOnVertices(&initvalue[0],EplHeadHydrostepEnum);
-		for(int i=0;i<numnodes;i++){
-			eplHeads[i]=max(basevalue[i],initvalue[i]);
-			if(xIsNan<IssmDouble>(eplHeads[i])) _error_("NaN found in solution vector");
-			if(xIsInf<IssmDouble>(eplHeads[i])) _error_("Inf found in solution vector");
-		}
+	/*If the EPL is not active we revert to the bedrock elevation when deactivating*/
+	for(int i=0;i<numnodes;i++){
+		eplHeads[i]=solution[doflist[i]];
+		if(xIsNan<IssmDouble>(eplHeads[i])) _error_("NaN found in solution vector");
+		if(xIsInf<IssmDouble>(eplHeads[i])) _error_("Inf found in solution vector");
 	}
 	/*Add input to the element: */
-	element->AddBasalInput(EplHeadHydrostepEnum,eplHeads,P1Enum);
+	element->AddBasalInput(EplHeadSubstepEnum,eplHeads,P1Enum);
 	/*Free ressources:*/
 	xDelete<IssmDouble>(eplHeads);
-	xDelete<IssmDouble>(basevalue);
-	xDelete<IssmDouble>(initvalue);
 	xDelete<int>(doflist);
 	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
@@ -549,4 +526,5 @@
 		IssmDouble* thickness     = xNew<IssmDouble>(numnodes);
 		IssmDouble* B             = xNew<IssmDouble>(numnodes);
+		IssmDouble* n             = xNew<IssmDouble>(numnodes);
 		IssmDouble* eplhead       = xNew<IssmDouble>(numnodes);
 		IssmDouble* epl_slopeX    = xNew<IssmDouble>(numnodes);
@@ -558,16 +536,14 @@
 		Input* 	active_element_input=element->GetInput(HydrologydcMaskEplactiveEltEnum); _assert_(active_element_input);
 		active_element_input->GetInputValue(&active_element);
-		//element->FindParam(&dt,TimesteppingTimeStepEnum);
-		element ->FindParam(&dt,HydrologydtEnum);
+		element->FindParam(&dt,TimesteppingTimeStepEnum);
 
 		/*For now, assuming just one way to compute EPL thickness*/
-		IssmDouble gravity          = element->GetMaterialParameter(ConstantsGEnum);
-		IssmDouble rho_water        = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-		IssmDouble rho_ice          = element->GetMaterialParameter(MaterialsRhoIceEnum);
-		IssmDouble n                =	element->GetMaterialParameter(MaterialsRheologyNEnum);
-		IssmDouble latentheat       = element->GetMaterialParameter(MaterialsLatentheatEnum);
-		IssmDouble epl_conductivity = element->GetMaterialParameter(HydrologydcEplConductivityEnum);
-		IssmDouble init_thick       =	element->GetMaterialParameter(HydrologydcEplInitialThicknessEnum);
-		IssmDouble max_thick        =	element->GetMaterialParameter(HydrologydcEplMaxThicknessEnum);
+		IssmDouble gravity          = element->FindParam(ConstantsGEnum);
+		IssmDouble rho_water        = element->FindParam(MaterialsRhoFreshwaterEnum);
+		IssmDouble rho_ice          = element->FindParam(MaterialsRhoIceEnum);
+		IssmDouble latentheat       = element->FindParam(MaterialsLatentheatEnum);
+		IssmDouble epl_conductivity = element->FindParam(HydrologydcEplConductivityEnum);
+		IssmDouble init_thick       =	element->FindParam(HydrologydcEplInitialThicknessEnum);
+		IssmDouble max_thick        =	element->FindParam(HydrologydcEplMaxThicknessEnum);
 
 		switch(domaintype){
@@ -577,5 +553,5 @@
 		}
 
-		element->GetInputListOnVertices(&eplhead[0],EplHeadHydrostepEnum);
+		element->GetInputListOnVertices(&eplhead[0],EplHeadSubstepEnum);
 		element->GetInputListOnVertices(&epl_slopeX[0],EplHeadSlopeXEnum);
 		element->GetInputListOnVertices(&epl_slopeY[0],EplHeadSlopeYEnum);
@@ -583,4 +559,5 @@
 		element->GetInputListOnVertices(&ice_thickness[0],ThicknessEnum);
 		element->GetInputListOnVertices(&bed[0],BaseEnum);
+		element->GetInputListOnVertices(&n[0],MaterialsRheologyNEnum);
 
 		if(!active_element){
@@ -592,5 +569,5 @@
 		else{
 			for(int i=0;i<numnodes;i++){
-				A=pow(B[i],-n);
+				A=pow(B[i],-n[i]);
 				/*Compute first the effective pressure in the EPL*/
 				EPL_N=gravity*((rho_ice*ice_thickness[i])-(rho_water*(eplhead[i]-bed[i])));
@@ -600,5 +577,5 @@
 				/*And proceed to the real thing*/
 				opening=(rho_water*gravity*epl_conductivity*EPLgrad2*dt)/(rho_ice*latentheat);
-				closing=(2.0*A*dt*pow(EPL_N,n))/(pow(n,n));
+				closing=(2.0*A*dt*pow(EPL_N,n[i]))/(pow(n[i],n[i]));
 				/*implicit*/
 				thickness[i] = old_thickness[i]/(1.0-opening+closing);
@@ -613,5 +590,5 @@
 			}
 		}
-		element->AddInput(HydrologydcEplThicknessHydrostepEnum,thickness,element->GetElementType());
+		element->AddInput(HydrologydcEplThicknessSubstepEnum,thickness,element->GetElementType());
 		xDelete<IssmDouble>(thickness);
 		xDelete<IssmDouble>(eplhead);
@@ -622,4 +599,5 @@
 		xDelete<IssmDouble>(bed);
 		xDelete<IssmDouble>(B);
+		xDelete<IssmDouble>(n);
 	}
 }/*}}}*/
@@ -653,5 +631,5 @@
 }/*}}}*/
 
-void  HydrologyDCEfficientAnalysis::HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask, Vector<IssmDouble>* recurence, int* eplzigzag_counter, Element* element){
+void  HydrologyDCEfficientAnalysis::HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask, Vector<IssmDouble>* recurence, Element* element){
 
 	bool        active_element;
@@ -682,6 +660,6 @@
 	IssmDouble* base          =xNew<IssmDouble>(numnodes);
 
-	IssmDouble init_thick    =basalelement->GetMaterialParameter(HydrologydcEplInitialThicknessEnum);
-	IssmDouble colapse_thick =basalelement->GetMaterialParameter(HydrologydcEplColapseThicknessEnum);
+	IssmDouble init_thick    =basalelement->FindParam(HydrologydcEplInitialThicknessEnum);
+	IssmDouble colapse_thick =basalelement->FindParam(HydrologydcEplColapseThicknessEnum);
 
 	Input* active_element_input=basalelement->GetInput(HydrologydcMaskEplactiveEltEnum); _assert_(active_element_input);
@@ -689,7 +667,7 @@
 
 	basalelement-> GetInputListOnVertices(&old_active[0],HydrologydcMaskEplactiveNodeEnum);
-	basalelement-> GetInputListOnVertices(&epl_thickness[0],HydrologydcEplThicknessHydrostepEnum);
-	basalelement-> GetInputListOnVertices(&sedhead[0],SedimentHeadHydrostepEnum);
-	basalelement-> GetInputListOnVertices(&eplhead[0],EplHeadHydrostepEnum);
+	basalelement-> GetInputListOnVertices(&epl_thickness[0],HydrologydcEplThicknessSubstepEnum);
+	basalelement-> GetInputListOnVertices(&sedhead[0],SedimentHeadSubstepEnum);
+	basalelement-> GetInputListOnVertices(&eplhead[0],EplHeadSubstepEnum);
 	basalelement-> GetInputListOnVertices(&residual[0],SedimentHeadResidualEnum);
 	basalelement-> GetInputListOnVertices(&base[0],BaseEnum);
@@ -709,5 +687,5 @@
 			}
 		}
-		if (old_active[i]==0.){
+		else if (old_active[i]==0.){
 			/*Activate if we have a residual from sediment*/
 			if(residual[i]>0.){
@@ -734,5 +712,5 @@
 		}
 	}
-	basalelement->AddInput(HydrologydcEplThicknessHydrostepEnum,epl_thickness,basalelement->GetElementType());
+	basalelement->AddInput(HydrologydcEplThicknessSubstepEnum,epl_thickness,basalelement->GetElementType());
 
 	if(domaintype!=Domain2DhorizontalEnum){
@@ -752,9 +730,9 @@
 	IssmDouble water_sheet,storing;
 	IssmDouble epl_thickness,prestep_head,base_elev;
-	IssmDouble rho_freshwater        = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-	IssmDouble g                     = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble epl_porosity					 = element->GetMaterialParameter(HydrologydcEplPorosityEnum);
-	IssmDouble epl_compressibility	 = element->GetMaterialParameter(HydrologydcEplCompressibilityEnum);
-	IssmDouble water_compressibility = element->GetMaterialParameter(HydrologydcWaterCompressibilityEnum);
+	IssmDouble rho_freshwater        = element->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble g                     = element->FindParam(ConstantsGEnum);
+	IssmDouble epl_porosity					 = element->FindParam(HydrologydcEplPorosityEnum);
+	IssmDouble epl_compressibility	 = element->FindParam(HydrologydcEplCompressibilityEnum);
+	IssmDouble water_compressibility = element->FindParam(HydrologydcWaterCompressibilityEnum);
 
 	epl_thick_input->GetInputValue(&epl_thickness,gauss);
@@ -784,5 +762,5 @@
 	IssmDouble water_sheet;
 	IssmDouble epl_thickness,base_elev,prestep_head;
-	IssmDouble epl_conductivity      = element->GetMaterialParameter(HydrologydcEplConductivityEnum);
+	IssmDouble epl_conductivity      = element->FindParam(HydrologydcEplConductivityEnum);
 	epl_thick_input->GetInputValue(&epl_thickness,gauss);
 	epl_head_input->GetInputValue(&prestep_head,gauss);
@@ -864,6 +842,6 @@
 	case 2:
 		/*Compute max*/
-		rho_water = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-		rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
+		rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
+		rho_ice   = element->FindParam(MaterialsRhoIceEnum);
 		element-> GetInputValue(&thickness,innode,ThicknessEnum);
 		element-> GetInputValue(&bed,innode,BaseEnum);
Index: /issm/trunk/src/c/analyses/HydrologyDCEfficientAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyDCEfficientAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/HydrologyDCEfficientAnalysis.h	(revision 24313)
@@ -1,3 +1,3 @@
-/*! \file HydrologyDCEfficientAnalysis.h 
+/*! \file HydrologyDCEfficientAnalysis.h
  *  \brief: header file for generic external result object
  */
@@ -17,10 +17,10 @@
 		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
 		void InitZigZagCounter(FemModel* femmodel);
 		void ResetCounter(FemModel* femmodel);
-			
+
 		/*Finite element Analysis*/
 		void           Core(FemModel* femmodel);
@@ -40,5 +40,5 @@
 		IssmDouble EplStoring(Element* element,Gauss* gauss, Input* epl_thick_input, Input* epl_head_input, Input* base_input);
 		IssmDouble EplTransmitivity(Element* element,Gauss* gauss, Input* epl_thick_input, Input* epl_head_input, Input* base_input);
-		void HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask, Vector<IssmDouble>* recurence, int* eplzigzag_counter, Element* element);
+		void HydrologyEPLGetMask(Vector<IssmDouble>* vec_mask, Vector<IssmDouble>* recurence, Element* element);
 		void HydrologyEPLGetActive(Vector<IssmDouble>* active_vec, Element* element);
 		void GetHydrologyDCInefficientHmax(IssmDouble* ph_max,Element* element, Node* innode);
Index: /issm/trunk/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 24313)
@@ -102,5 +102,5 @@
 	iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum);
 	iomodel->FetchDataToInput(elements,"md.hydrology.basal_moulin_input",HydrologydcBasalMoulinInputEnum);
-	iomodel->FetchDataToInput(elements,"md.initialization.sediment_head",SedimentHeadHydrostepEnum);
+	iomodel->FetchDataToInput(elements,"md.initialization.sediment_head",SedimentHeadSubstepEnum);
 	iomodel->FetchDataToInput(elements,"md.hydrology.sediment_transmitivity",HydrologydcSedimentTransmitivityEnum);
 	iomodel->FetchDataToInput(elements,"md.hydrology.mask_thawed_node",HydrologydcMaskThawedNodeEnum);
@@ -111,9 +111,9 @@
 	if(isefficientlayer){
 		iomodel->FetchDataToInput(elements,"md.hydrology.mask_eplactive_node",HydrologydcMaskEplactiveNodeEnum);
-		iomodel->FetchDataToInput(elements,"md.initialization.epl_head",EplHeadHydrostepEnum);
-	}
-
-}/*}}}*/
-void HydrologyDCInefficientAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+		iomodel->FetchDataToInput(elements,"md.initialization.epl_head",EplHeadSubstepEnum);
+	}
+
+}/*}}}*/
+void HydrologyDCInefficientAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	/*Fetch parameters: */
@@ -155,12 +155,12 @@
 			/*keep only this partition's nodes:*/
 			if(iomodel->my_vertices[i]){
-				loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCInefficientAnalysisEnum));
-				loads->AddObject(new Moulin(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCInefficientAnalysisEnum));
+				loads->AddObject(new Pengrid(i+1,i,iomodel));
+				loads->AddObject(new Moulin(i+1,i,iomodel));
 			}
 		}
 		else if(reCast<int>(iomodel->Data("md.mesh.vertexonbase")[i])){
 			if(iomodel->my_vertices[i]){
-				loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCInefficientAnalysisEnum));
-				loads->AddObject(new Moulin(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCInefficientAnalysisEnum));
+				loads->AddObject(new Pengrid(i+1,i,iomodel));
+				loads->AddObject(new Moulin(i+1,i,iomodel));
 			}
 		}
@@ -205,5 +205,5 @@
 	/*Check that all nodes are active, else return empty matrix*/
 	if(!thawed_element) {
-	if(domaintype!=Domain2DhorizontalEnum){
+		if(domaintype!=Domain2DhorizontalEnum){
 			basalelement->DeleteMaterials();
 			delete basalelement;
@@ -233,9 +233,8 @@
 	/*Retrieve all inputs and parameters*/
 	basalelement ->GetVerticesCoordinates(&xyz_list);
-	//basalelement ->FindParam(&dt,TimesteppingTimeStepEnum);
-	basalelement ->FindParam(&dt,HydrologydtEnum);
+	basalelement ->FindParam(&dt,TimesteppingTimeStepEnum);
 	basalelement ->FindParam(&isefficientlayer,HydrologydcIsefficientlayerEnum);
 	Input* SedTrans_input = basalelement->GetInput(HydrologydcSedimentTransmitivityEnum); _assert_(SedTrans_input);
-	Input* sed_head_input = basalelement->GetInput(SedimentHeadHydrostepEnum);
+	Input* sed_head_input = basalelement->GetInput(SedimentHeadSubstepEnum);
 	Input* base_input     = basalelement->GetInput(BaseEnum);
 	Input* old_wh_input = basalelement->GetInput(SedimentHeadOldEnum);                  _assert_(old_wh_input);
@@ -340,4 +339,5 @@
 	bool       active_element,isefficientlayer;
 	int        smb_model;
+	int        smbsubstepping;
 	IssmDouble dt,scalar,sediment_storing;
 	IssmDouble water_head,sediment_transmitivity;
@@ -348,5 +348,6 @@
 	Input*      active_element_input = NULL;
 	Input*      old_wh_input         = NULL;
-	Input*      surface_runoff_input = NULL;
+	Input*      dummy_input          = NULL;
+	TransientInput*  surface_runoff_input          = NULL;
 
 	/*Fetch number of nodes and dof for this finite element*/
@@ -359,20 +360,30 @@
 	/*Retrieve all inputs and parameters*/
 	basalelement->GetVerticesCoordinates(&xyz_list);
-	//basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
-	basalelement->FindParam(&dt,HydrologydtEnum);
+	basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
 	basalelement->FindParam(&isefficientlayer,HydrologydcIsefficientlayerEnum);
 	basalelement->FindParam(&smb_model,SmbEnum);
 
-	Input*	sed_head_input			 = basalelement->GetInput(SedimentHeadHydrostepEnum);
-	Input*	epl_head_input			 = basalelement->GetInput(EplHeadHydrostepEnum);
-	Input*	base_input					 = basalelement->GetInput(BaseEnum);
+	Input*	sed_head_input			 = basalelement->GetInput(SedimentHeadSubstepEnum);
+	Input*	epl_head_input			 = basalelement->GetInput(EplHeadSubstepEnum);
+	Input*	base_input				 = basalelement->GetInput(BaseEnum);
 	Input*	basal_melt_input		 = basalelement->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(basal_melt_input);
 	Input*	SedTrans_input			 = basalelement->GetInput(HydrologydcSedimentTransmitivityEnum); _assert_(SedTrans_input);
 
+	IssmDouble time;
+	basalelement->FindParam(&time,TimeEnum);
+
+
 	if(dt!= 0.){
 		old_wh_input = basalelement->GetInput(SedimentHeadOldEnum);                  _assert_(old_wh_input);
 	}
 	if(smb_model==SMBgradientscomponentsEnum){
-		surface_runoff_input = basalelement->GetInput(SmbRunoffEnum); _assert_(surface_runoff_input);
+		basalelement->FindParam(&smbsubstepping,SmbStepsPerStepEnum);
+		if(smbsubstepping>1) {
+			dummy_input = basalelement->GetInput(SmbRunoffTransientEnum); _assert_(dummy_input);
+		}
+		else {
+			dummy_input = basalelement->GetInput(SmbRunoffEnum); _assert_(dummy_input);
+		}
+		surface_runoff_input=xDynamicCast<TransientInput*>(dummy_input); _assert_(surface_runoff_input);
 	}
 
@@ -384,4 +395,8 @@
 	/* Start  looping on the number of gaussian points: */
 	Gauss* gauss=basalelement->NewGauss(2);
+
+	IssmDouble yts;
+	basalelement->FindParam(&yts,ConstantsYtsEnum);
+
 	for(int ig=gauss->begin();ig<gauss->end();ig++){
 		gauss->GaussPoint(ig);
@@ -407,6 +422,6 @@
 			if(!active_element){
 				basal_melt_input->GetInputValue(&water_load,gauss);
-				if(surface_runoff_input) surface_runoff_input->GetInputValue(&runoff_value,gauss);
-				else                     runoff_value = 0.;
+				if(surface_runoff_input)surface_runoff_input->GetInputValue(&runoff_value,gauss);
+				else runoff_value = 0.;
 				scalar = Jdet*gauss->weight*(water_load+runoff_value);
 				//scalar = Jdet*gauss->weight*(water_load)/sediment_transmitivity;
@@ -480,5 +495,5 @@
 }/*}}}*/
 void HydrologyDCInefficientAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
-	element->GetSolutionFromInputsOneDof(solution,SedimentHeadHydrostepEnum);
+	element->GetSolutionFromInputsOneDof(solution,SedimentHeadSubstepEnum);
 }/*}}}*/
 void HydrologyDCInefficientAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
@@ -488,9 +503,8 @@
 
 	/*Intermediaries*/
-	bool     thawed_element;
-	int			 domaintype;
+	int	 domaintype;
 	Element* basalelement=NULL;
-	bool		 converged;
-	int*		 doflist	=	NULL;
+	bool	 converged;
+	int*     doflist = NULL;
 
 	/*Get basal element*/
@@ -506,20 +520,18 @@
 		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
 	}
-
 	/*Fetch number of nodes for this finite element*/
 	int numnodes = basalelement->GetNumberOfNodes();
 
 	/*Fetch dof list and allocate solution vector*/
-	basalelement->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+	basalelement->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
 	IssmDouble* values   = xNew<IssmDouble>(numnodes);
 	IssmDouble* pressure = xNew<IssmDouble>(numnodes);
 	IssmDouble* residual = xNew<IssmDouble>(numnodes);
 
-	/*Use the dof list to index into the solution vector: */
-
 	for(int i=0;i<numnodes;i++){
-		values[i] =solution[doflist[i]];
+	  	values[i] =solution[doflist[i]];
 		if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
 		if(xIsInf<IssmDouble>(values[i])) _error_("Inf found in solution vector");
+
 	}
 
@@ -531,27 +543,20 @@
 		IssmDouble  penalty_factor,kmax,kappa,h_max;
 		IssmDouble* thickness = xNew<IssmDouble>(numnodes);
-		IssmDouble* base      = xNew<IssmDouble>(numnodes);
+		IssmDouble* base = xNew<IssmDouble>(numnodes);
 		IssmDouble* transmitivity = xNew<IssmDouble>(numnodes);
 
 		basalelement->FindParam(&kmax,HydrologySedimentKmaxEnum);
 		basalelement->FindParam(&penalty_factor,HydrologydcPenaltyFactorEnum);
-		IssmDouble rho_freshwater = basalelement->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-		IssmDouble rho_ice        = basalelement->GetMaterialParameter(MaterialsRhoIceEnum);
-		IssmDouble g              = basalelement->GetMaterialParameter(ConstantsGEnum);
-
-		basalelement->GetInputListOnVertices(thickness,ThicknessEnum);
-		basalelement->GetInputListOnVertices(base,BaseEnum);
-		basalelement->GetInputListOnVertices(transmitivity,HydrologydcSedimentTransmitivityEnum);
+		IssmDouble rho_freshwater = basalelement->FindParam(MaterialsRhoFreshwaterEnum);
+		IssmDouble rho_ice        = basalelement->FindParam(MaterialsRhoIceEnum);
+		IssmDouble g              = basalelement->FindParam(ConstantsGEnum);
+
+		basalelement->GetInputListOnVertices(&thickness[0],ThicknessEnum);
+		basalelement->GetInputListOnVertices(&base[0],BaseEnum);
+		basalelement->GetInputListOnVertices(&transmitivity[0],HydrologydcSedimentTransmitivityEnum);
+
 		kappa=kmax*pow(10.,penalty_factor);
 
-
-		Input* thawed_element_input = basalelement->GetInput(HydrologydcMaskThawedEltEnum); _assert_(thawed_element_input);
-		thawed_element_input->GetInputValue(&thawed_element);
-
 		for(int i=0;i<numnodes;i++){
-			/*frozen elements heads are set to base elevation*/
-			if(!thawed_element){
-				values[i]=base[i];
-			}
 			GetHydrologyDCInefficientHmax(&h_max,basalelement,basalelement->GetNode(i));
 			if(values[i]>h_max) {
@@ -563,14 +568,13 @@
 			}
 			pressure[i]=(rho_ice*g*thickness[i])-(rho_freshwater*g*(values[i]-base[i]));
-
 		}
 		xDelete<IssmDouble>(thickness);
+		xDelete<IssmDouble>(base);
 		xDelete<IssmDouble>(transmitivity);
-		xDelete<IssmDouble>(base);
 	}
 
 	/*Add input to the element: */
-	element->AddBasalInput(SedimentHeadHydrostepEnum,values,P1Enum);
-	element->AddBasalInput(EffectivePressureHydrostepEnum,pressure,P1Enum);
+	element->AddBasalInput(SedimentHeadSubstepEnum,values,P1Enum);
+	element->AddBasalInput(EffectivePressureSubstepEnum,pressure,P1Enum);
 	element->AddBasalInput(SedimentHeadResidualEnum,residual,P1Enum);
 
@@ -595,10 +599,10 @@
 	IssmDouble storing,yield;
 	IssmDouble base_elev,prestep_head,water_sheet;
-	IssmDouble rho_freshwater           = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-	IssmDouble g                        = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble sediment_porosity        = element->GetMaterialParameter(HydrologydcSedimentPorosityEnum);
-	IssmDouble sediment_thickness       = element->GetMaterialParameter(HydrologydcSedimentThicknessEnum);
-	IssmDouble sediment_compressibility = element->GetMaterialParameter(HydrologydcSedimentCompressibilityEnum);
-	IssmDouble water_compressibility    = element->GetMaterialParameter(HydrologydcWaterCompressibilityEnum);
+	IssmDouble rho_freshwater           = element->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble g                        = element->FindParam(ConstantsGEnum);
+	IssmDouble sediment_porosity        = element->FindParam(HydrologydcSedimentPorosityEnum);
+	IssmDouble sediment_thickness       = element->FindParam(HydrologydcSedimentThicknessEnum);
+	IssmDouble sediment_compressibility = element->FindParam(HydrologydcSedimentCompressibilityEnum);
+	IssmDouble water_compressibility    = element->FindParam(HydrologydcWaterCompressibilityEnum);
 	element->FindParam(&unconf_scheme,HydrologydcUnconfinedFlagEnum);
 	switch(unconf_scheme){
@@ -636,5 +640,5 @@
 	IssmDouble groundedice;
 	IssmDouble base_elev,prestep_head,water_sheet;
-	IssmDouble sediment_thickness       = element->GetMaterialParameter(HydrologydcSedimentThicknessEnum);
+	IssmDouble sediment_thickness       = element->FindParam(HydrologydcSedimentThicknessEnum);
 
 	element->FindParam(&unconf_scheme,HydrologydcUnconfinedFlagEnum);
@@ -681,6 +685,6 @@
 	case 2:
 		/*Compute max*/
-		rho_water = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-		rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
+		rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
+		rho_ice   = element->FindParam(MaterialsRhoIceEnum);
 		element->GetInputValue(&thickness,innode,ThicknessEnum);
 		element->GetInputValue(&bed,innode,BaseEnum);
Index: /issm/trunk/src/c/analyses/HydrologyDCInefficientAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyDCInefficientAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/HydrologyDCInefficientAnalysis.h	(revision 24313)
@@ -17,5 +17,5 @@
 		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
Index: /issm/trunk/src/c/analyses/HydrologyGlaDSAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 24313)
+++ /issm/trunk/src/c/analyses/HydrologyGlaDSAnalysis.cpp	(revision 24313)
@@ -0,0 +1,613 @@
+#include "./HydrologyGlaDSAnalysis.h"
+#include "../toolkits/toolkits.h"
+#include "../classes/classes.h"
+#include "../shared/shared.h"
+#include "../modules/modules.h"
+
+#define AEPS 2.2204460492503131E-015
+
+/*Model processing*/
+void HydrologyGlaDSAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+
+	/*retrieve some parameters: */
+	int hydrology_model;
+	iomodel->FindConstant(&hydrology_model,"md.hydrology.model");
+
+	if(hydrology_model!=HydrologyGlaDSEnum) return;
+
+	IoModelToConstraintsx(constraints,iomodel,"md.hydrology.spcphi",HydrologyGlaDSAnalysisEnum,P1Enum);
+
+}/*}}}*/
+void HydrologyGlaDSAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
+
+	/*Fetch parameters: */
+	int  hydrology_model;
+	iomodel->FindConstant(&hydrology_model,"md.hydrology.model");
+
+	/*Now, do we really want GlaDS?*/
+	if(hydrology_model!=HydrologyGlaDSEnum) return;
+
+	/*Add channels?*/
+	int K,L;
+	bool ischannels;
+	IssmDouble* channelarea;
+	iomodel->FindConstant(&ischannels,"md.hydrology.ischannels");
+	iomodel->FetchData(&channelarea,&K,&L,"md.initialization.channelarea");
+	if(ischannels){
+		/*Get faces (edges in 2d)*/
+		CreateFaces(iomodel);
+		for(int i=0;i<iomodel->numberoffaces;i++){
+
+			/*Get left and right elements*/
+			int element=iomodel->faces[4*i+2]-1; //faces are [node1 node2 elem1 elem2]
+
+			/*Now, if this element is not in the partition*/
+			if(!iomodel->my_elements[element]) continue;
+
+			/*Add channelarea from initialization if exists*/
+			if(K!=0 && K!=iomodel->numberoffaces){
+				_error_("Unknown dimension for channel area initialization.");
+			}
+			if(K==0){
+				loads->AddObject(new Channel(i+1,0.,i,iomodel));
+			}
+			else{
+				loads->AddObject(new Channel(i+1,channelarea[i],i,iomodel));
+			}
+			iomodel->DeleteData(1,"md.initialization.channelarea");
+		}
+	}
+
+	/*Create discrete loads for Moulins*/
+	CreateSingleNodeToElementConnectivity(iomodel);
+	for(int i=0;i<iomodel->numberofvertices;i++){
+		if (iomodel->domaintype!=Domain3DEnum){
+			/*keep only this partition's nodes:*/
+			if(iomodel->my_vertices[i]){
+				loads->AddObject(new Moulin(i+1,i,iomodel));
+			}
+		}
+		else if(reCast<int>(iomodel->Data("md.mesh.vertexonbase")[i])){
+			if(iomodel->my_vertices[i]){
+				loads->AddObject(new Moulin(i+1,i,iomodel));
+			}	
+		}
+	}
+	iomodel->DeleteData(1,"md.mesh.vertexonbase");
+
+	/*Deal with Neumann BC*/
+	int M,N;
+	int *segments = NULL;
+	iomodel->FetchData(&segments,&M,&N,"md.mesh.segments");
+
+	/*Check that the size seem right*/
+	_assert_(N==3); _assert_(M>=3);
+	for(int i=0;i<M;i++){
+		if(iomodel->my_elements[segments[i*3+2]-1]){
+			loads->AddObject(new Neumannflux(i+1,i,iomodel,segments));
+		}
+	}
+	xDelete<int>(segments);
+
+}/*}}}*/
+void HydrologyGlaDSAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
+
+	/*Fetch parameters: */
+	int  hydrology_model;
+	iomodel->FindConstant(&hydrology_model,"md.hydrology.model");
+
+	/*Now, do we really want GlaDS?*/
+	if(hydrology_model!=HydrologyGlaDSEnum) return;
+
+	if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
+	::CreateNodes(nodes,iomodel,HydrologyGlaDSAnalysisEnum,P1Enum);
+	iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
+}/*}}}*/
+int  HydrologyGlaDSAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
+	return 1;
+}/*}}}*/
+void HydrologyGlaDSAnalysis::UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
+
+	/*Fetch data needed: */
+	int    hydrology_model,frictionlaw;
+	iomodel->FindConstant(&hydrology_model,"md.hydrology.model");
+
+	/*Now, do we really want GlaDS?*/
+	if(hydrology_model!=HydrologyGlaDSEnum) return;
+
+	/*Update elements: */
+	int counter=0;
+	for(int i=0;i<iomodel->numberofelements;i++){
+		if(iomodel->my_elements[i]){
+			Element* element=(Element*)elements->GetObjectByOffset(counter);
+			element->Update(i,iomodel,analysis_counter,analysis_type,P1Enum);
+			counter++;
+		}
+	}
+
+	iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum);
+	iomodel->FetchDataToInput(elements,"md.geometry.base",BaseEnum);
+	iomodel->FetchDataToInput(elements,"md.geometry.bed",BedEnum);
+	iomodel->FetchDataToInput(elements,"md.basalforcings.geothermalflux",BasalforcingsGeothermalfluxEnum);
+	iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum);
+	if(iomodel->domaintype!=Domain2DhorizontalEnum){
+		iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum);
+		iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum);
+	}
+	iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
+	iomodel->FetchDataToInput(elements,"md.mask.groundedice_levelset",MaskGroundediceLevelsetEnum);
+	iomodel->FetchDataToInput(elements,"md.hydrology.bump_height",HydrologyBumpHeightEnum);
+	iomodel->FetchDataToInput(elements,"md.hydrology.sheet_conductivity",HydrologySheetConductivityEnum);
+	iomodel->FetchDataToInput(elements,"md.hydrology.neumannflux",HydrologyNeumannfluxEnum);
+	iomodel->FetchDataToInput(elements,"md.hydrology.moulin_input",HydrologyMoulinInputEnum);
+	iomodel->FetchDataToInput(elements,"md.initialization.watercolumn",HydrologySheetThicknessEnum);
+	iomodel->FetchDataToInput(elements,"md.initialization.hydraulic_potential",HydraulicPotentialEnum);
+	iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum);
+	iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum);
+	iomodel->FindConstant(&frictionlaw,"md.friction.law");
+
+	/*Friction law variables*/
+	switch(frictionlaw){
+		case 1:
+			iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum);
+			iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum);
+			iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum);
+			break;
+		case 8:
+			iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum);
+			break;
+		default:
+			_error_("Friction law "<< frictionlaw <<" not supported");
+	}
+}/*}}}*/
+void HydrologyGlaDSAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+
+	/*retrieve some parameters: */
+	int    hydrology_model;
+	int    numoutputs;
+	char** requestedoutputs = NULL;
+	iomodel->FindConstant(&hydrology_model,"md.hydrology.model");
+
+	/*Now, do we really want GlaDS?*/
+	if(hydrology_model!=HydrologyGlaDSEnum) return;
+
+	parameters->AddObject(new IntParam(HydrologyModelEnum,hydrology_model));
+	parameters->AddObject(iomodel->CopyConstantObject("md.friction.law",FrictionLawEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.pressure_melt_coefficient",HydrologyPressureMeltCoefficientEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.cavity_spacing",HydrologyCavitySpacingEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.ischannels",HydrologyIschannelsEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.melt_flag",HydrologyMeltFlagEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.channel_conductivity",HydrologyChannelConductivityEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.channel_sheet_width",HydrologyChannelSheetWidthEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.englacial_void_ratio",HydrologyEnglacialVoidRatioEnum));
+
+	/*Deal with friction parameters*/
+	int frictionlaw;
+	iomodel->FindConstant(&frictionlaw,"md.friction.law");
+	if(frictionlaw==4 || frictionlaw==6){
+		parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum));
+	}
+	if(frictionlaw==3 || frictionlaw==1 || frictionlaw==7){
+		parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum));
+	}
+	if(frictionlaw==9){
+		parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum));
+		parameters->AddObject(new IntParam(FrictionCouplingEnum,0));
+	}
+
+  /*Requested outputs*/
+  iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.hydrology.requested_outputs");
+  parameters->AddObject(new IntParam(HydrologyNumRequestedOutputsEnum,numoutputs));
+  if(numoutputs)parameters->AddObject(new StringArrayParam(HydrologyRequestedOutputsEnum,requestedoutputs,numoutputs));
+  iomodel->DeleteData(&requestedoutputs,numoutputs,"md.hydrology.requested_outputs");
+}/*}}}*/
+
+/*Finite Element Analysis*/
+void           HydrologyGlaDSAnalysis::Core(FemModel* femmodel){/*{{{*/
+	_error_("not implemented");
+}/*}}}*/
+ElementVector* HydrologyGlaDSAnalysis::CreateDVector(Element* element){/*{{{*/
+	/*Default, return NULL*/
+	return NULL;
+}/*}}}*/
+ElementMatrix* HydrologyGlaDSAnalysis::CreateJacobianMatrix(Element* element){/*{{{*/
+	_error_("Not implemented");
+}/*}}}*/
+ElementMatrix* HydrologyGlaDSAnalysis::CreateKMatrix(Element* element){/*{{{*/
+
+	/*Intermediaries */
+	IssmDouble  Jdet,dphi[3],h,k;
+	IssmDouble  A,B,n,phi_old,phi,phi_0,H,b,v1;
+	IssmDouble* xyz_list = NULL;
+
+	/*Hard coded coefficients*/
+	const IssmPDouble alpha = 5./4.;
+	const IssmPDouble beta  = 3./2.;
+
+	/*Fetch number of nodes and dof for this finite element*/
+	int numnodes = element->GetNumberOfNodes();
+
+	/*Initialize Element vector and other vectors*/
+	ElementMatrix* Ke     = element->NewElementMatrix();
+	IssmDouble*    dbasis = xNew<IssmDouble>(2*numnodes);
+	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
+
+	/*Retrieve all inputs and parameters*/
+	element->GetVerticesCoordinates(&xyz_list);
+
+	/*Get all inputs and parameters*/
+	IssmDouble dt        = element->FindParam(TimesteppingTimeStepEnum);
+	IssmDouble rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble g         = element->FindParam(ConstantsGEnum);
+	IssmDouble e_v       = element->FindParam(HydrologyEnglacialVoidRatioEnum);
+	Input* k_input   = element->GetInput(HydrologySheetConductivityEnum);_assert_(k_input);
+	Input* phi_input = element->GetInput(HydraulicPotentialEnum);      _assert_(phi_input);
+	Input* h_input   = element->GetInput(HydrologySheetThicknessEnum); _assert_(h_input);
+	Input* H_input      = element->GetInput(ThicknessEnum); _assert_(H_input);
+	Input* b_input      = element->GetInput(BedEnum); _assert_(b_input);
+	Input* B_input      = element->GetInput(MaterialsRheologyBEnum);         _assert_(B_input);
+	Input* n_input      = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss=element->NewGauss(2);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+		gauss->GaussPoint(ig);
+
+		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
+		element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+		element->NodalFunctions(basis,gauss);
+
+		phi_input->GetInputDerivativeValue(&dphi[0],xyz_list,gauss);
+		phi_input->GetInputValue(&phi,gauss);
+		h_input->GetInputValue(&h,gauss);
+		k_input->GetInputValue(&k,gauss);
+		B_input->GetInputValue(&B,gauss);
+		n_input->GetInputValue(&n,gauss);
+		b_input->GetInputValue(&b,gauss);
+		H_input->GetInputValue(&H,gauss);
+
+		/*Get norm of gradient of hydraulic potential and make sure it is >0*/
+		IssmDouble normgradphi = sqrt(dphi[0]*dphi[0] + dphi[1]*dphi[1]);
+		if(normgradphi < AEPS) normgradphi = AEPS;
+
+		IssmDouble coeff = k*pow(h,alpha)*pow(normgradphi,beta-2.);
+
+		/*Diffusive term*/
+		for(int i=0;i<numnodes;i++){
+			for(int j=0;j<numnodes;j++){
+				Ke->values[i*numnodes+j] += gauss->weight*Jdet*(
+							coeff*dbasis[0*numnodes+i]*dbasis[0*numnodes+j]
+							+ coeff*dbasis[1*numnodes+i]*dbasis[1*numnodes+j]);
+			}
+		}
+
+		/*Closing rate term, see Gagliardini and Werder 2018 eq. A2 (v = v1*phi_i + v2(phi_{i+1}))*/
+		phi_0 = rho_water*g*b + rho_ice*g*H;
+		A=pow(B,-n);
+		v1 = 2./pow(n,n)*A*h*(pow(fabs(phi_0 - phi),n-1.)*( - n));
+		for(int i=0;i<numnodes;i++){
+			for(int j=0;j<numnodes;j++){
+				Ke->values[i*numnodes+j] += gauss->weight*Jdet*(-v1)*basis[i]*basis[j];
+			}
+		}
+
+		/*Transient term if dt>0*/
+		if(dt>0.){
+			/*Diffusive term*/
+			for(int i=0;i<numnodes;i++){
+				for(int j=0;j<numnodes;j++){
+					Ke->values[i*numnodes+j] += gauss->weight*Jdet*e_v/(rho_water*g*dt)*basis[i]*basis[j];
+				}
+			}
+		}
+
+	}
+
+	/*Clean up and return*/
+	xDelete<IssmDouble>(xyz_list);
+	xDelete<IssmDouble>(basis);
+	xDelete<IssmDouble>(dbasis);
+	delete gauss;
+	return Ke;
+}/*}}}*/
+ElementVector* HydrologyGlaDSAnalysis::CreatePVector(Element* element){/*{{{*/
+
+	/*Skip if water or ice shelf element*/
+	if(element->IsFloating()) return NULL;
+
+	/*Intermediaries */
+	bool        meltflag;
+	IssmDouble  Jdet,w,v2,vx,vy,ub,h,h_r;
+	IssmDouble  G,m,frictionheat,alpha2;
+	IssmDouble  A,B,n,phi_old,phi,phi_0;
+	IssmDouble  H,b;
+	IssmDouble* xyz_list = NULL;
+
+	/*Fetch number of nodes and dof for this finite element*/
+	int numnodes = element->GetNumberOfNodes();
+
+	/*Initialize Element vector and other vectors*/
+	ElementVector* pe    = element->NewElementVector();
+	IssmDouble*    basis = xNew<IssmDouble>(numnodes);
+
+	/*Retrieve all inputs and parameters*/
+	element->GetVerticesCoordinates(&xyz_list);
+	element->FindParam(&meltflag,HydrologyMeltFlagEnum);
+	IssmDouble L         = element->FindParam(MaterialsLatentheatEnum);
+	IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble l_r       = element->FindParam(HydrologyCavitySpacingEnum);
+	IssmDouble dt        = element->FindParam(TimesteppingTimeStepEnum);
+	IssmDouble g         = element->FindParam(ConstantsGEnum);
+	IssmDouble e_v       = element->FindParam(HydrologyEnglacialVoidRatioEnum);
+	Input* hr_input     = element->GetInput(HydrologyBumpHeightEnum);_assert_(hr_input);
+	Input* vx_input     = element->GetInput(VxEnum);_assert_(vx_input);
+	Input* vy_input     = element->GetInput(VyEnum);_assert_(vy_input);
+	Input* h_input      = element->GetInput(HydrologySheetThicknessEnum);_assert_(h_input);
+	Input* H_input      = element->GetInput(ThicknessEnum); _assert_(H_input);
+	Input* b_input      = element->GetInput(BedEnum); _assert_(b_input);
+	Input* G_input      = element->GetInput(BasalforcingsGeothermalfluxEnum);_assert_(G_input);
+	Input* m_input      = element->GetInput(BasalforcingsGroundediceMeltingRateEnum);_assert_(m_input);
+	Input* B_input      = element->GetInput(MaterialsRheologyBEnum);         _assert_(B_input);
+	Input* n_input      = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
+	Input* phiold_input = element->GetInput(HydraulicPotentialOldEnum);      _assert_(phiold_input);
+	Input* phi_input    = element->GetInput(HydraulicPotentialEnum);         _assert_(phi_input);
+
+	/*Build friction element, needed later: */
+	Friction* friction=new Friction(element,2);
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss=element->NewGauss(2);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+		gauss->GaussPoint(ig);
+
+		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
+		element->NodalFunctions(basis,gauss);
+
+		/*Get input values at gauss points*/
+		vx_input->GetInputValue(&vx,gauss);
+		vy_input->GetInputValue(&vy,gauss);
+		h_input->GetInputValue(&h,gauss);
+		G_input->GetInputValue(&G,gauss);
+		B_input->GetInputValue(&B,gauss);
+		n_input->GetInputValue(&n,gauss);
+		hr_input->GetInputValue(&h_r,gauss);
+		phi_input->GetInputValue(&phi,gauss);
+		b_input->GetInputValue(&b,gauss);
+		H_input->GetInputValue(&H,gauss);
+
+		/*Get basal velocity*/
+		ub = sqrt(vx*vx + vy*vy);
+
+		/*Compute cavity opening w*/
+		w  = 0.;
+		if(h<h_r) w = ub*(h_r-h)/l_r;
+
+		/*Compute frictional heat flux*/
+		friction->GetAlpha2(&alpha2,gauss);
+		frictionheat=alpha2*ub*ub;
+
+		/*Compute melt (if necessary)*/
+		if(!meltflag){
+			m = (G + frictionheat)/(rho_ice*L);
+		}
+		else{
+			m_input->GetInputValue(&m,gauss);
+		}
+
+		/*Compute closing rate*/
+		phi_0 = rho_water*g*b + rho_ice*g*H;
+		A=pow(B,-n);
+		v2 = 2./pow(n,n)*A*h*(pow(fabs(phi_0 - phi),n-1.)*(phi_0 +(n-1.)*phi));
+
+		for(int i=0;i<numnodes;i++) pe->values[i]+= - Jdet*gauss->weight*(w-v2-m)*basis[i];
+
+		/*Transient term if dt>0*/
+		if(dt>0.){
+			phiold_input->GetInputValue(&phi_old,gauss);
+			for(int i=0;i<numnodes;i++) pe->values[i] += gauss->weight*Jdet*e_v/(rho_water*g*dt)*phi_old*basis[i];
+		}
+	}
+
+	/*Clean up and return*/
+	xDelete<IssmDouble>(xyz_list);
+	xDelete<IssmDouble>(basis);
+	delete gauss;
+	delete friction;
+	return pe;
+}/*}}}*/
+void           HydrologyGlaDSAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+
+	element->GetSolutionFromInputsOneDof(solution,HydraulicPotentialEnum);
+
+}/*}}}*/
+void           HydrologyGlaDSAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+	_error_("Not implemented yet");
+}/*}}}*/
+void           HydrologyGlaDSAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+	element->InputUpdateFromSolutionOneDof(solution,HydraulicPotentialEnum);
+}/*}}}*/
+void           HydrologyGlaDSAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+	/*Default, do nothing*/
+	return;
+}/*}}}*/
+
+/*GlaDS specifics*/
+void HydrologyGlaDSAnalysis::SetChannelCrossSectionOld(FemModel* femmodel){/*{{{*/
+
+	bool ischannels;
+	femmodel->parameters->FindParam(&ischannels,HydrologyIschannelsEnum);
+	if(!ischannels) return;
+
+	for(int i=0;i<femmodel->loads->Size();i++){
+		if(femmodel->loads->GetEnum(i)==ChannelEnum){
+			Channel* channel=(Channel*)femmodel->loads->GetObjectByOffset(i);
+			channel->SetChannelCrossSectionOld();
+		}
+	}
+
+}/*}}}*/
+void HydrologyGlaDSAnalysis::UpdateSheetThickness(FemModel* femmodel){/*{{{*/
+
+	for(int j=0;j<femmodel->elements->Size();j++){
+		Element* element=(Element*)femmodel->elements->GetObjectByOffset(j);
+		UpdateSheetThickness(element);
+	}
+
+}/*}}}*/
+void HydrologyGlaDSAnalysis::UpdateSheetThickness(Element* element){/*{{{*/
+
+	/*Skip if water or ice shelf element*/
+	if(element->IsFloating()) return;
+
+	/*Intermediaries */
+	IssmDouble  Jdet,vx,vy,ub,h_old,N,h_r,H,b;
+	IssmDouble  A,B,n,phi,phi_0;
+	IssmDouble  alpha,beta;
+
+	/*Fetch number vertices for this element*/
+	int numvertices = element->GetNumberOfVertices();
+
+	/*Initialize new sheet thickness*/
+	IssmDouble* h_new = xNew<IssmDouble>(numvertices);
+
+	/*Retrieve all inputs and parameters*/
+	IssmDouble  dt       = element->FindParam(TimesteppingTimeStepEnum);
+	IssmDouble  l_r      = element->FindParam(HydrologyCavitySpacingEnum);
+	IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble g         = element->FindParam(ConstantsGEnum);
+	Input* hr_input = element->GetInput(HydrologyBumpHeightEnum);_assert_(hr_input);
+	Input* vx_input = element->GetInput(VxEnum);_assert_(vx_input);
+	Input* vy_input = element->GetInput(VyEnum);_assert_(vy_input);
+	Input* H_input  = element->GetInput(ThicknessEnum); _assert_(H_input);
+	Input* b_input  = element->GetInput(BedEnum); _assert_(b_input);
+	Input* hold_input  = element->GetInput(HydrologySheetThicknessOldEnum);_assert_(hold_input);
+	Input* B_input  = element->GetInput(MaterialsRheologyBEnum);         _assert_(B_input);
+	Input* n_input  = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
+	Input* phi_input = element->GetInput(HydraulicPotentialEnum);         _assert_(phi_input);
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss=element->NewGauss();
+	for(int iv=0;iv<numvertices;iv++){
+		gauss->GaussVertex(iv);
+
+		/*Get input values at gauss points*/
+		phi_input->GetInputValue(&phi,gauss);
+		vx_input->GetInputValue(&vx,gauss);
+		vy_input->GetInputValue(&vy,gauss);
+		hold_input->GetInputValue(&h_old,gauss);
+		B_input->GetInputValue(&B,gauss);
+		n_input->GetInputValue(&n,gauss);
+		hr_input->GetInputValue(&h_r,gauss);
+		b_input->GetInputValue(&b,gauss);
+		H_input->GetInputValue(&H,gauss);
+
+		/*Get values for a few potentials*/
+		phi_0 = rho_water*g*b + rho_ice*g*H;
+		N = phi_0 - phi;
+
+		/*Get basal velocity*/
+		ub = sqrt(vx*vx + vy*vy);
+
+		/*Get A from B and n*/
+		A=pow(B,-n);
+
+		/*Define alpha and beta*/
+		if(h_old<h_r){
+			alpha = -ub/l_r - 2./pow(n,n)*A*pow(fabs(N),n-1.)*N;
+			beta  = ub*h_r/l_r;
+		}
+		else{
+			alpha = - 2./pow(n,n)*A*pow(fabs(N),n-1.)*N;
+			beta  = 0.;
+		}
+
+		/*Get new sheet thickness*/
+		h_new[iv] = ODE1(alpha,beta,h_old,dt,1);
+
+		/*Make sure it is positive*/
+		if(h_new[iv]<AEPS) h_new[iv] = AEPS;
+	}
+
+	element->AddInput(HydrologySheetThicknessEnum,h_new,P1Enum);
+
+	/*Clean up and return*/
+	xDelete<IssmDouble>(h_new);
+	delete gauss;
+}/*}}}*/
+void HydrologyGlaDSAnalysis::UpdateEffectivePressure(FemModel* femmodel){/*{{{*/
+
+	for(int j=0;j<femmodel->elements->Size();j++){
+		Element* element=(Element*)femmodel->elements->GetObjectByOffset(j);
+		UpdateEffectivePressure(element);
+	}
+
+}/*}}}*/
+void HydrologyGlaDSAnalysis::UpdateEffectivePressure(Element* element){/*{{{*/
+
+	/*Skip if water or ice shelf element*/
+	if(element->IsFloating()) return;
+	
+	/*Intermediary*/
+	IssmDouble phi_0, phi_m, p_i;
+	IssmDouble H,b,phi;
+
+	int numnodes = element->GetNumberOfNodes();
+
+	/*Get thickness and base on nodes to apply cap on water head*/
+   IssmDouble* N = xNew<IssmDouble>(numnodes);
+	IssmDouble  rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble  g         = element->FindParam(ConstantsGEnum);
+	Input* H_input   = element->GetInput(ThicknessEnum); _assert_(H_input);
+	Input* b_input   = element->GetInput(BedEnum); _assert_(b_input);
+	Input* phi_input = element->GetInput(HydraulicPotentialEnum); _assert_(phi_input);
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss=element->NewGauss();
+	for(int iv=0;iv<numnodes;iv++){
+		gauss->GaussNode(element->FiniteElement(),iv);
+
+		/*Get input values at gauss points*/
+		H_input->GetInputValue(&H,gauss);
+		b_input->GetInputValue(&b,gauss);
+		phi_input->GetInputValue(&phi,gauss);
+
+		/*Elevation potential*/
+		phi_m = rho_water*g*b;
+
+		/*Compute overburden pressure*/
+		p_i = rho_ice*g*H;
+
+		/*Copmute overburden potential*/
+		phi_0 = phi_m + p_i;
+
+		/*Calculate effective pressure*/
+		N[iv] = phi_0 - phi;
+
+		if(xIsNan<IssmDouble>(N[iv])) _error_("NaN found in solution vector");
+		if(xIsInf<IssmDouble>(N[iv])) _error_("Inf found in solution vector");
+	}
+
+	element->AddInput(EffectivePressureEnum,N,element->FiniteElement());
+
+	/*Clean up and return*/
+	delete gauss;
+	xDelete<IssmDouble>(N);
+}/*}}}*/
+void HydrologyGlaDSAnalysis::UpdateChannelCrossSection(FemModel* femmodel){/*{{{*/
+
+	bool ischannels;
+	femmodel->parameters->FindParam(&ischannels,HydrologyIschannelsEnum);
+	if(!ischannels) return;
+
+	for(int i=0;i<femmodel->loads->Size();i++){
+		if(femmodel->loads->GetEnum(i)==ChannelEnum){
+			Channel* channel=(Channel*)femmodel->loads->GetObjectByOffset(i);
+			channel->UpdateChannelCrossSection();
+		}
+	}
+
+}/*}}}*/
Index: /issm/trunk/src/c/analyses/HydrologyGlaDSAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyGlaDSAnalysis.h	(revision 24313)
+++ /issm/trunk/src/c/analyses/HydrologyGlaDSAnalysis.h	(revision 24313)
@@ -0,0 +1,41 @@
+/*! \file HydrologyGlaDSAnalysis.h 
+ *  \brief: header file for generic external result object
+ */
+
+#ifndef _HydrologyGlaDSAnalysis_
+#define _HydrologyGlaDSAnalysis_
+
+/*Headers*/
+#include "./Analysis.h"
+
+class HydrologyGlaDSAnalysis: public Analysis{
+
+	public:
+		/*Model processing*/
+		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
+		void CreateLoads(Loads* loads, IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
+		int  DofsPerNode(int** doflist,int domaintype,int approximation);
+		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
+		void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
+
+		/*Finite element Analysis*/
+		void           Core(FemModel* femmodel);
+		ElementVector* CreateDVector(Element* element);
+		ElementMatrix* CreateJacobianMatrix(Element* element);
+		ElementMatrix* CreateKMatrix(Element* element);
+		ElementVector* CreatePVector(Element* element);
+		void           GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+		void           GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+		void           InputUpdateFromSolution(IssmDouble* solution,Element* element);
+		void           UpdateConstraints(FemModel* femmodel);
+
+		/*Specific to GlaDS*/
+		void SetChannelCrossSectionOld(FemModel* femmodel);
+		void UpdateSheetThickness(FemModel* femmodel);
+		void UpdateSheetThickness(Element*  element);
+		void UpdateChannelCrossSection(FemModel* femmodel);
+		void UpdateEffectivePressure(FemModel* femmodel);
+		void UpdateEffectivePressure(Element* element);
+};
+#endif
Index: /issm/trunk/src/c/analyses/HydrologyPismAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyPismAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/HydrologyPismAnalysis.cpp	(revision 24313)
@@ -16,5 +16,5 @@
 
 }/*}}}*/
-void HydrologyPismAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void HydrologyPismAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 	return;
 }/*}}}*/
@@ -108,6 +108,6 @@
 	/*Retrieve all inputs and parameters*/
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
-	IssmDouble  rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  rho_water = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
+	IssmDouble  rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
 
 	/*Get water column and drainage rate*/
Index: /issm/trunk/src/c/analyses/HydrologyPismAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyPismAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/HydrologyPismAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/HydrologyShaktiAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/HydrologyShaktiAnalysis.cpp	(revision 24313)
@@ -38,10 +38,10 @@
 			/*keep only this partition's nodes:*/
 			if(iomodel->my_vertices[i]){
-				loads->AddObject(new Moulin(iomodel->loadcounter+i+1,i,iomodel,HydrologyShaktiAnalysisEnum));
+				loads->AddObject(new Moulin(i+1,i,iomodel));
 			}
 		}
 		else if(reCast<int>(iomodel->Data("md.mesh.vertexonbase")[i])){
 			if(iomodel->my_vertices[i]){
-				loads->AddObject(new Moulin(iomodel->loadcounter+i+1,i,iomodel,HydrologyShaktiAnalysisEnum));
+				loads->AddObject(new Moulin(i+1,i,iomodel));
 			}	
 		}
@@ -58,12 +58,11 @@
 	for(int i=0;i<M;i++){
 		if(iomodel->my_elements[segments[i*3+2]-1]){
-			loads->AddObject(new Neumannflux(iomodel->loadcounter+i+1,i,iomodel,segments,HydrologyShaktiAnalysisEnum));
+			loads->AddObject(new Neumannflux(i+1,i,iomodel,segments));
 		}
 	}
-
 	xDelete<int>(segments);
 
 }/*}}}*/
-void HydrologyShaktiAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void HydrologyShaktiAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	/*Fetch parameters: */
@@ -241,8 +240,8 @@
 	/*Retrieve all inputs and parameters*/
 	element->GetVerticesCoordinates(&xyz_list);
-	IssmDouble  latentheat      = element->GetMaterialParameter(MaterialsLatentheatEnum);
-	IssmDouble  g               = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  rho_ice         = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  rho_water       = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
+	IssmDouble  latentheat      = element->FindParam(MaterialsLatentheatEnum);
+	IssmDouble  g               = element->FindParam(ConstantsGEnum);
+	IssmDouble  rho_ice         = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  rho_water       = element->FindParam(MaterialsRhoFreshwaterEnum);
 	Input* geothermalflux_input = element->GetInput(BasalforcingsGeothermalfluxEnum);_assert_(geothermalflux_input);
 	Input* head_input           = element->GetInput(HydrologyHeadEnum);              _assert_(head_input);
@@ -355,5 +354,5 @@
 
 	/*Get gravity from parameters*/
-	   IssmDouble  g = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble  g = element->FindParam(ConstantsGEnum);
 
 	/*Fetch number of nodes for this finite element*/
@@ -361,5 +360,5 @@
 
 	/*Fetch dof list and allocate solution vector*/
-	element->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
 	IssmDouble* values = xNew<IssmDouble>(numnodes);
 
@@ -368,6 +367,6 @@
 	IssmDouble* thickness = xNew<IssmDouble>(numnodes);
 	IssmDouble* bed       = xNew<IssmDouble>(numnodes);
-	IssmDouble  rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  rho_water = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
+	IssmDouble  rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
 	element->GetInputListOnNodes(&thickness[0],ThicknessEnum);
 	element->GetInputListOnNodes(&bed[0],BaseEnum);
@@ -437,5 +436,5 @@
 
 	/*Get gravity from parameters*/
-	IssmDouble  g = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble  g = element->FindParam(ConstantsGEnum);
 
 	/*Get Reynolds and gap average values*/
@@ -479,8 +478,8 @@
 	element->GetVerticesCoordinates(&xyz_list);
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
-	IssmDouble  latentheat      = element->GetMaterialParameter(MaterialsLatentheatEnum);
-	IssmDouble  g               = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  rho_ice         = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  rho_water       = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
+	IssmDouble  latentheat      = element->FindParam(MaterialsLatentheatEnum);
+	IssmDouble  g               = element->FindParam(ConstantsGEnum);
+	IssmDouble  rho_ice         = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  rho_water       = element->FindParam(MaterialsRhoFreshwaterEnum);
 	Input* geothermalflux_input = element->GetInput(BasalforcingsGeothermalfluxEnum);_assert_(geothermalflux_input);
 	Input* head_input           = element->GetInput(HydrologyHeadEnum);              _assert_(head_input);
Index: /issm/trunk/src/c/analyses/HydrologyShaktiAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyShaktiAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/HydrologyShaktiAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/HydrologyShreveAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 24313)
@@ -20,5 +20,5 @@
 	/*No loads*/
 }/*}}}*/
-void HydrologyShreveAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void HydrologyShreveAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	/*Fetch parameters: */
@@ -105,8 +105,8 @@
 
 	/*Retrieve all inputs and parameters*/
-	IssmDouble  rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  rho_water = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  g         = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  mu_water  = element->GetMaterialParameter(MaterialsMuWaterEnum);
+	IssmDouble  rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  g         = element->FindParam(ConstantsGEnum);
+	IssmDouble  mu_water  = element->FindParam(MaterialsMuWaterEnum);
 	Input* surfaceslopex_input = element->GetInput(SurfaceSlopeXEnum); _assert_(surfaceslopex_input);
 	Input* surfaceslopey_input = element->GetInput(SurfaceSlopeYEnum); _assert_(surfaceslopey_input);
@@ -356,5 +356,5 @@
 
 	/*Fetch dof list and allocate solution vector*/
-	element->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
 	IssmDouble* values = xNew<IssmDouble>(numnodes);
 
Index: /issm/trunk/src/c/analyses/HydrologyShreveAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/HydrologyShreveAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/HydrologyShreveAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/L2ProjectionBaseAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/L2ProjectionBaseAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/L2ProjectionBaseAnalysis.cpp	(revision 24313)
@@ -14,5 +14,5 @@
 	/*No loads*/
 }/*}}}*/
-void L2ProjectionBaseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void L2ProjectionBaseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	if(iomodel->domaintype==Domain3DEnum){
Index: /issm/trunk/src/c/analyses/L2ProjectionBaseAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/L2ProjectionBaseAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/L2ProjectionBaseAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/L2ProjectionEPLAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/L2ProjectionEPLAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/L2ProjectionEPLAnalysis.cpp	(revision 24313)
@@ -14,5 +14,5 @@
 	/*No loads*/
 }/*}}}*/
-void L2ProjectionEPLAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void L2ProjectionEPLAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 	/*Now, do we really want DC?*/
 	int  hydrology_model;
@@ -60,5 +60,5 @@
 	}
 
-	iomodel->FetchDataToInput(elements,"md.initialization.epl_head",EplHeadHydrostepEnum);
+	iomodel->FetchDataToInput(elements,"md.initialization.epl_head",EplHeadSubstepEnum);
 	iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum);
 	if(iomodel->domaintype!=Domain2DhorizontalEnum){
@@ -202,6 +202,6 @@
 	basalelement->FindParam(&input_enum,InputToL2ProjectEnum);
 	switch(input_enum){
-		case EplHeadSlopeXEnum: input = basalelement->GetInput(EplHeadHydrostepEnum); index = 0; _assert_(input); break;
-		case EplHeadSlopeYEnum: input = basalelement->GetInput(EplHeadHydrostepEnum); index = 1; _assert_(input); break;
+		case EplHeadSlopeXEnum: input = basalelement->GetInput(EplHeadSubstepEnum); index = 0; _assert_(input); break;
+		case EplHeadSlopeYEnum: input = basalelement->GetInput(EplHeadSubstepEnum); index = 1; _assert_(input); break;
 		default: _error_("not implemented");
 	}
Index: /issm/trunk/src/c/analyses/L2ProjectionEPLAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/L2ProjectionEPLAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/L2ProjectionEPLAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/LevelsetAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/LevelsetAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/LevelsetAnalysis.cpp	(revision 24313)
@@ -20,5 +20,5 @@
 	return;
 }/*}}}*/
-void LevelsetAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void LevelsetAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 	int finiteelement;
 	iomodel->FindConstant(&finiteelement,"md.levelset.fe");
@@ -58,24 +58,20 @@
 		case DefaultCalvingEnum:
 			iomodel->FetchDataToInput(elements,"md.calving.calvingrate",CalvingCalvingrateEnum);
-			iomodel->FetchDataToInput(elements,"md.calving.meltingrate",CalvingMeltingrateEnum);
 			break;
 		case CalvingLevermannEnum:
 			iomodel->FetchDataToInput(elements,"md.calving.coeff",CalvinglevermannCoeffEnum);
-			iomodel->FetchDataToInput(elements,"md.calving.meltingrate",CalvinglevermannMeltingrateEnum);
 			break;
 		case CalvingVonmisesEnum:
 			iomodel->FetchDataToInput(elements,"md.calving.stress_threshold_groundedice",CalvingStressThresholdGroundediceEnum);
 			iomodel->FetchDataToInput(elements,"md.calving.stress_threshold_floatingice",CalvingStressThresholdFloatingiceEnum);
-			iomodel->FetchDataToInput(elements,"md.calving.meltingrate",CalvingMeltingrateEnum);
+			iomodel->FetchDataToInput(elements,"md.geometry.bed",BedEnum);
 			break;
 		case CalvingMinthicknessEnum:
-			iomodel->FetchDataToInput(elements,"md.calving.meltingrate",CalvingMeltingrateEnum);
+			iomodel->FetchDataToInput(elements,"md.geometry.bed",BedEnum);
 			break;
 		case CalvingHabEnum:
-			iomodel->FetchDataToInput(elements,"md.calving.meltingrate",CalvingMeltingrateEnum);
 			iomodel->FetchDataToInput(elements,"md.calving.flotation_fraction",CalvingHabFractionEnum);
 			break;
 		case CalvingCrevasseDepthEnum:
-			iomodel->FetchDataToInput(elements,"md.calving.meltingrate",CalvingMeltingrateEnum);
 			iomodel->FetchDataToInput(elements,"md.calving.water_height",WaterheightEnum);
 			break;
@@ -83,15 +79,33 @@
 			iomodel->FetchDataToInput(elements,"md.calving.stress_threshold_groundedice",CalvingStressThresholdGroundediceEnum);
 			iomodel->FetchDataToInput(elements,"md.calving.stress_threshold_floatingice",CalvingStressThresholdFloatingiceEnum);
-			iomodel->FetchDataToInput(elements,"md.calving.meltingrate",CalvingMeltingrateEnum);
 			break;
 		default:
 			_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
+	}
+
+	/*Get frontal melt parameters*/
+	int melt_parameterization;
+	iomodel->FindConstant(&melt_parameterization,"md.frontalforcings.parameterization");
+	switch(melt_parameterization){
+		case FrontalForcingsDefaultEnum:
+			iomodel->FetchDataToInput(elements,"md.frontalforcings.meltingrate",CalvingMeltingrateEnum);
+			break;
+		case FrontalForcingsRignotEnum:
+			iomodel->FetchDataToInput(elements,"md.frontalforcings.basin",FrontalForcingsBasinIdEnum);
+			iomodel->FetchDataToInput(elements,"md.frontalforcings.subglacial_discharge",FrontalForcingsSubglacialDischargeEnum);
+			iomodel->FetchDataToInput(elements,"md.frontalforcings.thermalforcing",FrontalForcingsThermalForcingEnum);
+			break;
+		default:
+			_error_("Frontal forcings"<<EnumToStringx(melt_parameterization)<<" not supported yet");
 	}
 }
 /*}}}*/
 void LevelsetAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+
 	parameters->AddObject(iomodel->CopyConstantObject("md.levelset.stabilization",LevelsetStabilizationEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.levelset.reinit_frequency",LevelsetReinitFrequencyEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.levelset.kill_icebergs",LevelsetKillIcebergsEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.levelset.calving_max",CalvingMaxEnum));
+
 	int  calvinglaw;
 	iomodel->FindConstant(&calvinglaw,"md.calving.law");
@@ -99,5 +113,7 @@
 		case DefaultCalvingEnum:
 		case CalvingLevermannEnum:
+			break;
 		case CalvingVonmisesEnum:
+			parameters->AddObject(iomodel->CopyConstantObject("md.calving.min_thickness",CalvingMinthicknessEnum));
 			break;
 		case CalvingMinthicknessEnum:
@@ -107,5 +123,5 @@
 			break;
 		case CalvingCrevasseDepthEnum:
-			parameters->AddObject(iomodel->CopyConstantObject("md.calving.critical_fraction",CalvingCrevasseDepthEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.calving.crevasse_opening_stress",CalvingCrevasseDepthEnum));
 			break;
 		case CalvingDev2Enum:
@@ -115,5 +131,17 @@
 			_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
 	}
-	return;
+
+	/*Get frontal melt parameters*/
+	int melt_parameterization;
+	iomodel->FindConstant(&melt_parameterization,"md.frontalforcings.parameterization");
+	switch(melt_parameterization){
+		case FrontalForcingsDefaultEnum:
+			break;
+		case FrontalForcingsRignotEnum:
+			parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.numberofbasins",FrontalForcingsNumberofBasinsEnum));
+			break;
+		default:
+			_error_("Frontal forcings "<<EnumToStringx(melt_parameterization)<<" not supported yet");
+	}
 }
 /*}}}*/
@@ -140,5 +168,5 @@
 
 	if(save_results){
-		if(VerboseSolution()) _printf0_("   saving results\n");
+		if(VerboseSolution()) _printf0_("   saving levelset results\n");
 		int outputs[1] = {MaskIceLevelsetEnum};
 		femmodel->RequestedOutputsx(&femmodel->results,&outputs[0],1);
@@ -250,5 +278,5 @@
 				default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
 			}
-			meltingrate_input = basalelement->GetInput(CalvinglevermannMeltingrateEnum);     _assert_(meltingrate_input);
+			meltingrate_input = basalelement->GetInput(CalvingMeltingrateEnum);     _assert_(meltingrate_input);
 			break;
 		case CalvingMinthicknessEnum:
@@ -300,5 +328,5 @@
 		/* Advection */
 		vx_input->GetInputValue(&v[0],gauss);
-		vy_input->GetInputValue(&v[1],gauss); 
+		vy_input->GetInputValue(&v[1],gauss);
 		gr_input->GetInputValue(&groundedice,gauss);
 
@@ -322,5 +350,5 @@
 
 				if(norm_dlsf>1.e-10)
-				 for(i=0;i<dim;i++){ 
+				 for(i=0;i<dim;i++){
 					 c[i]=calvingrate*dlsf[i]/norm_dlsf; m[i]=meltingrate*dlsf[i]/norm_dlsf;
 				 }
@@ -351,5 +379,5 @@
 
 				if(norm_dlsf>1.e-10)
-				 for(i=0;i<dim;i++){ 
+				 for(i=0;i<dim;i++){
 					 c[i]=0.;
 					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
@@ -372,5 +400,5 @@
 
 				if(norm_dlsf>1.e-10)
-				 for(i=0;i<dim;i++){ 
+				 for(i=0;i<dim;i++){
 					 c[i]=0.;
 					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
@@ -395,5 +423,5 @@
 
 				if(norm_dlsf>1.e-10)
-				 for(i=0;i<dim;i++){ 
+				 for(i=0;i<dim;i++){
 					 c[i]=0.;
 					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
@@ -422,5 +450,5 @@
 					meltingrate=0.;
 				}
-				else if(groundedice-calvinghaf>=haf_eps){ 
+				else if(groundedice-calvinghaf>=haf_eps){
 					// ice is well above calvinghaf -> no calving back, i.e. limit calving rate to ice velocity
 					calvingrate=min(calvingrate,vel);
@@ -429,5 +457,5 @@
 				else{ // ice is close to calvinghaf: smooth transition between limitation and free calving.
 					//heaviside: 0 for floating, 1 for grounded
-					heaviside=(groundedice-calvinghaf+haf_eps)/(2.*haf_eps) + sin(PI*(groundedice-calvinghaf)/haf_eps)/(2.*PI); 
+					heaviside=(groundedice-calvinghaf+haf_eps)/(2.*haf_eps) + sin(PI*(groundedice-calvinghaf)/haf_eps)/(2.*PI);
 					calvingrate=heaviside*(min(calvingrate,vel)-calvingrate)+calvingrate;
 					meltingrate=heaviside*meltingrate+0.;
@@ -439,11 +467,11 @@
 
 				if(norm_dlsf>1.e-10)
-				 for(i=0;i<dim;i++){ 
-					 c[i]=calvingrate*dlsf[i]/norm_dlsf; 
+				 for(i=0;i<dim;i++){
+					 c[i]=calvingrate*dlsf[i]/norm_dlsf;
 					 m[i]=meltingrate*dlsf[i]/norm_dlsf;
 				 }
 				else
 				 for(i=0;i<dim;i++){
-					 c[i]=0.; 
+					 c[i]=0.;
 					 m[i]=0.;
 				 }
@@ -478,5 +506,5 @@
 				/* Artificial Diffusion */
 				basalelement->ElementSizes(&hx,&hy,&hz);
-				h=sqrt( pow(hx*w[0]/vel,2) + pow(hy*w[1]/vel,2) ); 
+				h=sqrt( pow(hx*w[0]/vel,2) + pow(hy*w[1]/vel,2) );
 				kappa=h*vel/2.;
 				for(i=0;i<numnodes;i++){
@@ -487,5 +515,5 @@
 					}
 				}
-				break;	
+				break;
 			case 2:
 				  {
@@ -494,6 +522,6 @@
 				h=sqrt( pow(hx*w[0]/vel,2) + pow(hy*w[1]/vel,2) );
 				IssmDouble D[9];
-				for(row=0;row<dim;row++) 
-					for(col=0;col<dim;col++) 
+				for(row=0;row<dim;row++)
+					for(col=0;col<dim;col++)
 						D[row*dim+col] = D_scalar*h/(2.*vel)*w[row]*w[col];
 				GetBprime(Bprime,basalelement,xyz_list,gauss);
@@ -569,7 +597,7 @@
 }/*}}}*/
 void           LevelsetAnalysis::GetB(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
-	/*Compute B  matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2. 
+	/*Compute B  matrix. B=[B1 B2 B3] where Bi is of size 3*NDOF2.
 	 * For node i, Bi can be expressed in the actual coordinate system
-	 * by: 
+	 * by:
 	 *       Bi=[ N ]
 	 *          [ N ]
@@ -596,7 +624,7 @@
 }/*}}}*/
 void           LevelsetAnalysis::GetBprime(IssmDouble* Bprime,Element* element,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
-	/*Compute B'  matrix. B'=[B1' B2' B3'] where Bi' is of size 3*NDOF2. 
+	/*Compute B'  matrix. B'=[B1' B2' B3'] where Bi' is of size 3*NDOF2.
 	 * For node i, Bi' can be expressed in the actual coordinate system
-	 * by: 
+	 * by:
 	 *       Bi_prime=[ dN/dx ]
 	 *                [ dN/dy ]
@@ -671,12 +699,13 @@
 	/*Intermediaries*/
 	int         calvinglaw;
-	IssmDouble  min_thickness,thickness,hab_fraction,crevassedepth;
+	IssmDouble  min_thickness,thickness,hab_fraction;
+	IssmDouble	crevassedepth,surface_crevasse,surface,critical_fraction;
 	IssmDouble  rho_ice,rho_water;
 	IssmDouble  bed,water_depth;
-	IssmDouble  levelset;
+	IssmDouble  levelset,sealevel;
 
 	femmodel->parameters->FindParam(&calvinglaw,CalvingLawEnum);
 
-	if(calvinglaw==CalvingMinthicknessEnum){
+	if(calvinglaw==CalvingMinthicknessEnum || calvinglaw==CalvingVonmisesEnum){
 
 		/*Get minimum thickness threshold*/
@@ -687,7 +716,9 @@
 			Element* element  = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
 
-			int      numnodes = element->GetNumberOfNodes();	
+			int      numnodes = element->GetNumberOfNodes();
 			Gauss*   gauss    = element->NewGauss();
 			Input*   H_input  = element->GetInput(ThicknessEnum); _assert_(H_input);
+			Input*   b_input = element->GetInput(BedEnum); _assert_(b_input);
+			Input*   sl_input = element->GetInput(SealevelEnum); _assert_(sl_input);
 
 			/*Potentially constrain nodes of this element*/
@@ -695,11 +726,15 @@
 				gauss->GaussNode(element->GetElementType(),in);
 				Node* node=element->GetNode(in);
+				if(!node->IsActive()) continue;
+
 				H_input->GetInputValue(&thickness,gauss);
-				if(thickness<min_thickness){
+				b_input->GetInputValue(&bed,gauss);
+				sl_input->GetInputValue(&sealevel,gauss);
+				if(thickness<min_thickness && bed<sealevel){
 					node->ApplyConstraint(0,+1.);
 				}
 				else {
 					/* no ice, set no spc */
-					node->DofInFSet(0); 
+					node->DofInFSet(0);
 				}
 			}
@@ -718,6 +753,6 @@
 			Element* element  = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
 
-			rho_ice = element->GetMaterialParameter(MaterialsRhoIceEnum);
-			rho_water = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
+			rho_ice = element->FindParam(MaterialsRhoIceEnum);
+			rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
 
 			int      numnodes           = element->GetNumberOfNodes();
@@ -732,4 +767,6 @@
 				gauss->GaussNode(element->GetElementType(),in);
 				Node* node=element->GetNode(in);
+				if(!node->IsActive()) continue;
+
 				H_input->GetInputValue(&thickness,gauss);
 				bed_input->GetInputValue(&water_depth,gauss);
@@ -742,5 +779,5 @@
 				else {
 					/* no ice, set no spc */
-					node->DofInFSet(0); 
+					node->DofInFSet(0);
 				}
 			}
@@ -760,12 +797,15 @@
 
 		/*Vector of size number of nodes*/
-		vec_constraint_nodes=new Vector<IssmDouble>(femmodel->nodes->NumberOfNodes(LevelsetAnalysisEnum));
+		vec_constraint_nodes=new Vector<IssmDouble>(femmodel->nodes->NumberOfNodes());
 
 		for(int i=0;i<femmodel->elements->Size();i++){
-			Element* element  = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
-			int      numnodes = element->GetNumberOfNodes();
-			Gauss*   gauss    = element->NewGauss();
-			Input*   crevassedepth_input = element->GetInput(CrevasseDepthEnum); _assert_(crevassedepth_input);
-			Input*   bed_input = element->GetInput(BedEnum); _assert_(bed_input);
+			Element* element               = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+			int      numnodes              = element->GetNumberOfNodes();
+			Gauss*   gauss                 = element->NewGauss();
+			Input*   crevassedepth_input   = element->GetInput(CrevasseDepthEnum); _assert_(crevassedepth_input);
+			Input*   bed_input             = element->GetInput(BedEnum); _assert_(bed_input);
+			Input*   surface_crevasse_input = element->GetInput(SurfaceCrevasseEnum); _assert_(surface_crevasse_input);
+			Input*   thickness_input       = element->GetInput(ThicknessEnum); _assert_(thickness_input);
+			Input*   surface_input         = element->GetInput(SurfaceEnum); _assert_(surface_input);
 
 			/*First, look at ice front and figure out if any of the nodes will be calved*/
@@ -774,7 +814,13 @@
 					gauss->GaussNode(element->GetElementType(),in);
 					Node* node=element->GetNode(in);
+					if(!node->IsActive()) continue;
+
 					crevassedepth_input->GetInputValue(&crevassedepth,gauss);
 					bed_input->GetInputValue(&bed,gauss);
-					if(crevassedepth>0. && bed<0.){
+					surface_crevasse_input->GetInputValue(&surface_crevasse,gauss);
+					thickness_input->GetInputValue(&thickness,gauss);
+					surface_input->GetInputValue(&surface,gauss);
+
+					if((surface_crevasse-surface>0. || crevassedepth-thickness>0.) && bed<0.){
 						vec_constraint_nodes->SetValue(node->Sid(),1.0,INS_VAL);
 					}
@@ -783,4 +829,5 @@
 			delete gauss;
 		}
+
 		/*Assemble vector and serialize: */
 		vec_constraint_nodes->Assemble();
@@ -791,10 +838,13 @@
 			local_nflipped=0;
 			for(int i=0;i<femmodel->elements->Size();i++){
-				Element* element  = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
-				int      numnodes = element->GetNumberOfNodes();
-				Gauss*   gauss    = element->NewGauss();
-				Input*   levelset_input  = element->GetInput(DistanceToCalvingfrontEnum); _assert_(levelset_input);
-				Input*   crevassedepth_input = element->GetInput(CrevasseDepthEnum); _assert_(crevassedepth_input);
-				Input*   bed_input = element->GetInput(BedEnum); _assert_(bed_input);
+				Element* element                = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+				int      numnodes               = element->GetNumberOfNodes();
+				Gauss*   gauss                  = element->NewGauss();
+				Input*   levelset_input         = element->GetInput(DistanceToCalvingfrontEnum); _assert_(levelset_input);
+				Input*   crevassedepth_input    = element->GetInput(CrevasseDepthEnum); _assert_(crevassedepth_input);
+				Input*   bed_input              = element->GetInput(BedEnum); _assert_(bed_input);
+				Input*   surface_crevasse_input = element->GetInput(SurfaceCrevasseEnum); _assert_(surface_crevasse_input);
+				Input*   thickness_input        = element->GetInput(ThicknessEnum); _assert_(thickness_input);
+				Input*   surface_input          = element->GetInput(SurfaceEnum); _assert_(surface_input);
 
 				/*Is this element connected to a node that should be calved*/
@@ -816,6 +866,9 @@
 						crevassedepth_input->GetInputValue(&crevassedepth,gauss);
 						bed_input->GetInputValue(&bed,gauss);
-
-						if(crevassedepth>0. && bed<0. && levelset>-300. && levelset<0. && constraint_nodes[node->Sid()]==0.){
+						surface_crevasse_input->GetInputValue(&surface_crevasse,gauss);
+						thickness_input->GetInputValue(&thickness,gauss);
+						surface_input->GetInputValue(&surface,gauss);
+
+						if((surface_crevasse-surface>0. || crevassedepth-thickness>0.) && bed<0. && levelset>-300. && levelset<0. && constraint_nodes[node->Sid()]==0.){
 							local_nflipped++;
 							vec_constraint_nodes->SetValue(node->Sid(),1.0,INS_VAL);
@@ -846,4 +899,5 @@
 				gauss->GaussNode(element->GetElementType(),in);
 				Node* node=element->GetNode(in);
+				if(!node->IsActive()) continue;
 
 				if(constraint_nodes[node->Sid()]>0.){
Index: /issm/trunk/src/c/analyses/LevelsetAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/LevelsetAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/LevelsetAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/LoveAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/LoveAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/LoveAnalysis.cpp	(revision 24313)
@@ -10,5 +10,5 @@
 void LoveAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
 }/*}}}*/
-void LoveAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void LoveAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 }/*}}}*/
 int  LoveAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
@@ -19,4 +19,21 @@
 }/*}}}*/
 void LoveAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+
+	IssmDouble* frequencies = NULL;
+	int         nfreq;
+	iomodel->FetchData(&nfreq,"md.love.nfreq");
+	iomodel->FetchData(&frequencies,NULL,NULL,"md.love.frequencies");
+	parameters->AddObject(new DoubleVecParam(LoveFrequenciesEnum,frequencies,nfreq));
+	xDelete<IssmDouble>(frequencies);
+
+	parameters->AddObject(iomodel->CopyConstantObject("md.love.nfreq",LoveNfreqEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.love.sh_nmax",LoveShNmaxEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.love.sh_nmin",LoveShNminEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.love.g0",LoveG0Enum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.love.r0",LoveR0Enum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.love.mu0",LoveMu0Enum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.love.allow_layer_deletion",LoveAllowLayerDeletionEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.love.love_kernels",LoveKernelsEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.love.forcing_type",LoveForcingTypeEnum));
 }/*}}}*/
 void LoveAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
Index: /issm/trunk/src/c/analyses/LoveAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/LoveAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/LoveAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/MasstransportAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/MasstransportAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/MasstransportAnalysis.cpp	(revision 24313)
@@ -5,4 +5,6 @@
 #include "../modules/modules.h"
 
+#define FINITEELEMENT P1Enum
+
 /*Model processing*/
 void MasstransportAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
@@ -14,5 +16,5 @@
 	/*Do not add constraints in DG,  they are weakly imposed*/
 	if(stabilization!=3){
-		IoModelToConstraintsx(constraints,iomodel,"md.masstransport.spcthickness",MasstransportAnalysisEnum,P1Enum);
+		IoModelToConstraintsx(constraints,iomodel,"md.masstransport.spcthickness",MasstransportAnalysisEnum,FINITEELEMENT);
 	}
 
@@ -25,5 +27,4 @@
 
 	/*Intermediaries*/
-	int element;
 	int penpair_ids[2];
 	int count=0;
@@ -35,5 +36,5 @@
 
 	/*Loads only in DG*/
-	if (stabilization==3){
+	if(stabilization==3){
 
 		/*Get faces and elements*/
@@ -45,11 +46,9 @@
 
 			/*Get left and right elements*/
-			element=iomodel->faces[4*i+2]-1; //faces are [node1 node2 elem1 elem2]
+			int element=iomodel->faces[4*i+2]-1; //faces are [node1 node2 elem1 elem2]
 
 			/*Now, if this element is not in the partition, pass: */
 			if(!iomodel->my_elements[element]) continue;
-
-			/* Add load */
-			loads->AddObject(new Numericalflux(iomodel->loadcounter+i+1,i,i,iomodel,MasstransportAnalysisEnum));
+			loads->AddObject(new Numericalflux(i+1,i,i,iomodel));
 		}
 
@@ -77,12 +76,9 @@
 
 			/*Get node ids*/
-			penpair_ids[0]=iomodel->nodecounter+reCast<int>(vertex_pairing[2*i+0]);
-			penpair_ids[1]=iomodel->nodecounter+reCast<int>(vertex_pairing[2*i+1]);
+			penpair_ids[0]=reCast<int>(vertex_pairing[2*i+0]);
+			penpair_ids[1]=reCast<int>(vertex_pairing[2*i+1]);
 
 			/*Create Load*/
-			loads->AddObject(new Penpair(
-							iomodel->loadcounter+count+1,
-							&penpair_ids[0],
-							MasstransportAnalysisEnum));
+			loads->AddObject(new Penpair(count+1,&penpair_ids[0]));
 			count++;
 		}
@@ -92,7 +88,6 @@
 	iomodel->DeleteData(vertex_pairing,"md.masstransport.vertex_pairing");
 	iomodel->DeleteData(nodeonbase,"md.mesh.vertexonbase");
-
-}/*}}}*/
-void MasstransportAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+}/*}}}*/
+void MasstransportAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	/*Fetch parameters: */
@@ -106,8 +101,8 @@
 	if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
 	if(stabilization!=3){
-		::CreateNodes(nodes,iomodel,MasstransportAnalysisEnum,P1Enum);
+		::CreateNodes(nodes,iomodel,MasstransportAnalysisEnum,FINITEELEMENT,isamr);
 	}
 	else{
-		::CreateNodes(nodes,iomodel,MasstransportAnalysisEnum,P1DGEnum);
+		::CreateNodes(nodes,iomodel,MasstransportAnalysisEnum,P1DGEnum,isamr);
 	}
 	iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
@@ -134,7 +129,8 @@
 
 	/*Finite element type*/
-	finiteelement = P1Enum;
+	finiteelement = FINITEELEMENT;
 	if(stabilization==3){
 		finiteelement = P1DGEnum;
+		//finiteelement = P0DGEnum;
 	}
 
@@ -158,7 +154,9 @@
 	iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum);
 	iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum);
-
+	if(isgroundingline) 	iomodel->FetchDataToInput(elements,"md.geometry.bed",BedEnum);
 	/*Initialize cumdeltalthickness input*/
 	InputUpdateFromConstantx(elements,0.,SealevelriseCumDeltathicknessEnum);
+	/*Initialize ThicknessResidual input*/
+	InputUpdateFromConstantx(elements,0.,ThicknessResidualEnum);
 
 	/*Get what we need for ocean-induced basal melting*/
@@ -183,4 +181,26 @@
 			iomodel->FetchDataToInput(elements,"md.basalforcings.basin_id",BasalforcingsPicoBasinIdEnum);
 			break;
+		case BasalforcingsIsmip6Enum:{
+			iomodel->FetchDataToInput(elements,"md.basalforcings.basin_id",BasalforcingsIsmip6BasinIdEnum);
+			iomodel->FetchDataToInput(elements,"md.basalforcings.melt_anomaly",BasalforcingsIsmip6MeltAnomalyEnum,0.);
+			IssmDouble** array3d = NULL; int* Ms = NULL; int* Ns = NULL; int K;
+			iomodel->FetchData(&array3d,&Ms,&Ns,&K,"md.basalforcings.tf");
+			if(!array3d) _error_("md.basalforcings.tf not found in binary file");
+			for(int i=0;i<elements->Size();i++){
+				Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
+				if(iomodel->domaintype!=Domain2DhorizontalEnum && !element->IsOnBase()) continue;
+				for(int kk=0;kk<K;kk++){
+					element->DatasetInputAdd(BasalforcingsIsmip6TfEnum,array3d[kk],iomodel,Ms[kk],Ns[kk],1,BasalforcingsIsmip6TfEnum,7,kk);
+				}
+			}
+			xDelete<int>(Ms); xDelete<int>(Ns);
+			for(int i=0;i<K;i++) xDelete<IssmDouble>(array3d[i]);
+			xDelete<IssmDouble*>(array3d);
+			}
+			break;
+		case BeckmannGoosseFloatingMeltRateEnum:
+			iomodel->FetchDataToInput(elements,"md.basalforcings.ocean_salinity",BasalforcingsOceanSalinityEnum);
+			iomodel->FetchDataToInput(elements,"md.basalforcings.ocean_temp",BasalforcingsOceanTempEnum);
+			break;
 		default:
 			_error_("Basal forcing model "<<EnumToStringx(basalforcing_model)<<" not supported yet");
@@ -246,4 +266,5 @@
 			Ke = CreateKMatrixCG(basalelement);
 			break;
+		case P0DGEnum:
 		case P1DGEnum:
 			Ke = CreateKMatrixDG(basalelement);
@@ -268,4 +289,5 @@
 	IssmDouble Jdet,D_scalar,dt,h;
 	IssmDouble vel,vx,vy,dvxdx,dvydy;
+	IssmDouble xi,tau;
 	IssmDouble dvx[2],dvy[2];
 	IssmDouble* xyz_list = NULL;
@@ -286,4 +308,5 @@
 	ElementMatrix* Ke     = element->NewElementMatrix();
 	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
+	IssmDouble*		dbasis = xNew<IssmDouble>(dim*numnodes);
 	IssmDouble*    B      = xNew<IssmDouble>(dim*numnodes);
 	IssmDouble*    Bprime = xNew<IssmDouble>(dim*numnodes);
@@ -349,5 +372,5 @@
 		switch(stabilization){
 			case 0:
-				/*Nothing to be onde*/
+				/*Nothing to be done*/
 				break;
 			case 1:
@@ -359,21 +382,32 @@
 				break;
 			case 2:
+				/*Streamline upwinding*/
+				element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+				vxaverage_input->GetInputAverage(&vx);
 				if(dim==1){
 					vel=fabs(vx)+1.e-8;
-					D[0]=h/(2*vel)*vx*vx;
 				}
 				else{
-					/*Streamline upwinding*/
+					vyaverage_input->GetInputAverage(&vy);
 					vel=sqrt(vx*vx+vy*vy)+1.e-8;
-					D[0*dim+0]=h/(2*vel)*vx*vx;
-					D[1*dim+0]=h/(2*vel)*vy*vx;
-					D[0*dim+1]=h/(2*vel)*vx*vy;
-					D[1*dim+1]=h/(2*vel)*vy*vy;
 				}
+				tau=h/(2*vel);
+				break;
+			case 5:
+				/*SUPG*/
+				if(dim!=2) _error_("Stabilization "<<stabilization<<" not supported yet for dim != 2");
+				element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+				vxaverage_input->GetInputAverage(&vx);
+				vyaverage_input->GetInputAverage(&vy);
+				vel=sqrt(vx*vx+vy*vy)+1.e-8;
+				//xi=0.3130;
+				xi=1;
+				tau=xi*h/(2*vel);
 				break;
 			default:
 				_error_("Stabilization "<<stabilization<<" not supported yet");
 		}
-		if(stabilization==1 || stabilization==2){
+		if(stabilization==1){
+			/*SSA*/
 			if(dim==1) D[0]=D_scalar*D[0];
 			else{
@@ -389,4 +423,52 @@
 						&Ke->values[0],1);
 		}
+		if(stabilization==2){
+			/*Streamline upwind*/
+			for(int i=0;i<numnodes;i++){
+				for(int j=0;j<numnodes;j++){
+					Ke->values[i*numnodes+j]+=dt*gauss->weight*Jdet*tau*(vx*dbasis[0*numnodes+i]+vy*dbasis[1*numnodes+i])*(vx*dbasis[0*numnodes+j]+vy*dbasis[1*numnodes+j]);
+				}
+			}
+		}
+		if(stabilization==5){/*{{{*/
+			 /*Mass matrix - part 2*/
+			for(int i=0;i<numnodes;i++){
+				for(int j=0;j<numnodes;j++){
+					Ke->values[i*numnodes+j]+=gauss->weight*Jdet*tau*basis[j]*(vx*dbasis[0*numnodes+i]+vy*dbasis[1*numnodes+i]);	
+				}
+			}
+			/*Mass matrix - part 3*/
+			for(int i=0;i<numnodes;i++){
+				for(int j=0;j<numnodes;j++){
+					Ke->values[i*numnodes+j]+=gauss->weight*Jdet*tau*basis[j]*(basis[i]*dvxdx+basis[i]*dvydy);	
+				}
+			}
+			
+			/*Advection matrix - part 2, A*/
+			for(int i=0;i<numnodes;i++){
+            for(int j=0;j<numnodes;j++){
+               Ke->values[i*numnodes+j]+=dt*gauss->weight*Jdet*tau*(vx*dbasis[0*numnodes+j]+vy*dbasis[1*numnodes+j])*(vx*dbasis[0*numnodes+i]+vy*dbasis[1*numnodes+i]);
+            }
+         }
+			/*Advection matrix - part 3, A*/
+			for(int i=0;i<numnodes;i++){
+            for(int j=0;j<numnodes;j++){
+					Ke->values[i*numnodes+j]+=dt*gauss->weight*Jdet*tau*(vx*dbasis[0*numnodes+j]+vy*dbasis[1*numnodes+j])*(basis[i]*dvxdx+basis[i]*dvydy);
+				}
+         }
+
+			/*Advection matrix - part 2, B*/
+			for(int i=0;i<numnodes;i++){
+            for(int j=0;j<numnodes;j++){
+					Ke->values[i*numnodes+j]+=dt*gauss->weight*Jdet*tau*(basis[j]*dvxdx+basis[j]*dvydy)*(vx*dbasis[0*numnodes+i]+vy*dbasis[1*numnodes+i]);
+				}
+         }
+			/*Advection matrix - part 3, B*/
+			for(int i=0;i<numnodes;i++){
+            for(int j=0;j<numnodes;j++){
+					Ke->values[i*numnodes+j]+=dt*gauss->weight*Jdet*tau*(basis[j]*dvxdx+basis[j]*dvydy)*(basis[i]*dvxdx+basis[i]*dvydy);	
+				}
+			}
+		}/*}}}*/
 	}
 
@@ -394,4 +476,5 @@
 	xDelete<IssmDouble>(xyz_list);
 	xDelete<IssmDouble>(basis);
+	xDelete<IssmDouble>(dbasis);
 	xDelete<IssmDouble>(B);
 	xDelete<IssmDouble>(Bprime);
@@ -481,4 +564,5 @@
 			pe = CreatePVectorCG(basalelement);
 			break;
+		case P0DGEnum:
 		case P1DGEnum:
 			pe = CreatePVectorDG(basalelement);
@@ -499,4 +583,5 @@
 
 	/*Intermediaries */
+	int			stabilization,dim,domaintype;
 	int         melt_style,point1;
 	bool        mainlyfloating;
@@ -504,8 +589,19 @@
 	IssmDouble  Jdet,dt;
 	IssmDouble  ms,mb,gmb,fmb,thickness;
+	IssmDouble  vx,vy,vel,dvxdx,dvydy,xi,h,tau;
+	IssmDouble  dvx[2],dvy[2];
 	IssmDouble  gllevelset,phi=1.;
 	IssmDouble* xyz_list = NULL;
 	Gauss*      gauss     = NULL;
 
+	/*Get problem dimension*/
+	element->FindParam(&domaintype,DomainTypeEnum);
+	switch(domaintype){
+		case Domain2DverticalEnum:   dim = 1; break;
+		case Domain2DhorizontalEnum: dim = 2; break;
+		case Domain3DEnum:           dim = 2; break;
+		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+	}
+	  
 	/*Fetch number of nodes and dof for this finite element*/
 	int numnodes = element->GetNumberOfNodes();
@@ -514,4 +610,5 @@
 	ElementVector* pe    = element->NewElementVector();
 	IssmDouble*    basis = xNew<IssmDouble>(numnodes);
+	IssmDouble*    dbasis= xNew<IssmDouble>(dim*numnodes);
 
 	/*Retrieve all inputs and parameters*/
@@ -519,14 +616,18 @@
 	element->FindParam(&melt_style,GroundinglineMeltInterpolationEnum);
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
-	Input* gmb_input           = element->GetInput(BasalforcingsGroundediceMeltingRateEnum);  _assert_(gmb_input);
-	Input* fmb_input           = element->GetInput(BasalforcingsFloatingiceMeltingRateEnum);  _assert_(fmb_input);
-	Input* gllevelset_input   = element->GetInput(MaskGroundediceLevelsetEnum);              _assert_(gllevelset_input);
-	Input* ms_input            = element->GetInput(SmbMassBalanceEnum);                       _assert_(ms_input);
-	Input* thickness_input     = element->GetInput(ThicknessEnum);                            _assert_(thickness_input);
-
+	element->FindParam(&stabilization,MasstransportStabilizationEnum);
+	Input* gmb_input        = element->GetInput(BasalforcingsGroundediceMeltingRateEnum);  _assert_(gmb_input);
+	Input* fmb_input        = element->GetInput(BasalforcingsFloatingiceMeltingRateEnum);  _assert_(fmb_input);
+	Input* gllevelset_input = element->GetInput(MaskGroundediceLevelsetEnum);              _assert_(gllevelset_input);
+	Input* ms_input         = element->GetInput(SmbMassBalanceEnum);                       _assert_(ms_input);
+	Input* thickness_input  = element->GetInput(ThicknessEnum);                            _assert_(thickness_input);
+	Input* vxaverage_input  = element->GetInput(VxAverageEnum);										_assert_(vxaverage_input);
+	Input* vyaverage_input  = element->GetInput(VyAverageEnum);										_assert_(vyaverage_input);
+
+	h=element->CharacteristicLength();
+	
 	/*Recover portion of element that is grounded*/
 	phi=element->GetGroundedPortion(xyz_list);
 	if(melt_style==SubelementMelt2Enum){
-		gllevelset_input=element->GetInput(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input);
 		element->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating);
 	   gauss = element->NewGauss(point1,fraction1,fraction2,3);
@@ -563,9 +664,33 @@
 		else if(melt_style==FullMeltOnPartiallyFloatingEnum){
 			if (phi<0.99999999) mb=fmb;
-			else mb=fmb;
+			else mb=gmb;
 		}
 		else  _error_("melt interpolation "<<EnumToStringx(melt_style)<<" not implemented yet");
 
 		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*(thickness+dt*(ms-mb))*basis[i];
+	
+		if(stabilization==5){ //SUPG
+			element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+			vxaverage_input->GetInputAverage(&vx);
+			vyaverage_input->GetInputAverage(&vy);
+			vxaverage_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
+			vyaverage_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
+			vel=sqrt(vx*vx+vy*vy)+1.e-8;
+			dvxdx=dvx[0];
+			dvydy=dvy[1];
+			//xi=0.3130;
+			xi=1;
+			tau=xi*h/(2*vel);
+			
+			/*Force vector - part 2*/
+			for(int i=0;i<numnodes;i++){
+				pe->values[i]+=Jdet*gauss->weight*(thickness+dt*(ms-mb))*(tau*vx*dbasis[0*numnodes+i]+tau*vy*dbasis[1*numnodes+i]);
+			}
+			/*Force vector - part 3*/
+			for(int i=0;i<numnodes;i++){
+				pe->values[i]+=Jdet*gauss->weight*(thickness+dt*(ms-mb))*(tau*basis[i]*dvxdx+tau*basis[i]*dvydy);
+			}
+		}
+	
 	}
 
@@ -573,4 +698,5 @@
 	xDelete<IssmDouble>(xyz_list);
 	xDelete<IssmDouble>(basis);
+	xDelete<IssmDouble>(dbasis);
 	delete gauss;
 	return pe;
@@ -582,4 +708,7 @@
 
 	/*Intermediaries */
+	int melt_style, point1;
+	bool mainlyfloating;
+	IssmDouble  fraction1,fraction2,gllevelset;
 	IssmDouble  Jdet,dt;
 	IssmDouble  ms,mb,gmb,fmb,thickness,phi=1.;
@@ -596,12 +725,23 @@
 	element->GetVerticesCoordinates(&xyz_list);
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
-	Input* gmb_input           = element->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(gmb_input);
-	Input* fmb_input           = element->GetInput(BasalforcingsFloatingiceMeltingRateEnum); _assert_(fmb_input);
-	Input* ms_input            = element->GetInput(SmbMassBalanceEnum);          _assert_(ms_input);
-	Input* gllevelset_input   = element->GetInput(MaskGroundediceLevelsetEnum);             _assert_(gllevelset_input);
-	Input* thickness_input     = element->GetInput(ThicknessEnum);                           _assert_(thickness_input);
+	element->FindParam(&melt_style,GroundinglineMeltInterpolationEnum);
+	Input* gmb_input        = element->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(gmb_input);
+	Input* fmb_input        = element->GetInput(BasalforcingsFloatingiceMeltingRateEnum); _assert_(fmb_input);
+	Input* ms_input         = element->GetInput(SmbMassBalanceEnum);                      _assert_(ms_input);
+	Input* gllevelset_input = element->GetInput(MaskGroundediceLevelsetEnum);             _assert_(gllevelset_input);
+	Input* thickness_input  = element->GetInput(ThicknessEnum);                           _assert_(thickness_input);
+
+   /*Recover portion of element that is grounded*/
+   Gauss* gauss=NULL;
+   phi=element->GetGroundedPortion(xyz_list);
+   if(melt_style==SubelementMelt2Enum){
+      element->GetGroundedPart(&point1,&fraction1,&fraction2,&mainlyfloating);
+      gauss = element->NewGauss(point1,fraction1,fraction2,3);
+   }
+   else{
+      gauss = element->NewGauss(3);
+   }
 
 	/* Start  looping on the number of gaussian points: */
-	Gauss* gauss=element->NewGauss(2);
 	for(int ig=gauss->begin();ig<gauss->end();ig++){
 		gauss->GaussPoint(ig);
@@ -613,9 +753,24 @@
 		gmb_input->GetInputValue(&gmb,gauss);
 		fmb_input->GetInputValue(&fmb,gauss);
-		gllevelset_input->GetInputValue(&phi,gauss);
+		gllevelset_input->GetInputValue(&gllevelset,gauss);
 		thickness_input->GetInputValue(&thickness,gauss);
 
-		if(phi>0.) mb=gmb;
-		else mb=fmb;
+ 		if(melt_style==SubelementMelt1Enum){
+         if (phi>0.999999999) mb=gmb;
+         else mb=(1-phi)*fmb+phi*gmb; // phi is the fraction of grounded ice so (1-phi) is floating
+      }
+      else if(melt_style==SubelementMelt2Enum){
+         if(gllevelset>0.) mb=gmb;
+         else mb=fmb;
+      }
+      else if(melt_style==NoMeltOnPartiallyFloatingEnum){
+         if (phi<0.00000001) mb=fmb;
+         else mb=gmb;
+      }
+      else if(melt_style==FullMeltOnPartiallyFloatingEnum){
+         if (phi<0.99999999) mb=fmb;
+         else mb=gmb;
+      }
+      else  _error_("melt interpolation "<<EnumToStringx(melt_style)<<" not implemented yet");
 
 		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*(thickness+dt*(ms-mb))*basis[i];
@@ -693,88 +848,103 @@
 void           MasstransportAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
 
-	int        i,hydroadjustment,domaintype;
-	int*       doflist=NULL;
-	IssmDouble rho_ice,rho_water,minthickness;
-	Element*   basalelement=NULL;
-	bool        isgroundingline=0;
-
-	element->FindParam(&domaintype,DomainTypeEnum);
-	if(domaintype!=Domain2DhorizontalEnum){
-		if(!element->IsOnBase()) return;
-		basalelement=element->SpawnBasalElement();
-	}
-	else{
-		basalelement = element;
-	}
-
-	/*Fetch number of nodes for this finite element*/
-	int numnodes = basalelement->GetNumberOfNodes();
+	/*Only update if on base*/
+	if(!element->IsOnBase()) return;
 
 	/*Fetch dof list and allocate solution vector*/
-	basalelement->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
-	IssmDouble* newthickness   = xNew<IssmDouble>(numnodes);
-	IssmDouble* cumdeltathickness = xNew<IssmDouble>(numnodes);
-	IssmDouble* deltathickness    = xNew<IssmDouble>(numnodes);
-	IssmDouble* newbase        = xNew<IssmDouble>(numnodes);
-	IssmDouble* bed            = xNew<IssmDouble>(numnodes);
-	IssmDouble* newsurface     = xNew<IssmDouble>(numnodes);
-	IssmDouble* oldthickness   = xNew<IssmDouble>(numnodes);
-	IssmDouble* oldbase        = xNew<IssmDouble>(numnodes);
-	IssmDouble* oldsurface     = xNew<IssmDouble>(numnodes);
-	IssmDouble* phi            = xNew<IssmDouble>(numnodes);
-	IssmDouble* sealevel       = xNew<IssmDouble>(numnodes);
+	int *doflist = NULL;
+	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+
+	int numnodes = element->GetNumberOfNodes();
+	IssmDouble* newthickness = xNew<IssmDouble>(numnodes);
+	IssmDouble* thicknessresidual = xNew<IssmDouble>(numnodes);
 
 	/*Use the dof list to index into the solution vector: */
-	basalelement->FindParam(&minthickness,MasstransportMinThicknessEnum);
-	for(i=0;i<numnodes;i++){
+	IssmDouble minthickness = element->FindParam(MasstransportMinThicknessEnum);
+	for(int i=0;i<numnodes;i++){
 		newthickness[i]=solution[doflist[i]];
+		thicknessresidual[i]=0.;	
+		/*Check solution*/
 		if(xIsNan<IssmDouble>(newthickness[i])) _error_("NaN found in solution vector");
 		if(xIsInf<IssmDouble>(newthickness[i])) _error_("Inf found in solution vector");
-		/*Constrain thickness to be at least 1m*/
-		if(newthickness[i]<minthickness) newthickness[i]=minthickness;
-	}
+		if(newthickness[i]<minthickness){
+			thicknessresidual[i]=minthickness-newthickness[i];
+			newthickness[i]=minthickness;
+		}
+	}
+	element->AddBasalInput(ThicknessEnum,newthickness,element->GetElementType());
+	element->AddBasalInput(ThicknessResidualEnum,thicknessresidual,element->GetElementType());
+	
+	xDelete<int>(doflist);
+	xDelete<IssmDouble>(newthickness);
+ 	xDelete<IssmDouble>(thicknessresidual);
+
+	/*Update bed and surface accordingly*/
+
+	/*Get basal element*/
+	int domaintype; element->FindParam(&domaintype,DomainTypeEnum);
+	Element* basalelement=element;
+	if(domaintype!=Domain2DhorizontalEnum) basalelement = element->SpawnBasalElement();
+
+	/*Fetch number of nodes and dof for this finite element*/
+	int numvertices = basalelement->GetNumberOfVertices();
+
+	/*Now, we need to do some "processing"*/
+	newthickness  = xNew<IssmDouble>(numvertices);
+	IssmDouble* oldthickness      = xNew<IssmDouble>(numvertices);
+	IssmDouble* cumdeltathickness = xNew<IssmDouble>(numvertices);
+	IssmDouble* deltathickness    = xNew<IssmDouble>(numvertices);
+	IssmDouble* newbase           = xNew<IssmDouble>(numvertices);
+	IssmDouble* bed               = xNew<IssmDouble>(numvertices);
+	IssmDouble* newsurface        = xNew<IssmDouble>(numvertices);
+	IssmDouble* oldbase           = xNew<IssmDouble>(numvertices);
+	IssmDouble* oldsurface        = xNew<IssmDouble>(numvertices);
+	IssmDouble* phi               = xNew<IssmDouble>(numvertices);
+	IssmDouble* sealevel          = xNew<IssmDouble>(numvertices);
 
 	/*Get previous base, thickness, surfac and current sealevel and bed:*/
-	basalelement->GetInputListOnNodes(&oldbase[0],BaseEnum);
-	basalelement->GetInputListOnNodes(&oldsurface[0],SurfaceEnum);
-	basalelement->GetInputListOnNodes(&oldthickness[0],ThicknessEnum);
-	basalelement->GetInputListOnNodes(&phi[0],MaskGroundediceLevelsetEnum);
-	basalelement->GetInputListOnNodes(&sealevel[0],SealevelEnum);
-	basalelement->GetInputListOnNodes(&cumdeltathickness[0],SealevelriseCumDeltathicknessEnum);
-
+	basalelement->GetInputListOnVertices(&newthickness[0],ThicknessEnum);
+	basalelement->GetInputListOnVertices(&oldthickness[0],ThicknessOldEnum);
+	basalelement->GetInputListOnVertices(&oldbase[0],BaseEnum);
+	basalelement->GetInputListOnVertices(&oldsurface[0],SurfaceEnum);
+	basalelement->GetInputListOnVertices(&phi[0],MaskGroundediceLevelsetEnum);
+	basalelement->GetInputListOnVertices(&sealevel[0],SealevelEnum);
+	basalelement->GetInputListOnVertices(&cumdeltathickness[0],SealevelriseCumDeltathicknessEnum);
+
+	/*Do we do grounding line migration?*/
+	bool isgroundingline;
 	element->FindParam(&isgroundingline,TransientIsgroundinglineEnum);
-	if(isgroundingline) basalelement->GetInputListOnNodes(&bed[0],BedEnum);
+	if(isgroundingline) basalelement->GetInputListOnVertices(&bed[0],BedEnum);
 
 	/*What is the delta thickness forcing the sea-level rise core: cumulated over time, hence the +=:*/
-	for(i=0;i<numnodes;i++){
-		cumdeltathickness[i]+=newthickness[i]-oldthickness[i];
-		deltathickness[i]=newthickness[i]-oldthickness[i];
+	for(int i=0;i<numvertices;i++){
+		cumdeltathickness[i] += newthickness[i]-oldthickness[i];
+		deltathickness[i]     = newthickness[i]-oldthickness[i];
 	}
 
 	/*Find MasstransportHydrostaticAdjustment to figure out how to update the geometry:*/
+	int hydroadjustment;
 	basalelement->FindParam(&hydroadjustment,MasstransportHydrostaticAdjustmentEnum);
-	rho_ice   = basalelement->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_water = basalelement->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-
-	for(i=0;i<numnodes;i++) {
-		if (phi[i]>0.){ //this is an ice sheet: just add thickness to base.
-			/*Update! actually, the bed has moved too!:*/
+	IssmDouble rho_ice   = basalelement->FindParam(MaterialsRhoIceEnum);
+	IssmDouble rho_water = basalelement->FindParam(MaterialsRhoSeawaterEnum);
+
+	for(int i=0;i<numvertices;i++) {
+		if (phi[i]>0.){ //this is grounded ice: just add thickness to base.
 			if(isgroundingline){
 				newsurface[i] = bed[i]+newthickness[i]; //surface = bed + newthickness
-				newbase[i]     = bed[i];                 //new base at new bed
+				newbase[i]    = bed[i];                 //new base at new bed
 			}
 			else{
 				 newsurface[i] = oldbase[i]+newthickness[i]; //surface = oldbase + newthickness
-				 newbase[i]     = oldbase[i];                 //same base: do nothing
+				 newbase[i]    = oldbase[i];                 //same base: do nothing
 			}
 		}
 		else{ //this is an ice shelf: hydrostatic equilibrium*/
 			if(hydroadjustment==AbsoluteEnum){
-				newsurface[i] = newthickness[i]*(1-rho_ice/rho_water)+sealevel[i];
-				newbase[i]     = newthickness[i]*(-rho_ice/rho_water)+sealevel[i];
+				newsurface[i] = newthickness[i]*(1.-rho_ice/rho_water)+sealevel[i];
+				newbase[i]    = newthickness[i]*(-rho_ice/rho_water)+sealevel[i];
 			}
 			else if(hydroadjustment==IncrementalEnum){
 				newsurface[i] = oldsurface[i]+(1.0-rho_ice/rho_water)*(newthickness[i]-oldthickness[i])+sealevel[i]; //surface = oldsurface + (1-di) * dH
-				newbase[i]     = oldbase[i]-rho_ice/rho_water*(newthickness[i]-oldthickness[i])+sealevel[i]; //base               = oldbed + di * dH
+				newbase[i]    = oldbase[i]-rho_ice/rho_water*(newthickness[i]-oldthickness[i])+sealevel[i]; //base               = oldbed + di * dH
 			}
 			else _error_("Hydrostatic adjustment " << hydroadjustment << " (" << EnumToStringx(hydroadjustment) << ") not supported yet");
@@ -783,5 +953,4 @@
 
 	/*Add input to the element: */
-	element->AddBasalInput(ThicknessEnum,newthickness,P1Enum);
 	element->AddBasalInput(SurfaceEnum,newsurface,P1Enum);
 	element->AddBasalInput(BaseEnum,newbase,P1Enum);
@@ -801,5 +970,4 @@
 	xDelete<IssmDouble>(sealevel);
 	xDelete<IssmDouble>(bed);
-
 	xDelete<int>(doflist);
 	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
@@ -934,11 +1102,7 @@
 void           MasstransportAnalysis::LumpedMassMatrix(Vector<IssmDouble>** pMlff,FemModel* femmodel){/*{{{*/
 
-	/*Intermediaries*/
-	int  configuration_type;
-
 	/*Initialize Lumped mass matrix (actually we just save its diagonal)*/
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
-	int fsize      = femmodel->nodes->NumberOfDofs(configuration_type,FsetEnum);
-	int flocalsize = femmodel->nodes->NumberOfDofsLocal(configuration_type,FsetEnum);
+	int fsize      = femmodel->nodes->NumberOfDofs(FsetEnum);
+	int flocalsize = femmodel->nodes->NumberOfDofsLocal(FsetEnum);
 	Vector<IssmDouble>* Mlff = new Vector<IssmDouble>(flocalsize,fsize);
 
Index: /issm/trunk/src/c/analyses/MasstransportAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/MasstransportAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/MasstransportAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/MeltingAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/MeltingAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/MeltingAnalysis.cpp	(revision 24313)
@@ -21,5 +21,5 @@
 		if(iomodel->my_vertices[i]){
 			if (reCast<int>(iomodel->Data("md.mesh.vertexonbase")[i])){
-				loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,MeltingAnalysisEnum));
+				loads->AddObject(new Pengrid(i+1,i,iomodel));
 			}
 		}
@@ -28,5 +28,5 @@
 
 }/*}}}*/
-void MeltingAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void MeltingAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
@@ -97,6 +97,6 @@
 	/*Retrieve all inputs and parameters*/
 	basalelement->GetVerticesCoordinates(&xyz_list);
-	IssmDouble latentheat   = element->GetMaterialParameter(MaterialsLatentheatEnum);
-	IssmDouble heatcapacity = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
+	IssmDouble latentheat   = element->FindParam(MaterialsLatentheatEnum);
+	IssmDouble heatcapacity = element->FindParam(MaterialsHeatcapacityEnum);
 
 	/* Start  looping on the number of gaussian points: */
Index: /issm/trunk/src/c/analyses/MeltingAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/MeltingAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/MeltingAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/SealevelriseAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/SealevelriseAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/SealevelriseAnalysis.cpp	(revision 24313)
@@ -12,5 +12,5 @@
 	/*No loads*/
 }/*}}}*/
-void SealevelriseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void SealevelriseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 	::CreateNodes(nodes,iomodel,SealevelriseAnalysisEnum,P1Enum);
 }/*}}}*/
@@ -53,4 +53,5 @@
 	iomodel->FetchDataToInput(elements,"md.slr.Ugia",SealevelUGiaRateEnum);
 	iomodel->FetchDataToInput(elements,"md.slr.steric_rate",SealevelriseStericRateEnum);
+	iomodel->FetchDataToInput(elements,"md.slr.hydro_rate",SealevelriseHydroRateEnum);
 
 	/*Initialize cumdeltalthickness and sealevel rise rate input*/
Index: /issm/trunk/src/c/analyses/SealevelriseAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/SealevelriseAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/SealevelriseAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/SmbAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/SmbAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/SmbAnalysis.cpp	(revision 24313)
@@ -15,5 +15,5 @@
 	/*No loads*/
 }/*}}}*/
-void SmbAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void SmbAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 	::CreateNodes(nodes,iomodel,SmbAnalysisEnum,P1Enum);
 }/*}}}*/
@@ -57,4 +57,5 @@
 			iomodel->FetchDataToInput(elements,"md.smb.zMin",SmbZMinEnum);
 			iomodel->FetchDataToInput(elements,"md.smb.Tmean",SmbTmeanEnum);
+			iomodel->FetchDataToInput(elements,"md.smb.Vmean",SmbVmeanEnum);
 			iomodel->FetchDataToInput(elements,"md.smb.C",SmbCEnum);
 			iomodel->FetchDataToInput(elements,"md.smb.Tz",SmbTzEnum);
@@ -157,4 +158,17 @@
 			iomodel->FetchDataToInput(elements,"md.smb.runoffgrad",SmbRunoffgradEnum);
 			break;
+		case SMBsemicEnum:
+			iomodel->FetchDataToInput(elements,"md.thermal.spctemperature",ThermalSpctemperatureEnum);
+			iomodel->FetchDataToInput(elements,"md.smb.s0gcm",SmbS0gcmEnum);
+			iomodel->FetchDataToInput(elements,"md.smb.dailysnowfall",SmbDailysnowfallEnum);
+			iomodel->FetchDataToInput(elements,"md.smb.dailyrainfall",SmbDailyrainfallEnum);
+			iomodel->FetchDataToInput(elements,"md.smb.dailydsradiation",SmbDailydsradiationEnum);
+			iomodel->FetchDataToInput(elements,"md.smb.dailydlradiation",SmbDailydlradiationEnum);
+			iomodel->FetchDataToInput(elements,"md.smb.dailywindspeed",SmbDailywindspeedEnum);
+			iomodel->FetchDataToInput(elements,"md.smb.dailypressure",SmbDailypressureEnum);
+			iomodel->FetchDataToInput(elements,"md.smb.dailyairdensity",SmbDailyairdensityEnum);
+			iomodel->FetchDataToInput(elements,"md.smb.dailyairhumidity",SmbDailyairhumidityEnum);
+			iomodel->FetchDataToInput(elements,"md.smb.dailytemperature",SmbDailytemperatureEnum);
+			break;
 		default:
 			_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
@@ -167,5 +181,5 @@
 	char**  requestedoutputs = NULL;
 	bool    isdelta18o,ismungsm,isd18opd,issetpddfac,interp,isfirnwarming;
-	int     smb_model;
+	int     smb_model, smbslices;
 	IssmDouble *temp = NULL;
 	int         N,M;
@@ -176,7 +190,10 @@
 	iomodel->FindConstant(&interp,"md.timestepping.interp_forcings");
 
+	iomodel->FetchData(&smbslices,"md.smb.steps_per_step");
+	parameters->AddObject(new IntParam(SmbStepsPerStepEnum,smbslices));
+
 	switch(smb_model){
 		case SMBforcingEnum:
-			/*Nothing to add to parameters*/
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isclimatology",SmbIsclimatologyEnum));
 			break;
 		case SMBgembEnum:
@@ -184,4 +201,5 @@
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.swIdx",SmbSwIdxEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.denIdx",SmbDenIdxEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.dsnowIdx",SmbDsnowIdxEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.cldFrac",SmbCldFracEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.t0wet",SmbT0wetEnum));
@@ -199,4 +217,5 @@
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isdensification",SmbIsdensificationEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isturbulentflux",SmbIsturbulentfluxEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isclimatology",SmbIsclimatologyEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.InitDensityScaling",SmbInitDensityScalingEnum));
 			parameters->AddObject(iomodel->CopyConstantObject("md.smb.ThermoDeltaTScaling",SmbThermoDeltaTScalingEnum));
@@ -262,8 +281,8 @@
 			break;
 		case SMBcomponentsEnum:
-			/*Nothing to add to parameters*/
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isclimatology",SmbIsclimatologyEnum));
 			break;
 		case SMBmeltcomponentsEnum:
-			/*Nothing to add to parameters*/
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.isclimatology",SmbIsclimatologyEnum));
 			break;
 		case SMBgradientscomponentsEnum:
@@ -281,4 +300,7 @@
 			  iomodel->DeleteData(temp,"md.smb.runoffref");
 			break;
+		case SMBsemicEnum:
+			/*Nothing to add to parameters*/
+			break;
 		default:
 			_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
@@ -303,5 +325,5 @@
 	switch(smb_model){
 		case SMBforcingEnum:
-			/*Nothing to be done*/
+			SmbForcingx(femmodel);
 			break;
 		case SMBgembEnum:
@@ -364,4 +386,12 @@
 			SmbGradientsComponentsx(femmodel);
 			break;
+		case SMBsemicEnum:
+			#ifdef _HAVE_SEMIC_
+			if(VerboseSolution())_printf0_("  call smb SEMIC module\n");
+			SmbSemicx(femmodel);
+			#else
+			_error_("SEMIC not installed");
+			#endif //_HAVE_SEMIC_
+			break;
 		default:
 			_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
Index: /issm/trunk/src/c/analyses/SmbAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/SmbAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/SmbAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/SmoothAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/SmoothAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/SmoothAnalysis.cpp	(revision 24313)
@@ -10,5 +10,5 @@
 void SmoothAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
 }/*}}}*/
-void SmoothAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void SmoothAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	::CreateNodes(nodes,iomodel,SmoothAnalysisEnum,P1Enum);
@@ -137,6 +137,6 @@
 		case DrivingStressXEnum:
 		case DrivingStressYEnum:{
-			rho_ice       = element->GetMaterialParameter(MaterialsRhoIceEnum);
-			gravity       = element->GetMaterialParameter(ConstantsGEnum);
+			rho_ice       = element->FindParam(MaterialsRhoIceEnum);
+			gravity       = element->FindParam(ConstantsGEnum);
 			H_input       = element->GetInput(ThicknessEnum); _assert_(H_input);
 			surface_input = element->GetInput(SurfaceEnum);   _assert_(surface_input);
Index: /issm/trunk/src/c/analyses/SmoothAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/SmoothAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/SmoothAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/StressbalanceAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/StressbalanceAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/StressbalanceAnalysis.cpp	(revision 24313)
@@ -15,5 +15,5 @@
 	/*Intermediary*/
 	int        i,j;
-	int        count,finiteelement,p_fe,v_fe;
+	int        finiteelement,p_fe,v_fe;
 	IssmDouble g;
 	IssmDouble rho_ice;
@@ -122,5 +122,5 @@
 
 			/*Pressure spc*/
-			count = constraints->Size();
+			int count = constraints->Size();
 			iomodel->FetchData(&vertices_type,NULL,NULL,"md.flowequation.vertex_equation");
 			iomodel->FetchData(&surface,NULL,NULL,"md.geometry.surface");
@@ -139,5 +139,5 @@
 							if(iomodel->my_vertices[i]){
 								if(IoCodeToEnumVertexEquation(reCast<int>(vertices_type[i]))==NoneApproximationEnum){
-									constraints->AddObject(new SpcStatic(count+1,iomodel->nodecounter+iomodel->numberofvertices+i+1,0,g*rho_ice*(surface[i]-z[i])/FSreconditioning,StressbalanceAnalysisEnum));
+									constraints->AddObject(new SpcStatic(count+1,iomodel->numberofvertices+i+1,0,g*rho_ice*(surface[i]-z[i])/FSreconditioning,StressbalanceAnalysisEnum));
 									count++;
 								}
@@ -149,5 +149,5 @@
 							if(iomodel->my_vertices[i]){
 								if(IoCodeToEnumVertexEquation(reCast<int>(vertices_type[i]))==NoneApproximationEnum){
-									constraints->AddObject(new SpcStatic(count+1,iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofelements+i+1,0,g*rho_ice*(surface[i]-z[i])/FSreconditioning,StressbalanceAnalysisEnum));
+									constraints->AddObject(new SpcStatic(count+1,iomodel->numberofvertices+iomodel->numberofelements+i+1,0,g*rho_ice*(surface[i]-z[i])/FSreconditioning,StressbalanceAnalysisEnum));
 									count++;
 								}
@@ -159,5 +159,5 @@
 							if(iomodel->my_vertices[i]){
 								if(IoCodeToEnumVertexEquation(reCast<int>(vertices_type[i]))==NoneApproximationEnum){
-									constraints->AddObject(new SpcStatic(count+1,iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+i+1,0,g*rho_ice*(surface[i]-z[i])/FSreconditioning,StressbalanceAnalysisEnum));
+									constraints->AddObject(new SpcStatic(count+1,iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofverticalfaces+i+1,0,g*rho_ice*(surface[i]-z[i])/FSreconditioning,StressbalanceAnalysisEnum));
 									count++;
 								}
@@ -197,5 +197,5 @@
 
 	/*Initialize counter: */
-	count=0;
+	int count=0;
 
 	/*figure out times: */
@@ -223,14 +223,14 @@
 				/*If grionSSA, spc HO dofs: 3 & 4*/
 					if (reCast<int,IssmDouble>(nodeonHO[i])){
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,0,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+						constraints->AddObject(new SpcStatic(count+1,i+1,0,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 						count++;
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+						constraints->AddObject(new SpcStatic(count+1,i+1,1,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 						count++;
 						if (!xIsNan<IssmDouble>(spcvx[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,spcvx[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(count+1,i+1,2,spcvx[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
 						if (!xIsNan<IssmDouble>(spcvy[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,spcvy[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(count+1,i+1,3,spcvy[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
@@ -238,14 +238,14 @@
 					}
 					else if (reCast<int,IssmDouble>(nodeonSSA[i])){
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+						constraints->AddObject(new SpcStatic(count+1,i+1,2,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 						count++;
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+						constraints->AddObject(new SpcStatic(count+1,i+1,3,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 						count++;
 						if (!xIsNan<IssmDouble>(spcvx[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,0,spcvx[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(count+1,i+1,0,spcvx[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
 						if (!xIsNan<IssmDouble>(spcvy[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,spcvy[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(count+1,i+1,1,spcvy[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
@@ -258,16 +258,16 @@
 				/*If grion,HO spc FS dofs: 3 4 & 5*/
 					if (reCast<int,IssmDouble>(nodeonHO[i])){
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+						constraints->AddObject(new SpcStatic(count+1,i+1,2,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 						count++;
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+						constraints->AddObject(new SpcStatic(count+1,i+1,3,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 						count++;
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,4,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+						constraints->AddObject(new SpcStatic(count+1,i+1,4,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 						count++;
 						if (!xIsNan<IssmDouble>(spcvx[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,0,spcvx[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(count+1,i+1,0,spcvx[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
 						if (!xIsNan<IssmDouble>(spcvy[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,spcvy[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(count+1,i+1,1,spcvy[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
@@ -275,18 +275,18 @@
 					}
 					else if (reCast<int,IssmDouble>(nodeonFS[i])){ //spc HO nodes: 1 & 2
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,0,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+						constraints->AddObject(new SpcStatic(count+1,i+1,0,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 						count++;
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+						constraints->AddObject(new SpcStatic(count+1,i+1,1,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 						count++;
 						if (!xIsNan<IssmDouble>(spcvx[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,spcvx[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(count+1,i+1,2,spcvx[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
 						if (!xIsNan<IssmDouble>(spcvy[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,spcvy[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(count+1,i+1,3,spcvy[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
 						if (!xIsNan<IssmDouble>(spcvz[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,4,spcvz[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(count+1,i+1,4,spcvz[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
@@ -298,16 +298,16 @@
 				/*If grion,HO spc FS dofs: 3 4 & 5*/
 					if (reCast<int,IssmDouble>(nodeonSSA[i])){
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+						constraints->AddObject(new SpcStatic(count+1,i+1,2,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 						count++;
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+						constraints->AddObject(new SpcStatic(count+1,i+1,3,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 						count++;
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,4,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+						constraints->AddObject(new SpcStatic(count+1,i+1,4,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 						count++;
 						if (!xIsNan<IssmDouble>(spcvx[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,0,spcvx[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(count+1,i+1,0,spcvx[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
 						if (!xIsNan<IssmDouble>(spcvy[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,spcvy[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(count+1,i+1,1,spcvy[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
@@ -315,18 +315,18 @@
 					}
 					else if (reCast<int,IssmDouble>(nodeonFS[i])){ //spc SSA nodes: 1 & 2
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,0,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+						constraints->AddObject(new SpcStatic(count+1,i+1,0,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 						count++;
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+						constraints->AddObject(new SpcStatic(count+1,i+1,1,0,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 						count++;
 						if (!xIsNan<IssmDouble>(spcvx[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,spcvx[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(count+1,i+1,2,spcvx[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
 						if (!xIsNan<IssmDouble>(spcvy[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,3,spcvy[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(count+1,i+1,3,spcvy[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
 						if (!xIsNan<IssmDouble>(spcvz[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,4,spcvz[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+							constraints->AddObject(new SpcStatic(count+1,i+1,4,spcvz[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 							count++;
 						}
@@ -337,5 +337,5 @@
 			else{
 				if (Mx==iomodel->numberofvertices && !xIsNan<IssmDouble>(spcvx[i])){
-					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,0,spcvx[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+					constraints->AddObject(new SpcStatic(count+1,i+1,0,spcvx[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 					count++;
 
@@ -351,5 +351,5 @@
 
 					if(spcpresent){
-						constraints->AddObject(new SpcTransient(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,0,Nx,timesx,values,StressbalanceAnalysisEnum));
+						constraints->AddObject(new SpcTransient(count+1,i+1,0,Nx,timesx,values,StressbalanceAnalysisEnum));
 						count++;
 					}
@@ -357,10 +357,10 @@
 				}
 				else if (IoCodeToEnumVertexEquation(reCast<int>(vertices_type[i]))==SIAApproximationEnum){
-					constraints->AddObject(new SpcDynamic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,0,StressbalanceAnalysisEnum));
+					constraints->AddObject(new SpcDynamic(count+1,i+1,0,StressbalanceAnalysisEnum));
 					count++;
 				}
 
 				if (My==iomodel->numberofvertices && !xIsNan<IssmDouble>(spcvy[i])){
-					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,spcvy[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vy.
+					constraints->AddObject(new SpcStatic(count+1,i+1,1,spcvy[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vy.
 					count++;
 				}
@@ -374,5 +374,5 @@
 					}
 					if(spcpresent){
-						constraints->AddObject(new SpcTransient(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,Ny,timesy,values,StressbalanceAnalysisEnum));
+						constraints->AddObject(new SpcTransient(count+1,i+1,1,Ny,timesy,values,StressbalanceAnalysisEnum));
 						count++;
 					}
@@ -380,5 +380,5 @@
 				}
 				else if (IoCodeToEnumVertexEquation(reCast<int>(vertices_type[i]))==SIAApproximationEnum){
-					constraints->AddObject(new SpcDynamic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,StressbalanceAnalysisEnum));
+					constraints->AddObject(new SpcDynamic(count+1,i+1,1,StressbalanceAnalysisEnum));
 					count++;
 				}
@@ -386,5 +386,5 @@
 				if (IoCodeToEnumVertexEquation(reCast<int>(vertices_type[i]))==FSApproximationEnum ||  (IoCodeToEnumVertexEquation(reCast<int>(vertices_type[i]))==NoneApproximationEnum)){
 					if (Mz==iomodel->numberofvertices && !xIsNan<IssmDouble>(spcvz[i])){
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,spcvz[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy
+						constraints->AddObject(new SpcStatic(count+1,i+1,2,spcvz[i],StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy
 						count++;
 					}
@@ -398,5 +398,5 @@
 						}
 						if(spcpresent){
-							constraints->AddObject(new SpcTransient(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,Nz,timesz,values,StressbalanceAnalysisEnum));
+							constraints->AddObject(new SpcTransient(count+1,i+1,2,Nz,timesz,values,StressbalanceAnalysisEnum));
 							count++;
 						}
@@ -406,5 +406,5 @@
 				}
 				if (IoCodeToEnumVertexEquation(reCast<int>(vertices_type[i]))==NoneApproximationEnum){
-					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+i+1,0,g*rho_ice*(surface[i]-z[i])/FSreconditioning,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy
+					constraints->AddObject(new SpcStatic(count+1,iomodel->numberofvertices+i+1,0,g*rho_ice*(surface[i]-z[i])/FSreconditioning,StressbalanceAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy
 					count++;
 				}
@@ -470,9 +470,9 @@
 
 			/*Get node ids*/
-			penpair_ids[0]=iomodel->nodecounter+reCast<int,IssmDouble>(penalties[2*i+0]);
-			penpair_ids[1]=iomodel->nodecounter+reCast<int,IssmDouble>(penalties[2*i+1]);
+			penpair_ids[0]=reCast<int,IssmDouble>(penalties[2*i+0]);
+			penpair_ids[1]=reCast<int,IssmDouble>(penalties[2*i+1]);
 
 			/*Create Load*/
-			loads->AddObject(new Penpair(iomodel->loadcounter+count+1,&penpair_ids[0],StressbalanceAnalysisEnum));
+			loads->AddObject(new Penpair(count+1,&penpair_ids[0]));
 			count++;
 		}
@@ -488,5 +488,5 @@
 		for(i=0;i<numriftsegments;i++){
 			if(iomodel->my_elements[reCast<int,IssmDouble>(*(riftinfo+RIFTINFOSIZE*i+2))-1]){
-				loads->AddObject(new Riftfront(iomodel->loadcounter+count+1,i,iomodel,StressbalanceAnalysisEnum));
+				loads->AddObject(new Riftfront(count+1,i,iomodel));
 				count++;
 			}
@@ -496,5 +496,5 @@
 	}
 }/*}}}*/
-void StressbalanceAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void StressbalanceAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	/*Intermediary*/
@@ -537,53 +537,48 @@
 			iomodel->FindConstant(&finiteelement,"md.flowequation.fe_FS");
 		}
-		iomodel->FetchData(3,"md.flowequation.borderSSA","md.flowequation.vertex_equation","md.stressbalance.referential");
-		if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(3,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.borderFS");
-		::CreateNodes(nodes,iomodel,StressbalanceAnalysisEnum,finiteelement,approximation);
-		iomodel->DeleteData(6,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.borderSSA","md.flowequation.vertex_equation",
+		if(!isamr){
+			iomodel->FetchData(3,"md.flowequation.borderSSA","md.flowequation.vertex_equation","md.stressbalance.referential");
+			if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(3,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.borderFS");
+		}
+		::CreateNodes(nodes,iomodel,StressbalanceAnalysisEnum,finiteelement,isamr,approximation);
+		if(!isamr){
+			iomodel->DeleteData(6,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.borderSSA","md.flowequation.vertex_equation",
 					"md.stressbalance.referential","md.flowequation.borderFS");
+		}
 	}
 	else{
 		/*Coupling: we are going to create P1 Elements only*/
-
-		Node*  node  = NULL;
-		int    lid=0;
-		if(!nodes) nodes = new Nodes();
-
 		iomodel->FetchData(6,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.borderSSA","md.flowequation.borderFS",
 					"md.flowequation.vertex_equation","md.stressbalance.referential");
 		if(isFS){
-			/*P1+ velocity*/
+			int* approximations = xNew<int>(2*iomodel->numberofvertices+iomodel->numberofelements);
 			for(int i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					approximation=IoCodeToEnumVertexEquation(reCast<int>(iomodel->Data("md.flowequation.vertex_equation")[i]));
-					if(approximation==FSApproximationEnum)  approximation=FSvelocityEnum;
-					nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,lid++,i,iomodel,StressbalanceAnalysisEnum,approximation));
-				}
+				approximation = IoCodeToEnumVertexEquation(reCast<int>(iomodel->Data("md.flowequation.vertex_equation")[i]));
+				if(approximation==FSApproximationEnum)  approximation=FSvelocityEnum;
+				approximations[i] = approximation;
 			}
-			for(int i=0;i<iomodel->numberofelements;i++){
-				if(iomodel->my_elements[i]){
-					node = new Node(iomodel->nodecounter+iomodel->numberofvertices+i+1,iomodel->numberofvertices+i,lid++,0,iomodel,StressbalanceAnalysisEnum,FSvelocityEnum);
-					node->Deactivate();
-					nodes->AddObject(node);
-				}
-			}
-			/*P1 pressure*/
-			for(int i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					approximation=IoCodeToEnumVertexEquation(reCast<int>(iomodel->Data("md.flowequation.vertex_equation")[i]));
-					node = new Node(iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofelements+i+1,iomodel->numberofvertices+iomodel->numberofelements+i,lid++,i,iomodel,StressbalanceAnalysisEnum,FSpressureEnum);
+			for(int i=0;i<iomodel->numberofelements;i++) approximations[iomodel->numberofvertices+i] = FSvelocityEnum;
+			for(int i=0;i<iomodel->numberofvertices;i++) approximations[iomodel->numberofvertices+iomodel->numberofelements+i] = FSpressureEnum;
+			::CreateNodes(nodes,iomodel,StressbalanceAnalysisEnum,MINIcondensedEnum,isamr,0,approximations);
+			xDelete<int>(approximations);
+
+			for(int i=0;i<nodes->Size();i++){
+				Node* node=xDynamicCast<Node*>(nodes->GetObjectByOffset(i));
+				int   sid = node->Sid();
+				if(sid>=iomodel->numberofvertices+iomodel->numberofelements){
+					/*Constrain pressure if not FS*/
+					int id = sid - (iomodel->numberofvertices+iomodel->numberofelements);
+					approximation=IoCodeToEnumVertexEquation(reCast<int>(iomodel->Data("md.flowequation.vertex_equation")[id]));
 					if(approximation==HOApproximationEnum || approximation==SSAApproximationEnum){
 						node->Deactivate();
 					}
-					nodes->AddObject(node);
 				}
 			}
 		}
 		else{
-			for(int i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,lid++,i,iomodel,StressbalanceAnalysisEnum,IoCodeToEnumVertexEquation(reCast<int>(iomodel->Data("md.flowequation.vertex_equation")[i]))));
-				}
-			}
+			int* approximations = xNew<int>(iomodel->numberofvertices);
+			for(int i=0;i<iomodel->numberofvertices;i++) approximations[i] = IoCodeToEnumVertexEquation(reCast<int>(iomodel->Data("md.flowequation.vertex_equation")[i]));
+			::CreateNodes(nodes,iomodel,StressbalanceAnalysisEnum,P1Enum,isamr,0,approximations);
+			xDelete<int>(approximations);
 		}
 		iomodel->DeleteData(6,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.borderSSA","md.flowequation.borderFS",
@@ -788,4 +783,11 @@
 				iomodel->FetchDataToInput(elements,"md.basalforcings.basin_id",BasalforcingsPicoBasinIdEnum);
 				break;
+			case BasalforcingsIsmip6Enum:
+				iomodel->FetchDataToInput(elements,"md.basalforcings.basin_id",BasalforcingsIsmip6BasinIdEnum);
+				break;
+			case BeckmannGoosseFloatingMeltRateEnum:
+				iomodel->FetchDataToInput(elements,"md.basalforcings.ocean_salinity",BasalforcingsOceanSalinityEnum);
+				iomodel->FetchDataToInput(elements,"md.basalforcings.ocean_temp",BasalforcingsOceanTempEnum);
+				break;
 			default:
 				_error_("Basal forcing model "<<EnumToStringx(basalforcing_model)<<" not supported yet");
@@ -832,4 +834,5 @@
 			iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum);
 			iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum);
+			iomodel->FindConstant(&FrictionCoupling,"md.friction.coupling");
 			break;
 		case 5:
@@ -871,4 +874,14 @@
 			iomodel->FetchDataToInput(elements,"md.initialization.watercolumn",WatercolumnEnum,0.);
 			break;
+		case 11:
+			iomodel->FetchDataToInput(elements,"md.friction.m",FrictionMEnum);
+			iomodel->FetchDataToInput(elements,"md.friction.C",FrictionCEnum);
+			iomodel->FetchDataToInput(elements,"md.friction.Cmax",FrictionCmaxEnum);
+			break;
+		case 12:
+			iomodel->FetchDataToInput(elements,"md.friction.m",FrictionMEnum);
+			iomodel->FetchDataToInput(elements,"md.friction.C",FrictionCEnum);
+			iomodel->FetchDataToInput(elements,"md.friction.f",FrictionfEnum);
+			break;
 		default:
 			_error_("friction law "<< frictionlaw <<" not supported");
@@ -932,13 +945,44 @@
 	int frictionlaw;
 	iomodel->FindConstant(&frictionlaw,"md.friction.law");
-	if(frictionlaw==4 || frictionlaw==6) parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum));
-	if(frictionlaw==3 || frictionlaw==1 || frictionlaw==7) parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum));
-	if(frictionlaw==5) parameters->AddObject(iomodel->CopyConstantObject("md.friction.f",FrictionFEnum));
-	if(frictionlaw==9) parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum));
-	if(frictionlaw==10){
-		parameters->AddObject(iomodel->CopyConstantObject("md.friction.pseudoplasticity_exponent",FrictionPseudoplasticityExponentEnum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.friction.threshold_speed",FrictionThresholdSpeedEnum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.friction.delta",FrictionDeltaEnum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.friction.void_ratio",FrictionVoidRatioEnum));
+	switch(frictionlaw){
+		case 1:
+			parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum));
+			break;
+		case 2:
+			break;
+		case 3:
+			parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum));
+			break;
+		case 4:
+			parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum));
+			break;
+		case 5:
+			parameters->AddObject(iomodel->CopyConstantObject("md.friction.f",FrictionFEnum));
+			break;
+		case 6:
+			parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum));
+			break;
+		case 7:
+			parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum));
+			break;
+		case 8:
+			break;
+		case 9:
+			parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum));
+			break;
+		case 10:
+			parameters->AddObject(iomodel->CopyConstantObject("md.friction.pseudoplasticity_exponent",FrictionPseudoplasticityExponentEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.friction.threshold_speed",FrictionThresholdSpeedEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.friction.delta",FrictionDeltaEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.friction.void_ratio",FrictionVoidRatioEnum));
+			break;
+		case 11:
+			parameters->AddObject(new IntParam(FrictionCouplingEnum,2));
+			break;
+		case 12:
+			parameters->AddObject(new IntParam(FrictionCouplingEnum,2));
+			break;
+		default: _error_("Friction law "<<frictionlaw<<" not implemented yet");
 	}
 
@@ -1638,5 +1682,5 @@
 	Input*     thickness_input=element->GetInput(ThicknessEnum); _assert_(thickness_input);
 	Input*     surface_input  =element->GetInput(SurfaceEnum);   _assert_(surface_input);
-	IssmDouble rhog = element->GetMaterialParameter(MaterialsRhoIceEnum)*element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rhog = element->FindParam(MaterialsRhoIceEnum)*element->FindParam(ConstantsGEnum);
 
 	/* Start  looping on the number of gaussian points: */
@@ -1703,7 +1747,7 @@
 	Input* base_input       = element->GetInput(BaseEnum);       _assert_(base_input);
 	Input* sealevel_input       = element->GetInput(SealevelEnum);       _assert_(sealevel_input);
-	IssmDouble rho_water   = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble rho_ice     = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble gravity     = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_water   = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble rho_ice     = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble gravity     = element->FindParam(ConstantsGEnum);
 	element->GetVerticesCoordinates(&xyz_list);
 	element->GetIcefrontCoordinates(&xyz_list_front,xyz_list,MaskIceLevelsetEnum);
@@ -1875,6 +1919,6 @@
 
 	element->FindParam(&domaintype,DomainTypeEnum);
-	rho_ice =element->GetMaterialParameter(MaterialsRhoIceEnum);
-	g       =element->GetMaterialParameter(ConstantsGEnum);
+	rho_ice =element->FindParam(MaterialsRhoIceEnum);
+	g       =element->FindParam(ConstantsGEnum);
 	switch(domaintype){
 		case Domain2DhorizontalEnum:
@@ -1919,5 +1963,5 @@
 
 	/*Fetch dof list and allocate solution vectors*/
-	basalelement->GetDofList(&doflist,SSAApproximationEnum,GsetEnum);
+	basalelement->GetDofListLocal(&doflist,SSAApproximationEnum,GsetEnum);
 	IssmDouble* values    = xNew<IssmDouble>(numdof);
 	IssmDouble* vx        = xNew<IssmDouble>(numnodes);
@@ -2107,5 +2151,5 @@
 	Input*     thickness_input=element->GetInput(ThicknessEnum); _assert_(thickness_input);
 	Input*     surface_input  =element->GetInput(SurfaceEnum);   _assert_(surface_input);
-	IssmDouble rhog = element->GetMaterialParameter(MaterialsRhoIceEnum)*element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rhog = element->FindParam(MaterialsRhoIceEnum)*element->FindParam(ConstantsGEnum);
 
 	/* Start  looping on the number of gaussian points: */
@@ -2159,7 +2203,7 @@
 	Input* base_input       = element->GetInput(BaseEnum);       _assert_(base_input);
 	Input* sealevel_input       = element->GetInput(SealevelEnum);       _assert_(sealevel_input);
-	IssmDouble rho_water   = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble rho_ice     = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble gravity     = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_water   = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble rho_ice     = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble gravity     = element->FindParam(ConstantsGEnum);
 	element->GetVerticesCoordinates(&xyz_list);
 	element->GetIcefrontCoordinates(&xyz_list_front,xyz_list,MaskIceLevelsetEnum);
@@ -2215,6 +2259,6 @@
 	element->FindParam(&dim,DomainDimensionEnum);
 	element->FindParam(&domaintype,DomainTypeEnum);
-	rho_ice =element->GetMaterialParameter(MaterialsRhoIceEnum);
-	g       =element->GetMaterialParameter(ConstantsGEnum);
+	rho_ice =element->FindParam(MaterialsRhoIceEnum);
+	g       =element->FindParam(ConstantsGEnum);
 	if(dim==2){
 		element->GetInputListOnVertices(thickness,ThicknessEnum);
@@ -2248,5 +2292,5 @@
 
 	/*Fetch dof list and allocate solution vectors*/
-	basalelement->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+	basalelement->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
 	IssmDouble* values    = xNew<IssmDouble>(numdof);
 	IssmDouble* vx        = xNew<IssmDouble>(numnodes);
@@ -2634,5 +2678,5 @@
 	element->GetVerticesCoordinates(&xyz_list);
 	Input*     surface_input = element->GetInput(SurfaceEnum);   _assert_(surface_input);
-	IssmDouble rhog = element->GetMaterialParameter(MaterialsRhoIceEnum)*element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rhog = element->FindParam(MaterialsRhoIceEnum)*element->FindParam(ConstantsGEnum);
 
 	/* Start  looping on the number of gaussian points: */
@@ -2691,7 +2735,7 @@
 	Input* surface_input = element->GetInput(SurfaceEnum); _assert_(surface_input);
 	Input* sealevel_input       = element->GetInput(SealevelEnum);       _assert_(sealevel_input);
-	IssmDouble rho_water = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble gravity   = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble gravity   = element->FindParam(ConstantsGEnum);
 	element->GetVerticesCoordinates(&xyz_list);
 	element->GetIcefrontCoordinates(&xyz_list_front,xyz_list,MaskIceLevelsetEnum);
@@ -2877,6 +2921,6 @@
 
 	element->FindParam(&domaintype,DomainTypeEnum);
-	IssmDouble rho_ice =element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble g       =element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_ice =element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble g       =element->FindParam(ConstantsGEnum);
 	switch(domaintype){
 		case Domain3DEnum:
@@ -2903,5 +2947,5 @@
 
 	/*Fetch dof list and allocate solution vectors*/
-	element->GetDofList(&doflist,HOApproximationEnum,GsetEnum);
+	element->GetDofListLocal(&doflist,HOApproximationEnum,GsetEnum);
 	IssmDouble* values = xNew<IssmDouble>(numdof);
 	IssmDouble* vx     = xNew<IssmDouble>(numnodes);
@@ -3128,6 +3172,6 @@
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
 	if(dt==0)   dt=1.e+5;
-	IssmDouble  rho_water     = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  gravity       = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble  rho_water     = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  gravity       = element->FindParam(ConstantsGEnum);
 	Input*      base_input = element->GetInput(BaseEnum); _assert_(base_input);
 
@@ -4022,6 +4066,6 @@
 	/*Retrieve all inputs and parameters*/
 	element->GetVerticesCoordinates(&xyz_list);
-	IssmDouble  rho_ice =element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  gravity =element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble  rho_ice =element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  gravity =element->FindParam(ConstantsGEnum);
 	Input*      loadingforcex_input=element->GetInput(LoadingforceXEnum);  _assert_(loadingforcex_input);
 	Input*      loadingforcey_input=element->GetInput(LoadingforceYEnum);  _assert_(loadingforcey_input);
@@ -4104,6 +4148,6 @@
 	Input* surface_input  = element->GetInput(SurfaceEnum); _assert_(surface_input);
 	Input* sealevel_input       = element->GetInput(SealevelEnum);       _assert_(sealevel_input);
-	IssmDouble  rho_water = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  gravity   = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble  rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  gravity   = element->FindParam(ConstantsGEnum);
 
 	/*Initialize gauss points*/
@@ -4172,6 +4216,6 @@
 	element->GetVerticesCoordinatesBase(&xyz_list_base);
 	Input*      base_input=element->GetInput(BaseEnum); _assert_(base_input);
-	IssmDouble  rho_water=element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  gravity  =element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble  rho_water=element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  gravity  =element->FindParam(ConstantsGEnum);
 
 	/* Start  looping on the number of gaussian points: */
@@ -5063,4 +5107,12 @@
 	}
 
+	/*Do NOT account for bubble using GetInputValue! This is wrong*/
+	if(element->VelocityInterpolation()==P1bubblecondensedEnum ||
+				element->VelocityInterpolation()==P1bubbleEnum){
+		vvalues[(vnumnodes-1)*dim+0]=0.;
+		vvalues[(vnumnodes-1)*dim+1]=0.;
+		if(dim==3) vvalues[(vnumnodes-1)*dim+2]=0.;
+	}
+
 	/*Add value to global vector*/
 	solution->SetValues(vnumdof,vdoflist,vvalues,INS_VAL);
@@ -5155,5 +5207,4 @@
 void           StressbalanceAnalysis::InputUpdateFromSolutionFS(IssmDouble* solution,Element* element){/*{{{*/
 
-	bool         results_on_nodes;
 	int          i,dim;
 	int*         vdoflist=NULL;
@@ -5163,5 +5214,4 @@
 	element->FindParam(&dim,DomainDimensionEnum);
 	element->FindParam(&FSreconditioning,StressbalanceFSreconditioningEnum);
-	element->FindParam(&results_on_nodes,SettingsResultsOnNodesEnum);
 
 	/*Fetch number of nodes and dof for this finite element*/
@@ -5186,6 +5236,6 @@
 
 	/*Get dof list: */
-	element->GetDofListVelocity(&vdoflist,GsetEnum);
-	element->GetDofListPressure(&pdoflist,GsetEnum);
+	element->GetDofListLocalVelocity(&vdoflist,GsetEnum);
+	element->GetDofListLocalPressure(&pdoflist,GsetEnum);
 
 	/*Use the dof list to index into the solution vector: */
@@ -5223,9 +5273,12 @@
 
 	/*Add vx and vy as inputs to the tria element: */
-	element->AddInput(VxEnum, vx, element->VelocityInterpolation());
-	element->AddInput(VyEnum, vy, element->VelocityInterpolation());
-	element->AddInput(VelEnum,vel,element->VelocityInterpolation());
+	int fe_v = element->VelocityInterpolation();
+	//if(fe_v == P1bubblecondensedEnum) fe_v = P1Enum;
+	//if(fe_v == P1bubbleEnum) fe_v = P1Enum;
+	element->AddInput(VxEnum, vx, fe_v);
+	element->AddInput(VyEnum, vy, fe_v);
+	element->AddInput(VelEnum,vel,fe_v);
 	if(pnumdof>0) element->AddInput(PressureEnum,pressure,element->PressureInterpolation());
-	if(dim==3) element->AddInput(VzEnum,vz, element->VelocityInterpolation());
+	if(dim==3) element->AddInput(VzEnum,vz, fe_v);
 
 	/*Free ressources:*/
@@ -7085,7 +7138,7 @@
 
 	/*Fetch dof list and allocate solution vectors*/
-	element->GetDofList(&doflistFSv,FSvelocityEnum,GsetEnum);
-	element->GetDofList(&doflistHO, HOApproximationEnum, GsetEnum);
-	element->GetDofListPressure(&doflistFSp,GsetEnum);
+	element->GetDofListLocal(&doflistFSv,FSvelocityEnum,GsetEnum);
+	element->GetDofListLocal(&doflistHO, HOApproximationEnum, GsetEnum);
+	element->GetDofListLocalPressure(&doflistFSp,GsetEnum);
 	IssmDouble* HOvalues  = xNew<IssmDouble>(numdofHO);
 	IssmDouble* FSvalues  = xNew<IssmDouble>(numdofFSv+numdofFSp);
@@ -7184,7 +7237,7 @@
 
 	/*Fetch dof list and allocate solution vectors*/
-	element->GetDofList(&doflistFSv,FSvelocityEnum,GsetEnum);
-	element->GetDofListPressure(&doflistFSp,GsetEnum);
-	basalelement->GetDofList(&doflistSSA, SSAApproximationEnum, GsetEnum);
+	element->GetDofListLocal(&doflistFSv,FSvelocityEnum,GsetEnum);
+	element->GetDofListLocalPressure(&doflistFSp,GsetEnum);
+	basalelement->GetDofListLocal(&doflistSSA, SSAApproximationEnum, GsetEnum);
 	IssmDouble* SSAvalues  = xNew<IssmDouble>(numdofSSA);
 	IssmDouble* FSvalues  = xNew<IssmDouble>(numdofFSv+numdofFSp);
@@ -7285,6 +7338,6 @@
 
 	/*Fetch dof list and allocate solution vectors*/
-	basalelement->GetDofList(&SSAdoflist,SSAApproximationEnum,GsetEnum);
-	element     ->GetDofList(&HOdoflist, HOApproximationEnum, GsetEnum);
+	basalelement->GetDofListLocal(&SSAdoflist,SSAApproximationEnum,GsetEnum);
+	element     ->GetDofListLocal(&HOdoflist, HOApproximationEnum, GsetEnum);
 	IssmDouble* HOvalues  = xNew<IssmDouble>(numdof);
 	IssmDouble* SSAvalues = xNew<IssmDouble>(numdof);
@@ -7328,6 +7381,6 @@
 	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 2D,
 	 *so the pressure is just the pressure at the bedrock: */
-	rho_ice = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	g       = element->GetMaterialParameter(ConstantsGEnum);
+	rho_ice = element->FindParam(MaterialsRhoIceEnum);
+	g       = element->FindParam(ConstantsGEnum);
 	element->GetVerticesCoordinates(&xyz_list);
 	element->GetInputListOnNodes(&surface[0],SurfaceEnum);
Index: /issm/trunk/src/c/analyses/StressbalanceAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/StressbalanceAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/StressbalanceAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/StressbalanceSIAAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/StressbalanceSIAAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/StressbalanceSIAAnalysis.cpp	(revision 24313)
@@ -38,5 +38,5 @@
 
 		/*Initialize conunter*/
-		int count=0;
+		int count = 0;
 
 		/*vx and vy are spc'd if we are not on nodeonSIA: */
@@ -46,18 +46,18 @@
 				if (IoCodeToEnumVertexEquation(reCast<int>(iomodel->Data("md.flowequation.vertex_equation")[i]))!=SIAApproximationEnum){
 
-					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,0,0,StressbalanceSIAAnalysisEnum));
+					constraints->AddObject(new SpcStatic(count+1,i+1,0,0,StressbalanceSIAAnalysisEnum));
 					count++;
 
-					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,0,StressbalanceSIAAnalysisEnum));
+					constraints->AddObject(new SpcStatic(count+1,i+1,1,0,StressbalanceSIAAnalysisEnum));
 					count++;
 				}
 				else{
 					if (!xIsNan<IssmDouble>(iomodel->Data("md.stressbalance.spcvx")[i])){
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,0,iomodel->Data("md.stressbalance.spcvx")[i],StressbalanceSIAAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
+						constraints->AddObject(new SpcStatic(count+1,i+1,0,iomodel->Data("md.stressbalance.spcvx")[i],StressbalanceSIAAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 						count++;
 					}
 
 					if (!xIsNan<IssmDouble>(iomodel->Data("md.stressbalance.spcvy")[i])){
-						constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,iomodel->Data("md.stressbalance.spcvy")[i],StressbalanceSIAAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy
+						constraints->AddObject(new SpcStatic(count+1,i+1,1,iomodel->Data("md.stressbalance.spcvy")[i],StressbalanceSIAAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy
 						count++;
 					}
@@ -76,9 +76,8 @@
 
 }/*}}}*/
-void StressbalanceSIAAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void StressbalanceSIAAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	/*Intermediaries*/
 	bool  isSIA;
-	Node* node = NULL;
 
 	/*Fetch parameters: */
@@ -95,20 +94,11 @@
 	}
 
-	for(int i=0;i<iomodel->numberofvertices;i++){
-		if(iomodel->my_vertices[i]){
-
-			/*Create new node if is in this processor's partition*/
-			node = new Node(iomodel->nodecounter+i+1,i,lid++,i,iomodel,StressbalanceSIAAnalysisEnum,IoCodeToEnumVertexEquation(reCast<int>(iomodel->Data("md.flowequation.vertex_equation")[i])));
-
-			/*Deactivate node if not SIA*/
-			if(IoCodeToEnumVertexEquation(reCast<int>(iomodel->Data("md.flowequation.vertex_equation")[i]))!=SIAApproximationEnum){
-				node->Deactivate();
-			}
-
-			/*Add to Nodes dataset*/
-			nodes->AddObject(node);
-		}
-	}
-
+	::CreateNodes(nodes,iomodel,StressbalanceSIAAnalysisEnum,P1Enum,SIAApproximationEnum);
+	for(int i=0;i<nodes->Size();i++){
+		Node* node=xDynamicCast<Node*>(nodes->GetObjectByOffset(i));
+		int   sid = node->Sid();
+		int approximation=IoCodeToEnumVertexEquation(reCast<int>(iomodel->Data("md.flowequation.vertex_equation")[sid]));
+		if(approximation!=SIAApproximationEnum) node->Deactivate();
+	}
 	iomodel->DeleteData(6,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.borderSSA","md.flowequation.borderFS","md.flowequation.vertex_equation","md.stressbalance.referential");
 
@@ -328,9 +318,9 @@
 
 	/*Retrieve all inputs and parameters*/
-	IssmDouble  rho_ice    = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  gravity    = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  n          = element->GetMaterialParameter(MaterialsRheologyNEnum);
-	IssmDouble B;
+	IssmDouble  rho_ice    = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  gravity    = element->FindParam(ConstantsGEnum);
+	IssmDouble  B,n;
 	Input* B_input         = element->GetInput(MaterialsRheologyBbarEnum);_assert_(B_input);
+	Input* n_input         = element->GetInput(MaterialsRheologyNEnum);   _assert_(n_input);
 	Input* slopex_input    = element->GetInput(SurfaceSlopeXEnum);        _assert_(slopex_input);
 	Input* slopey_input    = element->GetInput(SurfaceSlopeYEnum);        _assert_(slopey_input);
@@ -349,4 +339,5 @@
 
 		B_input->GetInputValue(&B,gauss);
+		n_input->GetInputValue(&n,gauss);
 		thickness_input->GetInputValue(&thickness,gauss);
 		surface_input->GetInputValue(&surface,gauss);
@@ -417,9 +408,9 @@
 	/*Retrieve all inputs and parameters*/
 	element->GetVerticesCoordinates(&xyz_list);
-	IssmDouble  rho_ice    = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  gravity    = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  n          = element->GetMaterialParameter(MaterialsRheologyNEnum);
-	IssmDouble B;
+	IssmDouble  rho_ice    = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  gravity    = element->FindParam(ConstantsGEnum);
+	IssmDouble B,n;
 	Input* B_input         = element->GetInput(MaterialsRheologyBEnum);   _assert_(B_input);
+	Input* n_input         = element->GetInput(MaterialsRheologyNEnum);   _assert_(n_input);
 	Input* surface_input   = element->GetInput(SurfaceEnum);              _assert_(surface_input);
 	Input* slopex_input    = element->GetInput(SurfaceSlopeXEnum);        _assert_(slopex_input);
@@ -452,4 +443,5 @@
 
 			B_input->GetInputValue(&B,gauss);
+			n_input->GetInputValue(&n,gauss);
 			slopex_input->GetInputValue(&slope[0],gauss);
 			slopey_input->GetInputValue(&slope[1],gauss);
@@ -574,5 +566,5 @@
 
 	/*Fetch dof list and allocate solution vectors*/
-	element->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
 	IssmDouble* values    = xNew<IssmDouble>(numdof);
 	IssmDouble* vx        = xNew<IssmDouble>(numdof);
@@ -608,6 +600,6 @@
 	/*For pressure: we have not computed pressure in this analysis, for this element. We are in 2D, 
 	 *so the pressure is just the pressure at the bedrock: */
-	rho_ice  = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	g        = element->GetMaterialParameter(ConstantsGEnum);
+	rho_ice  = element->FindParam(MaterialsRhoIceEnum);
+	g        = element->FindParam(ConstantsGEnum);
 	element->FindParam(&domaintype,DomainTypeEnum);
 	switch(domaintype){
Index: /issm/trunk/src/c/analyses/StressbalanceSIAAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/StressbalanceSIAAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/StressbalanceSIAAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/StressbalanceVerticalAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 24313)
@@ -51,9 +51,9 @@
 
 				if (reCast<int,IssmDouble>(iomodel->Data("md.flowequation.borderFS")[i])){
-					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,0,0,StressbalanceVerticalAnalysisEnum)); //spc to zero as vertical velocity is done in Horiz for FS
+					constraints->AddObject(new SpcStatic(count+1,i+1,0,0,StressbalanceVerticalAnalysisEnum)); //spc to zero as vertical velocity is done in Horiz for FS
 					count++;
 				}
 				else if (!xIsNan<IssmDouble>(spcvz[i])){
-					constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,0,
+					constraints->AddObject(new SpcStatic(count+1,i+1,0,
 									spcvz[i],StressbalanceVerticalAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.
 					count++;
@@ -74,5 +74,5 @@
 
 }/*}}}*/
-void StressbalanceVerticalAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void StressbalanceVerticalAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	/*return if not 3d mesh*/
@@ -134,4 +134,11 @@
 		case BasalforcingsPicoEnum:
 			iomodel->FetchDataToInput(elements,"md.basalforcings.basin_id",BasalforcingsPicoBasinIdEnum);
+			break;
+		case BasalforcingsIsmip6Enum:
+			iomodel->FetchDataToInput(elements,"md.basalforcings.basin_id",BasalforcingsIsmip6BasinIdEnum);
+			break;
+		case BeckmannGoosseFloatingMeltRateEnum:
+			iomodel->FetchDataToInput(elements,"md.basalforcings.ocean_salinity",BasalforcingsOceanSalinityEnum);
+			iomodel->FetchDataToInput(elements,"md.basalforcings.ocean_temp",BasalforcingsOceanTempEnum);
 			break;
 		default:
@@ -526,5 +533,5 @@
 	/*Get dof list and vertices coordinates: */
 	element->GetVerticesCoordinates(&xyz_list);
-	element->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
 	IssmDouble*  values    = xNew<IssmDouble>(numdof);
 	IssmDouble*  vx        = xNew<IssmDouble>(numnodes);
@@ -584,6 +591,6 @@
 	 *so the pressure is just the pressure at the z elevation: except it this is a HOFS element */
 	if(approximation!=HOFSApproximationEnum &&  approximation!=SSAFSApproximationEnum){
-		rho_ice = element->GetMaterialParameter(MaterialsRhoIceEnum);
-		g       = element->GetMaterialParameter(ConstantsGEnum);
+		rho_ice = element->FindParam(MaterialsRhoIceEnum);
+		g       = element->FindParam(ConstantsGEnum);
 		element->GetInputListOnNodes(&surface[0],SurfaceEnum,0.);
 		for(i=0;i<numnodes;i++) pressure[i]=rho_ice*g*(surface[i]-xyz_list[i*3+2]);
Index: /issm/trunk/src/c/analyses/StressbalanceVerticalAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/StressbalanceVerticalAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/StressbalanceVerticalAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/ThermalAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/ThermalAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/ThermalAnalysis.cpp	(revision 24313)
@@ -84,5 +84,5 @@
 		if(iomodel->my_vertices[i]){
 			if (xIsNan<IssmDouble>(iomodel->Data("md.thermal.spctemperature")[i])){ //No penalty applied on spc nodes!
-				loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,ThermalAnalysisEnum));
+				loads->AddObject(new Pengrid(i+1,i,iomodel));
 			}
 		}
@@ -91,5 +91,5 @@
 
 }/*}}}*/
-void ThermalAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void ThermalAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	int finiteelement;
@@ -217,4 +217,5 @@
 			iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum);
 			iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum);
+			iomodel->FindConstant(&FrictionCoupling,"md.friction.coupling");
 			break;
 		case 5:
@@ -337,10 +338,10 @@
 	element->GetVerticesCoordinatesBase(&xyz_list_base);
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
-	IssmDouble  gravity             = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  rho_water           = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble  mixed_layer_capacity= element->GetMaterialParameter(MaterialsMixedLayerCapacityEnum);
-	IssmDouble  thermal_exchange_vel= element->GetMaterialParameter(MaterialsThermalExchangeVelocityEnum);
+	IssmDouble  gravity             = element->FindParam(ConstantsGEnum);
+	IssmDouble  rho_water           = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble  mixed_layer_capacity= element->FindParam(MaterialsMixedLayerCapacityEnum);
+	IssmDouble  thermal_exchange_vel= element->FindParam(MaterialsThermalExchangeVelocityEnum);
 
 	/* Start  looping on the number of gaussian points: */
@@ -377,4 +378,5 @@
 	IssmDouble  h,hx,hy,hz,vx,vy,vz,D_scalar;
 	IssmDouble  tau_parameter,diameter;
+	IssmDouble  tau_parameter_anisotropic[2],tau_parameter_hor,tau_parameter_ver;	
 	IssmDouble* xyz_list = NULL;
 
@@ -393,9 +395,9 @@
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
 	element->FindParam(&stabilization,ThermalStabilizationEnum);
-	IssmDouble  rho_water           = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  gravity             = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble  thermalconductivity = element->GetMaterialParameter(MaterialsThermalconductivityEnum);
+	IssmDouble  rho_water           = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  gravity             = element->FindParam(ConstantsGEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble  thermalconductivity = element->FindParam(MaterialsThermalconductivityEnum);
 	IssmDouble  kappa = thermalconductivity/(rho_ice*heatcapacity);
 	Input* vx_input  = element->GetInput(VxEnum);     _assert_(vx_input);
@@ -405,5 +407,4 @@
 	Input* vym_input = element->GetInput(VyMeshEnum); _assert_(vym_input);
 	Input* vzm_input = element->GetInput(VzMeshEnum); _assert_(vzm_input);
-	if(stabilization==2) diameter=element->MinEdgeLength(xyz_list);
 
 	/* Start  looping on the number of gaussian points: */
@@ -468,9 +469,11 @@
 		}
 		else if(stabilization==2){
+			diameter=element->MinEdgeLength(xyz_list);
 			tau_parameter=element->StabilizationParameter(u-um,v-vm,w-wm,diameter,kappa);
 			for(int i=0;i<numnodes;i++){
 				for(int j=0;j<numnodes;j++){
 					Ke->values[i*numnodes+j]+=tau_parameter*D_scalar*
-					  ((u-um)*dbasis[0*numnodes+i]+(v-vm)*dbasis[1*numnodes+i]+(w-wm)*dbasis[2*numnodes+i])*((u-um)*dbasis[0*numnodes+j]+(v-vm)*dbasis[1*numnodes+j]+(w-wm)*dbasis[2*numnodes+j]);
+					  ((u-um)*dbasis[0*numnodes+i]+(v-vm)*dbasis[1*numnodes+i]+(w-wm)*dbasis[2*numnodes+i])*
+					  ((u-um)*dbasis[0*numnodes+j]+(v-vm)*dbasis[1*numnodes+j]+(w-wm)*dbasis[2*numnodes+j]);
 				}
 			}
@@ -484,4 +487,19 @@
 			}
 		}
+		/*anisotropic SUPG*/
+		else if(stabilization==3){
+			element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+			element->ElementSizes(&hx,&hy,&hz);
+			element->StabilizationParameterAnisotropic(&tau_parameter_anisotropic[0],u-um,v-vm,w-wm,hx,hy,hz,kappa);
+			tau_parameter_hor=tau_parameter_anisotropic[0];
+			tau_parameter_ver=tau_parameter_anisotropic[1];
+			for(int i=0;i<numnodes;i++){
+				for(int j=0;j<numnodes;j++){
+					Ke->values[i*numnodes+j]+=D_scalar*
+						(sqrt(tau_parameter_hor)*(u-um)*dbasis[0*numnodes+i]+sqrt(tau_parameter_hor)*(v-vm)*dbasis[1*numnodes+i]+sqrt(tau_parameter_ver)*(w-wm)*dbasis[2*numnodes+i])*
+						(sqrt(tau_parameter_hor)*(u-um)*dbasis[0*numnodes+j]+sqrt(tau_parameter_hor)*(v-vm)*dbasis[1*numnodes+j]+sqrt(tau_parameter_ver)*(w-wm)*dbasis[2*numnodes+j]);
+				}
+			}
+		}
 	}
 
@@ -537,6 +555,6 @@
 	Input* vz_input             = element->GetInput(VzEnum);                          _assert_(vz_input);
 	Input* geothermalflux_input = element->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
 
 	/*Build friction element, needed later: */
@@ -595,10 +613,10 @@
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
 	Input*      pressure_input=element->GetInput(PressureEnum); _assert_(pressure_input);
-	IssmDouble  gravity             = element->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble  rho_water           = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble  mixed_layer_capacity= element->GetMaterialParameter(MaterialsMixedLayerCapacityEnum);
-	IssmDouble  thermal_exchange_vel= element->GetMaterialParameter(MaterialsThermalExchangeVelocityEnum);
+	IssmDouble  gravity             = element->FindParam(ConstantsGEnum);
+	IssmDouble  rho_water           = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble  mixed_layer_capacity= element->FindParam(MaterialsMixedLayerCapacityEnum);
+	IssmDouble  thermal_exchange_vel= element->FindParam(MaterialsThermalExchangeVelocityEnum);
 
 	/* Start  looping on the number of gaussian points: */
@@ -634,5 +652,6 @@
 	IssmDouble  Jdet,phi,dt;
 	IssmDouble  temperature;
-	IssmDouble  tau_parameter,diameter;
+	IssmDouble  tau_parameter,diameter,hx,hy,hz;
+	IssmDouble  tau_parameter_anisotropic[2],tau_parameter_hor,tau_parameter_ver;
 	IssmDouble  u,v,w;
 	IssmDouble  scalar_def,scalar_transient;
@@ -649,7 +668,7 @@
 	/*Retrieve all inputs and parameters*/
 	element->GetVerticesCoordinates(&xyz_list);
-	IssmDouble  rho_ice             = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble  heatcapacity        = element->GetMaterialParameter(MaterialsHeatcapacityEnum);
-	IssmDouble  thermalconductivity = element->GetMaterialParameter(MaterialsThermalconductivityEnum);
+	IssmDouble  rho_ice             = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble  heatcapacity        = element->FindParam(MaterialsHeatcapacityEnum);
+	IssmDouble  thermalconductivity = element->FindParam(MaterialsThermalconductivityEnum);
 	IssmDouble  kappa = thermalconductivity/(rho_ice*heatcapacity);
 	element->FindParam(&dt,TimesteppingTimeStepEnum);
@@ -660,5 +679,4 @@
 	Input* temperature_input = NULL;
 	if(reCast<bool,IssmDouble>(dt)){temperature_input = element->GetInput(TemperatureEnum); _assert_(temperature_input);}
-	if(stabilization==2) diameter=element->MinEdgeLength(xyz_list);
 
 	/* Start  looping on the number of gaussian points: */
@@ -685,5 +703,5 @@
 		if(stabilization==2){
 			element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
-
+			diameter=element->MinEdgeLength(xyz_list);
 			vx_input->GetInputValue(&u,gauss);
 			vy_input->GetInputValue(&v,gauss);
@@ -696,4 +714,17 @@
 				for(int i=0;i<numnodes;i++) pe->values[i]+=tau_parameter*scalar_transient*(u*dbasis[0*numnodes+i]+v*dbasis[1*numnodes+i]+w*dbasis[2*numnodes+i]);
 			}
+		}
+		/* anisotropic SUPG */
+		else if(stabilization==3){
+			element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+			element->ElementSizes(&hx,&hy,&hz);
+			vx_input->GetInputValue(&u,gauss);
+			vy_input->GetInputValue(&v,gauss);
+			vz_input->GetInputValue(&w,gauss);
+			element->StabilizationParameterAnisotropic(&tau_parameter_anisotropic[0],u,v,w,hx,hy,hz,kappa);
+			tau_parameter_hor=tau_parameter_anisotropic[0];
+			tau_parameter_ver=tau_parameter_anisotropic[1];
+
+			for(int i=0;i<numnodes;i++) pe->values[i]+=scalar_def*(tau_parameter_hor*u*dbasis[0*numnodes+i]+tau_parameter_hor*v*dbasis[1*numnodes+i]+tau_parameter_ver*w*dbasis[2*numnodes+i]);
 		}
 	}
@@ -806,5 +837,4 @@
 	int        *doflist   = NULL;
 	IssmDouble *xyz_list  = NULL;
-	IssmDouble  n=3.0;
 	bool        hack      = false;
 
@@ -813,5 +843,5 @@
 
 	/*Fetch dof list and allocate solution vector*/
-	element->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
 	IssmDouble* values    = xNew<IssmDouble>(numnodes);
 	IssmDouble* surface   = xNew<IssmDouble>(numnodes);
@@ -841,13 +871,21 @@
 
 	/*Get all inputs and parameters*/
-	if(element->material->ObjectEnum()!=MatestarEnum) n=element->GetMaterialParameter(MaterialsRheologyNEnum);
 	element->GetInputValue(&converged,ConvergedEnum);
 	if(converged){
 		element->AddInput(TemperatureEnum,values,element->GetElementType());
 
+		IssmDouble* n = xNew<IssmDouble>(numnodes);
+		if(element->material->ObjectEnum()==MatestarEnum){
+			for(i=0;i<numnodes;i++) n[i]=3.;
+		}
+		else{
+			element->GetInputListOnNodes(&n[0],MaterialsRheologyNEnum);
+		}
+
 		/*Update Rheology only if converged (we must make sure that the temperature is below melting point
 		 * otherwise the rheology could be negative*/
-		rheology_law=element->GetIntegerMaterialParameter(MaterialsRheologyLawEnum);
+		element->FindParam(&rheology_law,MaterialsRheologyLawEnum);
 		element->GetInputListOnNodes(&surface[0],SurfaceEnum);
+
 		switch(rheology_law){
 			case NoneEnum:
@@ -866,7 +904,15 @@
 				element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
 				break;
+			case NyeH2OEnum:
+				for(i=0;i<numnodes;i++) B[i]=NyeH2O(values[i]);
+				element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
+				break; 
+			case NyeCO2Enum:
+				for(i=0;i<numnodes;i++) B[i]=NyeCO2(values[i]);
+				element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
+				break;
 			case ArrheniusEnum:{
 				element->GetVerticesCoordinates(&xyz_list);
-				for(i=0;i<numnodes;i++) B[i]=Arrhenius(values[i],surface[i]-xyz_list[i*3+2],n);
+				for(i=0;i<numnodes;i++) B[i]=Arrhenius(values[i],surface[i]-xyz_list[i*3+2],n[i]);
 				element->AddInput(MaterialsRheologyBEnum,&B[0],element->GetElementType());
 				break;
@@ -875,4 +921,5 @@
 				_error_("Rheology law " << EnumToStringx(rheology_law) << " not supported yet");
 		}
+		xDelete<IssmDouble>(n);
 	}
 	else{
Index: /issm/trunk/src/c/analyses/ThermalAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/ThermalAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/ThermalAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/UzawaPressureAnalysis.cpp
===================================================================
--- /issm/trunk/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 24312)
+++ /issm/trunk/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 24313)
@@ -12,5 +12,5 @@
 	return;
 }/*}}}*/
-void UzawaPressureAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+void UzawaPressureAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
 
 	int finiteelement;
@@ -205,5 +205,5 @@
 
 	/*Fetch dof list and allocate solution vector*/
-	element->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+	element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
 	IssmDouble* values        = xNew<IssmDouble>(numnodes);
 	IssmDouble* valueslambda  = xNewZeroInit<IssmDouble>(numnodessigma);
Index: /issm/trunk/src/c/analyses/UzawaPressureAnalysis.h
===================================================================
--- /issm/trunk/src/c/analyses/UzawaPressureAnalysis.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/UzawaPressureAnalysis.h	(revision 24313)
@@ -15,5 +15,5 @@
 		void CreateConstraints(Constraints* constraints,IoModel* iomodel);
 		void CreateLoads(Loads* loads, IoModel* iomodel);
-		void CreateNodes(Nodes* nodes,IoModel* iomodel);
+		void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
 		int  DofsPerNode(int** doflist,int domaintype,int approximation);
 		void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
Index: /issm/trunk/src/c/analyses/analyses.h
===================================================================
--- /issm/trunk/src/c/analyses/analyses.h	(revision 24312)
+++ /issm/trunk/src/c/analyses/analyses.h	(revision 24313)
@@ -30,4 +30,5 @@
 #include "./HydrologyDCInefficientAnalysis.h"
 #include "./HydrologyShreveAnalysis.h"
+#include "./HydrologyGlaDSAnalysis.h"
 #include "./HydrologyShaktiAnalysis.h"
 #include "./HydrologyPismAnalysis.h"
Index: /issm/trunk/src/c/bamg/BamgOpts.cpp
===================================================================
--- /issm/trunk/src/c/bamg/BamgOpts.cpp	(revision 24312)
+++ /issm/trunk/src/c/bamg/BamgOpts.cpp	(revision 24313)
@@ -28,5 +28,5 @@
 	this->hminVertices=NULL; this->hminVerticesSize[0]=this->hminVerticesSize[1]=0;
 	this->hmaxVertices=NULL; this->hmaxVerticesSize[0]=this->hmaxVerticesSize[1]=0;
-	this->hVertices=NULL;    this->hVerticesSize[0]=this->hVerticesSize[1]=0;
+	this->hVertices=NULL;    this->hVerticesLength=0;
 	this->metric=NULL;       this->metricSize[0]=this->metricSize[1]=0;
 	this->field=NULL;        this->fieldSize[0]=this->fieldSize[1]=0;
@@ -70,5 +70,5 @@
 	if (this->hminVertices && this->hminVerticesSize[1]!=1) _error_("'hminVertices' should be a column");
 	if (this->hmaxVertices && this->hmaxVerticesSize[1]!=1) _error_("'hmaxVertices' should be a column");
-	if (this->hVertices && this->hVerticesSize[1]!=1) _error_("'hVertices' should be a column");
+	if (this->hVertices && this->hVerticesLength<2) _error_("'hVertices' should be a vector");
 	if (this->metric && (this->metricSize[1]!=1 && this->metricSize[1]!=3)) _error_("'metric' should have either 1 (iso) or 3 (aniso) columns.");
 	if (this->field){
Index: /issm/trunk/src/c/bamg/BamgOpts.h
===================================================================
--- /issm/trunk/src/c/bamg/BamgOpts.h	(revision 24312)
+++ /issm/trunk/src/c/bamg/BamgOpts.h	(revision 24313)
@@ -1,5 +1,5 @@
 /*!\file:  BamgOpts.h
  * \brief place holder for optimization function arguments
- */ 
+ */
 
 #ifndef _BAMGOPTS_H_
@@ -38,5 +38,5 @@
 		int     hmaxVerticesSize[2];
 		double* hmaxVertices;
-		int     hVerticesSize[2];
+		int     hVerticesLength;
 		double* hVertices;
 		int     metricSize[2];
Index: /issm/trunk/src/c/bamg/Geometry.cpp
===================================================================
--- /issm/trunk/src/c/bamg/Geometry.cpp	(revision 24312)
+++ /issm/trunk/src/c/bamg/Geometry.cpp	(revision 24313)
@@ -57,5 +57,5 @@
 		nbcurves=0;
 
-		double Hmin = HUGE_VAL;// the infinie value 
+		double Hmin = HUGE_VAL;// the infinie value
 		int i,j,n,i0,i1,i2,i3;
 
@@ -96,5 +96,5 @@
 			/*coefIcoor is the coefficient used for integer coordinates:
 			 *                       (x-pmin.x)
-			 * Icoor x = (2^30 -1) ------------ 
+			 * Icoor x = (2^30 -1) ------------
 			 *                          D
 			 * where D is the longest side of the domain (direction x or y)
@@ -155,9 +155,9 @@
 			}
 
-			// definition the default of the given mesh size 
+			// definition the default of the given mesh size
 			for (i=0;i<nbv;i++) {
-				if (vertices[i].color > 0) 
+				if (vertices[i].color > 0)
 				 vertices[i].m=Metric(verticeslength[i] /(double) vertices[i].color);
-				else 
+				else
 				 vertices[i].m=Metric(Hmin);
 			}
@@ -170,5 +170,5 @@
 
 		//hVertices
-		if(bamgopts->hVertices && bamgopts->hVerticesSize[0]==nbv){
+		if(bamgopts->hVertices && bamgopts->hVerticesLength==nbv){
 			if(verbose>5) _printf_("      processing hVertices\n");
 			for (i=0;i< nbv;i++){
@@ -211,5 +211,5 @@
 			if (bamggeom->CornersSize[1]!=1) _error_("Corners should have 1 column");
 			n=bamggeom->CornersSize[0];
-			for (i=0;i<n;i++) {     
+			for (i=0;i<n;i++) {
 				j=(int)bamggeom->Corners[i]-1; //for C indexing
 				if (j>nbv-1 || j<0) _error_("Bad corner definition: should in [0 " << nbv << "]");
@@ -225,5 +225,5 @@
 			if (bamggeom->RequiredVerticesSize[1]!=1) _error_("RequiredVertices should have 1 column");
 			n=bamggeom->RequiredVerticesSize[0];
-			for (i=0;i<n;i++) {     
+			for (i=0;i<n;i++) {
 				j=(int)bamggeom->RequiredVertices[i]-1; //for C indexing
 				if (j>nbv-1 || j<0) _error_("Bad RequiredVerticess  definition: should in [0 " << nbv << "]");
@@ -237,8 +237,8 @@
 			if (bamggeom->RequiredEdgesSize[1]!=1) _error_("RequiredEdges should have 1 column");
 			n=bamggeom->RequiredEdgesSize[0];
-			for (i=0;i<n;i++) {     
+			for (i=0;i<n;i++) {
 				j=(int)bamggeom->RequiredEdges[i]-1; //for C indexing
 				if (j>nbe-1 || j<0) _error_("Bad RequiredEdges definition: should in [0 " << nbe << "]");
-				edges[j].SetRequired();  
+				edges[j].SetRequired();
 			}
 		}
@@ -457,10 +457,10 @@
 			  the vertices by groups of 5:
 			  All the coordinates are transformed to ]0,1[^2
-			  then, the integer coordinates are computed using 
+			  then, the integer coordinates are computed using
 			  the transformation ]0,1[^2 -> [0 2^30-1[^2 for a quadtree of depth 30*/
-			vertices[i].i=R2ToI2(vertices[i].r); 
+			vertices[i].i=R2ToI2(vertices[i].r);
 
 			/*find nearest vertex already present in the quadtree (NULL if empty)*/
-			BamgVertex* v=quadtree.NearestVertex(vertices[i].i.x,vertices[i].i.y); 
+			BamgVertex* v=quadtree.NearestVertex(vertices[i].i.x,vertices[i].i.y);
 
 			/*if there is a vertex found that is to close to vertices[i] -> error*/
@@ -506,5 +506,5 @@
 		 *       head_F[j]=i;
 		 *    }
-		 * 
+		 *
 		 *    Then, we can go through all the elements that have for image j:
 		 *    for(i=head_F[j]; i!=-1; i=next_F[i])
@@ -512,14 +512,14 @@
 		 *    stop the loop when i=-1 (end of the chain)
 		 *    iterate using i=next_F[i] (next element that have for image j)
-		 * 
+		 *
 		 * 2. How to use this algorithm here?
-		 * 
+		 *
 		 * Here F is a function that associates two vertices v0 and v1 for a given edge E
 		 * We want to build the reciprocal function: what are the edges that contains
 		 * a vertex v?
 		 * To do so, we use the same chaining algorithm but there is a difficulty
-		 * coming from the fact that for F we have a couple of vertices and not one 
+		 * coming from the fact that for F we have a couple of vertices and not one
 		 * vertex.
-		 * To overcome this difficulty, we use a global indexing exactly like in 
+		 * To overcome this difficulty, we use a global indexing exactly like in
 		 * C/C++ so that
 		 * a member of a 2-column-table can be described by one index p=i*2+j
@@ -566,11 +566,11 @@
 		//sort head_v by order of increasing edges angle
 		for (i=0;i<nbv;i++) {
-			int exch=1,ord=0;      
+			int exch=1,ord=0;
 
 			//exchange vertices position in head_v and next_p till tey are sorted
 			while (exch){
-				long *p=head_v+i;               
-				long *po=p;                     
-				long  n=*p;                     
+				long *p=head_v+i;
+				long *po=p;
+				long  n=*p;
 				float angleold=-1000 ; // angle = - infinity
 				ord=0; exch=0;
@@ -584,8 +584,8 @@
 
 					//Next vertex index
-					n=*pn;                       
+					n=*pn;
 
 					//compute angle between horizontal axis and v0->v1
-					float angle = j1 ? OppositeAngle(eangle[i1]):  eangle[i1]; 
+					float angle = j1 ? OppositeAngle(eangle[i1]):  eangle[i1];
 
 					//exchange if the current edge angle is smaller than the previous one
@@ -593,5 +593,5 @@
 						exch=1;
 						*pn=*po;  // next_p[n] = n + 1
-						*po=*p;   // 
+						*po=*p;   //
 						*p=n;     // next_p[n+1] = n
 						po=pn;    // po now point toward pn (invert next and current)
@@ -634,6 +634,6 @@
 			else{
 				/*all vertices provided in geometry are corners (ord = number of edges holding i)*/
-				vertices[i].SetCorner() ; 
-				if(ord==2){ 
+				vertices[i].SetCorner() ;
+				if(ord==2){
 					long  n1 = head_v[i];
 					long  n2 = next_p[n1];
@@ -652,5 +652,5 @@
 			/*close the list around the vertex to have a circular loop*/
 			long no=-1, ne = head_v[i];
-			while (ne >=0) ne = next_p[no=ne];        
+			while (ne >=0) ne = next_p[no=ne];
 			if(no>=0) next_p[no] = head_v[i];
 		}
@@ -662,5 +662,5 @@
 			for (j=0;j<2;j++){
 
-				long n1 = next_p[k++]; 
+				long n1 = next_p[k++];
 				long i1 = n1/2 ,j1=n1%2;
 
@@ -695,5 +695,5 @@
 						ltg= lAB;
 					}
-					//else:  a Corner no tangent => nothing to do    
+					//else:  a Corner no tangent => nothing to do
 				}
 				else{
@@ -710,5 +710,5 @@
 			if (ltg2[0]!=0) edges[i].SetTgA();
 			if (ltg2[1]!=0) edges[i].SetTgB();
-		} 
+		}
 
 		/* generation of  all curves (from corner to corner)*/
@@ -726,12 +726,12 @@
 				for (i=0;i<nbe;i++){
 
-					GeomEdge & ei=edges[i];   
+					GeomEdge & ei=edges[i];
 					for(j=0;j<2;j++){
 						/*If current edge ei is unmarked and (level=1 or vertex i is required (corner)):
 						 * we do have the first edge of a new curve*/
-						if (!ei.Mark() && (level || ei[j].Required())) { 
+						if (!ei.Mark() && (level || ei[j].Required())) {
 							int k0=j,k1;
 							GeomEdge   *e=&ei;
-							GeomVertex *a=(*e)(k0); // begin 
+							GeomVertex *a=(*e)(k0); // begin
 							if(curves){
 								curves[nbcurves].FirstEdge=e;
@@ -739,7 +739,7 @@
 							}
 							int nee=0;
-							for(;;){ 
+							for(;;){
 								nee++;
-								k1 = 1-k0; // next vertex of the edge 
+								k1 = 1-k0; // next vertex of the edge
 								e->SetMark();
 								nb_marked_edges++;
@@ -765,10 +765,10 @@
 						}
 					}
-				} 
+				}
 			}
 			_assert_(nb_marked_edges && nbe);
 			//allocate if first step
 			if(step==0) curves=new Curve[nbcurves];
-		} 
+		}
 
 		/*clean up*/
@@ -812,5 +812,5 @@
 
 		//Get edge direction and swap v0 and v1 if necessary
-		R2 Ag=(R2)(*on)[0],Bg=(R2)(*on)[1],AB=Bg-Ag; 
+		R2 Ag=(R2)(*on)[0],Bg=(R2)(*on)[1],AB=Bg-Ag;
 		int OppositeSens = (V01,AB)<0;
 		int direction0=0,direction1=1;
@@ -828,5 +828,5 @@
 		directionge[bge]=1;
 
-		while(eg0!=(GeomEdge*)vg0 && (*eg0)(direction0)!=(GeomVertex*)vg0){ 
+		while(eg0!=(GeomEdge*)vg0 && (*eg0)(direction0)!=(GeomVertex*)vg0){
 			if (bge<=0) {
 				if(NbTry) {
@@ -846,6 +846,6 @@
 			direction0 = 1-( directionge[bge] = tmpge->AdjVertexIndex[direction0]);
 		}
-		while (eg1 != (GeomEdge*) vg1  &&  (*eg1)(direction1) != (GeomVertex*) vg1) { 
-			if(tge>=mxe ) { 
+		while (eg1 != (GeomEdge*) vg1  &&  (*eg1)(direction1) != (GeomVertex*) vg1) {
+			if(tge>=mxe ) {
 				_printf_("WARNING: on the class Mesh before call Geometry::ProjectOnCurve is having issues (isn't it Eric?)\n");
 				NbTry++;
@@ -871,5 +871,5 @@
 
 		double sg;
-		if (eg0 == eg1) { 
+		if (eg0 == eg1) {
 			double s0=vg0,s1=vg1;
 			sg =  s0*(1.0-s) +  s*s1;
@@ -886,5 +886,5 @@
 				lge[i]=ll += Norme2(AA-BB);
 				AA=BB ;}
-				lge[tge]=ll+=Norme2(AA-V1); 
+				lge[tge]=ll+=Norme2(AA-V1);
 				// search the geometrical edge
 				_assert_(s<=1.0);
@@ -900,10 +900,10 @@
 				}
 				on=ge[i];
-				if (i==tge) 
+				if (i==tge)
 				 s1=vg1;
 
 				s  =(ls-l0)/(l1-l0);
-				sg =s0*(1.0-s)+s*s1;    
-		} 
+				sg =s0*(1.0-s)+s*s1;
+		}
 		_assert_(on);
 		V.r= on->F(sg);
@@ -915,5 +915,5 @@
 		/*coefIcoor is the coefficient used for integer coordinates:
 		 *                       (x-pmin.x)
-		 * Icoor x = (2^30 -1) ------------ 
+		 * Icoor x = (2^30 -1) ------------
 		 *                          D
 		 * where D is the longest side of the domain (direction x or y)
@@ -927,3 +927,3 @@
 		for (int i=0;i<nbe;i++) edges[i].SetUnMark();
 	}/*}}}*/
-} 
+}
Index: /issm/trunk/src/c/classes/AdaptiveMeshRefinement.cpp
===================================================================
--- /issm/trunk/src/c/classes/AdaptiveMeshRefinement.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/AdaptiveMeshRefinement.cpp	(revision 24313)
@@ -15,5 +15,26 @@
 /*Constructor, copy, clean up and destructor*/
 AdaptiveMeshRefinement::AdaptiveMeshRefinement(){/*{{{*/
-	this->Initialize();
+
+	/*Set pointers to NULL*/
+	this->fathermesh						= NULL;
+	this->previousmesh					= NULL;
+	this->refinement_type				= -1;
+	this->level_max						= -1;
+	this->gradation						= -1;
+	this->lag								= -1;
+   this->groundingline_distance		= -1;
+	this->icefront_distance				= -1;
+	this->thicknesserror_threshold	= -1;
+	this->deviatoricerror_threshold	= -1;
+	this->deviatoricerror_maximum		= -1;
+	this->thicknesserror_maximum		= -1;
+	this->sid2index.clear();
+	this->index2sid.clear();
+	this->specialelementsindex.clear();
+	this->x									= NULL;
+	this->y									= NULL;
+	this->elementslist					= NULL;
+	this->numberofvertices				= -1;
+	this->numberofelements				= -1;
 }
 /*}}}*/
@@ -54,4 +75,6 @@
 /*}}}*/
 AdaptiveMeshRefinement::~AdaptiveMeshRefinement(){/*{{{*/
+	int writemesh = 0;//only to restart
+	if(writemesh) this->WriteMesh();
 	this->CleanUp();
 	gRefDBase.clear();
@@ -63,4 +86,7 @@
 	if(this->fathermesh)    delete this->fathermesh;
 	if(this->previousmesh)  delete this->previousmesh;
+	if(this->x)					delete this->x;
+	if(this->y)					delete this->y;
+	if(this->elementslist)	delete this->elementslist;
 	this->refinement_type				= -1;
 	this->level_max						= -1;
@@ -73,4 +99,6 @@
 	this->deviatoricerror_maximum		= -1;
 	this->thicknesserror_maximum		= -1;
+	this->numberofvertices				= -1;
+	this->numberofelements				= -1;
 	this->sid2index.clear();
 	this->index2sid.clear();
@@ -78,26 +106,28 @@
 }
 /*}}}*/
-void AdaptiveMeshRefinement::Initialize(){/*{{{*/
-
-	/*Set pointers to NULL*/
-	this->fathermesh						= NULL;
-	this->previousmesh					= NULL;
-	this->refinement_type				= -1;
-	this->level_max						= -1;
-	this->gradation						= -1;
-	this->lag								= -1;
-   this->groundingline_distance		= -1;
-	this->icefront_distance				= -1;
-	this->thicknesserror_threshold	= -1;
-	this->deviatoricerror_threshold	= -1;
-	this->deviatoricerror_maximum		= -1;
-	this->thicknesserror_maximum		= -1;
-	this->sid2index.clear();
-	this->index2sid.clear();
-	this->specialelementsindex.clear();
-}
-/*}}}*/
 
 /*Mesh refinement methods*/
+void AdaptiveMeshRefinement::SetMesh(int** elementslist_in,IssmDouble** x_in,IssmDouble** y_in,int* numberofvertices_in,int* numberofelements_in){/*{{{*/
+   
+   /*Delete previous mesh and keep the entire mesh*/
+   if(this->elementslist) xDelete<int>(this->elementslist);
+   if(this->x) xDelete<IssmDouble>(this->x);
+   if(this->y) xDelete<IssmDouble>(this->y);
+
+   this->elementslist      = *elementslist_in;
+   this->x                 = *x_in;
+   this->y                 = *y_in;
+   this->numberofvertices  = *numberofvertices_in;
+   this->numberofelements  = *numberofelements_in;
+}/*}}}*/
+void AdaptiveMeshRefinement::GetMesh(int** elementslist_out,IssmDouble** x_out,IssmDouble** y_out,int* numberofvertices_out,int* numberofelements_out){/*{{{*/
+   
+   /*Get the entire mesh*/
+   *elementslist_out    = this->elementslist;
+   *x_out               = this->x;
+   *y_out               = this->y;
+   *numberofvertices_out= this->numberofvertices;
+   *numberofelements_out= this->numberofelements;
+}/*}}}*/
 void AdaptiveMeshRefinement::ExecuteRefinement(double* gl_distance,double* if_distance,double* deviatoricerror,double* thicknesserror,int** pdatalist,double** pxylist,int** pelementslist){/*{{{*/
 
@@ -264,5 +294,5 @@
 	if(verbose) _printf_(""<<count<<"\n");
 	/*Adjust the connectivities before continue*/
-	gmesh->BuildConnectivity();
+	//gmesh->BuildConnectivity(); this is not necessary
 	/*}}}*/
 
@@ -301,5 +331,5 @@
 	if(verbose) _printf_(""<<count<<"\n");
 	/*Adjust the connectivities before continue*/
-	gmesh->BuildConnectivity();
+	//gmesh->BuildConnectivity();//this is not necessary
 	/*}}}*/
 
@@ -312,5 +342,5 @@
 }
 /*}}}*/
-int AdaptiveMeshRefinement::VerifyRefinementType(TPZGeoEl* geoel){/*{{{*/
+int AdaptiveMeshRefinement::VerifyRefinementType(TPZGeoEl* geoel,TPZGeoMesh* gmesh){/*{{{*/
 
 	/*
@@ -323,5 +353,4 @@
 	/*Output*/
 	int type=0;
-	int count=0;
 
 	/*Intermediaries*/
@@ -330,13 +359,14 @@
 	/*Loop over neighboors (sides 3, 4 and 5)*/
 	for(int j=3;j<6;j++){
+		if(!gmesh->Element(geoel->NeighbourIndex(j))->HasSubElement()) continue;
 		sons.clear();
-		geoel->Neighbour(j).Element()->GetHigherSubElements(sons);
-		if(sons.size()) count++; //if neighbour was refined
-		if(sons.size()>4) count++; //if neighbour's level is > element level+1
-	}
-
+		gmesh->Element(geoel->NeighbourIndex(j))->GetHigherSubElements(sons);
+		if(sons.size()) type++; //if neighbour was refined
+		if(sons.size()>4) type++; //if neighbour's level is > element level+1
+		if(type>1) break;
+	}
+	
 	/*Verify and return*/
-	if(count>1) type=2;
-	else type=count;
+	if(type>1) type=2;
 
 	return type;
@@ -358,4 +388,5 @@
 
 	count=1;
+	
 	while(count>0){
 		count=0;
@@ -367,15 +398,17 @@
 			if(gmesh->Element(i)->Level()==this->level_max) continue;
 			/*loop over neighboors (sides 3, 4 and 5). Important: neighbours has the same dimension of the element*/
-			type=this->VerifyRefinementType(gmesh->Element(i));
+			type=this->VerifyRefinementType(gmesh->Element(i),gmesh);
 			if(type<2){
 				typecount=0;
 				for(int j=3;j<6;j++){
-					if(gmesh->Element(i)->Neighbour(j).Element()->HasSubElement()) continue;
-					if(gmesh->Element(i)->Neighbour(j).Element()->Index()==i) typecount++;//neighbour==this element, element at the border
-					if(this->VerifyRefinementType(gmesh->Element(i)->Neighbour(j).Element())==1) typecount++;
+					if(gmesh->Element(gmesh->Element(i)->NeighbourIndex(j))->HasSubElement()) continue;
+					if(gmesh->Element(i)->NeighbourIndex(j)==i) typecount++;//neighbour==this element, element at the border
+					if(this->VerifyRefinementType(gmesh->Element(gmesh->Element(i)->NeighbourIndex(j)),gmesh)==1) typecount++;
+					if(typecount>1 && type==1) type=2;
+					else if(typecount>2 && type==0) type=2;
+					if(type==2) break;
 				}
-				if(typecount>1 && type==1) type=2;
-				else if(typecount>2 && type==0) type=2;
 			}
+			
 			/*refine the element if requested*/
 			if(type==2){gmesh->Element(i)->Divide(sons);	count++;}
@@ -386,5 +419,5 @@
 		}
 		/*Adjust the connectivities before continue*/
-		gmesh->BuildConnectivity();
+		//gmesh->BuildConnectivity();//this is not necessary
 	}
 }
@@ -424,5 +457,5 @@
 			else _printf_(""<<count<<", ");
 		}
-		gmesh->BuildConnectivity();
+		//gmesh->BuildConnectivity();//this is not necessary
 	}
 }
@@ -446,5 +479,5 @@
 	this->specialelementsindex.clear();
 	/*Adjust connectivities*/
-	gmesh->BuildConnectivity();
+	//gmesh->BuildConnectivity();//this is not necessary
 }
 /*}}}*/
@@ -550,25 +583,26 @@
 }
 /*}}}*/
-void AdaptiveMeshRefinement::CreateInitialMesh(int &nvertices,int &nelements,double* x,double* y,int* elements){/*{{{*/
+void AdaptiveMeshRefinement::Initialize(){/*{{{*/
 
 	/* IMPORTANT! elements come in Matlab indexing
 		NEOPZ works only in C indexing*/
 
-	if(nvertices<=0) _error_("Impossible to create initial mesh: nvertices is <= 0!\n");
-   if(nelements<=0) _error_("Impossible to create initial mesh: nelements is <= 0!\n");
+	if(this->numberofvertices<=0) _error_("Impossible to create initial mesh: nvertices is <= 0!\n");
+   if(this->numberofelements<=0) _error_("Impossible to create initial mesh: nelements is <= 0!\n");
 	if(this->refinement_type!=0 && this->refinement_type!=1) _error_("Impossible to create initial mesh: refinement type is not defined!\n");
 
     /*Verify and creating initial mesh*/
-   if(this->fathermesh || this->previousmesh) _error_("Initial mesh already exists!");
+   if(!this->x || !this->y || !this->elementslist) _error_("Mesh data structure is NULL!\n");
+	if(this->fathermesh || this->previousmesh) _error_("Initial mesh already exists!\n");
 
    this->fathermesh = new TPZGeoMesh();
-	this->fathermesh->NodeVec().Resize(nvertices);
+	this->fathermesh->NodeVec().Resize(this->numberofvertices);
 
 	/*Set the vertices (geometric nodes in NeoPZ context)*/
-	for(int i=0;i<nvertices;i++){  
+	for(int i=0;i<this->numberofvertices;i++){  
       /*x,y,z coords*/
 		TPZManVector<REAL,3> coord(3,0.);
-      coord[0]= x[i];
-      coord[1]= y[i];
+      coord[0]= this->x[i];
+      coord[1]= this->y[i];
       coord[2]= 0.;
       /*Insert in the mesh*/
@@ -581,9 +615,9 @@
    const int mat = this->GetElemMaterialID();
    TPZManVector<long> elem(this->GetNumberOfNodes(),0);
-	this->index2sid.clear(); this->index2sid.resize(nelements);
+	this->index2sid.clear(); this->index2sid.resize(this->numberofelements);
    this->sid2index.clear();
 
-	for(int i=0;i<nelements;i++){
-		for(int j=0;j<this->GetNumberOfNodes();j++) elem[j]=elements[i*this->GetNumberOfNodes()+j]-1;//Convert Matlab to C indexing
+	for(int i=0;i<this->numberofelements;i++){
+		for(int j=0;j<this->GetNumberOfNodes();j++) elem[j]=this->elementslist[i*this->GetNumberOfNodes()+j]-1;//Convert Matlab to C indexing
       switch(this->GetNumberOfNodes()){
 			case 3: this->fathermesh->CreateGeoElement(ETriangle,elem,mat,index,this->refinement_type);	break;
@@ -853,2 +887,87 @@
 }
 /*}}}*/
+void AdaptiveMeshRefinement::ReadMesh(){/*{{{*/
+
+	std::string fathermeshfile		= "/home/santos/issm_fathermesh.txt";
+	std::string previousmeshfile	= "/home/santos/issm_previousmesh.txt";
+	std::string amrfile				= "/home/santos/issm_amr.txt";
+	std::ifstream amrifstream(amrfile.c_str());				
+	int size,value;
+
+	TPZPersistenceManager::OpenRead(fathermeshfile);
+	this->fathermesh = dynamic_cast<TPZGeoMesh *>(TPZPersistenceManager::ReadFromFile());
+	TPZPersistenceManager::CloseRead();
+	
+	TPZPersistenceManager::OpenRead(previousmeshfile);
+	this->previousmesh = dynamic_cast<TPZGeoMesh *>(TPZPersistenceManager::ReadFromFile());
+   TPZPersistenceManager::CloseRead();
+
+	if(!amrifstream.is_open()) _error_("amr ifstream is not open!");
+	amrifstream.seekg(0);
+	
+	this->sid2index.clear();
+	this->index2sid.clear();
+	this->specialelementsindex.clear();
+	
+	amrifstream>>size;
+	for(int i=0;i<size;i++){
+		amrifstream>>value;
+		this->sid2index.push_back(value);
+	}
+	
+	amrifstream>>size;
+	for(int i=0;i<size;i++){
+		amrifstream>>value;
+		this->index2sid.push_back(value);
+	}
+	
+	amrifstream>>size;
+	for(int i=0;i<size;i++){
+		amrifstream>>value;
+		this->specialelementsindex.push_back(value);
+	}
+}
+/*}}}*/
+void AdaptiveMeshRefinement::WriteMesh(){/*{{{*/
+
+	std::string fathermeshfile		= "/home/santos/issm_fathermesh.txt";
+	std::string previousmeshfile	= "/home/santos/issm_previousmesh.txt";
+	std::string amrfile				= "/home/santos/issm_amr.txt";
+	std::ofstream amrofstream(amrfile.c_str());				
+
+	if(this->fathermesh){
+		TPZPersistenceManager::OpenWrite(fathermeshfile);
+		TPZPersistenceManager::WriteToFile(this->fathermesh);
+		TPZPersistenceManager::CloseWrite();
+	}
+
+	if(this->previousmesh){
+		TPZPersistenceManager::OpenWrite(previousmeshfile);
+		TPZPersistenceManager::WriteToFile(this->previousmesh);
+		TPZPersistenceManager::CloseWrite();
+	}
+
+	if(this->sid2index.size()>0){
+		amrofstream << this->sid2index.size() << std::endl;
+		for(int i=0;i<this->sid2index.size();i++) {
+			amrofstream << this->sid2index[i] << std::endl;
+		}
+	}
+	
+	if(this->index2sid.size()>0){
+		amrofstream << this->index2sid.size() << std::endl;
+		for(int i=0;i<this->index2sid.size();i++) {
+			amrofstream << this->index2sid[i] << std::endl;
+		}
+	}
+
+	if(this->specialelementsindex.size()){
+		amrofstream << this->specialelementsindex.size() << std::endl;
+		for(int i=0;i<this->specialelementsindex.size();i++) {
+			amrofstream << this->specialelementsindex[i] << std::endl;
+		}
+	}
+	amrofstream.flush();
+	amrofstream.close();
+}
+/*}}}*/
Index: /issm/trunk/src/c/classes/AdaptiveMeshRefinement.h
===================================================================
--- /issm/trunk/src/c/classes/AdaptiveMeshRefinement.h	(revision 24312)
+++ /issm/trunk/src/c/classes/AdaptiveMeshRefinement.h	(revision 24313)
@@ -68,6 +68,9 @@
 	void Initialize();
    void ExecuteRefinement(double* gl_distance,double* if_distance,double* deviatoricerror,double* thicknesserror,int** pdatalist,double** pxy,int** pelementslist);
-	void CreateInitialMesh(int &nvertices,int &nelements,double* x,double* y,int* elements);
+	void SetMesh(int** elementslist_in,IssmDouble** x_in,IssmDouble** y_in,int* numberofvertices,int* numberofelements);
+	void GetMesh(int** elementslist_out,IssmDouble** x_out,IssmDouble** y_out,int* numberofvertices,int* numberofelements);
 	void CheckMesh(int** pdata,double** pxy,int** pelements);
+	void ReadMesh();
+	void WriteMesh();
 	/*}}}*/
 private:
@@ -78,4 +81,9 @@
 	TPZGeoMesh *fathermesh;							// Entire mesh without refinement if refinement_type==1; refined with hanging nodes if efinement_type==0
 	TPZGeoMesh *previousmesh;						// Refined mesh without hanging nodes (it is always refpattern type), used to generate ISSM mesh
+	IssmDouble* x; 									// Entire mesh
+   IssmDouble* y;
+   int* elementslist;
+   int numberofvertices;
+   int numberofelements;	
 	/*}}}*/
 	/*Private methods{{{*/
@@ -90,5 +98,5 @@
 	void PrintGMeshVTK(TPZGeoMesh *gmesh,std::ofstream &file,bool matColor=true);
 	int GetVTK_ElType(TPZGeoEl* gel);
-	int VerifyRefinementType(TPZGeoEl* geoel);
+	int VerifyRefinementType(TPZGeoEl* geoel,TPZGeoMesh* gmesh);
 	/*}}}*/
 };
Index: /issm/trunk/src/c/classes/AmrBamg.cpp
===================================================================
--- /issm/trunk/src/c/classes/AmrBamg.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/AmrBamg.cpp	(revision 24313)
@@ -39,4 +39,9 @@
 	this->fathermesh								= NULL;
 	this->previousmesh							= NULL;
+	this->elementslist							= NULL;
+	this->x											= NULL;
+	this->y											= NULL;
+	this->numberofvertices						= -1;
+	this->numberofelements						= -1;
 
 	/*Only initialize options for now (same as bamg.m)*/
@@ -73,10 +78,34 @@
 	if(this->previousmesh) delete this->previousmesh;
 	if(this->options) delete this->options;
-
+	if(this->x) xDelete<IssmDouble>(this->x);
+	if(this->y) xDelete<IssmDouble>(this->y);
+	if(this->elementslist) xDelete<int>(this->elementslist);
 }
 /*}}}*/
 
 /*Methods*/
-void AmrBamg::Initialize(int* elements,IssmDouble* x,IssmDouble* y,int numberofvertices,int numberofelements){/*{{{*/
+void AmrBamg::SetMesh(int** elementslist_in,IssmDouble** x_in,IssmDouble** y_in,int* numberofvertices_in,int* numberofelements_in){/*{{{*/
+	
+	/*Delete previous mesh and keep the entire mesh*/
+	if(this->elementslist) xDelete<int>(this->elementslist);
+	if(this->x) xDelete<IssmDouble>(this->x);
+	if(this->y) xDelete<IssmDouble>(this->y);
+
+	this->elementslist		= *elementslist_in;
+	this->x						= *x_in;
+	this->y						= *y_in;
+	this->numberofvertices	= *numberofvertices_in;
+	this->numberofelements	= *numberofelements_in;
+}/*}}}*/
+void AmrBamg::GetMesh(int** elementslist_out,IssmDouble** x_out,IssmDouble** y_out,int* numberofvertices_out,int* numberofelements_out){/*{{{*/
+	
+	/*Get the entire mesh*/
+	*elementslist_out		= this->elementslist;
+	*x_out					= this->x;
+	*y_out					= this->y;
+	*numberofvertices_out= this->numberofvertices;
+	*numberofelements_out= this->numberofelements;
+}/*}}}*/
+void AmrBamg::Initialize(){/*{{{*/
 
 	/*Check options*/
@@ -85,5 +114,5 @@
 
 	/*Read father mesh and create geometry*/
-	Mesh* Th=new Mesh(elements,x,y,numberofvertices,numberofelements,this->options);
+	Mesh* Th=new Mesh(this->elementslist,this->x,this->y,this->numberofvertices,this->numberofelements,this->options);
 
 	/*Write geometry*/
@@ -99,5 +128,5 @@
 }/*}}}*/
 void AmrBamg::ExecuteRefinementBamg(IssmDouble* field,IssmDouble* hmaxVertices,int** pdatalist,IssmDouble** pxylist,int** pelementslist){/*{{{*/
-
+	
 	/*Intermediaries*/
 	BamgGeom* geomout=new BamgGeom();
@@ -113,5 +142,5 @@
 	this->options->field			 = field;
 	this->options->hmaxVertices = hmaxVertices;
-
+	
 	/*remesh*/
 	if(this->previousmesh){
Index: /issm/trunk/src/c/classes/AmrBamg.h
===================================================================
--- /issm/trunk/src/c/classes/AmrBamg.h	(revision 24312)
+++ /issm/trunk/src/c/classes/AmrBamg.h	(revision 24313)
@@ -28,4 +28,5 @@
 		IssmDouble deviatoricerror_maximum;
 
+
 		/* Constructor, destructor etc*/
 		AmrBamg();
@@ -34,8 +35,13 @@
 
 		/*General methods*/
-		void Initialize(int* elements,IssmDouble* x,IssmDouble* y,int numberofvertices,int numberofelements);
+		void Initialize();
+		void SetMesh(int** elementslist_in,IssmDouble** x_in,IssmDouble** y_in,int* numberofvertices,int* numberofelements);
+		void GetMesh(int** elementslist_out,IssmDouble** x_out,IssmDouble** y_out,int* numberofvertices,int* numberofelements);
 		void ExecuteRefinementBamg(IssmDouble* field,IssmDouble* hmaxVertices,int** pdatalist,IssmDouble** pxylist,int** pelementslist);
 		void SetBamgOpts(IssmDouble hmin_in,IssmDouble hmax_in,IssmDouble err_in,IssmDouble gradation_in);
-
+		
+		/*Access Method*/
+		BamgOpts* GetBamgOpts(){return this->options;}
+		
 	private:
 		BamgGeom* geometry;
@@ -43,4 +49,10 @@
 		BamgMesh* previousmesh;
 		BamgOpts* options;
+		/*entire mesh*/
+		IssmDouble* x;
+		IssmDouble* y;
+		int* elementslist;
+		int numberofvertices;
+		int numberofelements;
 };
 
Index: /issm/trunk/src/c/classes/Constraints/Constraint.h
===================================================================
--- /issm/trunk/src/c/classes/Constraints/Constraint.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Constraints/Constraint.h	(revision 24313)
@@ -22,5 +22,4 @@
 		virtual void ActivatePenaltyMethod(void)=0;
 		virtual void ConstrainNode(Nodes* nodes,Parameters* parameters)=0;
-		virtual bool InAnalysis(int analysis_type)=0;
 		virtual void PenaltyDofAndValue(int* dof,IssmDouble* value,Nodes* nodes,Parameters* parameters)=0;
 		virtual void InputUpdateFromVectorDakota(IssmDouble* vector,Nodes* nodes,int name,int type) = 0;
Index: /issm/trunk/src/c/classes/Constraints/Constraints.cpp
===================================================================
--- /issm/trunk/src/c/classes/Constraints/Constraints.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Constraints/Constraints.cpp	(revision 24313)
@@ -24,24 +24,7 @@
 	for(int i=0;i<this->Size();i++){
 		Constraint* constraint=(Constraint*)this->GetObjectByOffset(i);
-		if(constraint->InAnalysis(in_analysis)){
-			constraint->ActivatePenaltyMethod();
-		}
+		constraint->ActivatePenaltyMethod();
 	}
 
 }
 /*}}}*/
-int  Constraints::NumberOfConstraints(void){/*{{{*/
-
-	int localconstraints;
-	int numberofconstraints;
-
-	/*Get number of local constraints*/
-	localconstraints=this->Size();
-
-	/*figure out total number of constraints combining all the cpus (no clones here)*/
-	ISSM_MPI_Reduce(&localconstraints,&numberofconstraints,1,ISSM_MPI_INT,ISSM_MPI_SUM,0,IssmComm::GetComm() );
-	ISSM_MPI_Bcast(&numberofconstraints,1,ISSM_MPI_INT,0,IssmComm::GetComm());
-
-	return numberofconstraints;
-}
-/*}}}*/
Index: /issm/trunk/src/c/classes/Constraints/Constraints.h
===================================================================
--- /issm/trunk/src/c/classes/Constraints/Constraints.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Constraints/Constraints.h	(revision 24313)
@@ -28,6 +28,4 @@
 		/*numerics*/
 		void ActivatePenaltyMethod(int in_analysis);
-		int  NumberOfConstraints(void);
-
 };
 
Index: /issm/trunk/src/c/classes/Constraints/SpcDynamic.cpp
===================================================================
--- /issm/trunk/src/c/classes/Constraints/SpcDynamic.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Constraints/SpcDynamic.cpp	(revision 24313)
@@ -112,9 +112,4 @@
 }
 /*}}}*/
-bool SpcDynamic::InAnalysis(int in_analysis_type){/*{{{*/
-	if (in_analysis_type==this->analysis_type) return true;
-	else return false;
-}
-/*}}}*/
 
 /*SpcDynamic functions*/
Index: /issm/trunk/src/c/classes/Constraints/SpcDynamic.h
===================================================================
--- /issm/trunk/src/c/classes/Constraints/SpcDynamic.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Constraints/SpcDynamic.h	(revision 24313)
@@ -40,5 +40,4 @@
 		void ActivatePenaltyMethod(void);
 		void ConstrainNode(Nodes* nodes,Parameters* parameters);
-		bool InAnalysis(int analysis_type);
 		void PenaltyDofAndValue(int* dof,IssmDouble* value,Nodes* nodes,Parameters* parameters){_error_("not implemented yet");};
 		void InputUpdateFromVectorDakota(IssmDouble* vector,Nodes* nodes,int name,int type){_error_("not implemented yet");};
Index: /issm/trunk/src/c/classes/Constraints/SpcStatic.cpp
===================================================================
--- /issm/trunk/src/c/classes/Constraints/SpcStatic.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Constraints/SpcStatic.cpp	(revision 24313)
@@ -109,9 +109,4 @@
 }
 /*}}}*/
-bool SpcStatic::InAnalysis(int in_analysis_type){/*{{{*/
-	if (in_analysis_type==this->analysis_type) return true;
-	else return false;
-}
-/*}}}*/
 void SpcStatic::InputUpdateFromVectorDakota(IssmDouble* vector,Nodes* nodes,int name,int type){/*{{{*/
 
@@ -119,5 +114,5 @@
 	if(name != BalancethicknessSpcthicknessEnum) return;
 
-	/*Chase through nodes and find the node to which this SpcStatic applys: */
+	/*Chase through nodes and find the node to which this SpcStatic applies: */
 	Node* node=(Node*)nodes->GetObjectById(NULL,nodeid);
 
Index: /issm/trunk/src/c/classes/Constraints/SpcStatic.h
===================================================================
--- /issm/trunk/src/c/classes/Constraints/SpcStatic.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Constraints/SpcStatic.h	(revision 24313)
@@ -39,5 +39,4 @@
 		void ActivatePenaltyMethod(void);
 		void ConstrainNode(Nodes* nodes,Parameters* parameters);
-		bool InAnalysis(int analysis_type);
 		void PenaltyDofAndValue(int* dof,IssmDouble* value,Nodes* nodes,Parameters* parameters){_error_("not implemented yet");};
 		void InputUpdateFromVectorDakota(IssmDouble* vector,Nodes* nodes,int name,int type);
Index: /issm/trunk/src/c/classes/Constraints/SpcTransient.cpp
===================================================================
--- /issm/trunk/src/c/classes/Constraints/SpcTransient.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Constraints/SpcTransient.cpp	(revision 24313)
@@ -159,10 +159,4 @@
 }
 /*}}}*/
-bool SpcTransient::InAnalysis(int in_analysis_type){/*{{{*/
-
-	if (in_analysis_type==this->analysis_type) return true;
-	else return false;
-}
-/*}}}*/
 void SpcTransient::PenaltyDofAndValue(int* pdof,IssmDouble* pvalue,Nodes* nodes,Parameters* parameters){/*{{{*/
 
Index: /issm/trunk/src/c/classes/Constraints/SpcTransient.h
===================================================================
--- /issm/trunk/src/c/classes/Constraints/SpcTransient.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Constraints/SpcTransient.h	(revision 24313)
@@ -41,5 +41,4 @@
 		void   ActivatePenaltyMethod(void);
 		void   ConstrainNode(Nodes* nodes,Parameters* parameters);
-		bool   InAnalysis(int analysis_type);
 		void   PenaltyDofAndValue(int* dof,IssmDouble* value,Nodes* nodes,Parameters* parameters);
 		void InputUpdateFromVectorDakota(IssmDouble* vector,Nodes* nodes,int name,int type){_error_("not implemented yet");};
Index: /issm/trunk/src/c/classes/Contours.h
===================================================================
--- /issm/trunk/src/c/classes/Contours.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Contours.h	(revision 24313)
@@ -22,11 +22,8 @@
 
 	/*intermediary: */
-	int                  nprof;
-	int                 *profnvertices = NULL;
-	doubletype         **pprofx        = NULL;
-	doubletype         **pprofy        = NULL;
-
-	/*output: */
-	Contours *domain = NULL;
+	int          nprof;
+	int         *profnvertices = NULL;
+	doubletype **pprofx        = NULL;
+	doubletype **pprofy        = NULL;
 
 	/*If domainname is an empty string, return empty dataset*/
@@ -35,9 +32,9 @@
 	}
 	else{
-		ExpRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname);
+		ExpRead<doubletype>(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname);
 	}
 
 	/*now create dataset of contours: */
-	domain=new Contours();
+	Contours *domain=new Contours();
 
 	for(int i=0;i<nprof;i++){
Index: sm/trunk/src/c/classes/DofIndexing.cpp
===================================================================
--- /issm/trunk/src/c/classes/DofIndexing.cpp	(revision 24312)
+++ 	(revision )
@@ -1,322 +1,0 @@
-/*!\file DofIndexing.c
- * \brief: implementation of the DofIndexing object
- */
-
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include <string.h>
-
-#include "./DofIndexing.h"
-#include "../shared/Numerics/types.h"
-#include "../shared/Numerics/constants.h"
-#include "../shared/io/Print/Print.h"
-#include "../shared/io/Marshalling/Marshalling.h"
-#include "../shared/Exceptions/exceptions.h"
-#include "../shared/MemOps/MemOps.h"
-#include "../shared/Enum/Enum.h"
-
-/*DofIndexing constructors and destructor*/
-DofIndexing::DofIndexing(){/*{{{*/
-
-	this->gsize    = UNDEF;
-	this->fsize    = UNDEF;
-	this->ssize    = UNDEF;
-	this->clone    = false;
-	this->active   = true;
-	this->freeze   = false;
-	this->f_set    = NULL;
-	this->s_set    = NULL;
-	this->svalues  = NULL;
-	this->doftype  = NULL;
-	this->gdoflist = NULL;
-	this->fdoflist = NULL;
-	this->sdoflist = NULL;
-
-}
-/*}}}*/
-DofIndexing::DofIndexing(int in_gsize){/*{{{*/
-
-	this->Init(in_gsize,NULL);
-
-}
-/*}}}*/
-DofIndexing::DofIndexing(DofIndexing* in){ //copy constructor/*{{{*/
-
-	this->gsize  = in->gsize;
-	this->fsize  = in->fsize;
-	this->ssize  = in->ssize;
-	this->clone  = in->clone;
-	this->active = in->active;
-	this->freeze = in->freeze;
-
-	if(this->gsize>0){
-		this->f_set=xNew<bool>(this->gsize);
-		this->s_set=xNew<bool>(this->gsize);
-		this->svalues=xNew<IssmDouble>(this->gsize);
-		if(in->doftype){
-			this->doftype=xNew<int>(this->gsize); 
-		}
-		else{
-			this->doftype=NULL;
-		}
-		this->gdoflist=xNew<int>(this->gsize); 
-	}
-	else{
-		this->f_set    = NULL;
-		this->s_set    = NULL;
-		this->svalues  = NULL;
-		this->doftype  = NULL;
-		this->gdoflist = NULL;
-	}
-	if(this->fsize>0)this->fdoflist=xNew<int>(this->fsize); else this->fdoflist=NULL;
-	if(this->ssize>0)this->sdoflist=xNew<int>(this->ssize); else this->sdoflist=NULL;
-
-	if(this->gsize>0){
-		memcpy(this->f_set,in->f_set,this->gsize*sizeof(bool));
-		memcpy(this->s_set,in->s_set,this->gsize*sizeof(bool));
-		xMemCpy<IssmDouble>(this->svalues,in->svalues,this->gsize);
-		if(this->doftype)memcpy(this->doftype,in->doftype,this->gsize*sizeof(int));
-		memcpy(this->gdoflist,in->gdoflist,this->gsize*sizeof(int));
-	}
-	if(this->fsize>0)memcpy(this->fdoflist,in->fdoflist,this->fsize*sizeof(int));
-	if(this->ssize>0)memcpy(this->sdoflist,in->sdoflist,this->ssize*sizeof(int));
-
-}
-/*}}}*/
-DofIndexing::~DofIndexing(){ //destructor/*{{{*/
-
-	if(this->f_set) xDelete<bool>(f_set); 
-	if(this->s_set) xDelete<bool>(s_set); 
-	if(this->svalues) xDelete<IssmDouble>(svalues);
-	if(this->doftype) xDelete<int>(doftype); 
-	if(this->gdoflist) xDelete<int>(gdoflist);
-	if(this->fdoflist) xDelete<int>(fdoflist);
-	if(this->sdoflist) xDelete<int>(sdoflist);
-
-}
-/*}}}*/
-DofIndexing DofIndexing::operator=( const DofIndexing& in ){/*{{{*/
-
-	this->copy(in);
-
-	return this;
-}
-/*}}}*/
-void DofIndexing::copy(const DofIndexing& in ){/*{{{*/
-
-	this->gsize  = in.gsize;
-	this->fsize  = in.fsize;
-	this->ssize  = in.ssize;
-	this->clone  = in.clone;
-	this->active = in.active;
-	this->freeze = in.freeze;
-
-	if(this->gsize>0){
-		this->f_set=xNew<bool>(this->gsize);
-		this->s_set=xNew<bool>(this->gsize);
-		this->svalues=xNew<IssmDouble>(this->gsize);
-		if(in.doftype){
-			this->doftype=xNew<int>(this->gsize);
-		}
-		else{
-			this->doftype=NULL;
-		}
-		this->gdoflist=xNew<int>(this->gsize);
-	}
-	else{
-		this->f_set    = NULL;
-		this->s_set    = NULL;
-		this->svalues  = NULL;
-		this->doftype  = NULL;
-		this->gdoflist = NULL;
-	}
-	if(this->fsize>0)this->fdoflist=xNew<int>(this->fsize); else this->fdoflist=NULL;
-	if(this->ssize>0)this->sdoflist=xNew<int>(this->ssize); else this->sdoflist=NULL;
-
-	if(this->gsize>0){
-		memcpy(this->f_set,in.f_set,this->gsize*sizeof(bool));
-		memcpy(this->s_set,in.s_set,this->gsize*sizeof(bool));
-		xMemCpy<IssmDouble>(this->svalues,in.svalues,this->gsize);
-		if(this->doftype)memcpy(this->doftype,in.doftype,this->gsize*sizeof(int));
-		memcpy(this->gdoflist,in.gdoflist,this->gsize*sizeof(int));
-	}
-	if(this->fsize>0)memcpy(this->fdoflist,in.fdoflist,this->fsize*sizeof(int));
-	if(this->ssize>0)memcpy(this->sdoflist,in.sdoflist,this->ssize*sizeof(int));
-
-	return;
-}
-/*}}}*/
-void DofIndexing::Init(int in_gsize,int* in_doftype){/*{{{*/
-
-	this->gsize = in_gsize;
-
-	/*At this point, assume this is not a clone (will be dealt with later)*/
-	this->clone = false;
-
-	/*memory allocation */
-	if(this->gsize>0){
-		this->f_set    = xNew<bool>((unsigned int)in_gsize);
-		this->s_set    = xNew<bool>((unsigned int)in_gsize);
-		this->svalues  = xNew<IssmDouble>((unsigned int)in_gsize);
-		this->gdoflist = xNew<int>((unsigned int)in_gsize);
-
-		if(in_doftype) this->doftype = xNew<int>((unsigned int)in_gsize);
-		else this->doftype = NULL;
-	}
-
-	/*Assign values assuming no Dirichlet at this point*/
-	for(int i=0;i<this->gsize;i++){
-		this->f_set[i]    = true;
-		this->s_set[i]    = false;
-		this->svalues[i]  = 0.;      //0 constraint is the default value
-		this->gdoflist[i] = UNDEF;
-
-		if(this->doftype) this->doftype[i]=in_doftype[i];
-	}
-}
-/*}}}*/
-void DofIndexing::InitSet(int setenum){/*{{{*/
-
-	int i;
-	int size=0;
-
-	/*go through sets, and figure out how many dofs belong to this set, except for g-set, 
-	 * which has already been initialized: */
-	if(setenum==FsetEnum){
-		size=0;
-		for(i=0;i<this->gsize;i++) if(f_set[i])size++;
-		this->fsize=size;
-		xDelete<int>(this->fdoflist);
-
-		if(this->fsize)
-		 this->fdoflist=xNew<int>(size);
-		else
-		 this->fdoflist=NULL;
-	}
-	else if(setenum==SsetEnum){
-		size=0;
-		for(i=0;i<this->gsize;i++) if(s_set[i])size++;
-		this->ssize=size;
-		xDelete<int>(this->sdoflist);
-
-		if(this->ssize)
-		 this->sdoflist=xNew<int>(size);
-		else
-		 this->sdoflist=NULL;
-	}
-	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
-}
-/*}}}*/
-
-/*Some of the Object functionality: */
-void DofIndexing::Activate(void){/*{{{*/
-
-	this->active = true;
-
-	/*Constrain to 0. at this point*/
-	for(int i=0;i<this->gsize;i++){
-		this->f_set[i]    = true;
-		this->s_set[i]    = false;
-		this->svalues[i]  = 0.; 
-	}
-	return;
-}
-/*}}}*/
-void DofIndexing::Deactivate(void){/*{{{*/
-	this->active = false;
-
-	/*Constrain to 0. at this point*/
-	for(int i=0;i<this->gsize;i++){
-		this->f_set[i]    = false;
-		this->s_set[i]    = true;
-		this->svalues[i]  = 0.; 
-	}
-	return;
-}
-/*}}}*/
-void DofIndexing::DeepEcho(void){/*{{{*/
-
-	int i;
-
-	_printf_("DofIndexing:\n");
-	_printf_("   gsize:  " << gsize << "\n");
-	_printf_("   fsize:  " << fsize << "\n");
-	_printf_("   ssize:  " << ssize << "\n");
-	_printf_("   clone:  " << clone << "\n");
-	_printf_("   active: " << active << "\n");
-	_printf_("   freeze: " << freeze << "\n");
-
-	_printf_("   f_set = [ ");
-	for(i=0;i<gsize;i++) _printf_((f_set[i]?1:0)<< " ");
-	_printf_("]\n");
-	_printf_("   s_set = [ ");
-	for(i=0;i<gsize;i++) _printf_((s_set[i]?1:0)<< " ");
-	_printf_("]\n");
-
-	_printf_("   svalues (" << this->ssize << "): |");
-	for(i=0;i<this->gsize;i++){
-		if(this->s_set[i])_printf_(" " << svalues[i] << " |");
-	}
-	_printf_("\n");
-
-	if(doftype){
-		_printf_("   doftype: |");
-		for(i=0;i<gsize;i++){
-			_printf_(" " << doftype[i] << " |");
-		}
-		_printf_("\n");
-	}
-	else _printf_("   doftype: NULL\n");
-
-	_printf_("   g_doflist (" << this->gsize << "): |");
-	for(i=0;i<this->gsize;i++){
-		_printf_(" " << gdoflist[i] << " |");
-	}
-	_printf_("\n");
-
-	_printf_("   f_doflist (" << this->fsize << "): |");
-	for(i=0;i<this->fsize;i++){
-		_printf_(" " << fdoflist[i] << " |");
-	}
-	_printf_("\n");
-
-	_printf_("   s_doflist (" << this->ssize << "): |");
-	for(i=0;i<this->ssize;i++){
-		_printf_(" " << sdoflist[i] << " |");
-	}
-	_printf_("\n");
-}		
-/*}}}*/
-void DofIndexing::Echo(void){/*{{{*/
-
-	_printf_("DofIndexing:\n");
-	_printf_("   gsize:  " << gsize << "\n");
-	_printf_("   fsize:  " << fsize << "\n");
-	_printf_("   ssize:  " << ssize << "\n");
-	_printf_("   clone:  " << clone << "\n");
-	_printf_("   active: " << active << "\n");
-	_printf_("   freeze: " << freeze << "\n");
-}
-/*}}}*/
-void DofIndexing::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
-
-	MARSHALLING(gsize);
-	MARSHALLING(fsize);
-	MARSHALLING(ssize);
-	MARSHALLING(clone);
-	MARSHALLING(active);
-	MARSHALLING(freeze);
-	MARSHALLING_DYNAMIC(f_set,bool,gsize);
-	MARSHALLING_DYNAMIC(s_set,bool,gsize);
-	MARSHALLING_DYNAMIC(svalues,IssmDouble,gsize);
-	MARSHALLING_DYNAMIC(doftype,int,gsize);
-	MARSHALLING_DYNAMIC(gdoflist,int,gsize);
-	MARSHALLING_DYNAMIC(fdoflist,int,fsize);
-	MARSHALLING_DYNAMIC(sdoflist,int,ssize);
-
-}
-/*}}}*/
Index: sm/trunk/src/c/classes/DofIndexing.h
===================================================================
--- /issm/trunk/src/c/classes/DofIndexing.h	(revision 24312)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/*!\file: DofIndexing.h
- * \brief prototype for DofIndexing.h
- */ 
-
-#ifndef _DOFINDEXING_H_
-#define _DOFINDEXING_H_
-
-#include "../shared/Numerics/types.h"
-
-class DofIndexing{
-
-	public:
-
-		/*sizes: */
-		int gsize;   //number of dofs for a node
-		int fsize;   //number of dofs solver for
-		int ssize;   //number of constrained dofs
-
-		/*partitioning: */
-		bool clone;  //this node is replicated from another one
-		bool active; //Is this node active or inactive (all dofs are constrained)
-		bool freeze; //this is required for 2d solutions, we never activate nodes that are not on base
-
-		/*boundary conditions sets: */
-		bool       *f_set;     //is dof on f-set (on which we solve)
-		bool       *s_set;     //is dof on s-set (on which boundary conditions -dirichlet- are applied)
-		IssmDouble *svalues;   //list of constraint values. size g_size, for ease of use.
-
-		/*types of dofs: */
-		int        *doftype;   //approximation type of the dofs (used only for coupling), size g_size
-
-		/*list of degrees of freedom: */
-		int *gdoflist;   //dof list in g_set
-		int *fdoflist;   //dof list in f_set
-		int *sdoflist;   //dof list in s_set
-
-		/*DofIndexing constructors, destructors {{{*/
-		DofIndexing();
-		DofIndexing(int g_size);
-		void Init(int g_size,int* doftype);
-		void InitSet(int setenum);
-		DofIndexing(DofIndexing* properties);
-		~DofIndexing();
-		DofIndexing operator=(const DofIndexing& in);
-		/*}}}*/
-		/*Object like functionality: {{{*/
-		void  copy(const DofIndexing& in);
-		void  DeepEcho(void); 
-		void  Echo(void); 
-		void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
-		/*}}}*/
-		/*DofIndexing management: {{{*/
-		void Activate(void);
-		void Deactivate(void);
-		DofIndexing* Spawn(int* indices, int numindices);
-		/*}}}*/
-
-};
-#endif //ifndef _DOFINDEXING_H_
Index: /issm/trunk/src/c/classes/Elements/Element.cpp
===================================================================
--- /issm/trunk/src/c/classes/Elements/Element.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Elements/Element.cpp	(revision 24313)
@@ -17,4 +17,11 @@
 /*}}}*/
 
+#ifdef _HAVE_SEMIC_
+/* SEMIC prototype {{{*/
+extern "C" void run_semic_(double *sf_in, double *rf_in, double *swd_in, double *lwd_in, double *wind_in, double *sp_in, double *rhoa_in,
+			double *qq_in, double *tt_in, double *tsurf_out, double *smb_out, double *saccu_out, double *smelt_out);
+#endif
+// _HAVE_SEMIC_
+/*}}}*/
 /*Constructors/destructor/copy*/
 Element::Element(){/*{{{*/
@@ -25,5 +32,4 @@
 	this->vertices   = NULL;
 	this->material   = NULL;
-	this->matpar     = NULL;
 	this->parameters = NULL;
 	this->element_type_list=NULL;
@@ -60,10 +66,11 @@
 
 	/*Allocate arrays*/
-	int numvertices = this->GetNumberOfVertices();
-	IssmDouble* lambdas = xNew<IssmDouble>(numvertices);
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+
+	IssmDouble* lambdas = xNew<IssmDouble>(NUM_VERTICES);
 
 	/* Start looping on the number of vertices: */
 	Gauss* gauss=this->NewGauss();
-	for (int iv=0;iv<numvertices;iv++){
+	for (int iv=0;iv<NUM_VERTICES;iv++){
 		gauss->GaussVertex(iv);
 
@@ -154,21 +161,21 @@
 
 	/* Fetch number of nodes and allocate output*/
-   int numnodes = this->GetNumberOfNodes();
-   IssmDouble* newD = xNew<IssmDouble>(numnodes);
+	int numnodes = this->GetNumberOfNodes();
+	IssmDouble* newD = xNew<IssmDouble>(numnodes);
 
 	/* Retrieve domain-dependent inputs */
 	Input* n_input=this->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
-   Input* damage_input = NULL;
-   Input* B_input = NULL;
+	Input* damage_input = NULL;
+	Input* B_input = NULL;
 	int domaintype;
-   parameters->FindParam(&domaintype,DomainTypeEnum);
+	parameters->FindParam(&domaintype,DomainTypeEnum);
 	if(domaintype==Domain2DhorizontalEnum){
-      damage_input = this->GetInput(DamageDbarEnum);  _assert_(damage_input);
-      B_input=this->GetInput(MaterialsRheologyBbarEnum); _assert_(B_input);
-   }
-   else{
-      damage_input = this->GetInput(DamageDEnum);   _assert_(damage_input);
-      B_input=this->GetInput(MaterialsRheologyBEnum); _assert_(B_input);
-   }
+		damage_input = this->GetInput(DamageDbarEnum);  _assert_(damage_input);
+		B_input=this->GetInput(MaterialsRheologyBbarEnum); _assert_(B_input);
+	}
+	else{
+		damage_input = this->GetInput(DamageDEnum);   _assert_(damage_input);
+		B_input=this->GetInput(MaterialsRheologyBEnum); _assert_(B_input);
+	}
 
 	/* Start looping on the number of nodes: */
@@ -191,6 +198,6 @@
 
 		B_input->GetInputValue(&B,gauss);
-      n_input->GetInputValue(&n,gauss);
-      damage_input->GetInputValue(&D,gauss);
+		n_input->GetInputValue(&n,gauss);
+		damage_input->GetInputValue(&D,gauss);
 
 		/* Compute threshold strain rate from threshold stress */
@@ -239,16 +246,17 @@
 
 	/*Allocate arrays*/
-	int numvertices = this->GetNumberOfVertices();
-	IssmDouble* eps_xx = xNew<IssmDouble>(numvertices);
-	IssmDouble* eps_yy = xNew<IssmDouble>(numvertices);
-	IssmDouble* eps_zz = xNew<IssmDouble>(numvertices);
-	IssmDouble* eps_xy = xNew<IssmDouble>(numvertices);
-	IssmDouble* eps_xz = xNew<IssmDouble>(numvertices);
-	IssmDouble* eps_yz = xNew<IssmDouble>(numvertices);
-	IssmDouble* eps_ef = xNew<IssmDouble>(numvertices);
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+
+	IssmDouble* eps_xx = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* eps_yy = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* eps_zz = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* eps_xy = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* eps_xz = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* eps_yz = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* eps_ef = xNew<IssmDouble>(NUM_VERTICES);
 
 	/* Start looping on the number of vertices: */
 	Gauss* gauss=this->NewGauss();
-	for (int iv=0;iv<numvertices;iv++){
+	for (int iv=0;iv<NUM_VERTICES;iv++){
 		gauss->GaussVertex(iv);
 
@@ -260,5 +268,5 @@
 
 		if(dim==2){
-			 /* epsilon=[exx,eyy,exy];*/
+			/* epsilon=[exx,eyy,exy];*/
 			eps_xx[iv]=epsilon[0];
 			eps_yy[iv]=epsilon[1];
@@ -382,6 +390,6 @@
 	_printf_("   sid: "<<this->sid<<"\n");
 	if(vertices){
-		int numvertices = this->GetNumberOfVertices();
-		for(int i=0;i<numvertices;i++) vertices[i]->Echo();
+		const int NUM_VERTICES = this->GetNumberOfVertices();
+		for(int i=0;i<NUM_VERTICES;i++) vertices[i]->Echo();
 	}
 	else _printf_("vertices = NULL\n");
@@ -396,7 +404,4 @@
 	else _printf_("material = NULL\n");
 
-	if (matpar) matpar->DeepEcho();
-	else _printf_("matpar = NULL\n");
-
 	_printf_("   parameters\n");
 	if (parameters) parameters->DeepEcho();
@@ -424,13 +429,14 @@
 	if(!IsOnBase()) return;
 
-	int        numvertices = this->GetNumberOfVertices();
+	const int NUM_VERTICES 					= this->GetNumberOfVertices();
+	const int NUM_VERTICES_MONTHS_PER_YEAR	= NUM_VERTICES * 12;
 
 	int        i;
-	IssmDouble* monthlytemperatures=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* monthlyprec=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* TemperaturesPresentday=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* TemperaturesLgm=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* PrecipitationsPresentday=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* tmp=xNew<IssmDouble>(numvertices);
+	IssmDouble* monthlytemperatures=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* monthlyprec=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* TemperaturesPresentday=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* TemperaturesLgm=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* PrecipitationsPresentday=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* tmp=xNew<IssmDouble>(NUM_VERTICES);
 	IssmDouble Delta18oPresent,Delta18oLgm,Delta18oTime;
 	IssmDouble Delta18oSurfacePresent,Delta18oSurfaceLgm,Delta18oSurfaceTime;
@@ -450,5 +456,5 @@
 	Gauss* gauss=this->NewGauss();
 	for(int month=0;month<12;month++){
-		for(int iv=0;iv<numvertices;iv++){
+		for(int iv=0;iv<NUM_VERTICES;iv++){
 			gauss->GaussVertex(iv);
 			input->GetInputValue(&TemperaturesPresentday[iv*12+month],gauss,month/12.*yts);
@@ -469,5 +475,5 @@
 
 	/*Compute the temperature and precipitation*/
-	for(int iv=0;iv<numvertices;iv++){
+	for(int iv=0;iv<NUM_VERTICES;iv++){
 		ComputeDelta18oTemperaturePrecipitation(Delta18oSurfacePresent, Delta18oSurfaceLgm, Delta18oSurfaceTime,
 					Delta18oPresent, Delta18oLgm, Delta18oTime,
@@ -481,5 +487,5 @@
 	TransientInput* NewPrecipitationInput = new TransientInput(SmbPrecipitationEnum);
 	for (int imonth=0;imonth<12;imonth++) {
-		for(i=0;i<numvertices;i++) tmp[i]=monthlytemperatures[i*12+imonth];
+		for(i=0;i<NUM_VERTICES;i++) tmp[i]=monthlytemperatures[i*12+imonth];
 		switch(this->ObjectEnum()){
 			case TriaEnum:  NewTemperatureInput->AddTimeInput(new TriaInput(SmbMonthlytemperaturesEnum,&tmp[0],P1Enum),time_yr+imonth/12.*yts); break;
@@ -488,5 +494,5 @@
 			default: _error_("Not implemented yet");
 		}
-		for(i=0;i<numvertices;i++) tmp[i]=monthlyprec[i*12+imonth]/yts;
+		for(i=0;i<NUM_VERTICES;i++) tmp[i]=monthlyprec[i*12+imonth]/yts;
 		switch(this->ObjectEnum()){
 			case TriaEnum:  NewPrecipitationInput->AddTimeInput(new TriaInput(SmbPrecipitationEnum,&tmp[0],P1Enum),time_yr+imonth/12.*yts); break;
@@ -506,7 +512,7 @@
 		case PentaEnum:
 		case TetraEnum:
-							this->InputExtrude(SmbMonthlytemperaturesEnum,-1);
-							this->InputExtrude(SmbPrecipitationEnum,-1);
-							break;
+         this->InputExtrude(SmbMonthlytemperaturesEnum,-1);
+         this->InputExtrude(SmbPrecipitationEnum,-1);
+         break;
 		default: _error_("Not implemented yet");
 	}
@@ -527,14 +533,15 @@
 	if(!IsOnBase()) return;
 
-	int        numvertices = this->GetNumberOfVertices();
-
-	int        i;
-	IssmDouble* monthlytemperatures=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* monthlyprec=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* TemperaturesPresentday=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* PrecipitationsPresentday=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* TemperaturesReconstructed=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* PrecipitationsReconstructed=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* tmp=xNew<IssmDouble>(numvertices);
+	const int NUM_VERTICES 					= this->GetNumberOfVertices();
+	const int NUM_VERTICES_MONTHS_PER_YEAR	= NUM_VERTICES * 12;
+
+	int        	i;
+	IssmDouble* monthlytemperatures=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* monthlyprec=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* TemperaturesPresentday=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* PrecipitationsPresentday=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* TemperaturesReconstructed=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* PrecipitationsReconstructed=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* tmp=xNew<IssmDouble>(NUM_VERTICES);
 	IssmDouble Delta18oTime;
 	IssmDouble dpermil,f;
@@ -551,5 +558,5 @@
 
 	/*Get some pdd parameters*/
-	dpermil=this->matpar->GetMaterialParameter(SmbDpermilEnum);
+	dpermil=this->FindParam(SmbDpermilEnum);
 
 	this->parameters->FindParam(&isTemperatureScaled,SmbIstemperaturescaledEnum);
@@ -580,5 +587,5 @@
 	Gauss* gauss=this->NewGauss();
 	for(int month=0;month<12;month++) {
-		for(int iv=0;iv<numvertices;iv++) {
+		for(int iv=0;iv<NUM_VERTICES;iv++) {
 			gauss->GaussVertex(iv);
 			input->GetInputValue(&TemperaturesPresentday[iv*12+month],gauss,time_clim+month/12.*yts);
@@ -601,5 +608,5 @@
 
 	/*Compute the temperature and precipitation*/
-	for(int iv=0;iv<numvertices;iv++){
+	for(int iv=0;iv<NUM_VERTICES;iv++){
 		ComputeD18OTemperaturePrecipitationFromPD(Delta18oTime,dpermil,isTemperatureScaled,isPrecipScaled,
 					f,&PrecipitationsPresentday[iv*12], &TemperaturesPresentday[iv*12],
@@ -612,5 +619,5 @@
 	TransientInput* NewPrecipitationInput = new TransientInput(SmbPrecipitationEnum);
 	for (int imonth=0;imonth<12;imonth++) {
-		for(i=0;i<numvertices;i++) tmp[i]=monthlytemperatures[i*12+imonth];
+		for(i=0;i<NUM_VERTICES;i++) tmp[i]=monthlytemperatures[i*12+imonth];
 		switch(this->ObjectEnum()){
 			case TriaEnum:  NewTemperatureInput->AddTimeInput(new TriaInput(SmbMonthlytemperaturesEnum,&tmp[0],P1Enum),time_yr+imonth/12.*yts); break;
@@ -619,5 +626,5 @@
 			default: _error_("Not implemented yet");
 		}
-		for(i=0;i<numvertices;i++) tmp[i]=monthlyprec[i*12+imonth]/yts;
+		for(i=0;i<NUM_VERTICES;i++) tmp[i]=monthlyprec[i*12+imonth]/yts;
 		switch(this->ObjectEnum()){
 			case TriaEnum:  NewPrecipitationInput->AddTimeInput(new TriaInput(SmbPrecipitationEnum,&tmp[0],P1Enum),time_yr+imonth/12.*yts); break;
@@ -637,7 +644,7 @@
 		case PentaEnum:
 		case TetraEnum:
-							this->InputExtrude(SmbMonthlytemperaturesEnum,-1);
-							this->InputExtrude(SmbPrecipitationEnum,-1);
-							break;
+         this->InputExtrude(SmbMonthlytemperaturesEnum,-1);
+         this->InputExtrude(SmbPrecipitationEnum,-1);
+         break;
 		default: _error_("Not implemented yet");
 	}
@@ -659,5 +666,5 @@
 	/*Are we on the base? If not, return*/
 	if(!IsOnBase()) return;
-	int        numvertices = this->GetNumberOfVertices();
+	const int NUM_VERTICES = this->GetNumberOfVertices();
 
 	int        i;
@@ -666,17 +673,18 @@
 	IssmDouble accugrad, runoffgrad; //gradients from reference altitude
 	IssmDouble rho_water, rho_ice;
-	IssmDouble time;
-
-	IssmDouble*		smb		 = xNew<IssmDouble>(numvertices);
-	IssmDouble*		surf	 = xNew<IssmDouble>(numvertices);
-	IssmDouble*		accu	 = xNew<IssmDouble>(numvertices);
-	IssmDouble*		runoff = xNew<IssmDouble>(numvertices);
+	IssmDouble time,yts;
+
+	IssmDouble*		smb		= xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble*		surf	= xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble*		accu	= xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble*		runoff 	= xNew<IssmDouble>(NUM_VERTICES);
 
 	/*Get material parameters :*/
-	rho_water=this->matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	rho_ice=this->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_water=this->FindParam(MaterialsRhoSeawaterEnum);
+	rho_ice=this->FindParam(MaterialsRhoIceEnum);
 
 	/*Recover parameters*/
 	parameters->FindParam(&time,TimeEnum);
+	parameters->FindParam(&yts,ConstantsYtsEnum);
 	parameters->FindParam(&accualti,SmbAccualtiEnum);
 	parameters->FindParam(&accugrad,SmbAccugradEnum);
@@ -692,30 +700,29 @@
 
 	/*Compute the temperature and precipitation*/
-	for(int iv=0;iv<numvertices;iv++){
+	for(int iv=0;iv<NUM_VERTICES;iv++){
 		accu[iv]=max(0.,(accuref+(surf[iv]-accualti)*accugrad));
 		runoff[iv]=max(0.,(runoffref+(surf[iv]-runoffalti)*runoffgrad));
 		smb[iv]=(accu[iv]-runoff[iv])*rho_ice/rho_water;
 	}
+
 	switch(this->ObjectEnum()){
 	case TriaEnum:
-		this->inputs->AddInput(new TriaInput(SmbMassBalanceEnum,&smb[0],P1Enum));
-		this->inputs->AddInput(new TriaInput(SmbRunoffEnum,&runoff[0],P1Enum));
+		this->inputs->AddInput(new TriaInput(SmbMassBalanceSubstepEnum,&smb[0],P1Enum));
+		this->inputs->AddInput(new TriaInput(SmbRunoffSubstepEnum,&runoff[0],P1Enum));
 		break;
 	case PentaEnum:
-		this->inputs->AddInput(new PentaInput(SmbMassBalanceEnum,&smb[0],P1Enum));
-		this->inputs->AddInput(new PentaInput(SmbRunoffEnum,&runoff[0],P1Enum));
-		this->InputExtrude(SmbMassBalanceEnum,-1);
-		this->InputExtrude(SmbRunoffEnum,-1);
+		this->inputs->AddInput(new PentaInput(SmbMassBalanceSubstepEnum,&smb[0],P1Enum));
+		this->inputs->AddInput(new PentaInput(SmbRunoffSubstepEnum,&runoff[0],P1Enum));
+		this->InputExtrude(SmbMassBalanceSubstepEnum,-1);
+		this->InputExtrude(SmbRunoffSubstepEnum,-1);
 		break;
 	case TetraEnum:
-		this->inputs->AddInput(new TetraInput(SmbMassBalanceEnum,&smb[0],P1Enum));
-		this->inputs->AddInput(new TetraInput(SmbRunoffEnum,&runoff[0],P1Enum));
-		this->InputExtrude(SmbMassBalanceEnum,-1);
-		this->InputExtrude(SmbRunoffEnum,-1);
+		this->inputs->AddInput(new TetraInput(SmbMassBalanceSubstepEnum,&smb[0],P1Enum));
+		this->inputs->AddInput(new TetraInput(SmbRunoffSubstepEnum,&runoff[0],P1Enum));
+		this->InputExtrude(SmbMassBalanceSubstepEnum,-1);
+		this->InputExtrude(SmbRunoffSubstepEnum,-1);
 		break;
 	default: _error_("Not implemented yet");
 	}
-	/* this->AddInput(SmbMassBalanceEnum,smb,P1Enum); */
-	/* this->AddInput(SmbRunoffEnum,runoff,P1Enum); */
 	/*clean-up*/
 	xDelete<IssmDouble>(surf);
@@ -851,14 +858,14 @@
 	IssmDouble eps_eff;
 
-	 if(dim==2){
-		 /* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exx*eyy*/
-		 this->StrainRateSSA(&epsilon2d[0],xyz_list,gauss,vx_input,vy_input);
-		 eps_eff = sqrt(epsilon2d[0]*epsilon2d[0] + epsilon2d[1]*epsilon2d[1] + epsilon2d[2]*epsilon2d[2] + epsilon2d[0]*epsilon2d[1]);
-	 }
-	 else{
-		 /* eps_eff^2 = 1/2 exx^2*/
-		 this->StrainRateSSA1d(&epsilon1d,xyz_list,gauss,vx_input);
-		 eps_eff = sqrt(epsilon1d*epsilon1d/2.);
-	 }
+	if(dim==2){
+		/* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exx*eyy*/
+		this->StrainRateSSA(&epsilon2d[0],xyz_list,gauss,vx_input,vy_input);
+		eps_eff = sqrt(epsilon2d[0]*epsilon2d[0] + epsilon2d[1]*epsilon2d[1] + epsilon2d[2]*epsilon2d[2] + epsilon2d[0]*epsilon2d[1]);
+	}
+	else{
+		/* eps_eff^2 = 1/2 exx^2*/
+		this->StrainRateSSA1d(&epsilon1d,xyz_list,gauss,vx_input);
+		eps_eff = sqrt(epsilon1d*epsilon1d/2.);
+	}
 
 	/*Get viscosity*/
@@ -911,6 +918,6 @@
 	_printf_("   sid: "<<this->sid<<"\n");
 	if(vertices){
-		int numvertices = this->GetNumberOfVertices();
-		for(int i=0;i<numvertices;i++) vertices[i]->Echo();
+		const int NUM_VERTICES = this->GetNumberOfVertices();
+		for(int i=0;i<NUM_VERTICES;i++) vertices[i]->Echo();
 	}
 	else _printf_("vertices = NULL\n");
@@ -928,7 +935,4 @@
 	else _printf_("material = NULL\n");
 
-	if (matpar) matpar->Echo();
-	else _printf_("matpar = NULL\n");
-
 	_printf_("   parameters\n");
 	if (parameters) parameters->Echo();
@@ -940,13 +944,4 @@
 }
 /*}}}*/
-IssmDouble Element::EnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure){/*{{{*/
-	return matpar->GetEnthalpyDiffusionParameter(enthalpy,pressure);
-}/*}}}*/
-IssmDouble Element::EnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure){/*{{{*/
-	return matpar->GetEnthalpyDiffusionParameterVolume(numvertices,enthalpy,pressure);
-}/*}}}*/
-void       Element::EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure){/*{{{*/
-	matpar->EnthalpyToThermal(ptemperature,pwaterfraction,enthalpy,pressure);
-}/*}}}*/
 void       Element::FindParam(bool* pvalue,int paramenum){/*{{{*/
 	this->parameters->FindParam(pvalue,paramenum);
@@ -957,4 +952,7 @@
 void       Element::FindParam(IssmDouble* pvalue,int paramenum){/*{{{*/
 	this->parameters->FindParam(pvalue,paramenum);
+}/*}}}*/
+IssmDouble Element::FindParam(int paramenum){/*{{{*/
+	return this->parameters->FindParam(paramenum);
 }/*}}}*/
 void       Element::FindParam(int** pvalues,int* psize,int paramenum){/*{{{*/
@@ -997,4 +995,27 @@
 }
 /*}}}*/
+void       Element::GetDofListLocal(int** pdoflist,int approximation_enum,int setenum){/*{{{*/
+
+	/*Fetch number of nodes and dof for this finite element*/
+	int numnodes = this->GetNumberOfNodes();
+
+	/*First, figure out size of doflist and create it: */
+	int numberofdofs=0;
+	for(int i=0;i<numnodes;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
+
+	/*Allocate output*/
+	int* doflist=xNew<int>(numberofdofs);
+
+	/*Populate: */
+	int count=0;
+	for(int i=0;i<numnodes;i++){
+		nodes[i]->GetDofListLocal(doflist+count,approximation_enum,setenum);
+		count+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
+	}
+
+	/*Assign output pointers:*/
+	*pdoflist=doflist;
+}
+/*}}}*/
 void       Element::GetDofListPressure(int** pdoflist,int setenum){/*{{{*/
 
@@ -1037,4 +1058,51 @@
 	for(int i=0;i<numnodes;i++){
 		nodes[i]->GetDofList(doflist+count,FSvelocityEnum,setenum);
+		count+=nodes[i]->GetNumberOfDofs(FSvelocityEnum,setenum);
+	}
+
+	/*Assign output pointers:*/
+	*pdoflist=doflist;
+}
+/*}}}*/
+void       Element::GetDofListLocalPressure(int** pdoflist,int setenum){/*{{{*/
+
+	/*Fetch number of nodes and dof for this finite element*/
+	int vnumnodes = this->NumberofNodesVelocity();
+	int pnumnodes = this->NumberofNodesPressure();
+
+	/*First, figure out size of doflist and create it: */
+	int numberofdofs=0;
+	for(int i=vnumnodes;i<vnumnodes+pnumnodes;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(FSApproximationEnum,setenum);
+
+	/*Allocate output*/
+	int* doflist=xNew<int>(numberofdofs);
+
+	/*Populate: */
+	int count=0;
+	for(int i=vnumnodes;i<vnumnodes+pnumnodes;i++){
+		nodes[i]->GetDofListLocal(doflist+count,FSApproximationEnum,setenum);
+		count+=nodes[i]->GetNumberOfDofs(FSApproximationEnum,setenum);
+	}
+
+	/*Assign output pointers:*/
+	*pdoflist=doflist;
+}
+/*}}}*/
+void       Element::GetDofListLocalVelocity(int** pdoflist,int setenum){/*{{{*/
+
+	/*Fetch number of nodes and dof for this finite element*/
+	int numnodes = this->NumberofNodesVelocity();
+
+	/*First, figure out size of doflist and create it: */
+	int numberofdofs=0;
+	for(int i=0;i<numnodes;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(FSvelocityEnum,setenum);
+
+	/*Allocate output*/
+	int* doflist=xNew<int>(numberofdofs);
+
+	/*Populate: */
+	int count=0;
+	for(int i=0;i<numnodes;i++){
+		nodes[i]->GetDofListLocal(doflist+count,FSvelocityEnum,setenum);
 		count+=nodes[i]->GetNumberOfDofs(FSvelocityEnum,setenum);
 	}
@@ -1107,7 +1175,6 @@
 	Input* input=this->GetInput(enumtype);
 	if (!input) _error_("Input " << EnumToStringx(enumtype) << " not found in element");
-
 	/*Fetch number vertices for this element*/
-	int numvertices = this->GetNumberOfVertices();
+	const int NUM_VERTICES = this->GetNumberOfVertices();
 
 	/*Checks in debugging mode*/
@@ -1116,5 +1183,5 @@
 	/* Start looping on the number of vertices: */
 	Gauss*gauss=this->NewGauss();
-	for(int iv=0;iv<numvertices;iv++){
+	for(int iv=0;iv<NUM_VERTICES;iv++){
 		gauss->GaussVertex(iv);
 		input->GetInputValue(&pvalue[iv],gauss);
@@ -1132,5 +1199,5 @@
 
 	/*Fetch number vertices for this element*/
-	int numvertices = this->GetNumberOfVertices();
+	const int NUM_VERTICES = this->GetNumberOfVertices();
 
 	/*Checks in debugging mode*/
@@ -1139,5 +1206,5 @@
 	/* Start looping on the number of vertices: */
 	Gauss*gauss=this->NewGauss();
-	for(int iv=0;iv<numvertices;iv++){
+	for(int iv=0;iv<NUM_VERTICES;iv++){
 		gauss->GaussVertex(iv);
 		input->GetInputValue(&pvalue[iv],gauss,time);
@@ -1157,10 +1224,10 @@
 
 	/*Fetch number vertices for this element*/
-	int numvertices = this->GetNumberOfVertices();
+	const int NUM_VERTICES = this->GetNumberOfVertices();
 
 	/* Start looping on the number of vertices: */
 	if (input){
 		Gauss* gauss=this->NewGauss();
-		for (int iv=0;iv<numvertices;iv++){
+		for (int iv=0;iv<NUM_VERTICES;iv++){
 			gauss->GaussVertex(iv);
 			input->GetInputValue(&pvalue[iv],gauss);
@@ -1169,5 +1236,5 @@
 	}
 	else{
-		for(int iv=0;iv<numvertices;iv++) pvalue[iv]=defaultvalue;
+		for(int iv=0;iv<NUM_VERTICES;iv++) pvalue[iv]=defaultvalue;
 	}
 }
@@ -1250,18 +1317,21 @@
 
 }/*}}}*/
-IssmDouble Element::GetMaterialParameter(int enum_in){/*{{{*/
-
-	_assert_(this->matpar);
-	switch(enum_in){ // FIXME: change this to material
-		case MaterialsRheologyNEnum:
-			return this->material->GetN();
-		default:
-			return this->matpar->GetMaterialParameter(enum_in);
-	}
-}/*}}}*/
-int         Element::GetIntegerMaterialParameter(int enum_in){/*{{{*/
-
-	return this->matpar->GetIntegerMaterialParameter(enum_in);
-}/*}}}*/
+Node*      Element::GetNode(int nodeindex){/*{{{*/
+	_assert_(nodeindex>=0);
+	_assert_(nodeindex<this->GetNumberOfNodes(this->element_type));
+	return this->nodes[nodeindex];
+}/*}}}*/
+int        Element::GetNodeIndex(Node* node){/*{{{*/
+
+	_assert_(this->nodes);
+	int numnodes = this->GetNumberOfNodes(this->element_type);
+
+	for(int i=0;i<numnodes;i++){
+		if(node==nodes[i]) return i;
+	}
+	_error_("Node provided not found among element nodes");
+
+}
+/*}}}*/
 void       Element::GetNodesLidList(int* lidlist){/*{{{*/
 
@@ -1356,12 +1426,12 @@
 
 /* 	/\*Fetch number vertices for this element and allocate arrays*\/ */
-/* 	int numvertices = this->GetNumberOfVertices(); */
-/* 	int*        vertexpidlist = xNew<int>(numvertices); */
-/* 	IssmDouble* values        = xNew<IssmDouble>(numvertices); */
+/* 	const int NUM_VERTICES = this->GetNumberOfVertices(); */
+/* 	int*        vertexpidlist = xNew<int>(NUM_VERTICES); */
+/* 	IssmDouble* values        = xNew<IssmDouble>(NUM_VERTICES); */
 
 /* 	/\*Fill in values*\/ */
-/* 	this->GetVertexPidList(vertexpidlist); */
+/* 	this->GetVerticesPidList(vertexpidlist); */
 /* 	this->GetInputListOnVertices(values,input_enum); */
-/* 	vector->SetValues(numvertices,vertexpidlist,values,INS_VAL); */
+/* 	vector->SetValues(NUM_VERTICES,vertexpidlist,values,INS_VAL); */
 
 /* 	/\*Clean up*\/ */
@@ -1374,5 +1444,6 @@
 
 	/*Fetch number vertices for this element and allocate arrays*/
-	int         numvertices = this->GetNumberOfVertices();
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+
 	int         numnodes    = this->GetNumberOfNodes();
 	int*        doflist     = NULL;
@@ -1388,18 +1459,18 @@
 			break;
 		case VertexPIdEnum:
-			doflist = xNew<int>(numvertices);
-			values = xNew<IssmDouble>(numvertices);
+			doflist = xNew<int>(NUM_VERTICES);
+			values = xNew<IssmDouble>(NUM_VERTICES);
 			/*Fill in values*/
-			this->GetVertexPidList(doflist);
+			this->GetVerticesPidList(doflist);
 			this->GetInputListOnVertices(values,input_enum);
-			vector->SetValues(numvertices,doflist,values,INS_VAL);
+			vector->SetValues(NUM_VERTICES,doflist,values,INS_VAL);
 			break;
 		case VertexSIdEnum:
-			doflist = xNew<int>(numvertices);
-			values = xNew<IssmDouble>(numvertices);
+			doflist = xNew<int>(NUM_VERTICES);
+			values = xNew<IssmDouble>(NUM_VERTICES);
 			/*Fill in values*/
 			this->GetVerticesSidList(doflist);
 			this->GetInputListOnVertices(values,input_enum);
-			vector->SetValues(numvertices,doflist,values,INS_VAL);
+			vector->SetValues(NUM_VERTICES,doflist,values,INS_VAL);
 			break;
 		case NodesEnum:
@@ -1432,5 +1503,6 @@
 
 	/*Fetch number vertices for this element and allocate arrays*/
-	int         numvertices = this->GetNumberOfVertices();
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+
 	int         numnodes    = this->GetNumberOfNodes();
 	int*        doflist     = NULL;
@@ -1438,22 +1510,22 @@
 
 	switch(type){
-	case VertexPIdEnum:
-		doflist = xNew<int>(numvertices);
-		values = xNew<IssmDouble>(numvertices);
-		/*Fill in values*/
-		this->GetVertexPidList(doflist);
-		this->GetInputListOnVerticesAtTime(values,input_enum,time);
-		vector->SetValues(numvertices,doflist,values,INS_VAL);
-		break;
-	case VertexSIdEnum:
-		doflist = xNew<int>(numvertices);
-		values = xNew<IssmDouble>(numvertices);
-		/*Fill in values*/
-		this->GetVerticesSidList(doflist);
-		this->GetInputListOnVerticesAtTime(values,input_enum,time);
-		vector->SetValues(numvertices,doflist,values,INS_VAL);
-		break;
-	default:
-		_error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
+		case VertexPIdEnum:
+			doflist = xNew<int>(NUM_VERTICES);
+			values = xNew<IssmDouble>(NUM_VERTICES);
+			/*Fill in values*/
+			this->GetVerticesPidList(doflist);
+			this->GetInputListOnVerticesAtTime(values,input_enum,time);
+			vector->SetValues(NUM_VERTICES,doflist,values,INS_VAL);
+			break;
+		case VertexSIdEnum:
+			doflist = xNew<int>(NUM_VERTICES);
+			values = xNew<IssmDouble>(NUM_VERTICES);
+			/*Fill in values*/
+			this->GetVerticesSidList(doflist);
+			this->GetInputListOnVerticesAtTime(values,input_enum,time);
+			vector->SetValues(NUM_VERTICES,doflist,values,INS_VAL);
+			break;
+		default:
+			_error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
 	}
 
@@ -1464,8 +1536,15 @@
 }
 /*}}}*/
-void       Element::GetVertexPidList(int* pidlist){/*{{{*/
-
-	int numvertices = this->GetNumberOfVertices();
-	for(int i=0;i<numvertices;i++) pidlist[i]=vertices[i]->Pid();
+void       Element::GetVerticesLidList(int* lidlist){/*{{{*/
+
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+	for(int i=0;i<NUM_VERTICES;i++) lidlist[i]=vertices[i]->Lid();
+
+}
+/*}}}*/
+void       Element::GetVerticesPidList(int* pidlist){/*{{{*/
+
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+	for(int i=0;i<NUM_VERTICES;i++) pidlist[i]=vertices[i]->Pid();
 
 }
@@ -1473,13 +1552,14 @@
 void       Element::GetVerticesConnectivityList(int* connectivity){/*{{{*/
 
-	int numvertices = this->GetNumberOfVertices();
-	for(int i=0;i<numvertices;i++) connectivity[i]=this->vertices[i]->Connectivity();
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+	for(int i=0;i<NUM_VERTICES;i++) connectivity[i]=this->vertices[i]->Connectivity();
 }
 /*}}}*/
 void       Element::GetVerticesCoordinates(IssmDouble** pxyz_list){/*{{{*/
 
-	int         numvertices = this->GetNumberOfVertices();
-	IssmDouble* xyz_list    = xNew<IssmDouble>(numvertices*3);
-	::GetVerticesCoordinates(xyz_list,this->vertices,numvertices);
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+
+	IssmDouble* xyz_list    = xNew<IssmDouble>(NUM_VERTICES*3);
+	::GetVerticesCoordinates(xyz_list,this->vertices,NUM_VERTICES);
 
 	*pxyz_list = xyz_list;
@@ -1488,6 +1568,6 @@
 void       Element::GetVerticesSidList(int* sidlist){/*{{{*/
 
-	int numvertices = this->GetNumberOfVertices();
-	for(int i=0;i<numvertices;i++) sidlist[i]=this->vertices[i]->Sid();
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+	for(int i=0;i<NUM_VERTICES;i++) sidlist[i]=this->vertices[i]->Sid();
 }
 /*}}}*/
@@ -1498,8 +1578,9 @@
 
 	/*Create list of x*/
-	int         numvertices = this->GetNumberOfVertices();
-	IssmDouble* x_list      = xNew<IssmDouble>(numvertices);
-
-	for(int i=0;i<numvertices;i++) x_list[i]=xyz_list[i*3+0];
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+
+	IssmDouble* x_list = xNew<IssmDouble>(NUM_VERTICES);
+
+	for(int i=0;i<NUM_VERTICES;i++) x_list[i]=xyz_list[i*3+0];
 	ValueP1OnGauss(&x,x_list,gauss);
 
@@ -1513,8 +1594,9 @@
 
 	/*Create list of y*/
-	int         numvertices = this->GetNumberOfVertices();
-	IssmDouble* y_list      = xNew<IssmDouble>(numvertices);
-
-	for(int i=0;i<numvertices;i++) y_list[i]=xyz_list[i*3+1];
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+
+	IssmDouble* y_list      = xNew<IssmDouble>(NUM_VERTICES);
+
+	for(int i=0;i<NUM_VERTICES;i++) y_list[i]=xyz_list[i*3+1];
 	ValueP1OnGauss(&y,y_list,gauss);
 
@@ -1528,8 +1610,9 @@
 
 	/*Create list of z*/
-	int         numvertices = this->GetNumberOfVertices();
-	IssmDouble* z_list      = xNew<IssmDouble>(numvertices);
-
-	for(int i=0;i<numvertices;i++) z_list[i]=xyz_list[i*3+2];
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+
+	IssmDouble* z_list      = xNew<IssmDouble>(NUM_VERTICES);
+
+	for(int i=0;i<NUM_VERTICES;i++) z_list[i]=xyz_list[i*3+2];
 	ValueP1OnGauss(&z,z_list,gauss);
 
@@ -1546,5 +1629,5 @@
 
 	/*Get number of vertices*/
-	int numvertices = this->GetNumberOfVertices();
+	const int NUM_VERTICES = this->GetNumberOfVertices();
 	if(isautodiff){
 		int* N=NULL;
@@ -1560,6 +1643,6 @@
 
 		for(int n=0;n<N[control_index];n++){
-			for(int i=0;i<numvertices;i++){
-				indexing[i+n*numvertices]=this->vertices[i]->Sid() + start + n*M[control_index];
+			for(int i=0;i<NUM_VERTICES;i++){
+				indexing[i+n*NUM_VERTICES]=this->vertices[i]->Sid() + start + n*M[control_index];
 			}
 		}
@@ -1569,5 +1652,5 @@
 		parameters->FindParam(&M,ControlInputSizeMEnum);
 		/*get gradient indices*/
-		for(int i=0;i<numvertices;i++){
+		for(int i=0;i<NUM_VERTICES;i++){
 			indexing[i]=this->vertices[i]->Sid() + (control_index)*M;
 		}
@@ -1601,5 +1684,5 @@
 
 	/*recover ice density: */
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 
 	return rho_ice*this->IceVolume(scaled);
@@ -1657,118 +1740,119 @@
 void       Element::InputCreate(IssmDouble* vector,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code){/*{{{*/
 
-    /*Intermediaries*/
-    int i,t;
-
-    /*Branch on type of vector: nodal or elementary: */
-    if(vector_type==1){ //nodal vector
-
-        int         numvertices = this->GetNumberOfVertices();
-        int        *vertexids   = xNew<int>(numvertices);
-        IssmDouble *values      = xNew<IssmDouble>(numvertices);
-
-        /*Recover vertices ids needed to initialize inputs*/
-        _assert_(iomodel->elements);
-        for(i=0;i<numvertices;i++){
-            vertexids[i]=reCast<int>(iomodel->elements[numvertices*this->Sid()+i]); //ids for vertices are in the elements array from Matlab
-        }
-
-        /*Are we in transient or static? */
-		  if(M==1){
-			  values[0]=vector[0];
-			  this->AddInput(vector_enum,values,P0Enum);
-		  }
-		  else if(M==iomodel->numberofvertices){
-            for(i=0;i<numvertices;i++) values[i]=vector[vertexids[i]-1];
-            this->AddInput(vector_enum,values,P1Enum);
-        }
-        else if(M==iomodel->numberofvertices+1){
-            /*create transient input: */
-            IssmDouble* times = xNew<IssmDouble>(N);
-            for(t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
-            TransientInput* transientinput=new TransientInput(vector_enum,times,N);
-            for(t=0;t<N;t++){
-                for(i=0;i<numvertices;i++) values[i]=vector[N*(vertexids[i]-1)+t];
-                switch(this->ObjectEnum()){
-                    case TriaEnum:  transientinput->AddTimeInput(new TriaInput( vector_enum,values,P1Enum)); break;
-                    case PentaEnum: transientinput->AddTimeInput(new PentaInput(vector_enum,values,P1Enum)); break;
-                    case TetraEnum: transientinput->AddTimeInput(new TetraInput(vector_enum,values,P1Enum)); break;
-                    default: _error_("Not implemented yet");
-                }
-            }
-            this->inputs->AddInput(transientinput);
-            xDelete<IssmDouble>(times);
-        }
-        else if(M==iomodel->numberofelements){
-
-			  /*This is a Patch!*/
-			  xDelete<IssmDouble>(values);
-			  values = xNew<IssmDouble>(N);
-			  for(int j=0;j<N;j++) values[j]=vector[this->Sid()*N+j];
-
-			  if     (N==this->GetNumberOfNodes(P1Enum)   ) this->AddInput(vector_enum,values,P1Enum);
-			  else if(N==this->GetNumberOfNodes(P0Enum)   ) this->AddInput(vector_enum,values,P0Enum);
-			  else if(N==this->GetNumberOfNodes(P1xP2Enum)) this->AddInput(vector_enum,values,P1xP2Enum);
-			  else if(N==this->GetNumberOfNodes(P1xP3Enum)) this->AddInput(vector_enum,values,P1xP3Enum);
-			  else _error_("Patch interpolation not supported yet");
-
-		  }
-		  else{
-			  _error_("nodal vector is either numberofvertices or numberofvertices+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
-		  }
-
-        xDelete<IssmDouble>(values);
-        xDelete<int>(vertexids);
-    }
-    else if(vector_type==2){ //element vector
-
-        IssmDouble value;
-
-        /*Are we in transient or static? */
-        if(M==iomodel->numberofelements){
-            if (code==5){ //boolean
-                this->inputs->AddInput(new BoolInput(vector_enum,reCast<bool>(vector[this->Sid()])));
-            }
-            else if (code==6){ //integer
-                this->inputs->AddInput(new IntInput(vector_enum,reCast<int>(vector[this->Sid()])));
-            }
-            else if (code==7){ //IssmDouble
-                this->inputs->AddInput(new DoubleInput(vector_enum,vector[this->Sid()]));
-            }
-            else _error_("could not recognize nature of vector from code " << code);
-        }
-        else if(M==iomodel->numberofelements+1){
-            /*create transient input: */
-            IssmDouble* times = xNew<IssmDouble>(N);
-            for(t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
-            TransientInput* transientinput=new TransientInput(vector_enum,times,N);
-            TriaInput* bof=NULL;
-            for(t=0;t<N;t++){
-                value=vector[N*this->Sid()+t];
-                switch(this->ObjectEnum()){
-                    case TriaEnum:  transientinput->AddTimeInput(new TriaInput( vector_enum,&value,P0Enum)); break;
-                    case PentaEnum: transientinput->AddTimeInput(new PentaInput(vector_enum,&value,P0Enum)); break;
-                    case TetraEnum: transientinput->AddTimeInput(new TetraInput(vector_enum,&value,P0Enum)); break;
-                    default: _error_("Not implemented yet");
-                }
-            }
-            this->inputs->AddInput(transientinput);
-            xDelete<IssmDouble>(times);
-        }
-        else _error_("element vector is either numberofelements or numberofelements+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
-    }
-    else if(vector_type==3){ //element vector
-
-        /*For right now we are static */
-        if(M==iomodel->numberofelements){
-            /*create transient input: */
-            IssmDouble* layers = xNewZeroInit<IssmDouble>(N);;
-            for(t=0;t<N;t++) layers[t] = vector[N*this->Sid()+t];
-            DoubleArrayInput* arrayinput=new DoubleArrayInput(vector_enum,layers,N);
-            this->inputs->AddInput(arrayinput);
-            xDelete<IssmDouble>(layers);
-        }
-        else _error_("element vector is either numberofelements or numberofelements+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
-    }
-    else _error_("Cannot add input for vector type " << vector_type << " (not supported)");
+	/*Intermediaries*/
+	int i,t;
+
+	/*Branch on type of vector: nodal or elementary: */
+	if(vector_type==1){ //nodal vector
+
+		const int NUM_VERTICES = this->GetNumberOfVertices();
+
+		int        *vertexids   = xNew<int>(NUM_VERTICES);
+		IssmDouble *values      = xNew<IssmDouble>(NUM_VERTICES);
+
+		/*Recover vertices ids needed to initialize inputs*/
+		_assert_(iomodel->elements);
+		for(i=0;i<NUM_VERTICES;i++){
+			vertexids[i]=reCast<int>(iomodel->elements[NUM_VERTICES*this->Sid()+i]); //ids for vertices are in the elements array from Matlab
+		}
+
+		/*Are we in transient or static? */
+		if(M==1){
+			values[0]=vector[0];
+			this->AddInput(vector_enum,values,P0Enum);
+		}
+		else if(M==iomodel->numberofvertices){
+			for(i=0;i<NUM_VERTICES;i++) values[i]=vector[vertexids[i]-1];
+			this->AddInput(vector_enum,values,P1Enum);
+		}
+		else if(M==iomodel->numberofvertices+1){
+			/*create transient input: */
+			IssmDouble* times = xNew<IssmDouble>(N);
+			for(t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
+			TransientInput* transientinput=new TransientInput(vector_enum,times,N);
+			for(t=0;t<N;t++){
+				for(i=0;i<NUM_VERTICES;i++) values[i]=vector[N*(vertexids[i]-1)+t];
+				switch(this->ObjectEnum()){
+					case TriaEnum:  transientinput->AddTimeInput(new TriaInput( vector_enum,values,P1Enum)); break;
+					case PentaEnum: transientinput->AddTimeInput(new PentaInput(vector_enum,values,P1Enum)); break;
+					case TetraEnum: transientinput->AddTimeInput(new TetraInput(vector_enum,values,P1Enum)); break;
+					default: _error_("Not implemented yet");
+				}
+			}
+			this->inputs->AddInput(transientinput);
+			xDelete<IssmDouble>(times);
+		}
+		else if(M==iomodel->numberofelements){
+
+			/*This is a Patch!*/
+			xDelete<IssmDouble>(values);
+			values = xNew<IssmDouble>(N);
+			for(int j=0;j<N;j++) values[j]=vector[this->Sid()*N+j];
+
+			if     (N==this->GetNumberOfNodes(P1Enum)   ) this->AddInput(vector_enum,values,P1Enum);
+			else if(N==this->GetNumberOfNodes(P0Enum)   ) this->AddInput(vector_enum,values,P0Enum);
+			else if(N==this->GetNumberOfNodes(P1xP2Enum)) this->AddInput(vector_enum,values,P1xP2Enum);
+			else if(N==this->GetNumberOfNodes(P1xP3Enum)) this->AddInput(vector_enum,values,P1xP3Enum);
+			else _error_("Patch interpolation not supported yet");
+
+		}
+		else{
+			_error_("nodal vector is either numberofvertices or numberofvertices+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
+		}
+
+		xDelete<IssmDouble>(values);
+		xDelete<int>(vertexids);
+	}
+	else if(vector_type==2){ //element vector
+
+		IssmDouble value;
+
+		/*Are we in transient or static? */
+		if(M==iomodel->numberofelements){
+			if (code==5){ //boolean
+				this->inputs->AddInput(new BoolInput(vector_enum,reCast<bool>(vector[this->Sid()])));
+			}
+			else if (code==6){ //integer
+				this->inputs->AddInput(new IntInput(vector_enum,reCast<int>(vector[this->Sid()])));
+			}
+			else if (code==7){ //IssmDouble
+				this->inputs->AddInput(new DoubleInput(vector_enum,vector[this->Sid()]));
+			}
+			else _error_("could not recognize nature of vector from code " << code);
+		}
+		else if(M==iomodel->numberofelements+1){
+			/*create transient input: */
+			IssmDouble* times = xNew<IssmDouble>(N);
+			for(t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
+			TransientInput* transientinput=new TransientInput(vector_enum,times,N);
+			TriaInput* bof=NULL;
+			for(t=0;t<N;t++){
+				value=vector[N*this->Sid()+t];
+				switch(this->ObjectEnum()){
+					case TriaEnum:  transientinput->AddTimeInput(new TriaInput( vector_enum,&value,P0Enum)); break;
+					case PentaEnum: transientinput->AddTimeInput(new PentaInput(vector_enum,&value,P0Enum)); break;
+					case TetraEnum: transientinput->AddTimeInput(new TetraInput(vector_enum,&value,P0Enum)); break;
+					default: _error_("Not implemented yet");
+				}
+			}
+			this->inputs->AddInput(transientinput);
+			xDelete<IssmDouble>(times);
+		}
+		else _error_("element vector is either numberofelements or numberofelements+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
+	}
+	else if(vector_type==3){ //element vector
+
+		/*For right now we are static */
+		if(M==iomodel->numberofelements){
+			/*create transient input: */
+			IssmDouble* layers = xNewZeroInit<IssmDouble>(N);;
+			for(t=0;t<N;t++) layers[t] = vector[N*this->Sid()+t];
+			DoubleArrayInput* arrayinput=new DoubleArrayInput(vector_enum,layers,N);
+			this->inputs->AddInput(arrayinput);
+			xDelete<IssmDouble>(layers);
+		}
+		else _error_("element vector is either numberofelements or numberofelements+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
+	}
+	else _error_("Cannot add input for vector type " << vector_type << " (not supported)");
 }
 /*}}}*/
@@ -1776,9 +1860,10 @@
 
 	/*Intermediaries*/
-	int         numvertices = this->GetNumberOfVertices();
-	int        *vertexids   = xNew<int>(numvertices);
-	IssmDouble *values      = xNew<IssmDouble>(numvertices);
-	IssmDouble *values_min  = xNew<IssmDouble>(numvertices);
-	IssmDouble *values_max  = xNew<IssmDouble>(numvertices);
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+
+	int        *vertexids   = xNew<int>(NUM_VERTICES);
+	IssmDouble *values      = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble *values_min  = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble *values_max  = xNew<IssmDouble>(NUM_VERTICES);
 
 	/*Some sanity checks*/
@@ -1793,11 +1878,11 @@
 	/*Recover vertices ids needed to initialize inputs*/
 	_assert_(iomodel->elements);
-	for(int i=0;i<numvertices;i++){
-		vertexids[i]=reCast<int>(iomodel->elements[numvertices*this->Sid()+i]); //ids for vertices are in the elements array from Matlab
+	for(int i=0;i<NUM_VERTICES;i++){
+		vertexids[i]=reCast<int>(iomodel->elements[NUM_VERTICES*this->Sid()+i]); //ids for vertices are in the elements array from Matlab
 	}
 
 	/*Are we in transient or static? */
 	if(M==iomodel->numberofvertices){
-		for(int i=0;i<numvertices;i++){
+		for(int i=0;i<NUM_VERTICES;i++){
 			values[i]=vector[vertexids[i]-1];
 			values_min[i] = min_vector[vertexids[i]-1];
@@ -1808,41 +1893,41 @@
 
 	else if(M==iomodel->numberofvertices+1){
-            /*create transient input: */
-            IssmDouble* times = xNew<IssmDouble>(N);
-            for(int t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
-				/*Create the three transient inputs for the control input*/
-            TransientInput* values_input=new TransientInput(input_enum,times,N);
-				TransientInput* mins_input = new TransientInput(ControlInputMinsEnum,times,N);
-				TransientInput* maxs_input = new TransientInput(ControlInputMaxsEnum,times,N);
-			   TransientInput* grad_input = new TransientInput(ControlInputGradEnum);
-				for(int t=0;t<N;t++){
-                for(int i=0;i<numvertices;i++){
-						values[i]=vector[N*(vertexids[i]-1)+t];
-						values_min[i] = min_vector[N*(vertexids[i]-1)+t];
-						values_max[i] = max_vector[N*(vertexids[i]-1)+t];
-					 }
-					switch(this->ObjectEnum()){
-                    case TriaEnum:
-									values_input->AddTimeInput(new TriaInput(input_enum,values,P1Enum));
-									mins_input->AddTimeInput(new TriaInput(ControlInputMinsEnum,values_min,P1Enum));
-									maxs_input->AddTimeInput(new TriaInput(ControlInputMaxsEnum,values_max,P1Enum));
-								break;
-                    case PentaEnum:
-									values_input->AddTimeInput(new PentaInput(input_enum,values,P1Enum));
-									mins_input->AddTimeInput(new PentaInput(ControlInputMinsEnum,values_min,P1Enum));
-									maxs_input->AddTimeInput(new PentaInput(ControlInputMaxsEnum,values_max,P1Enum));
-									break;
-                    case TetraEnum:
-									values_input->AddTimeInput(new TetraInput(input_enum,values,P1Enum));
-									mins_input->AddTimeInput(new TetraInput(ControlInputMinsEnum,values_min,P1Enum));
-									maxs_input->AddTimeInput(new TetraInput(ControlInputMaxsEnum,values_max,P1Enum));
-									break;
-                    default: _error_("Not implemented yet");
-                }
-            }
-            this->inputs->AddInput(new ControlInput(input_enum,TransientInputEnum,values_input,mins_input,maxs_input,grad_input,P1Enum,id));
-            xDelete<IssmDouble>(times);
-        }
-		  else _error_("not currently supported type of M and N attempted");
+		/*create transient input: */
+		IssmDouble* times = xNew<IssmDouble>(N);
+		for(int t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
+		/*Create the three transient inputs for the control input*/
+		TransientInput* values_input=new TransientInput(input_enum,times,N);
+		TransientInput* mins_input = new TransientInput(ControlInputMinsEnum,times,N);
+		TransientInput* maxs_input = new TransientInput(ControlInputMaxsEnum,times,N);
+		TransientInput* grad_input = new TransientInput(ControlInputGradEnum);
+		for(int t=0;t<N;t++){
+			for(int i=0;i<NUM_VERTICES;i++){
+				values[i]=vector[N*(vertexids[i]-1)+t];
+				values_min[i] = min_vector[N*(vertexids[i]-1)+t];
+				values_max[i] = max_vector[N*(vertexids[i]-1)+t];
+			}
+			switch(this->ObjectEnum()){
+				case TriaEnum:
+					values_input->AddTimeInput(new TriaInput(input_enum,values,P1Enum));
+					mins_input->AddTimeInput(new TriaInput(ControlInputMinsEnum,values_min,P1Enum));
+					maxs_input->AddTimeInput(new TriaInput(ControlInputMaxsEnum,values_max,P1Enum));
+					break;
+				case PentaEnum:
+					values_input->AddTimeInput(new PentaInput(input_enum,values,P1Enum));
+					mins_input->AddTimeInput(new PentaInput(ControlInputMinsEnum,values_min,P1Enum));
+					maxs_input->AddTimeInput(new PentaInput(ControlInputMaxsEnum,values_max,P1Enum));
+					break;
+				case TetraEnum:
+					values_input->AddTimeInput(new TetraInput(input_enum,values,P1Enum));
+					mins_input->AddTimeInput(new TetraInput(ControlInputMinsEnum,values_min,P1Enum));
+					maxs_input->AddTimeInput(new TetraInput(ControlInputMaxsEnum,values_max,P1Enum));
+					break;
+				default: _error_("Not implemented yet");
+			}
+		}
+		this->inputs->AddInput(new ControlInput(input_enum,TransientInputEnum,values_input,mins_input,maxs_input,grad_input,P1Enum,id));
+		xDelete<IssmDouble>(times);
+	}
+	else _error_("not currently supported type of M and N attempted");
 
 	/*clean up*/
@@ -1851,176 +1936,177 @@
 }
 /*}}}*/
-void       Element::DatasetInputAdd(int enum_type,IssmDouble* vector,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code,int input_enum){/*{{{*/
-    /*enum_type: the name of the DatasetInput (eg Outputdefinition1)
-	  * vector: information being stored (eg observations)
-	  * vector_type: is if by element or by vertex
-	  * vector_enum: is the name of the vector being stored
-	  * code: what type of data is in the vector (booleans, ints, doubles)
-	  */
-
-	 /*Intermediaries*/
-    int					i,t;
-	 DatasetInput*		datasetinput = NULL;
-
-	 /*Get input if it already exists*/
-	 Input*  tempinput = GetInput(enum_type);
-	 if(tempinput){
-		 /*Cast it to a Datasetinput*/
-		 if(tempinput->ObjectEnum()!=DatasetInputEnum) _error_("don't know what to do");
-		 datasetinput = (DatasetInput*)tempinput;
-	 }
-	 else{
-		 datasetinput=new DatasetInput(enum_type);
-	   this->inputs->AddInput(datasetinput);
-	}
-
-    /*Branch on type of vector: nodal or elementary: */
-    if(vector_type==1){ //nodal vector
-
-        int         numvertices = this->GetNumberOfVertices();
-        int        *vertexids   = xNew<int>(numvertices);
-        IssmDouble *values      = xNew<IssmDouble>(numvertices);
-
-        /*Recover vertices ids needed to initialize inputs*/
-        _assert_(iomodel->elements);
-        for(i=0;i<numvertices;i++){
-            vertexids[i]=reCast<int>(iomodel->elements[numvertices*this->Sid()+i]); //ids for vertices are in the elements array from Matlab
-        }
-
-        /*Are we in transient or static? */
-		  if(M==1){
-			  values[0]=vector[0];
+void       Element::DatasetInputAdd(int enum_type,IssmDouble* vector,IoModel* iomodel,int M,int N,int vector_type,int input_enum,int code,int input_id){/*{{{*/
+	/*enum_type: the name of the DatasetInput (eg Outputdefinition1)
+	 * vector: information being stored (eg observations)
+	 * vector_type: is if by element or by vertex
+	 * input_enum: is the name of the vector being stored
+	 * code: what type of data is in the vector (booleans, ints, doubles)
+	 */
+
+	/*Intermediaries*/
+	int					i,t;
+	DatasetInput*		datasetinput = NULL;
+
+	/*Get input if it already exists*/
+	Input*  tempinput = GetInput(enum_type);
+	if(tempinput){
+		/*Cast it to a Datasetinput*/
+		if(tempinput->ObjectEnum()!=DatasetInputEnum) _error_("don't know what to do");
+		datasetinput = (DatasetInput*)tempinput;
+	}
+	else{
+		datasetinput=new DatasetInput(enum_type);
+		this->inputs->AddInput(datasetinput);
+	}
+
+	/*Branch on type of vector: nodal or elementary: */
+	if(vector_type==1){ //nodal vector
+
+		const int NUM_VERTICES = this->GetNumberOfVertices();
+
+		int        *vertexids   = xNew<int>(NUM_VERTICES);
+		IssmDouble *values      = xNew<IssmDouble>(NUM_VERTICES);
+
+		/*Recover vertices ids needed to initialize inputs*/
+		_assert_(iomodel->elements);
+		for(i=0;i<NUM_VERTICES;i++){
+			vertexids[i]=reCast<int>(iomodel->elements[NUM_VERTICES*this->Sid()+i]); //ids for vertices are in the elements array from Matlab
+		}
+
+		/*Are we in transient or static? */
+		if(M==1){
+			values[0]=vector[0];
+			switch(this->ObjectEnum()){
+				case TriaEnum:  datasetinput->AddInput(new TriaInput(input_enum,values,P0Enum),input_id); break;
+				case PentaEnum: datasetinput->AddInput(new PentaInput(input_enum,values,P0Enum),input_id); break;
+				case TetraEnum: datasetinput->AddInput(new TetraInput(input_enum,values,P0Enum),input_id); break;
+				default: _error_("Not implemented yet");
+			}
+		}
+		else if(M==iomodel->numberofvertices){
+			for(i=0;i<NUM_VERTICES;i++) values[i]=vector[vertexids[i]-1];
+			switch(this->ObjectEnum()){
+				case TriaEnum:  datasetinput->AddInput(new TriaInput(input_enum,values,P1Enum),input_id); break;
+				case PentaEnum: datasetinput->AddInput(new PentaInput(input_enum,values,P1Enum),input_id); break;
+				case TetraEnum: datasetinput->AddInput(new TetraInput(input_enum,values,P1Enum),input_id); break;
+				default: _error_("Not implemented yet");
+			}  }
+		else if(M==iomodel->numberofvertices+1){
+			/*create transient input: */
+			IssmDouble* times = xNew<IssmDouble>(N);
+			for(t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
+			TransientInput* transientinput=new TransientInput(input_enum,times,N);
+			for(t=0;t<N;t++){
+				for(i=0;i<NUM_VERTICES;i++) values[i]=vector[N*(vertexids[i]-1)+t];
 				switch(this->ObjectEnum()){
-                    case TriaEnum:  datasetinput->AddInput(new TriaInput(vector_enum,values,P0Enum),input_enum); break;
-                    case PentaEnum: datasetinput->AddInput(new PentaInput(vector_enum,values,P0Enum),input_enum); break;
-                    case TetraEnum: datasetinput->AddInput(new TetraInput(vector_enum,values,P0Enum),input_enum); break;
-                    default: _error_("Not implemented yet");
+					case TriaEnum:  transientinput->AddTimeInput(new TriaInput( input_enum,values,P1Enum)); break;
+					case PentaEnum: transientinput->AddTimeInput(new PentaInput(input_enum,values,P1Enum)); break;
+					case TetraEnum: transientinput->AddTimeInput(new TetraInput(input_enum,values,P1Enum)); break;
+					default: _error_("Not implemented yet");
 				}
-		  }
-		  else if(M==iomodel->numberofvertices){
-            for(i=0;i<numvertices;i++) values[i]=vector[vertexids[i]-1];
+			}
+			datasetinput->AddInput(transientinput,input_id);
+			xDelete<IssmDouble>(times);
+		}
+		else if(M==iomodel->numberofelements){
+
+			/*This is a Patch!*/
+			xDelete<IssmDouble>(values);
+			values = xNew<IssmDouble>(N);
+			for(int j=0;j<N;j++) values[j]=vector[this->Sid()*N+j];
+
+			if     (N==this->GetNumberOfNodes(P1Enum)   ){
 				switch(this->ObjectEnum()){
-                    case TriaEnum:  datasetinput->AddInput(new TriaInput(vector_enum,values,P1Enum),input_enum); break;
-                    case PentaEnum: datasetinput->AddInput(new PentaInput(vector_enum,values,P1Enum),input_enum); break;
-                    case TetraEnum: datasetinput->AddInput(new TetraInput(vector_enum,values,P1Enum),input_enum); break;
-                    default: _error_("Not implemented yet");
-				}  }
-        else if(M==iomodel->numberofvertices+1){
-            /*create transient input: */
-            IssmDouble* times = xNew<IssmDouble>(N);
-            for(t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
-            TransientInput* transientinput=new TransientInput(vector_enum,times,N);
-            for(t=0;t<N;t++){
-                for(i=0;i<numvertices;i++) values[i]=vector[N*(vertexids[i]-1)+t];
-                switch(this->ObjectEnum()){
-                    case TriaEnum:  transientinput->AddTimeInput(new TriaInput( vector_enum,values,P1Enum)); break;
-                    case PentaEnum: transientinput->AddTimeInput(new PentaInput(vector_enum,values,P1Enum)); break;
-                    case TetraEnum: transientinput->AddTimeInput(new TetraInput(vector_enum,values,P1Enum)); break;
-                    default: _error_("Not implemented yet");
-                }
-            }
-            datasetinput->AddInput(transientinput,input_enum);
-            xDelete<IssmDouble>(times);
-        }
-        else if(M==iomodel->numberofelements){
-
-			  /*This is a Patch!*/
-			  xDelete<IssmDouble>(values);
-			  values = xNew<IssmDouble>(N);
-			  for(int j=0;j<N;j++) values[j]=vector[this->Sid()*N+j];
-
-			  if     (N==this->GetNumberOfNodes(P1Enum)   ){
-				  switch(this->ObjectEnum()){
-					  case TriaEnum:  datasetinput->AddInput(new TriaInput(vector_enum,values,P1Enum),input_enum); break;
-					  case PentaEnum: datasetinput->AddInput(new PentaInput(vector_enum,values,P1Enum),input_enum); break;
-					  case TetraEnum: datasetinput->AddInput(new TetraInput(vector_enum,values,P1Enum),input_enum); break;
-					  default: _error_("Not implemented yet");
-				  }
-			  }
-			  else if(N==this->GetNumberOfNodes(P0Enum)   ){
-				  switch(this->ObjectEnum()){
-					  case TriaEnum:  datasetinput->AddInput(new TriaInput(vector_enum,values,P0Enum),input_enum); break;
-					  case PentaEnum: datasetinput->AddInput(new PentaInput(vector_enum,values,P0Enum),input_enum); break;
-					  case TetraEnum: datasetinput->AddInput(new TetraInput(vector_enum,values,P0Enum),input_enum); break;
-					  default: _error_("Not implemented yet");
-				  }
-			  }
-			  else if(N==this->GetNumberOfNodes(P1xP2Enum)){
-				  switch(this->ObjectEnum()){
-					  case TriaEnum:  datasetinput->AddInput(new TriaInput(vector_enum,values,P1xP2Enum),input_enum); break;
-					  case PentaEnum: datasetinput->AddInput(new PentaInput(vector_enum,values,P1xP2Enum),input_enum); break;
-					  case TetraEnum: datasetinput->AddInput(new TetraInput(vector_enum,values,P1xP2Enum),input_enum); break;
-					  default: _error_("Not implemented yet");
-				  }
-			  }
-			  else if(N==this->GetNumberOfNodes(P1xP3Enum)) {
-				 switch(this->ObjectEnum()){
-					  case TriaEnum:  datasetinput->AddInput(new TriaInput(vector_enum,values,P1xP3Enum),input_enum); break;
-					  case PentaEnum: datasetinput->AddInput(new PentaInput(vector_enum,values,P1xP3Enum),input_enum); break;
-					  case TetraEnum: datasetinput->AddInput(new TetraInput(vector_enum,values,P1xP3Enum),input_enum); break;
-					  default: _error_("Not implemented yet");
-				  }
-			  }
-			  else _error_("Patch interpolation not supported yet");
-
-		  }
-		  else{
-			  _error_("nodal vector is either numberofvertices or numberofvertices+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
-		  }
-
-        xDelete<IssmDouble>(values);
-        xDelete<int>(vertexids);
-    }
-    else if(vector_type==2){ //element vector
-
-        IssmDouble value;
-
-        /*Are we in transient or static? */
-        if(M==iomodel->numberofelements){
-            if (code==5){ //boolean
-                datasetinput->AddInput(new BoolInput(vector_enum,reCast<bool>(vector[this->Sid()])),input_enum);
-            }
-            else if (code==6){ //integer
-                datasetinput->AddInput(new IntInput(vector_enum,reCast<int>(vector[this->Sid()])),input_enum);
-            }
-            else if (code==7){ //IssmDouble
-                datasetinput->AddInput(new DoubleInput(vector_enum,vector[this->Sid()]),input_enum);
-            }
-            else _error_("could not recognize nature of vector from code " << code);
-        }
-        else if(M==iomodel->numberofelements+1){
-            /*create transient input: */
-            IssmDouble* times = xNew<IssmDouble>(N);
-            for(t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
-            TransientInput* transientinput=new TransientInput(vector_enum,times,N);
-            TriaInput* bof=NULL;
-            for(t=0;t<N;t++){
-                value=vector[N*this->Sid()+t];
-                switch(this->ObjectEnum()){
-                    case TriaEnum:  transientinput->AddTimeInput(new TriaInput( vector_enum,&value,P0Enum)); break;
-                    case PentaEnum: transientinput->AddTimeInput(new PentaInput(vector_enum,&value,P0Enum)); break;
-                    case TetraEnum: transientinput->AddTimeInput(new TetraInput(vector_enum,&value,P0Enum)); break;
-                    default: _error_("Not implemented yet");
-                }
-            }
-            datasetinput->AddInput(transientinput,input_enum);
-            xDelete<IssmDouble>(times);
-        }
-        else _error_("element vector is either numberofelements or numberofelements+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
-    }
-    else if(vector_type==3){ //element vector
-
-        /*For right now we are static */
-        if(M==iomodel->numberofelements){
-            /*create transient input: */
-            IssmDouble* layers = xNewZeroInit<IssmDouble>(N);;
-            for(t=0;t<N;t++) layers[t] = vector[N*this->Sid()+t];
-            DoubleArrayInput* arrayinput=new DoubleArrayInput(vector_enum,layers,N);
-            datasetinput->AddInput(arrayinput,input_enum);
-            xDelete<IssmDouble>(layers);
-        }
-        else _error_("element vector is either numberofelements or numberofelements+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long");
-    }
-    else _error_("Cannot add input for vector type " << vector_type << " (not supported)");
+					case TriaEnum:  datasetinput->AddInput(new TriaInput(input_enum,values,P1Enum),input_id); break;
+					case PentaEnum: datasetinput->AddInput(new PentaInput(input_enum,values,P1Enum),input_id); break;
+					case TetraEnum: datasetinput->AddInput(new TetraInput(input_enum,values,P1Enum),input_id); break;
+					default: _error_("Not implemented yet");
+				}
+			}
+			else if(N==this->GetNumberOfNodes(P0Enum)   ){
+				switch(this->ObjectEnum()){
+					case TriaEnum:  datasetinput->AddInput(new TriaInput(input_enum,values,P0Enum),input_id); break;
+					case PentaEnum: datasetinput->AddInput(new PentaInput(input_enum,values,P0Enum),input_id); break;
+					case TetraEnum: datasetinput->AddInput(new TetraInput(input_enum,values,P0Enum),input_id); break;
+					default: _error_("Not implemented yet");
+				}
+			}
+			else if(N==this->GetNumberOfNodes(P1xP2Enum)){
+				switch(this->ObjectEnum()){
+					case TriaEnum:  datasetinput->AddInput(new TriaInput(input_enum,values,P1xP2Enum),input_id); break;
+					case PentaEnum: datasetinput->AddInput(new PentaInput(input_enum,values,P1xP2Enum),input_id); break;
+					case TetraEnum: datasetinput->AddInput(new TetraInput(input_enum,values,P1xP2Enum),input_id); break;
+					default: _error_("Not implemented yet");
+				}
+			}
+			else if(N==this->GetNumberOfNodes(P1xP3Enum)) {
+				switch(this->ObjectEnum()){
+					case TriaEnum:  datasetinput->AddInput(new TriaInput(input_enum,values,P1xP3Enum),input_id); break;
+					case PentaEnum: datasetinput->AddInput(new PentaInput(input_enum,values,P1xP3Enum),input_id); break;
+					case TetraEnum: datasetinput->AddInput(new TetraInput(input_enum,values,P1xP3Enum),input_id); break;
+					default: _error_("Not implemented yet");
+				}
+			}
+			else _error_("Patch interpolation not supported yet");
+
+		}
+		else{
+			_error_("nodal vector is either numberofvertices or numberofvertices+1 long. Field provided (" << EnumToStringx(input_enum) << ") is " << M << " long");
+		}
+
+		xDelete<IssmDouble>(values);
+		xDelete<int>(vertexids);
+	}
+	else if(vector_type==2){ //element vector
+
+		IssmDouble value;
+
+		/*Are we in transient or static? */
+		if(M==iomodel->numberofelements){
+			if (code==5){ //boolean
+				datasetinput->AddInput(new BoolInput(input_enum,reCast<bool>(vector[this->Sid()])),input_id);
+			}
+			else if (code==6){ //integer
+				datasetinput->AddInput(new IntInput(input_enum,reCast<int>(vector[this->Sid()])),input_id);
+			}
+			else if (code==7){ //IssmDouble
+				datasetinput->AddInput(new DoubleInput(input_enum,vector[this->Sid()]),input_id);
+			}
+			else _error_("could not recognize nature of vector from code " << code);
+		}
+		else if(M==iomodel->numberofelements+1){
+			/*create transient input: */
+			IssmDouble* times = xNew<IssmDouble>(N);
+			for(t=0;t<N;t++) times[t] = vector[(M-1)*N+t];
+			TransientInput* transientinput=new TransientInput(input_enum,times,N);
+			TriaInput* bof=NULL;
+			for(t=0;t<N;t++){
+				value=vector[N*this->Sid()+t];
+				switch(this->ObjectEnum()){
+					case TriaEnum:  transientinput->AddTimeInput(new TriaInput( input_enum,&value,P0Enum)); break;
+					case PentaEnum: transientinput->AddTimeInput(new PentaInput(input_enum,&value,P0Enum)); break;
+					case TetraEnum: transientinput->AddTimeInput(new TetraInput(input_enum,&value,P0Enum)); break;
+					default: _error_("Not implemented yet");
+				}
+			}
+			datasetinput->AddInput(transientinput,input_id);
+			xDelete<IssmDouble>(times);
+		}
+		else _error_("element vector is either numberofelements or numberofelements+1 long. Field provided (" << EnumToStringx(input_enum) << ") is " << M << " long");
+	}
+	else if(vector_type==3){ //element vector
+
+		/*For right now we are static */
+		if(M==iomodel->numberofelements){
+			/*create transient input: */
+			IssmDouble* layers = xNewZeroInit<IssmDouble>(N);;
+			for(t=0;t<N;t++) layers[t] = vector[N*this->Sid()+t];
+			DoubleArrayInput* arrayinput=new DoubleArrayInput(input_enum,layers,N);
+			datasetinput->AddInput(arrayinput,input_id);
+			xDelete<IssmDouble>(layers);
+		}
+		else _error_("element vector is either numberofelements or numberofelements+1 long. Field provided (" << EnumToStringx(input_enum) << ") is " << M << " long");
+	}
+	else _error_("Cannot add input for vector type " << vector_type << " (not supported)");
 }
 /*}}}*/
@@ -2083,4 +2169,13 @@
 	return shelf;
 }/*}}}*/
+bool       Element::IsGrounded(){/*{{{*/
+
+	if(this->inputs->Max(MaskGroundediceLevelsetEnum) > 0.){
+		return true;
+	}
+	else{
+		return false;
+	}
+}/*}}}*/
 bool       Element::IsIceInElement(){/*{{{*/
 	return (this->inputs->Min(MaskIceLevelsetEnum)<0.);
@@ -2091,4 +2186,69 @@
 }
 /*}}}*/
+void       Element::Ismip6FloatingiceMeltingRate(){/*{{{*/
+
+	if(!this->IsIceInElement() || !this->IsFloating() || !this->IsOnBase()) return;
+
+	int         basinid,num_basins,M,N;
+	IssmDouble  tf,gamma0,base,delta_t_basin,mean_tf_basin,absval,meltanomaly;
+	bool        islocal;
+	IssmDouble* delta_t = NULL;
+	IssmDouble* mean_tf = NULL;
+	IssmDouble* depths  = NULL;
+
+	/*Allocate some arrays*/
+	const int numvertices = this->GetNumberOfVertices();
+	IssmDouble* basalmeltrate = xNew<IssmDouble>(numvertices);
+
+	/*Get variables*/
+	IssmDouble rhoi = this->FindParam(MaterialsRhoIceEnum);
+	IssmDouble rhow = this->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble lf   = this->FindParam(MaterialsLatentheatEnum);
+	IssmDouble cp   = this->FindParam(MaterialsMixedLayerCapacityEnum);
+
+	/*Hard code sea water density to be consistent with ISMIP6 documentation*/
+	rhow = 1028.;
+
+	/* Get parameters and inputs */
+	this->inputs->GetInputValue(&basinid,BasalforcingsIsmip6BasinIdEnum);
+	this->parameters->FindParam(&num_basins,BasalforcingsIsmip6NumBasinsEnum);
+	this->parameters->FindParam(&gamma0,BasalforcingsIsmip6Gamma0Enum);
+	this->parameters->FindParam(&delta_t,&M,BasalforcingsIsmip6DeltaTEnum);    _assert_(M==num_basins);
+	this->parameters->FindParam(&islocal,BasalforcingsIsmip6IsLocalEnum);
+	if(!islocal) {
+		this->parameters->FindParam(&mean_tf,&N,BasalforcingsIsmip6AverageTfEnum); _assert_(N==num_basins);
+	}
+	Input* tf_input = this->GetInput(BasalforcingsIsmip6TfShelfEnum);              _assert_(tf_input);
+	Input* meltanomaly_input = this->GetInput(BasalforcingsIsmip6MeltAnomalyEnum); _assert_(meltanomaly_input);
+	delta_t_basin = delta_t[basinid];
+	if(!islocal) mean_tf_basin = mean_tf[basinid];
+
+	/*Compute melt rate for Local and Nonlocal parameterizations*/
+	Gauss* gauss=this->NewGauss();
+	for(int i=0;i<numvertices;i++){
+		gauss->GaussVertex(i);
+		tf_input->GetInputValue(&tf,gauss);
+		meltanomaly_input->GetInputValue(&meltanomaly,gauss);
+		if(!islocal) {
+			absval = mean_tf_basin+delta_t_basin;
+			if (absval<0) {absval = -1.*absval;}
+			basalmeltrate[i] = gamma0*pow((rhow*cp)/(rhoi*lf),2)*(tf+delta_t_basin)*absval + meltanomaly;
+		}
+		else{
+			basalmeltrate[i] = gamma0*pow((rhow*cp)/(rhoi*lf),2)*pow(max(tf+delta_t_basin,0.),2) + meltanomaly;
+		}
+	}
+
+	/*Return basal melt rate*/
+	this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,basalmeltrate,P1Enum);
+
+	/*Cleanup and return*/
+	delete gauss;
+	xDelete<IssmDouble>(delta_t);
+	xDelete<IssmDouble>(mean_tf);
+	xDelete<IssmDouble>(depths);
+	xDelete<IssmDouble>(basalmeltrate);
+
+}/*}}}*/
 bool       Element::IsWaterInElement(){/*{{{*/
 	return (this->inputs->Max(MaskOceanLevelsetEnum)>0.);
@@ -2097,20 +2257,29 @@
 void       Element::LinearFloatingiceMeltingRate(){/*{{{*/
 
-	int numvertices      = this->GetNumberOfVertices();
-	IssmDouble  deepwaterel,upperwaterel,deepwatermelt;
-	IssmDouble* base     = xNew<IssmDouble>(numvertices);
-	IssmDouble* values   = xNew<IssmDouble>(numvertices);
-	IssmDouble time;
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+
+	IssmDouble  deepwaterel,upperwaterel,deepwatermelt,upperwatermelt;
+	IssmDouble* base     		= xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* values   		= xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble 	time;
 
 	parameters->FindParam(&time,TimeEnum);
 	parameters->FindParam(&deepwaterel,BasalforcingsDeepwaterElevationEnum,time);
+	parameters->FindParam(&deepwatermelt,BasalforcingsDeepwaterMeltingRateEnum,time);
 	parameters->FindParam(&upperwaterel,BasalforcingsUpperwaterElevationEnum,time);
-	parameters->FindParam(&deepwatermelt,BasalforcingsDeepwaterMeltingRateEnum,time);
+	parameters->FindParam(&upperwatermelt,BasalforcingsUpperwaterMeltingRateEnum,time);
+	_assert_(upperwaterel>deepwaterel);
 
 	this->GetInputListOnVertices(base,BaseEnum);
-	for(int i=0;i<numvertices;i++){
-		if(base[i]>upperwaterel)      values[i]=0;
-		else if (base[i]<deepwaterel) values[i]=deepwatermelt;
-		else values[i]=deepwatermelt*(base[i]-upperwaterel)/(deepwaterel-upperwaterel);
+	for(int i=0;i<NUM_VERTICES;i++){
+		if(base[i]>=upperwaterel){
+			values[i]=upperwatermelt;
+		}
+		else if (base[i]<deepwaterel){
+			values[i]=deepwatermelt;
+		}
+		else{
+			values[i]=deepwatermelt*(base[i]-upperwaterel)/(deepwaterel-upperwaterel);
+		}
 	}
 
@@ -2122,10 +2291,11 @@
 void       Element::SpatialLinearFloatingiceMeltingRate(){/*{{{*/
 
-	int numvertices      = this->GetNumberOfVertices();
-	IssmDouble* deepwatermelt     = xNew<IssmDouble>(numvertices);
-	IssmDouble* deepwaterel     = xNew<IssmDouble>(numvertices);
-	IssmDouble* upperwaterel     = xNew<IssmDouble>(numvertices);
-	IssmDouble* base     = xNew<IssmDouble>(numvertices);
-	IssmDouble* values   = xNew<IssmDouble>(numvertices);
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+
+	IssmDouble* deepwatermelt	= xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* deepwaterel     = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* upperwaterel	= xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* base			= xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* values			= xNew<IssmDouble>(NUM_VERTICES);
 
 	this->GetInputListOnVertices(base,BaseEnum);
@@ -2134,5 +2304,5 @@
 	this->GetInputListOnVertices(upperwaterel,BasalforcingsUpperwaterElevationEnum);
 
-	for(int i=0;i<numvertices;i++){
+	for(int i=0;i<NUM_VERTICES;i++){
 		if(base[i]>upperwaterel[i])      values[i]=0;
 		else if (base[i]<deepwaterel[i]) values[i]=deepwatermelt[i];
@@ -2150,10 +2320,10 @@
 void       Element::MantlePlumeGeothermalFlux(){/*{{{*/
 
-	int numvertices      = this->GetNumberOfVertices();
+	const int NUM_VERTICES = this->GetNumberOfVertices();
 	IssmDouble  mantleconductivity,nusselt,dtbg,plumeradius,topplumedepth,bottomplumedepth,plumex,plumey;
 	IssmDouble  crustthickness,uppercrustthickness,uppercrustheat,lowercrustheat;
 	IssmDouble  crustheat,plumeheat,dt,middleplumedepth,a,e,eprime,A0,lambda,Alambda,dAlambda;
 	IssmDouble  x,y,z,c;
-	IssmDouble* values   = xNew<IssmDouble>(numvertices);
+	IssmDouble* values   = xNew<IssmDouble>(NUM_VERTICES);
 	IssmDouble *xyz_list = NULL;
 
@@ -2176,5 +2346,5 @@
 	e=pow(a*a-c*c,1./2.)/a;
 	A0=(1-pow(e,2.))/pow(e,3.)*(1./2.*log((1+e)/(1-e))-e);
-	for(int i=0;i<numvertices;i++){
+	for(int i=0;i<NUM_VERTICES;i++){
 		y=xyz_list[i*3+0]-plumex;
 		z=xyz_list[i*3+1]-plumey;
@@ -2215,15 +2385,15 @@
 void       Element::MigrateGroundingLine(IssmDouble* phi_ungrounding){/*{{{*/
 
-	int         numvertices = this->GetNumberOfVertices();
+	const int  NUM_VERTICES = this->GetNumberOfVertices();
 	int        i,migration_style;
 	IssmDouble bed_hydro,yts;
 	IssmDouble rho_water,rho_ice,density;
-	IssmDouble* melting = xNew<IssmDouble>(numvertices);
-	IssmDouble* phi     = xNew<IssmDouble>(numvertices);
-	IssmDouble* h       = xNew<IssmDouble>(numvertices);
-	IssmDouble* s       = xNew<IssmDouble>(numvertices);
-	IssmDouble* b       = xNew<IssmDouble>(numvertices);
-	IssmDouble* r       = xNew<IssmDouble>(numvertices);
-	IssmDouble* sl      = xNew<IssmDouble>(numvertices);
+	IssmDouble* melting = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* phi     = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* h       = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* s       = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* b       = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* r       = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* sl      = xNew<IssmDouble>(NUM_VERTICES);
 
 	/*Recover info at the vertices: */
@@ -2236,10 +2406,10 @@
 	GetInputListOnVertices(&sl[0],SealevelEnum);
 	GetInputListOnVertices(&phi[0],MaskGroundediceLevelsetEnum);
-	rho_water   = matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	rho_ice     = matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_water   = FindParam(MaterialsRhoSeawaterEnum);
+	rho_ice     = FindParam(MaterialsRhoIceEnum);
 	density     = rho_ice/rho_water;
 
 	/*go through vertices, and update inputs, considering them to be TriaVertex type: */
-	for(i=0;i<numvertices;i++){
+	for(i=0;i<NUM_VERTICES;i++){
 		/* Contact FS*/
 		if(migration_style == ContactEnum){
@@ -2277,5 +2447,5 @@
 
 	/*Recalculate phi*/
-	for(i=0;i<numvertices;i++){
+	for(i=0;i<NUM_VERTICES;i++){
 		if(migration_style==SoftMigrationEnum){
 			bed_hydro=-density*h[i]+sl[i];
@@ -2307,10 +2477,10 @@
 /*}}}*/
 void       Element::MismipFloatingiceMeltingRate(){/*{{{*/
-
-	int numvertices      = this->GetNumberOfVertices();
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+
 	IssmDouble  meltratefactor,thresholdthickness,upperdepthmelt;
-	IssmDouble* base     = xNew<IssmDouble>(numvertices);
-	IssmDouble* bed      = xNew<IssmDouble>(numvertices);
-	IssmDouble* values   = xNew<IssmDouble>(numvertices);
+	IssmDouble* base     = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* bed      = xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* values   = xNew<IssmDouble>(NUM_VERTICES);
 
 	parameters->FindParam(&meltratefactor,BasalforcingsMeltrateFactorEnum);
@@ -2320,5 +2490,5 @@
 	this->GetInputListOnVertices(base,BaseEnum);
 	this->GetInputListOnVertices(bed,BedEnum);
-	for(int i=0;i<numvertices;i++){
+	for(int i=0;i<NUM_VERTICES;i++){
 		if(base[i]>upperdepthmelt){
 			values[i]=0;
@@ -2335,18 +2505,59 @@
 
 }/*}}}*/
+void       Element::BeckmannGoosseFloatingiceMeltingRate(){/*{{{*/
+
+	int numvertices      = this->GetNumberOfVertices();
+	IssmDouble meltratefactor,T_f,ocean_heat_flux;
+	IssmDouble rho_water    = this->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble rho_ice      = this->FindParam(MaterialsRhoIceEnum);
+	IssmDouble latentheat   = this->FindParam(MaterialsLatentheatEnum);
+	IssmDouble mixed_layer_capacity = this->FindParam(MaterialsMixedLayerCapacityEnum);
+	IssmDouble thermal_exchange_vel = this->FindParam(MaterialsThermalExchangeVelocityEnum);
+
+	IssmDouble* base    = xNew<IssmDouble>(numvertices);
+	IssmDouble* values  = xNew<IssmDouble>(numvertices);
+	IssmDouble* oceansalinity   = xNew<IssmDouble>(numvertices);
+	IssmDouble* oceantemp       = xNew<IssmDouble>(numvertices);
+
+	this->GetInputListOnVertices(base,BaseEnum);
+	this->GetInputListOnVertices(oceansalinity,BasalforcingsOceanSalinityEnum);
+	this->GetInputListOnVertices(oceantemp,BasalforcingsOceanTempEnum);
+	parameters->FindParam(&meltratefactor,BasalforcingsMeltrateFactorEnum);
+
+	Gauss* gauss=this->NewGauss();
+	for(int i=0;i<numvertices;i++){
+		T_f=(0.0939 - 0.057 * oceansalinity[i] + 7.64e-4 * base[i]); //degC
+
+		// compute ocean_heat_flux according to beckmann_goosse2003
+		// positive, if T_oc > T_ice ==> heat flux FROM ocean TO ice
+		ocean_heat_flux = meltratefactor * rho_water * mixed_layer_capacity * thermal_exchange_vel * (oceantemp[i] - T_f); // in W/m^2
+
+		// shelfbmassflux is positive if ice is freezing on; here it is always negative:
+		// same sign as ocean_heat_flux (positive if massflux FROM ice TO ocean)
+		values[i] = ocean_heat_flux / (latentheat * rho_ice); // m s-1
+	}
+
+	this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,values,P1Enum);
+	xDelete<IssmDouble>(base);
+	xDelete<IssmDouble>(values);
+	xDelete<IssmDouble>(oceantemp);
+	xDelete<IssmDouble>(oceansalinity);
+	delete gauss;
+}/*}}}*/
 void       Element::MungsmtpParameterization(void){/*{{{*/
 	/*Are we on the base? If not, return*/
 	if(!IsOnBase()) return;
 
-	int        numvertices = this->GetNumberOfVertices();
-
-	int        i;
-	IssmDouble* monthlytemperatures=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* monthlyprec=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* TemperaturesPresentday=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* TemperaturesLgm=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* PrecipitationsPresentday=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* PrecipitationsLgm=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* tmp=xNew<IssmDouble>(numvertices);
+	const int NUM_VERTICES 					= this->GetNumberOfVertices();
+	const int NUM_VERTICES_MONTHS_PER_YEAR 	= NUM_VERTICES * 12;
+
+	int i;
+	IssmDouble* monthlytemperatures=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* monthlyprec=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* TemperaturesPresentday=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* TemperaturesLgm=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* PrecipitationsPresentday=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* PrecipitationsLgm=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* tmp=xNew<IssmDouble>(NUM_VERTICES);
 	IssmDouble TdiffTime,PfacTime;
 	IssmDouble time,yts,time_yr;
@@ -2363,5 +2574,5 @@
 	Gauss* gauss=this->NewGauss();
 	for(int month=0;month<12;month++) {
-		for(int iv=0;iv<numvertices;iv++) {
+		for(int iv=0;iv<NUM_VERTICES;iv++) {
 			gauss->GaussVertex(iv);
 			input->GetInputValue(&TemperaturesPresentday[iv*12+month],gauss,month/12.*yts);
@@ -2380,5 +2591,5 @@
 
 	/*Compute the temperature and precipitation*/
-	for(int iv=0;iv<numvertices;iv++){
+	for(int iv=0;iv<NUM_VERTICES;iv++){
 		ComputeMungsmTemperaturePrecipitation(TdiffTime,PfacTime,
 					&PrecipitationsLgm[iv*12],&PrecipitationsPresentday[iv*12],
@@ -2391,5 +2602,5 @@
 	TransientInput* NewPrecipitationInput = new TransientInput(SmbPrecipitationEnum);
 	for (int imonth=0;imonth<12;imonth++) {
-		for(i=0;i<numvertices;i++) tmp[i]=monthlytemperatures[i*12+imonth];
+		for(i=0;i<NUM_VERTICES;i++) tmp[i]=monthlytemperatures[i*12+imonth];
 		switch(this->ObjectEnum()){
 			case TriaEnum:  NewTemperatureInput->AddTimeInput(new TriaInput(SmbMonthlytemperaturesEnum,&tmp[0],P1Enum),time_yr+imonth/12.*yts); break;
@@ -2398,5 +2609,5 @@
 			default: _error_("Not implemented yet");
 		}
-		for(i=0;i<numvertices;i++) tmp[i]=monthlyprec[i*12+imonth]/yts;
+		for(i=0;i<NUM_VERTICES;i++) tmp[i]=monthlyprec[i*12+imonth]/yts;
 		switch(this->ObjectEnum()){
 			case TriaEnum:  NewPrecipitationInput->AddTimeInput(new TriaInput(SmbPrecipitationEnum,&tmp[0],P1Enum),time_yr+imonth/12.*yts); break;
@@ -2446,20 +2657,299 @@
 }
 /*}}}*/
+void       Element::PicoUpdateBoxid(int* max_boxid_basin_list){/*{{{*/
+
+	if(!this->IsIceInElement() || !this->IsFloating()) return;
+
+	int        basin_id;
+	IssmDouble dist_gl,dist_cf;
+
+	inputs->GetInputValue(&basin_id,BasalforcingsPicoBasinIdEnum);
+	IssmDouble boxid_max=reCast<IssmDouble>(max_boxid_basin_list[basin_id])+1.;
+
+	Input* dist_gl_input=inputs->GetInput(DistanceToGroundinglineEnum); _assert_(dist_gl_input);
+	Input* dist_cf_input=inputs->GetInput(DistanceToCalvingfrontEnum);  _assert_(dist_cf_input);
+
+	/*Get dist_gl and dist_cf at center of element*/
+	Gauss* gauss=this->NewGauss(1); gauss->GaussPoint(0);
+	dist_gl_input->GetInputValue(&dist_gl,gauss);
+	dist_cf_input->GetInputValue(&dist_cf,gauss);
+	delete gauss;
+
+	/*Ensure values are positive for floating ice*/
+	dist_gl = fabs(dist_gl);
+	dist_cf = fabs(dist_cf);
+
+	/*Compute relative distance to grounding line*/
+	IssmDouble rel_dist_gl=dist_gl/(dist_gl+dist_cf);
+
+	/*Assign box numbers based on rel_dist_gl*/
+	int boxid = -1;
+	for(IssmDouble i=0.;i<boxid_max;i++){
+		IssmDouble lowbound  = 1. -sqrt((boxid_max-i   )/boxid_max);
+		IssmDouble highbound = 1. -sqrt((boxid_max-i-1.)/boxid_max);
+		if(rel_dist_gl>=lowbound && rel_dist_gl<=highbound){
+			boxid=reCast<int>(i);
+			break;
+		}
+	}
+	if(boxid==-1) _error_("No boxid found for element " << this->Sid() << "!");
+
+	this->inputs->AddInput(new IntInput(BasalforcingsPicoBoxIdEnum, boxid));
+
+}/*}}}*/
+void       Element::PicoUpdateBox(int loopboxid){/*{{{*/
+
+	if(!this->IsIceInElement() || !this->IsFloating()) return;
+
+	int boxid;
+	this->inputs->GetInputValue(&boxid,BasalforcingsPicoBoxIdEnum);
+	if(loopboxid!=boxid) return;
+
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+
+	int        basinid, maxbox, num_basins, numnodes, M;
+	IssmDouble gamma_T, overturning_coeff, thickness;
+	IssmDouble pressure, T_star,p_coeff, q_coeff;
+	bool       isplume;
+
+	/*Get variables*/
+	IssmDouble rhoi       = this->FindParam(MaterialsRhoIceEnum);
+	IssmDouble rhow       = this->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble earth_grav = this->FindParam(ConstantsGEnum);
+	IssmDouble rho_star   = 1033.;             // kg/m^3
+	IssmDouble nu         = rhoi/rhow;
+	IssmDouble latentheat = this->FindParam(MaterialsLatentheatEnum);
+	IssmDouble c_p_ocean  = this->FindParam(MaterialsMixedLayerCapacityEnum);
+	IssmDouble lambda     = latentheat/c_p_ocean;
+	IssmDouble a          = -0.0572;          // K/psu
+	IssmDouble b          = 0.0788 + this->FindParam(MaterialsMeltingpointEnum);  //K
+	IssmDouble c          = 7.77e-4;
+	IssmDouble alpha      = 7.5e-5;           // 1/K
+	IssmDouble Beta       = 7.7e-4;           // K
+
+	/* Get non-box-specific parameters and inputs */
+	this->parameters->FindParam(&num_basins, BasalforcingsPicoNumBasinsEnum);
+	this->parameters->FindParam(&gamma_T,BasalforcingsPicoGammaTEnum);
+	this->parameters->FindParam(&overturning_coeff,BasalforcingsPicoOverturningCoeffEnum);
+	this->parameters->FindParam(&maxbox,BasalforcingsPicoMaxboxcountEnum);
+	this->inputs->GetInputValue(&basinid,BasalforcingsPicoBasinIdEnum);
+	this->parameters->FindParam(&isplume, BasalforcingsPicoIsplumeEnum);
+	Input* thickness_input=this->GetInput(ThicknessEnum); _assert_(thickness_input);
+	_assert_(basinid<=num_basins);
+
+	IssmDouble* boxareas = NULL;
+	this->parameters->FindParam(&boxareas,&M,BasalforcingsPicoBoxAreaEnum);
+	_assert_(M==num_basins*maxbox);
+
+	IssmDouble area_boxi        = boxareas[basinid*maxbox+boxid];
+	IssmDouble g1               = area_boxi*gamma_T;
+
+	IssmDouble* basalmeltrates_shelf 				= xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* potential_pressure_melting_point	= xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* Tocs 								= xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* Socs								= xNew<IssmDouble>(NUM_VERTICES);
+
+	/* First box calculations */
+	if(boxid==0){
+		/* Get box1 parameters and inputs */
+		IssmDouble time, toc_farocean, soc_farocean;
+		this->parameters->FindParam(&time,TimeEnum);
+		this->parameters->FindParam(&toc_farocean, basinid, time, BasalforcingsPicoFarOceantemperatureEnum);
+		this->parameters->FindParam(&soc_farocean, basinid, time, BasalforcingsPicoFarOceansalinityEnum);
+		IssmDouble 	s1 				= soc_farocean/(nu*lambda);
+		IssmDouble* overturnings 	= xNew<IssmDouble>(NUM_VERTICES);
+
+		/* Start looping on the number of verticies and calculate ocean vars */
+		Gauss* gauss=this->NewGauss();
+		for(int i=0;i<NUM_VERTICES;i++){
+			gauss->GaussVertex(i);
+			thickness_input->GetInputValue(&thickness,gauss);
+			pressure = (rhoi*earth_grav*1e-4)*thickness;
+			T_star   = a*soc_farocean+b-c*pressure-toc_farocean;
+			p_coeff  = g1/(overturning_coeff*rho_star*(Beta*s1-alpha));
+			q_coeff  = T_star*(g1/(overturning_coeff*rho_star*(Beta*s1-alpha)));
+
+			/* To avoid negatives under the square root */
+			if((0.25*pow(p_coeff,2)-q_coeff)<0) q_coeff = 0.25*p_coeff*p_coeff;
+
+			Tocs[i] = toc_farocean-(-0.5*p_coeff+sqrt(0.25*pow(p_coeff,2)-q_coeff));
+			Socs[i] = soc_farocean-(soc_farocean/(nu*lambda))*(toc_farocean-Tocs[i]);
+			potential_pressure_melting_point[i] = a*Socs[i]+b-c*pressure;
+			if(!isplume) basalmeltrates_shelf[i] = (-gamma_T/(nu*lambda))*(potential_pressure_melting_point[i]-Tocs[i]);
+			overturnings[i] = overturning_coeff*rho_star*(Beta*(soc_farocean-Socs[i])-alpha*(toc_farocean-Tocs[i]));
+		}
+
+		if(!isplume) this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,basalmeltrates_shelf,P1Enum);
+		this->AddInput(BasalforcingsPicoSubShelfOceanTempEnum,Tocs,P1Enum);
+		this->AddInput(BasalforcingsPicoSubShelfOceanSalinityEnum,Socs,P1Enum);
+		this->AddInput(BasalforcingsPicoSubShelfOceanOverturningEnum,overturnings,P1Enum);
+
+		/*Cleanup and return*/
+		delete gauss;
+	}
+
+	/* Subsequent box calculations */
+	else {
+		/* Get subsequent box parameters and inputs */
+		IssmDouble* toc_weighted_avg         = NULL;
+		IssmDouble* soc_weighted_avg         = NULL;
+		IssmDouble* overturning_weighted_avg = NULL;
+		this->parameters->FindParam(&toc_weighted_avg,&num_basins,BasalforcingsPicoAverageTemperatureEnum);
+		this->parameters->FindParam(&soc_weighted_avg,&num_basins,BasalforcingsPicoAverageSalinityEnum);
+		this->parameters->FindParam(&overturning_weighted_avg,&num_basins,BasalforcingsPicoAverageOverturningEnum);
+		IssmDouble mean_toc                  = toc_weighted_avg[basinid];
+		IssmDouble mean_soc                  = soc_weighted_avg[basinid];
+		IssmDouble mean_overturning          = overturning_weighted_avg[basinid];
+		IssmDouble g2                        = g1/(nu*lambda);
+
+		/* Start looping on the number of verticies and calculate ocean vars */
+		Gauss* gauss=this->NewGauss();
+		for(int i=0;i<NUM_VERTICES;i++){
+			gauss->GaussVertex(i);
+			thickness_input->GetInputValue(&thickness,gauss);
+			pressure = (rhoi*earth_grav*1.e-4)*thickness;
+			T_star   = a*mean_soc+b-c*pressure-mean_toc;
+			Tocs[i]  = mean_toc+T_star*(g1/(mean_overturning+g1-g2*a*mean_soc));
+			Socs[i]  = mean_soc-mean_soc*((mean_toc-Tocs[i])/(nu*lambda));
+			potential_pressure_melting_point[i] = a*Socs[i]+b-c*pressure;
+			if(!isplume) basalmeltrates_shelf[i] = (-gamma_T/(nu*lambda))*(potential_pressure_melting_point[i]-Tocs[i]);
+		}
+
+		if(!isplume) this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,basalmeltrates_shelf,P1Enum);
+		this->AddInput(BasalforcingsPicoSubShelfOceanTempEnum,Tocs,P1Enum);
+		this->AddInput(BasalforcingsPicoSubShelfOceanSalinityEnum,Socs,P1Enum);
+
+		/*Cleanup and return*/
+		xDelete<IssmDouble>(toc_weighted_avg);
+		xDelete<IssmDouble>(soc_weighted_avg);
+		xDelete<IssmDouble>(overturning_weighted_avg);
+		delete gauss;
+	}
+
+	/*Cleanup and return*/
+	xDelete<IssmDouble>(boxareas);
+
+}/*}}}*/
+void       Element::PicoComputeBasalMelt(){/*{{{*/
+
+	if(!this->IsIceInElement() || !this->IsFloating()) return;
+
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+
+	IssmDouble E0, Cd, CdT, YT, lam1, lam2, lam3, M0, CdTS0, y1, y2, x0;
+	IssmDouble Tf_gl, YTS, CdTS, G1, G2, G3, g_alpha, M, l, X_hat, M_hat;
+	IssmDouble alpha, zgl, Toc, Soc, z_base, yts, slopex, slopey;
+
+	/*Get variables*/
+	E0    = 3.6e-2;        //Entrainment coefficient
+	Cd    = 2.5e-3;        //Drag coefficient
+	CdT   = 1.1e-3;        //Turbulent heat exchange coefficient
+	YT    = CdT/sqrt(Cd);  //Heat exchange coefficient
+	lam1  = -5.73e-2;      //Freezing point-salinity coefficient (degrees C)
+	lam2  = 8.32e-2;       //Freezing point offset (degrees C)
+	lam3  = 7.61e-4;       //Freezing point-depth coefficient (K m-1)
+	M0    = 10.;           //Melt-rate parameter (m yr-1 C-2)
+	CdTS0 = 6e-4;          //Heat exchange parameter
+	y1    = 0.545;         //Heat exchange parameter
+	y2    = 3.5e-5;        //Heat exchange parameter
+	x0    = 0.56;          //Dimentionless scaling factor
+
+	/*Define arrays*/
+	IssmDouble* basalmeltrates_shelf = xNew<IssmDouble>(NUM_VERTICES); //Basal melt-rate
+
+	/*Polynomial coefficients*/
+	IssmDouble p[12];
+	p[0]  =  0.1371330075095435;
+	p[1]  =  5.527656234709359E1;
+	p[2]  = -8.951812433987858E2;
+	p[3]  =  8.927093637594877E3;
+	p[4]  = -5.563863123811898E4;
+	p[5]  =  2.218596970948727E5;
+	p[6]  = -5.820015295669482E5;
+	p[7]  =  1.015475347943186E6;
+	p[8]  = -1.166290429178556E6;
+	p[9]  =  8.466870335320488E5;
+	p[10] = -3.520598035764990E5;
+	p[11] =  6.387953795485420E4;
+
+	/*Get inputs*/
+	Input* zgl_input            = this->GetInput(GroundinglineHeightEnum);                     _assert_(zgl_input);
+	Input* toc_input            = this->GetInput(BasalforcingsPicoSubShelfOceanTempEnum);      _assert_(toc_input);
+	Input* soc_input            = this->GetInput(BasalforcingsPicoSubShelfOceanSalinityEnum);  _assert_(soc_input);
+	Input* base_input           = this->GetInput(BaseEnum);                                    _assert_(base_input);
+	Input* baseslopex_input     = this->GetInput(BaseSlopeXEnum);                              _assert_(baseslopex_input);
+	Input* baseslopey_input     = this->GetInput(BaseSlopeYEnum);                              _assert_(baseslopey_input);
+	this->FindParam(&yts, ConstantsYtsEnum);
+
+	/*Loop over the number of vertices in this element*/
+	Gauss* gauss=this->NewGauss();
+	for(int i=0;i<NUM_VERTICES;i++){
+		gauss->GaussVertex(i);
+
+		/*Get inputs*/
+		zgl_input->GetInputValue(&zgl,gauss);
+		toc_input->GetInputValue(&Toc,gauss); //(K)
+		soc_input->GetInputValue(&Soc,gauss);
+		base_input->GetInputValue(&z_base,gauss);
+		baseslopex_input->GetInputValue(&slopex,gauss);
+		baseslopey_input->GetInputValue(&slopey,gauss);
+
+		/*Compute ice shelf base slope (radians)*/
+		alpha = atan(sqrt(slopex*slopex + slopey*slopey));
+		if(alpha>=M_PI) alpha = M_PI - 0.001;               //ensure sin(alpha) > 0 for meltrate calculations
+
+		/*Make necessary conversions*/
+		Toc = Toc-273.15;
+		if(zgl>z_base) zgl=z_base;
+
+		/*Low bound for Toc to ensure X_hat is between 0 and 1*/
+		if(Toc<lam1*Soc+lam2) Toc=lam1*Soc+lam2;
+
+		/*Compute parameters needed for melt-rate calculation*/
+		Tf_gl = lam1*Soc+lam2+lam3*zgl;                                              //Characteristic freezing point
+		YTS = YT*(y1+y2*(((Toc-Tf_gl)*E0*sin(alpha))/(lam3*(CdTS0+E0*sin(alpha))))); //Effective heat exchange coefficient
+		CdTS = sqrt(Cd)*YTS;                                                         //Heat exchange coefficient
+		G1 = sqrt(sin(alpha)/(Cd+E0*sin(alpha)));                                    //Geometric factor
+		G2 = sqrt(CdTS/(CdTS+E0*sin(alpha)));                                        //Geometric factor
+		G3 = (E0*sin(alpha))/(CdTS+E0*sin(alpha));                                   //Geometric factor
+		g_alpha = G1*G2*G3;                                                          //Melt scaling factor
+		M = M0*g_alpha*pow((Toc-Tf_gl),2);                                           //Melt-rate scale
+		l = ((Toc-Tf_gl)*(x0*CdTS+E0*sin(alpha)))/(lam3*x0*(CdTS+E0*sin(alpha)));    //Length scale
+		X_hat = (z_base-zgl)/l;                                                      //Dimentionless coordinate system
+
+		/*Compute polynomial fit*/
+		M_hat = 0.;                                                                  //Reset summation variable for each node
+		for(int ii=0;ii<12;ii++) {
+			M_hat += p[ii]*pow(X_hat,ii);                                               //Polynomial fit
+		}
+
+		/*Compute melt-rate*/
+		basalmeltrates_shelf[i] = (M*M_hat)/yts;                                     //Basal melt-rate (m/s)
+	}
+
+	/*Save computed melt-rate*/
+	this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,basalmeltrates_shelf,P1Enum);
+
+	/*Cleanup and return*/
+	delete gauss;
+
+}/*}}}*/
 void       Element::PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm,bool ismungsm,bool issetpddfac){/*{{{*/
 
-	int  numvertices = this->GetNumberOfVertices();
-
-	int        i;
-	IssmDouble* agd=xNew<IssmDouble>(numvertices); // surface mass balance
-	IssmDouble* melt=xNew<IssmDouble>(numvertices); // surface mass balance
-	IssmDouble* accu=xNew<IssmDouble>(numvertices); // surface mass balance
-	IssmDouble* monthlytemperatures=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* monthlyprec=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* yearlytemperatures=xNew<IssmDouble>(numvertices); memset(yearlytemperatures, 0., numvertices*sizeof(IssmDouble));
-	IssmDouble* tmp=xNew<IssmDouble>(numvertices);
-	IssmDouble* h=xNew<IssmDouble>(numvertices);
-	IssmDouble* s=xNew<IssmDouble>(numvertices);
-	IssmDouble* s0p=xNew<IssmDouble>(numvertices);
-	IssmDouble* s0t=xNew<IssmDouble>(numvertices);
+	const int NUM_VERTICES 		= this->GetNumberOfVertices();
+	const int NUM_VERTICES_MONTHS_PER_YEAR = NUM_VERTICES * 12;
+
+	int  		i;
+	IssmDouble* agd=xNew<IssmDouble>(NUM_VERTICES); // surface mass balance
+	IssmDouble* melt=xNew<IssmDouble>(NUM_VERTICES); // surface mass balance
+	IssmDouble* accu=xNew<IssmDouble>(NUM_VERTICES); // surface mass balance
+	IssmDouble* monthlytemperatures=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* monthlyprec=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* yearlytemperatures=xNew<IssmDouble>(NUM_VERTICES); memset(yearlytemperatures, 0., NUM_VERTICES*sizeof(IssmDouble));
+	IssmDouble* tmp=xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* h=xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* s=xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* s0p=xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* s0t=xNew<IssmDouble>(NUM_VERTICES);
 	IssmDouble pddsnowfac = -1.;
 	IssmDouble pddicefac = -1.;
@@ -2469,11 +2959,11 @@
 
 	/*Get material parameters :*/
-	rho_water=this->matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	rho_ice=this->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_water=this->FindParam(MaterialsRhoSeawaterEnum);
+	rho_ice=this->FindParam(MaterialsRhoIceEnum);
 
 	/*Get some pdd parameters*/
-	desfac=this->matpar->GetMaterialParameter(SmbDesfacEnum);
-	rlaps=this->matpar->GetMaterialParameter(SmbRlapsEnum);
-	rlapslgm=this->matpar->GetMaterialParameter(SmbRlapslgmEnum);
+	desfac=this->FindParam(SmbDesfacEnum);
+	rlaps=this->FindParam(SmbRlapsEnum);
+	rlapslgm=this->FindParam(SmbRlapslgmEnum);
 
 	/*Recover monthly temperatures and precipitation and compute the yearly mean temperatures*/
@@ -2488,5 +2978,5 @@
 	Gauss* gauss=this->NewGauss();
 	for(int month=0;month<12;month++) {
-		for(int iv=0;iv<numvertices;iv++) {
+		for(int iv=0;iv<NUM_VERTICES;iv++) {
 			gauss->GaussVertex(iv);
 			input->GetInputValue(&monthlytemperatures[iv*12+month],gauss,time_yr+month/12.*yts);
@@ -2525,10 +3015,12 @@
 
 	/*measure the surface mass balance*/
-	for (int iv = 0; iv<numvertices; iv++){
+	for (int iv = 0; iv<NUM_VERTICES; iv++){
 		gauss->GaussVertex(iv);
-		pddsnowfac=-1.;
-		pddicefac=-1.;
-		input->GetInputValue(&pddsnowfac,gauss);
-		input2->GetInputValue(&pddicefac,gauss);
+		pddsnowfac=0.;
+		pddicefac=0.;
+		if(issetpddfac==1){
+			input->GetInputValue(&pddsnowfac,gauss);
+			input2->GetInputValue(&pddicefac,gauss);
+		}
 		agd[iv]=PddSurfaceMassBalance(&monthlytemperatures[iv*12], &monthlyprec[iv*12],
 					pdds, pds, &melt[iv], &accu[iv], signorm, yts, h[iv], s[iv],
@@ -2545,9 +3037,9 @@
 	// TransientInput* NewPrecipitationInput = new TransientInput(SmbPrecipitationEnum);
 	// for (int imonth=0;imonth<12;imonth++) {
-	//   for(i=0;i<numvertices;i++) tmp[i]=monthlytemperatures[i*12+imonth];
+	//   for(i=0;i<NUM_VERTICES;i++) tmp[i]=monthlytemperatures[i*12+imonth];
 	//   TriaInput* newmonthinput1 = new TriaInput(SmbMonthlytemperaturesEnum,&tmp[0],P1Enum);
 	//   NewTemperatureInput->AddTimeInput(newmonthinput1,time+imonth/12.*yts);
 	//
-	//   for(i=0;i<numvertices;i++) tmp[i]=monthlyprec[i*12+imonth]/yts;
+	//   for(i=0;i<NUM_VERTICES;i++) tmp[i]=monthlyprec[i*12+imonth]/yts;
 	//   TriaInput* newmonthinput2 = new TriaInput(SmbPrecipitationEnum,&tmp[0],P1Enum);
 	//   NewPrecipitationInput->AddTimeInput(newmonthinput2,time+imonth/12.*yts);
@@ -2635,20 +3127,21 @@
 	/* General FIXMEs: get Tmelting point, pddicefactor, pddsnowfactor, sigma from parameters/user input */
 
-	int  numvertices = this->GetNumberOfVertices();
-
-	int        i;
-	IssmDouble* smb=xNew<IssmDouble>(numvertices);		// surface mass balance
-	IssmDouble* melt=xNew<IssmDouble>(numvertices);		// melting comp. of surface mass balance
-	IssmDouble* accu=xNew<IssmDouble>(numvertices);		// accuumulation comp. of surface mass balance
-	IssmDouble* melt_star=xNew<IssmDouble>(numvertices);
-	IssmDouble* monthlytemperatures=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* monthlyprec=xNew<IssmDouble>(12*numvertices);
-	IssmDouble* yearlytemperatures=xNew<IssmDouble>(numvertices); memset(yearlytemperatures, 0., numvertices*sizeof(IssmDouble));
-	IssmDouble* s=xNew<IssmDouble>(numvertices);			// actual surface height
-	IssmDouble* s0p=xNew<IssmDouble>(numvertices);		// reference elevation for precip.
-	IssmDouble* s0t=xNew<IssmDouble>(numvertices);		// reference elevation for temperature
-	IssmDouble* smbcorr=xNew<IssmDouble>(numvertices); // surface mass balance correction; will be added after pdd call
-	IssmDouble* p_ampl=xNew<IssmDouble>(numvertices);	// precip anomaly
-	IssmDouble* t_ampl=xNew<IssmDouble>(numvertices);	// remperature anomaly
+	const int NUM_VERTICES 		= this->GetNumberOfVertices();
+	const int NUM_VERTICES_MONTHS_PER_YEAR	= NUM_VERTICES * 12;
+
+	int        	i;
+	IssmDouble* smb=xNew<IssmDouble>(NUM_VERTICES);		// surface mass balance
+	IssmDouble* melt=xNew<IssmDouble>(NUM_VERTICES);		// melting comp. of surface mass balance
+	IssmDouble* accu=xNew<IssmDouble>(NUM_VERTICES);		// accuumulation comp. of surface mass balance
+	IssmDouble* melt_star=xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* monthlytemperatures=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* monthlyprec=xNew<IssmDouble>(NUM_VERTICES_MONTHS_PER_YEAR);
+	IssmDouble* yearlytemperatures=xNew<IssmDouble>(NUM_VERTICES); memset(yearlytemperatures, 0., NUM_VERTICES*sizeof(IssmDouble));
+	IssmDouble* s=xNew<IssmDouble>(NUM_VERTICES);			// actual surface height
+	IssmDouble* s0p=xNew<IssmDouble>(NUM_VERTICES);		// reference elevation for precip.
+	IssmDouble* s0t=xNew<IssmDouble>(NUM_VERTICES);		// reference elevation for temperature
+	IssmDouble* smbcorr=xNew<IssmDouble>(NUM_VERTICES); // surface mass balance correction; will be added after pdd call
+	IssmDouble* p_ampl=xNew<IssmDouble>(NUM_VERTICES);	// precip anomaly
+	IssmDouble* t_ampl=xNew<IssmDouble>(NUM_VERTICES);	// remperature anomaly
 	IssmDouble rho_water,rho_ice,desfac,rlaps;
 	IssmDouble inv_twelve=1./12.;								//factor for monthly average
@@ -2656,10 +3149,10 @@
 
 	/*Get material parameters :*/
-	rho_water=this->matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	rho_ice=this->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_water=this->FindParam(MaterialsRhoSeawaterEnum);
+	rho_ice=this->FindParam(MaterialsRhoIceEnum);
 
 	/*Get parameters for height corrections*/
-	desfac=this->matpar->GetMaterialParameter(SmbDesfacEnum);
-	rlaps=this->matpar->GetMaterialParameter(SmbRlapsEnum);
+	desfac=this->FindParam(SmbDesfacEnum);
+	rlaps=this->FindParam(SmbRlapsEnum);
 
 	/*Recover monthly temperatures and precipitation*/
@@ -2681,5 +3174,5 @@
 	Gauss* gauss=this->NewGauss();
 	for(int month=0;month<12;month++){
-		for(int iv=0;iv<numvertices;iv++){
+		for(int iv=0;iv<NUM_VERTICES;iv++){
 			gauss->GaussVertex(iv);
 			input->GetInputValue(&monthlytemperatures[iv*12+month],gauss,(month+1)/12.*yts);
@@ -2699,5 +3192,5 @@
 
 	/*measure the surface mass balance*/
-	for (int iv = 0; iv<numvertices; iv++){
+	for (int iv = 0; iv<NUM_VERTICES; iv++){
 		smb[iv]=PddSurfaceMassBalanceSicopolis(&monthlytemperatures[iv*12], &monthlyprec[iv*12],
 					&melt[iv], &accu[iv], &melt_star[iv], &t_ampl[iv], &p_ampl[iv], yts, s[iv],
@@ -2796,13 +3289,10 @@
 }
 /*}}}*/
-IssmDouble Element::PureIceEnthalpy(IssmDouble pressure){/*{{{*/
-	return this->matpar->PureIceEnthalpy(pressure);
-}/*}}}*/
 void       Element::ResultInterpolation(int* pinterpolation,int* pnodesperelement,int* parray_size, int output_enum){/*{{{*/
 
 	/*Some intputs need to be computed, even if they are already in inputs, they might not be up to date!*/
 	switch(output_enum){
-	case ViscousHeatingEnum: this->ViscousHeatingCreateInput(); break;
-	case StressMaxPrincipalEnum: this->StressMaxPrincipalCreateInput(); break;
+		case ViscousHeatingEnum: this->ViscousHeatingCreateInput(); break;
+		case StressMaxPrincipalEnum: this->StressMaxPrincipalCreateInput(); break;
 		case StressTensorxxEnum:
 		case StressTensorxyEnum:
@@ -2817,5 +3307,5 @@
 		case StrainRateyzEnum:
 		case StrainRatezzEnum:
-	  case StrainRateeffectiveEnum: this->ComputeStrainRate(); break;
+		case StrainRateeffectiveEnum: this->ComputeStrainRate(); break;
 		case DeviatoricStressxxEnum:
 		case DeviatoricStressxyEnum:
@@ -2824,4 +3314,6 @@
 		case DeviatoricStressyzEnum:
 		case DeviatoricStresszzEnum:
+		case DeviatoricStress1Enum:
+		case DeviatoricStress2Enum:
 		case DeviatoricStresseffectiveEnum: this->ComputeDeviatoricStressTensor(); break;
 		case EsaStrainratexxEnum:
@@ -2836,26 +3328,28 @@
 		case CalvingrateyEnum:
 		case CalvingCalvingrateEnum:
-			this->StrainRateparallel();
-			this->StrainRateperpendicular();
-			int calvinglaw;
-			this->FindParam(&calvinglaw,CalvingLawEnum);
-			switch(calvinglaw){
-				case DefaultCalvingEnum:
-					//do nothing
-					break;
-				case CalvingLevermannEnum:
-					this->CalvingRateLevermann();
-					break;
-				case CalvingVonmisesEnum:
-				case CalvingDev2Enum:
-					this->CalvingRateVonmises();
-					break;
-				case CalvingCrevasseDepthEnum:
-					this->CalvingCrevasseDepth();
-					break;
-				default:
-					_error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
-			}
-			break;
+												  this->StrainRateparallel();
+												  this->StrainRateperpendicular();
+												  int calvinglaw;
+												  this->FindParam(&calvinglaw,CalvingLawEnum);
+												  switch(calvinglaw){
+													  case DefaultCalvingEnum:
+														  //do nothing
+														  break;
+													  case CalvingLevermannEnum:
+														  this->CalvingRateLevermann();
+														  break;
+													  case CalvingVonmisesEnum:
+													  case CalvingDev2Enum:
+														  this->CalvingRateVonmises();
+														  break;
+													  case CalvingCrevasseDepthEnum:
+														  this->CalvingCrevasseDepth();
+														  break;
+													  default:
+														  _error_("Calving law "<<EnumToStringx(calvinglaw)<<" not supported yet");
+												  }
+												  break;
+		case CalvingFluxLevelsetEnum: this->CalvingFluxLevelset(); break;
+		case CalvingMeltingFluxLevelsetEnum: this->CalvingMeltingFluxLevelset(); break;
 		case StrainRateparallelEnum: this->StrainRateparallel(); break;
 		case StrainRateperpendicularEnum: this->StrainRateperpendicular(); break;
@@ -2898,41 +3392,42 @@
 	switch(input->GetResultInterpolation()){
 		case P0Enum:{
-			IssmDouble  value;
-			bool        bvalue;
-			Input*      input = this->GetInput(output_enum); _assert_(input);
-			switch(input->ObjectEnum()){
-				case DoubleInputEnum:
-					input->GetInputValue(&value);
-					break;
-				case BoolInputEnum:
-					input->GetInputValue(&bvalue);
-					value=reCast<IssmDouble>(bvalue);
-					break;
-				default:
-					Gauss* gauss = this->NewGauss();
-					input->GetInputValue(&value,gauss);
-					delete gauss;
-			}
-			vector->SetValue(this->Sid(),value,INS_VAL);
-			break;
-		}
+							IssmDouble  value;
+							bool        bvalue;
+							Input*      input = this->GetInput(output_enum); _assert_(input);
+							switch(input->ObjectEnum()){
+								case DoubleInputEnum:
+									input->GetInputValue(&value);
+									break;
+								case BoolInputEnum:
+									input->GetInputValue(&bvalue);
+									value=reCast<IssmDouble>(bvalue);
+									break;
+								default:
+									Gauss* gauss = this->NewGauss();
+									input->GetInputValue(&value,gauss);
+									delete gauss;
+							}
+							vector->SetValue(this->Sid(),value,INS_VAL);
+							break;
+						}
 		case P1Enum:{
-			int         numvertices = this->GetNumberOfVertices();
-			IssmDouble *values      = xNew<IssmDouble>(numvertices);
-			int        *connectivity= xNew<int>(numvertices);
-			int        *sidlist     = xNew<int>(numvertices);
-
-			this->GetVerticesSidList(sidlist);
-			this->GetVerticesConnectivityList(connectivity);
-			this->GetInputListOnVertices(values,output_enum);
-			for(int i=0;i<numvertices;i++) values[i] = values[i]/reCast<IssmDouble>(connectivity[i]);
-
-			vector->SetValues(numvertices,sidlist,values,ADD_VAL);
-
-			xDelete<IssmDouble>(values);
-			xDelete<int>(connectivity);
-			xDelete<int>(sidlist);
-			break;
-		}
+							const int NUM_VERTICES = this->GetNumberOfVertices();
+
+							IssmDouble *values      = xNew<IssmDouble>(NUM_VERTICES);
+							int        *connectivity= xNew<int>(NUM_VERTICES);
+							int        *sidlist     = xNew<int>(NUM_VERTICES);
+
+							this->GetVerticesSidList(sidlist);
+							this->GetVerticesConnectivityList(connectivity);
+							this->GetInputListOnVertices(values,output_enum);
+							for(int i=0;i<NUM_VERTICES;i++) values[i] = values[i]/reCast<IssmDouble>(connectivity[i]);
+
+							vector->SetValues(NUM_VERTICES,sidlist,values,ADD_VAL);
+
+							xDelete<IssmDouble>(values);
+							xDelete<int>(connectivity);
+							xDelete<int>(sidlist);
+							break;
+						}
 		default:
 					 _error_("interpolation "<<EnumToStringx(input->GetResultInterpolation())<<" not supported yet");
@@ -2963,5 +3458,5 @@
 			switch(set2_enum){
 				case FsetEnum:
-					if(nodes[i]->indexing.fsize){
+					if(nodes[i]->fsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -2971,5 +3466,5 @@
 					break;
 				case GsetEnum:
-					if(nodes[i]->indexing.gsize){
+					if(nodes[i]->gsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -2979,5 +3474,5 @@
 					break;
 				case SsetEnum:
-					if(nodes[i]->indexing.ssize){
+					if(nodes[i]->ssize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -3009,4 +3504,143 @@
 }
 /*}}}*/
+#ifdef _HAVE_SEMIC_
+void       Element::SmbSemic(){/*{{{*/
+
+	/*only compute SMB at the surface: */
+	if (!IsOnSurface()) return;
+
+	const int NUM_VERTICES 					= this->GetNumberOfVertices();
+	const int NUM_VERTICES_DAYS_PER_YEAR 	= NUM_VERTICES * 365;
+
+	IssmDouble* s=xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* s0gcm=xNew<IssmDouble>(NUM_VERTICES);
+	IssmDouble* st=xNew<IssmDouble>(NUM_VERTICES);
+
+	// daily forcing inputs
+	IssmDouble* dailyrainfall=xNew<IssmDouble>(NUM_VERTICES_DAYS_PER_YEAR);
+	IssmDouble* dailysnowfall=xNew<IssmDouble>(NUM_VERTICES_DAYS_PER_YEAR);
+	IssmDouble* dailydlradiation=xNew<IssmDouble>(NUM_VERTICES_DAYS_PER_YEAR);
+	IssmDouble* dailydsradiation=xNew<IssmDouble>(NUM_VERTICES_DAYS_PER_YEAR);
+	IssmDouble* dailywindspeed=xNew<IssmDouble>(NUM_VERTICES_DAYS_PER_YEAR);
+	IssmDouble* dailypressure=xNew<IssmDouble>(NUM_VERTICES_DAYS_PER_YEAR);
+	IssmDouble* dailyairdensity=xNew<IssmDouble>(NUM_VERTICES_DAYS_PER_YEAR);
+	IssmDouble* dailyairhumidity=xNew<IssmDouble>(NUM_VERTICES_DAYS_PER_YEAR);
+	IssmDouble* dailytemperature=xNew<IssmDouble>(NUM_VERTICES_DAYS_PER_YEAR);
+	// daily outputs
+	IssmDouble* tsurf_out=xNew<IssmDouble>(NUM_VERTICES); memset(tsurf_out, 0., NUM_VERTICES*sizeof(IssmDouble));
+	IssmDouble* smb_out=xNew<IssmDouble>(NUM_VERTICES); memset(smb_out, 0., NUM_VERTICES*sizeof(IssmDouble));
+	IssmDouble* saccu_out=xNew<IssmDouble>(NUM_VERTICES); memset(saccu_out, 0., NUM_VERTICES*sizeof(IssmDouble));
+	IssmDouble* smelt_out=xNew<IssmDouble>(NUM_VERTICES); memset(smelt_out, 0., NUM_VERTICES*sizeof(IssmDouble));
+
+	IssmDouble rho_water,rho_ice,desfac,rlaps,rdl;
+	IssmDouble time,yts,time_yr;
+
+	/* Get time: */
+	this->parameters->FindParam(&time,TimeEnum);
+	this->parameters->FindParam(&yts,ConstantsYtsEnum);
+	time_yr=floor(time/yts)*yts;
+
+	/*Get material parameters :*/
+	rho_water=this->FindParam(MaterialsRhoSeawaterEnum);
+	rho_ice=this->FindParam(MaterialsRhoIceEnum);
+	desfac=this->FindParam(SmbDesfacEnum);
+	rlaps=this->FindParam(SmbRlapsEnum);
+	rdl=this->FindParam(SmbRdlEnum);
+
+	/* Retrieve inputs: */
+	Input* dailysnowfall_input=this->GetInput(SmbDailysnowfallEnum); _assert_(dailysnowfall_input);
+	Input* dailyrainfall_input=this->GetInput(SmbDailyrainfallEnum); _assert_(dailyrainfall_input);
+	Input* dailydlradiation_input=this->GetInput(SmbDailydlradiationEnum); _assert_(dailydlradiation_input);
+	Input* dailydsradiation_input=this->GetInput(SmbDailydsradiationEnum); _assert_(dailydsradiation_input);
+	Input* dailywindspeed_input=this->GetInput(SmbDailywindspeedEnum); _assert_(dailywindspeed_input);
+	Input* dailypressure_input=this->GetInput(SmbDailypressureEnum); _assert_(dailypressure_input);
+	Input* dailyairdensity_input=this->GetInput(SmbDailyairdensityEnum); _assert_(dailyairdensity_input);
+	Input* dailyairhumidity_input=this->GetInput(SmbDailyairhumidityEnum); _assert_(dailyairhumidity_input);
+	Input* dailytemperature_input=this->GetInput(SmbDailytemperatureEnum); _assert_(dailytemperature_input);
+
+	/* Recover info at the vertices: */
+	GetInputListOnVertices(&s[0],SurfaceEnum);
+	GetInputListOnVertices(&s0gcm[0],SmbS0gcmEnum);
+
+	/* loop over vertices and days */ //FIXME account for leap years (365 -> 366)
+	Gauss* gauss=this->NewGauss();
+	for (int iday = 0; iday < 365; iday++){
+		for(int iv=0;iv<NUM_VERTICES;iv++) {
+			gauss->GaussVertex(iv);
+			/* get forcing */
+			dailyrainfall_input->GetInputValue(&dailyrainfall[iv*365+iday],gauss,time_yr+(iday+1)/365.*yts);
+			dailysnowfall_input->GetInputValue(&dailysnowfall[iv*365+iday],gauss,time_yr+(iday+1)/365.*yts);
+			dailydlradiation_input->GetInputValue(&dailydlradiation[iv*365+iday],gauss,time_yr+(iday+1)/365.*yts);
+			dailydsradiation_input->GetInputValue(&dailydsradiation[iv*365+iday],gauss,time_yr+(iday+1)/365.*yts);
+			dailywindspeed_input->GetInputValue(&dailywindspeed[iv*365+iday],gauss,time_yr+(iday+1)/365.*yts);
+			dailypressure_input->GetInputValue(&dailypressure[iv*365+iday],gauss,time_yr+(iday+1)/365.*yts);
+			dailyairdensity_input->GetInputValue(&dailyairdensity[iv*365+iday],gauss,time_yr+(iday+1)/365.*yts);
+			dailyairhumidity_input->GetInputValue(&dailyairhumidity[iv*365+iday],gauss,time_yr+(iday+1)/365.*yts);
+			dailytemperature_input->GetInputValue(&dailytemperature[iv*365+iday],gauss,time_yr+(iday+1)/365.*yts);
+
+			/* Surface temperature correction */
+			st[iv]=(s[iv]-s0gcm[iv])/1000.;
+			dailytemperature[iv*365+iday]=dailytemperature[iv*365+iday]-rlaps *st[iv];
+
+			/* Precipitation correction (Vizcaino et al. 2010) */
+			if (s0gcm[iv] < 2000.0) {
+				dailysnowfall[iv*365+iday] = dailysnowfall[iv*365+iday]*exp(desfac*(max(s[iv],2000.0)-2000.0));
+				dailyrainfall[iv*365+iday] = dailyrainfall[iv*365+iday]*exp(desfac*(max(s[iv],2000.0)-2000.0));
+			}else{
+				dailysnowfall[iv*365+iday] = dailysnowfall[iv*365+iday]*exp(desfac*(max(s[iv],2000.0)-s0gcm[iv]));
+				dailyrainfall[iv*365+iday] = dailyrainfall[iv*365+iday]*exp(desfac*(max(s[iv],2000.0)-s0gcm[iv]));
+			}
+
+			/* downward longwave radiation correction (Marty et al. 2002) */
+			st[iv]=(s[iv]-s0gcm[iv])/1000.;
+			dailydlradiation[iv*365+iday]=dailydlradiation[iv*365+iday]+rdl*st[iv];
+		}
+	}
+
+	for (int iv = 0; iv<NUM_VERTICES; iv++){
+		/* call semic */
+		run_semic_(&dailysnowfall[iv*365], &dailyrainfall[iv*365], &dailydsradiation[iv*365], &dailydlradiation[iv*365],
+					&dailywindspeed[iv*365], &dailypressure[iv*365], &dailyairdensity[iv*365], &dailyairhumidity[iv*365], &dailytemperature[iv*365],
+					&tsurf_out[iv], &smb_out[iv], &saccu_out[iv], &smelt_out[iv]);
+	}
+
+	switch(this->ObjectEnum()){
+		case TriaEnum:
+			this->inputs->AddInput(new TriaInput(TemperatureSEMICEnum,&tsurf_out[0],P1Enum)); // TODO add TemperatureSEMICEnum to EnumDefinitions
+			this->inputs->AddInput(new TriaInput(SmbMassBalanceEnum,&smb_out[0],P1Enum));
+			this->inputs->AddInput(new TriaInput(SmbAccumulationEnum,&saccu_out[0],P1Enum));
+			this->inputs->AddInput(new TriaInput(SmbMeltEnum,&smelt_out[0],P1Enum));
+			break;
+		case PentaEnum:
+			// TODO
+			break;
+		case TetraEnum:
+			// TODO
+			break;
+		default: _error_("Not implemented yet");
+	}
+
+	/*clean-up*/
+	delete gauss;
+	xDelete<IssmDouble>(dailysnowfall);
+	xDelete<IssmDouble>(dailyrainfall);
+	xDelete<IssmDouble>(dailydlradiation);
+	xDelete<IssmDouble>(dailydsradiation);
+	xDelete<IssmDouble>(dailywindspeed);
+	xDelete<IssmDouble>(dailypressure);
+	xDelete<IssmDouble>(dailyairdensity);
+	xDelete<IssmDouble>(dailyairhumidity);
+	xDelete<IssmDouble>(dailypressure);
+	xDelete<IssmDouble>(dailytemperature);
+	xDelete<IssmDouble>(smb_out);
+	xDelete<IssmDouble>(smelt_out);
+	xDelete<IssmDouble>(saccu_out);
+	xDelete<IssmDouble>(tsurf_out);
+	xDelete<IssmDouble>(s);
+	xDelete<IssmDouble>(st);
+	xDelete<IssmDouble>(s0gcm);
+}
+/*}}}*/
+#endif // _HAVE_SEMIC_
 int        Element::Sid(){/*{{{*/
 
@@ -3026,8 +3660,10 @@
 	IssmDouble dzMin=0.0;
 	IssmDouble Tmean=0.0;
+	IssmDouble Vmean=0.0;
 	IssmDouble C=0.0;
 	IssmDouble Tz,Vz=0.0;
 	IssmDouble rho_ice, rho_water,aSnow,aIce;
-	IssmDouble time,dt;
+	IssmDouble time,dt,starttime,finaltime;
+	IssmDouble timeclim=0.0;
 	IssmDouble t,smb_dt;
 	IssmDouble yts;
@@ -3043,9 +3679,7 @@
 	int        aIdx=0;
 	int        denIdx=0;
+	int        dsnowIdx=0;
 	int        swIdx=0;
 	IssmDouble cldFrac,t0wet, t0dry, K;
-	IssmDouble ulw=0.0;
-	IssmDouble netSW=0.0;
-	IssmDouble netLW=0.0;
 	IssmDouble lhf=0.0;
 	IssmDouble shf=0.0;
@@ -3063,7 +3697,10 @@
 	IssmDouble dMass=0.0;
 	bool isgraingrowth,isalbedo,isshortwave,isthermal,isaccumulation,ismelt,isdensification,isturbulentflux;
+	bool isclimatology=false;
 	IssmDouble init_scaling=0.0;
 	IssmDouble thermo_scaling=1.0;
 	IssmDouble adThresh=1023.0;
+	int offsetend=-1;
+	IssmDouble time0, timeend, delta;
 
 	/*}}}*/
@@ -3075,4 +3712,10 @@
 	IssmDouble* gsp = NULL;
 	IssmDouble  EC = 0.0;
+	IssmDouble  ulw = 0.0;
+	IssmDouble  netSW=0.0;
+	IssmDouble  netLW=0.0;
+	IssmDouble  meanULW=0.0;
+	IssmDouble  meanLHF=0.0;
+	IssmDouble  meanSHF=0.0;
 	IssmDouble* W = NULL;
 	IssmDouble* a = NULL;
@@ -3102,6 +3745,6 @@
 
 	/*Retrieve material properties and parameters:{{{ */
-	rho_ice = matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_water = matpar->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
+	rho_ice = FindParam(MaterialsRhoIceEnum);
+	rho_water = FindParam(MaterialsRhoFreshwaterEnum);
 	parameters->FindParam(&aSnow,SmbASnowEnum);
 	parameters->FindParam(&aIce,SmbAIceEnum);
@@ -3109,12 +3752,16 @@
 	parameters->FindParam(&dt,TimesteppingTimeStepEnum);          /*transient core time step*/
 	parameters->FindParam(&yts,ConstantsYtsEnum);
+	parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+	parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
 	parameters->FindParam(&smb_dt,SmbDtEnum);                     /*time period for the smb solution,  usually smaller than the glaciological dt*/
 	parameters->FindParam(&aIdx,SmbAIdxEnum);
 	parameters->FindParam(&denIdx,SmbDenIdxEnum);
 	parameters->FindParam(&swIdx,SmbSwIdxEnum);
+	parameters->FindParam(&dsnowIdx,SmbDsnowIdxEnum);
 	parameters->FindParam(&cldFrac,SmbCldFracEnum);
 	parameters->FindParam(&t0wet,SmbT0wetEnum);
 	parameters->FindParam(&t0dry,SmbT0dryEnum);
 	parameters->FindParam(&K,SmbKEnum);
+	parameters->FindParam(&isclimatology,SmbIsclimatologyEnum);
 	parameters->FindParam(&isgraingrowth,SmbIsgraingrowthEnum);
 	parameters->FindParam(&isalbedo,SmbIsalbedoEnum);
@@ -3138,4 +3785,5 @@
 	Input* zY_input=this->GetInput(SmbZYEnum); _assert_(zY_input);
 	Input* Tmean_input=this->GetInput(SmbTmeanEnum); _assert_(Tmean_input);
+	Input* Vmean_input=this->GetInput(SmbVmeanEnum); _assert_(Vmean_input);
 	Input* C_input=this->GetInput(SmbCEnum); _assert_(C_input);
 	Input* Tz_input=this->GetInput(SmbTzEnum); _assert_(Tz_input);
@@ -3161,4 +3809,5 @@
 	zY_input->GetInputValue(&zY,gauss);
 	Tmean_input->GetInputValue(&Tmean,gauss);
+	Vmean_input->GetInputValue(&Vmean,gauss);
 	C_input->GetInputValue(&C,gauss);
 	Tz_input->GetInputValue(&Tz,gauss);
@@ -3277,4 +3926,16 @@
 	time-=dt;
 
+	timeclim=time;
+	if (isclimatology){
+		//If this is a climatology, we need to repeat the forcing after the final time
+		offsetend=dynamic_cast<TransientInput*>(Ta_input)->GetTimeInputOffset(finaltime);
+		time0=dynamic_cast<TransientInput*>(Ta_input)->GetTimeByOffset(-1);
+		timeend=dynamic_cast<TransientInput*>(Ta_input)->GetTimeByOffset(offsetend);
+		if (time>time0 & timeend>time0){
+			delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+			timeclim=time0+delta;
+		}
+	}
+
 	/*Start loop: */
 	count=1;
@@ -3284,12 +3945,12 @@
 
 		/*extract daily data:{{{*/
-		Ta_input->GetInputValue(&Ta,gauss,t);//screen level air temperature [K]
-		V_input->GetInputValue(&V,gauss,t);  //wind speed [m s-1]
-		Dlwr_input->GetInputValue(&dlw,gauss,t);   //downward longwave radiation flux [W m-2]
-		Dswr_input->GetInputValue(&dsw,gauss,t);   //downward shortwave radiation flux [W m-2]
-		P_input->GetInputValue(&P,gauss,t);        //precipitation [kg m-2]
-		eAir_input->GetInputValue(&eAir,gauss,t);  //screen level vapor pressure [Pa]
-		pAir_input->GetInputValue(&pAir,gauss,t);  // screen level air pressure [Pa]
-		teValue_input->GetInputValue(&teValue,gauss);  // screen level air pressure [Pa]
+		Ta_input->GetInputValue(&Ta,gauss,t-time+timeclim);//screen level air temperature [K]
+		V_input->GetInputValue(&V,gauss,t-time+timeclim);  //wind speed [m s-1]
+		Dlwr_input->GetInputValue(&dlw,gauss,t-time+timeclim);   //downward longwave radiation flux [W m-2]
+		Dswr_input->GetInputValue(&dsw,gauss,t-time+timeclim);   //downward shortwave radiation flux [W m-2]
+		P_input->GetInputValue(&P,gauss,t-time+timeclim);        //precipitation [kg m-2]
+		eAir_input->GetInputValue(&eAir,gauss,t-time+timeclim);  //screen level vapor pressure [Pa]
+		pAir_input->GetInputValue(&pAir,gauss,t-time+timeclim);  // screen level air pressure [Pa]
+		teValue_input->GetInputValue(&teValue,gauss);  // Emissivity [0-1]
 		aValue_input->GetInputValue(&aValue,gauss);  // screen level air pressure [Pa]
 		//_printf_("Time: " << t << " Ta: " << Ta << " V: " << V << " dlw: " << dlw << " dsw: " << dsw << " P: " << P << " eAir: " << eAir << " pAir: " << pAir << "\n");
@@ -3306,8 +3967,8 @@
 
 		/*Calculate net shortwave [W m-2]*/
-		netSW = cellsum(swf,m);
+		netSW = netSW + cellsum(swf,m)*smb_dt/dt;
 
 		/*Thermal profile computation:*/
-		if(isthermal)thermo(&EC, &T, dz, d, swf, dlw, Ta, V, eAir, pAir, teValue, W[0], smb_dt, m, Vz, Tz, thermo_scaling,rho_ice,this->Sid());
+		if(isthermal)thermo(&EC, &T, &ulw, dz, d, swf, dlw, Ta, V, eAir, pAir, teValue, W[0], smb_dt, m, Vz, Tz, thermo_scaling,rho_ice,this->Sid());
 
 		/*Change in thickness of top cell due to evaporation/condensation  assuming same density as top cell.
@@ -3316,5 +3977,5 @@
 
 		/*Add snow/rain to top grid cell adjusting cell depth, temperature and density*/
-		if(isaccumulation)accumulation(&T, &dz, &d, &W, &a, &re, &gdn, &gsp, &m, aIdx, Ta, P, dzMin, aSnow,rho_ice,this->Sid());
+		if(isaccumulation)accumulation(&T, &dz, &d, &W, &a, &re, &gdn, &gsp, &m, aIdx, dsnowIdx, Tmean, Ta, P, dzMin, aSnow, C, V, Vmean, rho_ice,this->Sid());
 
 		/*Calculate water production, M [kg m-2] resulting from snow/ice temperature exceeding 273.15 deg K
@@ -3327,8 +3988,9 @@
 		/*Calculate upward longwave radiation flux [W m-2] not used in energy balance. Calculated for every
 		 * sub-time step in thermo equations*/
-		ulw = 5.67E-8 * pow(T[0],4.0) * teValue;
+		//ulw = 5.67E-8 * pow(T[0],4.0) * teValue; // + deltatest here
 
 		/*Calculate net longwave [W m-2]*/
-		netLW = dlw - ulw;
+		meanULW = meanULW + ulw*smb_dt/dt;
+		netLW = netLW + (dlw - ulw)*smb_dt/dt;
 
 		/*Calculate turbulent heat fluxes [W m-2]*/
@@ -3347,8 +4009,12 @@
 						<< "gsp[" << cellsum(gsp,m)  << "] "
 						<< "swf[" << netSW << "] "
+						<< "lwf[" << netLW << "] "
 						<< "a[" << a << "] "
 						<< "te[" << teValue << "] "
 						<< "\n");
 		} /*}}}*/
+
+		meanLHF = meanLHF + lhf*smb_dt/dt;
+		meanSHF = meanSHF + shf*smb_dt/dt;
 
 		/*Sum component mass changes [kg m-2]*/
@@ -3380,5 +4046,7 @@
 
 		/*Check bottom grid cell T is unchanged:*/
-		if (T[m-1]!=T_bottom) _printf_("T(end)~=T_bottom" << "\n");
+		if(VerboseSmb() && this->Sid()==0 && IssmComm::GetRank()==0){
+			if (T[m-1]!=T_bottom) _printf_("T(end)~=T_bottom" << "\n");
+		}
 
 		/*Free ressources: */
@@ -3403,4 +4071,9 @@
 	this->AddInput(new DoubleInput(SmbRunoffEnum,sumR/dt/rho_ice));
 	this->AddInput(new DoubleInput(SmbPrecipitationEnum,sumP/dt/rho_ice));
+	this->AddInput(new DoubleInput(SmbMeanULWEnum,meanULW));
+	this->AddInput(new DoubleInput(SmbNetLWEnum,netLW));
+	this->AddInput(new DoubleInput(SmbNetSWEnum,netSW));
+	this->AddInput(new DoubleInput(SmbMeanLHFEnum,meanLHF));
+	this->AddInput(new DoubleInput(SmbMeanSHFEnum,meanSHF));
 	this->AddInput(new DoubleInput(SmbDzAddEnum,sumdz_add));
 	this->AddInput(new DoubleInput(SmbMAddEnum,sumMassAdd/dt));
@@ -3580,6 +4253,7 @@
 
 	/*Fetch number vertices and allocate memory*/
-	int         numvertices  = this->GetNumberOfVertices();
-	IssmDouble* maxprincipal = xNew<IssmDouble>(numvertices);
+	const int NUM_VERTICES  = this->GetNumberOfVertices();
+
+	IssmDouble* maxprincipal = xNew<IssmDouble>(NUM_VERTICES);
 
 	/*Retrieve all inputs and parameters*/
@@ -3599,5 +4273,5 @@
 	/*loop over vertices: */
 	Gauss* gauss=this->NewGauss();
-	for (int iv=0;iv<numvertices;iv++){
+	for (int iv=0;iv<NUM_VERTICES;iv++){
 		gauss->GaussVertex(iv);
 
@@ -3652,11 +4326,4 @@
 }
 /*}}}*/
-void       Element::ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure){/*{{{*/
-	matpar->ThermalToEnthalpy(penthalpy,temperature,waterfraction,pressure);
-}/*}}}*/
-IssmDouble Element::TMeltingPoint(IssmDouble pressure){/*{{{*/
-	_assert_(matpar);
-	return this->matpar->TMeltingPoint(pressure);
-}/*}}}*/
 IssmDouble Element::TotalFloatingBmb(IssmDouble* mask, bool scaled){/*{{{*/
 
@@ -3929,6 +4596,7 @@
 
 	/*Fetch number vertices and allocate memory*/
-	int         numvertices    = this->GetNumberOfVertices();
-	IssmDouble* viscousheating = xNew<IssmDouble>(numvertices);
+	const int NUM_VERTICES = this->GetNumberOfVertices();
+
+	IssmDouble* viscousheating = xNew<IssmDouble>(NUM_VERTICES);
 
 	/*Retrieve all inputs and parameters*/
@@ -3940,5 +4608,5 @@
 	/*loop over vertices: */
 	Gauss* gauss=this->NewGauss();
-	for (int iv=0;iv<numvertices;iv++){
+	for (int iv=0;iv<NUM_VERTICES;iv++){
 		gauss->GaussVertex(iv);
 
@@ -3957,2 +4625,134 @@
 }
 /*}}}*/
+
+/*Enthalpy*/
+void       Element::ThermalToEnthalpy(IssmDouble * penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure){/*{{{*/
+
+	/*Ouput*/
+	IssmDouble enthalpy;
+
+	/*Get necessary parameters*/
+	IssmDouble latentheat,referencetemperature,heatcapacity;
+	parameters->FindParam(&latentheat,MaterialsLatentheatEnum);
+	parameters->FindParam(&referencetemperature,ConstantsReferencetemperatureEnum);
+	parameters->FindParam(&heatcapacity,MaterialsHeatcapacityEnum);
+
+	if(temperature<TMeltingPoint(pressure)){
+		enthalpy=heatcapacity*(temperature-referencetemperature);
+	}
+	else{
+		enthalpy=PureIceEnthalpy(pressure)+latentheat*waterfraction;
+	}
+
+	/*Assign output pointers:*/
+	*penthalpy=enthalpy;
+}
+/*}}}*/
+IssmDouble Element::TMeltingPoint(IssmDouble pressure){/*{{{*/
+
+	/*Get necessary parameters*/
+	IssmDouble beta,meltingpoint;
+	parameters->FindParam(&beta,MaterialsBetaEnum);
+	parameters->FindParam(&meltingpoint,MaterialsMeltingpointEnum);
+
+	return meltingpoint-beta*pressure;
+}
+/*}}}*/
+void       Element::EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure){/*{{{*/
+
+	/*Ouput*/
+	IssmDouble temperature,waterfraction;
+
+	/*Get necessary parameters*/
+	IssmDouble latentheat,referencetemperature,heatcapacity;
+	parameters->FindParam(&latentheat,MaterialsLatentheatEnum);
+	parameters->FindParam(&referencetemperature,ConstantsReferencetemperatureEnum);
+	parameters->FindParam(&heatcapacity,MaterialsHeatcapacityEnum);
+
+	if(enthalpy<PureIceEnthalpy(pressure)){
+		temperature=referencetemperature+enthalpy/heatcapacity;
+		waterfraction=0.;
+	}
+	else{
+		temperature=TMeltingPoint(pressure);
+		waterfraction=(enthalpy-PureIceEnthalpy(pressure))/latentheat;
+	}
+
+	/*Assign output pointers:*/
+	*pwaterfraction=waterfraction;
+	*ptemperature=temperature;
+}
+/*}}}*/
+IssmDouble Element::EnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure){/*{{{*/
+
+	/*Get necessary parameters*/
+	IssmDouble heatcapacity,thermalconductivity,temperateiceconductivity;
+	parameters->FindParam(&heatcapacity,MaterialsHeatcapacityEnum);
+	parameters->FindParam(&thermalconductivity,MaterialsThermalconductivityEnum);
+	parameters->FindParam(&temperateiceconductivity,MaterialsTemperateiceconductivityEnum);
+
+	if(enthalpy<PureIceEnthalpy(pressure)){
+		return thermalconductivity/heatcapacity;
+	}
+	else{
+		return temperateiceconductivity/heatcapacity;
+	}
+}
+/*}}}*/
+IssmDouble Element::EnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure){/*{{{*/
+
+	IssmDouble  lambda;                 // fraction of cold ice
+	IssmDouble  kappa,kappa_c,kappa_t;  //enthalpy conductivities
+	IssmDouble  Hc,Ht;
+	IssmDouble* PIE   = xNew<IssmDouble>(numvertices);
+	IssmDouble* dHpmp = xNew<IssmDouble>(numvertices);
+
+	for(int iv=0; iv<numvertices; iv++){
+		PIE[iv]=PureIceEnthalpy(pressure[iv]);
+		dHpmp[iv]=enthalpy[iv]-PIE[iv];
+	}
+
+	bool allequalsign=true;
+	if(dHpmp[0]<0){
+		for(int iv=1; iv<numvertices;iv++) allequalsign=(allequalsign && (dHpmp[iv]<0));
+	}
+	else{
+		for(int iv=1; iv<numvertices;iv++) allequalsign=(allequalsign && (dHpmp[iv]>=0));
+	}
+
+	if(allequalsign){
+		kappa=EnthalpyDiffusionParameter(enthalpy[0], pressure[0]);
+	}
+	else {
+		/* return harmonic mean of thermal conductivities, weighted by fraction of cold/temperate ice,
+			cf Patankar 1980, pp44 */
+		kappa_c=EnthalpyDiffusionParameter(PureIceEnthalpy(0.)-1.,0.);
+		kappa_t=EnthalpyDiffusionParameter(PureIceEnthalpy(0.)+1.,0.);
+		Hc=0.; Ht=0.;
+		for(int iv=0; iv<numvertices;iv++){
+			if(enthalpy[iv]<PIE[iv])
+			 Hc+=(PIE[iv]-enthalpy[iv]);
+			else
+			 Ht+=(enthalpy[iv]-PIE[iv]);
+		}
+		_assert_((Hc+Ht)>0.);
+		lambda = Hc/(Hc+Ht);
+		kappa  = 1./(lambda/kappa_c + (1.-lambda)/kappa_t);
+	}
+
+	/*Clean up and return*/
+	xDelete<IssmDouble>(PIE);
+	xDelete<IssmDouble>(dHpmp);
+	return kappa;
+}
+/*}}}*/
+IssmDouble Element::PureIceEnthalpy(IssmDouble pressure){/*{{{*/
+
+	/*Get necessary parameters*/
+	IssmDouble referencetemperature,heatcapacity;
+	parameters->FindParam(&referencetemperature,ConstantsReferencetemperatureEnum);
+	parameters->FindParam(&heatcapacity,MaterialsHeatcapacityEnum);
+
+	return heatcapacity*(TMeltingPoint(pressure)-referencetemperature);
+}
+/*}}}*/
Index: /issm/trunk/src/c/classes/Elements/Element.h
===================================================================
--- /issm/trunk/src/c/classes/Elements/Element.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Elements/Element.h	(revision 24313)
@@ -3,5 +3,5 @@
  * This class is a place holder for the Tria and the Penta elements.
  * It is derived from Element, so DataSets can contain them.
- */
+*/
 
 #ifndef _ELEMENT_H_
@@ -12,5 +12,4 @@
 #include "../../datastructures/datastructures.h"
 #include "../../toolkits/toolkits.h"
-#include "../Update.h"
 class DataSet;
 class Parameters;
@@ -24,7 +23,7 @@
 class Materials;
 class Material;
-class Matpar;
 class Inputs;
 class Input;
+class IoModel;
 class Gauss;
 class ElementVector;
@@ -35,5 +34,5 @@
 /*}}}*/
 
-class Element: public Object,public Update{
+class Element: public Object{
 
 	public:
@@ -44,5 +43,4 @@
 		Vertex     **vertices;
 		Material    *material;
-		Matpar      *matpar;
 		Parameters  *parameters;
 
@@ -75,10 +73,8 @@
 		void               dViscositydDSSA(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
 		void               Echo();
-		IssmDouble         EnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure);
-		IssmDouble         EnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure);
-		void               EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure);
 		void               FindParam(bool* pvalue,int paramenum);
 		void               FindParam(int* pvalue,int paramenum);
 		void               FindParam(IssmDouble* pvalue,int paramenum);
+		IssmDouble         FindParam(int paramenum);
 		void               FindParam(int** pvalues,int* psize,int paramenum);
 		IssmDouble         FloatingArea(IssmDouble* mask, bool scaled);
@@ -86,4 +82,7 @@
 		void	             GetDofListPressure(int** pdoflist,int setenum);
 		void	             GetDofListVelocity(int** pdoflist,int setenum);
+		void	             GetDofListLocal(int** pdoflist,int approximation_enum,int setenum);
+		void	             GetDofListLocalPressure(int** pdoflist,int setenum);
+		void	             GetDofListLocalVelocity(int** pdoflist,int setenum);
 		Input*             GetInput(int inputenum);
 		void               GetInputListOnNodes(IssmDouble* pvalue,int enumtype);
@@ -99,6 +98,6 @@
 		void               GetInputValue(IssmDouble* pvalue,Gauss* gauss,int enum_type);
 		void               GetInputsInterpolations(Vector<IssmDouble>* interps);
-		IssmDouble         GetMaterialParameter(int enum_in);
-		int                GetIntegerMaterialParameter(int enum_in);
+		Node*              GetNode(int nodeindex);
+		int                GetNodeIndex(Node* node);
 		void               GetNodesLidList(int* lidlist);
 		void               GetNodesSidList(int* sidlist);
@@ -107,5 +106,6 @@
 		void               GetVectorFromInputs(Vector<IssmDouble>* vector, int name_enum, int type);
 		void               GetVectorFromInputs(Vector<IssmDouble>* vector, int name_enum, int type,IssmDouble time);
-		void	             GetVertexPidList(int* pidlist);
+		void	             GetVerticesLidList(int* lidlist);
+		void	             GetVerticesPidList(int* pidlist);
 		void               GetVerticesConnectivityList(int* connectivitylist);
 		void               GetVerticesCoordinates(IssmDouble** xyz_list);
@@ -131,7 +131,10 @@
 		void               InputUpdateFromConstant(int constant, int name);
 		void               InputUpdateFromConstant(bool constant, int name);
+
 		bool               IsFloating();
+		bool               IsGrounded();
 		bool               IsIceInElement();
 		bool               IsLandInElement();
+		void               Ismip6FloatingiceMeltingRate();
 		bool               IsWaterInElement();
 		void               LinearFloatingiceMeltingRate();
@@ -141,11 +144,14 @@
 		void               MigrateGroundingLine(IssmDouble* sheet_ungrounding);
 		void               MismipFloatingiceMeltingRate();
+		void               BeckmannGoosseFloatingiceMeltingRate();
 		void               MungsmtpParameterization(void);
 		ElementMatrix*     NewElementMatrix(int approximation_enum=NoneApproximationEnum);
 		ElementMatrix*     NewElementMatrixCoupling(int number_nodes,int approximation_enum=NoneApproximationEnum);
 		ElementVector*     NewElementVector(int approximation_enum=NoneApproximationEnum);
+		void               PicoUpdateBoxid(int* pmax_boxid_basin); 
+		void               PicoUpdateBox(int loopboxid);
+		void               PicoComputeBasalMelt(); 
 		void               PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm,bool ismungsm,bool issetpddfac);
 		void               PositiveDegreeDaySicopolis(bool isfirnwarming);
-		IssmDouble         PureIceEnthalpy(IssmDouble pressure);
 		void               ResultInterpolation(int* pinterpolation,int*nodesperelement,int* parray_size, int output_enum);
 		void               ResultToPatch(IssmDouble* values,int nodesperelement,int output_enum);
@@ -153,4 +159,5 @@
 		void               ResultToVector(Vector<IssmDouble>* vector,int output_enum);
 		void               SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum);
+		void               SmbSemic();
 		int                Sid();
 		void               SmbGemb();
@@ -162,6 +169,4 @@
 		void               StrainRateSSA1d(IssmDouble* epsilon,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input);
 		void               StressMaxPrincipalCreateInput(void);
-		void               ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure);
-		IssmDouble         TMeltingPoint(IssmDouble pressure);
 		IssmDouble         TotalFloatingBmb(IssmDouble* mask, bool scaled);
 		IssmDouble         TotalGroundedBmb(IssmDouble* mask, bool scaled);
@@ -188,4 +193,11 @@
 		void               TransformStiffnessMatrixCoord(ElementMatrix* Ke,int numnodes,int* transformenum_list){_error_("not implemented yet");};/*Tiling only*/
 		void               ViscousHeatingCreateInput(void);
+		void               ThermalToEnthalpy(IssmDouble * penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure);
+		IssmDouble         TMeltingPoint(IssmDouble pressure);
+		void               EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure);
+		IssmDouble         EnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure);
+		IssmDouble         EnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure);
+		IssmDouble         PureIceEnthalpy(IssmDouble pressure);
+
 
 		/*Virtual functions*/
@@ -199,6 +211,8 @@
 		virtual void       CalvingCrevasseDepth(void){_error_("not implemented yet");};
 		virtual void	    CalvingRateLevermann(void)=0;
+		virtual void       CalvingFluxLevelset(void){_error_("not implemented yet");};
+		virtual void       CalvingMeltingFluxLevelset(void){_error_("not implemented yet");};
 		virtual IssmDouble CharacteristicLength(void)=0;
-		virtual void       ComputeBasalStress(Vector<IssmDouble>* sigma_b)=0;
+		virtual void       ComputeBasalStress(void){_error_("not implemented yet");};
 		virtual void       ComputeDeviatoricStressTensor(void)=0;
 		virtual void       ComputeSigmaNN(void)=0;
@@ -220,10 +234,11 @@
 		virtual void       GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlyfloating)=0;
 		virtual IssmDouble GetGroundedPortion(IssmDouble* xyz_list)=0;
+		virtual IssmDouble GetIcefrontArea(){_error_("not implemented");};
 		virtual void       GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum)=0;
-		virtual void       GetInputValue(IssmDouble* pvalue,Node* node,int enumtype)=0;
+		virtual void       GetInputValue(IssmDouble* pvalue,Vertex* vertex,int enumtype){_error_("not implemented yet");};
+		virtual void       GetInputValue(IssmDouble* pvalue,Node* node,int enumtype){_error_("not implemented yet");};
 		virtual void       GetLevelCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum,IssmDouble level)=0;
 		virtual void       GetLevelsetPositivePart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlynegative,IssmDouble* levelsetvalues)=0;
-		virtual Node*      GetNode(int node_number)=0;
-		virtual int        GetNodeIndex(Node* node)=0;
+		virtual int        GetVertexIndex(Vertex* vertex){_error_("not implemented");};;
 		virtual int        GetNumberOfNodes(void)=0;
 		virtual int        GetNumberOfNodes(int enum_type)=0;
@@ -236,8 +251,17 @@
 		virtual IssmDouble IceVolume(bool scaled)=0;
 		virtual IssmDouble IceVolumeAboveFloatation(bool scaled)=0;
+		virtual IssmDouble IcefrontMassFlux(bool scaled){_error_("not implemented");};
+		virtual IssmDouble IcefrontMassFluxLevelset(bool scaled){_error_("not implemented");};
+		virtual IssmDouble GroundinglineMassFlux(bool scaled){_error_("not implemented");};
 		virtual void       InputDepthAverageAtBase(int enum_type,int average_enum_type)=0;
 		virtual void       InputExtrude(int input_enum,int start)=0;
 		virtual void       InputUpdateFromSolutionOneDofCollapsed(IssmDouble* solution,int inputenum)=0;
 		virtual void       InputUpdateFromSolutionOneDof(IssmDouble* solution,int inputenum)=0;
+		#ifdef _HAVE_DAKOTA_
+		virtual void  InputUpdateFromMatrixDakota(IssmDouble* matrix, int rows, int ncols, int name, int type)=0;
+		virtual void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type)=0;
+		#endif
+		virtual void  InputUpdateFromIoModel(int index, IoModel* iomodel)=0;
+		virtual void  InputUpdateFromVector(IssmDouble* vector, int name, int type)=0;
 		virtual bool       IsFaceOnBoundary(void)=0;
 		virtual bool       IsIcefront(void)=0;
@@ -283,7 +307,4 @@
 		virtual int        NumberofNodesPressure(void)=0;
 		virtual int        NumberofNodesVelocity(void)=0;
-		virtual void       PicoUpdateBoxid(int* pmax_boxid_basin)=0;
-		virtual void       PicoUpdateBox(int loopboxid)=0;
-		virtual void       PicoComputeBasalMelt(void)=0;
 		virtual void       PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding)=0;
 		virtual int        PressureInterpolation()=0;
@@ -291,4 +312,5 @@
 		virtual void       ResetFSBasalBoundaryCondition()=0;
 		virtual void       ResetHooks()=0;
+		virtual void       RignotMeltParameterization(void){_error_("not implemented yet");};
 		virtual void       SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index,int offset,int N,int M)=0;
 		virtual void       SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index)=0;
@@ -298,4 +320,5 @@
 		virtual Element*   SpawnTopElement(void)=0;
 		virtual IssmDouble StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa)=0;
+		virtual void       StabilizationParameterAnisotropic(IssmDouble* tau_parameter_anisotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy, IssmDouble hz, IssmDouble kappa)=0;		
 		virtual void	    StrainRateparallel(void)=0;
 		virtual void	    StrainRateperpendicular(void)=0;
@@ -304,4 +327,6 @@
 		virtual int        TensorInterpolation()=0;
 		virtual IssmDouble TimeAdapt()=0;
+		virtual IssmDouble TotalCalvingFluxLevelset(bool scaled){_error_("not implemented");};
+		virtual IssmDouble TotalCalvingMeltingFluxLevelset(bool scaled){_error_("not implemented");};
 		virtual IssmDouble TotalFloatingBmb(bool scaled)=0;
 		virtual IssmDouble TotalGroundedBmb(bool scaled)=0;
Index: /issm/trunk/src/c/classes/Elements/ElementHook.cpp
===================================================================
--- /issm/trunk/src/c/classes/Elements/ElementHook.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Elements/ElementHook.cpp	(revision 24313)
@@ -21,5 +21,4 @@
 	this->hvertices  = NULL;
 	this->hmaterial  = NULL;
-	this->hmatpar    = NULL;
 	this->hneighbors = NULL;
 }
@@ -35,5 +34,4 @@
 	delete hvertices;
 	delete hmaterial;
-	delete hmatpar;
 	delete hneighbors;
 }
@@ -41,12 +39,6 @@
 ElementHook::ElementHook(int in_numanalyses,int element_id,int numvertices,IoModel* iomodel){/*{{{*/
 
-	/*intermediary: */
-	int matpar_id;
+	/*retrieve material_id*/
 	int material_id;
-
-	/*retrieve material_id: */
-	matpar_id = iomodel->matparcounter;
-
-	/*retrieve material_id*/
 	material_id = element_id;
 
@@ -61,5 +53,4 @@
 	this->hvertices   = new Hook(&vertex_ids[0],numvertices);
 	this->hmaterial   = new Hook(&material_id,1);
-	this->hmatpar     = new Hook(&matpar_id,1);
 	this->hneighbors  = NULL;
 
@@ -109,5 +100,4 @@
 		this->hvertices   = new Hook();
 		this->hmaterial   = new Hook();
-		this->hmatpar     = new Hook();
 		if(!hneighbors_null)this->hneighbors  = new Hook();
 		else this->hneighbors=NULL;
@@ -127,5 +117,4 @@
 	this->hvertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	this->hmaterial->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	this->hmatpar->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	if(this->hneighbors)this->hneighbors->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 
@@ -158,8 +147,4 @@
    else _printf_("  hmaterial = NULL\n");
 
-	_printf_("  hmatpar:\n");
-	if(hmatpar) hmatpar->DeepEcho();
-   else _printf_("  hmatpar = NULL\n");
-
 	_printf_("  hneighbors:\n");
 	if(hneighbors) hneighbors->DeepEcho();
@@ -189,8 +174,4 @@
 	if(hmaterial) hmaterial->Echo();
    else _printf_("  hmaterial = NULL\n");
-
-	_printf_("  hmatpar:\n");
-	if(hmatpar) hmatpar->Echo();
-   else _printf_("  hmatpar = NULL\n");
 
 	_printf_("  hneighbors:\n");
@@ -232,5 +213,4 @@
 	triahook->hmaterial=NULL;
 	triahook->hvertices=(Hook*)this->hvertices->Spawn(indices,2);
-	triahook->hmatpar=(Hook*)this->hmatpar->copy();
 }
 /*}}}*/
@@ -260,5 +240,4 @@
 	triahook->hmaterial=NULL;
 	triahook->hvertices=(Hook*)this->hvertices->Spawn(indices,3);
-	triahook->hmatpar=(Hook*)this->hmatpar->copy();
-}
-/*}}}*/
+}
+/*}}}*/
Index: /issm/trunk/src/c/classes/Elements/ElementHook.h
===================================================================
--- /issm/trunk/src/c/classes/Elements/ElementHook.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Elements/ElementHook.h	(revision 24313)
@@ -16,5 +16,4 @@
 		Hook  *hvertices;     // vertices
 		Hook  *hmaterial;     // 1 ice material
-		Hook  *hmatpar;       // 1 material parameter
 		Hook  *hneighbors;    // 2 elements, first down, second up in 3d only
 
Index: /issm/trunk/src/c/classes/Elements/Penta.cpp
===================================================================
--- /issm/trunk/src/c/classes/Elements/Penta.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Elements/Penta.cpp	(revision 24313)
@@ -54,5 +54,4 @@
 	this->vertices          = NULL;
 	this->material          = NULL;
-	this->matpar            = NULL;
 	this->verticalneighbors = NULL;
 
@@ -93,5 +92,4 @@
 	penta->hvertices = (Hook*)this->hvertices->copy();
 	penta->hmaterial = (Hook*)this->hmaterial->copy();
-	penta->hmatpar   = (Hook*)this->hmatpar->copy();
 	if (this->hneighbors) penta->hneighbors = (Hook*)(this->hneighbors->copy());
 	else penta->hneighbors = NULL;
@@ -116,5 +114,4 @@
 	penta->vertices = (Vertex**)this->hvertices->deliverp();
 	penta->material = (Material*)this->hmaterial->delivers();
-	penta->matpar   = (Matpar*)this->hmatpar->delivers();
 	penta->verticalneighbors = (Penta**)this->hneighbors->deliverp();
 
@@ -134,5 +131,4 @@
 	vertices = (Vertex**)this->hvertices->deliverp();
 	material = (Material*)this->hmaterial->delivers();
-	matpar   = (Matpar*)this->hmatpar->delivers();
 	verticalneighbors = (Penta**)this->hneighbors->deliverp();
 
@@ -192,6 +188,7 @@
 	IssmDouble  calvingrate[NUMVERTICES];
 	IssmDouble  lambda1,lambda2,ex,ey,vx,vy,vel;
-	IssmDouble  B,sigma_vm,sigma_max,sigma_max_floating,sigma_max_grounded;
-	IssmDouble  epse_2,groundedice,bed;
+	IssmDouble  B,sigma_max,sigma_max_floating,sigma_max_grounded,n;
+	IssmDouble  epse_2,groundedice,bed,sealevel;
+	IssmDouble  sigma_vm[NUMVERTICES];
 
 	/* Get node coordinates and dof list: */
@@ -209,7 +206,8 @@
 	Input* bs_input = inputs->GetInput(BaseEnum);                    _assert_(bs_input);
 	Input* B_input  = inputs->GetInput(MaterialsRheologyBbarEnum);   _assert_(B_input);
+	Input* n_input  = inputs->GetInput(MaterialsRheologyNEnum);   _assert_(n_input);
 	Input* smax_fl_input = inputs->GetInput(CalvingStressThresholdFloatingiceEnum); _assert_(smax_fl_input);
 	Input* smax_gr_input = inputs->GetInput(CalvingStressThresholdGroundediceEnum); _assert_(smax_gr_input);
-	IssmDouble  n   = this->GetMaterialParameter(MaterialsRheologyNEnum);
+	Input* sl_input  = inputs->GetInput(SealevelEnum); _assert_(sl_input);
 
 	/* Start looping on the number of vertices: */
@@ -220,4 +218,5 @@
 		/*Get velocity components and thickness*/
 		B_input->GetInputValue(&B,gauss);
+		n_input->GetInputValue(&n,gauss);
 		vx_input->GetInputValue(&vx,gauss);
 		vy_input->GetInputValue(&vy,gauss);
@@ -227,4 +226,5 @@
 		smax_gr_input->GetInputValue(&sigma_max_grounded,gauss);
 		vel=sqrt(vx*vx+vy*vy)+1.e-14;
+		sl_input->GetInputValue(&sealevel,gauss);
 
 		/*Compute strain rate and viscosity: */
@@ -242,5 +242,5 @@
 		/*Calculate sigma_vm*/
 		epse_2    = 1./2. *(lambda1*lambda1 + lambda2*lambda2);
-		sigma_vm  = sqrt(3.) * B * pow(epse_2,1./(2.*n));
+		sigma_vm[iv] = sqrt(3.) * B * pow(epse_2,1./(2.*n));
 
 		/*Tensile stress threshold*/
@@ -251,11 +251,11 @@
 
 		/*Assign values*/
-		if(bed>0.){
+		if(bed>sealevel){
 			calvingratex[iv]=0.;
 			calvingratey[iv]=0.;
 		}
 		else{
-			calvingratex[iv]=vx*sigma_vm/sigma_max;
-			calvingratey[iv]=vy*sigma_vm/sigma_max;
+			calvingratex[iv]=vx*sigma_vm[iv]/sigma_max;
+			calvingratey[iv]=vy*sigma_vm[iv]/sigma_max;
 		}
 		calvingrate[iv] =sqrt(calvingratex[iv]*calvingratex[iv] + calvingratey[iv]*calvingratey[iv]);
@@ -266,8 +266,10 @@
 	this->inputs->AddInput(new PentaInput(CalvingrateyEnum,&calvingratey[0],P1Enum));
 	this->inputs->AddInput(new PentaInput(CalvingCalvingrateEnum,&calvingrate[0],P1Enum));
+	this->inputs->AddInput(new PentaInput(SigmaVMEnum,&sigma_vm[0],P1Enum));
 
 	this->InputExtrude(CalvingratexEnum,-1);
 	this->InputExtrude(CalvingrateyEnum,-1);
 	this->InputExtrude(CalvingCalvingrateEnum,-1);
+	this->InputExtrude(SigmaVMEnum,-1);
 
 	/*Clean up and return*/
@@ -311,5 +313,5 @@
 
 		/*Calving rate proportionnal to the positive product of the strain rate along the ice flow direction and the strain rate perpendicular to the ice flow */
-		calvingrate[iv]=propcoeff*strainparallel*strainperpendicular;	
+		calvingrate[iv]=propcoeff*strainparallel*strainperpendicular;
 		if(calvingrate[iv]<0){
 			calvingrate[iv]=0;
@@ -329,6 +331,263 @@
 }
 /*}}}*/
-void       Penta::ComputeBasalStress(Vector<IssmDouble>* sigma_b){/*{{{*/
-
+void       Penta::CalvingFluxLevelset(){/*{{{*/
+
+	/*Make sure there is an ice front here*/
+	if(!IsIceInElement() || !IsZeroLevelset(MaskIceLevelsetEnum)){
+		IssmDouble flux_per_area=0;
+		this->inputs->AddInput(new PentaInput(CalvingFluxLevelsetEnum,&flux_per_area,P0Enum));
+	}
+	else{
+		int               domaintype,index1,index2;
+		const IssmPDouble epsilon = 1.e-15;
+		IssmDouble        s1,s2;
+		IssmDouble        gl[NUMVERTICES];
+		IssmDouble        xyz_front[2][3];
+
+		IssmDouble *xyz_list = NULL;
+		this->GetVerticesCoordinates(&xyz_list);
+
+		/*Recover parameters and values*/
+		GetInputListOnVertices(&gl[0],MaskIceLevelsetEnum);
+
+		/*Be sure that values are not zero*/
+		if(gl[0]==0.) gl[0]=gl[0]+epsilon;
+		if(gl[1]==0.) gl[1]=gl[1]+epsilon;
+		if(gl[2]==0.) gl[2]=gl[2]+epsilon;
+
+		int pt1 = 0;
+		int pt2 = 1;
+		if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
+
+			/*Portion of the segments*/
+			s1=gl[2]/(gl[2]-gl[1]);
+			s2=gl[2]/(gl[2]-gl[0]);
+			if(gl[2]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+			xyz_front[pt2][0]=xyz_list[3*2+0]+s1*(xyz_list[3*1+0]-xyz_list[3*2+0]);
+			xyz_front[pt2][1]=xyz_list[3*2+1]+s1*(xyz_list[3*1+1]-xyz_list[3*2+1]);
+			xyz_front[pt2][2]=xyz_list[3*2+2]+s1*(xyz_list[3*1+2]-xyz_list[3*2+2]);
+			xyz_front[pt1][0]=xyz_list[3*2+0]+s2*(xyz_list[3*0+0]-xyz_list[3*2+0]);
+			xyz_front[pt1][1]=xyz_list[3*2+1]+s2*(xyz_list[3*0+1]-xyz_list[3*2+1]);
+			xyz_front[pt1][2]=xyz_list[3*2+2]+s2*(xyz_list[3*0+2]-xyz_list[3*2+2]);
+		}
+		else if(gl[1]*gl[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
+
+			/*Portion of the segments*/
+			s1=gl[0]/(gl[0]-gl[1]);
+			s2=gl[0]/(gl[0]-gl[2]);
+			if(gl[0]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+
+			xyz_front[pt1][0]=xyz_list[3*0+0]+s1*(xyz_list[3*1+0]-xyz_list[3*0+0]);
+			xyz_front[pt1][1]=xyz_list[3*0+1]+s1*(xyz_list[3*1+1]-xyz_list[3*0+1]);
+			xyz_front[pt1][2]=xyz_list[3*0+2]+s1*(xyz_list[3*1+2]-xyz_list[3*0+2]);
+			xyz_front[pt2][0]=xyz_list[3*0+0]+s2*(xyz_list[3*2+0]-xyz_list[3*0+0]);
+			xyz_front[pt2][1]=xyz_list[3*0+1]+s2*(xyz_list[3*2+1]-xyz_list[3*0+1]);
+			xyz_front[pt2][2]=xyz_list[3*0+2]+s2*(xyz_list[3*2+2]-xyz_list[3*0+2]);
+		}
+		else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
+
+			/*Portion of the segments*/
+			s1=gl[1]/(gl[1]-gl[0]);
+			s2=gl[1]/(gl[1]-gl[2]);
+			if(gl[1]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+
+			xyz_front[pt2][0]=xyz_list[3*1+0]+s1*(xyz_list[3*0+0]-xyz_list[3*1+0]);
+			xyz_front[pt2][1]=xyz_list[3*1+1]+s1*(xyz_list[3*0+1]-xyz_list[3*1+1]);
+			xyz_front[pt2][2]=xyz_list[3*1+2]+s1*(xyz_list[3*0+2]-xyz_list[3*1+2]);
+			xyz_front[pt1][0]=xyz_list[3*1+0]+s2*(xyz_list[3*2+0]-xyz_list[3*1+0]);
+			xyz_front[pt1][1]=xyz_list[3*1+1]+s2*(xyz_list[3*2+1]-xyz_list[3*1+1]);
+			xyz_front[pt1][2]=xyz_list[3*1+2]+s2*(xyz_list[3*2+2]-xyz_list[3*1+2]);
+		}
+		else{
+			_error_("case not possible");
+		}
+
+		/*Some checks in debugging mode*/
+		_assert_(s1>=0 && s1<=1.);
+		_assert_(s2>=0 && s2<=1.);
+
+		/*Get normal vector*/
+		IssmDouble normal[3];
+		this->NormalSectionBase(&normal[0],&xyz_front[0][0]);
+		normal[0] = -normal[0];
+		normal[1] = -normal[1];
+
+		/*Get inputs*/
+		IssmDouble flux = 0.;
+		IssmDouble area = 0.;
+		IssmDouble calvingratex,calvingratey,thickness,Jdet,flux_per_area;
+		IssmDouble rho_ice=FindParam(MaterialsRhoIceEnum);
+		Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+		Input* calvingratex_input=NULL;
+		Input* calvingratey_input=NULL;
+		calvingratex_input=inputs->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
+		calvingratey_input=inputs->GetInput(CalvingrateyEnum); _assert_(calvingratey_input);
+
+		/*Start looping on Gaussian points*/
+		Gauss* gauss=this->NewGaussBase(xyz_list,&xyz_front[0][0],3);
+		for(int ig=gauss->begin();ig<gauss->end();ig++){
+
+			gauss->GaussPoint(ig);
+			thickness_input->GetInputValue(&thickness,gauss);
+			calvingratex_input->GetInputValue(&calvingratex,gauss);
+			calvingratey_input->GetInputValue(&calvingratey,gauss);
+			this->JacobianDeterminantLine(&Jdet,&xyz_front[0][0],gauss);
+
+			flux += rho_ice*Jdet*gauss->weight*thickness*(calvingratex*normal[0] + calvingratey*normal[1]);
+			area += Jdet*gauss->weight*thickness;
+
+			flux_per_area=flux/area;
+		}
+
+		this->inputs->AddInput(new PentaInput(CalvingFluxLevelsetEnum,&flux_per_area,P0Enum));
+
+		/*Clean up and return*/
+		delete gauss;
+	}
+}
+/*}}}*/
+void       Penta::CalvingMeltingFluxLevelset(){/*{{{*/
+
+	/*Make sure there is an ice front here*/
+	if(!IsIceInElement() || !IsZeroLevelset(MaskIceLevelsetEnum)){
+		IssmDouble flux_per_area=0;
+		this->inputs->AddInput(new PentaInput(CalvingMeltingFluxLevelsetEnum,&flux_per_area,P0Enum));
+	}
+	else{
+		int               domaintype,index1,index2;
+		const IssmPDouble epsilon = 1.e-15;
+		IssmDouble        s1,s2;
+		IssmDouble        gl[NUMVERTICES];
+		IssmDouble        xyz_front[2][3];
+
+		IssmDouble *xyz_list = NULL;
+		this->GetVerticesCoordinates(&xyz_list);
+
+		/*Recover parameters and values*/
+		GetInputListOnVertices(&gl[0],MaskIceLevelsetEnum);
+
+		/*Be sure that values are not zero*/
+		if(gl[0]==0.) gl[0]=gl[0]+epsilon;
+		if(gl[1]==0.) gl[1]=gl[1]+epsilon;
+		if(gl[2]==0.) gl[2]=gl[2]+epsilon;
+
+		int pt1 = 0;
+		int pt2 = 1;
+		if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
+
+			/*Portion of the segments*/
+			s1=gl[2]/(gl[2]-gl[1]);
+			s2=gl[2]/(gl[2]-gl[0]);
+			if(gl[2]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+			xyz_front[pt2][0]=xyz_list[3*2+0]+s1*(xyz_list[3*1+0]-xyz_list[3*2+0]);
+			xyz_front[pt2][1]=xyz_list[3*2+1]+s1*(xyz_list[3*1+1]-xyz_list[3*2+1]);
+			xyz_front[pt2][2]=xyz_list[3*2+2]+s1*(xyz_list[3*1+2]-xyz_list[3*2+2]);
+			xyz_front[pt1][0]=xyz_list[3*2+0]+s2*(xyz_list[3*0+0]-xyz_list[3*2+0]);
+			xyz_front[pt1][1]=xyz_list[3*2+1]+s2*(xyz_list[3*0+1]-xyz_list[3*2+1]);
+			xyz_front[pt1][2]=xyz_list[3*2+2]+s2*(xyz_list[3*0+2]-xyz_list[3*2+2]);
+		}
+		else if(gl[1]*gl[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
+
+			/*Portion of the segments*/
+			s1=gl[0]/(gl[0]-gl[1]);
+			s2=gl[0]/(gl[0]-gl[2]);
+			if(gl[0]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+
+			xyz_front[pt1][0]=xyz_list[3*0+0]+s1*(xyz_list[3*1+0]-xyz_list[3*0+0]);
+			xyz_front[pt1][1]=xyz_list[3*0+1]+s1*(xyz_list[3*1+1]-xyz_list[3*0+1]);
+			xyz_front[pt1][2]=xyz_list[3*0+2]+s1*(xyz_list[3*1+2]-xyz_list[3*0+2]);
+			xyz_front[pt2][0]=xyz_list[3*0+0]+s2*(xyz_list[3*2+0]-xyz_list[3*0+0]);
+			xyz_front[pt2][1]=xyz_list[3*0+1]+s2*(xyz_list[3*2+1]-xyz_list[3*0+1]);
+			xyz_front[pt2][2]=xyz_list[3*0+2]+s2*(xyz_list[3*2+2]-xyz_list[3*0+2]);
+		}
+		else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
+
+			/*Portion of the segments*/
+			s1=gl[1]/(gl[1]-gl[0]);
+			s2=gl[1]/(gl[1]-gl[2]);
+			if(gl[1]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+
+			xyz_front[pt2][0]=xyz_list[3*1+0]+s1*(xyz_list[3*0+0]-xyz_list[3*1+0]);
+			xyz_front[pt2][1]=xyz_list[3*1+1]+s1*(xyz_list[3*0+1]-xyz_list[3*1+1]);
+			xyz_front[pt2][2]=xyz_list[3*1+2]+s1*(xyz_list[3*0+2]-xyz_list[3*1+2]);
+			xyz_front[pt1][0]=xyz_list[3*1+0]+s2*(xyz_list[3*2+0]-xyz_list[3*1+0]);
+			xyz_front[pt1][1]=xyz_list[3*1+1]+s2*(xyz_list[3*2+1]-xyz_list[3*1+1]);
+			xyz_front[pt1][2]=xyz_list[3*1+2]+s2*(xyz_list[3*2+2]-xyz_list[3*1+2]);
+		}
+		else{
+			_error_("case not possible");
+		}
+
+		/*Some checks in debugging mode*/
+		_assert_(s1>=0 && s1<=1.);
+		_assert_(s2>=0 && s2<=1.);
+
+		/*Get normal vector*/
+		IssmDouble normal[3];
+		this->NormalSectionBase(&normal[0],&xyz_front[0][0]);
+		normal[0] = -normal[0];
+		normal[1] = -normal[1];
+
+		/*Get inputs*/
+		IssmDouble flux = 0.;
+		IssmDouble area = 0.;
+		IssmDouble calvingratex,calvingratey,vx,vy,vel,meltingrate,meltingratex,meltingratey,thickness,Jdet,flux_per_area;
+		IssmDouble rho_ice=FindParam(MaterialsRhoIceEnum);
+		Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+		Input* calvingratex_input=NULL;
+		Input* calvingratey_input=NULL;
+		Input* vx_input=NULL;
+		Input* vy_input=NULL;
+		Input* meltingrate_input=NULL;
+		calvingratex_input=inputs->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
+		calvingratey_input=inputs->GetInput(CalvingrateyEnum); _assert_(calvingratey_input);
+		vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
+		vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
+		meltingrate_input=inputs->GetInput(CalvingMeltingrateEnum); _assert_(meltingrate_input);
+
+		/*Start looping on Gaussian points*/
+		Gauss* gauss=this->NewGaussBase(xyz_list,&xyz_front[0][0],3);
+		for(int ig=gauss->begin();ig<gauss->end();ig++){
+
+			gauss->GaussPoint(ig);
+			thickness_input->GetInputValue(&thickness,gauss);
+			calvingratex_input->GetInputValue(&calvingratex,gauss);
+			calvingratey_input->GetInputValue(&calvingratey,gauss);
+			vx_input->GetInputValue(&vx,gauss);
+			vy_input->GetInputValue(&vy,gauss);
+			vel=vx*vx+vy*vy;
+			meltingrate_input->GetInputValue(&meltingrate,gauss);
+			meltingratex=meltingrate*vx/(sqrt(vel)+1.e-14);
+			meltingratey=meltingrate*vy/(sqrt(vel)+1.e-14);
+			this->JacobianDeterminantLine(&Jdet,&xyz_front[0][0],gauss);
+
+			flux += rho_ice*Jdet*gauss->weight*thickness*((calvingratex+meltingratex)*normal[0] + (calvingratey+meltingratey)*normal[1]);
+			area += Jdet*gauss->weight*thickness;
+
+			flux_per_area=flux/area;
+		}
+
+		this->inputs->AddInput(new PentaInput(CalvingMeltingFluxLevelsetEnum,&flux_per_area,P0Enum));
+
+		/*Clean up and return*/
+		delete gauss;
+	}
+}
+/*}}}*/
+void       Penta::ComputeBasalStress(void){/*{{{*/
+
+	_error_("not implemented (needs to be redone)");
 	int         i,j;
 	int         dofv[3]={0,1,2};
@@ -361,11 +620,11 @@
 	if(!IsOnBase()){
 		//put zero
-		sigma_b->SetValue(id-1,0.0,INS_VAL);
+		//sigma_b->SetValue(id-1,0.0,INS_VAL);
 		return;
 	}
 
 	/*recovre material parameters: */
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	gravity=matpar->GetMaterialParameter(ConstantsGEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	gravity=FindParam(ConstantsGEnum);
 
 	/* Get node coordinates and dof list: */
@@ -413,5 +672,5 @@
 
 	/*Add value to output*/
-	sigma_b->SetValue(id-1,value,INS_VAL);
+	//sigma_b->SetValue(id-1,value,INS_VAL);
 }
 /*}}}*/
@@ -448,5 +707,5 @@
 
 		/*Compute Stress*/
-		tau_xx[iv]=2*viscosity*epsilon[0]; // tau = nu eps 
+		tau_xx[iv]=2*viscosity*epsilon[0]; // tau = nu eps
 		tau_yy[iv]=2*viscosity*epsilon[1];
 		tau_zz[iv]=2*viscosity*epsilon[2];
@@ -537,10 +796,9 @@
 	this->element_type=this->element_type_list[analysis_counter];
 
-	/*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 
+	/*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
 	 * datasets, using internal ids and offsets hidden in hooks: */
 	if (this->hnodes[analysis_counter]) this->hnodes[analysis_counter]->configure(nodesin);
 	this->hvertices->configure(verticesin);
 	this->hmaterial->configure(materialsin);
-	this->hmatpar->configure(materialsin);
 	this->hneighbors->configure(elementsin);
 
@@ -550,5 +808,4 @@
 	this->vertices          = (Vertex**)this->hvertices->deliverp();
 	this->material          = (Material*)this->hmaterial->delivers();
-	this->matpar            = (Matpar*)this->hmatpar->delivers();
 	this->verticalneighbors = (Penta**)this->hneighbors->deliverp();
 
@@ -630,5 +887,5 @@
 	int         connectivity[NUMVERTICES];
 	IssmPDouble values[NUMVERTICES];
-	IssmPDouble gradients[NUMVERTICES]; 
+	IssmPDouble gradients[NUMVERTICES];
 	IssmDouble  value,gradient;
 
@@ -652,4 +909,30 @@
 
 }/*}}}*/
+void       Penta::CreateDistanceInputFromSegmentlist(IssmDouble* distances,int distanceenum){/*{{{*/
+
+	/*Get current field and vertex coordinates*/
+	IssmDouble ls[NUMVERTICES],distance;
+	GetInputListOnVertices(&ls[0],distanceenum);
+
+	/*Get distance from list of segments and reset ls*/
+	for(int j=0;j<NUMVERTICES;j++){
+		distance=distances[this->vertices[j]->Lid()];
+		if(xIsNan<IssmDouble>(distance)) _error_("NaN found in vector");
+		if(xIsInf<IssmDouble>(distance)) _error_("Inf found in vector");
+
+		/*FIXME: do we really need this?*/
+		if(distanceenum==MaskIceLevelsetEnum) if(distance>10000) distance=10000;
+		if(ls[j]>0){
+			ls[j] = distance;
+		}
+		else{
+			ls[j] = - distance;
+		}
+	}
+
+	/*Update Levelset*/
+	this->inputs->AddInput(new PentaInput(distanceenum,&ls[0],P1Enum));
+}
+/*}}}*/
 void       Penta::ElementResponse(IssmDouble* presponse,int response_enum){/*{{{*/
 
@@ -675,5 +958,5 @@
 			}
 			break;
-		default:  
+		default:
 			_error_("Response type " << EnumToStringx(response_enum) << " not supported yet!");
 	}
@@ -762,7 +1045,7 @@
 	GetInputListOnVertices(&pressure[0],PressureEnum);
 	GetInputListOnVertices(&phi[0],MaskGroundediceLevelsetEnum);
-	IssmDouble rho_ice   = matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble rho_water = matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble gravity   = matpar->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_ice   = FindParam(MaterialsRhoIceEnum);
+	IssmDouble rho_water = FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble gravity   = FindParam(ConstantsGEnum);
 
 	/* Get node coordinates and dof list: */
@@ -823,5 +1106,5 @@
 /*}}}*/
 void       Penta::GetAreaCoordinates(IssmDouble* area_coordinates,IssmDouble* xyz_zero,IssmDouble* xyz_list,int numpoints){/*{{{*/
-	/*Computeportion of the element that is grounded*/ 
+	/*Computeportion of the element that is grounded*/
 
 	int         i,j,k;
@@ -832,5 +1115,5 @@
 
 	/*Initialize xyz_list with original xyz_list of triangle coordinates*/
-	for(j=0;j<3;j++){ 
+	for(j=0;j<3;j++){
 		for(k=0;k<3;k++){
 			xyz_bis[j][k]=xyz_list[j*3+k];
@@ -838,5 +1121,5 @@
 	}
 	for(i=0;i<numpoints;i++){
-		for(j=0;j<3;j++){ 
+		for(j=0;j<3;j++){
 			for(k=0;k<3;k++){
 				/*Change appropriate line*/
@@ -891,5 +1174,5 @@
 /*}}}*/
 void       Penta::GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlyfloating){/*{{{*/
-	/*Computeportion of the element that is grounded*/ 
+	/*Computeportion of the element that is grounded*/
 
 	bool               floating=true;
@@ -945,5 +1228,5 @@
 /*}}}*/
 IssmDouble Penta::GetGroundedPortion(IssmDouble* xyz_list){/*{{{*/
-	/*Computeportion of the element that is grounded*/ 
+	/*Computeportion of the element that is grounded*/
 
 	bool               mainlyfloating = true;
@@ -1044,4 +1327,105 @@
 
 	return phi;
+}
+/*}}}*/
+IssmDouble Penta::GetIcefrontArea(){/*{{{*/
+
+	IssmDouble  bed[NUMVERTICES]; //basinId[NUMVERTICES];
+	IssmDouble	Haverage,frontarea;
+	IssmDouble  x1,y1,x2,y2,distance;
+	IssmDouble lsf[NUMVERTICES], Haux[NUMVERTICES], surfaces[NUMVERTICES], bases[NUMVERTICES];
+	int* indices=NULL;
+	IssmDouble* H=NULL;;
+	int nrfrontbed,numiceverts;
+
+	if(!this->IsOnBase()) return 0;
+	if(!IsZeroLevelset(MaskIceLevelsetEnum)) return 0;
+
+	/*Retrieve all inputs and parameters*/
+	GetInputListOnVertices(&bed[0],BedEnum);
+	GetInputListOnVertices(&surfaces[0],SurfaceEnum);
+	GetInputListOnVertices(&bases[0],BaseEnum);
+	GetInputListOnVertices(&lsf[0],MaskIceLevelsetEnum);
+
+	nrfrontbed=0;
+	for(int i=0;i<NUMVERTICES2D;i++){
+		/*Find if bed<0*/
+		if(bed[i]<0.) nrfrontbed++;
+	}
+
+	if(nrfrontbed==3){
+		/*2. Find coordinates of where levelset crosses 0*/
+		int         numiceverts;
+		IssmDouble  s[2],x[2],y[2];
+		this->GetLevelsetIntersectionBase(&indices, &numiceverts,&s[0],MaskIceLevelsetEnum,0.);
+		_assert_(numiceverts);
+
+		/*3 Write coordinates*/
+		IssmDouble  xyz_list[NUMVERTICES][3];
+		::GetVerticesCoordinates(&xyz_list[0][0],this->vertices,NUMVERTICES);
+		int counter = 0;
+		if((numiceverts>0) && (numiceverts<NUMVERTICES2D)){
+			for(int i=0;i<numiceverts;i++){
+				for(int n=numiceverts;n<NUMVERTICES2D;n++){ // iterate over no-ice vertices
+					x[counter] = xyz_list[indices[i]][0]+s[counter]*(xyz_list[indices[n]][0]-xyz_list[indices[i]][0]);
+					y[counter] = xyz_list[indices[i]][1]+s[counter]*(xyz_list[indices[n]][1]-xyz_list[indices[i]][1]);
+					counter++;
+				}
+			}
+		}
+		else if(numiceverts==NUMVERTICES2D){ //NUMVERTICES ice vertices: calving front lies on element edge
+
+			for(int i=0;i<NUMVERTICES2D;i++){
+				if(lsf[indices[i]]==0.){
+					x[counter]=xyz_list[indices[i]][0];
+					y[counter]=xyz_list[indices[i]][1];
+					counter++;
+				}
+				if(counter==2) break;
+			}
+			if(counter==1){
+				/*We actually have only 1 vertex on levelset, write a single point as a segment*/
+				x[counter]=x[0];
+				y[counter]=y[0];
+				counter++;
+			}
+		}
+		else{
+			_error_("not sure what's going on here...");
+		}
+		x1=x[0]; y1=y[0]; x2=x[1]; y2=y[1];
+		distance=sqrt(pow((x1-x2),2)+pow((y1-y2),2));
+
+		int numthk=numiceverts+2;
+		H=xNew<IssmDouble>(numthk);
+		for(int iv=0;iv<NUMVERTICES2D;iv++) Haux[iv]=-bed[indices[iv]]; //sort bed in ice/noice
+
+		switch(numiceverts){
+			case 1: // average over triangle
+				H[0]=Haux[0];
+				H[1]=Haux[0]+s[0]*(Haux[1]-Haux[0]);
+				H[2]=Haux[0]+s[1]*(Haux[2]-Haux[0]);
+				Haverage=(H[1]+H[2])/2;
+				break;
+			case 2: // average over quadrangle
+				H[0]=Haux[0];
+				H[1]=Haux[1];
+				H[2]=Haux[0]+s[0]*(Haux[2]-Haux[0]);
+				H[3]=Haux[1]+s[1]*(Haux[2]-Haux[1]);
+				Haverage=(H[2]+H[3])/2;
+				break;
+			default:
+				_error_("Number of ice covered vertices wrong in Tria::GetIceFrontArea(void)");
+				break;
+		}
+		frontarea=distance*Haverage;
+	}
+	else return 0;
+
+	xDelete<int>(indices);
+	xDelete<IssmDouble>(H);
+
+	_assert_(frontarea>0);
+	return frontarea;
 }
 /*}}}*/
@@ -1072,5 +1456,5 @@
 		indicesfront[0]=indicesfront[1];
 		indicesfront[1]=index;
-	}	
+	}
 
 	IssmDouble* xyz_front = xNew<IssmDouble>(2*dim*nrfrontnodes);
@@ -1093,6 +1477,8 @@
 	if(!input) _error_("No input of type " << EnumToStringx(enumtype) << " found in tria");
 
+	int index = this->GetNodeIndex(node);
+
 	GaussPenta* gauss=new GaussPenta();
-	gauss->GaussVertex(this->GetNodeIndex(node));
+	gauss->GaussNode(this->element_type,index);
 
 	input->GetInputValue(pvalue,gauss);
@@ -1100,4 +1486,18 @@
 }
 /*}}}*/
+void       Penta::GetInputValue(IssmDouble* pvalue,Vertex* vertex,int enumtype){/*{{{*/
+
+	Input* input=inputs->GetInput(enumtype);
+	if(!input) _error_("No input of type " << EnumToStringx(enumtype) << " found in tria");
+
+	int index = this->GetVertexIndex(vertex);
+
+	GaussPenta* gauss=new GaussPenta();
+	gauss->GaussVertex(index);
+
+	input->GetInputValue(pvalue,gauss);
+	delete gauss;
+}
+/*}}}*/
 Penta*     Penta::GetLowerPenta(void){/*{{{*/
 
@@ -1109,20 +1509,87 @@
 }
 /*}}}*/
-Node*      Penta::GetNode(int node_number){/*{{{*/
-	_assert_(node_number>=0); 
-	_assert_(node_number<this->NumberofNodes(this->element_type)); 
-	return this->nodes[node_number];
-}
-/*}}}*/
-int        Penta::GetNodeIndex(Node* node){/*{{{*/
-
-	_assert_(nodes);
-	int numnodes = this->NumberofNodes(this->element_type);
-
-	for(int i=0;i<numnodes;i++){
-		if(node==nodes[i]) return i;
-	}
-	_error_("Node provided not found among element nodes");
-
+void       Penta::GetLevelsetIntersectionBase(int** pindices, int* pnumiceverts, IssmDouble* fraction, int levelset_enum, IssmDouble level){/*{{{*/
+
+	/* GetLevelsetIntersection computes:
+	 * 1. indices of element, sorted in [iceverts, noiceverts] in counterclockwise fashion,
+	 * 2. fraction of intersected triangle edges intersected by levelset, lying below level*/
+
+	/*Intermediaries*/
+	int i, numiceverts, numnoiceverts;
+	int ind0, ind1, lastindex;
+	int indices_ice[NUMVERTICES2D],indices_noice[NUMVERTICES2D];
+	IssmDouble lsf[NUMVERTICES];
+	int* indices = xNew<int>(NUMVERTICES2D);
+
+	/*Retrieve all inputs and parameters*/
+	GetInputListOnVertices(&lsf[0],levelset_enum);
+
+	/* Determine distribution of ice over element.
+	 * Exploit: ice/no-ice parts are connected, so find starting vertex of segment*/
+	lastindex=0;
+	for(i=0;i<NUMVERTICES2D;i++){ // go backwards along vertices, and check for sign change
+		ind0=(NUMVERTICES2D-i)%NUMVERTICES2D;
+		ind1=(ind0-1+NUMVERTICES2D)%NUMVERTICES2D;
+		if((lsf[ind0]-level)*(lsf[ind1]-level)<=0.){ // levelset has been crossed, find last index belonging to segment
+			if(lsf[ind1]==level) //if levelset intersects 2nd vertex, choose this vertex as last
+				lastindex=ind1;
+			else
+				lastindex=ind0;
+			break;
+		}
+	}
+
+	numiceverts=0;
+	numnoiceverts=0;
+	for(i=0;i<NUMVERTICES2D;i++){
+		ind0=(lastindex+i)%NUMVERTICES2D;
+		if(lsf[i]<=level){
+			indices_ice[numiceverts]=i;
+			numiceverts++;
+		}
+		else{
+			indices_noice[numnoiceverts]=i;
+			numnoiceverts++;
+		}
+	}
+	//merge indices
+	for(i=0;i<numiceverts;i++){indices[i]=indices_ice[i];}
+	for(i=0;i<numnoiceverts;i++){indices[numiceverts+i]=indices_noice[i];}
+
+	switch (numiceverts){
+		case 0: // no vertex has ice: element is ice free, no intersection
+			for(i=0;i<2;i++)
+				fraction[i]=0.;
+			break;
+		case 1: // one vertex has ice:
+			for(i=0;i<2;i++){
+				fraction[i]=(level-lsf[indices[0]])/(lsf[indices[numiceverts+i]]-lsf[indices[0]]);
+			}
+			break;
+		case 2: // two vertices have ice: fraction is computed from first ice vertex to last in CCW fashion
+			for(i=0;i<2;i++){
+				fraction[i]=(level-lsf[indices[i]])/(lsf[indices[numiceverts]]-lsf[indices[i]]);
+			}
+			break;
+		case NUMVERTICES2D: // all vertices have ice: return triangle area
+			for(i=0;i<2;i++)
+				fraction[i]=1.;
+			break;
+		default:
+			_error_("Wrong number of ice vertices in Penta::GetLevelsetIntersectionBase!");
+			break;
+	}
+
+	*pindices=indices;
+	*pnumiceverts=numiceverts;
+}
+/*}}}*/
+int        Penta::GetVertexIndex(Vertex* vertex){/*{{{*/
+	_assert_(vertices);
+	for(int i=0;i<NUMVERTICES;i++){
+		if(vertex==vertices[i])
+		 return i;
+	}
+	_error_("Vertex provided not found among element vertices");
 }
 /*}}}*/
@@ -1136,5 +1603,5 @@
 /*}}}*/
 int        Penta::GetNumberOfVertices(void){/*{{{*/
-	return NUMVERTICES; 
+	return NUMVERTICES;
 }
 /*}}}*/
@@ -1294,4 +1761,122 @@
 }
 /*}}}*/
+IssmDouble Penta::IcefrontMassFluxLevelset(bool scaled){/*{{{*/
+
+	/*Make sure there is an ice front here*/
+	if(!IsIceInElement() || !IsZeroLevelset(MaskIceLevelsetEnum) || !IsOnBase()) return 0;
+
+	/*Scaled not implemented yet...*/
+	_assert_(!scaled);
+
+	int               domaintype,index1,index2;
+	const IssmPDouble epsilon = 1.e-15;
+	IssmDouble        s1,s2;
+	IssmDouble        gl[NUMVERTICES];
+	IssmDouble        xyz_front[2][3];
+
+	IssmDouble *xyz_list = NULL;
+	this->GetVerticesCoordinates(&xyz_list);
+
+	/*Recover parameters and values*/
+	GetInputListOnVertices(&gl[0],MaskIceLevelsetEnum);
+
+	/*Be sure that values are not zero*/
+	if(gl[0]==0.) gl[0]=gl[0]+epsilon;
+	if(gl[1]==0.) gl[1]=gl[1]+epsilon;
+	if(gl[2]==0.) gl[2]=gl[2]+epsilon;
+
+	int pt1 = 0;
+	int pt2 = 1;
+	if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
+
+		/*Portion of the segments*/
+		s1=gl[2]/(gl[2]-gl[1]);
+		s2=gl[2]/(gl[2]-gl[0]);
+		if(gl[2]<0.){
+			pt1 = 1; pt2 = 0;
+		}
+		xyz_front[pt2][0]=xyz_list[3*2+0]+s1*(xyz_list[3*1+0]-xyz_list[3*2+0]);
+		xyz_front[pt2][1]=xyz_list[3*2+1]+s1*(xyz_list[3*1+1]-xyz_list[3*2+1]);
+		xyz_front[pt2][2]=xyz_list[3*2+2]+s1*(xyz_list[3*1+2]-xyz_list[3*2+2]);
+		xyz_front[pt1][0]=xyz_list[3*2+0]+s2*(xyz_list[3*0+0]-xyz_list[3*2+0]);
+		xyz_front[pt1][1]=xyz_list[3*2+1]+s2*(xyz_list[3*0+1]-xyz_list[3*2+1]);
+		xyz_front[pt1][2]=xyz_list[3*2+2]+s2*(xyz_list[3*0+2]-xyz_list[3*2+2]);
+	}
+	else if(gl[1]*gl[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
+
+		/*Portion of the segments*/
+		s1=gl[0]/(gl[0]-gl[1]);
+		s2=gl[0]/(gl[0]-gl[2]);
+		if(gl[0]<0.){
+			pt1 = 1; pt2 = 0;
+		}
+
+		xyz_front[pt1][0]=xyz_list[3*0+0]+s1*(xyz_list[3*1+0]-xyz_list[3*0+0]);
+		xyz_front[pt1][1]=xyz_list[3*0+1]+s1*(xyz_list[3*1+1]-xyz_list[3*0+1]);
+		xyz_front[pt1][2]=xyz_list[3*0+2]+s1*(xyz_list[3*1+2]-xyz_list[3*0+2]);
+		xyz_front[pt2][0]=xyz_list[3*0+0]+s2*(xyz_list[3*2+0]-xyz_list[3*0+0]);
+		xyz_front[pt2][1]=xyz_list[3*0+1]+s2*(xyz_list[3*2+1]-xyz_list[3*0+1]);
+		xyz_front[pt2][2]=xyz_list[3*0+2]+s2*(xyz_list[3*2+2]-xyz_list[3*0+2]);
+	}
+	else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
+
+		/*Portion of the segments*/
+		s1=gl[1]/(gl[1]-gl[0]);
+		s2=gl[1]/(gl[1]-gl[2]);
+		if(gl[1]<0.){
+			pt1 = 1; pt2 = 0;
+		}
+
+		xyz_front[pt2][0]=xyz_list[3*1+0]+s1*(xyz_list[3*0+0]-xyz_list[3*1+0]);
+		xyz_front[pt2][1]=xyz_list[3*1+1]+s1*(xyz_list[3*0+1]-xyz_list[3*1+1]);
+		xyz_front[pt2][2]=xyz_list[3*1+2]+s1*(xyz_list[3*0+2]-xyz_list[3*1+2]);
+		xyz_front[pt1][0]=xyz_list[3*1+0]+s2*(xyz_list[3*2+0]-xyz_list[3*1+0]);
+		xyz_front[pt1][1]=xyz_list[3*1+1]+s2*(xyz_list[3*2+1]-xyz_list[3*1+1]);
+		xyz_front[pt1][2]=xyz_list[3*1+2]+s2*(xyz_list[3*2+2]-xyz_list[3*1+2]);
+	}
+	else{
+		_error_("case not possible");
+	}
+
+
+	/*Some checks in debugging mode*/
+	_assert_(s1>=0 && s1<=1.);
+	_assert_(s2>=0 && s2<=1.);
+
+	/*Get normal vector*/
+	IssmDouble normal[3];
+	this->NormalSectionBase(&normal[0],&xyz_front[0][0]);
+	normal[0] = -normal[0];
+	normal[1] = -normal[1];
+
+	this->InputDepthAverageAtBase(VxEnum,VxAverageEnum);
+	this->InputDepthAverageAtBase(VyEnum,VyAverageEnum);
+
+	/*Get inputs*/
+	IssmDouble flux = 0.;
+	IssmDouble vx,vy,thickness,Jdet;
+	IssmDouble rho_ice=FindParam(MaterialsRhoIceEnum);
+	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+	Input* vx_input=NULL;
+	Input* vy_input=NULL;
+	vx_input=inputs->GetInput(VxAverageEnum); _assert_(vx_input);
+	vy_input=inputs->GetInput(VyAverageEnum); _assert_(vy_input);
+
+	/*Start looping on Gaussian points*/
+	Gauss* gauss=this->NewGaussBase(xyz_list,&xyz_front[0][0],3);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+		thickness_input->GetInputValue(&thickness,gauss);
+		vx_input->GetInputValue(&vx,gauss);
+		vy_input->GetInputValue(&vy,gauss);
+		this->JacobianDeterminantLine(&Jdet,&xyz_front[0][0],gauss);
+
+		flux += rho_ice*Jdet*gauss->weight*thickness*(vx*normal[0] + vy*normal[1]);
+	}
+
+	return flux;
+}
+/*}}}*/
 IssmDouble Penta::IceVolume(bool scaled){/*{{{*/
 
@@ -1331,6 +1916,6 @@
 	if(!IsIceInElement() || IsFloating() || !IsOnBase())return 0;
 
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_water=matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	rho_water=FindParam(MaterialsRhoSeawaterEnum);
 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
 
@@ -1349,4 +1934,5 @@
 	Input* base_input        = inputs->GetInput(BaseEnum);        _assert_(base_input);
 	Input* bed_input = inputs->GetInput(BedEnum); _assert_(bed_input);
+	if(!bed_input) _error_("Could not find bed");
 	surface_input->GetInputAverage(&surface);
 	base_input->GetInputAverage(&bed);
@@ -1415,5 +2001,5 @@
 		case PentaInputEnum:
 		case ControlInputEnum:
-			depth_averaged_input=new PentaInput(average_enum,&total[0],P1Enum); 
+			depth_averaged_input=new PentaInput(average_enum,&total[0],P1Enum);
 			break;
 		default:
@@ -1482,5 +2068,5 @@
 	/*Recover vertices ids needed to initialize inputs*/
 	_assert_(iomodel->elements);
-	for(i=0;i<NUMVERTICES;i++){ 
+	for(i=0;i<NUMVERTICES;i++){
 		penta_vertex_ids[i]=iomodel->elements[NUMVERTICES*index+i]; //ids for vertices are in the elements array from Matlab
 	}
@@ -1594,6 +2180,6 @@
 
 	/*Fetch dof list and allocate solution vector*/
-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
-	IssmDouble* values    = xNew<IssmDouble>(numnodes);
+	GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
+	IssmDouble* values = xNew<IssmDouble>(numnodes);
 
 	/*Use the dof list to index into the solution vector: */
@@ -1625,5 +2211,5 @@
 
 	/*Get dof list: */
-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+	GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
 
 	/*Use the dof list to index into the solution vector and extrude it */
@@ -1662,5 +2248,13 @@
 
 	switch(type){
-		case VertexPIdEnum: 
+		case VertexLIdEnum:
+			for (int i=0;i<NUMVERTICES;i++){
+				values[i]=vector[this->vertices[i]->Lid()];
+			}
+			/*update input*/
+			this->inputs->AddInput(new PentaInput(name,values,P1Enum));
+			return;
+
+		case VertexPIdEnum:
 			for (int i=0;i<NUMVERTICES;i++){
 				values[i]=vector[this->vertices[i]->Pid()];
@@ -1670,5 +2264,5 @@
 			return;
 
-		case VertexSIdEnum: 
+		case VertexSIdEnum:
 			for (int i=0;i<NUMVERTICES;i++){
 				values[i]=vector[this->vertices[i]->Sid()];
@@ -1725,5 +2319,5 @@
 	isicefront=false;
 	if(IsIceInElement()){
-		nrice=0;       
+		nrice=0;
 		for(i=0;i<NUMVERTICES2D;i++)
 			if(ls[i]<0.) nrice++;
@@ -1927,4 +2521,13 @@
 }
 /*}}}*/
+Gauss*     Penta::NewGaussBase(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz){/*{{{*/
+
+	IssmDouble  area_coordinates[2][3];
+
+	GetAreaCoordinates(&area_coordinates[0][0],xyz_list_front,xyz_list,2);
+
+	return new GaussPenta(area_coordinates,order_horiz);
+}
+/*}}}*/
 Gauss*     Penta::NewGaussLine(int vertex1,int vertex2,int order){/*{{{*/
 	return new GaussPenta(vertex1,vertex2,order);
@@ -2014,5 +2617,5 @@
 
 	/*First, serarch the input: */
-	data=inputs->GetInput(natureofdataenum); 
+	data=inputs->GetInput(natureofdataenum);
 
 	/*figure out if we have the vertex id: */
@@ -2078,4 +2681,19 @@
 }
 /*}}}*/
+void       Penta::NormalSectionBase(IssmDouble* normal,IssmDouble* xyz_list){/*{{{*/
+
+	/*Build unit outward pointing vector*/
+	IssmDouble vector[2];
+	IssmDouble norm;
+
+	vector[0]=xyz_list[1*3+0] - xyz_list[0*3+0];
+	vector[1]=xyz_list[1*3+1] - xyz_list[0*3+1];
+
+	norm=sqrt(vector[0]*vector[0] + vector[1]*vector[1]);
+
+	normal[0]= + vector[1]/norm;
+	normal[1]= - vector[0]/norm;
+}
+/*}}}*/
 void       Penta::NormalTop(IssmDouble* top_normal,IssmDouble* xyz_list){/*{{{*/
 
@@ -2121,6 +2739,6 @@
 
 	/*material parameters: */
-	rho_water=matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 	density=rho_ice/rho_water;
 	GetInputListOnVertices(&h[0],ThicknessEnum);
@@ -2232,14 +2850,14 @@
 
 		/*New X axis          New Z axis*/
-		xz_plane[0]=1.;       xz_plane[3]=-slopex;  
-		xz_plane[1]=0.;       xz_plane[4]=-slopey;  
-		xz_plane[2]=slopex;   xz_plane[5]=1.;          
+		xz_plane[0]=1.;       xz_plane[3]=-slopex;
+		xz_plane[1]=0.;       xz_plane[4]=-slopey;
+		xz_plane[2]=slopex;   xz_plane[5]=1.;
 
 		if(groundedice>=0){
 			if(this->nodes[indices[i]]->GetApproximation()==FSvelocityEnum){
-				this->nodes[indices[i]]->DofInSSet(2); //vz 
+				this->nodes[indices[i]]->DofInSSet(2); //vz
 			}
 			else if(this->nodes[indices[i]]->GetApproximation()==SSAFSApproximationEnum || this->nodes[indices[i]]->GetApproximation()==HOFSApproximationEnum){
-				this->nodes[indices[i]]->DofInSSet(4); //vz 
+				this->nodes[indices[i]]->DofInSSet(4); //vz
 			}
 			else _error_("Flow equation approximation"<<EnumToStringx(this->nodes[indices[i]]->GetApproximation())<<" not supported yet");
@@ -2250,5 +2868,5 @@
 			}
 			else if(this->nodes[indices[i]]->GetApproximation()==SSAFSApproximationEnum || this->nodes[indices[i]]->GetApproximation()==HOFSApproximationEnum){
-				this->nodes[indices[i]]->DofInFSet(4); //vz 
+				this->nodes[indices[i]]->DofInFSet(4); //vz
 			}
 			else _error_("Flow equation approximation"<<EnumToStringx(this->nodes[indices[i]]->GetApproximation())<<" not supported yet");
@@ -2269,5 +2887,4 @@
 	this->vertices=NULL;
 	this->material=NULL;
-	this->matpar=NULL;
 	this->verticalneighbors=NULL;
 	this->parameters=NULL;
@@ -2277,14 +2894,68 @@
 	this->hvertices->reset();
 	this->hmaterial->reset();
-	this->hmatpar->reset();
 	if(this->hneighbors) this->hneighbors->reset();
 
 }
 /*}}}*/
-void       Penta::SetClone(int* minranks){/*{{{*/
-
-	_error_("not implemented yet");
-}
-
+void       Penta::RignotMeltParameterization(){/*{{{*/
+
+	if(!this->IsOnBase()) return;
+
+	IssmDouble A, B, alpha, beta;
+	IssmDouble bed,qsg,qsg_basin,TF,yts;
+	int numbasins;
+	IssmDouble basinid[NUMVERTICES];
+	IssmDouble* basin_icefront_area=NULL;
+
+	/* Coefficients */
+	A    = 3e-4;
+	B    = 0.15;
+	alpha = 0.39;
+	beta = 1.18;
+
+	/*Get inputs*/
+	Input* bed_input = this->GetInput(BedEnum);                     _assert_(bed_input);
+	Input* qsg_input = this->GetInput(FrontalForcingsSubglacialDischargeEnum);		 _assert_(qsg_input);
+	Input* TF_input  = this->GetInput(FrontalForcingsThermalForcingEnum);          _assert_(TF_input);
+	GetInputListOnVertices(&basinid[0],FrontalForcingsBasinIdEnum);
+
+	this->FindParam(&yts, ConstantsYtsEnum);
+	this->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
+	this->parameters->FindParam(&basin_icefront_area,&numbasins,FrontalForcingsBasinIcefrontAreaEnum);
+
+	IssmDouble meltrates[NUMVERTICES2D];  //frontal melt-rate
+
+	/* Start looping on the number of vertices: */
+	GaussPenta* gauss=new GaussPenta();
+	for(int iv=0;iv<NUMVERTICES2D;iv++){
+		gauss->GaussVertex(iv);
+
+		/* Get variables */
+		bed_input->GetInputValue(&bed,gauss);
+		qsg_input->GetInputValue(&qsg,gauss);
+		TF_input->GetInputValue(&TF,gauss);
+
+		if(basinid[iv]==0 || basin_icefront_area[reCast<int>(basinid[iv])-1]==0.) meltrates[iv]=0.;
+		else{
+			/* change the unit of qsg (m^3/d -> m/d) with ice front area */
+			qsg_basin=qsg/basin_icefront_area[reCast<int>(basinid[iv])-1];
+
+			/* calculate melt rates */
+			meltrates[iv]=((A*max(-bed,0.)*pow(max(qsg_basin,0.),alpha)+B)*pow(max(TF,0.),beta))/86400; //[m/s]
+		}
+
+		if(xIsNan<IssmDouble>(meltrates[iv])) _error_("NaN found in vector");
+		if(xIsInf<IssmDouble>(meltrates[iv])) _error_("Inf found in vector");
+	}
+
+	/*Add input*/
+	this->inputs->AddInput(new PentaInput(CalvingMeltingrateEnum,&meltrates[0],P1Enum));
+
+	this->InputExtrude(CalvingMeltingrateEnum,-1);
+
+	/*Cleanup and return*/
+	xDelete<IssmDouble>(basin_icefront_area);
+	delete gauss;
+}
 /*}}}*/
 void       Penta::SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index,int offset, int N, int M){/*{{{*/
@@ -2413,4 +3084,5 @@
 	if(this->inputs->GetInput(CalvingratexEnum)) this->InputDepthAverageAtBase(CalvingratexEnum,CalvingratexAverageEnum);
 	if(this->inputs->GetInput(CalvingrateyEnum)) this->InputDepthAverageAtBase(CalvingrateyEnum,CalvingrateyAverageEnum);
+
 	Tria* tria=(Tria*)SpawnTria(0,1,2);
 	switch(this->material->ObjectEnum()){
@@ -2459,8 +3131,7 @@
 	tria->material=(Material*)this->material->copy2(tria);
 
-	/*recover nodes, material and matpar: */
+	/*recover nodes, material*/
 	tria->nodes=(Node**)tria->hnodes[analysis_counter]->deliverp();
 	tria->vertices=(Vertex**)tria->hvertices->deliverp();
-	tria->matpar=(Matpar*)tria->hmatpar->delivers();
 
 	/*Return new Tria*/
@@ -2470,5 +3141,5 @@
 IssmDouble Penta::StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){/*{{{*/
 	/*Compute stabilization parameter*/
-	/*kappa=thermalconductivity/(rho_ice*hearcapacity) for thermal model*/
+	/*kappa=thermalconductivity/(rho_ice*heatcapacity) for thermal model*/
 	/*kappa=enthalpydiffusionparameter for enthalpy model*/
 
@@ -2477,5 +3148,5 @@
 
 	normu=pow(pow(u,2)+pow(v,2)+pow(w,2),0.5);
-	if(normu*diameter/(3*2*kappa)<1){ 
+	if(normu*diameter/(3*2*kappa)<1){
 		tau_parameter=pow(diameter,2)/(3*2*2*kappa);
 	}
@@ -2483,4 +3154,30 @@
 
 	return tau_parameter;
+}/*}}}*/
+void Penta::StabilizationParameterAnisotropic(IssmDouble* tau_parameter_anisotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy, IssmDouble hz, IssmDouble kappa){/*{{{*/
+	/*Compute stabilization parameter*/
+	/*kappa=thermalconductivity/(rho_ice*heatcapacity) for thermal model*/
+	/*kappa=enthalpydiffusionparameter for enthalpy model*/
+
+	IssmDouble normu,hk,C,area,p;
+
+	/* compute tau for the horizontal direction */
+	p=2.; C=3.;
+	normu=pow(pow(u,p)+pow(v,p)+pow(w,p),1./p);
+	hk=sqrt(pow(hx,2)+pow(hy,2));
+
+	if(normu*hk/(C*2*kappa)<1){
+		tau_parameter_anisotropic[0]=pow(hk,2)/(C*2*2*kappa);
+	}
+	else tau_parameter_anisotropic[0]=hk/(2*normu);
+
+	/* compute tau for the vertical direction */
+	hk=hz;
+	if(normu*hk/(C*2*kappa)<1){
+		tau_parameter_anisotropic[1]=pow(hk,2)/(C*2*2*kappa);
+	}
+	else{
+		tau_parameter_anisotropic[1]=hk/(2*normu);
+	}
 }
 /*}}}*/
@@ -2636,5 +3333,5 @@
 
 				if(prof<water_depth&prof<thickness){
-					/* Compute the local stress intensity factor*/ 
+					/* Compute the local stress intensity factor*/
 					ki[ig]+=Jdet[ig]*gauss->weight*stress_xx*StressIntensityIntegralWeight(prof,min(water_depth,thickness),thickness);
 				}
@@ -2676,5 +3373,5 @@
 	else if (approximation==SSAApproximationEnum){
 
-		/*This element should be collapsed into a tria element at its base. Create this tria element, 
+		/*This element should be collapsed into a tria element at its base. Create this tria element,
 		 * and compute SurfaceArea*/
 		tria=(Tria*)SpawnTria(0,1,2);
@@ -2735,4 +3432,255 @@
 	return dt;
 }/*}}}*/
+IssmDouble Penta::TotalCalvingFluxLevelset(bool scaled){/*{{{*/
+
+	/*Make sure there is an ice front here*/
+	if(!IsIceInElement() || !IsZeroLevelset(MaskIceLevelsetEnum) || !IsOnBase()) return 0;
+
+	/*Scaled not implemented yet...*/
+	_assert_(!scaled);
+
+	int               domaintype,index1,index2;
+	const IssmPDouble epsilon = 1.e-15;
+	IssmDouble        s1,s2;
+	IssmDouble        gl[NUMVERTICES];
+	IssmDouble        xyz_front[2][3];
+
+	IssmDouble *xyz_list = NULL;
+	this->GetVerticesCoordinates(&xyz_list);
+
+	/*Recover parameters and values*/
+	GetInputListOnVertices(&gl[0],MaskIceLevelsetEnum);
+
+	/*Be sure that values are not zero*/
+	if(gl[0]==0.) gl[0]=gl[0]+epsilon;
+	if(gl[1]==0.) gl[1]=gl[1]+epsilon;
+	if(gl[2]==0.) gl[2]=gl[2]+epsilon;
+
+	int pt1 = 0;
+	int pt2 = 1;
+	if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
+
+		/*Portion of the segments*/
+		s1=gl[2]/(gl[2]-gl[1]);
+		s2=gl[2]/(gl[2]-gl[0]);
+		if(gl[2]<0.){
+			pt1 = 1; pt2 = 0;
+		}
+		xyz_front[pt2][0]=xyz_list[3*2+0]+s1*(xyz_list[3*1+0]-xyz_list[3*2+0]);
+		xyz_front[pt2][1]=xyz_list[3*2+1]+s1*(xyz_list[3*1+1]-xyz_list[3*2+1]);
+		xyz_front[pt2][2]=xyz_list[3*2+2]+s1*(xyz_list[3*1+2]-xyz_list[3*2+2]);
+		xyz_front[pt1][0]=xyz_list[3*2+0]+s2*(xyz_list[3*0+0]-xyz_list[3*2+0]);
+		xyz_front[pt1][1]=xyz_list[3*2+1]+s2*(xyz_list[3*0+1]-xyz_list[3*2+1]);
+		xyz_front[pt1][2]=xyz_list[3*2+2]+s2*(xyz_list[3*0+2]-xyz_list[3*2+2]);
+	}
+	else if(gl[1]*gl[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
+
+		/*Portion of the segments*/
+		s1=gl[0]/(gl[0]-gl[1]);
+		s2=gl[0]/(gl[0]-gl[2]);
+		if(gl[0]<0.){
+			pt1 = 1; pt2 = 0;
+		}
+
+		xyz_front[pt1][0]=xyz_list[3*0+0]+s1*(xyz_list[3*1+0]-xyz_list[3*0+0]);
+		xyz_front[pt1][1]=xyz_list[3*0+1]+s1*(xyz_list[3*1+1]-xyz_list[3*0+1]);
+		xyz_front[pt1][2]=xyz_list[3*0+2]+s1*(xyz_list[3*1+2]-xyz_list[3*0+2]);
+		xyz_front[pt2][0]=xyz_list[3*0+0]+s2*(xyz_list[3*2+0]-xyz_list[3*0+0]);
+		xyz_front[pt2][1]=xyz_list[3*0+1]+s2*(xyz_list[3*2+1]-xyz_list[3*0+1]);
+		xyz_front[pt2][2]=xyz_list[3*0+2]+s2*(xyz_list[3*2+2]-xyz_list[3*0+2]);
+	}
+	else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
+
+		/*Portion of the segments*/
+		s1=gl[1]/(gl[1]-gl[0]);
+		s2=gl[1]/(gl[1]-gl[2]);
+		if(gl[1]<0.){
+			pt1 = 1; pt2 = 0;
+		}
+
+		xyz_front[pt2][0]=xyz_list[3*1+0]+s1*(xyz_list[3*0+0]-xyz_list[3*1+0]);
+		xyz_front[pt2][1]=xyz_list[3*1+1]+s1*(xyz_list[3*0+1]-xyz_list[3*1+1]);
+		xyz_front[pt2][2]=xyz_list[3*1+2]+s1*(xyz_list[3*0+2]-xyz_list[3*1+2]);
+		xyz_front[pt1][0]=xyz_list[3*1+0]+s2*(xyz_list[3*2+0]-xyz_list[3*1+0]);
+		xyz_front[pt1][1]=xyz_list[3*1+1]+s2*(xyz_list[3*2+1]-xyz_list[3*1+1]);
+		xyz_front[pt1][2]=xyz_list[3*1+2]+s2*(xyz_list[3*2+2]-xyz_list[3*1+2]);
+	}
+	else{
+		_error_("case not possible");
+	}
+
+
+	/*Some checks in debugging mode*/
+	_assert_(s1>=0 && s1<=1.);
+	_assert_(s2>=0 && s2<=1.);
+
+	/*Get normal vector*/
+	IssmDouble normal[3];
+	this->NormalSectionBase(&normal[0],&xyz_front[0][0]);
+	normal[0] = -normal[0];
+	normal[1] = -normal[1];
+
+	/*Get inputs*/
+	IssmDouble flux = 0.;
+	IssmDouble calvingratex,calvingratey,thickness,Jdet;
+	IssmDouble rho_ice=FindParam(MaterialsRhoIceEnum);
+	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+	Input* calvingratex_input=NULL;
+	Input* calvingratey_input=NULL;
+	calvingratex_input=inputs->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
+	calvingratey_input=inputs->GetInput(CalvingrateyEnum); _assert_(calvingratey_input);
+
+	/*Start looping on Gaussian points*/
+	Gauss* gauss=this->NewGaussBase(xyz_list,&xyz_front[0][0],3);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+		thickness_input->GetInputValue(&thickness,gauss);
+		calvingratex_input->GetInputValue(&calvingratex,gauss);
+		calvingratey_input->GetInputValue(&calvingratey,gauss);
+		this->JacobianDeterminantLine(&Jdet,&xyz_front[0][0],gauss);
+
+		flux += rho_ice*Jdet*gauss->weight*thickness*(calvingratex*normal[0] + calvingratey*normal[1]);
+	}
+
+	return flux;
+
+	/*Clean up and return*/
+	delete gauss;
+}
+/*}}}*/
+IssmDouble Penta::TotalCalvingMeltingFluxLevelset(bool scaled){/*{{{*/
+
+	/*Make sure there is an ice front here*/
+	if(!IsIceInElement() || !IsZeroLevelset(MaskIceLevelsetEnum) || !IsOnBase()) return 0;
+
+	/*Scaled not implemented yet...*/
+	_assert_(!scaled);
+
+	int               domaintype,index1,index2;
+	const IssmPDouble epsilon = 1.e-15;
+	IssmDouble        s1,s2;
+	IssmDouble        gl[NUMVERTICES];
+	IssmDouble        xyz_front[2][3];
+
+	IssmDouble *xyz_list = NULL;
+	this->GetVerticesCoordinates(&xyz_list);
+
+	/*Recover parameters and values*/
+	GetInputListOnVertices(&gl[0],MaskIceLevelsetEnum);
+
+	/*Be sure that values are not zero*/
+	if(gl[0]==0.) gl[0]=gl[0]+epsilon;
+	if(gl[1]==0.) gl[1]=gl[1]+epsilon;
+	if(gl[2]==0.) gl[2]=gl[2]+epsilon;
+
+	int pt1 = 0;
+	int pt2 = 1;
+	if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
+
+		/*Portion of the segments*/
+		s1=gl[2]/(gl[2]-gl[1]);
+		s2=gl[2]/(gl[2]-gl[0]);
+		if(gl[2]<0.){
+			pt1 = 1; pt2 = 0;
+		}
+		xyz_front[pt2][0]=xyz_list[3*2+0]+s1*(xyz_list[3*1+0]-xyz_list[3*2+0]);
+		xyz_front[pt2][1]=xyz_list[3*2+1]+s1*(xyz_list[3*1+1]-xyz_list[3*2+1]);
+		xyz_front[pt2][2]=xyz_list[3*2+2]+s1*(xyz_list[3*1+2]-xyz_list[3*2+2]);
+		xyz_front[pt1][0]=xyz_list[3*2+0]+s2*(xyz_list[3*0+0]-xyz_list[3*2+0]);
+		xyz_front[pt1][1]=xyz_list[3*2+1]+s2*(xyz_list[3*0+1]-xyz_list[3*2+1]);
+		xyz_front[pt1][2]=xyz_list[3*2+2]+s2*(xyz_list[3*0+2]-xyz_list[3*2+2]);
+	}
+	else if(gl[1]*gl[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
+
+		/*Portion of the segments*/
+		s1=gl[0]/(gl[0]-gl[1]);
+		s2=gl[0]/(gl[0]-gl[2]);
+		if(gl[0]<0.){
+			pt1 = 1; pt2 = 0;
+		}
+
+		xyz_front[pt1][0]=xyz_list[3*0+0]+s1*(xyz_list[3*1+0]-xyz_list[3*0+0]);
+		xyz_front[pt1][1]=xyz_list[3*0+1]+s1*(xyz_list[3*1+1]-xyz_list[3*0+1]);
+		xyz_front[pt1][2]=xyz_list[3*0+2]+s1*(xyz_list[3*1+2]-xyz_list[3*0+2]);
+		xyz_front[pt2][0]=xyz_list[3*0+0]+s2*(xyz_list[3*2+0]-xyz_list[3*0+0]);
+		xyz_front[pt2][1]=xyz_list[3*0+1]+s2*(xyz_list[3*2+1]-xyz_list[3*0+1]);
+		xyz_front[pt2][2]=xyz_list[3*0+2]+s2*(xyz_list[3*2+2]-xyz_list[3*0+2]);
+	}
+	else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
+
+		/*Portion of the segments*/
+		s1=gl[1]/(gl[1]-gl[0]);
+		s2=gl[1]/(gl[1]-gl[2]);
+		if(gl[1]<0.){
+			pt1 = 1; pt2 = 0;
+		}
+
+		xyz_front[pt2][0]=xyz_list[3*1+0]+s1*(xyz_list[3*0+0]-xyz_list[3*1+0]);
+		xyz_front[pt2][1]=xyz_list[3*1+1]+s1*(xyz_list[3*0+1]-xyz_list[3*1+1]);
+		xyz_front[pt2][2]=xyz_list[3*1+2]+s1*(xyz_list[3*0+2]-xyz_list[3*1+2]);
+		xyz_front[pt1][0]=xyz_list[3*1+0]+s2*(xyz_list[3*2+0]-xyz_list[3*1+0]);
+		xyz_front[pt1][1]=xyz_list[3*1+1]+s2*(xyz_list[3*2+1]-xyz_list[3*1+1]);
+		xyz_front[pt1][2]=xyz_list[3*1+2]+s2*(xyz_list[3*2+2]-xyz_list[3*1+2]);
+	}
+	else{
+		_error_("case not possible");
+	}
+
+
+	/*Some checks in debugging mode*/
+	_assert_(s1>=0 && s1<=1.);
+	_assert_(s2>=0 && s2<=1.);
+
+	/*Get normal vector*/
+	IssmDouble normal[3];
+	this->NormalSectionBase(&normal[0],&xyz_front[0][0]);
+	normal[0] = -normal[0];
+	normal[1] = -normal[1];
+
+	this->InputDepthAverageAtBase(VxEnum,VxAverageEnum);
+	this->InputDepthAverageAtBase(VyEnum,VyAverageEnum);
+
+	/*Get inputs*/
+	IssmDouble flux = 0.;
+	IssmDouble calvingratex,calvingratey,vx,vy,vel,meltingrate,meltingratex,meltingratey,thickness,Jdet;
+	IssmDouble rho_ice=FindParam(MaterialsRhoIceEnum);
+	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+	Input* calvingratex_input=NULL;
+	Input* calvingratey_input=NULL;
+	Input* vx_input=NULL;
+	Input* vy_input=NULL;
+	Input* meltingrate_input=NULL;
+	calvingratex_input=inputs->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
+	calvingratey_input=inputs->GetInput(CalvingrateyEnum); _assert_(calvingratey_input);
+	vx_input=inputs->GetInput(VxAverageEnum); _assert_(vx_input);
+	vy_input=inputs->GetInput(VyAverageEnum); _assert_(vy_input);
+	meltingrate_input=inputs->GetInput(CalvingMeltingrateEnum); _assert_(meltingrate_input);
+
+	/*Start looping on Gaussian points*/
+	Gauss* gauss=this->NewGaussBase(xyz_list,&xyz_front[0][0],3);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+		thickness_input->GetInputValue(&thickness,gauss);
+		calvingratex_input->GetInputValue(&calvingratex,gauss);
+		calvingratey_input->GetInputValue(&calvingratey,gauss);
+		vx_input->GetInputValue(&vx,gauss);
+		vy_input->GetInputValue(&vy,gauss);
+		vel=vx*vx+vy*vy;
+		meltingrate_input->GetInputValue(&meltingrate,gauss);
+		meltingratex=meltingrate*vx/(sqrt(vel)+1.e-14);
+		meltingratey=meltingrate*vy/(sqrt(vel)+1.e-14);
+		this->JacobianDeterminantLine(&Jdet,&xyz_front[0][0],gauss);
+
+		flux += rho_ice*Jdet*gauss->weight*thickness*((calvingratex+meltingratex)*normal[0] + (calvingratey+meltingratey)*normal[1]);
+	}
+
+	return flux;
+
+	/*Clean up and return*/
+	delete gauss;
+}
+/*}}}*/
 IssmDouble Penta::TotalFloatingBmb(bool scaled){/*{{{*/
 
@@ -2749,10 +3697,10 @@
 
 	/*Get material parameters :*/
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	Input* floatingmelt_input = this->GetInput(BasalforcingsFloatingiceMeltingRateEnum); _assert_(floatingmelt_input); 
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	Input* floatingmelt_input = this->GetInput(BasalforcingsFloatingiceMeltingRateEnum); _assert_(floatingmelt_input);
 	Input* gllevelset_input = this->GetInput(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input);
 	Input* scalefactor_input = NULL;
 	if(scaled==true){
-		scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input); 
+		scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
 	}
 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
@@ -2794,10 +3742,10 @@
 
 	/*Get material parameters :*/
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	Input* groundedmelt_input = this->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(groundedmelt_input); 
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	Input* groundedmelt_input = this->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(groundedmelt_input);
 	Input* gllevelset_input = this->GetInput(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input);
 	Input* scalefactor_input = NULL;
 	if(scaled==true){
-		scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input); 
+		scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
 	}
 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
@@ -2833,5 +3781,5 @@
 
 	/*Get material parameters :*/
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 
 	if(!IsIceInElement() || !IsOnSurface()) return 0.;
@@ -2850,5 +3798,5 @@
 	if(scaled==true){
 		Input* scalefactor_input = inputs->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
-		scalefactor_input->GetInputAverage(&scalefactor);// average scalefactor on element 
+		scalefactor_input->GetInputAverage(&scalefactor);// average scalefactor on element
 	}
 	else{
@@ -2878,5 +3826,5 @@
 	/*Checks if debuging*/
 	_assert_(iomodel->elements);
-	_assert_(index==this->sid); 
+	_assert_(index==this->sid);
 
 	/*Recover element type*/
@@ -2891,344 +3839,344 @@
 			numnodes         = 6;
 			penta_node_ids   = xNew<int>(numnodes);
-			penta_node_ids[0]=iomodel->nodecounter+iomodel->elements[6*index+0];
-			penta_node_ids[1]=iomodel->nodecounter+iomodel->elements[6*index+1];
-			penta_node_ids[2]=iomodel->nodecounter+iomodel->elements[6*index+2];
-			penta_node_ids[3]=iomodel->nodecounter+iomodel->elements[6*index+3];
-			penta_node_ids[4]=iomodel->nodecounter+iomodel->elements[6*index+4];
-			penta_node_ids[5]=iomodel->nodecounter+iomodel->elements[6*index+5];
+			penta_node_ids[0]=iomodel->elements[6*index+0];
+			penta_node_ids[1]=iomodel->elements[6*index+1];
+			penta_node_ids[2]=iomodel->elements[6*index+2];
+			penta_node_ids[3]=iomodel->elements[6*index+3];
+			penta_node_ids[4]=iomodel->elements[6*index+4];
+			penta_node_ids[5]=iomodel->elements[6*index+5];
 			break;
 		case P1bubbleEnum: case P1bubblecondensedEnum:
 			numnodes         = 7;
 			penta_node_ids   = xNew<int>(numnodes);
-			penta_node_ids[0]=iomodel->nodecounter+iomodel->elements[6*index+0];
-			penta_node_ids[1]=iomodel->nodecounter+iomodel->elements[6*index+1];
-			penta_node_ids[2]=iomodel->nodecounter+iomodel->elements[6*index+2];
-			penta_node_ids[3]=iomodel->nodecounter+iomodel->elements[6*index+3];
-			penta_node_ids[4]=iomodel->nodecounter+iomodel->elements[6*index+4];
-			penta_node_ids[5]=iomodel->nodecounter+iomodel->elements[6*index+5];
-			penta_node_ids[6]=iomodel->nodecounter+iomodel->numberofvertices+index+1;
+			penta_node_ids[0]=iomodel->elements[6*index+0];
+			penta_node_ids[1]=iomodel->elements[6*index+1];
+			penta_node_ids[2]=iomodel->elements[6*index+2];
+			penta_node_ids[3]=iomodel->elements[6*index+3];
+			penta_node_ids[4]=iomodel->elements[6*index+4];
+			penta_node_ids[5]=iomodel->elements[6*index+5];
+			penta_node_ids[6]=iomodel->numberofvertices+index+1;
 			break;
 		case P1xP2Enum:
 			numnodes         = 9;
 			penta_node_ids   = xNew<int>(numnodes);
-			penta_node_ids[ 0]=iomodel->nodecounter+iomodel->elements[6*index+0];
-			penta_node_ids[ 1]=iomodel->nodecounter+iomodel->elements[6*index+1];
-			penta_node_ids[ 2]=iomodel->nodecounter+iomodel->elements[6*index+2];
-			penta_node_ids[ 3]=iomodel->nodecounter+iomodel->elements[6*index+3];
-			penta_node_ids[ 4]=iomodel->nodecounter+iomodel->elements[6*index+4];
-			penta_node_ids[ 5]=iomodel->nodecounter+iomodel->elements[6*index+5];
-			penta_node_ids[ 6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1;
-			penta_node_ids[ 7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1;
-			penta_node_ids[ 8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1;
+			penta_node_ids[ 0]=iomodel->elements[6*index+0];
+			penta_node_ids[ 1]=iomodel->elements[6*index+1];
+			penta_node_ids[ 2]=iomodel->elements[6*index+2];
+			penta_node_ids[ 3]=iomodel->elements[6*index+3];
+			penta_node_ids[ 4]=iomodel->elements[6*index+4];
+			penta_node_ids[ 5]=iomodel->elements[6*index+5];
+			penta_node_ids[ 6]=iomodel->numberofvertices+iomodel->elementtoverticaledgeconnectivity[3*index+0]+1;
+			penta_node_ids[ 7]=iomodel->numberofvertices+iomodel->elementtoverticaledgeconnectivity[3*index+1]+1;
+			penta_node_ids[ 8]=iomodel->numberofvertices+iomodel->elementtoverticaledgeconnectivity[3*index+2]+1;
 			break;
 		case P1xP3Enum:
 			numnodes         = 12;
 			penta_node_ids   = xNew<int>(numnodes);
-			penta_node_ids[ 0]=iomodel->nodecounter+iomodel->elements[6*index+0];
-			penta_node_ids[ 1]=iomodel->nodecounter+iomodel->elements[6*index+1];
-			penta_node_ids[ 2]=iomodel->nodecounter+iomodel->elements[6*index+2];
-			penta_node_ids[ 3]=iomodel->nodecounter+iomodel->elements[6*index+3];
-			penta_node_ids[ 4]=iomodel->nodecounter+iomodel->elements[6*index+4];
-			penta_node_ids[ 5]=iomodel->nodecounter+iomodel->elements[6*index+5];
-			penta_node_ids[ 6]=iomodel->nodecounter+iomodel->numberofvertices+2*iomodel->elementtoedgeconnectivity[9*index+0]+1;
-			penta_node_ids[ 7]=iomodel->nodecounter+iomodel->numberofvertices+2*iomodel->elementtoedgeconnectivity[9*index+1]+1;
-			penta_node_ids[ 8]=iomodel->nodecounter+iomodel->numberofvertices+2*iomodel->elementtoedgeconnectivity[9*index+2]+1;
-			penta_node_ids[ 9]=iomodel->nodecounter+iomodel->numberofvertices+2*iomodel->elementtoedgeconnectivity[9*index+0]+2;
-			penta_node_ids[10]=iomodel->nodecounter+iomodel->numberofvertices+2*iomodel->elementtoedgeconnectivity[9*index+1]+2;
-			penta_node_ids[11]=iomodel->nodecounter+iomodel->numberofvertices+2*iomodel->elementtoedgeconnectivity[9*index+2]+2;
+			penta_node_ids[ 0]=iomodel->elements[6*index+0];
+			penta_node_ids[ 1]=iomodel->elements[6*index+1];
+			penta_node_ids[ 2]=iomodel->elements[6*index+2];
+			penta_node_ids[ 3]=iomodel->elements[6*index+3];
+			penta_node_ids[ 4]=iomodel->elements[6*index+4];
+			penta_node_ids[ 5]=iomodel->elements[6*index+5];
+			penta_node_ids[ 6]=iomodel->numberofvertices+2*iomodel->elementtoverticaledgeconnectivity[3*index+0]+1;
+			penta_node_ids[ 7]=iomodel->numberofvertices+2*iomodel->elementtoverticaledgeconnectivity[3*index+1]+1;
+			penta_node_ids[ 8]=iomodel->numberofvertices+2*iomodel->elementtoverticaledgeconnectivity[3*index+2]+1;
+			penta_node_ids[ 9]=iomodel->numberofvertices+2*iomodel->elementtoverticaledgeconnectivity[3*index+0]+2;
+			penta_node_ids[10]=iomodel->numberofvertices+2*iomodel->elementtoverticaledgeconnectivity[3*index+1]+2;
+			penta_node_ids[11]=iomodel->numberofvertices+2*iomodel->elementtoverticaledgeconnectivity[3*index+2]+2;
 			break;
 		case P2xP1Enum:
 			numnodes         = 12;
 			penta_node_ids   = xNew<int>(numnodes);
-			penta_node_ids[ 0]=iomodel->nodecounter+iomodel->elements[6*index+0];
-			penta_node_ids[ 1]=iomodel->nodecounter+iomodel->elements[6*index+1];
-			penta_node_ids[ 2]=iomodel->nodecounter+iomodel->elements[6*index+2];
-			penta_node_ids[ 3]=iomodel->nodecounter+iomodel->elements[6*index+3];
-			penta_node_ids[ 4]=iomodel->nodecounter+iomodel->elements[6*index+4];
-			penta_node_ids[ 5]=iomodel->nodecounter+iomodel->elements[6*index+5];
-			penta_node_ids[ 6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1;
-			penta_node_ids[ 7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1;
-			penta_node_ids[ 8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1;
-			penta_node_ids[ 9]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1;
-			penta_node_ids[10]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1;
-			penta_node_ids[11]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1;
+			penta_node_ids[ 0]=iomodel->elements[6*index+0];
+			penta_node_ids[ 1]=iomodel->elements[6*index+1];
+			penta_node_ids[ 2]=iomodel->elements[6*index+2];
+			penta_node_ids[ 3]=iomodel->elements[6*index+3];
+			penta_node_ids[ 4]=iomodel->elements[6*index+4];
+			penta_node_ids[ 5]=iomodel->elements[6*index+5];
+			penta_node_ids[ 6]=iomodel->numberofvertices+iomodel->elementtohorizontaledgeconnectivity[6*index+0]+1;
+			penta_node_ids[ 7]=iomodel->numberofvertices+iomodel->elementtohorizontaledgeconnectivity[6*index+1]+1;
+			penta_node_ids[ 8]=iomodel->numberofvertices+iomodel->elementtohorizontaledgeconnectivity[6*index+2]+1;
+			penta_node_ids[ 9]=iomodel->numberofvertices+iomodel->elementtohorizontaledgeconnectivity[6*index+3]+1;
+			penta_node_ids[10]=iomodel->numberofvertices+iomodel->elementtohorizontaledgeconnectivity[6*index+4]+1;
+			penta_node_ids[11]=iomodel->numberofvertices+iomodel->elementtohorizontaledgeconnectivity[6*index+5]+1;
 			break;
 		case P1xP4Enum:
 			numnodes         = 15;
 			penta_node_ids   = xNew<int>(numnodes);
-			penta_node_ids[ 0]=iomodel->nodecounter+iomodel->elements[6*index+0]; /*Vertex 1*/
-			penta_node_ids[ 1]=iomodel->nodecounter+iomodel->elements[6*index+1]; /*Vertex 2*/
-			penta_node_ids[ 2]=iomodel->nodecounter+iomodel->elements[6*index+2]; /*Vertex 3*/
-			penta_node_ids[ 3]=iomodel->nodecounter+iomodel->elements[6*index+3]; /*Vertex 4*/
-			penta_node_ids[ 4]=iomodel->nodecounter+iomodel->elements[6*index+4]; /*Vertex 5*/
-			penta_node_ids[ 5]=iomodel->nodecounter+iomodel->elements[6*index+5]; /*Vertex 6*/
-			penta_node_ids[ 6]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+0]+1; /*mid vertical edge 1*/
-			penta_node_ids[ 7]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+1]+1; /*mid vertical edge 2*/
-			penta_node_ids[ 8]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+2]+1; /*mid vertical edge 3*/
-			penta_node_ids[ 9]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+0]+2; /* 1/4 vertical edge 1*/
-			penta_node_ids[10]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+1]+2; /* 1/4 vertical edge 2*/
-			penta_node_ids[11]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+2]+2; /* 1/4 vertical edge 3*/
-			penta_node_ids[12]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+0]+3; /* 3/4 vertical edge 1*/
-			penta_node_ids[13]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+1]+3; /* 3/4 vertical edge 2*/
-			penta_node_ids[14]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+2]+3; /* 3/4 vertical edge 3*/
+			penta_node_ids[ 0]=iomodel->elements[6*index+0]; /*Vertex 1*/
+			penta_node_ids[ 1]=iomodel->elements[6*index+1]; /*Vertex 2*/
+			penta_node_ids[ 2]=iomodel->elements[6*index+2]; /*Vertex 3*/
+			penta_node_ids[ 3]=iomodel->elements[6*index+3]; /*Vertex 4*/
+			penta_node_ids[ 4]=iomodel->elements[6*index+4]; /*Vertex 5*/
+			penta_node_ids[ 5]=iomodel->elements[6*index+5]; /*Vertex 6*/
+			penta_node_ids[ 6]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*index+0]+1; /*mid vertical edge 1*/
+			penta_node_ids[ 7]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*index+1]+1; /*mid vertical edge 2*/
+			penta_node_ids[ 8]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*index+2]+1; /*mid vertical edge 3*/
+			penta_node_ids[ 9]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*index+0]+2; /* 1/4 vertical edge 1*/
+			penta_node_ids[10]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*index+1]+2; /* 1/4 vertical edge 2*/
+			penta_node_ids[11]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*index+2]+2; /* 1/4 vertical edge 3*/
+			penta_node_ids[12]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*index+0]+3; /* 3/4 vertical edge 1*/
+			penta_node_ids[13]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*index+1]+3; /* 3/4 vertical edge 2*/
+			penta_node_ids[14]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*index+2]+3; /* 3/4 vertical edge 3*/
 			break;
 		case P2xP4Enum:
 			numnodes         = 30;
 			penta_node_ids   = xNew<int>(numnodes);
-			penta_node_ids[ 0]=iomodel->nodecounter+iomodel->elements[6*index+0]; /*Vertex 1*/
-			penta_node_ids[ 1]=iomodel->nodecounter+iomodel->elements[6*index+1]; /*Vertex 2*/
-			penta_node_ids[ 2]=iomodel->nodecounter+iomodel->elements[6*index+2]; /*Vertex 3*/
-			penta_node_ids[ 3]=iomodel->nodecounter+iomodel->elements[6*index+3]; /*Vertex 4*/
-			penta_node_ids[ 4]=iomodel->nodecounter+iomodel->elements[6*index+4]; /*Vertex 5*/
-			penta_node_ids[ 5]=iomodel->nodecounter+iomodel->elements[6*index+5]; /*Vertex 6*/
-			penta_node_ids[ 6]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+0]+1; /*mid vertical edge 1*/
-			penta_node_ids[ 7]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+1]+1; /*mid vertical edge 2*/
-			penta_node_ids[ 8]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+2]+1; /*mid vertical edge 3*/
-			penta_node_ids[ 9]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+3]+1; /*mid basal edge 1*/
-			penta_node_ids[10]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+4]+1; /*mid basal edge 2*/
-			penta_node_ids[11]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+5]+1; /*mid basal edge 3*/
-			penta_node_ids[12]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+6]+1; /*mid top edge 1*/
-			penta_node_ids[13]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+7]+1; /*mid top edge 2*/
-			penta_node_ids[14]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+8]+1; /*mid top edge 3*/
-			penta_node_ids[15]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+0]+2; /* 1/4 vertical edge 1*/
-			penta_node_ids[16]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+1]+2; /* 1/4 vertical edge 2*/
-			penta_node_ids[17]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+2]+2; /* 1/4 vertical edge 3*/
-			penta_node_ids[18]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+0]+3; /* 3/4 vertical edge 1*/
-			penta_node_ids[19]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+1]+3; /* 3/4 vertical edge 2*/
-			penta_node_ids[20]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+2]+3; /* 3/4 vertical edge 3*/
-			penta_node_ids[21]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+2]+1; /* 1/4 vertical face 1*/
-			penta_node_ids[22]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+3]+1; /* 1/4 vertical face 2*/
-			penta_node_ids[23]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+4]+1; /* 1/4 vertical face 3*/
-			penta_node_ids[24]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+2]+2; /* 2/4 vertical face 1*/
-			penta_node_ids[25]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+3]+2; /* 2/4 vertical face 2*/
-			penta_node_ids[26]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+4]+2; /* 2/4 vertical face 3*/
-			penta_node_ids[27]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+2]+3; /* 3/4 vertical face 1*/
-			penta_node_ids[28]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+3]+3; /* 3/4 vertical face 2*/
-			penta_node_ids[29]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+4]+3; /* 3/4 vertical face 3*/
+			penta_node_ids[ 0]=iomodel->elements[6*index+0]; /*Vertex 1*/
+			penta_node_ids[ 1]=iomodel->elements[6*index+1]; /*Vertex 2*/
+			penta_node_ids[ 2]=iomodel->elements[6*index+2]; /*Vertex 3*/
+			penta_node_ids[ 3]=iomodel->elements[6*index+3]; /*Vertex 4*/
+			penta_node_ids[ 4]=iomodel->elements[6*index+4]; /*Vertex 5*/
+			penta_node_ids[ 5]=iomodel->elements[6*index+5]; /*Vertex 6*/
+			penta_node_ids[ 6]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1; /*mid vertical edge 1*/
+			penta_node_ids[ 7]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1; /*mid vertical edge 2*/
+			penta_node_ids[ 8]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1; /*mid vertical edge 3*/
+			penta_node_ids[ 9]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1; /*mid basal edge 1*/
+			penta_node_ids[10]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1; /*mid basal edge 2*/
+			penta_node_ids[11]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1; /*mid basal edge 3*/
+			penta_node_ids[12]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1; /*mid top edge 1*/
+			penta_node_ids[13]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1; /*mid top edge 2*/
+			penta_node_ids[14]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1; /*mid top edge 3*/
+			penta_node_ids[15]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*index+0]+1; /* 1/4 vertical edge 1*/
+			penta_node_ids[16]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*index+1]+1; /* 1/4 vertical edge 2*/
+			penta_node_ids[17]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*index+2]+1; /* 1/4 vertical edge 3*/
+			penta_node_ids[18]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*index+0]+2; /* 3/4 vertical edge 1*/
+			penta_node_ids[19]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*index+1]+2; /* 3/4 vertical edge 2*/
+			penta_node_ids[20]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*index+2]+2; /* 3/4 vertical edge 3*/
+			penta_node_ids[21]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+0]+1; /* 1/4 vertical face 1*/
+			penta_node_ids[22]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+1]+1; /* 1/4 vertical face 2*/
+			penta_node_ids[23]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+2]+1; /* 1/4 vertical face 3*/
+			penta_node_ids[24]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+0]+2; /* 2/4 vertical face 1*/
+			penta_node_ids[25]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+1]+2; /* 2/4 vertical face 2*/
+			penta_node_ids[26]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+2]+2; /* 2/4 vertical face 3*/
+			penta_node_ids[27]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+0]+3; /* 3/4 vertical face 1*/
+			penta_node_ids[28]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+1]+3; /* 3/4 vertical face 2*/
+			penta_node_ids[29]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+2]+3; /* 3/4 vertical face 3*/
 			break;
 		case P2Enum:
 			numnodes         = 18;
 			penta_node_ids   = xNew<int>(numnodes);
-			penta_node_ids[ 0]=iomodel->nodecounter+iomodel->elements[6*index+0];
-			penta_node_ids[ 1]=iomodel->nodecounter+iomodel->elements[6*index+1];
-			penta_node_ids[ 2]=iomodel->nodecounter+iomodel->elements[6*index+2];
-			penta_node_ids[ 3]=iomodel->nodecounter+iomodel->elements[6*index+3];
-			penta_node_ids[ 4]=iomodel->nodecounter+iomodel->elements[6*index+4];
-			penta_node_ids[ 5]=iomodel->nodecounter+iomodel->elements[6*index+5];
-			penta_node_ids[ 6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1;
-			penta_node_ids[ 7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1;
-			penta_node_ids[ 8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1;
-			penta_node_ids[ 9]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1;
-			penta_node_ids[10]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1;
-			penta_node_ids[11]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1;
-			penta_node_ids[12]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1;
-			penta_node_ids[13]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1;
-			penta_node_ids[14]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1;
-			penta_node_ids[15]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+2]+1;
-			penta_node_ids[16]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+3]+1;
-			penta_node_ids[17]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+4]+1;
+			penta_node_ids[ 0]=iomodel->elements[6*index+0];
+			penta_node_ids[ 1]=iomodel->elements[6*index+1];
+			penta_node_ids[ 2]=iomodel->elements[6*index+2];
+			penta_node_ids[ 3]=iomodel->elements[6*index+3];
+			penta_node_ids[ 4]=iomodel->elements[6*index+4];
+			penta_node_ids[ 5]=iomodel->elements[6*index+5];
+			penta_node_ids[ 6]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1;
+			penta_node_ids[ 7]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1;
+			penta_node_ids[ 8]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1;
+			penta_node_ids[ 9]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1;
+			penta_node_ids[10]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1;
+			penta_node_ids[11]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1;
+			penta_node_ids[12]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1;
+			penta_node_ids[13]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1;
+			penta_node_ids[14]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1;
+			penta_node_ids[15]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtoverticalfaceconnectivity[3*index+0]+1;
+			penta_node_ids[16]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtoverticalfaceconnectivity[3*index+1]+1;
+			penta_node_ids[17]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtoverticalfaceconnectivity[3*index+2]+1;
 			break;
 		case P2bubbleEnum: case P2bubblecondensedEnum:
 			numnodes         = 19;
 			penta_node_ids   = xNew<int>(numnodes);
-			penta_node_ids[ 0]=iomodel->nodecounter+iomodel->elements[6*index+0];
-			penta_node_ids[ 1]=iomodel->nodecounter+iomodel->elements[6*index+1];
-			penta_node_ids[ 2]=iomodel->nodecounter+iomodel->elements[6*index+2];
-			penta_node_ids[ 3]=iomodel->nodecounter+iomodel->elements[6*index+3];
-			penta_node_ids[ 4]=iomodel->nodecounter+iomodel->elements[6*index+4];
-			penta_node_ids[ 5]=iomodel->nodecounter+iomodel->elements[6*index+5];
-			penta_node_ids[ 6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1;
-			penta_node_ids[ 7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1;
-			penta_node_ids[ 8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1;
-			penta_node_ids[ 9]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1;
-			penta_node_ids[10]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1;
-			penta_node_ids[11]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1;
-			penta_node_ids[12]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1;
-			penta_node_ids[13]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1;
-			penta_node_ids[14]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1;
-			penta_node_ids[15]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+2]+1;
-			penta_node_ids[16]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+3]+1;
-			penta_node_ids[17]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+4]+1;
-			penta_node_ids[18]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+index+1;
+			penta_node_ids[ 0]=iomodel->elements[6*index+0];
+			penta_node_ids[ 1]=iomodel->elements[6*index+1];
+			penta_node_ids[ 2]=iomodel->elements[6*index+2];
+			penta_node_ids[ 3]=iomodel->elements[6*index+3];
+			penta_node_ids[ 4]=iomodel->elements[6*index+4];
+			penta_node_ids[ 5]=iomodel->elements[6*index+5];
+			penta_node_ids[ 6]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1;
+			penta_node_ids[ 7]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1;
+			penta_node_ids[ 8]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1;
+			penta_node_ids[ 9]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1;
+			penta_node_ids[10]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1;
+			penta_node_ids[11]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1;
+			penta_node_ids[12]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1;
+			penta_node_ids[13]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1;
+			penta_node_ids[14]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1;
+			penta_node_ids[15]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+2]+1;
+			penta_node_ids[16]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+3]+1;
+			penta_node_ids[17]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+4]+1;
+			penta_node_ids[18]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+index+1;
 			break;
 		case P1P1Enum: case P1P1GLSEnum:
 			numnodes         = 12;
 			penta_node_ids   = xNew<int>(numnodes);
-			penta_node_ids[ 0]=iomodel->nodecounter+iomodel->elements[6*index+0];
-			penta_node_ids[ 1]=iomodel->nodecounter+iomodel->elements[6*index+1];
-			penta_node_ids[ 2]=iomodel->nodecounter+iomodel->elements[6*index+2];
-			penta_node_ids[ 3]=iomodel->nodecounter+iomodel->elements[6*index+3];
-			penta_node_ids[ 4]=iomodel->nodecounter+iomodel->elements[6*index+4];
-			penta_node_ids[ 5]=iomodel->nodecounter+iomodel->elements[6*index+5];
-
-			penta_node_ids[ 6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elements[6*index+0];
-			penta_node_ids[ 7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elements[6*index+1];
-			penta_node_ids[ 8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elements[6*index+2];
-			penta_node_ids[ 9]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elements[6*index+3];
-			penta_node_ids[10]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elements[6*index+4];
-			penta_node_ids[11]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elements[6*index+5];
+			penta_node_ids[ 0]=iomodel->elements[6*index+0];
+			penta_node_ids[ 1]=iomodel->elements[6*index+1];
+			penta_node_ids[ 2]=iomodel->elements[6*index+2];
+			penta_node_ids[ 3]=iomodel->elements[6*index+3];
+			penta_node_ids[ 4]=iomodel->elements[6*index+4];
+			penta_node_ids[ 5]=iomodel->elements[6*index+5];
+
+			penta_node_ids[ 6]=iomodel->numberofvertices+iomodel->elements[6*index+0];
+			penta_node_ids[ 7]=iomodel->numberofvertices+iomodel->elements[6*index+1];
+			penta_node_ids[ 8]=iomodel->numberofvertices+iomodel->elements[6*index+2];
+			penta_node_ids[ 9]=iomodel->numberofvertices+iomodel->elements[6*index+3];
+			penta_node_ids[10]=iomodel->numberofvertices+iomodel->elements[6*index+4];
+			penta_node_ids[11]=iomodel->numberofvertices+iomodel->elements[6*index+5];
 			break;
 		case MINIEnum: case MINIcondensedEnum:
 			numnodes         = 13;
 			penta_node_ids   = xNew<int>(numnodes);
-			penta_node_ids[ 0]=iomodel->nodecounter+iomodel->elements[6*index+0];
-			penta_node_ids[ 1]=iomodel->nodecounter+iomodel->elements[6*index+1];
-			penta_node_ids[ 2]=iomodel->nodecounter+iomodel->elements[6*index+2];
-			penta_node_ids[ 3]=iomodel->nodecounter+iomodel->elements[6*index+3];
-			penta_node_ids[ 4]=iomodel->nodecounter+iomodel->elements[6*index+4];
-			penta_node_ids[ 5]=iomodel->nodecounter+iomodel->elements[6*index+5];
-			penta_node_ids[ 6]=iomodel->nodecounter+iomodel->numberofvertices+index+1;
-
-			penta_node_ids[ 7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*index+0];
-			penta_node_ids[ 8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*index+1];
-			penta_node_ids[ 9]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*index+2];
-			penta_node_ids[10]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*index+3];
-			penta_node_ids[11]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*index+4];
-			penta_node_ids[12]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*index+5];
+			penta_node_ids[ 0]=iomodel->elements[6*index+0];
+			penta_node_ids[ 1]=iomodel->elements[6*index+1];
+			penta_node_ids[ 2]=iomodel->elements[6*index+2];
+			penta_node_ids[ 3]=iomodel->elements[6*index+3];
+			penta_node_ids[ 4]=iomodel->elements[6*index+4];
+			penta_node_ids[ 5]=iomodel->elements[6*index+5];
+			penta_node_ids[ 6]=iomodel->numberofvertices+index+1;
+
+			penta_node_ids[ 7]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*index+0];
+			penta_node_ids[ 8]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*index+1];
+			penta_node_ids[ 9]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*index+2];
+			penta_node_ids[10]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*index+3];
+			penta_node_ids[11]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*index+4];
+			penta_node_ids[12]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*index+5];
 			break;
 		case TaylorHoodEnum:
 			numnodes         = 24;
 			penta_node_ids   = xNew<int>(numnodes);
-			penta_node_ids[ 0]=iomodel->nodecounter+iomodel->elements[6*index+0];
-			penta_node_ids[ 1]=iomodel->nodecounter+iomodel->elements[6*index+1];
-			penta_node_ids[ 2]=iomodel->nodecounter+iomodel->elements[6*index+2];
-			penta_node_ids[ 3]=iomodel->nodecounter+iomodel->elements[6*index+3];
-			penta_node_ids[ 4]=iomodel->nodecounter+iomodel->elements[6*index+4];
-			penta_node_ids[ 5]=iomodel->nodecounter+iomodel->elements[6*index+5];
-			penta_node_ids[ 6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1;
-			penta_node_ids[ 7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1;
-			penta_node_ids[ 8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1;
-			penta_node_ids[ 9]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1;
-			penta_node_ids[10]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1;
-			penta_node_ids[11]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1;
-			penta_node_ids[12]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1;
-			penta_node_ids[13]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1;
-			penta_node_ids[14]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1;
-			penta_node_ids[15]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+2]+1;
-			penta_node_ids[16]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+3]+1;
-			penta_node_ids[17]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+4]+1;
-
-			penta_node_ids[18]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->elements[6*index+0];
-			penta_node_ids[19]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->elements[6*index+1];
-			penta_node_ids[20]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->elements[6*index+2];
-			penta_node_ids[21]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->elements[6*index+3];
-			penta_node_ids[22]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->elements[6*index+4];
-			penta_node_ids[23]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->elements[6*index+5];
+			penta_node_ids[ 0]=iomodel->elements[6*index+0];
+			penta_node_ids[ 1]=iomodel->elements[6*index+1];
+			penta_node_ids[ 2]=iomodel->elements[6*index+2];
+			penta_node_ids[ 3]=iomodel->elements[6*index+3];
+			penta_node_ids[ 4]=iomodel->elements[6*index+4];
+			penta_node_ids[ 5]=iomodel->elements[6*index+5];
+			penta_node_ids[ 6]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1;
+			penta_node_ids[ 7]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1;
+			penta_node_ids[ 8]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1;
+			penta_node_ids[ 9]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1;
+			penta_node_ids[10]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1;
+			penta_node_ids[11]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1;
+			penta_node_ids[12]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1;
+			penta_node_ids[13]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1;
+			penta_node_ids[14]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1;
+			penta_node_ids[15]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtoverticalfaceconnectivity[3*index+0]+1;
+			penta_node_ids[16]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtoverticalfaceconnectivity[3*index+1]+1;
+			penta_node_ids[17]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtoverticalfaceconnectivity[3*index+2]+1;
+
+			penta_node_ids[18]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofverticalfaces+iomodel->elements[6*index+0];
+			penta_node_ids[19]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofverticalfaces+iomodel->elements[6*index+1];
+			penta_node_ids[20]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofverticalfaces+iomodel->elements[6*index+2];
+			penta_node_ids[21]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofverticalfaces+iomodel->elements[6*index+3];
+			penta_node_ids[22]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofverticalfaces+iomodel->elements[6*index+4];
+			penta_node_ids[23]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofverticalfaces+iomodel->elements[6*index+5];
 			break;
 		case LATaylorHoodEnum:
 			numnodes         = 18;
 			penta_node_ids   = xNew<int>(numnodes);
-			penta_node_ids[ 0]=iomodel->nodecounter+iomodel->elements[6*index+0];
-			penta_node_ids[ 1]=iomodel->nodecounter+iomodel->elements[6*index+1];
-			penta_node_ids[ 2]=iomodel->nodecounter+iomodel->elements[6*index+2];
-			penta_node_ids[ 3]=iomodel->nodecounter+iomodel->elements[6*index+3];
-			penta_node_ids[ 4]=iomodel->nodecounter+iomodel->elements[6*index+4];
-			penta_node_ids[ 5]=iomodel->nodecounter+iomodel->elements[6*index+5];
-			penta_node_ids[ 6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1;
-			penta_node_ids[ 7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1;
-			penta_node_ids[ 8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1;
-			penta_node_ids[ 9]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1;
-			penta_node_ids[10]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1;
-			penta_node_ids[11]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1;
-			penta_node_ids[12]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1;
-			penta_node_ids[13]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1;
-			penta_node_ids[14]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1;
-			penta_node_ids[15]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+2]+1;
-			penta_node_ids[16]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+3]+1;
-			penta_node_ids[17]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+4]+1;
+			penta_node_ids[ 0]=iomodel->elements[6*index+0];
+			penta_node_ids[ 1]=iomodel->elements[6*index+1];
+			penta_node_ids[ 2]=iomodel->elements[6*index+2];
+			penta_node_ids[ 3]=iomodel->elements[6*index+3];
+			penta_node_ids[ 4]=iomodel->elements[6*index+4];
+			penta_node_ids[ 5]=iomodel->elements[6*index+5];
+			penta_node_ids[ 6]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1;
+			penta_node_ids[ 7]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1;
+			penta_node_ids[ 8]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1;
+			penta_node_ids[ 9]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1;
+			penta_node_ids[10]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1;
+			penta_node_ids[11]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1;
+			penta_node_ids[12]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1;
+			penta_node_ids[13]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1;
+			penta_node_ids[14]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1;
+			penta_node_ids[15]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+2]+1;
+			penta_node_ids[16]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+3]+1;
+			penta_node_ids[17]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+4]+1;
 			break;
 		case OneLayerP4zEnum:
 			numnodes         = 30+6;
 			penta_node_ids   = xNew<int>(numnodes);
-			penta_node_ids[ 0]=iomodel->nodecounter+iomodel->elements[6*index+0]; /*Vertex 1*/
-			penta_node_ids[ 1]=iomodel->nodecounter+iomodel->elements[6*index+1]; /*Vertex 2*/
-			penta_node_ids[ 2]=iomodel->nodecounter+iomodel->elements[6*index+2]; /*Vertex 3*/
-			penta_node_ids[ 3]=iomodel->nodecounter+iomodel->elements[6*index+3]; /*Vertex 4*/
-			penta_node_ids[ 4]=iomodel->nodecounter+iomodel->elements[6*index+4]; /*Vertex 5*/
-			penta_node_ids[ 5]=iomodel->nodecounter+iomodel->elements[6*index+5]; /*Vertex 6*/
-			penta_node_ids[ 6]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+0]+1; /*mid vertical edge 1*/
-			penta_node_ids[ 7]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+1]+1; /*mid vertical edge 2*/
-			penta_node_ids[ 8]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+2]+1; /*mid vertical edge 3*/
-			penta_node_ids[ 9]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+3]+1; /*mid basal edge 1*/
-			penta_node_ids[10]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+4]+1; /*mid basal edge 2*/
-			penta_node_ids[11]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+5]+1; /*mid basal edge 3*/
-			penta_node_ids[12]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+6]+1; /*mid top edge 1*/
-			penta_node_ids[13]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+7]+1; /*mid top edge 2*/
-			penta_node_ids[14]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+8]+1; /*mid top edge 3*/
-			penta_node_ids[15]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+0]+2; /* 1/4 vertical edge 1*/
-			penta_node_ids[16]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+1]+2; /* 1/4 vertical edge 2*/
-			penta_node_ids[17]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+2]+2; /* 1/4 vertical edge 3*/
-			penta_node_ids[18]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+0]+3; /* 2/4 vertical edge 1*/
-			penta_node_ids[19]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+1]+3; /* 2/4 vertical edge 2*/
-			penta_node_ids[20]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->elementtoedgeconnectivity[9*index+2]+3; /* 2/4 vertical edge 3*/
-			penta_node_ids[21]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+2]+1; /* 1/4 vertical face 1*/
-			penta_node_ids[22]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+3]+1; /* 1/4 vertical face 2*/
-			penta_node_ids[23]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+4]+1; /* 1/4 vertical face 3*/
-			penta_node_ids[24]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+2]+2; /* 2/4 vertical face 1*/
-			penta_node_ids[25]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+3]+2; /* 2/4 vertical face 2*/
-			penta_node_ids[26]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+4]+2; /* 2/4 vertical face 3*/
-			penta_node_ids[27]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+2]+3; /* 3/4 vertical face 1*/
-			penta_node_ids[28]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+3]+3; /* 3/4 vertical face 2*/
-			penta_node_ids[29]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->elementtofaceconnectivity[5*index+4]+3; /* 3/4 vertical face 3*/
-
-			penta_node_ids[30]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->numberoffaces+iomodel->elements[6*index+0];
-			penta_node_ids[31]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->numberoffaces+iomodel->elements[6*index+1];
-			penta_node_ids[32]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->numberoffaces+iomodel->elements[6*index+2];
-			penta_node_ids[33]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->numberoffaces+iomodel->elements[6*index+3];
-			penta_node_ids[34]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->numberoffaces+iomodel->elements[6*index+4];
-			penta_node_ids[35]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->numberoffaces+iomodel->elements[6*index+5];
+			penta_node_ids[ 0]=iomodel->elements[6*index+0]; /*Vertex 1*/
+			penta_node_ids[ 1]=iomodel->elements[6*index+1]; /*Vertex 2*/
+			penta_node_ids[ 2]=iomodel->elements[6*index+2]; /*Vertex 3*/
+			penta_node_ids[ 3]=iomodel->elements[6*index+3]; /*Vertex 4*/
+			penta_node_ids[ 4]=iomodel->elements[6*index+4]; /*Vertex 5*/
+			penta_node_ids[ 5]=iomodel->elements[6*index+5]; /*Vertex 6*/
+			penta_node_ids[ 6]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1; /*mid vertical edge 1*/
+			penta_node_ids[ 7]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1; /*mid vertical edge 2*/
+			penta_node_ids[ 8]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1; /*mid vertical edge 3*/
+			penta_node_ids[ 9]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1; /*mid basal edge 1*/
+			penta_node_ids[10]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1; /*mid basal edge 2*/
+			penta_node_ids[11]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1; /*mid basal edge 3*/
+			penta_node_ids[12]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1; /*mid top edge 1*/
+			penta_node_ids[13]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1; /*mid top edge 2*/
+			penta_node_ids[14]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1; /*mid top edge 3*/
+			penta_node_ids[15]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*index+0]+1; /* 1/4 vertical edge 1*/
+			penta_node_ids[16]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*index+1]+1; /* 1/4 vertical edge 2*/
+			penta_node_ids[17]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*index+2]+1; /* 1/4 vertical edge 3*/
+			penta_node_ids[18]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*index+0]+2; /* 3/4 vertical edge 1*/
+			penta_node_ids[19]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*index+1]+2; /* 3/4 vertical edge 2*/
+			penta_node_ids[20]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*index+2]+2; /* 3/4 vertical edge 3*/
+			penta_node_ids[21]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+0]+1; /* 1/4 vertical face 1*/
+			penta_node_ids[22]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+1]+1; /* 1/4 vertical face 2*/
+			penta_node_ids[23]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+2]+1; /* 1/4 vertical face 3*/
+			penta_node_ids[24]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+0]+2; /* 2/4 vertical face 1*/
+			penta_node_ids[25]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+1]+2; /* 2/4 vertical face 2*/
+			penta_node_ids[26]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+2]+2; /* 2/4 vertical face 3*/
+			penta_node_ids[27]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+0]+3; /* 3/4 vertical face 1*/
+			penta_node_ids[28]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+1]+3; /* 3/4 vertical face 2*/
+			penta_node_ids[29]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*index+2]+3; /* 3/4 vertical face 3*/
+
+			penta_node_ids[30]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->numberofverticalfaces+iomodel->elements[6*index+0];
+			penta_node_ids[31]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->numberofverticalfaces+iomodel->elements[6*index+1];
+			penta_node_ids[32]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->numberofverticalfaces+iomodel->elements[6*index+2];
+			penta_node_ids[33]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->numberofverticalfaces+iomodel->elements[6*index+3];
+			penta_node_ids[34]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->numberofverticalfaces+iomodel->elements[6*index+4];
+			penta_node_ids[35]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->numberofverticalfaces+iomodel->elements[6*index+5];
 			break;
 		case CrouzeixRaviartEnum:
 			numnodes         = 25;
 			penta_node_ids   = xNew<int>(numnodes);
-			penta_node_ids[ 0]=iomodel->nodecounter+iomodel->elements[6*index+0];
-			penta_node_ids[ 1]=iomodel->nodecounter+iomodel->elements[6*index+1];
-			penta_node_ids[ 2]=iomodel->nodecounter+iomodel->elements[6*index+2];
-			penta_node_ids[ 3]=iomodel->nodecounter+iomodel->elements[6*index+3];
-			penta_node_ids[ 4]=iomodel->nodecounter+iomodel->elements[6*index+4];
-			penta_node_ids[ 5]=iomodel->nodecounter+iomodel->elements[6*index+5];
-			penta_node_ids[ 6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1;
-			penta_node_ids[ 7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1;
-			penta_node_ids[ 8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1;
-			penta_node_ids[ 9]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1;
-			penta_node_ids[10]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1;
-			penta_node_ids[11]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1;
-			penta_node_ids[12]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1;
-			penta_node_ids[13]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1;
-			penta_node_ids[14]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1;
-			penta_node_ids[15]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+2]+1;
-			penta_node_ids[16]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+3]+1;
-			penta_node_ids[17]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+4]+1;
-			penta_node_ids[18]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+index+1;
-
-			penta_node_ids[19]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+1;
-			penta_node_ids[20]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+2;
-			penta_node_ids[21]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+3;
-			penta_node_ids[22]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+4;
-			penta_node_ids[23]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+5;
-			penta_node_ids[24]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+6;
+			penta_node_ids[ 0]=iomodel->elements[6*index+0];
+			penta_node_ids[ 1]=iomodel->elements[6*index+1];
+			penta_node_ids[ 2]=iomodel->elements[6*index+2];
+			penta_node_ids[ 3]=iomodel->elements[6*index+3];
+			penta_node_ids[ 4]=iomodel->elements[6*index+4];
+			penta_node_ids[ 5]=iomodel->elements[6*index+5];
+			penta_node_ids[ 6]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1;
+			penta_node_ids[ 7]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1;
+			penta_node_ids[ 8]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1;
+			penta_node_ids[ 9]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1;
+			penta_node_ids[10]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1;
+			penta_node_ids[11]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1;
+			penta_node_ids[12]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1;
+			penta_node_ids[13]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1;
+			penta_node_ids[14]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1;
+			penta_node_ids[15]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+2]+1;
+			penta_node_ids[16]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+3]+1;
+			penta_node_ids[17]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+4]+1;
+			penta_node_ids[18]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+index+1;
+
+			penta_node_ids[19]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+1;
+			penta_node_ids[20]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+2;
+			penta_node_ids[21]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+3;
+			penta_node_ids[22]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+4;
+			penta_node_ids[23]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+5;
+			penta_node_ids[24]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+6;
 			break;
 		case LACrouzeixRaviartEnum:
 			numnodes         = 19;
 			penta_node_ids   = xNew<int>(numnodes);
-			penta_node_ids[ 0]=iomodel->nodecounter+iomodel->elements[6*index+0];
-			penta_node_ids[ 1]=iomodel->nodecounter+iomodel->elements[6*index+1];
-			penta_node_ids[ 2]=iomodel->nodecounter+iomodel->elements[6*index+2];
-			penta_node_ids[ 3]=iomodel->nodecounter+iomodel->elements[6*index+3];
-			penta_node_ids[ 4]=iomodel->nodecounter+iomodel->elements[6*index+4];
-			penta_node_ids[ 5]=iomodel->nodecounter+iomodel->elements[6*index+5];
-			penta_node_ids[ 6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1;
-			penta_node_ids[ 7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1;
-			penta_node_ids[ 8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1;
-			penta_node_ids[ 9]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1;
-			penta_node_ids[10]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1;
-			penta_node_ids[11]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1;
-			penta_node_ids[12]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1;
-			penta_node_ids[13]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1;
-			penta_node_ids[14]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1;
-			penta_node_ids[15]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+2]+1;
-			penta_node_ids[16]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+3]+1;
-			penta_node_ids[17]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+4]+1;
-			penta_node_ids[18]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+index+1;
+			penta_node_ids[ 0]=iomodel->elements[6*index+0];
+			penta_node_ids[ 1]=iomodel->elements[6*index+1];
+			penta_node_ids[ 2]=iomodel->elements[6*index+2];
+			penta_node_ids[ 3]=iomodel->elements[6*index+3];
+			penta_node_ids[ 4]=iomodel->elements[6*index+4];
+			penta_node_ids[ 5]=iomodel->elements[6*index+5];
+			penta_node_ids[ 6]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1;
+			penta_node_ids[ 7]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1;
+			penta_node_ids[ 8]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1;
+			penta_node_ids[ 9]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1;
+			penta_node_ids[10]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1;
+			penta_node_ids[11]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1;
+			penta_node_ids[12]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1;
+			penta_node_ids[13]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1;
+			penta_node_ids[14]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1;
+			penta_node_ids[15]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+2]+1;
+			penta_node_ids[16]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+3]+1;
+			penta_node_ids[17]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+4]+1;
+			penta_node_ids[18]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+index+1;
 			break;
 		default:
@@ -3416,4 +4364,5 @@
 	TransientInput *transientinput = NULL;
 	IssmDouble      values[6];
+	IssmDouble      value;
 
 	/*Check that name is an element input*/
@@ -3437,4 +4386,19 @@
 				if(t==0) transientinput=new TransientInput(name);
 				transientinput->AddTimeInput(new PentaInput(name,values,P1Enum),time);
+				transientinput->Configure(parameters);
+			}
+			this->inputs->AddInput(transientinput);
+			break;
+
+		case ElementEnum:
+			/*Get value for the element: */
+			for(t=0;t<ncols;t++){ //ncols is the number of times
+				value=matrix[ncols*(this->Sid())+t];
+
+				/*time:*/
+				time=matrix[(nrows-1)*ncols+t];
+
+				if(t==0) transientinput=new TransientInput(name);
+				transientinput->AddTimeInput(new PentaInput(name,&value,P0Enum),time);
 				transientinput->Configure(parameters);
 			}
@@ -3490,6 +4454,6 @@
 						/*hydrostatic equilibrium: */
 						IssmDouble rho_ice,rho_water,di;
-						rho_ice=this->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-						rho_water=this->matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
+						rho_ice=this->FindParam(MaterialsRhoIceEnum);
+						rho_water=this->FindParam(MaterialsRhoSeawaterEnum);
 
 						di=rho_ice/rho_water;
@@ -3542,4 +4506,11 @@
 			break;
 
+		case ElementEnum:
+			IssmDouble value;
+			/*Get value for the element: */
+			value=vector[this->Sid()]; //careful, vector of values here is not parallel distributed, but serial distributed (from a serial Dakota core!)
+			this->inputs->AddInput(new PentaInput(name,&value,P0Enum));
+			break;
+
 		default:
 			_error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
Index: /issm/trunk/src/c/classes/Elements/Penta.h
===================================================================
--- /issm/trunk/src/c/classes/Elements/Penta.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Elements/Penta.h	(revision 24313)
@@ -19,5 +19,4 @@
 class Node;
 class Material;
-class Matpar;
 class Tria;
 class ElementMatrix;
@@ -51,6 +50,8 @@
 		void           CalvingRateVonmises();
 		void           CalvingRateLevermann();
+		void           CalvingFluxLevelset();
+		void           CalvingMeltingFluxLevelset();
 		IssmDouble     CharacteristicLength(void){_error_("not implemented yet");};
-		void           ComputeBasalStress(Vector<IssmDouble>* sigma_b);
+		void           ComputeBasalStress(void);
 		void           ComputeDeviatoricStressTensor();
 		void           ComputeEsaStrainAndVorticity(){_error_("not implemented yet!");};
@@ -61,4 +62,5 @@
 		void           ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index);
 		void           ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum);
+		void				CreateDistanceInputFromSegmentlist(IssmDouble* distances,int distanceenum);
 		ElementMatrix* CreateBasalMassMatrix(void);
 		void           ElementResponse(IssmDouble* presponse,int response_enum);
@@ -75,10 +77,11 @@
 		void           GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating);
 		IssmDouble     GetGroundedPortion(IssmDouble* xyz_list);
+		IssmDouble		GetIcefrontArea();
 		void           GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
+		void           GetInputValue(IssmDouble* pvalue,Vertex* vertex,int enumtype);
 		void           GetInputValue(IssmDouble* pvalue,Node* node,int enumtype);
 		void           GetLevelCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum,IssmDouble level){_error_("not implemented yet");};
 		void           GetLevelsetPositivePart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlynegative,IssmDouble* levelsetvalues){_error_("not implemented yet");};
-		Node*          GetNode(int node_number);
-		int            GetNodeIndex(Node* node);
+		void				GetLevelsetIntersectionBase(int** pindices, int* pnumiceverts, IssmDouble* fraction, int levelset_enum, IssmDouble level);
 		int            GetNumberOfNodes(void);
 		int            GetNumberOfNodes(int enum_type);
@@ -88,7 +91,9 @@
 		void           GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data);
 		void           GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data,int offset);
+		int            GetVertexIndex(Vertex* vertex);
 		void           GetVerticesCoordinatesBase(IssmDouble** pxyz_list);
 		void           GetVerticesCoordinatesTop(IssmDouble** pxyz_list);
 		IssmDouble     GroundedArea(bool scaled);
+		IssmDouble		IcefrontMassFluxLevelset(bool scaled);
 		IssmDouble     IceVolume(bool scaled);
 		IssmDouble     IceVolumeAboveFloatation(bool scaled);
@@ -120,4 +125,5 @@
 		Gauss*         NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order){_error_("not implemented yet");};
 		Gauss*         NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz,int order_vert);
+		Gauss*         NewGaussBase(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz);
 		Gauss*         NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,bool mainlyfloating,int order);
 		Gauss*         NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,int order){_error_("not implemented yet");};
@@ -137,11 +143,9 @@
 		void	         NormalBase(IssmDouble* bed_normal, IssmDouble* xyz_list);
 		void           NormalSection(IssmDouble* normal,IssmDouble* xyz_list);
+		void           NormalSectionBase(IssmDouble* normal,IssmDouble* xyz_list);
 		void	         NormalTop(IssmDouble* bed_normal, IssmDouble* xyz_list);
 		int            NodalValue(IssmDouble* pvalue, int index, int natureofdataenum);
 		int            NumberofNodesPressure(void);
 		int            NumberofNodesVelocity(void);
-		void				PicoUpdateBoxid(int* pmax_boxid_basin){_error_("not implemented yet");};
-		void				PicoUpdateBox(int loopboxid){_error_("not implemented yet");};
-		void				PicoComputeBasalMelt(void){_error_("not implemented yet");};
 		void           PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding);
 		int            PressureInterpolation();
@@ -149,5 +153,5 @@
 		void           ResetFSBasalBoundaryCondition(void);
 		void           ResetHooks();
-		void	         SetClone(int* minranks);
+		void				RignotMeltParameterization();
 		void           SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index,int offset, int N,int M);
 		void           SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
@@ -158,4 +162,5 @@
 		Tria*	         SpawnTria(int index1,int index2,int index3);
 		IssmDouble     StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa);
+		void           StabilizationParameterAnisotropic(IssmDouble* tau_parameter_anisotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy, IssmDouble hz, IssmDouble kappa);
 		void           StressIntensityFactor();
 		void           StrainRateparallel();
@@ -164,4 +169,6 @@
 		int            TensorInterpolation(){_error_("not implemented yet");};
 		IssmDouble     TimeAdapt();
+		IssmDouble		TotalCalvingFluxLevelset(bool scaled);
+		IssmDouble		TotalCalvingMeltingFluxLevelset(bool scaled);
 		IssmDouble     TotalFloatingBmb(bool scaled);
 		IssmDouble     TotalGroundedBmb(bool scaled);
Index: /issm/trunk/src/c/classes/Elements/Seg.cpp
===================================================================
--- /issm/trunk/src/c/classes/Elements/Seg.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Elements/Seg.cpp	(revision 24313)
@@ -36,5 +36,4 @@
 			this->vertices = NULL;
 			this->material = NULL;
-			this->matpar   = NULL;
 
 			/*Only allocate pointer*/
@@ -78,5 +77,4 @@
 	seg->hvertices = (Hook*)this->hvertices->copy();
 	seg->hmaterial = (Hook*)this->hmaterial->copy();
-	seg->hmatpar   = (Hook*)this->hmatpar->copy();
 	seg->hneighbors = NULL;
 
@@ -100,5 +98,4 @@
 	seg->vertices = (Vertex**)this->hvertices->deliverp();
 	seg->material = (Material*)this->hmaterial->delivers();
-	seg->matpar   = (Matpar*)this->hmatpar->delivers();
 
 	return seg;
@@ -117,5 +114,4 @@
 	vertices = (Vertex**)this->hvertices->deliverp();
 	material = (Material*)this->hmaterial->delivers();
-	matpar   = (Matpar*)this->hmatpar->delivers();
 
 }
Index: /issm/trunk/src/c/classes/Elements/Seg.h
===================================================================
--- /issm/trunk/src/c/classes/Elements/Seg.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Elements/Seg.h	(revision 24313)
@@ -17,5 +17,4 @@
 class Node;
 class Material;
-class Matpar;
 class ElementMatrix;
 class ElementVector;
@@ -46,5 +45,4 @@
 		void        CalvingRateLevermann(void){_error_("not implemented yet");};
 		IssmDouble  CharacteristicLength(void);
-		void        ComputeBasalStress(Vector<IssmDouble>* sigma_b){_error_("not implemented yet");};
 		void        ComputeDeviatoricStressTensor(){_error_("not implemented yet");};
 		void        ComputeEsaStrainAndVorticity(){_error_("not implemented yet!");};
@@ -65,9 +63,7 @@
 		IssmDouble  GetGroundedPortion(IssmDouble* xyz_list);
 		void		   GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
-		void        GetInputValue(IssmDouble* pvalue,Node* node,int enumtype){_error_("not implemented yet");};
+		void        GetInputValue(IssmDouble* pvalue,Vertex* vertex,int enumtype){_error_("not implemented yet");};
 		void		   GetLevelCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum,IssmDouble level){_error_("not implemented");};
 		void        GetLevelsetPositivePart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlynegative,IssmDouble* levelsetvalues){_error_("not implemented yet");};
-		Node*       GetNode(int node_number){_error_("Not implemented");};
-		int         GetNodeIndex(Node* node){_error_("not implemented yet");};
 		int         GetNumberOfNodes(void);
 		int         GetNumberOfNodes(int enum_type){_error_("not implemented yet");};
@@ -130,7 +126,4 @@
 		int         NumberofNodesPressure(void){_error_("not implemented yet");};
 		int         NumberofNodesVelocity(void){_error_("not implemented yet");};
-		void        PicoUpdateBoxid(int* pmax_boxid_basin){_error_("not implemented yet");};
-		void			PicoUpdateBox(int loopboxid){_error_("not implemented yet");};
-		void			PicoComputeBasalMelt(void){_error_("not implemented yet");};
 		void        PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding){_error_("not implemented yet");};
 		int         PressureInterpolation(void){_error_("not implemented yet");};
@@ -145,4 +138,5 @@
 		Element*    SpawnTopElement(void){_error_("not implemented yet");};
 		IssmDouble  StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){_error_("not implemented yet");};
+		void        StabilizationParameterAnisotropic(IssmDouble* tau_parameter_anisotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy,  IssmDouble hz, IssmDouble kappa){_error_("not implemented yet");};
 		void        StrainRateparallel(void){_error_("not implemented yet");};
 		void        StrainRateperpendicular(void){_error_("not implemented yet");};
Index: /issm/trunk/src/c/classes/Elements/Tetra.cpp
===================================================================
--- /issm/trunk/src/c/classes/Elements/Tetra.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Elements/Tetra.cpp	(revision 24313)
@@ -37,5 +37,4 @@
 			this->vertices = NULL;
 			this->material = NULL;
-			this->matpar   = NULL;
 
 			/*Only allocate pointer*/
@@ -79,5 +78,4 @@
 	tetra->hvertices = (Hook*)this->hvertices->copy();
 	tetra->hmaterial = (Hook*)this->hmaterial->copy();
-	tetra->hmatpar   = (Hook*)this->hmatpar->copy();
 	tetra->hneighbors = NULL;
 
@@ -98,5 +96,4 @@
 	tetra->vertices = (Vertex**)this->hvertices->deliverp();
 	tetra->material = (Material*)this->hmaterial->delivers();
-	tetra->matpar   = (Matpar*)this->hmatpar->delivers();
 
 	return tetra;
@@ -114,5 +111,4 @@
 	vertices = (Vertex**)this->hvertices->deliverp();
 	material = (Material*)this->hmaterial->delivers();
-	matpar   = (Matpar*)this->hmatpar->delivers();
 
 }
@@ -141,5 +137,4 @@
 	this->hvertices->configure(verticesin);
 	this->hmaterial->configure(materialsin);
-	this->hmatpar->configure(materialsin);
 
 	/*Now, go pick up the objects inside the hooks: */
@@ -148,5 +143,4 @@
 	this->vertices          = (Vertex**)this->hvertices->deliverp();
 	this->material          = (Material*)this->hmaterial->delivers();
-	this->matpar            = (Matpar*)this->hmatpar->delivers();
 
 	/*point parameters to real dataset: */
@@ -262,16 +256,4 @@
 	input->GetInputValue(pvalue,gauss);
 	delete gauss;
-}
-/*}}}*/
-int      Tetra::GetNodeIndex(Node* node){/*{{{*/
-
-	_assert_(nodes);
-	int numnodes = this->NumberofNodes(this->element_type);
-
-	for(int i=0;i<numnodes;i++){
-		if(node==nodes[i]) return i;
-	}
-	_error_("Node provided not found among element nodes");
-
 }
 /*}}}*/
@@ -490,5 +472,5 @@
 
 	/*Fetch dof list and allocate solution vector*/
-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+	GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
 	IssmDouble* values    = xNew<IssmDouble>(numnodes);
 
@@ -812,5 +794,4 @@
 	this->vertices=NULL;
 	this->material=NULL;
-	this->matpar=NULL;
 	this->parameters=NULL;
 
@@ -819,5 +800,4 @@
 	this->hvertices->reset();
 	this->hmaterial->reset();
-	this->hmatpar->reset();
 	if(this->hneighbors) this->hneighbors->reset();
 }
@@ -872,8 +852,7 @@
 	tria->material=(Material*)this->material->copy2(tria);
 
-	/*recover nodes, material and matpar: */
+	/*recover nodes, material*/
 	tria->nodes    = (Node**)tria->hnodes[analysis_counter]->deliverp();
 	tria->vertices = (Vertex**)tria->hvertices->deliverp();
-	tria->matpar   = (Matpar*)tria->hmatpar->delivers();
 
 	/*Return new Tria*/
@@ -917,45 +896,45 @@
 			numnodes         = 4;
 			tetra_node_ids   = xNew<int>(numnodes);
-			tetra_node_ids[0]=iomodel->nodecounter+iomodel->elements[4*index+0];
-			tetra_node_ids[1]=iomodel->nodecounter+iomodel->elements[4*index+1];
-			tetra_node_ids[2]=iomodel->nodecounter+iomodel->elements[4*index+2];
-			tetra_node_ids[3]=iomodel->nodecounter+iomodel->elements[4*index+3];
+			tetra_node_ids[0]=iomodel->elements[4*index+0];
+			tetra_node_ids[1]=iomodel->elements[4*index+1];
+			tetra_node_ids[2]=iomodel->elements[4*index+2];
+			tetra_node_ids[3]=iomodel->elements[4*index+3];
 			break;
 		case P1bubbleEnum: case P1bubblecondensedEnum:
 			numnodes         = 5;
 			tetra_node_ids   = xNew<int>(numnodes);
-			tetra_node_ids[0]=iomodel->nodecounter+iomodel->elements[4*index+0];
-			tetra_node_ids[1]=iomodel->nodecounter+iomodel->elements[4*index+1];
-			tetra_node_ids[2]=iomodel->nodecounter+iomodel->elements[4*index+2];
-			tetra_node_ids[3]=iomodel->nodecounter+iomodel->elements[4*index+3];
-			tetra_node_ids[4]=iomodel->nodecounter+iomodel->numberofvertices+index+1;
+			tetra_node_ids[0]=iomodel->elements[4*index+0];
+			tetra_node_ids[1]=iomodel->elements[4*index+1];
+			tetra_node_ids[2]=iomodel->elements[4*index+2];
+			tetra_node_ids[3]=iomodel->elements[4*index+3];
+			tetra_node_ids[4]=iomodel->numberofvertices+index+1;
 			break;
 		case P2Enum:
 			numnodes        = 10;
 			tetra_node_ids   = xNew<int>(numnodes);
-			tetra_node_ids[0]=iomodel->nodecounter+iomodel->elements[4*index+0];
-			tetra_node_ids[1]=iomodel->nodecounter+iomodel->elements[4*index+1];
-			tetra_node_ids[2]=iomodel->nodecounter+iomodel->elements[4*index+2];
-			tetra_node_ids[3]=iomodel->nodecounter+iomodel->elements[4*index+3];
-			tetra_node_ids[4]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+0]+1;
-			tetra_node_ids[5]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+1]+1;
-			tetra_node_ids[6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+2]+1;
-			tetra_node_ids[7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+3]+1;
-			tetra_node_ids[8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+4]+1;
-			tetra_node_ids[9]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+5]+1;
+			tetra_node_ids[0]=iomodel->elements[4*index+0];
+			tetra_node_ids[1]=iomodel->elements[4*index+1];
+			tetra_node_ids[2]=iomodel->elements[4*index+2];
+			tetra_node_ids[3]=iomodel->elements[4*index+3];
+			tetra_node_ids[4]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+0]+1;
+			tetra_node_ids[5]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+1]+1;
+			tetra_node_ids[6]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+2]+1;
+			tetra_node_ids[7]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+3]+1;
+			tetra_node_ids[8]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+4]+1;
+			tetra_node_ids[9]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+5]+1;
 			break;
 		case MINIEnum: case MINIcondensedEnum:
 			numnodes         = 9;
 			tetra_node_ids   = xNew<int>(numnodes);
-			tetra_node_ids[0]=iomodel->nodecounter+iomodel->elements[4*index+0];
-			tetra_node_ids[1]=iomodel->nodecounter+iomodel->elements[4*index+1];
-			tetra_node_ids[2]=iomodel->nodecounter+iomodel->elements[4*index+2];
-			tetra_node_ids[3]=iomodel->nodecounter+iomodel->elements[4*index+3];
-			tetra_node_ids[4]=iomodel->nodecounter+iomodel->numberofvertices+index+1;
-
-			tetra_node_ids[5]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[4*index+0];
-			tetra_node_ids[6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[4*index+1];
-			tetra_node_ids[7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[4*index+2];
-			tetra_node_ids[8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[4*index+3];
+			tetra_node_ids[0]=iomodel->elements[4*index+0];
+			tetra_node_ids[1]=iomodel->elements[4*index+1];
+			tetra_node_ids[2]=iomodel->elements[4*index+2];
+			tetra_node_ids[3]=iomodel->elements[4*index+3];
+			tetra_node_ids[4]=iomodel->numberofvertices+index+1;
+
+			tetra_node_ids[5]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[4*index+0];
+			tetra_node_ids[6]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[4*index+1];
+			tetra_node_ids[7]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[4*index+2];
+			tetra_node_ids[8]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[4*index+3];
 			break;
 		case TaylorHoodEnum:
@@ -963,33 +942,33 @@
 			numnodes        = 14;
 			tetra_node_ids  = xNew<int>(numnodes);
-			tetra_node_ids[0]=iomodel->nodecounter+iomodel->elements[4*index+0];
-			tetra_node_ids[1]=iomodel->nodecounter+iomodel->elements[4*index+1];
-			tetra_node_ids[2]=iomodel->nodecounter+iomodel->elements[4*index+2];
-			tetra_node_ids[3]=iomodel->nodecounter+iomodel->elements[4*index+3];
-			tetra_node_ids[4]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+0]+1;
-			tetra_node_ids[5]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+1]+1;
-			tetra_node_ids[6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+2]+1;
-			tetra_node_ids[7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+3]+1;
-			tetra_node_ids[8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+4]+1;
-			tetra_node_ids[9]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+5]+1;
-
-			tetra_node_ids[10]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[4*index+0];
-			tetra_node_ids[11]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[4*index+1];
-			tetra_node_ids[12]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[4*index+2];
-			tetra_node_ids[13]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[4*index+3];
+			tetra_node_ids[0]=iomodel->elements[4*index+0];
+			tetra_node_ids[1]=iomodel->elements[4*index+1];
+			tetra_node_ids[2]=iomodel->elements[4*index+2];
+			tetra_node_ids[3]=iomodel->elements[4*index+3];
+			tetra_node_ids[4]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+0]+1;
+			tetra_node_ids[5]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+1]+1;
+			tetra_node_ids[6]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+2]+1;
+			tetra_node_ids[7]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+3]+1;
+			tetra_node_ids[8]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+4]+1;
+			tetra_node_ids[9]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+5]+1;
+
+			tetra_node_ids[10]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[4*index+0];
+			tetra_node_ids[11]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[4*index+1];
+			tetra_node_ids[12]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[4*index+2];
+			tetra_node_ids[13]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[4*index+3];
 			break;
 		case LATaylorHoodEnum:
 			numnodes        = 10;
 			tetra_node_ids  = xNew<int>(numnodes);
-			tetra_node_ids[0]=iomodel->nodecounter+iomodel->elements[4*index+0];
-			tetra_node_ids[1]=iomodel->nodecounter+iomodel->elements[4*index+1];
-			tetra_node_ids[2]=iomodel->nodecounter+iomodel->elements[4*index+2];
-			tetra_node_ids[3]=iomodel->nodecounter+iomodel->elements[4*index+3];
-			tetra_node_ids[4]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+0]+1;
-			tetra_node_ids[5]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+1]+1;
-			tetra_node_ids[6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+2]+1;
-			tetra_node_ids[7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+3]+1;
-			tetra_node_ids[8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+4]+1;
-			tetra_node_ids[9]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+5]+1;
+			tetra_node_ids[0]=iomodel->elements[4*index+0];
+			tetra_node_ids[1]=iomodel->elements[4*index+1];
+			tetra_node_ids[2]=iomodel->elements[4*index+2];
+			tetra_node_ids[3]=iomodel->elements[4*index+3];
+			tetra_node_ids[4]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+0]+1;
+			tetra_node_ids[5]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+1]+1;
+			tetra_node_ids[6]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+2]+1;
+			tetra_node_ids[7]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+3]+1;
+			tetra_node_ids[8]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+4]+1;
+			tetra_node_ids[9]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[6*index+5]+1;
 			break;
 		default:
Index: /issm/trunk/src/c/classes/Elements/Tetra.h
===================================================================
--- /issm/trunk/src/c/classes/Elements/Tetra.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Elements/Tetra.h	(revision 24313)
@@ -17,5 +17,4 @@
 class Node;
 class Material;
-class Matpar;
 class ElementMatrix;
 class ElementVector;
@@ -46,5 +45,4 @@
 		void        CalvingRateLevermann(void){_error_("not implemented yet");};
 		IssmDouble  CharacteristicLength(void){_error_("not implemented yet");};
-		void        ComputeBasalStress(Vector<IssmDouble>* sigma_b){_error_("not implemented yet");};
 		void        ComputeSigmaNN(){_error_("not implemented yet");};
 		void        ComputeStressTensor(){_error_("not implemented yet");};
@@ -74,6 +72,4 @@
 		void		   GetLevelCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum,IssmDouble level){_error_("not implemented yet");};
 		void        GetLevelsetPositivePart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlynegative,IssmDouble* levelsetvalues){_error_("not implemented yet");};
-		Node*       GetNode(int node_number){_error_("Not implemented");};
-		int         GetNodeIndex(Node* node);
 		int         GetNumberOfNodes(void);
 		int         GetNumberOfNodes(int enum_type){_error_("not implemented yet");};
@@ -138,7 +134,4 @@
 		int         NumberofNodesPressure(void);
 		int         NumberofNodesVelocity(void);
-		void			PicoUpdateBoxid(int* pmax_boxid_basin){_error_("not implemented yet");};	
-		void			PicoUpdateBox(int loopboxid){_error_("not implemented yet");};
-		void			PicoComputeBasalMelt(void){_error_("not implemented yet");};
 		void        PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding){_error_("not implemented yet");};
 		int         PressureInterpolation(void);
@@ -154,4 +147,5 @@
 		Tria*       SpawnTria(int index1,int index2,int index3);
 		IssmDouble  StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){_error_("not implemented yet");};
+		void        StabilizationParameterAnisotropic(IssmDouble* tau_parameter_anisotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy, IssmDouble hz, IssmDouble kappa){_error_("not implemented yet");};
 		void        StrainRateparallel(void){_error_("not implemented yet");};
 		void        StrainRateperpendicular(void){_error_("not implemented yet");};
Index: /issm/trunk/src/c/classes/Elements/Tria.cpp
===================================================================
--- /issm/trunk/src/c/classes/Elements/Tria.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Elements/Tria.cpp	(revision 24313)
@@ -42,5 +42,4 @@
 		this->vertices = NULL;
 		this->material = NULL;
-		this->matpar   = NULL;
 		if(nummodels>0){
 			this->element_type_list=xNew<int>(nummodels);
@@ -87,5 +86,4 @@
 	tria->hvertices = (Hook*)this->hvertices->copy();
 	tria->hmaterial = (Hook*)this->hmaterial->copy();
-	tria->hmatpar   = (Hook*)this->hmatpar->copy();
 	tria->hneighbors = NULL;
 
@@ -109,5 +107,4 @@
 	tria->vertices = (Vertex**)this->hvertices->deliverp();
 	tria->material = (Material*)this->hmaterial->delivers();
-	tria->matpar   = (Matpar*)this->hmatpar->delivers();
 
 	return tria;
@@ -125,5 +122,4 @@
 	vertices = (Vertex**)this->hvertices->deliverp();
 	material = (Material*)this->hmaterial->delivers();
-	matpar   = (Matpar*)this->hmatpar->delivers();
 
 }
@@ -215,5 +211,5 @@
 	/*Figure out the average for this element: */
 	this->GetVerticesSidList(&offsetsid[0]);
-	this->GetVertexPidList(&offsetdof[0]);
+	this->GetVerticesPidList(&offsetdof[0]);
 	mean=0;
 	for(i=0;i<NUMVERTICES;i++){
@@ -247,6 +243,7 @@
 	IssmDouble  lambda1,lambda2,ex,ey,vx,vy,vel;
 	IssmDouble  sigma_vm[NUMVERTICES];
-	IssmDouble  B,sigma_max,sigma_max_floating,sigma_max_grounded;
-	IssmDouble  epse_2,groundedice,bed;
+	IssmDouble  B,sigma_max,sigma_max_floating,sigma_max_grounded,n;
+	IssmDouble  epse_2,groundedice,bed,sealevel;		// added sealevel
+
 
 	/* Get node coordinates and dof list: */
@@ -261,5 +258,8 @@
 	Input* smax_fl_input = inputs->GetInput(CalvingStressThresholdFloatingiceEnum); _assert_(smax_fl_input);
 	Input* smax_gr_input = inputs->GetInput(CalvingStressThresholdGroundediceEnum); _assert_(smax_gr_input);
-	IssmDouble  n   = this->GetMaterialParameter(MaterialsRheologyNEnum);
+	Input* n_input  = inputs->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
+	Input* sl_input  = inputs->GetInput(SealevelEnum); _assert_(sl_input);
+
+
 
 	/* Start looping on the number of vertices: */
@@ -270,4 +270,5 @@
 		/*Get velocity components and thickness*/
 		B_input->GetInputValue(&B,gauss);
+		n_input->GetInputValue(&n,gauss);
 		vx_input->GetInputValue(&vx,gauss);
 		vy_input->GetInputValue(&vy,gauss);
@@ -277,4 +278,5 @@
 		smax_gr_input->GetInputValue(&sigma_max_grounded,gauss);
 		vel=sqrt(vx*vx+vy*vy)+1.e-14;
+		sl_input->GetInputValue(&sealevel,gauss);
 
 		/*Compute strain rate and viscosity: */
@@ -304,7 +306,6 @@
 		else
 		 sigma_max = sigma_max_grounded;
-
 		/*Assign values*/
-		if(bed>0.){
+		if(bed>sealevel){		// Changed 0. to sealevel
 			calvingratex[iv]=0.;
 			calvingratey[iv]=0.;
@@ -315,4 +316,5 @@
 		}
 		calvingrate[iv] =sqrt(calvingratex[iv]*calvingratex[iv] + calvingratey[iv]*calvingratey[iv]);
+
 	}
 
@@ -332,21 +334,20 @@
 	IssmDouble  calvingrate[NUMVERTICES];
 	IssmDouble  vx,vy,vel;
-	IssmDouble  critical_fraction,water_height;
-	IssmDouble  bed,Ho,thickness,float_depth;
+	IssmDouble  water_height, bed,Ho,thickness,surface;
 	IssmDouble  surface_crevasse[NUMVERTICES], basal_crevasse[NUMVERTICES], crevasse_depth[NUMVERTICES], H_surf, H_surfbasal;
-	IssmDouble  strainparallel, straineffective;
+	IssmDouble  B, strainparallel, straineffective,n;
 	IssmDouble  s_xx,s_xy,s_yy,s1,s2,stmp;
+	int crevasse_opening_stress;
 
 	/* Get node coordinates and dof list: */
 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
 
-	/*Get the critical fraction of thickness surface and basal crevasses penetrate for calving onset*/
-	this->parameters->FindParam(&critical_fraction,CalvingCrevasseDepthEnum);
-
-	IssmDouble rho_ice        = this->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble rho_seawater   = this->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble rho_freshwater = this->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-	IssmDouble constant_g     = this->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble rheology_n     = this->GetMaterialParameter(MaterialsRheologyNEnum);
+	/*retrieve the type of crevasse_opening_stress*/
+	this->parameters->FindParam(&crevasse_opening_stress,CalvingCrevasseDepthEnum);
+
+	IssmDouble rho_ice        = this->FindParam(MaterialsRhoIceEnum);
+	IssmDouble rho_seawater   = this->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble rho_freshwater = this->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble constant_g     = this->FindParam(ConstantsGEnum);
 
 	Input*   H_input                 = inputs->GetInput(ThicknessEnum); _assert_(H_input);
@@ -361,4 +362,6 @@
 	Input*   s_xy_input              = inputs->GetInput(DeviatoricStressxyEnum);     _assert_(s_xy_input);
 	Input*   s_yy_input              = inputs->GetInput(DeviatoricStressyyEnum);     _assert_(s_yy_input);
+	Input*	B_input  = inputs->GetInput(MaterialsRheologyBbarEnum);   _assert_(B_input);
+	Input*	n_input  = inputs->GetInput(MaterialsRheologyNEnum);   _assert_(n_input);
 
 	/*Loop over all elements of this partition*/
@@ -369,5 +372,5 @@
 		H_input->GetInputValue(&thickness,gauss);
 		bed_input->GetInputValue(&bed,gauss);
-		surface_input->GetInputValue(&float_depth,gauss);
+		surface_input->GetInputValue(&surface,gauss);
 		strainrateparallel_input->GetInputValue(&strainparallel,gauss);
 		strainrateeffective_input->GetInputValue(&straineffective,gauss);
@@ -378,4 +381,6 @@
 		s_xy_input->GetInputValue(&s_xy,gauss);
 		s_yy_input->GetInputValue(&s_yy,gauss);
+		B_input->GetInputValue(&B,gauss);
+		n_input->GetInputValue(&n,gauss);
 
 		vel=sqrt(vx*vx+vy*vy)+1.e-14;
@@ -388,26 +393,29 @@
 		if(Ho<0.)  Ho=0.;
 
-		/*Otero2010: balance between the tensile deviatoric stress and ice overburden pressure*/
-		/*surface crevasse*/
-		//surface_crevasse[iv] = rheology_B * strainparallel * pow(straineffective, ((1 / rheology_n)-1)) / (rho_ice * constant_g);
-		surface_crevasse[iv] = s1 / (rho_ice*constant_g);
+		if(crevasse_opening_stress==0){		/*Otero2010: balance between the tensile deviatoric stress and ice overburden pressure*/
+			surface_crevasse[iv] = B * strainparallel * pow(straineffective, ((1 / n)-1)) / (rho_ice * constant_g);
+			basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice)) * (B * strainparallel * pow(straineffective,((1/n)-1)) / (rho_ice*constant_g) - Ho);
+		}
+		else if(crevasse_opening_stress==1){	 /*Benn2017,Todd2018: maximum principal stress */
+			surface_crevasse[iv] = s1 / (rho_ice*constant_g);
+			basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice))* (s1/ (rho_ice*constant_g)-Ho);
+		}
+
+		/* some constraints */
 		if (surface_crevasse[iv]<0.) {
 			surface_crevasse[iv]=0.;
 			water_height = 0.;
 		}
+		if (basal_crevasse[iv]<0.) basal_crevasse[iv]=0.;
+		if (bed>0.) basal_crevasse[iv] = 0.;
+
 		//if (surface_crevasse[iv]<water_height){
 		//	water_height = surface_crevasse[iv];
 		//}
 
-		/*basal crevasse*/
-		//basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice)) * (rheology_B * strainparallel * pow(straineffective,((1/rheology_n)-1)) / (rho_ice*constant_g) - Ho);
-		basal_crevasse[iv] = (rho_ice/(rho_seawater-rho_ice))* (s1/ (rho_ice*constant_g)-Ho);
-		if (basal_crevasse[iv]<0.) basal_crevasse[iv]=0.;
-		if (bed>0.) basal_crevasse[iv] = 0.; 
-
-		H_surf = surface_crevasse[iv] + (rho_freshwater/rho_ice)*water_height - critical_fraction*float_depth;
-		H_surfbasal = (surface_crevasse[iv] + (rho_freshwater/rho_ice)*water_height + basal_crevasse[iv])-(critical_fraction*thickness);
-
-		crevasse_depth[iv] = max(H_surf,H_surfbasal);
+		/* add water in surface crevasse */
+		surface_crevasse[iv] = surface_crevasse[iv] + (rho_freshwater/rho_ice)*water_height; /* surface crevasse + water */
+		crevasse_depth[iv] = surface_crevasse[iv] + (rho_freshwater/rho_ice)*water_height + basal_crevasse[iv]; /* surface crevasse + basal crevasse + water */
+
 	}
 
@@ -476,4 +484,289 @@
 }
 /*}}}*/
+void       Tria::CalvingFluxLevelset(){/*{{{*/
+
+	/*Make sure there is an ice front here*/
+	if(!IsIceInElement() || !IsZeroLevelset(MaskIceLevelsetEnum)){
+		IssmDouble flux_per_area=0;
+		this->inputs->AddInput(new TriaInput(CalvingFluxLevelsetEnum,&flux_per_area,P0Enum));
+	}
+	else{
+		int               domaintype,index1,index2;
+		const IssmPDouble epsilon = 1.e-15;
+		IssmDouble        s1,s2;
+		IssmDouble        gl[NUMVERTICES];
+		IssmDouble        xyz_front[2][3];
+
+		IssmDouble *xyz_list = NULL;
+		this->GetVerticesCoordinates(&xyz_list);
+
+		/*Recover parameters and values*/
+		parameters->FindParam(&domaintype,DomainTypeEnum);
+		GetInputListOnVertices(&gl[0],MaskIceLevelsetEnum);
+
+		/*Be sure that values are not zero*/
+		if(gl[0]==0.) gl[0]=gl[0]+epsilon;
+		if(gl[1]==0.) gl[1]=gl[1]+epsilon;
+		if(gl[2]==0.) gl[2]=gl[2]+epsilon;
+
+		if(domaintype==Domain2DverticalEnum){
+			_error_("not implemented");
+		}
+		else if(domaintype==Domain2DhorizontalEnum || domaintype==Domain3DEnum || domaintype==Domain3DsurfaceEnum){
+			int pt1 = 0;
+			int pt2 = 1;
+			if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
+
+				/*Portion of the segments*/
+				s1=gl[2]/(gl[2]-gl[1]);
+				s2=gl[2]/(gl[2]-gl[0]);
+				if(gl[2]<0.){
+					pt1 = 1; pt2 = 0;
+				}
+				xyz_front[pt2][0]=xyz_list[3*2+0]+s1*(xyz_list[3*1+0]-xyz_list[3*2+0]);
+				xyz_front[pt2][1]=xyz_list[3*2+1]+s1*(xyz_list[3*1+1]-xyz_list[3*2+1]);
+				xyz_front[pt2][2]=xyz_list[3*2+2]+s1*(xyz_list[3*1+2]-xyz_list[3*2+2]);
+				xyz_front[pt1][0]=xyz_list[3*2+0]+s2*(xyz_list[3*0+0]-xyz_list[3*2+0]);
+				xyz_front[pt1][1]=xyz_list[3*2+1]+s2*(xyz_list[3*0+1]-xyz_list[3*2+1]);
+				xyz_front[pt1][2]=xyz_list[3*2+2]+s2*(xyz_list[3*0+2]-xyz_list[3*2+2]);
+			}
+			else if(gl[1]*gl[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
+
+				/*Portion of the segments*/
+				s1=gl[0]/(gl[0]-gl[1]);
+				s2=gl[0]/(gl[0]-gl[2]);
+				if(gl[0]<0.){
+					pt1 = 1; pt2 = 0;
+				}
+
+				xyz_front[pt1][0]=xyz_list[3*0+0]+s1*(xyz_list[3*1+0]-xyz_list[3*0+0]);
+				xyz_front[pt1][1]=xyz_list[3*0+1]+s1*(xyz_list[3*1+1]-xyz_list[3*0+1]);
+				xyz_front[pt1][2]=xyz_list[3*0+2]+s1*(xyz_list[3*1+2]-xyz_list[3*0+2]);
+				xyz_front[pt2][0]=xyz_list[3*0+0]+s2*(xyz_list[3*2+0]-xyz_list[3*0+0]);
+				xyz_front[pt2][1]=xyz_list[3*0+1]+s2*(xyz_list[3*2+1]-xyz_list[3*0+1]);
+				xyz_front[pt2][2]=xyz_list[3*0+2]+s2*(xyz_list[3*2+2]-xyz_list[3*0+2]);
+			}
+			else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
+
+				/*Portion of the segments*/
+				s1=gl[1]/(gl[1]-gl[0]);
+				s2=gl[1]/(gl[1]-gl[2]);
+				if(gl[1]<0.){
+					pt1 = 1; pt2 = 0;
+				}
+
+				xyz_front[pt2][0]=xyz_list[3*1+0]+s1*(xyz_list[3*0+0]-xyz_list[3*1+0]);
+				xyz_front[pt2][1]=xyz_list[3*1+1]+s1*(xyz_list[3*0+1]-xyz_list[3*1+1]);
+				xyz_front[pt2][2]=xyz_list[3*1+2]+s1*(xyz_list[3*0+2]-xyz_list[3*1+2]);
+				xyz_front[pt1][0]=xyz_list[3*1+0]+s2*(xyz_list[3*2+0]-xyz_list[3*1+0]);
+				xyz_front[pt1][1]=xyz_list[3*1+1]+s2*(xyz_list[3*2+1]-xyz_list[3*1+1]);
+				xyz_front[pt1][2]=xyz_list[3*1+2]+s2*(xyz_list[3*2+2]-xyz_list[3*1+2]);
+			}
+			else{
+				_error_("case not possible");
+			}
+
+		}
+		else _error_("mesh type "<<EnumToStringx(domaintype)<<"not supported yet ");
+
+		/*Some checks in debugging mode*/
+		_assert_(s1>=0 && s1<=1.);
+		_assert_(s2>=0 && s2<=1.);
+
+		/*Get normal vector*/
+		IssmDouble normal[3];
+		this->NormalSection(&normal[0],&xyz_front[0][0]);
+		normal[0] = -normal[0];
+		normal[1] = -normal[1];
+
+		/*Get inputs*/
+		IssmDouble flux = 0.;
+		IssmDouble area = 0.;
+		IssmDouble calvingratex,calvingratey,thickness,Jdet,flux_per_area;
+		IssmDouble rho_ice=FindParam(MaterialsRhoIceEnum);
+		Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+		Input* calvingratex_input=NULL;
+		Input* calvingratey_input=NULL;
+		if(domaintype==Domain2DhorizontalEnum){
+			calvingratex_input=inputs->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
+			calvingratey_input=inputs->GetInput(CalvingrateyEnum); _assert_(calvingratey_input);
+		}
+		else{
+			calvingratex_input=inputs->GetInput(CalvingratexAverageEnum); _assert_(calvingratex_input);
+			calvingratey_input=inputs->GetInput(CalvingrateyAverageEnum); _assert_(calvingratey_input);
+		}
+
+		/*Start looping on Gaussian points*/
+		Gauss* gauss=this->NewGauss(xyz_list,&xyz_front[0][0],3);
+		for(int ig=gauss->begin();ig<gauss->end();ig++){
+
+			gauss->GaussPoint(ig);
+			thickness_input->GetInputValue(&thickness,gauss);
+			calvingratex_input->GetInputValue(&calvingratex,gauss);
+			calvingratey_input->GetInputValue(&calvingratey,gauss);
+			this->JacobianDeterminantSurface(&Jdet,&xyz_front[0][0],gauss);
+
+			flux += rho_ice*Jdet*gauss->weight*thickness*(calvingratex*normal[0] + calvingratey*normal[1]);
+			area += Jdet*gauss->weight*thickness;
+
+			flux_per_area=flux/area;
+		}
+
+		this->inputs->AddInput(new TriaInput(CalvingFluxLevelsetEnum,&flux_per_area,P0Enum));
+
+		/*Clean up and return*/
+		delete gauss;
+	}
+}
+/*}}}*/
+void       Tria::CalvingMeltingFluxLevelset(){/*{{{*/
+
+	/*Make sure there is an ice front here*/
+	if(!IsIceInElement() || !IsZeroLevelset(MaskIceLevelsetEnum)){
+		IssmDouble flux_per_area=0;
+		this->inputs->AddInput(new TriaInput(CalvingMeltingFluxLevelsetEnum,&flux_per_area,P0Enum));
+	}
+	else{
+		int               domaintype,index1,index2;
+		const IssmPDouble epsilon = 1.e-15;
+		IssmDouble        s1,s2;
+		IssmDouble        gl[NUMVERTICES];
+		IssmDouble        xyz_front[2][3];
+
+
+		IssmDouble *xyz_list = NULL;
+		this->GetVerticesCoordinates(&xyz_list);
+
+		/*Recover parameters and values*/
+		parameters->FindParam(&domaintype,DomainTypeEnum);
+		GetInputListOnVertices(&gl[0],MaskIceLevelsetEnum);
+
+		/*Be sure that values are not zero*/
+		if(gl[0]==0.) gl[0]=gl[0]+epsilon;
+		if(gl[1]==0.) gl[1]=gl[1]+epsilon;
+		if(gl[2]==0.) gl[2]=gl[2]+epsilon;
+
+		if(domaintype==Domain2DverticalEnum){
+			_error_("not implemented");
+		}
+		else if(domaintype==Domain2DhorizontalEnum || domaintype==Domain3DEnum || domaintype==Domain3DsurfaceEnum){
+			int pt1 = 0;
+			int pt2 = 1;
+			if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
+
+				/*Portion of the segments*/
+				s1=gl[2]/(gl[2]-gl[1]);
+				s2=gl[2]/(gl[2]-gl[0]);
+				if(gl[2]<0.){
+					pt1 = 1; pt2 = 0;
+				}
+				xyz_front[pt2][0]=xyz_list[3*2+0]+s1*(xyz_list[3*1+0]-xyz_list[3*2+0]);
+				xyz_front[pt2][1]=xyz_list[3*2+1]+s1*(xyz_list[3*1+1]-xyz_list[3*2+1]);
+				xyz_front[pt2][2]=xyz_list[3*2+2]+s1*(xyz_list[3*1+2]-xyz_list[3*2+2]);
+				xyz_front[pt1][0]=xyz_list[3*2+0]+s2*(xyz_list[3*0+0]-xyz_list[3*2+0]);
+				xyz_front[pt1][1]=xyz_list[3*2+1]+s2*(xyz_list[3*0+1]-xyz_list[3*2+1]);
+				xyz_front[pt1][2]=xyz_list[3*2+2]+s2*(xyz_list[3*0+2]-xyz_list[3*2+2]);
+			}
+			else if(gl[1]*gl[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
+
+				/*Portion of the segments*/
+				s1=gl[0]/(gl[0]-gl[1]);
+				s2=gl[0]/(gl[0]-gl[2]);
+				if(gl[0]<0.){
+					pt1 = 1; pt2 = 0;
+				}
+
+				xyz_front[pt1][0]=xyz_list[3*0+0]+s1*(xyz_list[3*1+0]-xyz_list[3*0+0]);
+				xyz_front[pt1][1]=xyz_list[3*0+1]+s1*(xyz_list[3*1+1]-xyz_list[3*0+1]);
+				xyz_front[pt1][2]=xyz_list[3*0+2]+s1*(xyz_list[3*1+2]-xyz_list[3*0+2]);
+				xyz_front[pt2][0]=xyz_list[3*0+0]+s2*(xyz_list[3*2+0]-xyz_list[3*0+0]);
+				xyz_front[pt2][1]=xyz_list[3*0+1]+s2*(xyz_list[3*2+1]-xyz_list[3*0+1]);
+				xyz_front[pt2][2]=xyz_list[3*0+2]+s2*(xyz_list[3*2+2]-xyz_list[3*0+2]);
+			}
+			else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
+
+				/*Portion of the segments*/
+				s1=gl[1]/(gl[1]-gl[0]);
+				s2=gl[1]/(gl[1]-gl[2]);
+				if(gl[1]<0.){
+					pt1 = 1; pt2 = 0;
+				}
+
+				xyz_front[pt2][0]=xyz_list[3*1+0]+s1*(xyz_list[3*0+0]-xyz_list[3*1+0]);
+				xyz_front[pt2][1]=xyz_list[3*1+1]+s1*(xyz_list[3*0+1]-xyz_list[3*1+1]);
+				xyz_front[pt2][2]=xyz_list[3*1+2]+s1*(xyz_list[3*0+2]-xyz_list[3*1+2]);
+				xyz_front[pt1][0]=xyz_list[3*1+0]+s2*(xyz_list[3*2+0]-xyz_list[3*1+0]);
+				xyz_front[pt1][1]=xyz_list[3*1+1]+s2*(xyz_list[3*2+1]-xyz_list[3*1+1]);
+				xyz_front[pt1][2]=xyz_list[3*1+2]+s2*(xyz_list[3*2+2]-xyz_list[3*1+2]);
+			}
+			else{
+				_error_("case not possible");
+			}
+
+		}
+		else _error_("mesh type "<<EnumToStringx(domaintype)<<"not supported yet ");
+
+		/*Some checks in debugging mode*/
+		_assert_(s1>=0 && s1<=1.);
+		_assert_(s2>=0 && s2<=1.);
+
+		/*Get normal vector*/
+		IssmDouble normal[3];
+		this->NormalSection(&normal[0],&xyz_front[0][0]);
+		normal[0] = -normal[0];
+		normal[1] = -normal[1];
+
+		/*Get inputs*/
+		IssmDouble flux = 0.;
+		IssmDouble area = 0.;
+		IssmDouble calvingratex,calvingratey,vx,vy,vel,meltingrate,meltingratex,meltingratey,thickness,Jdet,flux_per_area;
+		IssmDouble rho_ice=FindParam(MaterialsRhoIceEnum);
+		Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+		Input* calvingratex_input=NULL;
+		Input* calvingratey_input=NULL;
+		Input* vx_input=NULL;
+		Input* vy_input=NULL;
+		Input* meltingrate_input=NULL;
+		if(domaintype==Domain2DhorizontalEnum){
+			calvingratex_input=inputs->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
+			calvingratey_input=inputs->GetInput(CalvingrateyEnum); _assert_(calvingratey_input);
+			vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
+			vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
+			meltingrate_input=inputs->GetInput(CalvingMeltingrateEnum); _assert_(meltingrate_input);
+		}
+		else{
+			calvingratex_input=inputs->GetInput(CalvingratexAverageEnum); _assert_(calvingratex_input);
+			calvingratey_input=inputs->GetInput(CalvingrateyAverageEnum); _assert_(calvingratey_input);
+		}
+
+		/*Start looping on Gaussian points*/
+		Gauss* gauss=this->NewGauss(xyz_list,&xyz_front[0][0],3);
+		for(int ig=gauss->begin();ig<gauss->end();ig++){
+
+			gauss->GaussPoint(ig);
+			thickness_input->GetInputValue(&thickness,gauss);
+			calvingratex_input->GetInputValue(&calvingratex,gauss);
+			calvingratey_input->GetInputValue(&calvingratey,gauss);
+			vx_input->GetInputValue(&vx,gauss);
+			vy_input->GetInputValue(&vy,gauss);
+			vel=vx*vx+vy*vy;
+			meltingrate_input->GetInputValue(&meltingrate,gauss);
+			meltingratex=meltingrate*vx/(sqrt(vel)+1.e-14);
+			meltingratey=meltingrate*vy/(sqrt(vel)+1.e-14);
+			this->JacobianDeterminantSurface(&Jdet,&xyz_front[0][0],gauss);
+
+			flux += rho_ice*Jdet*gauss->weight*thickness*((calvingratex+meltingratex)*normal[0] + (calvingratey+meltingratey)*normal[1]);
+			area += Jdet*gauss->weight*thickness;
+
+			flux_per_area=flux/area;
+		}
+
+		this->inputs->AddInput(new TriaInput(CalvingMeltingFluxLevelsetEnum,&flux_per_area,P0Enum));
+
+		/*Clean up and return*/
+		delete gauss;
+	}
+}
+/*}}}*/
 IssmDouble Tria::CharacteristicLength(void){/*{{{*/
 
@@ -481,5 +774,5 @@
 }
 /*}}}*/
-void       Tria::ComputeBasalStress(Vector<IssmDouble>* eps){/*{{{*/
+void       Tria::ComputeBasalStress(void){/*{{{*/
 	_error_("Not Implemented yet");
 }
@@ -488,5 +781,5 @@
 
 	IssmDouble  xyz_list[NUMVERTICES][3];
-	IssmDouble  viscosity;
+	IssmDouble  viscosity,lambda1,lambda2;
 	IssmDouble  epsilon[3]; /* epsilon=[exx,eyy,exy];*/
 	IssmDouble  tau_xx[NUMVERTICES];
@@ -497,4 +790,6 @@
 	IssmDouble	tau_yz[NUMVERTICES]={0,0,0};
 	IssmDouble  tau_e[NUMVERTICES];
+	IssmDouble  tau_1[NUMVERTICES];
+	IssmDouble  tau_2[NUMVERTICES];
 	GaussTria*  gauss=NULL;
 	int domaintype,dim=2;
@@ -538,4 +833,7 @@
 		tau_xy[iv]=2*viscosity*epsilon[2];
 		tau_e[iv]=1/sqrt(2)*sqrt(pow(tau_xx[iv],2)+pow(tau_yy[iv],2)+2*pow(tau_xy[iv],2));
+
+		/*Get Eigen values*/
+		Matrix2x2Eigen(&tau_2[iv],&tau_1[iv],NULL,NULL,tau_xx[iv],tau_xy[iv],tau_yy[iv]);
 	}
 
@@ -548,4 +846,6 @@
 	this->inputs->AddInput(new TriaInput(DeviatoricStresszzEnum,&tau_zz[0],P1Enum));
 	this->inputs->AddInput(new TriaInput(DeviatoricStresseffectiveEnum,&tau_e[0],P1Enum));
+	this->inputs->AddInput(new TriaInput(DeviatoricStress1Enum,&tau_1[0],P1Enum));
+	this->inputs->AddInput(new TriaInput(DeviatoricStress2Enum,&tau_2[0],P1Enum));
 
 	/*Clean up and return*/
@@ -582,5 +882,5 @@
 		strain_yy[iv]=epsilon[1];
 		strain_xy[iv]=epsilon[2];
-		vorticity_xy[iv]=epsilon[3]; 
+		vorticity_xy[iv]=epsilon[3];
 	}
 
@@ -609,5 +909,5 @@
 		IssmDouble  sigma_xx,sigma_xy,sigma_yy;
 		IssmDouble  epsilon[3]; /* epsilon=[exx,eyy,exy];*/
-		IssmDouble  base_normal[2]; 
+		IssmDouble  base_normal[2];
 		int domaintype,dim=2;
 
@@ -716,5 +1016,5 @@
 	if (this->element_type_list) this->element_type=this->element_type_list[analysis_counter];
 
-	/*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 
+	/*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
 	 * datasets, using internal ids and offsets hidden in hooks: */
 	if(this->hnodes){
@@ -722,8 +1022,7 @@
 		else this->hnodes[analysis_counter] = NULL;
 	}
-	else this->hnodes = NULL; 
+	else this->hnodes = NULL;
 	this->hvertices->configure(verticesin);
 	this->hmaterial->configure(materialsin);
-	this->hmatpar->configure(materialsin);
 
 	/*Now, go pick up the objects inside the hooks: */
@@ -732,5 +1031,4 @@
 	this->vertices = (Vertex**)this->hvertices->deliverp();
 	this->material = (Material*)this->hmaterial->delivers();
-	this->matpar   = (Matpar*)this->hmatpar->delivers();
 
 	/*point parameters to real dataset: */
@@ -800,5 +1098,5 @@
 	int         connectivity[NUMVERTICES];
 	IssmPDouble values[NUMVERTICES];
-	IssmPDouble gradients[NUMVERTICES]; 
+	IssmPDouble gradients[NUMVERTICES];
 	IssmDouble  value,gradient;
 
@@ -943,5 +1241,5 @@
 			*presponse=vel;}
 			break;
-		default:  
+		default:
 			_error_("Response type " << EnumToStringx(response_enum) << " not supported yet!");
 	}
@@ -1024,7 +1322,7 @@
 	GetInputListOnVertices(&pressure[0],PressureEnum);
 	GetInputListOnVertices(&phi[0],MaskGroundediceLevelsetEnum);
-	IssmDouble rho_ice   = matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble rho_water = matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble gravity   = matpar->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_ice   = FindParam(MaterialsRhoIceEnum);
+	IssmDouble rho_water = FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble gravity   = FindParam(ConstantsGEnum);
 
 	/* Get node coordinates and dof list: */
@@ -1063,5 +1361,5 @@
 		}
 		/*If was floating*/
-		else{	
+		else{
 			/*Tricky part:
 			 * 1. if base is now touching, we put 1 for sigma_nn and leave water pressure at 0 so that the rest of the module will reground this vertex
@@ -1154,5 +1452,5 @@
 	IssmDouble llr_list[NUMVERTICES][3];
 	IssmDouble x1,y1,z1,x2,y2,z2,x3,y3,z3;
-	IssmDouble arc12,arc23,arc31,semi_peri,excess; 
+	IssmDouble arc12,arc23,arc31,semi_peri,excess;
 
 	/*retrieve coordinates: lat,long,radius */
@@ -1167,16 +1465,16 @@
 	arc31=2.*asin(sqrt(pow(sin((x1-x3)/2),2.0)+cos(x3)*cos(x1)*pow(sin((y1-y3)/2),2)));
 
-	/*semi parameter */ 
-	semi_peri=(arc12+arc23+arc31)/2; 
+	/*semi parameter */
+	semi_peri=(arc12+arc23+arc31)/2;
 
 	/*spherical excess */
-	excess=4.*atan(sqrt(tan(semi_peri/2)*tan((semi_peri-arc12)/2)*tan((semi_peri-arc23)/2)*tan((semi_peri-arc31)/2))); 
+	excess=4.*atan(sqrt(tan(semi_peri/2)*tan((semi_peri-arc12)/2)*tan((semi_peri-arc23)/2)*tan((semi_peri-arc31)/2)));
 
 	/*area = excess*radius^2 */
-	return excess*pow((z1+z2+z3)/3,2); 
+	return excess*pow((z1+z2+z3)/3,2);
 }
 /*}}}*/
 void       Tria::GetAreaCoordinates(IssmDouble* area_coordinates,IssmDouble* xyz_zero,IssmDouble* xyz_list,int numpoints){/*{{{*/
-	/*Computeportion of the element that is grounded*/ 
+	/*Computeportion of the element that is grounded*/
 
 	int         i,j,k;
@@ -1187,5 +1485,5 @@
 
 	/*Initialize xyz_list with original xyz_list of triangle coordinates*/
-	for(j=0;j<3;j++){ 
+	for(j=0;j<3;j++){
 		for(k=0;k<3;k++){
 			xyz_bis[j][k]=xyz_list[j*3+k];
@@ -1193,5 +1491,5 @@
 	}
 	for(i=0;i<numpoints;i++){
-		for(j=0;j<3;j++){ 
+		for(j=0;j<3;j++){
 			for(k=0;k<3;k++){
 				/*Change appropriate line*/
@@ -1220,5 +1518,5 @@
 /*}}}*/
 void       Tria::GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlyfloating){/*{{{*/
-	/*Computeportion of the element that is grounded*/ 
+	/*Computeportion of the element that is grounded*/
 
 	bool               floating=true;
@@ -1274,5 +1572,5 @@
 /*}}}*/
 IssmDouble Tria::GetGroundedPortion(IssmDouble* xyz_list){/*{{{*/
-	/*Computeportion of the element that is grounded*/ 
+	/*Computeportion of the element that is grounded*/
 
 	bool              mainlyfloating = true;
@@ -1318,7 +1616,7 @@
 			if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
 				/*Coordinates of point 2: same as initial point 2*/
-				xyz_bis[2][0]=*(xyz_list+3*2+0);
-				xyz_bis[2][1]=*(xyz_list+3*2+1);
-				xyz_bis[2][2]=*(xyz_list+3*2+2);
+				xyz_bis[2][0]=xyz_list[3*2+0];
+				xyz_bis[2][1]=xyz_list[3*2+1];
+				xyz_bis[2][2]=xyz_list[3*2+2];
 
 				/*Portion of the segments*/
@@ -1327,18 +1625,18 @@
 
 				/*New point 1*/
-				xyz_bis[1][0]=*(xyz_list+3*2+0)+s1*(*(xyz_list+3*1+0)-*(xyz_list+3*2+0));
-				xyz_bis[1][1]=*(xyz_list+3*2+1)+s1*(*(xyz_list+3*1+1)-*(xyz_list+3*2+1));
-				xyz_bis[1][2]=*(xyz_list+3*2+2)+s1*(*(xyz_list+3*1+2)-*(xyz_list+3*2+2));
+				xyz_bis[1][0]=xyz_list[3*2+0]+s1*(xyz_list[3*1+0]-xyz_list[3*2+0]);
+				xyz_bis[1][1]=xyz_list[3*2+1]+s1*(xyz_list[3*1+1]-xyz_list[3*2+1]);
+				xyz_bis[1][2]=xyz_list[3*2+2]+s1*(xyz_list[3*1+2]-xyz_list[3*2+2]);
 
 				/*New point 0*/
-				xyz_bis[0][0]=*(xyz_list+3*2+0)+s2*(*(xyz_list+3*0+0)-*(xyz_list+3*2+0));
-				xyz_bis[0][1]=*(xyz_list+3*2+1)+s2*(*(xyz_list+3*0+1)-*(xyz_list+3*2+1));
-				xyz_bis[0][2]=*(xyz_list+3*2+2)+s2*(*(xyz_list+3*0+2)-*(xyz_list+3*2+2));
+				xyz_bis[0][0]=xyz_list[3*2+0]+s2*(xyz_list[3*0+0]-xyz_list[3*2+0]);
+				xyz_bis[0][1]=xyz_list[3*2+1]+s2*(xyz_list[3*0+1]-xyz_list[3*2+1]);
+				xyz_bis[0][2]=xyz_list[3*2+2]+s2*(xyz_list[3*0+2]-xyz_list[3*2+2]);
 			}
 			else if(gl[1]*gl[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
 				/*Coordinates of point 0: same as initial point 2*/
-				xyz_bis[0][0]=*(xyz_list+3*0+0);
-				xyz_bis[0][1]=*(xyz_list+3*0+1);
-				xyz_bis[0][2]=*(xyz_list+3*0+2);
+				xyz_bis[0][0]=xyz_list[3*0+0];
+				xyz_bis[0][1]=xyz_list[3*0+1];
+				xyz_bis[0][2]=xyz_list[3*0+2];
 
 				/*Portion of the segments*/
@@ -1347,18 +1645,18 @@
 
 				/*New point 1*/
-				xyz_bis[1][0]=*(xyz_list+3*0+0)+s1*(*(xyz_list+3*1+0)-*(xyz_list+3*0+0));
-				xyz_bis[1][1]=*(xyz_list+3*0+1)+s1*(*(xyz_list+3*1+1)-*(xyz_list+3*0+1));
-				xyz_bis[1][2]=*(xyz_list+3*0+2)+s1*(*(xyz_list+3*1+2)-*(xyz_list+3*0+2));
+				xyz_bis[1][0]=xyz_list[3*0+0]+s1*(xyz_list[3*1+0]-xyz_list[3*0+0]);
+				xyz_bis[1][1]=xyz_list[3*0+1]+s1*(xyz_list[3*1+1]-xyz_list[3*0+1]);
+				xyz_bis[1][2]=xyz_list[3*0+2]+s1*(xyz_list[3*1+2]-xyz_list[3*0+2]);
 
 				/*New point 2*/
-				xyz_bis[2][0]=*(xyz_list+3*0+0)+s2*(*(xyz_list+3*2+0)-*(xyz_list+3*0+0));
-				xyz_bis[2][1]=*(xyz_list+3*0+1)+s2*(*(xyz_list+3*2+1)-*(xyz_list+3*0+1));
-				xyz_bis[2][2]=*(xyz_list+3*0+2)+s2*(*(xyz_list+3*2+2)-*(xyz_list+3*0+2));
+				xyz_bis[2][0]=xyz_list[3*0+0]+s2*(xyz_list[3*2+0]-xyz_list[3*0+0]);
+				xyz_bis[2][1]=xyz_list[3*0+1]+s2*(xyz_list[3*2+1]-xyz_list[3*0+1]);
+				xyz_bis[2][2]=xyz_list[3*0+2]+s2*(xyz_list[3*2+2]-xyz_list[3*0+2]);
 			}
 			else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
 				/*Coordinates of point 1: same as initial point 2*/
-				xyz_bis[1][0]=*(xyz_list+3*1+0);
-				xyz_bis[1][1]=*(xyz_list+3*1+1);
-				xyz_bis[1][2]=*(xyz_list+3*1+2);
+				xyz_bis[1][0]=xyz_list[3*1+0];
+				xyz_bis[1][1]=xyz_list[3*1+1];
+				xyz_bis[1][2]=xyz_list[3*1+2];
 
 				/*Portion of the segments*/
@@ -1367,12 +1665,12 @@
 
 				/*New point 0*/
-				xyz_bis[0][0]=*(xyz_list+3*1+0)+s1*(*(xyz_list+3*0+0)-*(xyz_list+3*1+0));
-				xyz_bis[0][1]=*(xyz_list+3*1+1)+s1*(*(xyz_list+3*0+1)-*(xyz_list+3*1+1));
-				xyz_bis[0][2]=*(xyz_list+3*1+2)+s1*(*(xyz_list+3*0+2)-*(xyz_list+3*1+2));
+				xyz_bis[0][0]=xyz_list[3*1+0]+s1*(xyz_list[3*0+0]-xyz_list[3*1+0]);
+				xyz_bis[0][1]=xyz_list[3*1+1]+s1*(xyz_list[3*0+1]-xyz_list[3*1+1]);
+				xyz_bis[0][2]=xyz_list[3*1+2]+s1*(xyz_list[3*0+2]-xyz_list[3*1+2]);
 
 				/*New point 2*/
-				xyz_bis[2][0]=*(xyz_list+3*1+0)+s2*(*(xyz_list+3*2+0)-*(xyz_list+3*1+0));
-				xyz_bis[2][1]=*(xyz_list+3*1+1)+s2*(*(xyz_list+3*2+1)-*(xyz_list+3*1+1));
-				xyz_bis[2][2]=*(xyz_list+3*1+2)+s2*(*(xyz_list+3*2+2)-*(xyz_list+3*1+2));
+				xyz_bis[2][0]=xyz_list[3*1+0]+s2*(xyz_list[3*2+0]-xyz_list[3*1+0]);
+				xyz_bis[2][1]=xyz_list[3*1+1]+s2*(xyz_list[3*2+1]-xyz_list[3*1+1]);
+				xyz_bis[2][2]=xyz_list[3*1+2]+s2*(xyz_list[3*2+2]-xyz_list[3*1+2]);
 			}
 			else _error_("case not possible");
@@ -1398,8 +1696,107 @@
 }
 /*}}}*/
+IssmDouble Tria::GetIcefrontArea(){/*{{{*/
+
+	IssmDouble  bed[NUMVERTICES]; //basinId[NUMVERTICES];
+	IssmDouble	Haverage,frontarea;
+	IssmDouble  x1,y1,x2,y2,distance;
+	IssmDouble lsf[NUMVERTICES], Haux[NUMVERTICES], surfaces[NUMVERTICES], bases[NUMVERTICES];
+	int* indices=NULL;
+	IssmDouble* H=NULL;;
+	int nrfrontbed,numiceverts;
+
+	if(!IsZeroLevelset(MaskIceLevelsetEnum)) return 0;
+
+	/*Retrieve all inputs and parameters*/
+	GetInputListOnVertices(&bed[0],BedEnum);
+	GetInputListOnVertices(&surfaces[0],SurfaceEnum);
+	GetInputListOnVertices(&bases[0],BaseEnum);
+	GetInputListOnVertices(&lsf[0],MaskIceLevelsetEnum);
+
+	nrfrontbed=0;
+	for(int i=0;i<NUMVERTICES;i++){
+		/*Find if bed<0*/
+		if(bed[i]<0.) nrfrontbed++;
+	}
+
+	if(nrfrontbed==3){
+		/*2. Find coordinates of where levelset crosses 0*/
+		int         numiceverts;
+		IssmDouble  s[2],x[2],y[2];
+		this->GetLevelsetIntersection(&indices, &numiceverts,&s[0],MaskIceLevelsetEnum,0.);
+		_assert_(numiceverts);
+
+		/*3 Write coordinates*/
+		IssmDouble  xyz_list[NUMVERTICES][3];
+		::GetVerticesCoordinates(&xyz_list[0][0],this->vertices,NUMVERTICES);
+		int counter = 0;
+		if((numiceverts>0) && (numiceverts<NUMVERTICES)){
+			for(int i=0;i<numiceverts;i++){
+				for(int n=numiceverts;n<NUMVERTICES;n++){ // iterate over no-ice vertices
+					x[counter] = xyz_list[indices[i]][0]+s[counter]*(xyz_list[indices[n]][0]-xyz_list[indices[i]][0]);
+					y[counter] = xyz_list[indices[i]][1]+s[counter]*(xyz_list[indices[n]][1]-xyz_list[indices[i]][1]);
+					counter++;
+				}
+			}
+		}
+		else if(numiceverts==NUMVERTICES){ //NUMVERTICES ice vertices: calving front lies on element edge
+
+			for(int i=0;i<NUMVERTICES;i++){
+				if(lsf[indices[i]]==0.){
+					x[counter]=xyz_list[indices[i]][0];
+					y[counter]=xyz_list[indices[i]][1];
+					counter++;
+				}
+				if(counter==2) break;
+			}
+			if(counter==1){
+				/*We actually have only 1 vertex on levelset, write a single point as a segment*/
+				x[counter]=x[0];
+				y[counter]=y[0];
+				counter++;
+			}
+		}
+		else{
+			_error_("not sure what's going on here...");
+		}
+		x1=x[0]; y1=y[0]; x2=x[1]; y2=y[1];
+		distance=sqrt(pow((x1-x2),2)+pow((y1-y2),2));
+
+		int numthk=numiceverts+2;
+		H=xNew<IssmDouble>(numthk);
+		for(int iv=0;iv<NUMVERTICES;iv++) Haux[iv]=-bed[indices[iv]]; //sort bed in ice/noice
+
+		switch(numiceverts){
+			case 1: // average over triangle
+				H[0]=Haux[0];
+				H[1]=Haux[0]+s[0]*(Haux[1]-Haux[0]);
+				H[2]=Haux[0]+s[1]*(Haux[2]-Haux[0]);
+				Haverage=(H[1]+H[2])/2;
+				break;
+			case 2: // average over quadrangle
+				H[0]=Haux[0];
+				H[1]=Haux[1];
+				H[2]=Haux[0]+s[0]*(Haux[2]-Haux[0]);
+				H[3]=Haux[1]+s[1]*(Haux[2]-Haux[1]);
+				Haverage=(H[2]+H[3])/2;
+				break;
+			default:
+				_error_("Number of ice covered vertices wrong in Tria::GetIceFrontArea(void)");
+				break;
+		}
+		frontarea=distance*Haverage;
+	}
+	else return 0;
+
+	xDelete<int>(indices);
+	xDelete<IssmDouble>(H);
+
+	_assert_(frontarea>0);
+	return frontarea;
+}
+/*}}}*/
 void       Tria::GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum){/*{{{*/
 
 	/* Intermediaries */
-	int i, dir,nrfrontnodes;
 	IssmDouble  levelset[NUMVERTICES];
 	int         indicesfront[NUMVERTICES];
@@ -1409,13 +1806,12 @@
 
 	/* Get nodes where there is no ice */
-	nrfrontnodes=0;
-	for(i=0;i<NUMVERTICES;i++){
+	int num_frontnodes=0;
+	for(int i=0;i<NUMVERTICES;i++){
 		if(levelset[i]>=0.){
-			indicesfront[nrfrontnodes]=i;
-			nrfrontnodes++;
-		}
-	}
-
-	_assert_(nrfrontnodes==2);
+			indicesfront[num_frontnodes]=i;
+			num_frontnodes++;
+		}
+	}
+	_assert_(num_frontnodes==2);
 
 	/* arrange order of frontnodes such that they are oriented counterclockwise */
@@ -1424,11 +1820,11 @@
 		indicesfront[0]=indicesfront[1];
 		indicesfront[1]=index;
-	}	
-
-	IssmDouble* xyz_front = xNew<IssmDouble>(3*nrfrontnodes);
+	}
+
+	IssmDouble* xyz_front = xNew<IssmDouble>(3*2);
 	/* Return nodes */
-	for(i=0;i<nrfrontnodes;i++){
-		for(dir=0;dir<3;dir++){
-			xyz_front[3*i+dir]=xyz_list[3*indicesfront[i]+dir];
+	for(int i=0;i<2;i++){
+		for(int j=0;j<3;j++){
+			xyz_front[3*i+j]=xyz_list[3*indicesfront[i]+j];
 		}
 	}
@@ -1441,6 +1837,22 @@
 	if(!input) _error_("No input of type " << EnumToStringx(enumtype) << " found in tria");
 
+	int index = this->GetNodeIndex(node);
+
 	GaussTria* gauss=new GaussTria();
-	gauss->GaussVertex(this->GetNodeIndex(node));
+	gauss->GaussNode(this->element_type,index);
+
+	input->GetInputValue(pvalue,gauss);
+	delete gauss;
+}
+/*}}}*/
+void       Tria::GetInputValue(IssmDouble* pvalue,Vertex* vertex,int enumtype){/*{{{*/
+
+	Input* input=inputs->GetInput(enumtype);
+	if(!input) _error_("No input of type " << EnumToStringx(enumtype) << " found in tria");
+
+	int index = this->GetVertexIndex(vertex);
+
+	GaussTria* gauss=new GaussTria();
+	gauss->GaussVertex(index);
 
 	input->GetInputValue(pvalue,gauss);
@@ -1474,5 +1886,5 @@
 		indicesfront[0]=indicesfront[1];
 		indicesfront[1]=index;
-	}	
+	}
 
 	IssmDouble* xyz_front = xNew<IssmDouble>(3*nrfrontnodes);
@@ -1489,5 +1901,5 @@
 void       Tria::GetLevelsetIntersection(int** pindices, int* pnumiceverts, IssmDouble* fraction, int levelset_enum, IssmDouble level){/*{{{*/
 
-	/* GetLevelsetIntersection computes: 
+	/* GetLevelsetIntersection computes:
 	 * 1. indices of element, sorted in [iceverts, noiceverts] in counterclockwise fashion,
 	 * 2. fraction of intersected triangle edges intersected by levelset, lying below level*/
@@ -1531,5 +1943,5 @@
 		}
 	}
-	//merge indices 
+	//merge indices
 	for(i=0;i<numiceverts;i++){indices[i]=indices_ice[i];}
 	for(i=0;i<numnoiceverts;i++){indices[numiceverts+i]=indices_noice[i];}
@@ -1565,5 +1977,5 @@
 void       Tria::GetLevelsetPositivePart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlynegative,IssmDouble* gl){/*{{{*/
 
-	/*Computeportion of the element that has a positive levelset*/ 
+	/*Computeportion of the element that has a positive levelset*/
 
 	bool               negative=true;
@@ -1616,18 +2028,11 @@
 }
 /*}}}*/
-Node*      Tria::GetNode(int node_number){/*{{{*/
-	_assert_(node_number>=0); 
-	_assert_(node_number<this->NumberofNodes(this->element_type)); 
-	return this->nodes[node_number];
-
-}/*}}}*/
-int        Tria::GetNodeIndex(Node* node){/*{{{*/
-
-	_assert_(nodes);
+int        Tria::GetVertexIndex(Vertex* vertex){/*{{{*/
+	_assert_(vertices);
 	for(int i=0;i<NUMVERTICES;i++){
-		if(node==nodes[i])
+		if(vertex==vertices[i])
 		 return i;
 	}
-	_error_("Node provided not found among element nodes");
+	_error_("Vertex provided not found among element vertices");
 }
 /*}}}*/
@@ -1846,4 +2251,316 @@
 }
 /*}}}*/
+IssmDouble Tria::IcefrontMassFlux(bool scaled){/*{{{*/
+
+	/*Make sure there is an ice front here*/
+	if(!IsIceInElement() || !IsIcefront()) return 0;
+
+	/*Scaled not implemented yet...*/
+	_assert_(!scaled);
+
+	/*Get domain type*/
+	int domaintype;
+	parameters->FindParam(&domaintype,DomainTypeEnum);
+
+	/*Get ice front coordinates*/
+	IssmDouble *xyz_list = NULL;
+	IssmDouble* xyz_front = NULL;
+	this->GetVerticesCoordinates(&xyz_list);
+	this->GetIcefrontCoordinates(&xyz_front,xyz_list,MaskIceLevelsetEnum);
+
+	/*Get normal vector*/
+	IssmDouble normal[3];
+	this->NormalSection(&normal[0],xyz_front);
+	//normal[0] = -normal[0];
+	//normal[1] = -normal[1];
+
+	/*Get inputs*/
+	IssmDouble flux = 0.;
+	IssmDouble vx,vy,thickness,Jdet;
+	IssmDouble rho_ice=FindParam(MaterialsRhoIceEnum);
+	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+	Input* vx_input=NULL;
+	Input* vy_input=NULL;
+	if(domaintype==Domain2DhorizontalEnum){
+		vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
+		vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
+	}
+	else{
+		vx_input=inputs->GetInput(VxAverageEnum); _assert_(vx_input);
+		vy_input=inputs->GetInput(VyAverageEnum); _assert_(vy_input);
+	}
+
+	/*Start looping on Gaussian points*/
+	Gauss* gauss=this->NewGauss(xyz_list,xyz_front,3);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+		thickness_input->GetInputValue(&thickness,gauss);
+		vx_input->GetInputValue(&vx,gauss);
+		vy_input->GetInputValue(&vy,gauss);
+		this->JacobianDeterminantSurface(&Jdet,xyz_front,gauss);
+
+		flux += rho_ice*Jdet*gauss->weight*thickness*(vx*normal[0] + vy*normal[1]);
+	}
+	delete gauss;
+	return flux;
+}
+/*}}}*/
+IssmDouble Tria::IcefrontMassFluxLevelset(bool scaled){/*{{{*/
+
+	/*Make sure there is an ice front here*/
+	if(!IsIceInElement() || !IsZeroLevelset(MaskIceLevelsetEnum)) return 0;
+
+	/*Scaled not implemented yet...*/
+	_assert_(!scaled);
+
+	int               domaintype,index1,index2;
+	const IssmPDouble epsilon = 1.e-15;
+	IssmDouble        s1,s2;
+	IssmDouble        gl[NUMVERTICES];
+	IssmDouble        xyz_front[2][3];
+
+
+	IssmDouble *xyz_list = NULL;
+	this->GetVerticesCoordinates(&xyz_list);
+
+	/*Recover parameters and values*/
+	parameters->FindParam(&domaintype,DomainTypeEnum);
+	GetInputListOnVertices(&gl[0],MaskIceLevelsetEnum);
+
+	/*Be sure that values are not zero*/
+	if(gl[0]==0.) gl[0]=gl[0]+epsilon;
+	if(gl[1]==0.) gl[1]=gl[1]+epsilon;
+	if(gl[2]==0.) gl[2]=gl[2]+epsilon;
+
+	if(domaintype==Domain2DverticalEnum){
+		_error_("not implemented");
+	}
+	else if(domaintype==Domain2DhorizontalEnum || domaintype==Domain3DEnum || domaintype==Domain3DsurfaceEnum){
+		int pt1 = 0;
+		int pt2 = 1;
+		if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
+
+			/*Portion of the segments*/
+			s1=gl[2]/(gl[2]-gl[1]);
+			s2=gl[2]/(gl[2]-gl[0]);
+			if(gl[2]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+			xyz_front[pt2][0]=xyz_list[3*2+0]+s1*(xyz_list[3*1+0]-xyz_list[3*2+0]);
+			xyz_front[pt2][1]=xyz_list[3*2+1]+s1*(xyz_list[3*1+1]-xyz_list[3*2+1]);
+			xyz_front[pt2][2]=xyz_list[3*2+2]+s1*(xyz_list[3*1+2]-xyz_list[3*2+2]);
+			xyz_front[pt1][0]=xyz_list[3*2+0]+s2*(xyz_list[3*0+0]-xyz_list[3*2+0]);
+			xyz_front[pt1][1]=xyz_list[3*2+1]+s2*(xyz_list[3*0+1]-xyz_list[3*2+1]);
+			xyz_front[pt1][2]=xyz_list[3*2+2]+s2*(xyz_list[3*0+2]-xyz_list[3*2+2]);
+		}
+		else if(gl[1]*gl[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
+
+			/*Portion of the segments*/
+			s1=gl[0]/(gl[0]-gl[1]);
+			s2=gl[0]/(gl[0]-gl[2]);
+			if(gl[0]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+
+			xyz_front[pt1][0]=xyz_list[3*0+0]+s1*(xyz_list[3*1+0]-xyz_list[3*0+0]);
+			xyz_front[pt1][1]=xyz_list[3*0+1]+s1*(xyz_list[3*1+1]-xyz_list[3*0+1]);
+			xyz_front[pt1][2]=xyz_list[3*0+2]+s1*(xyz_list[3*1+2]-xyz_list[3*0+2]);
+			xyz_front[pt2][0]=xyz_list[3*0+0]+s2*(xyz_list[3*2+0]-xyz_list[3*0+0]);
+			xyz_front[pt2][1]=xyz_list[3*0+1]+s2*(xyz_list[3*2+1]-xyz_list[3*0+1]);
+			xyz_front[pt2][2]=xyz_list[3*0+2]+s2*(xyz_list[3*2+2]-xyz_list[3*0+2]);
+		}
+		else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
+
+			/*Portion of the segments*/
+			s1=gl[1]/(gl[1]-gl[0]);
+			s2=gl[1]/(gl[1]-gl[2]);
+			if(gl[1]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+
+			xyz_front[pt2][0]=xyz_list[3*1+0]+s1*(xyz_list[3*0+0]-xyz_list[3*1+0]);
+			xyz_front[pt2][1]=xyz_list[3*1+1]+s1*(xyz_list[3*0+1]-xyz_list[3*1+1]);
+			xyz_front[pt2][2]=xyz_list[3*1+2]+s1*(xyz_list[3*0+2]-xyz_list[3*1+2]);
+			xyz_front[pt1][0]=xyz_list[3*1+0]+s2*(xyz_list[3*2+0]-xyz_list[3*1+0]);
+			xyz_front[pt1][1]=xyz_list[3*1+1]+s2*(xyz_list[3*2+1]-xyz_list[3*1+1]);
+			xyz_front[pt1][2]=xyz_list[3*1+2]+s2*(xyz_list[3*2+2]-xyz_list[3*1+2]);
+		}
+		else{
+			_error_("case not possible");
+		}
+
+	}
+	else _error_("mesh type "<<EnumToStringx(domaintype)<<"not supported yet ");
+
+	/*Some checks in debugging mode*/
+	_assert_(s1>=0 && s1<=1.);
+	_assert_(s2>=0 && s2<=1.);
+
+	/*Get normal vector*/
+	IssmDouble normal[3];
+	this->NormalSection(&normal[0],&xyz_front[0][0]);
+	normal[0] = -normal[0];
+	normal[1] = -normal[1];
+
+	/*Get inputs*/
+	IssmDouble flux = 0.;
+	IssmDouble vx,vy,thickness,Jdet;
+	IssmDouble rho_ice=FindParam(MaterialsRhoIceEnum);
+	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+	Input* vx_input=NULL;
+	Input* vy_input=NULL;
+	if(domaintype==Domain2DhorizontalEnum){
+		vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
+		vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
+	}
+	else{
+		vx_input=inputs->GetInput(VxAverageEnum); _assert_(vx_input);
+		vy_input=inputs->GetInput(VyAverageEnum); _assert_(vy_input);
+	}
+
+	/*Start looping on Gaussian points*/
+	Gauss* gauss=this->NewGauss(xyz_list,&xyz_front[0][0],3);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+		thickness_input->GetInputValue(&thickness,gauss);
+		vx_input->GetInputValue(&vx,gauss);
+		vy_input->GetInputValue(&vy,gauss);
+		this->JacobianDeterminantSurface(&Jdet,&xyz_front[0][0],gauss);
+
+		flux += rho_ice*Jdet*gauss->weight*thickness*(vx*normal[0] + vy*normal[1]);
+	}
+	delete gauss;
+	return flux;
+}
+/*}}}*/
+IssmDouble Tria::GroundinglineMassFlux(bool scaled){/*{{{*/
+
+	/*Make sure there is an ice front here*/
+	if(!IsIceInElement()) return 0;
+	if(!IsZeroLevelset(MaskGroundediceLevelsetEnum)) return 0;
+
+	/*Scaled not implemented yet...*/
+	_assert_(!scaled);
+
+	int               domaintype,index1,index2;
+	const IssmPDouble epsilon = 1.e-15;
+	IssmDouble        s1,s2;
+	IssmDouble        gl[NUMVERTICES];
+	IssmDouble        xyz_front[2][3];
+
+	IssmDouble *xyz_list = NULL;
+	this->GetVerticesCoordinates(&xyz_list);
+
+	/*Recover parameters and values*/
+	parameters->FindParam(&domaintype,DomainTypeEnum);
+	GetInputListOnVertices(&gl[0],MaskGroundediceLevelsetEnum);
+
+	/*Be sure that values are not zero*/
+	if(gl[0]==0.) gl[0]=gl[0]+epsilon;
+	if(gl[1]==0.) gl[1]=gl[1]+epsilon;
+	if(gl[2]==0.) gl[2]=gl[2]+epsilon;
+
+	if(domaintype==Domain2DverticalEnum){
+		_error_("not implemented");
+	}
+	else if(domaintype==Domain2DhorizontalEnum || domaintype==Domain3DEnum || domaintype==Domain3DsurfaceEnum){
+		int pt1 = 0;
+		int pt2 = 1;
+		if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
+
+			/*Portion of the segments*/
+			s1=gl[2]/(gl[2]-gl[1]);
+			s2=gl[2]/(gl[2]-gl[0]);
+			if(gl[2]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+			xyz_front[pt2][0]=xyz_list[3*2+0]+s1*(xyz_list[3*1+0]-xyz_list[3*2+0]);
+			xyz_front[pt2][1]=xyz_list[3*2+1]+s1*(xyz_list[3*1+1]-xyz_list[3*2+1]);
+			xyz_front[pt2][2]=xyz_list[3*2+2]+s1*(xyz_list[3*1+2]-xyz_list[3*2+2]);
+			xyz_front[pt1][0]=xyz_list[3*2+0]+s2*(xyz_list[3*0+0]-xyz_list[3*2+0]);
+			xyz_front[pt1][1]=xyz_list[3*2+1]+s2*(xyz_list[3*0+1]-xyz_list[3*2+1]);
+			xyz_front[pt1][2]=xyz_list[3*2+2]+s2*(xyz_list[3*0+2]-xyz_list[3*2+2]);
+		}
+		else if(gl[1]*gl[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
+
+			/*Portion of the segments*/
+			s1=gl[0]/(gl[0]-gl[1]);
+			s2=gl[0]/(gl[0]-gl[2]);
+			if(gl[0]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+
+			xyz_front[pt1][0]=xyz_list[3*0+0]+s1*(xyz_list[3*1+0]-xyz_list[3*0+0]);
+			xyz_front[pt1][1]=xyz_list[3*0+1]+s1*(xyz_list[3*1+1]-xyz_list[3*0+1]);
+			xyz_front[pt1][2]=xyz_list[3*0+2]+s1*(xyz_list[3*1+2]-xyz_list[3*0+2]);
+			xyz_front[pt2][0]=xyz_list[3*0+0]+s2*(xyz_list[3*2+0]-xyz_list[3*0+0]);
+			xyz_front[pt2][1]=xyz_list[3*0+1]+s2*(xyz_list[3*2+1]-xyz_list[3*0+1]);
+			xyz_front[pt2][2]=xyz_list[3*0+2]+s2*(xyz_list[3*2+2]-xyz_list[3*0+2]);
+		}
+		else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
+
+			/*Portion of the segments*/
+			s1=gl[1]/(gl[1]-gl[0]);
+			s2=gl[1]/(gl[1]-gl[2]);
+			if(gl[1]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+
+			xyz_front[pt2][0]=xyz_list[3*1+0]+s1*(xyz_list[3*0+0]-xyz_list[3*1+0]);
+			xyz_front[pt2][1]=xyz_list[3*1+1]+s1*(xyz_list[3*0+1]-xyz_list[3*1+1]);
+			xyz_front[pt2][2]=xyz_list[3*1+2]+s1*(xyz_list[3*0+2]-xyz_list[3*1+2]);
+			xyz_front[pt1][0]=xyz_list[3*1+0]+s2*(xyz_list[3*2+0]-xyz_list[3*1+0]);
+			xyz_front[pt1][1]=xyz_list[3*1+1]+s2*(xyz_list[3*2+1]-xyz_list[3*1+1]);
+			xyz_front[pt1][2]=xyz_list[3*1+2]+s2*(xyz_list[3*2+2]-xyz_list[3*1+2]);
+		}
+		else{
+			_error_("case not possible");
+		}
+
+	}
+	else _error_("mesh type "<<EnumToStringx(domaintype)<<"not supported yet ");
+
+	/*Some checks in debugging mode*/
+	_assert_(s1>=0 && s1<=1.);
+	_assert_(s2>=0 && s2<=1.);
+
+	/*Get normal vector*/
+	IssmDouble normal[3];
+	this->NormalSection(&normal[0],&xyz_front[0][0]);
+
+	/*Get inputs*/
+	IssmDouble flux = 0.;
+	IssmDouble vx,vy,thickness,Jdet;
+	IssmDouble rho_ice=FindParam(MaterialsRhoIceEnum);
+	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+	Input* vx_input=NULL;
+	Input* vy_input=NULL;
+	if(domaintype==Domain2DhorizontalEnum){
+		vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
+		vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
+	}
+	else{
+		vx_input=inputs->GetInput(VxAverageEnum); _assert_(vx_input);
+		vy_input=inputs->GetInput(VyAverageEnum); _assert_(vy_input);
+	}
+
+	/*Start looping on Gaussian points*/
+	Gauss* gauss=this->NewGauss(xyz_list,&xyz_front[0][0],3);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+		thickness_input->GetInputValue(&thickness,gauss);
+		vx_input->GetInputValue(&vx,gauss);
+		vy_input->GetInputValue(&vy,gauss);
+		this->JacobianDeterminantSurface(&Jdet,&xyz_front[0][0],gauss);
+
+		flux += rho_ice*Jdet*gauss->weight*thickness*(vx*normal[0] + vy*normal[1]);
+	}
+
+	return flux;
+}
+/*}}}*/
 IssmDouble Tria::IceVolume(bool scaled){/*{{{*/
 
@@ -1867,5 +2584,5 @@
 
 	if(false && IsIcefront()){
-		//Assumption: linear ice thickness profile on element. 
+		//Assumption: linear ice thickness profile on element.
 		//Hence ice thickness at intersection of levelset function with triangle edge is linear interpolation of ice thickness at vertices.
 		this->GetLevelsetIntersection(&indices, &numiceverts, s, MaskIceLevelsetEnum, 0.);
@@ -1878,5 +2595,5 @@
 			for(i=0;i<NUMVERTICES;i++) SFaux[i]= scalefactors[indices[i]]; //sort thicknesses in ice/noice
 			switch(numiceverts){
-				case 1: // average over triangle 
+				case 1: // average over triangle
 					SF[0]=SFaux[0];
 					SF[1]=SFaux[0]+s[0]*(SFaux[1]-SFaux[0]);
@@ -1902,5 +2619,5 @@
 		for(i=0;i<NUMVERTICES;i++) Haux[i]= surfaces[indices[i]]-bases[indices[i]]; //sort thicknesses in ice/noice
 		switch(numiceverts){
-			case 1: // average over triangle 
+			case 1: // average over triangle
 				H[0]=Haux[0];
 				H[1]=Haux[0]+s[0]*(Haux[1]-Haux[0]);
@@ -1960,6 +2677,6 @@
 	if(!IsIceInElement() || IsFloating())return 0;
 
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_water=matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	rho_water=FindParam(MaterialsRhoSeawaterEnum);
 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
 
@@ -1978,4 +2695,5 @@
 	Input* base_input        = inputs->GetInput(BaseEnum);        _assert_(base_input);
 	Input* bed_input = inputs->GetInput(BedEnum); _assert_(bed_input);
+	if(!bed_input) _error_("Could not find bed");
 	surface_input->GetInputAverage(&surface);
 	base_input->GetInputAverage(&bed);
@@ -2165,5 +2883,5 @@
 
 	/*Fetch dof list and allocate solution vector*/
-	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+	GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
 	IssmDouble* values    = xNew<IssmDouble>(numnodes);
 
@@ -2172,5 +2890,5 @@
 		values[i]=solution[doflist[i]];
 		if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
-		if(xIsInf<IssmDouble>(values[i])) _error_("Inf found in solution vector");
+		if(xIsInf<IssmDouble>(values[i])) _error_("Inf found in solution vector, SID = " << this->Sid());
 	}
 
@@ -2189,9 +2907,10 @@
 
 	int         numnodes;
+	IssmDouble  value;
 	int        *doflist = NULL;
 	IssmDouble *values  = NULL;
 
 	switch(type){
-		case VertexLIdEnum: 
+		case VertexLIdEnum:
 			values = xNew<IssmDouble>(NUMVERTICES);
 			for(int i=0;i<NUMVERTICES;i++){
@@ -2204,5 +2923,5 @@
 			break;
 
-		case VertexPIdEnum: 
+		case VertexPIdEnum:
 			values = xNew<IssmDouble>(NUMVERTICES);
 			for(int i=0;i<NUMVERTICES;i++){
@@ -2215,5 +2934,5 @@
 			break;
 
-		case VertexSIdEnum: 
+		case VertexSIdEnum:
 			values = xNew<IssmDouble>(NUMVERTICES);
 			for(int i=0;i<NUMVERTICES;i++){
@@ -2253,4 +2972,12 @@
 			break;
 
+		case ElementEnum:
+			value=vector[this->Sid()];
+			if(xIsNan<IssmDouble>(value)) _error_("NaN found in vector");
+			if(xIsInf<IssmDouble>(value)) _error_("Inf found in vector");
+			/*update input*/
+			this->inputs->AddInput(new DoubleInput(name,value));
+			break;
+
 		default:
 			_error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
@@ -2295,5 +3022,5 @@
 	isicefront=false;
 	if(IsIceInElement()){
-		nrice=0;       
+		nrice=0;
 		for(i=0;i<NUMVERTICES;i++)
 			if(ls[i]<0.) nrice++;
@@ -2414,5 +3141,5 @@
 
 	/*Retrieve material parameters: */
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 
 	/*Retrieve values of the levelset defining the masscon: */
@@ -2449,13 +3176,8 @@
 	IssmDouble mass_flux=0.;
 	IssmDouble xyz_list[NUMVERTICES][3];
-	IssmDouble normal[2];
-	IssmDouble length,rho_ice;
-	IssmDouble h1,h2;
-	IssmDouble vx1,vx2,vy1,vy2;
-	GaussTria* gauss_1=NULL;
-	GaussTria* gauss_2=NULL;
+	IssmDouble vx1,vx2,vy1,vy2,h1,h2;
 
 	/*Get material parameters :*/
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	IssmDouble rho_ice=FindParam(MaterialsRhoIceEnum);
 
 	/*First off, check that this segment belongs to this element: */
@@ -2466,16 +3188,17 @@
 
 	/*get area coordinates of 0 and 1 locations: */
-	gauss_1=new GaussTria();
+	GaussTria* gauss_1=new GaussTria();
 	gauss_1->GaussFromCoords(x1,y1,&xyz_list[0][0]);
-	gauss_2=new GaussTria();
+	GaussTria* gauss_2=new GaussTria();
 	gauss_2->GaussFromCoords(x2,y2,&xyz_list[0][0]);
 
-	normal[0]=cos(atan2(x1-x2,y2-y1));
-	normal[1]=sin(atan2(x1-x2,y2-y1));
-
-	length=sqrt(pow(x2-x1,2)+pow(y2-y1,2));
-
+	/*Get segment length and normal (needs to be properly oriented)*/
+	IssmDouble nx=cos(atan2(x1-x2,y2-y1));
+	IssmDouble ny=sin(atan2(x1-x2,y2-y1));
+	IssmDouble length=sqrt(pow(x2-x1,2)+pow(y2-y1,2));
+
+	/*Get velocity and thickness*/
+	this->parameters->FindParam(&domaintype,DomainTypeEnum);
 	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
-	this->parameters->FindParam(&domaintype,DomainTypeEnum);
 	Input* vx_input=NULL;
 	Input* vy_input=NULL;
@@ -2496,7 +3219,7 @@
 	vy_input->GetInputValue(&vy2,gauss_2);
 
-	mass_flux= rho_ice*length*(  
-				(ONETHIRD*(h1-h2)*(vx1-vx2)+0.5*h2*(vx1-vx2)+0.5*(h1-h2)*vx2+h2*vx2)*normal[0]+
-				(ONETHIRD*(h1-h2)*(vy1-vy2)+0.5*h2*(vy1-vy2)+0.5*(h1-h2)*vy2+h2*vy2)*normal[1]
+	mass_flux= rho_ice*length*(
+				(1./3.*(h1-h2)*(vx1-vx2)+0.5*h2*(vx1-vx2)+0.5*(h1-h2)*vx2+h2*vx2)*nx+
+				(1./3.*(h1-h2)*(vy1-vy2)+0.5*h2*(vy1-vy2)+0.5*(h1-h2)*vy2+h2*vy2)*ny
 				);
 
@@ -2508,67 +3231,5 @@
 /*}}}*/
 IssmDouble Tria::MassFlux(IssmDouble* segment){/*{{{*/
-
-	int        domaintype;
-	IssmDouble mass_flux=0.;
-	IssmDouble xyz_list[NUMVERTICES][3];
-	IssmDouble normal[2];
-	IssmDouble length,rho_ice;
-	IssmDouble x1,y1,x2,y2,h1,h2;
-	IssmDouble vx1,vx2,vy1,vy2;
-	GaussTria* gauss_1=NULL;
-	GaussTria* gauss_2=NULL;
-
-	/*Get material parameters :*/
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-
-	/*First off, check that this segment belongs to this element: */
-	if (reCast<int>(*(segment+4))!=this->id)_error_("error message: segment with id " << reCast<int>(*(segment+4)) << " does not belong to element with id:" << this->id);
-
-	/*Recover segment node locations: */
-	x1=*(segment+0); y1=*(segment+1); x2=*(segment+2); y2=*(segment+3);
-
-	/*Get xyz list: */
-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
-
-	/*get area coordinates of 0 and 1 locations: */
-	gauss_1=new GaussTria();
-	gauss_1->GaussFromCoords(x1,y1,&xyz_list[0][0]);
-	gauss_2=new GaussTria();
-	gauss_2->GaussFromCoords(x2,y2,&xyz_list[0][0]);
-
-	normal[0]=cos(atan2(x1-x2,y2-y1));
-	normal[1]=sin(atan2(x1-x2,y2-y1));
-
-	length=sqrt(pow(x2-x1,2)+pow(y2-y1,2));
-
-	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
-	this->parameters->FindParam(&domaintype,DomainTypeEnum);
-	Input* vx_input=NULL;
-	Input* vy_input=NULL;
-	if(domaintype==Domain2DhorizontalEnum){
-		vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
-		vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
-	}
-	else{
-		vx_input=inputs->GetInput(VxAverageEnum); _assert_(vx_input);
-		vy_input=inputs->GetInput(VyAverageEnum); _assert_(vy_input);
-	}
-
-	thickness_input->GetInputValue(&h1, gauss_1);
-	thickness_input->GetInputValue(&h2, gauss_2);
-	vx_input->GetInputValue(&vx1,gauss_1);
-	vx_input->GetInputValue(&vx2,gauss_2);
-	vy_input->GetInputValue(&vy1,gauss_1);
-	vy_input->GetInputValue(&vy2,gauss_2);
-
-	mass_flux= rho_ice*length*(  
-				(ONETHIRD*(h1-h2)*(vx1-vx2)+0.5*h2*(vx1-vx2)+0.5*(h1-h2)*vx2+h2*vx2)*normal[0]+
-				(ONETHIRD*(h1-h2)*(vy1-vy2)+0.5*h2*(vy1-vy2)+0.5*(h1-h2)*vy2+h2*vy2)*normal[1]
-				);
-
-	/*clean up and return:*/
-	delete gauss_1;
-	delete gauss_2;
-	return mass_flux;
+	return this->MassFlux(segment[0],segment[1],segment[2],segment[3],reCast<int>(segment[4]));
 }
 /*}}}*/
@@ -2768,5 +3429,5 @@
 
 	/*First, serarch the input: */
-	data=inputs->GetInput(natureofdataenum); 
+	data=inputs->GetInput(natureofdataenum);
 
 	/*figure out if we have the vertex id: */
@@ -2805,5 +3466,5 @@
 	bed_normal[0]= + vector[1]/norm;
 	bed_normal[1]= - vector[0]/norm;
-	_assert_(bed_normal[1]<0); 
+	_assert_(bed_normal[1]<0);
 }
 /*}}}*/
@@ -2838,5 +3499,5 @@
 	top_normal[0]= + vector[1]/norm;
 	top_normal[1]= - vector[0]/norm;
-	_assert_(top_normal[1]>0); 
+	_assert_(top_normal[1]>0);
 }
 /*}}}*/
@@ -2855,276 +3516,4 @@
 }
 /*}}}*/
-void       Tria::PicoUpdateBoxid(int* max_boxid_basin_list){/*{{{*/
-
-	if(!this->IsIceInElement() || !this->IsFloating()) return;
-
-	int        basin_id;
-	IssmDouble dist_gl,dist_cf;
-
-	inputs->GetInputValue(&basin_id,BasalforcingsPicoBasinIdEnum);
-	IssmDouble boxid_max=reCast<IssmDouble>(max_boxid_basin_list[basin_id])+1.;
-
-	Input* dist_gl_input=inputs->GetInput(DistanceToGroundinglineEnum); _assert_(dist_gl_input);
-	Input* dist_cf_input=inputs->GetInput(DistanceToCalvingfrontEnum);  _assert_(dist_cf_input);
-
-	/*Get dist_gl and dist_cf at center of element*/
-	Gauss* gauss=this->NewGauss(1); gauss->GaussPoint(0);
-	dist_gl_input->GetInputValue(&dist_gl,gauss);
-	dist_cf_input->GetInputValue(&dist_cf,gauss);
-	delete gauss;
-
-	/*Ensure values are positive for floating ice*/
-	dist_gl = fabs(dist_gl);
-	dist_cf = fabs(dist_cf);
-
-	/*Compute relative distance to grounding line*/
-	IssmDouble rel_dist_gl=dist_gl/(dist_gl+dist_cf);
-
-	/*Assign box numbers based on rel_dist_gl*/
-	int boxid = -1;
-	for(IssmDouble i=0.;i<boxid_max;i++){
-		IssmDouble lowbound  = 1. -sqrt((boxid_max-i   )/boxid_max);
-		IssmDouble highbound = 1. -sqrt((boxid_max-i-1.)/boxid_max);
-		if(rel_dist_gl>=lowbound && rel_dist_gl<=highbound){
-			boxid=reCast<int>(i);
-			break;
-		}
-	}
-	if(boxid==-1) _error_("No boxid found for element " << this->Sid() << "!");
-
-	this->inputs->AddInput(new IntInput(BasalforcingsPicoBoxIdEnum, boxid));	
-}/*}}}*/
-void       Tria::PicoUpdateBox(int loopboxid){/*{{{*/
-
-	if(!this->IsIceInElement() || !this->IsFloating()) return;
-
-	int boxid;
-	this->inputs->GetInputValue(&boxid,BasalforcingsPicoBoxIdEnum);
-	if(loopboxid!=boxid) return;
-
-	int        basinid, maxbox, num_basins, numnodes, M;
-	IssmDouble gamma_T, overturning_coeff, thickness;
-	IssmDouble pressure, T_star,p_coeff, q_coeff;
-	bool       isplume;
-
-	/*Get variables*/
-	IssmDouble rhoi       = this->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble rhow       = this->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble earth_grav = this->GetMaterialParameter(ConstantsGEnum);
-	IssmDouble rho_star   = 1033.;             // kg/m^3
-	IssmDouble nu         = rhoi/rhow;
-	IssmDouble latentheat = this->GetMaterialParameter(MaterialsLatentheatEnum);
-	IssmDouble c_p_ocean  = this->GetMaterialParameter(MaterialsMixedLayerCapacityEnum);
-	IssmDouble lambda     = latentheat/c_p_ocean;
-	IssmDouble a          = -0.0572;          // K/psu
-	IssmDouble b          = 0.0788 + this->GetMaterialParameter(MaterialsMeltingpointEnum);  //K
-	IssmDouble c          = 7.77e-4;
-	IssmDouble alpha      = 7.5e-5;           // 1/K
-	IssmDouble Beta       = 7.7e-4;           // K
-
-	/* Get non-box-specific parameters and inputs */
-	this->parameters->FindParam(&num_basins, BasalforcingsPicoNumBasinsEnum);
-	this->parameters->FindParam(&gamma_T,BasalforcingsPicoGammaTEnum);
-	this->parameters->FindParam(&overturning_coeff,BasalforcingsPicoOverturningCoeffEnum);
-	this->parameters->FindParam(&maxbox,BasalforcingsPicoMaxboxcountEnum);
-	this->inputs->GetInputValue(&basinid,BasalforcingsPicoBasinIdEnum);
-	this->parameters->FindParam(&isplume, BasalforcingsPicoIsplumeEnum);
-	Input* thickness_input=this->GetInput(ThicknessEnum); _assert_(thickness_input);
-	_assert_(basinid<=num_basins);
-
-   IssmDouble* boxareas = NULL;
-	this->parameters->FindParam(&boxareas,&M,BasalforcingsPicoBoxAreaEnum);
-	_assert_(M==num_basins*maxbox);
-
-	IssmDouble area_boxi        = boxareas[basinid*maxbox+boxid];
-	IssmDouble g1               = area_boxi*gamma_T;
-
-	IssmDouble basalmeltrates_shelf[NUMVERTICES];
-	IssmDouble potential_pressure_melting_point[NUMVERTICES];
-	IssmDouble Tocs[NUMVERTICES];
-	IssmDouble Socs[NUMVERTICES];
-
-	/* First box calculations */
-	if(boxid==0){
-		/* Get box1 parameters and inputs */
-		IssmDouble time, toc_farocean, soc_farocean;
-		this->parameters->FindParam(&time,TimeEnum);
-		this->parameters->FindParam(&toc_farocean, basinid, time, BasalforcingsPicoFarOceantemperatureEnum);
-		this->parameters->FindParam(&soc_farocean, basinid, time, BasalforcingsPicoFarOceansalinityEnum);
-		IssmDouble s1 = soc_farocean/(nu*lambda);
-		IssmDouble overturnings[NUMVERTICES];
-
-		/* Start looping on the number of verticies and calculate ocean vars */
-		Gauss* gauss=this->NewGauss();
-		for(int i=0;i<NUMVERTICES;i++){
-			gauss->GaussVertex(i);
-			thickness_input->GetInputValue(&thickness,gauss);
-			pressure = (rhoi*earth_grav*1e-4)*thickness;
-			T_star   = a*soc_farocean+b-c*pressure-toc_farocean;
-			p_coeff  = g1/(overturning_coeff*rho_star*(Beta*s1-alpha));
-			q_coeff  = T_star*(g1/(overturning_coeff*rho_star*(Beta*s1-alpha)));
-
-			/* To avoid negatives under the square root */
-			if((0.25*pow(p_coeff,2)-q_coeff)<0) q_coeff = 0.25*p_coeff*p_coeff;
-
-			Tocs[i] = toc_farocean-(-0.5*p_coeff+sqrt(0.25*pow(p_coeff,2)-q_coeff));
-			Socs[i] = soc_farocean-(soc_farocean/(nu*lambda))*(toc_farocean-Tocs[i]);
-			potential_pressure_melting_point[i] = a*Socs[i]+b-c*pressure;
-			if(!isplume) basalmeltrates_shelf[i] = (-gamma_T/(nu*lambda))*(potential_pressure_melting_point[i]-Tocs[i]);
-			overturnings[i] = overturning_coeff*rho_star*(Beta*(soc_farocean-Socs[i])-alpha*(toc_farocean-Tocs[i]));
-		}
-
-		if(!isplume) this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,basalmeltrates_shelf,P1Enum);
-		this->AddInput(BasalforcingsPicoSubShelfOceanTempEnum,Tocs,P1Enum);
-		this->AddInput(BasalforcingsPicoSubShelfOceanSalinityEnum,Socs,P1Enum);
-		this->AddInput(BasalforcingsPicoSubShelfOceanOverturningEnum,overturnings,P1Enum);
-
-		/*Cleanup and return*/
-		delete gauss;
-	}
-
-	/* Subsequent box calculations */
-	else {
-		/* Get subsequent box parameters and inputs */
-		IssmDouble* toc_weighted_avg         = NULL;
-		IssmDouble* soc_weighted_avg         = NULL;
-		IssmDouble* overturning_weighted_avg = NULL;
-		this->parameters->FindParam(&toc_weighted_avg,&num_basins,BasalforcingsPicoAverageTemperatureEnum);
-		this->parameters->FindParam(&soc_weighted_avg,&num_basins,BasalforcingsPicoAverageSalinityEnum);
-		this->parameters->FindParam(&overturning_weighted_avg,&num_basins,BasalforcingsPicoAverageOverturningEnum);
-		IssmDouble mean_toc                  = toc_weighted_avg[basinid];
-		IssmDouble mean_soc                  = soc_weighted_avg[basinid];
-		IssmDouble mean_overturning          = overturning_weighted_avg[basinid];
-		IssmDouble g2                        = g1/(nu*lambda);
-
-		/* Start looping on the number of verticies and calculate ocean vars */
-		Gauss* gauss=this->NewGauss();
-		for(int i=0;i<NUMVERTICES;i++){
-			gauss->GaussVertex(i);
-			thickness_input->GetInputValue(&thickness,gauss);
-			pressure = (rhoi*earth_grav*1.e-4)*thickness;
-			T_star   = a*mean_soc+b-c*pressure-mean_toc;
-			Tocs[i]  = mean_toc+T_star*(g1/(mean_overturning+g1-g2*a*mean_soc));
-			Socs[i]  = mean_soc-mean_soc*((mean_toc-Tocs[i])/(nu*lambda));
-			potential_pressure_melting_point[i] = a*Socs[i]+b-c*pressure;
-			if(!isplume) basalmeltrates_shelf[i] = (-gamma_T/(nu*lambda))*(potential_pressure_melting_point[i]-Tocs[i]);
-		}
-
-		if(!isplume) this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,basalmeltrates_shelf,P1Enum);
-		this->AddInput(BasalforcingsPicoSubShelfOceanTempEnum,Tocs,P1Enum);
-		this->AddInput(BasalforcingsPicoSubShelfOceanSalinityEnum,Socs,P1Enum);
-
-		/*Cleanup and return*/
-		xDelete<IssmDouble>(toc_weighted_avg);
-		xDelete<IssmDouble>(soc_weighted_avg);
-		xDelete<IssmDouble>(overturning_weighted_avg);
-		delete gauss;
-	}
-
-	/*Cleanup and return*/
-	xDelete<IssmDouble>(boxareas);
-}
-/*}}}*/
-void       Tria::PicoComputeBasalMelt(void){/*{{{*/
-
-	if(!this->IsIceInElement() || !this->IsFloating()) return;
-
-   IssmDouble E0, Cd, CdT, YT, lam1, lam2, lam3, M0, CdTS0, y1, y2, x0;
-	IssmDouble Tf_gl, YTS, CdTS, G1, G2, G3, g_alpha, M, l, X_hat, M_hat;
-	IssmDouble alpha, zgl, Toc, Soc, z_base, yts, slopex, slopey;
-
-	/*Get variables*/
-	E0    = 3.6e-2;        //Entrainment coefficient
-	Cd    = 2.5e-3;        //Drag coefficient
-	CdT   = 1.1e-3;        //Turbulent heat exchange coefficient
-	YT    = CdT/sqrt(Cd);  //Heat exchange coefficient
-	lam1  = -5.73e-2;      //Freezing point-salinity coefficient (degrees C)
-	lam2  = 8.32e-2;       //Freezing point offset (degrees C)
-	lam3  = 7.61e-4;       //Freezing point-depth coefficient (K m-1)
-	M0    = 10.;           //Melt-rate parameter (m yr-1 C-2)
-	CdTS0 = 6e-4;          //Heat exchange parameter
-	y1    = 0.545;         //Heat exchange parameter
-	y2    = 3.5e-5;        //Heat exchange parameter
-	x0    = 0.56;          //Dimentionless scaling factor
-
-	/*Define arrays*/
-	IssmDouble basalmeltrates_shelf[NUMVERTICES];  //Basal melt-rate
-	//IssmDouble slope[NUMVERTICES];                 //Basal slope
-
-	/*Polynomial coefficients*/
-	IssmDouble p[12];
-	p[0]  =  0.1371330075095435;
-	p[1]  =  5.527656234709359E1;
-	p[2]  = -8.951812433987858E2;
-	p[3]  =  8.927093637594877E3;
-	p[4]  = -5.563863123811898E4;
-	p[5]  =  2.218596970948727E5;
-	p[6]  = -5.820015295669482E5;
-	p[7]  =  1.015475347943186E6;
-	p[8]  = -1.166290429178556E6;
-	p[9]  =  8.466870335320488E5;
-	p[10] = -3.520598035764990E5;
-	p[11] =  6.387953795485420E4;
-
-	/*Get inputs*/
-   Input* zgl_input            = this->GetInput(GroundinglineHeightEnum);                     _assert_(zgl_input);
-	Input* toc_input            = this->GetInput(BasalforcingsPicoSubShelfOceanTempEnum);      _assert_(toc_input);
-	Input* soc_input            = this->GetInput(BasalforcingsPicoSubShelfOceanSalinityEnum);  _assert_(soc_input);
-	Input* base_input           = this->GetInput(BaseEnum);                                    _assert_(base_input);
-	Input* baseslopex_input     = this->GetInput(BaseSlopeXEnum);                              _assert_(baseslopex_input);
-	Input* baseslopey_input     = this->GetInput(BaseSlopeYEnum);                              _assert_(baseslopey_input);
-	this->FindParam(&yts, ConstantsYtsEnum);
-
-	/*Loop over the number of vertices in this element*/
-	Gauss* gauss=this->NewGauss();
-	for(int i=0;i<NUMVERTICES;i++){
-		gauss->GaussVertex(i);
-
-		/*Get inputs*/
-      zgl_input->GetInputValue(&zgl,gauss); 
-		toc_input->GetInputValue(&Toc,gauss); //(K)
-		soc_input->GetInputValue(&Soc,gauss);
-		base_input->GetInputValue(&z_base,gauss);
-		baseslopex_input->GetInputValue(&slopex,gauss);
-		baseslopey_input->GetInputValue(&slopey,gauss);
-
-		/*Compute ice shelf base slope*/
-		alpha = sqrt(slopex*slopex + slopey*slopey);
-
-		/*Make necessary conversions*/
-		Toc = Toc-273.15;
-		alpha = atan(alpha);          
-		if(zgl>z_base) zgl=z_base-10;
-
-		/*Low bound for Toc to ensure X_hat is between 0 and 1*/
-		if(Toc<lam1*Soc+lam2) Toc=lam1*Soc+lam2;
-
-		/*Compute parameters needed for melt-rate calculation*/
-		Tf_gl = lam1*Soc+lam2+lam3*zgl;                                              //Characteristic freezing point
-		YTS = YT*(y1+y2*(((Toc-Tf_gl)*E0*sin(alpha))/(lam3*(CdTS0+E0*sin(alpha))))); //Effective heat exchange coefficient
-		CdTS = sqrt(Cd)*YTS;                                                         //Heat exchange coefficient
-		G1 = sqrt(sin(alpha)/(Cd+E0*sin(alpha)));                                    //Geometric factor
-		G2 = sqrt(CdTS/(CdTS+E0*sin(alpha)));                                        //Geometric factor
-		G3 = (E0*sin(alpha))/(CdTS+E0*sin(alpha));                                   //Geometric factor
-      g_alpha = G1*G2*G3;                                                          //Melt scaling factor
-		M = M0*g_alpha*pow((Toc-Tf_gl),2);                                           //Melt-rate scale
-		l = ((Toc-Tf_gl)*(x0*CdTS+E0*sin(alpha)))/(lam3*x0*(CdTS+E0*sin(alpha)));    //Length scale
-		X_hat = (z_base-zgl)/l;                                                      //Dimentionless coordinate system
-
-		/*Compute polynomial fit*/
-		M_hat = 0.;                                                                  //Reset summation variable for each node
-		for(int ii=0;ii<12;ii++) {
-		 M_hat += p[ii]*pow(X_hat,ii);                                               //Polynomial fit
-	   }
-
-		/*Compute melt-rate*/
-		basalmeltrates_shelf[i] = (M*M_hat)/yts;                                     //Basal melt-rate (m/s)
-	}
-   /*Save computed melt-rate*/
-   this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,basalmeltrates_shelf,P1Enum);
-
-   /*Cleanup and return*/
-	delete gauss;
-}/*}}}*/
 void       Tria::PotentialUngrounding(Vector<IssmDouble>* potential_ungrounding){/*{{{*/
 
@@ -3134,6 +3523,6 @@
 
 	/*material parameters: */
-	rho_water=matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_water=FindParam(MaterialsRhoSeawaterEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 	density=rho_ice/rho_water;
 	GetInputListOnVertices(&h[0],ThicknessEnum);
@@ -3225,7 +3614,7 @@
 
 			/*New X axis                  New Z axis*/
-			xz_plane[0]=cos(theta);       xz_plane[3]=0.;  
-			xz_plane[1]=sin(theta);       xz_plane[4]=0.;  
-			xz_plane[2]=0.;               xz_plane[5]=1.;          
+			xz_plane[0]=cos(theta);       xz_plane[3]=0.;
+			xz_plane[1]=sin(theta);       xz_plane[4]=0.;
+			xz_plane[2]=0.;               xz_plane[5]=1.;
 
 			if(groundedice>=0){
@@ -3251,5 +3640,4 @@
 	this->vertices=NULL;
 	this->material=NULL;
-	this->matpar=NULL;
 	this->parameters=NULL;
 
@@ -3258,12 +3646,63 @@
 	this->hvertices->reset();
 	this->hmaterial->reset();
-	this->hmatpar->reset();
 	if(this->hneighbors) this->hneighbors->reset();
 
 }
 /*}}}*/
-void       Tria::SetClone(int* minranks){/*{{{*/
-
-	_error_("not implemented yet");
+void       Tria::RignotMeltParameterization(){/*{{{*/
+
+   IssmDouble A, B, alpha, beta;
+	IssmDouble bed,qsg,qsg_basin,TF,yts;
+	int numbasins;
+	IssmDouble basinid[NUMVERTICES];
+	IssmDouble* basin_icefront_area=NULL;
+
+	/* Coefficients */
+	A    = 3e-4;
+	B    = 0.15;
+	alpha = 0.39;
+	beta = 1.18;
+
+	/*Get inputs*/
+	Input* bed_input = this->GetInput(BedEnum);                     _assert_(bed_input);
+	Input* qsg_input = this->GetInput(FrontalForcingsSubglacialDischargeEnum);		 _assert_(qsg_input);
+	Input* TF_input  = this->GetInput(FrontalForcingsThermalForcingEnum);          _assert_(TF_input);
+	GetInputListOnVertices(&basinid[0],FrontalForcingsBasinIdEnum);
+
+	this->FindParam(&yts, ConstantsYtsEnum);
+	this->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
+	this->parameters->FindParam(&basin_icefront_area,&numbasins,FrontalForcingsBasinIcefrontAreaEnum);
+
+	IssmDouble meltrates[NUMVERTICES];  //frontal melt-rate
+
+	/* Start looping on the number of vertices: */
+	GaussTria* gauss=new GaussTria();
+	for(int iv=0;iv<NUMVERTICES;iv++){
+		gauss->GaussVertex(iv);
+
+		/* Get variables */
+		bed_input->GetInputValue(&bed,gauss);
+		qsg_input->GetInputValue(&qsg,gauss);
+		TF_input->GetInputValue(&TF,gauss);
+
+		if(basin_icefront_area[reCast<int>(basinid[iv])-1]==0.) meltrates[iv]=0.;
+		else{
+			/* change the unit of qsg (m^3/d -> m/d) with ice front area */
+			qsg_basin=qsg/basin_icefront_area[reCast<int>(basinid[iv])-1];
+
+			/* calculate melt rates */
+			meltrates[iv]=((A*max(-bed,0.)*pow(max(qsg_basin,0.),alpha)+B)*pow(max(TF,0.),beta))/86400; //[m/s]
+		}
+
+		if(xIsNan<IssmDouble>(meltrates[iv])) _error_("NaN found in vector");
+		if(xIsInf<IssmDouble>(meltrates[iv])) _error_("Inf found in vector");
+	}
+
+	/*Add input*/
+	this->inputs->AddInput(new TriaInput(CalvingMeltingrateEnum,&meltrates[0],P1Enum));
+
+	/*Cleanup and return*/
+	xDelete<IssmDouble>(basin_icefront_area);
+	delete gauss;
 }
 /*}}}*/
@@ -3413,8 +3852,7 @@
 	seg->material=(Material*)this->material->copy2(seg);
 
-	/*recover nodes, material and matpar: */
+	/*recover nodes, material*/
 	seg->nodes    = (Node**)seg->hnodes[analysis_counter]->deliverp();
 	seg->vertices = (Vertex**)seg->hvertices->deliverp();
-	seg->matpar   = (Matpar*)seg->hmatpar->delivers();
 
 	/*Return new Seg*/
@@ -3604,4 +4042,274 @@
 }
 /*}}}*/
+IssmDouble Tria::TotalCalvingFluxLevelset(bool scaled){/*{{{*/
+
+	/*Make sure there is an ice front here*/
+	if(!IsIceInElement() || !IsZeroLevelset(MaskIceLevelsetEnum)) return 0;
+
+	/*Scaled not implemented yet...*/
+	_assert_(!scaled);
+
+	int               domaintype,index1,index2;
+	const IssmPDouble epsilon = 1.e-15;
+	IssmDouble        s1,s2;
+	IssmDouble        gl[NUMVERTICES];
+	IssmDouble        xyz_front[2][3];
+
+
+	IssmDouble *xyz_list = NULL;
+	this->GetVerticesCoordinates(&xyz_list);
+
+	/*Recover parameters and values*/
+	parameters->FindParam(&domaintype,DomainTypeEnum);
+	GetInputListOnVertices(&gl[0],MaskIceLevelsetEnum);
+
+	/*Be sure that values are not zero*/
+	if(gl[0]==0.) gl[0]=gl[0]+epsilon;
+	if(gl[1]==0.) gl[1]=gl[1]+epsilon;
+	if(gl[2]==0.) gl[2]=gl[2]+epsilon;
+
+	if(domaintype==Domain2DverticalEnum){
+		_error_("not implemented");
+	}
+	else if(domaintype==Domain2DhorizontalEnum || domaintype==Domain3DEnum || domaintype==Domain3DsurfaceEnum){
+		int pt1 = 0;
+		int pt2 = 1;
+		if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
+
+			/*Portion of the segments*/
+			s1=gl[2]/(gl[2]-gl[1]);
+			s2=gl[2]/(gl[2]-gl[0]);
+			if(gl[2]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+			xyz_front[pt2][0]=xyz_list[3*2+0]+s1*(xyz_list[3*1+0]-xyz_list[3*2+0]);
+			xyz_front[pt2][1]=xyz_list[3*2+1]+s1*(xyz_list[3*1+1]-xyz_list[3*2+1]);
+			xyz_front[pt2][2]=xyz_list[3*2+2]+s1*(xyz_list[3*1+2]-xyz_list[3*2+2]);
+			xyz_front[pt1][0]=xyz_list[3*2+0]+s2*(xyz_list[3*0+0]-xyz_list[3*2+0]);
+			xyz_front[pt1][1]=xyz_list[3*2+1]+s2*(xyz_list[3*0+1]-xyz_list[3*2+1]);
+			xyz_front[pt1][2]=xyz_list[3*2+2]+s2*(xyz_list[3*0+2]-xyz_list[3*2+2]);
+		}
+		else if(gl[1]*gl[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
+
+			/*Portion of the segments*/
+			s1=gl[0]/(gl[0]-gl[1]);
+			s2=gl[0]/(gl[0]-gl[2]);
+			if(gl[0]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+
+			xyz_front[pt1][0]=xyz_list[3*0+0]+s1*(xyz_list[3*1+0]-xyz_list[3*0+0]);
+			xyz_front[pt1][1]=xyz_list[3*0+1]+s1*(xyz_list[3*1+1]-xyz_list[3*0+1]);
+			xyz_front[pt1][2]=xyz_list[3*0+2]+s1*(xyz_list[3*1+2]-xyz_list[3*0+2]);
+			xyz_front[pt2][0]=xyz_list[3*0+0]+s2*(xyz_list[3*2+0]-xyz_list[3*0+0]);
+			xyz_front[pt2][1]=xyz_list[3*0+1]+s2*(xyz_list[3*2+1]-xyz_list[3*0+1]);
+			xyz_front[pt2][2]=xyz_list[3*0+2]+s2*(xyz_list[3*2+2]-xyz_list[3*0+2]);
+		}
+		else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
+
+			/*Portion of the segments*/
+			s1=gl[1]/(gl[1]-gl[0]);
+			s2=gl[1]/(gl[1]-gl[2]);
+			if(gl[1]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+
+			xyz_front[pt2][0]=xyz_list[3*1+0]+s1*(xyz_list[3*0+0]-xyz_list[3*1+0]);
+			xyz_front[pt2][1]=xyz_list[3*1+1]+s1*(xyz_list[3*0+1]-xyz_list[3*1+1]);
+			xyz_front[pt2][2]=xyz_list[3*1+2]+s1*(xyz_list[3*0+2]-xyz_list[3*1+2]);
+			xyz_front[pt1][0]=xyz_list[3*1+0]+s2*(xyz_list[3*2+0]-xyz_list[3*1+0]);
+			xyz_front[pt1][1]=xyz_list[3*1+1]+s2*(xyz_list[3*2+1]-xyz_list[3*1+1]);
+			xyz_front[pt1][2]=xyz_list[3*1+2]+s2*(xyz_list[3*2+2]-xyz_list[3*1+2]);
+		}
+		else{
+			_error_("case not possible");
+		}
+
+	}
+	else _error_("mesh type "<<EnumToStringx(domaintype)<<"not supported yet ");
+
+	/*Some checks in debugging mode*/
+	_assert_(s1>=0 && s1<=1.);
+	_assert_(s2>=0 && s2<=1.);
+
+	/*Get normal vector*/
+	IssmDouble normal[3];
+	this->NormalSection(&normal[0],&xyz_front[0][0]);
+	normal[0] = -normal[0];
+	normal[1] = -normal[1];
+
+	/*Get inputs*/
+	IssmDouble flux = 0.;
+	IssmDouble calvingratex,calvingratey,thickness,Jdet;
+	IssmDouble rho_ice=FindParam(MaterialsRhoIceEnum);
+	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+	Input* calvingratex_input=NULL;
+	Input* calvingratey_input=NULL;
+	if(domaintype==Domain2DhorizontalEnum){
+		calvingratex_input=inputs->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
+		calvingratey_input=inputs->GetInput(CalvingrateyEnum); _assert_(calvingratey_input);
+	}
+	else{
+		calvingratex_input=inputs->GetInput(CalvingratexAverageEnum); _assert_(calvingratex_input);
+		calvingratey_input=inputs->GetInput(CalvingrateyAverageEnum); _assert_(calvingratey_input);
+	}
+
+	/*Start looping on Gaussian points*/
+	Gauss* gauss=this->NewGauss(xyz_list,&xyz_front[0][0],3);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+		thickness_input->GetInputValue(&thickness,gauss);
+		calvingratex_input->GetInputValue(&calvingratex,gauss);
+		calvingratey_input->GetInputValue(&calvingratey,gauss);
+		this->JacobianDeterminantSurface(&Jdet,&xyz_front[0][0],gauss);
+
+		flux += rho_ice*Jdet*gauss->weight*thickness*(calvingratex*normal[0] + calvingratey*normal[1]);
+	}
+
+	return flux;
+}
+/*}}}*/
+IssmDouble Tria::TotalCalvingMeltingFluxLevelset(bool scaled){/*{{{*/
+
+	/*Make sure there is an ice front here*/
+	if(!IsIceInElement() || !IsZeroLevelset(MaskIceLevelsetEnum)) return 0;
+
+	/*Scaled not implemented yet...*/
+	_assert_(!scaled);
+
+	int               domaintype,index1,index2;
+	const IssmPDouble epsilon = 1.e-15;
+	IssmDouble        s1,s2;
+	IssmDouble        gl[NUMVERTICES];
+	IssmDouble        xyz_front[2][3];
+
+
+	IssmDouble *xyz_list = NULL;
+	this->GetVerticesCoordinates(&xyz_list);
+
+	/*Recover parameters and values*/
+	parameters->FindParam(&domaintype,DomainTypeEnum);
+	GetInputListOnVertices(&gl[0],MaskIceLevelsetEnum);
+
+	/*Be sure that values are not zero*/
+	if(gl[0]==0.) gl[0]=gl[0]+epsilon;
+	if(gl[1]==0.) gl[1]=gl[1]+epsilon;
+	if(gl[2]==0.) gl[2]=gl[2]+epsilon;
+
+	if(domaintype==Domain2DverticalEnum){
+		_error_("not implemented");
+	}
+	else if(domaintype==Domain2DhorizontalEnum || domaintype==Domain3DEnum || domaintype==Domain3DsurfaceEnum){
+		int pt1 = 0;
+		int pt2 = 1;
+		if(gl[0]*gl[1]>0){ //Nodes 0 and 1 are similar, so points must be found on segment 0-2 and 1-2
+
+			/*Portion of the segments*/
+			s1=gl[2]/(gl[2]-gl[1]);
+			s2=gl[2]/(gl[2]-gl[0]);
+			if(gl[2]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+			xyz_front[pt2][0]=xyz_list[3*2+0]+s1*(xyz_list[3*1+0]-xyz_list[3*2+0]);
+			xyz_front[pt2][1]=xyz_list[3*2+1]+s1*(xyz_list[3*1+1]-xyz_list[3*2+1]);
+			xyz_front[pt2][2]=xyz_list[3*2+2]+s1*(xyz_list[3*1+2]-xyz_list[3*2+2]);
+			xyz_front[pt1][0]=xyz_list[3*2+0]+s2*(xyz_list[3*0+0]-xyz_list[3*2+0]);
+			xyz_front[pt1][1]=xyz_list[3*2+1]+s2*(xyz_list[3*0+1]-xyz_list[3*2+1]);
+			xyz_front[pt1][2]=xyz_list[3*2+2]+s2*(xyz_list[3*0+2]-xyz_list[3*2+2]);
+		}
+		else if(gl[1]*gl[2]>0){ //Nodes 1 and 2 are similar, so points must be found on segment 0-1 and 0-2
+
+			/*Portion of the segments*/
+			s1=gl[0]/(gl[0]-gl[1]);
+			s2=gl[0]/(gl[0]-gl[2]);
+			if(gl[0]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+
+			xyz_front[pt1][0]=xyz_list[3*0+0]+s1*(xyz_list[3*1+0]-xyz_list[3*0+0]);
+			xyz_front[pt1][1]=xyz_list[3*0+1]+s1*(xyz_list[3*1+1]-xyz_list[3*0+1]);
+			xyz_front[pt1][2]=xyz_list[3*0+2]+s1*(xyz_list[3*1+2]-xyz_list[3*0+2]);
+			xyz_front[pt2][0]=xyz_list[3*0+0]+s2*(xyz_list[3*2+0]-xyz_list[3*0+0]);
+			xyz_front[pt2][1]=xyz_list[3*0+1]+s2*(xyz_list[3*2+1]-xyz_list[3*0+1]);
+			xyz_front[pt2][2]=xyz_list[3*0+2]+s2*(xyz_list[3*2+2]-xyz_list[3*0+2]);
+		}
+		else if(gl[0]*gl[2]>0){ //Nodes 0 and 2 are similar, so points must be found on segment 1-0 and 1-2
+
+			/*Portion of the segments*/
+			s1=gl[1]/(gl[1]-gl[0]);
+			s2=gl[1]/(gl[1]-gl[2]);
+			if(gl[1]<0.){
+				pt1 = 1; pt2 = 0;
+			}
+
+			xyz_front[pt2][0]=xyz_list[3*1+0]+s1*(xyz_list[3*0+0]-xyz_list[3*1+0]);
+			xyz_front[pt2][1]=xyz_list[3*1+1]+s1*(xyz_list[3*0+1]-xyz_list[3*1+1]);
+			xyz_front[pt2][2]=xyz_list[3*1+2]+s1*(xyz_list[3*0+2]-xyz_list[3*1+2]);
+			xyz_front[pt1][0]=xyz_list[3*1+0]+s2*(xyz_list[3*2+0]-xyz_list[3*1+0]);
+			xyz_front[pt1][1]=xyz_list[3*1+1]+s2*(xyz_list[3*2+1]-xyz_list[3*1+1]);
+			xyz_front[pt1][2]=xyz_list[3*1+2]+s2*(xyz_list[3*2+2]-xyz_list[3*1+2]);
+		}
+		else{
+			_error_("case not possible");
+		}
+
+	}
+	else _error_("mesh type "<<EnumToStringx(domaintype)<<"not supported yet ");
+
+	/*Some checks in debugging mode*/
+	_assert_(s1>=0 && s1<=1.);
+	_assert_(s2>=0 && s2<=1.);
+
+	/*Get normal vector*/
+	IssmDouble normal[3];
+	this->NormalSection(&normal[0],&xyz_front[0][0]);
+	normal[0] = -normal[0];
+	normal[1] = -normal[1];
+
+	/*Get inputs*/
+	IssmDouble flux = 0.;
+	IssmDouble calvingratex,calvingratey,vx,vy,vel,meltingrate,meltingratex,meltingratey,thickness,Jdet;
+	IssmDouble rho_ice=FindParam(MaterialsRhoIceEnum);
+	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+	Input* calvingratex_input=NULL;
+	Input* calvingratey_input=NULL;
+	Input* vx_input=NULL;
+	Input* vy_input=NULL;
+	Input* meltingrate_input=NULL;
+	if(domaintype==Domain2DhorizontalEnum){
+		calvingratex_input=inputs->GetInput(CalvingratexEnum); _assert_(calvingratex_input);
+		calvingratey_input=inputs->GetInput(CalvingrateyEnum); _assert_(calvingratey_input);
+		vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
+		vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
+		meltingrate_input=inputs->GetInput(CalvingMeltingrateEnum); _assert_(meltingrate_input);
+	}
+	else{
+		calvingratex_input=inputs->GetInput(CalvingratexAverageEnum); _assert_(calvingratex_input);
+		calvingratey_input=inputs->GetInput(CalvingrateyAverageEnum); _assert_(calvingratey_input);
+	}
+
+	/*Start looping on Gaussian points*/
+	Gauss* gauss=this->NewGauss(xyz_list,&xyz_front[0][0],3);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+		thickness_input->GetInputValue(&thickness,gauss);
+		calvingratex_input->GetInputValue(&calvingratex,gauss);
+		calvingratey_input->GetInputValue(&calvingratey,gauss);
+		vx_input->GetInputValue(&vx,gauss);
+		vy_input->GetInputValue(&vy,gauss);
+		vel=vx*vx+vy*vy;
+		meltingrate_input->GetInputValue(&meltingrate,gauss);
+		meltingratex=meltingrate*vx/(sqrt(vel)+1.e-14);
+		meltingratey=meltingrate*vy/(sqrt(vel)+1.e-14);
+		this->JacobianDeterminantSurface(&Jdet,&xyz_front[0][0],gauss);
+
+		flux += rho_ice*Jdet*gauss->weight*thickness*((calvingratex+meltingratex)*normal[0] + (calvingratey+meltingratey)*normal[1]);
+	}
+
+	return flux;
+}
+/*}}}*/
 IssmDouble Tria::TotalFloatingBmb(bool scaled){/*{{{*/
 
@@ -3618,10 +4326,10 @@
 
 	/*Get material parameters :*/
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	Input* floatingmelt_input = this->GetInput(BasalforcingsFloatingiceMeltingRateEnum); _assert_(floatingmelt_input); 
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	Input* floatingmelt_input = this->GetInput(BasalforcingsFloatingiceMeltingRateEnum); _assert_(floatingmelt_input);
 	Input* gllevelset_input = this->GetInput(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input);
 	Input* scalefactor_input = NULL;
 	if(scaled==true){
-		scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input); 
+		scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
 	}
 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
@@ -3663,10 +4371,10 @@
 
 	/*Get material parameters :*/
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	Input* groundedmelt_input = this->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(groundedmelt_input); 
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	Input* groundedmelt_input = this->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(groundedmelt_input);
 	Input* gllevelset_input = this->GetInput(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input);
 	Input* scalefactor_input = NULL;
 	if(scaled==true){
-		scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input); 
+		scalefactor_input = this->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
 	}
 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
@@ -3702,5 +4410,5 @@
 
 	/*Get material parameters :*/
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 
    if(!IsIceInElement())return 0;
@@ -3718,5 +4426,5 @@
 	if(scaled==true){
 		Input* scalefactor_input = inputs->GetInput(MeshScaleFactorEnum); _assert_(scalefactor_input);
-		scalefactor_input->GetInputAverage(&scalefactor);// average scalefactor on element 
+		scalefactor_input->GetInputAverage(&scalefactor);// average scalefactor on element
 	}
 	else{
@@ -3737,5 +4445,5 @@
 	/*Checks if debuging*/
 	_assert_(iomodel->elements);
-	_assert_(index==this->sid); 
+	_assert_(index==this->sid);
 
 	/*Recover element type*/
@@ -3744,69 +4452,74 @@
 	/*Recover nodes ids needed to initialize the node hook.*/
 	switch(finiteelement_type){
+		case P0DGEnum:
+			numnodes        = 1;
+			tria_node_ids   = xNew<int>(numnodes);
+			tria_node_ids[0]= index + 1;
+			break;
 		case P1Enum:
 			numnodes        = 3;
 			tria_node_ids   = xNew<int>(numnodes);
-			tria_node_ids[0]=iomodel->nodecounter+iomodel->elements[3*index+0];
-			tria_node_ids[1]=iomodel->nodecounter+iomodel->elements[3*index+1];
-			tria_node_ids[2]=iomodel->nodecounter+iomodel->elements[3*index+2];
+			tria_node_ids[0]=iomodel->elements[3*index+0];
+			tria_node_ids[1]=iomodel->elements[3*index+1];
+			tria_node_ids[2]=iomodel->elements[3*index+2];
 			break;
 		case P1DGEnum:
 			numnodes        = 3;
 			tria_node_ids   = xNew<int>(numnodes);
-			tria_node_ids[0]=iomodel->nodecounter+3*index+1;
-			tria_node_ids[1]=iomodel->nodecounter+3*index+2;
-			tria_node_ids[2]=iomodel->nodecounter+3*index+3;
+			tria_node_ids[0]=3*index+1;
+			tria_node_ids[1]=3*index+2;
+			tria_node_ids[2]=3*index+3;
 			break;
 		case P1bubbleEnum: case P1bubblecondensedEnum:
 			numnodes        = 4;
 			tria_node_ids   = xNew<int>(numnodes);
-			tria_node_ids[0]=iomodel->nodecounter+iomodel->elements[3*index+0];
-			tria_node_ids[1]=iomodel->nodecounter+iomodel->elements[3*index+1];
-			tria_node_ids[2]=iomodel->nodecounter+iomodel->elements[3*index+2];
-			tria_node_ids[3]=iomodel->nodecounter+iomodel->numberofvertices+index+1;
+			tria_node_ids[0]=iomodel->elements[3*index+0];
+			tria_node_ids[1]=iomodel->elements[3*index+1];
+			tria_node_ids[2]=iomodel->elements[3*index+2];
+			tria_node_ids[3]=iomodel->numberofvertices+index+1;
 			break;
 		case P2Enum:
 			numnodes        = 6;
 			tria_node_ids   = xNew<int>(numnodes);
-			tria_node_ids[0]=iomodel->nodecounter+iomodel->elements[3*index+0];
-			tria_node_ids[1]=iomodel->nodecounter+iomodel->elements[3*index+1];
-			tria_node_ids[2]=iomodel->nodecounter+iomodel->elements[3*index+2];
-			tria_node_ids[3]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+0]+1;
-			tria_node_ids[4]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+1]+1;
-			tria_node_ids[5]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+2]+1;
+			tria_node_ids[0]=iomodel->elements[3*index+0];
+			tria_node_ids[1]=iomodel->elements[3*index+1];
+			tria_node_ids[2]=iomodel->elements[3*index+2];
+			tria_node_ids[3]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+0]+1;
+			tria_node_ids[4]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+1]+1;
+			tria_node_ids[5]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+2]+1;
 			break;
 		case P2bubbleEnum: case P2bubblecondensedEnum:
 			numnodes        = 7;
 			tria_node_ids   = xNew<int>(numnodes);
-			tria_node_ids[0]=iomodel->nodecounter+iomodel->elements[3*index+0];
-			tria_node_ids[1]=iomodel->nodecounter+iomodel->elements[3*index+1];
-			tria_node_ids[2]=iomodel->nodecounter+iomodel->elements[3*index+2];
-			tria_node_ids[3]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+0]+1;
-			tria_node_ids[4]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+1]+1;
-			tria_node_ids[5]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+2]+1;
-			tria_node_ids[6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+index+1;
+			tria_node_ids[0]=iomodel->elements[3*index+0];
+			tria_node_ids[1]=iomodel->elements[3*index+1];
+			tria_node_ids[2]=iomodel->elements[3*index+2];
+			tria_node_ids[3]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+0]+1;
+			tria_node_ids[4]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+1]+1;
+			tria_node_ids[5]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+2]+1;
+			tria_node_ids[6]=iomodel->numberofvertices+iomodel->numberofedges+index+1;
 			break;
 		case P1P1Enum: case P1P1GLSEnum:
 			numnodes        = 6;
 			tria_node_ids   = xNew<int>(numnodes);
-			tria_node_ids[0]=iomodel->nodecounter+iomodel->elements[3*index+0];
-			tria_node_ids[1]=iomodel->nodecounter+iomodel->elements[3*index+1];
-			tria_node_ids[2]=iomodel->nodecounter+iomodel->elements[3*index+2];
-
-			tria_node_ids[3]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elements[3*index+0];
-			tria_node_ids[4]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elements[3*index+1];
-			tria_node_ids[5]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elements[3*index+2];
+			tria_node_ids[0]=iomodel->elements[3*index+0];
+			tria_node_ids[1]=iomodel->elements[3*index+1];
+			tria_node_ids[2]=iomodel->elements[3*index+2];
+
+			tria_node_ids[3]=iomodel->numberofvertices+iomodel->elements[3*index+0];
+			tria_node_ids[4]=iomodel->numberofvertices+iomodel->elements[3*index+1];
+			tria_node_ids[5]=iomodel->numberofvertices+iomodel->elements[3*index+2];
 			break;
 		case MINIEnum: case MINIcondensedEnum:
 			numnodes       = 7;
 			tria_node_ids  = xNew<int>(numnodes);
-			tria_node_ids[0]=iomodel->nodecounter+iomodel->elements[3*index+0];
-			tria_node_ids[1]=iomodel->nodecounter+iomodel->elements[3*index+1];
-			tria_node_ids[2]=iomodel->nodecounter+iomodel->elements[3*index+2];
-			tria_node_ids[3]=iomodel->nodecounter+iomodel->numberofvertices+index+1;
-
-			tria_node_ids[4]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[3*index+0];
-			tria_node_ids[5]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[3*index+1];
-			tria_node_ids[6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[3*index+2];
+			tria_node_ids[0]=iomodel->elements[3*index+0];
+			tria_node_ids[1]=iomodel->elements[3*index+1];
+			tria_node_ids[2]=iomodel->elements[3*index+2];
+			tria_node_ids[3]=iomodel->numberofvertices+index+1;
+
+			tria_node_ids[4]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[3*index+0];
+			tria_node_ids[5]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[3*index+1];
+			tria_node_ids[6]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[3*index+2];
 			break;
 		case TaylorHoodEnum:
@@ -3814,50 +4527,50 @@
 			numnodes        = 9;
 			tria_node_ids   = xNew<int>(numnodes);
-			tria_node_ids[0]=iomodel->nodecounter+iomodel->elements[3*index+0];
-			tria_node_ids[1]=iomodel->nodecounter+iomodel->elements[3*index+1];
-			tria_node_ids[2]=iomodel->nodecounter+iomodel->elements[3*index+2];
-			tria_node_ids[3]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+0]+1;
-			tria_node_ids[4]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+1]+1;
-			tria_node_ids[5]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+2]+1;
-
-			tria_node_ids[6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[3*index+0];
-			tria_node_ids[7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[3*index+1];
-			tria_node_ids[8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[3*index+2];
+			tria_node_ids[0]=iomodel->elements[3*index+0];
+			tria_node_ids[1]=iomodel->elements[3*index+1];
+			tria_node_ids[2]=iomodel->elements[3*index+2];
+			tria_node_ids[3]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+0]+1;
+			tria_node_ids[4]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+1]+1;
+			tria_node_ids[5]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+2]+1;
+
+			tria_node_ids[6]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[3*index+0];
+			tria_node_ids[7]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[3*index+1];
+			tria_node_ids[8]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[3*index+2];
 			break;
 		case LATaylorHoodEnum:
 			numnodes        = 6;
 			tria_node_ids   = xNew<int>(numnodes);
-			tria_node_ids[0]=iomodel->nodecounter+iomodel->elements[3*index+0];
-			tria_node_ids[1]=iomodel->nodecounter+iomodel->elements[3*index+1];
-			tria_node_ids[2]=iomodel->nodecounter+iomodel->elements[3*index+2];
-			tria_node_ids[3]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+0]+1;
-			tria_node_ids[4]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+1]+1;
-			tria_node_ids[5]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+2]+1;
+			tria_node_ids[0]=iomodel->elements[3*index+0];
+			tria_node_ids[1]=iomodel->elements[3*index+1];
+			tria_node_ids[2]=iomodel->elements[3*index+2];
+			tria_node_ids[3]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+0]+1;
+			tria_node_ids[4]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+1]+1;
+			tria_node_ids[5]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+2]+1;
 			break;
 		case CrouzeixRaviartEnum:
 			numnodes        = 10;
 			tria_node_ids   = xNew<int>(numnodes);
-			tria_node_ids[0]=iomodel->nodecounter+iomodel->elements[3*index+0];
-			tria_node_ids[1]=iomodel->nodecounter+iomodel->elements[3*index+1];
-			tria_node_ids[2]=iomodel->nodecounter+iomodel->elements[3*index+2];
-			tria_node_ids[3]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+0]+1;
-			tria_node_ids[4]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+1]+1;
-			tria_node_ids[5]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+2]+1;
-			tria_node_ids[6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+index+1;
-
-			tria_node_ids[7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofelements+3*index+1;
-			tria_node_ids[8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofelements+3*index+2;
-			tria_node_ids[9]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofelements+3*index+3;
+			tria_node_ids[0]=iomodel->elements[3*index+0];
+			tria_node_ids[1]=iomodel->elements[3*index+1];
+			tria_node_ids[2]=iomodel->elements[3*index+2];
+			tria_node_ids[3]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+0]+1;
+			tria_node_ids[4]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+1]+1;
+			tria_node_ids[5]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+2]+1;
+			tria_node_ids[6]=iomodel->numberofvertices+iomodel->numberofedges+index+1;
+
+			tria_node_ids[7]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofelements+3*index+1;
+			tria_node_ids[8]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofelements+3*index+2;
+			tria_node_ids[9]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofelements+3*index+3;
 			break;
 		case LACrouzeixRaviartEnum:
 			numnodes        = 7;
 			tria_node_ids   = xNew<int>(numnodes);
-			tria_node_ids[0]=iomodel->nodecounter+iomodel->elements[3*index+0];
-			tria_node_ids[1]=iomodel->nodecounter+iomodel->elements[3*index+1];
-			tria_node_ids[2]=iomodel->nodecounter+iomodel->elements[3*index+2];
-			tria_node_ids[3]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+0]+1;
-			tria_node_ids[4]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+1]+1;
-			tria_node_ids[5]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+2]+1;
-			tria_node_ids[6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+index+1;
+			tria_node_ids[0]=iomodel->elements[3*index+0];
+			tria_node_ids[1]=iomodel->elements[3*index+1];
+			tria_node_ids[2]=iomodel->elements[3*index+2];
+			tria_node_ids[3]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+0]+1;
+			tria_node_ids[4]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+1]+1;
+			tria_node_ids[5]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+2]+1;
+			tria_node_ids[6]=iomodel->numberofvertices+iomodel->numberofedges+index+1;
 			break;
 		default:
@@ -3875,5 +4588,5 @@
 void       Tria::UpdateConstraintsExtrudeFromBase(void){/*{{{*/
 
-	if(!HasEdgeOnBase()) return;
+	if(!HasNodeOnBase()) return;
 
 	int        extrusioninput;
@@ -3899,22 +4612,23 @@
 void       Tria::UpdateConstraintsExtrudeFromTop(void){/*{{{*/
 
-	if(!HasEdgeOnSurface()) return;
-
-	int extrusioninput;
-	int indices[2];
-	IssmDouble value;
+	if(!HasNodeOnSurface()) return;
+
+	int        extrusioninput;
+	IssmDouble value,isonsurface;
 
 	this->parameters->FindParam(&extrusioninput,InputToExtrudeEnum);
 	Input* input = inputs->GetInput(extrusioninput); _assert_(input);
-	this->EdgeOnSurfaceIndices(&indices[0],&indices[1]);
+	Input* onsurf = inputs->GetInput(MeshVertexonsurfaceEnum); _assert_(onsurf);
 
 	GaussTria* gauss=new GaussTria();
-	for(int i=0;i<2;i++){
-		gauss->GaussNode(P1Enum,indices[i]);
-		input->GetInputValue(&value,gauss);
-		this->nodes[indices[i]]->ApplyConstraint(0,value);
+	for(int iv=0;iv<this->NumberofNodes(this->element_type);iv++){
+		gauss->GaussNode(this->element_type,iv);
+		onsurf->GetInputValue(&isonsurface,gauss);
+		if(isonsurface==1.){
+			input->GetInputValue(&value,gauss);
+			this->nodes[iv]->ApplyConstraint(0,value);
+		}
 	}
 	delete gauss;
-
 }
 /*}}}*/
@@ -3978,5 +4692,5 @@
 	int        *indices = NULL;
 	this->GetLevelsetIntersection(&indices, &numiceverts,&s[0],fieldenum,fieldvalue);
-	_assert_(numiceverts); 
+	_assert_(numiceverts);
 
 	/*3 Write coordinates*/
@@ -4076,14 +4790,14 @@
 
 	/*recover material parameters: */
-	lithosphere_shear_modulus=matpar->GetMaterialParameter(MaterialsLithosphereShearModulusEnum);
-	lithosphere_density=matpar->GetMaterialParameter(MaterialsLithosphereDensityEnum);
-	mantle_shear_modulus=matpar->GetMaterialParameter(MaterialsMantleShearModulusEnum);
-	mantle_density=matpar->GetMaterialParameter(MaterialsMantleDensityEnum);
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+	lithosphere_shear_modulus=FindParam(MaterialsLithosphereShearModulusEnum);
+	lithosphere_density=FindParam(MaterialsLithosphereDensityEnum);
+	mantle_shear_modulus=FindParam(MaterialsMantleShearModulusEnum);
+	mantle_density=FindParam(MaterialsMantleDensityEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
 
 	/*pull thickness averages: */
-	thickness_input=inputs->GetInput(ThicknessEnum); 
+	thickness_input=inputs->GetInput(ThicknessEnum);
 	if (!thickness_input)_error_("thickness input needed to compute gia deflection!");
-	thickness_input->GetInputUpToCurrentTimeAverages(&hes,&times,&numtimes,currenttime);
+	thickness_input->GetInputAveragesUpToCurrentTime(&hes,&times,&numtimes,currenttime);
 
 	/*recover mantle viscosity: */
@@ -4158,5 +4872,5 @@
 	IssmDouble area;
 	IssmDouble earth_radius = 6371012.0;	// Earth's radius [m]
-	IssmDouble I;		//ice/water loading 
+	IssmDouble I;		//ice/water loading
 	IssmDouble rho_ice, rho_earth;
 
@@ -4164,5 +4878,5 @@
 	IssmDouble* U_elastic_precomputed = NULL;
 	IssmDouble* H_elastic_precomputed = NULL;
-	int         M, hemi; 
+	int         M, hemi;
 
 	/*computation of Green functions:*/
@@ -4177,14 +4891,14 @@
 
 	/*Compute ice thickness change: */
-	Input*	deltathickness_input=inputs->GetInput(EsaDeltathicknessEnum); 
+	Input*	deltathickness_input=inputs->GetInput(EsaDeltathicknessEnum);
 	if (!deltathickness_input)_error_("delta thickness input needed to compute elastic adjustment!");
 	deltathickness_input->GetInputAverage(&I);
 
-	/*early return if we are not on the (ice) loading point: */ 
-	if(I==0) return; 
+	/*early return if we are not on the (ice) loading point: */
+	if(I==0) return;
 
 	/*recover material parameters: */
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_earth=matpar->GetMaterialParameter(MaterialsEarthDensityEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	rho_earth=FindParam(MaterialsEarthDensityEnum);
 
 	/*how many dofs are we working with here? */
@@ -4192,5 +4906,5 @@
 
 	/*which hemisphere? for north-south, east-west components*/
-	this->parameters->FindParam(&hemi,EsaHemisphereEnum); 
+	this->parameters->FindParam(&hemi,EsaHemisphereEnum);
 
 	/*compute area of element:*/
@@ -4198,5 +4912,5 @@
 
 	/*figure out gravity center of our element (Cartesian): */
-	IssmDouble x_element, y_element; 
+	IssmDouble x_element, y_element;
 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
 	x_element=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
@@ -4223,22 +4937,22 @@
 	IssmDouble* Y_values=xNewZeroInit<IssmDouble>(gsize);
 	IssmDouble dx, dy, dist, alpha, ang, ang2;
-	IssmDouble N_azim, E_azim, X_azim, Y_azim; 
+	IssmDouble N_azim, E_azim, X_azim, Y_azim;
 
 	for(int i=0;i<gsize;i++){
 
-		indices[i]=i; 
-
-		IssmDouble N_azim=0; 
+		indices[i]=i;
+
+		IssmDouble N_azim=0;
 		IssmDouble E_azim=0;
 
 		/*Compute alpha angle between centroid and current vertex: */
-		dx = x_element - xx[i];		dy = y_element - yy[i]; 
-		dist = sqrt(pow(dx,2)+pow(dy,2));						// distance between vertex and elemental centroid [m] 
-		alpha = dist*360.0/(2*PI*earth_radius) * PI/180.0;	// [in radians] 360 degree = 2*pi*earth_radius 
+		dx = x_element - xx[i];		dy = y_element - yy[i];
+		dist = sqrt(pow(dx,2)+pow(dy,2));						// distance between vertex and elemental centroid [m]
+		alpha = dist*360.0/(2*PI*earth_radius) * PI/180.0;	// [in radians] 360 degree = 2*pi*earth_radius
 
 		/*Compute azimuths, both north and east components: */
-		ang = PI/2 - atan2(dy,dx);		// this is bearing angle! 
-		Y_azim = cos(ang); 
-		X_azim = sin(ang); 
+		ang = PI/2 - atan2(dy,dx);		// this is bearing angle!
+		Y_azim = cos(ang);
+		X_azim = sin(ang);
 
 		/*Elastic component  (from Eq 17 in Adhikari et al, GMD 2015): */
@@ -4253,10 +4967,10 @@
 		X_values[i]+=3*rho_ice/rho_earth*area/(4*PI*pow(earth_radius,2))*I*X_elastic[i];
 
-		/*North-south, East-west components */ 
+		/*North-south, East-west components */
 		if (hemi == -1) {
-			ang2 = PI/2 - atan2(yy[i],xx[i]); 
-		} 
+			ang2 = PI/2 - atan2(yy[i],xx[i]);
+		}
 		else if (hemi == 1) {
-			ang2 = PI/2 - atan2(-yy[i],-xx[i]); 
+			ang2 = PI/2 - atan2(-yy[i],-xx[i]);
 		}
 		if (hemi != 0){
@@ -4277,5 +4991,5 @@
 
 	/*free ressources:*/
-	xDelete<int>(indices); 
+	xDelete<int>(indices);
 	xDelete<IssmDouble>(U_values); xDelete<IssmDouble>(N_values); xDelete<IssmDouble>(E_values);
 	xDelete<IssmDouble>(U_elastic); xDelete<IssmDouble>(N_elastic); xDelete<IssmDouble>(E_elastic);
@@ -4294,5 +5008,5 @@
 	IssmDouble xyz_list[NUMVERTICES][3];
 	IssmDouble area;
-	IssmDouble I;		//ice/water loading 
+	IssmDouble I;		//ice/water loading
 	IssmDouble late,longe,re;
 	IssmDouble lati,longi,ri;
@@ -4315,14 +5029,14 @@
 
 	/*Compute ice thickness change: */
-	Input*	deltathickness_input=inputs->GetInput(EsaDeltathicknessEnum); 
+	Input*	deltathickness_input=inputs->GetInput(EsaDeltathicknessEnum);
 	if (!deltathickness_input)_error_("delta thickness input needed to compute elastic adjustment!");
 	deltathickness_input->GetInputAverage(&I);
 
-	/*early return if we are not on the (ice) loading point: */ 
-	if(I==0) return; 
+	/*early return if we are not on the (ice) loading point: */
+	if(I==0) return;
 
 	/*recover material parameters: */
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_earth=matpar->GetMaterialParameter(MaterialsEarthDensityEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	rho_earth=FindParam(MaterialsEarthDensityEnum);
 
 	/*how many dofs are we working with here? */
@@ -4362,5 +5076,5 @@
 	longe=(llr_list[0][1]+llr_list[1][1]+llr_list[2][1])/3.0;
 
-	late=90-late; 
+	late=90-late;
 	if(longe>180)longe=(longe-180)-180;
 
@@ -4370,5 +5084,5 @@
 
 	/*figure out gravity center of our element (Cartesian): */
-	IssmDouble x_element, y_element, z_element; 
+	IssmDouble x_element, y_element, z_element;
 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
 	x_element=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
@@ -4393,10 +5107,10 @@
 	IssmDouble alpha;
 	IssmDouble delPhi,delLambda;
-	IssmDouble dx, dy, dz, x, y, z; 
+	IssmDouble dx, dy, dz, x, y, z;
 	IssmDouble N_azim, E_azim;
 
 	for(int i=0;i<gsize;i++){
 
-		indices[i]=i; 
+		indices[i]=i;
 
 		/*Compute alpha angle between centroid and current vertex: */
@@ -4407,12 +5121,12 @@
 
 		/*Compute azimuths, both north and east components: */
-		x = xx[i]; y = yy[i]; z = zz[i]; 
+		x = xx[i]; y = yy[i]; z = zz[i];
 		if(latitude[i]==90){
-			x=1e-12; y=1e-12; 
+			x=1e-12; y=1e-12;
 		}
 		if(latitude[i]==-90){
-			x=1e-12; y=1e-12; 
-		}
-		dx = x_element-x; dy = y_element-y; dz = z_element-z; 
+			x=1e-12; y=1e-12;
+		}
+		dx = x_element-x; dy = y_element-y; dz = z_element-z;
 		N_azim = (-z*x*dx-z*y*dy+(pow(x,2)+pow(y,2))*dz) /pow((pow(x,2)+pow(y,2))*(pow(x,2)+pow(y,2)+pow(z,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
 		E_azim = (-y*dx+x*dy) /pow((pow(x,2)+pow(y,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
@@ -4434,5 +5148,5 @@
 
 	/*free ressources:*/
-	xDelete<int>(indices); 
+	xDelete<int>(indices);
 	xDelete<IssmDouble>(U_values); xDelete<IssmDouble>(N_values); xDelete<IssmDouble>(E_values);
 	xDelete<IssmDouble>(U_elastic); xDelete<IssmDouble>(N_elastic); xDelete<IssmDouble>(E_elastic);
@@ -4472,12 +5186,12 @@
 	/*early return if we are not on an ice cap OR ocean:*/
 	if(!(this->inputs->Max(MaskIceLevelsetEnum)<0) && !IsWaterInElement()){
-		dI_list[0] = 0.0; // this is important!!! 
-		dI_list[1] = 0.0; // this is important!!! 
-		dI_list[2] = 0.0; // this is important!!! 
-		return; 
+		dI_list[0] = 0.0; // this is important!!!
+		dI_list[1] = 0.0; // this is important!!!
+		dI_list[2] = 0.0; // this is important!!!
+		return;
 	}
 
 	/*Compute area of element:*/
-	IssmDouble area; 
+	IssmDouble area;
 	area=GetAreaSpherical();
 
@@ -4516,5 +5230,5 @@
 	longe=(llr_list[0][1]+llr_list[1][1]+llr_list[2][1])/3.0;
 
-	late=90-late; 
+	late=90-late;
 	if(longe>180)longe=(longe-180)-180;
 
@@ -4525,38 +5239,38 @@
 
 	if(IsWaterInElement()){
-		IssmDouble rho_water, S; 
+		IssmDouble rho_water, S;
 
 		/*recover material parameters: */
-		rho_water=matpar->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
+		rho_water=FindParam(MaterialsRhoFreshwaterEnum);
 
 		/*From Sg_old, recover water sea level rise:*/
 		S=0; for(int i=0;i<NUMVERTICES;i++) S+=Sg_old[this->vertices[i]->Sid()]/NUMVERTICES;
 
-		/* Perturbation terms for moment of inertia (moi_list): 
-		 * computed analytically (see Wu & Peltier, eqs 10 & 32) 
+		/* Perturbation terms for moment of inertia (moi_list):
+		 * computed analytically (see Wu & Peltier, eqs 10 & 32)
 		 * also consistent with my GMD formulation!
-		 * ALL in geographic coordinates 
+		 * ALL in geographic coordinates
 		 * */
-		dI_list[0] = -4*PI*(rho_water*S*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/eartharea; 
-		dI_list[1] = -4*PI*(rho_water*S*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/eartharea; 
-		dI_list[2] = +4*PI*(rho_water*S*area)*pow(re,4)*(1-pow(sin(late),2))/eartharea; 
+		dI_list[0] = -4*PI*(rho_water*S*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/eartharea;
+		dI_list[1] = -4*PI*(rho_water*S*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/eartharea;
+		dI_list[2] = +4*PI*(rho_water*S*area)*pow(re,4)*(1-pow(sin(late),2))/eartharea;
 	}
 	else if(this->inputs->Max(MaskIceLevelsetEnum)<0){
-		IssmDouble rho_ice, I; 
+		IssmDouble rho_ice, I;
 
 		/*recover material parameters: */
-		rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+		rho_ice=FindParam(MaterialsRhoIceEnum);
 
 		/*Compute ice thickness change: */
-		Input*	deltathickness_input=inputs->GetInput(SealevelriseDeltathicknessEnum); 
+		Input*	deltathickness_input=inputs->GetInput(SealevelriseDeltathicknessEnum);
 		if (!deltathickness_input)_error_("delta thickness input needed to compute sea level rise!");
 		deltathickness_input->GetInputAverage(&I);
 
-		dI_list[0] = -4*PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/eartharea; 
-		dI_list[1] = -4*PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/eartharea; 
-		dI_list[2] = +4*PI*(rho_ice*I*area)*pow(re,4)*(1-pow(sin(late),2))/eartharea; 
-	}
-
-	return; 
+		dI_list[0] = -4*PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/eartharea;
+		dI_list[1] = -4*PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/eartharea;
+		dI_list[2] = +4*PI*(rho_ice*I*area)*pow(re,4)*(1-pow(sin(late),2))/eartharea;
+	}
+
+	return;
 }/*}}}*/
 void    Tria::SealevelriseEustatic(Vector<IssmDouble>* pSgi,IssmDouble* peustatic,IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble oceanarea,IssmDouble eartharea){ /*{{{*/
@@ -4614,7 +5328,7 @@
 
 	/*recover material parameters: */
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_water=matpar->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-	rho_earth=matpar->GetMaterialParameter(MaterialsEarthDensityEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	rho_water=FindParam(MaterialsRhoFreshwaterEnum);
+	rho_earth=FindParam(MaterialsEarthDensityEnum);
 
 	/*recover love numbers and computational flags: */
@@ -4625,5 +5339,5 @@
 	/*recover elastic green function:*/
 	if(computeelastic){
-		DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGElasticEnum)); 
+		DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGElasticEnum));
 		_assert_(parameter);
 		parameter->GetParameterValueByPointer(&G_elastic_precomputed,&M);
@@ -4665,5 +5379,5 @@
 	longe=(llr_list[0][1]+llr_list[1][1]+llr_list[2][1])/3.0;
 
-	late=90-late; 
+	late=90-late;
 	if(longe>180)longe=(longe-180)-180;
 
@@ -4684,10 +5398,10 @@
 
 	/*Compute ice thickness change: */
-	Input*	deltathickness_input=inputs->GetInput(SealevelriseDeltathicknessEnum); 
+	Input*	deltathickness_input=inputs->GetInput(SealevelriseDeltathicknessEnum);
 	if (!deltathickness_input)_error_("delta thickness input needed to compute sea level rise!");
 
 	/*If we are fully grounded, take the average over the element: */
 	if(!notfullygrounded)deltathickness_input->GetInputAverage(&I);
-	else{ 
+	else{
 		IssmDouble total_weight=0;
 		bool mainlyfloating = true;
@@ -4715,6 +5429,6 @@
 	/*Compute eustatic compoent:*/
 	_assert_(oceanarea>0.);
-	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2 
-	eustatic += rho_ice*area*I/(oceanarea*rho_water); 
+	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
+	eustatic += rho_ice*area*I/(oceanarea*rho_water);
 
 	if(computeelastic | computerigid){
@@ -4808,6 +5522,6 @@
 
 	/*recover material parameters: */
-	rho_water=matpar->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-	rho_earth=matpar->GetMaterialParameter(MaterialsEarthDensityEnum);
+	rho_water=FindParam(MaterialsRhoFreshwaterEnum);
+	rho_earth=FindParam(MaterialsEarthDensityEnum);
 
 	/*how many dofs are we working with here? */
@@ -4849,5 +5563,5 @@
 	longe=(llr_list[0][1]+llr_list[1][1]+llr_list[2][1])/3.0;
 
-	late=90-late; 
+	late=90-late;
 	if(longe>180)longe=(longe-180)-180;
 
@@ -4874,5 +5588,5 @@
 	for(int i=0;i<gsize;i++){
 
-		indices[i]=i; 
+		indices[i]=i;
 
 		/*Compute alpha angle between centroid and current vertex : */
@@ -4883,6 +5597,6 @@
 
 		/*Rigid earth gravitational perturbation: */
-		if(computerigid){ 
-			G_rigid[i]=1.0/2.0/sin(alpha/2.0); 
+		if(computerigid){
+			G_rigid[i]=1.0/2.0/sin(alpha/2.0);
 			values[i]+=3*rho_water/rho_earth*area/eartharea*S*G_rigid[i];
 		}
@@ -4947,5 +5661,5 @@
 
 	/*early return if we are not on the ocean or on an ice cap:*/
-	if(!(this->inputs->Max(MaskIceLevelsetEnum)<0) && !IsWaterInElement()) return; 
+	if(!(this->inputs->Max(MaskIceLevelsetEnum)<0) && !IsWaterInElement()) return;
 
 	/*early return if we are fully floating: */
@@ -4960,7 +5674,7 @@
 
 	/*recover material parameters: */
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_water=matpar->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-	rho_earth=matpar->GetMaterialParameter(MaterialsEarthDensityEnum);
+	rho_ice=FindParam(MaterialsRhoIceEnum);
+	rho_water=FindParam(MaterialsRhoFreshwaterEnum);
+	rho_earth=FindParam(MaterialsEarthDensityEnum);
 
 	/*how many dofs are we working with here? */
@@ -5000,5 +5714,5 @@
 	longe=(llr_list[0][1]+llr_list[1][1]+llr_list[2][1])/3.0;
 
-	late=90-late; 
+	late=90-late;
 	if(longe>180)longe=(longe-180)-180;
 
@@ -5008,5 +5722,5 @@
 
 	/*figure out gravity center of our element (Cartesian): */
-	IssmDouble x_element, y_element, z_element; 
+	IssmDouble x_element, y_element, z_element;
 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
 	x_element=(xyz_list[0][0]+xyz_list[1][0]+xyz_list[2][0])/3.0;
@@ -5026,5 +5740,5 @@
 
 	/*Compute ice thickness change: */
-	Input*	deltathickness_input=inputs->GetInput(SealevelriseDeltathicknessEnum); 
+	Input*	deltathickness_input=inputs->GetInput(SealevelriseDeltathicknessEnum);
 	if (!deltathickness_input)_error_("delta thickness input needed to compute sea level rise!");
 	deltathickness_input->GetInputAverage(&I);
@@ -5040,15 +5754,15 @@
 	U_values=xNewZeroInit<IssmDouble>(gsize);
 	if(horiz){
-		N_values=xNewZeroInit<IssmDouble>(gsize); 
+		N_values=xNewZeroInit<IssmDouble>(gsize);
 		E_values=xNewZeroInit<IssmDouble>(gsize);
 	}
 	IssmDouble alpha;
 	IssmDouble delPhi,delLambda;
-	IssmDouble dx, dy, dz, x, y, z; 
+	IssmDouble dx, dy, dz, x, y, z;
 	IssmDouble N_azim, E_azim;
 
 	for(int i=0;i<gsize;i++){
 
-		indices[i]=i; 
+		indices[i]=i;
 
 		/*Compute alpha angle between centroid and current vertex: */
@@ -5059,12 +5773,12 @@
 
 		/*Compute azimuths, both north and east components: */
-		x = xx[i]; y = yy[i]; z = zz[i]; 
+		x = xx[i]; y = yy[i]; z = zz[i];
 		if(latitude[i]==90){
-			x=1e-12; y=1e-12; 
+			x=1e-12; y=1e-12;
 		}
 		if(latitude[i]==-90){
-			x=1e-12; y=1e-12; 
-		}
-		dx = x_element-x; dy = y_element-y; dz = z_element-z; 
+			x=1e-12; y=1e-12;
+		}
+		dx = x_element-x; dy = y_element-y; dz = z_element-z;
 		if(horiz){
 			N_azim = (-z*x*dx-z*y*dy+(pow(x,2)+pow(y,2))*dz) /pow((pow(x,2)+pow(y,2))*(pow(x,2)+pow(y,2)+pow(z,2))*(pow(dx,2)+pow(dy,2)+pow(dz,2)),0.5);
@@ -5103,7 +5817,7 @@
 
 	/*free ressources:*/
-	xDelete<int>(indices); 
-	xDelete<IssmDouble>(U_values); 
-	xDelete<IssmDouble>(U_elastic); 
+	xDelete<int>(indices);
+	xDelete<IssmDouble>(U_values);
+	xDelete<IssmDouble>(U_elastic);
 	if(horiz){
 		xDelete<IssmDouble>(N_values); xDelete<IssmDouble>(E_values);
@@ -5123,4 +5837,5 @@
 	TransientInput *transientinput = NULL;
 	IssmDouble      values[3];
+	IssmDouble      value;
 
 	/*Check that name is an element input*/
@@ -5144,4 +5859,19 @@
 				if(t==0) transientinput=new TransientInput(name);
 				transientinput->AddTimeInput(new TriaInput(name,values,P1Enum),time);
+				transientinput->Configure(parameters);
+			}
+			this->inputs->AddInput(transientinput);
+			break;
+
+		case ElementEnum:
+			/*Get value for the element: */
+			for(t=0;t<ncols;t++){ //ncols is the number of times
+				value=matrix[ncols*(this->Sid())+t];
+
+				/*time:*/
+				time=matrix[(nrows-1)*ncols+t];
+
+				if(t==0) transientinput=new TransientInput(name);
+				transientinput->AddTimeInput(new TriaInput(name,&value,P0Enum),time);
 				transientinput->Configure(parameters);
 			}
@@ -5193,6 +5923,6 @@
 						/*hydrostatic equilibrium: */
 						IssmDouble rho_ice,rho_water,di;
-						rho_ice   = this->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-						rho_water = this->matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
+						rho_ice   = this->FindParam(MaterialsRhoIceEnum);
+						rho_water = this->FindParam(MaterialsRhoSeawaterEnum);
 						di        = rho_ice/rho_water;
 
@@ -5240,4 +5970,10 @@
 			break;
 
+		case ElementEnum:
+			IssmDouble value;
+			/*Get value for the element: */
+			value=vector[this->Sid()]; //careful, vector of values here is not parallel distributed, but serial distributed (from a serial Dakota core!)
+			this->inputs->AddInput(new TriaInput(name,&value,P0Enum));
+			break;
 		default:
 			_error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
Index: /issm/trunk/src/c/classes/Elements/Tria.h
===================================================================
--- /issm/trunk/src/c/classes/Elements/Tria.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Elements/Tria.h	(revision 24313)
@@ -17,5 +17,4 @@
 class Node;
 class Material;
-class Matpar;
 class Seg;
 class ElementMatrix;
@@ -55,6 +54,8 @@
 		void        CalvingCrevasseDepth();
 		void			CalvingRateLevermann();
+		void			CalvingFluxLevelset();
+		void			CalvingMeltingFluxLevelset();
 		IssmDouble  CharacteristicLength(void);
-		void        ComputeBasalStress(Vector<IssmDouble>* sigma_b);
+		void        ComputeBasalStress(void);
 		void        ComputeDeviatoricStressTensor();
 		void        ComputeEsaStrainAndVorticity();
@@ -80,7 +81,8 @@
 		void        GetGroundedPart(int* point1,IssmDouble* fraction1, IssmDouble* fraction2,bool* mainlyfloating);
 		IssmDouble  GetGroundedPortion(IssmDouble* xyz_list);
+		IssmDouble  GetIcefrontArea();
 		void	      GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum);
 		void	      GetLevelCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum,IssmDouble level);
-		int         GetNodeIndex(Node* node);
+		int         GetVertexIndex(Vertex* vertex);
 		int         GetNumberOfNodes(void);
 		int         GetNumberOfNodes(int enum_type);
@@ -95,4 +97,7 @@
 		IssmDouble  IceVolume(bool scaled);
 		IssmDouble  IceVolumeAboveFloatation(bool scaled);
+		IssmDouble  IcefrontMassFlux(bool scaled);
+		IssmDouble  IcefrontMassFluxLevelset(bool scaled);
+		IssmDouble  GroundinglineMassFlux(bool scaled);
 		void        InputDepthAverageAtBase(int enum_type,int average_enum_type);
 		void        InputExtrude(int enum_type,int start){_error_("not implemented"); /*For penta only*/};
@@ -112,7 +117,4 @@
 		int         NumberofNodesPressure(void);
 		int         NumberofNodesVelocity(void);
-		void        PicoUpdateBoxid(int* pmax_boxid_basin);
-		void        PicoUpdateBox(int loopboxid);
-		void        PicoComputeBasalMelt(void);
 		void        PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding);
 		int         PressureInterpolation();
@@ -121,4 +123,5 @@
 		void        ResetHooks();
 		void        ResetLevelsetFromSegmentlist(IssmDouble* segments,int numsegments);
+		void        RignotMeltParameterization();
 		void        SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index,int offset,int N,int M);
 		void        SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
@@ -132,4 +135,6 @@
 		int         TensorInterpolation();
 		IssmDouble  TimeAdapt();
+		IssmDouble  TotalCalvingFluxLevelset(bool scaled);
+		IssmDouble  TotalCalvingMeltingFluxLevelset(bool scaled);
 		IssmDouble  TotalFloatingBmb(bool scaled);
 		IssmDouble  TotalGroundedBmb(bool scaled);
@@ -174,7 +179,7 @@
 		int            GetElementType(void);
 		void           GetInputValue(IssmDouble* pvalue,Node* node,int enumtype);
-		void		GetLevelsetIntersection(int** pindices, int* pnumiceverts, IssmDouble* fraction, int levelset_enum, IssmDouble level);
+		void           GetInputValue(IssmDouble* pvalue,Vertex* vertex,int enumtype);
+		void		      GetLevelsetIntersection(int** pindices, int* pnumiceverts, IssmDouble* fraction, int levelset_enum, IssmDouble level);
 		void           GetMaterialInputValue(IssmDouble* pvalue,Node* node,int enumtype);
-		Node*          GetNode(int node_number);
 		void	         InputUpdateFromSolutionOneDof(IssmDouble* solution,int enum_type);
 		void	         InputUpdateFromSolutionOneDofCollapsed(IssmDouble* solution,int enum_type){_error_("not implemented yet");};
@@ -207,8 +212,8 @@
 		void           NormalSection(IssmDouble* normal,IssmDouble* xyz_list);
 		void           NormalTop(IssmDouble* normal,IssmDouble* xyz_list);
-		void	         SetClone(int* minranks);
 		void           SetTemporaryElementType(int element_type_in){_error_("not implemented yet");};
 		Seg*	         SpawnSeg(int index1,int index2);
 		IssmDouble     StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){_error_("not implemented yet");};
+		void           StabilizationParameterAnisotropic(IssmDouble* tau_parameter_ansiotropic, IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble hx, IssmDouble hy, IssmDouble hz, IssmDouble kappa){_error_("not implemented yet");};
 		void           UpdateConstraintsExtrudeFromBase(void);
 		void           UpdateConstraintsExtrudeFromTop(void);
Index: /issm/trunk/src/c/classes/Elements/TriaRef.cpp
===================================================================
--- /issm/trunk/src/c/classes/Elements/TriaRef.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Elements/TriaRef.cpp	(revision 24313)
@@ -33,5 +33,5 @@
 /*Reference Element numerics*/
 void TriaRef::GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, Gauss* gauss,int finiteelement){/*{{{*/
-	/*From node values of parameter p (plist[0],plist[1],plist[2]), return parameter derivative value at gaussian 
+	/*From node values of parameter p (plist[0],plist[1],plist[2]), return parameter derivative value at gaussian
 	 * point specified by gauss_basis:
 	 *   dp/dx=plist[0]*dh1/dx+plist[1]*dh2/dx+plist[2]*dh3/dx
@@ -89,5 +89,5 @@
 /*}}}*/
 void TriaRef::GetJacobian(IssmDouble* J, IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
-	/*The Jacobian is constant over the element, discard the gaussian points. 
+	/*The Jacobian is constant over the element, discard the gaussian points.
 	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
 
@@ -106,5 +106,5 @@
 /*}}}*/
 void TriaRef::GetJacobianDeterminant(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
-	/*The Jacobian determinant is constant over the element, discard the gaussian points. 
+	/*The Jacobian determinant is constant over the element, discard the gaussian points.
 	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
 	IssmDouble J[2][2];
@@ -120,5 +120,5 @@
 /*}}}*/
 void TriaRef::GetJacobianDeterminant3D(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
-	/*The Jacobian determinant is constant over the element, discard the gaussian points. 
+	/*The Jacobian determinant is constant over the element, discard the gaussian points.
 	 * J is assumed to have been allocated of size NDOF2xNDOF2.*/
 	IssmDouble J[2][2];
@@ -157,5 +157,5 @@
 		case NoneEnum:
 			return;
-		case P0Enum:
+		case P0Enum: case P0DGEnum:
 			basis[0]=1.;
 			return;
@@ -202,5 +202,5 @@
 void TriaRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss,int finiteelement){/*{{{*/
 
-	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+	/*This routine returns the values of the nodal functions derivatives  (with respect to the
 	 * actual coordinate system): */
 	IssmDouble    Jinv[2][2];
@@ -211,10 +211,10 @@
 	/*Get nodal functions derivatives in reference triangle*/
 	IssmDouble dbasis_ref[2*NUMNODESMAX];
-	GetNodalFunctionsDerivativesReference(dbasis_ref,gauss,finiteelement); 
+	GetNodalFunctionsDerivativesReference(dbasis_ref,gauss,finiteelement);
 
 	/*Get Jacobian invert: */
 	GetJacobianInvert(&Jinv[0][0], xyz_list, gauss);
 
-	/*Build dbasis: 
+	/*Build dbasis:
 	 * [dhi/dx]= Jinv*[dhi/dr]
 	 * [dhi/dy]       [dhi/ds]
@@ -227,56 +227,6 @@
 }
 /*}}}*/
-void TriaRef::GetSegmentBFlux(IssmDouble* B,Gauss* gauss, int index1,int index2,int finiteelement){/*{{{*/
-	/*Compute B  matrix. B=[phi1 phi2 -phi3 -phi4]
-	 *
-	 * and phi1=phi3 phi2=phi4
-	 *
-	 * We assume B has been allocated already, of size: 1x4
-	 */
-
-	/*Fetch number of nodes for this finite element*/
-	int numnodes = this->NumberofNodes(finiteelement);
-
-	/*Get nodal functions*/
-	IssmDouble* basis=xNew<IssmDouble>(numnodes);
-	GetNodalFunctions(basis,gauss,finiteelement);
-
-	/*Build B for this segment*/
-	B[0] = +basis[index1];
-	B[1] = +basis[index2];
-	B[2] = -basis[index1];
-	B[3] = -basis[index2];
-
-	/*Clean-up*/
-	xDelete<IssmDouble>(basis);
-}
-/*}}}*/
-void TriaRef::GetSegmentBprimeFlux(IssmDouble* Bprime,Gauss* gauss, int index1,int index2,int finiteelement){/*{{{*/
-	/*Compute Bprime  matrix. Bprime=[phi1 phi2 phi3 phi4]
-	 *
-	 * and phi1=phi3 phi2=phi4
-	 *
-	 * We assume Bprime has been allocated already, of size: 1x4
-	 */
-
-	/*Fetch number of nodes for this finite element*/
-	int numnodes = this->NumberofNodes(finiteelement);
-
-	/*Get nodal functions*/
-	IssmDouble* basis=xNew<IssmDouble>(numnodes);
-	GetNodalFunctions(basis,gauss,finiteelement);
-
-	/*Build B'*/
-	Bprime[0] = basis[index1];
-	Bprime[1] = basis[index2];
-	Bprime[2] = basis[index1];
-	Bprime[3] = basis[index2];
-
-	/*Clean-up*/
-	xDelete<IssmDouble>(basis);
-}
-/*}}}*/
 void TriaRef::GetSegmentJacobianDeterminant(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
-	/*The Jacobian determinant is constant over the element, discard the gaussian points. 
+	/*The Jacobian determinant is constant over the element, discard the gaussian points.
 	 * J is assumed to have been allocated*/
 
@@ -305,4 +255,8 @@
 
 	switch(finiteelement){
+		case P0Enum: case P0DGEnum:
+			basis[0]=triabasis[0];
+			xDelete<IssmDouble>(triabasis);
+			return;
 		case P1Enum: case P1DGEnum:
 			basis[0]=triabasis[index1];
@@ -330,6 +284,34 @@
 }
 /*}}}*/
+void TriaRef::GetSegmentNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list_tria,Gauss* gauss,int index1,int index2,int finiteelement){/*{{{*/
+	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+
+	_assert_(index1>=0 && index1<3);
+	_assert_(index2>=0 && index2<3);
+
+	/*Fetch number of nodes for this finite element*/
+	int numnodes = this->NumberofNodes(finiteelement);
+
+	/*Get nodal functions*/
+	IssmDouble* dtriabasis=xNew<IssmDouble>(2*numnodes);
+	GetNodalFunctionsDerivatives(dtriabasis,xyz_list_tria,gauss,finiteelement);
+
+	switch(finiteelement){
+		case P1Enum: case P1DGEnum:
+			dbasis[2*0+0] = dtriabasis[numnodes*0+index1];
+			dbasis[2*0+1] = dtriabasis[numnodes*1+index1];
+			dbasis[2*1+0] = dtriabasis[numnodes*0+index2];
+			dbasis[2*1+1] = dtriabasis[numnodes*1+index2];
+			break;
+		default:
+			_error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
+	}
+
+	/*Clean up*/
+	xDelete<IssmDouble>(dtriabasis);
+}
+/*}}}*/
 void TriaRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss_in,int finiteelement){/*{{{*/
-	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+	/*This routine returns the values of the nodal functions derivatives  (with respect to the
 	 * natural coordinate system) at the gaussian point. */
 
@@ -341,5 +323,5 @@
 
 	switch(finiteelement){
-		case P0Enum:
+		case P0Enum: case P0DGEnum:
 			/*Nodal function 1*/
 			dbasis[NUMNODESP0*0+0] = 0.;
@@ -484,4 +466,5 @@
 		case NoneEnum:                return 0;
 		case P0Enum:                  return NUMNODESP0;
+		case P0DGEnum:                return NUMNODESP0;
 		case P1Enum:                  return NUMNODESP1;
 		case P1DGEnum:                return NUMNODESP1;
Index: /issm/trunk/src/c/classes/Elements/TriaRef.h
===================================================================
--- /issm/trunk/src/c/classes/Elements/TriaRef.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Elements/TriaRef.h	(revision 24313)
@@ -25,8 +25,7 @@
 		void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss,int finiteelement);
 		void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss,int finiteelement);
-		void GetSegmentBFlux(IssmDouble* B,Gauss* gauss, int index1,int index2,int finiteelement);
-		void GetSegmentBprimeFlux(IssmDouble* Bprime,Gauss* gauss, int index1,int index2,int finiteelement);
 		void GetSegmentJacobianDeterminant(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss);
 		void GetSegmentNodalFunctions(IssmDouble* basis,Gauss* gauss, int index1,int index2,int finiteelement);
+		void GetSegmentNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list_tria,Gauss* gauss, int index1,int index2,int finiteelement);
 		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*do nothing */};
 		void NodeOnEdgeIndices(int* pnumindices,int** pindices,int index,int finiteelement);
Index: /issm/trunk/src/c/classes/ExternalResults/GenericExternalResult.h
===================================================================
--- /issm/trunk/src/c/classes/ExternalResults/GenericExternalResult.h	(revision 24312)
+++ /issm/trunk/src/c/classes/ExternalResults/GenericExternalResult.h	(revision 24313)
@@ -56,15 +56,22 @@
 
 			MARSHALLING_ENUM(this->ObjectEnum());
-
-			bool isnull=true;
-			if(marshall_direction==MARSHALLING_FORWARD || marshall_direction == MARSHALLING_SIZE) if(value) isnull=false;
-
 			MARSHALLING(id);
-			MARSHALLING(result_name);
-			MARSHALLING(isnull)
-			if (!isnull) MARSHALLING(value) else value=0;
 			MARSHALLING(step);
 			MARSHALLING(time);
 
+			/*Marshal result name*/
+			int size = 0;
+			if(marshall_direction==MARSHALLING_FORWARD || marshall_direction == MARSHALLING_SIZE) size=strlen(result_name)+1;
+			MARSHALLING(size);
+			MARSHALLING_DYNAMIC(result_name,char,size);
+
+			/*Marshall value*/
+			this->value=0;
+			bool isnull=true;
+			if(marshall_direction==MARSHALLING_FORWARD || marshall_direction == MARSHALLING_SIZE){
+				if(value) isnull=false;
+			}
+			MARSHALLING(isnull);
+			if(!isnull){MARSHALLING(value);}
 		}  /*}}}*/
 
@@ -77,8 +84,22 @@
 			step        = 0;
 			time        = 0;
-			value       = NULL;
+			value       = 0;
 		} /*}}}*/
 		GenericExternalResult(int in_id, int in_enum_type,ResultType in_values, int in_M,int in_N,int in_step,IssmDouble in_time){/*{{{*/
-			_error_("template GenericExternalResult(int in_id, int in_enum_type,double* in_values, int in_M,int in_N,int in_step,IssmDouble in_time) not implemented for this ResultType\n");
+			id        = in_id;
+			step      = in_step;
+			time      = in_time;
+			M         = in_M;
+			N         = in_N;
+
+			/*Copy result in values*/
+			if(M*N){
+				value=xNew<IssmDouble>(M*N);
+				xMemCpy<IssmDouble>(value,in_values,M*N);
+			}
+			else value=NULL;
+
+			/*Convert enum to name*/
+			EnumToStringx(&this->result_name,in_enum_type);
 		}
 /*}}}*/
@@ -719,9 +740,10 @@
 		}
 
-		/*Serialize vector*/
-		IssmPDouble* serialvalues = this->value->ToMPISerial();
-		this->value->GetSize(&rows);
+		/*Serialize vector on cpu0*/
+		IssmPDouble* serialvalues = this->value->ToMPISerial0();
 
 		if(IssmComm::GetRank()==0){
+			this->value->GetSize(&rows);
+
 			/*First write name: */
 			length=(strlen(this->result_name)+1)*sizeof(char);
@@ -770,12 +792,14 @@
 		}
 
-		/*Serialize vector*/
-		serialvalues = this->value->ToMPISerial();
-		this->value->GetSize(&rows);
-
-		pserialvalues=xNew<IssmPDouble>(rows);
-		for(i=0;i<rows;i++)pserialvalues[i]=reCast<IssmPDouble>(serialvalues[i]);
+		/*Serialize vector only on cpu0*/
+		serialvalues = this->value->ToMPISerial0();
 
 		if(IssmComm::GetRank()==0){
+
+			/*Make it passive*/
+			this->value->GetSize(&rows);
+			pserialvalues=xNew<IssmPDouble>(rows);
+			for(i=0;i<rows;i++)pserialvalues[i]=reCast<IssmPDouble>(serialvalues[i]);
+
 			/*First write name: */
 			length=(strlen(this->result_name)+1)*sizeof(char);
@@ -794,10 +818,11 @@
 			fwrite(&cols,sizeof(int),1,fid);
 			fwrite(pserialvalues,cols*rows*sizeof(IssmPDouble),1,fid);
+
+			/*Clean up*/
+			xDelete<IssmPDouble>(pserialvalues);
 		}
 
 		/*Clean up*/
-		xDelete<IssmPDouble>(pserialvalues);
 		xDelete<IssmDouble>(serialvalues);
-
 	}
 	/*}}}*/
Index: /issm/trunk/src/c/classes/FemModel.cpp
===================================================================
--- /issm/trunk/src/c/classes/FemModel.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/FemModel.cpp	(revision 24313)
@@ -25,5 +25,4 @@
 /*module includes: {{{*/
 #include "../modules/ModelProcessorx/ModelProcessorx.h"
-#include "../modules/VerticesDofx/VerticesDofx.h"
 #include "../modules/SpcNodesx/SpcNodesx.h"
 #include "../modules/ConfigureObjectsx/ConfigureObjectsx.h"
@@ -99,5 +98,6 @@
 		/*Verifications. AMR supports SSA, P1 and horizontal 2D domain*/
 		bool isSSA;
-		int domaintype,element_type,analysis_counter=-1;
+		int domaintype,element_type;
+		this->analysis_counter=-1;
 		this->parameters->FindParam(&isSSA,FlowequationIsSSAEnum);
 		this->parameters->FindParam(&domaintype,DomainTypeEnum);
@@ -181,8 +181,17 @@
 	if(lockfilename)xDelete<char>(lockfilename);
 	if(elements)delete elements;
-	if(nodes)delete nodes;
 	if(vertices)delete vertices;
-	if(constraints)delete constraints;
-	if(loads)delete loads;
+	if(this->constraints_list && this->nummodels){
+		for(int i=0;i<this->nummodels;i++) delete this->constraints_list[i];
+		xDelete<Constraints*>(constraints_list);
+	}
+	if(this->loads_list && this->nummodels){
+		for(int i=0;i<this->nummodels;i++) delete this->loads_list[i];
+		xDelete<Loads*>(loads_list);
+	}
+	if(this->nodes_list && this->nummodels){
+		for(int i=0;i<this->nummodels;i++) delete this->nodes_list[i];
+		xDelete<Nodes*>(nodes_list);
+	}
 	if(materials)delete materials;
 	if(parameters)delete parameters;
@@ -202,4 +211,22 @@
 
 /*Object management*/
+int FemModel::AnalysisIndex(int analysis_enum){/*{{{*/
+
+	/*Checks in debugging mode*/
+	_assert_(this->analysis_type_list);
+
+	/*Find analysis in list*/
+	for(int i=0;i<this->nummodels;i++){
+		if(this->analysis_type_list[i]==analysis_enum){
+			return i;
+			break;
+		}
+	}
+
+	/*If you reach this point, analysis has not been found*/
+	_error_("Could not find index of analysis " << EnumToStringx(analysis_enum) << " in list of FemModel analyses");
+
+
+}/*}}}*/
 void FemModel::CheckPoint(void){/*{{{*/
 
@@ -277,5 +304,5 @@
 	/*Finalize PETSC for this model: */
 	#ifdef _HAVE_PETSC_
-	_printf0_("closing PETSc\n");
+	//_printf0_("closing PETSc\n");
 	PetscFinalize();
 	#endif
@@ -300,13 +327,14 @@
 	xMemCpy<int>(output->analysis_type_list,this->analysis_type_list,this->nummodels);
 
+	/*Analysis dependent arrays*/
+	output->constraints_list=xNew<Constraints*>(this->nummodels);
+	output->loads_list=xNew<Loads*>(this->nummodels);
+	output->nodes_list=xNew<Nodes*>(this->nummodels);
+
 	output->profiler=static_cast<Profiler*>(this->profiler->copy());
 
-	output->loads=static_cast<Loads*>(this->loads->Copy());
 	output->materials=static_cast<Materials*>(this->materials->Copy());
 	output->parameters=static_cast<Parameters*>(this->parameters->Copy());
-	output->constraints=static_cast<Constraints*>(this->constraints->Copy());
 	output->results=static_cast<Results*>(this->results->Copy());
-
-	output->nodes=static_cast<Nodes*>(this->nodes->Copy());
 	output->vertices=static_cast<Vertices*>(this->vertices->Copy());
 	output->elements=static_cast<Elements*>(this->elements->Copy());
@@ -319,10 +347,12 @@
 	/*do the post-processing of the datasets to get an FemModel that can actually run analyses: */
 	for(i=0;i<nummodels;i++){
+		output->constraints_list[i] = static_cast<Constraints*>(this->constraints_list[i]->Copy());
+		output->loads_list[i] = static_cast<Loads*>(this->loads_list[i]->Copy());
+		output->nodes_list[i] = static_cast<Nodes*>(this->nodes_list[i]->Copy());
 		analysis_type=output->analysis_type_list[i];
 		output->SetCurrentConfiguration(analysis_type);
-		if(i==0) VerticesDofx(output->vertices,output->parameters); //only call once, we only have one set of vertices
-		SpcNodesx(output->nodes,output->constraints,output->parameters,analysis_type);
-		NodesDofx(output->nodes,output->parameters,analysis_type);
-		ConfigureObjectsx(output->elements,output->loads,output->nodes,output->vertices,output->materials,output->parameters);
+		SpcNodesx(output->nodes_list[i],output->constraints_list[i],output->parameters);
+		NodesDofx(output->nodes_list[i],output->parameters);
+		ConfigureObjectsx(output->elements,output->loads_list[i],output->nodes_list[i],output->vertices,output->materials,output->parameters);
 	}
 
@@ -388,5 +418,5 @@
 	/*Initialize internal data: */
 	this->solution_type    = in_solution_type;
-	this->analysis_counter = nummodels-1;   //point to last analysis_type carried out.
+	this->analysis_counter = -1;
 	this->results          = new Results(); //not initialized by CreateDataSets
 
@@ -398,5 +428,5 @@
 
 	/*create datasets for all analyses*/
-	ModelProcessorx(&this->elements,&this->nodes,&this->vertices,&this->materials,&this->constraints,&this->loads,&this->parameters,iomodel,toolkitsoptionsfid,rootpath,this->solution_type,this->nummodels,this->analysis_type_list);
+	ModelProcessorx(&this->elements,&this->nodes_list,&this->vertices,&this->materials,&this->constraints_list,&this->loads_list,&this->parameters,iomodel,toolkitsoptionsfid,rootpath,this->solution_type,this->nummodels,this->analysis_type_list);
 
 	/*do the post-processing of the datasets to get an FemModel that can actually run analyses: */
@@ -407,10 +437,7 @@
 
 		if(VerboseMProcessor()) _printf0_("      configuring element and loads\n");
-		ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters);
+		ConfigureObjectsx(this->elements,this->loads,this->nodes,this->vertices,this->materials,this->parameters);
 
 		if(i==0){
-			if(VerboseMProcessor()) _printf0_("      creating vertex PIDs\n");
-			VerticesDofx(vertices,parameters);
-
 			if(VerboseMProcessor()) _printf0_("      detecting active vertices\n");
 			GetMaskOfIceVerticesLSMx0(this);
@@ -418,8 +445,8 @@
 
 		if(VerboseMProcessor()) _printf0_("      resolving node constraints\n");
-		SpcNodesx(nodes,constraints,parameters,analysis_type_list[i]);
+		SpcNodesx(nodes,this->constraints,parameters);
 
 		if(VerboseMProcessor()) _printf0_("      creating nodal degrees of freedom\n");
-		NodesDofx(nodes,parameters,analysis_type_list[i]);
+		NodesDofx(nodes,parameters);
 	}
 
@@ -433,18 +460,25 @@
 
 	if(marshall_direction==MARSHALLING_BACKWARD){
-		delete this->loads;
 		delete this->materials;
 		delete this->parameters;
-		delete this->constraints;
+		if(this->constraints_list && this->nummodels){
+			for(i=0;i<this->nummodels;i++) delete this->constraints_list[i];
+			xDelete<Constraints*>(constraints_list);
+		}
+		if(this->loads_list && this->nummodels){
+			for(i=0;i<this->nummodels;i++) delete this->loads_list[i];
+			xDelete<Loads*>(loads_list);
+		}
+		if(this->nodes_list && this->nummodels){
+			for(i=0;i<this->nummodels;i++) delete this->nodes_list[i];
+			xDelete<Nodes*>(nodes_list);
+		}
 		delete this->results;
-		delete this->nodes;
 		delete this->vertices;
 		delete this->elements;
 		xDelete<int>(this->analysis_type_list);
 
-		this->loads       = new Loads();
 		this->materials   = new Materials();
 		this->parameters  = new Parameters();
-		this->constraints = new Constraints();
 		this->results     = new Results();
 		this->nodes       = new Nodes();
@@ -460,27 +494,38 @@
 	MARSHALLING_DYNAMIC(analysis_type_list,int,nummodels);
 
-	this->loads->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	this->materials->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	this->parameters->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	this->constraints->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	this->results->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	this->nodes->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	this->vertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	this->elements->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+
+	if(marshall_direction==MARSHALLING_BACKWARD){
+		this->constraints_list = xNew<Constraints*>(this->nummodels);
+		for(i=0;i<nummodels;i++) this->constraints_list[i] = new Constraints();
+		this->loads_list = xNew<Loads*>(this->nummodels);
+		for(i=0;i<nummodels;i++) this->loads_list[i] = new Loads();
+		this->nodes_list = xNew<Nodes*>(this->nummodels);
+		for(i=0;i<nummodels;i++) this->nodes_list[i] = new Nodes();
+	}
+
+	for(i=0;i<nummodels;i++){
+		this->constraints_list[i]->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+		this->loads_list[i]->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+		this->nodes_list[i]->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	}
 
 	if(marshall_direction==MARSHALLING_BACKWARD){
 		/*reset hooks for elements, loads and nodes:*/
 		this->elements->ResetHooks();
-		this->loads->ResetHooks();
 		this->materials->ResetHooks();
 
 		/*do the post-processing of the datasets to get an FemModel that can actually run analyses:*/
 		for(i=0;i<nummodels;i++){
+			this->loads_list[i]->ResetHooks();
 			analysis_type=this->analysis_type_list[i];
 			SetCurrentConfiguration(analysis_type);
-			if(i==0) VerticesDofx(this->vertices,this->parameters); //only call once, we only have one set of vertices
-			SpcNodesx(this->nodes,this->constraints,this->parameters,analysis_type);
-			NodesDofx(this->nodes,this->parameters,analysis_type);
-			ConfigureObjectsx(this->elements,this->loads,this->nodes,this->vertices,this->materials,this->parameters);
+			SpcNodesx(this->nodes_list[i],this->constraints_list[i],this->parameters);
+			NodesDofx(this->nodes_list[i],this->parameters);
+			ConfigureObjectsx(this->elements,this->loads_list[i],this->nodes_list[i],this->vertices,this->materials,this->parameters);
 		}
 
@@ -489,5 +534,4 @@
 		SetCurrentConfiguration(analysis_type);
 	}
-
 }
 /*}}}*/
@@ -552,13 +596,9 @@
 	 * analyses. For example: do a SurfaceSlopeX, SurfaceSlopeY, BedSlopeX and BedSlopeY analysis using the
 	 * Slope configuration.*/
-	int found=-1;
-	for(int i=0;i<nummodels;i++){
-		if (analysis_type_list[i]==configuration_type){
-			found=i;
-			break;
-		}
-	}
-	if(found!=-1) analysis_counter=found;
-	else _error_("Could not find alias for analysis_type " << EnumToStringx(configuration_type) << " in list of FemModel analyses");
+	int index = AnalysisIndex(configuration_type);
+
+	/*If we already have the right analysis, return*/
+	//if(this->analysis_counter==index) return;
+	this->analysis_counter=index;
 
 	/*Now, plug analysis_counter and analysis_type inside the parameters: */
@@ -568,6 +608,9 @@
 
 	/*configure elements, loads and nodes, for this new analysis: */
+	this->loads = this->loads_list[this->analysis_counter];
+	this->constraints = this->constraints_list[this->analysis_counter];
+	this->nodes = this->nodes_list[this->analysis_counter];
+	this->loads->SetCurrentConfiguration(elements, loads, nodes,vertices, materials,parameters);
 	this->elements->SetCurrentConfiguration(elements,loads, nodes,vertices, materials,parameters);
-	this->loads->SetCurrentConfiguration(elements, loads, nodes,vertices, materials,parameters);
 
 	/*take care of toolkits options, that depend on this analysis type (present only after model processor)*/
@@ -780,4 +823,5 @@
 			if(ishydrology){
 				analyses_temp[numanalyses++]=HydrologyShreveAnalysisEnum;
+				analyses_temp[numanalyses++]=HydrologyGlaDSAnalysisEnum;
 				analyses_temp[numanalyses++]=HydrologyShaktiAnalysisEnum;
 				analyses_temp[numanalyses++]=HydrologyPismAnalysisEnum;
@@ -880,5 +924,6 @@
 		if(profiler->Used(ESACORE)) _printf0_("   "<<setw(40)<<left<<"ESA core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(ESACORE) << " sec\n");
 		if(profiler->Used(SLRCORE)) _printf0_("   "<<setw(40)<<left<<"SLR core elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(SLRCORE) << " sec\n");
-		
+		if(profiler->Used(MPISERIAL)) _printf0_("   "<<setw(40)<<left<<"MPISERIAL elapsed time:"<<setw(7)<<setprecision(6)<<profiler->TotalTime(MPISERIAL) << " sec\n");
+
 		/*Add to results: */
 		results->AddObject(new GenericExternalResult<IssmDouble>(results->Size()+1, ProfilingSolutionTimeEnum,  solution_time));
@@ -984,4 +1029,20 @@
 		Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
 		element->CalvingRateLevermann();
+	}
+}
+/*}}}*/
+void FemModel::CalvingFluxLevelsetx(){/*{{{*/
+
+	for(int i=0;i<elements->Size();i++){
+		Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
+		element->CalvingFluxLevelset();
+	}
+}
+/*}}}*/
+void FemModel::CalvingMeltingFluxLevelsetx(){/*{{{*/
+
+	for(int i=0;i<elements->Size();i++){
+		Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
+		element->CalvingMeltingFluxLevelset();
 	}
 }
@@ -1138,5 +1199,5 @@
 
 		/*Update signed distance*/
-		_assert_(vertex->lid<vertices->Size()); 
+		_assert_(vertex->lid<vertices->Size());
 		distances[vertex->lid] = sqrt(dmin);
 	}
@@ -1235,10 +1296,6 @@
 void FemModel::GetInputLocalMinMaxOnNodesx(IssmDouble** pmin,IssmDouble** pmax,IssmDouble* ug){/*{{{*/
 
-	/*Get vector sizes for current configuration*/
-	int configuration_type;
-	this->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
-	int numnodes = this->nodes->NumberOfNodes(configuration_type);
-
 	/*Initialize output vectors*/
+	int numnodes = this->nodes->NumberOfNodes();
 	IssmDouble* uLmin_local = xNew<IssmDouble>(numnodes);
 	IssmDouble* uLmax_local = xNew<IssmDouble>(numnodes);
@@ -1266,4 +1323,197 @@
 
 }/*}}}*/
+void FemModel::GetLocalVectorWithClonesGset(IssmDouble** plocal_ug,Vector<IssmDouble> *ug){/*{{{*/
+
+	this->nodes->GetLocalVectorWithClonesGset(plocal_ug,ug);
+
+}/*}}}*/
+void FemModel::GetLocalVectorWithClonesVertices(IssmDouble** plocal_vector,Vector<IssmDouble> *vector){/*{{{*/
+
+	/*retrieve vertex info*/
+	int localsize         = this->vertices->NumberOfVerticesLocalAll();
+	int localsize_masters = this->vertices->NumberOfVerticesLocal();
+
+	/*Get local vector of vector*/
+	int        *indices_vector_masters = NULL;
+	IssmDouble *local_vector_masters   = NULL;
+	vector->GetLocalVector(&local_vector_masters,&indices_vector_masters);
+	_assert_(localsize_masters==indices_vector_masters[localsize_masters-1] - indices_vector_masters[0]+1);
+	xDelete<int>(indices_vector_masters);
+
+	/*Now, extend vectors to account for clones (make vectors longer, for clones at the end)*/
+	IssmDouble *local_vector  = xNew<IssmDouble>(localsize);
+	xMemCpy<IssmDouble>(local_vector,local_vector_masters,localsize_masters);
+	xDelete<IssmDouble>(local_vector_masters);
+
+	/*Now send and receive vector for vertices on partition edge*/
+	SyncLocalVectorWithClonesVertices(local_vector);
+
+	/*Assign output pointer*/
+	*plocal_vector = local_vector;
+}/*}}}*/
+void FemModel::SyncLocalVectorWithClonesVertices(IssmDouble* local_vector){/*{{{*/
+
+	/*recover my_rank:*/
+	ISSM_MPI_Status status;
+	int my_rank   = IssmComm::GetRank();
+	int num_procs = IssmComm::GetSize();
+
+	/*Now send and receive vector for vertices on partition edge*/
+	#ifdef _HAVE_AD_
+	IssmDouble* buffer = xNew<IssmDouble>(this->vertices->Size(),"t"); //only one alloc, "t" is required by adolc
+	#else
+	IssmDouble* buffer = xNew<IssmDouble>(this->vertices->Size());
+	#endif
+	for(int rank=0;rank<num_procs;rank++){
+		if(this->vertices->common_send[rank]){
+			int  numids = this->vertices->common_send[rank];
+			for(int i=0;i<numids;i++){
+				int   master_lid = this->vertices->common_send_ids[rank][i];
+				Vertex* vertex=xDynamicCast<Vertex*>(this->vertices->GetObjectByOffset(master_lid));
+				_assert_(!vertex->clone);
+				buffer[i] = local_vector[vertex->lid];
+			}
+			ISSM_MPI_Send(buffer,numids,ISSM_MPI_DOUBLE,rank,0,IssmComm::GetComm());
+		}
+	}
+	for(int rank=0;rank<num_procs;rank++){
+		if(this->vertices->common_recv[rank]){
+			int  numids = this->vertices->common_recv[rank];
+			ISSM_MPI_Recv(buffer,numids,ISSM_MPI_DOUBLE,rank,0,IssmComm::GetComm(),&status);
+			for(int i=0;i<numids;i++){
+				int   master_lid = this->vertices->common_recv_ids[rank][i];
+				Vertex* vertex=xDynamicCast<Vertex*>(this->vertices->GetObjectByOffset(master_lid));
+				_assert_(vertex->clone);
+				local_vector[vertex->lid] = buffer[i];
+			}
+		}
+	}
+	xDelete<IssmDouble>(buffer);
+}/*}}}*/
+void FemModel::SyncLocalVectorWithClonesVerticesAdd(IssmDouble* local_vector){/*{{{*/
+
+	/*recover my_rank:*/
+	ISSM_MPI_Status status;
+	int my_rank   = IssmComm::GetRank();
+	int num_procs = IssmComm::GetSize();
+
+	/*Now send and receive vector for vertices on partition edge*/
+	#ifdef _HAVE_AD_
+	IssmDouble* buffer = xNew<IssmDouble>(this->vertices->Size(),"t"); //only one alloc, "t" is required by adolc
+	#else
+	IssmDouble* buffer = xNew<IssmDouble>(this->vertices->Size());
+	#endif
+
+	/*1st: add slaves to master values (reverse of what we usually do)*/
+	for(int rank=0;rank<num_procs;rank++){
+		if(this->vertices->common_recv[rank]){
+			int  numids = this->vertices->common_recv[rank];
+			for(int i=0;i<numids;i++){
+				int   master_lid = this->vertices->common_recv_ids[rank][i];
+				Vertex* vertex=xDynamicCast<Vertex*>(this->vertices->GetObjectByOffset(master_lid));
+				_assert_(vertex->clone);
+				buffer[i] = local_vector[vertex->lid];
+			}
+			ISSM_MPI_Send(buffer,numids,ISSM_MPI_DOUBLE,rank,0,IssmComm::GetComm());
+		}
+	}
+	for(int rank=0;rank<num_procs;rank++){
+		if(this->vertices->common_send[rank]){
+			int  numids = this->vertices->common_send[rank];
+			ISSM_MPI_Recv(buffer,numids,ISSM_MPI_DOUBLE,rank,0,IssmComm::GetComm(),&status);
+			for(int i=0;i<numids;i++){
+				int   master_lid = this->vertices->common_send_ids[rank][i];
+				Vertex* vertex=xDynamicCast<Vertex*>(this->vertices->GetObjectByOffset(master_lid));
+				_assert_(!vertex->clone);
+				local_vector[vertex->lid] += buffer[i];
+			}
+		}
+	}
+
+	/*Now sync masters across partitions*/
+	for(int rank=0;rank<num_procs;rank++){
+		if(this->vertices->common_send[rank]){
+			int  numids = this->vertices->common_send[rank];
+			for(int i=0;i<numids;i++){
+				int   master_lid = this->vertices->common_send_ids[rank][i];
+				Vertex* vertex=xDynamicCast<Vertex*>(this->vertices->GetObjectByOffset(master_lid));
+				_assert_(!vertex->clone);
+				buffer[i] = local_vector[vertex->lid];
+			}
+			ISSM_MPI_Send(buffer,numids,ISSM_MPI_DOUBLE,rank,0,IssmComm::GetComm());
+		}
+	}
+	for(int rank=0;rank<num_procs;rank++){
+		if(this->vertices->common_recv[rank]){
+			int  numids = this->vertices->common_recv[rank];
+			ISSM_MPI_Recv(buffer,numids,ISSM_MPI_DOUBLE,rank,0,IssmComm::GetComm(),&status);
+			for(int i=0;i<numids;i++){
+				int   master_lid = this->vertices->common_recv_ids[rank][i];
+				Vertex* vertex=xDynamicCast<Vertex*>(this->vertices->GetObjectByOffset(master_lid));
+				_assert_(vertex->clone);
+				local_vector[vertex->lid] = buffer[i];
+			}
+		}
+	}
+	xDelete<IssmDouble>(buffer);
+}/*}}}*/
+void FemModel::GetLocalVectorWithClonesNodes(IssmDouble** plocal_vector,Vector<IssmDouble> *vector){/*{{{*/
+
+	/*recover my_rank:*/
+	ISSM_MPI_Status status;
+	int my_rank   = IssmComm::GetRank();
+	int num_procs = IssmComm::GetSize();
+
+	/*retrieve vertex info*/
+	int localsize         = this->nodes->NumberOfNodesLocalAll();
+	int localsize_masters = this->nodes->NumberOfNodesLocal();
+
+	/*Get local vector of vector*/
+	int        *indices_vector_masters = NULL;
+	IssmDouble *local_vector_masters   = NULL;
+	vector->GetLocalVector(&local_vector_masters,&indices_vector_masters);
+	_assert_(localsize_masters==indices_vector_masters[localsize_masters-1] - indices_vector_masters[0]+1);
+	xDelete<int>(indices_vector_masters);
+
+	/*Now, extend vectors to account for clones (make vectors longer, for clones at the end)*/
+	IssmDouble *local_vector  = xNew<IssmDouble>(localsize);
+	xMemCpy<IssmDouble>(local_vector,local_vector_masters,localsize_masters);
+	xDelete<IssmDouble>(local_vector_masters);
+
+	/*Now send and receive vector for nodes on partition edge*/
+	#ifdef _HAVE_AD_
+	IssmDouble* buffer = xNew<IssmDouble>(this->nodes->Size(),"t"); //only one alloc, "t" is required by adolc
+	#else
+	IssmDouble* buffer = xNew<IssmDouble>(this->nodes->Size());
+	#endif
+	for(int rank=0;rank<num_procs;rank++){
+		if(this->nodes->common_send[rank]){
+			int  numids = this->nodes->common_send[rank];
+			for(int i=0;i<numids;i++){
+				int   master_lid = this->nodes->common_send_ids[rank][i];
+				Node* vertex=xDynamicCast<Node*>(this->nodes->GetObjectByOffset(master_lid));
+				_assert_(!vertex->clone);
+				buffer[i] = local_vector[vertex->lid];
+			}
+			ISSM_MPI_Send(buffer,numids,ISSM_MPI_DOUBLE,rank,0,IssmComm::GetComm());
+		}
+	}
+	for(int rank=0;rank<num_procs;rank++){
+		if(this->nodes->common_recv[rank]){
+			int  numids = this->nodes->common_recv[rank];
+			ISSM_MPI_Recv(buffer,numids,ISSM_MPI_DOUBLE,rank,0,IssmComm::GetComm(),&status);
+			for(int i=0;i<numids;i++){
+				int   master_lid = this->nodes->common_recv_ids[rank][i];
+				Node* vertex=xDynamicCast<Node*>(this->nodes->GetObjectByOffset(master_lid));
+				_assert_(vertex->clone);
+				local_vector[vertex->lid] = buffer[i];
+			}
+		}
+	}
+	xDelete<IssmDouble>(buffer);
+
+	/*Assign output pointer*/
+	*plocal_vector = local_vector;
+}/*}}}*/
 void FemModel::GroundedAreax(IssmDouble* pV, bool scaled){/*{{{*/
 
@@ -1280,4 +1530,85 @@
 	/*Assign output pointers: */
 	*pV=total_grounded_area;
+
+}/*}}}*/
+void FemModel::IcefrontAreax(){/*{{{*/
+
+	int numvertices      = this->GetElementsWidth();
+	int numbasins;
+	IssmDouble* BasinId   = xNew<IssmDouble>(numvertices);
+	this->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
+	IssmDouble* basin_icefront_area           = xNewZeroInit<IssmDouble>(numbasins);
+
+	for(int basin=1;basin<numbasins+1;basin++){
+		IssmDouble local_icefront_area = 0;
+		IssmDouble total_icefront_area;
+
+		for(int i=0;i<this->elements->Size();i++){
+			Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
+			element->GetInputListOnVertices(BasinId,FrontalForcingsBasinIdEnum);
+			for(int j=0;j<numvertices;j++){
+				if(BasinId[j]==basin){
+					local_icefront_area+=element->GetIcefrontArea();
+					break;
+				}
+			}
+		}
+		ISSM_MPI_Reduce(&local_icefront_area,&total_icefront_area,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm());
+		ISSM_MPI_Bcast(&total_icefront_area,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+
+		basin_icefront_area[basin-1]=total_icefront_area;
+	}
+
+	this->parameters->AddObject(new DoubleVecParam(FrontalForcingsBasinIcefrontAreaEnum,basin_icefront_area,numbasins));
+
+	xDelete<IssmDouble>(basin_icefront_area);
+	xDelete<IssmDouble>(BasinId);
+}/*}}}*/
+void FemModel::IcefrontMassFluxx(IssmDouble* pM, bool scaled){/*{{{*/
+
+	IssmDouble local_mass_flux = 0;
+	IssmDouble total_mass_flux;
+
+	for(int i=0;i<this->elements->Size();i++){
+		Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
+		local_mass_flux+=element->IcefrontMassFlux(scaled);
+	}
+	ISSM_MPI_Reduce(&local_mass_flux,&total_mass_flux,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+	ISSM_MPI_Bcast(&total_mass_flux,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+
+	/*Assign output pointers: */
+	*pM=total_mass_flux;
+
+}/*}}}*/
+void FemModel::IcefrontMassFluxLevelsetx(IssmDouble* pM, bool scaled){/*{{{*/
+
+	IssmDouble local_mass_flux = 0;
+	IssmDouble total_mass_flux;
+
+	for(int i=0;i<this->elements->Size();i++){
+		Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
+		local_mass_flux+=element->IcefrontMassFluxLevelset(scaled);
+	}
+	ISSM_MPI_Reduce(&local_mass_flux,&total_mass_flux,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+	ISSM_MPI_Bcast(&total_mass_flux,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+
+	/*Assign output pointers: */
+	*pM=total_mass_flux;
+
+}/*}}}*/
+void FemModel::GroundinglineMassFluxx(IssmDouble* pM, bool scaled){/*{{{*/
+
+	IssmDouble local_mass_flux = 0;
+	IssmDouble total_mass_flux;
+
+	for(int i=0;i<this->elements->Size();i++){
+		Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
+		local_mass_flux+=element->GroundinglineMassFlux(scaled);
+	}
+	ISSM_MPI_Reduce(&local_mass_flux,&total_mass_flux,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+	ISSM_MPI_Bcast(&total_mass_flux,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+
+	/*Assign output pointers: */
+	*pM=total_mass_flux;
 
 }/*}}}*/
@@ -1887,8 +2218,9 @@
 	/*Intermediaries*/
 	bool        isvec,results_on_nodes;
-	int         step,output_enum;
+	int         step,output_enum,numonnodes;
 	IssmDouble  time;
 	IssmDouble  double_result;
 	const char *output_string = NULL;
+	char**      resultsonnodes = NULL;
 
 	/*recover results*/
@@ -1899,12 +2231,14 @@
 	parameters->FindParam(&step,StepEnum);
 	parameters->FindParam(&time,TimeEnum);
-	parameters->FindParam(&results_on_nodes,SettingsResultsOnNodesEnum);
+	parameters->FindParam(&numonnodes,SettingsNumResultsOnNodesEnum);
+	if(numonnodes) parameters->FindParam(&resultsonnodes,&numonnodes,SettingsResultsOnNodesEnum);
+
 
 	/*Go through all requested output*/
 	for(int i=0;i<numoutputs;i++){
-
 		output_string = requested_outputs[i];
 		output_enum   = StringToEnumx(output_string,false);
 		isvec         = false;
+
 
 		/*If string is not an enum, it is defined in output definitions*/
@@ -1932,4 +2266,6 @@
 					case MaxDivergenceEnum:                  this->MaxDivergencex(&double_result);                  break;
 					case IceMassEnum:                        this->IceMassx(&double_result,false);                  break;
+					case IcefrontMassFluxEnum:               this->IcefrontMassFluxx(&double_result,false);         break;
+					case IcefrontMassFluxLevelsetEnum:       this->IcefrontMassFluxLevelsetx(&double_result,false);         break;
 					case IceMassScaledEnum:                  this->IceMassx(&double_result,true);                   break;
 					case IceVolumeEnum:                      this->IceVolumex(&double_result,false);                break;
@@ -1939,4 +2275,5 @@
 					case GroundedAreaEnum:                   this->GroundedAreax(&double_result,false);             break;
 					case GroundedAreaScaledEnum:             this->GroundedAreax(&double_result,true);              break;
+					case GroundinglineMassFluxEnum:          this->GroundinglineMassFluxx(&double_result,false);    break;
 					case FloatingAreaEnum:                   this->FloatingAreax(&double_result,false);             break;
 					case FloatingAreaScaledEnum:             this->FloatingAreax(&double_result,true);              break;
@@ -1953,4 +2290,6 @@
 					case MaxAbsVzEnum:                       this->MaxAbsVzx(&double_result);                       break;
 					case MassFluxEnum:                       this->MassFluxx(&double_result);                       break;
+					case TotalCalvingFluxLevelsetEnum:		  this->TotalCalvingFluxLevelsetx(&double_result,false);          break;
+					case TotalCalvingMeltingFluxLevelsetEnum:this->TotalCalvingMeltingFluxLevelsetx(&double_result,false);          break;
 					case TotalFloatingBmbEnum:               this->TotalFloatingBmbx(&double_result,false);         break;
 					case TotalFloatingBmbScaledEnum:         this->TotalFloatingBmbx(&double_result,true);          break;
@@ -1960,27 +2299,63 @@
 					case TotalSmbScaledEnum:                 this->TotalSmbx(&double_result,true);                  break;
 
-			   /*Scalar control output*/
-				case SurfaceAbsVelMisfitEnum:       SurfaceAbsVelMisfitx(&double_result,elements,nodes,vertices,loads,materials,parameters);        break;
-				case SurfaceRelVelMisfitEnum:       SurfaceRelVelMisfitx(&double_result,elements,nodes,vertices,loads,materials,parameters);        break;
-				case SurfaceLogVelMisfitEnum:       SurfaceLogVelMisfitx(&double_result,elements,nodes,vertices,loads,materials,parameters);        break;
-				case SurfaceLogVxVyMisfitEnum:      SurfaceLogVxVyMisfitx(&double_result,elements,nodes,vertices,loads,materials,parameters);       break;
-				case SurfaceAverageVelMisfitEnum:   SurfaceAverageVelMisfitx(&double_result,this);                                                  break;
-				case ThicknessAbsMisfitEnum:        ThicknessAbsMisfitx(&double_result,elements,nodes,vertices,loads,materials,parameters);         break;
-				case ThicknessAbsGradientEnum:      this->ThicknessAbsGradientx(&double_result);                                                    break;
-				case ThicknessAlongGradientEnum:    ThicknessAlongGradientx(&double_result,elements,nodes,vertices,loads,materials,parameters);     break;
-				case ThicknessAcrossGradientEnum:   ThicknessAcrossGradientx(&double_result,elements,nodes,vertices,loads,materials,parameters);    break;
-				case ThicknessPositiveEnum:         this->ThicknessPositivex(&double_result);                                                       break;
-				case RheologyBbarAbsGradientEnum:   RheologyBbarAbsGradientx(&double_result,elements,nodes,vertices,loads,materials,parameters);    break;
-				case RheologyBAbsGradientEnum:      RheologyBAbsGradientx(&double_result,elements,nodes,vertices,loads,materials,parameters);       break;
-				case DragCoefficientAbsGradientEnum:DragCoefficientAbsGradientx(&double_result,elements,nodes,vertices,loads,materials,parameters); break;
-				case BalancethicknessMisfitEnum:    BalancethicknessMisfitx(&double_result);                                                        break;
-				case SurfaceAbsMisfitEnum:          SurfaceAbsMisfitx(&double_result); break;
-				case OmegaAbsGradientEnum:          OmegaAbsGradientx(&double_result); break;
-				case EtaDiffEnum:                   EtaDiffx(&double_result); break;
-
-				   /*Vector */
+					/*Scalar control output*/
+					case SurfaceAbsVelMisfitEnum:       SurfaceAbsVelMisfitx(&double_result,elements,nodes,vertices,loads,materials,parameters);        break;
+					case SurfaceRelVelMisfitEnum:       SurfaceRelVelMisfitx(&double_result,elements,nodes,vertices,loads,materials,parameters);        break;
+					case SurfaceLogVelMisfitEnum:       SurfaceLogVelMisfitx(&double_result,elements,nodes,vertices,loads,materials,parameters);        break;
+					case SurfaceLogVxVyMisfitEnum:      SurfaceLogVxVyMisfitx(&double_result,elements,nodes,vertices,loads,materials,parameters);       break;
+					case SurfaceAverageVelMisfitEnum:   SurfaceAverageVelMisfitx(&double_result,this);                                                  break;
+					case ThicknessAbsMisfitEnum:        ThicknessAbsMisfitx(&double_result,elements,nodes,vertices,loads,materials,parameters);         break;
+					case ThicknessAbsGradientEnum:      this->ThicknessAbsGradientx(&double_result);                                                    break;
+					case ThicknessAlongGradientEnum:    ThicknessAlongGradientx(&double_result,elements,nodes,vertices,loads,materials,parameters);     break;
+					case ThicknessAcrossGradientEnum:   ThicknessAcrossGradientx(&double_result,elements,nodes,vertices,loads,materials,parameters);    break;
+					case ThicknessPositiveEnum:         this->ThicknessPositivex(&double_result);                                                       break;
+					case RheologyBbarAbsGradientEnum:   RheologyBbarAbsGradientx(&double_result,elements,nodes,vertices,loads,materials,parameters);    break;
+					case RheologyBAbsGradientEnum:      RheologyBAbsGradientx(&double_result,elements,nodes,vertices,loads,materials,parameters);       break;
+					case RheologyBInitialguessMisfitEnum:  RheologyBInitialguessMisfitx(&double_result,elements,nodes,vertices,loads,materials,parameters);       break;
+					case DragCoefficientAbsGradientEnum:DragCoefficientAbsGradientx(&double_result,elements,nodes,vertices,loads,materials,parameters); break;
+					case BalancethicknessMisfitEnum:    BalancethicknessMisfitx(&double_result);                                                        break;
+					case SurfaceAbsMisfitEnum:          SurfaceAbsMisfitx(&double_result); break;
+					case OmegaAbsGradientEnum:          OmegaAbsGradientx(&double_result); break;
+					case EtaDiffEnum:                   EtaDiffx(&double_result); break;
+
+					/*Vector special case (maybe should go to specific analysis?)*/
+					case ChannelAreaEnum:{
+
+							/*Get Number of Channels*/
+							int numchannels_local=0,numchannels;
+							for(int j=0;j<this->loads->Size();j++){
+								if(this->loads->GetEnum(j)==ChannelEnum) numchannels_local++;
+							}
+							ISSM_MPI_Reduce(&numchannels_local,&numchannels,1,ISSM_MPI_INT,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+							ISSM_MPI_Bcast(&numchannels,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+
+							IssmPDouble* values    = xNewZeroInit<IssmPDouble>(numchannels);
+							IssmPDouble* allvalues = xNew<IssmPDouble>(numchannels);
+
+							/*Fill-in vector*/
+							for(int j=0;j<this->loads->Size();j++){
+								if(this->loads->GetEnum(j)==ChannelEnum){
+									Channel* channel=(Channel*)this->loads->GetObjectByOffset(j);
+									channel->WriteChannelCrossSection(values);
+								}
+							}
+
+							/*Gather from all cpus*/
+							ISSM_MPI_Allreduce((void*)values,(void*)allvalues,numchannels,ISSM_MPI_PDOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
+							xDelete<IssmPDouble>(values);
+
+							if(save_results)results->AddResult(new GenericExternalResult<IssmPDouble*>(results->Size()+1,output_enum,allvalues,numchannels,1,step,time));
+							xDelete<IssmPDouble>(allvalues);
+
+							isvec = true;
+					}
+					break;
+
+
+				   /*Default is always Vector */
 					default:
 
 						/*Vector layout*/
+						if(!IsInputEnum(output_enum)) _error_("Cannot output \""<<EnumToStringx(output_enum)<<"\" because it is not an input");
 						int interpolation,nodesperelement,size,nlines,ncols,array_size;
 						int rank_interpolation=-1,rank_nodesperelement=-1,rank_arraysize=-1,max_rank_arraysize=0;
@@ -2002,4 +2377,10 @@
 						ISSM_MPI_Bcast(&nodesperelement,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 						ISSM_MPI_Bcast(&array_size,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+
+						results_on_nodes=false;
+						/*Loop to see if this output was requested on nodes*/
+						for(int j=0;j<numonnodes & results_on_nodes==false;j++){
+							if(strcmp(resultsonnodes[j],output_string) == 0 || strcmp(resultsonnodes[j],"all") == 0) results_on_nodes=true;
+						}
 
 						if(results_on_nodes){
@@ -2090,7 +2471,5 @@
 	/*Convert list of enums to list of string*/
 	char** enumlist = xNew<char*>(numoutputs);
-	for(int i=0;i<numoutputs;i++){
-		EnumToStringx(&enumlist[i],requested_outputs[i]);
-	}
+	for(int i=0;i<numoutputs;i++) EnumToStringx(&enumlist[i],requested_outputs[i]);
 
 	/*Call main module*/
@@ -2100,5 +2479,4 @@
 	for(int i=0;i<numoutputs;i++) xDelete<char>(enumlist[i]);
 	xDelete<char*>(enumlist);
-	return;
 }
 /*}}}*/
@@ -2128,4 +2506,6 @@
 		case IceVolumeAboveFloatationEnum:       this->IceVolumeAboveFloatationx(responses, false); break;
 		case IceVolumeAboveFloatationScaledEnum: this->IceVolumeAboveFloatationx(responses, true); break;
+		case IcefrontMassFluxEnum:               this->IcefrontMassFluxx(responses, false); break;
+		case IcefrontMassFluxLevelsetEnum:       this->IcefrontMassFluxLevelsetx(responses, false); break;
 		case GroundedAreaEnum:                   this->GroundedAreax(responses, false); break;
 		case GroundedAreaScaledEnum:             this->GroundedAreax(responses, true); break;
@@ -2156,4 +2536,6 @@
 		case DragCoefficientAbsGradientEnum:     DragCoefficientAbsGradientx(responses, elements,nodes, vertices, loads, materials, parameters); break;
 		case BalancethicknessMisfitEnum:         BalancethicknessMisfitx(responses); break;
+		case TotalCalvingFluxLevelsetEnum:		  this->TotalCalvingFluxLevelsetx(responses, false); break;
+		case TotalCalvingMeltingFluxLevelsetEnum:this->TotalCalvingMeltingFluxLevelsetx(responses, false); break;
 		case TotalFloatingBmbEnum:			        this->TotalFloatingBmbx(responses, false); break;
 		case TotalFloatingBmbScaledEnum:			  this->TotalFloatingBmbx(responses, true); break;
@@ -2176,4 +2558,12 @@
 }
 /*}}}*/
+void FemModel::RignotMeltParameterizationx(){/*{{{*/
+
+	for(int i=0;i<elements->Size();i++){
+		Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
+		element->RignotMeltParameterization();
+	}
+}
+/*}}}*/
 void FemModel::StrainRateparallelx(){/*{{{*/
 
@@ -2412,4 +2802,36 @@
 }
 /*}}}*/
+void FemModel::TotalCalvingFluxLevelsetx(IssmDouble* pM, bool scaled){/*{{{*/
+
+	IssmDouble local_calving_flux = 0;
+	IssmDouble total_calving_flux;
+
+	for(int i=0;i<this->elements->Size();i++){
+		Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
+		local_calving_flux+=element->TotalCalvingFluxLevelset(scaled);
+	}
+	ISSM_MPI_Reduce(&local_calving_flux,&total_calving_flux,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+	ISSM_MPI_Bcast(&total_calving_flux,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+
+	/*Assign output pointers: */
+	*pM=total_calving_flux;
+
+}/*}}}*/
+void FemModel::TotalCalvingMeltingFluxLevelsetx(IssmDouble* pM, bool scaled){/*{{{*/
+
+	IssmDouble local_calving_flux = 0;
+	IssmDouble total_calving_flux;
+
+	for(int i=0;i<this->elements->Size();i++){
+		Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
+		local_calving_flux+=element->TotalCalvingMeltingFluxLevelset(scaled);
+	}
+	ISSM_MPI_Reduce(&local_calving_flux,&total_calving_flux,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+	ISSM_MPI_Bcast(&total_calving_flux,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+
+	/*Assign output pointers: */
+	*pM=total_calving_flux;
+
+}/*}}}*/
 void FemModel::TotalFloatingBmbx(IssmDouble* pFbmb, bool scaled){/*{{{*/
 
@@ -2481,9 +2903,13 @@
 
 	IssmDouble time;
-	int        analysis_type;
+	int        analysis_type,config_type;
 
 	/*retrieve parameters: */
 	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+	parameters->FindParam(&config_type,ConfigurationTypeEnum);
 	parameters->FindParam(&time,TimeEnum);
+
+	int index=AnalysisIndex(config_type);
+	_assert_(this->analysis_type_list[index]==config_type);
 
 	/*start module: */
@@ -2495,8 +2921,8 @@
 
 	/*Second, constraints might be time dependent: */
-	SpcNodesx(nodes,constraints,parameters,analysis_type);
+	SpcNodesx(nodes,constraints,parameters);
 
 	/*Now, update degrees of freedoms: */
-	NodesDofx(nodes,parameters,analysis_type);
+	NodesDofx(nodes,parameters);
 
 }
@@ -2514,7 +2940,9 @@
 
 	/*Allocate vector*/
-	Vector<IssmDouble> *vx=new Vector<IssmDouble>(vertices->NumberOfVertices());
-	Vector<IssmDouble> *vy=new Vector<IssmDouble>(vertices->NumberOfVertices());
-	Vector<IssmDouble> *vz=new Vector<IssmDouble>(vertices->NumberOfVertices());
+	int numvert       = vertices->NumberOfVertices();
+	int numvert_local = vertices->NumberOfVerticesLocal();
+	Vector<IssmDouble> *vx=new Vector<IssmDouble>(numvert_local,numvert);
+	Vector<IssmDouble> *vy=new Vector<IssmDouble>(numvert_local,numvert);
+	Vector<IssmDouble> *vz=new Vector<IssmDouble>(numvert_local,numvert);
 
 	/*Update verices new geometry: */
@@ -2555,6 +2983,5 @@
 	int newnumberofvertices	= -1;
 	int newnumberofelements = -1;
-	bool* my_elements			= NULL;
-	int* my_vertices			= NULL;
+
 	int elementswidth       = this->GetElementsWidth();//just tria elements in this version
 	int amrtype,basalforcing_model;
@@ -2566,5 +2993,5 @@
 		#if defined(_HAVE_NEOPZ_) && !defined(_HAVE_AD_)
 		case AmrNeopzEnum: this->ReMeshNeopz(&newnumberofvertices,&newnumberofelements,&newx,&newy,&newz,&newelementslist); break;
-								 #endif
+		#endif
 
 		#if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_)
@@ -2575,56 +3002,82 @@
 	}
 
+	/*Create iomodel for model processing*/
+	IoModel* iomodel = new IoModel();
+	this->parameters->FindParam(&iomodel->domaintype,DomainTypeEnum);
+	this->parameters->FindParam(&iomodel->domaindim ,DomainDimensionEnum);
+	this->parameters->FindParam(&iomodel->meshelementtype,MeshElementtypeEnum);
+	iomodel->numberofvertices = newnumberofvertices;
+	iomodel->numberofelements = newnumberofelements;
+	iomodel->elements         = newelementslist;
+	iomodel->AddConstant(new IoConstant(0,"md.rifts.numrifts"));
+	iomodel->AddConstant(new IoConstant(false,"md.transient.isoceancoupling"));
+	bool temp; int tempint;
+	this->parameters->FindParam(&temp,FlowequationIsSIAEnum); iomodel->AddConstant(new IoConstant(temp,"md.flowequation.isSIA"));
+	this->parameters->FindParam(&temp,FlowequationIsSSAEnum); iomodel->AddConstant(new IoConstant(temp,"md.flowequation.isSSA"));
+	this->parameters->FindParam(&temp,FlowequationIsL1L2Enum); iomodel->AddConstant(new IoConstant(temp,"md.flowequation.isL1L2"));
+	this->parameters->FindParam(&temp,FlowequationIsHOEnum); iomodel->AddConstant(new IoConstant(temp,"md.flowequation.isHO"));
+	this->parameters->FindParam(&temp,FlowequationIsFSEnum); iomodel->AddConstant(new IoConstant(temp,"md.flowequation.isFS"));
+	this->parameters->FindParam(&tempint,MasstransportStabilizationEnum); iomodel->AddConstant(new IoConstant(tempint,"md.masstransport.stabilization"));
+	iomodel->AddConstant(new IoConstant(P1Enum,"md.flowequation.fe_SSA"));
+
 	/*Partitioning the new mesh. Maybe ElementsAndVerticesPartitioning.cpp could be modified to set this without iomodel.*/
-	this->ElementsAndVerticesPartitioning(newnumberofvertices,newnumberofelements,elementswidth,newelementslist,&my_elements,&my_vertices);
-
-	if(this->loads->Size()!=0) _error_("not supported yet");
-
-	/*Create vertices*/
-	Vertices* new_vertices=new Vertices();
-	this->CreateVertices(newnumberofvertices,newnumberofelements,elementswidth,newelementslist,my_vertices,newx,newy,newz,new_vertices);
+	::ElementsAndVerticesPartitioning(iomodel);
 
 	/*Creating elements*/
 	/*Just Tria in this version*/
 	Elements* new_elements=new Elements();
-	this->CreateElements(newnumberofelements,elementswidth,newelementslist,my_elements,new_elements);
+	this->CreateElements(newnumberofelements,elementswidth,newelementslist,iomodel->my_elements,new_elements);
+
+	/*Create vertices*/
+	Vertices* new_vertices=new Vertices();
+	CreateNumberNodeToElementConnectivity(iomodel);
+	::CreateVertices(new_elements,new_vertices,iomodel,TransientSolutionEnum,true);
+	for(int i=0;i<new_vertices->Size();i++){
+		Vertex *vertex=(Vertex*)new_vertices->GetObjectByOffset(i);
+		int     sid = vertex->Sid();
+		vertex->x=newx[sid];
+		vertex->y=newy[sid];
+		vertex->z=newz[sid];
+	}
 
 	/*Creating materials*/
 	Materials* new_materials=new Materials();
-	this->CreateMaterials(newnumberofelements,my_elements,new_materials);
+	this->CreateMaterials(newnumberofelements,iomodel->my_elements,new_materials);
 
 	/*Creating nodes and constraints*/
 	/*Just SSA (2D) and P1 in this version*/
-	Nodes* new_nodes					= new Nodes();
-	Constraints* new_constraints	= new Constraints();
-
-	int nodecounter		=0;
-	int constraintcounter=0;
+	Constraints **new_constraints_list = xNew<Constraints*>(this->nummodels);
+	Nodes       **new_nodes_list       = xNew<Nodes*>(this->nummodels);
+
+	this->analysis_counter=-1;
 	for(int i=0;i<this->nummodels;i++){//create nodes for each analysis in analysis_type_list
 
 		int analysis_enum = this->analysis_type_list[i];
+		if(VerboseMProcessor()) _printf0_("   creating datasets for analysis " << EnumToStringx(analysis_enum) << "\n");
+
+		if(this->loads_list[i]->Size()!=0) _error_("not supported yet");
+		new_constraints_list[i] = new Constraints();
+		new_nodes_list[i] = new Nodes();
 
 		/*As the domain is 2D, it is not necessary to create nodes for this analysis*/
 		if(analysis_enum==StressbalanceVerticalAnalysisEnum) continue;
-
-		this->CreateNodes(newnumberofvertices,my_vertices,nodecounter,analysis_enum,new_nodes);
-		this->CreateConstraints(new_vertices,nodecounter,constraintcounter,analysis_enum,new_constraints);
-		this->UpdateElements(newnumberofelements,newelementslist,my_elements,nodecounter,i,new_elements);
-
-		if(new_nodes->Size()) nodecounter=new_nodes->MaximumId();
-		constraintcounter = new_constraints->NumberOfConstraints();
-		/*Make sure nodecounter is at least 0 (if no node exists, maxid will be -1*/
-		_assert_(nodecounter>=0);
+		Analysis* analysis = EnumToAnalysis(analysis_enum);
+		analysis->CreateNodes(new_nodes_list[i],iomodel,true);
+		delete analysis;
+		this->UpdateElements(newnumberofelements,newelementslist,iomodel->my_elements,i,new_elements);
+		this->CreateConstraints(new_vertices,analysis_enum,new_constraints_list[i]);
+
+		new_constraints_list[i]->Presort();
+		new_nodes_list[i]->Presort();
 	}
 
 	new_elements->Presort();
-	new_nodes->Presort();
 	new_vertices->Presort();
-	this->loads->Presort();
+	//this->loads->Presort();
 	new_materials->Presort();
-	new_constraints->Presort();
-
-	/*reset hooks for elements, loads and nodes: */
+
+	/*reset hooks*/
 	new_elements->ResetHooks();
-	this->loads->ResetHooks();
+	//this->loads->ResetHooks();
 	new_materials->ResetHooks();
 
@@ -2633,5 +3086,5 @@
 	for(int i=0;i<this->nummodels;i++){
 		analysis_type=this->analysis_type_list[i];
-		//SetCurrentConfiguration(analysis_type);
+		SetCurrentConfiguration(analysis_type);
 
 		this->analysis_counter=i;
@@ -2642,6 +3095,6 @@
 
 		/*configure elements, loads and nodes, for this new analysis: */
-		new_elements->SetCurrentConfiguration(new_elements,this->loads,new_nodes,new_vertices,new_materials,this->parameters);
-		this->loads->SetCurrentConfiguration(new_elements,this->loads,new_nodes,new_vertices,new_materials,this->parameters);
+		new_elements->SetCurrentConfiguration(new_elements,this->loads,new_nodes_list[i],new_vertices,new_materials,this->parameters);
+		this->loads->SetCurrentConfiguration(new_elements,this->loads,new_nodes_list[i],new_vertices,new_materials,this->parameters);
 
 		/*take care of toolkits options, that depend on this analysis type (present only after model processor)*/
@@ -2651,10 +3104,7 @@
 		}
 
-		ConfigureObjectsx(new_elements,this->loads,new_nodes,new_vertices,new_materials,this->parameters);
-		if(i==0){
-			VerticesDofx(new_vertices,this->parameters); //only call once, we only have one set of vertices
-		}
-		SpcNodesx(new_nodes,new_constraints,this->parameters,analysis_type);
-		NodesDofx(new_nodes,this->parameters,analysis_type);
+		ConfigureObjectsx(new_elements,this->loads,new_nodes_list[i],new_vertices,new_materials,this->parameters);
+		SpcNodesx(new_nodes_list[i],new_constraints_list[i],this->parameters);
+		NodesDofx(new_nodes_list[i],this->parameters);
 	}
 
@@ -2665,7 +3115,15 @@
 	delete this->vertices;		this->vertices		= new_vertices;
 	delete this->elements;		this->elements		= new_elements;
-	delete this->nodes;			this->nodes			= new_nodes;
-	delete this->constraints;	this->constraints	= new_constraints;
 	delete this->materials;		this->materials	= new_materials;
+	if(this->constraints_list && this->nummodels){
+		for(int i=0;i<this->nummodels;i++) delete this->constraints_list[i];
+		xDelete<Constraints*>(this->constraints_list);
+	}
+	this->constraints_list= new_constraints_list;
+	if(this->nodes_list && this->nummodels){
+		for(int i=0;i<this->nummodels;i++) delete this->nodes_list[i];
+		xDelete<Nodes*>(this->nodes_list);
+	}
+	this->nodes_list = new_nodes_list;
 
 	GetMaskOfIceVerticesLSMx0(this);
@@ -2683,11 +3141,12 @@
 	SetCurrentConfiguration(analysis_type);
 
+	/*Set the new mesh*/
+	this->SetMesh(&newelementslist,&newx,&newy,&newnumberofvertices,&newnumberofelements);
+
 	/*Cleanup*/
-	xDelete<IssmDouble>(newx);
-	xDelete<IssmDouble>(newy);
 	xDelete<IssmDouble>(newz);
-	xDelete<int>(newelementslist);
-	xDelete<int>(my_vertices);
-	xDelete<bool>(my_elements);
+	/*Delete iomodel, but make sure to not erase some pointers*/
+	iomodel->elements = NULL;
+	delete iomodel;
 }
 /*}}}*/
@@ -2742,6 +3201,6 @@
 		element->GetInputListOnVertices(&r[0],BedEnum);
 		element->GetInputListOnVertices(&sl[0],SealevelEnum);
-		rho_water   = element->matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-		rho_ice     = element->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+		rho_water   = element->FindParam(MaterialsRhoSeawaterEnum);
+		rho_ice     = element->FindParam(MaterialsRhoIceEnum);
 		density     = rho_ice/rho_water;
 
@@ -2901,7 +3360,7 @@
 void FemModel::InterpolateInputs(Vertices* newfemmodel_vertices,Elements* newfemmodel_elements){/*{{{*/
 
-	int numberofelements			= this->elements->NumberOfElements();	//global, entire old mesh
+	int numberofelements			= -1;												//global, entire old mesh
 	int newnumberofelements		= newfemmodel_elements->Size();			//just on the new partition
-	int numberofvertices			= this->vertices->NumberOfVertices();	//global, entire old mesh
+	int numberofvertices			= -1;												//global, entire old mesh
 	int newnumberofvertices 	= newfemmodel_vertices->Size();			//just on the new partition
 	int elementswidth				= this->GetElementsWidth(); //just tria in this version
@@ -2920,5 +3379,4 @@
 	IssmDouble* x					= NULL;//global, entire old mesh
 	IssmDouble* y					= NULL;//global, entire old mesh
-	IssmDouble* z					= NULL;//global, entire old mesh
 	int* elementslist				= NULL;//global, entire old mesh
 	IssmDouble* newx				= NULL;//just on the new partition
@@ -2934,5 +3392,5 @@
 
 	/*Get the old mesh (global, entire mesh)*/
-	this->GetMesh(this->vertices,this->elements,&x,&y,&z,&elementslist);
+	this->GetMesh(&elementslist,&x,&y,&numberofvertices,&numberofelements);
 
 	/*Get the new mesh (just on the new partition)*/
@@ -2999,8 +3457,4 @@
 	xDelete<int>(P1input_enums);
 	xDelete<int>(P1input_interp);
-	xDelete<IssmDouble>(x);
-	xDelete<IssmDouble>(y);
-	xDelete<IssmDouble>(z);
-	xDelete<int>(elementslist);
 	xDelete<IssmDouble>(newx);
 	xDelete<IssmDouble>(newy);
@@ -3024,5 +3478,4 @@
 	IssmDouble* x			= NULL;
 	IssmDouble* y			= NULL;
-	IssmDouble* z			= NULL;
 	int* elementslist		= NULL;
 
@@ -3031,9 +3484,7 @@
 	parameters->FindParam(&step,StepEnum);
 	parameters->FindParam(&time,TimeEnum);
-	numberofelements=this->elements->NumberOfElements();
-	numberofvertices=this->vertices->NumberOfVertices();
 
 	/*Get mesh. Elementslist comes in Matlab indexing*/
-	this->GetMesh(this->vertices,this->elements,&x,&y,&z,&elementslist);
+	this->GetMesh(&elementslist,&x,&y,&numberofvertices,&numberofelements);
 
 	/*Write mesh in Results*/
@@ -3046,10 +3497,4 @@
 	this->results->AddResult(new GenericExternalResult<IssmDouble*>(this->results->Size()+1,MeshYEnum,
 					y,numberofvertices,1,step,time));
-
-	/*Cleanup*/
-	xDelete<IssmDouble>(x);
-	xDelete<IssmDouble>(y);
-	xDelete<IssmDouble>(z);
-	xDelete<int>(elementslist);
 }
 /*}}}*/
@@ -3116,41 +3561,4 @@
 	delete vmasklevelset;
 
-}
-/*}}}*/
-void FemModel::CreateVertices(int newnumberofvertices,int newnumberofelements,int elementswidth,int* newelementslist,int* my_vertices,IssmDouble* newx,IssmDouble* newy,IssmDouble* newz,Vertices* vertices){/*{{{*/
-
-	/*newelementslist is in Matlab indexing*/
-
-	/*Creating connectivity table*/
-	int* connectivity=NULL;
-	connectivity=xNewZeroInit<int>(newnumberofvertices);
-
-	for(int i=0;i<newnumberofelements;i++){
-		for(int j=0;j<elementswidth;j++){
-			int vertexid = newelementslist[elementswidth*i+j];
-			_assert_(vertexid>0 && vertexid-1<newnumberofvertices);//Matlab indexing
-			connectivity[vertexid-1]+=1;//Matlab to C indexing
-		}
-	}
-
-	/*Create vertex and insert in vertices*/
-	for(int i=0;i<newnumberofvertices;i++){
-		if(my_vertices[i]){
-			Vertex *newvertex=new Vertex();
-			newvertex->id=i+1;
-			newvertex->sid=i;
-			newvertex->pid=UNDEF;
-			newvertex->x=newx[i];
-			newvertex->y=newy[i];
-			newvertex->z=newz[i];
-			newvertex->domaintype=Domain2DhorizontalEnum;
-			newvertex->sigma=0.;
-			newvertex->connectivity=connectivity[i];
-			newvertex->clone=false;//itapopo check this
-			vertices->AddObject(newvertex);
-		}
-	}
-
-	xDelete<int>(connectivity);
 }
 /*}}}*/
@@ -3170,5 +3578,4 @@
 			newtria->vertices=NULL;
 			newtria->material=NULL;
-			newtria->matpar=NULL;
 			if(this->nummodels>0){
 				newtria->element_type_list=xNew<int>(this->nummodels);
@@ -3178,5 +3585,4 @@
 
 			/*Element hook*/
-			int matpar_id=newnumberofelements+1; //retrieve material parameter id (last pointer in femodel->materials)
 			int material_id=i+1; // retrieve material_id = i+1;
 			/*retrieve vertices ids*/
@@ -3188,5 +3594,4 @@
 			newtria->hvertices   =new Hook(&vertex_ids[0],elementswidth);
 			newtria->hmaterial   =new Hook(&material_id,1);
-			newtria->hmatpar     =new Hook(&matpar_id,1);
 			newtria->hneighbors  =NULL;
 			/*Initialize hnodes as NULL*/
@@ -3208,57 +3613,7 @@
 		}
 	}
-
-	/*Add new constant material property to materials, at the end: */
-	Matpar *newmatpar=static_cast<Matpar*>(this->materials->GetObjectByOffset(this->materials->Size()-1)->copy());
-	newmatpar->SetMid(newnumberofelements+1);
-	materials->AddObject(newmatpar);//put it at the end of the materials
-}
-/*}}}*/
-void FemModel::CreateNodes(int newnumberofvertices,int* my_vertices,int nodecounter,int analysis_enum,Nodes* nodes){/*{{{*/
-
-	int lid=0;
-	for(int j=0;j<newnumberofvertices;j++){
-		if(my_vertices[j]){
-
-			Node* newnode=new Node();
-
-			/*id: */
-			newnode->id=nodecounter+j+1;
-			newnode->sid=j;
-			newnode->lid=lid++;
-			newnode->analysis_enum=analysis_enum;
-
-			/*Initialize coord_system: Identity matrix by default*/
-			for(int k=0;k<3;k++) for(int l=0;l<3;l++) newnode->coord_system[k][l]=0.0;
-			for(int k=0;k<3;k++) newnode->coord_system[k][k]=1.0;
-
-			/*indexing:*/
-			newnode->indexingupdate=true;
-
-			Analysis* analysis=EnumToAnalysis(analysis_enum);
-			int *doftypes=NULL;
-			int numdofs=analysis->DofsPerNode(&doftypes,Domain2DhorizontalEnum,SSAApproximationEnum);
-			newnode->indexing.Init(numdofs,doftypes);
-			xDelete<int>(doftypes);
-			delete analysis;
-			if(analysis_enum==StressbalanceAnalysisEnum)
-				newnode->SetApproximation(SSAApproximationEnum);
-			else
-				newnode->SetApproximation(0);
-
-			/*Stressbalance Horiz*/
-			if(analysis_enum==StressbalanceAnalysisEnum){
-				// itapopo this code is rarely used.
-				/*Coordinate system provided, convert to coord_system matrix*/
-				//XZvectorsToCoordinateSystem(&this->coord_system[0][0],&iomodel->Data(StressbalanceReferentialEnum)[j*6]);
-				//_assert_(sqrt( coord_system[0][0]*coord_system[0][0] + coord_system[1][0]*coord_system[1][0]) >1.e-4);
-
-			}
-			nodes->AddObject(newnode);
-		}
-	}
-}
-/*}}}*/
-void FemModel::GetMesh(Vertices* femmodel_vertices, Elements* femmodel_elements,IssmDouble** px, IssmDouble** py, IssmDouble** pz, int** pelementslist){/*{{{*/
+}
+/*}}}*/
+void FemModel::GetMesh(Vertices* femmodel_vertices, Elements* femmodel_elements,IssmDouble** px, IssmDouble** py, int** pelementslist){/*{{{*/
 
 	if(!femmodel_vertices) _error_("GetMesh: vertices are NULL.");
@@ -3317,5 +3672,4 @@
 	*px				= x;
 	*py				= y;
-	*pz				= z;
 	*pelementslist = elementslist; //Matlab indexing. InterMesh uses this type.
 
@@ -3325,4 +3679,5 @@
 	xDelete<IssmDouble>(id2);
 	xDelete<IssmDouble>(id3);
+	xDelete<IssmDouble>(z);
 	delete vid1;
 	delete vid2;
@@ -3330,4 +3685,40 @@
 }
 /*}}}*/
+void FemModel::GetMesh(int** elementslist, IssmDouble** x, IssmDouble** y, int* numberofvertices, int* numberofelements){/*{{{*/
+
+	int amrtype;
+	this->parameters->FindParam(&amrtype,AmrTypeEnum);
+
+	switch(amrtype){
+
+      #if defined(_HAVE_NEOPZ_)
+      case AmrNeopzEnum: this->amr->GetMesh(elementslist,x,y,numberofvertices,numberofelements); break;
+      #endif
+
+      #if defined(_HAVE_BAMG_)
+      case AmrBamgEnum: this->amrbamg->GetMesh(elementslist,x,y,numberofvertices,numberofelements); break;
+      #endif
+
+      default: _error_("not implemented yet");
+   }
+}/*}}}*/
+void FemModel::SetMesh(int** elementslist, IssmDouble** x, IssmDouble** y, int* numberofvertices, int* numberofelements){/*{{{*/
+
+	int amrtype;
+	this->parameters->FindParam(&amrtype,AmrTypeEnum);
+
+	switch(amrtype){
+
+      #if defined(_HAVE_NEOPZ_)
+      case AmrNeopzEnum: this->amr->SetMesh(elementslist,x,y,numberofvertices,numberofelements); break;
+      #endif
+
+      #if defined(_HAVE_BAMG_)
+      case AmrBamgEnum: this->amrbamg->SetMesh(elementslist,x,y,numberofvertices,numberofelements); break;
+      #endif
+
+      default: _error_("not implemented yet");
+   }
+}/*}}}*/
 void FemModel::GetMeshOnPartition(Vertices* femmodel_vertices,Elements* femmodel_elements,IssmDouble** px,IssmDouble** py,IssmDouble** pz,int** pelementslist,int** psidtoindex){/*{{{*/
 
@@ -3387,20 +3778,20 @@
 }
 /*}}}*/
-void FemModel::CreateConstraints(Vertices* newfemmodel_vertices,int nodecounter,int constraintcounter,int analysis_enum,Constraints* newfemmodel_constraints){/*{{{*/
+void FemModel::CreateConstraints(Vertices* newfemmodel_vertices,int analysis_enum,Constraints* newfemmodel_constraints){/*{{{*/
 
 	/*ATTENTION: JUST SPCVX AND SPCVY*/
 	/*OTHERS CONSTRAINTS MUST BE IMPLEMENTED*/
 	if(analysis_enum!=StressbalanceAnalysisEnum) return;
-
-	int numberofnodes_analysistype= this->nodes->NumberOfNodes(analysis_enum);
+	int analysis_index = AnalysisIndex(analysis_enum);
+
+	int numberofnodes_analysistype= this->nodes_list[analysis_index]->NumberOfNodes();
 	int dofpernode						= 2;														//vx and vy
 	int numberofcols					= dofpernode*2;										//to keep dofs and flags in the vspc vector
-	int numberofvertices				= this->vertices->NumberOfVertices();			//global, entire old mesh
-	int numberofelements				= this->elements->NumberOfElements();			//global, entire old mesh
+	int numberofvertices				= -1;														//global, entire old mesh
+	int numberofelements				= -1;														//global, entire old mesh
 	int newnumberofvertices			= newfemmodel_vertices->Size();					//local, just the new partition
 	int count							= 0;
 	IssmDouble* x						= NULL;													//global, entire old mesh
 	IssmDouble* y						= NULL;													//global, entire old mesh
-	IssmDouble* z						= NULL;													//global, entire old mesh
 	int*			elementslist		= NULL;													//global, entire old mesh
 	IssmDouble* spc					= NULL;													//global, entire old mesh
@@ -3412,5 +3803,5 @@
 
 	/*Get old mesh (global, entire mesh). Elementslist comes in Matlab indexing*/
-	this->GetMesh(this->vertices,this->elements,&x,&y,&z,&elementslist);
+	this->GetMesh(&elementslist,&x,&y,&numberofvertices,&numberofelements);
 
 	/*Get vertices coordinates of the new partition*/
@@ -3425,8 +3816,7 @@
 
 	/*Get spcvx and spcvy of old mesh*/
-	for(int i=0;i<this->constraints->Size();i++){
-
-		Constraint* constraint=(Constraint*)constraints->GetObjectByOffset(i);
-		if(!constraint->InAnalysis(analysis_enum)) _error_("AMR create constraints for "<<EnumToStringx(analysis_enum)<<" not supported yet!\n");
+	for(int i=0;i<this->constraints_list[analysis_index]->Size();i++){
+
+		Constraint* constraint=(Constraint*)this->constraints_list[analysis_index]->GetObjectByOffset(i);
 
 		SpcStatic* spcstatic = xDynamicCast<SpcStatic*>(constraint);
@@ -3463,5 +3853,5 @@
 		/*spcvx*/
 		if(!xIsNan<IssmDouble>(newspc[i*numberofcols]) && newspc[i*numberofcols+dofpernode]>(1-eps)){
-			newfemmodel_constraints->AddObject(new SpcStatic(constraintcounter+count+1,nodecounter+vertex->Sid()+1,0,newspc[i*numberofcols],analysis_enum));
+			newfemmodel_constraints->AddObject(new SpcStatic(count+1,vertex->Sid()+1,0,newspc[i*numberofcols],analysis_enum));
 			//add count'th spc, on node i+1, setting dof 1 to vx.
 			count++;
@@ -3473,5 +3863,5 @@
 		/*spcvy*/
 		if(!xIsNan<IssmDouble>(newspc[i*numberofcols+1]) && newspc[i*numberofcols+dofpernode+1]>(1-eps) ){
-			newfemmodel_constraints->AddObject(new SpcStatic(constraintcounter+count+1,nodecounter+vertex->Sid()+1,1,newspc[i*numberofcols+1],analysis_enum));
+			newfemmodel_constraints->AddObject(new SpcStatic(count+1,vertex->Sid()+1,1,newspc[i*numberofcols+1],analysis_enum));
 			//add count'th spc, on node i+1, setting dof 1 to vx.
 			count++;
@@ -3480,8 +3870,4 @@
 
 	/*Cleanup*/
-	xDelete<IssmDouble>(x);
-	xDelete<IssmDouble>(y);
-	xDelete<IssmDouble>(z);
-	xDelete<int>(elementslist);
 	xDelete<IssmDouble>(spc);
 	xDelete<IssmDouble>(newspc);
@@ -3491,5 +3877,5 @@
 }
 /*}}}*/
-void FemModel::UpdateElements(int newnumberofelements,int* newelementslist,bool* my_elements,int nodecounter,int analysis_counter,Elements* newelements){/*{{{*/
+void FemModel::UpdateElements(int newnumberofelements,int* newelementslist,bool* my_elements,int analysis_counter,Elements* newelements){/*{{{*/
 
 	/*newelementslist is in Matlab indexing*/
@@ -3505,7 +3891,7 @@
 			int numnodes=3;
          int* tria_node_ids=xNew<int>(numnodes);
-         tria_node_ids[0]=nodecounter+newelementslist[3*iel+0]; //matlab indexing
-         tria_node_ids[1]=nodecounter+newelementslist[3*iel+1]; //matlab indexing
-         tria_node_ids[2]=nodecounter+newelementslist[3*iel+2]; //matlab indexing
+         tria_node_ids[0]=newelementslist[3*iel+0]; //matlab indexing
+         tria_node_ids[1]=newelementslist[3*iel+1]; //matlab indexing
+         tria_node_ids[2]=newelementslist[3*iel+2]; //matlab indexing
 			tria->SetHookNodes(tria_node_ids,numnodes,analysis_counter); tria->nodes=NULL;
    		xDelete<int>(tria_node_ids);
@@ -3514,77 +3900,4 @@
 	}
 	return;
-}
-/*}}}*/
-void FemModel::ElementsAndVerticesPartitioning(int& newnumberofvertices,int& newnumberofelements,int& elementswidth,int* newelementslist,bool** pmy_elements,int** pmy_vertices){/*{{{*/
-
-	/*newelementslist come in Matlab indexing*/
-
-	int *epart			= NULL; //element partitioning.
-	int *npart			= NULL; //node partitioning.
-	int *index 			= NULL; //elements in C indexing
-	int edgecut			= 1;
-	int numflag			= 0;
-	int etype			= 1;
-	int my_rank			= IssmComm::GetRank();
-	int numprocs		= IssmComm::GetSize();
-	bool *my_elements = NULL;
-	int *my_vertices  = NULL;
-
-	_assert_(newnumberofvertices>0);
-	_assert_(newnumberofelements>0);
-	epart=xNew<int>(newnumberofelements);
-	npart=xNew<int>(newnumberofvertices);
-   index=xNew<int>(elementswidth*newnumberofelements);
-
-	for (int i=0;i<newnumberofelements;i++){
-   	for (int j=0;j<elementswidth;j++){
-      	*(index+elementswidth*i+j)=(*(newelementslist+elementswidth*i+j))-1; //-1 for C indexing in Metis
-      }
-   }
-
-	/*Partition using Metis:*/
-	if (numprocs>1){
-#ifdef _HAVE_METIS_
-		METIS_PartMeshNodalPatch(&newnumberofelements,&newnumberofvertices, index, &etype, &numflag, &numprocs, &edgecut, epart, npart);
-#else
-		_error_("metis has not beed installed. Cannot run with more than 1 cpu");
-#endif
-	}
-	else if (numprocs==1){
-		/*METIS does not know how to deal with one cpu only!*/
-		for (int i=0;i<newnumberofelements;i++) epart[i]=0;
-		for (int i=0;i<newnumberofvertices;i++) npart[i]=0;
-	}
-	else _error_("At least one processor is required");
-
-	my_vertices=xNew<int>(newnumberofvertices);
-	my_elements=xNew<bool>(newnumberofelements);
-	for(int i=0;i<newnumberofvertices;i++) my_vertices[i]=0;
-	for(int i=0;i<newnumberofelements;i++) my_elements[i]=false;
-
-	/*Start figuring out, out of the partition, which elements belong to this cpu: */
-	for(int i=0;i<newnumberofelements;i++){
-		/*!All elements have been partitioned above, only deal with elements for this cpu: */
-		if(my_rank==epart[i]){
-			my_elements[i]=true;
-			/*Now that we are here, we can also start building the list of vertices belonging to this cpu partition: we use
-			 *the  element index to do this. For each element n, we know index[n][0:2] holds the indices (matlab indexing)
-			 into the vertices coordinates. If we start plugging 1 into my_vertices for each index[n][i] (i=0:2), then my_vertices
-			 will hold which vertices belong to this partition*/
-			for(int j=0;j<elementswidth;j++){
-				_assert_(newelementslist[elementswidth*i+j]-1<newnumberofvertices);//newelementslist is in Matlab indexing
-				my_vertices[newelementslist[elementswidth*i+j]-1]=1;//newelementslist is in Matlab indexing
-			}
-		}
-	}
-
-	/*Assign output pointers:*/
-	*pmy_elements=my_elements;
-	*pmy_vertices=my_vertices;
-
-	/*Free ressources:*/
-	xDelete<int>(epart);
-	xDelete<int>(npart);
-	xDelete<int>(index);
 }
 /*}}}*/
@@ -4526,4 +4839,6 @@
 	ISSM_MPI_Bcast(&oceanarea,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
 
+	//_printf0_("Ocean area: " << oceanarea << "\n");
+
 	ISSM_MPI_Reduce (&oceanvalue_cpu,&oceanvalue,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
 	ISSM_MPI_Bcast(&oceanvalue,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
@@ -4538,20 +4853,21 @@
 void FemModel::HydrologyEPLupdateDomainx(IssmDouble* pEplcount){ /*{{{*/
 
-	Vector<IssmDouble>* mask							= NULL;
-	Vector<IssmDouble>* recurence  				= NULL;
-	Vector<IssmDouble>* active						= NULL;
-	IssmDouble*         serial_mask				= NULL;
-	IssmDouble*         serial_rec  			= NULL;
-	IssmDouble*         serial_active			= NULL;
-	IssmDouble*         old_active        = NULL;
-	int*                eplzigzag_counter =	NULL;
+	Vector<IssmDouble> *mask = NULL;
+	Vector<IssmDouble> *recurence = NULL;
+	Vector<IssmDouble> *active = NULL;
+	IssmDouble         *serial_mask       = NULL;
+	IssmDouble         *serial_rec        = NULL;
+	IssmDouble         *serial_active     = NULL;
+	IssmDouble         *old_active        = NULL;
+	int                *eplzigzag_counter = NULL;
 	int                 eplflip_lock;
 
-	HydrologyDCEfficientAnalysis* effanalysis =  new HydrologyDCEfficientAnalysis();
-	HydrologyDCInefficientAnalysis* inefanalysis =  new HydrologyDCInefficientAnalysis();
+	HydrologyDCEfficientAnalysis   *effanalysis  = new HydrologyDCEfficientAnalysis();
+	HydrologyDCInefficientAnalysis *inefanalysis = new HydrologyDCInefficientAnalysis();
 
 	/*Step 1: update mask, the mask might be extended by residual and/or using downstream sediment head*/
-	mask=new Vector<IssmDouble>(this->nodes->NumberOfNodes(HydrologyDCEfficientAnalysisEnum));
-	recurence=new Vector<IssmDouble>(this->nodes->NumberOfNodes(HydrologyDCEfficientAnalysisEnum));
+	int numnodes = this->nodes->NumberOfNodes();
+	mask=new Vector<IssmDouble>(numnodes);
+	recurence=new Vector<IssmDouble>(numnodes);
 	this->parameters->FindParam(&eplzigzag_counter,NULL,EplZigZagCounterEnum);
 	this->parameters->FindParam(&eplflip_lock,HydrologydcEplflipLockEnum);
@@ -4560,6 +4876,7 @@
 	for (int i=0;i<elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
-		effanalysis->HydrologyEPLGetMask(mask,recurence,eplzigzag_counter,element);
-	}
+		effanalysis->HydrologyEPLGetMask(mask,recurence,element);
+	}
+
 	/*check for changes and increment zigzag counter, change the mask if necessary*/
 	recurence->Assemble();
@@ -4568,5 +4885,5 @@
 		Node* node=xDynamicCast<Node*>(nodes->GetObjectByOffset(i));
 		if(serial_rec[node->Sid()]==1.)eplzigzag_counter[node->Lid()] ++;
-		if(eplzigzag_counter[node->Lid()]>eplflip_lock & eplflip_lock!=0){
+		if(eplzigzag_counter[node->Lid()]>eplflip_lock && eplflip_lock!=0){
 			mask->SetValue(node->Sid(),old_active[node->Sid()],INS_VAL);
 		}
@@ -4588,5 +4905,5 @@
 	inefanalysis->ElementizeEplMask(this);
 	/*Step 2: update node activity. If one element is connected to mask=1, all nodes are active*/
-	active=new Vector<IssmDouble>(nodes->NumberOfNodes(HydrologyDCEfficientAnalysisEnum));
+	active=new Vector<IssmDouble>(nodes->NumberOfNodes());
 	for (int i=0;i<elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
@@ -4599,9 +4916,14 @@
 	delete active;
 
+
 	/*Update node activation accordingly*/
-	int counter =0;
-	for (int i=0;i<nodes->Size();i++){
-		Node* node=xDynamicCast<Node*>(nodes->GetObjectByOffset(i));
-		if(node->InAnalysis(HydrologyDCEfficientAnalysisEnum)){
+	int         counter  = 0; //this is probably not acurate but we are only interested in positivity
+	for(int i=0;i<elements->Size();i++){
+		Element    *element  = xDynamicCast<Element*>(elements->GetObjectByOffset(i));
+		int         numnodes = element->GetNumberOfNodes();
+		IssmDouble *base     = xNew<IssmDouble>(numnodes);
+		element->GetInputListOnNodes(&base[0],BaseEnum);
+		for(int in=0;in<numnodes;in++){
+			Node* node=element->GetNode(in);
 			if(serial_active[node->Sid()]==1.){
 				node->Activate();
@@ -4610,6 +4932,8 @@
 			else{
 				node->Deactivate();
-			}
-		}
+				node->ApplyConstraint(0,base[in]);
+			}
+		}
+		xDelete<IssmDouble>(base);
 	}
 	xDelete<IssmDouble>(serial_active);
@@ -4621,9 +4945,15 @@
 	counter=sum_counter;
 	*pEplcount = counter;
-	if(VerboseSolution()) _printf0_("   Number of active nodes in EPL layer: "<< counter <<"\n");
+	if(VerboseSolution()) {
+		if(counter==0){
+			_printf0_("   No nodes are active in EPL layer \n");
+		}
+		else {
+			_printf0_("   Some active nodes in EPL layer \n");
+		}
+	}
 
 	/*Update dof indexings*/
 	this->UpdateConstraintsx();
-
 }
 /*}}}*/
@@ -4642,5 +4972,5 @@
 	if(isthermal){
 		/*Step 1: update mask, the mask correspond to thawed nodes (that have a meltingrate)*/
-		mask=new Vector<IssmDouble>(this->nodes->NumberOfNodes(HydrologyDCInefficientAnalysisEnum));
+		mask=new Vector<IssmDouble>(this->nodes->NumberOfNodes());
 
 		for (int i=0;i<elements->Size();i++){
@@ -4663,5 +4993,5 @@
 
 	/*get node mask coherent with element mask*/
-	active=new Vector<IssmDouble>(nodes->NumberOfNodes(HydrologyDCInefficientAnalysisEnum));
+	active=new Vector<IssmDouble>(nodes->NumberOfNodes());
 	for (int i=0;i<elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
@@ -4675,8 +5005,14 @@
 
 	/*Update node activation accordingly*/
-	int counter =0;
-	for (int i=0;i<nodes->Size();i++){
-		Node* node=xDynamicCast<Node*>(nodes->GetObjectByOffset(i));
-		if(node->InAnalysis(HydrologyDCInefficientAnalysisEnum)){
+	int         counter  = 0; //this is probably not acurate but we are only interested in positivity
+	for(int i=0;i<elements->Size();i++){
+		Element    *element  = xDynamicCast<Element*>(elements->GetObjectByOffset(i));
+		int         numnodes = element->GetNumberOfNodes();
+		IssmDouble *base     = xNew<IssmDouble>(numnodes);
+
+		element->GetInputListOnNodes(&base[0],BaseEnum);
+
+		for(int in=0;in<numnodes;in++){
+			Node* node=element->GetNode(in);
 			if(serial_active[node->Sid()]==1.){
 				node->Activate();
@@ -4685,8 +5021,9 @@
 			else{
 				node->Deactivate();
-			}
-		}
-	}
-
+				node->ApplyConstraint(0,base[in]);
+			}
+		}
+		xDelete<IssmDouble>(base);
+	}
 	xDelete<IssmDouble>(serial_active);
 	delete inefanalysis;
@@ -4696,6 +5033,12 @@
 	counter=sum_counter;
 	*pIDScount = counter;
-	if(VerboseSolution()) _printf0_("   Number of active nodes in IDS layer: "<< counter <<"\n");
-
+	if(VerboseSolution()) {
+		if(counter==0){
+			_printf0_("   No nodes are active in IDS layer \n");
+		}
+		else {
+			_printf0_("   Some active nodes in IDS layer \n");
+		}
+	}
 	/*Update dof indexings*/
 	this->UpdateConstraintsx();
@@ -4710,5 +5053,6 @@
 
 	/*update node activity. If one element is connected to mask=1, all nodes are active*/
-	active=new Vector<IssmDouble>(nodes->NumberOfNodes(HydrologyDCEfficientAnalysisEnum));
+	this->SetCurrentConfiguration(HydrologyDCEfficientAnalysisEnum);
+	active=new Vector<IssmDouble>(nodes->NumberOfNodes());
 	for (int i=0;i<elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
@@ -4724,14 +5068,13 @@
 	/*Update node activation accordingly*/
 	int counter =0;
+	this->SetCurrentConfiguration(L2ProjectionEPLAnalysisEnum);
 	for (int i=0;i<nodes->Size();i++){
 		Node* node=xDynamicCast<Node*>(nodes->GetObjectByOffset(i));
-		if(node->InAnalysis(L2ProjectionEPLAnalysisEnum)){
-			if(serial_active[node->Sid()]==1.){
-				node->Activate();
-				if(!node->IsClone()) counter++;
-			}
-			else{
-				node->Deactivate();
-			}
+		if(serial_active[node->Sid()]==1.){
+			node->Activate();
+			if(!node->IsClone()) counter++;
+		}
+		else{
+			node->Deactivate();
 		}
 	}
@@ -4745,16 +5088,15 @@
 }
 /*}}}*/
-void FemModel::InitTransientOutputx(int* input_enum,int numoutputs){ /*{{{*/
-
-  for(int i=0;i<numoutputs;i++){
-		if(input_enum[i]<0){
+void FemModel::InitTransientOutputx(int* transientinput_enum,int numoutputs){ /*{{{*/
+
+	for(int i=0;i<numoutputs;i++){
+		if(transientinput_enum[i]<0){
 			_error_("Can't deal with non enum fields for result Stack");
 		}
 		else{
 			for(int j=0;j<elements->Size();j++){
-				TransientInput* transient_input = new TransientInput(input_enum[i]);
 				/*Intermediaries*/
+				TransientInput* transient_input = new TransientInput(transientinput_enum[i]);
 				Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(j));
-				//transient_input->Configure(element->parameters);
 				element->inputs->AddInput(transient_input);
 			}
@@ -4763,5 +5105,5 @@
 }
 /*}}}*/
-void FemModel::StackTransientOutputx(int* input_enum,int* stackedinput_enum,IssmDouble hydrotime,int numoutputs){ /*{{{*/
+void FemModel::StackTransientOutputx(int* input_enum,int* transientinput_enum,IssmDouble subtime,int numoutputs){ /*{{{*/
 
   for(int i=0;i<numoutputs;i++){
@@ -4773,24 +5115,23 @@
 				/*Intermediaries*/
 				Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(j));
-				TransientInput* stacking_input=NULL;
-				Input* input=element->inputs->GetInput(stackedinput_enum[i]); _assert_(input);
-				Input* input_to_stack=element->GetInput(input_enum[i]); _assert_(input_to_stack);
-				stacking_input=dynamic_cast<TransientInput*>(input);
+				Input* input=element->inputs->GetInput(transientinput_enum[i]); _assert_(input); //this is the enum stack
+				TransientInput* stacking_input=xDynamicCast<TransientInput*>(input);
 
 				int  numvertices = element->GetNumberOfVertices();
 				IssmDouble* N=xNew<IssmDouble>(numvertices);
-				element->GetInputListOnVertices(&N[0],input_enum[i]);
+				element->GetInputListOnVertices(&N[0],input_enum[i]);   //this is the enum to stack
 				switch(element->ObjectEnum()){
 				case TriaEnum:
-					stacking_input->AddTimeInput(new TriaInput(stackedinput_enum[i],&N[0],P1Enum),hydrotime);
+					stacking_input->AddTimeInput(new TriaInput(transientinput_enum[i],&N[0],P1Enum),subtime);
 					break;
 				case PentaEnum:
-					stacking_input->AddTimeInput(new PentaInput(stackedinput_enum[i],&N[0],P1Enum),hydrotime);
+					stacking_input->AddTimeInput(new PentaInput(transientinput_enum[i],&N[0],P1Enum),subtime);
 					break;
 				case TetraEnum:
-					stacking_input->AddTimeInput(new TetraInput(stackedinput_enum[i],&N[0],P1Enum),hydrotime);
+					stacking_input->AddTimeInput(new TetraInput(transientinput_enum[i],&N[0],P1Enum),subtime);
 					break;
 				default: _error_("Not implemented yet");
 				}
+				stacking_input->Configure(parameters);
 				xDelete<IssmDouble>(N);
 			}
@@ -4799,23 +5140,26 @@
 }
 /*}}}*/
-void FemModel::AverageTransientOutputx(int* input_enum,int* averagedinput_enum,IssmDouble init_time,int numoutputs){ /*{{{*/
-
-  for(int i=0;i<numoutputs;i++){
-		if(input_enum[i]<0){
+void FemModel::AverageTransientOutputx(int* transientinput_enum,int* averagedinput_enum,IssmDouble init_time,IssmDouble end_time,int numoutputs){ /*{{{*/
+
+	for(int i=0;i<numoutputs;i++){
+		if(transientinput_enum[i]<0){
 			_error_("Can't deal with non enum fields for result Stack");
 		}
 		else{
-			for(int j=0;j<elements->Size();j++){
-				/*Intermediaries*/
-				Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(j));
-				int  numvertices = element->GetNumberOfVertices();
-				IssmDouble* time_averaged=NULL;
-
-				Input* input=element->inputs->GetInput(input_enum[i]); _assert_(input);
-				TransientInput* stacking_input=NULL;
-				stacking_input=dynamic_cast<TransientInput*>(input);
-				stacking_input->GetInputAverageOnTimes(&time_averaged,init_time);
-
-				element->AddInput(averagedinput_enum[i],&time_averaged[0],P1Enum);
+			for(int j=0;j<this->elements->Size();j++){
+				Element*    element       = xDynamicCast<Element*>(elements->GetObjectByOffset(j));
+				int         numnodes      = element->GetNumberOfNodes();
+				IssmDouble* time_averaged = xNew<IssmDouble>(numnodes);
+				Gauss*      gauss         = element->NewGauss();
+
+				Input*      input         = element->GetInput(transientinput_enum[i]); _assert_(input);
+				TransientInput* transient_input=xDynamicCast<TransientInput*>(input);
+
+				for(int iv=0;iv<numnodes;iv++){
+					gauss->GaussNode(element->FiniteElement(),iv);
+					transient_input->GetInputAverageOverTimeSlice(&time_averaged[iv],gauss,init_time,end_time);
+				}
+				element->AddInput(averagedinput_enum[i],&time_averaged[0],element->GetElementType());
+				delete gauss;
 				xDelete<IssmDouble>(time_averaged);
 			}
@@ -5011,5 +5355,4 @@
 	IssmDouble* x             = NULL;
 	IssmDouble* y             = NULL;
-	IssmDouble* z             = NULL;
 	int* elements             = NULL;
 	IssmDouble hmin,hmax,err,gradation;
@@ -5022,5 +5365,5 @@
 
 	/*Get vertices coordinates of the coarse mesh (father mesh)*/
-	this->GetMesh(this->vertices,this->elements,&x,&y,&z,&elements);
+	this->GetMesh(this->vertices,this->elements,&x,&y,&elements);
 
 	/*Create bamg data structures for bamg*/
@@ -5050,13 +5393,8 @@
 
 	/*Re-create original mesh and put it in bamg structure (only cpu 0)*/
+	this->amrbamg->SetMesh(&elements,&x,&y,&numberofvertices,&numberofelements);
 	if(my_rank==0){
-		this->amrbamg->Initialize(elements,x,y,numberofvertices,numberofelements);
-	}
-
-	/*Free the vectors*/
-	xDelete<IssmDouble>(x);
-	xDelete<IssmDouble>(y);
-	xDelete<IssmDouble>(z);
-	xDelete<int>(elements);
+		this->amrbamg->Initialize();
+	}
 }
 /*}}}*/
@@ -5066,7 +5404,12 @@
 
 	/*Intermediaries*/
-	int numberofvertices			 = this->vertices->NumberOfVertices();
-	IssmDouble* verticedistance = NULL;
+	int numberofvertices			 				= this->vertices->NumberOfVertices();
+   Vector<IssmDouble>* vminvertexdistance = new Vector<IssmDouble>(numberofvertices);
+	IssmDouble* pminvertexdistance 			= NULL;
+	IssmDouble* levelset_points				= NULL;
+	IssmDouble x,y;
 	IssmDouble threshold,resolution;
+	IssmDouble minvertexdistance,distance;
+	int sid,numberofpoints;
 
 	switch(levelset_type){
@@ -5082,11 +5425,32 @@
 	}
 
-	/*Get vertice distance to zero level set points*/
-	this->GetVerticeDistanceToZeroLevelSet(&verticedistance,levelset_type);
-	if(!verticedistance) _error_("verticedistance is NULL!\n");
+	/*Get points which level set is zero (center of elements with zero level set)*/
+   this->GetZeroLevelSetPoints(&levelset_points,numberofpoints,levelset_type);//levelset_points is serial (global)
+
+	for(int i=0;i<this->vertices->Size();i++){//only on this partition
+		Vertex* vertex=(Vertex*)this->vertices->GetObjectByOffset(i);
+      /*Attention: no spherical coordinates*/
+      x	= vertex->GetX();
+      y 	= vertex->GetY();
+      sid= vertex->Sid();
+		minvertexdistance=INFINITY;
+
+		/*Find the minimum vertex distance*/
+		for(int j=0;j<numberofpoints;j++){
+         distance=sqrt((x-levelset_points[2*j])*(x-levelset_points[2*j])+(y-levelset_points[2*j+1])*(y-levelset_points[2*j+1]));
+         minvertexdistance=min(distance,minvertexdistance);
+    	}
+		/*Now, insert in the vector*/
+		vminvertexdistance->SetValue(sid,minvertexdistance,INS_VAL);
+   }
+	/*Assemble*/
+   vminvertexdistance->Assemble();
+
+   /*Assign the pointer*/
+  	pminvertexdistance=vminvertexdistance->ToMPISerial();
 
 	/*Fill hmaxVertices*/
 	for(int i=0;i<numberofvertices;i++){
-		if(verticedistance[i]<threshold){
+		if(pminvertexdistance[i]<threshold){ //hmaxvertices is serial (global)
 			if(xIsNan<IssmDouble>(hmaxvertices[i])) hmaxvertices[i]=resolution;
 			else hmaxvertices[i]=min(resolution,hmaxvertices[i]);
@@ -5095,5 +5459,7 @@
 
 	/*Cleanup*/
-	xDelete<IssmDouble>(verticedistance);
+	xDelete<IssmDouble>(pminvertexdistance);
+   xDelete<IssmDouble>(levelset_points);
+   delete vminvertexdistance;
 }
 /*}}}*/
@@ -5104,12 +5470,12 @@
 	/*Intermediaries*/
 	int elementswidth							= this->GetElementsWidth();
-	int numberofelements						= this->elements->NumberOfElements();
-	int numberofvertices						= this->vertices->NumberOfVertices();
-	IssmDouble* maxlength					= xNew<IssmDouble>(numberofelements);
-	IssmDouble* error_vertices				= xNewZeroInit<IssmDouble>(numberofvertices);
+	int numberofelements						= -1;
+	int numberofvertices						= -1;
+	IssmDouble	hmax							= this->amrbamg->GetBamgOpts()->hmax;
+	IssmDouble* maxlength					= NULL;
+	IssmDouble* error_vertices				= NULL;
 	IssmDouble* error_elements				= NULL;
 	IssmDouble* x								= NULL;
 	IssmDouble* y								= NULL;
-	IssmDouble* z								= NULL;
 	int* index									= NULL;
 	IssmDouble maxerror,threshold,groupthreshold,resolution,length;
@@ -5149,5 +5515,7 @@
 
 	/*Get mesh*/
-	this->GetMesh(this->vertices,this->elements,&x,&y,&z,&index);
+	this->GetMesh(&index,&x,&y,&numberofvertices,&numberofelements);
+	maxlength		= xNew<IssmDouble>(numberofelements);
+	error_vertices	= xNewZeroInit<IssmDouble>(numberofvertices);
 
 	/*Fill error_vertices (this is the sum of all elements connected to the vertex)*/
@@ -5168,20 +5536,24 @@
 	/*Fill hmaxvertices with the criteria*/
 	for(int i=0;i<numberofelements;i++){
-		refine=false;
 		/*Refine any element if its error > phi*maxerror*/
-		if(error_elements[i]>threshold*maxerror) refine=true;
-		/*If the element size is closer to the resolution, verify the sum of error in the vertices*/
-		if(resolution/maxlength[i]>0.85){
+		if(error_elements[i]>threshold*maxerror){
+			/*Now, fill the hmaxvertices if requested*/
 			for(int j=0;j<elementswidth;j++){
 				vid=index[i*elementswidth+j]-1;//Matlab to C indexing
-				if(error_vertices[vid]>groupthreshold*maxerror) refine=true;
-			}
-		}
-		/*Now, fill the hmaxvertices if requested*/
-		if(refine){
-			for(int j=0;j<elementswidth;j++){
-				vid=index[i*elementswidth+j]-1;//Matlab to C indexing
-				if(xIsNan<IssmDouble>(hmaxvertices[vid])) hmaxvertices[vid]=resolution;
-				else hmaxvertices[vid]=min(resolution,hmaxvertices[vid]);
+				if(xIsNan<IssmDouble>(hmaxvertices[vid])) hmaxvertices[vid]=max(maxlength[i]/2.,resolution);//Try first dividing the element
+				else hmaxvertices[vid]=min(max(maxlength[i]/2.,resolution),hmaxvertices[vid]);//Try first dividing the element
+			}
+		}
+		else {
+			/*Try unrefine the element*/
+			if(maxlength[i] < 1.1*hmax/2.){
+				for(int j=0;j<elementswidth;j++){
+					vid=index[i*elementswidth+j]-1;//Matlab to C indexing
+					if(error_vertices[vid]>groupthreshold*maxerror) hmaxvertices[vid]=maxlength[i]; //keep the current resolution
+					else{
+						if(xIsNan<IssmDouble>(hmaxvertices[vid])) hmaxvertices[vid]=min(maxlength[i]*2.,hmax);
+						else hmaxvertices[vid]=min(min(maxlength[i]*2.,hmax),hmaxvertices[vid]);//Try first to duplicate the element
+					}
+				}
 			}
 		}
@@ -5189,8 +5561,4 @@
 
 	/*Cleanup*/
-	xDelete<IssmDouble>(x);
-	xDelete<IssmDouble>(y);
-	xDelete<IssmDouble>(z);
-	xDelete<int>(index);
    xDelete<IssmDouble>(error_elements);
    xDelete<IssmDouble>(error_vertices);
@@ -5199,4 +5567,7 @@
 /*}}}*/
 void FemModel::GetVerticeDistanceToZeroLevelSet(IssmDouble** pverticedistance,int levelset_type){/*{{{*/
+
+	//itapopo esse metodo pode ser deletado
+
 
 	/*Here, "zero level set" means grounding line or ice front, depending on the level set type*/
@@ -5210,14 +5581,16 @@
 
 	/*Intermediaries*/
-   int numberofvertices       = this->vertices->NumberOfVertices();
+   int numberofvertices       = -1;
+	int numberofelements			= -1;
    IssmDouble* levelset_points= NULL;
    IssmDouble* x					= NULL;
    IssmDouble* y					= NULL;
-   IssmDouble* z					= NULL;
+	int* elementslist				= NULL;
 	int numberofpoints;
 	IssmDouble distance;
 
 	/*Get vertices coordinates*/
-	VertexCoordinatesx(&x,&y,&z,this->vertices,false) ;
+	this->GetMesh(&elementslist,&x,&y,&numberofvertices,&numberofelements);
+	//this->GetMeshOnPartition(this->vertices,this->elements,&x,&y,&z,&elementslist,&sidtoindex);
 
 	/*Get points which level set is zero (center of elements with zero level set)*/
@@ -5239,7 +5612,4 @@
 	/*Cleanup*/
    xDelete<IssmDouble>(levelset_points);
-   xDelete<IssmDouble>(x);
-   xDelete<IssmDouble>(y);
-   xDelete<IssmDouble>(z);
 }
 /*}}}*/
@@ -5273,5 +5643,5 @@
 		this->amr->ExecuteRefinement(gl_distance,if_distance,deviatoricerror,thicknesserror,
 												&newdatalist,&newxylist,&newelementslist);
-		if(newdatalist[0]<=0 || newdatalist[1]<=0) _error_("Error in the ReMeshNeopz.");	
+		if(newdatalist[0]<=0 || newdatalist[1]<=0) _error_("Error in the ReMeshNeopz.");
 	}
 
@@ -5322,6 +5692,6 @@
 	IssmDouble* x									= NULL;
 	IssmDouble* y									= NULL;
-	IssmDouble* z									= NULL;
 	int* elements									= NULL;
+	int amr_restart;
 
 	/*Initialize field as NULL for now*/
@@ -5330,5 +5700,5 @@
 	/*Get vertices coordinates of the coarse mesh (father mesh)*/
 	/*elements comes in Matlab indexing*/
-	this->GetMesh(this->vertices,this->elements,&x,&y,&z,&elements);
+	this->GetMesh(this->vertices,this->elements,&x,&y,&elements);
 
 	/*Create initial mesh (coarse mesh) in neopz data structure*/
@@ -5350,13 +5720,15 @@
 	this->parameters->FindParam(&this->amr->deviatoricerror_groupthreshold,AmrDeviatoricErrorGroupThresholdEnum);
 	this->parameters->FindParam(&this->amr->deviatoricerror_maximum,AmrDeviatoricErrorMaximumEnum);
+
+	/*Initialize NeoPZ data structure*/
+	this->amr->SetMesh(&elements,&x,&y,&numberofvertices,&numberofelements);
 	if(my_rank==0){
-		this->amr->CreateInitialMesh(numberofvertices,numberofelements,x,y,elements);
-	}
-
-	/*Free the vectors*/
-	xDelete<IssmDouble>(x);
-	xDelete<IssmDouble>(y);
-	xDelete<IssmDouble>(z);
-	xDelete<int>(elements);
+		this->parameters->FindParam(&amr_restart,AmrRestartEnum);
+		if(amr_restart){//experimental
+			this->amr->ReadMesh();
+		} else {//this is the default method
+			this->amr->Initialize();
+		}
+	}
 }
 /*}}}*/
Index: /issm/trunk/src/c/classes/FemModel.h
===================================================================
--- /issm/trunk/src/c/classes/FemModel.h	(revision 24312)
+++ /issm/trunk/src/c/classes/FemModel.h	(revision 24313)
@@ -11,5 +11,4 @@
 class DataSet;
 class Parameters;
-class NodeSets;
 class Nodes;
 class Vertices;
@@ -41,12 +40,17 @@
 		Profiler*    profiler;             //keep time, cpu and mem statistics while we are running.
 
-		Constraints *constraints;          //one set of constraints. each constraint knows which analysis_type it handles
 		Elements    *elements;             //elements (one set for all analyses)
-		Loads       *loads;                //one set of constraints. each constraint knows which analysis_type it handles
 		Materials   *materials;            //one set of materials, for each element
-		Nodes       *nodes;                //one set of nodes
 		Parameters  *parameters;           //one set of parameters, independent of the analysis_type
 		Results     *results;              //results that cannot be fit into the elements
 		Vertices    *vertices;             //one set of vertices
+
+		/*Analysis dependent datasets*/
+		Constraints  *constraints;
+		Constraints **constraints_list;
+		Loads        *loads;
+		Loads       **loads_list;
+		Nodes        *nodes;
+		Nodes       **nodes_list;
 
 		//FIXME: do we want only one class and have virtual functions? or keep 2 classes, at least rename AdaptiveMeshRefinement -> AmrNeopz
@@ -65,4 +69,5 @@
 
 		/*Methods:*/
+		int  AnalysisIndex(int);
 		void CheckPoint(void);
 		void CleanUp(void);
@@ -84,4 +89,6 @@
 		void CalvingRateVonmisesx();
 		void CalvingRateLevermannx();
+		void CalvingFluxLevelsetx();
+		void CalvingMeltingFluxLevelsetx();
 		void DeviatoricStressx();
 		void Divergencex(IssmDouble* pdiv);
@@ -90,5 +97,14 @@
 		void FloatingAreax(IssmDouble* pV, bool scaled);
 		void GetInputLocalMinMaxOnNodesx(IssmDouble** pmin,IssmDouble** pmax,IssmDouble* ug);
+		void GetLocalVectorWithClonesGset(IssmDouble** plocal_ug,Vector<IssmDouble> *ug);
+		void GetLocalVectorWithClonesVertices(IssmDouble** plocal_vector,Vector<IssmDouble> *vector);
+		void SyncLocalVectorWithClonesVertices(IssmDouble* local_vector);
+		void SyncLocalVectorWithClonesVerticesAdd(IssmDouble* local_vector);
+		void GetLocalVectorWithClonesNodes(IssmDouble** plocal_vector,Vector<IssmDouble> *vector);
 		void GroundedAreax(IssmDouble* pV, bool scaled);
+		void IcefrontAreax();
+		void IcefrontMassFluxx(IssmDouble* presponse, bool scaled);
+		void IcefrontMassFluxLevelsetx(IssmDouble* presponse, bool scaled);
+		void GroundinglineMassFluxx(IssmDouble* presponse, bool scaled);
 		void IceMassx(IssmDouble* pV, bool scaled);
 		void IceVolumex(IssmDouble* pV, bool scaled);
@@ -113,4 +129,7 @@
 		void StrainRateeffectivex();
 		void StressIntensityFactorx();
+		void RignotMeltParameterizationx();
+		void TotalCalvingFluxLevelsetx(IssmDouble* pGbmb, bool scaled);
+		void TotalCalvingMeltingFluxLevelsetx(IssmDouble* pGbmb, bool scaled);
 		void TotalFloatingBmbx(IssmDouble* pFbmb, bool scaled);
 		void TotalGroundedBmbx(IssmDouble* pGbmb, bool scaled);
@@ -135,6 +154,6 @@
 		#endif
 		#ifdef _HAVE_ESA_
-		void EsaGeodetic2D(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pX, Vector<IssmDouble>* pY, IssmDouble* xx, IssmDouble* yy); 
-		void EsaGeodetic3D(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, IssmDouble* latitude, IssmDouble* longitude, IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz); 
+		void EsaGeodetic2D(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pX, Vector<IssmDouble>* pY, IssmDouble* xx, IssmDouble* yy);
+		void EsaGeodetic3D(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, IssmDouble* latitude, IssmDouble* longitude, IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz);
 		#endif
 		#ifdef _HAVE_SEALEVELRISE_
@@ -142,5 +161,5 @@
 		void SealevelriseNonEustatic(Vector<IssmDouble>* pSgo, Vector<IssmDouble>* pSg_old, IssmDouble* latitude, IssmDouble* longitude, IssmDouble* radius,bool verboseconvolution,int loop);
 		void SealevelriseRotationalFeedback(Vector<IssmDouble>* pRSLgo_rot, Vector<IssmDouble>* pRSLg_old, IssmDouble* pIxz, IssmDouble* pIyz, IssmDouble* pIzz, IssmDouble* latitude, IssmDouble* longitude, IssmDouble* radius);
-		void SealevelriseElastic(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pSg_old, IssmDouble* latitude, IssmDouble* longitude, IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz,int loop,int horiz); 
+		void SealevelriseElastic(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, Vector<IssmDouble>* pSg_old, IssmDouble* latitude, IssmDouble* longitude, IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz,int loop,int horiz);
 		IssmDouble SealevelriseOceanAverage(Vector<IssmDouble>* Sg);
 		#endif
@@ -151,7 +170,7 @@
 		void UpdateConstraintsExtrudeFromTopx();
 		void UpdateConstraintsL2ProjectionEPLx(IssmDouble* pL2count);
-		void InitTransientOutputx(int* input_enum, int numoutputs);
-		void StackTransientOutputx(int* input_enum,int* stackedinput_enum, IssmDouble hydrotime, int numoutputs);
-		void AverageTransientOutputx(int* input_enum,int* averagedinput_enum,IssmDouble hydrotime,int numoutputs);
+		void InitTransientOutputx(int* transientinput_enum,int numoutputs);
+		void StackTransientOutputx(int* input_enum,int* transientinput_enum,IssmDouble hydrotime,int numoutputs);
+		void AverageTransientOutputx(int* transientinput_enum,int* averagedinput_enum,IssmDouble init_time,IssmDouble end_time,int numoutputs);
 		void UpdateConstraintsx(void);
 		int  UpdateVertexPositionsx(void);
@@ -168,16 +187,15 @@
 		void BedrockFromMismipPlus(void);
 		void AdjustBaseThicknessAndMask(void);
-		void GetMesh(Vertices* femmodel_vertices,Elements* femmodel_elements,IssmDouble** px, IssmDouble** py, IssmDouble** pz, int** pelementslist);
+		void GetMesh(Vertices* femmodel_vertices,Elements* femmodel_elements,IssmDouble** px, IssmDouble** py, int** pelementslist);
+		void GetMesh(int** elementslist, IssmDouble** x, IssmDouble** y, int* numberofvertices, int* numberofelements);
+		void SetMesh(int** elementslist, IssmDouble** x, IssmDouble** y, int* numberofvertices, int* numberofelements);
 		void GetMeshOnPartition(Vertices* femmodel_vertices,Elements* femmodel_elements,IssmDouble** px, IssmDouble** py, IssmDouble** pz, int** pelementslist,int** psidtoindex);
 		void GetGroundediceLevelSet(IssmDouble** pmasklevelset);
-		void CreateVertices(int newnumberofvertices,int newnumberofelements,int elementswidth,int* newelementslist,int* my_vertices,IssmDouble* newx,IssmDouble* newy,IssmDouble* newz,Vertices* vertices);
 		void CreateElements(int newnumberofelements,int elementswidth,int* newelementslist,bool* my_elements,Elements* elements);
 		void CreateMaterials(int newnumberofelements,bool* my_elements,Materials* materials);
-		void CreateNodes(int newnumberofvertices,int* my_vertices,int nodecounter,int analysis_enum,Nodes* nodes);
-		void CreateConstraints(Vertices* newfemmodel_vertices,int nodecounter,int constraintcounter,int analysis_enum,Constraints* newfemmodel_constraints);
+		void CreateConstraints(Vertices* newfemmodel_vertices,int analysis_enum,Constraints* newfemmodel_constraints);
 		void GetInputs(int* pnumP0inputs,IssmDouble** pP0inputs,int** pP0input_enums,int** pP0input_interp,int* pnumP1inputs,IssmDouble** pP1inputs,int** pP1input_enums,int** pP1input_interp);
 		void InterpolateInputs(Vertices* newfemmodel_vertices,Elements* newfemmodel_elements);
-		void UpdateElements(int newnumberofelements,int* newelementslist,bool* my_elements,int nodecounter,int analysis_counter,Elements* newelements);
-		void ElementsAndVerticesPartitioning(int& newnumberofvertices,int& newnumberofelements,int& elementswidth,int* newelementslist,bool** pmy_elements,int** pmy_vertices);
+		void UpdateElements(int newnumberofelements,int* newelementslist,bool* my_elements,int analysis_counter,Elements* newelements);
 		void WriteMeshInResults(void);
 		void WriteErrorEstimatorsInResults(void);
Index: /issm/trunk/src/c/classes/Inputs/BoolInput.cpp
===================================================================
--- /issm/trunk/src/c/classes/Inputs/BoolInput.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/BoolInput.cpp	(revision 24313)
@@ -153,4 +153,27 @@
 }
 /*}}}*/
+void BoolInput::PointwiseMult(Input* xinput){/*{{{*/
+	/*That would compare to a AND operation*/
+	BoolInput* xboolinput=NULL;
+
+	/*xinput is of the same type, so cast it: */
+	xboolinput=(BoolInput*)xinput;
+
+	/*Carry out the PointwiseMult operation depending on type:*/
+	switch(xinput->ObjectEnum()){
+
+		case BoolInputEnum:
+			this->value=reCast<bool,IssmDouble>(this->value=this->value*xboolinput->value);
+			return;
+
+		default:
+			_error_("not implemented yet");
+	}
+}
+/*}}}*/
+void BoolInput::Pow(IssmDouble exponent){/*{{{*/
+	/* no power for Bools*/
+}
+/*}}}*/
 void BoolInput::Scale(IssmDouble scale_factor){/*{{{*/
 	/*a bool cannot be scaled: */
Index: /issm/trunk/src/c/classes/Inputs/BoolInput.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/BoolInput.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/BoolInput.h	(revision 24313)
@@ -1,3 +1,3 @@
-/*! \file BoolInput.h 
+/*! \file BoolInput.h
  *  \brief: header file for triavertexinput object
  */
@@ -44,9 +44,9 @@
 		void ChangeEnum(int newenumtype);
 		void Extrude(int start);
-		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
 		void GetInputAverage(IssmDouble* pvalue);
+		void GetInputAveragesOnAllTime(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, Gauss* gauss){_error_("not implemented yet");};
 		void GetInputDerivativeAverageValue(IssmDouble* derivativevalues, IssmDouble* xyz_list){_error_("not implemented yet");};
-		void GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){_error_("not implemented yet");};
+		void GetInputAveragesUpToCurrentTime(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){_error_("not implemented yet");};
 		void GetInputValue(bool* pvalue);
 		void GetInputValue(int* pvalue);
@@ -61,6 +61,7 @@
 		IssmDouble Min(void){_error_("Min not implemented for booleans");};
 		IssmDouble MinAbs(void){_error_("Min not implemented for booleans");};
+		void PointwiseMult(Input* xinput);
+		void Pow(IssmDouble exponent);
 		void Scale(IssmDouble scale_factor);
-		void Set(IssmDouble setvalue){_error_("Set not implemented yet");};
 		/*}}}*/
 
Index: /issm/trunk/src/c/classes/Inputs/ControlInput.cpp
===================================================================
--- /issm/trunk/src/c/classes/Inputs/ControlInput.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/ControlInput.cpp	(revision 24313)
@@ -253,4 +253,7 @@
 }
 /*}}}*/
+void ControlInput::PointwiseMult(Input* xinput){/*{{{*/
+	values->PointwiseMult(xinput);
+}/*}}}*/
 void ControlInput::SaveValue(void){/*{{{*/
 	if(!values) _error_("Values of " << EnumToStringx(this->enum_type) << " not found");
Index: /issm/trunk/src/c/classes/Inputs/ControlInput.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/ControlInput.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/ControlInput.h	(revision 24313)
@@ -1,3 +1,3 @@
-/*! \file ControlInput.h 
+/*! \file ControlInput.h
  *  \brief: header file for triavertexinput object
  */
@@ -35,5 +35,5 @@
 		void  DeepEcho();
 		void  Echo();
-		int   Id(); 
+		int   Id();
 		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
 		int   ObjectEnum();
@@ -52,9 +52,9 @@
 		void GetGradient(Vector<IssmDouble>* gradient_vec,int* doflist);
 		void GetGradientValue(IssmDouble* pvalue,Gauss* gauss);
-		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
+		void GetInputAveragesOnAllTime(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
 		void GetInputAverage(IssmDouble* pvalue);
 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list,Gauss* gauss);
 		void GetInputDerivativeAverageValue(IssmDouble* derivativevalues, IssmDouble* xyz_list){_error_("not implemented yet");};
-		void GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){_error_("not implemented yet");};
+		void GetInputAveragesUpToCurrentTime(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){_error_("not implemented yet");};
 		void GetInputValue(bool* pvalue);
 		void GetInputValue(int* pvalue);
@@ -75,6 +75,7 @@
 		void ResultToPatch(IssmDouble* values,int nodesperelement,int sid){_error_("not supported yet");};
 		void SaveValue(void);
+		void PointwiseMult(Input* xinput);
+		void Pow(IssmDouble exponent){_error_("not implemented yet");};
 		void Scale(IssmDouble scale_factor){_error_("not implemented yet");};
-		void Set(IssmDouble setvalue){_error_("Set not implemented yet");};
 		void SetGradient(Input* gradient_in,int timestep);
 		void SetGradient(Input* gradient_in);
Index: /issm/trunk/src/c/classes/Inputs/DatasetInput.cpp
===================================================================
--- /issm/trunk/src/c/classes/Inputs/DatasetInput.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/DatasetInput.cpp	(revision 24313)
@@ -73,5 +73,5 @@
 	MARSHALLING(enum_type);
 	MARSHALLING(numids);
-	MARSHALLING_DYNAMIC(ids,int,numids)
+	MARSHALLING_DYNAMIC(ids,int,numids);
 	if (marshall_direction == MARSHALLING_BACKWARD) inputs = new Inputs();
 	inputs->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
@@ -157,5 +157,10 @@
 /*Object functions*/
 void DatasetInput::Configure(Parameters* parameters){/*{{{*/
-	/*do nothing: */
+
+	for(int i=0;i<this->numids;i++){
+		Input* input=xDynamicCast<Input*>(this->inputs->GetObjectByOffset(i));
+		input->Configure(parameters);
+	}
+
 }
 /*}}}*/
Index: /issm/trunk/src/c/classes/Inputs/DatasetInput.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/DatasetInput.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/DatasetInput.h	(revision 24313)
@@ -1,3 +1,3 @@
-/*! \file DatasetInput.h 
+/*! \file DatasetInput.h
  *  \brief: header file for datasetinput object
  */
@@ -47,5 +47,5 @@
 		void Extrude(int start){_error_("not implemented yet");};
 		void GetGradient(Vector<IssmDouble>* gradient_vec,int* doflist){_error_("not implemented yet");};
-		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
+		void GetInputAveragesOnAllTime(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
 		void GetInputAverage(IssmDouble* pvalue){_error_("not implemented yet");};
 		void GetInputDerivativeAverageValue(IssmDouble* derivativevalues, IssmDouble* xyz_list){_error_("not implemented yet");};
@@ -57,5 +57,5 @@
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss,IssmDouble time){_error_("not implemented yet");};
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss ,int index);
-		void GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){_error_("not implemented yet");};
+		void GetInputAveragesUpToCurrentTime(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){_error_("not implemented yet");};
 		int  GetInputInterpolationType(){_error_("not implemented yet!");};
 		int GetResultArraySize(void){_error_("not implemented yet");};
@@ -69,6 +69,7 @@
 		void ResultToPatch(IssmDouble* values,int nodesperelement,int sid){_error_("not supported yet");};
 		void SaveValue(void){_error_("not implemented yet");};
+		void PointwiseMult(Input* xinput){_error_("not implemented yet");};
+		void Pow(IssmDouble exponent){_error_("not implemented yet");};
 		void Scale(IssmDouble scale_factor){_error_("not implemented yet");};
-		void Set(IssmDouble setvalue){_error_("Set not implemented yet");};
 		void SetGradient(Input* gradient_in){_error_("not implemented yet");};
 		void UpdateValue(IssmDouble scalar){_error_("not implemented yet");};
Index: /issm/trunk/src/c/classes/Inputs/DoubleArrayInput.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/DoubleArrayInput.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/DoubleArrayInput.h	(revision 24313)
@@ -1,3 +1,3 @@
-/*! \file DoubleArrayInput.h 
+/*! \file DoubleArrayInput.h
  *  \brief: header file for vector type input object
  */
@@ -27,5 +27,5 @@
 		void  DeepEcho();
 		void  Echo();
-		int   Id(); 
+		int   Id();
 		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
 		int   ObjectEnum();
@@ -46,5 +46,5 @@
 		void ChangeEnum(int newenumtype);
 		void Extrude(int start){_error_("not supported yet");};
-		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
+		void GetInputAveragesOnAllTime(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
 		void GetInputAverage(IssmDouble* pvalue){_error_("not implemented yet");};
 		void GetInputDerivativeAverageValue(IssmDouble* derivativevalues, IssmDouble* xyz_list){_error_("not implemented yet");};
@@ -56,5 +56,5 @@
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss,IssmDouble time){_error_("not implemented yet");};
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss ,int index){_error_("not implemented yet");};
-		void GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){_error_("not implemented yet");};
+		void GetInputAveragesUpToCurrentTime(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){_error_("not implemented yet");};
 		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){_error_("not implemented yet");};
 		int  GetInputInterpolationType(){_error_("not implemented yet!");};
@@ -63,6 +63,7 @@
 		IssmDouble Min(void){_error_("not implemented yet");};
 		IssmDouble MinAbs(void){_error_("not implemented yet");};
+		void PointwiseMult(Input* xinput){_error_("not implemented yet");};
+		void Pow(IssmDouble exponent){_error_("not implemented yet");};
 		void Scale(IssmDouble scale_factor){_error_("not implemented yet");};
-		void Set(IssmDouble setvalue){_error_("Set not implemented yet");};
 		/*}}}*/
 
Index: /issm/trunk/src/c/classes/Inputs/DoubleInput.cpp
===================================================================
--- /issm/trunk/src/c/classes/Inputs/DoubleInput.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/DoubleInput.cpp	(revision 24313)
@@ -171,4 +171,61 @@
 }
 /*}}}*/
+void DoubleInput::PointwiseMult(Input* xinput){/*{{{*/
+
+	DoubleInput* xIssmDoubleinput=NULL;
+
+
+	/*xinput is of the same type, so cast it: */
+	xIssmDoubleinput=(DoubleInput*)xinput;
+
+	switch(xinput->ObjectEnum()){
+
+		case DoubleInputEnum:
+			this->value=this->value*xIssmDoubleinput->value;
+			return;
+
+		default:
+			_error_("not implemented yet");
+	}
+}
+/*}}}*/
+void DoubleInput::Pow(IssmDouble exponent){/*{{{*/
+
+	if(exponent==0.0){
+		/*  Not-a-number left alone Infinity set to one  */
+		if (value==value)value=1.0;
+	}
+	else if(exponent==0.5){
+		if(value>=0){
+			value=sqrt(value);
+		}
+		else{
+			value=INFINITY;
+		}
+	}
+	else if(exponent==1.0){
+		/* do nothing */
+	}
+	else if(exponent==-0.5){
+		if(value>=0){
+			value=1.0/sqrt(value);
+		}
+		else{
+			value=INFINITY;
+		}
+	}
+	else if(exponent==-1.0){
+		if(value!=0.){
+			value=1.0/value;
+		}
+		else{
+			value=INFINITY;
+		}
+	}
+	else {
+		value=pow(value,exponent);
+	}
+}
+/*}}}*/
 void DoubleInput::Scale(IssmDouble scale_factor){/*{{{*/
 	value=value*scale_factor;
Index: /issm/trunk/src/c/classes/Inputs/DoubleInput.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/DoubleInput.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/DoubleInput.h	(revision 24313)
@@ -1,3 +1,3 @@
-/*! \file DoubleInput.h 
+/*! \file DoubleInput.h
  *  \brief: header file for triavertexinput object
  */
@@ -28,5 +28,5 @@
 		void  DeepEcho();
 		void  Echo();
-		int   Id(); 
+		int   Id();
 		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
 		int   ObjectEnum();
@@ -47,5 +47,5 @@
 		void ChangeEnum(int newenumtype);
 		void Extrude(int start){_error_("not supported yet");};
-		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
+		void GetInputAveragesOnAllTime(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
 		void GetInputAverage(IssmDouble* pvalue);
 		void GetInputDerivativeAverageValue(IssmDouble* derivativevalues, IssmDouble* xyz_list){_error_("not implemented yet");};
@@ -57,5 +57,5 @@
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss,IssmDouble time){_error_("not implemented yet");};
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss ,int index){_error_("not implemented yet");};
-		void GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){_error_("not implemented yet");};
+		void GetInputAveragesUpToCurrentTime(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){_error_("not implemented yet");};
 		int  GetInputInterpolationType(){return P0Enum; };
 		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
@@ -64,6 +64,7 @@
 		IssmDouble Min(void);
 		IssmDouble MinAbs(void);
+		void PointwiseMult(Input* xinput);
+		void Pow(IssmDouble exponent);
 		void Scale(IssmDouble scale_factor);
-		void Set(IssmDouble setvalue){_error_("Set not implemented yet");};
 		/*}}}*/
 
Index: /issm/trunk/src/c/classes/Inputs/Input.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/Input.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/Input.h	(revision 24313)
@@ -1,5 +1,5 @@
 /*!\file:  Input.h
  * \brief abstract class for Input object
- */ 
+ */
 
 #ifndef _INPUT_H_
@@ -21,5 +21,5 @@
 class Input: public Object{
 
-	public: 
+	public:
 
 		virtual        ~Input(){};
@@ -27,5 +27,5 @@
 		virtual void ChangeEnum(int newenumtype)=0;
 		virtual void Configure(Parameters* parameters)=0;
-		virtual void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes)=0;
+		virtual void GetInputAveragesOnAllTime(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes)=0;
 		virtual void GetInputAverage(IssmDouble* pvalue)=0;
 		virtual void GetInputDerivativeAverageValue(IssmDouble* derivativevalues, IssmDouble* xyz_list)=0;
@@ -38,6 +38,6 @@
 		virtual void GetInputValue(IssmDouble* pvalue,Gauss* gauss,int index)=0;
 		virtual int  GetInputInterpolationType()=0;
-		virtual void GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime)=0;
-		virtual int  InstanceEnum()=0; 
+		virtual void GetInputAveragesUpToCurrentTime(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime)=0;
+		virtual int  InstanceEnum()=0;
 
 		virtual void   AXPY(Input* xinput,IssmDouble scalar)=0;
@@ -48,6 +48,7 @@
 		virtual IssmDouble Min(void)=0;
 		virtual IssmDouble MinAbs(void)=0;
+		virtual void   PointwiseMult(Input* xinput)=0;
+		virtual void   Pow(IssmDouble exponent)=0;
 		virtual void   Scale(IssmDouble scale_factor)=0;
-		virtual void   Set(IssmDouble setvalue)=0;
 
 		virtual int  GetResultArraySize(void)=0;
@@ -57,5 +58,5 @@
 		virtual Input* SpawnTriaInput(int index1,int index2,int index3)=0;
 		virtual void ResultToMatrix(IssmDouble* values,int ncols,int sid){_error_("not supported yet");};
-		virtual void ResultToPatch(IssmDouble* values,int nodesperelement,int sid){_error_("not supported yet");}; 
+		virtual void ResultToPatch(IssmDouble* values,int nodesperelement,int sid){_error_("not supported yet");};
 };
 #endif
Index: /issm/trunk/src/c/classes/Inputs/Inputs.cpp
===================================================================
--- /issm/trunk/src/c/classes/Inputs/Inputs.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/Inputs.cpp	(revision 24313)
@@ -33,4 +33,7 @@
 	_assert_(in_input); 
 	int enum_name = in_input->InstanceEnum();
+	#ifdef _ISSM_DEBUG_
+	if(!IsInputEnum(enum_name)) _error_("Enum \""<<EnumToStringx(enum_name)<<"\" is not placed properly in EnumDefinitions.h");
+	 #endif
 
 	/*Go through current inputs*/
@@ -57,4 +60,6 @@
 	/*Delete input if it already exists*/
 	this->DeleteInput(newenumtype);
+	_assert_(IsInputEnum(oldenumtype));
+	_assert_(IsInputEnum(newenumtype));
 
 	/*Go through current inputs*/
@@ -237,5 +242,5 @@
 
 	/*Go through inputs and call Spawn function*/
-	for ( object=objects.begin() ; object < objects.end(); object++ ){
+	for(object=objects.begin() ; object < objects.end(); object++ ){
 
 		/*Create new input*/
Index: /issm/trunk/src/c/classes/Inputs/Inputs.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/Inputs.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/Inputs.h	(revision 24313)
@@ -29,5 +29,4 @@
 		Input*      GetInput(int enum_name);
 		void        GetInputAverage(IssmDouble* pvalue, int enum_type);
-		void        GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
 		void        GetInputValue(bool* pvalue,int enum_type);
 		void        GetInputValue(int* pvalue,int enum_type);
@@ -39,5 +38,4 @@
 		Inputs*     SpawnSegInputs(int index1,int index2);
 		Inputs*     SpawnSegInputs(int position);
-		Inputs*     SpawnTriaInputs(int position);//TO BE REMOVED (replaced by the other one)
 		Inputs*     SpawnTriaInputs(int index1,int index2,int index3);
 
Index: /issm/trunk/src/c/classes/Inputs/IntInput.cpp
===================================================================
--- /issm/trunk/src/c/classes/Inputs/IntInput.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/IntInput.cpp	(revision 24313)
@@ -149,4 +149,66 @@
 }
 /*}}}*/
+void IntInput::PointwiseMult(Input* xinput){/*{{{*/
+
+	IssmDouble dvalue;
+	IntInput* xintinput=NULL;
+
+	/*xinput is of the same type, so cast it: */
+	xintinput=(IntInput*)xinput;
+
+	/*Carry out the PointwiseMult operation depending on type:*/
+	switch(xinput->ObjectEnum()){
+
+		case IntInputEnum:
+			dvalue=(IssmDouble)this->value*(IssmDouble)xintinput->value;
+			this->value=reCast<int>(dvalue);
+			return;
+
+		default:
+			_error_("not implemented yet");
+	}
+}
+/*}}}*/
+void IntInput::Pow(IssmDouble exponent){/*{{{*/
+
+	IssmDouble dvalue;
+
+	if(exponent==0.0){
+		/*  Not-a-number left alone Infinity set to one  */
+		if (dvalue==dvalue)dvalue=1.0;
+	}
+	else if(exponent==0.5){
+		if(dvalue>=0){
+			dvalue=sqrt(dvalue);
+		}
+		else{
+			dvalue=INFINITY;
+		}
+	}
+	else if(exponent==1.0){
+		/* do nothing */
+	}
+	else if(exponent==-0.5){
+		if(dvalue>=0){
+			dvalue=1.0/sqrt(dvalue);
+		}
+		else{
+			dvalue=INFINITY;
+		}
+	}
+	else if(exponent==-1.0){
+		if(dvalue!=0.){
+			dvalue=1.0/dvalue;
+		}
+		else{
+			dvalue=INFINITY;
+		}
+	}
+	else {
+		dvalue=pow(dvalue,exponent);
+	}
+	value=reCast<int>(dvalue);
+}
+/*}}}*/
 void IntInput::Scale(IssmDouble scale_factor){/*{{{*/
 	IssmDouble dvalue=(IssmDouble)value*scale_factor;
Index: /issm/trunk/src/c/classes/Inputs/IntInput.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/IntInput.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/IntInput.h	(revision 24313)
@@ -1,3 +1,3 @@
-/*! \file IntInput.h 
+/*! \file IntInput.h
  *  \brief: header file for triavertexinput object
  */
@@ -29,5 +29,5 @@
 		void  DeepEcho();
 		void  Echo();
-		int   Id(); 
+		int   Id();
 		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
 		int   ObjectEnum();
@@ -48,5 +48,5 @@
 		void ChangeEnum(int newenumtype);
 		void Extrude(int start){_error_("not supported yet");};
-		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
+		void GetInputAveragesOnAllTime(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
 		void GetInputAverage(IssmDouble* pvalue);
 		void GetInputDerivativeAverageValue(IssmDouble* derivativevalues, IssmDouble* xyz_list){_error_("not implemented yet");};
@@ -58,5 +58,5 @@
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss,IssmDouble time){_error_("not implemented yet");};
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss ,int index){_error_("not implemented yet");};
-		void GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){_error_("not implemented yet");};
+		void GetInputAveragesUpToCurrentTime(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){_error_("not implemented yet");};
 		int  GetInputInterpolationType(){_error_("not implemented yet!");};
 		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
@@ -65,6 +65,7 @@
 		IssmDouble Min(void){_error_("Min not implemented for integers");};
 		IssmDouble MinAbs(void){_error_("Min not implemented for integers");};
+		void PointwiseMult(Input* xinput);
+		void Pow(IssmDouble exponent);
 		void Scale(IssmDouble scale_factor);
-		void Set(IssmDouble setvalue){_error_("Set not implemented yet");};
 		/*}}}*/
 
Index: /issm/trunk/src/c/classes/Inputs/PentaInput.cpp
===================================================================
--- /issm/trunk/src/c/classes/Inputs/PentaInput.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/PentaInput.cpp	(revision 24313)
@@ -126,10 +126,10 @@
 	TriaInput* outinput=NULL;
 
-	if(this->interpolation_type==P0Enum){ 
+	if(this->interpolation_type==P0Enum){
 		outinput=new TriaInput(this->enum_type,&this->values[0],P0Enum);
 	}
 	else{
 		/*Assume P1 interpolation only for now*/
-		IssmDouble newvalues[3]; 
+		IssmDouble newvalues[3];
 
 		/*Create array of indices depending on location (0=base 1=surface)*/
@@ -319,4 +319,72 @@
 }
 /*}}}*/
+void PentaInput::PointwiseMult(Input* xinput){/*{{{*/
+
+	const int numnodes=this->NumberofNodes(this->interpolation_type);
+	PentaInput* xpentainput=NULL;
+
+	/*If xinput is a ControlInput, take its values directly*/
+	if(xinput->ObjectEnum()==ControlInputEnum){
+		xinput=((ControlInput*)xinput)->values;
+	}
+
+	/*xinput is of the same type, so cast it: */
+	if(xinput->ObjectEnum()!=PentaInputEnum)
+	  _error_("Operation not permitted because xinput is of type " << EnumToStringx(xinput->ObjectEnum()));
+	xpentainput=(PentaInput*)xinput;
+	if(xpentainput->interpolation_type!=this->interpolation_type) _error_("Operation not permitted because xinput is of type " << EnumToStringx(xpentainput->interpolation_type));
+
+	/*Carry out the PointwiseMult operation depending on type:*/
+	for(int i=0;i<numnodes;i++)this->values[i]=this->values[i]*xpentainput->values[i];
+
+}
+/*}}}*/
+void PentaInput::Pow(IssmDouble exponent){/*{{{*/
+
+	const int numnodes=this->NumberofNodes(this->interpolation_type);
+	if(exponent==0.0){
+		/*  Not-a-number left alone Infinity set to one  */
+		for(int i=0;i<numnodes;i++){
+			if (this->values[i]==this->values[i])this->values[i]=1.0;
+		}
+	}
+	else if(exponent==0.5){
+		for(int i=0;i<numnodes;i++){
+			if(this->values[i]>=0){
+				this->values[i]=sqrt(this->values[i]);
+			}
+			else{
+				this->values[i]=INFINITY;
+			}
+		}
+	}
+	else if(exponent==1.0){
+		/* do nothing */
+	}
+	else if(exponent==-0.5){
+		for(int i=0;i<numnodes;i++){
+			if(this->values[i]>=0){
+				this->values[i]=1.0/sqrt(this->values[i]);
+			}
+			else{
+				this->values[i]=INFINITY;
+			}
+		}
+	}
+	else if(exponent==-1.0){
+		for(int i=0;i<numnodes;i++){
+			if(this->values[i]!=0.){
+				this->values[i]=1.0/this->values[i];
+			}
+			else{
+				this->values[i]=INFINITY;
+			}
+		}
+	}
+	else {
+		for(int i=0;i<numnodes;i++)this->values[i]=pow(this->values[i],exponent);
+	}
+}
+/*}}}*/
 void PentaInput::Scale(IssmDouble scale_factor){/*{{{*/
 
Index: /issm/trunk/src/c/classes/Inputs/PentaInput.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/PentaInput.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/PentaInput.h	(revision 24313)
@@ -1,3 +1,3 @@
-/*! \file PentaInput.h 
+/*! \file PentaInput.h
  *  \brief: header file for PentaInput object
  */
@@ -46,5 +46,5 @@
 		void ChangeEnum(int newenumtype);
 		void Extrude(int start);
-		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
+		void GetInputAveragesOnAllTime(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
 		void GetInputAverage(IssmDouble* pvalue);
 		void GetInputDerivativeAverageValue(IssmDouble* derivativevalues, IssmDouble* xyz_list){_error_("not implemented yet");};
@@ -56,5 +56,5 @@
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss,IssmDouble time){_error_("not implemented yet");};
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss ,int index){_error_("not implemented yet");};
-		void GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){_error_("not implemented yet");};
+		void GetInputAveragesUpToCurrentTime(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){_error_("not implemented yet");};
 		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
 		int  GetInputInterpolationType(){_error_("not implemented yet!");};
@@ -63,6 +63,7 @@
 		IssmDouble Min(void);
 		IssmDouble MinAbs(void);
+		void PointwiseMult(Input* xinput);
+		void Pow(IssmDouble exponent);
 		void Scale(IssmDouble scale_factor);
-		void Set(IssmDouble setvalue){_error_("Set not implemented yet");};
 		Input* SpawnTriaInput(int index1,int index2,int index3);
 		Input* SpawnSegInput(int index1,int index2);
Index: /issm/trunk/src/c/classes/Inputs/SegInput.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/SegInput.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/SegInput.h	(revision 24313)
@@ -1,3 +1,3 @@
-/*! \file SegInput.h 
+/*! \file SegInput.h
  *  \brief: header file for SegInput object
  */
@@ -49,5 +49,5 @@
 		void ChangeEnum(int newenumtype){_error_("not implemented yet");};
 		void Extrude(int start){_error_("not supported yet");};
-		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
+		void GetInputAveragesOnAllTime(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){_error_("not implemented yet");};
 		void GetInputAverage(IssmDouble* pvalue);
 		void GetInputDerivativeAverageValue(IssmDouble* derivativevalues, IssmDouble* xyz_list){_error_("not implemented yet");};
@@ -59,5 +59,5 @@
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss,IssmDouble time){_error_("not implemented yet");};
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss ,int index){_error_("not implemented yet");};
-		void GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){_error_("not implemented yet");};
+		void GetInputAveragesUpToCurrentTime(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){_error_("not implemented yet");};
 		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){_error_("not implemented yet");};
 		int  GetInputInterpolationType(){_error_("not implemented yet!");};
@@ -66,6 +66,7 @@
 		IssmDouble Min(void);
 		IssmDouble MinAbs(void){_error_("not implemented yet");};
+		void PointwiseMult(Input* xinput){_error_("not implemented yet");};
+		void Pow(IssmDouble exponent){_error_("not implemented yet");};
 		void Scale(IssmDouble scale_factor){_error_("not implemented yet");};
-		void Set(IssmDouble setvalue){_error_("not implemented yet");};
 
 };
Index: /issm/trunk/src/c/classes/Inputs/TetraInput.cpp
===================================================================
--- /issm/trunk/src/c/classes/Inputs/TetraInput.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/TetraInput.cpp	(revision 24313)
@@ -122,5 +122,5 @@
 }
 /*}}}*/
-void TetraInput::GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){/*{{{*/
+void TetraInput::GetInputAveragesOnAllTime(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){/*{{{*/
 
 	IssmDouble* outvalues=NULL;
@@ -160,5 +160,5 @@
 }
 /*}}}*/
-void TetraInput::GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){/*{{{*/
+void TetraInput::GetInputAveragesUpToCurrentTime(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){/*{{{*/
 
 	IssmDouble* outvalues=NULL;
@@ -192,10 +192,10 @@
 	TriaInput* outinput=NULL;
 
-	if(this->interpolation_type==P0Enum){ 
+	if(this->interpolation_type==P0Enum){
 		outinput=new TriaInput(this->enum_type,&this->values[0],P0Enum);
 	}
 	else{
 		/*Assume P1 interpolation only for now*/
-		IssmDouble newvalues[3]; 
+		IssmDouble newvalues[3];
 
 		/*Create array of indices depending on location (0=base 1=surface)*/
@@ -286,4 +286,66 @@
 }
 /*}}}*/
+void TetraInput::PointwiseMult(Input* xinput){/*{{{*/
+
+	const int numnodes=this->NumberofNodes(this->interpolation_type);
+	TetraInput* xtetrainput=NULL;
+
+	/*xinput is of the same type, so cast it: */
+	if(xinput->ObjectEnum()!=TetraInputEnum) _error_("Operation not permitted because xinput is of type " << EnumToStringx(xinput->ObjectEnum()));
+	xtetrainput=(TetraInput*)xinput;
+	if(xtetrainput->interpolation_type!=this->interpolation_type) _error_("Operation not permitted because xinput is of type " << EnumToStringx(xtetrainput->interpolation_type));
+
+	/*Carry out the PointwiseMult operation depending on type:*/
+	for(int i=0;i<numnodes;i++)this->values[i]=this->values[i]*xtetrainput->values[i];
+
+}
+/*}}}*/
+void TetraInput::Pow(IssmDouble exponent){/*{{{*/
+
+	const int numnodes=this->NumberofNodes(this->interpolation_type);
+	if(exponent==0.0){
+		/*  Not-a-number left alone Infinity set to one  */
+		for(int i=0;i<numnodes;i++){
+			if (this->values[i]==this->values[i])this->values[i]=1.0;
+		}
+	}
+	else if(exponent==0.5){
+		for(int i=0;i<numnodes;i++){
+			if(this->values[i]>=0){
+				this->values[i]=sqrt(this->values[i]);
+			}
+			else{
+				this->values[i]=INFINITY;
+			}
+		}
+	}
+	else if(exponent==1.0){
+		/* do nothing */
+	}
+	else if(exponent==-0.5){
+		for(int i=0;i<numnodes;i++){
+			if(this->values[i]>=0){
+				this->values[i]=1.0/sqrt(this->values[i]);
+			}
+			else{
+				this->values[i]=INFINITY;
+			}
+		}
+	}
+	else if(exponent==-1.0){
+		for(int i=0;i<numnodes;i++){
+			if(this->values[i]!=0.){
+				this->values[i]=1.0/this->values[i];
+			}
+			else{
+				this->values[i]=INFINITY;
+			}
+		}
+	}
+	else {
+		for(int i=0;i<numnodes;i++)this->values[i]=pow(this->values[i],exponent);
+	}
+}
+/*}}}*/
 void TetraInput::Scale(IssmDouble scale_factor){/*{{{*/
 
@@ -292,8 +354,2 @@
 }
 /*}}}*/
-void TetraInput::Set(IssmDouble setvalue){/*{{{*/
-
-	const int numnodes=this->NumberofNodes(this->interpolation_type);
-	for(int i=0;i<numnodes;i++)values[i]=setvalue;
-}
-/*}}}*/
Index: /issm/trunk/src/c/classes/Inputs/TetraInput.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/TetraInput.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/TetraInput.h	(revision 24313)
@@ -1,3 +1,3 @@
-/*! \file TetraInput.h 
+/*! \file TetraInput.h
  *  \brief: header file for TetraInput object
  */
@@ -49,5 +49,5 @@
 		void ChangeEnum(int newenumtype);
 		void Extrude(int start){_error_("not supported yet");};
-		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes);
+		void GetInputAveragesOnAllTime(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes);
 		void GetInputAverage(IssmDouble* pvalue);
 		void GetInputDerivativeAverageValue(IssmDouble* derivativevalues, IssmDouble* xyz_list){_error_("not implemented yet");};
@@ -59,5 +59,5 @@
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss,IssmDouble time){_error_("not implemented yet");};
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss,int index){_error_("not implemented yet");};
-		void GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime);
+		void GetInputAveragesUpToCurrentTime(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime);
 		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
 		int  GetInputInterpolationType(){_error_("not implemented yet!");};
@@ -66,6 +66,7 @@
 		IssmDouble Min(void);
 		IssmDouble MinAbs(void);
+		void PointwiseMult(Input* xinput);
+		void Pow(IssmDouble exponent);
 		void Scale(IssmDouble scale_factor);
-		void Set(IssmDouble setvalue);
 
 };
Index: /issm/trunk/src/c/classes/Inputs/TransientInput.cpp
===================================================================
--- /issm/trunk/src/c/classes/Inputs/TransientInput.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/TransientInput.cpp	(revision 24313)
@@ -60,4 +60,39 @@
 }
 /*}}}*/
+void TransientInput::AddTimeInput(Input* input,IssmDouble time){/*{{{*/
+
+	/*insert values at time step: */
+	if (this->numtimesteps>0 && time<=this->timesteps[this->numtimesteps-1]) _error_("timestep values must increase sequentially");
+
+	//copy timesteps, add the new time, delete previous timesteps, and add the new input: inputs->AddObject(input);
+	IssmDouble* old_timesteps=NULL;
+
+	if (this->numtimesteps > 0){
+		old_timesteps=xNew<IssmDouble>(this->numtimesteps);
+		xMemCpy(old_timesteps,this->timesteps,this->numtimesteps);
+		xDelete(this->timesteps);
+	}
+
+	this->numtimesteps=this->numtimesteps+1;
+	this->timesteps=xNew<IssmDouble>(this->numtimesteps);
+
+	if (this->numtimesteps > 1){
+		xMemCpy(this->timesteps,old_timesteps,this->numtimesteps-1);
+		xDelete(old_timesteps);
+	}
+
+	/*go ahead and plug: */
+	this->timesteps[this->numtimesteps-1]=time;
+	inputs->AddObject(input);
+
+}
+/*}}}*/
+void TransientInput::AddTimeInput(Input* input){/*{{{*/
+
+	_assert_(this->inputs->Size()<this->numtimesteps);
+	inputs->AddObject(input);
+
+}
+/*}}}*/
 
 /*Object virtual functions definitions:*/
@@ -87,5 +122,5 @@
 	_printf_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
 	_printf_("   numtimesteps: " << this->numtimesteps << "\n");
-	_printf_("---inputs: \n"); 
+	_printf_("---inputs: \n");
 	for(i=0;i<this->numtimesteps;i++){
 		_printf_("   time: " << this->timesteps[i]<<"  ");
@@ -120,4 +155,43 @@
 
 /*TransientInput management*/
+void TransientInput::Configure(Parameters* parameters){/*{{{*/
+	this->parameters=parameters;
+}
+/*}}}*/
+int  TransientInput::GetResultArraySize(void){/*{{{*/
+
+	return 1;
+}
+/*}}}*/
+int  TransientInput::GetResultInterpolation(void){/*{{{*/
+
+	IssmDouble time;
+	int        output;
+
+	parameters->FindParam(&time,TimeEnum);
+	Input* input=GetTimeInput(time);
+	output = input->GetResultInterpolation();
+
+	/*Clean up and return*/
+	delete input;
+	return output;
+
+}
+/*}}}*/
+int  TransientInput::GetResultNumberOfNodes(void){/*{{{*/
+
+	IssmDouble time;
+	int        output;
+
+	parameters->FindParam(&time,TimeEnum);
+	Input* input=GetTimeInput(time);
+	output = input->GetResultNumberOfNodes();
+
+	/*Clean up and return*/
+	delete input;
+	return output;
+
+}
+/*}}}*/
 int TransientInput::InstanceEnum(void){/*{{{*/
 
@@ -174,5 +248,131 @@
 }
 /*}}}*/
-void TransientInput::GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){/*{{{*/
+void TransientInput::GetInputAverage(IssmDouble* pvalue){/*{{{*/
+
+	IssmDouble time;
+
+	/*First, recover current time from parameters: */
+	parameters->FindParam(&time,TimeEnum);
+
+	/*Retrieve interpolated values for this time step: */
+	Input* input=GetTimeInput(time);
+
+	/*Call input function*/
+	input->GetInputAverage(pvalue);
+
+	delete input;
+
+}
+/*}}}*/
+void TransientInput::GetInputAverageOverTimeSlice(IssmDouble* pvalue, Gauss* gauss, IssmDouble start_time,IssmDouble end_time){/*{{{*/
+
+	int averaging = 0;
+
+	Input* input=GetInputAverageOverTime(start_time,end_time,averaging);
+
+	/*Call input function*/
+	input->GetInputValue(pvalue, gauss);
+
+	//*pvalues=values;
+	delete input;
+}
+/*}}}*/
+Input* TransientInput::GetInputAverageOverTime(IssmDouble start_time,IssmDouble end_time,int averaging){/*{{{*/
+
+	int found;
+	int offset,start_offset,end_offset;
+	IssmDouble subdt;
+	IssmDouble slice_duration;
+
+	this->parameters->FindParam(&subdt,TimesteppingTimeStepEnum); //duration of each substeps
+
+	Input *averageinput  = NULL;
+
+
+	slice_duration=end_time-start_time;
+	start_time+=subdt; //because time is actually considered at the end of the timestep
+
+	/*go through the timesteps, and grab offset for the start of the slice*/
+	found=binary_search(&offset,start_time,this->timesteps,this->numtimesteps);
+	if(!found) _error_("Input not found (is TransientInput sorted ?)");
+	/*go through the timesteps, and grab offset for the end of the slice*/
+	found=binary_search(&end_offset,end_time,this->timesteps,this->numtimesteps);
+	if(!found) _error_("Input not found (is TransientInput sorted ?)");
+
+	start_offset = offset;
+	//stack the input for each timestep in the slice
+	while(offset <= end_offset ){
+		Input *currentinput  = NULL;
+
+		if (offset==-1){
+			/*get values for the first time: */
+			_assert_(start_time<this->timesteps[0]);
+			currentinput=(Input*)((Input*)this->inputs->GetObjectByOffset(0))->copy();
+		}
+		else if(offset==(this->numtimesteps-1)){
+			/*get values for the last time: */
+			_assert_(end_time>=this->timesteps[offset]);
+			currentinput=(Input*)((Input*)this->inputs->GetObjectByOffset(offset))->copy();
+		}
+		else{
+			currentinput=(Input*)((Input*)this->inputs->GetObjectByOffset(offset))->copy();
+		}
+		switch(averaging){
+			case 0: //Arithmetic mean
+				if (offset==start_offset){
+					averageinput=(Input*)currentinput->copy();
+					averageinput->Scale(subdt);
+				}
+				else{
+					averageinput->AXPY(currentinput,subdt);
+				}
+				break;
+			case 1: //Geometric mean
+				if (offset==start_offset){
+					averageinput=(Input*)currentinput->copy();
+					averageinput->Scale(subdt);
+				}
+				else{
+					currentinput->Scale(subdt);
+					averageinput->PointwiseMult(currentinput);
+				}
+				break;
+			case 2: //Harmonic mean
+				if (offset==start_offset){
+					averageinput=(Input*)currentinput->copy();
+					averageinput->Pow(-1);
+					averageinput->Scale(subdt);
+				}
+				else{
+					currentinput->Pow(-1);
+					averageinput->AXPY(currentinput,subdt);
+				}
+				break;
+			default:
+				_error_("averaging method is not recognised");
+		}
+		delete currentinput;
+		offset+=1;
+	}
+
+	//summation is done, now we normalise
+	switch(averaging){
+		case 0: //Arithmetic mean
+			averageinput->Scale(1.0/slice_duration);
+			break;
+		case 1: //Geometric mean
+			averageinput->Pow(1.0/slice_duration);
+			break;
+		case 2: //Harmonic mean
+			averageinput->Scale(1.0/slice_duration);
+			averageinput->Pow(-1.0);
+			break;
+		default:
+			_error_("averaging method is not recognised");
+	}
+	return averageinput;
+}
+/*}}}*/
+void TransientInput::GetInputAveragesOnAllTime(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){/*{{{*/
 
 	int i;
@@ -195,83 +395,5 @@
 }
 /*}}}*/
-void TransientInput::GetInputAverage(IssmDouble* pvalue){/*{{{*/
-
-	IssmDouble time;
-
-	/*First, recover current time from parameters: */
-	parameters->FindParam(&time,TimeEnum);
-
-	/*Retrieve interpolated values for this time step: */
-	Input* input=GetTimeInput(time);
-
-	/*Call input function*/
-	input->GetInputAverage(pvalue);
-
-	delete input;
-
-}
-/*}}}*/
-void TransientInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, Gauss* gauss){/*{{{*/
-
-	IssmDouble time;
-
-	/*First, recover current time from parameters: */
-	parameters->FindParam(&time,TimeEnum);
-
-	/*Retrieve interpolated values for this time step: */
-	Input* input=GetTimeInput(time);
-
-	/*Call input function*/
-	input->GetInputDerivativeValue(p,xyz_list,gauss);
-
-	delete input;
-}
-/*}}}*/
-void TransientInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){/*{{{*/
-	IssmDouble time;
-
-	/*First, recover current time from parameters: */
-	parameters->FindParam(&time,TimeEnum);
-
-	/*Retrieve interpolated values for this time step: */
-	Input* input=GetTimeInput(time);
-
-	/*Call input function*/
-	input->GetInputValue(pvalue,gauss);
-
-	delete input;
-}
-/*}}}*/
-void TransientInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss,IssmDouble time){/*{{{*/
-
-	/*Retrieve interpolated values for this time step: */
-	Input* input=GetTimeInput(time);
-
-	/*Call input function*/
-	input->GetInputValue(pvalue,gauss);
-
-	delete input;
-}
-/*}}}*/
-int  TransientInput::GetTimeInputOffset(IssmDouble time){/*{{{*/
-
-	int        found;
-	int        offset;
-
-	/*go through the timesteps, and figure out which interval we
-	 *     *fall within. Then interpolate the values on this interval: */
-	found=binary_search(&offset,time,this->timesteps,this->numtimesteps);
-	if(!found) _error_("Input not found (is TransientInput sorted ?)");
-
-	return offset;
-}
-/*}}}*/
-IssmDouble  TransientInput::GetTimeByOffset(int offset){/*{{{*/
-	if (offset < 0) offset=0;
-	_assert_(offset<(this->numtimesteps));
-	return this->timesteps[offset];
-}
-/*}}}*/
-void TransientInput::GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){/*{{{*/
+void TransientInput::GetInputAveragesUpToCurrentTime(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){/*{{{*/
 
 	int         i;
@@ -313,110 +435,65 @@
 }
 /*}}}*/
-void TransientInput::GetInputAverageOnTimes(IssmDouble** pvalues, IssmDouble init_time){/*{{{*/
-
-	int					numnodes;
-	IssmDouble  subtimestep;
-	IssmDouble* values= NULL;
-	Input* input=NULL;
-
-	/*Initialize numnode from transientinput out of time loop*/
-	for(int i=0;i<this->numtimesteps;i++){
-		/*First compute the lengt of the sub-timestep*/
-		if(i==0){
-			subtimestep = this->timesteps[i]-init_time;
-		}
-		else{
-			subtimestep = this->timesteps[i]-this->timesteps[i-1];
-		}	
-		/*Figure out type of input and get it*/
-		input = xDynamicCast<Input*>(this->inputs->GetObjectByOffset(i)); _assert_(input);
-		switch(input->ObjectEnum()){
-		case TriaInputEnum:{
-			TriaInput* triainput = (TriaInput*)this->inputs->GetObjectByOffset(i); _assert_(triainput);
-			if(i==0){
-				numnodes= triainput->NumberofNodes(triainput->interpolation_type);
-				values=xNewZeroInit<IssmDouble>(numnodes);
-			}
-			/*Sum the values weighted by their respective sub-timestep*/
-			for(int j=0;j<numnodes;j++){
-				values[j]+=(triainput->values[j]*subtimestep);
-			}
-			break;
-		}
-		case PentaInputEnum:{
-			PentaInput*	pentainput = (PentaInput*)this->inputs->GetObjectByOffset(i); _assert_(pentainput);
-			if(i==0){
-				numnodes= pentainput->NumberofNodes(pentainput->interpolation_type);
-				values=xNewZeroInit<IssmDouble>(numnodes);
-			}
-			/*Sum the values weighted by their respective sub-timestep*/
-			for(int j=0;j<numnodes;j++){
-				values[j]+=(pentainput->values[j]*subtimestep);
-			}
-			break;
-		}
-		case TetraInputEnum:{
-			TetraInput*	tetrainput = (TetraInput*)this->inputs->GetObjectByOffset(i); _assert_(tetrainput);
-			if(i==0){
-				numnodes= tetrainput->NumberofNodes(tetrainput->interpolation_type);
-				values=xNewZeroInit<IssmDouble>(numnodes);
-			}
-			/*Sum the values weighted by their respective sub-timestep*/
-			for(int j=0;j<numnodes;j++){
-				values[j]+=(tetrainput->values[j]*subtimestep);
-			}
-			break;
-		}
-		default: _error_("not implemented yet");
-		}
-	}
-	/*Compute the average based on the length of the full timestep*/
-	for(int j=0;j<numnodes;j++){
-		values[j]=values[j]/(this->timesteps[this->numtimesteps-1]-init_time);
-	}
-	*pvalues=values;
-}
-/*}}}*/
-
+void TransientInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, Gauss* gauss){/*{{{*/
+
+	IssmDouble time;
+
+	/*First, recover current time from parameters: */
+	parameters->FindParam(&time,TimeEnum);
+
+	/*Retrieve interpolated values for this time step: */
+	Input* input=GetTimeInput(time);
+
+	/*Call input function*/
+	input->GetInputDerivativeValue(p,xyz_list,gauss);
+
+	delete input;
+}
+/*}}}*/
+void TransientInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){/*{{{*/
+	IssmDouble time;
+
+	/*First, recover current time from parameters: */
+	parameters->FindParam(&time,TimeEnum);
+
+	/*Retrieve interpolated values for this time step: */
+	Input* input=GetTimeInput(time);
+
+	/*Call input function*/
+	input->GetInputValue(pvalue,gauss);
+
+	delete input;
+}
+/*}}}*/
+void TransientInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss,IssmDouble time){/*{{{*/
+
+	/*Retrieve interpolated values for this time step: */
+	Input* input=GetTimeInput(time);
+
+	/*Call input function*/
+	input->GetInputValue(pvalue,gauss);
+
+	delete input;
+}
+/*}}}*/
+IssmDouble  TransientInput::GetTimeByOffset(int offset){/*{{{*/
+	if (offset < 0) offset=0;
+	_assert_(offset<(this->numtimesteps));
+	return this->timesteps[offset];
+}
+/*}}}*/
+int  TransientInput::GetTimeInputOffset(IssmDouble time){/*{{{*/
+
+	int offset;
+
+	/*go through the timesteps, and figure out which interval we
+	 *     *fall within. Then interpolate the values on this interval: */
+	int found=binary_search(&offset,time,this->timesteps,this->numtimesteps);
+	if(!found) _error_("Input not found (is TransientInput sorted ?)");
+
+	return offset;
+}
+/*}}}*/
 /*Intermediary*/
-void TransientInput::AddTimeInput(Input* input,IssmDouble time){/*{{{*/
-
-	/*insert values at time step: */
-	if (this->numtimesteps>0 && time<=this->timesteps[this->numtimesteps-1]) _error_("timestep values must increase sequentially");
-
-	//copy timesteps, add the new time, delete previous timesteps, and add the new input: inputs->AddObject(input);
-	IssmDouble* old_timesteps=NULL;
-
-	if (this->numtimesteps > 0){
-		old_timesteps=xNew<IssmDouble>(this->numtimesteps);
-		xMemCpy(old_timesteps,this->timesteps,this->numtimesteps);
-		xDelete(this->timesteps);
-	}
-
-	this->numtimesteps=this->numtimesteps+1;
-	this->timesteps=xNew<IssmDouble>(this->numtimesteps);
-
-	if (this->numtimesteps > 1){
-		xMemCpy(this->timesteps,old_timesteps,this->numtimesteps-1);
-		xDelete(old_timesteps);
-	}
-
-	/*go ahead and plug: */
-	this->timesteps[this->numtimesteps-1]=time;
-	inputs->AddObject(input);
-
-}
-/*}}}*/
-void TransientInput::AddTimeInput(Input* input){/*{{{*/
-
-	_assert_(this->inputs->Size()<this->numtimesteps);
-	inputs->AddObject(input);
-
-}
-/*}}}*/
-void TransientInput::Configure(Parameters* parameters){/*{{{*/
-	this->parameters=parameters;
-}
-/*}}}*/
 void TransientInput::Extrude(int start){/*{{{*/
 
@@ -424,39 +501,4 @@
 		((Input*)this->inputs->GetObjectByOffset(i))->Extrude(start);
 	}
-}
-/*}}}*/
-int  TransientInput::GetResultArraySize(void){/*{{{*/
-
-	return 1;
-}
-/*}}}*/
-int  TransientInput::GetResultInterpolation(void){/*{{{*/
-
-	IssmDouble time;
-	int        output;
-
-	parameters->FindParam(&time,TimeEnum);
-	Input* input=GetTimeInput(time);
-	output = input->GetResultInterpolation();
-
-	/*Clean up and return*/
-	delete input;
-	return output;
-
-}
-/*}}}*/
-int  TransientInput::GetResultNumberOfNodes(void){/*{{{*/
-
-	IssmDouble time;
-	int        output;
-
-	parameters->FindParam(&time,TimeEnum);
-	Input* input=GetTimeInput(time);
-	output = input->GetResultNumberOfNodes();
-
-	/*Clean up and return*/
-	delete input;
-	return output;
-
 }
 /*}}}*/
@@ -476,5 +518,5 @@
 	Input *input2 = NULL;
 
-	/*go through the timesteps, and figure out which interval we 
+	/*go through the timesteps, and figure out which interval we
 	 *fall within. Then interpolate the values on this interval: */
 	found=binary_search(&offset,intime,this->timesteps,this->numtimesteps);
@@ -498,5 +540,5 @@
 		alpha1=(1.0-alpha2);
 
-		input1=(Input*)this->inputs->GetObjectByOffset(offset); 
+		input1=(Input*)this->inputs->GetObjectByOffset(offset);
 		input2=(Input*)this->inputs->GetObjectByOffset(offset+1);
 
Index: /issm/trunk/src/c/classes/Inputs/TransientInput.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/TransientInput.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/TransientInput.h	(revision 24313)
@@ -1,3 +1,3 @@
-/*! \file TransientInput.h 
+/*! \file TransientInput.h
  *  \brief: header file for transientinput object
  */
@@ -44,17 +44,21 @@
 		int  GetResultInterpolation(void);
 		int  GetResultNumberOfNodes(void);
-		int    InstanceEnum();
+		int  InstanceEnum();
 		void ResultToPatch(IssmDouble* values,int nodesperelement,int sid){_error_("not supported yet");};
 		Input* SpawnSegInput(int index1,int index2);
 		Input* SpawnTriaInput(int index1,int index2,int index3);
 		/*}}}*/
-		/*numerics: {{{*/
+		/*Object Functions: {{{*/
 		void AXPY(Input* xforcing,IssmDouble scalar){_error_("not implemented yet");};
 		void ChangeEnum(int newenumtype);
-		void Extrude(int start);
-		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes);
 		void GetInputAverage(IssmDouble* pvalue);
+		void GetInputAverageOverTimeSlice(IssmDouble* pvalue, Gauss* gauss, IssmDouble init_time, IssmDouble end_time);
+		Input* GetInputAverageOverTime(IssmDouble start_time,IssmDouble end_time,int averaging);
+		void GetInputAveragesOnAllTime(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes);
+		void GetInputAveragesUpToCurrentTime(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime);
 		void GetInputDerivativeAverageValue(IssmDouble* derivativevalues, IssmDouble* xyz_list){_error_("not implemented yet");};
 		void GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list,Gauss* gauss);
+		int  GetInputInterpolationType(){_error_("not implemented yet!");};
+		void GetTimeValues(IssmDouble* values,IssmDouble time){_error_("not implemented yet");};
 		void GetInputValue(bool* pvalue){_error_("not implemented yet");};
 		void GetInputValue(int* pvalue){_error_("not implemented yet");};
@@ -63,11 +67,13 @@
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss,IssmDouble time);
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss ,int index){_error_("not implemented yet");};
-		void GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime);
-		void GetInputAverageOnTimes(IssmDouble** pvalues, IssmDouble init_time);
-		int  GetInputInterpolationType(){_error_("not implemented yet!");};
 		IssmDouble  GetTimeByOffset(int offset);
+		int  GetTimeInputOffset(IssmDouble time);
+		void PointwiseMult(Input* xforcing){_error_("not implemented yet");};
+		void Pow(IssmDouble exponent){_error_("not implemented yet");};
+		void Scale(IssmDouble scale_factor){_error_("not implemented yet");};
+		/*}}}*/
+		/*Intermiadaries: {{{*/
+		void Extrude(int start);
 		Input* GetTimeInput(IssmDouble time);
-		int  GetTimeInputOffset(IssmDouble time);
-		void GetTimeValues(IssmDouble* values,IssmDouble time){_error_("not implemented yet");};
 		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
 		IssmDouble Max(void);
@@ -75,6 +81,4 @@
 		IssmDouble Min(void);
 		IssmDouble MinAbs(void);
-		void Scale(IssmDouble scale_factor){_error_("not implemented yet");};
-		void Set(IssmDouble setvalue){_error_("Set not implemented yet");};
 		/*}}}*/
 
Index: /issm/trunk/src/c/classes/Inputs/TriaInput.cpp
===================================================================
--- /issm/trunk/src/c/classes/Inputs/TriaInput.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/TriaInput.cpp	(revision 24313)
@@ -96,5 +96,5 @@
 int  TriaInput::GetResultInterpolation(void){/*{{{*/
 
-	if(this->interpolation_type==P0Enum){
+	if(this->interpolation_type==P0Enum || this->interpolation_type==P0DGEnum){
 		return P0Enum;
 	}
@@ -126,5 +126,5 @@
 	SegInput* outinput=NULL;
 
-	if(this->interpolation_type==P0Enum){ 
+	if(this->interpolation_type==P0Enum){
 		outinput=new SegInput(this->enum_type,&this->values[0],P0Enum);
 	}
@@ -165,5 +165,5 @@
 }
 /*}}}*/
-void TriaInput::GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){/*{{{*/
+void TriaInput::GetInputAveragesOnAllTime(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){/*{{{*/
 
 	IssmDouble* outvalues=NULL;
@@ -224,5 +224,5 @@
 /*}}}*/
 
-void TriaInput::GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){/*{{{*/
+void TriaInput::GetInputAveragesUpToCurrentTime(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){/*{{{*/
 
 	IssmDouble* outvalues=NULL;
@@ -320,4 +320,67 @@
 }
 /*}}}*/
+void TriaInput::PointwiseMult(Input* xinput){/*{{{*/
+
+	const int numnodes=this->NumberofNodes(this->interpolation_type);
+	TriaInput* xtriainput=NULL;
+
+
+	/*xinput is of the same type, so cast it: */
+	if(xinput->ObjectEnum()!=TriaInputEnum) _error_("Operation not permitted because xinput is of type " << EnumToStringx(xinput->ObjectEnum()));
+	xtriainput=(TriaInput*)xinput;
+	if(xtriainput->interpolation_type!=this->interpolation_type) _error_("Operation not permitted because xinput is of type " << EnumToStringx(xtriainput->interpolation_type));
+
+	/*Carry out the PointwiseMult operation depending on type:*/
+	for(int i=0;i<numnodes;i++)this->values[i]=this->values[i]*xtriainput->values[i];
+
+}
+/*}}}*/
+void TriaInput::Pow(IssmDouble exponent){/*{{{*/
+
+	const int numnodes=this->NumberofNodes(this->interpolation_type);
+	if(exponent==0.0){
+		/*  Not-a-number left alone Infinity set to one  */
+		for(int i=0;i<numnodes;i++){
+			if (this->values[i]==this->values[i])this->values[i]=1.0;
+		}
+	}
+	else if(exponent==0.5){
+		for(int i=0;i<numnodes;i++){
+			if(this->values[i]>=0){
+				this->values[i]=sqrt(this->values[i]);
+			}
+			else{
+				this->values[i]=INFINITY;
+			}
+		}
+	}
+	else if(exponent==1.0){
+		/* do nothing */
+	}
+	else if(exponent==-0.5){
+		for(int i=0;i<numnodes;i++){
+			if(this->values[i]>=0){
+				this->values[i]=1.0/sqrt(this->values[i]);
+			}
+			else{
+				this->values[i]=INFINITY;
+			}
+		}
+	}
+	else if(exponent==-1.0){
+		for(int i=0;i<numnodes;i++){
+			if(this->values[i]!=0.){
+				this->values[i]=1.0/this->values[i];
+			}
+			else{
+				this->values[i]=INFINITY;
+			}
+		}
+	}
+	else {
+		for(int i=0;i<numnodes;i++)this->values[i]=pow(this->values[i],exponent);
+	}
+}
+/*}}}*/
 void TriaInput::Scale(IssmDouble scale_factor){/*{{{*/
 
@@ -326,8 +389,2 @@
 }
 /*}}}*/
-void TriaInput::Set(IssmDouble setvalue){/*{{{*/
-
-	const int numnodes=this->NumberofNodes(this->interpolation_type);
-	for(int i=0;i<numnodes;i++)values[i]=setvalue;
-}
-/*}}}*/
Index: /issm/trunk/src/c/classes/Inputs/TriaInput.h
===================================================================
--- /issm/trunk/src/c/classes/Inputs/TriaInput.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Inputs/TriaInput.h	(revision 24313)
@@ -1,3 +1,3 @@
-/*! \file TriaInput.h 
+/*! \file TriaInput.h
  *  \brief: header file for TriaInput object
  */
@@ -49,5 +49,5 @@
 		void ChangeEnum(int newenumtype);
 		void Extrude(int start){_error_("not supported yet");};
-		void GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes);
+		void GetInputAveragesOnAllTime(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes);
 		void GetInputAverage(IssmDouble* pvalue);
 		void GetInputDerivativeAverageValue(IssmDouble* derivativevalues, IssmDouble* xyz_list);
@@ -59,5 +59,5 @@
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss,IssmDouble time){_error_("not implemented yet");};
 		void GetInputValue(IssmDouble* pvalue,Gauss* gauss,int index){_error_("not implemented yet");};
-		void GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime);
+		void GetInputAveragesUpToCurrentTime(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime);
 		int  GetInputInterpolationType(){return interpolation_type;};
 		void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
@@ -66,6 +66,7 @@
 		IssmDouble Min(void);
 		IssmDouble MinAbs(void);
+		void PointwiseMult(Input* xinput);
+		void Pow(IssmDouble exponent);
 		void Scale(IssmDouble scale_factor);
-		void Set(IssmDouble setvalue);
 
 };
Index: /issm/trunk/src/c/classes/IoModel.cpp
===================================================================
--- /issm/trunk/src/c/classes/IoModel.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/IoModel.cpp	(revision 24313)
@@ -1,4 +1,4 @@
 /*! \file IoModel.cpp
- * \brief  file containing the methods that will help in processing the input data coming 
+ * \brief  file containing the methods that will help in processing the input data coming
  * into ISSM, from Matlab, or through a binary file opened for reading.
  */
@@ -136,6 +136,10 @@
 	this->my_elements=NULL;
 	this->my_faces=NULL;
+	this->my_vfaces=NULL;
 	this->my_edges=NULL;
+	this->my_vedges=NULL;
+	this->my_hedges=NULL;
 	this->my_vertices=NULL;
+	this->epart=NULL;
 
 	this->domaintype=-1;
@@ -145,19 +149,23 @@
 	this->numberofelements=-1;
 	this->numberoffaces=-1;
+	this->numberofverticalfaces=-1;
 	this->numberofedges=-1;
+	this->numberofverticaledges=-1;
+	this->numberofhorizontaledges=-1;
 	this->facescols=-1;
 	this->elements=NULL;
 	this->faces=NULL;
+	this->verticalfaces=NULL;
 	this->edges=NULL;
-	this->elementtofaceconnectivity      =NULL;
-	this->elementtoedgeconnectivity      =NULL;
-	this->singlenodetoelementconnectivity=NULL;
-	this->numbernodetoelementconnectivity=NULL;
-
-	this->nodecounter=0;
-	this->loadcounter=0;
-	this->constraintcounter=0;
-}
-/*}}}*/
+	this->verticaledges=NULL;
+	this->horizontaledges=NULL;
+	this->elementtofaceconnectivity           = NULL;
+	this->elementtoverticalfaceconnectivity   = NULL;
+	this->elementtoedgeconnectivity           = NULL;
+	this->elementtoverticaledgeconnectivity   = NULL;
+	this->elementtohorizontaledgeconnectivity = NULL;
+	this->singlenodetoelementconnectivity     = NULL;
+	this->numbernodetoelementconnectivity     = NULL;
+}/*}}}*/
 IoModel::IoModel(FILE* iomodel_handle,int solution_enum_in,bool trace,IssmPDouble* X){/*{{{*/
 
@@ -174,6 +182,6 @@
 	this->solution_enum = solution_enum_in;
 
-	/*If we are running in AD mode, we need to start the trace and declare our independent variables now, 
-	 *and prevent them from being erased during successive calls to iomodel->FetchConstants, iomodel->FetchData and 
+	/*If we are running in AD mode, we need to start the trace and declare our independent variables now,
+	 *and prevent them from being erased during successive calls to iomodel->FetchConstants, iomodel->FetchData and
 	 iomodel->DeleteData:*/
 	this->StartTrace(trace);
@@ -199,7 +207,11 @@
 	/*Initialize permanent data: */
 	this->my_elements = NULL;
-	this->my_faces = NULL;
-	this->my_edges = NULL;
+	this->my_faces    = NULL;
+	this->my_vfaces   = NULL;
+	this->my_edges    = NULL;
+	this->my_vedges   = NULL;
+	this->my_hedges   = NULL;
 	this->my_vertices = NULL;
+	this->epart       = NULL;
 
 	FindConstant(&this->domaintype,"md.mesh.domain_type");
@@ -210,17 +222,18 @@
 	FetchData(&this->numberofelements,"md.mesh.numberofelements");
 	FetchData(&this->elements,NULL,NULL,"md.mesh.elements");
-	this->facescols                       = -1;
-	this->faces                           = NULL;
-	this->edges                           = NULL;
-	this->elementtofaceconnectivity       = NULL;
-	this->elementtoedgeconnectivity       = NULL;
-	this->singlenodetoelementconnectivity = NULL;
-	this->numbernodetoelementconnectivity = NULL;
-
-	this->nodecounter=0;
-	this->loadcounter=0;
-	this->constraintcounter=0;
-}
-/*}}}*/
+	this->facescols                           = -1;
+	this->faces                               = NULL;
+	this->verticalfaces                       = NULL;
+	this->edges                               = NULL;
+	this->verticaledges                       = NULL;
+	this->horizontaledges                     = NULL;
+	this->elementtofaceconnectivity           = NULL;
+	this->elementtoverticalfaceconnectivity   = NULL;
+	this->elementtoedgeconnectivity           = NULL;
+	this->elementtoverticaledgeconnectivity   = NULL;
+	this->elementtohorizontaledgeconnectivity = NULL;
+	this->singlenodetoelementconnectivity     = NULL;
+	this->numbernodetoelementconnectivity     = NULL;
+}/*}}}*/
 IoModel::~IoModel(){/*{{{*/
 
@@ -246,12 +259,22 @@
 	xDelete<bool>(this->my_elements);
 	xDelete<bool>(this->my_faces);
+	xDelete<bool>(this->my_vfaces);
 	xDelete<bool>(this->my_edges);
-	xDelete<int>(this->my_vertices);
+	xDelete<bool>(this->my_vedges);
+	xDelete<bool>(this->my_hedges);
+	xDelete<bool>(this->my_vertices);
+	xDelete<int>(this->epart);
 
 	xDelete<int>(this->elements);
 	xDelete<int>(this->faces);
+	xDelete<int>(this->verticalfaces);
 	xDelete<int>(this->edges);
+	xDelete<int>(this->verticaledges);
+	xDelete<int>(this->horizontaledges);
 	xDelete<int>(this->elementtofaceconnectivity);
+	xDelete<int>(this->elementtoverticalfaceconnectivity);
 	xDelete<int>(this->elementtoedgeconnectivity);
+	xDelete<int>(this->elementtoverticaledgeconnectivity);
+	xDelete<int>(this->elementtohorizontaledgeconnectivity);
 	xDelete<int>(this->singlenodetoelementconnectivity);
 	xDelete<int>(this->numbernodetoelementconnectivity);
@@ -319,5 +342,6 @@
 
 	bool        found;
-	int         record_enum,record_length,record_name_size;
+	int         record_enum,record_name_size;
+   long long   record_length;
 	char       *record_name = NULL;
 	const char *mddot = "md.";
@@ -369,5 +393,5 @@
 
 			/*Go to next Enum*/
-			if(fread(&record_length,sizeof(int),1,fid)!=1) _error_("Could not read record_length");
+			if(fread(&record_length,sizeof(long long),1,fid)!=1) _error_("Could not read record_length");
 			fseek(fid,record_length,SEEK_CUR);
 			xDelete<char>(record_name);
@@ -378,5 +402,5 @@
 			_printf0_(" Marshalled file is corrupted                                            \n");
 			_printf0_("                                                                         \n");
-			_printf0_("   * Last record found is : \n");
+			_printf0_("   * Last record found is :                                              \n");
 			_printf0_("     the corresponding model field has probably been marshalled          \n");
 			_printf0_("     incorrectly                                                         \n");
@@ -444,5 +468,5 @@
 			this->FetchData(&types,NULL,NULL,"md.autodiff.independent_object_types");
 
-			/*create independent objects, and at the same time, fetch the corresponding independent variables, 
+			/*create independent objects, and at the same time, fetch the corresponding independent variables,
 			 *and declare them as such in ADOLC: */
 			for(int i=0;i<num_independent_objects;i++){
@@ -521,5 +545,5 @@
 	if(numstrings){
 		for(int i=0;i<numstrings;i++){
-			char* string=stringarray[i]; 
+			char* string=stringarray[i];
 			xDelete<char>(string);
 		}
@@ -534,5 +558,5 @@
 	char* record_name = NULL;
 	int   record_name_size;
-	int record_length;
+	long long record_length;
 	int record_code; //1 to 7 number
 
@@ -585,5 +609,5 @@
 
 			/* Read the record length and the data type code: */
-			if(fread(&record_length,sizeof(int),1,this->fid)!=1) _error_("Cound not read record_length");
+			if(fread(&record_length,sizeof(long long),1,this->fid)!=1) _error_("Cound not read record_length");
 			if(fread(&record_code  ,sizeof(int),1,this->fid)!=1) _error_("Cound not read record_code");
 
@@ -592,13 +616,13 @@
 
 			/*Tell other cpus the name of the data, then branch according to the data type: */
-			ISSM_MPI_Bcast(&record_name_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
-			ISSM_MPI_Bcast(record_name,record_name_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 
-			ISSM_MPI_Bcast(&record_length,1,ISSM_MPI_INT,0,IssmComm::GetComm());  
+			ISSM_MPI_Bcast(&record_name_size,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+			ISSM_MPI_Bcast(record_name,record_name_size,ISSM_MPI_CHAR,0,IssmComm::GetComm());
+			ISSM_MPI_Bcast(&record_length,1,ISSM_MPI_LONG_LONG_INT,0,IssmComm::GetComm());
 
 			switch(record_code){
-				case 1: 
+				case 1:
 					/*Read the boolean and broadcast it to other cpus:*/
 					if(fread(&booleanint,sizeof(int),1,this->fid)!=1) _error_("could not read boolean ");
-					ISSM_MPI_Bcast(&booleanint,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+					ISSM_MPI_Bcast(&booleanint,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 					/*create BoolParam: */
@@ -614,4 +638,5 @@
 					if(strcmp(record_name,"md.basalforcings.model")==0) integer = IoCodeToEnumBasal(integer);
 					if(strcmp(record_name,"md.calving.law")==0) integer = IoCodeToEnumCalving(integer);
+					if(strcmp(record_name,"md.frontalforcings.parameterization")==0) integer = IoCodeToEnumFrontalforcings(integer);
 					if(strcmp(record_name,"md.hydrology.model")==0) integer = IoCodeToEnumHydrology(integer);
 					if(strcmp(record_name,"md.materials.type")==0) integer = IoCodeToEnumMaterials(integer);
@@ -620,5 +645,5 @@
 
 					/*Broadcast to other cpus*/
-					ISSM_MPI_Bcast(&integer,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+					ISSM_MPI_Bcast(&integer,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 					/*create IntParam: */
@@ -640,5 +665,5 @@
 						if(!exists){
 							if(fread(&pscalar,sizeof(IssmPDouble),1,this->fid)!=1) _error_("could not read scalar ");
-							ISSM_MPI_Bcast(&pscalar,1,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+							ISSM_MPI_Bcast(&pscalar,1,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
 							scalar=pscalar;
 
@@ -648,8 +673,8 @@
 					  }
 					break;
-				case 4: 
+				case 4:
 					/*We have to read a string from disk. First read the dimensions of the string, then the string: */
 					if(fread(&string_size,sizeof(int),1,this->fid)!=1) _error_("could not read length of string ");
-					ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+					ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 					if(string_size){
@@ -659,5 +684,5 @@
 						/*Read string, then broadcast: */
 						if(fread(string,string_size*sizeof(char),1,this->fid)!=1)_error_(" could not read string ");
-						ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 
+						ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm());
 					}
 					else{
@@ -700,8 +725,8 @@
 					xDelete<char>(string);
 					break;
-				case 5: 
-				case 6: 
-				case 7: 
-				case 8: 
+				case 5:
+				case 6:
+				case 7:
+				case 8:
 				case 10:
 					/*We are not interested in this record, too memory intensive. Skip it: */
@@ -710,8 +735,8 @@
 					fseek(fid,record_length,SEEK_CUR);
 					break;
-				case 9: 
+				case 9:
 					/*String Array*/
 					if(fread(&numstrings,sizeof(int),1,fid)!=1) _error_("could not read length of string array");
-					ISSM_MPI_Bcast(&numstrings,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+					ISSM_MPI_Bcast(&numstrings,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 					/*Now allocate string array: */
 					if(numstrings){
@@ -723,10 +748,10 @@
 
 							if(fread(&string_size,sizeof(int),1,fid)!=1) _error_("could not read length of string ");
-							ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+							ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 							if(string_size){
 								string=xNew<char>((string_size+1));
 								string[string_size]='\0';
 								if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_(" could not read string ");
-								ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 
+								ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm());
 							}
 							else{
@@ -745,6 +770,6 @@
 					xDelete<char*>(strings);
 					break;
-				default: 
-					_error_("unknown record type:" << record_code); 
+				default:
+					_error_("unknown record type:" << record_code);
 					break;
 			}
@@ -762,10 +787,10 @@
 				_assert_(record_name_size);
 				record_name=xNew<char>((record_name_size+1)); record_name[record_name_size]='\0';
-				ISSM_MPI_Bcast(record_name,record_name_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 
-				ISSM_MPI_Bcast(&record_length,1,ISSM_MPI_INT,0,IssmComm::GetComm());  
+				ISSM_MPI_Bcast(record_name,record_name_size,ISSM_MPI_CHAR,0,IssmComm::GetComm());
+				ISSM_MPI_Bcast(&record_length,1,ISSM_MPI_LONG_LONG_INT,0,IssmComm::GetComm());
 				switch(record_code){
-					case 1: 
+					case 1:
 						/*boolean. get it from cpu 0 */
-						ISSM_MPI_Bcast(&booleanint,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+						ISSM_MPI_Bcast(&booleanint,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 						/*create BoolParam: */
@@ -775,5 +800,5 @@
 					case 2:
 						/*integer. get it from cpu 0 */
-						ISSM_MPI_Bcast(&integer,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+						ISSM_MPI_Bcast(&integer,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 						/*create IntParam: */
@@ -801,6 +826,6 @@
 						  }
 						break;
-					case 4: 
-						ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+					case 4:
+						ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 						if(string_size){
 							string=xNew<char>((string_size+1));
@@ -808,5 +833,5 @@
 
 							/*Read string from cpu 0: */
-							ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 
+							ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm());
 						}
 						else{
@@ -855,5 +880,5 @@
 					case 10: break; //do nothing. not interested in this type of data, which is memory intensive.
 					case 9:
-							  ISSM_MPI_Bcast(&numstrings,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+							  ISSM_MPI_Bcast(&numstrings,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 							  /*Now allocate string array: */
 							  if(numstrings){
@@ -864,9 +889,9 @@
 								  for(int i=0;i<numstrings;i++){
 
-									  ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+									  ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 									  if(string_size){
 										  string=xNew<char>((string_size+1));
 										  string[string_size]='\0';
-										  ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 
+										  ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm());
 									  }
 									  else{
@@ -885,6 +910,6 @@
 							  xDelete<char*>(strings);
 							  break;
-					default: 
-							  _error_("unknown record type:" << record_code); 
+					default:
+							  _error_("unknown record type:" << record_code);
 							  break;
 				}
@@ -909,8 +934,8 @@
 
 	/*We have to read a boolean from disk. */
-	if(my_rank==0){  
+	if(my_rank==0){
 		if(fread(&booleanint,sizeof(int),1,fid)!=1) _error_("could not read boolean ");
 	}
-	ISSM_MPI_Bcast(&booleanint,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast(&booleanint,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 	/*cast to bool: */
@@ -928,5 +953,4 @@
 	/*recover my_rank:*/
 	int my_rank=IssmComm::GetRank();
-
 	/*Set file pointer to beginning of the data: */
 	fid=this->SetFilePointerToData(&code,NULL,data_name);
@@ -935,9 +959,9 @@
 
 	/*We have to read a integer from disk. First read the dimensions of the integer, then the integer: */
-	if(my_rank==0){  
+	if(my_rank==0){
 		if(fread(&integer,sizeof(int),1,fid)!=1) _error_("could not read integer ");
 	}
 
-	ISSM_MPI_Bcast(&integer,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast(&integer,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 	/*Assign output pointers: */
@@ -963,5 +987,5 @@
 		if(fread(&scalar,sizeof(IssmPDouble),1,fid)!=1)_error_("could not read scalar ");
 	}
-	ISSM_MPI_Bcast(&scalar,1,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast(&scalar,1,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
 
 	/*Assign output pointers: */
@@ -988,9 +1012,9 @@
 
 	/*We have to read a string from disk. First read the dimensions of the string, then the string: */
-	if(my_rank==0){  
+	if(my_rank==0){
 		if(fread(&string_size,sizeof(int),1,fid)!=1) _error_("could not read length of string ");
 	}
 
-	ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 	/*Now allocate string: */
@@ -1000,8 +1024,8 @@
 
 		/*Read string on node 0, then broadcast: */
-		if(my_rank==0){  
+		if(my_rank==0){
 			if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_(" could not read string ");
 		}
-		ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 
+		ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm());
 	}
 	else{
@@ -1033,8 +1057,8 @@
 	/*Now fetch: */
 
-	if(my_rank==0){  
+	if(my_rank==0){
 		if(fread(&numstrings,sizeof(int),1,fid)!=1) _error_("could not read length of string array");
 	}
-	ISSM_MPI_Bcast(&numstrings,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast(&numstrings,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 	/*Now allocate string array: */
@@ -1046,15 +1070,15 @@
 		for(int i=0;i<numstrings;i++){
 
-			if(my_rank==0){  
+			if(my_rank==0){
 				if(fread(&string_size,sizeof(int),1,fid)!=1) _error_("could not read length of string ");
 			}
-			ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 			if(string_size){
 				string=xNew<char>((string_size+1));
 				string[string_size]='\0';
-				if(my_rank==0){  
+				if(my_rank==0){
 					if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_(" could not read string ");
 				}
-				ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 
+				ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm());
 			}
 			else{
@@ -1092,11 +1116,11 @@
 	/*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */
 	/*numberofelements: */
-	if(my_rank==0){  
+	if(my_rank==0){
 		if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix ");
 	}
 
-	ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
-
-	if(my_rank==0){  
+	ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+
+	if(my_rank==0){
 		if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
 	}
@@ -1108,9 +1132,9 @@
 
 		/*Read matrix on node 0, then broadcast: */
-		if(my_rank==0){  
+		if(my_rank==0){
 			if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
 		}
 
-		ISSM_MPI_Bcast(matrix,M*N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+		ISSM_MPI_Bcast(matrix,M*N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
 	}
 
@@ -1170,10 +1194,10 @@
 		if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix ");
 	}
-	ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
-
-	if(my_rank==0){  
+	ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+
+	if(my_rank==0){
 		if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
 	}
-	ISSM_MPI_Bcast(&N,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast(&N,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 	/*Now allocate matrix: */
@@ -1183,8 +1207,8 @@
 			IssmPDouble offset,range;
 			if(my_rank==0) if(fread(&offset,sizeof(IssmPDouble),1,fid)!=1) _error_("could not read offset");
-			ISSM_MPI_Bcast(&offset,1,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast(&offset,1,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
 
 			if(my_rank==0) if(fread(&range,sizeof(IssmPDouble),1,fid)!=1) _error_("could not read range");
-			ISSM_MPI_Bcast(&range,1,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast(&range,1,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
 
 			*pmatrix=xNew<IssmDouble>(M*N);
@@ -1193,5 +1217,5 @@
 			uint8_t* rawmatrix=xNew<uint8_t>((M-1)*N);
 			if(my_rank==0) if(fread(rawmatrix,(M-1)*N*sizeof(char),1,fid)!=1) _error_("could not read matrix ");
-			ISSM_MPI_Bcast(rawmatrix,(M-1)*N,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast(rawmatrix,(M-1)*N,ISSM_MPI_CHAR,0,IssmComm::GetComm());
 
 			for(int i=0;i<(M-1)*N;++i) (*pmatrix)[i]=offset+range*reCast<IssmDouble>(rawmatrix[i])/255.;
@@ -1201,5 +1225,5 @@
 			IssmPDouble* timematrix=xNew<IssmPDouble>(N);
 			if(my_rank==0) if(fread(timematrix,N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read time in compressed matrix");
-			ISSM_MPI_Bcast(timematrix,N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast(timematrix,N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
 
 			for(int i=0;i<N;++i) (*pmatrix)[(M-1)*N+i]=timematrix[i];
@@ -1211,5 +1235,5 @@
 			matrix=xNew<IssmPDouble>(M*N);
 			if(my_rank==0) if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
-			ISSM_MPI_Bcast(matrix,M*N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast(matrix,M*N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
 
 			*pmatrix=xNew<IssmDouble>(M*N);
@@ -1248,8 +1272,8 @@
 
 	/*Now fetch: */
-	if(my_rank==0){  
+	if(my_rank==0){
 		if(fread(&numrecords,sizeof(int),1,fid)!=1) _error_("could not read number of records in matrix array ");
 	}
-	ISSM_MPI_Bcast(&numrecords,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast(&numrecords,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 	if(numrecords){
@@ -1269,13 +1293,13 @@
 		for(i=0;i<numrecords;i++){
 
-			if(my_rank==0){  
+			if(my_rank==0){
 				if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows in " << i << "th matrix of matrix array");
 			}
-			ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
-
-			if(my_rank==0){  
+			ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+
+			if(my_rank==0){
 				if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns in " << i << "th matrix of matrix array");
 			}
-			ISSM_MPI_Bcast(&N,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast(&N,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 			/*Now allocate matrix: */
@@ -1284,9 +1308,9 @@
 
 				/*Read matrix on node 0, then broadcast: */
-				if(my_rank==0){  
+				if(my_rank==0){
 					if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
 				}
 
-				ISSM_MPI_Bcast(matrix,M*N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+				ISSM_MPI_Bcast(matrix,M*N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
 				matrices[i]=xNew<IssmDouble>(M*N);
 				for (int j=0;j<M*N;++j) {matrices[i][j]=matrix[j];}
@@ -1314,6 +1338,6 @@
 	char* record_name = NULL;
 	int   record_name_size;
-	int   record_length;
-	int   record_code; 
+	long long record_length;
+	int   record_code;
 
 	/*records: */
@@ -1343,5 +1367,5 @@
 			/*Is this the record sought for? : */
 			if(strcmp(record_name,lastnonoption)==0){
-				if(fread(&record_length,sizeof(int),1,fid)!=1) _error_("Could not read record_length");
+				if(fread(&record_length,sizeof(long long),1,fid)!=1) _error_("Could not read record_length");
 				fseek(fid,record_length,SEEK_CUR);
 				xDelete<char>(record_name);
@@ -1349,5 +1373,5 @@
 			}
 			else{
-				if(fread(&record_length,sizeof(int),1,fid)!=1) _error_("Could not read record_length");
+				if(fread(&record_length,sizeof(long long),1,fid)!=1) _error_("Could not read record_length");
 				fseek(fid,record_length,SEEK_CUR);
 				xDelete<char>(record_name);
@@ -1392,5 +1416,5 @@
 
 			/* Read the record length and the data type code: */
-			if(fread(&record_length,sizeof(int),1,this->fid)!=1) _error_("Cound not read record_length");
+			if(fread(&record_length,sizeof(long long),1,this->fid)!=1) _error_("Cound not read record_length");
 			if(fread(&record_code  ,sizeof(int),1,this->fid)!=1) _error_("Cound not read record_code");
 
@@ -1399,7 +1423,7 @@
 
 			/*Tell other cpus the name of the data, then branch according to the data type: */
-			ISSM_MPI_Bcast(&record_name_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
-			ISSM_MPI_Bcast(record_name,record_name_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 
-			ISSM_MPI_Bcast(&record_length,1,ISSM_MPI_INT,0,IssmComm::GetComm());  
+			ISSM_MPI_Bcast(&record_name_size,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+			ISSM_MPI_Bcast(record_name,record_name_size,ISSM_MPI_CHAR,0,IssmComm::GetComm());
+			ISSM_MPI_Bcast(&record_length,1,ISSM_MPI_LONG_LONG_INT,0,IssmComm::GetComm());
 
 			switch(record_code){
@@ -1407,5 +1431,5 @@
 					  {
 						if(fread(&scalar,sizeof(IssmPDouble),1,this->fid)!=1) _error_("could not read scalar ");
-						ISSM_MPI_Bcast(&scalar,1,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+						ISSM_MPI_Bcast(&scalar,1,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
 						GenericOption<IssmDouble>* option = new GenericOption<IssmDouble>();
 						char* optionname=xNew<char>(strlen(record_name)-3+1);
@@ -1413,15 +1437,14 @@
 						option->value = scalar;
 						option->name  = optionname;
-						option->numel = 1;
-						option->ndims = 1;
-						option->size  = NULL;
+						option->size[0] = 1;
+						option->size[1] = 1;
 						options->AddOption(option);
 					  }
 					break;
-				case 4: 
+				case 4:
 					  {
 					/*We have to read a string from disk. First read the dimensions of the string, then the string: */
 					if(fread(&string_size,sizeof(int),1,this->fid)!=1) _error_("could not read length of string ");
-					ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+					ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 					if(string_size){
@@ -1431,5 +1454,5 @@
 						/*Read string, then broadcast: */
 						if(fread(string,string_size*sizeof(char),1,this->fid)!=1)_error_(" could not read string ");
-						ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 
+						ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm());
 					}
 					else{
@@ -1444,13 +1467,12 @@
 					option->value = string;
 					option->name  = optionname;
-					option->numel = 1;
-					option->ndims = 1;
-					option->size  = NULL;
+					option->size[0] = 1;
+					option->size[1] = 1;
 					options->AddOption(option);
 
 					  }
 					break;
-				default: 
-					_error_("record type not supported:" << record_code); 
+				default:
+					_error_("record type not supported:" << record_code);
 					break;
 			}
@@ -1468,11 +1490,11 @@
 				_assert_(record_name_size);
 				record_name=xNew<char>((record_name_size+1)); record_name[record_name_size]='\0';
-				ISSM_MPI_Bcast(record_name,record_name_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 
-				ISSM_MPI_Bcast(&record_length,1,ISSM_MPI_INT,0,IssmComm::GetComm());  
+				ISSM_MPI_Bcast(record_name,record_name_size,ISSM_MPI_CHAR,0,IssmComm::GetComm());
+				ISSM_MPI_Bcast(&record_length,1,ISSM_MPI_LONG_LONG_INT,0,IssmComm::GetComm());
 				switch(record_code){
 					case 3:
 						  {
 							if(fread(&scalar,sizeof(IssmPDouble),1,this->fid)!=1) _error_("could not read scalar ");
-							ISSM_MPI_Bcast(&scalar,1,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+							ISSM_MPI_Bcast(&scalar,1,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
 							char* optionname=xNew<char>(strlen(record_name)-3+1);
 							xMemCpy(optionname,&record_name[3],strlen(record_name)-3+1);
@@ -1480,15 +1502,14 @@
 							option->value = scalar;
 							option->name  = optionname;
-							option->numel = 1;
-							option->ndims = 1;
-							option->size  = NULL;
+							option->size[0] = 1;
+							option->size[1] = 1;
 							options->AddOption(option);
 						  }
 						break;
-					case 4: 
+					case 4:
 						  {
 						/*We have to read a string from disk. First read the dimensions of the string, then the string: */
 						if(fread(&string_size,sizeof(int),1,this->fid)!=1) _error_("could not read length of string ");
-						ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+						ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 						if(string_size){
@@ -1498,5 +1519,5 @@
 							/*Read string, then broadcast: */
 							if(fread(string,string_size*sizeof(char),1,this->fid)!=1)_error_(" could not read string ");
-							ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 
+							ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm());
 						}
 						else{
@@ -1511,12 +1532,11 @@
 						option->value = string;
 						option->name  = optionname;
-						option->numel = 1;
-						option->ndims = 1;
-						option->size  = NULL;
+						option->size[0] = 1;
+						option->size[1] = 1;
 						options->AddOption(option);
 						  }
 						break;
-					default: 
-						_error_("record type not supported:" << record_code); 
+					default:
+						_error_("record type not supported:" << record_code);
 						break;
 				}
@@ -1605,5 +1625,5 @@
 	for(int i=0;i<elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
-		if(!doublearray) element->AddInput(input_enum,&default_value,P0Enum); 
+		if(!doublearray) element->AddInput(input_enum,&default_value,P0Enum);
 		else             element->InputCreate(doublearray,this,M,N,vector_layout,input_enum,code);//we need i to index into elements.
 	}
@@ -1664,5 +1684,5 @@
 				element->InputUpdateFromConstant(scalar,input_enum);
 			}
-			break; 
+			break;
 		case 5: //boolean vector
 			this->FetchData(&doublearray,&M,&N,vector_name); //we still have a doublearray, because it might include times in transient mode
@@ -1723,5 +1743,5 @@
 		if(fread(&pscalar,sizeof(IssmPDouble),1,fid)!=1)_error_("could not read scalar ");
 
-		/*Now, before we even broadcast this to other nodes, declare the scalar  as an independent variable!. If we 
+		/*Now, before we even broadcast this to other nodes, declare the scalar  as an independent variable!. If we
 		 *have been supplied an X vector, use it instead of what we just read: */
 		#if defined(_HAVE_CODIPACK_)
@@ -1745,5 +1765,5 @@
 	}
 
-	ISSM_MPI_Bcast(&scalar,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast(&scalar,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
 	this->AddConstantIndependent(new IoConstant(scalar,constant_name));
 
@@ -1776,13 +1796,13 @@
 	/*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */
 	/*numberofelements: */
-	if(my_rank==0){  
+	if(my_rank==0){
 		if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix ");
 	}
-	ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
-
-	if(my_rank==0){  
+	ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+
+	if(my_rank==0){
 		if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
 	}
-	ISSM_MPI_Bcast(&N,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast(&N,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 	/*Now allocate matrix: */
@@ -1798,5 +1818,5 @@
 
 		/*Read matrix on node 0, then broadcast: */
-		if(my_rank==0){  
+		if(my_rank==0){
 			if(fread(buffer,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
 
@@ -1829,5 +1849,5 @@
 			#endif
 		}
-		ISSM_MPI_Bcast(matrix,M*N,ISSM_MPI_DOUBLE,0,IssmComm::GetComm()); 
+		ISSM_MPI_Bcast(matrix,M*N,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
 
 		xDelete<IssmPDouble>(buffer);
@@ -1836,5 +1856,5 @@
 
 	// FIXME codi is that at all relevant to CoDiPack or can we simply assume the same?
-	
+
 	/*Add to data as independent*/
 	this->AddDataIndependent(new IoData(matrix,code,layout,M,N,data_name));
@@ -1873,5 +1893,5 @@
 			if(my_rank==0){
 				/*check we are indeed finding a string, not something else: */
-				if(codes[i]!=4)_error_("expecting a string for \""<<data_name<<"\"");
+				if(codes[i]!=4)_error_("expecting a string for \""<<data_name<<"\" but code is "<<codes[i]<<" not 4");
 
 				/*We have to read a string from disk. First read the dimensions of the string, then the string: */
@@ -1880,5 +1900,5 @@
 			}
 
-			ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 			/*Now allocate string: */
@@ -1891,5 +1911,5 @@
 					if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_(" could not read string ");
 				}
-				ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 
+				ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm());
 			}
 			else{
@@ -1942,9 +1962,9 @@
 				/*We have to read a integer from disk. First read the dimensions of the integer, then the integer: */
 				fsetpos(fid,file_positions+i);
-				if(my_rank==0){  
+				if(my_rank==0){
 					if(fread(&integer,sizeof(int),1,fid)!=1) _error_("could not read integer ");
 				}
 			}
-			ISSM_MPI_Bcast(&integer,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast(&integer,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 			/*Assign: */
@@ -1995,9 +2015,9 @@
 				/*We have to read a double from disk: */
 				fsetpos(fid,file_positions+i);
-				if(my_rank==0){  
+				if(my_rank==0){
 					if(fread(&scalar,sizeof(IssmPDouble),1,fid)!=1) _error_("could not read scalar ");
 				}
 			}
-			ISSM_MPI_Bcast(&scalar,1,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast(&scalar,1,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
 
 			/*Assign: */
@@ -2057,10 +2077,10 @@
 				if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix ");
 			}
-			ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
-
-			if(my_rank==0){  
+			ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+
+			if(my_rank==0){
 				if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
 			}
-			ISSM_MPI_Bcast(&N,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast(&N,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 			/*Now allocate matrix: */
@@ -2069,11 +2089,11 @@
 
 				/*Read matrix on node 0, then broadcast: */
-				if(my_rank==0){  
+				if(my_rank==0){
 					if(fread(pmatrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
 				}
-				ISSM_MPI_Bcast(pmatrix,M*N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+				ISSM_MPI_Bcast(pmatrix,M*N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
 
 				//if(this->independents[data_enum]){ FIXME
-				//	/*this data has already been checked out! So cancel all that we've done here, and return 
+				//	/*this data has already been checked out! So cancel all that we've done here, and return
 				//	 * the data[data_enum] directly: */
 				//	matrix=this->data[data_enum];
@@ -2159,10 +2179,10 @@
 				if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix ");
 			}
-			ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
-
-			if(my_rank==0){  
+			ISSM_MPI_Bcast(&M,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+
+			if(my_rank==0){
 				if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
 			}
-			ISSM_MPI_Bcast(&N,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+			ISSM_MPI_Bcast(&N,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 			/*Now allocate matrix: */
@@ -2172,11 +2192,11 @@
 
 				/*Read matrix on node 0, then broadcast: */
-				if(my_rank==0){  
+				if(my_rank==0){
 					if(fread(pmatrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
 				}
-				ISSM_MPI_Bcast(pmatrix,M*N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 
+				ISSM_MPI_Bcast(pmatrix,M*N,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
 
 				//if(this->independents[data_enum]){ FIXME
-				//	/*this data has already been checked out! So cancel all that we've done here, and return 
+				//	/*this data has already been checked out! So cancel all that we've done here, and return
 				//	 * the data[data_enum] directly: */
 				//	matrix=this->data[data_enum];
@@ -2362,5 +2382,5 @@
 	char* record_name = NULL;
 	int   record_name_size;
-	int     record_length;
+	long long  record_length;
 	int     record_code;           //1 to 7 number
 	int     vector_type;           //1 to 7 number
@@ -2375,5 +2395,5 @@
 	_assert_(strncmp(data_name,mddot,3)==0);
 
-	/*Go find in the binary file, the data we want to fetch and count the number of 
+	/*Go find in the binary file, the data we want to fetch and count the number of
 	 * instances it appears: */
 	if(my_rank==0){
@@ -2410,5 +2430,5 @@
 
 			/*Read the record length, and use it to skip the record: */
-			if(fread(&record_length,sizeof(int),1,fid)!=1) _error_("Could not read record_length");
+			if(fread(&record_length,sizeof(long long),1,fid)!=1) _error_("Could not read record_length");
 			fseek(fid,record_length,SEEK_CUR);
 			xDelete<char>(record_name);
@@ -2422,5 +2442,5 @@
 		}
 
-		/*Reset FILE* position to the beginning of the file, and start again, this time saving the data information 
+		/*Reset FILE* position to the beginning of the file, and start again, this time saving the data information
 		 * as we find it: */
 		counter=0;
@@ -2454,5 +2474,5 @@
 			if(strcmp(record_name,data_name)==0){
 				/*Ok, we have found the correct string. Pass the record length, and read data type code: */
-				fseek(fid,sizeof(int),SEEK_CUR);
+				fseek(fid,sizeof(long long),SEEK_CUR);
 				if(fread(&record_code,sizeof(int),1,fid)!=1) _error_("Could not read record_code");
 
@@ -2466,7 +2486,7 @@
 
 				/*backup and skip over the record, as we have more work to do: */
-				if(5<=record_code && record_code<=7) fseek(fid,-sizeof(int),SEEK_CUR);
-				fseek(fid,-sizeof(int),SEEK_CUR);
-				fseek(fid,-sizeof(int),SEEK_CUR);
+				if(5<=record_code && record_code<=7) fseek(fid,-sizeof(int),SEEK_CUR); /*rewind for nodal or elementary type*/
+				fseek(fid,-sizeof(int),SEEK_CUR);/*rewind for data code*/
+				fseek(fid,-sizeof(long long),SEEK_CUR);/*rewind for record length*/
 
 				/*increment counter: */
@@ -2475,5 +2495,5 @@
 
 			/*Read the record length, and use it to skip this record, as it has already been processed: */
-			if(fread(&record_length,sizeof(int),1,fid)!=1) _error_("Could not read record_length");
+			if(fread(&record_length,sizeof(long long),1,fid)!=1) _error_("Could not read record_length");
 			/*skip: */
 			fseek(fid,record_length,SEEK_CUR);
@@ -2483,5 +2503,5 @@
 
 	/*Broadcast data: */
-	ISSM_MPI_Bcast(&num_instances,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast(&num_instances,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 	/*Assign output pointers:*/
@@ -2505,5 +2525,5 @@
 	char* record_name = NULL;
 	int   record_name_size;
-	int record_length;
+	long long record_length;
 	int record_code;       //1 to 7 number
 	int vector_type   = 0; //nodal or elementary
@@ -2519,4 +2539,5 @@
 
 		/*First set FILE* position to the beginning of the file: */
+		_assert_(fid);
 		fseek(fid,0,SEEK_SET);
 
@@ -2551,7 +2572,6 @@
 			if(strcmp(record_name,data_name)==0){
 				/*Ok, we have found the correct string. Pass the record length, and read data type code: */
-				fseek(fid,sizeof(int),SEEK_CUR);
+				fseek(fid,sizeof(long long),SEEK_CUR);
 				if(fread(&record_code,sizeof(int),1,fid)!=1) _error_("Could not read record_code");
-
 				/*if record_code points to a vector, get its type (nodal or elementary): */
 				if((5<=record_code && record_code<=7) || record_code==10){
@@ -2564,5 +2584,5 @@
 			else{
 				/*This is not the correct string, read the record length, and use it to skip this record: */
-				if(fread(&record_length,sizeof(int),1,fid)!=1) _error_("Could not read record_length");
+				if(fread(&record_length,sizeof(long long),1,fid)!=1) _error_("Could not read record_length");
 				/*skip: */
 				fseek(fid,record_length,SEEK_CUR);
@@ -2571,10 +2591,10 @@
 		}
 	}
-	ISSM_MPI_Bcast(&found,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast(&found,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 	if(!found)_error_("could not find data with name \"" << data_name << "\" in binary file");
 
 	/*Broadcast code and vector type: */
-	ISSM_MPI_Bcast(&record_code,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
-	ISSM_MPI_Bcast(&vector_type,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+	ISSM_MPI_Bcast(&record_code,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+	ISSM_MPI_Bcast(&vector_type,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 	/*Assign output pointers:*/
Index: /issm/trunk/src/c/classes/IoModel.h
===================================================================
--- /issm/trunk/src/c/classes/IoModel.h	(revision 24312)
+++ /issm/trunk/src/c/classes/IoModel.h	(revision 24313)
@@ -65,6 +65,10 @@
 		bool *my_elements;
 		bool *my_faces;
+		bool *my_vfaces;
 		bool *my_edges;
-		int  *my_vertices;
+		bool *my_vedges;
+		bool *my_hedges;
+		bool *my_vertices;
+		int  *epart;
 
 		/*Mesh properties and connectivity tables*/
@@ -73,21 +77,24 @@
 		int *elements;
 		int *edges;
+		int *verticaledges;
+		int *horizontaledges;
 		int *elementtoedgeconnectivity;
+		int *elementtoverticaledgeconnectivity;
+		int *elementtohorizontaledgeconnectivity;
 		int *elementtofaceconnectivity;
+		int *elementtoverticalfaceconnectivity;
 		int *faces;
+		int *verticalfaces;
 		int  facescols;
 		int  meshelementtype;
 		int *numbernodetoelementconnectivity;
 		int  numberofedges;
+		int  numberofverticaledges;
+		int  numberofhorizontaledges;
 		int  numberofelements;
 		int  numberoffaces;
+		int  numberofverticalfaces;
 		int  numberofvertices;
 		int *singlenodetoelementconnectivity;
-
-		/*Data to synchronize through low level object drivers: */
-		int constraintcounter;   //keep track of how many constraints are being created in each analysis
-		int loadcounter;         //keep track of how many loads are being created in each analysis
-		int nodecounter;         //keep track of how many nodes are being created in each analysis
-		int matparcounter;       //keep track of where we end up putting this object accessed by every element.
 
 		/*Methods*/
Index: /issm/trunk/src/c/classes/Loads/Channel.cpp
===================================================================
--- /issm/trunk/src/c/classes/Loads/Channel.cpp	(revision 24313)
+++ /issm/trunk/src/c/classes/Loads/Channel.cpp	(revision 24313)
@@ -0,0 +1,721 @@
+/*!\file Channel.c
+ * \brief: implementation of the Channel object
+ */
+
+/*Headers:*/
+/*{{{*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "shared/shared.h"
+#include "../classes.h"
+/*}}}*/	
+
+/*Macros*/
+#define NUMNODES    2
+#define NUMVERTICES 2
+
+#define C_W         4.22e3   /*specific heat capacity of water (J/kg/K)*/
+#define ALPHA_C     5./4.
+#define BETA_C      3./2.
+/*Make sure these are the same as in HydrologyGlaDSAnalysis::CreateKMatrix*/
+#define ALPHA_S     5./4.
+#define BETA_S      3./2.
+#define AEPS        2.2204460492503131E-015
+
+/*Channel constructors and destructor*/
+Channel::Channel(){/*{{{*/
+	this->id         = -1;
+	this->sid        = -1;
+	this->parameters = NULL;
+	this->helement   = NULL;
+	this->element    = NULL;
+	this->hnodes     = NULL;
+	this->hvertices  = NULL;
+	this->nodes      = NULL;
+}
+/*}}}*/
+Channel::Channel(int channel_id,IssmDouble channelarea,int index,IoModel* iomodel){/*{{{*/
+//Channel::Channel(int channel_id,int i,int index,IoModel* iomodel)
+
+	this->id=channel_id;
+	this->sid=channel_id-1;
+	this->parameters = NULL;
+	this->element    = NULL;
+	this->nodes      = NULL;
+
+	/*Set channel cross section to 0*/
+	//this->S    = 0.;
+	//this->Sold = 0.;
+	this->S    = channelarea;
+	this->Sold = channelarea;
+
+	/*Get edge info*/
+	int i1 = iomodel->faces[4*index+0];
+	int i2 = iomodel->faces[4*index+1];
+	int e1 = iomodel->faces[4*index+2];
+	int e2 = iomodel->faces[4*index+3];
+
+	if(e2==-1){
+		this->boundary = true;
+	}
+	else{
+		this->boundary = false;
+	}
+
+	/*Set Element hook (4th column may be -1 for boundary edges)*/
+	this->helement  = new Hook(&e1,1);
+
+	/*Set Vertices hooks (4th column may be -1 for boundary edges)*/
+	int channel_vertex_ids[2];
+	channel_vertex_ids[0]=i1;
+	channel_vertex_ids[1]=i2;
+	this->hvertices =new Hook(&channel_vertex_ids[0],2);
+
+	/*Set Nodes hooks (!! Assumes P1 CG)*/
+	int channel_node_ids[2];
+	channel_node_ids[0]=i1;
+	channel_node_ids[1]=i2;
+	this->hnodes=new Hook(&channel_node_ids[0],2);
+
+}/*}}}*/
+Channel::~Channel(){/*{{{*/
+	this->parameters=NULL;
+	delete helement;
+	delete hnodes;
+	delete hvertices;
+}/*}}}*/
+
+/*Object virtual functions definitions:*/
+Object* Channel::copy() {/*{{{*/
+
+	Channel* channel=NULL;
+
+	channel=new Channel();
+
+	/*copy fields: */
+	channel->id=this->id;
+	channel->S=this->S;
+
+	/*point parameters: */
+	channel->parameters=this->parameters;
+
+	/*now deal with hooks and objects: */
+	channel->hnodes    = (Hook*)this->hnodes->copy();
+	channel->hvertices = (Hook*)this->hvertices->copy();
+	channel->helement  = (Hook*)this->helement->copy();
+
+	/*corresponding fields*/
+	channel->nodes    = (Node**)channel->hnodes->deliverp();
+	channel->vertices = (Vertex**)channel->hvertices->deliverp();
+	channel->element  = (Element*)channel->helement->delivers();
+
+	return channel;
+}
+/*}}}*/
+void    Channel::DeepEcho(void){/*{{{*/
+
+	_printf_("Channel:\n");
+	_printf_("   id: " << id << "\n");
+	_printf_("   S:  " << S << "\n");
+	hnodes->DeepEcho();
+	hvertices->DeepEcho();
+	helement->DeepEcho();
+	_printf_("   parameters\n");
+	if(parameters)
+	 parameters->DeepEcho();
+	else
+	 _printf_("      NULL\n");
+}		
+/*}}}*/
+void    Channel::Echo(void){/*{{{*/
+	_printf_("Channel:\n");
+	_printf_("   id: " << id << "\n");
+	_printf_("   S:  " << S << "\n");
+	hnodes->Echo();
+	hvertices->Echo();
+	helement->Echo();
+	_printf_("   parameters: " << parameters << "\n");
+}
+/*}}}*/
+int     Channel::Id(void){/*{{{*/
+	return id;
+}
+/*}}}*/
+void    Channel::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
+
+	_assert_(this);
+
+	/*ok, marshall operations: */
+	MARSHALLING_ENUM(ChannelEnum);
+	MARSHALLING(id);
+	MARSHALLING(S);
+
+	if(marshall_direction==MARSHALLING_BACKWARD){
+		this->hnodes      = new Hook();
+		this->hvertices   = new Hook();
+		this->helement    = new Hook();
+	}
+
+	this->hnodes->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	this->hvertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+
+	/*corresponding fields*/
+	nodes    =(Node**)this->hnodes->deliverp();
+	vertices =(Vertex**)this->hvertices->deliverp();
+	element  =(Element*)this->helement->delivers();
+
+}
+/*}}}*/
+int     Channel::ObjectEnum(void){/*{{{*/
+	return ChannelEnum;
+}/*}}}*/
+
+/*Load virtual functions definitions:*/
+void  Channel::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/
+
+	/*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 
+	 * datasets, using internal ids and offsets hidden in hooks: */
+	hnodes->configure((DataSet*)nodesin);
+	hvertices->configure((DataSet*)verticesin);
+	helement->configure((DataSet*)elementsin);
+
+	/*Initialize hooked fields*/
+	this->nodes    = (Node**)hnodes->deliverp();
+	this->vertices = (Vertex**)hvertices->deliverp();
+	this->element  = (Element*)helement->delivers();
+
+	/*point parameters to real dataset: */
+	this->parameters=parametersin;
+}
+/*}}}*/
+void  Channel::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){/*{{{*/
+
+	/*recover some parameters*/
+	ElementMatrix* Ke=NULL;
+	int analysis_type;
+	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+
+	switch(analysis_type){
+		case HydrologyGlaDSAnalysisEnum:
+			Ke = this->CreateKMatrixHydrologyGlaDS();
+			break;
+		default:
+			_error_("Don't know why we should be here");
+	}
+
+	/*Add to global matrix*/
+	if(Ke){
+		Ke->AddToGlobal(Kff,Kfs);
+		delete Ke;
+	}
+
+}
+/*}}}*/
+void  Channel::CreatePVector(Vector<IssmDouble>* pf){/*{{{*/
+
+	/*recover some parameters*/
+	ElementVector* pe=NULL;
+	int analysis_type;
+	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+
+	switch(analysis_type){
+		case HydrologyGlaDSAnalysisEnum:
+			pe = this->CreatePVectorHydrologyGlaDS();
+			break;
+		default:
+			_error_("Don't know why we should be here");
+	}
+
+	/*Add to global matrix*/
+	if(pe){
+		pe->AddToGlobal(pf);
+		delete pe;
+	}
+
+}
+/*}}}*/
+void  Channel::GetNodesLidList(int* lidlist){/*{{{*/
+
+	_assert_(lidlist);
+	_assert_(nodes);
+
+	for(int i=0;i<NUMNODES;i++) lidlist[i]=nodes[i]->Lid();
+}
+/*}}}*/
+void  Channel::GetNodesSidList(int* sidlist){/*{{{*/
+
+	_assert_(sidlist);
+	_assert_(nodes);
+
+	for(int i=0;i<NUMNODES;i++) sidlist[i]=nodes[i]->Sid();
+}
+/*}}}*/
+int   Channel::GetNumberOfNodes(void){/*{{{*/
+	return NUMNODES;
+}
+/*}}}*/
+bool  Channel::IsPenalty(void){/*{{{*/
+	return false;
+}
+/*}}}*/
+void  Channel::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){/*{{{*/
+
+	/*No stiffness loads applied, do nothing: */
+	return;
+
+}
+/*}}}*/
+void  Channel::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){/*{{{*/
+
+	/*No penalty loads applied, do nothing: */
+	return;
+
+}
+/*}}}*/
+void  Channel::ResetHooks(){/*{{{*/
+
+	this->nodes=NULL;
+	this->vertices=NULL;
+	this->element=NULL;
+	this->parameters=NULL;
+
+	/*Get Element type*/
+	this->hnodes->reset();
+	this->hvertices->reset();
+	this->helement->reset();
+
+}
+/*}}}*/
+void  Channel::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/
+
+}
+/*}}}*/
+void  Channel::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/
+
+	/*Output */
+	int d_nz = 0;
+	int o_nz = 0;
+
+	/*Loop over all nodes*/
+	for(int i=0;i<this->GetNumberOfNodes();i++){
+
+		if(!flags[this->nodes[i]->Lid()]){
+
+			/*flag current node so that no other element processes it*/
+			flags[this->nodes[i]->Lid()]=true;
+
+			int counter=0;
+			while(flagsindices[counter]>=0) counter++;
+			flagsindices[counter]=this->nodes[i]->Lid();
+
+			/*if node is clone, we have an off-diagonal non-zero, else it is a diagonal non-zero*/
+			switch(set2_enum){
+				case FsetEnum:
+					if(nodes[i]->fsize){
+						if(this->nodes[i]->IsClone())
+						 o_nz += 1;
+						else
+						 d_nz += 1;
+					}
+					break;
+				case GsetEnum:
+					if(nodes[i]->gsize){
+						if(this->nodes[i]->IsClone())
+						 o_nz += 1;
+						else
+						 d_nz += 1;
+					}
+					break;
+				case SsetEnum:
+					if(nodes[i]->ssize){
+						if(this->nodes[i]->IsClone())
+						 o_nz += 1;
+						else
+						 d_nz += 1;
+					}
+					break;
+				default: _error_("not supported");
+			}
+		}
+	}
+
+	/*Assign output pointers: */
+	*pd_nz=d_nz;
+	*po_nz=o_nz;
+}
+/*}}}*/
+
+/*Channel specific functions*/
+ElementMatrix* Channel::CreateKMatrixHydrologyGlaDS(void){/*{{{*/
+
+	/*Initialize Element matrix and return if necessary*/
+	Tria*  tria=(Tria*)element;
+	if(!tria->IsIceInElement()) return NULL;
+	_assert_(tria->FiniteElement()==P1Enum); 
+	int index1=tria->GetVertexIndex(vertices[0]);
+	int index2=tria->GetVertexIndex(vertices[1]);
+
+	/*Intermediaries */
+	IssmDouble  Jdet,v1,qc,fFactor,Afactor,Bfactor,Xifactor;
+	IssmDouble  A,B,n,phi_old,phi,phi_0,dPw,ks,Ngrad;
+	IssmDouble  H,h,b,dphi[2],dphids,dphimds,db[2],dbds;
+	IssmDouble  xyz_list[NUMVERTICES][3];
+	IssmDouble  xyz_list_tria[3][3];
+	const int   numnodes = NUMNODES;
+
+	/*Initialize Element vector and other vectors*/
+	ElementMatrix* Ke=new ElementMatrix(this->nodes,NUMNODES,this->parameters);
+	IssmDouble     basis[NUMNODES];
+	IssmDouble     dbasisdx[2*NUMNODES];
+	IssmDouble     dbasisds[NUMNODES];
+
+	/*Retrieve all inputs and parameters*/
+	GetVerticesCoordinates(&xyz_list[0][0]     ,this->vertices,NUMVERTICES);
+	GetVerticesCoordinates(&xyz_list_tria[0][0],tria->vertices,3);
+
+	IssmDouble L         = element->FindParam(MaterialsLatentheatEnum);
+	IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble g         = element->FindParam(ConstantsGEnum);
+	IssmDouble kc        = element->FindParam(HydrologyChannelConductivityEnum);
+	IssmDouble lc        = element->FindParam(HydrologyChannelSheetWidthEnum);
+	IssmDouble c_t       = element->FindParam(HydrologyPressureMeltCoefficientEnum);
+
+	Input* h_input      = element->GetInput(HydrologySheetThicknessEnum);_assert_(h_input);
+	Input* H_input      = element->GetInput(ThicknessEnum); _assert_(H_input);
+	Input* b_input      = element->GetInput(BedEnum); _assert_(b_input);
+	Input* B_input      = element->GetInput(MaterialsRheologyBEnum);         _assert_(B_input);
+	Input* n_input      = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
+	Input* ks_input     = element->GetInput(HydrologySheetConductivityEnum); _assert_(ks_input);
+	Input* phi_input    = element->GetInput(HydraulicPotentialEnum);         _assert_(phi_input);
+
+	/*Get tangent vector*/
+	IssmDouble tx = xyz_list_tria[index2][0] - xyz_list_tria[index1][0];
+	IssmDouble ty = xyz_list_tria[index2][1] - xyz_list_tria[index1][1];
+	IssmDouble Lt = sqrt(tx*tx+ty*ty);
+	tx = tx/Lt;
+	ty = ty/Lt;
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss=new GaussTria(index1,index2,2);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+		gauss->GaussPoint(ig);
+
+		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
+		tria->GetSegmentNodalFunctions(&basis[0],gauss,index1,index2,tria->FiniteElement());
+		tria->GetSegmentNodalFunctionsDerivatives(&dbasisdx[0],&xyz_list_tria[0][0],gauss,index1,index2,tria->FiniteElement());
+		dbasisds[0] = dbasisdx[0*2+0]*tx + dbasisdx[0*2+1]*ty;
+		dbasisds[1] = dbasisdx[1*2+0]*tx + dbasisdx[1*2+1]*ty;
+
+		/*Get input values at gauss points*/
+		phi_input->GetInputDerivativeValue(&dphi[0],&xyz_list_tria[0][0],gauss);
+		b_input->GetInputDerivativeValue(&db[0],&xyz_list_tria[0][0],gauss);
+		phi_input->GetInputValue(&phi,gauss);
+		h_input->GetInputValue(&h,gauss);
+		ks_input->GetInputValue(&ks,gauss);
+		B_input->GetInputValue(&B,gauss);
+		n_input->GetInputValue(&n,gauss);
+		b_input->GetInputValue(&b,gauss);
+		H_input->GetInputValue(&H,gauss);
+
+		/*Get values for a few potentials*/
+		phi_0   = rho_water*g*b + rho_ice*g*H;
+		dphids  = dphi[0]*tx + dphi[1]*ty;
+		dphimds = rho_water*g*(db[0]*tx + db[1]*ty);
+		Ngrad   = fabs(dphids);
+		if(Ngrad<AEPS) Ngrad = AEPS;
+
+		/*Compute the effective conductivity Kc = k h^alpha |grad Phi|^{beta-2} (same for sheet)*/
+		IssmDouble Kc = kc * pow(this->S,ALPHA_C) * pow(Ngrad,BETA_C-2.);
+		IssmDouble Ks = ks * pow(h      ,ALPHA_S) * pow(Ngrad,BETA_S-2.);
+
+		/*Approx. discharge in the sheet flowing folwing in the direction of the channel ofver a width lc*/
+		qc = - Ks * dphids;
+
+		/*d(phi - phi_m)/ds*/
+		dPw = dphids - dphimds;
+
+		/*Compute f factor*/
+		fFactor = 0.;
+		if(this->S>0. || qc*dPw>0.){
+			fFactor = lc * qc;
+		}
+
+		/*Compute Afactor and Bfactor*/
+		Afactor = C_W*c_t*rho_water;
+		Bfactor = 1./L * (1./rho_ice - 1./rho_water);
+		if(dphids>0){
+			Xifactor = + Bfactor * (fabs(-Kc*dphids) + fabs(lc*qc));
+		}
+		else{
+			Xifactor = - Bfactor * (fabs(-Kc*dphids) + fabs(lc*qc));
+		}
+
+		/*Diffusive term*/
+		for(int i=0;i<numnodes;i++){
+			for(int j=0;j<numnodes;j++){
+				/*GlaDSCoupledSolver.F90 line 1659*/
+				Ke->values[i*numnodes+j] += gauss->weight*Jdet*(
+							+Kc*dbasisds[i]*dbasisds[j]                               /*Diffusion term*/
+							- Afactor * Bfactor* Kc * dPw * basis[i] * dbasisds[j]    /*First part of Pi*/
+							+ Afactor * fFactor * Bfactor * basis[i] * dbasisds[j]    /*Second part of Pi*/
+							+ Xifactor* basis[i] * dbasisds[j]                        /*Xi term*/
+							);
+			}
+		}
+
+		/*Closing rate term, see Gagliardini and Werder 2018 eq. A2 (v = v1*phi_i + v2(phi_{i+1}))*/
+		A=pow(B,-n);
+		v1 = 2./pow(n,n)*A*S*(pow(fabs(phi_0 - phi),n-1.)*( - n));
+		for(int i=0;i<numnodes;i++){
+			for(int j=0;j<numnodes;j++){
+				Ke->values[i*numnodes+j] += gauss->weight*Jdet*(-v1)*basis[i]*basis[j];
+			}
+		}
+	}
+
+	/*Clean up and return*/
+	delete gauss;
+	return Ke;
+}
+/*}}}*/
+ElementVector* Channel::CreatePVectorHydrologyGlaDS(void){/*{{{*/
+
+	/*Initialize Element matrix and return if necessary*/
+	Tria* tria=(Tria*)element;
+	if(!tria->IsIceInElement()) return NULL;
+	_assert_(tria->FiniteElement()==P1Enum); 
+	int index1=tria->GetVertexIndex(vertices[0]);
+	int index2=tria->GetVertexIndex(vertices[1]);
+
+	/*Intermediaries */
+	IssmDouble  Jdet,v2,Afactor,Bfactor,fFactor;
+	IssmDouble  A,B,n,phi_old,phi,phi_0,dphimds,dphi[2];
+	IssmDouble  H,h,b,db[2],dphids,qc,dPw,ks,Ngrad;
+	IssmDouble  xyz_list[NUMVERTICES][3];
+	IssmDouble  xyz_list_tria[3][3];
+	const int   numnodes = NUMNODES;
+
+	/*Initialize Element vector and other vectors*/
+	ElementVector* pe = new ElementVector(this->nodes,NUMNODES,this->parameters);
+	IssmDouble     basis[NUMNODES];
+
+	/*Retrieve all inputs and parameters*/
+	GetVerticesCoordinates(&xyz_list[0][0],this->vertices,NUMVERTICES);
+	GetVerticesCoordinates(&xyz_list_tria[0][0],tria->vertices,3);
+
+	IssmDouble L         = element->FindParam(MaterialsLatentheatEnum);
+	IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble kc        = element->FindParam(HydrologyChannelConductivityEnum);
+	IssmDouble g         = element->FindParam(ConstantsGEnum);
+	IssmDouble lc        = element->FindParam(HydrologyChannelSheetWidthEnum);
+	IssmDouble c_t       = element->FindParam(HydrologyPressureMeltCoefficientEnum);
+
+	Input* h_input      = element->GetInput(HydrologySheetThicknessEnum);_assert_(h_input);
+	Input* H_input      = element->GetInput(ThicknessEnum); _assert_(H_input);
+	Input* b_input      = element->GetInput(BedEnum); _assert_(b_input);
+	Input* B_input      = element->GetInput(MaterialsRheologyBEnum);         _assert_(B_input);
+	Input* n_input      = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
+	Input* ks_input     = element->GetInput(HydrologySheetConductivityEnum); _assert_(ks_input);
+	Input* phi_input    = element->GetInput(HydraulicPotentialEnum);         _assert_(phi_input);
+
+	/*Get tangent vector*/
+	IssmDouble tx = xyz_list_tria[index2][0] - xyz_list_tria[index1][0];
+	IssmDouble ty = xyz_list_tria[index2][1] - xyz_list_tria[index1][1];
+	IssmDouble Lt = sqrt(tx*tx+ty*ty);
+	tx = tx/Lt;
+	ty = ty/Lt;
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss=new GaussTria(index1,index2,2);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+		gauss->GaussPoint(ig);
+
+		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
+		tria->GetSegmentNodalFunctions(&basis[0],gauss,index1,index2,tria->FiniteElement());
+
+		/*Get input values at gauss points*/
+		b_input->GetInputDerivativeValue(&db[0],&xyz_list_tria[0][0],gauss);
+		phi_input->GetInputDerivativeValue(&dphi[0],&xyz_list_tria[0][0],gauss);
+		h_input->GetInputValue(&h,gauss);
+		ks_input->GetInputValue(&ks,gauss);
+		B_input->GetInputValue(&B,gauss);
+		n_input->GetInputValue(&n,gauss);
+		phi_input->GetInputValue(&phi,gauss);
+		b_input->GetInputValue(&b,gauss);
+		H_input->GetInputValue(&H,gauss);
+
+		/*Get values for a few potentials*/
+		phi_0   = rho_water*g*b + rho_ice*g*H;
+		dphids  = dphi[0]*tx + dphi[1]*ty;
+		dphimds = rho_water*g*(db[0]*tx + db[1]*ty);
+		Ngrad   = fabs(dphids);
+		if(Ngrad<AEPS) Ngrad = AEPS;
+
+		/*Compute the effective conductivity Ks = k h^alpha |grad Phi|^{beta-2} (same for sheet)*/
+		IssmDouble Ks = ks * pow(h,ALPHA_S) * pow(Ngrad,BETA_S-2.);
+
+		/*Approx. discharge in the sheet flowing folwing in the direction of the channel ofver a width lc*/
+		qc = - Ks * dphids;
+
+		/*d(phi - phi_m)/ds*/
+		dPw = dphids - dphimds;
+
+		/*Compute f factor*/
+		fFactor = 0.;
+		if(this->S>0. || qc*dPw>0.){
+			fFactor = lc * qc;
+		}
+
+		/*Compute Afactor and Bfactor*/
+		Afactor = C_W*c_t*rho_water;
+		Bfactor = 1./L * (1./rho_ice - 1./rho_water);
+
+		/*Compute closing rate*/
+		/*See Gagliardini and Werder 2018 eq. A2 (v = v2(phi_i) + v1*phi_{i+1})*/
+		A=pow(B,-n);
+		v2 = 2./pow(n,n)*A*this->S*(pow(fabs(phi_0 - phi),n-1.)*(phi_0 +(n-1.)*phi));
+
+		for(int i=0;i<numnodes;i++){
+			pe->values[i]+= - Jdet*gauss->weight*(-v2)*basis[i];
+			pe->values[i]+= + Jdet*gauss->weight*Afactor*Bfactor*fFactor*dphimds*basis[i];
+		}
+	}
+
+	/*Clean up and return*/
+	delete gauss;
+	return pe;
+}
+/*}}}*/
+void           Channel::SetChannelCrossSectionOld(void){/*{{{*/
+
+	this->Sold = this->S;
+
+} /*}}}*/
+void           Channel::UpdateChannelCrossSection(void){/*{{{*/
+
+	/*Initialize Element matrix and return if necessary*/
+	Tria*  tria=(Tria*)element;
+	if(!tria->IsIceInElement() || this->boundary){
+		this->S = 0.;
+		return;
+	}
+	_assert_(tria->FiniteElement()==P1Enum); 
+	int index1=tria->GetVertexIndex(vertices[0]);
+	int index2=tria->GetVertexIndex(vertices[1]);
+
+	/*Intermediaries */
+	IssmDouble  A,B,n,phi,phi_0,ks,Ngrad;
+	IssmDouble  H,h,b,dphi[2],dphids,dphimds,db[2],dbds;
+	IssmDouble  xyz_list[NUMVERTICES][3];
+	IssmDouble  xyz_list_tria[3][3];
+
+	/*Retrieve all inputs and parameters*/
+	GetVerticesCoordinates(&xyz_list[0][0]     ,this->vertices,NUMVERTICES);
+	GetVerticesCoordinates(&xyz_list_tria[0][0],tria->vertices,3);
+
+	IssmDouble L         = element->FindParam(MaterialsLatentheatEnum);
+	IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble g         = element->FindParam(ConstantsGEnum);
+	IssmDouble kc        = element->FindParam(HydrologyChannelConductivityEnum);
+	IssmDouble lc        = element->FindParam(HydrologyChannelSheetWidthEnum);
+	IssmDouble c_t       = element->FindParam(HydrologyPressureMeltCoefficientEnum);
+	IssmDouble dt        = element->FindParam(TimesteppingTimeStepEnum);
+
+	Input* h_input      = element->GetInput(HydrologySheetThicknessEnum);_assert_(h_input);
+	Input* H_input      = element->GetInput(ThicknessEnum); _assert_(H_input);
+	Input* b_input      = element->GetInput(BedEnum); _assert_(b_input);
+	Input* B_input      = element->GetInput(MaterialsRheologyBEnum);         _assert_(B_input);
+	Input* n_input      = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
+	Input* ks_input     = element->GetInput(HydrologySheetConductivityEnum); _assert_(ks_input);
+	Input* phi_input    = element->GetInput(HydraulicPotentialEnum);         _assert_(phi_input);
+
+	/*Get tangent vector*/
+	IssmDouble tx = xyz_list_tria[index2][0] - xyz_list_tria[index1][0];
+	IssmDouble ty = xyz_list_tria[index2][1] - xyz_list_tria[index1][1];
+	IssmDouble Lt = sqrt(tx*tx+ty*ty);
+	tx = tx/Lt;
+	ty = ty/Lt;
+
+	/*Evaluate fields on center of edge*/
+	GaussTria* gauss=new GaussTria();
+	gauss->GaussEdgeCenter(index1,index2);
+
+	/*Get input values at gauss points*/
+	phi_input->GetInputValue(&phi,gauss);
+	phi_input->GetInputDerivativeValue(&dphi[0],&xyz_list_tria[0][0],gauss);
+	h_input->GetInputValue(&h,gauss);
+	ks_input->GetInputValue(&ks,gauss);
+	B_input->GetInputValue(&B,gauss);
+	n_input->GetInputValue(&n,gauss);
+	b_input->GetInputValue(&b,gauss);
+	b_input->GetInputDerivativeValue(&db[0],&xyz_list_tria[0][0],gauss);
+	H_input->GetInputValue(&H,gauss);
+
+	/*Get values for a few potentials*/
+	phi_0   = rho_water*g*b + rho_ice*g*H;
+	dphids  = dphi[0]*tx + dphi[1]*ty;
+	dphimds = rho_water*g*(db[0]*tx + db[1]*ty);
+	Ngrad   = fabs(dphids);
+	if(Ngrad<AEPS) Ngrad = AEPS;
+
+	/*d(phi - phi_m)/ds*/
+	IssmDouble dPw = dphids - dphimds;
+
+	/*Approx. discharge in the sheet flowing folwing in the direction of the channel ofver a width lc*/
+	IssmDouble qc = - ks * pow(h,ALPHA_S) * pow(Ngrad,BETA_S-2.) * dphids;
+
+	/*Ice rate factor*/
+	A=pow(B,-n);
+
+	IssmDouble C = C_W*c_t*rho_water;
+	IssmDouble Qprime = -kc * pow(Ngrad,BETA_C-2.)*dphids;
+	IssmDouble N = phi_0 - phi;
+
+	bool converged  = false;
+	int  count      = 0;
+
+	while(!converged){
+
+		IssmDouble Snew = this->S;
+
+		/*Compute f factor*/
+		IssmDouble fFactor = 0.;
+		if(this->S>0. || qc*dPw>0.){
+			fFactor = lc * qc;
+		}
+
+		IssmDouble alpha = 1./(rho_ice*L)*(
+					fabs(Qprime*pow(Snew,ALPHA_C-1.)*dphids)
+					+ C*Qprime*pow(Snew,ALPHA_C-1.)*dPw
+					) - 2./pow(n,n)*A*pow(fabs(N),n-1.)*N;
+
+		IssmDouble beta = 1./(rho_ice*L)*( fabs(lc*qc*dphids) + C*fFactor*dPw );
+
+		/*Solve ODE*/
+		this->S = ODE1(alpha,beta,this->Sold,dt,2);
+		if(this->S<0.) this->S = 0.;
+		_assert_(!xIsNan<IssmDouble>(this->S)); 
+
+		count++;
+
+		if(fabs((this->S - Snew)/(Snew+AEPS))<1e-8  || count>=10) converged = true;
+	}
+
+	/*Clean up and return*/
+	delete gauss;
+}
+/*}}}*/
+void           Channel::WriteChannelCrossSection(IssmPDouble* values){/*{{{*/
+
+	_assert_(values);
+	values[this->sid] = reCast<IssmPDouble>(this->S);
+}
+/*}}}*/
Index: /issm/trunk/src/c/classes/Loads/Channel.h
===================================================================
--- /issm/trunk/src/c/classes/Loads/Channel.h	(revision 24313)
+++ /issm/trunk/src/c/classes/Loads/Channel.h	(revision 24313)
@@ -0,0 +1,89 @@
+/*!\file Channel.h
+ * \brief: header file for icefront object
+ */
+
+#ifndef _CHANNEL_H_
+#define _CHANNEL_H_
+
+/*Headers:*/
+#include "./Load.h"
+class Hook;
+class Parameters;
+class IoModel;
+class Element;
+class Vertex;
+class ElementMatrix;
+class ElementVector;
+
+class Channel: public Load {
+
+	private: 
+		IssmDouble S;
+		IssmDouble Sold;
+		bool       boundary;
+
+	public: 
+		int sid;
+		int id;
+
+		/*Hooks*/
+		Hook *helement;
+		Hook *hnodes;
+		Hook *hvertices;
+
+		/*Corresponding fields*/
+		Element     *element;
+		Vertex     **vertices;
+		Node       **nodes;
+		Parameters  *parameters;
+
+		/*Channel constructors,destructors {{{*/
+		Channel();
+		Channel(int numericalflux_id,IssmDouble channelarea,int index,IoModel* iomodel);
+		//Channel(int numericalflux_id,int i,int index,IoModel* iomodel);
+		~Channel();
+		/*}}}*/
+		/*Object virtual functions definitions:{{{ */
+		Object *copy();
+		void    DeepEcho();
+		void    Echo();
+		int     Id();
+		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
+		int     ObjectEnum();
+		/*}}}*/
+		/*Update virtual functions resolution: {{{*/
+		void InputUpdateFromConstant(IssmDouble constant, int name){/*Do nothing*/};
+		void InputUpdateFromConstant(int constant, int name){/*Do nothing*/};
+		void InputUpdateFromConstant(bool constant, int name){_error_("Not implemented yet!");}
+		void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");};
+		void InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){/*Do nothing*/}
+		void InputUpdateFromVector(IssmDouble* vector, int name, int type){/*Do nothing*/}
+		void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*Do nothing*/}
+		/*}}}*/
+		/*Load virtual functions definitions: {{{*/
+		void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
+		void CreateJacobianMatrix(Matrix<IssmDouble>* Jff){_error_("Not implemented yet");};
+		void CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
+		void CreatePVector(Vector<IssmDouble>* pf);
+		void GetNodesLidList(int* lidlist);
+		void GetNodesSidList(int* sidlist);
+		int  GetNumberOfNodes(void);
+		bool IsPenalty(void);
+		void PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");};
+		void PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax);
+		void PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax);
+		void ResetHooks();
+		void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
+		void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum);
+		/*}}}*/
+		/*Channel management:{{{*/
+		void           SetChannelCrossSectionOld(void);
+		void           UpdateChannelCrossSection(void);
+		ElementVector* CreatePVectorHydrologyGlaDS(void);
+		ElementMatrix* CreateKMatrixHydrologyGlaDS(void);
+		void           WriteChannelCrossSection(IssmPDouble* values);
+		/*}}}*/
+
+};
+
+#endif  /* _NUMERICALFLUX_H_ */
Index: /issm/trunk/src/c/classes/Loads/Friction.cpp
===================================================================
--- /issm/trunk/src/c/classes/Loads/Friction.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Loads/Friction.cpp	(revision 24313)
@@ -56,4 +56,9 @@
 	}
 
+
+	/*Checks*/
+	_assert_(!xIsNan<IssmDouble>(*palpha_complement));
+	_assert_(!xIsInf<IssmDouble>(*palpha_complement));
+
 }/*}}}*/
 void Friction::GetAlphaHydroComplement(IssmDouble* palpha_complement, Gauss* gauss){/*{{{*/
@@ -66,5 +71,4 @@
 	IssmDouble  alpha;
 	IssmDouble  Chi,Gamma;
-	IssmDouble  vx,vy,vz,vmag;
 	IssmDouble  alpha_complement;
 
@@ -75,28 +79,7 @@
 	element->GetInputValue(&n,gauss,MaterialsRheologyNEnum);
 
-	/*Get effective pressure*/
+	/*Get effective pressure and velocity magnitude*/
 	IssmDouble Neff = EffectivePressure(gauss);
-
-	//We need the velocity magnitude to evaluate the basal stress:
-	switch(dim){
-		case 1:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			vmag=sqrt(vx*vx);
-			break;
-		case 2:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			element->GetInputValue(&vy,gauss,VyEnum);
-			vmag=sqrt(vx*vx+vy*vy);
-			break;
-		case 3:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			element->GetInputValue(&vy,gauss,VyEnum);
-			element->GetInputValue(&vz,gauss,VzEnum);
-			vmag=sqrt(vx*vx+vy*vy+vz*vz);
-			break;
-		default:
-			_error_("not supported");
-	}
-	//	vmag=100./(3600.*24.*365.);
+	IssmDouble vmag = VelMag(gauss);
 
 	if (q_exp==1){
@@ -115,5 +98,4 @@
 					(Gamma/As - (alpha*q_exp*pow(Chi,q_exp-1.)* Gamma * Gamma/As));
 
-	_assert_(!xIsNan<IssmDouble>(alpha_complement));
 	/*Assign output pointers:*/
 	*palpha_complement=alpha_complement;
@@ -142,5 +124,5 @@
 	/*Compute scaling parameter*/
 	element->parameters->FindParam(&gamma,FrictionGammaEnum);
-	alpha_complement = alpha_complement/ exp((T-Tpmp)/gamma);
+	alpha_complement = alpha_complement/ (exp((T-Tpmp)/gamma)+1e-3);
 
 	/*Assign output pointers:*/
@@ -155,5 +137,4 @@
 	/*diverse: */
 	IssmDouble  r,s;
-	IssmDouble  vx,vy,vz,vmag;
 	IssmDouble  drag_p,drag_q;
 	IssmDouble  drag_coefficient;
@@ -171,32 +152,9 @@
 	/*Get effective pressure*/
 	IssmDouble Neff = EffectivePressure(gauss);
-
-	//We need the velocity magnitude to evaluate the basal stress:
-	switch(dim){
-		case 1:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			vmag=sqrt(vx*vx);
-			break;
-		case 2:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			element->GetInputValue(&vy,gauss,VyEnum);
-			vmag=sqrt(vx*vx+vy*vy);
-			break;
-		case 3:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			element->GetInputValue(&vy,gauss,VyEnum);
-			element->GetInputValue(&vz,gauss,VzEnum);
-			vmag=sqrt(vx*vx+vy*vy+vz*vz);
-			break;
-		default:
-			_error_("not supported");
-	}
+	IssmDouble vmag = VelMag(gauss);
 
 	/*Check to prevent dividing by zero if vmag==0*/
 	if(vmag==0. && (s-1.)<0.) alpha_complement=0.;
 	else alpha_complement=pow(Neff,r)*pow(vmag,(s-1));
-
-	_assert_(!xIsNan<IssmDouble>(alpha_complement));
-	_assert_(!xIsInf<IssmDouble>(alpha_complement));
 
 	/*Assign output pointers:*/
@@ -237,7 +195,18 @@
 			GetAlpha2PISM(palpha2,gauss);
 			break;
+		case 11:
+			GetAlpha2Schoof(palpha2,gauss);
+			break;
+		case 12:
+			GetAlpha2Tsai(palpha2,gauss);
+			break;
 	  default:
 			_error_("Friction law "<< this->law <<" not supported");
 	}
+
+	/*Checks*/
+	_assert_(!xIsNan<IssmDouble>(*palpha2));
+	_assert_(!xIsInf<IssmDouble>(*palpha2));
+	_assert_(*palpha2>=0);
 
 }/*}}}*/
@@ -251,5 +220,4 @@
 	IssmDouble  drag_p, drag_q;
 	IssmDouble  thickness,base,floatation_thickness,sealevel;
-	IssmDouble  vx,vy,vz,vmag;
 	IssmDouble  drag_coefficient,drag_coefficient_coulomb;
 	IssmDouble  alpha2,alpha2_coulomb;
@@ -263,7 +231,7 @@
 	element->GetInputValue(&drag_coefficient, gauss,FrictionCoefficientEnum);
 	element->GetInputValue(&drag_coefficient_coulomb, gauss,FrictionCoefficientcoulombEnum);
-	IssmDouble rho_water = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble gravity   = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble gravity   = element->FindParam(ConstantsGEnum);
 
 	//compute r and q coefficients: */
@@ -273,38 +241,24 @@
 	/*Get effective pressure*/
 	IssmDouble Neff = EffectivePressure(gauss);
-
-	/*Compute velocity magnitude*/
-	switch(dim){
-		case 1:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			vmag=sqrt(vx*vx);
-			break;
-		case 2:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			element->GetInputValue(&vy,gauss,VyEnum);
-			vmag=sqrt(vx*vx+vy*vy);
-			break;
-		case 3:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			element->GetInputValue(&vy,gauss,VyEnum);
-			element->GetInputValue(&vz,gauss,VzEnum);
-			vmag=sqrt(vx*vx+vy*vy+vz*vz);
-			break;
-		default:
-			_error_("not supported");
-	}
+	IssmDouble vmag = VelMag(gauss);
 
 	/*Check to prevent dividing by zero if vmag==0*/
-	if(vmag==0. && (s-1.)<0.) alpha2=0.;
-	else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
+	if(vmag==0. && (s-1.)<0.){
+		alpha2=0.;
+	}
+	else{
+		alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
+	}
 
 	floatation_thickness=0;
 	if(base<0) floatation_thickness=-(rho_water/rho_ice)*base;
-	if(vmag==0.) alpha2_coulomb=0.;
-	else alpha2_coulomb=drag_coefficient_coulomb*drag_coefficient_coulomb*rho_ice*gravity*(thickness-floatation_thickness)/vmag;
+	if(vmag==0.){
+		alpha2_coulomb=0.;
+	}
+	else{
+		alpha2_coulomb=drag_coefficient_coulomb*drag_coefficient_coulomb*rho_ice*gravity*max(0.,thickness-floatation_thickness)/vmag;
+	}
 
 	if(alpha2_coulomb<alpha2) alpha2=alpha2_coulomb;
-
-	_assert_(!xIsNan<IssmDouble>(alpha2));
 
 	/*Assign output pointers:*/
@@ -316,7 +270,7 @@
 		Based on Gagliardini 2007, needs a good effective pressure computation
 		Not tested so far so use at your own risks
-	  alpha2= NeffC[Chi/(1+alpha*Chi^q)]^(1/n)*1/vel  with
-		-Chi=|vel|/(C^n*Neff^n*As)
-		-alpha=(q-1)^(q-1)/q^q */
+	  alpha2= NeffC[Chi/(1+alpha*Chi^q)]^(1/n)*|vel|^(-1)  with
+		 Chi=|vel|/(C^n*Neff^n*As)
+		 alpha=(q-1)^(q-1)/q^q */
 
 	/*diverse: */
@@ -325,9 +279,6 @@
 	IssmDouble  As;
 	IssmDouble  n;
-
 	IssmDouble  alpha;
 	IssmDouble  Chi,Gamma;
-
-	IssmDouble  vx,vy,vz,vmag;
 	IssmDouble  alpha2;
 
@@ -340,27 +291,6 @@
 	/*Get effective pressure*/
 	IssmDouble Neff = EffectivePressure(gauss);
-
-	/*Compute velocity magnitude*/
-	switch(dim){
-		case 1:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			vmag=sqrt(vx*vx);
-			break;
-		case 2:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			element->GetInputValue(&vy,gauss,VyEnum);
-			vmag=sqrt(vx*vx+vy*vy);
-			break;
-		case 3:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			element->GetInputValue(&vy,gauss,VyEnum);
-			element->GetInputValue(&vz,gauss,VzEnum);
-			vmag=sqrt(vx*vx+vy*vy+vz*vz);
-			break;
-		default:
-			_error_("not supported");
-	}
-
-	//	vmag=100./(3600.*24.*365.);
+	IssmDouble vmag = VelMag(gauss);
+
 	//compute alpha and Chi coefficients: */
 	if (q_exp==1){
@@ -375,7 +305,6 @@
 	if(vmag==0.) alpha2=0.;
 	else	if (Neff==0) alpha2=0.0;
-	else	alpha2=Neff * C_param * pow(Gamma,1./n) * 1/vmag;
-
-	_assert_(!xIsNan<IssmDouble>(alpha2));
+	else	alpha2=Neff * C_param * pow(Gamma,1./n) * pow(vmag,-1);
+
 	/*Assign output pointers:*/
 	*palpha2=alpha2;
@@ -398,7 +327,7 @@
 	element->GetInputValue(&sealevel, gauss,SealevelEnum);
 	element->GetInputValue(&drag_coefficient, gauss,FrictionCoefficientEnum);
-	IssmDouble rho_water   = element->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
-	IssmDouble rho_ice     = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble gravity     = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_water   = element->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble rho_ice     = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble gravity     = element->FindParam(ConstantsGEnum);
 
 	//From base and thickness, compute effective pressure when drag is viscous:
@@ -409,5 +338,4 @@
 
 	alpha2=drag_coefficient*drag_coefficient*Neff;
-	_assert_(!xIsNan<IssmDouble>(alpha2));
 
 	/*Assign output pointers:*/
@@ -437,5 +365,5 @@
 	/*Compute scaling parameter*/
 	element->parameters->FindParam(&gamma,FrictionGammaEnum);
-	alpha2 = alpha2 / exp((T-Tpmp)/gamma);
+	alpha2 = alpha2 / (exp((T-Tpmp)/gamma)+1e-3);
 
 	/*Assign output pointers:*/
@@ -481,8 +409,4 @@
 	alpha2 = alpha2 * exp((deltaTref - deltaT)/(2*gamma));
 
-	/*Final checks in debuging mode*/
-	_assert_(!xIsNan<IssmDouble>(alpha2));
-	_assert_(!xIsInf<IssmDouble>(alpha2));
-
 	/*Assign output pointers:*/
 	*palpha2=alpha2;
@@ -496,5 +420,4 @@
 	IssmDouble  r,s;
 	IssmDouble  drag_p, drag_q;
-	IssmDouble  vx,vy,vz,vmag;
 	IssmDouble  drag_coefficient;
 	IssmDouble  alpha2;
@@ -509,32 +432,11 @@
 	s=1./drag_p;
 
-	/*Get effective pressure*/
+	/*Get effective pressure and basal velocity*/
 	IssmDouble Neff = EffectivePressure(gauss);
-
-	/*Compute velocity magnitude*/
-	switch(dim){
-		case 1:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			vmag=sqrt(vx*vx);
-			break;
-		case 2:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			element->GetInputValue(&vy,gauss,VyEnum);
-			vmag=sqrt(vx*vx+vy*vy);
-			break;
-		case 3:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			element->GetInputValue(&vy,gauss,VyEnum);
-			element->GetInputValue(&vz,gauss,VzEnum);
-			vmag=sqrt(vx*vx+vy*vy+vz*vz);
-			break;
-		default:
-			_error_("not supported");
-	}
+	IssmDouble vmag = VelMag(gauss);
 
 	/*Check to prevent dividing by zero if vmag==0*/
 	if(vmag==0. && (s-1.)<0.) alpha2=0.;
 	else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
-	_assert_(!xIsNan<IssmDouble>(alpha2));
 
 	/*Assign output pointers:*/
@@ -551,5 +453,4 @@
 	IssmDouble  Neff,F;
 	IssmDouble  thickness,base,sealevel;
-	IssmDouble  vx,vy,vz,vmag;
 	IssmDouble  drag_coefficient,water_layer;
 	IssmDouble  alpha2;
@@ -564,7 +465,7 @@
 	element->GetInputValue(&drag_coefficient, gauss,FrictionCoefficientEnum);
 	element->GetInputValue(&water_layer, gauss,FrictionWaterLayerEnum);
-	IssmDouble rho_water   = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	IssmDouble rho_ice     = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble gravity     = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_water   = element->FindParam(MaterialsRhoSeawaterEnum);
+	IssmDouble rho_ice     = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble gravity     = element->FindParam(ConstantsGEnum);
 
 	//compute r and q coefficients: */
@@ -579,28 +480,9 @@
 	if(Neff<0) Neff=0;
 
-	switch(dim){
-		case 1:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			vmag=sqrt(vx*vx);
-			break;
-		case 2:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			element->GetInputValue(&vy,gauss,VyEnum);
-			vmag=sqrt(vx*vx+vy*vy);
-			break;
-		case 3:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			element->GetInputValue(&vy,gauss,VyEnum);
-			element->GetInputValue(&vz,gauss,VzEnum);
-			vmag=sqrt(vx*vx+vy*vy+vz*vz);
-			break;
-		default:
-			_error_("not supported");
-	}
+	IssmDouble vmag = VelMag(gauss);
 
 	/*Check to prevent dividing by zero if vmag==0*/
 	if(vmag==0. && (s-1.)<0.) alpha2=0.;
 	else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
-	_assert_(!xIsNan<IssmDouble>(alpha2));
 
 	/*Assign output pointers:*/
@@ -613,5 +495,4 @@
 	/*diverse: */
 	IssmDouble  C,m;
-	IssmDouble  vx,vy,vz,vmag;
 	IssmDouble  alpha2;
 
@@ -620,28 +501,10 @@
 	element->GetInputValue(&m,FrictionMEnum);
 
-	switch(dim){
-		case 1:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			vmag=sqrt(vx*vx);
-			break;
-		case 2:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			element->GetInputValue(&vy,gauss,VyEnum);
-			vmag=sqrt(vx*vx+vy*vy);
-			break;
-		case 3:
-			element->GetInputValue(&vx,gauss,VxEnum);
-			element->GetInputValue(&vy,gauss,VyEnum);
-			element->GetInputValue(&vz,gauss,VzEnum);
-			vmag=sqrt(vx*vx+vy*vy+vz*vz);
-			break;
-		default:
-			_error_("not supported");
-	}
+	/*Get velocity magnitude*/
+	IssmDouble vmag = VelMag(gauss);
 
 	/*Check to prevent dividing by zero if vmag==0*/
 	if(vmag==0. && (1./m-1.)<0.) alpha2=0.;
 	else alpha2=pow(C,-1./m)*pow(vmag,(1./m-1.));
-	_assert_(!xIsNan<IssmDouble>(alpha2));
 
 	/*Assign output pointers:*/
@@ -700,6 +563,6 @@
 	element->GetInputValue(&base, gauss,BaseEnum);
 	//element->GetInputValue(&sealevel, gauss,SealevelEnum);
-	IssmDouble rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-	IssmDouble gravity   = element->GetMaterialParameter(ConstantsGEnum);
+	IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+	IssmDouble gravity   = element->FindParam(ConstantsGEnum);
 	P0 = gravity*rho_ice*thickness;
 
@@ -738,7 +601,71 @@
 	IssmDouble alpha2 = tau_c/(pow(ub+1.e-10,1.-q)*pow(u0,q));
 
-	/*Final checks in debuging mode*/
-	_assert_(!xIsNan<IssmDouble>(alpha2));
-	_assert_(!xIsInf<IssmDouble>(alpha2));
+	/*Assign output pointers:*/
+	*palpha2=alpha2;
+}/*}}}*/
+void Friction::GetAlpha2Schoof(IssmDouble* palpha2, Gauss* gauss){/*{{{*/
+
+	/*This routine calculates the basal friction coefficient 
+	 *
+	 *               C |u_b|^(m-1)
+	 * alpha2= __________________________
+	 *          (1+(C/(Cmax N))^1/m |u_b| )^m
+	 *
+	 * */
+
+	/*diverse: */
+	IssmDouble  C,Cmax,m,alpha2;
+
+	/*Recover parameters: */
+	element->GetInputValue(&Cmax,gauss,FrictionCmaxEnum);
+	element->GetInputValue(&C,gauss,FrictionCEnum);
+	element->GetInputValue(&m,FrictionMEnum);
+
+	/*Get effective pressure and velocity magnitude*/
+	IssmDouble N  = EffectivePressure(gauss);
+	IssmDouble ub = VelMag(gauss);
+
+	/*Compute alpha^2*/
+	if(ub<1e-10){
+		alpha2 = 0.;
+	}
+	else{
+		alpha2= (C*pow(ub,m-1.)) / pow(1.+  pow(C/(Cmax*N),1./m)*ub,m);
+	}
+
+	/*Assign output pointers:*/
+	*palpha2=alpha2;
+}/*}}}*/
+void Friction::GetAlpha2Tsai(IssmDouble* palpha2, Gauss* gauss){/*{{{*/
+
+	/*This routine calculates the basal friction coefficient 
+	 *
+	 * alpha2= min(C |ub|^m , f N ) / |ub|
+	 *
+	 * */
+
+	/*diverse: */
+	IssmDouble  C,f,m,alpha2;
+
+	/*Recover parameters: */
+	element->GetInputValue(&f,gauss,FrictionfEnum);
+	element->GetInputValue(&C,gauss,FrictionCEnum);
+	element->GetInputValue(&m,FrictionMEnum);
+
+	/*Get effective pressure and velocity magnitude*/
+	IssmDouble N  = EffectivePressure(gauss);
+	IssmDouble ub = VelMag(gauss);
+
+	/*Compute alpha^2*/
+	if(ub<1e-10){
+		alpha2 = 0.;
+	}
+	else{
+		alpha2= C*pow(ub,m);
+
+		if(alpha2>f*N) alpha2 = f*N;
+
+		alpha2 = alpha2/ub;
+	}
 
 	/*Assign output pointers:*/
@@ -764,7 +691,7 @@
 					 element->GetInputValue(&base, gauss,BaseEnum);
 					 element->GetInputValue(&sealevel, gauss,SealevelEnum);
-					 IssmDouble rho_water = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-					 IssmDouble rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-					 IssmDouble gravity   = element->GetMaterialParameter(ConstantsGEnum);
+					 IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+					 IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+					 IssmDouble gravity   = element->FindParam(ConstantsGEnum);
 					 p_ice   = gravity*rho_ice*thickness;
 					 p_water = rho_water*gravity*(sealevel-base);
@@ -774,6 +701,6 @@
 		case 1:{
 					 element->GetInputValue(&thickness, gauss,ThicknessEnum);
-					 IssmDouble rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-					 IssmDouble gravity   = element->GetMaterialParameter(ConstantsGEnum);
+					 IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+					 IssmDouble gravity   = element->FindParam(ConstantsGEnum);
 					 p_ice   = gravity*rho_ice*thickness;
 					 p_water = 0.;
@@ -785,7 +712,7 @@
 					 element->GetInputValue(&base, gauss,BaseEnum);
 					 element->GetInputValue(&sealevel, gauss,SealevelEnum);
-					 IssmDouble rho_water = element->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-					 IssmDouble rho_ice   = element->GetMaterialParameter(MaterialsRhoIceEnum);
-					 IssmDouble gravity   = element->GetMaterialParameter(ConstantsGEnum);
+					 IssmDouble rho_water = element->FindParam(MaterialsRhoSeawaterEnum);
+					 IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
+					 IssmDouble gravity   = element->FindParam(ConstantsGEnum);
 					 p_ice   = gravity*rho_ice*thickness;
 					 p_water = max(0.,rho_water*gravity*(sealevel-base));
@@ -810,2 +737,32 @@
 
 }/*}}}*/
+IssmDouble Friction::VelMag(Gauss* gauss){/*{{{*/
+	/*Get effective pressure as a function of  flag */
+
+
+	/*diverse*/
+	IssmDouble vx,vy,vz,vmag;
+
+	switch(dim){
+		case 1:
+			element->GetInputValue(&vx,gauss,VxEnum);
+			vmag=sqrt(vx*vx);
+			break;
+		case 2:
+			element->GetInputValue(&vx,gauss,VxEnum);
+			element->GetInputValue(&vy,gauss,VyEnum);
+			vmag=sqrt(vx*vx+vy*vy);
+			break;
+		case 3:
+			element->GetInputValue(&vx,gauss,VxEnum);
+			element->GetInputValue(&vy,gauss,VyEnum);
+			element->GetInputValue(&vz,gauss,VzEnum);
+			vmag=sqrt(vx*vx+vy*vy+vz*vz);
+			break;
+		default:
+			_error_("not supported");
+	}
+
+	return vmag;
+
+}/*}}}*/
Index: /issm/trunk/src/c/classes/Loads/Friction.h
===================================================================
--- /issm/trunk/src/c/classes/Loads/Friction.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Loads/Friction.h	(revision 24313)
@@ -7,16 +7,11 @@
 
 /*Headers:*/
-/*{{{*/
 class Inputs;
-class Matpar;
 class GaussPenta;
 class GaussTria;
-/*}}}*/
 
 class Friction{
 
 	public:
-		int analysis_type;
-
 		Element* element;
 		int      dim;
@@ -44,6 +39,9 @@
 		void  GetAlpha2WeertmanTemp(IssmDouble* palpha2,Gauss* gauss);
 		void  GetAlpha2PISM(IssmDouble* palpha2,Gauss* gauss);
+		void  GetAlpha2Schoof(IssmDouble* palpha2,Gauss* gauss);
+		void  GetAlpha2Tsai(IssmDouble* palpha2,Gauss* gauss);
 
 		IssmDouble EffectivePressure(Gauss* gauss);
+		IssmDouble VelMag(Gauss* gauss);
 };
 
Index: /issm/trunk/src/c/classes/Loads/Load.h
===================================================================
--- /issm/trunk/src/c/classes/Loads/Load.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Loads/Load.h	(revision 24313)
@@ -19,7 +19,6 @@
 class Parameters;
 #include "../../datastructures/datastructures.h"
-#include "../Update.h"
 
-class Load: public Object,public Update{
+class Load: public Object{
 
 	public: 
@@ -32,5 +31,4 @@
 		virtual void  GetNodesSidList(int* sidlist)=0;
 		virtual int   GetNumberOfNodes(void)=0;
-		virtual bool  InAnalysis(int analysis_type)=0;
 		virtual bool  IsPenalty(void)=0;
 		virtual void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax)=0;
Index: /issm/trunk/src/c/classes/Loads/Loads.cpp
===================================================================
--- /issm/trunk/src/c/classes/Loads/Loads.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Loads/Loads.cpp	(revision 24313)
@@ -16,4 +16,7 @@
 
 #include "../../shared/io/Comm/IssmComm.h"
+#include "../../shared/Numerics/recast.h"
+#include "../../shared/Enum/EnumDefinitions.h"
+#include "../../shared/Exceptions/exceptions.h"
 #include "./Loads.h"
 #include "./Load.h"
@@ -48,5 +51,5 @@
 }
 /*}}}*/
-bool Loads::IsPenalty(int analysis_type){/*{{{*/
+bool Loads::IsPenalty(){/*{{{*/
 
 	int ispenalty=0;
@@ -55,9 +58,6 @@
 	/*Now go through all loads, and get how many nodes they own, unless they are clone nodes: */
 	for(int i=0;i<this->Size();i++){
-
 		Load* load=xDynamicCast<Load*>(this->GetObjectByOffset(i));
-		if (load->InAnalysis(analysis_type)){
-			if(load->IsPenalty()) ispenalty++;
-		}
+		if(load->IsPenalty()) ispenalty++;
 	}
 
@@ -72,25 +72,19 @@
 }
 /*}}}*/
-int  Loads::MaxNumNodes(int analysis_type){/*{{{*/
+int  Loads::MaxNumNodes(){/*{{{*/
 
 	int max=0;
 	int allmax;
-	int numnodes=0;
 
 	/*Now go through all loads, and get how many nodes they own, unless they are clone nodes: */
 	for(int i=0;i<this->Size();i++){
-
 		Load* load=xDynamicCast<Load*>(this->GetObjectByOffset(i));
-		if (load->InAnalysis(analysis_type)){
-			numnodes=load->GetNumberOfNodes();
-			if(numnodes>max)max=numnodes;
-		}
+		int numnodes=load->GetNumberOfNodes();
+		if(numnodes>max)max=numnodes;
 	}
 
 	/*Grab max of all cpus: */
 	ISSM_MPI_Allreduce((void*)&max,(void*)&allmax,1,ISSM_MPI_INT,ISSM_MPI_MAX,IssmComm::GetComm());
-	max=allmax;
-
-	return max;
+	return allmax;
 }
 /*}}}*/
@@ -102,25 +96,4 @@
 	/*Get number of local loads*/
 	localloads=this->Size();
-
-	/*figure out total number of loads combining all the cpus (no clones here)*/
-	ISSM_MPI_Reduce(&localloads,&numberofloads,1,ISSM_MPI_INT,ISSM_MPI_SUM,0,IssmComm::GetComm() );
-	ISSM_MPI_Bcast(&numberofloads,1,ISSM_MPI_INT,0,IssmComm::GetComm());
-
-	return numberofloads;
-}
-/*}}}*/
-int  Loads::NumberOfLoads(int analysis_type){/*{{{*/
-
-	int localloads = 0;
-	int numberofloads;
-
-	/*Get number of local loads*/
-	for(int i=0;i<this->Size();i++){
-
-		Load* load=xDynamicCast<Load*>(this->GetObjectByOffset(i));
-
-		/*Check that this load corresponds to our analysis currently being carried out: */
-		if (load->InAnalysis(analysis_type)) localloads++;
-	}
 
 	/*figure out total number of loads combining all the cpus (no clones here)*/
@@ -151,31 +124,7 @@
 
 	for ( object=objects.begin() ; object < objects.end(); object++ ){
-
 		load=xDynamicCast<Load*>(*object);
 		load->SetCurrentConfiguration(elements,loads,nodes,vertices,materials,parameters);
-
 	}
-
 }
 /*}}}*/
-int  Loads::Size(void){/*{{{*/
-
-	return this->DataSet::Size();
-}
-/*}}}*/
-int  Loads::Size(int analysis_type){/*{{{*/
-
-	int localloads = 0;
-
-	/*Get number of local loads*/
-	for(int i=0;i<this->Size();i++){
-
-		Load* load=xDynamicCast<Load*>(this->GetObjectByOffset(i));
-
-		/*Check that this load corresponds to our analysis currently being carried out: */
-		if (load->InAnalysis(analysis_type)) localloads++;
-	}
-
-	return localloads;
-}
-/*}}}*/
Index: /issm/trunk/src/c/classes/Loads/Loads.h
===================================================================
--- /issm/trunk/src/c/classes/Loads/Loads.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Loads/Loads.h	(revision 24313)
@@ -24,13 +24,9 @@
 		/*numerics*/
 		void  Configure(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters);
-		bool  IsPenalty(int analysis);
-		int   MaxNumNodes(int analysis);
-		int   NumberOfLoads(void);
-		int   NumberOfLoads(int analysis);
+		bool  IsPenalty();
+		int   MaxNumNodes();
+		int   NumberOfLoads();
 		void  ResetHooks();
 		void  SetCurrentConfiguration(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters);
-		int   Size(int analysis);
-		int   Size(void);
-
 };
 
Index: /issm/trunk/src/c/classes/Loads/Moulin.cpp
===================================================================
--- /issm/trunk/src/c/classes/Loads/Moulin.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Loads/Moulin.cpp	(revision 24313)
@@ -23,15 +23,13 @@
 	this->parameters=NULL;
 	this->hnode=NULL;
+	this->hvertex=NULL;
 	this->node=NULL;
 	this->helement=NULL;
 	this->element=NULL;
-	this->hmatpar=NULL;
-	this->matpar=NULL;
-}
-/*}}}*/
-Moulin::Moulin(int id, int index, IoModel* iomodel, int in_analysis_type){ //i is the element index/*{{{*/
+}
+/*}}}*/
+Moulin::Moulin(int id, int index, IoModel* iomodel){ /*{{{*/
 
 	int pengrid_node_id;
-	int pengrid_matpar_id;
 	int pengrid_element_id;
 
@@ -43,27 +41,25 @@
 	/*id: */
 	this->id=id;
-	this->analysis_type=in_analysis_type;
 
 	/*hooks: */
-	pengrid_node_id=iomodel->nodecounter+index+1;
+	pengrid_node_id=index+1;
 	pengrid_element_id=iomodel->singlenodetoelementconnectivity[index];
 	_assert_(pengrid_element_id);
-	pengrid_matpar_id=iomodel->numberofelements+1; //refers to the constant material parameters object
 
 	this->hnode=new Hook(&pengrid_node_id,1);
+	this->hvertex=new Hook(&pengrid_node_id,1);
 	this->helement=new Hook(&pengrid_element_id,1);
-	this->hmatpar=new Hook(&pengrid_matpar_id,1);
 
 	//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
 	this->parameters=NULL;
 	this->node=NULL;
+	this->vertex=NULL;
 	this->element=NULL;
-	this->matpar=NULL;
 }
 /*}}}*/
 Moulin::~Moulin(){/*{{{*/
 	delete hnode;
+	delete hvertex;
 	delete helement;
-	delete hmatpar;
 	return;
 }
@@ -79,5 +75,4 @@
 	/*copy fields: */
 	pengrid->id=this->id;
-	pengrid->analysis_type=this->analysis_type;
 
 	/*point parameters: */
@@ -86,10 +81,10 @@
 	/*now deal with hooks and objects: */
 	pengrid->hnode=(Hook*)this->hnode->copy();
-	pengrid->hmatpar=(Hook*)this->hmatpar->copy();
+	pengrid->hvertex=(Hook*)this->hvertex->copy();
 	pengrid->helement=(Hook*)this->helement->copy();
 
 	/*corresponding fields*/
 	pengrid->node  =(Node*)pengrid->hnode->delivers();
-	pengrid->matpar =(Matpar*)pengrid->hmatpar->delivers();
+	pengrid->vertex=(Vertex*)pengrid->hvertex->delivers();
 	pengrid->element=(Element*)pengrid->helement->delivers();
 
@@ -101,8 +96,7 @@
 	_printf_("Moulin:\n");
 	_printf_("   id: " << id << "\n");
-	_printf_("   analysis_type: " << EnumToStringx(analysis_type) << "\n");
 	hnode->DeepEcho();
+	hvertex->DeepEcho();
 	helement->DeepEcho();
-	hmatpar->DeepEcho();
 	_printf_("   parameters\n");
 	parameters->DeepEcho();
@@ -122,19 +116,18 @@
 	MARSHALLING_ENUM(MoulinEnum);
 	MARSHALLING(id);
-	MARSHALLING(analysis_type);
 
 	if(marshall_direction==MARSHALLING_BACKWARD){
 		this->hnode      = new Hook();
+		this->hvertex      = new Hook();
 		this->helement   = new Hook();
-		this->hmatpar    = new Hook();
 	}
 
 	this->hnode->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	this->hvertex->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	this->hmatpar->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 
 	/*corresponding fields*/
 	node   =(Node*)this->hnode->delivers();
-	matpar =(Matpar*)this->hmatpar->delivers();
+	vertex =(Vertex*)this->hvertex->delivers();
 	element=(Element*)this->helement->delivers();
 }
@@ -152,11 +145,11 @@
 	 * datasets, using internal ids and offsets hidden in hooks: */
 	hnode->configure(nodesin);
+	hvertex->configure(verticesin);
 	helement->configure(elementsin);
-	hmatpar->configure(materialsin);
 
 	/*Get corresponding fields*/
 	node=(Node*)hnode->delivers();
+	vertex=(Vertex*)hvertex->delivers();
 	element=(Element*)helement->delivers();
-	matpar=(Matpar*)hmatpar->delivers();
 
 	/*point parameters to real dataset: */
@@ -166,6 +159,31 @@
 void  Moulin::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){/*{{{*/
 
-	/*No loads applied, do nothing: */
-	return;
+	/*recover some parameters*/
+	ElementMatrix* Ke=NULL;
+	int analysis_type;
+	this->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+
+	switch(analysis_type){
+		case HydrologyGlaDSAnalysisEnum:
+			Ke = this->CreateKMatrixHydrologyGlaDS();
+			break;
+		case HydrologyShaktiAnalysisEnum:
+			/*do nothing: */
+			return;
+		case HydrologyDCInefficientAnalysisEnum:
+			/*do nothing: */
+			return;
+		case HydrologyDCEfficientAnalysisEnum:
+			/*do nothing: */
+			return;
+		default:
+			_error_("Don't know why we should be here");
+
+	}
+	/*Add to global matrix*/
+	if(Ke){
+		Ke->AddToGlobal(Kff,Kfs);
+		delete Ke;
+	}
 
 }
@@ -178,18 +196,20 @@
 
 	switch(analysis_type){
-
-	case HydrologyShaktiAnalysisEnum:
-		pe = this->CreatePVectorHydrologyShakti();
-		break;
-	case HydrologyDCInefficientAnalysisEnum:
-		pe = CreatePVectorHydrologyDCInefficient();
-		break;
-	case HydrologyDCEfficientAnalysisEnum:
-		pe = CreatePVectorHydrologyDCEfficient();
-		break;
-	default:
-		_error_("Don't know why we should be here");
-		/*No loads applied, do nothing: */
-		return;
+		case HydrologyGlaDSAnalysisEnum:
+			pe = this->CreatePVectorHydrologyGlaDS();
+			break;
+		case HydrologyShaktiAnalysisEnum:
+			pe = this->CreatePVectorHydrologyShakti();
+			break;
+		case HydrologyDCInefficientAnalysisEnum:
+			pe = CreatePVectorHydrologyDCInefficient();
+			break;
+		case HydrologyDCEfficientAnalysisEnum:
+			pe = CreatePVectorHydrologyDCEfficient();
+			break;
+		default:
+			_error_("Don't know why we should be here");
+			/*No loads applied, do nothing: */
+			return;
 	}
 	if(pe){
@@ -221,11 +241,6 @@
 }
 /*}}}*/
-bool  Moulin::InAnalysis(int in_analysis_type){/*{{{*/
-	if (in_analysis_type==this->analysis_type)return true;
-	else return false;
-}
-/*}}}*/
 bool  Moulin::IsPenalty(void){/*{{{*/
-	return true;
+	return false;
 }
 /*}}}*/
@@ -245,11 +260,10 @@
 	this->node=NULL;
 	this->element=NULL;
-	this->matpar=NULL;
 	this->parameters=NULL;
 
 	/*Get Element type*/
 	this->hnode->reset();
+	this->hvertex->reset();
 	this->helement->reset();
-	this->hmatpar->reset();
 
 }
@@ -277,5 +291,5 @@
 		switch(set2_enum){
 			case FsetEnum:
-				if(node->indexing.fsize){
+				if(node->fsize){
 					if(this->node->IsClone())
 					 o_nz += 1;
@@ -285,5 +299,5 @@
 				break;
 			case GsetEnum:
-				if(node->indexing.gsize){
+				if(node->gsize){
 					if(this->node->IsClone())
 					 o_nz += 1;
@@ -293,5 +307,5 @@
 				break;
 			case SsetEnum:
-				if(node->indexing.ssize){
+				if(node->ssize){
 					if(this->node->IsClone())
 					 o_nz += 1;
@@ -337,4 +351,52 @@
 /*}}}*/
 
+ElementMatrix* Moulin::CreateKMatrixHydrologyGlaDS(void){/*{{{*/
+
+	/*If this node is not the master node (belongs to another partition of the
+	 * mesh), don't add the moulin input a second time*/
+	if(node->IsClone()) return NULL;
+
+	/*Initialize Element matrix*/
+	ElementMatrix* Ke=new ElementMatrix(&node,1,this->parameters);
+
+	/*Get all inputs and parameters*/
+	IssmDouble dt        = element->FindParam(TimesteppingTimeStepEnum);
+	IssmDouble rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble g         = element->FindParam(ConstantsGEnum);
+	IssmDouble Am        = 0.; //For now...
+
+	/*Load vector*/
+	Ke->values[0] = - Am/(rho_water*g)/dt;
+
+	/*Clean up and return*/
+	return Ke;
+}
+/*}}}*/
+ElementVector* Moulin::CreatePVectorHydrologyGlaDS(void){/*{{{*/
+
+	/*If this node is not the master node (belongs to another partition of the
+	 * mesh), don't add the moulin input a second time*/
+	if(node->IsClone()) return NULL;
+
+	/*Initialize Element vector*/
+	ElementVector* pe=new ElementVector(&node,1,this->parameters);
+
+	/*Get all inputs and parameters*/
+	IssmDouble dt        = element->FindParam(TimesteppingTimeStepEnum);
+	IssmDouble rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
+	IssmDouble g         = element->FindParam(ConstantsGEnum);
+	IssmDouble Am        = 0.; //For now...
+
+	/*Get hydraulic potential*/
+	IssmDouble phi_old,moulin_load;
+	element->GetInputValue(&phi_old,node,HydraulicPotentialOldEnum);
+	element->GetInputValue(&moulin_load,node,HydrologyMoulinInputEnum);
+
+	pe->values[0] = moulin_load -Am/(rho_water*g) * phi_old/dt;
+
+	/*Clean up and return*/
+	return pe;
+}
+/*}}}*/
 ElementVector* Moulin::CreatePVectorHydrologyShakti(void){/*{{{*/
 
Index: /issm/trunk/src/c/classes/Loads/Moulin.h
===================================================================
--- /issm/trunk/src/c/classes/Loads/Moulin.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Loads/Moulin.h	(revision 24313)
@@ -24,15 +24,14 @@
 
 		int id;
-		int analysis_type;
 
 		/*Hooks*/
-		Hook* hnode;  //hook to 1 node
+		Hook* hnode;     //hook to 1 node
+		Hook* hvertex;   //hook to 1 vertex
 		Hook* helement;  //hook to 1 element
-		Hook* hmatpar; //hook to 1 matpar
 
 		/*Corresponding fields*/
 		Node    *node;
+		Vertex  *vertex;
 		Element *element;
-		Matpar  *matpar;
 
 		Parameters* parameters; //pointer to solution parameters
@@ -42,5 +41,5 @@
 		/*Moulin constructors, destructors {{{*/
 		Moulin();
-		Moulin(int index, int id, IoModel* iomodel,int analysis_type);
+		Moulin(int index, int id, IoModel* iomodel);
 		~Moulin();
 		/*}}}*/
@@ -70,5 +69,4 @@
 		void  GetNodesLidList(int* lidlist);
 		int   GetNumberOfNodes(void);
-		bool  InAnalysis(int analysis_type);
 		bool  IsPenalty(void);
 		void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");};
@@ -80,5 +78,7 @@
 		/*}}}*/
 
+		ElementMatrix* CreateKMatrixHydrologyGlaDS(void);
 		ElementVector* CreatePVectorHydrologyShakti(void);
+		ElementVector* CreatePVectorHydrologyGlaDS(void);
 		ElementVector* CreatePVectorHydrologyDCInefficient(void);
 		ElementVector* CreatePVectorHydrologyDCEfficient(void);
Index: /issm/trunk/src/c/classes/Loads/Neumannflux.cpp
===================================================================
--- /issm/trunk/src/c/classes/Loads/Neumannflux.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Loads/Neumannflux.cpp	(revision 24313)
@@ -29,5 +29,5 @@
 }
 /*}}}*/
-Neumannflux::Neumannflux(int neumannflux_id,int i,IoModel* iomodel,int* segments,int in_analysis_type){/*{{{*/
+Neumannflux::Neumannflux(int neumannflux_id,int i,IoModel* iomodel,int* segments){/*{{{*/
 
 	/*Some sanity checks*/
@@ -44,6 +44,6 @@
 
 	/*2: Get the ids of the nodes*/
-	neumannflux_node_ids[0]=iomodel->nodecounter+neumannflux_vertex_ids[0];
-	neumannflux_node_ids[1]=iomodel->nodecounter+neumannflux_vertex_ids[1];
+	neumannflux_node_ids[0]=neumannflux_vertex_ids[0];
+	neumannflux_node_ids[1]=neumannflux_vertex_ids[1];
 
 	/*Get element id*/
@@ -52,5 +52,4 @@
 	/*Ok, we have everything to build the object: */
 	this->id=neumannflux_id;
-	this->analysis_type=in_analysis_type;
 
 	/*Hooks: */
@@ -82,5 +81,4 @@
 	/*copy fields: */
 	neumannflux->id=this->id;
-	neumannflux->analysis_type=this->analysis_type;
 
 	/*point parameters: */
@@ -104,5 +102,4 @@
 	_printf_("Neumannflux:\n");
 	_printf_("   id: " << id << "\n");
-	_printf_("   analysis_type: " << EnumToStringx(analysis_type) << "\n");
 	hnodes->DeepEcho();
 	hvertices->DeepEcho();
@@ -118,5 +115,4 @@
 	_printf_("Neumannflux:\n");
 	_printf_("   id: " << id << "\n");
-	_printf_("   analysis_type: " << EnumToStringx(analysis_type) << "\n");
 	hnodes->Echo();
 	hvertices->Echo();
@@ -136,5 +132,4 @@
 	MARSHALLING_ENUM(NeumannfluxEnum);
 	MARSHALLING(id);
-	MARSHALLING(analysis_type);
 
 	if(marshall_direction==MARSHALLING_BACKWARD){
@@ -192,4 +187,7 @@
 			/*Nothing!*/
 			break;
+		case HydrologyGlaDSAnalysisEnum:
+			/*Nothing!*/
+			break;
 		default:
 			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
@@ -215,4 +213,7 @@
 			pe=CreatePVectorHydrologyShakti();
 			break;
+		case HydrologyGlaDSAnalysisEnum:
+			pe=CreatePVectorHydrologyGlaDS();
+			break;
 		default:
 			_error_("analysis " << analysis_type << " (" << EnumToStringx(analysis_type) << ") not supported yet");
@@ -248,9 +249,4 @@
 }
 /*}}}*/
-bool  Neumannflux::InAnalysis(int in_analysis_type){/*{{{*/
-	if (in_analysis_type==this->analysis_type) return true;
-	else return false;
-}
-/*}}}*/
 bool  Neumannflux::IsPenalty(void){/*{{{*/
 	return false;
@@ -310,5 +306,5 @@
 			switch(set2_enum){
 				case FsetEnum:
-					if(nodes[i]->indexing.fsize){
+					if(nodes[i]->fsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -318,5 +314,5 @@
 					break;
 				case GsetEnum:
-					if(nodes[i]->indexing.gsize){
+					if(nodes[i]->gsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -326,5 +322,5 @@
 					break;
 				case SsetEnum:
-					if(nodes[i]->indexing.ssize){
+					if(nodes[i]->ssize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -368,6 +364,6 @@
 
 	/*Check wether it is an inflow or outflow BC (0 is the middle of the segment)*/
-	int index1=tria->GetNodeIndex(nodes[0]);
-	int index2=tria->GetNodeIndex(nodes[1]);
+	int index1=tria->GetVertexIndex(vertices[0]);
+	int index2=tria->GetVertexIndex(vertices[1]);
 
 	/* Start  looping on the number of gaussian points: */
@@ -389,2 +385,46 @@
 }
 /*}}}*/
+ElementVector* Neumannflux::CreatePVectorHydrologyGlaDS(void){/*{{{*/
+
+	/* constants*/
+	const int numdof=2;
+
+	/* Intermediaries*/
+	IssmDouble Jdet,flux;
+	IssmDouble xyz_list[NUMVERTICES][3];
+	IssmDouble basis[numdof];
+
+	/*Initialize Load Vector and return if necessary*/
+	Tria*  tria=(Tria*)element;
+	_assert_(tria->FiniteElement()==P1Enum); 
+	if(!tria->IsIceInElement() || tria->IsFloating()) return NULL;
+
+	/*Initialize Element vector and other vectors*/
+	ElementVector* pe=new ElementVector(nodes,NUMNODES_BOUNDARY,this->parameters);
+
+	/*Retrieve all inputs and parameters*/
+	GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+	Input* flux_input = tria->inputs->GetInput(HydrologyNeumannfluxEnum);  _assert_(flux_input); 
+
+	/*Check wether it is an inflow or outflow BC (0 is the middle of the segment)*/
+	int index1=tria->GetVertexIndex(vertices[0]);
+	int index2=tria->GetVertexIndex(vertices[1]);
+
+	/* Start  looping on the number of gaussian points: */
+	GaussTria* gauss=new GaussTria(index1,index2,2);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+
+		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
+		tria->GetSegmentNodalFunctions(&basis[0],gauss,index1,index2,tria->FiniteElement());
+		flux_input->GetInputValue(&flux,gauss);
+
+		for(int i=0;i<numdof;i++) pe->values[i] += gauss->weight*Jdet*flux*basis[i];
+	}
+
+	/*Clean up and return*/
+	delete gauss;
+	return pe;
+}
+/*}}}*/
Index: /issm/trunk/src/c/classes/Loads/Neumannflux.h
===================================================================
--- /issm/trunk/src/c/classes/Loads/Neumannflux.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Loads/Neumannflux.h	(revision 24313)
@@ -20,5 +20,4 @@
 	public: 
 		int id;
-		int analysis_type;
 
 		/*Hooks*/
@@ -35,5 +34,5 @@
 		/*Neumannflux constructors,destructors {{{*/
 		Neumannflux();
-		Neumannflux(int numericalflux_id,int i,IoModel* iomodel,int* segments,int analysis_type);
+		Neumannflux(int numericalflux_id,int i,IoModel* iomodel,int* segments);
 		~Neumannflux();
 		/*}}}*/
@@ -63,5 +62,4 @@
 		void GetNodesSidList(int* sidlist);
 		int  GetNumberOfNodes(void);
-		bool InAnalysis(int analysis_type);
 		bool IsPenalty(void);
 		void PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");};
@@ -74,4 +72,5 @@
 		/*Neumannflux management:{{{*/
 		ElementVector* CreatePVectorHydrologyShakti(void);
+		ElementVector* CreatePVectorHydrologyGlaDS(void);
 		/*}}}*/
 
Index: /issm/trunk/src/c/classes/Loads/Numericalflux.cpp
===================================================================
--- /issm/trunk/src/c/classes/Loads/Numericalflux.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Loads/Numericalflux.cpp	(revision 24313)
@@ -17,6 +17,4 @@
 /*Load macros*/
 #define NUMVERTICES 2
-#define NUMNODES_INTERNAL 4
-#define NUMNODES_BOUNDARY 2
 
 /*Numericalflux constructors and destructor*/
@@ -30,16 +28,16 @@
 }
 /*}}}*/
-Numericalflux::Numericalflux(int numericalflux_id,int i,int index,IoModel* iomodel, int in_analysis_type){/*{{{*/
+Numericalflux::Numericalflux(int numericalflux_id,int i,int index,IoModel* iomodel){/*{{{*/
 
 	/* Intermediary */
-	int  j;
-	int  pos1,pos2,pos3,pos4;
-	int  num_nodes;
+	int pos1,pos2,pos3,pos4;
+	int numnodes;
 
 	/*numericalflux constructor data: */
-	int   numericalflux_elem_ids[2];
-	int   numericalflux_vertex_ids[2];
-	int   numericalflux_node_ids[4];
-	int   numericalflux_type;
+	int numericalflux_elem_ids[2];
+	int numericalflux_vertex_ids[2];
+	int numericalflux_node_ids[4];
+	int numericalflux_type;
+   int numericalflux_degree;
 
 	/*Get edge*/
@@ -52,5 +50,4 @@
 	if(e2==-1){
 		/* Boundary edge, only one element */
-		num_nodes=2;
 		numericalflux_type=BoundaryEnum;
 		numericalflux_elem_ids[0]=e1;
@@ -58,5 +55,4 @@
 	else{
 		/* internal edge: connected to 2 elements */
-		 num_nodes=4;
 		numericalflux_type=InternalEnum;
 		numericalflux_elem_ids[0]=e1;
@@ -64,4 +60,8 @@
 	}
 
+   /*FIXME: hardcode element degree for now*/
+   this->flux_degree= P1DGEnum;
+   //this->flux_degree= P0DGEnum;
+
 	/*1: Get vertices ids*/
 	numericalflux_vertex_ids[0]=i1;
@@ -69,11 +69,8 @@
 
 	/*2: Get node ids*/
-	if (numericalflux_type==InternalEnum){
-
-		/*Now, we must get the nodes of the 4 nodes located on the edge*/
-
-		/*2: Get the column where these ids are located in the index*/
+	if(numericalflux_type==InternalEnum){
+		/*Get the column where these ids are located in the index*/
 		pos1=pos2=pos3=pos4=UNDEF;
-		for(j=0;j<3;j++){
+		for(int j=0;j<3;j++){
 			if(iomodel->elements[3*(e1-1)+j]==i1) pos1=j+1;
 			if(iomodel->elements[3*(e1-1)+j]==i2) pos2=j+1;
@@ -83,16 +80,15 @@
 		_assert_(pos1!=UNDEF && pos2!=UNDEF && pos3!=UNDEF && pos4!=UNDEF);
 
-		/*3: We have the id of the elements and the position of the vertices in the index
+		/* We have the id of the elements and the position of the vertices in the index
 		 * we can compute their dofs!*/
-		numericalflux_node_ids[0]=iomodel->nodecounter+3*(e1-1)+pos1;
-		numericalflux_node_ids[1]=iomodel->nodecounter+3*(e1-1)+pos2;
-		numericalflux_node_ids[2]=iomodel->nodecounter+3*(e2-1)+pos3;
-		numericalflux_node_ids[3]=iomodel->nodecounter+3*(e2-1)+pos4;
+		numericalflux_node_ids[0]=3*(e1-1)+pos1;
+		numericalflux_node_ids[1]=3*(e1-1)+pos2;
+		numericalflux_node_ids[2]=3*(e2-1)+pos3;
+		numericalflux_node_ids[3]=3*(e2-1)+pos4;
 	}
 	else{
-
-		/*2: Get the column where these ids are located in the index*/
+		/*Get the column where these ids are located in the index*/
 		pos1=pos2=UNDEF;
-		for(j=0;j<3;j++){
+		for(int j=0;j<3;j++){
 			if(iomodel->elements[3*(e1-1)+j]==i1) pos1=j+1;
 			if(iomodel->elements[3*(e1-1)+j]==i2) pos2=j+1;
@@ -100,24 +96,40 @@
 		_assert_(pos1!=UNDEF && pos2!=UNDEF);
 
-		/*3: We have the id of the elements and the position of the vertices in the index
+		/* We have the id of the elements and the position of the vertices in the index
 		 * we can compute their dofs!*/
-		numericalflux_node_ids[0]=iomodel->nodecounter+3*(e1-1)+pos1;
-		numericalflux_node_ids[1]=iomodel->nodecounter+3*(e1-1)+pos2;
-	}
-
-	/*Ok, we have everything to build the object: */
-	this->id=numericalflux_id;
-	this->analysis_type=in_analysis_type;
-	this->flux_type = numericalflux_type;
+		numericalflux_node_ids[0]=3*(e1-1)+pos1;
+		numericalflux_node_ids[1]=3*(e1-1)+pos2;
+	}
+
+   switch(this->flux_degree){
+      case P0DGEnum:
+         if(numericalflux_type==InternalEnum) numnodes = 2;
+         else numnodes = 1;
+			for(int i=0;i<numnodes;i++) numericalflux_node_ids[i] = numericalflux_elem_ids[i]; 
+         numericalflux_node_ids[1] = numericalflux_elem_ids[1];
+         break;
+      case P1DGEnum:
+         if(numericalflux_type==InternalEnum) numnodes = 4;
+         else numnodes = 2;
+         for(int i=0;i<numnodes;i++) numericalflux_node_ids[i] = numericalflux_node_ids[i]; //FIXME: to be improved...
+         break;
+      default:
+         _error_("not supported yet");
+
+   }
+
+	/*Assign object fields: */
+	this->id          = numericalflux_id;
+	this->flux_type   = numericalflux_type;
 
 	/*Hooks: */
-	this->hnodes    =new Hook(numericalflux_node_ids,num_nodes);
-	this->hvertices =new Hook(&numericalflux_vertex_ids[0],2);
-	this->helement  =new Hook(numericalflux_elem_ids,1); // take only the first element for now
-
-	//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
-	this->parameters=NULL;
-	this->element=NULL;
-	this->nodes=NULL;
+	this->hnodes    = new Hook(numericalflux_node_ids,numnodes);
+	this->hvertices = new Hook(&numericalflux_vertex_ids[0],2);
+	this->helement  = new Hook(numericalflux_elem_ids,1); // take only the first element for now
+
+	/*other fields*/
+	this->parameters = NULL;
+	this->element    = NULL;
+	this->nodes      = NULL;
 }
 /*}}}*/
@@ -139,6 +151,6 @@
 	/*copy fields: */
 	numericalflux->id=this->id;
-	numericalflux->analysis_type=this->analysis_type;
 	numericalflux->flux_type=this->flux_type;
+	numericalflux->flux_degree=this->flux_degree;
 
 	/*point parameters: */
@@ -162,6 +174,6 @@
 	_printf_("Numericalflux:\n");
 	_printf_("   id: " << id << "\n");
-	_printf_("   analysis_type: " << EnumToStringx(analysis_type) << "\n");
 	_printf_("   flux_type: " << this->flux_type<< "\n");
+	_printf_("   flux_degree: " << this->flux_degree<< "\n");
 	hnodes->DeepEcho();
 	hvertices->DeepEcho();
@@ -177,6 +189,6 @@
 	_printf_("Numericalflux:\n");
 	_printf_("   id: " << id << "\n");
-	_printf_("   analysis_type: " << EnumToStringx(analysis_type) << "\n");
 	_printf_("   flux_type: " << this->flux_type<< "\n");
+	_printf_("   flux_degree: " << this->flux_degree<< "\n");
 	hnodes->Echo();
 	hvertices->Echo();
@@ -196,6 +208,6 @@
 	MARSHALLING_ENUM(NumericalfluxEnum);
 	MARSHALLING(id);
-	MARSHALLING(analysis_type);
 	MARSHALLING(flux_type);
+	MARSHALLING(flux_degree);
 
 	if(marshall_direction==MARSHALLING_BACKWARD){
@@ -305,14 +317,6 @@
 	_assert_(nodes);
 
-	switch(this->flux_type){
-		case InternalEnum:
-			for(int i=0;i<NUMNODES_INTERNAL;i++) lidlist[i]=nodes[i]->Lid();
-			return;
-		case BoundaryEnum:
-			for(int i=0;i<NUMNODES_BOUNDARY;i++) lidlist[i]=nodes[i]->Lid();
-			return;
-		default:
-			_error_("Numericalflux type " << EnumToStringx(this->flux_type) << " not supported yet");
-	}
+	int numnodes = this->GetNumberOfNodes();
+	for(int i=0;i<numnodes;i++) lidlist[i]=nodes[i]->Lid();
 }
 /*}}}*/
@@ -322,32 +326,48 @@
 	_assert_(nodes);
 
-	switch(this->flux_type){
-		case InternalEnum:
-			for(int i=0;i<NUMNODES_INTERNAL;i++) sidlist[i]=nodes[i]->Sid();
-			return;
-		case BoundaryEnum:
-			for(int i=0;i<NUMNODES_BOUNDARY;i++) sidlist[i]=nodes[i]->Sid();
-			return;
-		default:
-			_error_("Numericalflux type " << EnumToStringx(this->flux_type) << " not supported yet");
-	}
+	int numnodes = this->GetNumberOfNodes();
+	for(int i=0;i<numnodes;i++) sidlist[i]=nodes[i]->Sid();
 }
 /*}}}*/
 int   Numericalflux::GetNumberOfNodes(void){/*{{{*/
 
-	switch(this->flux_type){
-		case InternalEnum:
-			return NUMNODES_INTERNAL;
-		case BoundaryEnum:
-			return NUMNODES_BOUNDARY;
-		default:
-			_error_("Numericalflux type " << EnumToStringx(this->flux_type) << " not supported yet");
-	}
-
-}
-/*}}}*/
-bool  Numericalflux::InAnalysis(int in_analysis_type){/*{{{*/
-	if (in_analysis_type==this->analysis_type) return true;
-	else return false;
+	if(this->flux_degree==P0DGEnum){
+		switch(this->flux_type){
+			case InternalEnum:
+				return 2;
+			case BoundaryEnum:
+				return 1;
+			default:
+				_error_("Numericalflux type " << EnumToStringx(this->flux_type) << " not supported yet");
+		}
+	}
+	else if(this->flux_degree==P1DGEnum){
+		switch(this->flux_type){
+			case InternalEnum:
+				return 4;
+			case BoundaryEnum:
+				return 2;
+			default:
+				_error_("Numericalflux type " << EnumToStringx(this->flux_type) << " not supported yet");
+		}
+	}
+	else{
+		_error_("Numericalflux " << EnumToStringx(this->flux_degree) << " not supported yet");
+	}
+
+}
+/*}}}*/
+int   Numericalflux::GetNumberOfNodesOneSide(void){/*{{{*/
+
+	if(this->flux_degree==P0DGEnum){
+		return 1;
+	}
+	else if(this->flux_degree==P1DGEnum){
+		return 2;
+	}
+	else{
+		_error_("Numericalflux " << EnumToStringx(this->flux_degree) << " not supported yet");
+	}
+
 }
 /*}}}*/
@@ -372,8 +392,8 @@
 void  Numericalflux::ResetHooks(){/*{{{*/
 
-	this->nodes=NULL;
-	this->vertices=NULL;
-	this->element=NULL;
-	this->parameters=NULL;
+	this->nodes      = NULL;
+	this->vertices   = NULL;
+	this->element    = NULL;
+	this->parameters = NULL;
 
 	/*Get Element type*/
@@ -385,4 +405,5 @@
 /*}}}*/
 void  Numericalflux::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/
+   /*Nothing to do :)*/
 
 }
@@ -409,5 +430,5 @@
 			switch(set2_enum){
 				case FsetEnum:
-					if(nodes[i]->indexing.fsize){
+					if(nodes[i]->fsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -417,5 +438,5 @@
 					break;
 				case GsetEnum:
-					if(nodes[i]->indexing.gsize){
+					if(nodes[i]->gsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -425,5 +446,5 @@
 					break;
 				case SsetEnum:
-					if(nodes[i]->indexing.ssize){
+					if(nodes[i]->ssize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -484,20 +505,12 @@
 ElementMatrix* Numericalflux::CreateKMatrixBalancethicknessBoundary(void){/*{{{*/
 
-	/* constants*/
-	const int numdof=NDOF1*NUMNODES_BOUNDARY;
+	/*Initialize Element matrix and return if necessary*/
+	Tria* tria=(Tria*)element;
+	if(!tria->IsIceInElement()) return NULL;
 
 	/* Intermediaries*/
-	int        i,j,ig,index1,index2;
-	IssmDouble     DL,Jdet,vx,vy,mean_vx,mean_vy,UdotN;
-	IssmDouble     xyz_list[NUMVERTICES][3];
-	IssmDouble     normal[2];
-	IssmDouble     L[numdof];
-	IssmDouble     Ke_g[numdof][numdof];
-	GaussTria *gauss;
-
-	/*Initialize Element matrix and return if necessary*/
-	ElementMatrix* Ke = NULL;
-	Tria*  tria=(Tria*)element;
-	if(!tria->IsIceInElement()) return NULL;
+	IssmDouble DL,Jdet,vx,vy,mean_vx,mean_vy;
+	IssmDouble xyz_list[NUMVERTICES][3];
+	IssmDouble normal[2];
 
 	/*Retrieve all inputs and parameters*/
@@ -508,8 +521,8 @@
 
 	/*Check wether it is an inflow or outflow BC (0 is the middle of the segment)*/
-	index1=tria->GetNodeIndex(nodes[0]);
-	index2=tria->GetNodeIndex(nodes[1]);
-
-	gauss=new GaussTria();
+	int index1=tria->GetVertexIndex(vertices[0]);
+	int index2=tria->GetVertexIndex(vertices[1]);
+
+	GaussTria* gauss=new GaussTria();
 	gauss->GaussEdgeCenter(index1,index2);
 	vxaverage_input->GetInputValue(&mean_vx,gauss);
@@ -517,19 +530,21 @@
 	delete gauss;
 
-	UdotN=mean_vx*normal[0]+mean_vy*normal[1];
-	if (UdotN<=0){
+	IssmDouble UdotN=mean_vx*normal[0]+mean_vy*normal[1];
+	if(UdotN<=0){
 		return NULL; /*(u,n)<0 -> inflow, PenaltyCreatePVector will take care of it*/
 	}
-	else{
-		Ke=new ElementMatrix(nodes,NUMNODES_BOUNDARY,this->parameters);
-	}
+
+	/*Initialize Element vector and other vectors*/
+   int            numnodes = this->GetNumberOfNodes();
+   ElementMatrix *Ke       = new ElementMatrix(nodes,numnodes,this->parameters);
+   IssmDouble    *basis    = xNew<IssmDouble>(numnodes);
 
 	/* Start  looping on the number of gaussian points: */
 	gauss=new GaussTria(index1,index2,2);
-	for(ig=gauss->begin();ig<gauss->end();ig++){
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
 
 		gauss->GaussPoint(ig);
 
-		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2,tria->FiniteElement());
+		tria->GetSegmentNodalFunctions(&basis[0],gauss,index1,index2,tria->FiniteElement());
 
 		vxaverage_input->GetInputValue(&vx,gauss);
@@ -539,13 +554,13 @@
 		DL=gauss->weight*Jdet*UdotN;
 
-		TripleMultiply(&L[0],1,numdof,1,
-					&DL,1,1,0,
-					&L[0],1,numdof,0,
-					&Ke_g[0][0],0);
-
-		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g[i][j];
+		for(int i=0;i<numnodes;i++){
+			for(int j=0;j<numnodes;j++){
+				Ke->values[i*numnodes+j]+=DL*basis[i]*basis[j];
+			}
+		}
 	} 
 
 	/*Clean up and return*/
+	xDelete<IssmDouble>(basis);
 	delete gauss;
 	return Ke;
@@ -553,23 +568,24 @@
 /*}}}*/
 ElementMatrix* Numericalflux::CreateKMatrixBalancethicknessInternal(void){/*{{{*/
-
-	/* constants*/
-	const int numdof=NDOF1*NUMNODES_INTERNAL;
-
-	/* Intermediaries*/
-	int        i,j,ig,index1,index2;
-	IssmDouble     DL1,DL2,Jdet,vx,vy,UdotN;
-	IssmDouble     xyz_list[NUMVERTICES][3];
-	IssmDouble     normal[2];
-	IssmDouble     B[numdof];
-	IssmDouble     Bprime[numdof];
-	IssmDouble     Ke_g1[numdof][numdof];
-	IssmDouble     Ke_g2[numdof][numdof];
-	GaussTria *gauss;
 
 	/*Initialize Element matrix and return if necessary*/
 	Tria*  tria=(Tria*)element;
 	if(!tria->IsIceInElement()) return NULL;
-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMNODES_INTERNAL,this->parameters);
+
+	/* Intermediaries*/
+	IssmDouble A1,A2,Jdet,vx,vy,UdotN;
+	IssmDouble xyz_list[NUMVERTICES][3];
+	IssmDouble normal[2];
+
+	/*Fetch number of nodes for this flux*/
+	int numnodes       = this->GetNumberOfNodes();
+	int numnodes_plus  = this->GetNumberOfNodesOneSide();
+	int numnodes_minus = numnodes_plus; /*For now we are not doing p-adaptive DG*/
+	_assert_(numnodes==numnodes_plus+numnodes_minus);
+
+	/*Initialize variables*/
+	ElementMatrix *Ke = new ElementMatrix(nodes,numnodes,this->parameters);
+	IssmDouble    *basis_plus  = xNew<IssmDouble>(numnodes_plus);
+	IssmDouble    *basis_minus = xNew<IssmDouble>(numnodes_minus);
 
 	/*Retrieve all inputs and parameters*/
@@ -580,13 +596,13 @@
 
 	/* Start  looping on the number of gaussian points: */
-	index1=tria->GetNodeIndex(nodes[0]);
-	index2=tria->GetNodeIndex(nodes[1]);
-	gauss=new GaussTria(index1,index2,2);
-	for(ig=gauss->begin();ig<gauss->end();ig++){
+	int index1=tria->GetVertexIndex(vertices[0]);
+	int index2=tria->GetVertexIndex(vertices[1]);
+	GaussTria* gauss=new GaussTria(index1,index2,2);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
 
 		gauss->GaussPoint(ig);
 
-		tria->GetSegmentBFlux(&B[0],gauss,index1,index2,tria->FiniteElement());
-		tria->GetSegmentBprimeFlux(&Bprime[0],gauss,index1,index2,tria->FiniteElement());
+		tria->GetSegmentNodalFunctions(&basis_plus[0] ,gauss,index1,index2,tria->FiniteElement());
+		tria->GetSegmentNodalFunctions(&basis_minus[0],gauss,index1,index2,tria->FiniteElement());
 
 		vxaverage_input->GetInputValue(&vx,gauss);
@@ -594,21 +610,52 @@
 		UdotN=vx*normal[0]+vy*normal[1];
 		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
-		DL1=gauss->weight*Jdet*UdotN/2;
-		DL2=gauss->weight*Jdet*fabs(UdotN)/2;
-
-		TripleMultiply(&B[0],1,numdof,1,
-					&DL1,1,1,0,
-					&Bprime[0],1,numdof,0,
-					&Ke_g1[0][0],0);
-		TripleMultiply(&B[0],1,numdof,1,
-					&DL2,1,1,0,
-					&B[0],1,numdof,0,
-					&Ke_g2[0][0],0);
-
-		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g1[i][j];
-		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g2[i][j];
+		A1=gauss->weight*Jdet*UdotN/2;
+		A2=gauss->weight*Jdet*fabs(UdotN)/2;
+
+		/*Term 1 (numerical flux): {Hv}.[[phi]] = 0.5(H+v+ + H-v-)(phi+n+ + phi-n-)
+		 *                                      = v.n/2 (H+phi+ + H-phi+ -H+phi- -H-phi-)
+		 *                                      = v.n/2 (H+phi+ + H-phi+ -H+phi- -H-phi-)
+		 *
+		 *Term 2 (stabilization)  |v.n|/2 [[H]].[[phi]] = |v.n|/2 (H+n+ + H-n-)(phi+n+ + phi-n-)
+		 *                                      = |v.n|/2 (H+phi+ -H-phi+ -H+phi- +H-phi-)
+		 *     | A++ | A+- |
+		 * K = |-----------|
+		 *     | A-+ | A-- |
+		 *
+		 *These 4 terms for each expressions are added independently*/
+
+		/*First term A++*/
+		for(int i=0;i<numnodes_plus;i++){
+			for(int j=0;j<numnodes_plus;j++){
+				Ke->values[i*numnodes+j] += A1*(basis_plus[j]*basis_plus[i]);
+				Ke->values[i*numnodes+j] += A2*(basis_plus[j]*basis_plus[i]);
+			}
+		}
+		/*Second term A+-*/
+		for(int i=0;i<numnodes_plus;i++){
+			for(int j=0;j<numnodes_minus;j++){
+				Ke->values[i*numnodes+numnodes_plus+j] +=  A1*(basis_minus[j]*basis_plus[i]);
+				Ke->values[i*numnodes+numnodes_plus+j] += -A2*(basis_minus[j]*basis_plus[i]);
+			}
+		}
+		/*Third term A-+*/
+		for(int i=0;i<numnodes_minus;i++){
+			for(int j=0;j<numnodes_plus;j++){
+				Ke->values[(numnodes_plus+i)*numnodes+j] += -A1*(basis_plus[j]*basis_minus[i]);
+				Ke->values[(numnodes_plus+i)*numnodes+j] += -A2*(basis_plus[j]*basis_minus[i]);
+			}
+		}
+		/*Fourth term A-+*/
+		for(int i=0;i<numnodes_minus;i++){
+			for(int j=0;j<numnodes_minus;j++){
+				Ke->values[(numnodes_plus+i)*numnodes+numnodes_plus+j] += -A1*(basis_minus[j]*basis_minus[i]);
+				Ke->values[(numnodes_plus+i)*numnodes+numnodes_plus+j] +=  A2*(basis_minus[j]*basis_minus[i]);
+			}
+		}
 	}
 
 	/*Clean up and return*/
+   xDelete<IssmDouble>(basis_plus);
+   xDelete<IssmDouble>(basis_minus);
 	delete gauss;
 	return Ke;
@@ -629,24 +676,16 @@
 ElementMatrix* Numericalflux::CreateKMatrixMasstransportBoundary(void){/*{{{*/
 
-	/* constants*/
-	const int numdof=NDOF1*NUMNODES_BOUNDARY;
-
-	/* Intermediaries*/
-	int        i,j,ig,index1,index2;
-	IssmDouble     DL,Jdet,dt,vx,vy,mean_vx,mean_vy,UdotN;
-	IssmDouble     xyz_list[NUMVERTICES][3];
-	IssmDouble     normal[2];
-	IssmDouble     L[numdof];
-	IssmDouble     Ke_g[numdof][numdof];
-	GaussTria *gauss;
-
 	/*Initialize Element matrix and return if necessary*/
-	ElementMatrix* Ke = NULL;
 	Tria*  tria=(Tria*)element;
 	if(!tria->IsIceInElement()) return NULL;
 
+	/* Intermediaries*/
+	IssmDouble DL,Jdet,vx,vy,mean_vx,mean_vy;
+	IssmDouble xyz_list[NUMVERTICES][3];
+	IssmDouble normal[2];
+
 	/*Retrieve all inputs and parameters*/
 	GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
-	parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+	IssmDouble dt = parameters->FindParam(TimesteppingTimeStepEnum);
 	Input* vxaverage_input=tria->inputs->GetInput(VxEnum); _assert_(vxaverage_input);
 	Input* vyaverage_input=tria->inputs->GetInput(VyEnum); _assert_(vyaverage_input);
@@ -654,8 +693,8 @@
 
 	/*Check wether it is an inflow or outflow BC (0 is the middle of the segment)*/
-	index1=tria->GetNodeIndex(nodes[0]);
-	index2=tria->GetNodeIndex(nodes[1]);
-
-	gauss=new GaussTria();
+	int index1=tria->GetVertexIndex(vertices[0]);
+	int index2=tria->GetVertexIndex(vertices[1]);
+
+	GaussTria* gauss=new GaussTria();
 	gauss->GaussEdgeCenter(index1,index2);
 	vxaverage_input->GetInputValue(&mean_vx,gauss);
@@ -663,19 +702,21 @@
 	delete gauss;
 
-	UdotN=mean_vx*normal[0]+mean_vy*normal[1];
-	if (UdotN<=0){
+	IssmDouble UdotN=mean_vx*normal[0]+mean_vy*normal[1];
+	if(UdotN<=0){
 		return NULL; /*(u,n)<0 -> inflow, PenaltyCreatePVector will take care of it*/
 	}
-	else{
-		Ke=new ElementMatrix(nodes,NUMNODES_BOUNDARY,this->parameters);
-	}
+
+	/*Initialize Element vector and other vectors*/
+   int            numnodes = this->GetNumberOfNodes();
+   ElementMatrix *Ke       = new ElementMatrix(nodes,numnodes,this->parameters);
+   IssmDouble    *basis    = xNew<IssmDouble>(numnodes);
 
 	/* Start  looping on the number of gaussian points: */
 	gauss=new GaussTria(index1,index2,2);
-	for(ig=gauss->begin();ig<gauss->end();ig++){
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
 
 		gauss->GaussPoint(ig);
 
-		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2,tria->FiniteElement());
+		tria->GetSegmentNodalFunctions(&basis[0],gauss,index1,index2,tria->FiniteElement());
 
 		vxaverage_input->GetInputValue(&vx,gauss);
@@ -685,13 +726,13 @@
 		DL=gauss->weight*Jdet*dt*UdotN;
 
-		TripleMultiply(&L[0],1,numdof,1,
-					&DL,1,1,0,
-					&L[0],1,numdof,0,
-					&Ke_g[0][0],0);
-
-		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g[i][j];
+		for(int i=0;i<numnodes;i++){
+			for(int j=0;j<numnodes;j++){
+				Ke->values[i*numnodes+j]+=DL*basis[i]*basis[j];
+			}
+		}
 	} 
 
 	/*Clean up and return*/
+	xDelete<IssmDouble>(basis);
 	delete gauss;
 	return Ke;
@@ -699,27 +740,28 @@
 /*}}}*/
 ElementMatrix* Numericalflux::CreateKMatrixMasstransportInternal(void){/*{{{*/
-
-	/* constants*/
-	const int numdof=NDOF1*NUMNODES_INTERNAL;
-
-	/* Intermediaries*/
-	int        i,j,ig,index1,index2;
-	IssmDouble     DL1,DL2,Jdet,dt,vx,vy,UdotN;
-	IssmDouble     xyz_list[NUMVERTICES][3];
-	IssmDouble     normal[2];
-	IssmDouble     B[numdof];
-	IssmDouble     Bprime[numdof];
-	IssmDouble     Ke_g1[numdof][numdof];
-	IssmDouble     Ke_g2[numdof][numdof];
-	GaussTria *gauss;
 
 	/*Initialize Element matrix and return if necessary*/
 	Tria*  tria=(Tria*)element;
 	if(!tria->IsIceInElement()) return NULL;
-	ElementMatrix* Ke=new ElementMatrix(nodes,NUMNODES_INTERNAL,this->parameters);
+
+	/* Intermediaries*/
+	IssmDouble A1,A2,Jdet,vx,vy,UdotN;
+	IssmDouble xyz_list[NUMVERTICES][3];
+	IssmDouble normal[2];
+
+	/*Fetch number of nodes for this flux*/
+	int numnodes       = this->GetNumberOfNodes();
+	int numnodes_plus  = this->GetNumberOfNodesOneSide();
+	int numnodes_minus = numnodes_plus; /*For now we are not doing p-adaptive DG*/
+	_assert_(numnodes==numnodes_plus+numnodes_minus);
+
+	/*Initialize variables*/
+	ElementMatrix *Ke = new ElementMatrix(nodes,numnodes,this->parameters);
+	IssmDouble    *basis_plus  = xNew<IssmDouble>(numnodes_plus);
+	IssmDouble    *basis_minus = xNew<IssmDouble>(numnodes_minus);
 
 	/*Retrieve all inputs and parameters*/
 	GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
-	parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+	IssmDouble dt = parameters->FindParam(TimesteppingTimeStepEnum);
 	Input* vxaverage_input=tria->inputs->GetInput(VxEnum);
 	Input* vyaverage_input=tria->inputs->GetInput(VyEnum);
@@ -727,13 +769,13 @@
 
 	/* Start  looping on the number of gaussian points: */
-	index1=tria->GetNodeIndex(nodes[0]);
-	index2=tria->GetNodeIndex(nodes[1]);
-	gauss=new GaussTria(index1,index2,2);
-	for(ig=gauss->begin();ig<gauss->end();ig++){
+	int index1=tria->GetVertexIndex(vertices[0]);
+	int index2=tria->GetVertexIndex(vertices[1]);
+	GaussTria* gauss=new GaussTria(index1,index2,2);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
 
 		gauss->GaussPoint(ig);
 
-		tria->GetSegmentBFlux(&B[0],gauss,index1,index2,tria->FiniteElement());
-		tria->GetSegmentBprimeFlux(&Bprime[0],gauss,index1,index2,tria->FiniteElement());
+		tria->GetSegmentNodalFunctions(&basis_plus[0] ,gauss,index1,index2,tria->FiniteElement());
+		tria->GetSegmentNodalFunctions(&basis_minus[0],gauss,index1,index2,tria->FiniteElement());
 
 		vxaverage_input->GetInputValue(&vx,gauss);
@@ -741,21 +783,52 @@
 		UdotN=vx*normal[0]+vy*normal[1];
 		tria->GetSegmentJacobianDeterminant(&Jdet,&xyz_list[0][0],gauss);
-		DL1=gauss->weight*Jdet*dt*UdotN/2;
-		DL2=gauss->weight*Jdet*dt*fabs(UdotN)/2;
-
-		TripleMultiply(&B[0],1,numdof,1,
-					&DL1,1,1,0,
-					&Bprime[0],1,numdof,0,
-					&Ke_g1[0][0],0);
-		TripleMultiply(&B[0],1,numdof,1,
-					&DL2,1,1,0,
-					&B[0],1,numdof,0,
-					&Ke_g2[0][0],0);
-
-		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g1[i][j];
-		for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g2[i][j];
+		A1=gauss->weight*Jdet*dt*UdotN/2;
+		A2=gauss->weight*Jdet*dt*fabs(UdotN)/2;
+
+		/*Term 1 (numerical flux): {Hv}.[[phi]] = 0.5(H+v+ + H-v-)(phi+n+ + phi-n-)
+		 *                                      = v.n/2 (H+phi+ + H-phi+ -H+phi- -H-phi-)
+		 *                                      = v.n/2 (H+phi+ + H-phi+ -H+phi- -H-phi-)
+		 *
+		 *Term 2 (stabilization)  |v.n|/2 [[H]].[[phi]] = |v.n|/2 (H+n+ + H-n-)(phi+n+ + phi-n-)
+		 *                                      = |v.n|/2 (H+phi+ -H-phi+ -H+phi- +H-phi-)
+		 *     | A++ | A+- |
+		 * K = |-----------|
+		 *     | A-+ | A-- |
+		 *
+		 *These 4 terms for each expressions are added independently*/
+
+		/*First term A++*/
+		for(int i=0;i<numnodes_plus;i++){
+			for(int j=0;j<numnodes_plus;j++){
+				Ke->values[i*numnodes+j] += A1*(basis_plus[j]*basis_plus[i]);
+				Ke->values[i*numnodes+j] += A2*(basis_plus[j]*basis_plus[i]);
+			}
+		}
+		/*Second term A+-*/
+		for(int i=0;i<numnodes_plus;i++){
+			for(int j=0;j<numnodes_minus;j++){
+				Ke->values[i*numnodes+numnodes_plus+j] +=  A1*(basis_minus[j]*basis_plus[i]);
+				Ke->values[i*numnodes+numnodes_plus+j] += -A2*(basis_minus[j]*basis_plus[i]);
+			}
+		}
+		/*Third term A-+*/
+		for(int i=0;i<numnodes_minus;i++){
+			for(int j=0;j<numnodes_plus;j++){
+				Ke->values[(numnodes_plus+i)*numnodes+j] += -A1*(basis_plus[j]*basis_minus[i]);
+				Ke->values[(numnodes_plus+i)*numnodes+j] += -A2*(basis_plus[j]*basis_minus[i]);
+			}
+		}
+		/*Fourth term A-+*/
+		for(int i=0;i<numnodes_minus;i++){
+			for(int j=0;j<numnodes_minus;j++){
+				Ke->values[(numnodes_plus+i)*numnodes+numnodes_plus+j] += -A1*(basis_minus[j]*basis_minus[i]);
+				Ke->values[(numnodes_plus+i)*numnodes+numnodes_plus+j] +=  A2*(basis_minus[j]*basis_minus[i]);
+			}
+		}
 	}
 
 	/*Clean up and return*/
+   xDelete<IssmDouble>(basis_plus);
+   xDelete<IssmDouble>(basis_minus);
 	delete gauss;
 	return Ke;
@@ -782,51 +855,45 @@
 ElementVector* Numericalflux::CreatePVectorBalancethicknessBoundary(void){/*{{{*/
 
-	/* constants*/
-	const int numdof=NDOF1*NUMNODES_BOUNDARY;
+	/*Initialize Load Vector and return if necessary*/
+	Tria*  tria=(Tria*)element;
+	if(!tria->IsIceInElement()) return NULL;
 
 	/* Intermediaries*/
-	int        i,ig,index1,index2;
-	IssmDouble DL,Jdet,vx,vy,mean_vx,mean_vy,UdotN,thickness;
+	IssmDouble DL,Jdet,vx,vy,mean_vx,mean_vy,thickness;
 	IssmDouble xyz_list[NUMVERTICES][3];
 	IssmDouble normal[2];
-	IssmDouble L[numdof];
-	GaussTria *gauss;
-
-	/*Initialize Load Vector and return if necessary*/
-	ElementVector* pe = NULL;
-	Tria*  tria=(Tria*)element;
-	if(!tria->IsIceInElement()) return NULL;
 
 	/*Retrieve all inputs and parameters*/
 	GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
-	Input* vxaverage_input=tria->inputs->GetInput(VxEnum); _assert_(vxaverage_input); 
-	Input* vyaverage_input=tria->inputs->GetInput(VyEnum); _assert_(vyaverage_input);
-	Input* thickness_input=tria->inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+	Input* vxaverage_input = tria->inputs->GetInput(VxEnum);        _assert_(vxaverage_input);
+	Input* vyaverage_input = tria->inputs->GetInput(VyEnum);        _assert_(vyaverage_input);
+	Input* thickness_input = tria->inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
 	GetNormal(&normal[0],xyz_list);
 
 	/*Check wether it is an inflow or outflow BC (0 is the middle of the segment)*/
-	index1=tria->GetNodeIndex(nodes[0]);
-	index2=tria->GetNodeIndex(nodes[1]);
-
-	gauss=new GaussTria();
+	int index1=tria->GetVertexIndex(vertices[0]);
+	int index2=tria->GetVertexIndex(vertices[1]);
+	GaussTria* gauss=new GaussTria();
 	gauss->GaussEdgeCenter(index1,index2);
 	vxaverage_input->GetInputValue(&mean_vx,gauss);
 	vyaverage_input->GetInputValue(&mean_vy,gauss);
 	delete gauss;
-	UdotN=mean_vx*normal[0]+mean_vy*normal[1];
-	if (UdotN>0){
+	IssmDouble UdotN=mean_vx*normal[0]+mean_vy*normal[1];
+	if(UdotN>0){
 		return NULL; /*(u,n)>0 -> outflow, PenaltyCreateKMatrix will take care of it*/
 	}
-	else{
-		pe=new ElementVector(nodes,NUMNODES_BOUNDARY,this->parameters);
-	}
+
+	/*Initialize Load Vector */
+	int            numnodes = this->GetNumberOfNodes();
+	ElementVector *pe       = new ElementVector(nodes,numnodes,this->parameters);
+	IssmDouble    *basis    = xNew<IssmDouble>(numnodes);
 
 	/* Start  looping on the number of gaussian points: */
 	gauss=new GaussTria(index1,index2,2);
-	for(ig=gauss->begin();ig<gauss->end();ig++){
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
 
 		gauss->GaussPoint(ig);
 
-		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2,tria->FiniteElement());
+		tria->GetSegmentNodalFunctions(&basis[0],gauss,index1,index2,tria->FiniteElement());
 
 		vxaverage_input->GetInputValue(&vx,gauss);
@@ -838,8 +905,9 @@
 		DL= - gauss->weight*Jdet*UdotN*thickness;
 
-		for(i=0;i<numdof;i++) pe->values[i] += DL*L[i];
+		for(int i=0;i<numnodes;i++) pe->values[i] += DL*basis[i];
 	}
 
 	/*Clean up and return*/
+   xDelete<IssmDouble>(basis);
 	delete gauss;
 	return pe;
@@ -867,53 +935,46 @@
 ElementVector* Numericalflux::CreatePVectorMasstransportBoundary(void){/*{{{*/
 
-	/* constants*/
-	const int numdof=NDOF1*NUMNODES_BOUNDARY;
+	/*Initialize Load Vector and return if necessary*/
+	Tria* tria=(Tria*)element;
+	if(!tria->IsIceInElement()) return NULL;
 
 	/* Intermediaries*/
-	int        i,ig,index1,index2;
-	IssmDouble     DL,Jdet,dt,vx,vy,mean_vx,mean_vy,UdotN,thickness;
-	IssmDouble     xyz_list[NUMVERTICES][3];
-	IssmDouble     normal[2];
-	IssmDouble     L[numdof];
-	GaussTria *gauss;
-
-	/*Initialize Load Vector and return if necessary*/
-	ElementVector* pe = NULL;
-	Tria*  tria=(Tria*)element;
-	if(!tria->IsIceInElement()) return NULL;
+	IssmDouble DL,Jdet,vx,vy,mean_vx,mean_vy,thickness;
+	IssmDouble xyz_list[NUMVERTICES][3];
+	IssmDouble normal[2];
 
 	/*Retrieve all inputs and parameters*/
 	GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
-	parameters->FindParam(&dt,TimesteppingTimeStepEnum);
-	Input* vxaverage_input   =tria->inputs->GetInput(VxEnum);                     _assert_(vxaverage_input); 
-	Input* vyaverage_input   =tria->inputs->GetInput(VyEnum);                     _assert_(vyaverage_input);
-	Input* spcthickness_input=tria->inputs->GetInput(MasstransportSpcthicknessEnum); _assert_(spcthickness_input);
+	IssmDouble dt = parameters->FindParam(TimesteppingTimeStepEnum);
+	Input* vxaverage_input    = tria->inputs->GetInput(VxEnum);                        _assert_(vxaverage_input);
+	Input* vyaverage_input    = tria->inputs->GetInput(VyEnum);                        _assert_(vyaverage_input);
+	Input* spcthickness_input = tria->inputs->GetInput(MasstransportSpcthicknessEnum); _assert_(spcthickness_input);
 	GetNormal(&normal[0],xyz_list);
 
 	/*Check wether it is an inflow or outflow BC (0 is the middle of the segment)*/
-	index1=tria->GetNodeIndex(nodes[0]);
-	index2=tria->GetNodeIndex(nodes[1]);
-
-	gauss=new GaussTria();
+	int index1=tria->GetVertexIndex(vertices[0]);
+	int index2=tria->GetVertexIndex(vertices[1]);
+	GaussTria* gauss=new GaussTria();
 	gauss->GaussEdgeCenter(index1,index2);
 	vxaverage_input->GetInputValue(&mean_vx,gauss);
 	vyaverage_input->GetInputValue(&mean_vy,gauss);
 	delete gauss;
-
-	UdotN=mean_vx*normal[0]+mean_vy*normal[1];
-	if (UdotN>0){
+	IssmDouble UdotN=mean_vx*normal[0]+mean_vy*normal[1];
+	if(UdotN>0){
 		return NULL; /*(u,n)>0 -> outflow, PenaltyCreateKMatrix will take care of it*/
 	}
-	else{
-		pe=new ElementVector(nodes,NUMNODES_BOUNDARY,this->parameters);
-	}
+
+	/*Initialize Load Vector */
+	int            numnodes = this->GetNumberOfNodes();
+	ElementVector *pe       = new ElementVector(nodes,numnodes,this->parameters);
+	IssmDouble    *basis    = xNew<IssmDouble>(numnodes);
 
 	/* Start  looping on the number of gaussian points: */
 	gauss=new GaussTria(index1,index2,2);
-	for(ig=gauss->begin();ig<gauss->end();ig++){
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
 
 		gauss->GaussPoint(ig);
 
-		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2,tria->FiniteElement());
+		tria->GetSegmentNodalFunctions(&basis[0],gauss,index1,index2,tria->FiniteElement());
 
 		vxaverage_input->GetInputValue(&vx,gauss);
@@ -926,8 +987,9 @@
 		DL= - gauss->weight*Jdet*dt*UdotN*thickness;
 
-		for(i=0;i<numdof;i++) pe->values[i] += DL*L[i];
+		for(int i=0;i<numnodes;i++) pe->values[i] += DL*basis[i];
 	}
 
 	/*Clean up and return*/
+   xDelete<IssmDouble>(basis);
 	delete gauss;
 	return pe;
@@ -945,10 +1007,9 @@
 	/*Build unit outward pointing vector*/
 	IssmDouble vector[2];
-	IssmDouble norm;
 
 	vector[0]=xyz_list[1][0] - xyz_list[0][0];
 	vector[1]=xyz_list[1][1] - xyz_list[0][1];
 
-	norm=sqrt(pow(vector[0],2.0)+pow(vector[1],2.0));
+	IssmDouble norm=sqrt(pow(vector[0],2.0)+pow(vector[1],2.0));
 
 	normal[0]= + vector[1]/norm;
Index: /issm/trunk/src/c/classes/Loads/Numericalflux.h
===================================================================
--- /issm/trunk/src/c/classes/Loads/Numericalflux.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Loads/Numericalflux.h	(revision 24313)
@@ -20,6 +20,6 @@
 	public: 
 		int id;
-		int analysis_type;
 		int flux_type;
+		int flux_degree;
 
 		/*Hooks*/
@@ -36,5 +36,5 @@
 		/*Numericalflux constructors,destructors {{{*/
 		Numericalflux();
-		Numericalflux(int numericalflux_id,int i,int index,IoModel* iomodel,int analysis_type);
+		Numericalflux(int numericalflux_id,int i,int index,IoModel* iomodel);
 		~Numericalflux();
 		/*}}}*/
@@ -64,5 +64,5 @@
 		void GetNodesSidList(int* sidlist);
 		int  GetNumberOfNodes(void);
-		bool InAnalysis(int analysis_type);
+		int  GetNumberOfNodesOneSide(void);
 		bool IsPenalty(void);
 		void PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");};
Index: /issm/trunk/src/c/classes/Loads/Pengrid.cpp
===================================================================
--- /issm/trunk/src/c/classes/Loads/Pengrid.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Loads/Pengrid.cpp	(revision 24313)
@@ -26,6 +26,4 @@
 	this->helement=NULL;
 	this->element=NULL;
-	this->hmatpar=NULL;
-	this->matpar=NULL;
 
 	/*not active, not zigzagging: */
@@ -35,8 +33,7 @@
 }
 /*}}}*/
-Pengrid::Pengrid(int id, int index, IoModel* iomodel, int in_analysis_type){ //i is the element index/*{{{*/
+Pengrid::Pengrid(int id, int index, IoModel* iomodel){/*{{{*/
 
 	int pengrid_node_id;
-	int pengrid_matpar_id;
 	int pengrid_element_id;
 
@@ -48,15 +45,12 @@
 	/*id: */
 	this->id=id;
-	this->analysis_type=in_analysis_type;
 
 	/*hooks: */
-	pengrid_node_id=iomodel->nodecounter+index+1;
+	pengrid_node_id=index+1;
 	pengrid_element_id=iomodel->singlenodetoelementconnectivity[index];
 	_assert_(pengrid_element_id);
-	pengrid_matpar_id=iomodel->numberofelements+1; //refers to the constant material parameters object
 
 	this->hnode=new Hook(&pengrid_node_id,1);
 	this->helement=new Hook(&pengrid_element_id,1);
-	this->hmatpar=new Hook(&pengrid_matpar_id,1);
 
 	//this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
@@ -64,5 +58,4 @@
 	this->node=NULL;
 	this->element=NULL;
-	this->matpar=NULL;
 
 	//let's not forget internals
@@ -75,5 +68,4 @@
 	delete hnode;
 	delete helement;
-	delete hmatpar;
 	return;
 }
@@ -89,5 +81,4 @@
 	/*copy fields: */
 	pengrid->id=this->id;
-	pengrid->analysis_type=this->analysis_type;
 
 	/*point parameters: */
@@ -96,10 +87,8 @@
 	/*now deal with hooks and objects: */
 	pengrid->hnode=(Hook*)this->hnode->copy();
-	pengrid->hmatpar=(Hook*)this->hmatpar->copy();
 	pengrid->helement=(Hook*)this->helement->copy();
 
 	/*corresponding fields*/
 	pengrid->node  =(Node*)pengrid->hnode->delivers();
-	pengrid->matpar =(Matpar*)pengrid->hmatpar->delivers();
 	pengrid->element=(Element*)pengrid->helement->delivers();
 
@@ -116,8 +105,6 @@
 	_printf_("Pengrid:\n");
 	_printf_("   id: " << id << "\n");
-	_printf_("   analysis_type: " << EnumToStringx(analysis_type) << "\n");
 	hnode->DeepEcho();
 	helement->DeepEcho();
-	hmatpar->DeepEcho();
 	_printf_("   active " << this->active << "\n");
 	_printf_("   zigzag_counter " << this->zigzag_counter << "\n");
@@ -139,19 +126,15 @@
 	MARSHALLING_ENUM(PengridEnum);
 	MARSHALLING(id);
-	MARSHALLING(analysis_type);
 
 	if(marshall_direction==MARSHALLING_BACKWARD){
 		this->hnode      = new Hook();
 		this->helement   = new Hook();
-		this->hmatpar    = new Hook();
 	}
 
 	this->hnode->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	this->hmatpar->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 
 	/*corresponding fields*/
 	node   =(Node*)this->hnode->delivers();
-	matpar =(Matpar*)this->hmatpar->delivers();
 	element=(Element*)this->helement->delivers();
 
@@ -174,10 +157,8 @@
 	hnode->configure(nodesin);
 	helement->configure(elementsin);
-	hmatpar->configure(materialsin);
 
 	/*Get corresponding fields*/
 	node=(Node*)hnode->delivers();
 	element=(Element*)helement->delivers();
-	matpar=(Matpar*)hmatpar->delivers();
 
 	/*point parameters to real dataset: */
@@ -217,9 +198,4 @@
 
 	return NUMVERTICES;
-}
-/*}}}*/
-bool  Pengrid::InAnalysis(int in_analysis_type){/*{{{*/
-	if (in_analysis_type==this->analysis_type)return true;
-	else return false;
 }
 /*}}}*/
@@ -290,5 +266,4 @@
 	this->node=NULL;
 	this->element=NULL;
-	this->matpar=NULL;
 	this->parameters=NULL;
 
@@ -296,5 +271,4 @@
 	this->hnode->reset();
 	this->helement->reset();
-	this->hmatpar->reset();
 
 }
@@ -322,5 +296,5 @@
 		switch(set2_enum){
 			case FsetEnum:
-				if(node->indexing.fsize){
+				if(node->fsize){
 					if(this->node->IsClone())
 					 o_nz += 1;
@@ -330,5 +304,5 @@
 				break;
 			case GsetEnum:
-				if(node->indexing.gsize){
+				if(node->gsize){
 					if(this->node->IsClone())
 					 o_nz += 1;
@@ -338,5 +312,5 @@
 				break;
 			case SsetEnum:
-				if(node->indexing.ssize){
+				if(node->ssize){
 					if(this->node->IsClone())
 					 o_nz += 1;
@@ -352,37 +326,4 @@
 	*pd_nz=d_nz;
 	*po_nz=o_nz;
-}
-/*}}}*/
-
-/*Update virtual functions definitions:*/
-void  Pengrid::InputUpdateFromConstant(IssmDouble constant, int name){/*{{{*/
-	/*Nothing*/
-}
-/*}}}*/
-void  Pengrid::InputUpdateFromConstant(int constant, int name){/*{{{*/
-	/*Nothing updated yet*/
-}
-/*}}}*/
-void  Pengrid::InputUpdateFromConstant(bool constant, int name){/*{{{*/
-
-	switch(name){
-
-		case ResetPenaltiesEnum:
-			if (constant) zigzag_counter=0;
-			return;
-
-	}
-}
-/*}}}*/
-void  Pengrid::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){/*{{{*/
-	/*Nothing updated yet*/
-}
-/*}}}*/
-void  Pengrid::InputUpdateFromVector(IssmDouble* vector, int name, int type){/*{{{*/
-	/*Nothing updated yet*/
-}
-/*}}}*/
-void  Pengrid::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*{{{*/
-	/*Nothing updated yet*/
 }
 /*}}}*/
@@ -440,5 +381,5 @@
 	/*Get sediment water head h*/
 	inefanalysis = new HydrologyDCInefficientAnalysis();
-	element->GetInputValue(&h,node,SedimentHeadHydrostepEnum);
+	element->GetInputValue(&h,node,SedimentHeadSubstepEnum);
 	inefanalysis->GetHydrologyDCInefficientHmax(&h_max,element,node);
 	parameters->FindParam(&penalty_lock,HydrologydcPenaltyLockEnum);
@@ -502,5 +443,5 @@
 
 	//Compute pressure melting point
-	t_pmp=matpar->TMeltingPoint(pressure);
+	t_pmp=element->TMeltingPoint(pressure);
 
 	//Figure out if temperature is over melting_point, in which case, this penalty needs to be activated.
@@ -570,5 +511,5 @@
 
 	/*Compute pressure melting point*/
-	t_pmp=matpar->GetMaterialParameter(MaterialsMeltingpointEnum)-matpar->GetMaterialParameter(MaterialsBetaEnum)*pressure;
+	t_pmp=parameters->FindParam(MaterialsMeltingpointEnum)-parameters->FindParam(MaterialsBetaEnum)*pressure;
 
 	/*Add penalty load*/
@@ -645,5 +586,5 @@
 
 	/*Compute pressure melting point*/
-	t_pmp=matpar->GetMaterialParameter(MaterialsMeltingpointEnum)-matpar->GetMaterialParameter(MaterialsBetaEnum)*pressure;
+	t_pmp=parameters->FindParam(MaterialsMeltingpointEnum)-parameters->FindParam(MaterialsBetaEnum)*pressure;
 
 	/*Add penalty load
@@ -680,5 +621,5 @@
 
 	/*Compute pressure melting point*/
-	t_pmp=matpar->GetMaterialParameter(MaterialsMeltingpointEnum)-matpar->GetMaterialParameter(MaterialsBetaEnum)*pressure;
+	t_pmp=parameters->FindParam(MaterialsMeltingpointEnum)-parameters->FindParam(MaterialsBetaEnum)*pressure;
 
 	pe->values[0]=kmax*pow(10.,penalty_factor)*t_pmp;
@@ -693,2 +634,7 @@
 }
 /*}}}*/
+void           Pengrid::ResetZigzagCounter(){/*{{{*/
+
+	zigzag_counter=0;
+}
+/*}}}*/
Index: /issm/trunk/src/c/classes/Loads/Pengrid.h
===================================================================
--- /issm/trunk/src/c/classes/Loads/Pengrid.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Loads/Pengrid.h	(revision 24313)
@@ -23,16 +23,13 @@
 	private: 
 
-		int        id;
-		int        analysis_type;
+		int id;
 
 		/*Hooks*/
 		Hook* hnode;  //hook to 1 node
 		Hook* helement;  //hook to 1 element
-		Hook* hmatpar; //hook to 1 matpar
 
 		/*Corresponding fields*/
 		Node    *node;
 		Element *element;
-		Matpar  *matpar;
 
 		Parameters* parameters; //pointer to solution parameters
@@ -46,5 +43,5 @@
 		/*Pengrid constructors, destructors {{{*/
 		Pengrid();
-		Pengrid(int id, int index, IoModel* iomodel,int analysis_type);
+		Pengrid(int id, int index, IoModel* iomodel);
 		~Pengrid();
 		/*}}}*/
@@ -57,13 +54,4 @@
 		int   ObjectEnum();
 		/*}}}*/
-		/*Update virtual functions resolution: {{{*/
-		void  InputUpdateFromConstant(IssmDouble constant, int name);
-		void  InputUpdateFromConstant(int constant, int name);
-		void  InputUpdateFromConstant(bool constant, int name);
-		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");};
-		void  InputUpdateFromMatrixDakota(IssmDouble* matrix ,int nrows, int ncols, int name, int type);
-		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
-		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
-		/*}}}*/
 		/*Load virtual functions definitions: {{{*/
 		void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
@@ -74,5 +62,4 @@
 		void  GetNodesSidList(int* sidlist);
 		int   GetNumberOfNodes(void);
-		bool  InAnalysis(int analysis_type);
 		bool  IsPenalty(void);
 		void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");};
@@ -94,4 +81,5 @@
 		ElementVector* PenaltyCreatePVectorThermal(IssmDouble kmax);
 		void  ResetConstraint(void);
+		void  ResetZigzagCounter(void);
 		/*}}}*/
 
Index: /issm/trunk/src/c/classes/Loads/Penpair.cpp
===================================================================
--- /issm/trunk/src/c/classes/Loads/Penpair.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Loads/Penpair.cpp	(revision 24313)
@@ -27,8 +27,7 @@
 }
 /*}}}*/
-Penpair::Penpair(int penpair_id, int* penpair_node_ids,int in_analysis_type){/*{{{*/
+Penpair::Penpair(int penpair_id, int* penpair_node_ids){/*{{{*/
 
 	this->id=penpair_id;
-	this->analysis_type=in_analysis_type;
 	this->hnodes=new Hook(penpair_node_ids,2);
 	this->parameters=NULL;
@@ -53,5 +52,4 @@
 	/*copy fields: */
 	penpair->id=this->id;
-	penpair->analysis_type=this->analysis_type;
 
 	/*now deal with hooks and objects: */
@@ -70,5 +68,4 @@
 	_printf_("Penpair:\n");
 	_printf_("   id: " << id << "\n");
-	_printf_("   analysis_type: " << EnumToStringx(analysis_type) << "\n");
 	hnodes->DeepEcho();
 
@@ -80,5 +77,4 @@
 	_printf_("Penpair:\n");
 	_printf_("   id: " << id << "\n");
-	_printf_("   analysis_type: " << EnumToStringx(analysis_type) << "\n");
 	hnodes->Echo();
 
@@ -95,5 +91,4 @@
 	MARSHALLING_ENUM(PenpairEnum);
 	MARSHALLING(id);
-	MARSHALLING(analysis_type);
 
 	if(marshall_direction==MARSHALLING_BACKWARD){
@@ -165,9 +160,4 @@
 
 	return NUMVERTICES;
-}
-/*}}}*/
-bool  Penpair::InAnalysis(int in_analysis_type){/*{{{*/
-	if (in_analysis_type==this->analysis_type)return true;
-	else return false;
 }
 /*}}}*/
@@ -245,5 +235,5 @@
 			switch(set2_enum){
 				case FsetEnum:
-					if(nodes[i]->indexing.fsize){
+					if(nodes[i]->fsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -253,5 +243,5 @@
 					break;
 				case GsetEnum:
-					if(nodes[i]->indexing.gsize){
+					if(nodes[i]->gsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -261,5 +251,5 @@
 					break;
 				case SsetEnum:
-					if(nodes[i]->indexing.ssize){
+					if(nodes[i]->ssize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
Index: /issm/trunk/src/c/classes/Loads/Penpair.h
===================================================================
--- /issm/trunk/src/c/classes/Loads/Penpair.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Loads/Penpair.h	(revision 24313)
@@ -18,5 +18,4 @@
 	private: 
 		int          id;
-		int          analysis_type;
 		Hook        *hnodes;          //hook to 2 nodes
 		Node       **nodes;
@@ -27,5 +26,5 @@
 		/*Penpair constructors, destructors: {{{*/
 		Penpair();
-		Penpair(int penpair_id,int* penpair_node_ids,int analysis_type);
+		Penpair(int penpair_id,int* penpair_node_ids);
 		~Penpair();
 		/*}}}*/
@@ -55,5 +54,4 @@
 		void  GetNodesSidList(int* sidlist);
 		int   GetNumberOfNodes(void);
-		bool  InAnalysis(int analysis_type);
 		bool  IsPenalty(void);
 		void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax);
Index: /issm/trunk/src/c/classes/Loads/Riftfront.cpp
===================================================================
--- /issm/trunk/src/c/classes/Loads/Riftfront.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Loads/Riftfront.cpp	(revision 24313)
@@ -23,12 +23,12 @@
 	this->parameters=NULL;
 	this->hnodes=NULL;
+	this->hvertices=NULL;
 	this->helements=NULL;
-	this->hmatpar=NULL;
 	this->nodes=NULL;
+	this->vertices=NULL;
 	this->elements=NULL;
-	this->matpar=NULL;
-}
-/*}}}*/
-Riftfront::Riftfront(int riftfront_id,int i, IoModel* iomodel,int riftfront_analysis_type){/*{{{*/
+}
+/*}}}*/
+Riftfront::Riftfront(int riftfront_id,int i, IoModel* iomodel){/*{{{*/
 
 	/*data: */
@@ -36,5 +36,4 @@
 	int    riftfront_node_ids[2];
 	int    riftfront_elem_ids[2];
-	int    riftfront_matpar_id;
 	IssmDouble riftfront_friction;
 	IssmDouble riftfront_fractionincrement;
@@ -57,17 +56,15 @@
 	/*id: */
 	this->id=riftfront_id;
-	this->analysis_type=riftfront_analysis_type;
 
 	/*hooks: */
-	riftfront_node_ids[0]=iomodel->nodecounter+node1;
-	riftfront_node_ids[1]=iomodel->nodecounter+node2;
+	riftfront_node_ids[0]=node1;
+	riftfront_node_ids[1]=node2;
 	riftfront_elem_ids[0]=el1;
 	riftfront_elem_ids[1]=el2;
-	riftfront_matpar_id=iomodel->numberofelements+1; //matlab indexing
 
 	/*Hooks: */
 	this->hnodes=new Hook(riftfront_node_ids,2);
+	this->hvertices=new Hook(riftfront_node_ids,2);
 	this->helements=new Hook(riftfront_elem_ids,2);
-	this->hmatpar=new Hook(&riftfront_matpar_id,1);
 
 	/*computational parameters: */
@@ -94,6 +91,6 @@
 	this->parameters=NULL;
 	this->nodes= NULL;
+	this->vertices= NULL;
 	this->elements= NULL;
-	this->matpar= NULL;
 
 }
@@ -102,6 +99,6 @@
 	this->parameters=NULL;
 	delete hnodes;
+	delete hvertices;
 	delete helements;
-	delete hmatpar;
 }
 /*}}}*/
@@ -116,5 +113,4 @@
 	/*copy fields: */
 	riftfront->id=this->id;
-	riftfront->analysis_type=this->analysis_type;
 	riftfront->type=this->type;
 	riftfront->fill=this->fill;
@@ -128,11 +124,11 @@
 	/*now deal with hooks and objects: */
 	riftfront->hnodes=(Hook*)this->hnodes->copy();
+	riftfront->hvertices=(Hook*)this->hvertices->copy();
 	riftfront->helements=(Hook*)this->helements->copy();
-	riftfront->hmatpar=(Hook*)this->hmatpar->copy();
 
 	/*corresponding fields*/
 	riftfront->nodes   =(Node**)riftfront->hnodes->deliverp();
+	riftfront->vertices=(Vertex**)riftfront->hvertices->deliverp();
 	riftfront->elements=(Element**)riftfront->helements->deliverp();
-	riftfront->matpar  =(Matpar*)riftfront->hmatpar->delivers();
 
 	/*internal data: */
@@ -157,8 +153,7 @@
 	_printf_("Riftfront:\n");
 	_printf_("   id: " << id << "\n");
-	_printf_("   analysis_type: " << EnumToStringx(analysis_type) << "\n");
 	hnodes->DeepEcho();
+	hvertices->DeepEcho();
 	helements->DeepEcho();
-	hmatpar->DeepEcho();
 	_printf_("   parameters\n");
 	if(parameters)parameters->DeepEcho();
@@ -169,8 +164,7 @@
 	_printf_("Riftfront:\n");
 	_printf_("   id: " << id << "\n");
-	_printf_("   analysis_type: " << EnumToStringx(analysis_type) << "\n");
 	_printf_("   hnodes: " << hnodes << "\n");
+	_printf_("   hvertices: " << hvertices << "\n");
 	_printf_("   helements: " << helements << "\n");
-	_printf_("   hmatpar: " << hmatpar << "\n");
 	_printf_("   parameters: " << parameters << "\n");
 	_printf_("   internal parameters: \n");
@@ -200,5 +194,4 @@
 	MARSHALLING_ENUM(RiftfrontEnum);
 	MARSHALLING(id);
-	MARSHALLING(analysis_type);
 	MARSHALLING(type);
 	MARSHALLING(fill);
@@ -209,15 +202,15 @@
 	if(marshall_direction==MARSHALLING_BACKWARD){
 		this->hnodes      = new Hook();
-		this->hmatpar     = new Hook();
+		this->hvertices      = new Hook();
 		this->helements   = new Hook();
 	}
 
 	this->hnodes->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-	this->hmatpar->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+	this->hvertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	this->helements->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 
 	/*corresponding fields*/
 	nodes     =(Node**)this->hnodes->deliverp();
-	matpar    =(Matpar*)this->hmatpar->delivers();
+	vertices  =(Vertex**)this->hvertices->deliverp();
 	elements  =(Element**)this->helements->deliverp();
 
@@ -264,11 +257,11 @@
 	 * datasets, using internal ids and offsets hidden in hooks: */
 	hnodes->configure(nodesin);
+	hvertices->configure(verticesin);
 	helements->configure(elementsin);
-	hmatpar->configure(materialsin);
 
 	/*Initialize hooked fields*/
 	this->nodes   =(Node**)hnodes->deliverp();
+	this->vertices=(Vertex**)hvertices->deliverp();
 	this->elements=(Element**)helements->deliverp();
-	this->matpar  =(Matpar*)hmatpar->delivers();
 
 	/*point parameters to real dataset: */
@@ -306,9 +299,4 @@
 
 	return NUMVERTICES;
-}
-/*}}}*/
-bool  Riftfront::InAnalysis(int in_analysis_type){/*{{{*/
-	if (in_analysis_type==this->analysis_type) return true;
-	else return false;
 }
 /*}}}*/
@@ -370,12 +358,12 @@
 
 	this->nodes=NULL;
+	this->vertices=NULL;
 	this->elements=NULL;
-	this->matpar=NULL;
 	this->parameters=NULL;
 
 	/*Get Element type*/
 	this->hnodes->reset();
+	this->hvertices->reset();
 	this->helements->reset();
-	this->hmatpar->reset();
 
 }
@@ -406,5 +394,5 @@
 			switch(set2_enum){
 				case FsetEnum:
-					if(nodes[i]->indexing.fsize){
+					if(nodes[i]->fsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -414,5 +402,5 @@
 					break;
 				case GsetEnum:
-					if(nodes[i]->indexing.gsize){
+					if(nodes[i]->gsize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -422,5 +410,5 @@
 					break;
 				case SsetEnum:
-					if(nodes[i]->indexing.ssize){
+					if(nodes[i]->ssize){
 						if(this->nodes[i]->IsClone())
 						 o_nz += 1;
@@ -448,12 +436,8 @@
 	IssmDouble  penalty_offset;
 
-	/*Objects: */
-	Tria       *tria1               = NULL;
-	Tria       *tria2               = NULL;
-
 	/*enum of element? */
 	if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!");
-	tria1=(Tria*)elements[0];
-	tria2=(Tria*)elements[1];
+	Tria* tria1=(Tria*)elements[0];
+	Tria* tria2=(Tria*)elements[1];
 
 	/*Initialize Element Matrix*/
@@ -463,6 +447,6 @@
 	/*Get some parameters: */
 	this->parameters->FindParam(&penalty_offset,StressbalancePenaltyFactorEnum);
-	tria1->GetInputValue(&h[0],nodes[0],ThicknessEnum);
-	tria2->GetInputValue(&h[1],nodes[1],ThicknessEnum);
+	tria1->GetInputValue(&h[0],vertices[0],ThicknessEnum);
+	tria2->GetInputValue(&h[1],vertices[1],ThicknessEnum);
 	if (h[0]!=h[1])_error_("different thicknesses not supported for rift fronts");
 	thickness=h[0];
@@ -534,12 +518,8 @@
 	IssmDouble pressure_water;
 
-	/*Objects: */
-	Tria *tria1 = NULL;
-	Tria *tria2 = NULL;
-
 	/*enum of element? */
 	if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!");
-	tria1=(Tria*)elements[0];
-	tria2=(Tria*)elements[1];
+	Tria* tria1=(Tria*)elements[0];
+	Tria* tria2=(Tria*)elements[1];
 
 	/*Initialize Element Matrix*/
@@ -548,13 +528,13 @@
 
 	/*Get some inputs: */
-	rho_ice=matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-	rho_water=matpar->GetMaterialParameter(MaterialsRhoSeawaterEnum);
-	gravity=matpar->GetMaterialParameter(ConstantsGEnum);
-	tria1->GetInputValue(&h[0],nodes[0],ThicknessEnum);
-	tria2->GetInputValue(&h[1],nodes[1],ThicknessEnum);
+	rho_ice=tria1->FindParam(MaterialsRhoIceEnum);
+	rho_water=tria1->FindParam(MaterialsRhoSeawaterEnum);
+	gravity=tria1->FindParam(ConstantsGEnum);
+	tria1->GetInputValue(&h[0],vertices[0],ThicknessEnum);
+	tria2->GetInputValue(&h[1],vertices[1],ThicknessEnum);
 	if (h[0]!=h[1])_error_("different thicknesses not supported for rift fronts");
 	thickness=h[0];
-	tria1->GetInputValue(&b[0],nodes[0],BaseEnum);
-	tria2->GetInputValue(&b[1],nodes[1],BaseEnum);
+	tria1->GetInputValue(&b[0],vertices[0],BaseEnum);
+	tria2->GetInputValue(&b[1],vertices[1],BaseEnum);
 	if (b[0]!=b[1])_error_("different beds not supported for rift fronts");
 	bed=b[0];
@@ -599,10 +579,10 @@
 
 	/*Ok, add contribution to first node, along the normal i==0: */
-	for (j=0;j<2;j++){
+	for(int j=0;j<2;j++){
 		pe->values[j]+=pressure*normal[j]*length;
 	}
 
 	/*Add contribution to second node, along the opposite normal: i==1 */
-	for (j=0;j<2;j++){
+	for(int j=0;j<2;j++){
 		pe->values[2+j]+= -pressure*normal[j]*length;
 	}	
@@ -652,8 +632,8 @@
 
 	/*First recover velocity: */
-	tria1->GetInputValue(&vx1,nodes[0],VxEnum);
-	tria2->GetInputValue(&vx2,nodes[1],VxEnum);
-	tria1->GetInputValue(&vy1,nodes[0],VyEnum);
-	tria2->GetInputValue(&vy2,nodes[1],VyEnum);
+	tria1->GetInputValue(&vx1,vertices[0],VxEnum);
+	tria2->GetInputValue(&vx2,vertices[1],VxEnum);
+	tria1->GetInputValue(&vy1,vertices[0],VyEnum);
+	tria2->GetInputValue(&vy2,vertices[1],VyEnum);
 
 	/*Node 1 faces node 2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */
Index: /issm/trunk/src/c/classes/Loads/Riftfront.h
===================================================================
--- /issm/trunk/src/c/classes/Loads/Riftfront.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Loads/Riftfront.h	(revision 24313)
@@ -18,5 +18,4 @@
 	public:
 		int		id;
-		int     analysis_type;
 
 		/*properties*/
@@ -29,10 +28,10 @@
 		/*hooks: */
 		Hook* hnodes;
+		Hook* hvertices;
 		Hook* helements;
-		Hook* hmatpar;
 
 		/*Corresponding fields*/
-		Matpar   *matpar;
 		Node    **nodes;
+		Vertex  **vertices;
 		Element **elements;
 
@@ -53,5 +52,5 @@
 		/*Riftfrontconstructors,destructors: {{{*/
 		Riftfront();
-		Riftfront(int riftfront_id,int i, IoModel* iomodel,int analysis_type);
+		Riftfront(int riftfront_id,int i, IoModel* iomodel);
 		~Riftfront();
 		/*}}}*/
@@ -81,5 +80,4 @@
 		void  GetNodesSidList(int* sidlist);
 		int   GetNumberOfNodes(void);
-		bool  InAnalysis(int analysis_type);
 		bool  IsPenalty(void);
 		void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");};
Index: /issm/trunk/src/c/classes/Materials/Material.h
===================================================================
--- /issm/trunk/src/c/classes/Materials/Material.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Materials/Material.h	(revision 24313)
@@ -11,5 +11,5 @@
 template <class doubletype> class Vector;
 #include "../../datastructures/datastructures.h"
-#include "../Update.h"
+#include "../../toolkits/toolkits.h"
 class Element;
 class Elements;
@@ -18,9 +18,8 @@
 /*}}}*/
 
-class Material: public Object,public Update{
+class Material: public Object{
 
 	public: 
 		virtual ~Material(){};
-		/*WARNING: input should not be public but it is an easy way to update B from T (using UpdateFromSolution) from Pentas*/
 
 		/*Numerics*/
Index: /issm/trunk/src/c/classes/Materials/Matestar.cpp
===================================================================
--- /issm/trunk/src/c/classes/Materials/Matestar.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Materials/Matestar.cpp	(revision 24313)
@@ -370,28 +370,4 @@
 }
 /*}}}*/
-void  Matestar::InputUpdateFromConstant(IssmDouble constant, int name){/*{{{*/
-	/*Nothing updated yet*/
-}
-/*}}}*/
-void  Matestar::InputUpdateFromConstant(int constant, int name){/*{{{*/
-	/*Nothing updated yet*/
-}
-/*}}}*/
-void  Matestar::InputUpdateFromConstant(bool constant, int name){/*{{{*/
-	/*Nothing updated yet*/
-}
-/*}}}*/
-void  Matestar::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols,int name, int type){/*{{{*/
-	/*Nothing updated yet*/
-}
-/*}}}*/
-void  Matestar::InputUpdateFromVector(IssmDouble* vector, int name, int type){/*{{{*/
-
-}
-/*}}}*/
-void  Matestar::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*{{{*/
-
-}
-/*}}}*/
 bool Matestar::IsDamage(){/*{{{*/
 
Index: /issm/trunk/src/c/classes/Materials/Matestar.h
===================================================================
--- /issm/trunk/src/c/classes/Materials/Matestar.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Materials/Matestar.h	(revision 24313)
@@ -44,13 +44,4 @@
 		int   ObjectEnum();
 		/*}}}*/
-		/*Update virtual funictions definitions: {{{*/
-		void  InputUpdateFromConstant(IssmDouble constant, int name);
-		void  InputUpdateFromConstant(int constant, int name);
-		void  InputUpdateFromConstant(bool constant, int name);
-		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented");};
-		void  InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrow, int ncols, int name, int type);
-		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
-		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
-		/*}}}*/
 		/*Material virtual functions resolution: {{{*/
 		void   Configure(Elements* elements);
Index: /issm/trunk/src/c/classes/Materials/Matice.cpp
===================================================================
--- /issm/trunk/src/c/classes/Materials/Matice.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Materials/Matice.cpp	(revision 24313)
@@ -654,28 +654,4 @@
 }
 /*}}}*/
-void  Matice::InputUpdateFromConstant(IssmDouble constant, int name){/*{{{*/
-	/*Nothing updated yet*/
-}
-/*}}}*/
-void  Matice::InputUpdateFromConstant(int constant, int name){/*{{{*/
-	/*Nothing updated yet*/
-}
-/*}}}*/
-void  Matice::InputUpdateFromConstant(bool constant, int name){/*{{{*/
-	/*Nothing updated yet*/
-}
-/*}}}*/
-void  Matice::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols,int name, int type){/*{{{*/
-	/*Nothing updated yet*/
-}
-/*}}}*/
-void  Matice::InputUpdateFromVector(IssmDouble* vector, int name, int type){/*{{{*/
-
-}
-/*}}}*/
-void  Matice::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*{{{*/
-
-}
-/*}}}*/
 void  Matice::ResetHooks(){/*{{{*/
 
@@ -792,5 +768,5 @@
 	surface_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss);
 	z=this->element->GetZcoord(xyz_list,gauss);
-	tau_perp = element->matpar->GetMaterialParameter(MaterialsRhoIceEnum) * element->matpar->GetMaterialParameter(ConstantsGEnum) * fabs(s-z)*sqrt(slope[0]*slope[0]+slope[1]*slope[1]);
+	tau_perp = element->FindParam(MaterialsRhoIceEnum) * element->FindParam(ConstantsGEnum) * fabs(s-z)*sqrt(slope[0]*slope[0]+slope[1]*slope[1]);
 
 	/* Get eps_b*/
Index: /issm/trunk/src/c/classes/Materials/Matice.h
===================================================================
--- /issm/trunk/src/c/classes/Materials/Matice.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Materials/Matice.h	(revision 24313)
@@ -48,13 +48,4 @@
 		int   ObjectEnum();
 		/*}}}*/
-		/*Update virtual funictions definitions: {{{*/
-		void  InputUpdateFromConstant(IssmDouble constant, int name);
-		void  InputUpdateFromConstant(int constant, int name);
-		void  InputUpdateFromConstant(bool constant, int name);
-		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented");};
-		void  InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrow, int ncols, int name, int type);
-		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
-		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
-		/*}}}*/
 		/*Material virtual functions resolution: {{{*/
 		void   Configure(Elements* elements);
Index: /issm/trunk/src/c/classes/Materials/Matlitho.cpp
===================================================================
--- /issm/trunk/src/c/classes/Materials/Matlitho.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Materials/Matlitho.cpp	(revision 24313)
@@ -182,6 +182,4 @@
 /*}}}*/
 
-/*Update virtual functions definitions:*/
-
 /*Matlitho management: */
 void       Matlitho::Configure(Elements* elementsin){/*{{{*/
Index: /issm/trunk/src/c/classes/Materials/Matlitho.h
===================================================================
--- /issm/trunk/src/c/classes/Materials/Matlitho.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Materials/Matlitho.h	(revision 24313)
@@ -40,13 +40,4 @@
 		int     ObjectEnum();
 		/*}}}*/
-		/*Update virtual functions resolution: {{{*/
-		void   InputUpdateFromConstant(IssmDouble constant, int name){_error_("not implemented");};
-		void   InputUpdateFromConstant(int constant, int name){_error_("not implemented");};
-		void   InputUpdateFromConstant(bool constant, int name){_error_("not implemented");};
-		void   InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented");};
-		void   InputUpdateFromMatrixDakota(IssmDouble* matrix,int nrows,int ncols, int name, int type){_error_("not implemented");};
-		void   InputUpdateFromVector(IssmDouble* vector, int name, int type){_error_("not implemented");};
-		void   InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){_error_("not implemented");};
-		/*}}}*/
 		/*Material virtual functions resolution: {{{*/
 		Material*  copy2(Element* element){_error_("not implemented");};
@@ -83,13 +74,4 @@
 
 		/*}}}*/
-		/*Numerics: {{{*/
-		void       EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure){_error_("not supported");};
-		IssmDouble GetEnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure){_error_("not supported");};
-		IssmDouble GetEnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure){_error_("not supported");};
-		IssmDouble GetMaterialParameter(int in_enum){_error_("not supported");}; 
-		IssmDouble PureIceEnthalpy(IssmDouble pressure){_error_("not supported");};
-		void       ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure){_error_("not supported");};
-		IssmDouble TMeltingPoint(IssmDouble pressure){_error_("not supported");};
-		/*}}}*/
 
 };
Index: sm/trunk/src/c/classes/Materials/Matpar.cpp
===================================================================
--- /issm/trunk/src/c/classes/Materials/Matpar.cpp	(revision 24312)
+++ 	(revision )
@@ -1,710 +1,0 @@
-/*!\file Matpar.c
- * \brief: implementation of the Matpar object
- */
-
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-#include "../classes.h"
-#include "../../shared/shared.h"
-
-/*Matpar constructors and destructor*/
-Matpar::Matpar(){/*{{{*/
-	return;
-}
-/*}}}*/
-Matpar::Matpar(IoModel* iomodel){/*{{{*/
-
-	rho_ice                   = 0;
-	rho_water                 = 0;
-	rho_freshwater            = 0;
-	mu_water                  = 0;
-	heatcapacity              = 0;
-	thermalconductivity       = 0;
-	temperateiceconductivity  = 0;
-	latentheat                = 0;
-	beta                      = 0;
-	meltingpoint              = 0;
-	referencetemperature      = 0;
-	mixed_layer_capacity      = 0;
-	thermal_exchange_velocity = 0;
-	g                         = 0;
-	omega                     = 0;
-	desfac                    = 0;
-	rlaps                     = 0;
-	rlapslgm                  = 0;
-	dpermil                   = 0;
-	rheology_law              = 0;
-
-	albedo_snow               = 0;
-	albedo_ice                = 0;
-
-	sediment_compressibility  = 0;
-	sediment_porosity         = 0;
-	sediment_thickness        = 0;
-	water_compressibility     = 0;
-
-	epl_compressibility       = 0;
-	epl_porosity              = 0;
-	epl_init_thickness        = 0;
-	epl_colapse_thickness     = 0;
-	epl_max_thickness         = 0;
-	epl_conductivity          = 0;
-
-	lithosphere_shear_modulus = 0;
-	lithosphere_density       = 0;
-	mantle_shear_modulus      = 0;
-	mantle_density            = 0;
-
-	earth_density             = 0;
-
-	int nnat,dummy;
-	int* nature=NULL;
-
-	bool isefficientlayer;
-	int  hydrology_model,smb_model,materials_type;
-	iomodel->FindConstant(&hydrology_model,"md.hydrology.model");
-	iomodel->FindConstant(&smb_model,"md.smb.model");
-	iomodel->FindConstant(&materials_type,"md.materials.type");
-
-	this->mid = iomodel->matparcounter;
-
-	switch(materials_type){
-		case MaticeEnum:
-		case MatdamageiceEnum:
-		case MatenhancediceEnum:
-		case MatestarEnum:
-			iomodel->FindConstant(&this->rho_ice,"md.materials.rho_ice");
-			iomodel->FindConstant(&this->rho_water,"md.materials.rho_water");
-			iomodel->FindConstant(&this->rho_freshwater,"md.materials.rho_freshwater");
-			iomodel->FindConstant(&this->mu_water,"md.materials.mu_water");
-			iomodel->FindConstant(&this->heatcapacity,"md.materials.heatcapacity");
-			iomodel->FindConstant(&this->thermalconductivity,"md.materials.thermalconductivity");
-			iomodel->FindConstant(&this->temperateiceconductivity,"md.materials.temperateiceconductivity");
-			iomodel->FindConstant(&this->latentheat,"md.materials.latentheat");
-			iomodel->FindConstant(&this->beta,"md.materials.beta");
-			iomodel->FindConstant(&this->meltingpoint,"md.materials.meltingpoint");
-			iomodel->FindConstant(&this->referencetemperature,"md.constants.referencetemperature");
-			iomodel->FindConstant(&this->mixed_layer_capacity,"md.materials.mixed_layer_capacity");
-			iomodel->FindConstant(&this->thermal_exchange_velocity,"md.materials.thermal_exchange_velocity");
-			iomodel->FindConstant(&this->g,"md.constants.g");
-			iomodel->FindConstant(&this->rheology_law,"md.materials.rheology_law");
-
-			switch(smb_model){
-				case SMBforcingEnum:
-					/*Nothing to add*/
-					break;
-				case SMBgembEnum:
-					iomodel->FindConstant(&this->albedo_ice,"md.smb.aIce");
-					iomodel->FindConstant(&this->albedo_snow,"md.smb.aSnow");
-					break;
-				case SMBpddEnum:
-					iomodel->FindConstant(&this->desfac,"md.smb.desfac");
-					iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
-					iomodel->FindConstant(&this->rlapslgm,"md.smb.rlapslgm");
-					break;
-				case SMBpddSicopolisEnum:
-					iomodel->FindConstant(&this->desfac,"md.smb.desfac");
-					iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
-					break;
-				case SMBd18opddEnum:
-					iomodel->FindConstant(&this->desfac,"md.smb.desfac");
-					iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
-					iomodel->FindConstant(&this->rlapslgm,"md.smb.rlapslgm");
-					iomodel->FindConstant(&this->dpermil,"md.smb.dpermil");
-				case SMBgradientsEnum:
-					/*Nothing to add*/
-					break;
-				case SMBgradientselaEnum:
-					/*Nothing to add*/
-					break;
-				case SMBhenningEnum:
-					/*Nothing to add*/
-					break;
-				case SMBcomponentsEnum:
-					/*Nothing to add*/
-					break;
-				case SMBmeltcomponentsEnum:
-					/*Nothing to add*/
-					break;
-				case SMBgradientscomponentsEnum:
-					/*Nothing to add*/
-					break;
-				default:
-					_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
-			}
-			if(hydrology_model==HydrologydcEnum){
-				iomodel->FindConstant(&this->sediment_compressibility,"md.hydrology.sediment_compressibility");
-				iomodel->FindConstant(&this->sediment_porosity,"md.hydrology.sediment_porosity");
-				iomodel->FindConstant(&this->sediment_thickness,"md.hydrology.sediment_thickness");
-				iomodel->FindConstant(&this->water_compressibility,"md.hydrology.water_compressibility");
-				iomodel->FindConstant(&isefficientlayer,"md.hydrology.isefficientlayer");
-
-				if(isefficientlayer){
-					iomodel->FindConstant(&this->epl_compressibility,"md.hydrology.epl_compressibility");
-					iomodel->FindConstant(&this->epl_porosity,"md.hydrology.epl_porosity");
-					iomodel->FindConstant(&this->epl_init_thickness,"md.hydrology.epl_initial_thickness");
-					iomodel->FindConstant(&this->epl_colapse_thickness,"md.hydrology.epl_colapse_thickness");
-					iomodel->FindConstant(&this->epl_max_thickness,"md.hydrology.epl_max_thickness");
-					iomodel->FindConstant(&this->epl_conductivity,"md.hydrology.epl_conductivity");
-				}
-			}
-			else if(hydrology_model==HydrologyshreveEnum){
-				/*Nothing to add*/
-			}
-			else if(hydrology_model==HydrologyshaktiEnum){
-				/*Nothing to add*/
-			}
-			else if(hydrology_model==HydrologypismEnum){
-				/*Nothing to add*/
-			}
-			else{
-				_error_("Hydrology model "<<EnumToStringx(hydrology_model)<<" not supported yet");
-			}
-
-			/*gia: */
-			iomodel->FindConstant(&this->lithosphere_shear_modulus,"md.materials.lithosphere_shear_modulus");
-			iomodel->FindConstant(&this->lithosphere_density,"md.materials.lithosphere_density");
-			iomodel->FindConstant(&this->mantle_shear_modulus,"md.materials.mantle_shear_modulus");
-			iomodel->FindConstant(&this->mantle_density,"md.materials.mantle_density");
-
-			/*slr:*/
-			iomodel->FindConstant(&this->earth_density,"md.materials.earth_density");
-
-			break;
-		case MaterialsEnum:
-			//we have several types of materials. Retrieve this info first:
-			iomodel->FetchData(&nature,&nnat,&dummy,"md.materials.nature");
-
-			//go through list of materials, and create constant parameters accordingly:
-			for(int i=0;i<nnat;i++){
-				switch(IoCodeToEnumMaterials(nature[i])){ //{{{
-					case MatlithoEnum:
-						break;
-					case MaticeEnum:
-					case MatdamageiceEnum:
-					case MatenhancediceEnum:
-					case MatestarEnum:
-						iomodel->FindConstant(&this->rho_ice,"md.materials.rho_ice");
-						iomodel->FindConstant(&this->rho_water,"md.materials.rho_water");
-						iomodel->FindConstant(&this->rho_freshwater,"md.materials.rho_freshwater");
-						iomodel->FindConstant(&this->mu_water,"md.materials.mu_water");
-						iomodel->FindConstant(&this->heatcapacity,"md.materials.heatcapacity");
-						iomodel->FindConstant(&this->thermalconductivity,"md.materials.thermalconductivity");
-						iomodel->FindConstant(&this->temperateiceconductivity,"md.materials.temperateiceconductivity");
-						iomodel->FindConstant(&this->latentheat,"md.materials.latentheat");
-						iomodel->FindConstant(&this->beta,"md.materials.beta");
-						iomodel->FindConstant(&this->meltingpoint,"md.materials.meltingpoint");
-						iomodel->FindConstant(&this->referencetemperature,"md.constants.referencetemperature");
-						iomodel->FindConstant(&this->mixed_layer_capacity,"md.materials.mixed_layer_capacity");
-						iomodel->FindConstant(&this->thermal_exchange_velocity,"md.materials.thermal_exchange_velocity");
-						iomodel->FindConstant(&this->g,"md.constants.g");
-						iomodel->FindConstant(&this->rheology_law,"md.materials.rheology_law");
-
-						switch(smb_model){ //{{{
-							case SMBforcingEnum:
-								/*Nothing to add*/
-								break;
-							case SMBgembEnum:
-								iomodel->FindConstant(&this->albedo_ice,"md.smb.aIce");
-								iomodel->FindConstant(&this->albedo_snow,"md.smb.aSnow");
-								break;
-							case SMBpddEnum:
-								iomodel->FindConstant(&this->desfac,"md.smb.desfac");
-								iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
-								iomodel->FindConstant(&this->rlapslgm,"md.smb.rlapslgm");
-								break;
-							case SMBpddSicopolisEnum:
-								iomodel->FindConstant(&this->desfac,"md.smb.desfac");
-								iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
-								break;
-							case SMBd18opddEnum:
-								iomodel->FindConstant(&this->desfac,"md.smb.desfac");
-								iomodel->FindConstant(&this->rlaps,"md.smb.rlaps");
-								iomodel->FindConstant(&this->rlapslgm,"md.smb.rlapslgm");
-								iomodel->FindConstant(&this->dpermil,"md.smb.dpermil");
-							case SMBgradientsEnum:
-								/*Nothing to add*/
-								break;
-							case SMBgradientselaEnum:
-								/*Nothing to add*/
-								break;
-							case SMBhenningEnum:
-								/*Nothing to add*/
-								break;
-							case SMBcomponentsEnum:
-								/*Nothing to add*/
-								break;
-							case SMBmeltcomponentsEnum:
-								/*Nothing to add*/
-								break;
-							default:
-								_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
-						}
-						if(hydrology_model==HydrologydcEnum){
-							iomodel->FindConstant(&this->sediment_compressibility,"md.hydrology.sediment_compressibility");
-							iomodel->FindConstant(&this->sediment_porosity,"md.hydrology.sediment_porosity");
-							iomodel->FindConstant(&this->sediment_thickness,"md.hydrology.sediment_thickness");
-							iomodel->FindConstant(&this->water_compressibility,"md.hydrology.water_compressibility");
-							iomodel->FindConstant(&isefficientlayer,"md.hydrology.isefficientlayer");
-
-							if(isefficientlayer){
-								iomodel->FindConstant(&this->epl_compressibility,"md.hydrology.epl_compressibility");
-								iomodel->FindConstant(&this->epl_porosity,"md.hydrology.epl_porosity");
-								iomodel->FindConstant(&this->epl_init_thickness,"md.hydrology.epl_initial_thickness");
-								iomodel->FindConstant(&this->epl_colapse_thickness,"md.hydrology.epl_colapse_thickness");
-								iomodel->FindConstant(&this->epl_max_thickness,"md.hydrology.epl_max_thickness");
-								iomodel->FindConstant(&this->epl_conductivity,"md.hydrology.epl_conductivity");
-							}
-						}
-						else if(hydrology_model==HydrologyshreveEnum){
-							/*Nothing to add*/
-						}
-						else if(hydrology_model==HydrologyshaktiEnum){
-							/*Nothing to add*/
-						}
-						else{
-							_error_("Hydrology model "<<EnumToStringx(hydrology_model)<<" not supported yet");
-						}
-
-						/*gia: */
-						iomodel->FindConstant(&this->lithosphere_shear_modulus,"md.materials.lithosphere_shear_modulus");
-						iomodel->FindConstant(&this->lithosphere_density,"md.materials.lithosphere_density");
-						iomodel->FindConstant(&this->mantle_shear_modulus,"md.materials.mantle_shear_modulus");
-						iomodel->FindConstant(&this->mantle_density,"md.materials.mantle_density");
-
-						/*slr:*/
-						iomodel->FindConstant(&this->earth_density,"md.materials.earth_density");
-						//}}}
-						break;
-					default:
-						_error_("Materials "<<EnumToStringx(IoCodeToEnumMaterials(nature[i]))<<" not supported");
-
-				} //}}}
-			}
-			//Free ressources:
-			xDelete<int>(nature);
-			break;
-
-			break;
-		default:
-			_error_("Material "<< EnumToStringx(materials_type) <<" not supported yet");
-	}
-}
-/*}}}*/
-Matpar::~Matpar(){/*{{{*/
-	return;
-}
-/*}}}*/
-void Matpar::SetMid(int matpar_mid){/*{{{*/
-	this->mid=matpar_mid;
-}
-/*}}}*/
-
-/*Object virtual functions definitions:*/
-Object* Matpar::copy() {/*{{{*/
-
-	/*Output*/
-	Matpar* matpar;
-
-	/*Initialize output*/
-	matpar=new Matpar(*this);
-
-	/*copy fields: */
-	matpar->mid=this->mid;
-	matpar->rho_ice=this->rho_ice;
-	matpar->rho_water=this->rho_water;
-	matpar->rho_freshwater=this->rho_freshwater;
-	matpar->mu_water=this->mu_water;
-	matpar->heatcapacity=this->heatcapacity;
-	matpar->thermalconductivity=this->thermalconductivity;
-	matpar->temperateiceconductivity=this->temperateiceconductivity;
-	matpar->latentheat=this->latentheat;
-	matpar->beta=this->beta;
-	matpar->meltingpoint=this->meltingpoint;
-	matpar->referencetemperature=this->referencetemperature;
-	matpar->mixed_layer_capacity=this->mixed_layer_capacity;
-	matpar->thermal_exchange_velocity=this->thermal_exchange_velocity;
-	matpar->g=this->g;
-	matpar->desfac=this->desfac;
-	matpar->rlaps=this->rlaps;
-	matpar->rlapslgm=this->rlapslgm;
-	matpar->dpermil=this->dpermil;
-	matpar->rheology_law=this->rheology_law;
-
-	matpar->sediment_compressibility=this->sediment_compressibility;
-	matpar->sediment_porosity=this->sediment_porosity;
-	matpar->sediment_thickness=this->sediment_thickness;
-	matpar->water_compressibility=this->water_compressibility;
-
-	matpar->epl_compressibility=this->epl_compressibility;
-	matpar->epl_porosity=this->epl_porosity;
-	matpar->epl_init_thickness=this->epl_init_thickness;
-	matpar->epl_colapse_thickness=this->epl_colapse_thickness;
-	matpar->epl_max_thickness=this->epl_max_thickness;
-	matpar->epl_conductivity=this->epl_conductivity;
-
-	matpar->lithosphere_shear_modulus=this->lithosphere_shear_modulus;
-	matpar->lithosphere_density=this->lithosphere_density;
-	matpar->mantle_shear_modulus=this->mantle_shear_modulus;
-	matpar->mantle_density=this->mantle_density;
-
-	matpar->earth_density=this->earth_density;
-
-	return matpar;
-}
-/*}}}*/
-void Matpar::DeepEcho(void){/*{{{*/
-
-	this->Echo();
-}
-/*}}}*/
-void Matpar::Echo(void){/*{{{*/
-
-	_printf_("Matpar:\n");
-	_printf_("   mid: " << mid << "\n");
-	_printf_("   rho_ice: " << rho_ice << "\n");
-	_printf_("   rho_water: " << rho_water << "\n");
-	_printf_("   rho_freshwater: " << rho_freshwater << "\n");
-	_printf_("   mu_water: " << mu_water << "\n");
-	_printf_("   heatcapacity: " << heatcapacity << "\n");
-	_printf_("   thermalconductivity: " << thermalconductivity << "\n");
-	_printf_("   temperateiceconductivity: " << temperateiceconductivity << "\n");
-	_printf_("   latentheat: " << latentheat << "\n");
-	_printf_("   beta: " << beta << "\n");
-	_printf_("   meltingpoint: " << meltingpoint << "\n");
-	_printf_("   referencetemperature: " << referencetemperature << "\n");
-	_printf_("   mixed_layer_capacity: " << mixed_layer_capacity << "\n");
-	_printf_("   thermal_exchange_velocity: " << thermal_exchange_velocity << "\n");
-	_printf_("   g: " << g << "\n");
-	_printf_("   omega: " << omega << "\n");
-	_printf_("   desfac: " << desfac << "\n");
-	_printf_("   rlaps: " << rlaps << "\n");
-	_printf_("   rlapslgm: " << rlapslgm << "\n");
-	_printf_("   dpermil: " << dpermil << "\n");
-	_printf_("   rheology_law: " << rheology_law << "\n");
-	_printf_("   albedo_ice: " << albedo_ice << "\n");
-	_printf_("   albedo_snow: " << albedo_snow << "\n");
-	_printf_("   sediment_compressibility: " << sediment_compressibility << "\n");
-	_printf_("   sediment_porosity: " << sediment_porosity << "\n");
-	_printf_("   sediment_thickness: " << sediment_thickness << "\n");
-	_printf_("   water_compressibility: " << water_compressibility << "\n");
-	_printf_("   epl_compressibility: " << epl_compressibility << "\n");
-	_printf_("   epl_porosity: " << epl_porosity << "\n");
-	_printf_("   epl_init_thickness: " << epl_init_thickness << "\n");
-	_printf_("   epl_colapse_thickness: " << epl_colapse_thickness << "\n");
-	_printf_("   epl_max_thickness: " << epl_max_thickness << "\n");
-	_printf_("   epl_conductivity: " << epl_conductivity << "\n");
-	_printf_("   lithosphere_shear_modulus: " << lithosphere_shear_modulus << "\n");
-	_printf_("   lithosphere_density: " << lithosphere_density << "\n");
-	_printf_("   mantle_shear_modulus: " << mantle_shear_modulus << "\n");
-	_printf_("   mantle_density: " << mantle_density << "\n");
-	_printf_("   earth_density: " << earth_density << "\n");
-	return;
-}
-/*}}}*/
-int  Matpar::Id(void){ return mid; }/*{{{*/
-/*}}}*/
-void Matpar::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
-
-	MARSHALLING_ENUM(MatparEnum);
-
-	MARSHALLING(mid);
-	MARSHALLING(rho_ice);
-	MARSHALLING(rho_water);
-	MARSHALLING(rho_freshwater);
-	MARSHALLING(mu_water);
-	MARSHALLING(heatcapacity);
-	MARSHALLING(thermalconductivity);
-	MARSHALLING(temperateiceconductivity);
-	MARSHALLING(latentheat);
-	MARSHALLING(beta);
-	MARSHALLING(meltingpoint);
-	MARSHALLING(referencetemperature);
-	MARSHALLING(mixed_layer_capacity);
-	MARSHALLING(thermal_exchange_velocity);
-	MARSHALLING(g);
-	MARSHALLING(omega);
-	MARSHALLING(desfac);
-	MARSHALLING(rlaps);
-	MARSHALLING(rlapslgm);
-	MARSHALLING(dpermil);
-	MARSHALLING(rheology_law);
-
-	//hydrology Dual Porous Continuum:
-	MARSHALLING(sediment_compressibility);
-	MARSHALLING(sediment_porosity);
-	MARSHALLING(sediment_thickness);
-	MARSHALLING(water_compressibility);
-
-	MARSHALLING(epl_compressibility);
-	MARSHALLING(epl_porosity);
-	MARSHALLING(epl_init_thickness);
-	MARSHALLING(epl_colapse_thickness);
-	MARSHALLING(epl_max_thickness);
-	MARSHALLING(epl_conductivity);
-
-	//gia:
-	MARSHALLING(lithosphere_shear_modulus);
-	MARSHALLING(lithosphere_density);
-	MARSHALLING(mantle_shear_modulus);
-	MARSHALLING(mantle_density);
-
-	//slr:
-	MARSHALLING(earth_density);
-}
-/*}}}*/
-int  Matpar::ObjectEnum(void){/*{{{*/
-
-	return MatparEnum;
-
-}
-/*}}}*/
-
-/*Update virtual functions definitions:*/
-void   Matpar::InputUpdateFromConstant(IssmDouble constant, int name){/*{{{*/
-
-	switch(name){
-		case MaterialsRhoIceEnum:
-			this->rho_ice=constant;
-			break;
-		case MaterialsRhoSeawaterEnum:
-			this->rho_water=constant;
-			break;
-		case MaterialsRhoFreshwaterEnum:
-			this->rho_freshwater=constant;
-			break;
-		case MaterialsMuWaterEnum:
-			this->mu_water=constant;
-			break;
-		case MaterialsHeatcapacityEnum:
-			this->heatcapacity=constant;
-			break;
-	  	case MaterialsThermalconductivityEnum:
-			this->thermalconductivity=constant;
-			break;
-	  	case MaterialsTemperateiceconductivityEnum:
-			this->temperateiceconductivity=constant;
-			break;
-		case  MaterialsLatentheatEnum:
-			this->latentheat=constant;
-			break;
-		case  MaterialsBetaEnum:
-			this->beta=constant;
-			break;
-		case  MaterialsMeltingpointEnum:
-			this->meltingpoint=constant;
-			break;
-		case  ConstantsReferencetemperatureEnum:
-			this->referencetemperature=constant;
-			break;
-		case  MaterialsMixedLayerCapacityEnum:
-			this->mixed_layer_capacity=constant;
-			break;
-		case  MaterialsThermalExchangeVelocityEnum:
-			this->thermalconductivity=constant;
-			break;
-		case  ConstantsGEnum:
-			this->g=constant;
-			break;
-		case  SmbDesfacEnum:
-			this->desfac=constant;
-			break;
-		case SmbRlapsEnum:
-			this->rlaps=constant;
-			break;
-		case SmbRlapslgmEnum:
-			this->rlapslgm=constant;
-			break;
-		case  SmbDpermilEnum:
-			this->dpermil=constant;
-			break;
-		default:
-			break;
-	}
-
-}
-/*}}}*/
-void   Matpar::InputUpdateFromConstant(int constant, int name){/*{{{*/
-	/*Nothing updated yet*/
-}
-/*}}}*/
-void   Matpar::InputUpdateFromConstant(bool constant, int name){/*{{{*/
-	/*Nothing updated yet*/
-}
-/*}}}*/
-void  Matpar::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols,int name, int type){/*{{{*/
-	/*Nothing updated yet*/
-}
-/*}}}*/
-void   Matpar::InputUpdateFromVector(IssmDouble* vector, int name, int type){/*{{{*/
-	/*Nothing updated yet*/
-}
-/*}}}*/
-void   Matpar::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*{{{*/
-	/*Nothing updated yet*/
-}
-/*}}}*/
-
-/*Matpar management: */
-void       Matpar::Configure(Elements* elementsin){/*{{{*/
-
-	/*nothing done yet!*/
-
-}
-/*}}}*/
-void       Matpar::EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure){/*{{{*/
-
-	/*Ouput*/
-	IssmDouble temperature,waterfraction;
-
-	if(enthalpy<PureIceEnthalpy(pressure)){
-		temperature=referencetemperature+enthalpy/heatcapacity;
-		waterfraction=0.;
-	}
-	else{
-		temperature=TMeltingPoint(pressure);
-		waterfraction=(enthalpy-PureIceEnthalpy(pressure))/latentheat;
-	}
-
-	/*Assign output pointers:*/
-	*pwaterfraction=waterfraction;
-	*ptemperature=temperature;
-}
-/*}}}*/
-IssmDouble Matpar::GetEnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure){/*{{{*/
-	if (enthalpy<PureIceEnthalpy(pressure))
-		return thermalconductivity/heatcapacity;
-	else
-		return temperateiceconductivity/heatcapacity;
-}
-/*}}}*/
-IssmDouble Matpar::GetEnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure){/*{{{*/
-
-	int         iv;
-	IssmDouble  lambda;                 // fraction of cold ice
-	IssmDouble  kappa,kappa_c,kappa_t;  //enthalpy conductivities
-	IssmDouble  Hc,Ht;
-	IssmDouble* PIE   = xNew<IssmDouble>(numvertices);
-	IssmDouble* dHpmp = xNew<IssmDouble>(numvertices);
-
-	for(iv=0; iv<numvertices; iv++){
-		PIE[iv]=PureIceEnthalpy(pressure[iv]);
-		dHpmp[iv]=enthalpy[iv]-PIE[iv];
-	}
-
-	bool allequalsign=true;
-	if(dHpmp[0]<0)
-		for(iv=1; iv<numvertices;iv++) allequalsign=(allequalsign && (dHpmp[iv]<0));
-	else
-		for(iv=1; iv<numvertices;iv++) allequalsign=(allequalsign && (dHpmp[iv]>=0));
-
-	if(allequalsign){
-		kappa=GetEnthalpyDiffusionParameter(enthalpy[0], pressure[0]);
-	}
-	else {
-		/* return harmonic mean of thermal conductivities, weighted by fraction of cold/temperate ice,
-		 cf Patankar 1980, pp44 */
-		kappa_c=GetEnthalpyDiffusionParameter(PureIceEnthalpy(0.)-1.,0.);
-		kappa_t=GetEnthalpyDiffusionParameter(PureIceEnthalpy(0.)+1.,0.);
-		Hc=0.; Ht=0.;
-		for(iv=0; iv<numvertices;iv++){
-			if(enthalpy[iv]<PIE[iv])
-			 Hc+=(PIE[iv]-enthalpy[iv]);
-			else
-			 Ht+=(enthalpy[iv]-PIE[iv]);
-		}
-		_assert_((Hc+Ht)>0.);
-		lambda = Hc/(Hc+Ht);
-		kappa  = 1./(lambda/kappa_c + (1.-lambda)/kappa_t);
-	}
-
-	/*Clean up and return*/
-	xDelete<IssmDouble>(PIE);
-	xDelete<IssmDouble>(dHpmp);
-	return kappa;
-}
-/*}}}*/
-IssmDouble Matpar::GetMaterialParameter(int enum_in){/*{{{*/
-
-	switch(enum_in){
-		case MaterialsRhoIceEnum:                    return this->rho_ice;
-		case MaterialsRhoSeawaterEnum:               return this->rho_water;
-		case MaterialsRhoFreshwaterEnum:             return this->rho_freshwater;
-		case MaterialsMuWaterEnum:                   return this->mu_water;
-		case MaterialsHeatcapacityEnum:              return this->heatcapacity;
-		case MaterialsThermalconductivityEnum:       return this->thermalconductivity;
-		case MaterialsTemperateiceconductivityEnum:  return this->temperateiceconductivity;
-		case MaterialsLatentheatEnum:                return this->latentheat;
-		case MaterialsBetaEnum:                      return this->beta;
-		case MaterialsMeltingpointEnum:              return this->meltingpoint;
-		case ConstantsReferencetemperatureEnum:      return this->referencetemperature;
-		case MaterialsMixedLayerCapacityEnum:        return this->mixed_layer_capacity;
-		case MaterialsThermalExchangeVelocityEnum:   return this->thermal_exchange_velocity;
-		case HydrologydcSedimentPorosityEnum:        return this->sediment_porosity;
-		case HydrologydcSedimentThicknessEnum:       return this->sediment_thickness;
-		case HydrologydcSedimentCompressibilityEnum: return this->sediment_compressibility;
-		case HydrologydcEplPorosityEnum:             return this->epl_porosity;
-		case HydrologydcEplCompressibilityEnum:      return this->epl_compressibility;
-		case HydrologydcEplConductivityEnum:         return this->epl_conductivity;
-		case HydrologydcEplInitialThicknessEnum:     return this->epl_init_thickness;
-		case HydrologydcEplColapseThicknessEnum:     return this->epl_colapse_thickness;
-		case HydrologydcEplMaxThicknessEnum:         return this->epl_max_thickness;
-		case HydrologydcWaterCompressibilityEnum:    return this->water_compressibility;
-		case ConstantsGEnum:                         return this->g;
-		case SmbDesfacEnum:                          return this->desfac;
-		case SmbRlapsEnum:                           return this->rlaps;
-		case SmbRlapslgmEnum:                        return this->rlapslgm;
-		case SmbDpermilEnum:                         return this->dpermil;
-		case MaterialsLithosphereShearModulusEnum:   return this->lithosphere_shear_modulus;
-		case MaterialsLithosphereDensityEnum:        return this->lithosphere_density;
-		case MaterialsMantleDensityEnum:             return this->mantle_density;
-		case MaterialsMantleShearModulusEnum:        return this->mantle_shear_modulus;
-		case MaterialsEarthDensityEnum:              return this->earth_density;
-		default: _error_("Enum "<<EnumToStringx(enum_in)<<" not supported yet");
-	}
-
-}
-/*}}}*/
-int        Matpar::GetIntegerMaterialParameter(int enum_in){/*{{{*/
-
-	switch(enum_in){
-		case MaterialsRheologyLawEnum:               return this->rheology_law;
-		default: _error_("Enum "<<EnumToStringx(enum_in)<<" not supported yet");
-	}
-
-}
-/*}}}*/
-IssmDouble Matpar::PureIceEnthalpy(IssmDouble pressure){/*{{{*/
-	return heatcapacity*(TMeltingPoint(pressure)-referencetemperature);
-}
-/*}}}*/
-void       Matpar::ResetHooks(){/*{{{*/
-
-	//Nothing to be done
-	return;
-}
-/*}}}*/
-void       Matpar::ThermalToEnthalpy(IssmDouble * penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure){/*{{{*/
-
-	/*Ouput*/
-	IssmDouble enthalpy;
-
-	if(temperature<TMeltingPoint(pressure)){
-		enthalpy=heatcapacity*(temperature-referencetemperature);
-	}
-	else{
-		enthalpy=PureIceEnthalpy(pressure)+latentheat*waterfraction;
-	}
-
-	/*Assign output pointers:*/
-	*penthalpy=enthalpy;
-}
-/*}}}*/
-IssmDouble Matpar::TMeltingPoint(IssmDouble pressure){/*{{{*/
-	return meltingpoint-beta*pressure;
-}
-/*}}}*/
Index: sm/trunk/src/c/classes/Materials/Matpar.h
===================================================================
--- /issm/trunk/src/c/classes/Materials/Matpar.h	(revision 24312)
+++ 	(revision )
@@ -1,137 +1,0 @@
-/*!\file Matpar.h
- * \brief: header file for matpar object
- */
-
-#ifndef _MATPAR_H_
-#define _MATPAR_H_
-
-/*Headers:*/
-/*{{{*/
-#include "./Material.h"
-class IoModel;
-/*}}}*/
-
-class Matpar: public Material{
-
-	private: 
-		int	      mid;
-		IssmDouble  rho_ice; 
-		IssmDouble  rho_water;
-		IssmDouble  rho_freshwater;
-		IssmDouble  mu_water;
-		IssmDouble  heatcapacity;
-		IssmDouble  thermalconductivity;
-		IssmDouble  temperateiceconductivity;
-		IssmDouble  latentheat;
-		IssmDouble  beta;
-		IssmDouble  meltingpoint;
-		IssmDouble  referencetemperature;
-		IssmDouble  mixed_layer_capacity;
-		IssmDouble  thermal_exchange_velocity;
-		IssmDouble  g;
-		IssmDouble  omega;
-		IssmDouble  desfac;
-		IssmDouble  rlaps;
-		IssmDouble  rlapslgm;
-		IssmDouble  dpermil;
-		int         rheology_law;
-
-		/*albedo: */
-		IssmDouble albedo_ice;
-		IssmDouble albedo_snow;
-
-		/*hydrology Dual Porous Continuum: */	 
-		IssmDouble  sediment_compressibility;
-		IssmDouble  sediment_porosity;	 
-		IssmDouble  sediment_thickness;
-		IssmDouble  water_compressibility;
-
-		IssmDouble  epl_compressibility;
-		IssmDouble  epl_porosity;
-		IssmDouble  epl_init_thickness;
-		IssmDouble  epl_colapse_thickness;
-		IssmDouble  epl_max_thickness;
-		IssmDouble  epl_conductivity;	 
-
-		/*gia: */
-		IssmDouble lithosphere_shear_modulus;
-		IssmDouble lithosphere_density;
-		IssmDouble mantle_shear_modulus;
-		IssmDouble mantle_density;
-
-		/*slr:*/
-		IssmDouble earth_density;
-
-	public:
-		Matpar();
-		Matpar(IoModel* iomodel);
-		~Matpar();
-		void SetMid(int matpar_mid);
-
-		/*Object virtual functions definitions:{{{ */
-		Object *copy();
-		void    DeepEcho();
-		void    Echo();
-		int     Id();
-		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
-		int     ObjectEnum();
-		/*}}}*/
-		/*Update virtual functions resolution: {{{*/
-		void   InputUpdateFromConstant(IssmDouble constant, int name);
-		void   InputUpdateFromConstant(int constant, int name);
-		void   InputUpdateFromConstant(bool constant, int name);
-		void   InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented");};
-		void   InputUpdateFromMatrixDakota(IssmDouble* matrix,int nrows,int ncols, int name, int type);
-		void   InputUpdateFromVector(IssmDouble* vector, int name, int type);
-		void   InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
-		/*}}}*/
-		/*Material virtual functions resolution: {{{*/
-		Material*  copy2(Element* element){_error_("not implemented");};
-		void       Configure(Elements* elements);
-		void       GetViscosity(IssmDouble* pviscosity,IssmDouble eps_eff,Gauss* gauss){_error_("not supported");};
-		void       GetViscosityBar(IssmDouble* pviscosity,IssmDouble eps_eff,Gauss* gauss){_error_("not supported");};
-		void       GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon,Gauss* gauss){_error_("not supported");};
-		void       GetViscosityDComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon,Gauss* gauss){_error_("not supported");};
-		void       GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon,Gauss* gauss){_error_("not supported");};
-		void       GetViscosity_B(IssmDouble* pviscosity,IssmDouble eps_eff,Gauss* gauss){_error_("not supported");};
-		void       GetViscosity_D(IssmDouble* pviscosity,IssmDouble eps_eff,Gauss* gauss){_error_("not supported");};
-		void       GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* pepsilon,Gauss* gauss){_error_("not supported");};
-		IssmDouble GetA(Gauss* gauss){_error_("not supported");};
-		IssmDouble GetAbar(Gauss* gauss){_error_("not supported");};
-		IssmDouble GetB(Gauss* gauss){_error_("not supported");};
-		IssmDouble GetBbar(Gauss* gauss){_error_("not supported");};
-		IssmDouble GetD(Gauss* gauss){_error_("not supported");};
-		IssmDouble GetDbar(Gauss* gauss){_error_("not supported");};
-		IssmDouble GetN(){_error_("not supported");};
-		bool       IsDamage(){_error_("not supported");};
-		bool       IsEnhanced(){_error_("not supported");};
-		void       ResetHooks();
-
-		void       ViscosityFS(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){_error_("not supported");};
-		void       ViscosityFSDerivativeEpsSquare(IssmDouble* pmu_prime,IssmDouble* epsilon,Gauss* gauss){_error_("not supported");};
-		void       ViscosityHO(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not supported");};
-		void       ViscosityHODerivativeEpsSquare(IssmDouble* pmu_prime,IssmDouble* epsilon,Gauss* gauss){_error_("not supported");};
-		void       ViscosityL1L2(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* surf){_error_("not supported");};
-		void       ViscositySSA(IssmDouble* pviscosity,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not supported");};
-		void       ViscositySSADerivativeEpsSquare(IssmDouble* pmu_prime,IssmDouble* epsilon,Gauss* gauss){_error_("not supported");};
-		void       ViscosityBFS(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input,IssmDouble eps_eff){_error_("not supported");};
-		void       ViscosityBHO(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,IssmDouble eps_eff){_error_("not supported");};
-		void       ViscosityBSSA(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,IssmDouble eps_eff){_error_("not supported");};
-		void       ViscosityBFS(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){_error_("not supported");};
-		void       ViscosityBHO(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not supported");};
-		void       ViscosityBSSA(IssmDouble* pmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){_error_("not supported");};
-		/*}}}*/
-		/*Numerics: {{{*/
-		void       EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure);
-		IssmDouble GetEnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure);
-		IssmDouble GetEnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure);
-		IssmDouble GetMaterialParameter(int in_enum); 
-		int        GetIntegerMaterialParameter(int in_enum); 
-		IssmDouble PureIceEnthalpy(IssmDouble pressure);
-		void       ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure);
-		IssmDouble TMeltingPoint(IssmDouble pressure);
-		/*}}}*/
-
-};
-
-#endif  /* _MATPAR_H_ */
Index: /issm/trunk/src/c/classes/Node.cpp
===================================================================
--- /issm/trunk/src/c/classes/Node.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Node.cpp	(revision 24313)
@@ -18,36 +18,86 @@
 /*Node constructors and destructors:*/
 Node::Node(){/*{{{*/
-	this->approximation=0;
-}
-/*}}}*/
-Node::Node(int node_id,int node_sid,int node_lid,int io_index, IoModel* iomodel,int analysis_enum,int in_approximation){/*{{{*/
-
-	/*Intermediary*/
-	int k,l;
-	int *doftypes = NULL;
+	this->approximation  = 0;
+	this->gsize          = -1;
+	this->fsize          = -1;
+	this->ssize          = -1;
+	this->clone          = false;
+	this->active         = true;
+	this->freeze         = false;
+	this->f_set          = NULL;
+	this->s_set          = NULL;
+	this->svalues        = NULL;
+	this->doftype        = NULL;
+	this->gdoflist       = NULL;
+	this->fdoflist       = NULL;
+	this->sdoflist       = NULL;
+	this->gdoflist_local = NULL;
+	this->fdoflist_local = NULL;
+	this->sdoflist_local = NULL;
+}
+/*}}}*/
+Node::Node(int node_id,int node_sid,int io_index,bool node_clone,IoModel* iomodel,int node_analysis,int in_approximation,bool isamr){/*{{{*/
 
 	/*id: */
 	this->id            = node_id;
 	this->sid           = node_sid;
-	this->lid           = node_lid;
-	this->analysis_enum = analysis_enum;
+	this->lid           = -1; /*Assigned by Finalize*/
+	this->pid           = -1; /*Assigned by Finalize*/
+	this->analysis_enum = node_analysis;
+	this->clone         = node_clone;
+	this->active        = true;
+	this->freeze        = false;
 
 	/*Initialize coord_system: Identity matrix by default*/
-	for(k=0;k<3;k++) for(l=0;l<3;l++) this->coord_system[k][l]=0.0;
-	for(k=0;k<3;k++) this->coord_system[k][k]=1.0;
+	for(int k=0;k<3;k++) for(int l=0;l<3;l++) this->coord_system[k][l]=0.0;
+	for(int k=0;k<3;k++) this->coord_system[k][k]=1.0;
+
+	this->approximation=0;
+	if(analysis_enum==StressbalanceAnalysisEnum) this->approximation=in_approximation;
 
 	/*indexing:*/
 	this->indexingupdate = true;
-
-	Analysis* analysis = EnumToAnalysis(analysis_enum);
-	int numdofs        = analysis->DofsPerNode(&doftypes,iomodel->domaintype,in_approximation);
-	indexing.Init(numdofs,doftypes);
-	xDelete<int>(doftypes);
+	this->doftype        = NULL;
+	Analysis *analysis = EnumToAnalysis(analysis_enum);
+	this->gsize = analysis->DofsPerNode(&this->doftype,iomodel->domaintype,in_approximation);
 	delete analysis;
 
-	if(analysis_enum==StressbalanceAnalysisEnum)
-	 this->approximation=in_approximation;
-	else
-	 this->approximation=0;
+	if(this->gsize>0){
+		this->f_set          = xNew<bool>(this->gsize);
+		this->s_set          = xNew<bool>(this->gsize);
+		this->svalues        = xNew<IssmDouble>(this->gsize);
+		this->gdoflist       = xNew<int>(this->gsize);
+		this->gdoflist_local = xNew<int>(this->gsize);
+		this->fsize          = -1;
+		this->ssize          = -1;
+		this->fdoflist       = NULL;
+		this->sdoflist       = NULL;
+		this->fdoflist_local = NULL;
+		this->sdoflist_local = NULL;
+	}
+	else{
+		this->f_set          = NULL;
+		this->s_set          = NULL;
+		this->svalues        = NULL;
+		this->gdoflist       = NULL;
+		this->gdoflist_local = NULL;
+		this->fsize          = -1;
+		this->ssize          = -1;
+		this->fdoflist       = NULL;
+		this->sdoflist       = NULL;
+		this->fdoflist_local = NULL;
+		this->sdoflist_local = NULL;
+	}
+
+	/*Assign values assuming no Dirichlet at this point*/
+	for(int i=0;i<this->gsize;i++){
+		this->f_set[i]    = true;
+		this->s_set[i]    = false;
+		this->svalues[i]  = 0.;
+		this->gdoflist[i] = -1;
+	}
+
+	/*Stop here if AMR*/
+	if(isamr) return;
 
 	/*Stressbalance Horiz*/
@@ -76,5 +126,5 @@
 			if(in_approximation==SSAFSApproximationEnum && reCast<int>(iomodel->Data("md.flowequation.borderSSA")[io_index])){
 				if(!reCast<int>(iomodel->Data("md.mesh.vertexonbase")[io_index])){
-					for(k=0;k<=1;k++) this->FreezeDof(k);
+					for(int k=0;k<=1;k++) this->FreezeDof(k);
 				}
 			}
@@ -95,6 +145,7 @@
 				analysis_enum==HydrologyDCInefficientAnalysisEnum ||
 				analysis_enum==HydrologyDCEfficientAnalysisEnum ||
+				analysis_enum==GLheightadvectionAnalysisEnum ||
 				analysis_enum==LevelsetAnalysisEnum
-				){
+	  ){
 		if(iomodel->domaintype!=Domain2DhorizontalEnum & iomodel->domaintype!=Domain3DsurfaceEnum){
 			/*On a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */
@@ -107,5 +158,5 @@
 	if(
 				analysis_enum==FreeSurfaceTopAnalysisEnum
-				){
+	  ){
 		if(iomodel->domaintype!=Domain2DhorizontalEnum){
 			/*On a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */
@@ -120,10 +171,19 @@
 /*}}}*/
 Node::~Node(){/*{{{*/
+
+	if(this->f_set)          xDelete<bool>(f_set);
+	if(this->s_set)          xDelete<bool>(s_set);
+	if(this->svalues)        xDelete<IssmDouble>(svalues);
+	if(this->doftype)        xDelete<int>(doftype);
+	if(this->gdoflist)       xDelete<int>(gdoflist);
+	if(this->fdoflist)       xDelete<int>(fdoflist);
+	if(this->sdoflist)       xDelete<int>(sdoflist);
+	if(this->gdoflist_local) xDelete<int>(gdoflist_local);
+	if(this->fdoflist_local) xDelete<int>(fdoflist_local);
+	if(this->sdoflist_local) xDelete<int>(sdoflist_local);
 	return;
 }
 /*}}}*/
 Object* Node::copy(void){/*{{{*/
-
-	int k,l;
 
 	/*output: */
@@ -137,13 +197,52 @@
 	output->sid = this->sid;
 	output->lid = this->lid;
+	output->pid = this->pid;
 	output->analysis_enum = this->analysis_enum;
 	output->approximation = this->approximation;
 
 	/*Initialize coord_system: */
-	for(k=0;k<3;k++) for(l=0;l<3;l++) output->coord_system[k][l]=this->coord_system[k][l];
+	for(int k=0;k<3;k++) for(int l=0;l<3;l++) output->coord_system[k][l]=this->coord_system[k][l];
 
 	/*indexing:*/
 	output->indexingupdate = this->indexingupdate;
-	output->indexing.copy(this->indexing);
+	output->gsize  = this->gsize;
+	output->fsize  = this->fsize;
+	output->ssize  = this->ssize;
+	output->clone  = this->clone;
+	output->active = this->active;
+	output->freeze = this->freeze;
+	if(output->gsize>0){
+		output->f_set=xNew<bool>(output->gsize);
+		output->s_set=xNew<bool>(output->gsize);
+		output->svalues=xNew<IssmDouble>(output->gsize);
+		if(this->doftype) output->doftype=xNew<int>(output->gsize);
+		output->gdoflist=xNew<int>(output->gsize);
+		output->gdoflist_local=xNew<int>(output->gsize);
+	}
+	if(output->fsize>0){
+		output->fdoflist=xNew<int>(output->fsize);
+		output->fdoflist_local=xNew<int>(output->fsize);
+	}
+	if(output->ssize>0){
+		output->sdoflist=xNew<int>(output->ssize);
+		output->sdoflist_local=xNew<int>(output->ssize);
+	}
+
+	if(output->gsize>0){
+		memcpy(output->f_set,this->f_set,output->gsize*sizeof(bool));
+		memcpy(output->s_set,this->s_set,output->gsize*sizeof(bool));
+		xMemCpy<IssmDouble>(output->svalues,this->svalues,output->gsize);
+		if(output->doftype)memcpy(output->doftype,this->doftype,output->gsize*sizeof(int));
+		memcpy(output->gdoflist,this->gdoflist,output->gsize*sizeof(int));
+		memcpy(output->gdoflist_local,this->gdoflist_local,output->gsize*sizeof(int));
+	}
+	if(output->fsize>0){
+		memcpy(output->fdoflist,this->fdoflist,output->fsize*sizeof(int));
+		memcpy(output->fdoflist_local,this->fdoflist_local,output->fsize*sizeof(int));
+	}
+	if(output->ssize>0){
+		memcpy(output->sdoflist,this->sdoflist,output->ssize*sizeof(int));
+		memcpy(output->sdoflist_local,this->sdoflist_local,output->ssize*sizeof(int));
+	}
 
 	return (Object*)output; 
@@ -156,15 +255,31 @@
 	MARSHALLING(sid);
 	MARSHALLING(lid);
+	MARSHALLING(pid);
 	MARSHALLING(indexingupdate);
-	indexing.Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 	MARSHALLING(analysis_enum);
 	MARSHALLING_ARRAY(coord_system,IssmDouble,9);
 
-}
-/*}}}*/
+	MARSHALLING(gsize);
+	MARSHALLING(fsize);
+	MARSHALLING(ssize);
+	MARSHALLING(clone);
+	MARSHALLING(active);
+	MARSHALLING(freeze);
+	MARSHALLING_DYNAMIC(f_set,bool,gsize);
+	MARSHALLING_DYNAMIC(s_set,bool,gsize);
+	MARSHALLING_DYNAMIC(svalues,IssmDouble,gsize);
+	MARSHALLING_DYNAMIC(doftype,int,gsize);
+	MARSHALLING_DYNAMIC(gdoflist,int,gsize);
+	MARSHALLING_DYNAMIC(fdoflist,int,fsize);
+	MARSHALLING_DYNAMIC(sdoflist,int,ssize);
+	MARSHALLING_DYNAMIC(gdoflist_local,int,gsize);
+	MARSHALLING_DYNAMIC(fdoflist_local,int,fsize);
+	MARSHALLING_DYNAMIC(sdoflist_local,int,ssize);
+} /*}}}*/
 
 /*Object virtual functions definitions:*/
 void Node::DeepEcho(void){/*{{{*/
 
+	int i;
 	_printf_("Node:\n");
 	_printf_("   id: " << id << "\n");
@@ -173,5 +288,50 @@
 	_printf_("   approximation: " << EnumToStringx(approximation) << "\n");
 	_printf_("   indexingupdate: " << indexingupdate << "\n");
-	indexing.DeepEcho();
+	_printf_("   gsize:  " << gsize << "\n");
+	_printf_("   fsize:  " << fsize << "\n");
+	_printf_("   ssize:  " << ssize << "\n");
+	_printf_("   clone:  " << clone << "\n");
+	_printf_("   active: " << active << "\n");
+	_printf_("   freeze: " << freeze << "\n");
+	_printf_("   f_set = [ ");
+	for(i=0;i<gsize;i++) _printf_((f_set[i]?1:0)<< " ");
+	_printf_("]\n");
+	_printf_("   s_set = [ ");
+	for(i=0;i<gsize;i++) _printf_((s_set[i]?1:0)<< " ");
+	_printf_("]\n");
+	_printf_("   svalues (" << this->ssize << "): |");
+	for(i=0;i<this->gsize;i++){
+		if(this->s_set[i])_printf_(" " << svalues[i] << " |");
+	}
+	_printf_("\n");
+	if(doftype){
+		_printf_("   doftype: |");
+		for(i=0;i<gsize;i++){
+			_printf_(" " << doftype[i] << " |");
+		}
+		_printf_("\n");
+	}
+	else _printf_("   doftype: NULL\n");
+
+	_printf_("   g_doflist (" << this->gsize << "): |");
+	for(i=0;i<this->gsize;i++) _printf_(" " << gdoflist[i] << " |");
+	_printf_("\n");
+	_printf_("   g_doflist_local (" << this->gsize << "): |");
+	for(i=0;i<this->gsize;i++) _printf_(" " << gdoflist_local[i] << " |");
+	_printf_("\n");
+
+	_printf_("   f_doflist (" << this->fsize << "): |");
+	for(i=0;i<this->fsize;i++) _printf_(" " << fdoflist[i] << " |");
+	_printf_("\n");
+	_printf_("   f_doflist_local (" << this->fsize << "): |");
+	for(i=0;i<this->fsize;i++) _printf_(" " << fdoflist_local[i] << " |");
+	_printf_("\n");
+
+	_printf_("   s_doflist (" << this->ssize << "): |");
+	for(i=0;i<this->ssize;i++) _printf_(" " << sdoflist[i] << " |");
+	_printf_("\n");
+	_printf_("   s_doflist_local (" << this->ssize << "): |");
+	for(i=0;i<this->ssize;i++) _printf_(" " << sdoflist_local[i] << " |");
+	_printf_("\n");
 
 }
@@ -182,9 +342,15 @@
 	_printf_("   id : " << id << "\n");
 	_printf_("   sid: " << sid << "\n");
+	_printf_("   lid: " << lid << "\n");
+	_printf_("   pid: " << pid << "\n");
 	_printf_("   analysis_enum: " << EnumToStringx(analysis_enum) << "\n");
 	_printf_("   approximation: " << EnumToStringx(approximation) << "\n");
 	_printf_("   indexingupdate: " << indexingupdate << "\n");
-	indexing.Echo();
-
+	_printf_("   gsize:  " << gsize << "\n");
+	_printf_("   fsize:  " << fsize << "\n");
+	_printf_("   ssize:  " << ssize << "\n");
+	_printf_("   clone:  " << clone << "\n");
+	_printf_("   active: " << active << "\n");
+	_printf_("   freeze: " << freeze << "\n");
 }
 /*}}}*/
@@ -210,14 +376,14 @@
 	_assert_(!this->indexingupdate);
 	if(setenum==GsetEnum){
-		_assert_(dofindex>=0 && dofindex<indexing.gsize);
-		return indexing.gdoflist[dofindex];
+		_assert_(dofindex>=0 && dofindex<gsize);
+		return gdoflist[dofindex];
 	}
 	else if(setenum==FsetEnum){
-		_assert_(dofindex>=0 && dofindex<indexing.fsize);
-		return indexing.fdoflist[dofindex];
+		_assert_(dofindex>=0 && dofindex<fsize);
+		return fdoflist[dofindex];
 	}
 	else if(setenum==SsetEnum){
-		_assert_(dofindex>=0 && dofindex<indexing.ssize);
-		return indexing.sdoflist[dofindex];
+		_assert_(dofindex>=0 && dofindex<ssize);
+		return sdoflist[dofindex];
 	}
 	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
@@ -232,16 +398,16 @@
 
 	if(approximation_enum==NoneApproximationEnum){
-		if(setenum==GsetEnum)for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=indexing.gdoflist[i];
-		if(setenum==FsetEnum)for(i=0;i<this->indexing.fsize;i++) outdoflist[i]=indexing.fdoflist[i];
-		if(setenum==SsetEnum)for(i=0;i<this->indexing.ssize;i++) outdoflist[i]=indexing.sdoflist[i];
+		if(setenum==GsetEnum)for(i=0;i<this->gsize;i++) outdoflist[i]=gdoflist[i];
+		if(setenum==FsetEnum)for(i=0;i<this->fsize;i++) outdoflist[i]=fdoflist[i];
+		if(setenum==SsetEnum)for(i=0;i<this->ssize;i++) outdoflist[i]=sdoflist[i];
 	}
 	else{
 
 		if(setenum==GsetEnum){
-			if(indexing.doftype){
+			if(doftype){
 				count=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(indexing.doftype[i]==approximation_enum){
-						outdoflist[count]=indexing.gdoflist[i];
+				for(i=0;i<this->gsize;i++){
+					if(doftype[i]==approximation_enum){
+						outdoflist[count]=gdoflist[i];
 						count++;
 					}
@@ -249,14 +415,14 @@
 				_assert_(count); //at least one dof should be the approximation requested
 			}
-			else for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=indexing.gdoflist[i];
+			else for(i=0;i<this->gsize;i++) outdoflist[i]=gdoflist[i];
 		}
 		else if(setenum==FsetEnum){
-			if(indexing.doftype){
+			if(doftype){
 				count=0;
 				count2=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(indexing.f_set[i]){
-						if(indexing.doftype[i]==approximation_enum){
-							outdoflist[count]=indexing.fdoflist[count2];
+				for(i=0;i<this->gsize;i++){
+					if(f_set[i]){
+						if(doftype[i]==approximation_enum){
+							outdoflist[count]=fdoflist[count2];
 							count++;
 						}
@@ -265,14 +431,14 @@
 				}
 			}
-			else for(i=0;i<this->indexing.fsize;i++) outdoflist[i]=indexing.fdoflist[i];
+			else for(i=0;i<this->fsize;i++) outdoflist[i]=fdoflist[i];
 		}
 		else if(setenum==SsetEnum){
-			if(indexing.doftype){
+			if(doftype){
 				count=0;
 				count2=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(indexing.s_set[i]){
-						if(indexing.doftype[i]==approximation_enum){
-							outdoflist[count]=indexing.sdoflist[count2];
+				for(i=0;i<this->gsize;i++){
+					if(s_set[i]){
+						if(doftype[i]==approximation_enum){
+							outdoflist[count]=sdoflist[count2];
 							count++;
 						}
@@ -281,5 +447,68 @@
 				}
 			}
-			else for(i=0;i<this->indexing.ssize;i++) outdoflist[i]=indexing.sdoflist[i];
+			else for(i=0;i<this->ssize;i++) outdoflist[i]=sdoflist[i];
+		}
+		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+	}
+}
+/*}}}*/
+void Node::GetDofListLocal(int* outdoflist,int approximation_enum,int setenum){/*{{{*/
+	int i;
+	int count=0;
+	int count2=0;
+
+	_assert_(!this->indexingupdate);
+
+	if(approximation_enum==NoneApproximationEnum){
+		if(setenum==GsetEnum)for(i=0;i<this->gsize;i++) outdoflist[i]=gdoflist_local[i];
+		if(setenum==FsetEnum)for(i=0;i<this->fsize;i++) outdoflist[i]=fdoflist_local[i];
+		if(setenum==SsetEnum)for(i=0;i<this->ssize;i++) outdoflist[i]=sdoflist_local[i];
+	}
+	else{
+
+		if(setenum==GsetEnum){
+			if(doftype){
+				count=0;
+				for(i=0;i<this->gsize;i++){
+					if(doftype[i]==approximation_enum){
+						outdoflist[count]=gdoflist_local[i];
+						count++;
+					}
+				}
+				_assert_(count); //at least one dof should be the approximation requested
+			}
+			else for(i=0;i<this->gsize;i++) outdoflist[i]=gdoflist_local[i];
+		}
+		else if(setenum==FsetEnum){
+			if(doftype){
+				count=0;
+				count2=0;
+				for(i=0;i<this->gsize;i++){
+					if(f_set[i]){
+						if(doftype[i]==approximation_enum){
+							outdoflist[count]=fdoflist_local[count2];
+							count++;
+						}
+						count2++;
+					}
+				}
+			}
+			else for(i=0;i<this->fsize;i++) outdoflist[i]=fdoflist_local[i];
+		}
+		else if(setenum==SsetEnum){
+			if(doftype){
+				count=0;
+				count2=0;
+				for(i=0;i<this->gsize;i++){
+					if(s_set[i]){
+						if(doftype[i]==approximation_enum){
+							outdoflist[count]=sdoflist_local[count2];
+							count++;
+						}
+						count2++;
+					}
+				}
+			}
+			else for(i=0;i<this->ssize;i++) outdoflist[i]=sdoflist_local[i];
 		}
 		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
@@ -295,9 +524,9 @@
 
 	if(approximation_enum==NoneApproximationEnum){
-		if(setenum==GsetEnum)for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=i;
+		if(setenum==GsetEnum)for(i=0;i<this->gsize;i++) outdoflist[i]=i;
 		else if(setenum==FsetEnum){
 			count=0;
-			for(i=0;i<this->indexing.gsize;i++){
-				if(indexing.f_set[i]){
+			for(i=0;i<this->gsize;i++){
+				if(f_set[i]){
 					outdoflist[count]=i;
 					count++;
@@ -307,6 +536,6 @@
 		else if(setenum==SsetEnum){
 			count=0;
-			for(i=0;i<this->indexing.gsize;i++){
-				if(indexing.s_set[i]){
+			for(i=0;i<this->gsize;i++){
+				if(s_set[i]){
 					outdoflist[count]=i;
 					count++;
@@ -319,8 +548,8 @@
 
 		if(setenum==GsetEnum){
-			if(indexing.doftype){
+			if(doftype){
 				count=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(indexing.doftype[i]==approximation_enum){
+				for(i=0;i<this->gsize;i++){
+					if(doftype[i]==approximation_enum){
 						outdoflist[count]=count;
 						count++;
@@ -329,14 +558,14 @@
 				_assert_(count);
 			}
-			else for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=i;
+			else for(i=0;i<this->gsize;i++) outdoflist[i]=i;
 		}
 		else if(setenum==FsetEnum){
 
-			if(indexing.doftype){
+			if(doftype){
 				count=0;
 				count2=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(indexing.doftype[i]==approximation_enum){
-						if(indexing.f_set[i]){
+				for(i=0;i<this->gsize;i++){
+					if(doftype[i]==approximation_enum){
+						if(f_set[i]){
 							outdoflist[count]=count2;
 							count++;
@@ -350,6 +579,6 @@
 
 				count=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(indexing.f_set[i]){
+				for(i=0;i<this->gsize;i++){
+					if(f_set[i]){
 						outdoflist[count]=i;
 						count++;
@@ -359,10 +588,10 @@
 		}
 		else if(setenum==SsetEnum){
-			if(indexing.doftype){
+			if(doftype){
 				count=0;
 				count2=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(indexing.doftype[i]==approximation_enum){
-						if(indexing.s_set[i]){
+				for(i=0;i<this->gsize;i++){
+					if(doftype[i]==approximation_enum){
+						if(s_set[i]){
 							outdoflist[count]=count2;
 							count++;
@@ -375,6 +604,6 @@
 			else{
 				count=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(indexing.s_set[i]){
+				for(i=0;i<this->gsize;i++){
+					if(s_set[i]){
 						outdoflist[count]=i;
 						count++;
@@ -387,9 +616,4 @@
 }
 /*}}}*/
-bool Node::InAnalysis(int in_analysis_enum){/*{{{*/
-	if (in_analysis_enum==this->analysis_enum) return true;
-	else return false;
-}
-/*}}}*/
 int  Node::Lid(void){/*{{{*/
 	return lid; 
@@ -400,11 +624,20 @@
 }
 /*}}}*/
+int  Node::Pid(void){/*{{{*/
+	return this->pid; 
+}
+/*}}}*/
 
 /*Node numerics:*/
 void Node::Activate(void){/*{{{*/
 
-	if(!IsActive() && !this->indexing.freeze){
+	if(!IsActive() && !this->freeze){
 		this->indexingupdate = true;
-		indexing.Activate();
+		this->active = true;
+		for(int i=0;i<this->gsize;i++){
+			this->f_set[i]    = true;
+			this->s_set[i]    = false;
+			this->svalues[i]  = 0.; 
+		}
 	}
 
@@ -416,5 +649,5 @@
 	 * dofs are constrained to a certain value (dirichlet boundary condition*/
 	DofInSSet(dof);
-	this->indexing.svalues[dof]=value;
+	this->svalues[dof]=value;
 }
 /*}}}*/
@@ -426,10 +659,10 @@
 
 	/*Recover values for s set and plug them in constraints vector: */
-	if(this->indexing.ssize){
-		values=xNew<IssmDouble>(this->indexing.ssize);
+	if(this->ssize){
+		values=xNew<IssmDouble>(this->ssize);
 		count=0;
-		for(i=0;i<this->indexing.gsize;i++){
-			if(this->indexing.s_set[i]){
-				values[count]=this->indexing.svalues[i];
+		for(i=0;i<this->gsize;i++){
+			if(this->s_set[i]){
+				values[count]=this->svalues[i];
 				_assert_(!xIsNan<IssmDouble>(values[count]));
 				count++;
@@ -438,5 +671,5 @@
 
 		/*Add values into constraint vector: */
-		ys->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INS_VAL);
+		ys->SetValues(this->ssize,this->sdoflist,values,INS_VAL);
 	}
 
@@ -448,23 +681,27 @@
 void Node::Deactivate(void){/*{{{*/
 
-	if(IsActive() && !this->indexing.freeze){
+	if(IsActive() && !this->freeze){
 		this->indexingupdate = true;
-		indexing.Deactivate();
-	}
-
-}
-/*}}}*/
+		this->active = false;
+		/*Constrain to 0. at this point*/
+		for(int i=0;i<this->gsize;i++){
+			this->f_set[i]    = false;
+			this->s_set[i]    = true;
+			this->svalues[i]  = 0.; 
+		}
+	}
+} /*}}}*/
 void Node::DofInFSet(int dof){/*{{{*/
 
 	/*Put dof for this node into the f set (ie, this dof will NOT be constrained 
 	 * to a fixed value during computations. Only do this for active nodes. */
-	_assert_(dof<this->indexing.gsize);
-	_assert_(this->indexing.active);
-
-	if(this->indexing.f_set[dof] == 0){
-		if(this->indexing.freeze) _error_("Cannot change dof of frozen node");
+	_assert_(dof<this->gsize);
+	_assert_(this->active);
+
+	if(this->f_set[dof] == 0){
+		if(this->freeze) _error_("Cannot change dof of frozen node");
 		this->indexingupdate = true;
-		this->indexing.f_set[dof]=1; 
-		this->indexing.s_set[dof]=0;
+		this->f_set[dof]=1; 
+		this->s_set[dof]=0;
 	}
 }
@@ -474,11 +711,11 @@
 	/*Put dof for this node into the s set (ie, this dof will be constrained 
 	 * to a fixed value during computations. */
-	_assert_(dof<this->indexing.gsize);
-
-	if(this->indexing.f_set[dof] == 1){
-		//if(this->indexing.freeze) _error_("Cannot change dof of frozen node");
+	_assert_(dof<this->gsize);
+
+	if(this->f_set[dof] == 1){
+		//if(this->freeze) _error_("Cannot change dof of frozen node");
 		this->indexingupdate = true;
-		this->indexing.f_set[dof]=0; //n splits into f (for which we solve) and s (single point constraints)
-		this->indexing.s_set[dof]=1;
+		this->f_set[dof]=0; //n splits into f (for which we solve) and s (single point constraints)
+		this->s_set[dof]=1;
 	}
 }
@@ -488,5 +725,5 @@
 	DofInSSet(dof); //with 0 displacement for this dof.
 	//FIXME: for now we don't want this element to change so we use freeze
-	this->indexing.freeze =true;
+	this->freeze =true;
 
 }
@@ -497,5 +734,5 @@
 }
 /*}}}*/
-void  Node::SetApproximation(int in_approximation){/*{{{*/
+void Node::SetApproximation(int in_approximation){/*{{{*/
 
 	this->approximation = in_approximation;
@@ -511,36 +748,36 @@
 
 	if(approximation_enum==NoneApproximationEnum){
-		if      (setenum==GsetEnum) numdofs=this->indexing.gsize;
-		else if (setenum==FsetEnum) numdofs=this->indexing.fsize;
-		else if (setenum==SsetEnum) numdofs=this->indexing.ssize;
+		if      (setenum==GsetEnum) numdofs=this->gsize;
+		else if (setenum==FsetEnum) numdofs=this->fsize;
+		else if (setenum==SsetEnum) numdofs=this->ssize;
 		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
 	}
 	else{
 		if(setenum==GsetEnum){
-			if(this->indexing.doftype){
+			if(this->doftype){
 				numdofs=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if(this->indexing.doftype[i]==approximation_enum) numdofs++;
-				}
-			}
-			else numdofs=this->indexing.gsize;
+				for(i=0;i<this->gsize;i++){
+					if(this->doftype[i]==approximation_enum) numdofs++;
+				}
+			}
+			else numdofs=this->gsize;
 		}
 		else if (setenum==FsetEnum){
-			if(this->indexing.doftype){
+			if(this->doftype){
 				numdofs=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if((this->indexing.doftype[i]==approximation_enum) && (this->indexing.f_set[i])) numdofs++;
-				}
-			}
-			else numdofs=this->indexing.fsize;
+				for(i=0;i<this->gsize;i++){
+					if((this->doftype[i]==approximation_enum) && (this->f_set[i])) numdofs++;
+				}
+			}
+			else numdofs=this->fsize;
 		}
 		else if (setenum==SsetEnum){
-			if(this->indexing.doftype){
+			if(this->doftype){
 			numdofs=0;
-				for(i=0;i<this->indexing.gsize;i++){
-					if((this->indexing.doftype[i]==approximation_enum) && (this->indexing.s_set[i])) numdofs++;
-				}
-			}
-			else numdofs=this->indexing.ssize;
+				for(i=0;i<this->gsize;i++){
+					if((this->doftype[i]==approximation_enum) && (this->s_set[i])) numdofs++;
+				}
+			}
+			else numdofs=this->ssize;
 		}
 		else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
@@ -551,6 +788,6 @@
 void Node::HardDeactivate(void){/*{{{*/
 
-	this->indexing.Deactivate();
-	this->indexing.freeze =true;
+	this->Deactivate();
+	this->freeze =true;
 
 }
@@ -558,5 +795,5 @@
 bool Node::IsActive(void){/*{{{*/
 
-	return indexing.active;
+	return active;
 
 }
@@ -564,5 +801,5 @@
 int  Node::IsClone(){/*{{{*/
 
-	return indexing.clone;
+	return clone;
 
 }
@@ -577,6 +814,8 @@
 
 	/*Dof should be added to the f-set, and taken out of the s-set:*/
-	DofInFSet(dof);
-	this->indexing.svalues[dof]=0.;
+	if(this->active){
+		DofInFSet(dof);
+		this->svalues[dof]=0.;
+	}
 }
 /*}}}*/
@@ -587,134 +826,139 @@
 }
 /*}}}*/
-void Node::VecMerge(Vector<IssmDouble>* ug, IssmDouble* vector_serial,int setenum){/*{{{*/
-
-	IssmDouble *values  = NULL;
-	int        *indices = NULL;
-	int         count   = 0;
-	int         i;
+void Node::VecMerge(Vector<IssmDouble>* ug,IssmDouble* local_uf,int* indices_uf,IssmDouble* local_ys,int* indices_ys){/*{{{*/
+
+	/*Only perform operation if not clone*/
+	if(this->IsClone()) return;
+
+	if(this->fsize){
+		int*        indices = xNew<int>(this->fsize);
+		IssmDouble* values  = xNew<IssmDouble>(this->fsize);
+
+		int count = 0;
+		for(int i=0;i<this->gsize;i++){
+			if(this->f_set[i]){
+				_assert_(local_uf);
+				_assert_(this->fdoflist[count]==indices_uf[this->fdoflist_local[count]]);
+
+				values[count] =local_uf[this->fdoflist_local[count]];
+				indices[count]=this->gdoflist[i];
+				count++;
+			}
+		}
+		ug->SetValues(this->fsize,indices,values,INS_VAL);
+
+		xDelete<IssmDouble>(values);
+		xDelete<int>(indices);
+	}
+	if(this->ssize){
+		int*        indices = xNew<int>(this->ssize);
+		IssmDouble* values  = xNew<IssmDouble>(this->ssize);
+
+		int count = 0;
+		for(int i=0;i<this->gsize;i++){
+			if(this->s_set[i]){
+				_assert_(local_ys);
+				_assert_(this->sdoflist[count]==indices_ys[this->sdoflist_local[count]]);
+
+				values[count] =local_ys[this->sdoflist_local[count]];
+				indices[count]=this->gdoflist[i];
+				count++;
+			}
+		}
+		ug->SetValues(this->ssize,indices,values,INS_VAL);
+		
+		xDelete<IssmDouble>(values);
+		xDelete<int>(indices);
+	}
+}
+/*}}}*/
+void Node::VecReduce(Vector<IssmDouble>* uf, IssmDouble* local_ug,int* indices_ug){/*{{{*/
+
+
+	/*Only perform operation if not clone*/
+	if(this->IsClone()) return;
+
+	if(this->fsize){
+		int*        indices = xNew<int>(this->fsize);
+		IssmDouble* values  = xNew<IssmDouble>(this->fsize);
+
+		int count = 0;
+		for(int i=0;i<this->gsize;i++){
+			if(this->f_set[i]){
+				_assert_(local_ug);
+				_assert_(this->gdoflist[i]==indices_ug[this->gdoflist_local[i]]);
+
+				values[count] =local_ug[this->gdoflist_local[i]];
+				indices[count]=this->fdoflist[count];
+				count++;
+			}
+		}
+		uf->SetValues(this->fsize,indices,values,INS_VAL);
+
+		xDelete<IssmDouble>(values);
+		xDelete<int>(indices);
+	}
+}
+/*}}}*/
+
+/* indexing routines:*/
+void Node::AllocateDofLists(int setenum){/*{{{*/
+
+	/*Initialize: */
+	int size=0;
 
 	if(setenum==FsetEnum){
-		if(this->indexing.fsize){
-			indices=xNew<int>(this->indexing.fsize);
- 			values=xNew<IssmDouble>(this->indexing.fsize);
-
-			for(i=0;i<this->indexing.gsize;i++){
-				if(this->indexing.f_set[i]){
-					_assert_(vector_serial);
-					values[count]=vector_serial[this->indexing.fdoflist[count]];
-					indices[count]=this->indexing.gdoflist[i];
-					count++;
-				}
-			}
-
-			/*Add values into ug: */
-			ug->SetValues(this->indexing.fsize,indices,values,INS_VAL);
+		for(int i=0;i<this->gsize;i++) if(f_set[i])size++;
+		this->fsize=size;
+		xDelete<int>(this->fdoflist);
+		xDelete<int>(this->fdoflist_local);
+
+		if(this->fsize){
+			this->fdoflist=xNew<int>(size);
+			this->fdoflist_local=xNew<int>(size);
+		}
+		else{
+			this->fdoflist=NULL;
+			this->fdoflist_local=NULL;
 		}
 	}
 	else if(setenum==SsetEnum){
-		if(this->indexing.ssize){
-			indices=xNew<int>(this->indexing.ssize);
-			values=xNew<IssmDouble>(this->indexing.ssize);
-
-			for(i=0;i<this->indexing.gsize;i++){
-				if(this->indexing.s_set[i]){
-					_assert_(vector_serial);
-					values[count]=vector_serial[this->indexing.sdoflist[count]];
-					indices[count]=this->indexing.gdoflist[i];
-					count++;
-				}
-			}
-
-			/*Add values into ug: */
-			ug->SetValues(this->indexing.ssize,indices,values,INS_VAL);
-		}
-	}
-	else _error_("VecMerge can only merge from the s or f-set onto the g-set!");
-
-	/*Free ressources:*/
-	xDelete<IssmDouble>(values);
-	xDelete<int>(indices);
-}
-/*}}}*/
-void Node::VecReduce(Vector<IssmDouble>* vector, IssmDouble* ug_serial,int setenum){/*{{{*/
-
-	IssmDouble* values=NULL;
-	int     count=0;
-	int     i;
-
-	if(setenum==FsetEnum){
-		if(this->indexing.fsize){
- 			values=xNew<IssmDouble>(this->indexing.fsize);
-
-			for(i=0;i<this->indexing.gsize;i++){
-				if(this->indexing.f_set[i]){
-					_assert_(ug_serial);
-					values[count]=ug_serial[this->indexing.gdoflist[i]];
-					count++;
-				}
-			}
-
-			/*Add values into ug: */
-			vector->SetValues(this->indexing.fsize,this->indexing.fdoflist,values,INS_VAL);
-		}
-	}
-	else if(setenum==SsetEnum){
-		if(this->indexing.ssize){
-			values=xNew<IssmDouble>(this->indexing.ssize);
-
-			for(i=0;i<this->indexing.gsize;i++){
-				if(this->indexing.s_set[i]){
-					_assert_(ug_serial);
-					values[count]=ug_serial[this->indexing.gdoflist[i]];
-					count++;
-				}
-			}
-
-			/*Add values into ug: */
-			vector->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INS_VAL);
-		}
-	}
-	else _error_("VecReduce can only merge from the s or f-set onto the g-set!");
-
-	/*Free ressources:*/
-	xDelete<IssmDouble>(values);
-}
-/*}}}*/
-
-/* indexing routines:*/
-void Node::DistributeDofs(int* pdofcount,int setenum){/*{{{*/
-
-	int i;
-	int dofcount;
-
-	dofcount=*pdofcount;
-
-	/*Initialize: */
-	if(setenum==FsetEnum) this->indexing.InitSet(setenum);
-	if(setenum==SsetEnum) this->indexing.InitSet(setenum);
-
-	/*For clone nodfs, don't distribute dofs, we will get them from another cpu in UpdateCloneDofs!*/
-	if(indexing.clone){
-		return;
-	}
+		for(int i=0;i<this->gsize;i++) if(s_set[i])size++;
+		this->ssize=size;
+		xDelete<int>(this->sdoflist);
+		xDelete<int>(this->sdoflist_local);
+
+		if(this->ssize){
+			this->sdoflist=xNew<int>(size);
+			this->sdoflist_local=xNew<int>(size);
+		}
+		else{
+			this->sdoflist=NULL;
+			this->sdoflist_local=NULL;
+		}
+	}
+	/*TODO, we should never be here for GSET! add an assert and track down whether this happens*/
+}
+/*}}}*/
+void Node::DistributeLocalDofs(int* pdofcount,int setenum){/*{{{*/
+
+	/*Get current count*/
+	int dofcount=*pdofcount;
 
 	/*This node should distribute dofs for setenum set (eg, f_set or s_set), go ahead: */
 	if(setenum==GsetEnum){
-		for(i=0;i<this->indexing.gsize;i++){
-			indexing.gdoflist[i]=dofcount+i;
-		}
-		dofcount+=this->indexing.gsize;
+		_assert_(this->gsize==0 || this->gdoflist_local);
+		for(int i=0;i<this->gsize;i++) gdoflist_local[i]=dofcount+i;
+		dofcount+=this->gsize;
 	}
 	else if(setenum==FsetEnum){
-		for(i=0;i<this->indexing.fsize;i++){
-			indexing.fdoflist[i]=dofcount+i;
-		}
-		dofcount+=this->indexing.fsize;
+		_assert_(this->fsize==0 || this->fdoflist_local);
+		for(int i=0;i<this->fsize;i++) fdoflist_local[i]=dofcount+i;
+		dofcount+=this->fsize;
 	}
 	else if(setenum==SsetEnum){
-		for(i=0;i<this->indexing.ssize;i++){
-			indexing.sdoflist[i]=dofcount+i;
-		}
-		dofcount+=this->indexing.ssize;
+		_assert_(this->ssize==0 || this->sdoflist_local);
+		for(int i=0;i<this->ssize;i++) sdoflist_local[i]=dofcount+i;
+		dofcount+=this->ssize;
 	}
 	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
@@ -724,60 +968,39 @@
 }
 /*}}}*/
-void Node::OffsetDofs(int dofcount,int setenum){/*{{{*/
-
-	int i;
-
-	if(indexing.clone){
-		/*This node is a clone, don't off_set the dofs!: */
-		return;
-	}
+void Node::DistributeGlobalDofsMasters(int dofcount,int setenum){/*{{{*/
+
+	/*This node is a clone, don't offset the dofs!: */
+	if(clone) return;
 
 	/*This node should off_set the dofs, go ahead: */
 	if(setenum==GsetEnum){
-		for(i=0;i<this->indexing.gsize;i++) indexing.gdoflist[i]+=dofcount;
+		_assert_(this->gsize==0 || this->gdoflist);
+		for(int i=0;i<this->gsize;i++) this->gdoflist[i]=this->gdoflist_local[i]+dofcount;
 	}
 	else if(setenum==FsetEnum){
-		for(i=0;i<this->indexing.fsize;i++) indexing.fdoflist[i]+=dofcount;
+		_assert_(this->fsize==0 || this->fdoflist);
+		for(int i=0;i<this->fsize;i++) this->fdoflist[i]=this->fdoflist_local[i]+dofcount;
 	}
 	else if(setenum==SsetEnum){
-		for(i=0;i<this->indexing.ssize;i++) indexing.sdoflist[i]+=dofcount;
+		_assert_(this->ssize==0 || this->sdoflist);
+		for(int i=0;i<this->ssize;i++) this->sdoflist[i]=this->sdoflist_local[i]+dofcount;
 	}
 	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
 }
 /*}}}*/
-void Node::SetClone(int* minranks){/*{{{*/
-
-	int my_rank;
-
-	/*recover my_rank:*/
-	my_rank=IssmComm::GetRank();
-
-	if (minranks[sid]==my_rank){
-		indexing.clone=false;
-	}
-	else{
-		/*!there is a cpu with lower rank that has the same node, 
-		therefore, I am a clone*/
-		indexing.clone=true;	
-	}
-}
-/*}}}*/
-void Node::ShowTrueDofs(int* truedofs, int ncols,int setenum){/*{{{*/
-
-	int j;
-
-	/*Are we a clone? : */
-	if(indexing.clone) return;
+void Node::ShowMasterDofs(int* truedofs,int setenum){/*{{{*/
+
+	_assert_(!this->clone);
 
 	/*Ok, we are not a clone, just plug our dofs into truedofs: */
 	switch(setenum){
 		case GsetEnum:
-			for(j=0;j<this->indexing.gsize;j++) truedofs[ncols*sid+j]=indexing.gdoflist[j];
+			for(int j=0;j<this->gsize;j++) truedofs[j]=gdoflist[j];
 			break;
 		case FsetEnum:
-			for(j=0;j<this->indexing.fsize;j++) truedofs[ncols*sid+j]=indexing.fdoflist[j];
+			for(int j=0;j<this->fsize;j++) truedofs[j]=fdoflist[j];
 			break;
 		case SsetEnum:
-			for(j=0;j<this->indexing.ssize;j++) truedofs[ncols*sid+j]=indexing.sdoflist[j];
+			for(int j=0;j<this->ssize;j++) truedofs[j]=sdoflist[j];
 			break;
 		default:
@@ -787,10 +1010,7 @@
 }
 /*}}}*/
-void Node::UpdateCloneDofs(int* alltruedofs,int ncols,int setenum){/*{{{*/
-
-	int j;
-
-	/*If we are not a clone, don't update, we already have dofs!: */
-	if(!indexing.clone)return;
+void Node::UpdateCloneDofs(int* alltruedofs,int setenum){/*{{{*/
+
+	_assert_(this->clone);
 
 	/*Ok, we are a clone node, but we did not create the dofs for this node.
@@ -798,11 +1018,11 @@
 	switch(setenum){
 		case GsetEnum:
-			for(j=0;j<this->indexing.gsize;j++) indexing.gdoflist[j]=alltruedofs[ncols*sid+j];
+			for(int j=0;j<this->gsize;j++) gdoflist[j]=alltruedofs[j];
 			break;
 		case FsetEnum:
-			for(j=0;j<this->indexing.fsize;j++) indexing.fdoflist[j]=alltruedofs[ncols*sid+j];
+			for(int j=0;j<this->fsize;j++) fdoflist[j]=alltruedofs[j];
 			break;
 		case SsetEnum:
-			for(j=0;j<this->indexing.ssize;j++) indexing.sdoflist[j]=alltruedofs[ncols*sid+j];
+			for(int j=0;j<this->ssize;j++) sdoflist[j]=alltruedofs[j];
 			break;
 		default:
Index: /issm/trunk/src/c/classes/Node.h
===================================================================
--- /issm/trunk/src/c/classes/Node.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Node.h	(revision 24313)
@@ -10,6 +10,4 @@
 #include "../datastructures/datastructures.h"
 #include "../shared/shared.h"
-#include "./DofIndexing.h"
-#include "./Update.h"
 class  Inputs;
 class  Hook;
@@ -17,6 +15,6 @@
 class  DataSet;
 class  Vertices;
-template <class doubletype> class  Vector;
-template <class doubletype> class  Matrix;
+template <class doubletype> class Vector;
+template <class doubletype> class Matrix;
 class ElementVector;
 class ElementMatrix;
@@ -26,20 +24,49 @@
 
 	private:
-		int approximation; //For ice flow models, we need to know what ice flow approximation is employed on this node
+		int  approximation; //For ice flow models, we need to know what ice flow approximation is employed on this node
+		bool clone;  //this node is replicated from another one
+		int  id;    // unique arbitrary id.
+		int  sid;   // "serial" id (rank of this node if the dataset was serial on 1 cpu)
+		int  lid;   // "local"  id (rank of this node in current partition)
+		int  pid;   // parallel id (specific to this partition)
+
+		/*Only this function can access these private fields*/
+		//friend void Nodes::Finalize();
+		friend class Nodes;
+		friend class FemModel;
 
 	public: 
-
-		int id;    // unique arbitrary id.
-		int sid;   // "serial" id (rank of this node if the dataset was serial on 1 cpu)
-		int lid;   // "local"  id (rank of this node in current partition)
-
-		int          analysis_enum;
+		int  analysis_enum;
 		IssmDouble   coord_system[3][3];
 		bool         indexingupdate;
-		DofIndexing  indexing;
+
+		/*sizes: */
+		int gsize;   //number of dofs for a node
+		int fsize;   //number of dofs solver for
+		int ssize;   //number of constrained dofs
+
+		/*Activation*/
+		bool active; //Is this node active or inactive (all dofs are constrained)
+		bool freeze; //this is required for 2d solutions, we never activate nodes that are not on base
+
+		/*boundary conditions sets: */
+		bool       *f_set;     //is dof on f-set (on which we solve)
+		bool       *s_set;     //is dof on s-set (on which boundary conditions -dirichlet- are applied)
+		IssmDouble *svalues;   //list of constraint values. size g_size, for ease of use.
+
+		/*types of dofs: */
+		int        *doftype;   //approximation type of the dofs (used only for coupling), size g_size
+
+		/*list of degrees of freedom: */
+		int *gdoflist;
+		int *fdoflist;
+		int *sdoflist;
+		int *gdoflist_local;
+		int *fdoflist_local;
+		int *sdoflist_local;
 
 		/*Node constructors, destructors*/
 		Node();
-		Node(int node_id,int node_sid,int node_lid,int io_index, IoModel* iomodel,int analysis_enum,int approximation_in);
+		Node(int node_id,int node_sid,int io_index,bool isclone,IoModel* iomodel,int analysis_enum,int approximation_in,bool isamr);
 		~Node();
 
@@ -53,9 +80,10 @@
 
 		/*Node numerical routines*/
+		void  AllocateDofLists(int setenum);
 		void  Activate(void);
 		void  ApplyConstraint(int dof,IssmDouble value);
 		void  CreateNodalConstraints(Vector<IssmDouble>* ys);
 		void  Deactivate(void);
-		void  DistributeDofs(int* pdofcount,int setenum);
+		void  DistributeLocalDofs(int* pdofcount,int setenum);
 		void  DofInFSet(int dof);
 		void  DofInSSet(int dof);
@@ -65,8 +93,8 @@
 		int   GetDof(int dofindex,int setenum);
 		void  GetDofList(int* poutdoflist,int approximation_enum,int setenum);
+		void  GetDofListLocal(int* poutdoflist,int approximation_enum,int setenum);
 		void  GetLocalDofList(int* poutdoflist,int approximation_enum,int setenum);
 		int   GetNumberOfDofs(int approximation_enum,int setenum);
 		void  HardDeactivate(void);
-		bool  InAnalysis(int analysis_enum);
 		bool  IsActive(void);
 		int   IsClone();
@@ -74,15 +102,15 @@
 		int   IsGrounded();
 		int   Lid(void); 
-		void  OffsetDofs(int dofcount,int setenum);
+		void  DistributeGlobalDofsMasters(int dofcount,int setenum);
 		void  ReindexingDone(void);
 		void  RelaxConstraint(int dof);
 		bool  RequiresDofReindexing(void);
-		void  SetClone(int* minranks);
 		void  SetCurrentConfiguration(DataSet* nodes,Vertices* vertices);
-		void  ShowTrueDofs(int* truerows,int ncols,int setenum);
+		void  ShowMasterDofs(int* truerows,int setenum);
 		int   Sid(void); 
-		void  UpdateCloneDofs(int* alltruerows,int ncols,int setenum);
-		void  VecMerge(Vector<IssmDouble>* ug, IssmDouble* vector_serial,int setenum);
-		void  VecReduce(Vector<IssmDouble>* vector, IssmDouble* ug_serial,int setnum);
+		int   Pid(void); 
+		void  UpdateCloneDofs(int* alltruerows,int setenum);
+		void  VecMerge(Vector<IssmDouble>* ug,IssmDouble* local_uf,int* indices_uf,IssmDouble* local_ys,int* indices_ys);
+		void  VecReduce(Vector<IssmDouble>* uf, IssmDouble* local_ug,int* indices_ug);
 		void  SetApproximation(int in_approximation);
 };
Index: /issm/trunk/src/c/classes/Nodes.cpp
===================================================================
--- /issm/trunk/src/c/classes/Nodes.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Nodes.cpp	(revision 24313)
@@ -4,5 +4,5 @@
  */
 
-/*Headers: {{{*/
+/*Headers*/
 #ifdef HAVE_CONFIG_H
 	#include <config.h>
@@ -10,19 +10,35 @@
 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
 #endif
-
 #include "../shared/io/Comm/IssmComm.h"
 #include "./Nodes.h"
 #include "./Node.h"
-
 using namespace std;
-/*}}}*/
 
 /*Object constructors and destructor*/
 Nodes::Nodes(){/*{{{*/
-	enum_type=NodesEnum;
+	this->enum_type             = NodesEnum;
+	this->common_recv           = NULL;
+	this->common_recv_ids       = NULL;
+	this->common_send           = NULL;
+	this->common_send_ids       = NULL;
+	this->numberofnodes         = -1;
+	this->numberofnodes_local   = -1;
+	this->numberofmasters_local = -1;
 	return;
 }
 /*}}}*/
 Nodes::~Nodes(){/*{{{*/
+	int num_proc=IssmComm::GetSize();
+
+	if(this->common_recv) xDelete<int>(common_recv);
+	if(this->common_send) xDelete<int>(common_send);
+	if(this->common_recv_ids){
+		for(int i=0;i<num_proc;i++) if(common_recv_ids[i]) xDelete<int>(common_recv_ids[i]);
+		xDelete<int*>(common_recv_ids);
+	}
+	if(this->common_send_ids){
+		for(int i=0;i<num_proc;i++) if(common_send_ids[i]) xDelete<int>(common_send_ids[i]);
+		xDelete<int*>(common_send_ids);
+	}
 	return;
 }
@@ -30,50 +46,137 @@
 
 /*Numerics*/
-void  Nodes::DistributeDofs(int analysis_type,int setenum){/*{{{*/
-
-	int  i;
-	int  dofcount=0;
-	int  maxdofspernode=0;
-	int* alldofcount=NULL;
-	int* truedofs=NULL;
-	int* alltruedofs=NULL;
-	int  numnodes=0;
+Nodes* Nodes::Copy() {/*{{{*/
+
+	int num_proc = IssmComm::GetSize();
+
+	/*Copy dataset*/
+	Nodes* output=new Nodes();
+	output->sorted=this->sorted;
+	output->numsorted=this->numsorted;
+	output->presorted=this->presorted;
+	for(vector<Object*>::iterator obj=this->objects.begin() ; obj < this->objects.end(); obj++ ){
+		output->AddObject((*obj)->copy());
+	}
+
+	/*Build id_offsets and sorted_ids*/
+	int objsize = this->numsorted;
+	output->id_offsets=NULL;
+	output->sorted_ids=NULL;
+	if(this->sorted && objsize>0 && this->id_offsets){	
+		output->id_offsets=xNew<int>(objsize);
+		xMemCpy<int>(output->id_offsets,this->id_offsets,objsize);
+	}
+	if(this->sorted && objsize>0 && this->sorted_ids){
+		output->sorted_ids=xNew<int>(objsize);
+		xMemCpy<int>(output->sorted_ids,this->sorted_ids,objsize);
+	}
+
+	/*Copy other fields*/
+	output->numberofnodes         = this->numberofnodes;
+	output->numberofnodes_local   = this->numberofnodes_local;
+	output->numberofmasters_local = this->numberofmasters_local;
+
+	if(this->common_recv){
+		output->common_recv=xNew<int>(num_proc);
+		for(int i=0;i<num_proc;i++) output->common_recv[i]=this->common_recv[i];
+	}
+	if(this->common_send){
+		output->common_send=xNew<int>(num_proc);
+		for(int i=0;i<num_proc;i++) output->common_send[i]=this->common_send[i];
+	}
+	if(this->common_recv_ids){
+		output->common_recv_ids = xNew<int*>(num_proc);
+		for(int i=0;i<num_proc;i++){
+			output->common_recv_ids[i]=xNew<int>(this->common_recv[i]);
+			for(int j=0;j<this->common_recv[i];j++) output->common_recv_ids[i][j]=this->common_recv_ids[i][j];
+		}
+	}
+	if(this->common_send_ids){
+		output->common_send_ids = xNew<int*>(num_proc);
+		for(int i=0;i<num_proc;i++){
+			output->common_send_ids[i]=xNew<int>(this->common_send[i]);
+			for(int j=0;j<this->common_send[i];j++) output->common_send_ids[i][j]=this->common_send_ids[i][j];
+		}
+	}
+
+	return output;
+}
+/*}}}*/
+void  Nodes::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
+
+	int num_procs=IssmComm::GetSize();
+	int test = num_procs;
+	MARSHALLING_ENUM(NodesEnum);
+	MARSHALLING(numberofnodes);
+	MARSHALLING(numberofnodes_local);
+	MARSHALLING(numberofmasters_local);
+
+	MARSHALLING(test);
+	if(test!=num_procs) _error_("number of cores is not the same as before");
+
+	DataSet::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+
+	if(marshall_direction == MARSHALLING_BACKWARD){
+		this->common_recv_ids = xNew<int*>(num_procs);
+		this->common_send_ids = xNew<int*>(num_procs);
+		for(int i=0;i<num_procs;i++){
+			this->common_recv_ids[i] = NULL;
+			this->common_send_ids[i] = NULL;
+		}
+	}
+
+	/*Stop here if no nodes*/
+	if(this->Size()==0) return;
+
+	MARSHALLING_DYNAMIC(this->common_recv,int,num_procs);
+	MARSHALLING_DYNAMIC(this->common_send,int,num_procs);
+	for(int i=0;i<num_procs;i++){
+		if(this->common_recv[i]) MARSHALLING_DYNAMIC(this->common_recv_ids[i],int,this->common_recv[i]);
+		if(this->common_send[i]) MARSHALLING_DYNAMIC(this->common_send_ids[i],int,this->common_send[i]);
+	}
+}
+/*}}}*/
+void  Nodes::DistributeDofs(int setenum){/*{{{*/
 
 	/*recover my_rank:*/
+	ISSM_MPI_Status status;
 	int my_rank   = IssmComm::GetRank();
 	int num_procs = IssmComm::GetSize();
 
-	/*some check: */
-	_assert_(setenum==GsetEnum || setenum==FsetEnum || setenum==SsetEnum);
-
-	/*Go through objects, and distribute dofs locally, from 0 to numberofdofsperobject*/
-	for(i=0;i<this->Size();i++){
-		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
-
-		/*Check that this node corresponds to our analysis currently being carried out: */
-		if(node->InAnalysis(analysis_type)){
-			node->DistributeDofs(&dofcount,setenum);
-		}
+	/*First, allocate dof lists based on fset and sset*/
+	for(int i=0;i<this->Size();i++){
+		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
+		node->AllocateDofLists(setenum);
+	}
+
+	/*Now, Build local dofs for masters first*/
+	int  dofcount=0;
+	for(int i=0;i<this->Size();i++){
+		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
+		if(!node->IsClone()) node->DistributeLocalDofs(&dofcount,setenum);
+	}
+	/*Build local dofs for clones, they always will be at the end*/
+	int dofcount_local = dofcount;
+	for(int i=0;i<this->Size();i++){
+		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
+		if(node->IsClone()) node->DistributeLocalDofs(&dofcount_local,setenum);
 	}
 
 	/* Now every object has distributed dofs, but locally, and with a dof count starting from 
-	 * 0. This means the dofs between all the cpus are not unique. We now offset the dofs of eache
-	 * cpus by the total last dofs of the previus cpu, starting from 0.
+	 * 0. This means the dofs between all the cpus are not unique. We now offset the dofs of each
+	 * cpus by the total last (master) dofs of the previus cpu, starting from 0.
 	 * First: get number of dofs for each cpu*/
-	alldofcount=xNew<int>(num_procs);
+	int* alldofcount=xNew<int>(num_procs);
 	ISSM_MPI_Gather(&dofcount,1,ISSM_MPI_INT,alldofcount,1,ISSM_MPI_INT,0,IssmComm::GetComm());
 	ISSM_MPI_Bcast(alldofcount,num_procs,ISSM_MPI_INT,0,IssmComm::GetComm());
 
 	/* Every cpu should start its own dof count at the end of the dofcount from cpu-1*/
-	dofcount=0;
-	for(i=0;i<my_rank;i++){
-		dofcount+=alldofcount[i];
-	}
-	for(i=0;i<this->Size();i++){
-		/*Check that this node corresponds to our analysis currently being carried out: */
-		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
-		if (node->InAnalysis(analysis_type)){
-			node->OffsetDofs(dofcount,setenum);
-		}
+	int offset=0;
+	for(int i=0;i<my_rank;i++) offset+=alldofcount[i];
+	xDelete<int>(alldofcount);
+
+	for(int i=0;i<this->Size();i++){
+		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
+		node->DistributeGlobalDofsMasters(offset,setenum);
 	}
 
@@ -81,108 +184,123 @@
 	 * object that is not a clone, tell them to show their dofs, so that later on, they can get picked 
 	 * up by their clones: */
-	maxdofspernode=this->MaxNumDofs(analysis_type,setenum);
-	numnodes=this->NumberOfNodes(analysis_type);
-	if(numnodes*maxdofspernode){
-		truedofs=   xNewZeroInit<int>(numnodes*maxdofspernode); //initialize to 0, so that we can pick up the max
-		alltruedofs=xNewZeroInit<int>(numnodes*maxdofspernode);
-	}
-
-	for(i=0;i<this->Size();i++){
-		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
-		if (node->InAnalysis(analysis_type)){
-			node->ShowTrueDofs(truedofs,maxdofspernode,setenum);//give maxdofspernode, column size, so that nodes can index into truedofs
-		}
-	}
-
-	ISSM_MPI_Allreduce((void*)truedofs,(void*)alltruedofs,numnodes*maxdofspernode,ISSM_MPI_INT,ISSM_MPI_MAX,IssmComm::GetComm());
-
-	/* Now every cpu knows the true dofs of everyone else that is not a clone*/
-	for(i=0;i<this->Size();i++){
-		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
-		if (node->InAnalysis(analysis_type)){
-			node->UpdateCloneDofs(alltruedofs,maxdofspernode,setenum);
-		}
-	}
+	int  maxdofspernode = this->MaxNumDofs(setenum);
+	int* truedofs       = xNew<int>(this->Size()*maxdofspernode); //only one alloc
+	for(int rank=0;rank<num_procs;rank++){
+		if(this->common_send[rank]){
+			int  numids = this->common_send[rank];
+			for(int i=0;i<numids;i++){
+				Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(this->common_send_ids[rank][i]));
+				node->ShowMasterDofs(&truedofs[i*maxdofspernode+0],setenum);
+			}
+			ISSM_MPI_Send(truedofs,numids*maxdofspernode,ISSM_MPI_INT,rank,0,IssmComm::GetComm());
+		}
+	}
+	for(int rank=0;rank<num_procs;rank++){
+		if(this->common_recv[rank]){
+			int  numids = this->common_recv[rank];
+			ISSM_MPI_Recv(truedofs,numids*maxdofspernode,ISSM_MPI_INT,rank,0,IssmComm::GetComm(),&status);
+			for(int i=0;i<numids;i++){
+				Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(this->common_recv_ids[rank][i]));
+				node->UpdateCloneDofs(&truedofs[i*maxdofspernode+0],setenum);
+			}
+		}
+	}
+	xDelete<int>(truedofs);
 
 	/*Update indexingupdateflag*/
-	for(i=0;i<this->Size();i++){
-		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
-		if (node->InAnalysis(analysis_type)){
-			node->ReindexingDone();
-		}
-	}
-
-	/* Free ressources: */
-	xDelete<int>(alldofcount);
-	xDelete<int>(truedofs);
-	xDelete<int>(alltruedofs);
-}
-/*}}}*/
-void  Nodes::FlagClones(int analysis_type){/*{{{*/
-
-	int i;
-	int num_procs;
-	int numnodes;
-
-	/*recover num_procs: */
-	num_procs=IssmComm::GetSize();
-
-	/*Figure out number of nodes for this analysis: */
-	numnodes=this->NumberOfNodes(analysis_type);
-
-	/*Allocate ranks: */
-	int* ranks    = xNew<int>(numnodes);
-	int* minranks = xNew<int>(numnodes);
-	for(i=0;i<numnodes;i++)ranks[i]=num_procs; //no cpu can have rank num_procs. This is the maximum limit.
-
-	/*Now go through all our objects and ask them to report to who they belong (which rank): */
-	Ranks(ranks,analysis_type);
-
-	/*We need to take the minimum rank for each vertex, and every cpu needs to get that result. That way, 
-	 * when we start building the dof list for all vertexs, a cpu can check whether its vertex already has been 
-	 * dealt with by another cpu. We take the minimum because we are going to manage dof assignment in increasing 
-	 * order of cpu rank. This is also why we initialized this array to num_procs.*/
-	ISSM_MPI_Allreduce((void*)ranks,(void*)minranks,numnodes,ISSM_MPI_INT,ISSM_MPI_MIN,IssmComm::GetComm());
-
-	/*Now go through all objects, and use minranks to flag which objects are cloned: */
-	for(i=0;i<this->Size();i++){
-
-		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
-
-		/*Check that this node corresponds to our analysis currently being carried out: */
-		if (node->InAnalysis(analysis_type)){
-
-			/*For this object, decide whether it is a clone: */
-			node->SetClone(minranks);
-		}
-	}
-
-	/*Free ressources: */
-	xDelete<int>(ranks); 
-	xDelete<int>(minranks);
-
-}
-/*}}}*/
-int   Nodes::MaximumId(){/*{{{*/
-
-	int max=-1;
-	int id,allmax;
+	for(int i=0;i<this->Size();i++){
+		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
+		node->ReindexingDone();
+	}
+}
+/*}}}*/
+void  Nodes::Finalize(){/*{{{*/
+
+	/*Here we do 4 things:
+	 * - count all nodes once for all so that we do not need to call MPI
+	 *   every time we need to know the total number of vertices
+	 * - Distribute lids (local ids): masters first, slaves second
+	 * - Distribute pids (parallel ids)
+	 * - Distribute Gset once for all
+	 */
+
+	/*recover my_rank:*/
+	ISSM_MPI_Status status;
+	int my_rank   = IssmComm::GetRank();
+	int num_procs = IssmComm::GetSize();
+
+	/*1. set number of nodes once for all*/
+	this->numberofnodes_local=this->Size();
+	this->numberofmasters_local=0;
+	for(int i=0;i<this->Size();i++){
+		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
+		if(!node->clone) this->numberofmasters_local++;
+	}
+	ISSM_MPI_Allreduce((void*)&this->numberofmasters_local,(void*)&this->numberofnodes,1,ISSM_MPI_INT,ISSM_MPI_SUM,IssmComm::GetComm());
+
+	/*2. Distribute lids (First: masters, then clones)*/
+	int lid = 0;
+	for(int i=0;i<this->Size();i++){
+		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
+		if(!node->clone) node->lid=lid++;
+	}
+	for(int i=0;i<this->Size();i++){
+		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
+		if(node->clone) node->lid=lid++;
+	}
+
+	/*3. Distribute pids based on lids and offsets*/
+	int* all_num_masters=xNew<int>(num_procs);
+	ISSM_MPI_Gather(&this->numberofmasters_local,1,ISSM_MPI_INT,all_num_masters,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+	ISSM_MPI_Bcast(all_num_masters,num_procs,ISSM_MPI_INT,0,IssmComm::GetComm());
+	int offset=0;
+	for(int i=0;i<my_rank;i++) offset+=all_num_masters[i];
+	xDelete<int>(all_num_masters);
+
+	for(int i=0;i<this->Size();i++){
+		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
+		node->pid = node->lid+offset;
+	}
+
+	/* Share pids of masters and update pids of clones*/
+	int* truepids = xNew<int>(this->Size()); //only one alloc
+	for(int rank=0;rank<num_procs;rank++){
+		if(this->common_send[rank]){
+			int  numids = this->common_send[rank];
+			for(int i=0;i<numids;i++){
+				Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(this->common_send_ids[rank][i]));
+				truepids[i] = node->pid;
+			}
+			ISSM_MPI_Send(truepids,numids,ISSM_MPI_INT,rank,0,IssmComm::GetComm());
+		}
+	}
+	for(int rank=0;rank<num_procs;rank++){
+		if(this->common_recv[rank]){
+			int  numids = this->common_recv[rank];
+			ISSM_MPI_Recv(truepids,numids,ISSM_MPI_INT,rank,0,IssmComm::GetComm(),&status);
+			for(int i=0;i<numids;i++){
+				Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(this->common_recv_ids[rank][i]));
+				node->pid = truepids[i];
+			}
+		}
+	}
+	xDelete<int>(truepids);
+
+	/*4. Distribute G dofs once for all*/
+	//this->DistributeDofs(GsetEnum);
+
+	return;
+}/*}}}*/
+int   Nodes::MaxNumDofs(int setenum){/*{{{*/
+
+	int max=0;
+	int allmax;
 
 	/*Now go through all nodes, and get how many dofs they own, unless they are clone nodes: */
-	if(!sorted){
-		for(int i=0;i<this->Size();i++){
-			Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
-			id=node->Id();
-			if(id>max)max=id;
-		}
-	}
-	else{
-		if(this->Size()==0){
-			max = 0;
-		}
-		else{
-			Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(this->Size()-1));
-			max = node->Id();
-		}
+	for(int i=0;i<this->Size();i++){
+		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
+
+		int numdofs=node->GetNumberOfDofs(NoneApproximationEnum,setenum);
+		if(numdofs>max) max=numdofs;
 	}
 
@@ -194,57 +312,27 @@
 }
 /*}}}*/
-int   Nodes::MaxNumDofs(int analysis_type,int setenum){/*{{{*/
-
-	int max=0;
-	int allmax,numdofs;
+int   Nodes::NumberOfDofs(int setenum){/*{{{*/
+
+	int   allnumdofs;
+
+	/*Get number of dofs on current cpu (excluding clones)*/
+	int numdofs=this->NumberOfDofsLocal(setenum);
+
+	/*Gather from all cpus: */
+	ISSM_MPI_Allreduce ((void*)&numdofs,(void*)&allnumdofs,1,ISSM_MPI_INT,ISSM_MPI_SUM,IssmComm::GetComm());
+	return allnumdofs;
+}
+/*}}}*/
+int   Nodes::NumberOfDofsLocal(int setenum){/*{{{*/
+
+	int   numdofs=0;
 
 	/*Now go through all nodes, and get how many dofs they own, unless they are clone nodes: */
 	for(int i=0;i<this->Size();i++){
-
-		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
-
-		/*Check that this node corresponds to our analysis currently being carried out: */
-		if (node->InAnalysis(analysis_type)){
-
-			numdofs=node->GetNumberOfDofs(NoneApproximationEnum,setenum);
-			if(numdofs>max)max=numdofs;
-		}
-	}
-
-	/*Grab max of all cpus: */
-	ISSM_MPI_Allreduce((void*)&max,(void*)&allmax,1,ISSM_MPI_INT,ISSM_MPI_MAX,IssmComm::GetComm());
-	max=allmax;
-
-	return max;
-}
-/*}}}*/
-int   Nodes::NumberOfDofs(int analysis_type,int setenum){/*{{{*/
-
-	int   allnumdofs;
-
-	/*Get number of dofs on current cpu (excluding clones)*/
-	int numdofs=this->NumberOfDofsLocal(analysis_type,setenum);
-
-	/*Gather from all cpus: */
-	ISSM_MPI_Allreduce ( (void*)&numdofs,(void*)&allnumdofs,1,ISSM_MPI_INT,ISSM_MPI_SUM,IssmComm::GetComm());
-	return allnumdofs;
-}
-/*}}}*/
-int   Nodes::NumberOfDofsLocal(int analysis_type,int setenum){/*{{{*/
-
-	int   numdofs=0;
-
-	/*Now go through all nodes, and get how many dofs they own, unless they are clone nodes: */
-	for(int i=0;i<this->Size();i++){
-
-		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
-
-		/*Check that this node corresponds to our analysis currently being carried out: */
-		if (node->InAnalysis(analysis_type)){
-
-			/*Ok, this object is a node, ask it to plug values into partition: */
-			if (!node->IsClone()){
-				numdofs+=node->GetNumberOfDofs(NoneApproximationEnum,setenum);
-			}
+		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
+
+		/*Ok, this object is a node, ask it to plug values into partition: */
+		if (!node->IsClone()){
+			numdofs+=node->GetNumberOfDofs(NoneApproximationEnum,setenum);
 		}
 	}
@@ -253,79 +341,31 @@
 }
 /*}}}*/
+int   Nodes::NumberOfDofsLocalAll(int setenum){/*{{{*/
+
+	/*go through all nodes, and get how many dofs they own, unless they are clone nodes: */
+	int numdofs=0;
+	for(int i=0;i<this->Size();i++){
+		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
+		numdofs+=node->GetNumberOfDofs(NoneApproximationEnum,setenum);
+	}
+	return numdofs;
+}
+/*}}}*/
 int   Nodes::NumberOfNodes(void){/*{{{*/
 
-	/*Careful! only use once all clones have been setup for all nodes!: */
-
-	int numnodes=0;
-	int allnumnodes=0;
-
-	/*Now go through all nodes, and get how many dofs they own, unless they are clone nodes: */
-	for(int i=0;i<this->Size();i++){
-		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
-
-		/*Ok, this object is a node, ask it to plug values into partition: */
-		if (!node->IsClone()) numnodes++;
-	}
-
-	/*Gather from all cpus: */
-	ISSM_MPI_Allreduce ( (void*)&numnodes,(void*)&allnumnodes,1,ISSM_MPI_INT,ISSM_MPI_SUM,IssmComm::GetComm());
-
-	return allnumnodes;
-}
-/*}}}*/
-int   Nodes::NumberOfNodes(int analysis_type){/*{{{*/
-
-	int i;
-
-	int max_sid=-1;
-	int sid;
-	int node_max_sid;
-
-	for(i=0;i<this->Size();i++){
-
-		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
-
-		/*Check that this node corresponds to our analysis currently being carried out: */
-		if (node->InAnalysis(analysis_type)){
-
-			sid=node->Sid();
-			if (sid>max_sid)max_sid=sid;
-		}
-	}
-
-	ISSM_MPI_Reduce (&max_sid,&node_max_sid,1,ISSM_MPI_INT,ISSM_MPI_MAX,0,IssmComm::GetComm() );
-	ISSM_MPI_Bcast(&node_max_sid,1,ISSM_MPI_INT,0,IssmComm::GetComm());
-	max_sid=node_max_sid;
-
-	/*sid starts at 0*/
-	max_sid++;
-
-	/*return*/
-	return max_sid;
-}
-/*}}}*/
-void  Nodes::Ranks(int* ranks,int analysis_type){/*{{{*/
-
-	int my_rank;
-	int sid;
-
-	/*recover my_rank:*/
-	my_rank=IssmComm::GetRank();
-
-	/*Go through nodes, and for each object, report it cpu: */
-	for(int i=0;i<this->Size();i++){
-
-		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
-
-		/*Check that this node corresponds to our analysis currently being carried out: */
-		if (node->InAnalysis(analysis_type)){
-			/*Plug rank into ranks, according to sid: */
-			sid=node->Sid();
-			ranks[sid]=my_rank; 
-		}
-	}
-}
-/*}}}*/
-bool Nodes::RequiresDofReindexing(int analysis_type){/*{{{*/
+	return this->numberofnodes;
+}
+/*}}}*/
+int   Nodes::NumberOfNodesLocal(void){/*{{{*/
+
+	return this->numberofmasters_local;
+}
+/*}}}*/
+int   Nodes::NumberOfNodesLocalAll(void){/*{{{*/
+
+	return this->numberofnodes_local;
+}
+/*}}}*/
+bool  Nodes::RequiresDofReindexing(void){/*{{{*/
 
 	int flag = 0;
@@ -334,13 +374,8 @@
 	/*Now go through all nodes, and get how many dofs they own, unless they are clone nodes: */
 	for(int i=0;i<this->Size();i++){
-
-		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
-
-		/*Check that this node corresponds to our analysis currently being carried out: */
-		if(node->InAnalysis(analysis_type)){
-			if(node->RequiresDofReindexing()){
-				flag = 1;
-				break;
-			}
+		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
+		if(node->RequiresDofReindexing()){
+			flag = 1;
+			break;
 		}
 	}
@@ -353,2 +388,133 @@
 }
 /*}}}*/
+
+void  Nodes::CheckDofListAcrossPartitions(void){/*{{{*/
+
+	/*recover my_rank:*/
+	ISSM_MPI_Status status;
+	int my_rank   = IssmComm::GetRank();
+	int num_procs = IssmComm::GetSize();
+
+	/*Display message*/
+	if(VerboseModule()) _printf0_("   Checking degrees of freedom across partitions\n");
+
+	/*Allocate vector to check degrees of freedom*/
+	int gsize      = this->NumberOfDofs(GsetEnum);
+	int glocalsize = this->NumberOfDofsLocal(GsetEnum);
+	Vector<IssmDouble>* dofs_check=new Vector<IssmDouble>(glocalsize,gsize);
+
+	/*First, go over all nodes, and masters can write their f dof and -1 for s-set*/
+	for(int i=0;i<this->Size();i++){
+		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
+
+		/*Skip if clone (will check later)*/
+		if(node->IsClone()) continue;
+
+		/*Write degree of freedom if active*/
+		int count = 0;
+		for(int j=0;j<node->gsize;j++){
+			if(node->f_set[j]){
+				if(node->s_set[j]) _error_("a degree of freedom is both in f and s set!");
+				dofs_check->SetValue(node->gdoflist[j],reCast<IssmDouble>(node->fdoflist[count]),INS_VAL);
+				count++;
+			}
+			else{
+				if(node->s_set[j]==0) _error_("a degree of freedom is neither in f nor in s set!");
+				dofs_check->SetValue(node->gdoflist[j],-1.,INS_VAL);
+			}
+		}
+	}
+	dofs_check->Assemble();
+
+	/*Get local vector with both masters and slaves:*/
+	IssmDouble *local_dofs_check = NULL;
+	this->GetLocalVectorWithClonesGset(&local_dofs_check,dofs_check);
+	delete dofs_check;
+
+	/*Second, go over all nodes, and check that we still have what's expected...*/
+	for(int i=0;i<this->Size();i++){
+		Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(i));
+
+		/*Write degree of freedom if active*/
+		int countg = 0;
+		int countf = 0;
+		int counts = 0;
+		for(int j=0;j<node->gsize;j++){
+			int index = node->gdoflist_local[countg];
+			if(node->f_set[j]){
+				if(reCast<int>(local_dofs_check[index]) != node->fdoflist[countf]){
+					_error_("Dof #"<<j<<" of node sid "<<node->Sid()<<" not consistent: "<<local_dofs_check[index]<<"!="<<node->fdoflist[countf]);
+				}
+				countf++;
+			}
+			else{
+				if(local_dofs_check[index] != -1.){
+					_error_("Dof #"<<j<<" of node sid "<<node->Sid()<<" not consistently in s set");
+				}
+				counts++;
+			}
+			countg++;
+		}
+	}
+
+	/*cleanup and return*/
+	xDelete<IssmDouble>(local_dofs_check);
+}/*}}}*/
+void  Nodes::GetLocalVectorWithClonesGset(IssmDouble** plocal_ug,Vector<IssmDouble> *ug){/*{{{*/
+
+	/*recover my_rank:*/
+	ISSM_MPI_Status status;
+	int my_rank   = IssmComm::GetRank();
+	int num_procs = IssmComm::GetSize();
+
+	/*retrieve node info*/
+	int glocalsize         = this->NumberOfDofsLocalAll(GsetEnum);
+	int glocalsize_masters = this->NumberOfDofsLocal(GsetEnum);
+	int maxdofspernode     = this->MaxNumDofs(GsetEnum);
+
+	/*Get local vector of ug*/
+	int        *indices_ug_masters = NULL;
+	IssmDouble *local_ug_masters   = NULL;
+	ug->GetLocalVector(&local_ug_masters,&indices_ug_masters);
+	_assert_(glocalsize_masters==indices_ug_masters[glocalsize_masters-1] - indices_ug_masters[0]+1);
+	xDelete<int>(indices_ug_masters);
+
+	/*Now, extend vectors to account for clones (make vectors longer, for clones at the end)*/
+	IssmDouble *local_ug  = xNew<IssmDouble>(glocalsize);
+	xMemCpy<IssmDouble>(local_ug,local_ug_masters,glocalsize_masters);
+	xDelete<IssmDouble>(local_ug_masters);
+
+	/*Now send and receive ug for nodes on partition edge*/
+	#ifdef _HAVE_AD_
+	IssmDouble* buffer = xNew<IssmDouble>(this->Size()*maxdofspernode,"t"); //only one alloc, "t" is required by adolc
+	#else
+	IssmDouble* buffer = xNew<IssmDouble>(this->Size()*maxdofspernode);
+	#endif
+	for(int rank=0;rank<num_procs;rank++){
+		if(this->common_send[rank]){
+			int  numids = this->common_send[rank];
+			for(int i=0;i<numids;i++){
+				int   master_lid = this->common_send_ids[rank][i];
+				Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(master_lid));
+				_assert_(!node->IsClone());
+				for(int j=0;j<node->gsize;j++) buffer[i*maxdofspernode+j]=local_ug[node->gdoflist_local[j]];
+			}
+			ISSM_MPI_Send(buffer,numids*maxdofspernode,ISSM_MPI_DOUBLE,rank,0,IssmComm::GetComm());
+		}
+	}
+	for(int rank=0;rank<num_procs;rank++){
+		if(this->common_recv[rank]){
+			int  numids = this->common_recv[rank];
+			ISSM_MPI_Recv(buffer,numids*maxdofspernode,ISSM_MPI_DOUBLE,rank,0,IssmComm::GetComm(),&status);
+			for(int i=0;i<numids;i++){
+				int   master_lid = this->common_recv_ids[rank][i];
+				Node* node=xDynamicCast<Node*>(this->GetObjectByOffset(master_lid));
+				for(int j=0;j<node->gsize;j++) local_ug[node->gdoflist_local[j]] = buffer[i*maxdofspernode+j];
+			}
+		}
+	}
+	xDelete<IssmDouble>(buffer);
+
+	/*Assign output pointer*/
+	*plocal_ug = local_ug;
+}/*}}}*/
Index: /issm/trunk/src/c/classes/Nodes.h
===================================================================
--- /issm/trunk/src/c/classes/Nodes.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Nodes.h	(revision 24313)
@@ -3,4 +3,5 @@
 
 #include "../datastructures/datastructures.h"
+#include "../toolkits/toolkits.h"
 class Parameters;
 class Elements;
@@ -18,5 +19,13 @@
 class Nodes: public DataSet{
 
+	private:
+		int numberofnodes;
+		int numberofnodes_local;
+		int numberofmasters_local;
 	public:
+		int*  common_recv;
+		int** common_recv_ids;
+		int*  common_send;
+		int** common_send_ids;
 
 		/*constructors, destructors*/
@@ -24,16 +33,21 @@
 		~Nodes();
 
+		/*Objects virtual functions*/
+		Nodes* Copy();
+		void   Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
+
 		/*numerics*/
-		void  DistributeDofs(int analysis_type,int SETENUM);
-		void  FlagClones(int analysis_type);
-		int   MaximumId(void);
-		int   MaxNumDofs(int analysis_type,int setenum);
-		int   NumberOfDofs(int analysis_type,int setenum);
-		int   NumberOfDofsLocal(int analysis_type,int setenum);
-		int   NumberOfNodes(int analysis_type);
+		void  DistributeDofs(int SETENUM);
+		void  Finalize(void);
+		int   MaxNumDofs(int setenum);
+		int   NumberOfDofs(int setenum);
+		int   NumberOfDofsLocal(int setenum);
+		int   NumberOfDofsLocalAll(int setenum);
 		int   NumberOfNodes(void);
-		void  Ranks(int* ranks,int analysis_type);
-		bool  RequiresDofReindexing(int analysis_type);
-
+		int   NumberOfNodesLocal(void);
+		int   NumberOfNodesLocalAll(void);
+		bool  RequiresDofReindexing(void);
+		void  CheckDofListAcrossPartitions(void);
+		void  GetLocalVectorWithClonesGset(IssmDouble** plocal_vector,Vector<IssmDouble> *vector);
 };
 
Index: /issm/trunk/src/c/classes/Options/GenericOption.h
===================================================================
--- /issm/trunk/src/c/classes/Options/GenericOption.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Options/GenericOption.h	(revision 24313)
@@ -23,26 +23,16 @@
 
 	public:
-
 		char       *name;
 		OptionType  value;
-
-		int         numel;   //in case OptionType is an array
-		int         ndims;   //in case OptionType is a multi-dimensional array: */
-		int        *size;
+		int         size[2];
 
 		/*GenericOption constructors, destructors*/
 		GenericOption(){ /*{{{*/
-
-			name   = NULL;
-			numel  = 0;
-			ndims  = 0;
-			size   = NULL;
-
+			name = NULL;
+			size[0] = 0;
+			size[1] = 0;
 		} /*}}}*/
 		~GenericOption(){ /*{{{*/
-
-			if(name)   xDelete<char>(name);
-			if(size)   xDelete<int>(size);
-
+			if(name) xDelete<char>(name);
 		} /*}}}*/
 
@@ -52,28 +42,17 @@
 		};/*}}}*/
 		void DeepEcho(){ /*{{{*/
-
 			char  indent[81]="";
 			this->DeepEcho(indent);
-
 		} /*}}}*/
 		void DeepEcho(char* indent){ /*{{{*/
 
 			char  cstr[81];
-			bool  flag=true;
 
-			if(flag) _printf0_(indent << "         name: \"" << name << "\"\n");
-			if(flag) _printf0_(indent << "         numel: " << numel << "\n");
-			if(flag) _printf0_(indent << "         ndims: " << ndims << "\n");
-			if(size){
-				StringFromSize(cstr,size,ndims);
-				if(flag) _printf0_(indent << "          size: " << cstr << "\n");
-			}
-			else if(flag) _printf0_(indent << "          size: [empty]\n");
-			_printf_(indent << "         value: " << value << "\n");;
+			_printf_(indent << "          name: \"" << name << "\"\n");
+			_printf_(indent << "          size: " << size[0] <<"x"<<size[1]<< "\n");
+			_printf_(indent << "         value: " << value << "\n");
 		} /*}}}*/
 		void Echo(){ /*{{{*/
-
 			this->DeepEcho();
-
 		} /*}}}*/
 		int  Id(){/*{{{*/
@@ -91,13 +70,4 @@
 			return name;
 		};/*}}}*/
-		int   NDims(){/*{{{*/
-			return ndims;
-		};/*}}}*/
-		int   NumEl(){/*{{{*/
-			return numel;
-		};/*}}}*/
-		int*  Size(){/*{{{*/
-			return size;
-		};/*}}}*/
 };
 
@@ -107,6 +77,7 @@
 
 	/*Copy vector*/
-	IssmPDouble* outvalue=xNew<IssmPDouble>(this->NumEl());
-	for(int i=0;i<this->NumEl();i++) outvalue[i]=this->value[i];
+	int numel = this->size[0]*this->size[1];
+	IssmPDouble* outvalue=xNew<IssmPDouble>(numel);
+	for(int i=0;i<numel;i++) outvalue[i]=this->value[i];
 
 	/*Assign output pointer*/
@@ -117,6 +88,7 @@
 
 	/*Copy vector*/
-	IssmDouble* outvalue=xNew<IssmDouble>(this->NumEl());
-	for(int i=0;i<this->NumEl();i++) outvalue[i]=this->value[i];
+	int numel = this->size[0]*this->size[1];
+	IssmDouble* outvalue=xNew<IssmDouble>(numel);
+	for(int i=0;i<numel;i++) outvalue[i]=this->value[i];
 
 	/*Assign output pointer*/
@@ -135,8 +107,6 @@
 /*Special destructors when there is a pointer*/
 template <> inline GenericOption<char*>::~GenericOption(){ /*{{{*/
-
-	if(name)   xDelete<char>(name);
-	if(size)   xDelete<int>(size);
-	if(value)  xDelete<char>(value);
+	if(name)  xDelete<char>(name);
+	if(value) xDelete<char>(value);
 } 
 /*}}}*/
Index: /issm/trunk/src/c/classes/Options/Option.h
===================================================================
--- /issm/trunk/src/c/classes/Options/Option.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Options/Option.h	(revision 24313)
@@ -25,13 +25,10 @@
 		virtual void  Echo()= 0;
 		int           Id(){_error_("Not implemented yet"); };
-		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
-		int           ObjectEnum(){return OptionEnum;              };
+		void          Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
+		int           ObjectEnum(){return OptionEnum;};
 
 
 		/*virtual functions: */
 		virtual char* Name()=0;
-		virtual int   NDims()=0;
-		virtual int   NumEl()=0;
-		virtual int*  Size()=0;
 
 };
Index: /issm/trunk/src/c/classes/Params/Parameters.cpp
===================================================================
--- /issm/trunk/src/c/classes/Params/Parameters.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Params/Parameters.cpp	(revision 24313)
@@ -55,4 +55,13 @@
 }
 /*}}}*/
+int Parameters::EnumToIndex(int enum_in){/*{{{*/
+
+	/*Make sure this parameter is at the right place*/
+	#ifdef _ISSM_DEBUG_
+	if(enum_in<=ParametersSTARTEnum) _error_("Enum "<<EnumToStringx(enum_in)<<" should appear after ParametersSTARTEnum");
+	if(enum_in>=ParametersENDEnum)   _error_("Enum "<<EnumToStringx(enum_in)<<" should appear before ParametersENDEnum");
+	#endif
+	return enum_in - ParametersSTARTEnum -1;
+}/*}}}*/
 
 void Parameters::AddObject(Param* newparam){/*{{{*/
@@ -63,9 +72,5 @@
 
 	/*Get index in array*/
-	#ifdef _ISSM_DEBUG_
-	if(param_enum<=ParametersSTARTEnum) _error_("Cannot add param: Enum "<<EnumToStringx(param_enum)<<" should appear after ParametersSTARTEnum");
-	if(param_enum>=ParametersENDEnum)   _error_("Cannot add param: Enum "<<EnumToStringx(param_enum)<<" should appear before ParametersENDEnum");
-	#endif
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 
 	/*Delete param if it already exists*/
@@ -238,8 +243,5 @@
 void Parameters::Delete(int param_enum){/*{{{*/
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(this->params[index]){
 		delete this->params[index];
@@ -252,8 +254,5 @@
 bool Parameters::Exist(int param_enum){/*{{{*/
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(this->params[index]) return true;
 
@@ -263,8 +262,5 @@
 void Parameters::FindParam(bool* pbool,int param_enum){ _assert_(this);/*{{{*/
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
 	this->params[index]->GetParameterValue(pbool);
@@ -273,8 +269,5 @@
 void Parameters::FindParam(int* pinteger,int param_enum){ _assert_(this);/*{{{*/
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
 	this->params[index]->GetParameterValue(pinteger);
@@ -282,8 +275,5 @@
 /*}}}*/
 void Parameters::FindParam(IssmDouble* pscalar,int param_enum){ _assert_(this);/*{{{*/
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
 	this->params[index]->GetParameterValue(pscalar);
@@ -292,8 +282,5 @@
 void Parameters::FindParam(IssmDouble* pscalar, int param_enum,IssmDouble time){ _assert_(this);/*{{{*/
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
 	this->params[index]->GetParameterValue(pscalar,time);
@@ -302,8 +289,5 @@
 void Parameters::FindParam(IssmDouble* pscalar,int row,IssmDouble time, int param_enum){ _assert_(this);/*{{{*/
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
 	this->params[index]->GetParameterValue(pscalar,row,time);
@@ -312,8 +296,5 @@
 void Parameters::FindParam(char** pstring,int param_enum){ _assert_(this);/*{{{*/
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
 	this->params[index]->GetParameterValue(pstring);
@@ -323,8 +304,5 @@
 void Parameters::FindParam(char*** pstringarray,int* pM,int param_enum){ _assert_(this);/*{{{*/
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
 	this->params[index]->GetParameterValue(pstringarray,pM);
@@ -333,8 +311,5 @@
 void Parameters::FindParam(int** pintarray,int* pM, int param_enum){ _assert_(this);/*{{{*/
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
 	this->params[index]->GetParameterValue(pintarray,pM);
@@ -344,8 +319,5 @@
 void Parameters::FindParam(int** pintarray,int* pM,int *pN,int param_enum){ _assert_(this);/*{{{*/
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
 	this->params[index]->GetParameterValue(pintarray,pM,pN);
@@ -355,8 +327,5 @@
 void Parameters::FindParam(IssmDouble** pIssmDoublearray,int* pM, int param_enum){ _assert_(this);/*{{{*/
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
@@ -367,8 +336,5 @@
 void Parameters::FindParam(IssmDouble** pIssmDoublearray,int* pM, int* pN,int param_enum){ _assert_(this);/*{{{*/
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
 	this->params[index]->GetParameterValue(pIssmDoublearray,pM,pN);
@@ -377,8 +343,5 @@
 void Parameters::FindParam(IssmDouble*** parray,int* pM,int** pmdims_array,int** pndims_array,int param_enum){ _assert_(this);/*{{{*/
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
 	this->params[index]->GetParameterValue(parray,pM,pmdims_array,pndims_array);
@@ -387,8 +350,5 @@
 void Parameters::FindParam(Vector<IssmDouble>** pvec,int param_enum){ _assert_(this);/*{{{*/
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
 	this->params[index]->GetParameterValue(pvec);
@@ -397,8 +357,5 @@
 void Parameters::FindParam(Matrix<IssmDouble>** pmat,int param_enum){ _assert_(this);/*{{{*/
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
 	this->params[index]->GetParameterValue(pmat);
@@ -407,8 +364,5 @@
 void Parameters::FindParam(FILE** pfid,int param_enum){ _assert_(this);/*{{{*/
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
 	this->params[index]->GetParameterValue(pfid);
@@ -418,8 +372,5 @@
 	_assert_(this);
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
 	this->params[index]->GetParameterValue(pdataset);
@@ -427,10 +378,8 @@
 /*}}}*/
 void Parameters::FindParamAndMakePassive(IssmPDouble* pscalar,int param_enum){ _assert_(this);/*{{{*/
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
 
 	/*Get "active" parameter*/
 	IssmDouble intermediary;
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
 	this->params[index]->GetParameterValue(&intermediary);
@@ -442,8 +391,5 @@
 void Parameters::FindParamAndMakePassive(IssmPDouble** pvec,int* pM, int param_enum){ _assert_(this);/*{{{*/
 
-	_assert_(param_enum>ParametersSTARTEnum);
-	_assert_(param_enum<ParametersENDEnum);
-
-	int index = param_enum - ParametersSTARTEnum -1;
+	int index = EnumToIndex(param_enum);
 
 	/*Output*/
@@ -465,8 +411,5 @@
 	_assert_(this);
 
-	_assert_(dataset_type>ParametersSTARTEnum);
-	_assert_(dataset_type<ParametersENDEnum);
-
-	int index = dataset_type - ParametersSTARTEnum -1;
+	int index = EnumToIndex(dataset_type);
 	if(!this->params[index]) _error_("Parameter " << EnumToStringx(dataset_type) <<" not set");
 	if(this->params[index]->ObjectEnum()!=DataSetParamEnum) _error_("Parameter " << EnumToStringx(dataset_type) <<" is not a DataSetParam!");
@@ -485,4 +428,14 @@
 }
 /*}}}*/
+IssmDouble Parameters::FindParam(int param_enum){ _assert_(this);/*{{{*/
+
+	int index = EnumToIndex(param_enum);
+	if(!this->params[index]) _error_("Parameter " << EnumToStringx(param_enum) <<" not set");
+
+	IssmDouble value;
+	this->params[index]->GetParameterValue(&value);
+	return value;
+}
+/*}}}*/
 
 void   Parameters::SetParam(bool boolean,int enum_type){/*{{{*/
@@ -514,5 +467,4 @@
 	/*first, figure out if the param has already been created: */
 	param=xDynamicCast<Param*>(this->FindParamObject(enum_type));
-
 	if(param) param->SetValue(scalar); //already exists, just set it.
 	else this->AddObject(new DoubleParam(enum_type,scalar)); //just add the new parameter.
@@ -636,11 +588,5 @@
 Param* Parameters::FindParamObject(int param_enum){/*{{{*/
 
-	#ifdef _ISSM_DEBUG_
-	if(param_enum<=ParametersSTARTEnum) _error_("Cannot find param: Enum "<<EnumToStringx(param_enum)<<" should appear after ParametersSTARTEnum");
-	if(param_enum>=ParametersENDEnum)   _error_("Cannot find param: Enum "<<EnumToStringx(param_enum)<<" should appear before ParametersENDEnum");
-	#endif
-
-	int index = param_enum - ParametersSTARTEnum -1;
-	return this->params[index];
+	return this->params[EnumToIndex(param_enum)];
 }
 /*}}}*/
Index: /issm/trunk/src/c/classes/Params/Parameters.h
===================================================================
--- /issm/trunk/src/c/classes/Params/Parameters.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Params/Parameters.h	(revision 24313)
@@ -20,4 +20,5 @@
 	private:
 		Param* params[NUMPARAMS];
+		int    EnumToIndex(int enum_in);
 
 	public:
@@ -55,4 +56,5 @@
 		void  FindParamAndMakePassive(IssmPDouble** pvec,int* pM,int enum_type);
 		void  FindParamInDataset(IssmDouble** pIssmDoublearray,int* pM,int* pN,int dataset_type,int enum_type);
+		IssmDouble FindParam(int enum_type);
 
 		void  SetParam(bool boolean,int enum_type);
Index: /issm/trunk/src/c/classes/Profiler.h
===================================================================
--- /issm/trunk/src/c/classes/Profiler.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Profiler.h	(revision 24313)
@@ -27,5 +27,7 @@
 #define ESACORE				14 /*Profiling ESA */
 #define SLRCORE				15 /*Profiling SLR */
-#define MAXPROFSIZE			16 /*Used to initialize static arrays*/
+#define MPISERIAL				16 /*Profiling MPISerial */
+#define MAXPROFSIZE			17 /*Used to initialize static arrays*/
+
 
 class Profiler: public Object{
Index: /issm/trunk/src/c/classes/Radar.cpp
===================================================================
--- /issm/trunk/src/c/classes/Radar.cpp	(revision 24313)
+++ /issm/trunk/src/c/classes/Radar.cpp	(revision 24313)
@@ -0,0 +1,277 @@
+/*!\file Radar.cpp
+ * \brief: Radar Object
+ */
+
+/*Headers:*/
+#ifdef HAVE_CONFIG_H
+   #include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+#include "./classes.h"
+#include "./Elements/Element.h"
+#include "./Elements/Elements.h"
+#include "./ExternalResults/ExternalResult.h"
+#include "./ExternalResults/Results.h"
+#include "../datastructures/datastructures.h"
+#include "./FemModel.h"
+#include "../classes/Params/Parameters.h"
+#include "../classes/Inputs/Input.h"
+#include "../classes/gauss/Gauss.h"
+#include "./Radar.h"
+
+/*Element macros*/
+#define NUMVERTICES   6
+#define NUMVERTICES2D 3
+
+/*Radar constructors, destructors :*/
+Radar::Radar(){/*{{{*/
+	this->definitionenum = -1;
+	this->name = NULL;
+}
+/*}}}*/
+Radar::Radar(char* in_name, int in_definitionenum){/*{{{*/	
+	this->definitionenum=in_definitionenum;
+	this->name		= xNew<char>(strlen(in_name)+1);
+	xMemCpy<char>(this->name,in_name,strlen(in_name)+1);
+}
+/*}}}*/
+Radar::~Radar(){/*{{{*/
+	if(this->name)xDelete(this->name);
+}
+/*}}}*/
+/*Object virtual function resolution: */
+Object* Radar::copy() {/*{{{*/
+	Radar* out =new Radar(this->name,this->definitionenum);
+	return (Object*)out;
+}
+/*}}}*/
+void Radar::DeepEcho(void){/*{{{*/
+	this->Echo();
+}
+/*}}}*/
+void Radar::Echo(void){/*{{{*/
+	_printf_(" Radar: " << name << " " << this->definitionenum << "\n");
+}
+/*}}}*/
+int Radar::Id(void){/*{{{*/
+	return -1;
+}
+/*}}}*/
+void Radar::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
+	_error_("not implemented yet!"); 
+} 
+/*}}}*/
+int Radar::ObjectEnum(void){/*{{{*/
+	return RadarEnum;
+}
+/*}}}*/
+/*Definition virtual function resolutoin: */
+int Radar::DefinitionEnum(){/*{{{*/
+	return this->definitionenum;
+}
+/*}}}*/
+char* Radar::Name(){/*{{{*/
+	char* name2=xNew<char>(strlen(this->name)+1);
+	xMemCpy(name2,this->name,strlen(this->name)+1);
+	return name2;
+}
+/*}}}*/
+IssmDouble Radar::Response(FemModel* femmodel){/*{{{*/	
+	int i; 
+	for(i=0;i<femmodel->elements->Size();i++){
+		Element* element=(Element*)femmodel->elements->GetObjectByOffset(i);
+		this->ComputeRadarAttenuation(element);
+		this->ComputeRadarPower(element); 
+	}
+	return 0.;
+}
+	/*}}}*/
+void Radar::ComputeRadarAttenuation(Element* element){/*{{{*/
+	//int         numvertices = element->GetNumberOfVertices();
+	IssmDouble  eps0=8.85418782e-12;
+	IssmDouble  eps_ice=3.17;
+	IssmDouble  e=2.7183;
+	IssmDouble  c=299792458;
+	IssmDouble  k=1.3806488e-23;
+	IssmDouble  eVtoJ=1.6e-19;
+	IssmDouble  Tr_M07=252.1500;
+	IssmDouble  Tr_W97=258.1500;
+	IssmDouble  sig_ice_M07=9.2;
+	IssmDouble  sig_ice_W97=9;
+	IssmDouble  cond_H_M07=3.2;
+	IssmDouble  cond_H_W97=4;
+	IssmDouble  cond_Cl_M07=0.43;
+	IssmDouble  cond_Cl_W97=0.55;
+	IssmDouble  cond_NH_M07=0.8;
+	IssmDouble  cond_NH_W97=1;
+	IssmDouble  E_M07=8.1600e-20;
+	IssmDouble  E_W97=9.2800e-20;
+	IssmDouble  E_H_M07=3.2000e-20;
+	IssmDouble  E_H_W97=3.3600e-20;
+	IssmDouble  E_Cl_M07=3.0400e-20;
+	IssmDouble  E_Cl_W97=3.6800e-20;
+	IssmDouble  E_NH=3.6800e-20;
+	IssmDouble  mol_H_hol=1.6; 
+	IssmDouble  mol_H_lgp=0.2; 
+	IssmDouble  mol_Cl_hol=0.4; 
+	IssmDouble  mol_Cl_lgp=1.8; 
+	IssmDouble  mol_NH_hol=0.5;
+	IssmDouble  mol_NH_lgp=0.4; 
+	IssmDouble  mol_H, mol_Cl, mol_NH;
+	IssmDouble  attenuation_rate_macgregor[NUMVERTICES];
+	IssmDouble  attenuation_rate_wolff[NUMVERTICES];
+	IssmDouble  temperature, ice_period, attenuation_rate_M07_pureice, attenuation_rate_M07_H, attenuation_rate_M07_Cl, attenuation_rate_M07_NH;
+	IssmDouble  attenuation_rate_W97_pureice, attenuation_rate_W97_H, attenuation_rate_W97_Cl, attenuation_rate_W97_NH;
+	IssmDouble  m1, m2, m3, m4, m5, m6, m7, m8;
+	IssmDouble  w2, w3, w4, w5, w6, w7, w8;
+	GaussPenta* gauss=NULL;
+
+	/*Retrieve all inputs we will be needing: */
+	Input* temp_input=element->GetInput(TemperatureEnum); _assert_(temp_input);
+	Input* ice_period_input=element->GetInput(RadarIcePeriodEnum); _assert_(ice_period_input); 
+
+	/* Start looping on the number of vertices: */
+	gauss=new GaussPenta();
+
+	for (int iv=0;iv<NUMVERTICES;iv++){
+		gauss->GaussVertex(iv);
+   
+		/*Get ice temperature: */
+		temp_input->GetInputValue(&temperature,gauss);
+		ice_period_input->GetInputValue(&ice_period,gauss);
+
+		if(ice_period>0){; 
+			mol_H=mol_H_hol;
+			mol_Cl=mol_Cl_hol;
+			mol_NH=mol_NH_hol;
+			}
+		else{ 
+			mol_H=mol_H_lgp;
+			mol_Cl=mol_Cl_lgp; 
+			mol_NH=mol_NH_lgp;
+		}
+
+		/*Compute M07 radar conductivity constant: */
+		m1=(10*log10(e))/(1000*eps0*sqrt(eps_ice)*c);
+		m2=E_M07/k;
+		m3=cond_H_M07*mol_H;
+		m4=E_H_M07/k;
+		m5=cond_Cl_M07*mol_Cl;
+		m6=E_Cl_M07/k;
+		m7=cond_NH_M07*mol_NH;
+		m8=E_NH/k;
+
+		/*Compute MacGregor (M07) attenuation rate: */
+		attenuation_rate_M07_pureice=m1*sig_ice_M07*exp(m2*((1/Tr_M07)-(1/temperature)));
+		attenuation_rate_M07_H=m3*exp(m4*((1/Tr_M07)-(1/temperature)));
+		attenuation_rate_M07_Cl=m5*exp(m6*((1/Tr_M07)-(1/temperature)));
+		attenuation_rate_M07_NH=m7*exp(m8*((1/Tr_M07)-(1/temperature)));
+		attenuation_rate_macgregor[iv]=attenuation_rate_M07_pureice+attenuation_rate_M07_H+attenuation_rate_M07_Cl+attenuation_rate_M07_NH;
+
+	   /*Compute Wolff (W97) radar conductivity constant: */
+		w2=E_W97/k;
+		w3=cond_H_W97*mol_H;
+		w4=E_H_W97/k;
+		w5=cond_Cl_W97*mol_Cl;
+		w6=E_Cl_W97/k;
+		w7=cond_NH_W97*mol_NH;
+		w8=E_NH/k;
+
+		/*Compute Wolff attenuation rate: */
+		attenuation_rate_W97_pureice=m1*sig_ice_W97*exp(w2*((1/Tr_W97)-(1/temperature)));
+		attenuation_rate_W97_H=w3*exp(w4*((1/Tr_W97)-(1/temperature)));
+		attenuation_rate_W97_Cl=w5*exp(w6*((1/Tr_W97)-(1/temperature)));
+		attenuation_rate_W97_NH=w7*exp(w8*((1/Tr_W97)-(1/temperature)));
+		attenuation_rate_wolff[iv]=attenuation_rate_W97_pureice+attenuation_rate_W97_H+attenuation_rate_W97_Cl+attenuation_rate_W97_NH;
+	}
+
+		/*Add Attenuation rate results into inputs*/
+	   element->AddInput(new PentaInput(RadarAttenuationMacGregorEnum,&attenuation_rate_macgregor[0],P1Enum));
+		element->AddInput(new PentaInput(RadarAttenuationWolffEnum,&attenuation_rate_wolff[0],P1Enum));
+
+		/*Clean up*/
+		delete gauss;
+
+}/*}}}*/
+void Radar::ComputeRadarPower(Element* element){/*{{{*/
+
+	IssmDouble  *xyz_list=NULL;
+	IssmDouble  power_M07[NUMVERTICES];
+	IssmDouble  power_W97[NUMVERTICES];
+	IssmDouble  depth[NUMVERTICES];
+	IssmDouble  aircraft_elev=0.5;
+	IssmDouble  eps_ice=3.15;
+	IssmDouble  t_tp=273.15;         /* triple point temperature [K] */
+	IssmDouble  p_tp=611.73;         /* water pressure [Pa] */
+	IssmDouble  gamma=7.4200e-07; /* Clausius-Clapeyron constant [K/kPa] */
+	IssmDouble  attenuation_rate_macgregor, attenuation_rate_wolff, attenuation_total_M07, attenuation_total_W97;
+	IssmDouble  thickness, surface, z, temperature, geometric_loss, reflectivity;
+	IssmDouble  rho_ice, gravity, pressure, pressure_melting_pt, frozen_temp, basal_temp, basal_pmp;
+	GaussPenta* gauss=NULL;
+	
+	/* Get node coordinates*/
+	element->GetVerticesCoordinates(&xyz_list);
+	Input* atten_input_M07=element->GetInput(RadarAttenuationMacGregorEnum); _assert_(atten_input_M07);
+	Input* atten_input_W97=element->GetInput(RadarAttenuationWolffEnum); _assert_(atten_input_W97);
+	Input* surf_input=element->GetInput(SurfaceEnum); _assert_(surf_input);
+	Input* thick_input=element->GetInput(ThicknessEnum); _assert_(thick_input);
+	Input* temp_input=element->GetInput(TemperatureEnum); _assert_(temp_input);
+
+	/* Start looping on the number of vertices: */
+	gauss=new GaussPenta();
+	for (int iv=0;iv<NUMVERTICES;iv++){
+			gauss->GaussVertex(iv);
+
+			/*Get all the inputs: */
+			atten_input_M07->GetInputValue(&attenuation_rate_macgregor,gauss);
+			atten_input_W97->GetInputValue(&attenuation_rate_wolff,gauss);
+			thick_input->GetInputValue(&thickness,gauss);
+			temp_input->GetInputValue(&temperature,gauss);
+			surf_input->GetInputValue(&surface,gauss);
+
+			/*Compute depth below the ice surface: */
+			z=xyz_list[3*iv+2];
+			depth[iv]=(surface-z)/1e3;
+
+			/*Compute total attenuation: */
+			attenuation_total_M07=attenuation_rate_macgregor*depth[iv];
+			attenuation_total_W97=attenuation_rate_wolff*depth[iv];
+
+			/*Compute geometric loss: */
+			geometric_loss=10*log10((depth[iv]+aircraft_elev)/sqrt(eps_ice));
+
+			/*Compute radar power: */
+			power_M07[iv]=-geometric_loss-attenuation_total_M07;
+			power_W97[iv]=-geometric_loss-attenuation_total_W97;
+
+			/*Identify basal elements: */
+			if(element->IsOnBase() && iv<NUMVERTICES2D){
+
+				/*Compute pressure melting point: */
+				rho_ice=element->FindParam(MaterialsLatentheatEnum);
+				gravity=element->FindParam(ConstantsGEnum);
+				pressure=rho_ice*gravity*thickness;
+				pressure_melting_pt=t_tp-gamma*(pressure-p_tp);
+				
+				if((temperature-pressure_melting_pt)<=-1){
+					reflectivity=-40;
+					}
+				else if((temperature-pressure_melting_pt)>-1 && (temperature-pressure_melting_pt)<0){
+					reflectivity=0;
+					}
+				else{
+					reflectivity=70;
+					}
+				power_M07[iv]=power_M07[iv]+reflectivity;
+				power_W97[iv]=power_W97[iv]+reflectivity;
+			}
+		}
+
+	    /*Add power results into inputs*/
+			element->AddInput(new PentaInput(RadarPowerMacGregorEnum,&power_M07[0],P1Enum));
+			element->AddInput(new PentaInput(RadarPowerWolffEnum,&power_W97[0],P1Enum));
+
+		/*Clean up and return*/
+		delete gauss;
+}/*}}}*/
Index: /issm/trunk/src/c/classes/Radar.h
===================================================================
--- /issm/trunk/src/c/classes/Radar.h	(revision 24313)
+++ /issm/trunk/src/c/classes/Radar.h	(revision 24313)
@@ -0,0 +1,41 @@
+/*!\file Radar.h
+ * \brief: header file for Radar object
+ */
+
+#ifndef _RADAR_H_
+#define _RADAR_H_
+
+/*Headers:*/
+#include "./Definition.h"
+#include "./FemModel.h"
+
+IssmDouble OutputDefinitionsResponsex(FemModel* femmodel,int output_enum);
+void  GetVectorFromInputsx( IssmDouble** pvector, int* pvector_size, FemModel* femmodel,int name);
+
+class Radar: public Object, public Definition{
+
+	public: 
+		char* name;
+		int	definitionenum;
+		
+		/*Radar constructors, destructors :*/
+		Radar();
+		Radar(char* in_name, int in_definitionenum);
+		~Radar();
+		
+		/*Object virtual function resolutoin: */
+		Object* copy();
+		void DeepEcho(void);
+		void Echo(void);
+		int Id(void);
+		void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
+		int ObjectEnum(void);
+		
+		/*Definition virtual function resolutoin: */
+		int DefinitionEnum();
+		char* Name();
+		IssmDouble Response(FemModel* femmodel);
+		void ComputeRadarAttenuation(Element* element);
+		void ComputeRadarPower(Element* element);
+};
+#endif  /* _RADAR_H_ */
Index: sm/trunk/src/c/classes/Update.h
===================================================================
--- /issm/trunk/src/c/classes/Update.h	(revision 24312)
+++ 	(revision )
@@ -1,28 +1,0 @@
-/*!\file: Update.h: abstract class used by some objects to update their properties
- * \brief prototypes for Update.h
- */ 
-
-#ifndef _UPDATE_H_
-#define  _UPDATE_H_
-
-/*Headers:*/
-#include "../shared/shared.h"
-class IoModel;
-
-class Update{
-
-	public:
-
-		virtual void  InputUpdateFromConstant(IssmDouble constant, int name)=0;
-		virtual void  InputUpdateFromConstant(int constant, int name)=0;
-		virtual void  InputUpdateFromConstant(bool constant, int name)=0;
-		#ifdef _HAVE_DAKOTA_
-		virtual void  InputUpdateFromMatrixDakota(IssmDouble* matrix, int rows, int ncols, int name, int type)=0;
-		virtual void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type)=0;
-		#endif
-		virtual void  InputUpdateFromIoModel(int index, IoModel* iomodel)=0;
-		virtual void  InputUpdateFromVector(IssmDouble* vector, int name, int type)=0;
-
-};
-
-#endif //ifndef _UPDATE_H_
Index: /issm/trunk/src/c/classes/Vertex.cpp
===================================================================
--- /issm/trunk/src/c/classes/Vertex.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Vertex.cpp	(revision 24313)
@@ -20,44 +20,61 @@
 }
 /*}}}*/
-Vertex::Vertex(int vertex_id, int vertex_sid,int vertex_lid,int i, IoModel* iomodel){/*{{{*/
-
-	this->id           = vertex_id;
-	this->sid          = vertex_sid;
-	this->pid          = UNDEF;
-	this->lid          = vertex_lid;
-
-	_assert_(iomodel->Data("md.mesh.x") && iomodel->Data("md.mesh.y") && iomodel->Data("md.mesh.z"));
-	this->x            = iomodel->Data("md.mesh.x")[i];
-	this->y            = iomodel->Data("md.mesh.y")[i];
-	this->z            = iomodel->Data("md.mesh.z")[i];
-	this->domaintype     = iomodel->domaintype;
-
-	if(iomodel->Data("md.mesh.lat") && iomodel->Data("md.mesh.long")){
-		this->latitute     = iomodel->Data("md.mesh.lat")[i];
-		this->longitude    = iomodel->Data("md.mesh.long")[i];
-	}
-
-	switch(iomodel->domaintype){
-		case Domain3DEnum:
-			_assert_(iomodel->Data("md.geometry.base") && iomodel->Data("md.geometry.thickness"));
-			this->sigma = (iomodel->Data("md.mesh.z")[i]-iomodel->Data("md.geometry.base")[i])/(iomodel->Data("md.geometry.thickness")[i]);
-			break;
-		case Domain3DsurfaceEnum:
-			_assert_(iomodel->Data("md.mesh.lat") && iomodel->Data("md.mesh.long") && iomodel->Data("md.mesh.r"));
-			this->latitute     = iomodel->Data("md.mesh.lat")[i];
-			this->longitude    = iomodel->Data("md.mesh.long")[i];
-			this->R            = iomodel->Data("md.mesh.r")[i];
-			break;
-		case Domain2DhorizontalEnum:
-			this->sigma = 0.;
-			break;
-		case Domain2DverticalEnum:
-			_assert_(iomodel->Data("md.geometry.base") && iomodel->Data("md.geometry.thickness"));
-			this->sigma = (iomodel->Data("md.mesh.y")[i]-iomodel->Data("md.geometry.base")[i])/(iomodel->Data("md.geometry.thickness")[i]);
-			break;
-	}
-
+Vertex::Vertex(int vertex_id, int vertex_sid,bool vertex_clone, IoModel* iomodel,bool isamr){/*{{{*/
+
+	/*Checks in debugging mode*/
+	_assert_(vertex_sid>=0 && vertex_sid<iomodel->numberofvertices);
+
+	/*IDs*/
+	this->id    = vertex_id;
+	this->sid   = vertex_sid;
+	this->pid   = -1; /*Assigned later*/
+	this->lid   = -1; /*Assigned later*/
+	this->clone = vertex_clone;
+
+	/*Properties from iomodel*/
 	_assert_(iomodel->numbernodetoelementconnectivity);
-	this->connectivity = iomodel->numbernodetoelementconnectivity[i];
+	this->connectivity = iomodel->numbernodetoelementconnectivity[vertex_sid];
+	this->domaintype   = iomodel->domaintype;
+
+	/*Coordinates, only if not AMR*/
+	if(!isamr){
+		_assert_(iomodel->Data("md.mesh.x") && iomodel->Data("md.mesh.y") && iomodel->Data("md.mesh.z"));
+		this->x            = iomodel->Data("md.mesh.x")[vertex_sid];
+		this->y            = iomodel->Data("md.mesh.y")[vertex_sid];
+		this->z            = iomodel->Data("md.mesh.z")[vertex_sid];
+		if(iomodel->Data("md.mesh.lat") && iomodel->Data("md.mesh.long")){
+			this->latitute     = iomodel->Data("md.mesh.lat")[vertex_sid];
+			this->longitude    = iomodel->Data("md.mesh.long")[vertex_sid];
+		}
+
+		switch(iomodel->domaintype){
+			case Domain3DEnum:
+				_assert_(iomodel->Data("md.geometry.base") && iomodel->Data("md.geometry.thickness"));
+				this->sigma = (iomodel->Data("md.mesh.z")[vertex_sid]-iomodel->Data("md.geometry.base")[vertex_sid])/(iomodel->Data("md.geometry.thickness")[vertex_sid]);
+				break;
+			case Domain3DsurfaceEnum:
+				_assert_(iomodel->Data("md.mesh.lat") && iomodel->Data("md.mesh.long") && iomodel->Data("md.mesh.r"));
+				this->latitute     = iomodel->Data("md.mesh.lat")[vertex_sid];
+				this->longitude    = iomodel->Data("md.mesh.long")[vertex_sid];
+				this->R            = iomodel->Data("md.mesh.r")[vertex_sid];
+				break;
+			case Domain2DhorizontalEnum:
+				this->sigma = 0.;
+				break;
+			case Domain2DverticalEnum:
+				_assert_(iomodel->Data("md.geometry.base") && iomodel->Data("md.geometry.thickness"));
+				this->sigma = (iomodel->Data("md.mesh.y")[vertex_sid]-iomodel->Data("md.geometry.base")[vertex_sid])/(iomodel->Data("md.geometry.thickness")[vertex_sid]);
+				break;
+		}
+	}
+	else{
+		this->x         = 0.;
+		this->y         = 0.;
+		this->z         = 0.;
+		this->latitute  = 0.;
+		this->longitude = 0.;
+		this->R         = 0.;
+		this->sigma     = 0.;
+	}
 
 }/*}}}*/
@@ -121,20 +138,4 @@
 int        Vertex::Connectivity(void){return connectivity;}/*{{{*/
 /*}}}*/
-void       Vertex::DistributePids(int* ppidcount){/*{{{*/
-
-	/*retrieve current pid*/
-	int pidcount=*ppidcount;
-
-	/*This vertex is a clone! Don't distribute pids, it will get them from another cpu!*/
-	if(this->clone) return;
-
-	/*This vertex should distribute its pid*/
-	this->pid=pidcount;
-	pidcount++;
-
-	/*Assign output pointers: */
-	*ppidcount=pidcount;
-}
-/*}}}*/
 IssmDouble Vertex::GetLatitude(){/*{{{*/
 	return this->latitute;
@@ -161,55 +162,9 @@
 }
 /*}}}*/
-void       Vertex::OffsetPids(int pidcount){/*{{{*/
-
-	/*This vertex is a clone, don't offset the pids*/
-	if(this->clone) return;
-
-	/*This vertex should offset his pid, go ahead: */
-	this->pid+=pidcount;
-}
-/*}}}*/
 int        Vertex::Pid(void){ return pid; }/*{{{*/
 /*}}}*/
 int        Vertex::Lid(void){ return lid; }/*{{{*/
 /*}}}*/
-void       Vertex::SetClone(int* minranks){/*{{{*/
-
-	int my_rank;
-
-	/*recover my_rank:*/
-	my_rank=IssmComm::GetRank();
-
-	if (minranks[this->sid]==my_rank){
-		this->clone=false;
-	}
-	else{
-		/*!there is a cpu with lower rank that has the same vertex, 
-		therefore, I am a clone*/
-		this->clone=true;
-	}
-
-}
-/*}}}*/
-void       Vertex::ShowTruePids(int* truepids){/*{{{*/
-
-	/*Are we a clone? : */
-	if(this->clone)return;
-
-	/*Ok, we are not a clone, just plug our pid into truepids: */
-	truepids[this->sid]=this->pid;
-}
-/*}}}*/
 int        Vertex::Sid(void){ return sid; }/*{{{*/
-/*}}}*/
-void       Vertex::UpdateClonePids(int* alltruepids){/*{{{*/
-
-	/*If we are not a clone, don't update, we already have pids: */
-	if(!this->clone)return;
-
-	/*Ok, we are a clone node, but we did not create the pid for this vertex 
-	 * Therefore, our pid is garbage right now. Go pick it up in the alltruepids: */
-	this->pid=alltruepids[this->sid];
-}
 /*}}}*/
 void       Vertex::UpdatePosition(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz,Parameters* parameters,IssmDouble* surface,IssmDouble* bed){/*{{{*/
@@ -250,5 +205,5 @@
 void       Vertex::VertexCoordinates(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz, bool spherical){/*{{{*/
 
-	if (this->clone==true) return;
+	if(this->clone==true) return;
 
 	if(!spherical){
Index: /issm/trunk/src/c/classes/Vertex.h
===================================================================
--- /issm/trunk/src/c/classes/Vertex.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Vertex.h	(revision 24313)
@@ -37,5 +37,5 @@
 		/*Vertex constructors, destructors {{{*/
 		Vertex();
-		Vertex(int id, int sid,int lid,int i, IoModel* iomodel);
+		Vertex(int id, int sid,bool clone, IoModel* iomodel,bool isamr);
 		~Vertex();
 		/*}}}*/
@@ -51,5 +51,4 @@
 		/*Vertex management:*/ 
 		int        Connectivity(void); 
-		void       DistributePids(int* ppidcount);
 		IssmDouble GetLatitude(void); 
 		IssmDouble GetLongitude(void); 
@@ -58,11 +57,7 @@
 		IssmDouble GetY(void); 
 		IssmDouble GetZ(void); 
-		void       OffsetPids(int pidcount);
 		int        Pid(void); 
 		int        Lid(void); 
-		void       SetClone(int* minranks);
-		void       ShowTruePids(int* borderpids);
 		int        Sid(void); 
-		void       UpdateClonePids(int* allborderpids);
 		void       UpdatePosition(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed);
 		void       VertexCoordinates(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz,bool spherical=false);
Index: /issm/trunk/src/c/classes/Vertices.cpp
===================================================================
--- /issm/trunk/src/c/classes/Vertices.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/Vertices.cpp	(revision 24313)
@@ -25,9 +25,29 @@
 /*Object constructors and destructor*/
 Vertices::Vertices(){/*{{{*/
-	enum_type=VerticesEnum;
+	this->enum_type              = VerticesEnum;
+	this->common_recv            = NULL;
+	this->common_recv_ids        = NULL;
+	this->common_send            = NULL;
+	this->common_send_ids        = NULL;
+	this->numberofvertices       = -1;
+	this->numberofvertices_local = -1;
+	this->numberofmasters_local  = -1;
 	return;
 }
 /*}}}*/
 Vertices::~Vertices(){/*{{{*/
+
+	int num_proc=IssmComm::GetSize();
+
+	if(this->common_recv) xDelete<int>(common_recv);
+	if(this->common_send) xDelete<int>(common_send);
+	if(this->common_recv_ids){
+		for(int i=0;i<num_proc;i++) if(common_recv_ids[i]) xDelete<int>(common_recv_ids[i]);
+		xDelete<int*>(common_recv_ids);
+	}
+	if(this->common_send_ids){
+		for(int i=0;i<num_proc;i++) if(common_send_ids[i]) xDelete<int>(common_send_ids[i]);
+		xDelete<int*>(common_send_ids);
+	}
 	return;
 }
@@ -35,147 +55,80 @@
 
 /*Numerics management*/
-void  Vertices::DistributePids(int numberofobjects){/*{{{*/
-
-	int num_procs;
-	int my_rank;
-
-	int  i;
-	int  pidcount    = 0;
-	int *allpidcount = NULL;
-	int *truepids    = NULL;
-	int *alltruepids = NULL;
-
-	/*recover my_rank:*/
-	my_rank=IssmComm::GetRank();
-	num_procs=IssmComm::GetSize();
-
-	/*Go through objects, and distribute pids locally, from 0 to numberofpidsperobject*/
-	for (i=0;i<this->Size();i++){
-		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
-		vertex->DistributePids(&pidcount);
-	}
-
-	/* Now every object has distributed pids, but locally, and with a pid count starting from 
-	 * 0. This means the pids between all the cpus are not unique. We now offset the pids of each
-	 * cpus by the total last pids of the previus cpu, starting from 0.
-	 * First: get number of pids for each cpu*/
-	allpidcount=xNew<int>(num_procs);
-	ISSM_MPI_Gather(&pidcount,1,ISSM_MPI_INT,allpidcount,1,ISSM_MPI_INT,0,IssmComm::GetComm());
-	ISSM_MPI_Bcast(allpidcount,num_procs,ISSM_MPI_INT,0,IssmComm::GetComm());
-
-	/* Every cpu should start its own pid count at the end of the pidcount from cpu-1*/
-	pidcount=0;
-	if(my_rank!=0){
-		for(i=0;i<my_rank;i++){
-			pidcount+=allpidcount[i];
-		}
-	}
-	for (i=0;i<this->Size();i++){
-		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
-		vertex->OffsetPids(pidcount);
-	}
-
-	/* Finally, remember that cpus may have skipped some objects, because they were clones. For every 
-	 * object that is not a clone, tell them to show their pids, so that later on, they can get picked 
-	 * up by their clones: */
-	truepids   =xNewZeroInit<int>(numberofobjects);
-	alltruepids=xNewZeroInit<int>(numberofobjects);
-	for (i=0;i<this->Size();i++){
-		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
-		vertex->ShowTruePids(truepids);
-	}
-	ISSM_MPI_Allreduce((void*)truepids,(void*)alltruepids,numberofobjects,ISSM_MPI_INT,ISSM_MPI_MAX,IssmComm::GetComm());
-
-	/* Now every cpu knows the true pids of everyone else that is not a clone*/
-	for(i=0;i<this->Size();i++){
-		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
-		vertex->UpdateClonePids(alltruepids);
-	}
-
-	/* Free ressources: */
-	xDelete<int>(allpidcount);
-	xDelete<int>(truepids);
-	xDelete<int>(alltruepids);
-}
-/*}}}*/
-void  Vertices::FlagClones(int numberofobjects){/*{{{*/
-
-	int i;
-	int num_procs;
-
-	int* ranks=NULL;
-	int* minranks=NULL;
-
-	/*recover num_procs:*/
-	num_procs=IssmComm::GetSize();
-
-	/*Allocate ranks: */
-	ranks=xNew<int>(numberofobjects);
-	minranks=xNew<int>(numberofobjects);
-
-	for(i=0;i<numberofobjects;i++)ranks[i]=num_procs; //no cpu can have rank num_procs. This is the maximum limit.
-
-	/*Now go through all our objects and ask them to report to who they belong (which rank): */
-	Ranks(ranks);
-
-	/*We need to take the minimum rank for each vertex, and every cpu needs to get that result. That way, 
-	 * when we start building the dof list for all vertexs, a cpu can check whether its vertex already has been 
-	 * dealt with by another cpu. We take the minimum because we are going to manage dof assignment in increasing 
-	 * order of cpu rank. This is also why we initialized this array to num_procs.*/
-	ISSM_MPI_Allreduce ( (void*)ranks,(void*)minranks,numberofobjects,ISSM_MPI_INT,ISSM_MPI_MIN,IssmComm::GetComm());
-
-	/*Now go through all objects, and use minranks to flag which objects are cloned: */
-	for(i=0;i<this->Size();i++){
-		/*For this object, decide whether it is a clone: */
-		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
-		vertex->SetClone(minranks);
-	}
-
-	/*Free ressources: */
-	xDelete<int>(ranks); 
-	xDelete<int>(minranks);
-
-}
-/*}}}*/
-int Vertices::NumberOfVertices(void){/*{{{*/
-
-	int i,sid;
-	int max_sid=0;
-	int vertex_max_sid;
-
-	if (this->Size()==0)return 0;
-
-	for(i=0;i<this->Size();i++){
-		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
-		sid=vertex->Sid();
-		if (sid>max_sid)max_sid=sid;
-	}
-
-	ISSM_MPI_Reduce (&max_sid,&vertex_max_sid,1,ISSM_MPI_INT,ISSM_MPI_MAX,0,IssmComm::GetComm() );
-	ISSM_MPI_Bcast(&vertex_max_sid,1,ISSM_MPI_INT,0,IssmComm::GetComm());
-	max_sid=vertex_max_sid;
-
-	/*sid starts at 0*/
-	max_sid++;
-
-	/*return:*/
-	return max_sid;
-}
-/*}}}*/
-void   Vertices::Ranks(int* ranks){/*{{{*/
-
-	int my_rank;
-	int        sid;
-
-	/*recover my_rank:*/
-	my_rank=IssmComm::GetRank();
-
-	/*Go through a dataset, and for each object, report it cpu: */
-	for(int i=0;i<this->Size();i++){
-		/*Plug rank into ranks, according to id: */
-		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
-		sid=vertex->Sid();
-		ranks[sid]=my_rank; 
-	}
+Vertices* Vertices::Copy() {/*{{{*/
+
+	int num_proc = IssmComm::GetSize();
+
+	/*Copy dataset*/
+	Vertices* output=new Vertices();
+	output->sorted    = this->sorted;
+	output->numsorted = this->numsorted;
+	output->presorted = this->presorted;
+	for(vector<Object*>::iterator obj=this->objects.begin() ; obj < this->objects.end(); obj++ ) output->AddObject((*obj)->copy());
+
+	/*Build id_offsets and sorted_ids*/
+	output->id_offsets=NULL;
+	output->sorted_ids=NULL;
+	int objsize = this->numsorted;
+	if(this->sorted && objsize>0 && this->id_offsets){	
+		output->id_offsets=xNew<int>(objsize);
+		xMemCpy<int>(output->id_offsets,this->id_offsets,objsize);
+	}
+	if(this->sorted && objsize>0 && this->sorted_ids){
+		output->sorted_ids=xNew<int>(objsize);
+		xMemCpy<int>(output->sorted_ids,this->sorted_ids,objsize);
+	}
+
+	/*Copy other fields*/
+	output->numberofvertices       = this->numberofvertices;
+	output->numberofvertices_local = this->numberofvertices_local;
+	output->numberofmasters_local  = this->numberofmasters_local;
+
+	if(this->common_recv){
+		output->common_recv=xNew<int>(num_proc);
+		for(int i=0;i<num_proc;i++) output->common_recv[i]=this->common_recv[i];
+	}
+	if(this->common_send){
+		output->common_send=xNew<int>(num_proc);
+		for(int i=0;i<num_proc;i++) output->common_send[i]=this->common_send[i];
+	}
+	if(this->common_recv_ids){
+		output->common_recv_ids = xNew<int*>(num_proc);
+		for(int i=0;i<num_proc;i++){
+			output->common_recv_ids[i]=xNew<int>(this->common_recv[i]);
+			for(int j=0;j<this->common_recv[i];j++) output->common_recv_ids[i][j]=this->common_recv_ids[i][j];
+		}
+	}
+	if(this->common_send_ids){
+		output->common_send_ids = xNew<int*>(num_proc);
+		for(int i=0;i<num_proc;i++){
+			output->common_send_ids[i]=xNew<int>(this->common_send[i]);
+			for(int j=0;j<this->common_send[i];j++) output->common_send_ids[i][j]=this->common_send_ids[i][j];
+		}
+	}
+
+	return output;
+}
+/*}}}*/
+void Vertices::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/
+
+	int num_procs=IssmComm::GetSize();
+	int test = num_procs;
+	MARSHALLING_ENUM(VerticesEnum);
+	MARSHALLING(numberofvertices);
+	MARSHALLING(numberofvertices_local);
+	MARSHALLING(numberofmasters_local);
+	MARSHALLING(test);
+	if(test!=num_procs) _error_("number of cores is not the same as before");
+	MARSHALLING_DYNAMIC(this->common_recv,int,num_procs);
+	MARSHALLING_DYNAMIC(this->common_send,int,num_procs);
+	if(marshall_direction == MARSHALLING_BACKWARD){
+		this->common_recv_ids = xNew<int*>(num_procs);
+		this->common_send_ids = xNew<int*>(num_procs);
+	}
+	for(int i=0;i<num_procs;i++){
+		MARSHALLING_DYNAMIC(this->common_recv_ids[i],int,this->common_recv[i]);
+		MARSHALLING_DYNAMIC(this->common_send_ids[i],int,this->common_send[i]);
+	}
+	DataSet::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
 }
 /*}}}*/
@@ -217,2 +170,83 @@
 }
 /*}}}*/
+
+void Vertices::Finalize(){/*{{{*/
+
+	/*Here we do 3 things:
+	 * - count all vertices once for all so that we do not need to call MPI
+	 *   every time we need to know the total number of vertices
+	 * - Distribute lids (local ids): masters first, slaves second
+	 * - Distribute pids (parallel ids)
+	 *   */
+
+	/*recover my_rank:*/
+	ISSM_MPI_Status status;
+	int my_rank   = IssmComm::GetRank();
+	int num_procs = IssmComm::GetSize();
+
+	/*1. set number of vertices once for all*/
+	this->numberofvertices_local=this->Size();
+	this->numberofmasters_local=0;
+	for(int i=0;i<this->Size();i++){
+		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
+		if(!vertex->clone) this->numberofmasters_local++;
+	}
+	ISSM_MPI_Allreduce((void*)&this->numberofmasters_local,(void*)&this->numberofvertices,1,ISSM_MPI_INT,ISSM_MPI_SUM,IssmComm::GetComm());
+
+	/*2. Distribute lids (First: masters, then clones)*/
+	int lid = 0;
+	for(int i=0;i<this->Size();i++){
+		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
+		if(!vertex->clone) vertex->lid=lid++;
+	}
+	for(int i=0;i<this->Size();i++){
+		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
+		if(vertex->clone) vertex->lid=lid++;
+	}
+
+	/*3. Distribute pids based on lids and offsets*/
+	int* all_num_masters=xNew<int>(num_procs);
+	ISSM_MPI_Gather(&this->numberofmasters_local,1,ISSM_MPI_INT,all_num_masters,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+	ISSM_MPI_Bcast(all_num_masters,num_procs,ISSM_MPI_INT,0,IssmComm::GetComm());
+	int offset=0;
+	for(int i=0;i<my_rank;i++) offset+=all_num_masters[i];
+	xDelete<int>(all_num_masters);
+
+	for(int i=0;i<this->Size();i++){
+		Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(i));
+		vertex->pid = vertex->lid+offset;
+	}
+
+	/* Share pids of masters and update pids of clones*/
+	int* truepids = xNew<int>(this->Size()); //only one alloc
+	for(int rank=0;rank<num_procs;rank++){
+		if(this->common_send[rank]){
+			int  numids = this->common_send[rank];
+			for(int i=0;i<numids;i++){
+				Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(this->common_send_ids[rank][i]));
+				truepids[i] = vertex->pid;
+			}
+			ISSM_MPI_Send(truepids,numids,ISSM_MPI_INT,rank,0,IssmComm::GetComm());
+		}
+	}
+	for(int rank=0;rank<num_procs;rank++){
+		if(this->common_recv[rank]){
+			int  numids = this->common_recv[rank];
+			ISSM_MPI_Recv(truepids,numids,ISSM_MPI_INT,rank,0,IssmComm::GetComm(),&status);
+			for(int i=0;i<numids;i++){
+				Vertex* vertex=xDynamicCast<Vertex*>(this->GetObjectByOffset(this->common_recv_ids[rank][i]));
+				vertex->pid = truepids[i];
+			}
+		}
+	}
+	xDelete<int>(truepids);
+}/*}}}*/
+int Vertices::NumberOfVertices(){/*{{{*/
+	return this->numberofvertices;
+}/*}}}*/
+int Vertices::NumberOfVerticesLocal(void){/*{{{*/
+	return this->numberofmasters_local;
+}/*}}}*/
+int Vertices::NumberOfVerticesLocalAll(void){/*{{{*/
+	return this->numberofvertices_local;
+}/*}}}*/
Index: /issm/trunk/src/c/classes/Vertices.h
===================================================================
--- /issm/trunk/src/c/classes/Vertices.h	(revision 24312)
+++ /issm/trunk/src/c/classes/Vertices.h	(revision 24313)
@@ -14,5 +14,13 @@
 class Vertices: public DataSet{
 
+	private:
+		int numberofvertices;
+		int numberofvertices_local;
+		int numberofmasters_local;
 	public:
+		int*  common_recv;
+		int** common_recv_ids;
+		int*  common_send;
+		int** common_send_ids;
 
 		/*constructors, destructors:*/ 
@@ -20,10 +28,14 @@
 		~Vertices();
 
+		/*Objects virtual functions*/
+		Vertices* Copy();
+		void      Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
+
 		/*numerics:*/
-		void  DistributePids(int numberofnodes);
-		void  FlagClones(int numberofnodes);
+		void  Finalize(void);
 		int   NumberOfVertices(void);
-		void  Ranks(int* ranks);
-		void LatLonList(IssmDouble** lat,IssmDouble** lon);
+		int   NumberOfVerticesLocal(void);
+		int   NumberOfVerticesLocalAll(void);
+		void  LatLonList(IssmDouble** lat,IssmDouble** lon);
 };
 
Index: /issm/trunk/src/c/classes/classes.h
===================================================================
--- /issm/trunk/src/c/classes/classes.h	(revision 24312)
+++ /issm/trunk/src/c/classes/classes.h	(revision 24313)
@@ -26,4 +26,5 @@
 #include "./Massconaxpby.h"
 #include "./Regionaloutput.h"
+#include "./Radar.h"
 
 /*Constraints: */
@@ -35,4 +36,5 @@
 
 /*Loads: */
+#include "./Loads/Channel.h"
 #include "./Loads/Loads.h"
 #include "./Loads/Load.h"
@@ -90,5 +92,4 @@
 #include "./Materials/Matlitho.h"
 #include "./Materials/Matestar.h"
-#include "./Materials/Matpar.h"
 
 /*Params: */
@@ -129,7 +130,5 @@
 /*diverse: */
 #include "./Hook.h"
-#include "./DofIndexing.h"
 #include "./IoModel.h"
-#include "./Update.h"
 #include "./FemModel.h"
 #include "./GiaDeflectionCoreArgs.h"
Index: /issm/trunk/src/c/classes/gauss/GaussPenta.cpp
===================================================================
--- /issm/trunk/src/c/classes/gauss/GaussPenta.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/gauss/GaussPenta.cpp	(revision 24313)
@@ -433,4 +433,35 @@
 }
 /*}}}*/
+GaussPenta::GaussPenta(IssmDouble area_coordinates[2][3],int order_horiz){/*{{{*/
+
+	/*Intermediaties*/
+	IssmPDouble *seg_horiz_coords  = NULL;
+	IssmPDouble *seg_horiz_weights = NULL;
+
+	/*get the gauss points using the product of two line rules*/
+	GaussLegendreLinear(&seg_horiz_coords,&seg_horiz_weights,order_horiz);
+
+	/*Allocate GaussPenta fields*/
+	numgauss=order_horiz;
+	coords1=xNew<IssmDouble>(numgauss);
+	coords2=xNew<IssmDouble>(numgauss);
+	coords3=xNew<IssmDouble>(numgauss);
+	coords4=xNew<IssmDouble>(numgauss);
+	weights=xNew<IssmDouble>(numgauss);
+
+	/*Quads: get the gauss points using the product of two line rules  */
+	for(int i=0;i<order_horiz;i++){
+		coords1[i]=0.5*(area_coordinates[0][0]+area_coordinates[1][0]) + 0.5*seg_horiz_coords[i]*(area_coordinates[1][0]-area_coordinates[0][0]);
+		coords2[i]=0.5*(area_coordinates[0][1]+area_coordinates[1][1]) + 0.5*seg_horiz_coords[i]*(area_coordinates[1][1]-area_coordinates[0][1]);
+		coords3[i]=0.5*(area_coordinates[0][2]+area_coordinates[1][2]) + 0.5*seg_horiz_coords[i]*(area_coordinates[1][2]-area_coordinates[0][2]);
+		coords4[i]=0.;
+		weights[i]=seg_horiz_weights[i];
+	}
+
+	/*clean-up*/
+	xDelete<IssmPDouble>(seg_horiz_coords);
+	xDelete<IssmPDouble>(seg_horiz_weights);
+}
+/*}}}*/
 GaussPenta::~GaussPenta(){/*{{{*/
 	xDelete<IssmDouble>(weights);
Index: /issm/trunk/src/c/classes/gauss/GaussPenta.h
===================================================================
--- /issm/trunk/src/c/classes/gauss/GaussPenta.h	(revision 24312)
+++ /issm/trunk/src/c/classes/gauss/GaussPenta.h	(revision 24313)
@@ -37,4 +37,5 @@
 		GaussPenta(int index,IssmDouble r1, IssmDouble r2,bool maintlyfloating,int order);
 		GaussPenta(IssmDouble area_coordinates[4][3],int order_horiz,int order_vert);
+		GaussPenta(IssmDouble area_coordinates[2][3],int order_horiz);
 		~GaussPenta();
 
Index: /issm/trunk/src/c/classes/gauss/GaussTria.cpp
===================================================================
--- /issm/trunk/src/c/classes/gauss/GaussTria.cpp	(revision 24312)
+++ /issm/trunk/src/c/classes/gauss/GaussTria.cpp	(revision 24313)
@@ -497,5 +497,5 @@
 	/*update static arrays*/
 	switch(finiteelement){
-		case P0Enum:
+		case P0Enum: case P0DGEnum:
 			switch(iv){
 				case 0: coord1=1./3.; coord2=1./3.; coord3=1./3.; break;
Index: /issm/trunk/src/c/cores/ResetBoundaryConditions.cpp
===================================================================
--- /issm/trunk/src/c/cores/ResetBoundaryConditions.cpp	(revision 24312)
+++ /issm/trunk/src/c/cores/ResetBoundaryConditions.cpp	(revision 24313)
@@ -13,7 +13,9 @@
 
 	if(VerboseSolution()) _printf0_("   updating boundary conditions...\n");
+	_assert_(femmodel->analysis_type_list[femmodel->analysis_counter]==analysis_type); 
 
 	/*set current analysis: */
 	femmodel->SetCurrentConfiguration(analysis_type);
+	int index = femmodel->AnalysisIndex(analysis_type);
 
 	/*retrieve boundary conditions from element inputs :*/
Index: /issm/trunk/src/c/cores/adjointstressbalance_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/adjointstressbalance_core.cpp	(revision 24312)
+++ /issm/trunk/src/c/cores/adjointstressbalance_core.cpp	(revision 24313)
@@ -26,7 +26,4 @@
 
 	/*Compute velocities*/
-	if(VerboseSolution()) _printf0_("   computing velocities\n");
-	femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
-
 	if(VerboseSolution()) _printf0_("   computing velocities\n");
 	femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
Index: /issm/trunk/src/c/cores/bedslope_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/bedslope_core.cpp	(revision 24312)
+++ /issm/trunk/src/c/cores/bedslope_core.cpp	(revision 24313)
@@ -1,5 +1,5 @@
 /*!\file: bedslope_core.cpp
- * \brief: core of the slope solution 
- */ 
+ * \brief: core of the slope solution
+ */
 
 #include "./cores.h"
@@ -34,5 +34,5 @@
 
 	if(save_results){
-		if(VerboseSolution()) _printf0_("   saving results\n");
+		if(VerboseSolution()) _printf0_("   saving bedslopes results\n");
 		if(domaintype!=Domain2DverticalEnum){
 			int outputs[2] = {BedSlopeXEnum,BedSlopeYEnum};
Index: /issm/trunk/src/c/cores/bmb_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/bmb_core.cpp	(revision 24312)
+++ /issm/trunk/src/c/cores/bmb_core.cpp	(revision 24313)
@@ -17,4 +17,6 @@
 	femmodel->parameters->FindParam(&basalforcing_model,BasalforcingsEnum);
 
+	if(VerboseSolution()) _printf0_("   computing basal mass balance\n");
+
 	/*In some cases we need to run additional analyses to get the required input data*/
 	if(basalforcing_model==BasalforcingsPicoEnum){
@@ -33,3 +35,7 @@
 	/*Call module now*/
 	FloatingiceMeltingRatex(femmodel);
+
+	/*Extrude basal melt*/
+	femmodel->parameters->SetParam(BasalforcingsFloatingiceMeltingRateEnum,InputToExtrudeEnum);
+	extrudefrombase_core(femmodel);
 }
Index: sm/trunk/src/c/cores/controlad_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/controlad_core.cpp	(revision 24312)
+++ 	(revision )
@@ -1,332 +1,0 @@
-/*!\file: controlad_core.cpp
- * \brief: core of the ad control solution 
- */ 
-
-#include <config.h>
-#include "./cores.h"
-#include "../toolkits/toolkits.h"
-#include "../classes/classes.h"
-#include "../shared/shared.h"
-#include "../modules/modules.h"
-#include "../solutionsequences/solutionsequences.h"
-
-/*This file is probably never used!*/
-#if defined (_HAVE_M1QN3_)  & defined (_HAVE_ADOLC_)
-/*m1qn3 prototypes {{{*/
-extern "C" void *ctonbe_; // DIS mode : Conversion
-extern "C" void *ctcabe_; // DIS mode : Conversion
-extern "C" void *euclid_; // Scalar product
-typedef void (*SimulFunc) (long* indic,long* n, double* x, double* pf,double* g,long [],float [],void* dzs);
-extern "C" void m1qn3_ (void f(long* indic,long* n, double* x, double* pf,double* g,long [],float [],void* dzs),
-			void **, void **, void **,
-			long *, double [], double *, double [], double*, double *,
-			double *, char [], long *, long *, long *, long *, long *, long *, long [], double [], long *,
-			long *, long *, long [], float [],void* );
-
-/*Cost function prototype*/
-void simulad(long* indic,long* n,double* X,double* pf,double* G,long izs[1],float rzs[1],void* dzs);
-FemModel* presimulad(int* pintn, double** pX, FemModel* femmodel);
-void postsimulad(long* indic,long* n,double* X,double* pf,double* G,long izs[1],float rzs[1],void* dzs);
-/*}}}*/
-void controlad_core(FemModel* femmodel){ /*{{{*/
-
-	/*Intermediaries*/
-	FemModel*    femmodelad=NULL;
-	int          i;
-	long         omode;
-	IssmPDouble  f,dxmin,gttol;
-	IssmDouble   dxmind,gttold; 
-	int          maxsteps,maxiter;
-	int          intn,solution_type;
-	IssmPDouble  *X  = NULL;
-	IssmDouble   *Xd  = NULL;
-	IssmPDouble  *G  = NULL;
-
-	/*Recover some parameters*/
-	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
-	femmodel->parameters->FindParam(&maxsteps,InversionMaxstepsEnum);
-	femmodel->parameters->FindParam(&maxiter,InversionMaxiterEnum);
-	femmodel->parameters->FindParam(&dxmind,InversionDxminEnum); dxmin=reCast<IssmPDouble>(dxmind);
-	femmodel->parameters->FindParam(&gttold,InversionGttolEnum); gttol=reCast<IssmPDouble>(gttold);
-	femmodel->parameters->SetParam(false,SaveResultsEnum);
-
-	/*Initialize M1QN3 parameters*/
-	if(VerboseControl())_printf0_("   Initialize M1QN3 parameters\n");
-	SimulFunc costfuncion  = &simulad;  /*Cost function address*/
-	void**    prosca       = &euclid_;  /*Dot product function (euclid is the default)*/
-	char      normtype[]   = "dfn";     /*Norm type: dfn = scalar product defined by prosca*/
-	long      izs[5];                   /*Arrays used by m1qn3 subroutines*/
-	long      iz[5];                    /*Integer m1qn3 working array of size 5*/
-	float     rzs[1];                   /*Arrays used by m1qn3 subroutines*/
-	long      impres       = 0;         /*verbosity level*/
-	long      imode[3]     = {0};       /*scaling and starting mode, 0 by default*/
-	long      indic        = 4;         /*compute f and g*/
-	long      reverse      = 0;         /*reverse or direct mode*/
-	long      io           = 6;         /*Channel number for the output*/
-
-	/*Optimization criterions*/
-	long niter = long(maxsteps); /*Maximum number of iterations*/
-	long nsim  = long(maxiter);/*Maximum number of function calls*/
-
-	/*Run the first part of simulad, in order to get things started!:*/
-	femmodelad=presimulad(&intn,&X,femmodel);
-
-	/*Get problem dimension and initialize gradient: */
-	long n = long(intn);
-	G = xNew<IssmPDouble>(n);
-
-	/*Allocate m1qn3 working arrays (see doc)*/
-	long      m   = 100;
-	long      ndz = 4*n+m*(2*n+1);
-	double*   dz  = xNew<double>(ndz);
-
-	if(VerboseControl())_printf0_("   Computing initial solution\n");
-	_printf0_("\n");
-	_printf0_("Cost function f(x)   | Gradient norm |g(x)| |  List of contributions\n");
-	_printf0_("____________________________________________________________________\n");
-
-	//run post simular phase, to fire up the control optimization
-	postsimulad(&indic,&n,X,&f,G,izs,rzs,(void*)femmodelad); 
-	double f1=f;
-
-	m1qn3_(costfuncion,prosca,&ctonbe_,&ctcabe_,
-				&n,X,&f,G,&dxmin,&f1,
-				&gttol,normtype,&impres,&io,imode,&omode,&niter,&nsim,iz,dz,&ndz,
-				&reverse,&indic,izs,rzs,(void*)femmodel);
-
-	switch(int(omode)){
-		case 0:  _printf0_("   Stop requested (indic = 0)\n"); break;
-		case 1:  _printf0_("   Convergence reached (gradient satisfies stopping criterion)\n"); break;
-		case 2:  _printf0_("   Bad initialization\n"); break;
-		case 3:  _printf0_("   Line search failure\n"); break;
-		case 4:  _printf0_("   Maximum number of iterations exceeded\n");break;
-		case 5:  _printf0_("   Maximum number of function calls exceeded\n"); break;
-		case 6:  _printf0_("   stopped on dxmin during line search\n"); break;
-		case 7:  _printf0_("   <g,d> > 0  or  <y,s> <0\n"); break;
-		default: _printf0_("   Unknown end condition\n");
-	}
-
-	/*Save results:*/
-	femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,AutodiffJacobianEnum,G,n,1,0,0.0));
-	femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,AutodiffXpEnum,X,intn,1,0,0.0));
-
-	/*Clean-up and return*/
-	xDelete<double>(G);
-	xDelete<double>(X);
-	xDelete<double>(dz);
-}/*}}}*/
-FemModel* presimulad(int* pintn, double** pX, FemModel* femmodel){ /*{{{*/
-
-	/*Intermediaries:*/
-	char* rootpath=NULL;
-	char* inputfilename=NULL;
-	char* outputfilename=NULL;
-	char* toolkitsfilename=NULL;
-	char* lockfilename=NULL;
-	char* restartfilename=NULL;
-	int         solution_type;
-	IssmDouble    pfd;
-	IssmDouble*   Xd=NULL;
-	int           intn;
-	IssmPDouble*   X=NULL;
-	int            i;
-
-	/*Now things get complicated. The femmodel we recovered did not initialize an AD trace, so we can't compute gradients with it. We are going to recreate 
-	 *a new femmodel, identical in all aspects to the first one, with trace on though, which will allow us to run the forward mode and get the gradient 
-	 in one run of the solution core. So first recover the filenames required for the FemModel constructor, then call a new ad tailored constructor:*/
-	femmodel->parameters->FindParam(&rootpath,RootPathEnum);
-	femmodel->parameters->FindParam(&inputfilename,InputFileNameEnum);
-	femmodel->parameters->FindParam(&outputfilename,OutputFileNameEnum);
-	femmodel->parameters->FindParam(&toolkitsfilename,ToolkitsFileNameEnum);
-	femmodel->parameters->FindParam(&lockfilename,LockFileNameEnum);
-	femmodel->parameters->FindParam(&restartfilename,RestartFileNameEnum);
-
-	femmodel=new FemModel(rootpath, inputfilename, outputfilename, toolkitsfilename, lockfilename, restartfilename,IssmComm::GetComm(), femmodel->solution_type,NULL);
-
-	/*Get initial guess:*/
-	femmodel->parameters->FindParam(&Xd,&intn,AutodiffXpEnum);
-	X=xNew<IssmPDouble>(intn); for(i=0;i<intn;i++) X[i]=reCast<IssmPDouble>(Xd[i]); 
-
-	xDelete<char>(rootpath);
-	xDelete<char>(inputfilename);
-	xDelete<char>(outputfilename);
-	xDelete<char>(toolkitsfilename);
-	xDelete<char>(lockfilename);
-	xDelete<char>(restartfilename);
-	xDelete<IssmDouble>(Xd);
-
-	*pintn=intn;
-	*pX=X;
-
-	return femmodel;
-
-} /*}}}*/
-void postsimulad(long* indic,long* n,double* X,double* pf,double* G,long izs[1],float rzs[1],void* dzs){ /*{{{*/
-
-	/*Intermediaries:*/
-	char* rootpath=NULL;
-	char* inputfilename=NULL;
-	char* outputfilename=NULL;
-	char* toolkitsfilename=NULL;
-	char* lockfilename=NULL;
-	IssmPDouble* G2=NULL;
-	int         solution_type;
-	FemModel   *femmodel  =  NULL;
-	IssmDouble    pfd;
-	int            i;
-
-	/*Recover Femmodel*/
-	femmodel  = (FemModel*)dzs;
-
-	/*Recover number of cost functions responses*/
-	int num_responses;
-	femmodel->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
-
-	/*Recover some parameters*/
-	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
-
-	/*Compute solution:*/
-	void (*solutioncore)(FemModel*)=NULL;
-	CorePointerFromSolutionEnum(&solutioncore,femmodel->parameters,solution_type);
-	solutioncore(femmodel);
-
-	/*Compute objective function*/
-	IssmDouble* Jlist = NULL;
-	femmodel->CostFunctionx(&pfd,&Jlist,NULL); *pf=reCast<IssmPDouble>(pfd);
-	_printf0_("f(x) = "<<setw(12)<<setprecision(7)<<*pf<<"  |  ");
-
-	/*Compute gradient using AD. Gradient is in the results after the ad_core is called*/
-	adgradient_core(femmodel); 
-
-	if(IssmComm::GetRank()==0){
-		IssmPDouble* G_temp=NULL;
-		GenericExternalResult<IssmPDouble*>* gradient=(GenericExternalResult<IssmPDouble*>*)femmodel->results->FindResult(AutodiffJacobianEnum); _assert_(gradient);
-		G_temp=gradient->GetValues();
-		/*copy onto G2, to avoid a leak: */
-		G2=xNew<IssmPDouble>(*n); 
-		xMemCpy<IssmPDouble>(G2,G_temp,*n);
-	}
-	else G2=xNew<IssmPDouble>(*n);
-
-	/*MPI broadcast results:*/
-	ISSM_MPI_Bcast(G2,*n,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
-
-	/*Send gradient to m1qn3 core: */
-	for(long i=0;i<*n;i++) G[i] = G2[i];
-
-	/*Constrain X and G*/
-	IssmDouble  Gnorm = 0.;
-	for(long i=0;i<*n;i++) Gnorm += G[i]*G[i];
-	Gnorm = sqrt(Gnorm);
-
-	/*Print info*/
-	_printf0_("       "<<setw(12)<<setprecision(7)<<Gnorm<<" |");
-	for(int i=0;i<num_responses;i++) _printf0_(" "<<setw(12)<<setprecision(7)<<Jlist[i]);
-	_printf0_("\n");
-
-	/*Clean-up and return*/
-	xDelete<IssmDouble>(Jlist);
-	xDelete<IssmPDouble>(G2);
-
-	xDelete<char>(rootpath);
-	xDelete<char>(inputfilename);
-	xDelete<char>(outputfilename);
-	xDelete<char>(toolkitsfilename);
-	xDelete<char>(lockfilename);
-
-} /*}}}*/
-void simulad(long* indic,long* n,double* X,double* pf,double* G,long izs[1],float rzs[1],void* dzs){ /*{{{*/
-
-	/*Intermediaries:*/
-	char* rootpath=NULL;
-	char* inputfilename=NULL;
-	char* outputfilename=NULL;
-	char* toolkitsfilename=NULL;
-	char* lockfilename=NULL;
-	char* restartfilename=NULL;
-	IssmPDouble* G2=NULL;
-	int         solution_type;
-	FemModel   *femmodel  =  NULL;
-	FemModel   *femmodelad  = NULL;
-	IssmDouble    pfd;
-	int            i;
-
-	/*Recover Femmodel*/
-	femmodel  = (FemModel*)dzs;
-
-	/*Recover number of cost functions responses*/
-	int num_responses;
-	femmodel->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
-
-	/*Now things get complicated. The femmodel we recovered did not initialize an AD trace, so we can't compute gradients with it. We are going to recreate 
-	 *a new femmodel, identical in all aspects to the first one, with trace on though, which will allow us to run the forward mode and get the gradient 
-	 in one run of the solution core. So first recover the filenames required for the FemModel constructor, then call a new ad tailored constructor:*/
-	femmodel->parameters->FindParam(&rootpath,RootPathEnum);
-	femmodel->parameters->FindParam(&inputfilename,InputFileNameEnum);
-	femmodel->parameters->FindParam(&outputfilename,OutputFileNameEnum);
-	femmodel->parameters->FindParam(&toolkitsfilename,ToolkitsFileNameEnum);
-	femmodel->parameters->FindParam(&lockfilename,LockFileNameEnum);
-	femmodel->parameters->FindParam(&restartfilename,RestartFileNameEnum);
-
-	femmodelad=new FemModel(rootpath, inputfilename, outputfilename, toolkitsfilename, lockfilename, restartfilename,IssmComm::GetComm(), femmodel->solution_type,X);
-	femmodel=femmodelad; //We can do this, because femmodel is being called from outside, not by reference, so we won't erase it
-
-	/*Recover some parameters*/
-	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
-
-	/*Compute solution:*/
-	void (*solutioncore)(FemModel*)=NULL;
-	CorePointerFromSolutionEnum(&solutioncore,femmodel->parameters,solution_type);
-	solutioncore(femmodel);
-
-	/*Compute objective function*/
-	IssmDouble* Jlist = NULL;
-	femmodel->CostFunctionx(&pfd,&Jlist,NULL); *pf=reCast<IssmPDouble>(pfd);
-	_printf0_("f(x) = "<<setw(12)<<setprecision(7)<<*pf<<"  |  ");
-
-	/*Compute gradient using AD. Gradient is in the results after the ad_core is called*/
-	adgradient_core(femmodel); 
-
-	if(IssmComm::GetRank()==0){
-		IssmPDouble* G_temp=NULL;
-		GenericExternalResult<IssmPDouble*>* gradient=(GenericExternalResult<IssmPDouble*>*)femmodel->results->FindResult(AutodiffJacobianEnum); _assert_(gradient);
-		G_temp=gradient->GetValues();
-		/*copy onto G2, to avoid a leak: */
-		G2=xNew<IssmPDouble>(*n); 
-		xMemCpy<IssmPDouble>(G2,G_temp,*n);
-	}
-	else G2=xNew<IssmPDouble>(*n);
-
-	/*MPI broadcast results:*/
-	ISSM_MPI_Bcast(G2,*n,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm());
-
-	/*Send gradient to m1qn3 core: */
-	for(long i=0;i<*n;i++) G[i] = G2[i];
-
-	/*Recover Gnorm: */
-	IssmDouble  Gnorm = 0.;
-	for(int i=0;i<*n;i++) Gnorm += G[i]*G[i];
-	Gnorm = sqrt(Gnorm);
-
-	/*Print info*/
-	_printf0_("       "<<setw(12)<<setprecision(7)<<Gnorm<<" |");
-	for(int i=0;i<num_responses;i++) _printf0_(" "<<setw(12)<<setprecision(7)<<Jlist[i]);
-	_printf0_("\n");
-
-	/*Clean-up and return*/
-	xDelete<IssmDouble>(Jlist);
-	xDelete<IssmPDouble>(G2);
-	xDelete<char>(rootpath);
-	xDelete<char>(inputfilename);
-	xDelete<char>(outputfilename);
-	xDelete<char>(toolkitsfilename);
-	xDelete<char>(lockfilename);
-	xDelete<char>(restartfilename);
-	if(femmodelad)delete femmodelad;
-
-} /*}}}*/
-#else
-void controlad_core(FemModel* femmodel){ /*{{{*/
-	_error_("AD and/or M1QN3 not installed");
-}/*}}}*/
-#endif //_HAVE_M1QN3_
Index: /issm/trunk/src/c/cores/controladm1qn3_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/controladm1qn3_core.cpp	(revision 24312)
+++ /issm/trunk/src/c/cores/controladm1qn3_core.cpp	(revision 24313)
@@ -190,9 +190,9 @@
 	if(solution_type == TransientSolutionEnum) femmodel = input_struct->femmodel->copy();
 
-	IssmPDouble*  Jlist        = input_struct->Jlist;
-	int           JlistM       = input_struct->M;
-	int           JlistN       = input_struct->N;
-	int*          Jlisti       = input_struct->i;
-	int           intn         = (int)*n;
+	IssmPDouble*  Jlist  = input_struct->Jlist;
+	int           JlistM = input_struct->M;
+	int           JlistN = input_struct->N;
+	int*          Jlisti = input_struct->i;
+	int           intn   = (int)*n;
 
 	/*Recover some parameters*/
@@ -267,13 +267,12 @@
 		femmodel->parameters->FindParam(&restart_time,TimesteppingStartTimeEnum);
 		femmodel->parameters->SetParam(restart_time,TimeEnum);
-
 	}
 
 	/*Get Dependents*/
-	IssmDouble  output_value;
-	int         num_dependents;
+	IssmDouble   output_value;
+	int          num_dependents;
 	IssmPDouble *dependents;
-	DataSet*    dependent_objects=NULL;
-	IssmDouble	J=0.;
+	DataSet     *dependent_objects = NULL;
+	IssmDouble   J                 = 0.;
 	femmodel->parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum);
 	femmodel->parameters->FindParam(&dependent_objects,AutodiffDependentObjectsEnum);
@@ -378,13 +377,12 @@
 	/* call the fos_reverse in a loop on the index, from 0 to num_dependents, so
 	 * as to generate num_dependents gradients: */
-	for(int aDepIndex=0;aDepIndex<num_dependents_old;aDepIndex++){
+	for(int dep_index=0;dep_index<num_dependents_old;dep_index++){
 
 		/*initialize direction index in the weights vector: */
-		aWeightVector=xNewZeroInit<IssmPDouble>(num_dependents);
 		if(my_rank==0){
-			if(aDepIndex<0 || aDepIndex>=num_dependents || codi_global.output_indices.size() <= aDepIndex){
-				_error_("index value for AutodiffFosReverseIndexEnum should be in [0,num_dependents-1]");
+			if(dep_index<0 || dep_index>=num_dependents || codi_global.output_indices.size() <= dep_index){
+				_error_("index value for dependent index should be in [0,num_dependents-1]");
 			}
-			tape_codi.setGradient(codi_global.output_indices[aDepIndex],1.0);
+			tape_codi.setGradient(codi_global.output_indices[dep_index],1.0);
 		}
 		tape_codi.evaluate();
@@ -393,14 +391,12 @@
 		weightVectorTimesJac=xNew<IssmPDouble>(num_independents);
 		auto in_size = codi_global.input_indices.size();
-		for(size_t i = 0; i < in_size; ++i) {
+		for(size_t i = 0; i < in_size; ++i){
 			_assert_(i<num_independents);
 			weightVectorTimesJac[i] = tape_codi.getGradient(codi_global.input_indices[i]);
 		}
-		if(my_rank==0) for(int i=0;i<num_independents;i++) {
+		if(my_rank==0) for(int i=0;i<num_independents;i++){
 			totalgradient[i]+=weightVectorTimesJac[i];
 		}
-		/*free resources :*/
 		xDelete(weightVectorTimesJac);
-		xDelete(aWeightVector);
 	}
 	/*}}}*/
@@ -470,5 +466,4 @@
 	xDelete<IssmDouble>(scaling_factors);
 	xDelete<IssmPDouble>(totalgradient);
-
 }/*}}}*/
 void controladm1qn3_core(FemModel* femmodel){/*{{{*/
Index: /issm/trunk/src/c/cores/cores.h
===================================================================
--- /issm/trunk/src/c/cores/cores.h	(revision 24312)
+++ /issm/trunk/src/c/cores/cores.h	(revision 24313)
@@ -31,5 +31,4 @@
 void controlm1qn3_core(FemModel* femmodel);
 void controladm1qn3_core(FemModel* femmodel);
-void controlad_core(FemModel* femmodel);
 void controlvalidation_core(FemModel* femmodel);
 void masstransport_core(FemModel* femmodel);
Index: /issm/trunk/src/c/cores/damage_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/damage_core.cpp	(revision 24312)
+++ /issm/trunk/src/c/cores/damage_core.cpp	(revision 24313)
@@ -1,5 +1,5 @@
-/* 
+/*
  * \brief: damage_core.cpp: core for the damage solution
- */ 
+ */
 
 #include "./cores.h"
@@ -11,13 +11,13 @@
 
 void damage_core(FemModel* femmodel){
-	
+
 	/*Start profiler*/
 	femmodel->profiler->Start(DAMAGECORE);
-        
+
 	/*intermediary*/
 	bool   save_results;
 	bool   dakota_analysis     = false;
 	int    solution_type,stabilization;
-	int    numoutputs          = 0; 
+	int    numoutputs          = 0;
 	char   **requested_outputs = NULL;
 
@@ -40,16 +40,16 @@
 
 	if(save_results){
-		if(VerboseSolution()) _printf0_("   saving results\n");
+		if(VerboseSolution()) _printf0_("   saving damage results\n");
 		femmodel->RequestedOutputsx(&femmodel->results,requested_outputs,numoutputs);
 	}
 
-	/*Free resources:*/	
+	/*Free resources:*/
 	if(numoutputs){
 		for(int i=0;i<numoutputs;i++){
 			xDelete<char>(requested_outputs[i]);
-		} 
+		}
 		xDelete<char*>(requested_outputs);
 	}
-	
+
 	/*End profiler*/
 	femmodel->profiler->Stop(DAMAGECORE);
Index: /issm/trunk/src/c/cores/esa_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/esa_core.cpp	(revision 24312)
+++ /issm/trunk/src/c/cores/esa_core.cpp	(revision 24313)
@@ -21,5 +21,4 @@
 	Vector<IssmDouble> *U_y    = NULL; 
 	bool save_results,isesa,iscoupler;
-	int configuration_type;
 	int domaintype;
 	int solution_type;
@@ -39,5 +38,4 @@
 	/*Recover some parameters: */
 	femmodel->parameters->FindParam(&domaintype,DomainTypeEnum);
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
@@ -50,5 +48,5 @@
 
 	/*Figure out size of g-set deflection vector and allocate solution vector: */
-	gsize      = femmodel->nodes->NumberOfDofs(configuration_type,GsetEnum);
+	gsize      = femmodel->nodes->NumberOfDofs(GsetEnum);
 
 	/*several cases here, depending on value of iscoupler and isesa: 
Index: /issm/trunk/src/c/cores/gia_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/gia_core.cpp	(revision 24312)
+++ /issm/trunk/src/c/cores/gia_core.cpp	(revision 24313)
@@ -22,9 +22,7 @@
 	bool save_results;
 	int  gsize;
-	int  configuration_type;
 
 	/*Recover some parameters: */
 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 
 	if(VerboseSolution()) _printf0_("   computing GIA\n");
@@ -34,5 +32,5 @@
 
 	/*Figure out size of g-set deflection vector and allocate solution vector: */
-	gsize      = femmodel->nodes->NumberOfDofs(configuration_type,GsetEnum);
+	gsize      = femmodel->nodes->NumberOfDofs(GsetEnum);
 	wg = new Vector<IssmDouble>(gsize);
 	dwdtg = new Vector<IssmDouble>(gsize);
Index: /issm/trunk/src/c/cores/hydrology_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/hydrology_core.cpp	(revision 24312)
+++ /issm/trunk/src/c/cores/hydrology_core.cpp	(revision 24313)
@@ -30,4 +30,5 @@
 	femmodel->parameters->FindParam(&numoutputs,HydrologyNumRequestedOutputsEnum);
 	if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,HydrologyRequestedOutputsEnum);
+
 	/*Using the Shreve based Model*/
 	if (hydrology_model==HydrologyshreveEnum){
@@ -40,5 +41,4 @@
 		femmodel->SetCurrentConfiguration(HydrologyShreveAnalysisEnum);
 		solutionsequence_nonlinear(femmodel,modify_loads);
-
 		/*transfer water column thickness to old water column thickness: */
 		InputDuplicatex(femmodel,WatercolumnEnum,WaterColumnOldEnum);
@@ -50,71 +50,99 @@
 		/*intermediary: */
 		bool       isefficientlayer;
-		int        step,hydroslices;
-		IssmDouble time,init_time,hydrotime,yts;
-		IssmDouble dt,hydrodt;
-
+		/*recover parameters: */
 		femmodel->parameters->FindParam(&isefficientlayer,HydrologydcIsefficientlayerEnum);
-		femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
-		femmodel->parameters->FindParam(&step,StepEnum);
-		femmodel->parameters->FindParam(&time,TimeEnum);
-		femmodel->parameters->FindParam(&hydroslices,HydrologyStepsPerStepEnum);
-		femmodel->parameters->FindParam(&yts,ConstantsYtsEnum);
 
 		/*first we exclude frozen nodes of the solved nodes*/
 		femmodel->SetCurrentConfiguration(HydrologyDCInefficientAnalysisEnum);
 		femmodel->HydrologyIDSupdateDomainx(&ThawedNodes);
+
 		if(ThawedNodes>0){
-			init_time = time-dt; //getting the time back to the start of the timestep
-			hydrotime=init_time;
-			hydrodt=dt/hydroslices; //computing hydro dt from dt and a divider
-			femmodel->parameters->AddObject(new DoubleParam(HydrologydtEnum,hydrodt));
-			if(hydroslices>1){
-				/*define which variable needs to be averaged on the sub-timestep and initialize as needed*/
+			/*check if we need sub steps*/
+			int        dtslices;
+			femmodel->parameters->FindParam(&dtslices,HydrologyStepsPerStepEnum);
+
+			if(dtslices>1){
+				int        substep, numaveragedinput;
+				IssmDouble global_time, subtime, yts;
+				IssmDouble dt, subdt;
+
+            femmodel->parameters->FindParam(&global_time,TimeEnum);
+            femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+            femmodel->parameters->FindParam(&yts,ConstantsYtsEnum);
+
+				subtime=global_time-dt; //getting the time back to the start of the timestep
+				subdt=dt/dtslices; //computing hydro dt from dt and a divider
+				substep=0;
+				femmodel->parameters->SetParam(subdt,TimesteppingTimeStepEnum);
+
+				/*intermiedaries to deal with averaging*/
+				static const int substeplist[4] = {EffectivePressureSubstepEnum,SedimentHeadSubstepEnum,EplHeadSubstepEnum,HydrologydcEplThicknessSubstepEnum};
+				static const int transientlist[4] = {EffectivePressureTransientEnum,SedimentHeadTransientEnum,EplHeadTransientEnum,HydrologydcEplThicknessTransientEnum};
+				static const int averagelist[4] = {EffectivePressureEnum,SedimentHeadEnum,EplHeadEnum,HydrologydcEplThicknessEnum};
+				std::vector<int> substepinput;
+				std::vector<int> transientinput;
+				std::vector<int> averagedinput;
+
 				if (isefficientlayer){
-					int inputtostack[4]={EffectivePressureHydrostepEnum,SedimentHeadHydrostepEnum,EplHeadHydrostepEnum,HydrologydcEplThicknessHydrostepEnum};
-					int stackedinput[4]={EffectivePressureStackedEnum,SedimentHeadStackedEnum,EplHeadStackedEnum,HydrologydcEplThicknessStackedEnum};
-					int averagedinput[4]={EffectivePressureEnum,SedimentHeadEnum,EplHeadEnum,HydrologydcEplThicknessEnum};
-					femmodel->InitTransientOutputx(&stackedinput[0],4);
-					while(hydrotime<time-(yts*DBL_EPSILON)){ //loop on hydro dts
-						hydrotime+=hydrodt;
-						/*save preceding timestep*/
-						InputDuplicatex(femmodel,SedimentHeadHydrostepEnum,SedimentHeadOldEnum);
-						InputDuplicatex(femmodel,EplHeadHydrostepEnum,EplHeadOldEnum);
-						InputDuplicatex(femmodel,HydrologydcEplThicknessHydrostepEnum,HydrologydcEplThicknessOldEnum);
-						/*Proceed now to heads computations*/
-						solutionsequence_hydro_nonlinear(femmodel);
-						/*If we have a sub-timestep we stack the variables here*/
-						femmodel->StackTransientOutputx(&inputtostack[0],&stackedinput[0],hydrotime,4);
+					/*define which variable needs to be averaged on the sub-timestep and initialize as needed*/
+					numaveragedinput = 4;
+					substepinput.assign(substeplist,substeplist+4);
+					transientinput.assign(transientlist,transientlist+4);
+					averagedinput.assign(averagelist,averagelist+4);
+				}
+				else{
+					numaveragedinput = 2;
+					substepinput.assign(substeplist,substeplist+2);
+					transientinput.assign(transientlist,transientlist+2);
+					averagedinput.assign(averagelist,averagelist+2);
+				}
+				femmodel->InitTransientOutputx(&transientinput[0],numaveragedinput);
+				while(substep<dtslices){ //loop on hydro dts
+					substep+=1;
+					subtime+=subdt;
+					/*Setting substep time as global time*/
+					femmodel->parameters->SetParam(subtime,TimeEnum);
+					if(VerboseSolution()) _printf0_("sub iteration " << substep << "/" << dtslices << "  time [yr]: " << setprecision(4) << subtime/yts << " (time step: " << subdt/yts << ")\n");
+					if(VerboseSolution()) _printf0_("   computing water heads\n");
+					/*save preceding timestep*/
+					InputDuplicatex(femmodel,SedimentHeadSubstepEnum,SedimentHeadOldEnum);
+					if (isefficientlayer){
+						InputDuplicatex(femmodel,EplHeadSubstepEnum,EplHeadOldEnum);
+						InputDuplicatex(femmodel,HydrologydcEplThicknessSubstepEnum,HydrologydcEplThicknessOldEnum);
 					}
-					femmodel->AverageTransientOutputx(&stackedinput[0],&averagedinput[0],init_time,4);
-				}
-				else{
-					int inputtostack[2]={EffectivePressureHydrostepEnum,SedimentHeadHydrostepEnum};
-					int stackedinput[2]={EffectivePressureStackedEnum,SedimentHeadStackedEnum};
-					int averagedinput[2]={EffectivePressureEnum,SedimentHeadEnum};
-					femmodel->InitTransientOutputx(&stackedinput[0],2);
-					while(hydrotime<time-(yts*DBL_EPSILON)){ //loop on hydro dts
-						hydrotime+=hydrodt;
-						/*save preceding timestep*/
-						InputDuplicatex(femmodel,SedimentHeadHydrostepEnum,SedimentHeadOldEnum);
-						/*Proceed now to heads computations*/
-						solutionsequence_hydro_nonlinear(femmodel);
-						/*If we have a sub-timestep we stack the variables here*/
-						femmodel->StackTransientOutputx(&inputtostack[0],&stackedinput[0],hydrotime,2);
-					}
-					femmodel->AverageTransientOutputx(&stackedinput[0],&averagedinput[0],init_time,2);
-				}
+					/*Proceed now to heads computations*/
+					solutionsequence_hydro_nonlinear(femmodel);
+               /*If we have a sub-timestep we store the substep inputs in a transient input here*/
+					femmodel->StackTransientOutputx(&substepinput[0],&transientinput[0],subtime,numaveragedinput);
+				}
+				/*averaging the stack*/
+				femmodel->AverageTransientOutputx(&transientinput[0],&averagedinput[0],global_time-dt,subtime,numaveragedinput);
+
+				/*And reseting to global time*/
+				femmodel->parameters->SetParam(dt,TimesteppingTimeStepEnum);
+				femmodel->parameters->SetParam(global_time,TimeEnum);
 			}
 			else{
-				InputDuplicatex(femmodel,SedimentHeadHydrostepEnum,SedimentHeadOldEnum);
+				InputDuplicatex(femmodel,SedimentHeadSubstepEnum,SedimentHeadOldEnum);
 				if (isefficientlayer){
-					InputDuplicatex(femmodel,EplHeadHydrostepEnum,EplHeadOldEnum);
-					InputDuplicatex(femmodel,HydrologydcEplThicknessHydrostepEnum,HydrologydcEplThicknessOldEnum);
+					InputDuplicatex(femmodel,EplHeadSubstepEnum,EplHeadOldEnum);
+					InputDuplicatex(femmodel,HydrologydcEplThicknessSubstepEnum,HydrologydcEplThicknessOldEnum);
 				}
 				/*Proceed now to heads computations*/
+				if(VerboseSolution()) _printf0_("   computing water heads\n");
 				solutionsequence_hydro_nonlinear(femmodel);
+				/*If no substeps are present we want to duplicate the results for coupling purposes*/
+				InputDuplicatex(femmodel,SedimentHeadSubstepEnum,SedimentHeadEnum);
+				InputDuplicatex(femmodel,EffectivePressureSubstepEnum,EffectivePressureEnum);
+				if (isefficientlayer){
+					InputDuplicatex(femmodel,EplHeadSubstepEnum,EplHeadEnum);
+					InputDuplicatex(femmodel,HydrologydcEplThicknessSubstepEnum,HydrologydcEplThicknessEnum);
+				}
 			}
 		}
-	}
+		if(VerboseSolution()) printf("   hydroDC done\n");
+	}
+
+	/*Using the SHAKTI model*/
 	else if (hydrology_model==HydrologyshaktiEnum){
 		femmodel->SetCurrentConfiguration(HydrologyShaktiAnalysisEnum);
@@ -126,4 +154,24 @@
 		delete analysis;
 	}
+
+	/*Using the GlaDS model*/
+	else if (hydrology_model==HydrologyGlaDSEnum){
+		HydrologyGlaDSAnalysis* analysis = new HydrologyGlaDSAnalysis();
+		femmodel->SetCurrentConfiguration(HydrologyGlaDSAnalysisEnum);
+
+		/*Set fields as old*/
+		InputDuplicatex(femmodel,HydraulicPotentialEnum,HydraulicPotentialOldEnum);
+		InputDuplicatex(femmodel,HydrologySheetThicknessEnum,HydrologySheetThicknessOldEnum);
+		analysis->SetChannelCrossSectionOld(femmodel);
+
+		/*Solve for new potential*/
+		solutionsequence_glads_nonlinear(femmodel);
+
+		if(VerboseSolution()) _printf0_("   updating effective pressure\n");
+		analysis->UpdateEffectivePressure(femmodel);
+		delete analysis;
+	}
+
+	/*Using the PISM hydrology model*/
 	else if (hydrology_model==HydrologypismEnum){
 		femmodel->SetCurrentConfiguration(HydrologyPismAnalysisEnum);
@@ -137,5 +185,5 @@
 	}
 	if(save_results){
-		if(VerboseSolution()) _printf0_("   saving results \n");
+		if(VerboseSolution()) _printf0_("   saving hydrology results \n");
 		if(hydrology_model==HydrologydcEnum && ThawedNodes==0){
 			if(VerboseSolution()) _printf0_("   No thawed node hydro is skiped \n");}
@@ -151,5 +199,4 @@
 		xDelete<char*>(requested_outputs);
 	}
-
 	/*End profiler*/
 	femmodel->profiler->Stop(HYDROLOGYCORE);
Index: /issm/trunk/src/c/cores/masstransport_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/masstransport_core.cpp	(revision 24312)
+++ /issm/trunk/src/c/cores/masstransport_core.cpp	(revision 24313)
@@ -61,4 +61,5 @@
 		}
 		femmodel->SetCurrentConfiguration(MasstransportAnalysisEnum);
+		InputDuplicatex(femmodel,ThicknessEnum,ThicknessOldEnum);
 		if(stabilization==4){
 			solutionsequence_fct(femmodel);
Index: /issm/trunk/src/c/cores/movingfront_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/movingfront_core.cpp	(revision 24312)
+++ /issm/trunk/src/c/cores/movingfront_core.cpp	(revision 24313)
@@ -16,5 +16,5 @@
 
 	/* intermediaries */
-	bool save_results,isstressbalance,ismasstransport,isthermal,isenthalpy,islevelset,ismovingfront;
+	bool save_results,isstressbalance,ismasstransport,isthermal,isenthalpy,islevelset,ismovingfront,killicebergs;
 	int  domaintype, num_extrapol_vars, index,reinit_frequency,step;
 	int* extrapol_vars=NULL;
@@ -29,4 +29,5 @@
 	femmodel->parameters->FindParam(&ismovingfront,TransientIsmovingfrontEnum);
 	femmodel->parameters->FindParam(&reinit_frequency,LevelsetReinitFrequencyEnum);
+	femmodel->parameters->FindParam(&killicebergs,LevelsetKillIcebergsEnum);
 	femmodel->parameters->FindParam(&step,StepEnum);
 	if(isthermal && domaintype==Domain3DEnum) femmodel->parameters->FindParam(&isenthalpy,ThermalIsenthalpyEnum);
@@ -36,4 +37,5 @@
 	/* start the work from here */
 	Calvingx(femmodel);
+	FrontalForcingsx(femmodel);
 	if(VerboseSolution()) _printf0_("   computing level set transport\n");
 
@@ -87,4 +89,10 @@
 	delete analysis;
 
+	/*Kill ice berg to avoid free body motion*/
+	if(killicebergs){
+		if(VerboseSolution()) _printf0_("   looking for icebergs to kill\n");
+		KillIcebergsx(femmodel);
+	}
+
 	/*Reset levelset if needed*/
 	if(reinit_frequency && (step%reinit_frequency==0)){
Index: /issm/trunk/src/c/cores/sealevelrise_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/sealevelrise_core.cpp	(revision 24312)
+++ /issm/trunk/src/c/cores/sealevelrise_core.cpp	(revision 24313)
@@ -82,5 +82,4 @@
 	bool iscoupler;
 	int  solution_type;
-	int  configuration_type;
 	int  modelid,earthid;
 	bool istransientmasstransport;
@@ -100,5 +99,4 @@
 	femmodel->parameters->FindParam(&frequency,SealevelriseGeodeticRunFrequencyEnum);
 	femmodel->parameters->FindParam(&count,SealevelriseRunCountEnum);
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 	femmodel->parameters->FindParam(&horiz,SealevelriseHorizEnum);
 	femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
@@ -227,4 +225,5 @@
 	Vector<IssmDouble> *SL  = NULL; 
 	Vector<IssmDouble> *steric_rate_g  = NULL; 
+	Vector<IssmDouble> *hydro_rate_g  = NULL; 
 	Vector<IssmDouble> *U_esa_rate= NULL;
 	Vector<IssmDouble> *N_esa_rate= NULL;
@@ -257,4 +256,5 @@
 	GetVectorFromInputsx(&SL,femmodel,SealevelEnum,VertexSIdEnum);
 	GetVectorFromInputsx(&steric_rate_g,femmodel,SealevelriseStericRateEnum,VertexSIdEnum);
+	GetVectorFromInputsx(&hydro_rate_g,femmodel,SealevelriseHydroRateEnum,VertexSIdEnum);
 	if(geodetic){
 		GetVectorFromInputsx(&U_esa_rate,femmodel,SealevelUEsaRateEnum,VertexSIdEnum);
@@ -264,5 +264,5 @@
 	}
 
-	/*compute: sea level change = initial sea level + (N_gia_rate+N_esa_rate)  * dt + steric_rate * dt*/
+	/*compute: sea level change = initial sea level + (N_gia_rate+N_esa_rate)  * dt + steric_rate + hydro_rate* dt*/
 	if(geodetic){
 		SL->AXPY(N_gia_rate,dt);
@@ -270,4 +270,5 @@
 	}
 	SL->AXPY(steric_rate_g,dt);
+	SL->AXPY(hydro_rate_g,dt);
 
 	/*compute new bedrock position: */
@@ -285,4 +286,5 @@
 	delete SL;
 	delete steric_rate_g;
+	delete hydro_rate_g;
 	if(geodetic){
 		delete U_esa_rate;
@@ -301,5 +303,4 @@
 
 	/*parameters: */
-	int  configuration_type;
 	int  gsize;
 	bool spherical=true;
@@ -313,5 +314,4 @@
 
 	/*recover parameters:*/
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 	femmodel->parameters->FindParam(&loop,SealevelriseLoopIncrementEnum);
 
@@ -320,5 +320,5 @@
 
 	/*Figure out size of g-set deflection vector and allocate solution vector: */
-	gsize = femmodel->nodes->NumberOfDofs(configuration_type,GsetEnum);
+	gsize = femmodel->nodes->NumberOfDofs(GsetEnum);
 
 	/*Initialize:*/
@@ -360,5 +360,4 @@
 	bool save_results;
 	int  gsize;
-	int  configuration_type;
 	bool spherical=true;
 	bool converged=true;
@@ -379,5 +378,4 @@
 	femmodel->parameters->FindParam(&eps_rel,SealevelriseReltolEnum);
 	femmodel->parameters->FindParam(&eps_abs,SealevelriseAbstolEnum);
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 	femmodel->parameters->FindParam(&loop,SealevelriseLoopIncrementEnum);
 
@@ -389,5 +387,5 @@
 
 	/*Figure out size of g-set deflection vector and allocate solution vector: */
-	gsize = femmodel->nodes->NumberOfDofs(configuration_type,GsetEnum);
+	gsize = femmodel->nodes->NumberOfDofs(GsetEnum);
 
 	/*Initialize:*/
@@ -477,5 +475,4 @@
 
 	/*parameters: */
-	int configuration_type;
 	int  gsize;
 	bool spherical=true;
@@ -491,10 +488,9 @@
 
 	/*retrieve some parameters:*/
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 	femmodel->parameters->FindParam(&loop,SealevelriseLoopIncrementEnum);
 	femmodel->parameters->FindParam(&horiz,SealevelriseHorizEnum);
 
 	/*find size of vectors:*/
-	gsize      = femmodel->nodes->NumberOfDofs(configuration_type,GsetEnum);
+	gsize      = femmodel->nodes->NumberOfDofs(GsetEnum);
 
 	/*intialize vectors:*/
Index: /issm/trunk/src/c/cores/smb_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/smb_core.cpp	(revision 24312)
+++ /issm/trunk/src/c/cores/smb_core.cpp	(revision 24313)
@@ -1,5 +1,5 @@
 /*!\file: smb_core.cpp
- * \brief: core of the smb solution 
- */ 
+ * \brief: core of the smb solution
+ */
 
 #include "./cores.h"
@@ -11,8 +11,8 @@
 
 void smb_core(FemModel* femmodel){
-	
+
 	/*Start profiler*/
 	femmodel->profiler->Start(SMBCORE);
-	
+
 	/*parameters: */
 	Analysis* analysis=NULL;
@@ -33,12 +33,74 @@
 	if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,SmbRequestedOutputsEnum);
 
-	if(VerboseSolution()) _printf0_("   computing smb \n");
+	/*sub steping specifics*/
+	int dtslices;
+	int numaveragedinput;
+	femmodel->parameters->FindParam(&dtslices,SmbStepsPerStepEnum);
+	/*intermiedaries to deal with averaging*/
+	static const int substeplist[2] = {SmbMassBalanceSubstepEnum,SmbRunoffSubstepEnum};
+	static const int transientlist[2] = {SmbMassBalanceTransientEnum,SmbRunoffTransientEnum};
+	static const int averagelist[2] = {SmbMassBalanceEnum,SmbRunoffEnum};
+	std::vector<int> substepinput;
+	std::vector<int> transientinput;
+	std::vector<int> averagedinput;
 
-	analysis = new SmbAnalysis();
-	analysis->Core(femmodel);
-	delete analysis;
+	/*define which variable needs to be averaged on the sub-timestep and initialize as needed*/
+	if(smb_model==SMBgradientscomponentsEnum){
+		numaveragedinput = 2;
+		substepinput.assign(substeplist,substeplist+2);
+		transientinput.assign(transientlist,transientlist+2);
+		averagedinput.assign(averagelist,averagelist+2);
+	}
+
+	/*if yes compute necessary intermiedaries and start looping*/
+	if (dtslices>1){
+		int        substep;
+		IssmDouble global_time,subtime,yts;
+		IssmDouble dt,subdt;
+
+		femmodel->parameters->FindParam(&global_time,TimeEnum);
+		femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+		femmodel->parameters->FindParam(&yts,ConstantsYtsEnum);
+
+		subtime=global_time-dt; //getting the time back to the start of the timestep
+		subdt=dt/dtslices; //computing substep from dt and a divider
+		substep=0;
+		femmodel->parameters->SetParam(subdt,TimesteppingTimeStepEnum);
+
+		femmodel->InitTransientOutputx(&transientinput[0],numaveragedinput);
+		while(substep<dtslices){ //loop on sub dts
+			substep+=1;
+			subtime+=subdt;
+			femmodel->parameters->SetParam(subtime,TimeEnum);
+         if(VerboseSolution()) _printf0_("sub iteration " << substep << "/" << dtslices << "  time [yr]: " << setprecision(4) << subtime/yts << " (time step: " << subdt/yts << ")\n");
+         if(VerboseSolution()) _printf0_("   computing smb\n");
+         analysis = new SmbAnalysis();
+			if(VerboseSolution()) _printf0_("   Calling core\n");
+			analysis->Core(femmodel);
+         /*If we have a sub-timestep we store the substep inputs in a transient input here*/
+         femmodel->StackTransientOutputx(&substepinput[0],&transientinput[0],subtime,numaveragedinput);
+			delete analysis;
+		}
+      /*averaging the transient input*/
+		femmodel->AverageTransientOutputx(&transientinput[0],&averagedinput[0],global_time-dt,subtime,numaveragedinput);
+		/*and reset timesteping variables to original*/
+		femmodel->parameters->SetParam(global_time,TimeEnum);
+		femmodel->parameters->SetParam(dt,TimesteppingTimeStepEnum);
+	}
+	else{
+      if(VerboseSolution()) _printf0_("   computing smb \n");
+      analysis = new SmbAnalysis();
+		analysis->Core(femmodel);
+		/*If no substeps are present we want to duplicate the computed substep enum for coupling purposes*/
+		if(smb_model==SMBgradientscomponentsEnum){
+			for(int i=0;i<numaveragedinput;i++){
+				InputDuplicatex(femmodel,substepinput[i],averagedinput[i]);
+			}
+		}
+		delete analysis;
+	}
 
 	if(save_results){
-		if(VerboseSolution()) _printf0_("   saving results\n");
+		if(VerboseSolution()) _printf0_("   saving smb results\n");
 		femmodel->RequestedOutputsx(&femmodel->results,requested_outputs,numoutputs);
 	}
Index: /issm/trunk/src/c/cores/stressbalance_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/stressbalance_core.cpp	(revision 24312)
+++ /issm/trunk/src/c/cores/stressbalance_core.cpp	(revision 24313)
@@ -1,5 +1,5 @@
 /*!\file: stressbalance_core.cpp
- * \brief: core of the stressbalance solution 
- */ 
+ * \brief: core of the stressbalance solution
+ */
 
 #include "./cores.h"
@@ -56,5 +56,8 @@
 
 		/*Take the last velocity into account so that the velocity on the SSA domain is not zero*/
-		if(isSSA || isL1L2 || isHO ) ResetBoundaryConditions(femmodel,StressbalanceSIAAnalysisEnum);
+		if(isSSA || isL1L2 || isHO ){
+			femmodel->SetCurrentConfiguration(StressbalanceSIAAnalysisEnum);
+			ResetBoundaryConditions(femmodel,StressbalanceSIAAnalysisEnum);
+		}
 
 		analysis = new StressbalanceSIAAnalysis();
@@ -63,5 +66,8 @@
 
 		/*Reset velocities for other ice flow models*/
-		if(isSSA || isL1L2 || isHO) ResetBoundaryConditions(femmodel,StressbalanceAnalysisEnum);
+		if(isSSA || isL1L2 || isHO){
+			femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
+			ResetBoundaryConditions(femmodel,StressbalanceAnalysisEnum);
+		}
 	}
 
@@ -85,11 +91,12 @@
 
 	if(save_results){
-		if(VerboseSolution()) _printf0_("   saving results\n");
+		if(VerboseSolution()) _printf0_("   saving stressbalance results\n");
 		femmodel->RequestedOutputsx(&femmodel->results,requested_outputs,numoutputs);
+		if(VerboseSolution()) _printf0_("   results saved\n");
 	}
 
 	if(solution_type==StressbalanceSolutionEnum && !control_analysis)femmodel->RequestedDependentsx();
 
-	/*Free ressources:*/	
+	/*Free ressources:*/
 	if(numoutputs){for(int i=0;i<numoutputs;i++){xDelete<char>(requested_outputs[i]);} xDelete<char*>(requested_outputs);}
 
Index: /issm/trunk/src/c/cores/surfaceslope_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/surfaceslope_core.cpp	(revision 24312)
+++ /issm/trunk/src/c/cores/surfaceslope_core.cpp	(revision 24313)
@@ -1,5 +1,5 @@
 /*!\file: surfaceslope_core.cpp
- * \brief: core of the slope solution 
- */ 
+ * \brief: core of the slope solution
+ */
 
 #include "./cores.h"
@@ -38,5 +38,5 @@
 
 	if(save_results){
-		if(VerboseSolution()) _printf0_("saving results:\n");
+		if(VerboseSolution()) _printf0_("saving surface slopes results:\n");
 		if(domaintype!=Domain2DverticalEnum){
 			int outputs[2] = {SurfaceSlopeXEnum,SurfaceSlopeYEnum};
Index: /issm/trunk/src/c/cores/thermal_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/thermal_core.cpp	(revision 24312)
+++ /issm/trunk/src/c/cores/thermal_core.cpp	(revision 24313)
@@ -1,5 +1,5 @@
 /*!\file: thermal_core.cpp
- * \brief: core of the thermal solution 
- */ 
+ * \brief: core of the thermal solution
+ */
 
 #include "./cores.h"
@@ -12,8 +12,8 @@
 
 void thermal_core(FemModel* femmodel){
-	
+
 	/*Start profiler*/
         femmodel->profiler->Start(THERMALCORE);
-	
+
 	/*intermediary*/
 	bool   save_results,isenthalpy;
@@ -49,11 +49,11 @@
 
 	if(save_results){
-		if(VerboseSolution()) _printf0_("   saving results\n");
+		if(VerboseSolution()) _printf0_("   saving thermal results\n");
 		femmodel->RequestedOutputsx(&femmodel->results,requested_outputs,numoutputs);
 	}
 
-	/*Free ressources:*/	
+	/*Free ressources:*/
 	if(numoutputs){for(int i=0;i<numoutputs;i++){xDelete<char>(requested_outputs[i]);} xDelete<char*>(requested_outputs);}
-	
+
 	/*End profiler*/
         femmodel->profiler->Stop(THERMALCORE);
Index: /issm/trunk/src/c/cores/transient_core.cpp
===================================================================
--- /issm/trunk/src/c/cores/transient_core.cpp	(revision 24312)
+++ /issm/trunk/src/c/cores/transient_core.cpp	(revision 24313)
@@ -25,4 +25,5 @@
 	int        timestepping;
 	int        output_frequency;
+	int        sb_coupling_frequency;
 	int        recording_frequency;
 	int        domaintype,groundingline_migration,smb_model,amr_frequency,amr_restart;
@@ -48,4 +49,5 @@
 	femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
 	femmodel->parameters->FindParam(&output_frequency,SettingsOutputFrequencyEnum);
+	femmodel->parameters->FindParam(&sb_coupling_frequency,SettingsSbCouplingFrequencyEnum);
 	femmodel->parameters->FindParam(&timestepping,TimesteppingTypeEnum);
 	femmodel->parameters->FindParam(&isstressbalance,TransientIsstressbalanceEnum);
@@ -72,139 +74,18 @@
 	#if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_)
 	if(amr_frequency){
-		femmodel->parameters->FindParam(&amr_restart,AmrRestartEnum);
-		if(amr_restart) femmodel->ReMesh();
-	}
+	  femmodel->parameters->FindParam(&amr_restart,AmrRestartEnum);
+	  if(amr_restart) femmodel->ReMesh();
+  }
 	#endif
 
-	if(isoceancoupling){ /*{{{*/
-		#ifndef _HAVE_AD_
-		if(VerboseSolution()) _printf0_("   ocean coupling: initialization \n");
-		int my_rank;
-		ISSM_MPI_Comm tomitgcmcomm;
-		ISSM_MPI_Status status;
-
-		my_rank=IssmComm::GetRank();
-		GenericParam<ISSM_MPI_Comm>* parcom = dynamic_cast<GenericParam<ISSM_MPI_Comm>*>(femmodel->parameters->FindParamObject(ToMITgcmCommEnum));
-		if(!parcom)_error_("TransferForcing error message: could not find ToMITgcmCommEnum communicator");
-		tomitgcmcomm=parcom->GetParameterValue();
-
-		int oceangridnxsize,oceangridnysize,ngrids_ocean,nels_ocean;
-		IssmDouble  oceantime,coupling_time;
-		IssmDouble *oceangridx;
-		IssmDouble *oceangridy;
-		IssmDouble *icebase_oceangrid = NULL;
-		IssmDouble *icemask_oceangrid = NULL;
-		IssmDouble* x_ice             = NULL;
-		IssmDouble* y_ice             = NULL;
-		IssmDouble* lat_ice           = NULL;
-		IssmDouble* lon_ice           = NULL;
-		IssmDouble* z_ice             = NULL;
-		IssmDouble* icebase           = NULL;
-		IssmDouble* icemask           = NULL;
-		int*        index_ice         = NULL;
-		int*        index_ocean       = NULL;
-		int         ngrids_ice=femmodel->vertices->NumberOfVertices();
-		int         nels_ice=femmodel->elements->NumberOfElements();
-
-		/*Recover fixed parameters and store them*/
-		femmodel->parameters->FindParam(&coupling_time,TimesteppingCouplingTimeEnum);
-		if(my_rank==0){
-			ISSM_MPI_Send(&coupling_time,1,ISSM_MPI_DOUBLE,0,10001000,tomitgcmcomm);
-			ISSM_MPI_Recv(&oceangridnxsize,1,ISSM_MPI_INT,0,10001003,tomitgcmcomm,&status);
-			ISSM_MPI_Recv(&oceangridnysize,1,ISSM_MPI_INT,0,10001004,tomitgcmcomm,&status);
-		}
-		ngrids_ocean=oceangridnxsize*oceangridnysize;
-		ISSM_MPI_Bcast(&oceangridnxsize,1,ISSM_MPI_INT,0,IssmComm::GetComm());
-		ISSM_MPI_Bcast(&oceangridnysize,1,ISSM_MPI_INT,0,IssmComm::GetComm());
-		ISSM_MPI_Bcast(&ngrids_ocean,1,ISSM_MPI_INT,0,IssmComm::GetComm());
-		ISSM_MPI_Bcast(&oceantime,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
-		femmodel->parameters->SetParam(oceangridnxsize,OceanGridNxEnum);
-		femmodel->parameters->SetParam(oceangridnysize,OceanGridNyEnum);
-		if(my_rank==0){
-			oceangridx = xNew<IssmDouble>(ngrids_ocean);
-			ISSM_MPI_Recv(oceangridx,ngrids_ocean,ISSM_MPI_DOUBLE,0,10001005,tomitgcmcomm,&status);
-			oceangridy = xNew<IssmDouble>(ngrids_ocean);
-			ISSM_MPI_Recv(oceangridy,ngrids_ocean,ISSM_MPI_DOUBLE,0,10001006,tomitgcmcomm,&status);
-
-			/*Exchange varying parameters for the initialization*/
-			ISSM_MPI_Send(&time,1,ISSM_MPI_DOUBLE,0,10001001,tomitgcmcomm);
-			ISSM_MPI_Recv(&oceantime,1,ISSM_MPI_DOUBLE,0,10001002,tomitgcmcomm,&status);
-		}
-		if(my_rank!=0){
-			oceangridx=xNew<IssmDouble>(ngrids_ocean);
-			oceangridy=xNew<IssmDouble>(ngrids_ocean);
-		}
-		ISSM_MPI_Bcast(oceangridx,ngrids_ocean,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
-		ISSM_MPI_Bcast(oceangridy,ngrids_ocean,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
-		femmodel->parameters->SetParam(oceangridx,ngrids_ocean,OceanGridXEnum);
-		femmodel->parameters->SetParam(oceangridy,ngrids_ocean,OceanGridYEnum);
-
-		/*Interpolate ice base and mask onto ocean grid*/
-		femmodel->GetMesh(femmodel->vertices,femmodel->elements,&x_ice,&y_ice,&z_ice,&index_ice);
-		BamgTriangulatex(&index_ocean,&nels_ocean,oceangridx,oceangridy,ngrids_ocean);
-		femmodel->vertices->LatLonList(&lat_ice,&lon_ice);
-		GetVectorFromInputsx(&icebase,femmodel,BaseEnum,VertexSIdEnum);
-		Options* options = new Options();
-		GenericOption<double> *odouble = new GenericOption<double>();
-		const char* name = "default";
-		odouble->name =xNew<char>(strlen(name)+1);
-		memcpy(odouble->name,name,(strlen(name)+1)*sizeof(char));
-		odouble->value=+9999.;
-		odouble->numel=1;
-		odouble->ndims=1;
-		odouble->size=NULL;
-		options->AddOption(odouble);
-		InterpFromMeshToMesh2dx(&icebase_oceangrid,index_ice,lon_ice,lat_ice,ngrids_ice,nels_ice,
-						icebase,ngrids_ice,1,
-						oceangridx,oceangridy,ngrids_ocean,options);
-		delete options;
-		xDelete<IssmDouble>(icebase);
-
-		GetVectorFromInputsx(&icemask,femmodel,MaskIceLevelsetEnum,VertexSIdEnum);
-		Options* options2 = new Options();
-		GenericOption<double> *odouble2 = new GenericOption<double>();
-		const char* name2 = "default";
-		odouble2->name =xNew<char>(strlen(name2)+1);
-		memcpy(odouble2->name,name2,(strlen(name2)+1)*sizeof(char));
-		odouble2->value=+1.;
-		odouble2->numel=1;
-		odouble2->ndims=1;
-		odouble2->size=NULL;
-		options2->AddOption(odouble2);
-		InterpFromMeshToMesh2dx(&icemask_oceangrid,index_ice,lon_ice,lat_ice,ngrids_ice,nels_ice,
-					icemask,ngrids_ice,1,oceangridx,oceangridy,ngrids_ocean,options2);
-		delete options2;
-		xDelete<IssmDouble>(icemask);
-
-		/*Put +9999 for places where there is no ice!*/
-		for(int i=0;i<ngrids_ocean;i++) if(icemask_oceangrid[i]>0.) icebase_oceangrid[i]=+9999.;
-		xDelete<IssmDouble>(icemask_oceangrid);
-
-		if(my_rank==0){
-			ISSM_MPI_Send(icebase_oceangrid,ngrids_ocean,ISSM_MPI_DOUBLE,0,10001008,tomitgcmcomm);
-		}
-
-		/*Delete*/
-		xDelete<int>(index_ice);
-		xDelete<int>(index_ocean);
-		xDelete<IssmDouble>(lat_ice);
-		xDelete<IssmDouble>(lon_ice);
-		xDelete<IssmDouble>(x_ice);
-		xDelete<IssmDouble>(y_ice);
-		xDelete<IssmDouble>(z_ice);
-		xDelete<IssmDouble>(icebase_oceangrid);
-		xDelete<IssmDouble>(oceangridx);
-		xDelete<IssmDouble>(oceangridy);
-	#else
-	_error_("not supported");
+	#if defined(_HAVE_OCEAN_ )
+	if(isoceancoupling) OceanExchangeDatax(femmodel,true);
 	#endif
-	}
-	/*}}}*/
-
-		IssmDouble  output_value;
-		int         num_dependents;
-		IssmPDouble *dependents;
-		DataSet*    dependent_objects=NULL;
-		IssmDouble  J=0.;
+
+	IssmDouble  output_value;
+	int         num_dependents;
+	IssmPDouble *dependents;
+	DataSet*    dependent_objects=NULL;
+	IssmDouble  J=0.;
 
 	if(iscontrol && isautodiff){
@@ -245,123 +126,7 @@
 		femmodel->parameters->SetParam(save_results,SaveResultsEnum);
 
-		if(isoceancoupling){ /*{{{*/
-
-			#ifndef _HAVE_AD_
-			if(VerboseSolution()) _printf0_("   ocean coupling: exchanging information\n");
-			int my_rank;
-			ISSM_MPI_Comm tomitgcmcomm;
-			ISSM_MPI_Status status;
-
-			my_rank=IssmComm::GetRank();
-			GenericParam<ISSM_MPI_Comm>* parcom = dynamic_cast<GenericParam<ISSM_MPI_Comm>*>(femmodel->parameters->FindParamObject(ToMITgcmCommEnum));
-			if(!parcom)_error_("TransferForcing error message: could not find ToMITgcmCommEnum communicator");
-			tomitgcmcomm=parcom->GetParameterValue();
-			int ngrids_ocean, nels_ocean;
-			IssmDouble oceantime;
-			IssmDouble rho_ice;
-			IssmDouble *oceanmelt         = NULL;
-			IssmDouble *icebase_oceangrid = NULL;
-			IssmDouble *icemask_oceangrid = NULL;
-			IssmDouble *oceangridx        = NULL;
-			IssmDouble *oceangridy        = NULL;
-			IssmDouble *x_ice             = NULL;
-			IssmDouble *y_ice             = NULL;
-			IssmDouble *lat_ice           = NULL;
-			IssmDouble *lon_ice           = NULL;
-			IssmDouble *z_ice             = NULL;
-			IssmDouble *icebase           = NULL;
-			IssmDouble *icemask           = NULL;
-			IssmDouble *melt_mesh         = NULL;
-			int        *index_ice         = NULL;
-			int        *index_ocean       = NULL;
-			int         ngrids_ice=femmodel->vertices->NumberOfVertices();
-			int         nels_ice=femmodel->elements->NumberOfElements();
-
-			/*Recover mesh and inputs needed*/
-			femmodel->parameters->FindParam(&rho_ice,MaterialsRhoIceEnum);
-			femmodel->GetMesh(femmodel->vertices,femmodel->elements,&x_ice,&y_ice,&z_ice,&index_ice);
-			femmodel->parameters->FindParam(&oceangridx,&ngrids_ocean,OceanGridXEnum);
-			femmodel->parameters->FindParam(&oceangridy,&ngrids_ocean,OceanGridYEnum);
-			BamgTriangulatex(&index_ocean,&nels_ocean,oceangridx,oceangridy,ngrids_ocean);
-
-			femmodel->vertices->LatLonList(&lat_ice,&lon_ice);
-
-			/*Interpolate ice base and mask onto ocean grid*/
-			GetVectorFromInputsx(&icebase,femmodel,BaseEnum,VertexSIdEnum);
-			Options* options = new Options();
-			GenericOption<double> *odouble = new GenericOption<double>();
-			const char* name = "default";
-			odouble->name =xNew<char>(strlen(name)+1);
-			memcpy(odouble->name,name,(strlen(name)+1)*sizeof(char));
-			odouble->value=+9999.;
-			odouble->numel=1;
-			odouble->ndims=1;
-			odouble->size=NULL;
-			options->AddOption(odouble);
-			InterpFromMeshToMesh2dx(&icebase_oceangrid,index_ice,lon_ice,lat_ice,ngrids_ice,nels_ice,
-						icebase,ngrids_ice,1,oceangridx,oceangridy,ngrids_ocean,options);
-			delete options;
-			xDelete<IssmDouble>(icebase);
-
-			GetVectorFromInputsx(&icemask,femmodel,MaskIceLevelsetEnum,VertexSIdEnum);
-			Options* options2 = new Options();
-			GenericOption<double> *odouble2 = new GenericOption<double>();
-			const char* name2 = "default";
-			odouble2->name =xNew<char>(strlen(name2)+1);
-			memcpy(odouble2->name,name2,(strlen(name2)+1)*sizeof(char));
-			odouble2->value=+1.;
-			odouble2->numel=1;
-			odouble2->ndims=1;
-			odouble2->size=NULL;
-			options2->AddOption(odouble2);
-			InterpFromMeshToMesh2dx(&icemask_oceangrid,index_ice,lon_ice,lat_ice,ngrids_ice,nels_ice,
-						icemask,ngrids_ice,1,oceangridx,oceangridy,ngrids_ocean,options2);
-			delete options2;
-			xDelete<IssmDouble>(icemask);
-
-			/*Put +9999 for places where there is no ice!*/
-			for(int i=0;i<ngrids_ocean;i++) if(icemask_oceangrid[i]>0.) icebase_oceangrid[i]=+9999.;
-			xDelete<IssmDouble>(icemask_oceangrid);
-
-			/*Send and receive data*/
-			if(my_rank==0){
-				ISSM_MPI_Send(&time,1,ISSM_MPI_DOUBLE,0,10001001,tomitgcmcomm);
-				ISSM_MPI_Recv(&oceantime,1,ISSM_MPI_DOUBLE,0,10001002,tomitgcmcomm,&status);
-				if((oceantime - time > 0.1*yts) & (oceantime - time < -0.1*yts)) _error_("Ocean and ice time are starting to diverge");
-				oceanmelt = xNew<IssmDouble>(ngrids_ocean);
-				ISSM_MPI_Recv(oceanmelt,ngrids_ocean,ISSM_MPI_DOUBLE,0,10001007,tomitgcmcomm,&status);
-				ISSM_MPI_Send(icebase_oceangrid,ngrids_ocean,ISSM_MPI_DOUBLE,0,10001008,tomitgcmcomm);
-			}
-			ISSM_MPI_Bcast(&oceantime,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
-			if(my_rank!=0) oceanmelt=xNew<IssmDouble>(ngrids_ocean);
-			ISSM_MPI_Bcast(oceanmelt,ngrids_ocean,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
-
-			/*Interp melt onto ice grid*/
-			InterpFromMeshToMesh2dx(&melt_mesh,index_ocean,oceangridx,oceangridy,ngrids_ocean,nels_ocean,
-						oceanmelt,ngrids_ocean,1,
-						lon_ice,lat_ice,ngrids_ice,NULL);
-
-			for(int i=0;i<ngrids_ice;i++) melt_mesh[i]=-melt_mesh[i]/rho_ice; //heat flux provided by ocean is in kg/m^2/s
-			InputUpdateFromVectorx(femmodel,melt_mesh,BasalforcingsFloatingiceMeltingRateEnum,VertexSIdEnum);
-
-			/*Delete*/
-			xDelete<int>(index_ice);
-			xDelete<int>(index_ocean);
-			xDelete<IssmDouble>(lat_ice);
-			xDelete<IssmDouble>(lon_ice);
-			xDelete<IssmDouble>(x_ice);
-			xDelete<IssmDouble>(y_ice);
-			xDelete<IssmDouble>(z_ice);
-			xDelete<IssmDouble>(melt_mesh);
-			xDelete<IssmDouble>(oceangridx);
-			xDelete<IssmDouble>(oceangridy);
-			xDelete<IssmDouble>(oceanmelt);
-			xDelete<IssmDouble>(icebase_oceangrid);
-
-		#else
-		_error_("not supported");
-		#endif
-		}
-		/*}}}*/
+	#if defined(_HAVE_OCEAN_ )
+	if(isoceancoupling) OceanExchangeDatax(femmodel,false);
+	#endif
 
 		if(isthermal && domaintype==Domain3DEnum){
@@ -371,27 +136,46 @@
 				femmodel->parameters->FindParam(&smb_model,SmbEnum);
 				if(isenthalpy){
-					if(smb_model==SMBpddEnum)				ResetBoundaryConditions(femmodel,EnthalpyAnalysisEnum);
-					if(smb_model==SMBd18opddEnum)			ResetBoundaryConditions(femmodel,EnthalpyAnalysisEnum);
-					if(smb_model==SMBpddSicopolisEnum)	ResetBoundaryConditions(femmodel,EnthalpyAnalysisEnum);
+					if(smb_model==SMBpddEnum || smb_model==SMBd18opddEnum || smb_model==SMBpddSicopolisEnum){
+						femmodel->SetCurrentConfiguration(EnthalpyAnalysisEnum);
+						ResetBoundaryConditions(femmodel,EnthalpyAnalysisEnum);
+					}
 				}
 				else{
-					if(smb_model==SMBpddEnum)				ResetBoundaryConditions(femmodel,ThermalAnalysisEnum);
-					if(smb_model==SMBd18opddEnum)			ResetBoundaryConditions(femmodel,ThermalAnalysisEnum);
-					if(smb_model==SMBpddSicopolisEnum)	ResetBoundaryConditions(femmodel,ThermalAnalysisEnum);
+					if(smb_model==SMBpddEnum || smb_model==SMBd18opddEnum || smb_model==SMBpddSicopolisEnum){
+						femmodel->SetCurrentConfiguration(ThermalAnalysisEnum);
+						ResetBoundaryConditions(femmodel,ThermalAnalysisEnum);
+					}
 				}
 			}
 			thermal_core(femmodel);
 		}
-
-		/*shifting smb position to have runoff value*/
-		if(issmb) smb_core(femmodel);
-
-		if(ishydrology) hydrology_core(femmodel);
-
-		if(isstressbalance) stressbalance_core(femmodel);
-
-		if(isdamageevolution) damage_core(femmodel);
-
-		if(ismovingfront)	movingfront_core(femmodel);
+		/* Using Hydrology dc  coupled we need to compute smb in the hydrology inner time loop*/
+		if(issmb) {
+			if(VerboseSolution()) _printf0_("   computing smb\n");
+			smb_core(femmodel);
+		}
+
+		if(ishydrology){
+			if(VerboseSolution()) _printf0_("   computing hydrology\n");
+			int hydrology_model;
+			hydrology_core(femmodel);
+			femmodel->parameters->FindParam(&hydrology_model,HydrologyModelEnum);
+			if(hydrology_model!=HydrologydcEnum && issmb)smb_core(femmodel);
+		}
+
+		if(isstressbalance && (step%sb_coupling_frequency==0 || step==1) ) {
+			if(VerboseSolution()) _printf0_("   computing stress balance\n");
+			stressbalance_core(femmodel);
+		}
+
+		if(isdamageevolution) {
+			if(VerboseSolution()) _printf0_("   computing damage\n");
+			damage_core(femmodel);
+		}
+
+		if(ismovingfront)	{
+			if(VerboseSolution()) _printf0_("   computing moving front\n");
+			movingfront_core(femmodel);
+		}
 
 		/* from here on, prepare geometry for next time step*/
@@ -399,4 +183,5 @@
 
 		if(ismasstransport){
+			if(VerboseSolution()) _printf0_("   computing mass transport\n");
 			bmb_core(femmodel);
 			masstransport_core(femmodel);
Index: /issm/trunk/src/c/datastructures/DataSet.cpp
===================================================================
--- /issm/trunk/src/c/datastructures/DataSet.cpp	(revision 24312)
+++ /issm/trunk/src/c/datastructures/DataSet.cpp	(revision 24313)
@@ -173,10 +173,4 @@
 				this->AddObject(matestar);
 			}
-			else if(obj_enum==MatparEnum){
-				Matpar* matpar=NULL;
-				matpar=new Matpar();
-				matpar->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
-				this->AddObject(matpar);
-			}
 			else if(obj_enum==SpcStaticEnum){
 				SpcStatic* spcstatic=NULL;
@@ -299,4 +293,10 @@
 				this->AddObject(penpair);
 			}
+			else if(obj_enum==DoubleExternalResultEnum){
+				GenericExternalResult<double>* result=new GenericExternalResult<double>();
+				result->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
+				result->Echo();
+				this->AddObject(result);
+			}
 			else _error_("could not recognize enum type: " << obj_enum << ": " << EnumToStringx(obj_enum) ); 
 		}
@@ -438,4 +438,9 @@
 			id_offsets[i]=i;
 			sorted_ids[i]=objects[i]->Id();
+
+			/*In debugging mode, make sure Ids are ACTUALLY sorted...*/
+			#ifdef _ISSM_DEBUG_
+			//if(i>0) _assert_(sorted_ids[i]>sorted_ids[i-1]);
+			#endif
 		}
 	}
Index: /issm/trunk/src/c/main/EnvironmentFinalize.cpp
===================================================================
--- /issm/trunk/src/c/main/EnvironmentFinalize.cpp	(revision 24312)
+++ /issm/trunk/src/c/main/EnvironmentFinalize.cpp	(revision 24313)
@@ -19,7 +19,7 @@
 	/*Print closing statement*/
 	ISSM_MPI_Comm_rank(ISSM_MPI_COMM_WORLD,&my_rank);
-	if(!my_rank) printf("closing MPI\n");
 
 	/*Finalize: */
+	//if(!my_rank) printf("closing MPI\n");
 	ISSM_MPI_Finalize();
 }
Index: /issm/trunk/src/c/main/esmfbinders.cpp
===================================================================
--- /issm/trunk/src/c/main/esmfbinders.cpp	(revision 24312)
+++ /issm/trunk/src/c/main/esmfbinders.cpp	(revision 24313)
@@ -72,5 +72,5 @@
 
 						/*Recover rho_ice: */
-						rho_ice=element->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
+						rho_ice=element->FindParam(MaterialsRhoIceEnum);
 
 						/*Recover area of element: */
Index: /issm/trunk/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp
===================================================================
--- /issm/trunk/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp	(revision 24313)
@@ -12,5 +12,4 @@
 	int  fsize,ssize,flocalsize,slocalsize;
 	int  connectivity, numberofdofspernode;
-	int  configuration_type;
 	int  m,n,M,N;
 	int *d_nnz = NULL;
@@ -27,14 +26,13 @@
 
 	/*retrieve parameters: */
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 	femmodel->parameters->FindParam(&connectivity,MeshAverageVertexConnectivityEnum);
 
 	/*retrieve node info*/
-	fsize      = femmodel->nodes->NumberOfDofs(configuration_type,FsetEnum);
-	ssize      = femmodel->nodes->NumberOfDofs(configuration_type,SsetEnum);
-	flocalsize = femmodel->nodes->NumberOfDofsLocal(configuration_type,FsetEnum);
-	slocalsize = femmodel->nodes->NumberOfDofsLocal(configuration_type,SsetEnum);
-
-	numberofdofspernode=femmodel->nodes->MaxNumDofs(configuration_type,GsetEnum);
+	fsize      = femmodel->nodes->NumberOfDofs(FsetEnum);
+	ssize      = femmodel->nodes->NumberOfDofs(SsetEnum);
+	flocalsize = femmodel->nodes->NumberOfDofsLocal(FsetEnum);
+	slocalsize = femmodel->nodes->NumberOfDofsLocal(SsetEnum);
+
+	numberofdofspernode=femmodel->nodes->MaxNumDofs(GsetEnum);
 
 	/*if our matrices are coming from issm, we don't do dynamic allocation like Petsc 
@@ -93,5 +91,4 @@
 	/*Intermediary*/
 	int      i,j,k,index,offset,count;
-	int      configuration_type;
 	int      d_nz,o_nz;
 	Element *element            = NULL;
@@ -109,17 +106,15 @@
 	int *o_nnz = NULL;
 
-	/*retrive parameters: */
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
-
 	/*Get vector size and number of nodes*/
-	int numnodes            = femmodel->nodes->NumberOfNodes(configuration_type);
+	int numnodes            = femmodel->nodes->NumberOfNodes();
+	int localmasters        = femmodel->nodes->NumberOfNodesLocal();
 	int localnumnodes       = femmodel->nodes->Size();
-	int numberofdofspernode = femmodel->nodes->MaxNumDofs(configuration_type,GsetEnum);
-	int M                   = femmodel->nodes->NumberOfDofs(configuration_type,set1enum);
-	int N                   = femmodel->nodes->NumberOfDofs(configuration_type,set2enum);
-	int m                   = femmodel->nodes->NumberOfDofsLocal(configuration_type,set1enum);
-	int n                   = femmodel->nodes->NumberOfDofsLocal(configuration_type,set2enum);
+	int numberofdofspernode = femmodel->nodes->MaxNumDofs(GsetEnum);
+	int M                   = femmodel->nodes->NumberOfDofs(set1enum);
+	int N                   = femmodel->nodes->NumberOfDofs(set2enum);
+	int m                   = femmodel->nodes->NumberOfDofsLocal(set1enum);
+	int n                   = femmodel->nodes->NumberOfDofsLocal(set2enum);
 	int numnodesperelement  = femmodel->elements->MaxNumNodes();
-	int numnodesperload     = femmodel->loads->MaxNumNodes(configuration_type);
+	int numnodesperload     = femmodel->loads->MaxNumNodes();
 
 	/*First, we are building chaining vectors so that we know what nodes are
@@ -153,10 +148,9 @@
 	/*Chain for loads*/
 	head_l         = xNew<int>(localnumnodes); for(i=0;i<localnumnodes;i++) head_l[i]=-1;
-	next_l         = xNew<int>(femmodel->loads->Size(configuration_type)*numnodesperload);
-	count2offset_l = xNew<int>(femmodel->loads->Size(configuration_type)*numnodesperload);
+	next_l         = xNew<int>(femmodel->loads->Size()*numnodesperload);
+	count2offset_l = xNew<int>(femmodel->loads->Size()*numnodesperload);
 	k=0;
 	for(i=0;i<femmodel->loads->Size();i++){
 		load = xDynamicCast<Load*>(femmodel->loads->GetObjectByOffset(i));
-		if(!load->InAnalysis(configuration_type)) continue;
 		lidlist = xNew<int>(load->GetNumberOfNodes());
 		load->GetNodesLidList(lidlist);
@@ -178,8 +172,8 @@
 	bool *flags                  = xNew<bool>(localnumnodes);
 	int  *flagsindices           = xNew<int>(localnumnodes);
-	int  *d_connectivity         = xNewZeroInit<int>(numnodes);
-	int  *o_connectivity         = xNewZeroInit<int>(numnodes);
-	int  *connectivity_clone     = xNewZeroInit<int>(numnodes);
-	int  *all_connectivity_clone = xNewZeroInit<int>(numnodes);
+	int  *d_connectivity         = xNewZeroInit<int>(localnumnodes);
+	int  *o_connectivity         = xNewZeroInit<int>(localnumnodes);
+
+	Vector<IssmDouble> *connectivity_clone= new Vector<IssmDouble>(localmasters,numnodes);
 
 	/*Resetting flags to false at eahc iteration takes a lot of time, so we keep track of the flags
@@ -191,48 +185,46 @@
 	for(i=0;i<femmodel->nodes->Size();i++){
 		Node* node=xDynamicCast<Node*>(femmodel->nodes->GetObjectByOffset(i));
-		if(node->InAnalysis(configuration_type)){
-
-			/*Reinitialize flags to false*/
-			j=0;
-			while(j<localnumnodes){
-				if(flagsindices[j]>=0){
-					flags[flagsindices[j]] = false;
-					flagsindices[j]        = -1;
-					j++;
-				}
-				else{
-					break;
-				}
-			}
-
-			//for(j=0;j<localnumnodes;j++) flags[j]=false;
-
-			/*Loop over elements that hold node number i*/
-			//if(head_e[node->Lid()]==-1 && head_l[node->Lid()]==-1){
-			//	printf("[%i] vertex %i\n",IssmComm::GetRank(),node->Lid()+1);
-			//}
-			for(j=head_e[node->Lid()];j!=-1;j=next_e[j]){
-				offset=count2offset_e[j];
-				element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(offset));
-				element->SetwiseNodeConnectivity(&d_nz,&o_nz,node,flags,flagsindices,set1enum,set2enum);
-				if(node->IsClone()){
-					connectivity_clone[node->Sid()]+=d_nz+o_nz;
-				}
-				else{
-					d_connectivity[node->Sid()]+=d_nz;
-					o_connectivity[node->Sid()]+=o_nz;
-				}
-			}
-			for(j=head_l[node->Lid()];j!=-1;j=next_l[j]){
-				offset=count2offset_l[j];
-				load=xDynamicCast<Load*>(femmodel->loads->GetObjectByOffset(offset));
-				load->SetwiseNodeConnectivity(&d_nz,&o_nz,node,flags,flagsindices,set1enum,set2enum);
-				if(node->IsClone()){
-					connectivity_clone[node->Sid()]+=d_nz+o_nz;
-				}
-				else{
-					d_connectivity[node->Sid()]+=d_nz;
-					o_connectivity[node->Sid()]+=o_nz;
-				}
+
+		/*Reinitialize flags to false*/
+		j=0;
+		while(j<localnumnodes){
+			if(flagsindices[j]>=0){
+				flags[flagsindices[j]] = false;
+				flagsindices[j]        = -1;
+				j++;
+			}
+			else{
+				break;
+			}
+		}
+
+		//for(j=0;j<localnumnodes;j++) flags[j]=false;
+
+		/*Loop over elements that hold node number i*/
+		//if(head_e[node->Lid()]==-1 && head_l[node->Lid()]==-1){
+		//	printf("[%i] vertex %i\n",IssmComm::GetRank(),node->Lid()+1);
+		//}
+		for(j=head_e[node->Lid()];j!=-1;j=next_e[j]){
+			offset=count2offset_e[j];
+			element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(offset));
+			element->SetwiseNodeConnectivity(&d_nz,&o_nz,node,flags,flagsindices,set1enum,set2enum);
+			if(node->IsClone()){
+				connectivity_clone->SetValue(node->Pid(),d_nz+o_nz,ADD_VAL);
+			}
+			else{
+				d_connectivity[node->Lid()]+=d_nz;
+				o_connectivity[node->Lid()]+=o_nz;
+			}
+		}
+		for(j=head_l[node->Lid()];j!=-1;j=next_l[j]){
+			offset=count2offset_l[j];
+			load=xDynamicCast<Load*>(femmodel->loads->GetObjectByOffset(offset));
+			load->SetwiseNodeConnectivity(&d_nz,&o_nz,node,flags,flagsindices,set1enum,set2enum);
+			if(node->IsClone()){
+				connectivity_clone->SetValue(node->Pid(),d_nz+o_nz,ADD_VAL);
+			}
+			else{
+				d_connectivity[node->Lid()]+=d_nz;
+				o_connectivity[node->Lid()]+=o_nz;
 			}
 		}
@@ -248,6 +240,8 @@
 
 	/*sum over all cpus*/
-	ISSM_MPI_Allreduce((void*)connectivity_clone,(void*)all_connectivity_clone,numnodes,ISSM_MPI_INT,ISSM_MPI_SUM,IssmComm::GetComm());
-	xDelete<int>(connectivity_clone);
+	connectivity_clone->Assemble();
+	IssmDouble* serial_connectivity_clone=NULL;
+	femmodel->GetLocalVectorWithClonesNodes(&serial_connectivity_clone,connectivity_clone);
+	delete connectivity_clone;
 
 	if(set1enum==FsetEnum){
@@ -257,9 +251,9 @@
 		for(i=0;i<femmodel->nodes->Size();i++){
 			Node* node=xDynamicCast<Node*>(femmodel->nodes->GetObjectByOffset(i));
-			if(node->InAnalysis(configuration_type) && !node->IsClone()){
-				for(j=0;j<node->indexing.fsize;j++){
+			if(!node->IsClone()){
+				for(j=0;j<node->fsize;j++){
 					_assert_(count<m);
-					d_nnz[count]=numberofdofspernode*(d_connectivity[node->Sid()] + all_connectivity_clone[node->Sid()]);
-					o_nnz[count]=numberofdofspernode*(o_connectivity[node->Sid()] + all_connectivity_clone[node->Sid()]);
+					d_nnz[count]=numberofdofspernode*(d_connectivity[node->Lid()] + reCast<int>(serial_connectivity_clone[node->Lid()]));
+					o_nnz[count]=numberofdofspernode*(o_connectivity[node->Lid()] + reCast<int>(serial_connectivity_clone[node->Lid()]));
 					if(d_nnz[count]>n)   d_nnz[count]=n;
 					if(o_nnz[count]>N-n) o_nnz[count]=N-n;
@@ -275,5 +269,5 @@
 	xDelete<int>(d_connectivity);
 	xDelete<int>(o_connectivity);
-	xDelete<int>(all_connectivity_clone);
+	xDelete<IssmDouble>(serial_connectivity_clone);
 
 	/*Allocate ouptput pointer*/
Index: /issm/trunk/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp
===================================================================
--- /issm/trunk/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp	(revision 24313)
@@ -16,7 +16,6 @@
 void AverageOntoPartitionx(double** paverage, Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,double* vertex_response){
 
-	int     dummy;
 	int     npart;
-	double *qmu_part  = NULL;
+	double *qmu_vpart  = NULL;
 
 	/*output: */
@@ -27,5 +26,5 @@
 
 	/*First, recover qmu partition of vertices: */
-	parameters->FindParam(&qmu_part,&dummy,QmuPartitionEnum);
+	parameters->FindParam(&qmu_vpart,NULL,QmuVpartitionEnum);
 
 	/*Some parameters: */
@@ -42,5 +41,5 @@
 	for(int i=0;i<elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
-		element->AverageOntoPartition(partition_contributions,partition_areas,vertex_response,qmu_part);
+		element->AverageOntoPartition(partition_contributions,partition_areas,vertex_response,qmu_vpart);
 	}
 
@@ -56,5 +55,5 @@
 
 	/*Free ressources:*/
-	xDelete<double>(qmu_part);
+	xDelete<double>(qmu_vpart);
 	delete partition_contributions;
 	delete partition_areas;
Index: /issm/trunk/src/c/modules/Bamgx/Bamgx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Bamgx/Bamgx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/Bamgx/Bamgx.cpp	(revision 24313)
@@ -21,5 +21,5 @@
 	int i;
 	int noerr=1;
-	double hminaniso=1e-100; 
+	double hminaniso=1e-100;
 	Mesh* Thr=NULL;
 	Mesh* Thb=NULL;
@@ -31,6 +31,6 @@
 	verbosity=bamgopts->verbose;
 
-	// no metric -> no smoothing 
-	if (bamgopts->metric==NULL) nbsmooth=0; 
+	// no metric -> no smoothing
+	if (bamgopts->metric==NULL) nbsmooth=0;
 
 	/*If no mesh in input, generate one*/
@@ -84,8 +84,8 @@
 		/*Anisotropic mesh adaptation {{{*/
 
-		// read background mesh 
+		// read background mesh
 		if (verbosity>0) _printf_("Anisotropic mesh adaptation\n");
 		if (verbosity>1) _printf_("   Processing initial mesh and geometry...\n");
-		Mesh BTh(bamggeom_in,bamgmesh_in,bamgopts); 
+		Mesh BTh(bamggeom_in,bamgmesh_in,bamgopts);
 
 		//Make Quadtree from background mesh
@@ -101,5 +101,5 @@
 			BTh.ReadMetric(bamgopts);
 		}
-		else { 
+		else {
 			if (verbosity>1) _printf_("   Generating initial Metric...\n");
 			Metric Mhmax(bamgopts->hmax);
@@ -114,5 +114,5 @@
 
 		// change using hVertices if provided
-		if(bamgopts->hVertices && bamgopts->hVerticesSize[0]==BTh.nbv){
+		if(bamgopts->hVertices && bamgopts->hVerticesLength==BTh.nbv){
 			if (verbosity>1) _printf_("   Merging Metric with hVertices...\n");
 			for (i=0;i<BTh.nbv;i++){
Index: /issm/trunk/src/c/modules/Calvingx/Calvingx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Calvingx/Calvingx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/Calvingx/Calvingx.cpp	(revision 24313)
@@ -17,5 +17,4 @@
 		case DefaultCalvingEnum:
 		case CalvingMinthicknessEnum:
-			break;
 		case CalvingHabEnum:
 			break;
Index: /issm/trunk/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp	(revision 24313)
@@ -30,7 +30,5 @@
 	for(i=0;i<loads->Size();i++){
 		load=(Load*)loads->GetObjectByOffset(i);
-		if (load->InAnalysis(configuration_type)){
-			load->Configure(elements,loads,nodes,vertices,materials,parameters);
-		}
+		load->Configure(elements,loads,nodes,vertices,materials,parameters);
 	}
 	if(VerboseMProcessor()) _printf0_("      Configuring materials...\n");
Index: /issm/trunk/src/c/modules/ConstraintsStatex/ConstraintsStatex.cpp
===================================================================
--- /issm/trunk/src/c/modules/ConstraintsStatex/ConstraintsStatex.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ConstraintsStatex/ConstraintsStatex.cpp	(revision 24313)
@@ -33,10 +33,8 @@
 	for(int i=0;i<femmodel->loads->Size();i++){
 		Load* load=(Load*)femmodel->loads->GetObjectByOffset(i);
-		if(load->InAnalysis(analysis_type)){
-			if(load->ObjectEnum()==PengridEnum){
-				Pengrid* pengrid=(Pengrid*)load;
-				pengrid->ConstraintActivate(&unstable);
-				num_unstable_constraints += unstable;
-			}
+		if(load->ObjectEnum()==PengridEnum){
+			Pengrid* pengrid=(Pengrid*)load;
+			pengrid->ConstraintActivate(&unstable);
+			num_unstable_constraints += unstable;
 		}
 	}
Index: /issm/trunk/src/c/modules/ConstraintsStatex/RiftConstraintsState.cpp
===================================================================
--- /issm/trunk/src/c/modules/ConstraintsStatex/RiftConstraintsState.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ConstraintsStatex/RiftConstraintsState.cpp	(revision 24313)
@@ -20,9 +20,7 @@
 	for (i=0;i<loads->Size();i++){
 		Load* load=(Load*)loads->GetObjectByOffset(i);
-		if(load->InAnalysis(configuration_type)){
-			if(RiftfrontEnum==loads->GetEnum(i)){
-				found=1;
-				break;
-			}
+		if(RiftfrontEnum==loads->GetEnum(i)){
+			found=1;
+			break;
 		}
 	}
@@ -77,12 +75,7 @@
 
 			load=(Load*)loads->GetObjectByOffset(i);
-			if(load->InAnalysis(configuration_type)){
-
-				riftfront=(Riftfront*)load;
-
-				riftfront->Constrain(&unstable);
-
-				num_unstable_constraints+=unstable;
-			}
+			riftfront=(Riftfront*)load;
+			riftfront->Constrain(&unstable);
+			num_unstable_constraints+=unstable;
 		}
 	}
@@ -114,11 +107,8 @@
 
 			load=(Load*)loads->GetObjectByOffset(i);
-			if(load->InAnalysis(configuration_type)){
-
-				riftfront=(Riftfront*)load;
-				if (riftfront->IsFrozen()){
-					found=1;
-					break;
-				}
+			riftfront=(Riftfront*)load;
+			if (riftfront->IsFrozen()){
+				found=1;
+				break;
 			}
 		}
@@ -146,12 +136,7 @@
 
 		if (RiftfrontEnum==loads->GetEnum(i)){
-
 			load=(Load*)loads->GetObjectByOffset(i);
-			if(load->InAnalysis(configuration_type)){
-
-				riftfront=(Riftfront*)load;
-				riftfront->FreezeConstraints();
-			}
-
+			riftfront=(Riftfront*)load;
+			riftfront->FreezeConstraints();
 		}
 	}
Index: /issm/trunk/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp
===================================================================
--- /issm/trunk/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp	(revision 24313)
@@ -36,6 +36,6 @@
 	for (i=0;i<femmodel->loads->Size();i++){
 		load=(Load*)femmodel->loads->GetObjectByOffset(i);
-		if(load->InAnalysis(configuration_type)) load->CreateJacobianMatrix(Jff);
-		if(load->InAnalysis(configuration_type)) load->PenaltyCreateJacobianMatrix(Jff,kmax);
+		load->CreateJacobianMatrix(Jff);
+		load->PenaltyCreateJacobianMatrix(Jff,kmax);
 	}
 	Jff->Assemble();
Index: /issm/trunk/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.cpp	(revision 24313)
@@ -8,5 +8,5 @@
 #include "../../toolkits/toolkits.h"
 
-void CreateNodalConstraintsx( Vector<IssmDouble>** pys, Nodes* nodes,int configuration_type){
+void CreateNodalConstraintsx( Vector<IssmDouble>** pys, Nodes* nodes){
 
 	bool  oldalloc  = false;
@@ -20,6 +20,6 @@
 
 	/*figure out how many dofs we have: */
-	ssize=nodes->NumberOfDofs(configuration_type,SsetEnum);
-	slocalsize = nodes->NumberOfDofsLocal(configuration_type,SsetEnum);
+	ssize=nodes->NumberOfDofs(SsetEnum);
+	slocalsize = nodes->NumberOfDofsLocal(SsetEnum);
 
 	/*allocate:*/
@@ -33,7 +33,5 @@
 	for(int i=0;i<nodes->Size();i++){
 		Node* node=(Node*)nodes->GetObjectByOffset(i);
-		if (node->InAnalysis(configuration_type)){
-			node->CreateNodalConstraints(ys);
-		}
+		node->CreateNodalConstraints(ys);
 	}
 
Index: /issm/trunk/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.h
===================================================================
--- /issm/trunk/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.h	(revision 24312)
+++ /issm/trunk/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.h	(revision 24313)
@@ -8,5 +8,5 @@
 
 /* local prototypes: */
-void CreateNodalConstraintsx( Vector<IssmDouble>** pys, Nodes* nodes,int configuration_type);
+void CreateNodalConstraintsx( Vector<IssmDouble>** pys, Nodes* nodes);
 
 #endif  /* _CREATENODALCONSTRAINTSX_H */
Index: /issm/trunk/src/c/modules/Damagex/Damagex.cpp
===================================================================
--- /issm/trunk/src/c/modules/Damagex/Damagex.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/Damagex/Damagex.cpp	(revision 24313)
@@ -24,4 +24,8 @@
 			/* Damage calculated using source term in DamageEvolutionAnalysis */
 			break;
+		case 3:
+			if(VerboseModule()) _printf0_("   computing damage using source term in advection scheme\n");
+			/* Damage calculated using source term in DamageEvolutionAnalysis */
+			break;
 		default:
 			_error_("Damage law "<<EnumToStringx(damagelaw)<<" not implemented yet");
Index: /issm/trunk/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp
===================================================================
--- /issm/trunk/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/FloatingiceMeltingRatePicox/FloatingiceMeltingRatePicox.cpp	(revision 24313)
@@ -12,20 +12,20 @@
 	bool isplume;
 
-   /*First, reset all melt to 0 */
-   for(int i=0;i<femmodel->elements->Size();i++){
-	      Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
-	      int numvertices = element->GetNumberOfVertices();
-	      IssmDouble* values = xNewZeroInit<IssmDouble>(numvertices);
-	      element->AddInput(BasalforcingsFloatingiceMeltingRateEnum,values,P1Enum);
-	      xDelete<IssmDouble>(values);
-	   }
+	/*First, reset all melt to 0 */
+	for(int i=0;i<femmodel->elements->Size();i++){
+		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+		int numvertices = element->GetNumberOfVertices();
+		IssmDouble* values = xNewZeroInit<IssmDouble>(numvertices);
+		element->AddInput(BasalforcingsFloatingiceMeltingRateEnum,values,P1Enum);
+		xDelete<IssmDouble>(values);
+	}
 
 	/*PICO melt rate parameterization (Reese et al., 2018)*/
-   femmodel->parameters->FindParam(&maxbox,BasalforcingsPicoMaxboxcountEnum);
-   UpdateBoxIdsPico(femmodel);
-   ComputeBoxAreasPico(femmodel);
-   for(int i=0;i<maxbox;i++){
-	      UpdateBoxPico(femmodel,i);
-	      ComputeAverageOceanvarsPico(femmodel,i);
+	femmodel->parameters->FindParam(&maxbox,BasalforcingsPicoMaxboxcountEnum);
+	UpdateBoxIdsPico(femmodel);
+	ComputeBoxAreasPico(femmodel);
+	for(int i=0;i<maxbox;i++){
+		UpdateBoxPico(femmodel,i);
+		ComputeAverageOceanvarsPico(femmodel,i);
 	}
 
@@ -103,5 +103,5 @@
 void ComputeBoxAreasPico(FemModel* femmodel){/*{{{*/
 
-	int num_basins,maxbox,basinid,boxid;
+	int num_basins,maxbox,basinid,boxid,domaintype;
 	IssmDouble dist_max,area;
 
@@ -113,8 +113,12 @@
 	for(int i=0;i<femmodel->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
-		if(!element->IsIceInElement() || !element->IsFloating()) continue;
-		element->inputs->GetInputValue(&boxid,BasalforcingsPicoBoxIdEnum);
-		element->inputs->GetInputValue(&basinid,BasalforcingsPicoBasinIdEnum);
-		boxareas[basinid*maxbox+boxid]+=element->GetHorizontalSurfaceArea();
+		if(!element->IsOnBase()) continue;
+		Element* basalelement = element->SpawnBasalElement();
+		if(!basalelement->IsIceInElement() || !basalelement->IsFloating()) continue;
+		basalelement->inputs->GetInputValue(&boxid,BasalforcingsPicoBoxIdEnum);
+		basalelement->inputs->GetInputValue(&basinid,BasalforcingsPicoBasinIdEnum);
+		boxareas[basinid*maxbox+boxid]+=basalelement->GetHorizontalSurfaceArea();
+		basalelement->FindParam(&domaintype,DomainTypeEnum);
+		if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
 	}
 
@@ -140,5 +144,5 @@
 void ComputeAverageOceanvarsPico(FemModel* femmodel, int boxid){/*{{{*/
 
-	int num_basins, basinid, maxbox, M;
+	int num_basins, basinid, maxbox, M, domaintype;
 	IssmDouble area, toc, soc, overturning;
 	IssmDouble* boxareas=NULL;
@@ -157,20 +161,24 @@
 	for(int i=0;i<femmodel->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
-		if(!element->IsIceInElement() || !element->IsFloating()) continue;
+		if(!element->IsOnBase()) continue;
+		Element* basalelement = element->SpawnBasalElement();
+		if(!basalelement->IsIceInElement() || !basalelement->IsFloating()) continue;
 		int el_boxid;
-		element->inputs->GetInputValue(&el_boxid,BasalforcingsPicoBoxIdEnum);
+		basalelement->inputs->GetInputValue(&el_boxid,BasalforcingsPicoBoxIdEnum);
 		if(el_boxid!=boxid) continue;
 
-		Input* tocs_input=element->GetInput(BasalforcingsPicoSubShelfOceanTempEnum); _assert_(tocs_input); 
-		Input* socs_input=element->GetInput(BasalforcingsPicoSubShelfOceanSalinityEnum); _assert_(socs_input);
-
-		element->inputs->GetInputValue(&basinid,BasalforcingsPicoBasinIdEnum);
-		Gauss* gauss=element->NewGauss(1); gauss->GaussPoint(0);
+		Input* tocs_input=basalelement->GetInput(BasalforcingsPicoSubShelfOceanTempEnum); _assert_(tocs_input); 
+		Input* socs_input=basalelement->GetInput(BasalforcingsPicoSubShelfOceanSalinityEnum); _assert_(socs_input);
+
+		basalelement->inputs->GetInputValue(&basinid,BasalforcingsPicoBasinIdEnum);
+		Gauss* gauss=basalelement->NewGauss(1); gauss->GaussPoint(0);
 		tocs_input->GetInputValue(&toc,gauss);
 		socs_input->GetInputValue(&soc,gauss);
 		delete gauss;
-		area=element->GetHorizontalSurfaceArea();
+		area=basalelement->GetHorizontalSurfaceArea();
 		toc_weighted_avg[basinid]+=toc*area;
 		soc_weighted_avg[basinid]+=soc*area;
+		basalelement->FindParam(&domaintype,DomainTypeEnum);
+		if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
 	}
 
@@ -194,17 +202,21 @@
 		for(int i=0;i<femmodel->elements->Size();i++){
 			Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
-			if(!element->IsIceInElement() || !element->IsFloating()) continue;
+			if(!element->IsOnBase()) continue;
+			Element* basalelement = element->SpawnBasalElement();
+			if(!basalelement->IsIceInElement() || !basalelement->IsFloating()) continue;
 			int el_boxid;
-			element->inputs->GetInputValue(&el_boxid,BasalforcingsPicoBoxIdEnum);
+			basalelement->inputs->GetInputValue(&el_boxid,BasalforcingsPicoBoxIdEnum);
 			if(el_boxid!=boxid) continue;
 
-	     	Input* overturnings_input=element->GetInput(BasalforcingsPicoSubShelfOceanOverturningEnum); _assert_(overturnings_input);
-
-			element->inputs->GetInputValue(&basinid,BasalforcingsPicoBasinIdEnum);
-			Gauss* gauss=element->NewGauss(1); gauss->GaussPoint(0);
+	     	Input* overturnings_input=basalelement->GetInput(BasalforcingsPicoSubShelfOceanOverturningEnum); _assert_(overturnings_input);
+
+			basalelement->inputs->GetInputValue(&basinid,BasalforcingsPicoBasinIdEnum);
+			Gauss* gauss=basalelement->NewGauss(1); gauss->GaussPoint(0);
 			overturnings_input->GetInputValue(&overturning,gauss);
 			delete gauss;
-			area=element->GetHorizontalSurfaceArea();
+			area=basalelement->GetHorizontalSurfaceArea();
 			overturning_weighted_avg[basinid]+=overturning*area;
+			basalelement->FindParam(&domaintype,DomainTypeEnum);
+			if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
 		}
 
Index: /issm/trunk/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp
===================================================================
--- /issm/trunk/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp	(revision 24313)
@@ -22,18 +22,26 @@
 			break;
 		case LinearFloatingMeltRateEnum:
-			if(VerboseSolution())_printf0_("	call Linear Floating melting rate module\n");
+			if(VerboseSolution())_printf0_("	  call Linear Floating melting rate module\n");
 			LinearFloatingiceMeltingRatex(femmodel);
 			break;
 		case MismipFloatingMeltRateEnum:
-			if(VerboseSolution())_printf0_("	call Mismip Floating melting rate module\n");
+			if(VerboseSolution())_printf0_("	  call Mismip Floating melting rate module\n");
 			MismipFloatingiceMeltingRatex(femmodel);
 			break;
 		case SpatialLinearFloatingMeltRateEnum:
-			if(VerboseSolution())_printf0_("	call Spatial Linear Floating melting rate module\n");
+			if(VerboseSolution())_printf0_("	  call Spatial Linear Floating melting rate module\n");
 			SpatialLinearFloatingiceMeltingRatex(femmodel);
 			break;
 		case BasalforcingsPicoEnum:
-			if(VerboseSolution())_printf0_(" call Pico Floating melting rate module\n");
+			if(VerboseSolution())_printf0_("   call Pico Floating melting rate module\n");
 			FloatingiceMeltingRatePicox(femmodel);
+			break;
+		case BasalforcingsIsmip6Enum:
+			if(VerboseSolution())_printf0_("   call ISMIP 6 Floating melting rate module\n");
+			FloatingiceMeltingRateIsmip6x(femmodel);
+			break;
+		case BeckmannGoosseFloatingMeltRateEnum:
+			if(VerboseSolution())_printf0_("        call BeckmannGoosse Floating melting rate module\n");
+			BeckmannGoosseFloatingiceMeltingRatex(femmodel);
 			break;
 		default:
@@ -67,2 +75,132 @@
 }
 /*}}}*/
+void FloatingiceMeltingRateIsmip6x(FemModel* femmodel){/*{{{*/
+
+	int         num_basins, basinid, num_depths, domaintype;
+	IssmDouble  area, tf, base, time;
+	bool        islocal;
+	IssmDouble* tf_depths = NULL;
+
+	femmodel->parameters->FindParam(&num_basins,BasalforcingsIsmip6NumBasinsEnum);
+	femmodel->parameters->FindParam(&tf_depths,&num_depths,BasalforcingsIsmip6TfDepthsEnum); _assert_(tf_depths); 
+	femmodel->parameters->FindParam(&islocal,BasalforcingsIsmip6IsLocalEnum);
+
+	/*Binary search works for vectors that are sorted in increasing order only, make depths positive*/
+	for(int i=0;i<num_depths;i++) tf_depths[i] = -tf_depths[i];
+
+	IssmDouble* tf_weighted_avg     = xNewZeroInit<IssmDouble>(num_basins);
+	IssmDouble* tf_weighted_avg_cpu = xNewZeroInit<IssmDouble>(num_basins);
+	IssmDouble* areas_summed        = xNewZeroInit<IssmDouble>(num_basins);
+	IssmDouble* areas_summed_cpu    = xNewZeroInit<IssmDouble>(num_basins);
+
+	/*Get TF at each ice shelf point - linearly intepolate in depth and time*/
+	for(int i=0;i<femmodel->elements->Size();i++){
+		Element* element     = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+		int      numvertices = element->GetNumberOfVertices();
+
+		/*Set melt to 0 if non floating*/
+		if(!element->IsIceInElement() || !element->IsFloating() || !element->IsOnBase()){
+			IssmDouble* values = xNewZeroInit<IssmDouble>(numvertices);
+			element->AddInput(BasalforcingsFloatingiceMeltingRateEnum,values,P1Enum);
+			element->AddInput(BasalforcingsIsmip6TfShelfEnum,values,P1Enum);
+			xDelete<IssmDouble>(values);
+			continue;
+		}
+
+		/*Get TF on all vertices*/
+		IssmDouble* tf_test        = xNew<IssmDouble>(numvertices);
+		IssmDouble* depth_vertices = xNew<IssmDouble>(numvertices);
+		Input*      tf_input = element->GetInput(BasalforcingsIsmip6TfEnum); _assert_(tf_input);
+
+		element->GetInputListOnVertices(&depth_vertices[0],BaseEnum);
+
+		Gauss* gauss=element->NewGauss();
+		for(int iv=0;iv<numvertices;iv++){
+			gauss->GaussVertex(iv);
+
+			/*Find out where the ice shelf base is within tf_depths*/
+			IssmDouble depth = -depth_vertices[iv]; /*NOTE: make sure we are dealing with depth>0*/
+			int offset;
+			int found=binary_search(&offset,depth,tf_depths,num_depths); 
+			if(!found) _error_("depth not found");
+
+			if (offset==-1){
+				/*get values for the first depth: */
+				_assert_(depth<=tf_depths[0]);
+				tf_input->GetInputValue(&tf_test[iv],gauss,0);
+			}
+			else if(offset==num_depths-1){
+				/*get values for the last time: */
+				_assert_(depth>=tf_depths[num_depths-1]);
+				tf_input->GetInputValue(&tf_test[iv],gauss,num_depths-1);
+			}
+			else {
+				/*get values between two times [offset:offset+1], Interpolate linearly*/
+				_assert_(depth>=tf_depths[offset] && depth<tf_depths[offset+1]);
+				IssmDouble deltaz=tf_depths[offset+1]-tf_depths[offset];
+				IssmDouble alpha2=(depth-tf_depths[offset])/deltaz;
+				IssmDouble alpha1=(1.-alpha2);
+				IssmDouble tf1,tf2;
+				tf_input->GetInputValue(&tf1,gauss,offset);
+				tf_input->GetInputValue(&tf2,gauss,offset+1);
+				tf_test[iv] = alpha1*tf1 + alpha2*tf2;
+			}
+		}
+
+		element->AddInput(BasalforcingsIsmip6TfShelfEnum,tf_test,P1Enum);
+		xDelete<IssmDouble>(tf_test);
+		xDelete<IssmDouble>(depth_vertices);
+		delete gauss;
+	}
+
+	if(!islocal) {
+		/*Compute sums of tf*area and shelf-area per cpu*/
+		for(int i=0;i<femmodel->elements->Size();i++){
+			Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+			if(!element->IsOnBase() || !element->IsIceInElement() || !element->IsFloating()) continue;
+			/*Spawn basal element if on base to compute element area*/
+			Element* basalelement = element->SpawnBasalElement();
+			Input* tf_input=basalelement->GetInput(BasalforcingsIsmip6TfShelfEnum); _assert_(tf_input);
+			basalelement->inputs->GetInputValue(&basinid,BasalforcingsIsmip6BasinIdEnum);
+			Gauss* gauss=basalelement->NewGauss(1); gauss->GaussPoint(0);
+			tf_input->GetInputValue(&tf,gauss);
+			delete gauss;
+			area=basalelement->GetHorizontalSurfaceArea();
+			tf_weighted_avg[basinid]+=tf*area;
+			areas_summed[basinid]   +=area;	
+			/*Delete spawned element if we are in 3D*/
+			basalelement->FindParam(&domaintype,DomainTypeEnum);
+			if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+		}
+
+		/*Syncronize across cpus*/
+		ISSM_MPI_Allreduce(tf_weighted_avg,tf_weighted_avg_cpu,num_basins,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
+		ISSM_MPI_Allreduce(areas_summed,areas_summed_cpu,num_basins,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
+
+		/*Compute weighted means and save*/
+		for(int k=0;k<num_basins;k++){tf_weighted_avg_cpu[k] = tf_weighted_avg_cpu[k]/areas_summed_cpu[k];}
+		femmodel->parameters->AddObject(new DoubleVecParam(BasalforcingsIsmip6AverageTfEnum,tf_weighted_avg_cpu,num_basins));
+	}
+
+   /*Compute meltrates*/
+	for(int i=0;i<femmodel->elements->Size();i++){
+		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+		element->Ismip6FloatingiceMeltingRate();
+	}
+
+	/*Cleanup and return */
+	xDelete<IssmDouble>(tf_weighted_avg);
+	xDelete<IssmDouble>(tf_weighted_avg_cpu);
+	xDelete<IssmDouble>(areas_summed);
+	xDelete<IssmDouble>(areas_summed_cpu);
+	xDelete<IssmDouble>(tf_depths);
+}
+/*}}}*/
+void BeckmannGoosseFloatingiceMeltingRatex(FemModel* femmodel){/*{{{*/
+
+	for(int i=0;i<femmodel->elements->Size();i++){
+		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+		element->BeckmannGoosseFloatingiceMeltingRate();
+	}
+}
+/*}}}*/
Index: /issm/trunk/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.h
===================================================================
--- /issm/trunk/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.h	(revision 24312)
+++ /issm/trunk/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.h	(revision 24313)
@@ -14,4 +14,6 @@
 void SpatialLinearFloatingiceMeltingRatex(FemModel* femmodel);
 void MismipFloatingiceMeltingRatex(FemModel* femmodel);
+void FloatingiceMeltingRateIsmip6x(FemModel* femmodel);
+void BeckmannGoosseFloatingiceMeltingRatex(FemModel* femmodel);
 
 #endif  /* _FloatingiceMeltingRatex_H*/
Index: /issm/trunk/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp	(revision 24313)
+++ /issm/trunk/src/c/modules/FrontalForcingsx/FrontalForcingsx.cpp	(revision 24313)
@@ -0,0 +1,26 @@
+/*!\file FrontalForcingsx
+ * \brief: compute ice frontal melting rate
+ */
+
+#include "./FrontalForcingsx.h"
+#include "../../shared/shared.h"
+#include "../../toolkits/toolkits.h"
+
+void FrontalForcingsx(FemModel* femmodel){
+
+	/*Recover melt_parameterization*/
+	int melt_parameterization;
+	femmodel->parameters->FindParam(&melt_parameterization,FrontalForcingsParamEnum);
+	
+	/*Calculate melting rate*/
+	switch(melt_parameterization){
+		case FrontalForcingsDefaultEnum:
+			break;
+		case FrontalForcingsRignotEnum:
+			femmodel->IcefrontAreax();
+			femmodel->RignotMeltParameterizationx();
+			break;
+		default:
+			_error_("Frontal forcings "<<EnumToStringx(melt_parameterization)<<" not supported yet");
+	}
+}
Index: /issm/trunk/src/c/modules/FrontalForcingsx/FrontalForcingsx.h
===================================================================
--- /issm/trunk/src/c/modules/FrontalForcingsx/FrontalForcingsx.h	(revision 24313)
+++ /issm/trunk/src/c/modules/FrontalForcingsx/FrontalForcingsx.h	(revision 24313)
@@ -0,0 +1,10 @@
+#ifndef _FRONTALFORCINGSX_H
+#define _FRONTALFORCINGSX_H
+
+#include "../../classes/classes.h"
+#include "../../analyses/analyses.h"
+
+/* local prototypes: */
+void FrontalForcingsx(FemModel* femmodel);
+
+#endif
Index: /issm/trunk/src/c/modules/GeothermalFluxx/GeothermalFluxx.cpp
===================================================================
--- /issm/trunk/src/c/modules/GeothermalFluxx/GeothermalFluxx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/GeothermalFluxx/GeothermalFluxx.cpp	(revision 24313)
@@ -20,4 +20,6 @@
 		case MismipFloatingMeltRateEnum:
 		case LinearFloatingMeltRateEnum:
+		case BasalforcingsPicoEnum:
+		case BasalforcingsIsmip6Enum:
 			/*Nothing to be done*/
 			break;
@@ -25,4 +27,7 @@
 			if(VerboseSolution())_printf0_("	call Mantle Plume Geothermal Flux module\n");
 			MantlePlumeGeothermalFluxx(femmodel);
+			break;
+		case BeckmannGoosseFloatingMeltRateEnum:
+			/*Nothing to be done*/
 			break;
 		default:
Index: /issm/trunk/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp	(revision 24313)
@@ -9,23 +9,17 @@
 void GetSolutionFromInputsx(Vector<IssmDouble>** psolution,FemModel* femmodel){
 
-	/*intermediary: */
-	int      gsize;
-	int      configuration,analysisenum;
-
-	/*output: */
-	Vector<IssmDouble>* solution=NULL;
-
 	if(VerboseModule()) _printf0_("   Get solution from inputs\n");
 
-	/*retrive parameters: */
-	femmodel->parameters->FindParam(&configuration,ConfigurationTypeEnum);
+	/*retrieve parameters: */
+	int analysisenum;
 	femmodel->parameters->FindParam(&analysisenum,AnalysisTypeEnum);
 
 	/*Get size of vector: */
-	gsize=femmodel->nodes->NumberOfDofs(configuration,GsetEnum);
-	if(gsize==0) _error_("Allocating a Vec of size 0 as gsize=0 for configuration "<<EnumToStringx(configuration));
+	int gsize       = femmodel->nodes->NumberOfDofs(GsetEnum);
+	int gsize_local = femmodel->nodes->NumberOfDofsLocal(GsetEnum);
+	if(gsize==0) _error_("Allocating a Vec of size 0 as gsize=0 ");
 
 	/*Initialize solution: */
-	solution=new Vector<IssmDouble>(gsize);
+	Vector<IssmDouble>* solution=new Vector<IssmDouble>(gsize_local,gsize);
 
 	/*Go through elements and plug solution: */
Index: /issm/trunk/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp
===================================================================
--- /issm/trunk/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp	(revision 24313)
@@ -8,74 +8,51 @@
 
 void InputUpdateFromConstantx(FemModel* femmodel,bool constant, int name){
-
-	int i;
 	if(VerboseModule()) _printf0_("   Input updates from constant\n");
 
 	/*Elements and loads drive the update: */
-	for(i=0;i<femmodel->elements->Size();i++){
+	for(int i=0;i<femmodel->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
 		element->InputUpdateFromConstant(constant,name);
-	}
-
-	for(i=0;i<femmodel->loads->Size();i++){
-		Load* load=(Load*)femmodel->loads->GetObjectByOffset(i);
-		load->InputUpdateFromConstant(constant,name);
-	}
-
-	for(i=0;i<femmodel->materials->Size();i++){
-		Material* material=(Material*)femmodel->materials->GetObjectByOffset(i);
-		material->InputUpdateFromConstant(constant,name);
 	}
 }
 void InputUpdateFromConstantx(FemModel* femmodel,int constant, int name){
 
-	int i;
 	if(VerboseModule()) _printf0_("   Input updates from constant\n");
 
 	/*Elements and loads drive the update: */
-	for(i=0;i<femmodel->elements->Size();i++){
+	for(int i=0;i<femmodel->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
 		element->InputUpdateFromConstant(constant,name);
-	}
-
-	for(i=0;i<femmodel->loads->Size();i++){
-		Load* load=(Load*)femmodel->loads->GetObjectByOffset(i);
-		load->InputUpdateFromConstant(constant,name);
-	}
-
-	for(i=0;i<femmodel->materials->Size();i++){
-		Material* material=(Material*)femmodel->materials->GetObjectByOffset(i);
-		material->InputUpdateFromConstant(constant,name);
 	}
 }
 void InputUpdateFromConstantx(FemModel* femmodel,IssmDouble constant, int name){
 
-	int i;
 	if(VerboseModule()) _printf0_("   Input updates from constant\n");
 
 	/*Elements and loads drive the update: */
-	for(i=0;i<femmodel->elements->Size();i++){
-		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
-		element->InputUpdateFromConstant(constant,name);
+	if(IsInputEnum(name)){
+		for(int i=0;i<femmodel->elements->Size();i++){
+			Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+			element->InputUpdateFromConstant(constant,name);
+		}
 	}
-
-	for(i=0;i<femmodel->loads->Size();i++){
-		Load* load=(Load*)femmodel->loads->GetObjectByOffset(i);
-		load->InputUpdateFromConstant(constant,name);
+	else if(IsParamEnum(name)){
+		if(femmodel->parameters->Exist(name)){
+			femmodel->parameters->SetParam(constant,name);
+		}
+		else{
+			_error_("Param not set");
+		}
 	}
-
-	for(i=0;i<femmodel->materials->Size();i++){
-		Material* material=(Material*)femmodel->materials->GetObjectByOffset(i);
-		material->InputUpdateFromConstant(constant,name);
+	else{
+		_error_("not supported");
 	}
-
 }
 void InputUpdateFromConstantx(Elements* elements,IssmDouble constant, int name){
 
-	int i;
 	if(VerboseModule()) _printf0_("   Input updates from constant\n");
 
 	/*Elements and loads drive the update: */
-	for(i=0;i<elements->Size();i++){
+	for(int i=0;i<elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
 		element->InputUpdateFromConstant(constant,name);
Index: /issm/trunk/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp
===================================================================
--- /issm/trunk/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp	(revision 24313)
@@ -16,8 +16,10 @@
 
 	int     numberofvertices;
+	int     numberofelements;
 	int     nrows;
 	int     ncols;
 	int     npart;
-	double *qmu_part  = NULL;
+	double *qmu_vpart  = NULL;
+	double *qmu_epart  = NULL;
 
 	double *distributed_values = NULL;
@@ -28,6 +30,8 @@
 	/*retrieve parameters: */
 	femmodel->parameters->FindParam(&npart,QmuNumberofpartitionsEnum);
-	femmodel->parameters->FindParam(&qmu_part,&dummy,QmuPartitionEnum);
+	femmodel->parameters->FindParam(&qmu_vpart,NULL,QmuVpartitionEnum);
+	femmodel->parameters->FindParam(&qmu_epart,NULL,QmuEpartitionEnum);
 	numberofvertices=femmodel->vertices->NumberOfVertices();
+	numberofelements=femmodel->elements->NumberOfElements();
 
 	/*Go through all dakota descriptors, ex: "rho_ice","thermal_conductivity","thickness1","thickness2", etc ..., and 
@@ -56,13 +60,27 @@
 			femmodel->parameters->FindParamInDataset(&parameter,&nrows,&ncols,QmuVariableDescriptorsEnum,StringToEnumx(root));
 
-			/*We've got the parameter, we need to update it using qmu_part (a partitioning vector), 
-			 * and the distributed_values. Two cases: we either have a nrows=numberofvertices, in 
-			 * which case our parameter is a vector, or nrows=numberofvertices+1, in which case, 
-			 * our parameter is a transient vector. Deal with both cases accordingly: */
-			for(k=0;k<numberofvertices;k++){
-				for(l=0;l<ncols;l++){
-					*(parameter+ncols*k+l)=*(parameter+ncols*k+l)*distributed_values[(int)qmu_part[k]];
+
+			/*We've got the parameter, we need to update it using qmu_vpart or qmu_epart (depending on whether 
+			 * it is element or vertex distributed), and the distributed_values. 
+			 In addition, the parameter can be either a static or transient (nrows+1) vector. */
+			
+			//_printf_("nrows: " << nrows << " numberofvertices: " << numberofvertices << " numberofelements: " << numberofelements << "\n");
+
+			if (nrows==numberofvertices || nrows==(numberofvertices+1)){
+				for(k=0;k<numberofvertices;k++){
+					for(l=0;l<ncols;l++){
+						*(parameter+ncols*k+l)=*(parameter+ncols*k+l)*distributed_values[(int)qmu_vpart[k]];
+					}
 				}
 			}
+			else if (nrows==numberofelements || nrows==(numberofelements+1)){
+				for(k=0;k<numberofelements;k++){
+					for(l=0;l<ncols;l++){
+						*(parameter+ncols*k+l)=*(parameter+ncols*k+l)*distributed_values[(int)qmu_epart[k]];
+					}
+				}
+
+			}
+			else _error_("partitioning vector should be either elements or vertex sized!");
 
 			#ifdef _DEBUG_
@@ -83,5 +101,8 @@
 
 			/*Update inputs using the parameter matrix: */
-			InputUpdateFromMatrixDakotax(femmodel, parameter, nrows,ncols,StringToEnumx(root), VertexEnum);
+			if(nrows==numberofvertices || (nrows==numberofvertices+1))
+				InputUpdateFromMatrixDakotax(femmodel, parameter, nrows,ncols,StringToEnumx(root), VertexEnum);
+			else
+				InputUpdateFromMatrixDakotax(femmodel, parameter, nrows,ncols,StringToEnumx(root), ElementEnum);
 
 			/*increment i to skip the distributed values just collected: */
@@ -105,4 +126,5 @@
 
 	/*Free ressources:*/
-	xDelete<double>(qmu_part);
+	xDelete<double>(qmu_vpart);
+	xDelete<double>(qmu_epart);
 }
Index: /issm/trunk/src/c/modules/InputUpdateFromMatrixDakotax/InputUpdateFromMatrixDakotax.cpp
===================================================================
--- /issm/trunk/src/c/modules/InputUpdateFromMatrixDakotax/InputUpdateFromMatrixDakotax.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/InputUpdateFromMatrixDakotax/InputUpdateFromMatrixDakotax.cpp	(revision 24313)
@@ -11,9 +11,10 @@
 
 	int i;
-	int numberofvertices;
+	int numberofvertices,numberofelements;
 
 	numberofvertices=femmodel->vertices->NumberOfVertices();
+	numberofelements=femmodel->elements->NumberOfElements();
 
-	if((ncols==1) && (nrows==numberofvertices)) InputUpdateFromVectorDakotax(femmodel,matrix,name,type);
+	if((ncols==1) && (nrows==numberofvertices || nrows==numberofelements)) InputUpdateFromVectorDakotax(femmodel,matrix,name,type);
 	else{
 
@@ -23,12 +24,4 @@
 			element->InputUpdateFromMatrixDakota(matrix,nrows,ncols,name,type);
 		}
-		for(i=0;i<femmodel->loads->Size();i++){
-			Load* load=(Load*)femmodel->loads->GetObjectByOffset(i);
-			load->InputUpdateFromMatrixDakota(matrix,nrows,ncols,name,type);
-		}
-		for(i=0;i<femmodel->materials->Size();i++){
-			Material* material=(Material*)femmodel->materials->GetObjectByOffset(i);
-			material->InputUpdateFromMatrixDakota(matrix,nrows,ncols,name,type);
-		}
 	}
 }
Index: /issm/trunk/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp
===================================================================
--- /issm/trunk/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp	(revision 24313)
@@ -9,28 +9,24 @@
 void InputUpdateFromSolutionx(FemModel* femmodel,Vector<IssmDouble>* solution){
 
-	/*Serialize solution, so that elements can index into it on every CPU: */
-	IssmDouble* serial_solution=solution->ToMPISerial();
-
-	/*Call overloaded form of InputUpdateFromSolutionx: */
-	InputUpdateFromSolutionx(femmodel,serial_solution);
-
-	/*cleanup and return*/
-	xDelete<IssmDouble>(serial_solution);
-}
-
-void InputUpdateFromSolutionx(FemModel* femmodel,IssmDouble* solution){
-
-	/*retrive parameters: */
-	int analysisenum;
-	femmodel->parameters->FindParam(&analysisenum,AnalysisTypeEnum);
-
 	/*Display message*/
 	if(VerboseModule()) _printf0_("   Updating inputs from solution\n");
 
+	/*GetAnalysis*/
+	int analysisenum;
+	femmodel->parameters->FindParam(&analysisenum,AnalysisTypeEnum);
 	Analysis* analysis = EnumToAnalysis(analysisenum);
+
+	/*Get local vector with both masters and slaves:*/
+	IssmDouble *local_ug = NULL;
+	femmodel->GetLocalVectorWithClonesGset(&local_ug,solution);
+
+	/*Now update inputs (analysis specific)*/
 	for(int i=0;i<femmodel->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
-		analysis->InputUpdateFromSolution(solution,element);
+		analysis->InputUpdateFromSolution(local_ug,element);
 	}
+
+	/*cleanup and return*/
 	delete analysis;
+	xDelete<IssmDouble>(local_ug);
 }
Index: /issm/trunk/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.h
===================================================================
--- /issm/trunk/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.h	(revision 24312)
+++ /issm/trunk/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.h	(revision 24313)
@@ -11,5 +11,4 @@
 /* local prototypes: */
 void	InputUpdateFromSolutionx(FemModel* femmodel,Vector<IssmDouble>* solution);
-void  InputUpdateFromSolutionx(FemModel* femmodel,IssmDouble* solution);
 
 #endif  /* _UPDATEINPUTSFROMSOLUTIONXX_H */
Index: /issm/trunk/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.cpp
===================================================================
--- /issm/trunk/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.cpp	(revision 24313)
@@ -23,15 +23,3 @@
 		element->InputUpdateFromVectorDakota(vector,name,type);
 	}
-	for(int i=0;i<femmodel->loads->Size();i++){
-		Load* load=(Load*)femmodel->loads->GetObjectByOffset(i);
-		load->InputUpdateFromVectorDakota(vector,name,type);
-	}
-	for(int i=0;i<femmodel->materials->Size();i++){
-		Material* material=(Material*)femmodel->materials->GetObjectByOffset(i);
-		material->InputUpdateFromVectorDakota(vector,name,type);
-	}
-	for(int i=0;i<femmodel->constraints->Size();i++){
-		Constraint* constraint=(Constraint*)femmodel->constraints->GetObjectByOffset(i);
-		constraint->InputUpdateFromVectorDakota(vector,femmodel->nodes,name,type);
-	}
 }
Index: /issm/trunk/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.cpp
===================================================================
--- /issm/trunk/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.cpp	(revision 24313)
@@ -9,25 +9,23 @@
 void InputUpdateFromVectorx(FemModel* femmodel,Vector<IssmDouble>* vector, int name, int type){
 
-	IssmDouble* serial_vector=vector->ToMPISerial();
-	InputUpdateFromVectorx(femmodel,serial_vector,name,type);
-	xDelete<IssmDouble>(serial_vector);
+	if(type==VertexPIdEnum){
+		IssmDouble* serial_vector=NULL;
+		femmodel->GetLocalVectorWithClonesVertices(&serial_vector,vector);
+		InputUpdateFromVectorx(femmodel,serial_vector,name,VertexLIdEnum);
+		xDelete<IssmDouble>(serial_vector);
+	}
+	else{
+		IssmDouble* serial_vector=vector->ToMPISerial();
+		InputUpdateFromVectorx(femmodel,serial_vector,name,type);
+		xDelete<IssmDouble>(serial_vector);
+	}
 }
 
 void InputUpdateFromVectorx(FemModel* femmodel,IssmDouble* vector, int name, int type){
 
-	int i;
-
 	/*Update elements, nodes, loads and materials from inputs: */
-	for(i=0;i<femmodel->elements->Size();i++){
+	for(int i=0;i<femmodel->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
 		element->InputUpdateFromVector(vector,name,type);
 	}
-	for(i=0;i<femmodel->loads->Size();i++){
-		Load* load=(Load*)femmodel->loads->GetObjectByOffset(i);
-		load->InputUpdateFromVector(vector,name,type);
-	}
-	for(i=0;i<femmodel->materials->Size();i++){
-		Material* material=(Material*)femmodel->materials->GetObjectByOffset(i);
-		material->InputUpdateFromVector(vector,name,type);
-	}
 }
Index: /issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 24313)
@@ -54,9 +54,9 @@
 
 	/*intermediary: */
-	int         i,j,count,elementnbv,numfacevertices;
+	int         i,j,elementnbv,numfacevertices;
 	IssmDouble  value;
-	IssmDouble *times            = NULL;
-	IssmDouble *values           = NULL;
-	bool        spcpresent       = false;
+	IssmDouble *times      = NULL;
+	IssmDouble *values     = NULL;
+	bool        spcpresent = false;
 
 	/*Higher-order finite elements*/
@@ -113,5 +113,5 @@
 	}
 
-	count=0;
+	int count =0;
 	if(M==iomodel->numberofvertices){
 		switch(finite_element){
@@ -120,5 +120,5 @@
 					if((iomodel->my_vertices[i])){
 						if (!xIsNan<IssmDouble>(spcdata[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,spcdata[i],analysis_type));
+							constraints->AddObject(new SpcStatic(count+1,i+1,dof,spcdata[i],analysis_type));
 							count++;
 						}
@@ -130,5 +130,5 @@
 					if((iomodel->my_vertices[i])){
 						if (!xIsNan<IssmDouble>(spcdata[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,spcdata[i],analysis_type));
+							constraints->AddObject(new SpcStatic(count+1,i+1,dof,spcdata[i],analysis_type));
 							count++;
 						}
@@ -140,5 +140,38 @@
 						v2 = iomodel->edges[3*i+1]-1;
 						if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+i+1,
+							constraints->AddObject(new SpcStatic(count+1,iomodel->numberofvertices+i+1,
+											dof,(spcdata[v1]+spcdata[v2])/2.,analysis_type));
+							count++;
+						}
+					}
+				}
+				if(iomodel->meshelementtype==PentaEnum){
+					for(i=0;i<iomodel->numberofverticalfaces;i++){
+						if(iomodel->my_vfaces[i]){
+							value=0.;
+							for(j=0;j<4;j++) value += spcdata[iomodel->verticalfaces[i*4+j] -1]/4.;
+							if(!xIsNan<IssmDouble>(value)){
+								constraints->AddObject(new SpcStatic(count+1,iomodel->numberofvertices+iomodel->numberofedges+i+1,dof,value,analysis_type));
+								count++;
+							}
+						}
+					}
+				}
+				break;
+			case P2bubbleEnum:
+				for(i=0;i<iomodel->numberofvertices;i++){
+					if((iomodel->my_vertices[i])){
+						if (!xIsNan<IssmDouble>(spcdata[i])){
+							constraints->AddObject(new SpcStatic(count+1,i+1,dof,spcdata[i],analysis_type));
+							count++;
+						}
+					}
+				}
+				for(i=0;i<iomodel->numberofedges;i++){
+					if(iomodel->my_edges[i] && boundaryedge[i]){
+						v1 = iomodel->edges[3*i+0]-1;
+						v2 = iomodel->edges[3*i+1]-1;
+						if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
+							constraints->AddObject(new SpcStatic(count+1,iomodel->numberofvertices+i+1,
 											dof,(spcdata[v1]+spcdata[v2])/2.,analysis_type));
 							count++;
@@ -157,47 +190,6 @@
 								value = value/reCast<IssmDouble>(numfacevertices);
 								if(!xIsNan<IssmDouble>(value)){
-									constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,
-													iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+i+1,
-													dof,value,analysis_type));
-									count++;
-								}
-							}
-						}
-					}
-				}
-				break;
-			case P2bubbleEnum:
-				for(i=0;i<iomodel->numberofvertices;i++){
-					if((iomodel->my_vertices[i])){
-						if (!xIsNan<IssmDouble>(spcdata[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,spcdata[i],analysis_type));
-							count++;
-						}
-					}
-				}
-				for(i=0;i<iomodel->numberofedges;i++){
-					if(iomodel->my_edges[i] && boundaryedge[i]){
-						v1 = iomodel->edges[3*i+0]-1;
-						v2 = iomodel->edges[3*i+1]-1;
-						if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+i+1,
-											dof,(spcdata[v1]+spcdata[v2])/2.,analysis_type));
-							count++;
-						}
-					}
-				}
-				if(iomodel->meshelementtype==PentaEnum){
-					for(i=0;i<iomodel->numberoffaces;i++){
-						if(iomodel->faces[i*iomodel->facescols+2]==2){/*Vertical quads*/
-							if(iomodel->my_faces[i]){
-								numfacevertices = iomodel->faces[i*iomodel->facescols+3];
-								value=0.;
-								for(j=0;j<numfacevertices;j++){
-									value += spcdata[iomodel->faces[i*iomodel->facescols+4+j] -1];
-								}
-								value = value/reCast<IssmDouble>(numfacevertices);
-								if(!xIsNan<IssmDouble>(value)){
-									constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,
-													iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+i+1,
+									constraints->AddObject(new SpcStatic(count+1,
+													iomodel->numberofvertices+iomodel->numberofedges+i+1,
 													dof,value,analysis_type));
 									count++;
@@ -213,9 +205,9 @@
 						value = value/reCast<IssmDouble,int>(elementnbv+0);
 						if(!xIsNan<IssmDouble>(value)){
-							int nodeid = iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+i+1;
+							int nodeid = iomodel->numberofvertices+iomodel->numberofedges+i+1;
 							if(iomodel->meshelementtype==PentaEnum){
 								nodeid += iomodel->numberoffaces;
 							}
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,nodeid,dof,value,analysis_type));
+							constraints->AddObject(new SpcStatic(count+1,nodeid,dof,value,analysis_type));
 							count++;
 						}
@@ -227,5 +219,5 @@
 					if((iomodel->my_vertices[i])){
 						if (!xIsNan<IssmDouble>(spcdata[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,spcdata[i],analysis_type));
+							constraints->AddObject(new SpcStatic(count+1,i+1,dof,spcdata[i],analysis_type));
 							count++;
 						}
@@ -233,52 +225,43 @@
 				}
 				for(i=0;i<iomodel->numberofedges;i++){
-					if(iomodel->edges[i*3+2]==2){/*Vertical edges*/
-						if(iomodel->my_edges[i]){
-							v1 = iomodel->edges[3*i+0]-1;
-							v2 = iomodel->edges[3*i+1]-1;
-							if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
-								constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+3*i+1,
-												dof,1./2.*spcdata[v1]+1./2.*spcdata[v2],analysis_type));
-								constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+2,iomodel->nodecounter+iomodel->numberofvertices+3*i+2,
-												dof,1./2.*spcdata[v1]+1./2.*spcdata[v2],analysis_type));
-								constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+3,iomodel->nodecounter+iomodel->numberofvertices+3*i+3,
-												dof,1./2.*spcdata[v1]+1./2.*spcdata[v2],analysis_type));
-								count=count+3;
-							}
-						}
-					}
-					if(iomodel->edges[i*3+2]==1){/*Horizontal edges*/
-						if(iomodel->my_edges[i]){
-							v1 = iomodel->edges[3*i+0]-1;
-							v2 = iomodel->edges[3*i+1]-1;
-							if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
-								constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+3*i+1,
-												dof,1./2.*spcdata[v1]+1./2.*spcdata[v2],analysis_type));
-								count=count+1;
-							}
-						}
-					}
-				}
-				for(i=0;i<iomodel->numberoffaces;i++){
-					if(iomodel->faces[i*iomodel->facescols+2]==2){/*Vertical quads*/
-						if(iomodel->my_faces[i]){
-							numfacevertices = iomodel->faces[i*iomodel->facescols+3];
-							value=0.;
-							for(j=0;j<numfacevertices;j++){
-								value += spcdata[iomodel->faces[i*iomodel->facescols+4+j] -1];
-							}
-							value = value/reCast<IssmDouble>(numfacevertices);
-							if(!xIsNan<IssmDouble>(value)){
-								constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,
-												iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*i+1,
-												dof,value,analysis_type));
-								constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+2,
-												iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*i+2,
-												dof,value,analysis_type));
-								constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+3,
-												iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*i+3,
-												dof,value,analysis_type));
-								count=count+3;
-							}
+					if(iomodel->my_edges[i]){
+						v1 = iomodel->edges[3*i+0]-1;
+						v2 = iomodel->edges[3*i+1]-1;
+						if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
+							constraints->AddObject(new SpcStatic(count+1,iomodel->numberofvertices+i+1,
+											dof,1./2.*spcdata[v1]+1./2.*spcdata[v2],analysis_type));
+							count++;
+						}
+					}
+				}
+				for(i=0;i<iomodel->numberofverticaledges;i++){
+					if(iomodel->my_vedges[i]){
+						v1 = iomodel->verticaledges[2*i+0]-1;
+						v2 = iomodel->verticaledges[2*i+1]-1;
+						if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
+							/*FIXME: should not be 1/2 but 1/4 and 3/4!*/
+							constraints->AddObject(new SpcStatic(count+1,iomodel->numberofvertices+iomodel->numberofedges+2*i+1,
+											dof,1./2.*spcdata[v1]+1./2.*spcdata[v2],analysis_type));
+							constraints->AddObject(new SpcStatic(count+2,iomodel->numberofvertices+iomodel->numberofedges+2*i+2,
+											dof,1./2.*spcdata[v1]+1./2.*spcdata[v2],analysis_type));
+							count=count+2;
+						}
+					}
+				}
+				for(i=0;i<iomodel->numberofverticalfaces;i++){
+					if(iomodel->my_vfaces[i]){
+						value=0.;
+						for(j=0;j<4;j++) value += spcdata[iomodel->verticalfaces[i*4+j]-1]/4.;
+						if(!xIsNan<IssmDouble>(value)){
+							constraints->AddObject(new SpcStatic(count+1,
+											iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*i+1,
+											dof,value,analysis_type));
+							constraints->AddObject(new SpcStatic(count+2,
+											iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*i+2,
+											dof,value,analysis_type));
+							constraints->AddObject(new SpcStatic(count+3,
+											iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*i+3,
+											dof,value,analysis_type));
+							count=count+3;
 						}
 					}
@@ -289,5 +272,5 @@
 					if((iomodel->my_vertices[i])){
 						if (!xIsNan<IssmDouble>(spcdata[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,spcdata[i],analysis_type));
+							constraints->AddObject(new SpcStatic(count+1,i+1,dof,spcdata[i],analysis_type));
 							count++;
 						}
@@ -300,5 +283,5 @@
 						value = value/reCast<IssmDouble,int>(elementnbv+0);
 						if(!xIsNan<IssmDouble>(value)){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+i+1,
+							constraints->AddObject(new SpcStatic(count+1,iomodel->numberofvertices+i+1,
 											dof,value,analysis_type));
 							count++;
@@ -311,5 +294,5 @@
 					if((iomodel->my_vertices[i])){
 						if (!xIsNan<IssmDouble>(spcdata[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,spcdata[i],analysis_type));
+							constraints->AddObject(new SpcStatic(count+1,i+1,dof,spcdata[i],analysis_type));
 							count++;
 						}
@@ -321,19 +304,16 @@
 					if((iomodel->my_vertices[i])){
 						if (!xIsNan<IssmDouble>(spcdata[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,spcdata[i],analysis_type));
-							count++;
-						}
-					}
-				}
-				for(i=0;i<iomodel->numberofedges;i++){
-					if(iomodel->edges[i*3+2]==2){
-						if(iomodel->my_edges[i]){
-							v1 = iomodel->edges[3*i+0]-1;
-							v2 = iomodel->edges[3*i+1]-1;
-							if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
-								constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+i+1,
-												dof,(spcdata[v1]+spcdata[v2])/2.,analysis_type));
-								count++;
-							}
+							constraints->AddObject(new SpcStatic(count+1,i+1,dof,spcdata[i],analysis_type));
+							count++;
+						}
+					}
+				}
+				for(i=0;i<iomodel->numberofverticaledges;i++){
+					if(iomodel->my_vedges[i]){
+						v1 = iomodel->verticaledges[2*i+0]-1;
+						v2 = iomodel->verticaledges[2*i+1]-1;
+						if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
+							constraints->AddObject(new SpcStatic(count+1,iomodel->numberofvertices+i+1,dof,(spcdata[v1]+spcdata[v2])/2.,analysis_type));
+							count++;
 						}
 					}
@@ -344,21 +324,19 @@
 					if((iomodel->my_vertices[i])){
 						if (!xIsNan<IssmDouble>(spcdata[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,spcdata[i],analysis_type));
-							count++;
-						}
-					}
-				}
-				for(i=0;i<iomodel->numberofedges;i++){
-					if(iomodel->edges[i*3+2]==2){
-						if(iomodel->my_edges[i]){
-							v1 = iomodel->edges[3*i+0]-1;
-							v2 = iomodel->edges[3*i+1]-1;
-							if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
-								constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+2*i+1,
-												dof,2./3.*spcdata[v1]+1./3.*spcdata[v2],analysis_type));
-								constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+2,iomodel->nodecounter+iomodel->numberofvertices+2*i+2,
-												dof,1./3.*spcdata[v1]+2./3.*spcdata[v2],analysis_type));
-								count=count+2;
-							}
+							constraints->AddObject(new SpcStatic(count+1,i+1,dof,spcdata[i],analysis_type));
+							count++;
+						}
+					}
+				}
+				for(i=0;i<iomodel->numberofverticaledges;i++){
+					if(iomodel->my_vedges[i]){
+						v1 = iomodel->verticaledges[2*i+0]-1;
+						v2 = iomodel->verticaledges[2*i+1]-1;
+						if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
+							constraints->AddObject(new SpcStatic(count+1,iomodel->numberofvertices+2*i+1,
+											dof,2./3.*spcdata[v1]+1./3.*spcdata[v2],analysis_type));
+							constraints->AddObject(new SpcStatic(count+2,iomodel->numberofvertices+2*i+2,
+											dof,1./3.*spcdata[v1]+2./3.*spcdata[v2],analysis_type));
+							count=count+2;
 						}
 					}
@@ -369,23 +347,21 @@
 					if((iomodel->my_vertices[i])){
 						if (!xIsNan<IssmDouble>(spcdata[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,spcdata[i],analysis_type));
-							count++;
-						}
-					}
-				}
-				for(i=0;i<iomodel->numberofedges;i++){
-					if(iomodel->edges[i*3+2]==2){/*Vertical edges*/
-						if(iomodel->my_edges[i]){
-							v1 = iomodel->edges[3*i+0]-1;
-							v2 = iomodel->edges[3*i+1]-1;
-							if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
-								constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+3*i+1,
-												dof,1./2.*spcdata[v1]+1./2.*spcdata[v2],analysis_type));
-								constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+2,iomodel->nodecounter+iomodel->numberofvertices+3*i+2,
-												dof,1./2.*spcdata[v1]+1./2.*spcdata[v2],analysis_type));
-								constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+3,iomodel->nodecounter+iomodel->numberofvertices+3*i+3,
-												dof,1./2.*spcdata[v1]+1./2.*spcdata[v2],analysis_type));
-								count=count+3;
-							}
+							constraints->AddObject(new SpcStatic(count+1,i+1,dof,spcdata[i],analysis_type));
+							count++;
+						}
+					}
+				}
+				for(i=0;i<iomodel->numberofverticaledges;i++){
+					if(iomodel->my_vedges[i]){
+						v1 = iomodel->verticaledges[2*i+0]-1;
+						v2 = iomodel->verticaledges[2*i+1]-1;
+						if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
+							constraints->AddObject(new SpcStatic(count+1,iomodel->numberofvertices+3*i+1,
+											dof,1./2.*spcdata[v1]+1./2.*spcdata[v2],analysis_type));
+							constraints->AddObject(new SpcStatic(count+2,iomodel->numberofvertices+3*i+2,
+											dof,1./2.*spcdata[v1]+1./2.*spcdata[v2],analysis_type));
+							constraints->AddObject(new SpcStatic(count+3,iomodel->numberofvertices+3*i+3,
+											dof,1./2.*spcdata[v1]+1./2.*spcdata[v2],analysis_type));
+							count=count+3;
 						}
 					}
@@ -396,19 +372,16 @@
 					if((iomodel->my_vertices[i])){
 						if (!xIsNan<IssmDouble>(spcdata[i])){
-							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,spcdata[i],analysis_type));
-							count++;
-						}
-					}
-				}
-				for(i=0;i<iomodel->numberofedges;i++){
-					if(iomodel->edges[i*3+2]!=2){
-						if(iomodel->my_edges[i]){
-							v1 = iomodel->edges[3*i+0]-1;
-							v2 = iomodel->edges[3*i+1]-1;
-							if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
-								constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+i+1,
-												dof,(spcdata[v1]+spcdata[v2])/2.,analysis_type));
-								count++;
-							}
+							constraints->AddObject(new SpcStatic(count+1,i+1,dof,spcdata[i],analysis_type));
+							count++;
+						}
+					}
+				}
+				for(i=0;i<iomodel->numberofhorizontaledges;i++){
+					if(iomodel->my_hedges[i]){
+						v1 = iomodel->horizontaledges[2*i+0]-1;
+						v2 = iomodel->horizontaledges[2*i+1]-1;
+						if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
+							constraints->AddObject(new SpcStatic(count+1,iomodel->numberofvertices+i+1,dof,(spcdata[v1]+spcdata[v2])/2.,analysis_type));
+							count++;
 						}
 					}
@@ -441,5 +414,5 @@
 
 						if(spcpresent){
-							constraints->AddObject(new SpcTransient(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,N,times,values,analysis_type));
+							constraints->AddObject(new SpcTransient(count+1,i+1,dof,N,times,values,analysis_type));
 							count++;
 						}
@@ -462,5 +435,5 @@
 
 						if(spcpresent){
-							constraints->AddObject(new SpcTransient(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,N,times,values,analysis_type));
+							constraints->AddObject(new SpcTransient(count+1,i+1,dof,N,times,values,analysis_type));
 							count++;
 						}
@@ -479,6 +452,5 @@
 						}
 						if(spcpresent){
-							constraints->AddObject(new SpcTransient(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+i+1,dof,
-											N,times,values,analysis_type));
+							constraints->AddObject(new SpcTransient(count+1,iomodel->numberofvertices+i+1,dof,N,times,values,analysis_type));
 							count++;
 						}
@@ -500,5 +472,5 @@
 
 						if(spcpresent){
-							constraints->AddObject(new SpcTransient(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,N,times,values,analysis_type));
+							constraints->AddObject(new SpcTransient(count+1,i+1,dof,N,times,values,analysis_type));
 							count++;
 						}
@@ -506,22 +478,19 @@
 					}
 				}
-				for(i=0;i<iomodel->numberofedges;i++){
-					if(iomodel->edges[i*3+2]==2){
-						if(iomodel->my_edges[i]){
-							v1 = iomodel->edges[3*i+0]-1;
-							v2 = iomodel->edges[3*i+1]-1;
-							values=xNew<IssmDouble>(N);
-							spcpresent=false;
-							for(j=0;j<N;j++){
-								values[j]=(spcdata[v1*N+j]+spcdata[v2*N+j])/2.;
-								if(!xIsNan<IssmDouble>(values[j])) spcpresent=true; //NaN means no spc by default
-							}
-							if(spcpresent){
-								constraints->AddObject(new SpcTransient(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+i+1,dof,
-												N,times,values,analysis_type));
-								count++;
-							}
-							xDelete<IssmDouble>(values);
-						}
+				for(i=0;i<iomodel->numberofverticaledges;i++){
+					if(iomodel->my_vedges[i]){
+						v1 = iomodel->verticaledges[2*i+0]-1;
+						v2 = iomodel->verticaledges[2*i+1]-1;
+						values=xNew<IssmDouble>(N);
+						spcpresent=false;
+						for(j=0;j<N;j++){
+							values[j]=(spcdata[v1*N+j]+spcdata[v2*N+j])/2.;
+							if(!xIsNan<IssmDouble>(values[j])) spcpresent=true; //NaN means no spc by default
+						}
+						if(spcpresent){
+							constraints->AddObject(new SpcTransient(count+1,iomodel->numberofvertices+i+1,dof,N,times,values,analysis_type));
+							count++;
+						}
+						xDelete<IssmDouble>(values);
 					}
 				}
@@ -540,5 +509,5 @@
 
 						if(spcpresent){
-							constraints->AddObject(new SpcTransient(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,N,times,values,analysis_type));
+							constraints->AddObject(new SpcTransient(count+1,i+1,dof,N,times,values,analysis_type));
 							count++;
 						}
@@ -546,32 +515,28 @@
 					}
 				}
-				for(i=0;i<iomodel->numberofedges;i++){
-					if(iomodel->edges[i*3+2]==2){
-						if(iomodel->my_edges[i]){
-							v1 = iomodel->edges[3*i+0]-1;
-							v2 = iomodel->edges[3*i+1]-1;
-							values=xNew<IssmDouble>(N);
-							spcpresent=false;
-							for(j=0;j<N;j++){
-								values[j]=2./3.*spcdata[v1*N+j]+1./3.*spcdata[v2*N+j];
-								if(!xIsNan<IssmDouble>(values[j])) spcpresent=true; //NaN means no spc by default
-							}
-							if(spcpresent){
-								constraints->AddObject(new SpcTransient(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+2*i+1,dof,
-												N,times,values,analysis_type));
-								count++;
-							}
-							spcpresent=false;
-							for(j=0;j<N;j++){
-								values[j]=1./3.*spcdata[v1*N+j]+2./3.*spcdata[v2*N+j];
-								  if(!xIsNan<IssmDouble>(values[j])) spcpresent=true; //NaN means no spc by default
-							}
-							if(spcpresent){
-								constraints->AddObject(new SpcTransient(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+2*i+2,dof,
-												N,times,values,analysis_type));
-								count++;
-							}
-							xDelete<IssmDouble>(values);
-						}
+				for(i=0;i<iomodel->numberofverticaledges;i++){
+					if(iomodel->my_vedges[i]){
+						v1 = iomodel->verticaledges[2*i+0]-1;
+						v2 = iomodel->verticaledges[2*i+1]-1;
+						values=xNew<IssmDouble>(N);
+						spcpresent=false;
+						for(j=0;j<N;j++){
+							values[j]=2./3.*spcdata[v1*N+j]+1./3.*spcdata[v2*N+j];
+							if(!xIsNan<IssmDouble>(values[j])) spcpresent=true; //NaN means no spc by default
+						}
+						if(spcpresent){
+							constraints->AddObject(new SpcTransient(count+1,iomodel->numberofvertices+2*i+1,dof,N,times,values,analysis_type));
+							count++;
+						}
+						spcpresent=false;
+						for(j=0;j<N;j++){
+							values[j]=1./3.*spcdata[v1*N+j]+2./3.*spcdata[v2*N+j];
+							if(!xIsNan<IssmDouble>(values[j])) spcpresent=true; //NaN means no spc by default
+						}
+						if(spcpresent){
+							constraints->AddObject(new SpcTransient(count+1,iomodel->numberofvertices+2*i+2,dof,N,times,values,analysis_type));
+							count++;
+						}
+						xDelete<IssmDouble>(values);
 					}
 				}
@@ -590,5 +555,5 @@
 
 						if(spcpresent){
-							constraints->AddObject(new SpcTransient(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,N,times,values,analysis_type));
+							constraints->AddObject(new SpcTransient(count+1,i+1,dof,N,times,values,analysis_type));
 							count++;
 						}
@@ -608,6 +573,5 @@
 							}
 							if(spcpresent){
-								constraints->AddObject(new SpcTransient(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+i+1,dof,
-												N,times,values,analysis_type));
+								constraints->AddObject(new SpcTransient(count+1,iomodel->numberofvertices+i+1,dof,N,times,values,analysis_type));
 								count++;
 							}
@@ -625,7 +589,4 @@
 	}
 
-	/*Update counter now since we have added some constraints*/
-	iomodel->constraintcounter = constraints->NumberOfConstraints();
-
 	/*Free ressources:*/
 	xDelete<IssmDouble>(times);
@@ -636,5 +597,5 @@
 
 	/*intermediary: */
-	int         i,j,count,elementnbv,numfacevertices;
+	int         i,j,elementnbv,numfacevertices;
 	IssmDouble  value;
 	IssmDouble *times            = NULL;
@@ -698,5 +659,5 @@
 	}
 
-	count=0;
+	int count=0;
 	if(M==iomodel->numberofvertices){
 		switch(finite_element){
@@ -705,5 +666,5 @@
 					if((iomodel->my_vertices[i])){
 						if (!xIsNan<IssmDouble>(spcdata[i])){
-							constraints->AddObject(new SpcDynamic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,analysis_type));
+							constraints->AddObject(new SpcDynamic(count+1,i+1,dof,analysis_type));
 							count++;
 						}
@@ -715,5 +676,5 @@
 					if((iomodel->my_vertices[i])){
 						if (!xIsNan<IssmDouble>(spcdata[i])){
-							constraints->AddObject(new SpcDynamic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,analysis_type));
+							constraints->AddObject(new SpcDynamic(count+1,i+1,dof,analysis_type));
 							count++;
 						}
@@ -726,5 +687,5 @@
 							v2 = iomodel->edges[3*i+1]-1;
 							if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
-								constraints->AddObject(new SpcDynamic(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+i+1,
+								constraints->AddObject(new SpcDynamic(count+1,iomodel->numberofvertices+i+1,
 												dof,analysis_type));
 								count++;
@@ -738,5 +699,5 @@
 					if((iomodel->my_vertices[i])){
 						if (!xIsNan<IssmDouble>(spcdata[i])){
-							constraints->AddObject(new SpcDynamic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,analysis_type));
+							constraints->AddObject(new SpcDynamic(count+1,i+1,dof,analysis_type));
 							count++;
 						}
@@ -749,8 +710,6 @@
 							v2 = iomodel->edges[3*i+1]-1;
 							if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
-								constraints->AddObject(new SpcDynamic(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+2*i+1,
-												dof,analysis_type));
-								constraints->AddObject(new SpcDynamic(iomodel->constraintcounter+count+2,iomodel->nodecounter+iomodel->numberofvertices+2*i+2,
-												dof,analysis_type));
+								constraints->AddObject(new SpcDynamic(count+1,iomodel->numberofvertices+2*i+1,dof,analysis_type));
+								constraints->AddObject(new SpcDynamic(count+2,iomodel->numberofvertices+2*i+2,dof,analysis_type));
 								count=count+2;
 							}
@@ -767,7 +726,4 @@
 	}
 
-	/*Update counter now since we have added some constraints*/
-	iomodel->constraintcounter = constraints->NumberOfConstraints();
-
 	/*Free ressources:*/
 	xDelete<IssmDouble>(times);
Index: /issm/trunk/src/c/modules/KillIcebergsx/KillIcebergsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/KillIcebergsx/KillIcebergsx.cpp	(revision 24313)
+++ /issm/trunk/src/c/modules/KillIcebergsx/KillIcebergsx.cpp	(revision 24313)
@@ -0,0 +1,124 @@
+/*!\file KillIcebergsx
+ * \brief: compute inverse method gradient
+ */
+
+#include "./KillIcebergsx.h"
+#include "../../shared/shared.h"
+#include "../../toolkits/toolkits.h"
+
+#include "../InputUpdateFromVectorx/InputUpdateFromVectorx.h"
+
+void KillIcebergsx(FemModel* femmodel){
+
+	/*Intermediaries*/
+	int lid;
+
+	/*retrieve vertex info and prepare element flag to speed up process*/
+	int         nbv_local    = femmodel->vertices->Size();
+	IssmDouble *local_mask   = xNewZeroInit<IssmDouble>(nbv_local);
+	bool       *element_flag = xNewZeroInit<bool>(femmodel->elements->Size());
+
+	/*Step 1, go through all elements and put 1 in local_mask if the element is grounded*/
+	for(int i=0;i<femmodel->elements->Size();i++){
+		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+		if(!element->IsIceInElement()){
+			/*Nothing to do, just flag element to speed up the computation*/
+			element_flag[i] = true;
+		}
+		else{
+			if(element->IsGrounded()){
+				int numvertices = element->GetNumberOfVertices();
+				for(int v=0;v<numvertices;v++) local_mask[element->vertices[v]->Lid()] = 1.;
+			}
+		}
+	}
+
+	/*Now we have 2 loops, one across cpus, and one for each cpus: we are going
+	 * to propagate the mask if an element is connected to a positive mask
+	 * already.  We then communicate to the other partitions. We stop when the
+	 * mask stops changing*/
+	bool keepsyncing = true;
+	while(keepsyncing){
+
+		/*Get local mask from parallel vector*/
+		femmodel->SyncLocalVectorWithClonesVerticesAdd(local_mask);
+
+		/*Local iterations on partition*/
+		bool keepgoing    = true;
+		int  didsomething = 0;
+		int  iter         = 1;
+		while(keepgoing){
+			//_printf0_("   -- Kill icebergs: local iteration "<<iter<<"\n");
+
+			keepgoing    = false;
+			didsomething = 0;
+			for(int i=0;i<femmodel->elements->Size();i++){
+				Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+
+				if(!element_flag[i]){
+					int numvertices = element->GetNumberOfVertices();
+					bool found1 = false;
+					for(int j=0;j<numvertices;j++){
+						lid = element->vertices[j]->Lid();
+						if(local_mask[lid]>0.){
+							found1 = true;
+							break;
+						}
+					}
+					if(found1){
+						element_flag[i] = true;
+						for(int j=0;j<numvertices;j++){
+							lid = element->vertices[j]->Lid();
+							if(local_mask[lid]==0.){
+								local_mask[lid]=1.;
+								keepgoing = true;
+								didsomething = 1;
+							}
+						}
+					}
+				}
+			}
+			iter++;
+		}
+
+		/*Check how many iterations all cpus did*/
+		int iter_max;
+		ISSM_MPI_Reduce(&iter,&iter_max,1,ISSM_MPI_INT,ISSM_MPI_MAX,0,IssmComm::GetComm());
+		ISSM_MPI_Bcast(&iter_max,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+		if(iter_max==2){
+			/*If iter is only 2, nothing else was changed in the while loop above (iter is initialized as 1 and then ++)*/
+			keepsyncing = false;
+		}
+	}
+
+	/*Cleanup*/
+	xDelete<bool>(element_flag);
+
+	/*OK, now deactivate iceberg and count the number of deactivated vertices*/
+	for(int i=0;i<femmodel->elements->Size();i++){
+		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+
+		if(element->IsIceInElement()){
+			int  numvertices = element->GetNumberOfVertices();
+			bool deactivate = false;
+			for(int j=0;j<numvertices;j++){
+				lid = element->vertices[j]->Lid();
+				if(local_mask[lid]==0.){
+					deactivate = true;
+					break;
+				}
+			}
+
+			if(deactivate){
+				int  numvertices = element->GetNumberOfVertices();
+				IssmDouble* values = xNew<IssmDouble>(numvertices);
+				for(int j=0;j<numvertices;j++) values[j] = 1.; /*Anything >0 = no ice*/
+				element->AddInput(MaskIceLevelsetEnum,values,P1Enum);
+				xDelete<IssmDouble>(values);
+			}
+		}
+	}
+
+	/*cleanup*/
+	xDelete<IssmDouble>(local_mask);
+}
Index: /issm/trunk/src/c/modules/KillIcebergsx/KillIcebergsx.h
===================================================================
--- /issm/trunk/src/c/modules/KillIcebergsx/KillIcebergsx.h	(revision 24313)
+++ /issm/trunk/src/c/modules/KillIcebergsx/KillIcebergsx.h	(revision 24313)
@@ -0,0 +1,10 @@
+#ifndef _KILLICEBERGS_H
+#define _KILLICEBERGS_H
+
+#include "../../classes/classes.h"
+#include "../../analyses/analyses.h"
+
+/* local prototypes: */
+void KillIcebergsx(FemModel* femmodel);
+
+#endif
Index: /issm/trunk/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp	(revision 24313)
@@ -3,5 +3,4 @@
  */
 
-#include "../VecMergex/VecMergex.h"
 #include "../../shared/io/io.h"
 #include "./Mergesolutionfromftogx.h"
@@ -9,42 +8,42 @@
 void	Mergesolutionfromftogx( Vector<IssmDouble>** pug, Vector<IssmDouble>* uf, Vector<IssmDouble>* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0){
 
-	/*output: */
-	Vector<IssmDouble>* ug=NULL;
-
-	/*intermediary: */
-	int configuration_type;
-	int gsize,fsize,ssize;
-
 	/*Display message*/
 	if(VerboseModule()) _printf0_("   Merging solution vector from fset to gset\n");
 
 	/*first, get gsize, fsize and ssize: */
-	parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
-	gsize=nodes->NumberOfDofs(configuration_type,GsetEnum);
-	fsize=nodes->NumberOfDofs(configuration_type,FsetEnum);
-	ssize=nodes->NumberOfDofs(configuration_type,SsetEnum);
+	int gsize=nodes->NumberOfDofs(GsetEnum);
+	int gsize_local=nodes->NumberOfDofsLocal(GsetEnum);
+	int fsize=nodes->NumberOfDofs(FsetEnum);
+	int ssize=nodes->NumberOfDofs(SsetEnum);
 
 	/*serialize uf and ys: those two vectors will be indexed by the nodes, who are the only ones 
 	 *that know which values should be plugged into ug and where: */
-	if(ssize){
-		if(flag_ys0){
-			ys->Set(0.0);
-		}
+	if(ssize) if(flag_ys0) ys->Set(0.0);
+
+	/*Get local vectors ys and uf*/
+	int        *indices_ys = NULL;
+	IssmDouble *local_ys   = NULL;
+	ys->GetLocalVector(&local_ys,&indices_ys);
+	int        *indices_uf = NULL;
+	IssmDouble *local_uf   = NULL;
+	uf->GetLocalVector(&local_uf,&indices_uf);
+
+	/*initialize ug: */
+	Vector<IssmDouble>* ug=new Vector<IssmDouble>(gsize_local,gsize);
+
+	/*Let nodes figure it out*/
+	for(int i=0;i<nodes->Size();i++){
+		Node* node=(Node*)nodes->GetObjectByOffset(i);
+		node->VecMerge(ug,local_uf,indices_uf,local_ys,indices_ys);
 	}
 
-	/*initialize ug: */
-	ug=new Vector<IssmDouble>(gsize);
+	/*Assemble vector: */
+	ug->Assemble();
 
-	/*Merge f set back into g set: */
-	if(fsize){
-		VecMergex(ug,uf,nodes,parameters,FsetEnum);
-	}
-
-	/*Merge s set back into g set: */
-	if(ssize){
-		VecMergex(ug,ys,nodes,parameters,SsetEnum);
-	}
-
-	/*Assign correct pointer*/
+	/*Cleanup and assign output pointer*/
+	xDelete<int>(indices_uf);
+	xDelete<int>(indices_ys);
+	xDelete<IssmDouble>(local_uf);
+	xDelete<IssmDouble>(local_ys);
 	*pug=ug;
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 24313)
@@ -60,4 +60,5 @@
 		if(     cost_function==ThicknessAbsMisfitEnum) iomodel->FetchDataToInput(elements,"md.inversion.thickness_obs",InversionThicknessObsEnum);
 		else if(cost_function==SurfaceAbsMisfitEnum)   iomodel->FetchDataToInput(elements,"md.inversion.surface_obs",InversionSurfaceObsEnum);
+		else if(cost_function==RheologyBInitialguessMisfitEnum) iomodel->FetchDataToInput(elements,"md.materials.rheology_B",RheologyBInitialguessEnum);
 		else if(cost_function==SurfaceAbsVelMisfitEnum
 			  || cost_function==SurfaceRelVelMisfitEnum
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateEdges.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateEdges.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateEdges.cpp	(revision 24313)
@@ -17,7 +17,6 @@
 
 	/*Intermediaries*/
-	bool exist;
 	int  i,j,v1,v2,v3;
-	int  maxnbe,nbe,elementnbe,elementnbv;
+	int  elementnbe,elementnbv;
 	int *elementedges         = NULL;
 	int *elementedges_markers = NULL;
@@ -30,7 +29,7 @@
 			elementedges         = xNew<int>(elementnbe*2);
 			elementedges_markers = xNew<int>(elementnbe);
-			elementedges[2*0+0] = 1; elementedges[2*0+1] = 2; elementedges_markers[0] = 1;
-			elementedges[2*1+0] = 2; elementedges[2*1+1] = 0; elementedges_markers[1] = 1;
-			elementedges[2*2+0] = 0; elementedges[2*2+1] = 1; elementedges_markers[2] = 1;
+			elementedges[2*0+0] = 1; elementedges[2*0+1] = 2; elementedges_markers[0] = -1;
+			elementedges[2*1+0] = 2; elementedges[2*1+1] = 0; elementedges_markers[1] = -1;
+			elementedges[2*2+0] = 0; elementedges[2*2+1] = 1; elementedges_markers[2] = -1;
 			break;
 		case TetraEnum:
@@ -39,10 +38,10 @@
 			elementedges         = xNew<int>(elementnbe*2);
 			elementedges_markers = xNew<int>(elementnbe);
-			elementedges[2*0+0] = 1; elementedges[2*0+1] = 2; elementedges_markers[0] = 1;
-			elementedges[2*1+0] = 0; elementedges[2*1+1] = 2; elementedges_markers[1] = 1;
-			elementedges[2*2+0] = 0; elementedges[2*2+1] = 1; elementedges_markers[2] = 1;
-			elementedges[2*3+0] = 1; elementedges[2*3+1] = 3; elementedges_markers[3] = 1;
-			elementedges[2*4+0] = 2; elementedges[2*4+1] = 3; elementedges_markers[4] = 1;
-			elementedges[2*5+0] = 0; elementedges[2*5+1] = 3; elementedges_markers[5] = 1;
+			elementedges[2*0+0] = 1; elementedges[2*0+1] = 2; elementedges_markers[0] = -1;
+			elementedges[2*1+0] = 0; elementedges[2*1+1] = 2; elementedges_markers[1] = -1;
+			elementedges[2*2+0] = 0; elementedges[2*2+1] = 1; elementedges_markers[2] = -1;
+			elementedges[2*3+0] = 1; elementedges[2*3+1] = 3; elementedges_markers[3] = -1;
+			elementedges[2*4+0] = 2; elementedges[2*4+1] = 3; elementedges_markers[4] = -1;
+			elementedges[2*5+0] = 0; elementedges[2*5+1] = 3; elementedges_markers[5] = -1;
 			break;
 		case PentaEnum:
@@ -66,9 +65,17 @@
 
 	/*Maximum number of edges*/
-	maxnbe = elementnbe*iomodel->numberofelements;
+	int maxnbe = elementnbe*iomodel->numberofelements;
 
 	/*Initialize intermediaries*/
-	int *edgestemp                 = xNew<int>(maxnbe*3);                             /*format: [vertex1 vertex2 marker]       */
-	int *element_edge_connectivity = xNew<int>(iomodel->numberofelements*elementnbe); /*format: [edge1 edge2 ... edgen] */
+	int *edgestemp                  = xNew<int>(maxnbe*3);                             /*format: [vertex1 vertex2 marker]*/
+	int *vedgestemp                 = xNew<int>(maxnbe*2);                             /*format: [vertex1 vertex2]       */
+	int *hedgestemp                 = xNew<int>(maxnbe*2);                             /*format: [vertex1 vertex2]       */
+	int *element_edge_connectivity  = xNew<int>(iomodel->numberofelements*elementnbe); /*format: [edge1 edge2 ... edgen] */
+	int *element_vedge_connectivity = NULL;
+	int *element_hedge_connectivity = NULL;
+	if(iomodel->meshelementtype==PentaEnum){
+		element_vedge_connectivity  = xNew<int>(iomodel->numberofelements*3); /*format: [edge1 edge2 ... edgen] */
+		element_hedge_connectivity  = xNew<int>(iomodel->numberofelements*6); /*format: [edge1 edge2 ... edgen] */
+	}
 
 	/*Initialize chain*/
@@ -78,5 +85,5 @@
 
 	/*Initialize number of edges*/
-	nbe = 0;
+	int nbe  = 0;
 
 	for(i=0;i<iomodel->numberofelements;i++){
@@ -93,5 +100,5 @@
 
 			/*This edge a priori has not been processed yet*/
-			exist = false;
+			bool exist = false;
 
 			/*Go through all processed edges connected to v1 and check whether we have seen this edge yet*/
@@ -126,21 +133,85 @@
 	}
 
+	/*vertical/horizontal edges*/
+	int nbve = 0;
+	int nbhe = 0;
+	if(iomodel->meshelementtype==PentaEnum){
+		for(i=0;i<iomodel->numberofvertices;i++) head_minv[i]=-1;
+		for(i=0;i<iomodel->numberofelements;i++){
+			for(j=0;j<3;j++){
+				v1 = iomodel->elements[i*elementnbv+elementedges[2*j+0]]-1; _assert_(v1>=0 & v1<iomodel->numberofvertices);
+				v2 = iomodel->elements[i*elementnbv+elementedges[2*j+1]]-1; _assert_(v2>=0 & v2<iomodel->numberofvertices);
+				if(v2<v1){ v3=v2; v2=v1; v1=v3;}
+				bool exist = false;
+				for(int e=head_minv[v1]; e!=-1; e=next_edge[e]){
+					if(vedgestemp[e*2+1]==v2+1){
+						exist = true;
+						element_vedge_connectivity[i*3+j]=e;
+						break;
+					}
+				}
+				if(!exist){
+					vedgestemp[nbve*2+0] = v1+1;
+					vedgestemp[nbve*2+1] = v2+1;
+					element_vedge_connectivity[i*3+j]=nbve;
+					next_edge[nbve] = head_minv[v1];
+					head_minv[v1]   = nbve;
+					nbve++;
+				}
+			}
+		}
+		for(i=0;i<iomodel->numberofvertices;i++) head_minv[i]=-1;
+		for(i=0;i<iomodel->numberofelements;i++){
+			for(j=3;j<9;j++){
+				v1 = iomodel->elements[i*elementnbv+elementedges[2*j+0]]-1; _assert_(v1>=0 & v1<iomodel->numberofvertices);
+				v2 = iomodel->elements[i*elementnbv+elementedges[2*j+1]]-1; _assert_(v2>=0 & v2<iomodel->numberofvertices);
+				if(v2<v1){ v3=v2; v2=v1; v1=v3;}
+				bool exist = false;
+				for(int e=head_minv[v1]; e!=-1; e=next_edge[e]){
+					if(hedgestemp[e*2+1]==v2+1){
+						exist = true;
+						element_hedge_connectivity[i*6+(j-3)]=e;
+						break;
+					}
+				}
+				if(!exist){
+					hedgestemp[nbhe*2+0] = v1+1;
+					hedgestemp[nbhe*2+1] = v2+1;
+					element_hedge_connectivity[i*6+(j-3)]=nbhe;
+					next_edge[nbhe] = head_minv[v1];
+					head_minv[v1]   = nbhe;
+					nbhe++;
+				}
+			}
+		}
+	}
+
 	/*Clean up*/
 	xDelete<int>(head_minv);
 	xDelete<int>(next_edge);
+	xDelete<int>(elementedges);
 	xDelete<int>(elementedges_markers);
 
 	/*Create final edges*/
-	int* edges = xNew<int>(nbe*3); /*format: [vertex1 vertex2 marker]*/
+	int* edges = xNew<int>(nbe*3);
 	for(int i=0;i<3*nbe;i++) edges[i] = edgestemp[i];
-
-	/*Clean up*/
 	xDelete<int>(edgestemp);
-	xDelete<int>(elementedges);
+	int* vedges = xNew<int>(nbve*2);
+	for(int i=0;i<2*nbve;i++) vedges[i] = vedgestemp[i];
+	xDelete<int>(vedgestemp);
+	int* hedges = xNew<int>(nbhe*2);
+	for(int i=0;i<2*nbhe;i++) hedges[i] = hedgestemp[i];
+	xDelete<int>(hedgestemp);
 
 	/*Assign output pointers*/
-	iomodel->edges                     = edges;
+	iomodel->edges           = edges;
+	iomodel->verticaledges   = vedges;
+	iomodel->horizontaledges = hedges;
 	iomodel->elementtoedgeconnectivity = element_edge_connectivity;
+	iomodel->elementtoverticaledgeconnectivity = element_vedge_connectivity;
+	iomodel->elementtohorizontaledgeconnectivity = element_hedge_connectivity;
 	iomodel->numberofedges             = nbe;
+	iomodel->numberofverticaledges     = nbve;
+	iomodel->numberofhorizontaledges   = nbhe;
 }/*}}}*/
 void EdgeOnBoundaryFlags(bool** pflags,IoModel* iomodel){/*{{{*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 24313)
@@ -8,29 +8,42 @@
 #include "./ModelProcessorx.h"
 
-void CreateElementsVerticesAndMaterials(Elements* elements,Vertices* vertices,Materials* materials,IoModel* iomodel,const int nummodels,int solution_type){
+#define MAXCONNECTIVITY 5
+
+bool IsVertexInRank(int* vertices_ranks,int* vertices_proc_count,int vid,int rank){/*{{{*/
+
+	/*See if node is already in partition*/
+	for(int k=0;k<vertices_proc_count[vid];k++){
+		if(vertices_ranks[MAXCONNECTIVITY*vid+k] == rank) return true;
+	}
+
+	return false;
+}/*}}}*/
+int  VertexMasterRank(int* vertices_ranks,int vid){/*{{{*/
+	return vertices_ranks[MAXCONNECTIVITY*vid+0];
+}/*}}}*/
+void AddVertexToRank(int* vertices_ranks,int* vertices_proc_count,int vid,int rank){/*{{{*/
+
+	/*See if node is already in partition, return if this is the case*/
+	if(IsVertexInRank(vertices_ranks,vertices_proc_count,vid,rank)) return;
+
+	/*This rank has not been marked for this node just yet so go ahead and add it*/
+	if(vertices_proc_count[vid]==MAXCONNECTIVITY) _error_("This vertex is connected to more than "<<MAXCONNECTIVITY<<" partition. Either reduce the number of processors, or increase MAXCONNECTIVITY");
+	vertices_ranks[MAXCONNECTIVITY*vid+vertices_proc_count[vid]] = rank;
+	vertices_proc_count[vid]++;
+}/*}}}*/
+
+void CreateElements(Elements* elements,IoModel* iomodel,const int nummodels){/*{{{*/
 
 	/*Intermediary*/
-	int i;
-	int materials_type;
 	bool control_analysis;
-	bool dakota_analysis;
 	bool adolc_analysis;
-	bool isoceancoupling;
-	int nnat,dummy;
-	int* nature=NULL;
 
 	/*Fetch parameters: */
 	iomodel->FindConstant(&control_analysis,"md.inversion.iscontrol");
-	iomodel->FindConstant(&dakota_analysis,"md.qmu.isdakota");
-	iomodel->FindConstant(&materials_type,"md.materials.type");
 	iomodel->FindConstant(&adolc_analysis,"md.autodiff.isautodiff");
-	iomodel->FindConstant(&isoceancoupling,"md.transient.isoceancoupling");
 
 	/*Did we already create the elements? : */
 	_assert_(elements->Size()==0);
 
-	/*Setup matpar counter in iomodel before we call on element constructors: */
-	iomodel->matparcounter=iomodel->numberofelements+1;
-
 	/*Create elements*/
 	if(control_analysis && !adolc_analysis)iomodel->FetchData(2,"md.inversion.min_parameters","md.inversion.max_parameters");
@@ -38,10 +51,10 @@
 	switch(iomodel->meshelementtype){
 		case TriaEnum:
-			for(i=0;i<iomodel->numberofelements;i++){
+			for(int i=0;i<iomodel->numberofelements;i++){
 				if(iomodel->my_elements[i]) elements->AddObject(new Tria(i+1,i,iomodel,nummodels));
 			}
 			break;
 		case TetraEnum:
-			for(i=0;i<iomodel->numberofelements;i++){
+			for(int i=0;i<iomodel->numberofelements;i++){
 				if(iomodel->my_elements[i]) elements->AddObject(new Tetra(i+1,i,iomodel,nummodels));
 			}
@@ -49,5 +62,5 @@
 		case PentaEnum:
 			iomodel->FetchData(2,"md.mesh.upperelements","md.mesh.lowerelements");
-			for(i=0;i<iomodel->numberofelements;i++){
+			for(int i=0;i<iomodel->numberofelements;i++){
 				if(iomodel->my_elements[i]) elements->AddObject(new Penta(i+1,i,iomodel,nummodels));
 			}
@@ -56,4 +69,21 @@
 			_error_("Mesh not supported yet");
 	}
+
+	/*Free data: */
+	iomodel->DeleteData(4,"md.mesh.upperelements","md.mesh.lowerelements","md.inversion.min_parameters","md.inversion.max_parameters");
+}/*}}}*/
+void CreateMaterials(Elements* elements,Materials* materials,IoModel* iomodel,const int nummodels){/*{{{*/
+
+	/*Intermediary*/
+	int  i;
+	int  nnat,dummy;
+	int* nature=NULL;
+
+	/*Fetch parameters: */
+	int materials_type;
+	iomodel->FindConstant(&materials_type,"md.materials.type");
+
+	/*Did we already create the materiaas? : */
+	_assert_(materials->Size()==0);
 
 	/*Create materials*/
@@ -223,27 +253,204 @@
 
 	/*Free data: */
-	iomodel->DeleteData(7,"md.mesh.upperelements","md.mesh.lowerelements","md.material.rheology_B","md.material.rheology_n","md.damage.D","md.inversion.min_parameters","md.inversion.max_parameters");
-
-	/*Add new constant material property to materials, at the end: */
-	materials->AddObject(new Matpar(iomodel));//put it at the end of the materials
-
-	/*Create vertices: */
-
-	/*Fetch data:*/
-	iomodel->FetchData(6,"md.mesh.x","md.mesh.y","md.mesh.z","md.geometry.base","md.geometry.thickness","md.mask.ice_levelset");
-	if (iomodel->domaintype == Domain3DsurfaceEnum) iomodel->FetchData(3,"md.mesh.lat","md.mesh.long","md.mesh.r");
-	else iomodel->FetchDataToInput(elements,"md.mesh.scale_factor",MeshScaleFactorEnum,1.);
-	if (isoceancoupling) iomodel->FetchData(2,"md.mesh.lat","md.mesh.long");
-
-	CreateNumberNodeToElementConnectivity(iomodel,solution_type);
-
-	int lid = 0;
-	for(i=0;i<iomodel->numberofvertices;i++){
-		if(iomodel->my_vertices[i]) vertices->AddObject(new Vertex(i+1,i,lid++,i,iomodel));
+	iomodel->DeleteData(3,"md.material.rheology_B","md.material.rheology_n","md.damage.D");
+}/*}}}*/
+void CreateVertices(Elements* elements,Vertices* vertices,IoModel* iomodel,int solution_type,bool isamr){/*{{{*/
+
+	/*Get element partitionning*/
+	int* epart = iomodel->epart;
+
+	/*Determine element width*/
+	int  elements_width;
+	switch(iomodel->meshelementtype){
+		case TriaEnum:  elements_width=3; break;
+		case TetraEnum: elements_width=4; break;
+		case PentaEnum: elements_width=6; break;
+		default: _error_("mesh elements "<< EnumToStringx(iomodel->meshelementtype) <<" not supported yet");
+	}
+
+	/*Get my_rank:*/
+	int my_rank   = IssmComm::GetRank();
+	int num_procs = IssmComm::GetSize();
+
+	/*create matrix that keeps track of all ranks that have vertex i, and initialize as -1 (Common to all CPUs)*/
+	int* vertices_ranks = xNew<int>(MAXCONNECTIVITY*iomodel->numberofvertices);
+	for(int i=0;i<MAXCONNECTIVITY*iomodel->numberofvertices;i++) vertices_ranks[i] = -1;
+
+	/*For all vertices, count how many cpus hold vertex i (initialize with 0)*/
+	int* vertices_proc_count = xNewZeroInit<int>(iomodel->numberofvertices);
+
+	/*Go through all elements and mark all vertices for all partitions*/
+	for(int i=0;i<iomodel->numberofelements;i++){
+		for(int j=0;j<elements_width;j++){
+			/*Get current vertex sid*/
+			int vid = iomodel->elements[elements_width*i+j]-1;
+			AddVertexToRank(vertices_ranks,vertices_proc_count,vid,epart[i]);
+		}
+	}
+
+	/*Take care of penalties (only in non-AMR for now)*/
+	if(!isamr){
+		int numvertex_pairing;
+		int *vertex_pairing = NULL;
+		iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,"md.stressbalance.vertex_pairing");
+		for(int i=0;i<numvertex_pairing;i++){
+			int id1 = vertex_pairing[2*i+0]-1;
+			int id2 = vertex_pairing[2*i+1]-1;
+			for(int e=0;e<num_procs;e++){
+				if(IsVertexInRank(vertices_ranks,vertices_proc_count,id1,e)){
+					AddVertexToRank(vertices_ranks,vertices_proc_count,id2,e);
+				}
+			}
+		}
+		xDelete<int>(vertex_pairing);
+		iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,"md.masstransport.vertex_pairing");
+		for(int i=0;i<numvertex_pairing;i++){
+			int id1 = vertex_pairing[2*i+0]-1;
+			int id2 = vertex_pairing[2*i+1]-1;
+			for(int e=0;e<num_procs;e++){
+				if(IsVertexInRank(vertices_ranks,vertices_proc_count,id1,e)){
+					AddVertexToRank(vertices_ranks,vertices_proc_count,id2,e);
+				}
+			}
+		}
+		xDelete<int>(vertex_pairing);
+	}
+
+	/*Create vector of size total numnodes, initialized with -1, that will keep track of local ids*/
+	int  offset = 0;
+	int* vertices_offsets  = xNew<int>(iomodel->numberofvertices);
+	for(int i=0;i<iomodel->numberofvertices;i++){
+		if(IsVertexInRank(vertices_ranks,vertices_proc_count,i,my_rank)){
+			vertices_offsets[i] = offset++;
+		}
+		else{
+			vertices_offsets[i] = -1;
+		}
+	}
+
+	/*Now, Count how many clones we have with other partitions*/
+	int*  common_send = xNew<int>(num_procs);
+	int*  common_recv = xNew<int>(num_procs);
+	int** common_send_ids = xNew<int*>(num_procs);
+	int** common_recv_ids = xNew<int*>(num_procs);
+
+	/*First step: allocate, Step 2: populate*/
+	for(int step=0;step<2;step++){
+
+		if(step==1){
+			/*Allocate send and receive arrays of ids now*/
+			for(int i=0;i<num_procs;i++){
+				_assert_(common_send[i]>=0 && common_recv[i]>=0);
+				common_send_ids[i] = xNew<int>(common_send[i]);
+				common_recv_ids[i] = xNew<int>(common_recv[i]);
+			}
+		}
+
+		/*Re/Initialize counters to 0*/
+		for(int i=0;i<num_procs;i++){
+			common_recv[i]=0;
+			common_send[i]=0;
+		}
+
+		/*Go through table and find clones/masters etc*/
+		for(int i=0;i<iomodel->numberofvertices;i++){
+
+			/*If we did not find this vertex in our current partition, go to next vertex*/
+			if(vertices_offsets[i] == -1) continue;
+
+			/*Find in what column this rank belongs*/
+			int col = -1;
+			for(int j=0;j<MAXCONNECTIVITY;j++){
+				if(vertices_ranks[MAXCONNECTIVITY*i+j] == my_rank){
+					col = j;
+					break;
+				}
+			}
+			_assert_(col!=-1);
+
+			/*If col==0, it is either not on boundary, or a master*/
+			if(col==0){
+				/*1. is this vertex on the boundary? Skip if not*/
+				if(vertices_ranks[MAXCONNECTIVITY*i+col+1]==-1){
+					continue;
+				}
+				else{
+					for(int j=1;j<vertices_proc_count[i];j++){
+						_assert_(vertices_ranks[MAXCONNECTIVITY*i+j]>=0);
+						int rank = vertices_ranks[MAXCONNECTIVITY*i+j];
+						if(step==1){
+							common_send_ids[rank][common_send[rank]] = vertices_offsets[i];
+						}
+						common_send[rank]++;
+					}
+				}
+			}
+			else{
+				/*3. It is a slave, record that we need to receive for this cpu*/
+				int rank = vertices_ranks[MAXCONNECTIVITY*i+0];
+				if(step==1){
+					common_recv_ids[rank][common_recv[rank]] = vertices_offsets[i];
+				}
+				common_recv[rank]++;
+			}
+		}
+	}
+
+	/*Create Vertices, depending on the constructor type: */
+	if(solution_type!=LoveSolutionEnum) CreateNumberNodeToElementConnectivity(iomodel);
+	if(!isamr){
+		bool isoceancoupling;
+		iomodel->FindConstant(&isoceancoupling,"md.transient.isoceancoupling");
+
+		iomodel->FetchData(6,"md.mesh.x","md.mesh.y","md.mesh.z","md.geometry.base","md.geometry.thickness","md.mask.ice_levelset");
+		if (iomodel->domaintype == Domain3DsurfaceEnum) iomodel->FetchData(3,"md.mesh.lat","md.mesh.long","md.mesh.r");
+		else iomodel->FetchDataToInput(elements,"md.mesh.scale_factor",MeshScaleFactorEnum,1.);
+		if (isoceancoupling) iomodel->FetchData(2,"md.mesh.lat","md.mesh.long");
+
+		for(int i=0;i<iomodel->numberofvertices;i++){
+			if(vertices_offsets[i]!=-1){
+				bool isclone = (vertices_ranks[MAXCONNECTIVITY*i+0]!=my_rank);
+				vertices->AddObject(new Vertex(i+1,i,isclone,iomodel,isamr));
+			}
+		}
+
+		/*Free data: */
+		iomodel->DeleteData(6,"md.mesh.x","md.mesh.y","md.mesh.z","md.geometry.base","md.geometry.thickness","md.mask.ice_levelset");
+		if (iomodel->domaintype == Domain3DsurfaceEnum) iomodel->DeleteData(3,"md.mesh.lat","md.mesh.long","md.mesh.r");
+		if (isoceancoupling) iomodel->DeleteData(2,"md.mesh.lat","md.mesh.long");
+	}
+	else{
+		for(int i=0;i<iomodel->numberofvertices;i++){
+			if(vertices_offsets[i]!=-1){
+				bool isclone = (vertices_ranks[MAXCONNECTIVITY*i+0]!=my_rank);
+				vertices->AddObject(new Vertex(i+1,i,isclone,iomodel,isamr));
+			}
+		}
+	}
+	xDelete<int>(vertices_offsets);
+
+	/*Final step, create my_vertices*/
+	_assert_(!iomodel->my_vertices);
+	iomodel->my_vertices = xNew<bool>(iomodel->numberofvertices);
+	for(int i=0;i<iomodel->numberofvertices;i++){
+		if(IsVertexInRank(vertices_ranks,vertices_proc_count,i,my_rank)){
+			iomodel->my_vertices[i] = true;
+		}
+		else{
+			iomodel->my_vertices[i] = false;
+		}
 	}
 
 	/*Free data: */
-	iomodel->DeleteData(6,"md.mesh.x","md.mesh.y","md.mesh.z","md.geometry.base","md.geometry.thickness","md.mask.ice_levelset");
-	if (iomodel->domaintype == Domain3DsurfaceEnum) iomodel->DeleteData(3,"md.mesh.lat","md.mesh.long","md.mesh.r");
-	if (isoceancoupling) iomodel->DeleteData(2,"md.mesh.lat","md.mesh.long");
-}
+	xDelete<int>(vertices_ranks);
+	xDelete<int>(vertices_proc_count);
+
+	/*Assign communicators*/
+	vertices->common_send=common_send;
+	vertices->common_recv=common_recv;
+	vertices->common_send_ids=common_send_ids;
+	vertices->common_recv_ids=common_recv_ids;
+
+	/*Finalize Initialization*/
+	vertices->Finalize();
+}/*}}}*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateFaces.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateFaces.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateFaces.cpp	(revision 24313)
@@ -125,7 +125,6 @@
 
 	/*Intermediaries*/
-	bool exist;
-	int  i,j,k,v0,cols,facescols;
-	int  maxnbf,nbf,elementnbf,elementnbv,facenbv,facemaxnbv;
+	int  i,j,k,v0,cols,facemaxnbv;
+	int  elementnbf,elementnbv,facenbv;
 	int *elementfaces         = NULL;
 	int *elementfaces_markers = NULL;
@@ -175,12 +174,17 @@
 
 	/*Allocate connectivity*/
-	int *element_face_connectivity = xNew<int>(iomodel->numberofelements*elementnbf); /*format: [face1 face2 ...] */
+	int *element_face_connectivity  = xNew<int>(iomodel->numberofelements*elementnbf); /*format: [face1 face2 ...] */
+	int *element_vface_connectivity = NULL;
+	if(iomodel->meshelementtype==PentaEnum){
+		element_vface_connectivity = xNew<int>(iomodel->numberofelements*3); /*format: [face1 face2 face3] */
+	}
 
 	/*Maximum number of faces for initial allocation*/
-	maxnbf     = elementnbf*iomodel->numberofelements;
-	facescols  = 4+facemaxnbv; _assert_(facescols>6);
+	int maxnbf     = elementnbf*iomodel->numberofelements;
+	int facescols  = 4+facemaxnbv; _assert_(facescols>6);
 
 	/*Initialize intermediaries*/
-	int* facestemp = xNew<int>(maxnbf*facescols);        /*format: [element1 element2 marker nbv vertex1 vertex2 vertex3 ...]    */
+	int* facestemp  = xNew<int>(maxnbf*facescols);        /*format: [element1 element2 marker nbv vertex1 vertex2 vertex3 ...]    */
+	int* vfacestemp = xNew<int>(maxnbf*4);
 	for(i=0;i<maxnbf;i++) facestemp[i*facescols+1]=-1;   /*Initialize second column of faces as -1 (boundary face)               */
 
@@ -191,7 +195,6 @@
 
 	/*Initialize number of faces and list of vertex indices*/
-	nbf = 0;
+	int nbf = 0;
 	int* v = xNew<int>(facemaxnbv);
-
 	for(i=0;i<iomodel->numberofelements;i++){
 		for(j=0;j<elementnbf;j++){
@@ -208,5 +211,5 @@
 
 			/*This face a priori has not been processed yet*/
-			exist = false;
+			bool exist = false;
 
 			/*Go through all processed faces connected to v0 and check whether we have seen this face yet*/
@@ -243,4 +246,32 @@
 	}
 
+	/*Vertical faces*/
+	int nbvf = 0;
+	if(iomodel->meshelementtype==PentaEnum){
+		for(i=0;i<iomodel->numberofvertices;i++) head_minv[i]=-1;
+		for(i=0;i<iomodel->numberofelements;i++){
+			for(j=2;j<5;j++){
+				for(k=0;k<4;k++) v[k] = iomodel->elements[i*elementnbv + elementfaces[cols*j+k+1]] - 1;
+				HeapSort(v,4);
+				v0 = v[0]; _assert_(v0>=0 && v0<iomodel->numberofvertices);
+				bool exist = false;
+				for(int f=head_minv[v0]; f!=-1; f=next_face[f]){
+					if(vfacestemp[f*4+1]==v[1]+1 && vfacestemp[f*4+2]==v[2]+1){
+						exist = true;
+						element_vface_connectivity[i*3+(j-2)]=f;
+						break;
+					}
+				}
+				if(!exist){ _assert_(nbvf<maxnbf);
+					for(k=0;k<4;k++) vfacestemp[nbvf*4+k] = v[k]+1;
+					element_vface_connectivity[i*3+(j-2)]=nbvf;
+					next_face[nbvf] = head_minv[v0];
+					head_minv[v0]   = nbvf;
+					nbvf++;
+				}
+			}
+		}
+	}
+
 	/*Clean up*/
 	xDelete<int>(head_minv);
@@ -254,9 +285,15 @@
 	xMemCpy<int>(faces,facestemp,nbf*facescols);
 	xDelete<int>(facestemp);
+	int* vfaces = xNew<int>(nbvf*4);
+	xMemCpy<int>(vfaces,vfacestemp,nbvf*4);
+	xDelete<int>(vfacestemp);
 
 	/*Assign output pointers*/
-	iomodel->faces                     = faces;
-	iomodel->numberoffaces             = nbf;
-	iomodel->facescols                 = facescols;
-	iomodel->elementtofaceconnectivity = element_face_connectivity;
+	iomodel->faces                             = faces;
+	iomodel->verticalfaces                     = vfaces;
+	iomodel->numberoffaces                     = nbf;
+	iomodel->numberofverticalfaces             = nbvf;
+	iomodel->facescols                         = facescols;
+	iomodel->elementtofaceconnectivity         = element_face_connectivity;
+	iomodel->elementtoverticalfaceconnectivity = element_vface_connectivity;
 }/*}}}*/
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateNodes.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateNodes.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateNodes.cpp	(revision 24313)
@@ -9,595 +9,695 @@
 #include "./ModelProcessorx.h"
 
-void CreateNodes(Nodes* nodes, IoModel* iomodel,int analysis,int finite_element,int approximation){
+#define MAXCONNECTIVITY 5
+
+bool IsNodeInRank(int* nodes_ranks,int* nodes_proc_count,int nid,int rank){/*{{{*/
+
+	/*See if node is already in partition*/
+	for(int k=0;k<nodes_proc_count[nid];k++){
+		if(nodes_ranks[MAXCONNECTIVITY*nid+k] == rank) return true;
+	}
+
+	return false;
+}/*}}}*/
+int  NodeMasterRank(int* nodes_ranks,int nid){/*{{{*/
+	return nodes_ranks[MAXCONNECTIVITY*nid+0];
+}/*}}}*/
+void AddNodeToRank(int* nodes_ranks,int* nodes_proc_count,int nid,int rank){/*{{{*/
+
+	/*See if node is already in partition, return if this is the case*/
+	if(IsNodeInRank(nodes_ranks,nodes_proc_count,nid,rank)) return;
+
+	/*This rank has not been marked for this node just yet so go ahead and add it*/
+	if(nodes_proc_count[nid]==MAXCONNECTIVITY) _error_("This node is connected to more than "<<MAXCONNECTIVITY<<" partition. Either reduce the number of processors, or increase MAXCONNECTIVITY");
+	nodes_ranks[MAXCONNECTIVITY*nid+nodes_proc_count[nid]] = rank;
+	nodes_proc_count[nid]++;
+}/*}}}*/
+
+void CreateNodes(Nodes* nodes, IoModel* iomodel,int analysis,int finite_element,bool isamr,int approximation,int* approximations){
 
 	/*Intermediaries*/
-	int   i,j,counter,vnodes,lid=0;
-	int   numberoffaces,elementnbv;
-	int   id0 = iomodel->nodecounter;
-	bool *my_nodes = NULL;
-	Node *node     = NULL;
-
-	switch(finite_element){
-		case P1Enum:
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,approximation));
-				}
-			}
-			break;
-
-		case P1DGEnum:
-			NodesPartitioning(&my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,false);
-			for(i=0;i<iomodel->numberofelements;i++){
-				for(j=0;j<3;j++){
-					if(my_nodes[3*i+j]){ 
-						nodes->AddObject(new Node(id0+3*i+j+1,id0+3*i+j,lid++,iomodel->elements[3*i+j]-1,iomodel,analysis,approximation));
-
+	int        numnodes;
+	int        element_numnodes;
+	int        element_node_ids[40] = {0};
+
+	/*Get partitioning variables*/
+	int  my_rank   = IssmComm::GetRank();
+	int  num_procs = IssmComm::GetSize();
+	int*     epart = iomodel->epart;
+
+	/*Determine how many nodes we have in total (which depends on the type of finite element)*/
+	/*{{{*/
+	if(iomodel->meshelementtype==TriaEnum){
+		switch(finite_element){
+			case P0DGEnum:
+				numnodes = iomodel->numberofelements;
+				break;
+			case P1Enum:
+				numnodes = iomodel->numberofvertices;
+				break;
+			case P1DGEnum:
+				numnodes = 3*iomodel->numberofelements;
+				break;
+			case P1bubbleEnum: case P1bubblecondensedEnum:
+				numnodes = iomodel->numberofvertices+iomodel->numberofelements;
+				break;
+			case P2Enum:
+				EdgesPartitioning(iomodel);
+				numnodes = iomodel->numberofvertices+iomodel->numberofedges;
+				break;
+			case MINIEnum: case MINIcondensedEnum:
+				/*P1+ velocity (bubble statically condensed), P1 pressure*/
+				numnodes = (iomodel->numberofvertices+iomodel->numberofelements) + (iomodel->numberofvertices);
+				break;
+			case TaylorHoodEnum: case XTaylorHoodEnum:
+				/*P2 velocity, P1 pressure*/
+				EdgesPartitioning(iomodel);
+				numnodes = (iomodel->numberofvertices+iomodel->numberofedges) + (iomodel->numberofvertices);
+				break;
+			case LATaylorHoodEnum:
+				/*P2 velocity*/
+				EdgesPartitioning(iomodel);
+				numnodes = (iomodel->numberofvertices+iomodel->numberofedges);
+				break;
+			case CrouzeixRaviartEnum:
+				/*P2b velocity, P1 DG pressure*/
+				EdgesPartitioning(iomodel);
+				numnodes = (iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofelements) + (3*iomodel->numberofelements);
+				break;
+			case LACrouzeixRaviartEnum:
+				/*P2b velocity*/
+				EdgesPartitioning(iomodel);
+				numnodes = (iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofelements);
+				break;
+			default:
+				_error_("Finite element "<<EnumToStringx(finite_element)<<" not supported yet");
+		}
+	}
+	else if(iomodel->meshelementtype==PentaEnum){
+		switch(finite_element){
+			case P1Enum:
+				numnodes = iomodel->numberofvertices;
+				break;
+			case P1bubbleEnum: case P1bubblecondensedEnum:
+				numnodes = iomodel->numberofvertices+iomodel->numberofelements;
+				break;
+			case P1xP2Enum:
+				EdgesPartitioning(iomodel);
+				numnodes = iomodel->numberofvertices+iomodel->numberofverticaledges;
+				break;
+			case P1xP3Enum:
+				EdgesPartitioning(iomodel);
+				numnodes = iomodel->numberofvertices+2*iomodel->numberofverticaledges;
+				break;
+			case P1xP4Enum:
+				EdgesPartitioning(iomodel);
+				numnodes = iomodel->numberofvertices+3*iomodel->numberofverticaledges;
+				break;
+			case P2xP1Enum:
+				EdgesPartitioning(iomodel);
+				numnodes = iomodel->numberofvertices+iomodel->numberofhorizontaledges;
+				break;
+			case P2Enum:
+				EdgesPartitioning(iomodel);
+				FacesPartitioning(iomodel);
+				numnodes = iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofverticalfaces;
+				break;
+			case P2xP4Enum:
+				EdgesPartitioning(iomodel);
+				FacesPartitioning(iomodel);
+				numnodes = iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->numberofverticalfaces;
+				break;
+			case MINIEnum: case MINIcondensedEnum:
+				/*P1+ velocity (bubble statically condensed), P1 pressure*/
+				numnodes = (iomodel->numberofvertices+iomodel->numberofelements) + (iomodel->numberofvertices);
+				break;
+			case TaylorHoodEnum: case XTaylorHoodEnum:
+				/*P2 velocity, P1 pressure*/
+				EdgesPartitioning(iomodel);
+				FacesPartitioning(iomodel);
+				numnodes = (iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofverticalfaces) + (iomodel->numberofvertices);
+				break;
+			case OneLayerP4zEnum:
+				/*P2xP4 velocity, P1 pressure*/
+				EdgesPartitioning(iomodel);
+				FacesPartitioning(iomodel);
+				numnodes = (iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->numberofverticalfaces) + (iomodel->numberofvertices);
+				break;
+			default:
+				_error_("Finite element "<<EnumToStringx(finite_element)<<" not supported yet");
+		}
+	}
+	else{
+		_error_("mesh elements "<< EnumToStringx(iomodel->meshelementtype) <<" not supported yet");
+	}
+	/*}}}*/
+
+	/*create matrix that keeps track of all ranks that have node i, and initialize as -1 (Common to all CPUs)*/
+	int* nodes_ranks = xNew<int>(MAXCONNECTIVITY*numnodes);
+	for(int i=0;i<MAXCONNECTIVITY*numnodes;i++) nodes_ranks[i] = -1;
+
+	/*For all nodes, count how many cpus have node i (initialize with 0)*/
+	int* nodes_proc_count = xNewZeroInit<int>(numnodes);
+
+	/*Create vector of approximation per node (used for FS: vel or pressure)*/
+	int* nodes_approx = xNew<int>(numnodes);
+	if(approximations){
+		for(int i=0;i<numnodes;i++) nodes_approx[i] = approximations[i];
+	}
+	else{
+		for(int i=0;i<numnodes;i++) nodes_approx[i] = approximation;
+	}
+
+	/*Go through all elements and mark all vertices for all partitions*/
+	/*{{{*/
+	for(int i=0;i<iomodel->numberofelements;i++){
+
+		/*Define nodes sids for each element*/
+		if(iomodel->meshelementtype==TriaEnum){
+			switch(finite_element){
+				case P0DGEnum:
+					element_numnodes=1;
+					element_node_ids[0]=i;
+					break;
+				case P1Enum:
+					element_numnodes=3;
+					element_node_ids[0]=iomodel->elements[3*i+0]-1;
+					element_node_ids[1]=iomodel->elements[3*i+1]-1;
+					element_node_ids[2]=iomodel->elements[3*i+2]-1;
+					break;
+				case P1bubbleEnum: case P1bubblecondensedEnum:
+					element_numnodes=4;
+					element_node_ids[0]=iomodel->elements[3*i+0]-1;
+					element_node_ids[1]=iomodel->elements[3*i+1]-1;
+					element_node_ids[2]=iomodel->elements[3*i+2]-1;
+					element_node_ids[3]=iomodel->numberofvertices+i;
+					break;
+				case P1DGEnum:
+					element_numnodes=3;
+					element_node_ids[0]=3*i+0;
+					element_node_ids[1]=3*i+1;
+					element_node_ids[2]=3*i+2;
+					break;
+				case P2Enum:
+					element_numnodes = 6;
+					element_node_ids[0]=iomodel->elements[3*i+0]-1;
+					element_node_ids[1]=iomodel->elements[3*i+1]-1;
+					element_node_ids[2]=iomodel->elements[3*i+2]-1;
+					element_node_ids[3]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*i+0];
+					element_node_ids[4]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*i+1];
+					element_node_ids[5]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*i+2];
+					break;
+				case MINIEnum: case MINIcondensedEnum:
+					element_numnodes = 4+3;
+					element_node_ids[0]=iomodel->elements[3*i+0]-1;
+					element_node_ids[1]=iomodel->elements[3*i+1]-1;
+					element_node_ids[2]=iomodel->elements[3*i+2]-1;
+					element_node_ids[3]=iomodel->numberofvertices+i;
+					for(int n=0;n<4;n++) nodes_approx[element_node_ids[n]] = FSvelocityEnum;
+					element_node_ids[4]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[3*i+0]-1;
+					element_node_ids[5]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[3*i+1]-1;
+					element_node_ids[6]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[3*i+2]-1;
+					for(int n=4;n<7;n++) nodes_approx[element_node_ids[n]] = FSpressureEnum;
+					break;
+				case TaylorHoodEnum: case XTaylorHoodEnum:
+					element_numnodes = 6+3;
+					element_node_ids[0]=iomodel->elements[3*i+0]-1;
+					element_node_ids[1]=iomodel->elements[3*i+1]-1;
+					element_node_ids[2]=iomodel->elements[3*i+2]-1;
+					element_node_ids[3]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*i+0];
+					element_node_ids[4]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*i+1];
+					element_node_ids[5]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*i+2];
+					for(int n=0;n<6;n++) nodes_approx[element_node_ids[n]] = FSvelocityEnum;
+					element_node_ids[6]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[3*i+0]-1;
+					element_node_ids[7]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[3*i+1]-1;
+					element_node_ids[8]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[3*i+2]-1;
+					for(int n=6;n<9;n++) nodes_approx[element_node_ids[n]] = FSpressureEnum;
+					break;
+				case LATaylorHoodEnum:
+					element_numnodes = 6;
+					element_node_ids[0]=iomodel->elements[3*i+0]-1;
+					element_node_ids[1]=iomodel->elements[3*i+1]-1;
+					element_node_ids[2]=iomodel->elements[3*i+2]-1;
+					element_node_ids[3]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*i+0];
+					element_node_ids[4]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*i+1];
+					element_node_ids[5]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*i+2];
+					for(int n=0;n<6;n++) nodes_approx[element_node_ids[n]] = FSvelocityEnum;
+					break;
+				case CrouzeixRaviartEnum:
+					element_numnodes = 7+3;
+					element_node_ids[0]=iomodel->elements[3*i+0]-1;
+					element_node_ids[1]=iomodel->elements[3*i+1]-1;
+					element_node_ids[2]=iomodel->elements[3*i+2]-1;
+					element_node_ids[3]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*i+0];
+					element_node_ids[4]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*i+1];
+					element_node_ids[5]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*i+2];
+					element_node_ids[6]=iomodel->numberofvertices+iomodel->numberofedges+i;
+					for(int n=0;n<7;n++) nodes_approx[element_node_ids[n]] = FSvelocityEnum;
+					element_node_ids[7]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofelements+3*i+0;
+					element_node_ids[8]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofelements+3*i+1;
+					element_node_ids[9]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofelements+3*i+2;
+					for(int n=7;n<10;n++) nodes_approx[element_node_ids[n]] = FSpressureEnum;
+					break;
+				case LACrouzeixRaviartEnum:
+					element_numnodes = 7;
+					element_node_ids[0]=iomodel->elements[3*i+0]-1;
+					element_node_ids[1]=iomodel->elements[3*i+1]-1;
+					element_node_ids[2]=iomodel->elements[3*i+2]-1;
+					element_node_ids[3]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*i+0];
+					element_node_ids[4]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*i+1];
+					element_node_ids[5]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*i+2];
+					element_node_ids[6]=iomodel->numberofvertices+iomodel->numberofedges+i;
+					for(int n=0;n<7;n++) nodes_approx[element_node_ids[n]] = FSvelocityEnum;
+					break;
+				default:
+					_error_("Finite element "<<EnumToStringx(finite_element)<<" not supported yet");
+			}
+		}
+		else if(iomodel->meshelementtype==PentaEnum){
+			switch(finite_element){
+				case P1Enum:
+					element_numnodes=6;
+					element_node_ids[0]=iomodel->elements[6*i+0]-1;
+					element_node_ids[1]=iomodel->elements[6*i+1]-1;
+					element_node_ids[2]=iomodel->elements[6*i+2]-1;
+					element_node_ids[3]=iomodel->elements[6*i+3]-1;
+					element_node_ids[4]=iomodel->elements[6*i+4]-1;
+					element_node_ids[5]=iomodel->elements[6*i+5]-1;
+					break;
+				case P1bubbleEnum: case P1bubblecondensedEnum:
+					element_numnodes=7;
+					element_node_ids[0]=iomodel->elements[6*i+0]-1;
+					element_node_ids[1]=iomodel->elements[6*i+1]-1;
+					element_node_ids[2]=iomodel->elements[6*i+2]-1;
+					element_node_ids[3]=iomodel->elements[6*i+3]-1;
+					element_node_ids[4]=iomodel->elements[6*i+4]-1;
+					element_node_ids[5]=iomodel->elements[6*i+5]-1;
+					element_node_ids[6]=iomodel->numberofvertices+i;
+					break;
+				case P1xP2Enum:
+					element_numnodes=9;
+					element_node_ids[0]=iomodel->elements[6*i+0]-1;
+					element_node_ids[1]=iomodel->elements[6*i+1]-1;
+					element_node_ids[2]=iomodel->elements[6*i+2]-1;
+					element_node_ids[3]=iomodel->elements[6*i+3]-1;
+					element_node_ids[4]=iomodel->elements[6*i+4]-1;
+					element_node_ids[5]=iomodel->elements[6*i+5]-1;
+					element_node_ids[6]=iomodel->numberofvertices+iomodel->elementtoverticaledgeconnectivity[3*i+0];
+					element_node_ids[7]=iomodel->numberofvertices+iomodel->elementtoverticaledgeconnectivity[3*i+1];
+					element_node_ids[8]=iomodel->numberofvertices+iomodel->elementtoverticaledgeconnectivity[3*i+2];
+					break;
+				case P1xP3Enum:
+					element_numnodes=12;
+					element_node_ids[ 0]=iomodel->elements[6*i+0]-1;
+					element_node_ids[ 1]=iomodel->elements[6*i+1]-1;
+					element_node_ids[ 2]=iomodel->elements[6*i+2]-1;
+					element_node_ids[ 3]=iomodel->elements[6*i+3]-1;
+					element_node_ids[ 4]=iomodel->elements[6*i+4]-1;
+					element_node_ids[ 5]=iomodel->elements[6*i+5]-1;
+					element_node_ids[ 6]=iomodel->numberofvertices+2*iomodel->elementtoverticaledgeconnectivity[3*i+0]+0;
+					element_node_ids[ 7]=iomodel->numberofvertices+2*iomodel->elementtoverticaledgeconnectivity[3*i+1]+0;
+					element_node_ids[ 8]=iomodel->numberofvertices+2*iomodel->elementtoverticaledgeconnectivity[3*i+2]+0;
+					element_node_ids[ 9]=iomodel->numberofvertices+2*iomodel->elementtoverticaledgeconnectivity[3*i+0]+1;
+					element_node_ids[10]=iomodel->numberofvertices+2*iomodel->elementtoverticaledgeconnectivity[3*i+1]+1;
+					element_node_ids[11]=iomodel->numberofvertices+2*iomodel->elementtoverticaledgeconnectivity[3*i+2]+1;
+					break;
+				case P1xP4Enum:
+					element_numnodes=15;
+					element_node_ids[ 0]=iomodel->elements[6*i+0]-1; /*Vertex 1*/
+					element_node_ids[ 1]=iomodel->elements[6*i+1]-1; /*Vertex 2*/
+					element_node_ids[ 2]=iomodel->elements[6*i+2]-1; /*Vertex 3*/
+					element_node_ids[ 3]=iomodel->elements[6*i+3]-1; /*Vertex 4*/
+					element_node_ids[ 4]=iomodel->elements[6*i+4]-1; /*Vertex 5*/
+					element_node_ids[ 5]=iomodel->elements[6*i+5]-1; /*Vertex 6*/
+					element_node_ids[ 6]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*i+0]+0; /*mid vertical edge 1*/
+					element_node_ids[ 7]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*i+1]+0; /*mid vertical edge 2*/
+					element_node_ids[ 8]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*i+2]+0; /*mid vertical edge 3*/
+					element_node_ids[ 9]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*i+0]+1; /* 1/4 vertical edge 1*/
+					element_node_ids[10]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*i+1]+1; /* 1/4 vertical edge 2*/
+					element_node_ids[11]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*i+2]+1; /* 1/4 vertical edge 3*/
+					element_node_ids[12]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*i+0]+2; /* 3/4 vertical edge 1*/
+					element_node_ids[13]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*i+1]+2; /* 3/4 vertical edge 2*/
+					element_node_ids[14]=iomodel->numberofvertices+3*iomodel->elementtoverticaledgeconnectivity[3*i+2]+2; /* 3/4 vertical edge 3*/
+					break;
+				case P2xP1Enum:
+					element_numnodes=12;
+					element_node_ids[ 0]=iomodel->elements[6*i+0]-1;
+					element_node_ids[ 1]=iomodel->elements[6*i+1]-1;
+					element_node_ids[ 2]=iomodel->elements[6*i+2]-1;
+					element_node_ids[ 3]=iomodel->elements[6*i+3]-1;
+					element_node_ids[ 4]=iomodel->elements[6*i+4]-1;
+					element_node_ids[ 5]=iomodel->elements[6*i+5]-1;
+					element_node_ids[ 6]=iomodel->numberofvertices+iomodel->elementtohorizontaledgeconnectivity[6*i+0];
+					element_node_ids[ 7]=iomodel->numberofvertices+iomodel->elementtohorizontaledgeconnectivity[6*i+1];
+					element_node_ids[ 8]=iomodel->numberofvertices+iomodel->elementtohorizontaledgeconnectivity[6*i+2];
+					element_node_ids[ 9]=iomodel->numberofvertices+iomodel->elementtohorizontaledgeconnectivity[6*i+3];
+					element_node_ids[10]=iomodel->numberofvertices+iomodel->elementtohorizontaledgeconnectivity[6*i+4];
+					element_node_ids[11]=iomodel->numberofvertices+iomodel->elementtohorizontaledgeconnectivity[6*i+5];
+					break;
+				case P2Enum:
+					element_numnodes = 18;
+					element_node_ids[ 0]=iomodel->elements[6*i+0]-1;
+					element_node_ids[ 1]=iomodel->elements[6*i+1]-1;
+					element_node_ids[ 2]=iomodel->elements[6*i+2]-1;
+					element_node_ids[ 3]=iomodel->elements[6*i+3]-1;
+					element_node_ids[ 4]=iomodel->elements[6*i+4]-1;
+					element_node_ids[ 5]=iomodel->elements[6*i+5]-1;
+					element_node_ids[ 6]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+0];
+					element_node_ids[ 7]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+1];
+					element_node_ids[ 8]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+2];
+					element_node_ids[ 9]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+3];
+					element_node_ids[10]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+4];
+					element_node_ids[11]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+5];
+					element_node_ids[12]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+6];
+					element_node_ids[13]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+7];
+					element_node_ids[14]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+8];
+					element_node_ids[15]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtoverticalfaceconnectivity[3*i+0];
+					element_node_ids[16]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtoverticalfaceconnectivity[3*i+1];
+					element_node_ids[17]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtoverticalfaceconnectivity[3*i+2];
+					break;
+				case P2xP4Enum:
+					element_numnodes = 30;
+					element_node_ids[ 0]=iomodel->elements[6*i+0]-1; /*Vertex 1*/
+					element_node_ids[ 1]=iomodel->elements[6*i+1]-1; /*Vertex 2*/
+					element_node_ids[ 2]=iomodel->elements[6*i+2]-1; /*Vertex 3*/
+					element_node_ids[ 3]=iomodel->elements[6*i+3]-1; /*Vertex 4*/
+					element_node_ids[ 4]=iomodel->elements[6*i+4]-1; /*Vertex 5*/
+					element_node_ids[ 5]=iomodel->elements[6*i+5]-1; /*Vertex 6*/
+					element_node_ids[ 6]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+0]; /*mid vertical edge 1*/
+					element_node_ids[ 7]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+1]; /*mid vertical edge 2*/
+					element_node_ids[ 8]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+2]; /*mid vertical edge 3*/
+					element_node_ids[ 9]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+3]; /*mid basal edge 1*/
+					element_node_ids[10]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+4]; /*mid basal edge 2*/
+					element_node_ids[11]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+5]; /*mid basal edge 3*/
+					element_node_ids[12]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+6]; /*mid top edge 1*/
+					element_node_ids[13]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+7]; /*mid top edge 2*/
+					element_node_ids[14]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+8]; /*mid top edge 3*/
+					element_node_ids[15]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*i+0]; /* 1/4 vertical edge 1*/
+					element_node_ids[16]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*i+1]; /* 1/4 vertical edge 2*/
+					element_node_ids[17]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*i+2]; /* 1/4 vertical edge 3*/
+					element_node_ids[18]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*i+0]+1; /* 3/4 vertical edge 1*/
+					element_node_ids[19]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*i+1]+1; /* 3/4 vertical edge 2*/
+					element_node_ids[20]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*i+2]+1; /* 3/4 vertical edge 3*/
+					element_node_ids[21]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+0]+0; /* 1/4 vertical face 1*/
+					element_node_ids[22]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+1]+0; /* 1/4 vertical face 2*/
+					element_node_ids[23]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+2]+0; /* 1/4 vertical face 3*/
+					element_node_ids[24]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+0]+1; /* 2/4 vertical face 1*/
+					element_node_ids[25]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+1]+1; /* 2/4 vertical face 2*/
+					element_node_ids[26]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+2]+1; /* 2/4 vertical face 3*/
+					element_node_ids[27]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+0]+2; /* 3/4 vertical face 1*/
+					element_node_ids[28]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+1]+2; /* 3/4 vertical face 2*/
+					element_node_ids[29]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+2]+2; /* 3/4 vertical face 3*/
+					break;
+				case MINIEnum: case MINIcondensedEnum:
+					element_numnodes = 7+6;
+					element_node_ids[ 0]=iomodel->elements[6*i+0]-1;
+					element_node_ids[ 1]=iomodel->elements[6*i+1]-1;
+					element_node_ids[ 2]=iomodel->elements[6*i+2]-1;
+					element_node_ids[ 3]=iomodel->elements[6*i+3]-1;
+					element_node_ids[ 4]=iomodel->elements[6*i+4]-1;
+					element_node_ids[ 5]=iomodel->elements[6*i+5]-1;
+					element_node_ids[ 6]=iomodel->numberofvertices+i;
+					if(!approximations) for(int n=0;n<7;n++) nodes_approx[element_node_ids[n]] = FSvelocityEnum;
+					element_node_ids[ 7]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*i+0]-1;
+					element_node_ids[ 8]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*i+1]-1;
+					element_node_ids[ 9]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*i+2]-1;
+					element_node_ids[10]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*i+3]-1;
+					element_node_ids[11]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*i+4]-1;
+					element_node_ids[12]=iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[6*i+5]-1;
+					if(!approximations) for(int n=7;n<13;n++) nodes_approx[element_node_ids[n]] = FSpressureEnum;
+					break;
+				case TaylorHoodEnum: case XTaylorHoodEnum:
+					element_numnodes = 18+6;
+					element_node_ids[ 0]=iomodel->elements[6*i+0]-1;
+					element_node_ids[ 1]=iomodel->elements[6*i+1]-1;
+					element_node_ids[ 2]=iomodel->elements[6*i+2]-1;
+					element_node_ids[ 3]=iomodel->elements[6*i+3]-1;
+					element_node_ids[ 4]=iomodel->elements[6*i+4]-1;
+					element_node_ids[ 5]=iomodel->elements[6*i+5]-1;
+					element_node_ids[ 6]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+0];
+					element_node_ids[ 7]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+1];
+					element_node_ids[ 8]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+2];
+					element_node_ids[ 9]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+3];
+					element_node_ids[10]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+4];
+					element_node_ids[11]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+5];
+					element_node_ids[12]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+6];
+					element_node_ids[13]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+7];
+					element_node_ids[14]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+8];
+					element_node_ids[15]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtoverticalfaceconnectivity[3*i+0];
+					element_node_ids[16]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtoverticalfaceconnectivity[3*i+1];
+					element_node_ids[17]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtoverticalfaceconnectivity[3*i+2];
+					for(int n=0;n<18;n++) nodes_approx[element_node_ids[n]] = FSvelocityEnum;
+					element_node_ids[18]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofverticalfaces+iomodel->elements[6*i+0]-1;
+					element_node_ids[19]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofverticalfaces+iomodel->elements[6*i+1]-1;
+					element_node_ids[20]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofverticalfaces+iomodel->elements[6*i+2]-1;
+					element_node_ids[21]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofverticalfaces+iomodel->elements[6*i+3]-1;
+					element_node_ids[22]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofverticalfaces+iomodel->elements[6*i+4]-1;
+					element_node_ids[23]=iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofverticalfaces+iomodel->elements[6*i+5]-1;
+					for(int n=18;n<24;n++) nodes_approx[element_node_ids[n]] = FSpressureEnum;
+					break;
+				case OneLayerP4zEnum:
+					element_numnodes = 30+6;
+					element_node_ids[ 0]=iomodel->elements[6*i+0]-1; /*Vertex 1*/
+					element_node_ids[ 1]=iomodel->elements[6*i+1]-1; /*Vertex 2*/
+					element_node_ids[ 2]=iomodel->elements[6*i+2]-1; /*Vertex 3*/
+					element_node_ids[ 3]=iomodel->elements[6*i+3]-1; /*Vertex 4*/
+					element_node_ids[ 4]=iomodel->elements[6*i+4]-1; /*Vertex 5*/
+					element_node_ids[ 5]=iomodel->elements[6*i+5]-1; /*Vertex 6*/
+					element_node_ids[ 6]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+0]; /*mid vertical edge 1*/
+					element_node_ids[ 7]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+1]; /*mid vertical edge 2*/
+					element_node_ids[ 8]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+2]; /*mid vertical edge 3*/
+					element_node_ids[ 9]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+3]; /*mid basal edge 1*/
+					element_node_ids[10]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+4]; /*mid basal edge 2*/
+					element_node_ids[11]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+5]; /*mid basal edge 3*/
+					element_node_ids[12]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+6]; /*mid top edge 1*/
+					element_node_ids[13]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+7]; /*mid top edge 2*/
+					element_node_ids[14]=iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*i+8]; /*mid top edge 3*/
+					element_node_ids[15]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*i+0]; /* 1/4 vertical edge 1*/
+					element_node_ids[16]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*i+1]; /* 1/4 vertical edge 2*/
+					element_node_ids[17]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*i+2]; /* 1/4 vertical edge 3*/
+					element_node_ids[18]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*i+0]+1; /* 3/4 vertical edge 1*/
+					element_node_ids[19]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*i+1]+1; /* 3/4 vertical edge 2*/
+					element_node_ids[20]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->elementtoverticaledgeconnectivity[3*i+2]+1; /* 3/4 vertical edge 3*/
+					element_node_ids[21]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+0]+0; /* 1/4 vertical face 1*/
+					element_node_ids[22]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+1]+0; /* 1/4 vertical face 2*/
+					element_node_ids[23]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+2]+0; /* 1/4 vertical face 3*/
+					element_node_ids[24]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+0]+1; /* 2/4 vertical face 1*/
+					element_node_ids[25]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+1]+1; /* 2/4 vertical face 2*/
+					element_node_ids[26]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+2]+1; /* 2/4 vertical face 3*/
+					element_node_ids[27]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+0]+2; /* 3/4 vertical face 1*/
+					element_node_ids[28]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+1]+2; /* 3/4 vertical face 2*/
+					element_node_ids[29]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->elementtoverticalfaceconnectivity[3*i+2]+2; /* 3/4 vertical face 3*/
+					for(int n=0;n<30;n++) nodes_approx[element_node_ids[n]] = FSvelocityEnum;
+					element_node_ids[30]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->numberofverticalfaces+iomodel->elements[6*i+0]-1;
+					element_node_ids[31]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->numberofverticalfaces+iomodel->elements[6*i+1]-1;
+					element_node_ids[32]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->numberofverticalfaces+iomodel->elements[6*i+2]-1;
+					element_node_ids[33]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->numberofverticalfaces+iomodel->elements[6*i+3]-1;
+					element_node_ids[34]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->numberofverticalfaces+iomodel->elements[6*i+4]-1;
+					element_node_ids[35]=iomodel->numberofvertices+iomodel->numberofedges+2*iomodel->numberofverticaledges+3*iomodel->numberofverticalfaces+iomodel->elements[6*i+5]-1;
+					for(int n=30;n<36;n++) nodes_approx[element_node_ids[n]] = FSpressureEnum;
+					break;
+				default:
+					_error_("Finite element "<<EnumToStringx(finite_element)<<" not supported yet");
+			}
+		}
+		else{
+			_error_("mesh elements "<< EnumToStringx(iomodel->meshelementtype) <<" not supported yet");
+		}
+
+		/*Add rank epart[i] for all nodes belonging to this element*/
+		for(int j=0;j<element_numnodes;j++){
+			int nid = element_node_ids[j]; _assert_(nid<numnodes);
+			AddNodeToRank(nodes_ranks,nodes_proc_count,nid,epart[i]);
+		}
+	}
+	/*}}}*/
+	if((finite_element==P0DGEnum || finite_element==P1DGEnum) && analysis!=UzawaPressureAnalysisEnum){/*Special case for DG...{{{*/
+		if(finite_element==P1DGEnum){
+			int node_list[4];
+			if(iomodel->domaintype!=Domain2DhorizontalEnum) _error_("not implemented yet");
+			CreateEdges(iomodel);
+			CreateFaces(iomodel);
+			for(int i=0;i<iomodel->numberoffaces;i++){
+				int e1=iomodel->faces[4*i+2]-1; //faces are [node1 node2 elem1 elem2]
+				int e2=iomodel->faces[4*i+3]-1; //faces are [node1 node2 elem1 elem2]
+				if(e2!=-2){
+					if(epart[e1]!=epart[e2]){
+						int i1=iomodel->faces[4*i+0];
+						int i2=iomodel->faces[4*i+1];
+						int pos=-1;
+						for(int j=0;j<3;j++) if(iomodel->elements[3*e2+j]==i1) pos=j;
+						if(     pos==0){ node_list[0] = e2*3+0; node_list[1] = e2*3+2;}
+						else if(pos==1){ node_list[0] = e2*3+1; node_list[1] = e2*3+0;}
+						else if(pos==2){ node_list[0] = e2*3+2; node_list[1] = e2*3+1;}
+						else _error_("not supposed to happen");
+						pos=-1;
+						for(int j=0;j<3;j++) if(iomodel->elements[3*e1+j]==i1) pos=j;
+						if(     pos==0){ node_list[2] = e1*3+0; node_list[3] = e1*3+1;}
+						else if(pos==1){ node_list[2] = e1*3+1; node_list[3] = e1*3+2;}
+						else if(pos==2){ node_list[2] = e1*3+2; node_list[3] = e1*3+0;}
+						else _error_("not supposed to happen");
+						for(int j=0;j<4;j++){
+							int  nid = node_list[j];
+							AddNodeToRank(nodes_ranks,nodes_proc_count,nid,epart[e1]);
+							AddNodeToRank(nodes_ranks,nodes_proc_count,nid,epart[e2]);
+						}
 					}
 				}
 			}
-			break;
-
-		case P1bubbleEnum:
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,approximation));
-				}
-			}
-			for(i=0;i<iomodel->numberofelements;i++){
-				if(iomodel->my_elements[i]){
-					nodes->AddObject(new Node(id0+iomodel->numberofvertices+i+1,iomodel->numberofvertices+i,lid++,0,iomodel,analysis,approximation));
-				}
-			}
-			break;
-
-		case P1bubblecondensedEnum:
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,approximation));
-				}
-			}
-			for(i=0;i<iomodel->numberofelements;i++){
-				if(iomodel->my_elements[i]){
-					node = new Node(id0+iomodel->numberofvertices+i+1,iomodel->numberofvertices+i,lid++,0,iomodel,analysis,approximation);
-					node->HardDeactivate();
-					nodes->AddObject(node);
-				}
-			}
-			break;
-
-		case P1xP2Enum:
-			EdgesPartitioning(iomodel);
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,approximation));
-				}
-			}
-
-			counter = iomodel->numberofvertices;
-			for(i=0;i<iomodel->numberofedges;i++){
-				if(iomodel->edges[i*3+2]==2){
-					if(iomodel->my_edges[i]){
-						node = new Node(id0+iomodel->numberofvertices+i+1,counter+1,lid++,0,iomodel,analysis,approximation);
-						nodes->AddObject(node);
-					}
-					counter++;
-				}
-			}
-			break;
-
-		case P1xP3Enum:
-			EdgesPartitioning(iomodel);
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,approximation));
-				}
-			}
-
-			counter = iomodel->numberofvertices;
-			for(i=0;i<iomodel->numberofedges;i++){
-				if(iomodel->edges[i*3+2]==2){
-					if(iomodel->my_edges[i]){
-						node = new Node(id0+iomodel->numberofvertices+2*i+1,counter+1,lid++,0,iomodel,analysis,approximation);
-						nodes->AddObject(node);
-						node = new Node(id0+iomodel->numberofvertices+2*i+2,counter+2,lid++,0,iomodel,analysis,approximation);
-						nodes->AddObject(node);
-					}
-					counter=counter+2;
-				}
-			}
-			break;
-		case P1xP4Enum:
-			EdgesPartitioning(iomodel);
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,approximation));
-				}
-			}
-			counter = iomodel->numberofvertices;
-			for(i=0;i<iomodel->numberofedges;i++){
-				if(iomodel->edges[i*3+2]==2){/*Vertical edges*/
-					if(iomodel->my_edges[i]){
-						node = new Node(id0+iomodel->numberofvertices+3*i+1,counter+1,lid++,0,iomodel,analysis,approximation);
-						nodes->AddObject(node);
-						node = new Node(id0+iomodel->numberofvertices+3*i+2,counter+2,lid++,0,iomodel,analysis,approximation);
-						nodes->AddObject(node);
-						node = new Node(id0+iomodel->numberofvertices+3*i+3,counter+3,lid++,0,iomodel,analysis,approximation);
-						nodes->AddObject(node);
-					}
-					counter=counter+3;
-				}
-			}
-			break;
-
-		case P2xP1Enum:
-			EdgesPartitioning(iomodel);
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,approximation));
-				}
-			}
-
-			counter = iomodel->numberofvertices;
-			for(i=0;i<iomodel->numberofedges;i++){
-				if(iomodel->edges[i*3+2]!=2){
-					if(iomodel->my_edges[i]){
-						node = new Node(id0+iomodel->numberofvertices+i+1,counter+1,lid++,0,iomodel,analysis,approximation);
-						nodes->AddObject(node);
-					}
-					counter++;
-				}
-			}
-			break;
-
-		case P2Enum:
-			EdgesPartitioning(iomodel);
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,approximation));
-				}
-			}
-			for(i=0;i<iomodel->numberofedges;i++){
-				if(iomodel->my_edges[i]){
-					nodes->AddObject(new Node(id0+iomodel->numberofvertices+i+1,iomodel->numberofvertices+i,lid++,0,iomodel,analysis,approximation));
-				}
-			}
-			id0 = id0+iomodel->numberofvertices+iomodel->numberofedges;
-	      if(iomodel->meshelementtype==PentaEnum){
-				FacesPartitioning(iomodel);
-				for(i=0;i<iomodel->numberoffaces;i++){
-					if(iomodel->faces[i*iomodel->facescols+2]==2){/*Vertical quads*/
-						if(iomodel->my_faces[i]){
-							node = new Node(id0+i+1,iomodel->numberofvertices+iomodel->numberofedges+i,lid++,0,iomodel,analysis,approximation);
-							nodes->AddObject(node);
-						}
-					}
-					else if(iomodel->faces[i*iomodel->facescols+2]==1){/*Triangular base/top*/
-						/*Nothing*/
-					}
-					else{
-						_error_("not supported");
+		}
+		else if(finite_element==P0DGEnum){
+			int node_list[2];
+			if(iomodel->domaintype!=Domain2DhorizontalEnum) _error_("not implemented yet");
+			CreateEdges(iomodel);
+			CreateFaces(iomodel);
+			for(int i=0;i<iomodel->numberoffaces;i++){
+				int e1=iomodel->faces[4*i+2]-1; //faces are [node1 node2 elem1 elem2]
+				int e2=iomodel->faces[4*i+3]-1; //faces are [node1 node2 elem1 elem2]
+				if(e2!=-2){
+					if(epart[e1]!=epart[e2]){
+						AddNodeToRank(nodes_ranks,nodes_proc_count,e2,epart[e1]);
+						//AddNodeToRank(nodes_ranks,nodes_proc_count,e1,epart[e2]);
 					}
 				}
 			}
-			break;
-		case P2bubbleEnum:
-			EdgesPartitioning(iomodel);
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,approximation));
+		}
+		else{
+			_error_("not supported");
+		}
+	}/*}}}*/
+	/*Vertex pairing for stressbalance{{{*/
+	if(!isamr && (analysis==StressbalanceAnalysisEnum || analysis==StressbalanceVerticalAnalysisEnum)){
+		int *vertex_pairing = NULL;
+		int  numvertex_pairing;
+		iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,"md.stressbalance.vertex_pairing");
+		_assert_(numvertex_pairing==0 || finite_element==P1Enum);
+		for(int i=0;i<numvertex_pairing;i++){
+			int nid1 = vertex_pairing[2*i+0]-1;
+			int nid2 = vertex_pairing[2*i+1]-1;
+			for(int j=0;j<nodes_proc_count[nid1];j++) AddNodeToRank(nodes_ranks,nodes_proc_count,nid2,nodes_ranks[MAXCONNECTIVITY*nid1+j]);
+			for(int j=0;j<nodes_proc_count[nid2];j++) AddNodeToRank(nodes_ranks,nodes_proc_count,nid1,nodes_ranks[MAXCONNECTIVITY*nid2+j]);
+		}
+		xDelete<int>(vertex_pairing);
+	}
+	if(!isamr && (analysis==MasstransportAnalysisEnum || analysis==FreeSurfaceBaseAnalysisEnum || analysis==FreeSurfaceTopAnalysisEnum)){
+		int *vertex_pairing = NULL;
+		int  numvertex_pairing;
+		iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,"md.masstransport.vertex_pairing");
+		_assert_(numvertex_pairing==0 || finite_element==P1Enum);
+		for(int i=0;i<numvertex_pairing;i++){
+			int nid1 = vertex_pairing[2*i+0]-1;
+			int nid2 = vertex_pairing[2*i+1]-1;
+			for(int j=0;j<nodes_proc_count[nid1];j++) AddNodeToRank(nodes_ranks,nodes_proc_count,nid2,nodes_ranks[MAXCONNECTIVITY*nid1+j]);
+			for(int j=0;j<nodes_proc_count[nid2];j++) AddNodeToRank(nodes_ranks,nodes_proc_count,nid1,nodes_ranks[MAXCONNECTIVITY*nid2+j]);
+		}
+		xDelete<int>(vertex_pairing);
+	}
+	/*}}}*/
+
+	/*Create vector of size total numnodes, initialized with -1, that will keep track of local ids*/
+	int  offset = 0;
+	int* nodes_offsets  = xNew<int>(numnodes);
+	for(int i=0;i<numnodes;i++){
+		if(IsNodeInRank(nodes_ranks,nodes_proc_count,i,my_rank)){
+			nodes_offsets[i] = offset++;
+		}
+		else{
+			nodes_offsets[i] = -1;
+		}
+	}
+
+	/*Now, Count how many clones we have with other partitions*/
+	int*  common_send = xNew<int>(num_procs);
+	int*  common_recv = xNew<int>(num_procs);
+	int** common_send_ids = xNew<int*>(num_procs);
+	int** common_recv_ids = xNew<int*>(num_procs);
+
+	/*First step: allocate, Step 2: populate*/
+	for(int step=0;step<2;step++){
+		if(step==1){
+			/*Allocate send and receive arrays of ids now*/
+			for(int i=0;i<num_procs;i++){
+				_assert_(common_send[i]>=0 && common_recv[i]>=0);
+				common_send_ids[i] = xNew<int>(common_send[i]);
+				common_recv_ids[i] = xNew<int>(common_recv[i]);
+			}
+		}
+		/*Re/Initialize counters to 0*/
+		for(int i=0;i<num_procs;i++){
+			common_recv[i]=0;
+			common_send[i]=0;
+		}
+		/*Go through table and find clones/masters etc*/
+		for(int i=0;i<numnodes;i++){
+			/*If we did not find this vertex in our current partition, go to next vertex*/
+			if(nodes_offsets[i] == -1) continue;
+			/*Find in what column this rank belongs*/
+			int col = -1;
+			for(int j=0;j<MAXCONNECTIVITY;j++){
+				if(nodes_ranks[MAXCONNECTIVITY*i+j] == my_rank){
+					col = j;
+					break;
 				}
 			}
-			for(i=0;i<iomodel->numberofedges;i++){
-				if(iomodel->my_edges[i]){
-					nodes->AddObject(new Node(id0+iomodel->numberofvertices+i+1,iomodel->numberofvertices+i,lid++,0,iomodel,analysis,approximation));
+			_assert_(col!=-1);
+
+			/*If col==0, it is either not on boundary, or a master*/
+			if(col==0){
+				/*1. is this vertex on the boundary? Skip if not*/
+				if(nodes_ranks[MAXCONNECTIVITY*i+col+1]==-1){
+					continue;
 				}
-			}
-			id0 = id0+iomodel->numberofvertices+iomodel->numberofedges;
-			if(iomodel->meshelementtype==PentaEnum){
-				FacesPartitioning(iomodel);
-				for(i=0;i<iomodel->numberoffaces;i++){
-					if(iomodel->faces[i*iomodel->facescols+2]==2){/*Vertical quads*/
-						if(iomodel->my_faces[i]){
-							node = new Node(id0+i+1,iomodel->numberofvertices+iomodel->numberofedges+i,lid++,0,iomodel,analysis,approximation);
-							nodes->AddObject(node);
+				else{
+					for(int j=1;j<nodes_proc_count[i];j++){
+						_assert_(nodes_ranks[MAXCONNECTIVITY*i+j]>=0);
+						int rank = nodes_ranks[MAXCONNECTIVITY*i+j];
+						if(step==1){
+							common_send_ids[rank][common_send[rank]] = nodes_offsets[i];
 						}
-					}
-					else if(iomodel->faces[i*iomodel->facescols+2]==1){/*Triangular base/top*/
-						/*Nothing*/
-					}
-					else{
-						_error_("not supported");
+						common_send[rank]++;
 					}
 				}
-				id0 = id0+iomodel->numberoffaces;
-			}
-			for(i=0;i<iomodel->numberofelements;i++){
-				if(iomodel->my_elements[i]){
-					nodes->AddObject(new Node(id0+i+1,id0-iomodel->nodecounter+i,lid++,0,iomodel,analysis,approximation));
+			}
+			else{
+				/*3. It is a slave, record that we need to receive for this cpu*/
+				int rank = nodes_ranks[MAXCONNECTIVITY*i+0];
+				if(step==1){
+					common_recv_ids[rank][common_recv[rank]] = nodes_offsets[i];
 				}
-			}
-			break;
-		case P2xP4Enum:
-			EdgesPartitioning(iomodel);
-			FacesPartitioning(iomodel);
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,approximation));
+				common_recv[rank]++;
+			}
+		}
+	}
+	xDelete<int>(nodes_proc_count);
+
+	/*Go ahead and create vertices now that we have all we need*/
+	for(int i=0;i<numnodes;i++){
+		if(nodes_offsets[i]!=-1){
+			bool isclone = (nodes_ranks[MAXCONNECTIVITY*i+0]!=my_rank);
+			int io_index = 0;
+			if(i<iomodel->numberofvertices) io_index = i;
+			Node* node=new Node(i+1,i,io_index,isclone,iomodel,analysis,nodes_approx[i],isamr);
+			if(finite_element==MINIcondensedEnum || finite_element==P1bubblecondensedEnum){
+				/*Bubble function is collapsed, needs to constrain it, maybe this is not the best place to do this, but that's life!*/
+				if(i>=iomodel->numberofvertices && i<iomodel->numberofvertices+iomodel->numberofelements){
+					node->HardDeactivate();
 				}
 			}
-			counter = iomodel->numberofvertices;
-			for(i=0;i<iomodel->numberofedges;i++){
-				if(iomodel->edges[i*3+2]==2){/*Vertical edges*/
-					if(iomodel->my_edges[i]){
-						node = new Node(id0+iomodel->numberofvertices+3*i+1,counter+1,lid++,0,iomodel,analysis,approximation);
-						nodes->AddObject(node);
-						node = new Node(id0+iomodel->numberofvertices+3*i+2,counter+2,lid++,0,iomodel,analysis,approximation);
-						nodes->AddObject(node);
-						node = new Node(id0+iomodel->numberofvertices+3*i+3,counter+3,lid++,0,iomodel,analysis,approximation);
-						nodes->AddObject(node);
-					}
-					counter=counter+3;
-				}
-				else if(iomodel->edges[i*3+2]==1){/*Horizontal edges*/
-					if(iomodel->my_edges[i]){
-						node = new Node(id0+iomodel->numberofvertices+3*i+1,counter+1,lid++,0,iomodel,analysis,approximation);
-						nodes->AddObject(node);
-					}
-					counter=counter+1;
-				}
-				else{
-					_error_("not supported");
-				}
-			}
-			id0 = id0+iomodel->numberofvertices+3*iomodel->numberofedges;
-			for(i=0;i<iomodel->numberoffaces;i++){
-				if(iomodel->faces[i*iomodel->facescols+2]==2){/*Vertical quads*/
-					if(iomodel->my_faces[i]){
-						node = new Node(id0+3*i+1,counter+1,lid++,0,iomodel,analysis,approximation);
-						nodes->AddObject(node);
-						node = new Node(id0+3*i+2,counter+2,lid++,0,iomodel,analysis,approximation);
-						nodes->AddObject(node);
-						node = new Node(id0+3*i+3,counter+3,lid++,0,iomodel,analysis,approximation);
-						nodes->AddObject(node);
-					}
-					counter=counter+3;
-				}
-				else if(iomodel->faces[i*iomodel->facescols+2]==1){/*Triangular base/top*/
-					/*Nothing*/
-				}
-				else{
-					_error_("not supported");
-				}
-			}
-			break;
-
-		/*Stokes elements*/
-		case P1P1Enum:
-			_assert_(approximation==FSApproximationEnum);
-			/*P1 velocity*/
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,FSvelocityEnum));
-				}
-			}
-			/*P1 pressure*/
-			vnodes = id0+iomodel->numberofvertices;
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(vnodes+i+1,iomodel->numberofvertices+i,lid++,i,iomodel,analysis,FSpressureEnum));
-				}
-			}
-			break;
-		case P1P1GLSEnum:
-			_assert_(approximation==FSApproximationEnum);
-			/*P1 velocity*/
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,FSvelocityEnum));
-				}
-			}
-			/*P1 pressure*/
-			vnodes = id0+iomodel->numberofvertices;
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(vnodes+i+1,iomodel->numberofvertices+i,lid++,i,iomodel,analysis,FSpressureEnum));
-				}
-			}
-			break;
-		case MINIcondensedEnum:
-			_assert_(approximation==FSApproximationEnum);
-			/*P1+ velocity (bubble statically condensed)*/
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,FSvelocityEnum));
-				}
-			}
-			for(i=0;i<iomodel->numberofelements;i++){
-				if(iomodel->my_elements[i]){
-					node = new Node(id0+iomodel->numberofvertices+i+1,iomodel->numberofvertices+i,lid++,0,iomodel,analysis,FSvelocityEnum);
-					node->HardDeactivate();
-					nodes->AddObject(node);
-				}
-			}
-			/*P1 pressure*/
-			vnodes = id0+iomodel->numberofvertices+iomodel->numberofelements;
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(vnodes+i+1,iomodel->numberofvertices+iomodel->numberofelements+i,lid++,i,iomodel,analysis,FSpressureEnum));
-				}
-			}
-			break;
-		case MINIEnum:
-			_assert_(approximation==FSApproximationEnum);
-			/*P1+ velocity*/
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,FSvelocityEnum));
-				}
-			}
-			for(i=0;i<iomodel->numberofelements;i++){
-				if(iomodel->my_elements[i]){
-					nodes->AddObject(new Node(id0+iomodel->numberofvertices+i+1,iomodel->numberofvertices+i,lid++,0,iomodel,analysis,FSvelocityEnum));
-				}
-			}
-			/*P1 pressure*/
-			vnodes = id0+iomodel->numberofvertices+iomodel->numberofelements;
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(vnodes+i+1,iomodel->numberofvertices+iomodel->numberofelements+i,lid++,i,iomodel,analysis,FSpressureEnum));
-				}
-			}
-			break;
-		case TaylorHoodEnum:
-		case XTaylorHoodEnum:
-			_assert_(approximation==FSApproximationEnum);
-			/*P2 velocity*/
-			EdgesPartitioning(iomodel);
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,FSvelocityEnum));
-				}
-			}
-			for(i=0;i<iomodel->numberofedges;i++){
-				if(iomodel->my_edges[i]){
-					nodes->AddObject(new Node(id0+iomodel->numberofvertices+i+1,iomodel->numberofvertices+i,lid++,0,iomodel,analysis,FSvelocityEnum));
-				}
-			}
-			id0 = id0+iomodel->numberofvertices+iomodel->numberofedges;
-	      if(iomodel->meshelementtype==PentaEnum){
-				FacesPartitioning(iomodel);
-				for(i=0;i<iomodel->numberoffaces;i++){
-					if(iomodel->faces[i*iomodel->facescols+2]==2){/*Vertical quads*/
-						if(iomodel->my_faces[i]){
-							node = new Node(id0+i+1,iomodel->numberofvertices+iomodel->numberofedges+i,lid++,0,iomodel,analysis,FSvelocityEnum);
-							nodes->AddObject(node);
-						}
-					}
-					else if(iomodel->faces[i*iomodel->facescols+2]==1){/*Triangular base/top*/
-						/*Nothing*/
-					}
-					else{
-						_error_("not supported");
-					}
-				}
-			}
-
-			/*P1 pressure*/
-	      if(iomodel->meshelementtype==PentaEnum){
-				numberoffaces=iomodel->numberoffaces;
-			}
-			else{
-				numberoffaces=0;
-			}
-			vnodes = id0+numberoffaces;
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(vnodes+i+1,iomodel->numberofvertices+iomodel->numberofedges+numberoffaces+i,lid++,i,iomodel,analysis,FSpressureEnum));
-				}
-			}
-			break;
-		case LATaylorHoodEnum:
-			_assert_(approximation==FSApproximationEnum);
-			/*P2 velocity*/
-			EdgesPartitioning(iomodel);
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,FSvelocityEnum));
-				}
-			}
-			for(i=0;i<iomodel->numberofedges;i++){
-				if(iomodel->my_edges[i]){
-					nodes->AddObject(new Node(id0+iomodel->numberofvertices+i+1,iomodel->numberofvertices+i,lid++,0,iomodel,analysis,FSvelocityEnum));
-				}
-			}
-			id0 = id0+iomodel->numberofvertices+iomodel->numberofedges;
-	      if(iomodel->meshelementtype==PentaEnum){
-				FacesPartitioning(iomodel);
-				for(i=0;i<iomodel->numberoffaces;i++){
-					if(iomodel->faces[i*iomodel->facescols+2]==2){/*Vertical quads*/
-						if(iomodel->my_faces[i]){
-							node = new Node(id0+i+1,iomodel->numberofvertices+iomodel->numberofedges+i,lid++,0,iomodel,analysis,FSvelocityEnum);
-							nodes->AddObject(node);
-						}
-					}
-					else if(iomodel->faces[i*iomodel->facescols+2]==1){/*Triangular base/top*/
-						/*Nothing*/
-					}
-					else{
-						_error_("not supported");
-					}
-				}
-			}
-
-			/*No pressure*/
-			break;
-		case OneLayerP4zEnum:
-			_assert_(approximation==FSApproximationEnum);
-			EdgesPartitioning(iomodel);
-			FacesPartitioning(iomodel);
-			/*P2xP4 velocity*/
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,FSvelocityEnum));
-				}
-			}
-			counter = iomodel->numberofvertices;
-			for(i=0;i<iomodel->numberofedges;i++){
-				if(iomodel->edges[i*3+2]==2){/*Vertical edges*/
-					if(iomodel->my_edges[i]){
-						node = new Node(id0+iomodel->numberofvertices+3*i+1,counter+1,lid++,0,iomodel,analysis,FSvelocityEnum);
-						nodes->AddObject(node);
-						node = new Node(id0+iomodel->numberofvertices+3*i+2,counter+2,lid++,0,iomodel,analysis,FSvelocityEnum);
-						nodes->AddObject(node);
-						node = new Node(id0+iomodel->numberofvertices+3*i+3,counter+3,lid++,0,iomodel,analysis,FSvelocityEnum);
-						nodes->AddObject(node);
-					}
-					counter=counter+3;
-				}
-				else if(iomodel->edges[i*3+2]==1){/*Horizontal edges*/
-					if(iomodel->my_edges[i]){
-						node = new Node(id0+iomodel->numberofvertices+3*i+1,counter+1,lid++,0,iomodel,analysis,FSvelocityEnum);
-						nodes->AddObject(node);
-					}
-					counter=counter+1;
-				}
-				else{
-					_error_("not supported");
-				}
-			}
-			id0 = id0+iomodel->numberofvertices+3*iomodel->numberofedges;
-			for(i=0;i<iomodel->numberoffaces;i++){
-				if(iomodel->faces[i*iomodel->facescols+2]==2){/*Vertical quads*/
-					if(iomodel->my_faces[i]){
-						node = new Node(id0+3*i+1,counter+1,lid++,0,iomodel,analysis,FSvelocityEnum);
-						nodes->AddObject(node);
-						node = new Node(id0+3*i+2,counter+2,lid++,0,iomodel,analysis,FSvelocityEnum);
-						nodes->AddObject(node);
-						node = new Node(id0+3*i+3,counter+3,lid++,0,iomodel,analysis,FSvelocityEnum);
-						nodes->AddObject(node);
-					}
-					counter=counter+3;
-				}
-				else if(iomodel->faces[i*iomodel->facescols+2]==1){/*Triangular base/top*/
-					/*Nothing*/
-				}
-				else{
-					_error_("not supported");
-				}
-			}
-
-			/*P1 pressure*/
-			vnodes = id0+3*iomodel->numberoffaces;
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(vnodes+i+1,counter+1,lid++,i,iomodel,analysis,FSpressureEnum));
-				}
-				counter++;
-			}
-			break;
-		case CrouzeixRaviartEnum:
-			_assert_(approximation==FSApproximationEnum);
-			/*P2b velocity*/
-			EdgesPartitioning(iomodel);
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,FSvelocityEnum));
-				}
-			}
-			for(i=0;i<iomodel->numberofedges;i++){
-				if(iomodel->my_edges[i]){
-					nodes->AddObject(new Node(id0+iomodel->numberofvertices+i+1,iomodel->numberofvertices+i,lid++,0,iomodel,analysis,FSvelocityEnum));
-				}
-			}
-			id0 = id0+iomodel->numberofvertices+iomodel->numberofedges;
-			if(iomodel->meshelementtype==PentaEnum){
-				FacesPartitioning(iomodel);
-				for(i=0;i<iomodel->numberoffaces;i++){
-					if(iomodel->faces[i*iomodel->facescols+2]==2){/*Vertical quads*/
-						if(iomodel->my_faces[i]){
-							node = new Node(id0+i+1,iomodel->numberofvertices+iomodel->numberofedges+i,lid++,0,iomodel,analysis,FSvelocityEnum);
-							nodes->AddObject(node);
-						}
-					}
-					else if(iomodel->faces[i*iomodel->facescols+2]==1){/*Triangular base/top*/
-						/*Nothing*/
-					}
-					else{
-						_error_("not supported");
-					}
-				}
-				id0 = id0+iomodel->numberoffaces;
-			}
-			for(i=0;i<iomodel->numberofelements;i++){
-				if(iomodel->my_elements[i]){
-					nodes->AddObject(new Node(id0+i+1,id0-iomodel->nodecounter+i,lid++,0,iomodel,analysis,FSvelocityEnum));
-				}
-			}
-
-			/*P1 DG pressure*/
-			vnodes = id0+iomodel->numberofelements;
-			switch(iomodel->meshelementtype){
-				case TriaEnum:  elementnbv = 3; break;
-				case TetraEnum: elementnbv = 4; break;
-				case PentaEnum: elementnbv = 6; break;
-				default:        _error_("mesh dimension not supported yet");
-			}
-			for(i=0;i<iomodel->numberofelements;i++){
-				if(iomodel->my_elements[i]){
-					for(j=0;j<elementnbv;j++){
-						nodes->AddObject(new Node(vnodes+elementnbv*i+j+1,vnodes-iomodel->nodecounter+elementnbv*i+j,lid++,iomodel->elements[+elementnbv*i+j]-1,iomodel,analysis,FSpressureEnum));
-
-					}
-				}
-			}
-			break;
-		case LACrouzeixRaviartEnum:
-			_assert_(approximation==FSApproximationEnum);
-			/*P2b velocity*/
-			EdgesPartitioning(iomodel);
-			for(i=0;i<iomodel->numberofvertices;i++){
-				if(iomodel->my_vertices[i]){
-					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,FSvelocityEnum));
-				}
-			}
-			for(i=0;i<iomodel->numberofedges;i++){
-				if(iomodel->my_edges[i]){
-					nodes->AddObject(new Node(id0+iomodel->numberofvertices+i+1,iomodel->numberofvertices+i,lid++,0,iomodel,analysis,FSvelocityEnum));
-				}
-			}
-			id0 = id0+iomodel->numberofvertices+iomodel->numberofedges;
-			if(iomodel->meshelementtype==PentaEnum){
-				FacesPartitioning(iomodel);
-				for(i=0;i<iomodel->numberoffaces;i++){
-					if(iomodel->faces[i*iomodel->facescols+2]==2){/*Vertical quads*/
-						if(iomodel->my_faces[i]){
-							node = new Node(id0+i+1,iomodel->numberofvertices+iomodel->numberofedges+i,lid++,0,iomodel,analysis,FSvelocityEnum);
-							nodes->AddObject(node);
-						}
-					}
-					else if(iomodel->faces[i*iomodel->facescols+2]==1){/*Triangular base/top*/
-						/*Nothing*/
-					}
-					else{
-						_error_("not supported");
-					}
-				}
-				id0 = id0+iomodel->numberoffaces;
-			}
-			for(i=0;i<iomodel->numberofelements;i++){
-				if(iomodel->my_elements[i]){
-					nodes->AddObject(new Node(id0+i+1,id0-iomodel->nodecounter+i,lid++,0,iomodel,analysis,FSvelocityEnum));
-				}
-			}
-
-			/*No pressure*/
-			break;
-
-		default:
-			_error_("Finite element "<<EnumToStringx(finite_element)<<" not supported yet");
-	}
-
-	/*Clean up*/
-	xDelete<bool>(my_nodes);
+			nodes->AddObject(node);
+		}
+	}
+
+	/*Free data: */
+	xDelete<int>(nodes_approx);
+	xDelete<int>(nodes_ranks);
+	xDelete<int>(nodes_offsets);
+
+	/*Assign communicators*/
+	nodes->common_send=common_send;
+	nodes->common_recv=common_recv;
+	nodes->common_send_ids=common_send_ids;
+	nodes->common_recv_ids=common_recv_ids;
+
+	/*Finalize Initialization*/
+	nodes->Finalize();
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp	(revision 24313)
@@ -14,5 +14,5 @@
 #include "./ModelProcessorx.h"
 
-void CreateNumberNodeToElementConnectivity(IoModel* iomodel,int solution_type){
+void CreateNumberNodeToElementConnectivity(IoModel* iomodel){
 
 	/*Intermediary*/
@@ -28,32 +28,25 @@
 
 	/*Some checks if debugging*/
-	if (solution_type==LoveSolutionEnum){
-		/*do nothing, we don't have a mesh. Just initialize to NULL*/
+	_assert_(iomodel->numberofvertices);
+	_assert_(iomodel->numberofelements);
+	_assert_(iomodel->elements);
+
+	/*Allocate ouput*/
+	connectivity=xNewZeroInit<int>(iomodel->numberofvertices);
+
+	/*Get element width*/
+	switch(iomodel->meshelementtype){
+		case TriaEnum:  elementswidth=3; break;
+		case TetraEnum: elementswidth=4; break;
+		case PentaEnum: elementswidth=6; break;
+		default:                   _error_("mesh not supported yet");
 	}
-	else{
 
-		/*Some checks if debugging*/
-		_assert_(iomodel->numberofvertices);
-		_assert_(iomodel->numberofelements);
-		_assert_(iomodel->elements);
-
-		/*Allocate ouput*/
-		connectivity=xNewZeroInit<int>(iomodel->numberofvertices);
-
-		/*Get element width*/
-		switch(iomodel->meshelementtype){
-			case TriaEnum:  elementswidth=3; break;
-			case TetraEnum: elementswidth=4; break;
-			case PentaEnum: elementswidth=6; break;
-			default:                   _error_("mesh not supported yet");
-		}
-
-		/*Create connectivity table*/
-		for (i=0;i<iomodel->numberofelements;i++){
-			for (j=0;j<elementswidth;j++){
-				vertexid=iomodel->elements[elementswidth*i+j];
-				_assert_(vertexid>0 && vertexid-1<iomodel->numberofvertices);
-				connectivity[vertexid-1]+=1;
-			}
+	/*Create connectivity table*/
+	for (i=0;i<iomodel->numberofelements;i++){
+		for (j=0;j<elementswidth;j++){
+			vertexid=iomodel->elements[elementswidth*i+j];
+			_assert_(vertexid>0 && vertexid-1<iomodel->numberofvertices);
+			connectivity[vertexid-1]+=1;
 		}
 	}
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp	(revision 24313)
@@ -18,5 +18,4 @@
 	/*Create output_definitions dataset: */
 	output_definitions=new DataSet();
-
 	char** out_strings = NULL;
 	iomodel->FetchData(&out_strings,&num_output_definitions,"md.outputdefinition.list");
@@ -27,5 +26,5 @@
 		}
 	}
-	// free data
+	// free data:
 	for(int i=0;i<num_output_definitions;i++) xDelete<char>(out_strings[i]);
 	xDelete<char*>(out_strings);
@@ -221,5 +220,5 @@
 				}
 
-				/*Free ressources:*/
+				  /*Free ressources:*/
 				for(j=0;j<num_cfsurfacesquares;j++){
 					char* string=NULL;
@@ -634,8 +633,27 @@
 				xDelete<int>(cost_functions_weights_N);
 				xDelete<IssmDouble*>(cost_functions_weights);
-			}
+			
 			/*}}}*/
+			}
+			else if (output_definition_enums[i]==RadarEnum){		
+				/*Deal with radar: {{{*/
+				int    numout;
+				char **radar_name_s             = NULL;
+				char **radar_definitionstring_s = NULL;
+				int  **radar_ice_period_s       = NULL;
+
+				/*Fetch name and definition, etc ... (see src/m/classes/radar.m): */
+				iomodel->FetchMultipleData(&radar_definitionstring_s,&numout,"md.radar.definitionstring");
+				iomodel->FetchMultipleData(&radar_name_s,&numout,"md.radar.name");
+				if(numout>1) _error_("not suppored yet"); 
+				/*Fetch necessary inputs for calculation*/
+				//iomodel->FetchDataToInput(elements,"md.ice_period",RadarIcePeriodEnum);
+
+				/*Add to output definitions*/
+				output_definitions->AddObject(new Radar(radar_name_s[0],StringToEnumx(radar_definitionstring_s[0])));
+				/*}}}*/ 
+			}
 		else _error_("output definition enum " << EnumToStringx(output_definition_enums[i]) << " not supported yet!");
-		}
+		}		
 	}
 	parameters->AddObject(new DataSetParam(OutputdefinitionEnum,output_definitions));
Index: /issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 24313)
@@ -19,6 +19,7 @@
 
 	int         i,j,m,k;
-	int         numoutputs,materialtype,smb_model,basalforcing_model,timestepping_type;
+	int         numoutputs,basalforcing_model,timestepping_type;
 	char**      requestedoutputs = NULL;
+	char**      outputonnodes = NULL;
 	char*       fieldname = NULL;
 	IssmDouble  time;
@@ -47,4 +48,5 @@
 	parameters->AddObject(iomodel->CopyConstantObject("md.mesh.domain_dimension",DomainDimensionEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.settings.output_frequency",SettingsOutputFrequencyEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.settings.sb_coupling_frequency",SettingsSbCouplingFrequencyEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.settings.recording_frequency",SettingsRecordingFrequencyEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.constants.yts",ConstantsYtsEnum));
@@ -53,5 +55,4 @@
 	parameters->AddObject(iomodel->CopyConstantObject("md.settings.waitonlock",SettingsWaitonlockEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.mesh.numberofvertices",MeshNumberofverticesEnum));
-	parameters->AddObject(iomodel->CopyConstantObject("md.settings.results_on_nodes",SettingsResultsOnNodesEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.settings.io_gather",SettingsIoGatherEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.settings.solver_residue_threshold",SettingsSolverResidueThresholdEnum));
@@ -61,4 +62,5 @@
 	parameters->AddObject(iomodel->CopyConstantObject("md.inversion.type",InversionTypeEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.calving.law",CalvingLawEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.frontalforcings.parameterization",FrontalForcingsParamEnum));
 	parameters->AddObject(new IntParam(SealevelriseRunCountEnum,1));  
 
@@ -164,4 +166,14 @@
 			}
 			xDelete<IssmDouble>(transparam);
+			iomodel->FetchData(&transparam,&N,&M,"md.basalforcings.upperwater_melting_rate"); 
+			if(N==1){
+				_assert_(M==1);
+				parameters->AddObject(new DoubleParam(BasalforcingsUpperwaterMeltingRateEnum,transparam[0]));
+			}
+			else{
+				_assert_(N==2);
+				parameters->AddObject(new TransientParam(BasalforcingsUpperwaterMeltingRateEnum,&transparam[0],&transparam[M],interp,M));
+			}
+			xDelete<IssmDouble>(transparam);
 			iomodel->FetchData(&transparam,&N,&M,"md.basalforcings.deepwater_elevation"); 
 			if(N==1){
@@ -208,18 +220,32 @@
 			break;
 		case BasalforcingsPicoEnum:
-				iomodel->FindConstant(&interp,"md.timestepping.interp_forcings");
-				parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.num_basins",BasalforcingsPicoNumBasinsEnum));
-				parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.maxboxcount",BasalforcingsPicoMaxboxcountEnum));
-				parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.overturning_coeff",BasalforcingsPicoOverturningCoeffEnum));
-				parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.gamma_T",BasalforcingsPicoGammaTEnum));
-				parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.isplume",BasalforcingsPicoIsplumeEnum));
-				iomodel->FetchData(&transparam,&M,&N,"md.basalforcings.farocean_temperature");
-				_assert_(M>=1 && N>=1); 
-				parameters->AddObject(new TransientArrayParam(BasalforcingsPicoFarOceantemperatureEnum,transparam,&transparam[N*(M-1)],interp,N,M));
-				xDelete<IssmDouble>(transparam);
-				iomodel->FetchData(&transparam,&M,&N,"md.basalforcings.farocean_salinity");
-				_assert_(M>=1 && N>=1); 
-				parameters->AddObject(new TransientArrayParam(BasalforcingsPicoFarOceansalinityEnum,transparam,&transparam[N*(M-1)],interp,N,M));
-				xDelete<IssmDouble>(transparam);
+			iomodel->FindConstant(&interp,"md.timestepping.interp_forcings");
+			parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.num_basins",BasalforcingsPicoNumBasinsEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.maxboxcount",BasalforcingsPicoMaxboxcountEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.overturning_coeff",BasalforcingsPicoOverturningCoeffEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.gamma_T",BasalforcingsPicoGammaTEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.isplume",BasalforcingsPicoIsplumeEnum));
+			iomodel->FetchData(&transparam,&M,&N,"md.basalforcings.farocean_temperature");
+			_assert_(M>=1 && N>=1); 
+			parameters->AddObject(new TransientArrayParam(BasalforcingsPicoFarOceantemperatureEnum,transparam,&transparam[N*(M-1)],interp,N,M));
+			xDelete<IssmDouble>(transparam);
+			iomodel->FetchData(&transparam,&M,&N,"md.basalforcings.farocean_salinity");
+			_assert_(M>=1 && N>=1); 
+			parameters->AddObject(new TransientArrayParam(BasalforcingsPicoFarOceansalinityEnum,transparam,&transparam[N*(M-1)],interp,N,M));
+			xDelete<IssmDouble>(transparam);
+			break;
+		case BasalforcingsIsmip6Enum:
+			parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.num_basins",BasalforcingsIsmip6NumBasinsEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.gamma_0",BasalforcingsIsmip6Gamma0Enum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.islocal",BasalforcingsIsmip6IsLocalEnum));	
+			iomodel->FetchData(&transparam,&M,&N,"md.basalforcings.delta_t");
+			parameters->AddObject(new DoubleVecParam(BasalforcingsIsmip6DeltaTEnum,transparam,N));
+			xDelete<IssmDouble>(transparam);
+			iomodel->FetchData(&transparam,&M,&N,"md.basalforcings.tf_depths");
+			parameters->AddObject(new DoubleVecParam(BasalforcingsIsmip6TfDepthsEnum,transparam,N));
+			xDelete<IssmDouble>(transparam);
+			break;
+		case BeckmannGoosseFloatingMeltRateEnum:
+			parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.meltrate_factor",BasalforcingsMeltrateFactorEnum));
 			break;
 		default:
@@ -260,4 +286,10 @@
 	parameters->AddObject(new BoolParam(SaveResultsEnum,true));
 
+	/*Should we output results on nodes?*/
+	iomodel->FindConstant(&outputonnodes,&numoutputs,"md.settings.results_on_nodes");
+	parameters->AddObject(new IntParam(SettingsNumResultsOnNodesEnum,numoutputs));
+	if(numoutputs)parameters->AddObject(new StringArrayParam(SettingsResultsOnNodesEnum,outputonnodes,numoutputs));
+	iomodel->DeleteData(&outputonnodes,numoutputs,"md.settings.results_on_nodes");
+
 	/*Requested outputs */
 	iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.transient.requested_outputs");
@@ -271,9 +303,163 @@
 	iomodel->DeleteData(&requestedoutputs,numoutputs,"md.steadystate.requested_outputs");
 
-	iomodel->FindConstant(&materialtype,"md.materials.type");
-	if(materialtype==MatdamageiceEnum || materialtype==MaticeEnum || materialtype==MatenhancediceEnum){
-		parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_ice",MaterialsRhoIceEnum));
-	}
-	if(materialtype==MatdamageiceEnum){
+	int materialstype;
+	iomodel->FindConstant(&materialstype,"md.materials.type");
+
+	switch(materialstype){
+		case MaticeEnum:
+		case MatdamageiceEnum:
+		case MatenhancediceEnum:
+		case MatestarEnum:
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_ice",MaterialsRhoIceEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_water",MaterialsRhoSeawaterEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_freshwater",MaterialsRhoFreshwaterEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.mu_water",MaterialsMuWaterEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.heatcapacity",MaterialsHeatcapacityEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.thermalconductivity",MaterialsThermalconductivityEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.temperateiceconductivity",MaterialsTemperateiceconductivityEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.effectiveconductivity_averaging",MaterialsEffectiveconductivityAveragingEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.latentheat",MaterialsLatentheatEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.beta",MaterialsBetaEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.meltingpoint",MaterialsMeltingpointEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.constants.referencetemperature",ConstantsReferencetemperatureEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.mixed_layer_capacity",MaterialsMixedLayerCapacityEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.thermal_exchange_velocity",MaterialsThermalExchangeVelocityEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.constants.g",ConstantsGEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.rheology_law",MaterialsRheologyLawEnum));
+
+			/*gia: */
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.lithosphere_shear_modulus",MaterialsLithosphereShearModulusEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.lithosphere_density",MaterialsLithosphereDensityEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.mantle_shear_modulus",MaterialsMantleShearModulusEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.mantle_density",MaterialsMantleDensityEnum));
+
+			/*slr:*/
+			parameters->AddObject(iomodel->CopyConstantObject("md.materials.earth_density",MaterialsEarthDensityEnum));
+			break;
+		case MaterialsEnum:{
+			int nnat,dummy;
+			int* nature=NULL;
+			iomodel->FetchData(&nature,&nnat,&dummy,"md.materials.nature");
+			for(int i=0;i<nnat;i++){
+				switch(IoCodeToEnumMaterials(nature[i])){
+					case MatlithoEnum:
+						break;
+					case MaticeEnum:
+					case MatdamageiceEnum:
+					case MatenhancediceEnum:
+					case MatestarEnum:
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_ice",MaterialsRhoIceEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_water",MaterialsRhoSeawaterEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.rho_freshwater",MaterialsRhoFreshwaterEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.mu_water",MaterialsMuWaterEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.heatcapacity",MaterialsHeatcapacityEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.thermalconductivity",MaterialsThermalconductivityEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.temperateiceconductivity",MaterialsTemperateiceconductivityEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.effectiveconductivity_averaging",MaterialsEffectiveconductivityAveragingEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.latentheat",MaterialsLatentheatEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.beta",MaterialsBetaEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.meltingpoint",MaterialsMeltingpointEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.constants.referencetemperature",ConstantsReferencetemperatureEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.mixed_layer_capacity",MaterialsMixedLayerCapacityEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.thermal_exchange_velocity",MaterialsThermalExchangeVelocityEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.constants.g",ConstantsGEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.rheology_law",MaterialsRheologyLawEnum));
+
+						/*gia: */
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.lithosphere_shear_modulus",MaterialsLithosphereShearModulusEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.lithosphere_density",MaterialsLithosphereDensityEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.mantle_shear_modulus",MaterialsMantleShearModulusEnum));
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.mantle_density",MaterialsMantleDensityEnum));
+
+						/*slr:*/
+						parameters->AddObject(iomodel->CopyConstantObject("md.materials.earth_density",MaterialsEarthDensityEnum));
+						break;
+				}
+			}
+			break;
+
+	}
+		default:
+			_error_("Material "<< EnumToStringx(materialstype) <<" not supported yet");
+	}
+
+	int smb_model;
+	iomodel->FindConstant(&smb_model,"md.smb.model");
+	switch(smb_model){
+		case SMBforcingEnum:
+		case SMBgradientsEnum:
+		case SMBgradientselaEnum:
+		case SMBhenningEnum:
+		case SMBcomponentsEnum:
+		case SMBmeltcomponentsEnum:
+		case SMBgradientscomponentsEnum:
+			/*Nothing to add*/
+			break;
+		case SMBgembEnum:
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.aIce",SmbAIceEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.aSnow",SmbASnowEnum));
+			break;
+		case SMBpddEnum:
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.desfac",SmbDesfacEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.rlaps",SmbRlapsEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.rlapslgm",SmbRlapslgmEnum));
+			break;
+		case SMBpddSicopolisEnum:
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.desfac",SmbDesfacEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.rlaps",SmbRlapsEnum));
+			break;
+		case SMBd18opddEnum:
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.desfac",SmbDesfacEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.rlaps",SmbRlapsEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.rlapslgm",SmbRlapslgmEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.dpermil",SmbDpermilEnum));
+			break;
+		case SMBsemicEnum:
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.desfac",SmbDesfacEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.rlaps",SmbRlapsEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.smb.rdl",SmbRdlEnum));
+			break;
+		default:
+			_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
+	}
+
+	int hydrology_model;
+	iomodel->FindConstant(&hydrology_model,"md.hydrology.model");
+	if(hydrology_model==HydrologydcEnum){
+		/*FIXME: this cshould go to Analysis!!!*/
+		parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.sediment_compressibility",HydrologydcSedimentCompressibilityEnum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.sediment_porosity",HydrologydcSedimentPorosityEnum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.sediment_thickness",HydrologydcSedimentThicknessEnum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.water_compressibility",HydrologydcWaterCompressibilityEnum));
+		parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.isefficientlayer",HydrologydcIsefficientlayerEnum));
+
+		bool isefficientlayer;
+		iomodel->FindConstant(&isefficientlayer,"md.hydrology.isefficientlayer");
+		if(isefficientlayer){
+			parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.epl_compressibility",HydrologydcEplCompressibilityEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.epl_porosity",HydrologydcEplPorosityEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.epl_initial_thickness",HydrologydcEplInitialThicknessEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.epl_colapse_thickness",HydrologydcEplColapseThicknessEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.epl_max_thickness",HydrologydcEplMaxThicknessEnum));
+			parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.epl_conductivity",HydrologydcEplConductivityEnum));
+		}
+	}
+	else if(hydrology_model==HydrologyshreveEnum){
+		/*Nothing to add*/
+	}
+	else if(hydrology_model==HydrologyshaktiEnum){
+		/*Nothing to add*/
+	}
+	else if(hydrology_model==HydrologypismEnum){
+		/*Nothing to add*/
+	}
+	else if(hydrology_model==HydrologyGlaDSEnum){
+		/*Nothing to add*/
+	}
+	else{
+		_error_("Hydrology model "<<EnumToStringx(hydrology_model)<<" not supported yet");
+	}
+
+	if(materialstype==MatdamageiceEnum){
 		iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.damage.requested_outputs");
 		parameters->AddObject(new IntParam(DamageEvolutionNumRequestedOutputsEnum,numoutputs));
@@ -344,24 +530,4 @@
 	/*}}}*/
 
-	/*Fourier love parameters (FIXME: should be in an analysis...*/
-	if(solution_type==LoveSolutionEnum){
-		IssmDouble* frequencies = NULL;
-		int         nfreq;
-		iomodel->FetchData(&nfreq,"md.love.nfreq");
-		iomodel->FetchData(&frequencies,NULL,NULL,"md.love.frequencies");
-		parameters->AddObject(new DoubleVecParam(LoveFrequenciesEnum,frequencies,nfreq));
-		xDelete<IssmDouble>(frequencies);
-
-		parameters->AddObject(iomodel->CopyConstantObject("md.love.nfreq",LoveNfreqEnum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.love.sh_nmax",LoveShNmaxEnum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.love.sh_nmin",LoveShNminEnum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.love.g0",LoveG0Enum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.love.r0",LoveR0Enum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.love.mu0",LoveMu0Enum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.love.allow_layer_deletion",LoveAllowLayerDeletionEnum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.love.love_kernels",LoveKernelsEnum));
-		parameters->AddObject(iomodel->CopyConstantObject("md.love.forcing_type",LoveForcingTypeEnum));
-	}
-
 	/*Before returning, create parameters in case we are running Qmu or control types runs: */
 	CreateParametersControl(parameters,iomodel,solution_type);
@@ -378,5 +544,4 @@
 	CreateParametersAutodiff(parameters,iomodel);
 	if(VerboseMProcessor()) _printf0_("   ending autodiff parameters \n");
-
 	#endif
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp	(revision 24313)
@@ -13,6 +13,7 @@
 	/*variable declarations*/
 	int          i;
-	int         *part                   = NULL;
-	double      *dpart                  = NULL;
+	double      *vpart                  = NULL;
+	double      *epart                  = NULL;
+	int          npart;
 	char       **responsedescriptors    = NULL;
 	int          numresponsedescriptors;
@@ -65,16 +66,11 @@
 		parameters->AddObject(new StringArrayParam(QmuResponsedescriptorsEnum,responsedescriptors,numresponsedescriptors));
 
-		/*Deal with partitioning*/
-		/*partition vertices in iomodel->qmu_npart parts, unless a partition is already present: */
+		/*Load partitioning vectors (both vertex and element based: */
 		parameters->AddObject(iomodel->CopyConstantObject("md.qmu.numberofpartitions",QmuNumberofpartitionsEnum));
-		iomodel->FetchData(&dpart,NULL,NULL,"md.qmu.partition");
-		if(!dpart){
-			/*Partition elements and vertices and nodes: */
-			ElementsAndVerticesPartitioning(&iomodel->my_elements,&iomodel->my_vertices,iomodel);
-
-			dpart=xNew<double>(iomodel->numberofvertices);
-			for(i=0;i<iomodel->numberofvertices;i++)dpart[i]=iomodel->my_vertices[i];
-		}
-		parameters->AddObject(new DoubleVecParam(QmuPartitionEnum,dpart,iomodel->numberofvertices));
+		iomodel->FetchData(&vpart,&npart,NULL,"md.qmu.vpartition"); if(!vpart) _error_("md.qmu.vpartition is empty");
+		parameters->AddObject(new DoubleVecParam(QmuVpartitionEnum,vpart,npart));
+		
+		iomodel->FetchData(&epart,&npart,NULL,"md.qmu.epartition"); if(!epart) _error_("md.qmu.epartition is empty");
+		parameters->AddObject(new DoubleVecParam(QmuEpartitionEnum,epart,npart));
 
 		/*Deal with data needed because of qmu variables*/
@@ -116,6 +112,6 @@
 		}
 		xDelete<char*>(variabledescriptors);
-		xDelete<int>(part);
-		xDelete<double>(dpart);
+		xDelete<double>(vpart);
+		xDelete<double>(epart);
 		xDelete<char>(qmuinname);
 		xDelete<char>(qmuerrname);
Index: /issm/trunk/src/c/modules/ModelProcessorx/EdgesPartitioning.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/EdgesPartitioning.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ModelProcessorx/EdgesPartitioning.cpp	(revision 24313)
@@ -27,5 +27,5 @@
 
 	/*output: */
-	iomodel->my_edges=xNewZeroInit<bool>(iomodel->numberofedges);
+	iomodel->my_edges  = xNewZeroInit<bool>(iomodel->numberofedges);
 
 	for(int i=0;i<iomodel->numberofelements;i++){
@@ -36,3 +36,14 @@
 		}
 	}
+
+	if(iomodel->meshelementtype==PentaEnum){
+		iomodel->my_vedges = xNewZeroInit<bool>(iomodel->numberofverticaledges);
+		iomodel->my_hedges = xNewZeroInit<bool>(iomodel->numberofhorizontaledges);
+		for(int i=0;i<iomodel->numberofelements;i++){
+			if(iomodel->my_elements[i]){
+				for(int j=0;j<3;j++) iomodel->my_vedges[iomodel->elementtoverticaledgeconnectivity[i*3+j]]   = true;
+				for(int j=0;j<6;j++) iomodel->my_hedges[iomodel->elementtohorizontaledgeconnectivity[i*6+j]] = true;
+			}
+		}
+	}
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp	(revision 24313)
@@ -15,27 +15,15 @@
 #include "../ModelProcessorx/ModelProcessorx.h"
 
-void  ElementsAndVerticesPartitioning(bool** pmy_elements, int** pmy_vertices, IoModel* iomodel){
+void  ElementsAndVerticesPartitioning(IoModel* iomodel){
 
-	int i,j;
-
-	const int RIFTINFOSIZE = 12;
 	int numberofelements2d;
 	int numberofvertices2d;
 	int numlayers;
-	int numrifts;
-	int numvertex_pairing;
-
-	/*output: */
-	bool *my_elements = NULL;
-	int  *my_vertices = NULL;
 
 	/*intermediary: */
-	int        *epart          = NULL; //element partitioning.
-	int        *npart          = NULL; //node partitioning.
-	int         elements_width;        //number of columns in elements (2d->3, 3d->6)
-	int         el1,el2;
-	int        *elements2d     = NULL;
-	int        *vertex_pairing = NULL;
-	IssmDouble *riftinfo       = NULL;
+	int *epart          = NULL; //element partitioning.
+	int *npart          = NULL; //node partitioning.
+	int  elements_width;        //number of columns in elements (2d->3, 3d->6)
+	int *elements2d     = NULL;
 
 	/*Get my_rank:*/
@@ -43,9 +31,6 @@
 	int num_procs = IssmComm::GetSize();
 
-	/*Fetch parameters: */
-	iomodel->FindConstant(&numrifts,"md.rifts.numrifts");
-
 	/*First, check that partitioning has not yet been carryed out. Just check whether my_elements pointers is not already assigned a value: */
-	if(*pmy_elements)return;
+	if(iomodel->my_elements) return;
 
 	/*Number of vertices per elements, needed to correctly retrieve data: */
@@ -75,15 +60,19 @@
 	}
 
+	/*Partition and free resouces*/
 	MeshPartitionx(&epart,&npart,iomodel->numberofelements,iomodel->numberofvertices,iomodel->elements,numberofelements2d,numberofvertices2d,elements2d,numlayers,elements_width,iomodel->meshelementtype,num_procs);
-
-	/*Free elements2d: */
 	xDelete<int>(elements2d);
+	xDelete<int>(npart);
 
 	/*Deal with rifts, they have to be included into one partition only, not several: */
+	int numrifts;
+	iomodel->FindConstant(&numrifts,"md.rifts.numrifts");
 	if(numrifts){
+		IssmDouble *riftinfo = NULL;
 		iomodel->FetchData(&riftinfo,&numrifts,NULL,"md.rifts.riftstruct");
-		for(i=0;i<numrifts;i++){
-			el1=reCast<int>(*(riftinfo+RIFTINFOSIZE*i+2))-1; //matlab indexing to c indexing
-			el2=reCast<int>(*(riftinfo+RIFTINFOSIZE*i+3))-1; //matlab indexing to c indexing
+		for(int i=0;i<numrifts;i++){
+			const int RIFTINFOSIZE = 12;
+			int el1=reCast<int>(*(riftinfo+RIFTINFOSIZE*i+2))-1; //matlab indexing to c indexing
+			int el2=reCast<int>(*(riftinfo+RIFTINFOSIZE*i+3))-1; //matlab indexing to c indexing
 			epart[el2]=epart[el1]; //ensures that this pair of elements will be in the same partition, as well as the corresponding vertices;
 		}
@@ -91,48 +80,16 @@
 	}
 
-	/*Used later on: */
-	my_vertices=xNewZeroInit<int>(iomodel->numberofvertices);
-	my_elements=xNewZeroInit<bool>(iomodel->numberofelements);
+	/*Create my_elements, used by each partition */
+	bool *my_elements = xNewZeroInit<bool>(iomodel->numberofelements);
 
 	/*Start figuring out, out of the partition, which elements belong to this cpu: */
-	for(i=0;i<iomodel->numberofelements;i++){
+	for(int i=0;i<iomodel->numberofelements;i++){
 
 		/*!All elements have been partitioned above, only deal with elements for this cpu: */
-		if(my_rank==epart[i]){ 
-			my_elements[i]=true;
-			/*Now that we are here, we can also start building the list of vertices belonging to this cpu partition: we use 
-			 *the  element index to do this. For each element n, we know index[n][0:2] holds the indices (matlab indexing) 
-			 into the vertices coordinates. If we start plugging 1 into my_vertices for each index[n][i] (i=0:2), then my_vertices 
-			 will hold which vertices belong to this partition*/
-			for(j=0;j<elements_width;j++){
-				my_vertices[iomodel->elements[elements_width*i+j]-1]=1;
-			}
-		}
+		if(my_rank==epart[i]) my_elements[i]=true;
 	}
 
-	/*We might have vertex_pairing in which case, some vertices have to be cloned:
-	 * penpair has 2 nodes that are poointing toward 2 vertices.
-	 * The 2 vertices must be in the same cpu as the penpair*/
-	iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,"md.stressbalance.vertex_pairing");
-	for(i=0;i<numvertex_pairing;i++){
-		if(my_vertices[vertex_pairing[2*i+0]-1] && !my_vertices[vertex_pairing[2*i+1]-1]){
-			my_vertices[vertex_pairing[2*i+1]-1]=2; //to know that these elements are not on the partition
-		}
-	}
-	xDelete<int>(vertex_pairing);
-	iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,"md.masstransport.vertex_pairing");
-	for(i=0;i<numvertex_pairing;i++){
-		if(my_vertices[vertex_pairing[2*i+0]-1] && !my_vertices[vertex_pairing[2*i+1]-1]){
-			my_vertices[vertex_pairing[2*i+1]-1]=2; //to know that these elements are not on the partition
-		}
-	}
-	xDelete<int>(vertex_pairing);
-
-	/*Free ressources:*/
-	xDelete<int>(npart);
-	xDelete<int>(epart);
-
-	/*Assign output pointers:*/
-	*pmy_elements=my_elements;
-	*pmy_vertices=my_vertices;
+	/*Assign pointers to iomodel*/
+	iomodel->epart      =epart;
+	iomodel->my_elements=my_elements;
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/FacesPartitioning.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/FacesPartitioning.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ModelProcessorx/FacesPartitioning.cpp	(revision 24313)
@@ -43,3 +43,15 @@
 		}
 	}
+
+	if(iomodel->meshelementtype==PentaEnum){
+		iomodel->my_vfaces = xNewZeroInit<bool>(iomodel->numberofverticalfaces);
+		for(int i=0;i<iomodel->numberofelements;i++){
+			if(iomodel->my_elements[i]){
+				for(int j=0;j<3;j++){
+					_assert_(iomodel->elementtoverticalfaceconnectivity[i*3+j]<iomodel->numberofverticalfaces);
+					iomodel->my_vfaces[iomodel->elementtoverticalfaceconnectivity[i*3+j]] = true;
+				}
+			}
+		}
+	}
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	(revision 24313)
@@ -13,18 +13,9 @@
 #include "./ModelProcessorx.h"
 
-void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads, Parameters** pparameters,IoModel* iomodel,FILE* toolkitfile, char* rootpath,const int solution_enum,const int nummodels,const int* analysis_enum_list){
+void ModelProcessorx(Elements** pelements, Nodes*** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints*** pconstraints, Loads*** ploads, Parameters** pparameters,IoModel* iomodel,FILE* toolkitfile, char* rootpath,const int solution_enum,const int nummodels,const int* analysis_enum_list){
+	_assert_(nummodels>0);
 
-	int   i,analysis_enum,verbose;
-
-	/*Initialize datasets*/
-	Elements    *elements    = new Elements();
-	Nodes       *nodes       = new Nodes();
-	Vertices    *vertices    = new Vertices();
-	Materials   *materials   = new Materials();
-	Constraints *constraints = new Constraints();
-	Loads       *loads       = new Loads();
-	Parameters  *parameters  = new Parameters();
-
-	/*Fetch parameters: */
+	/*Set Verbosity once for all*/
+	int verbose;
 	iomodel->FindConstant(&verbose,"md.verbose");
 	SetVerbosityLevel(verbose);
@@ -32,16 +23,29 @@
 	if(VerboseMProcessor()) _printf0_("   starting model processor \n");
 
+	/*Initialize datasets*/
+	Elements    *elements     = new Elements();
+	Vertices    *vertices     = new Vertices();
+	Materials   *materials    = new Materials();
+	Parameters  *parameters   = new Parameters();
+	Constraints **constraints = xNew<Constraints*>(nummodels);
+	Loads       **loads       = xNew<Loads*>(nummodels);
+	Nodes       **nodes       = xNew<Nodes*>(nummodels);
+	for(int i = 0;i<nummodels;i++) constraints[i] = new Constraints();
+	for(int i = 0;i<nummodels;i++) loads[i]       = new Loads();
+	for(int i = 0;i<nummodels;i++) nodes[i]       = new Nodes();
+
 	/*Partition Elements and Nodes*/
-	ElementsAndVerticesPartitioning(&iomodel->my_elements,&iomodel->my_vertices,iomodel);
+	ElementsAndVerticesPartitioning(iomodel);
 
 	/*Create elements, vertices and materials, independent of analysis_enum: */
-	CreateElementsVerticesAndMaterials(elements,vertices,materials,iomodel,nummodels,solution_enum);
-
-	/*Create Parameters*/
+	CreateElements(elements,iomodel,nummodels);
+	CreateMaterials(elements,materials,iomodel,nummodels);
+	CreateVertices(elements,vertices,iomodel,solution_enum);
 	CreateParameters(parameters,iomodel,rootpath,toolkitfile,solution_enum);
 
-	for(i=0;i<nummodels;i++){
+	/*Update datasets based on each analysis (and add nodes, constrains and loads)*/
+	for(int i=0;i<nummodels;i++){
 
-		analysis_enum=analysis_enum_list[i];
+		int analysis_enum=analysis_enum_list[i];
 		parameters->AddObject(new IntParam(AnalysisCounterEnum,i));
 
@@ -49,19 +53,14 @@
 		Analysis* analysis = EnumToAnalysis(analysis_enum);
 		analysis->UpdateParameters(parameters,iomodel,solution_enum,analysis_enum);
-		analysis->CreateNodes(nodes,iomodel);
-		analysis->CreateConstraints(constraints,iomodel);
-		analysis->CreateLoads(loads,iomodel);
+		analysis->CreateNodes(nodes[i],iomodel);
 		analysis->UpdateElements(elements,iomodel,i,analysis_enum);
+		analysis->CreateConstraints(constraints[i],iomodel);
+		analysis->CreateLoads(loads[i],iomodel);
 		delete analysis;
 
-		/* Update counters, because we have created more nodes, loads and
-		 * constraints, and ids for objects created in next call to CreateDataSets
-		 * will need to start at the end of the updated counters: */
-		if(nodes->Size()) iomodel->nodecounter = nodes->MaximumId();
-		iomodel->loadcounter       = loads->NumberOfLoads();
-		iomodel->constraintcounter = constraints->NumberOfConstraints();
-
-		/*Make sure nodecounter is at least 0 (if no node exists, maxid will be -1*/
-		_assert_(iomodel->nodecounter>=0);
+		/*Tell datasets that Ids are already sorted*/
+		constraints[i]->Presort();
+		loads[i]->Presort();
+		nodes[i]->Presort();
 	}
 
@@ -73,7 +72,5 @@
 	UpdateElementsAndMaterialsDakota(elements,materials,iomodel);
 	#endif
-	if(solution_enum==TransientSolutionEnum){
-		UpdateElementsTransient(elements,parameters,iomodel,analysis_enum);
-	}
+	if(solution_enum==TransientSolutionEnum) UpdateElementsTransient(elements,parameters,iomodel);
 
 	/*Output definitions dataset: */
@@ -86,11 +83,6 @@
 	 * redone: */
 	elements->Presort();
-	nodes->Presort();
 	vertices->Presort();
-	loads->Presort();
 	materials->Presort();
-
-	constraints->Presort();
-	if(VerboseMProcessor()) _printf0_("   done with model processor \n");
 
 	/*Assign output pointers:*/
@@ -102,3 +94,5 @@
 	*ploads       = loads;
 	*pparameters  = parameters;
+
+	if(VerboseMProcessor()) _printf0_("   done with model processor \n");
 }
Index: /issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.h
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.h	(revision 24312)
+++ /issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.h	(revision 24313)
@@ -9,8 +9,10 @@
 #include "../../analyses/analyses.h"
 
-void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads, Parameters** pparameters,IoModel* iomodel,FILE* toolkitfile, char* rootpath,const int solution_type,const int nummodels,const int* analysis_type_listh);
+void ModelProcessorx(Elements** pelements, Nodes*** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints*** pconstraints, Loads*** ploads, Parameters** pparameters,IoModel* iomodel,FILE* toolkitfile, char* rootpath,const int solution_type,const int nummodels,const int* analysis_type_listh);
 
 /*Creation of fem datasets: general drivers*/
-void CreateElementsVerticesAndMaterials(Elements* elements,Vertices* vertices,Materials* materials, IoModel* iomodel,const int nummodels,int solution_type);
+void CreateElements(Elements* elements,IoModel* iomodel,int nummodels);
+void CreateMaterials(Elements* elements,Materials* materials,IoModel* iomodel,int nummodels);
+void CreateVertices(Elements* elements,Vertices* vertices,IoModel* iomodel,int solution_type,bool isamr=false);
 void CreateParameters(Parameters*parameters,IoModel* iomodel,char* rootpath,FILE* toolkitfile,const int solution_type);
 void CreateParametersAutodiff(Parameters* parameters,IoModel* iomodel);
@@ -21,10 +23,10 @@
 void UpdateElementsAndMaterialsControlAD(Elements* elements,Parameters* parameters,Materials* materials, IoModel* iomodel);
 void UpdateElementsAndMaterialsDakota(Elements* elements,Materials* materials, IoModel* iomodel);
-void UpdateElementsTransient(Elements* elements,Parameters* parameters,IoModel* iomodel,int analysis_type);
-void CreateNodes(Nodes*nodes, IoModel* iomodel,int analysis,int finite_element,int approximation=NoneApproximationEnum);
+void UpdateElementsTransient(Elements* elements,Parameters* parameters,IoModel* iomodel);
+void CreateNodes(Nodes*nodes, IoModel* iomodel,int analysis,int finite_element,bool isamr=false,int approximation=NoneApproximationEnum,int* approximations=NULL);
 
 /*partitioning: */
-void ElementsAndVerticesPartitioning(bool** pmy_elements, int** pmy_vertices, IoModel* iomodel);
-void NodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices,  IoModel* iomodel, bool continuous);
+void ElementsAndVerticesPartitioning(IoModel* iomodel);
+void DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements,bool* my_vertices,  IoModel* iomodel);
 void FacesPartitioning(IoModel* iomodel);
 void EdgesPartitioning(IoModel* iomodel);
@@ -38,4 +40,4 @@
 /*Connectivity*/
 void CreateSingleNodeToElementConnectivity(IoModel* iomodel);
-void CreateNumberNodeToElementConnectivity(IoModel* iomodel,int solution_type);
+void CreateNumberNodeToElementConnectivity(IoModel* iomodel);
 #endif
Index: /issm/trunk/src/c/modules/ModelProcessorx/NodesPartitioning.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ModelProcessorx/NodesPartitioning.cpp	(revision 24313)
@@ -15,26 +15,5 @@
 #include "../ModelProcessorx/ModelProcessorx.h"
 
-void  DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel);
-void  ContinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel);
-
-void  NodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel, bool continuous){
-
-	if(continuous==true)
-		ContinuousGalerkinNodesPartitioning(pmy_nodes,my_elements, my_vertices, iomodel);
-	else
-		DiscontinuousGalerkinNodesPartitioning(pmy_nodes,my_elements, my_vertices, iomodel);
-}
-
-void  ContinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel){
-
-	/*output: */
-	bool* my_nodes=xNew<bool>(iomodel->numberofvertices);
-	for(int i=0;i<iomodel->numberofvertices;i++) my_nodes[i]=(bool)my_vertices[i];
-
-	/*Assign output pointers:*/
-	*pmy_nodes=my_nodes;
-}
-
-void  DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel){
+void  DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements,bool* my_vertices, IoModel* iomodel){
 
 	/* Each element has it own nodes (as many as vertices) + additional nodes
Index: /issm/trunk/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp
===================================================================
--- /issm/trunk/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp	(revision 24313)
@@ -9,5 +9,7 @@
 #include "../ModelProcessorx.h"
 
-void	UpdateElementsTransient(Elements* elements, Parameters* parameters,IoModel* iomodel,int analysis_type){
+void	UpdateElementsTransient(Elements* elements, Parameters* parameters,IoModel* iomodel){
+
+	/*FIXME: this should go into parameterization update*/
 
 	bool isgroundingline;
Index: /issm/trunk/src/c/modules/NodesDofx/NodesDofx.cpp
===================================================================
--- /issm/trunk/src/c/modules/NodesDofx/NodesDofx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/NodesDofx/NodesDofx.cpp	(revision 24313)
@@ -8,24 +8,19 @@
 #include "../../toolkits/toolkits.h"
 
-void NodesDofx(Nodes* nodes, Parameters* parameters,int configuration_type){
+void NodesDofx(Nodes* nodes, Parameters* parameters){
 
 	/*Do we have any nodes for this analysis type? :*/
-	if(!nodes->NumberOfNodes(configuration_type)) return;
+	if(!nodes->NumberOfNodes()) return;
 
 	/*Do we really need to update dof indexings*/
-	if(!nodes->RequiresDofReindexing(configuration_type)) return;
+	if(!nodes->RequiresDofReindexing()) return;
 
 	if(VerboseModule()) _printf0_("   Renumbering degrees of freedom\n");
-
-	/*Ensure that only for each cpu, the partition border nodes only will be taken into account once 
-	 * across the cluster. To do so, we flag all the clone nodes: */
-	nodes->FlagClones(configuration_type);
 
 	/*Go through all nodes, and build degree of freedom lists. Each node gets a fixed number of dofs. When 
 	 *a  node has already been distributed dofs on one cpu, all other cpus with the same node cannot distribute it 
 	 *anymore. Use clone field to be sure of that: */
-	nodes->DistributeDofs(configuration_type,GsetEnum);
-	nodes->DistributeDofs(configuration_type,FsetEnum);
-	nodes->DistributeDofs(configuration_type,SsetEnum);
-
+	nodes->DistributeDofs(GsetEnum);
+	nodes->DistributeDofs(FsetEnum);
+	nodes->DistributeDofs(SsetEnum);
 }
Index: /issm/trunk/src/c/modules/NodesDofx/NodesDofx.h
===================================================================
--- /issm/trunk/src/c/modules/NodesDofx/NodesDofx.h	(revision 24312)
+++ /issm/trunk/src/c/modules/NodesDofx/NodesDofx.h	(revision 24313)
@@ -9,5 +9,5 @@
 
 /* local prototypes: */
-void NodesDofx(Nodes* nodes, Parameters* parameters,int analysis_type);
+void NodesDofx(Nodes* nodes, Parameters* parameters);
 
 #endif  /* _NODESDOFX_H */
Index: /issm/trunk/src/c/modules/OceanExchangeDatax/OceanExchangeDatax.cpp
===================================================================
--- /issm/trunk/src/c/modules/OceanExchangeDatax/OceanExchangeDatax.cpp	(revision 24313)
+++ /issm/trunk/src/c/modules/OceanExchangeDatax/OceanExchangeDatax.cpp	(revision 24313)
@@ -0,0 +1,168 @@
+/*!\file OceanExchangeDatax
+ * \brief: exchange of data with ocean model 
+ */
+
+#include "../../shared/shared.h"
+#include "../../toolkits/toolkits.h"
+#include "../../classes/classes.h"
+#include "../modules.h"
+#include "./OceanExchangeDatax.h"
+
+void OceanExchangeDatax(FemModel* femmodel, bool init_stage){
+
+	#ifndef _HAVE_AD_
+	if(VerboseSolution()) _printf0_("   ocean coupling: exchanging information\n");
+	int my_rank;
+	ISSM_MPI_Comm tomitgcmcomm;
+	ISSM_MPI_Status status;
+
+	my_rank=IssmComm::GetRank();
+	GenericParam<ISSM_MPI_Comm>* parcom = dynamic_cast<GenericParam<ISSM_MPI_Comm>*>(femmodel->parameters->FindParamObject(ToMITgcmCommEnum));
+	if(!parcom)_error_("TransferForcing error message: could not find ToMITgcmCommEnum communicator");
+	tomitgcmcomm=parcom->GetParameterValue();
+
+	int oceangridnxsize,oceangridnysize,ngrids_ocean,nels_ocean;
+	IssmDouble  oceantime,coupling_time,time,yts;
+	IssmDouble rho_ice;
+	IssmDouble *oceanmelt         = NULL;
+	IssmDouble *oceangridx;
+	IssmDouble *oceangridy;
+	IssmDouble *icebase_oceangrid = NULL;
+	IssmDouble *icemask_oceangrid = NULL;
+	IssmDouble* x_ice             = NULL;
+	IssmDouble* y_ice             = NULL;
+	IssmDouble* lat_ice           = NULL;
+	IssmDouble* lon_ice           = NULL;
+	IssmDouble* icebase           = NULL;
+	IssmDouble* icemask           = NULL;
+	IssmDouble* melt_mesh         = NULL;
+	int*        index_ice         = NULL;
+	int*        index_ocean       = NULL;
+	int         ngrids_ice=femmodel->vertices->NumberOfVertices();
+	int         nels_ice=femmodel->elements->NumberOfElements();
+
+	/*Recover fixed parameters and store them*/
+	femmodel->parameters->FindParam(&coupling_time,TimesteppingCouplingTimeEnum);
+	femmodel->parameters->FindParam(&time,TimeEnum);
+
+	/*Exchange or recover mesh and inputs needed*/
+	if(init_stage==true){
+		if(my_rank==0){
+			ISSM_MPI_Send(&coupling_time,1,ISSM_MPI_DOUBLE,0,10001000,tomitgcmcomm);
+			ISSM_MPI_Recv(&oceangridnxsize,1,ISSM_MPI_INT,0,10001003,tomitgcmcomm,&status);
+			ISSM_MPI_Recv(&oceangridnysize,1,ISSM_MPI_INT,0,10001004,tomitgcmcomm,&status);
+		}
+		ngrids_ocean=oceangridnxsize*oceangridnysize;
+		ISSM_MPI_Bcast(&oceangridnxsize,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+		ISSM_MPI_Bcast(&oceangridnysize,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+		ISSM_MPI_Bcast(&ngrids_ocean,1,ISSM_MPI_INT,0,IssmComm::GetComm());
+		ISSM_MPI_Bcast(&oceantime,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+		femmodel->parameters->SetParam(oceangridnxsize,OceanGridNxEnum);
+		femmodel->parameters->SetParam(oceangridnysize,OceanGridNyEnum);
+		if(my_rank==0){
+			oceangridx = xNew<IssmDouble>(ngrids_ocean);
+			ISSM_MPI_Recv(oceangridx,ngrids_ocean,ISSM_MPI_DOUBLE,0,10001005,tomitgcmcomm,&status);
+			oceangridy = xNew<IssmDouble>(ngrids_ocean);
+			ISSM_MPI_Recv(oceangridy,ngrids_ocean,ISSM_MPI_DOUBLE,0,10001006,tomitgcmcomm,&status);
+
+			/*Exchange varying parameters for the initialization*/
+			ISSM_MPI_Send(&time,1,ISSM_MPI_DOUBLE,0,10001001,tomitgcmcomm);
+			ISSM_MPI_Recv(&oceantime,1,ISSM_MPI_DOUBLE,0,10001002,tomitgcmcomm,&status);
+		}
+		if(my_rank!=0){
+			oceangridx=xNew<IssmDouble>(ngrids_ocean);
+			oceangridy=xNew<IssmDouble>(ngrids_ocean);
+		}
+		ISSM_MPI_Bcast(oceangridx,ngrids_ocean,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+		ISSM_MPI_Bcast(oceangridy,ngrids_ocean,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+		femmodel->parameters->SetParam(oceangridx,ngrids_ocean,OceanGridXEnum);
+		femmodel->parameters->SetParam(oceangridy,ngrids_ocean,OceanGridYEnum);
+	}
+	else{
+		femmodel->parameters->FindParam(&oceangridx,&ngrids_ocean,OceanGridXEnum);
+		femmodel->parameters->FindParam(&oceangridy,&ngrids_ocean,OceanGridYEnum);
+	}
+
+	/*Interpolate ice base and mask onto ocean grid*/
+	femmodel->GetMesh(femmodel->vertices,femmodel->elements,&x_ice,&y_ice,&index_ice);
+	BamgTriangulatex(&index_ocean,&nels_ocean,oceangridx,oceangridy,ngrids_ocean);
+	femmodel->vertices->LatLonList(&lat_ice,&lon_ice);
+	GetVectorFromInputsx(&icebase,femmodel,BaseEnum,VertexSIdEnum);
+	Options* options = new Options();
+	GenericOption<double> *odouble = new GenericOption<double>();
+	const char* name = "default";
+	odouble->name =xNew<char>(strlen(name)+1);
+	memcpy(odouble->name,name,(strlen(name)+1)*sizeof(char));
+	odouble->value=+9999.;
+	odouble->size[0]=1;
+	odouble->size[1]=1;
+	options->AddOption(odouble);
+	InterpFromMeshToMesh2dx(&icebase_oceangrid,index_ice,lon_ice,lat_ice,ngrids_ice,nels_ice,
+					icebase,ngrids_ice,1,oceangridx,oceangridy,ngrids_ocean,options);
+	delete options;
+	xDelete<IssmDouble>(icebase);
+
+	GetVectorFromInputsx(&icemask,femmodel,MaskIceLevelsetEnum,VertexSIdEnum);
+	Options* options2 = new Options();
+	GenericOption<double> *odouble2 = new GenericOption<double>();
+	const char* name2 = "default";
+	odouble2->name =xNew<char>(strlen(name2)+1);
+	memcpy(odouble2->name,name2,(strlen(name2)+1)*sizeof(char));
+	odouble2->value=+1.;
+	odouble2->size[0]=1;
+	odouble2->size[1]=1;
+	options2->AddOption(odouble2);
+	InterpFromMeshToMesh2dx(&icemask_oceangrid,index_ice,lon_ice,lat_ice,ngrids_ice,nels_ice,
+				icemask,ngrids_ice,1,oceangridx,oceangridy,ngrids_ocean,options2);
+	delete options2;
+	xDelete<IssmDouble>(icemask);
+
+	/*Put +9999 for places where there is no ice!*/
+	for(int i=0;i<ngrids_ocean;i++) if(icemask_oceangrid[i]>0.) icebase_oceangrid[i]=+9999.;
+	xDelete<IssmDouble>(icemask_oceangrid);
+
+	if(init_stage==true){ //just send icebase
+		if(my_rank==0){
+			ISSM_MPI_Send(icebase_oceangrid,ngrids_ocean,ISSM_MPI_DOUBLE,0,10001008,tomitgcmcomm);
+		}
+	}
+	else{ //send and receive exchanged data
+		femmodel->parameters->FindParam(&rho_ice,MaterialsRhoIceEnum);
+		femmodel->parameters->FindParam(&yts,ConstantsYtsEnum);
+		if(my_rank==0){
+			ISSM_MPI_Send(&time,1,ISSM_MPI_DOUBLE,0,10001001,tomitgcmcomm);
+			ISSM_MPI_Recv(&oceantime,1,ISSM_MPI_DOUBLE,0,10001002,tomitgcmcomm,&status);
+			if((oceantime - time > 0.1*yts) & (oceantime - time < -0.1*yts)) _error_("Ocean and ice time are starting to diverge");
+			oceanmelt = xNew<IssmDouble>(ngrids_ocean);
+			ISSM_MPI_Recv(oceanmelt,ngrids_ocean,ISSM_MPI_DOUBLE,0,10001007,tomitgcmcomm,&status);
+			ISSM_MPI_Send(icebase_oceangrid,ngrids_ocean,ISSM_MPI_DOUBLE,0,10001008,tomitgcmcomm);
+		}
+		ISSM_MPI_Bcast(&oceantime,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+		if(my_rank!=0) oceanmelt=xNew<IssmDouble>(ngrids_ocean);
+		ISSM_MPI_Bcast(oceanmelt,ngrids_ocean,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+
+		/*Interp melt onto ice grid*/
+		InterpFromMeshToMesh2dx(&melt_mesh,index_ocean,oceangridx,oceangridy,ngrids_ocean,nels_ocean,
+					oceanmelt,ngrids_ocean,1,
+					lon_ice,lat_ice,ngrids_ice,NULL);
+
+		for(int i=0;i<ngrids_ice;i++) melt_mesh[i]=-melt_mesh[i]/rho_ice; //heat flux provided by ocean is in kg/m^2/s
+		InputUpdateFromVectorx(femmodel,melt_mesh,BasalforcingsFloatingiceMeltingRateEnum,VertexSIdEnum);
+	}
+
+	/*Delete*/
+	xDelete<int>(index_ice);
+	xDelete<int>(index_ocean);
+	xDelete<IssmDouble>(lat_ice);
+	xDelete<IssmDouble>(lon_ice);
+	xDelete<IssmDouble>(x_ice);
+	xDelete<IssmDouble>(y_ice);
+	xDelete<IssmDouble>(icebase_oceangrid);
+	xDelete<IssmDouble>(oceangridx);
+	xDelete<IssmDouble>(oceangridy);
+	xDelete<IssmDouble>(melt_mesh);
+	xDelete<IssmDouble>(oceanmelt);
+	#else
+	_error_("not supported");
+	#endif
+}
Index: /issm/trunk/src/c/modules/OceanExchangeDatax/OceanExchangeDatax.h
===================================================================
--- /issm/trunk/src/c/modules/OceanExchangeDatax/OceanExchangeDatax.h	(revision 24313)
+++ /issm/trunk/src/c/modules/OceanExchangeDatax/OceanExchangeDatax.h	(revision 24313)
@@ -0,0 +1,12 @@
+/*!\file:  OceanExchangeDatax.h
+ * \brief header file for Exchange of ocean data
+ */ 
+
+#ifndef _OCEANEXCHANGEDATAX_H
+#define _OCEANEXCHANGEDATAX_H
+
+#include "../../classes/classes.h"
+
+/* local prototypes: */
+void OceanExchangeDatax(FemModel* femmodel, bool init_stage);
+#endif  /* _OCEANEXCHANGEDATAX_H */
Index: /issm/trunk/src/c/modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.cpp
===================================================================
--- /issm/trunk/src/c/modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.cpp	(revision 24313)
@@ -34,5 +34,4 @@
 	/*If we are here, did not find the definition for this response, not good!: */
 	_error_("Could not find the response for output definition " << output_string << " because could not find the definition itself!");
-
 }
 
@@ -63,4 +62,3 @@
 				<<" ("<<output_enum<<")"
 				<< " because could not find the definition itself!");
-
 }
Index: /issm/trunk/src/c/modules/ParseToolkitsOptionsx/ParseToolkitsOptionsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/ParseToolkitsOptionsx/ParseToolkitsOptionsx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ParseToolkitsOptionsx/ParseToolkitsOptionsx.cpp	(revision 24313)
@@ -22,20 +22,18 @@
 	char word1[1000];
 	char word2[1000];
-	int my_rank;
-	int i;
 
 	/*intermediary: */
-	int         *analyses     = NULL;
-	char       **strings      = NULL;
-	char        *string       = NULL;
-	char       **toolkits     = NULL;
-	char        *toolkit      = NULL;
-	char        *newstring    = NULL;
-	char        *catstring    = NULL;
-	int          numanalyses;
-	int          stringlength,toolkitlength;
+	int   *analyses     = NULL;
+	char **strings      = NULL;
+	char  *string       = NULL;
+	char **toolkits     = NULL;
+	char  *toolkit      = NULL;
+	char  *newstring    = NULL;
+	char  *catstring    = NULL;
+	int    numanalyses;
+	int    stringlength,toolkitlength;
 
 	/*Get my_rank:*/
-	my_rank=IssmComm::GetRank();
+	int my_rank=IssmComm::GetRank();
 
 	if(my_rank==0){
@@ -59,6 +57,6 @@
 		strings  = xNew<char*>(numanalyses);
 		toolkits = xNew<char*>(numanalyses);
-		for(i=0;i<numanalyses;i++) strings[i]  = NULL;
-		for(i=0;i<numanalyses;i++) toolkits[i] = NULL;
+		for(int i=0;i<numanalyses;i++) strings[i]  = NULL;
+		for(int i=0;i<numanalyses;i++) toolkits[i] = NULL;
 
 		/*Go back to beginning of file:*/
@@ -119,5 +117,5 @@
 	}
 	ISSM_MPI_Bcast(analyses,numanalyses,ISSM_MPI_INT,0,IssmComm::GetComm());
-	for(i=0;i<numanalyses;i++){
+	for(int i=0;i<numanalyses;i++){
 		char* toolkit=toolkits[i];
 		if(my_rank==0){
@@ -147,6 +145,6 @@
 
 	/*Clean up and return*/
-	for(i=0;i<numanalyses;i++) xDelete<char>(strings[i]);
-	for(i=0;i<numanalyses;i++) xDelete<char>(toolkits[i]);
+	for(int i=0;i<numanalyses;i++) xDelete<char>(strings[i]);
+	for(int i=0;i<numanalyses;i++) xDelete<char>(toolkits[i]);
 	xDelete<char*>(strings);
 	xDelete<char*>(toolkits);
Index: /issm/trunk/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp	(revision 24313)
@@ -8,59 +8,36 @@
 void Reducevectorgtofx(Vector<IssmDouble>** puf, Vector<IssmDouble>* ug, Nodes* nodes,Parameters* parameters){
 
-	/*output: */
-	Vector<IssmDouble>* uf=NULL;
-
-	/*variables: */
-	int         configuration_type;
-	int         fsize;
-	IssmDouble *ug_serial = NULL;
-	bool        oldalloc  = false;
-
 	if(VerboseModule()) _printf0_("   Reduce vector from g to f set\n");
 
 	/*first figure out fsize: */
-	parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
-	fsize=nodes->NumberOfDofs(configuration_type,FsetEnum);
+	int fsize=nodes->NumberOfDofs(FsetEnum);
+	int flocalsize = nodes->NumberOfDofsLocal(FsetEnum);
 
-	int    analysis_type;
-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
-	int flocalsize = nodes->NumberOfDofsLocal(analysis_type,FsetEnum);
-
+	/*If fsize is 0, return NULL vector*/
 	if(fsize==0){
-		uf=NULL;
-	}
-	else{
-		/*allocate: */
-		if(oldalloc)
-		 uf=new Vector<IssmDouble>(fsize);
-		else
-		 uf=new Vector<IssmDouble>(flocalsize,fsize);
-
-		if(nodes->NumberOfNodes(configuration_type)){ 
-
-			/*serialize ug, so nodes can index into it: */
-			ug_serial=ug->ToMPISerial();
-
-			/*Go through all nodes, and ask them to retrieve values from ug, and plug them into uf: */
-			for(int i=0;i<nodes->Size();i++){
-
-				Node* node=(Node*)nodes->GetObjectByOffset(i);
-
-				/*Check that this node corresponds to our analysis currently being carried out: */
-				if (node->InAnalysis(configuration_type)){
-
-					/*For this object, reduce values for enum set Fset: */
-					node->VecReduce(uf,ug_serial,FsetEnum);
-				}
-			}
-		}
-		/*Assemble vector: */
-		uf->Assemble();
+		*puf=NULL;
+		return;
 	}
 
-	/*Free ressources:*/
-	xDelete<IssmDouble>(ug_serial);
+	/*Get local vectors ug*/
+	int        *indices_ug = NULL;
+	IssmDouble *local_ug   = NULL;
+	ug->GetLocalVector(&local_ug,&indices_ug);
 
-	/*Assign output pointers:*/
+	/*Allocate output*/
+	Vector<IssmDouble>* uf=new Vector<IssmDouble>(flocalsize,fsize);
+
+	/*Let nodes figure it out*/
+	for(int i=0;i<nodes->Size();i++){
+		Node* node=(Node*)nodes->GetObjectByOffset(i);
+		node->VecReduce(uf,local_ug,indices_ug);
+	}
+
+	/*Assemble vector: */
+	uf->Assemble();
+
+	/*Cleanup and assing output pointer*/
+	xDelete<int>(indices_ug);
+	xDelete<IssmDouble>(local_ug);
 	*puf=uf;
 }
Index: /issm/trunk/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp	(revision 24313)
@@ -31,10 +31,27 @@
 	for(int i=0;i<femmodel->loads->Size();i++){
 		Load* load=(Load*)femmodel->loads->GetObjectByOffset(i);
-		if(load->InAnalysis(analysis_type)){
-			if(load->ObjectEnum()==PengridEnum){
-				Pengrid* pengrid=(Pengrid*)load;
-				pengrid->ResetConstraint();
-			}
+		if(load->ObjectEnum()==PengridEnum){
+			Pengrid* pengrid=(Pengrid*)load;
+			pengrid->ResetConstraint();
 		}
 	}
 }
+void ResetZigzagCounterx(FemModel* femmodel){
+
+	/*Display message*/
+	if(VerboseModule()) _printf0_("   Resetting penalties\n");
+
+	/*Deal with rift first*/
+	if(RiftIsPresent(femmodel->loads,femmodel->analysis_type_list[femmodel->analysis_counter])){
+		_error_("rift constraints reset not supported yet!");
+	}
+
+	/*Reset pengrid to inactive mode*/
+	for(int i=0;i<femmodel->loads->Size();i++){
+		Load* load=(Load*)femmodel->loads->GetObjectByOffset(i);
+		if(load->ObjectEnum()==PengridEnum){
+			Pengrid* pengrid=(Pengrid*)load;
+			pengrid->ResetZigzagCounter();
+		}
+	}
+}
Index: /issm/trunk/src/c/modules/ResetConstraintsx/ResetConstraintsx.h
===================================================================
--- /issm/trunk/src/c/modules/ResetConstraintsx/ResetConstraintsx.h	(revision 24312)
+++ /issm/trunk/src/c/modules/ResetConstraintsx/ResetConstraintsx.h	(revision 24313)
@@ -10,4 +10,5 @@
 /* local prototypes: */
 void ResetConstraintsx(FemModel* femmodel);
+void ResetZigzagCounterx(FemModel* femmodel);
 
 #endif  /* _RESETCONSTRAINTSX_H */
Index: /issm/trunk/src/c/modules/RheologyBAbsGradientx/RheologyBAbsGradientx.cpp
===================================================================
--- /issm/trunk/src/c/modules/RheologyBAbsGradientx/RheologyBAbsGradientx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/RheologyBAbsGradientx/RheologyBAbsGradientx.cpp	(revision 24313)
@@ -78,2 +78,75 @@
 	return Jelem;
 }
+
+void RheologyBInitialguessMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters){
+
+	/*output: */
+	IssmDouble J=0.;
+	IssmDouble J_sum;
+
+	/*Compute Misfit: */
+	for(int i=0;i<elements->Size();i++){
+		Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
+		J+=RheologyBInitialguessMisfit(element);
+	}
+
+	/*Sum all J from all cpus of the cluster:*/
+	ISSM_MPI_Reduce (&J,&J_sum,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
+	ISSM_MPI_Bcast(&J_sum,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
+	J=J_sum;
+
+	/*Assign output pointers: */
+	*pJ=J;
+}
+
+IssmDouble RheologyBInitialguessMisfit(Element* element){
+
+	int         domaintype,numcomponents;
+	IssmDouble  Jelem=0.;
+	IssmDouble  misfit,Jdet;
+	IssmDouble  B,B0,weight;
+	IssmDouble* xyz_list      = NULL;
+
+	/*If on water, return 0: */
+	if(!element->IsIceInElement()) return 0.;
+
+	/*Get problem dimension*/
+	element->FindParam(&domaintype,DomainTypeEnum);
+	switch(domaintype){
+		case Domain2DverticalEnum:   numcomponents   = 1; break;
+		case Domain3DEnum:           numcomponents   = 2; break;
+		case Domain2DhorizontalEnum: numcomponents   = 2; break;
+		default: _error_("not supported yet");
+	}
+
+	/* Get node coordinates*/
+	element->GetVerticesCoordinates(&xyz_list);
+
+	/*Retrieve all inputs we will be needing: */
+	Input* weights_input=element->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
+	Input* rheologyb_input=element->GetInput(MaterialsRheologyBbarEnum);            _assert_(rheologyb_input);
+	Input* rheologyb0_input=element->GetInput(RheologyBInitialguessEnum);           _assert_(rheologyb0_input);
+
+	/* Start  looping on the number of gaussian points: */
+	Gauss* gauss=element->NewGauss(2);
+	for(int ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+
+		/* Get Jacobian determinant: */
+		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
+
+		/*Get all parameters at gaussian point*/
+		weights_input->GetInputValue(&weight,gauss,RheologyBInitialguessMisfitEnum);
+		rheologyb_input->GetInputValue(&B,gauss);
+		rheologyb0_input->GetInputValue(&B0,gauss);
+
+		/*Tikhonov regularization: J = 1/2 (B-B0)^2 */ 
+		Jelem+=weight*1./2.*(B-B0)*(B-B0)*Jdet*gauss->weight;
+	}
+
+	/*clean up and Return: */
+	xDelete<IssmDouble>(xyz_list);
+	delete gauss;
+	return Jelem;
+}
Index: /issm/trunk/src/c/modules/RheologyBAbsGradientx/RheologyBAbsGradientx.h
===================================================================
--- /issm/trunk/src/c/modules/RheologyBAbsGradientx/RheologyBAbsGradientx.h	(revision 24312)
+++ /issm/trunk/src/c/modules/RheologyBAbsGradientx/RheologyBAbsGradientx.h	(revision 24313)
@@ -12,3 +12,6 @@
 IssmDouble RheologyBAbsGradient(Element* element);
 
+void RheologyBInitialguessMisfitx( IssmDouble* pJ, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters);
+IssmDouble RheologyBInitialguessMisfit(Element* element);
+
 #endif
Index: /issm/trunk/src/c/modules/SetActiveNodesLSMx/SetActiveNodesLSMx.cpp
===================================================================
--- /issm/trunk/src/c/modules/SetActiveNodesLSMx/SetActiveNodesLSMx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/SetActiveNodesLSMx/SetActiveNodesLSMx.cpp	(revision 24313)
@@ -77,10 +77,6 @@
 	/*Assemble vector and serialize */
 	vec_mask_ice->Assemble();
-	IssmDouble* mask_ice=vec_mask_ice->ToMPISerial();
-	InputUpdateFromVectorx(femmodel,mask_ice,IceMaskNodeActivationEnum,VertexSIdEnum);
-
-	/*Clean up and return*/
+	InputUpdateFromVectorx(femmodel,vec_mask_ice,IceMaskNodeActivationEnum,VertexSIdEnum);
 	delete vec_mask_ice;
-	xDelete<IssmDouble>(mask_ice);
 }/*}}}*/
 void GetMaskOfIceVerticesLSMx(FemModel* femmodel){/*{{{*/
@@ -89,9 +85,8 @@
 
 	/*Create vector on gset*/
-	int configuration_type;
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
-	int gsize=femmodel->nodes->NumberOfDofs(configuration_type,GsetEnum);
+	int gsize              = femmodel->nodes->NumberOfDofs(GsetEnum);
+	int glocalsize_masters = femmodel->nodes->NumberOfDofsLocal(GsetEnum);
 	if(gsize==0)  return;
-	Vector<IssmDouble>* vec_mask_ice=new Vector<IssmDouble>(gsize);
+	Vector<IssmDouble>* vec_mask_ice=new Vector<IssmDouble>(glocalsize_masters,gsize);
 
 	/*Fill vector with values: */
@@ -113,12 +108,17 @@
 	/*Assemble vector and serialize */
 	vec_mask_ice->Assemble();
-	IssmDouble* mask_ice=vec_mask_ice->ToMPISerial();
+
+	/*Get local vector with masters and slaves*/
+	IssmDouble *local_ug = NULL;
+	femmodel->GetLocalVectorWithClonesGset(&local_ug,vec_mask_ice);
 	delete vec_mask_ice;
+
+	/*Now update inputs (analysis specific)*/
 	for(int i=0;i<femmodel->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
-		element->InputUpdateFromSolutionOneDof(mask_ice,IceMaskNodeActivationEnum);
+		element->InputUpdateFromSolutionOneDof(local_ug,IceMaskNodeActivationEnum);
 	}
 
-	/*Clean up and return*/
-	xDelete<IssmDouble>(mask_ice);
+	/*cleanup and return*/
+	xDelete<IssmDouble>(local_ug);
 }/*}}}*/
Index: /issm/trunk/src/c/modules/Solverx/Solverx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Solverx/Solverx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/Solverx/Solverx.cpp	(revision 24313)
@@ -11,23 +11,64 @@
 #include "./Solverx.h"
 #include "../../shared/shared.h"
+#include "../../classes/Params/Parameters.h"
 
 void	Solverx(Vector<IssmDouble>** puf, Matrix<IssmDouble>* Kff, Vector<IssmDouble>* pf, Vector<IssmDouble>* uf0,Vector<IssmDouble>* df, Parameters* parameters){
 
-	/*intermediary: */
-	Solver<IssmDouble> *solver=NULL;
-
-	/*output: */
-	Vector<IssmDouble> *uf=NULL;
-
-	if(VerboseModule()) _printf0_("   Solving matrix system\n");
-
-	/*Initialize solver: */
-	solver=new Solver<IssmDouble>(Kff,pf,uf0,df,parameters);
+	/*Create Solver Object*/
+	Solver<IssmDouble>* solver=new Solver<IssmDouble>(Kff,pf,uf0,df,parameters);
 
 	/*Solve:*/
-	uf=solver->Solve();
+	if(VerboseModule()) _printf0_("   Solving matrix system\n");
+	Vector<IssmDouble>* uf=solver->Solve();
+
+	/*Check convergence, if failed, try recovery model*/
+	if(!checkconvergence(Kff,pf,uf,parameters)){
+
+		_printf0_("   WARNING: Solver failed, Trying Recovery Mode\n");
+		ToolkitsOptionsFromAnalysis(parameters,RecoveryAnalysisEnum);
+		delete uf;
+		uf=solver->Solve();
+
+		if(!checkconvergence(Kff,pf,uf,parameters)) _error_("Recovery solver failed...");
+	}
 
 	/*clean up and assign output pointers:*/
+	_assert_(puf);
 	delete solver;
 	*puf=uf;
 }
+bool checkconvergence(Matrix<IssmDouble>* Kff,Vector<IssmDouble>* pf,Vector<IssmDouble>* uf,Parameters* parameters){
+
+	/*Recover parameters: */
+	IssmDouble solver_residue_threshold;
+	parameters->FindParam(&solver_residue_threshold,SettingsSolverResidueThresholdEnum);
+
+	/*don't check convergence if NaN*/
+	if(xIsNan<IssmDouble>(solver_residue_threshold)) return true;
+
+	/*compute KUF = KU - F = K*U - F*/
+	Vector<IssmDouble>* KU  = uf->Duplicate(); Kff->MatMult(uf,KU);
+	Vector<IssmDouble>* KUF = KU->Duplicate(); KU->Copy(KUF); KUF->AYPX(pf,-1.);
+	delete KU;
+
+	/*compute norm(KUF), norm(F)*/
+	IssmDouble nKUF=KUF->Norm(NORM_TWO);
+	IssmDouble nF=pf->Norm(NORM_TWO);
+	delete KUF;
+
+	/*Check solver residue*/
+	IssmDouble solver_residue = 0.;
+	if(nF>0.)  solver_residue = nKUF/(nF);
+	if(VerboseConvergence()) _printf0_("\n   solver residue: norm(KU-F)/norm(F)=" << solver_residue << "\n");
+	if(xIsNan<IssmDouble>(solver_residue)) _error_("Solver residue is NaN");
+
+	/*Check convergence*/
+	if(solver_residue>solver_residue_threshold){
+		_printf0_("   solver residue too high!: norm(KU-F)/norm(F)=" << solver_residue << " => Trying recovery solver\n");
+		return false;
+	}
+	else{
+		return true;
+	}
+
+}
Index: /issm/trunk/src/c/modules/Solverx/Solverx.h
===================================================================
--- /issm/trunk/src/c/modules/Solverx/Solverx.h	(revision 24312)
+++ /issm/trunk/src/c/modules/Solverx/Solverx.h	(revision 24313)
@@ -16,4 +16,5 @@
 /* local prototypes: */
 void	Solverx(Vector<IssmDouble>** puf, Matrix<IssmDouble>* Kff, Vector<IssmDouble>* pf, Vector<IssmDouble>* uf0,Vector<IssmDouble>* df, Parameters* parameters);
+bool checkconvergence(Matrix<IssmDouble>* Kff,Vector<IssmDouble>* pf,Vector<IssmDouble>* uf,Parameters* parameters);
 
 #endif  /* _SOLVERX_H */
Index: /issm/trunk/src/c/modules/SpcNodesx/SpcNodesx.cpp
===================================================================
--- /issm/trunk/src/c/modules/SpcNodesx/SpcNodesx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/SpcNodesx/SpcNodesx.cpp	(revision 24313)
@@ -8,17 +8,9 @@
 #include "../../toolkits/toolkits.h"
 
-void SpcNodesx(Nodes* nodes,Constraints* constraints,Parameters* parameters, int analysis_type){
+void SpcNodesx(Nodes* nodes,Constraints* constraints,Parameters* parameters){
 
 	for(int i=0;i<constraints->Size();i++){
-
 		Constraint* constraint=(Constraint*)constraints->GetObjectByOffset(i);
-
-		/*Check this constraint belongs to this analysis: */
-		if(constraint->InAnalysis(analysis_type)){
-
-			/*Ok, apply constraint onto corresponding node: */
-			constraint->ConstrainNode(nodes,parameters);
-		}
+		constraint->ConstrainNode(nodes,parameters);
 	}
-
 }
Index: /issm/trunk/src/c/modules/SpcNodesx/SpcNodesx.h
===================================================================
--- /issm/trunk/src/c/modules/SpcNodesx/SpcNodesx.h	(revision 24312)
+++ /issm/trunk/src/c/modules/SpcNodesx/SpcNodesx.h	(revision 24313)
@@ -10,5 +10,5 @@
 
 /* local prototypes: */
-void SpcNodesx(Nodes* nodes, Constraints* constraints,Parameters* parameters,int analysis_type);
+void SpcNodesx(Nodes* nodes, Constraints* constraints,Parameters* parameters);
 
 #endif  /* _SPCNODESX_H */
Index: /issm/trunk/src/c/modules/SurfaceMassBalancex/Gembx.cpp
===================================================================
--- /issm/trunk/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/SurfaceMassBalancex/Gembx.cpp	(revision 24313)
@@ -18,4 +18,5 @@
 const double Gdntol = 1e-10;
 const double Wtol = 1e-13;
+const double Ptol = 1e-6;
 
 const double CI = 2102.0;                       // heat capacity of snow/ice (J kg-1 k-1)
@@ -26,4 +27,6 @@
 const double CA = 1005.0;                    // heat capacity of air (J kg-1 K-1)
 const double R = 8.314;                      // gas constant (J mol-1 K-1)
+
+const double Delflag=-99999;
 
 void Gembx(FemModel* femmodel){  /*{{{*/
@@ -123,23 +126,23 @@
 	IssmDouble F = 0.0, H=0.0, G=0.0;
 	const IssmDouble E = 0.09;        //[mm d-1] model time growth constant E
-	// convert T from K to ºC
+	// convert T from K to degC
 	T = T - CtoK;
 
 	// temperature coefficient F
-	if(T>-6.0) F =  0.7 + ((T/-6.0) * 0.3);
-	if(T<=-6.0 && T>-22.0) F =  1.0 - ((T+6.0)/-16.0 * 0.8);
-	if(T<=-22.0 && T>-40.0) F =  0.2 - ((T+22.0)/-18.0 * 0.2);
+	if(T> -6.0+Ttol) F =  0.7 + ((T/-6.0) * 0.3);
+	if(T<= -6.0+Ttol && T> -22.0+Ttol) F =  1.0 - ((T+6.0)/-16.0 * 0.8);
+	if(T<= -22.0+Ttol && T> -40.0+Ttol) F =  0.2 - ((T+22.0)/-18.0 * 0.2);
 
 	// density coefficient F
-	if(d<150.0) H=1.0;
-
-	if(d>=150.0 & d<400.0) H = 1.0 - ((d-150.0)/250.0);
+	if(d< 150.0-Dtol) H=1.0;
+
+	if(d>= 150.0-Dtol && d <400.0-Dtol) H = 1.0 - ((d-150.0)/250.0);
 
 	// temperature gradient coefficient G
-	if(dT >= 0.16 && dT < 0.25) G = ((dT - 0.16)/0.09) * 0.1;
-	if(dT >= 0.25 && dT < 0.4)  G = 0.1 + (((dT - 0.25)/0.15) * 0.57);
-	if(dT >= 0.4  && dT < 0.5)  G = 0.67 + (((dT - 0.4)/0.1) * 0.23);
-	if(dT >= 0.5  && dT < 0.7)  G = 0.9 + (((dT - 0.5)/0.2) * 0.1);
-	if(dT >= 0.7              )  G = 1.0;
+	if(dT >= 0.16-Ttol && dT < 0.25-Ttol) G = ((dT - 0.16)/0.09) * 0.1;
+	if(dT >= 0.25-Ttol && dT < 0.4-Ttol)  G = 0.1 + (((dT - 0.25)/0.15) * 0.57);
+	if(dT >= 0.4-Ttol && dT < 0.5-Ttol)  G = 0.67 + (((dT - 0.4)/0.1) * 0.23);
+	if(dT >= 0.5-Ttol && dT < 0.7-Ttol)  G = 0.9 + (((dT - 0.5)/0.2) * 0.1);
+	if(dT >= 0.7-Ttol)  G = 1.0;
 
 	// grouped coefficient Q
@@ -204,5 +207,5 @@
 
 	/*only when aIdx = 1 or 2 do we run grainGrowth: */
-	if(aIdx!=1 & aIdx!=2){
+	if(aIdx!=1 && aIdx!=2){
 		/*come out as we came in: */
 		return;
@@ -219,5 +222,5 @@
 
 	//set maximum water content by mass to 9 percent (Brun, 1980)
-	for(int i=0;i<m;i++)if(lwc[i]>9.0-Wtol) lwc[i]=9.0;
+	for(int i=0;i<m;i++)if(lwc[i]>9.0+Wtol) lwc[i]=9.0;
 
 	/* Calculate temperature gradiant across grid cells 
@@ -236,5 +239,5 @@
 	// Take forward differences on left and right edges
 	dT[0] = (T[1] - T[0])/(zGPC[1]-zGPC[0]);
-	dT[m-1] = (T[m-1] - T[m-2])/(zGPC[m-1]-zGPC[m-2]);
+	if(m>1) dT[m-1] = (T[m-1] - T[m-2])/(zGPC[m-1]-zGPC[m-2]);
 
 	//Take centered differences on interior points
@@ -248,61 +251,74 @@
 		if (gdn[i]>0.0+Gdntol){
 
-			//_printf_("Dendritic dry snow metamorphism\n");
-
-			//index for dentricity > 0 and T gradients < 5 degC m-1 and >= 5 degC m-1
-			if(dT[i]<5.0-Ttol){
-				//determine coefficients
-				IssmDouble A = - 2e8 * exp(-6e3 / T[i]) * dt;
-				IssmDouble B = 1e9 * exp(-6e3 / T[i]) * dt;
-				//new dentricity and sphericity for dT < 5 degC m-1
-				gdn[i] += A;
-				gsp[i] += B;
+			if(W[i]<=0.0+Wtol){
+				//_printf_("Dendritic dry snow metamorphism\n");
+				//index for dentricity > 0 and T gradients < 5 degC m-1 and >= 5 degC m-1
+				if(dT[i]<=5.0+Ttol){
+					//determine coefficients
+					IssmDouble A = - 2e8 * exp(-6e3 / T[i]) * dt;
+					IssmDouble B = 1e9 * exp(-6e3 / T[i]) * dt;
+					//new dentricity and sphericity for dT < 5 degC m-1
+					gdn[i] += A;
+					gsp[i] += B;
+				}
+				else{
+					// new dendricity and sphericity for dT >= 5 degC m-1
+
+					//determine coeff0icients
+					IssmDouble C = (-2e8 * exp(-6e3 / T[i]) * dt) * pow(dT[i],.4);
+					gdn[i] +=C;
+					gsp[i] +=C;
+				}
 			}
 			else{
-				// new dendricity and sphericity for dT >= 5 degC m-1
-
-				//determine coefficients
-				IssmDouble C = (-2e8 * exp(-6e3 / T[i]) * dt) * pow(dT[i],.4);
-				gdn[i] +=C;
-				gsp[i] +=C;
-			}
-
-			// wet snow metamorphism
-			if(W[i]>0.0+Wtol){
-
-				//_printf_("D}ritic wet snow metamorphism\n");
+				// wet snow metamorphism
+				//_printf_("Dendritic wet snow metamorphism\n");
 
 				//determine coefficient
 				IssmDouble D = (1.0/16.0) * pow(lwc[i],3.0) * dt;
 
-				// new dendricity and sphericity for wet snow
+				// new dendricity for wet snow
 				gdn[i] -= D;
+				// new sphericity for wet snow
 				gsp[i] += D;
 			}
-
 			// dendricity and sphericity can not be > 1 or < 0
-			if (gdn[i]<0.0+Wtol)gdn[i]=0.0;
-			if (gsp[i]<0.0+Wtol)gsp[i]=0.0;
-			if (gdn[i]>1.0-Wtol)gdn[i]=1.0;
-			if (gsp[i]>1.0-Wtol)gsp[i]=1.0;
-
-			// determine new grain size (mm)
-			gsz[i] = 0.1 + (1.0-gdn[i])*0.25 + (0.5-gsp[i])*0.1;
+         if (gdn[i]<0.0+Gdntol)gdn[i]=0.0;
+         if (gsp[i]<0.0+Gdntol)gsp[i]=0.0;
+         if (gdn[i]>1.0-Gdntol)gdn[i]=1.0;
+         if (gsp[i]>1.0-Gdntol)gsp[i]=1.0;
+
+         // determine new grain size (mm)
+         gsz[i] = 0.1 + (1.0-gdn[i])*0.25 + (0.5-gsp[i])*0.1;
 
 		}
 		else{
 
-			/*Dry snow metamorphism (Marbouty, 1980) grouped model coefficinets
+			//When the state of "faceted crystals" (gsp==0) is fully reached,
+			// snow evolves towards depth hoar if the gradient is
+			// higher than 15 degC m-1 (Brun et al., 1992)
+			//When wet-snow grains (class 6) are submitted to a
+			// temperature gradient higher than degC m-1, their sphericity
+			// decreases according to Equations (4). When sphericity
+			// reaches 0, their size increases according to the functions
+			// determined by Marbouty. (Brun et al., 1992)
+			if(gsp[i]>0.0+Gdntol && gsp[i]<1.0-Gdntol && (dT[i]>15.0+Ttol || (T[i]>5.0+Ttol && W[i]>0.0+Wtol)) ){
+				//determine coeff0icients
+				IssmDouble C = (-2e8 * exp(-6e3 / T[i]) * dt) * pow(dT[i],.4);
+				gsp[i] +=C;
+				if (gsp[i]<0.0+Gdntol)gsp[i]=0.0;
+			}
+			/*Dry snow metamorphism (Marbouty, 1980) grouped model coefficents
 			 *from Marbouty, 1980: Figure 9*/
-
-			//_printf_("Nond}ritic snow metamorphism\n");
-			Q = Marbouty(T[i],d[i],dT[i]);
-
-			// calculate grain growth
-			gsz[i] += (Q*dt);
-
+			else if(W[i]<=0.0+Wtol || (gsp[i]<=0.0+Gdntol && dT[i]>15.0+Ttol) || (gsp[i]<=0.0+Gdntol && T[i]>5.0+Ttol && W[i]>0.0+Wtol)){
+				//_printf_("Nondendritic snow metamorphism\n");
+				Q = Marbouty(T[i],d[i],dT[i]);
+
+				// calculate grain growth
+				gsz[i] += (Q*dt);
+			}
 			//Wet snow metamorphism (Brun, 1989)
-			if(W[i]>0.0+Wtol){
-				//_printf_("Nond}ritic wet snow metamorphism\n");
+			else{
+				//_printf_("Nondendritic wet snow metamorphism\n");
 				//wet rate of change coefficient
 				IssmDouble E = 1.28e-8 + (4.22e-10 * pow(lwc[i],3.0))* (dt *dts);   // [mm^3 s^-1]
@@ -310,5 +326,4 @@
 				// calculate change in grain volume and convert to grain size
 				gsz[i] = 2.0 * pow(3.0/(Pi * 4.0)*((4.0/ 3.0)*Pi*pow(gsz[i]/2.0,3.0) + E),1.0/3.0);
-
 			}
 
@@ -317,8 +332,8 @@
 
 			// grains with sphericity == 0 can not have grain sizes > 5 mm (Brun, 1992)
-			if (fabs(gsp[i]-1.0)>Wtol && gsz[i]>5.0-Wtol) gsz[i]=5.0;
-		}
-
-		//convert grain size back to effective grain radius: 
+			if (fabs(gsp[i]-1.0)>=Wtol && gsz[i]>5.0-Wtol) gsz[i]=5.0;
+		}
+
+		//convert grain size back to effective grain radius:
 		re[i]=gsz[i]/2.0;
 	}
@@ -400,5 +415,5 @@
 	const IssmDouble dSnow = 300;   // density of fresh snow [kg m-3]       
 
-	if(aIdx==0 || (adThresh - d[0]<Dtol)){
+	if(aIdx==0 || (adThresh - d[0])<Dtol){
 		a[0] = aValue;
 	}
@@ -509,5 +524,5 @@
 
 }  /*}}}*/
-void thermo(IssmDouble* pEC, IssmDouble** pT, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlwrf, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble teValue, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid) { /*{{{*/
+void thermo(IssmDouble* pEC, IssmDouble** pT, IssmDouble* pulwrf, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlwrf, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble teValue, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid) { /*{{{*/
 
 	/* ENGLACIAL THERMODYNAMICS*/
@@ -536,4 +551,5 @@
 	// T: grid cell temperature [k]
 	// EC: evaporation/condensation [kg]
+	// ulwrf: upward longwave radiation flux [W m-2]
 
 	/*intermediary: */
@@ -583,4 +599,5 @@
 	IssmDouble EC=0.0;
 	IssmDouble* T=*pT;
+	IssmDouble ulwrf=0.0;
 
 	if(VerboseSmb() && sid==0 && IssmComm::GetRank()==0)_printf0_("   thermal module\n");
@@ -610,5 +627,6 @@
 
 	// Bulk-transfer coefficient for turbulent fluxes
-	An =  pow(0.4,2) / pow(log(Tz/z0),2);     // Bulk-transfer coefficient
+	//An =  pow(0.4,2) / pow(log(Tz/z0),2);     // Bulk-transfer coefficient
+	An =  pow(0.4,2) / (log(Tz/z0)*log(Vz/z0));     // Bulk-transfer coefficient
 	C = An * dAir * V;                        // shf & lhf common coefficient
 
@@ -649,6 +667,6 @@
 	KP = xNew<IssmDouble>(m);
 
-	KU[0] = UNDEF;
-	KD[m-1] = UNDEF;
+	KU[0] = Delflag;
+	KD[m-1] = Delflag;
 	for(int i=1;i<m;i++) KU[i]= K[i-1];
 	for(int i=0;i<m-1;i++) KD[i] = K[i+1];
@@ -658,6 +676,6 @@
 	dzU = xNew<IssmDouble>(m);
 	dzD = xNew<IssmDouble>(m);
-	dzU[0]=UNDEF;
-	dzD[m-1]=UNDEF;
+	dzU[0]=Delflag;
+	dzD[m-1]=Delflag;
 
 	for(int i=1;i<m;i++) dzU[i]= dz[i-1];
@@ -820,5 +838,7 @@
 
 		// upward longwave contribution
-		ulw = - (SB * pow(Ts,4.0)* teValue) * dt ;
+		ulw = - (SB * pow(Ts,4.0)* teValue) * dt; // - deltatest here
+		ulwrf = ulwrf - ulw/dt0;
+
 		dT_ulw = ulw / TCs;
 
@@ -875,4 +895,5 @@
 	*pEC=EC;
 	*pT=T;
+	*pulwrf=ulwrf;
 
 }  /*}}}*/
@@ -1076,5 +1097,5 @@
 
 } /*}}}*/ 
-void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pm, int aIdx, IssmDouble T_air, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble dIce, int sid){ /*{{{*/
+void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pm, int aIdx, int dsnowIdx, IssmDouble Tmean, IssmDouble T_air, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble C, IssmDouble V, IssmDouble Vmean, IssmDouble dIce, int sid){ /*{{{*/
 
 	// Adds precipitation and deposition to the model grid
@@ -1086,4 +1107,8 @@
 	   adjusts the properties of the top grid cell to account for accumulation
 	   T_air & T = Air and top grid cell temperatures [K]
+		Tmean =  average surface temperature [K]
+		Vmean =  average wind velocity [m s-1]
+		V =  wind velocity [m s-1]
+		C =  average accumulation rate [kg m-2 yr-1]
 	   dz = topgrid cell length [m]
 	   d = density of top grid gell [kg m-3]
@@ -1095,6 +1120,6 @@
 	// MAIN FUNCTION
 	// specify constants
-	const IssmDouble dSnow = 150;    // density of snow [kg m-3]
-	const IssmDouble reNew = 0.1;    // new snow grain size [mm]
+	IssmDouble dSnow = 150;    // density of snow [kg m-3]
+	const IssmDouble reNew = 0.05;    // new snow grain size [mm]
 	const IssmDouble gdnNew = 1.0;     // new snow dendricity 
 	const IssmDouble gspNew = 0.5;   // new snow sphericity 
@@ -1131,4 +1156,28 @@
 	m=*pm;
 
+	//Density of fresh snow [kg m-3]
+	switch (dsnowIdx){
+		case 0: // Default value defined above
+			break;
+
+		case 1: // Density of Antarctica snow
+			dSnow = 350;
+			break;
+
+		case 2: // Density of Greenland snow, Fausto et al., 2008
+			dSnow = 315;
+			break;
+
+		case 3: //Surface snow accumulation density from Kaspers et al., 2004, Antarctica
+			//dSnow = alpha1 + beta1*T + delta1*C + epsilon1*W
+			//     7.36x10-2  1.06x10-3  6.69x10-2  4.77x10-3 
+			dSnow=(7.36e-2 + 1.06e-3*min(Tmean,CtoK-Ttol) + 6.69e-2*C/1000 + 4.77e-3*Vmean)*1000;
+			break;
+
+		case 4: // Kuipers Munneke and others (2015), Greenland
+			dSnow = 481.0 + 4.834*(Tmean-CtoK);
+			break;
+	}
+
 	// determine initial mass
 	mInit=xNew<IssmDouble>(m);
@@ -1137,9 +1186,17 @@
 	for(int i=0;i<m;i++)massinit+=mInit[i];
 
-	if (P > 0.0+Dtol){
+	if (P > 0.0+Ptol){
 
 		if (T_air <= CtoK+Ttol){ // if snow
 
 			IssmDouble  z_snow = P/dSnow;               // depth of snow
+			IssmDouble dfall = gdnNew;
+			IssmDouble sfall = gspNew;
+			IssmDouble refall = reNew;
+
+			//From Vionnet et al., 2012 (Crocus)
+			dfall = min(max(1.29 - 0.17*V,0.20),1.0);
+			sfall = min(max(0.08*V + 0.38,0.5),0.9);
+			refall = max((0.1 + (1.0-dfall)*0.25 + (0.5-sfall)*0.1)/2.0,Gdntol);
 
 			// if snow depth is greater than specified min dz, new cell created
@@ -1151,12 +1208,12 @@
 				newcell(&W,0.0,top,m); //new cell W
 				newcell(&a,aSnow,top,m); //new cell a
-				newcell(&re,reNew,top,m); //new cell grain size
-				newcell(&gdn,gdnNew,top,m); //new cell grain dendricity
-				newcell(&gsp,gspNew,top,m); //new cell grain sphericity
+				newcell(&re,refall,top,m); //new cell grain size
+				newcell(&gdn,dfall,top,m); //new cell grain dendricity
+				newcell(&gsp,sfall,top,m); //new cell grain sphericity
 				m=m+1;
 			}
 			else { // if snow depth is less than specified minimum dz snow
 
-				IssmDouble mass = mInit[0] + P;         // grid cell adjust mass
+				mass = mInit[0] + P;         // grid cell adjust mass
 
 				dz[0] = dz[0] + P/dSnow;    // adjust grid cell depth      
@@ -1169,7 +1226,7 @@
 				// adjust a, re, gdn & gsp
 				if(aIdx>0)a[0] = (aSnow * P + a[0] * mInit[0])/mass;
-				re[0] = (reNew * P + re[0] * mInit[0])/mass;
-				gdn[0] = (gdnNew * P + gdn[0] * mInit[0])/mass;
-				gsp[0] = (gspNew * P + gsp[0] * mInit[0])/mass;
+				gdn[0] = (dfall * P + gdn[0] * mInit[0])/mass;
+				gsp[0] = (sfall * P + gsp[0] * mInit[0])/mass;
+				re[0] = max((0.1 + (1.0-gdn[0])*0.25 + (0.5-gsp[0])*0.1)/2.0,Gdntol);
 			}
 		}
@@ -1193,5 +1250,5 @@
 
 			// if d > the density of ice, d = dIce
-			if (d[0] > dIce+Dtol){
+			if (d[0] > dIce-Dtol){
 				d[0] = dIce;           // adjust d
 				dz[0] = mass / d[0];    // dz is adjusted to conserve mass
@@ -1344,8 +1401,8 @@
 		for(int i=0;i<n;i++) m[i] += dW[i];                                            // new mass [kg]
 		for(int i=0;i<n;i++) d[i] = m[i] / dz[i];                                    // density [kg m-3]   
-		for(int i=0;i<n;i++) T[i] = T[i] + (dW[i]*(LF+(CtoK - T[i])*CI)/(m[i]*CI));      // temperature [K]
+		for(int i=0;i<n;i++) if(m[i]>Wtol) T[i] = T[i] + (dW[i]*(LF+(CtoK - T[i])*CI)/(m[i]*CI));      // temperature [K]
 
 		// if pore water froze in ice then adjust d and dz thickness
-		for(int i=0;i<n;i++)if(d[i]>dIce-Dtol)d[i]=dIce;
+		for(int i=0;i<n;i++)if(d[i]> dIce-Dtol)d[i]=dIce;
 		for(int i=0;i<n;i++) dz[i]= m[i]/d[i];
 
@@ -1362,5 +1419,5 @@
 
 	// run melt algorithm if there is melt water or excess pore water
-	if ((cellsum(exsT,n) > 0.0 + Ttol) || (cellsum(exsW,n) > 0.0 + Wtol)){
+	if ((cellsum(exsT,n) > 0.0+Ttol) || (cellsum(exsW,n) > 0.0+Wtol)){
 		// _printf_(""MELT OCCURS");
 		// check to see if thermal energy exceeds energy to melt entire cell
@@ -1370,5 +1427,5 @@
 		surpT=xNew<IssmDouble>(n); for(int i=0;i<n;i++)surpT[i] = max(0.0, exsT[i]- LF/CI);
 
-		if (cellsum(surpT,n) > 0.0 + Ttol ){
+		if (cellsum(surpT,n) > 0.0+Ttol ){
 			// _printf_("T Surplus");
 			// calculate surplus energy
@@ -1376,5 +1433,5 @@
 
 			int i = 0;
-			while (cellsum(surpE,n) > 0.0 + Ttol){
+			while (cellsum(surpE,n) > 0.0+Ttol && i<n){
 				// use surplus energy to increase the temperature of lower cell
 				T[i+1] = surpE[i]/m[i+1]/CI + T[i+1];
@@ -1394,5 +1451,9 @@
 
 		// convert temperature excess to melt [kg]
-		for(int i=0;i<n;i++) M[i] = min(exsT[i] * d[i] * dz[i] * CI / LF, m[i]);  // melt
+		IssmDouble Mmax=0.0;
+		for(int i=0;i<n;i++){
+			Mmax=exsT[i] * d[i] * dz[i] * CI / LF;
+			M[i] = min(Mmax, m[i]);  // melt
+		}
 		sumM = cellsum(M,n);                                                       // total melt [kg]
 
@@ -1410,5 +1471,5 @@
 		X = 0;
 		for(int i=n-1;i>=0;i--){
-			if(M[i]>0.0+Wtol || exsW[i]>0.0+Wtol){
+			if(M[i]> 0.0+Wtol || exsW[i]> 0.0+Wtol){
 				X=i;
 				break;
@@ -1422,5 +1483,5 @@
 
 			// break loop if there is no meltwater and if depth is > mw_depth
-			if (inM == 0.0 && i > X){
+			if (fabs(inM) < Wtol && i > X){
 				break;
 			}
@@ -1454,5 +1515,5 @@
 			// some or all meltwater refreezes
 			else{
-				// change in density density and temperature
+				// change in density and temperature
 				// _printf_("MELT REFREEZE");
 				//-----------------------melt water-----------------------------
@@ -1467,5 +1528,5 @@
 				Wi = (dIce-d[i])* Swi * dz_0;            // irreducible water 
 				dW[i] = min(inM - F1, Wi-W[i]);         // change in pore water
-				if (dW[i] < 0.0-Wtol && -1*dW[i]>W[i]-Wtol ){
+				if (dW[i] < 0.0-Wtol && -1*dW[i]> W[i]-Wtol ){
 					dW[i]= -1*W[i];
 				}
@@ -1484,5 +1545,7 @@
 
 				flxDn[i+1] = inM - F1 - dW[i];     // meltwater out        
-				T[i] = T[i] + ((F1+F2)*(LF+(CtoK - T[i])*CI)/(m[i]*CI));// change in temperature
+				if (m[i]>Wtol){
+					T[i] = T[i] + ((F1+F2)*(LF+(CtoK - T[i])*CI)/(m[i]*CI));// change in temperature
+				}
 
 				// check if an ice layer forms 
@@ -1498,5 +1561,5 @@
 
 		//// GRID CELL SPACING AND MODEL DEPTH
-		for(int i=0;i<n;i++)if (W[i] < 0.0 - Wtol) _error_("negative pore water generated in melt equations");
+		for(int i=0;i<n;i++)if (W[i] < 0.0-Wtol) _error_("negative pore water generated in melt equations");
 
 		// delete all cells with zero mass
@@ -1508,7 +1571,7 @@
 
 		// delete all cells with zero mass
-		D_size=0; for(int i=0;i<n;i++)if(m[i]>0.0)D_size++; 
+		D_size=0; for(int i=0;i<n;i++)if(m[i]> (0.0+Wtol))D_size++; 
 		D=xNew<int>(D_size);
-		D_size=0; for(int i=0;i<n;i++)if(m[i]>0.0){ D[D_size] = i; D_size++;}
+		D_size=0; for(int i=0;i<n;i++)if(m[i]> (0.0+Wtol)){ D[D_size] = i; D_size++;}
 
 		celldelete(&m,n,D,D_size);
@@ -1588,5 +1651,5 @@
 
 			// set cell to 99999 for deletion
-			m[i] = -99999;
+			m[i] = Delflag;
 		}
 	}
@@ -1596,5 +1659,5 @@
          //find closest cell to merge with
 		for(int i=n-2;i>=0;i--){
-			if(m[i]!=-99999){
+			if(m[i]!=Delflag){
 				X2=i;
 				X1=n-1;
@@ -1618,11 +1681,11 @@
 
 		// set cell to 99999 for deletion
-		m[X2] = -99999;
+		m[X2] = Delflag;
 	}
 
 	// delete combined cells
-	D_size=0; for(int i=0;i<n;i++)if(m[i]!=-99999)D_size++; 
+	D_size=0; for(int i=0;i<n;i++)if(m[i]> Delflag+Wtol)D_size++; 
 	D=xNew<int>(D_size); 
-	D_size=0; for(int i=0;i<n;i++)if(m[i]!=-99999){ D[D_size] = i; D_size++;}
+	D_size=0; for(int i=0;i<n;i++)if(m[i]> Delflag+Wtol){ D[D_size] = i; D_size++;}
 
 	celldelete(&m,n,D,D_size);
@@ -1912,9 +1975,12 @@
 			case 6: // Ligtenberg and others (2011) [semi-emperical], Antarctica 
 				// common variable
-				H = exp((-60000.0/(Tmean * R)) + (42400.0/(Tmean * R))) * (C * 9.81);
+				// From literature: H = exp((-60000.0/(Tmean * R)) + (42400.0/(Tmean * R))) * (C * 9.81);
+				H = exp((-60000.0/(T[i] * R)) + (42400.0/(Tmean * R))) * (C * 9.81);
 				c0arth = 0.07 * H;
 				c1arth = 0.03 * H;
-				M0 = max(1.435 - (0.151 * log(C)),0.25);
-				M1 = max(2.366 - (0.293 * log(C)),0.25);
+				M0 = max(1.6599 - (0.1724 * log(C)),0.25);
+				M1 = max(2.0102 - (0.2458 * log(C)),0.25);
+				//M0 = max(1.435 - (0.151 * log(C)),0.25);
+				//M1 = max(2.366 - (0.293 * log(C)),0.25);
 				c0 = M0*c0arth;
 				c1 = M1*c1arth;
@@ -1923,9 +1989,12 @@
 			case 7: // Kuipers Munneke and others (2015) [semi-emperical], Greenland
 				// common variable
-				H = exp((-60000.0/(T[i] * R)) + (42400.0/(T[i] * R))) * (C * 9.81);
+				// From literature: H = exp((-60000.0/(T[i] * R)) + (42400.0/(T[i] * R))) * (C * 9.81);
+				H = exp((-60000.0/(T[i] * R)) + (42400.0/(Tmean * R))) * (C * 9.81);
 				c0arth = 0.07 * H;
 				c1arth = 0.03 * H;
-				M0 = max(1.042 - (0.0916 * log(C)),0.25);
-				M1 = max(1.734 - (0.2039 * log(C)),0.25);
+				//M0 = max(1.042 - (0.0916 * log(C)),0.25);
+				//M1 = max(1.734 - (0.2039 * log(C)),0.25);
+				M0 = max(1.6201 - (0.1450 * log(C)),0.25);
+				M1 = max(2.5577 - (0.2899 * log(C)),0.25);
 				c0 = M0*c0arth;
 				c1 = M1*c1arth;
@@ -1940,5 +2009,5 @@
 
 		// do not allow densities to exceed the density of ice
-		if(d[i] > dIce-Dtol) d[i]=dIce;
+		if(d[i] > dIce-Ptol) d[i]=dIce;
 
 		// calculate new grid cell length
@@ -2013,5 +2082,5 @@
 
 	// if V = 0 goes to infinity therfore if V = 0 change
-	if(V<0.01-Dtol)V=0.01;
+	if(V< 0.01-Dtol)V=0.01;
 
 	// calculate the Bulk Richardson Number (Ri)
@@ -2037,5 +2106,6 @@
 
 	//// Bulk-transfer coefficient
-	An =  pow(0.4,2) / pow(log(Tz/z0),2);     // Bulk-transfer coefficient
+	//An =  pow(0.4,2) / pow(log(Tz/z0),2);     // Bulk-transfer coefficient
+	An =  pow(0.4,2) / (log(Tz/z0)*log(Vz/z0));     // Bulk-transfer coefficient
 	C = An * d_air * V;             // shf & lhf common coefficient
 
Index: /issm/trunk/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
===================================================================
--- /issm/trunk/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 24313)
@@ -6,5 +6,60 @@
 #include "../../shared/shared.h"
 #include "../../toolkits/toolkits.h"
-
+#include "../modules.h"
+
+void SmbForcingx(FemModel* femmodel){/*{{{*/
+
+	// void SmbForcingx(smb,ni){
+	//    INPUT parameters: ni: working size of arrays
+	//    OUTPUT: mass-balance (m/yr ice): agd(NA)
+	bool isclimatology=false;
+	femmodel->parameters->FindParam(&isclimatology,SmbIsclimatologyEnum);
+
+	if (isclimatology){
+		int v;
+		IssmDouble time,dt,delta,starttime,finaltime;
+		int offsetend=-1;
+		IssmDouble time0, timeend, timeclim;
+
+		femmodel->parameters->FindParam(&time,TimeEnum); 
+		femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+		femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+		femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
+		
+		if (time<=starttime+dt){
+			InputDuplicatex(femmodel,SmbMassBalanceEnum,SmbMassBalanceClimateEnum);
+		}
+
+		/*Loop over all the elements of this partition*/
+		for(int i=0;i<femmodel->elements->Size();i++){
+			Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+
+			int         numvertices = element->GetNumberOfVertices();
+			IssmDouble* smb         = xNew<IssmDouble>(numvertices);
+
+			/*Recover Smb*/
+			//If this is a climatology, we need to repeat the forcing after the final time
+			Input* smb_input=element->GetInput(SmbMassBalanceClimateEnum); _assert_(smb_input);
+
+			//Get accumulation climatology value
+			offsetend=dynamic_cast<TransientInput*>(smb_input)->GetTimeInputOffset(finaltime);
+			time0=dynamic_cast<TransientInput*>(smb_input)->GetTimeByOffset(-1);
+			timeend=dynamic_cast<TransientInput*>(smb_input)->GetTimeByOffset(offsetend);
+			timeclim=time;
+			if (time>time0 & timeend>time0){
+				delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+				if (delta==0){ timeclim=timeend;}
+				else{ timeclim=time0+delta;}
+			}
+
+			element->GetInputListOnVerticesAtTime(smb,SmbMassBalanceClimateEnum,timeclim);
+
+			/*Add input to element and Free memory*/
+			element->AddInput(SmbMassBalanceEnum,smb,P1Enum);
+			xDelete<IssmDouble>(smb);
+		}
+	}
+
+}/*}}}*/
 void SmbGradientsx(FemModel* femmodel){/*{{{*/
 
@@ -41,6 +96,6 @@
 
 		/*Get material parameters :*/
-		rho_ice=element->matpar->GetMaterialParameter(MaterialsRhoIceEnum);
-		rho_water=element->matpar->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
+		rho_ice=element->FindParam(MaterialsRhoIceEnum);
+		rho_water=element->FindParam(MaterialsRhoFreshwaterEnum);
 
 		/* Get constants */
@@ -350,4 +405,13 @@
 	//    OUTPUT: mass-balance (m/yr ice): agd(NA)
 	int v;
+	bool isclimatology=false;
+	IssmDouble time,delta,starttime,finaltime;
+	int offsetend=-1;
+	IssmDouble time0, timeend, timeclim;
+
+	femmodel->parameters->FindParam(&isclimatology,SmbIsclimatologyEnum);
+	femmodel->parameters->FindParam(&time,TimeEnum); 
+	femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+	femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
 
 	/*Loop over all the elements of this partition*/
@@ -363,7 +427,55 @@
 
 		/*Recover Smb Components*/
-		element->GetInputListOnVertices(acc,SmbAccumulationEnum);
-		element->GetInputListOnVertices(evap,SmbEvaporationEnum);
-		element->GetInputListOnVertices(runoff,SmbRunoffEnum);
+		if (isclimatology){
+
+			//If this is a climatology, we need to repeat the forcing after the final time
+			Input* acc_input=element->GetInput(SmbAccumulationEnum); _assert_(acc_input);
+			Input* evap_input=element->GetInput(SmbEvaporationEnum); _assert_(evap_input);
+			Input* runoff_input=element->GetInput(SmbRunoffEnum); _assert_(runoff_input);
+
+			//Get accumulation climatology value
+			offsetend=dynamic_cast<TransientInput*>(acc_input)->GetTimeInputOffset(finaltime);
+			time0=dynamic_cast<TransientInput*>(acc_input)->GetTimeByOffset(-1);
+			timeend=dynamic_cast<TransientInput*>(acc_input)->GetTimeByOffset(offsetend);
+			timeclim=time;
+			if (time>time0 & timeend>time0){
+				delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+				if (delta==0){ timeclim=timeend;}
+				else{ timeclim=time0+delta;}
+			}
+
+			element->GetInputListOnVerticesAtTime(acc,SmbAccumulationEnum,timeclim);
+
+			//Get evaporation climatology value
+			offsetend=dynamic_cast<TransientInput*>(evap_input)->GetTimeInputOffset(finaltime);
+			time0=dynamic_cast<TransientInput*>(evap_input)->GetTimeByOffset(-1);
+			timeend=dynamic_cast<TransientInput*>(evap_input)->GetTimeByOffset(offsetend);
+			timeclim=time;
+			if (time>time0 & timeend>time0){
+				delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+				if (delta==0){ timeclim=timeend;}
+				else{ timeclim=time0+delta;}
+			}
+
+			element->GetInputListOnVerticesAtTime(evap,SmbEvaporationEnum,timeclim);
+
+			//Get runoff climatology value
+			offsetend=dynamic_cast<TransientInput*>(runoff_input)->GetTimeInputOffset(finaltime);
+			time0=dynamic_cast<TransientInput*>(runoff_input)->GetTimeByOffset(-1);
+			timeend=dynamic_cast<TransientInput*>(runoff_input)->GetTimeByOffset(offsetend);
+			timeclim=time;
+			if (time>time0 & timeend>time0){
+				delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+				if (delta==0){ timeclim=timeend;}
+				else{ timeclim=time0+delta;}
+			}
+
+			element->GetInputListOnVerticesAtTime(runoff,SmbRunoffEnum,timeclim);
+		}
+		else{
+			element->GetInputListOnVertices(acc,SmbAccumulationEnum);
+			element->GetInputListOnVertices(evap,SmbEvaporationEnum);
+			element->GetInputListOnVertices(runoff,SmbRunoffEnum);
+		}
 
 		// loop over all vertices
@@ -391,4 +503,13 @@
 	//    OUTPUT: mass-balance (m/yr ice): agd(NA)
 	int v;
+	bool isclimatology=false;
+	IssmDouble time,delta,starttime,finaltime;
+	int offsetend=-1;
+	IssmDouble time0, timeend, timeclim;
+
+	femmodel->parameters->FindParam(&isclimatology,SmbIsclimatologyEnum);
+	femmodel->parameters->FindParam(&time,TimeEnum);
+	femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
+	femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
 
 	/*Loop over all the elements of this partition*/
@@ -405,8 +526,70 @@
 
 		/*Recover Smb Components*/
-		element->GetInputListOnVertices(acc,SmbAccumulationEnum);
-		element->GetInputListOnVertices(evap,SmbEvaporationEnum);
-		element->GetInputListOnVertices(melt,SmbMeltEnum);
-		element->GetInputListOnVertices(refreeze,SmbRefreezeEnum);
+		if (isclimatology){
+
+			//If this is a climatology, we need to repeat the forcing after the final time
+			Input* acc_input=element->GetInput(SmbAccumulationEnum); _assert_(acc_input);
+			Input* evap_input=element->GetInput(SmbEvaporationEnum); _assert_(evap_input);
+			Input* melt_input=element->GetInput(SmbMeltEnum); _assert_(melt_input);
+			Input* refreeze_input=element->GetInput(SmbRefreezeEnum); _assert_(refreeze_input);
+
+			//Get accumulation climatology value
+			offsetend=dynamic_cast<TransientInput*>(acc_input)->GetTimeInputOffset(finaltime);
+			time0=dynamic_cast<TransientInput*>(acc_input)->GetTimeByOffset(-1);
+			timeend=dynamic_cast<TransientInput*>(acc_input)->GetTimeByOffset(offsetend);
+			timeclim=time;
+			if (time>time0 & timeend>time0){
+				delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+				if (delta==0){ timeclim=timeend;}
+				else{ timeclim=time0+delta;}
+			}
+
+			element->GetInputListOnVerticesAtTime(acc,SmbAccumulationEnum,timeclim);
+
+			//Get evaporation climatology value
+			offsetend=dynamic_cast<TransientInput*>(evap_input)->GetTimeInputOffset(finaltime);
+			time0=dynamic_cast<TransientInput*>(evap_input)->GetTimeByOffset(-1);
+			timeend=dynamic_cast<TransientInput*>(evap_input)->GetTimeByOffset(offsetend);
+			timeclim=time;
+			if (time>time0){
+				delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+				if (delta==0){ timeclim=timeend;}
+				else{ timeclim=time0+delta;}
+			}
+
+			element->GetInputListOnVerticesAtTime(evap,SmbEvaporationEnum,timeclim);
+
+			//Get melt climatology value
+			offsetend=dynamic_cast<TransientInput*>(melt_input)->GetTimeInputOffset(finaltime);
+			time0=dynamic_cast<TransientInput*>(melt_input)->GetTimeByOffset(-1);
+			timeend=dynamic_cast<TransientInput*>(melt_input)->GetTimeByOffset(offsetend);
+			timeclim=time;
+			if (time>time0){
+				delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+				if (delta==0){ timeclim=timeend;}
+				else{ timeclim=time0+delta;}
+			}
+
+			element->GetInputListOnVerticesAtTime(melt,SmbMeltEnum,timeclim);
+
+			//Get refreeze climatology value
+			offsetend=dynamic_cast<TransientInput*>(refreeze_input)->GetTimeInputOffset(finaltime);
+			time0=dynamic_cast<TransientInput*>(refreeze_input)->GetTimeByOffset(-1);
+			timeend=dynamic_cast<TransientInput*>(refreeze_input)->GetTimeByOffset(offsetend);
+			timeclim=time;
+			if (time>time0){
+				delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
+				if (delta==0){ timeclim=timeend;}
+				else{ timeclim=time0+delta;}
+			}
+
+			element->GetInputListOnVerticesAtTime(refreeze,SmbRefreezeEnum,timeclim);
+		}
+		else{
+			element->GetInputListOnVertices(acc,SmbAccumulationEnum);
+			element->GetInputListOnVertices(evap,SmbEvaporationEnum);
+			element->GetInputListOnVertices(melt,SmbMeltEnum);
+			element->GetInputListOnVertices(refreeze,SmbRefreezeEnum);
+		}
 
 		// loop over all vertices
@@ -427,9 +610,4 @@
 void SmbGradientsComponentsx(FemModel* femmodel){/*{{{*/
 
-	// void SurfaceMassBalancex(hd,agd,ni){
-	//    INPUT parameters: ni: working size of arrays
-	//    INPUT: surface elevation (m): hd(NA)
-	//    OUTPUT: mass-balance (m/yr ice): agd(NA)
-
 	for(int i=0;i<femmodel->elements->Size();i++){
 		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
@@ -438,2 +616,14 @@
 
 }/*}}}*/
+#ifdef _HAVE_SEMIC_
+void SmbSemicx(FemModel* femmodel){/*{{{*/
+
+	for(int i=0;i<femmodel->elements->Size();i++){
+		Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+		element->SmbSemic();
+	}
+
+}/*}}}*/
+#else
+void SmbSemicx(FemModel* femmodel){_error_("SEMIC not installed");}
+#endif //_HAVE_SEMIC_
Index: /issm/trunk/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h
===================================================================
--- /issm/trunk/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 24312)
+++ /issm/trunk/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 24313)
@@ -10,4 +10,5 @@
 /* local prototypes: */
 void SurfaceMassBalancex(FemModel* femmodel);
+void SmbForcingx(FemModel* femmodel);
 void SmbGradientsx(FemModel* femmodel);
 void SmbGradientsElax(FemModel* femmodel);
@@ -21,4 +22,6 @@
 void SmbMeltComponentsx(FemModel* femmodel);
 void SmbGradientsComponentsx(FemModel* femmodel);
+/* SEMIC: */
+void SmbSemicx(FemModel* femmodel);
 /*GEMB: */
 void       Gembx(FemModel* femmodel);
@@ -28,6 +31,6 @@
 void albedo(IssmDouble** a,int aIdx, IssmDouble* re, IssmDouble* d, IssmDouble cldFrac, IssmDouble aIce, IssmDouble aSnow, IssmDouble aValue, IssmDouble adThresh, IssmDouble* T, IssmDouble* W, IssmDouble P, IssmDouble EC, IssmDouble t0wet, IssmDouble t0dry, IssmDouble K, IssmDouble dt, IssmDouble dIce, int m, int sid);
 void shortwave(IssmDouble** pswf, int swIdx, int aIdx, IssmDouble dsw, IssmDouble as, IssmDouble* d, IssmDouble* dz, IssmDouble* re, IssmDouble dIce, int m, int sid);
-void thermo(IssmDouble* pEC, IssmDouble** T, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlw, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble teValue, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid);
-void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pm, int aIdx,IssmDouble Ta, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble dIce, int sid);
+void thermo(IssmDouble* pEC, IssmDouble** T, IssmDouble* pulwrf, IssmDouble* dz, IssmDouble* d, IssmDouble* swf, IssmDouble dlw, IssmDouble Ta, IssmDouble V, IssmDouble eAir, IssmDouble pAir, IssmDouble teValue, IssmDouble Ws, IssmDouble dt0, int m, IssmDouble Vz, IssmDouble Tz, IssmDouble thermo_scaling, IssmDouble dIce, int sid);
+void accumulation(IssmDouble** pT, IssmDouble** pdz, IssmDouble** pd, IssmDouble** pW, IssmDouble** pa, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pm, int aIdx, int dsnowIdx, IssmDouble Tmean, IssmDouble Ta, IssmDouble P, IssmDouble dzMin, IssmDouble aSnow, IssmDouble C, IssmDouble V, IssmDouble Vmean, IssmDouble dIce, int sid);
 void melt(IssmDouble* pM, IssmDouble* pR, IssmDouble* pmAdd, IssmDouble* pdz_add, IssmDouble** pT, IssmDouble** pd, IssmDouble** pdz, IssmDouble** pW, IssmDouble** pa, IssmDouble** pre, IssmDouble** pgdn, IssmDouble** pgsp, int* pn, IssmDouble dzMin, IssmDouble zMax, IssmDouble zMin, IssmDouble zTop, IssmDouble dIce, int sid);
 void densification(IssmDouble** pd,IssmDouble** pdz, IssmDouble* T, IssmDouble* re, int denIdx, IssmDouble C, IssmDouble dt, IssmDouble Tmean, IssmDouble dIce, int m, int sid);
Index: /issm/trunk/src/c/modules/SurfaceMassBalancex/run_semic.f90
===================================================================
--- /issm/trunk/src/c/modules/SurfaceMassBalancex/run_semic.f90	(revision 24313)
+++ /issm/trunk/src/c/modules/SurfaceMassBalancex/run_semic.f90	(revision 24313)
@@ -0,0 +1,185 @@
+subroutine run_semic(sf_in, rf_in, swd_in, lwd_in, wind_in, &
+      sp_in, rhoa_in, qq_in, tt_in, tsurf_out, &
+      smb_out, saccu_out, smelt_out)
+
+   use utils
+   use surface_physics
+
+   implicit none
+
+   ! declare surface physics class
+   type(surface_physics_class) :: surface
+   ! declare forcing class
+   type(forc_class) :: forc
+   ! declare validation class
+   !type(vali_class) :: vali	! validation not needed here
+
+   integer, parameter:: dp=kind(0.d0)  !< define precision (machine specific)
+   integer :: i, k, nx, nloop, ntime, year, day
+
+   ! forcing data    
+   double precision, intent(in),dimension(1,365) :: sf_in  ! snow fall rate [m/s]
+   double precision, intent(in),dimension(1,365) :: rf_in  ! rain fall rate [m/s]
+   double precision, intent(in),dimension(1,365) :: swd_in ! downwelling shortwave radiation [W/m2]
+   double precision, intent(in),dimension(1,365) :: lwd_in ! downwelling longwave radiation [W/m2]
+   double precision, intent(in),dimension(1,365) :: wind_in! surface wind speed [m/s]
+   double precision, intent(in),dimension(1,365) :: sp_in  ! surface pressure [Pa]
+   double precision, intent(in),dimension(1,365) :: rhoa_in! air density [kg/m3]
+   double precision, intent(in),dimension(1,365) :: qq_in  ! air specific humidity [kg/kg]
+   double precision, intent(in),dimension(1,365) :: tt_in  ! air temperature [K]
+
+   ! output data
+   double precision :: tsurf_out  ! Ice surface Temperature [K]
+   double precision :: smb_out  ! surface mass balance=(Accu-Melt) [m/s]
+   double precision :: saccu_out  ! accumulation [m/s]
+   double precision :: smelt_out  ! ablation [m/s]
+
+   double precision :: total_time, start, finish
+
+   ! set parameters
+   character (len=256) :: name         ! not used(?)
+   character (len=256) :: boundary(30) ! not used(?)
+   character (len=256) :: alb_scheme   
+   integer :: n_ksub    
+   double precision    :: ceff
+   double precision    :: albi
+   double precision    :: albl
+   double precision    :: alb_smax
+   double precision    :: alb_smin
+   double precision    :: hcrit
+   double precision    :: rcrit
+   double precision    :: amp
+   double precision    :: csh
+   double precision    :: clh
+   double precision    :: tmin
+   double precision    :: tmax
+   double precision    :: tstic
+   double precision    :: tsticsub
+   double precision    :: tau_a
+   double precision    :: tau_f
+   double precision    :: w_crit
+   double precision    :: mcrit
+   double precision    :: afac
+   double precision    :: tmid
+
+   nloop = 10
+   nx = 1
+   ntime = 365
+   year = 0
+
+   ! set vector length
+   surface%par%nx = nx
+
+   ! set input (forcing data)
+   allocate(forc%sf(nx,ntime))
+   allocate(forc%rf(nx,ntime))
+   allocate(forc%swd(nx,ntime))
+   allocate(forc%lwd(nx,ntime))
+   allocate(forc%wind(nx,ntime))
+   allocate(forc%sp(nx,ntime))
+   allocate(forc%rhoa(nx,ntime))
+   allocate(forc%tt(nx,ntime))
+   allocate(forc%qq(nx,ntime))
+
+!	write(*,*) sf_in
+   forc%sf(:,:) = sf_in
+   forc%rf(:,:) = rf_in
+   forc%swd(:,:) = swd_in
+   forc%lwd(:,:) = lwd_in
+   forc%wind(:,:) = wind_in
+   forc%sp(:,:) = sp_in
+   forc%rhoa(:,:) = rhoa_in
+   forc%qq(:,:) = qq_in
+   forc%tt(:,:) = tt_in
+
+   ! FIXME should be user input
+   !boundary = "" "" ""
+   surface%par%tstic = 86400.0_dp
+   surface%par%ceff= 2.0e6_dp
+   surface%par%csh = 2.0e-3_dp
+   surface%par%clh = 5.0e-4_dp
+   surface%par%alb_smax = 0.79_dp
+   surface%par%alb_smin = 0.6_dp
+   surface%par%albi = 0.41_dp
+   surface%par%albl = 0.07_dp
+   surface%par%tmin = -999_dp
+   surface%par%tmax = 273.15_dp
+   surface%par%hcrit = 0.028_dp
+   surface%par%rcrit = 0.85_dp
+   surface%par%amp = 3.0_dp
+   surface%par%alb_scheme = "None"
+   surface%par%tau_a = 0.008_dp
+   surface%par%tau_f = 0.24_dp
+   surface%par%w_crit = 15.0_dp
+   surface%par%mcrit = 6.0e-8_dp
+   surface%par%n_ksub = 3.0_dp
+   
+   ! initialize sub-daily time step tsticsub
+   surface%par%tsticsub = surface%par%tstic / dble(surface%par%n_ksub)
+
+   ! allocate necessary arrays for surface_physics module
+   call surface_alloc(surface%now,surface%par%nx)
+
+   ! initialise prognostic variables
+   surface%now%mask(:) = 2.0_dp !loi_mask(:nx)
+   surface%now%hsnow(:) = 1.0_dp
+   surface%now%hice(:)  = 0.0_dp
+   surface%now%alb(:) = 0.8_dp
+   surface%now%tsurf(:) = 260.0_dp
+   surface%now%alb_snow(:) = 0.8_dp
+   !surface%now%acc(:) = 0.0_dp
+   !surface%now%smb(:) = 0.0_dp
+   !surface%now%melt(:) = 0.0_dp
+   surface%now%qmr_res(:) = 0.0_dp
+
+   tsurf_out = 0.0_dp
+   smb_out = 0.0_dp
+   saccu_out = 0.0_dp
+   smelt_out = 0.0_dp
+
+   ! define boundary conditions (not used, here!)
+   call surface_boundary_define(surface%bnd,surface%par%boundary)
+   !call print_boundary_opt(surface%bnd)
+
+   do k=1,nloop ! re-iterate 'nloop' times
+
+   day = 1
+
+   do i=1,ntime ! loop over one year
+
+
+   ! read input for i-th day of year
+   surface%now%sf = forc%sf(1,day)
+   surface%now%rf = forc%rf(1,day)
+   surface%now%sp = forc%sp(1,day)
+   surface%now%lwd = forc%lwd(1,day)
+   surface%now%swd = forc%swd(1,day)
+   surface%now%wind = forc%wind(1,day)
+   surface%now%rhoa = forc%rhoa(1,day)
+   surface%now%t2m = forc%tt(1,day)
+   surface%now%qq = forc%qq(1,day)
+
+   ! calculate prognostic and diagnsotic variables
+   call cpu_time(start)
+   call surface_energy_and_mass_balance(surface%now,surface%par,surface%bnd,day,-1)
+   call cpu_time(finish)
+   total_time = total_time + (finish - start)
+
+   if (k==nloop) then 
+      tsurf_out=tsurf_out+surface%now%tsurf(1)*1.0_dp/365.0_dp
+      smb_out=smb_out+surface%now%smb(1)*1.0_dp/365.0_dp
+      saccu_out=saccu_out+surface%now%alb(1)*1.0_dp/365.0_dp
+      smelt_out=smelt_out+surface%now%melt(1)*1.0_dp/365.0_dp
+   endif
+   day = day + 1
+
+   end do
+
+   end do
+
+   ! de-allocate surface_physics arrays
+   call surface_dealloc(surface%now)
+
+   !write(*,*) 'total time for surface_physics:', nloop, total_time
+
+end subroutine run_semic
Index: /issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.cpp
===================================================================
--- /issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.cpp	(revision 24313)
@@ -12,5 +12,5 @@
 	/*intermediary: */
 	int      i,M,N;
-	int      configuration_type,analysisenum;
+	int      analysisenum;
 	Element *element = NULL;
 	Load    *load    = NULL;
@@ -24,13 +24,12 @@
 
 	/*Display message*/
-	if(VerboseModule()) _printf0_("   Generating matrices");
+	if(VerboseModule()) _printf0_("   Allocating matrices");
 
 	/*retrieve parameters: */
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 	femmodel->parameters->FindParam(&analysisenum,AnalysisTypeEnum);
 	Analysis* analysis = EnumToAnalysis(analysisenum);
 
 	/*Check if there are penalties*/
-	bool ispenalty = femmodel->loads->IsPenalty(configuration_type);
+	bool ispenalty = femmodel->loads->IsPenalty();
 
 	/*First, we might need to do a dry run to get kmax if penalties are employed*/
@@ -54,5 +53,5 @@
 		for (i=0;i<femmodel->loads->Size();i++){
 			load=xDynamicCast<Load*>(femmodel->loads->GetObjectByOffset(i));
-			if(load->InAnalysis(configuration_type)) load->CreateKMatrix(Kff_temp,NULL);
+			load->CreateKMatrix(Kff_temp,NULL);
 		}
 		Kff_temp->Assemble();
@@ -71,4 +70,6 @@
 		_printf0_(" (Kff stiffness matrix size: "<<M<<" x "<<N<<")\n");
 	}
+
+	if(VerboseModule()) _printf0_("   Assembling matrices\n");
 
 	/*Fill stiffness matrix and load vector from elements*/
@@ -89,8 +90,6 @@
 	for(i=0;i<femmodel->loads->Size();i++){
 		load=xDynamicCast<Load*>(femmodel->loads->GetObjectByOffset(i));
-		if(load->InAnalysis(configuration_type)){
-			load->CreateKMatrix(Kff,Kfs);
-			load->CreatePVector(pf);
-		}
+		load->CreateKMatrix(Kff,Kfs);
+		load->CreatePVector(pf);
 	}
 
@@ -99,8 +98,6 @@
 		for (i=0;i<femmodel->loads->Size();i++){
 			load=xDynamicCast<Load*>(femmodel->loads->GetObjectByOffset(i));
-			if(load->InAnalysis(configuration_type)){
-				load->PenaltyCreateKMatrix(Kff,Kfs,kmax);
-				load->PenaltyCreatePVector(pf,kmax);
-			}
+			load->PenaltyCreateKMatrix(Kff,Kfs,kmax);
+			load->PenaltyCreatePVector(pf,kmax);
 		}
 	}
Index: /issm/trunk/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.cpp
===================================================================
--- /issm/trunk/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.cpp	(revision 24312)
+++ /issm/trunk/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.cpp	(revision 24313)
@@ -20,13 +20,9 @@
 
 	for(int i=0;i<constraints->Size();i++){
+		Constraint* constraint=(Constraint*)constraints->GetObjectByOffset(i);
+		if(constraint->ObjectEnum()==SpcDynamicEnum){ 
+			((SpcDynamic*)constraint)->SetDynamicConstraint(nodes,yg_serial);
+		}
 
-		Constraint* constraint=(Constraint*)constraints->GetObjectByOffset(i);
-
-		/*Check this constraint belongs to this analysis: */
-		if(constraint->InAnalysis(configuration_type) && constraint->ObjectEnum()==SpcDynamicEnum){
-
-			((SpcDynamic*)constraint)->SetDynamicConstraint(nodes,yg_serial);
-
-		}
 	}
 
Index: sm/trunk/src/c/modules/VerticesDofx/VerticesDofx.cpp
===================================================================
--- /issm/trunk/src/c/modules/VerticesDofx/VerticesDofx.cpp	(revision 24312)
+++ 	(revision )
@@ -1,25 +1,0 @@
-/*!\file VerticesDofx
- * \brief: establish degrees of freedom for all vertices: */
-
-#include "./VerticesDofx.h"
-
-#include "../../shared/shared.h"
-#include "../../toolkits/toolkits.h"
-
-void VerticesDofx( Vertices* vertices, Parameters* parameters) {
-
-	/*intermediary: */
-	int  numberofvertices;
-
-	/*figure out how many vertices we have: */
-	numberofvertices=vertices->NumberOfVertices();
-
-	/*Ensure that only for each cpu, the partition border vertices only will be
-	 * taken into account once across the cluster. To do so, we flag all the
-	 * clone vertices: */
-	vertices->FlagClones(numberofvertices);
-
-	/*Go through all vertices and distribute pids*/
-	vertices->DistributePids(numberofvertices); 
-
-}
Index: sm/trunk/src/c/modules/VerticesDofx/VerticesDofx.h
===================================================================
--- /issm/trunk/src/c/modules/VerticesDofx/VerticesDofx.h	(revision 24312)
+++ 	(revision )
@@ -1,13 +1,0 @@
-/*!\file:  VerticesDofx.h
- * \brief header file for degree of freedoms distribution routines.
- */ 
-
-#ifndef _VERTICESDOFX_H
-#define _VERTICESDOFX_H
-
-#include "../../classes/classes.h"
-
-/* local prototypes: */
-void VerticesDofx( Vertices* vertices, Parameters* parameters);
-
-#endif  /* _VERTICESDOFX_H */
Index: /issm/trunk/src/c/modules/modules.h
===================================================================
--- /issm/trunk/src/c/modules/modules.h	(revision 24312)
+++ /issm/trunk/src/c/modules/modules.h	(revision 24313)
@@ -38,4 +38,5 @@
 #include "./Gradjx/Gradjx.h"
 #include "./GroundinglineMigrationx/GroundinglineMigrationx.h"
+#include "./FrontalForcingsx/FrontalForcingsx.h"
 #include "./InputDepthAverageAtBasex/InputDepthAverageAtBasex.h"
 #include "./InputDuplicatex/InputDuplicatex.h"
@@ -57,4 +58,5 @@
 #include "./KMLOverlayx/KMLOverlayx.h"
 #include "./Exp2Kmlx/Exp2Kmlx.h"
+#include "./KillIcebergsx/KillIcebergsx.h"
 #include "./Kml2Expx/Kml2Expx.h"
 #include "./Krigingx/Krigingx.h"
@@ -98,6 +100,9 @@
 #include "./ThicknessAcrossGradientx/ThicknessAcrossGradientx.h"
 #include "./UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h"
-#include "./VerticesDofx/VerticesDofx.h"
 #include "./VertexCoordinatesx/VertexCoordinatesx.h"
-#include "./VecMergex/VecMergex.h"
+
+#ifdef _HAVE_OCEAN_
+#include "./OceanExchangeDatax/OceanExchangeDatax.h"
 #endif
+
+#endif
Index: /issm/trunk/src/c/shared/Elements/BuddJacka.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/BuddJacka.cpp	(revision 24312)
+++ /issm/trunk/src/c/shared/Elements/BuddJacka.cpp	(revision 24313)
@@ -17,39 +17,39 @@
 
 	if(T<=-40.){
-		B=1e8*(-0.000237326134296*pow(T+50.,3)+ 0.017054655749852*pow(T+50.,2)-0.496435984007500*(T+50.)+7.670967258739796);
+		B=1e9*(-0.000031098521204*pow(T+50.,3)+ 0.002234792114381*pow(T+50.,2)-0.065051516643164*(T+50.)+1.005181071430026);
 	}
 	else if((-40.<T)  &&  (T<=-35.)){
-	 B=1e8*(-0.000237326134296*pow(T+40.,3)+ 0.009934871720961*pow(T+40.,2)-0.226540709299368*(T+40.)+4.174746859353635);
+	 B=1e9*(-0.000031098521204*pow(T+40.,3)+ 0.001301836478264*pow(T+40.,2)-0.029685230716715*(T+40.)+0.547046595232583);
 	}
 	else if((-35.<T)  &&  (T<=-30.)){
-		B=1e8*(-0.000293001369376*pow(T+35.,3)+ 0.006374979706516*pow(T+35.,2)-0.144991452161983*(T+35.)+3.260749339093782);
+		B=1e9*(-0.000038394040864*pow(T+35.,3)+ 0.000835358660205*pow(T+35.,2)-0.018999255024368*(T+35.)+0.427279038455119);
 	}
 	else if((-30.<T)  &&  (T<=-25.)){
-		B=1e8*(-0.000053702836500*pow(T+30.,3)+ 0.001979959165871*pow(T+30.,2)-0.103216757800049*(T+30.)+2.658541399774723);
+		B=1e9*(-0.000007037062330*pow(T+30.,3)+ 0.000259448047242*pow(T+30.,2)-0.013525221487131*(T+30.)+0.348367474730384);
 	}
 	else if((-25.<T)  &&  (T<=-20.)){
-		B=1e8*( 0.000006906867543*pow(T+25.,3)+ 0.001174416618375*pow(T+25.,2)-0.087444878878821*(T+25.)+2.185243735358781);
+		B=1e9*( 0.000000905055684*pow(T+25.,3)+ 0.000153892112291*pow(T+25.,2)-0.011458520689465*(T+25.)+0.286347935684521);
 	}
 	else if((-20.<T)  &&  (T<=-15.)){
-		B=1e8*(-0.000015460250554*pow(T+20.,3)+ 0.001278019631513*pow(T+20.,2)-0.075182697629382*(T+20.)+1.778243114866868);
+		B=1e9*(-0.000002025865930*pow(T+20.,3)+ 0.000167467947546*pow(T+20.,2)-0.009851720390281*(T+20.)+0.233015767004928);
 	}
 	else if((-15.<T)  &&  (T<=-10.)){
-		B=1e8*(-0.000110386100241*pow(T+15.,3)+ 0.001046115873209*pow(T+15.,2)-0.063562020105772*(T+15.)+1.432347586188582);
+		B=1e9*(-0.000014464671112*pow(T+15.,3)+ 0.000137079958603*pow(T+15.,2)-0.008328980859537*(T+15.)+0.187690630500981);
 	}
 	else if((-10.<T)  &&  (T<=-5.)){
-		B=1e8*(-0.000108595885218*pow(T+10.,3)+-0.000609675630408*pow(T+10.,2)-0.061379818891767*(T+10.)+1.126892119959808);
+		B=1e9*(-0.000014230086582*pow(T+10.,3)+-0.000079890108083*pow(T+10.,2)-0.008043031606935*(T+10.)+0.147664641279324);
 	}
 	else if((-5.<T)  &&  (T<=-2.)){
-		B=1e8*( 0.000173187986430*pow(T+5.,3)+-0.002238613908676*pow(T+5.,2)-0.075621266587187*(T+5. )+0.791176649088537);
+		B=1e9*( 0.000022694046251*pow(T+5.,3)+-0.000293341406806*pow(T+5.,2)-0.009909189181377*(T+5. )+0.103673469719891);
 	}
 	else if((-2.<T)  &&  (T<=-1.)){
-		B=1e8*( 0.000429499435151*pow(T+2.,3)+-0.000679922030808*pow(T+2.,2)-0.084376874405640*(T+2. )+0.548841399782495);
+		B=1e9*( 0.000056280347425*pow(T+2.,3)+-0.000089094990549*pow(T+2.,2)-0.011056498373441*(T+2. )+0.071918568763277);
 	}
 	else if((-1.<T)){
-		B=1e8*( 0.000429499435151*pow(T+1.,3)+ 0.000608576274646*pow(T+1.,2)-0.084448220161802*(T+1. )+0.464214102781199);
+		B=1e9*( 0.000056280347425*pow(T+1.,3)+ 0.000079746051725*pow(T+1.,2)-0.011065847312265*(T+1. )+0.060829255746712);
 	}
 	else{
 		/*FIXME: just copying previous case for now.... Felicity?*/
-		B=1e8*( 0.000429499435151*pow(T+1.,3)+ 0.000608576274646*pow(T+1.,2)-0.084448220161802*(T+1. )+0.464214102781199);
+		B=1e9*( 0.000056280347425*pow(T+1.,3)+ 0.000079746051725*pow(T+1.,2)-0.011065847312265*(T+1. )+0.060829255746712);
 	}
 
Index: /issm/trunk/src/c/shared/Elements/ComputeD18OTemperaturePrecipitationFromPD.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/ComputeD18OTemperaturePrecipitationFromPD.cpp	(revision 24312)
+++ /issm/trunk/src/c/shared/Elements/ComputeD18OTemperaturePrecipitationFromPD.cpp	(revision 24313)
@@ -6,4 +6,5 @@
 #include "./elements.h"
 #include "../Numerics/numerics.h"
+#include <cmath>
 
 void ComputeD18OTemperaturePrecipitationFromPD(IssmDouble d018,IssmDouble dpermil,bool isTemperatureScaled,
@@ -21,7 +22,7 @@
   deltaTemp = dpermil * (d018+34.83);   
 
-  for (int imonth = 0; imonth<12; imonth++){
+  for(int imonth = 0; imonth<12; imonth++){
 
-	 if (isTemperatureScaled)monthlytemperaturestmp[imonth] = TemperaturePresentday[imonth] + deltaTemp;
+	 if(isTemperatureScaled)monthlytemperaturestmp[imonth] = TemperaturePresentday[imonth] + deltaTemp;
 	 else{
 		 monthlytemperaturestmp[imonth] = TemperatureReconstructed[imonth];
Index: /issm/trunk/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp	(revision 24312)
+++ /issm/trunk/src/c/shared/Elements/ComputeDelta18oTemperaturePrecipitation.cpp	(revision 24313)
@@ -6,4 +6,5 @@
 #include "./elements.h"
 #include "../Numerics/numerics.h"
+#include <cmath>
 
 void ComputeDelta18oTemperaturePrecipitation(IssmDouble Delta18oSurfacePresent, IssmDouble Delta18oSurfaceLgm, IssmDouble Delta18oSurfaceTime,
Index: /issm/trunk/src/c/shared/Elements/ComputeMungsmTemperaturePrecipitation.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/ComputeMungsmTemperaturePrecipitation.cpp	(revision 24312)
+++ /issm/trunk/src/c/shared/Elements/ComputeMungsmTemperaturePrecipitation.cpp	(revision 24313)
@@ -7,4 +7,5 @@
 #include "./elements.h"
 #include "../Numerics/numerics.h"
+#include <cmath>
 
 void ComputeMungsmTemperaturePrecipitation(IssmDouble TdiffTime, IssmDouble PfacTime,
Index: /issm/trunk/src/c/shared/Elements/DrainageFunctionWaterfraction.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/DrainageFunctionWaterfraction.cpp	(revision 24312)
+++ /issm/trunk/src/c/shared/Elements/DrainageFunctionWaterfraction.cpp	(revision 24313)
@@ -31,8 +31,8 @@
 	/*drain only up to w0*/
 	if(dt==0.){
-		if((waterfraction>w0) && (waterfraction-Dret*yts<w0))
+		if(waterfraction>w0) 
 			return waterfraction-w0;
 		else
-			return Dret*yts;
+			return Dret;
 	}
 	else{
Index: /issm/trunk/src/c/shared/Elements/NyeCO2.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/NyeCO2.cpp	(revision 24313)
+++ /issm/trunk/src/c/shared/Elements/NyeCO2.cpp	(revision 24313)
@@ -0,0 +1,29 @@
+/* \file NyeCO2.cpp
+ * \brief figure out B of CO2 ice for a certain temperature
+ *		INPUT function B=NyeCO2(temperature)
+ *    	where rigidigty (in s^(1/n)Pa) is the flow law paramter in the flow law sigma=B*e(1/n) (Nye, p2000). 
+ */
+
+#include "../io/io.h" 
+#include <math.h> 
+#include "../Numerics/types.h"
+
+IssmDouble NyeCO2(IssmDouble temperature){
+
+	/*Coefficients*/
+	const IssmPDouble Rg      = 8.3144598;     /* J mol^-1 K^-1 */ 
+	const IssmPDouble A_const = pow(10.,10.8); /*s^-1 MPa       */ 
+	const IssmPDouble Q       = 63000.;        /*J mol^-1       */ 
+	const IssmPDouble n       = 7.;            /*Glen's exponent*/
+
+	/*Arrhenius Law*/
+	IssmDouble A = A_const *exp(-Q/(temperature*Rg));  /*s^-1 MPa   */
+	IssmDouble B = 1e6*pow(A,-1/n);                    /*s^(1/n) Pa */
+
+	/*Beyond-melting-point cases*/
+	if((temperature>200.)&&(temperature<220.)) _printf0_("CO2 ICE - POSSIBLE MELTING. Some temperature values are between 200K and 220K.\n");
+	else if(temperature>=220.) _printf0_("CO2 ICE - GUARANTEED MELTING. Some temperature values are beyond 220K.\n");
+
+	/*Return output*/
+	return B; 
+}
Index: /issm/trunk/src/c/shared/Elements/NyeH2O.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/NyeH2O.cpp	(revision 24313)
+++ /issm/trunk/src/c/shared/Elements/NyeH2O.cpp	(revision 24313)
@@ -0,0 +1,28 @@
+/* \file NyeH2O.cpp
+ * brief figure out B of H2O ice for a certain temperature
+ *		INPUT function B=NyeH2O(temperature)
+ *    	where rigidigty (in s^(1/n)Pa) is the flow law paramter in the flow law sigma=B*e(1/n) (Nye, p2000). 
+ */
+
+#include "../io/io.h"
+#include <math.h>
+#include "../Numerics/types.h"
+
+IssmDouble NyeH2O(IssmDouble temperature){
+
+	/*Coefficients*/
+	const IssmPDouble Rg      = 8.3144598; /* J mol^-1 K^-1 */
+	const IssmPDouble A_const = 9.e4;      /*s^-1 MPa       */
+	const IssmPDouble Q       = 60000.;    /*J mol^-1       */
+	const IssmPDouble n       = 3.;        /*Glen's exponent*/
+
+	/*Arrhenius Law*/
+	IssmDouble A = A_const *exp(-Q/(temperature*Rg));  /*s^-1 MPa   */
+	IssmDouble B = 1e6*pow(A,-1/n);                    /*s^(1/n) Pa */
+
+	/*Beyond-melting-point case*/
+	if(temperature>=273.15) _printf0_("H2O ICE - GUARANTEED MELTING. Some temperature values are beyond 273.15K.\n");
+
+	/*Return output*/
+	return B;
+}
Index: /issm/trunk/src/c/shared/Elements/PddSurfaceMassBalance.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 24312)
+++ /issm/trunk/src/c/shared/Elements/PddSurfaceMassBalance.cpp	(revision 24313)
@@ -7,4 +7,5 @@
 #include "./elements.h"
 #include "../Numerics/numerics.h"
+#include <cmath>
 
 IssmDouble PddSurfaceMassBalance(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec,
@@ -134,5 +135,5 @@
   snowfac=pddsnowfac0;
   icefac=pddicefac0;
-  if (pddsnowfac>=0) {
+  if (pddsnowfac>0) {
 	  if (pddsnowfac<1.65) {
 		  _printf0_("WARNING: Pdd snow factor input, " << pddsnowfac << ", results in a negative value. It will be ignored. \n");
@@ -142,7 +143,7 @@
 	  }
   }
-  if (pddicefac>=0) {
+  if (pddicefac>0) {
 	  if (pddicefac>17.22) {
-		  _printf0_("WARNING: Pdd ice factor input, " << pddsnowfac << ", results in a negative value. It will be ignored. \n");
+		  _printf0_("WARNING: Pdd ice factor input, " << pddicefac << ", results in a negative value. It will be ignored. \n");
 	  }
 	  else{
@@ -157,6 +158,7 @@
   } 
   else if(Tsum< 10){
-    snwmf = (0.15*(Tsum+1) + (2.65+snowfac-pddsnowfac0))*0.001;
-    smf = (((icefac-pddicefac0)/(Tsum+1))*pow((10.-Tsum),3) + pddicefac0)*0.001;
+	  snwmf = (0.15*(Tsum+1) + (2.65+snowfac-pddsnowfac0))*0.001;
+	  smf = (((17.22-icefac)/(pow(11,3)))*pow((10.-Tsum),3) + pddicefac0)*0.001;
+	  //JC,smf = (((icefac-pddicefac0)/(Tsum+1))*pow((10.-Tsum),3) + pddicefac0)*0.001;
   }
   else{
Index: /issm/trunk/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp	(revision 24312)
+++ /issm/trunk/src/c/shared/Elements/PddSurfaceMassBalanceSicopolis.cpp	(revision 24313)
@@ -6,4 +6,5 @@
 #include "../Numerics/numerics.h"
 #include "../Exceptions/exceptions.h"
+#include <cmath>
 
 IssmDouble PddSurfaceMassBalanceSicopolis(IssmDouble* monthlytemperatures, IssmDouble* monthlyprec,
Index: /issm/trunk/src/c/shared/Elements/PrintArrays.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/PrintArrays.cpp	(revision 24312)
+++ /issm/trunk/src/c/shared/Elements/PrintArrays.cpp	(revision 24313)
@@ -49,4 +49,16 @@
 	_printf_("\n");
 }
+void printarray_matlab(const char* filename,int* array,int lines,int cols){
+	FILE *f = fopen(filename,"w");
+	fprintf(f,"%% Matrix of size %ix%i\n",lines,cols);
+	fprintf(f,"\n");
+	fprintf(f,"A=[...\n");
+	for(int i=0;i<lines;i++){  
+		for(int j=0;j<cols;j++) fprintf(f," %i",array[i*cols+j]);
+		fprintf(f,"\n");
+	}  
+	fprintf(f,"];\n");
+	fclose(f);
+}
 void printarray(bool* array,int lines,int cols){
 	_printf_("\n");
Index: /issm/trunk/src/c/shared/Elements/elements.h
===================================================================
--- /issm/trunk/src/c/shared/Elements/elements.h	(revision 24312)
+++ /issm/trunk/src/c/shared/Elements/elements.h	(revision 24313)
@@ -13,4 +13,6 @@
 IssmDouble Paterson(IssmDouble temperature);
 IssmDouble Arrhenius(IssmDouble temperature,IssmDouble depth,IssmDouble n);
+IssmDouble NyeH2O(IssmDouble temperature);
+IssmDouble NyeCO2(IssmDouble temperature);
 IssmDouble LliboutryDuval(IssmDouble enthalpy, IssmDouble pressure, IssmDouble n, IssmDouble betaCC, IssmDouble referencetemperature, IssmDouble heatcapacity, IssmDouble latentheat);
 // IssmDouble LliboutryDuval(IssmDouble temperature, IssmDouble waterfraction, IssmDouble depth,IssmDouble n);
@@ -44,4 +46,7 @@
 IssmDouble StressIntensityIntegralWeight(IssmDouble depth, IssmDouble water_depth, IssmDouble thickness);
 
+/*Enthalphy*/
+void EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure);
+
 /*Print arrays*/
 void printarray(IssmPDouble* array,int lines,int cols=1);
@@ -49,4 +54,5 @@
 void printarray(IssmDouble* array,int lines,int cols=1);
 #endif
+void printarray_matlab(const char* filename,int* array,int lines,int cols=1);
 void printarray(int* array,int lines,int cols=1);
 void printarray(bool* array,int lines,int cols=1);
Index: /issm/trunk/src/c/shared/Enum/Enum.vim
===================================================================
--- /issm/trunk/src/c/shared/Enum/Enum.vim	(revision 24313)
+++ /issm/trunk/src/c/shared/Enum/Enum.vim	(revision 24313)
@@ -0,0 +1,1459 @@
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" ISSM specific c syntax highlighting
+"
+"   WARNING: DO NOT MODIFY THIS FILE
+"            this file has been automatically generated by Synchronize.sh
+"            Please read README for more information
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+"PETSc
+syn keyword cType Vec Mat SeqVec SeqMat
+
+"ISSM typedefs
+syn keyword cType mxArray ErrorException QuadtreeBox
+syn keyword cType IssmDouble IssmPDouble
+
+"ISSM Enums
+syn keyword cConstant ParametersSTARTEnum
+syn keyword cConstant AdolcParamEnum
+syn keyword cConstant AmrDeviatoricErrorGroupThresholdEnum
+syn keyword cConstant AmrDeviatoricErrorMaximumEnum
+syn keyword cConstant AmrDeviatoricErrorResolutionEnum
+syn keyword cConstant AmrDeviatoricErrorThresholdEnum
+syn keyword cConstant AmrErrEnum
+syn keyword cConstant AmrFieldEnum
+syn keyword cConstant AmrGradationEnum
+syn keyword cConstant AmrGroundingLineDistanceEnum
+syn keyword cConstant AmrGroundingLineResolutionEnum
+syn keyword cConstant AmrHmaxEnum
+syn keyword cConstant AmrHminEnum
+syn keyword cConstant AmrIceFrontDistanceEnum
+syn keyword cConstant AmrIceFrontResolutionEnum
+syn keyword cConstant AmrKeepMetricEnum
+syn keyword cConstant AmrLagEnum
+syn keyword cConstant AmrLevelMaxEnum
+syn keyword cConstant AmrRestartEnum
+syn keyword cConstant AmrThicknessErrorGroupThresholdEnum
+syn keyword cConstant AmrThicknessErrorMaximumEnum
+syn keyword cConstant AmrThicknessErrorResolutionEnum
+syn keyword cConstant AmrThicknessErrorThresholdEnum
+syn keyword cConstant AmrTypeEnum
+syn keyword cConstant AnalysisCounterEnum
+syn keyword cConstant AnalysisTypeEnum
+syn keyword cConstant AugmentedLagrangianREnum
+syn keyword cConstant AugmentedLagrangianRholambdaEnum
+syn keyword cConstant AugmentedLagrangianRhopEnum
+syn keyword cConstant AugmentedLagrangianRlambdaEnum
+syn keyword cConstant AugmentedLagrangianThetaEnum
+syn keyword cConstant AutodiffCbufsizeEnum
+syn keyword cConstant AutodiffDependentObjectsEnum
+syn keyword cConstant AutodiffDriverEnum
+syn keyword cConstant AutodiffFosForwardIndexEnum
+syn keyword cConstant AutodiffFosReverseIndexEnum
+syn keyword cConstant AutodiffFovForwardIndicesEnum
+syn keyword cConstant AutodiffGcTriggerMaxSizeEnum
+syn keyword cConstant AutodiffGcTriggerRatioEnum
+syn keyword cConstant AutodiffIsautodiffEnum
+syn keyword cConstant AutodiffLbufsizeEnum
+syn keyword cConstant AutodiffNumDependentsEnum
+syn keyword cConstant AutodiffNumIndependentsEnum
+syn keyword cConstant AutodiffObufsizeEnum
+syn keyword cConstant AutodiffTapeAllocEnum
+syn keyword cConstant AutodiffTbufsizeEnum
+syn keyword cConstant AutodiffXpEnum
+syn keyword cConstant BalancethicknessStabilizationEnum
+syn keyword cConstant BasalforcingsBottomplumedepthEnum
+syn keyword cConstant BasalforcingsCrustthicknessEnum
+syn keyword cConstant BasalforcingsDeepwaterElevationEnum
+syn keyword cConstant BasalforcingsDeepwaterMeltingRateEnum
+syn keyword cConstant BasalforcingsDtbgEnum
+syn keyword cConstant BasalforcingsEnum
+syn keyword cConstant BasalforcingsIsmip6AverageTfEnum
+syn keyword cConstant BasalforcingsIsmip6BasinAreaEnum
+syn keyword cConstant BasalforcingsIsmip6DeltaTEnum
+syn keyword cConstant BasalforcingsIsmip6Gamma0Enum
+syn keyword cConstant BasalforcingsIsmip6IsLocalEnum
+syn keyword cConstant BasalforcingsIsmip6NumBasinsEnum
+syn keyword cConstant BasalforcingsIsmip6TfDepthsEnum
+syn keyword cConstant BasalforcingsLowercrustheatEnum
+syn keyword cConstant BasalforcingsMantleconductivityEnum
+syn keyword cConstant BasalforcingsMeltrateFactorEnum
+syn keyword cConstant BasalforcingsNusseltEnum
+syn keyword cConstant BasalforcingsPicoAverageOverturningEnum
+syn keyword cConstant BasalforcingsPicoAverageSalinityEnum
+syn keyword cConstant BasalforcingsPicoAverageTemperatureEnum
+syn keyword cConstant BasalforcingsPicoBoxAreaEnum
+syn keyword cConstant BasalforcingsPicoFarOceansalinityEnum
+syn keyword cConstant BasalforcingsPicoFarOceantemperatureEnum
+syn keyword cConstant BasalforcingsPicoGammaTEnum
+syn keyword cConstant BasalforcingsPicoIsplumeEnum
+syn keyword cConstant BasalforcingsPicoMaxboxcountEnum
+syn keyword cConstant BasalforcingsPicoNumBasinsEnum
+syn keyword cConstant BasalforcingsPicoOverturningCoeffEnum
+syn keyword cConstant BasalforcingsPlumeradiusEnum
+syn keyword cConstant BasalforcingsPlumexEnum
+syn keyword cConstant BasalforcingsPlumeyEnum
+syn keyword cConstant BasalforcingsThresholdThicknessEnum
+syn keyword cConstant BasalforcingsTopplumedepthEnum
+syn keyword cConstant BasalforcingsUppercrustheatEnum
+syn keyword cConstant BasalforcingsUppercrustthicknessEnum
+syn keyword cConstant BasalforcingsUpperdepthMeltEnum
+syn keyword cConstant BasalforcingsUpperwaterElevationEnum
+syn keyword cConstant BasalforcingsUpperwaterMeltingRateEnum
+syn keyword cConstant CalvingCrevasseDepthEnum
+syn keyword cConstant CalvingHeightAboveFloatationEnum
+syn keyword cConstant CalvingLawEnum
+syn keyword cConstant CalvingMaxEnum
+syn keyword cConstant CalvingMinthicknessEnum
+syn keyword cConstant ConfigurationTypeEnum
+syn keyword cConstant ConstantsGEnum
+syn keyword cConstant ConstantsReferencetemperatureEnum
+syn keyword cConstant ConstantsYtsEnum
+syn keyword cConstant ControlInputSizeMEnum
+syn keyword cConstant ControlInputSizeNEnum
+syn keyword cConstant DamageC1Enum
+syn keyword cConstant DamageC2Enum
+syn keyword cConstant DamageC3Enum
+syn keyword cConstant DamageC4Enum
+syn keyword cConstant DamageEnum
+syn keyword cConstant DamageEquivStressEnum
+syn keyword cConstant DamageEvolutionNumRequestedOutputsEnum
+syn keyword cConstant DamageEvolutionRequestedOutputsEnum
+syn keyword cConstant DamageHealingEnum
+syn keyword cConstant DamageKappaEnum
+syn keyword cConstant DamageLawEnum
+syn keyword cConstant DamageMaxDamageEnum
+syn keyword cConstant DamageStabilizationEnum
+syn keyword cConstant DamageStressThresholdEnum
+syn keyword cConstant DamageStressUBoundEnum
+syn keyword cConstant DebugProfilingEnum
+syn keyword cConstant DomainDimensionEnum
+syn keyword cConstant DomainTypeEnum
+syn keyword cConstant EarthIdEnum
+syn keyword cConstant EplZigZagCounterEnum
+syn keyword cConstant EsaHElasticEnum
+syn keyword cConstant EsaHemisphereEnum
+syn keyword cConstant EsaRequestedOutputsEnum
+syn keyword cConstant EsaUElasticEnum
+syn keyword cConstant ExtrapolationVariableEnum
+syn keyword cConstant FemModelCommEnum
+syn keyword cConstant FlowequationFeFSEnum
+syn keyword cConstant FlowequationIsFSEnum
+syn keyword cConstant FlowequationIsHOEnum
+syn keyword cConstant FlowequationIsL1L2Enum
+syn keyword cConstant FlowequationIsSIAEnum
+syn keyword cConstant FlowequationIsSSAEnum
+syn keyword cConstant FrictionCouplingEnum
+syn keyword cConstant FrictionDeltaEnum
+syn keyword cConstant FrictionFEnum
+syn keyword cConstant FrictionGammaEnum
+syn keyword cConstant FrictionLawEnum
+syn keyword cConstant FrictionPseudoplasticityExponentEnum
+syn keyword cConstant FrictionThresholdSpeedEnum
+syn keyword cConstant FrictionVoidRatioEnum
+syn keyword cConstant FrontalForcingsBasinIcefrontAreaEnum
+syn keyword cConstant FrontalForcingsNumberofBasinsEnum
+syn keyword cConstant FrontalForcingsParamEnum
+syn keyword cConstant GiaCrossSectionShapeEnum
+syn keyword cConstant GroundinglineFrictionInterpolationEnum
+syn keyword cConstant GroundinglineMeltInterpolationEnum
+syn keyword cConstant GroundinglineMigrationEnum
+syn keyword cConstant HydrologyCavitySpacingEnum
+syn keyword cConstant HydrologyChannelConductivityEnum
+syn keyword cConstant HydrologyChannelSheetWidthEnum
+syn keyword cConstant HydrologyEnglacialVoidRatioEnum
+syn keyword cConstant HydrologyIschannelsEnum
+syn keyword cConstant HydrologyMeltFlagEnum
+syn keyword cConstant HydrologyModelEnum
+syn keyword cConstant HydrologyNumRequestedOutputsEnum
+syn keyword cConstant HydrologyPressureMeltCoefficientEnum
+syn keyword cConstant HydrologyRelaxationEnum
+syn keyword cConstant HydrologyRequestedOutputsEnum
+syn keyword cConstant HydrologySedimentKmaxEnum
+syn keyword cConstant HydrologyStepsPerStepEnum
+syn keyword cConstant HydrologyStorageEnum
+syn keyword cConstant HydrologydcEplColapseThicknessEnum
+syn keyword cConstant HydrologydcEplCompressibilityEnum
+syn keyword cConstant HydrologydcEplConductivityEnum
+syn keyword cConstant HydrologydcEplInitialThicknessEnum
+syn keyword cConstant HydrologydcEplMaxThicknessEnum
+syn keyword cConstant HydrologydcEplPorosityEnum
+syn keyword cConstant HydrologydcEplThickCompEnum
+syn keyword cConstant HydrologydcEplflipLockEnum
+syn keyword cConstant HydrologydcIsefficientlayerEnum
+syn keyword cConstant HydrologydcLeakageFactorEnum
+syn keyword cConstant HydrologydcMaxIterEnum
+syn keyword cConstant HydrologydcPenaltyFactorEnum
+syn keyword cConstant HydrologydcPenaltyLockEnum
+syn keyword cConstant HydrologydcRelTolEnum
+syn keyword cConstant HydrologydcSedimentCompressibilityEnum
+syn keyword cConstant HydrologydcSedimentlimitEnum
+syn keyword cConstant HydrologydcSedimentlimitFlagEnum
+syn keyword cConstant HydrologydcSedimentPorosityEnum
+syn keyword cConstant HydrologydcSedimentThicknessEnum
+syn keyword cConstant HydrologydcTransferFlagEnum
+syn keyword cConstant HydrologydcUnconfinedFlagEnum
+syn keyword cConstant HydrologydcWaterCompressibilityEnum
+syn keyword cConstant HydrologyshreveStabilizationEnum
+syn keyword cConstant IcecapToEarthCommEnum
+syn keyword cConstant IndexEnum
+syn keyword cConstant InputFileNameEnum
+syn keyword cConstant InputToDepthaverageInEnum
+syn keyword cConstant InputToDepthaverageOutEnum
+syn keyword cConstant InputToExtrudeEnum
+syn keyword cConstant InputToL2ProjectEnum
+syn keyword cConstant InputToSmoothEnum
+syn keyword cConstant InversionAlgorithmEnum
+syn keyword cConstant InversionControlParametersEnum
+syn keyword cConstant InversionControlScalingFactorsEnum
+syn keyword cConstant InversionCostFunctionsEnum
+syn keyword cConstant InversionDxminEnum
+syn keyword cConstant InversionGatolEnum
+syn keyword cConstant InversionGradientScalingEnum
+syn keyword cConstant InversionGrtolEnum
+syn keyword cConstant InversionGttolEnum
+syn keyword cConstant InversionIncompleteAdjointEnum
+syn keyword cConstant InversionIscontrolEnum
+syn keyword cConstant InversionMaxiterEnum
+syn keyword cConstant InversionMaxiterPerStepEnum
+syn keyword cConstant InversionMaxstepsEnum
+syn keyword cConstant InversionNstepsEnum
+syn keyword cConstant InversionNumControlParametersEnum
+syn keyword cConstant InversionNumCostFunctionsEnum
+syn keyword cConstant InversionStepThresholdEnum
+syn keyword cConstant InversionTypeEnum
+syn keyword cConstant LevelsetKillIcebergsEnum
+syn keyword cConstant LevelsetReinitFrequencyEnum
+syn keyword cConstant LevelsetStabilizationEnum
+syn keyword cConstant LockFileNameEnum
+syn keyword cConstant LoveAllowLayerDeletionEnum
+syn keyword cConstant LoveForcingTypeEnum
+syn keyword cConstant LoveFrequenciesEnum
+syn keyword cConstant LoveG0Enum
+syn keyword cConstant LoveKernelsEnum
+syn keyword cConstant LoveMu0Enum
+syn keyword cConstant LoveNfreqEnum
+syn keyword cConstant LoveR0Enum
+syn keyword cConstant LoveShNmaxEnum
+syn keyword cConstant LoveShNminEnum
+syn keyword cConstant MassFluxSegmentsEnum
+syn keyword cConstant MassFluxSegmentsPresentEnum
+syn keyword cConstant MasstransportHydrostaticAdjustmentEnum
+syn keyword cConstant MasstransportIsfreesurfaceEnum
+syn keyword cConstant MasstransportMinThicknessEnum
+syn keyword cConstant MasstransportNumRequestedOutputsEnum
+syn keyword cConstant MasstransportPenaltyFactorEnum
+syn keyword cConstant MasstransportRequestedOutputsEnum
+syn keyword cConstant MasstransportStabilizationEnum
+syn keyword cConstant MaterialsBetaEnum
+syn keyword cConstant MaterialsEarthDensityEnum
+syn keyword cConstant MaterialsEffectiveconductivityAveragingEnum
+syn keyword cConstant MaterialsHeatcapacityEnum
+syn keyword cConstant MaterialsLatentheatEnum
+syn keyword cConstant MaterialsLithosphereDensityEnum
+syn keyword cConstant MaterialsLithosphereShearModulusEnum
+syn keyword cConstant MaterialsMantleDensityEnum
+syn keyword cConstant MaterialsMantleShearModulusEnum
+syn keyword cConstant MaterialsMeltingpointEnum
+syn keyword cConstant MaterialsMixedLayerCapacityEnum
+syn keyword cConstant MaterialsMuWaterEnum
+syn keyword cConstant MaterialsRheologyLawEnum
+syn keyword cConstant MaterialsRhoFreshwaterEnum
+syn keyword cConstant MaterialsRhoIceEnum
+syn keyword cConstant MaterialsRhoSeawaterEnum
+syn keyword cConstant MaterialsTemperateiceconductivityEnum
+syn keyword cConstant MaterialsThermalExchangeVelocityEnum
+syn keyword cConstant MaterialsThermalconductivityEnum
+syn keyword cConstant MeltingOffsetEnum
+syn keyword cConstant MeshAverageVertexConnectivityEnum
+syn keyword cConstant MeshElementtypeEnum
+syn keyword cConstant MeshNumberoflayersEnum
+syn keyword cConstant MeshNumberofverticesEnum
+syn keyword cConstant ModelIdEnum
+syn keyword cConstant NodesEnum
+syn keyword cConstant NumModelsEnum
+syn keyword cConstant OceanGridNxEnum
+syn keyword cConstant OceanGridNyEnum
+syn keyword cConstant OceanGridXEnum
+syn keyword cConstant OceanGridYEnum
+syn keyword cConstant OutputBufferPointerEnum
+syn keyword cConstant OutputBufferSizePointerEnum
+syn keyword cConstant OutputFileNameEnum
+syn keyword cConstant OutputFilePointerEnum
+syn keyword cConstant OutputdefinitionEnum
+syn keyword cConstant ParamEnum
+syn keyword cConstant ParametersEnum
+syn keyword cConstant QmuErrNameEnum
+syn keyword cConstant QmuInNameEnum
+syn keyword cConstant QmuIsdakotaEnum
+syn keyword cConstant QmuNumberofpartitionsEnum
+syn keyword cConstant QmuOutNameEnum
+syn keyword cConstant QmuEpartitionEnum
+syn keyword cConstant QmuVpartitionEnum
+syn keyword cConstant QmuResponsedescriptorsEnum
+syn keyword cConstant QmuVariableDescriptorsEnum
+syn keyword cConstant RestartFileNameEnum
+syn keyword cConstant ResultsEnum
+syn keyword cConstant RootPathEnum
+syn keyword cConstant SaveResultsEnum
+syn keyword cConstant SealevelEustaticEnum
+syn keyword cConstant SealevelriseAbstolEnum
+syn keyword cConstant SealevelriseAngularVelocityEnum
+syn keyword cConstant SealevelriseElasticEnum
+syn keyword cConstant SealevelriseEquatorialMoiEnum
+syn keyword cConstant SealevelriseFluidLoveEnum
+syn keyword cConstant SealevelriseGElasticEnum
+syn keyword cConstant SealevelriseGeodeticEnum
+syn keyword cConstant SealevelriseGeodeticRunFrequencyEnum
+syn keyword cConstant SealevelriseHElasticEnum
+syn keyword cConstant SealevelriseHorizEnum
+syn keyword cConstant SealevelriseLoopIncrementEnum
+syn keyword cConstant SealevelriseMaxiterEnum
+syn keyword cConstant SealevelriseOceanAreaScalingEnum
+syn keyword cConstant SealevelrisePolarMoiEnum
+syn keyword cConstant SealevelriseReltolEnum
+syn keyword cConstant SealevelriseRequestedOutputsEnum
+syn keyword cConstant SealevelriseRigidEnum
+syn keyword cConstant SealevelriseRotationEnum
+syn keyword cConstant SealevelriseRunCountEnum
+syn keyword cConstant SealevelriseTidalLoveHEnum
+syn keyword cConstant SealevelriseTidalLoveKEnum
+syn keyword cConstant SealevelriseTransitionsEnum
+syn keyword cConstant SealevelriseUElasticEnum
+syn keyword cConstant SettingsIoGatherEnum
+syn keyword cConstant SettingsNumResultsOnNodesEnum
+syn keyword cConstant SettingsOutputFrequencyEnum
+syn keyword cConstant SettingsRecordingFrequencyEnum
+syn keyword cConstant SettingsResultsOnNodesEnum
+syn keyword cConstant SettingsSbCouplingFrequencyEnum
+syn keyword cConstant SettingsSolverResidueThresholdEnum
+syn keyword cConstant SettingsWaitonlockEnum
+syn keyword cConstant SmbAIceEnum
+syn keyword cConstant SmbAIdxEnum
+syn keyword cConstant SmbASnowEnum
+syn keyword cConstant SmbAccualtiEnum
+syn keyword cConstant SmbAccugradEnum
+syn keyword cConstant SmbAccurefEnum
+syn keyword cConstant SmbAdThreshEnum
+syn keyword cConstant SmbDesfacEnum
+syn keyword cConstant SmbDpermilEnum
+syn keyword cConstant SmbDsnowIdxEnum
+syn keyword cConstant SmbCldFracEnum
+syn keyword cConstant SmbDelta18oEnum
+syn keyword cConstant SmbDelta18oSurfaceEnum
+syn keyword cConstant SmbDenIdxEnum
+syn keyword cConstant SmbDtEnum
+syn keyword cConstant SmbEnum
+syn keyword cConstant SmbFEnum
+syn keyword cConstant SmbInitDensityScalingEnum
+syn keyword cConstant SmbIsaccumulationEnum
+syn keyword cConstant SmbIsalbedoEnum
+syn keyword cConstant SmbIsclimatologyEnum
+syn keyword cConstant SmbIsd18opdEnum
+syn keyword cConstant SmbIsdelta18oEnum
+syn keyword cConstant SmbIsdensificationEnum
+syn keyword cConstant SmbIsfirnwarmingEnum
+syn keyword cConstant SmbIsgraingrowthEnum
+syn keyword cConstant SmbIsmeltEnum
+syn keyword cConstant SmbIsmungsmEnum
+syn keyword cConstant SmbIsprecipscaledEnum
+syn keyword cConstant SmbIssetpddfacEnum
+syn keyword cConstant SmbIsshortwaveEnum
+syn keyword cConstant SmbIstemperaturescaledEnum
+syn keyword cConstant SmbIsthermalEnum
+syn keyword cConstant SmbIsturbulentfluxEnum
+syn keyword cConstant SmbKEnum
+syn keyword cConstant SmbNumRequestedOutputsEnum
+syn keyword cConstant SmbPfacEnum
+syn keyword cConstant SmbRdlEnum
+syn keyword cConstant SmbRequestedOutputsEnum
+syn keyword cConstant SmbRlapsEnum
+syn keyword cConstant SmbRlapslgmEnum
+syn keyword cConstant SmbRunoffaltiEnum
+syn keyword cConstant SmbRunoffgradEnum
+syn keyword cConstant SmbRunoffrefEnum
+syn keyword cConstant SmbSealevEnum
+syn keyword cConstant SmbStepsPerStepEnum
+syn keyword cConstant SmbSwIdxEnum
+syn keyword cConstant SmbT0dryEnum
+syn keyword cConstant SmbT0wetEnum
+syn keyword cConstant SmbTdiffEnum
+syn keyword cConstant SmbThermoDeltaTScalingEnum
+syn keyword cConstant SmoothThicknessMultiplierEnum
+syn keyword cConstant SolutionTypeEnum
+syn keyword cConstant SteadystateMaxiterEnum
+syn keyword cConstant SteadystateNumRequestedOutputsEnum
+syn keyword cConstant SteadystateReltolEnum
+syn keyword cConstant SteadystateRequestedOutputsEnum
+syn keyword cConstant StepEnum
+syn keyword cConstant StressbalanceAbstolEnum
+syn keyword cConstant StressbalanceFSreconditioningEnum
+syn keyword cConstant StressbalanceIsnewtonEnum
+syn keyword cConstant StressbalanceMaxiterEnum
+syn keyword cConstant StressbalanceNumRequestedOutputsEnum
+syn keyword cConstant StressbalancePenaltyFactorEnum
+syn keyword cConstant StressbalanceReltolEnum
+syn keyword cConstant StressbalanceRequestedOutputsEnum
+syn keyword cConstant StressbalanceRestolEnum
+syn keyword cConstant StressbalanceRiftPenaltyThresholdEnum
+syn keyword cConstant StressbalanceShelfDampeningEnum
+syn keyword cConstant ThermalIsdrainicecolumnEnum
+syn keyword cConstant ThermalIsdynamicbasalspcEnum
+syn keyword cConstant ThermalIsenthalpyEnum
+syn keyword cConstant ThermalMaxiterEnum
+syn keyword cConstant ThermalNumRequestedOutputsEnum
+syn keyword cConstant ThermalPenaltyFactorEnum
+syn keyword cConstant ThermalPenaltyLockEnum
+syn keyword cConstant ThermalPenaltyThresholdEnum
+syn keyword cConstant ThermalReltolEnum
+syn keyword cConstant ThermalRequestedOutputsEnum
+syn keyword cConstant ThermalStabilizationEnum
+syn keyword cConstant ThermalWatercolumnUpperlimitEnum
+syn keyword cConstant TimeEnum
+syn keyword cConstant TimesteppingCflCoefficientEnum
+syn keyword cConstant TimesteppingCouplingTimeEnum
+syn keyword cConstant TimesteppingFinalTimeEnum
+syn keyword cConstant TimesteppingInterpForcingsEnum
+syn keyword cConstant TimesteppingStartTimeEnum
+syn keyword cConstant TimesteppingTimeStepEnum
+syn keyword cConstant TimesteppingTimeStepMaxEnum
+syn keyword cConstant TimesteppingTimeStepMinEnum
+syn keyword cConstant TimesteppingTypeEnum
+syn keyword cConstant ToMITgcmCommEnum
+syn keyword cConstant ToolkitsFileNameEnum
+syn keyword cConstant ToolkitsOptionsAnalysesEnum
+syn keyword cConstant ToolkitsOptionsStringsEnum
+syn keyword cConstant ToolkitsTypesEnum
+syn keyword cConstant TransientAmrFrequencyEnum
+syn keyword cConstant TransientIscouplerEnum
+syn keyword cConstant TransientIsdamageevolutionEnum
+syn keyword cConstant TransientIsesaEnum
+syn keyword cConstant TransientIsgiaEnum
+syn keyword cConstant TransientIsgroundinglineEnum
+syn keyword cConstant TransientIshydrologyEnum
+syn keyword cConstant TransientIsmasstransportEnum
+syn keyword cConstant TransientIsmovingfrontEnum
+syn keyword cConstant TransientIsoceancouplingEnum
+syn keyword cConstant TransientIsslrEnum
+syn keyword cConstant TransientIssmbEnum
+syn keyword cConstant TransientIsstressbalanceEnum
+syn keyword cConstant TransientIsthermalEnum
+syn keyword cConstant TransientNumRequestedOutputsEnum
+syn keyword cConstant TransientRequestedOutputsEnum
+syn keyword cConstant VelocityEnum
+syn keyword cConstant WorldCommEnum
+syn keyword cConstant ParametersENDEnum
+syn keyword cConstant InputsSTARTEnum
+syn keyword cConstant AdjointEnum
+syn keyword cConstant AdjointpEnum
+syn keyword cConstant AdjointxEnum
+syn keyword cConstant AdjointyEnum
+syn keyword cConstant AdjointzEnum
+syn keyword cConstant AirEnum
+syn keyword cConstant ApproximationEnum
+syn keyword cConstant BalancethicknessMisfitEnum
+syn keyword cConstant BalancethicknessOmega0Enum
+syn keyword cConstant BalancethicknessOmegaEnum
+syn keyword cConstant BalancethicknessThickeningRateEnum
+syn keyword cConstant BasalCrevasseEnum
+syn keyword cConstant BasalforcingsFloatingiceMeltingRateEnum
+syn keyword cConstant BasalforcingsGeothermalfluxEnum
+syn keyword cConstant BasalforcingsGroundediceMeltingRateEnum
+syn keyword cConstant BasalforcingsIsmip6BasinIdEnum
+syn keyword cConstant BasalforcingsIsmip6TfEnum
+syn keyword cConstant BasalforcingsIsmip6TfShelfEnum
+syn keyword cConstant BasalforcingsIsmip6MeltAnomalyEnum
+syn keyword cConstant BasalforcingsOceanSalinityEnum
+syn keyword cConstant BasalforcingsOceanTempEnum
+syn keyword cConstant BasalforcingsPicoBasinIdEnum
+syn keyword cConstant BasalforcingsPicoBoxIdEnum
+syn keyword cConstant BasalforcingsPicoSubShelfOceanOverturningEnum
+syn keyword cConstant BasalforcingsPicoSubShelfOceanSalinityEnum
+syn keyword cConstant BasalforcingsPicoSubShelfOceanTempEnum
+syn keyword cConstant BasalStressxEnum
+syn keyword cConstant BasalStressyEnum
+syn keyword cConstant BasalStressEnum
+syn keyword cConstant BaseEnum
+syn keyword cConstant BaseSlopeXEnum
+syn keyword cConstant BaseSlopeYEnum
+syn keyword cConstant BedEnum
+syn keyword cConstant BedSlopeXEnum
+syn keyword cConstant BedSlopeYEnum
+syn keyword cConstant CalvingCalvingrateEnum
+syn keyword cConstant CalvingHabFractionEnum
+syn keyword cConstant CalvingMeltingrateEnum
+syn keyword cConstant CalvingStressThresholdFloatingiceEnum
+syn keyword cConstant CalvingStressThresholdGroundediceEnum
+syn keyword cConstant CalvinglevermannCoeffEnum
+syn keyword cConstant CalvingratexAverageEnum
+syn keyword cConstant CalvingratexEnum
+syn keyword cConstant CalvingrateyAverageEnum
+syn keyword cConstant CalvingrateyEnum
+syn keyword cConstant CalvingFluxLevelsetEnum
+syn keyword cConstant CalvingMeltingFluxLevelsetEnum
+syn keyword cConstant ConvergedEnum
+syn keyword cConstant CrevasseDepthEnum
+syn keyword cConstant DamageDEnum
+syn keyword cConstant DamageDbarEnum
+syn keyword cConstant DamageFEnum
+syn keyword cConstant DegreeOfChannelizationEnum
+syn keyword cConstant DepthBelowSurfaceEnum
+syn keyword cConstant DeviatoricStresseffectiveEnum
+syn keyword cConstant DeviatoricStressxxEnum
+syn keyword cConstant DeviatoricStressxyEnum
+syn keyword cConstant DeviatoricStressxzEnum
+syn keyword cConstant DeviatoricStressyyEnum
+syn keyword cConstant DeviatoricStressyzEnum
+syn keyword cConstant DeviatoricStresszzEnum
+syn keyword cConstant DeviatoricStress1Enum
+syn keyword cConstant DeviatoricStress2Enum
+syn keyword cConstant DistanceToCalvingfrontEnum
+syn keyword cConstant DistanceToGroundinglineEnum
+syn keyword cConstant Domain2DhorizontalEnum
+syn keyword cConstant Domain2DverticalEnum
+syn keyword cConstant Domain3DEnum
+syn keyword cConstant DragCoefficientAbsGradientEnum
+syn keyword cConstant DrivingStressXEnum
+syn keyword cConstant DrivingStressYEnum
+syn keyword cConstant EffectivePressureEnum
+syn keyword cConstant EffectivePressureSubstepEnum
+syn keyword cConstant EffectivePressureTransientEnum
+syn keyword cConstant EnthalpyEnum
+syn keyword cConstant EnthalpyPicardEnum
+syn keyword cConstant EplHeadEnum
+syn keyword cConstant EplHeadOldEnum
+syn keyword cConstant EplHeadSlopeXEnum
+syn keyword cConstant EplHeadSlopeYEnum
+syn keyword cConstant EplHeadSubstepEnum
+syn keyword cConstant EplHeadTransientEnum
+syn keyword cConstant EsaDeltathicknessEnum
+syn keyword cConstant EsaEmotionEnum
+syn keyword cConstant EsaNmotionEnum
+syn keyword cConstant EsaRotationrateEnum
+syn keyword cConstant EsaStrainratexxEnum
+syn keyword cConstant EsaStrainratexyEnum
+syn keyword cConstant EsaStrainrateyyEnum
+syn keyword cConstant EsaUmotionEnum
+syn keyword cConstant EsaXmotionEnum
+syn keyword cConstant EsaYmotionEnum
+syn keyword cConstant EtaDiffEnum
+syn keyword cConstant FlowequationBorderFSEnum
+syn keyword cConstant FrictionAsEnum
+syn keyword cConstant FrictionCEnum
+syn keyword cConstant FrictionCmaxEnum
+syn keyword cConstant FrictionCoefficientEnum
+syn keyword cConstant FrictionCoefficientcoulombEnum
+syn keyword cConstant FrictionEffectivePressureEnum
+syn keyword cConstant FrictionMEnum
+syn keyword cConstant FrictionPEnum
+syn keyword cConstant FrictionPressureAdjustedTemperatureEnum
+syn keyword cConstant FrictionQEnum
+syn keyword cConstant FrictionSedimentCompressibilityCoefficientEnum
+syn keyword cConstant FrictionTillFrictionAngleEnum
+syn keyword cConstant FrictionWaterLayerEnum
+syn keyword cConstant FrictionfEnum
+syn keyword cConstant FrontalForcingsBasinIdEnum
+syn keyword cConstant FrontalForcingsSubglacialDischargeEnum
+syn keyword cConstant FrontalForcingsThermalForcingEnum
+syn keyword cConstant GeometryHydrostaticRatioEnum
+syn keyword cConstant GiaLithosphereThicknessEnum
+syn keyword cConstant GiaMantleViscosityEnum
+syn keyword cConstant GiaWEnum
+syn keyword cConstant GiadWdtEnum
+syn keyword cConstant GradientEnum
+syn keyword cConstant GroundinglineHeightEnum
+syn keyword cConstant HydraulicPotentialEnum
+syn keyword cConstant HydraulicPotentialOldEnum
+syn keyword cConstant HydrologyBasalFluxEnum
+syn keyword cConstant HydrologyBumpHeightEnum
+syn keyword cConstant HydrologyBumpSpacingEnum
+syn keyword cConstant HydrologydcBasalMoulinInputEnum
+syn keyword cConstant HydrologydcEplThicknessEnum
+syn keyword cConstant HydrologydcEplThicknessOldEnum
+syn keyword cConstant HydrologydcEplThicknessSubstepEnum
+syn keyword cConstant HydrologydcEplThicknessTransientEnum
+syn keyword cConstant HydrologydcMaskEplactiveEltEnum
+syn keyword cConstant HydrologydcMaskEplactiveNodeEnum
+syn keyword cConstant HydrologydcMaskThawedEltEnum
+syn keyword cConstant HydrologydcMaskThawedNodeEnum
+syn keyword cConstant HydrologydcSedimentTransmitivityEnum
+syn keyword cConstant HydrologyDrainageRateEnum
+syn keyword cConstant HydrologyEnglacialInputEnum
+syn keyword cConstant HydrologyGapHeightEnum
+syn keyword cConstant HydrologyHeadEnum
+syn keyword cConstant HydrologyHeadOldEnum
+syn keyword cConstant HydrologyMoulinInputEnum
+syn keyword cConstant HydrologyNeumannfluxEnum
+syn keyword cConstant HydrologyReynoldsEnum
+syn keyword cConstant HydrologySheetConductivityEnum
+syn keyword cConstant HydrologySheetThicknessEnum
+syn keyword cConstant HydrologySheetThicknessOldEnum
+syn keyword cConstant HydrologyWatercolumnMaxEnum
+syn keyword cConstant HydrologyWaterVxEnum
+syn keyword cConstant HydrologyWaterVyEnum
+syn keyword cConstant IceEnum
+syn keyword cConstant IceMaskNodeActivationEnum
+syn keyword cConstant InputEnum
+syn keyword cConstant InversionCostFunctionsCoefficientsEnum
+syn keyword cConstant InversionSurfaceObsEnum
+syn keyword cConstant InversionThicknessObsEnum
+syn keyword cConstant InversionVelObsEnum
+syn keyword cConstant InversionVxObsEnum
+syn keyword cConstant InversionVyObsEnum
+syn keyword cConstant LevelsetfunctionSlopeXEnum
+syn keyword cConstant LevelsetfunctionSlopeYEnum
+syn keyword cConstant LoadingforceXEnum
+syn keyword cConstant LoadingforceYEnum
+syn keyword cConstant LoadingforceZEnum
+syn keyword cConstant MaskGroundediceLevelsetEnum
+syn keyword cConstant MaskIceLevelsetEnum
+syn keyword cConstant MaskLandLevelsetEnum
+syn keyword cConstant MaskOceanLevelsetEnum
+syn keyword cConstant MasstransportSpcthicknessEnum
+syn keyword cConstant MaterialsRheologyBEnum
+syn keyword cConstant MaterialsRheologyBbarEnum
+syn keyword cConstant MaterialsRheologyEEnum
+syn keyword cConstant MaterialsRheologyEbarEnum
+syn keyword cConstant MaterialsRheologyEcEnum
+syn keyword cConstant MaterialsRheologyEcbarEnum
+syn keyword cConstant MaterialsRheologyEsEnum
+syn keyword cConstant MaterialsRheologyEsbarEnum
+syn keyword cConstant MaterialsRheologyNEnum
+syn keyword cConstant MeshScaleFactorEnum
+syn keyword cConstant MeshVertexonbaseEnum
+syn keyword cConstant MeshVertexonboundaryEnum
+syn keyword cConstant MeshVertexonsurfaceEnum
+syn keyword cConstant MisfitEnum
+syn keyword cConstant NeumannfluxEnum
+syn keyword cConstant NewDamageEnum
+syn keyword cConstant NodeEnum
+syn keyword cConstant OmegaAbsGradientEnum
+syn keyword cConstant P0Enum
+syn keyword cConstant P1Enum
+syn keyword cConstant PressureEnum
+syn keyword cConstant RadarEnum
+syn keyword cConstant RadarAttenuationMacGregorEnum
+syn keyword cConstant RadarAttenuationWolffEnum
+syn keyword cConstant RadarIcePeriodEnum
+syn keyword cConstant RadarPowerMacGregorEnum
+syn keyword cConstant RadarPowerWolffEnum
+syn keyword cConstant RheologyBAbsGradientEnum
+syn keyword cConstant RheologyBInitialguessEnum
+syn keyword cConstant RheologyBInitialguessMisfitEnum
+syn keyword cConstant RheologyBbarAbsGradientEnum
+syn keyword cConstant SealevelEnum
+syn keyword cConstant SealevelEustaticMaskEnum
+syn keyword cConstant SealevelEustaticOceanMaskEnum
+syn keyword cConstant SealevelNEsaEnum
+syn keyword cConstant SealevelNEsaRateEnum
+syn keyword cConstant SealevelNGiaEnum
+syn keyword cConstant SealevelNGiaRateEnum
+syn keyword cConstant SealevelRSLEnum
+syn keyword cConstant SealevelRSLEustaticEnum
+syn keyword cConstant SealevelRSLEustaticRateEnum
+syn keyword cConstant SealevelRSLRateEnum
+syn keyword cConstant SealevelUEastEsaEnum
+syn keyword cConstant SealevelUEsaEnum
+syn keyword cConstant SealevelUEsaRateEnum
+syn keyword cConstant SealevelUGiaEnum
+syn keyword cConstant SealevelUGiaRateEnum
+syn keyword cConstant SealevelUNorthEsaEnum
+syn keyword cConstant SealevelriseCumDeltathicknessEnum
+syn keyword cConstant SealevelriseDeltathicknessEnum
+syn keyword cConstant SealevelriseSpcthicknessEnum
+syn keyword cConstant SealevelriseStericRateEnum
+syn keyword cConstant SealevelriseHydroRateEnum
+syn keyword cConstant SedimentHeadEnum
+syn keyword cConstant SedimentHeadOldEnum
+syn keyword cConstant SedimentHeadSubstepEnum
+syn keyword cConstant SedimentHeadTransientEnum
+syn keyword cConstant SedimentHeadResidualEnum
+syn keyword cConstant SedimentHeadStackedEnum
+syn keyword cConstant SigmaNNEnum
+syn keyword cConstant SigmaVMEnum
+syn keyword cConstant SmbAEnum
+syn keyword cConstant SmbAValueEnum
+syn keyword cConstant SmbAccumulationEnum
+syn keyword cConstant SmbAiniEnum
+syn keyword cConstant SmbBMaxEnum
+syn keyword cConstant SmbBMinEnum
+syn keyword cConstant SmbBNegEnum
+syn keyword cConstant SmbBPosEnum
+syn keyword cConstant SmbCEnum
+syn keyword cConstant SmbDEnum
+syn keyword cConstant SmbDailyairdensityEnum
+syn keyword cConstant SmbDailyairhumidityEnum
+syn keyword cConstant SmbDailydlradiationEnum
+syn keyword cConstant SmbDailydsradiationEnum
+syn keyword cConstant SmbDailypressureEnum
+syn keyword cConstant SmbDailyrainfallEnum
+syn keyword cConstant SmbDailysnowfallEnum
+syn keyword cConstant SmbDailytemperatureEnum
+syn keyword cConstant SmbDailywindspeedEnum
+syn keyword cConstant SmbDiniEnum
+syn keyword cConstant SmbDlwrfEnum
+syn keyword cConstant SmbDswrfEnum
+syn keyword cConstant SmbDzAddEnum
+syn keyword cConstant SmbDzEnum
+syn keyword cConstant SmbDzMinEnum
+syn keyword cConstant SmbDzTopEnum
+syn keyword cConstant SmbDziniEnum
+syn keyword cConstant SmbEAirEnum
+syn keyword cConstant SmbECEnum
+syn keyword cConstant SmbECiniEnum
+syn keyword cConstant SmbElaEnum
+syn keyword cConstant SmbEvaporationEnum
+syn keyword cConstant SmbFACEnum
+syn keyword cConstant SmbGdnEnum
+syn keyword cConstant SmbGdniniEnum
+syn keyword cConstant SmbGspEnum
+syn keyword cConstant SmbGspiniEnum
+syn keyword cConstant SmbHrefEnum
+syn keyword cConstant SmbIsInitializedEnum
+syn keyword cConstant SmbMAddEnum
+syn keyword cConstant SmbMassBalanceClimateEnum
+syn keyword cConstant SmbMassBalanceEnum
+syn keyword cConstant SmbMassBalanceSubstepEnum
+syn keyword cConstant SmbMassBalanceTransientEnum
+syn keyword cConstant SmbMeanLHFEnum
+syn keyword cConstant SmbMeanSHFEnum
+syn keyword cConstant SmbMeanULWEnum
+syn keyword cConstant SmbMeltEnum
+syn keyword cConstant SmbMonthlytemperaturesEnum
+syn keyword cConstant SmbNetLWEnum
+syn keyword cConstant SmbNetSWEnum
+syn keyword cConstant SmbPAirEnum
+syn keyword cConstant SmbPEnum
+syn keyword cConstant SmbPddfacIceEnum
+syn keyword cConstant SmbPddfacSnowEnum
+syn keyword cConstant SmbPrecipitationEnum
+syn keyword cConstant SmbPrecipitationsAnomalyEnum
+syn keyword cConstant SmbPrecipitationsLgmEnum
+syn keyword cConstant SmbPrecipitationsPresentdayEnum
+syn keyword cConstant SmbPrecipitationsReconstructedEnum
+syn keyword cConstant SmbReEnum
+syn keyword cConstant SmbRefreezeEnum
+syn keyword cConstant SmbReiniEnum
+syn keyword cConstant SmbRunoffEnum
+syn keyword cConstant SmbRunoffSubstepEnum
+syn keyword cConstant SmbRunoffTransientEnum
+syn keyword cConstant SmbS0gcmEnum
+syn keyword cConstant SmbS0pEnum
+syn keyword cConstant SmbS0tEnum
+syn keyword cConstant SmbSizeiniEnum
+syn keyword cConstant SmbSmbCorrEnum
+syn keyword cConstant SmbSmbrefEnum
+syn keyword cConstant SmbTEnum
+syn keyword cConstant SmbTaEnum
+syn keyword cConstant SmbTeValueEnum
+syn keyword cConstant SmbTemperaturesAnomalyEnum
+syn keyword cConstant SmbTemperaturesLgmEnum
+syn keyword cConstant SmbTemperaturesPresentdayEnum
+syn keyword cConstant SmbTemperaturesReconstructedEnum
+syn keyword cConstant SmbTiniEnum
+syn keyword cConstant SmbTmeanEnum
+syn keyword cConstant SmbTzEnum
+syn keyword cConstant SmbVEnum
+syn keyword cConstant SmbVmeanEnum
+syn keyword cConstant SmbVzEnum
+syn keyword cConstant SmbWEnum
+syn keyword cConstant SmbWiniEnum
+syn keyword cConstant SmbZMaxEnum
+syn keyword cConstant SmbZMinEnum
+syn keyword cConstant SmbZTopEnum
+syn keyword cConstant SmbZYEnum
+syn keyword cConstant StrainRateeffectiveEnum
+syn keyword cConstant StrainRateparallelEnum
+syn keyword cConstant StrainRateperpendicularEnum
+syn keyword cConstant StrainRatexxEnum
+syn keyword cConstant StrainRatexyEnum
+syn keyword cConstant StrainRatexzEnum
+syn keyword cConstant StrainRateyyEnum
+syn keyword cConstant StrainRateyzEnum
+syn keyword cConstant StrainRatezzEnum
+syn keyword cConstant StressMaxPrincipalEnum
+syn keyword cConstant StressTensorxxEnum
+syn keyword cConstant StressTensorxyEnum
+syn keyword cConstant StressTensorxzEnum
+syn keyword cConstant StressTensoryyEnum
+syn keyword cConstant StressTensoryzEnum
+syn keyword cConstant StressTensorzzEnum
+syn keyword cConstant SurfaceAbsMisfitEnum
+syn keyword cConstant SurfaceAbsVelMisfitEnum
+syn keyword cConstant SurfaceAreaEnum
+syn keyword cConstant SurfaceAverageVelMisfitEnum
+syn keyword cConstant SurfaceCrevasseEnum
+syn keyword cConstant SurfaceEnum
+syn keyword cConstant SurfaceLogVelMisfitEnum
+syn keyword cConstant SurfaceLogVxVyMisfitEnum
+syn keyword cConstant SurfaceObservationEnum
+syn keyword cConstant SurfaceRelVelMisfitEnum
+syn keyword cConstant SurfaceSlopeXEnum
+syn keyword cConstant SurfaceSlopeYEnum
+syn keyword cConstant TemperatureEnum
+syn keyword cConstant TemperaturePDDEnum
+syn keyword cConstant TemperaturePicardEnum
+syn keyword cConstant TemperatureSEMICEnum
+syn keyword cConstant ThermalSpctemperatureEnum
+syn keyword cConstant ThicknessAbsGradientEnum
+syn keyword cConstant ThicknessAbsMisfitEnum
+syn keyword cConstant ThicknessAcrossGradientEnum
+syn keyword cConstant ThicknessAlongGradientEnum
+syn keyword cConstant ThicknessEnum
+syn keyword cConstant ThicknessOldEnum
+syn keyword cConstant ThicknessPositiveEnum
+syn keyword cConstant ThicknessResidualEnum
+syn keyword cConstant VelEnum
+syn keyword cConstant VxAverageEnum
+syn keyword cConstant VxEnum
+syn keyword cConstant VxMeshEnum
+syn keyword cConstant VxObsEnum
+syn keyword cConstant VyAverageEnum
+syn keyword cConstant VyEnum
+syn keyword cConstant VyMeshEnum
+syn keyword cConstant VyObsEnum
+syn keyword cConstant VzEnum
+syn keyword cConstant VzFSEnum
+syn keyword cConstant VzHOEnum
+syn keyword cConstant VzMeshEnum
+syn keyword cConstant VzSSAEnum
+syn keyword cConstant WaterColumnOldEnum
+syn keyword cConstant WatercolumnEnum
+syn keyword cConstant WaterfractionDrainageEnum
+syn keyword cConstant WaterfractionDrainageIntegratedEnum
+syn keyword cConstant WaterfractionEnum
+syn keyword cConstant WaterheightEnum
+syn keyword cConstant WeightsSurfaceObservationEnum
+syn keyword cConstant Outputdefinition1Enum
+syn keyword cConstant Outputdefinition10Enum
+syn keyword cConstant Outputdefinition11Enum
+syn keyword cConstant Outputdefinition12Enum
+syn keyword cConstant Outputdefinition13Enum
+syn keyword cConstant Outputdefinition14Enum
+syn keyword cConstant Outputdefinition15Enum
+syn keyword cConstant Outputdefinition16Enum
+syn keyword cConstant Outputdefinition17Enum
+syn keyword cConstant Outputdefinition18Enum
+syn keyword cConstant Outputdefinition19Enum
+syn keyword cConstant Outputdefinition20Enum
+syn keyword cConstant Outputdefinition21Enum
+syn keyword cConstant Outputdefinition22Enum
+syn keyword cConstant Outputdefinition23Enum
+syn keyword cConstant Outputdefinition24Enum
+syn keyword cConstant Outputdefinition25Enum
+syn keyword cConstant Outputdefinition26Enum
+syn keyword cConstant Outputdefinition27Enum
+syn keyword cConstant Outputdefinition28Enum
+syn keyword cConstant Outputdefinition29Enum
+syn keyword cConstant Outputdefinition2Enum
+syn keyword cConstant Outputdefinition30Enum
+syn keyword cConstant Outputdefinition31Enum
+syn keyword cConstant Outputdefinition32Enum
+syn keyword cConstant Outputdefinition33Enum
+syn keyword cConstant Outputdefinition34Enum
+syn keyword cConstant Outputdefinition35Enum
+syn keyword cConstant Outputdefinition36Enum
+syn keyword cConstant Outputdefinition37Enum
+syn keyword cConstant Outputdefinition38Enum
+syn keyword cConstant Outputdefinition39Enum
+syn keyword cConstant Outputdefinition3Enum
+syn keyword cConstant Outputdefinition40Enum
+syn keyword cConstant Outputdefinition41Enum
+syn keyword cConstant Outputdefinition42Enum
+syn keyword cConstant Outputdefinition43Enum
+syn keyword cConstant Outputdefinition44Enum
+syn keyword cConstant Outputdefinition45Enum
+syn keyword cConstant Outputdefinition46Enum
+syn keyword cConstant Outputdefinition47Enum
+syn keyword cConstant Outputdefinition48Enum
+syn keyword cConstant Outputdefinition49Enum
+syn keyword cConstant Outputdefinition4Enum
+syn keyword cConstant Outputdefinition50Enum
+syn keyword cConstant Outputdefinition51Enum
+syn keyword cConstant Outputdefinition52Enum
+syn keyword cConstant Outputdefinition53Enum
+syn keyword cConstant Outputdefinition54Enum
+syn keyword cConstant Outputdefinition55Enum
+syn keyword cConstant Outputdefinition56Enum
+syn keyword cConstant Outputdefinition57Enum
+syn keyword cConstant Outputdefinition58Enum
+syn keyword cConstant Outputdefinition59Enum
+syn keyword cConstant Outputdefinition5Enum
+syn keyword cConstant Outputdefinition60Enum
+syn keyword cConstant Outputdefinition61Enum
+syn keyword cConstant Outputdefinition62Enum
+syn keyword cConstant Outputdefinition63Enum
+syn keyword cConstant Outputdefinition64Enum
+syn keyword cConstant Outputdefinition65Enum
+syn keyword cConstant Outputdefinition66Enum
+syn keyword cConstant Outputdefinition67Enum
+syn keyword cConstant Outputdefinition68Enum
+syn keyword cConstant Outputdefinition69Enum
+syn keyword cConstant Outputdefinition6Enum
+syn keyword cConstant Outputdefinition70Enum
+syn keyword cConstant Outputdefinition71Enum
+syn keyword cConstant Outputdefinition72Enum
+syn keyword cConstant Outputdefinition73Enum
+syn keyword cConstant Outputdefinition74Enum
+syn keyword cConstant Outputdefinition75Enum
+syn keyword cConstant Outputdefinition76Enum
+syn keyword cConstant Outputdefinition77Enum
+syn keyword cConstant Outputdefinition78Enum
+syn keyword cConstant Outputdefinition79Enum
+syn keyword cConstant Outputdefinition7Enum
+syn keyword cConstant Outputdefinition80Enum
+syn keyword cConstant Outputdefinition81Enum
+syn keyword cConstant Outputdefinition82Enum
+syn keyword cConstant Outputdefinition83Enum
+syn keyword cConstant Outputdefinition84Enum
+syn keyword cConstant Outputdefinition85Enum
+syn keyword cConstant Outputdefinition86Enum
+syn keyword cConstant Outputdefinition87Enum
+syn keyword cConstant Outputdefinition88Enum
+syn keyword cConstant Outputdefinition89Enum
+syn keyword cConstant Outputdefinition8Enum
+syn keyword cConstant Outputdefinition90Enum
+syn keyword cConstant Outputdefinition91Enum
+syn keyword cConstant Outputdefinition92Enum
+syn keyword cConstant Outputdefinition93Enum
+syn keyword cConstant Outputdefinition94Enum
+syn keyword cConstant Outputdefinition95Enum
+syn keyword cConstant Outputdefinition96Enum
+syn keyword cConstant Outputdefinition97Enum
+syn keyword cConstant Outputdefinition98Enum
+syn keyword cConstant Outputdefinition99Enum
+syn keyword cConstant Outputdefinition9Enum
+syn keyword cConstant Outputdefinition100Enum
+syn keyword cConstant InputsENDEnum
+syn keyword cConstant AbsoluteEnum
+syn keyword cConstant AdaptiveTimesteppingEnum
+syn keyword cConstant AdjointBalancethickness2AnalysisEnum
+syn keyword cConstant AdjointBalancethicknessAnalysisEnum
+syn keyword cConstant AdjointHorizAnalysisEnum
+syn keyword cConstant AggressiveMigrationEnum
+syn keyword cConstant AmrBamgEnum
+syn keyword cConstant AmrNeopzEnum
+syn keyword cConstant AndroidFrictionCoefficientEnum
+syn keyword cConstant ArrheniusEnum
+syn keyword cConstant AutodiffJacobianEnum
+syn keyword cConstant Balancethickness2AnalysisEnum
+syn keyword cConstant Balancethickness2SolutionEnum
+syn keyword cConstant BalancethicknessAnalysisEnum
+syn keyword cConstant BalancethicknessApparentMassbalanceEnum
+syn keyword cConstant BalancethicknessSoftAnalysisEnum
+syn keyword cConstant BalancethicknessSoftSolutionEnum
+syn keyword cConstant BalancethicknessSolutionEnum
+syn keyword cConstant BalancethicknessSpcthicknessEnum
+syn keyword cConstant BalancevelocityAnalysisEnum
+syn keyword cConstant BalancevelocitySolutionEnum
+syn keyword cConstant BasalforcingsIsmip6Enum
+syn keyword cConstant BasalforcingsPicoEnum
+syn keyword cConstant BeckmannGoosseFloatingMeltRateEnum
+syn keyword cConstant BedSlopeSolutionEnum
+syn keyword cConstant BoolExternalResultEnum
+syn keyword cConstant BoolInputEnum
+syn keyword cConstant BoolParamEnum
+syn keyword cConstant BoundaryEnum
+syn keyword cConstant BuddJackaEnum
+syn keyword cConstant CalvingDev2Enum
+syn keyword cConstant CalvingHabEnum
+syn keyword cConstant CalvingLevermannEnum
+syn keyword cConstant CalvingVonmisesEnum
+syn keyword cConstant CfdragcoeffabsgradEnum
+syn keyword cConstant CfsurfacelogvelEnum
+syn keyword cConstant CfsurfacesquareEnum
+syn keyword cConstant ChannelEnum
+syn keyword cConstant ChannelAreaEnum
+syn keyword cConstant ChannelAreaOldEnum
+syn keyword cConstant ClosedEnum
+syn keyword cConstant ColinearEnum
+syn keyword cConstant ConstraintsEnum
+syn keyword cConstant ContactEnum
+syn keyword cConstant ContourEnum
+syn keyword cConstant ContoursEnum
+syn keyword cConstant ControlInputEnum
+syn keyword cConstant ControlInputGradEnum
+syn keyword cConstant ControlInputMaxsEnum
+syn keyword cConstant ControlInputMinsEnum
+syn keyword cConstant ControlInputValuesEnum
+syn keyword cConstant CrouzeixRaviartEnum
+syn keyword cConstant CuffeyEnum
+syn keyword cConstant CuffeyTemperateEnum
+syn keyword cConstant DamageEvolutionAnalysisEnum
+syn keyword cConstant DamageEvolutionSolutionEnum
+syn keyword cConstant DataSetEnum
+syn keyword cConstant DataSetParamEnum
+syn keyword cConstant DatasetInputEnum
+syn keyword cConstant DefaultAnalysisEnum
+syn keyword cConstant DefaultCalvingEnum
+syn keyword cConstant DenseEnum
+syn keyword cConstant DependentObjectEnum
+syn keyword cConstant DepthAverageAnalysisEnum
+syn keyword cConstant DeviatoricStressErrorEstimatorEnum
+syn keyword cConstant DivergenceEnum
+syn keyword cConstant Domain3DsurfaceEnum
+syn keyword cConstant DoubleArrayInputEnum
+syn keyword cConstant DoubleExternalResultEnum
+syn keyword cConstant DoubleInputEnum
+syn keyword cConstant DoubleMatArrayParamEnum
+syn keyword cConstant DoubleMatExternalResultEnum
+syn keyword cConstant DoubleMatParamEnum
+syn keyword cConstant DoubleParamEnum
+syn keyword cConstant DoubleVecParamEnum
+syn keyword cConstant ElementEnum
+syn keyword cConstant ElementHookEnum
+syn keyword cConstant ElementSIdEnum
+syn keyword cConstant EnthalpyAnalysisEnum
+syn keyword cConstant EsaAnalysisEnum
+syn keyword cConstant EsaSolutionEnum
+syn keyword cConstant EsaTransitionsEnum
+syn keyword cConstant ExternalResultEnum
+syn keyword cConstant ExtrapolationAnalysisEnum
+syn keyword cConstant ExtrudeFromBaseAnalysisEnum
+syn keyword cConstant ExtrudeFromTopAnalysisEnum
+syn keyword cConstant FSApproximationEnum
+syn keyword cConstant FSSolverEnum
+syn keyword cConstant FSpressureEnum
+syn keyword cConstant FSvelocityEnum
+syn keyword cConstant FemModelEnum
+syn keyword cConstant FileParamEnum
+syn keyword cConstant FixedTimesteppingEnum
+syn keyword cConstant FloatingAreaEnum
+syn keyword cConstant FloatingAreaScaledEnum
+syn keyword cConstant FloatingMeltRateEnum
+syn keyword cConstant FreeEnum
+syn keyword cConstant FreeSurfaceBaseAnalysisEnum
+syn keyword cConstant FreeSurfaceTopAnalysisEnum
+syn keyword cConstant FrontalForcingsDefaultEnum
+syn keyword cConstant FrontalForcingsRignotEnum
+syn keyword cConstant FsetEnum
+syn keyword cConstant FullMeltOnPartiallyFloatingEnum
+syn keyword cConstant GLheightadvectionAnalysisEnum
+syn keyword cConstant GaussPentaEnum
+syn keyword cConstant GaussSegEnum
+syn keyword cConstant GaussTetraEnum
+syn keyword cConstant GaussTriaEnum
+syn keyword cConstant GenericOptionEnum
+syn keyword cConstant GenericParamEnum
+syn keyword cConstant GiaIvinsAnalysisEnum
+syn keyword cConstant GiaSolutionEnum
+syn keyword cConstant Gradient1Enum
+syn keyword cConstant Gradient2Enum
+syn keyword cConstant Gradient3Enum
+syn keyword cConstant GroundedAreaEnum
+syn keyword cConstant GroundedAreaScaledEnum
+syn keyword cConstant GroundingOnlyEnum
+syn keyword cConstant GroundinglineMassFluxEnum
+syn keyword cConstant GsetEnum
+syn keyword cConstant GslEnum
+syn keyword cConstant HOApproximationEnum
+syn keyword cConstant HOFSApproximationEnum
+syn keyword cConstant HookEnum
+syn keyword cConstant HydrologyDCEfficientAnalysisEnum
+syn keyword cConstant HydrologyDCInefficientAnalysisEnum
+syn keyword cConstant HydrologyGlaDSAnalysisEnum
+syn keyword cConstant HydrologyGlaDSEnum
+syn keyword cConstant HydrologyPismAnalysisEnum
+syn keyword cConstant HydrologyShaktiAnalysisEnum
+syn keyword cConstant HydrologyShreveAnalysisEnum
+syn keyword cConstant HydrologySolutionEnum
+syn keyword cConstant HydrologydcEnum
+syn keyword cConstant HydrologypismEnum
+syn keyword cConstant HydrologyshaktiEnum
+syn keyword cConstant HydrologyshreveEnum
+syn keyword cConstant IceMassEnum
+syn keyword cConstant IceMassScaledEnum
+syn keyword cConstant IceVolumeAboveFloatationEnum
+syn keyword cConstant IceVolumeAboveFloatationScaledEnum
+syn keyword cConstant IceVolumeEnum
+syn keyword cConstant IceVolumeScaledEnum
+syn keyword cConstant IcefrontMassFluxEnum
+syn keyword cConstant IcefrontMassFluxLevelsetEnum
+syn keyword cConstant IncrementalEnum
+syn keyword cConstant IndexedEnum
+syn keyword cConstant IntExternalResultEnum
+syn keyword cConstant IntInputEnum
+syn keyword cConstant IntMatExternalResultEnum
+syn keyword cConstant IntMatParamEnum
+syn keyword cConstant IntParamEnum
+syn keyword cConstant IntVecParamEnum
+syn keyword cConstant InternalEnum
+syn keyword cConstant IntersectEnum
+syn keyword cConstant InversionVzObsEnum
+syn keyword cConstant JEnum
+syn keyword cConstant L1L2ApproximationEnum
+syn keyword cConstant L2ProjectionBaseAnalysisEnum
+syn keyword cConstant L2ProjectionEPLAnalysisEnum
+syn keyword cConstant LACrouzeixRaviartEnum
+syn keyword cConstant LATaylorHoodEnum
+syn keyword cConstant LambdaSEnum
+syn keyword cConstant LevelsetAnalysisEnum
+syn keyword cConstant LevelsetfunctionPicardEnum
+syn keyword cConstant LinearFloatingMeltRateEnum
+syn keyword cConstant LliboutryDuvalEnum
+syn keyword cConstant LoadsEnum
+syn keyword cConstant LoveAnalysisEnum
+syn keyword cConstant LoveHiEnum
+syn keyword cConstant LoveHrEnum
+syn keyword cConstant LoveKernelsImagEnum
+syn keyword cConstant LoveKernelsRealEnum
+syn keyword cConstant LoveKiEnum
+syn keyword cConstant LoveKrEnum
+syn keyword cConstant LoveLiEnum
+syn keyword cConstant LoveLrEnum
+syn keyword cConstant LoveSolutionEnum
+syn keyword cConstant MINIEnum
+syn keyword cConstant MINIcondensedEnum
+syn keyword cConstant MantlePlumeGeothermalFluxEnum
+syn keyword cConstant MassFluxEnum
+syn keyword cConstant MassconEnum
+syn keyword cConstant MassconaxpbyEnum
+syn keyword cConstant MassfluxatgateEnum
+syn keyword cConstant MasstransportAnalysisEnum
+syn keyword cConstant MasstransportSolutionEnum
+syn keyword cConstant MatdamageiceEnum
+syn keyword cConstant MatenhancediceEnum
+syn keyword cConstant MaterialsEnum
+syn keyword cConstant MatestarEnum
+syn keyword cConstant MaticeEnum
+syn keyword cConstant MatlithoEnum
+syn keyword cConstant MatrixParamEnum
+syn keyword cConstant MaxAbsVxEnum
+syn keyword cConstant MaxAbsVyEnum
+syn keyword cConstant MaxAbsVzEnum
+syn keyword cConstant MaxDivergenceEnum
+syn keyword cConstant MaxVelEnum
+syn keyword cConstant MaxVxEnum
+syn keyword cConstant MaxVyEnum
+syn keyword cConstant MaxVzEnum
+syn keyword cConstant MelangeEnum
+syn keyword cConstant MeltingAnalysisEnum
+syn keyword cConstant MeshElementsEnum
+syn keyword cConstant MeshXEnum
+syn keyword cConstant MeshYEnum
+syn keyword cConstant MinVelEnum
+syn keyword cConstant MinVxEnum
+syn keyword cConstant MinVyEnum
+syn keyword cConstant MinVzEnum
+syn keyword cConstant MismipFloatingMeltRateEnum
+syn keyword cConstant MoulinEnum
+syn keyword cConstant MpiDenseEnum
+syn keyword cConstant MpiEnum
+syn keyword cConstant MpiSparseEnum
+syn keyword cConstant MumpsEnum
+syn keyword cConstant NoFrictionOnPartiallyFloatingEnum
+syn keyword cConstant NoMeltOnPartiallyFloatingEnum
+syn keyword cConstant NodalEnum
+syn keyword cConstant NodalvalueEnum
+syn keyword cConstant NodeSIdEnum
+syn keyword cConstant NoneApproximationEnum
+syn keyword cConstant NoneEnum
+syn keyword cConstant NumberedcostfunctionEnum
+syn keyword cConstant NyeCO2Enum
+syn keyword cConstant NyeH2OEnum
+syn keyword cConstant NumericalfluxEnum
+syn keyword cConstant OldGradientEnum
+syn keyword cConstant OneLayerP4zEnum
+syn keyword cConstant OpenEnum
+syn keyword cConstant OptionEnum
+syn keyword cConstant P0ArrayEnum
+syn keyword cConstant P0DGEnum
+syn keyword cConstant P1DGEnum
+syn keyword cConstant P1P1Enum
+syn keyword cConstant P1P1GLSEnum
+syn keyword cConstant P1bubbleEnum
+syn keyword cConstant P1bubblecondensedEnum
+syn keyword cConstant P1xP2Enum
+syn keyword cConstant P1xP3Enum
+syn keyword cConstant P1xP4Enum
+syn keyword cConstant P2Enum
+syn keyword cConstant P2bubbleEnum
+syn keyword cConstant P2bubblecondensedEnum
+syn keyword cConstant P2xP1Enum
+syn keyword cConstant P2xP4Enum
+syn keyword cConstant PatersonEnum
+syn keyword cConstant PengridEnum
+syn keyword cConstant PenpairEnum
+syn keyword cConstant PentaEnum
+syn keyword cConstant PentaInputEnum
+syn keyword cConstant ProfilerEnum
+syn keyword cConstant ProfilingCurrentFlopsEnum
+syn keyword cConstant ProfilingCurrentMemEnum
+syn keyword cConstant ProfilingSolutionTimeEnum
+syn keyword cConstant RegionaloutputEnum
+syn keyword cConstant RegularEnum
+syn keyword cConstant RecoveryAnalysisEnum
+syn keyword cConstant RiftfrontEnum
+syn keyword cConstant SIAApproximationEnum
+syn keyword cConstant SMBcomponentsEnum
+syn keyword cConstant SMBd18opddEnum
+syn keyword cConstant SMBforcingEnum
+syn keyword cConstant SMBgcmEnum
+syn keyword cConstant SMBgembEnum
+syn keyword cConstant SMBgradientsEnum
+syn keyword cConstant SMBgradientscomponentsEnum
+syn keyword cConstant SMBgradientselaEnum
+syn keyword cConstant SMBhenningEnum
+syn keyword cConstant SMBmeltcomponentsEnum
+syn keyword cConstant SMBpddEnum
+syn keyword cConstant SMBpddSicopolisEnum
+syn keyword cConstant SMBsemicEnum
+syn keyword cConstant SSAApproximationEnum
+syn keyword cConstant SSAFSApproximationEnum
+syn keyword cConstant SSAHOApproximationEnum
+syn keyword cConstant ScaledEnum
+syn keyword cConstant SealevelAbsoluteEnum
+syn keyword cConstant SealevelEmotionEnum
+syn keyword cConstant SealevelInertiaTensorXZEnum
+syn keyword cConstant SealevelInertiaTensorYZEnum
+syn keyword cConstant SealevelInertiaTensorZZEnum
+syn keyword cConstant SealevelNmotionEnum
+syn keyword cConstant SealevelUmotionEnum
+syn keyword cConstant SealevelriseAnalysisEnum
+syn keyword cConstant SealevelriseSolutionEnum
+syn keyword cConstant SegEnum
+syn keyword cConstant SegInputEnum
+syn keyword cConstant SegmentEnum
+syn keyword cConstant SegmentRiftfrontEnum
+syn keyword cConstant SeparateEnum
+syn keyword cConstant SeqEnum
+syn keyword cConstant SmbAnalysisEnum
+syn keyword cConstant SmbSolutionEnum
+syn keyword cConstant SmoothAnalysisEnum
+syn keyword cConstant SoftMigrationEnum
+syn keyword cConstant SpatialLinearFloatingMeltRateEnum
+syn keyword cConstant SpcDynamicEnum
+syn keyword cConstant SpcStaticEnum
+syn keyword cConstant SpcTransientEnum
+syn keyword cConstant SsetEnum
+syn keyword cConstant SteadystateSolutionEnum
+syn keyword cConstant StressIntensityFactorEnum
+syn keyword cConstant StressbalanceAnalysisEnum
+syn keyword cConstant StressbalanceConvergenceNumStepsEnum
+syn keyword cConstant StressbalanceSIAAnalysisEnum
+syn keyword cConstant StressbalanceSolutionEnum
+syn keyword cConstant StressbalanceVerticalAnalysisEnum
+syn keyword cConstant StringArrayParamEnum
+syn keyword cConstant StringExternalResultEnum
+syn keyword cConstant StringParamEnum
+syn keyword cConstant SubelementFriction1Enum
+syn keyword cConstant SubelementFriction2Enum
+syn keyword cConstant SubelementMelt1Enum
+syn keyword cConstant SubelementMelt2Enum
+syn keyword cConstant SubelementMigrationEnum
+syn keyword cConstant SurfaceSlopeSolutionEnum
+syn keyword cConstant TaylorHoodEnum
+syn keyword cConstant TetraEnum
+syn keyword cConstant TetraInputEnum
+syn keyword cConstant ThermalAnalysisEnum
+syn keyword cConstant ThermalSolutionEnum
+syn keyword cConstant ThicknessErrorEstimatorEnum
+syn keyword cConstant TotalCalvingFluxLevelsetEnum
+syn keyword cConstant TotalCalvingMeltingFluxLevelsetEnum
+syn keyword cConstant TotalFloatingBmbEnum
+syn keyword cConstant TotalFloatingBmbScaledEnum
+syn keyword cConstant TotalGroundedBmbEnum
+syn keyword cConstant TotalGroundedBmbScaledEnum
+syn keyword cConstant TotalSmbEnum
+syn keyword cConstant TotalSmbScaledEnum
+syn keyword cConstant TransientArrayParamEnum
+syn keyword cConstant TransientInputEnum
+syn keyword cConstant TransientParamEnum
+syn keyword cConstant TransientSolutionEnum
+syn keyword cConstant TriaEnum
+syn keyword cConstant TriaInputEnum
+syn keyword cConstant UzawaPressureAnalysisEnum
+syn keyword cConstant VectorParamEnum
+syn keyword cConstant VertexEnum
+syn keyword cConstant VertexLIdEnum
+syn keyword cConstant VertexPIdEnum
+syn keyword cConstant VertexSIdEnum
+syn keyword cConstant VerticesEnum
+syn keyword cConstant ViscousHeatingEnum
+syn keyword cConstant WaterEnum
+syn keyword cConstant XTaylorHoodEnum
+syn keyword cConstant XYEnum
+syn keyword cConstant XYZEnum
+syn keyword cConstant BalancethicknessD0Enum
+syn keyword cConstant BalancethicknessDiffusionCoefficientEnum
+syn keyword cConstant BilinearInterpEnum
+syn keyword cConstant CalvingdevCoeffEnum
+syn keyword cConstant DeviatoricStressEnum
+syn keyword cConstant EtaAbsGradientEnum
+syn keyword cConstant MeshZEnum
+syn keyword cConstant NearestInterpEnum
+syn keyword cConstant OutputdefinitionListEnum
+syn keyword cConstant SealevelObsEnum
+syn keyword cConstant SealevelWeightsEnum
+syn keyword cConstant StrainRateEnum
+syn keyword cConstant StressTensorEnum
+syn keyword cConstant StressbalanceViscosityOvershootEnum
+syn keyword cConstant SubelementMigration4Enum
+syn keyword cConstant TimesteppingTimeAdaptEnum
+syn keyword cConstant TriangleInterpEnum
+syn keyword cConstant MaximumNumberOfDefinitionsEnum
+"ISSM Enums end
+
+"ISSM objects
+syn keyword cType AdaptiveMeshRefinement
+syn keyword cType AmrBamg
+syn keyword cType BoolInput
+syn keyword cType BoolParam
+syn keyword cType Cfdragcoeffabsgrad
+syn keyword cType Cfsurfacelogvel
+syn keyword cType Cfsurfacesquare
+syn keyword cType Channel
+syn keyword cType Constraint
+syn keyword cType Constraints
+syn keyword cType Contour
+syn keyword cType Contours
+syn keyword cType ControlInput
+syn keyword cType Covertree
+syn keyword cType DataSetParam
+syn keyword cType DatasetInput
+syn keyword cType Definition
+syn keyword cType DependentObject
+syn keyword cType DoubleArrayInput
+syn keyword cType DoubleInput
+syn keyword cType DoubleMatArrayParam
+syn keyword cType DoubleMatParam
+syn keyword cType DoubleParam
+syn keyword cType DoubleTransientMatParam
+syn keyword cType DoubleVecParam
+syn keyword cType Element
+syn keyword cType ElementHook
+syn keyword cType ElementMatrix
+syn keyword cType ElementVector
+syn keyword cType Elements
+syn keyword cType ExponentialVariogram
+syn keyword cType ExternalResult
+syn keyword cType FemModel
+syn keyword cType FileParam
+syn keyword cType Friction
+syn keyword cType Gauss
+syn keyword cType GaussPenta
+syn keyword cType GaussSeg
+syn keyword cType GaussTetra
+syn keyword cType GaussTria
+syn keyword cType GaussianVariogram
+syn keyword cType GenericExternalResult
+syn keyword cType GenericOption
+syn keyword cType GenericParam
+syn keyword cType GiaDeflectionCoreArgs
+syn keyword cType Hook
+syn keyword cType Input
+syn keyword cType Inputs
+syn keyword cType IntInput
+syn keyword cType IntMatParam
+syn keyword cType IntParam
+syn keyword cType IntVecParam
+syn keyword cType IoModel
+syn keyword cType IssmDirectApplicInterface
+syn keyword cType IssmParallelDirectApplicInterface
+syn keyword cType Load
+syn keyword cType Loads
+syn keyword cType Masscon
+syn keyword cType Massconaxpby
+syn keyword cType Massfluxatgate
+syn keyword cType Material
+syn keyword cType Materials
+syn keyword cType Matestar
+syn keyword cType Matice
+syn keyword cType Matlitho
+syn keyword cType MatrixParam
+syn keyword cType Misfit
+syn keyword cType Moulin
+syn keyword cType Neumannflux
+syn keyword cType Nodalvalue
+syn keyword cType Node
+syn keyword cType Nodes
+syn keyword cType Numberedcostfunction
+syn keyword cType Numericalflux
+syn keyword cType Observation
+syn keyword cType Observations
+syn keyword cType Option
+syn keyword cType OptionUtilities
+syn keyword cType Options
+syn keyword cType Param
+syn keyword cType Parameters
+syn keyword cType Pengrid
+syn keyword cType Penpair
+syn keyword cType Penta
+syn keyword cType PentaInput
+syn keyword cType PentaRef
+syn keyword cType PowerVariogram
+syn keyword cType Profiler
+syn keyword cType Quadtree
+syn keyword cType Radar
+syn keyword cType Regionaloutput
+syn keyword cType Results
+syn keyword cType RiftStruct
+syn keyword cType Riftfront
+syn keyword cType Seg
+syn keyword cType SegInput
+syn keyword cType SegRef
+syn keyword cType Segment
+syn keyword cType SpcDynamic
+syn keyword cType SpcStatic
+syn keyword cType SpcTransient
+syn keyword cType SphericalVariogram
+syn keyword cType StringArrayParam
+syn keyword cType StringParam
+syn keyword cType Tetra
+syn keyword cType TetraInput
+syn keyword cType TetraRef
+syn keyword cType TransientArrayParam
+syn keyword cType TransientInput
+syn keyword cType TransientParam
+syn keyword cType Tria
+syn keyword cType TriaInput
+syn keyword cType TriaRef
+syn keyword cType Variogram
+syn keyword cType VectorParam
+syn keyword cType Vertex
+syn keyword cType Vertices
+syn keyword cType classes
+syn keyword cType gaussobjects
+syn keyword cType krigingobjects
+syn keyword cType matrixobjects
+syn keyword cType AdjointBalancethickness2Analysis
+syn keyword cType AdjointBalancethicknessAnalysis
+syn keyword cType AdjointHorizAnalysis
+syn keyword cType Analysis
+syn keyword cType Balancethickness2Analysis
+syn keyword cType BalancethicknessAnalysis
+syn keyword cType BalancethicknessSoftAnalysis
+syn keyword cType BalancevelocityAnalysis
+syn keyword cType DamageEvolutionAnalysis
+syn keyword cType DepthAverageAnalysis
+syn keyword cType EnthalpyAnalysis
+syn keyword cType EnumToAnalysis
+syn keyword cType EsaAnalysis
+syn keyword cType ExtrapolationAnalysis
+syn keyword cType ExtrudeFromBaseAnalysis
+syn keyword cType ExtrudeFromTopAnalysis
+syn keyword cType FreeSurfaceBaseAnalysis
+syn keyword cType FreeSurfaceTopAnalysis
+syn keyword cType GLheightadvectionAnalysis
+syn keyword cType GiaIvinsAnalysis
+syn keyword cType HydrologyDCEfficientAnalysis
+syn keyword cType HydrologyDCInefficientAnalysis
+syn keyword cType HydrologyGlaDSAnalysis
+syn keyword cType HydrologyPismAnalysis
+syn keyword cType HydrologyShaktiAnalysis
+syn keyword cType HydrologyShreveAnalysis
+syn keyword cType L2ProjectionBaseAnalysis
+syn keyword cType L2ProjectionEPLAnalysis
+syn keyword cType LevelsetAnalysis
+syn keyword cType LoveAnalysis
+syn keyword cType MasstransportAnalysis
+syn keyword cType MeltingAnalysis
+syn keyword cType SealevelriseAnalysis
+syn keyword cType SmbAnalysis
+syn keyword cType SmoothAnalysis
+syn keyword cType StressbalanceAnalysis
+syn keyword cType StressbalanceSIAAnalysis
+syn keyword cType StressbalanceVerticalAnalysis
+syn keyword cType ThermalAnalysis
+syn keyword cType UzawaPressureAnalysis
+"ISSM objects end
Index: /issm/trunk/src/c/shared/Enum/EnumDefinitions.h
===================================================================
--- /issm/trunk/src/c/shared/Enum/EnumDefinitions.h	(revision 24312)
+++ /issm/trunk/src/c/shared/Enum/EnumDefinitions.h	(revision 24313)
@@ -63,4 +63,11 @@
 	BasalforcingsDtbgEnum,
 	BasalforcingsEnum,
+	BasalforcingsIsmip6AverageTfEnum,
+	BasalforcingsIsmip6BasinAreaEnum,
+	BasalforcingsIsmip6DeltaTEnum,
+	BasalforcingsIsmip6Gamma0Enum,
+	BasalforcingsIsmip6IsLocalEnum,
+	BasalforcingsIsmip6NumBasinsEnum,
+	BasalforcingsIsmip6TfDepthsEnum,
 	BasalforcingsLowercrustheatEnum,
 	BasalforcingsMantleconductivityEnum,
@@ -87,4 +94,5 @@
 	BasalforcingsUpperdepthMeltEnum,
 	BasalforcingsUpperwaterElevationEnum,
+	BasalforcingsUpperwaterMeltingRateEnum,
 	CalvingCrevasseDepthEnum,
 	CalvingHeightAboveFloatationEnum,
@@ -93,8 +101,13 @@
 	CalvingMinthicknessEnum,
 	ConfigurationTypeEnum,
+	ConstantsGEnum,
+	ConstantsReferencetemperatureEnum,
 	ConstantsYtsEnum,
+	ControlInputSizeMEnum,
+	ControlInputSizeNEnum,
 	DamageC1Enum,
 	DamageC2Enum,
 	DamageC3Enum,
+	DamageC4Enum,
 	DamageEnum,
 	DamageEquivStressEnum,
@@ -107,4 +120,5 @@
 	DamageStabilizationEnum,
 	DamageStressThresholdEnum,
+	DamageStressUBoundEnum,
 	DebugProfilingEnum,
 	DomainDimensionEnum,
@@ -125,4 +139,5 @@
 	FlowequationIsSSAEnum,
 	FrictionCouplingEnum,
+	FrictionDeltaEnum,
 	FrictionFEnum,
 	FrictionGammaEnum,
@@ -130,12 +145,34 @@
 	FrictionPseudoplasticityExponentEnum,
 	FrictionThresholdSpeedEnum,
-	FrictionDeltaEnum,
 	FrictionVoidRatioEnum,
+	FrontalForcingsBasinIcefrontAreaEnum,
+	FrontalForcingsNumberofBasinsEnum,
+	FrontalForcingsParamEnum,
 	GiaCrossSectionShapeEnum,
-	GroundinglineMigrationEnum,
 	GroundinglineFrictionInterpolationEnum,
 	GroundinglineMeltInterpolationEnum,
+	GroundinglineMigrationEnum,
+	HydrologyCavitySpacingEnum,
+	HydrologyChannelConductivityEnum,
+	HydrologyChannelSheetWidthEnum,
+	HydrologyEnglacialVoidRatioEnum,
+	HydrologyIschannelsEnum,
+	HydrologyMeltFlagEnum,
+	HydrologyModelEnum,
+	HydrologyNumRequestedOutputsEnum,
+	HydrologyPressureMeltCoefficientEnum,
+	HydrologyRelaxationEnum,
+	HydrologyRequestedOutputsEnum,
+	HydrologySedimentKmaxEnum,
+	HydrologyStepsPerStepEnum,
+	HydrologyStorageEnum,
+	HydrologydcEplColapseThicknessEnum,
+	HydrologydcEplCompressibilityEnum,
+	HydrologydcEplConductivityEnum,
+	HydrologydcEplInitialThicknessEnum,
+	HydrologydcEplMaxThicknessEnum,
+	HydrologydcEplPorosityEnum,
+	HydrologydcEplThickCompEnum,
 	HydrologydcEplflipLockEnum,
-	HydrologydcEplThickCompEnum,
 	HydrologydcIsefficientlayerEnum,
 	HydrologydcLeakageFactorEnum,
@@ -144,17 +181,13 @@
 	HydrologydcPenaltyLockEnum,
 	HydrologydcRelTolEnum,
+	HydrologydcSedimentCompressibilityEnum,
 	HydrologydcSedimentlimitEnum,
 	HydrologydcSedimentlimitFlagEnum,
+	HydrologydcSedimentPorosityEnum,
+	HydrologydcSedimentThicknessEnum,
 	HydrologydcTransferFlagEnum,
 	HydrologydcUnconfinedFlagEnum,
-	HydrologydtEnum,
-	HydrologyModelEnum,
-	HydrologyNumRequestedOutputsEnum,
-	HydrologyRelaxationEnum,
-	HydrologyRequestedOutputsEnum,
-	HydrologySedimentKmaxEnum,
+	HydrologydcWaterCompressibilityEnum,
 	HydrologyshreveStabilizationEnum,
-	HydrologyStepsPerStepEnum,
-	HydrologyStorageEnum,
 	IcecapToEarthCommEnum,
 	IndexEnum,
@@ -168,6 +201,4 @@
 	InversionControlParametersEnum,
 	InversionControlScalingFactorsEnum,
-	ControlInputSizeMEnum,
-	ControlInputSizeNEnum,
 	InversionCostFunctionsEnum,
 	InversionDxminEnum,
@@ -186,4 +217,5 @@
 	InversionStepThresholdEnum,
 	InversionTypeEnum,
+	LevelsetKillIcebergsEnum,
 	LevelsetReinitFrequencyEnum,
 	LevelsetStabilizationEnum,
@@ -208,5 +240,23 @@
 	MasstransportRequestedOutputsEnum,
 	MasstransportStabilizationEnum,
+	MaterialsBetaEnum,
+	MaterialsEarthDensityEnum,
+	MaterialsEffectiveconductivityAveragingEnum,
+	MaterialsHeatcapacityEnum,
+	MaterialsLatentheatEnum,
+	MaterialsLithosphereDensityEnum,
+	MaterialsLithosphereShearModulusEnum,
+	MaterialsMantleDensityEnum,
+	MaterialsMantleShearModulusEnum,
+	MaterialsMeltingpointEnum,
+	MaterialsMixedLayerCapacityEnum,
+	MaterialsMuWaterEnum,
+	MaterialsRheologyLawEnum,
+	MaterialsRhoFreshwaterEnum,
 	MaterialsRhoIceEnum,
+	MaterialsRhoSeawaterEnum,
+	MaterialsTemperateiceconductivityEnum,
+	MaterialsThermalExchangeVelocityEnum,
+	MaterialsThermalconductivityEnum,
 	MeltingOffsetEnum,
 	MeshAverageVertexConnectivityEnum,
@@ -223,7 +273,7 @@
 	OutputBufferPointerEnum,
 	OutputBufferSizePointerEnum,
-	OutputdefinitionEnum,
 	OutputFileNameEnum,
 	OutputFilePointerEnum,
+	OutputdefinitionEnum,
 	ParamEnum,
 	ParametersEnum,
@@ -233,5 +283,6 @@
 	QmuNumberofpartitionsEnum,
 	QmuOutNameEnum,
-	QmuPartitionEnum,
+	QmuEpartitionEnum,
+	QmuVpartitionEnum,
 	QmuResponsedescriptorsEnum,
 	QmuVariableDescriptorsEnum,
@@ -241,6 +292,4 @@
 	SaveResultsEnum,
 	SealevelEustaticEnum,
-	SealevelEustaticOceanMaskEnum,
-	SealevelEustaticMaskEnum,
 	SealevelriseAbstolEnum,
 	SealevelriseAngularVelocityEnum,
@@ -263,21 +312,25 @@
 	SealevelriseRunCountEnum,
 	SealevelriseTidalLoveHEnum,
-	SealevelriseSpcthicknessEnum,
 	SealevelriseTidalLoveKEnum,
 	SealevelriseTransitionsEnum,
 	SealevelriseUElasticEnum,
 	SettingsIoGatherEnum,
+	SettingsNumResultsOnNodesEnum,
 	SettingsOutputFrequencyEnum,
 	SettingsRecordingFrequencyEnum,
 	SettingsResultsOnNodesEnum,
+	SettingsSbCouplingFrequencyEnum,
 	SettingsSolverResidueThresholdEnum,
 	SettingsWaitonlockEnum,
+	SmbAIceEnum,
+	SmbAIdxEnum,
+	SmbASnowEnum,
 	SmbAccualtiEnum,
 	SmbAccugradEnum,
 	SmbAccurefEnum,
 	SmbAdThreshEnum,
-	SmbAIceEnum,
-	SmbAIdxEnum,
-	SmbASnowEnum,
+	SmbDesfacEnum,
+	SmbDpermilEnum,
+	SmbDsnowIdxEnum,
 	SmbCldFracEnum,
 	SmbDelta18oEnum,
@@ -290,15 +343,16 @@
 	SmbIsaccumulationEnum,
 	SmbIsalbedoEnum,
+	SmbIsclimatologyEnum,
 	SmbIsd18opdEnum,
 	SmbIsdelta18oEnum,
 	SmbIsdensificationEnum,
+	SmbIsfirnwarmingEnum,
 	SmbIsgraingrowthEnum,
-	SmbIsfirnwarmingEnum,
 	SmbIsmeltEnum,
 	SmbIsmungsmEnum,
+	SmbIsprecipscaledEnum,
 	SmbIssetpddfacEnum,
 	SmbIsshortwaveEnum,
 	SmbIstemperaturescaledEnum,
-	SmbIsprecipscaledEnum,
 	SmbIsthermalEnum,
 	SmbIsturbulentfluxEnum,
@@ -306,9 +360,13 @@
 	SmbNumRequestedOutputsEnum,
 	SmbPfacEnum,
+	SmbRdlEnum,
 	SmbRequestedOutputsEnum,
+	SmbRlapsEnum,
+	SmbRlapslgmEnum,
 	SmbRunoffaltiEnum,
 	SmbRunoffgradEnum,
 	SmbRunoffrefEnum,
 	SmbSealevEnum,
+	SmbStepsPerStepEnum,
 	SmbSwIdxEnum,
 	SmbT0dryEnum,
@@ -334,4 +392,5 @@
 	StressbalanceRiftPenaltyThresholdEnum,
 	StressbalanceShelfDampeningEnum,
+	ThermalIsdrainicecolumnEnum,
 	ThermalIsdynamicbasalspcEnum,
 	ThermalIsenthalpyEnum,
@@ -344,4 +403,5 @@
 	ThermalRequestedOutputsEnum,
 	ThermalStabilizationEnum,
+	ThermalWatercolumnUpperlimitEnum,
 	TimeEnum,
 	TimesteppingCflCoefficientEnum,
@@ -382,4 +442,5 @@
 	/*Inputs{{{*/
 	AdjointEnum,
+	AdjointpEnum,
 	AdjointxEnum,
 	AdjointyEnum,
@@ -391,7 +452,14 @@
 	BalancethicknessOmegaEnum,
 	BalancethicknessThickeningRateEnum,
+	BasalCrevasseEnum,
 	BasalforcingsFloatingiceMeltingRateEnum,
 	BasalforcingsGeothermalfluxEnum,
 	BasalforcingsGroundediceMeltingRateEnum,
+	BasalforcingsIsmip6BasinIdEnum,
+	BasalforcingsIsmip6TfEnum,
+	BasalforcingsIsmip6TfShelfEnum,
+	BasalforcingsIsmip6MeltAnomalyEnum,
+	BasalforcingsOceanSalinityEnum,
+	BasalforcingsOceanTempEnum,
 	BasalforcingsPicoBasinIdEnum,
 	BasalforcingsPicoBoxIdEnum,
@@ -399,4 +467,7 @@
 	BasalforcingsPicoSubShelfOceanSalinityEnum,
 	BasalforcingsPicoSubShelfOceanTempEnum,
+	BasalStressxEnum,
+	BasalStressyEnum,
+	BasalStressEnum,
 	BaseEnum,
 	BaseSlopeXEnum,
@@ -407,18 +478,22 @@
 	CalvingCalvingrateEnum,
 	CalvingHabFractionEnum,
+	CalvingMeltingrateEnum,
+	CalvingStressThresholdFloatingiceEnum,
+	CalvingStressThresholdGroundediceEnum,
 	CalvinglevermannCoeffEnum,
-	CalvinglevermannMeltingrateEnum,
-	CalvingMeltingrateEnum,
 	CalvingratexAverageEnum,
 	CalvingratexEnum,
 	CalvingrateyAverageEnum,
 	CalvingrateyEnum,
-	CalvingStressThresholdFloatingiceEnum,
-	CalvingStressThresholdGroundediceEnum,
+	CalvingFluxLevelsetEnum,
+	CalvingMeltingFluxLevelsetEnum,
 	ConvergedEnum,
 	CrevasseDepthEnum,
+	DamageDEnum,
 	DamageDbarEnum,
-	DamageDEnum,
 	DamageFEnum,
+	DegreeOfChannelizationEnum,
+	DepthBelowSurfaceEnum,
+	DeviatoricStresseffectiveEnum,
 	DeviatoricStressxxEnum,
 	DeviatoricStressxyEnum,
@@ -427,4 +502,6 @@
 	DeviatoricStressyzEnum,
 	DeviatoricStresszzEnum,
+	DeviatoricStress1Enum,
+	DeviatoricStress2Enum,
 	DistanceToCalvingfrontEnum,
 	DistanceToGroundinglineEnum,
@@ -435,22 +512,32 @@
 	DrivingStressXEnum,
 	DrivingStressYEnum,
-	EffectivePressureHydrostepEnum,
+   EffectivePressureEnum,
+	EffectivePressureSubstepEnum,
+	EffectivePressureTransientEnum,
 	EnthalpyEnum,
 	EnthalpyPicardEnum,
-	EplHeadHydrostepEnum,
-	EplHeadOldEnum,
+	EplHeadEnum,
+   EplHeadOldEnum,
 	EplHeadSlopeXEnum,
 	EplHeadSlopeYEnum,
+	EplHeadSubstepEnum,
+   EplHeadTransientEnum,
 	EsaDeltathicknessEnum,
 	EsaEmotionEnum,
 	EsaNmotionEnum,
+	EsaRotationrateEnum,
+	EsaStrainratexxEnum,
+	EsaStrainratexyEnum,
+	EsaStrainrateyyEnum,
 	EsaUmotionEnum,
 	EsaXmotionEnum,
 	EsaYmotionEnum,
 	EtaDiffEnum,
+	FlowequationBorderFSEnum,
 	FrictionAsEnum,
 	FrictionCEnum,
+	FrictionCmaxEnum,
+	FrictionCoefficientEnum,
 	FrictionCoefficientcoulombEnum,
-	FrictionCoefficientEnum,
 	FrictionEffectivePressureEnum,
 	FrictionMEnum,
@@ -458,20 +545,28 @@
 	FrictionPressureAdjustedTemperatureEnum,
 	FrictionQEnum,
+	FrictionSedimentCompressibilityCoefficientEnum,
+	FrictionTillFrictionAngleEnum,
 	FrictionWaterLayerEnum,
-	HydrologyWatercolumnMaxEnum,
-	FrictionTillFrictionAngleEnum,
-	FrictionSedimentCompressibilityCoefficientEnum,
+	FrictionfEnum,
+	FrontalForcingsBasinIdEnum,
+	FrontalForcingsSubglacialDischargeEnum,
+	FrontalForcingsThermalForcingEnum,
 	GeometryHydrostaticRatioEnum,
 	GiaLithosphereThicknessEnum,
 	GiaMantleViscosityEnum,
+	GiaWEnum,
 	GiadWdtEnum,
-	GiaWEnum,
 	GradientEnum,
 	GroundinglineHeightEnum,
+	HydraulicPotentialEnum,
+	HydraulicPotentialOldEnum,
+	HydrologyBasalFluxEnum,
 	HydrologyBumpHeightEnum,
 	HydrologyBumpSpacingEnum,
 	HydrologydcBasalMoulinInputEnum,
-	HydrologydcEplThicknessHydrostepEnum,
+	HydrologydcEplThicknessEnum,
 	HydrologydcEplThicknessOldEnum,
+	HydrologydcEplThicknessSubstepEnum,
+	HydrologydcEplThicknessTransientEnum,
 	HydrologydcMaskEplactiveEltEnum,
 	HydrologydcMaskEplactiveNodeEnum,
@@ -479,5 +574,6 @@
 	HydrologydcMaskThawedNodeEnum,
 	HydrologydcSedimentTransmitivityEnum,
-	HydrologyEnglacialInputEnum,
+   HydrologyDrainageRateEnum,
+   HydrologyEnglacialInputEnum,
 	HydrologyGapHeightEnum,
 	HydrologyHeadEnum,
@@ -486,7 +582,10 @@
 	HydrologyNeumannfluxEnum,
 	HydrologyReynoldsEnum,
+	HydrologySheetConductivityEnum,
+	HydrologySheetThicknessEnum,
+	HydrologySheetThicknessOldEnum,
+	HydrologyWatercolumnMaxEnum,
 	HydrologyWaterVxEnum,
 	HydrologyWaterVyEnum,
-	HydrologyDrainageRateEnum,
 	IceEnum,
 	IceMaskNodeActivationEnum,
@@ -505,13 +604,15 @@
 	MaskGroundediceLevelsetEnum,
 	MaskIceLevelsetEnum,
+	MaskLandLevelsetEnum,
+	MaskOceanLevelsetEnum,
 	MasstransportSpcthicknessEnum,
+	MaterialsRheologyBEnum,
 	MaterialsRheologyBbarEnum,
-	MaterialsRheologyBEnum,
+	MaterialsRheologyEEnum,
 	MaterialsRheologyEbarEnum,
+	MaterialsRheologyEcEnum,
 	MaterialsRheologyEcbarEnum,
-	MaterialsRheologyEcEnum,
-	MaterialsRheologyEEnum,
+	MaterialsRheologyEsEnum,
 	MaterialsRheologyEsbarEnum,
-	MaterialsRheologyEsEnum,
 	MaterialsRheologyNEnum,
 	MeshScaleFactorEnum,
@@ -521,4 +622,5 @@
 	MisfitEnum,
 	NeumannfluxEnum,
+	NewDamageEnum,
 	NodeEnum,
 	OmegaAbsGradientEnum,
@@ -526,31 +628,48 @@
 	P1Enum,
 	PressureEnum,
+	RadarEnum,
+	RadarAttenuationMacGregorEnum,
+	RadarAttenuationWolffEnum,
+	RadarIcePeriodEnum,
+	RadarPowerMacGregorEnum,
+	RadarPowerWolffEnum,
 	RheologyBAbsGradientEnum,
+	RheologyBInitialguessEnum,
+	RheologyBInitialguessMisfitEnum,
 	RheologyBbarAbsGradientEnum,
 	SealevelEnum,
+	SealevelEustaticMaskEnum,
+	SealevelEustaticOceanMaskEnum,
+	SealevelNEsaEnum,
+	SealevelNEsaRateEnum,
+	SealevelNGiaEnum,
+	SealevelNGiaRateEnum,
+	SealevelRSLEnum,
+	SealevelRSLEustaticEnum,
+	SealevelRSLEustaticRateEnum,
+	SealevelRSLRateEnum,
+	SealevelUEastEsaEnum,
+	SealevelUEsaEnum,
+	SealevelUEsaRateEnum,
+	SealevelUGiaEnum,
+	SealevelUGiaRateEnum,
+	SealevelUNorthEsaEnum,
 	SealevelriseCumDeltathicknessEnum,
 	SealevelriseDeltathicknessEnum,
-	SealevelUEsaRateEnum,
-	SealevelNEsaRateEnum,
-	SealevelRSLRateEnum,
-	SealevelUEsaEnum,
-	SealevelRSLEustaticRateEnum,
-	SealevelNEsaEnum,
-	SealevelUGiaEnum,
-	SealevelNGiaEnum,
-	SealevelRSLEnum,
-	SealevelRSLEustaticEnum,
-	SealevelUNorthEsaEnum,
-	SealevelUEastEsaEnum,
-	SealevelNGiaRateEnum,
-	SealevelUGiaRateEnum,
-	SedimentHeadHydrostepEnum,
-	SedimentHeadOldEnum,
+	SealevelriseSpcthicknessEnum,
+	SealevelriseStericRateEnum,
+	SealevelriseHydroRateEnum,
+   SedimentHeadEnum,
+   SedimentHeadOldEnum,
+	SedimentHeadSubstepEnum,
+	SedimentHeadTransientEnum,
 	SedimentHeadResidualEnum,
+	SedimentHeadStackedEnum,
 	SigmaNNEnum,
+	SigmaVMEnum,
+	SmbAEnum,
+	SmbAValueEnum,
 	SmbAccumulationEnum,
-	SmbAEnum,
 	SmbAiniEnum,
-	SmbAValueEnum,
 	SmbBMaxEnum,
 	SmbBMinEnum,
@@ -559,11 +678,21 @@
 	SmbCEnum,
 	SmbDEnum,
+	SmbDailyairdensityEnum,
+	SmbDailyairhumidityEnum,
+	SmbDailydlradiationEnum,
+	SmbDailydsradiationEnum,
+	SmbDailypressureEnum,
+	SmbDailyrainfallEnum,
+	SmbDailysnowfallEnum,
+	SmbDailytemperatureEnum,
+	SmbDailywindspeedEnum,
 	SmbDiniEnum,
 	SmbDlwrfEnum,
 	SmbDswrfEnum,
+	SmbDzAddEnum,
 	SmbDzEnum,
-	SmbDziniEnum,
 	SmbDzMinEnum,
 	SmbDzTopEnum,
+	SmbDziniEnum,
 	SmbEAirEnum,
 	SmbECEnum,
@@ -571,4 +700,5 @@
 	SmbElaEnum,
 	SmbEvaporationEnum,
+	SmbFACEnum,
 	SmbGdnEnum,
 	SmbGdniniEnum,
@@ -577,11 +707,20 @@
 	SmbHrefEnum,
 	SmbIsInitializedEnum,
+	SmbMAddEnum,
+	SmbMassBalanceClimateEnum,
 	SmbMassBalanceEnum,
+   SmbMassBalanceSubstepEnum,
+   SmbMassBalanceTransientEnum,
+	SmbMeanLHFEnum,
+	SmbMeanSHFEnum,
+	SmbMeanULWEnum,
 	SmbMeltEnum,
 	SmbMonthlytemperaturesEnum,
+	SmbNetLWEnum,
+	SmbNetSWEnum,
 	SmbPAirEnum,
+	SmbPEnum,
 	SmbPddfacIceEnum,
 	SmbPddfacSnowEnum,
-	SmbPEnum,
 	SmbPrecipitationEnum,
 	SmbPrecipitationsAnomalyEnum,
@@ -593,20 +732,24 @@
 	SmbReiniEnum,
 	SmbRunoffEnum,
+   SmbRunoffSubstepEnum,
+   SmbRunoffTransientEnum,
+	SmbS0gcmEnum,
 	SmbS0pEnum,
 	SmbS0tEnum,
 	SmbSizeiniEnum,
+	SmbSmbCorrEnum,
 	SmbSmbrefEnum,
-	SmbSmbCorrEnum,
+	SmbTEnum,
 	SmbTaEnum,
+	SmbTeValueEnum,
 	SmbTemperaturesAnomalyEnum,
 	SmbTemperaturesLgmEnum,
 	SmbTemperaturesPresentdayEnum,
 	SmbTemperaturesReconstructedEnum,
-	SmbTEnum,
-	SmbTeValueEnum,
 	SmbTiniEnum,
 	SmbTmeanEnum,
 	SmbTzEnum,
 	SmbVEnum,
+	SmbVmeanEnum,
 	SmbVzEnum,
 	SmbWEnum,
@@ -636,4 +779,5 @@
 	SurfaceAreaEnum,
 	SurfaceAverageVelMisfitEnum,
+	SurfaceCrevasseEnum,
 	SurfaceEnum,
 	SurfaceLogVelMisfitEnum,
@@ -644,5 +788,8 @@
 	SurfaceSlopeYEnum,
 	TemperatureEnum,
+	TemperaturePDDEnum,
 	TemperaturePicardEnum,
+	TemperatureSEMICEnum,
+	ThermalSpctemperatureEnum,
 	ThicknessAbsGradientEnum,
 	ThicknessAbsMisfitEnum,
@@ -650,5 +797,7 @@
 	ThicknessAlongGradientEnum,
 	ThicknessEnum,
+	ThicknessOldEnum,
 	ThicknessPositiveEnum,
+	ThicknessResidualEnum,
 	VelEnum,
 	VxAverageEnum,
@@ -665,6 +814,6 @@
 	VzMeshEnum,
 	VzSSAEnum,
+	WaterColumnOldEnum,
 	WatercolumnEnum,
-	WaterColumnOldEnum,
 	WaterfractionDrainageEnum,
 	WaterfractionDrainageIntegratedEnum,
@@ -672,274 +821,4 @@
 	WaterheightEnum,
 	WeightsSurfaceObservationEnum,
-	/*}}}*/
-	InputsENDEnum,
-	/*Other{{{*/
-	AbsoluteEnum,
-	AdaptiveTimesteppingEnum,
-	AdjointBalancethickness2AnalysisEnum,
-	AdjointBalancethicknessAnalysisEnum,
-	AdjointHorizAnalysisEnum,
-	AdjointpEnum,
-	AggressiveMigrationEnum,
-	AmrBamgEnum,
-	AmrNeopzEnum,
-	AndroidFrictionCoefficientEnum,
-	ArrheniusEnum,
-	AutodiffJacobianEnum,
-	Balancethickness2AnalysisEnum,
-	Balancethickness2SolutionEnum,
-	BalancethicknessAnalysisEnum,
-	BalancethicknessApparentMassbalanceEnum,
-	BalancethicknessSoftAnalysisEnum,
-	BalancethicknessSoftSolutionEnum,
-	BalancethicknessSolutionEnum,
-	BalancethicknessSpcthicknessEnum,
-	BalancevelocityAnalysisEnum,
-	BalancevelocitySolutionEnum,
-	BasalCrevasseEnum,
-	BasalforcingsPicoEnum,
-	BedSlopeSolutionEnum,
-	BoolExternalResultEnum,
-	BoolInputEnum,
-	BoolParamEnum,
-	BoundaryEnum,
-	BuddJackaEnum,
-	CalvingDev2Enum,
-	CalvingHabEnum,
-	CalvingLevermannEnum,
-	CalvingVonmisesEnum,
-	CfsurfacelogvelEnum,
-	CfsurfacesquareEnum,
-	CfdragcoeffabsgradEnum,
-	ClosedEnum,
-	ColinearEnum,
-	ConstantsGEnum,
-	ConstantsReferencetemperatureEnum,
-	ConstraintsEnum,
-	ContactEnum,
-	ContourEnum,
-	ContoursEnum,
-	ControlInputEnum,
-	ControlInputValuesEnum,
-	ControlInputMinsEnum,
-	ControlInputMaxsEnum,
-	ControlInputGradEnum,
-	CrouzeixRaviartEnum,
-	CuffeyEnum,
-	CuffeyTemperateEnum,
-	DamageEvolutionAnalysisEnum,
-	DamageEvolutionSolutionEnum,
-	DataSetEnum,
-	DatasetInputEnum,
-	DataSetParamEnum,
-	DefaultAnalysisEnum,
-	DefaultCalvingEnum,
-	DegreeOfChannelizationEnum,
-	DenseEnum,
-	DependentObjectEnum,
-	DepthAverageAnalysisEnum,
-	DeviatoricStresseffectiveEnum,
-	DeviatoricStressErrorEstimatorEnum,
-	DivergenceEnum,
-	Domain3DsurfaceEnum,
-	DoubleArrayInputEnum,
-	DoubleExternalResultEnum,
-	DoubleInputEnum,
-	DoubleMatArrayParamEnum,
-	DoubleMatExternalResultEnum,
-	DoubleMatParamEnum,
-	DoubleParamEnum,
-	DoubleVecParamEnum,
-	EffectivePressureStackedEnum,
-	EffectivePressureEnum,
-	ElementEnum,
-	ElementHookEnum,
-	ElementSIdEnum,
-	EnthalpyAnalysisEnum,
-	EplHeadStackedEnum,
-	EplHeadEnum,
-	EsaAnalysisEnum,
-	EsaRotationrateEnum,
-	EsaSolutionEnum,
-	EsaStrainratexxEnum,
-	EsaStrainratexyEnum,
-	EsaStrainrateyyEnum,
-	EsaTransitionsEnum,
-	ExternalResultEnum,
-	ExtrapolationAnalysisEnum,
-	ExtrudeFromBaseAnalysisEnum,
-	ExtrudeFromTopAnalysisEnum,
-	FemModelEnum,
-	FileParamEnum,
-	FixedTimesteppingEnum,
-	FloatingAreaEnum,
-	FloatingAreaScaledEnum,
-	FloatingMeltRateEnum,
-	FlowequationBorderFSEnum,
-	FreeEnum,
-	FreeSurfaceBaseAnalysisEnum,
-	FreeSurfaceTopAnalysisEnum,
-	FSApproximationEnum,
-	FsetEnum,
-	FSpressureEnum,
-	FSSolverEnum,
-	FSvelocityEnum,
-	FullMeltOnPartiallyFloatingEnum,
-	GaussPentaEnum,
-	GaussSegEnum,
-	GaussTetraEnum,
-	GaussTriaEnum,
-	GenericOptionEnum,
-	GenericParamEnum,
-	GLheightadvectionAnalysisEnum,
-	GiaIvinsAnalysisEnum,
-	GiaSolutionEnum,
-	Gradient1Enum,
-	Gradient2Enum,
-	Gradient3Enum,
-	GroundedAreaEnum,
-	GroundedAreaScaledEnum,
-	GroundingOnlyEnum,
-	GsetEnum,
-	GslEnum,
-	HOApproximationEnum,
-	HOFSApproximationEnum,
-	HookEnum,
-	HydrologyBasalFluxEnum,
-	HydrologyDCEfficientAnalysisEnum,
-	HydrologydcEnum,
-	HydrologydcEplColapseThicknessEnum,
-	HydrologydcEplCompressibilityEnum,
-	HydrologydcEplConductivityEnum,
-	HydrologydcEplInitialThicknessEnum,
-	HydrologydcEplMaxThicknessEnum,
-	HydrologydcEplPorosityEnum,
-	HydrologydcEplThicknessStackedEnum,
-	HydrologydcEplThicknessEnum,
-	HydrologyDCInefficientAnalysisEnum,
-	HydrologydcSedimentCompressibilityEnum,
-	HydrologydcSedimentPorosityEnum,
-	HydrologydcSedimentThicknessEnum,
-	HydrologydcWaterCompressibilityEnum,
-	HydrologyShreveAnalysisEnum,
-	HydrologyshreveEnum,
-	HydrologySolutionEnum,
-	HydrologyShaktiAnalysisEnum,
-	HydrologyPismAnalysisEnum,
-	HydrologyshaktiEnum,
-	HydrologypismEnum,
-	IceMassEnum,
-	IceMassScaledEnum,
-	IceVolumeAboveFloatationEnum,
-	IceVolumeAboveFloatationScaledEnum,
-	IceVolumeEnum,
-	IceVolumeScaledEnum,
-	IncrementalEnum,
-	IndexedEnum,
-	InternalEnum,
-	IntersectEnum,
-	IntExternalResultEnum,
-	IntInputEnum,
-	IntMatExternalResultEnum,
-	IntMatParamEnum,
-	IntParamEnum,
-	IntVecParamEnum,
-	InversionVzObsEnum,
-	JEnum,
-	L1L2ApproximationEnum,
-	L2ProjectionBaseAnalysisEnum,
-	L2ProjectionEPLAnalysisEnum,
-	LACrouzeixRaviartEnum,
-	LambdaSEnum,
-	LATaylorHoodEnum,
-	LevelsetAnalysisEnum,
-	LevelsetfunctionPicardEnum,
-	LinearFloatingMeltRateEnum,
-	SpatialLinearFloatingMeltRateEnum,
-	LliboutryDuvalEnum,
-	LoadsEnum,
-	LoveAnalysisEnum,
-	LoveHiEnum,
-	LoveHrEnum,
-	LoveKernelsImagEnum,
-	LoveKernelsRealEnum,
-	LoveKiEnum,
-	LoveKrEnum,
-	LoveLiEnum,
-	LoveLrEnum,
-	LoveSolutionEnum,
-	MantlePlumeGeothermalFluxEnum,
-	MaskLandLevelsetEnum,
-	MaskOceanLevelsetEnum,
-	MassconaxpbyEnum,
-	MassconEnum,
-	MassfluxatgateEnum,
-	MassFluxEnum,
-	MasstransportAnalysisEnum,
-	MasstransportSolutionEnum,
-	MatdamageiceEnum,
-	MatenhancediceEnum,
-	MaterialsBetaEnum,
-	MaterialsEarthDensityEnum,
-	MaterialsEnum,
-	MaterialsHeatcapacityEnum,
-	MaterialsLatentheatEnum,
-	MaterialsLithosphereDensityEnum,
-	MaterialsLithosphereShearModulusEnum,
-	MaterialsMantleDensityEnum,
-	MaterialsMantleShearModulusEnum,
-	MaterialsMeltingpointEnum,
-	MaterialsMixedLayerCapacityEnum,
-	MaterialsMuWaterEnum,
-	MaterialsRheologyLawEnum,
-	MaterialsRhoFreshwaterEnum,
-	MaterialsRhoSeawaterEnum,
-	MaterialsTemperateiceconductivityEnum,
-	MaterialsThermalconductivityEnum,
-	MaterialsThermalExchangeVelocityEnum,
-	MatestarEnum,
-	MaticeEnum,
-	MatlithoEnum,
-	MatparEnum,
-	MatrixParamEnum,
-	MaxAbsVxEnum,
-	MaxAbsVyEnum,
-	MaxAbsVzEnum,
-	MaxDivergenceEnum,
-	MaxVelEnum,
-	MaxVxEnum,
-	MaxVyEnum,
-	MaxVzEnum,
-	MelangeEnum,
-	MeltingAnalysisEnum,
-	MeshElementsEnum,
-	MeshXEnum,
-	MeshYEnum,
-	MINIcondensedEnum,
-	MINIEnum,
-	MinVelEnum,
-	MinVxEnum,
-	MinVyEnum,
-	MinVzEnum,
-	MismipFloatingMeltRateEnum,
-	MoulinEnum,
-	MpiDenseEnum,
-	MpiEnum,
-	MpiSparseEnum,
-	MumpsEnum,
-	NewDamageEnum,
-	NodalEnum,
-	NodalvalueEnum,
-	NodeSIdEnum,
-	NoFrictionOnPartiallyFloatingEnum,
-	NoMeltOnPartiallyFloatingEnum,
-	NoneApproximationEnum,
-	NoneEnum,
-	NumberedcostfunctionEnum,
-	NumericalfluxEnum,
-	OldGradientEnum,
-	OneLayerP4zEnum,
-	OpenEnum,
-	OptionEnum,
 	Outputdefinition1Enum,
 	Outputdefinition10Enum,
@@ -1042,16 +921,251 @@
 	Outputdefinition9Enum,
 	Outputdefinition100Enum,
+	/*}}}*/
+	InputsENDEnum,
+	/*Other{{{*/
+	AbsoluteEnum,
+	AdaptiveTimesteppingEnum,
+	AdjointBalancethickness2AnalysisEnum,
+	AdjointBalancethicknessAnalysisEnum,
+	AdjointHorizAnalysisEnum,
+	AggressiveMigrationEnum,
+	AmrBamgEnum,
+	AmrNeopzEnum,
+	AndroidFrictionCoefficientEnum,
+	ArrheniusEnum,
+	AutodiffJacobianEnum,
+	Balancethickness2AnalysisEnum,
+	Balancethickness2SolutionEnum,
+	BalancethicknessAnalysisEnum,
+	BalancethicknessApparentMassbalanceEnum,
+	BalancethicknessSoftAnalysisEnum,
+	BalancethicknessSoftSolutionEnum,
+	BalancethicknessSolutionEnum,
+	BalancethicknessSpcthicknessEnum,
+	BalancevelocityAnalysisEnum,
+	BalancevelocitySolutionEnum,
+	BasalforcingsIsmip6Enum,
+	BasalforcingsPicoEnum,
+	BeckmannGoosseFloatingMeltRateEnum,
+	BedSlopeSolutionEnum,
+	BoolExternalResultEnum,
+	BoolInputEnum,
+	BoolParamEnum,
+	BoundaryEnum,
+	BuddJackaEnum,
+	CalvingDev2Enum,
+	CalvingHabEnum,
+	CalvingLevermannEnum,
+	CalvingVonmisesEnum,
+	CfdragcoeffabsgradEnum,
+	CfsurfacelogvelEnum,
+	CfsurfacesquareEnum,
+	ChannelEnum,
+	ChannelAreaEnum,
+	ChannelAreaOldEnum,
+	ClosedEnum,
+	ColinearEnum,
+	ConstraintsEnum,
+	ContactEnum,
+	ContourEnum,
+	ContoursEnum,
+	ControlInputEnum,
+	ControlInputGradEnum,
+	ControlInputMaxsEnum,
+	ControlInputMinsEnum,
+	ControlInputValuesEnum,
+	CrouzeixRaviartEnum,
+	CuffeyEnum,
+	CuffeyTemperateEnum,
+	DamageEvolutionAnalysisEnum,
+	DamageEvolutionSolutionEnum,
+	DataSetEnum,
+	DataSetParamEnum,
+	DatasetInputEnum,
+	DefaultAnalysisEnum,
+	DefaultCalvingEnum,
+	DenseEnum,
+	DependentObjectEnum,
+	DepthAverageAnalysisEnum,
+	DeviatoricStressErrorEstimatorEnum,
+	DivergenceEnum,
+	Domain3DsurfaceEnum,
+	DoubleArrayInputEnum,
+	DoubleExternalResultEnum,
+	DoubleInputEnum,
+	DoubleMatArrayParamEnum,
+	DoubleMatExternalResultEnum,
+	DoubleMatParamEnum,
+	DoubleParamEnum,
+	DoubleVecParamEnum,
+	ElementEnum,
+	ElementHookEnum,
+	ElementSIdEnum,
+	EnthalpyAnalysisEnum,
+	EsaAnalysisEnum,
+	EsaSolutionEnum,
+	EsaTransitionsEnum,
+	ExternalResultEnum,
+	ExtrapolationAnalysisEnum,
+	ExtrudeFromBaseAnalysisEnum,
+	ExtrudeFromTopAnalysisEnum,
+	FSApproximationEnum,
+	FSSolverEnum,
+	FSpressureEnum,
+	FSvelocityEnum,
+	FemModelEnum,
+	FileParamEnum,
+	FixedTimesteppingEnum,
+	FloatingAreaEnum,
+	FloatingAreaScaledEnum,
+	FloatingMeltRateEnum,
+	FreeEnum,
+	FreeSurfaceBaseAnalysisEnum,
+	FreeSurfaceTopAnalysisEnum,
+	FrontalForcingsDefaultEnum,
+	FrontalForcingsRignotEnum,
+	FsetEnum,
+	FullMeltOnPartiallyFloatingEnum,
+	GLheightadvectionAnalysisEnum,
+	GaussPentaEnum,
+	GaussSegEnum,
+	GaussTetraEnum,
+	GaussTriaEnum,
+	GenericOptionEnum,
+	GenericParamEnum,
+	GiaIvinsAnalysisEnum,
+	GiaSolutionEnum,
+	Gradient1Enum,
+	Gradient2Enum,
+	Gradient3Enum,
+	GroundedAreaEnum,
+	GroundedAreaScaledEnum,
+	GroundingOnlyEnum,
+	GroundinglineMassFluxEnum,
+	GsetEnum,
+	GslEnum,
+	HOApproximationEnum,
+	HOFSApproximationEnum,
+	HookEnum,
+	HydrologyDCEfficientAnalysisEnum,
+	HydrologyDCInefficientAnalysisEnum,
+	HydrologyGlaDSAnalysisEnum,
+	HydrologyGlaDSEnum,
+	HydrologyPismAnalysisEnum,
+	HydrologyShaktiAnalysisEnum,
+	HydrologyShreveAnalysisEnum,
+	HydrologySolutionEnum,
+	HydrologydcEnum,
+	HydrologypismEnum,
+	HydrologyshaktiEnum,
+	HydrologyshreveEnum,
+	IceMassEnum,
+	IceMassScaledEnum,
+	IceVolumeAboveFloatationEnum,
+	IceVolumeAboveFloatationScaledEnum,
+	IceVolumeEnum,
+	IceVolumeScaledEnum,
+	IcefrontMassFluxEnum,
+	IcefrontMassFluxLevelsetEnum,
+	IncrementalEnum,
+	IndexedEnum,
+	IntExternalResultEnum,
+	IntInputEnum,
+	IntMatExternalResultEnum,
+	IntMatParamEnum,
+	IntParamEnum,
+	IntVecParamEnum,
+	InternalEnum,
+	IntersectEnum,
+	InversionVzObsEnum,
+	JEnum,
+	L1L2ApproximationEnum,
+	L2ProjectionBaseAnalysisEnum,
+	L2ProjectionEPLAnalysisEnum,
+	LACrouzeixRaviartEnum,
+	LATaylorHoodEnum,
+	LambdaSEnum,
+	LevelsetAnalysisEnum,
+	LevelsetfunctionPicardEnum,
+	LinearFloatingMeltRateEnum,
+	LliboutryDuvalEnum,
+	LoadsEnum,
+	LoveAnalysisEnum,
+	LoveHiEnum,
+	LoveHrEnum,
+	LoveKernelsImagEnum,
+	LoveKernelsRealEnum,
+	LoveKiEnum,
+	LoveKrEnum,
+	LoveLiEnum,
+	LoveLrEnum,
+	LoveSolutionEnum,
+	MINIEnum,
+	MINIcondensedEnum,
+	MantlePlumeGeothermalFluxEnum,
+	MassFluxEnum,
+	MassconEnum,
+	MassconaxpbyEnum,
+	MassfluxatgateEnum,
+	MasstransportAnalysisEnum,
+	MasstransportSolutionEnum,
+	MatdamageiceEnum,
+	MatenhancediceEnum,
+	MaterialsEnum,
+	MatestarEnum,
+	MaticeEnum,
+	MatlithoEnum,
+	MatrixParamEnum,
+	MaxAbsVxEnum,
+	MaxAbsVyEnum,
+	MaxAbsVzEnum,
+	MaxDivergenceEnum,
+	MaxVelEnum,
+	MaxVxEnum,
+	MaxVyEnum,
+	MaxVzEnum,
+	MelangeEnum,
+	MeltingAnalysisEnum,
+	MeshElementsEnum,
+	MeshXEnum,
+	MeshYEnum,
+	MinVelEnum,
+	MinVxEnum,
+	MinVyEnum,
+	MinVzEnum,
+	MismipFloatingMeltRateEnum,
+	MoulinEnum,
+	MpiDenseEnum,
+	MpiEnum,
+	MpiSparseEnum,
+	MumpsEnum,
+	NoFrictionOnPartiallyFloatingEnum,
+	NoMeltOnPartiallyFloatingEnum,
+	NodalEnum,
+	NodalvalueEnum,
+	NodeSIdEnum,
+	NoneApproximationEnum,
+	NoneEnum,
+	NumberedcostfunctionEnum,
+	NyeCO2Enum,
+	NyeH2OEnum,
+	NumericalfluxEnum,
+	OldGradientEnum,
+	OneLayerP4zEnum,
+	OpenEnum,
+	OptionEnum,
 	P0ArrayEnum,
-	P1bubblecondensedEnum,
-	P1bubbleEnum,
+	P0DGEnum,
 	P1DGEnum,
 	P1P1Enum,
 	P1P1GLSEnum,
+	P1bubbleEnum,
+	P1bubblecondensedEnum,
 	P1xP2Enum,
 	P1xP3Enum,
 	P1xP4Enum,
+	P2Enum,
+	P2bubbleEnum,
 	P2bubblecondensedEnum,
-	P2bubbleEnum,
-	P2Enum,
 	P2xP1Enum,
 	P2xP4Enum,
@@ -1067,6 +1181,23 @@
 	RegionaloutputEnum,
 	RegularEnum,
-	ResetPenaltiesEnum,
+	RecoveryAnalysisEnum,
 	RiftfrontEnum,
+	SIAApproximationEnum,
+	SMBcomponentsEnum,
+	SMBd18opddEnum,
+	SMBforcingEnum,
+	SMBgcmEnum,
+	SMBgembEnum,
+	SMBgradientsEnum,
+	SMBgradientscomponentsEnum,
+	SMBgradientselaEnum,
+	SMBhenningEnum,
+	SMBmeltcomponentsEnum,
+	SMBpddEnum,
+	SMBpddSicopolisEnum,
+	SMBsemicEnum,
+	SSAApproximationEnum,
+	SSAFSApproximationEnum,
+	SSAHOApproximationEnum,
 	ScaledEnum,
 	SealevelAbsoluteEnum,
@@ -1076,10 +1207,7 @@
 	SealevelInertiaTensorZZEnum,
 	SealevelNmotionEnum,
+	SealevelUmotionEnum,
 	SealevelriseAnalysisEnum,
 	SealevelriseSolutionEnum,
-	SealevelriseStericRateEnum,
-	SealevelUmotionEnum,
-	SedimentHeadStackedEnum,
-	SedimentHeadEnum,
 	SegEnum,
 	SegInputEnum,
@@ -1088,37 +1216,15 @@
 	SeparateEnum,
 	SeqEnum,
-	SIAApproximationEnum,
-	SigmaVMEnum,
 	SmbAnalysisEnum,
-	SMBcomponentsEnum,
-	SMBd18opddEnum,
-	SmbDesfacEnum,
-	SmbDpermilEnum,
-	SmbDzAddEnum,
-	SmbFACEnum,
-	SMBforcingEnum,
-	SMBgcmEnum,
-	SMBgembEnum,
-	SMBgradientselaEnum,
-	SMBgradientsEnum,
-	SMBhenningEnum,
-	SmbMAddEnum,
-	SMBmeltcomponentsEnum,
-	SMBpddEnum,
-	SMBpddSicopolisEnum,
-	SMBgradientscomponentsEnum,
-	SmbRlapsEnum,
-	SmbRlapslgmEnum,
 	SmbSolutionEnum,
 	SmoothAnalysisEnum,
 	SoftMigrationEnum,
+	SpatialLinearFloatingMeltRateEnum,
 	SpcDynamicEnum,
 	SpcStaticEnum,
 	SpcTransientEnum,
-	SSAApproximationEnum,
-	SSAFSApproximationEnum,
-	SSAHOApproximationEnum,
 	SsetEnum,
 	SteadystateSolutionEnum,
+	StressIntensityFactorEnum,
 	StressbalanceAnalysisEnum,
 	StressbalanceConvergenceNumStepsEnum,
@@ -1126,5 +1232,4 @@
 	StressbalanceSolutionEnum,
 	StressbalanceVerticalAnalysisEnum,
-	StressIntensityFactorEnum,
 	StringArrayParamEnum,
 	StringExternalResultEnum,
@@ -1132,17 +1237,16 @@
 	SubelementFriction1Enum,
 	SubelementFriction2Enum,
-	SubelementMigrationEnum,
 	SubelementMelt1Enum,
 	SubelementMelt2Enum,
-	SurfaceCrevasseEnum,
+	SubelementMigrationEnum,
 	SurfaceSlopeSolutionEnum,
 	TaylorHoodEnum,
-	TemperaturePDDEnum,
 	TetraEnum,
 	TetraInputEnum,
 	ThermalAnalysisEnum,
 	ThermalSolutionEnum,
-	ThermalSpctemperatureEnum,
 	ThicknessErrorEstimatorEnum,
+	TotalCalvingFluxLevelsetEnum,
+	TotalCalvingMeltingFluxLevelsetEnum,
 	TotalFloatingBmbEnum,
 	TotalFloatingBmbScaledEnum,
@@ -1160,7 +1264,7 @@
 	VectorParamEnum,
 	VertexEnum,
+	VertexLIdEnum,
 	VertexPIdEnum,
 	VertexSIdEnum,
-	VertexLIdEnum,
 	VerticesEnum,
 	ViscousHeatingEnum,
@@ -1183,6 +1287,6 @@
 	SealevelWeightsEnum,
 	StrainRateEnum,
+	StressTensorEnum,
 	StressbalanceViscosityOvershootEnum,
-	StressTensorEnum,
 	SubelementMigration4Enum,
 	TimesteppingTimeAdaptEnum,
Index: /issm/trunk/src/c/shared/Enum/EnumToStringx.cpp
===================================================================
--- /issm/trunk/src/c/shared/Enum/EnumToStringx.cpp	(revision 24312)
+++ /issm/trunk/src/c/shared/Enum/EnumToStringx.cpp	(revision 24313)
@@ -71,4 +71,11 @@
 		case BasalforcingsDtbgEnum : return "BasalforcingsDtbg";
 		case BasalforcingsEnum : return "Basalforcings";
+		case BasalforcingsIsmip6AverageTfEnum : return "BasalforcingsIsmip6AverageTf";
+		case BasalforcingsIsmip6BasinAreaEnum : return "BasalforcingsIsmip6BasinArea";
+		case BasalforcingsIsmip6DeltaTEnum : return "BasalforcingsIsmip6DeltaT";
+		case BasalforcingsIsmip6Gamma0Enum : return "BasalforcingsIsmip6Gamma0";
+		case BasalforcingsIsmip6IsLocalEnum : return "BasalforcingsIsmip6IsLocal";
+		case BasalforcingsIsmip6NumBasinsEnum : return "BasalforcingsIsmip6NumBasins";
+		case BasalforcingsIsmip6TfDepthsEnum : return "BasalforcingsIsmip6TfDepths";
 		case BasalforcingsLowercrustheatEnum : return "BasalforcingsLowercrustheat";
 		case BasalforcingsMantleconductivityEnum : return "BasalforcingsMantleconductivity";
@@ -95,4 +102,5 @@
 		case BasalforcingsUpperdepthMeltEnum : return "BasalforcingsUpperdepthMelt";
 		case BasalforcingsUpperwaterElevationEnum : return "BasalforcingsUpperwaterElevation";
+		case BasalforcingsUpperwaterMeltingRateEnum : return "BasalforcingsUpperwaterMeltingRate";
 		case CalvingCrevasseDepthEnum : return "CalvingCrevasseDepth";
 		case CalvingHeightAboveFloatationEnum : return "CalvingHeightAboveFloatation";
@@ -101,8 +109,13 @@
 		case CalvingMinthicknessEnum : return "CalvingMinthickness";
 		case ConfigurationTypeEnum : return "ConfigurationType";
+		case ConstantsGEnum : return "ConstantsG";
+		case ConstantsReferencetemperatureEnum : return "ConstantsReferencetemperature";
 		case ConstantsYtsEnum : return "ConstantsYts";
+		case ControlInputSizeMEnum : return "ControlInputSizeM";
+		case ControlInputSizeNEnum : return "ControlInputSizeN";
 		case DamageC1Enum : return "DamageC1";
 		case DamageC2Enum : return "DamageC2";
 		case DamageC3Enum : return "DamageC3";
+		case DamageC4Enum : return "DamageC4";
 		case DamageEnum : return "Damage";
 		case DamageEquivStressEnum : return "DamageEquivStress";
@@ -115,4 +128,5 @@
 		case DamageStabilizationEnum : return "DamageStabilization";
 		case DamageStressThresholdEnum : return "DamageStressThreshold";
+		case DamageStressUBoundEnum : return "DamageStressUBound";
 		case DebugProfilingEnum : return "DebugProfiling";
 		case DomainDimensionEnum : return "DomainDimension";
@@ -133,4 +147,5 @@
 		case FlowequationIsSSAEnum : return "FlowequationIsSSA";
 		case FrictionCouplingEnum : return "FrictionCoupling";
+		case FrictionDeltaEnum : return "FrictionDelta";
 		case FrictionFEnum : return "FrictionF";
 		case FrictionGammaEnum : return "FrictionGamma";
@@ -138,12 +153,34 @@
 		case FrictionPseudoplasticityExponentEnum : return "FrictionPseudoplasticityExponent";
 		case FrictionThresholdSpeedEnum : return "FrictionThresholdSpeed";
-		case FrictionDeltaEnum : return "FrictionDelta";
 		case FrictionVoidRatioEnum : return "FrictionVoidRatio";
+		case FrontalForcingsBasinIcefrontAreaEnum : return "FrontalForcingsBasinIcefrontArea";
+		case FrontalForcingsNumberofBasinsEnum : return "FrontalForcingsNumberofBasins";
+		case FrontalForcingsParamEnum : return "FrontalForcingsParam";
 		case GiaCrossSectionShapeEnum : return "GiaCrossSectionShape";
-		case GroundinglineMigrationEnum : return "GroundinglineMigration";
 		case GroundinglineFrictionInterpolationEnum : return "GroundinglineFrictionInterpolation";
 		case GroundinglineMeltInterpolationEnum : return "GroundinglineMeltInterpolation";
+		case GroundinglineMigrationEnum : return "GroundinglineMigration";
+		case HydrologyCavitySpacingEnum : return "HydrologyCavitySpacing";
+		case HydrologyChannelConductivityEnum : return "HydrologyChannelConductivity";
+		case HydrologyChannelSheetWidthEnum : return "HydrologyChannelSheetWidth";
+		case HydrologyEnglacialVoidRatioEnum : return "HydrologyEnglacialVoidRatio";
+		case HydrologyIschannelsEnum : return "HydrologyIschannels";
+		case HydrologyMeltFlagEnum : return "HydrologyMeltFlag";
+		case HydrologyModelEnum : return "HydrologyModel";
+		case HydrologyNumRequestedOutputsEnum : return "HydrologyNumRequestedOutputs";
+		case HydrologyPressureMeltCoefficientEnum : return "HydrologyPressureMeltCoefficient";
+		case HydrologyRelaxationEnum : return "HydrologyRelaxation";
+		case HydrologyRequestedOutputsEnum : return "HydrologyRequestedOutputs";
+		case HydrologySedimentKmaxEnum : return "HydrologySedimentKmax";
+		case HydrologyStepsPerStepEnum : return "HydrologyStepsPerStep";
+		case HydrologyStorageEnum : return "HydrologyStorage";
+		case HydrologydcEplColapseThicknessEnum : return "HydrologydcEplColapseThickness";
+		case HydrologydcEplCompressibilityEnum : return "HydrologydcEplCompressibility";
+		case HydrologydcEplConductivityEnum : return "HydrologydcEplConductivity";
+		case HydrologydcEplInitialThicknessEnum : return "HydrologydcEplInitialThickness";
+		case HydrologydcEplMaxThicknessEnum : return "HydrologydcEplMaxThickness";
+		case HydrologydcEplPorosityEnum : return "HydrologydcEplPorosity";
+		case HydrologydcEplThickCompEnum : return "HydrologydcEplThickComp";
 		case HydrologydcEplflipLockEnum : return "HydrologydcEplflipLock";
-		case HydrologydcEplThickCompEnum : return "HydrologydcEplThickComp";
 		case HydrologydcIsefficientlayerEnum : return "HydrologydcIsefficientlayer";
 		case HydrologydcLeakageFactorEnum : return "HydrologydcLeakageFactor";
@@ -152,17 +189,13 @@
 		case HydrologydcPenaltyLockEnum : return "HydrologydcPenaltyLock";
 		case HydrologydcRelTolEnum : return "HydrologydcRelTol";
+		case HydrologydcSedimentCompressibilityEnum : return "HydrologydcSedimentCompressibility";
 		case HydrologydcSedimentlimitEnum : return "HydrologydcSedimentlimit";
 		case HydrologydcSedimentlimitFlagEnum : return "HydrologydcSedimentlimitFlag";
+		case HydrologydcSedimentPorosityEnum : return "HydrologydcSedimentPorosity";
+		case HydrologydcSedimentThicknessEnum : return "HydrologydcSedimentThickness";
 		case HydrologydcTransferFlagEnum : return "HydrologydcTransferFlag";
 		case HydrologydcUnconfinedFlagEnum : return "HydrologydcUnconfinedFlag";
-		case HydrologydtEnum : return "Hydrologydt";
-		case HydrologyModelEnum : return "HydrologyModel";
-		case HydrologyNumRequestedOutputsEnum : return "HydrologyNumRequestedOutputs";
-		case HydrologyRelaxationEnum : return "HydrologyRelaxation";
-		case HydrologyRequestedOutputsEnum : return "HydrologyRequestedOutputs";
-		case HydrologySedimentKmaxEnum : return "HydrologySedimentKmax";
+		case HydrologydcWaterCompressibilityEnum : return "HydrologydcWaterCompressibility";
 		case HydrologyshreveStabilizationEnum : return "HydrologyshreveStabilization";
-		case HydrologyStepsPerStepEnum : return "HydrologyStepsPerStep";
-		case HydrologyStorageEnum : return "HydrologyStorage";
 		case IcecapToEarthCommEnum : return "IcecapToEarthComm";
 		case IndexEnum : return "Index";
@@ -176,6 +209,4 @@
 		case InversionControlParametersEnum : return "InversionControlParameters";
 		case InversionControlScalingFactorsEnum : return "InversionControlScalingFactors";
-		case ControlInputSizeMEnum : return "ControlInputSizeM";
-		case ControlInputSizeNEnum : return "ControlInputSizeN";
 		case InversionCostFunctionsEnum : return "InversionCostFunctions";
 		case InversionDxminEnum : return "InversionDxmin";
@@ -194,4 +225,5 @@
 		case InversionStepThresholdEnum : return "InversionStepThreshold";
 		case InversionTypeEnum : return "InversionType";
+		case LevelsetKillIcebergsEnum : return "LevelsetKillIcebergs";
 		case LevelsetReinitFrequencyEnum : return "LevelsetReinitFrequency";
 		case LevelsetStabilizationEnum : return "LevelsetStabilization";
@@ -216,5 +248,23 @@
 		case MasstransportRequestedOutputsEnum : return "MasstransportRequestedOutputs";
 		case MasstransportStabilizationEnum : return "MasstransportStabilization";
+		case MaterialsBetaEnum : return "MaterialsBeta";
+		case MaterialsEarthDensityEnum : return "MaterialsEarthDensity";
+		case MaterialsEffectiveconductivityAveragingEnum : return "MaterialsEffectiveconductivityAveraging";
+		case MaterialsHeatcapacityEnum : return "MaterialsHeatcapacity";
+		case MaterialsLatentheatEnum : return "MaterialsLatentheat";
+		case MaterialsLithosphereDensityEnum : return "MaterialsLithosphereDensity";
+		case MaterialsLithosphereShearModulusEnum : return "MaterialsLithosphereShearModulus";
+		case MaterialsMantleDensityEnum : return "MaterialsMantleDensity";
+		case MaterialsMantleShearModulusEnum : return "MaterialsMantleShearModulus";
+		case MaterialsMeltingpointEnum : return "MaterialsMeltingpoint";
+		case MaterialsMixedLayerCapacityEnum : return "MaterialsMixedLayerCapacity";
+		case MaterialsMuWaterEnum : return "MaterialsMuWater";
+		case MaterialsRheologyLawEnum : return "MaterialsRheologyLaw";
+		case MaterialsRhoFreshwaterEnum : return "MaterialsRhoFreshwater";
 		case MaterialsRhoIceEnum : return "MaterialsRhoIce";
+		case MaterialsRhoSeawaterEnum : return "MaterialsRhoSeawater";
+		case MaterialsTemperateiceconductivityEnum : return "MaterialsTemperateiceconductivity";
+		case MaterialsThermalExchangeVelocityEnum : return "MaterialsThermalExchangeVelocity";
+		case MaterialsThermalconductivityEnum : return "MaterialsThermalconductivity";
 		case MeltingOffsetEnum : return "MeltingOffset";
 		case MeshAverageVertexConnectivityEnum : return "MeshAverageVertexConnectivity";
@@ -231,7 +281,7 @@
 		case OutputBufferPointerEnum : return "OutputBufferPointer";
 		case OutputBufferSizePointerEnum : return "OutputBufferSizePointer";
-		case OutputdefinitionEnum : return "Outputdefinition";
 		case OutputFileNameEnum : return "OutputFileName";
 		case OutputFilePointerEnum : return "OutputFilePointer";
+		case OutputdefinitionEnum : return "Outputdefinition";
 		case ParamEnum : return "Param";
 		case ParametersEnum : return "Parameters";
@@ -241,5 +291,6 @@
 		case QmuNumberofpartitionsEnum : return "QmuNumberofpartitions";
 		case QmuOutNameEnum : return "QmuOutName";
-		case QmuPartitionEnum : return "QmuPartition";
+		case QmuEpartitionEnum : return "QmuEpartition";
+		case QmuVpartitionEnum : return "QmuVpartition";
 		case QmuResponsedescriptorsEnum : return "QmuResponsedescriptors";
 		case QmuVariableDescriptorsEnum : return "QmuVariableDescriptors";
@@ -249,6 +300,4 @@
 		case SaveResultsEnum : return "SaveResults";
 		case SealevelEustaticEnum : return "SealevelEustatic";
-		case SealevelEustaticOceanMaskEnum : return "SealevelEustaticOceanMask";
-		case SealevelEustaticMaskEnum : return "SealevelEustaticMask";
 		case SealevelriseAbstolEnum : return "SealevelriseAbstol";
 		case SealevelriseAngularVelocityEnum : return "SealevelriseAngularVelocity";
@@ -271,21 +320,25 @@
 		case SealevelriseRunCountEnum : return "SealevelriseRunCount";
 		case SealevelriseTidalLoveHEnum : return "SealevelriseTidalLoveH";
-		case SealevelriseSpcthicknessEnum : return "SealevelriseSpcthickness";
 		case SealevelriseTidalLoveKEnum : return "SealevelriseTidalLoveK";
 		case SealevelriseTransitionsEnum : return "SealevelriseTransitions";
 		case SealevelriseUElasticEnum : return "SealevelriseUElastic";
 		case SettingsIoGatherEnum : return "SettingsIoGather";
+		case SettingsNumResultsOnNodesEnum : return "SettingsNumResultsOnNodes";
 		case SettingsOutputFrequencyEnum : return "SettingsOutputFrequency";
 		case SettingsRecordingFrequencyEnum : return "SettingsRecordingFrequency";
 		case SettingsResultsOnNodesEnum : return "SettingsResultsOnNodes";
+		case SettingsSbCouplingFrequencyEnum : return "SettingsSbCouplingFrequency";
 		case SettingsSolverResidueThresholdEnum : return "SettingsSolverResidueThreshold";
 		case SettingsWaitonlockEnum : return "SettingsWaitonlock";
+		case SmbAIceEnum : return "SmbAIce";
+		case SmbAIdxEnum : return "SmbAIdx";
+		case SmbASnowEnum : return "SmbASnow";
 		case SmbAccualtiEnum : return "SmbAccualti";
 		case SmbAccugradEnum : return "SmbAccugrad";
 		case SmbAccurefEnum : return "SmbAccuref";
 		case SmbAdThreshEnum : return "SmbAdThresh";
-		case SmbAIceEnum : return "SmbAIce";
-		case SmbAIdxEnum : return "SmbAIdx";
-		case SmbASnowEnum : return "SmbASnow";
+		case SmbDesfacEnum : return "SmbDesfac";
+		case SmbDpermilEnum : return "SmbDpermil";
+		case SmbDsnowIdxEnum : return "SmbDsnowIdx";
 		case SmbCldFracEnum : return "SmbCldFrac";
 		case SmbDelta18oEnum : return "SmbDelta18o";
@@ -298,15 +351,16 @@
 		case SmbIsaccumulationEnum : return "SmbIsaccumulation";
 		case SmbIsalbedoEnum : return "SmbIsalbedo";
+		case SmbIsclimatologyEnum : return "SmbIsclimatology";
 		case SmbIsd18opdEnum : return "SmbIsd18opd";
 		case SmbIsdelta18oEnum : return "SmbIsdelta18o";
 		case SmbIsdensificationEnum : return "SmbIsdensification";
+		case SmbIsfirnwarmingEnum : return "SmbIsfirnwarming";
 		case SmbIsgraingrowthEnum : return "SmbIsgraingrowth";
-		case SmbIsfirnwarmingEnum : return "SmbIsfirnwarming";
 		case SmbIsmeltEnum : return "SmbIsmelt";
 		case SmbIsmungsmEnum : return "SmbIsmungsm";
+		case SmbIsprecipscaledEnum : return "SmbIsprecipscaled";
 		case SmbIssetpddfacEnum : return "SmbIssetpddfac";
 		case SmbIsshortwaveEnum : return "SmbIsshortwave";
 		case SmbIstemperaturescaledEnum : return "SmbIstemperaturescaled";
-		case SmbIsprecipscaledEnum : return "SmbIsprecipscaled";
 		case SmbIsthermalEnum : return "SmbIsthermal";
 		case SmbIsturbulentfluxEnum : return "SmbIsturbulentflux";
@@ -314,9 +368,13 @@
 		case SmbNumRequestedOutputsEnum : return "SmbNumRequestedOutputs";
 		case SmbPfacEnum : return "SmbPfac";
+		case SmbRdlEnum : return "SmbRdl";
 		case SmbRequestedOutputsEnum : return "SmbRequestedOutputs";
+		case SmbRlapsEnum : return "SmbRlaps";
+		case SmbRlapslgmEnum : return "SmbRlapslgm";
 		case SmbRunoffaltiEnum : return "SmbRunoffalti";
 		case SmbRunoffgradEnum : return "SmbRunoffgrad";
 		case SmbRunoffrefEnum : return "SmbRunoffref";
 		case SmbSealevEnum : return "SmbSealev";
+		case SmbStepsPerStepEnum : return "SmbStepsPerStep";
 		case SmbSwIdxEnum : return "SmbSwIdx";
 		case SmbT0dryEnum : return "SmbT0dry";
@@ -342,4 +400,5 @@
 		case StressbalanceRiftPenaltyThresholdEnum : return "StressbalanceRiftPenaltyThreshold";
 		case StressbalanceShelfDampeningEnum : return "StressbalanceShelfDampening";
+		case ThermalIsdrainicecolumnEnum : return "ThermalIsdrainicecolumn";
 		case ThermalIsdynamicbasalspcEnum : return "ThermalIsdynamicbasalspc";
 		case ThermalIsenthalpyEnum : return "ThermalIsenthalpy";
@@ -352,4 +411,5 @@
 		case ThermalRequestedOutputsEnum : return "ThermalRequestedOutputs";
 		case ThermalStabilizationEnum : return "ThermalStabilization";
+		case ThermalWatercolumnUpperlimitEnum : return "ThermalWatercolumnUpperlimit";
 		case TimeEnum : return "Time";
 		case TimesteppingCflCoefficientEnum : return "TimesteppingCflCoefficient";
@@ -388,4 +448,5 @@
 		case InputsSTARTEnum : return "InputsSTART";
 		case AdjointEnum : return "Adjoint";
+		case AdjointpEnum : return "Adjointp";
 		case AdjointxEnum : return "Adjointx";
 		case AdjointyEnum : return "Adjointy";
@@ -397,7 +458,14 @@
 		case BalancethicknessOmegaEnum : return "BalancethicknessOmega";
 		case BalancethicknessThickeningRateEnum : return "BalancethicknessThickeningRate";
+		case BasalCrevasseEnum : return "BasalCrevasse";
 		case BasalforcingsFloatingiceMeltingRateEnum : return "BasalforcingsFloatingiceMeltingRate";
 		case BasalforcingsGeothermalfluxEnum : return "BasalforcingsGeothermalflux";
 		case BasalforcingsGroundediceMeltingRateEnum : return "BasalforcingsGroundediceMeltingRate";
+		case BasalforcingsIsmip6BasinIdEnum : return "BasalforcingsIsmip6BasinId";
+		case BasalforcingsIsmip6TfEnum : return "BasalforcingsIsmip6Tf";
+		case BasalforcingsIsmip6TfShelfEnum : return "BasalforcingsIsmip6TfShelf";
+		case BasalforcingsIsmip6MeltAnomalyEnum : return "BasalforcingsIsmip6MeltAnomaly";
+		case BasalforcingsOceanSalinityEnum : return "BasalforcingsOceanSalinity";
+		case BasalforcingsOceanTempEnum : return "BasalforcingsOceanTemp";
 		case BasalforcingsPicoBasinIdEnum : return "BasalforcingsPicoBasinId";
 		case BasalforcingsPicoBoxIdEnum : return "BasalforcingsPicoBoxId";
@@ -405,4 +473,7 @@
 		case BasalforcingsPicoSubShelfOceanSalinityEnum : return "BasalforcingsPicoSubShelfOceanSalinity";
 		case BasalforcingsPicoSubShelfOceanTempEnum : return "BasalforcingsPicoSubShelfOceanTemp";
+		case BasalStressxEnum : return "BasalStressx";
+		case BasalStressyEnum : return "BasalStressy";
+		case BasalStressEnum : return "BasalStress";
 		case BaseEnum : return "Base";
 		case BaseSlopeXEnum : return "BaseSlopeX";
@@ -413,18 +484,22 @@
 		case CalvingCalvingrateEnum : return "CalvingCalvingrate";
 		case CalvingHabFractionEnum : return "CalvingHabFraction";
+		case CalvingMeltingrateEnum : return "CalvingMeltingrate";
+		case CalvingStressThresholdFloatingiceEnum : return "CalvingStressThresholdFloatingice";
+		case CalvingStressThresholdGroundediceEnum : return "CalvingStressThresholdGroundedice";
 		case CalvinglevermannCoeffEnum : return "CalvinglevermannCoeff";
-		case CalvinglevermannMeltingrateEnum : return "CalvinglevermannMeltingrate";
-		case CalvingMeltingrateEnum : return "CalvingMeltingrate";
 		case CalvingratexAverageEnum : return "CalvingratexAverage";
 		case CalvingratexEnum : return "Calvingratex";
 		case CalvingrateyAverageEnum : return "CalvingrateyAverage";
 		case CalvingrateyEnum : return "Calvingratey";
-		case CalvingStressThresholdFloatingiceEnum : return "CalvingStressThresholdFloatingice";
-		case CalvingStressThresholdGroundediceEnum : return "CalvingStressThresholdGroundedice";
+		case CalvingFluxLevelsetEnum : return "CalvingFluxLevelset";
+		case CalvingMeltingFluxLevelsetEnum : return "CalvingMeltingFluxLevelset";
 		case ConvergedEnum : return "Converged";
 		case CrevasseDepthEnum : return "CrevasseDepth";
+		case DamageDEnum : return "DamageD";
 		case DamageDbarEnum : return "DamageDbar";
-		case DamageDEnum : return "DamageD";
 		case DamageFEnum : return "DamageF";
+		case DegreeOfChannelizationEnum : return "DegreeOfChannelization";
+		case DepthBelowSurfaceEnum : return "DepthBelowSurface";
+		case DeviatoricStresseffectiveEnum : return "DeviatoricStresseffective";
 		case DeviatoricStressxxEnum : return "DeviatoricStressxx";
 		case DeviatoricStressxyEnum : return "DeviatoricStressxy";
@@ -433,4 +508,6 @@
 		case DeviatoricStressyzEnum : return "DeviatoricStressyz";
 		case DeviatoricStresszzEnum : return "DeviatoricStresszz";
+		case DeviatoricStress1Enum : return "DeviatoricStress1";
+		case DeviatoricStress2Enum : return "DeviatoricStress2";
 		case DistanceToCalvingfrontEnum : return "DistanceToCalvingfront";
 		case DistanceToGroundinglineEnum : return "DistanceToGroundingline";
@@ -441,22 +518,32 @@
 		case DrivingStressXEnum : return "DrivingStressX";
 		case DrivingStressYEnum : return "DrivingStressY";
-		case EffectivePressureHydrostepEnum : return "EffectivePressureHydrostep";
+		case EffectivePressureEnum : return "EffectivePressure";
+		case EffectivePressureSubstepEnum : return "EffectivePressureSubstep";
+		case EffectivePressureTransientEnum : return "EffectivePressureTransient";
 		case EnthalpyEnum : return "Enthalpy";
 		case EnthalpyPicardEnum : return "EnthalpyPicard";
-		case EplHeadHydrostepEnum : return "EplHeadHydrostep";
+		case EplHeadEnum : return "EplHead";
 		case EplHeadOldEnum : return "EplHeadOld";
 		case EplHeadSlopeXEnum : return "EplHeadSlopeX";
 		case EplHeadSlopeYEnum : return "EplHeadSlopeY";
+		case EplHeadSubstepEnum : return "EplHeadSubstep";
+		case EplHeadTransientEnum : return "EplHeadTransient";
 		case EsaDeltathicknessEnum : return "EsaDeltathickness";
 		case EsaEmotionEnum : return "EsaEmotion";
 		case EsaNmotionEnum : return "EsaNmotion";
+		case EsaRotationrateEnum : return "EsaRotationrate";
+		case EsaStrainratexxEnum : return "EsaStrainratexx";
+		case EsaStrainratexyEnum : return "EsaStrainratexy";
+		case EsaStrainrateyyEnum : return "EsaStrainrateyy";
 		case EsaUmotionEnum : return "EsaUmotion";
 		case EsaXmotionEnum : return "EsaXmotion";
 		case EsaYmotionEnum : return "EsaYmotion";
 		case EtaDiffEnum : return "EtaDiff";
+		case FlowequationBorderFSEnum : return "FlowequationBorderFS";
 		case FrictionAsEnum : return "FrictionAs";
 		case FrictionCEnum : return "FrictionC";
+		case FrictionCmaxEnum : return "FrictionCmax";
+		case FrictionCoefficientEnum : return "FrictionCoefficient";
 		case FrictionCoefficientcoulombEnum : return "FrictionCoefficientcoulomb";
-		case FrictionCoefficientEnum : return "FrictionCoefficient";
 		case FrictionEffectivePressureEnum : return "FrictionEffectivePressure";
 		case FrictionMEnum : return "FrictionM";
@@ -464,20 +551,28 @@
 		case FrictionPressureAdjustedTemperatureEnum : return "FrictionPressureAdjustedTemperature";
 		case FrictionQEnum : return "FrictionQ";
+		case FrictionSedimentCompressibilityCoefficientEnum : return "FrictionSedimentCompressibilityCoefficient";
+		case FrictionTillFrictionAngleEnum : return "FrictionTillFrictionAngle";
 		case FrictionWaterLayerEnum : return "FrictionWaterLayer";
-		case HydrologyWatercolumnMaxEnum : return "HydrologyWatercolumnMax";
-		case FrictionTillFrictionAngleEnum : return "FrictionTillFrictionAngle";
-		case FrictionSedimentCompressibilityCoefficientEnum : return "FrictionSedimentCompressibilityCoefficient";
+		case FrictionfEnum : return "Frictionf";
+		case FrontalForcingsBasinIdEnum : return "FrontalForcingsBasinId";
+		case FrontalForcingsSubglacialDischargeEnum : return "FrontalForcingsSubglacialDischarge";
+		case FrontalForcingsThermalForcingEnum : return "FrontalForcingsThermalForcing";
 		case GeometryHydrostaticRatioEnum : return "GeometryHydrostaticRatio";
 		case GiaLithosphereThicknessEnum : return "GiaLithosphereThickness";
 		case GiaMantleViscosityEnum : return "GiaMantleViscosity";
+		case GiaWEnum : return "GiaW";
 		case GiadWdtEnum : return "GiadWdt";
-		case GiaWEnum : return "GiaW";
 		case GradientEnum : return "Gradient";
 		case GroundinglineHeightEnum : return "GroundinglineHeight";
+		case HydraulicPotentialEnum : return "HydraulicPotential";
+		case HydraulicPotentialOldEnum : return "HydraulicPotentialOld";
+		case HydrologyBasalFluxEnum : return "HydrologyBasalFlux";
 		case HydrologyBumpHeightEnum : return "HydrologyBumpHeight";
 		case HydrologyBumpSpacingEnum : return "HydrologyBumpSpacing";
 		case HydrologydcBasalMoulinInputEnum : return "HydrologydcBasalMoulinInput";
-		case HydrologydcEplThicknessHydrostepEnum : return "HydrologydcEplThicknessHydrostep";
+		case HydrologydcEplThicknessEnum : return "HydrologydcEplThickness";
 		case HydrologydcEplThicknessOldEnum : return "HydrologydcEplThicknessOld";
+		case HydrologydcEplThicknessSubstepEnum : return "HydrologydcEplThicknessSubstep";
+		case HydrologydcEplThicknessTransientEnum : return "HydrologydcEplThicknessTransient";
 		case HydrologydcMaskEplactiveEltEnum : return "HydrologydcMaskEplactiveElt";
 		case HydrologydcMaskEplactiveNodeEnum : return "HydrologydcMaskEplactiveNode";
@@ -485,4 +580,5 @@
 		case HydrologydcMaskThawedNodeEnum : return "HydrologydcMaskThawedNode";
 		case HydrologydcSedimentTransmitivityEnum : return "HydrologydcSedimentTransmitivity";
+		case HydrologyDrainageRateEnum : return "HydrologyDrainageRate";
 		case HydrologyEnglacialInputEnum : return "HydrologyEnglacialInput";
 		case HydrologyGapHeightEnum : return "HydrologyGapHeight";
@@ -492,7 +588,10 @@
 		case HydrologyNeumannfluxEnum : return "HydrologyNeumannflux";
 		case HydrologyReynoldsEnum : return "HydrologyReynolds";
+		case HydrologySheetConductivityEnum : return "HydrologySheetConductivity";
+		case HydrologySheetThicknessEnum : return "HydrologySheetThickness";
+		case HydrologySheetThicknessOldEnum : return "HydrologySheetThicknessOld";
+		case HydrologyWatercolumnMaxEnum : return "HydrologyWatercolumnMax";
 		case HydrologyWaterVxEnum : return "HydrologyWaterVx";
 		case HydrologyWaterVyEnum : return "HydrologyWaterVy";
-		case HydrologyDrainageRateEnum : return "HydrologyDrainageRate";
 		case IceEnum : return "Ice";
 		case IceMaskNodeActivationEnum : return "IceMaskNodeActivation";
@@ -511,13 +610,15 @@
 		case MaskGroundediceLevelsetEnum : return "MaskGroundediceLevelset";
 		case MaskIceLevelsetEnum : return "MaskIceLevelset";
+		case MaskLandLevelsetEnum : return "MaskLandLevelset";
+		case MaskOceanLevelsetEnum : return "MaskOceanLevelset";
 		case MasstransportSpcthicknessEnum : return "MasstransportSpcthickness";
+		case MaterialsRheologyBEnum : return "MaterialsRheologyB";
 		case MaterialsRheologyBbarEnum : return "MaterialsRheologyBbar";
-		case MaterialsRheologyBEnum : return "MaterialsRheologyB";
+		case MaterialsRheologyEEnum : return "MaterialsRheologyE";
 		case MaterialsRheologyEbarEnum : return "MaterialsRheologyEbar";
+		case MaterialsRheologyEcEnum : return "MaterialsRheologyEc";
 		case MaterialsRheologyEcbarEnum : return "MaterialsRheologyEcbar";
-		case MaterialsRheologyEcEnum : return "MaterialsRheologyEc";
-		case MaterialsRheologyEEnum : return "MaterialsRheologyE";
+		case MaterialsRheologyEsEnum : return "MaterialsRheologyEs";
 		case MaterialsRheologyEsbarEnum : return "MaterialsRheologyEsbar";
-		case MaterialsRheologyEsEnum : return "MaterialsRheologyEs";
 		case MaterialsRheologyNEnum : return "MaterialsRheologyN";
 		case MeshScaleFactorEnum : return "MeshScaleFactor";
@@ -527,4 +628,5 @@
 		case MisfitEnum : return "Misfit";
 		case NeumannfluxEnum : return "Neumannflux";
+		case NewDamageEnum : return "NewDamage";
 		case NodeEnum : return "Node";
 		case OmegaAbsGradientEnum : return "OmegaAbsGradient";
@@ -532,31 +634,48 @@
 		case P1Enum : return "P1";
 		case PressureEnum : return "Pressure";
+		case RadarEnum : return "Radar";
+		case RadarAttenuationMacGregorEnum : return "RadarAttenuationMacGregor";
+		case RadarAttenuationWolffEnum : return "RadarAttenuationWolff";
+		case RadarIcePeriodEnum : return "RadarIcePeriod";
+		case RadarPowerMacGregorEnum : return "RadarPowerMacGregor";
+		case RadarPowerWolffEnum : return "RadarPowerWolff";
 		case RheologyBAbsGradientEnum : return "RheologyBAbsGradient";
+		case RheologyBInitialguessEnum : return "RheologyBInitialguess";
+		case RheologyBInitialguessMisfitEnum : return "RheologyBInitialguessMisfit";
 		case RheologyBbarAbsGradientEnum : return "RheologyBbarAbsGradient";
 		case SealevelEnum : return "Sealevel";
+		case SealevelEustaticMaskEnum : return "SealevelEustaticMask";
+		case SealevelEustaticOceanMaskEnum : return "SealevelEustaticOceanMask";
+		case SealevelNEsaEnum : return "SealevelNEsa";
+		case SealevelNEsaRateEnum : return "SealevelNEsaRate";
+		case SealevelNGiaEnum : return "SealevelNGia";
+		case SealevelNGiaRateEnum : return "SealevelNGiaRate";
+		case SealevelRSLEnum : return "SealevelRSL";
+		case SealevelRSLEustaticEnum : return "SealevelRSLEustatic";
+		case SealevelRSLEustaticRateEnum : return "SealevelRSLEustaticRate";
+		case SealevelRSLRateEnum : return "SealevelRSLRate";
+		case SealevelUEastEsaEnum : return "SealevelUEastEsa";
+		case SealevelUEsaEnum : return "SealevelUEsa";
+		case SealevelUEsaRateEnum : return "SealevelUEsaRate";
+		case SealevelUGiaEnum : return "SealevelUGia";
+		case SealevelUGiaRateEnum : return "SealevelUGiaRate";
+		case SealevelUNorthEsaEnum : return "SealevelUNorthEsa";
 		case SealevelriseCumDeltathicknessEnum : return "SealevelriseCumDeltathickness";
 		case SealevelriseDeltathicknessEnum : return "SealevelriseDeltathickness";
-		case SealevelUEsaRateEnum : return "SealevelUEsaRate";
-		case SealevelNEsaRateEnum : return "SealevelNEsaRate";
-		case SealevelRSLRateEnum : return "SealevelRSLRate";
-		case SealevelUEsaEnum : return "SealevelUEsa";
-		case SealevelRSLEustaticRateEnum : return "SealevelRSLEustaticRate";
-		case SealevelNEsaEnum : return "SealevelNEsa";
-		case SealevelUGiaEnum : return "SealevelUGia";
-		case SealevelNGiaEnum : return "SealevelNGia";
-		case SealevelRSLEnum : return "SealevelRSL";
-		case SealevelRSLEustaticEnum : return "SealevelRSLEustatic";
-		case SealevelUNorthEsaEnum : return "SealevelUNorthEsa";
-		case SealevelUEastEsaEnum : return "SealevelUEastEsa";
-		case SealevelNGiaRateEnum : return "SealevelNGiaRate";
-		case SealevelUGiaRateEnum : return "SealevelUGiaRate";
-		case SedimentHeadHydrostepEnum : return "SedimentHeadHydrostep";
+		case SealevelriseSpcthicknessEnum : return "SealevelriseSpcthickness";
+		case SealevelriseStericRateEnum : return "SealevelriseStericRate";
+		case SealevelriseHydroRateEnum : return "SealevelriseHydroRate";
+		case SedimentHeadEnum : return "SedimentHead";
 		case SedimentHeadOldEnum : return "SedimentHeadOld";
+		case SedimentHeadSubstepEnum : return "SedimentHeadSubstep";
+		case SedimentHeadTransientEnum : return "SedimentHeadTransient";
 		case SedimentHeadResidualEnum : return "SedimentHeadResidual";
+		case SedimentHeadStackedEnum : return "SedimentHeadStacked";
 		case SigmaNNEnum : return "SigmaNN";
+		case SigmaVMEnum : return "SigmaVM";
+		case SmbAEnum : return "SmbA";
+		case SmbAValueEnum : return "SmbAValue";
 		case SmbAccumulationEnum : return "SmbAccumulation";
-		case SmbAEnum : return "SmbA";
 		case SmbAiniEnum : return "SmbAini";
-		case SmbAValueEnum : return "SmbAValue";
 		case SmbBMaxEnum : return "SmbBMax";
 		case SmbBMinEnum : return "SmbBMin";
@@ -565,11 +684,21 @@
 		case SmbCEnum : return "SmbC";
 		case SmbDEnum : return "SmbD";
+		case SmbDailyairdensityEnum : return "SmbDailyairdensity";
+		case SmbDailyairhumidityEnum : return "SmbDailyairhumidity";
+		case SmbDailydlradiationEnum : return "SmbDailydlradiation";
+		case SmbDailydsradiationEnum : return "SmbDailydsradiation";
+		case SmbDailypressureEnum : return "SmbDailypressure";
+		case SmbDailyrainfallEnum : return "SmbDailyrainfall";
+		case SmbDailysnowfallEnum : return "SmbDailysnowfall";
+		case SmbDailytemperatureEnum : return "SmbDailytemperature";
+		case SmbDailywindspeedEnum : return "SmbDailywindspeed";
 		case SmbDiniEnum : return "SmbDini";
 		case SmbDlwrfEnum : return "SmbDlwrf";
 		case SmbDswrfEnum : return "SmbDswrf";
+		case SmbDzAddEnum : return "SmbDzAdd";
 		case SmbDzEnum : return "SmbDz";
-		case SmbDziniEnum : return "SmbDzini";
 		case SmbDzMinEnum : return "SmbDzMin";
 		case SmbDzTopEnum : return "SmbDzTop";
+		case SmbDziniEnum : return "SmbDzini";
 		case SmbEAirEnum : return "SmbEAir";
 		case SmbECEnum : return "SmbEC";
@@ -577,4 +706,5 @@
 		case SmbElaEnum : return "SmbEla";
 		case SmbEvaporationEnum : return "SmbEvaporation";
+		case SmbFACEnum : return "SmbFAC";
 		case SmbGdnEnum : return "SmbGdn";
 		case SmbGdniniEnum : return "SmbGdnini";
@@ -583,11 +713,20 @@
 		case SmbHrefEnum : return "SmbHref";
 		case SmbIsInitializedEnum : return "SmbIsInitialized";
+		case SmbMAddEnum : return "SmbMAdd";
+		case SmbMassBalanceClimateEnum : return "SmbMassBalanceClimate";
 		case SmbMassBalanceEnum : return "SmbMassBalance";
+		case SmbMassBalanceSubstepEnum : return "SmbMassBalanceSubstep";
+		case SmbMassBalanceTransientEnum : return "SmbMassBalanceTransient";
+		case SmbMeanLHFEnum : return "SmbMeanLHF";
+		case SmbMeanSHFEnum : return "SmbMeanSHF";
+		case SmbMeanULWEnum : return "SmbMeanULW";
 		case SmbMeltEnum : return "SmbMelt";
 		case SmbMonthlytemperaturesEnum : return "SmbMonthlytemperatures";
+		case SmbNetLWEnum : return "SmbNetLW";
+		case SmbNetSWEnum : return "SmbNetSW";
 		case SmbPAirEnum : return "SmbPAir";
+		case SmbPEnum : return "SmbP";
 		case SmbPddfacIceEnum : return "SmbPddfacIce";
 		case SmbPddfacSnowEnum : return "SmbPddfacSnow";
-		case SmbPEnum : return "SmbP";
 		case SmbPrecipitationEnum : return "SmbPrecipitation";
 		case SmbPrecipitationsAnomalyEnum : return "SmbPrecipitationsAnomaly";
@@ -599,20 +738,24 @@
 		case SmbReiniEnum : return "SmbReini";
 		case SmbRunoffEnum : return "SmbRunoff";
+		case SmbRunoffSubstepEnum : return "SmbRunoffSubstep";
+		case SmbRunoffTransientEnum : return "SmbRunoffTransient";
+		case SmbS0gcmEnum : return "SmbS0gcm";
 		case SmbS0pEnum : return "SmbS0p";
 		case SmbS0tEnum : return "SmbS0t";
 		case SmbSizeiniEnum : return "SmbSizeini";
+		case SmbSmbCorrEnum : return "SmbSmbCorr";
 		case SmbSmbrefEnum : return "SmbSmbref";
-		case SmbSmbCorrEnum : return "SmbSmbCorr";
+		case SmbTEnum : return "SmbT";
 		case SmbTaEnum : return "SmbTa";
+		case SmbTeValueEnum : return "SmbTeValue";
 		case SmbTemperaturesAnomalyEnum : return "SmbTemperaturesAnomaly";
 		case SmbTemperaturesLgmEnum : return "SmbTemperaturesLgm";
 		case SmbTemperaturesPresentdayEnum : return "SmbTemperaturesPresentday";
 		case SmbTemperaturesReconstructedEnum : return "SmbTemperaturesReconstructed";
-		case SmbTEnum : return "SmbT";
-		case SmbTeValueEnum : return "SmbTeValue";
 		case SmbTiniEnum : return "SmbTini";
 		case SmbTmeanEnum : return "SmbTmean";
 		case SmbTzEnum : return "SmbTz";
 		case SmbVEnum : return "SmbV";
+		case SmbVmeanEnum : return "SmbVmean";
 		case SmbVzEnum : return "SmbVz";
 		case SmbWEnum : return "SmbW";
@@ -642,4 +785,5 @@
 		case SurfaceAreaEnum : return "SurfaceArea";
 		case SurfaceAverageVelMisfitEnum : return "SurfaceAverageVelMisfit";
+		case SurfaceCrevasseEnum : return "SurfaceCrevasse";
 		case SurfaceEnum : return "Surface";
 		case SurfaceLogVelMisfitEnum : return "SurfaceLogVelMisfit";
@@ -650,5 +794,8 @@
 		case SurfaceSlopeYEnum : return "SurfaceSlopeY";
 		case TemperatureEnum : return "Temperature";
+		case TemperaturePDDEnum : return "TemperaturePDD";
 		case TemperaturePicardEnum : return "TemperaturePicard";
+		case TemperatureSEMICEnum : return "TemperatureSEMIC";
+		case ThermalSpctemperatureEnum : return "ThermalSpctemperature";
 		case ThicknessAbsGradientEnum : return "ThicknessAbsGradient";
 		case ThicknessAbsMisfitEnum : return "ThicknessAbsMisfit";
@@ -656,5 +803,7 @@
 		case ThicknessAlongGradientEnum : return "ThicknessAlongGradient";
 		case ThicknessEnum : return "Thickness";
+		case ThicknessOldEnum : return "ThicknessOld";
 		case ThicknessPositiveEnum : return "ThicknessPositive";
+		case ThicknessResidualEnum : return "ThicknessResidual";
 		case VelEnum : return "Vel";
 		case VxAverageEnum : return "VxAverage";
@@ -671,6 +820,6 @@
 		case VzMeshEnum : return "VzMesh";
 		case VzSSAEnum : return "VzSSA";
+		case WaterColumnOldEnum : return "WaterColumnOld";
 		case WatercolumnEnum : return "Watercolumn";
-		case WaterColumnOldEnum : return "WaterColumnOld";
 		case WaterfractionDrainageEnum : return "WaterfractionDrainage";
 		case WaterfractionDrainageIntegratedEnum : return "WaterfractionDrainageIntegrated";
@@ -678,272 +827,4 @@
 		case WaterheightEnum : return "Waterheight";
 		case WeightsSurfaceObservationEnum : return "WeightsSurfaceObservation";
-		case InputsENDEnum : return "InputsEND";
-		case AbsoluteEnum : return "Absolute";
-		case AdaptiveTimesteppingEnum : return "AdaptiveTimestepping";
-		case AdjointBalancethickness2AnalysisEnum : return "AdjointBalancethickness2Analysis";
-		case AdjointBalancethicknessAnalysisEnum : return "AdjointBalancethicknessAnalysis";
-		case AdjointHorizAnalysisEnum : return "AdjointHorizAnalysis";
-		case AdjointpEnum : return "Adjointp";
-		case AggressiveMigrationEnum : return "AggressiveMigration";
-		case AmrBamgEnum : return "AmrBamg";
-		case AmrNeopzEnum : return "AmrNeopz";
-		case AndroidFrictionCoefficientEnum : return "AndroidFrictionCoefficient";
-		case ArrheniusEnum : return "Arrhenius";
-		case AutodiffJacobianEnum : return "AutodiffJacobian";
-		case Balancethickness2AnalysisEnum : return "Balancethickness2Analysis";
-		case Balancethickness2SolutionEnum : return "Balancethickness2Solution";
-		case BalancethicknessAnalysisEnum : return "BalancethicknessAnalysis";
-		case BalancethicknessApparentMassbalanceEnum : return "BalancethicknessApparentMassbalance";
-		case BalancethicknessSoftAnalysisEnum : return "BalancethicknessSoftAnalysis";
-		case BalancethicknessSoftSolutionEnum : return "BalancethicknessSoftSolution";
-		case BalancethicknessSolutionEnum : return "BalancethicknessSolution";
-		case BalancethicknessSpcthicknessEnum : return "BalancethicknessSpcthickness";
-		case BalancevelocityAnalysisEnum : return "BalancevelocityAnalysis";
-		case BalancevelocitySolutionEnum : return "BalancevelocitySolution";
-		case BasalCrevasseEnum : return "BasalCrevasse";
-		case BasalforcingsPicoEnum : return "BasalforcingsPico";
-		case BedSlopeSolutionEnum : return "BedSlopeSolution";
-		case BoolExternalResultEnum : return "BoolExternalResult";
-		case BoolInputEnum : return "BoolInput";
-		case BoolParamEnum : return "BoolParam";
-		case BoundaryEnum : return "Boundary";
-		case BuddJackaEnum : return "BuddJacka";
-		case CalvingDev2Enum : return "CalvingDev2";
-		case CalvingHabEnum : return "CalvingHab";
-		case CalvingLevermannEnum : return "CalvingLevermann";
-		case CalvingVonmisesEnum : return "CalvingVonmises";
-		case CfsurfacelogvelEnum : return "Cfsurfacelogvel";
-		case CfsurfacesquareEnum : return "Cfsurfacesquare";
-		case CfdragcoeffabsgradEnum : return "Cfdragcoeffabsgrad";
-		case ClosedEnum : return "Closed";
-		case ColinearEnum : return "Colinear";
-		case ConstantsGEnum : return "ConstantsG";
-		case ConstantsReferencetemperatureEnum : return "ConstantsReferencetemperature";
-		case ConstraintsEnum : return "Constraints";
-		case ContactEnum : return "Contact";
-		case ContourEnum : return "Contour";
-		case ContoursEnum : return "Contours";
-		case ControlInputEnum : return "ControlInput";
-		case ControlInputValuesEnum : return "ControlInputValues";
-		case ControlInputMinsEnum : return "ControlInputMins";
-		case ControlInputMaxsEnum : return "ControlInputMaxs";
-		case ControlInputGradEnum : return "ControlInputGrad";
-		case CrouzeixRaviartEnum : return "CrouzeixRaviart";
-		case CuffeyEnum : return "Cuffey";
-		case CuffeyTemperateEnum : return "CuffeyTemperate";
-		case DamageEvolutionAnalysisEnum : return "DamageEvolutionAnalysis";
-		case DamageEvolutionSolutionEnum : return "DamageEvolutionSolution";
-		case DataSetEnum : return "DataSet";
-		case DatasetInputEnum : return "DatasetInput";
-		case DataSetParamEnum : return "DataSetParam";
-		case DefaultAnalysisEnum : return "DefaultAnalysis";
-		case DefaultCalvingEnum : return "DefaultCalving";
-		case DegreeOfChannelizationEnum : return "DegreeOfChannelization";
-		case DenseEnum : return "Dense";
-		case DependentObjectEnum : return "DependentObject";
-		case DepthAverageAnalysisEnum : return "DepthAverageAnalysis";
-		case DeviatoricStresseffectiveEnum : return "DeviatoricStresseffective";
-		case DeviatoricStressErrorEstimatorEnum : return "DeviatoricStressErrorEstimator";
-		case DivergenceEnum : return "Divergence";
-		case Domain3DsurfaceEnum : return "Domain3Dsurface";
-		case DoubleArrayInputEnum : return "DoubleArrayInput";
-		case DoubleExternalResultEnum : return "DoubleExternalResult";
-		case DoubleInputEnum : return "DoubleInput";
-		case DoubleMatArrayParamEnum : return "DoubleMatArrayParam";
-		case DoubleMatExternalResultEnum : return "DoubleMatExternalResult";
-		case DoubleMatParamEnum : return "DoubleMatParam";
-		case DoubleParamEnum : return "DoubleParam";
-		case DoubleVecParamEnum : return "DoubleVecParam";
-		case EffectivePressureStackedEnum : return "EffectivePressureStacked";
-		case EffectivePressureEnum : return "EffectivePressure";
-		case ElementEnum : return "Element";
-		case ElementHookEnum : return "ElementHook";
-		case ElementSIdEnum : return "ElementSId";
-		case EnthalpyAnalysisEnum : return "EnthalpyAnalysis";
-		case EplHeadStackedEnum : return "EplHeadStacked";
-		case EplHeadEnum : return "EplHead";
-		case EsaAnalysisEnum : return "EsaAnalysis";
-		case EsaRotationrateEnum : return "EsaRotationrate";
-		case EsaSolutionEnum : return "EsaSolution";
-		case EsaStrainratexxEnum : return "EsaStrainratexx";
-		case EsaStrainratexyEnum : return "EsaStrainratexy";
-		case EsaStrainrateyyEnum : return "EsaStrainrateyy";
-		case EsaTransitionsEnum : return "EsaTransitions";
-		case ExternalResultEnum : return "ExternalResult";
-		case ExtrapolationAnalysisEnum : return "ExtrapolationAnalysis";
-		case ExtrudeFromBaseAnalysisEnum : return "ExtrudeFromBaseAnalysis";
-		case ExtrudeFromTopAnalysisEnum : return "ExtrudeFromTopAnalysis";
-		case FemModelEnum : return "FemModel";
-		case FileParamEnum : return "FileParam";
-		case FixedTimesteppingEnum : return "FixedTimestepping";
-		case FloatingAreaEnum : return "FloatingArea";
-		case FloatingAreaScaledEnum : return "FloatingAreaScaled";
-		case FloatingMeltRateEnum : return "FloatingMeltRate";
-		case FlowequationBorderFSEnum : return "FlowequationBorderFS";
-		case FreeEnum : return "Free";
-		case FreeSurfaceBaseAnalysisEnum : return "FreeSurfaceBaseAnalysis";
-		case FreeSurfaceTopAnalysisEnum : return "FreeSurfaceTopAnalysis";
-		case FSApproximationEnum : return "FSApproximation";
-		case FsetEnum : return "Fset";
-		case FSpressureEnum : return "FSpressure";
-		case FSSolverEnum : return "FSSolver";
-		case FSvelocityEnum : return "FSvelocity";
-		case FullMeltOnPartiallyFloatingEnum : return "FullMeltOnPartiallyFloating";
-		case GaussPentaEnum : return "GaussPenta";
-		case GaussSegEnum : return "GaussSeg";
-		case GaussTetraEnum : return "GaussTetra";
-		case GaussTriaEnum : return "GaussTria";
-		case GenericOptionEnum : return "GenericOption";
-		case GenericParamEnum : return "GenericParam";
-		case GLheightadvectionAnalysisEnum : return "GLheightadvectionAnalysis";
-		case GiaIvinsAnalysisEnum : return "GiaIvinsAnalysis";
-		case GiaSolutionEnum : return "GiaSolution";
-		case Gradient1Enum : return "Gradient1";
-		case Gradient2Enum : return "Gradient2";
-		case Gradient3Enum : return "Gradient3";
-		case GroundedAreaEnum : return "GroundedArea";
-		case GroundedAreaScaledEnum : return "GroundedAreaScaled";
-		case GroundingOnlyEnum : return "GroundingOnly";
-		case GsetEnum : return "Gset";
-		case GslEnum : return "Gsl";
-		case HOApproximationEnum : return "HOApproximation";
-		case HOFSApproximationEnum : return "HOFSApproximation";
-		case HookEnum : return "Hook";
-		case HydrologyBasalFluxEnum : return "HydrologyBasalFlux";
-		case HydrologyDCEfficientAnalysisEnum : return "HydrologyDCEfficientAnalysis";
-		case HydrologydcEnum : return "Hydrologydc";
-		case HydrologydcEplColapseThicknessEnum : return "HydrologydcEplColapseThickness";
-		case HydrologydcEplCompressibilityEnum : return "HydrologydcEplCompressibility";
-		case HydrologydcEplConductivityEnum : return "HydrologydcEplConductivity";
-		case HydrologydcEplInitialThicknessEnum : return "HydrologydcEplInitialThickness";
-		case HydrologydcEplMaxThicknessEnum : return "HydrologydcEplMaxThickness";
-		case HydrologydcEplPorosityEnum : return "HydrologydcEplPorosity";
-		case HydrologydcEplThicknessStackedEnum : return "HydrologydcEplThicknessStacked";
-		case HydrologydcEplThicknessEnum : return "HydrologydcEplThickness";
-		case HydrologyDCInefficientAnalysisEnum : return "HydrologyDCInefficientAnalysis";
-		case HydrologydcSedimentCompressibilityEnum : return "HydrologydcSedimentCompressibility";
-		case HydrologydcSedimentPorosityEnum : return "HydrologydcSedimentPorosity";
-		case HydrologydcSedimentThicknessEnum : return "HydrologydcSedimentThickness";
-		case HydrologydcWaterCompressibilityEnum : return "HydrologydcWaterCompressibility";
-		case HydrologyShreveAnalysisEnum : return "HydrologyShreveAnalysis";
-		case HydrologyshreveEnum : return "Hydrologyshreve";
-		case HydrologySolutionEnum : return "HydrologySolution";
-		case HydrologyShaktiAnalysisEnum : return "HydrologyShaktiAnalysis";
-		case HydrologyPismAnalysisEnum : return "HydrologyPismAnalysis";
-		case HydrologyshaktiEnum : return "Hydrologyshakti";
-		case HydrologypismEnum : return "Hydrologypism";
-		case IceMassEnum : return "IceMass";
-		case IceMassScaledEnum : return "IceMassScaled";
-		case IceVolumeAboveFloatationEnum : return "IceVolumeAboveFloatation";
-		case IceVolumeAboveFloatationScaledEnum : return "IceVolumeAboveFloatationScaled";
-		case IceVolumeEnum : return "IceVolume";
-		case IceVolumeScaledEnum : return "IceVolumeScaled";
-		case IncrementalEnum : return "Incremental";
-		case IndexedEnum : return "Indexed";
-		case InternalEnum : return "Internal";
-		case IntersectEnum : return "Intersect";
-		case IntExternalResultEnum : return "IntExternalResult";
-		case IntInputEnum : return "IntInput";
-		case IntMatExternalResultEnum : return "IntMatExternalResult";
-		case IntMatParamEnum : return "IntMatParam";
-		case IntParamEnum : return "IntParam";
-		case IntVecParamEnum : return "IntVecParam";
-		case InversionVzObsEnum : return "InversionVzObs";
-		case JEnum : return "J";
-		case L1L2ApproximationEnum : return "L1L2Approximation";
-		case L2ProjectionBaseAnalysisEnum : return "L2ProjectionBaseAnalysis";
-		case L2ProjectionEPLAnalysisEnum : return "L2ProjectionEPLAnalysis";
-		case LACrouzeixRaviartEnum : return "LACrouzeixRaviart";
-		case LambdaSEnum : return "LambdaS";
-		case LATaylorHoodEnum : return "LATaylorHood";
-		case LevelsetAnalysisEnum : return "LevelsetAnalysis";
-		case LevelsetfunctionPicardEnum : return "LevelsetfunctionPicard";
-		case LinearFloatingMeltRateEnum : return "LinearFloatingMeltRate";
-		case SpatialLinearFloatingMeltRateEnum : return "SpatialLinearFloatingMeltRate";
-		case LliboutryDuvalEnum : return "LliboutryDuval";
-		case LoadsEnum : return "Loads";
-		case LoveAnalysisEnum : return "LoveAnalysis";
-		case LoveHiEnum : return "LoveHi";
-		case LoveHrEnum : return "LoveHr";
-		case LoveKernelsImagEnum : return "LoveKernelsImag";
-		case LoveKernelsRealEnum : return "LoveKernelsReal";
-		case LoveKiEnum : return "LoveKi";
-		case LoveKrEnum : return "LoveKr";
-		case LoveLiEnum : return "LoveLi";
-		case LoveLrEnum : return "LoveLr";
-		case LoveSolutionEnum : return "LoveSolution";
-		case MantlePlumeGeothermalFluxEnum : return "MantlePlumeGeothermalFlux";
-		case MaskLandLevelsetEnum : return "MaskLandLevelset";
-		case MaskOceanLevelsetEnum : return "MaskOceanLevelset";
-		case MassconaxpbyEnum : return "Massconaxpby";
-		case MassconEnum : return "Masscon";
-		case MassfluxatgateEnum : return "Massfluxatgate";
-		case MassFluxEnum : return "MassFlux";
-		case MasstransportAnalysisEnum : return "MasstransportAnalysis";
-		case MasstransportSolutionEnum : return "MasstransportSolution";
-		case MatdamageiceEnum : return "Matdamageice";
-		case MatenhancediceEnum : return "Matenhancedice";
-		case MaterialsBetaEnum : return "MaterialsBeta";
-		case MaterialsEarthDensityEnum : return "MaterialsEarthDensity";
-		case MaterialsEnum : return "Materials";
-		case MaterialsHeatcapacityEnum : return "MaterialsHeatcapacity";
-		case MaterialsLatentheatEnum : return "MaterialsLatentheat";
-		case MaterialsLithosphereDensityEnum : return "MaterialsLithosphereDensity";
-		case MaterialsLithosphereShearModulusEnum : return "MaterialsLithosphereShearModulus";
-		case MaterialsMantleDensityEnum : return "MaterialsMantleDensity";
-		case MaterialsMantleShearModulusEnum : return "MaterialsMantleShearModulus";
-		case MaterialsMeltingpointEnum : return "MaterialsMeltingpoint";
-		case MaterialsMixedLayerCapacityEnum : return "MaterialsMixedLayerCapacity";
-		case MaterialsMuWaterEnum : return "MaterialsMuWater";
-		case MaterialsRheologyLawEnum : return "MaterialsRheologyLaw";
-		case MaterialsRhoFreshwaterEnum : return "MaterialsRhoFreshwater";
-		case MaterialsRhoSeawaterEnum : return "MaterialsRhoSeawater";
-		case MaterialsTemperateiceconductivityEnum : return "MaterialsTemperateiceconductivity";
-		case MaterialsThermalconductivityEnum : return "MaterialsThermalconductivity";
-		case MaterialsThermalExchangeVelocityEnum : return "MaterialsThermalExchangeVelocity";
-		case MatestarEnum : return "Matestar";
-		case MaticeEnum : return "Matice";
-		case MatlithoEnum : return "Matlitho";
-		case MatparEnum : return "Matpar";
-		case MatrixParamEnum : return "MatrixParam";
-		case MaxAbsVxEnum : return "MaxAbsVx";
-		case MaxAbsVyEnum : return "MaxAbsVy";
-		case MaxAbsVzEnum : return "MaxAbsVz";
-		case MaxDivergenceEnum : return "MaxDivergence";
-		case MaxVelEnum : return "MaxVel";
-		case MaxVxEnum : return "MaxVx";
-		case MaxVyEnum : return "MaxVy";
-		case MaxVzEnum : return "MaxVz";
-		case MelangeEnum : return "Melange";
-		case MeltingAnalysisEnum : return "MeltingAnalysis";
-		case MeshElementsEnum : return "MeshElements";
-		case MeshXEnum : return "MeshX";
-		case MeshYEnum : return "MeshY";
-		case MINIcondensedEnum : return "MINIcondensed";
-		case MINIEnum : return "MINI";
-		case MinVelEnum : return "MinVel";
-		case MinVxEnum : return "MinVx";
-		case MinVyEnum : return "MinVy";
-		case MinVzEnum : return "MinVz";
-		case MismipFloatingMeltRateEnum : return "MismipFloatingMeltRate";
-		case MoulinEnum : return "Moulin";
-		case MpiDenseEnum : return "MpiDense";
-		case MpiEnum : return "Mpi";
-		case MpiSparseEnum : return "MpiSparse";
-		case MumpsEnum : return "Mumps";
-		case NewDamageEnum : return "NewDamage";
-		case NodalEnum : return "Nodal";
-		case NodalvalueEnum : return "Nodalvalue";
-		case NodeSIdEnum : return "NodeSId";
-		case NoFrictionOnPartiallyFloatingEnum : return "NoFrictionOnPartiallyFloating";
-		case NoMeltOnPartiallyFloatingEnum : return "NoMeltOnPartiallyFloating";
-		case NoneApproximationEnum : return "NoneApproximation";
-		case NoneEnum : return "None";
-		case NumberedcostfunctionEnum : return "Numberedcostfunction";
-		case NumericalfluxEnum : return "Numericalflux";
-		case OldGradientEnum : return "OldGradient";
-		case OneLayerP4zEnum : return "OneLayerP4z";
-		case OpenEnum : return "Open";
-		case OptionEnum : return "Option";
 		case Outputdefinition1Enum : return "Outputdefinition1";
 		case Outputdefinition10Enum : return "Outputdefinition10";
@@ -1046,16 +927,249 @@
 		case Outputdefinition9Enum : return "Outputdefinition9";
 		case Outputdefinition100Enum : return "Outputdefinition100";
+		case InputsENDEnum : return "InputsEND";
+		case AbsoluteEnum : return "Absolute";
+		case AdaptiveTimesteppingEnum : return "AdaptiveTimestepping";
+		case AdjointBalancethickness2AnalysisEnum : return "AdjointBalancethickness2Analysis";
+		case AdjointBalancethicknessAnalysisEnum : return "AdjointBalancethicknessAnalysis";
+		case AdjointHorizAnalysisEnum : return "AdjointHorizAnalysis";
+		case AggressiveMigrationEnum : return "AggressiveMigration";
+		case AmrBamgEnum : return "AmrBamg";
+		case AmrNeopzEnum : return "AmrNeopz";
+		case AndroidFrictionCoefficientEnum : return "AndroidFrictionCoefficient";
+		case ArrheniusEnum : return "Arrhenius";
+		case AutodiffJacobianEnum : return "AutodiffJacobian";
+		case Balancethickness2AnalysisEnum : return "Balancethickness2Analysis";
+		case Balancethickness2SolutionEnum : return "Balancethickness2Solution";
+		case BalancethicknessAnalysisEnum : return "BalancethicknessAnalysis";
+		case BalancethicknessApparentMassbalanceEnum : return "BalancethicknessApparentMassbalance";
+		case BalancethicknessSoftAnalysisEnum : return "BalancethicknessSoftAnalysis";
+		case BalancethicknessSoftSolutionEnum : return "BalancethicknessSoftSolution";
+		case BalancethicknessSolutionEnum : return "BalancethicknessSolution";
+		case BalancethicknessSpcthicknessEnum : return "BalancethicknessSpcthickness";
+		case BalancevelocityAnalysisEnum : return "BalancevelocityAnalysis";
+		case BalancevelocitySolutionEnum : return "BalancevelocitySolution";
+		case BasalforcingsIsmip6Enum : return "BasalforcingsIsmip6";
+		case BasalforcingsPicoEnum : return "BasalforcingsPico";
+		case BeckmannGoosseFloatingMeltRateEnum : return "BeckmannGoosseFloatingMeltRate";
+		case BedSlopeSolutionEnum : return "BedSlopeSolution";
+		case BoolExternalResultEnum : return "BoolExternalResult";
+		case BoolInputEnum : return "BoolInput";
+		case BoolParamEnum : return "BoolParam";
+		case BoundaryEnum : return "Boundary";
+		case BuddJackaEnum : return "BuddJacka";
+		case CalvingDev2Enum : return "CalvingDev2";
+		case CalvingHabEnum : return "CalvingHab";
+		case CalvingLevermannEnum : return "CalvingLevermann";
+		case CalvingVonmisesEnum : return "CalvingVonmises";
+		case CfdragcoeffabsgradEnum : return "Cfdragcoeffabsgrad";
+		case CfsurfacelogvelEnum : return "Cfsurfacelogvel";
+		case CfsurfacesquareEnum : return "Cfsurfacesquare";
+		case ChannelEnum : return "Channel";
+		case ChannelAreaEnum : return "ChannelArea";
+		case ChannelAreaOldEnum : return "ChannelAreaOld";
+		case ClosedEnum : return "Closed";
+		case ColinearEnum : return "Colinear";
+		case ConstraintsEnum : return "Constraints";
+		case ContactEnum : return "Contact";
+		case ContourEnum : return "Contour";
+		case ContoursEnum : return "Contours";
+		case ControlInputEnum : return "ControlInput";
+		case ControlInputGradEnum : return "ControlInputGrad";
+		case ControlInputMaxsEnum : return "ControlInputMaxs";
+		case ControlInputMinsEnum : return "ControlInputMins";
+		case ControlInputValuesEnum : return "ControlInputValues";
+		case CrouzeixRaviartEnum : return "CrouzeixRaviart";
+		case CuffeyEnum : return "Cuffey";
+		case CuffeyTemperateEnum : return "CuffeyTemperate";
+		case DamageEvolutionAnalysisEnum : return "DamageEvolutionAnalysis";
+		case DamageEvolutionSolutionEnum : return "DamageEvolutionSolution";
+		case DataSetEnum : return "DataSet";
+		case DataSetParamEnum : return "DataSetParam";
+		case DatasetInputEnum : return "DatasetInput";
+		case DefaultAnalysisEnum : return "DefaultAnalysis";
+		case DefaultCalvingEnum : return "DefaultCalving";
+		case DenseEnum : return "Dense";
+		case DependentObjectEnum : return "DependentObject";
+		case DepthAverageAnalysisEnum : return "DepthAverageAnalysis";
+		case DeviatoricStressErrorEstimatorEnum : return "DeviatoricStressErrorEstimator";
+		case DivergenceEnum : return "Divergence";
+		case Domain3DsurfaceEnum : return "Domain3Dsurface";
+		case DoubleArrayInputEnum : return "DoubleArrayInput";
+		case DoubleExternalResultEnum : return "DoubleExternalResult";
+		case DoubleInputEnum : return "DoubleInput";
+		case DoubleMatArrayParamEnum : return "DoubleMatArrayParam";
+		case DoubleMatExternalResultEnum : return "DoubleMatExternalResult";
+		case DoubleMatParamEnum : return "DoubleMatParam";
+		case DoubleParamEnum : return "DoubleParam";
+		case DoubleVecParamEnum : return "DoubleVecParam";
+		case ElementEnum : return "Element";
+		case ElementHookEnum : return "ElementHook";
+		case ElementSIdEnum : return "ElementSId";
+		case EnthalpyAnalysisEnum : return "EnthalpyAnalysis";
+		case EsaAnalysisEnum : return "EsaAnalysis";
+		case EsaSolutionEnum : return "EsaSolution";
+		case EsaTransitionsEnum : return "EsaTransitions";
+		case ExternalResultEnum : return "ExternalResult";
+		case ExtrapolationAnalysisEnum : return "ExtrapolationAnalysis";
+		case ExtrudeFromBaseAnalysisEnum : return "ExtrudeFromBaseAnalysis";
+		case ExtrudeFromTopAnalysisEnum : return "ExtrudeFromTopAnalysis";
+		case FSApproximationEnum : return "FSApproximation";
+		case FSSolverEnum : return "FSSolver";
+		case FSpressureEnum : return "FSpressure";
+		case FSvelocityEnum : return "FSvelocity";
+		case FemModelEnum : return "FemModel";
+		case FileParamEnum : return "FileParam";
+		case FixedTimesteppingEnum : return "FixedTimestepping";
+		case FloatingAreaEnum : return "FloatingArea";
+		case FloatingAreaScaledEnum : return "FloatingAreaScaled";
+		case FloatingMeltRateEnum : return "FloatingMeltRate";
+		case FreeEnum : return "Free";
+		case FreeSurfaceBaseAnalysisEnum : return "FreeSurfaceBaseAnalysis";
+		case FreeSurfaceTopAnalysisEnum : return "FreeSurfaceTopAnalysis";
+		case FrontalForcingsDefaultEnum : return "FrontalForcingsDefault";
+		case FrontalForcingsRignotEnum : return "FrontalForcingsRignot";
+		case FsetEnum : return "Fset";
+		case FullMeltOnPartiallyFloatingEnum : return "FullMeltOnPartiallyFloating";
+		case GLheightadvectionAnalysisEnum : return "GLheightadvectionAnalysis";
+		case GaussPentaEnum : return "GaussPenta";
+		case GaussSegEnum : return "GaussSeg";
+		case GaussTetraEnum : return "GaussTetra";
+		case GaussTriaEnum : return "GaussTria";
+		case GenericOptionEnum : return "GenericOption";
+		case GenericParamEnum : return "GenericParam";
+		case GiaIvinsAnalysisEnum : return "GiaIvinsAnalysis";
+		case GiaSolutionEnum : return "GiaSolution";
+		case Gradient1Enum : return "Gradient1";
+		case Gradient2Enum : return "Gradient2";
+		case Gradient3Enum : return "Gradient3";
+		case GroundedAreaEnum : return "GroundedArea";
+		case GroundedAreaScaledEnum : return "GroundedAreaScaled";
+		case GroundingOnlyEnum : return "GroundingOnly";
+		case GroundinglineMassFluxEnum : return "GroundinglineMassFlux";
+		case GsetEnum : return "Gset";
+		case GslEnum : return "Gsl";
+		case HOApproximationEnum : return "HOApproximation";
+		case HOFSApproximationEnum : return "HOFSApproximation";
+		case HookEnum : return "Hook";
+		case HydrologyDCEfficientAnalysisEnum : return "HydrologyDCEfficientAnalysis";
+		case HydrologyDCInefficientAnalysisEnum : return "HydrologyDCInefficientAnalysis";
+		case HydrologyGlaDSAnalysisEnum : return "HydrologyGlaDSAnalysis";
+		case HydrologyGlaDSEnum : return "HydrologyGlaDS";
+		case HydrologyPismAnalysisEnum : return "HydrologyPismAnalysis";
+		case HydrologyShaktiAnalysisEnum : return "HydrologyShaktiAnalysis";
+		case HydrologyShreveAnalysisEnum : return "HydrologyShreveAnalysis";
+		case HydrologySolutionEnum : return "HydrologySolution";
+		case HydrologydcEnum : return "Hydrologydc";
+		case HydrologypismEnum : return "Hydrologypism";
+		case HydrologyshaktiEnum : return "Hydrologyshakti";
+		case HydrologyshreveEnum : return "Hydrologyshreve";
+		case IceMassEnum : return "IceMass";
+		case IceMassScaledEnum : return "IceMassScaled";
+		case IceVolumeAboveFloatationEnum : return "IceVolumeAboveFloatation";
+		case IceVolumeAboveFloatationScaledEnum : return "IceVolumeAboveFloatationScaled";
+		case IceVolumeEnum : return "IceVolume";
+		case IceVolumeScaledEnum : return "IceVolumeScaled";
+		case IcefrontMassFluxEnum : return "IcefrontMassFlux";
+		case IcefrontMassFluxLevelsetEnum : return "IcefrontMassFluxLevelset";
+		case IncrementalEnum : return "Incremental";
+		case IndexedEnum : return "Indexed";
+		case IntExternalResultEnum : return "IntExternalResult";
+		case IntInputEnum : return "IntInput";
+		case IntMatExternalResultEnum : return "IntMatExternalResult";
+		case IntMatParamEnum : return "IntMatParam";
+		case IntParamEnum : return "IntParam";
+		case IntVecParamEnum : return "IntVecParam";
+		case InternalEnum : return "Internal";
+		case IntersectEnum : return "Intersect";
+		case InversionVzObsEnum : return "InversionVzObs";
+		case JEnum : return "J";
+		case L1L2ApproximationEnum : return "L1L2Approximation";
+		case L2ProjectionBaseAnalysisEnum : return "L2ProjectionBaseAnalysis";
+		case L2ProjectionEPLAnalysisEnum : return "L2ProjectionEPLAnalysis";
+		case LACrouzeixRaviartEnum : return "LACrouzeixRaviart";
+		case LATaylorHoodEnum : return "LATaylorHood";
+		case LambdaSEnum : return "LambdaS";
+		case LevelsetAnalysisEnum : return "LevelsetAnalysis";
+		case LevelsetfunctionPicardEnum : return "LevelsetfunctionPicard";
+		case LinearFloatingMeltRateEnum : return "LinearFloatingMeltRate";
+		case LliboutryDuvalEnum : return "LliboutryDuval";
+		case LoadsEnum : return "Loads";
+		case LoveAnalysisEnum : return "LoveAnalysis";
+		case LoveHiEnum : return "LoveHi";
+		case LoveHrEnum : return "LoveHr";
+		case LoveKernelsImagEnum : return "LoveKernelsImag";
+		case LoveKernelsRealEnum : return "LoveKernelsReal";
+		case LoveKiEnum : return "LoveKi";
+		case LoveKrEnum : return "LoveKr";
+		case LoveLiEnum : return "LoveLi";
+		case LoveLrEnum : return "LoveLr";
+		case LoveSolutionEnum : return "LoveSolution";
+		case MINIEnum : return "MINI";
+		case MINIcondensedEnum : return "MINIcondensed";
+		case MantlePlumeGeothermalFluxEnum : return "MantlePlumeGeothermalFlux";
+		case MassFluxEnum : return "MassFlux";
+		case MassconEnum : return "Masscon";
+		case MassconaxpbyEnum : return "Massconaxpby";
+		case MassfluxatgateEnum : return "Massfluxatgate";
+		case MasstransportAnalysisEnum : return "MasstransportAnalysis";
+		case MasstransportSolutionEnum : return "MasstransportSolution";
+		case MatdamageiceEnum : return "Matdamageice";
+		case MatenhancediceEnum : return "Matenhancedice";
+		case MaterialsEnum : return "Materials";
+		case MatestarEnum : return "Matestar";
+		case MaticeEnum : return "Matice";
+		case MatlithoEnum : return "Matlitho";
+		case MatrixParamEnum : return "MatrixParam";
+		case MaxAbsVxEnum : return "MaxAbsVx";
+		case MaxAbsVyEnum : return "MaxAbsVy";
+		case MaxAbsVzEnum : return "MaxAbsVz";
+		case MaxDivergenceEnum : return "MaxDivergence";
+		case MaxVelEnum : return "MaxVel";
+		case MaxVxEnum : return "MaxVx";
+		case MaxVyEnum : return "MaxVy";
+		case MaxVzEnum : return "MaxVz";
+		case MelangeEnum : return "Melange";
+		case MeltingAnalysisEnum : return "MeltingAnalysis";
+		case MeshElementsEnum : return "MeshElements";
+		case MeshXEnum : return "MeshX";
+		case MeshYEnum : return "MeshY";
+		case MinVelEnum : return "MinVel";
+		case MinVxEnum : return "MinVx";
+		case MinVyEnum : return "MinVy";
+		case MinVzEnum : return "MinVz";
+		case MismipFloatingMeltRateEnum : return "MismipFloatingMeltRate";
+		case MoulinEnum : return "Moulin";
+		case MpiDenseEnum : return "MpiDense";
+		case MpiEnum : return "Mpi";
+		case MpiSparseEnum : return "MpiSparse";
+		case MumpsEnum : return "Mumps";
+		case NoFrictionOnPartiallyFloatingEnum : return "NoFrictionOnPartiallyFloating";
+		case NoMeltOnPartiallyFloatingEnum : return "NoMeltOnPartiallyFloating";
+		case NodalEnum : return "Nodal";
+		case NodalvalueEnum : return "Nodalvalue";
+		case NodeSIdEnum : return "NodeSId";
+		case NoneApproximationEnum : return "NoneApproximation";
+		case NoneEnum : return "None";
+		case NumberedcostfunctionEnum : return "Numberedcostfunction";
+		case NyeCO2Enum : return "NyeCO2";
+		case NyeH2OEnum : return "NyeH2O";
+		case NumericalfluxEnum : return "Numericalflux";
+		case OldGradientEnum : return "OldGradient";
+		case OneLayerP4zEnum : return "OneLayerP4z";
+		case OpenEnum : return "Open";
+		case OptionEnum : return "Option";
 		case P0ArrayEnum : return "P0Array";
-		case P1bubblecondensedEnum : return "P1bubblecondensed";
-		case P1bubbleEnum : return "P1bubble";
+		case P0DGEnum : return "P0DG";
 		case P1DGEnum : return "P1DG";
 		case P1P1Enum : return "P1P1";
 		case P1P1GLSEnum : return "P1P1GLS";
+		case P1bubbleEnum : return "P1bubble";
+		case P1bubblecondensedEnum : return "P1bubblecondensed";
 		case P1xP2Enum : return "P1xP2";
 		case P1xP3Enum : return "P1xP3";
 		case P1xP4Enum : return "P1xP4";
+		case P2Enum : return "P2";
+		case P2bubbleEnum : return "P2bubble";
 		case P2bubblecondensedEnum : return "P2bubblecondensed";
-		case P2bubbleEnum : return "P2bubble";
-		case P2Enum : return "P2";
 		case P2xP1Enum : return "P2xP1";
 		case P2xP4Enum : return "P2xP4";
@@ -1071,6 +1185,23 @@
 		case RegionaloutputEnum : return "Regionaloutput";
 		case RegularEnum : return "Regular";
-		case ResetPenaltiesEnum : return "ResetPenalties";
+		case RecoveryAnalysisEnum : return "RecoveryAnalysis";
 		case RiftfrontEnum : return "Riftfront";
+		case SIAApproximationEnum : return "SIAApproximation";
+		case SMBcomponentsEnum : return "SMBcomponents";
+		case SMBd18opddEnum : return "SMBd18opdd";
+		case SMBforcingEnum : return "SMBforcing";
+		case SMBgcmEnum : return "SMBgcm";
+		case SMBgembEnum : return "SMBgemb";
+		case SMBgradientsEnum : return "SMBgradients";
+		case SMBgradientscomponentsEnum : return "SMBgradientscomponents";
+		case SMBgradientselaEnum : return "SMBgradientsela";
+		case SMBhenningEnum : return "SMBhenning";
+		case SMBmeltcomponentsEnum : return "SMBmeltcomponents";
+		case SMBpddEnum : return "SMBpdd";
+		case SMBpddSicopolisEnum : return "SMBpddSicopolis";
+		case SMBsemicEnum : return "SMBsemic";
+		case SSAApproximationEnum : return "SSAApproximation";
+		case SSAFSApproximationEnum : return "SSAFSApproximation";
+		case SSAHOApproximationEnum : return "SSAHOApproximation";
 		case ScaledEnum : return "Scaled";
 		case SealevelAbsoluteEnum : return "SealevelAbsolute";
@@ -1080,10 +1211,7 @@
 		case SealevelInertiaTensorZZEnum : return "SealevelInertiaTensorZZ";
 		case SealevelNmotionEnum : return "SealevelNmotion";
+		case SealevelUmotionEnum : return "SealevelUmotion";
 		case SealevelriseAnalysisEnum : return "SealevelriseAnalysis";
 		case SealevelriseSolutionEnum : return "SealevelriseSolution";
-		case SealevelriseStericRateEnum : return "SealevelriseStericRate";
-		case SealevelUmotionEnum : return "SealevelUmotion";
-		case SedimentHeadStackedEnum : return "SedimentHeadStacked";
-		case SedimentHeadEnum : return "SedimentHead";
 		case SegEnum : return "Seg";
 		case SegInputEnum : return "SegInput";
@@ -1092,37 +1220,15 @@
 		case SeparateEnum : return "Separate";
 		case SeqEnum : return "Seq";
-		case SIAApproximationEnum : return "SIAApproximation";
-		case SigmaVMEnum : return "SigmaVM";
 		case SmbAnalysisEnum : return "SmbAnalysis";
-		case SMBcomponentsEnum : return "SMBcomponents";
-		case SMBd18opddEnum : return "SMBd18opdd";
-		case SmbDesfacEnum : return "SmbDesfac";
-		case SmbDpermilEnum : return "SmbDpermil";
-		case SmbDzAddEnum : return "SmbDzAdd";
-		case SmbFACEnum : return "SmbFAC";
-		case SMBforcingEnum : return "SMBforcing";
-		case SMBgcmEnum : return "SMBgcm";
-		case SMBgembEnum : return "SMBgemb";
-		case SMBgradientselaEnum : return "SMBgradientsela";
-		case SMBgradientsEnum : return "SMBgradients";
-		case SMBhenningEnum : return "SMBhenning";
-		case SmbMAddEnum : return "SmbMAdd";
-		case SMBmeltcomponentsEnum : return "SMBmeltcomponents";
-		case SMBpddEnum : return "SMBpdd";
-		case SMBpddSicopolisEnum : return "SMBpddSicopolis";
-		case SMBgradientscomponentsEnum : return "SMBgradientscomponents";
-		case SmbRlapsEnum : return "SmbRlaps";
-		case SmbRlapslgmEnum : return "SmbRlapslgm";
 		case SmbSolutionEnum : return "SmbSolution";
 		case SmoothAnalysisEnum : return "SmoothAnalysis";
 		case SoftMigrationEnum : return "SoftMigration";
+		case SpatialLinearFloatingMeltRateEnum : return "SpatialLinearFloatingMeltRate";
 		case SpcDynamicEnum : return "SpcDynamic";
 		case SpcStaticEnum : return "SpcStatic";
 		case SpcTransientEnum : return "SpcTransient";
-		case SSAApproximationEnum : return "SSAApproximation";
-		case SSAFSApproximationEnum : return "SSAFSApproximation";
-		case SSAHOApproximationEnum : return "SSAHOApproximation";
 		case SsetEnum : return "Sset";
 		case SteadystateSolutionEnum : return "SteadystateSolution";
+		case StressIntensityFactorEnum : return "StressIntensityFactor";
 		case StressbalanceAnalysisEnum : return "StressbalanceAnalysis";
 		case StressbalanceConvergenceNumStepsEnum : return "StressbalanceConvergenceNumSteps";
@@ -1130,5 +1236,4 @@
 		case StressbalanceSolutionEnum : return "StressbalanceSolution";
 		case StressbalanceVerticalAnalysisEnum : return "StressbalanceVerticalAnalysis";
-		case StressIntensityFactorEnum : return "StressIntensityFactor";
 		case StringArrayParamEnum : return "StringArrayParam";
 		case StringExternalResultEnum : return "StringExternalResult";
@@ -1136,17 +1241,16 @@
 		case SubelementFriction1Enum : return "SubelementFriction1";
 		case SubelementFriction2Enum : return "SubelementFriction2";
-		case SubelementMigrationEnum : return "SubelementMigration";
 		case SubelementMelt1Enum : return "SubelementMelt1";
 		case SubelementMelt2Enum : return "SubelementMelt2";
-		case SurfaceCrevasseEnum : return "SurfaceCrevasse";
+		case SubelementMigrationEnum : return "SubelementMigration";
 		case SurfaceSlopeSolutionEnum : return "SurfaceSlopeSolution";
 		case TaylorHoodEnum : return "TaylorHood";
-		case TemperaturePDDEnum : return "TemperaturePDD";
 		case TetraEnum : return "Tetra";
 		case TetraInputEnum : return "TetraInput";
 		case ThermalAnalysisEnum : return "ThermalAnalysis";
 		case ThermalSolutionEnum : return "ThermalSolution";
-		case ThermalSpctemperatureEnum : return "ThermalSpctemperature";
 		case ThicknessErrorEstimatorEnum : return "ThicknessErrorEstimator";
+		case TotalCalvingFluxLevelsetEnum : return "TotalCalvingFluxLevelset";
+		case TotalCalvingMeltingFluxLevelsetEnum : return "TotalCalvingMeltingFluxLevelset";
 		case TotalFloatingBmbEnum : return "TotalFloatingBmb";
 		case TotalFloatingBmbScaledEnum : return "TotalFloatingBmbScaled";
@@ -1164,7 +1268,7 @@
 		case VectorParamEnum : return "VectorParam";
 		case VertexEnum : return "Vertex";
+		case VertexLIdEnum : return "VertexLId";
 		case VertexPIdEnum : return "VertexPId";
 		case VertexSIdEnum : return "VertexSId";
-		case VertexLIdEnum : return "VertexLId";
 		case VerticesEnum : return "Vertices";
 		case ViscousHeatingEnum : return "ViscousHeating";
@@ -1185,6 +1289,6 @@
 		case SealevelWeightsEnum : return "SealevelWeights";
 		case StrainRateEnum : return "StrainRate";
+		case StressTensorEnum : return "StressTensor";
 		case StressbalanceViscosityOvershootEnum : return "StressbalanceViscosityOvershoot";
-		case StressTensorEnum : return "StressTensor";
 		case SubelementMigration4Enum : return "SubelementMigration4";
 		case TimesteppingTimeAdaptEnum : return "TimesteppingTimeAdapt";
Index: /issm/trunk/src/c/shared/Enum/StringToEnumx.cpp
===================================================================
--- /issm/trunk/src/c/shared/Enum/StringToEnumx.cpp	(revision 24312)
+++ /issm/trunk/src/c/shared/Enum/StringToEnumx.cpp	(revision 24313)
@@ -71,4 +71,11 @@
 	      else if (strcmp(name,"BasalforcingsDtbg")==0) return BasalforcingsDtbgEnum;
 	      else if (strcmp(name,"Basalforcings")==0) return BasalforcingsEnum;
+	      else if (strcmp(name,"BasalforcingsIsmip6AverageTf")==0) return BasalforcingsIsmip6AverageTfEnum;
+	      else if (strcmp(name,"BasalforcingsIsmip6BasinArea")==0) return BasalforcingsIsmip6BasinAreaEnum;
+	      else if (strcmp(name,"BasalforcingsIsmip6DeltaT")==0) return BasalforcingsIsmip6DeltaTEnum;
+	      else if (strcmp(name,"BasalforcingsIsmip6Gamma0")==0) return BasalforcingsIsmip6Gamma0Enum;
+	      else if (strcmp(name,"BasalforcingsIsmip6IsLocal")==0) return BasalforcingsIsmip6IsLocalEnum;
+	      else if (strcmp(name,"BasalforcingsIsmip6NumBasins")==0) return BasalforcingsIsmip6NumBasinsEnum;
+	      else if (strcmp(name,"BasalforcingsIsmip6TfDepths")==0) return BasalforcingsIsmip6TfDepthsEnum;
 	      else if (strcmp(name,"BasalforcingsLowercrustheat")==0) return BasalforcingsLowercrustheatEnum;
 	      else if (strcmp(name,"BasalforcingsMantleconductivity")==0) return BasalforcingsMantleconductivityEnum;
@@ -95,4 +102,5 @@
 	      else if (strcmp(name,"BasalforcingsUpperdepthMelt")==0) return BasalforcingsUpperdepthMeltEnum;
 	      else if (strcmp(name,"BasalforcingsUpperwaterElevation")==0) return BasalforcingsUpperwaterElevationEnum;
+	      else if (strcmp(name,"BasalforcingsUpperwaterMeltingRate")==0) return BasalforcingsUpperwaterMeltingRateEnum;
 	      else if (strcmp(name,"CalvingCrevasseDepth")==0) return CalvingCrevasseDepthEnum;
 	      else if (strcmp(name,"CalvingHeightAboveFloatation")==0) return CalvingHeightAboveFloatationEnum;
@@ -101,8 +109,13 @@
 	      else if (strcmp(name,"CalvingMinthickness")==0) return CalvingMinthicknessEnum;
 	      else if (strcmp(name,"ConfigurationType")==0) return ConfigurationTypeEnum;
+	      else if (strcmp(name,"ConstantsG")==0) return ConstantsGEnum;
+	      else if (strcmp(name,"ConstantsReferencetemperature")==0) return ConstantsReferencetemperatureEnum;
 	      else if (strcmp(name,"ConstantsYts")==0) return ConstantsYtsEnum;
+	      else if (strcmp(name,"ControlInputSizeM")==0) return ControlInputSizeMEnum;
+	      else if (strcmp(name,"ControlInputSizeN")==0) return ControlInputSizeNEnum;
 	      else if (strcmp(name,"DamageC1")==0) return DamageC1Enum;
 	      else if (strcmp(name,"DamageC2")==0) return DamageC2Enum;
 	      else if (strcmp(name,"DamageC3")==0) return DamageC3Enum;
+	      else if (strcmp(name,"DamageC4")==0) return DamageC4Enum;
 	      else if (strcmp(name,"Damage")==0) return DamageEnum;
 	      else if (strcmp(name,"DamageEquivStress")==0) return DamageEquivStressEnum;
@@ -115,4 +128,5 @@
 	      else if (strcmp(name,"DamageStabilization")==0) return DamageStabilizationEnum;
 	      else if (strcmp(name,"DamageStressThreshold")==0) return DamageStressThresholdEnum;
+	      else if (strcmp(name,"DamageStressUBound")==0) return DamageStressUBoundEnum;
 	      else if (strcmp(name,"DebugProfiling")==0) return DebugProfilingEnum;
 	      else if (strcmp(name,"DomainDimension")==0) return DomainDimensionEnum;
@@ -123,5 +137,8 @@
 	      else if (strcmp(name,"EsaHemisphere")==0) return EsaHemisphereEnum;
 	      else if (strcmp(name,"EsaRequestedOutputs")==0) return EsaRequestedOutputsEnum;
-	      else if (strcmp(name,"EsaUElastic")==0) return EsaUElasticEnum;
+         else stage=2;
+   }
+   if(stage==2){
+	      if (strcmp(name,"EsaUElastic")==0) return EsaUElasticEnum;
 	      else if (strcmp(name,"ExtrapolationVariable")==0) return ExtrapolationVariableEnum;
 	      else if (strcmp(name,"FemModelComm")==0) return FemModelCommEnum;
@@ -133,20 +150,40 @@
 	      else if (strcmp(name,"FlowequationIsSSA")==0) return FlowequationIsSSAEnum;
 	      else if (strcmp(name,"FrictionCoupling")==0) return FrictionCouplingEnum;
+	      else if (strcmp(name,"FrictionDelta")==0) return FrictionDeltaEnum;
 	      else if (strcmp(name,"FrictionF")==0) return FrictionFEnum;
 	      else if (strcmp(name,"FrictionGamma")==0) return FrictionGammaEnum;
 	      else if (strcmp(name,"FrictionLaw")==0) return FrictionLawEnum;
 	      else if (strcmp(name,"FrictionPseudoplasticityExponent")==0) return FrictionPseudoplasticityExponentEnum;
-         else stage=2;
-   }
-   if(stage==2){
-	      if (strcmp(name,"FrictionThresholdSpeed")==0) return FrictionThresholdSpeedEnum;
-	      else if (strcmp(name,"FrictionDelta")==0) return FrictionDeltaEnum;
+	      else if (strcmp(name,"FrictionThresholdSpeed")==0) return FrictionThresholdSpeedEnum;
 	      else if (strcmp(name,"FrictionVoidRatio")==0) return FrictionVoidRatioEnum;
+	      else if (strcmp(name,"FrontalForcingsBasinIcefrontArea")==0) return FrontalForcingsBasinIcefrontAreaEnum;
+	      else if (strcmp(name,"FrontalForcingsNumberofBasins")==0) return FrontalForcingsNumberofBasinsEnum;
+	      else if (strcmp(name,"FrontalForcingsParam")==0) return FrontalForcingsParamEnum;
 	      else if (strcmp(name,"GiaCrossSectionShape")==0) return GiaCrossSectionShapeEnum;
-	      else if (strcmp(name,"GroundinglineMigration")==0) return GroundinglineMigrationEnum;
 	      else if (strcmp(name,"GroundinglineFrictionInterpolation")==0) return GroundinglineFrictionInterpolationEnum;
 	      else if (strcmp(name,"GroundinglineMeltInterpolation")==0) return GroundinglineMeltInterpolationEnum;
+	      else if (strcmp(name,"GroundinglineMigration")==0) return GroundinglineMigrationEnum;
+	      else if (strcmp(name,"HydrologyCavitySpacing")==0) return HydrologyCavitySpacingEnum;
+	      else if (strcmp(name,"HydrologyChannelConductivity")==0) return HydrologyChannelConductivityEnum;
+	      else if (strcmp(name,"HydrologyChannelSheetWidth")==0) return HydrologyChannelSheetWidthEnum;
+	      else if (strcmp(name,"HydrologyEnglacialVoidRatio")==0) return HydrologyEnglacialVoidRatioEnum;
+	      else if (strcmp(name,"HydrologyIschannels")==0) return HydrologyIschannelsEnum;
+	      else if (strcmp(name,"HydrologyMeltFlag")==0) return HydrologyMeltFlagEnum;
+	      else if (strcmp(name,"HydrologyModel")==0) return HydrologyModelEnum;
+	      else if (strcmp(name,"HydrologyNumRequestedOutputs")==0) return HydrologyNumRequestedOutputsEnum;
+	      else if (strcmp(name,"HydrologyPressureMeltCoefficient")==0) return HydrologyPressureMeltCoefficientEnum;
+	      else if (strcmp(name,"HydrologyRelaxation")==0) return HydrologyRelaxationEnum;
+	      else if (strcmp(name,"HydrologyRequestedOutputs")==0) return HydrologyRequestedOutputsEnum;
+	      else if (strcmp(name,"HydrologySedimentKmax")==0) return HydrologySedimentKmaxEnum;
+	      else if (strcmp(name,"HydrologyStepsPerStep")==0) return HydrologyStepsPerStepEnum;
+	      else if (strcmp(name,"HydrologyStorage")==0) return HydrologyStorageEnum;
+	      else if (strcmp(name,"HydrologydcEplColapseThickness")==0) return HydrologydcEplColapseThicknessEnum;
+	      else if (strcmp(name,"HydrologydcEplCompressibility")==0) return HydrologydcEplCompressibilityEnum;
+	      else if (strcmp(name,"HydrologydcEplConductivity")==0) return HydrologydcEplConductivityEnum;
+	      else if (strcmp(name,"HydrologydcEplInitialThickness")==0) return HydrologydcEplInitialThicknessEnum;
+	      else if (strcmp(name,"HydrologydcEplMaxThickness")==0) return HydrologydcEplMaxThicknessEnum;
+	      else if (strcmp(name,"HydrologydcEplPorosity")==0) return HydrologydcEplPorosityEnum;
+	      else if (strcmp(name,"HydrologydcEplThickComp")==0) return HydrologydcEplThickCompEnum;
 	      else if (strcmp(name,"HydrologydcEplflipLock")==0) return HydrologydcEplflipLockEnum;
-	      else if (strcmp(name,"HydrologydcEplThickComp")==0) return HydrologydcEplThickCompEnum;
 	      else if (strcmp(name,"HydrologydcIsefficientlayer")==0) return HydrologydcIsefficientlayerEnum;
 	      else if (strcmp(name,"HydrologydcLeakageFactor")==0) return HydrologydcLeakageFactorEnum;
@@ -155,17 +192,13 @@
 	      else if (strcmp(name,"HydrologydcPenaltyLock")==0) return HydrologydcPenaltyLockEnum;
 	      else if (strcmp(name,"HydrologydcRelTol")==0) return HydrologydcRelTolEnum;
+	      else if (strcmp(name,"HydrologydcSedimentCompressibility")==0) return HydrologydcSedimentCompressibilityEnum;
 	      else if (strcmp(name,"HydrologydcSedimentlimit")==0) return HydrologydcSedimentlimitEnum;
 	      else if (strcmp(name,"HydrologydcSedimentlimitFlag")==0) return HydrologydcSedimentlimitFlagEnum;
+	      else if (strcmp(name,"HydrologydcSedimentPorosity")==0) return HydrologydcSedimentPorosityEnum;
+	      else if (strcmp(name,"HydrologydcSedimentThickness")==0) return HydrologydcSedimentThicknessEnum;
 	      else if (strcmp(name,"HydrologydcTransferFlag")==0) return HydrologydcTransferFlagEnum;
 	      else if (strcmp(name,"HydrologydcUnconfinedFlag")==0) return HydrologydcUnconfinedFlagEnum;
-	      else if (strcmp(name,"Hydrologydt")==0) return HydrologydtEnum;
-	      else if (strcmp(name,"HydrologyModel")==0) return HydrologyModelEnum;
-	      else if (strcmp(name,"HydrologyNumRequestedOutputs")==0) return HydrologyNumRequestedOutputsEnum;
-	      else if (strcmp(name,"HydrologyRelaxation")==0) return HydrologyRelaxationEnum;
-	      else if (strcmp(name,"HydrologyRequestedOutputs")==0) return HydrologyRequestedOutputsEnum;
-	      else if (strcmp(name,"HydrologySedimentKmax")==0) return HydrologySedimentKmaxEnum;
+	      else if (strcmp(name,"HydrologydcWaterCompressibility")==0) return HydrologydcWaterCompressibilityEnum;
 	      else if (strcmp(name,"HydrologyshreveStabilization")==0) return HydrologyshreveStabilizationEnum;
-	      else if (strcmp(name,"HydrologyStepsPerStep")==0) return HydrologyStepsPerStepEnum;
-	      else if (strcmp(name,"HydrologyStorage")==0) return HydrologyStorageEnum;
 	      else if (strcmp(name,"IcecapToEarthComm")==0) return IcecapToEarthCommEnum;
 	      else if (strcmp(name,"Index")==0) return IndexEnum;
@@ -179,6 +212,4 @@
 	      else if (strcmp(name,"InversionControlParameters")==0) return InversionControlParametersEnum;
 	      else if (strcmp(name,"InversionControlScalingFactors")==0) return InversionControlScalingFactorsEnum;
-	      else if (strcmp(name,"ControlInputSizeM")==0) return ControlInputSizeMEnum;
-	      else if (strcmp(name,"ControlInputSizeN")==0) return ControlInputSizeNEnum;
 	      else if (strcmp(name,"InversionCostFunctions")==0) return InversionCostFunctionsEnum;
 	      else if (strcmp(name,"InversionDxmin")==0) return InversionDxminEnum;
@@ -197,4 +228,5 @@
 	      else if (strcmp(name,"InversionStepThreshold")==0) return InversionStepThresholdEnum;
 	      else if (strcmp(name,"InversionType")==0) return InversionTypeEnum;
+	      else if (strcmp(name,"LevelsetKillIcebergs")==0) return LevelsetKillIcebergsEnum;
 	      else if (strcmp(name,"LevelsetReinitFrequency")==0) return LevelsetReinitFrequencyEnum;
 	      else if (strcmp(name,"LevelsetStabilization")==0) return LevelsetStabilizationEnum;
@@ -219,5 +251,26 @@
 	      else if (strcmp(name,"MasstransportRequestedOutputs")==0) return MasstransportRequestedOutputsEnum;
 	      else if (strcmp(name,"MasstransportStabilization")==0) return MasstransportStabilizationEnum;
+	      else if (strcmp(name,"MaterialsBeta")==0) return MaterialsBetaEnum;
+	      else if (strcmp(name,"MaterialsEarthDensity")==0) return MaterialsEarthDensityEnum;
+	      else if (strcmp(name,"MaterialsEffectiveconductivityAveraging")==0) return MaterialsEffectiveconductivityAveragingEnum;
+	      else if (strcmp(name,"MaterialsHeatcapacity")==0) return MaterialsHeatcapacityEnum;
+	      else if (strcmp(name,"MaterialsLatentheat")==0) return MaterialsLatentheatEnum;
+	      else if (strcmp(name,"MaterialsLithosphereDensity")==0) return MaterialsLithosphereDensityEnum;
+	      else if (strcmp(name,"MaterialsLithosphereShearModulus")==0) return MaterialsLithosphereShearModulusEnum;
+	      else if (strcmp(name,"MaterialsMantleDensity")==0) return MaterialsMantleDensityEnum;
+	      else if (strcmp(name,"MaterialsMantleShearModulus")==0) return MaterialsMantleShearModulusEnum;
+         else stage=3;
+   }
+   if(stage==3){
+	      if (strcmp(name,"MaterialsMeltingpoint")==0) return MaterialsMeltingpointEnum;
+	      else if (strcmp(name,"MaterialsMixedLayerCapacity")==0) return MaterialsMixedLayerCapacityEnum;
+	      else if (strcmp(name,"MaterialsMuWater")==0) return MaterialsMuWaterEnum;
+	      else if (strcmp(name,"MaterialsRheologyLaw")==0) return MaterialsRheologyLawEnum;
+	      else if (strcmp(name,"MaterialsRhoFreshwater")==0) return MaterialsRhoFreshwaterEnum;
 	      else if (strcmp(name,"MaterialsRhoIce")==0) return MaterialsRhoIceEnum;
+	      else if (strcmp(name,"MaterialsRhoSeawater")==0) return MaterialsRhoSeawaterEnum;
+	      else if (strcmp(name,"MaterialsTemperateiceconductivity")==0) return MaterialsTemperateiceconductivityEnum;
+	      else if (strcmp(name,"MaterialsThermalExchangeVelocity")==0) return MaterialsThermalExchangeVelocityEnum;
+	      else if (strcmp(name,"MaterialsThermalconductivity")==0) return MaterialsThermalconductivityEnum;
 	      else if (strcmp(name,"MeltingOffset")==0) return MeltingOffsetEnum;
 	      else if (strcmp(name,"MeshAverageVertexConnectivity")==0) return MeshAverageVertexConnectivityEnum;
@@ -234,7 +287,7 @@
 	      else if (strcmp(name,"OutputBufferPointer")==0) return OutputBufferPointerEnum;
 	      else if (strcmp(name,"OutputBufferSizePointer")==0) return OutputBufferSizePointerEnum;
-	      else if (strcmp(name,"Outputdefinition")==0) return OutputdefinitionEnum;
 	      else if (strcmp(name,"OutputFileName")==0) return OutputFileNameEnum;
 	      else if (strcmp(name,"OutputFilePointer")==0) return OutputFilePointerEnum;
+	      else if (strcmp(name,"Outputdefinition")==0) return OutputdefinitionEnum;
 	      else if (strcmp(name,"Param")==0) return ParamEnum;
 	      else if (strcmp(name,"Parameters")==0) return ParametersEnum;
@@ -244,5 +297,6 @@
 	      else if (strcmp(name,"QmuNumberofpartitions")==0) return QmuNumberofpartitionsEnum;
 	      else if (strcmp(name,"QmuOutName")==0) return QmuOutNameEnum;
-	      else if (strcmp(name,"QmuPartition")==0) return QmuPartitionEnum;
+	      else if (strcmp(name,"QmuEpartition")==0) return QmuEpartitionEnum;
+	      else if (strcmp(name,"QmuVpartition")==0) return QmuVpartitionEnum;
 	      else if (strcmp(name,"QmuResponsedescriptors")==0) return QmuResponsedescriptorsEnum;
 	      else if (strcmp(name,"QmuVariableDescriptors")==0) return QmuVariableDescriptorsEnum;
@@ -252,6 +306,4 @@
 	      else if (strcmp(name,"SaveResults")==0) return SaveResultsEnum;
 	      else if (strcmp(name,"SealevelEustatic")==0) return SealevelEustaticEnum;
-	      else if (strcmp(name,"SealevelEustaticOceanMask")==0) return SealevelEustaticOceanMaskEnum;
-	      else if (strcmp(name,"SealevelEustaticMask")==0) return SealevelEustaticMaskEnum;
 	      else if (strcmp(name,"SealevelriseAbstol")==0) return SealevelriseAbstolEnum;
 	      else if (strcmp(name,"SealevelriseAngularVelocity")==0) return SealevelriseAngularVelocityEnum;
@@ -260,8 +312,5 @@
 	      else if (strcmp(name,"SealevelriseFluidLove")==0) return SealevelriseFluidLoveEnum;
 	      else if (strcmp(name,"SealevelriseGElastic")==0) return SealevelriseGElasticEnum;
-         else stage=3;
-   }
-   if(stage==3){
-	      if (strcmp(name,"SealevelriseGeodetic")==0) return SealevelriseGeodeticEnum;
+	      else if (strcmp(name,"SealevelriseGeodetic")==0) return SealevelriseGeodeticEnum;
 	      else if (strcmp(name,"SealevelriseGeodeticRunFrequency")==0) return SealevelriseGeodeticRunFrequencyEnum;
 	      else if (strcmp(name,"SealevelriseHElastic")==0) return SealevelriseHElasticEnum;
@@ -277,21 +326,25 @@
 	      else if (strcmp(name,"SealevelriseRunCount")==0) return SealevelriseRunCountEnum;
 	      else if (strcmp(name,"SealevelriseTidalLoveH")==0) return SealevelriseTidalLoveHEnum;
-	      else if (strcmp(name,"SealevelriseSpcthickness")==0) return SealevelriseSpcthicknessEnum;
 	      else if (strcmp(name,"SealevelriseTidalLoveK")==0) return SealevelriseTidalLoveKEnum;
 	      else if (strcmp(name,"SealevelriseTransitions")==0) return SealevelriseTransitionsEnum;
 	      else if (strcmp(name,"SealevelriseUElastic")==0) return SealevelriseUElasticEnum;
 	      else if (strcmp(name,"SettingsIoGather")==0) return SettingsIoGatherEnum;
+	      else if (strcmp(name,"SettingsNumResultsOnNodes")==0) return SettingsNumResultsOnNodesEnum;
 	      else if (strcmp(name,"SettingsOutputFrequency")==0) return SettingsOutputFrequencyEnum;
 	      else if (strcmp(name,"SettingsRecordingFrequency")==0) return SettingsRecordingFrequencyEnum;
 	      else if (strcmp(name,"SettingsResultsOnNodes")==0) return SettingsResultsOnNodesEnum;
+	      else if (strcmp(name,"SettingsSbCouplingFrequency")==0) return SettingsSbCouplingFrequencyEnum;
 	      else if (strcmp(name,"SettingsSolverResidueThreshold")==0) return SettingsSolverResidueThresholdEnum;
 	      else if (strcmp(name,"SettingsWaitonlock")==0) return SettingsWaitonlockEnum;
+	      else if (strcmp(name,"SmbAIce")==0) return SmbAIceEnum;
+	      else if (strcmp(name,"SmbAIdx")==0) return SmbAIdxEnum;
+	      else if (strcmp(name,"SmbASnow")==0) return SmbASnowEnum;
 	      else if (strcmp(name,"SmbAccualti")==0) return SmbAccualtiEnum;
 	      else if (strcmp(name,"SmbAccugrad")==0) return SmbAccugradEnum;
 	      else if (strcmp(name,"SmbAccuref")==0) return SmbAccurefEnum;
 	      else if (strcmp(name,"SmbAdThresh")==0) return SmbAdThreshEnum;
-	      else if (strcmp(name,"SmbAIce")==0) return SmbAIceEnum;
-	      else if (strcmp(name,"SmbAIdx")==0) return SmbAIdxEnum;
-	      else if (strcmp(name,"SmbASnow")==0) return SmbASnowEnum;
+	      else if (strcmp(name,"SmbDesfac")==0) return SmbDesfacEnum;
+	      else if (strcmp(name,"SmbDpermil")==0) return SmbDpermilEnum;
+	      else if (strcmp(name,"SmbDsnowIdx")==0) return SmbDsnowIdxEnum;
 	      else if (strcmp(name,"SmbCldFrac")==0) return SmbCldFracEnum;
 	      else if (strcmp(name,"SmbDelta18o")==0) return SmbDelta18oEnum;
@@ -304,15 +357,16 @@
 	      else if (strcmp(name,"SmbIsaccumulation")==0) return SmbIsaccumulationEnum;
 	      else if (strcmp(name,"SmbIsalbedo")==0) return SmbIsalbedoEnum;
+	      else if (strcmp(name,"SmbIsclimatology")==0) return SmbIsclimatologyEnum;
 	      else if (strcmp(name,"SmbIsd18opd")==0) return SmbIsd18opdEnum;
 	      else if (strcmp(name,"SmbIsdelta18o")==0) return SmbIsdelta18oEnum;
 	      else if (strcmp(name,"SmbIsdensification")==0) return SmbIsdensificationEnum;
+	      else if (strcmp(name,"SmbIsfirnwarming")==0) return SmbIsfirnwarmingEnum;
 	      else if (strcmp(name,"SmbIsgraingrowth")==0) return SmbIsgraingrowthEnum;
-	      else if (strcmp(name,"SmbIsfirnwarming")==0) return SmbIsfirnwarmingEnum;
 	      else if (strcmp(name,"SmbIsmelt")==0) return SmbIsmeltEnum;
 	      else if (strcmp(name,"SmbIsmungsm")==0) return SmbIsmungsmEnum;
+	      else if (strcmp(name,"SmbIsprecipscaled")==0) return SmbIsprecipscaledEnum;
 	      else if (strcmp(name,"SmbIssetpddfac")==0) return SmbIssetpddfacEnum;
 	      else if (strcmp(name,"SmbIsshortwave")==0) return SmbIsshortwaveEnum;
 	      else if (strcmp(name,"SmbIstemperaturescaled")==0) return SmbIstemperaturescaledEnum;
-	      else if (strcmp(name,"SmbIsprecipscaled")==0) return SmbIsprecipscaledEnum;
 	      else if (strcmp(name,"SmbIsthermal")==0) return SmbIsthermalEnum;
 	      else if (strcmp(name,"SmbIsturbulentflux")==0) return SmbIsturbulentfluxEnum;
@@ -320,10 +374,17 @@
 	      else if (strcmp(name,"SmbNumRequestedOutputs")==0) return SmbNumRequestedOutputsEnum;
 	      else if (strcmp(name,"SmbPfac")==0) return SmbPfacEnum;
+	      else if (strcmp(name,"SmbRdl")==0) return SmbRdlEnum;
 	      else if (strcmp(name,"SmbRequestedOutputs")==0) return SmbRequestedOutputsEnum;
+	      else if (strcmp(name,"SmbRlaps")==0) return SmbRlapsEnum;
+	      else if (strcmp(name,"SmbRlapslgm")==0) return SmbRlapslgmEnum;
 	      else if (strcmp(name,"SmbRunoffalti")==0) return SmbRunoffaltiEnum;
 	      else if (strcmp(name,"SmbRunoffgrad")==0) return SmbRunoffgradEnum;
 	      else if (strcmp(name,"SmbRunoffref")==0) return SmbRunoffrefEnum;
 	      else if (strcmp(name,"SmbSealev")==0) return SmbSealevEnum;
-	      else if (strcmp(name,"SmbSwIdx")==0) return SmbSwIdxEnum;
+	      else if (strcmp(name,"SmbStepsPerStep")==0) return SmbStepsPerStepEnum;
+         else stage=4;
+   }
+   if(stage==4){
+	      if (strcmp(name,"SmbSwIdx")==0) return SmbSwIdxEnum;
 	      else if (strcmp(name,"SmbT0dry")==0) return SmbT0dryEnum;
 	      else if (strcmp(name,"SmbT0wet")==0) return SmbT0wetEnum;
@@ -348,4 +409,5 @@
 	      else if (strcmp(name,"StressbalanceRiftPenaltyThreshold")==0) return StressbalanceRiftPenaltyThresholdEnum;
 	      else if (strcmp(name,"StressbalanceShelfDampening")==0) return StressbalanceShelfDampeningEnum;
+	      else if (strcmp(name,"ThermalIsdrainicecolumn")==0) return ThermalIsdrainicecolumnEnum;
 	      else if (strcmp(name,"ThermalIsdynamicbasalspc")==0) return ThermalIsdynamicbasalspcEnum;
 	      else if (strcmp(name,"ThermalIsenthalpy")==0) return ThermalIsenthalpyEnum;
@@ -358,4 +420,5 @@
 	      else if (strcmp(name,"ThermalRequestedOutputs")==0) return ThermalRequestedOutputsEnum;
 	      else if (strcmp(name,"ThermalStabilization")==0) return ThermalStabilizationEnum;
+	      else if (strcmp(name,"ThermalWatercolumnUpperlimit")==0) return ThermalWatercolumnUpperlimitEnum;
 	      else if (strcmp(name,"Time")==0) return TimeEnum;
 	      else if (strcmp(name,"TimesteppingCflCoefficient")==0) return TimesteppingCflCoefficientEnum;
@@ -383,8 +446,5 @@
 	      else if (strcmp(name,"TransientIsmovingfront")==0) return TransientIsmovingfrontEnum;
 	      else if (strcmp(name,"TransientIsoceancoupling")==0) return TransientIsoceancouplingEnum;
-         else stage=4;
-   }
-   if(stage==4){
-	      if (strcmp(name,"TransientIsslr")==0) return TransientIsslrEnum;
+	      else if (strcmp(name,"TransientIsslr")==0) return TransientIsslrEnum;
 	      else if (strcmp(name,"TransientIssmb")==0) return TransientIssmbEnum;
 	      else if (strcmp(name,"TransientIsstressbalance")==0) return TransientIsstressbalanceEnum;
@@ -397,4 +457,5 @@
 	      else if (strcmp(name,"InputsSTART")==0) return InputsSTARTEnum;
 	      else if (strcmp(name,"Adjoint")==0) return AdjointEnum;
+	      else if (strcmp(name,"Adjointp")==0) return AdjointpEnum;
 	      else if (strcmp(name,"Adjointx")==0) return AdjointxEnum;
 	      else if (strcmp(name,"Adjointy")==0) return AdjointyEnum;
@@ -406,7 +467,14 @@
 	      else if (strcmp(name,"BalancethicknessOmega")==0) return BalancethicknessOmegaEnum;
 	      else if (strcmp(name,"BalancethicknessThickeningRate")==0) return BalancethicknessThickeningRateEnum;
+	      else if (strcmp(name,"BasalCrevasse")==0) return BasalCrevasseEnum;
 	      else if (strcmp(name,"BasalforcingsFloatingiceMeltingRate")==0) return BasalforcingsFloatingiceMeltingRateEnum;
 	      else if (strcmp(name,"BasalforcingsGeothermalflux")==0) return BasalforcingsGeothermalfluxEnum;
 	      else if (strcmp(name,"BasalforcingsGroundediceMeltingRate")==0) return BasalforcingsGroundediceMeltingRateEnum;
+	      else if (strcmp(name,"BasalforcingsIsmip6BasinId")==0) return BasalforcingsIsmip6BasinIdEnum;
+	      else if (strcmp(name,"BasalforcingsIsmip6Tf")==0) return BasalforcingsIsmip6TfEnum;
+	      else if (strcmp(name,"BasalforcingsIsmip6TfShelf")==0) return BasalforcingsIsmip6TfShelfEnum;
+	      else if (strcmp(name,"BasalforcingsIsmip6MeltAnomaly")==0) return BasalforcingsIsmip6MeltAnomalyEnum;
+	      else if (strcmp(name,"BasalforcingsOceanSalinity")==0) return BasalforcingsOceanSalinityEnum;
+	      else if (strcmp(name,"BasalforcingsOceanTemp")==0) return BasalforcingsOceanTempEnum;
 	      else if (strcmp(name,"BasalforcingsPicoBasinId")==0) return BasalforcingsPicoBasinIdEnum;
 	      else if (strcmp(name,"BasalforcingsPicoBoxId")==0) return BasalforcingsPicoBoxIdEnum;
@@ -414,4 +482,7 @@
 	      else if (strcmp(name,"BasalforcingsPicoSubShelfOceanSalinity")==0) return BasalforcingsPicoSubShelfOceanSalinityEnum;
 	      else if (strcmp(name,"BasalforcingsPicoSubShelfOceanTemp")==0) return BasalforcingsPicoSubShelfOceanTempEnum;
+	      else if (strcmp(name,"BasalStressx")==0) return BasalStressxEnum;
+	      else if (strcmp(name,"BasalStressy")==0) return BasalStressyEnum;
+	      else if (strcmp(name,"BasalStress")==0) return BasalStressEnum;
 	      else if (strcmp(name,"Base")==0) return BaseEnum;
 	      else if (strcmp(name,"BaseSlopeX")==0) return BaseSlopeXEnum;
@@ -422,18 +493,25 @@
 	      else if (strcmp(name,"CalvingCalvingrate")==0) return CalvingCalvingrateEnum;
 	      else if (strcmp(name,"CalvingHabFraction")==0) return CalvingHabFractionEnum;
+	      else if (strcmp(name,"CalvingMeltingrate")==0) return CalvingMeltingrateEnum;
+	      else if (strcmp(name,"CalvingStressThresholdFloatingice")==0) return CalvingStressThresholdFloatingiceEnum;
+	      else if (strcmp(name,"CalvingStressThresholdGroundedice")==0) return CalvingStressThresholdGroundediceEnum;
 	      else if (strcmp(name,"CalvinglevermannCoeff")==0) return CalvinglevermannCoeffEnum;
-	      else if (strcmp(name,"CalvinglevermannMeltingrate")==0) return CalvinglevermannMeltingrateEnum;
-	      else if (strcmp(name,"CalvingMeltingrate")==0) return CalvingMeltingrateEnum;
 	      else if (strcmp(name,"CalvingratexAverage")==0) return CalvingratexAverageEnum;
 	      else if (strcmp(name,"Calvingratex")==0) return CalvingratexEnum;
 	      else if (strcmp(name,"CalvingrateyAverage")==0) return CalvingrateyAverageEnum;
 	      else if (strcmp(name,"Calvingratey")==0) return CalvingrateyEnum;
-	      else if (strcmp(name,"CalvingStressThresholdFloatingice")==0) return CalvingStressThresholdFloatingiceEnum;
-	      else if (strcmp(name,"CalvingStressThresholdGroundedice")==0) return CalvingStressThresholdGroundediceEnum;
+	      else if (strcmp(name,"CalvingFluxLevelset")==0) return CalvingFluxLevelsetEnum;
+	      else if (strcmp(name,"CalvingMeltingFluxLevelset")==0) return CalvingMeltingFluxLevelsetEnum;
 	      else if (strcmp(name,"Converged")==0) return ConvergedEnum;
 	      else if (strcmp(name,"CrevasseDepth")==0) return CrevasseDepthEnum;
-	      else if (strcmp(name,"DamageDbar")==0) return DamageDbarEnum;
 	      else if (strcmp(name,"DamageD")==0) return DamageDEnum;
+         else stage=5;
+   }
+   if(stage==5){
+	      if (strcmp(name,"DamageDbar")==0) return DamageDbarEnum;
 	      else if (strcmp(name,"DamageF")==0) return DamageFEnum;
+	      else if (strcmp(name,"DegreeOfChannelization")==0) return DegreeOfChannelizationEnum;
+	      else if (strcmp(name,"DepthBelowSurface")==0) return DepthBelowSurfaceEnum;
+	      else if (strcmp(name,"DeviatoricStresseffective")==0) return DeviatoricStresseffectiveEnum;
 	      else if (strcmp(name,"DeviatoricStressxx")==0) return DeviatoricStressxxEnum;
 	      else if (strcmp(name,"DeviatoricStressxy")==0) return DeviatoricStressxyEnum;
@@ -442,4 +520,6 @@
 	      else if (strcmp(name,"DeviatoricStressyz")==0) return DeviatoricStressyzEnum;
 	      else if (strcmp(name,"DeviatoricStresszz")==0) return DeviatoricStresszzEnum;
+	      else if (strcmp(name,"DeviatoricStress1")==0) return DeviatoricStress1Enum;
+	      else if (strcmp(name,"DeviatoricStress2")==0) return DeviatoricStress2Enum;
 	      else if (strcmp(name,"DistanceToCalvingfront")==0) return DistanceToCalvingfrontEnum;
 	      else if (strcmp(name,"DistanceToGroundingline")==0) return DistanceToGroundinglineEnum;
@@ -450,22 +530,32 @@
 	      else if (strcmp(name,"DrivingStressX")==0) return DrivingStressXEnum;
 	      else if (strcmp(name,"DrivingStressY")==0) return DrivingStressYEnum;
-	      else if (strcmp(name,"EffectivePressureHydrostep")==0) return EffectivePressureHydrostepEnum;
+	      else if (strcmp(name,"EffectivePressure")==0) return EffectivePressureEnum;
+	      else if (strcmp(name,"EffectivePressureSubstep")==0) return EffectivePressureSubstepEnum;
+	      else if (strcmp(name,"EffectivePressureTransient")==0) return EffectivePressureTransientEnum;
 	      else if (strcmp(name,"Enthalpy")==0) return EnthalpyEnum;
 	      else if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
-	      else if (strcmp(name,"EplHeadHydrostep")==0) return EplHeadHydrostepEnum;
+	      else if (strcmp(name,"EplHead")==0) return EplHeadEnum;
 	      else if (strcmp(name,"EplHeadOld")==0) return EplHeadOldEnum;
 	      else if (strcmp(name,"EplHeadSlopeX")==0) return EplHeadSlopeXEnum;
 	      else if (strcmp(name,"EplHeadSlopeY")==0) return EplHeadSlopeYEnum;
+	      else if (strcmp(name,"EplHeadSubstep")==0) return EplHeadSubstepEnum;
+	      else if (strcmp(name,"EplHeadTransient")==0) return EplHeadTransientEnum;
 	      else if (strcmp(name,"EsaDeltathickness")==0) return EsaDeltathicknessEnum;
 	      else if (strcmp(name,"EsaEmotion")==0) return EsaEmotionEnum;
 	      else if (strcmp(name,"EsaNmotion")==0) return EsaNmotionEnum;
+	      else if (strcmp(name,"EsaRotationrate")==0) return EsaRotationrateEnum;
+	      else if (strcmp(name,"EsaStrainratexx")==0) return EsaStrainratexxEnum;
+	      else if (strcmp(name,"EsaStrainratexy")==0) return EsaStrainratexyEnum;
+	      else if (strcmp(name,"EsaStrainrateyy")==0) return EsaStrainrateyyEnum;
 	      else if (strcmp(name,"EsaUmotion")==0) return EsaUmotionEnum;
 	      else if (strcmp(name,"EsaXmotion")==0) return EsaXmotionEnum;
 	      else if (strcmp(name,"EsaYmotion")==0) return EsaYmotionEnum;
 	      else if (strcmp(name,"EtaDiff")==0) return EtaDiffEnum;
+	      else if (strcmp(name,"FlowequationBorderFS")==0) return FlowequationBorderFSEnum;
 	      else if (strcmp(name,"FrictionAs")==0) return FrictionAsEnum;
 	      else if (strcmp(name,"FrictionC")==0) return FrictionCEnum;
+	      else if (strcmp(name,"FrictionCmax")==0) return FrictionCmaxEnum;
+	      else if (strcmp(name,"FrictionCoefficient")==0) return FrictionCoefficientEnum;
 	      else if (strcmp(name,"FrictionCoefficientcoulomb")==0) return FrictionCoefficientcoulombEnum;
-	      else if (strcmp(name,"FrictionCoefficient")==0) return FrictionCoefficientEnum;
 	      else if (strcmp(name,"FrictionEffectivePressure")==0) return FrictionEffectivePressureEnum;
 	      else if (strcmp(name,"FrictionM")==0) return FrictionMEnum;
@@ -473,20 +563,28 @@
 	      else if (strcmp(name,"FrictionPressureAdjustedTemperature")==0) return FrictionPressureAdjustedTemperatureEnum;
 	      else if (strcmp(name,"FrictionQ")==0) return FrictionQEnum;
+	      else if (strcmp(name,"FrictionSedimentCompressibilityCoefficient")==0) return FrictionSedimentCompressibilityCoefficientEnum;
+	      else if (strcmp(name,"FrictionTillFrictionAngle")==0) return FrictionTillFrictionAngleEnum;
 	      else if (strcmp(name,"FrictionWaterLayer")==0) return FrictionWaterLayerEnum;
-	      else if (strcmp(name,"HydrologyWatercolumnMax")==0) return HydrologyWatercolumnMaxEnum;
-	      else if (strcmp(name,"FrictionTillFrictionAngle")==0) return FrictionTillFrictionAngleEnum;
-	      else if (strcmp(name,"FrictionSedimentCompressibilityCoefficient")==0) return FrictionSedimentCompressibilityCoefficientEnum;
+	      else if (strcmp(name,"Frictionf")==0) return FrictionfEnum;
+	      else if (strcmp(name,"FrontalForcingsBasinId")==0) return FrontalForcingsBasinIdEnum;
+	      else if (strcmp(name,"FrontalForcingsSubglacialDischarge")==0) return FrontalForcingsSubglacialDischargeEnum;
+	      else if (strcmp(name,"FrontalForcingsThermalForcing")==0) return FrontalForcingsThermalForcingEnum;
 	      else if (strcmp(name,"GeometryHydrostaticRatio")==0) return GeometryHydrostaticRatioEnum;
 	      else if (strcmp(name,"GiaLithosphereThickness")==0) return GiaLithosphereThicknessEnum;
 	      else if (strcmp(name,"GiaMantleViscosity")==0) return GiaMantleViscosityEnum;
+	      else if (strcmp(name,"GiaW")==0) return GiaWEnum;
 	      else if (strcmp(name,"GiadWdt")==0) return GiadWdtEnum;
-	      else if (strcmp(name,"GiaW")==0) return GiaWEnum;
 	      else if (strcmp(name,"Gradient")==0) return GradientEnum;
 	      else if (strcmp(name,"GroundinglineHeight")==0) return GroundinglineHeightEnum;
+	      else if (strcmp(name,"HydraulicPotential")==0) return HydraulicPotentialEnum;
+	      else if (strcmp(name,"HydraulicPotentialOld")==0) return HydraulicPotentialOldEnum;
+	      else if (strcmp(name,"HydrologyBasalFlux")==0) return HydrologyBasalFluxEnum;
 	      else if (strcmp(name,"HydrologyBumpHeight")==0) return HydrologyBumpHeightEnum;
 	      else if (strcmp(name,"HydrologyBumpSpacing")==0) return HydrologyBumpSpacingEnum;
 	      else if (strcmp(name,"HydrologydcBasalMoulinInput")==0) return HydrologydcBasalMoulinInputEnum;
-	      else if (strcmp(name,"HydrologydcEplThicknessHydrostep")==0) return HydrologydcEplThicknessHydrostepEnum;
+	      else if (strcmp(name,"HydrologydcEplThickness")==0) return HydrologydcEplThicknessEnum;
 	      else if (strcmp(name,"HydrologydcEplThicknessOld")==0) return HydrologydcEplThicknessOldEnum;
+	      else if (strcmp(name,"HydrologydcEplThicknessSubstep")==0) return HydrologydcEplThicknessSubstepEnum;
+	      else if (strcmp(name,"HydrologydcEplThicknessTransient")==0) return HydrologydcEplThicknessTransientEnum;
 	      else if (strcmp(name,"HydrologydcMaskEplactiveElt")==0) return HydrologydcMaskEplactiveEltEnum;
 	      else if (strcmp(name,"HydrologydcMaskEplactiveNode")==0) return HydrologydcMaskEplactiveNodeEnum;
@@ -494,4 +592,5 @@
 	      else if (strcmp(name,"HydrologydcMaskThawedNode")==0) return HydrologydcMaskThawedNodeEnum;
 	      else if (strcmp(name,"HydrologydcSedimentTransmitivity")==0) return HydrologydcSedimentTransmitivityEnum;
+	      else if (strcmp(name,"HydrologyDrainageRate")==0) return HydrologyDrainageRateEnum;
 	      else if (strcmp(name,"HydrologyEnglacialInput")==0) return HydrologyEnglacialInputEnum;
 	      else if (strcmp(name,"HydrologyGapHeight")==0) return HydrologyGapHeightEnum;
@@ -501,13 +600,13 @@
 	      else if (strcmp(name,"HydrologyNeumannflux")==0) return HydrologyNeumannfluxEnum;
 	      else if (strcmp(name,"HydrologyReynolds")==0) return HydrologyReynoldsEnum;
+	      else if (strcmp(name,"HydrologySheetConductivity")==0) return HydrologySheetConductivityEnum;
+	      else if (strcmp(name,"HydrologySheetThickness")==0) return HydrologySheetThicknessEnum;
+	      else if (strcmp(name,"HydrologySheetThicknessOld")==0) return HydrologySheetThicknessOldEnum;
+	      else if (strcmp(name,"HydrologyWatercolumnMax")==0) return HydrologyWatercolumnMaxEnum;
 	      else if (strcmp(name,"HydrologyWaterVx")==0) return HydrologyWaterVxEnum;
 	      else if (strcmp(name,"HydrologyWaterVy")==0) return HydrologyWaterVyEnum;
-	      else if (strcmp(name,"HydrologyDrainageRate")==0) return HydrologyDrainageRateEnum;
 	      else if (strcmp(name,"Ice")==0) return IceEnum;
 	      else if (strcmp(name,"IceMaskNodeActivation")==0) return IceMaskNodeActivationEnum;
-         else stage=5;
-   }
-   if(stage==5){
-	      if (strcmp(name,"Input")==0) return InputEnum;
+	      else if (strcmp(name,"Input")==0) return InputEnum;
 	      else if (strcmp(name,"InversionCostFunctionsCoefficients")==0) return InversionCostFunctionsCoefficientsEnum;
 	      else if (strcmp(name,"InversionSurfaceObs")==0) return InversionSurfaceObsEnum;
@@ -523,13 +622,18 @@
 	      else if (strcmp(name,"MaskGroundediceLevelset")==0) return MaskGroundediceLevelsetEnum;
 	      else if (strcmp(name,"MaskIceLevelset")==0) return MaskIceLevelsetEnum;
+	      else if (strcmp(name,"MaskLandLevelset")==0) return MaskLandLevelsetEnum;
+	      else if (strcmp(name,"MaskOceanLevelset")==0) return MaskOceanLevelsetEnum;
 	      else if (strcmp(name,"MasstransportSpcthickness")==0) return MasstransportSpcthicknessEnum;
+	      else if (strcmp(name,"MaterialsRheologyB")==0) return MaterialsRheologyBEnum;
 	      else if (strcmp(name,"MaterialsRheologyBbar")==0) return MaterialsRheologyBbarEnum;
-	      else if (strcmp(name,"MaterialsRheologyB")==0) return MaterialsRheologyBEnum;
+	      else if (strcmp(name,"MaterialsRheologyE")==0) return MaterialsRheologyEEnum;
 	      else if (strcmp(name,"MaterialsRheologyEbar")==0) return MaterialsRheologyEbarEnum;
+         else stage=6;
+   }
+   if(stage==6){
+	      if (strcmp(name,"MaterialsRheologyEc")==0) return MaterialsRheologyEcEnum;
 	      else if (strcmp(name,"MaterialsRheologyEcbar")==0) return MaterialsRheologyEcbarEnum;
-	      else if (strcmp(name,"MaterialsRheologyEc")==0) return MaterialsRheologyEcEnum;
-	      else if (strcmp(name,"MaterialsRheologyE")==0) return MaterialsRheologyEEnum;
+	      else if (strcmp(name,"MaterialsRheologyEs")==0) return MaterialsRheologyEsEnum;
 	      else if (strcmp(name,"MaterialsRheologyEsbar")==0) return MaterialsRheologyEsbarEnum;
-	      else if (strcmp(name,"MaterialsRheologyEs")==0) return MaterialsRheologyEsEnum;
 	      else if (strcmp(name,"MaterialsRheologyN")==0) return MaterialsRheologyNEnum;
 	      else if (strcmp(name,"MeshScaleFactor")==0) return MeshScaleFactorEnum;
@@ -539,4 +643,5 @@
 	      else if (strcmp(name,"Misfit")==0) return MisfitEnum;
 	      else if (strcmp(name,"Neumannflux")==0) return NeumannfluxEnum;
+	      else if (strcmp(name,"NewDamage")==0) return NewDamageEnum;
 	      else if (strcmp(name,"Node")==0) return NodeEnum;
 	      else if (strcmp(name,"OmegaAbsGradient")==0) return OmegaAbsGradientEnum;
@@ -544,31 +649,48 @@
 	      else if (strcmp(name,"P1")==0) return P1Enum;
 	      else if (strcmp(name,"Pressure")==0) return PressureEnum;
+	      else if (strcmp(name,"Radar")==0) return RadarEnum;
+	      else if (strcmp(name,"RadarAttenuationMacGregor")==0) return RadarAttenuationMacGregorEnum;
+	      else if (strcmp(name,"RadarAttenuationWolff")==0) return RadarAttenuationWolffEnum;
+	      else if (strcmp(name,"RadarIcePeriod")==0) return RadarIcePeriodEnum;
+	      else if (strcmp(name,"RadarPowerMacGregor")==0) return RadarPowerMacGregorEnum;
+	      else if (strcmp(name,"RadarPowerWolff")==0) return RadarPowerWolffEnum;
 	      else if (strcmp(name,"RheologyBAbsGradient")==0) return RheologyBAbsGradientEnum;
+	      else if (strcmp(name,"RheologyBInitialguess")==0) return RheologyBInitialguessEnum;
+	      else if (strcmp(name,"RheologyBInitialguessMisfit")==0) return RheologyBInitialguessMisfitEnum;
 	      else if (strcmp(name,"RheologyBbarAbsGradient")==0) return RheologyBbarAbsGradientEnum;
 	      else if (strcmp(name,"Sealevel")==0) return SealevelEnum;
+	      else if (strcmp(name,"SealevelEustaticMask")==0) return SealevelEustaticMaskEnum;
+	      else if (strcmp(name,"SealevelEustaticOceanMask")==0) return SealevelEustaticOceanMaskEnum;
+	      else if (strcmp(name,"SealevelNEsa")==0) return SealevelNEsaEnum;
+	      else if (strcmp(name,"SealevelNEsaRate")==0) return SealevelNEsaRateEnum;
+	      else if (strcmp(name,"SealevelNGia")==0) return SealevelNGiaEnum;
+	      else if (strcmp(name,"SealevelNGiaRate")==0) return SealevelNGiaRateEnum;
+	      else if (strcmp(name,"SealevelRSL")==0) return SealevelRSLEnum;
+	      else if (strcmp(name,"SealevelRSLEustatic")==0) return SealevelRSLEustaticEnum;
+	      else if (strcmp(name,"SealevelRSLEustaticRate")==0) return SealevelRSLEustaticRateEnum;
+	      else if (strcmp(name,"SealevelRSLRate")==0) return SealevelRSLRateEnum;
+	      else if (strcmp(name,"SealevelUEastEsa")==0) return SealevelUEastEsaEnum;
+	      else if (strcmp(name,"SealevelUEsa")==0) return SealevelUEsaEnum;
+	      else if (strcmp(name,"SealevelUEsaRate")==0) return SealevelUEsaRateEnum;
+	      else if (strcmp(name,"SealevelUGia")==0) return SealevelUGiaEnum;
+	      else if (strcmp(name,"SealevelUGiaRate")==0) return SealevelUGiaRateEnum;
+	      else if (strcmp(name,"SealevelUNorthEsa")==0) return SealevelUNorthEsaEnum;
 	      else if (strcmp(name,"SealevelriseCumDeltathickness")==0) return SealevelriseCumDeltathicknessEnum;
 	      else if (strcmp(name,"SealevelriseDeltathickness")==0) return SealevelriseDeltathicknessEnum;
-	      else if (strcmp(name,"SealevelUEsaRate")==0) return SealevelUEsaRateEnum;
-	      else if (strcmp(name,"SealevelNEsaRate")==0) return SealevelNEsaRateEnum;
-	      else if (strcmp(name,"SealevelRSLRate")==0) return SealevelRSLRateEnum;
-	      else if (strcmp(name,"SealevelUEsa")==0) return SealevelUEsaEnum;
-	      else if (strcmp(name,"SealevelRSLEustaticRate")==0) return SealevelRSLEustaticRateEnum;
-	      else if (strcmp(name,"SealevelNEsa")==0) return SealevelNEsaEnum;
-	      else if (strcmp(name,"SealevelUGia")==0) return SealevelUGiaEnum;
-	      else if (strcmp(name,"SealevelNGia")==0) return SealevelNGiaEnum;
-	      else if (strcmp(name,"SealevelRSL")==0) return SealevelRSLEnum;
-	      else if (strcmp(name,"SealevelRSLEustatic")==0) return SealevelRSLEustaticEnum;
-	      else if (strcmp(name,"SealevelUNorthEsa")==0) return SealevelUNorthEsaEnum;
-	      else if (strcmp(name,"SealevelUEastEsa")==0) return SealevelUEastEsaEnum;
-	      else if (strcmp(name,"SealevelNGiaRate")==0) return SealevelNGiaRateEnum;
-	      else if (strcmp(name,"SealevelUGiaRate")==0) return SealevelUGiaRateEnum;
-	      else if (strcmp(name,"SedimentHeadHydrostep")==0) return SedimentHeadHydrostepEnum;
+	      else if (strcmp(name,"SealevelriseSpcthickness")==0) return SealevelriseSpcthicknessEnum;
+	      else if (strcmp(name,"SealevelriseStericRate")==0) return SealevelriseStericRateEnum;
+	      else if (strcmp(name,"SealevelriseHydroRate")==0) return SealevelriseHydroRateEnum;
+	      else if (strcmp(name,"SedimentHead")==0) return SedimentHeadEnum;
 	      else if (strcmp(name,"SedimentHeadOld")==0) return SedimentHeadOldEnum;
+	      else if (strcmp(name,"SedimentHeadSubstep")==0) return SedimentHeadSubstepEnum;
+	      else if (strcmp(name,"SedimentHeadTransient")==0) return SedimentHeadTransientEnum;
 	      else if (strcmp(name,"SedimentHeadResidual")==0) return SedimentHeadResidualEnum;
+	      else if (strcmp(name,"SedimentHeadStacked")==0) return SedimentHeadStackedEnum;
 	      else if (strcmp(name,"SigmaNN")==0) return SigmaNNEnum;
+	      else if (strcmp(name,"SigmaVM")==0) return SigmaVMEnum;
+	      else if (strcmp(name,"SmbA")==0) return SmbAEnum;
+	      else if (strcmp(name,"SmbAValue")==0) return SmbAValueEnum;
 	      else if (strcmp(name,"SmbAccumulation")==0) return SmbAccumulationEnum;
-	      else if (strcmp(name,"SmbA")==0) return SmbAEnum;
 	      else if (strcmp(name,"SmbAini")==0) return SmbAiniEnum;
-	      else if (strcmp(name,"SmbAValue")==0) return SmbAValueEnum;
 	      else if (strcmp(name,"SmbBMax")==0) return SmbBMaxEnum;
 	      else if (strcmp(name,"SmbBMin")==0) return SmbBMinEnum;
@@ -577,11 +699,21 @@
 	      else if (strcmp(name,"SmbC")==0) return SmbCEnum;
 	      else if (strcmp(name,"SmbD")==0) return SmbDEnum;
+	      else if (strcmp(name,"SmbDailyairdensity")==0) return SmbDailyairdensityEnum;
+	      else if (strcmp(name,"SmbDailyairhumidity")==0) return SmbDailyairhumidityEnum;
+	      else if (strcmp(name,"SmbDailydlradiation")==0) return SmbDailydlradiationEnum;
+	      else if (strcmp(name,"SmbDailydsradiation")==0) return SmbDailydsradiationEnum;
+	      else if (strcmp(name,"SmbDailypressure")==0) return SmbDailypressureEnum;
+	      else if (strcmp(name,"SmbDailyrainfall")==0) return SmbDailyrainfallEnum;
+	      else if (strcmp(name,"SmbDailysnowfall")==0) return SmbDailysnowfallEnum;
+	      else if (strcmp(name,"SmbDailytemperature")==0) return SmbDailytemperatureEnum;
+	      else if (strcmp(name,"SmbDailywindspeed")==0) return SmbDailywindspeedEnum;
 	      else if (strcmp(name,"SmbDini")==0) return SmbDiniEnum;
 	      else if (strcmp(name,"SmbDlwrf")==0) return SmbDlwrfEnum;
 	      else if (strcmp(name,"SmbDswrf")==0) return SmbDswrfEnum;
+	      else if (strcmp(name,"SmbDzAdd")==0) return SmbDzAddEnum;
 	      else if (strcmp(name,"SmbDz")==0) return SmbDzEnum;
-	      else if (strcmp(name,"SmbDzini")==0) return SmbDziniEnum;
 	      else if (strcmp(name,"SmbDzMin")==0) return SmbDzMinEnum;
 	      else if (strcmp(name,"SmbDzTop")==0) return SmbDzTopEnum;
+	      else if (strcmp(name,"SmbDzini")==0) return SmbDziniEnum;
 	      else if (strcmp(name,"SmbEAir")==0) return SmbEAirEnum;
 	      else if (strcmp(name,"SmbEC")==0) return SmbECEnum;
@@ -589,4 +721,5 @@
 	      else if (strcmp(name,"SmbEla")==0) return SmbElaEnum;
 	      else if (strcmp(name,"SmbEvaporation")==0) return SmbEvaporationEnum;
+	      else if (strcmp(name,"SmbFAC")==0) return SmbFACEnum;
 	      else if (strcmp(name,"SmbGdn")==0) return SmbGdnEnum;
 	      else if (strcmp(name,"SmbGdnini")==0) return SmbGdniniEnum;
@@ -595,11 +728,20 @@
 	      else if (strcmp(name,"SmbHref")==0) return SmbHrefEnum;
 	      else if (strcmp(name,"SmbIsInitialized")==0) return SmbIsInitializedEnum;
+	      else if (strcmp(name,"SmbMAdd")==0) return SmbMAddEnum;
+	      else if (strcmp(name,"SmbMassBalanceClimate")==0) return SmbMassBalanceClimateEnum;
 	      else if (strcmp(name,"SmbMassBalance")==0) return SmbMassBalanceEnum;
+	      else if (strcmp(name,"SmbMassBalanceSubstep")==0) return SmbMassBalanceSubstepEnum;
+	      else if (strcmp(name,"SmbMassBalanceTransient")==0) return SmbMassBalanceTransientEnum;
+	      else if (strcmp(name,"SmbMeanLHF")==0) return SmbMeanLHFEnum;
+	      else if (strcmp(name,"SmbMeanSHF")==0) return SmbMeanSHFEnum;
+	      else if (strcmp(name,"SmbMeanULW")==0) return SmbMeanULWEnum;
 	      else if (strcmp(name,"SmbMelt")==0) return SmbMeltEnum;
 	      else if (strcmp(name,"SmbMonthlytemperatures")==0) return SmbMonthlytemperaturesEnum;
+	      else if (strcmp(name,"SmbNetLW")==0) return SmbNetLWEnum;
+	      else if (strcmp(name,"SmbNetSW")==0) return SmbNetSWEnum;
 	      else if (strcmp(name,"SmbPAir")==0) return SmbPAirEnum;
+	      else if (strcmp(name,"SmbP")==0) return SmbPEnum;
 	      else if (strcmp(name,"SmbPddfacIce")==0) return SmbPddfacIceEnum;
 	      else if (strcmp(name,"SmbPddfacSnow")==0) return SmbPddfacSnowEnum;
-	      else if (strcmp(name,"SmbP")==0) return SmbPEnum;
 	      else if (strcmp(name,"SmbPrecipitation")==0) return SmbPrecipitationEnum;
 	      else if (strcmp(name,"SmbPrecipitationsAnomaly")==0) return SmbPrecipitationsAnomalyEnum;
@@ -610,27 +752,31 @@
 	      else if (strcmp(name,"SmbRefreeze")==0) return SmbRefreezeEnum;
 	      else if (strcmp(name,"SmbReini")==0) return SmbReiniEnum;
-	      else if (strcmp(name,"SmbRunoff")==0) return SmbRunoffEnum;
+         else stage=7;
+   }
+   if(stage==7){
+	      if (strcmp(name,"SmbRunoff")==0) return SmbRunoffEnum;
+	      else if (strcmp(name,"SmbRunoffSubstep")==0) return SmbRunoffSubstepEnum;
+	      else if (strcmp(name,"SmbRunoffTransient")==0) return SmbRunoffTransientEnum;
+	      else if (strcmp(name,"SmbS0gcm")==0) return SmbS0gcmEnum;
 	      else if (strcmp(name,"SmbS0p")==0) return SmbS0pEnum;
 	      else if (strcmp(name,"SmbS0t")==0) return SmbS0tEnum;
 	      else if (strcmp(name,"SmbSizeini")==0) return SmbSizeiniEnum;
+	      else if (strcmp(name,"SmbSmbCorr")==0) return SmbSmbCorrEnum;
 	      else if (strcmp(name,"SmbSmbref")==0) return SmbSmbrefEnum;
-	      else if (strcmp(name,"SmbSmbCorr")==0) return SmbSmbCorrEnum;
+	      else if (strcmp(name,"SmbT")==0) return SmbTEnum;
 	      else if (strcmp(name,"SmbTa")==0) return SmbTaEnum;
+	      else if (strcmp(name,"SmbTeValue")==0) return SmbTeValueEnum;
 	      else if (strcmp(name,"SmbTemperaturesAnomaly")==0) return SmbTemperaturesAnomalyEnum;
 	      else if (strcmp(name,"SmbTemperaturesLgm")==0) return SmbTemperaturesLgmEnum;
 	      else if (strcmp(name,"SmbTemperaturesPresentday")==0) return SmbTemperaturesPresentdayEnum;
 	      else if (strcmp(name,"SmbTemperaturesReconstructed")==0) return SmbTemperaturesReconstructedEnum;
-	      else if (strcmp(name,"SmbT")==0) return SmbTEnum;
-	      else if (strcmp(name,"SmbTeValue")==0) return SmbTeValueEnum;
 	      else if (strcmp(name,"SmbTini")==0) return SmbTiniEnum;
 	      else if (strcmp(name,"SmbTmean")==0) return SmbTmeanEnum;
 	      else if (strcmp(name,"SmbTz")==0) return SmbTzEnum;
 	      else if (strcmp(name,"SmbV")==0) return SmbVEnum;
+	      else if (strcmp(name,"SmbVmean")==0) return SmbVmeanEnum;
 	      else if (strcmp(name,"SmbVz")==0) return SmbVzEnum;
 	      else if (strcmp(name,"SmbW")==0) return SmbWEnum;
-         else stage=6;
-   }
-   if(stage==6){
-	      if (strcmp(name,"SmbWini")==0) return SmbWiniEnum;
+	      else if (strcmp(name,"SmbWini")==0) return SmbWiniEnum;
 	      else if (strcmp(name,"SmbZMax")==0) return SmbZMaxEnum;
 	      else if (strcmp(name,"SmbZMin")==0) return SmbZMinEnum;
@@ -657,4 +803,5 @@
 	      else if (strcmp(name,"SurfaceArea")==0) return SurfaceAreaEnum;
 	      else if (strcmp(name,"SurfaceAverageVelMisfit")==0) return SurfaceAverageVelMisfitEnum;
+	      else if (strcmp(name,"SurfaceCrevasse")==0) return SurfaceCrevasseEnum;
 	      else if (strcmp(name,"Surface")==0) return SurfaceEnum;
 	      else if (strcmp(name,"SurfaceLogVelMisfit")==0) return SurfaceLogVelMisfitEnum;
@@ -665,5 +812,8 @@
 	      else if (strcmp(name,"SurfaceSlopeY")==0) return SurfaceSlopeYEnum;
 	      else if (strcmp(name,"Temperature")==0) return TemperatureEnum;
+	      else if (strcmp(name,"TemperaturePDD")==0) return TemperaturePDDEnum;
 	      else if (strcmp(name,"TemperaturePicard")==0) return TemperaturePicardEnum;
+	      else if (strcmp(name,"TemperatureSEMIC")==0) return TemperatureSEMICEnum;
+	      else if (strcmp(name,"ThermalSpctemperature")==0) return ThermalSpctemperatureEnum;
 	      else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
 	      else if (strcmp(name,"ThicknessAbsMisfit")==0) return ThicknessAbsMisfitEnum;
@@ -671,5 +821,7 @@
 	      else if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum;
 	      else if (strcmp(name,"Thickness")==0) return ThicknessEnum;
+	      else if (strcmp(name,"ThicknessOld")==0) return ThicknessOldEnum;
 	      else if (strcmp(name,"ThicknessPositive")==0) return ThicknessPositiveEnum;
+	      else if (strcmp(name,"ThicknessResidual")==0) return ThicknessResidualEnum;
 	      else if (strcmp(name,"Vel")==0) return VelEnum;
 	      else if (strcmp(name,"VxAverage")==0) return VxAverageEnum;
@@ -686,6 +838,6 @@
 	      else if (strcmp(name,"VzMesh")==0) return VzMeshEnum;
 	      else if (strcmp(name,"VzSSA")==0) return VzSSAEnum;
+	      else if (strcmp(name,"WaterColumnOld")==0) return WaterColumnOldEnum;
 	      else if (strcmp(name,"Watercolumn")==0) return WatercolumnEnum;
-	      else if (strcmp(name,"WaterColumnOld")==0) return WaterColumnOldEnum;
 	      else if (strcmp(name,"WaterfractionDrainage")==0) return WaterfractionDrainageEnum;
 	      else if (strcmp(name,"WaterfractionDrainageIntegrated")==0) return WaterfractionDrainageIntegratedEnum;
@@ -693,278 +845,4 @@
 	      else if (strcmp(name,"Waterheight")==0) return WaterheightEnum;
 	      else if (strcmp(name,"WeightsSurfaceObservation")==0) return WeightsSurfaceObservationEnum;
-	      else if (strcmp(name,"InputsEND")==0) return InputsENDEnum;
-	      else if (strcmp(name,"Absolute")==0) return AbsoluteEnum;
-	      else if (strcmp(name,"AdaptiveTimestepping")==0) return AdaptiveTimesteppingEnum;
-	      else if (strcmp(name,"AdjointBalancethickness2Analysis")==0) return AdjointBalancethickness2AnalysisEnum;
-	      else if (strcmp(name,"AdjointBalancethicknessAnalysis")==0) return AdjointBalancethicknessAnalysisEnum;
-	      else if (strcmp(name,"AdjointHorizAnalysis")==0) return AdjointHorizAnalysisEnum;
-	      else if (strcmp(name,"Adjointp")==0) return AdjointpEnum;
-	      else if (strcmp(name,"AggressiveMigration")==0) return AggressiveMigrationEnum;
-	      else if (strcmp(name,"AmrBamg")==0) return AmrBamgEnum;
-	      else if (strcmp(name,"AmrNeopz")==0) return AmrNeopzEnum;
-	      else if (strcmp(name,"AndroidFrictionCoefficient")==0) return AndroidFrictionCoefficientEnum;
-	      else if (strcmp(name,"Arrhenius")==0) return ArrheniusEnum;
-	      else if (strcmp(name,"AutodiffJacobian")==0) return AutodiffJacobianEnum;
-	      else if (strcmp(name,"Balancethickness2Analysis")==0) return Balancethickness2AnalysisEnum;
-	      else if (strcmp(name,"Balancethickness2Solution")==0) return Balancethickness2SolutionEnum;
-	      else if (strcmp(name,"BalancethicknessAnalysis")==0) return BalancethicknessAnalysisEnum;
-	      else if (strcmp(name,"BalancethicknessApparentMassbalance")==0) return BalancethicknessApparentMassbalanceEnum;
-	      else if (strcmp(name,"BalancethicknessSoftAnalysis")==0) return BalancethicknessSoftAnalysisEnum;
-	      else if (strcmp(name,"BalancethicknessSoftSolution")==0) return BalancethicknessSoftSolutionEnum;
-	      else if (strcmp(name,"BalancethicknessSolution")==0) return BalancethicknessSolutionEnum;
-	      else if (strcmp(name,"BalancethicknessSpcthickness")==0) return BalancethicknessSpcthicknessEnum;
-	      else if (strcmp(name,"BalancevelocityAnalysis")==0) return BalancevelocityAnalysisEnum;
-	      else if (strcmp(name,"BalancevelocitySolution")==0) return BalancevelocitySolutionEnum;
-	      else if (strcmp(name,"BasalCrevasse")==0) return BasalCrevasseEnum;
-	      else if (strcmp(name,"BasalforcingsPico")==0) return BasalforcingsPicoEnum;
-	      else if (strcmp(name,"BedSlopeSolution")==0) return BedSlopeSolutionEnum;
-	      else if (strcmp(name,"BoolExternalResult")==0) return BoolExternalResultEnum;
-	      else if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
-	      else if (strcmp(name,"BoolParam")==0) return BoolParamEnum;
-	      else if (strcmp(name,"Boundary")==0) return BoundaryEnum;
-	      else if (strcmp(name,"BuddJacka")==0) return BuddJackaEnum;
-	      else if (strcmp(name,"CalvingDev2")==0) return CalvingDev2Enum;
-	      else if (strcmp(name,"CalvingHab")==0) return CalvingHabEnum;
-	      else if (strcmp(name,"CalvingLevermann")==0) return CalvingLevermannEnum;
-	      else if (strcmp(name,"CalvingVonmises")==0) return CalvingVonmisesEnum;
-	      else if (strcmp(name,"Cfsurfacelogvel")==0) return CfsurfacelogvelEnum;
-	      else if (strcmp(name,"Cfsurfacesquare")==0) return CfsurfacesquareEnum;
-	      else if (strcmp(name,"Cfdragcoeffabsgrad")==0) return CfdragcoeffabsgradEnum;
-	      else if (strcmp(name,"Closed")==0) return ClosedEnum;
-	      else if (strcmp(name,"Colinear")==0) return ColinearEnum;
-	      else if (strcmp(name,"ConstantsG")==0) return ConstantsGEnum;
-	      else if (strcmp(name,"ConstantsReferencetemperature")==0) return ConstantsReferencetemperatureEnum;
-	      else if (strcmp(name,"Constraints")==0) return ConstraintsEnum;
-	      else if (strcmp(name,"Contact")==0) return ContactEnum;
-	      else if (strcmp(name,"Contour")==0) return ContourEnum;
-	      else if (strcmp(name,"Contours")==0) return ContoursEnum;
-	      else if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
-	      else if (strcmp(name,"ControlInputValues")==0) return ControlInputValuesEnum;
-	      else if (strcmp(name,"ControlInputMins")==0) return ControlInputMinsEnum;
-	      else if (strcmp(name,"ControlInputMaxs")==0) return ControlInputMaxsEnum;
-	      else if (strcmp(name,"ControlInputGrad")==0) return ControlInputGradEnum;
-	      else if (strcmp(name,"CrouzeixRaviart")==0) return CrouzeixRaviartEnum;
-	      else if (strcmp(name,"Cuffey")==0) return CuffeyEnum;
-	      else if (strcmp(name,"CuffeyTemperate")==0) return CuffeyTemperateEnum;
-	      else if (strcmp(name,"DamageEvolutionAnalysis")==0) return DamageEvolutionAnalysisEnum;
-	      else if (strcmp(name,"DamageEvolutionSolution")==0) return DamageEvolutionSolutionEnum;
-	      else if (strcmp(name,"DataSet")==0) return DataSetEnum;
-	      else if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum;
-	      else if (strcmp(name,"DataSetParam")==0) return DataSetParamEnum;
-         else stage=7;
-   }
-   if(stage==7){
-	      if (strcmp(name,"DefaultAnalysis")==0) return DefaultAnalysisEnum;
-	      else if (strcmp(name,"DefaultCalving")==0) return DefaultCalvingEnum;
-	      else if (strcmp(name,"DegreeOfChannelization")==0) return DegreeOfChannelizationEnum;
-	      else if (strcmp(name,"Dense")==0) return DenseEnum;
-	      else if (strcmp(name,"DependentObject")==0) return DependentObjectEnum;
-	      else if (strcmp(name,"DepthAverageAnalysis")==0) return DepthAverageAnalysisEnum;
-	      else if (strcmp(name,"DeviatoricStresseffective")==0) return DeviatoricStresseffectiveEnum;
-	      else if (strcmp(name,"DeviatoricStressErrorEstimator")==0) return DeviatoricStressErrorEstimatorEnum;
-	      else if (strcmp(name,"Divergence")==0) return DivergenceEnum;
-	      else if (strcmp(name,"Domain3Dsurface")==0) return Domain3DsurfaceEnum;
-	      else if (strcmp(name,"DoubleArrayInput")==0) return DoubleArrayInputEnum;
-	      else if (strcmp(name,"DoubleExternalResult")==0) return DoubleExternalResultEnum;
-	      else if (strcmp(name,"DoubleInput")==0) return DoubleInputEnum;
-	      else if (strcmp(name,"DoubleMatArrayParam")==0) return DoubleMatArrayParamEnum;
-	      else if (strcmp(name,"DoubleMatExternalResult")==0) return DoubleMatExternalResultEnum;
-	      else if (strcmp(name,"DoubleMatParam")==0) return DoubleMatParamEnum;
-	      else if (strcmp(name,"DoubleParam")==0) return DoubleParamEnum;
-	      else if (strcmp(name,"DoubleVecParam")==0) return DoubleVecParamEnum;
-	      else if (strcmp(name,"EffectivePressureStacked")==0) return EffectivePressureStackedEnum;
-	      else if (strcmp(name,"EffectivePressure")==0) return EffectivePressureEnum;
-	      else if (strcmp(name,"Element")==0) return ElementEnum;
-	      else if (strcmp(name,"ElementHook")==0) return ElementHookEnum;
-	      else if (strcmp(name,"ElementSId")==0) return ElementSIdEnum;
-	      else if (strcmp(name,"EnthalpyAnalysis")==0) return EnthalpyAnalysisEnum;
-	      else if (strcmp(name,"EplHeadStacked")==0) return EplHeadStackedEnum;
-	      else if (strcmp(name,"EplHead")==0) return EplHeadEnum;
-	      else if (strcmp(name,"EsaAnalysis")==0) return EsaAnalysisEnum;
-	      else if (strcmp(name,"EsaRotationrate")==0) return EsaRotationrateEnum;
-	      else if (strcmp(name,"EsaSolution")==0) return EsaSolutionEnum;
-	      else if (strcmp(name,"EsaStrainratexx")==0) return EsaStrainratexxEnum;
-	      else if (strcmp(name,"EsaStrainratexy")==0) return EsaStrainratexyEnum;
-	      else if (strcmp(name,"EsaStrainrateyy")==0) return EsaStrainrateyyEnum;
-	      else if (strcmp(name,"EsaTransitions")==0) return EsaTransitionsEnum;
-	      else if (strcmp(name,"ExternalResult")==0) return ExternalResultEnum;
-	      else if (strcmp(name,"ExtrapolationAnalysis")==0) return ExtrapolationAnalysisEnum;
-	      else if (strcmp(name,"ExtrudeFromBaseAnalysis")==0) return ExtrudeFromBaseAnalysisEnum;
-	      else if (strcmp(name,"ExtrudeFromTopAnalysis")==0) return ExtrudeFromTopAnalysisEnum;
-	      else if (strcmp(name,"FemModel")==0) return FemModelEnum;
-	      else if (strcmp(name,"FileParam")==0) return FileParamEnum;
-	      else if (strcmp(name,"FixedTimestepping")==0) return FixedTimesteppingEnum;
-	      else if (strcmp(name,"FloatingArea")==0) return FloatingAreaEnum;
-	      else if (strcmp(name,"FloatingAreaScaled")==0) return FloatingAreaScaledEnum;
-	      else if (strcmp(name,"FloatingMeltRate")==0) return FloatingMeltRateEnum;
-	      else if (strcmp(name,"FlowequationBorderFS")==0) return FlowequationBorderFSEnum;
-	      else if (strcmp(name,"Free")==0) return FreeEnum;
-	      else if (strcmp(name,"FreeSurfaceBaseAnalysis")==0) return FreeSurfaceBaseAnalysisEnum;
-	      else if (strcmp(name,"FreeSurfaceTopAnalysis")==0) return FreeSurfaceTopAnalysisEnum;
-	      else if (strcmp(name,"FSApproximation")==0) return FSApproximationEnum;
-	      else if (strcmp(name,"Fset")==0) return FsetEnum;
-	      else if (strcmp(name,"FSpressure")==0) return FSpressureEnum;
-	      else if (strcmp(name,"FSSolver")==0) return FSSolverEnum;
-	      else if (strcmp(name,"FSvelocity")==0) return FSvelocityEnum;
-	      else if (strcmp(name,"FullMeltOnPartiallyFloating")==0) return FullMeltOnPartiallyFloatingEnum;
-	      else if (strcmp(name,"GaussPenta")==0) return GaussPentaEnum;
-	      else if (strcmp(name,"GaussSeg")==0) return GaussSegEnum;
-	      else if (strcmp(name,"GaussTetra")==0) return GaussTetraEnum;
-	      else if (strcmp(name,"GaussTria")==0) return GaussTriaEnum;
-	      else if (strcmp(name,"GenericOption")==0) return GenericOptionEnum;
-	      else if (strcmp(name,"GenericParam")==0) return GenericParamEnum;
-	      else if (strcmp(name,"GLheightadvectionAnalysis")==0) return GLheightadvectionAnalysisEnum;
-	      else if (strcmp(name,"GiaIvinsAnalysis")==0) return GiaIvinsAnalysisEnum;
-	      else if (strcmp(name,"GiaSolution")==0) return GiaSolutionEnum;
-	      else if (strcmp(name,"Gradient1")==0) return Gradient1Enum;
-	      else if (strcmp(name,"Gradient2")==0) return Gradient2Enum;
-	      else if (strcmp(name,"Gradient3")==0) return Gradient3Enum;
-	      else if (strcmp(name,"GroundedArea")==0) return GroundedAreaEnum;
-	      else if (strcmp(name,"GroundedAreaScaled")==0) return GroundedAreaScaledEnum;
-	      else if (strcmp(name,"GroundingOnly")==0) return GroundingOnlyEnum;
-	      else if (strcmp(name,"Gset")==0) return GsetEnum;
-	      else if (strcmp(name,"Gsl")==0) return GslEnum;
-	      else if (strcmp(name,"HOApproximation")==0) return HOApproximationEnum;
-	      else if (strcmp(name,"HOFSApproximation")==0) return HOFSApproximationEnum;
-	      else if (strcmp(name,"Hook")==0) return HookEnum;
-	      else if (strcmp(name,"HydrologyBasalFlux")==0) return HydrologyBasalFluxEnum;
-	      else if (strcmp(name,"HydrologyDCEfficientAnalysis")==0) return HydrologyDCEfficientAnalysisEnum;
-	      else if (strcmp(name,"Hydrologydc")==0) return HydrologydcEnum;
-	      else if (strcmp(name,"HydrologydcEplColapseThickness")==0) return HydrologydcEplColapseThicknessEnum;
-	      else if (strcmp(name,"HydrologydcEplCompressibility")==0) return HydrologydcEplCompressibilityEnum;
-	      else if (strcmp(name,"HydrologydcEplConductivity")==0) return HydrologydcEplConductivityEnum;
-	      else if (strcmp(name,"HydrologydcEplInitialThickness")==0) return HydrologydcEplInitialThicknessEnum;
-	      else if (strcmp(name,"HydrologydcEplMaxThickness")==0) return HydrologydcEplMaxThicknessEnum;
-	      else if (strcmp(name,"HydrologydcEplPorosity")==0) return HydrologydcEplPorosityEnum;
-	      else if (strcmp(name,"HydrologydcEplThicknessStacked")==0) return HydrologydcEplThicknessStackedEnum;
-	      else if (strcmp(name,"HydrologydcEplThickness")==0) return HydrologydcEplThicknessEnum;
-	      else if (strcmp(name,"HydrologyDCInefficientAnalysis")==0) return HydrologyDCInefficientAnalysisEnum;
-	      else if (strcmp(name,"HydrologydcSedimentCompressibility")==0) return HydrologydcSedimentCompressibilityEnum;
-	      else if (strcmp(name,"HydrologydcSedimentPorosity")==0) return HydrologydcSedimentPorosityEnum;
-	      else if (strcmp(name,"HydrologydcSedimentThickness")==0) return HydrologydcSedimentThicknessEnum;
-	      else if (strcmp(name,"HydrologydcWaterCompressibility")==0) return HydrologydcWaterCompressibilityEnum;
-	      else if (strcmp(name,"HydrologyShreveAnalysis")==0) return HydrologyShreveAnalysisEnum;
-	      else if (strcmp(name,"Hydrologyshreve")==0) return HydrologyshreveEnum;
-	      else if (strcmp(name,"HydrologySolution")==0) return HydrologySolutionEnum;
-	      else if (strcmp(name,"HydrologyShaktiAnalysis")==0) return HydrologyShaktiAnalysisEnum;
-	      else if (strcmp(name,"HydrologyPismAnalysis")==0) return HydrologyPismAnalysisEnum;
-	      else if (strcmp(name,"Hydrologyshakti")==0) return HydrologyshaktiEnum;
-	      else if (strcmp(name,"Hydrologypism")==0) return HydrologypismEnum;
-	      else if (strcmp(name,"IceMass")==0) return IceMassEnum;
-	      else if (strcmp(name,"IceMassScaled")==0) return IceMassScaledEnum;
-	      else if (strcmp(name,"IceVolumeAboveFloatation")==0) return IceVolumeAboveFloatationEnum;
-	      else if (strcmp(name,"IceVolumeAboveFloatationScaled")==0) return IceVolumeAboveFloatationScaledEnum;
-	      else if (strcmp(name,"IceVolume")==0) return IceVolumeEnum;
-	      else if (strcmp(name,"IceVolumeScaled")==0) return IceVolumeScaledEnum;
-	      else if (strcmp(name,"Incremental")==0) return IncrementalEnum;
-	      else if (strcmp(name,"Indexed")==0) return IndexedEnum;
-	      else if (strcmp(name,"Internal")==0) return InternalEnum;
-	      else if (strcmp(name,"Intersect")==0) return IntersectEnum;
-	      else if (strcmp(name,"IntExternalResult")==0) return IntExternalResultEnum;
-	      else if (strcmp(name,"IntInput")==0) return IntInputEnum;
-	      else if (strcmp(name,"IntMatExternalResult")==0) return IntMatExternalResultEnum;
-	      else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
-	      else if (strcmp(name,"IntParam")==0) return IntParamEnum;
-	      else if (strcmp(name,"IntVecParam")==0) return IntVecParamEnum;
-	      else if (strcmp(name,"InversionVzObs")==0) return InversionVzObsEnum;
-	      else if (strcmp(name,"J")==0) return JEnum;
-	      else if (strcmp(name,"L1L2Approximation")==0) return L1L2ApproximationEnum;
-	      else if (strcmp(name,"L2ProjectionBaseAnalysis")==0) return L2ProjectionBaseAnalysisEnum;
-	      else if (strcmp(name,"L2ProjectionEPLAnalysis")==0) return L2ProjectionEPLAnalysisEnum;
-	      else if (strcmp(name,"LACrouzeixRaviart")==0) return LACrouzeixRaviartEnum;
-	      else if (strcmp(name,"LambdaS")==0) return LambdaSEnum;
-	      else if (strcmp(name,"LATaylorHood")==0) return LATaylorHoodEnum;
-         else stage=8;
-   }
-   if(stage==8){
-	      if (strcmp(name,"LevelsetAnalysis")==0) return LevelsetAnalysisEnum;
-	      else if (strcmp(name,"LevelsetfunctionPicard")==0) return LevelsetfunctionPicardEnum;
-	      else if (strcmp(name,"LinearFloatingMeltRate")==0) return LinearFloatingMeltRateEnum;
-	      else if (strcmp(name,"SpatialLinearFloatingMeltRate")==0) return SpatialLinearFloatingMeltRateEnum;
-	      else if (strcmp(name,"LliboutryDuval")==0) return LliboutryDuvalEnum;
-	      else if (strcmp(name,"Loads")==0) return LoadsEnum;
-	      else if (strcmp(name,"LoveAnalysis")==0) return LoveAnalysisEnum;
-	      else if (strcmp(name,"LoveHi")==0) return LoveHiEnum;
-	      else if (strcmp(name,"LoveHr")==0) return LoveHrEnum;
-	      else if (strcmp(name,"LoveKernelsImag")==0) return LoveKernelsImagEnum;
-	      else if (strcmp(name,"LoveKernelsReal")==0) return LoveKernelsRealEnum;
-	      else if (strcmp(name,"LoveKi")==0) return LoveKiEnum;
-	      else if (strcmp(name,"LoveKr")==0) return LoveKrEnum;
-	      else if (strcmp(name,"LoveLi")==0) return LoveLiEnum;
-	      else if (strcmp(name,"LoveLr")==0) return LoveLrEnum;
-	      else if (strcmp(name,"LoveSolution")==0) return LoveSolutionEnum;
-	      else if (strcmp(name,"MantlePlumeGeothermalFlux")==0) return MantlePlumeGeothermalFluxEnum;
-	      else if (strcmp(name,"MaskLandLevelset")==0) return MaskLandLevelsetEnum;
-	      else if (strcmp(name,"MaskOceanLevelset")==0) return MaskOceanLevelsetEnum;
-	      else if (strcmp(name,"Massconaxpby")==0) return MassconaxpbyEnum;
-	      else if (strcmp(name,"Masscon")==0) return MassconEnum;
-	      else if (strcmp(name,"Massfluxatgate")==0) return MassfluxatgateEnum;
-	      else if (strcmp(name,"MassFlux")==0) return MassFluxEnum;
-	      else if (strcmp(name,"MasstransportAnalysis")==0) return MasstransportAnalysisEnum;
-	      else if (strcmp(name,"MasstransportSolution")==0) return MasstransportSolutionEnum;
-	      else if (strcmp(name,"Matdamageice")==0) return MatdamageiceEnum;
-	      else if (strcmp(name,"Matenhancedice")==0) return MatenhancediceEnum;
-	      else if (strcmp(name,"MaterialsBeta")==0) return MaterialsBetaEnum;
-	      else if (strcmp(name,"MaterialsEarthDensity")==0) return MaterialsEarthDensityEnum;
-	      else if (strcmp(name,"Materials")==0) return MaterialsEnum;
-	      else if (strcmp(name,"MaterialsHeatcapacity")==0) return MaterialsHeatcapacityEnum;
-	      else if (strcmp(name,"MaterialsLatentheat")==0) return MaterialsLatentheatEnum;
-	      else if (strcmp(name,"MaterialsLithosphereDensity")==0) return MaterialsLithosphereDensityEnum;
-	      else if (strcmp(name,"MaterialsLithosphereShearModulus")==0) return MaterialsLithosphereShearModulusEnum;
-	      else if (strcmp(name,"MaterialsMantleDensity")==0) return MaterialsMantleDensityEnum;
-	      else if (strcmp(name,"MaterialsMantleShearModulus")==0) return MaterialsMantleShearModulusEnum;
-	      else if (strcmp(name,"MaterialsMeltingpoint")==0) return MaterialsMeltingpointEnum;
-	      else if (strcmp(name,"MaterialsMixedLayerCapacity")==0) return MaterialsMixedLayerCapacityEnum;
-	      else if (strcmp(name,"MaterialsMuWater")==0) return MaterialsMuWaterEnum;
-	      else if (strcmp(name,"MaterialsRheologyLaw")==0) return MaterialsRheologyLawEnum;
-	      else if (strcmp(name,"MaterialsRhoFreshwater")==0) return MaterialsRhoFreshwaterEnum;
-	      else if (strcmp(name,"MaterialsRhoSeawater")==0) return MaterialsRhoSeawaterEnum;
-	      else if (strcmp(name,"MaterialsTemperateiceconductivity")==0) return MaterialsTemperateiceconductivityEnum;
-	      else if (strcmp(name,"MaterialsThermalconductivity")==0) return MaterialsThermalconductivityEnum;
-	      else if (strcmp(name,"MaterialsThermalExchangeVelocity")==0) return MaterialsThermalExchangeVelocityEnum;
-	      else if (strcmp(name,"Matestar")==0) return MatestarEnum;
-	      else if (strcmp(name,"Matice")==0) return MaticeEnum;
-	      else if (strcmp(name,"Matlitho")==0) return MatlithoEnum;
-	      else if (strcmp(name,"Matpar")==0) return MatparEnum;
-	      else if (strcmp(name,"MatrixParam")==0) return MatrixParamEnum;
-	      else if (strcmp(name,"MaxAbsVx")==0) return MaxAbsVxEnum;
-	      else if (strcmp(name,"MaxAbsVy")==0) return MaxAbsVyEnum;
-	      else if (strcmp(name,"MaxAbsVz")==0) return MaxAbsVzEnum;
-	      else if (strcmp(name,"MaxDivergence")==0) return MaxDivergenceEnum;
-	      else if (strcmp(name,"MaxVel")==0) return MaxVelEnum;
-	      else if (strcmp(name,"MaxVx")==0) return MaxVxEnum;
-	      else if (strcmp(name,"MaxVy")==0) return MaxVyEnum;
-	      else if (strcmp(name,"MaxVz")==0) return MaxVzEnum;
-	      else if (strcmp(name,"Melange")==0) return MelangeEnum;
-	      else if (strcmp(name,"MeltingAnalysis")==0) return MeltingAnalysisEnum;
-	      else if (strcmp(name,"MeshElements")==0) return MeshElementsEnum;
-	      else if (strcmp(name,"MeshX")==0) return MeshXEnum;
-	      else if (strcmp(name,"MeshY")==0) return MeshYEnum;
-	      else if (strcmp(name,"MINIcondensed")==0) return MINIcondensedEnum;
-	      else if (strcmp(name,"MINI")==0) return MINIEnum;
-	      else if (strcmp(name,"MinVel")==0) return MinVelEnum;
-	      else if (strcmp(name,"MinVx")==0) return MinVxEnum;
-	      else if (strcmp(name,"MinVy")==0) return MinVyEnum;
-	      else if (strcmp(name,"MinVz")==0) return MinVzEnum;
-	      else if (strcmp(name,"MismipFloatingMeltRate")==0) return MismipFloatingMeltRateEnum;
-	      else if (strcmp(name,"Moulin")==0) return MoulinEnum;
-	      else if (strcmp(name,"MpiDense")==0) return MpiDenseEnum;
-	      else if (strcmp(name,"Mpi")==0) return MpiEnum;
-	      else if (strcmp(name,"MpiSparse")==0) return MpiSparseEnum;
-	      else if (strcmp(name,"Mumps")==0) return MumpsEnum;
-	      else if (strcmp(name,"NewDamage")==0) return NewDamageEnum;
-	      else if (strcmp(name,"Nodal")==0) return NodalEnum;
-	      else if (strcmp(name,"Nodalvalue")==0) return NodalvalueEnum;
-	      else if (strcmp(name,"NodeSId")==0) return NodeSIdEnum;
-	      else if (strcmp(name,"NoFrictionOnPartiallyFloating")==0) return NoFrictionOnPartiallyFloatingEnum;
-	      else if (strcmp(name,"NoMeltOnPartiallyFloating")==0) return NoMeltOnPartiallyFloatingEnum;
-	      else if (strcmp(name,"NoneApproximation")==0) return NoneApproximationEnum;
-	      else if (strcmp(name,"None")==0) return NoneEnum;
-	      else if (strcmp(name,"Numberedcostfunction")==0) return NumberedcostfunctionEnum;
-	      else if (strcmp(name,"Numericalflux")==0) return NumericalfluxEnum;
-	      else if (strcmp(name,"OldGradient")==0) return OldGradientEnum;
-	      else if (strcmp(name,"OneLayerP4z")==0) return OneLayerP4zEnum;
-	      else if (strcmp(name,"Open")==0) return OpenEnum;
-	      else if (strcmp(name,"Option")==0) return OptionEnum;
 	      else if (strcmp(name,"Outputdefinition1")==0) return Outputdefinition1Enum;
 	      else if (strcmp(name,"Outputdefinition10")==0) return Outputdefinition10Enum;
@@ -997,9 +875,9 @@
 	      else if (strcmp(name,"Outputdefinition36")==0) return Outputdefinition36Enum;
 	      else if (strcmp(name,"Outputdefinition37")==0) return Outputdefinition37Enum;
-	      else if (strcmp(name,"Outputdefinition38")==0) return Outputdefinition38Enum;
-         else stage=9;
+         else stage=8;
    }
-   if(stage==9){
-	      if (strcmp(name,"Outputdefinition39")==0) return Outputdefinition39Enum;
+   if(stage==8){
+	      if (strcmp(name,"Outputdefinition38")==0) return Outputdefinition38Enum;
+	      else if (strcmp(name,"Outputdefinition39")==0) return Outputdefinition39Enum;
 	      else if (strcmp(name,"Outputdefinition3")==0) return Outputdefinition3Enum;
 	      else if (strcmp(name,"Outputdefinition40")==0) return Outputdefinition40Enum;
@@ -1070,16 +948,255 @@
 	      else if (strcmp(name,"Outputdefinition9")==0) return Outputdefinition9Enum;
 	      else if (strcmp(name,"Outputdefinition100")==0) return Outputdefinition100Enum;
+	      else if (strcmp(name,"InputsEND")==0) return InputsENDEnum;
+	      else if (strcmp(name,"Absolute")==0) return AbsoluteEnum;
+	      else if (strcmp(name,"AdaptiveTimestepping")==0) return AdaptiveTimesteppingEnum;
+	      else if (strcmp(name,"AdjointBalancethickness2Analysis")==0) return AdjointBalancethickness2AnalysisEnum;
+	      else if (strcmp(name,"AdjointBalancethicknessAnalysis")==0) return AdjointBalancethicknessAnalysisEnum;
+	      else if (strcmp(name,"AdjointHorizAnalysis")==0) return AdjointHorizAnalysisEnum;
+	      else if (strcmp(name,"AggressiveMigration")==0) return AggressiveMigrationEnum;
+	      else if (strcmp(name,"AmrBamg")==0) return AmrBamgEnum;
+	      else if (strcmp(name,"AmrNeopz")==0) return AmrNeopzEnum;
+	      else if (strcmp(name,"AndroidFrictionCoefficient")==0) return AndroidFrictionCoefficientEnum;
+	      else if (strcmp(name,"Arrhenius")==0) return ArrheniusEnum;
+	      else if (strcmp(name,"AutodiffJacobian")==0) return AutodiffJacobianEnum;
+	      else if (strcmp(name,"Balancethickness2Analysis")==0) return Balancethickness2AnalysisEnum;
+	      else if (strcmp(name,"Balancethickness2Solution")==0) return Balancethickness2SolutionEnum;
+	      else if (strcmp(name,"BalancethicknessAnalysis")==0) return BalancethicknessAnalysisEnum;
+	      else if (strcmp(name,"BalancethicknessApparentMassbalance")==0) return BalancethicknessApparentMassbalanceEnum;
+	      else if (strcmp(name,"BalancethicknessSoftAnalysis")==0) return BalancethicknessSoftAnalysisEnum;
+	      else if (strcmp(name,"BalancethicknessSoftSolution")==0) return BalancethicknessSoftSolutionEnum;
+	      else if (strcmp(name,"BalancethicknessSolution")==0) return BalancethicknessSolutionEnum;
+	      else if (strcmp(name,"BalancethicknessSpcthickness")==0) return BalancethicknessSpcthicknessEnum;
+	      else if (strcmp(name,"BalancevelocityAnalysis")==0) return BalancevelocityAnalysisEnum;
+	      else if (strcmp(name,"BalancevelocitySolution")==0) return BalancevelocitySolutionEnum;
+	      else if (strcmp(name,"BasalforcingsIsmip6")==0) return BasalforcingsIsmip6Enum;
+	      else if (strcmp(name,"BasalforcingsPico")==0) return BasalforcingsPicoEnum;
+	      else if (strcmp(name,"BeckmannGoosseFloatingMeltRate")==0) return BeckmannGoosseFloatingMeltRateEnum;
+	      else if (strcmp(name,"BedSlopeSolution")==0) return BedSlopeSolutionEnum;
+	      else if (strcmp(name,"BoolExternalResult")==0) return BoolExternalResultEnum;
+	      else if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
+	      else if (strcmp(name,"BoolParam")==0) return BoolParamEnum;
+	      else if (strcmp(name,"Boundary")==0) return BoundaryEnum;
+	      else if (strcmp(name,"BuddJacka")==0) return BuddJackaEnum;
+	      else if (strcmp(name,"CalvingDev2")==0) return CalvingDev2Enum;
+	      else if (strcmp(name,"CalvingHab")==0) return CalvingHabEnum;
+	      else if (strcmp(name,"CalvingLevermann")==0) return CalvingLevermannEnum;
+	      else if (strcmp(name,"CalvingVonmises")==0) return CalvingVonmisesEnum;
+	      else if (strcmp(name,"Cfdragcoeffabsgrad")==0) return CfdragcoeffabsgradEnum;
+	      else if (strcmp(name,"Cfsurfacelogvel")==0) return CfsurfacelogvelEnum;
+	      else if (strcmp(name,"Cfsurfacesquare")==0) return CfsurfacesquareEnum;
+	      else if (strcmp(name,"Channel")==0) return ChannelEnum;
+	      else if (strcmp(name,"ChannelArea")==0) return ChannelAreaEnum;
+	      else if (strcmp(name,"ChannelAreaOld")==0) return ChannelAreaOldEnum;
+	      else if (strcmp(name,"Closed")==0) return ClosedEnum;
+	      else if (strcmp(name,"Colinear")==0) return ColinearEnum;
+	      else if (strcmp(name,"Constraints")==0) return ConstraintsEnum;
+	      else if (strcmp(name,"Contact")==0) return ContactEnum;
+	      else if (strcmp(name,"Contour")==0) return ContourEnum;
+	      else if (strcmp(name,"Contours")==0) return ContoursEnum;
+	      else if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
+	      else if (strcmp(name,"ControlInputGrad")==0) return ControlInputGradEnum;
+	      else if (strcmp(name,"ControlInputMaxs")==0) return ControlInputMaxsEnum;
+         else stage=9;
+   }
+   if(stage==9){
+	      if (strcmp(name,"ControlInputMins")==0) return ControlInputMinsEnum;
+	      else if (strcmp(name,"ControlInputValues")==0) return ControlInputValuesEnum;
+	      else if (strcmp(name,"CrouzeixRaviart")==0) return CrouzeixRaviartEnum;
+	      else if (strcmp(name,"Cuffey")==0) return CuffeyEnum;
+	      else if (strcmp(name,"CuffeyTemperate")==0) return CuffeyTemperateEnum;
+	      else if (strcmp(name,"DamageEvolutionAnalysis")==0) return DamageEvolutionAnalysisEnum;
+	      else if (strcmp(name,"DamageEvolutionSolution")==0) return DamageEvolutionSolutionEnum;
+	      else if (strcmp(name,"DataSet")==0) return DataSetEnum;
+	      else if (strcmp(name,"DataSetParam")==0) return DataSetParamEnum;
+	      else if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum;
+	      else if (strcmp(name,"DefaultAnalysis")==0) return DefaultAnalysisEnum;
+	      else if (strcmp(name,"DefaultCalving")==0) return DefaultCalvingEnum;
+	      else if (strcmp(name,"Dense")==0) return DenseEnum;
+	      else if (strcmp(name,"DependentObject")==0) return DependentObjectEnum;
+	      else if (strcmp(name,"DepthAverageAnalysis")==0) return DepthAverageAnalysisEnum;
+	      else if (strcmp(name,"DeviatoricStressErrorEstimator")==0) return DeviatoricStressErrorEstimatorEnum;
+	      else if (strcmp(name,"Divergence")==0) return DivergenceEnum;
+	      else if (strcmp(name,"Domain3Dsurface")==0) return Domain3DsurfaceEnum;
+	      else if (strcmp(name,"DoubleArrayInput")==0) return DoubleArrayInputEnum;
+	      else if (strcmp(name,"DoubleExternalResult")==0) return DoubleExternalResultEnum;
+	      else if (strcmp(name,"DoubleInput")==0) return DoubleInputEnum;
+	      else if (strcmp(name,"DoubleMatArrayParam")==0) return DoubleMatArrayParamEnum;
+	      else if (strcmp(name,"DoubleMatExternalResult")==0) return DoubleMatExternalResultEnum;
+	      else if (strcmp(name,"DoubleMatParam")==0) return DoubleMatParamEnum;
+	      else if (strcmp(name,"DoubleParam")==0) return DoubleParamEnum;
+	      else if (strcmp(name,"DoubleVecParam")==0) return DoubleVecParamEnum;
+	      else if (strcmp(name,"Element")==0) return ElementEnum;
+	      else if (strcmp(name,"ElementHook")==0) return ElementHookEnum;
+	      else if (strcmp(name,"ElementSId")==0) return ElementSIdEnum;
+	      else if (strcmp(name,"EnthalpyAnalysis")==0) return EnthalpyAnalysisEnum;
+	      else if (strcmp(name,"EsaAnalysis")==0) return EsaAnalysisEnum;
+	      else if (strcmp(name,"EsaSolution")==0) return EsaSolutionEnum;
+	      else if (strcmp(name,"EsaTransitions")==0) return EsaTransitionsEnum;
+	      else if (strcmp(name,"ExternalResult")==0) return ExternalResultEnum;
+	      else if (strcmp(name,"ExtrapolationAnalysis")==0) return ExtrapolationAnalysisEnum;
+	      else if (strcmp(name,"ExtrudeFromBaseAnalysis")==0) return ExtrudeFromBaseAnalysisEnum;
+	      else if (strcmp(name,"ExtrudeFromTopAnalysis")==0) return ExtrudeFromTopAnalysisEnum;
+	      else if (strcmp(name,"FSApproximation")==0) return FSApproximationEnum;
+	      else if (strcmp(name,"FSSolver")==0) return FSSolverEnum;
+	      else if (strcmp(name,"FSpressure")==0) return FSpressureEnum;
+	      else if (strcmp(name,"FSvelocity")==0) return FSvelocityEnum;
+	      else if (strcmp(name,"FemModel")==0) return FemModelEnum;
+	      else if (strcmp(name,"FileParam")==0) return FileParamEnum;
+	      else if (strcmp(name,"FixedTimestepping")==0) return FixedTimesteppingEnum;
+	      else if (strcmp(name,"FloatingArea")==0) return FloatingAreaEnum;
+	      else if (strcmp(name,"FloatingAreaScaled")==0) return FloatingAreaScaledEnum;
+	      else if (strcmp(name,"FloatingMeltRate")==0) return FloatingMeltRateEnum;
+	      else if (strcmp(name,"Free")==0) return FreeEnum;
+	      else if (strcmp(name,"FreeSurfaceBaseAnalysis")==0) return FreeSurfaceBaseAnalysisEnum;
+	      else if (strcmp(name,"FreeSurfaceTopAnalysis")==0) return FreeSurfaceTopAnalysisEnum;
+	      else if (strcmp(name,"FrontalForcingsDefault")==0) return FrontalForcingsDefaultEnum;
+	      else if (strcmp(name,"FrontalForcingsRignot")==0) return FrontalForcingsRignotEnum;
+	      else if (strcmp(name,"Fset")==0) return FsetEnum;
+	      else if (strcmp(name,"FullMeltOnPartiallyFloating")==0) return FullMeltOnPartiallyFloatingEnum;
+	      else if (strcmp(name,"GLheightadvectionAnalysis")==0) return GLheightadvectionAnalysisEnum;
+	      else if (strcmp(name,"GaussPenta")==0) return GaussPentaEnum;
+	      else if (strcmp(name,"GaussSeg")==0) return GaussSegEnum;
+	      else if (strcmp(name,"GaussTetra")==0) return GaussTetraEnum;
+	      else if (strcmp(name,"GaussTria")==0) return GaussTriaEnum;
+	      else if (strcmp(name,"GenericOption")==0) return GenericOptionEnum;
+	      else if (strcmp(name,"GenericParam")==0) return GenericParamEnum;
+	      else if (strcmp(name,"GiaIvinsAnalysis")==0) return GiaIvinsAnalysisEnum;
+	      else if (strcmp(name,"GiaSolution")==0) return GiaSolutionEnum;
+	      else if (strcmp(name,"Gradient1")==0) return Gradient1Enum;
+	      else if (strcmp(name,"Gradient2")==0) return Gradient2Enum;
+	      else if (strcmp(name,"Gradient3")==0) return Gradient3Enum;
+	      else if (strcmp(name,"GroundedArea")==0) return GroundedAreaEnum;
+	      else if (strcmp(name,"GroundedAreaScaled")==0) return GroundedAreaScaledEnum;
+	      else if (strcmp(name,"GroundingOnly")==0) return GroundingOnlyEnum;
+	      else if (strcmp(name,"GroundinglineMassFlux")==0) return GroundinglineMassFluxEnum;
+	      else if (strcmp(name,"Gset")==0) return GsetEnum;
+	      else if (strcmp(name,"Gsl")==0) return GslEnum;
+	      else if (strcmp(name,"HOApproximation")==0) return HOApproximationEnum;
+	      else if (strcmp(name,"HOFSApproximation")==0) return HOFSApproximationEnum;
+	      else if (strcmp(name,"Hook")==0) return HookEnum;
+	      else if (strcmp(name,"HydrologyDCEfficientAnalysis")==0) return HydrologyDCEfficientAnalysisEnum;
+	      else if (strcmp(name,"HydrologyDCInefficientAnalysis")==0) return HydrologyDCInefficientAnalysisEnum;
+	      else if (strcmp(name,"HydrologyGlaDSAnalysis")==0) return HydrologyGlaDSAnalysisEnum;
+	      else if (strcmp(name,"HydrologyGlaDS")==0) return HydrologyGlaDSEnum;
+	      else if (strcmp(name,"HydrologyPismAnalysis")==0) return HydrologyPismAnalysisEnum;
+	      else if (strcmp(name,"HydrologyShaktiAnalysis")==0) return HydrologyShaktiAnalysisEnum;
+	      else if (strcmp(name,"HydrologyShreveAnalysis")==0) return HydrologyShreveAnalysisEnum;
+	      else if (strcmp(name,"HydrologySolution")==0) return HydrologySolutionEnum;
+	      else if (strcmp(name,"Hydrologydc")==0) return HydrologydcEnum;
+	      else if (strcmp(name,"Hydrologypism")==0) return HydrologypismEnum;
+	      else if (strcmp(name,"Hydrologyshakti")==0) return HydrologyshaktiEnum;
+	      else if (strcmp(name,"Hydrologyshreve")==0) return HydrologyshreveEnum;
+	      else if (strcmp(name,"IceMass")==0) return IceMassEnum;
+	      else if (strcmp(name,"IceMassScaled")==0) return IceMassScaledEnum;
+	      else if (strcmp(name,"IceVolumeAboveFloatation")==0) return IceVolumeAboveFloatationEnum;
+	      else if (strcmp(name,"IceVolumeAboveFloatationScaled")==0) return IceVolumeAboveFloatationScaledEnum;
+	      else if (strcmp(name,"IceVolume")==0) return IceVolumeEnum;
+	      else if (strcmp(name,"IceVolumeScaled")==0) return IceVolumeScaledEnum;
+	      else if (strcmp(name,"IcefrontMassFlux")==0) return IcefrontMassFluxEnum;
+	      else if (strcmp(name,"IcefrontMassFluxLevelset")==0) return IcefrontMassFluxLevelsetEnum;
+	      else if (strcmp(name,"Incremental")==0) return IncrementalEnum;
+	      else if (strcmp(name,"Indexed")==0) return IndexedEnum;
+	      else if (strcmp(name,"IntExternalResult")==0) return IntExternalResultEnum;
+	      else if (strcmp(name,"IntInput")==0) return IntInputEnum;
+	      else if (strcmp(name,"IntMatExternalResult")==0) return IntMatExternalResultEnum;
+	      else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
+	      else if (strcmp(name,"IntParam")==0) return IntParamEnum;
+	      else if (strcmp(name,"IntVecParam")==0) return IntVecParamEnum;
+	      else if (strcmp(name,"Internal")==0) return InternalEnum;
+	      else if (strcmp(name,"Intersect")==0) return IntersectEnum;
+	      else if (strcmp(name,"InversionVzObs")==0) return InversionVzObsEnum;
+	      else if (strcmp(name,"J")==0) return JEnum;
+	      else if (strcmp(name,"L1L2Approximation")==0) return L1L2ApproximationEnum;
+	      else if (strcmp(name,"L2ProjectionBaseAnalysis")==0) return L2ProjectionBaseAnalysisEnum;
+	      else if (strcmp(name,"L2ProjectionEPLAnalysis")==0) return L2ProjectionEPLAnalysisEnum;
+	      else if (strcmp(name,"LACrouzeixRaviart")==0) return LACrouzeixRaviartEnum;
+	      else if (strcmp(name,"LATaylorHood")==0) return LATaylorHoodEnum;
+	      else if (strcmp(name,"LambdaS")==0) return LambdaSEnum;
+	      else if (strcmp(name,"LevelsetAnalysis")==0) return LevelsetAnalysisEnum;
+	      else if (strcmp(name,"LevelsetfunctionPicard")==0) return LevelsetfunctionPicardEnum;
+	      else if (strcmp(name,"LinearFloatingMeltRate")==0) return LinearFloatingMeltRateEnum;
+	      else if (strcmp(name,"LliboutryDuval")==0) return LliboutryDuvalEnum;
+	      else if (strcmp(name,"Loads")==0) return LoadsEnum;
+	      else if (strcmp(name,"LoveAnalysis")==0) return LoveAnalysisEnum;
+	      else if (strcmp(name,"LoveHi")==0) return LoveHiEnum;
+         else stage=10;
+   }
+   if(stage==10){
+	      if (strcmp(name,"LoveHr")==0) return LoveHrEnum;
+	      else if (strcmp(name,"LoveKernelsImag")==0) return LoveKernelsImagEnum;
+	      else if (strcmp(name,"LoveKernelsReal")==0) return LoveKernelsRealEnum;
+	      else if (strcmp(name,"LoveKi")==0) return LoveKiEnum;
+	      else if (strcmp(name,"LoveKr")==0) return LoveKrEnum;
+	      else if (strcmp(name,"LoveLi")==0) return LoveLiEnum;
+	      else if (strcmp(name,"LoveLr")==0) return LoveLrEnum;
+	      else if (strcmp(name,"LoveSolution")==0) return LoveSolutionEnum;
+	      else if (strcmp(name,"MINI")==0) return MINIEnum;
+	      else if (strcmp(name,"MINIcondensed")==0) return MINIcondensedEnum;
+	      else if (strcmp(name,"MantlePlumeGeothermalFlux")==0) return MantlePlumeGeothermalFluxEnum;
+	      else if (strcmp(name,"MassFlux")==0) return MassFluxEnum;
+	      else if (strcmp(name,"Masscon")==0) return MassconEnum;
+	      else if (strcmp(name,"Massconaxpby")==0) return MassconaxpbyEnum;
+	      else if (strcmp(name,"Massfluxatgate")==0) return MassfluxatgateEnum;
+	      else if (strcmp(name,"MasstransportAnalysis")==0) return MasstransportAnalysisEnum;
+	      else if (strcmp(name,"MasstransportSolution")==0) return MasstransportSolutionEnum;
+	      else if (strcmp(name,"Matdamageice")==0) return MatdamageiceEnum;
+	      else if (strcmp(name,"Matenhancedice")==0) return MatenhancediceEnum;
+	      else if (strcmp(name,"Materials")==0) return MaterialsEnum;
+	      else if (strcmp(name,"Matestar")==0) return MatestarEnum;
+	      else if (strcmp(name,"Matice")==0) return MaticeEnum;
+	      else if (strcmp(name,"Matlitho")==0) return MatlithoEnum;
+	      else if (strcmp(name,"MatrixParam")==0) return MatrixParamEnum;
+	      else if (strcmp(name,"MaxAbsVx")==0) return MaxAbsVxEnum;
+	      else if (strcmp(name,"MaxAbsVy")==0) return MaxAbsVyEnum;
+	      else if (strcmp(name,"MaxAbsVz")==0) return MaxAbsVzEnum;
+	      else if (strcmp(name,"MaxDivergence")==0) return MaxDivergenceEnum;
+	      else if (strcmp(name,"MaxVel")==0) return MaxVelEnum;
+	      else if (strcmp(name,"MaxVx")==0) return MaxVxEnum;
+	      else if (strcmp(name,"MaxVy")==0) return MaxVyEnum;
+	      else if (strcmp(name,"MaxVz")==0) return MaxVzEnum;
+	      else if (strcmp(name,"Melange")==0) return MelangeEnum;
+	      else if (strcmp(name,"MeltingAnalysis")==0) return MeltingAnalysisEnum;
+	      else if (strcmp(name,"MeshElements")==0) return MeshElementsEnum;
+	      else if (strcmp(name,"MeshX")==0) return MeshXEnum;
+	      else if (strcmp(name,"MeshY")==0) return MeshYEnum;
+	      else if (strcmp(name,"MinVel")==0) return MinVelEnum;
+	      else if (strcmp(name,"MinVx")==0) return MinVxEnum;
+	      else if (strcmp(name,"MinVy")==0) return MinVyEnum;
+	      else if (strcmp(name,"MinVz")==0) return MinVzEnum;
+	      else if (strcmp(name,"MismipFloatingMeltRate")==0) return MismipFloatingMeltRateEnum;
+	      else if (strcmp(name,"Moulin")==0) return MoulinEnum;
+	      else if (strcmp(name,"MpiDense")==0) return MpiDenseEnum;
+	      else if (strcmp(name,"Mpi")==0) return MpiEnum;
+	      else if (strcmp(name,"MpiSparse")==0) return MpiSparseEnum;
+	      else if (strcmp(name,"Mumps")==0) return MumpsEnum;
+	      else if (strcmp(name,"NoFrictionOnPartiallyFloating")==0) return NoFrictionOnPartiallyFloatingEnum;
+	      else if (strcmp(name,"NoMeltOnPartiallyFloating")==0) return NoMeltOnPartiallyFloatingEnum;
+	      else if (strcmp(name,"Nodal")==0) return NodalEnum;
+	      else if (strcmp(name,"Nodalvalue")==0) return NodalvalueEnum;
+	      else if (strcmp(name,"NodeSId")==0) return NodeSIdEnum;
+	      else if (strcmp(name,"NoneApproximation")==0) return NoneApproximationEnum;
+	      else if (strcmp(name,"None")==0) return NoneEnum;
+	      else if (strcmp(name,"Numberedcostfunction")==0) return NumberedcostfunctionEnum;
+	      else if (strcmp(name,"NyeCO2")==0) return NyeCO2Enum;
+	      else if (strcmp(name,"NyeH2O")==0) return NyeH2OEnum;
+	      else if (strcmp(name,"Numericalflux")==0) return NumericalfluxEnum;
+	      else if (strcmp(name,"OldGradient")==0) return OldGradientEnum;
+	      else if (strcmp(name,"OneLayerP4z")==0) return OneLayerP4zEnum;
+	      else if (strcmp(name,"Open")==0) return OpenEnum;
+	      else if (strcmp(name,"Option")==0) return OptionEnum;
 	      else if (strcmp(name,"P0Array")==0) return P0ArrayEnum;
-	      else if (strcmp(name,"P1bubblecondensed")==0) return P1bubblecondensedEnum;
-	      else if (strcmp(name,"P1bubble")==0) return P1bubbleEnum;
+	      else if (strcmp(name,"P0DG")==0) return P0DGEnum;
 	      else if (strcmp(name,"P1DG")==0) return P1DGEnum;
 	      else if (strcmp(name,"P1P1")==0) return P1P1Enum;
 	      else if (strcmp(name,"P1P1GLS")==0) return P1P1GLSEnum;
+	      else if (strcmp(name,"P1bubble")==0) return P1bubbleEnum;
+	      else if (strcmp(name,"P1bubblecondensed")==0) return P1bubblecondensedEnum;
 	      else if (strcmp(name,"P1xP2")==0) return P1xP2Enum;
 	      else if (strcmp(name,"P1xP3")==0) return P1xP3Enum;
 	      else if (strcmp(name,"P1xP4")==0) return P1xP4Enum;
+	      else if (strcmp(name,"P2")==0) return P2Enum;
+	      else if (strcmp(name,"P2bubble")==0) return P2bubbleEnum;
 	      else if (strcmp(name,"P2bubblecondensed")==0) return P2bubblecondensedEnum;
-	      else if (strcmp(name,"P2bubble")==0) return P2bubbleEnum;
-	      else if (strcmp(name,"P2")==0) return P2Enum;
 	      else if (strcmp(name,"P2xP1")==0) return P2xP1Enum;
 	      else if (strcmp(name,"P2xP4")==0) return P2xP4Enum;
@@ -1095,6 +1212,23 @@
 	      else if (strcmp(name,"Regionaloutput")==0) return RegionaloutputEnum;
 	      else if (strcmp(name,"Regular")==0) return RegularEnum;
-	      else if (strcmp(name,"ResetPenalties")==0) return ResetPenaltiesEnum;
+	      else if (strcmp(name,"RecoveryAnalysis")==0) return RecoveryAnalysisEnum;
 	      else if (strcmp(name,"Riftfront")==0) return RiftfrontEnum;
+	      else if (strcmp(name,"SIAApproximation")==0) return SIAApproximationEnum;
+	      else if (strcmp(name,"SMBcomponents")==0) return SMBcomponentsEnum;
+	      else if (strcmp(name,"SMBd18opdd")==0) return SMBd18opddEnum;
+	      else if (strcmp(name,"SMBforcing")==0) return SMBforcingEnum;
+	      else if (strcmp(name,"SMBgcm")==0) return SMBgcmEnum;
+	      else if (strcmp(name,"SMBgemb")==0) return SMBgembEnum;
+	      else if (strcmp(name,"SMBgradients")==0) return SMBgradientsEnum;
+	      else if (strcmp(name,"SMBgradientscomponents")==0) return SMBgradientscomponentsEnum;
+	      else if (strcmp(name,"SMBgradientsela")==0) return SMBgradientselaEnum;
+	      else if (strcmp(name,"SMBhenning")==0) return SMBhenningEnum;
+	      else if (strcmp(name,"SMBmeltcomponents")==0) return SMBmeltcomponentsEnum;
+	      else if (strcmp(name,"SMBpdd")==0) return SMBpddEnum;
+	      else if (strcmp(name,"SMBpddSicopolis")==0) return SMBpddSicopolisEnum;
+	      else if (strcmp(name,"SMBsemic")==0) return SMBsemicEnum;
+	      else if (strcmp(name,"SSAApproximation")==0) return SSAApproximationEnum;
+	      else if (strcmp(name,"SSAFSApproximation")==0) return SSAFSApproximationEnum;
+	      else if (strcmp(name,"SSAHOApproximation")==0) return SSAHOApproximationEnum;
 	      else if (strcmp(name,"Scaled")==0) return ScaledEnum;
 	      else if (strcmp(name,"SealevelAbsolute")==0) return SealevelAbsoluteEnum;
@@ -1104,52 +1238,27 @@
 	      else if (strcmp(name,"SealevelInertiaTensorZZ")==0) return SealevelInertiaTensorZZEnum;
 	      else if (strcmp(name,"SealevelNmotion")==0) return SealevelNmotionEnum;
+	      else if (strcmp(name,"SealevelUmotion")==0) return SealevelUmotionEnum;
 	      else if (strcmp(name,"SealevelriseAnalysis")==0) return SealevelriseAnalysisEnum;
 	      else if (strcmp(name,"SealevelriseSolution")==0) return SealevelriseSolutionEnum;
-	      else if (strcmp(name,"SealevelriseStericRate")==0) return SealevelriseStericRateEnum;
-	      else if (strcmp(name,"SealevelUmotion")==0) return SealevelUmotionEnum;
-	      else if (strcmp(name,"SedimentHeadStacked")==0) return SedimentHeadStackedEnum;
-	      else if (strcmp(name,"SedimentHead")==0) return SedimentHeadEnum;
 	      else if (strcmp(name,"Seg")==0) return SegEnum;
 	      else if (strcmp(name,"SegInput")==0) return SegInputEnum;
 	      else if (strcmp(name,"Segment")==0) return SegmentEnum;
-	      else if (strcmp(name,"SegmentRiftfront")==0) return SegmentRiftfrontEnum;
+         else stage=11;
+   }
+   if(stage==11){
+	      if (strcmp(name,"SegmentRiftfront")==0) return SegmentRiftfrontEnum;
 	      else if (strcmp(name,"Separate")==0) return SeparateEnum;
 	      else if (strcmp(name,"Seq")==0) return SeqEnum;
-	      else if (strcmp(name,"SIAApproximation")==0) return SIAApproximationEnum;
-	      else if (strcmp(name,"SigmaVM")==0) return SigmaVMEnum;
 	      else if (strcmp(name,"SmbAnalysis")==0) return SmbAnalysisEnum;
-	      else if (strcmp(name,"SMBcomponents")==0) return SMBcomponentsEnum;
-	      else if (strcmp(name,"SMBd18opdd")==0) return SMBd18opddEnum;
-         else stage=10;
-   }
-   if(stage==10){
-	      if (strcmp(name,"SmbDesfac")==0) return SmbDesfacEnum;
-	      else if (strcmp(name,"SmbDpermil")==0) return SmbDpermilEnum;
-	      else if (strcmp(name,"SmbDzAdd")==0) return SmbDzAddEnum;
-	      else if (strcmp(name,"SmbFAC")==0) return SmbFACEnum;
-	      else if (strcmp(name,"SMBforcing")==0) return SMBforcingEnum;
-	      else if (strcmp(name,"SMBgcm")==0) return SMBgcmEnum;
-	      else if (strcmp(name,"SMBgemb")==0) return SMBgembEnum;
-	      else if (strcmp(name,"SMBgradientsela")==0) return SMBgradientselaEnum;
-	      else if (strcmp(name,"SMBgradients")==0) return SMBgradientsEnum;
-	      else if (strcmp(name,"SMBhenning")==0) return SMBhenningEnum;
-	      else if (strcmp(name,"SmbMAdd")==0) return SmbMAddEnum;
-	      else if (strcmp(name,"SMBmeltcomponents")==0) return SMBmeltcomponentsEnum;
-	      else if (strcmp(name,"SMBpdd")==0) return SMBpddEnum;
-	      else if (strcmp(name,"SMBpddSicopolis")==0) return SMBpddSicopolisEnum;
-	      else if (strcmp(name,"SMBgradientscomponents")==0) return SMBgradientscomponentsEnum;
-	      else if (strcmp(name,"SmbRlaps")==0) return SmbRlapsEnum;
-	      else if (strcmp(name,"SmbRlapslgm")==0) return SmbRlapslgmEnum;
 	      else if (strcmp(name,"SmbSolution")==0) return SmbSolutionEnum;
 	      else if (strcmp(name,"SmoothAnalysis")==0) return SmoothAnalysisEnum;
 	      else if (strcmp(name,"SoftMigration")==0) return SoftMigrationEnum;
+	      else if (strcmp(name,"SpatialLinearFloatingMeltRate")==0) return SpatialLinearFloatingMeltRateEnum;
 	      else if (strcmp(name,"SpcDynamic")==0) return SpcDynamicEnum;
 	      else if (strcmp(name,"SpcStatic")==0) return SpcStaticEnum;
 	      else if (strcmp(name,"SpcTransient")==0) return SpcTransientEnum;
-	      else if (strcmp(name,"SSAApproximation")==0) return SSAApproximationEnum;
-	      else if (strcmp(name,"SSAFSApproximation")==0) return SSAFSApproximationEnum;
-	      else if (strcmp(name,"SSAHOApproximation")==0) return SSAHOApproximationEnum;
 	      else if (strcmp(name,"Sset")==0) return SsetEnum;
 	      else if (strcmp(name,"SteadystateSolution")==0) return SteadystateSolutionEnum;
+	      else if (strcmp(name,"StressIntensityFactor")==0) return StressIntensityFactorEnum;
 	      else if (strcmp(name,"StressbalanceAnalysis")==0) return StressbalanceAnalysisEnum;
 	      else if (strcmp(name,"StressbalanceConvergenceNumSteps")==0) return StressbalanceConvergenceNumStepsEnum;
@@ -1157,5 +1266,4 @@
 	      else if (strcmp(name,"StressbalanceSolution")==0) return StressbalanceSolutionEnum;
 	      else if (strcmp(name,"StressbalanceVerticalAnalysis")==0) return StressbalanceVerticalAnalysisEnum;
-	      else if (strcmp(name,"StressIntensityFactor")==0) return StressIntensityFactorEnum;
 	      else if (strcmp(name,"StringArrayParam")==0) return StringArrayParamEnum;
 	      else if (strcmp(name,"StringExternalResult")==0) return StringExternalResultEnum;
@@ -1163,17 +1271,16 @@
 	      else if (strcmp(name,"SubelementFriction1")==0) return SubelementFriction1Enum;
 	      else if (strcmp(name,"SubelementFriction2")==0) return SubelementFriction2Enum;
-	      else if (strcmp(name,"SubelementMigration")==0) return SubelementMigrationEnum;
 	      else if (strcmp(name,"SubelementMelt1")==0) return SubelementMelt1Enum;
 	      else if (strcmp(name,"SubelementMelt2")==0) return SubelementMelt2Enum;
-	      else if (strcmp(name,"SurfaceCrevasse")==0) return SurfaceCrevasseEnum;
+	      else if (strcmp(name,"SubelementMigration")==0) return SubelementMigrationEnum;
 	      else if (strcmp(name,"SurfaceSlopeSolution")==0) return SurfaceSlopeSolutionEnum;
 	      else if (strcmp(name,"TaylorHood")==0) return TaylorHoodEnum;
-	      else if (strcmp(name,"TemperaturePDD")==0) return TemperaturePDDEnum;
 	      else if (strcmp(name,"Tetra")==0) return TetraEnum;
 	      else if (strcmp(name,"TetraInput")==0) return TetraInputEnum;
 	      else if (strcmp(name,"ThermalAnalysis")==0) return ThermalAnalysisEnum;
 	      else if (strcmp(name,"ThermalSolution")==0) return ThermalSolutionEnum;
-	      else if (strcmp(name,"ThermalSpctemperature")==0) return ThermalSpctemperatureEnum;
 	      else if (strcmp(name,"ThicknessErrorEstimator")==0) return ThicknessErrorEstimatorEnum;
+	      else if (strcmp(name,"TotalCalvingFluxLevelset")==0) return TotalCalvingFluxLevelsetEnum;
+	      else if (strcmp(name,"TotalCalvingMeltingFluxLevelset")==0) return TotalCalvingMeltingFluxLevelsetEnum;
 	      else if (strcmp(name,"TotalFloatingBmb")==0) return TotalFloatingBmbEnum;
 	      else if (strcmp(name,"TotalFloatingBmbScaled")==0) return TotalFloatingBmbScaledEnum;
@@ -1191,7 +1298,7 @@
 	      else if (strcmp(name,"VectorParam")==0) return VectorParamEnum;
 	      else if (strcmp(name,"Vertex")==0) return VertexEnum;
+	      else if (strcmp(name,"VertexLId")==0) return VertexLIdEnum;
 	      else if (strcmp(name,"VertexPId")==0) return VertexPIdEnum;
 	      else if (strcmp(name,"VertexSId")==0) return VertexSIdEnum;
-	      else if (strcmp(name,"VertexLId")==0) return VertexLIdEnum;
 	      else if (strcmp(name,"Vertices")==0) return VerticesEnum;
 	      else if (strcmp(name,"ViscousHeating")==0) return ViscousHeatingEnum;
@@ -1212,11 +1319,11 @@
 	      else if (strcmp(name,"SealevelWeights")==0) return SealevelWeightsEnum;
 	      else if (strcmp(name,"StrainRate")==0) return StrainRateEnum;
+	      else if (strcmp(name,"StressTensor")==0) return StressTensorEnum;
 	      else if (strcmp(name,"StressbalanceViscosityOvershoot")==0) return StressbalanceViscosityOvershootEnum;
-	      else if (strcmp(name,"StressTensor")==0) return StressTensorEnum;
 	      else if (strcmp(name,"SubelementMigration4")==0) return SubelementMigration4Enum;
 	      else if (strcmp(name,"TimesteppingTimeAdapt")==0) return TimesteppingTimeAdaptEnum;
 	      else if (strcmp(name,"TriangleInterp")==0) return TriangleInterpEnum;
 	      else if (strcmp(name,"MaximumNumberOfDefinitions")==0) return MaximumNumberOfDefinitionsEnum;
-         else stage=11;
+         else stage=12;
    }
 	/*If we reach this point, the string provided has not been found*/
Index: /issm/trunk/src/c/shared/Enum/Synchronize.sh
===================================================================
--- /issm/trunk/src/c/shared/Enum/Synchronize.sh	(revision 24312)
+++ /issm/trunk/src/c/shared/Enum/Synchronize.sh	(revision 24313)
@@ -13,5 +13,5 @@
 
 #Deal with Analyses
-if true ; then
+if false ; then
 #Build EnumToAnalysis.cpp {{{
 #Header
@@ -173,5 +173,5 @@
 	echo "         else stage=$(($i+1));" >> $ISSM_DIR//src/c/shared/Enum/StringToEnumx.cpp
 	echo "   }" >> $ISSM_DIR//src/c/shared/Enum/StringToEnumx.cpp
-	
+
 	if [ $i2 -ge $NUMENUMS ]; then break; fi
 	let i1=$i1+120
@@ -190,4 +190,40 @@
 #}}}
 
+#vim file
+#Build Enum.vim{{{
+#Header
+cat <<END > $ISSM_DIR/src/c/shared/Enum/Enum.vim
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" ISSM specific c syntax highlighting
+"
+"   WARNING: DO NOT MODIFY THIS FILE
+"            this file has been automatically generated by Synchronize.sh
+"            Please read README for more information
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+"PETSc
+syn keyword cType Vec Mat SeqVec SeqMat
+
+"ISSM typedefs
+syn keyword cType mxArray ErrorException QuadtreeBox
+syn keyword cType IssmDouble IssmPDouble
+
+"ISSM Enums
+END
+cat temp |  awk '{print "syn keyword cConstant " $1}' >> $ISSM_DIR/src/c/shared/Enum/Enum.vim
+cat <<END >> $ISSM_DIR/src/c/shared/Enum/Enum.vim
+"ISSM Enums end
+END
+
+#Synchronize ISSM objects objects
+cat <<END >> $ISSM_DIR/src/c/shared/Enum/Enum.vim
+
+"ISSM objects
+END
+find $ISSM_DIR/src/c/classes -name "*.cpp" -o -name "*.h" | sed -e "s/\// /g" -e "s/\.cpp//" -e "s/\.h//" | awk '{print  $(NF)}' | sort | uniq | awk '{ printf "syn keyword cType " $1 "\n"}'>> $ISSM_DIR/src/c/shared/Enum/Enum.vim
+find $ISSM_DIR/src/c/analyses -name "*Analysis.h" | sed -e "s/\// /g" -e "s/\.cpp//" -e "s/\.h//" | awk '{print  $(NF)}' | sort | uniq | awk '{ printf "syn keyword cType " $1 "\n"}'>> $ISSM_DIR/src/c/shared/Enum/Enum.vim
+echo "\"ISSM objects end" >> $ISSM_DIR/src/c/shared/Enum/Enum.vim
+#}}}
+
 #clean up{{{
 rm temp
Index: /issm/trunk/src/c/shared/Exp/exp.h
===================================================================
--- /issm/trunk/src/c/shared/Exp/exp.h	(revision 24312)
+++ /issm/trunk/src/c/shared/Exp/exp.h	(revision 24313)
@@ -80,5 +80,5 @@
 	/*open domain outline file for reading: */
 	if ((fid=fopen(domainname,"r"))==NULL){
-		_error_("could not find file \"" << domainname<<"\". Make sure that the file and path provided exist."); 
+		_error_("could not find file \"" << domainname<<"\". Make sure that the file and path provided exist.");
 	}
 
Index: /issm/trunk/src/c/shared/Matrix/MatrixUtils.cpp
===================================================================
--- /issm/trunk/src/c/shared/Matrix/MatrixUtils.cpp	(revision 24312)
+++ /issm/trunk/src/c/shared/Matrix/MatrixUtils.cpp	(revision 24313)
@@ -424,6 +424,6 @@
 	*plambda1 = lambda1;
 	*plambda2 = lambda2;
-	*pvx      = vx;
-	*pvy      = vy;
+	if(pvx) *pvx = vx;
+	if(pvy) *pvy = vy;
 
 }/*}}}*/
Index: /issm/trunk/src/c/shared/MemOps/MemOps.h
===================================================================
--- /issm/trunk/src/c/shared/MemOps/MemOps.h	(revision 24312)
+++ /issm/trunk/src/c/shared/MemOps/MemOps.h	(revision 24313)
@@ -18,9 +18,9 @@
 static char const DEFCONTIG = 'f';
 
-// AD (mostly ADOLC) is sensitive to calls to ensurecontiguous. These changes limit its use.
+/* AD (mostly ADOLC) is sensitive to calls to ensurecontiguous. These changes limit its use.*/
 #ifdef _HAVE_AD_
-template <class T> T* xNew(unsigned int size, const char* const contig = &DEFCONTIG) { /*{{{*/
+template <class T> T* xNew(unsigned int size, const char* const contig = &DEFCONTIG){
 #else
-template <class T> T* xNew(unsigned int size) { /*{{{*/
+template <class T> T* xNew(unsigned int size){
 #endif
 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
@@ -33,5 +33,5 @@
   return aT_p;
 #endif  
-}/*}}}*/
+}
 template <class T> T** xNew(unsigned int dim1, unsigned int dim2) { /*{{{*/
 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
@@ -58,7 +58,7 @@
 // AD (mostly ADOLC) is sensitive to calls to ensurecontiguous. These changes limit its use.
 #ifdef _HAVE_AD_
-template <class T> T* xNewZeroInit(unsigned int size,const char* const contig = &DEFCONTIG) {/*{{{*/
+template <class T> T* xNewZeroInit(unsigned int size,const char* const contig = &DEFCONTIG){
 #else
-template <class T> T* xNewZeroInit(unsigned int size) {/*{{{*/
+template <class T> T* xNewZeroInit(unsigned int size){
 #endif
 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
@@ -76,5 +76,5 @@
   return aT_p;
 #endif
-}/*}}}*/
+}
 template <class T> T** xNewZeroInit(unsigned int dim1, unsigned int dim2) {/*{{{*/
 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
Index: /issm/trunk/src/c/shared/Numerics/BrentSearch.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/BrentSearch.cpp	(revision 24312)
+++ /issm/trunk/src/c/shared/Numerics/BrentSearch.cpp	(revision 24313)
@@ -11,4 +11,5 @@
 #include <float.h>
 #include <iomanip>
+#include <cmath>
 
 #include "../Exceptions/exceptions.h"
Index: /issm/trunk/src/c/shared/Numerics/ODE1.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/ODE1.cpp	(revision 24313)
+++ /issm/trunk/src/c/shared/Numerics/ODE1.cpp	(revision 24313)
@@ -0,0 +1,23 @@
+#include <math.h>
+#include "./types.h"
+#include "../Exceptions/exceptions.h"
+
+IssmDouble ODE1(IssmDouble alpha,IssmDouble beta,IssmDouble Si, IssmDouble dt,int method){
+	/* solve the following equation:
+	 *
+	 *   dS/dt = alpha S + beta
+	 *
+	 *   method 0: Forward Euler (explicit)
+	 *   method 1: backward Euler (implicit)
+	 *   method 2: Crank Nicolson
+	 *
+	 *   return S^{i+1} based on  Si, dt, alpha and beta
+	 */
+
+	switch(method){
+		case 0: return Si*(1.+alpha*dt) + beta*dt;
+		case 1: return (Si+beta*dt)/(1.-alpha*dt);
+		case 2: return (Si*(1.+alpha*dt/2.) + beta*dt)/(1-alpha*dt/2.);
+		default: _error_("not supported yet");
+	}
+}
Index: /issm/trunk/src/c/shared/Numerics/constants.h
===================================================================
--- /issm/trunk/src/c/shared/Numerics/constants.h	(revision 24312)
+++ /issm/trunk/src/c/shared/Numerics/constants.h	(revision 24313)
@@ -7,5 +7,4 @@
 
 #define UNDEF -9999
-#define ONETHIRD 0.333333333333333333333333333333333333333333333333333333333333
 #define SQRT2 1.414213562373095048801688724209698078569671875376948073176679738
 #define SQRT3 1.732050807568877293527446341505872366942805253810380628055806979
Index: /issm/trunk/src/c/shared/Numerics/isnan.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/isnan.cpp	(revision 24312)
+++ /issm/trunk/src/c/shared/Numerics/isnan.cpp	(revision 24313)
@@ -1,4 +1,2 @@
-/*This routine only used by Intel compler: */
-
 #ifdef HAVE_CONFIG_H
    #include <config.h>
@@ -7,21 +5,14 @@
 #endif
 
+/*Special overloading definitions for AD*/
 #include "./isnan.h"
 
 #if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
-template <> int xIsNan<adouble> (const adouble& X){
-  return std::isnan(X.getValue());
-}
-template <> int xIsInf<adouble> (const adouble& X){
-  return std::isinf(X.getValue());
-}
+template <> int xIsNan<adouble> (const adouble& X){ return std::isnan(X.getValue()); }
+template <> int xIsInf<adouble> (const adouble& X){ return std::isinf(X.getValue()); }
 #endif
 
 #if defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_)
-template <> int xIsNan<IssmDouble> (const IssmDouble& X){
-	  return std::isnan(X.getValue());
-}
-template <> int xIsInf<IssmDouble> (const IssmDouble& X){
-	return std::isinf(X.getValue());
-}
+template <> int xIsNan<IssmDouble> (const IssmDouble& X){ return std::isnan(X.getValue()); }
+template <> int xIsInf<IssmDouble> (const IssmDouble& X){ return std::isinf(X.getValue()); }
 #endif
Index: /issm/trunk/src/c/shared/Numerics/isnan.h
===================================================================
--- /issm/trunk/src/c/shared/Numerics/isnan.h	(revision 24312)
+++ /issm/trunk/src/c/shared/Numerics/isnan.h	(revision 24313)
@@ -1,6 +1,2 @@
-/*!\file:  isnan.h
- * \brief: only used for intel compiler.
- */ 
-
 #ifndef _XISNAN_H_
 #define _XISNAN_H_
@@ -12,18 +8,15 @@
 #endif
 
-/*If include cmath instead of math, isnan on linux64 murdo does not work: */
+/*cmath defines isnan and isinf*/
 #include <cmath>
 
-template <class T> int xIsNan(const T& X) {
 #ifdef _INTEL_WIN_
-		return (X!=X)?1:0;
+template <class T> int xIsNan(const T& X){return (X!=X)?1:0;}
 #else
-		return std::isnan(X);
+template <class T> int xIsNan(const T& X){return std::isnan(X); }
 #endif
-}
+template <class T> int xIsInf(const T& X){return std::isinf(X); }
 
-template <class T> int xIsInf(const T& X) {
-	return std::isinf(X);
-}
+/*Special overloading definitions for AD*/
 
 #if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
Index: /issm/trunk/src/c/shared/Numerics/numerics.h
===================================================================
--- /issm/trunk/src/c/shared/Numerics/numerics.h	(revision 24312)
+++ /issm/trunk/src/c/shared/Numerics/numerics.h	(revision 24313)
@@ -41,4 +41,5 @@
 
 int         NewtonSolveDnorm(IssmDouble* pdnorm,IssmDouble c1,IssmDouble c2,IssmDouble c3,IssmDouble n,IssmDouble dnorm);
+IssmDouble  ODE1(IssmDouble alpha,IssmDouble beta,IssmDouble Si, IssmDouble dt,int method);
 
 #endif //ifndef _NUMERICS_H_
Index: /issm/trunk/src/c/shared/io/Marshalling/IoCodeConversions.cpp
===================================================================
--- /issm/trunk/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 24312)
+++ /issm/trunk/src/c/shared/io/Marshalling/IoCodeConversions.cpp	(revision 24313)
@@ -113,7 +113,17 @@
 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
 	}
+	else if(strcmp(string_in,"BasalforcingsGeothermalflux")==0){
+		const char* field = "md.basalforcings.geothermalflux";
+		input_enum        = BasalforcingsGeothermalfluxEnum;
+		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+	}
 	else if(strcmp(string_in,"FrictionCoefficient")==0 || strcmp(string_in,"md.friction.coefficient")==0){
 		const char* field = "md.friction.coefficient";
 		input_enum        = FrictionCoefficientEnum;
+		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+	}
+	else if(strcmp(string_in,"FrictionEffectivePressure")==0){
+		const char* field = "md.friction.effective_pressure";
+		input_enum        = FrictionEffectivePressureEnum;
 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
 	}
@@ -153,4 +163,29 @@
 		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
 	}
+	else if(strcmp(string_in,"SealevelriseDeltathickness")==0){
+		const char* field = "md.slr.deltathickness";
+		input_enum        = SealevelriseDeltathicknessEnum;
+		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+	}
+	else if(strcmp(string_in,"SealevelNGiaRate")==0){
+		const char* field = "md.slr.Ngia";
+		input_enum        = SealevelNGiaRateEnum;
+		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+	}
+	else if(strcmp(string_in,"SealevelriseStericRate")==0){
+		const char* field = "md.slr.steric_rate";
+		input_enum        = SealevelriseStericRateEnum;
+		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+	}
+	else if(strcmp(string_in,"SealevelriseHydroRate")==0){
+		const char* field = "md.slr.hydro_rate";
+		input_enum        = SealevelriseHydroRateEnum;
+		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+	}
+	else if(strcmp(string_in,"SealevelUGiaRate")==0){
+		const char* field = "md.slr.Ugia";
+		input_enum        = SealevelUGiaRateEnum;
+		fieldname=xNew<char>((strlen(field)+1)); xMemCpy<char>(fieldname,field,(strlen(field)+1));
+	}
 	else{
 		_error_("Field \""<<string_in<<"\" not supported yet");
@@ -175,4 +210,5 @@
 		case 10: return SMBpddSicopolisEnum;
 		case 11: return SMBgradientscomponentsEnum;
+		case 12: return SMBsemicEnum;	
 		default: _error_("Marshalled SMB code \""<<enum_in<<"\" not supported yet");
 	}
@@ -186,4 +222,6 @@
 		case 5: return BasalforcingsPicoEnum;
 		case 6: return SpatialLinearFloatingMeltRateEnum;
+		case 7: return BasalforcingsIsmip6Enum;
+		case 8: return BeckmannGoosseFloatingMeltRateEnum;
 		default: _error_("Marshalled Basal Forcings code \""<<enum_in<<"\" not supported yet");
 	}
@@ -201,4 +239,11 @@
 	}
 }/*}}}*/
+int IoCodeToEnumFrontalforcings(int enum_in){/*{{{*/
+	switch(enum_in){
+		case 1: return FrontalForcingsDefaultEnum;
+		case 2: return FrontalForcingsRignotEnum;
+		default: _error_("Marshalled Frontalforcings code \""<<enum_in<<"\" not supported yet");
+	}
+}/*}}}*/
 int IoCodeToEnumHydrology(int enum_in){/*{{{*/
 	switch(enum_in){
@@ -207,4 +252,5 @@
 		case 3: return HydrologyshaktiEnum;
 		case 4: return HydrologypismEnum;
+		case 5: return HydrologyGlaDSEnum;
 		default: _error_("Marshalled hydrology code \""<<enum_in<<"\" not supported yet");
 	}
Index: /issm/trunk/src/c/shared/io/Marshalling/IoCodeConversions.h
===================================================================
--- /issm/trunk/src/c/shared/io/Marshalling/IoCodeConversions.h	(revision 24312)
+++ /issm/trunk/src/c/shared/io/Marshalling/IoCodeConversions.h	(revision 24313)
@@ -7,4 +7,5 @@
 int IoCodeToEnumBasal(int enum_in);
 int IoCodeToEnumCalving(int enum_in);
+int IoCodeToEnumFrontalforcings(int enum_in);
 int IoCodeToEnumHydrology(int enum_in);
 int IoCodeToEnumMaterials(int enum_in);
Index: /issm/trunk/src/c/solutionsequences/convergence.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/convergence.cpp	(revision 24312)
+++ /issm/trunk/src/c/solutionsequences/convergence.cpp	(revision 24313)
@@ -7,5 +7,5 @@
 #include "../shared/shared.h"
 
-void convergence(bool* pconverged, Matrix<IssmDouble>* Kff,Vector<IssmDouble>* pf,Vector<IssmDouble>* uf,Vector<IssmDouble>* old_uf,IssmDouble eps_res,IssmDouble eps_rel,IssmDouble eps_abs){/*{{{*/
+void convergence(bool* pconverged, Matrix<IssmDouble>* Kff,Vector<IssmDouble>* pf,Vector<IssmDouble>* uf,Vector<IssmDouble>* old_uf,IssmDouble eps_res,IssmDouble eps_rel,IssmDouble eps_abs){
 
 	/*output*/
@@ -13,14 +13,11 @@
 
 	/*intermediary*/
-	Vector<IssmDouble>* KU=NULL;
-	Vector<IssmDouble>* KUF=NULL;
 	Vector<IssmDouble>* KUold=NULL;
 	Vector<IssmDouble>* KUoldF=NULL;
 	Vector<IssmDouble>* duf=NULL;
 	IssmDouble ndu,nduinf,nu;
-	IssmDouble nKUF;
 	IssmDouble nKUoldF;
 	IssmDouble nF;
-	IssmDouble solver_residue,res;
+	IssmDouble res;
 	int analysis_type;
 
@@ -32,28 +29,4 @@
 		*pconverged=true;
 		return;
-	}
-
-
-	/*Display solver caracteristics*/
-	if (VerboseConvergence()){
-
-	
-
-		/*compute KUF = KU - F = K*U - F*/
-		KU=uf->Duplicate(); Kff->MatMult(uf,KU);
-		KUF=KU->Duplicate(); KU->Copy(KUF); KUF->AYPX(pf,-1.0);
-
-		/*compute norm(KUF), norm(F) and residue*/
-		nKUF=KUF->Norm(NORM_TWO);
-		nF=pf->Norm(NORM_TWO);
-		solver_residue=nKUF/nF;
-		_printf0_("\n" << "   solver residue: norm(KU-F)/norm(F)=" << solver_residue << "\n");
-		if(xIsNan<IssmDouble>(solver_residue)){
-			//Kff->Echo();
-		}
-
-		/*clean up*/
-		delete KU;
-		delete KUF;
 	}
 
@@ -139,5 +112,3 @@
 	/*assign output*/
 	*pconverged=converged;
-}/*}}}*/
-
-
+}
Index: /issm/trunk/src/c/solutionsequences/solutionsequence_adjoint_linear.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequence_adjoint_linear.cpp	(revision 24312)
+++ /issm/trunk/src/c/solutionsequences/solutionsequence_adjoint_linear.cpp	(revision 24313)
@@ -20,12 +20,10 @@
 	Vector<IssmDouble>*  df  = NULL;
 	Vector<IssmDouble>*  ys  = NULL;
-	int  configuration_type;
 
 	/*Recover parameters: */
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 	femmodel->UpdateConstraintsx();
 
 	SystemMatricesx(&Kff, &Kfs, &pf, &df, NULL,femmodel);
-	CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
+	CreateNodalConstraintsx(&ys,femmodel->nodes);
 	Reduceloadx(pf, Kfs, ys,true); delete Kfs; //true means spc = 0
 
Index: /issm/trunk/src/c/solutionsequences/solutionsequence_fct.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequence_fct.cpp	(revision 24312)
+++ /issm/trunk/src/c/solutionsequences/solutionsequence_fct.cpp	(revision 24313)
@@ -105,9 +105,7 @@
 	for(int i=0;i<femmodel->constraints->Size();i++){
 		Constraint* constraint=(Constraint*)femmodel->constraints->GetObjectByOffset(i);
-		if(constraint->InAnalysis(configuration_type)){
-			constraint->PenaltyDofAndValue(&dof,&d,femmodel->nodes,femmodel->parameters);
-			if(dof!=-1){
-				MatSetValue(LHS,dof,dof,dmax,INSERT_VALUES);
-			}
+		constraint->PenaltyDofAndValue(&dof,&d,femmodel->nodes,femmodel->parameters);
+		if(dof!=-1){
+			MatSetValue(LHS,dof,dof,dmax,INSERT_VALUES);
 		}
 	}
@@ -151,10 +149,8 @@
 	for(int i=0;i<femmodel->constraints->Size();i++){
 		Constraint* constraint=(Constraint*)femmodel->constraints->GetObjectByOffset(i);
-		if(constraint->InAnalysis(configuration_type)){
-			constraint->PenaltyDofAndValue(&dof,&d,femmodel->nodes,femmodel->parameters);
-			d = d*dmax;
-			if(dof!=-1){
-				VecSetValues(RHS,1,&dof,(const double*)&d,INSERT_VALUES);
-			}
+		constraint->PenaltyDofAndValue(&dof,&d,femmodel->nodes,femmodel->parameters);
+		d = d*dmax;
+		if(dof!=-1){
+			VecSetValues(RHS,1,&dof,(const double*)&d,INSERT_VALUES);
 		}
 	}
Index: /issm/trunk/src/c/solutionsequences/solutionsequence_glads_nonlinear.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequence_glads_nonlinear.cpp	(revision 24313)
+++ /issm/trunk/src/c/solutionsequences/solutionsequence_glads_nonlinear.cpp	(revision 24313)
@@ -0,0 +1,96 @@
+/*!\file: solutionsequence_nonlinear.cpp
+ * \brief: core of a non-linear solution, using fixed-point method 
+ */ 
+
+#include "./solutionsequences.h"
+#include "../toolkits/toolkits.h"
+#include "../classes/classes.h"
+#include "../shared/shared.h"
+#include "../modules/modules.h"
+
+void solutionsequence_glads_nonlinear(FemModel* femmodel){
+
+	/*intermediary: */
+	Matrix<IssmDouble>* Kff = NULL;
+	Matrix<IssmDouble>* Kfs = NULL;
+	Vector<IssmDouble>* ug  = NULL;
+	Vector<IssmDouble>* uf  = NULL;
+	Vector<IssmDouble>* old_uf = NULL;
+	Vector<IssmDouble>* pf  = NULL;
+	Vector<IssmDouble>* df  = NULL;
+	Vector<IssmDouble>* ys  = NULL;
+
+	/*parameters:*/
+	int max_nonlinear_iterations;
+	IssmDouble eps_res,eps_rel,eps_abs;
+	HydrologyGlaDSAnalysis* analysis = new HydrologyGlaDSAnalysis();
+
+	/*Recover parameters (FIXME: from Stress balance for now :( )*/
+	femmodel->parameters->FindParam(&max_nonlinear_iterations,StressbalanceMaxiterEnum);
+	femmodel->parameters->FindParam(&eps_res,StressbalanceRestolEnum);
+	femmodel->parameters->FindParam(&eps_rel,StressbalanceReltolEnum);
+	femmodel->parameters->FindParam(&eps_abs,StressbalanceAbstolEnum);
+	femmodel->UpdateConstraintsx();
+
+	int  count_out=0;
+	bool converged_out=false;
+	int  count_in=0;
+	bool converged_in=false;
+
+	/*Start non-linear iteration using input velocity: */
+	GetSolutionFromInputsx(&ug,femmodel);
+	Reducevectorgtofx(&uf, ug, femmodel->nodes,femmodel->parameters);
+
+	while(!converged_out){
+
+		count_in=0;
+		converged_in=false;
+
+		while(!converged_in){
+			/*save pointer to old solution*/
+			delete old_uf;old_uf=uf;
+			delete ug;
+
+			SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel);
+			CreateNodalConstraintsx(&ys,femmodel->nodes);
+			Reduceloadx(pf, Kfs, ys); delete Kfs;
+			femmodel->profiler->Start(SOLVER);
+			Solverx(&uf, Kff, pf, old_uf, df, femmodel->parameters);
+			femmodel->profiler->Stop(SOLVER);
+			Mergesolutionfromftogx(&ug, uf,ys,femmodel->nodes,femmodel->parameters);delete ys;
+
+			convergence(&converged_in,Kff,pf,uf,old_uf,eps_res,eps_rel,eps_abs); delete Kff; delete pf; delete df;
+			InputUpdateFromSolutionx(femmodel,ug);
+
+			/*Increase count: */
+			count_in++;
+			if(count_in>=max_nonlinear_iterations && !converged_in){
+				_printf0_("   maximum number of nonlinear iterations of inner loop (" << max_nonlinear_iterations << ") exceeded\n"); 
+				converged_in = true;
+			}
+		}
+		if(VerboseConvergence()) _printf0_(setw(50) << left << "   Inner loop converged in "<<count_in<<" iterations\n");
+
+		if(VerboseConvergence()) _printf0_("   updating sheet thickness and channels cross section\n");
+		analysis->UpdateSheetThickness(femmodel);
+		analysis->UpdateChannelCrossSection(femmodel);
+
+		/*Converged if inner loop converged in one solution*/
+		if(count_in==1) converged_out = true;
+
+		/*Increase count: */
+		count_out++;
+		if(count_out>=max_nonlinear_iterations && !converged_out){
+			_printf0_("   maximum number of nonlinear iterations of outer loop (" << max_nonlinear_iterations << ") exceeded\n"); 
+			converged_out = true;
+		}
+	}
+
+	if(VerboseConvergence()) _printf0_("\n   total number of iterations: " << count_out<<"x"<<count_in<<"\n");
+
+	/*clean-up*/
+	delete uf;
+	delete ug;
+	delete old_uf;
+	delete analysis;
+}
Index: /issm/trunk/src/c/solutionsequences/solutionsequence_hydro_nonlinear.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequence_hydro_nonlinear.cpp	(revision 24312)
+++ /issm/trunk/src/c/solutionsequences/solutionsequence_hydro_nonlinear.cpp	(revision 24313)
@@ -57,5 +57,5 @@
 	if(!isefficientlayer) hydroconverged=true;
 
-	/*Retrieve inputs as the initial state for the non linear iteration*/
+	/*{{{*//*Retrieve inputs as the initial state for the non linear iteration*/
 	GetSolutionFromInputsx(&ug_sed,femmodel);
 	Reducevectorgtofx(&uf_sed, ug_sed, femmodel->nodes,femmodel->parameters);
@@ -65,8 +65,12 @@
 		femmodel->SetCurrentConfiguration(HydrologyDCEfficientAnalysisEnum);
 		GetSolutionFromInputsx(&ug_epl,femmodel);
-		/*Initialize the element mask*/
+		/*Initialize the EPL element mask*/
 		inefanalysis->ElementizeEplMask(femmodel);
 		effanalysis->InitZigZagCounter(femmodel);
+		/*Initialize the IDS element mask*/
+		femmodel->SetCurrentConfiguration(HydrologyDCInefficientAnalysisEnum);
+		inefanalysis->ElementizeIdsMask(femmodel);
 	}
+	/*}}}*/
 	/*The real computation starts here, outermost loop is on the two layer system*/
 	for(;;){
@@ -84,5 +88,5 @@
 		/*Loop on sediment layer to deal with transfer and head value*/
 		femmodel->SetCurrentConfiguration(HydrologyDCInefficientAnalysisEnum);
-		InputUpdateFromConstantx(femmodel,true,ResetPenaltiesEnum);
+		ResetZigzagCounterx(femmodel);
 		InputUpdateFromConstantx(femmodel,false,ConvergedEnum);
 		femmodel->UpdateConstraintsx();
@@ -98,8 +102,8 @@
 			/*{{{*//*Loop on the sediment layer to deal with the penalization*/
 			for(;;){
-				/*{{{*/ /*Core of the computation*/
+				/*{{{*//*Core of the computation*/
 				if(VerboseSolution()) _printf0_("Building Sediment Matrix...\n");
 				SystemMatricesx(&Kff,&Kfs,&pf,&df,&sediment_kmax,femmodel);
-				CreateNodalConstraintsx(&ys,femmodel->nodes,HydrologyDCInefficientAnalysisEnum);
+				CreateNodalConstraintsx(&ys,femmodel->nodes);
 				Reduceloadx(pf,Kfs,ys); delete Kfs;
 				delete uf_sed;
@@ -130,5 +134,5 @@
 			sedconverged=false;
 
-			/*Checking convegence on the value of the sediment head*/
+			/*Checking convergence on the value of the sediment head*/
 			duf=uf_sed_sub_iter->Duplicate();_assert_(duf);
 			uf_sed_sub_iter->Copy(duf);
@@ -160,6 +164,5 @@
 			if(VerboseSolution()) _printf0_("==updating mask...\n");
 			femmodel->HydrologyEPLupdateDomainx(&ThickCount);
-			inefanalysis->ElementizeEplMask(femmodel);
-			InputUpdateFromConstantx(femmodel,true,ResetPenaltiesEnum);
+			ResetZigzagCounterx(femmodel);
 			InputUpdateFromConstantx(femmodel,false,ConvergedEnum);
 
@@ -172,5 +175,4 @@
 				femmodel->SetCurrentConfiguration(L2ProjectionEPLAnalysisEnum);
 				femmodel->UpdateConstraintsL2ProjectionEPLx(&L2Count);
-				inefanalysis->ElementizeEplMask(femmodel);
 				femmodel->parameters->SetParam(EplHeadSlopeXEnum,InputToL2ProjectEnum);
 				solutionsequence_linear(femmodel);
@@ -182,10 +184,9 @@
 				//updating mask after the computation of the epl thickness (Allow to close too thin EPL)
 				femmodel->HydrologyEPLupdateDomainx(&ThickCount);
-				inefanalysis->ElementizeEplMask(femmodel);
 				/*}}}*/
 
 				if(VerboseSolution()) _printf0_("Building EPL Matrix...\n");
 				SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel);
-				CreateNodalConstraintsx(&ys,femmodel->nodes,HydrologyDCEfficientAnalysisEnum);
+				CreateNodalConstraintsx(&ys,femmodel->nodes);
 				Reduceloadx(pf,Kfs,ys); delete Kfs;
 				delete uf_epl;
@@ -229,7 +230,6 @@
 			}
 		}
-		/*}}}*/ /*End of the global EPL loop*/
-
-		/*{{{*/ /*Now dealing with the convergence of the whole system*/
+		/*}}}*//*End of the global EPL loop*/
+		/*{{{*//*Now dealing with the convergence of the whole system*/
 		if(!hydroconverged){
 			//compute norm(du)/norm(u)
Index: /issm/trunk/src/c/solutionsequences/solutionsequence_la.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequence_la.cpp	(revision 24312)
+++ /issm/trunk/src/c/solutionsequences/solutionsequence_la.cpp	(revision 24313)
@@ -21,5 +21,5 @@
 	Vector<IssmDouble>*  pug_old = NULL;
 	IssmDouble           eps_rel,r,theta; // 0<theta<.5   -> .15<theta<.45
-	int                  configuration_type,max_nonlinear_iterations;
+	int                  max_nonlinear_iterations;
 	bool                 vel_converged      = false;
 	bool                 pressure_converged = false;
@@ -31,5 +31,4 @@
 
 	/*Recover parameters: */
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 	femmodel->parameters->FindParam(&eps_rel,StressbalanceReltolEnum);
 	femmodel->parameters->FindParam(&max_nonlinear_iterations,StressbalanceMaxiterEnum);
@@ -60,7 +59,6 @@
 			/*Solve KU=F*/
 			femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
-			femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 			SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel);
-			CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
+			CreateNodalConstraintsx(&ys,femmodel->nodes);
 			Reduceloadx(pf, Kfs, ys); delete Kfs;
 
@@ -95,7 +93,6 @@
 
 		femmodel->SetCurrentConfiguration(UzawaPressureAnalysisEnum);
-		femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 		SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel);
-		CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
+		CreateNodalConstraintsx(&ys,femmodel->nodes);
 		Reduceloadx(pf, Kfs, ys); delete Kfs;
 
Index: /issm/trunk/src/c/solutionsequences/solutionsequence_la_theta.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequence_la_theta.cpp	(revision 24312)
+++ /issm/trunk/src/c/solutionsequences/solutionsequence_la_theta.cpp	(revision 24313)
@@ -20,5 +20,5 @@
 	Vector<IssmDouble>*  ys     = NULL;
 	IssmDouble           eps_rel,r,theta; // 0<theta<.5   -> .15<theta<.45
-	int                  configuration_type,max_nonlinear_iterations;
+	int                  max_nonlinear_iterations;
 
 	/*Create analysis*/
@@ -26,5 +26,4 @@
 
 	/*Recover parameters: */
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 	femmodel->parameters->FindParam(&eps_rel,StressbalanceReltolEnum);
 	femmodel->parameters->FindParam(&max_nonlinear_iterations,StressbalanceMaxiterEnum);
@@ -57,5 +56,5 @@
 		/*Solve KU=F*/
 		SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel);
-		CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
+		CreateNodalConstraintsx(&ys,femmodel->nodes);
 		Reduceloadx(pf, Kfs, ys); delete Kfs;
 
Index: /issm/trunk/src/c/solutionsequences/solutionsequence_linear.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequence_linear.cpp	(revision 24312)
+++ /issm/trunk/src/c/solutionsequences/solutionsequence_linear.cpp	(revision 24313)
@@ -18,20 +18,9 @@
 	Vector<IssmDouble>*  df  = NULL;
 	Vector<IssmDouble>*  ys  = NULL;
-	int  configuration_type;
-	IssmDouble solver_residue_threshold;
-
-	/*solver convergence test: */
-	IssmDouble nKUF;
-	IssmDouble nF;
-	IssmDouble solver_residue;
-	Vector<IssmDouble>* KU=NULL;
-	Vector<IssmDouble>* KUF=NULL;
 
 	/*Recover parameters: */
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
-	femmodel->parameters->FindParam(&solver_residue_threshold,SettingsSolverResidueThresholdEnum);
 	femmodel->UpdateConstraintsx();
 	SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel);
-	CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
+	CreateNodalConstraintsx(&ys,femmodel->nodes);
 	Reduceloadx(pf, Kfs, ys); delete Kfs;
 
@@ -40,19 +29,5 @@
 	femmodel->profiler->Stop(SOLVER);
 
-	/*Check that the solver converged nicely: */
-
-	//compute KUF = KU - F = K*U - F
-	KU=uf->Duplicate(); Kff->MatMult(uf,KU);
-	KUF=KU->Duplicate(); KU->Copy(KUF); KUF->AYPX(pf,-1.0);
-
-	//compute norm(KUF), norm(F) and residue
-	nKUF=KUF->Norm(NORM_TWO);
-	nF=pf->Norm(NORM_TWO);
-	solver_residue=nKUF/nF;
-
-	if(!xIsNan(solver_residue_threshold) && solver_residue>solver_residue_threshold)_error_("   solver residue too high!: norm(KU-F)/norm(F)=" << solver_residue << "\n");
-
-	//clean up
-	delete KU; delete KUF;
+	/*Clean up*/
 	delete Kff; delete pf; delete df;
 
Index: /issm/trunk/src/c/solutionsequences/solutionsequence_newton.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequence_newton.cpp	(revision 24312)
+++ /issm/trunk/src/c/solutionsequences/solutionsequence_newton.cpp	(revision 24313)
@@ -30,10 +30,8 @@
 	/*parameters:*/
 	int max_nonlinear_iterations;
-	int configuration_type;
 	IssmDouble eps_res,eps_rel,eps_abs;
 
 	/*Recover parameters: */
 	femmodel->parameters->FindParam(&max_nonlinear_iterations,StressbalanceMaxiterEnum);
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 	femmodel->parameters->FindParam(&newton,StressbalanceIsnewtonEnum);
 	femmodel->parameters->FindParam(&eps_res,StressbalanceRestolEnum);
@@ -61,5 +59,5 @@
 		if(count==1 || newton==2){
 			SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel);
-			CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
+			CreateNodalConstraintsx(&ys,femmodel->nodes);
 			Reduceloadx(pf,Kfs,ys);delete Kfs;
 			femmodel->profiler->Start(SOLVER);
@@ -75,5 +73,5 @@
 		/*Prepare next iteration using Newton's method*/
 		SystemMatricesx(&Kff,&Kfs,&pf,&df,&kmax,femmodel);delete df;
-		CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
+		CreateNodalConstraintsx(&ys,femmodel->nodes);
 		Reduceloadx(pf,Kfs,ys);delete Kfs;
 
Index: /issm/trunk/src/c/solutionsequences/solutionsequence_nonlinear.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequence_nonlinear.cpp	(revision 24312)
+++ /issm/trunk/src/c/solutionsequences/solutionsequence_nonlinear.cpp	(revision 24313)
@@ -65,5 +65,5 @@
 
 		SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel);
-		CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
+		CreateNodalConstraintsx(&ys,femmodel->nodes);
 		Reduceloadx(pf, Kfs, ys); delete Kfs;
 		femmodel->profiler->Start(SOLVER);
@@ -109,4 +109,6 @@
 	if(conserve_loads){
 		delete femmodel->loads;
+		int index=femmodel->AnalysisIndex(configuration_type);
+		femmodel->loads_list[index]=savedloads;
 		femmodel->loads=savedloads;
 	}
Index: /issm/trunk/src/c/solutionsequences/solutionsequence_schurcg.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequence_schurcg.cpp	(revision 24312)
+++ /issm/trunk/src/c/solutionsequences/solutionsequence_schurcg.cpp	(revision 24313)
@@ -9,30 +9,73 @@
 #include "../modules/modules.h"
 #include "../analyses/analyses.h"
-
+#include <iostream>
+#include <fstream>
 
 #ifdef _HAVE_PETSC_
 
 
-void SchurCGSolver(Vector<IssmDouble>** puf,Mat Kff,Vec pf, Vec uf0,IS isv,IS isp,Parameters* parameters){/*{{{*/
+void SchurCGSolver(Vector<IssmDouble>** puf,Mat Kff, Vec pf, Vec uf0,IS isv,IS isp,Parameters* parameters){/*{{{*/
 
 	Mat                  A, B, BT;				/* Saddle point block matrices */
-	Mat						IP;						/* Preconditioner matrix */
-	Mat						IP2;
+	Mat						IP;						/* Preconditioner or mass matrix */
 	int                  nu, np;					/* No of. free nodes in velocity / pressure space */
    Vec                  p,uold,unew;			/* Solution vectors for pressure / vel. */ 
-	Vec						tmpu, tmpp, rhsu,rhsp; /* temp. vectors, arbitrary RHS in vel. / pressure space */
-	Vec						gold,gnew,wold,wnew,chi,thetaold,thetanew,eta; /* CG intermediaries */
+	Vec						tmpu,tmpu2,resu,resp,tmpp,tmpp2,rhsu,rhsp; /* temp. vectors, arbitrary RHS in vel. / pressure space */
+	Vec						gold,gnew,wold,wnew,chi; /* CG intermediaries */
 	Vec						f1,f2;					/* RHS of the global system */
-	double					rho,gamma,tmpScalar; /* Step sizes, arbitrary double */
-	KSP						kspu,kspp;				/* KSP contexts for vel. / pressure systems*/
+	double					rho,gamma,tmpScalar,tmpScalar2; /* Step sizes, arbitrary double */
+	KSP						kspu,kspip;		/* KSP contexts for vel. / pressure systems*/
 	KSPConvergedReason	reason;					/* Convergence reason for troubleshooting */
 	int						its;						/* No. of iterations for troubleshooting */
-	double					initRnorm, rnorm, TOL; /* residual norms, STOP tolerance */
+	double					initRnorm, rnorm, TOL,ELLTOL; /* residual norms, STOP tolerance */
 	PC							pcu,pcp;					/* Preconditioner contexts pertaining the KSP contexts*/
 	PetscViewer				viewer;					/* Viewer for troubleshooting */
 	IssmPDouble				t1,t2;					/* Time measurement for bottleneck analysis */
 
-	/*STOP tolerance for the rel. residual*/
-	TOL = 0.4;
+	
+	double tmp1,tmp2,tmp3;
+	int tmpi;
+	double tmp4,tmp5,tmp6,tmp7;
+
+	int noIt;
+
+
+
+	int precond = 0;
+
+	#if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)
+	PetscTruth flag,flg;
+	#else
+	PetscBool flag,flg;
+	#endif
+
+
+	char ksp_type[50];
+	char pc_type[50];
+	int maxiter;
+
+	#if _PETSC_MINOR_<7
+	PetscOptionsGetString(PETSC_NULL,"-ksp_type",ksp_type,49,&flg);
+	PetscOptionsGetString(PETSC_NULL,"-pc_type",pc_type,49,&flg);
+	PetscOptionsGetReal(PETSC_NULL,"-tol",&TOL,NULL);
+	PetscOptionsGetReal(PETSC_NULL,"-elltol",&ELLTOL,NULL);
+	PetscOptionsGetInt(PETSC_NULL,"-schur_pc",&precond,NULL);
+	PetscOptionsGetInt(PETSC_NULL,"-max_iter",&maxiter,NULL);
+	#else
+	PetscOptionsGetString(NULL,PETSC_NULL,"-ksp_type",ksp_type,49,&flg);
+	PetscOptionsGetString(NULL,PETSC_NULL,"-pc_type",pc_type,49,&flg);
+	PetscOptionsGetReal(NULL,PETSC_NULL,"-tol",&TOL,NULL);
+	PetscOptionsGetReal(NULL,PETSC_NULL,"-elltol",&ELLTOL,NULL);
+	PetscOptionsGetInt(NULL,PETSC_NULL,"-schur_pc",&precond,NULL);
+	PetscOptionsGetInt(NULL,PETSC_NULL,"-max_iter",&maxiter,NULL);
+	#endif
+
+	
+	if(precond){
+		_printf0_("Running WITH preconditioner\n");
+	}else{
+		_printf0_("Running WITHOUT preconditioner\n");
+	}
+
 
 	/*Initialize output*/
@@ -41,7 +84,9 @@
 	/* Extract block matrices from the saddle point matrix */
 	/* [ A   B ] = Kff
-    * [ B^T 0 ] 
+    * [ B^T I ]
+	 * where A is the elliptic submatrix, B^T represents the incompressibility, 
+	 * and I the Schur preconditioner (stored here, because the space was allocated either way) 
 	 *         */
-	#if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=8)
+	#if _PETSC_MINOR_>10
 	MatCreateSubMatrix(Kff,isv,isv,MAT_INITIAL_MATRIX,&A);
 	MatCreateSubMatrix(Kff,isv,isp,MAT_INITIAL_MATRIX,&B);
@@ -54,9 +99,10 @@
 	
 	/* Extract preconditioner matrix on the pressure space*/
-	#if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=8)
+	#if _PETSC_MINOR_>10
 	MatCreateSubMatrix(Kff,isp,isp,MAT_INITIAL_MATRIX,&IP);
 	#else
 	MatGetSubMatrix(Kff,isp,isp,MAT_INITIAL_MATRIX,&IP);
 	#endif
+
 
 	/* Get number of velocity / pressure nodes */
@@ -77,13 +123,14 @@
 	VecDuplicate(p,&f2);VecSet(f2,0.0);
 	VecDuplicate(uold,&tmpu);VecSet(tmpu,0.0);
+	VecDuplicate(uold,&tmpu2);VecSet(tmpu2,0.0);
+	VecDuplicate(uold,&resu);VecSet(resu,0.0);
 	VecDuplicate(p,&tmpp);VecSet(tmpp,0.0);
+	VecDuplicate(p,&tmpp2);VecSet(tmpp2,0.0);
 	VecDuplicate(p,&rhsp);VecSet(rhsp,0.0);
+	VecDuplicate(p,&resp);VecSet(resp,0.0);
 	VecDuplicate(uold,&rhsu);VecSet(rhsu,0.0);
 	VecDuplicate(p,&gold);VecSet(gold,0.0);
 	VecDuplicate(p,&wnew);VecSet(wnew,0.0);
 	VecDuplicate(uold,&chi);VecSet(chi,0.0);
-	VecDuplicate(p,&thetanew);VecSet(thetanew,0.0);
-	VecDuplicate(p,&thetaold);VecSet(thetaold,0.0);
-	VecDuplicate(p,&eta);VecSet(eta,0.0);
 	
 	/* Get global RHS (for each block sub-problem respectively)*/
@@ -104,10 +151,61 @@
 	KSPSetOperators(kspu,A,A,DIFFERENT_NONZERO_PATTERN);
 	#endif
-	KSPSetType(kspu,KSPCG);
+	if (strcmp(ksp_type,"gmres")==0){
+		KSPSetType(kspu,KSPGMRES);
+	}else if(strcmp(ksp_type,"pipegmres")==0){
+		KSPSetType(kspu,KSPPGMRES);
+	}else if(strcmp(ksp_type,"cg")==0){
+		KSPSetType(kspu,KSPCG);
+	}else if(strcmp(ksp_type,"pipecg")==0){
+		KSPSetType(kspu,KSPPIPECG);
+	}else if(strcmp(ksp_type,"bicg")==0){
+		KSPSetType(kspu,KSPBICG);
+	}else if(strcmp(ksp_type,"bicgstab")==0){
+		KSPSetType(kspu,KSPBCGS);
+	}else if(strcmp(ksp_type,"ibicgstab")==0){
+		KSPSetType(kspu,KSPIBCGS);
+	}else if(strcmp(ksp_type,"minres")==0){
+		KSPSetType(kspu,KSPMINRES);
+	}else if(strcmp(ksp_type,"cr")==0){
+		KSPSetType(kspu,KSPCR);
+	}else if(strcmp(ksp_type,"pipecr")==0){
+		KSPSetType(kspu,KSPPIPECR);
+	}else{
+		_error_("Suggested KSP method not implemented yet!\n");
+	}
+	
 	KSPSetInitialGuessNonzero(kspu,PETSC_TRUE);
-	//KSPSetTolerances(kspu,1e-12,PETSC_DEFAULT,PETSC_DEFAULT,PETSC_DEFAULT);
-	//KSPMonitorSet(kspu,KSPMonitorDefault,NULL,NULL);
+	
+	/*Strong rel. residual tolerance needed when solving for the velocity update. 
+	 * This is because ISSM uses the dimensional equations, so the initial guess chi = 0
+	 * results in a very high initial residual (~ 1e19)*/
+	KSPSetTolerances(kspu,ELLTOL,PETSC_DEFAULT,PETSC_DEFAULT,maxiter); //maxiter
+
+
+
 	KSPGetPC(kspu,&pcu);
-	PCSetType(pcu,PCSOR);
+	if (strcmp(pc_type,"bjacobi")==0){
+		PCSetType(pcu,PCBJACOBI);
+	}else if(strcmp(pc_type,"asm")==0){
+		PCSetType(pcu,PCASM);
+	}else if(strcmp(pc_type,"gamg")==0){
+		PCSetType(pcu,PCGAMG);
+	}else if(strcmp(pc_type,"gasm")==0){
+		PCSetType(pcu,PCGASM);
+	}else if(strcmp(pc_type,"jacobi")==0){
+		PCSetType(pcu,PCJACOBI);
+	}else if(strcmp(pc_type,"icc")==0){
+		PCSetType(pcu,PCICC);
+	}else if(strcmp(pc_type,"ilu")==0){
+		PCSetType(pcu,PCILU);
+	}else if(strcmp(pc_type,"sor")==0){
+		PCSetType(pcu,PCSOR);
+	}else if(strcmp(pc_type,"eisenstat")==0){
+		PCSetType(pcu,PCEISENSTAT);
+	}else if(strcmp(pc_type,"none")==0){
+		PCSetType(pcu,PCNONE);
+	}else{
+	_error_("Suggested preconditioner not implemented yet!\n");
+	}
 	KSPSetUp(kspu);
 
@@ -117,7 +215,39 @@
 	VecScale(p,-1.);MatMultAdd(B,p,f1,rhsu);VecScale(p,-1.);
 
+	if (VerboseConvergence())
+	{
+
+		VecScale(rhsu,-1.);MatMultAdd(A,uold,rhsu,tmpu);VecScale(rhsu,-1.);
+		VecNorm(tmpu,NORM_2,&tmp4);
+
+		VecScale(f2,-1.);MatMultAdd(BT,uold,f2,tmpp);VecScale(f2,-1.);
+		VecNorm(tmpp,NORM_2,&tmp6);
+
+		KSPInitialResidual(kspu,uold,tmpu,tmpu2,resu,rhsu);
+		VecNorm(resu,NORM_2,&tmp5);
+
+
+	}
+
+
 	/* Go solve Au0 = F1-Bp0*/
 	KSPSolve(kspu,rhsu,uold);
-	
+	KSPGetIterationNumber(kspu,&noIt);
+
+
+
+	if (VerboseConvergence())
+	{
+	
+	KSPGetIterationNumber(kspu,&tmpi);
+	VecScale(rhsu,-1.);MatMultAdd(A,uold,rhsu,tmpu);VecScale(rhsu,-1.);
+	VecNorm(tmpu,NORM_2,&tmp2);
+	KSPGetResidualNorm(kspu,&tmp1);
+
+	_printf0_("||Au_00 - rhsu||_euc: " << tmp4 <<"\n||P(-1)(Au_00 - rhsu)||_euc: " << tmp5 << "\n ||Au_n0 - rhsu||_euc: " << tmp2<< "\n||P(-1)(Au_n0 - rhsu)||_euc: " << tmp1 << "\nIteration number: "<<tmpi<<"\n"); 	
+	_printf0_("||BTu_00 - f2||_euc: " << tmp6 <<"\n");
+	}
+
+
 
 	/* Set up u_new */
@@ -133,30 +263,64 @@
 	
 	/* Create KSP context */
-	KSPCreate(IssmComm::GetComm(),&kspp);
+	KSPCreate(IssmComm::GetComm(),&kspip);
 	#if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=5)
-	KSPSetOperators(kspp,IP,IP);
+	KSPSetOperators(kspip,IP,IP);
 	#else
-	KSPSetOperators(kspp,IP,IP,DIFFERENT_NONZERO_PATTERN);
+	KSPSetOperators(kspip,IP,IP,DIFFERENT_NONZERO_PATTERN);
 	#endif
 	
 	/* Create RHS */
 	/* RHS = BT * uold - F2 */
-	VecScale(f2,-1.);MatMultAdd(BT,uold,f2,rhsp);VecScale(f2,-1.);
+	VecScale(uold,-1.);MatMultAdd(BT,uold,f2,rhsp);VecScale(uold,-1.);
+
 
 	/* Set KSP & PC options */
-	KSPSetType(kspp,KSPCG);
-	KSPSetInitialGuessNonzero(kspp,PETSC_TRUE);
-	KSPGetPC(kspp,&pcp);
+	KSPSetType(kspip,KSPGMRES);
+	KSPSetInitialGuessNonzero(kspip,PETSC_TRUE);
+	
+	
+	KSPGetPC(kspip,&pcp);
 	PCSetType(pcp,PCJACOBI);
-	/* Note: Systems in the pressure space are cheap, so we can afford a better tolerance */
-	KSPSetTolerances(kspp,1e-10,PETSC_DEFAULT,PETSC_DEFAULT,PETSC_DEFAULT);
-	KSPSetUp(kspp);
-	
+	/* Note: Systems in the pressure space are cheap, so we can afford a good tolerance */
+	KSPSetTolerances(kspip,1e-12,PETSC_DEFAULT,PETSC_DEFAULT,PETSC_DEFAULT);
+	KSPSetUp(kspip);
+
+	if (VerboseConvergence())
+	{
+		KSPInitialResidual(kspip,gold,tmpp,tmpp2,resp,rhsp);
+		VecScale(rhsp,-1.);MatMultAdd(IP,gold,rhsp,tmpp);VecScale(rhsp,-1.);
+		VecNorm(resp,NORM_2,&tmp5);
+		VecNorm(tmpp,NORM_2,&tmp4);
+	}
+
+
+
 	/* Go solve */
-	KSPSolve(kspp,rhsp,gold);
-	
+	KSPSolve(kspip,rhsp,gold);
+
+
+
+	if (VerboseConvergence())
+	{
+	
+	KSPGetResidualNorm(kspip,&tmp1);
+	VecScale(rhsp,-1.);MatMultAdd(IP,gold,rhsp,tmpp);VecScale(rhsp,-1.);
+	VecNorm(tmpp,NORM_2,&tmp2);
+
+	KSPGetIterationNumber(kspip,&tmpi);
+	_printf0_("||IP*g00 - rhsp||_euc: " << tmp4 <<"\n||Jac(-1)*(IP*g00-rhsp)||_euc: " << tmp5 << "\n||IP*gn0-rhsp||_euc: " << tmp2<< "\n||Jac(-1)*(IP*gn0-rhsp)||_euc: " << tmp1 << "\nIteration number: "<<tmpi<<"\n"); 	
+	}
+
+
 	/*Initial residual*/
-	VecNorm(gold,NORM_INFINITY,&initRnorm);
-	
+	MatMult(IP,gold,tmpp);VecDot(gold,tmpp,&initRnorm);
+	initRnorm = sqrt(initRnorm);
+	_printf0_("inner product norm g0: "<<initRnorm<<"\n");
+
+
+	/*Iterate only if inital residual large enough*/
+	if(initRnorm > 1e-5)
+	{
+
 	/* Further setup */
 	VecDuplicate(gold,&gnew);VecCopy(gold,gnew);
@@ -171,9 +335,4 @@
 	VecAssemblyBegin(wold);VecAssemblyEnd(wold);
 
-	/*Realizing the step size part 1: thetam */
-	/*IP * theta = BT * uold - F2*/
-	VecScale(f2,-1.);MatMultAdd(BT,uold,f2,rhsp);VecScale(f2,-1.);
-	KSPSolve(kspp,rhsp,thetaold);
-
 
 	/* Count number of iterations */
@@ -182,15 +341,46 @@
 	/* CG iteration*/
 	for(;;){
+		if(VerboseConvergence())
+		{
+		 _printf0_("\n###### Step " << count << " ######\n");
+		}
 
 		/*Realizing the step size part 2: chim */
-		/*a(chim,v) = -b(wm,v)  i.e.  A * chim = -B * wm */
+		/*a(chim,v) = b(wm,v)  i.e.  A * chim = B * wm */
 		/*chim_DIR = 0*/
-		VecScale(wold,-1.);MatMult(B,wold,rhsu);VecScale(wold,-1.);
-		KSPSolve(kspu,rhsu,chi);
-
-		/*Realizing the step size part 3: etam */
-		MatMult(BT,chi,rhsp);
-		KSPSolve(kspp,rhsp,eta);
-	
+		VecScale(wold,1.);MatMult(B,wold,rhsu);VecScale(wold,1.);
+		VecSet(chi,0.0);
+	
+		
+		if(VerboseConvergence())
+		{
+		VecScale(rhsu,-1.);MatMultAdd(A,chi,rhsu,tmpu);VecScale(rhsu,-1.);
+		VecNorm(tmpu,NORM_2,&tmp4);
+			
+		KSPInitialResidual(kspu,chi,tmpu,tmpu2,resu,rhsu);
+		VecNorm(resu,NORM_2,&tmp5);
+
+		}
+
+		
+			KSPSolve(kspu,rhsu,chi);
+		
+	
+		
+		
+		if (VerboseConvergence())
+		{
+		VecNorm(chi,NORM_2,&tmp1);
+		KSPGetResidualNorm(kspu,&tmp2);
+	
+		VecScale(rhsu,-1.);MatMultAdd(A,chi,rhsu,tmpu);VecScale(rhsu,-1.);
+		VecNorm(tmpu,NORM_2,&tmp3);
+		
+		
+		KSPGetIterationNumber(kspu,&tmpi);
+		_printf0_("||chi_nk||_euc: "<< tmp1 << "\n||A*chi_0k - rhsu||_euc: "<<tmp4<< "\n||P(-1)*(A*chi_0k-rhsu)||_euc: " << tmp5 << "\n||A*chi_nk - rhsu||_euc: "<< tmp3 <<"\n||P(-1)*(A*chi_nk - rhsu)||_euc: " << tmp2 <<"\nIteration Number: " << tmpi <<"\n");
+		}
+
+
 		/* ---------------------------------------------------------- */
 
@@ -198,6 +388,9 @@
 		/*Set step size*/
 		/*rhom = [(wm)^T * IP^-1 * (BT * um - F2)]/[(wm)^T * IP^-1 * BT * chim]*/
-		VecDot(wold,thetaold,&rho);
-		VecDot(wold,eta,&tmpScalar);
+		MatMult(IP,gold,tmpp);
+		VecDot(tmpp,wold,&rho);
+		
+		MatMult(BT,chi,tmpp);
+		VecDot(tmpp,wold,&tmpScalar);
 		rho = rho/tmpScalar;
 
@@ -207,5 +400,5 @@
 
 		/*Pressure update*/
-		/*p(m+1) = pm - rhom * wm*/
+		/*p(m+1) = pm + rhom * wm*/
 		VecAXPY(p,-1.*rho,wold);
 
@@ -213,13 +406,20 @@
 		/*Velocity update*/
 		/*u(m+1) = um - rhom * chim*/
-		VecWAXPY(unew,-1.*rho,chi,uold);
-
-
-		/* ---------------------------------------------------------- */
-
-		/*Theta update*/
-		/*IP * theta = BT * uold - F2*/
-		VecScale(f2,-1.);MatMultAdd(BT,unew,f2,rhsp);VecScale(f2,-1.);
-		KSPSolve(kspp,rhsp,thetanew);
+		VecWAXPY(unew,rho,chi,uold);
+		VecNorm(unew,NORM_2,&tmpScalar);
+
+
+		if (VerboseConvergence())
+		{
+		VecScale(p,-1.);MatMultAdd(B,p,f1,rhsu);VecScale(p,-1.);
+		VecScale(rhsu,-1.);MatMultAdd(A,unew,rhsu,tmpu);VecScale(rhsu,-1.);
+		VecNorm(tmpu,NORM_2,&tmp6);
+
+		VecScale(f2,-1);MatMultAdd(BT,unew,f2,tmpp);VecScale(f2,-1);
+		VecNorm(tmpp,NORM_2,&tmp7);
+		_printf0_("Momentum balance norm: " << tmp6 <<"\n");
+		_printf0_("Incompressibility norm: " << tmp7 <<"\n");
+		}
+
 
 
@@ -228,22 +428,37 @@
 		/*Residual update*/
 		/*g(m+1) = gm - rhom * BT * chim*/
-		VecWAXPY(gnew,-1.*rho,eta,gold);
+		MatMult(BT,chi,tmpp);
+		MatMult(IP,gold,tmpp2);
+		VecWAXPY(rhsp,-1.*rho,tmpp,tmpp2);
+		KSPSolve(kspip,rhsp,gnew);
+		
+
 
 		/* ---------------------------------------------------------- */
 
-
-		/*BREAK if norm(g(m+0),2) < TOL or pressure space has been full searched*/
-		VecNorm(gnew,NORM_INFINITY,&rnorm);
+		MatMult(IP,gnew,tmpp);
+		
+		VecDot(tmpp,gnew,&gamma);
+		rnorm = sqrt(gamma);
+
+		/*BREAK if norm(g(m+0),2) < TOL or pressure space has been fully searched*/
 		if(rnorm < TOL*initRnorm) 
+		{
+			break;
+		}else if(rnorm > 1000*initRnorm)
+		{
+		 _printf0_("L2-Norm g: "<< rnorm << "\n");
+		 _printf0_("Solver diverged and ends prematurely.\n");
 		 break;
-		else if(rnorm > 100*initRnorm)
-		 _error_("Solver diverged. This shouldn't happen\n");
-		//else
-		// PetscPrintf(PETSC_COMM_WORLD,"rel. residual at step %d: %g, at TOL = %g\n",count,rnorm/initRnorm,TOL);
-	
-
-
-
-		if(count > np-1) break;
+		}else{
+			_printf0_("L2-Norm g: "<< rnorm << "\n");
+		}
+	
+		/*Break prematurely if solver doesn't reach desired tolerance in reasonable time frame*/
+		if(count > 10./TOL)   
+		{ 
+		 _printf0_("Ended after " << ceil(5./TOL) << " CG iterations\n");
+		 break;
+		}
 	
 
@@ -252,18 +467,16 @@
 
 		/*Directional update*/
-		/*gamma = [g(m+1)^T * theta(m+1)]/[g(m)^T * thetam]*/
-		VecDot(gnew,thetanew,&gamma);
-		VecDot(gold,thetaold,&tmpScalar);
+		MatMult(IP,gold,tmpp);
+		VecDot(tmpp,gold,&tmpScalar);
 		gamma = gamma/tmpScalar;
 
-		/*w(m+1) = g(m+1) + gamma * w(m)*/
 		VecWAXPY(wnew,gamma,wold,gnew);
 
 		/* Assign new to old iterates */
-		VecCopy(wnew,wold);VecCopy(gnew,gold);VecCopy(unew,uold);VecCopy(thetanew,thetaold);
+		VecCopy(wnew,wold);VecCopy(gnew,gold);VecCopy(unew,uold);
 		
 		count++;
 	}
-
+	}
 
 	/* Restore pressure and velocity sol. vectors to its global form */
@@ -276,5 +489,5 @@
 
 	/* Cleanup */
-	KSPDestroy(&kspu);KSPDestroy(&kspp);
+	KSPDestroy(&kspu);KSPDestroy(&kspip);
 
 	MatDestroy(&A);MatDestroy(&B);MatDestroy(&BT);MatDestroy(&IP);
@@ -282,6 +495,6 @@
 	VecDestroy(&p);VecDestroy(&uold);VecDestroy(&unew);VecDestroy(&rhsu);VecDestroy(&rhsp);
 	VecDestroy(&gold);VecDestroy(&gnew);VecDestroy(&wold);VecDestroy(&wnew);VecDestroy(&chi);
-	VecDestroy(&tmpp);VecDestroy(&tmpu);VecDestroy(&f1);VecDestroy(&f2);VecDestroy(&eta);
-	VecDestroy(&thetanew);VecDestroy(&thetaold);
+	VecDestroy(&tmpp);VecDestroy(&tmpu);VecDestroy(&f1);VecDestroy(&f2);
+	VecDestroy(&tmpu2);VecDestroy(&tmpp2);VecDestroy(&resu);VecDestroy(&resp);
 
 }/*}}}*/
@@ -319,20 +532,20 @@
 	}
 
-  /* Note: SchurCG also constructs the Schur preconditioner and stores it in the free block of Kff */
-  /*			[A    B]
+  /* Note: SchurCG also constructs the Schur preconditioner and stores it in the free block of Kff 
+   *			[A    B]
 	* Kff =  |      |
 	*			[B^T IP]
    * To calculate the residual, only the necessary blocks need to be extracted */
 
-		/*Extract A, B, B^T */
-		#if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=8)
-		MatCreateSubMatrix(Kff->pmatrix->matrix,isv,isv,MAT_INITIAL_MATRIX,&A);
-		MatCreateSubMatrix(Kff->pmatrix->matrix,isv,isp,MAT_INITIAL_MATRIX,&B);
-		MatCreateSubMatrix(Kff->pmatrix->matrix,isp,isv,MAT_INITIAL_MATRIX,&BT);
-		#else
-		MatGetSubMatrix(Kff->pmatrix->matrix,isv,isv,MAT_INITIAL_MATRIX,&A);
-		MatGetSubMatrix(Kff->pmatrix->matrix,isv,isp,MAT_INITIAL_MATRIX,&B);
-		MatGetSubMatrix(Kff->pmatrix->matrix,isp,isv,MAT_INITIAL_MATRIX,&BT);
-		#endif
+	/*Extract A, B, B^T */
+	#if _PETSC_MINOR_>10
+	MatCreateSubMatrix(Kff->pmatrix->matrix,isv,isv,MAT_INITIAL_MATRIX,&A);
+	MatCreateSubMatrix(Kff->pmatrix->matrix,isv,isp,MAT_INITIAL_MATRIX,&B);
+	MatCreateSubMatrix(Kff->pmatrix->matrix,isp,isv,MAT_INITIAL_MATRIX,&BT);
+	#else
+	MatGetSubMatrix(Kff->pmatrix->matrix,isv,isv,MAT_INITIAL_MATRIX,&A);
+	MatGetSubMatrix(Kff->pmatrix->matrix,isv,isp,MAT_INITIAL_MATRIX,&B);
+	MatGetSubMatrix(Kff->pmatrix->matrix,isp,isv,MAT_INITIAL_MATRIX,&BT);
+	#endif
 	
 		/*no. of free nodes in velocity/pressure space*/
@@ -492,8 +705,8 @@
 	Vector<IssmDouble>* ys  = NULL;
 
-
 	/*parameters:*/
 	int max_nonlinear_iterations;
 	int configuration_type;
+	int precond;
 	IssmDouble eps_res,eps_rel,eps_abs;
 
@@ -508,5 +721,5 @@
 	int  count=0;
 	bool converged=false;
-
+	
 	/*Start non-linear iteration using input velocity: */
 	GetSolutionFromInputsx(&ug,femmodel);
@@ -516,5 +729,5 @@
 	InputUpdateFromConstantx(femmodel,converged,ConvergedEnum);
 	InputUpdateFromSolutionx(femmodel,ug);
-
+	
 	for(;;){
 
@@ -525,35 +738,57 @@
 		/*Get stiffness matrix and Load vector*/
 		SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel);
-		CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
+		CreateNodalConstraintsx(&ys,femmodel->nodes);
 		Reduceloadx(pf, Kfs, ys); delete Kfs;
 
-		/*Create mass matrix*/
-		StressbalanceAnalysis* analysis = new StressbalanceAnalysis();
-		/*Get complete stiffness matrix without penalties*/
-		for(int i=0;i<femmodel->elements->Size();i++){
-			Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
-			ElementMatrix* Ie = analysis->CreateSchurPrecondMatrix(element);
-			if(Ie) Ie->AddToGlobal(Kff,NULL);
-			delete Ie;
-		}
-		Kff->Assemble();
+		/*Create pressure matrix of choice*/
+		#if _PETSC_MINOR_<7
+		PetscOptionsGetInt(PETSC_NULL,"-schur_pc",&precond,NULL);
+		#else
+		PetscOptionsGetInt(NULL,PETSC_NULL,"-schur_pc",&precond,NULL);
+		#endif
+	
+		StressbalanceAnalysis* analysis = new StressbalanceAnalysis();	
+	
+		/* Construct Schur preconditioner matrix or mass matrix depending on input */
+		if(precond)
+		{
+			for(int i=0;i<femmodel->elements->Size();i++){
+				Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+				ElementMatrix* Ie = analysis->CreateSchurPrecondMatrix(element);
+				if(Ie) Ie->AddToGlobal(Kff,NULL);
+				delete Ie;
+			}
+		}else{
+			
+			for(int i=0;i<femmodel->elements->Size();i++){
+				Element* element2=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
+				ElementMatrix* Ie2 = analysis->CreatePressureMassMatrix(element2);
+				if(Ie2) Ie2->AddToGlobal(Kff,NULL);
+				delete Ie2;
+			}
+		}
+
+	   		
 		delete analysis;
-
+	
 		/*Obtain index sets for velocity and pressure components */
 		IS isv = NULL;
 		IS isp = NULL;
 		#if _PETSC_MAJOR_==3
-			/*Make indices out of doftypes: */
-			if(!(df->pvector->vector))_error_("need doftypes for FS solver!\n");
+
+		/*Make indices out of doftypes: */
+		if(!(df->pvector->vector))_error_("need doftypes for FS solver!\n");
 			DofTypesToIndexSet(&isv,&isp,df->pvector->vector,FSSolverEnum);
 		#else
 			_error_("Petsc 3.X required");
 		#endif
-
-
+		Kff->Assemble();
+
+	
 		/*Solve*/
 		femmodel->profiler->Start(SOLVER);
 		_assert_(Kff->type==PetscMatType); 
-		
+
+
 		SchurCGSolver(&uf,
 					Kff->pmatrix->matrix,
@@ -564,5 +799,4 @@
 					femmodel->parameters);
 		femmodel->profiler->Stop(SOLVER);
-	
 
 		/*Merge solution from f set to g set*/
@@ -577,4 +811,5 @@
 			converged=true;
 		}
+
 		InputUpdateFromConstantx(femmodel,converged,ConvergedEnum);
 		InputUpdateFromSolutionx(femmodel,ug);
Index: /issm/trunk/src/c/solutionsequences/solutionsequence_shakti_nonlinear.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequence_shakti_nonlinear.cpp	(revision 24312)
+++ /issm/trunk/src/c/solutionsequences/solutionsequence_shakti_nonlinear.cpp	(revision 24313)
@@ -23,5 +23,4 @@
 	/*parameters:*/
 	int max_nonlinear_iterations;
-	int configuration_type;
 	IssmDouble eps_res,eps_rel,eps_abs;
 
@@ -31,5 +30,4 @@
 	femmodel->parameters->FindParam(&eps_rel,StressbalanceReltolEnum);
 	femmodel->parameters->FindParam(&eps_abs,StressbalanceAbstolEnum);
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 	femmodel->UpdateConstraintsx();
 
@@ -41,7 +39,4 @@
 	Reducevectorgtofx(&uf, ug, femmodel->nodes,femmodel->parameters);
 
-	//Update once again the solution to make sure that vx and vxold are similar (for next step in transient or steadystate)
-	InputUpdateFromConstantx(femmodel,converged,ConvergedEnum);
-
 	for(;;){
 		/*save pointer to old solution*/
@@ -50,5 +45,5 @@
 
 		SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel);
-		CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
+		CreateNodalConstraintsx(&ys,femmodel->nodes);
 		Reduceloadx(pf, Kfs, ys); delete Kfs;
 		femmodel->profiler->Start(SOLVER);
@@ -58,5 +53,4 @@
 
 		convergence(&converged,Kff,pf,uf,old_uf,eps_res,eps_rel,eps_abs); delete Kff; delete pf; delete df;
-		InputUpdateFromConstantx(femmodel,converged,ConvergedEnum);
 		InputUpdateFromSolutionx(femmodel,ug);
 
Index: /issm/trunk/src/c/solutionsequences/solutionsequence_stokescoupling_nonlinear.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequence_stokescoupling_nonlinear.cpp	(revision 24312)
+++ /issm/trunk/src/c/solutionsequences/solutionsequence_stokescoupling_nonlinear.cpp	(revision 24313)
@@ -32,5 +32,4 @@
 	int  min_mechanical_constraints;
 	int  max_nonlinear_iterations;
-	int  configuration_type;
 	IssmDouble eps_res,eps_rel,eps_abs;
 
@@ -55,5 +54,4 @@
 		/*First stressbalance horiz:*/
 		femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
-		femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 
 		//Update once again the solution to make sure that vx and vxold are similar (for next step in transient or steadystate)
@@ -66,5 +64,5 @@
 		/*solve: */
 		SystemMatricesx(&Kff_horiz, &Kfs_horiz, &pf_horiz, &df_horiz, NULL,femmodel);
-		CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
+		CreateNodalConstraintsx(&ys,femmodel->nodes);
 		Reduceloadx(pf_horiz, Kfs_horiz, ys); delete Kfs_horiz;
 		femmodel->profiler->Start(SOLVER);
@@ -78,9 +76,8 @@
 		/*Second compute vertical velocity: */
 		femmodel->SetCurrentConfiguration(StressbalanceVerticalAnalysisEnum);
-		femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 
 		/*solve: */
 		SystemMatricesx(&Kff_vert, &Kfs_vert, &pf_vert, &df_vert,NULL,femmodel);
-		CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
+		CreateNodalConstraintsx(&ys,femmodel->nodes);
 		Reduceloadx(pf_vert, Kfs_vert, ys); delete Kfs_vert;
 		femmodel->profiler->Start(SOLVER);
Index: /issm/trunk/src/c/solutionsequences/solutionsequence_thermal_nonlinear.cpp
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequence_thermal_nonlinear.cpp	(revision 24312)
+++ /issm/trunk/src/c/solutionsequences/solutionsequence_thermal_nonlinear.cpp	(revision 24313)
@@ -33,10 +33,8 @@
 
 	/*parameters:*/
-	int  configuration_type;
 	IssmDouble eps_rel;
 
 	/*Recover parameters: */
 	femmodel->parameters->FindParam(&isenthalpy,ThermalIsenthalpyEnum);
-	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
 	femmodel->parameters->FindParam(&thermal_maxiter,ThermalMaxiterEnum);
 
@@ -56,5 +54,5 @@
 	else{
 		femmodel->parameters->FindParam(&thermal_penalty_threshold,ThermalPenaltyThresholdEnum);
-		InputUpdateFromConstantx(femmodel,true,ResetPenaltiesEnum);
+		ResetZigzagCounterx(femmodel);
 		femmodel->UpdateConstraintsx();
 	}
@@ -75,5 +73,5 @@
 		else SystemMatricesx(&Kff, &Kfs, &pf,&df, &melting_offset,femmodel);
 		delete tg;
-		CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
+		CreateNodalConstraintsx(&ys,femmodel->nodes);
 		Reduceloadx(pf, Kfs, ys); delete Kfs;
 		femmodel->profiler->Start(SOLVER);
Index: /issm/trunk/src/c/solutionsequences/solutionsequences.h
===================================================================
--- /issm/trunk/src/c/solutionsequences/solutionsequences.h	(revision 24312)
+++ /issm/trunk/src/c/solutionsequences/solutionsequences.h	(revision 24313)
@@ -15,4 +15,5 @@
 void solutionsequence_hydro_nonlinear(FemModel* femmodel);
 void solutionsequence_shakti_nonlinear(FemModel* femmodel);
+void solutionsequence_glads_nonlinear(FemModel* femmodel);
 void solutionsequence_nonlinear(FemModel* femmodel,bool conserve_loads);
 void solutionsequence_newton(FemModel* femmodel);
Index: /issm/trunk/src/c/toolkits/ToolkitOptions.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/ToolkitOptions.cpp	(revision 24312)
+++ /issm/trunk/src/c/toolkits/ToolkitOptions.cpp	(revision 24313)
@@ -23,7 +23,11 @@
 	sprintf(toolkitoptions,"%s",options);
 }/*}}}*/
+void  ToolkitOptions::Init(){ /*{{{*/
+	toolkittype    = NULL;
+	toolkitoptions = NULL;
+}/*}}}*/
 char* ToolkitOptions::GetToolkitType(){  /*{{{*/
 
-	_assert_(toolkittype); 
+	if(toolkittype==NULL) _error_("toolkittype not set (may be a mex?)");
 	char* toolkittype_out = xNew<char>(strlen(toolkittype)+1); 
 	sprintf(toolkittype_out,"%s",toolkittype);
@@ -45,5 +49,5 @@
 
 	/*First, because tokenizing destroys a string, copy what we have: */
-	_assert_(tokenlist);
+	if(tokenlist==NULL) _error_("tokenlist not set (may be a mex?)");
 	tokenlistcopy= xNew<char>(strlen(tokenlist)+1); 
 	sprintf(tokenlistcopy,"%s",tokenlist);
Index: /issm/trunk/src/c/toolkits/ToolkitOptions.h
===================================================================
--- /issm/trunk/src/c/toolkits/ToolkitOptions.h	(revision 24312)
+++ /issm/trunk/src/c/toolkits/ToolkitOptions.h	(revision 24313)
@@ -15,5 +15,6 @@
 
 	public:
-		static void Init(const char* type_in,const char* options);
+		static void  Init(const char* type_in,const char* options);
+		static void  Init(void);
 		static char* GetToolkitType(void);
 		static char* GetToolkitOptionValue(const char* option);
Index: /issm/trunk/src/c/toolkits/issm/IssmAbsVec.h
===================================================================
--- /issm/trunk/src/c/toolkits/issm/IssmAbsVec.h	(revision 24312)
+++ /issm/trunk/src/c/toolkits/issm/IssmAbsVec.h	(revision 24313)
@@ -37,4 +37,5 @@
 		virtual void GetSize(int* pM)=0;
 		virtual void GetLocalSize(int* pM)=0;
+		virtual void GetLocalVector(doubletype** pvector,int** pindices)=0;
 		virtual IssmAbsVec<doubletype>* Duplicate(void)=0;
 		virtual void Set(doubletype value)=0;
@@ -42,4 +43,5 @@
 		virtual void AYPX(IssmAbsVec* X, doubletype a)=0;
 		virtual doubletype* ToMPISerial(void)=0;
+		virtual doubletype* ToMPISerial0(void)=0;
 		virtual void Shift(doubletype shift)=0;
 		virtual void Copy(IssmAbsVec* to)=0;
Index: /issm/trunk/src/c/toolkits/issm/IssmMpiSparseMat.h
===================================================================
--- /issm/trunk/src/c/toolkits/issm/IssmMpiSparseMat.h	(revision 24312)
+++ /issm/trunk/src/c/toolkits/issm/IssmMpiSparseMat.h	(revision 24313)
@@ -150,16 +150,11 @@
 		void Assemble(){/*{{{*/
 
-			int           i,j;
-
-			int         *RowRank            = NULL;
-			int           num_procs;
-
-			int        *row_indices_forcpu = NULL;
-			int        *col_indices_forcpu = NULL;
-			int        *modes_forcpu       = NULL;
-			doubletype *values_forcpu      = NULL;
-			int         *numvalues_forcpu   = NULL;
-			DataSet     **bucketsforcpu       = NULL;
-
+			int         *RowRank = NULL;
+			int         *row_indices_forcpu  = NULL;
+			int         *col_indices_forcpu  = NULL;
+			int         *modes_forcpu        = NULL;
+			doubletype  *values_forcpu       = NULL;
+			int         *numvalues_forcpu    = NULL;
+			DataSet    **bucketsforcpu       = NULL;
 			int        **row_indices_fromcpu = NULL;
 			int        **col_indices_fromcpu = NULL;
@@ -167,28 +162,23 @@
 			doubletype **values_fromcpu      = NULL;
 			int         *numvalues_fromcpu   = NULL;
-
-			int           lower_row;
-			int           upper_row;
-			int*          sendcnts            = NULL;
-			int*          displs              = NULL;
-			int           count               = 0;
-
-			int           this_row_numvalues;
-			int*          this_row_cols       = NULL;
-			int*          this_row_mods       = NULL;
-			int*          numvalues_perrow    = NULL;
-			int           row;
-			
-			doubletype**  values_perrow       = NULL;
-			int**         cols_perrow         = NULL;
-			int**         mods_perrow         = NULL;
-			int*          counters_perrow     = NULL;
-			int           counter;
+			int          lower_row;
+			int          upper_row;
+			int         *sendcnts = NULL;
+			int         *displs   = NULL;
+			int          this_row_numvalues;
+			int         *this_row_cols       = NULL;
+			int         *this_row_mods       = NULL;
+			int         *numvalues_perrow    = NULL;
+
+			doubletype **values_perrow       = NULL;
+			int        **cols_perrow         = NULL;
+			int        **mods_perrow         = NULL;
+			int         *counters_perrow     = NULL;
 
 			/*Early exit: */
-			if(this->M*this->N==0)return; //no need to assemble.
+			if(this->M*this->N==0) return;
 
 			/*some communicator info: */
-			num_procs=IssmComm::GetSize();
+			int num_procs=IssmComm::GetSize();
 			ISSM_MPI_Comm comm=IssmComm::GetComm();
 
@@ -196,10 +186,9 @@
 			RowRank=DetermineRowRankFromLocalSize(M,m,comm);
 
-			/*Now, sort out our dataset of buckets according to cpu ownership of rows: {{{*/
+			/*Now, sort out our dataset of buckets according to cpu ownership of rows*/
 			bucketsforcpu=xNew<DataSet*>(num_procs);
-
-			for(i=0;i<num_procs;i++){
+			for(int i=0;i<num_procs;i++){
 				DataSet* bucketsofcpu_i=new DataSet();
-				for (j=0;j<buckets->Size();j++){
+				for(int j=0;j<buckets->Size();j++){
 					Bucket<doubletype>* bucket=(Bucket<doubletype>*)buckets->GetObjectByOffset(j);
 					bucket->SpawnBucketsPerCpu(bucketsofcpu_i,i,RowRank);
@@ -207,18 +196,14 @@
 				bucketsforcpu[i]=bucketsofcpu_i;
 			}
-			/*}}}*/
-
-			/*Recap, each cpu has num_procs datasets of buckets. For a certain cpu j, for a given dataset i, the buckets this  {{{
+
+			/*Recap, each cpu has num_procs datasets of buckets. For a certain cpu j, for a given dataset i, the buckets this 
 			 * dataset owns correspond to rows that are owned by cpu i, not j!. Out of all the buckets we own, make row,col,value,insert_mode 
 			 * vectors that will be shipped around the cluster: */
 			this->BucketsBuildScatterBuffers(&numvalues_forcpu,&row_indices_forcpu,&col_indices_forcpu,&values_forcpu,&modes_forcpu,bucketsforcpu,num_procs);
-			/*}}}*/
-
-			/*Now, we need to allocate on each cpu arrays to receive data from all the other cpus. To know what we need to allocate, we need  {{{
+
+			/*Now, we need to allocate on each cpu arrays to receive data from all the other cpus. To know what we need to allocate, we need 
 			 *some scatter calls: */
 			numvalues_fromcpu   = xNew<int>(num_procs);
-			for(i=0;i<num_procs;i++){
-				ISSM_MPI_Scatter(numvalues_forcpu,1,ISSM_MPI_INT,numvalues_fromcpu+i,1,ISSM_MPI_INT,i,comm);
-			}
+			for(int i=0;i<num_procs;i++) ISSM_MPI_Scatter(numvalues_forcpu,1,ISSM_MPI_INT,numvalues_fromcpu+i,1,ISSM_MPI_INT,i,comm);
 
 			row_indices_fromcpu=xNew<int*>(num_procs);
@@ -226,5 +211,5 @@
 			values_fromcpu=xNew<doubletype*>(num_procs);
 			modes_fromcpu=xNew<int*>(num_procs);
-			for(i=0;i<num_procs;i++){
+			for(int i=0;i<num_procs;i++){
 				int size=numvalues_fromcpu[i];
 				if(size){
@@ -238,17 +223,15 @@
 					values_fromcpu[i]=xNew<doubletype>(size);
 #endif
-
 					modes_fromcpu[i]=xNew<int>(size);
 				}
 				else{
-					row_indices_fromcpu[i]=NULL;
-					col_indices_fromcpu[i]=NULL;
-					values_fromcpu[i]=NULL;
-					modes_fromcpu[i]=NULL;
-				}
-			}
-			/*}}}*/
-
-			/*Scatter values around: {{{*/
+					row_indices_fromcpu[i] = NULL;
+					col_indices_fromcpu[i] = NULL;
+					values_fromcpu[i]      = NULL;
+					modes_fromcpu[i]       = NULL;
+				}
+			}
+
+			/*Scatter values around*/
 			/*Now, to scatter values across the cluster, we need sendcnts and displs. Our sendbufs have been built by BucketsBuildScatterBuffers, with a stride given 
 			 * by numvalues_forcpu. Get this ready to go before starting the scatter itslef. For reference, here is the ISSM_MPI_Scatterv prototype: 
@@ -256,6 +239,6 @@
 			sendcnts=xNew<int>(num_procs);
 			displs=xNew<int>(num_procs);
-			count=0;
-			for(i=0;i<num_procs;i++){
+			int count=0;
+			for(int i=0;i<num_procs;i++){
 				sendcnts[i]=numvalues_forcpu[i];
 				displs[i]=count;
@@ -263,5 +246,5 @@
 			}
 
-			for(i=0;i<num_procs;i++){
+			for(int i=0;i<num_procs;i++){
 				ISSM_MPI_Scatterv( row_indices_forcpu, sendcnts, displs, ISSM_MPI_INT, row_indices_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_INT, i, comm);
 				ISSM_MPI_Scatterv( col_indices_forcpu, sendcnts, displs, ISSM_MPI_INT, col_indices_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_INT, i, comm);
@@ -269,15 +252,14 @@
 				ISSM_MPI_Scatterv( modes_forcpu, sendcnts, displs, ISSM_MPI_INT, modes_fromcpu[i], numvalues_fromcpu[i], ISSM_MPI_INT, i, comm);
 			}
-			/*}}}*/
-
-			/*Plug values into global matrix. To do so, we are going to first figure out how many overall values each sparse row is going to get, then we fill up these values, and give it to each sparse row: {{{*/
+
+			/*Plug values into global matrix. To do so, we are going to first figure out how many overall values each sparse row is going to get, then we fill up these values, and give it to each sparse row*/
 			GetOwnershipBoundariesFromRange(&lower_row,&upper_row,m,comm);
 
 			/*Figure out how many values each row is going to get: */
 			numvalues_perrow=xNewZeroInit<int>(this->m);
-			for(i=0;i<num_procs;i++){ 
+			for(int i=0;i<num_procs;i++){ 
 				int  numvalues=numvalues_fromcpu[i];
 				int* rows=row_indices_fromcpu[i];
-				for(j=0;j<numvalues;j++)numvalues_perrow[rows[j]-lower_row]++;
+				for(int j=0;j<numvalues;j++)numvalues_perrow[rows[j]-lower_row]++;
 			}
 
@@ -288,5 +270,5 @@
 			counters_perrow=xNewZeroInit<int>(this->m);
 
-			for(i=0;i<this->m;i++){
+			for(int i=0;i<this->m;i++){
 				values_perrow[i]=xNewZeroInit<doubletype>(numvalues_perrow[i]);
 				cols_perrow[i]=xNewZeroInit<int>(numvalues_perrow[i]);
@@ -295,5 +277,5 @@
 
 			/*collect:*/
-			for(i=0;i<num_procs;i++){
+			for(int i=0;i<num_procs;i++){
 				int  numvalues=numvalues_fromcpu[i];
 				int* rows=row_indices_fromcpu[i];
@@ -301,8 +283,7 @@
 				doubletype* values=values_fromcpu[i];
 				int* mods=modes_fromcpu[i];
-
-				for(j=0;j<numvalues;j++){
-					row=rows[j]-lower_row;
-					counter=counters_perrow[row];
+				for(int j=0;j<numvalues;j++){
+					int row=rows[j]-lower_row;
+					int counter=counters_perrow[row];
 					values_perrow[row][counter]=values[j];
 					cols_perrow[row][counter]=cols[j];
@@ -313,10 +294,7 @@
 					
 			/*Plug into matrix: */
-			for(i=0;i<this->m;i++){
-				this->matrix[i]->SetValues(numvalues_perrow[i],cols_perrow[i],values_perrow[i],mods_perrow[i]);
-			}
-			/*}}}*/
-
-			/*Free ressources:{{{*/
+			for(int i=0;i<this->m;i++) this->matrix[i]->SetValues(numvalues_perrow[i],cols_perrow[i],values_perrow[i],mods_perrow[i]);
+
+			/*Free ressources*/
 			xDelete<int>(numvalues_perrow);
 			xDelete<int>(RowRank);
@@ -326,17 +304,14 @@
 			xDelete<doubletype>(values_forcpu);
 			xDelete<int>(numvalues_forcpu);
-
-			for(i=0;i<num_procs;i++){
+			for(int i=0;i<num_procs;i++){
 				DataSet* buckets=bucketsforcpu[i];
 				delete buckets;
 			}
 			xDelete<DataSet*>(bucketsforcpu);
-
-			for(i=0;i<num_procs;i++){
+			for(int i=0;i<num_procs;i++){
 				int* rows=row_indices_fromcpu[i];
 				int* cols=col_indices_fromcpu[i];
 				int* modes=modes_fromcpu[i];
 				doubletype* values=values_fromcpu[i];
-
 				xDelete<int>(rows);
 				xDelete<int>(cols);
@@ -349,9 +324,7 @@
 			xDelete<doubletype*>(values_fromcpu);
 			xDelete<int>(numvalues_fromcpu);
-
 			xDelete<int>(sendcnts);
 			xDelete<int>(displs);
-			
-			for(i=0;i<this->m;i++){
+			for(int i=0;i<this->m;i++){
 				doubletype* values=values_perrow[i]; xDelete<doubletype>(values);
 				int* cols=cols_perrow[i]; xDelete<int>(cols);
@@ -362,8 +335,5 @@
 			xDelete<int*>(cols_perrow);
 			xDelete<int*>(mods_perrow);
-			/*}}}*/
-
-		}
-		/*}}}*/
+		}/*}}}*/
 		doubletype Norm(NormMode mode){/*{{{*/
 
@@ -458,7 +428,5 @@
 
 			/*intermediary: */
-			int         i,j;
-			int         count                   = 0;
-			int         total_size              = 0;
+			int         count;
 			int        *temp_row_indices_forcpu = NULL;
 			int        *temp_col_indices_forcpu = NULL;
@@ -476,13 +444,11 @@
 
 			numvalues_forcpu=xNew<int>(num_procs);
-			for(i=0;i<num_procs;i++){
-				DataSet    *buckets            = bucketsforcpu[i];
-
+			for(int i=0;i<num_procs;i++){
+				DataSet    *buckets = bucketsforcpu[i];
 				count=0;
-				for(j=0;j<buckets->Size();j++){
+				for(int j=0;j<buckets->Size();j++){
 					Bucket<doubletype>* bucket =(Bucket<doubletype>*)buckets->GetObjectByOffset(j);
 					count+=bucket->MarshallSize();
 				}
-
 				numvalues_forcpu[i]=count;
 			}
@@ -490,8 +456,6 @@
 			/*now, figure out size of  total buffers (for all cpus!): */
 			count=0;
-			for(i=0;i<num_procs;i++){
-				count+=numvalues_forcpu[i];
-			}
-			total_size=count;
+			for(int i=0;i<num_procs;i++) count+=numvalues_forcpu[i];
+			int total_size=count;
 
 			/*Allocate buffers: */
@@ -505,5 +469,4 @@
 			values_forcpu = xNew<doubletype>(total_size);
 #endif
-
 			modes_forcpu = xNew<int>(total_size);
 
@@ -511,13 +474,13 @@
 			 *lose track of where these buffers are located in memory, we are going to work using copies 
 			 of them: */
-			temp_row_indices_forcpu=row_indices_forcpu;
-			temp_col_indices_forcpu=col_indices_forcpu;
-			temp_values_forcpu=values_forcpu;
-			temp_modes_forcpu=modes_forcpu;
+			temp_row_indices_forcpu = row_indices_forcpu;
+			temp_col_indices_forcpu = col_indices_forcpu;
+			temp_values_forcpu      = values_forcpu;
+			temp_modes_forcpu       = modes_forcpu;
 
 			/*Fill buffers: */
-			for(i=0;i<num_procs;i++){
-				DataSet    *buckets            = bucketsforcpu[i];
-				for(j=0;j<buckets->Size();j++){
+			for(int i=0;i<num_procs;i++){
+				DataSet *buckets = bucketsforcpu[i];
+				for(int j=0;j<buckets->Size();j++){
 					Bucket<doubletype>* bucket =(Bucket<doubletype>*)buckets->GetObjectByOffset(j);
 					bucket->Marshall(&temp_row_indices_forcpu,&temp_col_indices_forcpu,&temp_values_forcpu,&temp_modes_forcpu); //pass in the address of the buffers, so as to have the Marshall routine increment them.
@@ -526,8 +489,8 @@
 
 			/*sanity check: */
-			if (temp_row_indices_forcpu!=row_indices_forcpu+total_size)_error_("problem with marshalling of buckets");
-			if (temp_col_indices_forcpu!=col_indices_forcpu+total_size)_error_("problem with marshalling of buckets");
-			if (temp_values_forcpu!=values_forcpu+total_size)_error_("problem with marshalling of buckets");
-			if (temp_modes_forcpu!=modes_forcpu+total_size)_error_("problem with marshalling of buckets");
+			if(temp_row_indices_forcpu!=row_indices_forcpu+total_size)_error_("problem with marshalling of buckets");
+			if(temp_col_indices_forcpu!=col_indices_forcpu+total_size)_error_("problem with marshalling of buckets");
+			if(temp_values_forcpu!=values_forcpu+total_size)_error_("problem with marshalling of buckets");
+			if(temp_modes_forcpu!=modes_forcpu+total_size)_error_("problem with marshalling of buckets");
 
 			/*output buffers: */
Index: /issm/trunk/src/c/toolkits/issm/IssmMpiVec.h
===================================================================
--- /issm/trunk/src/c/toolkits/issm/IssmMpiVec.h	(revision 24312)
+++ /issm/trunk/src/c/toolkits/issm/IssmMpiVec.h	(revision 24313)
@@ -337,4 +337,39 @@
 		}
 		/*}}}*/
+		void GetLocalVector(doubletype** pvector,int** pindices){/*{{{*/
+
+			/*First, check that vector size is not 0*/
+			int vector_size;
+			this->GetSize(&vector_size);
+			if(vector_size==0){
+				*pvector=NULL;
+				*pindices=NULL;
+				return;
+			}
+
+			/*Get Ownership range*/
+			int lower_row,upper_row; 
+			GetOwnershipBoundariesFromRange(&lower_row,&upper_row,m,IssmComm::GetComm());
+			int range=upper_row-lower_row;    
+
+			/*return NULL if no range*/
+			if(range==0){
+				*pvector=NULL;
+				*pindices=NULL;
+				return;
+			}
+
+			/*Build indices*/
+			int* indices=xNew<int>(range); 
+			for(int i=0;i<range;i++) indices[i]=lower_row+i;
+
+			/*Get vector*/
+			_assert_(range==this->m);
+			doubletype* values =xNew<doubletype>(range);
+			xMemCpy<doubletype>(values,this->vector,this->m);
+
+			*pvector  = values;
+			*pindices = indices;
+		} /*}}}*/
 		IssmMpiVec<doubletype>* Duplicate(void){/*{{{*/
 
@@ -425,4 +460,11 @@
 			/*return: */
 			return buffer;
+
+		}
+		/*}}}*/
+		doubletype* ToMPISerial0(void){/*{{{*/
+
+			/*FIXME: Should not broadcast to every cpu*/
+			return this->ToMPISerial();
 
 		}
Index: /issm/trunk/src/c/toolkits/issm/IssmSeqVec.h
===================================================================
--- /issm/trunk/src/c/toolkits/issm/IssmSeqVec.h	(revision 24312)
+++ /issm/trunk/src/c/toolkits/issm/IssmSeqVec.h	(revision 24313)
@@ -141,9 +141,28 @@
 		/*}}}*/
 		void GetLocalSize(int* pM){/*{{{*/
-
 			*pM=this->M;
-
-		}
-		/*}}}*/
+		}/*}}}*/
+		void GetLocalVector(doubletype** pvector,int** pindices){/*{{{*/
+
+			/*First, check that vector size is not 0*/
+			int vector_size;
+			this->GetSize(&vector_size);
+			if(vector_size==0){
+				*pvector=NULL;
+				*pindices=NULL;
+				return;
+			}
+
+			/*Build indices*/
+			int* indices=xNew<int>(vector_size); 
+			for(int i=0;i<vector_size;i++) indices[i]=i;
+
+			/*Get vector*/
+			doubletype* values =xNew<doubletype>(vector_size);
+			xMemCpy<doubletype>(values,this->vector,vector_size);
+
+			*pvector  = values;
+			*pindices = indices;
+		} /*}}}*/
 		IssmSeqVec<doubletype>* Duplicate(void){/*{{{*/
 
@@ -196,4 +215,10 @@
 			}
 			return buffer;
+
+		}
+		/*}}}*/
+		doubletype* ToMPISerial0(void){/*{{{*/
+
+			return this->ToMPISerial();
 
 		}
Index: /issm/trunk/src/c/toolkits/issm/IssmVec.h
===================================================================
--- /issm/trunk/src/c/toolkits/issm/IssmVec.h	(revision 24312)
+++ /issm/trunk/src/c/toolkits/issm/IssmVec.h	(revision 24313)
@@ -153,4 +153,7 @@
 		}
 		/*}}}*/
+		void GetLocalVector(doubletype** pvector,int** pindices){/*{{{*/
+			vector->GetLocalVector(pvector,pindices);
+		} /*}}}*/
 		IssmVec<doubletype>* Duplicate(void){/*{{{*/
 
@@ -180,4 +183,8 @@
 		}
 		/*}}}*/
+		doubletype* ToMPISerial0(void){/*{{{*/
+			return vector->ToMPISerial0();
+		}
+		/*}}}*/
 		void Shift(doubletype shift){/*{{{*/
 			vector->Shift(shift);
Index: /issm/trunk/src/c/toolkits/mpi/issmmpi.h
===================================================================
--- /issm/trunk/src/c/toolkits/mpi/issmmpi.h	(revision 24312)
+++ /issm/trunk/src/c/toolkits/mpi/issmmpi.h	(revision 24313)
@@ -25,6 +25,6 @@
 			#include "medi/medi.hpp"
 			using namespace medi;
-			#include "medi/codiMediPackTypes.hpp"
 			#if defined(_HAVE_CODIPACK_)
+			#include "codi/externals/codiMediPackTypes.hpp"
 			#define TOOL CoDiPackTool<IssmDouble>
 			#define AMPI_ADOUBLE TOOL::MPI_TYPE
@@ -61,8 +61,9 @@
 
 	#if defined(_HAVE_MEDIPACK_) && !defined(_WRAPPERS_)
-	#define ISSM_MPI_CHAR       AMPI_CHAR
-	#define ISSM_MPI_DOUBLE     AMPI_ADOUBLE // corresponds to IssmDouble
-	#define ISSM_MPI_PDOUBLE    AMPI_DOUBLE  // corresponds to IssmPDouble
-	#define ISSM_MPI_INT        AMPI_INT
+	#define ISSM_MPI_CHAR          AMPI_CHAR
+	#define ISSM_MPI_DOUBLE        AMPI_ADOUBLE // corresponds to IssmDouble
+	#define ISSM_MPI_PDOUBLE       AMPI_DOUBLE  // corresponds to IssmPDouble
+	#define ISSM_MPI_INT           AMPI_INT
+	#define ISSM_MPI_LONG_LONG_INT AMPI_LONG_LONG_INT
 	
 	// operations
@@ -84,7 +85,8 @@
 			#define ISSM_MPI_DOUBLE    MPI_DOUBLE
 		#endif
-		#define ISSM_MPI_PDOUBLE    MPI_DOUBLE
-		#define ISSM_MPI_INT        MPI_INT
-		#define ISSM_MPI_CHAR       MPI_CHAR
+		#define ISSM_MPI_PDOUBLE        MPI_DOUBLE
+		#define ISSM_MPI_INT            MPI_INT
+		#define ISSM_MPI_LONG_LONG_INT  MPI_LONG_LONG_INT
+		#define ISSM_MPI_CHAR           MPI_CHAR
 
 		// operations
@@ -113,8 +115,9 @@
 
 	// data types
-	#define ISSM_MPI_CHAR       1
-	#define ISSM_MPI_DOUBLE     2
-	#define ISSM_MPI_PDOUBLE    3
-	#define ISSM_MPI_INT        4
+	#define ISSM_MPI_CHAR          1
+	#define ISSM_MPI_DOUBLE        2
+	#define ISSM_MPI_PDOUBLE       3
+	#define ISSM_MPI_INT           4
+	#define ISSM_MPI_LONG_LONG_INT 5
 
 	// operations
Index: /issm/trunk/src/c/toolkits/objects/Vector.h
===================================================================
--- /issm/trunk/src/c/toolkits/objects/Vector.h	(revision 24312)
+++ /issm/trunk/src/c/toolkits/objects/Vector.h	(revision 24313)
@@ -217,4 +217,15 @@
 		}
 		/*}}}*/
+		void GetLocalVector(doubletype** pvector,int** pindices){_assert_(this);/*{{{*/
+
+			if(type==PetscVecType){
+				#ifdef _HAVE_PETSC_
+				this->pvector->GetLocalVector(pvector,pindices);
+				#endif
+			}
+			else this->ivector->GetLocalVector(pvector,pindices);
+
+		}
+		/*}}}*/
 		Vector<doubletype>* Duplicate(void){_assert_(this);/*{{{*/
 
@@ -231,7 +242,5 @@
 
 			return output;
-
-		}
-		/*}}}*/
+		} /*}}}*/
 		void Set(doubletype value){_assert_(this);/*{{{*/
 
@@ -277,4 +286,20 @@
 			}
 			else vec_serial=this->ivector->ToMPISerial();
+
+			return vec_serial;
+
+		}
+		/*}}}*/
+		doubletype* ToMPISerial0(void){/*{{{*/
+
+			doubletype* vec_serial=NULL;
+
+			_assert_(this);
+			if(type==PetscVecType){
+				#ifdef _HAVE_PETSC_
+				vec_serial=this->pvector->ToMPISerial0();
+				#endif
+			}
+			else vec_serial=this->ivector->ToMPISerial0();
 
 			return vec_serial;
Index: /issm/trunk/src/c/toolkits/petsc/objects/PetscVec.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 24312)
+++ /issm/trunk/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 24313)
@@ -83,5 +83,5 @@
 
 	_assert_(this->vector);
-	VecAssemblyBegin(this->vector); 
+	VecAssemblyBegin(this->vector);
 	VecAssemblyEnd(this->vector);
 
@@ -113,14 +113,47 @@
 	_assert_(this->vector);
 	VecGetSize(this->vector,pM);
-
-}
-/*}}}*/
-void PetscVec::GetLocalSize(int* pM){/*{{{*/
-
-	_assert_(this->vector);
-	VecGetLocalSize(this->vector,pM);
-
-}
-/*}}}*/
+}
+/*}}}*/
+void PetscVec::GetLocalSize(int* pm){/*{{{*/
+
+	_assert_(this->vector);
+	VecGetLocalSize(this->vector,pm);
+}
+/*}}}*/
+void PetscVec::GetLocalVector(IssmDouble** pvector,int** pindices){/*{{{*/
+
+	_assert_(this->vector);
+
+	/*First, check that vector size is not 0*/
+	int vector_size;
+	this->GetSize(&vector_size);
+	if(vector_size==0){
+		*pvector=NULL;
+		*pindices=NULL;
+		return;
+	}
+
+	/*Get Ownership range*/
+	PetscInt lower_row,upper_row;
+	VecGetOwnershipRange(this->vector,&lower_row,&upper_row);
+	int range=upper_row-lower_row;
+
+	/*return NULL if no range*/
+	if(range==0){
+		*pvector=NULL;
+		*pindices=NULL;
+		return;
+	}
+
+	/*Build indices*/
+	int* indices=xNew<int>(range);
+	for(int i=0;i<range;i++) indices[i]=lower_row+i;
+	/*Get vector*/
+	IssmDouble* values =xNew<IssmDouble>(range);
+	VecGetValues(this->vector,range,indices,values);
+
+	*pvector  = values;
+	*pindices = indices;
+} /*}}}*/
 PetscVec* PetscVec::Duplicate(void){/*{{{*/
 
@@ -158,5 +191,13 @@
 
 	IssmDouble* vec_serial=NULL;
-	VecToMPISerial(&vec_serial, this->vector,IssmComm::GetComm());
+	VecToMPISerial(&vec_serial, this->vector,IssmComm::GetComm(),true);
+	return vec_serial;
+
+}
+/*}}}*/
+IssmDouble* PetscVec::ToMPISerial0(void){/*{{{*/
+
+	IssmDouble* vec_serial=NULL;
+	VecToMPISerial(&vec_serial, this->vector,IssmComm::GetComm(),false);
 	return vec_serial;
 
@@ -197,5 +238,12 @@
 
 	_assert_(this->vector);
-	VecScale(this->vector,scale_factor); 
+	VecScale(this->vector,scale_factor);
+
+}
+/*}}}*/
+void PetscVec::Pow(IssmDouble scale_factor){/*{{{*/
+
+	_assert_(this->vector);
+	VecPow(this->vector,scale_factor);
 
 }
@@ -217,2 +265,9 @@
 }
 /*}}}*/
+void PetscVec::PointwiseMult(PetscVec* x,PetscVec* y){/*{{{*/
+
+	_assert_(this->vector);
+	VecPointwiseMult(this->vector,x->vector,y->vector);
+
+}
+/*}}}*/
Index: /issm/trunk/src/c/toolkits/petsc/objects/PetscVec.h
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/objects/PetscVec.h	(revision 24312)
+++ /issm/trunk/src/c/toolkits/petsc/objects/PetscVec.h	(revision 24313)
@@ -1,7 +1,7 @@
 /*!\file:  PetscVec.h
- * \brief wrapper to our own PetscVec object, which is needed to add AD capabilities (using ADOLC) 
- * to a C-coded Petsc API. We are just wrapping the Petsc objects into C++ equivalent, so that 
+ * \brief wrapper to our own PetscVec object, which is needed to add AD capabilities (using ADOLC)
+ * to a C-coded Petsc API. We are just wrapping the Petsc objects into C++ equivalent, so that
  * later, we can map all of the Petsc routines into Adolc equivalents.
- */ 
+ */
 
 #ifndef _PETSCVEC_H_
@@ -45,4 +45,5 @@
 		void        GetSize(int* pM);
 		void        GetLocalSize(int* pM);
+		void        GetLocalVector(IssmDouble** pvector,int** pindices);
 		PetscVec*   Duplicate(void);
 		void        Set(IssmDouble value);
@@ -50,4 +51,5 @@
 		void        AYPX(PetscVec* X, IssmDouble a);
 		IssmDouble* ToMPISerial(void);
+		IssmDouble* ToMPISerial0(void);
 		void        Shift(IssmDouble shift);
 		void        Copy(PetscVec* to);
@@ -55,5 +57,7 @@
 		IssmDouble  Max(void);
 		void        Scale(IssmDouble scale_factor);
+		void        Pow(IssmDouble scale_factor);
 		void        PointwiseDivide(PetscVec* x,PetscVec* y);
+		void        PointwiseMult(PetscVec* x,PetscVec* y);
 		IssmDouble  Dot(PetscVec* vector);
 };
Index: sm/trunk/src/c/toolkits/petsc/patches/VecMerge.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/VecMerge.cpp	(revision 24312)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*!\file:  VecMerge.cpp
- * \brief merge vector B into A using partitioning vector A(row_partition_vector)=B;
- */ 
-
-#ifdef HAVE_CONFIG_H
-	#include <config.h>
-#else
-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
-#endif
-
-/*Petsc includes: */
-#include <petscmat.h>
-#include <petscvec.h>
-#include <petscksp.h>
-
-#include "./petscpatches.h"
-
-#include "../../../shared/shared.h"
-
-void VecMerge(Vec A, Vec B, double* row_partition_vector,int row_partition_size){
-
-	/*Petsc matrix*/
-	int lower_row,upper_row,range;
-	int* idxm=NULL;
-	double* values=NULL;
-
-	/*Vector sizes: */
-	int MB;
-
-	VecGetSize(B,&MB);
-
-	/*If the dimension of the partitioning vector is not the same as that of vector B, we have a problem: */
-	if ((row_partition_size !=MB) ){
-		_error_("Dimensions of partitioning vector incompatible with dimensions of input vector\n");
-	}
-
-	/*Get values from vector B and plug them into vector A, using the partitioning vector*/
-	VecGetOwnershipRange(B,&lower_row,&upper_row);
-	upper_row--;
-	range=upper_row-lower_row+1;
-
-	if (range){
-		/*This node owns rows of vector B, get them*/
-		idxm=xNew<int>(range);
-		values=xNew<double>(range);
-		for(int i=0;i<range;i++){
-			idxm[i]=lower_row+i;
-		}
-		VecGetValues(B,range,idxm,values);
-		/*Now, modify idxm using the partition vector, and plug values into A*/
-		for(int i=0;i<range;i++){
-			idxm[i]=int(row_partition_vector[lower_row+i])-1; //-1 because partition vector comes from Matlab, where indices start at 1.
-		}
-		VecSetValues(A,range,idxm,values,INSERT_VALUES);
-	}
-
-	/*Assemble vector*/
-	VecAssemblyBegin(A);
-	VecAssemblyEnd(A);
-
-	/*Free ressources:*/
-	xDelete<int>(idxm);
-	xDelete<double>(values);
-}
Index: /issm/trunk/src/c/toolkits/petsc/patches/VecToMPISerial.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/VecToMPISerial.cpp	(revision 24312)
+++ /issm/trunk/src/c/toolkits/petsc/patches/VecToMPISerial.cpp	(revision 24313)
@@ -12,5 +12,5 @@
 #include "../../../shared/shared.h"
 
-int VecToMPISerial(double** pgathered_vector, Vec vector,ISSM_MPI_Comm comm){
+int VecToMPISerial(double** pgathered_vector, Vec vector,ISSM_MPI_Comm comm,bool broadcast){
 
 	int i;
@@ -45,5 +45,7 @@
 
 	/*Allocate gathered vector on all nodes .*/
-	gathered_vector=xNew<double>(vector_size);
+	if(broadcast || my_rank==0){ 
+		gathered_vector=xNew<double>(vector_size);
+	}
 
 	/*Allocate local vectors*/
@@ -83,6 +85,8 @@
 	}
 
-	/*Now, broadcast gathered_vector from node 0 to other nodes: */
-	ISSM_MPI_Bcast(gathered_vector,vector_size,ISSM_MPI_PDOUBLE,0,comm);
+	if(broadcast){
+		/*Now, broadcast gathered_vector from node 0 to other nodes: */
+		ISSM_MPI_Bcast(gathered_vector,vector_size,ISSM_MPI_PDOUBLE,0,comm);
+	}
 
 	/*Assign output pointers: */
Index: /issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h	(revision 24312)
+++ /issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h	(revision 24313)
@@ -22,5 +22,5 @@
 Mat NewMat(int M,int N,int connectivity,int numberofdofspernode, ISSM_MPI_Comm comm);
 
-int VecToMPISerial(double** pgathered_vector, Vec vector,ISSM_MPI_Comm comm);
+int VecToMPISerial(double** pgathered_vector, Vec vector,ISSM_MPI_Comm comm,bool broadcast=true);
 void MatFree(Mat* pmat);
 void ISFree(IS* pis);
@@ -30,5 +30,4 @@
 		double* col_partition_vector,int col_partition_vector_size);
 void PetscOptionsDetermineSolverType(int* psolver_type);
-void VecMerge(Vec A, Vec B, double* row_partition_vector,int row_partition_size);
 void MatMultPatch(Mat A,Vec X, Vec AX,ISSM_MPI_Comm comm);
 void MatToSerial(double** poutmatrix,Mat matrix,ISSM_MPI_Comm comm);
Index: /issm/trunk/src/dox/issm.dox
===================================================================
--- /issm/trunk/src/dox/issm.dox	(revision 24312)
+++ /issm/trunk/src/dox/issm.dox	(revision 24313)
@@ -47,26 +47,26 @@
 </th>
 <tr>
-<th  bgcolor=#FFFFFF style="text-align:left;"> C++ </th><td  bgcolor=#FFFFFF style="text-align:right;">507</td><td  bgcolor=#FFFFFF style="text-align:right;">21317</td><td  bgcolor=#FFFFFF style="text-align:right;">21788</td><td  bgcolor=#FFFFFF style="text-align:right;">99398</td><td  bgcolor=#FFFFFF style="text-align:right;">142503</td>
+<th  bgcolor=#FFFFFF style="text-align:left;"> C++ </th><td  bgcolor=#FFFFFF style="text-align:right;">496</td><td  bgcolor=#FFFFFF style="text-align:right;">20972</td><td  bgcolor=#FFFFFF style="text-align:right;">21438</td><td  bgcolor=#FFFFFF style="text-align:right;">100023</td><td  bgcolor=#FFFFFF style="text-align:right;">142433</td>
 </tr>
 <tr>
-<th  bgcolor=#C6E2FF style="text-align:left;"> MATLAB </th><td  bgcolor=#C6E2FF style="text-align:right;">875</td><td  bgcolor=#C6E2FF style="text-align:right;">9048</td><td  bgcolor=#C6E2FF style="text-align:right;">13309</td><td  bgcolor=#C6E2FF style="text-align:right;">57616</td><td  bgcolor=#C6E2FF style="text-align:right;">79973</td>
+<th  bgcolor=#C6E2FF style="text-align:left;"> MATLAB </th><td  bgcolor=#C6E2FF style="text-align:right;">939</td><td  bgcolor=#C6E2FF style="text-align:right;">9662</td><td  bgcolor=#C6E2FF style="text-align:right;">14183</td><td  bgcolor=#C6E2FF style="text-align:right;">61403</td><td  bgcolor=#C6E2FF style="text-align:right;">85248</td>
 </tr>
 <tr>
-<th  bgcolor=#FFFFFF style="text-align:left;"> Python </th><td  bgcolor=#FFFFFF style="text-align:right;">391</td><td  bgcolor=#FFFFFF style="text-align:right;">6083</td><td  bgcolor=#FFFFFF style="text-align:right;">6973</td><td  bgcolor=#FFFFFF style="text-align:right;">36762</td><td  bgcolor=#FFFFFF style="text-align:right;">49818</td>
+<th  bgcolor=#FFFFFF style="text-align:left;"> Python </th><td  bgcolor=#FFFFFF style="text-align:right;">279</td><td  bgcolor=#FFFFFF style="text-align:right;">4846</td><td  bgcolor=#FFFFFF style="text-align:right;">5001</td><td  bgcolor=#FFFFFF style="text-align:right;">31024</td><td  bgcolor=#FFFFFF style="text-align:right;">40871</td>
 </tr>
 <tr>
-<th  bgcolor=#C6E2FF style="text-align:left;"> C/C++  Header </th><td  bgcolor=#C6E2FF style="text-align:right;">432</td><td  bgcolor=#C6E2FF style="text-align:right;">3718</td><td  bgcolor=#C6E2FF style="text-align:right;">3851</td><td  bgcolor=#C6E2FF style="text-align:right;">17527</td><td  bgcolor=#C6E2FF style="text-align:right;">25096</td>
+<th  bgcolor=#C6E2FF style="text-align:left;"> Javascript </th><td  bgcolor=#C6E2FF style="text-align:right;">108</td><td  bgcolor=#C6E2FF style="text-align:right;">4266</td><td  bgcolor=#C6E2FF style="text-align:right;">7777</td><td  bgcolor=#C6E2FF style="text-align:right;">24886</td><td  bgcolor=#C6E2FF style="text-align:right;">36929</td>
 </tr>
 <tr>
-<th  bgcolor=#FFFFFF style="text-align:left;"> m4 </th><td  bgcolor=#FFFFFF style="text-align:right;">8</td><td  bgcolor=#FFFFFF style="text-align:right;">1487</td><td  bgcolor=#FFFFFF style="text-align:right;">153</td><td  bgcolor=#FFFFFF style="text-align:right;">10086</td><td  bgcolor=#FFFFFF style="text-align:right;">11726</td>
+<th  bgcolor=#FFFFFF style="text-align:left;"> C/C++  Header </th><td  bgcolor=#FFFFFF style="text-align:right;">433</td><td  bgcolor=#FFFFFF style="text-align:right;">3716</td><td  bgcolor=#FFFFFF style="text-align:right;">3843</td><td  bgcolor=#FFFFFF style="text-align:right;">17815</td><td  bgcolor=#FFFFFF style="text-align:right;">25374</td>
 </tr>
 <tr>
-<th  bgcolor=#C6E2FF style="text-align:left;"> Javascript </th><td  bgcolor=#C6E2FF style="text-align:right;">104</td><td  bgcolor=#C6E2FF style="text-align:right;">1485</td><td  bgcolor=#C6E2FF style="text-align:right;">2228</td><td  bgcolor=#C6E2FF style="text-align:right;">9643</td><td  bgcolor=#C6E2FF style="text-align:right;">13356</td>
+<th  bgcolor=#C6E2FF style="text-align:left;"> m4 </th><td  bgcolor=#C6E2FF style="text-align:right;">8</td><td  bgcolor=#C6E2FF style="text-align:right;">1085</td><td  bgcolor=#C6E2FF style="text-align:right;">159</td><td  bgcolor=#C6E2FF style="text-align:right;">10303</td><td  bgcolor=#C6E2FF style="text-align:right;">11547</td>
 </tr>
 <tr>
-<th  bgcolor=#FFFFFF style="text-align:left;"> Bourne  Shell </th><td  bgcolor=#FFFFFF style="text-align:right;">6</td><td  bgcolor=#FFFFFF style="text-align:right;">131</td><td  bgcolor=#FFFFFF style="text-align:right;">229</td><td  bgcolor=#FFFFFF style="text-align:right;">1032</td><td  bgcolor=#FFFFFF style="text-align:right;">1392</td>
+<th  bgcolor=#FFFFFF style="text-align:left;"> Fortran </th><td  bgcolor=#FFFFFF style="text-align:right;">90</td><td  bgcolor=#FFFFFF style="text-align:right;">6</td><td  bgcolor=#FFFFFF style="text-align:right;">361</td><td  bgcolor=#FFFFFF style="text-align:right;">382</td><td  bgcolor=#FFFFFF style="text-align:right;">1160</td><td  bgcolor=#FFFFFF style="text-align:right;">1909</td>
 </tr>
 <tr>
-<th  bgcolor=#C6E2FF style="text-align:left;"> Fortran </th><td  bgcolor=#C6E2FF style="text-align:right;">90</td><td  bgcolor=#C6E2FF style="text-align:right;">5</td><td  bgcolor=#C6E2FF style="text-align:right;">331</td><td  bgcolor=#C6E2FF style="text-align:right;">358</td><td  bgcolor=#C6E2FF style="text-align:right;">1029</td><td  bgcolor=#C6E2FF style="text-align:right;">1723</td>
+<th  bgcolor=#C6E2FF style="text-align:left;"> Bourne  Again  Shell </th><td  bgcolor=#C6E2FF style="text-align:right;">4</td><td  bgcolor=#C6E2FF style="text-align:right;">112</td><td  bgcolor=#C6E2FF style="text-align:right;">200</td><td  bgcolor=#C6E2FF style="text-align:right;">600</td><td  bgcolor=#C6E2FF style="text-align:right;">912</td>
 </tr>
 <tr>
@@ -74,5 +74,8 @@
 </tr>
 <tr>
-<th  bgcolor=#C6E2FF style="text-align:left;"> SUM: </th><td  bgcolor=#C6E2FF style="text-align:right;">2335</td><td  bgcolor=#C6E2FF style="text-align:right;">43604</td><td  bgcolor=#C6E2FF style="text-align:right;">49191</td><td  bgcolor=#C6E2FF style="text-align:right;">233458</td><td  bgcolor=#C6E2FF style="text-align:right;">326253</td>
+<th  bgcolor=#C6E2FF style="text-align:left;"> Bourne  Shell </th><td  bgcolor=#C6E2FF style="text-align:right;">2</td><td  bgcolor=#C6E2FF style="text-align:right;">51</td><td  bgcolor=#C6E2FF style="text-align:right;">73</td><td  bgcolor=#C6E2FF style="text-align:right;">230</td><td  bgcolor=#C6E2FF style="text-align:right;">354</td>
+</tr>
+<tr>
+<th  bgcolor=#FFFFFF style="text-align:left;"> SUM: </th><td  bgcolor=#FFFFFF style="text-align:right;">2282</td><td  bgcolor=#FFFFFF style="text-align:right;">45075</td><td  bgcolor=#FFFFFF style="text-align:right;">53358</td><td  bgcolor=#FFFFFF style="text-align:right;">247809</td><td  bgcolor=#FFFFFF style="text-align:right;">346242</td>
 </tr>
 </table>
Index: /issm/trunk/src/m/archive/arch.py
===================================================================
--- /issm/trunk/src/m/archive/arch.py	(revision 24312)
+++ /issm/trunk/src/m/archive/arch.py	(revision 24313)
@@ -1,266 +1,256 @@
 import numpy as np
-import math
 import struct
-import sys
-import os
+from os import path
 from collections import OrderedDict
 
-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);
-	"""
-	nargs=len(args);
-	if nargs % 2 != 0 :
-		raise ValueError('Incorrect number of arguments.')
-	# open file
-	try:
-		if not os.path.isfile(filename):
-			fid=open(filename,'wb')
-		else:
-			fid=open(filename,'ab')
-	except IOError as e:
-		raise IOError("archwrite error: could not open '%s' to write to." % filename)
-
-	nfields=len(args)/2
-	# generate data to write
-	for i in range(nfields):
-		# write field name
-		name=args[2*i]
-		write_field_name(fid,name)
-		
-		# write data associated with field name
-		data=args[2*i+1]
-		code=format_archive_code(data)
-		if code==1:
-			raise ValueError("archwrite : error writing data, string should not be written as field data")
-		elif code==2:
-			write_scalar(fid,data)
-		elif code==3:
-			write_vector(fid,data)
-		else:
-			raise ValueError("archwrite : error writing data, invalid code entered '%d'" % code)
-	
-	fid.close()
-
-# }}}
-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')
-	"""
-	try:
-		if os.path.isfile(filename):
-			fid=open(filename,'rb')
-		else:
-			raise IOError("archread error : file '%s' does not exist" % filename)
-	except IOError as e:
-		raise IOError("archread error : could not open file '%s' to read from" % filename)
-	
-	archive_results=[]
-
-	# read first result
-	result=read_field(fid)
-	while result:
-		if fieldname == result['field_name']:
-			# found the data we wanted
-			archive_results=result['data']; # we only want the data
-			break
-		
-		# read next result
-		result=read_field(fid)
-	
-	# close file
-	fid.close()
-	
-	return archive_results
-# }}}
-def archdisp(filename): # {{{
-	"""
-	ARCHDISP - Given an arch filename, display the contents of that file
-
-		Usage:
-			archdisp('archive101.arch')
-	"""
-	try:
-		if os.path.isfile(filename):
-			fid=open(filename,'rb')
-		else:
-			raise IOError("archread error : file '%s' does not exist" % filename)
-	except IOError as e:
-		raise IOError("archread error : could not open file '%s' to read from" % filename)
-	
-	print 'Source file: '
-	print '\t{0}'.format(filename)
-	print 'Variables: '
-
-	result=read_field(fid)
-	while result:
-		print '\t{0}'.format(result['field_name'])
-		print '\t\tSize:\t\t{0}'.format(result['size'])
-		print '\t\tDatatype:\t{0}'.format(result['data_type'])
-		# go to next result
-		result=read_field(fid)
-	
-	# close file
-	fid.close()
-
-# }}}
-
-# Helper functions 
-def write_field_name(fid,data): # {{{
-	"""
-	Routine to write field name (variable name) to an archive file.
-	"""
-	# write the length of the record
-	# length to write + string size (len) + format code
-	reclen=len(data)+4+4
-	fid.write(struct.pack('>i',reclen))
-	
-	# write format code
-	code=format_archive_code(data);
-	if code != 1:
-		raise TypeError("archwrite : error writing field name, expected string, but got %s" % type(data))
-	fid.write(struct.pack('>i',1))
-
-	# write string length, and then the string
-	fid.write(struct.pack('>i',len(data)))
-	fid.write(struct.pack('>%ds' % len(data),data))
-# }}}
-def write_scalar(fid,data): # {{{
-	"""
-	Procedure to write a double to an arch file pointed to by fid
-	"""
-	# write length of record
-	# double (8 bytes) + format code (4 bytes)
-	reclen=8+4
-	fid.write(struct.pack('>i',reclen))
-
-	# write the format code (2 for scalar)
-	fid.write(struct.pack('>i',2))
-	
-	# write the double
-	fid.write(struct.pack('>d',data))
-
-# }}}
-def write_vector(fid,data): # {{{
-	"""
-	Procedure to write a np.array to an arch file
-	"""
-	# Make sure our vector is the correct shape.
-	# Reshape it into a row vector if it is not correct.
-	if isinstance(data,(bool,int,long,float)):
-		data=np.array([data])
-	elif isinstance(data,(list,tuple)):
-		data=np.array(data).reshape(-1,)
-	
-	if np.ndim(data) == 1:
-		if np.size(data):
-			data=data.reshape(np.size(data),)
-		else:
-			data=data.reshape(0,0)
-	
-	# get size of data
-	sz=data.shape
-
-	# write length of record
-	# format code + row size + col size + (double size * row amt * col amt)
-	reclen=4+4+4+8*sz[0]*sz[1]
-	# make sure we can fit data into file
-	if reclen>2**31:
-		raise ValueError("archwrite error : can not write vector to binary file because it is too large")
-	fid.write(struct.pack('>i',reclen))
-	
-	# write format code
-	fid.write(struct.pack('>i',3))
-
-	# write vector
-	fid.write(struct.pack('>i',sz[0]))
-	fid.write(struct.pack('>i',sz[1]))
-	for i in xrange(sz[0]):
-		for j in xrange(sz[1]):
-			fid.write(struct.pack('>d',float(data[i][j])))
-
-# }}}
-
-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
-	"""
-
-	try:
-		# first, read the string
-		reclen=struct.unpack('>i',fid.read(struct.calcsize('>i')))[0]
-		check_name=struct.unpack('>i',fid.read(struct.calcsize('>i')))[0]
-		if check_name != 1:
-			raise ValueError('archread error : a string was not present at the start of the arch file')
-		namelen=struct.unpack('>i',fid.read(struct.calcsize('>i')))[0]
-		fieldname=struct.unpack('>%ds' % namelen,fid.read(namelen))[0]
-		
-		# then, read the data
-		datalen=struct.unpack('>i',fid.read(struct.calcsize('>i')))[0]
-		data_type=struct.unpack('>i',fid.read(struct.calcsize('>i')))[0]
-
-		if data_type==2:
-			# unpack scalar
-			data=struct.unpack('>d',fid.read(struct.calcsize('>d')))[0]
-		elif data_type==3:
-			rows=struct.unpack('>i',fid.read(struct.calcsize('>i')))[0]
-			cols=struct.unpack('>i',fid.read(struct.calcsize('>i')))[0]
-			raw_data=np.zeros(shape=(rows,cols),dtype=float)
-			for i in xrange(rows):
-				raw_data[i,:]=struct.unpack('>%dd' % cols,fid.read(cols*struct.calcsize('>d')))
-			# The matrix will be unpacked in order and will be filled left -> right by column
-			# We need to reshape and transpose the matrix so it can be read correctly
-			data=raw_data.reshape(raw_data.shape[::-1]).T
-		else:
-			raise TypeError("Cannot read data type %d" % data_type)
-			
-		# give additional data to user
-		if data_type==2:
-			data_size='1x1'
-			data_type_str='double'
-		elif data_type==3:
-			data_size='{0}x{1}'.format(rows,cols)
-			data_type_str='vector/matrix'
-
-		result=OrderedDict()
-		result['field_name']=fieldname
-		result['size']=data_size
-		result['data_type']=data_type_str
-		result['data']=data
-
-	except struct.error as e:
-		result=None
-
-	return result
-# }}}
-
-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,basestring):
-		code=1
-	elif format.shape[0] == 1 and format.shape[1] == 1:
-		code=2
-	elif isinstance(format,(list,tuple,np.ndarray)):
-		code=3
-	else:
-		raise TypeError("archwrite error: data type '%s' is not valid." % type(format))
-	return code
-# }}}
+
+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)
+    """
+
+    nargs = len(args)
+    if nargs % 2 != 0:
+        raise ValueError('Incorrect number of arguments.')
+    # open file
+    try:
+        if not path.isfile(filename):
+            fid = open(filename, 'wb')
+        else:
+            fid = open(filename, 'ab')
+    except IOError as e:
+        raise IOError("archwrite error: could not open '{}' to write to due to:".format(filename), e)
+    nfields = len(args) / 2
+    # generate data to write
+    for i in range(int(nfields)):
+        # write field name
+        name = args[2 * i]
+        write_field_name(fid, name)
+        # write data associated with field name
+        data = args[2 * i + 1]
+        code = format_archive_code(data)
+        if code == 1:
+            raise ValueError("archwrite : error writing data, string should not be written as field data")
+        elif code == 2:
+            write_scalar(fid, data)
+        elif code == 3:
+            write_vector(fid, data)
+        else:
+            raise ValueError("archwrite : error writing data, invalid code entered '{}'".format(code))
+    fid.close()
+    # }}}
+
+
+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')
+    """
+    try:
+        if path.isfile(filename):
+            fid = open(filename, 'rb')
+        else:
+            raise IOError("archread error : file '{}' does not exist".format(filename))
+    except IOError as e:
+        raise IOError("archread error : could not open file '{}' to read from due to :".format(filename), e)
+
+    archive_results = []
+    # read first result
+    result = read_field(fid)
+    while result:
+        if fieldname == result['field_name']:
+            # found the data we wanted
+            archive_results = result['data']  # we only want the data
+            break
+    # read next result
+        result = read_field(fid)
+    # close file
+    fid.close()
+    return archive_results
+    # }}}
+
+
+def archdisp(filename):  # {{{
+    """
+    ARCHDISP - Given an arch filename, display the contents of that file
+
+        Usage:
+            archdisp('archive101.arch')
+    """
+    try:
+        if path.isfile(filename):
+            fid = open(filename, 'rb')
+        else:
+            raise IOError("archread error : file '{}' does not exist".format(filename))
+    except IOError as e:
+        raise IOError("archread error : could not open file '{}' to read from due to ".format(filename), e)
+    print('Source file: ')
+    print(('\t{0}'.format(filename)))
+    print('Variables: ')
+    result = read_field(fid)
+    while result:
+        print(('\t{0}'.format(result['field_name'])))
+        print(('\t\tSize:\t\t{0}'.format(result['size'])))
+        print(('\t\tDatatype:\t{0}'.format(result['data_type'])))
+    # go to next result
+        result = read_field(fid)
+    # close file
+    fid.close()
+    # }}}
+
+
+# Helper functions
+def write_field_name(fid, data):  # {{{
+    """
+    Routine to write field name (variable name) to an archive file.
+    """
+    # write the length of the record
+    # length to write + string size (len) + format code
+    reclen = len(data) + 4 + 4
+    fid.write(struct.pack('>i', reclen))
+    # write format code
+    code = format_archive_code(data)
+    if code != 1:
+        raise TypeError("archwrite : error writing field name, expected string, but got %s" % type(data))
+    fid.write(struct.pack('>i', 1))
+    # write string length, and then the string
+    fid.write(struct.pack('>i', len(data)))
+    fid.write(struct.pack('>{}s'.format(len(data)), data.encode('utf8')))
+    # }}}
+
+
+def write_scalar(fid, data):  # {{{
+    """
+    Procedure to write a double to an arch file pointed to by fid
+    """
+    # write length of record
+    # double (8 bytes) + format code (4 bytes)
+    reclen = 8 + 4
+    fid.write(struct.pack('>i', reclen))
+
+    # write the format code (2 for scalar)
+    fid.write(struct.pack('>i', 2))
+    # write the double
+    fid.write(struct.pack('>d', data))
+    # }}}
+
+
+def write_vector(fid, data):  # {{{
+    """
+    Procedure to write a np.array to an arch file
+    """
+    # Make sure our vector is the correct shape.
+    # Reshape it into a row vector if it is not correct.
+    if isinstance(data, (bool, int, float)):
+        data = np.array([data])
+    elif isinstance(data, (list, tuple)):
+        data = np.array(data).reshape(-1, )
+    if np.ndim(data) == 1:
+        if np.size(data):
+            data = data.reshape(np.size(data), )
+        else:
+            data = data.reshape(0, 0)
+    # get size of data
+    sz = data.shape
+    # write length of record
+    # format code + row size + col size + (double size * row amt * col amt)
+    reclen = 4 + 4 + 4 + 8 * sz[0] * sz[1]
+    # make sure we can fit data into file
+    if reclen > 2**31:
+        raise ValueError("archwrite error : can not write vector to binary file because it is too large")
+    fid.write(struct.pack('>i', reclen))
+    # write format code
+    fid.write(struct.pack('>i', 3))
+    # write vector
+    fid.write(struct.pack('>i', sz[0]))
+    fid.write(struct.pack('>i', sz[1]))
+    for i in range(sz[0]):
+        for j in range(sz[1]):
+            fid.write(struct.pack('>d', float(data[i][j])))
+    # }}}
+
+
+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
+    """
+
+    try:
+        # first, read the string
+        #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:
+            raise ValueError('archread error : a string was not present at the start of the arch file')
+        namelen = struct.unpack('>i', fid.read(struct.calcsize('>i')))[0]
+        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
+        data_type = struct.unpack('>i', fid.read(struct.calcsize('>i')))[0]
+
+        if data_type == 2:
+            # struct.upack scalar
+            data = struct.unpack('>d', fid.read(struct.calcsize('>d')))[0]
+        elif data_type == 3:
+            rows = struct.unpack('>i', fid.read(struct.calcsize('>i')))[0]
+            cols = struct.unpack('>i', fid.read(struct.calcsize('>i')))[0]
+            raw_data = np.zeros(shape=(rows, cols), dtype=float)
+            for i in range(rows):
+                raw_data[i, :] = struct.unpack('>{}d'.format(cols), fid.read(cols * struct.calcsize('>d')))
+                # The matrix will be struct.upacked in order and will be filled left -> right by column
+                # We need to reshape and transpose the matrix so it can be read correctly
+            data = raw_data.reshape(raw_data.shape[::-1]).T
+        else:
+            raise TypeError("Cannot read data type {}".format(data_type))
+
+        # give additional data to user
+        if data_type == 2:
+            data_size = '1x1'
+            data_type_str = 'double'
+        elif data_type == 3:
+            data_size = '{0}x{1}'.format(rows, cols)
+            data_type_str = 'vector/matrix'
+
+        result = OrderedDict()
+        result['field_name'] = fieldname.decode('utf8')
+        result['size'] = data_size
+        result['data_type'] = data_type_str
+        result['data'] = data
+
+    except struct.error as e:
+        result = None
+        print("result is empty due to", e)
+
+    return result
+    # }}}
+
+
+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):
+        code = 1
+    elif format.shape[0] == 1 and format.shape[1] == 1:
+        code = 2
+    elif isinstance(format, (list, tuple, np.ndarray)):
+        code = 3
+    else:
+        raise TypeError("archwrite error: data type '%s' is not valid." % type(format))
+    return code
+    # }}}
Index: /issm/trunk/src/m/array/MatlabArray.py
===================================================================
--- /issm/trunk/src/m/array/MatlabArray.py	(revision 24312)
+++ /issm/trunk/src/m/array/MatlabArray.py	(revision 24313)
@@ -2,275 +2,283 @@
 import numpy as np
 from MatlabFuncs import *
-
 #move this later
 from helpers import *
+from functools import reduce
+
 
 def allempty(cin):
-	'''
-	function to return an empty cell array if all array elements are empty
-	cout=allempty(cin)
-'''
-	for i in cin:
-		if not isempty(i):
-			cout = cin
-			return cout
-	return []
-
-def allequal(ain,aval):
-	'''
-	function to return an empty array if all array elements are
-	equal to the given value, which may also be empty but not nan.
-
-	(note that by definition, nan is not equal to nan; this could
-	be changed by using isequalwithequalnans.)
-
-	aout=allequal(ain,aval)
-'''
-	if type(ain) != type(aval):
-		print allequal.__doc__
-		raise RuntimeError("ain and aval must be of the same type")
-	
-	if type(ain) == list:
-		ain = np.array(ain)
-	if type(ain) == np.ndarray:
-		ain = ain.flatten()
-
-	for i in ain:
-		if i != aval:
-			if type(ain) == str:
-				return ''
-			else:
-				return []
-	return ain
+    '''
+    function to return an empty cell array if all array elements are empty
+    cout = allempty(cin)
+    '''
+    for i in cin:
+        if not isempty(i):
+            cout = cin
+            return cout
+    return []
+
+
+def allequal(ain, aval):
+    '''
+    function to return an empty array if all array elements are
+    equal to the given value, which may also be empty but not nan.
+
+    (note that by definition, nan is not equal to nan; this could
+    be changed by using isequalwithequalnans.)
+
+    aout = allequal(ain, aval)
+    '''
+    if type(ain) != type(aval):
+        print((allequal.__doc__))
+        raise RuntimeError("ain and aval must be of the same type")
+
+    if type(ain) == list:
+        ain = np.array(ain)
+    if type(ain) == np.ndarray:
+        ain = ain.flatten()
+
+    for i in ain:
+        if i != aval:
+            if type(ain) == str:
+                return ''
+            else:
+                return []
+    return ain
+
 
 def array_numel(*args):
-	'''
-	function to find a number of elements from a list of arrays.
-  
-	asize=array_numel(varargin)
-
-	see array_size to check the number and shape of elements, if
-	multiple indices will be used.
-'''
-	anum = 0
-	inum = 0
-	for arg in args:
-		if type(arg) == str:
-			inum = len(arg)
-		else:
-			inum = np.size(arg)
-
-		if inum != 0:
-			if anum == 0:
-				anum = inum
-			else:
-				if inum != anum:
-					raise RuntimeError('Inputs had inconsistent number of elements')
-	return anum
+    '''
+    function to find a number of elements from a list of arrays.
+
+    asize = array_numel(varargin)
+
+    see array_size to check the number and shape of elements, if
+    multiple indices will be used.
+    '''
+    anum = 0
+    inum = 0
+    for arg in args:
+        if type(arg) == str:
+            inum = len(arg)
+        else:
+            inum = np.size(arg)
+
+        if inum != 0:
+            if anum == 0:
+                anum = inum
+            else:
+                if inum != anum:
+                    raise RuntimeError('Inputs had inconsistent number of elements')
+    return anum
+
 
 def array_size(*args):
-	'''
-	function to find an array size from a list of arrays.
- 
-	asize=array_size(varargin)
-
-	see array_numel to check only the number of elements, if
-	single indices will be used.
-	all arguments are assumed to be 1 or 2 dimensional
-
-	Note: to call on all elements of an array use: array_size(*x)
-		in Matlab this would be array_size(x{1:end})
-
-	Note: to get all elements in a linear array use: array_size(np.array(x).flatten()[0:])
-		in Matlab this would be array_size(x{1:end})
-		because Matlab allows direct 1D access of nD arrays
-'''
-	asize = (0,0)
-	isize = (0,0)
-	for arg in args:
-		if type(arg) == str:
-			isize = (1,1)		#cellstr in matlab makes this happen
-		else:
-			isize = np.shape(arg)
-			if isize == ():		#arg is a single value, ex. 0.3, 5, False, etc
-				isize = (1,1)
-
-		if isize != (0,0):
-			if asize == (0,0):
-				asize = isize
-			else:
-				if isize != asize:
-					raise RuntimeError('Inputs had inconsistent shapes')
-
-	#numpy gives (y,) if x = 1, must be reversed to match matlab syntax in this case
-	if len(asize) == 1:
-		asize = (1,asize[0])
-
-	return asize
-
-def str2int(astr,cfl='first',asint=True):
-	'''
-	function to find and read the first or last positive integer
-	in a character string. cfl={'first','f','last','l'}; default: 'first'
-	returns 0 if astr has no positive integers
-
-	Setting asint=False returns a list of strings
-		eg. ['1','2','3'] from '123'
-
-	aint=str2int(astr,cfl)
-'''
-	aint = []
-
-	num = '1234567890'
-
-	if type(cfl) != str or type(astr) != str or len(cfl) == 0 or len(astr) == 0:
-		raise TypeError('str2int(astr,cfl): both arguments must be strings with length > 0')
-
-	# find last positive int
-	if cfl[0] in ['l','L']:
-		for i in reversed(astr):
-			if i in num:
-				aint.append(i)
-			else:
-				if len(aint) > 0:
-					# aint is backwards since we were iterating backwards
-					aint = list(reversed(aint))
-					if asint:
-						# convert list(str) to int
-						aint = int(reduce(lambda x,y: x+y,aint))
-					break
-
-	elif cfl[0] in ['f','F']:
-		for i in astr:
-			if i in num:
-				aint.append(i)
-			else:
-				if len(aint) > 0:
-					if asint:
-						# convert list(str) to int
-						aint = int(reduce(lambda x,y: x+y,aint))
-					break
-
-	# return 0 if aint is still [] (no integers found)
-	return aint or 0
-
-def string_dim(a,idim,*args):
-	'''
-	function to return the string dimension of an array element
-
-	function sdim=string_dim(a,idim,varargin)
-
-	such that: given the array/matrix a,
-		idim is the linear index of an element in a,
-		return the x/y/z/w/... coordinates of idim in n dimensions
-
-	ex. a = [1 2 3
-		 4 5 6]
-
-	idim = 4
-	(a[4] == 5; counted as [1,4,2,5,3,6] linearly in matlab)
-
-	x = string_dim(a,4) -> '[1,1]'
-
-	a[x] == a[4] == a[1,1] == 5
-
-	example use: exec('print a'+string_dim(a,4)) -> print a[1,1]
-'''
-	sdmin = ''
-	if type(a) == list:
-		a = np.array(a)
-	if type(a) != np.ndarray:
-		raise TypeError('string_dim(a,idim,*args): a must be a numpy array <numpy.ndarray>. Try passing np.array(a) instead')
-
-	if np.size(a) == 0 and idim == 0:
-		return sdim
-	
-	if idim >= np.size(a):
-		raise RuntimeError('string_dim(a,idim,*args): index idim exceeds number of elements in a')
-
-	#check for column or row vector
-	for iarg in args:
-		if strcmpi(iarg,'vector'):
-			if a.ndim == 2 and (np.shape(a,1) == 1 or np.shape(a,2) == 1):
-				return '('+str(idim)+')'
-
-	#transpose to compensate for differences in linear indexing in
-	# matlab vs in python (y/x + linear vs x/y)
-	a = a.T
-
-	#general case
-	asize = np.shape(a)
-	i = np.zeros((np.shape(asize)))
-	aprod = np.prod(asize)
-	idim = idim - 1
-	index = np.zeros((len(asize)))
-	
-	#calculate indices base 0
-	for i in range(len(asize)):
-		aprod=aprod/asize[i]
-		index[i]=np.floor(idim/aprod)
-		idim=idim-index[i]*aprod
-
-	#assemble string for output
-	sdim ='['
-	for i in range(len(asize)-1):
-	    sdim += str(int(index[i])) + ','
-
-	sdim += str(int(index[-1])) + ']'
-
-	# happens due to how python does indexing, this response in matlab is just ''
-	if sdim == '[-1]':
-		return ''
-
-	return sdim
+    '''
+    function to find an array size from a list of arrays.
+
+    asize = array_size(varargin)
+
+    see array_numel to check only the number of elements, if
+    single indices will be used.
+    all arguments are assumed to be 1 or 2 dimensional
+
+    Note: to call on all elements of an array use: array_size(* x)
+        in Matlab this would be array_size(x{1:end})
+
+    Note: to get all elements in a linear array use: array_size(np.array(x).flatten()[0:])
+        in Matlab this would be array_size(x{1:end})
+        because Matlab allows direct 1D access of nD arrays
+    '''
+    asize = (0, 0)
+    isize = (0, 0)
+    for arg in args:
+        if type(arg) == str:
+            isize = (1, 1)  #cellstr in matlab makes this happen
+        else:
+            isize = np.shape(arg)
+            if isize == ():  #arg is a single value, ex. 0.3, 5, False, etc
+                isize = (1, 1)
+
+        if isize != (0, 0):
+            if asize == (0, 0):
+                asize = isize
+            else:
+                if isize != asize:
+                    raise RuntimeError('Inputs had inconsistent shapes')
+
+    #numpy gives (y, ) if x = 1, must be reversed to match matlab syntax in this case
+    if len(asize) == 1:
+        asize = (1, asize[0])
+
+    return asize
+
+
+def str2int(astr, cfl='first', asint=True):
+    '''
+    function to find and read the first or last positive integer
+    in a character string. cfl={'first', 'f', 'last', 'l'}; default: 'first'
+    returns 0 if astr has no positive integers
+
+    Setting asint = False returns a list of strings
+        eg. ['1', '2', '3'] from '123'
+
+    aint = str2int(astr, cfl)
+    '''
+    aint = []
+
+    num = '1234567890'
+
+    if type(cfl) != str or type(astr) != str or len(cfl) == 0 or len(astr) == 0:
+        raise TypeError('str2int(astr, cfl): both arguments must be strings with length > 0')
+
+    # find last positive int
+    if cfl[0] in ['l', 'L']:
+        for i in reversed(astr):
+            if i in num:
+                aint.append(i)
+            else:
+                if len(aint) > 0:
+                    # aint is backwards since we were iterating backwards
+                    aint = list(reversed(aint))
+                    if asint:
+                        # convert list(str) to int
+                        aint = int(reduce(lambda x, y: x + y, aint))
+                    break
+
+    elif cfl[0] in ['f', 'F']:
+        for i in astr:
+            if i in num:
+                aint.append(i)
+            else:
+                if len(aint) > 0:
+                    if asint:
+                        # convert list(str) to int
+                        aint = int(reduce(lambda x, y: x + y, aint))
+                    break
+
+    # return 0 if aint is still [] (no integers found)
+    return aint or 0
+
+
+def string_dim(a, idim, *args):
+    '''
+    function to return the string dimension of an array element
+
+    function sdim = string_dim(a, idim, varargin)
+
+    such that: given the array / matrix a,
+        idim is the linear index of an element in a,
+        return the x / y / z / w / ... coordinates of idim in n dimensions
+
+    ex. a = [1 2 3
+         4 5 6]
+
+    idim = 4
+    (a[4] == 5; counted as [1, 4, 2, 5, 3, 6] linearly in matlab)
+
+    x = string_dim(a, 4) -> '[1, 1]'
+
+    a[x] == a[4] == a[1, 1] == 5
+
+    example use: exec('print a' + string_dim(a, 4)) -> print a[1, 1]
+    '''
+
+    if type(a) == list:
+        a = np.array(a)
+    if type(a) != np.ndarray:
+        raise TypeError('string_dim(a, idim, *args): a must be a numpy array < numpy.ndarray > . Try passing np.array(a) instead')
+
+    if np.size(a) == 0 and idim == 0:
+        return sdim
+
+    if idim >= np.size(a):
+        raise RuntimeError('string_dim(a, idim, *args): index idim exceeds number of elements in a')
+
+    #check for column or row vector
+    for iarg in args:
+        if strcmpi(iarg, 'vector'):
+            if a.ndim == 2 and (np.shape(a, 1) == 1 or np.shape(a, 2) == 1):
+                return '(' + str(idim) + ')'
+
+    #transpose to compensate for differences in linear indexing in
+    # matlab vs in python (y / x + linear vs x / y)
+    a = a.T
+
+    #general case
+    asize = np.shape(a)
+    i = np.zeros((np.shape(asize)))
+    aprod = np.prod(asize)
+    idim = idim - 1
+    index = np.zeros((len(asize)))
+
+    #calculate indices base 0
+    for i in range(len(asize)):
+        aprod = aprod / asize[i]
+        index[i] = np.floor(idim / aprod)
+        idim = idim - index[i] * aprod
+
+    #assemble string for output
+    sdim = '['
+    for i in range(len(asize) - 1):
+        sdim += str(int(index[i])) + ', '
+
+    sdim += str(int(index[-1])) + ']'
+
+    # happens due to how python does indexing, this response in matlab is just ''
+    if sdim == '[-1]':
+        return ''
+
+    return sdim
+
 
 def string_vec(a):
-	'''
-	function to return the string of a vector
-
-	function svec=string_vec(a)
-'''
-	return str(a)
-
-def struc_class(sclass,cstr,name):
-	'''
-	function to find the structural fields of a specified class
-
-	sclasso=struc_class(sclass,cstr,variable_name)
-
-	such that:
-	sclasso.variable_name == sclass (hard copy)
-
-	if variable_name == ''
-		sclasso.cstr == sclass (hard copy)
-'''
-	try:
-		# I tried other methods, but this is, unfortunately, the best behaving by far
-		exec 'from '+cstr+' import *'
-	except:
-		raise RuntimeError('MatlabArray.struc_class Class Error: class "'+cstr+'" does not exist')
-
-	sclasso = struct()
-
-	if isinstance(sclass,eval(cstr)):
-		# if we were given no name, call it by its class name
-		if name != '':
-			setattr(sclasso, name, deepcopy(sclass))
-		else:
-			setattr(sclasso, cstr, deepcopy(sclass))
-	else:
-		raise RuntimeError('MatlabArray.struc_class Match Error: provided object of type "'+str(type(sclass))+'" does not match provided string; object should be of type '+cstr)
-
-	#may need this later depending on how src/m/classes/qmu works out
-
-	#if len(vars(sclass)) == 0:
-		#return Lstruct()
-
-	#else:
-		#fnames = fieldnames(sclass)
-		#for f in fnames:
-			#if isinstance(vars(sclass)[f],eval(cstr)):
-				#exec('sclasso.%s = vars(sclass)[f]')%(f)
-				#vars(sclasso)[f] = vars(sclass)[f]
-
-	return sclasso
+    '''
+    function to return the string of a vector
+
+    function svec = string_vec(a)
+    '''
+    return str(a)
+
+
+def struc_class(sclass, cstr, name):
+    '''
+    function to find the structural fields of a specified class
+
+    sclasso = struc_class(sclass, cstr, variable_name)
+
+    such that:
+    sclasso.variable_name == sclass (hard copy)
+
+    if variable_name == ''
+        sclasso.cstr == sclass (hard copy)
+    '''
+    try:
+        # I tried other methods, but this is, unfortunately, the best behaving by far
+        exec('from ' + cstr + ' import * ')
+    except:
+        raise RuntimeError('MatlabArray.struc_class Class Error: class "' + cstr + '" does not exist')
+
+    sclasso = struct()
+
+    if isinstance(sclass, eval(cstr)):
+        # if we were given no name, call it by its class name
+        if name != '':
+            setattr(sclasso, name, deepcopy(sclass))
+        else:
+            setattr(sclasso, cstr, deepcopy(sclass))
+    else:
+        raise RuntimeError('MatlabArray.struc_class Match Error: provided object of type "' + str(type(sclass)) + '" does not match provided string; object should be of type ' + cstr)
+
+    #may need this later depending on how src / m / classes / qmu works out
+
+    #if len(vars(sclass)) == 0:
+    #return Lstruct()
+
+    #else:
+    #fnames = fieldnames(sclass)
+    #for f in fnames:
+    #if isinstance(vars(sclass)[f], eval(cstr)):
+    #exec('sclasso.%s = vars(sclass)[f]')%(f)
+    #vars(sclasso)[f] = vars(sclass)[f]
+
+    return sclasso
Index: /issm/trunk/src/m/boundaryconditions/PattynSMB.py
===================================================================
--- /issm/trunk/src/m/boundaryconditions/PattynSMB.py	(revision 24312)
+++ /issm/trunk/src/m/boundaryconditions/PattynSMB.py	(revision 24313)
@@ -1,11 +1,12 @@
-import os
-import numpy as  np
-def PattynSMB(md,Tf):
-	"""
-    PATTYNSMB- Compute SMB over Antarctica (from Pattyn 2006, pg. 18, "GRANTISM: An ExcelTM model for Greenland 
-	and Antarctic ice-sheet response to climate changes")
+import numpy as np
+
+
+def PattynSMB(md, Tf):
+    """
+    PATTYNSMB - Compute SMB over Antarctica (from Pattyn 2006, pg. 18, "GRANTISM: An ExcelTM model for Greenland
+    and Antarctic ice-sheet response to climate changes")
 
     Usage:
-      md=PattynSMB(md,Tf)
+      md = PattynSMB(md, Tf)
 
       where Tf is a background forcing temperature ("an anomalous temperature relative to the present conditions)
@@ -13,38 +14,37 @@
 
     See also: SETICESHELFBC, SETMARINEICESHEETBC
-	"""
- 
-	# Tma    : Mean annual surface temperature in [deg C]
-	# Tms    : Mean summer temperature in [deg C]
-	# h      : Surface/bedrock elevation (I assume in meters but paper does not specify)
-	# phi    : Latitude in degrees SOUTH
-	# lambda : Longitude in degrees WEST
-	# Tf     : Background forcing temperature ("an anomalous temperature relative to the present conditions)
-	# ACCdot : Accumulation rate in units of [m/a] ice equivalent
-	# ABLdot : Surface ablation rate in [m/a] ice equivalent
+    """
 
-	#Double check lat and long exist:
-	if np.any(np.isnan(md.mesh.lat)): 
-		raise IOError('PattynSMB error message: md.mesh.lat field required')
+    # Tma    : Mean annual surface temperature in [deg C]
+    # Tms    : Mean summer temperature in [deg C]
+    # h      : Surface / bedrock elevation (I assume in meters but paper does not specify)
+    # phi    : Latitude in degrees SOUTH
+    # lambda : Longitude in degrees WEST
+    # Tf     : Background forcing temperature ("an anomalous temperature relative to the present conditions)
+    # ACCdot : Accumulation rate in units of [m / a] ice equivalent
+    # ABLdot : Surface ablation rate in [m / a] ice equivalent
 
-	# Calculate mean annual surface temperature, Eqn (11)
-	# Here, -0.012 is the atmospheric Lapse rate from sea level in deg/m.
-	# It is multiplied by surface elevation from sea level
-	Tma = -15.15 - 0.012*md.geometry.surface
-	
+    #Double check lat and long exist:
+    if np.any(np.isnan(md.mesh.lat)):
+        raise IOError('PattynSMB error message: md.mesh.lat field required')
 
-	# Calculate summer temperature, Eqn (12)
-	# No melting at PIG in mean conditions - need about 6 degress Tf to start having a negative yearly SMB
-	Tms = 16.81 - 0.00692*md.geometry.surface - 0.27937*np.abs(md.mesh.lat) + Tf
-	Tms= Tms[0]
+    # Calculate mean annual surface temperature, Eqn (11)
+    # Here, -0.012 is the atmospheric Lapse rate from sea level in deg / m.
+    # It is multiplied by surface elevation from sea level
+    Tma = -15.15 - 0.012 * md.geometry.surface
 
-	# Calculate Accumulation perturbation with Tf forcing, Eqn (9)
-	ACCdot = 2.5*2**((Tma+Tf)/10.) - 2.5*2**(Tma/10.)
+    # Calculate summer temperature, Eqn (12)
+    # No melting at PIG in mean conditions - need about 6 degress Tf to start having a negative yearly SMB
+    Tms = 16.81 - 0.00692 * md.geometry.surface - 0.27937 * np.abs(md.mesh.lat) + Tf
+    Tms = Tms[0]
 
-	# Calculate Ablation, Eqn (10) (use for both Antarctica & Greenland), max melt is 10m/a
-	ABLdot=0.*np.ones(md.mesh.numberofvertices)
-	pos=np.nonzero(Tms>=0)
-	ABLdot[pos]=np.minimum(1.4*Tms[pos],10)
+    # Calculate Accumulation perturbation with Tf forcing, Eqn (9)
+    ACCdot = 2.5 * 2**((Tma + Tf) / 10.) - 2.5 * 2**(Tma / 10.)
 
-	smb=ACCdot-ABLdot
-	return smb[0]
+    # Calculate Ablation, Eqn (10) (use for both Antarctica & Greenland), max melt is 10m / a
+    ABLdot = 0. * np.ones(md.mesh.numberofvertices)
+    pos = np.nonzero(Tms >= 0)
+    ABLdot[pos] = np.minimum(1.4 * Tms[pos], 10)
+
+    smb = ACCdot - ABLdot
+    return smb[0]
Index: /issm/trunk/src/m/boundaryconditions/SetIceSheetBC.py
===================================================================
--- /issm/trunk/src/m/boundaryconditions/SetIceSheetBC.py	(revision 24312)
+++ /issm/trunk/src/m/boundaryconditions/SetIceSheetBC.py	(revision 24313)
@@ -1,59 +1,57 @@
-import os
 import numpy as np
-from ContourToMesh import ContourToMesh
+
 
 def SetIceSheetBC(md):
-	"""
-	SETICESHEETBC - Create the boundary conditions for stressbalance and thermal models for an IceSheet with no Ice Front
+    """
+    SETICESHEETBC - Create the boundary conditions for stressbalance and thermal models for an IceSheet with no Ice Front
 
-	   Usage:
-	      md=SetIceSheetBC(md)
+       Usage:
+          md = SetIceSheetBC(md)
 
-	   See also: SETICESHELFBC, SETMARINEICESHEETBC
-	"""
+       See also: SETICESHELFBC, SETMARINEICESHEETBC
+    """
 
-	#node on Dirichlet
-	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[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.loadingforce=0*np.ones((md.mesh.numberofvertices,3))
+    #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[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.loadingforce = 0 * np.ones((md.mesh.numberofvertices, 3))
 
-	#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"
-		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"
+    #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")
+        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")
 
-	#No ice front -> do nothing
+    #No ice front -> do nothing
 
-	#Create zeros basalforcings and smb
-	md.smb.initialize(md)
-	md.basalforcings.initialize(md)
+    #Create zeros basalforcings and smb
+    md.smb.initialize(md)
+    md.basalforcings.initialize(md)
 
-	#Deal with other boundary conditions
-	if np.all(np.isnan(md.balancethickness.thickening_rate)):
-		md.balancethickness.thickening_rate=np.zeros((md.mesh.numberofvertices))
-		print "      no balancethickness.thickening_rate specified: values set as zero"
-	md.masstransport.spcthickness=float('nan')*np.ones((md.mesh.numberofvertices))
-	md.balancethickness.spcthickness=float('nan')*np.ones((md.mesh.numberofvertices))
-	md.damage.spcdamage=float('nan')*np.ones((md.mesh.numberofvertices))
+    #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))
 
-	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))
-		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
-		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
-	else:
-		print "      no thermal boundary conditions created: no observed temperature found"
+    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))
+        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
+        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
+    else:
+        print("      no thermal boundary conditions created: no observed temperature found")
 
-	return md
-
+    return md
Index: /issm/trunk/src/m/boundaryconditions/SetIceShelfBC.py
===================================================================
--- /issm/trunk/src/m/boundaryconditions/SetIceShelfBC.py	(revision 24312)
+++ /issm/trunk/src/m/boundaryconditions/SetIceShelfBC.py	(revision 24313)
@@ -4,98 +4,98 @@
 import MatlabFuncs as m
 
-def SetIceShelfBC(md,icefrontfile=''):
-	"""
-	SETICESHELFBC - Create the boundary conditions for stressbalance and thermal models for a  Ice Shelf with Ice Front
 
-	   Neumann BC are used on the ice front (an ARGUS contour around the ice front
-	   must be given in input)
-	   Dirichlet BC are used elsewhere for stressbalance
+def SetIceShelfBC(md, icefrontfile=''):
+    """
+    SETICESHELFBC - Create the boundary conditions for stressbalance and thermal models for a  Ice Shelf with Ice Front
 
-	   Usage:
-	      md=SetIceShelfBC(md,varargin)
+       Neumann BC are used on the ice front (an ARGUS contour around the ice front
+       must be given in input)
+       Dirichlet BC are used elsewhere for stressbalance
 
-	   Example:
-	      md=SetIceShelfBC(md);
-	      md=SetIceShelfBC(md,'Front.exp');
+       Usage:
+          md = SetIceShelfBC(md, varargin)
 
-	   See also: SETICESHEETBC, SETMARINEICESHEETBC
-	"""
+       Example:
+          md = SetIceShelfBC(md)
+          md = SetIceShelfBC(md, 'Front.exp')
 
-	#node on Dirichlet (boundary and ~icefront)
-	if icefrontfile:
-		if not os.path.exists(icefrontfile):
-			raise IOError("SetIceShelfBC error message: ice front file '%s' not found." % icefrontfile)
-		nodeinsideicefront=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,icefrontfile,'node',2)
-		nodeonicefront=np.logical_and(md.mesh.vertexonboundary,nodeinsideicefront.reshape(-1))
-	else:
-		nodeonicefront=np.zeros((md.mesh.numberofvertices),bool)
+       See also: SETICESHEETBC, SETMARINEICESHEETBC
+    """
 
-#	pos=find(md.mesh.vertexonboundary & ~nodeonicefront);
-	pos=np.nonzero(np.logical_and(md.mesh.vertexonboundary,np.logical_not(nodeonicefront)))[0]
-	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.loadingforce=0*np.ones((md.mesh.numberofvertices,3))
+    #node on Dirichlet (boundary and ~icefront)
+    if icefrontfile:
+        if not os.path.exists(icefrontfile):
+            raise IOError("SetIceShelfBC error message: ice front file '%s' not found." % icefrontfile)
+        nodeinsideicefront = ContourToMesh(md.mesh.elements, md.mesh.x, md.mesh.y, icefrontfile, 'node', 2)
+        nodeonicefront = np.logical_and(md.mesh.vertexonboundary, nodeinsideicefront.reshape(-1))
+    else:
+        nodeonicefront = np.zeros((md.mesh.numberofvertices), bool)
 
-	#Icefront position
-	pos=np.nonzero(nodeonicefront)[0]
-	md.mask.ice_levelset[pos]=0
+    #    pos = find(md.mesh.vertexonboundary & ~nodeonicefront)
+    pos = np.nonzero(np.logical_and(md.mesh.vertexonboundary, np.logical_not(nodeonicefront)))[0]
+    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.loadingforce = 0 * np.ones((md.mesh.numberofvertices, 3))
 
-	#First find segments that are not completely on the front
-	if m.strcmp(md.mesh.elementtype(),'Penta'):
-		numbernodesfront=4;
-	elif m.strcmp(md.mesh.elementtype(),'Tria'):
-		numbernodesfront=2;
-	else:
-		raise	error('mesh type not supported yet')
-	if any(md.mask.ice_levelset<=0):
-		values=md.mask.ice_levelset[md.mesh.segments[:,0:-1]-1]
-		segmentsfront=1-values
-		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
-		pos=md.mesh.segments[segments,0:-1]-1
-	else:
-		pos=np.nonzero(md.mesh.vertexonboundary)[0]
-	md.stressbalance.spcvx[pos]=0
-	md.stressbalance.spcvy[pos]=0
-	md.stressbalance.spcvz[pos]=0
-																													   
-	#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:
-		#reshape to rank-2 if necessary to match spc arrays
-		if np.ndim(md.inversion.vx_obs)==1:
-			md.inversion.vx_obs=md.inversion.vx_obs.reshape(-1,)
-		if np.ndim(md.inversion.vy_obs)==1:
-			md.inversion.vy_obs=md.inversion.vy_obs.reshape(-1,)
-		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"
+    #Icefront position
+    pos = np.nonzero(nodeonicefront)[0]
+    md.mask.ice_levelset[pos] = 0
 
-	#Create zeros basalforcings and smb
-	md.smb.initialize(md)
-	md.basalforcings.initialize(md)
+    #First find segments that are not completely on the front
+    if m.strcmp(md.mesh.elementtype(), 'Penta'):
+        numbernodesfront = 4
+    elif m.strcmp(md.mesh.elementtype(), 'Tria'):
+        numbernodesfront = 2
+    else:
+        raise NameError('mesh type not supported yet')
+    if any(md.mask.ice_levelset <= 0):
+        values = md.mask.ice_levelset[md.mesh.segments[:, 0:-1] - 1]
+        segmentsfront = 1 - values
+        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
+        pos = md.mesh.segments[segments, 0:-1] - 1
+    else:
+        pos = np.nonzero(md.mesh.vertexonboundary)[0]
+    md.stressbalance.spcvx[pos] = 0
+    md.stressbalance.spcvy[pos] = 0
+    md.stressbalance.spcvz[pos] = 0
 
-	#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))
+    #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:
+        #reshape to rank - 2 if necessary to match spc arrays
+        if np.ndim(md.inversion.vx_obs) == 1:
+            md.inversion.vx_obs = md.inversion.vx_obs.reshape(-1, )
+        if np.ndim(md.inversion.vy_obs) == 1:
+            md.inversion.vy_obs = md.inversion.vy_obs.reshape(-1, )
+        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")
 
-	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))
-		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
-		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))
-	else:
-		print "      no thermal boundary conditions created: no observed temperature found"
+    #Create zeros basalforcings and smb
+    md.smb.initialize(md)
+    md.basalforcings.initialize(md)
 
-	return md
+    #Deal with other boundary conditions
+    if np.all(np.isnan(md.balancethickness.thickening_rate)):
+        md.balancethickness.thickening_rate = np.zeros((md.mesh.numberofvertices))
+        print("      no balancethickness.thickening_rate specified: values set as zero")
+    md.masstransport.spcthickness = float('nan') * np.ones((md.mesh.numberofvertices))
+    md.balancethickness.spcthickness = float('nan') * np.ones((md.mesh.numberofvertices))
+    md.damage.spcdamage = float('nan') * np.ones((md.mesh.numberofvertices))
 
+    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))
+        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
+        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))
+    else:
+        print("      no thermal boundary conditions created: no observed temperature found")
+
+    return md
Index: /issm/trunk/src/m/boundaryconditions/SetMarineIceSheetBC.py
===================================================================
--- /issm/trunk/src/m/boundaryconditions/SetMarineIceSheetBC.py	(revision 24312)
+++ /issm/trunk/src/m/boundaryconditions/SetMarineIceSheetBC.py	(revision 24313)
@@ -2,110 +2,108 @@
 import numpy as np
 from ContourToMesh import ContourToMesh
-import MatlabFuncs as m
 
-def SetMarineIceSheetBC(md,icefrontfile=''):
-	"""
-	SETICEMARINESHEETBC - Create the boundary conditions for stressbalance and thermal models for a  Marine Ice Sheet with Ice Front
 
-	   Neumann BC are used on the ice front (an ARGUS contour around the ice front
-	   can be given in input, or it will be deduced as onfloatingice & onboundary)
-	   Dirichlet BC are used elsewhere for stressbalance
+def SetMarineIceSheetBC(md, icefrontfile=''):
+    """
+    SETICEMARINESHEETBC - Create the boundary conditions for stressbalance and thermal models for a  Marine Ice Sheet with Ice Front
 
-	   Usage:
-	      md=SetMarineIceSheetBC(md,icefrontfile)
-	      md=SetMarineIceSheetBC(md)
+       Neumann BC are used on the ice front (an ARGUS contour around the ice front
+       can be given in input, or it will be deduced as onfloatingice & onboundary)
+       Dirichlet BC are used elsewhere for stressbalance
 
-	   Example:
-	      md=SetMarineIceSheetBC(md,'Front.exp')
-	      md=SetMarineIceSheetBC(md)
+       Usage:
+          md = SetMarineIceSheetBC(md, icefrontfile)
+          md = SetMarineIceSheetBC(md)
 
-	   See also: SETICESHELFBC, SETMARINEICESHEETBC
-	"""
+       Example:
+          md = SetMarineIceSheetBC(md, 'Front.exp')
+          md = SetMarineIceSheetBC(md)
 
-	#node on Dirichlet (boundary and ~icefront)
-	if icefrontfile:
-		#User provided Front.exp, use it
-		if not os.path.exists(icefrontfile):
-			raise IOError("SetMarineIceSheetBC error message: ice front file '%s' not found." % 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
-		vertexonfloatingice=np.zeros((md.mesh.numberofvertices))
-		pos=np.nonzero(np.sum(md.mask.groundedice_levelset[md.mesh.elements-1]<0.,axis=1) >0.)[0]
-		vertexonfloatingice[md.mesh.elements[pos].astype(int)-1]=1.
-		vertexonicefront=np.logical_and(np.reshape(md.mesh.vertexonboundary,(-1,)),vertexonfloatingice>0.)
+       See also: SETICESHELFBC, SETMARINEICESHEETBC
+    """
+    #node on Dirichlet (boundary and ~icefront)
+    if icefrontfile:
+        #User provided Front.exp, use it
+        if not os.path.exists(icefrontfile):
+            raise IOError("SetMarineIceSheetBC error message: ice front file '%s' not found." % 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
+        vertexonfloatingice = np.zeros((md.mesh.numberofvertices))
+        pos = np.nonzero(np.sum(md.mask.groundedice_levelset[md.mesh.elements - 1] < 0., axis=1) > 0.)[0]
+        vertexonfloatingice[md.mesh.elements[pos].astype(int) - 1] = 1.
+        vertexonicefront = np.logical_and(np.reshape(md.mesh.vertexonboundary, (-1, )), vertexonfloatingice > 0.)
 
-#	pos=find(md.mesh.vertexonboundary & ~vertexonicefront);
-	pos=np.nonzero(np.logical_and(md.mesh.vertexonboundary,np.logical_not(vertexonicefront)))[0]
-	if not np.size(pos):
-		print "SetMarineIceSheetBC warning: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually."
+    #pos = find(md.mesh.vertexonboundary & ~vertexonicefront)
+    pos = np.nonzero(np.logical_and(md.mesh.vertexonboundary, np.logical_not(vertexonicefront)))[0]
+    if not np.size(pos):
+        print("SetMarineIceSheetBC warning: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually.")
 
-	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.loadingforce=0*np.ones((md.mesh.numberofvertices,3))
+    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.loadingforce = 0 * np.ones((md.mesh.numberofvertices, 3))
 
-	#Position of ice front
-	pos=np.nonzero(vertexonicefront)[0]
-	md.mask.ice_levelset[pos]=0
+    #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
-	if m.strcmp(md.mesh.elementtype(),'Penta'):
-		numbernodesfront=4
-	elif m.strcmp(md.mesh.elementtype(),'Tria'):
-		numbernodesfront=2
-	else:
-			raise StandardError("Mesh type not supported")
-	if any(md.mask.ice_levelset<=0):
-		values=md.mask.ice_levelset[md.mesh.segments[:,0:-1]-1]
-		segmentsfront=1-values
-		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
-		pos=md.mesh.segments[segments,0:-1]-1
-	else:
-		pos=np.nonzero(md.mesh.vertexonboundary)[0]
-	md.stressbalance.spcvx[pos]=0
-	md.stressbalance.spcvy[pos]=0
-	md.stressbalance.spcvz[pos]=0
+    #First find segments that are not completely on the front
+    if md.mesh.elementtype() == 'Penta':
+        numbernodesfront = 4
+    elif md.mesh.elementtype() == 'Tria':
+        numbernodesfront = 2
+    else:
+        raise Exception("Mesh type not supported")
+    if any(md.mask.ice_levelset <= 0):
+        values = md.mask.ice_levelset[md.mesh.segments[:, 0:-1] - 1]
+        segmentsfront = 1 - values
+        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
+        pos = md.mesh.segments[segments, 0:-1] - 1
+    else:
+        pos = np.nonzero(md.mesh.vertexonboundary)[0]
+    md.stressbalance.spcvx[pos] = 0
+    md.stressbalance.spcvy[pos] = 0
+    md.stressbalance.spcvz[pos] = 0
 
-	#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"
-		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"
+    #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")
+        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")
 
-	md.hydrology.spcwatercolumn=np.zeros((md.mesh.numberofvertices,2))
-	pos=np.nonzero(md.mesh.vertexonboundary)[0]
-	md.hydrology.spcwatercolumn[pos,0]=1
+    md.hydrology.spcwatercolumn = np.zeros((md.mesh.numberofvertices, 2))
+    pos = np.nonzero(md.mesh.vertexonboundary)[0]
+    md.hydrology.spcwatercolumn[pos, 0] = 1
 
-	#Create zeros basalforcings and smb
-	md.smb.initialize(md)
-	md.basalforcings.initialize(md)
+    #Create zeros basalforcings and smb
+    md.smb.initialize(md)
+    md.basalforcings.initialize(md)
 
-	#Deal with other boundary conditions
-	if np.all(np.isnan(md.balancethickness.thickening_rate)):
-		md.balancethickness.thickening_rate=np.zeros((md.mesh.numberofvertices))
-		print "      no balancethickness.thickening_rate specified: values set as zero"
+    #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))
+    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))
 
-	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))
-		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
-		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.groundedice_levelset>0.)]=50.*10.**-3    #50mW/m2
-	else:
-		print "      no thermal boundary conditions created: no observed temperature found"
+    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))
+        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
+        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.groundedice_levelset > 0.)] = 50. * 10.**- 3  #50mW / m2
+    else:
+        print("      no thermal boundary conditions created: no observed temperature found")
 
-	return md
-
+    return md
Index: /issm/trunk/src/m/boundaryconditions/love_numbers.py
===================================================================
--- /issm/trunk/src/m/boundaryconditions/love_numbers.py	(revision 24312)
+++ /issm/trunk/src/m/boundaryconditions/love_numbers.py	(revision 24313)
@@ -1,10063 +1,10062 @@
-from MatlabFuncs import *
-from model import *
 import numpy as np
 
-def love_numbers(value,*varargin):
-#LOVE_NUMBERS: provide love numbers (value 'h','k','l','gamma' and 'lambda'
-#			   retrieved from: http://www.srosat.com/iag-jsg/loveNb.php
-#    Usage:   series=love_numbers(value) 
-#             series=love_numbers(value,reference_frame) 
-# 
-#             where value is one of 'h','k','l','gamma' and 'lambda'. 
-#	      reference_frame = one of 'CM' (default) and 'CF'.
-#
-#    Example:  
-#          love_k=love_numbers('k');
-#          love_k=love_numbers('k','CF');
-# 
 
-        # some checks:
-        if len(varargin)==0:
-        	frame='CM';
-		print 'Info: computation is done in Center of Mass (CM) reference frame by default'
-        elif len(varargin)==1: 
-		reference_frame = varargin[0]
-		if (reference_frame in ['CF','CM']):
-	            	frame=reference_frame;
-		else:
-			raise RuntimeError('reference_frame should be one of ''CM'' or ''CF''')
+def love_numbers(value, * varargin):
+    '''LOVE_NUMBERS: provide love numbers (value 'h', 'k', 'l', 'gamma' and 'lambda'
+             retrieved from: http://www.srosat.com/iag-jsg/loveNb.php
+    Usage:   series = love_numbers(value)
+           series = love_numbers(value, reference_frame)
+
+           where value is one of 'h', 'k', 'l', 'gamma' and 'lambda'.
+        reference_frame = one of 'CM' (default) and 'CF'.
+
+    Example:
+        love_k = love_numbers('k')
+        love_k = love_numbers('k', 'CF')
+
+    '''
+
+    # some checks:
+    if len(varargin) == 0:
+        frame = 'CM'
+        print('Info: computation is done in Center of Mass (CM) reference frame by default')
+    elif len(varargin) == 1:
+        reference_frame = varargin[0]
+        if (reference_frame in ['CF', 'CM']):
+            frame = reference_frame
         else:
-            	raise RuntimeError('love_numbers error message: bad usage') 
-        
-        if value not in ['h','k','l','gamma','lambda']:
-        	raise RuntimeError('value should be one of ''h'',''k'',''l'',''gamma'' and ''lambda''') 
-        
-        if len(varargin)>1: 
-            raise RuntimeError('love_numbers error message: wrong usage') 
-        
-        love_numbers=np.array([[    0         , 0          ,0          ,0          ,0          ,0          ,0          ],
-												 [	-1.28740059,-1.00000000,-0.89858519,1.28740059, 0.42519882  ,0.89858519 ,0.00000000 ],
-												 [	-1.00025365, -0.30922675, 0.02060926, 1.69102690, 0.46358648, 0.67016399, 0.61829668],
-												 [	-1.06243501, -0.19927948, 0.06801636, 1.86315553, 0.55741597, 0.73270416, 0.56270589],
-												 [	-1.06779588, -0.13649834, 0.05667027, 1.93129754, 0.63672498, 0.80683140, 0.51132745],
-												 [	-1.10365923, -0.10736896, 0.04401221, 1.99629027, 0.68737906, 0.84861883, 0.48642259],
-												 [	-1.16440348, -0.09295485, 0.03638747, 2.07144863, 0.72031283, 0.87065768, 0.47898268],
-												 [	-1.23634156, -0.08469861, 0.03202759, 2.15164295, 0.74355796, 0.88327380, 0.47955214],
-												 [	-1.31140380, -0.07921412, 0.02937593, 2.23218968, 0.76126493, 0.89140995, 0.48323250],
-												 [	-1.38582399, -0.07513541, 0.02762338, 2.31068858, 0.77552290, 0.89724121, 0.48795424],
-												 [	-1.45807465, -0.07187005, 0.02638627, 2.38620460, 0.78744212, 0.90174369, 0.49291061],
-												 [	-1.52763314, -0.06913154, 0.02547640, 2.45850160, 0.79766475, 0.90539206, 0.49779422],
-												 [	-1.59437866, -0.06676258, 0.02479080, 2.52761607, 0.80659635, 0.90844662, 0.50248477],
-												 [	-1.65833071, -0.06466619, 0.02426511, 2.59366452, 0.81451271, 0.91106870, 0.50693175],
-												 [	-1.71954820, -0.06277732, 0.02385464, 2.65677088, 0.82161167, 0.91336804, 0.51111243],
-												 [	-1.77809640, -0.06105001, 0.02352654, 2.71704639, 0.82804049, 0.91542346, 0.51501712],
-												 [	-1.83403970, -0.05945081, 0.02325609, 2.77458889, 0.83391153, 0.91729309, 0.51864363],
-												 [	-1.88744242, -0.05795502, 0.02302469, 2.82948740, 0.83931209, 0.91902029, 0.52199490],
-												 [	-1.93837115, -0.05654418, 0.02281843, 2.88182697, 0.84431095, 0.92063739, 0.52507761],
-												 [	-1.98689666, -0.05520447, 0.02262706, 2.93169219, 0.84896295, 0.92216847, 0.52790108],
-												 [	-2.03309477, -0.05392545, 0.02244322, 2.97916932, 0.85331225, 0.92363132, 0.53047654],
-												 [	-2.07704643, -0.05269926, 0.02226173, 3.02434717, 0.85739480, 0.92503902, 0.53281639],
-												 [	-2.11883714, -0.05151988, 0.02207909, 3.06731726, 0.86124014, 0.92640103, 0.53493369],
-												 [	-2.15855611, -0.05038274, 0.02189307, 3.10817337, 0.86487276, 0.92772419, 0.53684176],
-												 [	-2.19629514, -0.04928430, 0.02170238, 3.14701084, 0.86831322, 0.92901331, 0.53855386],
-												 [	-2.23214747, -0.04822179, 0.02150643, 3.18392568, 0.87157886, 0.93027178, 0.54008294],
-												 [	-2.26620674, -0.04719301, 0.02130509, 3.21901373, 0.87468453, 0.93150190, 0.54144148],
-												 [	-2.29856595, -0.04619619, 0.02109858, 3.25236976, 0.87764301, 0.93270523, 0.54264140],
-												 [	-2.32931659, -0.04522983, 0.02088735, 3.28408675, 0.88046543, 0.93388282, 0.54369397],
-												 [	-2.35854794, -0.04429270, 0.02067197, 3.31425524, 0.88316156, 0.93503533, 0.54460979],
-												 [	-2.38634650, -0.04338368, 0.02045310, 3.34296281, 0.88574004, 0.93616321, 0.54539877],
-												 [	-2.41279547, -0.04250179, 0.02023142, 3.37029367, 0.88820859, 0.93726678, 0.54607015],
-												 [	-2.43797451, -0.04164613, 0.02000761, 3.39632839, 0.89057416, 0.93834626, 0.54663248],
-												 [	-2.46195951, -0.04081583, 0.01978231, 3.42114367, 0.89284301, 0.93940185, 0.54709369],
-												 [	-2.48482241, -0.04001011, 0.01955614, 3.44481230, 0.89502085, 0.94043375, 0.54746112],
-												 [	-2.50663126, -0.03922817, 0.01932966, 3.46740309, 0.89711291, 0.94144217, 0.54774153],
-												 [	-2.52745016, -0.03846928, 0.01910337, 3.48898088, 0.89912397, 0.94242735, 0.54794114],
-												 [	-2.54733938, -0.03773269, 0.01887774, 3.50960670, 0.90105847, 0.94338957, 0.54806571],
-												 [	-2.56635547, -0.03701769, 0.01865317, 3.52933779, 0.90292050, 0.94432915, 0.54812051],
-												 [	-2.58455138, -0.03632358, 0.01843000, 3.54822780, 0.90471386, 0.94524642, 0.54811044],
-												 [	-2.60197665, -0.03564968, 0.01820854, 3.56632697, 0.90644209, 0.94614178, 0.54803997],
-												 [	-2.61867756, -0.03499532, 0.01798905, 3.58368224, 0.90810850, 0.94701563, 0.54791326],
-												 [	-2.63469733, -0.03435985, 0.01777176, 3.60033748, 0.90971616, 0.94786840, 0.54773413],
-												 [	-2.65007629, -0.03374263, 0.01755683, 3.61633367, 0.91126798, 0.94870054, 0.54750610],
-												 [	-2.66485208, -0.03314303, 0.01734443, 3.63170905, 0.91276665, 0.94951253, 0.54723245],
-												 [	-2.67905981, -0.03256047, 0.01713468, 3.64649934, 0.91421471, 0.95030485, 0.54691620],
-												 [	-2.69273222, -0.03199435, 0.01692767, 3.66073787, 0.91561457, 0.95107798, 0.54656015],
-												 [	-2.70589990, -0.03144411, 0.01672347, 3.67445580, 0.91696845, 0.95183242, 0.54616691],
-												 [	-2.71859139, -0.03090919, 0.01652215, 3.68768220, 0.91827849, 0.95256866, 0.54573889],
-												 [	-2.73083334, -0.03038907, 0.01632374, 3.70044427, 0.91954667, 0.95328719, 0.54527835],
-												 [	-2.74265068, -0.02988323, 0.01612826, 3.71276745, 0.92077487, 0.95398851, 0.54478739],
-												 [	-2.75406669, -0.02939118, 0.01593573, 3.72467551, 0.92196486, 0.95467309, 0.54426797],
-												 [	-2.76510320, -0.02891245, 0.01574615, 3.73619076, 0.92311833, 0.95534141, 0.54372191],
-												 [	-2.77578063, -0.02844656, 0.01555950, 3.74733406, 0.92423685, 0.95599393, 0.54315095],
-												 [	-2.78611812, -0.02799309, 0.01537578, 3.75812503, 0.92532192, 0.95663113, 0.54255669],
-												 [	-2.79613364, -0.02755161, 0.01519496, 3.76858203, 0.92637496, 0.95725343, 0.54194065],
-												 [	-2.80584405, -0.02712170, 0.01501701, 3.77872235, 0.92739730, 0.95786128, 0.54130424],
-												 [	-2.81526521, -0.02670298, 0.01484191, 3.78856223, 0.92839022, 0.95845511, 0.54064880],
-												 [	-2.82441204, -0.02629506, 0.01466961, 3.79811697, 0.92935491, 0.95903532, 0.53997561],
-												 [	-2.83329857, -0.02589759, 0.01450009, 3.80740098, 0.93029251, 0.95960232, 0.53928586],
-												 [	-2.84193804, -0.02551021, 0.01433329, 3.81642782, 0.93120412, 0.96015649, 0.53858067],
-												 [	-2.85034293, -0.02513260, 0.01416919, 3.82521033, 0.93209074, 0.96069821, 0.53786112],
-												 [	-2.85852503, -0.02476443, 0.01400773, 3.83376061, 0.93295337, 0.96122784, 0.53712821],
-												 [	-2.86649548, -0.02440538, 0.01384888, 3.84209010, 0.93379291, 0.96174574, 0.53638291],
-												 [	-2.87426481, -0.02405518, 0.01369258, 3.85020963, 0.93461026, 0.96225224, 0.53562612],
-												 [	-2.88184299, -0.02371352, 0.01353880, 3.85812947, 0.93540625, 0.96274768, 0.53485873],
-												 [	-2.88923945, -0.02338014, 0.01338749, 3.86585931, 0.93618168, 0.96323236, 0.53408154],
-												 [	-2.89646316, -0.02305478, 0.01323861, 3.87340838, 0.93693730, 0.96370661, 0.53329534],
-												 [	-2.90352261, -0.02273718, 0.01309211, 3.88078542, 0.93767383, 0.96417071, 0.53250089],
-												 [	-2.91042585, -0.02242710, 0.01294795, 3.88799874, 0.93839197, 0.96462494, 0.53169888],
-												 [	-2.91718054, -0.02212431, 0.01280609, 3.89505623, 0.93909236, 0.96506960, 0.53089002],
-												 [	-2.92379397, -0.02182859, 0.01266648, 3.90196538, 0.93977564, 0.96550493, 0.53007493],
-												 [	-2.93027306, -0.02153971, 0.01252908, 3.90873334, 0.94044240, 0.96593120, 0.52925424],
-												 [	-2.93662439, -0.02125748, 0.01239386, 3.91536691, 0.94109322, 0.96634866, 0.52842854],
-												 [	-2.94285425, -0.02098169, 0.01226077, 3.92187256, 0.94172863, 0.96675754, 0.52759839],
-												 [	-2.94896860, -0.02071215, 0.01212977, 3.92825645, 0.94234915, 0.96715808, 0.52676434],
-												 [	-2.95497314, -0.02044868, 0.01200082, 3.93452446, 0.94295529, 0.96755050, 0.52592690],
-												 [	-2.96087331, -0.02019110, 0.01187388, 3.94068220, 0.94354752, 0.96793501, 0.52508656],
-												 [	-2.96667427, -0.01993924, 0.01174893, 3.94673503, 0.94412630, 0.96831183, 0.52424380],
-												 [	-2.97238097, -0.01969293, 0.01162591, 3.95268804, 0.94469206, 0.96868116, 0.52339906],
-												 [	-2.97799813, -0.01945201, 0.01150481, 3.95854612, 0.94524521, 0.96904318, 0.52255277],
-												 [	-2.98353025, -0.01921634, 0.01138557, 3.96431391, 0.94578617, 0.96939809, 0.52170535],
-												 [	-2.98898162, -0.01898576, 0.01126817, 3.96999586, 0.94631531, 0.96974607, 0.52085719],
-												 [	-2.99435636, -0.01876014, 0.01115257, 3.97559622, 0.94683300, 0.97008729, 0.52000868],
-												 [	-2.99965838, -0.01853932, 0.01103875, 3.98111905, 0.94733959, 0.97042193, 0.51916016],
-												 [	-3.00489143, -0.01832319, 0.01092666, 3.98656824, 0.94783543, 0.97075015, 0.51831198],
-												 [	-3.01005909, -0.01811161, 0.01081628, 3.99194748, 0.94832084, 0.97107211, 0.51746448],
-												 [	-3.01516479, -0.01790446, 0.01070757, 3.99726033, 0.94879613, 0.97138796, 0.51661796],
-												 [	-3.02021180, -0.01770162, 0.01060052, 4.00251017, 0.94926160, 0.97169786, 0.51577273],
-												 [	-3.02520323, -0.01750298, 0.01049508, 4.00770025, 0.94971755, 0.97200194, 0.51492908],
-												 [	-3.03014209, -0.01730842, 0.01039123, 4.01283367, 0.95016424, 0.97230035, 0.51408727],
-												 [	-3.03503122, -0.01711783, 0.01028894, 4.01791339, 0.95060195, 0.97259323, 0.51324758],
-												 [	-3.03987336, -0.01693111, 0.01018819, 4.02294225, 0.95103094, 0.97288070, 0.51241024],
-												 [	-3.04467112, -0.01674816, 0.01008894, 4.02792295, 0.95145145, 0.97316290, 0.51157550],
-												 [	-3.04942699, -0.01656889, 0.00999117, 4.03285810, 0.95186373, 0.97343995, 0.51074358],
-												 [	-3.05414335, -0.01639319, 0.00989485, 4.03775017, 0.95226799, 0.97371196, 0.50991471],
-												 [	-3.05882250, -0.01622097, 0.00979997, 4.04260153, 0.95266447, 0.97397906, 0.50908908],
-												 [	-3.06346660, -0.01605215, 0.00970649, 4.04741445, 0.95305338, 0.97424136, 0.50826689],
-												 [	-3.06807773, -0.01588664, 0.00961439, 4.05219109, 0.95343492, 0.97449897, 0.50744832],
-												 [	-3.07265789, -0.01572436, 0.00952364, 4.05693353, 0.95380929, 0.97475200, 0.50663356],
-												 [	-3.07720897, -0.01556522, 0.00943423, 4.06164375, 0.95417670, 0.97500055, 0.50582277],
-												 [	-3.08173279, -0.01540916, 0.00934613, 4.06632364, 0.95453731, 0.97524472, 0.50501611],
-												 [	-3.08623109, -0.01525608, 0.00925931, 4.07097501, 0.95489131, 0.97548461, 0.50421372],
-												 [	-3.09070551, -0.01510592, 0.00917376, 4.07559959, 0.95523888, 0.97572032, 0.50341576],
-												 [	-3.09515765, -0.01495861, 0.00908946, 4.08019904, 0.95558018, 0.97595193, 0.50262236],
-												 [	-3.09958899, -0.01481408, 0.00900637, 4.08477492, 0.95591537, 0.97617955, 0.50183364],
-												 [	-3.10400100, -0.01467225, 0.00892449, 4.08932875, 0.95624461, 0.97640325, 0.50104973],
-												 [	-3.10839504, -0.01453308, 0.00884379, 4.09386196, 0.95656806, 0.97662313, 0.50027073],
-												 [	-3.11277241, -0.01439648, 0.00876425, 4.09837593, 0.95688585, 0.97683927, 0.49949676],
-												 [	-3.11713438, -0.01426240, 0.00868586, 4.10287198, 0.95719812, 0.97705174, 0.49872791],
-												 [	-3.12148213, -0.01413079, 0.00860858, 4.10735134, 0.95750503, 0.97726063, 0.49796429],
-												 [	-3.12581680, -0.01400157, 0.00853241, 4.11181522, 0.95780669, 0.97746601, 0.49720597],
-												 [	-3.13013947, -0.01387471, 0.00845733, 4.11626476, 0.95810324, 0.97766796, 0.49645304],
-												 [	-3.13445117, -0.01375013, 0.00838331, 4.12070104, 0.95839480, 0.97786656, 0.49570558],
-												 [	-3.13875289, -0.01362779, 0.00831034, 4.12512510, 0.95868150, 0.97806186, 0.49496366],
-												 [	-3.14304556, -0.01350764, 0.00823841, 4.12953792, 0.95896344, 0.97825395, 0.49422734],
-												 [	-3.14733008, -0.01338963, 0.00816748, 4.13394045, 0.95924075, 0.97844289, 0.49349669],
-												 [	-3.15160728, -0.01327370, 0.00809756, 4.13833358, 0.95951352, 0.97862874, 0.49277177],
-												 [	-3.15587797, -0.01315981, 0.00802862, 4.14271816, 0.95978188, 0.97881157, 0.49205262],
-												 [	-3.16014293, -0.01304792, 0.00796064, 4.14709501, 0.96004592, 0.97899144, 0.49133930],
-												 [	-3.16440288, -0.01293797, 0.00789361, 4.15146491, 0.96030574, 0.97916842, 0.49063185],
-												 [	-3.16865852, -0.01282993, 0.00782751, 4.15582858, 0.96056144, 0.97934256, 0.48993030],
-												 [	-3.17291049, -0.01272375, 0.00776233, 4.16018673, 0.96081312, 0.97951392, 0.48923471],
-												 [	-3.17715942, -0.01261940, 0.00769805, 4.16454003, 0.96106086, 0.97968255, 0.48854509],
-												 [	-3.18140591, -0.01251682, 0.00763466, 4.16888910, 0.96130476, 0.97984852, 0.48786148],
-												 [	-3.18565052, -0.01241598, 0.00757215, 4.17323454, 0.96154490, 0.98001187, 0.48718390],
-												 [	-3.18989378, -0.01231685, 0.00751049, 4.17757693, 0.96178137, 0.98017266, 0.48651237],
-												 [	-3.19413619, -0.01221938, 0.00744968, 4.18191681, 0.96201424, 0.98033094, 0.48584692],
-												 [	-3.19837823, -0.01212354, 0.00738970, 4.18625469, 0.96224360, 0.98048676, 0.48518756],
-												 [	-3.20262035, -0.01202930, 0.00733053, 4.19059105, 0.96246952, 0.98064017, 0.48453431],
-												 [	-3.20686298, -0.01193661, 0.00727217, 4.19492637, 0.96269208, 0.98079121, 0.48388717],
-												 [	-3.21110653, -0.01184546, 0.00721461, 4.19926107, 0.96291135, 0.98093994, 0.48324615],
-												 [	-3.21535137, -0.01175579, 0.00715782, 4.20359557, 0.96312741, 0.98108639, 0.48261126],
-												 [	-3.21959786, -0.01166759, 0.00710179, 4.20793027, 0.96334031, 0.98123062, 0.48198250],
-												 [	-3.22384634, -0.01158082, 0.00704652, 4.21226552, 0.96355014, 0.98137266, 0.48135988],
-												 [	-3.22809714, -0.01149545, 0.00699199, 4.21660169, 0.96375694, 0.98151256, 0.48074338],
-												 [	-3.23235055, -0.01141146, 0.00693819, 4.22093909, 0.96396080, 0.98165035, 0.48013301],
-												 [	-3.23660685, -0.01132880, 0.00688511, 4.22527805, 0.96416176, 0.98178609, 0.47952876],
-												 [	-3.24086631, -0.01124746, 0.00683273, 4.22961885, 0.96435989, 0.98191980, 0.47893063],
-												 [	-3.24512918, -0.01116741, 0.00678105, 4.23396177, 0.96455525, 0.98205153, 0.47833860],
-												 [	-3.24939569, -0.01108862, 0.00673005, 4.23830707, 0.96474789, 0.98218132, 0.47775267],
-												 [	-3.25366606, -0.01101107, 0.00667973, 4.24265499, 0.96493787, 0.98230920, 0.47717282],
-												 [	-3.25794050, -0.01093473, 0.00663007, 4.24700577, 0.96512525, 0.98243520, 0.47659903],
-												 [	-3.26221918, -0.01085957, 0.00658106, 4.25135961, 0.96531007, 0.98255937, 0.47603130],
-												 [	-3.26650230, -0.01078557, 0.00653269, 4.25571672, 0.96549239, 0.98268174, 0.47546960],
-												 [	-3.27079000, -0.01071272, 0.00648495, 4.26007729, 0.96567225, 0.98280233, 0.47491391],
-												 [	-3.27508246, -0.01064097, 0.00643784, 4.26444149, 0.96584971, 0.98292119, 0.47436422],
-												 [	-3.27937980, -0.01057032, 0.00639134, 4.26880948, 0.96602482, 0.98303834, 0.47382051],
-												 [	-3.28368216, -0.01050074, 0.00634544, 4.27318141, 0.96619761, 0.98315382, 0.47328275],
-												 [	-3.28798965, -0.01043222, 0.00630013, 4.27755743, 0.96636814, 0.98326765, 0.47275091],
-												 [	-3.29230239, -0.01036472, 0.00625541, 4.28193767, 0.96653645, 0.98337988, 0.47222499],
-												 [	-3.29662047, -0.01029823, 0.00621126, 4.28632224, 0.96670258, 0.98349051, 0.47170494],
-												 [	-3.30094399, -0.01023273, 0.00616768, 4.29071126, 0.96686657, 0.98359960, 0.47119074],
-												 [	-3.30527303, -0.01016819, 0.00612465, 4.29510483, 0.96702847, 0.98370715, 0.47068237],
-												 [	-3.30960766, -0.01010461, 0.00608218, 4.29950304, 0.96718831, 0.98381321, 0.47017979],
-												 [	-3.31394795, -0.01004197, 0.00604024, 4.30390598, 0.96734614, 0.98391779, 0.46968299],
-												 [	-3.31829395, -0.00998024, 0.00599883, 4.30831372, 0.96750198, 0.98402093, 0.46919192],
-												 [	-3.32264573, -0.00991940, 0.00595795, 4.31272633, 0.96765588, 0.98412265, 0.46870656],
-												 [	-3.32700331, -0.00985945, 0.00591759, 4.31714387, 0.96780788, 0.98422297, 0.46822687],
-												 [	-3.33136675, -0.00980035, 0.00587773, 4.32156640, 0.96795801, 0.98432191, 0.46775284],
-												 [	-3.33573607, -0.00974211, 0.00583838, 4.32599396, 0.96810630, 0.98441951, 0.46728441],
-												 [	-3.34011130, -0.00968470, 0.00579951, 4.33042660, 0.96825278, 0.98451579, 0.46682157],
-												 [	-3.34449246, -0.00962810, 0.00576113, 4.33486436, 0.96839750, 0.98461077, 0.46636427],
-												 [	-3.34887956, -0.00957230, 0.00572323, 4.33930726, 0.96854048, 0.98470447, 0.46591248],
-												 [	-3.35327261, -0.00951729, 0.00568581, 4.34375533, 0.96868175, 0.98479691, 0.46546617],
-												 [	-3.35767163, -0.00946304, 0.00564884, 4.34820858, 0.96882135, 0.98488812, 0.46502531],
-												 [	-3.36207660, -0.00940956, 0.00561233, 4.35266704, 0.96895930, 0.98497811, 0.46458986],
-												 [	-3.36648753, -0.00935681, 0.00557627, 4.35713071, 0.96909563, 0.98506691, 0.46415977],
-												 [	-3.37090440, -0.00930480, 0.00554066, 4.36159960, 0.96923037, 0.98515454, 0.46373503],
-												 [	-3.37532721, -0.00925350, 0.00550548, 4.36607371, 0.96936355, 0.98524102, 0.46331559],
-												 [	-3.37975593, -0.00920290, 0.00547073, 4.37055303, 0.96949520, 0.98532636, 0.46290141],
-												 [	-3.38419056, -0.00915300, 0.00543641, 4.37503756, 0.96962535, 0.98541059, 0.46249246],
-												 [	-3.38863105, -0.00910377, 0.00540251, 4.37952729, 0.96975401, 0.98549373, 0.46208870],
-												 [	-3.39307740, -0.00905520, 0.00536901, 4.38402220, 0.96988122, 0.98557578, 0.46169009],
-												 [	-3.39752956, -0.00900729, 0.00533593, 4.38852227, 0.97000699, 0.98565678, 0.46129660],
-												 [	-3.40198751, -0.00896002, 0.00530324, 4.39302749, 0.97013137, 0.98573674, 0.46090819],
-												 [	-3.40645121, -0.00891338, 0.00527095, 4.39753783, 0.97025435, 0.98581567, 0.46052482],
-												 [	-3.41092063, -0.00886736, 0.00523904, 4.40205326, 0.97037598, 0.98589360, 0.46014645],
-												 [	-3.41539571, -0.00882195, 0.00520752, 4.40657376, 0.97049628, 0.98597053, 0.45977305],
-												 [	-3.41987643, -0.00877713, 0.00517637, 4.41109929, 0.97061526, 0.98604649, 0.45940458],
-												 [	-3.42436272, -0.00873290, 0.00514560, 4.41562982, 0.97073295, 0.98612149, 0.45904100],
-												 [	-3.42885456, -0.00868925, 0.00511520, 4.42016531, 0.97084936, 0.98619555, 0.45868227],
-												 [	-3.43335188, -0.00864617, 0.00508515, 4.42470571, 0.97096453, 0.98626868, 0.45832835],
-												 [	-3.43785464, -0.00860364, 0.00505546, 4.42925100, 0.97107847, 0.98634090, 0.45797921],
-												 [	-3.44236278, -0.00856166, 0.00502613, 4.43380112, 0.97119120, 0.98641222, 0.45763480],
-												 [	-3.44687625, -0.00852021, 0.00499714, 4.43835604, 0.97130274, 0.98648265, 0.45729509],
-												 [	-3.45139500, -0.00847930, 0.00496849, 4.44291570, 0.97141311, 0.98655221, 0.45696005],
-												 [	-3.45591895, -0.00843890, 0.00494017, 4.44748005, 0.97152233, 0.98662092, 0.45662962],
-												 [	-3.46044807, -0.00839902, 0.00491219, 4.45204905, 0.97163042, 0.98668879, 0.45630378],
-												 [	-3.46498227, -0.00835964, 0.00488454, 4.45662264, 0.97173739, 0.98675583, 0.45598249],
-												 [	-3.46952151, -0.00832075, 0.00485721, 4.46120077, 0.97184326, 0.98682205, 0.45566570],
-												 [	-3.47406572, -0.00828234, 0.00483019, 4.46578338, 0.97194805, 0.98688746, 0.45535338],
-												 [	-3.47861484, -0.00824442, 0.00480349, 4.47037042, 0.97205179, 0.98695209, 0.45504550],
-												 [	-3.48316880, -0.00820696, 0.00477710, 4.47496184, 0.97215447, 0.98701594, 0.45474201],
-												 [	-3.48772753, -0.00816996, 0.00475102, 4.47955756, 0.97225612, 0.98707902, 0.45444287],
-												 [	-3.49229097, -0.00813342, 0.00472523, 4.48415755, 0.97235676, 0.98714134, 0.45414806],
-												 [	-3.49685904, -0.00809733, 0.00469975, 4.48876172, 0.97245640, 0.98720293, 0.45385753],
-												 [	-3.50143169, -0.00806167, 0.00467455, 4.49337002, 0.97255506, 0.98726378, 0.45357123],
-												 [	-3.50600884, -0.00802644, 0.00464964, 4.49798240, 0.97265275, 0.98732391, 0.45328915],
-												 [	-3.51059042, -0.00799164, 0.00462502, 4.50259878, 0.97274949, 0.98738333, 0.45301123],
-												 [	-3.51517637, -0.00795726, 0.00460068, 4.50721911, 0.97284528, 0.98744206, 0.45273745],
-												 [	-3.51976660, -0.00792329, 0.00457662, 4.51184331, 0.97294015, 0.98750009, 0.45246776],
-												 [	-3.52436105, -0.00788972, 0.00455283, 4.51647133, 0.97303411, 0.98755745, 0.45220214],
-												 [	-3.52895964, -0.00785655, 0.00452930, 4.52110309, 0.97312718, 0.98761414, 0.45194053],
-												 [	-3.53356231, -0.00782377, 0.00450605, 4.52573854, 0.97321936, 0.98767018, 0.45168291],
-												 [	-3.53816898, -0.00779138, 0.00448306, 4.53037760, 0.97331067, 0.98772556, 0.45142923],
-												 [	-3.54277957, -0.00775937, 0.00446032, 4.53502021, 0.97340111, 0.98778031, 0.45117947],
-												 [	-3.54739402, -0.00772773, 0.00443784, 4.53966629, 0.97349072, 0.98783443, 0.45093359],
-												 [	-3.55201224, -0.00769645, 0.00441562, 4.54431579, 0.97357949, 0.98788793, 0.45069155],
-												 [	-3.55663417, -0.00766554, 0.00439364, 4.54896864, 0.97366744, 0.98794082, 0.45045331],
-												 [	-3.56125973, -0.00763498, 0.00437190, 4.55362475, 0.97375458, 0.98799311, 0.45021885],
-												 [	-3.56588885, -0.00760478, 0.00435041, 4.55828407, 0.97384092, 0.98804481, 0.44998812],
-												 [	-3.57052145, -0.00757491, 0.00432916, 4.56294653, 0.97392648, 0.98809593, 0.44976109],
-												 [	-3.57515745, -0.00754539, 0.00430814, 4.56761206, 0.97401126, 0.98814646, 0.44953772],
-												 [	-3.57979678, -0.00751620, 0.00428736, 4.57228058, 0.97409528, 0.98819644, 0.44931799],
-												 [	-3.58443937, -0.00748734, 0.00426681, 4.57695203, 0.97417854, 0.98824585, 0.44910185],
-												 [	-3.58908514, -0.00745880, 0.00424648, 4.58162633, 0.97426107, 0.98829472, 0.44888928],
-												 [	-3.59373401, -0.00743059, 0.00422637, 4.58630343, 0.97434286, 0.98834304, 0.44868023],
-												 [	-3.59838592, -0.00740268, 0.00420649, 4.59098323, 0.97442393, 0.98839083, 0.44847468],
-												 [	-3.60304078, -0.00737509, 0.00418682, 4.59566569, 0.97450428, 0.98843809, 0.44827259],
-												 [	-3.60769852, -0.00734780, 0.00416737, 4.60035072, 0.97458394, 0.98848483, 0.44807392],
-												 [	-3.61235907, -0.00732081, 0.00414813, 4.60503826, 0.97466290, 0.98853106, 0.44787865],
-												 [	-3.61702235, -0.00729411, 0.00412910, 4.60972823, 0.97474118, 0.98857678, 0.44768674],
-												 [	-3.62168828, -0.00726771, 0.00411028, 4.61442057, 0.97481879, 0.98862201, 0.44749816],
-												 [	-3.62635680, -0.00724159, 0.00409166, 4.61911521, 0.97489573, 0.98866675, 0.44731288],
-												 [	-3.63102782, -0.00721575, 0.00407325, 4.62381207, 0.97497202, 0.98871100, 0.44713086],
-												 [	-3.63570128, -0.00719020, 0.00405503, 4.62851108, 0.97504766, 0.98875478, 0.44695207],
-												 [	-3.64037709, -0.00716491, 0.00403700, 4.63321218, 0.97512267, 0.98879808, 0.44677649],
-												 [	-3.64505519, -0.00713990, 0.00401918, 4.63791530, 0.97519704, 0.98884093, 0.44660407],
-												 [	-3.64973550, -0.00711515, 0.00400154, 4.64262036, 0.97527080, 0.98888331, 0.44643478],
-												 [	-3.65441795, -0.00709066, 0.00398409, 4.64732729, 0.97534394, 0.98892525, 0.44626861],
-												 [	-3.65910247, -0.00706643, 0.00396683, 4.65203604, 0.97541648, 0.98896674, 0.44610551],
-												 [	-3.66378898, -0.00704246, 0.00394975, 4.65674652, 0.97548842, 0.98900779, 0.44594545],
-												 [	-3.66847740, -0.00701873, 0.00393286, 4.66145867, 0.97555978, 0.98904841, 0.44578841],
-												 [	-3.67316767, -0.00699526, 0.00391614, 4.66617242, 0.97563055, 0.98908860, 0.44563435],
-												 [	-3.67785972, -0.00697202, 0.00389960, 4.67088770, 0.97570076, 0.98912838, 0.44548324],
-												 [	-3.68255347, -0.00694903, 0.00388324, 4.67560444, 0.97577039, 0.98916773, 0.44533506],
-												 [	-3.68724885, -0.00692627, 0.00386705, 4.68032258, 0.97583947, 0.98920668, 0.44518977],
-												 [	-3.69194579, -0.00690374, 0.00385103, 4.68504204, 0.97590800, 0.98924523, 0.44504735],
-												 [	-3.69664421, -0.00688145, 0.00383518, 4.68976277, 0.97597598, 0.98928338, 0.44490776],
-												 [	-3.70134406, -0.00685938, 0.00381949, 4.69448468, 0.97604342, 0.98932113, 0.44477099],
-												 [	-3.70604525, -0.00683753, 0.00380397, 4.69920772, 0.97611034, 0.98935850, 0.44463698],
-												 [	-3.71074772, -0.00681590, 0.00378861, 4.70393182, 0.97617673, 0.98939548, 0.44450573],
-												 [	-3.71545140, -0.00679449, 0.00377342, 4.70865691, 0.97624261, 0.98943209, 0.44437720],
-												 [	-3.72015622, -0.00677330, 0.00375838, 4.71338292, 0.97630797, 0.98946833, 0.44425137],
-												 [	-3.72486211, -0.00675231, 0.00374349, 4.71810980, 0.97637283, 0.98950420, 0.44412820],
-												 [	-3.72956899, -0.00673153, 0.00372877, 4.72283746, 0.97643720, 0.98953970, 0.44400767],
-												 [	-3.73427682, -0.00671096, 0.00371419, 4.72756585, 0.97650107, 0.98957485, 0.44388975],
-												 [	-3.73898550, -0.00669059, 0.00369976, 4.73229491, 0.97656446, 0.98960965, 0.44377441],
-												 [	-3.74369498, -0.00667042, 0.00368549, 4.73702457, 0.97662737, 0.98964409, 0.44366163],
-												 [	-3.74840519, -0.00665044, 0.00367136, 4.74175475, 0.97668980, 0.98967820, 0.44355139],
-												 [	-3.75311607, -0.00663066, 0.00365738, 4.74648541, 0.97675177, 0.98971196, 0.44344364],
-												 [	-3.75782754, -0.00661107, 0.00364354, 4.75121648, 0.97681327, 0.98974540, 0.44333838],
-												 [	-3.76253955, -0.00659167, 0.00362984, 4.75594788, 0.97687432, 0.98977850, 0.44323557],
-												 [	-3.76725202, -0.00657245, 0.00361628, 4.76067957, 0.97693492, 0.98981127, 0.44313518],
-												 [	-3.77196489, -0.00655341, 0.00360286, 4.76541147, 0.97699508, 0.98984372, 0.44303720],
-												 [	-3.77667809, -0.00653456, 0.00358958, 4.77014353, 0.97705479, 0.98987586, 0.44294159],
-												 [	-3.78139156, -0.00651589, 0.00357643, 4.77487568, 0.97711407, 0.98990768, 0.44284833],
-												 [	-3.78610525, -0.00649739, 0.00356342, 4.77960786, 0.97717292, 0.98993920, 0.44275740],
-												 [	-3.79081907, -0.00647906, 0.00355053, 4.78434001, 0.97723134, 0.98997040, 0.44266877],
-												 [	-3.79553298, -0.00646091, 0.00353778, 4.78907207, 0.97728935, 0.99000131, 0.44258241],
-												 [	-3.80024690, -0.00644292, 0.00352516, 4.79380398, 0.97734694, 0.99003192, 0.44249831],
-												 [	-3.80496078, -0.00642510, 0.00351266, 4.79853567, 0.97740413, 0.99006223, 0.44241644],
-												 [	-3.80967455, -0.00640745, 0.00350029, 4.80326710, 0.97746090, 0.99009226, 0.44233677],
-												 [	-3.81438815, -0.00638996, 0.00348804, 4.80799819, 0.97751728, 0.99012200, 0.44225928],
-												 [	-3.81910152, -0.00637262, 0.00347592, 4.81272889, 0.97757326, 0.99015145, 0.44218395],
-												 [	-3.82381460, -0.00635545, 0.00346392, 4.81745915, 0.97762886, 0.99018063, 0.44211076],
-												 [	-3.82852732, -0.00633843, 0.00345204, 4.82218889, 0.97768406, 0.99020953, 0.44203968],
-												 [	-3.83323964, -0.00632157, 0.00344027, 4.82691808, 0.97773889, 0.99023816, 0.44197068],
-												 [	-3.83795149, -0.00630485, 0.00342863, 4.83164664, 0.97779333, 0.99026652, 0.44190376],
-												 [	-3.84266280, -0.00628829, 0.00341709, 4.83637452, 0.97784741, 0.99029462, 0.44183887],
-												 [	-3.84737353, -0.00627187, 0.00340568, 4.84110166, 0.97790111, 0.99032245, 0.44177601],
-												 [	-3.85208361, -0.00625560, 0.00339437, 4.84582801, 0.97795446, 0.99035003, 0.44171515],
-												 [	-3.85679299, -0.00623948, 0.00338318, 4.85055351, 0.97800744, 0.99037735, 0.44165627],
-												 [	-3.86150160, -0.00622349, 0.00337210, 4.85527811, 0.97806006, 0.99040441, 0.44159934],
-												 [	-3.86620939, -0.00620765, 0.00336112, 4.86000175, 0.97811233, 0.99043123, 0.44154435],
-												 [	-3.87091631, -0.00619194, 0.00335026, 4.86472437, 0.97816426, 0.99045780, 0.44149127],
-												 [	-3.87562229, -0.00617637, 0.00333950, 4.86944592, 0.97821584, 0.99048413, 0.44144009],
-												 [	-3.88032729, -0.00616094, 0.00332885, 4.87416635, 0.97826708, 0.99051022, 0.44139078],
-												 [	-3.88503124, -0.00614564, 0.00331830, 4.87888561, 0.97831798, 0.99053607, 0.44134332],
-												 [	-3.88973410, -0.00613047, 0.00330785, 4.88360363, 0.97836855, 0.99056168, 0.44129769],
-												 [	-3.89443580, -0.00611543, 0.00329750, 4.88832037, 0.97841879, 0.99058707, 0.44125387],
-												 [	-3.89913629, -0.00610051, 0.00328726, 4.89303577, 0.97846870, 0.99061223, 0.44121185],
-												 [	-3.90383552, -0.00608573, 0.00327711, 4.89774979, 0.97851829, 0.99063716, 0.44117159],
-												 [	-3.90853343, -0.00607107, 0.00326707, 4.90246236, 0.97856756, 0.99066187, 0.44113309],
-												 [	-3.91322998, -0.00605653, 0.00325712, 4.90717345, 0.97861652, 0.99068635, 0.44109632],
-												 [	-3.91792511, -0.00604212, 0.00324726, 4.91188299, 0.97866516, 0.99071062, 0.44106126],
-												 [	-3.92261876, -0.00602782, 0.00323750, 4.91659094, 0.97871350, 0.99073468, 0.44102790],
-												 [	-3.92731089, -0.00601364, 0.00322784, 4.92129724, 0.97876153, 0.99075852, 0.44099621],
-												 [	-3.93200144, -0.00599958, 0.00321826, 4.92600186, 0.97880926, 0.99078215, 0.44096618],
-												 [	-3.93669036, -0.00598564, 0.00320878, 4.93070472, 0.97885669, 0.99080558, 0.44093779],
-												 [	-3.94137761, -0.00597181, 0.00319939, 4.93540580, 0.97890383, 0.99082880, 0.44091101],
-												 [	-3.94606313, -0.00595809, 0.00319009, 4.94010504, 0.97895067, 0.99085182, 0.44088584],
-												 [	-3.95074687, -0.00594449, 0.00318088, 4.94480238, 0.97899722, 0.99087463, 0.44086225],
-												 [	-3.95542878, -0.00593099, 0.00317175, 4.94949779, 0.97904349, 0.99089725, 0.44084022],
-												 [	-3.96010882, -0.00591761, 0.00316271, 4.95419121, 0.97908947, 0.99091968, 0.44081975],
-												 [	-3.96478693, -0.00590433, 0.00315376, 4.95888260, 0.97913517, 0.99094191, 0.44080080],
-												 [	-3.96946306, -0.00589116, 0.00314489, 4.96357191, 0.97918060, 0.99096395, 0.44078336],
-												 [	-3.97413718, -0.00587809, 0.00313611, 4.96825909, 0.97922575, 0.99098581, 0.44076742],
-												 [	-3.97880922, -0.00586512, 0.00312740, 4.97294410, 0.97927063, 0.99100747, 0.44075296],
-												 [	-3.98347915, -0.00585226, 0.00311878, 4.97762689, 0.97931524, 0.99102895, 0.44073996],
-												 [	-3.98814692, -0.00583950, 0.00311024, 4.98230742, 0.97935959, 0.99105026, 0.44072841],
-												 [	-3.99281247, -0.00582684, 0.00310178, 4.98698564, 0.97940367, 0.99107138, 0.44071828],
-												 [	-3.99747577, -0.00581428, 0.00309340, 4.99166150, 0.97944749, 0.99109232, 0.44070956],
-												 [	-4.00213677, -0.00580181, 0.00308510, 4.99633496, 0.97949105, 0.99111309, 0.44070224],
-												 [	-4.00679542, -0.00578944, 0.00307688, 5.00100598, 0.97953436, 0.99113368, 0.44069630],
-												 [	-4.01145168, -0.00577717, 0.00306873, 5.00567451, 0.97957741, 0.99115410, 0.44069173],
-												 [	-4.01610551, -0.00576499, 0.00306065, 5.01034052, 0.97962021, 0.99117436, 0.44068850],
-												 [	-4.02075685, -0.00575290, 0.00305266, 5.01500395, 0.97966277, 0.99119444, 0.44068660],
-												 [	-4.02540567, -0.00574091, 0.00304473, 5.01966476, 0.97970508, 0.99121436, 0.44068602],
-												 [	-4.03005191, -0.00572900, 0.00303688, 5.02432291, 0.97974715, 0.99123412, 0.44068674],
-												 [	-4.03469555, -0.00571719, 0.00302910, 5.02897837, 0.97978897, 0.99125371, 0.44068875],
-												 [	-4.03933654, -0.00570546, 0.00302139, 5.03363108, 0.97983056, 0.99127315, 0.44069203],
-												 [	-4.04397482, -0.00569382, 0.00301375, 5.03828100, 0.97987192, 0.99129242, 0.44069657],
-												 [	-4.04861037, -0.00568227, 0.00300619, 5.04292810, 0.97991304, 0.99131154, 0.44070234],
-												 [	-4.05324314, -0.00567080, 0.00299869, 5.04757234, 0.97995393, 0.99133051, 0.44070935],
-												 [	-4.05787308, -0.00565942, 0.00299126, 5.05221367, 0.97999459, 0.99134932, 0.44071756],
-												 [	-4.06250017, -0.00564812, 0.00298390, 5.05685205, 0.98003502, 0.99136799, 0.44072698],
-												 [	-4.06712435, -0.00563690, 0.00297660, 5.06148744, 0.98007523, 0.99138650, 0.44073757],
-												 [	-4.07174558, -0.00562577, 0.00296937, 5.06611981, 0.98011522, 0.99140486, 0.44074934],
-												 [	-4.07636383, -0.00561471, 0.00296221, 5.07074912, 0.98015498, 0.99142308, 0.44076227],
-												 [	-4.08097906, -0.00560374, 0.00295511, 5.07537532, 0.98019453, 0.99144116, 0.44077633],
-												 [	-4.08559122, -0.00559284, 0.00294807, 5.07999838, 0.98023386, 0.99145909, 0.44079153],
-												 [	-4.09020028, -0.00558202, 0.00294110, 5.08461826, 0.98027298, 0.99147688, 0.44080784],
-												 [	-4.09480620, -0.00557128, 0.00293419, 5.08923492, 0.98031189, 0.99149453, 0.44082525],
-												 [	-4.09940894, -0.00556061, 0.00292734, 5.09384833, 0.98035059, 0.99151204, 0.44084375],
-												 [	-4.10400846, -0.00555002, 0.00292056, 5.09845844, 0.98038908, 0.99152942, 0.44086333],
-												 [	-4.10860473, -0.00553950, 0.00291383, 5.10306522, 0.98042736, 0.99154666, 0.44088396],
-												 [	-4.11319770, -0.00552906, 0.00290717, 5.10766864, 0.98046544, 0.99156377, 0.44090565],
-												 [	-4.11778734, -0.00551869, 0.00290056, 5.11226865, 0.98050332, 0.99158075, 0.44092838],
-												 [	-4.12237362, -0.00550839, 0.00289401, 5.11686523, 0.98054100, 0.99159760, 0.44095213],
-												 [	-4.12695649, -0.00549816, 0.00288752, 5.12145833, 0.98057848, 0.99161431, 0.44097689],
-												 [	-4.13153592, -0.00548801, 0.00288109, 5.12604792, 0.98061577, 0.99163090, 0.44100265],
-												 [	-4.13611188, -0.00547792, 0.00287471, 5.13063396, 0.98065286, 0.99164737, 0.44102940],
-												 [	-4.14068433, -0.00546790, 0.00286839, 5.13521643, 0.98068975, 0.99166371, 0.44105712],
-												 [	-4.14525323, -0.00545795, 0.00286213, 5.13979528, 0.98072646, 0.99167992, 0.44108581],
-												 [	-4.14981854, -0.00544806, 0.00285592, 5.14437048, 0.98076298, 0.99169602, 0.44111544],
-												 [	-4.15438025, -0.00543824, 0.00284976, 5.14894200, 0.98079931, 0.99171199, 0.44114602],
-												 [	-4.15893830, -0.00542849, 0.00284366, 5.15350981, 0.98083545, 0.99172785, 0.44117753],
-												 [	-4.16349267, -0.00541880, 0.00283761, 5.15807386, 0.98087141, 0.99174358, 0.44120995],
-												 [	-4.16804332, -0.00540918, 0.00283162, 5.16263414, 0.98090719, 0.99175920, 0.44124328],
-												 [	-4.17259021, -0.00539962, 0.00282567, 5.16719060, 0.98094278, 0.99177471, 0.44127750],
-												 [	-4.17713333, -0.00539012, 0.00281978, 5.17174321, 0.98097820, 0.99179010, 0.44131260],
-												 [	-4.18167262, -0.00538069, 0.00281394, 5.17629194, 0.98101344, 0.99180537, 0.44134857],
-												 [	-4.18620807, -0.00537131, 0.00280815, 5.18083676, 0.98104851, 0.99182054, 0.44138541],
-												 [	-4.19073963, -0.00536200, 0.00280241, 5.18537763, 0.98108340, 0.99183560, 0.44142309],
-												 [	-4.19526728, -0.00535274, 0.00279671, 5.18991453, 0.98111811, 0.99185054, 0.44146162],
-												 [	-4.19979098, -0.00534355, 0.00279107, 5.19444743, 0.98115266, 0.99186538, 0.44150097],
-												 [	-4.20431070, -0.00533441, 0.00278548, 5.19897629, 0.98118704, 0.99188011, 0.44154114],
-												 [	-4.20882641, -0.00532534, 0.00277993, 5.20350108, 0.98122125, 0.99189474, 0.44158211],
-												 [	-4.21333809, -0.00531632, 0.00277443, 5.20802177, 0.98125529, 0.99190926, 0.44162389],
-												 [	-4.21784569, -0.00530735, 0.00276897, 5.21253834, 0.98128916, 0.99192367, 0.44166645],
-												 [	-4.22234919, -0.00529845, 0.00276357, 5.21705075, 0.98132288, 0.99193799, 0.44170979],
-												 [	-4.22684856, -0.00528959, 0.00275820, 5.22155897, 0.98135643, 0.99195220, 0.44175389],
-												 [	-4.23134377, -0.00528080, 0.00275289, 5.22606297, 0.98138982, 0.99196631, 0.44179875],
-												 [	-4.23583479, -0.00527206, 0.00274762, 5.23056273, 0.98142305, 0.99198033, 0.44184436],
-												 [	-4.24032159, -0.00526337, 0.00274239, 5.23505822, 0.98145612, 0.99199424, 0.44189070],
-												 [	-4.24480413, -0.00525473, 0.00273720, 5.23954940, 0.98148904, 0.99200806, 0.44193777],
-												 [	-4.24928241, -0.00524615, 0.00273206, 5.24403626, 0.98152180, 0.99202179, 0.44198557],
-												 [	-4.25375637, -0.00523762, 0.00272697, 5.24851875, 0.98155440, 0.99203541, 0.44203406],
-												 [	-4.25822600, -0.00522914, 0.00272191, 5.25299686, 0.98158685, 0.99204895, 0.44208326],
-												 [	-4.26269127, -0.00522071, 0.00271690, 5.25747055, 0.98161916, 0.99206239, 0.44213315],
-												 [	-4.26715214, -0.00521233, 0.00271193, 5.26193981, 0.98165131, 0.99207574, 0.44218372],
-												 [	-4.27160860, -0.00520401, 0.00270700, 5.26640459, 0.98168331, 0.99208900, 0.44223496],
-												 [	-4.27606061, -0.00519573, 0.00270211, 5.27086489, 0.98171516, 0.99210217, 0.44228686],
-												 [	-4.28050816, -0.00518750, 0.00269726, 5.27532066, 0.98174687, 0.99211524, 0.44233942],
-												 [	-4.28495120, -0.00517932, 0.00269245, 5.27977188, 0.98177844, 0.99212824, 0.44239262],
-												 [	-4.28938971, -0.00517119, 0.00268767, 5.28421853, 0.98180986, 0.99214114, 0.44244646],
-												 [	-4.29382368, -0.00516310, 0.00268294, 5.28866058, 0.98184113, 0.99215396, 0.44250093],
-												 [	-4.29825306, -0.00515506, 0.00267825, 5.29309800, 0.98187227, 0.99216669, 0.44255601],
-												 [	-4.30267785, -0.00514707, 0.00267359, 5.29753078, 0.98190326, 0.99217934, 0.44261171],
-												 [	-4.30709800, -0.00513912, 0.00266898, 5.30195888, 0.98193412, 0.99219190, 0.44266801],
-												 [	-4.31151350, -0.00513122, 0.00266440, 5.30638227, 0.98196483, 0.99220438, 0.44272490],
-												 [	-4.31592431, -0.00512337, 0.00265985, 5.31080095, 0.98199542, 0.99221678, 0.44278238],
-												 [	-4.32033043, -0.00511555, 0.00265535, 5.31521487, 0.98202586, 0.99222910, 0.44284044],
-												 [	-4.32473181, -0.00510779, 0.00265088, 5.31962403, 0.98205617, 0.99224134, 0.44289907],
-												 [	-4.32912844, -0.00510006, 0.00264644, 5.32402838, 0.98208635, 0.99225350, 0.44295825],
-												 [	-4.33352030, -0.00509238, 0.00264204, 5.32842792, 0.98211639, 0.99226558, 0.44301800],
-												 [	-4.33790735, -0.00508474, 0.00263768, 5.33282261, 0.98214630, 0.99227758, 0.44307829],
-												 [	-4.34228957, -0.00507715, 0.00263335, 5.33721243, 0.98217609, 0.99228950, 0.44313911],
-												 [	-4.34666695, -0.00506959, 0.00262906, 5.34159736, 0.98220574, 0.99230135, 0.44320047],
-												 [	-4.35103946, -0.00506208, 0.00262479, 5.34597738, 0.98223526, 0.99231313, 0.44326235],
-												 [	-4.35540706, -0.00505461, 0.00262057, 5.35035246, 0.98226466, 0.99232483, 0.44332475],
-												 [	-4.35976976, -0.00504718, 0.00261637, 5.35472258, 0.98229393, 0.99233645, 0.44338766],
-												 [	-4.36412751, -0.00503978, 0.00261221, 5.35908772, 0.98232308, 0.99234800, 0.44345107],
-												 [	-4.36848029, -0.00503243, 0.00260808, 5.36344786, 0.98235210, 0.99235949, 0.44351497],
-												 [	-4.37282810, -0.00502512, 0.00260399, 5.36780298, 0.98238100, 0.99237089, 0.44357936],
-												 [	-4.37717089, -0.00501785, 0.00259992, 5.37215304, 0.98240977, 0.99238223, 0.44364422],
-												 [	-4.38150866, -0.00501061, 0.00259589, 5.37649804, 0.98243843, 0.99239350, 0.44370956],
-												 [	-4.38584137, -0.00500341, 0.00259189, 5.38083796, 0.98246696, 0.99240470, 0.44377537],
-												 [	-4.39016901, -0.00499626, 0.00258792, 5.38517276, 0.98249538, 0.99241583, 0.44384163],
-												 [	-4.39449156, -0.00498913, 0.00258397, 5.38950243, 0.98252368, 0.99242689, 0.44390835],
-												 [	-4.39880900, -0.00498205, 0.00258006, 5.39382695, 0.98255186, 0.99243789, 0.44397551],
-												 [	-4.40312130, -0.00497500, 0.00257618, 5.39814630, 0.98257992, 0.99244881, 0.44404311],
-												 [	-4.40742845, -0.00496799, 0.00257233, 5.40246046, 0.98260787, 0.99245968, 0.44411114],
-												 [	-4.41173042, -0.00496101, 0.00256851, 5.40676940, 0.98263570, 0.99247047, 0.44417960],
-												 [	-4.41602719, -0.00495407, 0.00256472, 5.41107312, 0.98266342, 0.99248121, 0.44424847],
-												 [	-4.42031875, -0.00494717, 0.00256096, 5.41537158, 0.98269102, 0.99249187, 0.44431776],
-												 [	-4.42460508, -0.00494030, 0.00255722, 5.41966478, 0.98271852, 0.99250248, 0.44438745],
-												 [	-4.42888615, -0.00493346, 0.00255351, 5.42395268, 0.98274590, 0.99251302, 0.44445755],
-												 [	-4.43316194, -0.00492666, 0.00254984, 5.42823528, 0.98277317, 0.99252350, 0.44452803],
-												 [	-4.43743244, -0.00491989, 0.00254618, 5.43251255, 0.98280033, 0.99253392, 0.44459891],
-												 [	-4.44169763, -0.00491316, 0.00254256, 5.43678447, 0.98282738, 0.99254428, 0.44467016],
-												 [	-4.44595749, -0.00490646, 0.00253896, 5.44105103, 0.98285433, 0.99255458, 0.44474179],
-												 [	-4.45021200, -0.00489979, 0.00253539, 5.44531221, 0.98288117, 0.99256482, 0.44481379],
-												 [	-4.45446115, -0.00489316, 0.00253185, 5.44956799, 0.98290790, 0.99257500, 0.44488616],
-												 [	-4.45870490, -0.00488655, 0.00252833, 5.45381835, 0.98293452, 0.99258512, 0.44495888],
-												 [	-4.46294326, -0.00487998, 0.00252484, 5.45806327, 0.98296105, 0.99259518, 0.44503195],
-												 [	-4.46717619, -0.00487344, 0.00252137, 5.46230275, 0.98298746, 0.99260519, 0.44510537],
-												 [	-4.47140368, -0.00486693, 0.00251793, 5.46653675, 0.98301378, 0.99261514, 0.44517912],
-												 [	-4.47562571, -0.00486046, 0.00251451, 5.47076526, 0.98303999, 0.99262503, 0.44525322],
-												 [	-4.47984227, -0.00485401, 0.00251112, 5.47498827, 0.98306610, 0.99263487, 0.44532764],
-												 [	-4.48405334, -0.00484759, 0.00250775, 5.47920575, 0.98309211, 0.99264465, 0.44540238],
-												 [	-4.48825891, -0.00484121, 0.00250441, 5.48341770, 0.98311802, 0.99265438, 0.44547744],
-												 [	-4.49245894, -0.00483485, 0.00250109, 5.48762409, 0.98314383, 0.99266406, 0.44555282],
-												 [	-4.49665344, -0.00482852, 0.00249780, 5.49182492, 0.98316954, 0.99267368, 0.44562850],
-												 [	-4.50084238, -0.00482223, 0.00249453, 5.49602015, 0.98319515, 0.99268325, 0.44570449],
-												 [	-4.50502575, -0.00481596, 0.00249128, 5.50020979, 0.98322067, 0.99269277, 0.44578077],
-												 [	-4.50920352, -0.00480972, 0.00248805, 5.50439380, 0.98324609, 0.99270223, 0.44585734],
-												 [	-4.51337569, -0.00480350, 0.00248485, 5.50857219, 0.98327141, 0.99271164, 0.44593420],
-												 [	-4.51754224, -0.00479732, 0.00248167, 5.51274492, 0.98329664, 0.99272101, 0.44601134],
-												 [	-4.52170315, -0.00479117, 0.00247851, 5.51691199, 0.98332177, 0.99273032, 0.44608876],
-												 [	-4.52585842, -0.00478504, 0.00247538, 5.52107338, 0.98334681, 0.99273958, 0.44616645],
-												 [	-4.53000801, -0.00477894, 0.00247227, 5.52522907, 0.98337176, 0.99274880, 0.44624440],
-												 [	-4.53415192, -0.00477286, 0.00246917, 5.52937906, 0.98339661, 0.99275796, 0.44632262],
-												 [	-4.53829014, -0.00476682, 0.00246610, 5.53352332, 0.98342137, 0.99276708, 0.44640109],
-												 [	-4.54242264, -0.00476080, 0.00246306, 5.53766184, 0.98344605, 0.99277615, 0.44647982],
-												 [	-4.54654942, -0.00475480, 0.00246003, 5.54179461, 0.98347063, 0.99278517, 0.44655879],
-												 [	-4.55067046, -0.00474884, 0.00245702, 5.54592162, 0.98349512, 0.99279414, 0.44663801],
-												 [	-4.55478574, -0.00474290, 0.00245404, 5.55004285, 0.98351952, 0.99280307, 0.44671746],
-												 [	-4.55889526, -0.00473698, 0.00245107, 5.55415828, 0.98354383, 0.99281195, 0.44679715],
-												 [	-4.56299899, -0.00473109, 0.00244812, 5.55826790, 0.98356806, 0.99282079, 0.44687706],
-												 [	-4.56709693, -0.00472522, 0.00244520, 5.56237170, 0.98359219, 0.99282958, 0.44695720],
-												 [	-4.57118906, -0.00471938, 0.00244229, 5.56646967, 0.98361625, 0.99283832, 0.44703756],
-												 [	-4.57527536, -0.00471357, 0.00243940, 5.57056179, 0.98364021, 0.99284703, 0.44711814],
-												 [	-4.57935583, -0.00470778, 0.00243654, 5.57464806, 0.98366409, 0.99285569, 0.44719893],
-												 [	-4.58343045, -0.00470201, 0.00243369, 5.57872844, 0.98368788, 0.99286430, 0.44727992],
-												 [	-4.58749921, -0.00469627, 0.00243086, 5.58280295, 0.98371159, 0.99287287, 0.44736112],
-												 [	-4.59156210, -0.00469055, 0.00242805, 5.58687155, 0.98373522, 0.99288140, 0.44744252],
-												 [	-4.59561910, -0.00468485, 0.00242526, 5.59093424, 0.98375876, 0.99288989, 0.44752411],
-												 [	-4.59967020, -0.00467918, 0.00242248, 5.59499102, 0.98378222, 0.99289833, 0.44760589],
-												 [	-4.60371538, -0.00467353, 0.00241973, 5.59904185, 0.98380560, 0.99290674, 0.44768785],
-												 [	-4.60775465, -0.00466791, 0.00241699, 5.60308674, 0.98382890, 0.99291510, 0.44777000],
-												 [	-4.61178797, -0.00466230, 0.00241427, 5.60712567, 0.98385211, 0.99292343, 0.44785233],
-												 [	-4.61581536, -0.00465672, 0.00241157, 5.61115863, 0.98387525, 0.99293171, 0.44793483],
-												 [	-4.61983678, -0.00465116, 0.00240889, 5.61518561, 0.98389830, 0.99293995, 0.44801750],
-												 [	-4.62385223, -0.00464563, 0.00240622, 5.61920660, 0.98392128, 0.99294815, 0.44810034],
-												 [	-4.62786170, -0.00464011, 0.00240357, 5.62322158, 0.98394418, 0.99295632, 0.44818334],
-												 [	-4.63186517, -0.00463462, 0.00240093, 5.62723055, 0.98396700, 0.99296444, 0.44826650],
-												 [	-4.63586264, -0.00462915, 0.00239832, 5.63123349, 0.98398974, 0.99297253, 0.44834982],
-												 [	-4.63985410, -0.00462370, 0.00239572, 5.63523040, 0.98401240, 0.99298058, 0.44843328],
-												 [	-4.64383953, -0.00461827, 0.00239313, 5.63922126, 0.98403499, 0.99298859, 0.44851690],
-												 [	-4.64781892, -0.00461286, 0.00239057, 5.64320606, 0.98405750, 0.99299657, 0.44860066],
-												 [	-4.65179227, -0.00460748, 0.00238802, 5.64718479, 0.98407993, 0.99300451, 0.44868455],
-												 [	-4.65575956, -0.00460211, 0.00238548, 5.65115744, 0.98410229, 0.99301241, 0.44876859],
-												 [	-4.65972078, -0.00459677, 0.00238296, 5.65512401, 0.98412458, 0.99302027, 0.44885276],
-												 [	-4.66367592, -0.00459144, 0.00238046, 5.65908448, 0.98414679, 0.99302810, 0.44893706],
-												 [	-4.66762497, -0.00458614, 0.00237797, 5.66303884, 0.98416893, 0.99303590, 0.44902148],
-												 [	-4.67156793, -0.00458085, 0.00237549, 5.66698708, 0.98419099, 0.99304366, 0.44910603],
-												 [	-4.67550478, -0.00457558, 0.00237303, 5.67092920, 0.98421298, 0.99305138, 0.44919070],
-												 [	-4.67943552, -0.00457034, 0.00237059, 5.67486518, 0.98423490, 0.99305907, 0.44927549],
-												 [	-4.68336012, -0.00456511, 0.00236816, 5.67879501, 0.98425675, 0.99306673, 0.44936038],
-												 [	-4.68727860, -0.00455990, 0.00236575, 5.68271869, 0.98427852, 0.99307435, 0.44944539],
-												 [	-4.69119092, -0.00455472, 0.00236335, 5.68663621, 0.98430023, 0.99308194, 0.44953051],
-												 [	-4.69509710, -0.00454955, 0.00236096, 5.69054755, 0.98432186, 0.99308949, 0.44961572],
-												 [	-4.69899711, -0.00454440, 0.00235859, 5.69445271, 0.98434343, 0.99309701, 0.44970104],
-												 [	-4.70289095, -0.00453926, 0.00235623, 5.69835168, 0.98436492, 0.99310450, 0.44978646],
-												 [	-4.70677861, -0.00453415, 0.00235389, 5.70224446, 0.98438635, 0.99311196, 0.44987197],
-												 [	-4.71066008, -0.00452905, 0.00235156, 5.70613103, 0.98440771, 0.99311939, 0.44995757],
-												 [	-4.71453535, -0.00452398, 0.00234924, 5.71001138, 0.98442899, 0.99312678, 0.45004326],
-												 [	-4.71840442, -0.00451892, 0.00234694, 5.71388551, 0.98445021, 0.99313414, 0.45012903],
-												 [	-4.72226728, -0.00451387, 0.00234465, 5.71775341, 0.98447137, 0.99314147, 0.45021488],
-												 [	-4.72612392, -0.00450885, 0.00234237, 5.72161507, 0.98449245, 0.99314877, 0.45030082],
-												 [	-4.72997433, -0.00450384, 0.00234011, 5.72547048, 0.98451347, 0.99315604, 0.45038683],
-												 [	-4.73381850, -0.00449885, 0.00233786, 5.72931964, 0.98453443, 0.99316328, 0.45047291],
-												 [	-4.73765643, -0.00449388, 0.00233562, 5.73316254, 0.98455532, 0.99317049, 0.45055907],
-												 [	-4.74148810, -0.00448893, 0.00233340, 5.73699917, 0.98457614, 0.99317767, 0.45064529],
-												 [	-4.74531352, -0.00448399, 0.00233119, 5.74082953, 0.98459690, 0.99318483, 0.45073158],
-												 [	-4.74913267, -0.00447907, 0.00232899, 5.74465360, 0.98461759, 0.99319195, 0.45081792],
-												 [	-4.75294555, -0.00447416, 0.00232680, 5.74847138, 0.98463822, 0.99319904, 0.45090433],
-												 [	-4.75675214, -0.00446927, 0.00232462, 5.75228287, 0.98465878, 0.99320610, 0.45099080],
-												 [	-4.76055246, -0.00446440, 0.00232246, 5.75608805, 0.98467929, 0.99321314, 0.45107732],
-												 [	-4.76434647, -0.00445955, 0.00232031, 5.75988693, 0.98469973, 0.99322015, 0.45116389],
-												 [	-4.76813419, -0.00445471, 0.00231816, 5.76367948, 0.98472010, 0.99322713, 0.45125051],
-												 [	-4.77191560, -0.00444988, 0.00231604, 5.76746572, 0.98474042, 0.99323408, 0.45133717],
-												 [	-4.77569070, -0.00444507, 0.00231392, 5.77124562, 0.98476067, 0.99324101, 0.45142388],
-												 [	-4.77945947, -0.00444028, 0.00231181, 5.77501919, 0.98478086, 0.99324791, 0.45151063],
-												 [	-4.78322192, -0.00443550, 0.00230972, 5.77878642, 0.98480099, 0.99325478, 0.45159742],
-												 [	-4.78697804, -0.00443074, 0.00230763, 5.78254730, 0.98482106, 0.99326162, 0.45168425],
-												 [	-4.79072783, -0.00442600, 0.00230556, 5.78630183, 0.98484107, 0.99326844, 0.45177111],
-												 [	-4.79447127, -0.00442127, 0.00230350, 5.79005000, 0.98486102, 0.99327523, 0.45185800],
-												 [	-4.79820836, -0.00441655, 0.00230145, 5.79379181, 0.98488091, 0.99328200, 0.45194492],
-												 [	-4.80193909, -0.00441185, 0.00229941, 5.79752724, 0.98490074, 0.99328874, 0.45203187],
-												 [	-4.80566347, -0.00440716, 0.00229738, 5.80125630, 0.98492051, 0.99329546, 0.45211884],
-												 [	-4.80938148, -0.00440249, 0.00229536, 5.80497899, 0.98494022, 0.99330215, 0.45220583],
-												 [	-4.81309312, -0.00439783, 0.00229335, 5.80869528, 0.98495988, 0.99330881, 0.45229285],
-												 [	-4.81679838, -0.00439319, 0.00229135, 5.81240519, 0.98497947, 0.99331546, 0.45237988],
-												 [	-4.82049726, -0.00438856, 0.00228937, 5.81610870, 0.98499901, 0.99332207, 0.45246692],
-												 [	-4.82418976, -0.00438395, 0.00228739, 5.81980581, 0.98501850, 0.99332866, 0.45255398],
-												 [	-4.82787587, -0.00437935, 0.00228542, 5.82349652, 0.98503792, 0.99333523, 0.45264105],
-												 [	-4.83155558, -0.00437476, 0.00228346, 5.82718082, 0.98505729, 0.99334178, 0.45272813],
-												 [	-4.83522889, -0.00437019, 0.00228151, 5.83085870, 0.98507660, 0.99334830, 0.45281521],
-												 [	-4.83889580, -0.00436563, 0.00227957, 5.83453017, 0.98509586, 0.99335480, 0.45290231],
-												 [	-4.84255630, -0.00436109, 0.00227764, 5.83819521, 0.98511506, 0.99336127, 0.45298940],
-												 [	-4.84621038, -0.00435656, 0.00227572, 5.84185383, 0.98513421, 0.99336772, 0.45307649],
-												 [	-4.84985805, -0.00435204, 0.00227381, 5.84550601, 0.98515330, 0.99337415, 0.45316358],
-												 [	-4.85349930, -0.00434753, 0.00227191, 5.84915177, 0.98517233, 0.99338056, 0.45325067],
-												 [	-4.85713412, -0.00434304, 0.00227002, 5.85279108, 0.98519132, 0.99338694, 0.45333775],
-												 [	-4.86076252, -0.00433856, 0.00226813, 5.85642396, 0.98521024, 0.99339330, 0.45342482],
-												 [	-4.86438448, -0.00433410, 0.00226626, 5.86005038, 0.98522912, 0.99339964, 0.45351189],
-												 [	-4.86800001, -0.00432965, 0.00226439, 5.86367036, 0.98524794, 0.99340596, 0.45359894],
-												 [	-4.87160909, -0.00432521, 0.00226253, 5.86728389, 0.98526671, 0.99341226, 0.45368598],
-												 [	-4.87521174, -0.00432078, 0.00226069, 5.87089096, 0.98528542, 0.99341853, 0.45377301],
-												 [	-4.87880793, -0.00431637, 0.00225885, 5.87449157, 0.98530409, 0.99342479, 0.45386001],
-												 [	-4.88239768, -0.00431196, 0.00225701, 5.87808572, 0.98532270, 0.99343102, 0.45394700],
-												 [	-4.88598098, -0.00430758, 0.00225519, 5.88167340, 0.98534126, 0.99343723, 0.45403397],
-												 [	-4.88955781, -0.00430320, 0.00225338, 5.88525462, 0.98535976, 0.99344342, 0.45412092],
-												 [	-4.89312819, -0.00429883, 0.00225157, 5.88882936, 0.98537822, 0.99344960, 0.45420784],
-												 [	-4.89669211, -0.00429448, 0.00224977, 5.89239763, 0.98539662, 0.99345575, 0.45429473],
-												 [	-4.90024957, -0.00429014, 0.00224798, 5.89595942, 0.98541498, 0.99346188, 0.45438160],
-												 [	-4.90380055, -0.00428581, 0.00224620, 5.89951474, 0.98543328, 0.99346799, 0.45446844],
-												 [	-4.90734507, -0.00428150, 0.00224442, 5.90306357, 0.98545154, 0.99347408, 0.45455524],
-												 [	-4.91088312, -0.00427719, 0.00224266, 5.90660592, 0.98546974, 0.99348015, 0.45464201],
-												 [	-4.91441469, -0.00427290, 0.00224090, 5.91014179, 0.98548790, 0.99348620, 0.45472875],
-												 [	-4.91793978, -0.00426862, 0.00223915, 5.91367116, 0.98550600, 0.99349224, 0.45481546],
-												 [	-4.92145840, -0.00426435, 0.00223740, 5.91719405, 0.98552406, 0.99349825, 0.45490212],
-												 [	-4.92497053, -0.00426009, 0.00223566, 5.92071044, 0.98554206, 0.99350425, 0.45498875],
-												 [	-4.92847618, -0.00425584, 0.00223394, 5.92422034, 0.98556002, 0.99351022, 0.45507533],
-												 [	-4.93197535, -0.00425160, 0.00223221, 5.92772375, 0.98557793, 0.99351618, 0.45516187],
-												 [	-4.93546803, -0.00424738, 0.00223050, 5.93122065, 0.98559579, 0.99352212, 0.45524837],
-												 [	-4.93895423, -0.00424317, 0.00222879, 5.93471106, 0.98561361, 0.99352804, 0.45533482],
-												 [	-4.94243393, -0.00423896, 0.00222709, 5.93819497, 0.98563138, 0.99353395, 0.45542123],
-												 [	-4.94590714, -0.00423477, 0.00222540, 5.94167237, 0.98564910, 0.99353983, 0.45550758],
-												 [	-4.94937386, -0.00423059, 0.00222371, 5.94514327, 0.98566677, 0.99354570, 0.45559389],
-												 [	-4.95283409, -0.00422642, 0.00222203, 5.94860767, 0.98568439, 0.99355155, 0.45568014],
-												 [	-4.95628782, -0.00422226, 0.00222036, 5.95206556, 0.98570197, 0.99355738, 0.45576634],
-												 [	-4.95973505, -0.00421811, 0.00221869, 5.95551694, 0.98571951, 0.99356320, 0.45585249],
-												 [	-4.96317579, -0.00421397, 0.00221703, 5.95896181, 0.98573699, 0.99356900, 0.45593858],
-												 [	-4.96661002, -0.00420984, 0.00221538, 5.96240018, 0.98575444, 0.99357478, 0.45602462],
-												 [	-4.97003776, -0.00420573, 0.00221373, 5.96583204, 0.98577183, 0.99358054, 0.45611059],
-												 [	-4.97345900, -0.00420162, 0.00221209, 5.96925738, 0.98578918, 0.99358629, 0.45619651],
-												 [	-4.97687374, -0.00419752, 0.00221046, 5.97267622, 0.98580649, 0.99359202, 0.45628236],
-												 [	-4.98028197, -0.00419344, 0.00220883, 5.97608854, 0.98582375, 0.99359774, 0.45636816],
-												 [	-4.98368371, -0.00418936, 0.00220721, 5.97949435, 0.98584096, 0.99360343, 0.45645388],
-												 [	-4.98707894, -0.00418529, 0.00220559, 5.98289365, 0.98585814, 0.99360912, 0.45653955],
-												 [	-4.99046767, -0.00418123, 0.00220398, 5.98628643, 0.98587526, 0.99361478, 0.45662514],
-												 [	-4.99384989, -0.00417719, 0.00220238, 5.98967270, 0.98589235, 0.99362043, 0.45671067],
-												 [	-4.99722561, -0.00417315, 0.00220078, 5.99305246, 0.98590939, 0.99362607, 0.45679613],
-												 [	-5.00059483, -0.00416912, 0.00219919, 5.99642571, 0.98592638, 0.99363169, 0.45688152],
-												 [	-5.00395754, -0.00416511, 0.00219761, 5.99979244, 0.98594334, 0.99363729, 0.45696684],
-												 [	-5.00731375, -0.00416110, 0.00219603, 6.00315266, 0.98596025, 0.99364288, 0.45705209],
-												 [	-5.01066346, -0.00415710, 0.00219445, 6.00650636, 0.98597712, 0.99364845, 0.45713726],
-												 [	-5.01400667, -0.00415311, 0.00219288, 6.00985356, 0.98599394, 0.99365401, 0.45722236],
-												 [	-5.01734337, -0.00414913, 0.00219132, 6.01319424, 0.98601072, 0.99365955, 0.45730738],
-												 [	-5.02067356, -0.00414516, 0.00218976, 6.01652841, 0.98602746, 0.99366508, 0.45739233],
-												 [	-5.02399726, -0.00414120, 0.00218821, 6.01985606, 0.98604416, 0.99367059, 0.45747719],
-												 [	-5.02731445, -0.00413724, 0.00218666, 6.02317721, 0.98606082, 0.99367609, 0.45756198],
-												 [	-5.03062515, -0.00413330, 0.00218512, 6.02649184, 0.98607744, 0.99368157, 0.45764669],
-												 [	-5.03392934, -0.00412937, 0.00218359, 6.02979997, 0.98609401, 0.99368704, 0.45773131],
-												 [	-5.03722703, -0.00412544, 0.00218206, 6.03310159, 0.98611054, 0.99369250, 0.45781585],
-												 [	-5.04051822, -0.00412153, 0.00218053, 6.03639670, 0.98612704, 0.99369794, 0.45790031],
-												 [	-5.04380292, -0.00411762, 0.00217901, 6.03968530, 0.98614349, 0.99370337, 0.45798469],
-												 [	-5.04708112, -0.00411372, 0.00217750, 6.04296739, 0.98615990, 0.99370878, 0.45806897],
-												 [	-5.05035282, -0.00410983, 0.00217599, 6.04624299, 0.98617627, 0.99371418, 0.45815318],
-												 [	-5.05361802, -0.00410595, 0.00217448, 6.04951207, 0.98619260, 0.99371957, 0.45823729],
-												 [	-5.05687674, -0.00410208, 0.00217298, 6.05277466, 0.98620889, 0.99372494, 0.45832131],
-												 [	-5.06012896, -0.00409821, 0.00217148, 6.05603074, 0.98622514, 0.99373030, 0.45840525],
-												 [	-5.06337469, -0.00409436, 0.00216999, 6.05928033, 0.98624135, 0.99373565, 0.45848909],
-												 [	-5.06661393, -0.00409051, 0.00216851, 6.06252341, 0.98625753, 0.99374098, 0.45857285],
-												 [	-5.06984668, -0.00408668, 0.00216703, 6.06576000, 0.98627366, 0.99374630, 0.45865651],
-												 [	-5.07307294, -0.00408285, 0.00216555, 6.06899010, 0.98628975, 0.99375161, 0.45874007],
-												 [	-5.07629272, -0.00407902, 0.00216408, 6.07221370, 0.98630581, 0.99375690, 0.45882355],
-												 [	-5.07950602, -0.00407521, 0.00216261, 6.07543081, 0.98632182, 0.99376218, 0.45890693],
-												 [	-5.08271283, -0.00407141, 0.00216115, 6.07864143, 0.98633780, 0.99376745, 0.45899021],
-												 [	-5.08591317, -0.00406761, 0.00215969, 6.08184556, 0.98635374, 0.99377270, 0.45907339],
-												 [	-5.08910703, -0.00406382, 0.00215823, 6.08504321, 0.98636965, 0.99377795, 0.45915648],
-												 [	-5.09229441, -0.00406004, 0.00215678, 6.08823437, 0.98638551, 0.99378318, 0.45923947],
-												 [	-5.09547532, -0.00405627, 0.00215534, 6.09141905, 0.98640134, 0.99378840, 0.45932235],
-												 [	-5.09864975, -0.00405250, 0.00215390, 6.09459725, 0.98641713, 0.99379360, 0.45940514],
-												 [	-5.10181772, -0.00404874, 0.00215246, 6.09776897, 0.98643288, 0.99379880, 0.45948783],
-												 [	-5.10497922, -0.00404500, 0.00215102, 6.10093422, 0.98644859, 0.99380398, 0.45957041],
-												 [	-5.10813425, -0.00404125, 0.00214960, 6.10409300, 0.98646427, 0.99380915, 0.45965289],
-												 [	-5.11128282, -0.00403752, 0.00214817, 6.10724530, 0.98647991, 0.99381431, 0.45973527],
-												 [	-5.11442494, -0.00403379, 0.00214675, 6.11039114, 0.98649552, 0.99381946, 0.45981755],
-												 [	-5.11756059, -0.00403008, 0.00214533, 6.11353051, 0.98651108, 0.99382459, 0.45989972],
-												 [	-5.12068979, -0.00402637, 0.00214392, 6.11666343, 0.98652662, 0.99382971, 0.45998178],
-												 [	-5.12381254, -0.00402266, 0.00214251, 6.11978988, 0.98654211, 0.99383483, 0.46006373],
-												 [	-5.12692884, -0.00401897, 0.00214110, 6.12290987, 0.98655757, 0.99383993, 0.46014558],
-												 [	-5.13003869, -0.00401528, 0.00213970, 6.12602341, 0.98657300, 0.99384502, 0.46022732],
-												 [	-5.13314210, -0.00401160, 0.00213831, 6.12913050, 0.98658838, 0.99385010, 0.46030896],
-												 [	-5.13623906, -0.00400792, 0.00213691, 6.13223114, 0.98660374, 0.99385516, 0.46039048],
-												 [	-5.13932959, -0.00400426, 0.00213552, 6.13532533, 0.98661906, 0.99386022, 0.46047189],
-												 [	-5.14241368, -0.00400060, 0.00213413, 6.13841308, 0.98663434, 0.99386527, 0.46055319],
-												 [	-5.14549135, -0.00399695, 0.00213275, 6.14149440, 0.98664959, 0.99387030, 0.46063438],
-												 [	-5.14856258, -0.00399330, 0.00213137, 6.14456928, 0.98666480, 0.99387532, 0.46071546],
-												 [	-5.15162739, -0.00398967, 0.00213000, 6.14763772, 0.98667998, 0.99388034, 0.46079643],
-												 [	-5.15468577, -0.00398604, 0.00212862, 6.15069974, 0.98669512, 0.99388534, 0.46087728],
-												 [	-5.15773774, -0.00398241, 0.00212725, 6.15375533, 0.98671023, 0.99389033, 0.46095802],
-												 [	-5.16078329, -0.00397880, 0.00212589, 6.15680449, 0.98672531, 0.99389532, 0.46103864],
-												 [	-5.16382243, -0.00397519, 0.00212453, 6.15984724, 0.98674035, 0.99390029, 0.46111915],
-												 [	-5.16685516, -0.00397159, 0.00212317, 6.16288358, 0.98675535, 0.99390525, 0.46119954],
-												 [	-5.16988149, -0.00396799, 0.00212181, 6.16591350, 0.98677033, 0.99391020, 0.46127982],
-												 [	-5.17290141, -0.00396440, 0.00212046, 6.16893701, 0.98678527, 0.99391514, 0.46135997],
-												 [	-5.17591494, -0.00396082, 0.00211911, 6.17195412, 0.98680017, 0.99392007, 0.46144001],
-												 [	-5.17892208, -0.00395724, 0.00211776, 6.17496483, 0.98681505, 0.99392499, 0.46151994],
-												 [	-5.18192282, -0.00395368, 0.00211642, 6.17796914, 0.98682989, 0.99392990, 0.46159974],
-												 [	-5.18491718, -0.00395011, 0.00211508, 6.18096706, 0.98684470, 0.99393481, 0.46167943],
-												 [	-5.18790516, -0.00394656, 0.00211374, 6.18395860, 0.98685947, 0.99393970, 0.46175899],
-												 [	-5.19088675, -0.00394301, 0.00211241, 6.18694374, 0.98687421, 0.99394458, 0.46183843],
-												 [	-5.19386198, -0.00393947, 0.00211108, 6.18992251, 0.98688892, 0.99394945, 0.46191776],
-												 [	-5.19683083, -0.00393593, 0.00210975, 6.19289490, 0.98690360, 0.99395432, 0.46199696],
-												 [	-5.19979332, -0.00393241, 0.00210843, 6.19586092, 0.98691824, 0.99395917, 0.46207604],
-												 [	-5.20274945, -0.00392888, 0.00210710, 6.19882057, 0.98693285, 0.99396401, 0.46215500],
-												 [	-5.20569922, -0.00392537, 0.00210578, 6.20177385, 0.98694743, 0.99396885, 0.46223383],
-												 [	-5.20864264, -0.00392186, 0.00210447, 6.20472078, 0.98696198, 0.99397367, 0.46231254],
-												 [	-5.21157971, -0.00391835, 0.00210315, 6.20766135, 0.98697650, 0.99397849, 0.46239113],
-												 [	-5.21451043, -0.00391486, 0.00210184, 6.21059558, 0.98699098, 0.99398330, 0.46246959],
-												 [	-5.21743482, -0.00391137, 0.00210054, 6.21352345, 0.98700544, 0.99398810, 0.46254793],
-												 [	-5.22035287, -0.00390788, 0.00209923, 6.21644499, 0.98701986, 0.99399289, 0.46262614],
-												 [	-5.22326459, -0.00390440, 0.00209793, 6.21936019, 0.98703425, 0.99399767, 0.46270423],
-												 [	-5.22616999, -0.00390093, 0.00209663, 6.22226905, 0.98704861, 0.99400244, 0.46278219],
-												 [	-5.22906906, -0.00389747, 0.00209533, 6.22517159, 0.98706294, 0.99400720, 0.46286003],
-												 [	-5.23196182, -0.00389401, 0.00209404, 6.22806781, 0.98707724, 0.99401196, 0.46293774],
-												 [	-5.23484826, -0.00389055, 0.00209274, 6.23095771, 0.98709151, 0.99401670, 0.46301532],
-												 [	-5.23772840, -0.00388711, 0.00209145, 6.23384129, 0.98710574, 0.99402144, 0.46309277],
-												 [	-5.24060224, -0.00388366, 0.00209017, 6.23671857, 0.98711995, 0.99402617, 0.46317009],
-												 [	-5.24346978, -0.00388023, 0.00208888, 6.23958955, 0.98713413, 0.99403089, 0.46324729],
-												 [	-5.24633103, -0.00387680, 0.00208760, 6.24245423, 0.98714827, 0.99403560, 0.46332436],
-												 [	-5.24918599, -0.00387338, 0.00208632, 6.24531261, 0.98716239, 0.99404030, 0.46340129],
-												 [	-5.25203467, -0.00386996, 0.00208504, 6.24816471, 0.98717648, 0.99404500, 0.46347810],
-												 [	-5.25487707, -0.00386655, 0.00208377, 6.25101053, 0.98719053, 0.99404969, 0.46355478],
-												 [	-5.25771320, -0.00386314, 0.00208250, 6.25385007, 0.98720456, 0.99405436, 0.46363133],
-												 [	-5.26054307, -0.00385974, 0.00208123, 6.25668333, 0.98721856, 0.99405904, 0.46370775],
-												 [	-5.26336668, -0.00385634, 0.00207996, 6.25951033, 0.98723253, 0.99406370, 0.46378403],
-												 [	-5.26618402, -0.00385295, 0.00207869, 6.26233107, 0.98724646, 0.99406835, 0.46386019],
-												 [	-5.26899512, -0.00384957, 0.00207743, 6.26514555, 0.98726037, 0.99407300, 0.46393621],
-												 [	-5.27179998, -0.00384619, 0.00207617, 6.26795379, 0.98727425, 0.99407764, 0.46401210],
-												 [	-5.27459860, -0.00384282, 0.00207491, 6.27075577, 0.98728810, 0.99408227, 0.46408786],
-												 [	-5.27739098, -0.00383945, 0.00207365, 6.27355152, 0.98730193, 0.99408689, 0.46416348],
-												 [	-5.28017713, -0.00383609, 0.00207240, 6.27634104, 0.98731572, 0.99409151, 0.46423898],
-												 [	-5.28295706, -0.00383274, 0.00207115, 6.27912432, 0.98732949, 0.99409612, 0.46431433],
-												 [	-5.28573078, -0.00382939, 0.00206989, 6.28190139, 0.98734322, 0.99410072, 0.46438956],
-												 [	-5.28849828, -0.00382604, 0.00206865, 6.28467224, 0.98735693, 0.99410531, 0.46446465],
-												 [	-5.29125958, -0.00382271, 0.00206740, 6.28743687, 0.98737061, 0.99410989, 0.46453961],
-												 [	-5.29401468, -0.00381937, 0.00206616, 6.29019530, 0.98738426, 0.99411447, 0.46461443],
-												 [	-5.29676358, -0.00381604, 0.00206491, 6.29294754, 0.98739789, 0.99411904, 0.46468912],
-												 [	-5.29950630, -0.00381272, 0.00206367, 6.29569358, 0.98741148, 0.99412361, 0.46476368],
-												 [	-5.30224283, -0.00380940, 0.00206243, 6.29843343, 0.98742505, 0.99412816, 0.46483809],
-												 [	-5.30497319, -0.00380609, 0.00206120, 6.30116710, 0.98743859, 0.99413271, 0.46491238],
-												 [	-5.30769738, -0.00380279, 0.00205996, 6.30389459, 0.98745210, 0.99413725, 0.46498652],
-												 [	-5.31041540, -0.00379948, 0.00205873, 6.30661592, 0.98746559, 0.99414179, 0.46506054],
-												 [	-5.31312727, -0.00379619, 0.00205750, 6.30933108, 0.98747905, 0.99414631, 0.46513441],
-												 [	-5.31583299, -0.00379290, 0.00205627, 6.31204009, 0.98749248, 0.99415083, 0.46520815],
-												 [	-5.31853255, -0.00378961, 0.00205504, 6.31474294, 0.98750588, 0.99415535, 0.46528175],
-												 [	-5.32122598, -0.00378633, 0.00205382, 6.31743965, 0.98751926, 0.99415985, 0.46535522],
-												 [	-5.32391328, -0.00378306, 0.00205259, 6.32013023, 0.98753261, 0.99416435, 0.46542855],
-												 [	-5.32659445, -0.00377979, 0.00205137, 6.32281466, 0.98754593, 0.99416884, 0.46550174],
-												 [	-5.32926950, -0.00377652, 0.00205015, 6.32549298, 0.98755923, 0.99417333, 0.46557479],
-												 [	-5.33193843, -0.00377326, 0.00204893, 6.32816517, 0.98757249, 0.99417781, 0.46564771],
-												 [	-5.33460126, -0.00377000, 0.00204772, 6.33083125, 0.98758574, 0.99418228, 0.46572049],
-												 [	-5.33725798, -0.00376675, 0.00204650, 6.33349123, 0.98759895, 0.99418674, 0.46579313],
-												 [	-5.33990861, -0.00376351, 0.00204529, 6.33614511, 0.98761214, 0.99419120, 0.46586563],
-												 [	-5.34255316, -0.00376027, 0.00204408, 6.33879289, 0.98762531, 0.99419565, 0.46593799],
-												 [	-5.34519162, -0.00375703, 0.00204287, 6.34143458, 0.98763844, 0.99420010, 0.46601022],
-												 [	-5.34782400, -0.00375380, 0.00204166, 6.34407020, 0.98765155, 0.99420454, 0.46608230],
-												 [	-5.35045032, -0.00375058, 0.00204045, 6.34669974, 0.98766464, 0.99420897, 0.46615425],
-												 [	-5.35307057, -0.00374736, 0.00203925, 6.34932321, 0.98767770, 0.99421340, 0.46622606],
-												 [	-5.35568477, -0.00374414, 0.00203804, 6.35194063, 0.98769073, 0.99421781, 0.46629773],
-												 [	-5.35829292, -0.00374093, 0.00203684, 6.35455199, 0.98770374, 0.99422223, 0.46636926],
-												 [	-5.36089503, -0.00373773, 0.00203564, 6.35715730, 0.98771672, 0.99422663, 0.46644065],
-												 [	-5.36349110, -0.00373453, 0.00203444, 6.35975657, 0.98772968, 0.99423103, 0.46651190],
-												 [	-5.36608114, -0.00373133, 0.00203324, 6.36234981, 0.98774261, 0.99423543, 0.46658301],
-												 [	-5.36866517, -0.00372814, 0.00203205, 6.36493703, 0.98775552, 0.99423982, 0.46665398],
-												 [	-5.37124318, -0.00372495, 0.00203085, 6.36751823, 0.98776840, 0.99424420, 0.46672482],
-												 [	-5.37381518, -0.00372177, 0.00202966, 6.37009341, 0.98778125, 0.99424857, 0.46679551],
-												 [	-5.37638118, -0.00371859, 0.00202847, 6.37266259, 0.98779408, 0.99425294, 0.46686606],
-												 [	-5.37894119, -0.00371542, 0.00202728, 6.37522577, 0.98780689, 0.99425730, 0.46693647],
-												 [	-5.38149521, -0.00371225, 0.00202609, 6.37778296, 0.98781967, 0.99426166, 0.46700674],
-												 [	-5.38404325, -0.00370909, 0.00202490, 6.38033416, 0.98783243, 0.99426601, 0.46707687],
-												 [	-5.38658532, -0.00370593, 0.00202371, 6.38287939, 0.98784516, 0.99427036, 0.46714686],
-												 [	-5.38912142, -0.00370278, 0.00202253, 6.38541865, 0.98785786, 0.99427470, 0.46721671],
-												 [	-5.39165157, -0.00369963, 0.00202134, 6.38795194, 0.98787055, 0.99427903, 0.46728642],
-												 [	-5.39417576, -0.00369648, 0.00202016, 6.39047928, 0.98788320, 0.99428336, 0.46735598],
-												 [	-5.39669401, -0.00369334, 0.00201898, 6.39300067, 0.98789584, 0.99428768, 0.46742541],
-												 [	-5.39920633, -0.00369021, 0.00201780, 6.39551612, 0.98790845, 0.99429200, 0.46749470],
-												 [	-5.40171272, -0.00368707, 0.00201662, 6.39802564, 0.98792103, 0.99429631, 0.46756384],
-												 [	-5.40421318, -0.00368395, 0.00201544, 6.40052923, 0.98793359, 0.99430061, 0.46763284],
-												 [	-5.40670773, -0.00368082, 0.00201427, 6.40302690, 0.98794613, 0.99430491, 0.46770170],
-												 [	-5.40919637, -0.00367771, 0.00201309, 6.40551867, 0.98795864, 0.99430920, 0.46777042],
-												 [	-5.41167912, -0.00367459, 0.00201192, 6.40800452, 0.98797113, 0.99431349, 0.46783900],
-												 [	-5.41415597, -0.00367148, 0.00201075, 6.41048448, 0.98798360, 0.99431777, 0.46790744],
-												 [	-5.41662693, -0.00366838, 0.00200957, 6.41295855, 0.98799604, 0.99432205, 0.46797574],
-												 [	-5.41909202, -0.00366528, 0.00200840, 6.41542674, 0.98800846, 0.99432632, 0.46804389],
-												 [	-5.42155124, -0.00366218, 0.00200724, 6.41788906, 0.98802085, 0.99433058, 0.46811190],
-												 [	-5.42400460, -0.00365909, 0.00200607, 6.42034551, 0.98803323, 0.99433484, 0.46817978],
-												 [	-5.42645210, -0.00365600, 0.00200490, 6.42279610, 0.98804557, 0.99433910, 0.46824751],
-												 [	-5.42889376, -0.00365292, 0.00200374, 6.42524084, 0.98805790, 0.99434334, 0.46831509],
-												 [	-5.43132958, -0.00364984, 0.00200257, 6.42767973, 0.98807020, 0.99434759, 0.46838254],
-												 [	-5.43375956, -0.00364677, 0.00200141, 6.43011279, 0.98808248, 0.99435183, 0.46844985],
-												 [	-5.43618372, -0.00364370, 0.00200024, 6.43254002, 0.98809474, 0.99435606, 0.46851701],
-												 [	-5.43860207, -0.00364063, 0.00199908, 6.43496143, 0.98810697, 0.99436029, 0.46858403],
-												 [	-5.44101460, -0.00363757, 0.00199792, 6.43737703, 0.98811918, 0.99436451, 0.46865091],
-												 [	-5.44342134, -0.00363451, 0.00199676, 6.43978683, 0.98813137, 0.99436872, 0.46871765],
-												 [	-5.44582228, -0.00363146, 0.00199561, 6.44219082, 0.98814353, 0.99437294, 0.46878424],
-												 [	-5.44821744, -0.00362841, 0.00199445, 6.44458903, 0.98815567, 0.99437714, 0.46885070],
-												 [	-5.45060682, -0.00362536, 0.00199329, 6.44698145, 0.98816779, 0.99438134, 0.46891701],
-												 [	-5.45299043, -0.00362232, 0.00199214, 6.44936811, 0.98817989, 0.99438554, 0.46898318],
-												 [	-5.45536828, -0.00361929, 0.00199098, 6.45174899, 0.98819196, 0.99438973, 0.46904921],
-												 [	-5.45774037, -0.00361625, 0.00198983, 6.45412412, 0.98820402, 0.99439392, 0.46911510],
-												 [	-5.46010672, -0.00361323, 0.00198868, 6.45649350, 0.98821605, 0.99439810, 0.46918084],
-												 [	-5.46246734, -0.00361020, 0.00198753, 6.45885714, 0.98822805, 0.99440227, 0.46924645],
-												 [	-5.46482222, -0.00360718, 0.00198638, 6.46121504, 0.98824004, 0.99440644, 0.46931191],
-												 [	-5.46717138, -0.00360417, 0.00198523, 6.46356722, 0.98825200, 0.99441061, 0.46937723],
-												 [	-5.46951483, -0.00360115, 0.00198408, 6.46591367, 0.98826395, 0.99441477, 0.46944241],
-												 [	-5.47185257, -0.00359814, 0.00198293, 6.46825442, 0.98827587, 0.99441892, 0.46950744],
-												 [	-5.47418461, -0.00359514, 0.00198178, 6.47058947, 0.98828776, 0.99442308, 0.46957234],
-												 [	-5.47651097, -0.00359214, 0.00198064, 6.47291883, 0.98829964, 0.99442722, 0.46963709],
-												 [	-5.47883164, -0.00358914, 0.00197949, 6.47524250, 0.98831150, 0.99443136, 0.46970170],
-												 [	-5.48114664, -0.00358615, 0.00197835, 6.47756049, 0.98832333, 0.99443550, 0.46976617],
-												 [	-5.48345598, -0.00358316, 0.00197721, 6.47987281, 0.98833514, 0.99443963, 0.46983050],
-												 [	-5.48575966, -0.00358018, 0.00197606, 6.48217948, 0.98834693, 0.99444376, 0.46989469],
-												 [	-5.48805769, -0.00357720, 0.00197492, 6.48448049, 0.98835870, 0.99444788, 0.46995873],
-												 [	-5.49035007, -0.00357422, 0.00197378, 6.48677585, 0.98837045, 0.99445200, 0.47002264],
-												 [	-5.49263683, -0.00357125, 0.00197264, 6.48906558, 0.98838217, 0.99445611, 0.47008640],
-												 [	-5.49491797, -0.00356828, 0.00197150, 6.49134968, 0.98839388, 0.99446022, 0.47015002],
-												 [	-5.49719348, -0.00356532, 0.00197036, 6.49362817, 0.98840556, 0.99446432, 0.47021350],
-												 [	-5.49946339, -0.00356236, 0.00196923, 6.49590104, 0.98841723, 0.99446842, 0.47027684],
-												 [	-5.50172771, -0.00355940, 0.00196809, 6.49816831, 0.98842887, 0.99447251, 0.47034004],
-												 [	-5.50398643, -0.00355645, 0.00196695, 6.50042998, 0.98844049, 0.99447660, 0.47040310],
-												 [	-5.50623957, -0.00355350, 0.00196582, 6.50268607, 0.98845209, 0.99448068, 0.47046602],
-												 [	-5.50848713, -0.00355055, 0.00196468, 6.50493658, 0.98846367, 0.99448476, 0.47052879],
-												 [	-5.51072913, -0.00354761, 0.00196355, 6.50718152, 0.98847523, 0.99448884, 0.47059143],
-												 [	-5.51296557, -0.00354467, 0.00196242, 6.50942090, 0.98848677, 0.99449291, 0.47065392],
-												 [	-5.51519647, -0.00354174, 0.00196129, 6.51165473, 0.98849828, 0.99449698, 0.47071627],
-												 [	-5.51742182, -0.00353881, 0.00196016, 6.51388301, 0.98850978, 0.99450104, 0.47077849],
-												 [	-5.51964164, -0.00353588, 0.00195902, 6.51610576, 0.98852126, 0.99450510, 0.47084056],
-												 [	-5.52185594, -0.00353296, 0.00195789, 6.51832298, 0.98853271, 0.99450915, 0.47090249],
-												 [	-5.52406473, -0.00353004, 0.00195677, 6.52053469, 0.98854415, 0.99451320, 0.47096428],
-												 [	-5.52626800, -0.00352712, 0.00195564, 6.52274088, 0.98855556, 0.99451724, 0.47102593],
-												 [	-5.52846578, -0.00352421, 0.00195451, 6.52494157, 0.98856696, 0.99452128, 0.47108744],
-												 [	-5.53065808, -0.00352130, 0.00195338, 6.52713677, 0.98857834, 0.99452532, 0.47114881],
-												 [	-5.53284489, -0.00351840, 0.00195226, 6.52932649, 0.98858969, 0.99452935, 0.47121004],
-												 [	-5.53502623, -0.00351550, 0.00195113, 6.53151073, 0.98860103, 0.99453337, 0.47127113],
-												 [	-5.53720210, -0.00351260, 0.00195001, 6.53368950, 0.98861234, 0.99453740, 0.47133208],
-												 [	-5.53937252, -0.00350971, 0.00194888, 6.53586282, 0.98862364, 0.99454141, 0.47139289],
-												 [	-5.54153750, -0.00350682, 0.00194776, 6.53803068, 0.98863491, 0.99454543, 0.47145356],
-												 [	-5.54369704, -0.00350393, 0.00194663, 6.54019311, 0.98864617, 0.99454944, 0.47151409],
-												 [	-5.54585115, -0.00350105, 0.00194551, 6.54235010, 0.98865740, 0.99455344, 0.47157449],
-												 [	-5.54799984, -0.00349817, 0.00194439, 6.54450167, 0.98866862, 0.99455744, 0.47163474],
-												 [	-5.55014311, -0.00349529, 0.00194327, 6.54664782, 0.98867982, 0.99456144, 0.47169485],
-												 [	-5.55228099, -0.00349242, 0.00194215, 6.54878857, 0.98869099, 0.99456543, 0.47175483],
-												 [	-5.55441347, -0.00348955, 0.00194103, 6.55092392, 0.98870215, 0.99456942, 0.47181466],
-												 [	-5.55654057, -0.00348669, 0.00193991, 6.55305388, 0.98871329, 0.99457340, 0.47187436],
-												 [	-5.55866229, -0.00348383, 0.00193879, 6.55517846, 0.98872441, 0.99457738, 0.47193391],
-												 [	-5.56077864, -0.00348097, 0.00193767, 6.55729767, 0.98873551, 0.99458136, 0.47199333],
-												 [	-5.56288964, -0.00347811, 0.00193655, 6.55941152, 0.98874659, 0.99458533, 0.47205261],
-												 [	-5.56499528, -0.00347526, 0.00193544, 6.56152002, 0.98875765, 0.99458930, 0.47211176],
-												 [	-5.56709558, -0.00347242, 0.00193432, 6.56362317, 0.98876869, 0.99459326, 0.47217076],
-												 [	-5.56919055, -0.00346957, 0.00193321, 6.56572098, 0.98877972, 0.99459722, 0.47222962],
-												 [	-5.57128020, -0.00346673, 0.00193209, 6.56781347, 0.98879072, 0.99460118, 0.47228835],
-												 [	-5.57336453, -0.00346390, 0.00193098, 6.56990064, 0.98880171, 0.99460513, 0.47234694],
-												 [	-5.57544356, -0.00346106, 0.00192986, 6.57198250, 0.98881267, 0.99460907, 0.47240539],
-												 [	-5.57751729, -0.00345823, 0.00192875, 6.57405906, 0.98882362, 0.99461302, 0.47246371],
-												 [	-5.57958573, -0.00345541, 0.00192764, 6.57613032, 0.98883455, 0.99461696, 0.47252188],
-												 [	-5.58164889, -0.00345259, 0.00192652, 6.57819631, 0.98884546, 0.99462089, 0.47257992],
-												 [	-5.58370679, -0.00344977, 0.00192541, 6.58025702, 0.98885635, 0.99462482, 0.47263782],
-												 [	-5.58575942, -0.00344695, 0.00192430, 6.58231247, 0.98886722, 0.99462875, 0.47269559],
-												 [	-5.58780679, -0.00344414, 0.00192319, 6.58436266, 0.98887808, 0.99463267, 0.47275321],
-												 [	-5.58984893, -0.00344133, 0.00192208, 6.58640760, 0.98888891, 0.99463659, 0.47281070],
-												 [	-5.59188583, -0.00343852, 0.00192097, 6.58844731, 0.98889973, 0.99464051, 0.47286806],
-												 [	-5.59391750, -0.00343572, 0.00191986, 6.59048178, 0.98891053, 0.99464442, 0.47292528],
-												 [	-5.59594396, -0.00343292, 0.00191875, 6.59251104, 0.98892131, 0.99464833, 0.47298236],
-												 [	-5.59796521, -0.00343013, 0.00191764, 6.59453508, 0.98893207, 0.99465223, 0.47303930],
-												 [	-5.59998126, -0.00342733, 0.00191653, 6.59655393, 0.98894281, 0.99465613, 0.47309611],
-												 [	-5.60199212, -0.00342455, 0.00191543, 6.59856758, 0.98895354, 0.99466003, 0.47315278],
-												 [	-5.60399781, -0.00342176, 0.00191432, 6.60057605, 0.98896425, 0.99466392, 0.47320932],
-												 [	-5.60599831, -0.00341898, 0.00191321, 6.60257934, 0.98897493, 0.99466781, 0.47326572],
-												 [	-5.60799366, -0.00341620, 0.00191211, 6.60457746, 0.98898561, 0.99467169, 0.47332198],
-												 [	-5.60998385, -0.00341342, 0.00191100, 6.60657043, 0.98899626, 0.99467557, 0.47337811],
-												 [	-5.61196890, -0.00341065, 0.00190990, 6.60855825, 0.98900689, 0.99467945, 0.47343411],
-												 [	-5.61394881, -0.00340788, 0.00190879, 6.61054093, 0.98901751, 0.99468332, 0.47348997],
-												 [	-5.61592360, -0.00340512, 0.00190769, 6.61251848, 0.98902811, 0.99468719, 0.47354569],
-												 [	-5.61789327, -0.00340235, 0.00190659, 6.61449091, 0.98903869, 0.99469106, 0.47360128],
-												 [	-5.61985783, -0.00339960, 0.00190548, 6.61645823, 0.98904926, 0.99469492, 0.47365674],
-												 [	-5.62181729, -0.00339684, 0.00190438, 6.61842045, 0.98905980, 0.99469878, 0.47371206],
-												 [	-5.62377166, -0.00339409, 0.00190328, 6.62037757, 0.98907033, 0.99470263, 0.47376724],
-												 [	-5.62572095, -0.00339134, 0.00190218, 6.62232961, 0.98908084, 0.99470648, 0.47382230],
-												 [	-5.62766517, -0.00338859, 0.00190108, 6.62427658, 0.98909133, 0.99471033, 0.47387721],
-												 [	-5.62960432, -0.00338585, 0.00189998, 6.62621847, 0.98910181, 0.99471417, 0.47393200],
-												 [	-5.63153842, -0.00338311, 0.00189888, 6.62815531, 0.98911227, 0.99471801, 0.47398665],
-												 [	-5.63346748, -0.00338037, 0.00189778, 6.63008711, 0.98912271, 0.99472185, 0.47404117],
-												 [	-5.63539150, -0.00337764, 0.00189668, 6.63201386, 0.98913313, 0.99472568, 0.47409555],
-												 [	-5.63731050, -0.00337491, 0.00189558, 6.63393558, 0.98914354, 0.99472951, 0.47414980],
-												 [	-5.63922447, -0.00337218, 0.00189448, 6.63585229, 0.98915393, 0.99473333, 0.47420392],
-												 [	-5.64113344, -0.00336946, 0.00189338, 6.63776398, 0.98916430, 0.99473716, 0.47425791],
-												 [	-5.64303741, -0.00336674, 0.00189229, 6.63967067, 0.98917466, 0.99474097, 0.47431176],
-												 [	-5.64493639, -0.00336402, 0.00189119, 6.64157237, 0.98918499, 0.99474479, 0.47436548],
-												 [	-5.64683039, -0.00336131, 0.00189009, 6.64346908, 0.98919531, 0.99474860, 0.47441907],
-												 [	-5.64871942, -0.00335860, 0.00188899, 6.64536082, 0.98920562, 0.99475241, 0.47447252],
-												 [	-5.65060348, -0.00335589, 0.00188790, 6.64724759, 0.98921590, 0.99475621, 0.47452585],
-												 [	-5.65248259, -0.00335319, 0.00188680, 6.64912941, 0.98922617, 0.99476001, 0.47457904],
-												 [	-5.65435676, -0.00335049, 0.00188571, 6.65100628, 0.98923642, 0.99476381, 0.47463210],
-												 [	-5.65622600, -0.00334779, 0.00188461, 6.65287821, 0.98924666, 0.99476760, 0.47468503],
-												 [	-5.65809030, -0.00334509, 0.00188352, 6.65474521, 0.98925688, 0.99477139, 0.47473783],
-												 [	-5.65994970, -0.00334240, 0.00188243, 6.65660729, 0.98926708, 0.99477517, 0.47479050],
-												 [	-5.66180418, -0.00333971, 0.00188133, 6.65846447, 0.98927727, 0.99477896, 0.47484303],
-												 [	-5.66365377, -0.00333703, 0.00188024, 6.66031674, 0.98928744, 0.99478273, 0.47489544],
-												 [	-5.66549846, -0.00333434, 0.00187915, 6.66216412, 0.98929759, 0.99478651, 0.47494772],
-												 [	-5.66733828, -0.00333166, 0.00187805, 6.66400662, 0.98930772, 0.99479028, 0.47499986],
-												 [	-5.66917323, -0.00332899, 0.00187696, 6.66584424, 0.98931784, 0.99479405, 0.47505187],
-												 [	-5.67100331, -0.00332631, 0.00187587, 6.66767700, 0.98932794, 0.99479781, 0.47510376],
-												 [	-5.67282855, -0.00332364, 0.00187478, 6.66950490, 0.98933803, 0.99480158, 0.47515552],
-												 [	-5.67464894, -0.00332098, 0.00187369, 6.67132796, 0.98934810, 0.99480533, 0.47520714],
-												 [	-5.67646450, -0.00331831, 0.00187260, 6.67314618, 0.98935815, 0.99480909, 0.47525864],
-												 [	-5.67827523, -0.00331565, 0.00187151, 6.67495958, 0.98936819, 0.99481284, 0.47531001],
-												 [	-5.68008115, -0.00331299, 0.00187042, 6.67676816, 0.98937821, 0.99481659, 0.47536125],
-												 [	-5.68188226, -0.00331034, 0.00186933, 6.67857192, 0.98938821, 0.99482033, 0.47541236],
-												 [	-5.68367858, -0.00330769, 0.00186824, 6.68037089, 0.98939820, 0.99482407, 0.47546334],
-												 [	-5.68547011, -0.00330504, 0.00186715, 6.68216507, 0.98940817, 0.99482781, 0.47551419],
-												 [	-5.68725686, -0.00330239, 0.00186606, 6.68395447, 0.98941813, 0.99483154, 0.47556492],
-												 [	-5.68903884, -0.00329975, 0.00186498, 6.68573909, 0.98942807, 0.99483527, 0.47561551],
-												 [	-5.69081606, -0.00329711, 0.00186389, 6.68751895, 0.98943799, 0.99483900, 0.47566598],
-												 [	-5.69258853, -0.00329447, 0.00186280, 6.68929406, 0.98944790, 0.99484272, 0.47571632],
-												 [	-5.69435627, -0.00329184, 0.00186172, 6.69106443, 0.98945779, 0.99484644, 0.47576654],
-												 [	-5.69611926, -0.00328921, 0.00186063, 6.69283005, 0.98946767, 0.99485016, 0.47581663],
-												 [	-5.69787754, -0.00328658, 0.00185954, 6.69459096, 0.98947753, 0.99485388, 0.47586659],
-												 [	-5.69963110, -0.00328396, 0.00185846, 6.69634715, 0.98948737, 0.99485759, 0.47591642],
-												 [	-5.70137996, -0.00328133, 0.00185737, 6.69809863, 0.98949720, 0.99486129, 0.47596613],
-												 [	-5.70312413, -0.00327872, 0.00185629, 6.69984541, 0.98950701, 0.99486500, 0.47601571],
-												 [	-5.70486360, -0.00327610, 0.00185520, 6.70158750, 0.98951681, 0.99486870, 0.47606516],
-												 [	-5.70659840, -0.00327349, 0.00185412, 6.70332492, 0.98952659, 0.99487239, 0.47611449],
-												 [	-5.70832854, -0.00327088, 0.00185304, 6.70505766, 0.98953636, 0.99487609, 0.47616370],
-												 [	-5.71005402, -0.00326827, 0.00185195, 6.70678575, 0.98954611, 0.99487978, 0.47621277],
-												 [	-5.71177484, -0.00326567, 0.00185087, 6.70850918, 0.98955584, 0.99488347, 0.47626172],
-												 [	-5.71349103, -0.00326306, 0.00184979, 6.71022797, 0.98956556, 0.99488715, 0.47631055],
-												 [	-5.71520259, -0.00326047, 0.00184870, 6.71194212, 0.98957526, 0.99489083, 0.47635925],
-												 [	-5.71690953, -0.00325787, 0.00184762, 6.71365166, 0.98958495, 0.99489451, 0.47640783],
-												 [	-5.71861185, -0.00325528, 0.00184654, 6.71535658, 0.98959462, 0.99489818, 0.47645628],
-												 [	-5.72030958, -0.00325269, 0.00184546, 6.71705689, 0.98960428, 0.99490185, 0.47650461],
-												 [	-5.72200271, -0.00325010, 0.00184438, 6.71875261, 0.98961392, 0.99490552, 0.47655282],
-												 [	-5.72369126, -0.00324752, 0.00184330, 6.72044374, 0.98962355, 0.99490918, 0.47660090],
-												 [	-5.72537523, -0.00324494, 0.00184222, 6.72213029, 0.98963316, 0.99491284, 0.47664886],
-												 [	-5.72705463, -0.00324236, 0.00184114, 6.72381227, 0.98964276, 0.99491650, 0.47669669],
-												 [	-5.72872948, -0.00323979, 0.00184006, 6.72548970, 0.98965234, 0.99492016, 0.47674440],
-												 [	-5.73039979, -0.00323721, 0.00183898, 6.72716257, 0.98966190, 0.99492381, 0.47679198],
-												 [	-5.73206555, -0.00323464, 0.00183790, 6.72883091, 0.98967145, 0.99492746, 0.47683945],
-												 [	-5.73372679, -0.00323208, 0.00183682, 6.73049471, 0.98968099, 0.99493110, 0.47688679],
-												 [	-5.73538351, -0.00322952, 0.00183574, 6.73215399, 0.98969051, 0.99493474, 0.47693401],
-												 [	-5.73703572, -0.00322695, 0.00183466, 6.73380876, 0.98970002, 0.99493838, 0.47698111],
-												 [	-5.73868343, -0.00322440, 0.00183359, 6.73545903, 0.98970951, 0.99494202, 0.47702808],
-												 [	-5.74032664, -0.00322184, 0.00183251, 6.73710480, 0.98971898, 0.99494565, 0.47707494],
-												 [	-5.74196538, -0.00321929, 0.00183143, 6.73874609, 0.98972844, 0.99494928, 0.47712167],
-												 [	-5.74359964, -0.00321674, 0.00183036, 6.74038290, 0.98973789, 0.99495290, 0.47716828],
-												 [	-5.74522943, -0.00321419, 0.00182928, 6.74201524, 0.98974732, 0.99495653, 0.47721477],
-												 [	-5.74685478, -0.00321165, 0.00182820, 6.74364312, 0.98975674, 0.99496014, 0.47726113],
-												 [	-5.74847567, -0.00320911, 0.00182713, 6.74526656, 0.98976614, 0.99496376, 0.47730738],
-												 [	-5.75009213, -0.00320657, 0.00182605, 6.74688556, 0.98977552, 0.99496737, 0.47735351],
-												 [	-5.75170417, -0.00320404, 0.00182498, 6.74850013, 0.98978490, 0.99497098, 0.47739952],
-												 [	-5.75331179, -0.00320151, 0.00182390, 6.75011028, 0.98979425, 0.99497459, 0.47744540],
-												 [	-5.75491499, -0.00319898, 0.00182283, 6.75171602, 0.98980360, 0.99497819, 0.47749117],
-												 [	-5.75651380, -0.00319645, 0.00182176, 6.75331735, 0.98981293, 0.99498179, 0.47753682],
-												 [	-5.75810822, -0.00319393, 0.00182068, 6.75491429, 0.98982224, 0.99498539, 0.47758234],
-												 [	-5.75969826, -0.00319141, 0.00181961, 6.75650685, 0.98983154, 0.99498899, 0.47762775],
-												 [	-5.76128392, -0.00318889, 0.00181854, 6.75809504, 0.98984082, 0.99499258, 0.47767304],
-												 [	-5.76286523, -0.00318637, 0.00181746, 6.75967886, 0.98985009, 0.99499616, 0.47771821],
-												 [	-5.76444218, -0.00318386, 0.00181639, 6.76125832, 0.98985935, 0.99499975, 0.47776327],
-												 [	-5.76601479, -0.00318135, 0.00181532, 6.76283343, 0.98986859, 0.99500333, 0.47780820],
-												 [	-5.76758306, -0.00317884, 0.00181425, 6.76440421, 0.98987782, 0.99500691, 0.47785302],
-												 [	-5.76914700, -0.00317634, 0.00181318, 6.76597066, 0.98988703, 0.99501049, 0.47789772],
-												 [	-5.77070663, -0.00317384, 0.00181210, 6.76753279, 0.98989623, 0.99501406, 0.47794230],
-												 [	-5.77226195, -0.00317134, 0.00181103, 6.76909061, 0.98990542, 0.99501763, 0.47798676],
-												 [	-5.77381298, -0.00316884, 0.00180996, 6.77064413, 0.98991459, 0.99502119, 0.47803110],
-												 [	-5.77535971, -0.00316635, 0.00180889, 6.77219336, 0.98992374, 0.99502476, 0.47807533],
-												 [	-5.77690216, -0.00316386, 0.00180782, 6.77373830, 0.98993289, 0.99502832, 0.47811945],
-												 [	-5.77844035, -0.00316137, 0.00180675, 6.77527898, 0.98994201, 0.99503187, 0.47816344],
-												 [	-5.77997427, -0.00315889, 0.00180569, 6.77681538, 0.98995113, 0.99503543, 0.47820732],
-												 [	-5.78150394, -0.00315640, 0.00180462, 6.77834753, 0.98996023, 0.99503898, 0.47825108],
-												 [	-5.78302936, -0.00315393, 0.00180355, 6.77987544, 0.98996931, 0.99504253, 0.47829473],
-												 [	-5.78455056, -0.00315145, 0.00180248, 6.78139911, 0.98997839, 0.99504607, 0.47833826],
-												 [	-5.78606752, -0.00314897, 0.00180141, 6.78291855, 0.98998744, 0.99504961, 0.47838168],
-												 [	-5.78758027, -0.00314650, 0.00180035, 6.78443377, 0.98999649, 0.99505315, 0.47842498],
-												 [	-5.78908882, -0.00314403, 0.00179928, 6.78594478, 0.99000552, 0.99505669, 0.47846816],
-												 [	-5.79059316, -0.00314157, 0.00179821, 6.78745159, 0.99001453, 0.99506022, 0.47851123],
-												 [	-5.79209332, -0.00313911, 0.00179715, 6.78895421, 0.99002354, 0.99506375, 0.47855419],
-												 [	-5.79358930, -0.00313665, 0.00179608, 6.79045265, 0.99003253, 0.99506727, 0.47859703],
-												 [	-5.79508110, -0.00313419, 0.00179501, 6.79194692, 0.99004150, 0.99507080, 0.47863976],
-												 [	-5.79656875, -0.00313173, 0.00179395, 6.79343702, 0.99005046, 0.99507432, 0.47868238],
-												 [	-5.79805224, -0.00312928, 0.00179288, 6.79492296, 0.99005941, 0.99507784, 0.47872487],
-												 [	-5.79953159, -0.00312683, 0.00179182, 6.79640476, 0.99006834, 0.99508135, 0.47876726],
-												 [	-5.80100681, -0.00312438, 0.00179075, 6.79788243, 0.99007726, 0.99508486, 0.47880954],
-												 [	-5.80247790, -0.00312194, 0.00178969, 6.79935596, 0.99008617, 0.99508837, 0.47885170],
-												 [	-5.80394487, -0.00311950, 0.00178863, 6.80082538, 0.99009506, 0.99509187, 0.47889374],
-												 [	-5.80540774, -0.00311706, 0.00178756, 6.80229068, 0.99010394, 0.99509538, 0.47893568],
-												 [	-5.80686651, -0.00311462, 0.00178650, 6.80375189, 0.99011281, 0.99509888, 0.47897750],
-												 [	-5.80832119, -0.00311219, 0.00178544, 6.80520900, 0.99012166, 0.99510237, 0.47901921],
-												 [	-5.80977179, -0.00310976, 0.00178438, 6.80666204, 0.99013050, 0.99510587, 0.47906081],
-												 [	-5.81121832, -0.00310733, 0.00178331, 6.80811099, 0.99013933, 0.99510936, 0.47910230],
-												 [	-5.81266079, -0.00310490, 0.00178225, 6.80955589, 0.99014814, 0.99511284, 0.47914367],
-												 [	-5.81409921, -0.00310248, 0.00178119, 6.81099673, 0.99015694, 0.99511633, 0.47918494],
-												 [	-5.81553358, -0.00310006, 0.00178013, 6.81243352, 0.99016573, 0.99511981, 0.47922609],
-												 [	-5.81696392, -0.00309764, 0.00177907, 6.81386627, 0.99017450, 0.99512329, 0.47926714],
-												 [	-5.81839023, -0.00309523, 0.00177801, 6.81529500, 0.99018326, 0.99512676, 0.47930807],
-												 [	-5.81981252, -0.00309282, 0.00177695, 6.81671970, 0.99019200, 0.99513024, 0.47934889],
-												 [	-5.82123081, -0.00309041, 0.00177589, 6.81814040, 0.99020074, 0.99513370, 0.47938960],
-												 [	-5.82264509, -0.00308800, 0.00177483, 6.81955709, 0.99020946, 0.99513717, 0.47943020],
-												 [	-5.82405539, -0.00308560, 0.00177377, 6.82096980, 0.99021816, 0.99514063, 0.47947070],
-												 [	-5.82546171, -0.00308319, 0.00177271, 6.82237851, 0.99022686, 0.99514410, 0.47951108],
-												 [	-5.82686405, -0.00308079, 0.00177165, 6.82378326, 0.99023554, 0.99514755, 0.47955135],
-												 [	-5.82826243, -0.00307840, 0.00177059, 6.82518403, 0.99024421, 0.99515101, 0.47959152],
-												 [	-5.82965686, -0.00307600, 0.00176954, 6.82658086, 0.99025286, 0.99515446, 0.47963157],
-												 [	-5.83104734, -0.00307361, 0.00176848, 6.82797373, 0.99026150, 0.99515791, 0.47967152],
-												 [	-5.83243389, -0.00307122, 0.00176742, 6.82936266, 0.99027013, 0.99516135, 0.47971136],
-												 [	-5.83381650, -0.00306884, 0.00176637, 6.83074767, 0.99027875, 0.99516480, 0.47975109],
-												 [	-5.83519520, -0.00306645, 0.00176531, 6.83212875, 0.99028735, 0.99516824, 0.47979072],
-												 [	-5.83656999, -0.00306407, 0.00176425, 6.83350592, 0.99029594, 0.99517167, 0.47983023],
-												 [	-5.83794088, -0.00306169, 0.00176320, 6.83487918, 0.99030451, 0.99517511, 0.47986964],
-												 [	-5.83930788, -0.00305932, 0.00176214, 6.83624856, 0.99031308, 0.99517854, 0.47990894],
-												 [	-5.84067099, -0.00305695, 0.00176109, 6.83761404, 0.99032163, 0.99518197, 0.47994814],
-												 [	-5.84203023, -0.00305458, 0.00176003, 6.83897565, 0.99033017, 0.99518539, 0.47998722],
-												 [	-5.84338560, -0.00305221, 0.00175898, 6.84033340, 0.99033869, 0.99518881, 0.48002620],
-												 [	-5.84473712, -0.00304984, 0.00175793, 6.84168728, 0.99034721, 0.99519223, 0.48006508],
-												 [	-5.84608479, -0.00304748, 0.00175687, 6.84303731, 0.99035571, 0.99519565, 0.48010385],
-												 [	-5.84742862, -0.00304512, 0.00175582, 6.84438350, 0.99036419, 0.99519906, 0.48014251],
-												 [	-5.84876862, -0.00304276, 0.00175477, 6.84572586, 0.99037267, 0.99520247, 0.48018107],
-												 [	-5.85010480, -0.00304041, 0.00175371, 6.84706439, 0.99038113, 0.99520588, 0.48021952],
-												 [	-5.85143717, -0.00303805, 0.00175266, 6.84839911, 0.99038958, 0.99520929, 0.48025787],
-												 [	-5.85276573, -0.00303570, 0.00175161, 6.84973003, 0.99039802, 0.99521269, 0.48029611],
-												 [	-5.85409050, -0.00303336, 0.00175056, 6.85105714, 0.99040644, 0.99521609, 0.48033425],
-												 [	-5.85541148, -0.00303101, 0.00174951, 6.85238047, 0.99041485, 0.99521948, 0.48037228],
-												 [	-5.85672868, -0.00302867, 0.00174846, 6.85370002, 0.99042325, 0.99522288, 0.48041021],
-												 [	-5.85804212, -0.00302633, 0.00174741, 6.85501579, 0.99043164, 0.99522627, 0.48044803],
-												 [	-5.85935180, -0.00302399, 0.00174636, 6.85632781, 0.99044002, 0.99522965, 0.48048575],
-												 [	-5.86065772, -0.00302166, 0.00174531, 6.85763607, 0.99044838, 0.99523304, 0.48052337],
-												 [	-5.86195991, -0.00301932, 0.00174426, 6.85894058, 0.99045673, 0.99523642, 0.48056088],
-												 [	-5.86325835, -0.00301699, 0.00174321, 6.86024136, 0.99046507, 0.99523980, 0.48059829],
-												 [	-5.86455308, -0.00301467, 0.00174216, 6.86153841, 0.99047339, 0.99524317, 0.48063560],
-												 [	-5.86584409, -0.00301234, 0.00174111, 6.86283174, 0.99048171, 0.99524655, 0.48067281],
-												 [	-5.86713139, -0.00301002, 0.00174006, 6.86412137, 0.99049001, 0.99524992, 0.48070991],
-												 [	-5.86841499, -0.00300770, 0.00173902, 6.86540729, 0.99049829, 0.99525328, 0.48074691],
-												 [	-5.86969490, -0.00300538, 0.00173797, 6.86668952, 0.99050657, 0.99525665, 0.48078381],
-												 [	-5.87097113, -0.00300307, 0.00173692, 6.86796806, 0.99051483, 0.99526001, 0.48082060],
-												 [	-5.87224368, -0.00300076, 0.00173588, 6.86924293, 0.99052309, 0.99526337, 0.48085730],
-												 [	-5.87351257, -0.00299845, 0.00173483, 6.87051413, 0.99053133, 0.99526672, 0.48089389],
-												 [	-5.87477781, -0.00299614, 0.00173378, 6.87178167, 0.99053955, 0.99527008, 0.48093038],
-												 [	-5.87603940, -0.00299383, 0.00173274, 6.87304557, 0.99054777, 0.99527343, 0.48096678],
-												 [	-5.87729735, -0.00299153, 0.00173169, 6.87430582, 0.99055597, 0.99527677, 0.48100307],
-												 [	-5.87855167, -0.00298923, 0.00173065, 6.87556244, 0.99056416, 0.99528012, 0.48103926],
-												 [	-5.87980237, -0.00298694, 0.00172961, 6.87681543, 0.99057234, 0.99528346, 0.48107535],
-												 [	-5.88104946, -0.00298464, 0.00172856, 6.87806482, 0.99058051, 0.99528680, 0.48111134],
-												 [	-5.88229294, -0.00298235, 0.00172752, 6.87931059, 0.99058867, 0.99529013, 0.48114723],
-												 [	-5.88353283, -0.00298006, 0.00172648, 6.88055277, 0.99059681, 0.99529347, 0.48118302],
-												 [	-5.88476913, -0.00297777, 0.00172543, 6.88179135, 0.99060494, 0.99529680, 0.48121871],
-												 [	-5.88600185, -0.00297549, 0.00172439, 6.88302636, 0.99061306, 0.99530012, 0.48125430],
-												 [	-5.88723100, -0.00297320, 0.00172335, 6.88425779, 0.99062117, 0.99530345, 0.48128980],
-												 [	-5.88845659, -0.00297093, 0.00172231, 6.88548566, 0.99062927, 0.99530677, 0.48132519],
-												 [	-5.88967862, -0.00296865, 0.00172127, 6.88670998, 0.99063735, 0.99531009, 0.48136049],
-												 [	-5.89089712, -0.00296637, 0.00172022, 6.88793074, 0.99064542, 0.99531340, 0.48139569],
-												 [	-5.89211207, -0.00296410, 0.00171918, 6.88914797, 0.99065348, 0.99531671, 0.48143079],
-												 [	-5.89332350, -0.00296183, 0.00171814, 6.89036167, 0.99066153, 0.99532002, 0.48146579],
-												 [	-5.89453141, -0.00295956, 0.00171710, 6.89157185, 0.99066957, 0.99532333, 0.48150069],
-												 [	-5.89573581, -0.00295730, 0.00171607, 6.89277851, 0.99067760, 0.99532664, 0.48153550],
-												 [	-5.89693670, -0.00295504, 0.00171503, 6.89398167, 0.99068561, 0.99532994, 0.48157021],
-												 [	-5.89813411, -0.00295278, 0.00171399, 6.89518133, 0.99069361, 0.99533324, 0.48160482],
-												 [	-5.89932802, -0.00295052, 0.00171295, 6.89637751, 0.99070160, 0.99533653, 0.48163934],
-												 [	-5.90051846, -0.00294826, 0.00171191, 6.89757020, 0.99070958, 0.99533983, 0.48167376],
-												 [	-5.90170544, -0.00294601, 0.00171088, 6.89875943, 0.99071755, 0.99534312, 0.48170809],
-												 [	-5.90288895, -0.00294376, 0.00170984, 6.89994519, 0.99072550, 0.99534640, 0.48174231],
-												 [	-5.90406901, -0.00294151, 0.00170880, 6.90112750, 0.99073345, 0.99534969, 0.48177645],
-												 [	-5.90524562, -0.00293927, 0.00170777, 6.90230636, 0.99074138, 0.99535297, 0.48181048],
-												 [	-5.90641881, -0.00293702, 0.00170673, 6.90348178, 0.99074930, 0.99535625, 0.48184443],
-												 [	-5.90758856, -0.00293478, 0.00170569, 6.90465378, 0.99075721, 0.99535952, 0.48187827],
-												 [	-5.90875490, -0.00293254, 0.00170466, 6.90582235, 0.99076511, 0.99536280, 0.48191202],
-												 [	-5.90991782, -0.00293031, 0.00170363, 6.90698751, 0.99077300, 0.99536607, 0.48194568],
-												 [	-5.91107735, -0.00292807, 0.00170259, 6.90814927, 0.99078087, 0.99536933, 0.48197924],
-												 [	-5.91223348, -0.00292584, 0.00170156, 6.90930763, 0.99078874, 0.99537260, 0.48201271],
-												 [	-5.91338622, -0.00292362, 0.00170052, 6.91046261, 0.99079659, 0.99537586, 0.48204608],
-												 [	-5.91453559, -0.00292139, 0.00169949, 6.91161420, 0.99080443, 0.99537912, 0.48207936],
-												 [	-5.91568159, -0.00291917, 0.00169846, 6.91276243, 0.99081226, 0.99538238, 0.48211255],
-												 [	-5.91682423, -0.00291694, 0.00169743, 6.91390729, 0.99082008, 0.99538563, 0.48214564],
-												 [	-5.91796352, -0.00291472, 0.00169639, 6.91504879, 0.99082789, 0.99538888, 0.48217864],
-												 [	-5.91909946, -0.00291251, 0.00169536, 6.91618695, 0.99083569, 0.99539213, 0.48221155],
-												 [	-5.92023207, -0.00291029, 0.00169433, 6.91732177, 0.99084347, 0.99539537, 0.48224436],
-												 [	-5.92136135, -0.00290808, 0.00169330, 6.91845327, 0.99085124, 0.99539862, 0.48227709],
-												 [	-5.92248731, -0.00290587, 0.00169227, 6.91958144, 0.99085901, 0.99540186, 0.48230971],
-												 [	-5.92360996, -0.00290367, 0.00169124, 6.92070629, 0.99086676, 0.99540509, 0.48234225],
-												 [	-5.92472930, -0.00290146, 0.00169021, 6.92182784, 0.99087450, 0.99540833, 0.48237470],
-												 [	-5.92584536, -0.00289926, 0.00168918, 6.92294610, 0.99088223, 0.99541156, 0.48240705],
-												 [	-5.92695812, -0.00289706, 0.00168816, 6.92406106, 0.99088995, 0.99541479, 0.48243931],
-												 [	-5.92806761, -0.00289486, 0.00168713, 6.92517274, 0.99089766, 0.99541801, 0.48247148],
-												 [	-5.92917382, -0.00289267, 0.00168610, 6.92628115, 0.99090535, 0.99542123, 0.48250356],
-												 [	-5.93027677, -0.00289047, 0.00168507, 6.92738630, 0.99091304, 0.99542445, 0.48253555],
-												 [	-5.93137647, -0.00288828, 0.00168405, 6.92848819, 0.99092071, 0.99542767, 0.48256745],
-												 [	-5.93247293, -0.00288610, 0.00168302, 6.92958683, 0.99092837, 0.99543089, 0.48259926],
-												 [	-5.93356614, -0.00288391, 0.00168199, 6.93068223, 0.99093603, 0.99543410, 0.48263098],
-												 [	-5.93465613, -0.00288173, 0.00168097, 6.93177440, 0.99094367, 0.99543731, 0.48266260],
-												 [	-5.93574289, -0.00287955, 0.00167994, 6.93286334, 0.99095130, 0.99544051, 0.48269414],
-												 [	-5.93682644, -0.00287737, 0.00167892, 6.93394907, 0.99095892, 0.99544371, 0.48272559],
-												 [	-5.93790678, -0.00287519, 0.00167789, 6.93503159, 0.99096653, 0.99544692, 0.48275695],
-												 [	-5.93898392, -0.00287302, 0.00167687, 6.93611091, 0.99097412, 0.99545011, 0.48278822],
-												 [	-5.94005788, -0.00287085, 0.00167585, 6.93718703, 0.99098171, 0.99545331, 0.48281940],
-												 [	-5.94112865, -0.00286868, 0.00167482, 6.93825997, 0.99098929, 0.99545650, 0.48285049],
-												 [	-5.94219625, -0.00286651, 0.00167380, 6.93932974, 0.99099685, 0.99545969, 0.48288150],
-												 [	-5.94326068, -0.00286435, 0.00167278, 6.94039634, 0.99100441, 0.99546288, 0.48291241],
-												 [	-5.94432196, -0.00286218, 0.00167176, 6.94145977, 0.99101195, 0.99546606, 0.48294324],
-												 [	-5.94538008, -0.00286002, 0.00167074, 6.94252006, 0.99101949, 0.99546924, 0.48297398],
-												 [	-5.94643506, -0.00285787, 0.00166971, 6.94357720, 0.99102701, 0.99547242, 0.48300463],
-												 [	-5.94748691, -0.00285571, 0.00166869, 6.94463120, 0.99103452, 0.99547559, 0.48303520],
-												 [	-5.94853563, -0.00285356, 0.00166767, 6.94568207, 0.99104202, 0.99547877, 0.48306568],
-												 [	-5.94958124, -0.00285141, 0.00166666, 6.94672983, 0.99104951, 0.99548194, 0.48309607],
-												 [	-5.95062373, -0.00284926, 0.00166564, 6.94777447, 0.99105699, 0.99548510, 0.48312637],
-												 [	-5.95166312, -0.00284711, 0.00166462, 6.94881600, 0.99106446, 0.99548827, 0.48315659],
-												 [	-5.95269941, -0.00284497, 0.00166360, 6.94985444, 0.99107192, 0.99549143, 0.48318672],
-												 [	-5.95373262, -0.00284283, 0.00166258, 6.95088979, 0.99107937, 0.99549459, 0.48321676],
-												 [	-5.95476275, -0.00284069, 0.00166156, 6.95192206, 0.99108681, 0.99549775, 0.48324672],
-												 [	-5.95578980, -0.00283855, 0.00166055, 6.95295125, 0.99109423, 0.99550090, 0.48327660],
-												 [	-5.95681380, -0.00283642, 0.00165953, 6.95397738, 0.99110165, 0.99550405, 0.48330638],
-												 [	-5.95783474, -0.00283429, 0.00165852, 6.95500045, 0.99110906, 0.99550720, 0.48333609],
-												 [	-5.95885262, -0.00283216, 0.00165750, 6.95602047, 0.99111645, 0.99551034, 0.48336571],
-												 [	-5.95986747, -0.00283003, 0.00165648, 6.95703744, 0.99112384, 0.99551348, 0.48339524],
-												 [	-5.96087929, -0.00282791, 0.00165547, 6.95805138, 0.99113121, 0.99551662, 0.48342469],
-												 [	-5.96188808, -0.00282578, 0.00165446, 6.95906230, 0.99113858, 0.99551976, 0.48345405],
-												 [	-5.96289385, -0.00282366, 0.00165344, 6.96007019, 0.99114593, 0.99552290, 0.48348333],
-												 [	-5.96389662, -0.00282154, 0.00165243, 6.96107507, 0.99115327, 0.99552603, 0.48351252],
-												 [	-5.96489638, -0.00281943, 0.00165142, 6.96207695, 0.99116061, 0.99552916, 0.48354163],
-												 [	-5.96589315, -0.00281732, 0.00165040, 6.96307584, 0.99116793, 0.99553228, 0.48357066],
-												 [	-5.96688693, -0.00281520, 0.00164939, 6.96407173, 0.99117524, 0.99553540, 0.48359961],
-												 [	-5.96787774, -0.00281310, 0.00164838, 6.96506464, 0.99118255, 0.99553852, 0.48362846],
-												 [	-5.96886557, -0.00281099, 0.00164737, 6.96605458, 0.99118984, 0.99554164, 0.48365724],
-												 [	-5.96985044, -0.00280888, 0.00164636, 6.96704156, 0.99119712, 0.99554476, 0.48368594],
-												 [	-5.97083235, -0.00280678, 0.00164535, 6.96802557, 0.99120439, 0.99554787, 0.48371455],
-												 [	-5.97181132, -0.00280468, 0.00164434, 6.96900664, 0.99121165, 0.99555098, 0.48374308],
-												 [	-5.97278734, -0.00280258, 0.00164333, 6.96998476, 0.99121891, 0.99555409, 0.48377153],
-												 [	-5.97376044, -0.00280049, 0.00164232, 6.97095995, 0.99122615, 0.99555719, 0.48379989],
-												 [	-5.97473060, -0.00279840, 0.00164131, 6.97193221, 0.99123338, 0.99556029, 0.48382818],
-												 [	-5.97569785, -0.00279631, 0.00164031, 6.97290155, 0.99124060, 0.99556339, 0.48385638],
-												 [	-5.97666219, -0.00279422, 0.00163930, 6.97386797, 0.99124781, 0.99556648, 0.48388450],
-												 [	-5.97762362, -0.00279213, 0.00163829, 6.97483149, 0.99125501, 0.99556958, 0.48391254],
-												 [	-5.97858216, -0.00279005, 0.00163729, 6.97579212, 0.99126220, 0.99557267, 0.48394050],
-												 [	-5.97953782, -0.00278796, 0.00163628, 6.97674985, 0.99126938, 0.99557576, 0.48396837],
-												 [	-5.98049059, -0.00278589, 0.00163527, 6.97770470, 0.99127655, 0.99557884, 0.48399617],
-												 [	-5.98144049, -0.00278381, 0.00163427, 6.97865668, 0.99128371, 0.99558192, 0.48402389],
-												 [	-5.98238752, -0.00278173, 0.00163326, 6.97960579, 0.99129087, 0.99558500, 0.48405152],
-												 [	-5.98333170, -0.00277966, 0.00163226, 6.98055204, 0.99129801, 0.99558808, 0.48407908],
-												 [	-5.98427302, -0.00277759, 0.00163126, 6.98149543, 0.99130514, 0.99559115, 0.48410655],
-												 [	-5.98521150, -0.00277552, 0.00163025, 6.98243598, 0.99131226, 0.99559422, 0.48413395],
-												 [	-5.98614715, -0.00277346, 0.00162925, 6.98337369, 0.99131937, 0.99559729, 0.48416127],
-												 [	-5.98707997, -0.00277139, 0.00162825, 6.98430858, 0.99132647, 0.99560036, 0.48418851],
-												 [	-5.98800996, -0.00276933, 0.00162725, 6.98524063, 0.99133356, 0.99560342, 0.48421567],
-												 [	-5.98893715, -0.00276727, 0.00162625, 6.98616988, 0.99134064, 0.99560648, 0.48424275],
-												 [	-5.98986153, -0.00276521, 0.00162525, 6.98709631, 0.99134771, 0.99560954, 0.48426975],
-												 [	-5.99078310, -0.00276316, 0.00162425, 6.98801995, 0.99135477, 0.99561259, 0.48429667],
-												 [	-5.99170189, -0.00276111, 0.00162325, 6.98894079, 0.99136183, 0.99561565, 0.48432352],
-												 [	-5.99261789, -0.00275906, 0.00162225, 6.98985884, 0.99136887, 0.99561870, 0.48435028],
-												 [	-5.99353112, -0.00275701, 0.00162125, 6.99077411, 0.99137590, 0.99562174, 0.48437697],
-												 [	-5.99444158, -0.00275496, 0.00162025, 6.99168662, 0.99138292, 0.99562479, 0.48440358],
-												 [	-5.99534927, -0.00275292, 0.00161925, 6.99259635, 0.99138994, 0.99562783, 0.48443012],
-												 [	-5.99625421, -0.00275088, 0.00161826, 6.99350334, 0.99139694, 0.99563087, 0.48445657],
-												 [	-5.99715640, -0.00274884, 0.00161726, 6.99440757, 0.99140393, 0.99563390, 0.48448295],
-												 [	-5.99805585, -0.00274680, 0.00161626, 6.99530906, 0.99141092, 0.99563694, 0.48450926],
-												 [	-5.99895257, -0.00274476, 0.00161527, 6.99620781, 0.99141789, 0.99563997, 0.48453548],
-												 [	-5.99984656, -0.00274273, 0.00161427, 6.99710383, 0.99142485, 0.99564299, 0.48456163],
-												 [	-6.00073784, -0.00274070, 0.00161328, 6.99799714, 0.99143181, 0.99564602, 0.48458771],
-												 [	-6.00162640, -0.00273867, 0.00161228, 6.99888773, 0.99143875, 0.99564904, 0.48461370],
-												 [	-6.00251225, -0.00273665, 0.00161129, 6.99977561, 0.99144569, 0.99565206, 0.48463962],
-												 [	-6.00339541, -0.00273462, 0.00161030, 7.00066079, 0.99145261, 0.99565508, 0.48466547],
-												 [	-6.00427588, -0.00273260, 0.00160931, 7.00154328, 0.99145953, 0.99565809, 0.48469124],
-												 [	-6.00515367, -0.00273058, 0.00160831, 7.00242309, 0.99146644, 0.99566111, 0.48471693],
-												 [	-6.00602878, -0.00272856, 0.00160732, 7.00330021, 0.99147334, 0.99566411, 0.48474255],
-												 [	-6.00690122, -0.00272655, 0.00160633, 7.00417467, 0.99148022, 0.99566712, 0.48476810],
-												 [	-6.00777100, -0.00272454, 0.00160534, 7.00504646, 0.99148710, 0.99567012, 0.48479357],
-												 [	-6.00863812, -0.00272252, 0.00160435, 7.00591560, 0.99149397, 0.99567313, 0.48481896],
-												 [	-6.00950260, -0.00272052, 0.00160336, 7.00678208, 0.99150083, 0.99567612, 0.48484429],
-												 [	-6.01036444, -0.00271851, 0.00160237, 7.00764593, 0.99150768, 0.99567912, 0.48486953],
-												 [	-6.01122364, -0.00271651, 0.00160138, 7.00850713, 0.99151452, 0.99568211, 0.48489471],
-												 [	-6.01208022, -0.00271450, 0.00160039, 7.00936571, 0.99152135, 0.99568510, 0.48491980],
-												 [	-6.01293417, -0.00271250, 0.00159941, 7.01022167, 0.99152817, 0.99568809, 0.48494483],
-												 [	-6.01378552, -0.00271051, 0.00159842, 7.01107501, 0.99153498, 0.99569107, 0.48496978],
-												 [	-6.01463426, -0.00270851, 0.00159743, 7.01192575, 0.99154179, 0.99569406, 0.48499466],
-												 [	-6.01548040, -0.00270652, 0.00159645, 7.01277388, 0.99154858, 0.99569704, 0.48501947],
-												 [	-6.01632394, -0.00270453, 0.00159546, 7.01361942, 0.99155537, 0.99570001, 0.48504420],
-												 [	-6.01716491, -0.00270254, 0.00159448, 7.01446237, 0.99156214, 0.99570299, 0.48506886],
-												 [	-6.01800329, -0.00270055, 0.00159349, 7.01530274, 0.99156891, 0.99570596, 0.48509345],
-												 [	-6.01883911, -0.00269856, 0.00159251, 7.01614055, 0.99157566, 0.99570893, 0.48511797],
-												 [	-6.01967236, -0.00269658, 0.00159153, 7.01697578, 0.99158241, 0.99571189, 0.48514241],
-												 [	-6.02050306, -0.00269460, 0.00159054, 7.01780845, 0.99158915, 0.99571486, 0.48516678],
-												 [	-6.02133120, -0.00269262, 0.00158956, 7.01863858, 0.99159588, 0.99571782, 0.48519108],
-												 [	-6.02215680, -0.00269065, 0.00158858, 7.01946615, 0.99160260, 0.99572077, 0.48521531],
-												 [	-6.02297987, -0.00268867, 0.00158760, 7.02029119, 0.99160931, 0.99572373, 0.48523947],
-												 [	-6.02380040, -0.00268670, 0.00158662, 7.02111370, 0.99161601, 0.99572668, 0.48526355],
-												 [	-6.02461841, -0.00268473, 0.00158564, 7.02193368, 0.99162270, 0.99572963, 0.48528757],
-												 [	-6.02543391, -0.00268276, 0.00158466, 7.02275115, 0.99162938, 0.99573258, 0.48531151],
-												 [	-6.02624690, -0.00268080, 0.00158368, 7.02356610, 0.99163606, 0.99573552, 0.48533539],
-												 [	-6.02705738, -0.00267883, 0.00158270, 7.02437855, 0.99164272, 0.99573847, 0.48535919],
-												 [	-6.02786537, -0.00267687, 0.00158172, 7.02518850, 0.99164938, 0.99574141, 0.48538292],
-												 [	-6.02867087, -0.00267491, 0.00158074, 7.02599596, 0.99165602, 0.99574434, 0.48540659],
-												 [	-6.02947389, -0.00267296, 0.00157977, 7.02680093, 0.99166266, 0.99574728, 0.48543018],
-												 [	-6.03027443, -0.00267100, 0.00157879, 7.02760343, 0.99166929, 0.99575021, 0.48545370],
-												 [	-6.03107251, -0.00266905, 0.00157781, 7.02840346, 0.99167591, 0.99575314, 0.48547716],
-												 [	-6.03186812, -0.00266710, 0.00157684, 7.02920102, 0.99168252, 0.99575606, 0.48550054],
-												 [	-6.03266127, -0.00266515, 0.00157586, 7.02999612, 0.99168912, 0.99575899, 0.48552386],
-												 [	-6.03345198, -0.00266320, 0.00157489, 7.03078878, 0.99169571, 0.99576191, 0.48554710],
-												 [	-6.03424025, -0.00266126, 0.00157391, 7.03157899, 0.99170230, 0.99576483, 0.48557028],
-												 [	-6.03502608, -0.00265932, 0.00157294, 7.03236676, 0.99170887, 0.99576774, 0.48559339],
-												 [	-6.03580948, -0.00265738, 0.00157197, 7.03315210, 0.99171544, 0.99577065, 0.48561643],
-												 [	-6.03659046, -0.00265544, 0.00157100, 7.03393502, 0.99172199, 0.99577356, 0.48563940],
-												 [	-6.03736903, -0.00265350, 0.00157002, 7.03471552, 0.99172854, 0.99577647, 0.48566231],
-												 [	-6.03814518, -0.00265157, 0.00156905, 7.03549361, 0.99173508, 0.99577938, 0.48568514],
-												 [	-6.03891894, -0.00264964, 0.00156808, 7.03626930, 0.99174161, 0.99578228, 0.48570791],
-												 [	-6.03969029, -0.00264771, 0.00156711, 7.03704258, 0.99174813, 0.99578518, 0.48573061],
-												 [	-6.04045926, -0.00264578, 0.00156614, 7.03781348, 0.99175464, 0.99578807, 0.48575324],
-												 [	-6.04122585, -0.00264386, 0.00156517, 7.03858199, 0.99176115, 0.99579097, 0.48577581],
-												 [	-6.04199006, -0.00264193, 0.00156421, 7.03934813, 0.99176764, 0.99579386, 0.48579831],
-												 [	-6.04275190, -0.00264001, 0.00156324, 7.04011189, 0.99177413, 0.99579675, 0.48582075],
-												 [	-6.04351138, -0.00263809, 0.00156227, 7.04087328, 0.99178061, 0.99579964, 0.48584311],
-												 [	-6.04426850, -0.00263618, 0.00156130, 7.04163232, 0.99178707, 0.99580252, 0.48586541],
-												 [	-6.04502327, -0.00263426, 0.00156034, 7.04238901, 0.99179353, 0.99580540, 0.48588765],
-												 [	-6.04577570, -0.00263235, 0.00155937, 7.04314335, 0.99179998, 0.99580828, 0.48590981],
-												 [	-6.04652579, -0.00263044, 0.00155841, 7.04389535, 0.99180643, 0.99581115, 0.48593191],
-												 [	-6.04727354, -0.00262853, 0.00155744, 7.04464502, 0.99181286, 0.99581403, 0.48595395],
-												 [	-6.04801898, -0.00262662, 0.00155648, 7.04539236, 0.99181929, 0.99581690, 0.48597592],
-												 [	-6.04876210, -0.00262472, 0.00155552, 7.04613738, 0.99182570, 0.99581977, 0.48599782],
-												 [	-6.04950290, -0.00262282, 0.00155455, 7.04688009, 0.99183211, 0.99582263, 0.48601966],
-												 [	-6.05024140, -0.00262092, 0.00155359, 7.04762049, 0.99183851, 0.99582549, 0.48604144],
-												 [	-6.05097760, -0.00261902, 0.00155263, 7.04835858, 0.99184490, 0.99582835, 0.48606315],
-												 [	-6.05171151, -0.00261712, 0.00155167, 7.04909439, 0.99185128, 0.99583121, 0.48608479],
-												 [	-6.05244313, -0.00261523, 0.00155071, 7.04982791, 0.99185765, 0.99583407, 0.48610637],
-												 [	-6.05317248, -0.00261334, 0.00154975, 7.05055914, 0.99186402, 0.99583692, 0.48612789],
-												 [	-6.05389955, -0.00261145, 0.00154879, 7.05128810, 0.99187037, 0.99583977, 0.48614934],
-												 [	-6.05462435, -0.00260956, 0.00154783, 7.05201479, 0.99187672, 0.99584261, 0.48617073],
-												 [	-6.05534689, -0.00260767, 0.00154687, 7.05273922, 0.99188306, 0.99584546, 0.48619205],
-												 [	-6.05606718, -0.00260579, 0.00154591, 7.05346139, 0.99188939, 0.99584830, 0.48621331],
-												 [	-6.05678521, -0.00260391, 0.00154495, 7.05418131, 0.99189571, 0.99585114, 0.48623450],
-												 [	-6.05750101, -0.00260203, 0.00154400, 7.05489898, 0.99190203, 0.99585398, 0.48625564],
-												 [	-6.05821457, -0.00260015, 0.00154304, 7.05561442, 0.99190833, 0.99585681, 0.48627671],
-												 [	-6.05892590, -0.00259827, 0.00154209, 7.05632763, 0.99191463, 0.99585964, 0.48629772],
-												 [	-6.05963501, -0.00259640, 0.00154113, 7.05703861, 0.99192092, 0.99586247, 0.48631866],
-												 [	-6.06034190, -0.00259453, 0.00154018, 7.05774737, 0.99192720, 0.99586529, 0.48633954],
-												 [	-6.06104657, -0.00259266, 0.00153922, 7.05845392, 0.99193347, 0.99586812, 0.48636036],
-												 [	-6.06174905, -0.00259079, 0.00153827, 7.05915826, 0.99193973, 0.99587094, 0.48638112],
-												 [	-6.06244932, -0.00258893, 0.00153732, 7.05986040, 0.99194598, 0.99587376, 0.48640181],
-												 [	-6.06314740, -0.00258706, 0.00153637, 7.06056034, 0.99195223, 0.99587657, 0.48642244],
-												 [	-6.06384330, -0.00258520, 0.00153541, 7.06125810, 0.99195847, 0.99587938, 0.48644301],
-												 [	-6.06453701, -0.00258334, 0.00153446, 7.06195367, 0.99196470, 0.99588220, 0.48646352],
-												 [	-6.06522855, -0.00258148, 0.00153351, 7.06264707, 0.99197092, 0.99588500, 0.48648397],
-												 [	-6.06591793, -0.00257963, 0.00153256, 7.06333830, 0.99197713, 0.99588781, 0.48650436],
-												 [	-6.06660514, -0.00257778, 0.00153161, 7.06402736, 0.99198334, 0.99589061, 0.48652468],
-												 [	-6.06729019, -0.00257592, 0.00153067, 7.06471427, 0.99198953, 0.99589341, 0.48654494],
-												 [	-6.06797309, -0.00257408, 0.00152972, 7.06539902, 0.99199572, 0.99589621, 0.48656515],
-												 [	-6.06865385, -0.00257223, 0.00152877, 7.06608163, 0.99200190, 0.99589900, 0.48658529],
-												 [	-6.06933248, -0.00257038, 0.00152782, 7.06676209, 0.99200807, 0.99590179, 0.48660537],
-												 [	-6.07000896, -0.00256854, 0.00152688, 7.06744043, 0.99201424, 0.99590458, 0.48662539],
-												 [	-6.07068333, -0.00256670, 0.00152593, 7.06811663, 0.99202039, 0.99590737, 0.48664535],
-												 [	-6.07135557, -0.00256486, 0.00152499, 7.06879071, 0.99202654, 0.99591015, 0.48666525],
-												 [	-6.07202570, -0.00256302, 0.00152404, 7.06946268, 0.99203268, 0.99591294, 0.48668509],
-												 [	-6.07269372, -0.00256119, 0.00152310, 7.07013254, 0.99203881, 0.99591572, 0.48670487],
-												 [	-6.07335964, -0.00255935, 0.00152215, 7.07080029, 0.99204493, 0.99591849, 0.48672460],
-												 [	-6.07402346, -0.00255752, 0.00152121, 7.07146594, 0.99205104, 0.99592127, 0.48674426],
-												 [	-6.07468520, -0.00255569, 0.00152027, 7.07212950, 0.99205715, 0.99592404, 0.48676386],
-												 [	-6.07534484, -0.00255387, 0.00151933, 7.07279098, 0.99206325, 0.99592681, 0.48678341],
-												 [	-6.07600241, -0.00255204, 0.00151839, 7.07345037, 0.99206934, 0.99592957, 0.48680289],
-												 [	-6.07665791, -0.00255022, 0.00151745, 7.07410769, 0.99207542, 0.99593234, 0.48682232],
-												 [	-6.07731134, -0.00254840, 0.00151651, 7.07476294, 0.99208149, 0.99593510, 0.48684169],
-												 [	-6.07796271, -0.00254658, 0.00151557, 7.07541613, 0.99208756, 0.99593786, 0.48686100],
-												 [	-6.07861202, -0.00254476, 0.00151463, 7.07606726, 0.99209362, 0.99594061, 0.48688025],
-												 [	-6.07925928, -0.00254294, 0.00151369, 7.07671634, 0.99209967, 0.99594336, 0.48689944],
-												 [	-6.07990450, -0.00254113, 0.00151275, 7.07736337, 0.99210571, 0.99594612, 0.48691858],
-												 [	-6.08054769, -0.00253932, 0.00151182, 7.07800837, 0.99211174, 0.99594886, 0.48693766],
-												 [	-6.08118884, -0.00253751, 0.00151088, 7.07865133, 0.99211777, 0.99595161, 0.48695668],
-												 [	-6.08182796, -0.00253570, 0.00150994, 7.07929226, 0.99212379, 0.99595435, 0.48697564],
-												 [	-6.08246507, -0.00253390, 0.00150901, 7.07993117, 0.99212980, 0.99595709, 0.48699454],
-												 [	-6.08310016, -0.00253210, 0.00150807, 7.08056806, 0.99213580, 0.99595983, 0.48701339],
-												 [	-6.08373324, -0.00253029, 0.00150714, 7.08120294, 0.99214179, 0.99596257, 0.48703218],
-												 [	-6.08436431, -0.00252849, 0.00150621, 7.08183582, 0.99214778, 0.99596530, 0.48705092],
-												 [	-6.08499339, -0.00252670, 0.00150527, 7.08246669, 0.99215376, 0.99596803, 0.48706960],
-												 [	-6.08562048, -0.00252490, 0.00150434, 7.08309558, 0.99215973, 0.99597076, 0.48708821],
-												 [	-6.08624558, -0.00252311, 0.00150341, 7.08372247, 0.99216569, 0.99597348, 0.48710678],
-												 [	-6.08686870, -0.00252132, 0.00150248, 7.08434738, 0.99217164, 0.99597620, 0.48712529],
-												 [	-6.08748985, -0.00251953, 0.00150155, 7.08497032, 0.99217759, 0.99597892, 0.48714374],
-												 [	-6.08810902, -0.00251774, 0.00150062, 7.08559128, 0.99218353, 0.99598164, 0.48716214],
-												 [	-6.08872624, -0.00251595, 0.00149969, 7.08621028, 0.99218946, 0.99598436, 0.48718048],
-												 [	-6.08934149, -0.00251417, 0.00149876, 7.08682732, 0.99219538, 0.99598707, 0.48719876],
-												 [	-6.08995479, -0.00251239, 0.00149784, 7.08744241, 0.99220130, 0.99598978, 0.48721699],
-												 [	-6.09056615, -0.00251061, 0.00149691, 7.08805554, 0.99220721, 0.99599248, 0.48723517],
-												 [	-6.09117556, -0.00250883, 0.00149598, 7.08866673, 0.99221310, 0.99599519, 0.48725329],
-												 [	-6.09178304, -0.00250705, 0.00149506, 7.08927599, 0.99221900, 0.99599789, 0.48727135],
-												 [	-6.09238859, -0.00250528, 0.00149413, 7.08988331, 0.99222488, 0.99600059, 0.48728936],
-												 [	-6.09299221, -0.00250351, 0.00149320, 7.09048871, 0.99223076, 0.99600329, 0.48730732],
-												 [	-6.09359392, -0.00250174, 0.00149228, 7.09109218, 0.99223663, 0.99600598, 0.48732522],
-												 [	-6.09419371, -0.00249997, 0.00149136, 7.09169374, 0.99224249, 0.99600867, 0.48734306],
-												 [	-6.09479159, -0.00249820, 0.00149043, 7.09229339, 0.99224834, 0.99601136, 0.48736085],
-												 [	-6.09538757, -0.00249644, 0.00148951, 7.09289113, 0.99225419, 0.99601405, 0.48737859],
-												 [	-6.09598165, -0.00249468, 0.00148859, 7.09348698, 0.99226003, 0.99601673, 0.48739628],
-												 [	-6.09657385, -0.00249292, 0.00148767, 7.09408093, 0.99226586, 0.99601942, 0.48741390],
-												 [	-6.09716415, -0.00249116, 0.00148675, 7.09467299, 0.99227168, 0.99602210, 0.48743148],
-												 [	-6.09775257, -0.00248940, 0.00148583, 7.09526317, 0.99227749, 0.99602477, 0.48744900],
-												 [	-6.09833912, -0.00248765, 0.00148491, 7.09585148, 0.99228330, 0.99602745, 0.48746647],
-												 [	-6.09892380, -0.00248589, 0.00148399, 7.09643791, 0.99228910, 0.99603012, 0.48748389],
-												 [	-6.09950662, -0.00248414, 0.00148307, 7.09702248, 0.99229489, 0.99603279, 0.48750125],
-												 [	-6.10008757, -0.00248239, 0.00148215, 7.09760518, 0.99230068, 0.99603545, 0.48751856],
-												 [	-6.10066667, -0.00248065, 0.00148124, 7.09818603, 0.99230646, 0.99603812, 0.48753582],
-												 [	-6.10124393, -0.00247890, 0.00148032, 7.09876503, 0.99231223, 0.99604078, 0.48755302],
-												 [	-6.10181934, -0.00247716, 0.00147941, 7.09934218, 0.99231799, 0.99604344, 0.48757018],
-												 [	-6.10239291, -0.00247542, 0.00147849, 7.09991749, 0.99232374, 0.99604609, 0.48758728],
-												 [	-6.10296465, -0.00247368, 0.00147758, 7.10049097, 0.99232949, 0.99604875, 0.48760432],
-												 [	-6.10353456, -0.00247194, 0.00147666, 7.10106262, 0.99233523, 0.99605140, 0.48762132],
-												 [	-6.10410265, -0.00247020, 0.00147575, 7.10163245, 0.99234096, 0.99605405, 0.48763826],
-												 [	-6.10466892, -0.00246847, 0.00147484, 7.10220045, 0.99234669, 0.99605669, 0.48765516],
-												 [	-6.10523338, -0.00246674, 0.00147393, 7.10276665, 0.99235240, 0.99605934, 0.48767200],
-												 [	-6.10579604, -0.00246501, 0.00147301, 7.10333103, 0.99235811, 0.99606198, 0.48768879],
-												 [	-6.10635689, -0.00246328, 0.00147210, 7.10389362, 0.99236382, 0.99606462, 0.48770552],
-												 [	-6.10691595, -0.00246155, 0.00147119, 7.10445440, 0.99236951, 0.99606725, 0.48772221],
-												 [	-6.10747322, -0.00245983, 0.00147028, 7.10501339, 0.99237520, 0.99606989, 0.48773885],
-												 [	-6.10802871, -0.00245811, 0.00146937, 7.10557060, 0.99238088, 0.99607252, 0.48775543],
-												 [	-6.10858241, -0.00245639, 0.00146847, 7.10612603, 0.99238655, 0.99607515, 0.48777197],
-												 [	-6.10913434, -0.00245467, 0.00146756, 7.10667967, 0.99239222, 0.99607777, 0.48778845],
-												 [	-6.10968450, -0.00245295, 0.00146665, 7.10723155, 0.99239787, 0.99608040, 0.48780488],
-												 [	-6.11023289, -0.00245123, 0.00146575, 7.10778166, 0.99240353, 0.99608302, 0.48782127],
-												 [	-6.11077953, -0.00244952, 0.00146484, 7.10833001, 0.99240917, 0.99608564, 0.48783760],
-												 [	-6.11132441, -0.00244781, 0.00146393, 7.10887660, 0.99241480, 0.99608825, 0.48785388],
-												 [	-6.11186754, -0.00244610, 0.00146303, 7.10942144, 0.99242043, 0.99609087, 0.48787012],
-												 [	-6.11240893, -0.00244439, 0.00146213, 7.10996454, 0.99242605, 0.99609348, 0.48788630],
-												 [	-6.11294858, -0.00244269, 0.00146122, 7.11050589, 0.99243167, 0.99609609, 0.48790243],
-												 [	-6.11348649, -0.00244098, 0.00146032, 7.11104551, 0.99243728, 0.99609869, 0.48791852],
-												 [	-6.11402268, -0.00243928, 0.00145942, 7.11158340, 0.99244288, 0.99610130, 0.48793455],
-												 [	-6.11455714, -0.00243758, 0.00145852, 7.11211956, 0.99244847, 0.99610390, 0.48795053],
-												 [	-6.11508989, -0.00243588, 0.00145762, 7.11265400, 0.99245405, 0.99610650, 0.48796647],
-												 [	-6.11562092, -0.00243419, 0.00145672, 7.11318673, 0.99245963, 0.99610909, 0.48798236],
-												 [	-6.11615024, -0.00243249, 0.00145582, 7.11371775, 0.99246520, 0.99611169, 0.48799820],
-												 [	-6.11667786, -0.00243080, 0.00145492, 7.11424706, 0.99247077, 0.99611428, 0.48801399],
-												 [	-6.11720378, -0.00242911, 0.00145402, 7.11477467, 0.99247632, 0.99611687, 0.48802973],
-												 [	-6.11772800, -0.00242742, 0.00145312, 7.11530058, 0.99248187, 0.99611945, 0.48804543],
-												 [	-6.11825054, -0.00242574, 0.00145223, 7.11582481, 0.99248741, 0.99612204, 0.48806107],
-												 [	-6.11877140, -0.00242405, 0.00145133, 7.11634735, 0.99249295, 0.99612462, 0.48807667],
-												 [	-6.11929057, -0.00242237, 0.00145043, 7.11686820, 0.99249847, 0.99612720, 0.48809222],
-												 [	-6.11980807, -0.00242069, 0.00144954, 7.11738739, 0.99250400, 0.99612978, 0.48810772],
-												 [	-6.12032390, -0.00241901, 0.00144864, 7.11790490, 0.99250951, 0.99613235, 0.48812317],
-												 [	-6.12083807, -0.00241733, 0.00144775, 7.11842074, 0.99251501, 0.99613492, 0.48813858],
-												 [	-6.12135058, -0.00241565, 0.00144686, 7.11893493, 0.99252051, 0.99613749, 0.48815394],
-												 [	-6.12186144, -0.00241398, 0.00144597, 7.11944746, 0.99252601, 0.99614006, 0.48816925],
-												 [	-6.12237064, -0.00241231, 0.00144507, 7.11995834, 0.99253149, 0.99614262, 0.48818451],
-												 [	-6.12287820, -0.00241064, 0.00144418, 7.12046757, 0.99253697, 0.99614518, 0.48819973],
-												 [	-6.12338412, -0.00240897, 0.00144329, 7.12097516, 0.99254244, 0.99614774, 0.48821490],
-												 [	-6.12388841, -0.00240730, 0.00144240, 7.12148111, 0.99254790, 0.99615030, 0.48823002],
-												 [	-6.12439107, -0.00240563, 0.00144151, 7.12198543, 0.99255336, 0.99615285, 0.48824510],
-												 [	-6.12489210, -0.00240397, 0.00144062, 7.12248813, 0.99255881, 0.99615540, 0.48826013],
-												 [	-6.12539151, -0.00240231, 0.00143974, 7.12298920, 0.99256425, 0.99615795, 0.48827512],
-												 [	-6.12588931, -0.00240065, 0.00143885, 7.12348866, 0.99256969, 0.99616050, 0.48829005],
-												 [	-6.12638549, -0.00239899, 0.00143796, 7.12398650, 0.99257512, 0.99616304, 0.48830495],
-												 [	-6.12688007, -0.00239734, 0.00143708, 7.12448273, 0.99258054, 0.99616559, 0.48831979],
-												 [	-6.12737305, -0.00239568, 0.00143619, 7.12497736, 0.99258596, 0.99616813, 0.48833460],
-												 [	-6.12786443, -0.00239403, 0.00143531, 7.12547040, 0.99259136, 0.99617066, 0.48834935],
-												 [	-6.12835422, -0.00239238, 0.00143442, 7.12596184, 0.99259676, 0.99617320, 0.48836406],
-												 [	-6.12884242, -0.00239073, 0.00143354, 7.12645169, 0.99260216, 0.99617573, 0.48837872],
-												 [	-6.12932904, -0.00238908, 0.00143266, 7.12693996, 0.99260755, 0.99617826, 0.48839334],
-												 [	-6.12981408, -0.00238744, 0.00143177, 7.12742664, 0.99261293, 0.99618079, 0.48840792],
-												 [	-6.13029755, -0.00238580, 0.00143089, 7.12791176, 0.99261830, 0.99618331, 0.48842244],
-												 [	-6.13077945, -0.00238416, 0.00143001, 7.12839530, 0.99262367, 0.99618583, 0.48843693],
-												 [	-6.13125979, -0.00238252, 0.00142913, 7.12887728, 0.99262903, 0.99618835, 0.48845136],
-												 [	-6.13173857, -0.00238088, 0.00142825, 7.12935769, 0.99263438, 0.99619087, 0.48846576],
-												 [	-6.13221579, -0.00237924, 0.00142737, 7.12983655, 0.99263972, 0.99619339, 0.48848011],
-												 [	-6.13269147, -0.00237761, 0.00142649, 7.13031386, 0.99264506, 0.99619590, 0.48849441],
-												 [	-6.13316560, -0.00237598, 0.00142562, 7.13078962, 0.99265040, 0.99619841, 0.48850867],
-												 [	-6.13363819, -0.00237434, 0.00142474, 7.13126384, 0.99265572, 0.99620092, 0.48852289],
-												 [	-6.13410924, -0.00237272, 0.00142386, 7.13173652, 0.99266104, 0.99620342, 0.48853706],
-												 [	-6.13457876, -0.00237109, 0.00142299, 7.13220767, 0.99266635, 0.99620593, 0.48855119],
-												 [	-6.13504676, -0.00236946, 0.00142211, 7.13267729, 0.99267166, 0.99620843, 0.48856528],
-												 [	-6.13551323, -0.00236784, 0.00142124, 7.13314539, 0.99267696, 0.99621092, 0.48857932],
-												 [	-6.13597818, -0.00236622, 0.00142036, 7.13361197, 0.99268225, 0.99621342, 0.48859332],
-												 [	-6.13644163, -0.00236460, 0.00141949, 7.13407703, 0.99268753, 0.99621591, 0.48860727],
-												 [	-6.13690356, -0.00236298, 0.00141862, 7.13454058, 0.99269281, 0.99621840, 0.48862118],
-												 [	-6.13736399, -0.00236136, 0.00141774, 7.13500263, 0.99269808, 0.99622089, 0.48863505],
-												 [	-6.13782292, -0.00235975, 0.00141687, 7.13546317, 0.99270335, 0.99622338, 0.48864888],
-												 [	-6.13828035, -0.00235814, 0.00141600, 7.13592222, 0.99270861, 0.99622586, 0.48866266],
-												 [	-6.13873630, -0.00235652, 0.00141513, 7.13637977, 0.99271386, 0.99622834, 0.48867640],
-												 [	-6.13919076, -0.00235492, 0.00141426, 7.13683584, 0.99271910, 0.99623082, 0.48869010],
-												 [	-6.13964373, -0.00235331, 0.00141339, 7.13729042, 0.99272434, 0.99623330, 0.48870375],
-												 [	-6.14009523, -0.00235170, 0.00141253, 7.13774353, 0.99272957, 0.99623577, 0.48871736],
-												 [	-6.14054526, -0.00235010, 0.00141166, 7.13819516, 0.99273480, 0.99623824, 0.48873093],
-												 [	-6.14099381, -0.00234850, 0.00141079, 7.13864532, 0.99274001, 0.99624071, 0.48874446],
-												 [	-6.14144091, -0.00234689, 0.00140993, 7.13909401, 0.99274523, 0.99624318, 0.48875794],
-												 [	-6.14188654, -0.00234530, 0.00140906, 7.13954125, 0.99275043, 0.99624564, 0.48877139],
-												 [	-6.14233072, -0.00234370, 0.00140820, 7.13998702, 0.99275563, 0.99624811, 0.48878479],
-												 [	-6.14277345, -0.00234210, 0.00140733, 7.14043134, 0.99276082, 0.99625057, 0.48879815],
-												 [	-6.14321473, -0.00234051, 0.00140647, 7.14087422, 0.99276601, 0.99625302, 0.48881147],
-												 [	-6.14365457, -0.00233892, 0.00140561, 7.14131565, 0.99277118, 0.99625548, 0.48882475],
-												 [	-6.14409297, -0.00233733, 0.00140474, 7.14175564, 0.99277636, 0.99625793, 0.48883798],
-												 [	-6.14452994, -0.00233574, 0.00140388, 7.14219420, 0.99278152, 0.99626038, 0.48885118],
-												 [	-6.14496548, -0.00233415, 0.00140302, 7.14263132, 0.99278668, 0.99626283, 0.48886433],
-												 [	-6.14539959, -0.00233257, 0.00140216, 7.14306702, 0.99279183, 0.99626527, 0.48887745],
-												 [	-6.14583228, -0.00233098, 0.00140130, 7.14350130, 0.99279698, 0.99626772, 0.48889052],
-												 [	-6.14626356, -0.00232940, 0.00140044, 7.14393416, 0.99280212, 0.99627016, 0.48890355],
-												 [	-6.14669342, -0.00232782, 0.00139958, 7.14436560, 0.99280725, 0.99627259, 0.48891654],
-												 [	-6.14712188, -0.00232625, 0.00139873, 7.14479564, 0.99281238, 0.99627503, 0.48892949],
-												 [	-6.14754894, -0.00232467, 0.00139787, 7.14522427, 0.99281750, 0.99627746, 0.48894240],
-												 [	-6.14797459, -0.00232309, 0.00139701, 7.14565150, 0.99282261, 0.99627989, 0.48895527],
-												 [	-6.14839885, -0.00232152, 0.00139616, 7.14607733, 0.99282772, 0.99628232, 0.48896810],
-												 [	-6.14882172, -0.00231995, 0.00139530, 7.14650177, 0.99283282, 0.99628475, 0.48898089],
-												 [	-6.14924320, -0.00231838, 0.00139445, 7.14692482, 0.99283791, 0.99628717, 0.48899364],
-												 [	-6.14966330, -0.00231681, 0.00139359, 7.14734649, 0.99284300, 0.99628959, 0.48900634],
-												 [	-6.15008202, -0.00231525, 0.00139274, 7.14776677, 0.99284808, 0.99629201, 0.48901902],
-												 [	-6.15049937, -0.00231368, 0.00139189, 7.14818569, 0.99285316, 0.99629443, 0.48903165],
-												 [	-6.15091535, -0.00231212, 0.00139104, 7.14860323, 0.99285823, 0.99629684, 0.48904424],
-												 [	-6.15132996, -0.00231056, 0.00139018, 7.14901940, 0.99286329, 0.99629926, 0.48905679],
-												 [	-6.15174321, -0.00230900, 0.00138933, 7.14943421, 0.99286834, 0.99630166, 0.48906930],
-												 [	-6.15215510, -0.00230744, 0.00138848, 7.14984766, 0.99287339, 0.99630407, 0.48908178],
-												 [	-6.15256564, -0.00230589, 0.00138763, 7.15025975, 0.99287844, 0.99630648, 0.48909421],
-												 [	-6.15297483, -0.00230433, 0.00138679, 7.15067050, 0.99288347, 0.99630888, 0.48910661],
-												 [	-6.15338268, -0.00230278, 0.00138594, 7.15107989, 0.99288850, 0.99631128, 0.48911897],
-												 [	-6.15378918, -0.00230123, 0.00138509, 7.15148795, 0.99289353, 0.99631368, 0.48913128],
-												 [	-6.15419435, -0.00229968, 0.00138424, 7.15189467, 0.99289855, 0.99631607, 0.48914356],
-												 [	-6.15459818, -0.00229814, 0.00138340, 7.15230005, 0.99290356, 0.99631847, 0.48915581],
-												 [	-6.15500069, -0.00229659, 0.00138255, 7.15270410, 0.99290856, 0.99632086, 0.48916801],
-												 [	-6.15540187, -0.00229505, 0.00138171, 7.15310682, 0.99291356, 0.99632324, 0.48918017],
-												 [	-6.15580173, -0.00229350, 0.00138087, 7.15350822, 0.99291855, 0.99632563, 0.48919230],
-												 [	-6.15620027, -0.00229196, 0.00138002, 7.15390831, 0.99292354, 0.99632801, 0.48920439],
-												 [	-6.15659750, -0.00229042, 0.00137918, 7.15430708, 0.99292852, 0.99633040, 0.48921644],
-												 [	-6.15699342, -0.00228889, 0.00137834, 7.15470454, 0.99293349, 0.99633278, 0.48922846],
-												 [	-6.15738804, -0.00228735, 0.00137750, 7.15510069, 0.99293846, 0.99633515, 0.48924043],
-												 [	-6.15778136, -0.00228582, 0.00137666, 7.15549554, 0.99294342, 0.99633753, 0.48925237],
-												 [	-6.15817338, -0.00228429, 0.00137582, 7.15588909, 0.99294838, 0.99633990, 0.48926427],
-												 [	-6.15856410, -0.00228276, 0.00137498, 7.15628135, 0.99295333, 0.99634227, 0.48927613],
-												 [	-6.15895354, -0.00228123, 0.00137414, 7.15667231, 0.99295827, 0.99634464, 0.48928796],
-												 [	-6.15934170, -0.00227970, 0.00137330, 7.15706199, 0.99296321, 0.99634700, 0.48929975],
-												 [	-6.15972857, -0.00227818, 0.00137246, 7.15745039, 0.99296814, 0.99634936, 0.48931151],
-												 [	-6.16011416, -0.00227665, 0.00137162, 7.15783751, 0.99297306, 0.99635172, 0.48932322],
-												 [	-6.16049848, -0.00227513, 0.00137079, 7.15822335, 0.99297798, 0.99635408, 0.48933490],
-												 [	-6.16088154, -0.00227361, 0.00136995, 7.15860793, 0.99298289, 0.99635644, 0.48934654],
-												 [	-6.16126332, -0.00227209, 0.00136912, 7.15899123, 0.99298780, 0.99635879, 0.48935815],
-												 [	-6.16164385, -0.00227057, 0.00136828, 7.15937328, 0.99299270, 0.99636114, 0.48936972],
-												 [	-6.16202312, -0.00226906, 0.00136745, 7.15975406, 0.99299759, 0.99636349, 0.48938125],
-												 [	-6.16240113, -0.00226754, 0.00136662, 7.16013359, 0.99300248, 0.99636584, 0.48939275],
-												 [	-6.16277790, -0.00226603, 0.00136579, 7.16051186, 0.99300736, 0.99636818, 0.48940421],
-												 [	-6.16315341, -0.00226452, 0.00136495, 7.16088889, 0.99301224, 0.99637052, 0.48941563],
-												 [	-6.16352769, -0.00226301, 0.00136412, 7.16126468, 0.99301711, 0.99637286, 0.48942702],
-												 [	-6.16390073, -0.00226151, 0.00136329, 7.16163922, 0.99302197, 0.99637520, 0.48943837],
-												 [	-6.16427253, -0.00226000, 0.00136246, 7.16201253, 0.99302683, 0.99637753, 0.48944969],
-												 [	-6.16464310, -0.00225850, 0.00136164, 7.16238461, 0.99303168, 0.99637987, 0.48946098],
-												 [	-6.16501245, -0.00225700, 0.00136081, 7.16275545, 0.99303653, 0.99638220, 0.48947222],
-												 [	-6.16538057, -0.00225549, 0.00135998, 7.16312507, 0.99304136, 0.99638453, 0.48948343],
-												 [	-6.16574747, -0.00225400, 0.00135915, 7.16349348, 0.99304620, 0.99638685, 0.48949461],
-												 [	-6.16611316, -0.00225250, 0.00135833, 7.16386066, 0.99305103, 0.99638918, 0.48950575],
-												 [	-6.16647763, -0.00225100, 0.00135750, 7.16422663, 0.99305585, 0.99639150, 0.48951685],
-												 [	-6.16684090, -0.00224951, 0.00135668, 7.16459139, 0.99306066, 0.99639382, 0.48952792],
-												 [	-6.16720296, -0.00224802, 0.00135585, 7.16495494, 0.99306547, 0.99639613, 0.48953896],
-												 [	-6.16756382, -0.00224653, 0.00135503, 7.16531729, 0.99307027, 0.99639845, 0.48954996],
-												 [	-6.16792348, -0.00224504, 0.00135421, 7.16567845, 0.99307507, 0.99640076, 0.48956093],
-												 [	-6.16828195, -0.00224355, 0.00135338, 7.16603840, 0.99307986, 0.99640307, 0.48957186],
-												 [	-6.16863923, -0.00224206, 0.00135256, 7.16639717, 0.99308465, 0.99640538, 0.48958276],
-												 [	-6.16899533, -0.00224058, 0.00135174, 7.16675475, 0.99308943, 0.99640768, 0.48959363],
-												 [	-6.16935024, -0.00223910, 0.00135092, 7.16711114, 0.99309420, 0.99640998, 0.48960445],
-												 [	-6.16970397, -0.00223762, 0.00135010, 7.16746636, 0.99309897, 0.99641228, 0.48961525],
-												 [	-6.17005653, -0.00223614, 0.00134928, 7.16782039, 0.99310373, 0.99641458, 0.48962601],
-												 [	-6.17040791, -0.00223466, 0.00134846, 7.16817326, 0.99310849, 0.99641688, 0.48963673],
-												 [	-6.17075813, -0.00223318, 0.00134765, 7.16852495, 0.99311324, 0.99641917, 0.48964743],
-												 [	-6.17110719, -0.00223171, 0.00134683, 7.16887548, 0.99311798, 0.99642146, 0.48965809],
-												 [	-6.17145508, -0.00223024, 0.00134601, 7.16922484, 0.99312272, 0.99642375, 0.48966871],
-												 [	-6.17180182, -0.00222876, 0.00134520, 7.16957305, 0.99312745, 0.99642604, 0.48967931],
-												 [	-6.17214740, -0.00222729, 0.00134438, 7.16992010, 0.99313218, 0.99642832, 0.48968987],
-												 [	-6.17249183, -0.00222583, 0.00134357, 7.17026601, 0.99313690, 0.99643061, 0.48970039],
-												 [	-6.17283512, -0.00222436, 0.00134275, 7.17061076, 0.99314162, 0.99643289, 0.48971088],
-												 [	-6.17317726, -0.00222289, 0.00134194, 7.17095437, 0.99314633, 0.99643517, 0.48972134],
-												 [	-6.17351827, -0.00222143, 0.00134113, 7.17129683, 0.99315103, 0.99643744, 0.48973177],
-												 [	-6.17385813, -0.00221997, 0.00134032, 7.17163816, 0.99315573, 0.99643971, 0.48974217],
-												 [	-6.17419687, -0.00221851, 0.00133950, 7.17197836, 0.99316042, 0.99644199, 0.48975252],
-												 [	-6.17453448, -0.00221705, 0.00133869, 7.17231743, 0.99316511, 0.99644425, 0.48976285],
-												 [	-6.17487096, -0.00221559, 0.00133788, 7.17265537, 0.99316979, 0.99644652, 0.48977314],
-												 [	-6.17520632, -0.00221414, 0.00133708, 7.17299218, 0.99317446, 0.99644879, 0.48978341],
-												 [	-6.17554056, -0.00221269, 0.00133627, 7.17332788, 0.99317913, 0.99645105, 0.48979364],
-												 [	-6.17587369, -0.00221123, 0.00133546, 7.17366246, 0.99318379, 0.99645331, 0.48980384],
-												 [	-6.17620571, -0.00220978, 0.00133465, 7.17399593, 0.99318845, 0.99645557, 0.48981400],
-												 [	-6.17653662, -0.00220833, 0.00133385, 7.17432829, 0.99319310, 0.99645782, 0.48982414],
-												 [	-6.17686642, -0.00220689, 0.00133304, 7.17465954, 0.99319775, 0.99646007, 0.48983424],
-												 [	-6.17719513, -0.00220544, 0.00133223, 7.17498969, 0.99320239, 0.99646233, 0.48984431],
-												 [	-6.17752273, -0.00220400, 0.00133143, 7.17531874, 0.99320702, 0.99646457, 0.48985434],
-												 [	-6.17784925, -0.00220255, 0.00133063, 7.17564669, 0.99321165, 0.99646682, 0.48986435],
-												 [	-6.17817467, -0.00220111, 0.00132982, 7.17597356, 0.99321628, 0.99646906, 0.48987432],
-												 [	-6.17849900, -0.00219967, 0.00132902, 7.17629933, 0.99322089, 0.99647131, 0.48988427],
-												 [	-6.17882225, -0.00219823, 0.00132822, 7.17662402, 0.99322551, 0.99647355, 0.48989418],
-												 [	-6.17914442, -0.00219680, 0.00132742, 7.17694762, 0.99323011, 0.99647578, 0.48990406],
-												 [	-6.17946552, -0.00219536, 0.00132662, 7.17727015, 0.99323471, 0.99647802, 0.48991391],
-												 [	-6.17978554, -0.00219393, 0.00132582, 7.17759161, 0.99323931, 0.99648025, 0.48992373],
-												 [	-6.18010448, -0.00219250, 0.00132502, 7.17791199, 0.99324390, 0.99648248, 0.48993351],
-												 [	-6.18042237, -0.00219107, 0.00132422, 7.17823130, 0.99324848, 0.99648471, 0.48994327],
-												 [	-6.18073919, -0.00218964, 0.00132342, 7.17854955, 0.99325306, 0.99648694, 0.48995299],
-												 [	-6.18105494, -0.00218821, 0.00132262, 7.17886673, 0.99325763, 0.99648916, 0.48996269],
-												 [	-6.18136964, -0.00218679, 0.00132183, 7.17918286, 0.99326220, 0.99649139, 0.48997235],
-												 [	-6.18168329, -0.00218536, 0.00132103, 7.17949793, 0.99326676, 0.99649361, 0.48998198],
-												 [	-6.18199589, -0.00218394, 0.00132024, 7.17981195, 0.99327132, 0.99649582, 0.48999158],
-												 [	-6.18230744, -0.00218252, 0.00131944, 7.18012492, 0.99327587, 0.99649804, 0.49000115],
-												 [	-6.18261795, -0.00218110, 0.00131865, 7.18043684, 0.99328041, 0.99650025, 0.49001070],
-												 [	-6.18292741, -0.00217968, 0.00131785, 7.18074773, 0.99328495, 0.99650246, 0.49002020],
-												 [	-6.18323584, -0.00217827, 0.00131706, 7.18105757, 0.99328949, 0.99650467, 0.49002969],
-												 [	-6.18354323, -0.00217685, 0.00131627, 7.18136638, 0.99329401, 0.99650688, 0.49003913],
-												 [	-6.18384960, -0.00217544, 0.00131548, 7.18167416, 0.99329854, 0.99650908, 0.49004855],
-												 [	-6.18415493, -0.00217403, 0.00131469, 7.18198091, 0.99330305, 0.99651129, 0.49005794],
-												 [	-6.18445924, -0.00217262, 0.00131390, 7.18228663, 0.99330757, 0.99651349, 0.49006730],
-												 [	-6.18476253, -0.00217121, 0.00131311, 7.18259133, 0.99331207, 0.99651568, 0.49007664],
-												 [	-6.18506481, -0.00216980, 0.00131232, 7.18289501, 0.99331657, 0.99651788, 0.49008594],
-												 [	-6.18536606, -0.00216840, 0.00131153, 7.18319767, 0.99332107, 0.99652007, 0.49009521],
-												 [	-6.18566631, -0.00216699, 0.00131074, 7.18349932, 0.99332556, 0.99652226, 0.49010445],
-												 [	-6.18596555, -0.00216559, 0.00130996, 7.18379996, 0.99333004, 0.99652445, 0.49011367],
-												 [	-6.18626378, -0.00216419, 0.00130917, 7.18409959, 0.99333452, 0.99652664, 0.49012285],
-												 [	-6.18656101, -0.00216279, 0.00130839, 7.18439822, 0.99333900, 0.99652882, 0.49013200],
-												 [	-6.18685724, -0.00216139, 0.00130760, 7.18469585, 0.99334346, 0.99653101, 0.49014113],
-												 [	-6.18715248, -0.00216000, 0.00130682, 7.18499249, 0.99334793, 0.99653319, 0.49015022],
-												 [	-6.18744673, -0.00215860, 0.00130603, 7.18528812, 0.99335238, 0.99653537, 0.49015929],
-												 [	-6.18773998, -0.00215721, 0.00130525, 7.18558277, 0.99335684, 0.99653754, 0.49016833],
-												 [	-6.18803225, -0.00215582, 0.00130447, 7.18587643, 0.99336128, 0.99653972, 0.49017734],
-												 [	-6.18832353, -0.00215443, 0.00130369, 7.18616911, 0.99336572, 0.99654189, 0.49018632],
-												 [	-6.18861384, -0.00215304, 0.00130291, 7.18646080, 0.99337016, 0.99654406, 0.49019527],
-												 [	-6.18890316, -0.00215165, 0.00130213, 7.18675152, 0.99337459, 0.99654622, 0.49020420],
-												 [	-6.18919152, -0.00215026, 0.00130135, 7.18704125, 0.99337901, 0.99654839, 0.49021309],
-												 [	-6.18947890, -0.00214888, 0.00130057, 7.18733002, 0.99338343, 0.99655055, 0.49022196],
-												 [	-6.18976532, -0.00214750, 0.00129979, 7.18761782, 0.99338785, 0.99655271, 0.49023080],
-												 [	-6.19005077, -0.00214612, 0.00129901, 7.18790465, 0.99339226, 0.99655487, 0.49023961],
-												 [	-6.19033526, -0.00214474, 0.00129823, 7.18819052, 0.99339666, 0.99655703, 0.49024839],
-												 [	-6.19061879, -0.00214336, 0.00129746, 7.18847543, 0.99340106, 0.99655918, 0.49025714],
-												 [	-6.19090136, -0.00214198, 0.00129668, 7.18875938, 0.99340545, 0.99656134, 0.49026588],
-												 [	-6.19118298, -0.00214061, 0.00129591, 7.18904238, 0.99340984, 0.99656349, 0.49027457],
-												 [	-6.19146366, -0.00213923, 0.00129513, 7.18932442, 0.99341422, 0.99656563, 0.49028324],
-												 [	-6.19174338, -0.00213786, 0.00129436, 7.18960552, 0.99341860, 0.99656778, 0.49029189],
-												 [	-6.19202217, -0.00213649, 0.00129359, 7.18988568, 0.99342297, 0.99656992, 0.49030051],
-												 [	-6.19230001, -0.00213512, 0.00129281, 7.19016489, 0.99342734, 0.99657207, 0.49030909],
-												 [	-6.19257691, -0.00213375, 0.00129204, 7.19044316, 0.99343170, 0.99657421, 0.49031766],
-												 [	-6.19285288, -0.00213239, 0.00129127, 7.19072050, 0.99343606, 0.99657634, 0.49032619],
-												 [	-6.19312792, -0.00213102, 0.00129050, 7.19099690, 0.99344041, 0.99657848, 0.49033470],
-												 [	-6.19340203, -0.00212966, 0.00128973, 7.19127237, 0.99344475, 0.99658061, 0.49034317],
-												 [	-6.19367521, -0.00212830, 0.00128896, 7.19154692, 0.99344909, 0.99658274, 0.49035163],
-												 [	-6.19394748, -0.00212694, 0.00128819, 7.19182054, 0.99345343, 0.99658487, 0.49036006],
-												 [	-6.19421882, -0.00212558, 0.00128743, 7.19209324, 0.99345776, 0.99658700, 0.49036845],
-												 [	-6.19448924, -0.00212422, 0.00128666, 7.19236502, 0.99346208, 0.99658912, 0.49037683],
-												 [	-6.19475875, -0.00212286, 0.00128589, 7.19263589, 0.99346640, 0.99659124, 0.49038517],
-												 [	-6.19502735, -0.00212151, 0.00128513, 7.19290584, 0.99347072, 0.99659336, 0.49039349],
-												 [	-6.19529504, -0.00212016, 0.00128436, 7.19317489, 0.99347503, 0.99659548, 0.49040178],
-												 [	-6.19556183, -0.00211880, 0.00128360, 7.19344302, 0.99347933, 0.99659760, 0.49041005],
-												 [	-6.19582771, -0.00211745, 0.00128283, 7.19371026, 0.99348363, 0.99659971, 0.49041829],
-												 [	-6.19609270, -0.00211611, 0.00128207, 7.19397659, 0.99348792, 0.99660182, 0.49042650],
-												 [	-6.19635678, -0.00211476, 0.00128131, 7.19424203, 0.99349221, 0.99660393, 0.49043469],
-												 [	-6.19661998, -0.00211341, 0.00128054, 7.19450656, 0.99349650, 0.99660604, 0.49044285],
-												 [	-6.19688228, -0.00211207, 0.00127978, 7.19477021, 0.99350077, 0.99660815, 0.49045099],
-												 [	-6.19714369, -0.00211073, 0.00127902, 7.19503297, 0.99350505, 0.99661025, 0.49045909],
-												 [	-6.19740422, -0.00210938, 0.00127826, 7.19529484, 0.99350932, 0.99661235, 0.49046717],
-												 [	-6.19766387, -0.00210804, 0.00127750, 7.19555583, 0.99351358, 0.99661445, 0.49047523],
-												 [	-6.19792264, -0.00210671, 0.00127674, 7.19581593, 0.99351784, 0.99661655, 0.49048326],
-												 [	-6.19818053, -0.00210537, 0.00127599, 7.19607516, 0.99352209, 0.99661864, 0.49049127],
-												 [	-6.19843754, -0.00210403, 0.00127523, 7.19633351, 0.99352634, 0.99662074, 0.49049925],
-												 [	-6.19869369, -0.00210270, 0.00127447, 7.19659099, 0.99353058, 0.99662283, 0.49050720],
-												 [	-6.19894896, -0.00210137, 0.00127372, 7.19684760, 0.99353482, 0.99662492, 0.49051513],
-												 [	-6.19920337, -0.00210004, 0.00127296, 7.19710334, 0.99353905, 0.99662700, 0.49052303],
-												 [	-6.19945692, -0.00209871, 0.00127221, 7.19735822, 0.99354328, 0.99662909, 0.49053091],
-												 [	-6.19970961, -0.00209738, 0.00127145, 7.19761223, 0.99354750, 0.99663117, 0.49053876],
-												 [	-6.19996144, -0.00209605, 0.00127070, 7.19786539, 0.99355172, 0.99663325, 0.49054659],
-												 [	-6.20021242, -0.00209473, 0.00126995, 7.19811769, 0.99355593, 0.99663533, 0.49055439],
-												 [	-6.20046254, -0.00209340, 0.00126919, 7.19836914, 0.99356014, 0.99663741, 0.49056217],
-												 [	-6.20071181, -0.00209208, 0.00126844, 7.19861973, 0.99356434, 0.99663948, 0.49056992],
-												 [	-6.20096024, -0.00209076, 0.00126769, 7.19886948, 0.99356854, 0.99664155, 0.49057765],
-												 [	-6.20120782, -0.00208944, 0.00126694, 7.19911839, 0.99357273, 0.99664362, 0.49058536],
-												 [	-6.20145457, -0.00208812, 0.00126619, 7.19936645, 0.99357692, 0.99664569, 0.49059304],
-												 [	-6.20170047, -0.00208680, 0.00126544, 7.19961367, 0.99358110, 0.99664776, 0.49060069],
-												 [	-6.20194554, -0.00208549, 0.00126469, 7.19986005, 0.99358528, 0.99664982, 0.49060832],
-												 [	-6.20218978, -0.00208417, 0.00126395, 7.20010560, 0.99358945, 0.99665188, 0.49061593],
-												 [	-6.20243318, -0.00208286, 0.00126320, 7.20035032, 0.99359362, 0.99665394, 0.49062351],
-												 [	-6.20267576, -0.00208155, 0.00126245, 7.20059421, 0.99359778, 0.99665600, 0.49063106],
-												 [	-6.20291751, -0.00208024, 0.00126171, 7.20083727, 0.99360194, 0.99665805, 0.49063859],
-												 [	-6.20315844, -0.00207893, 0.00126096, 7.20107951, 0.99360609, 0.99666011, 0.49064611],
-												 [	-6.20339855, -0.00207762, 0.00126022, 7.20132093, 0.99361024, 0.99666216, 0.49065358],
-												 [	-6.20363785, -0.00207632, 0.00125947, 7.20156153, 0.99361438, 0.99666421, 0.49066104],
-												 [	-6.20387633, -0.00207501, 0.00125873, 7.20180131, 0.99361852, 0.99666626, 0.49066848],
-												 [	-6.20411399, -0.00207371, 0.00125799, 7.20204028, 0.99362265, 0.99666830, 0.49067589],
-												 [	-6.20435085, -0.00207241, 0.00125725, 7.20227844, 0.99362678, 0.99667034, 0.49068328],
-												 [	-6.20458690, -0.00207111, 0.00125650, 7.20251579, 0.99363090, 0.99667238, 0.49069064],
-												 [	-6.20482215, -0.00206981, 0.00125576, 7.20275234, 0.99363502, 0.99667442, 0.49069799],
-												 [	-6.20505660, -0.00206852, 0.00125502, 7.20298808, 0.99363914, 0.99667646, 0.49070530],
-												 [	-6.20529024, -0.00206722, 0.00125428, 7.20322302, 0.99364325, 0.99667850, 0.49071260],
-												 [	-6.20552310, -0.00206593, 0.00125355, 7.20345717, 0.99364735, 0.99668053, 0.49071987],
-												 [	-6.20575515, -0.00206463, 0.00125281, 7.20369052, 0.99365145, 0.99668256, 0.49072711],
-												 [	-6.20598642, -0.00206334, 0.00125207, 7.20392308, 0.99365554, 0.99668459, 0.49073434],
-												 [	-6.20621690, -0.00206205, 0.00125133, 7.20415485, 0.99365963, 0.99668662, 0.49074154],
-												 [	-6.20644659, -0.00206076, 0.00125060, 7.20438583, 0.99366372, 0.99668864, 0.49074872],
-												 [	-6.20667550, -0.00205947, 0.00124986, 7.20461602, 0.99366780, 0.99669066, 0.49075587],
-												 [	-6.20690362, -0.00205819, 0.00124913, 7.20484543, 0.99367187, 0.99669268, 0.49076300],
-												 [	-6.20713097, -0.00205690, 0.00124839, 7.20507407, 0.99367594, 0.99669470, 0.49077011],
-												 [	-6.20735754, -0.00205562, 0.00124766, 7.20530192, 0.99368001, 0.99669672, 0.49077720],
-												 [	-6.20758334, -0.00205434, 0.00124693, 7.20552900, 0.99368407, 0.99669873, 0.49078426],
-												 [	-6.20780837, -0.00205306, 0.00124619, 7.20575531, 0.99368812, 0.99670075, 0.49079130],
-												 [	-6.20803263, -0.00205178, 0.00124546, 7.20598085, 0.99369217, 0.99670276, 0.49079832],
-												 [	-6.20825612, -0.00205050, 0.00124473, 7.20620562, 0.99369622, 0.99670477, 0.49080531],
-												 [	-6.20847885, -0.00204923, 0.00124400, 7.20642963, 0.99370026, 0.99670677, 0.49081228],
-												 [	-6.20870082, -0.00204795, 0.00124327, 7.20665287, 0.99370430, 0.99670878, 0.49081924],
-												 [	-6.20892203, -0.00204668, 0.00124254, 7.20687536, 0.99370833, 0.99671078, 0.49082617],
-												 [	-6.20914249, -0.00204540, 0.00124181, 7.20709708, 0.99371236, 0.99671278, 0.49083307],
-												 [	-6.20936219, -0.00204413, 0.00124109, 7.20731805, 0.99371638, 0.99671478, 0.49083996],
-												 [	-6.20958114, -0.00204286, 0.00124036, 7.20753827, 0.99372040, 0.99671678, 0.49084681],
-												 [	-6.20979934, -0.00204160, 0.00123963, 7.20775774, 0.99372441, 0.99671877, 0.49085365],
-												 [	-6.21001679, -0.00204033, 0.00123891, 7.20797646, 0.99372842, 0.99672076, 0.49086047],
-												 [	-6.21023350, -0.00203906, 0.00123818, 7.20819444, 0.99373242, 0.99672275, 0.49086727],
-												 [	-6.21044947, -0.00203780, 0.00123746, 7.20841167, 0.99373642, 0.99672474, 0.49087404],
-												 [	-6.21066470, -0.00203654, 0.00123673, 7.20862816, 0.99374042, 0.99672673, 0.49088079],
-												 [	-6.21087920, -0.00203528, 0.00123601, 7.20884392, 0.99374441, 0.99672871, 0.49088752],
-												 [	-6.21109295, -0.00203402, 0.00123529, 7.20905894, 0.99374839, 0.99673070, 0.49089423],
-												 [	-6.21130598, -0.00203276, 0.00123456, 7.20927322, 0.99375237, 0.99673268, 0.49090092],
-												 [	-6.21151828, -0.00203150, 0.00123384, 7.20948678, 0.99375635, 0.99673466, 0.49090759],
-												 [	-6.21172985, -0.00203024, 0.00123312, 7.20969960, 0.99376032, 0.99673663, 0.49091423],
-												 [	-6.21194069, -0.00202899, 0.00123240, 7.20991170, 0.99376428, 0.99673861, 0.49092085],
-												 [	-6.21215082, -0.00202774, 0.00123168, 7.21012308, 0.99376825, 0.99674058, 0.49092745],
-												 [	-6.21236022, -0.00202648, 0.00123096, 7.21033373, 0.99377220, 0.99674255, 0.49093403],
-												 [	-6.21256890, -0.00202523, 0.00123025, 7.21054367, 0.99377616, 0.99674452, 0.49094059],
-												 [	-6.21277687, -0.00202398, 0.00122953, 7.21075289, 0.99378010, 0.99674649, 0.49094712],
-												 [	-6.21298413, -0.00202274, 0.00122881, 7.21096139, 0.99378405, 0.99674845, 0.49095364],
-												 [	-6.21319067, -0.00202149, 0.00122809, 7.21116918, 0.99378798, 0.99675042, 0.49096013],
-												 [	-6.21339651, -0.00202025, 0.00122738, 7.21137627, 0.99379192, 0.99675238, 0.49096661],
-												 [	-6.21360164, -0.00201900, 0.00122666, 7.21158264, 0.99379585, 0.99675434, 0.49097306],
-												 [	-6.21380607, -0.00201776, 0.00122595, 7.21178831, 0.99379977, 0.99675629, 0.49097950],
-												 [	-6.21400979, -0.00201652, 0.00122523, 7.21199328, 0.99380369, 0.99675825, 0.49098591],
-												 [	-6.21421282, -0.00201528, 0.00122452, 7.21219754, 0.99380761, 0.99676020, 0.49099230],
-												 [	-6.21441515, -0.00201404, 0.00122381, 7.21240111, 0.99381152, 0.99676215, 0.49099867],
-												 [	-6.21461678, -0.00201280, 0.00122310, 7.21260398, 0.99381543, 0.99676410, 0.49100502],
-												 [	-6.21481773, -0.00201157, 0.00122239, 7.21280616, 0.99381933, 0.99676605, 0.49101135],
-												 [	-6.21501798, -0.00201033, 0.00122167, 7.21300765, 0.99382323, 0.99676799, 0.49101767],
-												 [	-6.21521754, -0.00200910, 0.00122096, 7.21320844, 0.99382712, 0.99676994, 0.49102395],
-												 [	-6.21541642, -0.00200787, 0.00122026, 7.21340855, 0.99383101, 0.99677188, 0.49103022],
-												 [	-6.21561461, -0.00200664, 0.00121955, 7.21360798, 0.99383489, 0.99677382, 0.49103647],
-												 [	-6.21581213, -0.00200541, 0.00121884, 7.21380672, 0.99383877, 0.99677575, 0.49104269],
-												 [	-6.21600896, -0.00200418, 0.00121813, 7.21400478, 0.99384265, 0.99677769, 0.49104891],
-												 [	-6.21620512, -0.00200295, 0.00121742, 7.21420217, 0.99384652, 0.99677962, 0.49105509],
-												 [	-6.21640060, -0.00200173, 0.00121672, 7.21439887, 0.99385038, 0.99678156, 0.49106126],
-												 [	-6.21659541, -0.00200050, 0.00121601, 7.21459491, 0.99385424, 0.99678349, 0.49106741],
-												 [	-6.21678955, -0.00199928, 0.00121531, 7.21479027, 0.99385810, 0.99678541, 0.49107353],
-												 [	-6.21698302, -0.00199806, 0.00121460, 7.21498497, 0.99386195, 0.99678734, 0.49107964],
-												 [	-6.21717583, -0.00199684, 0.00121390, 7.21517899, 0.99386580, 0.99678926, 0.49108574],
-												 [	-6.21736797, -0.00199562, 0.00121320, 7.21537235, 0.99386965, 0.99679119, 0.49109180],
-												 [	-6.21755945, -0.00199440, 0.00121249, 7.21556505, 0.99387349, 0.99679311, 0.49109786],
-												 [	-6.21775028, -0.00199319, 0.00121179, 7.21575709, 0.99387732, 0.99679502, 0.49110388],
-												 [	-6.21794044, -0.00199197, 0.00121109, 7.21594847, 0.99388115, 0.99679694, 0.49110989],
-												 [	-6.21812995, -0.00199076, 0.00121039, 7.21613919, 0.99388498, 0.99679885, 0.49111588],
-												 [	-6.21831881, -0.00198955, 0.00120969, 7.21632926, 0.99388880, 0.99680077, 0.49112186],
-												 [	-6.21850702, -0.00198833, 0.00120899, 7.21651868, 0.99389261, 0.99680268, 0.49112781],
-												 [	-6.21869457, -0.00198712, 0.00120829, 7.21670745, 0.99389643, 0.99680459, 0.49113374],
-												 [	-6.21888149, -0.00198592, 0.00120759, 7.21689557, 0.99390024, 0.99680649, 0.49113965],
-												 [	-6.21906775, -0.00198471, 0.00120689, 7.21708304, 0.99390404, 0.99680840, 0.49114555],
-												 [	-6.21925338, -0.00198350, 0.00120620, 7.21726987, 0.99390784, 0.99681030, 0.49115142],
-												 [	-6.21943836, -0.00198230, 0.00120550, 7.21745606, 0.99391163, 0.99681220, 0.49115728],
-												 [	-6.21962271, -0.00198110, 0.00120481, 7.21764161, 0.99391542, 0.99681410, 0.49116312],
-												 [	-6.21980642, -0.00197989, 0.00120411, 7.21782653, 0.99391921, 0.99681600, 0.49116895],
-												 [	-6.21998950, -0.00197869, 0.00120342, 7.21801081, 0.99392299, 0.99681789, 0.49117474],
-												 [	-6.22017194, -0.00197749, 0.00120272, 7.21819445, 0.99392677, 0.99681979, 0.49118052],
-												 [	-6.22035376, -0.00197630, 0.00120203, 7.21837746, 0.99393054, 0.99682168, 0.49118629],
-												 [	-6.22053495, -0.00197510, 0.00120134, 7.21855985, 0.99393431, 0.99682357, 0.49119203],
-												 [	-6.22071551, -0.00197390, 0.00120064, 7.21874161, 0.99393808, 0.99682545, 0.49119776],
-												 [	-6.22089545, -0.00197271, 0.00119995, 7.21892274, 0.99394184, 0.99682734, 0.49120347],
-												 [	-6.22107477, -0.00197152, 0.00119926, 7.21910325, 0.99394559, 0.99682922, 0.49120916],
-												 [	-6.22125347, -0.00197032, 0.00119857, 7.21928314, 0.99394935, 0.99683111, 0.49121482],
-												 [	-6.22143155, -0.00196913, 0.00119788, 7.21946242, 0.99395309, 0.99683299, 0.49122047],
-												 [	-6.22160902, -0.00196794, 0.00119719, 7.21964107, 0.99395684, 0.99683486, 0.49122611],
-												 [	-6.22178587, -0.00196676, 0.00119650, 7.21981911, 0.99396058, 0.99683674, 0.49123173],
-												 [	-6.22196211, -0.00196557, 0.00119582, 7.21999654, 0.99396431, 0.99683861, 0.49123732],
-												 [	-6.22213774, -0.00196438, 0.00119513, 7.22017336, 0.99396804, 0.99684049, 0.49124290],
-												 [	-6.22231277, -0.00196320, 0.00119444, 7.22034957, 0.99397177, 0.99684236, 0.49124846],
-												 [	-6.22248719, -0.00196202, 0.00119376, 7.22052517, 0.99397549, 0.99684423, 0.49125400],
-												 [	-6.22266101, -0.00196083, 0.00119307, 7.22070017, 0.99397920, 0.99684609, 0.49125953],
-												 [	-6.22283422, -0.00195965, 0.00119239, 7.22087457, 0.99398292, 0.99684796, 0.49126504],
-												 [	-6.22300684, -0.00195848, 0.00119170, 7.22104836, 0.99398663, 0.99684982, 0.49127053],
-												 [	-6.22317886, -0.00195730, 0.00119102, 7.22122156, 0.99399033, 0.99685168, 0.49127600],
-												 [	-6.22335028, -0.00195612, 0.00119034, 7.22139416, 0.99399403, 0.99685354, 0.49128145],
-												 [	-6.22352111, -0.00195495, 0.00118965, 7.22156617, 0.99399773, 0.99685540, 0.49128689],
-												 [	-6.22369135, -0.00195377, 0.00118897, 7.22173758, 0.99400142, 0.99685726, 0.49129231],
-												 [	-6.22386100, -0.00195260, 0.00118829, 7.22190841, 0.99400511, 0.99685911, 0.49129771],
-												 [	-6.22403007, -0.00195143, 0.00118761, 7.22207864, 0.99400879, 0.99686096, 0.49130310],
-												 [	-6.22419854, -0.00195026, 0.00118693, 7.22224829, 0.99401247, 0.99686281, 0.49130846],
-												 [	-6.22436644, -0.00194909, 0.00118625, 7.22241735, 0.99401615, 0.99686466, 0.49131381],
-												 [	-6.22453375, -0.00194792, 0.00118557, 7.22258583, 0.99401982, 0.99686651, 0.49131914],
-												 [	-6.22470048, -0.00194675, 0.00118490, 7.22275373, 0.99402348, 0.99686835, 0.49132446],
-												 [	-6.22486664, -0.00194559, 0.00118422, 7.22292105, 0.99402715, 0.99687019, 0.49132975],
-												 [	-6.22503222, -0.00194442, 0.00118354, 7.22308780, 0.99403081, 0.99687204, 0.49133503],
-												 [	-6.22519722, -0.00194326, 0.00118287, 7.22325396, 0.99403446, 0.99687387, 0.49134030],
-												 [	-6.22536166, -0.00194210, 0.00118219, 7.22341956, 0.99403811, 0.99687571, 0.49134554],
-												 [	-6.22552552, -0.00194094, 0.00118152, 7.22358458, 0.99404176, 0.99687755, 0.49135077],
-												 [	-6.22568881, -0.00193978, 0.00118084, 7.22374904, 0.99404540, 0.99687938, 0.49135598],
-												 [	-6.22585154, -0.00193862, 0.00118017, 7.22391292, 0.99404904, 0.99688121, 0.49136117],
-												 [	-6.22601370, -0.00193746, 0.00117950, 7.22407624, 0.99405267, 0.99688304, 0.49136635],
-												 [	-6.22617531, -0.00193631, 0.00117882, 7.22423900, 0.99405630, 0.99688487, 0.49137152],
-												 [	-6.22633635, -0.00193515, 0.00117815, 7.22440119, 0.99405992, 0.99688670, 0.49137666],
-												 [	-6.22649683, -0.00193400, 0.00117748, 7.22456283, 0.99406354, 0.99688852, 0.49138179],
-												 [	-6.22665675, -0.00193285, 0.00117681, 7.22472390, 0.99406716, 0.99689034, 0.49138690],
-												 [	-6.22681612, -0.00193170, 0.00117614, 7.22488442, 0.99407077, 0.99689216, 0.49139199],
-												 [	-6.22697494, -0.00193055, 0.00117547, 7.22504439, 0.99407438, 0.99689398, 0.49139707],
-												 [	-6.22713320, -0.00192940, 0.00117480, 7.22520380, 0.99407799, 0.99689580, 0.49140214],
-												 [	-6.22729092, -0.00192825, 0.00117413, 7.22536266, 0.99408159, 0.99689762, 0.49140718],
-												 [	-6.22744808, -0.00192711, 0.00117346, 7.22552098, 0.99408519, 0.99689943, 0.49141221],
-												 [	-6.22760470, -0.00192596, 0.00117280, 7.22567874, 0.99408878, 0.99690124, 0.49141723],
-												 [	-6.22776078, -0.00192482, 0.00117213, 7.22583596, 0.99409237, 0.99690305, 0.49142222],
-												 [	-6.22791631, -0.00192368, 0.00117147, 7.22599264, 0.99409595, 0.99690486, 0.49142719],
-												 [	-6.22807131, -0.00192253, 0.00117080, 7.22614877, 0.99409953, 0.99690667, 0.49143216],
-												 [	-6.22822576, -0.00192139, 0.00117014, 7.22630437, 0.99410311, 0.99690847, 0.49143711],
-												 [	-6.22837968, -0.00192026, 0.00116947, 7.22645942, 0.99410668, 0.99691027, 0.49144204],
-												 [	-6.22853306, -0.00191912, 0.00116881, 7.22661394, 0.99411025, 0.99691207, 0.49144696],
-												 [	-6.22868591, -0.00191798, 0.00116815, 7.22676793, 0.99411381, 0.99691387, 0.49145186],
-												 [	-6.22883823, -0.00191685, 0.00116748, 7.22692138, 0.99411737, 0.99691567, 0.49145674],
-												 [	-6.22899002, -0.00191571, 0.00116682, 7.22707430, 0.99412093, 0.99691747, 0.49146161],
-												 [	-6.22914128, -0.00191458, 0.00116616, 7.22722670, 0.99412448, 0.99691926, 0.49146647],
-												 [	-6.22929201, -0.00191345, 0.00116550, 7.22737856, 0.99412803, 0.99692105, 0.49147130],
-												 [	-6.22944222, -0.00191232, 0.00116484, 7.22752990, 0.99413157, 0.99692284, 0.49147613],
-												 [	-6.22959190, -0.00191119, 0.00116418, 7.22768071, 0.99413511, 0.99692463, 0.49148093],
-												 [	-6.22974107, -0.00191006, 0.00116352, 7.22783101, 0.99413865, 0.99692642, 0.49148571],
-												 [	-6.22988971, -0.00190893, 0.00116286, 7.22798078, 0.99414218, 0.99692820, 0.49149049],
-												 [	-6.23003784, -0.00190781, 0.00116221, 7.22813003, 0.99414571, 0.99692998, 0.49149525],
-												 [	-6.23018545, -0.00190669, 0.00116155, 7.22827877, 0.99414924, 0.99693176, 0.49149999],
-												 [	-6.23033255, -0.00190556, 0.00116089, 7.22842699, 0.99415276, 0.99693354, 0.49150472],
-												 [	-6.23047913, -0.00190444, 0.00116024, 7.22857469, 0.99415627, 0.99693532, 0.49150944],
-												 [	-6.23062521, -0.00190332, 0.00115958, 7.22872189, 0.99415978, 0.99693710, 0.49151413],
-												 [	-6.23077077, -0.00190220, 0.00115893, 7.22886857, 0.99416329, 0.99693887, 0.49151881],
-												 [	-6.23091583, -0.00190108, 0.00115828, 7.22901475, 0.99416680, 0.99694064, 0.49152348],
-												 [	-6.23106038, -0.00189996, 0.00115762, 7.22916042, 0.99417030, 0.99694241, 0.49152813],
-												 [	-6.23120443, -0.00189885, 0.00115697, 7.22930558, 0.99417379, 0.99694418, 0.49153277],
-												 [	-6.23134798, -0.00189773, 0.00115632, 7.22945024, 0.99417729, 0.99694595, 0.49153739],
-												 [	-6.23149102, -0.00189662, 0.00115567, 7.22959440, 0.99418078, 0.99694772, 0.49154200],
-												 [	-6.23163357, -0.00189551, 0.00115501, 7.22973806, 0.99418426, 0.99694948, 0.49154659],
-												 [	-6.23177562, -0.00189439, 0.00115436, 7.22988122, 0.99418774, 0.99695124, 0.49155116],
-												 [	-6.23191717, -0.00189328, 0.00115371, 7.23002389, 0.99419122, 0.99695300, 0.49155572],
-												 [	-6.23205823, -0.00189218, 0.00115307, 7.23016606, 0.99419469, 0.99695476, 0.49156028],
-												 [	-6.23219880, -0.00189107, 0.00115242, 7.23030773, 0.99419816, 0.99695652, 0.49156481],
-												 [	-6.23233888, -0.00188996, 0.00115177, 7.23044891, 0.99420163, 0.99695827, 0.49156932],
-												 [	-6.23247846, -0.00188886, 0.00115112, 7.23058961, 0.99420509, 0.99696002, 0.49157383],
-												 [	-6.23261756, -0.00188775, 0.00115047, 7.23072981, 0.99420855, 0.99696177, 0.49157832],
-												 [	-6.23275618, -0.00188665, 0.00114983, 7.23086953, 0.99421200, 0.99696352, 0.49158279],
-												 [	-6.23289431, -0.00188555, 0.00114918, 7.23100876, 0.99421545, 0.99696527, 0.49158725],
-												 [	-6.23303196, -0.00188444, 0.00114854, 7.23114751, 0.99421890, 0.99696702, 0.49159170],
-												 [	-6.23316912, -0.00188334, 0.00114789, 7.23128578, 0.99422234, 0.99696876, 0.49159612],
-												 [	-6.23330581, -0.00188225, 0.00114725, 7.23142357, 0.99422578, 0.99697050, 0.49160053],
-												 [	-6.23344202, -0.00188115, 0.00114661, 7.23156087, 0.99422921, 0.99697225, 0.49160494],
-												 [	-6.23357776, -0.00188005, 0.00114596, 7.23169771, 0.99423264, 0.99697398, 0.49160932],
-												 [	-6.23371302, -0.00187896, 0.00114532, 7.23183406, 0.99423607, 0.99697572, 0.49161370],
-												 [	-6.23384781, -0.00187786, 0.00114468, 7.23196994, 0.99423949, 0.99697746, 0.49161806],
-												 [	-6.23398212, -0.00187677, 0.00114404, 7.23210535, 0.99424291, 0.99697919, 0.49162241],
-												 [	-6.23411597, -0.00187568, 0.00114340, 7.23224029, 0.99424633, 0.99698092, 0.49162674],
-												 [	-6.23424935, -0.00187459, 0.00114276, 7.23237476, 0.99424974, 0.99698265, 0.49163105],
-												 [	-6.23438226, -0.00187350, 0.00114212, 7.23250876, 0.99425315, 0.99698438, 0.49163535],
-												 [	-6.23451471, -0.00187241, 0.00114148, 7.23264230, 0.99425655, 0.99698611, 0.49163964],
-												 [	-6.23464669, -0.00187132, 0.00114084, 7.23277537, 0.99425995, 0.99698783, 0.49164392],
-												 [	-6.23477821, -0.00187024, 0.00114021, 7.23290797, 0.99426335, 0.99698956, 0.49164818],
-												 [	-6.23490927, -0.00186915, 0.00113957, 7.23304012, 0.99426674, 0.99699128, 0.49165242],
-												 [	-6.23503988, -0.00186807, 0.00113893, 7.23317181, 0.99427013, 0.99699300, 0.49165666],
-												 [	-6.23517002, -0.00186698, 0.00113830, 7.23330304, 0.99427352, 0.99699472, 0.49166087],
-												 [	-6.23529971, -0.00186590, 0.00113766, 7.23343381, 0.99427690, 0.99699644, 0.49166508],
-												 [	-6.23542895, -0.00186482, 0.00113703, 7.23356413, 0.99428028, 0.99699815, 0.49166927],
-												 [	-6.23555773, -0.00186374, 0.00113639, 7.23369399, 0.99428365, 0.99699986, 0.49167345],
-												 [	-6.23568606, -0.00186267, 0.00113576, 7.23382340, 0.99428702, 0.99700157, 0.49167762],
-												 [	-6.23581395, -0.00186159, 0.00113513, 7.23395236, 0.99429039, 0.99700328, 0.49168176],
-												 [	-6.23594138, -0.00186051, 0.00113449, 7.23408087, 0.99429375, 0.99700499, 0.49168591],
-												 [	-6.23606837, -0.00185944, 0.00113386, 7.23420893, 0.99429711, 0.99700670, 0.49169003],
-												 [	-6.23619491, -0.00185836, 0.00113323, 7.23433655, 0.99430047, 0.99700840, 0.49169415],
-												 [	-6.23632102, -0.00185729, 0.00113260, 7.23446372, 0.99430382, 0.99701011, 0.49169823],
-												 [	-6.23644667, -0.00185622, 0.00113197, 7.23459045, 0.99430717, 0.99701181, 0.49170232],
-												 [	-6.23657189, -0.00185515, 0.00113134, 7.23471674, 0.99431051, 0.99701351, 0.49170640],
-												 [	-6.23669667, -0.00185408, 0.00113071, 7.23484259, 0.99431385, 0.99701521, 0.49171044],
-												 [	-6.23682101, -0.00185301, 0.00113009, 7.23496800, 0.99431719, 0.99701690, 0.49171449],
-												 [	-6.23694492, -0.00185195, 0.00112946, 7.23509297, 0.99432052, 0.99701860, 0.49171853],
-												 [	-6.23706839, -0.00185088, 0.00112883, 7.23521751, 0.99432385, 0.99702029, 0.49172254],
-												 [	-6.23719143, -0.00184981, 0.00112820, 7.23534161, 0.99432718, 0.99702198, 0.49172655],
-												 [	-6.23731403, -0.00184875, 0.00112758, 7.23546528, 0.99433050, 0.99702367, 0.49173054],
-												 [	-6.23743621, -0.00184769, 0.00112695, 7.23558852, 0.99433382, 0.99702536, 0.49173452],
-												 [	-6.23755795, -0.00184663, 0.00112633, 7.23571133, 0.99433713, 0.99702705, 0.49173848],
-												 [	-6.23767927, -0.00184557, 0.00112570, 7.23583371, 0.99434044, 0.99702873, 0.49174243],
-												 [	-6.23780017, -0.00184451, 0.00112508, 7.23595566, 0.99434375, 0.99703041, 0.49174639],
-												 [	-6.23792064, -0.00184345, 0.00112446, 7.23607719, 0.99434706, 0.99703209, 0.49175031],
-												 [	-6.23804068, -0.00184239, 0.00112383, 7.23619829, 0.99435036, 0.99703377, 0.49175422],
-												 [	-6.23816031, -0.00184134, 0.00112321, 7.23631897, 0.99435365, 0.99703545, 0.49175813],
-												 [	-6.23827952, -0.00184028, 0.00112259, 7.23643923, 0.99435695, 0.99703713, 0.49176201],
-												 [	-6.23839830, -0.00183923, 0.00112197, 7.23655907, 0.99436024, 0.99703880, 0.49176589],
-												 [	-6.23851667, -0.00183817, 0.00112135, 7.23667850, 0.99436352, 0.99704048, 0.49176975],
-												 [	-6.23863462, -0.00183712, 0.00112073, 7.23679750, 0.99436680, 0.99704215, 0.49177361],
-												 [	-6.23875216, -0.00183607, 0.00112011, 7.23691609, 0.99437008, 0.99704382, 0.49177744],
-												 [	-6.23886929, -0.00183502, 0.00111949, 7.23703427, 0.99437336, 0.99704548, 0.49178127],
-												 [	-6.23898600, -0.00183398, 0.00111887, 7.23715203, 0.99437663, 0.99704715, 0.49178508],
-												 [	-6.23910231, -0.00183293, 0.00111826, 7.23726938, 0.99437990, 0.99704881, 0.49178889],
-												 [	-6.23921820, -0.00183188, 0.00111764, 7.23738632, 0.99438316, 0.99705048, 0.49179268],
-												 [	-6.23933369, -0.00183084, 0.00111702, 7.23750286, 0.99438642, 0.99705214, 0.49179645],
-												 [	-6.23944877, -0.00182979, 0.00111641, 7.23761898, 0.99438968, 0.99705380, 0.49180022],
-												 [	-6.23956345, -0.00182875, 0.00111579, 7.23773470, 0.99439293, 0.99705546, 0.49180397],
-												 [	-6.23967773, -0.00182771, 0.00111518, 7.23785002, 0.99439618, 0.99705711, 0.49180771],
-												 [	-6.23979160, -0.00182667, 0.00111456, 7.23796493, 0.99439943, 0.99705877, 0.49181144],
-												 [	-6.23990507, -0.00182563, 0.00111395, 7.23807944, 0.99440267, 0.99706042, 0.49181516],
-												 [	-6.24001814, -0.00182459, 0.00111334, 7.23819355, 0.99440591, 0.99706207, 0.49181886],
-												 [	-6.24013082, -0.00182355, 0.00111273, 7.23830726, 0.99440915, 0.99706372, 0.49182255],
-												 [	-6.24024309, -0.00182251, 0.00111211, 7.23842058, 0.99441238, 0.99706537, 0.49182623],
-												 [	-6.24035498, -0.00182148, 0.00111150, 7.23853350, 0.99441561, 0.99706702, 0.49182990],
-												 [	-6.24046647, -0.00182045, 0.00111089, 7.23864602, 0.99441884, 0.99706866, 0.49183355],
-												 [	-6.24057756, -0.00181941, 0.00111028, 7.23875815, 0.99442206, 0.99707031, 0.49183719],
-												 [	-6.24068827, -0.00181838, 0.00110967, 7.23886989, 0.99442528, 0.99707195, 0.49184083],
-												 [	-6.24079858, -0.00181735, 0.00110906, 7.23898123, 0.99442849, 0.99707359, 0.49184446],
-												 [	-6.24090851, -0.00181632, 0.00110846, 7.23909219, 0.99443170, 0.99707523, 0.49184806],
-												 [	-6.24101805, -0.00181529, 0.00110785, 7.23920276, 0.99443491, 0.99707686, 0.49185165],
-												 [	-6.24112720, -0.00181426, 0.00110724, 7.23931294, 0.99443812, 0.99707850, 0.49185524],
-												 [	-6.24123597, -0.00181324, 0.00110663, 7.23942274, 0.99444132, 0.99708013, 0.49185881],
-												 [	-6.24134436, -0.00181221, 0.00110603, 7.23953215, 0.99444451, 0.99708176, 0.49186237],
-												 [	-6.24145237, -0.00181118, 0.00110542, 7.23964118, 0.99444771, 0.99708339, 0.49186593],
-												 [	-6.24155999, -0.00181016, 0.00110482, 7.23974983, 0.99445090, 0.99708502, 0.49186947],
-												 [	-6.24166723, -0.00180914, 0.00110421, 7.23985810, 0.99445408, 0.99708665, 0.49187299],
-												 [	-6.24177410, -0.00180812, 0.00110361, 7.23996598, 0.99445727, 0.99708828, 0.49187651],
-												 [	-6.24188059, -0.00180710, 0.00110300, 7.24007349, 0.99446045, 0.99708990, 0.49188001],
-												 [	-6.24198671, -0.00180608, 0.00110240, 7.24018063, 0.99446363, 0.99709152, 0.49188351],
-												 [	-6.24209245, -0.00180506, 0.00110180, 7.24028739, 0.99446680, 0.99709314, 0.49188699],
-												 [	-6.24219781, -0.00180404, 0.00110120, 7.24039377, 0.99446997, 0.99709476, 0.49189046],
-												 [	-6.24230281, -0.00180302, 0.00110060, 7.24049978, 0.99447313, 0.99709638, 0.49189392],
-												 [	-6.24240743, -0.00180201, 0.00110000, 7.24060543, 0.99447630, 0.99709800, 0.49189737],
-												 [	-6.24251169, -0.00180100, 0.00109940, 7.24071070, 0.99447946, 0.99709961, 0.49190081],
-												 [	-6.24261558, -0.00179998, 0.00109880, 7.24081560, 0.99448261, 0.99710122, 0.49190424],
-												 [	-6.24271910, -0.00179897, 0.00109820, 7.24092013, 0.99448577, 0.99710283, 0.49190765],
-												 [	-6.24282226, -0.00179796, 0.00109760, 7.24102430, 0.99448891, 0.99710444, 0.49191105],
-												 [	-6.24292505, -0.00179695, 0.00109700, 7.24112810, 0.99449206, 0.99710605, 0.49191444],
-												 [	-6.24302748, -0.00179594, 0.00109640, 7.24123154, 0.99449520, 0.99710766, 0.49191782],
-												 [	-6.24312955, -0.00179493, 0.00109581, 7.24133462, 0.99449834, 0.99710926, 0.49192119],
-												 [	-6.24323126, -0.00179392, 0.00109521, 7.24143733, 0.99450148, 0.99711087, 0.49192455],
-												 [	-6.24333261, -0.00179292, 0.00109461, 7.24153969, 0.99450461, 0.99711247, 0.49192789],
-												 [	-6.24343360, -0.00179191, 0.00109402, 7.24164168, 0.99450774, 0.99711407, 0.49193123],
-												 [	-6.24353423, -0.00179091, 0.00109342, 7.24174332, 0.99451086, 0.99711567, 0.49193456],
-												 [	-6.24363451, -0.00178991, 0.00109283, 7.24184460, 0.99451399, 0.99711726, 0.49193787],
-												 [	-6.24373444, -0.00178891, 0.00109224, 7.24194553, 0.99451711, 0.99711886, 0.49194119],
-												 [	-6.24383401, -0.00178790, 0.00109164, 7.24204610, 0.99452022, 0.99712045, 0.49194448],
-												 [	-6.24393323, -0.00178690, 0.00109105, 7.24214632, 0.99452333, 0.99712204, 0.49194776],
-												 [	-6.24403210, -0.00178591, 0.00109046, 7.24224619, 0.99452644, 0.99712364, 0.49195103],
-												 [	-6.24413062, -0.00178491, 0.00108987, 7.24234571, 0.99452955, 0.99712522, 0.49195429],
-												 [	-6.24422879, -0.00178391, 0.00108928, 7.24244488, 0.99453265, 0.99712681, 0.49195755],
-												 [	-6.24432661, -0.00178292, 0.00108869, 7.24254370, 0.99453575, 0.99712840, 0.49196079],
-												 [	-6.24442409, -0.00178192, 0.00108810, 7.24264217, 0.99453884, 0.99712998, 0.49196402],
-												 [	-6.24452123, -0.00178093, 0.00108751, 7.24274030, 0.99454194, 0.99713157, 0.49196723],
-												 [	-6.24461802, -0.00177993, 0.00108692, 7.24283808, 0.99454502, 0.99713315, 0.49197045],
-												 [	-6.24471446, -0.00177894, 0.00108633, 7.24293552, 0.99454811, 0.99713473, 0.49197365],
-												 [	-6.24481057, -0.00177795, 0.00108574, 7.24303262, 0.99455119, 0.99713630, 0.49197684],
-												 [	-6.24490634, -0.00177696, 0.00108516, 7.24312938, 0.99455427, 0.99713788, 0.49198002],
-												 [	-6.24500177, -0.00177597, 0.00108457, 7.24322579, 0.99455735, 0.99713946, 0.49198318],
-												 [	-6.24509686, -0.00177499, 0.00108398, 7.24332187, 0.99456042, 0.99714103, 0.49198634],
-												 [	-6.24519161, -0.00177400, 0.00108340, 7.24341761, 0.99456349, 0.99714260, 0.49198949],
-												 [	-6.24528603, -0.00177301, 0.00108281, 7.24351302, 0.99456655, 0.99714417, 0.49199263],
-												 [	-6.24538012, -0.00177203, 0.00108223, 7.24360809, 0.99456961, 0.99714574, 0.49199575],
-												 [	-6.24547387, -0.00177105, 0.00108164, 7.24370283, 0.99457267, 0.99714731, 0.49199887],
-												 [	-6.24556729, -0.00177006, 0.00108106, 7.24379723, 0.99457573, 0.99714887, 0.49200198],
-												 [	-6.24566038, -0.00176908, 0.00108048, 7.24389130, 0.99457878, 0.99715044, 0.49200507],
-												 [	-6.24575314, -0.00176810, 0.00107990, 7.24398504, 0.99458183, 0.99715200, 0.49200817],
-												 [	-6.24584557, -0.00176712, 0.00107931, 7.24407845, 0.99458488, 0.99715356, 0.49201123],
-												 [	-6.24593768, -0.00176614, 0.00107873, 7.24417153, 0.99458792, 0.99715512, 0.49201431],
-												 [	-6.24602946, -0.00176517, 0.00107815, 7.24426429, 0.99459096, 0.99715668, 0.49201737],
-												 [	-6.24612091, -0.00176419, 0.00107757, 7.24435672, 0.99459400, 0.99715824, 0.49202041],
-												 [	-6.24621204, -0.00176321, 0.00107699, 7.24444883, 0.99459703, 0.99715979, 0.49202344],
-												 [	-6.24630285, -0.00176224, 0.00107641, 7.24454061, 0.99460006, 0.99716135, 0.49202647],
-												 [	-6.24639333, -0.00176127, 0.00107584, 7.24463206, 0.99460309, 0.99716290, 0.49202949],
-												 [	-6.24648350, -0.00176029, 0.00107526, 7.24472320, 0.99460611, 0.99716445, 0.49203250],
-												 [	-6.24657334, -0.00175932, 0.00107468, 7.24481402, 0.99460913, 0.99716600, 0.49203550],
-												 [	-6.24666287, -0.00175835, 0.00107410, 7.24490451, 0.99461215, 0.99716755, 0.49203848],
-												 [	-6.24675208, -0.00175738, 0.00107353, 7.24499469, 0.99461516, 0.99716909, 0.49204146],
-												 [	-6.24684097, -0.00175641, 0.00107295, 7.24508455, 0.99461817, 0.99717064, 0.49204443],
-												 [	-6.24692955, -0.00175545, 0.00107238, 7.24517410, 0.99462118, 0.99717218, 0.49204739],
-												 [	-6.24701781, -0.00175448, 0.00107180, 7.24526333, 0.99462418, 0.99717372, 0.49205033],
-												 [	-6.24710576, -0.00175351, 0.00107123, 7.24535225, 0.99462718, 0.99717526, 0.49205328],
-												 [	-6.24719340, -0.00175255, 0.00107065, 7.24544085, 0.99463018, 0.99717680, 0.49205621],
-												 [	-6.24728073, -0.00175158, 0.00107008, 7.24552914, 0.99463317, 0.99717834, 0.49205913],
-												 [	-6.24736775, -0.00175062, 0.00106951, 7.24561712, 0.99463617, 0.99717987, 0.49206204],
-												 [	-6.24745446, -0.00174966, 0.00106893, 7.24570479, 0.99463915, 0.99718141, 0.49206494],
-												 [	-6.24754086, -0.00174870, 0.00106836, 7.24579216, 0.99464214, 0.99718294, 0.49206783],
-												 [	-6.24762695, -0.00174774, 0.00106779, 7.24587921, 0.99464512, 0.99718447, 0.49207072],
-												 [	-6.24771274, -0.00174678, 0.00106722, 7.24596596, 0.99464810, 0.99718600, 0.49207359],
-												 [	-6.24779823, -0.00174582, 0.00106665, 7.24605241, 0.99465108, 0.99718753, 0.49207645],
-												 [	-6.24788341, -0.00174487, 0.00106608, 7.24613854, 0.99465405, 0.99718905, 0.49207931],
-												 [	-6.24796829, -0.00174391, 0.00106551, 7.24622438, 0.99465702, 0.99719058, 0.49208216],
-												 [	-6.24805287, -0.00174296, 0.00106494, 7.24630991, 0.99465998, 0.99719210, 0.49208499],
-												 [	-6.24813715, -0.00174200, 0.00106438, 7.24639515, 0.99466295, 0.99719362, 0.49208783],
-												 [	-6.24822113, -0.00174105, 0.00106381, 7.24648008, 0.99466591, 0.99719514, 0.49209064],
-												 [	-6.24830481, -0.00174010, 0.00106324, 7.24656471, 0.99466886, 0.99719666, 0.49209345],
-												 [	-6.24838819, -0.00173915, 0.00106267, 7.24664905, 0.99467182, 0.99719818, 0.49209625],
-												 [	-6.24847128, -0.00173819, 0.00106211, 7.24673309, 0.99467477, 0.99719970, 0.49209904],
-												 [	-6.24855407, -0.00173725, 0.00106154, 7.24681683, 0.99467771, 0.99720121, 0.49210182],
-												 [	-6.24863657, -0.00173630, 0.00106098, 7.24690027, 0.99468066, 0.99720272, 0.49210459],
-												 [	-6.24871878, -0.00173535, 0.00106041, 7.24698343, 0.99468360, 0.99720424, 0.49210735],
-												 [	-6.24880069, -0.00173440, 0.00105985, 7.24706629, 0.99468654, 0.99720575, 0.49211010],
-												 [	-6.24888231, -0.00173346, 0.00105929, 7.24714886, 0.99468947, 0.99720725, 0.49211286],
-												 [	-6.24896365, -0.00173251, 0.00105872, 7.24723113, 0.99469240, 0.99720876, 0.49211559],
-												 [	-6.24904469, -0.00173157, 0.00105816, 7.24731312, 0.99469533, 0.99721027, 0.49211832],
-												 [	-6.24912545, -0.00173063, 0.00105760, 7.24739482, 0.99469826, 0.99721177, 0.49212104],
-												 [	-6.24920591, -0.00172969, 0.00105704, 7.24747623, 0.99470118, 0.99721327, 0.49212375],
-												 [	-6.24928610, -0.00172875, 0.00105648, 7.24755735, 0.99470410, 0.99721478, 0.49212645],
-												 [	-6.24936599, -0.00172781, 0.00105592, 7.24763819, 0.99470702, 0.99721628, 0.49212915],
-												 [	-6.24944561, -0.00172687, 0.00105536, 7.24771874, 0.99470993, 0.99721777, 0.49213183],
-												 [	-6.24952494, -0.00172593, 0.00105480, 7.24779901, 0.99471284, 0.99721927, 0.49213451],
-												 [	-6.24960399, -0.00172499, 0.00105424, 7.24787899, 0.99471575, 0.99722077, 0.49213717],
-												 [	-6.24968275, -0.00172406, 0.00105368, 7.24795870, 0.99471865, 0.99722226, 0.49213983],
-												 [	-6.24976124, -0.00172312, 0.00105312, 7.24803812, 0.99472155, 0.99722375, 0.49214248],
-												 [	-6.24983945, -0.00172219, 0.00105257, 7.24811726, 0.99472445, 0.99722524, 0.49214512],
-												 [	-6.24991738, -0.00172126, 0.00105201, 7.24819612, 0.99472735, 0.99722673, 0.49214776],
-												 [	-6.24999503, -0.00172032, 0.00105145, 7.24827471, 0.99473024, 0.99722822, 0.49215038],
-												 [	-6.25007241, -0.00171939, 0.00105090, 7.24835302, 0.99473313, 0.99722971, 0.49215299],
-												 [	-6.25014951, -0.00171846, 0.00105034, 7.24843105, 0.99473601, 0.99723119, 0.49215561],
-												 [	-6.25022634, -0.00171753, 0.00104979, 7.24850880, 0.99473890, 0.99723268, 0.49215820],
-												 [	-6.25030289, -0.00171660, 0.00104923, 7.24858628, 0.99474178, 0.99723416, 0.49216079],
-												 [	-6.25037917, -0.00171568, 0.00104868, 7.24866349, 0.99474465, 0.99723564, 0.49216338],
-												 [	-6.25045518, -0.00171475, 0.00104813, 7.24874043, 0.99474753, 0.99723712, 0.49216595],
-												 [	-6.25053092, -0.00171382, 0.00104758, 7.24881709, 0.99475040, 0.99723860, 0.49216851],
-												 [	-6.25060639, -0.00171290, 0.00104702, 7.24889349, 0.99475327, 0.99724008, 0.49217106],
-												 [	-6.25068159, -0.00171198, 0.00104647, 7.24896961, 0.99475613, 0.99724155, 0.49217362],
-												 [	-6.25075652, -0.00171105, 0.00104592, 7.24904547, 0.99475899, 0.99724303, 0.49217616],
-												 [	-6.25083119, -0.00171013, 0.00104537, 7.24912106, 0.99476185, 0.99724450, 0.49217869],
-												 [	-6.25090559, -0.00170921, 0.00104482, 7.24919638, 0.99476471, 0.99724597, 0.49218121],
-												 [	-6.25097972, -0.00170829, 0.00104427, 7.24927143, 0.99476756, 0.99724744, 0.49218373],
-												 [	-6.25105359, -0.00170737, 0.00104372, 7.24934622, 0.99477041, 0.99724891, 0.49218624],
-												 [	-6.25112720, -0.00170645, 0.00104317, 7.24942075, 0.99477326, 0.99725037, 0.49218873],
-												 [	-6.25120055, -0.00170554, 0.00104262, 7.24949501, 0.99477610, 0.99725184, 0.49219122],
-												 [	-6.25127363, -0.00170462, 0.00104208, 7.24956901, 0.99477894, 0.99725330, 0.49219371],
-												 [	-6.25134646, -0.00170370, 0.00104153, 7.24964275, 0.99478178, 0.99725477, 0.49219618],
-												 [	-6.25141902, -0.00170279, 0.00104098, 7.24971623, 0.99478462, 0.99725623, 0.49219865],
-												 [	-6.25149133, -0.00170188, 0.00104044, 7.24978945, 0.99478745, 0.99725769, 0.49220112],
-												 [	-6.25156338, -0.00170096, 0.00103989, 7.24986241, 0.99479028, 0.99725915, 0.49220356],
-												 [	-6.25163517, -0.00170005, 0.00103935, 7.24993512, 0.99479311, 0.99726060, 0.49220600],
-												 [	-6.25170670, -0.00169914, 0.00103880, 7.25000756, 0.99479593, 0.99726206, 0.49220844],
-												 [	-6.25177798, -0.00169823, 0.00103826, 7.25007975, 0.99479875, 0.99726351, 0.49221087],
-												 [	-6.25184901, -0.00169732, 0.00103771, 7.25015169, 0.99480157, 0.99726496, 0.49221329],
-												 [	-6.25191978, -0.00169641, 0.00103717, 7.25022337, 0.99480438, 0.99726642, 0.49221570],
-												 [	-6.25199031, -0.00169551, 0.00103663, 7.25029480, 0.99480719, 0.99726787, 0.49221811],
-												 [	-6.25206057, -0.00169460, 0.00103609, 7.25036598, 0.99481000, 0.99726931, 0.49222050],
-												 [	-6.25213059, -0.00169369, 0.00103555, 7.25043690, 0.99481281, 0.99727076, 0.49222289],
-												 [	-6.25220036, -0.00169279, 0.00103500, 7.25050757, 0.99481561, 0.99727221, 0.49222527],
-												 [	-6.25226988, -0.00169189, 0.00103446, 7.25057800, 0.99481841, 0.99727365, 0.49222765],
-												 [	-6.25233916, -0.00169098, 0.00103392, 7.25064817, 0.99482121, 0.99727509, 0.49223001],
-												 [	-6.25240818, -0.00169008, 0.00103338, 7.25071810, 0.99482400, 0.99727653, 0.49223237],
-												 [	-6.25247696, -0.00168918, 0.00103285, 7.25078778, 0.99482680, 0.99727797, 0.49223472],
-												 [	-6.25254550, -0.00168828, 0.00103231, 7.25085722, 0.99482958, 0.99727941, 0.49223706],
-												 [	-6.25261379, -0.00168738, 0.00103177, 7.25092640, 0.99483237, 0.99728085, 0.49223939],
-												 [	-6.25268183, -0.00168648, 0.00103123, 7.25099535, 0.99483515, 0.99728229, 0.49224172],
-												 [	-6.25274963, -0.00168559, 0.00103069, 7.25106405, 0.99483793, 0.99728372, 0.49224404],
-												 [	-6.25281720, -0.00168469, 0.00103016, 7.25113251, 0.99484071, 0.99728515, 0.49224636],
-												 [	-6.25288452, -0.00168379, 0.00102962, 7.25120072, 0.99484348, 0.99728659, 0.49224866],
-												 [	-6.25295160, -0.00168290, 0.00102909, 7.25126870, 0.99484626, 0.99728802, 0.49225097],
-												 [	-6.25301844, -0.00168200, 0.00102855, 7.25133643, 0.99484902, 0.99728945, 0.49225325],
-												 [	-6.25308504, -0.00168111, 0.00102802, 7.25140393, 0.99485179, 0.99729087, 0.49225553],
-												 [	-6.25315140, -0.00168022, 0.00102748, 7.25147118, 0.99485455, 0.99729230, 0.49225780],
-												 [	-6.25321753, -0.00167933, 0.00102695, 7.25153820, 0.99485731, 0.99729372, 0.49226008],
-												 [	-6.25328342, -0.00167844, 0.00102641, 7.25160498, 0.99486007, 0.99729515, 0.49226233],
-												 [	-6.25334907, -0.00167755, 0.00102588, 7.25167153, 0.99486282, 0.99729657, 0.49226459],
-												 [	-6.25341450, -0.00167666, 0.00102535, 7.25173784, 0.99486558, 0.99729799, 0.49226684],
-												 [	-6.25347968, -0.00167577, 0.00102482, 7.25180391, 0.99486832, 0.99729941, 0.49226907],
-												 [	-6.25354464, -0.00167489, 0.00102429, 7.25186975, 0.99487107, 0.99730083, 0.49227131],
-												 [	-6.25360936, -0.00167400, 0.00102376, 7.25193536, 0.99487381, 0.99730224, 0.49227354],
-												 [	-6.25367385, -0.00167312, 0.00102323, 7.25200074, 0.99487655, 0.99730366, 0.49227575],
-												 [	-6.25373811, -0.00167223, 0.00102270, 7.25206588, 0.99487929, 0.99730507, 0.49227796],
-												 [	-6.25380215, -0.00167135, 0.00102217, 7.25213080, 0.99488202, 0.99730649, 0.49228016],
-												 [	-6.25386595, -0.00167047, 0.00102164, 7.25219548, 0.99488476, 0.99730790, 0.49228236],
-												 [	-6.25392952, -0.00166958, 0.00102111, 7.25225994, 0.99488749, 0.99730931, 0.49228455],
-												 [	-6.25399287, -0.00166870, 0.00102058, 7.25232417, 0.99489021, 0.99731072, 0.49228673],
-												 [	-6.25405599, -0.00166782, 0.00102005, 7.25238817, 0.99489294, 0.99731212, 0.49228892],
-												 [	-6.25411889, -0.00166694, 0.00101953, 7.25245194, 0.99489566, 0.99731353, 0.49229108],
-												 [	-6.25418156, -0.00166607, 0.00101900, 7.25251549, 0.99489837, 0.99731493, 0.49229324],
-												 [	-6.25424401, -0.00166519, 0.00101847, 7.25257882, 0.99490109, 0.99731634, 0.49229539],
-												 [	-6.25430623, -0.00166431, 0.00101795, 7.25264192, 0.99490380, 0.99731774, 0.49229754],
-												 [	-6.25436823, -0.00166344, 0.00101742, 7.25270479, 0.99490651, 0.99731914, 0.49229968],
-												 [	-6.25443001, -0.00166256, 0.00101690, 7.25276745, 0.99490922, 0.99732054, 0.49230182],
-												 [	-6.25449157, -0.00166169, 0.00101638, 7.25282988, 0.99491192, 0.99732194, 0.49230394],
-												 [	-6.25455291, -0.00166082, 0.00101585, 7.25289209, 0.99491462, 0.99732333, 0.49230606],
-												 [	-6.25461403, -0.00165994, 0.00101533, 7.25295408, 0.99491732, 0.99732473, 0.49230817],
-												 [	-6.25467493, -0.00165907, 0.00101481, 7.25301586, 0.99492002, 0.99732612, 0.49231027],
-												 [	-6.25473561, -0.00165820, 0.00101428, 7.25307741, 0.99492271, 0.99732751, 0.49231238],
-												 [	-6.25479608, -0.00165733, 0.00101376, 7.25313874, 0.99492540, 0.99732890, 0.49231446],
-												 [	-6.25485633, -0.00165647, 0.00101324, 7.25319986, 0.99492809, 0.99733029, 0.49231656],
-												 [	-6.25491636, -0.00165560, 0.00101272, 7.25326076, 0.99493077, 0.99733168, 0.49231863],
-												 [	-6.25497618, -0.00165473, 0.00101220, 7.25332145, 0.99493345, 0.99733307, 0.49232070],
-												 [	-6.25503579, -0.00165386, 0.00101168, 7.25338192, 0.99493613, 0.99733445, 0.49232277],
-												 [	-6.25509518, -0.00165300, 0.00101116, 7.25344218, 0.99493881, 0.99733584, 0.49232483],
-												 [	-6.25515436, -0.00165214, 0.00101064, 7.25350222, 0.99494148, 0.99733722, 0.49232688],
-												 [	-6.25521333, -0.00165127, 0.00101012, 7.25356206, 0.99494415, 0.99733860, 0.49232894],
-												 [	-6.25527209, -0.00165041, 0.00100961, 7.25362168, 0.99494682, 0.99733998, 0.49233097],
-												 [	-6.25533063, -0.00164955, 0.00100909, 7.25368108, 0.99494949, 0.99734136, 0.49233301],
-												 [	-6.25538897, -0.00164869, 0.00100857, 7.25374028, 0.99495215, 0.99734274, 0.49233504],
-												 [	-6.25544710, -0.00164783, 0.00100806, 7.25379927, 0.99495481, 0.99734412, 0.49233704],
-												 [	-6.25550502, -0.00164697, 0.00100754, 7.25385805, 0.99495747, 0.99734549, 0.49233906],
-												 [	-6.25556273, -0.00164611, 0.00100702, 7.25391662, 0.99496012, 0.99734687, 0.49234107],
-												 [	-6.25562024, -0.00164525, 0.00100651, 7.25397499, 0.99496278, 0.99734824, 0.49234308],
-												 [	-6.25567754, -0.00164440, 0.00100599, 7.25403314, 0.99496543, 0.99734961, 0.49234506],
-												 [	-6.25573464, -0.00164354, 0.00100548, 7.25409110, 0.99496807, 0.99735098, 0.49234706],
-												 [	-6.25579153, -0.00164268, 0.00100497, 7.25414884, 0.99497072, 0.99735235, 0.49234904],
-												 [	-6.25584821, -0.00164183, 0.00100445, 7.25420638, 0.99497336, 0.99735372, 0.49235101],
-												 [	-6.25590470, -0.00164098, 0.00100394, 7.25426372, 0.99497600, 0.99735508, 0.49235297],
-												 [	-6.25596098, -0.00164012, 0.00100343, 7.25432086, 0.99497863, 0.99735645, 0.49235495],
-												 [	-6.25601706, -0.00163927, 0.00100292, 7.25437779, 0.99498127, 0.99735781, 0.49235690],
-												 [	-6.25607294, -0.00163842, 0.00100241, 7.25443452, 0.99498390, 0.99735917, 0.49235884],
-												 [	-6.25612862, -0.00163757, 0.00100189, 7.25449105, 0.99498652, 0.99736053, 0.49236079],
-												 [	-6.25618410, -0.00163672, 0.00100138, 7.25454738, 0.99498915, 0.99736189, 0.49236272],
-												 [	-6.25623938, -0.00163587, 0.00100087, 7.25460351, 0.99499177, 0.99736325, 0.49236466],
-												 [	-6.25629447, -0.00163503, 0.00100036, 7.25465944, 0.99499439, 0.99736461, 0.49236658],
-												 [	-6.25634936, -0.00163418, 0.00099986, 7.25471518, 0.99499701, 0.99736596, 0.49236850],
-												 [	-6.25640405, -0.00163333, 0.00099935, 7.25477071, 0.99499963, 0.99736732, 0.49237042],
-												 [	-6.25645854, -0.00163249, 0.00099884, 7.25482605, 0.99500224, 0.99736867, 0.49237232],
-												 [	-6.25651284, -0.00163164, 0.00099833, 7.25488119, 0.99500485, 0.99737002, 0.49237422],
-												 [	-6.25656694, -0.00163080, 0.00099782, 7.25493614, 0.99500745, 0.99737137, 0.49237612],
-												 [	-6.25662085, -0.00162996, 0.00099732, 7.25499089, 0.99501006, 0.99737272, 0.49237800],
-												 [	-6.25667457, -0.00162912, 0.00099681, 7.25504545, 0.99501266, 0.99737407, 0.49237989],
-												 [	-6.25672809, -0.00162828, 0.00099631, 7.25509982, 0.99501526, 0.99737542, 0.49238176],
-												 [	-6.25678143, -0.00162744, 0.00099580, 7.25515399, 0.99501786, 0.99737676, 0.49238364],
-												 [	-6.25683457, -0.00162660, 0.00099530, 7.25520797, 0.99502045, 0.99737811, 0.49238550],
-												 [	-6.25688752, -0.00162576, 0.00099479, 7.25526176, 0.99502304, 0.99737945, 0.49238736],
-												 [	-6.25694028, -0.00162492, 0.00099429, 7.25531536, 0.99502563, 0.99738079, 0.49238921],
-												 [	-6.25699285, -0.00162408, 0.00099378, 7.25536877, 0.99502822, 0.99738213, 0.49239105],
-												 [	-6.25704524, -0.00162325, 0.00099328, 7.25542199, 0.99503080, 0.99738347, 0.49239289],
-												 [	-6.25709743, -0.00162241, 0.00099278, 7.25547502, 0.99503338, 0.99738481, 0.49239473],
-												 [	-6.25714944, -0.00162158, 0.00099228, 7.25552786, 0.99503596, 0.99738615, 0.49239656],
-												 [	-6.25720127, -0.00162074, 0.00099177, 7.25558052, 0.99503853, 0.99738748, 0.49239838],
-												 [	-6.25725290, -0.00161991, 0.00099127, 7.25563299, 0.99504111, 0.99738881, 0.49240020],
-												 [	-6.25730435, -0.00161908, 0.00099077, 7.25568527, 0.99504368, 0.99739015, 0.49240201],
-												 [	-6.25735562, -0.00161825, 0.00099027, 7.25573737, 0.99504625, 0.99739148, 0.49240381],
-												 [	-6.25740670, -0.00161742, 0.00098977, 7.25578929, 0.99504881, 0.99739281, 0.49240561],
-												 [	-6.25745761, -0.00161659, 0.00098927, 7.25584102, 0.99505137, 0.99739414, 0.49240741],
-												 [	-6.25750832, -0.00161576, 0.00098877, 7.25589256, 0.99505393, 0.99739547, 0.49240919],
-												 [	-6.25755886, -0.00161493, 0.00098828, 7.25594393, 0.99505649, 0.99739679, 0.49241098],
-												 [	-6.25760921, -0.00161411, 0.00098778, 7.25599511, 0.99505905, 0.99739812, 0.49241276],
-												 [	-6.25765939, -0.00161328, 0.00098728, 7.25604611, 0.99506160, 0.99739944, 0.49241453],
-												 [	-6.25770938, -0.00161245, 0.00098678, 7.25609693, 0.99506415, 0.99740076, 0.49241630],
-												 [	-6.25775920, -0.00161163, 0.00098629, 7.25614757, 0.99506670, 0.99740209, 0.49241806],
-												 [	-6.25780883, -0.00161080, 0.00098579, 7.25619803, 0.99506924, 0.99740341, 0.49241981],
-												 [	-6.25785829, -0.00160998, 0.00098529, 7.25624831, 0.99507179, 0.99740472, 0.49242156],
-												 [	-6.25790757, -0.00160916, 0.00098480, 7.25629841, 0.99507433, 0.99740604, 0.49242330],
-												 [	-6.25795667, -0.00160834, 0.00098430, 7.25634834, 0.99507686, 0.99740736, 0.49242504],
-												 [	-6.25800560, -0.00160752, 0.00098381, 7.25639808, 0.99507940, 0.99740867, 0.49242678],
-												 [	-6.25805435, -0.00160670, 0.00098332, 7.25644766, 0.99508193, 0.99740999, 0.49242849],
-												 [	-6.25810293, -0.00160588, 0.00098282, 7.25649705, 0.99508446, 0.99741130, 0.49243022],
-												 [	-6.25815133, -0.00160506, 0.00098233, 7.25654627, 0.99508699, 0.99741261, 0.49243193],
-												 [	-6.25819956, -0.00160424, 0.00098184, 7.25659532, 0.99508951, 0.99741392, 0.49243365],
-												 [	-6.25824762, -0.00160342, 0.00098134, 7.25664419, 0.99509203, 0.99741523, 0.49243535],
-												 [	-6.25829550, -0.00160261, 0.00098085, 7.25669289, 0.99509455, 0.99741654, 0.49243704],
-												 [	-6.25834321, -0.00160179, 0.00098036, 7.25674142, 0.99509707, 0.99741784, 0.49243875],
-												 [	-6.25839075, -0.00160098, 0.00097987, 7.25678978, 0.99509959, 0.99741915, 0.49244043],
-												 [	-6.25843812, -0.00160017, 0.00097938, 7.25683796, 0.99510210, 0.99742045, 0.49244213],
-												 [	-6.25848532, -0.00159935, 0.00097889, 7.25688597, 0.99510461, 0.99742176, 0.49244379],
-												 [	-6.25853235, -0.00159854, 0.00097840, 7.25693381, 0.99510712, 0.99742306, 0.49244547],
-												 [	-6.25857922, -0.00159773, 0.00097791, 7.25698149, 0.99510962, 0.99742436, 0.49244714],
-												 [	-6.25862591, -0.00159692, 0.00097742, 7.25702899, 0.99511212, 0.99742566, 0.49244880],
-												 [	-6.25867244, -0.00159611, 0.00097693, 7.25707633, 0.99511462, 0.99742696, 0.49245046],
-												 [	-6.25871879, -0.00159530, 0.00097645, 7.25712350, 0.99511712, 0.99742825, 0.49245210],
-												 [	-6.25876499, -0.00159449, 0.00097596, 7.25717050, 0.99511962, 0.99742955, 0.49245376],
-												 [	-6.25881101, -0.00159368, 0.00097547, 7.25721733, 0.99512211, 0.99743084, 0.49245539],
-												 [	-6.25885688, -0.00159288, 0.00097499, 7.25726400, 0.99512460, 0.99743214, 0.49245702],
-												 [	-6.25890257, -0.00159207, 0.00097450, 7.25731050, 0.99512709, 0.99743343, 0.49245866],
-												 [	-6.25894810, -0.00159127, 0.00097402, 7.25735684, 0.99512957, 0.99743472, 0.49246028],
-												 [	-6.25899347, -0.00159046, 0.00097353, 7.25740301, 0.99513205, 0.99743601, 0.49246190],
-												 [	-6.25903868, -0.00158966, 0.00097305, 7.25744902, 0.99513453, 0.99743730, 0.49246352],
-												 [	-6.25908372, -0.00158886, 0.00097256, 7.25749487, 0.99513701, 0.99743858, 0.49246513],
-												 [	-6.25912861, -0.00158805, 0.00097208, 7.25754055, 0.99513949, 0.99743987, 0.49246673],
-												 [	-6.25917333, -0.00158725, 0.00097159, 7.25758607, 0.99514196, 0.99744115, 0.49246833],
-												 [	-6.25921789, -0.00158645, 0.00097111, 7.25763144, 0.99514443, 0.99744244, 0.49246993],
-												 [	-6.25926229, -0.00158565, 0.00097063, 7.25767664, 0.99514690, 0.99744372, 0.49247152],
-												 [	-6.25930653, -0.00158485, 0.00097015, 7.25772168, 0.99514936, 0.99744500, 0.49247309],
-												 [	-6.25935061, -0.00158406, 0.00096966, 7.25776656, 0.99515183, 0.99744628, 0.49247468],
-												 [	-6.25939453, -0.00158326, 0.00096918, 7.25781128, 0.99515429, 0.99744756, 0.49247625],
-												 [	-6.25943830, -0.00158246, 0.00096870, 7.25785584, 0.99515675, 0.99744884, 0.49247782],
-												 [	-6.25948191, -0.00158167, 0.00096822, 7.25790024, 0.99515920, 0.99745011, 0.49247939],
-												 [	-6.25952536, -0.00158087, 0.00096774, 7.25794449, 0.99516165, 0.99745139, 0.49248095],
-												 [	-6.25956866, -0.00158008, 0.00096726, 7.25798858, 0.99516411, 0.99745266, 0.49248251],
-												 [	-6.25961180, -0.00157928, 0.00096678, 7.25803252, 0.99516655, 0.99745393, 0.49248405],
-												 [	-6.25965478, -0.00157849, 0.00096631, 7.25807629, 0.99516900, 0.99745521, 0.49248560],
-												 [	-6.25969761, -0.00157770, 0.00096583, 7.25811992, 0.99517144, 0.99745648, 0.49248715],
-												 [	-6.25974029, -0.00157691, 0.00096535, 7.25816339, 0.99517389, 0.99745774, 0.49248867],
-												 [	-6.25978282, -0.00157612, 0.00096487, 7.25820670, 0.99517633, 0.99745901, 0.49249021],
-												 [	-6.25982519, -0.00157533, 0.00096440, 7.25824986, 0.99517876, 0.99746028, 0.49249174],
-												 [	-6.25986741, -0.00157454, 0.00096392, 7.25829287, 0.99518120, 0.99746154, 0.49249325],
-												 [	-6.25990947, -0.00157375, 0.00096344, 7.25833572, 0.99518363, 0.99746281, 0.49249477],
-												 [	-6.25995139, -0.00157296, 0.00096297, 7.25837843, 0.99518606, 0.99746407, 0.49249628],
-												 [	-6.25999315, -0.00157217, 0.00096249, 7.25842098, 0.99518848, 0.99746533, 0.49249779],
-												 [	-6.26003477, -0.00157139, 0.00096202, 7.25846338, 0.99519091, 0.99746659, 0.49249929],
-												 [	-6.26007624, -0.00157060, 0.00096154, 7.25850563, 0.99519333, 0.99746785, 0.49250079],
-												 [	-6.26011755, -0.00156982, 0.00096107, 7.25854773, 0.99519575, 0.99746911, 0.49250228],
-												 [	-6.26015872, -0.00156903, 0.00096060, 7.25858969, 0.99519817, 0.99747037, 0.49250377],
-												 [	-6.26019974, -0.00156825, 0.00096012, 7.25863149, 0.99520058, 0.99747163, 0.49250524],
-												 [	-6.26024061, -0.00156747, 0.00095965, 7.25867315, 0.99520300, 0.99747288, 0.49250672],
-												 [	-6.26028134, -0.00156669, 0.00095918, 7.25871465, 0.99520541, 0.99747414, 0.49250819],
-												 [	-6.26032192, -0.00156591, 0.00095871, 7.25875601, 0.99520782, 0.99747539, 0.49250967],
-												 [	-6.26036235, -0.00156513, 0.00095823, 7.25879723, 0.99521022, 0.99747664, 0.49251114],
-												 [	-6.26040264, -0.00156435, 0.00095776, 7.25883830, 0.99521263, 0.99747789, 0.49251259],
-												 [	-6.26044279, -0.00156357, 0.00095729, 7.25887922, 0.99521503, 0.99747914, 0.49251404],
-												 [	-6.26048279, -0.00156279, 0.00095682, 7.25892000, 0.99521743, 0.99748039, 0.49251549],
-												 [	-6.26052264, -0.00156201, 0.00095635, 7.25896063, 0.99521982, 0.99748163, 0.49251694],
-												 [	-6.26056235, -0.00156124, 0.00095588, 7.25900112, 0.99522222, 0.99748288, 0.49251838],
-												 [	-6.26060192, -0.00156046, 0.00095542, 7.25904146, 0.99522461, 0.99748412, 0.49251982],
-												 [	-6.26064135, -0.00155969, 0.00095495, 7.25908167, 0.99522700, 0.99748537, 0.49252125],
-												 [	-6.26068064, -0.00155891, 0.00095448, 7.25912173, 0.99522939, 0.99748661, 0.49252269],
-												 [	-6.26071978, -0.00155814, 0.00095401, 7.25916164, 0.99523177, 0.99748785, 0.49252410],
-												 [	-6.26075879, -0.00155737, 0.00095354, 7.25920142, 0.99523415, 0.99748909, 0.49252552],
-												 [	-6.26079765, -0.00155659, 0.00095308, 7.25924106, 0.99523653, 0.99749033, 0.49252694],
-												 [	-6.26083637, -0.00155582, 0.00095261, 7.25928055, 0.99523891, 0.99749157, 0.49252834],
-												 [	-6.26087496, -0.00155505, 0.00095215, 7.25931991, 0.99524129, 0.99749280, 0.49252975],
-												 [	-6.26091341, -0.00155428, 0.00095168, 7.25935912, 0.99524366, 0.99749404, 0.49253116],
-												 [	-6.26095171, -0.00155351, 0.00095122, 7.25939820, 0.99524603, 0.99749527, 0.49253255],
-												 [	-6.26098988, -0.00155274, 0.00095075, 7.25943714, 0.99524840, 0.99749651, 0.49253394],
-												 [	-6.26102792, -0.00155198, 0.00095029, 7.25947594, 0.99525077, 0.99749774, 0.49253533],
-												 [	-6.26106581, -0.00155121, 0.00094982, 7.25951460, 0.99525313, 0.99749897, 0.49253672],
-												 [	-6.26110357, -0.00155044, 0.00094936, 7.25955313, 0.99525549, 0.99750020, 0.49253810],
-												 [	-6.26114120, -0.00154968, 0.00094890, 7.25959152, 0.99525785, 0.99750143, 0.49253947],
-												 [	-6.26117869, -0.00154891, 0.00094843, 7.25962977, 0.99526021, 0.99750265, 0.49254085],
-												 [	-6.26121604, -0.00154815, 0.00094797, 7.25966789, 0.99526256, 0.99750388, 0.49254220],
-												 [	-6.26125326, -0.00154739, 0.00094751, 7.25970587, 0.99526492, 0.99750510, 0.49254357],
-												 [	-6.26129035, -0.00154662, 0.00094705, 7.25974372, 0.99526727, 0.99750633, 0.49254493],
-												 [	-6.26132730, -0.00154586, 0.00094659, 7.25978144, 0.99526962, 0.99750755, 0.49254628],
-												 [	-6.26136412, -0.00154510, 0.00094613, 7.25981902, 0.99527196, 0.99750877, 0.49254763],
-												 [	-6.26140081, -0.00154434, 0.00094567, 7.25985647, 0.99527431, 0.99750999, 0.49254897],
-												 [	-6.26143736, -0.00154358, 0.00094521, 7.25989378, 0.99527665, 0.99751121, 0.49255032],
-												 [	-6.26147379, -0.00154282, 0.00094475, 7.25993097, 0.99527899, 0.99751243, 0.49255166],
-												 [	-6.26151008, -0.00154206, 0.00094429, 7.25996802, 0.99528132, 0.99751365, 0.49255299],
-												 [	-6.26154624, -0.00154131, 0.00094383, 7.26000494, 0.99528366, 0.99751486, 0.49255432],
-												 [	-6.26158228, -0.00154055, 0.00094337, 7.26004173, 0.99528599, 0.99751608, 0.49255564],
-												 [	-6.26161818, -0.00153979, 0.00094292, 7.26007839, 0.99528832, 0.99751729, 0.49255696],
-												 [	-6.26165395, -0.00153904, 0.00094246, 7.26011492, 0.99529065, 0.99751851, 0.49255828],
-												 [	-6.26168960, -0.00153828, 0.00094200, 7.26015132, 0.99529297, 0.99751972, 0.49255958],
-												 [	-6.26172512, -0.00153753, 0.00094155, 7.26018759, 0.99529530, 0.99752093, 0.49256090],
-												 [	-6.26176051, -0.00153677, 0.00094109, 7.26022373, 0.99529762, 0.99752214, 0.49256219],
-												 [	-6.26179577, -0.00153602, 0.00094063, 7.26025975, 0.99529994, 0.99752334, 0.49256349],
-												 [	-6.26183090, -0.00153527, 0.00094018, 7.26029563, 0.99530226, 0.99752455, 0.49256478],
-												 [	-6.26186591, -0.00153452, 0.00093972, 7.26033139, 0.99530457, 0.99752576, 0.49256609],
-												 [	-6.26190080, -0.00153377, 0.00093927, 7.26036703, 0.99530688, 0.99752696, 0.49256738],
-												 [	-6.26193555, -0.00153302, 0.00093882, 7.26040254, 0.99530919, 0.99752817, 0.49256866],
-												 [	-6.26197019, -0.00153227, 0.00093836, 7.26043792, 0.99531150, 0.99752937, 0.49256993],
-												 [	-6.26200470, -0.00153152, 0.00093791, 7.26047317, 0.99531381, 0.99753057, 0.49257121],
-												 [	-6.26203908, -0.00153077, 0.00093746, 7.26050831, 0.99531611, 0.99753177, 0.49257249],
-												 [	-6.26207334, -0.00153003, 0.00093700, 7.26054331, 0.99531841, 0.99753297, 0.49257375],
-												 [	-6.26210748, -0.00152928, 0.00093655, 7.26057820, 0.99532071, 0.99753417, 0.49257501],
-												 [	-6.26214149, -0.00152853, 0.00093610, 7.26061296, 0.99532301, 0.99753537, 0.49257629],
-												 [	-6.26217539, -0.00152779, 0.00093565, 7.26064760, 0.99532530, 0.99753656, 0.49257754],
-												 [	-6.26220916, -0.00152705, 0.00093520, 7.26068211, 0.99532759, 0.99753776, 0.49257879],
-												 [	-6.26224280, -0.00152630, 0.00093475, 7.26071650, 0.99532988, 0.99753895, 0.49258003],
-												 [	-6.26227633, -0.00152556, 0.00093430, 7.26075077, 0.99533217, 0.99754014, 0.49258128],
-												 [	-6.26230974, -0.00152482, 0.00093385, 7.26078492, 0.99533446, 0.99754133, 0.49258252],
-												 [	-6.26234303, -0.00152408, 0.00093340, 7.26081895, 0.99533674, 0.99754253, 0.49258376],
-												 [	-6.26237620, -0.00152333, 0.00093295, 7.26085286, 0.99533902, 0.99754372, 0.49258498],
-												 [	-6.26240924, -0.00152259, 0.00093250, 7.26088665, 0.99534130, 0.99754490, 0.49258622],
-												 [	-6.26244217, -0.00152186, 0.00093205, 7.26092032, 0.99534358, 0.99754609, 0.49258745],
-												 [	-6.26247499, -0.00152112, 0.00093161, 7.26095387, 0.99534586, 0.99754728, 0.49258868],
-												 [	-6.26250768, -0.00152038, 0.00093116, 7.26098730, 0.99534813, 0.99754846, 0.49258989],
-												 [	-6.26254025, -0.00151964, 0.00093071, 7.26102061, 0.99535040, 0.99754965, 0.49259110],
-												 [	-6.26257271, -0.00151890, 0.00093027, 7.26105381, 0.99535267, 0.99755083, 0.49259230],
-												 [	-6.26260505, -0.00151817, 0.00092982, 7.26108689, 0.99535493, 0.99755201, 0.49259351],
-												 [	-6.26263728, -0.00151743, 0.00092937, 7.26111985, 0.99535720, 0.99755319, 0.49259471],
-												 [	-6.26266939, -0.00151670, 0.00092893, 7.26115269, 0.99535946, 0.99755437, 0.49259592],
-												 [	-6.26270138, -0.00151596, 0.00092848, 7.26118542, 0.99536172, 0.99755555, 0.49259711],
-												 [	-6.26273326, -0.00151523, 0.00092804, 7.26121803, 0.99536398, 0.99755673, 0.49259829],
-												 [	-6.26276503, -0.00151450, 0.00092760, 7.26125053, 0.99536623, 0.99755790, 0.49259950],
-												 [	-6.26279668, -0.00151377, 0.00092715, 7.26128291, 0.99536849, 0.99755908, 0.49260067],
-												 [	-6.26282822, -0.00151304, 0.00092671, 7.26131518, 0.99537074, 0.99756025, 0.49260186],
-												 [	-6.26285964, -0.00151231, 0.00092627, 7.26134733, 0.99537299, 0.99756143, 0.49260303],
-												 [	-6.26289095, -0.00151158, 0.00092582, 7.26137937, 0.99537524, 0.99756260, 0.49260421],
-												 [	-6.26292215, -0.00151085, 0.00092538, 7.26141130, 0.99537748, 0.99756377, 0.49260538],
-												 [	-6.26295323, -0.00151012, 0.00092494, 7.26144311, 0.99537972, 0.99756494, 0.49260653],
-												 [	-6.26298421, -0.00150939, 0.00092450, 7.26147481, 0.99538196, 0.99756611, 0.49260770],
-												 [	-6.26301507, -0.00150866, 0.00092406, 7.26150640, 0.99538420, 0.99756728, 0.49260887],
-												 [	-6.26304582, -0.00150794, 0.00092362, 7.26153788, 0.99538644, 0.99756844, 0.49261002],
-												 [	-6.26307646, -0.00150721, 0.00092318, 7.26156925, 0.99538867, 0.99756961, 0.49261117],
-												 [	-6.26310699, -0.00150649, 0.00092274, 7.26160050, 0.99539091, 0.99757078, 0.49261231],
-												 [	-6.26313741, -0.00150576, 0.00092230, 7.26163165, 0.99539314, 0.99757194, 0.49261347],
-												 [	-6.26316772, -0.00150504, 0.00092186, 7.26166269, 0.99539536, 0.99757310, 0.49261461],
-												 [	-6.26319793, -0.00150431, 0.00092142, 7.26169361, 0.99539759, 0.99757426, 0.49261575],
-												 [	-6.26322802, -0.00150359, 0.00092098, 7.26172443, 0.99539981, 0.99757542, 0.49261688],
-												 [	-6.26325801, -0.00150287, 0.00092055, 7.26175513, 0.99540204, 0.99757658, 0.49261801],
-												 [	-6.26328788, -0.00150215, 0.00092011, 7.26178573, 0.99540426, 0.99757774, 0.49261913],
-												 [	-6.26331765, -0.00150143, 0.00091967, 7.26181623, 0.99540647, 0.99757890, 0.49262025],
-												 [	-6.26334732, -0.00150071, 0.00091924, 7.26184661, 0.99540869, 0.99758006, 0.49262138],
-												 [	-6.26337687, -0.00149999, 0.00091880, 7.26187688, 0.99541090, 0.99758121, 0.49262250],
-												 [	-6.26340633, -0.00149927, 0.00091836, 7.26190705, 0.99541311, 0.99758236, 0.49262361],
-												 [	-6.26343567, -0.00149855, 0.00091793, 7.26193712, 0.99541532, 0.99758352, 0.49262472],
-												 [	-6.26346491, -0.00149784, 0.00091749, 7.26196707, 0.99541753, 0.99758467, 0.49262583],
-												 [	-6.26349404, -0.00149712, 0.00091706, 7.26199692, 0.99541974, 0.99758582, 0.49262693],
-												 [	-6.26352307, -0.00149640, 0.00091662, 7.26202667, 0.99542194, 0.99758697, 0.49262803],
-												 [	-6.26355200, -0.00149569, 0.00091619, 7.26205631, 0.99542414, 0.99758812, 0.49262913],
-												 [	-6.26358082, -0.00149498, 0.00091576, 7.26208585, 0.99542634, 0.99758927, 0.49263021],
-												 [	-6.26360954, -0.00149426, 0.00091532, 7.26211528, 0.99542854, 0.99759042, 0.49263131],
-												 [	-6.26363815, -0.00149355, 0.00091489, 7.26214460, 0.99543073, 0.99759156, 0.49263239],
-												 [	-6.26366666, -0.00149284, 0.00091446, 7.26217383, 0.99543292, 0.99759271, 0.49263348],
-												 [	-6.26369507, -0.00149212, 0.00091403, 7.26220295, 0.99543511, 0.99759385, 0.49263456],
-												 [	-6.26372338, -0.00149141, 0.00091359, 7.26223197, 0.99543730, 0.99759499, 0.49263563],
-												 [	-6.26375159, -0.00149070, 0.00091316, 7.26226088, 0.99543949, 0.99759613, 0.49263671],
-												 [	-6.26377969, -0.00148999, 0.00091273, 7.26228970, 0.99544167, 0.99759728, 0.49263778],
-												 [	-6.26380769, -0.00148928, 0.00091230, 7.26231841, 0.99544386, 0.99759841, 0.49263884],
-												 [	-6.26383560, -0.00148857, 0.00091187, 7.26234702, 0.99544604, 0.99759955, 0.49263991],
-												 [	-6.26386340, -0.00148787, 0.00091144, 7.26237553, 0.99544821, 0.99760069, 0.49264097],
-												 [	-6.26389110, -0.00148716, 0.00091101, 7.26240394, 0.99545039, 0.99760183, 0.49264203],
-												 [	-6.26391870, -0.00148645, 0.00091058, 7.26243225, 0.99545257, 0.99760296, 0.49264308],
-												 [	-6.26394621, -0.00148575, 0.00091016, 7.26246046, 0.99545474, 0.99760410, 0.49264413],
-												 [	-6.26397361, -0.00148504, 0.00090973, 7.26248857, 0.99545691, 0.99760523, 0.49264518],
-												 [	-6.26400092, -0.00148434, 0.00090930, 7.26251658, 0.99545908, 0.99760636, 0.49264622],
-												 [	-6.26402813, -0.00148363, 0.00090887, 7.26254449, 0.99546124, 0.99760750, 0.49264726],
-												 [	-6.26405524, -0.00148293, 0.00090844, 7.26257231, 0.99546341, 0.99760863, 0.49264830],
-												 [	-6.26408225, -0.00148223, 0.00090802, 7.26260002, 0.99546557, 0.99760976, 0.49264934],
-												 [	-6.26410916, -0.00148152, 0.00090759, 7.26262764, 0.99546773, 0.99761088, 0.49265036],
-												 [	-6.26413598, -0.00148082, 0.00090717, 7.26265516, 0.99546989, 0.99761201, 0.49265140],
-												 [	-6.26416271, -0.00148012, 0.00090674, 7.26268258, 0.99547204, 0.99761314, 0.49265242],
-												 [	-6.26418933, -0.00147942, 0.00090631, 7.26270991, 0.99547420, 0.99761426, 0.49265345],
-												 [	-6.26421586, -0.00147872, 0.00090589, 7.26273714, 0.99547635, 0.99761539, 0.49265447],
-												 [	-6.26424230, -0.00147802, 0.00090547, 7.26276428, 0.99547850, 0.99761651, 0.49265547],
-												 [	-6.26426864, -0.00147733, 0.00090504, 7.26279132, 0.99548065, 0.99761763, 0.49265649],
-												 [	-6.26429489, -0.00147663, 0.00090462, 7.26281826, 0.99548279, 0.99761875, 0.49265751],
-												 [	-6.26432104, -0.00147593, 0.00090419, 7.26284511, 0.99548494, 0.99761987, 0.49265851],
-												 [	-6.26434710, -0.00147523, 0.00090377, 7.26287186, 0.99548708, 0.99762099, 0.49265951],
-												 [	-6.26437306, -0.00147454, 0.00090335, 7.26289852, 0.99548922, 0.99762211, 0.49266051],
-												 [	-6.26439893, -0.00147384, 0.00090293, 7.26292509, 0.99549136, 0.99762323, 0.49266151],
-												 [	-6.26442471, -0.00147315, 0.00090250, 7.26295156, 0.99549349, 0.99762435, 0.49266249],
-												 [	-6.26445040, -0.00147246, 0.00090208, 7.26297794, 0.99549563, 0.99762546, 0.49266350],
-												 [	-6.26447599, -0.00147176, 0.00090166, 7.26300423, 0.99549776, 0.99762658, 0.49266448],
-												 [	-6.26450150, -0.00147107, 0.00090124, 7.26303043, 0.99549989, 0.99762769, 0.49266547],
-												 [	-6.26452691, -0.00147038, 0.00090082, 7.26305653, 0.99550202, 0.99762880, 0.49266646],
-												 [	-6.26455222, -0.00146969, 0.00090040, 7.26308254, 0.99550415, 0.99762991, 0.49266744],
-												 [	-6.26457745, -0.00146900, 0.00089998, 7.26310846, 0.99550627, 0.99763102, 0.49266841],
-												 [	-6.26460259, -0.00146831, 0.00089956, 7.26313428, 0.99550839, 0.99763213, 0.49266939],
-												 [	-6.26462764, -0.00146762, 0.00089914, 7.26316002, 0.99551051, 0.99763324, 0.49267035],
-												 [	-6.26465259, -0.00146693, 0.00089872, 7.26318567, 0.99551263, 0.99763435, 0.49267132],
-												 [	-6.26467746, -0.00146624, 0.00089831, 7.26321122, 0.99551475, 0.99763545, 0.49267230],
-												 [	-6.26470224, -0.00146555, 0.00089789, 7.26323669, 0.99551686, 0.99763656, 0.49267325],
-												 [	-6.26472693, -0.00146486, 0.00089747, 7.26326207, 0.99551898, 0.99763766, 0.49267421],
-												 [	-6.26475153, -0.00146418, 0.00089705, 7.26328735, 0.99552109, 0.99763877, 0.49267517],
-												 [	-6.26477604, -0.00146349, 0.00089664, 7.26331255, 0.99552319, 0.99763987, 0.49267611],
-												 [	-6.26480047, -0.00146281, 0.00089622, 7.26333766, 0.99552530, 0.99764097, 0.49267707],
-												 [	-6.26482481, -0.00146212, 0.00089580, 7.26336268, 0.99552741, 0.99764207, 0.49267802],
-												 [	-6.26484906, -0.00146144, 0.00089539, 7.26338762, 0.99552951, 0.99764317, 0.49267897],
-												 [	-6.26487322, -0.00146076, 0.00089497, 7.26341246, 0.99553161, 0.99764427, 0.49267991],
-												 [	-6.26489730, -0.00146007, 0.00089456, 7.26343722, 0.99553371, 0.99764537, 0.49268085],
-												 [	-6.26492129, -0.00145939, 0.00089414, 7.26346189, 0.99553581, 0.99764646, 0.49268179],
-												 [	-6.26494519, -0.00145871, 0.00089373, 7.26348648, 0.99553790, 0.99764756, 0.49268272],
-												 [	-6.26496901, -0.00145803, 0.00089332, 7.26351098, 0.99553999, 0.99764865, 0.49268365],
-												 [	-6.26499274, -0.00145735, 0.00089290, 7.26353539, 0.99554209, 0.99764975, 0.49268458],
-												 [	-6.26501639, -0.00145667, 0.00089249, 7.26355972, 0.99554417, 0.99765084, 0.49268549],
-												 [	-6.26503995, -0.00145599, 0.00089208, 7.26358396, 0.99554626, 0.99765193, 0.49268643],
-												 [	-6.26506343, -0.00145531, 0.00089166, 7.26360811, 0.99554835, 0.99765302, 0.49268735],
-												 [	-6.26508682, -0.00145463, 0.00089125, 7.26363219, 0.99555043, 0.99765411, 0.49268826],
-												 [	-6.26511013, -0.00145396, 0.00089084, 7.26365617, 0.99555251, 0.99765520, 0.49268918],
-												 [	-6.26513336, -0.00145328, 0.00089043, 7.26368008, 0.99555459, 0.99765629, 0.49269008],
-												 [	-6.26515650, -0.00145261, 0.00089002, 7.26370389, 0.99555667, 0.99765738, 0.49269099],
-												 [	-6.26517956, -0.00145193, 0.00088961, 7.26372763, 0.99555875, 0.99765846, 0.49269190],
-												 [	-6.26520254, -0.00145126, 0.00088920, 7.26375128, 0.99556082, 0.99765955, 0.49269281],
-												 [	-6.26522543, -0.00145058, 0.00088879, 7.26377485, 0.99556289, 0.99766063, 0.49269370],
-												 [	-6.26524824, -0.00144991, 0.00088838, 7.26379834, 0.99556496, 0.99766171, 0.49269460],
-												 [	-6.26527098, -0.00144924, 0.00088797, 7.26382174, 0.99556703, 0.99766280, 0.49269550],
-												 [	-6.26529363, -0.00144856, 0.00088756, 7.26384506, 0.99556910, 0.99766388, 0.49269640],
-												 [	-6.26531619, -0.00144789, 0.00088715, 7.26386830, 0.99557116, 0.99766496, 0.49269728],
-												 [	-6.26533868, -0.00144722, 0.00088674, 7.26389146, 0.99557323, 0.99766604, 0.49269817],
-												 [	-6.26536109, -0.00144655, 0.00088634, 7.26391454, 0.99557529, 0.99766711, 0.49269905],
-												 [	-6.26538341, -0.00144588, 0.00088593, 7.26393753, 0.99557735, 0.99766819, 0.49269994],
-												 [	-6.26540566, -0.00144521, 0.00088552, 7.26396045, 0.99557940, 0.99766927, 0.49270083],
-												 [	-6.26542783, -0.00144454, 0.00088511, 7.26398329, 0.99558146, 0.99767034, 0.49270168],
-												 [	-6.26544992, -0.00144387, 0.00088471, 7.26400604, 0.99558351, 0.99767142, 0.49270256],
-												 [	-6.26547192, -0.00144321, 0.00088430, 7.26402872, 0.99558556, 0.99767249, 0.49270344],
-												 [	-6.26549385, -0.00144254, 0.00088390, 7.26405131, 0.99558761, 0.99767356, 0.49270431],
-												 [	-6.26551570, -0.00144187, 0.00088349, 7.26407383, 0.99558966, 0.99767463, 0.49270518],
-												 [	-6.26553748, -0.00144121, 0.00088309, 7.26409627, 0.99559171, 0.99767571, 0.49270604],
-												 [	-6.26555917, -0.00144054, 0.00088268, 7.26411863, 0.99559375, 0.99767678, 0.49270690],
-												 [	-6.26558079, -0.00143988, 0.00088228, 7.26414091, 0.99559579, 0.99767784, 0.49270776],
-												 [	-6.26560233, -0.00143922, 0.00088187, 7.26416311, 0.99559783, 0.99767891, 0.49270862],
-												 [	-6.26562379, -0.00143855, 0.00088147, 7.26418524, 0.99559987, 0.99767998, 0.49270947],
-												 [	-6.26564518, -0.00143789, 0.00088107, 7.26420729, 0.99560191, 0.99768104, 0.49271032],
-												 [	-6.26566648, -0.00143723, 0.00088066, 7.26422926, 0.99560394, 0.99768211, 0.49271118],
-												 [	-6.26568772, -0.00143657, 0.00088026, 7.26425115, 0.99560598, 0.99768317, 0.49271202],
-												 [	-6.26570887, -0.00143590, 0.00087986, 7.26427297, 0.99560801, 0.99768424, 0.49271286],
-												 [	-6.26572995, -0.00143524, 0.00087946, 7.26429471, 0.99561004, 0.99768530, 0.49271371],
-												 [	-6.26575096, -0.00143458, 0.00087906, 7.26431637, 0.99561206, 0.99768636, 0.49271455],
-												 [	-6.26577189, -0.00143393, 0.00087865, 7.26433796, 0.99561409, 0.99768742, 0.49271537],
-												 [	-6.26579274, -0.00143327, 0.00087825, 7.26435948, 0.99561611, 0.99768848, 0.49271621],
-												 [	-6.26581352, -0.00143261, 0.00087785, 7.26438092, 0.99561813, 0.99768954, 0.49271704],
-												 [	-6.26583423, -0.00143195, 0.00087745, 7.26440228, 0.99562015, 0.99769059, 0.49271787],
-												 [	-6.26585486, -0.00143130, 0.00087705, 7.26442357, 0.99562217, 0.99769165, 0.49271871],
-												 [	-6.26587542, -0.00143064, 0.00087665, 7.26444478, 0.99562419, 0.99769271, 0.49271954],
-												 [	-6.26589591, -0.00142998, 0.00087626, 7.26446592, 0.99562620, 0.99769376, 0.49272035],
-												 [	-6.26591632, -0.00142933, 0.00087586, 7.26448699, 0.99562822, 0.99769482, 0.49272117],
-												 [	-6.26593666, -0.00142867, 0.00087546, 7.26450798, 0.99563023, 0.99769587, 0.49272198],
-												 [	-6.26595692, -0.00142802, 0.00087506, 7.26452890, 0.99563224, 0.99769692, 0.49272279],
-												 [	-6.26597711, -0.00142737, 0.00087466, 7.26454975, 0.99563424, 0.99769797, 0.49272362],
-												 [	-6.26599724, -0.00142671, 0.00087426, 7.26457052, 0.99563625, 0.99769902, 0.49272441],
-												 [	-6.26601728, -0.00142606, 0.00087387, 7.26459122, 0.99563825, 0.99770007, 0.49272522],
-												 [	-6.26603726, -0.00142541, 0.00087347, 7.26461185, 0.99564025, 0.99770112, 0.49272604],
-												 [	-6.26605717, -0.00142476, 0.00087307, 7.26463241, 0.99564225, 0.99770217, 0.49272683],
-												 [	-6.26607700, -0.00142411, 0.00087268, 7.26465289, 0.99564425, 0.99770321, 0.49272764],
-												 [	-6.26609676, -0.00142346, 0.00087228, 7.26467331, 0.99564625, 0.99770426, 0.49272843],
-												 [	-6.26611646, -0.00142281, 0.00087189, 7.26469365, 0.99564824, 0.99770530, 0.49272921],
-												 [	-6.26613608, -0.00142216, 0.00087149, 7.26471392, 0.99565024, 0.99770635, 0.49273003],
-												 [	-6.26615563, -0.00142151, 0.00087110, 7.26473412, 0.99565223, 0.99770739, 0.49273081],
-												 [	-6.26617512, -0.00142087, 0.00087070, 7.26475425, 0.99565422, 0.99770843, 0.49273160],
-												 [	-6.26619453, -0.00142022, 0.00087031, 7.26477431, 0.99565620, 0.99770947, 0.49273238],
-												 [	-6.26621387, -0.00141957, 0.00086992, 7.26479430, 0.99565819, 0.99771051, 0.49273317],
-												 [	-6.26623315, -0.00141893, 0.00086952, 7.26481422, 0.99566017, 0.99771155, 0.49273396],
-												 [	-6.26625235, -0.00141828, 0.00086913, 7.26483407, 0.99566216, 0.99771259, 0.49273473],
-												 [	-6.26627149, -0.00141764, 0.00086874, 7.26485385, 0.99566414, 0.99771362, 0.49273551],
-												 [	-6.26629056, -0.00141699, 0.00086835, 7.26487356, 0.99566612, 0.99771466, 0.49273628],
-												 [	-6.26630956, -0.00141635, 0.00086795, 7.26489321, 0.99566809, 0.99771570, 0.49273706],
-												 [	-6.26632849, -0.00141571, 0.00086756, 7.26491278, 0.99567007, 0.99771673, 0.49273783],
-												 [	-6.26634735, -0.00141506, 0.00086717, 7.26493229, 0.99567204, 0.99771776, 0.49273859],
-												 [	-6.26636615, -0.00141442, 0.00086678, 7.26495173, 0.99567401, 0.99771880, 0.49273935],
-												 [	-6.26638488, -0.00141378, 0.00086639, 7.26497110, 0.99567598, 0.99771983, 0.49274013],
-												 [	-6.26640355, -0.00141314, 0.00086600, 7.26499041, 0.99567795, 0.99772086, 0.49274089],
-												 [	-6.26642214, -0.00141250, 0.00086561, 7.26500964, 0.99567992, 0.99772189, 0.49274164],
-												 [	-6.26644067, -0.00141186, 0.00086522, 7.26502881, 0.99568188, 0.99772292, 0.49274241],
-												 [	-6.26645914, -0.00141122, 0.00086483, 7.26504792, 0.99568384, 0.99772395, 0.49274316],
-												 [	-6.26647754, -0.00141058, 0.00086444, 7.26506695, 0.99568580, 0.99772497, 0.49274392],
-												 [	-6.26649587, -0.00140995, 0.00086405, 7.26508592, 0.99568776, 0.99772600, 0.49274466],
-												 [	-6.26651414, -0.00140931, 0.00086366, 7.26510483, 0.99568972, 0.99772703, 0.49274542],
-												 [	-6.26653234, -0.00140867, 0.00086328, 7.26512367, 0.99569168, 0.99772805, 0.49274618],
-												 [	-6.26655048, -0.00140804, 0.00086289, 7.26514244, 0.99569363, 0.99772908, 0.49274690],
-												 [	-6.26656855, -0.00140740, 0.00086250, 7.26516115, 0.99569558, 0.99773010, 0.49274765],
-												 [	-6.26658656, -0.00140677, 0.00086211, 7.26517979, 0.99569753, 0.99773112, 0.49274839],
-												 [	-6.26660450, -0.00140613, 0.00086173, 7.26519837, 0.99569948, 0.99773214, 0.49274912],
-												 [	-6.26662238, -0.00140550, 0.00086134, 7.26521688, 0.99570143, 0.99773316, 0.49274986],
-												 [	-6.26664020, -0.00140486, 0.00086096, 7.26523533, 0.99570337, 0.99773418, 0.49275059],
-												 [	-6.26665795, -0.00140423, 0.00086057, 7.26525372, 0.99570532, 0.99773520, 0.49275132],
-												 [	-6.26667564, -0.00140360, 0.00086018, 7.26527204, 0.99570726, 0.99773622, 0.49275206],
-												 [	-6.26669326, -0.00140297, 0.00085980, 7.26529030, 0.99570920, 0.99773723, 0.49275276],
-												 [	-6.26671083, -0.00140234, 0.00085942, 7.26530849, 0.99571114, 0.99773825, 0.49275350],
-												 [	-6.26672833, -0.00140171, 0.00085903, 7.26532662, 0.99571307, 0.99773926, 0.49275423],
-												 [	-6.26674577, -0.00140108, 0.00085865, 7.26534469, 0.99571501, 0.99774028, 0.49275495],
-												 [	-6.26676314, -0.00140045, 0.00085826, 7.26536270, 0.99571694, 0.99774129, 0.49275567],
-												 [	-6.26678046, -0.00139982, 0.00085788, 7.26538064, 0.99571887, 0.99774230, 0.49275639],
-												 [	-6.26679771, -0.00139919, 0.00085750, 7.26539852, 0.99572080, 0.99774331, 0.49275711],
-												 [	-6.26681490, -0.00139856, 0.00085711, 7.26541634, 0.99572273, 0.99774433, 0.49275782],
-												 [	-6.26683203, -0.00139793, 0.00085673, 7.26543410, 0.99572466, 0.99774533, 0.49275852],
-												 [	-6.26684910, -0.00139731, 0.00085635, 7.26545179, 0.99572658, 0.99774634, 0.49275924],
-												 [	-6.26686611, -0.00139668, 0.00085597, 7.26546943, 0.99572851, 0.99774735, 0.49275995],
-												 [	-6.26688306, -0.00139605, 0.00085559, 7.26548700, 0.99573043, 0.99774836, 0.49276065],
-												 [	-6.26689994, -0.00139543, 0.00085521, 7.26550451, 0.99573235, 0.99774936, 0.49276134],
-												 [	-6.26691677, -0.00139481, 0.00085482, 7.26552196, 0.99573426, 0.99775037, 0.49276204],
-												 [	-6.26693354, -0.00139418, 0.00085444, 7.26553936, 0.99573618, 0.99775137, 0.49276274],
-												 [	-6.26695024, -0.00139356, 0.00085406, 7.26555669, 0.99573809, 0.99775238, 0.49276344],
-												 [	-6.26696689, -0.00139293, 0.00085368, 7.26557396, 0.99574001, 0.99775338, 0.49276413],
-												 [	-6.26698348, -0.00139231, 0.00085331, 7.26559117, 0.99574192, 0.99775438, 0.49276484],
-												 [	-6.26700001, -0.00139169, 0.00085293, 7.26560832, 0.99574383, 0.99775538, 0.49276553],
-												 [	-6.26701648, -0.00139107, 0.00085255, 7.26562541, 0.99574574, 0.99775638, 0.49276621],
-												 [	-6.26703289, -0.00139045, 0.00085217, 7.26564245, 0.99574764, 0.99775738, 0.49276691],
-												 [	-6.26704925, -0.00138983, 0.00085179, 7.26565942, 0.99574955, 0.99775838, 0.49276759],
-												 [	-6.26706554, -0.00138921, 0.00085141, 7.26567633, 0.99575145, 0.99775938, 0.49276826],
-												 [	-6.26708178, -0.00138859, 0.00085104, 7.26569319, 0.99575335, 0.99776038, 0.49276895],
-												 [	-6.26709796, -0.00138797, 0.00085066, 7.26570999, 0.99575525, 0.99776137, 0.49276963],
-												 [	-6.26711408, -0.00138735, 0.00085028, 7.26572673, 0.99575715, 0.99776237, 0.49277030],
-												 [	-6.26713015, -0.00138674, 0.00084990, 7.26574341, 0.99575904, 0.99776336, 0.49277097],
-												 [	-6.26714616, -0.00138612, 0.00084953, 7.26576004, 0.99576094, 0.99776435, 0.49277165],
-												 [	-6.26716211, -0.00138550, 0.00084915, 7.26577661, 0.99576283, 0.99776535, 0.49277232],
-												 [	-6.26717800, -0.00138489, 0.00084878, 7.26579312, 0.99576472, 0.99776634, 0.49277298],
-												 [	-6.26719384, -0.00138427, 0.00084840, 7.26580957, 0.99576661, 0.99776733, 0.49277366],
-												 [	-6.26720962, -0.00138366, 0.00084803, 7.26582597, 0.99576850, 0.99776832, 0.49277432],
-												 [	-6.26722535, -0.00138304, 0.00084765, 7.26584231, 0.99577038, 0.99776931, 0.49277499],
-												 [	-6.26724102, -0.00138243, 0.00084728, 7.26585859, 0.99577227, 0.99777029, 0.49277565],
-												 [	-6.26725663, -0.00138181, 0.00084690, 7.26587482, 0.99577415, 0.99777128, 0.49277630],
-												 [	-6.26727219, -0.00138120, 0.00084653, 7.26589099, 0.99577603, 0.99777227, 0.49277698],
-												 [	-6.26728769, -0.00138059, 0.00084616, 7.26590710, 0.99577791, 0.99777325, 0.49277763],
-												 [	-6.26730314, -0.00137998, 0.00084578, 7.26592316, 0.99577979, 0.99777424, 0.49277828],
-												 [	-6.26731854, -0.00137937, 0.00084541, 7.26593917, 0.99578166, 0.99777522, 0.49277893],
-												 [	-6.26733388, -0.00137876, 0.00084504, 7.26595512, 0.99578354, 0.99777621, 0.49277959],
-												 [	-6.26734916, -0.00137815, 0.00084467, 7.26597101, 0.99578541, 0.99777719, 0.49278024],
-												 [	-6.26736439, -0.00137754, 0.00084429, 7.26598685, 0.99578728, 0.99777817, 0.49278088],
-												 [	-6.26737957, -0.00137693, 0.00084392, 7.26600264, 0.99578915, 0.99777915, 0.49278153],
-												 [	-6.26739469, -0.00137632, 0.00084355, 7.26601837, 0.99579102, 0.99778013, 0.49278219],
-												 [	-6.26740976, -0.00137571, 0.00084318, 7.26603405, 0.99579289, 0.99778111, 0.49278281],
-												 [	-6.26742477, -0.00137510, 0.00084281, 7.26604967, 0.99579475, 0.99778209, 0.49278347],
-												 [	-6.26743974, -0.00137450, 0.00084244, 7.26606524, 0.99579661, 0.99778306, 0.49278410],
-												 [	-6.26745464, -0.00137389, 0.00084207, 7.26608075, 0.99579847, 0.99778404, 0.49278472],
-												 [	-6.26746950, -0.00137328, 0.00084170, 7.26609622, 0.99580033, 0.99778502, 0.49278536],
-												 [	-6.26748430, -0.00137268, 0.00084133, 7.26611162, 0.99580219, 0.99778599, 0.49278600],
-												 [	-6.26749906, -0.00137207, 0.00084096, 7.26612698, 0.99580405, 0.99778696, 0.49278663],
-												 [	-6.26751375, -0.00137147, 0.00084059, 7.26614228, 0.99580590, 0.99778794, 0.49278724],
-												 [	-6.26752840, -0.00137087, 0.00084022, 7.26615753, 0.99580776, 0.99778891, 0.49278789],
-												 [	-6.26754300, -0.00137026, 0.00083986, 7.26617273, 0.99580961, 0.99778988, 0.49278852],
-												 [	-6.26755754, -0.00136966, 0.00083949, 7.26618788, 0.99581146, 0.99779085, 0.49278914],
-												 [	-6.26757203, -0.00136906, 0.00083912, 7.26620297, 0.99581331, 0.99779182, 0.49278975],
-												 [	-6.26758647, -0.00136846, 0.00083875, 7.26621801, 0.99581515, 0.99779279, 0.49279037],
-												 [	-6.26760086, -0.00136786, 0.00083839, 7.26623300, 0.99581700, 0.99779376, 0.49279099],
-												 [	-6.26761520, -0.00136725, 0.00083802, 7.26624794, 0.99581884, 0.99779472, 0.49279161],
-												 [	-6.26762949, -0.00136665, 0.00083765, 7.26626283, 0.99582068, 0.99779569, 0.49279223],
-												 [	-6.26764372, -0.00136605, 0.00083729, 7.26627767, 0.99582252, 0.99779666, 0.49279284],
-												 [	-6.26765791, -0.00136546, 0.00083692, 7.26629245, 0.99582436, 0.99779762, 0.49279345],
-												 [	-6.26767205, -0.00136486, 0.00083656, 7.26630719, 0.99582620, 0.99779859, 0.49279407],
-												 [	-6.26768613, -0.00136426, 0.00083619, 7.26632187, 0.99582804, 0.99779955, 0.49279468],
-												 [	-6.26770017, -0.00136366, 0.00083583, 7.26633651, 0.99582987, 0.99780051, 0.49279528],
-												 [	-6.26771416, -0.00136306, 0.00083546, 7.26635109, 0.99583170, 0.99780147, 0.49279588],
-												 [	-6.26772809, -0.00136247, 0.00083510, 7.26636562, 0.99583353, 0.99780243, 0.49279649],
-												 [	-6.26774198, -0.00136187, 0.00083474, 7.26638011, 0.99583536, 0.99780339, 0.49279710],
-												 [	-6.26775582, -0.00136128, 0.00083437, 7.26639454, 0.99583719, 0.99780435, 0.49279770],
-												 [	-6.26776961, -0.00136068, 0.00083401, 7.26640893, 0.99583902, 0.99780531, 0.49279829],
-												 [	-6.26778335, -0.00136009, 0.00083365, 7.26642326, 0.99584084, 0.99780627, 0.49279888],
-												 [	-6.26779704, -0.00135949, 0.00083328, 7.26643755, 0.99584266, 0.99780722, 0.49279946],
-												 [	-6.26781069, -0.00135890, 0.00083292, 7.26645179, 0.99584449, 0.99780818, 0.49280008],
-												 [	-6.26782428, -0.00135831, 0.00083256, 7.26646598, 0.99584631, 0.99780913, 0.49280067],
-												 [	-6.26783783, -0.00135771, 0.00083220, 7.26648012, 0.99584812, 0.99781009, 0.49280125],
-												 [	-6.26785133, -0.00135712, 0.00083184, 7.26649421, 0.99584994, 0.99781104, 0.49280185],
-												 [	-6.26786479, -0.00135653, 0.00083148, 7.26650826, 0.99585175, 0.99781199, 0.49280244],
-												 [	-6.26787819, -0.00135594, 0.00083111, 7.26652225, 0.99585357, 0.99781295, 0.49280301],
-												 [	-6.26789155, -0.00135535, 0.00083075, 7.26653620, 0.99585538, 0.99781390, 0.49280360],
-												 [	-6.26790486, -0.00135476, 0.00083039, 7.26655010, 0.99585719, 0.99781485, 0.49280419],
-												 [	-6.26791812, -0.00135417, 0.00083003, 7.26656395, 0.99585900, 0.99781580, 0.49280476],
-												 [	-6.26793134, -0.00135358, 0.00082967, 7.26657776, 0.99586081, 0.99781675, 0.49280534],
-												 [	-6.26794451, -0.00135299, 0.00082931, 7.26659152, 0.99586261, 0.99781769, 0.49280594],
-												 [	-6.26795764, -0.00135240, 0.00082896, 7.26660523, 0.99586442, 0.99781864, 0.49280650],
-												 [	-6.26797071, -0.00135182, 0.00082860, 7.26661890, 0.99586622, 0.99781959, 0.49280708],
-												 [	-6.26798374, -0.00135123, 0.00082824, 7.26663252, 0.99586802, 0.99782053, 0.49280764],
-												 [	-6.26799673, -0.00135064, 0.00082788, 7.26664609, 0.99586982, 0.99782148, 0.49280822],
-												 [	-6.26800967, -0.00135006, 0.00082752, 7.26665961, 0.99587162, 0.99782242, 0.49280878],
-												 [	-6.26802256, -0.00134947, 0.00082717, 7.26667309, 0.99587341, 0.99782336, 0.49280935],
-												 [	-6.26803541, -0.00134889, 0.00082681, 7.26668653, 0.99587521, 0.99782431, 0.49280992],
-												 [	-6.26804822, -0.00134830, 0.00082645, 7.26669991, 0.99587700, 0.99782525, 0.49281048],
-												 [	-6.26806098, -0.00134772, 0.00082609, 7.26671326, 0.99587879, 0.99782619, 0.49281107],
-												 [	-6.26807369, -0.00134713, 0.00082574, 7.26672655, 0.99588058, 0.99782713, 0.49281162],
-												 [	-6.26808636, -0.00134655, 0.00082538, 7.26673981, 0.99588237, 0.99782807, 0.49281218],
-												 [	-6.26809898, -0.00134597, 0.00082503, 7.26675301, 0.99588416, 0.99782900, 0.49281274],
-												 [	-6.26811156, -0.00134539, 0.00082467, 7.26676617, 0.99588595, 0.99782994, 0.49281329],
-												 [	-6.26812410, -0.00134481, 0.00082432, 7.26677929, 0.99588773, 0.99783088, 0.49281384],
-												 [	-6.26813659, -0.00134422, 0.00082396, 7.26679236, 0.99588951, 0.99783181, 0.49281439],
-												 [	-6.26814904, -0.00134364, 0.00082361, 7.26680539, 0.99589129, 0.99783275, 0.49281496],
-												 [	-6.26816144, -0.00134306, 0.00082325, 7.26681838, 0.99589307, 0.99783368, 0.49281552],
-												 [	-6.26817380, -0.00134248, 0.00082290, 7.26683132, 0.99589485, 0.99783462, 0.49281605],
-												 [	-6.26818612, -0.00134191, 0.00082255, 7.26684421, 0.99589663, 0.99783555, 0.49281661],
-												 [	-6.26819839, -0.00134133, 0.00082219, 7.26685706, 0.99589840, 0.99783648, 0.49281716],
-												 [	-6.26821062, -0.00134075, 0.00082184, 7.26686987, 0.99590018, 0.99783741, 0.49281769],
-												 [	-6.26822281, -0.00134017, 0.00082149, 7.26688264, 0.99590195, 0.99783834, 0.49281824],
-												 [	-6.26823495, -0.00133959, 0.00082113, 7.26689536, 0.99590372, 0.99783927, 0.49281878],
-												 [	-6.26824705, -0.00133902, 0.00082078, 7.26690804, 0.99590549, 0.99784020, 0.49281933],
-												 [	-6.26825911, -0.00133844, 0.00082043, 7.26692067, 0.99590725, 0.99784113, 0.49281987],
-												 [	-6.26827113, -0.00133787, 0.00082008, 7.26693326, 0.99590902, 0.99784206, 0.49282040],
-												 [	-6.26828310, -0.00133729, 0.00081973, 7.26694581, 0.99591078, 0.99784298, 0.49282094],
-												 [	-6.26829504, -0.00133672, 0.00081938, 7.26695832, 0.99591255, 0.99784391, 0.49282147],
-												 [	-6.26830693, -0.00133614, 0.00081902, 7.26697079, 0.99591431, 0.99784483, 0.49282201],
-												 [	-6.26831878, -0.00133557, 0.00081867, 7.26698321, 0.99591607, 0.99784576, 0.49282254],
-												 [	-6.26833058, -0.00133499, 0.00081832, 7.26699559, 0.99591783, 0.99784668, 0.49282308],
-												 [	-6.26834235, -0.00133442, 0.00081797, 7.26700793, 0.99591958, 0.99784760, 0.49282360],
-												 [	-6.26835407, -0.00133385, 0.00081762, 7.26702023, 0.99592134, 0.99784853, 0.49282414],
-												 [	-6.26836576, -0.00133328, 0.00081728, 7.26703248, 0.99592309, 0.99784945, 0.49282465],
-												 [	-6.26837740, -0.00133271, 0.00081693, 7.26704469, 0.99592485, 0.99785037, 0.49282520],
-												 [	-6.26838900, -0.00133214, 0.00081658, 7.26705687, 0.99592660, 0.99785129, 0.49282572],
-												 [	-6.26840056, -0.00133157, 0.00081623, 7.26706900, 0.99592835, 0.99785221, 0.49282624],
-												 [	-6.26841209, -0.00133100, 0.00081588, 7.26708109, 0.99593009, 0.99785312, 0.49282676],
-												 [	-6.26842357, -0.00133043, 0.00081553, 7.26709314, 0.99593184, 0.99785404, 0.49282728],
-												 [	-6.26843501, -0.00132986, 0.00081519, 7.26710515, 0.99593359, 0.99785496, 0.49282780],
-												 [	-6.26844641, -0.00132929, 0.00081484, 7.26711712, 0.99593533, 0.99785587, 0.49282829],
-												 [	-6.26845777, -0.00132872, 0.00081449, 7.26712905, 0.99593707, 0.99785679, 0.49282883],
-												 [	-6.26846909, -0.00132815, 0.00081414, 7.26714093, 0.99593881, 0.99785770, 0.49282934],
-												 [	-6.26848037, -0.00132759, 0.00081380, 7.26715278, 0.99594055, 0.99785862, 0.49282986],
-												 [	-6.26849161, -0.00132702, 0.00081345, 7.26716459, 0.99594229, 0.99785953, 0.49283037],
-												 [	-6.26850281, -0.00132645, 0.00081311, 7.26717636, 0.99594402, 0.99786044, 0.49283087],
-												 [	-6.26851397, -0.00132589, 0.00081276, 7.26718809, 0.99594576, 0.99786135, 0.49283138],
-												 [	-6.26852510, -0.00132532, 0.00081242, 7.26719977, 0.99594749, 0.99786226, 0.49283189],
-												 [	-6.26853618, -0.00132476, 0.00081207, 7.26721142, 0.99594922, 0.99786317, 0.49283239],
-												 [	-6.26854723, -0.00132419, 0.00081173, 7.26722303, 0.99595095, 0.99786408, 0.49283291],
-												 [	-6.26855824, -0.00132363, 0.00081138, 7.26723461, 0.99595268, 0.99786499, 0.49283341],
-												 [	-6.26856921, -0.00132307, 0.00081104, 7.26724614, 0.99595441, 0.99786590, 0.49283391],
-												 [	-6.26858014, -0.00132251, 0.00081069, 7.26725763, 0.99595614, 0.99786680, 0.49283441],
-												 [	-6.26859103, -0.00132194, 0.00081035, 7.26726909, 0.99595786, 0.99786771, 0.49283490],
-												 [	-6.26860188, -0.00132138, 0.00081001, 7.26728050, 0.99595958, 0.99786861, 0.49283543],
-												 [	-6.26861270, -0.00132082, 0.00080966, 7.26729188, 0.99596131, 0.99786952, 0.49283590],
-												 [	-6.26862348, -0.00132026, 0.00080932, 7.26730322, 0.99596303, 0.99787042, 0.49283641],
-												 [	-6.26863422, -0.00131970, 0.00080898, 7.26731452, 0.99596474, 0.99787132, 0.49283690],
-												 [	-6.26864493, -0.00131914, 0.00080864, 7.26732579, 0.99596646, 0.99787223, 0.49283740],
-												 [	-6.26865559, -0.00131858, 0.00080829, 7.26733701, 0.99596818, 0.99787313, 0.49283789],
-												 [	-6.26866622, -0.00131802, 0.00080795, 7.26734820, 0.99596989, 0.99787403, 0.49283838],
-												 [	-6.26867681, -0.00131746, 0.00080761, 7.26735935, 0.99597160, 0.99787493, 0.49283886],
-												 [	-6.26868737, -0.00131690, 0.00080727, 7.26737047, 0.99597332, 0.99787583, 0.49283935],
-												 [	-6.26869789, -0.00131635, 0.00080693, 7.26738154, 0.99597503, 0.99787673, 0.49283983],
-												 [	-6.26870837, -0.00131579, 0.00080659, 7.26739258, 0.99597673, 0.99787762, 0.49284032],
-												 [	-6.26871882, -0.00131523, 0.00080625, 7.26740358, 0.99597844, 0.99787852, 0.49284083],
-												 [	-6.26872923, -0.00131468, 0.00080591, 7.26741455, 0.99598015, 0.99787942, 0.49284129],
-												 [	-6.26873960, -0.00131412, 0.00080557, 7.26742548, 0.99598185, 0.99788031, 0.49284178],
-												 [	-6.26874993, -0.00131357, 0.00080523, 7.26743637, 0.99598355, 0.99788121, 0.49284226],
-												 [	-6.26876024, -0.00131301, 0.00080489, 7.26744723, 0.99598526, 0.99788210, 0.49284273],
-												 [	-6.26877050, -0.00131246, 0.00080455, 7.26745804, 0.99598696, 0.99788299, 0.49284320],
-												 [	-6.26878073, -0.00131190, 0.00080421, 7.26746883, 0.99598865, 0.99788389, 0.49284369],
-												 [	-6.26879092, -0.00131135, 0.00080387, 7.26747958, 0.99599035, 0.99788478, 0.49284417],
-												 [	-6.26880108, -0.00131080, 0.00080354, 7.26749029, 0.99599205, 0.99788567, 0.49284465],
-												 [	-6.26881120, -0.00131024, 0.00080320, 7.26750096, 0.99599374, 0.99788656, 0.49284510],
-												 [	-6.26882129, -0.00130969, 0.00080286, 7.26751160, 0.99599543, 0.99788745, 0.49284559],
-												 [	-6.26883135, -0.00130914, 0.00080252, 7.26752221, 0.99599713, 0.99788834, 0.49284606],
-												 [	-6.26884136, -0.00130859, 0.00080219, 7.26753278, 0.99599882, 0.99788923, 0.49284653],
-												 [	-6.26885135, -0.00130804, 0.00080185, 7.26754331, 0.99600050, 0.99789011, 0.49284699],
-												 [	-6.26886129, -0.00130749, 0.00080151, 7.26755381, 0.99600219, 0.99789100, 0.49284746],
-												 [	-6.26887121, -0.00130694, 0.00080118, 7.26756427, 0.99600388, 0.99789189, 0.49284793],
-												 [	-6.26888109, -0.00130639, 0.00080084, 7.26757470, 0.99600556, 0.99789277, 0.49284838],
-												 [	-6.26889093, -0.00130584, 0.00080051, 7.26758509, 0.99600724, 0.99789365, 0.49284885],
-												 [	-6.26890074, -0.00130529, 0.00080017, 7.26759545, 0.99600893, 0.99789454, 0.49284932],
-												 [	-6.26891052, -0.00130474, 0.00079984, 7.26760578, 0.99601061, 0.99789542, 0.49284977],
-												 [	-6.26892026, -0.00130420, 0.00079950, 7.26761607, 0.99601228, 0.99789630, 0.49285024],
-												 [	-6.26892997, -0.00130365, 0.00079917, 7.26762633, 0.99601396, 0.99789719, 0.49285069],
-												 [	-6.26893965, -0.00130310, 0.00079883, 7.26763655, 0.99601564, 0.99789807, 0.49285114],
-												 [	-6.26894929, -0.00130256, 0.00079850, 7.26764674, 0.99601731, 0.99789895, 0.49285162],
-												 [	-6.26895890, -0.00130201, 0.00079816, 7.26765689, 0.99601899, 0.99789983, 0.49285206],
-												 [	-6.26896848, -0.00130146, 0.00079783, 7.26766701, 0.99602066, 0.99790070, 0.49285251],
-												 [	-6.26897802, -0.00130092, 0.00079750, 7.26767710, 0.99602233, 0.99790158, 0.49285297],
-												 [	-6.26898753, -0.00130038, 0.00079717, 7.26768715, 0.99602400, 0.99790246, 0.49285344],
-												 [	-6.26899700, -0.00129983, 0.00079683, 7.26769717, 0.99602566, 0.99790334, 0.49285388],
-												 [	-6.26900645, -0.00129929, 0.00079650, 7.26770716, 0.99602733, 0.99790421, 0.49285432],
-												 [	-6.26901586, -0.00129875, 0.00079617, 7.26771711, 0.99602900, 0.99790509, 0.49285477],
-												 [	-6.26902524, -0.00129820, 0.00079584, 7.26772703, 0.99603066, 0.99790596, 0.49285523],
-												 [	-6.26903458, -0.00129766, 0.00079550, 7.26773692, 0.99603232, 0.99790683, 0.49285566],
-												 [	-6.26904390, -0.00129712, 0.00079517, 7.26774678, 0.99603398, 0.99790771, 0.49285611],
-												 [	-6.26905318, -0.00129658, 0.00079484, 7.26775660, 0.99603564, 0.99790858, 0.49285655],
-												 [	-6.26906243, -0.00129604, 0.00079451, 7.26776639, 0.99603730, 0.99790945, 0.49285701],
-												 [	-6.26907164, -0.00129550, 0.00079418, 7.26777615, 0.99603896, 0.99791032, 0.49285743],
-												 [	-6.26908083, -0.00129496, 0.00079385, 7.26778587, 0.99604061, 0.99791119, 0.49285787],
-												 [	-6.26908998, -0.00129442, 0.00079352, 7.26779557, 0.99604227, 0.99791206, 0.49285833],
-												 [	-6.26909911, -0.00129388, 0.00079319, 7.26780523, 0.99604392, 0.99791293, 0.49285876],
-												 [	-6.26910820, -0.00129334, 0.00079286, 7.26781486, 0.99604557, 0.99791380, 0.49285921],
-												 [	-6.26911726, -0.00129280, 0.00079253, 7.26782446, 0.99604722, 0.99791467, 0.49285963],
-												 [	-6.26912629, -0.00129226, 0.00079220, 7.26783402, 0.99604887, 0.99791553, 0.49286007],
-												 [	-6.26913528, -0.00129173, 0.00079188, 7.26784356, 0.99605051, 0.99791640, 0.49286049],
-												 [	-6.26914425, -0.00129119, 0.00079155, 7.26785306, 0.99605216, 0.99791726, 0.49286093],
-												 [	-6.26915318, -0.00129065, 0.00079122, 7.26786253, 0.99605380, 0.99791813, 0.49286138],
-												 [	-6.26916209, -0.00129012, 0.00079089, 7.26787197, 0.99605545, 0.99791899, 0.49286178],
-												 [	-6.26917096, -0.00128958, 0.00079056, 7.26788138, 0.99605709, 0.99791985, 0.49286223],
-												 [	-6.26917981, -0.00128905, 0.00079024, 7.26789076, 0.99605873, 0.99792072, 0.49286266],
-												 [	-6.26918862, -0.00128851, 0.00078991, 7.26790011, 0.99606037, 0.99792158, 0.49286308],
-												 [	-6.26919740, -0.00128798, 0.00078958, 7.26790942, 0.99606201, 0.99792244, 0.49286350],
-												 [	-6.26920615, -0.00128744, 0.00078926, 7.26791871, 0.99606364, 0.99792330, 0.49286392],
-												 [	-6.26921488, -0.00128691, 0.00078893, 7.26792797, 0.99606528, 0.99792416, 0.49286436],
-												 [	-6.26922357, -0.00128638, 0.00078860, 7.26793719, 0.99606691, 0.99792502, 0.49286478],
-												 [	-6.26923223, -0.00128585, 0.00078828, 7.26794639, 0.99606854, 0.99792588, 0.49286521],
-												 [	-6.26924086, -0.00128531, 0.00078795, 7.26795555, 0.99607017, 0.99792673, 0.49286564],
-												 [	-6.26924947, -0.00128478, 0.00078763, 7.26796468, 0.99607180, 0.99792759, 0.49286605],
-												 [	-6.26925804, -0.00128425, 0.00078730, 7.26797379, 0.99607343, 0.99792845, 0.49286646],
-												 [	-6.26926658, -0.00128372, 0.00078698, 7.26798286, 0.99607506, 0.99792930, 0.49286689],
-												 [	-6.26927510, -0.00128319, 0.00078665, 7.26799191, 0.99607668, 0.99793016, 0.49286730],
-												 [	-6.26928358, -0.00128266, 0.00078633, 7.26800092, 0.99607831, 0.99793101, 0.49286770],
-												 [	-6.26929204, -0.00128213, 0.00078601, 7.26800991, 0.99607993, 0.99793186, 0.49286812],
-												 [	-6.26930047, -0.00128160, 0.00078568, 7.26801887, 0.99608155, 0.99793272, 0.49286854],
-												 [	-6.26930887, -0.00128107, 0.00078536, 7.26802779, 0.99608317, 0.99793357, 0.49286895],
-												 [	-6.26931724, -0.00128054, 0.00078504, 7.26803669, 0.99608479, 0.99793442, 0.49286937],
-												 [	-6.26932558, -0.00128002, 0.00078471, 7.26804556, 0.99608641, 0.99793527, 0.49286977],
-												 [	-6.26933389, -0.00127949, 0.00078439, 7.26805440, 0.99608802, 0.99793612, 0.49287019],
-												 [	-6.26934217, -0.00127896, 0.00078407, 7.26806321, 0.99608964, 0.99793697, 0.49287058],
-												 [	-6.26935043, -0.00127844, 0.00078375, 7.26807199, 0.99609125, 0.99793782, 0.49287100],
-												 [	-6.26935866, -0.00127791, 0.00078342, 7.26808075, 0.99609287, 0.99793867, 0.49287142],
-												 [	-6.26936686, -0.00127738, 0.00078310, 7.26808947, 0.99609448, 0.99793951, 0.49287182],
-												 [	-6.26937503, -0.00127686, 0.00078278, 7.26809817, 0.99609609, 0.99794036, 0.49287224],
-												 [	-6.26938317, -0.00127634, 0.00078246, 7.26810683, 0.99609769, 0.99794120, 0.49287263],
-												 [	-6.26939129, -0.00127581, 0.00078214, 7.26811547, 0.99609930, 0.99794205, 0.49287302],
-												 [	-6.26939937, -0.00127529, 0.00078182, 7.26812409, 0.99610091, 0.99794289, 0.49287345],
-												 [	-6.26940743, -0.00127476, 0.00078150, 7.26813267, 0.99610251, 0.99794374, 0.49287384],
-												 [	-6.26941547, -0.00127424, 0.00078118, 7.26814123, 0.99610411, 0.99794458, 0.49287423],
-												 [	-6.26942347, -0.00127372, 0.00078086, 7.26814975, 0.99610572, 0.99794542, 0.49287464],
-												 [	-6.26943145, -0.00127320, 0.00078054, 7.26815825, 0.99610732, 0.99794626, 0.49287504],
-												 [	-6.26943940, -0.00127267, 0.00078022, 7.26816673, 0.99610892, 0.99794711, 0.49287543],
-												 [	-6.26944732, -0.00127215, 0.00077990, 7.26817517, 0.99611051, 0.99794795, 0.49287581],
-												 [	-6.26945522, -0.00127163, 0.00077958, 7.26818359, 0.99611211, 0.99794879, 0.49287621],
-												 [	-6.26946309, -0.00127111, 0.00077926, 7.26819198, 0.99611370, 0.99794962, 0.49287661],
-												 [	-6.26947093, -0.00127059, 0.00077895, 7.26820034, 0.99611530, 0.99795046, 0.49287701],
-												 [	-6.26947875, -0.00127007, 0.00077863, 7.26820868, 0.99611689, 0.99795130, 0.49287739],
-												 [	-6.26948654, -0.00126955, 0.00077831, 7.26821698, 0.99611848, 0.99795214, 0.49287779],
-												 [	-6.26949430, -0.00126903, 0.00077799, 7.26822527, 0.99612007, 0.99795297, 0.49287817],
-												 [	-6.26950204, -0.00126852, 0.00077768, 7.26823352, 0.99612166, 0.99795381, 0.49287857],
-												 [	-6.26950975, -0.00126800, 0.00077736, 7.26824175, 0.99612325, 0.99795464, 0.49287896],
-												 [	-6.26951743, -0.00126748, 0.00077704, 7.26824995, 0.99612484, 0.99795548, 0.49287934],
-												 [	-6.26952509, -0.00126696, 0.00077673, 7.26825813, 0.99612642, 0.99795631, 0.49287973],
-												 [	-6.26953272, -0.00126645, 0.00077641, 7.26826627, 0.99612800, 0.99795714, 0.49288012],
-												 [	-6.26954033, -0.00126593, 0.00077609, 7.26827440, 0.99612959, 0.99795798, 0.49288050],
-												 [	-6.26954791, -0.00126541, 0.00077578, 7.26828249, 0.99613117, 0.99795881, 0.49288087],
-												 [	-6.26955546, -0.00126490, 0.00077546, 7.26829056, 0.99613275, 0.99795964, 0.49288126],
-												 [	-6.26956299, -0.00126438, 0.00077515, 7.26829860, 0.99613433, 0.99796047, 0.49288164],
-												 [	-6.26957049, -0.00126387, 0.00077483, 7.26830662, 0.99613590, 0.99796130, 0.49288203],
-												 [	-6.26957797, -0.00126335, 0.00077452, 7.26831461, 0.99613748, 0.99796213, 0.49288240],
-												 [	-6.26958542, -0.00126284, 0.00077420, 7.26832258, 0.99613905, 0.99796296, 0.49288278],
-												 [	-6.26959285, -0.00126233, 0.00077389, 7.26833052, 0.99614063, 0.99796378, 0.49288317],
-												 [	-6.26960025, -0.00126181, 0.00077357, 7.26833844, 0.99614220, 0.99796461, 0.49288354],
-												 [	-6.26960763, -0.00126130, 0.00077326, 7.26834632, 0.99614377, 0.99796544, 0.49288392],
-												 [	-6.26961498, -0.00126079, 0.00077295, 7.26835419, 0.99614534, 0.99796626, 0.49288432],
-												 [	-6.26962230, -0.00126028, 0.00077263, 7.26836203, 0.99614691, 0.99796709, 0.49288467],
-												 [	-6.26962961, -0.00125977, 0.00077232, 7.26836984, 0.99614847, 0.99796791, 0.49288504],
-												 [	-6.26963688, -0.00125926, 0.00077201, 7.26837763, 0.99615004, 0.99796874, 0.49288540],
-												 [	-6.26964414, -0.00125874, 0.00077170, 7.26838539, 0.99615160, 0.99796956, 0.49288580],
-												 [	-6.26965137, -0.00125823, 0.00077138, 7.26839313, 0.99615317, 0.99797038, 0.49288618],
-												 [	-6.26965857, -0.00125772, 0.00077107, 7.26840084, 0.99615473, 0.99797120, 0.49288651],
-												 [	-6.26966575, -0.00125722, 0.00077076, 7.26840853, 0.99615629, 0.99797202, 0.49288691],
-												 [	-6.26967290, -0.00125671, 0.00077045, 7.26841620, 0.99615785, 0.99797284, 0.49288729],
-												 [	-6.26968003, -0.00125620, 0.00077014, 7.26842384, 0.99615941, 0.99797366, 0.49288765],
-												 [	-6.26968714, -0.00125569, 0.00076983, 7.26843145, 0.99616097, 0.99797448, 0.49288801],
-												 [	-6.26969422, -0.00125518, 0.00076952, 7.26843904, 0.99616252, 0.99797530, 0.49288835],
-												 [	-6.26970128, -0.00125468, 0.00076920, 7.26844661, 0.99616408, 0.99797612, 0.49288872],
-												 [	-6.26970832, -0.00125417, 0.00076889, 7.26845415, 0.99616563, 0.99797694, 0.49288910],
-												 [	-6.26971533, -0.00125366, 0.00076858, 7.26846167, 0.99616718, 0.99797775, 0.49288946],
-												 [	-6.26972232, -0.00125316, 0.00076827, 7.26846916, 0.99616873, 0.99797857, 0.49288983],
-												 [	-6.26972928, -0.00125265, 0.00076797, 7.26847663, 0.99617028, 0.99797938, 0.49289019],
-												 [	-6.26973622, -0.00125214, 0.00076766, 7.26848408, 0.99617183, 0.99798020, 0.49289056],
-												 [	-6.26974314, -0.00125164, 0.00076735, 7.26849150, 0.99617338, 0.99798101, 0.49289092],
-												 [	-6.26975003, -0.00125114, 0.00076704, 7.26849890, 0.99617492, 0.99798183, 0.49289126],
-												 [	-6.26975691, -0.00125063, 0.00076673, 7.26850627, 0.99617647, 0.99798264, 0.49289162],
-												 [	-6.26976375, -0.00125013, 0.00076642, 7.26851363, 0.99617801, 0.99798345, 0.49289199],
-												 [	-6.26977058, -0.00124962, 0.00076611, 7.26852095, 0.99617955, 0.99798426, 0.49289234],
-												 [	-6.26977738, -0.00124912, 0.00076581, 7.26852826, 0.99618109, 0.99798507, 0.49289269],
-												 [	-6.26978416, -0.00124862, 0.00076550, 7.26853554, 0.99618263, 0.99798588, 0.49289304],
-												 [	-6.26979092, -0.00124812, 0.00076519, 7.26854280, 0.99618417, 0.99798669, 0.49289341],
-												 [	-6.26979765, -0.00124762, 0.00076488, 7.26855003, 0.99618571, 0.99798750, 0.49289376],
-												 [	-6.26980436, -0.00124711, 0.00076458, 7.26855725, 0.99618724, 0.99798831, 0.49289409],
-												 [	-6.26981105, -0.00124661, 0.00076427, 7.26856444, 0.99618878, 0.99798912, 0.49289444],
-												 [	-6.26981772, -0.00124611, 0.00076396, 7.26857160, 0.99619031, 0.99798992, 0.49289482],
-												 [	-6.26982436, -0.00124561, 0.00076366, 7.26857875, 0.99619184, 0.99799073, 0.49289516],
-												 [	-6.26983098, -0.00124511, 0.00076335, 7.26858587, 0.99619337, 0.99799154, 0.49289554],
-												 [	-6.26983758, -0.00124461, 0.00076305, 7.26859297, 0.99619490, 0.99799234, 0.49289586],
-												 [	-6.26984416, -0.00124412, 0.00076274, 7.26860004, 0.99619643, 0.99799314, 0.49289620],
-												 [	-6.26985071, -0.00124362, 0.00076244, 7.26860710, 0.99619796, 0.99799395, 0.49289657],
-												 [	-6.26985725, -0.00124312, 0.00076213, 7.26861413, 0.99619949, 0.99799475, 0.49289690],
-												 [	-6.26986376, -0.00124262, 0.00076183, 7.26862114, 0.99620101, 0.99799555, 0.49289724],
-												 [	-6.26987025, -0.00124212, 0.00076152, 7.26862812, 0.99620253, 0.99799636, 0.49289757],
-												 [	-6.26987672, -0.00124163, 0.00076122, 7.26863509, 0.99620406, 0.99799716, 0.49289792],
-												 [	-6.26988316, -0.00124113, 0.00076091, 7.26864203, 0.99620558, 0.99799796, 0.49289828],
-												 [	-6.26988959, -0.00124063, 0.00076061, 7.26864895, 0.99620710, 0.99799876, 0.49289862],
-												 [	-6.26989599, -0.00124014, 0.00076031, 7.26865585, 0.99620862, 0.99799956, 0.49289895],
-												 [	-6.26990237, -0.00123964, 0.00076000, 7.26866273, 0.99621013, 0.99800035, 0.49289931],
-												 [	-6.26990873, -0.00123915, 0.00075970, 7.26866958, 0.99621165, 0.99800115, 0.49289965],
-												 [	-6.26991507, -0.00123865, 0.00075940, 7.26867642, 0.99621317, 0.99800195, 0.49289998],
-												 [	-6.26992139, -0.00123816, 0.00075909, 7.26868323, 0.99621468, 0.99800275, 0.49290032],
-												 [	-6.26992769, -0.00123767, 0.00075879, 7.26869002, 0.99621619, 0.99800354, 0.49290066],
-												 [	-6.26993396, -0.00123717, 0.00075849, 7.26869679, 0.99621770, 0.99800434, 0.49290100],
-												 [	-6.26994022, -0.00123668, 0.00075819, 7.26870354, 0.99621921, 0.99800513, 0.49290132],
-												 [	-6.26994645, -0.00123619, 0.00075789, 7.26871027, 0.99622072, 0.99800593, 0.49290166],
-												 [	-6.26995267, -0.00123569, 0.00075758, 7.26871697, 0.99622223, 0.99800672, 0.49290199],
-												 [	-6.26995886, -0.00123520, 0.00075728, 7.26872366, 0.99622374, 0.99800751, 0.49290231],
-												 [	-6.26996503, -0.00123471, 0.00075698, 7.26873032, 0.99622524, 0.99800831, 0.49290268],
-												 [	-6.26997119, -0.00123422, 0.00075668, 7.26873697, 0.99622675, 0.99800910, 0.49290298],
-												 [	-6.26997732, -0.00123373, 0.00075638, 7.26874359, 0.99622825, 0.99800989, 0.49290333],
-												 [	-6.26998343, -0.00123324, 0.00075608, 7.26875019, 0.99622975, 0.99801068, 0.49290366],
-												 [	-6.26998952, -0.00123275, 0.00075578, 7.26875677, 0.99623126, 0.99801147, 0.49290397],
-												 [	-6.26999559, -0.00123226, 0.00075548, 7.26876333, 0.99623275, 0.99801226, 0.49290432],
-												 [	-6.27000164, -0.00123177, 0.00075518, 7.26876987, 0.99623425, 0.99801305, 0.49290464],
-												 [	-6.27000767, -0.00123128, 0.00075488, 7.26877639, 0.99623575, 0.99801384, 0.49290499],
-												 [	-6.27001368, -0.00123079, 0.00075458, 7.26878289, 0.99623725, 0.99801462, 0.49290530],
-												 [	-6.27001968, -0.00123031, 0.00075428, 7.26878937, 0.99623874, 0.99801541, 0.49290562],
-												 [	-6.27002565, -0.00122982, 0.00075399, 7.26879583, 0.99624024, 0.99801620, 0.49290596],
-												 [	-6.27003160, -0.00122933, 0.00075369, 7.26880227, 0.99624173, 0.99801698, 0.49290628],
-												 [	-6.27003753, -0.00122884, 0.00075339, 7.26880869, 0.99624322, 0.99801777, 0.49290660],
-												 [	-6.27004344, -0.00122836, 0.00075309, 7.26881508, 0.99624471, 0.99801855, 0.49290693],
-												 [	-6.27004933, -0.00122787, 0.00075279, 7.26882146, 0.99624620, 0.99801934, 0.49290725],
-												 [	-6.27005521, -0.00122739, 0.00075250, 7.26882782, 0.99624769, 0.99802012, 0.49290756],
-												 [	-6.27006106, -0.00122690, 0.00075220, 7.26883416, 0.99624917, 0.99802090, 0.49290790],
-												 [	-6.27006690, -0.00122642, 0.00075190, 7.26884048, 0.99625066, 0.99802168, 0.49290821],
-												 [	-6.27007271, -0.00122593, 0.00075160, 7.26884678, 0.99625214, 0.99802246, 0.49290851],
-												 [	-6.27007851, -0.00122545, 0.00075131, 7.26885306, 0.99625363, 0.99802324, 0.49290885],
-												 [	-6.27008428, -0.00122496, 0.00075101, 7.26885932, 0.99625511, 0.99802402, 0.49290916],
-												 [	-6.27009004, -0.00122448, 0.00075072, 7.26886556, 0.99625659, 0.99802480, 0.49290948],
-												 [	-6.27009578, -0.00122400, 0.00075042, 7.26887178, 0.99625807, 0.99802558, 0.49290980],
-												 [	-6.27010150, -0.00122351, 0.00075012, 7.26887799, 0.99625955, 0.99802636, 0.49291012],
-												 [	-6.27010720, -0.00122303, 0.00074983, 7.26888417, 0.99626102, 0.99802714, 0.49291045],
-												 [	-6.27011288, -0.00122255, 0.00074953, 7.26889033, 0.99626250, 0.99802792, 0.49291075],
-												 [	-6.27011855, -0.00122207, 0.00074924, 7.26889648, 0.99626398, 0.99802869, 0.49291108],
-												 [	-6.27012419, -0.00122159, 0.00074894, 7.26890260, 0.99626545, 0.99802947, 0.49291137],
-												 [	-6.27012982, -0.00122111, 0.00074865, 7.26890871, 0.99626692, 0.99803024, 0.49291169],
-												 [	-6.27013543, -0.00122063, 0.00074836, 7.26891480, 0.99626839, 0.99803102, 0.49291199],
-												 [	-6.27014102, -0.00122015, 0.00074806, 7.26892087, 0.99626986, 0.99803179, 0.49291232],
-												 [	-6.27014659, -0.00121967, 0.00074777, 7.26892692, 0.99627133, 0.99803257, 0.49291262],
-												 [	-6.27015214, -0.00121919, 0.00074747, 7.26893295, 0.99627280, 0.99803334, 0.49291295],
-												 [	-6.27015767, -0.00121871, 0.00074718, 7.26893897, 0.99627427, 0.99803411, 0.49291325],
-												 [	-6.27016319, -0.00121823, 0.00074689, 7.26894496, 0.99627574, 0.99803488, 0.49291356],
-												 [	-6.27016869, -0.00121775, 0.00074659, 7.26895094, 0.99627720, 0.99803565, 0.49291386],
-												 [	-6.27017417, -0.00121727, 0.00074630, 7.26895690, 0.99627866, 0.99803642, 0.49291418],
-												 [	-6.27017963, -0.00121680, 0.00074601, 7.26896284, 0.99628013, 0.99803719, 0.49291448],
-												 [	-6.27018508, -0.00121632, 0.00074572, 7.26896876, 0.99628159, 0.99803796, 0.49291478],
-												 [	-6.27019050, -0.00121584, 0.00074543, 7.26897466, 0.99628305, 0.99803873, 0.49291509],
-												 [	-6.27019591, -0.00121537, 0.00074513, 7.26898055, 0.99628451, 0.99803950, 0.49291539],
-												 [	-6.27020130, -0.00121489, 0.00074484, 7.26898641, 0.99628596, 0.99804027, 0.49291571],
-												 [	-6.27020668, -0.00121441, 0.00074455, 7.26899226, 0.99628742, 0.99804103, 0.49291599],
-												 [	-6.27021203, -0.00121394, 0.00074426, 7.26899810, 0.99628888, 0.99804180, 0.49291629],
-												 [	-6.27021737, -0.00121346, 0.00074397, 7.26900391, 0.99629033, 0.99804257, 0.49291660],
-												 [	-6.27022270, -0.00121299, 0.00074368, 7.26900971, 0.99629178, 0.99804333, 0.49291688],
-												 [	-6.27022800, -0.00121252, 0.00074339, 7.26901548, 0.99629324, 0.99804410, 0.49291722],
-												 [	-6.27023329, -0.00121204, 0.00074310, 7.26902124, 0.99629469, 0.99804486, 0.49291750],
-												 [	-6.27023856, -0.00121157, 0.00074281, 7.26902699, 0.99629614, 0.99804562, 0.49291781],
-												 [	-6.27024381, -0.00121110, 0.00074252, 7.26903271, 0.99629759, 0.99804639, 0.49291812],
-												 [	-6.27024904, -0.00121062, 0.00074223, 7.26903842, 0.99629903, 0.99804715, 0.49291840],
-												 [	-6.27025426, -0.00121015, 0.00074194, 7.26904411, 0.99630048, 0.99804791, 0.49291870],
-												 [	-6.27025946, -0.00120968, 0.00074165, 7.26904979, 0.99630193, 0.99804867, 0.49291902],
-												 [	-6.27026465, -0.00120921, 0.00074136, 7.26905544, 0.99630337, 0.99804943, 0.49291932],
-												 [	-6.27026982, -0.00120874, 0.00074107, 7.26906108, 0.99630481, 0.99805019, 0.49291960],
-												 [	-6.27027497, -0.00120827, 0.00074078, 7.26906670, 0.99630626, 0.99805095, 0.49291988],
-												 [	-6.27028010, -0.00120780, 0.00074050, 7.26907231, 0.99630770, 0.99805171, 0.49292018],
-												 [	-6.27028522, -0.00120732, 0.00074021, 7.26907789, 0.99630914, 0.99805247, 0.49292047],
-												 [	-6.27029032, -0.00120686, 0.00073992, 7.26908347, 0.99631057, 0.99805322, 0.49292077],
-												 [	-6.27029541, -0.00120639, 0.00073963, 7.26908902, 0.99631201, 0.99805398, 0.49292106],
-												 [	-6.27030047, -0.00120592, 0.00073934, 7.26909456, 0.99631345, 0.99805474, 0.49292137],
-												 [	-6.27030552, -0.00120545, 0.00073906, 7.26910008, 0.99631488, 0.99805549, 0.49292164],
-												 [	-6.27031056, -0.00120498, 0.00073877, 7.26910558, 0.99631632, 0.99805625, 0.49292193],
-												 [	-6.27031558, -0.00120451, 0.00073848, 7.26911107, 0.99631775, 0.99805700, 0.49292223],
-												 [	-6.27032058, -0.00120404, 0.00073820, 7.26911654, 0.99631918, 0.99805776, 0.49292252],
-												 [	-6.27032557, -0.00120358, 0.00073791, 7.26912199, 0.99632061, 0.99805851, 0.49292278],
-												 [	-6.27033054, -0.00120311, 0.00073763, 7.26912743, 0.99632204, 0.99805926, 0.49292312],
-												 [	-6.27033549, -0.00120264, 0.00073734, 7.26913285, 0.99632347, 0.99806002, 0.49292338],
-												 [	-6.27034043, -0.00120218, 0.00073705, 7.26913825, 0.99632490, 0.99806077, 0.49292367],
-												 [	-6.27034536, -0.00120171, 0.00073677, 7.26914364, 0.99632633, 0.99806152, 0.49292394],
-												 [	-6.27035026, -0.00120125, 0.00073648, 7.26914902, 0.99632775, 0.99806227, 0.49292425],
-												 [	-6.27035515, -0.00120078, 0.00073620, 7.26915437, 0.99632918, 0.99806302, 0.49292452],
-												 [	-6.27036003, -0.00120032, 0.00073591, 7.26915971, 0.99633060, 0.99806377, 0.49292480],
-												 [	-6.27036489, -0.00119985, 0.00073563, 7.26916504, 0.99633202, 0.99806452, 0.49292511],
-												 [	-6.27036973, -0.00119939, 0.00073535, 7.26917034, 0.99633344, 0.99806527, 0.49292536],
-												 [	-6.27037456, -0.00119892, 0.00073506, 7.26917564, 0.99633486, 0.99806601, 0.49292567],
-												 [	-6.27037937, -0.00119846, 0.00073478, 7.26918091, 0.99633628, 0.99806676, 0.49292595],
-												 [	-6.27038417, -0.00119800, 0.00073449, 7.26918617, 0.99633770, 0.99806751, 0.49292622],
-												 [	-6.27038895, -0.00119754, 0.00073421, 7.26919142, 0.99633912, 0.99806825, 0.49292651],
-												 [	-6.27039372, -0.00119707, 0.00073393, 7.26919664, 0.99634053, 0.99806900, 0.49292678],
-												 [	-6.27039847, -0.00119661, 0.00073364, 7.26920186, 0.99634195, 0.99806974, 0.49292707],
-												 [	-6.27040321, -0.00119615, 0.00073336, 7.26920706, 0.99634336, 0.99807049, 0.49292736],
-												 [	-6.27040793, -0.00119569, 0.00073308, 7.26921224, 0.99634477, 0.99807123, 0.49292762],
-												 [	-6.27041263, -0.00119523, 0.00073280, 7.26921740, 0.99634618, 0.99807198, 0.49292790],
-												 [	-6.27041732, -0.00119477, 0.00073251, 7.26922256, 0.99634759, 0.99807272, 0.49292816],
-												 [	-6.27042200, -0.00119431, 0.00073223, 7.26922769, 0.99634900, 0.99807346, 0.49292845],
-												 [	-6.27042666, -0.00119385, 0.00073195, 7.26923281, 0.99635041, 0.99807420, 0.49292873],
-												 [	-6.27043131, -0.00119339, 0.00073167, 7.26923792, 0.99635182, 0.99807494, 0.49292902],
-												 [	-6.27043594, -0.00119293, 0.00073139, 7.26924301, 0.99635322, 0.99807568, 0.49292929],
-												 [	-6.27044055, -0.00119247, 0.00073111, 7.26924808, 0.99635463, 0.99807642, 0.49292955],
-												 [	-6.27044516, -0.00119201, 0.00073083, 7.26925314, 0.99635603, 0.99807716, 0.49292983],
-												 [	-6.27044974, -0.00119155, 0.00073054, 7.26925819, 0.99635743, 0.99807790, 0.49293011],
-												 [	-6.27045432, -0.00119110, 0.00073026, 7.26926322, 0.99635884, 0.99807864, 0.49293037],
-												 [	-6.27045887, -0.00119064, 0.00072998, 7.26926823, 0.99636024, 0.99807938, 0.49293066],
-												 [	-6.27046342, -0.00119018, 0.00072970, 7.26927323, 0.99636164, 0.99808011, 0.49293095],
-												 [	-6.27046795, -0.00118973, 0.00072942, 7.26927822, 0.99636303, 0.99808085, 0.49293118],
-												 [	-6.27047246, -0.00118927, 0.00072914, 7.26928319, 0.99636443, 0.99808158, 0.49293146],
-												 [	-6.27047696, -0.00118881, 0.00072887, 7.26928815, 0.99636583, 0.99808232, 0.49293175],
-												 [	-6.27048145, -0.00118836, 0.00072859, 7.26929309, 0.99636722, 0.99808305, 0.49293201],
-												 [	-6.27048592, -0.00118790, 0.00072831, 7.26929802, 0.99636862, 0.99808379, 0.49293228],
-												 [	-6.27049038, -0.00118745, 0.00072803, 7.26930293, 0.99637001, 0.99808452, 0.49293255],
-												 [	-6.27049482, -0.00118699, 0.00072775, 7.26930783, 0.99637140, 0.99808526, 0.49293281],
-												 [	-6.27049925, -0.00118654, 0.00072747, 7.26931271, 0.99637279, 0.99808599, 0.49293309],
-												 [	-6.27050366, -0.00118609, 0.00072719, 7.26931758, 0.99637418, 0.99808672, 0.49293334],
-												 [	-6.27050807, -0.00118563, 0.00072692, 7.26932243, 0.99637557, 0.99808745, 0.49293360],
-												 [	-6.27051245, -0.00118518, 0.00072664, 7.26932727, 0.99637696, 0.99808818, 0.49293390],
-												 [	-6.27051683, -0.00118473, 0.00072636, 7.26933210, 0.99637835, 0.99808891, 0.49293415],
-												 [	-6.27052119, -0.00118427, 0.00072608, 7.26933691, 0.99637973, 0.99808964, 0.49293444],
-												 [	-6.27052553, -0.00118382, 0.00072581, 7.26934171, 0.99638112, 0.99809037, 0.49293467],
-												 [	-6.27052986, -0.00118337, 0.00072553, 7.26934649, 0.99638250, 0.99809110, 0.49293494],
-												 [	-6.27053418, -0.00118292, 0.00072525, 7.26935126, 0.99638388, 0.99809183, 0.49293521],
-												 [	-6.27053849, -0.00118247, 0.00072498, 7.26935602, 0.99638526, 0.99809256, 0.49293547],
-												 [	-6.27054278, -0.00118202, 0.00072470, 7.26936076, 0.99638664, 0.99809328, 0.49293575],
-												 [	-6.27054706, -0.00118157, 0.00072442, 7.26936549, 0.99638802, 0.99809401, 0.49293600],
-												 [	-6.27055132, -0.00118112, 0.00072415, 7.26937020, 0.99638940, 0.99809474, 0.49293625],
-												 [	-6.27055557, -0.00118067, 0.00072387, 7.26937491, 0.99639078, 0.99809546, 0.49293651],
-												 [	-6.27055981, -0.00118022, 0.00072360, 7.26937959, 0.99639215, 0.99809619, 0.49293677],
-												 [	-6.27056403, -0.00117977, 0.00072332, 7.26938427, 0.99639353, 0.99809691, 0.49293703],
-												 [	-6.27056825, -0.00117932, 0.00072305, 7.26938893, 0.99639490, 0.99809763, 0.49293729],
-												 [	-6.27057244, -0.00117887, 0.00072277, 7.26939357, 0.99639628, 0.99809836, 0.49293754],
-												 [	-6.27057663, -0.00117842, 0.00072250, 7.26939820, 0.99639765, 0.99809908, 0.49293783],
-												 [	-6.27058080, -0.00117798, 0.00072222, 7.26940282, 0.99639902, 0.99809980, 0.49293807],
-												 [	-6.27058496, -0.00117753, 0.00072195, 7.26940743, 0.99640039, 0.99810052, 0.49293833],
-												 [	-6.27058910, -0.00117708, 0.00072167, 7.26941202, 0.99640176, 0.99810124, 0.49293858],
-												 [	-6.27059324, -0.00117663, 0.00072140, 7.26941660, 0.99640312, 0.99810196, 0.49293885],
-												 [	-6.27059736, -0.00117619, 0.00072113, 7.26942117, 0.99640449, 0.99810268, 0.49293910],
-												 [	-6.27060146, -0.00117574, 0.00072085, 7.26942572, 0.99640586, 0.99810340, 0.49293936],
-												 [	-6.27060556, -0.00117530, 0.00072058, 7.26943026, 0.99640722, 0.99810412, 0.49293961],
-												 [	-6.27060964, -0.00117485, 0.00072031, 7.26943479, 0.99640859, 0.99810484, 0.49293988],
-												 [	-6.27061371, -0.00117441, 0.00072004, 7.26943930, 0.99640995, 0.99810556, 0.49294014],
-												 [	-6.27061776, -0.00117396, 0.00071976, 7.26944380, 0.99641131, 0.99810628, 0.49294037],
-												 [	-6.27062180, -0.00117352, 0.00071949, 7.26944829, 0.99641267, 0.99810699, 0.49294061],
-												 [	-6.27062583, -0.00117307, 0.00071922, 7.26945276, 0.99641403, 0.99810771, 0.49294091],
-												 [	-6.27062985, -0.00117263, 0.00071895, 7.26945722, 0.99641539, 0.99810842, 0.49294113],
-												 [	-6.27063386, -0.00117219, 0.00071867, 7.26946167, 0.99641675, 0.99810914, 0.49294137],
-												 [	-6.27063785, -0.00117174, 0.00071840, 7.26946611, 0.99641810, 0.99810985, 0.49294161],
-												 [	-6.27064183, -0.00117130, 0.00071813, 7.26947053, 0.99641946, 0.99811057, 0.49294187],
-												 [	-6.27064580, -0.00117086, 0.00071786, 7.26947494, 0.99642081, 0.99811128, 0.49294216],
-												 [	-6.27064976, -0.00117042, 0.00071759, 7.26947934, 0.99642217, 0.99811199, 0.49294239],
-												 [	-6.27065370, -0.00116997, 0.00071732, 7.26948372, 0.99642352, 0.99811271, 0.49294263],
-												 [	-6.27065763, -0.00116953, 0.00071705, 7.26948810, 0.99642487, 0.99811342, 0.49294289],
-												 [	-6.27066155, -0.00116909, 0.00071678, 7.26949246, 0.99642622, 0.99811413, 0.49294314],
-												 [	-6.27066546, -0.00116865, 0.00071651, 7.26949680, 0.99642757, 0.99811484, 0.49294338],
-												 [	-6.27066935, -0.00116821, 0.00071624, 7.26950114, 0.99642892, 0.99811555, 0.49294362],
-												 [	-6.27067323, -0.00116777, 0.00071597, 7.26950546, 0.99643026, 0.99811626, 0.49294387],
-												 [	-6.27067711, -0.00116733, 0.00071570, 7.26950977, 0.99643161, 0.99811697, 0.49294414],
-												 [	-6.27068096, -0.00116689, 0.00071543, 7.26951407, 0.99643296, 0.99811768, 0.49294435],
-												 [	-6.27068481, -0.00116645, 0.00071516, 7.26951836, 0.99643430, 0.99811839, 0.49294462],
-												 [	-6.27068865, -0.00116601, 0.00071489, 7.26952263, 0.99643564, 0.99811909, 0.49294486],
-												 [	-6.27069247, -0.00116558, 0.00071462, 7.26952689, 0.99643699, 0.99811980, 0.49294512],
-												 [	-6.27069628, -0.00116514, 0.00071435, 7.26953114, 0.99643833, 0.99812051, 0.49294533],
-												 [	-6.27070008, -0.00116470, 0.00071409, 7.26953538, 0.99643967, 0.99812121, 0.49294559],
-												 [	-6.27070387, -0.00116426, 0.00071382, 7.26953961, 0.99644101, 0.99812192, 0.49294582],
-												 [	-6.27070765, -0.00116383, 0.00071355, 7.26954382, 0.99644235, 0.99812262, 0.49294607],
-												 [	-6.27071141, -0.00116339, 0.00071328, 7.26954802, 0.99644368, 0.99812333, 0.49294633],
-												 [	-6.27071516, -0.00116295, 0.00071301, 7.26955221, 0.99644502, 0.99812403, 0.49294657],
-												 [	-6.27071891, -0.00116252, 0.00071275, 7.26955639, 0.99644635, 0.99812474, 0.49294678],
-												 [	-6.27072264, -0.00116208, 0.00071248, 7.26956056, 0.99644769, 0.99812544, 0.49294701],
-												 [	-6.27072636, -0.00116165, 0.00071221, 7.26956471, 0.99644902, 0.99812614, 0.49294726],
-												 [	-6.27073006, -0.00116121, 0.00071195, 7.26956885, 0.99645035, 0.99812684, 0.49294753],
-												 [	-6.27073376, -0.00116078, 0.00071168, 7.26957298, 0.99645169, 0.99812755, 0.49294774],
-												 [	-6.27073744, -0.00116034, 0.00071141, 7.26957710, 0.99645302, 0.99812825, 0.49294799],
-												 [	-6.27074112, -0.00115991, 0.00071115, 7.26958121, 0.99645434, 0.99812895, 0.49294824],
-												 [	-6.27074478, -0.00115947, 0.00071088, 7.26958531, 0.99645567, 0.99812965, 0.49294849],
-												 [	-6.27074843, -0.00115904, 0.00071062, 7.26958939, 0.99645700, 0.99813035, 0.49294867],
-												 [	-6.27075207, -0.00115861, 0.00071035, 7.26959347, 0.99645833, 0.99813104, 0.49294894],
-												 [	-6.27075570, -0.00115817, 0.00071008, 7.26959753, 0.99645965, 0.99813174, 0.49294918],
-												 [	-6.27075932, -0.00115774, 0.00070982, 7.26960158, 0.99646098, 0.99813244, 0.49294940],
-												 [	-6.27076293, -0.00115731, 0.00070955, 7.26960562, 0.99646230, 0.99813314, 0.49294966],
-												 [	-6.27076652, -0.00115688, 0.00070929, 7.26960965, 0.99646362, 0.99813383, 0.49294988],
-												 [	-6.27077011, -0.00115644, 0.00070902, 7.26961366, 0.99646494, 0.99813453, 0.49295014],
-												 [	-6.27077368, -0.00115601, 0.00070876, 7.26961767, 0.99646626, 0.99813523, 0.49295035],
-												 [	-6.27077724, -0.00115558, 0.00070850, 7.26962166, 0.99646758, 0.99813592, 0.49295058],
-												 [	-6.27078080, -0.00115515, 0.00070823, 7.26962565, 0.99646890, 0.99813662, 0.49295081],
-												 [	-6.27078434, -0.00115472, 0.00070797, 7.26962962, 0.99647022, 0.99813731, 0.49295107],
-												 [	-6.27078787, -0.00115429, 0.00070770, 7.26963358, 0.99647154, 0.99813800, 0.49295129],
-												 [	-6.27079139, -0.00115386, 0.00070744, 7.26963753, 0.99647285, 0.99813870, 0.49295151],
-												 [	-6.27079490, -0.00115343, 0.00070718, 7.26964147, 0.99647417, 0.99813939, 0.49295175],
-												 [	-6.27079840, -0.00115300, 0.00070692, 7.26964540, 0.99647548, 0.99814008, 0.49295200],
-												 [	-6.27080189, -0.00115257, 0.00070665, 7.26964931, 0.99647679, 0.99814077, 0.49295221],
-												 [	-6.27080537, -0.00115215, 0.00070639, 7.26965322, 0.99647810, 0.99814146, 0.49295246],
-												 [	-6.27080883, -0.00115172, 0.00070613, 7.26965711, 0.99647941, 0.99814215, 0.49295267],
-												 [	-6.27081229, -0.00115129, 0.00070586, 7.26966100, 0.99648072, 0.99814284, 0.49295289],
-												 [	-6.27081574, -0.00115086, 0.00070560, 7.26966487, 0.99648203, 0.99814353, 0.49295314],
-												 [	-6.27081917, -0.00115044, 0.00070534, 7.26966874, 0.99648334, 0.99814422, 0.49295337],
-												 [	-6.27082260, -0.00115001, 0.00070508, 7.26967259, 0.99648465, 0.99814491, 0.49295357],
-												 [	-6.27082601, -0.00114958, 0.00070482, 7.26967643, 0.99648595, 0.99814560, 0.49295381],
-												 [	-6.27082942, -0.00114916, 0.00070456, 7.26968026, 0.99648726, 0.99814629, 0.49295404],
-												 [	-6.27083281, -0.00114873, 0.00070430, 7.26968408, 0.99648856, 0.99814697, 0.49295428],
-												 [	-6.27083620, -0.00114830, 0.00070403, 7.26968789, 0.99648986, 0.99814766, 0.49295451],
-												 [	-6.27083957, -0.00114788, 0.00070377, 7.26969169, 0.99649117, 0.99814835, 0.49295473],
-												 [	-6.27084294, -0.00114745, 0.00070351, 7.26969548, 0.99649247, 0.99814903, 0.49295497],
-												 [	-6.27084629, -0.00114703, 0.00070325, 7.26969926, 0.99649377, 0.99814972, 0.49295518],
-												 [	-6.27084964, -0.00114661, 0.00070299, 7.26970303, 0.99649507, 0.99815040, 0.49295540],
-												 [	-6.27085297, -0.00114618, 0.00070273, 7.26970679, 0.99649636, 0.99815109, 0.49295563],
-												 [	-6.27085630, -0.00114576, 0.00070247, 7.26971054, 0.99649766, 0.99815177, 0.49295584],
-												 [	-6.27085961, -0.00114533, 0.00070221, 7.26971428, 0.99649896, 0.99815245, 0.49295609],
-												 [	-6.27086292, -0.00114491, 0.00070195, 7.26971800, 0.99650025, 0.99815313, 0.49295629],
-												 [	-6.27086621, -0.00114449, 0.00070169, 7.26972172, 0.99650155, 0.99815382, 0.49295653],
-												 [	-6.27086950, -0.00114407, 0.00070144, 7.26972543, 0.99650284, 0.99815450, 0.49295673],
-												 [	-6.27087277, -0.00114364, 0.00070118, 7.26972913, 0.99650413, 0.99815518, 0.49295696],
-												 [	-6.27087604, -0.00114322, 0.00070092, 7.26973281, 0.99650542, 0.99815586, 0.49295720],
-												 [	-6.27087929, -0.00114280, 0.00070066, 7.26973649, 0.99650671, 0.99815654, 0.49295739],
-												 [	-6.27088254, -0.00114238, 0.00070040, 7.26974016, 0.99650800, 0.99815722, 0.49295764],
-												 [	-6.27088577, -0.00114196, 0.00070014, 7.26974382, 0.99650929, 0.99815790, 0.49295785],
-												 [	-6.27088900, -0.00114154, 0.00069989, 7.26974746, 0.99651058, 0.99815858, 0.49295811],
-												 [	-6.27089222, -0.00114112, 0.00069963, 7.26975110, 0.99651187, 0.99815925, 0.49295829],
-												 [	-6.27089543, -0.00114070, 0.00069937, 7.26975473, 0.99651315, 0.99815993, 0.49295850],
-												 [	-6.27089862, -0.00114028, 0.00069911, 7.26975835, 0.99651444, 0.99816061, 0.49295875],
-												 [	-6.27090181, -0.00113986, 0.00069886, 7.26976195, 0.99651572, 0.99816129, 0.49295895],
-												 [	-6.27090499, -0.00113944, 0.00069860, 7.26976555, 0.99651700, 0.99816196, 0.49295918],
-												 [	-6.27090816, -0.00113902, 0.00069834, 7.26976914, 0.99651829, 0.99816264, 0.49295938],
-												 [	-6.27091132, -0.00113860, 0.00069809, 7.26977272, 0.99651957, 0.99816331, 0.49295963],
-												 [	-6.27091447, -0.00113818, 0.00069783, 7.26977629, 0.99652085, 0.99816399, 0.49295982],
-												 [	-6.27091762, -0.00113777, 0.00069757, 7.26977985, 0.99652213, 0.99816466, 0.49296003],
-												 [	-6.27092075, -0.00113735, 0.00069732, 7.26978340, 0.99652340, 0.99816533, 0.49296028],
-												 [	-6.27092387, -0.00113693, 0.00069706, 7.26978694, 0.99652468, 0.99816601, 0.49296049],
-												 [	-6.27092699, -0.00113651, 0.00069681, 7.26979047, 0.99652596, 0.99816668, 0.49296071],
-												 [	-6.27093009, -0.00113610, 0.00069655, 7.26979399, 0.99652723, 0.99816735, 0.49296091],
-												 [	-6.27093319, -0.00113568, 0.00069629, 7.26979751, 0.99652851, 0.99816802, 0.49296112],
-												 [	-6.27093627, -0.00113527, 0.00069604, 7.26980101, 0.99652978, 0.99816869, 0.49296137],
-												 [	-6.27093935, -0.00113485, 0.00069578, 7.26980450, 0.99653105, 0.99816937, 0.49296155],
-												 [	-6.27094242, -0.00113443, 0.00069553, 7.26980799, 0.99653232, 0.99817004, 0.49296176],
-												 [	-6.27094548, -0.00113402, 0.00069528, 7.26981146, 0.99653360, 0.99817070, 0.49296198],
-												 [	-6.27094853, -0.00113360, 0.00069502, 7.26981493, 0.99653487, 0.99817137, 0.49296221],
-												 [	-6.27095157, -0.00113319, 0.00069477, 7.26981838, 0.99653613, 0.99817204, 0.49296241],
-												 [	-6.27095461, -0.00113278, 0.00069451, 7.26982183, 0.99653740, 0.99817271, 0.49296261],
-												 [	-6.27095763, -0.00113236, 0.00069426, 7.26982527, 0.99653867, 0.99817338, 0.49296284],
-												 [	-6.27096065, -0.00113195, 0.00069401, 7.26982870, 0.99653994, 0.99817405, 0.49296306],
-												 [	-6.27096365, -0.00113154, 0.00069375, 7.26983212, 0.99654120, 0.99817471, 0.49296324],
-												 [	-6.27096665, -0.00113112, 0.00069350, 7.26983553, 0.99654246, 0.99817538, 0.49296349],
-												 [	-6.27096964, -0.00113071, 0.00069325, 7.26983893, 0.99654373, 0.99817604, 0.49296367],
-												 [	-6.27097262, -0.00113030, 0.00069299, 7.26984232, 0.99654499, 0.99817671, 0.49296390],
-												 [	-6.27097559, -0.00112989, 0.00069274, 7.26984571, 0.99654625, 0.99817737, 0.49296411],
-												 [	-6.27097856, -0.00112947, 0.00069249, 7.26984908, 0.99654751, 0.99817804, 0.49296432],
-												 [	-6.27098151, -0.00112906, 0.00069224, 7.26985245, 0.99654877, 0.99817870, 0.49296451],
-												 [	-6.27098446, -0.00112865, 0.00069198, 7.26985581, 0.99655003, 0.99817937, 0.49296475],
-												 [	-6.27098739, -0.00112824, 0.00069173, 7.26985915, 0.99655129, 0.99818003, 0.49296493],
-												 [	-6.27099032, -0.00112783, 0.00069148, 7.26986249, 0.99655255, 0.99818069, 0.49296516],
-												 [	-6.27099324, -0.00112742, 0.00069123, 7.26986583, 0.99655380, 0.99818135, 0.49296535],
-												 [	-6.27099616, -0.00112701, 0.00069098, 7.26986915, 0.99655506, 0.99818202, 0.49296556],
-												 [	-6.27099906, -0.00112660, 0.00069072, 7.26987246, 0.99655631, 0.99818268, 0.49296577],
-												 [	-6.27100196, -0.00112619, 0.00069047, 7.26987577, 0.99655756, 0.99818334, 0.49296597],
-												 [	-6.27100484, -0.00112578, 0.00069022, 7.26987906, 0.99655882, 0.99818400, 0.49296619],
-												 [	-6.27100772, -0.00112537, 0.00068997, 7.26988235, 0.99656007, 0.99818466, 0.49296639],
-												 [	-6.27101059, -0.00112496, 0.00068972, 7.26988563, 0.99656132, 0.99818532, 0.49296663],
-												 [	-6.27101345, -0.00112455, 0.00068947, 7.26988890, 0.99656257, 0.99818597, 0.49296681],
-												 [	-6.27101631, -0.00112415, 0.00068922, 7.26989216, 0.99656382, 0.99818663, 0.49296699],
-												 [	-6.27101915, -0.00112374, 0.00068897, 7.26989541, 0.99656506, 0.99818729, 0.49296722],
-												 [	-6.27102199, -0.00112333, 0.00068872, 7.26989866, 0.99656631, 0.99818795, 0.49296743],
-												 [	-6.27102482, -0.00112292, 0.00068847, 7.26990189, 0.99656756, 0.99818860, 0.49296764],
-												 [	-6.27102764, -0.00112252, 0.00068822, 7.26990512, 0.99656880, 0.99818926, 0.49296783],
-												 [	-6.27103045, -0.00112211, 0.00068797, 7.26990834, 0.99657005, 0.99818992, 0.49296802],
-												 [	-6.27103326, -0.00112171, 0.00068772, 7.26991155, 0.99657129, 0.99819057, 0.49296822],
-												 [	-6.27103606, -0.00112130, 0.00068747, 7.26991476, 0.99657253, 0.99819123, 0.49296843],
-												 [	-6.27103885, -0.00112089, 0.00068723, 7.26991795, 0.99657377, 0.99819188, 0.49296863],
-												 [	-6.27104163, -0.00112049, 0.00068698, 7.26992114, 0.99657501, 0.99819253, 0.49296882],
-												 [	-6.27104440, -0.00112008, 0.00068673, 7.26992432, 0.99657625, 0.99819319, 0.49296903],
-												 [	-6.27104717, -0.00111968, 0.00068648, 7.26992749, 0.99657749, 0.99819384, 0.49296925],
-												 [	-6.27104992, -0.00111927, 0.00068623, 7.26993065, 0.99657873, 0.99819449, 0.49296948],
-												 [	-6.27105267, -0.00111887, 0.00068599, 7.26993380, 0.99657997, 0.99819514, 0.49296966],
-												 [	-6.27105541, -0.00111847, 0.00068574, 7.26993695, 0.99658120, 0.99819580, 0.49296986],
-												 [	-6.27105815, -0.00111806, 0.00068549, 7.26994009, 0.99658244, 0.99819645, 0.49297006],
-												 [	-6.27106088, -0.00111766, 0.00068524, 7.26994322, 0.99658367, 0.99819710, 0.49297025],
-												 [	-6.27106359, -0.00111726, 0.00068500, 7.26994634, 0.99658491, 0.99819775, 0.49297043],
-												 [	-6.27106630, -0.00111685, 0.00068475, 7.26994945, 0.99658614, 0.99819840, 0.49297064],
-												 [	-6.27106901, -0.00111645, 0.00068450, 7.26995256, 0.99658737, 0.99819905, 0.49297085],
-												 [	-6.27107170, -0.00111605, 0.00068426, 7.26995565, 0.99658860, 0.99819970, 0.49297106],
-												 [	-6.27107439, -0.00111565, 0.00068401, 7.26995874, 0.99658983, 0.99820034, 0.49297123],
-												 [	-6.27107707, -0.00111525, 0.00068376, 7.26996183, 0.99659106, 0.99820099, 0.49297145],
-												 [	-6.27107974, -0.00111484, 0.00068352, 7.26996490, 0.99659229, 0.99820164, 0.49297165],
-												 [	-6.27108241, -0.00111444, 0.00068327, 7.26996797, 0.99659352, 0.99820229, 0.49297182],
-												 [	-6.27108507, -0.00111404, 0.00068302, 7.26997103, 0.99659474, 0.99820293, 0.49297202],
-												 [	-6.27108772, -0.00111364, 0.00068278, 7.26997408, 0.99659597, 0.99820358, 0.49297222],
-												 [	-6.27109036, -0.00111324, 0.00068253, 7.26997712, 0.99659719, 0.99820422, 0.49297241],
-												 [	-6.27109300, -0.00111284, 0.00068229, 7.26998015, 0.99659842, 0.99820487, 0.49297262],
-												 [	-6.27109562, -0.00111244, 0.00068204, 7.26998318, 0.99659964, 0.99820551, 0.49297281],
-												 [	-6.27109825, -0.00111204, 0.00068180, 7.26998620, 0.99660086, 0.99820616, 0.49297301],
-												 [	-6.27110086, -0.00111164, 0.00068155, 7.26998921, 0.99660208, 0.99820680, 0.49297320],
-												 [	-6.27110347, -0.00111125, 0.00068131, 7.26999222, 0.99660330, 0.99820744, 0.49297339],
-												 [	-6.27110606, -0.00111085, 0.00068106, 7.26999522, 0.99660452, 0.99820809, 0.49297359],
-												 [	-6.27110866, -0.00111045, 0.00068082, 7.26999821, 0.99660574, 0.99820873, 0.49297380],
-												 [	-6.27111124, -0.00111005, 0.00068058, 7.27000119, 0.99660696, 0.99820937, 0.49297397],
-												 [	-6.27111382, -0.00110965, 0.00068033, 7.27000416, 0.99660818, 0.99821001, 0.49297417],
-												 [	-6.27111639, -0.00110926, 0.00068009, 7.27000713, 0.99660939, 0.99821065, 0.49297437],
-												 [	-6.27111895, -0.00110886, 0.00067985, 7.27001009, 0.99661061, 0.99821129, 0.49297456],
-												 [	-6.27112151, -0.00110846, 0.00067960, 7.27001304, 0.99661182, 0.99821193, 0.49297477],
-												 [	-6.27112405, -0.00110807, 0.00067936, 7.27001599, 0.99661303, 0.99821257, 0.49297493],
-												 [	-6.27112660, -0.00110767, 0.00067912, 7.27001892, 0.99661425, 0.99821321, 0.49297516],
-												 [	-6.27112913, -0.00110728, 0.00067887, 7.27002185, 0.99661546, 0.99821385, 0.49297533],
-												 [	-6.27113166, -0.00110688, 0.00067863, 7.27002478, 0.99661667, 0.99821449, 0.49297550],
-												 [	-6.27113418, -0.00110648, 0.00067839, 7.27002769, 0.99661788, 0.99821513, 0.49297572],
-												 [	-6.27113669, -0.00110609, 0.00067815, 7.27003060, 0.99661909, 0.99821576, 0.49297589],
-												 [	-6.27113920, -0.00110569, 0.00067790, 7.27003350, 0.99662030, 0.99821640, 0.49297607],
-												 [	-6.27114170, -0.00110530, 0.00067766, 7.27003640, 0.99662150, 0.99821704, 0.49297628],
-												 [	-6.27114419, -0.00110491, 0.00067742, 7.27003928, 0.99662271, 0.99821767, 0.49297646],
-												 [	-6.27114668, -0.00110451, 0.00067718, 7.27004216, 0.99662392, 0.99821831, 0.49297664],
-												 [	-6.27114915, -0.00110412, 0.00067694, 7.27004504, 0.99662512, 0.99821894, 0.49297684],
-												 [	-6.27115163, -0.00110372, 0.00067670, 7.27004790, 0.99662632, 0.99821958, 0.49297702],
-												 [	-6.27115409, -0.00110333, 0.00067646, 7.27005076, 0.99662753, 0.99822021, 0.49297723],
-												 [	-6.27115655, -0.00110294, 0.00067621, 7.27005361, 0.99662873, 0.99822085, 0.49297742],
-												 [	-6.27115900, -0.00110255, 0.00067597, 7.27005646, 0.99662993, 0.99822148, 0.49297759],
-												 [	-6.27116145, -0.00110215, 0.00067573, 7.27005929, 0.99663113, 0.99822211, 0.49297781],
-												 [	-6.27116389, -0.00110176, 0.00067549, 7.27006212, 0.99663233, 0.99822274, 0.49297799],
-												 [	-6.27116632, -0.00110137, 0.00067525, 7.27006495, 0.99663353, 0.99822338, 0.49297818],
-												 [	-6.27116874, -0.00110098, 0.00067501, 7.27006776, 0.99663473, 0.99822401, 0.49297837],
-												 [	-6.27117116, -0.00110059, 0.00067477, 7.27007057, 0.99663592, 0.99822464, 0.49297853],
-												 [	-6.27117357, -0.00110020, 0.00067453, 7.27007338, 0.99663712, 0.99822527, 0.49297873],
-												 [	-6.27117598, -0.00109981, 0.00067429, 7.27007617, 0.99663832, 0.99822590, 0.49297890],
-												 [	-6.27117838, -0.00109942, 0.00067405, 7.27007896, 0.99663951, 0.99822653, 0.49297910],
-												 [	-6.27118077, -0.00109903, 0.00067381, 7.27008174, 0.99664070, 0.99822716, 0.49297929],
-												 [	-6.27118315, -0.00109864, 0.00067358, 7.27008452, 0.99664190, 0.99822779, 0.49297945],
-												 [	-6.27118553, -0.00109825, 0.00067334, 7.27008729, 0.99664309, 0.99822842, 0.49297965],
-												 [	-6.27118791, -0.00109786, 0.00067310, 7.27009005, 0.99664428, 0.99822904, 0.49297987],
-												 [	-6.27119027, -0.00109747, 0.00067286, 7.27009280, 0.99664547, 0.99822967, 0.49298005],
-												 [	-6.27119263, -0.00109708, 0.00067262, 7.27009555, 0.99664666, 0.99823030, 0.49298023],
-												 [	-6.27119499, -0.00109669, 0.00067238, 7.27009829, 0.99664785, 0.99823092, 0.49298041],
-												 [	-6.27119733, -0.00109630, 0.00067214, 7.27010103, 0.99664904, 0.99823155, 0.49298056],
-												 [	-6.27119968, -0.00109592, 0.00067191, 7.27010376, 0.99665022, 0.99823218, 0.49298074],
-												 [	-6.27120201, -0.00109553, 0.00067167, 7.27010648, 0.99665141, 0.99823280, 0.49298095],
-												 [	-6.27120434, -0.00109514, 0.00067143, 7.27010920, 0.99665259, 0.99823343, 0.49298115],
-												 [	-6.27120666, -0.00109475, 0.00067119, 7.27011190, 0.99665378, 0.99823405, 0.49298131],
-												 [	-6.27120898, -0.00109437, 0.00067096, 7.27011461, 0.99665496, 0.99823467, 0.49298149],
-												 [	-6.27121129, -0.00109398, 0.00067072, 7.27011730, 0.99665614, 0.99823530, 0.49298166],
-												 [	-6.27121359, -0.00109360, 0.00067048, 7.27011999, 0.99665733, 0.99823592, 0.49298185],
-												 [	-6.27121589, -0.00109321, 0.00067025, 7.27012268, 0.99665851, 0.99823654, 0.49298202],
-												 [	-6.27121818, -0.00109282, 0.00067001, 7.27012535, 0.99665969, 0.99823717, 0.49298224],
-												 [	-6.27122046, -0.00109244, 0.00066977, 7.27012802, 0.99666087, 0.99823779, 0.49298236],
-												 [	-6.27122274, -0.00109205, 0.00066954, 7.27013069, 0.99666205, 0.99823841, 0.49298260],
-												 [	-6.27122501, -0.00109167, 0.00066930, 7.27013334, 0.99666322, 0.99823903, 0.49298275],
-												 [	-6.27122728, -0.00109128, 0.00066907, 7.27013600, 0.99666440, 0.99823965, 0.49298294],
-												 [	-6.27122954, -0.00109090, 0.00066883, 7.27013864, 0.99666558, 0.99824027, 0.49298313],
-												 [	-6.27123179, -0.00109052, 0.00066859, 7.27014128, 0.99666675, 0.99824089, 0.49298330],
-												 [	-6.27123404, -0.00109013, 0.00066836, 7.27014391, 0.99666793, 0.99824151, 0.49298351],
-												 [	-6.27123629, -0.00108975, 0.00066812, 7.27014654, 0.99666910, 0.99824213, 0.49298363],
-												 [	-6.27123852, -0.00108937, 0.00066789, 7.27014916, 0.99667027, 0.99824275, 0.49298382],
-												 [	-6.27124075, -0.00108898, 0.00066765, 7.27015177, 0.99667144, 0.99824336, 0.49298401],
-												 [	-6.27124298, -0.00108860, 0.00066742, 7.27015438, 0.99667261, 0.99824398, 0.49298420],
-												 [	-6.27124520, -0.00108822, 0.00066718, 7.27015698, 0.99667379, 0.99824460, 0.49298438],
-												 [	-6.27124741, -0.00108784, 0.00066695, 7.27015957, 0.99667495, 0.99824521, 0.49298453],
-												 [	-6.27124962, -0.00108745, 0.00066672, 7.27016216, 0.99667612, 0.99824583, 0.49298471],
-												 [	-6.27125182, -0.00108707, 0.00066648, 7.27016475, 0.99667729, 0.99824645, 0.49298491],
-												 [	-6.27125401, -0.00108669, 0.00066625, 7.27016732, 0.99667846, 0.99824706, 0.49298510],
-												 [	-6.27125620, -0.00108631, 0.00066601, 7.27016989, 0.99667962, 0.99824768, 0.49298524],
-												 [	-6.27125839, -0.00108593, 0.00066578, 7.27017246, 0.99668079, 0.99824829, 0.49298544],
-												 [	-6.27126057, -0.00108555, 0.00066555, 7.27017502, 0.99668195, 0.99824890, 0.49298562],
-												 [	-6.27126274, -0.00108517, 0.00066531, 7.27017757, 0.99668312, 0.99824952, 0.49298575],
-												 [	-6.27126490, -0.00108479, 0.00066508, 7.27018012, 0.99668428, 0.99825013, 0.49298596],
-												 [	-6.27126707, -0.00108441, 0.00066485, 7.27018266, 0.99668544, 0.99825074, 0.49298614],
-												 [	-6.27126922, -0.00108403, 0.00066461, 7.27018519, 0.99668660, 0.99825136, 0.49298629],
-												 [	-6.27127137, -0.00108365, 0.00066438, 7.27018772, 0.99668776, 0.99825197, 0.49298647],
-												 [	-6.27127351, -0.00108327, 0.00066415, 7.27019024, 0.99668892, 0.99825258, 0.49298665],
-												 [	-6.27127565, -0.00108289, 0.00066392, 7.27019276, 0.99669008, 0.99825319, 0.49298685],
-												 [	-6.27127779, -0.00108251, 0.00066369, 7.27019527, 0.99669124, 0.99825380, 0.49298701],
-												 [	-6.27127991, -0.00108214, 0.00066345, 7.27019778, 0.99669240, 0.99825441, 0.49298719],
-												 [	-6.27128204, -0.00108176, 0.00066322, 7.27020028, 0.99669356, 0.99825502, 0.49298735],
-												 [	-6.27128415, -0.00108138, 0.00066299, 7.27020277, 0.99669471, 0.99825563, 0.49298754],
-												 [	-6.27128626, -0.00108100, 0.00066276, 7.27020526, 0.99669587, 0.99825624, 0.49298772],
-												 [	-6.27128837, -0.00108063, 0.00066253, 7.27020774, 0.99669702, 0.99825685, 0.49298787],
-												 [	-6.27129047, -0.00108025, 0.00066230, 7.27021022, 0.99669817, 0.99825746, 0.49298806],
-												 [	-6.27129256, -0.00107987, 0.00066206, 7.27021269, 0.99669933, 0.99825806, 0.49298822],
-												 [	-6.27129465, -0.00107950, 0.00066183, 7.27021516, 0.99670048, 0.99825867, 0.49298838],
-												 [	-6.27129674, -0.00107912, 0.00066160, 7.27021762, 0.99670163, 0.99825928, 0.49298857],
-												 [	-6.27129881, -0.00107874, 0.00066137, 7.27022007, 0.99670278, 0.99825988, 0.49298872],
-												 [	-6.27130089, -0.00107837, 0.00066114, 7.27022252, 0.99670393, 0.99826049, 0.49298890],
-												 [	-6.27130295, -0.00107799, 0.00066091, 7.27022496, 0.99670508, 0.99826109, 0.49298906],
-												 [	-6.27130502, -0.00107762, 0.00066068, 7.27022740, 0.99670622, 0.99826170, 0.49298921],
-												 [	-6.27130707, -0.00107724, 0.00066045, 7.27022983, 0.99670737, 0.99826230, 0.49298942],
-												 [	-6.27130913, -0.00107687, 0.00066022, 7.27023226, 0.99670852, 0.99826291, 0.49298958],
-												 [	-6.27131117, -0.00107649, 0.00065999, 7.27023468, 0.99670966, 0.99826351, 0.49298977],
-												 [	-6.27131321, -0.00107612, 0.00065976, 7.27023709, 0.99671081, 0.99826412, 0.49298992],
-												 [	-6.27131525, -0.00107575, 0.00065953, 7.27023950, 0.99671195, 0.99826472, 0.49299011],
-												 [	-6.27131728, -0.00107537, 0.00065931, 7.27024191, 0.99671309, 0.99826532, 0.49299028],
-												 [	-6.27131930, -0.00107500, 0.00065908, 7.27024430, 0.99671423, 0.99826592, 0.49299042],
-												 [	-6.27132133, -0.00107463, 0.00065885, 7.27024670, 0.99671538, 0.99826653, 0.49299058],
-												 [	-6.27132334, -0.00107425, 0.00065862, 7.27024909, 0.99671652, 0.99826713, 0.49299077],
-												 [	-6.27132535, -0.00107388, 0.00065839, 7.27025147, 0.99671766, 0.99826773, 0.49299096],
-												 [	-6.27132736, -0.00107351, 0.00065816, 7.27025385, 0.99671879, 0.99826833, 0.49299111],
-												 [	-6.27132936, -0.00107314, 0.00065793, 7.27025622, 0.99671993, 0.99826893, 0.49299126],
-												 [	-6.27133135, -0.00107277, 0.00065771, 7.27025858, 0.99672107, 0.99826953, 0.49299144],
-												 [	-6.27133334, -0.00107239, 0.00065748, 7.27026094, 0.99672221, 0.99827013, 0.49299160],
-												 [	-6.27133532, -0.00107202, 0.00065725, 7.27026330, 0.99672334, 0.99827073, 0.49299180],
-												 [	-6.27133730, -0.00107165, 0.00065702, 7.27026565, 0.99672448, 0.99827132, 0.49299193],
-												 [	-6.27133928, -0.00107128, 0.00065680, 7.27026800, 0.99672561, 0.99827192, 0.49299212],
-												 [	-6.27134125, -0.00107091, 0.00065657, 7.27027034, 0.99672674, 0.99827252, 0.49299227],
-												 [	-6.27134321, -0.00107054, 0.00065634, 7.27027267, 0.99672788, 0.99827312, 0.49299243],
-												 [	-6.27134517, -0.00107017, 0.00065611, 7.27027500, 0.99672901, 0.99827371, 0.49299259],
-												 [	-6.27134713, -0.00106980, 0.00065589, 7.27027733, 0.99673014, 0.99827431, 0.49299280],
-												 [	-6.27134908, -0.00106943, 0.00065566, 7.27027964, 0.99673127, 0.99827491, 0.49299296],
-												 [	-6.27135102, -0.00106906, 0.00065543, 7.27028196, 0.99673240, 0.99827550, 0.49299309],
-												 [	-6.27135296, -0.00106870, 0.00065521, 7.27028427, 0.99673353, 0.99827610, 0.49299327],
-												 [	-6.27135490, -0.00106833, 0.00065498, 7.27028657, 0.99673466, 0.99827669, 0.49299344],
-												 [	-6.27135683, -0.00106796, 0.00065476, 7.27028887, 0.99673578, 0.99827729, 0.49299361],
-												 [	-6.27135875, -0.00106759, 0.00065453, 7.27029116, 0.99673691, 0.99827788, 0.49299378],
-												 [	-6.27136067, -0.00106722, 0.00065430, 7.27029345, 0.99673804, 0.99827847, 0.49299395],
-												 [	-6.27136259, -0.00106685, 0.00065408, 7.27029574, 0.99673916, 0.99827907, 0.49299413],
-												 [	-6.27136450, -0.00106649, 0.00065385, 7.27029801, 0.99674028, 0.99827966, 0.49299427],
-												 [	-6.27136641, -0.00106612, 0.00065363, 7.27030029, 0.99674141, 0.99828025, 0.49299442],
-												 [	-6.27136831, -0.00106575, 0.00065340, 7.27030256, 0.99674253, 0.99828084, 0.49299460],
-												 [	-6.27137021, -0.00106539, 0.00065318, 7.27030482, 0.99674365, 0.99828143, 0.49299474],
-												 [	-6.27137210, -0.00106502, 0.00065295, 7.27030708, 0.99674477, 0.99828203, 0.49299490],
-												 [	-6.27137399, -0.00106465, 0.00065273, 7.27030933, 0.99674589, 0.99828262, 0.49299509],
-												 [	-6.27137587, -0.00106429, 0.00065250, 7.27031158, 0.99674701, 0.99828321, 0.49299525],
-												 [	-6.27137775, -0.00106392, 0.00065228, 7.27031382, 0.99674813, 0.99828380, 0.49299541],
-												 [	-6.27137962, -0.00106356, 0.00065206, 7.27031606, 0.99674925, 0.99828439, 0.49299561],
-												 [	-6.27138149, -0.00106319, 0.00065183, 7.27031830, 0.99675037, 0.99828497, 0.49299573],
-												 [	-6.27138335, -0.00106283, 0.00065161, 7.27032053, 0.99675148, 0.99828556, 0.49299589],
-												 [	-6.27138521, -0.00106246, 0.00065139, 7.27032275, 0.99675260, 0.99828615, 0.49299603],
-												 [	-6.27138707, -0.00106210, 0.00065116, 7.27032497, 0.99675371, 0.99828674, 0.49299621],
-												 [	-6.27138892, -0.00106173, 0.00065094, 7.27032719, 0.99675483, 0.99828733, 0.49299635],
-												 [	-6.27139077, -0.00106137, 0.00065072, 7.27032940, 0.99675594, 0.99828791, 0.49299653],
-												 [	-6.27139261, -0.00106101, 0.00065049, 7.27033160, 0.99675705, 0.99828850, 0.49299670],
-												 [	-6.27139445, -0.00106064, 0.00065027, 7.27033380, 0.99675816, 0.99828909, 0.49299687],
-												 [	-6.27139628, -0.00106028, 0.00065005, 7.27033600, 0.99675928, 0.99828967, 0.49299705],
-												 [	-6.27139811, -0.00105992, 0.00064982, 7.27033819, 0.99676039, 0.99829026, 0.49299718],
-												 [	-6.27139993, -0.00105956, 0.00064960, 7.27034037, 0.99676150, 0.99829084, 0.49299736],
-												 [	-6.27140175, -0.00105919, 0.00064938, 7.27034256, 0.99676260, 0.99829143, 0.49299751],
-												 [	-6.27140356, -0.00105883, 0.00064916, 7.27034473, 0.99676371, 0.99829201, 0.49299765],
-												 [	-6.27140537, -0.00105847, 0.00064893, 7.27034690, 0.99676482, 0.99829260, 0.49299782],
-												 [	-6.27140718, -0.00105811, 0.00064871, 7.27034907, 0.99676593, 0.99829318, 0.49299800],
-												 [	-6.27140898, -0.00105775, 0.00064849, 7.27035123, 0.99676703, 0.99829376, 0.49299816],
-												 [	-6.27141078, -0.00105739, 0.00064827, 7.27035339, 0.99676814, 0.99829434, 0.49299833],
-												 [	-6.27141257, -0.00105702, 0.00064805, 7.27035555, 0.99676924, 0.99829493, 0.49299845],
-												 [	-6.27141436, -0.00105666, 0.00064783, 7.27035770, 0.99677034, 0.99829551, 0.49299862],
-												 [	-6.27141614, -0.00105630, 0.00064761, 7.27035984, 0.99677145, 0.99829609, 0.49299878],
-												 [	-6.27141792, -0.00105594, 0.00064739, 7.27036198, 0.99677255, 0.99829667, 0.49299891],
-												 [	-6.27141970, -0.00105558, 0.00064716, 7.27036412, 0.99677365, 0.99829725, 0.49299912],
-												 [	-6.27142147, -0.00105522, 0.00064694, 7.27036625, 0.99677475, 0.99829783, 0.49299926],
-												 [	-6.27142324, -0.00105486, 0.00064672, 7.27036837, 0.99677585, 0.99829841, 0.49299943],
-												 [	-6.27142500, -0.00105451, 0.00064650, 7.27037050, 0.99677695, 0.99829899, 0.49299955],
-												 [	-6.27142676, -0.00105415, 0.00064628, 7.27037261, 0.99677805, 0.99829957, 0.49299971],
-												 [	-6.27142851, -0.00105379, 0.00064606, 7.27037473, 0.99677914, 0.99830015, 0.49299984],
-												 [	-6.27143026, -0.00105343, 0.00064584, 7.27037683, 0.99678024, 0.99830073, 0.49300001],
-												 [	-6.27143201, -0.00105307, 0.00064562, 7.27037894, 0.99678134, 0.99830131, 0.49300017],
-												 [	-6.27143375, -0.00105271, 0.00064540, 7.27038104, 0.99678243, 0.99830188, 0.49300033],
-												 [	-6.27143549, -0.00105236, 0.00064518, 7.27038313, 0.99678353, 0.99830246, 0.49300050],
-												 [	-6.27143722, -0.00105200, 0.00064496, 7.27038522, 0.99678462, 0.99830304, 0.49300065],
-												 [	-6.27143895, -0.00105164, 0.00064475, 7.27038731, 0.99678571, 0.99830361, 0.49300081],
-												 [	-6.27144068, -0.00105128, 0.00064453, 7.27038939, 0.99678681, 0.99830419, 0.49300096],
-												 [	-6.27144240, -0.00105093, 0.00064431, 7.27039147, 0.99678790, 0.99830477, 0.49300112],
-												 [	-6.27144412, -0.00105057, 0.00064409, 7.27039355, 0.99678899, 0.99830534, 0.49300126],
-												 [	-6.27144583, -0.00105021, 0.00064387, 7.27039561, 0.99679008, 0.99830592, 0.49300141],
-												 [	-6.27144754, -0.00104986, 0.00064365, 7.27039768, 0.99679117, 0.99830649, 0.49300158],
-												 [	-6.27144924, -0.00104950, 0.00064343, 7.27039974, 0.99679226, 0.99830706, 0.49300174],
-												 [	-6.27145094, -0.00104915, 0.00064322, 7.27040180, 0.99679334, 0.99830764, 0.49300191],
-												 [	-6.27145264, -0.00104879, 0.00064300, 7.27040385, 0.99679443, 0.99830821, 0.49300203],
-												 [	-6.27145433, -0.00104844, 0.00064278, 7.27040590, 0.99679552, 0.99830878, 0.49300220],
-												 [	-6.27145602, -0.00104808, 0.00064256, 7.27040794, 0.99679660, 0.99830936, 0.49300234],
-												 [	-6.27145771, -0.00104773, 0.00064234, 7.27040998, 0.99679769, 0.99830993, 0.49300248],
-												 [	-6.27145939, -0.00104737, 0.00064213, 7.27041202, 0.99679877, 0.99831050, 0.49300264],
-												 [	-6.27146107, -0.00104702, 0.00064191, 7.27041405, 0.99679986, 0.99831107, 0.49300280],
-												 [	-6.27146274, -0.00104667, 0.00064169, 7.27041607, 0.99680094, 0.99831164, 0.49300294],
-												 [	-6.27146441, -0.00104631, 0.00064148, 7.27041810, 0.99680202, 0.99831221, 0.49300310],
-												 [	-6.27146607, -0.00104596, 0.00064126, 7.27042012, 0.99680310, 0.99831278, 0.49300325],
-												 [	-6.27146774, -0.00104561, 0.00064104, 7.27042213, 0.99680418, 0.99831335, 0.49300340],
-												 [	-6.27146939, -0.00104525, 0.00064083, 7.27042414, 0.99680526, 0.99831392, 0.49300357],
-												 [	-6.27147105, -0.00104490, 0.00064061, 7.27042615, 0.99680634, 0.99831449, 0.49300370],
-												 [	-6.27147270, -0.00104455, 0.00064039, 7.27042815, 0.99680742, 0.99831506, 0.49300390],
-												 [	-6.27147434, -0.00104420, 0.00064018, 7.27043015, 0.99680850, 0.99831563, 0.49300402],
-												 [	-6.27147599, -0.00104384, 0.00063996, 7.27043214, 0.99680957, 0.99831620, 0.49300417],
-												 [	-6.27147762, -0.00104349, 0.00063975, 7.27043413, 0.99681065, 0.99831676, 0.49300431],
-												 [	-6.27147926, -0.00104314, 0.00063953, 7.27043612, 0.99681172, 0.99831733, 0.49300449],
-												 [	-6.27148089, -0.00104279, 0.00063931, 7.27043810, 0.99681280, 0.99831790, 0.49300460],
-												 [	-6.27148252, -0.00104244, 0.00063910, 7.27044008, 0.99681387, 0.99831846, 0.49300478],
-												 [	-6.27148414, -0.00104209, 0.00063888, 7.27044205, 0.99681495, 0.99831903, 0.49300494],
-												 [	-6.27148576, -0.00104174, 0.00063867, 7.27044402, 0.99681602, 0.99831959, 0.49300507],
-												 [	-6.27148738, -0.00104139, 0.00063845, 7.27044599, 0.99681709, 0.99832016, 0.49300523],
-												 [	-6.27148899, -0.00104104, 0.00063824, 7.27044795, 0.99681816, 0.99832072, 0.49300537],
-												 [	-6.27149060, -0.00104069, 0.00063802, 7.27044991, 0.99681923, 0.99832129, 0.49300552],
-												 [	-6.27149220, -0.00104034, 0.00063781, 7.27045186, 0.99682030, 0.99832185, 0.49300567],
-												 [	-6.27149380, -0.00103999, 0.00063760, 7.27045382, 0.99682137, 0.99832242, 0.49300583],
-												 [	-6.27149540, -0.00103964, 0.00063738, 7.27045576, 0.99682244, 0.99832298, 0.49300595],
-												 [	-6.27149699, -0.00103929, 0.00063717, 7.27045771, 0.99682351, 0.99832354, 0.49300609],
-												 [	-6.27149859, -0.00103894, 0.00063695, 7.27045964, 0.99682457, 0.99832411, 0.49300627],
-												 [	-6.27150017, -0.00103859, 0.00063674, 7.27046158, 0.99682564, 0.99832467, 0.49300642],
-												 [	-6.27150175, -0.00103824, 0.00063653, 7.27046351, 0.99682670, 0.99832523, 0.49300653],
-												 [	-6.27150333, -0.00103790, 0.00063631, 7.27046544, 0.99682777, 0.99832579, 0.49300671],
-												 [	-6.27150491, -0.00103755, 0.00063610, 7.27046736, 0.99682883, 0.99832635, 0.49300686],
-												 [	-6.27150648, -0.00103720, 0.00063589, 7.27046928, 0.99682990, 0.99832691, 0.49300700],
-												 [	-6.27150805, -0.00103685, 0.00063567, 7.27047120, 0.99683096, 0.99832747, 0.49300717],
-												 [	-6.27150962, -0.00103651, 0.00063546, 7.27047311, 0.99683202, 0.99832803, 0.49300731],
-												 [	-6.27151118, -0.00103616, 0.00063525, 7.27047502, 0.99683308, 0.99832859, 0.49300742],
-												 [	-6.27151274, -0.00103581, 0.00063503, 7.27047692, 0.99683414, 0.99832915, 0.49300759],
-												 [	-6.27151429, -0.00103547, 0.00063482, 7.27047882, 0.99683520, 0.99832971, 0.49300775],
-												 [	-6.27151584, -0.00103512, 0.00063461, 7.27048072, 0.99683626, 0.99833027, 0.49300787],
-												 [	-6.27151739, -0.00103478, 0.00063440, 7.27048262, 0.99683732, 0.99833083, 0.49300803],
-												 [	-6.27151893, -0.00103443, 0.00063419, 7.27048451, 0.99683838, 0.99833138, 0.49300818],
-												 [	-6.27152048, -0.00103408, 0.00063397, 7.27048639, 0.99683943, 0.99833194, 0.49300831],
-												 [	-6.27152201, -0.00103374, 0.00063376, 7.27048827, 0.99684049, 0.99833250, 0.49300846],
-												 [	-6.27152355, -0.00103339, 0.00063355, 7.27049015, 0.99684154, 0.99833306, 0.49300863],
-												 [	-6.27152508, -0.00103305, 0.00063334, 7.27049203, 0.99684260, 0.99833361, 0.49300877],
-												 [	-6.27152660, -0.00103270, 0.00063313, 7.27049390, 0.99684365, 0.99833417, 0.49300891],
-												 [	-6.27152813, -0.00103236, 0.00063292, 7.27049577, 0.99684471, 0.99833472, 0.49300907],
-												 [	-6.27152965, -0.00103202, 0.00063271, 7.27049763, 0.99684576, 0.99833528, 0.49300922],
-												 [	-6.27153117, -0.00103167, 0.00063249, 7.27049949, 0.99684681, 0.99833583, 0.49300935],
-												 [	-6.27153268, -0.00103133, 0.00063228, 7.27050135, 0.99684786, 0.99833639, 0.49300949],
-												 [	-6.27153419, -0.00103099, 0.00063207, 7.27050320, 0.99684891, 0.99833694, 0.49300966],
-												 [	-6.27153570, -0.00103064, 0.00063186, 7.27050505, 0.99684996, 0.99833749, 0.49300980],
-												 [	-6.27153720, -0.00103030, 0.00063165, 7.27050690, 0.99685101, 0.99833805, 0.49300992],
-												 [	-6.27153870, -0.00102996, 0.00063144, 7.27050874, 0.99685206, 0.99833860, 0.49301003],
-												 [	-6.27154020, -0.00102961, 0.00063123, 7.27051058, 0.99685311, 0.99833915, 0.49301024],
-												 [	-6.27154169, -0.00102927, 0.00063102, 7.27051242, 0.99685415, 0.99833971, 0.49301036],
-												 [	-6.27154318, -0.00102893, 0.00063081, 7.27051425, 0.99685520, 0.99834026, 0.49301051],
-												 [	-6.27154467, -0.00102859, 0.00063060, 7.27051608, 0.99685625, 0.99834081, 0.49301064],
-												 [	-6.27154615, -0.00102825, 0.00063039, 7.27051791, 0.99685729, 0.99834136, 0.49301076],
-												 [	-6.27154763, -0.00102791, 0.00063018, 7.27051973, 0.99685834, 0.99834191, 0.49301089],
-												 [	-6.27154911, -0.00102756, 0.00062997, 7.27052155, 0.99685938, 0.99834246, 0.49301105],
-												 [	-6.27155059, -0.00102722, 0.00062976, 7.27052336, 0.99686042, 0.99834301, 0.49301119],
-												 [	-6.27155206, -0.00102688, 0.00062956, 7.27052517, 0.99686146, 0.99834356, 0.49301134],
-												 [	-6.27155352, -0.00102654, 0.00062935, 7.27052698, 0.99686251, 0.99834411, 0.49301148],
-												 [	-6.27155499, -0.00102620, 0.00062914, 7.27052879, 0.99686355, 0.99834466, 0.49301163],
-												 [	-6.27155645, -0.00102586, 0.00062893, 7.27053059, 0.99686459, 0.99834521, 0.49301176],
-												 [	-6.27155791, -0.00102552, 0.00062872, 7.27053239, 0.99686563, 0.99834576, 0.49301188],
-												 [	-6.27155936, -0.00102518, 0.00062851, 7.27053418, 0.99686666, 0.99834630, 0.49301206],
-												 [	-6.27156082, -0.00102484, 0.00062830, 7.27053597, 0.99686770, 0.99834685, 0.49301220],
-												 [	-6.27156226, -0.00102451, 0.00062810, 7.27053776, 0.99686874, 0.99834740, 0.49301233],
-												 [	-6.27156371, -0.00102417, 0.00062789, 7.27053954, 0.99686978, 0.99834794, 0.49301246],
-												 [	-6.27156515, -0.00102383, 0.00062768, 7.27054132, 0.99687081, 0.99834849, 0.49301262],
-												 [	-6.27156659, -0.00102349, 0.00062747, 7.27054310, 0.99687185, 0.99834904, 0.49301280],
-												 [	-6.27156803, -0.00102315, 0.00062727, 7.27054488, 0.99687288, 0.99834958, 0.49301294],
-												 [	-6.27156946, -0.00102281, 0.00062706, 7.27054665, 0.99687392, 0.99835013, 0.49301309],
-												 [	-6.27157089, -0.00102248, 0.00062685, 7.27054842, 0.99687495, 0.99835067, 0.49301319],
-												 [	-6.27157232, -0.00102214, 0.00062664, 7.27055018, 0.99687598, 0.99835122, 0.49301335],
-												 [	-6.27157374, -0.00102180, 0.00062644, 7.27055194, 0.99687701, 0.99835176, 0.49301345],
-												 [	-6.27157517, -0.00102146, 0.00062623, 7.27055370, 0.99687805, 0.99835231, 0.49301362],
-												 [	-6.27157658, -0.00102113, 0.00062602, 7.27055546, 0.99687908, 0.99835285, 0.49301372],
-												 [	-6.27157800, -0.00102079, 0.00062582, 7.27055721, 0.99688011, 0.99835339, 0.49301383],
-												 [	-6.27157941, -0.00102045, 0.00062561, 7.27055896, 0.99688113, 0.99835393, 0.49301405],
-												 [	-6.27158082, -0.00102012, 0.00062540, 7.27056070, 0.99688216, 0.99835448, 0.49301418],
-												 [	-6.27158223, -0.00101978, 0.00062520, 7.27056244, 0.99688319, 0.99835502, 0.49301433],
-												 [	-6.27158363, -0.00101945, 0.00062499, 7.27056418, 0.99688422, 0.99835556, 0.49301444],
-												 [	-6.27158503, -0.00101911, 0.00062479, 7.27056592, 0.99688524, 0.99835610, 0.49301454],
-												 [	-6.27158643, -0.00101878, 0.00062458, 7.27056765, 0.99688627, 0.99835664, 0.49301468],
-												 [	-6.27158782, -0.00101844, 0.00062438, 7.27056938, 0.99688730, 0.99835718, 0.49301483],
-												 [	-6.27158921, -0.00101811, 0.00062417, 7.27057111, 0.99688832, 0.99835772, 0.49301499],
-												 [	-6.27159060, -0.00101777, 0.00062396, 7.27057283, 0.99688934, 0.99835826, 0.49301513],
-												 [	-6.27159199, -0.00101744, 0.00062376, 7.27057455, 0.99689037, 0.99835880, 0.49301528],
-												 [	-6.27159337, -0.00101710, 0.00062355, 7.27057627, 0.99689139, 0.99835934, 0.49301541],
-												 [	-6.27159475, -0.00101677, 0.00062335, 7.27057798, 0.99689241, 0.99835988, 0.49301553],
-												 [	-6.27159613, -0.00101644, 0.00062314, 7.27057969, 0.99689343, 0.99836042, 0.49301569],
-												 [	-6.27159750, -0.00101610, 0.00062294, 7.27058140, 0.99689445, 0.99836096, 0.49301584],
-												 [	-6.27159887, -0.00101577, 0.00062274, 7.27058310, 0.99689547, 0.99836150, 0.49301593],
-												 [	-6.27160024, -0.00101544, 0.00062253, 7.27058480, 0.99689649, 0.99836203, 0.49301608],
-												 [	-6.27160160, -0.00101510, 0.00062233, 7.27058650, 0.99689751, 0.99836257, 0.49301621],
-												 [	-6.27160297, -0.00101477, 0.00062212, 7.27058820, 0.99689853, 0.99836311, 0.49301634],
-												 [	-6.27160433, -0.00101444, 0.00062192, 7.27058989, 0.99689954, 0.99836364, 0.49301647],
-												 [	-6.27160568, -0.00101410, 0.00062171, 7.27059158, 0.99690056, 0.99836418, 0.49301663],
-												 [	-6.27160704, -0.00101377, 0.00062151, 7.27059327, 0.99690158, 0.99836472, 0.49301679],
-												 [	-6.27160839, -0.00101344, 0.00062131, 7.27059495, 0.99690259, 0.99836525, 0.49301693],
-												 [	-6.27160974, -0.00101311, 0.00062110, 7.27059663, 0.99690361, 0.99836579, 0.49301706],
-												 [	-6.27161108, -0.00101278, 0.00062090, 7.27059831, 0.99690462, 0.99836632, 0.49301722],
-												 [	-6.27161243, -0.00101245, 0.00062070, 7.27059998, 0.99690563, 0.99836686, 0.49301730],
-												 [	-6.27161377, -0.00101212, 0.00062049, 7.27060165, 0.99690664, 0.99836739, 0.49301748],
-												 [	-6.27161511, -0.00101179, 0.00062029, 7.27060332, 0.99690766, 0.99836792, 0.49301757],
-												 [	-6.27161644, -0.00101146, 0.00062009, 7.27060499, 0.99690867, 0.99836846, 0.49301772],
-												 [	-6.27161777, -0.00101112, 0.00061989, 7.27060665, 0.99690968, 0.99836899, 0.49301787],
-												 [	-6.27161910, -0.00101079, 0.00061968, 7.27060831, 0.99691069, 0.99836952, 0.49301798],
-												 [	-6.27162043, -0.00101046, 0.00061948, 7.27060996, 0.99691170, 0.99837005, 0.49301811],
-												 [	-6.27162175, -0.00101014, 0.00061928, 7.27061162, 0.99691271, 0.99837059, 0.49301825],
-												 [	-6.27162307, -0.00100981, 0.00061908, 7.27061327, 0.99691371, 0.99837112, 0.49301840],
-												 [	-6.27162439, -0.00100948, 0.00061887, 7.27061492, 0.99691472, 0.99837165, 0.49301855],
-												 [	-6.27162571, -0.00100915, 0.00061867, 7.27061656, 0.99691573, 0.99837218, 0.49301866],
-												 [	-6.27162702, -0.00100882, 0.00061847, 7.27061820, 0.99691673, 0.99837271, 0.49301881],
-												 [	-6.27162833, -0.00100849, 0.00061827, 7.27061984, 0.99691774, 0.99837324, 0.49301892],
-												 [	-6.27162964, -0.00100816, 0.00061807, 7.27062148, 0.99691874, 0.99837377, 0.49301906],
-												 [	-6.27163095, -0.00100783, 0.00061787, 7.27062311, 0.99691975, 0.99837430, 0.49301923],
-												 [	-6.27163225, -0.00100751, 0.00061767, 7.27062474, 0.99692075, 0.99837483, 0.49301935],
-												 [	-6.27163355, -0.00100718, 0.00061746, 7.27062637, 0.99692175, 0.99837536, 0.49301944],
-												 [	-6.27163485, -0.00100685, 0.00061726, 7.27062800, 0.99692275, 0.99837589, 0.49301961],
-												 [	-6.27163614, -0.00100652, 0.00061706, 7.27062962, 0.99692375, 0.99837641, 0.49301974],
-												 [	-6.27163743, -0.00100620, 0.00061686, 7.27063124, 0.99692476, 0.99837694, 0.49301990],
-												 [	-6.27163872, -0.00100587, 0.00061666, 7.27063285, 0.99692576, 0.99837747, 0.49301996],
-												 [	-6.27164001, -0.00100554, 0.00061646, 7.27063447, 0.99692675, 0.99837800, 0.49302013],
-												 [	-6.27164130, -0.00100522, 0.00061626, 7.27063608, 0.99692775, 0.99837852, 0.49302024],
-												 [	-6.27164258, -0.00100489, 0.00061606, 7.27063769, 0.99692875, 0.99837905, 0.49302039],
-												 [	-6.27164386, -0.00100456, 0.00061586, 7.27063929, 0.99692975, 0.99837957, 0.49302050],
-												 [	-6.27164513, -0.00100424, 0.00061566, 7.27064090, 0.99693075, 0.99838010, 0.49302064],
-												 [	-6.27164641, -0.00100391, 0.00061546, 7.27064250, 0.99693174, 0.99838063, 0.49302080],
-												 [	-6.27164768, -0.00100359, 0.00061526, 7.27064409, 0.99693274, 0.99838115, 0.49302092],
-												 [	-6.27164895, -0.00100326, 0.00061506, 7.27064569, 0.99693373, 0.99838168, 0.49302106],
-												 [	-6.27165022, -0.00100294, 0.00061486, 7.27064728, 0.99693473, 0.99838220, 0.49302117],
-												 [	-6.27165148, -0.00100261, 0.00061466, 7.27064887, 0.99693572, 0.99838272, 0.49302135],
-												 [	-6.27165274, -0.00100229, 0.00061446, 7.27065045, 0.99693671, 0.99838325, 0.49302147],
-												 [	-6.27165400, -0.00100196, 0.00061427, 7.27065204, 0.99693770, 0.99838377, 0.49302161],
-												 [	-6.27165526, -0.00100164, 0.00061407, 7.27065362, 0.99693870, 0.99838429, 0.49302174],
-												 [	-6.27165651, -0.00100132, 0.00061387, 7.27065520, 0.99693969, 0.99838482, 0.49302182],
-												 [	-6.27165777, -0.00100099, 0.00061367, 7.27065677, 0.99694068, 0.99838534, 0.49302200],
-												 [	-6.27165902, -0.00100067, 0.00061347, 7.27065835, 0.99694167, 0.99838586, 0.49302214],
-												 [	-6.27166026, -0.00100035, 0.00061327, 7.27065992, 0.99694266, 0.99838638, 0.49302227],
-												 [	-6.27166151, -0.00100002, 0.00061307, 7.27066149, 0.99694364, 0.99838690, 0.49302237],
-												 [	-6.27166275, -0.00099970, 0.00061288, 7.27066305, 0.99694463, 0.99838742, 0.49302253],
-												 [	-6.27166399, -0.00099938, 0.00061268, 7.27066461, 0.99694562, 0.99838795, 0.49302264],
-												 [	-6.27166523, -0.00099905, 0.00061248, 7.27066617, 0.99694660, 0.99838847, 0.49302277],
-												 [	-6.27166646, -0.00099873, 0.00061228, 7.27066773, 0.99694759, 0.99838899, 0.49302290],
-												 [	-6.27166770, -0.00099841, 0.00061208, 7.27066928, 0.99694858, 0.99838951, 0.49302301],
-												 [	-6.27166893, -0.00099809, 0.00061189, 7.27067084, 0.99694956, 0.99839002, 0.49302315],
-												 [	-6.27167015, -0.00099777, 0.00061169, 7.27067239, 0.99695054, 0.99839054, 0.49302331],
-												 [	-6.27167138, -0.00099745, 0.00061149, 7.27067393, 0.99695153, 0.99839106, 0.49302343],
-												 [	-6.27167260, -0.00099712, 0.00061130, 7.27067548, 0.99695251, 0.99839158, 0.49302354],
-												 [	-6.27167382, -0.00099680, 0.00061110, 7.27067702, 0.99695349, 0.99839210, 0.49302367],
-												 [	-6.27167504, -0.00099648, 0.00061090, 7.27067856, 0.99695447, 0.99839262, 0.49302378],
-												 [	-6.27167626, -0.00099616, 0.00061070, 7.27068010, 0.99695545, 0.99839313, 0.49302391],
-												 [	-6.27167747, -0.00099584, 0.00061051, 7.27068163, 0.99695643, 0.99839365, 0.49302405],
-												 [	-6.27167868, -0.00099552, 0.00061031, 7.27068316, 0.99695741, 0.99839417, 0.49302418],
-												 [	-6.27167989, -0.00099520, 0.00061012, 7.27068469, 0.99695839, 0.99839468, 0.49302428],
-												 [	-6.27168110, -0.00099488, 0.00060992, 7.27068622, 0.99695937, 0.99839520, 0.49302442],
-												 [	-6.27168231, -0.00099456, 0.00060972, 7.27068774, 0.99696035, 0.99839571, 0.49302457],
-												 [	-6.27168351, -0.00099424, 0.00060953, 7.27068927, 0.99696133, 0.99839623, 0.49302469],
-												 [	-6.27168471, -0.00099392, 0.00060933, 7.27069078, 0.99696230, 0.99839674, 0.49302483],
-												 [	-6.27168591, -0.00099360, 0.00060914, 7.27069230, 0.99696328, 0.99839726, 0.49302493],
-												 [	-6.27168710, -0.00099329, 0.00060894, 7.27069382, 0.99696425, 0.99839777, 0.49302510],
-												 [	-6.27168829, -0.00099297, 0.00060874, 7.27069533, 0.99696523, 0.99839829, 0.49302519],
-												 [	-6.27168949, -0.00099265, 0.00060855, 7.27069684, 0.99696620, 0.99839880, 0.49302531],
-												 [	-6.27169067, -0.00099233, 0.00060835, 7.27069834, 0.99696717, 0.99839931, 0.49302546],
-												 [	-6.27169186, -0.00099201, 0.00060816, 7.27069985, 0.99696815, 0.99839983, 0.49302559],
-												 [	-6.27169305, -0.00099170, 0.00060796, 7.27070135, 0.99696912, 0.99840034, 0.49302572],
-												 [	-6.27169423, -0.00099138, 0.00060777, 7.27070285, 0.99697009, 0.99840085, 0.49302581],
-												 [	-6.27169541, -0.00099106, 0.00060757, 7.27070435, 0.99697106, 0.99840137, 0.49302594],
-												 [	-6.27169659, -0.00099074, 0.00060738, 7.27070584, 0.99697203, 0.99840188, 0.49302606],
-												 [	-6.27169776, -0.00099043, 0.00060719, 7.27070734, 0.99697300, 0.99840239, 0.49302620],
-												 [	-6.27169893, -0.00099011, 0.00060699, 7.27070883, 0.99697397, 0.99840290, 0.49302635],
-												 [	-6.27170011, -0.00098979, 0.00060680, 7.27071031, 0.99697494, 0.99840341, 0.49302644],
-												 [	-6.27170128, -0.00098948, 0.00060660, 7.27071180, 0.99697590, 0.99840392, 0.49302662],
-												 [	-6.27170244, -0.00098916, 0.00060641, 7.27071328, 0.99697687, 0.99840443, 0.49302676],
-												 [	-6.27170361, -0.00098884, 0.00060622, 7.27071476, 0.99697784, 0.99840494, 0.49302682],
-												 [	-6.27170477, -0.00098853, 0.00060602, 7.27071624, 0.99697880, 0.99840545, 0.49302696],
-												 [	-6.27170593, -0.00098821, 0.00060583, 7.27071772, 0.99697977, 0.99840596, 0.49302711],
-												 [	-6.27170709, -0.00098790, 0.00060563, 7.27071919, 0.99698073, 0.99840647, 0.49302721],
-												 [	-6.27170825, -0.00098758, 0.00060544, 7.27072066, 0.99698170, 0.99840698, 0.49302733],
-												 [	-6.27170940, -0.00098727, 0.00060525, 7.27072213, 0.99698266, 0.99840748, 0.49302748],
-												 [	-6.27171055, -0.00098695, 0.00060505, 7.27072360, 0.99698362, 0.99840799, 0.49302765],
-												 [	-6.27171170, -0.00098664, 0.00060486, 7.27072506, 0.99698459, 0.99840850, 0.49302773],
-												 [	-6.27171285, -0.00098633, 0.00060467, 7.27072652, 0.99698555, 0.99840901, 0.49302786],
-												 [	-6.27171399, -0.00098601, 0.00060448, 7.27072798, 0.99698651, 0.99840951, 0.49302797],
-												 [	-6.27171514, -0.00098570, 0.00060428, 7.27072944, 0.99698747, 0.99841002, 0.49302811],
-												 [	-6.27171628, -0.00098538, 0.00060409, 7.27073090, 0.99698843, 0.99841053, 0.49302824],
-												 [	-6.27171742, -0.00098507, 0.00060390, 7.27073235, 0.99698939, 0.99841103, 0.49302835],
-												 [	-6.27171856, -0.00098476, 0.00060371, 7.27073380, 0.99699035, 0.99841154, 0.49302848],
-												 [	-6.27171969, -0.00098444, 0.00060351, 7.27073525, 0.99699130, 0.99841204, 0.49302858],
-												 [	-6.27172082, -0.00098413, 0.00060332, 7.27073669, 0.99699226, 0.99841255, 0.49302871],
-												 [	-6.27172196, -0.00098382, 0.00060313, 7.27073814, 0.99699322, 0.99841305, 0.49302887],
-												 [	-6.27172309, -0.00098351, 0.00060294, 7.27073958, 0.99699417, 0.99841356, 0.49302895],
-												 [	-6.27172421, -0.00098319, 0.00060275, 7.27074102, 0.99699513, 0.99841406, 0.49302912],
-												 [	-6.27172534, -0.00098288, 0.00060256, 7.27074246, 0.99699608, 0.99841456, 0.49302925],
-												 [	-6.27172646, -0.00098257, 0.00060236, 7.27074389, 0.99699704, 0.99841507, 0.49302935],
-												 [	-6.27172758, -0.00098226, 0.00060217, 7.27074532, 0.99699799, 0.99841557, 0.49302945],
-												 [	-6.27172870, -0.00098195, 0.00060198, 7.27074676, 0.99699894, 0.99841607, 0.49302959],
-												 [	-6.27172982, -0.00098163, 0.00060179, 7.27074818, 0.99699990, 0.99841657, 0.49302970],
-												 [	-6.27173093, -0.00098132, 0.00060160, 7.27074961, 0.99700085, 0.99841708, 0.49302981],
-												 [	-6.27173205, -0.00098101, 0.00060141, 7.27075103, 0.99700180, 0.99841758, 0.49302992],
-												 [	-6.27173316, -0.00098070, 0.00060122, 7.27075246, 0.99700275, 0.99841808, 0.49303009],
-												 [	-6.27173427, -0.00098039, 0.00060103, 7.27075388, 0.99700370, 0.99841858, 0.49303019],
-												 [	-6.27173537, -0.00098008, 0.00060084, 7.27075529, 0.99700465, 0.99841908, 0.49303031],
-												 [	-6.27173648, -0.00097977, 0.00060065, 7.27075671, 0.99700560, 0.99841958, 0.49303044],
-												 [	-6.27173758, -0.00097946, 0.00060046, 7.27075812, 0.99700655, 0.99842008, 0.49303056],
-												 [	-6.27173868, -0.00097915, 0.00060027, 7.27075953, 0.99700749, 0.99842058, 0.49303069],
-												 [	-6.27173978, -0.00097884, 0.00060008, 7.27076094, 0.99700844, 0.99842108, 0.49303080],
-												 [	-6.27174088, -0.00097853, 0.00059989, 7.27076235, 0.99700939, 0.99842158, 0.49303094],
-												 [	-6.27174198, -0.00097822, 0.00059970, 7.27076375, 0.99701033, 0.99842208, 0.49303107],
-												 [	-6.27174307, -0.00097791, 0.00059951, 7.27076516, 0.99701128, 0.99842258, 0.49303120],
-												 [	-6.27174416, -0.00097761, 0.00059932, 7.27076656, 0.99701222, 0.99842308, 0.49303132],
-												 [	-6.27174525, -0.00097730, 0.00059913, 7.27076795, 0.99701317, 0.99842357, 0.49303142],
-												 [	-6.27174634, -0.00097699, 0.00059894, 7.27076935, 0.99701411, 0.99842407, 0.49303154],
-												 [	-6.27174743, -0.00097668, 0.00059875, 7.27077075, 0.99701505, 0.99842457, 0.49303168],
-												 [	-6.27174851, -0.00097637, 0.00059856, 7.27077214, 0.99701599, 0.99842507, 0.49303176],
-												 [	-6.27174959, -0.00097606, 0.00059837, 7.27077353, 0.99701693, 0.99842556, 0.49303192],
-												 [	-6.27175067, -0.00097576, 0.00059818, 7.27077491, 0.99701788, 0.99842606, 0.49303205],
-												 [	-6.27175175, -0.00097545, 0.00059800, 7.27077630, 0.99701882, 0.99842656, 0.49303212],
-												 [	-6.27175283, -0.00097514, 0.00059781, 7.27077769, 0.99701976, 0.99842705, 0.49303223],
-												 [	-6.27175390, -0.00097484, 0.00059762, 7.27077907, 0.99702070, 0.99842755, 0.49303239],
-												 [	-6.27175497, -0.00097453, 0.00059743, 7.27078045, 0.99702163, 0.99842804, 0.49303247],
-												 [	-6.27175605, -0.00097422, 0.00059724, 7.27078182, 0.99702257, 0.99842854, 0.49303263],
-												 [	-6.27175712, -0.00097392, 0.00059705, 7.27078320, 0.99702351, 0.99842903, 0.49303277],
-												 [	-6.27175818, -0.00097361, 0.00059687, 7.27078457, 0.99702445, 0.99842952, 0.49303287],
-												 [	-6.27175925, -0.00097330, 0.00059668, 7.27078595, 0.99702538, 0.99843002, 0.49303298],
-												 [	-6.27176031, -0.00097300, 0.00059649, 7.27078731, 0.99702632, 0.99843051, 0.49303309],
-												 [	-6.27176137, -0.00097269, 0.00059630, 7.27078868, 0.99702725, 0.99843101, 0.49303324],
-												 [	-6.27176243, -0.00097239, 0.00059612, 7.27079005, 0.99702819, 0.99843150, 0.49303337],
-												 [	-6.27176349, -0.00097208, 0.00059593, 7.27079141, 0.99702912, 0.99843199, 0.49303342],
-												 [	-6.27176455, -0.00097178, 0.00059574, 7.27079277, 0.99703005, 0.99843248, 0.49303355],
-												 [	-6.27176560, -0.00097147, 0.00059555, 7.27079413, 0.99703099, 0.99843298, 0.49303367],
-												 [	-6.27176666, -0.00097117, 0.00059537, 7.27079549, 0.99703192, 0.99843347, 0.49303384],
-												 [	-6.27176771, -0.00097086, 0.00059518, 7.27079685, 0.99703285, 0.99843396, 0.49303391],
-												 [	-6.27176876, -0.00097056, 0.00059499, 7.27079820, 0.99703378, 0.99843445, 0.49303404],
-												 [	-6.27176980, -0.00097025, 0.00059481, 7.27079955, 0.99703471, 0.99843494, 0.49303417],
-												 [	-6.27177085, -0.00096995, 0.00059462, 7.27080090, 0.99703564, 0.99843543, 0.49303426],
-												 [	-6.27177189, -0.00096965, 0.00059443, 7.27080225, 0.99703657, 0.99843592, 0.49303442],
-												 [	-6.27177294, -0.00096934, 0.00059425, 7.27080359, 0.99703750, 0.99843641, 0.49303454],
-												 [	-6.27177398, -0.00096904, 0.00059406, 7.27080494, 0.99703843, 0.99843690, 0.49303464],
-												 [	-6.27177502, -0.00096874, 0.00059388, 7.27080628, 0.99703936, 0.99843739, 0.49303476],
-												 [	-6.27177605, -0.00096843, 0.00059369, 7.27080762, 0.99704028, 0.99843788, 0.49303487],
-												 [	-6.27177709, -0.00096813, 0.00059350, 7.27080896, 0.99704121, 0.99843837, 0.49303501],
-												 [	-6.27177812, -0.00096783, 0.00059332, 7.27081030, 0.99704213, 0.99843886, 0.49303512],
-												 [	-6.27177915, -0.00096752, 0.00059313, 7.27081163, 0.99704306, 0.99843934, 0.49303521],
-												 [	-6.27178018, -0.00096722, 0.00059295, 7.27081296, 0.99704398, 0.99843983, 0.49303537],
-												 [	-6.27178121, -0.00096692, 0.00059276, 7.27081429, 0.99704491, 0.99844032, 0.49303546],
-												 [	-6.27178224, -0.00096662, 0.00059258, 7.27081562, 0.99704583, 0.99844081, 0.49303558],
-												 [	-6.27178326, -0.00096632, 0.00059239, 7.27081695, 0.99704675, 0.99844129, 0.49303575],
-												 [	-6.27178429, -0.00096602, 0.00059221, 7.27081827, 0.99704768, 0.99844178, 0.49303581],
-												 [	-6.27178531, -0.00096571, 0.00059202, 7.27081960, 0.99704860, 0.99844227, 0.49303591],
-												 [	-6.27178633, -0.00096541, 0.00059184, 7.27082092, 0.99704952, 0.99844275, 0.49303609],
-												 [	-6.27178735, -0.00096511, 0.00059165, 7.27082224, 0.99705044, 0.99844324, 0.49303618],
-												 [	-6.27178836, -0.00096481, 0.00059147, 7.27082355, 0.99705136, 0.99844372, 0.49303628],
-												 [	-6.27178938, -0.00096451, 0.00059128, 7.27082487, 0.99705228, 0.99844421, 0.49303641],
-												 [	-6.27179039, -0.00096421, 0.00059110, 7.27082618, 0.99705320, 0.99844469, 0.49303652],
-												 [	-6.27179140, -0.00096391, 0.00059091, 7.27082749, 0.99705412, 0.99844518, 0.49303666],
-												 [	-6.27179242, -0.00096361, 0.00059073, 7.27082881, 0.99705503, 0.99844566, 0.49303673],
-												 [	-6.27179342, -0.00096331, 0.00059055, 7.27083011, 0.99705595, 0.99844614, 0.49303690],
-												 [	-6.27179443, -0.00096301, 0.00059036, 7.27083142, 0.99705687, 0.99844663, 0.49303700],
-												 [	-6.27179544, -0.00096271, 0.00059018, 7.27083272, 0.99705778, 0.99844711, 0.49303712],
-												 [	-6.27179644, -0.00096241, 0.00058999, 7.27083403, 0.99705870, 0.99844759, 0.49303722],
-												 [	-6.27179744, -0.00096211, 0.00058981, 7.27083533, 0.99705961, 0.99844808, 0.49303732],
-												 [	-6.27179844, -0.00096181, 0.00058963, 7.27083663, 0.99706053, 0.99844856, 0.49303745],
-												 [	-6.27179944, -0.00096152, 0.00058944, 7.27083792, 0.99706144, 0.99844904, 0.49303757],
-												 [	-6.27180044, -0.00096122, 0.00058926, 7.27083922, 0.99706235, 0.99844952, 0.49303771],
-												 [	-6.27180143, -0.00096092, 0.00058908, 7.27084051, 0.99706327, 0.99845000, 0.49303777],
-												 [	-6.27180243, -0.00096062, 0.00058890, 7.27084181, 0.99706418, 0.99845048, 0.49303795],
-												 [	-6.27180342, -0.00096032, 0.00058871, 7.27084310, 0.99706509, 0.99845097, 0.49303802],
-												 [	-6.27180441, -0.00096002, 0.00058853, 7.27084438, 0.99706600, 0.99845145, 0.49303815],
-												 [	-6.27180540, -0.00095973, 0.00058835, 7.27084567, 0.99706691, 0.99845193, 0.49303827],
-												 [	-6.27180639, -0.00095943, 0.00058816, 7.27084696, 0.99706782, 0.99845241, 0.49303836],
-												 [	-6.27180737, -0.00095913, 0.00058798, 7.27084824, 0.99706873, 0.99845289, 0.49303844],
-												 [	-6.27180836, -0.00095884, 0.00058780, 7.27084952, 0.99706964, 0.99845336, 0.49303861],
-												 [	-6.27180934, -0.00095854, 0.00058762, 7.27085080, 0.99707055, 0.99845384, 0.49303868],
-												 [	-6.27181032, -0.00095824, 0.00058744, 7.27085208, 0.99707145, 0.99845432, 0.49303884],
-												 [	-6.27181130, -0.00095795, 0.00058725, 7.27085335, 0.99707236, 0.99845480, 0.49303895],
-												 [	-6.27181228, -0.00095765, 0.00058707, 7.27085463, 0.99707327, 0.99845528, 0.49303908],
-												 [	-6.27181325, -0.00095735, 0.00058689, 7.27085590, 0.99707417, 0.99845576, 0.49303915],
-												 [	-6.27181423, -0.00095706, 0.00058671, 7.27085717, 0.99707508, 0.99845623, 0.49303928],
-												 [	-6.27181520, -0.00095676, 0.00058653, 7.27085844, 0.99707598, 0.99845671, 0.49303940],
-												 [	-6.27181618, -0.00095647, 0.00058635, 7.27085971, 0.99707689, 0.99845719, 0.49303950],
-												 [	-6.27181715, -0.00095617, 0.00058616, 7.27086098, 0.99707779, 0.99845766, 0.49303965],
-												 [	-6.27181811, -0.00095588, 0.00058598, 7.27086224, 0.99707869, 0.99845814, 0.49303979],
-												 [	-6.27181908, -0.00095558, 0.00058580, 7.27086350, 0.99707960, 0.99845862, 0.49303989],
-												 [	-6.27182005, -0.00095529, 0.00058562, 7.27086476, 0.99708050, 0.99845909, 0.49303994],
-												 [	-6.27182101, -0.00095499, 0.00058544, 7.27086602, 0.99708140, 0.99845957, 0.49304006],
-												 [	-6.27182198, -0.00095470, 0.00058526, 7.27086728, 0.99708230, 0.99846004, 0.49304023],
-												 [	-6.27182294, -0.00095440, 0.00058508, 7.27086854, 0.99708320, 0.99846052, 0.49304031],
-												 [	-6.27182390, -0.00095411, 0.00058490, 7.27086979, 0.99708410, 0.99846099, 0.49304040],
-												 [	-6.27182486, -0.00095381, 0.00058472, 7.27087104, 0.99708500, 0.99846147, 0.49304052],
-												 [	-6.27182581, -0.00095352, 0.00058454, 7.27087229, 0.99708590, 0.99846194, 0.49304066],
-												 [	-6.27182677, -0.00095323, 0.00058436, 7.27087354, 0.99708680, 0.99846242, 0.49304078],
-												 [	-6.27182772, -0.00095293, 0.00058418, 7.27087479, 0.99708769, 0.99846289, 0.49304090],
-												 [	-6.27182867, -0.00095264, 0.00058400, 7.27087603, 0.99708859, 0.99846336, 0.49304102],
-												 [	-6.27182963, -0.00095235, 0.00058382, 7.27087728, 0.99708949, 0.99846383, 0.49304112],
-												 [	-6.27183058, -0.00095205, 0.00058364, 7.27087852, 0.99709038, 0.99846431, 0.49304120],
-												 [	-6.27183152, -0.00095176, 0.00058346, 7.27087976, 0.99709128, 0.99846478, 0.49304129],
-												 [	-6.27183247, -0.00095147, 0.00058328, 7.27088100, 0.99709217, 0.99846525, 0.49304145],
-												 [	-6.27183342, -0.00095118, 0.00058310, 7.27088224, 0.99709307, 0.99846572, 0.49304157],
-												 [	-6.27183436, -0.00095088, 0.00058292, 7.27088348, 0.99709396, 0.99846619, 0.49304165],
-												 [	-6.27183530, -0.00095059, 0.00058274, 7.27088471, 0.99709485, 0.99846667, 0.49304175],
-												 [	-6.27183624, -0.00095030, 0.00058256, 7.27088594, 0.99709575, 0.99846714, 0.49304190],
-												 [	-6.27183718, -0.00095001, 0.00058238, 7.27088717, 0.99709664, 0.99846761, 0.49304204],
-												 [	-6.27183812, -0.00094972, 0.00058221, 7.27088840, 0.99709753, 0.99846808, 0.49304212],
-												 [	-6.27183906, -0.00094943, 0.00058203, 7.27088963, 0.99709842, 0.99846855, 0.49304222],
-												 [	-6.27183999, -0.00094914, 0.00058185, 7.27089086, 0.99709931, 0.99846902, 0.49304233],
-												 [	-6.27184093, -0.00094884, 0.00058167, 7.27089208, 0.99710020, 0.99846949, 0.49304245],
-												 [	-6.27184186, -0.00094855, 0.00058149, 7.27089331, 0.99710109, 0.99846996, 0.49304255],
-												 [	-6.27184279, -0.00094826, 0.00058131, 7.27089453, 0.99710198, 0.99847042, 0.49304263],
-												 [	-6.27184372, -0.00094797, 0.00058113, 7.27089575, 0.99710287, 0.99847089, 0.49304277],
-												 [	-6.27184465, -0.00094768, 0.00058096, 7.27089697, 0.99710375, 0.99847136, 0.49304288],
-												 [	-6.27184558, -0.00094739, 0.00058078, 7.27089818, 0.99710464, 0.99847183, 0.49304302],
-												 [	-6.27184650, -0.00094710, 0.00058060, 7.27089940, 0.99710553, 0.99847230, 0.49304309],
-												 [	-6.27184743, -0.00094681, 0.00058042, 7.27090061, 0.99710641, 0.99847276, 0.49304322],
-												 [	-6.27184835, -0.00094652, 0.00058025, 7.27090182, 0.99710730, 0.99847323, 0.49304332],
-												 [	-6.27184927, -0.00094623, 0.00058007, 7.27090304, 0.99710818, 0.99847370, 0.49304348],
-												 [	-6.27185019, -0.00094595, 0.00057989, 7.27090424, 0.99710907, 0.99847416, 0.49304351],
-												 [	-6.27185111, -0.00094566, 0.00057971, 7.27090545, 0.99710995, 0.99847463, 0.49304363],
-												 [	-6.27185203, -0.00094537, 0.00057954, 7.27090666, 0.99711083, 0.99847510, 0.49304378],
-												 [	-6.27185294, -0.00094508, 0.00057936, 7.27090786, 0.99711172, 0.99847556, 0.49304390],
-												 [	-6.27185386, -0.00094479, 0.00057918, 7.27090907, 0.99711260, 0.99847603, 0.49304399],
-												 [	-6.27185477, -0.00094450, 0.00057901, 7.27091027, 0.99711348, 0.99847649, 0.49304412],
-												 [	-6.27185568, -0.00094421, 0.00057883, 7.27091147, 0.99711436, 0.99847696, 0.49304419],
-												 [	-6.27185659, -0.00094393, 0.00057865, 7.27091267, 0.99711524, 0.99847742, 0.49304433],
-												 [	-6.27185750, -0.00094364, 0.00057848, 7.27091386, 0.99711612, 0.99847789, 0.49304445],
-												 [	-6.27185841, -0.00094335, 0.00057830, 7.27091506, 0.99711700, 0.99847835, 0.49304453],
-												 [	-6.27185932, -0.00094306, 0.00057812, 7.27091625, 0.99711788, 0.99847881, 0.49304463],
-												 [	-6.27186022, -0.00094278, 0.00057795, 7.27091745, 0.99711876, 0.99847928, 0.49304471],
-												 [	-6.27186113, -0.00094249, 0.00057777, 7.27091864, 0.99711964, 0.99847974, 0.49304488],
-												 [	-6.27186203, -0.00094220, 0.00057759, 7.27091983, 0.99712051, 0.99848020, 0.49304496],
-												 [	-6.27186293, -0.00094192, 0.00057742, 7.27092101, 0.99712139, 0.99848067, 0.49304509],
-												 [	-6.27186383, -0.00094163, 0.00057724, 7.27092220, 0.99712227, 0.99848113, 0.49304521],
-												 [	-6.27186473, -0.00094134, 0.00057707, 7.27092339, 0.99712314, 0.99848159, 0.49304528],
-												 [	-6.27186563, -0.00094106, 0.00057689, 7.27092457, 0.99712402, 0.99848205, 0.49304542],
-												 [	-6.27186652, -0.00094077, 0.00057672, 7.27092575, 0.99712489, 0.99848251, 0.49304552],
-												 [	-6.27186742, -0.00094049, 0.00057654, 7.27092693, 0.99712577, 0.99848297, 0.49304562],
-												 [	-6.27186831, -0.00094020, 0.00057636, 7.27092811, 0.99712664, 0.99848344, 0.49304571],
-												 [	-6.27186920, -0.00093991, 0.00057619, 7.27092929, 0.99712751, 0.99848390, 0.49304585],
-												 [	-6.27187010, -0.00093963, 0.00057601, 7.27093047, 0.99712839, 0.99848436, 0.49304595],
-												 [	-6.27187098, -0.00093934, 0.00057584, 7.27093164, 0.99712926, 0.99848482, 0.49304606],
-												 [	-6.27187187, -0.00093906, 0.00057567, 7.27093281, 0.99713013, 0.99848528, 0.49304619],
-												 [	-6.27187276, -0.00093877, 0.00057549, 7.27093399, 0.99713100, 0.99848574, 0.49304625],
-												 [	-6.27187365, -0.00093849, 0.00057532, 7.27093516, 0.99713187, 0.99848619, 0.49304638],
-												 [	-6.27187453, -0.00093821, 0.00057514, 7.27093633, 0.99713274, 0.99848665, 0.49304650],
-												 [	-6.27187541, -0.00093792, 0.00057497, 7.27093749, 0.99713361, 0.99848711, 0.49304662],
-												 [	-6.27187630, -0.00093764, 0.00057479, 7.27093866, 0.99713448, 0.99848757, 0.49304675],
-												 [	-6.27187718, -0.00093735, 0.00057462, 7.27093983, 0.99713535, 0.99848803, 0.49304680],
-												 [	-6.27187806, -0.00093707, 0.00057444, 7.27094099, 0.99713622, 0.99848849, 0.49304696],
-												 [	-6.27187894, -0.00093679, 0.00057427, 7.27094215, 0.99713708, 0.99848894, 0.49304701],
-												 [	-6.27187981, -0.00093650, 0.00057410, 7.27094331, 0.99713795, 0.99848940, 0.49304717],
-												 [	-6.27188069, -0.00093622, 0.00057392, 7.27094447, 0.99713882, 0.99848986, 0.49304726],
-												 [	-6.27188156, -0.00093594, 0.00057375, 7.27094563, 0.99713968, 0.99849031, 0.49304734],
-												 [	-6.27188244, -0.00093565, 0.00057358, 7.27094678, 0.99714055, 0.99849077, 0.49304749],
-												 [	-6.27188331, -0.00093537, 0.00057340, 7.27094794, 0.99714141, 0.99849123, 0.49304756],
-												 [	-6.27188418, -0.00093509, 0.00057323, 7.27094909, 0.99714228, 0.99849168, 0.49304769],
-												 [	-6.27188505, -0.00093481, 0.00057306, 7.27095025, 0.99714314, 0.99849214, 0.49304781],
-												 [	-6.27188592, -0.00093452, 0.00057288, 7.27095140, 0.99714400, 0.99849259, 0.49304789],
-												 [	-6.27188679, -0.00093424, 0.00057271, 7.27095255, 0.99714486, 0.99849305, 0.49304797],
-												 [	-6.27188765, -0.00093396, 0.00057254, 7.27095369, 0.99714573, 0.99849350, 0.49304811],
-												 [	-6.27188852, -0.00093368, 0.00057236, 7.27095484, 0.99714659, 0.99849396, 0.49304819],
-												 [	-6.27188938, -0.00093340, 0.00057219, 7.27095599, 0.99714745, 0.99849441, 0.49304832],
-												 [	-6.27189025, -0.00093312, 0.00057202, 7.27095713, 0.99714831, 0.99849487, 0.49304841],
-												 [	-6.27189111, -0.00093283, 0.00057185, 7.27095827, 0.99714917, 0.99849532, 0.49304852],
-												 [	-6.27189197, -0.00093255, 0.00057167, 7.27095942, 0.99715003, 0.99849577, 0.49304861],
-												 [	-6.27189283, -0.00093227, 0.00057150, 7.27096056, 0.99715089, 0.99849623, 0.49304875],
-												 [	-6.27189369, -0.00093199, 0.00057133, 7.27096169, 0.99715175, 0.99849668, 0.49304884],
-												 [	-6.27189454, -0.00093171, 0.00057116, 7.27096283, 0.99715260, 0.99849713, 0.49304894],
-												 [	-6.27189540, -0.00093143, 0.00057098, 7.27096397, 0.99715346, 0.99849758, 0.49304909],
-												 [	-6.27189625, -0.00093115, 0.00057081, 7.27096510, 0.99715432, 0.99849804, 0.49304918],
-												 [	-6.27189711, -0.00093087, 0.00057064, 7.27096624, 0.99715517, 0.99849849, 0.49304926],
-												 [	-6.27189796, -0.00093059, 0.00057047, 7.27096737, 0.99715603, 0.99849894, 0.49304941],
-												 [	-6.27189881, -0.00093031, 0.00057030, 7.27096850, 0.99715689, 0.99849939, 0.49304950],
-												 [	-6.27189966, -0.00093003, 0.00057013, 7.27096963, 0.99715774, 0.99849984, 0.49304958],
-												 [	-6.27190051, -0.00092975, 0.00056995, 7.27097076, 0.99715860, 0.99850029, 0.49304964],
-												 [	-6.27190136, -0.00092947, 0.00056978, 7.27097188, 0.99715945, 0.99850074, 0.49304982],
-												 [	-6.27190220, -0.00092919, 0.00056961, 7.27097301, 0.99716030, 0.99850119, 0.49304989],
-												 [	-6.27190305, -0.00092892, 0.00056944, 7.27097413, 0.99716115, 0.99850164, 0.49305004],
-												 [	-6.27190389, -0.00092864, 0.00056927, 7.27097525, 0.99716201, 0.99850209, 0.49305011],
-												 [	-6.27190474, -0.00092836, 0.00056910, 7.27097638, 0.99716286, 0.99850254, 0.49305025],
-												 [	-6.27190558, -0.00092808, 0.00056893, 7.27097750, 0.99716371, 0.99850299, 0.49305033],
-												 [	-6.27190642, -0.00092780, 0.00056876, 7.27097862, 0.99716456, 0.99850344, 0.49305045],
-												 [	-6.27190726, -0.00092752, 0.00056859, 7.27097973, 0.99716541, 0.99850389, 0.49305056],
-												 [	-6.27190810, -0.00092725, 0.00056842, 7.27098085, 0.99716626, 0.99850434, 0.49305065],
-												 [	-6.27190893, -0.00092697, 0.00056825, 7.27098197, 0.99716711, 0.99850478, 0.49305076],
-												 [	-6.27190977, -0.00092669, 0.00056808, 7.27098308, 0.99716796, 0.99850523, 0.49305085],
-												 [	-6.27191061, -0.00092641, 0.00056791, 7.27098419, 0.99716881, 0.99850568, 0.49305094],
-												 [	-6.27191144, -0.00092614, 0.00056774, 7.27098530, 0.99716965, 0.99850613, 0.49305108],
-												 [	-6.27191227, -0.00092586, 0.00056757, 7.27098641, 0.99717050, 0.99850657, 0.49305115],
-												 [	-6.27191311, -0.00092558, 0.00056740, 7.27098752, 0.99717135, 0.99850702, 0.49305125],
-												 [	-6.27191394, -0.00092531, 0.00056723, 7.27098863, 0.99717219, 0.99850747, 0.49305139],
-												 [	-6.27191477, -0.00092503, 0.00056706, 7.27098974, 0.99717304, 0.99850791, 0.49305148],
-												 [	-6.27191559, -0.00092475, 0.00056689, 7.27099084, 0.99717389, 0.99850836, 0.49305158],
-												 [	-6.27191642, -0.00092448, 0.00056672, 7.27099194, 0.99717473, 0.99850880, 0.49305167],
-												 [	-6.27191725, -0.00092420, 0.00056655, 7.27099305, 0.99717557, 0.99850925, 0.49305181],
-												 [	-6.27191807, -0.00092393, 0.00056638, 7.27099415, 0.99717642, 0.99850969, 0.49305190],
-												 [	-6.27191890, -0.00092365, 0.00056621, 7.27099525, 0.99717726, 0.99851014, 0.49305201],
-												 [	-6.27191972, -0.00092338, 0.00056604, 7.27099635, 0.99717810, 0.99851058, 0.49305208],
-												 [	-6.27192054, -0.00092310, 0.00056587, 7.27099744, 0.99717895, 0.99851103, 0.49305223],
-												 [	-6.27192136, -0.00092282, 0.00056570, 7.27099854, 0.99717979, 0.99851147, 0.49305232],
-												 [	-6.27192218, -0.00092255, 0.00056553, 7.27099964, 0.99718063, 0.99851192, 0.49305243],
-												 [	-6.27192300, -0.00092227, 0.00056537, 7.27100073, 0.99718147, 0.99851236, 0.49305250],
-												 [	-6.27192382, -0.00092200, 0.00056520, 7.27100182, 0.99718231, 0.99851280, 0.49305258],
-												 [	-6.27192464, -0.00092173, 0.00056503, 7.27100291, 0.99718315, 0.99851325, 0.49305275],
-												 [	-6.27192545, -0.00092145, 0.00056486, 7.27100400, 0.99718399, 0.99851369, 0.49305278],
-												 [	-6.27192627, -0.00092118, 0.00056469, 7.27100509, 0.99718483, 0.99851413, 0.49305295],
-												 [	-6.27192708, -0.00092090, 0.00056452, 7.27100618, 0.99718566, 0.99851457, 0.49305299],
-												 [	-6.27192790, -0.00092063, 0.00056436, 7.27100727, 0.99718650, 0.99851502, 0.49305314],
-												 [	-6.27192871, -0.00092036, 0.00056419, 7.27100835, 0.99718734, 0.99851546, 0.49305323],
-												 [	-6.27192952, -0.00092008, 0.00056402, 7.27100944, 0.99718818, 0.99851590, 0.49305333],
-												 [	-6.27193033, -0.00091981, 0.00056385, 7.27101052, 0.99718901, 0.99851634, 0.49305345],
-												 [	-6.27193114, -0.00091954, 0.00056368, 7.27101160, 0.99718985, 0.99851678, 0.49305349],
-												 [	-6.27193194, -0.00091926, 0.00056352, 7.27101268, 0.99719068, 0.99851722, 0.49305365],
-												 [	-6.27193275, -0.00091899, 0.00056335, 7.27101376, 0.99719152, 0.99851766, 0.49305371],
-												 [	-6.27193356, -0.00091872, 0.00056318, 7.27101484, 0.99719235, 0.99851810, 0.49305382],
-												 [	-6.27193436, -0.00091844, 0.00056301, 7.27101592, 0.99719318, 0.99851854, 0.49305392],
-												 [	-6.27193516, -0.00091817, 0.00056285, 7.27101699, 0.99719402, 0.99851898, 0.49305400],
-												 [	-6.27193597, -0.00091790, 0.00056268, 7.27101807, 0.99719485, 0.99851942, 0.49305415],
-												 [	-6.27193677, -0.00091763, 0.00056251, 7.27101914, 0.99719568, 0.99851986, 0.49305427],
-												 [	-6.27193757, -0.00091736, 0.00056235, 7.27102021, 0.99719651, 0.99852030, 0.49305437],
-												 [	-6.27193837, -0.00091708, 0.00056218, 7.27102128, 0.99719735, 0.99852074, 0.49305443],
-												 [	-6.27193917, -0.00091681, 0.00056201, 7.27102235, 0.99719818, 0.99852117, 0.49305458],
-												 [	-6.27193996, -0.00091654, 0.00056185, 7.27102342, 0.99719901, 0.99852161, 0.49305464],
-												 [	-6.27194076, -0.00091627, 0.00056168, 7.27102449, 0.99719984, 0.99852205, 0.49305472],
-												 [	-6.27194155, -0.00091600, 0.00056151, 7.27102556, 0.99720066, 0.99852249, 0.49305485],
-												 [	-6.27194235, -0.00091573, 0.00056135, 7.27102662, 0.99720149, 0.99852292, 0.49305488],
-												 [	-6.27194314, -0.00091546, 0.00056118, 7.27102769, 0.99720232, 0.99852336, 0.49305501],
-												 [	-6.27194394, -0.00091519, 0.00056102, 7.27102875, 0.99720315, 0.99852380, 0.49305520],
-												 [	-6.27194473, -0.00091492, 0.00056085, 7.27102981, 0.99720398, 0.99852423, 0.49305527],
-												 [	-6.27194552, -0.00091465, 0.00056068, 7.27103087, 0.99720480, 0.99852467, 0.49305537],
-												 [	-6.27194631, -0.00091438, 0.00056052, 7.27103193, 0.99720563, 0.99852511, 0.49305541],
-												 [	-6.27194710, -0.00091411, 0.00056035, 7.27103299, 0.99720646, 0.99852554, 0.49305558],
-												 [	-6.27194788, -0.00091384, 0.00056019, 7.27103405, 0.99720728, 0.99852598, 0.49305568],
-												 [	-6.27194867, -0.00091357, 0.00056002, 7.27103510, 0.99720811, 0.99852641, 0.49305582],
-												 [	-6.27194946, -0.00091330, 0.00055986, 7.27103616, 0.99720893, 0.99852685, 0.49305585],
-												 [	-6.27195024, -0.00091303, 0.00055969, 7.27103721, 0.99720975, 0.99852728, 0.49305599],
-												 [	-6.27195102, -0.00091276, 0.00055953, 7.27103827, 0.99721058, 0.99852772, 0.49305606],
-												 [	-6.27195181, -0.00091249, 0.00055936, 7.27103932, 0.99721140, 0.99852815, 0.49305614],
-												 [	-6.27195259, -0.00091222, 0.00055920, 7.27104037, 0.99721222, 0.99852858, 0.49305629],
-												 [	-6.27195337, -0.00091195, 0.00055903, 7.27104142, 0.99721304, 0.99852902, 0.49305636],
-												 [	-6.27195415, -0.00091168, 0.00055887, 7.27104247, 0.99721387, 0.99852945, 0.49305643],
-												 [	-6.27195493, -0.00091141, 0.00055870, 7.27104351, 0.99721469, 0.99852988, 0.49305655],
-												 [	-6.27195571, -0.00091115, 0.00055854, 7.27104456, 0.99721551, 0.99853032, 0.49305663],
-												 [	-6.27195648, -0.00091088, 0.00055837, 7.27104561, 0.99721633, 0.99853075, 0.49305679],
-												 [	-6.27195726, -0.00091061, 0.00055821, 7.27104665, 0.99721715, 0.99853118, 0.49305682],
-												 [	-6.27195803, -0.00091034, 0.00055804, 7.27104769, 0.99721796, 0.99853161, 0.49305696],
-												 [	-6.27195881, -0.00091007, 0.00055788, 7.27104873, 0.99721878, 0.99853205, 0.49305711],
-												 [	-6.27195958, -0.00090981, 0.00055771, 7.27104978, 0.99721960, 0.99853248, 0.49305719],
-												 [	-6.27196035, -0.00090954, 0.00055755, 7.27105081, 0.99722042, 0.99853291, 0.49305721],
-												 [	-6.27196113, -0.00090927, 0.00055739, 7.27105185, 0.99722124, 0.99853334, 0.49305736],
-												 [	-6.27196190, -0.00090901, 0.00055722, 7.27105289, 0.99722205, 0.99853377, 0.49305741],
-												 [	-6.27196267, -0.00090874, 0.00055706, 7.27105393, 0.99722287, 0.99853420, 0.49305756],
-												 [	-6.27196344, -0.00090847, 0.00055690, 7.27105496, 0.99722368, 0.99853463, 0.49305766],
-												 [	-6.27196420, -0.00090821, 0.00055673, 7.27105600, 0.99722450, 0.99853506, 0.49305779],
-												 [	-6.27196497, -0.00090794, 0.00055657, 7.27105703, 0.99722531, 0.99853549, 0.49305788],
-												 [	-6.27196574, -0.00090767, 0.00055641, 7.27105806, 0.99722613, 0.99853592, 0.49305797],
-												 [	-6.27196650, -0.00090741, 0.00055624, 7.27105909, 0.99722694, 0.99853635, 0.49305806],
-												 [	-6.27196726, -0.00090714, 0.00055608, 7.27106012, 0.99722776, 0.99853678, 0.49305817],
-												 [	-6.27196803, -0.00090688, 0.00055592, 7.27106115, 0.99722857, 0.99853721, 0.49305825],
-												 [	-6.27196879, -0.00090661, 0.00055575, 7.27106218, 0.99722938, 0.99853764, 0.49305840],
-												 [	-6.27196955, -0.00090634, 0.00055559, 7.27106321, 0.99723019, 0.99853807, 0.49305847],
-												 [	-6.27197031, -0.00090608, 0.00055543, 7.27106423, 0.99723100, 0.99853849, 0.49305859],
-												 [	-6.27197107, -0.00090581, 0.00055526, 7.27106526, 0.99723181, 0.99853892, 0.49305865],
-												 [	-6.27197183, -0.00090555, 0.00055510, 7.27106628, 0.99723262, 0.99853935, 0.49305875],
-												 [	-6.27197259, -0.00090528, 0.00055494, 7.27106730, 0.99723343, 0.99853978, 0.49305889],
-												 [	-6.27197335, -0.00090502, 0.00055478, 7.27106833, 0.99723424, 0.99854020, 0.49305896],
-												 [	-6.27197410, -0.00090476, 0.00055461, 7.27106935, 0.99723505, 0.99854063, 0.49305906],
-												 [	-6.27197486, -0.00090449, 0.00055445, 7.27107037, 0.99723586, 0.99854106, 0.49305911],
-												 [	-6.27197561, -0.00090423, 0.00055429, 7.27107138, 0.99723667, 0.99854148, 0.49305929],
-												 [	-6.27197637, -0.00090396, 0.00055413, 7.27107240, 0.99723748, 0.99854191, 0.49305933],
-												 [	-6.27197712, -0.00090370, 0.00055397, 7.27107342, 0.99723828, 0.99854233, 0.49305943],
-												 [	-6.27197787, -0.00090344, 0.00055380, 7.27107443, 0.99723909, 0.99854276, 0.49305954],
-												 [	-6.27197862, -0.00090317, 0.00055364, 7.27107545, 0.99723990, 0.99854319, 0.49305965],
-												 [	-6.27197937, -0.00090291, 0.00055348, 7.27107646, 0.99724070, 0.99854361, 0.49305972],
-												 [	-6.27198012, -0.00090264, 0.00055332, 7.27107748, 0.99724151, 0.99854404, 0.49305986],
-												 [	-6.27198087, -0.00090238, 0.00055316, 7.27107849, 0.99724231, 0.99854446, 0.49305996],
-												 [	-6.27198162, -0.00090212, 0.00055300, 7.27107950, 0.99724312, 0.99854488, 0.49306003],
-												 [	-6.27198236, -0.00090186, 0.00055284, 7.27108051, 0.99724392, 0.99854531, 0.49306014],
-												 [	-6.27198311, -0.00090159, 0.00055267, 7.27108151, 0.99724472, 0.99854573, 0.49306027],
-												 [	-6.27198385, -0.00090133, 0.00055251, 7.27108252, 0.99724553, 0.99854616, 0.49306036],
-												 [	-6.27198460, -0.00090107, 0.00055235, 7.27108353, 0.99724633, 0.99854658, 0.49306043],
-												 [	-6.27198534, -0.00090081, 0.00055219, 7.27108453, 0.99724713, 0.99854700, 0.49306047],
-												 [	-6.27198608, -0.00090054, 0.00055203, 7.27108554, 0.99724793, 0.99854742, 0.49306066],
-												 [	-6.27198682, -0.00090028, 0.00055187, 7.27108654, 0.99724873, 0.99854785, 0.49306072],
-												 [	-6.27198756, -0.00090002, 0.00055171, 7.27108754, 0.99724953, 0.99854827, 0.49306079],
-												 [	-6.27198830, -0.00089976, 0.00055155, 7.27108855, 0.99725033, 0.99854869, 0.49306090],
-												 [	-6.27198904, -0.00089950, 0.00055139, 7.27108955, 0.99725113, 0.99854911, 0.49306100],
-												 [	-6.27198978, -0.00089924, 0.00055123, 7.27109054, 0.99725193, 0.99854954, 0.49306107],
-												 [	-6.27199052, -0.00089898, 0.00055107, 7.27109154, 0.99725273, 0.99854996, 0.49306122],
-												 [	-6.27199126, -0.00089871, 0.00055091, 7.27109254, 0.99725353, 0.99855038, 0.49306129],
-												 [	-6.27199199, -0.00089845, 0.00055075, 7.27109354, 0.99725433, 0.99855080, 0.49306135],
-												 [	-6.27199273, -0.00089819, 0.00055059, 7.27109453, 0.99725512, 0.99855122, 0.49306146],
-												 [	-6.27199346, -0.00089793, 0.00055043, 7.27109553, 0.99725592, 0.99855164, 0.49306163],
-												 [	-6.27199419, -0.00089767, 0.00055027, 7.27109652, 0.99725672, 0.99855206, 0.49306163],
-												 [	-6.27199493, -0.00089741, 0.00055011, 7.27109751, 0.99725751, 0.99855248, 0.49306178],
-												 [	-6.27199566, -0.00089715, 0.00054995, 7.27109851, 0.99725831, 0.99855290, 0.49306188],
-												 [	-6.27199639, -0.00089689, 0.00054979, 7.27109950, 0.99725910, 0.99855332, 0.49306196],
-												 [	-6.27199712, -0.00089663, 0.00054963, 7.27110049, 0.99725990, 0.99855374, 0.49306206],
-												 [	-6.27199785, -0.00089637, 0.00054947, 7.27110147, 0.99726069, 0.99855416, 0.49306218],
-												 [	-6.27199857, -0.00089611, 0.00054931, 7.27110246, 0.99726149, 0.99855458, 0.49306227],
-												 [	-6.27199930, -0.00089585, 0.00054915, 7.27110345, 0.99726228, 0.99855499, 0.49306238],
-												 [	-6.27200003, -0.00089559, 0.00054899, 7.27110443, 0.99726307, 0.99855541, 0.49306244],
-												 [	-6.27200076, -0.00089534, 0.00054883, 7.27110542, 0.99726386, 0.99855583, 0.49306254],
-												 [	-6.27200148, -0.00089508, 0.00054868, 7.27110640, 0.99726465, 0.99855625, 0.49306260],
-												 [	-6.27200220, -0.00089482, 0.00054852, 7.27110739, 0.99726545, 0.99855667, 0.49306270],
-												 [	-6.27200293, -0.00089456, 0.00054836, 7.27110837, 0.99726624, 0.99855708, 0.49306284],
-												 [	-6.27200365, -0.00089430, 0.00054820, 7.27110935, 0.99726703, 0.99855750, 0.49306289],
-												 [	-6.27200437, -0.00089404, 0.00054804, 7.27111033, 0.99726782, 0.99855792, 0.49306299],
-												 [	-6.27200509, -0.00089378, 0.00054788, 7.27111131, 0.99726861, 0.99855833, 0.49306315],
-												 [	-6.27200581, -0.00089353, 0.00054772, 7.27111229, 0.99726940, 0.99855875, 0.49306325],
-												 [	-6.27200653, -0.00089327, 0.00054757, 7.27111326, 0.99727018, 0.99855916, 0.49306334],
-												 [	-6.27200725, -0.00089301, 0.00054741, 7.27111424, 0.99727097, 0.99855958, 0.49306342],
-												 [	-6.27200797, -0.00089275, 0.00054725, 7.27111522, 0.99727176, 0.99856000, 0.49306348],
-												 [	-6.27200869, -0.00089250, 0.00054709, 7.27111619, 0.99727255, 0.99856041, 0.49306360],
-												 [	-6.27200940, -0.00089224, 0.00054693, 7.27111717, 0.99727333, 0.99856083, 0.49306368],
-												 [	-6.27201012, -0.00089198, 0.00054678, 7.27111814, 0.99727412, 0.99856124, 0.49306382],
-												 [	-6.27201083, -0.00089172, 0.00054662, 7.27111911, 0.99727491, 0.99856166, 0.49306389],
-												 [	-6.27201155, -0.00089147, 0.00054646, 7.27112008, 0.99727569, 0.99856207, 0.49306395],
-												 [	-6.27201226, -0.00089121, 0.00054630, 7.27112105, 0.99727648, 0.99856248, 0.49306405],
-												 [	-6.27201297, -0.00089095, 0.00054615, 7.27112202, 0.99727726, 0.99856290, 0.49306415],
-												 [	-6.27201369, -0.00089070, 0.00054599, 7.27112299, 0.99727804, 0.99856331, 0.49306425],
-												 [	-6.27201440, -0.00089044, 0.00054583, 7.27112395, 0.99727883, 0.99856373, 0.49306438],
-												 [	-6.27201511, -0.00089019, 0.00054568, 7.27112492, 0.99727961, 0.99856414, 0.49306445],
-												 [	-6.27201582, -0.00088993, 0.00054552, 7.27112589, 0.99728039, 0.99856455, 0.49306454],
-												 [	-6.27201653, -0.00088967, 0.00054536, 7.27112685, 0.99728118, 0.99856496, 0.49306460],
-												 [	-6.27201723, -0.00088942, 0.00054520, 7.27112782, 0.99728196, 0.99856538, 0.49306473],
-												 [	-6.27201794, -0.00088916, 0.00054505, 7.27112878, 0.99728274, 0.99856579, 0.49306481],
-												 [	-6.27201865, -0.00088891, 0.00054489, 7.27112974, 0.99728352, 0.99856620, 0.49306490],
-												 [	-6.27201935, -0.00088865, 0.00054473, 7.27113070, 0.99728430, 0.99856661, 0.49306499],
-												 [	-6.27202006, -0.00088840, 0.00054458, 7.27113166, 0.99728508, 0.99856702, 0.49306507],
-												 [	-6.27202076, -0.00088814, 0.00054442, 7.27113262, 0.99728586, 0.99856744, 0.49306519],
-												 [	-6.27202147, -0.00088789, 0.00054427, 7.27113358, 0.99728664, 0.99856785, 0.49306522],
-												 [	-6.27202217, -0.00088763, 0.00054411, 7.27113454, 0.99728742, 0.99856826, 0.49306541],
-												 [	-6.27202287, -0.00088738, 0.00054395, 7.27113549, 0.99728820, 0.99856867, 0.49306548],
-												 [	-6.27202357, -0.00088713, 0.00054380, 7.27113645, 0.99728897, 0.99856908, 0.49306558],
-												 [	-6.27202427, -0.00088687, 0.00054364, 7.27113740, 0.99728975, 0.99856949, 0.49306563],
-												 [	-6.27202497, -0.00088662, 0.00054349, 7.27113836, 0.99729053, 0.99856990, 0.49306575],
-												 [	-6.27202567, -0.00088636, 0.00054333, 7.27113931, 0.99729130, 0.99857031, 0.49306582],
-												 [	-6.27202637, -0.00088611, 0.00054317, 7.27114026, 0.99729208, 0.99857072, 0.49306593],
-												 [	-6.27202707, -0.00088586, 0.00054302, 7.27114121, 0.99729285, 0.99857113, 0.49306602],
-												 [	-6.27202777, -0.00088560, 0.00054286, 7.27114216, 0.99729363, 0.99857153, 0.49306615],
-												 [	-6.27202846, -0.00088535, 0.00054271, 7.27114311, 0.99729440, 0.99857194, 0.49306620],
-												 [	-6.27202916, -0.00088510, 0.00054255, 7.27114406, 0.99729518, 0.99857235, 0.49306631],
-												 [	-6.27202985, -0.00088484, 0.00054240, 7.27114501, 0.99729595, 0.99857276, 0.49306638],
-												 [	-6.27203055, -0.00088459, 0.00054224, 7.27114596, 0.99729673, 0.99857317, 0.49306650],
-												 [	-6.27203124, -0.00088434, 0.00054209, 7.27114690, 0.99729750, 0.99857358, 0.49306661],
-												 [	-6.27203193, -0.00088409, 0.00054193, 7.27114785, 0.99729827, 0.99857398, 0.49306664],
-												 [	-6.27203262, -0.00088383, 0.00054178, 7.27114879, 0.99729904, 0.99857439, 0.49306674],
-												 [	-6.27203332, -0.00088358, 0.00054162, 7.27114973, 0.99729981, 0.99857480, 0.49306687],
-												 [	-6.27203401, -0.00088333, 0.00054147, 7.27115068, 0.99730059, 0.99857520, 0.49306699],
-												 [	-6.27203470, -0.00088308, 0.00054131, 7.27115162, 0.99730136, 0.99857561, 0.49306701],
-												 [	-6.27203539, -0.00088282, 0.00054116, 7.27115256, 0.99730213, 0.99857602, 0.49306713],
-												 [	-6.27203607, -0.00088257, 0.00054100, 7.27115350, 0.99730290, 0.99857642, 0.49306721],
-												 [	-6.27203676, -0.00088232, 0.00054085, 7.27115444, 0.99730366, 0.99857683, 0.49306728],
-												 [	-6.27203745, -0.00088207, 0.00054069, 7.27115538, 0.99730443, 0.99857724, 0.49306742],
-												 [	-6.27203813, -0.00088182, 0.00054054, 7.27115632, 0.99730520, 0.99857764, 0.49306753],
-												 [	-6.27203882, -0.00088157, 0.00054039, 7.27115725, 0.99730597, 0.99857805, 0.49306761],
-												 [	-6.27203950, -0.00088132, 0.00054023, 7.27115819, 0.99730674, 0.99857845, 0.49306769],
-												 [	-6.27204019, -0.00088107, 0.00054008, 7.27115912, 0.99730750, 0.99857886, 0.49306776],
-												 [	-6.27204087, -0.00088082, 0.00053992, 7.27116006, 0.99730827, 0.99857926, 0.49306785],
-												 [	-6.27204156, -0.00088056, 0.00053977, 7.27116099, 0.99730904, 0.99857966, 0.49306801],
-												 [	-6.27204224, -0.00088031, 0.00053962, 7.27116192, 0.99730980, 0.99858007, 0.49306813],
-												 [	-6.27204292, -0.00088006, 0.00053946, 7.27116286, 0.99731057, 0.99858047, 0.49306816],
-												 [	-6.27204360, -0.00087981, 0.00053931, 7.27116379, 0.99731133, 0.99858088, 0.49306827],
-												 [	-6.27204428, -0.00087956, 0.00053916, 7.27116472, 0.99731210, 0.99858128, 0.49306833],
-												 [	-6.27204496, -0.00087931, 0.00053900, 7.27116565, 0.99731286, 0.99858168, 0.49306842],
-												 [	-6.27204564, -0.00087906, 0.00053885, 7.27116657, 0.99731363, 0.99858209, 0.49306852],
-												 [	-6.27204632, -0.00087881, 0.00053870, 7.27116750, 0.99731439, 0.99858249, 0.49306865],
-												 [	-6.27204699, -0.00087857, 0.00053854, 7.27116843, 0.99731515, 0.99858289, 0.49306872],
-												 [	-6.27204767, -0.00087832, 0.00053839, 7.27116935, 0.99731591, 0.99858329, 0.49306875],
-												 [	-6.27204835, -0.00087807, 0.00053824, 7.27117028, 0.99731668, 0.99858369, 0.49306889],
-												 [	-6.27204902, -0.00087782, 0.00053809, 7.27117120, 0.99731744, 0.99858410, 0.49306899],
-												 [	-6.27204970, -0.00087757, 0.00053793, 7.27117213, 0.99731820, 0.99858450, 0.49306909],
-												 [	-6.27205037, -0.00087732, 0.00053778, 7.27117305, 0.99731896, 0.99858490, 0.49306915],
-												 [	-6.27205104, -0.00087707, 0.00053763, 7.27117397, 0.99731972, 0.99858530, 0.49306931],
-												 [	-6.27205172, -0.00087682, 0.00053748, 7.27117489, 0.99732048, 0.99858570, 0.49306931],
-												 [	-6.27205239, -0.00087658, 0.00053732, 7.27117581, 0.99732124, 0.99858610, 0.49306947],
-												 [	-6.27205306, -0.00087633, 0.00053717, 7.27117673, 0.99732200, 0.99858650, 0.49306949],
-												 [	-6.27205373, -0.00087608, 0.00053702, 7.27117765, 0.99732276, 0.99858690, 0.49306961],
-												 [	-6.27205440, -0.00087583, 0.00053687, 7.27117857, 0.99732351, 0.99858730, 0.49306974],
-												 [	-6.27205507, -0.00087558, 0.00053671, 7.27117949, 0.99732427, 0.99858770, 0.49306982],
-												 [	-6.27205574, -0.00087534, 0.00053656, 7.27118040, 0.99732503, 0.99858810, 0.49306986],
-												 [	-6.27205641, -0.00087509, 0.00053641, 7.27118132, 0.99732579, 0.99858850, 0.49306997],
-												 [	-6.27205707, -0.00087484, 0.00053626, 7.27118223, 0.99732654, 0.99858890, 0.49307002],
-												 [	-6.27205774, -0.00087459, 0.00053611, 7.27118315, 0.99732730, 0.99858930, 0.49307020],
-												 [	-6.27205841, -0.00087435, 0.00053596, 7.27118406, 0.99732805, 0.99858970, 0.49307021],
-												 [	-6.27205907, -0.00087410, 0.00053580, 7.27118497, 0.99732881, 0.99859010, 0.49307035],
-												 [	-6.27205974, -0.00087385, 0.00053565, 7.27118588, 0.99732956, 0.99859049, 0.49307047],
-												 [	-6.27206040, -0.00087361, 0.00053550, 7.27118679, 0.99733032, 0.99859089, 0.49307051],
-												 [	-6.27206106, -0.00087336, 0.00053535, 7.27118770, 0.99733107, 0.99859129, 0.49307062],
-												 [	-6.27206173, -0.00087311, 0.00053520, 7.27118861, 0.99733182, 0.99859169, 0.49307069],
-												 [	-6.27206239, -0.00087287, 0.00053505, 7.27118952, 0.99733258, 0.99859208, 0.49307080],
-												 [	-6.27206305, -0.00087262, 0.00053490, 7.27119043, 0.99733333, 0.99859248, 0.49307089],
-												 [	-6.27206371, -0.00087238, 0.00053475, 7.27119134, 0.99733408, 0.99859288, 0.49307096],
-												 [	-6.27206437, -0.00087213, 0.00053460, 7.27119224, 0.99733483, 0.99859327, 0.49307103],
-												 [	-6.27206503, -0.00087188, 0.00053445, 7.27119315, 0.99733558, 0.99859367, 0.49307121],
-												 [	-6.27206569, -0.00087164, 0.00053429, 7.27119405, 0.99733633, 0.99859407, 0.49307121],
-												 [	-6.27206635, -0.00087139, 0.00053414, 7.27119496, 0.99733709, 0.99859446, 0.49307131],
-												 [	-6.27206701, -0.00087115, 0.00053399, 7.27119586, 0.99733783, 0.99859486, 0.49307143],
-												 [	-6.27206767, -0.00087090, 0.00053384, 7.27119676, 0.99733858, 0.99859525, 0.49307152],
-												 [	-6.27206832, -0.00087066, 0.00053369, 7.27119766, 0.99733933, 0.99859565, 0.49307163],
-												 [	-6.27206898, -0.00087041, 0.00053354, 7.27119856, 0.99734008, 0.99859604, 0.49307170],
-												 [	-6.27206963, -0.00087017, 0.00053339, 7.27119946, 0.99734083, 0.99859644, 0.49307178],
-												 [	-6.27207029, -0.00086992, 0.00053324, 7.27120036, 0.99734158, 0.99859683, 0.49307182],
-												 [	-6.27207094, -0.00086968, 0.00053309, 7.27120126, 0.99734233, 0.99859723, 0.49307196],
-												 [	-6.27207160, -0.00086944, 0.00053294, 7.27120216, 0.99734307, 0.99859762, 0.49307197],
-												 [	-6.27207225, -0.00086919, 0.00053279, 7.27120306, 0.99734382, 0.99859802, 0.49307220],
-												 [	-6.27207290, -0.00086895, 0.00053264, 7.27120395, 0.99734457, 0.99859841, 0.49307226],
-												 [	-6.27207355, -0.00086870, 0.00053249, 7.27120485, 0.99734531, 0.99859880, 0.49307233],
-												 [	-6.27207420, -0.00086846, 0.00053234, 7.27120574, 0.99734606, 0.99859920, 0.49307241],
-												 [	-6.27207485, -0.00086822, 0.00053219, 7.27120664, 0.99734680, 0.99859959, 0.49307252],
-												 [	-6.27207550, -0.00086797, 0.00053205, 7.27120753, 0.99734755, 0.99859998, 0.49307258],
-												 [	-6.27207615, -0.00086773, 0.00053190, 7.27120842, 0.99734829, 0.99860037, 0.49307271],
-												 [	-6.27207680, -0.00086749, 0.00053175, 7.27120931, 0.99734903, 0.99860077, 0.49307274],
-												 [	-6.27207745, -0.00086724, 0.00053160, 7.27121021, 0.99734978, 0.99860116, 0.49307287],
-												 [	-6.27207810, -0.00086700, 0.00053145, 7.27121110, 0.99735052, 0.99860155, 0.49307293],
-												 [	-6.27207874, -0.00086676, 0.00053130, 7.27121199, 0.99735126, 0.99860194, 0.49307303],
-												 [	-6.27207939, -0.00086652, 0.00053115, 7.27121287, 0.99735200, 0.99860233, 0.49307313],
-												 [	-6.27208004, -0.00086627, 0.00053100, 7.27121376, 0.99735275, 0.99860273, 0.49307325],
-												 [	-6.27208068, -0.00086603, 0.00053085, 7.27121465, 0.99735349, 0.99860312, 0.49307329],
-												 [	-6.27208132, -0.00086579, 0.00053070, 7.27121554, 0.99735423, 0.99860351, 0.49307333],
-												 [	-6.27208197, -0.00086555, 0.00053056, 7.27121642, 0.99735497, 0.99860390, 0.49307349],
-												 [	-6.27208261, -0.00086530, 0.00053041, 7.27121731, 0.99735571, 0.99860429, 0.49307355],
-												 [	-6.27208325, -0.00086506, 0.00053026, 7.27121819, 0.99735645, 0.99860468, 0.49307366],
-												 [	-6.27208390, -0.00086482, 0.00053011, 7.27121907, 0.99735719, 0.99860507, 0.49307376],
-												 [	-6.27208454, -0.00086458, 0.00052996, 7.27121996, 0.99735792, 0.99860546, 0.49307384],
-												 [	-6.27208518, -0.00086434, 0.00052981, 7.27122084, 0.99735866, 0.99860585, 0.49307389],
-												 [	-6.27208582, -0.00086410, 0.00052967, 7.27122172, 0.99735940, 0.99860624, 0.49307398],
-												 [	-6.27208646, -0.00086386, 0.00052952, 7.27122260, 0.99736014, 0.99860663, 0.49307410],
-												 [	-6.27208710, -0.00086361, 0.00052937, 7.27122348, 0.99736088, 0.99860701, 0.49307418],
-												 [	-6.27208774, -0.00086337, 0.00052922, 7.27122436, 0.99736161, 0.99860740, 0.49307431],
-												 [	-6.27208837, -0.00086313, 0.00052908, 7.27122524, 0.99736235, 0.99860779, 0.49307430],
-												 [	-6.27208901, -0.00086289, 0.00052893, 7.27122612, 0.99736308, 0.99860818, 0.49307450],
-												 [	-6.27208965, -0.00086265, 0.00052878, 7.27122700, 0.99736382, 0.99860857, 0.49307452],
-												 [	-6.27209028, -0.00086241, 0.00052863, 7.27122787, 0.99736455, 0.99860896, 0.49307461],
-												 [	-6.27209092, -0.00086217, 0.00052849, 7.27122875, 0.99736529, 0.99860934, 0.49307473],
-												 [	-6.27209155, -0.00086193, 0.00052834, 7.27122962, 0.99736602, 0.99860973, 0.49307476],
-												 [	-6.27209219, -0.00086169, 0.00052819, 7.27123050, 0.99736676, 0.99861012, 0.49307493],
-												 [	-6.27209282, -0.00086145, 0.00052804, 7.27123137, 0.99736749, 0.99861050, 0.49307491],
-												 [	-6.27209346, -0.00086121, 0.00052790, 7.27123224, 0.99736822, 0.99861089, 0.49307506],
-												 [	-6.27209409, -0.00086097, 0.00052775, 7.27123312, 0.99736896, 0.99861128, 0.49307515],
-												 [	-6.27209472, -0.00086073, 0.00052760, 7.27123399, 0.99736969, 0.99861166, 0.49307527],
-												 [	-6.27209535, -0.00086049, 0.00052746, 7.27123486, 0.99737042, 0.99861205, 0.49307528],
-												 [	-6.27209598, -0.00086025, 0.00052731, 7.27123573, 0.99737115, 0.99861244, 0.49307544],
-												 [	-6.27209661, -0.00086002, 0.00052716, 7.27123660, 0.99737188, 0.99861282, 0.49307551],
-												 [	-6.27209724, -0.00085978, 0.00052702, 7.27123747, 0.99737261, 0.99861321, 0.49307555],
-												 [	-6.27209787, -0.00085954, 0.00052687, 7.27123833, 0.99737334, 0.99861359, 0.49307566],
-												 [	-6.27209850, -0.00085930, 0.00052672, 7.27123920, 0.99737407, 0.99861398, 0.49307570],
-												 [	-6.27209913, -0.00085906, 0.00052658, 7.27124007, 0.99737480, 0.99861436, 0.49307581],
-												 [	-6.27209976, -0.00085882, 0.00052643, 7.27124094, 0.99737553, 0.99861475, 0.49307599],
-												 [	-6.27210038, -0.00085858, 0.00052628, 7.27124180, 0.99737626, 0.99861513, 0.49307598],
-												 [	-6.27210101, -0.00085835, 0.00052614, 7.27124266, 0.99737699, 0.99861551, 0.49307614],
-												 [	-6.27210164, -0.00085811, 0.00052599, 7.27124353, 0.99737771, 0.99861590, 0.49307614],
-												 [	-6.27210226, -0.00085787, 0.00052585, 7.27124439, 0.99737844, 0.99861628, 0.49307625],
-												 [	-6.27210289, -0.00085763, 0.00052570, 7.27124525, 0.99737917, 0.99861667, 0.49307637],
-												 [	-6.27210351, -0.00085740, 0.00052555, 7.27124612, 0.99737989, 0.99861705, 0.49307645],
-												 [	-6.27210414, -0.00085716, 0.00052541, 7.27124698, 0.99738062, 0.99861743, 0.49307653],
-												 [	-6.27210476, -0.00085692, 0.00052526, 7.27124784, 0.99738135, 0.99861782, 0.49307663],
-												 [	-6.27210538, -0.00085668, 0.00052512, 7.27124870, 0.99738207, 0.99861820, 0.49307669],
-												 [	-6.27210600, -0.00085645, 0.00052497, 7.27124956, 0.99738280, 0.99861858, 0.49307677],
-												 [	-6.27210663, -0.00085621, 0.00052483, 7.27125042, 0.99738352, 0.99861896, 0.49307688],
-												 [	-6.27210725, -0.00085597, 0.00052468, 7.27125127, 0.99738424, 0.99861934, 0.49307699],
-												 [	-6.27210787, -0.00085574, 0.00052454, 7.27125213, 0.99738497, 0.99861973, 0.49307706],
-												 [	-6.27210849, -0.00085550, 0.00052439, 7.27125299, 0.99738569, 0.99862011, 0.49307704],
-												 [	-6.27210911, -0.00085526, 0.00052425, 7.27125384, 0.99738641, 0.99862049, 0.49307723],
-												 [	-6.27210973, -0.00085503, 0.00052410, 7.27125470, 0.99738714, 0.99862087, 0.49307731],
-												 [	-6.27211034, -0.00085479, 0.00052396, 7.27125555, 0.99738786, 0.99862125, 0.49307742],
-												 [	-6.27211096, -0.00085456, 0.00052381, 7.27125641, 0.99738858, 0.99862163, 0.49307753],
-												 [	-6.27211158, -0.00085432, 0.00052367, 7.27125726, 0.99738930, 0.99862201, 0.49307753],
-												 [	-6.27211220, -0.00085408, 0.00052352, 7.27125811, 0.99739002, 0.99862239, 0.49307764],
-												 [	-6.27211281, -0.00085385, 0.00052338, 7.27125896, 0.99739074, 0.99862277, 0.49307770],
-												 [	-6.27211343, -0.00085361, 0.00052323, 7.27125981, 0.99739146, 0.99862315, 0.49307780],
-												 [	-6.27211404, -0.00085338, 0.00052309, 7.27126067, 0.99739218, 0.99862353, 0.49307792],
-												 [	-6.27211466, -0.00085314, 0.00052295, 7.27126152, 0.99739290, 0.99862391, 0.49307794],
-												 [	-6.27211527, -0.00085291, 0.00052280, 7.27126236, 0.99739362, 0.99862429, 0.49307803],
-												 [	-6.27211589, -0.00085267, 0.00052266, 7.27126321, 0.99739434, 0.99862467, 0.49307820],
-												 [	-6.27211650, -0.00085244, 0.00052251, 7.27126406, 0.99739506, 0.99862505, 0.49307827],
-												 [	-6.27211711, -0.00085220, 0.00052237, 7.27126491, 0.99739577, 0.99862543, 0.49307830],
-												 [	-6.27211772, -0.00085197, 0.00052222, 7.27126575, 0.99739649, 0.99862581, 0.49307839],
-												 [	-6.27211833, -0.00085173, 0.00052208, 7.27126660, 0.99739721, 0.99862618, 0.49307851],
-												 [	-6.27211895, -0.00085150, 0.00052194, 7.27126745, 0.99739792, 0.99862656, 0.49307861],
-												 [	-6.27211956, -0.00085127, 0.00052179, 7.27126829, 0.99739864, 0.99862694, 0.49307868],
-												 [	-6.27212017, -0.00085103, 0.00052165, 7.27126913, 0.99739936, 0.99862732, 0.49307878],
-												 [	-6.27212078, -0.00085080, 0.00052151, 7.27126998, 0.99740007, 0.99862770, 0.49307884],
-												 [	-6.27212138, -0.00085056, 0.00052136, 7.27127082, 0.99740079, 0.99862807, 0.49307888],
-												 [	-6.27212199, -0.00085033, 0.00052122, 7.27127166, 0.99740150, 0.99862845, 0.49307902],
-												 [	-6.27212260, -0.00085010, 0.00052108, 7.27127250, 0.99740221, 0.99862883, 0.49307911],
-												 [	-6.27212321, -0.00084986, 0.00052093, 7.27127334, 0.99740293, 0.99862920, 0.49307920],
-												 [	-6.27212381, -0.00084963, 0.00052079, 7.27127418, 0.99740364, 0.99862958, 0.49307926],
-												 [	-6.27212442, -0.00084940, 0.00052065, 7.27127502, 0.99740435, 0.99862996, 0.49307935],
-												 [	-6.27212503, -0.00084916, 0.00052050, 7.27127586, 0.99740507, 0.99863033, 0.49307944],
-												 [	-6.27212563, -0.00084893, 0.00052036, 7.27127670, 0.99740578, 0.99863071, 0.49307944],
-												 [	-6.27212624, -0.00084870, 0.00052022, 7.27127754, 0.99740649, 0.99863108, 0.49307954],
-												 [	-6.27212684, -0.00084847, 0.00052008, 7.27127837, 0.99740720, 0.99863146, 0.49307961],
-												 [	-6.27212744, -0.00084823, 0.00051993, 7.27127921, 0.99740791, 0.99863183, 0.49307978],
-												 [	-6.27212805, -0.00084800, 0.00051979, 7.27128005, 0.99740862, 0.99863221, 0.49307983],
-												 [	-6.27212865, -0.00084777, 0.00051965, 7.27128088, 0.99740933, 0.99863258, 0.49307996],
-												 [	-6.27212925, -0.00084754, 0.00051951, 7.27128172, 0.99741004, 0.99863296, 0.49308005],
-												 [	-6.27212986, -0.00084730, 0.00051936, 7.27128255, 0.99741075, 0.99863333, 0.49308014],
-												 [	-6.27213046, -0.00084707, 0.00051922, 7.27128338, 0.99741146, 0.99863371, 0.49308018],
-												 [	-6.27213106, -0.00084684, 0.00051908, 7.27128422, 0.99741217, 0.99863408, 0.49308030],
-												 [	-6.27213166, -0.00084661, 0.00051894, 7.27128505, 0.99741288, 0.99863445, 0.49308040],
-												 [	-6.27213226, -0.00084638, 0.00051879, 7.27128588, 0.99741359, 0.99863483, 0.49308040],
-												 [	-6.27213286, -0.00084615, 0.00051865, 7.27128671, 0.99741429, 0.99863520, 0.49308050],
-												 [	-6.27213345, -0.00084592, 0.00051851, 7.27128754, 0.99741500, 0.99863557, 0.49308061],
-												 [	-6.27213405, -0.00084568, 0.00051837, 7.27128837, 0.99741571, 0.99863595, 0.49308064],
-												 [	-6.27213465, -0.00084545, 0.00051823, 7.27128920, 0.99741641, 0.99863632, 0.49308083],
-												 [	-6.27213525, -0.00084522, 0.00051809, 7.27129003, 0.99741712, 0.99863669, 0.49308089],
-												 [	-6.27213585, -0.00084499, 0.00051794, 7.27129085, 0.99741783, 0.99863706, 0.49308103],
-												 [	-6.27213644, -0.00084476, 0.00051780, 7.27129168, 0.99741853, 0.99863744, 0.49308104],
-												 [	-6.27213704, -0.00084453, 0.00051766, 7.27129251, 0.99741924, 0.99863781, 0.49308114],
-												 [	-6.27213763, -0.00084430, 0.00051752, 7.27129333, 0.99741994, 0.99863818, 0.49308122],
-												 [	-6.27213823, -0.00084407, 0.00051738, 7.27129416, 0.99742064, 0.99863855, 0.49308125],
-												 [	-6.27213882, -0.00084384, 0.00051724, 7.27129498, 0.99742135, 0.99863892, 0.49308128],
-												 [	-6.27213942, -0.00084361, 0.00051710, 7.27129581, 0.99742205, 0.99863929, 0.49308149],
-												 [	-6.27214001, -0.00084338, 0.00051696, 7.27129663, 0.99742275, 0.99863966, 0.49308153],
-												 [	-6.27214060, -0.00084315, 0.00051681, 7.27129745, 0.99742346, 0.99864003, 0.49308160],
-												 [	-6.27214120, -0.00084292, 0.00051667, 7.27129827, 0.99742416, 0.99864041, 0.49308174],
-												 [	-6.27214179, -0.00084269, 0.00051653, 7.27129910, 0.99742486, 0.99864078, 0.49308171],
-												 [	-6.27214238, -0.00084246, 0.00051639, 7.27129992, 0.99742556, 0.99864115, 0.49308189],
-												 [	-6.27214297, -0.00084223, 0.00051625, 7.27130074, 0.99742626, 0.99864152, 0.49308189],
-												 [	-6.27214356, -0.00084200, 0.00051611, 7.27130156, 0.99742696, 0.99864188, 0.49308208],
-												 [	-6.27214415, -0.00084178, 0.00051597, 7.27130237, 0.99742766, 0.99864225, 0.49308218],
-												 [	-6.27214474, -0.00084155, 0.00051583, 7.27130319, 0.99742836, 0.99864262, 0.49308217],
-												 [	-6.27214533, -0.00084132, 0.00051569, 7.27130401, 0.99742906, 0.99864299, 0.49308225],
-												 [	-6.27214592, -0.00084109, 0.00051555, 7.27130483, 0.99742976, 0.99864336, 0.49308239],
-												 [	-6.27214651, -0.00084086, 0.00051541, 7.27130564, 0.99743046, 0.99864373, 0.49308247],
-												 [	-6.27214709, -0.00084063, 0.00051527, 7.27130646, 0.99743116, 0.99864410, 0.49308255],
-												 [	-6.27214768, -0.00084040, 0.00051513, 7.27130728, 0.99743186, 0.99864447, 0.49308258],
-												 [	-6.27214827, -0.00084018, 0.00051499, 7.27130809, 0.99743255, 0.99864483, 0.49308266],
-												 [	-6.27214885, -0.00083995, 0.00051485, 7.27130891, 0.99743325, 0.99864520, 0.49308274],
-												 [	-6.27214944, -0.00083972, 0.00051471, 7.27130972, 0.99743395, 0.99864557, 0.49308290],
-												 [	-6.27215002, -0.00083949, 0.00051457, 7.27131053, 0.99743464, 0.99864594, 0.49308290],
-												 [	-6.27215061, -0.00083926, 0.00051443, 7.27131134, 0.99743534, 0.99864631, 0.49308300],
-												 [	-6.27215119, -0.00083904, 0.00051429, 7.27131216, 0.99743604, 0.99864667, 0.49308315],
-												 [	-6.27215178, -0.00083881, 0.00051415, 7.27131297, 0.99743673, 0.99864704, 0.49308314],
-												 [	-6.27215236, -0.00083858, 0.00051401, 7.27131378, 0.99743743, 0.99864741, 0.49308324],
-												 [	-6.27215294, -0.00083836, 0.00051387, 7.27131459, 0.99743812, 0.99864777, 0.49308338],
-												 [	-6.27215353, -0.00083813, 0.00051373, 7.27131540, 0.99743881, 0.99864814, 0.49308338],
-												 [	-6.27215411, -0.00083790, 0.00051359, 7.27131621, 0.99743951, 0.99864850, 0.49308350],
-												 [	-6.27215469, -0.00083768, 0.00051345, 7.27131702, 0.99744020, 0.99864887, 0.49308357],
-												 [	-6.27215527, -0.00083745, 0.00051332, 7.27131782, 0.99744089, 0.99864924, 0.49308374],
-												 [	-6.27215585, -0.00083722, 0.00051318, 7.27131863, 0.99744159, 0.99864960, 0.49308379],
-												 [	-6.27215643, -0.00083700, 0.00051304, 7.27131944, 0.99744228, 0.99864997, 0.49308384],
-												 [	-6.27215701, -0.00083677, 0.00051290, 7.27132024, 0.99744297, 0.99865033, 0.49308393],
-												 [	-6.27215759, -0.00083654, 0.00051276, 7.27132105, 0.99744366, 0.99865070, 0.49308399],
-												 [	-6.27215817, -0.00083632, 0.00051262, 7.27132185, 0.99744435, 0.99865106, 0.49308412],
-												 [	-6.27215875, -0.00083609, 0.00051248, 7.27132266, 0.99744504, 0.99865143, 0.49308421],
-												 [	-6.27215933, -0.00083587, 0.00051234, 7.27132346, 0.99744574, 0.99865179, 0.49308425],
-												 [	-6.27215990, -0.00083564, 0.00051221, 7.27132426, 0.99744643, 0.99865215, 0.49308434],
-												 [	-6.27216048, -0.00083541, 0.00051207, 7.27132507, 0.99744711, 0.99865252, 0.49308442],
-												 [	-6.27216106, -0.00083519, 0.00051193, 7.27132587, 0.99744780, 0.99865288, 0.49308450],
-												 [	-6.27216164, -0.00083496, 0.00051179, 7.27132667, 0.99744849, 0.99865324, 0.49308461],
-												 [	-6.27216221, -0.00083474, 0.00051165, 7.27132747, 0.99744918, 0.99865361, 0.49308467],
-												 [	-6.27216279, -0.00083451, 0.00051151, 7.27132827, 0.99744987, 0.99865397, 0.49308473],
-												 [	-6.27216336, -0.00083429, 0.00051138, 7.27132907, 0.99745056, 0.99865433, 0.49308483],
-												 [	-6.27216394, -0.00083406, 0.00051124, 7.27132987, 0.99745124, 0.99865470, 0.49308489],
-												 [	-6.27216451, -0.00083384, 0.00051110, 7.27133067, 0.99745193, 0.99865506, 0.49308501],
-												 [	-6.27216508, -0.00083361, 0.00051096, 7.27133147, 0.99745262, 0.99865542, 0.49308509],
-												 [	-6.27216566, -0.00083339, 0.00051083, 7.27133227, 0.99745330, 0.99865578, 0.49308519],
-												 [	-6.27216623, -0.00083317, 0.00051069, 7.27133306, 0.99745399, 0.99865615, 0.49308520],
-												 [	-6.27216680, -0.00083294, 0.00051055, 7.27133386, 0.99745468, 0.99865651, 0.49308532],
-												 [	-6.27216737, -0.00083272, 0.00051041, 7.27133465, 0.99745536, 0.99865687, 0.49308537],
-												 [	-6.27216794, -0.00083249, 0.00051028, 7.27133545, 0.99745605, 0.99865723, 0.49308548],
-												 [	-6.27216851, -0.00083227, 0.00051014, 7.27133624, 0.99745673, 0.99865759, 0.49308555],
-												 [	-6.27216909, -0.00083205, 0.00051000, 7.27133704, 0.99745741, 0.99865795, 0.49308568],
-												 [	-6.27216966, -0.00083182, 0.00050986, 7.27133783, 0.99745810, 0.99865831, 0.49308575],
-												 [	-6.27217022, -0.00083160, 0.00050973, 7.27133863, 0.99745878, 0.99865867, 0.49308580],
-												 [	-6.27217079, -0.00083138, 0.00050959, 7.27133942, 0.99745946, 0.99865903, 0.49308589],
-												 [	-6.27217136, -0.00083115, 0.00050945, 7.27134021, 0.99746015, 0.99865939, 0.49308593],
-												 [	-6.27217193, -0.00083093, 0.00050932, 7.27134100, 0.99746083, 0.99865975, 0.49308603],
-												 [	-6.27217250, -0.00083071, 0.00050918, 7.27134179, 0.99746151, 0.99866011, 0.49308603],
-												 [	-6.27217307, -0.00083048, 0.00050904, 7.27134258, 0.99746219, 0.99866047, 0.49308626],
-												 [	-6.27217363, -0.00083026, 0.00050891, 7.27134337, 0.99746287, 0.99866083, 0.49308628],
-												 [	-6.27217420, -0.00083004, 0.00050877, 7.27134416, 0.99746355, 0.99866119, 0.49308633],
-												 [	-6.27217477, -0.00082982, 0.00050863, 7.27134495, 0.99746424, 0.99866155, 0.49308648],
-												 [	-6.27217533, -0.00082959, 0.00050850, 7.27134574, 0.99746492, 0.99866191, 0.49308650],
-												 [	-6.27217590, -0.00082937, 0.00050836, 7.27134653, 0.99746559, 0.99866227, 0.49308659],
-												 [	-6.27217646, -0.00082915, 0.00050822, 7.27134731, 0.99746627, 0.99866263, 0.49308664],
-												 [	-6.27217703, -0.00082893, 0.00050809, 7.27134810, 0.99746695, 0.99866299, 0.49308674],
-												 [	-6.27217759, -0.00082871, 0.00050795, 7.27134888, 0.99746763, 0.99866334, 0.49308688],
-												 [	-6.27217815, -0.00082848, 0.00050782, 7.27134967, 0.99746831, 0.99866370, 0.49308691],
-												 [	-6.27217872, -0.00082826, 0.00050768, 7.27135045, 0.99746899, 0.99866406, 0.49308700],
-												 [	-6.27217928, -0.00082804, 0.00050754, 7.27135124, 0.99746967, 0.99866442, 0.49308706],
-												 [	-6.27217984, -0.00082782, 0.00050741, 7.27135202, 0.99747034, 0.99866477, 0.49308711],
-												 [	-6.27218040, -0.00082760, 0.00050727, 7.27135281, 0.99747102, 0.99866513, 0.49308731],
-												 [	-6.27218097, -0.00082738, 0.00050714, 7.27135359, 0.99747170, 0.99866549, 0.49308733],
-												 [	-6.27218153, -0.00082716, 0.00050700, 7.27135437, 0.99747237, 0.99866584, 0.49308746],
-												 [	-6.27218209, -0.00082693, 0.00050686, 7.27135515, 0.99747305, 0.99866620, 0.49308753],
-												 [	-6.27218265, -0.00082671, 0.00050673, 7.27135593, 0.99747372, 0.99866656, 0.49308759],
-												 [	-6.27218321, -0.00082649, 0.00050659, 7.27135671, 0.99747440, 0.99866691, 0.49308757],
-												 [	-6.27218377, -0.00082627, 0.00050646, 7.27135749, 0.99747507, 0.99866727, 0.49308770],
-												 [	-6.27218433, -0.00082605, 0.00050632, 7.27135827, 0.99747575, 0.99866763, 0.49308772],
-												 [	-6.27218488, -0.00082583, 0.00050619, 7.27135905, 0.99747642, 0.99866798, 0.49308784],
-												 [	-6.27218544, -0.00082561, 0.00050605, 7.27135983, 0.99747709, 0.99866834, 0.49308794],
-												 [	-6.27218600, -0.00082539, 0.00050592, 7.27136061, 0.99747777, 0.99866869, 0.49308810],
-												 [	-6.27218656, -0.00082517, 0.00050578, 7.27136139, 0.99747844, 0.99866905, 0.49308812],
-												 [	-6.27218711, -0.00082495, 0.00050565, 7.27136216, 0.99747911, 0.99866940, 0.49308821],
-												 [	-6.27218767, -0.00082473, 0.00050551, 7.27136294, 0.99747978, 0.99866976, 0.49308825],
-												 [	-6.27218823, -0.00082451, 0.00050538, 7.27136371, 0.99748046, 0.99867011, 0.49308833],
-												 [	-6.27218878, -0.00082429, 0.00050524, 7.27136449, 0.99748113, 0.99867046, 0.49308847],
-												 [	-6.27218934, -0.00082407, 0.00050511, 7.27136526, 0.99748180, 0.99867082, 0.49308860],
-												 [	-6.27218989, -0.00082385, 0.00050497, 7.27136604, 0.99748247, 0.99867117, 0.49308859],
-												 [	-6.27219045, -0.00082363, 0.00050484, 7.27136681, 0.99748314, 0.99867153, 0.49308869],
-												 [	-6.27219100, -0.00082341, 0.00050471, 7.27136759, 0.99748381, 0.99867188, 0.49308873],
-												 [	-6.27219155, -0.00082320, 0.00050457, 7.27136836, 0.99748448, 0.99867223, 0.49308878],
-												 [	-6.27219211, -0.00082298, 0.00050444, 7.27136913, 0.99748515, 0.99867259, 0.49308888],
-												 [	-6.27219266, -0.00082276, 0.00050430, 7.27136990, 0.99748582, 0.99867294, 0.49308897],
-												 [	-6.27219321, -0.00082254, 0.00050417, 7.27137067, 0.99748649, 0.99867329, 0.49308901],
-												 [	-6.27219376, -0.00082232, 0.00050403, 7.27137144, 0.99748715, 0.99867364, 0.49308913],
-												 [	-6.27219432, -0.00082210, 0.00050390, 7.27137221, 0.99748782, 0.99867400, 0.49308916],
-												 [	-6.27219487, -0.00082188, 0.00050377, 7.27137298, 0.99748849, 0.99867435, 0.49308935],
-												 [	-6.27219542, -0.00082167, 0.00050363, 7.27137375, 0.99748916, 0.99867470, 0.49308938],
-												 [	-6.27219597, -0.00082145, 0.00050350, 7.27137452, 0.99748982, 0.99867505, 0.49308944],
-												 [	-6.27219652, -0.00082123, 0.00050337, 7.27137529, 0.99749049, 0.99867540, 0.49308959],
-												 [	-6.27219707, -0.00082101, 0.00050323, 7.27137606, 0.99749116, 0.99867576, 0.49308961],
-												 [	-6.27219762, -0.00082080, 0.00050310, 7.27137682, 0.99749182, 0.99867611, 0.49308966],
-												 [	-6.27219817, -0.00082058, 0.00050296, 7.27137759, 0.99749249, 0.99867646, 0.49308979],
-												 [	-6.27219872, -0.00082036, 0.00050283, 7.27137836, 0.99749315, 0.99867681, 0.49308985],
-												 [	-6.27219926, -0.00082014, 0.00050270, 7.27137912, 0.99749382, 0.99867716, 0.49308989],
-												 [	-6.27219981, -0.00081993, 0.00050256, 7.27137989, 0.99749448, 0.99867751, 0.49309002],
-												 [	-6.27220036, -0.00081971, 0.00050243, 7.27138065, 0.99749514, 0.99867786, 0.49309006],
-												 [	-6.27220091, -0.00081949, 0.00050230, 7.27138141, 0.99749581, 0.99867821, 0.49309016],
-												 [	-6.27220145, -0.00081927, 0.00050216, 7.27138218, 0.99749647, 0.99867856, 0.49309022],
-												 [	-6.27220200, -0.00081906, 0.00050203, 7.27138294, 0.99749713, 0.99867891, 0.49309028],
-												 [	-6.27220254, -0.00081884, 0.00050190, 7.27138370, 0.99749780, 0.99867926, 0.49309037],
-												 [	-6.27220309, -0.00081862, 0.00050177, 7.27138446, 0.99749846, 0.99867961, 0.49309053],
-												 [	-6.27220363, -0.00081841, 0.00050163, 7.27138523, 0.99749912, 0.99867996, 0.49309055],
-												 [	-6.27220418, -0.00081819, 0.00050150, 7.27138599, 0.99749978, 0.99868031, 0.49309069],
-												 [	-6.27220472, -0.00081798, 0.00050137, 7.27138675, 0.99750044, 0.99868066, 0.49309070],
-												 [	-6.27220527, -0.00081776, 0.00050124, 7.27138751, 0.99750110, 0.99868100, 0.49309083],
-												 [	-6.27220581, -0.00081754, 0.00050110, 7.27138827, 0.99750176, 0.99868135, 0.49309090],
-												 [	-6.27220635, -0.00081733, 0.00050097, 7.27138902, 0.99750242, 0.99868170, 0.49309098],
-												 [	-6.27220690, -0.00081711, 0.00050084, 7.27138978, 0.99750308, 0.99868205, 0.49309101],
-												 [	-6.27220744, -0.00081690, 0.00050071, 7.27139054, 0.99750374, 0.99868240, 0.49309113],
-												 [	-6.27220798, -0.00081668, 0.00050057, 7.27139130, 0.99750440, 0.99868275, 0.49309116],
-												 [	-6.27220852, -0.00081647, 0.00050044, 7.27139205, 0.99750506, 0.99868309, 0.49309123],
-												 [	-6.27220906, -0.00081625, 0.00050031, 7.27139281, 0.99750572, 0.99868344, 0.49309142],
-												 [	-6.27220960, -0.00081604, 0.00050018, 7.27139357, 0.99750638, 0.99868379, 0.49309142],
-												 [	-6.27221014, -0.00081582, 0.00050005, 7.27139432, 0.99750703, 0.99868413, 0.49309146],
-												 [	-6.27221068, -0.00081561, 0.00049991, 7.27139508, 0.99750769, 0.99868448, 0.49309158],
-												 [	-6.27221122, -0.00081539, 0.00049978, 7.27139583, 0.99750835, 0.99868483, 0.49309166],
-												 [	-6.27221176, -0.00081518, 0.00049965, 7.27139659, 0.99750901, 0.99868517, 0.49309171],
-												 [	-6.27221230, -0.00081496, 0.00049952, 7.27139734, 0.99750966, 0.99868552, 0.49309183],
-												 [	-6.27221284, -0.00081475, 0.00049939, 7.27139809, 0.99751032, 0.99868587, 0.49309186],
-												 [	-6.27221338, -0.00081453, 0.00049926, 7.27139884, 0.99751097, 0.99868621, 0.49309196],
-												 [	-6.27221391, -0.00081432, 0.00049912, 7.27139960, 0.99751163, 0.99868656, 0.49309197],
-												 [	-6.27221445, -0.00081410, 0.00049899, 7.27140035, 0.99751228, 0.99868690, 0.49309212],
-												 [	-6.27221499, -0.00081389, 0.00049886, 7.27140110, 0.99751294, 0.99868725, 0.49309226],
-												 [	-6.27221552, -0.00081368, 0.00049873, 7.27140185, 0.99751359, 0.99868759, 0.49309233],
-												 [	-6.27221606, -0.00081346, 0.00049860, 7.27140260, 0.99751425, 0.99868794, 0.49309240],
-												 [	-6.27221660, -0.00081325, 0.00049847, 7.27140335, 0.99751490, 0.99868828, 0.49309241],
-												 [	-6.27221713, -0.00081303, 0.00049834, 7.27140410, 0.99751555, 0.99868863, 0.49309250],
-												 [	-6.27221767, -0.00081282, 0.00049821, 7.27140485, 0.99751621, 0.99868897, 0.49309252],
-												 [	-6.27221820, -0.00081261, 0.00049807, 7.27140559, 0.99751686, 0.99868932, 0.49309262],
-												 [	-6.27221874, -0.00081239, 0.00049794, 7.27140634, 0.99751751, 0.99868966, 0.49309274],
-												 [	-6.27221927, -0.00081218, 0.00049781, 7.27140709, 0.99751816, 0.99869001, 0.49309277],
-												 [	-6.27221980, -0.00081197, 0.00049768, 7.27140784, 0.99751881, 0.99869035, 0.49309287],
-												 [	-6.27222034, -0.00081176, 0.00049755, 7.27140858, 0.99751946, 0.99869069, 0.49309295],
-												 [	-6.27222087, -0.00081154, 0.00049742, 7.27140933, 0.99752012, 0.99869104, 0.49309305],
-												 [	-6.27222140, -0.00081133, 0.00049729, 7.27141007, 0.99752077, 0.99869138, 0.49309311],
-												 [	-6.27222193, -0.00081112, 0.00049716, 7.27141082, 0.99752142, 0.99869172, 0.49309317],
-												 [	-6.27222247, -0.00081090, 0.00049703, 7.27141156, 0.99752207, 0.99869207, 0.49309328],
-												 [	-6.27222300, -0.00081069, 0.00049690, 7.27141230, 0.99752271, 0.99869241, 0.49309332],
-												 [	-6.27222353, -0.00081048, 0.00049677, 7.27141305, 0.99752336, 0.99869275, 0.49309344],
-												 [	-6.27222406, -0.00081027, 0.00049664, 7.27141379, 0.99752401, 0.99869309, 0.49309341],
-												 [	-6.27222459, -0.00081006, 0.00049651, 7.27141453, 0.99752466, 0.99869344, 0.49309354],
-												 [	-6.27222512, -0.00080984, 0.00049638, 7.27141527, 0.99752531, 0.99869378, 0.49309361],
-												 [	-6.27222565, -0.00080963, 0.00049625, 7.27141602, 0.99752596, 0.99869412, 0.49309375],
-												 [	-6.27222618, -0.00080942, 0.00049612, 7.27141676, 0.99752660, 0.99869446, 0.49309380],
-												 [	-6.27222671, -0.00080921, 0.00049599, 7.27141750, 0.99752725, 0.99869480, 0.49309382],
-												 [	-6.27222723, -0.00080900, 0.00049586, 7.27141824, 0.99752790, 0.99869514, 0.49309395],
-												 [	-6.27222776, -0.00080879, 0.00049573, 7.27141898, 0.99752854, 0.99869548, 0.49309403],
-												 [	-6.27222829, -0.00080857, 0.00049560, 7.27141972, 0.99752919, 0.99869582, 0.49309409],
-												 [	-6.27222882, -0.00080836, 0.00049547, 7.27142045, 0.99752984, 0.99869617, 0.49309410],
-												 [	-6.27222934, -0.00080815, 0.00049534, 7.27142119, 0.99753048, 0.99869651, 0.49309425],
-												 [	-6.27222987, -0.00080794, 0.00049521, 7.27142193, 0.99753113, 0.99869685, 0.49309434],
-												 [	-6.27223040, -0.00080773, 0.00049508, 7.27142267, 0.99753177, 0.99869719, 0.49309443],
-												 [	-6.27223092, -0.00080752, 0.00049495, 7.27142340, 0.99753241, 0.99869753, 0.49309447],
-												 [	-6.27223145, -0.00080731, 0.00049482, 7.27142414, 0.99753306, 0.99869787, 0.49309457],
-												 [	-6.27223197, -0.00080710, 0.00049469, 7.27142488, 0.99753370, 0.99869821, 0.49309459],
-												 [	-6.27223250, -0.00080689, 0.00049457, 7.27142561, 0.99753435, 0.99869855, 0.49309463],
-												 [	-6.27223302, -0.00080668, 0.00049444, 7.27142635, 0.99753499, 0.99869888, 0.49309473],
-												 [	-6.27223355, -0.00080647, 0.00049431, 7.27142708, 0.99753563, 0.99869922, 0.49309486],
-												 [	-6.27223407, -0.00080626, 0.00049418, 7.27142781, 0.99753627, 0.99869956, 0.49309496],
-												 [	-6.27223460, -0.00080605, 0.00049405, 7.27142855, 0.99753692, 0.99869990, 0.49309501],
-												 [	-6.27223512, -0.00080584, 0.00049392, 7.27142928, 0.99753756, 0.99870024, 0.49309506],
-												 [	-6.27223564, -0.00080563, 0.00049379, 7.27143001, 0.99753820, 0.99870058, 0.49309510],
-												 [	-6.27223616, -0.00080542, 0.00049366, 7.27143074, 0.99753884, 0.99870092, 0.49309524],
-												 [	-6.27223669, -0.00080521, 0.00049354, 7.27143148, 0.99753948, 0.99870125, 0.49309538],
-												 [	-6.27223721, -0.00080500, 0.00049341, 7.27143221, 0.99754012, 0.99870159, 0.49309541],
-												 [	-6.27223773, -0.00080479, 0.00049328, 7.27143294, 0.99754076, 0.99870193, 0.49309547],
-												 [	-6.27223825, -0.00080458, 0.00049315, 7.27143367, 0.99754140, 0.99870227, 0.49309552],
-												 [	-6.27223877, -0.00080437, 0.00049302, 7.27143440, 0.99754204, 0.99870260, 0.49309562],
-												 [	-6.27223929, -0.00080416, 0.00049289, 7.27143513, 0.99754268, 0.99870294, 0.49309564],
-												 [	-6.27223981, -0.00080395, 0.00049277, 7.27143586, 0.99754332, 0.99870328, 0.49309575],
-												 [	-6.27224033, -0.00080375, 0.00049264, 7.27143658, 0.99754395, 0.99870362, 0.49309585],
-												 [	-6.27224085, -0.00080354, 0.00049251, 7.27143731, 0.99754459, 0.99870395, 0.49309591],
-												 [	-6.27224137, -0.00080333, 0.00049238, 7.27143804, 0.99754523, 0.99870429, 0.49309595],
-												 [	-6.27224189, -0.00080312, 0.00049225, 7.27143877, 0.99754587, 0.99870463, 0.49309610],
-												 [	-6.27224241, -0.00080291, 0.00049213, 7.27143949, 0.99754650, 0.99870496, 0.49309609],
-												 [	-6.27224292, -0.00080270, 0.00049200, 7.27144022, 0.99754714, 0.99870530, 0.49309625],
-												 [	-6.27224344, -0.00080250, 0.00049187, 7.27144094, 0.99754778, 0.99870563, 0.49309625],
-												 [	-6.27224396, -0.00080229, 0.00049174, 7.27144167, 0.99754841, 0.99870597, 0.49309632],
-												 [	-6.27224447, -0.00080208, 0.00049162, 7.27144239, 0.99754905, 0.99870630, 0.49309639],
-												 [	-6.27224499, -0.00080187, 0.00049149, 7.27144312, 0.99754968, 0.99870664, 0.49309648],
-												 [	-6.27224551, -0.00080166, 0.00049136, 7.27144384, 0.99755032, 0.99870697, 0.49309655],
-												 [	-6.27224602, -0.00080146, 0.00049123, 7.27144457, 0.99755095, 0.99870731, 0.49309667],
-												 [	-6.27224654, -0.00080125, 0.00049111, 7.27144529, 0.99755159, 0.99870764, 0.49309666],
-												 [	-6.27224705, -0.00080104, 0.00049098, 7.27144601, 0.99755222, 0.99870798, 0.49309679],
-												 [	-6.27224757, -0.00080084, 0.00049085, 7.27144673, 0.99755286, 0.99870831, 0.49309687],
-												 [	-6.27224808, -0.00080063, 0.00049072, 7.27144746, 0.99755349, 0.99870865, 0.49309695],
-												 [	-6.27224860, -0.00080042, 0.00049060, 7.27144818, 0.99755412, 0.99870898, 0.49309704],
-												 [	-6.27224911, -0.00080021, 0.00049047, 7.27144890, 0.99755476, 0.99870932, 0.49309706],
-												 [	-6.27224962, -0.00080001, 0.00049034, 7.27144962, 0.99755539, 0.99870965, 0.49309713],
-												 [	-6.27225014, -0.00079980, 0.00049022, 7.27145034, 0.99755602, 0.99870998, 0.49309722],
-												 [	-6.27225065, -0.00079959, 0.00049009, 7.27145106, 0.99755665, 0.99871032, 0.49309728],
-												 [	-6.27225116, -0.00079939, 0.00048996, 7.27145178, 0.99755728, 0.99871065, 0.49309738],
-												 [	-6.27225168, -0.00079918, 0.00048984, 7.27145249, 0.99755791, 0.99871098, 0.49309747],
-												 [	-6.27225219, -0.00079897, 0.00048971, 7.27145321, 0.99755854, 0.99871131, 0.49309753],
-												 [	-6.27225270, -0.00079877, 0.00048958, 7.27145393, 0.99755918, 0.99871165, 0.49309771],
-												 [	-6.27225321, -0.00079856, 0.00048946, 7.27145465, 0.99755981, 0.99871198, 0.49309765],
-												 [	-6.27225372, -0.00079836, 0.00048933, 7.27145536, 0.99756044, 0.99871231, 0.49309782],
-												 [	-6.27225423, -0.00079815, 0.00048921, 7.27145608, 0.99756106, 0.99871264, 0.49309784],
-												 [	-6.27225474, -0.00079795, 0.00048908, 7.27145680, 0.99756169, 0.99871298, 0.49309793],
-												 [	-6.27225525, -0.00079774, 0.00048895, 7.27145751, 0.99756232, 0.99871331, 0.49309799],
-												 [	-6.27225576, -0.00079753, 0.00048883, 7.27145823, 0.99756295, 0.99871364, 0.49309812],
-												 [	-6.27225627, -0.00079733, 0.00048870, 7.27145894, 0.99756358, 0.99871397, 0.49309805],
-												 [	-6.27225678, -0.00079712, 0.00048857, 7.27145966, 0.99756421, 0.99871430, 0.49309821],
-												 [	-6.27225729, -0.00079692, 0.00048845, 7.27146037, 0.99756483, 0.99871463, 0.49309831],
-												 [	-6.27225780, -0.00079671, 0.00048832, 7.27146108, 0.99756546, 0.99871496, 0.49309836],
-												 [	-6.27225830, -0.00079651, 0.00048820, 7.27146180, 0.99756609, 0.99871529, 0.49309842],
-												 [	-6.27225881, -0.00079630, 0.00048807, 7.27146251, 0.99756671, 0.99871563, 0.49309856],
-												 [	-6.27225932, -0.00079610, 0.00048795, 7.27146322, 0.99756734, 0.99871596, 0.49309861],
-												 [	-6.27225983, -0.00079589, 0.00048782, 7.27146393, 0.99756797, 0.99871629, 0.49309861],
-												 [	-6.27226033, -0.00079569, 0.00048769, 7.27146464, 0.99756859, 0.99871662, 0.49309873],
-												 [	-6.27226084, -0.00079548, 0.00048757, 7.27146535, 0.99756922, 0.99871695, 0.49309877],
-												 [	-6.27226134, -0.00079528, 0.00048744, 7.27146606, 0.99756984, 0.99871728, 0.49309886],
-												 [	-6.27226185, -0.00079508, 0.00048732, 7.27146677, 0.99757047, 0.99871761, 0.49309893],
-												 [	-6.27226235, -0.00079487, 0.00048719, 7.27146748, 0.99757109, 0.99871793, 0.49309902],
-												 [	-6.27226286, -0.00079467, 0.00048707, 7.27146819, 0.99757172, 0.99871826, 0.49309912],
-												 [	-6.27226336, -0.00079446, 0.00048694, 7.27146890, 0.99757234, 0.99871859, 0.49309921],
-												 [	-6.27226387, -0.00079426, 0.00048682, 7.27146961, 0.99757296, 0.99871892, 0.49309921],
-												 [	-6.27226437, -0.00079406, 0.00048669, 7.27147032, 0.99757359, 0.99871925, 0.49309928],
-												 [	-6.27226488, -0.00079385, 0.00048657, 7.27147102, 0.99757421, 0.99871958, 0.49309939],
-												 [	-6.27226538, -0.00079365, 0.00048644, 7.27147173, 0.99757483, 0.99871991, 0.49309945],
-												 [	-6.27226588, -0.00079345, 0.00048632, 7.27147244, 0.99757545, 0.99872024, 0.49309958],
-												 [	-6.27226639, -0.00079324, 0.00048619, 7.27147314, 0.99757607, 0.99872056, 0.49309958],
-												 [	-6.27226689, -0.00079304, 0.00048607, 7.27147385, 0.99757670, 0.99872089, 0.49309961],
-												 [	-6.27226739, -0.00079284, 0.00048594, 7.27147455, 0.99757732, 0.99872122, 0.49309967],
-												 [	-6.27226789, -0.00079263, 0.00048582, 7.27147526, 0.99757794, 0.99872155, 0.49309986],
-												 [	-6.27226839, -0.00079243, 0.00048570, 7.27147596, 0.99757856, 0.99872187, 0.49309996],
-												 [	-6.27226889, -0.00079223, 0.00048557, 7.27147667, 0.99757918, 0.99872220, 0.49309999],
-												 [	-6.27226939, -0.00079202, 0.00048545, 7.27147737, 0.99757980, 0.99872253, 0.49310010],
-												 [	-6.27226990, -0.00079182, 0.00048532, 7.27147807, 0.99758042, 0.99872286, 0.49310015],
-												 [	-6.27227040, -0.00079162, 0.00048520, 7.27147878, 0.99758104, 0.99872318, 0.49310022],
-												 [	-6.27227090, -0.00079142, 0.00048507, 7.27147948, 0.99758166, 0.99872351, 0.49310023],
-												 [	-6.27227139, -0.00079121, 0.00048495, 7.27148018, 0.99758227, 0.99872384, 0.49310029],
-												 [	-6.27227189, -0.00079101, 0.00048483, 7.27148088, 0.99758289, 0.99872416, 0.49310038],
-												 [	-6.27227239, -0.00079081, 0.00048470, 7.27148158, 0.99758351, 0.99872449, 0.49310046],
-												 [	-6.27227289, -0.00079061, 0.00048458, 7.27148228, 0.99758413, 0.99872481, 0.49310052],
-												 [	-6.27227339, -0.00079041, 0.00048445, 7.27148298, 0.99758474, 0.99872514, 0.49310058],
-												 [	-6.27227389, -0.00079020, 0.00048433, 7.27148368, 0.99758536, 0.99872546, 0.49310064],
-												 [	-6.27227439, -0.00079000, 0.00048421, 7.27148438, 0.99758598, 0.99872579, 0.49310077],
-												 [	-6.27227488, -0.00078980, 0.00048408, 7.27148508, 0.99758659, 0.99872612, 0.49310085],
-												 [	-6.27227538, -0.00078960, 0.00048396, 7.27148578, 0.99758721, 0.99872644, 0.49310092],
-												 [	-6.27227588, -0.00078940, 0.00048384, 7.27148648, 0.99758783, 0.99872677, 0.49310100],
-												 [	-6.27227637, -0.00078920, 0.00048371, 7.27148717, 0.99758844, 0.99872709, 0.49310112],
-												 [	-6.27227687, -0.00078900, 0.00048359, 7.27148787, 0.99758906, 0.99872741, 0.49310113],
-												 [	-6.27227736, -0.00078880, 0.00048347, 7.27148857, 0.99758967, 0.99872774, 0.49310122],
-												 [	-6.27227786, -0.00078859, 0.00048334, 7.27148927, 0.99759029, 0.99872806, 0.49310127],
-												 [	-6.27227836, -0.00078839, 0.00048322, 7.27148996, 0.99759090, 0.99872839, 0.49310130],
-												 [	-6.27227885, -0.00078819, 0.00048310, 7.27149066, 0.99759151, 0.99872871, 0.49310141],
-												 [	-6.27227934, -0.00078799, 0.00048297, 7.27149135, 0.99759213, 0.99872903, 0.49310152],
-												 [	-6.27227984, -0.00078779, 0.00048285, 7.27149205, 0.99759274, 0.99872936, 0.49310152],
-												 [	-6.27228033, -0.00078759, 0.00048273, 7.27149274, 0.99759335, 0.99872968, 0.49310163],
-												 [	-6.27228083, -0.00078739, 0.00048260, 7.27149344, 0.99759397, 0.99873001, 0.49310168],
-												 [	-6.27228132, -0.00078719, 0.00048248, 7.27149413, 0.99759458, 0.99873033, 0.49310178],
-												 [	-6.27228181, -0.00078699, 0.00048236, 7.27149482, 0.99759519, 0.99873065, 0.49310189],
-												 [	-6.27228231, -0.00078679, 0.00048224, 7.27149552, 0.99759580, 0.99873097, 0.49310191],
-												 [	-6.27228280, -0.00078659, 0.00048211, 7.27149621, 0.99759641, 0.99873130, 0.49310203],
-												 [	-6.27228329, -0.00078639, 0.00048199, 7.27149690, 0.99759702, 0.99873162, 0.49310202],
-												 [	-6.27228378, -0.00078619, 0.00048187, 7.27149759, 0.99759763, 0.99873194, 0.49310216],
-												 [	-6.27228427, -0.00078599, 0.00048175, 7.27149828, 0.99759825, 0.99873226, 0.49310220],
-												 [	-6.27228476, -0.00078579, 0.00048162, 7.27149897, 0.99759886, 0.99873259, 0.49310228],
-												 [	-6.27228526, -0.00078559, 0.00048150, 7.27149966, 0.99759946, 0.99873291, 0.49310231],
-												 [	-6.27228575, -0.00078539, 0.00048138, 7.27150035, 0.99760007, 0.99873323, 0.49310245],
-												 [	-6.27228624, -0.00078519, 0.00048126, 7.27150104, 0.99760068, 0.99873355, 0.49310250],
-												 [	-6.27228673, -0.00078500, 0.00048113, 7.27150173, 0.99760129, 0.99873387, 0.49310256],
-												 [	-6.27228722, -0.00078480, 0.00048101, 7.27150242, 0.99760190, 0.99873419, 0.49310269],
-												 [	-6.27228771, -0.00078460, 0.00048089, 7.27150311, 0.99760251, 0.99873451, 0.49310278],
-												 [	-6.27228819, -0.00078440, 0.00048077, 7.27150380, 0.99760312, 0.99873483, 0.49310277],
-												 [	-6.27228868, -0.00078420, 0.00048065, 7.27150448, 0.99760372, 0.99873515, 0.49310291],
-												 [	-6.27228917, -0.00078400, 0.00048052, 7.27150517, 0.99760433, 0.99873548, 0.49310291],
-												 [	-6.27228966, -0.00078380, 0.00048040, 7.27150586, 0.99760494, 0.99873580, 0.49310301],
-												 [	-6.27229015, -0.00078360, 0.00048028, 7.27150654, 0.99760555, 0.99873612, 0.49310307],
-												 [	-6.27229064, -0.00078341, 0.00048016, 7.27150723, 0.99760615, 0.99873644, 0.49310321],
-												 [	-6.27229112, -0.00078321, 0.00048004, 7.27150792, 0.99760676, 0.99873676, 0.49310322],
-												 [	-6.27229161, -0.00078301, 0.00047992, 7.27150860, 0.99760736, 0.99873707, 0.49310330],
-												 [	-6.27229210, -0.00078281, 0.00047979, 7.27150929, 0.99760797, 0.99873739, 0.49310330],
-												 [	-6.27229258, -0.00078261, 0.00047967, 7.27150997, 0.99760857, 0.99873771, 0.49310340],
-												 [	-6.27229307, -0.00078242, 0.00047955, 7.27151065, 0.99760918, 0.99873803, 0.49310344],
-												 [	-6.27229356, -0.00078222, 0.00047943, 7.27151134, 0.99760978, 0.99873835, 0.49310362],
-												 [	-6.27229404, -0.00078202, 0.00047931, 7.27151202, 0.99761039, 0.99873867, 0.49310362],
-												 [	-6.27229453, -0.00078182, 0.00047919, 7.27151270, 0.99761099, 0.99873899, 0.49310369],
-												 [	-6.27229501, -0.00078163, 0.00047907, 7.27151339, 0.99761160, 0.99873931, 0.49310382],
-												 [	-6.27229550, -0.00078143, 0.00047895, 7.27151407, 0.99761220, 0.99873963, 0.49310378],
-												 [	-6.27229598, -0.00078123, 0.00047882, 7.27151475, 0.99761280, 0.99873994, 0.49310395],
-												 [	-6.27229646, -0.00078103, 0.00047870, 7.27151543, 0.99761340, 0.99874026, 0.49310398],
-												 [	-6.27229695, -0.00078084, 0.00047858, 7.27151611, 0.99761401, 0.99874058, 0.49310409],
-												 [	-6.27229743, -0.00078064, 0.00047846, 7.27151679, 0.99761461, 0.99874090, 0.49310410],
-												 [	-6.27229791, -0.00078044, 0.00047834, 7.27151747, 0.99761521, 0.99874122, 0.49310419],
-												 [	-6.27229840, -0.00078025, 0.00047822, 7.27151815, 0.99761581, 0.99874153, 0.49310426],
-												 [	-6.27229888, -0.00078005, 0.00047810, 7.27151883, 0.99761641, 0.99874185, 0.49310431],
-												 [	-6.27229936, -0.00077985, 0.00047798, 7.27151951, 0.99761701, 0.99874217, 0.49310439],
-												 [	-6.27229984, -0.00077966, 0.00047786, 7.27152019, 0.99761762, 0.99874248, 0.49310456],
-												 [	-6.27230033, -0.00077946, 0.00047774, 7.27152087, 0.99761822, 0.99874280, 0.49310453],
-												 [	-6.27230081, -0.00077926, 0.00047762, 7.27152154, 0.99761882, 0.99874312, 0.49310456],
-												 [	-6.27230129, -0.00077907, 0.00047750, 7.27152222, 0.99761942, 0.99874343, 0.49310472],
-												 [	-6.27230177, -0.00077887, 0.00047738, 7.27152290, 0.99762001, 0.99874375, 0.49310478],
-												 [	-6.27230225, -0.00077868, 0.00047726, 7.27152357, 0.99762061, 0.99874407, 0.49310482],
-												 [	-6.27230273, -0.00077848, 0.00047714, 7.27152425, 0.99762121, 0.99874438, 0.49310485],
-												 [	-6.27230321, -0.00077828, 0.00047702, 7.27152493, 0.99762181, 0.99874470, 0.49310496],
-												 [	-6.27230369, -0.00077809, 0.00047690, 7.27152560, 0.99762241, 0.99874501, 0.49310508],
-												 [	-6.27230417, -0.00077789, 0.00047678, 7.27152628, 0.99762301, 0.99874533, 0.49310514],
-												 [	-6.27230465, -0.00077770, 0.00047666, 7.27152695, 0.99762360, 0.99874564, 0.49310512],
-												 [	-6.27230513, -0.00077750, 0.00047654, 7.27152763, 0.99762420, 0.99874596, 0.49310522],
-												 [	-6.27230561, -0.00077731, 0.00047642, 7.27152830, 0.99762480, 0.99874627, 0.49310530],
-												 [	-6.27230609, -0.00077711, 0.00047630, 7.27152897, 0.99762540, 0.99874659, 0.49310543],
-												 [	-6.27230656, -0.00077692, 0.00047618, 7.27152965, 0.99762599, 0.99874690, 0.49310543],
-												 [	-6.27230704, -0.00077672, 0.00047606, 7.27153032, 0.99762659, 0.99874722, 0.49310556],
-												 [	-6.27230752, -0.00077653, 0.00047594, 7.27153099, 0.99762718, 0.99874753, 0.49310555],
-												 [	-6.27230800, -0.00077633, 0.00047582, 7.27153166, 0.99762778, 0.99874785, 0.49310570],
-												 [	-6.27230847, -0.00077614, 0.00047570, 7.27153233, 0.99762837, 0.99874816, 0.49310570],
-												 [	-6.27230895, -0.00077594, 0.00047558, 7.27153301, 0.99762897, 0.99874848, 0.49310582],
-												 [	-6.27230943, -0.00077575, 0.00047546, 7.27153368, 0.99762956, 0.99874879, 0.49310585],
-												 [	-6.27230990, -0.00077556, 0.00047534, 7.27153435, 0.99763016, 0.99874910, 0.49310599],
-												 [	-6.27231038, -0.00077536, 0.00047522, 7.27153502, 0.99763075, 0.99874942, 0.49310605],
-												 [	-6.27231085, -0.00077517, 0.00047510, 7.27153569, 0.99763135, 0.99874973, 0.49310608],
-												 [	-6.27231133, -0.00077497, 0.00047498, 7.27153636, 0.99763194, 0.99875004, 0.49310612],
-												 [	-6.27231180, -0.00077478, 0.00047487, 7.27153702, 0.99763253, 0.99875036, 0.49310624],
-												 [	-6.27231228, -0.00077458, 0.00047475, 7.27153769, 0.99763312, 0.99875067, 0.49310622],
-												 [	-6.27231275, -0.00077439, 0.00047463, 7.27153836, 0.99763372, 0.99875098, 0.49310639],
-												 [	-6.27231323, -0.00077420, 0.00047451, 7.27153903, 0.99763431, 0.99875129, 0.49310643],
-												 [	-6.27231370, -0.00077400, 0.00047439, 7.27153970, 0.99763490, 0.99875161, 0.49310644],
-												 [	-6.27231417, -0.00077381, 0.00047427, 7.27154036, 0.99763549, 0.99875192, 0.49310654],
-												 [	-6.27231465, -0.00077362, 0.00047415, 7.27154103, 0.99763608, 0.99875223, 0.49310665],
-												 [	-6.27231512, -0.00077342, 0.00047403, 7.27154170, 0.99763668, 0.99875254, 0.49310674],
-												 [	-6.27231559, -0.00077323, 0.00047392, 7.27154236, 0.99763727, 0.99875285, 0.49310670],
-												 [	-6.27231607, -0.00077304, 0.00047380, 7.27154303, 0.99763786, 0.99875317, 0.49310684],
-												 [	-6.27231654, -0.00077284, 0.00047368, 7.27154369, 0.99763845, 0.99875348, 0.49310692],
-												 [	-6.27231701, -0.00077265, 0.00047356, 7.27154436, 0.99763904, 0.99875379, 0.49310699],
-												 [	-6.27231748, -0.00077246, 0.00047344, 7.27154502, 0.99763963, 0.99875410, 0.49310700],
-												 [	-6.27231795, -0.00077227, 0.00047332, 7.27154569, 0.99764021, 0.99875441, 0.49310703],
-												 [	-6.27231842, -0.00077207, 0.00047321, 7.27154635, 0.99764080, 0.99875472, 0.49310722],
-												 [	-6.27231889, -0.00077188, 0.00047309, 7.27154701, 0.99764139, 0.99875503, 0.49310725],
-												 [	-6.27231936, -0.00077169, 0.00047297, 7.27154768, 0.99764198, 0.99875534, 0.49310729],
-												 [	-6.27231984, -0.00077150, 0.00047285, 7.27154834, 0.99764257, 0.99875565, 0.49310745],
-												 [	-6.27232031, -0.00077130, 0.00047273, 7.27154900, 0.99764316, 0.99875596, 0.49310751],
-												 [	-6.27232077, -0.00077111, 0.00047262, 7.27154966, 0.99764374, 0.99875627, 0.49310749],
-												 [	-6.27232124, -0.00077092, 0.00047250, 7.27155032, 0.99764433, 0.99875658, 0.49310765],
-												 [	-6.27232171, -0.00077073, 0.00047238, 7.27155099, 0.99764492, 0.99875689, 0.49310767],
-												 [	-6.27232218, -0.00077054, 0.00047226, 7.27155165, 0.99764550, 0.99875720, 0.49310775],
-												 [	-6.27232265, -0.00077034, 0.00047215, 7.27155231, 0.99764609, 0.99875751, 0.49310781],
-												 [	-6.27232312, -0.00077015, 0.00047203, 7.27155297, 0.99764668, 0.99875782, 0.49310787],
-												 [	-6.27232359, -0.00076996, 0.00047191, 7.27155363, 0.99764726, 0.99875813, 0.49310796],
-												 [	-6.27232406, -0.00076977, 0.00047179, 7.27155429, 0.99764785, 0.99875844, 0.49310787],
-												 [	-6.27232452, -0.00076958, 0.00047168, 7.27155494, 0.99764843, 0.99875875, 0.49310807],
-												 [	-6.27232499, -0.00076939, 0.00047156, 7.27155560, 0.99764902, 0.99875906, 0.49310819],
-												 [	-6.27232546, -0.00076920, 0.00047144, 7.27155626, 0.99764960, 0.99875936, 0.49310824],
-												 [	-6.27232592, -0.00076900, 0.00047132, 7.27155692, 0.99765019, 0.99875967, 0.49310831],
-												 [	-6.27232639, -0.00076881, 0.00047121, 7.27155758, 0.99765077, 0.99875998, 0.49310826],
-												 [	-6.27232686, -0.00076862, 0.00047109, 7.27155823, 0.99765135, 0.99876029, 0.49310841],
-												 [	-6.27232732, -0.00076843, 0.00047097, 7.27155889, 0.99765194, 0.99876060, 0.49310851],
-												 [	-6.27232779, -0.00076824, 0.00047086, 7.27155955, 0.99765252, 0.99876090, 0.49310855],
-												 [	-6.27232825, -0.00076805, 0.00047074, 7.27156020, 0.99765310, 0.99876121, 0.49310862],
-												 [	-6.27232872, -0.00076786, 0.00047062, 7.27156086, 0.99765369, 0.99876152, 0.49310868],
-												 [	-6.27232918, -0.00076767, 0.00047050, 7.27156151, 0.99765427, 0.99876183, 0.49310870],
-												 [	-6.27232965, -0.00076748, 0.00047039, 7.27156217, 0.99765485, 0.99876213, 0.49310885],
-												 [	-6.27233011, -0.00076729, 0.00047027, 7.27156282, 0.99765543, 0.99876244, 0.49310881],
-												 [	-6.27233058, -0.00076710, 0.00047015, 7.27156348, 0.99765601, 0.99876275, 0.49310901],
-												 [	-6.27233104, -0.00076691, 0.00047004, 7.27156413, 0.99765660, 0.99876305, 0.49310905],
-												 [	-6.27233150, -0.00076672, 0.00046992, 7.27156478, 0.99765718, 0.99876336, 0.49310906],
-												 [	-6.27233197, -0.00076653, 0.00046981, 7.27156544, 0.99765776, 0.99876367, 0.49310915],
-												 [	-6.27233243, -0.00076634, 0.00046969, 7.27156609, 0.99765834, 0.99876397, 0.49310926],
-												 [	-6.27233289, -0.00076615, 0.00046957, 7.27156674, 0.99765892, 0.99876428, 0.49310922],
-												 [	-6.27233336, -0.00076596, 0.00046946, 7.27156740, 0.99765950, 0.99876458, 0.49310945],
-												 [	-6.27233382, -0.00076577, 0.00046934, 7.27156805, 0.99766008, 0.99876489, 0.49310949],
-												 [	-6.27233428, -0.00076558, 0.00046922, 7.27156870, 0.99766065, 0.99876520, 0.49310955],
-												 [	-6.27233474, -0.00076539, 0.00046911, 7.27156935, 0.99766123, 0.99876550, 0.49310960],
-												 [	-6.27233520, -0.00076520, 0.00046899, 7.27157000, 0.99766181, 0.99876581, 0.49310966],
-												 [	-6.27233566, -0.00076501, 0.00046888, 7.27157065, 0.99766239, 0.99876611, 0.49310976],
-												 [	-6.27233612, -0.00076482, 0.00046876, 7.27157130, 0.99766297, 0.99876642, 0.49310982],
-												 [	-6.27233658, -0.00076464, 0.00046864, 7.27157195, 0.99766355, 0.99876672, 0.49310988],
-												 [	-6.27233705, -0.00076445, 0.00046853, 7.27157260, 0.99766412, 0.99876703, 0.49310995],
-												 [	-6.27233751, -0.00076426, 0.00046841, 7.27157325, 0.99766470, 0.99876733, 0.49310998],
-												 [	-6.27233797, -0.00076407, 0.00046830, 7.27157390, 0.99766528, 0.99876763, 0.49311004],
-												 [	-6.27233843, -0.00076388, 0.00046818, 7.27157454, 0.99766585, 0.99876794, 0.49311017],
-												 [	-6.27233888, -0.00076369, 0.00046806, 7.27157519, 0.99766643, 0.99876824, 0.49311019],
-												 [	-6.27233934, -0.00076350, 0.00046795, 7.27157584, 0.99766701, 0.99876855, 0.49311023],
-												 [	-6.27233980, -0.00076332, 0.00046783, 7.27157649, 0.99766758, 0.99876885, 0.49311028],
-												 [	-6.27234026, -0.00076313, 0.00046772, 7.27157713, 0.99766816, 0.99876915, 0.49311042],
-												 [	-6.27234072, -0.00076294, 0.00046760, 7.27157778, 0.99766873, 0.99876946, 0.49311047],
-												 [	-6.27234118, -0.00076275, 0.00046749, 7.27157843, 0.99766931, 0.99876976, 0.49311045],
-												 [	-6.27234163, -0.00076256, 0.00046737, 7.27157907, 0.99766988, 0.99877006, 0.49311061],
-												 [	-6.27234209, -0.00076238, 0.00046726, 7.27157972, 0.99767046, 0.99877037, 0.49311059],
-												 [	-6.27234255, -0.00076219, 0.00046714, 7.27158036, 0.99767103, 0.99877067, 0.49311072],
-												 [	-6.27234301, -0.00076200, 0.00046703, 7.27158101, 0.99767160, 0.99877097, 0.49311081],
-												 [	-6.27234346, -0.00076181, 0.00046691, 7.27158165, 0.99767218, 0.99877128, 0.49311088],
-												 [	-6.27234392, -0.00076163, 0.00046680, 7.27158229, 0.99767275, 0.99877158, 0.49311099],
-												 [	-6.27234438, -0.00076144, 0.00046668, 7.27158294, 0.99767332, 0.99877188, 0.49311100],
-												 [	-6.27234483, -0.00076125, 0.00046657, 7.27158358, 0.99767389, 0.99877218, 0.49311108],
-												 [	-6.27234529, -0.00076106, 0.00046645, 7.27158422, 0.99767447, 0.99877248, 0.49311114],
-												 [	-6.27234574, -0.00076088, 0.00046634, 7.27158487, 0.99767504, 0.99877279, 0.49311126],
-												 [	-6.27234620, -0.00076069, 0.00046622, 7.27158551, 0.99767561, 0.99877309, 0.49311118],
-												 [	-6.27234665, -0.00076050, 0.00046611, 7.27158615, 0.99767618, 0.99877339, 0.49311132],
-												 [	-6.27234711, -0.00076032, 0.00046599, 7.27158679, 0.99767675, 0.99877369, 0.49311134],
-												 [	-6.27234756, -0.00076013, 0.00046588, 7.27158743, 0.99767732, 0.99877399, 0.49311138],
-												 [	-6.27234802, -0.00075994, 0.00046576, 7.27158807, 0.99767789, 0.99877429, 0.49311158],
-												 [	-6.27234847, -0.00075976, 0.00046565, 7.27158872, 0.99767846, 0.99877459, 0.49311152],
-												 [	-6.27234892, -0.00075957, 0.00046554, 7.27158935, 0.99767903, 0.99877489, 0.49311170],
-												 [	-6.27234938, -0.00075938, 0.00046542, 7.27158999, 0.99767960, 0.99877519, 0.49311176],
-												 [	-6.27234983, -0.00075920, 0.00046531, 7.27159063, 0.99768017, 0.99877550, 0.49311184],
-												 [	-6.27235028, -0.00075901, 0.00046519, 7.27159127, 0.99768074, 0.99877580, 0.49311180],
-												 [	-6.27235074, -0.00075882, 0.00046508, 7.27159191, 0.99768131, 0.99877610, 0.49311187],
-												 [	-6.27235119, -0.00075864, 0.00046496, 7.27159255, 0.99768188, 0.99877640, 0.49311206],
-												 [	-6.27235164, -0.00075845, 0.00046485, 7.27159319, 0.99768245, 0.99877670, 0.49311212],
-												 [	-6.27235209, -0.00075827, 0.00046474, 7.27159383, 0.99768302, 0.99877700, 0.49311212],
-												 [	-6.27235255, -0.00075808, 0.00046462, 7.27159446, 0.99768358, 0.99877730, 0.49311214],
-												 [	-6.27235300, -0.00075790, 0.00046451, 7.27159510, 0.99768415, 0.99877759, 0.49311223],
-												 [	-6.27235345, -0.00075771, 0.00046440, 7.27159574, 0.99768472, 0.99877789, 0.49311231],
-												 [	-6.27235390, -0.00075753, 0.00046428, 7.27159637, 0.99768529, 0.99877819, 0.49311242],
-												 [	-6.27235435, -0.00075734, 0.00046417, 7.27159701, 0.99768585, 0.99877849, 0.49311242],
-												 [	-6.27235480, -0.00075715, 0.00046405, 7.27159765, 0.99768642, 0.99877879, 0.49311257],
-												 [	-6.27235525, -0.00075697, 0.00046394, 7.27159828, 0.99768699, 0.99877909, 0.49311263],
-												 [	-6.27235570, -0.00075678, 0.00046383, 7.27159892, 0.99768755, 0.99877939, 0.49311265],
-												 [	-6.27235615, -0.00075660, 0.00046371, 7.27159955, 0.99768812, 0.99877969, 0.49311271],
-												 [	-6.27235660, -0.00075641, 0.00046360, 7.27160019, 0.99768868, 0.99877999, 0.49311273],
-												 [	-6.27235705, -0.00075623, 0.00046349, 7.27160082, 0.99768925, 0.99878028, 0.49311292],
-												 [	-6.27235750, -0.00075605, 0.00046337, 7.27160145, 0.99768981, 0.99878058, 0.49311290],
-												 [	-6.27235795, -0.00075586, 0.00046326, 7.27160209, 0.99769038, 0.99878088, 0.49311294],
-												 [	-6.27235840, -0.00075568, 0.00046315, 7.27160272, 0.99769094, 0.99878118, 0.49311305],
-												 [	-6.27235884, -0.00075549, 0.00046303, 7.27160335, 0.99769150, 0.99878147, 0.49311309],
-												 [	-6.27235929, -0.00075531, 0.00046292, 7.27160398, 0.99769207, 0.99878177, 0.49311327],
-												 [	-6.27235974, -0.00075512, 0.00046281, 7.27160462, 0.99769263, 0.99878207, 0.49311324],
-												 [	-6.27236019, -0.00075494, 0.00046269, 7.27160525, 0.99769319, 0.99878237, 0.49311327],
-												 [	-6.27236063, -0.00075475, 0.00046258, 7.27160588, 0.99769376, 0.99878266, 0.49311333],
-												 [	-6.27236108, -0.00075457, 0.00046247, 7.27160651, 0.99769432, 0.99878296, 0.49311348],
-												 [	-6.27236153, -0.00075439, 0.00046236, 7.27160714, 0.99769488, 0.99878326, 0.49311361],
-												 [	-6.27236197, -0.00075420, 0.00046224, 7.27160777, 0.99769544, 0.99878355, 0.49311357],
-												 [	-6.27236242, -0.00075402, 0.00046213, 7.27160840, 0.99769601, 0.99878385, 0.49311362],
-												 [	-6.27236287, -0.00075384, 0.00046202, 7.27160903, 0.99769657, 0.99878415, 0.49311367],
-												 [	-6.27236331, -0.00075365, 0.00046191, 7.27160966, 0.99769713, 0.99878444, 0.49311366],
-												 [	-6.27236376, -0.00075347, 0.00046179, 7.27161029, 0.99769769, 0.99878474, 0.49311384],
-												 [	-6.27236420, -0.00075329, 0.00046168, 7.27161092, 0.99769825, 0.99878503, 0.49311393],
-												 [	-6.27236465, -0.00075310, 0.00046157, 7.27161155, 0.99769881, 0.99878533, 0.49311405],
-												 [	-6.27236509, -0.00075292, 0.00046146, 7.27161217, 0.99769937, 0.99878563, 0.49311410],
-												 [	-6.27236554, -0.00075274, 0.00046134, 7.27161280, 0.99769993, 0.99878592, 0.49311401],
-												 [	-6.27236598, -0.00075255, 0.00046123, 7.27161343, 0.99770049, 0.99878622, 0.49311424],
-												 [	-6.27236643, -0.00075237, 0.00046112, 7.27161406, 0.99770105, 0.99878651, 0.49311425],
-												 [	-6.27236687, -0.00075219, 0.00046101, 7.27161468, 0.99770161, 0.99878681, 0.49311423],
-												 [	-6.27236731, -0.00075200, 0.00046089, 7.27161531, 0.99770217, 0.99878710, 0.49311442],
-												 [	-6.27236776, -0.00075182, 0.00046078, 7.27161594, 0.99770272, 0.99878740, 0.49311431],
-												 [	-6.27236820, -0.00075164, 0.00046067, 7.27161656, 0.99770328, 0.99878769, 0.49311449],
-												 [	-6.27236864, -0.00075146, 0.00046056, 7.27161719, 0.99770384, 0.99878798, 0.49311451],
-												 [	-6.27236909, -0.00075127, 0.00046045, 7.27161781, 0.99770440, 0.99878828, 0.49311462],
-												 [	-6.27236953, -0.00075109, 0.00046034, 7.27161844, 0.99770496, 0.99878857, 0.49311465],
-												 [	-6.27236997, -0.00075091, 0.00046022, 7.27161906, 0.99770551, 0.99878887, 0.49311479],
-												 [	-6.27237041, -0.00075073, 0.00046011, 7.27161968, 0.99770607, 0.99878916, 0.49311488],
-												 [	-6.27237085, -0.00075055, 0.00046000, 7.27162031, 0.99770663, 0.99878945, 0.49311489],
-												 [	-6.27237130, -0.00075036, 0.00045989, 7.27162093, 0.99770718, 0.99878975, 0.49311496],
-												 [	-6.27237174, -0.00075018, 0.00045978, 7.27162155, 0.99770774, 0.99879004, 0.49311494],
-												 [	-6.27237218, -0.00075000, 0.00045967, 7.27162218, 0.99770829, 0.99879033, 0.49311510],
-												 [	-6.27237262, -0.00074982, 0.00045955, 7.27162280, 0.99770885, 0.99879063, 0.49311504],
-												 [	-6.27237306, -0.00074964, 0.00045944, 7.27162342, 0.99770941, 0.99879092, 0.49311523],
-												 [	-6.27237350, -0.00074946, 0.00045933, 7.27162404, 0.99770996, 0.99879121, 0.49311526],
-												 [	-6.27237394, -0.00074927, 0.00045922, 7.27162466, 0.99771051, 0.99879151, 0.49311531],
-												 [	-6.27237438, -0.00074909, 0.00045911, 7.27162529, 0.99771107, 0.99879180, 0.49311549],
-												 [	-6.27237482, -0.00074891, 0.00045900, 7.27162591, 0.99771162, 0.99879209, 0.49311546],
-												 [	-6.27237526, -0.00074873, 0.00045889, 7.27162653, 0.99771218, 0.99879238, 0.49311554],
-												 [	-6.27237570, -0.00074855, 0.00045878, 7.27162715, 0.99771273, 0.99879268, 0.49311557],
-												 [	-6.27237614, -0.00074837, 0.00045866, 7.27162777, 0.99771328, 0.99879297, 0.49311573],
-												 [	-6.27237657, -0.00074819, 0.00045855, 7.27162839, 0.99771384, 0.99879326, 0.49311571],
-												 [	-6.27237701, -0.00074801, 0.00045844, 7.27162901, 0.99771439, 0.99879355, 0.49311580],
-												 [	-6.27237745, -0.00074783, 0.00045833, 7.27162962, 0.99771494, 0.99879384, 0.49311585],
-												 [	-6.27237789, -0.00074765, 0.00045822, 7.27163024, 0.99771549, 0.99879413, 0.49311592],
-												 [	-6.27237833, -0.00074747, 0.00045811, 7.27163086, 0.99771605, 0.99879442, 0.49311607],
-												 [	-6.27237876, -0.00074728, 0.00045800, 7.27163148, 0.99771660, 0.99879472, 0.49311608],
-												 [	-6.27237920, -0.00074710, 0.00045789, 7.27163210, 0.99771715, 0.99879501, 0.49311612],
-												 [	-6.27237964, -0.00074692, 0.00045778, 7.27163271, 0.99771770, 0.99879530, 0.49311622],
-												 [	-6.27238007, -0.00074674, 0.00045767, 7.27163333, 0.99771825, 0.99879559, 0.49311623],
-												 [	-6.27238051, -0.00074656, 0.00045756, 7.27163395, 0.99771880, 0.99879588, 0.49311629],
-												 [	-6.27238095, -0.00074638, 0.00045745, 7.27163456, 0.99771935, 0.99879617, 0.49311629],
-												 [	-6.27238138, -0.00074620, 0.00045734, 7.27163518, 0.99771990, 0.99879646, 0.49311644],
-												 [	-6.27238182, -0.00074602, 0.00045723, 7.27163580, 0.99772045, 0.99879675, 0.49311641],
-												 [	-6.27238225, -0.00074584, 0.00045712, 7.27163641, 0.99772100, 0.99879704, 0.49311653],
-												 [	-6.27238269, -0.00074566, 0.00045701, 7.27163703, 0.99772155, 0.99879733, 0.49311671],
-												 [	-6.27238312, -0.00074548, 0.00045690, 7.27163764, 0.99772210, 0.99879762, 0.49311673],
-												 [	-6.27238356, -0.00074531, 0.00045679, 7.27163825, 0.99772265, 0.99879791, 0.49311683],
-												 [	-6.27238399, -0.00074513, 0.00045668, 7.27163887, 0.99772320, 0.99879820, 0.49311676],
-												 [	-6.27238443, -0.00074495, 0.00045657, 7.27163948, 0.99772375, 0.99879849, 0.49311684],
-												 [	-6.27238486, -0.00074477, 0.00045646, 7.27164010, 0.99772429, 0.99879878, 0.49311690],
-												 [	-6.27238530, -0.00074459, 0.00045635, 7.27164071, 0.99772484, 0.99879907, 0.49311703],
-												 [	-6.27238573, -0.00074441, 0.00045624, 7.27164132, 0.99772539, 0.99879936, 0.49311710],
-												 [	-6.27238616, -0.00074423, 0.00045613, 7.27164193, 0.99772594, 0.99879964, 0.49311708],
-												 [	-6.27238660, -0.00074405, 0.00045602, 7.27164255, 0.99772648, 0.99879993, 0.49311725],
-												 [	-6.27238703, -0.00074387, 0.00045591, 7.27164316, 0.99772703, 0.99880022, 0.49311732],
-												 [	-6.27238746, -0.00074369, 0.00045580, 7.27164377, 0.99772758, 0.99880051, 0.49311738],
-												 [	-6.27238790, -0.00074352, 0.00045569, 7.27164438, 0.99772812, 0.99880080, 0.49311739],
-												 [	-6.27238833, -0.00074334, 0.00045558, 7.27164499, 0.99772867, 0.99880109, 0.49311746],
-												 [	-6.27238876, -0.00074316, 0.00045547, 7.27164560, 0.99772921, 0.99880137, 0.49311752],
-												 [	-6.27238919, -0.00074298, 0.00045536, 7.27164621, 0.99772976, 0.99880166, 0.49311758],
-												 [	-6.27238962, -0.00074280, 0.00045525, 7.27164682, 0.99773030, 0.99880195, 0.49311766],
-												 [	-6.27239006, -0.00074262, 0.00045514, 7.27164743, 0.99773085, 0.99880224, 0.49311772],
-												 [	-6.27239049, -0.00074245, 0.00045503, 7.27164804, 0.99773139, 0.99880252, 0.49311777],
-												 [	-6.27239092, -0.00074227, 0.00045492, 7.27164865, 0.99773194, 0.99880281, 0.49311785],
-												 [	-6.27239135, -0.00074209, 0.00045481, 7.27164926, 0.99773248, 0.99880310, 0.49311791],
-												 [	-6.27239178, -0.00074191, 0.00045470, 7.27164987, 0.99773303, 0.99880339, 0.49311797],
-												 [	-6.27239221, -0.00074173, 0.00045459, 7.27165048, 0.99773357, 0.99880367, 0.49311806],
-												 [	-6.27239264, -0.00074156, 0.00045449, 7.27165108, 0.99773411, 0.99880396, 0.49311809],
-												 [	-6.27239307, -0.00074138, 0.00045438, 7.27165169, 0.99773466, 0.99880425, 0.49311816],
-												 [	-6.27239350, -0.00074120, 0.00045427, 7.27165230, 0.99773520, 0.99880453, 0.49311824],
-												 [	-6.27239393, -0.00074102, 0.00045416, 7.27165291, 0.99773574, 0.99880482, 0.49311829],
-												 [	-6.27239436, -0.00074085, 0.00045405, 7.27165351, 0.99773628, 0.99880510, 0.49311835],
-												 [	-6.27239479, -0.00074067, 0.00045394, 7.27165412, 0.99773683, 0.99880539, 0.49311839],
-												 [	-6.27239522, -0.00074049, 0.00045383, 7.27165472, 0.99773737, 0.99880568, 0.49311849],
-												 [	-6.27239564, -0.00074031, 0.00045372, 7.27165533, 0.99773791, 0.99880596, 0.49311853],
-												 [	-6.27239607, -0.00074014, 0.00045362, 7.27165593, 0.99773845, 0.99880625, 0.49311862],
-												 [	-6.27239650, -0.00073996, 0.00045351, 7.27165654, 0.99773899, 0.99880653, 0.49311867],
-												 [	-6.27239693, -0.00073978, 0.00045340, 7.27165714, 0.99773953, 0.99880682, 0.49311873],
-												 [	-6.27239736, -0.00073961, 0.00045329, 7.27165775, 0.99774007, 0.99880710, 0.49311878],
-												 [	-6.27239778, -0.00073943, 0.00045318, 7.27165835, 0.99774061, 0.99880739, 0.49311885],
-												 [	-6.27239821, -0.00073925, 0.00045307, 7.27165896, 0.99774115, 0.99880767, 0.49311891],
-												 [	-6.27239864, -0.00073908, 0.00045296, 7.27165956, 0.99774169, 0.99880796, 0.49311897],
-												 [	-6.27239906, -0.00073890, 0.00045286, 7.27166016, 0.99774223, 0.99880824, 0.49311905],
-												 [	-6.27239949, -0.00073872, 0.00045275, 7.27166077, 0.99774277, 0.99880853, 0.49311912],
-												 [	-6.27239992, -0.00073855, 0.00045264, 7.27166137, 0.99774331, 0.99880881, 0.49311918],
-												 [	-6.27240034, -0.00073837, 0.00045253, 7.27166197, 0.99774385, 0.99880910, 0.49311924],
-												 [	-6.27240077, -0.00073820, 0.00045242, 7.27166257, 0.99774439, 0.99880938, 0.49311929],
-												 [	-6.27240119, -0.00073802, 0.00045232, 7.27166317, 0.99774492, 0.99880966, 0.49311935],
-												 [	-6.27240162, -0.00073784, 0.00045221, 7.27166378, 0.99774546, 0.99880995, 0.49311941],
-												 [	-6.27240205, -0.00073767, 0.00045210, 7.27166438, 0.99774600, 0.99881023, 0.49311949],
-												 [	-6.27240247, -0.00073749, 0.00045199, 7.27166498, 0.99774654, 0.99881051, 0.49311956],
-												 [	-6.27240289, -0.00073732, 0.00045188, 7.27166558, 0.99774707, 0.99881080, 0.49311961],
-												 [	-6.27240332, -0.00073714, 0.00045178, 7.27166618, 0.99774761, 0.99881108, 0.49311968],
-												 [	-6.27240374, -0.00073697, 0.00045167, 7.27166678, 0.99774815, 0.99881136, 0.49311975],
-												 [	-6.27240417, -0.00073679, 0.00045156, 7.27166738, 0.99774868, 0.99881165, 0.49311980],
-												 [	-6.27240459, -0.00073662, 0.00045145, 7.27166798, 0.99774922, 0.99881193, 0.49311987],
-												 [	-6.27240502, -0.00073644, 0.00045135, 7.27166858, 0.99774976, 0.99881221, 0.49311992],
-												 [	-6.27240544, -0.00073626, 0.00045124, 7.27166917, 0.99775029, 0.99881250, 0.49312000],
-												 [	-6.27240586, -0.00073609, 0.00045113, 7.27166977, 0.99775083, 0.99881278, 0.49312006],
-												 [	-6.27240628, -0.00073591, 0.00045102, 7.27167037, 0.99775136, 0.99881306, 0.49312011],
-												 [	-6.27240671, -0.00073574, 0.00045092, 7.27167097, 0.99775190, 0.99881334, 0.49312017],
-												 [	-6.27240713, -0.00073556, 0.00045081, 7.27167157, 0.99775243, 0.99881362, 0.49312022],
-												 [	-6.27240755, -0.00073539, 0.00045070, 7.27167216, 0.99775297, 0.99881391, 0.49312031],
-												 [	-6.27240797, -0.00073522, 0.00045060, 7.27167276, 0.99775350, 0.99881419, 0.49312033],
-												 [	-6.27240840, -0.00073504, 0.00045049, 7.27167336, 0.99775403, 0.99881447, 0.49312043],
-												 [	-6.27240882, -0.00073487, 0.00045038, 7.27167395, 0.99775457, 0.99881475, 0.49312049],
-												 [	-6.27240924, -0.00073469, 0.00045027, 7.27167455, 0.99775510, 0.99881503, 0.49312054],
-												 [	-6.27240966, -0.00073452, 0.00045017, 7.27167514, 0.99775563, 0.99881531, 0.49312061],
-												 [	-6.27241008, -0.00073434, 0.00045006, 7.27167574, 0.99775617, 0.99881560, 0.49312068],
-												 [	-6.27241050, -0.00073417, 0.00044995, 7.27167633, 0.99775670, 0.99881588, 0.49312074],
-												 [	-6.27241092, -0.00073400, 0.00044985, 7.27167693, 0.99775723, 0.99881616, 0.49312080],
-												 [	-6.27241134, -0.00073382, 0.00044974, 7.27167752, 0.99775776, 0.99881644, 0.49312087],
-												 [	-6.27241176, -0.00073365, 0.00044963, 7.27167812, 0.99775829, 0.99881672, 0.49312093],
-												 [	-6.27241218, -0.00073347, 0.00044953, 7.27167871, 0.99775883, 0.99881700, 0.49312099],
-												 [	-6.27241260, -0.00073330, 0.00044942, 7.27167930, 0.99775936, 0.99881728, 0.49312106],
-												 [	-6.27241302, -0.00073313, 0.00044931, 7.27167990, 0.99775989, 0.99881756, 0.49312110],
-												 [	-6.27241344, -0.00073295, 0.00044921, 7.27168049, 0.99776042, 0.99881784, 0.49312117],
-												 [	-6.27241386, -0.00073278, 0.00044910, 7.27168108, 0.99776095, 0.99881812, 0.49312124],
-												 [	-6.27241428, -0.00073261, 0.00044899, 7.27168167, 0.99776148, 0.99881840, 0.49312129],
-												 [	-6.27241470, -0.00073243, 0.00044889, 7.27168227, 0.99776201, 0.99881868, 0.49312137],
-												 [	-6.27241512, -0.00073226, 0.00044878, 7.27168286, 0.99776254, 0.99881896, 0.49312141],
-												 [	-6.27241554, -0.00073209, 0.00044868, 7.27168345, 0.99776307, 0.99881924, 0.49312147],
-												 [	-6.27241595, -0.00073191, 0.00044857, 7.27168404, 0.99776360, 0.99881952, 0.49312156],
-												 [	-6.27241637, -0.00073174, 0.00044846, 7.27168463, 0.99776413, 0.99881980, 0.49312161],
-												 [	-6.27241679, -0.00073157, 0.00044836, 7.27168522, 0.99776466, 0.99882008, 0.49312166],
-												 [	-6.27241721, -0.00073139, 0.00044825, 7.27168581, 0.99776518, 0.99882035, 0.49312172],
-												 [	-6.27241762, -0.00073122, 0.00044815, 7.27168640, 0.99776571, 0.99882063, 0.49312178],
-												 [	-6.27241804, -0.00073105, 0.00044804, 7.27168699, 0.99776624, 0.99882091, 0.49312185],
-												 [	-6.27241846, -0.00073088, 0.00044793, 7.27168758, 0.99776677, 0.99882119, 0.49312193],
-												 [	-6.27241887, -0.00073070, 0.00044783, 7.27168817, 0.99776730, 0.99882147, 0.49312197],
-												 [	-6.27241929, -0.00073053, 0.00044772, 7.27168876, 0.99776782, 0.99882175, 0.49312203],
-												 [	-6.27241971, -0.00073036, 0.00044762, 7.27168935, 0.99776835, 0.99882202, 0.49312211],
-												 [	-6.27242012, -0.00073019, 0.00044751, 7.27168994, 0.99776888, 0.99882230, 0.49312215],
-												 [	-6.27242054, -0.00073001, 0.00044741, 7.27169052, 0.99776940, 0.99882258, 0.49312222],
-												 [	-6.27242095, -0.00072984, 0.00044730, 7.27169111, 0.99776993, 0.99882286, 0.49312230],
-												 [	-6.27242137, -0.00072967, 0.00044719, 7.27169170, 0.99777045, 0.99882314, 0.49312233],
-												 [	-6.27242178, -0.00072950, 0.00044709, 7.27169229, 0.99777098, 0.99882341, 0.49312241],
-												 [	-6.27242220, -0.00072933, 0.00044698, 7.27169287, 0.99777151, 0.99882369, 0.49312246],
-												 [	-6.27242261, -0.00072915, 0.00044688, 7.27169346, 0.99777203, 0.99882397, 0.49312253],
-												 [	-6.27242303, -0.00072898, 0.00044677, 7.27169405, 0.99777256, 0.99882424, 0.49312260],
-												 [	-6.27242344, -0.00072881, 0.00044667, 7.27169463, 0.99777308, 0.99882452, 0.49312265],
-												 [	-6.27242386, -0.00072864, 0.00044656, 7.27169522, 0.99777361, 0.99882480, 0.49312272],
-												 [	-6.27242427, -0.00072847, 0.00044646, 7.27169580, 0.99777413, 0.99882508, 0.49312276],
-												 [	-6.27242468, -0.00072830, 0.00044635, 7.27169639, 0.99777465, 0.99882535, 0.49312285],
-												 [	-6.27242510, -0.00072813, 0.00044625, 7.27169697, 0.99777518, 0.99882563, 0.49312291],
-												 [	-6.27242551, -0.00072795, 0.00044614, 7.27169756, 0.99777570, 0.99882590, 0.49312295],
-												 [	-6.27242592, -0.00072778, 0.00044604, 7.27169814, 0.99777622, 0.99882618, 0.49312303],
-												 [	-6.27242634, -0.00072761, 0.00044593, 7.27169872, 0.99777675, 0.99882646, 0.49312307],
-												 [	-6.27242675, -0.00072744, 0.00044583, 7.27169931, 0.99777727, 0.99882673, 0.49312312],
-												 [	-6.27242716, -0.00072727, 0.00044572, 7.27169989, 0.99777779, 0.99882701, 0.49312319],
-												 [	-6.27242757, -0.00072710, 0.00044562, 7.27170047, 0.99777831, 0.99882728, 0.49312326],
-												 [	-6.27242798, -0.00072693, 0.00044551, 7.27170106, 0.99777884, 0.99882756, 0.49312335],
-												 [	-6.27242840, -0.00072676, 0.00044541, 7.27170164, 0.99777936, 0.99882783, 0.49312338],
-												 [	-6.27242881, -0.00072659, 0.00044530, 7.27170222, 0.99777988, 0.99882811, 0.49312345],
-												 [	-6.27242922, -0.00072642, 0.00044520, 7.27170280, 0.99778040, 0.99882838, 0.49312349],
-												 [	-6.27242963, -0.00072625, 0.00044509, 7.27170338, 0.99778092, 0.99882866, 0.49312358],
-												 [	-6.27243004, -0.00072608, 0.00044499, 7.27170397, 0.99778144, 0.99882893, 0.49312364],
-												 [	-6.27243045, -0.00072591, 0.00044488, 7.27170455, 0.99778196, 0.99882921, 0.49312368],
-												 [	-6.27243086, -0.00072574, 0.00044478, 7.27170513, 0.99778248, 0.99882948, 0.49312376],
-												 [	-6.27243127, -0.00072557, 0.00044468, 7.27170571, 0.99778300, 0.99882976, 0.49312381],
-												 [	-6.27243168, -0.00072540, 0.00044457, 7.27170629, 0.99778352, 0.99883003, 0.49312388],
-												 [	-6.27243209, -0.00072523, 0.00044447, 7.27170687, 0.99778404, 0.99883031, 0.49312394],
-												 [	-6.27243250, -0.00072506, 0.00044436, 7.27170745, 0.99778456, 0.99883058, 0.49312397],
-												 [	-6.27243291, -0.00072489, 0.00044426, 7.27170803, 0.99778508, 0.99883086, 0.49312405],
-												 [	-6.27243332, -0.00072472, 0.00044416, 7.27170860, 0.99778560, 0.99883113, 0.49312410],
-												 [	-6.27243373, -0.00072455, 0.00044405, 7.27170918, 0.99778612, 0.99883140, 0.49312419],
-												 [	-6.27243414, -0.00072438, 0.00044395, 7.27170976, 0.99778664, 0.99883168, 0.49312424],
-												 [	-6.27243455, -0.00072421, 0.00044384, 7.27171034, 0.99778716, 0.99883195, 0.49312429],
-												 [	-6.27243496, -0.00072404, 0.00044374, 7.27171092, 0.99778767, 0.99883222, 0.49312436],
-												 [	-6.27243536, -0.00072387, 0.00044364, 7.27171150, 0.99778819, 0.99883250, 0.49312441],
-												 [	-6.27243577, -0.00072370, 0.00044353, 7.27171207, 0.99778871, 0.99883277, 0.49312447],
-												 [	-6.27243618, -0.00072353, 0.00044343, 7.27171265, 0.99778923, 0.99883304, 0.49312454],
-												 [	-6.27243659, -0.00072336, 0.00044332, 7.27171323, 0.99778974, 0.99883331, 0.49312460],
-												 [	-6.27243700, -0.00072319, 0.00044322, 7.27171380, 0.99779026, 0.99883359, 0.49312464],
-												 [	-6.27243740, -0.00072302, 0.00044312, 7.27171438, 0.99779078, 0.99883386, 0.49312471],
-												 [	-6.27243781, -0.00072285, 0.00044301, 7.27171495, 0.99779129, 0.99883413, 0.49312476],
-												 [	-6.27243822, -0.00072269, 0.00044291, 7.27171553, 0.99779181, 0.99883440, 0.49312483],
-												 [	-6.27243862, -0.00072252, 0.00044281, 7.27171611, 0.99779232, 0.99883468, 0.49312489],
-												 [	-6.27243903, -0.00072235, 0.00044270, 7.27171668, 0.99779284, 0.99883495, 0.49312495],
-												 [	-6.27243944, -0.00072218, 0.00044260, 7.27171726, 0.99779336, 0.99883522, 0.49312500],
-												 [	-6.27243984, -0.00072201, 0.00044250, 7.27171783, 0.99779387, 0.99883549, 0.49312508],
-												 [	-6.27244025, -0.00072184, 0.00044239, 7.27171840, 0.99779438, 0.99883576, 0.49312514],
-												 [	-6.27244065, -0.00072167, 0.00044229, 7.27171898, 0.99779490, 0.99883604, 0.49312518],
-												 [	-6.27244106, -0.00072151, 0.00044219, 7.27171955, 0.99779541, 0.99883631, 0.49312525],
-												 [	-6.27244146, -0.00072134, 0.00044208, 7.27172012, 0.99779593, 0.99883658, 0.49312531],
-												 [	-6.27244187, -0.00072117, 0.00044198, 7.27172070, 0.99779644, 0.99883685, 0.49312537],
-												 [	-6.27244227, -0.00072100, 0.00044188, 7.27172127, 0.99779696, 0.99883712, 0.49312544],
-												 [	-6.27244268, -0.00072083, 0.00044177, 7.27172184, 0.99779747, 0.99883739, 0.49312550],
-												 [	-6.27244308, -0.00072067, 0.00044167, 7.27172242, 0.99779798, 0.99883766, 0.49312555],
-												 [	-6.27244349, -0.00072050, 0.00044157, 7.27172299, 0.99779849, 0.99883793, 0.49312563],
-												 [	-6.27244389, -0.00072033, 0.00044147, 7.27172356, 0.99779901, 0.99883820, 0.49312567],
-												 [	-6.27244429, -0.00072016, 0.00044136, 7.27172413, 0.99779952, 0.99883847, 0.49312573],
-												 [	-6.27244470, -0.00072000, 0.00044126, 7.27172470, 0.99780003, 0.99883874, 0.49312578],
-												 [	-6.27244510, -0.00071983, 0.00044116, 7.27172527, 0.99780054, 0.99883901, 0.49312585],
-												 [	-6.27244550, -0.00071966, 0.00044105, 7.27172584, 0.99780105, 0.99883928, 0.49312592],
-												 [	-6.27244591, -0.00071949, 0.00044095, 7.27172641, 0.99780157, 0.99883955, 0.49312598],
-												 [	-6.27244631, -0.00071933, 0.00044085, 7.27172698, 0.99780208, 0.99883982, 0.49312604],
-												 [	-6.27244671, -0.00071916, 0.00044075, 7.27172755, 0.99780259, 0.99884009, 0.49312608],
-												 [	-6.27244712, -0.00071899, 0.00044064, 7.27172812, 0.99780310, 0.99884036, 0.49312614],
-												 [	-6.27244752, -0.00071883, 0.00044054, 7.27172869, 0.99780361, 0.99884063, 0.49312622],
-												 [	-6.27244792, -0.00071866, 0.00044044, 7.27172926, 0.99780412, 0.99884090, 0.49312626],
-												 [	-6.27244832, -0.00071849, 0.00044034, 7.27172983, 0.99780463, 0.99884117, 0.49312632],
-												 [	-6.27244872, -0.00071833, 0.00044024, 7.27173040, 0.99780514, 0.99884144, 0.49312638],
-												 [	-6.27244912, -0.00071816, 0.00044013, 7.27173097, 0.99780565, 0.99884171, 0.49312645],
-												 [	-6.27244953, -0.00071799, 0.00044003, 7.27173153, 0.99780616, 0.99884198, 0.49312649],
-												 [	-6.27244993, -0.00071783, 0.00043993, 7.27173210, 0.99780667, 0.99884225, 0.49312657],
-												 [	-6.27245033, -0.00071766, 0.00043983, 7.27173267, 0.99780718, 0.99884251, 0.49312664],
-												 [	-6.27245073, -0.00071749, 0.00043972, 7.27173323, 0.99780768, 0.99884278, 0.49312669],
-												 [	-6.27245113, -0.00071733, 0.00043962, 7.27173380, 0.99780819, 0.99884305, 0.49312674],
-												 [	-6.27245153, -0.00071716, 0.00043952, 7.27173437, 0.99780870, 0.99884332, 0.49312680],
-												 [	-6.27245193, -0.00071699, 0.00043942, 7.27173493, 0.99780921, 0.99884359, 0.49312685],
-												 [	-6.27245233, -0.00071683, 0.00043932, 7.27173550, 0.99780972, 0.99884385, 0.49312691],
-												 [	-6.27245273, -0.00071666, 0.00043922, 7.27173607, 0.99781022, 0.99884412, 0.49312701],
-												 [	-6.27245313, -0.00071650, 0.00043911, 7.27173663, 0.99781073, 0.99884439, 0.49312703],
-												 [	-6.27245353, -0.00071633, 0.00043901, 7.27173720, 0.99781124, 0.99884466, 0.49312710],
-												 [	-6.27245393, -0.00071617, 0.00043891, 7.27173776, 0.99781174, 0.99884492, 0.49312716],
-												 [	-6.27245432, -0.00071600, 0.00043881, 7.27173833, 0.99781225, 0.99884519, 0.49312722],
-												 [	-6.27245472, -0.00071583, 0.00043871, 7.27173889, 0.99781276, 0.99884546, 0.49312728],
-												 [	-6.27245512, -0.00071567, 0.00043861, 7.27173945, 0.99781326, 0.99884573, 0.49312736],
-												 [	-6.27245552, -0.00071550, 0.00043850, 7.27174002, 0.99781377, 0.99884599, 0.49312741],
-												 [	-6.27245592, -0.00071534, 0.00043840, 7.27174058, 0.99781427, 0.99884626, 0.49312745],
-												 [	-6.27245632, -0.00071517, 0.00043830, 7.27174114, 0.99781478, 0.99884653, 0.49312752],
-												 [	-6.27245671, -0.00071501, 0.00043820, 7.27174171, 0.99781528, 0.99884679, 0.49312756],
-												 [	-6.27245711, -0.00071484, 0.00043810, 7.27174227, 0.99781579, 0.99884706, 0.49312763],
-												 [	-6.27245751, -0.00071468, 0.00043800, 7.27174283, 0.99781629, 0.99884733, 0.49312770],
-												 [	-6.27245791, -0.00071451, 0.00043790, 7.27174339, 0.99781680, 0.99884759, 0.49312773],
-												 [	-6.27245830, -0.00071435, 0.00043779, 7.27174396, 0.99781730, 0.99884786, 0.49312781],
-												 [	-6.27245870, -0.00071418, 0.00043769, 7.27174452, 0.99781781, 0.99884812, 0.49312788],
-												 [	-6.27245910, -0.00071402, 0.00043759, 7.27174508, 0.99781831, 0.99884839, 0.49312794],
-												 [	-6.27245949, -0.00071385, 0.00043749, 7.27174564, 0.99781881, 0.99884866, 0.49312798],
-												 [	-6.27245989, -0.00071369, 0.00043739, 7.27174620, 0.99781932, 0.99884892, 0.49312802],
-												 [	-6.27246028, -0.00071352, 0.00043729, 7.27174676, 0.99781982, 0.99884919, 0.49312810],
-												 [	-6.27246068, -0.00071336, 0.00043719, 7.27174732, 0.99782032, 0.99884945, 0.49312816],
-												 [	-6.27246108, -0.00071320, 0.00043709, 7.27174788, 0.99782083, 0.99884972, 0.49312820],
-												 [	-6.27246147, -0.00071303, 0.00043699, 7.27174844, 0.99782133, 0.99884998, 0.49312828],
-												 [	-6.27246187, -0.00071287, 0.00043689, 7.27174900, 0.99782183, 0.99885025, 0.49312834],
-												 [	-6.27246226, -0.00071270, 0.00043679, 7.27174956, 0.99782233, 0.99885051, 0.49312839],
-												 [	-6.27246266, -0.00071254, 0.00043669, 7.27175012, 0.99782283, 0.99885078, 0.49312847],
-												 [	-6.27246305, -0.00071237, 0.00043658, 7.27175068, 0.99782333, 0.99885104, 0.49312849],
-												 [	-6.27246345, -0.00071221, 0.00043648, 7.27175123, 0.99782384, 0.99885131, 0.49312857],
-												 [	-6.27246384, -0.00071205, 0.00043638, 7.27175179, 0.99782434, 0.99885157, 0.49312862],
-												 [	-6.27246423, -0.00071188, 0.00043628, 7.27175235, 0.99782484, 0.99885183, 0.49312870],
-												 [	-6.27246463, -0.00071172, 0.00043618, 7.27175291, 0.99782534, 0.99885210, 0.49312875],
-												 [	-6.27246502, -0.00071156, 0.00043608, 7.27175347, 0.99782584, 0.99885236, 0.49312878],
-												 [	-6.27246541, -0.00071139, 0.00043598, 7.27175402, 0.99782634, 0.99885263, 0.49312886],
-												 [	-6.27246581, -0.00071123, 0.00043588, 7.27175458, 0.99782684, 0.99885289, 0.49312892],
-												 [	-6.27246620, -0.00071107, 0.00043578, 7.27175514, 0.99782734, 0.99885315, 0.49312899],
-												 [	-6.27246659, -0.00071090, 0.00043568, 7.27175569, 0.99782784, 0.99885342, 0.49312906],
-												 [	-6.27246699, -0.00071074, 0.00043558, 7.27175625, 0.99782833, 0.99885368, 0.49312908],
-												 [	-6.27246738, -0.00071058, 0.00043548, 7.27175680, 0.99782883, 0.99885394, 0.49312914],
-												 [	-6.27246777, -0.00071041, 0.00043538, 7.27175736, 0.99782933, 0.99885421, 0.49312922],
-												 [	-6.27246816, -0.00071025, 0.00043528, 7.27175791, 0.99782983, 0.99885447, 0.49312926],
-												 [	-6.27246856, -0.00071009, 0.00043518, 7.27175847, 0.99783033, 0.99885473, 0.49312934],
-												 [	-6.27246895, -0.00070992, 0.00043508, 7.27175902, 0.99783083, 0.99885499, 0.49312938],
-												 [	-6.27246934, -0.00070976, 0.00043498, 7.27175958, 0.99783132, 0.99885526, 0.49312944],
-												 [	-6.27246973, -0.00070960, 0.00043488, 7.27176013, 0.99783182, 0.99885552, 0.49312948],
-												 [	-6.27247012, -0.00070944, 0.00043478, 7.27176069, 0.99783232, 0.99885578, 0.49312957],
-												 [	-6.27247051, -0.00070927, 0.00043468, 7.27176124, 0.99783282, 0.99885604, 0.49312962],
-												 [	-6.27247090, -0.00070911, 0.00043458, 7.27176179, 0.99783331, 0.99885631, 0.49312968],
-												 [	-6.27247129, -0.00070895, 0.00043448, 7.27176235, 0.99783381, 0.99885657, 0.49312972],
-												 [	-6.27247168, -0.00070879, 0.00043438, 7.27176290, 0.99783431, 0.99885683, 0.49312980],
-												 [	-6.27247207, -0.00070862, 0.00043428, 7.27176345, 0.99783480, 0.99885709, 0.49312985],
-												 [	-6.27247246, -0.00070846, 0.00043418, 7.27176400, 0.99783530, 0.99885735, 0.49312992],
-												 [	-6.27247285, -0.00070830, 0.00043409, 7.27176456, 0.99783579, 0.99885762, 0.49312999],
-												 [	-6.27247324, -0.00070814, 0.00043399, 7.27176511, 0.99783629, 0.99885788, 0.49313003],
-												 [	-6.27247363, -0.00070798, 0.00043389, 7.27176566, 0.99783678, 0.99885814, 0.49313009],
-												 [	-6.27247402, -0.00070781, 0.00043379, 7.27176621, 0.99783728, 0.99885840, 0.49313014],
-												 [	-6.27247441, -0.00070765, 0.00043369, 7.27176676, 0.99783777, 0.99885866, 0.49313021],
-												 [	-6.27247480, -0.00070749, 0.00043359, 7.27176731, 0.99783827, 0.99885892, 0.49313025],
-												 [	-6.27247519, -0.00070733, 0.00043349, 7.27176786, 0.99783876, 0.99885918, 0.49313031],
-												 [	-6.27247558, -0.00070717, 0.00043339, 7.27176841, 0.99783926, 0.99885944, 0.49313036],
-												 [	-6.27247597, -0.00070701, 0.00043329, 7.27176896, 0.99783975, 0.99885970, 0.49313043],
-												 [	-6.27247636, -0.00070684, 0.00043319, 7.27176951, 0.99784024, 0.99885996, 0.49313047],
-												 [	-6.27247674, -0.00070668, 0.00043309, 7.27177006, 0.99784074, 0.99886022, 0.49313056],
-												 [	-6.27247713, -0.00070652, 0.00043299, 7.27177061, 0.99784123, 0.99886048, 0.49313062],
-												 [	-6.27247752, -0.00070636, 0.00043290, 7.27177116, 0.99784172, 0.99886074, 0.49313067],
-												 [	-6.27247791, -0.00070620, 0.00043280, 7.27177171, 0.99784222, 0.99886100, 0.49313072],
-												 [	-6.27247829, -0.00070604, 0.00043270, 7.27177226, 0.99784271, 0.99886126, 0.49313077],
-												 [	-6.27247868, -0.00070588, 0.00043260, 7.27177280, 0.99784320, 0.99886152, 0.49313084],
-												 [	-6.27247907, -0.00070572, 0.00043250, 7.27177335, 0.99784369, 0.99886178, 0.49313089],
-												 [	-6.27247945, -0.00070556, 0.00043240, 7.27177390, 0.99784418, 0.99886204, 0.49313094],
-												 [	-6.27247984, -0.00070539, 0.00043230, 7.27177445, 0.99784468, 0.99886230, 0.49313101],
-												 [	-6.27248023, -0.00070523, 0.00043220, 7.27177499, 0.99784517, 0.99886256, 0.49313105],
-												 [	-6.27248061, -0.00070507, 0.00043211, 7.27177554, 0.99784566, 0.99886282, 0.49313111],
-												 [	-6.27248100, -0.00070491, 0.00043201, 7.27177609, 0.99784615, 0.99886308, 0.49313117],
-												 [	-6.27248139, -0.00070475, 0.00043191, 7.27177663, 0.99784664, 0.99886334, 0.49313123],
-												 [	-6.27248177, -0.00070459, 0.00043181, 7.27177718, 0.99784713, 0.99886360, 0.49313129],
-												 [	-6.27248216, -0.00070443, 0.00043171, 7.27177773, 0.99784762, 0.99886386, 0.49313133],
-												 [	-6.27248254, -0.00070427, 0.00043161, 7.27177827, 0.99784811, 0.99886411, 0.49313142],
-												 [	-6.27248293, -0.00070411, 0.00043152, 7.27177882, 0.99784860, 0.99886437, 0.49313147],
-												 [	-6.27248331, -0.00070395, 0.00043142, 7.27177936, 0.99784909, 0.99886463, 0.49313152],
-												 [	-6.27248370, -0.00070379, 0.00043132, 7.27177991, 0.99784958, 0.99886489, 0.49313157],
-												 [	-6.27248408, -0.00070363, 0.00043122, 7.27178045, 0.99785007, 0.99886515, 0.49313161],
-												 [	-6.27248447, -0.00070347, 0.00043112, 7.27178099, 0.99785056, 0.99886541, 0.49313168],
-												 [	-6.27248485, -0.00070331, 0.00043103, 7.27178154, 0.99785104, 0.99886566, 0.49313174],
-												 [	-6.27248523, -0.00070315, 0.00043093, 7.27178208, 0.99785153, 0.99886592, 0.49313183],
-												 [	-6.27248562, -0.00070299, 0.00043083, 7.27178263, 0.99785202, 0.99886618, 0.49313186],
-												 [	-6.27248600, -0.00070283, 0.00043073, 7.27178317, 0.99785251, 0.99886644, 0.49313191],
-												 [	-6.27248638, -0.00070267, 0.00043063, 7.27178371, 0.99785300, 0.99886669, 0.49313198],
-												 [	-6.27248677, -0.00070251, 0.00043054, 7.27178425, 0.99785348, 0.99886695, 0.49313204],
-												 [	-6.27248715, -0.00070235, 0.00043044, 7.27178480, 0.99785397, 0.99886721, 0.49313208],
-												 [	-6.27248753, -0.00070219, 0.00043034, 7.27178534, 0.99785446, 0.99886747, 0.49313214],
-												 [	-6.27248792, -0.00070203, 0.00043024, 7.27178588, 0.99785495, 0.99886772, 0.49313220],
-												 [	-6.27248830, -0.00070188, 0.00043014, 7.27178642, 0.99785543, 0.99886798, 0.49313224],
-												 [	-6.27248868, -0.00070172, 0.00043005, 7.27178696, 0.99785592, 0.99886824, 0.49313233],
-												 [	-6.27248906, -0.00070156, 0.00042995, 7.27178751, 0.99785641, 0.99886849, 0.49313235],
-												 [	-6.27248945, -0.00070140, 0.00042985, 7.27178805, 0.99785689, 0.99886875, 0.49313243],
-												 [	-6.27248983, -0.00070124, 0.00042975, 7.27178859, 0.99785738, 0.99886901, 0.49313250],
-												 [	-6.27249021, -0.00070108, 0.00042966, 7.27178913, 0.99785786, 0.99886926, 0.49313254],
-												 [	-6.27249059, -0.00070092, 0.00042956, 7.27178967, 0.99785835, 0.99886952, 0.49313259],
-												 [	-6.27249097, -0.00070076, 0.00042946, 7.27179021, 0.99785883, 0.99886977, 0.49313265],
-												 [	-6.27249135, -0.00070060, 0.00042937, 7.27179075, 0.99785932, 0.99887003, 0.49313270],
-												 [	-6.27249173, -0.00070045, 0.00042927, 7.27179129, 0.99785980, 0.99887029, 0.49313277],
-												 [	-6.27249211, -0.00070029, 0.00042917, 7.27179183, 0.99786029, 0.99887054, 0.49313282],
-												 [	-6.27249250, -0.00070013, 0.00042907, 7.27179237, 0.99786077, 0.99887080, 0.49313289],
-												 [	-6.27249288, -0.00069997, 0.00042898, 7.27179290, 0.99786126, 0.99887105, 0.49313291],
-												 [	-6.27249326, -0.00069981, 0.00042888, 7.27179344, 0.99786174, 0.99887131, 0.49313301],
-												 [	-6.27249364, -0.00069965, 0.00042878, 7.27179398, 0.99786222, 0.99887156, 0.49313305],
-												 [	-6.27249402, -0.00069950, 0.00042869, 7.27179452, 0.99786271, 0.99887182, 0.49313311],
-												 [	-6.27249440, -0.00069934, 0.00042859, 7.27179506, 0.99786319, 0.99887207, 0.49313316],
-												 [	-6.27249477, -0.00069918, 0.00042849, 7.27179559, 0.99786367, 0.99887233, 0.49313322],
-												 [	-6.27249515, -0.00069902, 0.00042840, 7.27179613, 0.99786415, 0.99887258, 0.49313329],
-												 [	-6.27249553, -0.00069887, 0.00042830, 7.27179667, 0.99786464, 0.99887284, 0.49313333],
-												 [	-6.27249591, -0.00069871, 0.00042820, 7.27179720, 0.99786512, 0.99887309, 0.49313340],
-												 [	-6.27249629, -0.00069855, 0.00042810, 7.27179774, 0.99786560, 0.99887335, 0.49313343],
-												 [	-6.27249667, -0.00069839, 0.00042801, 7.27179828, 0.99786608, 0.99887360, 0.49313349],
-												 [	-6.27249705, -0.00069823, 0.00042791, 7.27179881, 0.99786656, 0.99887385, 0.49313355],
-												 [	-6.27249743, -0.00069808, 0.00042781, 7.27179935, 0.99786705, 0.99887411, 0.49313361],
-												 [	-6.27249780, -0.00069792, 0.00042772, 7.27179988, 0.99786753, 0.99887436, 0.49313365],
-												 [	-6.27249818, -0.00069776, 0.00042762, 7.27180042, 0.99786801, 0.99887462, 0.49313373],
-												 [	-6.27249856, -0.00069761, 0.00042753, 7.27180095, 0.99786849, 0.99887487, 0.49313378],
-												 [	-6.27249894, -0.00069745, 0.00042743, 7.27180149, 0.99786897, 0.99887512, 0.49313382],
-												 [	-6.27249931, -0.00069729, 0.00042733, 7.27180202, 0.99786945, 0.99887538, 0.49313387],
-												 [	-6.27249969, -0.00069713, 0.00042724, 7.27180256, 0.99786993, 0.99887563, 0.49313395],
-												 [	-6.27250007, -0.00069698, 0.00042714, 7.27180309, 0.99787041, 0.99887588, 0.49313401],
-												 [	-6.27250045, -0.00069682, 0.00042704, 7.27180363, 0.99787089, 0.99887614, 0.49313405],
-												 [	-6.27250082, -0.00069666, 0.00042695, 7.27180416, 0.99787137, 0.99887639, 0.49313411],
-												 [	-6.27250120, -0.00069651, 0.00042685, 7.27180469, 0.99787185, 0.99887664, 0.49313417],
-												 [	-6.27250158, -0.00069635, 0.00042676, 7.27180523, 0.99787233, 0.99887689, 0.49313425],
-												 [	-6.27250195, -0.00069619, 0.00042666, 7.27180576, 0.99787281, 0.99887715, 0.49313428],
-												 [	-6.27250233, -0.00069604, 0.00042656, 7.27180629, 0.99787328, 0.99887740, 0.49313433],
-												 [	-6.27250270, -0.00069588, 0.00042647, 7.27180682, 0.99787376, 0.99887765, 0.49313436],
-												 [	-6.27250308, -0.00069572, 0.00042637, 7.27180736, 0.99787424, 0.99887790, 0.49313447],
-												 [	-6.27250345, -0.00069557, 0.00042628, 7.27180789, 0.99787472, 0.99887816, 0.49313453],
-												 [	-6.27250383, -0.00069541, 0.00042618, 7.27180842, 0.99787520, 0.99887841, 0.49313456],
-												 [	-6.27250420, -0.00069525, 0.00042608, 7.27180895, 0.99787567, 0.99887866, 0.49313463],
-												 [	-6.27250458, -0.00069510, 0.00042599, 7.27180948, 0.99787615, 0.99887891, 0.49313466],
-												 [	-6.27250495, -0.00069494, 0.00042589, 7.27181001, 0.99787663, 0.99887916, 0.49313471],
-												 [	-6.27250533, -0.00069479, 0.00042580, 7.27181054, 0.99787711, 0.99887942, 0.49313478],
-												 [	-6.27250570, -0.00069463, 0.00042570, 7.27181107, 0.99787758, 0.99887967, 0.49313484],
-												 [	-6.27250608, -0.00069447, 0.00042561, 7.27181160, 0.99787806, 0.99887992, 0.49313489],
-												 [	-6.27250645, -0.00069432, 0.00042551, 7.27181213, 0.99787854, 0.99888017, 0.49313499],
-												 [	-6.27250683, -0.00069416, 0.00042541, 7.27181266, 0.99787901, 0.99888042, 0.49313500],
-												 [	-6.27250720, -0.00069401, 0.00042532, 7.27181319, 0.99787949, 0.99888067, 0.49313506],
-												 [	-6.27250757, -0.00069385, 0.00042522, 7.27181372, 0.99787996, 0.99888092, 0.49313510],
-												 [	-6.27250795, -0.00069370, 0.00042513, 7.27181425, 0.99788044, 0.99888117, 0.49313518],
-												 [	-6.27250832, -0.00069354, 0.00042503, 7.27181478, 0.99788091, 0.99888143, 0.49313523],
-												 [	-6.27250869, -0.00069339, 0.00042494, 7.27181531, 0.99788139, 0.99888168, 0.49313528],
-												 [	-6.27250906, -0.00069323, 0.00042484, 7.27181583, 0.99788186, 0.99888193, 0.49313532],
-												 [	-6.27250944, -0.00069308, 0.00042475, 7.27181636, 0.99788234, 0.99888218, 0.49313537],
-												 [	-6.27250981, -0.00069292, 0.00042465, 7.27181689, 0.99788281, 0.99888243, 0.49313545],
-												 [	-6.27251018, -0.00069277, 0.00042456, 7.27181742, 0.99788329, 0.99888268, 0.49313551],
-												 [	-6.27251055, -0.00069261, 0.00042446, 7.27181794, 0.99788376, 0.99888293, 0.49313557],
-												 [	-6.27251093, -0.00069246, 0.00042437, 7.27181847, 0.99788423, 0.99888318, 0.49313560],
-												 [	-6.27251130, -0.00069230, 0.00042427, 7.27181900, 0.99788471, 0.99888343, 0.49313566],
-												 [	-6.27251167, -0.00069215, 0.00042418, 7.27181952, 0.99788518, 0.99888368, 0.49313574],
-												 [	-6.27251204, -0.00069199, 0.00042408, 7.27182005, 0.99788565, 0.99888393, 0.49313579],
-												 [	-6.27251241, -0.00069184, 0.00042399, 7.27182058, 0.99788613, 0.99888418, 0.49313583],
-												 [	-6.27251278, -0.00069168, 0.00042389, 7.27182110, 0.99788660, 0.99888443, 0.49313587],
-												 [	-6.27251315, -0.00069153, 0.00042380, 7.27182163, 0.99788707, 0.99888468, 0.49313593],
-												 [	-6.27251353, -0.00069137, 0.00042370, 7.27182215, 0.99788754, 0.99888492, 0.49313600],
-												 [	-6.27251390, -0.00069122, 0.00042361, 7.27182268, 0.99788801, 0.99888517, 0.49313604],
-												 [	-6.27251427, -0.00069106, 0.00042351, 7.27182320, 0.99788849, 0.99888542, 0.49313613],
-												 [	-6.27251464, -0.00069091, 0.00042342, 7.27182373, 0.99788896, 0.99888567, 0.49313616],
-												 [	-6.27251501, -0.00069076, 0.00042332, 7.27182425, 0.99788943, 0.99888592, 0.49313621],
-												 [	-6.27251538, -0.00069060, 0.00042323, 7.27182478, 0.99788990, 0.99888617, 0.49313628],
-												 [	-6.27251575, -0.00069045, 0.00042314, 7.27182530, 0.99789037, 0.99888642, 0.49313634],
-												 [	-6.27251612, -0.00069029, 0.00042304, 7.27182582, 0.99789084, 0.99888667, 0.49313637],
-												 [	-6.27251649, -0.00069014, 0.00042295, 7.27182635, 0.99789131, 0.99888691, 0.49313644],
-												 [	-6.27251685, -0.00068999, 0.00042285, 7.27182687, 0.99789178, 0.99888716, 0.49313651],
-												 [	-6.27251722, -0.00068983, 0.00042276, 7.27182739, 0.99789225, 0.99888741, 0.49313656],
-												 [	-6.27251759, -0.00068968, 0.00042266, 7.27182791, 0.99789272, 0.99888766, 0.49313664],
-												 [	-6.27251796, -0.00068952, 0.00042257, 7.27182844, 0.99789319, 0.99888791, 0.49313666],
-												 [	-6.27251833, -0.00068937, 0.00042248, 7.27182896, 0.99789366, 0.99888815, 0.49313670],
-												 [	-6.27251870, -0.00068922, 0.00042238, 7.27182948, 0.99789413, 0.99888840, 0.49313677],
-												 [	-6.27251907, -0.00068906, 0.00042229, 7.27183000, 0.99789460, 0.99888865, 0.49313683],
-												 [	-6.27251943, -0.00068891, 0.00042219, 7.27183052, 0.99789507, 0.99888890, 0.49313687],
-												 [	-6.27251980, -0.00068876, 0.00042210, 7.27183104, 0.99789554, 0.99888914, 0.49313691],
-												 [	-6.27252017, -0.00068860, 0.00042200, 7.27183157, 0.99789601, 0.99888939, 0.49313700],
-												 [	-6.27252054, -0.00068845, 0.00042191, 7.27183209, 0.99789647, 0.99888964, 0.49313706],
-												 [	-6.27252091, -0.00068830, 0.00042182, 7.27183261, 0.99789694, 0.99888988, 0.49313707],
-												 [	-6.27252127, -0.00068815, 0.00042172, 7.27183313, 0.99789741, 0.99889013, 0.49313711],
-												 [	-6.27252164, -0.00068799, 0.00042163, 7.27183365, 0.99789788, 0.99889038, 0.49313720],
-												 [	-6.27252201, -0.00068784, 0.00042154, 7.27183417, 0.99789835, 0.99889062, 0.49313727],
-												 [	-6.27252237, -0.00068769, 0.00042144, 7.27183469, 0.99789881, 0.99889087, 0.49313733],
-												 [	-6.27252274, -0.00068753, 0.00042135, 7.27183521, 0.99789928, 0.99889112, 0.49313737],
-												 [	-6.27252311, -0.00068738, 0.00042125, 7.27183572, 0.99789975, 0.99889136, 0.49313744],
-												 [	-6.27252347, -0.00068723, 0.00042116, 7.27183624, 0.99790021, 0.99889161, 0.49313749],
-												 [	-6.27252384, -0.00068708, 0.00042107, 7.27183676, 0.99790068, 0.99889186, 0.49313754],
-												 [	-6.27252420, -0.00068692, 0.00042097, 7.27183728, 0.99790115, 0.99889210, 0.49313760],
-												 [	-6.27252457, -0.00068677, 0.00042088, 7.27183780, 0.99790161, 0.99889235, 0.49313767],
-												 [	-6.27252494, -0.00068662, 0.00042079, 7.27183832, 0.99790208, 0.99889259, 0.49313771],
-												 [	-6.27252530, -0.00068647, 0.00042069, 7.27183883, 0.99790254, 0.99889284, 0.49313775],
-												 [	-6.27252567, -0.00068631, 0.00042060, 7.27183935, 0.99790301, 0.99889309, 0.49313782],
-												 [	-6.27252603, -0.00068616, 0.00042051, 7.27183987, 0.99790347, 0.99889333, 0.49313786],
-												 [	-6.27252640, -0.00068601, 0.00042041, 7.27184039, 0.99790394, 0.99889358, 0.49313791],
-												 [	-6.27252676, -0.00068586, 0.00042032, 7.27184090, 0.99790440, 0.99889382, 0.49313797],
-												 [	-6.27252712, -0.00068571, 0.00042023, 7.27184142, 0.99790487, 0.99889407, 0.49313801],
-												 [	-6.27252749, -0.00068555, 0.00042013, 7.27184193, 0.99790533, 0.99889431, 0.49313810],
-												 [	-6.27252785, -0.00068540, 0.00042004, 7.27184245, 0.99790579, 0.99889456, 0.49313815],
-												 [	-6.27252822, -0.00068525, 0.00041995, 7.27184297, 0.99790626, 0.99889480, 0.49313818],
-												 [	-6.27252858, -0.00068510, 0.00041985, 7.27184348, 0.99790672, 0.99889505, 0.49313824],
-												 [	-6.27252895, -0.00068495, 0.00041976, 7.27184400, 0.99790719, 0.99889529, 0.49313828],
-												 [	-6.27252931, -0.00068480, 0.00041967, 7.27184451, 0.99790765, 0.99889553, 0.49313835],
-												 [	-6.27252967, -0.00068464, 0.00041958, 7.27184503, 0.99790811, 0.99889578, 0.49313842],
-												 [	-6.27253004, -0.00068449, 0.00041948, 7.27184554, 0.99790857, 0.99889602, 0.49313845],
-												 [	-6.27253040, -0.00068434, 0.00041939, 7.27184606, 0.99790904, 0.99889627, 0.49313853],
-												 [	-6.27253076, -0.00068419, 0.00041930, 7.27184657, 0.99790950, 0.99889651, 0.49313854],
-												 [	-6.27253112, -0.00068404, 0.00041920, 7.27184708, 0.99790996, 0.99889676, 0.49313861],
-												 [	-6.27253149, -0.00068389, 0.00041911, 7.27184760, 0.99791042, 0.99889700, 0.49313867],
-												 [	-6.27253185, -0.00068374, 0.00041902, 7.27184811, 0.99791089, 0.99889724, 0.49313874],
-												 [	-6.27253221, -0.00068359, 0.00041893, 7.27184862, 0.99791135, 0.99889749, 0.49313876],
-												 [	-6.27253257, -0.00068344, 0.00041883, 7.27184914, 0.99791181, 0.99889773, 0.49313881],
-												 [	-6.27253293, -0.00068328, 0.00041874, 7.27184965, 0.99791227, 0.99889797, 0.49313886],
-												 [	-6.27253330, -0.00068313, 0.00041865, 7.27185016, 0.99791273, 0.99889822, 0.49313893],
-												 [	-6.27253366, -0.00068298, 0.00041856, 7.27185068, 0.99791319, 0.99889846, 0.49313897],
-												 [	-6.27253402, -0.00068283, 0.00041846, 7.27185119, 0.99791365, 0.99889870, 0.49313904],
-												 [	-6.27253438, -0.00068268, 0.00041837, 7.27185170, 0.99791411, 0.99889895, 0.49313909],
-												 [	-6.27253474, -0.00068253, 0.00041828, 7.27185221, 0.99791457, 0.99889919, 0.49313915],
-												 [	-6.27253510, -0.00068238, 0.00041819, 7.27185272, 0.99791503, 0.99889943, 0.49313920],
-												 [	-6.27253546, -0.00068223, 0.00041810, 7.27185323, 0.99791549, 0.99889967, 0.49313924],
-												 [	-6.27253582, -0.00068208, 0.00041800, 7.27185374, 0.99791595, 0.99889992, 0.49313932],
-												 [	-6.27253618, -0.00068193, 0.00041791, 7.27185425, 0.99791641, 0.99890016, 0.49313937],
-												 [	-6.27253654, -0.00068178, 0.00041782, 7.27185477, 0.99791687, 0.99890040, 0.49313944],
-												 [	-6.27253690, -0.00068163, 0.00041773, 7.27185528, 0.99791733, 0.99890064, 0.49313947],
-												 [	-6.27253726, -0.00068148, 0.00041763, 7.27185579, 0.99791779, 0.99890089, 0.49313953],
-												 [	-6.27253762, -0.00068133, 0.00041754, 7.27185630, 0.99791825, 0.99890113, 0.49313960],
-												 [	-6.27253798, -0.00068118, 0.00041745, 7.27185680, 0.99791871, 0.99890137, 0.49313964],
-												 [	-6.27253834, -0.00068103, 0.00041736, 7.27185731, 0.99791916, 0.99890161, 0.49313969],
-												 [	-6.27253870, -0.00068088, 0.00041727, 7.27185782, 0.99791962, 0.99890185, 0.49313973],
-												 [	-6.27253906, -0.00068073, 0.00041718, 7.27185833, 0.99792008, 0.99890209, 0.49313978],
-												 [	-6.27253942, -0.00068058, 0.00041708, 7.27185884, 0.99792054, 0.99890234, 0.49313983],
-												 [	-6.27253978, -0.00068043, 0.00041699, 7.27185935, 0.99792099, 0.99890258, 0.49313991],
-												 [	-6.27254014, -0.00068028, 0.00041690, 7.27185986, 0.99792145, 0.99890282, 0.49313998],
-												 [	-6.27254050, -0.00068013, 0.00041681, 7.27186036, 0.99792191, 0.99890306, 0.49314002],
-												 [	-6.27254086, -0.00067998, 0.00041672, 7.27186087, 0.99792237, 0.99890330, 0.49314008],
-												 [	-6.27254121, -0.00067983, 0.00041662, 7.27186138, 0.99792282, 0.99890354, 0.49314012],
-												 [	-6.27254157, -0.00067968, 0.00041653, 7.27186189, 0.99792328, 0.99890378, 0.49314018],
-												 [	-6.27254193, -0.00067953, 0.00041644, 7.27186239, 0.99792373, 0.99890402, 0.49314019],
-												 [	-6.27254229, -0.00067939, 0.00041635, 7.27186290, 0.99792419, 0.99890426, 0.49314025],
-												 [	-6.27254264, -0.00067924, 0.00041626, 7.27186341, 0.99792465, 0.99890450, 0.49314034],
-												 [	-6.27254300, -0.00067909, 0.00041617, 7.27186391, 0.99792510, 0.99890474, 0.49314040],
-												 [	-6.27254336, -0.00067894, 0.00041608, 7.27186442, 0.99792556, 0.99890499, 0.49314044],
-												 [	-6.27254372, -0.00067879, 0.00041598, 7.27186493, 0.99792601, 0.99890523, 0.49314049],
-												 [	-6.27254407, -0.00067864, 0.00041589, 7.27186543, 0.99792647, 0.99890547, 0.49314054],
-												 [	-6.27254443, -0.00067849, 0.00041580, 7.27186594, 0.99792692, 0.99890571, 0.49314058],
-												 [	-6.27254479, -0.00067834, 0.00041571, 7.27186644, 0.99792738, 0.99890595, 0.49314062],
-												 [	-6.27254514, -0.00067819, 0.00041562, 7.27186695, 0.99792783, 0.99890618, 0.49314070],
-												 [	-6.27254550, -0.00067805, 0.00041553, 7.27186745, 0.99792828, 0.99890642, 0.49314075],
-												 [	-6.27254585, -0.00067790, 0.00041544, 7.27186796, 0.99792874, 0.99890666, 0.49314079],
-												 [	-6.27254621, -0.00067775, 0.00041535, 7.27186846, 0.99792919, 0.99890690, 0.49314085],
-												 [	-6.27254657, -0.00067760, 0.00041526, 7.27186897, 0.99792965, 0.99890714, 0.49314090],
-												 [	-6.27254692, -0.00067745, 0.00041516, 7.27186947, 0.99793010, 0.99890738, 0.49314094],
-												 [	-6.27254728, -0.00067730, 0.00041507, 7.27186997, 0.99793055, 0.99890762, 0.49314100],
-												 [	-6.27254763, -0.00067716, 0.00041498, 7.27187048, 0.99793101, 0.99890786, 0.49314106],
-												 [	-6.27254799, -0.00067701, 0.00041489, 7.27187098, 0.99793146, 0.99890810, 0.49314111],
-												 [	-6.27254834, -0.00067686, 0.00041480, 7.27187148, 0.99793191, 0.99890834, 0.49314118],
-												 [	-6.27254870, -0.00067671, 0.00041471, 7.27187199, 0.99793236, 0.99890858, 0.49314123],
-												 [	-6.27254905, -0.00067656, 0.00041462, 7.27187249, 0.99793282, 0.99890882, 0.49314127],
-												 [	-6.27254941, -0.00067642, 0.00041453, 7.27187299, 0.99793327, 0.99890905, 0.49314132],
-												 [	-6.27254976, -0.00067627, 0.00041444, 7.27187349, 0.99793372, 0.99890929, 0.49314138],
-												 [	-6.27255012, -0.00067612, 0.00041435, 7.27187399, 0.99793417, 0.99890953, 0.49314144],
-												 [	-6.27255047, -0.00067597, 0.00041426, 7.27187450, 0.99793462, 0.99890977, 0.49314149],
-												 [	-6.27255082, -0.00067583, 0.00041417, 7.27187500, 0.99793507, 0.99891001, 0.49314155],
-												 [	-6.27255118, -0.00067568, 0.00041408, 7.27187550, 0.99793552, 0.99891025, 0.49314159],
-												 [	-6.27255153, -0.00067553, 0.00041399, 7.27187600, 0.99793597, 0.99891048, 0.49314164],
-												 [	-6.27255188, -0.00067538, 0.00041390, 7.27187650, 0.99793643, 0.99891072, 0.49314169],
-												 [	-6.27255224, -0.00067524, 0.00041381, 7.27187700, 0.99793688, 0.99891096, 0.49314176],
-												 [	-6.27255259, -0.00067509, 0.00041372, 7.27187750, 0.99793733, 0.99891120, 0.49314181],
-												 [	-6.27255294, -0.00067494, 0.00041362, 7.27187800, 0.99793778, 0.99891143, 0.49314185],
-												 [	-6.27255330, -0.00067479, 0.00041353, 7.27187850, 0.99793823, 0.99891167, 0.49314190],
-												 [	-6.27255365, -0.00067465, 0.00041344, 7.27187900, 0.99793868, 0.99891191, 0.49314197],
-												 [	-6.27255400, -0.00067450, 0.00041335, 7.27187950, 0.99793912, 0.99891215, 0.49314200],
-												 [	-6.27255435, -0.00067435, 0.00041326, 7.27188000, 0.99793957, 0.99891238, 0.49314208],
-												 [	-6.27255470, -0.00067421, 0.00041317, 7.27188050, 0.99794002, 0.99891262, 0.49314213],
-												 [	-6.27255506, -0.00067406, 0.00041308, 7.27188100, 0.99794047, 0.99891286, 0.49314217],
-												 [	-6.27255541, -0.00067391, 0.00041299, 7.27188150, 0.99794092, 0.99891309, 0.49314220],
-												 [	-6.27255576, -0.00067377, 0.00041290, 7.27188199, 0.99794137, 0.99891333, 0.49314225],
-												 [	-6.27255611, -0.00067362, 0.00041281, 7.27188249, 0.99794182, 0.99891357, 0.49314232],
-												 [	-6.27255646, -0.00067347, 0.00041272, 7.27188299, 0.99794227, 0.99891380, 0.49314238],
-												 [	-6.27255681, -0.00067333, 0.00041263, 7.27188349, 0.99794271, 0.99891404, 0.49314241],
-												 [	-6.27255717, -0.00067318, 0.00041254, 7.27188398, 0.99794316, 0.99891428, 0.49314247],
-												 [	-6.27255752, -0.00067303, 0.00041245, 7.27188448, 0.99794361, 0.99891451, 0.49314253],
-												 [	-6.27255787, -0.00067289, 0.00041236, 7.27188498, 0.99794406, 0.99891475, 0.49314258],
-												 [	-6.27255822, -0.00067274, 0.00041228, 7.27188548, 0.99794450, 0.99891498, 0.49314263],
-												 [	-6.27255857, -0.00067260, 0.00041219, 7.27188597, 0.99794495, 0.99891522, 0.49314268],
-												 [	-6.27255892, -0.00067245, 0.00041210, 7.27188647, 0.99794540, 0.99891545, 0.49314274],
-												 [	-6.27255927, -0.00067230, 0.00041201, 7.27188696, 0.99794584, 0.99891569, 0.49314280],
-												 [	-6.27255962, -0.00067216, 0.00041192, 7.27188746, 0.99794629, 0.99891593, 0.49314284],
-												 [	-6.27255997, -0.00067201, 0.00041183, 7.27188796, 0.99794673, 0.99891616, 0.49314287],
-												 [	-6.27256032, -0.00067187, 0.00041174, 7.27188845, 0.99794718, 0.99891640, 0.49314297],
-												 [	-6.27256067, -0.00067172, 0.00041165, 7.27188895, 0.99794763, 0.99891663, 0.49314303],
-												 [	-6.27256102, -0.00067157, 0.00041156, 7.27188944, 0.99794807, 0.99891687, 0.49314307],
-												 [	-6.27256137, -0.00067143, 0.00041147, 7.27188994, 0.99794852, 0.99891710, 0.49314312],
-												 [	-6.27256171, -0.00067128, 0.00041138, 7.27189043, 0.99794896, 0.99891734, 0.49314315],
-												 [	-6.27256206, -0.00067114, 0.00041129, 7.27189093, 0.99794941, 0.99891757, 0.49314322],
-												 [	-6.27256241, -0.00067099, 0.00041120, 7.27189142, 0.99794985, 0.99891781, 0.49314325],
-												 [	-6.27256276, -0.00067085, 0.00041111, 7.27189191, 0.99795030, 0.99891804, 0.49314333],
-												 [	-6.27256311, -0.00067070, 0.00041102, 7.27189241, 0.99795074, 0.99891828, 0.49314337],
-												 [	-6.27256346, -0.00067056, 0.00041093, 7.27189290, 0.99795119, 0.99891851, 0.49314340],
-												 [	-6.27256381, -0.00067041, 0.00041085, 7.27189339, 0.99795163, 0.99891874, 0.49314348],
-												 [	-6.27256415, -0.00067027, 0.00041076, 7.27189389, 0.99795207, 0.99891898, 0.49314353],
-												 [	-6.27256450, -0.00067012, 0.00041067, 7.27189438, 0.99795252, 0.99891921, 0.49314358],
-												 [	-6.27256485, -0.00066998, 0.00041058, 7.27189487, 0.99795296, 0.99891945, 0.49314365],
-												 [	-6.27256520, -0.00066983, 0.00041049, 7.27189537, 0.99795340, 0.99891968, 0.49314368],
-												 [	-6.27256554, -0.00066969, 0.00041040, 7.27189586, 0.99795385, 0.99891991, 0.49314376],
-												 [	-6.27256589, -0.00066954, 0.00041031, 7.27189635, 0.99795429, 0.99892015, 0.49314379],
-												 [	-6.27256624, -0.00066940, 0.00041022, 7.27189684, 0.99795473, 0.99892038, 0.49314383],
-												 [	-6.27256658, -0.00066925, 0.00041013, 7.27189733, 0.99795517, 0.99892061, 0.49314389],
-												 [	-6.27256693, -0.00066911, 0.00041005, 7.27189782, 0.99795562, 0.99892085, 0.49314395],
-												 [	-6.27256728, -0.00066896, 0.00040996, 7.27189832, 0.99795606, 0.99892108, 0.49314398],
-												 [	-6.27256762, -0.00066882, 0.00040987, 7.27189881, 0.99795650, 0.99892131, 0.49314403],
-												 [	-6.27256797, -0.00066867, 0.00040978, 7.27189930, 0.99795694, 0.99892155, 0.49314409],
-												 [	-6.27256832, -0.00066853, 0.00040969, 7.27189979, 0.99795738, 0.99892178, 0.49314415],
-												 [	-6.27256866, -0.00066838, 0.00040960, 7.27190028, 0.99795782, 0.99892201, 0.49314419],
-												 [	-6.27256901, -0.00066824, 0.00040951, 7.27190077, 0.99795827, 0.99892225, 0.49314425],
-												 [	-6.27256935, -0.00066810, 0.00040943, 7.27190126, 0.99795871, 0.99892248, 0.49314428],
-												 [	-6.27256970, -0.00066795, 0.00040934, 7.27190175, 0.99795915, 0.99892271, 0.49314436],
-												 [	-6.27257004, -0.00066781, 0.00040925, 7.27190224, 0.99795959, 0.99892294, 0.49314439],
-												 [	-6.27257039, -0.00066766, 0.00040916, 7.27190273, 0.99796003, 0.99892318, 0.49314446],
-												 [	-6.27257073, -0.00066752, 0.00040907, 7.27190322, 0.99796047, 0.99892341, 0.49314452],
-												 [	-6.27257108, -0.00066738, 0.00040898, 7.27190370, 0.99796091, 0.99892364, 0.49314453],
-												 [	-6.27257142, -0.00066723, 0.00040890, 7.27190419, 0.99796135, 0.99892387, 0.49314460],
-												 [	-6.27257177, -0.00066709, 0.00040881, 7.27190468, 0.99796179, 0.99892410, 0.49314466],
-												 [	-6.27257211, -0.00066694, 0.00040872, 7.27190517, 0.99796223, 0.99892434, 0.49314470],
-												 [	-6.27257246, -0.00066680, 0.00040863, 7.27190566, 0.99796267, 0.99892457, 0.49314476],
-												 [	-6.27257280, -0.00066666, 0.00040854, 7.27190615, 0.99796311, 0.99892480, 0.49314482],
-												 [	-6.27257315, -0.00066651, 0.00040846, 7.27190663, 0.99796354, 0.99892503, 0.49314486],
-												 [	-6.27257349, -0.00066637, 0.00040837, 7.27190712, 0.99796398, 0.99892526, 0.49314490],
-												 [	-6.27257383, -0.00066623, 0.00040828, 7.27190761, 0.99796442, 0.99892549, 0.49314498],
-												 [	-6.27257418, -0.00066608, 0.00040819, 7.27190809, 0.99796486, 0.99892573, 0.49314501],
-												 [	-6.27257452, -0.00066594, 0.00040810, 7.27190858, 0.99796530, 0.99892596, 0.49314505],
-												 [	-6.27257486, -0.00066580, 0.00040802, 7.27190907, 0.99796574, 0.99892619, 0.49314512],
-												 [	-6.27257521, -0.00066565, 0.00040793, 7.27190955, 0.99796617, 0.99892642, 0.49314515],
-												 [	-6.27257555, -0.00066551, 0.00040784, 7.27191004, 0.99796661, 0.99892665, 0.49314521],
-												 [	-6.27257589, -0.00066537, 0.00040775, 7.27191053, 0.99796705, 0.99892688, 0.49314528],
-												 [	-6.27257623, -0.00066522, 0.00040766, 7.27191101, 0.99796748, 0.99892711, 0.49314532],
-												 [	-6.27257658, -0.00066508, 0.00040758, 7.27191150, 0.99796792, 0.99892734, 0.49314537],
-												 [	-6.27257692, -0.00066494, 0.00040749, 7.27191198, 0.99796836, 0.99892757, 0.49314541],
-												 [	-6.27257726, -0.00066480, 0.00040740, 7.27191247, 0.99796880, 0.99892780, 0.49314547],
-												 [	-6.27257760, -0.00066465, 0.00040731, 7.27191295, 0.99796923, 0.99892803, 0.49314555],
-												 [	-6.27257795, -0.00066451, 0.00040723, 7.27191344, 0.99796967, 0.99892826, 0.49314558],
-												 [	-6.27257829, -0.00066437, 0.00040714, 7.27191392, 0.99797010, 0.99892849, 0.49314564],
-												 [	-6.27257863, -0.00066422, 0.00040705, 7.27191440, 0.99797054, 0.99892872, 0.49314568],
-												 [	-6.27257897, -0.00066408, 0.00040696, 7.27191489, 0.99797098, 0.99892895, 0.49314573],
-												 [	-6.27257931, -0.00066394, 0.00040688, 7.27191537, 0.99797141, 0.99892918, 0.49314579],
-												 [	-6.27257965, -0.00066380, 0.00040679, 7.27191586, 0.99797185, 0.99892941, 0.49314582],
-												 [	-6.27257999, -0.00066366, 0.00040670, 7.27191634, 0.99797228, 0.99892964, 0.49314588],
-												 [	-6.27258033, -0.00066351, 0.00040662, 7.27191682, 0.99797272, 0.99892987, 0.49314593],
-												 [	-6.27258068, -0.00066337, 0.00040653, 7.27191730, 0.99797315, 0.99893010, 0.49314598],
-												 [	-6.27258102, -0.00066323, 0.00040644, 7.27191779, 0.99797358, 0.99893033, 0.49314603],
-												 [	-6.27258136, -0.00066309, 0.00040635, 7.27191827, 0.99797402, 0.99893056, 0.49314608],
-												 [	-6.27258170, -0.00066294, 0.00040627, 7.27191875, 0.99797445, 0.99893079, 0.49314611],
-												 [	-6.27258204, -0.00066280, 0.00040618, 7.27191923, 0.99797489, 0.99893102, 0.49314621],
-												 [	-6.27258238, -0.00066266, 0.00040609, 7.27191972, 0.99797532, 0.99893125, 0.49314623],
-												 [	-6.27258272, -0.00066252, 0.00040601, 7.27192020, 0.99797575, 0.99893148, 0.49314626],
-												 [	-6.27258306, -0.00066238, 0.00040592, 7.27192068, 0.99797619, 0.99893170, 0.49314635],
-												 [	-6.27258340, -0.00066224, 0.00040583, 7.27192116, 0.99797662, 0.99893193, 0.49314639],
-												 [	-6.27258373, -0.00066209, 0.00040574, 7.27192164, 0.99797705, 0.99893216, 0.49314644],
-												 [	-6.27258407, -0.00066195, 0.00040566, 7.27192212, 0.99797749, 0.99893239, 0.49314649],
-												 [	-6.27258441, -0.00066181, 0.00040557, 7.27192260, 0.99797792, 0.99893262, 0.49314651],
-												 [	-6.27258475, -0.00066167, 0.00040548, 7.27192308, 0.99797835, 0.99893285, 0.49314660],
-												 [	-6.27258509, -0.00066153, 0.00040540, 7.27192356, 0.99797878, 0.99893307, 0.49314663],
-												 [	-6.27258543, -0.00066139, 0.00040531, 7.27192404, 0.99797922, 0.99893330, 0.49314669],
-												 [	-6.27258577, -0.00066125, 0.00040522, 7.27192452, 0.99797965, 0.99893353, 0.49314673],
-												 [	-6.27258611, -0.00066110, 0.00040514, 7.27192500, 0.99798008, 0.99893376, 0.49314679],
-												 [	-6.27258644, -0.00066096, 0.00040505, 7.27192548, 0.99798051, 0.99893399, 0.49314686],
-												 [	-6.27258678, -0.00066082, 0.00040496, 7.27192596, 0.99798094, 0.99893421, 0.49314689],
-												 [	-6.27258712, -0.00066068, 0.00040488, 7.27192644, 0.99798137, 0.99893444, 0.49314694],
-												 [	-6.27258746, -0.00066054, 0.00040479, 7.27192692, 0.99798181, 0.99893467, 0.49314700],
-												 [	-6.27258780, -0.00066040, 0.00040471, 7.27192740, 0.99798224, 0.99893490, 0.49314705],
-												 [	-6.27258813, -0.00066026, 0.00040462, 7.27192788, 0.99798267, 0.99893512, 0.49314708],
-												 [	-6.27258847, -0.00066012, 0.00040453, 7.27192835, 0.99798310, 0.99893535, 0.49314712],
-												 [	-6.27258881, -0.00065998, 0.00040445, 7.27192883, 0.99798353, 0.99893558, 0.49314719],
-												 [	-6.27258914, -0.00065984, 0.00040436, 7.27192931, 0.99798396, 0.99893580, 0.49314727],
-												 [	-6.27258948, -0.00065970, 0.00040427, 7.27192979, 0.99798439, 0.99893603, 0.49314727],
-												 [	-6.27258982, -0.00065955, 0.00040419, 7.27193026, 0.99798482, 0.99893626, 0.49314731],
-												 [	-6.27259015, -0.00065941, 0.00040410, 7.27193074, 0.99798525, 0.99893648, 0.49314740],
-												 [	-6.27259049, -0.00065927, 0.00040401, 7.27193122, 0.99798568, 0.99893671, 0.49314745],
-												 [	-6.27259083, -0.00065913, 0.00040393, 7.27193169, 0.99798610, 0.99893694, 0.49314746],
-												 [	-6.27259116, -0.00065899, 0.00040384, 7.27193217, 0.99798653, 0.99893716, 0.49314754],
-												 [	-6.27259150, -0.00065885, 0.00040376, 7.27193265, 0.99798696, 0.99893739, 0.49314761],
-												 [	-6.27259184, -0.00065871, 0.00040367, 7.27193312, 0.99798739, 0.99893762, 0.49314766],
-												 [	-6.27259217, -0.00065857, 0.00040358, 7.27193360, 0.99798782, 0.99893784, 0.49314769],
-												 [	-6.27259251, -0.00065843, 0.00040350, 7.27193407, 0.99798825, 0.99893807, 0.49314775],
-												 [	-6.27259284, -0.00065829, 0.00040341, 7.27193455, 0.99798868, 0.99893829, 0.49314778],
-												 [	-6.27259318, -0.00065815, 0.00040333, 7.27193502, 0.99798910, 0.99893852, 0.49314784],
-												 [	-6.27259351, -0.00065801, 0.00040324, 7.27193550, 0.99798953, 0.99893875, 0.49314788],
-												 [	-6.27259385, -0.00065787, 0.00040316, 7.27193597, 0.99798996, 0.99893897, 0.49314794],
-												 [	-6.27259418, -0.00065773, 0.00040307, 7.27193645, 0.99799039, 0.99893920, 0.49314799],
-												 [	-6.27259452, -0.00065759, 0.00040298, 7.27193692, 0.99799081, 0.99893942, 0.49314805],
-												 [	-6.27259485, -0.00065745, 0.00040290, 7.27193740, 0.99799124, 0.99893965, 0.49314807],
-												 [	-6.27259519, -0.00065731, 0.00040281, 7.27193787, 0.99799167, 0.99893987, 0.49314813],
-												 [	-6.27259552, -0.00065717, 0.00040273, 7.27193835, 0.99799209, 0.99894010, 0.49314822],
-												 [	-6.27259585, -0.00065703, 0.00040264, 7.27193882, 0.99799252, 0.99894032, 0.49314825],
-												 [	-6.27259619, -0.00065690, 0.00040256, 7.27193929, 0.99799295, 0.99894055, 0.49314830],
-												 [	-6.27259652, -0.00065676, 0.00040247, 7.27193977, 0.99799337, 0.99894077, 0.49314836],
-												 [	-6.27259686, -0.00065662, 0.00040239, 7.27194024, 0.99799380, 0.99894100, 0.49314839],
-												 [	-6.27259719, -0.00065648, 0.00040230, 7.27194071, 0.99799422, 0.99894122, 0.49314844],
-												 [	-6.27259752, -0.00065634, 0.00040221, 7.27194118, 0.99799465, 0.99894145, 0.49314848],
-												 [	-6.27259786, -0.00065620, 0.00040213, 7.27194166, 0.99799507, 0.99894167, 0.49314852],
-												 [	-6.27259819, -0.00065606, 0.00040204, 7.27194213, 0.99799550, 0.99894190, 0.49314858],
-												 [	-6.27259852, -0.00065592, 0.00040196, 7.27194260, 0.99799593, 0.99894212, 0.49314864],
-												 [	-6.27259885, -0.00065578, 0.00040187, 7.27194307, 0.99799635, 0.99894234, 0.49314867],
-												 [	-6.27259919, -0.00065564, 0.00040179, 7.27194354, 0.99799677, 0.99894257, 0.49314872],
-												 [	-6.27259952, -0.00065550, 0.00040170, 7.27194402, 0.99799720, 0.99894279, 0.49314880],
-												 [	-6.27259985, -0.00065537, 0.00040162, 7.27194449, 0.99799762, 0.99894302, 0.49314880],
-												 [	-6.27260018, -0.00065523, 0.00040153, 7.27194496, 0.99799805, 0.99894324, 0.49314888],
-												 [	-6.27260052, -0.00065509, 0.00040145, 7.27194543, 0.99799847, 0.99894346, 0.49314897],
-												 [	-6.27260085, -0.00065495, 0.00040136, 7.27194590, 0.99799889, 0.99894369, 0.49314899],
-												 [	-6.27260118, -0.00065481, 0.00040128, 7.27194637, 0.99799932, 0.99894391, 0.49314902],
-												 [	-6.27260151, -0.00065467, 0.00040119, 7.27194684, 0.99799974, 0.99894413, 0.49314908],
-												 [	-6.27260184, -0.00065453, 0.00040111, 7.27194731, 0.99800016, 0.99894436, 0.49314911],
-												 [	-6.27260217, -0.00065440, 0.00040102, 7.27194778, 0.99800059, 0.99894458, 0.49314920],
-												 [	-6.27260251, -0.00065426, 0.00040094, 7.27194825, 0.99800101, 0.99894480, 0.49314922],
-												 [	-6.27260284, -0.00065412, 0.00040085, 7.27194872, 0.99800143, 0.99894503, 0.49314928],
-												 [	-6.27260317, -0.00065398, 0.00040077, 7.27194919, 0.99800186, 0.99894525, 0.49314931],
-												 [	-6.27260350, -0.00065384, 0.00040068, 7.27194966, 0.99800228, 0.99894547, 0.49314937],
-												 [	-6.27260383, -0.00065370, 0.00040060, 7.27195013, 0.99800270, 0.99894570, 0.49314942],
-												 [	-6.27260416, -0.00065357, 0.00040051, 7.27195059, 0.99800312, 0.99894592, 0.49314947],
-												 [	-6.27260449, -0.00065343, 0.00040043, 7.27195106, 0.99800354, 0.99894614, 0.49314952],
-												 [	-6.27260482, -0.00065329, 0.00040035, 7.27195153, 0.99800397, 0.99894636, 0.49314960],
-												 [	-6.27260515, -0.00065315, 0.00040026, 7.27195200, 0.99800439, 0.99894659, 0.49314963],
-												 [	-6.27260548, -0.00065302, 0.00040018, 7.27195247, 0.99800481, 0.99894681, 0.49314965],
-												 [	-6.27260581, -0.00065288, 0.00040009, 7.27195293, 0.99800523, 0.99894703, 0.49314972],
-												 [	-6.27260614, -0.00065274, 0.00040001, 7.27195340, 0.99800565, 0.99894725, 0.49314975],
-												 [	-6.27260647, -0.00065260, 0.00039992, 7.27195387, 0.99800607, 0.99894747, 0.49314983],
-												 [	-6.27260680, -0.00065246, 0.00039984, 7.27195434, 0.99800649, 0.99894770, 0.49314987],
-												 [	-6.27260713, -0.00065233, 0.00039975, 7.27195480, 0.99800691, 0.99894792, 0.49314994],
-												 [	-6.27260746, -0.00065219, 0.00039967, 7.27195527, 0.99800733, 0.99894814, 0.49314996],
-												 [	-6.27260779, -0.00065205, 0.00039959, 7.27195573, 0.99800775, 0.99894836, 0.49314998],
-												 [	-6.27260812, -0.00065192, 0.00039950, 7.27195620, 0.99800817, 0.99894858, 0.49315004],
-												 [	-6.27260844, -0.00065178, 0.00039942, 7.27195667, 0.99800859, 0.99894880, 0.49315011],
-												 [	-6.27260877, -0.00065164, 0.00039933, 7.27195713, 0.99800901, 0.99894903, 0.49315016],
-												 [	-6.27260910, -0.00065150, 0.00039925, 7.27195760, 0.99800943, 0.99894925, 0.49315020],
-												 [	-6.27260943, -0.00065137, 0.00039917, 7.27195806, 0.99800985, 0.99894947, 0.49315028],
-												 [	-6.27260976, -0.00065123, 0.00039908, 7.27195853, 0.99801027, 0.99894969, 0.49315027],
-												 [	-6.27261009, -0.00065109, 0.00039900, 7.27195899, 0.99801069, 0.99894991, 0.49315035],
-												 [	-6.27261041, -0.00065096, 0.00039891, 7.27195946, 0.99801110, 0.99895013, 0.49315041],
-												 [	-6.27261074, -0.00065082, 0.00039883, 7.27195992, 0.99801152, 0.99895035, 0.49315047],
-												 [	-6.27261107, -0.00065068, 0.00039875, 7.27196039, 0.99801194, 0.99895057, 0.49315053],
-												 [	-6.27261140, -0.00065055, 0.00039866, 7.27196085, 0.99801236, 0.99895079, 0.49315055],
-												 [	-6.27261172, -0.00065041, 0.00039858, 7.27196132, 0.99801278, 0.99895101, 0.49315059],
-												 [	-6.27261205, -0.00065027, 0.00039849, 7.27196178, 0.99801320, 0.99895123, 0.49315063],
-												 [	-6.27261238, -0.00065014, 0.00039841, 7.27196224, 0.99801361, 0.99895145, 0.49315070],
-												 [	-6.27261271, -0.00065000, 0.00039833, 7.27196271, 0.99801403, 0.99895167, 0.49315074],
-												 [	-6.27261303, -0.00064986, 0.00039824, 7.27196317, 0.99801445, 0.99895189, 0.49315081],
-												 [	-6.27261336, -0.00064973, 0.00039816, 7.27196363, 0.99801486, 0.99895212, 0.49315083],
-												 [	-6.27261369, -0.00064959, 0.00039808, 7.27196410, 0.99801528, 0.99895233, 0.49315088],
-												 [	-6.27261401, -0.00064945, 0.00039799, 7.27196456, 0.99801570, 0.99895255, 0.49315095],
-												 [	-6.27261434, -0.00064932, 0.00039791, 7.27196502, 0.99801611, 0.99895277, 0.49315102],
-												 [	-6.27261466, -0.00064918, 0.00039782, 7.27196548, 0.99801653, 0.99895299, 0.49315101],
-												 [	-6.27261499, -0.00064904, 0.00039774, 7.27196595, 0.99801695, 0.99895321, 0.49315109],
-												 [	-6.27261532, -0.00064891, 0.00039766, 7.27196641, 0.99801736, 0.99895343, 0.49315112],
-												 [	-6.27261564, -0.00064877, 0.00039757, 7.27196687, 0.99801778, 0.99895365, 0.49315120],
-												 [	-6.27261597, -0.00064864, 0.00039749, 7.27196733, 0.99801819, 0.99895387, 0.49315122],
-												 [	-6.27261629, -0.00064850, 0.00039741, 7.27196779, 0.99801861, 0.99895409, 0.49315129],
-												 [	-6.27261662, -0.00064836, 0.00039732, 7.27196825, 0.99801902, 0.99895431, 0.49315134],
-												 [	-6.27261694, -0.00064823, 0.00039724, 7.27196871, 0.99801944, 0.99895453, 0.49315136],
-												 [	-6.27261727, -0.00064809, 0.00039716, 7.27196917, 0.99801985, 0.99895475, 0.49315141],
-												 [	-6.27261759, -0.00064796, 0.00039707, 7.27196963, 0.99802027, 0.99895497, 0.49315149],
-												 [	-6.27261792, -0.00064782, 0.00039699, 7.27197009, 0.99802068, 0.99895519, 0.49315153],
-												 [	-6.27261824, -0.00064769, 0.00039691, 7.27197056, 0.99802110, 0.99895540, 0.49315156],
-												 [	-6.27261857, -0.00064755, 0.00039683, 7.27197101, 0.99802151, 0.99895562, 0.49315162],
-												 [	-6.27261889, -0.00064742, 0.00039674, 7.27197147, 0.99802193, 0.99895584, 0.49315167],
-												 [	-6.27261921, -0.00064728, 0.00039666, 7.27197193, 0.99802234, 0.99895606, 0.49315173],
-												 [	-6.27261954, -0.00064715, 0.00039658, 7.27197239, 0.99802275, 0.99895628, 0.49315176],
-												 [	-6.27261986, -0.00064701, 0.00039649, 7.27197285, 0.99802317, 0.99895650, 0.49315180],
-												 [	-6.27262019, -0.00064687, 0.00039641, 7.27197331, 0.99802358, 0.99895671, 0.49315186],
-												 [	-6.27262051, -0.00064674, 0.00039633, 7.27197377, 0.99802399, 0.99895693, 0.49315191],
-												 [	-6.27262083, -0.00064660, 0.00039624, 7.27197423, 0.99802441, 0.99895715, 0.49315198],
-												 [	-6.27262116, -0.00064647, 0.00039616, 7.27197469, 0.99802482, 0.99895737, 0.49315200],
-												 [	-6.27262148, -0.00064633, 0.00039608, 7.27197515, 0.99802523, 0.99895759, 0.49315204],
-												 [	-6.27262180, -0.00064620, 0.00039600, 7.27197560, 0.99802564, 0.99895780, 0.49315211],
-												 [	-6.27262213, -0.00064606, 0.00039591, 7.27197606, 0.99802606, 0.99895802, 0.49315216],
-												 [	-6.27262245, -0.00064593, 0.00039583, 7.27197652, 0.99802647, 0.99895824, 0.49315219],
-												 [	-6.27262277, -0.00064579, 0.00039575, 7.27197698, 0.99802688, 0.99895846, 0.49315225],
-												 [	-6.27262309, -0.00064566, 0.00039567, 7.27197743, 0.99802729, 0.99895867, 0.49315226],
-												 [	-6.27262342, -0.00064553, 0.00039558, 7.27197789, 0.99802770, 0.99895889, 0.49315233],
-												 [	-6.27262374, -0.00064539, 0.00039550, 7.27197835, 0.99802812, 0.99895911, 0.49315238],
-												 [	-6.27262406, -0.00064526, 0.00039542, 7.27197880, 0.99802853, 0.99895933, 0.49315244],
-												 [	-6.27262438, -0.00064512, 0.00039534, 7.27197926, 0.99802894, 0.99895954, 0.49315248],
-												 [	-6.27262470, -0.00064499, 0.00039525, 7.27197972, 0.99802935, 0.99895976, 0.49315254],
-												 [	-6.27262503, -0.00064485, 0.00039517, 7.27198017, 0.99802976, 0.99895998, 0.49315255],
-												 [	-6.27262535, -0.00064472, 0.00039509, 7.27198063, 0.99803017, 0.99896019, 0.49315260],
-												 [	-6.27262567, -0.00064458, 0.00039501, 7.27198108, 0.99803058, 0.99896041, 0.49315266],
-												 [	-6.27262599, -0.00064445, 0.00039492, 7.27198154, 0.99803099, 0.99896063, 0.49315272],
-												 [	-6.27262631, -0.00064432, 0.00039484, 7.27198199, 0.99803140, 0.99896084, 0.49315276],
-												 [	-6.27262663, -0.00064418, 0.00039476, 7.27198245, 0.99803181, 0.99896106, 0.49315283],
-												 [	-6.27262695, -0.00064405, 0.00039468, 7.27198290, 0.99803222, 0.99896127, 0.49315287],
-												 [	-6.27262727, -0.00064391, 0.00039460, 7.27198336, 0.99803263, 0.99896149, 0.49315291],
-												 [	-6.27262759, -0.00064378, 0.00039451, 7.27198381, 0.99803304, 0.99896171, 0.49315298],
-												 [	-6.27262792, -0.00064365, 0.00039443, 7.27198427, 0.99803345, 0.99896192, 0.49315301],
-												 [	-6.27262824, -0.00064351, 0.00039435, 7.27198472, 0.99803386, 0.99896214, 0.49315305],
-												 [	-6.27262856, -0.00064338, 0.00039427, 7.27198518, 0.99803427, 0.99896235, 0.49315310],
-												 [	-6.27262888, -0.00064325, 0.00039418, 7.27198563, 0.99803468, 0.99896257, 0.49315315],
-												 [	-6.27262920, -0.00064311, 0.00039410, 7.27198608, 0.99803508, 0.99896279, 0.49315320],
-												 [	-6.27262952, -0.00064298, 0.00039402, 7.27198654, 0.99803549, 0.99896300, 0.49315324],
-												 [	-6.27262984, -0.00064284, 0.00039394, 7.27198699, 0.99803590, 0.99896322, 0.49315329],
-												 [	-6.27263015, -0.00064271, 0.00039386, 7.27198744, 0.99803631, 0.99896343, 0.49315335],
-												 [	-6.27263047, -0.00064258, 0.00039378, 7.27198790, 0.99803672, 0.99896365, 0.49315341],
-												 [	-6.27263079, -0.00064244, 0.00039369, 7.27198835, 0.99803712, 0.99896386, 0.49315341],
-												 [	-6.27263111, -0.00064231, 0.00039361, 7.27198880, 0.99803753, 0.99896408, 0.49315348],
-												 [	-6.27263143, -0.00064218, 0.00039353, 7.27198925, 0.99803794, 0.99896429, 0.49315355],
-												 [	-6.27263175, -0.00064204, 0.00039345, 7.27198971, 0.99803835, 0.99896451, 0.49315360],
-												 [	-6.27263207, -0.00064191, 0.00039337, 7.27199016, 0.99803875, 0.99896472, 0.49315362],
-												 [	-6.27263239, -0.00064178, 0.00039329, 7.27199061, 0.99803916, 0.99896494, 0.49315366],
-												 [	-6.27263271, -0.00064165, 0.00039320, 7.27199106, 0.99803957, 0.99896515, 0.49315370],
-												 [	-6.27263302, -0.00064151, 0.00039312, 7.27199151, 0.99803997, 0.99896537, 0.49315378],
-												 [	-6.27263334, -0.00064138, 0.00039304, 7.27199196, 0.99804038, 0.99896558, 0.49315382],
-												 [	-6.27263366, -0.00064125, 0.00039296, 7.27199241, 0.99804079, 0.99896579, 0.49315384],
-												 [	-6.27263398, -0.00064111, 0.00039288, 7.27199287, 0.99804119, 0.99896601, 0.49315390],
-												 [	-6.27263430, -0.00064098, 0.00039280, 7.27199332, 0.99804160, 0.99896622, 0.49315398],
-												 [	-6.27263461, -0.00064085, 0.00039271, 7.27199377, 0.99804200, 0.99896644, 0.49315398],
-												 [	-6.27263493, -0.00064072, 0.00039263, 7.27199422, 0.99804241, 0.99896665, 0.49315402],
-												 [	-6.27263525, -0.00064058, 0.00039255, 7.27199467, 0.99804281, 0.99896686, 0.49315410],
-												 [	-6.27263557, -0.00064045, 0.00039247, 7.27199512, 0.99804322, 0.99896708, 0.49315415],
-												 [	-6.27263588, -0.00064032, 0.00039239, 7.27199557, 0.99804362, 0.99896729, 0.49315420],
-												 [	-6.27263620, -0.00064019, 0.00039231, 7.27199602, 0.99804403, 0.99896751, 0.49315423],
-												 [	-6.27263652, -0.00064005, 0.00039223, 7.27199646, 0.99804443, 0.99896772, 0.49315429],
-												 [	-6.27263683, -0.00063992, 0.00039215, 7.27199691, 0.99804484, 0.99896793, 0.49315433],
-												 [	-6.27263715, -0.00063979, 0.00039206, 7.27199736, 0.99804524, 0.99896815, 0.49315438],
-												 [	-6.27263747, -0.00063966, 0.00039198, 7.27199781, 0.99804565, 0.99896836, 0.49315441],
-												 [	-6.27263778, -0.00063952, 0.00039190, 7.27199826, 0.99804605, 0.99896857, 0.49315445],
-												 [	-6.27263810, -0.00063939, 0.00039182, 7.27199871, 0.99804645, 0.99896879, 0.49315452],
-												 [	-6.27263842, -0.00063926, 0.00039174, 7.27199916, 0.99804686, 0.99896900, 0.49315453],
-												 [	-6.27263873, -0.00063913, 0.00039166, 7.27199960, 0.99804726, 0.99896921, 0.49315461],
-												 [	-6.27263905, -0.00063900, 0.00039158, 7.27200005, 0.99804766, 0.99896942, 0.49315465],
-												 [	-6.27263936, -0.00063886, 0.00039150, 7.27200050, 0.99804807, 0.99896964, 0.49315471],
-												 [	-6.27263968, -0.00063873, 0.00039142, 7.27200095, 0.99804847, 0.99896985, 0.49315476],
-												 [	-6.27263999, -0.00063860, 0.00039134, 7.27200139, 0.99804887, 0.99897006, 0.49315480],
-												 [	-6.27264031, -0.00063847, 0.00039126, 7.27200184, 0.99804928, 0.99897028, 0.49315486],
-												 [	-6.27264063, -0.00063834, 0.00039117, 7.27200229, 0.99804968, 0.99897049, 0.49315489],
-												 [	-6.27264094, -0.00063821, 0.00039109, 7.27200273, 0.99805008, 0.99897070, 0.49315491],
-												 [	-6.27264126, -0.00063807, 0.00039101, 7.27200318, 0.99805048, 0.99897091, 0.49315503],
-												 [	-6.27264157, -0.00063794, 0.00039093, 7.27200363, 0.99805088, 0.99897112, 0.49315504],
-												 [	-6.27264188, -0.00063781, 0.00039085, 7.27200407, 0.99805129, 0.99897134, 0.49315507],
-												 [	-6.27264220, -0.00063768, 0.00039077, 7.27200452, 0.99805169, 0.99897155, 0.49315512],
-												 [	-6.27264251, -0.00063755, 0.00039069, 7.27200496, 0.99805209, 0.99897176, 0.49315517],
-												 [	-6.27264283, -0.00063742, 0.00039061, 7.27200541, 0.99805249, 0.99897197, 0.49315521],
-												 [	-6.27264314, -0.00063729, 0.00039053, 7.27200586, 0.99805289, 0.99897218, 0.49315529],
-												 [	-6.27264346, -0.00063716, 0.00039045, 7.27200630, 0.99805329, 0.99897240, 0.49315533],
-												 [	-6.27264377, -0.00063702, 0.00039037, 7.27200675, 0.99805369, 0.99897261, 0.49315538],
-												 [	-6.27264408, -0.00063689, 0.00039029, 7.27200719, 0.99805409, 0.99897282, 0.49315540],
-												 [	-6.27264440, -0.00063676, 0.00039021, 7.27200764, 0.99805450, 0.99897303, 0.49315545],
-												 [	-6.27264471, -0.00063663, 0.00039013, 7.27200808, 0.99805490, 0.99897324, 0.49315550],
-												 [	-6.27264502, -0.00063650, 0.00039005, 7.27200852, 0.99805530, 0.99897345, 0.49315556],
-												 [	-6.27264534, -0.00063637, 0.00038997, 7.27200897, 0.99805570, 0.99897366, 0.49315563],
-												 [	-6.27264565, -0.00063624, 0.00038989, 7.27200941, 0.99805610, 0.99897387, 0.49315563],
-												 [	-6.27264596, -0.00063611, 0.00038981, 7.27200986, 0.99805649, 0.99897409, 0.49315568],
-												 [	-6.27264628, -0.00063598, 0.00038973, 7.27201030, 0.99805689, 0.99897430, 0.49315572],
-												 [	-6.27264659, -0.00063585, 0.00038965, 7.27201074, 0.99805729, 0.99897451, 0.49315579],
-												 [	-6.27264690, -0.00063572, 0.00038957, 7.27201119, 0.99805769, 0.99897472, 0.49315582],
-												 [	-6.27264721, -0.00063559, 0.00038949, 7.27201163, 0.99805809, 0.99897493, 0.49315589],
-												 [	-6.27264753, -0.00063545, 0.00038941, 7.27201207, 0.99805849, 0.99897514, 0.49315595],
-												 [	-6.27264784, -0.00063532, 0.00038933, 7.27201251, 0.99805889, 0.99897535, 0.49315600],
-												 [	-6.27264815, -0.00063519, 0.00038925, 7.27201296, 0.99805929, 0.99897556, 0.49315603],
-												 [	-6.27264846, -0.00063506, 0.00038917, 7.27201340, 0.99805969, 0.99897577, 0.49315606],
-												 [	-6.27264877, -0.00063493, 0.00038909, 7.27201384, 0.99806008, 0.99897598, 0.49315609],
-												 [	-6.27264909, -0.00063480, 0.00038901, 7.27201428, 0.99806048, 0.99897619, 0.49315614],
-												 [	-6.27264940, -0.00063467, 0.00038893, 7.27201472, 0.99806088, 0.99897640, 0.49315621],
-												 [	-6.27264971, -0.00063454, 0.00038885, 7.27201517, 0.99806128, 0.99897661, 0.49315622],
-												 [	-6.27265002, -0.00063441, 0.00038877, 7.27201561, 0.99806168, 0.99897682, 0.49315632],
-												 [	-6.27265033, -0.00063428, 0.00038869, 7.27201605, 0.99806207, 0.99897703, 0.49315636],
-												 [	-6.27265064, -0.00063415, 0.00038861, 7.27201649, 0.99806247, 0.99897724, 0.49315639],
-												 [	-6.27265095, -0.00063402, 0.00038853, 7.27201693, 0.99806287, 0.99897745, 0.49315644],
-												 [	-6.27265126, -0.00063389, 0.00038845, 7.27201737, 0.99806326, 0.99897766, 0.49315648],
-												 [	-6.27265157, -0.00063376, 0.00038837, 7.27201781, 0.99806366, 0.99897787, 0.49315654],
-												 [	-6.27265189, -0.00063363, 0.00038829, 7.27201825, 0.99806406, 0.99897808, 0.49315656],
-												 [	-6.27265220, -0.00063350, 0.00038821, 7.27201869, 0.99806445, 0.99897829, 0.49315663],
-												 [	-6.27265251, -0.00063337, 0.00038813, 7.27201913, 0.99806485, 0.99897849, 0.49315664],
-												 [	-6.27265282, -0.00063324, 0.00038805, 7.27201957, 0.99806525, 0.99897870, 0.49315672],
-												 [	-6.27265313, -0.00063312, 0.00038797, 7.27202001, 0.99806564, 0.99897891, 0.49315678],
-												 [	-6.27265344, -0.00063299, 0.00038789, 7.27202045, 0.99806604, 0.99897912, 0.49315679],
-												 [	-6.27265375, -0.00063286, 0.00038781, 7.27202089, 0.99806643, 0.99897933, 0.49315682],
-												 [	-6.27265406, -0.00063273, 0.00038773, 7.27202133, 0.99806683, 0.99897954, 0.49315688],
-												 [	-6.27265436, -0.00063260, 0.00038765, 7.27202177, 0.99806722, 0.99897975, 0.49315697],
-												 [	-6.27265467, -0.00063247, 0.00038758, 7.27202221, 0.99806762, 0.99897996, 0.49315698],
-												 [	-6.27265498, -0.00063234, 0.00038750, 7.27202264, 0.99806801, 0.99898016, 0.49315705],
-												 [	-6.27265529, -0.00063221, 0.00038742, 7.27202308, 0.99806841, 0.99898037, 0.49315710],
-												 [	-6.27265560, -0.00063208, 0.00038734, 7.27202352, 0.99806880, 0.99898058, 0.49315714],
-												 [	-6.27265591, -0.00063195, 0.00038726, 7.27202396, 0.99806920, 0.99898079, 0.49315716],
-												 [	-6.27265622, -0.00063182, 0.00038718, 7.27202440, 0.99806959, 0.99898100, 0.49315722],
-												 [	-6.27265653, -0.00063169, 0.00038710, 7.27202483, 0.99806999, 0.99898121, 0.49315726],
-												 [	-6.27265684, -0.00063157, 0.00038702, 7.27202527, 0.99807038, 0.99898141, 0.49315731],
-												 [	-6.27265714, -0.00063144, 0.00038694, 7.27202571, 0.99807077, 0.99898162, 0.49315737],
-												 [	-6.27265745, -0.00063131, 0.00038686, 7.27202614, 0.99807117, 0.99898183, 0.49315740],
-												 [	-6.27265776, -0.00063118, 0.00038678, 7.27202658, 0.99807156, 0.99898204, 0.49315744],
-												 [	-6.27265807, -0.00063105, 0.00038671, 7.27202702, 0.99807195, 0.99898224, 0.49315747],
-												 [	-6.27265838, -0.00063092, 0.00038663, 7.27202745, 0.99807235, 0.99898245, 0.49315751],
-												 [	-6.27265868, -0.00063079, 0.00038655, 7.27202789, 0.99807274, 0.99898266, 0.49315758],
-												 [	-6.27265899, -0.00063066, 0.00038647, 7.27202833, 0.99807313, 0.99898287, 0.49315760],
-												 [	-6.27265930, -0.00063054, 0.00038639, 7.27202876, 0.99807353, 0.99898307, 0.49315770],
-												 [	-6.27265961, -0.00063041, 0.00038631, 7.27202920, 0.99807392, 0.99898328, 0.49315771],
-												 [	-6.27265991, -0.00063028, 0.00038623, 7.27202963, 0.99807431, 0.99898349, 0.49315780],
-												 [	-6.27266022, -0.00063015, 0.00038615, 7.27203007, 0.99807470, 0.99898369, 0.49315780],
-												 [	-6.27266053, -0.00063002, 0.00038608, 7.27203051, 0.99807510, 0.99898390, 0.49315786],
-												 [	-6.27266083, -0.00062989, 0.00038600, 7.27203094, 0.99807549, 0.99898411, 0.49315792],
-												 [	-6.27266114, -0.00062977, 0.00038592, 7.27203138, 0.99807588, 0.99898432, 0.49315794],
-												 [	-6.27266145, -0.00062964, 0.00038584, 7.27203181, 0.99807627, 0.99898452, 0.49315802],
-												 [	-6.27266175, -0.00062951, 0.00038576, 7.27203224, 0.99807666, 0.99898473, 0.49315805],
-												 [	-6.27266206, -0.00062938, 0.00038568, 7.27203268, 0.99807705, 0.99898493, 0.49315808],
-												 [	-6.27266237, -0.00062925, 0.00038560, 7.27203311, 0.99807744, 0.99898514, 0.49315812],
-												 [	-6.27266267, -0.00062913, 0.00038553, 7.27203355, 0.99807784, 0.99898535, 0.49315818],
-												 [	-6.27266298, -0.00062900, 0.00038545, 7.27203398, 0.99807823, 0.99898555, 0.49315821],
-												 [	-6.27266329, -0.00062887, 0.00038537, 7.27203441, 0.99807862, 0.99898576, 0.49315828],
-												 [	-6.27266359, -0.00062874, 0.00038529, 7.27203485, 0.99807901, 0.99898597, 0.49315830],
-												 [	-6.27266390, -0.00062862, 0.00038521, 7.27203528, 0.99807940, 0.99898617, 0.49315836],
-												 [	-6.27266420, -0.00062849, 0.00038513, 7.27203571, 0.99807979, 0.99898638, 0.49315841],
-												 [	-6.27266451, -0.00062836, 0.00038506, 7.27203615, 0.99808018, 0.99898658, 0.49315847],
-												 [	-6.27266481, -0.00062823, 0.00038498, 7.27203658, 0.99808057, 0.99898679, 0.49315850],
-												 [	-6.27266512, -0.00062811, 0.00038490, 7.27203701, 0.99808096, 0.99898700, 0.49315856],
-												 [	-6.27266542, -0.00062798, 0.00038482, 7.27203744, 0.99808135, 0.99898720, 0.49315859],
-												 [	-6.27266573, -0.00062785, 0.00038474, 7.27203788, 0.99808174, 0.99898741, 0.49315862],
-												 [	-6.27266603, -0.00062772, 0.00038467, 7.27203831, 0.99808213, 0.99898761, 0.49315867],
-												 [	-6.27266634, -0.00062760, 0.00038459, 7.27203874, 0.99808251, 0.99898782, 0.49315875],
-												 [	-6.27266664, -0.00062747, 0.00038451, 7.27203917, 0.99808290, 0.99898802, 0.49315880],
-												 [	-6.27266695, -0.00062734, 0.00038443, 7.27203960, 0.99808329, 0.99898823, 0.49315883],
-												 [	-6.27266725, -0.00062721, 0.00038435, 7.27204004, 0.99808368, 0.99898843, 0.49315887],
-												 [	-6.27266755, -0.00062709, 0.00038428, 7.27204047, 0.99808407, 0.99898864, 0.49315892],
-												 [	-6.27266786, -0.00062696, 0.00038420, 7.27204090, 0.99808446, 0.99898884, 0.49315895],
-												 [	-6.27266816, -0.00062683, 0.00038412, 7.27204133, 0.99808485, 0.99898905, 0.49315899],
-												 [	-6.27266847, -0.00062671, 0.00038404, 7.27204176, 0.99808523, 0.99898925, 0.49315906],
-												 [	-6.27266877, -0.00062658, 0.00038396, 7.27204219, 0.99808562, 0.99898946, 0.49315910],
-												 [	-6.27266907, -0.00062645, 0.00038389, 7.27204262, 0.99808601, 0.99898966, 0.49315911],
-												 [	-6.27266938, -0.00062633, 0.00038381, 7.27204305, 0.99808640, 0.99898987, 0.49315917],
-												 [	-6.27266968, -0.00062620, 0.00038373, 7.27204348, 0.99808678, 0.99899007, 0.49315922],
-												 [	-6.27266998, -0.00062607, 0.00038365, 7.27204391, 0.99808717, 0.99899027, 0.49315926],
-												 [	-6.27267028, -0.00062595, 0.00038358, 7.27204434, 0.99808756, 0.99899048, 0.49315930],
-												 [	-6.27267059, -0.00062582, 0.00038350, 7.27204477, 0.99808794, 0.99899068, 0.49315934],
-												 [	-6.27267089, -0.00062569, 0.00038342, 7.27204520, 0.99808833, 0.99899089, 0.49315940],
-												 [	-6.27267119, -0.00062557, 0.00038334, 7.27204563, 0.99808872, 0.99899109, 0.49315945],
-												 [	-6.27267150, -0.00062544, 0.00038327, 7.27204606, 0.99808910, 0.99899129, 0.49315950],
-												 [	-6.27267180, -0.00062531, 0.00038319, 7.27204648, 0.99808949, 0.99899150, 0.49315953],
-												 [	-6.27267210, -0.00062519, 0.00038311, 7.27204691, 0.99808988, 0.99899170, 0.49315956],
-												 [	-6.27267240, -0.00062506, 0.00038303, 7.27204734, 0.99809026, 0.99899191, 0.49315961],
-												 [	-6.27267270, -0.00062494, 0.00038296, 7.27204777, 0.99809065, 0.99899211, 0.49315968],
-												 [	-6.27267301, -0.00062481, 0.00038288, 7.27204820, 0.99809103, 0.99899231, 0.49315973],
-												 [	-6.27267331, -0.00062468, 0.00038280, 7.27204863, 0.99809142, 0.99899252, 0.49315977],
-												 [	-6.27267361, -0.00062456, 0.00038272, 7.27204905, 0.99809180, 0.99899272, 0.49315980],
-												 [	-6.27267391, -0.00062443, 0.00038265, 7.27204948, 0.99809219, 0.99899292, 0.49315984],
-												 [	-6.27267421, -0.00062431, 0.00038257, 7.27204991, 0.99809257, 0.99899313, 0.49315989],
-												 [	-6.27267451, -0.00062418, 0.00038249, 7.27205033, 0.99809296, 0.99899333, 0.49315993],
-												 [	-6.27267481, -0.00062405, 0.00038241, 7.27205076, 0.99809334, 0.99899353, 0.49315999],
-												 [	-6.27267512, -0.00062393, 0.00038234, 7.27205119, 0.99809373, 0.99899373, 0.49316004],
-												 [	-6.27267542, -0.00062380, 0.00038226, 7.27205162, 0.99809411, 0.99899394, 0.49316007],
-												 [	-6.27267572, -0.00062368, 0.00038218, 7.27205204, 0.99809450, 0.99899414, 0.49316011],
-												 [	-6.27267602, -0.00062355, 0.00038211, 7.27205247, 0.99809488, 0.99899434, 0.49316016],
-												 [	-6.27267632, -0.00062342, 0.00038203, 7.27205289, 0.99809527, 0.99899455, 0.49316020],
-												 [	-6.27267662, -0.00062330, 0.00038195, 7.27205332, 0.99809565, 0.99899475, 0.49316023],
-												 [	-6.27267692, -0.00062317, 0.00038188, 7.27205375, 0.99809603, 0.99899495, 0.49316033],
-												 [	-6.27267722, -0.00062305, 0.00038180, 7.27205417, 0.99809642, 0.99899515, 0.49316032],
-												 [	-6.27267752, -0.00062292, 0.00038172, 7.27205460, 0.99809680, 0.99899536, 0.49316037],
-												 [	-6.27267782, -0.00062280, 0.00038164, 7.27205502, 0.99809718, 0.99899556, 0.49316043],
-												 [	-6.27267812, -0.00062267, 0.00038157, 7.27205545, 0.99809757, 0.99899576, 0.49316049],
-												 [	-6.27267842, -0.00062255, 0.00038149, 7.27205587, 0.99809795, 0.99899596, 0.49316053],
-												 [	-6.27267872, -0.00062242, 0.00038141, 7.27205630, 0.99809833, 0.99899616, 0.49316060],
-												 [	-6.27267902, -0.00062230, 0.00038134, 7.27205672, 0.99809871, 0.99899637, 0.49316061],
-												 [	-6.27267932, -0.00062217, 0.00038126, 7.27205715, 0.99809910, 0.99899657, 0.49316068],
-												 [	-6.27267962, -0.00062205, 0.00038118, 7.27205757, 0.99809948, 0.99899677, 0.49316072],
-												 [	-6.27267992, -0.00062192, 0.00038111, 7.27205799, 0.99809986, 0.99899697, 0.49316074],
-												 [	-6.27268021, -0.00062180, 0.00038103, 7.27205842, 0.99810024, 0.99899717, 0.49316079],
-												 [	-6.27268051, -0.00062167, 0.00038095, 7.27205884, 0.99810062, 0.99899737, 0.49316083],
-												 [	-6.27268081, -0.00062155, 0.00038088, 7.27205927, 0.99810100, 0.99899757, 0.49316088],
-												 [	-6.27268111, -0.00062142, 0.00038080, 7.27205969, 0.99810139, 0.99899778, 0.49316090],
-												 [	-6.27268141, -0.00062130, 0.00038072, 7.27206011, 0.99810177, 0.99899798, 0.49316099],
-												 [	-6.27268171, -0.00062117, 0.00038065, 7.27206053, 0.99810215, 0.99899818, 0.49316102],
-												 [	-6.27268201, -0.00062105, 0.00038057, 7.27206096, 0.99810253, 0.99899838, 0.49316107],
-												 [	-6.27268230, -0.00062092, 0.00038050, 7.27206138, 0.99810291, 0.99899858, 0.49316107],
-												 [	-6.27268260, -0.00062080, 0.00038042, 7.27206180, 0.99810329, 0.99899878, 0.49316112],
-												 [	-6.27268290, -0.00062067, 0.00038034, 7.27206223, 0.99810367, 0.99899898, 0.49316121],
-												 [	-6.27268320, -0.00062055, 0.00038027, 7.27206265, 0.99810405, 0.99899918, 0.49316122],
-												 [	-6.27268350, -0.00062043, 0.00038019, 7.27206307, 0.99810443, 0.99899938, 0.49316127],
-												 [	-6.27268379, -0.00062030, 0.00038011, 7.27206349, 0.99810481, 0.99899958, 0.49316133],
-												 [	-6.27268409, -0.00062018, 0.00038004, 7.27206391, 0.99810519, 0.99899978, 0.49316137],
-												 [	-6.27268439, -0.00062005, 0.00037996, 7.27206433, 0.99810557, 0.99899999, 0.49316141],
-												 [	-6.27268468, -0.00061993, 0.00037989, 7.27206476, 0.99810595, 0.99900019, 0.49316145],
-												 [	-6.27268498, -0.00061980, 0.00037981, 7.27206518, 0.99810633, 0.99900039, 0.49316150],
-												 [	-6.27268528, -0.00061968, 0.00037973, 7.27206560, 0.99810671, 0.99900059, 0.49316152],
-												 [	-6.27268558, -0.00061956, 0.00037966, 7.27206602, 0.99810709, 0.99900079, 0.49316158],
-												 [	-6.27268587, -0.00061943, 0.00037958, 7.27206644, 0.99810747, 0.99900099, 0.49316160],
-												 [	-6.27268617, -0.00061931, 0.00037951, 7.27206686, 0.99810785, 0.99900119, 0.49316174],
-												 [	-6.27268647, -0.00061919, 0.00037943, 7.27206728, 0.99810823, 0.99900139, 0.49316174],
-												 [	-6.27268676, -0.00061906, 0.00037935, 7.27206770, 0.99810860, 0.99900159, 0.49316173],
-												 [	-6.27268706, -0.00061894, 0.00037928, 7.27206812, 0.99810898, 0.99900179, 0.49316182],
-												 [	-6.27268735, -0.00061881, 0.00037920, 7.27206854, 0.99810936, 0.99900198, 0.49316185],
-												 [	-6.27268765, -0.00061869, 0.00037913, 7.27206896, 0.99810974, 0.99900218, 0.49316190],
-												 [	-6.27268795, -0.00061857, 0.00037905, 7.27206938, 0.99811012, 0.99900238, 0.49316194],
-												 [	-6.27268824, -0.00061844, 0.00037897, 7.27206980, 0.99811049, 0.99900258, 0.49316199],
-												 [	-6.27268854, -0.00061832, 0.00037890, 7.27207022, 0.99811087, 0.99900278, 0.49316201],
-												 [	-6.27268883, -0.00061820, 0.00037882, 7.27207064, 0.99811125, 0.99900298, 0.49316207],
-												 [	-6.27268913, -0.00061807, 0.00037875, 7.27207106, 0.99811163, 0.99900318, 0.49316215],
-												 [	-6.27268942, -0.00061795, 0.00037867, 7.27207147, 0.99811200, 0.99900338, 0.49316215],
-												 [	-6.27268972, -0.00061783, 0.00037860, 7.27207189, 0.99811238, 0.99900358, 0.49316222],
-												 [	-6.27269001, -0.00061770, 0.00037852, 7.27207231, 0.99811276, 0.99900378, 0.49316225],
-												 [	-6.27269031, -0.00061758, 0.00037844, 7.27207273, 0.99811313, 0.99900398, 0.49316226],
-												 [	-6.27269060, -0.00061746, 0.00037837, 7.27207315, 0.99811351, 0.99900418, 0.49316232],
-												 [	-6.27269090, -0.00061733, 0.00037829, 7.27207356, 0.99811389, 0.99900437, 0.49316241],
-												 [	-6.27269119, -0.00061721, 0.00037822, 7.27207398, 0.99811426, 0.99900457, 0.49316240],
-												 [	-6.27269149, -0.00061709, 0.00037814, 7.27207440, 0.99811464, 0.99900477, 0.49316244],
-												 [	-6.27269178, -0.00061696, 0.00037807, 7.27207482, 0.99811502, 0.99900497, 0.49316250],
-												 [	-6.27269208, -0.00061684, 0.00037799, 7.27207523, 0.99811539, 0.99900517, 0.49316255],
-												 [	-6.27269237, -0.00061672, 0.00037792, 7.27207565, 0.99811577, 0.99900537, 0.49316260],
-												 [	-6.27269266, -0.00061660, 0.00037784, 7.27207607, 0.99811614, 0.99900556, 0.49316268],
-												 [	-6.27269296, -0.00061647, 0.00037777, 7.27207648, 0.99811652, 0.99900576, 0.49316264],
-												 [	-6.27269325, -0.00061635, 0.00037769, 7.27207690, 0.99811689, 0.99900596, 0.49316274],
-												 [	-6.27269354, -0.00061623, 0.00037762, 7.27207732, 0.99811727, 0.99900616, 0.49316275],
-												 [	-6.27269384, -0.00061610, 0.00037754, 7.27207773, 0.99811764, 0.99900636, 0.49316280],
-												 [	-6.27269413, -0.00061598, 0.00037746, 7.27207815, 0.99811802, 0.99900655, 0.49316280],
-												 [	-6.27269442, -0.00061586, 0.00037739, 7.27207857, 0.99811839, 0.99900675, 0.49316288],
-												 [	-6.27269472, -0.00061574, 0.00037731, 7.27207898, 0.99811877, 0.99900695, 0.49316293],
-												 [	-6.27269501, -0.00061561, 0.00037724, 7.27207940, 0.99811914, 0.99900715, 0.49316299],
-												 [	-6.27269530, -0.00061549, 0.00037716, 7.27207981, 0.99811952, 0.99900734, 0.49316305],
-												 [	-6.27269560, -0.00061537, 0.00037709, 7.27208023, 0.99811989, 0.99900754, 0.49316305],
-												 [	-6.27269589, -0.00061525, 0.00037701, 7.27208064, 0.99812026, 0.99900774, 0.49316309],
-												 [	-6.27269618, -0.00061512, 0.00037694, 7.27208106, 0.99812064, 0.99900794, 0.49316319],
-												 [	-6.27269647, -0.00061500, 0.00037686, 7.27208147, 0.99812101, 0.99900813, 0.49316320],
-												 [	-6.27269677, -0.00061488, 0.00037679, 7.27208189, 0.99812138, 0.99900833, 0.49316326],
-												 [	-6.27269706, -0.00061476, 0.00037671, 7.27208230, 0.99812176, 0.99900853, 0.49316331],
-												 [	-6.27269735, -0.00061464, 0.00037664, 7.27208271, 0.99812213, 0.99900872, 0.49316334],
-												 [	-6.27269764, -0.00061451, 0.00037656, 7.27208313, 0.99812250, 0.99900892, 0.49316337],
-												 [	-6.27269793, -0.00061439, 0.00037649, 7.27208354, 0.99812288, 0.99900912, 0.49316343],
-												 [	-6.27269823, -0.00061427, 0.00037642, 7.27208396, 0.99812325, 0.99900931, 0.49316350],
-												 [	-6.27269852, -0.00061415, 0.00037634, 7.27208437, 0.99812362, 0.99900951, 0.49316348],
-												 [	-6.27269881, -0.00061403, 0.00037627, 7.27208478, 0.99812399, 0.99900971, 0.49316356],
-												 [	-6.27269910, -0.00061390, 0.00037619, 7.27208520, 0.99812437, 0.99900990, 0.49316359],
-												 [	-6.27269939, -0.00061378, 0.00037612, 7.27208561, 0.99812474, 0.99901010, 0.49316364],
-												 [	-6.27269968, -0.00061366, 0.00037604, 7.27208602, 0.99812511, 0.99901030, 0.49316368],
-												 [	-6.27269997, -0.00061354, 0.00037597, 7.27208643, 0.99812548, 0.99901049, 0.49316372],
-												 [	-6.27270027, -0.00061342, 0.00037589, 7.27208685, 0.99812585, 0.99901069, 0.49316379],
-												 [	-6.27270056, -0.00061330, 0.00037582, 7.27208726, 0.99812623, 0.99901089, 0.49316380],
-												 [	-6.27270085, -0.00061318, 0.00037574, 7.27208767, 0.99812660, 0.99901108, 0.49316383],
-												 [	-6.27270114, -0.00061305, 0.00037567, 7.27208808, 0.99812697, 0.99901128, 0.49316392],
-												 [	-6.27270143, -0.00061293, 0.00037559, 7.27208850, 0.99812734, 0.99901147, 0.49316393],
-												 [	-6.27270172, -0.00061281, 0.00037552, 7.27208891, 0.99812771, 0.99901167, 0.49316398],
-												 [	-6.27270201, -0.00061269, 0.00037545, 7.27208932, 0.99812808, 0.99901186, 0.49316403],
-												 [	-6.27270230, -0.00061257, 0.00037537, 7.27208973, 0.99812845, 0.99901206, 0.49316407],
-												 [	-6.27270259, -0.00061245, 0.00037530, 7.27209014, 0.99812882, 0.99901226, 0.49316411],
-												 [	-6.27270288, -0.00061233, 0.00037522, 7.27209055, 0.99812919, 0.99901245, 0.49316419],
-												 [	-6.27270317, -0.00061221, 0.00037515, 7.27209096, 0.99812956, 0.99901265, 0.49316420],
-												 [	-6.27270346, -0.00061208, 0.00037507, 7.27209137, 0.99812993, 0.99901284, 0.49316424],
-												 [	-6.27270375, -0.00061196, 0.00037500, 7.27209178, 0.99813030, 0.99901304, 0.49316431],
-												 [	-6.27270404, -0.00061184, 0.00037493, 7.27209219, 0.99813067, 0.99901323, 0.49316432],
-												 [	-6.27270433, -0.00061172, 0.00037485, 7.27209260, 0.99813104, 0.99901343, 0.49316435],
-												 [	-6.27270462, -0.00061160, 0.00037478, 7.27209301, 0.99813141, 0.99901362, 0.49316437],
-												 [	-6.27270490, -0.00061148, 0.00037470, 7.27209342, 0.99813178, 0.99901382, 0.49316447],
-												 [	-6.27270519, -0.00061136, 0.00037463, 7.27209383, 0.99813215, 0.99901401, 0.49316452],
-												 [	-6.27270548, -0.00061124, 0.00037456, 7.27209424, 0.99813252, 0.99901421, 0.49316453],
-												 [	-6.27270577, -0.00061112, 0.00037448, 7.27209465, 0.99813289, 0.99901440, 0.49316460],
-												 [	-6.27270606, -0.00061100, 0.00037441, 7.27209506, 0.99813326, 0.99901460, 0.49316462],
-												 [	-6.27270635, -0.00061088, 0.00037433, 7.27209547, 0.99813362, 0.99901479, 0.49316468],
-												 [	-6.27270664, -0.00061076, 0.00037426, 7.27209588, 0.99813399, 0.99901498, 0.49316472],
-												 [	-6.27270692, -0.00061064, 0.00037419, 7.27209629, 0.99813436, 0.99901518, 0.49316476],
-												 [	-6.27270721, -0.00061051, 0.00037411, 7.27209670, 0.99813473, 0.99901537, 0.49316483],
-												 [	-6.27270750, -0.00061039, 0.00037404, 7.27209711, 0.99813510, 0.99901557, 0.49316482],
-												 [	-6.27270779, -0.00061027, 0.00037396, 7.27209751, 0.99813547, 0.99901576, 0.49316493],
-												 [	-6.27270808, -0.00061015, 0.00037389, 7.27209792, 0.99813583, 0.99901596, 0.49316495],
-												 [	-6.27270836, -0.00061003, 0.00037382, 7.27209833, 0.99813620, 0.99901615, 0.49316498],
-												 [	-6.27270865, -0.00060991, 0.00037374, 7.27209874, 0.99813657, 0.99901634, 0.49316501],
-												 [	-6.27270894, -0.00060979, 0.00037367, 7.27209915, 0.99813694, 0.99901654, 0.49316504],
-												 [	-6.27270923, -0.00060967, 0.00037360, 7.27209955, 0.99813730, 0.99901673, 0.49316509],
-												 [	-6.27270951, -0.00060955, 0.00037352, 7.27209996, 0.99813767, 0.99901692, 0.49316516],
-												 [	-6.27270980, -0.00060943, 0.00037345, 7.27210037, 0.99813804, 0.99901712, 0.49316521],
-												 [	-6.27271009, -0.00060931, 0.00037338, 7.27210078, 0.99813840, 0.99901731, 0.49316522],
-												 [	-6.27271038, -0.00060919, 0.00037330, 7.27210118, 0.99813877, 0.99901751, 0.49316529],
-												 [	-6.27271066, -0.00060907, 0.00037323, 7.27210159, 0.99813914, 0.99901770, 0.49316533],
-												 [	-6.27271095, -0.00060895, 0.00037315, 7.27210200, 0.99813950, 0.99901789, 0.49316538],
-												 [	-6.27271124, -0.00060883, 0.00037308, 7.27210240, 0.99813987, 0.99901808, 0.49316545],
-												 [	-6.27271152, -0.00060871, 0.00037301, 7.27210281, 0.99814023, 0.99901828, 0.49316550],
-												 [	-6.27271181, -0.00060859, 0.00037293, 7.27210321, 0.99814060, 0.99901847, 0.49316550],
-												 [	-6.27271209, -0.00060847, 0.00037286, 7.27210362, 0.99814097, 0.99901866, 0.49316554],
-												 [	-6.27271238, -0.00060836, 0.00037279, 7.27210403, 0.99814133, 0.99901886, 0.49316555],
-												 [	-6.27271267, -0.00060824, 0.00037271, 7.27210443, 0.99814170, 0.99901905, 0.49316564],
-												 [	-6.27271295, -0.00060812, 0.00037264, 7.27210484, 0.99814206, 0.99901924, 0.49316569],
-												 [	-6.27271324, -0.00060800, 0.00037257, 7.27210524, 0.99814243, 0.99901944, 0.49316569],
-												 [	-6.27271352, -0.00060788, 0.00037249, 7.27210565, 0.99814279, 0.99901963, 0.49316572],
-												 [	-6.27271381, -0.00060776, 0.00037242, 7.27210605, 0.99814316, 0.99901982, 0.49316582],
-												 [	-6.27271410, -0.00060764, 0.00037235, 7.27210646, 0.99814352, 0.99902001, 0.49316585],
-												 [	-6.27271438, -0.00060752, 0.00037228, 7.27210686, 0.99814389, 0.99902021, 0.49316587],
-												 [	-6.27271467, -0.00060740, 0.00037220, 7.27210727, 0.99814425, 0.99902040, 0.49316592],
-												 [	-6.27271495, -0.00060728, 0.00037213, 7.27210767, 0.99814461, 0.99902059, 0.49316598],
-												 [	-6.27271524, -0.00060716, 0.00037206, 7.27210807, 0.99814498, 0.99902078, 0.49316599],
-												 [	-6.27271552, -0.00060704, 0.00037198, 7.27210848, 0.99814534, 0.99902097, 0.49316604],
-												 [	-6.27271581, -0.00060692, 0.00037191, 7.27210888, 0.99814571, 0.99902117, 0.49316608],
-												 [	-6.27271609, -0.00060680, 0.00037184, 7.27210929, 0.99814607, 0.99902136, 0.49316611],
-												 [	-6.27271637, -0.00060669, 0.00037176, 7.27210969, 0.99814643, 0.99902155, 0.49316616],
-												 [	-6.27271666, -0.00060657, 0.00037169, 7.27211009, 0.99814680, 0.99902174, 0.49316618],
-												 [	-6.27271694, -0.00060645, 0.00037162, 7.27211050, 0.99814716, 0.99902193, 0.49316624],
-												 [	-6.27271723, -0.00060633, 0.00037155, 7.27211090, 0.99814752, 0.99902213, 0.49316630],
-												 [	-6.27271751, -0.00060621, 0.00037147, 7.27211130, 0.99814789, 0.99902232, 0.49316633],
-												 [	-6.27271780, -0.00060609, 0.00037140, 7.27211170, 0.99814825, 0.99902251, 0.49316640],
-												 [	-6.27271808, -0.00060597, 0.00037133, 7.27211211, 0.99814861, 0.99902270, 0.49316642],
-												 [	-6.27271836, -0.00060585, 0.00037125, 7.27211251, 0.99814897, 0.99902289, 0.49316649],
-												 [	-6.27271865, -0.00060574, 0.00037118, 7.27211291, 0.99814934, 0.99902308, 0.49316653],
-												 [	-6.27271893, -0.00060562, 0.00037111, 7.27211331, 0.99814970, 0.99902327, 0.49316657],
-												 [	-6.27271921, -0.00060550, 0.00037104, 7.27211371, 0.99815006, 0.99902346, 0.49316659],
-												 [	-6.27271950, -0.00060538, 0.00037096, 7.27211412, 0.99815042, 0.99902366, 0.49316664],
-												 [	-6.27271978, -0.00060526, 0.00037089, 7.27211452, 0.99815079, 0.99902385, 0.49316670],
-												 [	-6.27272006, -0.00060514, 0.00037082, 7.27211492, 0.99815115, 0.99902404, 0.49316670],
-												 [	-6.27272035, -0.00060503, 0.00037075, 7.27211532, 0.99815151, 0.99902423, 0.49316673],
-												 [	-6.27272063, -0.00060491, 0.00037067, 7.27211572, 0.99815187, 0.99902442, 0.49316679],
-												 [	-6.27272091, -0.00060479, 0.00037060, 7.27211612, 0.99815223, 0.99902461, 0.49316685],
-												 [	-6.27272120, -0.00060467, 0.00037053, 7.27211652, 0.99815259, 0.99902480, 0.49316688],
-												 [	-6.27272148, -0.00060455, 0.00037046, 7.27211692, 0.99815295, 0.99902499, 0.49316692],
-												 [	-6.27272176, -0.00060444, 0.00037038, 7.27211732, 0.99815331, 0.99902518, 0.49316699],
-												 [	-6.27272204, -0.00060432, 0.00037031, 7.27211773, 0.99815367, 0.99902537, 0.49316698],
-												 [	-6.27272232, -0.00060420, 0.00037024, 7.27211813, 0.99815404, 0.99902556, 0.49316707],
-												 [	-6.27272261, -0.00060408, 0.00037017, 7.27211853, 0.99815440, 0.99902575, 0.49316710],
-												 [	-6.27272289, -0.00060396, 0.00037009, 7.27211893, 0.99815476, 0.99902594, 0.49316715],
-												 [	-6.27272317, -0.00060385, 0.00037002, 7.27211933, 0.99815512, 0.99902613, 0.49316718],
-												 [	-6.27272345, -0.00060373, 0.00036995, 7.27211972, 0.99815548, 0.99902632, 0.49316722],
-												 [	-6.27272373, -0.00060361, 0.00036988, 7.27212012, 0.99815584, 0.99902651, 0.49316726],
-												 [	-6.27272402, -0.00060349, 0.00036981, 7.27212052, 0.99815620, 0.99902670, 0.49316729],
-												 [	-6.27272430, -0.00060337, 0.00036973, 7.27212092, 0.99815656, 0.99902689, 0.49316735],
-												 [	-6.27272458, -0.00060326, 0.00036966, 7.27212132, 0.99815691, 0.99902708, 0.49316741],
-												 [	-6.27272486, -0.00060314, 0.00036959, 7.27212172, 0.99815727, 0.99902727, 0.49316741],
-												 [	-6.27272514, -0.00060302, 0.00036952, 7.27212212, 0.99815763, 0.99902746, 0.49316748],
-												 [	-6.27272542, -0.00060290, 0.00036945, 7.27212252, 0.99815799, 0.99902765, 0.49316753],
-												 [	-6.27272570, -0.00060279, 0.00036937, 7.27212292, 0.99815835, 0.99902784, 0.49316756],
-												 [	-6.27272598, -0.00060267, 0.00036930, 7.27212331, 0.99815871, 0.99902803, 0.49316761],
-												 [	-6.27272626, -0.00060255, 0.00036923, 7.27212371, 0.99815907, 0.99902822, 0.49316767],
-												 [	-6.27272654, -0.00060244, 0.00036916, 7.27212411, 0.99815943, 0.99902841, 0.49316768],
-												 [	-6.27272683, -0.00060232, 0.00036909, 7.27212451, 0.99815978, 0.99902860, 0.49316772],
-												 [	-6.27272711, -0.00060220, 0.00036901, 7.27212490, 0.99816014, 0.99902879, 0.49316778],
-												 [	-6.27272739, -0.00060208, 0.00036894, 7.27212530, 0.99816050, 0.99902897, 0.49316778],
-												 [	-6.27272767, -0.00060197, 0.00036887, 7.27212570, 0.99816086, 0.99902916, 0.49316783],
-												 [	-6.27272795, -0.00060185, 0.00036880, 7.27212610, 0.99816122, 0.99902935, 0.49316788],
-												 [	-6.27272823, -0.00060173, 0.00036873, 7.27212649, 0.99816157, 0.99902954, 0.49316787],
-												 [	-6.27272851, -0.00060162, 0.00036865, 7.27212689, 0.99816193, 0.99902973, 0.49316799],
-												 [	-6.27272879, -0.00060150, 0.00036858, 7.27212729, 0.99816229, 0.99902992, 0.49316801],
-												 [	-6.27272907, -0.00060138, 0.00036851, 7.27212768, 0.99816265, 0.99903011, 0.49316805],
-												 [	-6.27272934, -0.00060127, 0.00036844, 7.27212808, 0.99816300, 0.99903029, 0.49316810],
-												 [	-6.27272962, -0.00060115, 0.00036837, 7.27212848, 0.99816336, 0.99903048, 0.49316812],
-												 [	-6.27272990, -0.00060103, 0.00036830, 7.27212887, 0.99816372, 0.99903067, 0.49316815],
-												 [	-6.27273018, -0.00060092, 0.00036823, 7.27212927, 0.99816407, 0.99903086, 0.49316824],
-												 [	-6.27273046, -0.00060080, 0.00036815, 7.27212966, 0.99816443, 0.99903105, 0.49316825],
-												 [	-6.27273074, -0.00060068, 0.00036808, 7.27213006, 0.99816479, 0.99903124, 0.49316832],
-												 [	-6.27273102, -0.00060057, 0.00036801, 7.27213045, 0.99816514, 0.99903142, 0.49316835],
-												 [	-6.27273130, -0.00060045, 0.00036794, 7.27213085, 0.99816550, 0.99903161, 0.49316839],
-												 [	-6.27273158, -0.00060033, 0.00036787, 7.27213124, 0.99816585, 0.99903180, 0.49316844],
-												 [	-6.27273186, -0.00060022, 0.00036780, 7.27213164, 0.99816621, 0.99903199, 0.49316848],
-												 [	-6.27273213, -0.00060010, 0.00036773, 7.27213203, 0.99816657, 0.99903218, 0.49316850],
-												 [	-6.27273241, -0.00059998, 0.00036765, 7.27213243, 0.99816692, 0.99903236, 0.49316856],
-												 [	-6.27273269, -0.00059987, 0.00036758, 7.27213282, 0.99816728, 0.99903255, 0.49316861],
-												 [	-6.27273297, -0.00059975, 0.00036751, 7.27213322, 0.99816763, 0.99903274, 0.49316864],
-												 [	-6.27273325, -0.00059963, 0.00036744, 7.27213361, 0.99816799, 0.99903293, 0.49316869],
-												 [	-6.27273352, -0.00059952, 0.00036737, 7.27213401, 0.99816834, 0.99903311, 0.49316872],
-												 [	-6.27273380, -0.00059940, 0.00036730, 7.27213440, 0.99816870, 0.99903330, 0.49316876],
-												 [	-6.27273408, -0.00059929, 0.00036723, 7.27213479, 0.99816905, 0.99903349, 0.49316877],
-												 [	-6.27273436, -0.00059917, 0.00036716, 7.27213519, 0.99816941, 0.99903367, 0.49316887],
-												 [	-6.27273463, -0.00059905, 0.00036708, 7.27213558, 0.99816976, 0.99903386, 0.49316888],
-												 [	-6.27273491, -0.00059894, 0.00036701, 7.27213597, 0.99817012, 0.99903405, 0.49316895],
-												 [	-6.27273519, -0.00059882, 0.00036694, 7.27213637, 0.99817047, 0.99903424, 0.49316897],
-												 [	-6.27273547, -0.00059871, 0.00036687, 7.27213676, 0.99817082, 0.99903442, 0.49316901],
-												 [	-6.27273574, -0.00059859, 0.00036680, 7.27213715, 0.99817118, 0.99903461, 0.49316906],
-												 [	-6.27273602, -0.00059848, 0.00036673, 7.27213754, 0.99817153, 0.99903480, 0.49316911],
-												 [	-6.27273630, -0.00059836, 0.00036666, 7.27213794, 0.99817189, 0.99903498, 0.49316913],
-												 [	-6.27273657, -0.00059824, 0.00036659, 7.27213833, 0.99817224, 0.99903517, 0.49316914],
-												 [	-6.27273685, -0.00059813, 0.00036652, 7.27213872, 0.99817259, 0.99903535, 0.49316924],
-												 [	-6.27273713, -0.00059801, 0.00036645, 7.27213911, 0.99817295, 0.99903554, 0.49316926],
-												 [	-6.27273740, -0.00059790, 0.00036637, 7.27213951, 0.99817330, 0.99903573, 0.49316930],
-												 [	-6.27273768, -0.00059778, 0.00036630, 7.27213990, 0.99817365, 0.99903591, 0.49316938],
-												 [	-6.27273796, -0.00059767, 0.00036623, 7.27214029, 0.99817400, 0.99903610, 0.49316938],
-												 [	-6.27273823, -0.00059755, 0.00036616, 7.27214068, 0.99817436, 0.99903629, 0.49316938],
-												 [	-6.27273851, -0.00059744, 0.00036609, 7.27214107, 0.99817471, 0.99903647, 0.49316946],
-												 [	-6.27273878, -0.00059732, 0.00036602, 7.27214146, 0.99817506, 0.99903666, 0.49316948],
-												 [	-6.27273906, -0.00059721, 0.00036595, 7.27214185, 0.99817541, 0.99903684, 0.49316954],
-												 [	-6.27273933, -0.00059709, 0.00036588, 7.27214224, 0.99817577, 0.99903703, 0.49316961],
-												 [	-6.27273961, -0.00059698, 0.00036581, 7.27214263, 0.99817612, 0.99903722, 0.49316964],
-												 [	-6.27273989, -0.00059686, 0.00036574, 7.27214303, 0.99817647, 0.99903740, 0.49316966],
-												 [	-6.27274016, -0.00059674, 0.00036567, 7.27214342, 0.99817682, 0.99903759, 0.49316973],
-												 [	-6.27274044, -0.00059663, 0.00036560, 7.27214381, 0.99817717, 0.99903777, 0.49316976],
-												 [	-6.27274071, -0.00059651, 0.00036553, 7.27214420, 0.99817752, 0.99903796, 0.49316978],
-												 [	-6.27274099, -0.00059640, 0.00036546, 7.27214459, 0.99817788, 0.99903814, 0.49316985],
-												 [	-6.27274126, -0.00059629, 0.00036539, 7.27214498, 0.99817823, 0.99903833, 0.49316985],
-												 [	-6.27274154, -0.00059617, 0.00036532, 7.27214537, 0.99817858, 0.99903851, 0.49316990],
-												 [	-6.27274181, -0.00059606, 0.00036525, 7.27214575, 0.99817893, 0.99903870, 0.49316996],
-												 [	-6.27274208, -0.00059594, 0.00036517, 7.27214614, 0.99817928, 0.99903888, 0.49317001],
-												 [	-6.27274236, -0.00059583, 0.00036510, 7.27214653, 0.99817963, 0.99903907, 0.49317000],
-												 [	-6.27274263, -0.00059571, 0.00036503, 7.27214692, 0.99817998, 0.99903925, 0.49317004],
-												 [	-6.27274291, -0.00059560, 0.00036496, 7.27214731, 0.99818033, 0.99903944, 0.49317008],
-												 [	-6.27274318, -0.00059548, 0.00036489, 7.27214770, 0.99818068, 0.99903962, 0.49317014],
-												 [	-6.27274346, -0.00059537, 0.00036482, 7.27214809, 0.99818103, 0.99903981, 0.49317022],
-												 [	-6.27274373, -0.00059525, 0.00036475, 7.27214848, 0.99818138, 0.99903999, 0.49317024],
-												 [	-6.27274400, -0.00059514, 0.00036468, 7.27214886, 0.99818173, 0.99904018, 0.49317029],
-												 [	-6.27274428, -0.00059502, 0.00036461, 7.27214925, 0.99818208, 0.99904036, 0.49317032],
-												 [	-6.27274455, -0.00059491, 0.00036454, 7.27214964, 0.99818243, 0.99904055, 0.49317037],
-												 [	-6.27274482, -0.00059480, 0.00036447, 7.27215003, 0.99818278, 0.99904073, 0.49317042],
-												 [	-6.27274510, -0.00059468, 0.00036440, 7.27215042, 0.99818313, 0.99904092, 0.49317048],
-												 [	-6.27274537, -0.00059457, 0.00036433, 7.27215080, 0.99818348, 0.99904110, 0.49317047],
-												 [	-6.27274564, -0.00059445, 0.00036426, 7.27215119, 0.99818383, 0.99904128, 0.49317056],
-												 [	-6.27274592, -0.00059434, 0.00036419, 7.27215158, 0.99818418, 0.99904147, 0.49317055],
-												 [	-6.27274619, -0.00059422, 0.00036412, 7.27215197, 0.99818452, 0.99904165, 0.49317062],
-												 [	-6.27274646, -0.00059411, 0.00036405, 7.27215235, 0.99818487, 0.99904184, 0.49317064],
-												 [	-6.27274674, -0.00059400, 0.00036398, 7.27215274, 0.99818522, 0.99904202, 0.49317066],
-												 [	-6.27274701, -0.00059388, 0.00036391, 7.27215313, 0.99818557, 0.99904220, 0.49317073],
-												 [	-6.27274728, -0.00059377, 0.00036384, 7.27215351, 0.99818592, 0.99904239, 0.49317076],
-												 [	-6.27274755, -0.00059365, 0.00036377, 7.27215390, 0.99818627, 0.99904257, 0.49317082],
-												 [	-6.27274783, -0.00059354, 0.00036370, 7.27215428, 0.99818661, 0.99904276, 0.49317086],
-												 [	-6.27274810, -0.00059343, 0.00036363, 7.27215467, 0.99818696, 0.99904294, 0.49317091],
-												 [	-6.27274837, -0.00059331, 0.00036356, 7.27215506, 0.99818731, 0.99904312, 0.49317096],
-												 [	-6.27274864, -0.00059320, 0.00036349, 7.27215544, 0.99818766, 0.99904331, 0.49317092],
-												 [	-6.27274891, -0.00059309, 0.00036342, 7.27215583, 0.99818800, 0.99904349, 0.49317097],
-												 [	-6.27274919, -0.00059297, 0.00036335, 7.27215621, 0.99818835, 0.99904367, 0.49317108],
-												 [	-6.27274946, -0.00059286, 0.00036329, 7.27215660, 0.99818870, 0.99904386, 0.49317108],
-												 [	-6.27274973, -0.00059275, 0.00036322, 7.27215698, 0.99818905, 0.99904404, 0.49317113],
-												 [	-6.27275000, -0.00059263, 0.00036315, 7.27215737, 0.99818939, 0.99904422, 0.49317119],
-												 [	-6.27275027, -0.00059252, 0.00036308, 7.27215775, 0.99818974, 0.99904440, 0.49317125],
-												 [	-6.27275054, -0.00059241, 0.00036301, 7.27215814, 0.99819009, 0.99904459, 0.49317124],
-												 [	-6.27275081, -0.00059229, 0.00036294, 7.27215852, 0.99819043, 0.99904477, 0.49317130],
-												 [	-6.27275109, -0.00059218, 0.00036287, 7.27215891, 0.99819078, 0.99904495, 0.49317131],
-												 [	-6.27275136, -0.00059207, 0.00036280, 7.27215929, 0.99819113, 0.99904514, 0.49317136],
-												 [	-6.27275163, -0.00059195, 0.00036273, 7.27215968, 0.99819147, 0.99904532, 0.49317137],
-												 [	-6.27275190, -0.00059184, 0.00036266, 7.27216006, 0.99819182, 0.99904550, 0.49317148],
-												 [	-6.27275217, -0.00059173, 0.00036259, 7.27216044, 0.99819216, 0.99904568, 0.49317152],
-												 [	-6.27275244, -0.00059161, 0.00036252, 7.27216083, 0.99819251, 0.99904587, 0.49317157],
-												 [	-6.27275271, -0.00059150, 0.00036245, 7.27216121, 0.99819285, 0.99904605, 0.49317157],
-												 [	-6.27275298, -0.00059139, 0.00036238, 7.27216159, 0.99819320, 0.99904623, 0.49317163],
-												 [	-6.27275325, -0.00059127, 0.00036231, 7.27216198, 0.99819355, 0.99904641, 0.49317168],
-												 [	-6.27275352, -0.00059116, 0.00036224, 7.27216236, 0.99819389, 0.99904660, 0.49317166],
-												 [	-6.27275379, -0.00059105, 0.00036217, 7.27216274, 0.99819424, 0.99904678, 0.49317177],
-												 [	-6.27275406, -0.00059094, 0.00036211, 7.27216313, 0.99819458, 0.99904696, 0.49317179],
-												 [	-6.27275433, -0.00059082, 0.00036204, 7.27216351, 0.99819493, 0.99904714, 0.49317185],
-												 [	-6.27275460, -0.00059071, 0.00036197, 7.27216389, 0.99819527, 0.99904732, 0.49317189],
-												 [	-6.27275487, -0.00059060, 0.00036190, 7.27216427, 0.99819561, 0.99904751, 0.49317188],
-												 [	-6.27275514, -0.00059048, 0.00036183, 7.27216466, 0.99819596, 0.99904769, 0.49317197],
-												 [	-6.27275541, -0.00059037, 0.00036176, 7.27216504, 0.99819630, 0.99904787, 0.49317199],
-												 [	-6.27275568, -0.00059026, 0.00036169, 7.27216542, 0.99819665, 0.99904805, 0.49317206],
-												 [	-6.27275595, -0.00059015, 0.00036162, 7.27216580, 0.99819699, 0.99904823, 0.49317206],
-												 [	-6.27275622, -0.00059003, 0.00036155, 7.27216618, 0.99819733, 0.99904841, 0.49317210],
-												 [	-6.27275649, -0.00058992, 0.00036148, 7.27216656, 0.99819768, 0.99904859, 0.49317215],
-												 [	-6.27275675, -0.00058981, 0.00036141, 7.27216695, 0.99819802, 0.99904878, 0.49317218],
-												 [	-6.27275702, -0.00058970, 0.00036135, 7.27216733, 0.99819837, 0.99904896, 0.49317220],
-												 [	-6.27275729, -0.00058958, 0.00036128, 7.27216771, 0.99819871, 0.99904914, 0.49317224],
-												 [	-6.27275756, -0.00058947, 0.00036121, 7.27216809, 0.99819905, 0.99904932, 0.49317231],
-												 [	-6.27275783, -0.00058936, 0.00036114, 7.27216847, 0.99819939, 0.99904950, 0.49317228],
-												 [	-6.27275810, -0.00058925, 0.00036107, 7.27216885, 0.99819974, 0.99904968, 0.49317238],
-												 [	-6.27275837, -0.00058914, 0.00036100, 7.27216923, 0.99820008, 0.99904986, 0.49317241],
-												 [	-6.27275863, -0.00058902, 0.00036093, 7.27216961, 0.99820042, 0.99905004, 0.49317245],
-												 [	-6.27275890, -0.00058891, 0.00036086, 7.27216999, 0.99820077, 0.99905022, 0.49317253],
-												 [	-6.27275917, -0.00058880, 0.00036080, 7.27217037, 0.99820111, 0.99905040, 0.49317256],
-												 [	-6.27275944, -0.00058869, 0.00036073, 7.27217075, 0.99820145, 0.99905059, 0.49317260],
-												 [	-6.27275971, -0.00058858, 0.00036066, 7.27217113, 0.99820179, 0.99905077, 0.49317263],
-												 [	-6.27275997, -0.00058846, 0.00036059, 7.27217151, 0.99820213, 0.99905095, 0.49317270],
-												 [	-6.27276024, -0.00058835, 0.00036052, 7.27217189, 0.99820248, 0.99905113, 0.49317272],
-												 [	-6.27276051, -0.00058824, 0.00036045, 7.27217227, 0.99820282, 0.99905131, 0.49317275],
-												 [	-6.27276078, -0.00058813, 0.00036038, 7.27217265, 0.99820316, 0.99905149, 0.49317277],
-												 [	-6.27276104, -0.00058802, 0.00036032, 7.27217303, 0.99820350, 0.99905167, 0.49317281],
-												 [	-6.27276131, -0.00058790, 0.00036025, 7.27217341, 0.99820384, 0.99905185, 0.49317287],
-												 [	-6.27276158, -0.00058779, 0.00036018, 7.27217378, 0.99820418, 0.99905203, 0.49317289],
-												 [	-6.27276184, -0.00058768, 0.00036011, 7.27217416, 0.99820453, 0.99905221, 0.49317299],
-												 [	-6.27276211, -0.00058757, 0.00036004, 7.27217454, 0.99820487, 0.99905239, 0.49317296],
-												 [	-6.27276238, -0.00058746, 0.00035997, 7.27217492, 0.99820521, 0.99905257, 0.49317302],
-												 [	-6.27276265, -0.00058735, 0.00035991, 7.27217530, 0.99820555, 0.99905275, 0.49317307],
-												 [	-6.27276291, -0.00058724, 0.00035984, 7.27217568, 0.99820589, 0.99905293, 0.49317310],
-												 [	-6.27276318, -0.00058712, 0.00035977, 7.27217605, 0.99820623, 0.99905311, 0.49317316],
-												 [	-6.27276344, -0.00058701, 0.00035970, 7.27217643, 0.99820657, 0.99905329, 0.49317319],
-												 [	-6.27276371, -0.00058690, 0.00035963, 7.27217681, 0.99820691, 0.99905347, 0.49317321],
-												 [	-6.27276398, -0.00058679, 0.00035956, 7.27217719, 0.99820725, 0.99905365, 0.49317328],
-												 [	-6.27276424, -0.00058668, 0.00035950, 7.27217756, 0.99820759, 0.99905383, 0.49317329],
-												 [	-6.27276451, -0.00058657, 0.00035943, 7.27217794, 0.99820793, 0.99905400, 0.49317335],
-												 [	-6.27276478, -0.00058646, 0.00035936, 7.27217832, 0.99820827, 0.99905418, 0.49317337],
-												 [	-6.27276504, -0.00058635, 0.00035929, 7.27217870, 0.99820861, 0.99905436, 0.49317339],
-												 [	-6.27276531, -0.00058623, 0.00035922, 7.27217907, 0.99820895, 0.99905454, 0.49317346],
-												 [	-6.27276557, -0.00058612, 0.00035916, 7.27217945, 0.99820929, 0.99905472, 0.49317350],
-												 [	-6.27276584, -0.00058601, 0.00035909, 7.27217982, 0.99820963, 0.99905490, 0.49317354],
-												 [	-6.27276610, -0.00058590, 0.00035902, 7.27218020, 0.99820997, 0.99905508, 0.49317358],
-												 [	-6.27276637, -0.00058579, 0.00035895, 7.27218058, 0.99821030, 0.99905526, 0.49317361],
-												 [	-6.27276663, -0.00058568, 0.00035888, 7.27218095, 0.99821064, 0.99905544, 0.49317361],
-												 [	-6.27276690, -0.00058557, 0.00035882, 7.27218133, 0.99821098, 0.99905562, 0.49317370],
-												 [	-6.27276716, -0.00058546, 0.00035875, 7.27218170, 0.99821132, 0.99905579, 0.49317372],
-												 [	-6.27276743, -0.00058535, 0.00035868, 7.27218208, 0.99821166, 0.99905597, 0.49317378],
-												 [	-6.27276769, -0.00058524, 0.00035861, 7.27218246, 0.99821200, 0.99905615, 0.49317376],
-												 [	-6.27276796, -0.00058513, 0.00035854, 7.27218283, 0.99821233, 0.99905633, 0.49317387],
-												 [	-6.27276822, -0.00058502, 0.00035848, 7.27218321, 0.99821267, 0.99905651, 0.49317387],
-												 [	-6.27276849, -0.00058491, 0.00035841, 7.27218358, 0.99821301, 0.99905669, 0.49317394],
-												 [	-6.27276875, -0.00058480, 0.00035834, 7.27218396, 0.99821335, 0.99905686, 0.49317397],
-												 [	-6.27276902, -0.00058468, 0.00035827, 7.27218433, 0.99821369, 0.99905704, 0.49317398],
-												 [	-6.27276928, -0.00058457, 0.00035820, 7.27218471, 0.99821402, 0.99905722, 0.49317402],
-												 [	-6.27276954, -0.00058446, 0.00035814, 7.27218508, 0.99821436, 0.99905740, 0.49317408],
-												 [	-6.27276981, -0.00058435, 0.00035807, 7.27218545, 0.99821470, 0.99905758, 0.49317410],
-												 [	-6.27277007, -0.00058424, 0.00035800, 7.27218583, 0.99821504, 0.99905775, 0.49317417],
-												 [	-6.27277034, -0.00058413, 0.00035793, 7.27218620, 0.99821537, 0.99905793, 0.49317422],
-												 [	-6.27277060, -0.00058402, 0.00035787, 7.27218658, 0.99821571, 0.99905811, 0.49317425],
-												 [	-6.27277086, -0.00058391, 0.00035780, 7.27218695, 0.99821605, 0.99905829, 0.49317429],
-												 [	-6.27277113, -0.00058380, 0.00035773, 7.27218732, 0.99821638, 0.99905847, 0.49317428],
-												 [	-6.27277139, -0.00058369, 0.00035766, 7.27218770, 0.99821672, 0.99905864, 0.49317437],
-												 [	-6.27277165, -0.00058358, 0.00035760, 7.27218807, 0.99821706, 0.99905882, 0.49317446],
-												 [	-6.27277192, -0.00058347, 0.00035753, 7.27218844, 0.99821739, 0.99905900, 0.49317445],
-												 [	-6.27277218, -0.00058336, 0.00035746, 7.27218882, 0.99821773, 0.99905918, 0.49317449],
-												 [	-6.27277244, -0.00058325, 0.00035739, 7.27218919, 0.99821806, 0.99905935, 0.49317453],
-												 [	-6.27277270, -0.00058314, 0.00035733, 7.27218956, 0.99821840, 0.99905953, 0.49317457],
-												 [	-6.27277297, -0.00058303, 0.00035726, 7.27218993, 0.99821874, 0.99905971, 0.49317458],
-												 [	-6.27277323, -0.00058292, 0.00035719, 7.27219031, 0.99821907, 0.99905988, 0.49317467],
-												 [	-6.27277349, -0.00058281, 0.00035712, 7.27219068, 0.99821941, 0.99906006, 0.49317464],
-												 [	-6.27277376, -0.00058270, 0.00035706, 7.27219105, 0.99821974, 0.99906024, 0.49317472],
-												 [	-6.27277402, -0.00058259, 0.00035699, 7.27219142, 0.99822008, 0.99906042, 0.49317476],
-												 [	-6.27277428, -0.00058248, 0.00035692, 7.27219180, 0.99822041, 0.99906059, 0.49317478],
-												 [	-6.27277454, -0.00058237, 0.00035686, 7.27219217, 0.99822075, 0.99906077, 0.49317481],
-												 [	-6.27277480, -0.00058227, 0.00035679, 7.27219254, 0.99822108, 0.99906095, 0.49317486],
-												 [	-6.27277507, -0.00058216, 0.00035672, 7.27219291, 0.99822142, 0.99906112, 0.49317492],
-												 [	-6.27277533, -0.00058205, 0.00035665, 7.27219328, 0.99822175, 0.99906130, 0.49317497],
-												 [	-6.27277559, -0.00058194, 0.00035659, 7.27219365, 0.99822209, 0.99906148, 0.49317500],
-												 [	-6.27277585, -0.00058183, 0.00035652, 7.27219402, 0.99822242, 0.99906165, 0.49317504],
-												 [	-6.27277611, -0.00058172, 0.00035645, 7.27219440, 0.99822275, 0.99906183, 0.49317502],
-												 [	-6.27277637, -0.00058161, 0.00035639, 7.27219477, 0.99822309, 0.99906200, 0.49317510],
-												 [	-6.27277664, -0.00058150, 0.00035632, 7.27219514, 0.99822342, 0.99906218, 0.49317515],
-												 [	-6.27277690, -0.00058139, 0.00035625, 7.27219551, 0.99822376, 0.99906236, 0.49317515],
-												 [	-6.27277716, -0.00058128, 0.00035619, 7.27219588, 0.99822409, 0.99906253, 0.49317527],
-												 [	-6.27277742, -0.00058117, 0.00035612, 7.27219625, 0.99822442, 0.99906271, 0.49317521],
-												 [	-6.27277768, -0.00058106, 0.00035605, 7.27219662, 0.99822476, 0.99906289, 0.49317533],
-												 [	-6.27277794, -0.00058095, 0.00035598, 7.27219699, 0.99822509, 0.99906306, 0.49317536],
-												 [	-6.27277820, -0.00058084, 0.00035592, 7.27219736, 0.99822542, 0.99906324, 0.49317532],
-												 [	-6.27277846, -0.00058074, 0.00035585, 7.27219773, 0.99822576, 0.99906341, 0.49317542],
-												 [	-6.27277872, -0.00058063, 0.00035578, 7.27219810, 0.99822609, 0.99906359, 0.49317544],
-												 [	-6.27277898, -0.00058052, 0.00035572, 7.27219847, 0.99822642, 0.99906376, 0.49317549],
-												 [	-6.27277924, -0.00058041, 0.00035565, 7.27219884, 0.99822675, 0.99906394, 0.49317552],
-												 [	-6.27277950, -0.00058030, 0.00035558, 7.27219920, 0.99822709, 0.99906412, 0.49317558],
-												 [	-6.27277977, -0.00058019, 0.00035552, 7.27219957, 0.99822742, 0.99906429, 0.49317562],
-												 [	-6.27278003, -0.00058008, 0.00035545, 7.27219994, 0.99822775, 0.99906447, 0.49317566],
-												 [	-6.27278029, -0.00057997, 0.00035538, 7.27220031, 0.99822808, 0.99906464, 0.49317568],
-												 [	-6.27278055, -0.00057987, 0.00035532, 7.27220068, 0.99822842, 0.99906482, 0.49317573],
-												 [	-6.27278080, -0.00057976, 0.00035525, 7.27220105, 0.99822875, 0.99906499, 0.49317574],
-												 [	-6.27278106, -0.00057965, 0.00035518, 7.27220142, 0.99822908, 0.99906517, 0.49317581],
-												 [	-6.27278132, -0.00057954, 0.00035512, 7.27220178, 0.99822941, 0.99906534, 0.49317584],
-												 [	-6.27278158, -0.00057943, 0.00035505, 7.27220215, 0.99822974, 0.99906552, 0.49317591],
-												 [	-6.27278184, -0.00057932, 0.00035498, 7.27220252, 0.99823008, 0.99906569, 0.49317591],
-												 [	-6.27278210, -0.00057921, 0.00035492, 7.27220289, 0.99823041, 0.99906587, 0.49317595],
-												 [	-6.27278236, -0.00057911, 0.00035485, 7.27220326, 0.99823074, 0.99906604, 0.49317597],
-												 [	-6.27278262, -0.00057900, 0.00035479, 7.27220362, 0.99823107, 0.99906622, 0.49317601],
-												 [	-6.27278288, -0.00057889, 0.00035472, 7.27220399, 0.99823140, 0.99906639, 0.49317609],
-												 [	-6.27278314, -0.00057878, 0.00035465, 7.27220436, 0.99823173, 0.99906657, 0.49317610],
-												 [	-6.27278340, -0.00057867, 0.00035459, 7.27220472, 0.99823206, 0.99906674, 0.49317615],
-												 [	-6.27278366, -0.00057857, 0.00035452, 7.27220509, 0.99823239, 0.99906691, 0.49317621],
-												 [	-6.27278392, -0.00057846, 0.00035445, 7.27220546, 0.99823272, 0.99906709, 0.49317622],
-												 [	-6.27278417, -0.00057835, 0.00035439, 7.27220582, 0.99823305, 0.99906726, 0.49317632],
-												 [	-6.27278443, -0.00057824, 0.00035432, 7.27220619, 0.99823338, 0.99906744, 0.49317629],
-												 [	-6.27278469, -0.00057813, 0.00035425, 7.27220656, 0.99823371, 0.99906761, 0.49317636],
-												 [	-6.27278495, -0.00057802, 0.00035419, 7.27220692, 0.99823404, 0.99906779, 0.49317638],
-												 [	-6.27278521, -0.00057792, 0.00035412, 7.27220729, 0.99823437, 0.99906796, 0.49317641],
-												 [	-6.27278547, -0.00057781, 0.00035406, 7.27220766, 0.99823470, 0.99906813, 0.49317644],
-												 [	-6.27278572, -0.00057770, 0.00035399, 7.27220802, 0.99823503, 0.99906831, 0.49317646],
-												 [	-6.27278598, -0.00057759, 0.00035392, 7.27220839, 0.99823536, 0.99906848, 0.49317651],
-												 [	-6.27278624, -0.00057749, 0.00035386, 7.27220875, 0.99823569, 0.99906866, 0.49317654],
-												 [	-6.27278650, -0.00057738, 0.00035379, 7.27220912, 0.99823602, 0.99906883, 0.49317660],
-												 [	-6.27278675, -0.00057727, 0.00035373, 7.27220948, 0.99823635, 0.99906900, 0.49317666],
-												 [	-6.27278701, -0.00057716, 0.00035366, 7.27220985, 0.99823668, 0.99906918, 0.49317668],
-												 [	-6.27278727, -0.00057706, 0.00035359, 7.27221021, 0.99823701, 0.99906935, 0.49317676],
-												 [	-6.27278753, -0.00057695, 0.00035353, 7.27221058, 0.99823734, 0.99906952, 0.49317676],
-												 [	-6.27278778, -0.00057684, 0.00035346, 7.27221094, 0.99823766, 0.99906970, 0.49317678],
-												 [	-6.27278804, -0.00057673, 0.00035340, 7.27221131, 0.99823799, 0.99906987, 0.49317683],
-												 [	-6.27278830, -0.00057663, 0.00035333, 7.27221167, 0.99823832, 0.99907004, 0.49317687],
-												 [	-6.27278855, -0.00057652, 0.00035326, 7.27221204, 0.99823865, 0.99907022, 0.49317691],
-												 [	-6.27278881, -0.00057641, 0.00035320, 7.27221240, 0.99823898, 0.99907039, 0.49317697],
-												 [	-6.27278907, -0.00057630, 0.00035313, 7.27221277, 0.99823931, 0.99907056, 0.49317699],
-												 [	-6.27278933, -0.00057620, 0.00035307, 7.27221313, 0.99823963, 0.99907074, 0.49317702],
-												 [	-6.27278958, -0.00057609, 0.00035300, 7.27221349, 0.99823996, 0.99907091, 0.49317708],
-												 [	-6.27278984, -0.00057598, 0.00035294, 7.27221386, 0.99824029, 0.99907108, 0.49317710],
-												 [	-6.27279009, -0.00057587, 0.00035287, 7.27221422, 0.99824062, 0.99907126, 0.49317717],
-												 [	-6.27279035, -0.00057577, 0.00035280, 7.27221458, 0.99824094, 0.99907143, 0.49317720],
-												 [	-6.27279061, -0.00057566, 0.00035274, 7.27221495, 0.99824127, 0.99907160, 0.49317720],
-												 [	-6.27279086, -0.00057555, 0.00035267, 7.27221531, 0.99824160, 0.99907177, 0.49317727],
-												 [	-6.27279112, -0.00057545, 0.00035261, 7.27221567, 0.99824193, 0.99907195, 0.49317735],
-												 [	-6.27279137, -0.00057534, 0.00035254, 7.27221604, 0.99824225, 0.99907212, 0.49317732],
-												 [	-6.27279163, -0.00057523, 0.00035248, 7.27221640, 0.99824258, 0.99907229, 0.49317739],
-												 [	-6.27279189, -0.00057513, 0.00035241, 7.27221676, 0.99824291, 0.99907246, 0.49317738],
-												 [	-6.27279214, -0.00057502, 0.00035235, 7.27221712, 0.99824323, 0.99907264, 0.49317745],
-												 [	-6.27279240, -0.00057491, 0.00035228, 7.27221749, 0.99824356, 0.99907281, 0.49317748],
-												 [	-6.27279265, -0.00057480, 0.00035221, 7.27221785, 0.99824389, 0.99907298, 0.49317752],
-												 [	-6.27279291, -0.00057470, 0.00035215, 7.27221821, 0.99824421, 0.99907315, 0.49317757],
-												 [	-6.27279316, -0.00057459, 0.00035208, 7.27221857, 0.99824454, 0.99907332, 0.49317760],
-												 [	-6.27279342, -0.00057448, 0.00035202, 7.27221893, 0.99824486, 0.99907350, 0.49317764],
-												 [	-6.27279367, -0.00057438, 0.00035195, 7.27221930, 0.99824519, 0.99907367, 0.49317766],
-												 [	-6.27279393, -0.00057427, 0.00035189, 7.27221966, 0.99824551, 0.99907384, 0.49317770],
-												 [	-6.27279418, -0.00057417, 0.00035182, 7.27222002, 0.99824584, 0.99907401, 0.49317777],
-												 [	-6.27279444, -0.00057406, 0.00035176, 7.27222038, 0.99824617, 0.99907418, 0.49317774],
-												 [	-6.27279469, -0.00057395, 0.00035169, 7.27222074, 0.99824649, 0.99907436, 0.49317781],
-												 [	-6.27279495, -0.00057385, 0.00035163, 7.27222110, 0.99824682, 0.99907453, 0.49317792],
-												 [	-6.27279520, -0.00057374, 0.00035156, 7.27222146, 0.99824714, 0.99907470, 0.49317788],
-												 [	-6.27279546, -0.00057363, 0.00035150, 7.27222182, 0.99824747, 0.99907487, 0.49317793],
-												 [	-6.27279571, -0.00057353, 0.00035143, 7.27222218, 0.99824779, 0.99907504, 0.49317800],
-												 [	-6.27279596, -0.00057342, 0.00035137, 7.27222254, 0.99824812, 0.99907521, 0.49317798],
-												 [	-6.27279622, -0.00057331, 0.00035130, 7.27222290, 0.99824844, 0.99907538, 0.49317810],
-												 [	-6.27279647, -0.00057321, 0.00035124, 7.27222326, 0.99824877, 0.99907556, 0.49317811],
-												 [	-6.27279673, -0.00057310, 0.00035117, 7.27222362, 0.99824909, 0.99907573, 0.49317808],
-												 [	-6.27279698, -0.00057300, 0.00035111, 7.27222398, 0.99824941, 0.99907590, 0.49317818],
-												 [	-6.27279723, -0.00057289, 0.00035104, 7.27222434, 0.99824974, 0.99907607, 0.49317820],
-												 [	-6.27279749, -0.00057278, 0.00035098, 7.27222470, 0.99825006, 0.99907624, 0.49317824],
-												 [	-6.27279774, -0.00057268, 0.00035091, 7.27222506, 0.99825039, 0.99907641, 0.49317828],
-												 [	-6.27279799, -0.00057257, 0.00035085, 7.27222542, 0.99825071, 0.99907658, 0.49317828],
-												 [	-6.27279825, -0.00057247, 0.00035078, 7.27222578, 0.99825103, 0.99907675, 0.49317836],
-												 [	-6.27279850, -0.00057236, 0.00035072, 7.27222614, 0.99825136, 0.99907692, 0.49317841],
-												 [	-6.27279875, -0.00057225, 0.00035065, 7.27222650, 0.99825168, 0.99907709, 0.49317844],
-												 [	-6.27279901, -0.00057215, 0.00035059, 7.27222686, 0.99825200, 0.99907727, 0.49317846],
-												 [	-6.27279926, -0.00057204, 0.00035052, 7.27222722, 0.99825233, 0.99907744, 0.49317853],
-												 [	-6.27279951, -0.00057194, 0.00035046, 7.27222758, 0.99825265, 0.99907761, 0.49317855],
-												 [	-6.27279977, -0.00057183, 0.00035039, 7.27222793, 0.99825297, 0.99907778, 0.49317862],
-												 [	-6.27280002, -0.00057173, 0.00035033, 7.27222829, 0.99825330, 0.99907795, 0.49317862],
-												 [	-6.27280027, -0.00057162, 0.00035026, 7.27222865, 0.99825362, 0.99907812, 0.49317865],
-												 [	-6.27280052, -0.00057152, 0.00035020, 7.27222901, 0.99825394, 0.99907829, 0.49317872],
-												 [	-6.27280078, -0.00057141, 0.00035013, 7.27222937, 0.99825426, 0.99907846, 0.49317874],
-												 [	-6.27280103, -0.00057130, 0.00035007, 7.27222972, 0.99825459, 0.99907863, 0.49317875],
-												 [	-6.27280128, -0.00057120, 0.00035000, 7.27223008, 0.99825491, 0.99907880, 0.49317879],
-												 [	-6.27280153, -0.00057109, 0.00034994, 7.27223044, 0.99825523, 0.99907897, 0.49317885],
-												 [	-6.27280178, -0.00057099, 0.00034987, 7.27223080, 0.99825555, 0.99907914, 0.49317886],
-												 [	-6.27280204, -0.00057088, 0.00034981, 7.27223115, 0.99825587, 0.99907931, 0.49317891],
-												 [	-6.27280229, -0.00057078, 0.00034974, 7.27223151, 0.99825620, 0.99907948, 0.49317896],
-												 [	-6.27280254, -0.00057067, 0.00034968, 7.27223187, 0.99825652, 0.99907965, 0.49317901],
-												 [	-6.27280279, -0.00057057, 0.00034962, 7.27223222, 0.99825684, 0.99907982, 0.49317904],
-												 [	-6.27280304, -0.00057046, 0.00034955, 7.27223258, 0.99825716, 0.99907999, 0.49317904],
-												 [	-6.27280329, -0.00057036, 0.00034949, 7.27223294, 0.99825748, 0.99908016, 0.49317910],
-												 [	-6.27280355, -0.00057025, 0.00034942, 7.27223329, 0.99825780, 0.99908033, 0.49317919],
-												 [	-6.27280380, -0.00057015, 0.00034936, 7.27223365, 0.99825812, 0.99908050, 0.49317919],
-												 [	-6.27280405, -0.00057004, 0.00034929, 7.27223401, 0.99825844, 0.99908066, 0.49317919],
-												 [	-6.27280430, -0.00056994, 0.00034923, 7.27223436, 0.99825877, 0.99908083, 0.49317929],
-												 [	-6.27280455, -0.00056983, 0.00034916, 7.27223472, 0.99825909, 0.99908100, 0.49317932],
-												 [	-6.27280480, -0.00056973, 0.00034910, 7.27223507, 0.99825941, 0.99908117, 0.49317933],
-												 [	-6.27280505, -0.00056962, 0.00034904, 7.27223543, 0.99825973, 0.99908134, 0.49317936],
-												 [	-6.27280530, -0.00056952, 0.00034897, 7.27223579, 0.99826005, 0.99908151, 0.49317942],
-												 [	-6.27280555, -0.00056941, 0.00034891, 7.27223614, 0.99826037, 0.99908168, 0.49317941],
-												 [	-6.27280580, -0.00056931, 0.00034884, 7.27223650, 0.99826069, 0.99908185, 0.49317944],
-												 [	-6.27280606, -0.00056920, 0.00034878, 7.27223685, 0.99826101, 0.99908202, 0.49317951],
-												 [	-6.27280631, -0.00056910, 0.00034872, 7.27223721, 0.99826133, 0.99908219, 0.49317958],
-												 [	-6.27280656, -0.00056899, 0.00034865, 7.27223756, 0.99826165, 0.99908235, 0.49317962],
-												 [	-6.27280681, -0.00056889, 0.00034859, 7.27223792, 0.99826197, 0.99908252, 0.49317961],
-												 [	-6.27280706, -0.00056878, 0.00034852, 7.27223827, 0.99826229, 0.99908269, 0.49317963],
-												 [	-6.27280731, -0.00056868, 0.00034846, 7.27223863, 0.99826261, 0.99908286, 0.49317970],
-												 [	-6.27280756, -0.00056858, 0.00034839, 7.27223898, 0.99826293, 0.99908303, 0.49317974],
-												 [	-6.27280781, -0.00056847, 0.00034833, 7.27223933, 0.99826324, 0.99908320, 0.49317978],
-												 [	-6.27280806, -0.00056837, 0.00034827, 7.27223969, 0.99826356, 0.99908337, 0.49317977],
-												 [	-6.27280830, -0.00056826, 0.00034820, 7.27224004, 0.99826388, 0.99908353, 0.49317984],
-												 [	-6.27280855, -0.00056816, 0.00034814, 7.27224040, 0.99826420, 0.99908370, 0.49317991],
-												 [	-6.27280880, -0.00056805, 0.00034807, 7.27224075, 0.99826452, 0.99908387, 0.49317993],
-												 [	-6.27280905, -0.00056795, 0.00034801, 7.27224110, 0.99826484, 0.99908404, 0.49317997],
-												 [	-6.27280930, -0.00056785, 0.00034795, 7.27224146, 0.99826516, 0.99908421, 0.49317999],
-												 [	-6.27280955, -0.00056774, 0.00034788, 7.27224181, 0.99826547, 0.99908438, 0.49318004],
-												 [	-6.27280980, -0.00056764, 0.00034782, 7.27224216, 0.99826579, 0.99908454, 0.49318009],
-												 [	-6.27281005, -0.00056753, 0.00034776, 7.27224252, 0.99826611, 0.99908471, 0.49318013],
-												 [	-6.27281030, -0.00056743, 0.00034769, 7.27224287, 0.99826643, 0.99908488, 0.49318014],
-												 [	-6.27281055, -0.00056733, 0.00034763, 7.27224322, 0.99826675, 0.99908505, 0.49318020],
-												 [	-6.27281080, -0.00056722, 0.00034756, 7.27224357, 0.99826706, 0.99908521, 0.49318023],
-												 [	-6.27281104, -0.00056712, 0.00034750, 7.27224393, 0.99826738, 0.99908538, 0.49318021],
-												 [	-6.27281129, -0.00056701, 0.00034744, 7.27224428, 0.99826770, 0.99908555, 0.49318033],
-												 [	-6.27281154, -0.00056691, 0.00034737, 7.27224463, 0.99826802, 0.99908572, 0.49318033],
-												 [	-6.27281179, -0.00056681, 0.00034731, 7.27224498, 0.99826833, 0.99908588, 0.49318036],
-												 [	-6.27281204, -0.00056670, 0.00034725, 7.27224534, 0.99826865, 0.99908605, 0.49318042],
-												 [	-6.27281229, -0.00056660, 0.00034718, 7.27224569, 0.99826897, 0.99908622, 0.49318046],
-												 [	-6.27281253, -0.00056649, 0.00034712, 7.27224604, 0.99826929, 0.99908639, 0.49318048],
-												 [	-6.27281278, -0.00056639, 0.00034706, 7.27224639, 0.99826960, 0.99908655, 0.49318053],
-												 [	-6.27281303, -0.00056629, 0.00034699, 7.27224674, 0.99826992, 0.99908672, 0.49318056],
-												 [	-6.27281328, -0.00056618, 0.00034693, 7.27224709, 0.99827024, 0.99908689, 0.49318059],
-												 [	-6.27281353, -0.00056608, 0.00034686, 7.27224745, 0.99827055, 0.99908705, 0.49318066],
-												 [	-6.27281377, -0.00056598, 0.00034680, 7.27224780, 0.99827087, 0.99908722, 0.49318067],
-												 [	-6.27281402, -0.00056587, 0.00034674, 7.27224815, 0.99827119, 0.99908739, 0.49318073],
-												 [	-6.27281427, -0.00056577, 0.00034667, 7.27224850, 0.99827150, 0.99908756, 0.49318072],
-												 [	-6.27281452, -0.00056567, 0.00034661, 7.27224885, 0.99827182, 0.99908772, 0.49318077],
-												 [	-6.27281476, -0.00056556, 0.00034655, 7.27224920, 0.99827213, 0.99908789, 0.49318079],
-												 [	-6.27281501, -0.00056546, 0.00034648, 7.27224955, 0.99827245, 0.99908806, 0.49318086],
-												 [	-6.27281526, -0.00056536, 0.00034642, 7.27224990, 0.99827276, 0.99908822, 0.49318086],
-												 [	-6.27281550, -0.00056525, 0.00034636, 7.27225025, 0.99827308, 0.99908839, 0.49318091],
-												 [	-6.27281575, -0.00056515, 0.00034629, 7.27225060, 0.99827340, 0.99908856, 0.49318093],
-												 [	-6.27281600, -0.00056505, 0.00034623, 7.27225095, 0.99827371, 0.99908872, 0.49318097],
-												 [	-6.27281624, -0.00056494, 0.00034617, 7.27225130, 0.99827403, 0.99908889, 0.49318102],
-												 [	-6.27281649, -0.00056484, 0.00034610, 7.27225165, 0.99827434, 0.99908905, 0.49318109],
-												 [	-6.27281674, -0.00056474, 0.00034604, 7.27225200, 0.99827466, 0.99908922, 0.49318111],
-												 [	-6.27281698, -0.00056463, 0.00034598, 7.27225235, 0.99827497, 0.99908939, 0.49318114],
-												 [	-6.27281723, -0.00056453, 0.00034592, 7.27225270, 0.99827529, 0.99908955, 0.49318118],
-												 [	-6.27281748, -0.00056443, 0.00034585, 7.27225305, 0.99827560, 0.99908972, 0.49318122],
-												 [	-6.27281772, -0.00056433, 0.00034579, 7.27225340, 0.99827591, 0.99908988, 0.49318124],
-												 [	-6.27281797, -0.00056422, 0.00034573, 7.27225375, 0.99827623, 0.99909005, 0.49318128],
-												 [	-6.27281822, -0.00056412, 0.00034566, 7.27225409, 0.99827654, 0.99909022, 0.49318131],
-												 [	-6.27281846, -0.00056402, 0.00034560, 7.27225444, 0.99827686, 0.99909038, 0.49318135],
-												 [	-6.27281871, -0.00056391, 0.00034554, 7.27225479, 0.99827717, 0.99909055, 0.49318140],
-												 [	-6.27281895, -0.00056381, 0.00034547, 7.27225514, 0.99827749, 0.99909071, 0.49318139],
-												 [	-6.27281920, -0.00056371, 0.00034541, 7.27225549, 0.99827780, 0.99909088, 0.49318148],
-												 [	-6.27281944, -0.00056361, 0.00034535, 7.27225584, 0.99827811, 0.99909105, 0.49318152],
-												 [	-6.27281969, -0.00056350, 0.00034528, 7.27225619, 0.99827843, 0.99909121, 0.49318156],
-												 [	-6.27281993, -0.00056340, 0.00034522, 7.27225653, 0.99827874, 0.99909138, 0.49318159],
-												 [	-6.27282018, -0.00056330, 0.00034516, 7.27225688, 0.99827905, 0.99909154, 0.49318163],
-												 [	-6.27282043, -0.00056320, 0.00034510, 7.27225723, 0.99827937, 0.99909171, 0.49318166],
-												 [	-6.27282067, -0.00056309, 0.00034503, 7.27225758, 0.99827968, 0.99909187, 0.49318168],
-												 [	-6.27282092, -0.00056299, 0.00034497, 7.27225792, 0.99827999, 0.99909204, 0.49318179],
-												 [	-6.27282116, -0.00056289, 0.00034491, 7.27225827, 0.99828031, 0.99909220, 0.49318171],
-												 [	-6.27282141, -0.00056279, 0.00034485, 7.27225862, 0.99828062, 0.99909237, 0.49318177],
-												 [	-6.27282165, -0.00056268, 0.00034478, 7.27225897, 0.99828093, 0.99909253, 0.49318188],
-												 [	-6.27282189, -0.00056258, 0.00034472, 7.27225931, 0.99828124, 0.99909270, 0.49318185],
-												 [	-6.27282214, -0.00056248, 0.00034466, 7.27225966, 0.99828156, 0.99909286, 0.49318190],
-												 [	-6.27282238, -0.00056238, 0.00034459, 7.27226001, 0.99828187, 0.99909303, 0.49318196],
-												 [	-6.27282263, -0.00056228, 0.00034453, 7.27226035, 0.99828218, 0.99909319, 0.49318197],
-												 [	-6.27282287, -0.00056217, 0.00034447, 7.27226070, 0.99828249, 0.99909336, 0.49318203],
-												 [	-6.27282312, -0.00056207, 0.00034441, 7.27226104, 0.99828281, 0.99909352, 0.49318204],
-												 [	-6.27282336, -0.00056197, 0.00034434, 7.27226139, 0.99828312, 0.99909369, 0.49318210],
-												 [	-6.27282360, -0.00056187, 0.00034428, 7.27226174, 0.99828343, 0.99909385, 0.49318213],
-												 [	-6.27282385, -0.00056177, 0.00034422, 7.27226208, 0.99828374, 0.99909402, 0.49318217],
-												 [	-6.27282409, -0.00056166, 0.00034416, 7.27226243, 0.99828405, 0.99909418, 0.49318219],
-												 [	-6.27282434, -0.00056156, 0.00034409, 7.27226277, 0.99828436, 0.99909434, 0.49318217],
-												 [	-6.27282458, -0.00056146, 0.00034403, 7.27226312, 0.99828467, 0.99909451, 0.49318229],
-												 [	-6.27282482, -0.00056136, 0.00034397, 7.27226347, 0.99828499, 0.99909467, 0.49318235],
-												 [	-6.27282507, -0.00056126, 0.00034391, 7.27226381, 0.99828530, 0.99909484, 0.49318234],
-												 [	-6.27282531, -0.00056115, 0.00034384, 7.27226416, 0.99828561, 0.99909500, 0.49318238],
-												 [	-6.27282555, -0.00056105, 0.00034378, 7.27226450, 0.99828592, 0.99909516, 0.49318244],
-												 [	-6.27282580, -0.00056095, 0.00034372, 7.27226485, 0.99828623, 0.99909533, 0.49318245],
-												 [	-6.27282604, -0.00056085, 0.00034366, 7.27226519, 0.99828654, 0.99909549, 0.49318251],
-												 [	-6.27282628, -0.00056075, 0.00034360, 7.27226554, 0.99828685, 0.99909566, 0.49318249],
-												 [	-6.27282653, -0.00056065, 0.00034353, 7.27226588, 0.99828716, 0.99909582, 0.49318260],
-												 [	-6.27282677, -0.00056055, 0.00034347, 7.27226622, 0.99828747, 0.99909598, 0.49318256],
-												 [	-6.27282701, -0.00056044, 0.00034341, 7.27226657, 0.99828778, 0.99909615, 0.49318268],
-												 [	-6.27282725, -0.00056034, 0.00034335, 7.27226691, 0.99828809, 0.99909631, 0.49318269],
-												 [	-6.27282750, -0.00056024, 0.00034328, 7.27226726, 0.99828840, 0.99909648, 0.49318273],
-												 [	-6.27282774, -0.00056014, 0.00034322, 7.27226760, 0.99828871, 0.99909664, 0.49318276],
-												 [	-6.27282798, -0.00056004, 0.00034316, 7.27226794, 0.99828902, 0.99909680, 0.49318278],
-												 [	-6.27282822, -0.00055994, 0.00034310, 7.27226829, 0.99828933, 0.99909697, 0.49318281],
-												 [	-6.27282847, -0.00055984, 0.00034304, 7.27226863, 0.99828964, 0.99909713, 0.49318285],
-												 [	-6.27282871, -0.00055973, 0.00034297, 7.27226898, 0.99828995, 0.99909729, 0.49318289],
-												 [	-6.27282895, -0.00055963, 0.00034291, 7.27226932, 0.99829026, 0.99909746, 0.49318294],
-												 [	-6.27282919, -0.00055953, 0.00034285, 7.27226966, 0.99829057, 0.99909762, 0.49318296],
-												 [	-6.27282944, -0.00055943, 0.00034279, 7.27227000, 0.99829088, 0.99909778, 0.49318295],
-												 [	-6.27282968, -0.00055933, 0.00034273, 7.27227035, 0.99829119, 0.99909794, 0.49318302],
-												 [	-6.27282992, -0.00055923, 0.00034266, 7.27227069, 0.99829150, 0.99909811, 0.49318310],
-												 [	-6.27283016, -0.00055913, 0.00034260, 7.27227103, 0.99829180, 0.99909827, 0.49318311],
-												 [	-6.27283040, -0.00055903, 0.00034254, 7.27227138, 0.99829211, 0.99909843, 0.49318314],
-												 [	-6.27283064, -0.00055893, 0.00034248, 7.27227172, 0.99829242, 0.99909860, 0.49318318],
-												 [	-6.27283089, -0.00055882, 0.00034242, 7.27227206, 0.99829273, 0.99909876, 0.49318320],
-												 [	-6.27283113, -0.00055872, 0.00034235, 7.27227240, 0.99829304, 0.99909892, 0.49318320],
-												 [	-6.27283137, -0.00055862, 0.00034229, 7.27227274, 0.99829335, 0.99909908, 0.49318327],
-												 [	-6.27283161, -0.00055852, 0.00034223, 7.27227309, 0.99829365, 0.99909925, 0.49318333],
-												 [	-6.27283185, -0.00055842, 0.00034217, 7.27227343, 0.99829396, 0.99909941, 0.49318333],
-												 [	-6.27283209, -0.00055832, 0.00034211, 7.27227377, 0.99829427, 0.99909957, 0.49318336],
-												 [	-6.27283233, -0.00055822, 0.00034204, 7.27227411, 0.99829458, 0.99909973, 0.49318343],
-												 [	-6.27283257, -0.00055812, 0.00034198, 7.27227445, 0.99829489, 0.99909990, 0.49318344],
-												 [	-6.27283281, -0.00055802, 0.00034192, 7.27227479, 0.99829519, 0.99910006, 0.49318351],
-												 [	-6.27283305, -0.00055792, 0.00034186, 7.27227514, 0.99829550, 0.99910022, 0.49318353],
-												 [	-6.27283329, -0.00055782, 0.00034180, 7.27227548, 0.99829581, 0.99910038, 0.49318358],
-												 [	-6.27283353, -0.00055772, 0.00034174, 7.27227582, 0.99829611, 0.99910055, 0.49318362],
-												 [	-6.27283378, -0.00055762, 0.00034168, 7.27227616, 0.99829642, 0.99910071, 0.49318360],
-												 [	-6.27283402, -0.00055752, 0.00034161, 7.27227650, 0.99829673, 0.99910087, 0.49318367],
-												 [	-6.27283426, -0.00055742, 0.00034155, 7.27227684, 0.99829704, 0.99910103, 0.49318371],
-												 [	-6.27283450, -0.00055732, 0.00034149, 7.27227718, 0.99829734, 0.99910119, 0.49318374],
-												 [	-6.27283474, -0.00055722, 0.00034143, 7.27227752, 0.99829765, 0.99910136, 0.49318380],
-												 [	-6.27283498, -0.00055712, 0.00034137, 7.27227786, 0.99829796, 0.99910152, 0.49318376],
-												 [	-6.27283522, -0.00055701, 0.00034131, 7.27227820, 0.99829826, 0.99910168, 0.49318386],
-												 [	-6.27283546, -0.00055691, 0.00034124, 7.27227854, 0.99829857, 0.99910184, 0.49318389],
-												 [	-6.27283570, -0.00055681, 0.00034118, 7.27227888, 0.99829887, 0.99910200, 0.49318390],
-												 [	-6.27283593, -0.00055671, 0.00034112, 7.27227922, 0.99829918, 0.99910216, 0.49318396],
-												 [	-6.27283617, -0.00055661, 0.00034106, 7.27227956, 0.99829949, 0.99910233, 0.49318401],
-												 [	-6.27283641, -0.00055651, 0.00034100, 7.27227990, 0.99829979, 0.99910249, 0.49318410],
-												 [	-6.27283665, -0.00055641, 0.00034094, 7.27228024, 0.99830010, 0.99910265, 0.49318407],
-												 [	-6.27283689, -0.00055631, 0.00034088, 7.27228058, 0.99830040, 0.99910281, 0.49318407],
-												 [	-6.27283713, -0.00055621, 0.00034081, 7.27228092, 0.99830071, 0.99910297, 0.49318414],
-												 [	-6.27283737, -0.00055611, 0.00034075, 7.27228126, 0.99830101, 0.99910313, 0.49318415],
-												 [	-6.27283761, -0.00055601, 0.00034069, 7.27228159, 0.99830132, 0.99910329, 0.49318423],
-												 [	-6.27283785, -0.00055591, 0.00034063, 7.27228193, 0.99830163, 0.99910345, 0.49318423],
-												 [	-6.27283809, -0.00055581, 0.00034057, 7.27228227, 0.99830193, 0.99910362, 0.49318427],
-												 [	-6.27283833, -0.00055571, 0.00034051, 7.27228261, 0.99830224, 0.99910378, 0.49318428],
-												 [	-6.27283856, -0.00055562, 0.00034045, 7.27228295, 0.99830254, 0.99910394, 0.49318433],
-												 [	-6.27283880, -0.00055552, 0.00034039, 7.27228329, 0.99830285, 0.99910410, 0.49318443],
-												 [	-6.27283904, -0.00055542, 0.00034033, 7.27228363, 0.99830315, 0.99910426, 0.49318443],
-												 [	-6.27283928, -0.00055532, 0.00034026, 7.27228396, 0.99830345, 0.99910442, 0.49318449],
-												 [	-6.27283952, -0.00055522, 0.00034020, 7.27228430, 0.99830376, 0.99910458, 0.49318449],
-												 [	-6.27283976, -0.00055512, 0.00034014, 7.27228464, 0.99830406, 0.99910474, 0.49318454],
-												 [	-6.27283999, -0.00055502, 0.00034008, 7.27228498, 0.99830437, 0.99910490, 0.49318457],
-												 [	-6.27284023, -0.00055492, 0.00034002, 7.27228531, 0.99830467, 0.99910506, 0.49318459],
-												 [	-6.27284047, -0.00055482, 0.00033996, 7.27228565, 0.99830498, 0.99910522, 0.49318460],
-												 [	-6.27284071, -0.00055472, 0.00033990, 7.27228599, 0.99830528, 0.99910538, 0.49318465],
-												 [	-6.27284095, -0.00055462, 0.00033984, 7.27228633, 0.99830558, 0.99910554, 0.49318472],
-												 [	-6.27284118, -0.00055452, 0.00033978, 7.27228666, 0.99830589, 0.99910570, 0.49318477],
-												 [	-6.27284142, -0.00055442, 0.00033972, 7.27228700, 0.99830619, 0.99910586, 0.49318479],
-												 [	-6.27284166, -0.00055432, 0.00033965, 7.27228734, 0.99830649, 0.99910602, 0.49318483],
-												 [	-6.27284190, -0.00055422, 0.00033959, 7.27228767, 0.99830680, 0.99910618, 0.49318487],
-												 [	-6.27284213, -0.00055412, 0.00033953, 7.27228801, 0.99830710, 0.99910634, 0.49318489],
-												 [	-6.27284237, -0.00055402, 0.00033947, 7.27228835, 0.99830740, 0.99910650, 0.49318490],
-												 [	-6.27284261, -0.00055393, 0.00033941, 7.27228868, 0.99830771, 0.99910666, 0.49318496],
-												 [	-6.27284285, -0.00055383, 0.00033935, 7.27228902, 0.99830801, 0.99910682, 0.49318499],
-												 [	-6.27284308, -0.00055373, 0.00033929, 7.27228936, 0.99830831, 0.99910698, 0.49318499],
-												 [	-6.27284332, -0.00055363, 0.00033923, 7.27228969, 0.99830861, 0.99910714, 0.49318509],
-												 [	-6.27284356, -0.00055353, 0.00033917, 7.27229003, 0.99830892, 0.99910730, 0.49318511],
-												 [	-6.27284379, -0.00055343, 0.00033911, 7.27229036, 0.99830922, 0.99910746, 0.49318515],
-												 [	-6.27284403, -0.00055333, 0.00033905, 7.27229070, 0.99830952, 0.99910762, 0.49318516],
-												 [	-6.27284427, -0.00055323, 0.00033899, 7.27229103, 0.99830982, 0.99910778, 0.49318524],
-												 [	-6.27284450, -0.00055313, 0.00033893, 7.27229137, 0.99831013, 0.99910794, 0.49318524],
-												 [	-6.27284474, -0.00055303, 0.00033887, 7.27229170, 0.99831043, 0.99910810, 0.49318528],
-												 [	-6.27284498, -0.00055294, 0.00033880, 7.27229204, 0.99831073, 0.99910826, 0.49318529],
-												 [	-6.27284521, -0.00055284, 0.00033874, 7.27229237, 0.99831103, 0.99910842, 0.49318533],
-												 [	-6.27284545, -0.00055274, 0.00033868, 7.27229271, 0.99831133, 0.99910858, 0.49318539],
-												 [	-6.27284568, -0.00055264, 0.00033862, 7.27229304, 0.99831164, 0.99910874, 0.49318542],
-												 [	-6.27284592, -0.00055254, 0.00033856, 7.27229338, 0.99831194, 0.99910890, 0.49318543],
-												 [	-6.27284616, -0.00055244, 0.00033850, 7.27229371, 0.99831224, 0.99910906, 0.49318547],
-												 [	-6.27284639, -0.00055234, 0.00033844, 7.27229405, 0.99831254, 0.99910921, 0.49318555],
-												 [	-6.27284663, -0.00055225, 0.00033838, 7.27229438, 0.99831284, 0.99910937, 0.49318557],
-												 [	-6.27284686, -0.00055215, 0.00033832, 7.27229472, 0.99831314, 0.99910953, 0.49318561],
-												 [	-6.27284710, -0.00055205, 0.00033826, 7.27229505, 0.99831344, 0.99910969, 0.49318565],
-												 [	-6.27284733, -0.00055195, 0.00033820, 7.27229538, 0.99831374, 0.99910985, 0.49318570],
-												 [	-6.27284757, -0.00055185, 0.00033814, 7.27229572, 0.99831404, 0.99911001, 0.49318569],
-												 [	-6.27284781, -0.00055175, 0.00033808, 7.27229605, 0.99831435, 0.99911017, 0.49318574],
-												 [	-6.27284804, -0.00055165, 0.00033802, 7.27229639, 0.99831465, 0.99911033, 0.49318575],
-												 [	-6.27284828, -0.00055156, 0.00033796, 7.27229672, 0.99831495, 0.99911048, 0.49318581],
-												 [	-6.27284851, -0.00055146, 0.00033790, 7.27229705, 0.99831525, 0.99911064, 0.49318582],
-												 [	-6.27284875, -0.00055136, 0.00033784, 7.27229739, 0.99831555, 0.99911080, 0.49318586],
-												 [	-6.27284898, -0.00055126, 0.00033778, 7.27229772, 0.99831585, 0.99911096, 0.49318588],
-												 [	-6.27284922, -0.00055116, 0.00033772, 7.27229805, 0.99831615, 0.99911112, 0.49318595],
-												 [	-6.27284945, -0.00055107, 0.00033766, 7.27229838, 0.99831645, 0.99911128, 0.49318599],
-												 [	-6.27284968, -0.00055097, 0.00033760, 7.27229872, 0.99831675, 0.99911143, 0.49318604],
-												 [	-6.27284992, -0.00055087, 0.00033754, 7.27229905, 0.99831705, 0.99911159, 0.49318604],
-												 [	-6.27285015, -0.00055077, 0.00033748, 7.27229938, 0.99831735, 0.99911175, 0.49318612],
-												 [	-6.27285039, -0.00055067, 0.00033742, 7.27229971, 0.99831765, 0.99911191, 0.49318613],
-												 [	-6.27285062, -0.00055058, 0.00033736, 7.27230005, 0.99831794, 0.99911207, 0.49318622],
-												 [	-6.27285086, -0.00055048, 0.00033730, 7.27230038, 0.99831824, 0.99911223, 0.49318623],
-												 [	-6.27285109, -0.00055038, 0.00033724, 7.27230071, 0.99831854, 0.99911238, 0.49318626],
-												 [	-6.27285133, -0.00055028, 0.00033718, 7.27230104, 0.99831884, 0.99911254, 0.49318626],
-												 [	-6.27285156, -0.00055018, 0.00033712, 7.27230138, 0.99831914, 0.99911270, 0.49318628],
-												 [	-6.27285179, -0.00055009, 0.00033706, 7.27230171, 0.99831944, 0.99911286, 0.49318633],
-												 [	-6.27285203, -0.00054999, 0.00033700, 7.27230204, 0.99831974, 0.99911301, 0.49318637],
-												 [	-6.27285226, -0.00054989, 0.00033694, 7.27230237, 0.99832004, 0.99911317, 0.49318637],
-												 [	-6.27285249, -0.00054979, 0.00033688, 7.27230270, 0.99832034, 0.99911333, 0.49318644],
-												 [	-6.27285273, -0.00054970, 0.00033682, 7.27230303, 0.99832063, 0.99911349, 0.49318645],
-												 [	-6.27285296, -0.00054960, 0.00033676, 7.27230336, 0.99832093, 0.99911364, 0.49318646],
-												 [	-6.27285319, -0.00054950, 0.00033670, 7.27230369, 0.99832123, 0.99911380, 0.49318651],
-												 [	-6.27285343, -0.00054940, 0.00033664, 7.27230403, 0.99832153, 0.99911396, 0.49318650],
-												 [	-6.27285366, -0.00054931, 0.00033658, 7.27230436, 0.99832183, 0.99911412, 0.49318659],
-												 [	-6.27285389, -0.00054921, 0.00033652, 7.27230469, 0.99832212, 0.99911427, 0.49318666],
-												 [	-6.27285413, -0.00054911, 0.00033646, 7.27230502, 0.99832242, 0.99911443, 0.49318665],
-												 [	-6.27285436, -0.00054901, 0.00033640, 7.27230535, 0.99832272, 0.99911459, 0.49318670],
-												 [	-6.27285459, -0.00054892, 0.00033634, 7.27230568, 0.99832302, 0.99911474, 0.49318673],
-												 [	-6.27285483, -0.00054882, 0.00033628, 7.27230601, 0.99832332, 0.99911490, 0.49318677],
-												 [	-6.27285506, -0.00054872, 0.00033622, 7.27230634, 0.99832361, 0.99911506, 0.49318685],
-												 [	-6.27285529, -0.00054862, 0.00033616, 7.27230667, 0.99832391, 0.99911522, 0.49318683],
-												 [	-6.27285552, -0.00054853, 0.00033610, 7.27230700, 0.99832421, 0.99911537, 0.49318692],
-												 [	-6.27285576, -0.00054843, 0.00033604, 7.27230733, 0.99832450, 0.99911553, 0.49318690],
-												 [	-6.27285599, -0.00054833, 0.00033598, 7.27230766, 0.99832480, 0.99911569, 0.49318694],
-												 [	-6.27285622, -0.00054824, 0.00033592, 7.27230799, 0.99832510, 0.99911584, 0.49318700],
-												 [	-6.27285645, -0.00054814, 0.00033586, 7.27230832, 0.99832539, 0.99911600, 0.49318701],
-												 [	-6.27285669, -0.00054804, 0.00033580, 7.27230865, 0.99832569, 0.99911616, 0.49318705],
-												 [	-6.27285692, -0.00054794, 0.00033574, 7.27230897, 0.99832599, 0.99911631, 0.49318711],
-												 [	-6.27285715, -0.00054785, 0.00033568, 7.27230930, 0.99832628, 0.99911647, 0.49318708],
-												 [	-6.27285738, -0.00054775, 0.00033563, 7.27230963, 0.99832658, 0.99911662, 0.49318719],
-												 [	-6.27285761, -0.00054765, 0.00033557, 7.27230996, 0.99832688, 0.99911678, 0.49318717],
-												 [	-6.27285785, -0.00054756, 0.00033551, 7.27231029, 0.99832717, 0.99911694, 0.49318724],
-												 [	-6.27285808, -0.00054746, 0.00033545, 7.27231062, 0.99832747, 0.99911709, 0.49318723],
-												 [	-6.27285831, -0.00054736, 0.00033539, 7.27231095, 0.99832776, 0.99911725, 0.49318729],
-												 [	-6.27285854, -0.00054727, 0.00033533, 7.27231127, 0.99832806, 0.99911741, 0.49318737],
-												 [	-6.27285877, -0.00054717, 0.00033527, 7.27231160, 0.99832836, 0.99911756, 0.49318736],
-												 [	-6.27285900, -0.00054707, 0.00033521, 7.27231193, 0.99832865, 0.99911772, 0.49318737],
-												 [	-6.27285923, -0.00054698, 0.00033515, 7.27231226, 0.99832895, 0.99911787, 0.49318744],
-												 [	-6.27285947, -0.00054688, 0.00033509, 7.27231259, 0.99832924, 0.99911803, 0.49318747],
-												 [	-6.27285970, -0.00054678, 0.00033503, 7.27231291, 0.99832954, 0.99911819, 0.49318750],
-												 [	-6.27285993, -0.00054669, 0.00033497, 7.27231324, 0.99832983, 0.99911834, 0.49318752],
-												 [	-6.27286016, -0.00054659, 0.00033491, 7.27231357, 0.99833013, 0.99911850, 0.49318756],
-												 [	-6.27286039, -0.00054649, 0.00033485, 7.27231390, 0.99833042, 0.99911865, 0.49318760],
-												 [	-6.27286062, -0.00054640, 0.00033480, 7.27231422, 0.99833072, 0.99911881, 0.49318765],
-												 [	-6.27286085, -0.00054630, 0.00033474, 7.27231455, 0.99833101, 0.99911896, 0.49318766],
-												 [	-6.27286108, -0.00054620, 0.00033468, 7.27231488, 0.99833131, 0.99911912, 0.49318767],
-												 [	-6.27286131, -0.00054611, 0.00033462, 7.27231521, 0.99833160, 0.99911927, 0.49318769],
-												 [	-6.27286154, -0.00054601, 0.00033456, 7.27231553, 0.99833190, 0.99911943, 0.49318777],
-												 [	-6.27286177, -0.00054591, 0.00033450, 7.27231586, 0.99833219, 0.99911959, 0.49318778],
-												 [	-6.27286200, -0.00054582, 0.00033444, 7.27231619, 0.99833248, 0.99911974, 0.49318783],
-												 [	-6.27286223, -0.00054572, 0.00033438, 7.27231651, 0.99833278, 0.99911990, 0.49318785],
-												 [	-6.27286246, -0.00054563, 0.00033432, 7.27231684, 0.99833307, 0.99912005, 0.49318790],
-												 [	-6.27286269, -0.00054553, 0.00033426, 7.27231716, 0.99833337, 0.99912021, 0.49318796],
-												 [	-6.27286292, -0.00054543, 0.00033420, 7.27231749, 0.99833366, 0.99912036, 0.49318798],
-												 [	-6.27286315, -0.00054534, 0.00033415, 7.27231782, 0.99833395, 0.99912052, 0.49318802],
-												 [	-6.27286338, -0.00054524, 0.00033409, 7.27231814, 0.99833425, 0.99912067, 0.49318801],
-												 [	-6.27286361, -0.00054515, 0.00033403, 7.27231847, 0.99833454, 0.99912083, 0.49318810],
-												 [	-6.27286384, -0.00054505, 0.00033397, 7.27231879, 0.99833483, 0.99912098, 0.49318815],
-												 [	-6.27286407, -0.00054495, 0.00033391, 7.27231912, 0.99833513, 0.99912114, 0.49318815],
-												 [	-6.27286430, -0.00054486, 0.00033385, 7.27231944, 0.99833542, 0.99912129, 0.49318821],
-												 [	-6.27286453, -0.00054476, 0.00033379, 7.27231977, 0.99833571, 0.99912145, 0.49318820],
-												 [	-6.27286476, -0.00054467, 0.00033373, 7.27232010, 0.99833601, 0.99912160, 0.49318828],
-												 [	-6.27286499, -0.00054457, 0.00033368, 7.27232042, 0.99833630, 0.99912175, 0.49318827],
-												 [	-6.27286522, -0.00054447, 0.00033362, 7.27232075, 0.99833659, 0.99912191, 0.49318830],
-												 [	-6.27286545, -0.00054438, 0.00033356, 7.27232107, 0.99833689, 0.99912206, 0.49318834],
-												 [	-6.27286568, -0.00054428, 0.00033350, 7.27232139, 0.99833718, 0.99912222, 0.49318840],
-												 [	-6.27286591, -0.00054419, 0.00033344, 7.27232172, 0.99833747, 0.99912237, 0.49318849],
-												 [	-6.27286614, -0.00054409, 0.00033338, 7.27232204, 0.99833776, 0.99912253, 0.49318845],
-												 [	-6.27286636, -0.00054400, 0.00033332, 7.27232237, 0.99833805, 0.99912268, 0.49318852],
-												 [	-6.27286659, -0.00054390, 0.00033326, 7.27232269, 0.99833835, 0.99912283, 0.49318851],
-												 [	-6.27286682, -0.00054380, 0.00033321, 7.27232302, 0.99833864, 0.99912299, 0.49318855],
-												 [	-6.27286705, -0.00054371, 0.00033315, 7.27232334, 0.99833893, 0.99912314, 0.49318857],
-												 [	-6.27286728, -0.00054361, 0.00033309, 7.27232366, 0.99833922, 0.99912330, 0.49318863],
-												 [	-6.27286751, -0.00054352, 0.00033303, 7.27232399, 0.99833951, 0.99912345, 0.49318865],
-												 [	-6.27286774, -0.00054342, 0.00033297, 7.27232431, 0.99833981, 0.99912360, 0.49318871],
-												 [	-6.27286796, -0.00054333, 0.00033291, 7.27232464, 0.99834010, 0.99912376, 0.49318871],
-												 [	-6.27286819, -0.00054323, 0.00033286, 7.27232496, 0.99834039, 0.99912391, 0.49318882],
-												 [	-6.27286842, -0.00054314, 0.00033280, 7.27232528, 0.99834068, 0.99912407, 0.49318885],
-												 [	-6.27286865, -0.00054304, 0.00033274, 7.27232561, 0.99834097, 0.99912422, 0.49318882],
-												 [	-6.27286888, -0.00054295, 0.00033268, 7.27232593, 0.99834126, 0.99912437, 0.49318888],
-												 [	-6.27286910, -0.00054285, 0.00033262, 7.27232625, 0.99834155, 0.99912453, 0.49318890],
-												 [	-6.27286933, -0.00054276, 0.00033256, 7.27232657, 0.99834184, 0.99912468, 0.49318892],
-												 [	-6.27286956, -0.00054266, 0.00033250, 7.27232690, 0.99834214, 0.99912483, 0.49318896],
-												 [	-6.27286979, -0.00054257, 0.00033245, 7.27232722, 0.99834243, 0.99912499, 0.49318900],
-												 [	-6.27287001, -0.00054247, 0.00033239, 7.27232754, 0.99834272, 0.99912514, 0.49318899],
-												 [	-6.27287024, -0.00054238, 0.00033233, 7.27232787, 0.99834301, 0.99912529, 0.49318908],
-												 [	-6.27287047, -0.00054228, 0.00033227, 7.27232819, 0.99834330, 0.99912545, 0.49318910],
-												 [	-6.27287070, -0.00054219, 0.00033221, 7.27232851, 0.99834359, 0.99912560, 0.49318913],
-												 [	-6.27287092, -0.00054209, 0.00033216, 7.27232883, 0.99834388, 0.99912575, 0.49318913],
-												 [	-6.27287115, -0.00054200, 0.00033210, 7.27232915, 0.99834417, 0.99912591, 0.49318919],
-												 [	-6.27287138, -0.00054190, 0.00033204, 7.27232948, 0.99834446, 0.99912606, 0.49318918],
-												 [	-6.27287160, -0.00054181, 0.00033198, 7.27232980, 0.99834475, 0.99912621, 0.49318924],
-												 [	-6.27287183, -0.00054171, 0.00033192, 7.27233012, 0.99834504, 0.99912637, 0.49318928],
-												 [	-6.27287206, -0.00054162, 0.00033186, 7.27233044, 0.99834533, 0.99912652, 0.49318937],
-												 [	-6.27287228, -0.00054152, 0.00033181, 7.27233076, 0.99834562, 0.99912667, 0.49318939],
-												 [	-6.27287251, -0.00054143, 0.00033175, 7.27233108, 0.99834591, 0.99912682, 0.49318942],
-												 [	-6.27287274, -0.00054133, 0.00033169, 7.27233140, 0.99834620, 0.99912698, 0.49318944],
-												 [	-6.27287296, -0.00054124, 0.00033163, 7.27233173, 0.99834649, 0.99912713, 0.49318945],
-												 [	-6.27287319, -0.00054114, 0.00033157, 7.27233205, 0.99834677, 0.99912728, 0.49318948],
-												 [	-6.27287342, -0.00054105, 0.00033152, 7.27233237, 0.99834706, 0.99912744, 0.49318948],
-												 [	-6.27287364, -0.00054095, 0.00033146, 7.27233269, 0.99834735, 0.99912759, 0.49318960],
-												 [	-6.27287387, -0.00054086, 0.00033140, 7.27233301, 0.99834764, 0.99912774, 0.49318965],
-												 [	-6.27287409, -0.00054076, 0.00033134, 7.27233333, 0.99834793, 0.99912789, 0.49318963],
-												 [	-6.27287432, -0.00054067, 0.00033128, 7.27233365, 0.99834822, 0.99912805, 0.49318967],
-												 [	-6.27287455, -0.00054058, 0.00033123, 7.27233397, 0.99834851, 0.99912820, 0.49318974],
-												 [	-6.27287477, -0.00054048, 0.00033117, 7.27233429, 0.99834880, 0.99912835, 0.49318975],
-												 [	-6.27287500, -0.00054039, 0.00033111, 7.27233461, 0.99834908, 0.99912850, 0.49318982],
-												 [	-6.27287522, -0.00054029, 0.00033105, 7.27233493, 0.99834937, 0.99912865, 0.49318976],
-												 [	-6.27287545, -0.00054020, 0.00033100, 7.27233525, 0.99834966, 0.99912881, 0.49318982],
-												 [	-6.27287568, -0.00054010, 0.00033094, 7.27233557, 0.99834995, 0.99912896, 0.49318990],
-												 [	-6.27287590, -0.00054001, 0.00033088, 7.27233589, 0.99835024, 0.99912911, 0.49318991],
-												 [	-6.27287613, -0.00053992, 0.00033082, 7.27233621, 0.99835052, 0.99912926, 0.49318988],
-												 [	-6.27287635, -0.00053982, 0.00033076, 7.27233653, 0.99835081, 0.99912941, 0.49319001],
-												 [	-6.27287658, -0.00053973, 0.00033071, 7.27233685, 0.99835110, 0.99912957, 0.49318998],
-												 [	-6.27287680, -0.00053963, 0.00033065, 7.27233717, 0.99835139, 0.99912972, 0.49319007],
-												 [	-6.27287703, -0.00053954, 0.00033059, 7.27233749, 0.99835168, 0.99912987, 0.49319009],
-												 [	-6.27287725, -0.00053945, 0.00033053, 7.27233781, 0.99835196, 0.99913002, 0.49319013],
-												 [	-6.27287748, -0.00053935, 0.00033048, 7.27233812, 0.99835225, 0.99913017, 0.49319012],
-												 [	-6.27287770, -0.00053926, 0.00033042, 7.27233844, 0.99835254, 0.99913032, 0.49319022],
-												 [	-6.27287793, -0.00053916, 0.00033036, 7.27233876, 0.99835282, 0.99913048, 0.49319019],
-												 [	-6.27287815, -0.00053907, 0.00033030, 7.27233908, 0.99835311, 0.99913063, 0.49319021],
-												 [	-6.27287838, -0.00053898, 0.00033025, 7.27233940, 0.99835340, 0.99913078, 0.49319029],
-												 [	-6.27287860, -0.00053888, 0.00033019, 7.27233972, 0.99835368, 0.99913093, 0.49319029],
-												 [	-6.27287882, -0.00053879, 0.00033013, 7.27234004, 0.99835397, 0.99913108, 0.49319033],
-												 [	-6.27287905, -0.00053869, 0.00033007, 7.27234035, 0.99835426, 0.99913123, 0.49319038],
-												 [	-6.27287927, -0.00053860, 0.00033002, 7.27234067, 0.99835454, 0.99913138, 0.49319044],
-												 [	-6.27287950, -0.00053851, 0.00032996, 7.27234099, 0.99835483, 0.99913153, 0.49319044],
-												 [	-6.27287972, -0.00053841, 0.00032990, 7.27234131, 0.99835512, 0.99913169, 0.49319052],
-												 [	-6.27287994, -0.00053832, 0.00032984, 7.27234162, 0.99835540, 0.99913184, 0.49319053],
-												 [	-6.27288017, -0.00053823, 0.00032979, 7.27234194, 0.99835569, 0.99913199, 0.49319055],
-												 [	-6.27288039, -0.00053813, 0.00032973, 7.27234226, 0.99835598, 0.99913214, 0.49319059],
-												 [	-6.27288062, -0.00053804, 0.00032967, 7.27234258, 0.99835626, 0.99913229, 0.49319064],
-												 [	-6.27288084, -0.00053795, 0.00032961, 7.27234289, 0.99835655, 0.99913244, 0.49319065],
-												 [	-6.27288106, -0.00053785, 0.00032956, 7.27234321, 0.99835683, 0.99913259, 0.49319063],
-												 [	-6.27288129, -0.00053776, 0.00032950, 7.27234353, 0.99835712, 0.99913274, 0.49319073],
-												 [	-6.27288151, -0.00053767, 0.00032944, 7.27234385, 0.99835740, 0.99913289, 0.49319071],
-												 [	-6.27288173, -0.00053757, 0.00032938, 7.27234416, 0.99835769, 0.99913304, 0.49319080],
-												 [	-6.27288196, -0.00053748, 0.00032933, 7.27234448, 0.99835797, 0.99913319, 0.49319079],
-												 [	-6.27288218, -0.00053739, 0.00032927, 7.27234480, 0.99835826, 0.99913334, 0.49319084],
-												 [	-6.27288240, -0.00053729, 0.00032921, 7.27234511, 0.99835854, 0.99913349, 0.49319094],
-												 [	-6.27288263, -0.00053720, 0.00032916, 7.27234543, 0.99835883, 0.99913365, 0.49319090],
-												 [	-6.27288285, -0.00053711, 0.00032910, 7.27234574, 0.99835911, 0.99913380, 0.49319093],
-												 [	-6.27288307, -0.00053701, 0.00032904, 7.27234606, 0.99835940, 0.99913395, 0.49319095],
-												 [	-6.27288330, -0.00053692, 0.00032898, 7.27234638, 0.99835968, 0.99913410, 0.49319102],
-												 [	-6.27288352, -0.00053683, 0.00032893, 7.27234669, 0.99835997, 0.99913425, 0.49319110],
-												 [	-6.27288374, -0.00053673, 0.00032887, 7.27234701, 0.99836025, 0.99913440, 0.49319107],
-												 [	-6.27288396, -0.00053664, 0.00032881, 7.27234732, 0.99836054, 0.99913455, 0.49319115],
-												 [	-6.27288419, -0.00053655, 0.00032876, 7.27234764, 0.99836082, 0.99913470, 0.49319113],
-												 [	-6.27288441, -0.00053645, 0.00032870, 7.27234795, 0.99836111, 0.99913485, 0.49319119],
-												 [	-6.27288463, -0.00053636, 0.00032864, 7.27234827, 0.99836139, 0.99913500, 0.49319119],
-												 [	-6.27288485, -0.00053627, 0.00032859, 7.27234859, 0.99836167, 0.99913515, 0.49319124],
-												 [	-6.27288508, -0.00053618, 0.00032853, 7.27234890, 0.99836196, 0.99913530, 0.49319131],
-												 [	-6.27288530, -0.00053608, 0.00032847, 7.27234922, 0.99836224, 0.99913545, 0.49319132],
-												 [	-6.27288552, -0.00053599, 0.00032841, 7.27234953, 0.99836253, 0.99913560, 0.49319134],
-												 [	-6.27288574, -0.00053590, 0.00032836, 7.27234985, 0.99836281, 0.99913575, 0.49319141],
-												 [	-6.27288596, -0.00053580, 0.00032830, 7.27235016, 0.99836309, 0.99913590, 0.49319142],
-												 [	-6.27288619, -0.00053571, 0.00032824, 7.27235047, 0.99836338, 0.99913604, 0.49319138],
-												 [	-6.27288641, -0.00053562, 0.00032819, 7.27235079, 0.99836366, 0.99913619, 0.49319145],
-												 [	-6.27288663, -0.00053553, 0.00032813, 7.27235110, 0.99836394, 0.99913634, 0.49319149],
-												 [	-6.27288685, -0.00053543, 0.00032807, 7.27235142, 0.99836423, 0.99913649, 0.49319155],
-												 [	-6.27288707, -0.00053534, 0.00032802, 7.27235173, 0.99836451, 0.99913664, 0.49319156],
-												 [	-6.27288729, -0.00053525, 0.00032796, 7.27235205, 0.99836479, 0.99913679, 0.49319156],
-												 [	-6.27288752, -0.00053516, 0.00032790, 7.27235236, 0.99836507, 0.99913694, 0.49319162],
-												 [	-6.27288774, -0.00053506, 0.00032785, 7.27235267, 0.99836536, 0.99913709, 0.49319169],
-												 [	-6.27288796, -0.00053497, 0.00032779, 7.27235299, 0.99836564, 0.99913724, 0.49319169],
-												 [	-6.27288818, -0.00053488, 0.00032773, 7.27235330, 0.99836592, 0.99913739, 0.49319176],
-												 [	-6.27288840, -0.00053479, 0.00032768, 7.27235361, 0.99836620, 0.99913754, 0.49319177],
-												 [	-6.27288862, -0.00053469, 0.00032762, 7.27235393, 0.99836649, 0.99913769, 0.49319182],
-												 [	-6.27288884, -0.00053460, 0.00032756, 7.27235424, 0.99836677, 0.99913784, 0.49319183],
-												 [	-6.27288906, -0.00053451, 0.00032751, 7.27235455, 0.99836705, 0.99913798, 0.49319186],
-												 [	-6.27288928, -0.00053442, 0.00032745, 7.27235487, 0.99836733, 0.99913813, 0.49319195],
-												 [	-6.27288950, -0.00053432, 0.00032739, 7.27235518, 0.99836762, 0.99913828, 0.49319191],
-												 [	-6.27288973, -0.00053423, 0.00032734, 7.27235549, 0.99836790, 0.99913843, 0.49319195],
-												 [	-6.27288995, -0.00053414, 0.00032728, 7.27235581, 0.99836818, 0.99913858, 0.49319198],
-												 [	-6.27289017, -0.00053405, 0.00032722, 7.27235612, 0.99836846, 0.99913873, 0.49319204],
-												 [	-6.27289039, -0.00053396, 0.00032717, 7.27235643, 0.99836874, 0.99913888, 0.49319208],
-												 [	-6.27289061, -0.00053386, 0.00032711, 7.27235674, 0.99836902, 0.99913903, 0.49319213],
-												 [	-6.27289083, -0.00053377, 0.00032705, 7.27235706, 0.99836931, 0.99913917, 0.49319212],
-												 [	-6.27289105, -0.00053368, 0.00032700, 7.27235737, 0.99836959, 0.99913932, 0.49319218],
-												 [	-6.27289127, -0.00053359, 0.00032694, 7.27235768, 0.99836987, 0.99913947, 0.49319222],
-												 [	-6.27289149, -0.00053350, 0.00032689, 7.27235799, 0.99837015, 0.99913962, 0.49319223],
-												 [	-6.27289171, -0.00053340, 0.00032683, 7.27235830, 0.99837043, 0.99913977, 0.49319229],
-												 [	-6.27289193, -0.00053331, 0.00032677, 7.27235862, 0.99837071, 0.99913992, 0.49319228],
-												 [	-6.27289215, -0.00053322, 0.00032672, 7.27235893, 0.99837099, 0.99914006, 0.49319230],
-												 [	-6.27289237, -0.00053313, 0.00032666, 7.27235924, 0.99837127, 0.99914021, 0.49319236],
-												 [	-6.27289259, -0.00053304, 0.00032660, 7.27235955, 0.99837155, 0.99914036, 0.49319240],
-												 [	-6.27289281, -0.00053294, 0.00032655, 7.27235986, 0.99837183, 0.99914051, 0.49319244],
-												 [	-6.27289303, -0.00053285, 0.00032649, 7.27236017, 0.99837211, 0.99914066, 0.49319243],
-												 [	-6.27289325, -0.00053276, 0.00032643, 7.27236048, 0.99837239, 0.99914080, 0.49319249],
-												 [	-6.27289346, -0.00053267, 0.00032638, 7.27236080, 0.99837267, 0.99914095, 0.49319257],
-												 [	-6.27289368, -0.00053258, 0.00032632, 7.27236111, 0.99837295, 0.99914110, 0.49319253],
-												 [	-6.27289390, -0.00053249, 0.00032627, 7.27236142, 0.99837323, 0.99914125, 0.49319261],
-												 [	-6.27289412, -0.00053239, 0.00032621, 7.27236173, 0.99837351, 0.99914140, 0.49319263],
-												 [	-6.27289434, -0.00053230, 0.00032615, 7.27236204, 0.99837379, 0.99914154, 0.49319267],
-												 [	-6.27289456, -0.00053221, 0.00032610, 7.27236235, 0.99837407, 0.99914169, 0.49319271],
-												 [	-6.27289478, -0.00053212, 0.00032604, 7.27236266, 0.99837435, 0.99914184, 0.49319271],
-												 [	-6.27289500, -0.00053203, 0.00032599, 7.27236297, 0.99837463, 0.99914199, 0.49319270],
-												 [	-6.27289522, -0.00053194, 0.00032593, 7.27236328, 0.99837491, 0.99914213, 0.49319278],
-												 [	-6.27289544, -0.00053185, 0.00032587, 7.27236359, 0.99837519, 0.99914228, 0.49319281],
-												 [	-6.27289565, -0.00053175, 0.00032582, 7.27236390, 0.99837547, 0.99914243, 0.49319284],
-												 [	-6.27289587, -0.00053166, 0.00032576, 7.27236421, 0.99837575, 0.99914258, 0.49319286],
-												 [	-6.27289609, -0.00053157, 0.00032571, 7.27236452, 0.99837603, 0.99914272, 0.49319287],
-												 [	-6.27289631, -0.00053148, 0.00032565, 7.27236483, 0.99837631, 0.99914287, 0.49319297],
-												 [	-6.27289653, -0.00053139, 0.00032559, 7.27236514, 0.99837659, 0.99914302, 0.49319300],
-												 [	-6.27289675, -0.00053130, 0.00032554, 7.27236545, 0.99837687, 0.99914316, 0.49319302],
-												 [	-6.27289696, -0.00053121, 0.00032548, 7.27236576, 0.99837714, 0.99914331, 0.49319305],
-												 [	-6.27289718, -0.00053112, 0.00032543, 7.27236607, 0.99837742, 0.99914346, 0.49319306],
-												 [	-6.27289740, -0.00053102, 0.00032537, 7.27236638, 0.99837770, 0.99914361, 0.49319318],
-												 [	-6.27289762, -0.00053093, 0.00032531, 7.27236668, 0.99837798, 0.99914375, 0.49319313],
-												 [	-6.27289784, -0.00053084, 0.00032526, 7.27236699, 0.99837826, 0.99914390, 0.49319318],
-												 [	-6.27289805, -0.00053075, 0.00032520, 7.27236730, 0.99837854, 0.99914405, 0.49319320],
-												 [	-6.27289827, -0.00053066, 0.00032515, 7.27236761, 0.99837881, 0.99914419, 0.49319315],
-												 [	-6.27289849, -0.00053057, 0.00032509, 7.27236792, 0.99837909, 0.99914434, 0.49319329],
-												 [	-6.27289871, -0.00053048, 0.00032504, 7.27236823, 0.99837937, 0.99914449, 0.49319329],
-												 [	-6.27289892, -0.00053039, 0.00032498, 7.27236854, 0.99837965, 0.99914463, 0.49319336],
-												 [	-6.27289914, -0.00053030, 0.00032492, 7.27236884, 0.99837993, 0.99914478, 0.49319338],
-												 [	-6.27289936, -0.00053021, 0.00032487, 7.27236915, 0.99838020, 0.99914493, 0.49319340],
-												 [	-6.27289958, -0.00053012, 0.00032481, 7.27236946, 0.99838048, 0.99914507, 0.49319339],
-												 [	-6.27289979, -0.00053002, 0.00032476, 7.27236977, 0.99838076, 0.99914522, 0.49319350],
-												 [	-6.27290001, -0.00052993, 0.00032470, 7.27237008, 0.99838104, 0.99914536, 0.49319352],
-												 [	-6.27290023, -0.00052984, 0.00032465, 7.27237038, 0.99838131, 0.99914551, 0.49319359],
-												 [	-6.27290044, -0.00052975, 0.00032459, 7.27237069, 0.99838159, 0.99914566, 0.49319354],
-												 [	-6.27290066, -0.00052966, 0.00032453, 7.27237100, 0.99838187, 0.99914580, 0.49319355],
-												 [	-6.27290088, -0.00052957, 0.00032448, 7.27237131, 0.99838214, 0.99914595, 0.49319365],
-												 [	-6.27290109, -0.00052948, 0.00032442, 7.27237161, 0.99838242, 0.99914610, 0.49319372],
-												 [	-6.27290131, -0.00052939, 0.00032437, 7.27237192, 0.99838270, 0.99914624, 0.49319371],
-												 [	-6.27290153, -0.00052930, 0.00032431, 7.27237223, 0.99838297, 0.99914639, 0.49319369],
-												 [	-6.27290174, -0.00052921, 0.00032426, 7.27237254, 0.99838325, 0.99914653, 0.49319379],
-												 [	-6.27290196, -0.00052912, 0.00032420, 7.27237284, 0.99838353, 0.99914668, 0.49319379],
-												 [	-6.27290218, -0.00052903, 0.00032415, 7.27237315, 0.99838380, 0.99914683, 0.49319387],
-												 [	-6.27290239, -0.00052894, 0.00032409, 7.27237346, 0.99838408, 0.99914697, 0.49319384],
-												 [	-6.27290261, -0.00052885, 0.00032404, 7.27237376, 0.99838436, 0.99914712, 0.49319390],
-												 [	-6.27290283, -0.00052876, 0.00032398, 7.27237407, 0.99838463, 0.99914726, 0.49319391],
-												 [	-6.27290304, -0.00052867, 0.00032392, 7.27237438, 0.99838491, 0.99914741, 0.49319397],
-												 [	-6.27290326, -0.00052858, 0.00032387, 7.27237468, 0.99838518, 0.99914755, 0.49319399],
-												 [	-6.27290347, -0.00052849, 0.00032381, 7.27237499, 0.99838546, 0.99914770, 0.49319399],
-												 [	-6.27290369, -0.00052840, 0.00032376, 7.27237529, 0.99838574, 0.99914785, 0.49319402],
-												 [	-6.27290391, -0.00052831, 0.00032370, 7.27237560, 0.99838601, 0.99914799, 0.49319410],
-												 [	-6.27290412, -0.00052822, 0.00032365, 7.27237591, 0.99838629, 0.99914814, 0.49319411],
-												 [	-6.27290434, -0.00052813, 0.00032359, 7.27237621, 0.99838656, 0.99914828, 0.49319417],
-												 [	-6.27290455, -0.00052804, 0.00032354, 7.27237652, 0.99838684, 0.99914843, 0.49319421],
-												 [	-6.27290477, -0.00052795, 0.00032348, 7.27237682, 0.99838711, 0.99914857, 0.49319423],
-												 [	-6.27290498, -0.00052786, 0.00032343, 7.27237713, 0.99838739, 0.99914872, 0.49319424],
-												 [	-6.27290520, -0.00052777, 0.00032337, 7.27237743, 0.99838766, 0.99914886, 0.49319429],
-												 [	-6.27290541, -0.00052768, 0.00032332, 7.27237774, 0.99838794, 0.99914901, 0.49319426],
-												 [	-6.27290563, -0.00052759, 0.00032326, 7.27237804, 0.99838821, 0.99914915, 0.49319434],
-												 [	-6.27290584, -0.00052750, 0.00032321, 7.27237835, 0.99838849, 0.99914930, 0.49319436],
-												 [	-6.27290606, -0.00052741, 0.00032315, 7.27237865, 0.99838876, 0.99914944, 0.49319441],
-												 [	-6.27290627, -0.00052732, 0.00032310, 7.27237896, 0.99838904, 0.99914959, 0.49319443],
-												 [	-6.27290649, -0.00052723, 0.00032304, 7.27237926, 0.99838931, 0.99914973, 0.49319450],
-												 [	-6.27290670, -0.00052714, 0.00032299, 7.27237957, 0.99838959, 0.99914988, 0.49319447],
-												 [	-6.27290692, -0.00052705, 0.00032293, 7.27237987, 0.99838986, 0.99915002, 0.49319454],
-												 [	-6.27290713, -0.00052696, 0.00032288, 7.27238018, 0.99839013, 0.99915017, 0.49319453],
-												 [	-6.27290735, -0.00052687, 0.00032282, 7.27238048, 0.99839041, 0.99915031, 0.49319457],
-												 [	-6.27290756, -0.00052678, 0.00032277, 7.27238078, 0.99839068, 0.99915046, 0.49319463],
-												 [	-6.27290778, -0.00052669, 0.00032271, 7.27238109, 0.99839096, 0.99915060, 0.49319468],
-												 [	-6.27290799, -0.00052660, 0.00032266, 7.27238139, 0.99839123, 0.99915075, 0.49319471],
-												 [	-6.27290821, -0.00052651, 0.00032260, 7.27238170, 0.99839150, 0.99915089, 0.49319472],
-												 [	-6.27290842, -0.00052642, 0.00032255, 7.27238200, 0.99839178, 0.99915103, 0.49319477],
-												 [	-6.27290863, -0.00052633, 0.00032249, 7.27238230, 0.99839205, 0.99915118, 0.49319479],
-												 [	-6.27290885, -0.00052624, 0.00032244, 7.27238261, 0.99839232, 0.99915132, 0.49319479],
-												 [	-6.27290906, -0.00052615, 0.00032238, 7.27238291, 0.99839260, 0.99915147, 0.49319486],
-												 [	-6.27290928, -0.00052606, 0.00032233, 7.27238321, 0.99839287, 0.99915161, 0.49319496],
-												 [	-6.27290949, -0.00052597, 0.00032227, 7.27238352, 0.99839314, 0.99915176, 0.49319494],
-												 [	-6.27290970, -0.00052588, 0.00032222, 7.27238382, 0.99839342, 0.99915190, 0.49319490],
-												 [	-6.27290992, -0.00052579, 0.00032216, 7.27238412, 0.99839369, 0.99915204, 0.49319495],
-												 [	-6.27291013, -0.00052570, 0.00032211, 7.27238443, 0.99839396, 0.99915219, 0.49319503],
-												 [	-6.27291034, -0.00052561, 0.00032205, 7.27238473, 0.99839424, 0.99915233, 0.49319499],
-												 [	-6.27291056, -0.00052553, 0.00032200, 7.27238503, 0.99839451, 0.99915248, 0.49319506],
-												 [	-6.27291077, -0.00052544, 0.00032194, 7.27238534, 0.99839478, 0.99915262, 0.49319516],
-												 [	-6.27291098, -0.00052535, 0.00032189, 7.27238564, 0.99839505, 0.99915276, 0.49319515],
-												 [	-6.27291120, -0.00052526, 0.00032183, 7.27238594, 0.99839533, 0.99915291, 0.49319519],
-												 [	-6.27291141, -0.00052517, 0.00032178, 7.27238624, 0.99839560, 0.99915305, 0.49319519],
-												 [	-6.27291162, -0.00052508, 0.00032173, 7.27238654, 0.99839587, 0.99915320, 0.49319522],
-												 [	-6.27291184, -0.00052499, 0.00032167, 7.27238685, 0.99839614, 0.99915334, 0.49319528],
-												 [	-6.27291205, -0.00052490, 0.00032162, 7.27238715, 0.99839642, 0.99915348, 0.49319533],
-												 [	-6.27291226, -0.00052481, 0.00032156, 7.27238745, 0.99839669, 0.99915363, 0.49319536],
-												 [	-6.27291248, -0.00052472, 0.00032151, 7.27238775, 0.99839696, 0.99915377, 0.49319537],
-												 [	-6.27291269, -0.00052463, 0.00032145, 7.27238805, 0.99839723, 0.99915391, 0.49319544],
-												 [	-6.27291290, -0.00052455, 0.00032140, 7.27238836, 0.99839750, 0.99915406, 0.49319545],
-												 [	-6.27291311, -0.00052446, 0.00032134, 7.27238866, 0.99839777, 0.99915420, 0.49319547],
-												 [	-6.27291333, -0.00052437, 0.00032129, 7.27238896, 0.99839805, 0.99915434, 0.49319547],
-												 [	-6.27291354, -0.00052428, 0.00032123, 7.27238926, 0.99839832, 0.99915449, 0.49319552],
-												 [	-6.27291375, -0.00052419, 0.00032118, 7.27238956, 0.99839859, 0.99915463, 0.49319555],
-												 [	-6.27291396, -0.00052410, 0.00032113, 7.27238986, 0.99839886, 0.99915477, 0.49319555],
-												 [	-6.27291418, -0.00052401, 0.00032107, 7.27239016, 0.99839913, 0.99915492, 0.49319565],
-												 [	-6.27291439, -0.00052392, 0.00032102, 7.27239046, 0.99839940, 0.99915506, 0.49319563],
-												 [	-6.27291460, -0.00052384, 0.00032096, 7.27239077, 0.99839967, 0.99915520, 0.49319565],
-												 [	-6.27291481, -0.00052375, 0.00032091, 7.27239107, 0.99839994, 0.99915534, 0.49319571],
-												 [	-6.27291503, -0.00052366, 0.00032085, 7.27239137, 0.99840021, 0.99915549, 0.49319576],
-												 [	-6.27291524, -0.00052357, 0.00032080, 7.27239167, 0.99840049, 0.99915563, 0.49319577],
-												 [	-6.27291545, -0.00052348, 0.00032075, 7.27239197, 0.99840076, 0.99915577, 0.49319579],
-												 [	-6.27291566, -0.00052339, 0.00032069, 7.27239227, 0.99840103, 0.99915592, 0.49319582],
-												 [	-6.27291587, -0.00052330, 0.00032064, 7.27239257, 0.99840130, 0.99915606, 0.49319587],
-												 [	-6.27291608, -0.00052322, 0.00032058, 7.27239287, 0.99840157, 0.99915620, 0.49319592],
-												 [	-6.27291630, -0.00052313, 0.00032053, 7.27239317, 0.99840184, 0.99915634, 0.49319593],
-												 [	-6.27291651, -0.00052304, 0.00032047, 7.27239347, 0.99840211, 0.99915649, 0.49319594],
-												 [	-6.27291672, -0.00052295, 0.00032042, 7.27239377, 0.99840238, 0.99915663, 0.49319596],
-												 [	-6.27291693, -0.00052286, 0.00032037, 7.27239407, 0.99840265, 0.99915677, 0.49319602],
-												 [	-6.27291714, -0.00052277, 0.00032031, 7.27239437, 0.99840292, 0.99915691, 0.49319607],
-												 [	-6.27291735, -0.00052269, 0.00032026, 7.27239467, 0.99840319, 0.99915706, 0.49319609],
-												 [	-6.27291756, -0.00052260, 0.00032020, 7.27239497, 0.99840346, 0.99915720, 0.49319609],
-												 [	-6.27291777, -0.00052251, 0.00032015, 7.27239526, 0.99840373, 0.99915734, 0.49319619],
-												 [	-6.27291799, -0.00052242, 0.00032010, 7.27239556, 0.99840400, 0.99915748, 0.49319624],
-												 [	-6.27291820, -0.00052233, 0.00032004, 7.27239586, 0.99840427, 0.99915763, 0.49319616],
-												 [	-6.27291841, -0.00052225, 0.00031999, 7.27239616, 0.99840453, 0.99915777, 0.49319625],
-												 [	-6.27291862, -0.00052216, 0.00031993, 7.27239646, 0.99840480, 0.99915791, 0.49319632],
-												 [	-6.27291883, -0.00052207, 0.00031988, 7.27239676, 0.99840507, 0.99915805, 0.49319625],
-												 [	-6.27291904, -0.00052198, 0.00031983, 7.27239706, 0.99840534, 0.99915819, 0.49319634],
-												 [	-6.27291925, -0.00052189, 0.00031977, 7.27239736, 0.99840561, 0.99915834, 0.49319638],
-												 [	-6.27291946, -0.00052180, 0.00031972, 7.27239766, 0.99840588, 0.99915848, 0.49319640],
-												 [	-6.27291967, -0.00052172, 0.00031966, 7.27239795, 0.99840615, 0.99915862, 0.49319643],
-												 [	-6.27291988, -0.00052163, 0.00031961, 7.27239825, 0.99840642, 0.99915876, 0.49319646],
-												 [	-6.27292009, -0.00052154, 0.00031956, 7.27239855, 0.99840669, 0.99915890, 0.49319643],
-												 [	-6.27292030, -0.00052145, 0.00031950, 7.27239885, 0.99840695, 0.99915904, 0.49319651],
-												 [	-6.27292051, -0.00052137, 0.00031945, 7.27239915, 0.99840722, 0.99915919, 0.49319652],
-												 [	-6.27292072, -0.00052128, 0.00031939, 7.27239944, 0.99840749, 0.99915933, 0.49319657],
-												 [	-6.27292093, -0.00052119, 0.00031934, 7.27239974, 0.99840776, 0.99915947, 0.49319663],
-												 [	-6.27292114, -0.00052110, 0.00031929, 7.27240004, 0.99840803, 0.99915961, 0.49319665],
-												 [	-6.27292135, -0.00052101, 0.00031923, 7.27240034, 0.99840830, 0.99915975, 0.49319671],
-												 [	-6.27292156, -0.00052093, 0.00031918, 7.27240063, 0.99840856, 0.99915989, 0.49319676],
-												 [	-6.27292177, -0.00052084, 0.00031913, 7.27240093, 0.99840883, 0.99916004, 0.49319677],
-												 [	-6.27292198, -0.00052075, 0.00031907, 7.27240123, 0.99840910, 0.99916018, 0.49319672],
-												 [	-6.27292219, -0.00052066, 0.00031902, 7.27240153, 0.99840937, 0.99916032, 0.49319676],
-												 [	-6.27292240, -0.00052058, 0.00031896, 7.27240182, 0.99840964, 0.99916046, 0.49319684],
-												 [	-6.27292261, -0.00052049, 0.00031891, 7.27240212, 0.99840990, 0.99916060, 0.49319683],
-												 [	-6.27292282, -0.00052040, 0.00031886, 7.27240242, 0.99841017, 0.99916074, 0.49319688],
-												 [	-6.27292303, -0.00052031, 0.00031880, 7.27240271, 0.99841044, 0.99916088, 0.49319696],
-												 [	-6.27292324, -0.00052023, 0.00031875, 7.27240301, 0.99841070, 0.99916102, 0.49319696],
-												 [	-6.27292345, -0.00052014, 0.00031870, 7.27240331, 0.99841097, 0.99916117, 0.49319698],
-												 [	-6.27292366, -0.00052005, 0.00031864, 7.27240360, 0.99841124, 0.99916131, 0.49319702],
-												 [	-6.27292386, -0.00051996, 0.00031859, 7.27240390, 0.99841151, 0.99916145, 0.49319705],
-												 [	-6.27292407, -0.00051988, 0.00031854, 7.27240420, 0.99841177, 0.99916159, 0.49319708],
-												 [	-6.27292428, -0.00051979, 0.00031848, 7.27240449, 0.99841204, 0.99916173, 0.49319705],
-												 [	-6.27292449, -0.00051970, 0.00031843, 7.27240479, 0.99841231, 0.99916187, 0.49319715],
-												 [	-6.27292470, -0.00051962, 0.00031837, 7.27240508, 0.99841257, 0.99916201, 0.49319716],
-												 [	-6.27292491, -0.00051953, 0.00031832, 7.27240538, 0.99841284, 0.99916215, 0.49319722],
-												 [	-6.27292512, -0.00051944, 0.00031827, 7.27240568, 0.99841311, 0.99916229, 0.49319725],
-												 [	-6.27292533, -0.00051935, 0.00031821, 7.27240597, 0.99841337, 0.99916243, 0.49319725],
-												 [	-6.27292553, -0.00051927, 0.00031816, 7.27240627, 0.99841364, 0.99916257, 0.49319734],
-												 [	-6.27292574, -0.00051918, 0.00031811, 7.27240656, 0.99841390, 0.99916271, 0.49319744],
-												 [	-6.27292595, -0.00051909, 0.00031805, 7.27240686, 0.99841417, 0.99916285, 0.49319739],
-												 [	-6.27292616, -0.00051901, 0.00031800, 7.27240715, 0.99841444, 0.99916299, 0.49319736],
-												 [	-6.27292637, -0.00051892, 0.00031795, 7.27240745, 0.99841470, 0.99916313, 0.49319748],
-												 [	-6.27292658, -0.00051883, 0.00031789, 7.27240774, 0.99841497, 0.99916327, 0.49319747],
-												 [	-6.27292678, -0.00051874, 0.00031784, 7.27240804, 0.99841523, 0.99916341, 0.49319748],
-												 [	-6.27292699, -0.00051866, 0.00031779, 7.27240833, 0.99841550, 0.99916355, 0.49319753],
-												 [	-6.27292720, -0.00051857, 0.00031773, 7.27240863, 0.99841577, 0.99916369, 0.49319759],
-												 [	-6.27292741, -0.00051848, 0.00031768, 7.27240892, 0.99841603, 0.99916384, 0.49319759],
-												 [	-6.27292762, -0.00051840, 0.00031763, 7.27240922, 0.99841630, 0.99916398, 0.49319759],
-												 [	-6.27292782, -0.00051831, 0.00031757, 7.27240951, 0.99841656, 0.99916412, 0.49319764],
-												 [	-6.27292803, -0.00051822, 0.00031752, 7.27240981, 0.99841683, 0.99916426, 0.49319769],
-												 [	-6.27292824, -0.00051814, 0.00031747, 7.27241010, 0.99841709, 0.99916440, 0.49319768],
-												 [	-6.27292845, -0.00051805, 0.00031742, 7.27241040, 0.99841736, 0.99916453, 0.49319773],
-												 [	-6.27292865, -0.00051796, 0.00031736, 7.27241069, 0.99841762, 0.99916467, 0.49319777],
-												 [	-6.27292886, -0.00051788, 0.00031731, 7.27241098, 0.99841789, 0.99916481, 0.49319789],
-												 [	-6.27292907, -0.00051779, 0.00031726, 7.27241128, 0.99841815, 0.99916495, 0.49319781],
-												 [	-6.27292927, -0.00051770, 0.00031720, 7.27241157, 0.99841842, 0.99916509, 0.49319785],
-												 [	-6.27292948, -0.00051762, 0.00031715, 7.27241186, 0.99841868, 0.99916523, 0.49319784],
-												 [	-6.27292969, -0.00051753, 0.00031710, 7.27241216, 0.99841895, 0.99916537, 0.49319795],
-												 [	-6.27292990, -0.00051744, 0.00031704, 7.27241245, 0.99841921, 0.99916551, 0.49319794],
-												 [	-6.27293010, -0.00051736, 0.00031699, 7.27241275, 0.99841947, 0.99916565, 0.49319797],
-												 [	-6.27293031, -0.00051727, 0.00031694, 7.27241304, 0.99841974, 0.99916579, 0.49319807],
-												 [	-6.27293052, -0.00051718, 0.00031688, 7.27241333, 0.99842000, 0.99916593, 0.49319800],
-												 [	-6.27293072, -0.00051710, 0.00031683, 7.27241363, 0.99842027, 0.99916607, 0.49319809],
-												 [	-6.27293093, -0.00051701, 0.00031678, 7.27241392, 0.99842053, 0.99916621, 0.49319811],
-												 [	-6.27293114, -0.00051693, 0.00031673, 7.27241421, 0.99842079, 0.99916635, 0.49319811],
-												 [	-6.27293134, -0.00051684, 0.00031667, 7.27241450, 0.99842106, 0.99916649, 0.49319817],
-												 [	-6.27293155, -0.00051675, 0.00031662, 7.27241480, 0.99842132, 0.99916663, 0.49319820],
-												 [	-6.27293176, -0.00051667, 0.00031657, 7.27241509, 0.99842159, 0.99916677, 0.49319821],
-												 [	-6.27293196, -0.00051658, 0.00031651, 7.27241538, 0.99842185, 0.99916691, 0.49319833],
-												 [	-6.27293217, -0.00051649, 0.00031646, 7.27241567, 0.99842211, 0.99916704, 0.49319829],
-												 [	-6.27293237, -0.00051641, 0.00031641, 7.27241597, 0.99842238, 0.99916718, 0.49319831],
-												 [	-6.27293258, -0.00051632, 0.00031636, 7.27241626, 0.99842264, 0.99916732, 0.49319838],
-												 [	-6.27293279, -0.00051624, 0.00031630, 7.27241655, 0.99842290, 0.99916746, 0.49319843],
-												 [	-6.27293299, -0.00051615, 0.00031625, 7.27241684, 0.99842316, 0.99916760, 0.49319840],
-												 [	-6.27293320, -0.00051606, 0.00031620, 7.27241713, 0.99842343, 0.99916774, 0.49319841],
-												 [	-6.27293340, -0.00051598, 0.00031614, 7.27241743, 0.99842369, 0.99916788, 0.49319849],
-												 [	-6.27293361, -0.00051589, 0.00031609, 7.27241772, 0.99842395, 0.99916802, 0.49319850],
-												 [	-6.27293382, -0.00051581, 0.00031604, 7.27241801, 0.99842422, 0.99916816, 0.49319856],
-												 [	-6.27293402, -0.00051572, 0.00031599, 7.27241830, 0.99842448, 0.99916829, 0.49319860],
-												 [	-6.27293423, -0.00051563, 0.00031593, 7.27241859, 0.99842474, 0.99916843, 0.49319855],
-												 [	-6.27293443, -0.00051555, 0.00031588, 7.27241888, 0.99842500, 0.99916857, 0.49319861],
-												 [	-6.27293464, -0.00051546, 0.00031583, 7.27241918, 0.99842527, 0.99916871, 0.49319870],
-												 [	-6.27293484, -0.00051538, 0.00031578, 7.27241947, 0.99842553, 0.99916885, 0.49319866],
-												 [	-6.27293505, -0.00051529, 0.00031572, 7.27241976, 0.99842579, 0.99916899, 0.49319873],
-												 [	-6.27293525, -0.00051520, 0.00031567, 7.27242005, 0.99842605, 0.99916912, 0.49319872],
-												 [	-6.27293546, -0.00051512, 0.00031562, 7.27242034, 0.99842632, 0.99916926, 0.49319875],
-												 [	-6.27293566, -0.00051503, 0.00031557, 7.27242063, 0.99842658, 0.99916940, 0.49319885],
-												 [	-6.27293587, -0.00051495, 0.00031551, 7.27242092, 0.99842684, 0.99916954, 0.49319881],
-												 [	-6.27293607, -0.00051486, 0.00031546, 7.27242121, 0.99842710, 0.99916968, 0.49319885],
-												 [	-6.27293628, -0.00051478, 0.00031541, 7.27242150, 0.99842736, 0.99916982, 0.49319897],
-												 [	-6.27293648, -0.00051469, 0.00031536, 7.27242179, 0.99842762, 0.99916995, 0.49319898],
-												 [	-6.27293669, -0.00051461, 0.00031530, 7.27242208, 0.99842789, 0.99917009, 0.49319895],
-												 [	-6.27293689, -0.00051452, 0.00031525, 7.27242237, 0.99842815, 0.99917023, 0.49319902],
-												 [	-6.27293710, -0.00051443, 0.00031520, 7.27242266, 0.99842841, 0.99917037, 0.49319899],
-												 [	-6.27293730, -0.00051435, 0.00031515, 7.27242295, 0.99842867, 0.99917051, 0.49319907],
-												 [	-6.27293751, -0.00051426, 0.00031509, 7.27242324, 0.99842893, 0.99917064, 0.49319910],
-												 [	-6.27293771, -0.00051418, 0.00031504, 7.27242353, 0.99842919, 0.99917078, 0.49319911],
-												 [	-6.27293792, -0.00051409, 0.00031499, 7.27242382, 0.99842945, 0.99917092, 0.49319911],
-												 [	-6.27293812, -0.00051401, 0.00031494, 7.27242411, 0.99842971, 0.99917106, 0.49319918],
-												 [	-6.27293832, -0.00051392, 0.00031488, 7.27242440, 0.99842997, 0.99917119, 0.49319923],
-												 [	-6.27293853, -0.00051384, 0.00031483, 7.27242469, 0.99843024, 0.99917133, 0.49319919],
-												 [	-6.27293873, -0.00051375, 0.00031478, 7.27242498, 0.99843050, 0.99917147, 0.49319924],
-												 [	-6.27293894, -0.00051367, 0.00031473, 7.27242527, 0.99843076, 0.99917161, 0.49319925],
-												 [	-6.27293914, -0.00051358, 0.00031467, 7.27242556, 0.99843102, 0.99917174, 0.49319934],
-												 [	-6.27293934, -0.00051350, 0.00031462, 7.27242585, 0.99843128, 0.99917188, 0.49319932],
-												 [	-6.27293955, -0.00051341, 0.00031457, 7.27242614, 0.99843154, 0.99917202, 0.49319938],
-												 [	-6.27293975, -0.00051333, 0.00031452, 7.27242643, 0.99843180, 0.99917216, 0.49319942],
-												 [	-6.27293995, -0.00051324, 0.00031447, 7.27242671, 0.99843206, 0.99917229, 0.49319947],
-												 [	-6.27294016, -0.00051315, 0.00031441, 7.27242700, 0.99843232, 0.99917243, 0.49319948],
-												 [	-6.27294036, -0.00051307, 0.00031436, 7.27242729, 0.99843258, 0.99917257, 0.49319954],
-												 [	-6.27294057, -0.00051298, 0.00031431, 7.27242758, 0.99843284, 0.99917271, 0.49319956],
-												 [	-6.27294077, -0.00051290, 0.00031426, 7.27242787, 0.99843310, 0.99917284, 0.49319957],
-												 [	-6.27294097, -0.00051281, 0.00031421, 7.27242816, 0.99843336, 0.99917298, 0.49319962],
-												 [	-6.27294118, -0.00051273, 0.00031415, 7.27242845, 0.99843362, 0.99917312, 0.49319969],
-												 [	-6.27294138, -0.00051265, 0.00031410, 7.27242873, 0.99843388, 0.99917325, 0.49319972],
-												 [	-6.27294158, -0.00051256, 0.00031405, 7.27242902, 0.99843414, 0.99917339, 0.49319967],
-												 [	-6.27294178, -0.00051248, 0.00031400, 7.27242931, 0.99843439, 0.99917353, 0.49319971],
-												 [	-6.27294199, -0.00051239, 0.00031395, 7.27242960, 0.99843465, 0.99917366, 0.49319975],
-												 [	-6.27294219, -0.00051231, 0.00031389, 7.27242988, 0.99843491, 0.99917380, 0.49319976],
-												 [	-6.27294239, -0.00051222, 0.00031384, 7.27243017, 0.99843517, 0.99917394, 0.49319985],
-												 [	-6.27294260, -0.00051214, 0.00031379, 7.27243046, 0.99843543, 0.99917407, 0.49319980],
-												 [	-6.27294280, -0.00051205, 0.00031374, 7.27243075, 0.99843569, 0.99917421, 0.49319987],
-												 [	-6.27294300, -0.00051197, 0.00031369, 7.27243103, 0.99843595, 0.99917435, 0.49319991],
-												 [	-6.27294320, -0.00051188, 0.00031363, 7.27243132, 0.99843621, 0.99917448, 0.49319996],
-												 [	-6.27294341, -0.00051180, 0.00031358, 7.27243161, 0.99843647, 0.99917462, 0.49320001],
-												 [	-6.27294361, -0.00051171, 0.00031353, 7.27243190, 0.99843673, 0.99917476, 0.49319998],
-												 [	-6.27294381, -0.00051163, 0.00031348, 7.27243218, 0.99843698, 0.99917489, 0.49320000],
-												 [	-6.27294401, -0.00051154, 0.00031343, 7.27243247, 0.99843724, 0.99917503, 0.49320003],
-												 [	-6.27294422, -0.00051146, 0.00031337, 7.27243276, 0.99843750, 0.99917517, 0.49320007],
-												 [	-6.27294442, -0.00051137, 0.00031332, 7.27243304, 0.99843776, 0.99917530, 0.49320006],
-												 [	-6.27294462, -0.00051129, 0.00031327, 7.27243333, 0.99843802, 0.99917544, 0.49320012],
-												 [	-6.27294482, -0.00051121, 0.00031322, 7.27243362, 0.99843827, 0.99917558, 0.49320018],
-												 [	-6.27294502, -0.00051112, 0.00031317, 7.27243390, 0.99843853, 0.99917571, 0.49320018],
-												 [	-6.27294523, -0.00051104, 0.00031312, 7.27243419, 0.99843879, 0.99917585, 0.49320017],
-												 [	-6.27294543, -0.00051095, 0.00031306, 7.27243448, 0.99843905, 0.99917598, 0.49320022],
-												 [	-6.27294563, -0.00051087, 0.00031301, 7.27243476, 0.99843931, 0.99917612, 0.49320033],
-												 [	-6.27294583, -0.00051078, 0.00031296, 7.27243505, 0.99843956, 0.99917626, 0.49320035],
-												 [	-6.27294603, -0.00051070, 0.00031291, 7.27243533, 0.99843982, 0.99917639, 0.49320035],
-												 [	-6.27294623, -0.00051062, 0.00031286, 7.27243562, 0.99844008, 0.99917653, 0.49320037],
-												 [	-6.27294644, -0.00051053, 0.00031281, 7.27243590, 0.99844034, 0.99917666, 0.49320040],
-												 [	-6.27294664, -0.00051045, 0.00031275, 7.27243619, 0.99844059, 0.99917680, 0.49320046],
-												 [	-6.27294684, -0.00051036, 0.00031270, 7.27243648, 0.99844085, 0.99917693, 0.49320050],
-												 [	-6.27294704, -0.00051028, 0.00031265, 7.27243676, 0.99844111, 0.99917707, 0.49320049],
-												 [	-6.27294724, -0.00051019, 0.00031260, 7.27243705, 0.99844136, 0.99917721, 0.49320054],
-												 [	-6.27294744, -0.00051011, 0.00031255, 7.27243733, 0.99844162, 0.99917734, 0.49320055],
-												 [	-6.27294764, -0.00051003, 0.00031250, 7.27243762, 0.99844188, 0.99917748, 0.49320064],
-												 [	-6.27294784, -0.00050994, 0.00031244, 7.27243790, 0.99844214, 0.99917761, 0.49320065],
-												 [	-6.27294805, -0.00050986, 0.00031239, 7.27243819, 0.99844239, 0.99917775, 0.49320067],
-												 [	-6.27294825, -0.00050977, 0.00031234, 7.27243847, 0.99844265, 0.99917788, 0.49320073],
-												 [	-6.27294845, -0.00050969, 0.00031229, 7.27243876, 0.99844291, 0.99917802, 0.49320072],
-												 [	-6.27294865, -0.00050961, 0.00031224, 7.27243904, 0.99844316, 0.99917815, 0.49320076],
-												 [	-6.27294885, -0.00050952, 0.00031219, 7.27243933, 0.99844342, 0.99917829, 0.49320077],
-												 [	-6.27294905, -0.00050944, 0.00031214, 7.27243961, 0.99844367, 0.99917843, 0.49320076],
-												 [	-6.27294925, -0.00050936, 0.00031208, 7.27243989, 0.99844393, 0.99917856, 0.49320084],
-												 [	-6.27294945, -0.00050927, 0.00031203, 7.27244018, 0.99844419, 0.99917870, 0.49320087],
-												 [	-6.27294965, -0.00050919, 0.00031198, 7.27244046, 0.99844444, 0.99917883, 0.49320088],
-												 [	-6.27294985, -0.00050910, 0.00031193, 7.27244075, 0.99844470, 0.99917897, 0.49320097],
-												 [	-6.27295005, -0.00050902, 0.00031188, 7.27244103, 0.99844495, 0.99917910, 0.49320091],
-												 [	-6.27295025, -0.00050894, 0.00031183, 7.27244132, 0.99844521, 0.99917924, 0.49320097],
-												 [	-6.27295045, -0.00050885, 0.00031178, 7.27244160, 0.99844547, 0.99917937, 0.49320101],
-												 [	-6.27295065, -0.00050877, 0.00031173, 7.27244188, 0.99844572, 0.99917951, 0.49320102],
-												 [	-6.27295085, -0.00050869, 0.00031167, 7.27244217, 0.99844598, 0.99917964, 0.49320101],
-												 [	-6.27295105, -0.00050860, 0.00031162, 7.27244245, 0.99844623, 0.99917978, 0.49320112],
-												 [	-6.27295125, -0.00050852, 0.00031157, 7.27244273, 0.99844649, 0.99917991, 0.49320117],
-												 [	-6.27295145, -0.00050844, 0.00031152, 7.27244302, 0.99844674, 0.99918004, 0.49320117],
-												 [	-6.27295165, -0.00050835, 0.00031147, 7.27244330, 0.99844700, 0.99918018, 0.49320119],
-												 [	-6.27295185, -0.00050827, 0.00031142, 7.27244358, 0.99844725, 0.99918031, 0.49320122],
-												 [	-6.27295205, -0.00050818, 0.00031137, 7.27244387, 0.99844751, 0.99918045, 0.49320128],
-												 [	-6.27295225, -0.00050810, 0.00031132, 7.27244415, 0.99844776, 0.99918058, 0.49320130],
-												 [	-6.27295245, -0.00050802, 0.00031126, 7.27244443, 0.99844802, 0.99918072, 0.49320132],
-												 [	-6.27295265, -0.00050793, 0.00031121, 7.27244472, 0.99844827, 0.99918085, 0.49320130],
-												 [	-6.27295285, -0.00050785, 0.00031116, 7.27244500, 0.99844853, 0.99918099, 0.49320137],
-												 [	-6.27295305, -0.00050777, 0.00031111, 7.27244528, 0.99844878, 0.99918112, 0.49320141],
-												 [	-6.27295325, -0.00050768, 0.00031106, 7.27244556, 0.99844904, 0.99918126, 0.49320145],
-												 [	-6.27295345, -0.00050760, 0.00031101, 7.27244585, 0.99844929, 0.99918139, 0.49320144],
-												 [	-6.27295365, -0.00050752, 0.00031096, 7.27244613, 0.99844955, 0.99918152, 0.49320149],
-												 [	-6.27295385, -0.00050743, 0.00031091, 7.27244641, 0.99844980, 0.99918166, 0.49320154],
-												 [	-6.27295404, -0.00050735, 0.00031086, 7.27244669, 0.99845005, 0.99918179, 0.49320156],
-												 [	-6.27295424, -0.00050727, 0.00031081, 7.27244697, 0.99845031, 0.99918193, 0.49320161],
-												 [	-6.27295444, -0.00050719, 0.00031075, 7.27244726, 0.99845056, 0.99918206, 0.49320163],
-												 [	-6.27295464, -0.00050710, 0.00031070, 7.27244754, 0.99845082, 0.99918219, 0.49320168],
-												 [	-6.27295484, -0.00050702, 0.00031065, 7.27244782, 0.99845107, 0.99918233, 0.49320163],
-												 [	-6.27295504, -0.00050694, 0.00031060, 7.27244810, 0.99845132, 0.99918246, 0.49320171],
-												 [	-6.27295524, -0.00050685, 0.00031055, 7.27244838, 0.99845158, 0.99918260, 0.49320174],
-												 [	-6.27295544, -0.00050677, 0.00031050, 7.27244867, 0.99845183, 0.99918273, 0.49320177],
-												 [	-6.27295563, -0.00050669, 0.00031045, 7.27244895, 0.99845208, 0.99918286, 0.49320176],
-												 [	-6.27295583, -0.00050660, 0.00031040, 7.27244923, 0.99845234, 0.99918300, 0.49320182],
-												 [	-6.27295603, -0.00050652, 0.00031035, 7.27244951, 0.99845259, 0.99918313, 0.49320186],
-												 [	-6.27295623, -0.00050644, 0.00031030, 7.27244979, 0.99845284, 0.99918327, 0.49320185],
-												 [	-6.27295643, -0.00050636, 0.00031025, 7.27245007, 0.99845310, 0.99918340, 0.49320186],
-												 [	-6.27295663, -0.00050627, 0.00031019, 7.27245035, 0.99845335, 0.99918353, 0.49320197],
-												 [	-6.27295682, -0.00050619, 0.00031014, 7.27245063, 0.99845360, 0.99918367, 0.49320197],
-												 [	-6.27295702, -0.00050611, 0.00031009, 7.27245091, 0.99845386, 0.99918380, 0.49320194],
-												 [	-6.27295722, -0.00050602, 0.00031004, 7.27245120, 0.99845411, 0.99918393, 0.49320202],
-												 [	-6.27295742, -0.00050594, 0.00030999, 7.27245148, 0.99845436, 0.99918407, 0.49320205],
-												 [	-6.27295762, -0.00050586, 0.00030994, 7.27245176, 0.99845462, 0.99918420, 0.49320207],
-												 [	-6.27295781, -0.00050578, 0.00030989, 7.27245204, 0.99845487, 0.99918433, 0.49320207],
-												 [	-6.27295801, -0.00050569, 0.00030984, 7.27245232, 0.99845512, 0.99918447, 0.49320217],
-												 [	-6.27295821, -0.00050561, 0.00030979, 7.27245260, 0.99845537, 0.99918460, 0.49320221],
-												 [	-6.27295841, -0.00050553, 0.00030974, 7.27245288, 0.99845563, 0.99918473, 0.49320219],
-												 [	-6.27295860, -0.00050545, 0.00030969, 7.27245316, 0.99845588, 0.99918487, 0.49320222],
-												 [	-6.27295880, -0.00050536, 0.00030964, 7.27245344, 0.99845613, 0.99918500, 0.49320228],
-												 [	-6.27295900, -0.00050528, 0.00030959, 7.27245372, 0.99845638, 0.99918513, 0.49320230],
-												 [	-6.27295920, -0.00050520, 0.00030954, 7.27245400, 0.99845663, 0.99918526, 0.49320235],
-												 [	-6.27295939, -0.00050512, 0.00030949, 7.27245428, 0.99845689, 0.99918540, 0.49320231],
-												 [	-6.27295959, -0.00050503, 0.00030944, 7.27245456, 0.99845714, 0.99918553, 0.49320239],
-												 [	-6.27295979, -0.00050495, 0.00030938, 7.27245484, 0.99845739, 0.99918566, 0.49320239],
-												 [	-6.27295998, -0.00050487, 0.00030933, 7.27245512, 0.99845764, 0.99918580, 0.49320243],
-												 [	-6.27296018, -0.00050479, 0.00030928, 7.27245539, 0.99845789, 0.99918593, 0.49320240],
-												 [	-6.27296038, -0.00050470, 0.00030923, 7.27245567, 0.99845814, 0.99918606, 0.49320248],
-												 [	-6.27296058, -0.00050462, 0.00030918, 7.27245595, 0.99845840, 0.99918619, 0.49320254],
-												 [	-6.27296077, -0.00050454, 0.00030913, 7.27245623, 0.99845865, 0.99918633, 0.49320254],
-												 [	-6.27296097, -0.00050446, 0.00030908, 7.27245651, 0.99845890, 0.99918646, 0.49320257],
-												 [	-6.27296117, -0.00050438, 0.00030903, 7.27245679, 0.99845915, 0.99918659, 0.49320260],
-												 [	-6.27296136, -0.00050429, 0.00030898, 7.27245707, 0.99845940, 0.99918673, 0.49320260],
-												 [	-6.27296156, -0.00050421, 0.00030893, 7.27245735, 0.99845965, 0.99918686, 0.49320264],
-												 [	-6.27296176, -0.00050413, 0.00030888, 7.27245763, 0.99845990, 0.99918699, 0.49320270],
-												 [	-6.27296195, -0.00050405, 0.00030883, 7.27245790, 0.99846015, 0.99918712, 0.49320271],
-												 [	-6.27296215, -0.00050397, 0.00030878, 7.27245818, 0.99846040, 0.99918726, 0.49320271],
-												 [	-6.27296234, -0.00050388, 0.00030873, 7.27245846, 0.99846066, 0.99918739, 0.49320279],
-												 [	-6.27296254, -0.00050380, 0.00030868, 7.27245874, 0.99846091, 0.99918752, 0.49320285],
-												 [	-6.27296274, -0.00050372, 0.00030863, 7.27245902, 0.99846116, 0.99918765, 0.49320278],
-												 [	-6.27296293, -0.00050364, 0.00030858, 7.27245930, 0.99846141, 0.99918778, 0.49320286],
-												 [	-6.27296313, -0.00050356, 0.00030853, 7.27245957, 0.99846166, 0.99918792, 0.49320284],
-												 [	-6.27296332, -0.00050347, 0.00030848, 7.27245985, 0.99846191, 0.99918805, 0.49320294],
-												 [	-6.27296352, -0.00050339, 0.00030843, 7.27246013, 0.99846216, 0.99918818, 0.49320297],
-												 [	-6.27296372, -0.00050331, 0.00030838, 7.27246041, 0.99846241, 0.99918831, 0.49320295],
-												 [	-6.27296391, -0.00050323, 0.00030833, 7.27246068, 0.99846266, 0.99918844, 0.49320301],
-												 [	-6.27296411, -0.00050315, 0.00030828, 7.27246096, 0.99846291, 0.99918858, 0.49320303],
-												 [	-6.27296430, -0.00050306, 0.00030823, 7.27246124, 0.99846316, 0.99918871, 0.49320305],
-												 [	-6.27296450, -0.00050298, 0.00030818, 7.27246152, 0.99846341, 0.99918884, 0.49320310],
-												 [	-6.27296469, -0.00050290, 0.00030813, 7.27246179, 0.99846366, 0.99918897, 0.49320314],
-												 [	-6.27296489, -0.00050282, 0.00030808, 7.27246207, 0.99846391, 0.99918910, 0.49320318],
-												 [	-6.27296509, -0.00050274, 0.00030803, 7.27246235, 0.99846416, 0.99918924, 0.49320319],
-												 [	-6.27296528, -0.00050266, 0.00030798, 7.27246263, 0.99846441, 0.99918937, 0.49320326],
-												 [	-6.27296548, -0.00050257, 0.00030793, 7.27246290, 0.99846466, 0.99918950, 0.49320325],
-												 [	-6.27296567, -0.00050249, 0.00030788, 7.27246318, 0.99846490, 0.99918963, 0.49320329],
-												 [	-6.27296587, -0.00050241, 0.00030783, 7.27246346, 0.99846515, 0.99918976, 0.49320330],
-												 [	-6.27296606, -0.00050233, 0.00030778, 7.27246373, 0.99846540, 0.99918989, 0.49320333],
-												 [	-6.27296626, -0.00050225, 0.00030773, 7.27246401, 0.99846565, 0.99919002, 0.49320339],
-												 [	-6.27296645, -0.00050217, 0.00030768, 7.27246429, 0.99846590, 0.99919016, 0.49320339],
-												 [	-6.27296665, -0.00050209, 0.00030763, 7.27246456, 0.99846615, 0.99919029, 0.49320338],
-												 [	-6.27296684, -0.00050200, 0.00030758, 7.27246484, 0.99846640, 0.99919042, 0.49320344],
-												 [	-6.27296704, -0.00050192, 0.00030753, 7.27246511, 0.99846665, 0.99919055, 0.49320353],
-												 [	-6.27296723, -0.00050184, 0.00030748, 7.27246539, 0.99846690, 0.99919068, 0.49320349],
-												 [	-6.27296743, -0.00050176, 0.00030743, 7.27246567, 0.99846715, 0.99919081, 0.49320357],
-												 [	-6.27296762, -0.00050168, 0.00030738, 7.27246594, 0.99846739, 0.99919094, 0.49320354],
-												 [	-6.27296781, -0.00050160, 0.00030733, 7.27246622, 0.99846764, 0.99919108, 0.49320360],
-												 [	-6.27296801, -0.00050152, 0.00030728, 7.27246649, 0.99846789, 0.99919121, 0.49320366],
-												 [	-6.27296820, -0.00050143, 0.00030723, 7.27246677, 0.99846814, 0.99919134, 0.49320363],
-												 [	-6.27296840, -0.00050135, 0.00030718, 7.27246704, 0.99846839, 0.99919147, 0.49320369],
-												 [	-6.27296859, -0.00050127, 0.00030713, 7.27246732, 0.99846864, 0.99919160, 0.49320376],
-												 [	-6.27296879, -0.00050119, 0.00030708, 7.27246760, 0.99846888, 0.99919173, 0.49320377],
-												 [	-6.27296898, -0.00050111, 0.00030703, 7.27246787, 0.99846913, 0.99919186, 0.49320381],
-												 [	-6.27296917, -0.00050103, 0.00030698, 7.27246815, 0.99846938, 0.99919199, 0.49320377],
-												 [	-6.27296937, -0.00050095, 0.00030693, 7.27246842, 0.99846963, 0.99919212, 0.49320384],
-												 [	-6.27296956, -0.00050087, 0.00030688, 7.27246870, 0.99846987, 0.99919225, 0.49320380],
-												 [	-6.27296976, -0.00050079, 0.00030683, 7.27246897, 0.99847012, 0.99919238, 0.49320387],
-												 [	-6.27296995, -0.00050070, 0.00030678, 7.27246925, 0.99847037, 0.99919251, 0.49320387],
-												 [	-6.27297014, -0.00050062, 0.00030673, 7.27246952, 0.99847062, 0.99919265, 0.49320397],
-												 [	-6.27297034, -0.00050054, 0.00030668, 7.27246980, 0.99847086, 0.99919278, 0.49320397],
-												 [	-6.27297053, -0.00050046, 0.00030663, 7.27247007, 0.99847111, 0.99919291, 0.49320399],
-												 [	-6.27297073, -0.00050038, 0.00030658, 7.27247034, 0.99847136, 0.99919304, 0.49320405],
-												 [	-6.27297092, -0.00050030, 0.00030653, 7.27247062, 0.99847161, 0.99919317, 0.49320409],
-												 [	-6.27297111, -0.00050022, 0.00030648, 7.27247089, 0.99847185, 0.99919330, 0.49320412],
-												 [	-6.27297131, -0.00050014, 0.00030643, 7.27247117, 0.99847210, 0.99919343, 0.49320414],
-												 [	-6.27297150, -0.00050006, 0.00030638, 7.27247144, 0.99847235, 0.99919356, 0.49320414],
-												 [	-6.27297169, -0.00049998, 0.00030633, 7.27247172, 0.99847259, 0.99919369, 0.49320417],
-												 [	-6.27297189, -0.00049990, 0.00030629, 7.27247199, 0.99847284, 0.99919382, 0.49320418],
-												 [	-6.27297208, -0.00049982, 0.00030624, 7.27247226, 0.99847309, 0.99919395, 0.49320420],
-												 [	-6.27297227, -0.00049973, 0.00030619, 7.27247254, 0.99847333, 0.99919408, 0.49320426],
-												 [	-6.27297246, -0.00049965, 0.00030614, 7.27247281, 0.99847358, 0.99919421, 0.49320420],
-												 [	-6.27297266, -0.00049957, 0.00030609, 7.27247308, 0.99847383, 0.99919434, 0.49320435],
-												 [	-6.27297285, -0.00049949, 0.00030604, 7.27247336, 0.99847407, 0.99919447, 0.49320431],
-												 [	-6.27297304, -0.00049941, 0.00030599, 7.27247363, 0.99847432, 0.99919460, 0.49320437],
-												 [	-6.27297324, -0.00049933, 0.00030594, 7.27247390, 0.99847457, 0.99919473, 0.49320437],
-												 [	-6.27297343, -0.00049925, 0.00030589, 7.27247418, 0.99847481, 0.99919486, 0.49320443],
-												 [	-6.27297362, -0.00049917, 0.00030584, 7.27247445, 0.99847506, 0.99919499, 0.49320448],
-												 [	-6.27297381, -0.00049909, 0.00030579, 7.27247472, 0.99847530, 0.99919512, 0.49320448],
-												 [	-6.27297401, -0.00049901, 0.00030574, 7.27247500, 0.99847555, 0.99919525, 0.49320449],
-												 [	-6.27297420, -0.00049893, 0.00030569, 7.27247527, 0.99847580, 0.99919538, 0.49320451],
-												 [	-6.27297439, -0.00049885, 0.00030564, 7.27247554, 0.99847604, 0.99919551, 0.49320453],
-												 [	-6.27297458, -0.00049877, 0.00030559, 7.27247582, 0.99847629, 0.99919564, 0.49320461],
-												 [	-6.27297478, -0.00049869, 0.00030554, 7.27247609, 0.99847653, 0.99919577, 0.49320461],
-												 [	-6.27297497, -0.00049861, 0.00030550, 7.27247636, 0.99847678, 0.99919590, 0.49320465],
-												 [	-6.27297516, -0.00049853, 0.00030545, 7.27247663, 0.99847702, 0.99919603, 0.49320475],
-												 [	-6.27297535, -0.00049845, 0.00030540, 7.27247691, 0.99847727, 0.99919616, 0.49320473],
-												 [	-6.27297554, -0.00049837, 0.00030535, 7.27247718, 0.99847751, 0.99919629, 0.49320474],
-												 [	-6.27297574, -0.00049829, 0.00030530, 7.27247745, 0.99847776, 0.99919641, 0.49320475],
-												 [	-6.27297593, -0.00049821, 0.00030525, 7.27247772, 0.99847800, 0.99919654, 0.49320486],
-												 [	-6.27297612, -0.00049813, 0.00030520, 7.27247799, 0.99847825, 0.99919667, 0.49320483],
-												 [	-6.27297631, -0.00049805, 0.00030515, 7.27247827, 0.99847849, 0.99919680, 0.49320494],
-												 [	-6.27297650, -0.00049797, 0.00030510, 7.27247854, 0.99847874, 0.99919693, 0.49320494],
-												 [	-6.27297670, -0.00049789, 0.00030505, 7.27247881, 0.99847898, 0.99919706, 0.49320488],
-												 [	-6.27297689, -0.00049781, 0.00030500, 7.27247908, 0.99847923, 0.99919719, 0.49320497],
-												 [	-6.27297708, -0.00049773, 0.00030495, 7.27247935, 0.99847947, 0.99919732, 0.49320498],
-												 [	-6.27297727, -0.00049765, 0.00030491, 7.27247962, 0.99847972, 0.99919745, 0.49320504],
-												 [	-6.27297746, -0.00049757, 0.00030486, 7.27247990, 0.99847996, 0.99919758, 0.49320498],
-												 [	-6.27297765, -0.00049749, 0.00030481, 7.27248017, 0.99848021, 0.99919771, 0.49320508],
-												 [	-6.27297784, -0.00049741, 0.00030476, 7.27248044, 0.99848045, 0.99919784, 0.49320506],
-												 [	-6.27297804, -0.00049733, 0.00030471, 7.27248071, 0.99848070, 0.99919796, 0.49320512],
-												 [	-6.27297823, -0.00049725, 0.00030466, 7.27248098, 0.99848094, 0.99919809, 0.49320520],
-												 [	-6.27297842, -0.00049717, 0.00030461, 7.27248125, 0.99848118, 0.99919822, 0.49320518],
-												 [	-6.27297861, -0.00049709, 0.00030456, 7.27248152, 0.99848143, 0.99919835, 0.49320519],
-												 [	-6.27297880, -0.00049701, 0.00030451, 7.27248179, 0.99848167, 0.99919848, 0.49320524],
-												 [	-6.27297899, -0.00049693, 0.00030446, 7.27248206, 0.99848192, 0.99919861, 0.49320527],
-												 [	-6.27297918, -0.00049685, 0.00030442, 7.27248233, 0.99848216, 0.99919874, 0.49320529],
-												 [	-6.27297937, -0.00049677, 0.00030437, 7.27248260, 0.99848240, 0.99919887, 0.49320530],
-												 [	-6.27297956, -0.00049669, 0.00030432, 7.27248288, 0.99848265, 0.99919899, 0.49320533],
-												 [	-6.27297975, -0.00049661, 0.00030427, 7.27248315, 0.99848289, 0.99919912, 0.49320533],
-												 [	-6.27297994, -0.00049653, 0.00030422, 7.27248342, 0.99848313, 0.99919925, 0.49320545],
-												 [	-6.27298013, -0.00049645, 0.00030417, 7.27248369, 0.99848338, 0.99919938, 0.49320550],
-												 [	-6.27298033, -0.00049637, 0.00030412, 7.27248396, 0.99848362, 0.99919951, 0.49320544],
-												 [	-6.27298052, -0.00049629, 0.00030407, 7.27248423, 0.99848386, 0.99919964, 0.49320542],
-												 [	-6.27298071, -0.00049621, 0.00030403, 7.27248450, 0.99848411, 0.99919976, 0.49320549],
-												 [	-6.27298090, -0.00049613, 0.00030398, 7.27248477, 0.99848435, 0.99919989, 0.49320553],
-												 [	-6.27298109, -0.00049605, 0.00030393, 7.27248504, 0.99848459, 0.99920002, 0.49320549],
-												 [	-6.27298128, -0.00049597, 0.00030388, 7.27248531, 0.99848484, 0.99920015, 0.49320559],
-												 [	-6.27298147, -0.00049589, 0.00030383, 7.27248557, 0.99848508, 0.99920028, 0.49320560],
-												 [	-6.27298166, -0.00049581, 0.00030378, 7.27248584, 0.99848532, 0.99920041, 0.49320562],
-												 [	-6.27298185, -0.00049573, 0.00030373, 7.27248611, 0.99848556, 0.99920053, 0.49320572],
-												 [	-6.27298204, -0.00049565, 0.00030368, 7.27248638, 0.99848581, 0.99920066, 0.49320570],
-												 [	-6.27298223, -0.00049557, 0.00030364, 7.27248665, 0.99848605, 0.99920079, 0.49320571],
-												 [	-6.27298242, -0.00049550, 0.00030359, 7.27248692, 0.99848629, 0.99920092, 0.49320573],
-												 [	-6.27298261, -0.00049542, 0.00030354, 7.27248719, 0.99848653, 0.99920105, 0.49320576],
-												 [	-6.27298280, -0.00049534, 0.00030349, 7.27248746, 0.99848678, 0.99920117, 0.49320585],
-												 [	-6.27298299, -0.00049526, 0.00030344, 7.27248773, 0.99848702, 0.99920130, 0.49320584],
-												 [	-6.27298318, -0.00049518, 0.00030339, 7.27248800, 0.99848726, 0.99920143, 0.49320590],
-												 [	-6.27298336, -0.00049510, 0.00030334, 7.27248827, 0.99848750, 0.99920156, 0.49320592],
-												 [	-6.27298355, -0.00049502, 0.00030330, 7.27248853, 0.99848774, 0.99920168, 0.49320594],
-												 [	-6.27298374, -0.00049494, 0.00030325, 7.27248880, 0.99848799, 0.99920181, 0.49320595],
-												 [	-6.27298393, -0.00049486, 0.00030320, 7.27248907, 0.99848823, 0.99920194, 0.49320597],
-												 [	-6.27298412, -0.00049478, 0.00030315, 7.27248934, 0.99848847, 0.99920207, 0.49320596],
-												 [	-6.27298431, -0.00049470, 0.00030310, 7.27248961, 0.99848871, 0.99920220, 0.49320603],
-												 [	-6.27298450, -0.00049462, 0.00030305, 7.27248988, 0.99848895, 0.99920232, 0.49320613],
-												 [	-6.27298469, -0.00049455, 0.00030300, 7.27249014, 0.99848919, 0.99920245, 0.49320607],
-												 [	-6.27298488, -0.00049447, 0.00030296, 7.27249041, 0.99848944, 0.99920258, 0.49320616],
-												 [	-6.27298507, -0.00049439, 0.00030291, 7.27249068, 0.99848968, 0.99920270, 0.49320618],
-												 [	-6.27298526, -0.00049431, 0.00030286, 7.27249095, 0.99848992, 0.99920283, 0.49320613],
-												 [	-6.27298545, -0.00049423, 0.00030281, 7.27249122, 0.99849016, 0.99920296, 0.49320620],
-												 [	-6.27298563, -0.00049415, 0.00030276, 7.27249148, 0.99849040, 0.99920309, 0.49320622],
-												 [	-6.27298582, -0.00049407, 0.00030271, 7.27249175, 0.99849064, 0.99920321, 0.49320626],
-												 [	-6.27298601, -0.00049399, 0.00030267, 7.27249202, 0.99849088, 0.99920334, 0.49320625],
-												 [	-6.27298620, -0.00049391, 0.00030262, 7.27249229, 0.99849112, 0.99920347, 0.49320640],
-												 [	-6.27298639, -0.00049384, 0.00030257, 7.27249255, 0.99849136, 0.99920360, 0.49320640],
-												 [	-6.27298658, -0.00049376, 0.00030252, 7.27249282, 0.99849161, 0.99920372, 0.49320636],
-												 [	-6.27298677, -0.00049368, 0.00030247, 7.27249309, 0.99849185, 0.99920385, 0.49320641],
-												 [	-6.27298695, -0.00049360, 0.00030242, 7.27249336, 0.99849209, 0.99920398, 0.49320644],
-												 [	-6.27298714, -0.00049352, 0.00030238, 7.27249362, 0.99849233, 0.99920410, 0.49320643],
-												 [	-6.27298733, -0.00049344, 0.00030233, 7.27249389, 0.99849257, 0.99920423, 0.49320647],
-												 [	-6.27298752, -0.00049336, 0.00030228, 7.27249416, 0.99849281, 0.99920436, 0.49320649],
-												 [	-6.27298771, -0.00049328, 0.00030223, 7.27249442, 0.99849305, 0.99920448, 0.49320659],
-												 [	-6.27298790, -0.00049321, 0.00030218, 7.27249469, 0.99849329, 0.99920461, 0.49320657],
-												 [	-6.27298808, -0.00049313, 0.00030214, 7.27249496, 0.99849353, 0.99920474, 0.49320661],
-												 [	-6.27298827, -0.00049305, 0.00030209, 7.27249522, 0.99849377, 0.99920486, 0.49320660],
-												 [	-6.27298846, -0.00049297, 0.00030204, 7.27249549, 0.99849401, 0.99920499, 0.49320663],
-												 [	-6.27298865, -0.00049289, 0.00030199, 7.27249576, 0.99849425, 0.99920512, 0.49320673],
-												 [	-6.27298883, -0.00049281, 0.00030194, 7.27249602, 0.99849449, 0.99920524, 0.49320673],
-												 [	-6.27298902, -0.00049273, 0.00030189, 7.27249629, 0.99849473, 0.99920537, 0.49320669],
-												 [	-6.27298921, -0.00049266, 0.00030185, 7.27249655, 0.99849497, 0.99920550, 0.49320677],
-												 [	-6.27298940, -0.00049258, 0.00030180, 7.27249682, 0.99849521, 0.99920562, 0.49320680],
-												 [	-6.27298959, -0.00049250, 0.00030175, 7.27249709, 0.99849545, 0.99920575, 0.49320687],
-												 [	-6.27298977, -0.00049242, 0.00030170, 7.27249735, 0.99849569, 0.99920588, 0.49320693],
-												 [	-6.27298996, -0.00049234, 0.00030165, 7.27249762, 0.99849593, 0.99920600, 0.49320681],
-												 [	-6.27299015, -0.00049226, 0.00030161, 7.27249788, 0.99849616, 0.99920613, 0.49320699],
-												 [	-6.27299033, -0.00049219, 0.00030156, 7.27249815, 0.99849640, 0.99920626, 0.49320687],
-												 [	-6.27299052, -0.00049211, 0.00030151, 7.27249841, 0.99849664, 0.99920638, 0.49320699],
-												 [	-6.27299071, -0.00049203, 0.00030146, 7.27249868, 0.99849688, 0.99920651, 0.49320705],
-												 [	-6.27299090, -0.00049195, 0.00030141, 7.27249894, 0.99849712, 0.99920663, 0.49320709],
-												 [	-6.27299108, -0.00049187, 0.00030137, 7.27249921, 0.99849736, 0.99920676, 0.49320704],
-												 [	-6.27299127, -0.00049180, 0.00030132, 7.27249948, 0.99849760, 0.99920689, 0.49320700],
-												 [	-6.27299146, -0.00049172, 0.00030127, 7.27249974, 0.99849784, 0.99920701, 0.49320709],
-												 [	-6.27299164, -0.00049164, 0.00030122, 7.27250001, 0.99849808, 0.99920714, 0.49320722],
-												 [	-6.27299183, -0.00049156, 0.00030118, 7.27250027, 0.99849831, 0.99920726, 0.49320713],
-												 [	-6.27299202, -0.00049148, 0.00030113, 7.27250053, 0.99849855, 0.99920739, 0.49320717],
-												 [	-6.27299220, -0.00049140, 0.00030108, 7.27250080, 0.99849879, 0.99920752, 0.49320720],
-												 [	-6.27299239, -0.00049133, 0.00030103, 7.27250106, 0.99849903, 0.99920764, 0.49320724],
-												 [	-6.27299258, -0.00049125, 0.00030098, 7.27250133, 0.99849927, 0.99920777, 0.49320731],
-												 [	-6.27299276, -0.00049117, 0.00030094, 7.27250159, 0.99849951, 0.99920789, 0.49320733],
-												 [	-6.27299295, -0.00049109, 0.00030089, 7.27250186, 0.99849974, 0.99920802, 0.49320736],
-												 [	-6.27299314, -0.00049102, 0.00030084, 7.27250212, 0.99849998, 0.99920814, 0.49320742],
-												 [	-6.27299332, -0.00049094, 0.00030079, 7.27250239, 0.99850022, 0.99920827, 0.49320737],
-												 [	-6.27299351, -0.00049086, 0.00030075, 7.27250265, 0.99850046, 0.99920840, 0.49320741],
-												 [	-6.27299370, -0.00049078, 0.00030070, 7.27250291, 0.99850070, 0.99920852, 0.49320747],
-												 [	-6.27299388, -0.00049070, 0.00030065, 7.27250318, 0.99850093, 0.99920865, 0.49320746],
-												 [	-6.27299407, -0.00049063, 0.00030060, 7.27250344, 0.99850117, 0.99920877, 0.49320747],
-												 [	-6.27299425, -0.00049055, 0.00030055, 7.27250371, 0.99850141, 0.99920890, 0.49320753],
-												 [	-6.27299444, -0.00049047, 0.00030051, 7.27250397, 0.99850165, 0.99920902, 0.49320754],
-												 [	-6.27299463, -0.00049039, 0.00030046, 7.27250423, 0.99850188, 0.99920915, 0.49320761],
-												 [	-6.27299481, -0.00049032, 0.00030041, 7.27250450, 0.99850212, 0.99920927, 0.49320761],
-												 [	-6.27299500, -0.00049024, 0.00030036, 7.27250476, 0.99850236, 0.99920940, 0.49320763],
-												 [	-6.27299518, -0.00049016, 0.00030032, 7.27250502, 0.99850260, 0.99920952, 0.49320763],
-												 [	-6.27299537, -0.00049008, 0.00030027, 7.27250529, 0.99850283, 0.99920965, 0.49320764],
-												 [	-6.27299556, -0.00049000, 0.00030022, 7.27250555, 0.99850307, 0.99920977, 0.49320768],
-												 [	-6.27299574, -0.00048993, 0.00030017, 7.27250581, 0.99850331, 0.99920990, 0.49320774],
-												 [	-6.27299593, -0.00048985, 0.00030013, 7.27250608, 0.99850354, 0.99921002, 0.49320770],
-												 [	-6.27299611, -0.00048977, 0.00030008, 7.27250634, 0.99850378, 0.99921015, 0.49320782],
-												 [	-6.27299630, -0.00048969, 0.00030003, 7.27250660, 0.99850402, 0.99921027, 0.49320781],
-												 [	-6.27299648, -0.00048962, 0.00029998, 7.27250687, 0.99850426, 0.99921040, 0.49320784],
-												 [	-6.27299667, -0.00048954, 0.00029994, 7.27250713, 0.99850449, 0.99921052, 0.49320787],
-												 [	-6.27299685, -0.00048946, 0.00029989, 7.27250739, 0.99850473, 0.99921065, 0.49320791],
-												 [	-6.27299704, -0.00048938, 0.00029984, 7.27250765, 0.99850496, 0.99921077, 0.49320794],
-												 [	-6.27299722, -0.00048931, 0.00029979, 7.27250792, 0.99850520, 0.99921090, 0.49320795],
-												 [	-6.27299741, -0.00048923, 0.00029975, 7.27250818, 0.99850544, 0.99921102, 0.49320801],
-												 [	-6.27299759, -0.00048915, 0.00029970, 7.27250844, 0.99850567, 0.99921115, 0.49320802],
-												 [	-6.27299778, -0.00048908, 0.00029965, 7.27250870, 0.99850591, 0.99921127, 0.49320805],
-												 [	-6.27299796, -0.00048900, 0.00029960, 7.27250896, 0.99850615, 0.99921140, 0.49320810],
-												 [	-6.27299815, -0.00048892, 0.00029956, 7.27250923, 0.99850638, 0.99921152, 0.49320806],
-												 [	-6.27299833, -0.00048884, 0.00029951, 7.27250949, 0.99850662, 0.99921165, 0.49320815],
-												 [	-6.27299852, -0.00048877, 0.00029946, 7.27250975, 0.99850685, 0.99921177, 0.49320816],
-												 [	-6.27299870, -0.00048869, 0.00029941, 7.27251001, 0.99850709, 0.99921190, 0.49320817],
-												 [	-6.27299889, -0.00048861, 0.00029937, 7.27251027, 0.99850733, 0.99921202, 0.49320820],
-												 [	-6.27299907, -0.00048854, 0.00029932, 7.27251054, 0.99850756, 0.99921214, 0.49320826],
-												 [	-6.27299926, -0.00048846, 0.00029927, 7.27251080, 0.99850780, 0.99921227, 0.49320827],
-												 [	-6.27299944, -0.00048838, 0.00029923, 7.27251106, 0.99850803, 0.99921239, 0.49320823],
-												 [	-6.27299962, -0.00048830, 0.00029918, 7.27251132, 0.99850827, 0.99921252, 0.49320833],
-												 [	-6.27299981, -0.00048823, 0.00029913, 7.27251158, 0.99850850, 0.99921264, 0.49320833],
-												 [	-6.27299999, -0.00048815, 0.00029908, 7.27251184, 0.99850874, 0.99921277, 0.49320839],
-												 [	-6.27300018, -0.00048807, 0.00029904, 7.27251210, 0.99850897, 0.99921289, 0.49320841],
-												 [	-6.27300036, -0.00048800, 0.00029899, 7.27251236, 0.99850921, 0.99921301, 0.49320850],
-												 [	-6.27300055, -0.00048792, 0.00029894, 7.27251263, 0.99850944, 0.99921314, 0.49320846],
-												 [	-6.27300073, -0.00048784, 0.00029890, 7.27251289, 0.99850968, 0.99921326, 0.49320848],
-												 [	-6.27300091, -0.00048777, 0.00029885, 7.27251315, 0.99850991, 0.99921339, 0.49320847],
-												 [	-6.27300110, -0.00048769, 0.00029880, 7.27251341, 0.99851015, 0.99921351, 0.49320858],
-												 [	-6.27300128, -0.00048761, 0.00029875, 7.27251367, 0.99851038, 0.99921363, 0.49320864],
-												 [	-6.27300146, -0.00048754, 0.00029871, 7.27251393, 0.99851062, 0.99921376, 0.49320855],
-												 [	-6.27300165, -0.00048746, 0.00029866, 7.27251419, 0.99851085, 0.99921388, 0.49320856],
-												 [	-6.27300183, -0.00048738, 0.00029861, 7.27251445, 0.99851109, 0.99921401, 0.49320863],
-												 [	-6.27300202, -0.00048730, 0.00029857, 7.27251471, 0.99851132, 0.99921413, 0.49320867],
-												 [	-6.27300220, -0.00048723, 0.00029852, 7.27251497, 0.99851156, 0.99921425, 0.49320861],
-												 [	-6.27300238, -0.00048715, 0.00029847, 7.27251523, 0.99851179, 0.99921438, 0.49320874],
-												 [	-6.27300257, -0.00048707, 0.00029842, 7.27251549, 0.99851202, 0.99921450, 0.49320874],
-												 [	-6.27300275, -0.00048700, 0.00029838, 7.27251575, 0.99851226, 0.99921462, 0.49320881],
-												 [	-6.27300293, -0.00048692, 0.00029833, 7.27251601, 0.99851249, 0.99921475, 0.49320880],
-												 [	-6.27300312, -0.00048685, 0.00029828, 7.27251627, 0.99851273, 0.99921487, 0.49320887],
-												 [	-6.27300330, -0.00048677, 0.00029824, 7.27251653, 0.99851296, 0.99921499, 0.49320886],
-												 [	-6.27300348, -0.00048669, 0.00029819, 7.27251679, 0.99851320, 0.99921512, 0.49320893],
-												 [	-6.27300367, -0.00048662, 0.00029814, 7.27251705, 0.99851343, 0.99921524, 0.49320893],
-												 [	-6.27300385, -0.00048654, 0.00029810, 7.27251731, 0.99851366, 0.99921536, 0.49320895],
-												 [	-6.27300403, -0.00048646, 0.00029805, 7.27251757, 0.99851390, 0.99921549, 0.49320892],
-												 [	-6.27300421, -0.00048639, 0.00029800, 7.27251783, 0.99851413, 0.99921561, 0.49320898],
-												 [	-6.27300440, -0.00048631, 0.00029796, 7.27251809, 0.99851436, 0.99921573, 0.49320901],
-												 [	-6.27300458, -0.00048623, 0.00029791, 7.27251835, 0.99851460, 0.99921586, 0.49320901],
-												 [	-6.27300476, -0.00048616, 0.00029786, 7.27251861, 0.99851483, 0.99921598, 0.49320912],
-												 [	-6.27300495, -0.00048608, 0.00029782, 7.27251886, 0.99851506, 0.99921610, 0.49320910],
-												 [	-6.27300513, -0.00048600, 0.00029777, 7.27251912, 0.99851530, 0.99921623, 0.49320913],
-												 [	-6.27300531, -0.00048593, 0.00029772, 7.27251938, 0.99851553, 0.99921635, 0.49320917],
-												 [	-6.27300549, -0.00048585, 0.00029768, 7.27251964, 0.99851576, 0.99921647, 0.49320916],
-												 [	-6.27300568, -0.00048578, 0.00029763, 7.27251990, 0.99851600, 0.99921660, 0.49320920],
-												 [	-6.27300586, -0.00048570, 0.00029758, 7.27252016, 0.99851623, 0.99921672, 0.49320924],
-												 [	-6.27300604, -0.00048562, 0.00029753, 7.27252042, 0.99851646, 0.99921684, 0.49320926],
-												 [	-6.27300622, -0.00048555, 0.00029749, 7.27252068, 0.99851669, 0.99921696, 0.49320930],
-												 [	-6.27300640, -0.00048547, 0.00029744, 7.27252093, 0.99851693, 0.99921709, 0.49320931],
-												 [	-6.27300659, -0.00048539, 0.00029739, 7.27252119, 0.99851716, 0.99921721, 0.49320938],
-												 [	-6.27300677, -0.00048532, 0.00029735, 7.27252145, 0.99851739, 0.99921733, 0.49320939],
-												 [	-6.27300695, -0.00048524, 0.00029730, 7.27252171, 0.99851763, 0.99921746, 0.49320948],
-												 [	-6.27300713, -0.00048517, 0.00029725, 7.27252197, 0.99851786, 0.99921758, 0.49320954],
-												 [	-6.27300732, -0.00048509, 0.00029721, 7.27252222, 0.99851809, 0.99921770, 0.49320950],
-												 [	-6.27300750, -0.00048501, 0.00029716, 7.27252248, 0.99851832, 0.99921782, 0.49320952],
-												 [	-6.27300768, -0.00048494, 0.00029712, 7.27252274, 0.99851855, 0.99921795, 0.49320954],
-												 [	-6.27300786, -0.00048486, 0.00029707, 7.27252300, 0.99851879, 0.99921807, 0.49320960],
-												 [	-6.27300804, -0.00048479, 0.00029702, 7.27252326, 0.99851902, 0.99921819, 0.49320959],
-												 [	-6.27300822, -0.00048471, 0.00029698, 7.27252351, 0.99851925, 0.99921831, 0.49320958],
-												 [	-6.27300841, -0.00048463, 0.00029693, 7.27252377, 0.99851948, 0.99921844, 0.49320965],
-												 [	-6.27300859, -0.00048456, 0.00029688, 7.27252403, 0.99851971, 0.99921856, 0.49320967],
-												 [	-6.27300877, -0.00048448, 0.00029684, 7.27252429, 0.99851995, 0.99921868, 0.49320972],
-												 [	-6.27300895, -0.00048441, 0.00029679, 7.27252454, 0.99852018, 0.99921880, 0.49320973],
-												 [	-6.27300913, -0.00048433, 0.00029674, 7.27252480, 0.99852041, 0.99921893, 0.49320972],
-												 [	-6.27300931, -0.00048426, 0.00029670, 7.27252506, 0.99852064, 0.99921905, 0.49320980],
-												 [	-6.27300949, -0.00048418, 0.00029665, 7.27252531, 0.99852087, 0.99921917, 0.49320981],
-												 [	-6.27300968, -0.00048410, 0.00029660, 7.27252557, 0.99852110, 0.99921929, 0.49320974],
-												 [	-6.27300986, -0.00048403, 0.00029656, 7.27252583, 0.99852134, 0.99921941, 0.49320985],
-												 [	-6.27301004, -0.00048395, 0.00029651, 7.27252608, 0.99852157, 0.99921954, 0.49320992],
-												 [	-6.27301022, -0.00048388, 0.00029646, 7.27252634, 0.99852180, 0.99921966, 0.49320992],
-												 [	-6.27301040, -0.00048380, 0.00029642, 7.27252660, 0.99852203, 0.99921978, 0.49320993],
-												 [	-6.27301058, -0.00048373, 0.00029637, 7.27252685, 0.99852226, 0.99921990, 0.49320993],
-												 [	-6.27301076, -0.00048365, 0.00029633, 7.27252711, 0.99852249, 0.99922002, 0.49321001],
-												 [	-6.27301094, -0.00048357, 0.00029628, 7.27252737, 0.99852272, 0.99922015, 0.49321003],
-												 [	-6.27301112, -0.00048350, 0.00029623, 7.27252762, 0.99852295, 0.99922027, 0.49321005],
-												 [	-6.27301130, -0.00048342, 0.00029619, 7.27252788, 0.99852318, 0.99922039, 0.49321008],
-												 [	-6.27301148, -0.00048335, 0.00029614, 7.27252814, 0.99852341, 0.99922051, 0.49321008],
-												 [	-6.27301166, -0.00048327, 0.00029609, 7.27252839, 0.99852364, 0.99922063, 0.49321010],
-												 [	-6.27301185, -0.00048320, 0.00029605, 7.27252865, 0.99852388, 0.99922075, 0.49321017],
-												 [	-6.27301203, -0.00048312, 0.00029600, 7.27252890, 0.99852411, 0.99922088, 0.49321023],
-												 [	-6.27301221, -0.00048305, 0.00029596, 7.27252916, 0.99852434, 0.99922100, 0.49321020],
-												 [	-6.27301239, -0.00048297, 0.00029591, 7.27252942, 0.99852457, 0.99922112, 0.49321023],
-												 [	-6.27301257, -0.00048290, 0.00029586, 7.27252967, 0.99852480, 0.99922124, 0.49321024],
-												 [	-6.27301275, -0.00048282, 0.00029582, 7.27252993, 0.99852503, 0.99922136, 0.49321030],
-												 [	-6.27301293, -0.00048275, 0.00029577, 7.27253018, 0.99852526, 0.99922148, 0.49321031],
-												 [	-6.27301311, -0.00048267, 0.00029572, 7.27253044, 0.99852549, 0.99922161, 0.49321030],
-												 [	-6.27301329, -0.00048259, 0.00029568, 7.27253069, 0.99852572, 0.99922173, 0.49321030],
-												 [	-6.27301347, -0.00048252, 0.00029563, 7.27253095, 0.99852595, 0.99922185, 0.49321039],
-												 [	-6.27301365, -0.00048244, 0.00029559, 7.27253120, 0.99852618, 0.99922197, 0.49321037],
-												 [	-6.27301383, -0.00048237, 0.00029554, 7.27253146, 0.99852641, 0.99922209, 0.49321046],
-												 [	-6.27301401, -0.00048229, 0.00029549, 7.27253171, 0.99852664, 0.99922221, 0.49321048],
-												 [	-6.27301419, -0.00048222, 0.00029545, 7.27253197, 0.99852687, 0.99922233, 0.49321049],
-												 [	-6.27301437, -0.00048214, 0.00029540, 7.27253222, 0.99852710, 0.99922245, 0.49321046],
-												 [	-6.27301455, -0.00048207, 0.00029536, 7.27253248, 0.99852732, 0.99922258, 0.49321053],
-												 [	-6.27301473, -0.00048199, 0.00029531, 7.27253273, 0.99852755, 0.99922270, 0.49321060],
-												 [	-6.27301491, -0.00048192, 0.00029526, 7.27253299, 0.99852778, 0.99922282, 0.49321066],
-												 [	-6.27301509, -0.00048184, 0.00029522, 7.27253324, 0.99852801, 0.99922294, 0.49321062],
-												 [	-6.27301526, -0.00048177, 0.00029517, 7.27253350, 0.99852824, 0.99922306, 0.49321065],
-												 [	-6.27301544, -0.00048169, 0.00029513, 7.27253375, 0.99852847, 0.99922318, 0.49321069],
-												 [	-6.27301562, -0.00048162, 0.00029508, 7.27253400, 0.99852870, 0.99922330, 0.49321066],
-												 [	-6.27301580, -0.00048154, 0.00029503, 7.27253426, 0.99852893, 0.99922342, 0.49321075],
-												 [	-6.27301598, -0.00048147, 0.00029499, 7.27253451, 0.99852916, 0.99922354, 0.49321074],
-												 [	-6.27301616, -0.00048139, 0.00029494, 7.27253477, 0.99852939, 0.99922366, 0.49321082],
-												 [	-6.27301634, -0.00048132, 0.00029490, 7.27253502, 0.99852962, 0.99922378, 0.49321081],
-												 [	-6.27301652, -0.00048124, 0.00029485, 7.27253528, 0.99852984, 0.99922391, 0.49321083],
-												 [	-6.27301670, -0.00048117, 0.00029480, 7.27253553, 0.99853007, 0.99922403, 0.49321094],
-												 [	-6.27301688, -0.00048109, 0.00029476, 7.27253578, 0.99853030, 0.99922415, 0.49321096],
-												 [	-6.27301706, -0.00048102, 0.00029471, 7.27253604, 0.99853053, 0.99922427, 0.49321093],
-												 [	-6.27301724, -0.00048095, 0.00029467, 7.27253629, 0.99853076, 0.99922439, 0.49321094],
-												 [	-6.27301741, -0.00048087, 0.00029462, 7.27253654, 0.99853099, 0.99922451, 0.49321098],
-												 [	-6.27301759, -0.00048080, 0.00029458, 7.27253680, 0.99853121, 0.99922463, 0.49321102],
-												 [	-6.27301777, -0.00048072, 0.00029453, 7.27253705, 0.99853144, 0.99922475, 0.49321101],
-												 [	-6.27301795, -0.00048065, 0.00029448, 7.27253730, 0.99853167, 0.99922487, 0.49321109],
-												 [	-6.27301813, -0.00048057, 0.00029444, 7.27253756, 0.99853190, 0.99922499, 0.49321107],
-												 [	-6.27301831, -0.00048050, 0.00029439, 7.27253781, 0.99853213, 0.99922511, 0.49321107],
-												 [	-6.27301849, -0.00048042, 0.00029435, 7.27253806, 0.99853235, 0.99922523, 0.49321110],
-												 [	-6.27301866, -0.00048035, 0.00029430, 7.27253832, 0.99853258, 0.99922535, 0.49321118],
-												 [	-6.27301884, -0.00048027, 0.00029426, 7.27253857, 0.99853281, 0.99922547, 0.49321119],
-												 [	-6.27301902, -0.00048020, 0.00029421, 7.27253882, 0.99853304, 0.99922559, 0.49321116],
-												 [	-6.27301920, -0.00048012, 0.00029416, 7.27253907, 0.99853327, 0.99922571, 0.49321127],
-												 [	-6.27301938, -0.00048005, 0.00029412, 7.27253933, 0.99853349, 0.99922583, 0.49321123],
-												 [	-6.27301956, -0.00047998, 0.00029407, 7.27253958, 0.99853372, 0.99922595, 0.49321129],
-												 [	-6.27301973, -0.00047990, 0.00029403, 7.27253983, 0.99853395, 0.99922607, 0.49321135],
-												 [	-6.27301991, -0.00047983, 0.00029398, 7.27254008, 0.99853418, 0.99922619, 0.49321135],
-												 [	-6.27302009, -0.00047975, 0.00029394, 7.27254034, 0.99853440, 0.99922631, 0.49321139],
-												 [	-6.27302027, -0.00047968, 0.00029389, 7.27254059, 0.99853463, 0.99922643, 0.49321146],
-												 [	-6.27302044, -0.00047960, 0.00029384, 7.27254084, 0.99853486, 0.99922655, 0.49321142],
-												 [	-6.27302062, -0.00047953, 0.00029380, 7.27254109, 0.99853508, 0.99922667, 0.49321144],
-												 [	-6.27302080, -0.00047946, 0.00029375, 7.27254135, 0.99853531, 0.99922679, 0.49321144],
-												 [	-6.27302098, -0.00047938, 0.00029371, 7.27254160, 0.99853554, 0.99922691, 0.49321157],
-												 [	-6.27302116, -0.00047931, 0.00029366, 7.27254185, 0.99853577, 0.99922703, 0.49321152],
-												 [	-6.27302133, -0.00047923, 0.00029362, 7.27254210, 0.99853599, 0.99922715, 0.49321153],
-												 [	-6.27302151, -0.00047916, 0.00029357, 7.27254235, 0.99853622, 0.99922727, 0.49321157],
-												 [	-6.27302169, -0.00047908, 0.00029353, 7.27254260, 0.99853645, 0.99922739, 0.49321160],
-												 [	-6.27302187, -0.00047901, 0.00029348, 7.27254286, 0.99853667, 0.99922751, 0.49321170],
-												 [	-6.27302204, -0.00047894, 0.00029344, 7.27254311, 0.99853690, 0.99922763, 0.49321172],
-												 [	-6.27302222, -0.00047886, 0.00029339, 7.27254336, 0.99853712, 0.99922775, 0.49321163],
-												 [	-6.27302240, -0.00047879, 0.00029334, 7.27254361, 0.99853735, 0.99922787, 0.49321166],
-												 [	-6.27302257, -0.00047871, 0.00029330, 7.27254386, 0.99853758, 0.99922799, 0.49321175],
-												 [	-6.27302275, -0.00047864, 0.00029325, 7.27254411, 0.99853780, 0.99922811, 0.49321177],
-												 [	-6.27302293, -0.00047857, 0.00029321, 7.27254436, 0.99853803, 0.99922823, 0.49321185],
-												 [	-6.27302311, -0.00047849, 0.00029316, 7.27254461, 0.99853826, 0.99922834, 0.49321182],
-												 [	-6.27302328, -0.00047842, 0.00029312, 7.27254486, 0.99853848, 0.99922846, 0.49321190],
-												 [	-6.27302346, -0.00047834, 0.00029307, 7.27254512, 0.99853871, 0.99922858, 0.49321191],
-												 [	-6.27302364, -0.00047827, 0.00029303, 7.27254537, 0.99853893, 0.99922870, 0.49321187],
-												 [	-6.27302381, -0.00047820, 0.00029298, 7.27254562, 0.99853916, 0.99922882, 0.49321186],
-												 [	-6.27302399, -0.00047812, 0.00029294, 7.27254587, 0.99853939, 0.99922894, 0.49321193],
-												 [	-6.27302417, -0.00047805, 0.00029289, 7.27254612, 0.99853961, 0.99922906, 0.49321201],
-												 [	-6.27302434, -0.00047797, 0.00029285, 7.27254637, 0.99853984, 0.99922918, 0.49321205],
-												 [	-6.27302452, -0.00047790, 0.00029280, 7.27254662, 0.99854006, 0.99922930, 0.49321210],
-												 [	-6.27302470, -0.00047783, 0.00029276, 7.27254687, 0.99854029, 0.99922942, 0.49321211],
-												 [	-6.27302487, -0.00047775, 0.00029271, 7.27254712, 0.99854051, 0.99922954, 0.49321206],
-												 [	-6.27302505, -0.00047768, 0.00029267, 7.27254737, 0.99854074, 0.99922965, 0.49321212],
-												 [	-6.27302523, -0.00047761, 0.00029262, 7.27254762, 0.99854096, 0.99922977, 0.49321212],
-												 [	-6.27302540, -0.00047753, 0.00029257, 7.27254787, 0.99854119, 0.99922989, 0.49321221],
-												 [	-6.27302558, -0.00047746, 0.00029253, 7.27254812, 0.99854141, 0.99923001, 0.49321218],
-												 [	-6.27302575, -0.00047739, 0.00029248, 7.27254837, 0.99854164, 0.99923013, 0.49321223],
-												 [	-6.27302593, -0.00047731, 0.00029244, 7.27254862, 0.99854186, 0.99923025, 0.49321227],
-												 [	-6.27302611, -0.00047724, 0.00029239, 7.27254887, 0.99854209, 0.99923037, 0.49321227],
-												 [	-6.27302628, -0.00047716, 0.00029235, 7.27254912, 0.99854231, 0.99923049, 0.49321226],
-												 [	-6.27302646, -0.00047709, 0.00029230, 7.27254937, 0.99854254, 0.99923060, 0.49321229],
-												 [	-6.27302664, -0.00047702, 0.00029226, 7.27254962, 0.99854276, 0.99923072, 0.49321232],
-												 [	-6.27302681, -0.00047694, 0.00029221, 7.27254987, 0.99854299, 0.99923084, 0.49321239],
-												 [	-6.27302699, -0.00047687, 0.00029217, 7.27255012, 0.99854321, 0.99923096, 0.49321240],
-												 [	-6.27302716, -0.00047680, 0.00029212, 7.27255037, 0.99854344, 0.99923108, 0.49321246],
-												 [	-6.27302734, -0.00047672, 0.00029208, 7.27255061, 0.99854366, 0.99923120, 0.49321244],
-												 [	-6.27302751, -0.00047665, 0.00029203, 7.27255086, 0.99854388, 0.99923132, 0.49321242],
-												 [	-6.27302769, -0.00047658, 0.00029199, 7.27255111, 0.99854411, 0.99923143, 0.49321242],
-												 [	-6.27302787, -0.00047650, 0.00029194, 7.27255136, 0.99854433, 0.99923155, 0.49321258],
-												 [	-6.27302804, -0.00047643, 0.00029190, 7.27255161, 0.99854456, 0.99923167, 0.49321251],
-												 [	-6.27302822, -0.00047636, 0.00029185, 7.27255186, 0.99854478, 0.99923179, 0.49321261],
-												 [	-6.27302839, -0.00047628, 0.00029181, 7.27255211, 0.99854501, 0.99923191, 0.49321264],
-												 [	-6.27302857, -0.00047621, 0.00029176, 7.27255236, 0.99854523, 0.99923203, 0.49321265],
-												 [	-6.27302874, -0.00047614, 0.00029172, 7.27255261, 0.99854545, 0.99923214, 0.49321268],
-												 [	-6.27302892, -0.00047606, 0.00029167, 7.27255285, 0.99854568, 0.99923226, 0.49321269],
-												 [	-6.27302909, -0.00047599, 0.00029163, 7.27255310, 0.99854590, 0.99923238, 0.49321277],
-												 [	-6.27302927, -0.00047592, 0.00029158, 7.27255335, 0.99854612, 0.99923250, 0.49321272],
-												 [	-6.27302944, -0.00047584, 0.00029154, 7.27255360, 0.99854635, 0.99923262, 0.49321278],
-												 [	-6.27302962, -0.00047577, 0.00029150, 7.27255385, 0.99854657, 0.99923273, 0.49321287],
-												 [	-6.27302979, -0.00047570, 0.00029145, 7.27255410, 0.99854679, 0.99923285, 0.49321280],
-												 [	-6.27302997, -0.00047562, 0.00029141, 7.27255434, 0.99854702, 0.99923297, 0.49321291],
-												 [	-6.27303014, -0.00047555, 0.00029136, 7.27255459, 0.99854724, 0.99923309, 0.49321279],
-												 [	-6.27303032, -0.00047548, 0.00029132, 7.27255484, 0.99854746, 0.99923321, 0.49321284],
-												 [	-6.27303049, -0.00047541, 0.00029127, 7.27255509, 0.99854769, 0.99923332, 0.49321288],
-												 [	-6.27303067, -0.00047533, 0.00029123, 7.27255533, 0.99854791, 0.99923344, 0.49321294],
-												 [	-6.27303084, -0.00047526, 0.00029118, 7.27255558, 0.99854813, 0.99923356, 0.49321292],
-												 [	-6.27303102, -0.00047519, 0.00029114, 7.27255583, 0.99854836, 0.99923368, 0.49321300],
-												 [	-6.27303119, -0.00047511, 0.00029109, 7.27255608, 0.99854858, 0.99923379, 0.49321302],
-												 [	-6.27303137, -0.00047504, 0.00029105, 7.27255632, 0.99854880, 0.99923391, 0.49321303],
-												 [	-6.27303154, -0.00047497, 0.00029100, 7.27255657, 0.99854903, 0.99923403, 0.49321311],
-												 [	-6.27303171, -0.00047490, 0.00029096, 7.27255682, 0.99854925, 0.99923415, 0.49321311],
-												 [	-6.27303189, -0.00047482, 0.00029091, 7.27255707, 0.99854947, 0.99923426, 0.49321315],
-												 [	-6.27303206, -0.00047475, 0.00029087, 7.27255731, 0.99854969, 0.99923438, 0.49321319],
-												 [	-6.27303224, -0.00047468, 0.00029082, 7.27255756, 0.99854992, 0.99923450, 0.49321317],
-												 [	-6.27303241, -0.00047460, 0.00029078, 7.27255781, 0.99855014, 0.99923462, 0.49321321],
-												 [	-6.27303259, -0.00047453, 0.00029073, 7.27255805, 0.99855036, 0.99923473, 0.49321326],
-												 [	-6.27303276, -0.00047446, 0.00029069, 7.27255830, 0.99855058, 0.99923485, 0.49321318],
-												 [	-6.27303293, -0.00047439, 0.00029065, 7.27255855, 0.99855081, 0.99923497, 0.49321326],
-												 [	-6.27303311, -0.00047431, 0.00029060, 7.27255879, 0.99855103, 0.99923509, 0.49321333],
-												 [	-6.27303328, -0.00047424, 0.00029056, 7.27255904, 0.99855125, 0.99923520, 0.49321333],
-												 [	-6.27303345, -0.00047417, 0.00029051, 7.27255929, 0.99855147, 0.99923532, 0.49321344],
-												 [	-6.27303363, -0.00047410, 0.00029047, 7.27255953, 0.99855169, 0.99923544, 0.49321337],
-												 [	-6.27303380, -0.00047402, 0.00029042, 7.27255978, 0.99855192, 0.99923555, 0.49321345],
-												 [	-6.27303398, -0.00047395, 0.00029038, 7.27256003, 0.99855214, 0.99923567, 0.49321337],
-												 [	-6.27303415, -0.00047388, 0.00029033, 7.27256027, 0.99855236, 0.99923579, 0.49321344],
-												 [	-6.27303432, -0.00047380, 0.00029029, 7.27256052, 0.99855258, 0.99923591, 0.49321346],
-												 [	-6.27303450, -0.00047373, 0.00029025, 7.27256076, 0.99855280, 0.99923602, 0.49321354],
-												 [	-6.27303467, -0.00047366, 0.00029020, 7.27256101, 0.99855302, 0.99923614, 0.49321353],
-												 [	-6.27303484, -0.00047359, 0.00029016, 7.27256126, 0.99855325, 0.99923626, 0.49321361],
-												 [	-6.27303502, -0.00047351, 0.00029011, 7.27256150, 0.99855347, 0.99923637, 0.49321358],
-												 [	-6.27303519, -0.00047344, 0.00029007, 7.27256175, 0.99855369, 0.99923649, 0.49321363],
-												 [	-6.27303536, -0.00047337, 0.00029002, 7.27256199, 0.99855391, 0.99923661, 0.49321367],
-												 [	-6.27303554, -0.00047330, 0.00028998, 7.27256224, 0.99855413, 0.99923672, 0.49321364],
-												 [	-6.27303571, -0.00047323, 0.00028993, 7.27256248, 0.99855435, 0.99923684, 0.49321377],
-												 [	-6.27303588, -0.00047315, 0.00028989, 7.27256273, 0.99855457, 0.99923696, 0.49321375],
-												 [	-6.27303606, -0.00047308, 0.00028985, 7.27256298, 0.99855479, 0.99923707, 0.49321379],
-												 [	-6.27303623, -0.00047301, 0.00028980, 7.27256322, 0.99855501, 0.99923719, 0.49321377],
-												 [	-6.27303640, -0.00047294, 0.00028976, 7.27256347, 0.99855524, 0.99923731, 0.49321372],
-												 [	-6.27303658, -0.00047286, 0.00028971, 7.27256371, 0.99855546, 0.99923742, 0.49321383],
-												 [	-6.27303675, -0.00047279, 0.00028967, 7.27256396, 0.99855568, 0.99923754, 0.49321384],
-												 [	-6.27303692, -0.00047272, 0.00028962, 7.27256420, 0.99855590, 0.99923766, 0.49321394],
-												 [	-6.27303709, -0.00047265, 0.00028958, 7.27256445, 0.99855612, 0.99923777, 0.49321386],
-												 [	-6.27303727, -0.00047258, 0.00028954, 7.27256469, 0.99855634, 0.99923789, 0.49321390],
-												 [	-6.27303744, -0.00047250, 0.00028949, 7.27256494, 0.99855656, 0.99923801, 0.49321401],
-												 [	-6.27303761, -0.00047243, 0.00028945, 7.27256518, 0.99855678, 0.99923812, 0.49321394],
-												 [	-6.27303778, -0.00047236, 0.00028940, 7.27256543, 0.99855700, 0.99923824, 0.49321395],
-												 [	-6.27303796, -0.00047229, 0.00028936, 7.27256567, 0.99855722, 0.99923835, 0.49321400],
-												 [	-6.27303813, -0.00047221, 0.00028931, 7.27256591, 0.99855744, 0.99923847, 0.49321392],
-												 [	-6.27303830, -0.00047214, 0.00028927, 7.27256616, 0.99855766, 0.99923859, 0.49321409],
-												 [	-6.27303847, -0.00047207, 0.00028923, 7.27256640, 0.99855788, 0.99923870, 0.49321404],
-												 [	-6.27303865, -0.00047200, 0.00028918, 7.27256665, 0.99855810, 0.99923882, 0.49321416],
-												 [	-6.27303882, -0.00047193, 0.00028914, 7.27256689, 0.99855832, 0.99923893, 0.49321409],
-												 [	-6.27303899, -0.00047185, 0.00028909, 7.27256714, 0.99855854, 0.99923905, 0.49321418],
-												 [	-6.27303916, -0.00047178, 0.00028905, 7.27256738, 0.99855876, 0.99923917, 0.49321418],
-												 [	-6.27303933, -0.00047171, 0.00028901, 7.27256762, 0.99855898, 0.99923928, 0.49321424],
-												 [	-6.27303951, -0.00047164, 0.00028896, 7.27256787, 0.99855920, 0.99923940, 0.49321434],
-												 [	-6.27303968, -0.00047157, 0.00028892, 7.27256811, 0.99855942, 0.99923951, 0.49321431],
-												 [	-6.27303985, -0.00047150, 0.00028887, 7.27256835, 0.99855964, 0.99923963, 0.49321429],
-												 [	-6.27304002, -0.00047142, 0.00028883, 7.27256860, 0.99855986, 0.99923975, 0.49321428],
-												 [	-6.27304019, -0.00047135, 0.00028879, 7.27256884, 0.99856008, 0.99923986, 0.49321434],
-												 [	-6.27304037, -0.00047128, 0.00028874, 7.27256909, 0.99856030, 0.99923998, 0.49321435],
-												 [	-6.27304054, -0.00047121, 0.00028870, 7.27256933, 0.99856052, 0.99924009, 0.49321437],
-												 [	-6.27304071, -0.00047114, 0.00028865, 7.27256957, 0.99856073, 0.99924021, 0.49321446],
-												 [	-6.27304088, -0.00047106, 0.00028861, 7.27256982, 0.99856095, 0.99924032, 0.49321442],
-												 [	-6.27304105, -0.00047099, 0.00028857, 7.27257006, 0.99856117, 0.99924044, 0.49321442],
-												 [	-6.27304122, -0.00047092, 0.00028852, 7.27257030, 0.99856139, 0.99924056, 0.49321451],
-												 [	-6.27304139, -0.00047085, 0.00028848, 7.27257054, 0.99856161, 0.99924067, 0.49321455],
-												 [	-6.27304157, -0.00047078, 0.00028843, 7.27257079, 0.99856183, 0.99924079, 0.49321455],
-												 [	-6.27304174, -0.00047071, 0.00028839, 7.27257103, 0.99856205, 0.99924090, 0.49321459],
-												 [	-6.27304191, -0.00047064, 0.00028835, 7.27257127, 0.99856227, 0.99924102, 0.49321464],
-												 [	-6.27304208, -0.00047056, 0.00028830, 7.27257152, 0.99856249, 0.99924113, 0.49321460],
-												 [	-6.27304225, -0.00047049, 0.00028826, 7.27257176, 0.99856270, 0.99924125, 0.49321463],
-												 [	-6.27304242, -0.00047042, 0.00028822, 7.27257200, 0.99856292, 0.99924136, 0.49321476],
-												 [	-6.27304259, -0.00047035, 0.00028817, 7.27257224, 0.99856314, 0.99924148, 0.49321475],
-												 [	-6.27304276, -0.00047028, 0.00028813, 7.27257249, 0.99856336, 0.99924159, 0.49321471],
-												 [	-6.27304294, -0.00047021, 0.00028808, 7.27257273, 0.99856358, 0.99924171, 0.49321475],
-												 [	-6.27304311, -0.00047013, 0.00028804, 7.27257297, 0.99856380, 0.99924183, 0.49321476],
-												 [	-6.27304328, -0.00047006, 0.00028800, 7.27257321, 0.99856401, 0.99924194, 0.49321484],
-												 [	-6.27304345, -0.00046999, 0.00028795, 7.27257346, 0.99856423, 0.99924206, 0.49321477],
-												 [	-6.27304362, -0.00046992, 0.00028791, 7.27257370, 0.99856445, 0.99924217, 0.49321483],
-												 [	-6.27304379, -0.00046985, 0.00028787, 7.27257394, 0.99856467, 0.99924229, 0.49321495],
-												 [	-6.27304396, -0.00046978, 0.00028782, 7.27257418, 0.99856489, 0.99924240, 0.49321491],
-												 [	-6.27304413, -0.00046971, 0.00028778, 7.27257442, 0.99856510, 0.99924252, 0.49321493],
-												 [	-6.27304430, -0.00046964, 0.00028773, 7.27257467, 0.99856532, 0.99924263, 0.49321498],
-												 [	-6.27304447, -0.00046956, 0.00028769, 7.27257491, 0.99856554, 0.99924275, 0.49321496],
-												 [	-6.27304464, -0.00046949, 0.00028765, 7.27257515, 0.99856576, 0.99924286, 0.49321502],
-												 [	-6.27304481, -0.00046942, 0.00028760, 7.27257539, 0.99856597, 0.99924298, 0.49321503],
-												 [	-6.27304498, -0.00046935, 0.00028756, 7.27257563, 0.99856619, 0.99924309, 0.49321507],
-												 [	-6.27304515, -0.00046928, 0.00028752, 7.27257587, 0.99856641, 0.99924320, 0.49321515],
-												 [	-6.27304532, -0.00046921, 0.00028747, 7.27257611, 0.99856663, 0.99924332, 0.49321508],
-												 [	-6.27304549, -0.00046914, 0.00028743, 7.27257636, 0.99856684, 0.99924343, 0.49321514],
-												 [	-6.27304566, -0.00046907, 0.00028738, 7.27257660, 0.99856706, 0.99924355, 0.49321526],
-												 [	-6.27304583, -0.00046900, 0.00028734, 7.27257684, 0.99856728, 0.99924366, 0.49321521],
-												 [	-6.27304600, -0.00046892, 0.00028730, 7.27257708, 0.99856750, 0.99924378, 0.49321521],
-												 [	-6.27304617, -0.00046885, 0.00028725, 7.27257732, 0.99856771, 0.99924389, 0.49321523],
-												 [	-6.27304634, -0.00046878, 0.00028721, 7.27257756, 0.99856793, 0.99924401, 0.49321526],
-												 [	-6.27304651, -0.00046871, 0.00028717, 7.27257780, 0.99856815, 0.99924412, 0.49321530],
-												 [	-6.27304668, -0.00046864, 0.00028712, 7.27257804, 0.99856836, 0.99924424, 0.49321535],
-												 [	-6.27304685, -0.00046857, 0.00028708, 7.27257828, 0.99856858, 0.99924435, 0.49321541],
-												 [	-6.27304702, -0.00046850, 0.00028704, 7.27257852, 0.99856880, 0.99924446, 0.49321529],
-												 [	-6.27304719, -0.00046843, 0.00028699, 7.27257876, 0.99856901, 0.99924458, 0.49321541],
-												 [	-6.27304736, -0.00046836, 0.00028695, 7.27257901, 0.99856923, 0.99924469, 0.49321535],
-												 [	-6.27304753, -0.00046829, 0.00028691, 7.27257925, 0.99856945, 0.99924481, 0.49321543],
-												 [	-6.27304770, -0.00046821, 0.00028686, 7.27257949, 0.99856966, 0.99924492, 0.49321548],
-												 [	-6.27304787, -0.00046814, 0.00028682, 7.27257973, 0.99856988, 0.99924504, 0.49321551],
-												 [	-6.27304804, -0.00046807, 0.00028678, 7.27257997, 0.99857010, 0.99924515, 0.49321545],
-												 [	-6.27304821, -0.00046800, 0.00028673, 7.27258021, 0.99857031, 0.99924526, 0.49321554],
-												 [	-6.27304838, -0.00046793, 0.00028669, 7.27258045, 0.99857053, 0.99924538, 0.49321557],
-												 [	-6.27304855, -0.00046786, 0.00028665, 7.27258069, 0.99857074, 0.99924549, 0.49321561],
-												 [	-6.27304872, -0.00046779, 0.00028660, 7.27258093, 0.99857096, 0.99924561, 0.49321567],
-												 [	-6.27304889, -0.00046772, 0.00028656, 7.27258117, 0.99857118, 0.99924572, 0.49321567],
-												 [	-6.27304906, -0.00046765, 0.00028652, 7.27258141, 0.99857139, 0.99924583, 0.49321571],
-												 [	-6.27304922, -0.00046758, 0.00028647, 7.27258165, 0.99857161, 0.99924595, 0.49321566],
-												 [	-6.27304939, -0.00046751, 0.00028643, 7.27258189, 0.99857182, 0.99924606, 0.49321576],
-												 [	-6.27304956, -0.00046744, 0.00028639, 7.27258213, 0.99857204, 0.99924618, 0.49321567],
-												 [	-6.27304973, -0.00046737, 0.00028634, 7.27258236, 0.99857226, 0.99924629, 0.49321585],
-												 [	-6.27304990, -0.00046730, 0.00028630, 7.27258260, 0.99857247, 0.99924640, 0.49321576],
-												 [	-6.27305007, -0.00046723, 0.00028626, 7.27258284, 0.99857269, 0.99924652, 0.49321581],
-												 [	-6.27305024, -0.00046715, 0.00028621, 7.27258308, 0.99857290, 0.99924663, 0.49321580],
-												 [	-6.27305041, -0.00046708, 0.00028617, 7.27258332, 0.99857312, 0.99924675, 0.49321590],
-												 [	-6.27305057, -0.00046701, 0.00028613, 7.27258356, 0.99857333, 0.99924686, 0.49321582],
-												 [	-6.27305074, -0.00046694, 0.00028608, 7.27258380, 0.99857355, 0.99924697, 0.49321587],
-												 [	-6.27305091, -0.00046687, 0.00028604, 7.27258404, 0.99857376, 0.99924709, 0.49321595],
-												 [	-6.27305108, -0.00046680, 0.00028600, 7.27258428, 0.99857398, 0.99924720, 0.49321595],
-												 [	-6.27305125, -0.00046673, 0.00028595, 7.27258452, 0.99857419, 0.99924731, 0.49321600],
-												 [	-6.27305142, -0.00046666, 0.00028591, 7.27258476, 0.99857441, 0.99924743, 0.49321598],
-												 [	-6.27305159, -0.00046659, 0.00028587, 7.27258499, 0.99857462, 0.99924754, 0.49321613],
-												 [	-6.27305175, -0.00046652, 0.00028582, 7.27258523, 0.99857484, 0.99924765, 0.49321611],
-												 [	-6.27305192, -0.00046645, 0.00028578, 7.27258547, 0.99857505, 0.99924777, 0.49321600],
-												 [	-6.27305209, -0.00046638, 0.00028574, 7.27258571, 0.99857527, 0.99924788, 0.49321621],
-												 [	-6.27305226, -0.00046631, 0.00028570, 7.27258595, 0.99857548, 0.99924799, 0.49321615],
-												 [	-6.27305243, -0.00046624, 0.00028565, 7.27258619, 0.99857570, 0.99924811, 0.49321620],
-												 [	-6.27305259, -0.00046617, 0.00028561, 7.27258642, 0.99857591, 0.99924822, 0.49321625],
-												 [	-6.27305276, -0.00046610, 0.00028557, 7.27258666, 0.99857613, 0.99924833, 0.49321621],
-												 [	-6.27305293, -0.00046603, 0.00028552, 7.27258690, 0.99857634, 0.99924845, 0.49321630],
-												 [	-6.27305310, -0.00046596, 0.00028548, 7.27258714, 0.99857656, 0.99924856, 0.49321623],
-												 [	-6.27305327, -0.00046589, 0.00028544, 7.27258738, 0.99857677, 0.99924867, 0.49321633],
-												 [	-6.27305343, -0.00046582, 0.00028539, 7.27258761, 0.99857698, 0.99924879, 0.49321637],
-												 [	-6.27305360, -0.00046575, 0.00028535, 7.27258785, 0.99857720, 0.99924890, 0.49321640],
-												 [	-6.27305377, -0.00046568, 0.00028531, 7.27258809, 0.99857741, 0.99924901, 0.49321641],
-												 [	-6.27305394, -0.00046561, 0.00028527, 7.27258833, 0.99857763, 0.99924913, 0.49321644],
-												 [	-6.27305410, -0.00046554, 0.00028522, 7.27258857, 0.99857784, 0.99924924, 0.49321640],
-												 [	-6.27305427, -0.00046547, 0.00028518, 7.27258880, 0.99857805, 0.99924935, 0.49321644],
-												 [	-6.27305444, -0.00046540, 0.00028514, 7.27258904, 0.99857827, 0.99924946, 0.49321647],
-												 [	-6.27305461, -0.00046533, 0.00028509, 7.27258928, 0.99857848, 0.99924958, 0.49321655],
-												 [	-6.27305477, -0.00046526, 0.00028505, 7.27258952, 0.99857870, 0.99924969, 0.49321652],
-												 [	-6.27305494, -0.00046519, 0.00028501, 7.27258975, 0.99857891, 0.99924980, 0.49321651],
-												 [	-6.27305511, -0.00046512, 0.00028497, 7.27258999, 0.99857912, 0.99924992, 0.49321656],
-												 [	-6.27305528, -0.00046505, 0.00028492, 7.27259023, 0.99857934, 0.99925003, 0.49321656],
-												 [	-6.27305544, -0.00046498, 0.00028488, 7.27259046, 0.99857955, 0.99925014, 0.49321665],
-												 [	-6.27305561, -0.00046491, 0.00028484, 7.27259070, 0.99857976, 0.99925025, 0.49321668],
-												 [	-6.27305578, -0.00046484, 0.00028479, 7.27259094, 0.99857998, 0.99925037, 0.49321665],
-												 [	-6.27305594, -0.00046477, 0.00028475, 7.27259117, 0.99858019, 0.99925048, 0.49321672],
-												 [	-6.27305611, -0.00046470, 0.00028471, 7.27259141, 0.99858040, 0.99925059, 0.49321675],
-												 [	-6.27305628, -0.00046463, 0.00028467, 7.27259165, 0.99858062, 0.99925070, 0.49321677],
-												 [	-6.27305645, -0.00046456, 0.00028462, 7.27259188, 0.99858083, 0.99925082, 0.49321675],
-												 [	-6.27305661, -0.00046449, 0.00028458, 7.27259212, 0.99858104, 0.99925093, 0.49321677],
-												 [	-6.27305678, -0.00046442, 0.00028454, 7.27259236, 0.99858126, 0.99925104, 0.49321687],
-												 [	-6.27305695, -0.00046435, 0.00028449, 7.27259259, 0.99858147, 0.99925115, 0.49321692],
-												 [	-6.27305711, -0.00046428, 0.00028445, 7.27259283, 0.99858168, 0.99925127, 0.49321690],
-												 [	-6.27305728, -0.00046421, 0.00028441, 7.27259307, 0.99858189, 0.99925138, 0.49321690],
-												 [	-6.27305745, -0.00046414, 0.00028437, 7.27259330, 0.99858211, 0.99925149, 0.49321703],
-												 [	-6.27305761, -0.00046407, 0.00028432, 7.27259354, 0.99858232, 0.99925160, 0.49321695],
-												 [	-6.27305778, -0.00046400, 0.00028428, 7.27259377, 0.99858253, 0.99925171, 0.49321702],
-												 [	-6.27305795, -0.00046393, 0.00028424, 7.27259401, 0.99858275, 0.99925183, 0.49321702],
-												 [	-6.27305811, -0.00046386, 0.00028420, 7.27259425, 0.99858296, 0.99925194, 0.49321707],
-												 [	-6.27305828, -0.00046380, 0.00028415, 7.27259448, 0.99858317, 0.99925205, 0.49321711],
-												 [	-6.27305844, -0.00046373, 0.00028411, 7.27259472, 0.99858338, 0.99925216, 0.49321702],
-												 [	-6.27305861, -0.00046366, 0.00028407, 7.27259495, 0.99858359, 0.99925227, 0.49321714],
-												 [	-6.27305878, -0.00046359, 0.00028403, 7.27259519, 0.99858381, 0.99925239, 0.49321714],
-												 [	-6.27305894, -0.00046352, 0.00028398, 7.27259543, 0.99858402, 0.99925250, 0.49321712],
-												 [	-6.27305911, -0.00046345, 0.00028394, 7.27259566, 0.99858423, 0.99925261, 0.49321724],
-												 [	-6.27305927, -0.00046338, 0.00028390, 7.27259590, 0.99858444, 0.99925272, 0.49321723],
-												 [	-6.27305944, -0.00046331, 0.00028386, 7.27259613, 0.99858465, 0.99925283, 0.49321718],
-												 [	-6.27305961, -0.00046324, 0.00028381, 7.27259637, 0.99858487, 0.99925295, 0.49321725],
-												 [	-6.27305977, -0.00046317, 0.00028377, 7.27259660, 0.99858508, 0.99925306, 0.49321729],
-												 [	-6.27305994, -0.00046310, 0.00028373, 7.27259684, 0.99858529, 0.99925317, 0.49321728],
-												 [	-6.27306010, -0.00046303, 0.00028369, 7.27259707, 0.99858550, 0.99925328, 0.49321728],
-												 [	-6.27306027, -0.00046296, 0.00028364, 7.27259731, 0.99858571, 0.99925339, 0.49321738],
-												 [	-6.27306044, -0.00046289, 0.00028360, 7.27259754, 0.99858593, 0.99925351, 0.49321730],
-												 [	-6.27306060, -0.00046282, 0.00028356, 7.27259778, 0.99858614, 0.99925362, 0.49321736],
-												 [	-6.27306077, -0.00046276, 0.00028352, 7.27259801, 0.99858635, 0.99925373, 0.49321743],
-												 [	-6.27306093, -0.00046269, 0.00028347, 7.27259825, 0.99858656, 0.99925384, 0.49321740],
-												 [	-6.27306110, -0.00046262, 0.00028343, 7.27259848, 0.99858677, 0.99925395, 0.49321757],
-												 [	-6.27306126, -0.00046255, 0.00028339, 7.27259872, 0.99858698, 0.99925406, 0.49321754],
-												 [	-6.27306143, -0.00046248, 0.00028335, 7.27259895, 0.99858719, 0.99925417, 0.49321760],
-												 [	-6.27306159, -0.00046241, 0.00028330, 7.27259918, 0.99858740, 0.99925429, 0.49321757],
-												 [	-6.27306176, -0.00046234, 0.00028326, 7.27259942, 0.99858762, 0.99925440, 0.49321761],
-												 [	-6.27306192, -0.00046227, 0.00028322, 7.27259965, 0.99858783, 0.99925451, 0.49321757],
-												 [	-6.27306209, -0.00046220, 0.00028318, 7.27259989, 0.99858804, 0.99925462, 0.49321764],
-												 [	-6.27306225, -0.00046213, 0.00028314, 7.27260012, 0.99858825, 0.99925473, 0.49321769],
-												 [	-6.27306242, -0.00046206, 0.00028309, 7.27260036, 0.99858846, 0.99925484, 0.49321767],
-												 [	-6.27306259, -0.00046200, 0.00028305, 7.27260059, 0.99858867, 0.99925495, 0.49321773],
-												 [	-6.27306275, -0.00046193, 0.00028301, 7.27260082, 0.99858888, 0.99925506, 0.49321772],
-												 [	-6.27306292, -0.00046186, 0.00028297, 7.27260106, 0.99858909, 0.99925518, 0.49321771],
-												 [	-6.27306308, -0.00046179, 0.00028292, 7.27260129, 0.99858930, 0.99925529, 0.49321779],
-												 [	-6.27306324, -0.00046172, 0.00028288, 7.27260152, 0.99858951, 0.99925540, 0.49321779],
-												 [	-6.27306341, -0.00046165, 0.00028284, 7.27260176, 0.99858972, 0.99925551, 0.49321780],
-												 [	-6.27306357, -0.00046158, 0.00028280, 7.27260199, 0.99858993, 0.99925562, 0.49321791],
-												 [	-6.27306374, -0.00046151, 0.00028275, 7.27260223, 0.99859014, 0.99925573, 0.49321791],
-												 [	-6.27306390, -0.00046144, 0.00028271, 7.27260246, 0.99859035, 0.99925584, 0.49321788],
-												 [	-6.27306407, -0.00046138, 0.00028267, 7.27260269, 0.99859056, 0.99925595, 0.49321791],
-												 [	-6.27306423, -0.00046131, 0.00028263, 7.27260293, 0.99859077, 0.99925606, 0.49321799],
-												 [	-6.27306440, -0.00046124, 0.00028259, 7.27260316, 0.99859098, 0.99925618, 0.49321795],
-												 [	-6.27306456, -0.00046117, 0.00028254, 7.27260339, 0.99859119, 0.99925629, 0.49321797],
-												 [	-6.27306473, -0.00046110, 0.00028250, 7.27260363, 0.99859140, 0.99925640, 0.49321800],
-												 [	-6.27306489, -0.00046103, 0.00028246, 7.27260386, 0.99859161, 0.99925651, 0.49321804],
-												 [	-6.27306505, -0.00046096, 0.00028242, 7.27260409, 0.99859182, 0.99925662, 0.49321800],
-												 [	-6.27306522, -0.00046090, 0.00028238, 7.27260432, 0.99859203, 0.99925673, 0.49321804],
-												 [	-6.27306538, -0.00046083, 0.00028233, 7.27260456, 0.99859224, 0.99925684, 0.49321806],
-												 [	-6.27306555, -0.00046076, 0.00028229, 7.27260479, 0.99859245, 0.99925695, 0.49321814],
-												 [	-6.27306571, -0.00046069, 0.00028225, 7.27260502, 0.99859266, 0.99925706, 0.49321818],
-												 [	-6.27306588, -0.00046062, 0.00028221, 7.27260525, 0.99859287, 0.99925717, 0.49321811],
-												 [	-6.27306604, -0.00046055, 0.00028217, 7.27260549, 0.99859308, 0.99925728, 0.49321821],
-												 [	-6.27306620, -0.00046048, 0.00028212, 7.27260572, 0.99859329, 0.99925739, 0.49321828],
-												 [	-6.27306637, -0.00046042, 0.00028208, 7.27260595, 0.99859350, 0.99925750, 0.49321829],
-												 [	-6.27306653, -0.00046035, 0.00028204, 7.27260618, 0.99859371, 0.99925761, 0.49321826],
-												 [	-6.27306670, -0.00046028, 0.00028200, 7.27260642, 0.99859392, 0.99925772, 0.49321833],
-												 [	-6.27306686, -0.00046021, 0.00028196, 7.27260665, 0.99859413, 0.99925783, 0.49321833],
-												 [	-6.27306702, -0.00046014, 0.00028191, 7.27260688, 0.99859434, 0.99925794, 0.49321830],
-												 [	-6.27306719, -0.00046007, 0.00028187, 7.27260711, 0.99859455, 0.99925805, 0.49321842],
-												 [	-6.27306735, -0.00046000, 0.00028183, 7.27260735, 0.99859475, 0.99925817, 0.49321838],
-												 [	-6.27306751, -0.00045994, 0.00028179, 7.27260758, 0.99859496, 0.99925828, 0.49321849],
-												 [	-6.27306768, -0.00045987, 0.00028175, 7.27260781, 0.99859517, 0.99925839, 0.49321848],
-												 [	-6.27306784, -0.00045980, 0.00028170, 7.27260804, 0.99859538, 0.99925850, 0.49321848],
-												 [	-6.27306800, -0.00045973, 0.00028166, 7.27260827, 0.99859559, 0.99925861, 0.49321852],
-												 [	-6.27306817, -0.00045966, 0.00028162, 7.27260850, 0.99859580, 0.99925872, 0.49321855],
-												 [	-6.27306833, -0.00045959, 0.00028158, 7.27260874, 0.99859601, 0.99925883, 0.49321849],
-												 [	-6.27306849, -0.00045953, 0.00028154, 7.27260897, 0.99859622, 0.99925894, 0.49321861],
-												 [	-6.27306866, -0.00045946, 0.00028150, 7.27260920, 0.99859642, 0.99925905, 0.49321858],
-												 [	-6.27306882, -0.00045939, 0.00028145, 7.27260943, 0.99859663, 0.99925916, 0.49321869],
-												 [	-6.27306898, -0.00045932, 0.00028141, 7.27260966, 0.99859684, 0.99925927, 0.49321873],
-												 [	-6.27306915, -0.00045925, 0.00028137, 7.27260989, 0.99859705, 0.99925938, 0.49321868],
-												 [	-6.27306931, -0.00045919, 0.00028133, 7.27261012, 0.99859726, 0.99925949, 0.49321872],
-												 [	-6.27306947, -0.00045912, 0.00028129, 7.27261035, 0.99859746, 0.99925960, 0.49321879],
-												 [	-6.27306964, -0.00045905, 0.00028124, 7.27261059, 0.99859767, 0.99925971, 0.49321873],
-												 [	-6.27306980, -0.00045898, 0.00028120, 7.27261082, 0.99859788, 0.99925982, 0.49321881],
-												 [	-6.27306996, -0.00045891, 0.00028116, 7.27261105, 0.99859809, 0.99925993, 0.49321869],
-												 [	-6.27307012, -0.00045885, 0.00028112, 7.27261128, 0.99859830, 0.99926003, 0.49321889],
-												 [	-6.27307029, -0.00045878, 0.00028108, 7.27261151, 0.99859850, 0.99926014, 0.49321883],
-												 [	-6.27307045, -0.00045871, 0.00028104, 7.27261174, 0.99859871, 0.99926025, 0.49321889],
-												 [	-6.27307061, -0.00045864, 0.00028099, 7.27261197, 0.99859892, 0.99926036, 0.49321886],
-												 [	-6.27307078, -0.00045857, 0.00028095, 7.27261220, 0.99859913, 0.99926047, 0.49321894],
-												 [	-6.27307094, -0.00045851, 0.00028091, 7.27261243, 0.99859934, 0.99926058, 0.49321894],
-												 [	-6.27307110, -0.00045844, 0.00028087, 7.27261266, 0.99859954, 0.99926069, 0.49321891],
-												 [	-6.27307126, -0.00045837, 0.00028083, 7.27261289, 0.99859975, 0.99926080, 0.49321907],
-												 [	-6.27307142, -0.00045830, 0.00028079, 7.27261312, 0.99859996, 0.99926091, 0.49321892],
-												 [	-6.27307159, -0.00045823, 0.00028074, 7.27261335, 0.99860016, 0.99926102, 0.49321904],
-												 [	-6.27307175, -0.00045817, 0.00028070, 7.27261358, 0.99860037, 0.99926113, 0.49321907],
-												 [	-6.27307191, -0.00045810, 0.00028066, 7.27261381, 0.99860058, 0.99926124, 0.49321903],
-												 [	-6.27307207, -0.00045803, 0.00028062, 7.27261404, 0.99860079, 0.99926135, 0.49321912],
-												 [	-6.27307224, -0.00045796, 0.00028058, 7.27261427, 0.99860099, 0.99926146, 0.49321912],
-												 [	-6.27307240, -0.00045790, 0.00028054, 7.27261450, 0.99860120, 0.99926157, 0.49321912],
-												 [	-6.27307256, -0.00045783, 0.00028050, 7.27261473, 0.99860141, 0.99926168, 0.49321924],
-												 [	-6.27307272, -0.00045776, 0.00028045, 7.27261496, 0.99860161, 0.99926179, 0.49321924],
-												 [	-6.27307288, -0.00045769, 0.00028041, 7.27261519, 0.99860182, 0.99926190, 0.49321921],
-												 [	-6.27307305, -0.00045762, 0.00028037, 7.27261542, 0.99860203, 0.99926200, 0.49321927],
-												 [	-6.27307321, -0.00045756, 0.00028033, 7.27261565, 0.99860223, 0.99926211, 0.49321925],
-												 [	-6.27307337, -0.00045749, 0.00028029, 7.27261588, 0.99860244, 0.99926222, 0.49321926],
-												 [	-6.27307353, -0.00045742, 0.00028025, 7.27261611, 0.99860265, 0.99926233, 0.49321932],
-												 [	-6.27307369, -0.00045735, 0.00028021, 7.27261634, 0.99860285, 0.99926244, 0.49321935],
-												 [	-6.27307386, -0.00045729, 0.00028016, 7.27261657, 0.99860306, 0.99926255, 0.49321931],
-												 [	-6.27307402, -0.00045722, 0.00028012, 7.27261680, 0.99860327, 0.99926266, 0.49321940],
-												 [	-6.27307418, -0.00045715, 0.00028008, 7.27261703, 0.99860347, 0.99926277, 0.49321940],
-												 [	-6.27307434, -0.00045708, 0.00028004, 7.27261726, 0.99860368, 0.99926288, 0.49321938],
-												 [	-6.27307450, -0.00045702, 0.00028000, 7.27261749, 0.99860389, 0.99926299, 0.49321955],
-												 [	-6.27307466, -0.00045695, 0.00027996, 7.27261771, 0.99860409, 0.99926309, 0.49321946],
-												 [	-6.27307482, -0.00045688, 0.00027992, 7.27261794, 0.99860430, 0.99926320, 0.49321952],
-												 [	-6.27307499, -0.00045681, 0.00027987, 7.27261817, 0.99860450, 0.99926331, 0.49321956],
-												 [	-6.27307515, -0.00045675, 0.00027983, 7.27261840, 0.99860471, 0.99926342, 0.49321950],
-												 [	-6.27307531, -0.00045668, 0.00027979, 7.27261863, 0.99860492, 0.99926353, 0.49321959],
-												 [	-6.27307547, -0.00045661, 0.00027975, 7.27261886, 0.99860512, 0.99926364, 0.49321954],
-												 [	-6.27307563, -0.00045654, 0.00027971, 7.27261909, 0.99860533, 0.99926375, 0.49321964],
-												 [	-6.27307579, -0.00045648, 0.00027967, 7.27261931, 0.99860553, 0.99926385, 0.49321960],
-												 [	-6.27307595, -0.00045641, 0.00027963, 7.27261954, 0.99860574, 0.99926396, 0.49321972],
-												 [	-6.27307611, -0.00045634, 0.00027959, 7.27261977, 0.99860595, 0.99926407, 0.49321973],
-												 [	-6.27307628, -0.00045628, 0.00027954, 7.27262000, 0.99860615, 0.99926418, 0.49321968],
-												 [	-6.27307644, -0.00045621, 0.00027950, 7.27262023, 0.99860636, 0.99926429, 0.49321967],
-												 [	-6.27307660, -0.00045614, 0.00027946, 7.27262046, 0.99860656, 0.99926440, 0.49321972],
-												 [	-6.27307676, -0.00045607, 0.00027942, 7.27262068, 0.99860677, 0.99926451, 0.49321981],
-												 [	-6.27307692, -0.00045601, 0.00027938, 7.27262091, 0.99860697, 0.99926461, 0.49321979],
-												 [	-6.27307708, -0.00045594, 0.00027934, 7.27262114, 0.99860718, 0.99926472, 0.49321986],
-												 [	-6.27307724, -0.00045587, 0.00027930, 7.27262137, 0.99860738, 0.99926483, 0.49321988],
-												 [	-6.27307740, -0.00045581, 0.00027926, 7.27262160, 0.99860759, 0.99926494, 0.49321990],
-												 [	-6.27307756, -0.00045574, 0.00027921, 7.27262182, 0.99860779, 0.99926505, 0.49321998],
-												 [	-6.27307772, -0.00045567, 0.00027917, 7.27262205, 0.99860800, 0.99926516, 0.49322003],
-												 [	-6.27307788, -0.00045560, 0.00027913, 7.27262228, 0.99860820, 0.99926526, 0.49321994],
-												 [	-6.27307804, -0.00045554, 0.00027909, 7.27262251, 0.99860841, 0.99926537, 0.49322002],
-												 [	-6.27307820, -0.00045547, 0.00027905, 7.27262273, 0.99860861, 0.99926548, 0.49321999],
-												 [	-6.27307836, -0.00045540, 0.00027901, 7.27262296, 0.99860882, 0.99926559, 0.49322005],
-												 [	-6.27307852, -0.00045534, 0.00027897, 7.27262319, 0.99860902, 0.99926570, 0.49322007],
-												 [	-6.27307868, -0.00045527, 0.00027893, 7.27262342, 0.99860923, 0.99926580, 0.49322002],
-												 [	-6.27307884, -0.00045520, 0.00027889, 7.27262364, 0.99860943, 0.99926591, 0.49322013],
-												 [	-6.27307900, -0.00045514, 0.00027884, 7.27262387, 0.99860964, 0.99926602, 0.49322009],
-												 [	-6.27307916, -0.00045507, 0.00027880, 7.27262410, 0.99860984, 0.99926613, 0.49322010],
-												 [	-6.27307932, -0.00045500, 0.00027876, 7.27262432, 0.99861004, 0.99926624, 0.49322020],
-												 [	-6.27307949, -0.00045493, 0.00027872, 7.27262455, 0.99861025, 0.99926634, 0.49322020],
-												 [	-6.27307964, -0.00045487, 0.00027868, 7.27262478, 0.99861045, 0.99926645, 0.49322021],
-												 [	-6.27307980, -0.00045480, 0.00027864, 7.27262500, 0.99861066, 0.99926656, 0.49322031],
-												 [	-6.27307996, -0.00045473, 0.00027860, 7.27262523, 0.99861086, 0.99926667, 0.49322031],
-												 [	-6.27308012, -0.00045467, 0.00027856, 7.27262546, 0.99861107, 0.99926677, 0.49322033],
-												 [	-6.27308028, -0.00045460, 0.00027852, 7.27262568, 0.99861127, 0.99926688, 0.49322029],
-												 [	-6.27308044, -0.00045453, 0.00027848, 7.27262591, 0.99861147, 0.99926699, 0.49322034],
-												 [	-6.27308060, -0.00045447, 0.00027844, 7.27262614, 0.99861168, 0.99926710, 0.49322033],
-												 [	-6.27308076, -0.00045440, 0.00027839, 7.27262636, 0.99861188, 0.99926721, 0.49322036],
-												 [	-6.27308092, -0.00045433, 0.00027835, 7.27262659, 0.99861209, 0.99926731, 0.49322047],
-												 [	-6.27308108, -0.00045427, 0.00027831, 7.27262682, 0.99861229, 0.99926742, 0.49322045],
-												 [	-6.27308124, -0.00045420, 0.00027827, 7.27262704, 0.99861249, 0.99926753, 0.49322049],
-												 [	-6.27308140, -0.00045413, 0.00027823, 7.27262727, 0.99861270, 0.99926764, 0.49322055],
-												 [	-6.27308156, -0.00045407, 0.00027819, 7.27262749, 0.99861290, 0.99926774, 0.49322054],
-												 [	-6.27308172, -0.00045400, 0.00027815, 7.27262772, 0.99861310, 0.99926785, 0.49322056],
-												 [	-6.27308188, -0.00045393, 0.00027811, 7.27262795, 0.99861331, 0.99926796, 0.49322059],
-												 [	-6.27308204, -0.00045387, 0.00027807, 7.27262817, 0.99861351, 0.99926807, 0.49322050],
-												 [	-6.27308220, -0.00045380, 0.00027803, 7.27262840, 0.99861371, 0.99926817, 0.49322063],
-												 [	-6.27308236, -0.00045373, 0.00027799, 7.27262862, 0.99861392, 0.99926828, 0.49322066],
-												 [	-6.27308252, -0.00045367, 0.00027795, 7.27262885, 0.99861412, 0.99926839, 0.49322063],
-												 [	-6.27308268, -0.00045360, 0.00027790, 7.27262907, 0.99861432, 0.99926849, 0.49322070],
-												 [	-6.27308284, -0.00045353, 0.00027786, 7.27262930, 0.99861453, 0.99926860, 0.49322066],
-												 [	-6.27308299, -0.00045347, 0.00027782, 7.27262953, 0.99861473, 0.99926871, 0.49322073],
-												 [	-6.27308315, -0.00045340, 0.00027778, 7.27262975, 0.99861493, 0.99926882, 0.49322074],
-												 [	-6.27308331, -0.00045334, 0.00027774, 7.27262998, 0.99861514, 0.99926892, 0.49322073],
-												 [	-6.27308347, -0.00045327, 0.00027770, 7.27263020, 0.99861534, 0.99926903, 0.49322080],
-												 [	-6.27308363, -0.00045320, 0.00027766, 7.27263043, 0.99861554, 0.99926914, 0.49322087],
-												 [	-6.27308379, -0.00045314, 0.00027762, 7.27263065, 0.99861574, 0.99926924, 0.49322079],
-												 [	-6.27308395, -0.00045307, 0.00027758, 7.27263088, 0.99861595, 0.99926935, 0.49322088],
-												 [	-6.27308411, -0.00045300, 0.00027754, 7.27263110, 0.99861615, 0.99926946, 0.49322089],
-												 [	-6.27308426, -0.00045294, 0.00027750, 7.27263133, 0.99861635, 0.99926956, 0.49322091],
-												 [	-6.27308442, -0.00045287, 0.00027746, 7.27263155, 0.99861655, 0.99926967, 0.49322099],
-												 [	-6.27308458, -0.00045281, 0.00027742, 7.27263178, 0.99861676, 0.99926978, 0.49322093],
-												 [	-6.27308474, -0.00045274, 0.00027738, 7.27263200, 0.99861696, 0.99926989, 0.49322094],
-												 [	-6.27308490, -0.00045267, 0.00027734, 7.27263223, 0.99861716, 0.99926999, 0.49322104],
-												 [	-6.27308506, -0.00045261, 0.00027729, 7.27263245, 0.99861736, 0.99927010, 0.49322101],
-												 [	-6.27308522, -0.00045254, 0.00027725, 7.27263268, 0.99861757, 0.99927021, 0.49322100],
-												 [	-6.27308537, -0.00045247, 0.00027721, 7.27263290, 0.99861777, 0.99927031, 0.49322109],
-												 [	-6.27308553, -0.00045241, 0.00027717, 7.27263312, 0.99861797, 0.99927042, 0.49322112],
-												 [	-6.27308569, -0.00045234, 0.00027713, 7.27263335, 0.99861817, 0.99927053, 0.49322118],
-												 [	-6.27308585, -0.00045228, 0.00027709, 7.27263357, 0.99861837, 0.99927063, 0.49322108],
-												 [	-6.27308601, -0.00045221, 0.00027705, 7.27263380, 0.99861858, 0.99927074, 0.49322119],
-												 [	-6.27308616, -0.00045214, 0.00027701, 7.27263402, 0.99861878, 0.99927085, 0.49322124],
-												 [	-6.27308632, -0.00045208, 0.00027697, 7.27263424, 0.99861898, 0.99927095, 0.49322120],
-												 [	-6.27308648, -0.00045201, 0.00027693, 7.27263447, 0.99861918, 0.99927106, 0.49322125],
-												 [	-6.27308664, -0.00045195, 0.00027689, 7.27263469, 0.99861938, 0.99927116, 0.49322131],
-												 [	-6.27308680, -0.00045188, 0.00027685, 7.27263492, 0.99861959, 0.99927127, 0.49322139],
-												 [	-6.27308695, -0.00045181, 0.00027681, 7.27263514, 0.99861979, 0.99927138, 0.49322128],
-												 [	-6.27308711, -0.00045175, 0.00027677, 7.27263536, 0.99861999, 0.99927148, 0.49322133],
-												 [	-6.27308727, -0.00045168, 0.00027673, 7.27263559, 0.99862019, 0.99927159, 0.49322134],
-												 [	-6.27308743, -0.00045162, 0.00027669, 7.27263581, 0.99862039, 0.99927170, 0.49322141],
-												 [	-6.27308759, -0.00045155, 0.00027665, 7.27263604, 0.99862059, 0.99927180, 0.49322137],
-												 [	-6.27308774, -0.00045148, 0.00027661, 7.27263626, 0.99862079, 0.99927191, 0.49322148],
-												 [	-6.27308790, -0.00045142, 0.00027657, 7.27263648, 0.99862099, 0.99927202, 0.49322145],
-												 [	-6.27308806, -0.00045135, 0.00027653, 7.27263671, 0.99862120, 0.99927212, 0.49322138],
-												 [	-6.27308822, -0.00045129, 0.00027649, 7.27263693, 0.99862140, 0.99927223, 0.49322155],
-												 [	-6.27308837, -0.00045122, 0.00027645, 7.27263715, 0.99862160, 0.99927233, 0.49322147],
-												 [	-6.27308853, -0.00045116, 0.00027641, 7.27263737, 0.99862180, 0.99927244, 0.49322164],
-												 [	-6.27308869, -0.00045109, 0.00027636, 7.27263760, 0.99862200, 0.99927255, 0.49322155],
-												 [	-6.27308884, -0.00045102, 0.00027632, 7.27263782, 0.99862220, 0.99927265, 0.49322156],
-												 [	-6.27308900, -0.00045096, 0.00027628, 7.27263804, 0.99862240, 0.99927276, 0.49322154],
-												 [	-6.27308916, -0.00045089, 0.00027624, 7.27263827, 0.99862260, 0.99927286, 0.49322167],
-												 [	-6.27308932, -0.00045083, 0.00027620, 7.27263849, 0.99862280, 0.99927297, 0.49322165],
-												 [	-6.27308947, -0.00045076, 0.00027616, 7.27263871, 0.99862300, 0.99927308, 0.49322177],
-												 [	-6.27308963, -0.00045070, 0.00027612, 7.27263894, 0.99862320, 0.99927318, 0.49322172],
-												 [	-6.27308979, -0.00045063, 0.00027608, 7.27263916, 0.99862340, 0.99927329, 0.49322177],
-												 [	-6.27308994, -0.00045056, 0.00027604, 7.27263938, 0.99862360, 0.99927339, 0.49322171],
-												 [	-6.27309010, -0.00045050, 0.00027600, 7.27263960, 0.99862381, 0.99927350, 0.49322172],
-												 [	-6.27309026, -0.00045043, 0.00027596, 7.27263983, 0.99862401, 0.99927360, 0.49322182],
-												 [	-6.27309042, -0.00045037, 0.00027592, 7.27264005, 0.99862421, 0.99927371, 0.49322183],
-												 [	-6.27309057, -0.00045030, 0.00027588, 7.27264027, 0.99862441, 0.99927382, 0.49322187],
-												 [	-6.27309073, -0.00045024, 0.00027584, 7.27264049, 0.99862461, 0.99927392, 0.49322184],
-												 [	-6.27309089, -0.00045017, 0.00027580, 7.27264071, 0.99862481, 0.99927403, 0.49322189],
-												 [	-6.27309104, -0.00045011, 0.00027576, 7.27264094, 0.99862501, 0.99927413, 0.49322190],
-												 [	-6.27309120, -0.00045004, 0.00027572, 7.27264116, 0.99862521, 0.99927424, 0.49322188],
-												 [	-6.27309136, -0.00044997, 0.00027568, 7.27264138, 0.99862541, 0.99927434, 0.49322197],
-												 [	-6.27309151, -0.00044991, 0.00027564, 7.27264160, 0.99862561, 0.99927445, 0.49322195],
-												 [	-6.27309167, -0.00044984, 0.00027560, 7.27264182, 0.99862581, 0.99927455, 0.49322198],
-												 [	-6.27309183, -0.00044978, 0.00027556, 7.27264205, 0.99862601, 0.99927466, 0.49322195],
-												 [	-6.27309198, -0.00044971, 0.00027552, 7.27264227, 0.99862621, 0.99927477, 0.49322211],
-												 [	-6.27309214, -0.00044965, 0.00027548, 7.27264249, 0.99862641, 0.99927487, 0.49322215],
-												 [	-6.27309229, -0.00044958, 0.00027544, 7.27264271, 0.99862660, 0.99927498, 0.49322209],
-												 [	-6.27309245, -0.00044952, 0.00027540, 7.27264293, 0.99862680, 0.99927508, 0.49322211],
-												 [	-6.27309261, -0.00044945, 0.00027536, 7.27264315, 0.99862700, 0.99927519, 0.49322213],
-												 [	-6.27309276, -0.00044939, 0.00027532, 7.27264338, 0.99862720, 0.99927529, 0.49322220],
-												 [	-6.27309292, -0.00044932, 0.00027528, 7.27264360, 0.99862740, 0.99927540, 0.49322206],
-												 [	-6.27309307, -0.00044926, 0.00027524, 7.27264382, 0.99862760, 0.99927550, 0.49322222],
-												 [	-6.27309323, -0.00044919, 0.00027520, 7.27264404, 0.99862780, 0.99927561, 0.49322230],
-												 [	-6.27309339, -0.00044913, 0.00027516, 7.27264426, 0.99862800, 0.99927571, 0.49322233],
-												 [	-6.27309354, -0.00044906, 0.00027512, 7.27264448, 0.99862820, 0.99927582, 0.49322226],
-												 [	-6.27309370, -0.00044900, 0.00027508, 7.27264470, 0.99862840, 0.99927592, 0.49322237],
-												 [	-6.27309385, -0.00044893, 0.00027504, 7.27264492, 0.99862860, 0.99927603, 0.49322238],
-												 [	-6.27309401, -0.00044887, 0.00027500, 7.27264514, 0.99862880, 0.99927613, 0.49322229],
-												 [	-6.27309417, -0.00044880, 0.00027496, 7.27264537, 0.99862899, 0.99927624, 0.49322245],
-												 [	-6.27309432, -0.00044874, 0.00027492, 7.27264559, 0.99862919, 0.99927634, 0.49322245],
-												 [	-6.27309448, -0.00044867, 0.00027488, 7.27264581, 0.99862939, 0.99927645, 0.49322246],
-												 [	-6.27309463, -0.00044861, 0.00027484, 7.27264603, 0.99862959, 0.99927655, 0.49322247],
-												 [	-6.27309479, -0.00044854, 0.00027480, 7.27264625, 0.99862979, 0.99927666, 0.49322254],
-												 [	-6.27309494, -0.00044848, 0.00027476, 7.27264647, 0.99862999, 0.99927676, 0.49322253],
-												 [	-6.27309510, -0.00044841, 0.00027472, 7.27264669, 0.99863019, 0.99927687, 0.49322258],
-												 [	-6.27309526, -0.00044835, 0.00027468, 7.27264691, 0.99863039, 0.99927697, 0.49322250],
-												 [	-6.27309541, -0.00044828, 0.00027464, 7.27264713, 0.99863058, 0.99927708, 0.49322253],
-												 [	-6.27309557, -0.00044822, 0.00027460, 7.27264735, 0.99863078, 0.99927718, 0.49322260],
-												 [	-6.27309572, -0.00044815, 0.00027456, 7.27264757, 0.99863098, 0.99927729, 0.49322265],
-												 [	-6.27309588, -0.00044809, 0.00027452, 7.27264779, 0.99863118, 0.99927739, 0.49322261],
-												 [	-6.27309603, -0.00044802, 0.00027448, 7.27264801, 0.99863138, 0.99927750, 0.49322265],
-												 [	-6.27309619, -0.00044796, 0.00027444, 7.27264823, 0.99863158, 0.99927760, 0.49322274],
-												 [	-6.27309634, -0.00044789, 0.00027440, 7.27264845, 0.99863177, 0.99927770, 0.49322271],
-												 [	-6.27309650, -0.00044783, 0.00027436, 7.27264867, 0.99863197, 0.99927781, 0.49322271],
-												 [	-6.27309665, -0.00044776, 0.00027432, 7.27264889, 0.99863217, 0.99927791, 0.49322277],
-												 [	-6.27309681, -0.00044770, 0.00027429, 7.27264911, 0.99863237, 0.99927802, 0.49322282],
-												 [	-6.27309696, -0.00044763, 0.00027425, 7.27264933, 0.99863256, 0.99927812, 0.49322277],
-												 [	-6.27309712, -0.00044757, 0.00027421, 7.27264955, 0.99863276, 0.99927823, 0.49322279],
-												 [	-6.27309727, -0.00044750, 0.00027417, 7.27264977, 0.99863296, 0.99927833, 0.49322290],
-												 [	-6.27309743, -0.00044744, 0.00027413, 7.27264999, 0.99863316, 0.99927844, 0.49322286],
-												 [	-6.27309758, -0.00044737, 0.00027409, 7.27265021, 0.99863336, 0.99927854, 0.49322289],
-												 [	-6.27309774, -0.00044731, 0.00027405, 7.27265043, 0.99863355, 0.99927864, 0.49322292],
-												 [	-6.27309789, -0.00044724, 0.00027401, 7.27265065, 0.99863375, 0.99927875, 0.49322303],
-												 [	-6.27309805, -0.00044718, 0.00027397, 7.27265087, 0.99863395, 0.99927885, 0.49322297],
-												 [	-6.27309820, -0.00044712, 0.00027393, 7.27265108, 0.99863415, 0.99927896, 0.49322299],
-												 [	-6.27309835, -0.00044705, 0.00027389, 7.27265130, 0.99863434, 0.99927906, 0.49322300],
-												 [	-6.27309851, -0.00044699, 0.00027385, 7.27265152, 0.99863454, 0.99927916, 0.49322302],
-												 [	-6.27309866, -0.00044692, 0.00027381, 7.27265174, 0.99863474, 0.99927927, 0.49322302],
-												 [	-6.27309882, -0.00044686, 0.00027377, 7.27265196, 0.99863493, 0.99927937, 0.49322309],
-												 [	-6.27309897, -0.00044679, 0.00027373, 7.27265218, 0.99863513, 0.99927948, 0.49322304],
-												 [	-6.27309913, -0.00044673, 0.00027369, 7.27265240, 0.99863533, 0.99927958, 0.49322317],
-												 [	-6.27309928, -0.00044666, 0.00027365, 7.27265262, 0.99863553, 0.99927968, 0.49322317],
-												 [	-6.27309944, -0.00044660, 0.00027361, 7.27265284, 0.99863572, 0.99927979, 0.49322320],
-												 [	-6.27309959, -0.00044653, 0.00027357, 7.27265305, 0.99863592, 0.99927989, 0.49322325],
-												 [	-6.27309974, -0.00044647, 0.00027353, 7.27265327, 0.99863612, 0.99928000, 0.49322322],
-												 [	-6.27309990, -0.00044641, 0.00027349, 7.27265349, 0.99863631, 0.99928010, 0.49322331],
-												 [	-6.27310005, -0.00044634, 0.00027345, 7.27265371, 0.99863651, 0.99928020, 0.49322327],
-												 [	-6.27310021, -0.00044628, 0.00027341, 7.27265393, 0.99863671, 0.99928031, 0.49322319],
-												 [	-6.27310036, -0.00044621, 0.00027338, 7.27265415, 0.99863690, 0.99928041, 0.49322336],
-												 [	-6.27310051, -0.00044615, 0.00027334, 7.27265436, 0.99863710, 0.99928052, 0.49322341],
-												 [	-6.27310067, -0.00044608, 0.00027330, 7.27265458, 0.99863730, 0.99928062, 0.49322335],
-												 [	-6.27310082, -0.00044602, 0.00027326, 7.27265480, 0.99863749, 0.99928072, 0.49322336],
-												 [	-6.27310097, -0.00044596, 0.00027322, 7.27265502, 0.99863769, 0.99928083, 0.49322343],
-												 [	-6.27310113, -0.00044589, 0.00027318, 7.27265524, 0.99863789, 0.99928093, 0.49322345],
-												 [	-6.27310128, -0.00044583, 0.00027314, 7.27265546, 0.99863808, 0.99928103, 0.49322341],
-												 [	-6.27310144, -0.00044576, 0.00027310, 7.27265567, 0.99863828, 0.99928114, 0.49322343],
-												 [	-6.27310159, -0.00044570, 0.00027306, 7.27265589, 0.99863847, 0.99928124, 0.49322353],
-												 [	-6.27310174, -0.00044563, 0.00027302, 7.27265611, 0.99863867, 0.99928134, 0.49322355],
-												 [	-6.27310190, -0.00044557, 0.00027298, 7.27265633, 0.99863887, 0.99928145, 0.49322359],
-												 [	-6.27310205, -0.00044551, 0.00027294, 7.27265654, 0.99863906, 0.99928155, 0.49322357],
-												 [	-6.27310220, -0.00044544, 0.00027290, 7.27265676, 0.99863926, 0.99928165, 0.49322365],
-												 [	-6.27310236, -0.00044538, 0.00027286, 7.27265698, 0.99863945, 0.99928176, 0.49322365],
-												 [	-6.27310251, -0.00044531, 0.00027282, 7.27265720, 0.99863965, 0.99928186, 0.49322366],
-												 [	-6.27310266, -0.00044525, 0.00027279, 7.27265741, 0.99863984, 0.99928196, 0.49322350],
-												 [	-6.27310282, -0.00044519, 0.00027275, 7.27265763, 0.99864004, 0.99928207, 0.49322363],
-												 [	-6.27310297, -0.00044512, 0.00027271, 7.27265785, 0.99864024, 0.99928217, 0.49322376],
-												 [	-6.27310312, -0.00044506, 0.00027267, 7.27265807, 0.99864043, 0.99928227, 0.49322376],
-												 [	-6.27310328, -0.00044499, 0.00027263, 7.27265828, 0.99864063, 0.99928238, 0.49322386],
-												 [	-6.27310343, -0.00044493, 0.00027259, 7.27265850, 0.99864082, 0.99928248, 0.49322387],
-												 [	-6.27310358, -0.00044487, 0.00027255, 7.27265872, 0.99864102, 0.99928258, 0.49322377],
-												 [	-6.27310374, -0.00044480, 0.00027251, 7.27265893, 0.99864121, 0.99928269, 0.49322371],
-												 [	-6.27310389, -0.00044474, 0.00027247, 7.27265915, 0.99864141, 0.99928279, 0.49322385],
-												 [	-6.27310404, -0.00044467, 0.00027243, 7.27265937, 0.99864160, 0.99928289, 0.49322391],
-												 [	-6.27310419, -0.00044461, 0.00027239, 7.27265958, 0.99864180, 0.99928300, 0.49322388],
-												 [	-6.27310435, -0.00044455, 0.00027235, 7.27265980, 0.99864199, 0.99928310, 0.49322387],
-												 [	-6.27310450, -0.00044448, 0.00027231, 7.27266002, 0.99864219, 0.99928320, 0.49322394],
-												 [	-6.27310465, -0.00044442, 0.00027228, 7.27266023, 0.99864238, 0.99928330, 0.49322403],
-												 [	-6.27310481, -0.00044436, 0.00027224, 7.27266045, 0.99864258, 0.99928341, 0.49322393],
-												 [	-6.27310496, -0.00044429, 0.00027220, 7.27266067, 0.99864277, 0.99928351, 0.49322396],
-												 [	-6.27310511, -0.00044423, 0.00027216, 7.27266088, 0.99864297, 0.99928361, 0.49322397],
-												 [	-6.27310526, -0.00044416, 0.00027212, 7.27266110, 0.99864316, 0.99928372, 0.49322408],
-												 [	-6.27310542, -0.00044410, 0.00027208, 7.27266132, 0.99864336, 0.99928382, 0.49322399],
-												 [	-6.27310557, -0.00044404, 0.00027204, 7.27266153, 0.99864355, 0.99928392, 0.49322405],
-												 [	-6.27310572, -0.00044397, 0.00027200, 7.27266175, 0.99864375, 0.99928402, 0.49322411],
-												 [	-6.27310587, -0.00044391, 0.00027196, 7.27266196, 0.99864394, 0.99928413, 0.49322415],
-												 [	-6.27310603, -0.00044385, 0.00027192, 7.27266218, 0.99864414, 0.99928423, 0.49322414],
-												 [	-6.27310618, -0.00044378, 0.00027189, 7.27266240, 0.99864433, 0.99928433, 0.49322429],
-												 [	-6.27310633, -0.00044372, 0.00027185, 7.27266261, 0.99864453, 0.99928444, 0.49322422],
-												 [	-6.27310648, -0.00044365, 0.00027181, 7.27266283, 0.99864472, 0.99928454, 0.49322422],
-												 [	-6.27310663, -0.00044359, 0.00027177, 7.27266304, 0.99864491, 0.99928464, 0.49322418],
-												 [	-6.27310679, -0.00044353, 0.00027173, 7.27266326, 0.99864511, 0.99928474, 0.49322426],
-												 [	-6.27310694, -0.00044346, 0.00027169, 7.27266347, 0.99864530, 0.99928485, 0.49322432],
-												 [	-6.27310709, -0.00044340, 0.00027165, 7.27266369, 0.99864550, 0.99928495, 0.49322429],
-												 [	-6.27310724, -0.00044334, 0.00027161, 7.27266391, 0.99864569, 0.99928505, 0.49322440],
-												 [	-6.27310739, -0.00044327, 0.00027157, 7.27266412, 0.99864589, 0.99928515, 0.49322431],
-												 [	-6.27310755, -0.00044321, 0.00027153, 7.27266434, 0.99864608, 0.99928526, 0.49322435],
-												 [	-6.27310770, -0.00044315, 0.00027150, 7.27266455, 0.99864627, 0.99928536, 0.49322446],
-												 [	-6.27310785, -0.00044308, 0.00027146, 7.27266477, 0.99864647, 0.99928546, 0.49322440],
-												 [	-6.27310800, -0.00044302, 0.00027142, 7.27266498, 0.99864666, 0.99928556, 0.49322441],
-												 [	-6.27310815, -0.00044296, 0.00027138, 7.27266520, 0.99864685, 0.99928566, 0.49322447],
-												 [	-6.27310831, -0.00044289, 0.00027134, 7.27266541, 0.99864705, 0.99928577, 0.49322449],
-												 [	-6.27310846, -0.00044283, 0.00027130, 7.27266563, 0.99864724, 0.99928587, 0.49322455],
-												 [	-6.27310861, -0.00044277, 0.00027126, 7.27266584, 0.99864744, 0.99928597, 0.49322455],
-												 [	-6.27310876, -0.00044270, 0.00027122, 7.27266606, 0.99864763, 0.99928607, 0.49322448],
-												 [	-6.27310891, -0.00044264, 0.00027119, 7.27266627, 0.99864782, 0.99928618, 0.49322460],
-												 [	-6.27310906, -0.00044258, 0.00027115, 7.27266649, 0.99864802, 0.99928628, 0.49322463],
-												 [	-6.27310921, -0.00044251, 0.00027111, 7.27266670, 0.99864821, 0.99928638, 0.49322466],
-												 [	-6.27310937, -0.00044245, 0.00027107, 7.27266692, 0.99864840, 0.99928648, 0.49322476],
-												 [	-6.27310952, -0.00044239, 0.00027103, 7.27266713, 0.99864860, 0.99928658, 0.49322465],
-												 [	-6.27310967, -0.00044232, 0.00027099, 7.27266735, 0.99864879, 0.99928669, 0.49322471],
-												 [	-6.27310982, -0.00044226, 0.00027095, 7.27266756, 0.99864898, 0.99928679, 0.49322475],
-												 [	-6.27310997, -0.00044220, 0.00027091, 7.27266777, 0.99864917, 0.99928689, 0.49322474],
-												 [	-6.27311012, -0.00044213, 0.00027088, 7.27266799, 0.99864937, 0.99928699, 0.49322474],
-												 [	-6.27311027, -0.00044207, 0.00027084, 7.27266820, 0.99864956, 0.99928709, 0.49322480],
-												 [	-6.27311042, -0.00044201, 0.00027080, 7.27266842, 0.99864975, 0.99928719, 0.49322485],
-												 [	-6.27311058, -0.00044194, 0.00027076, 7.27266863, 0.99864995, 0.99928730, 0.49322481],
-												 [	-6.27311073, -0.00044188, 0.00027072, 7.27266884, 0.99865014, 0.99928740, 0.49322488],
-												 [	-6.27311088, -0.00044182, 0.00027068, 7.27266906, 0.99865033, 0.99928750, 0.49322485],
-												 [	-6.27311103, -0.00044176, 0.00027064, 7.27266927, 0.99865052, 0.99928760, 0.49322488],
-												 [	-6.27311118, -0.00044169, 0.00027060, 7.27266949, 0.99865072, 0.99928770, 0.49322494],
-												 [	-6.27311133, -0.00044163, 0.00027057, 7.27266970, 0.99865091, 0.99928780, 0.49322492],
-												 [	-6.27311148, -0.00044157, 0.00027053, 7.27266991, 0.99865110, 0.99928791, 0.49322499],
-												 [	-6.27311163, -0.00044150, 0.00027049, 7.27267013, 0.99865129, 0.99928801, 0.49322490],
-												 [	-6.27311178, -0.00044144, 0.00027045, 7.27267034, 0.99865149, 0.99928811, 0.49322494],
-												 [	-6.27311193, -0.00044138, 0.00027041, 7.27267056, 0.99865168, 0.99928821, 0.49322503],
-												 [	-6.27311208, -0.00044131, 0.00027037, 7.27267077, 0.99865187, 0.99928831, 0.49322507],
-												 [	-6.27311223, -0.00044125, 0.00027033, 7.27267098, 0.99865206, 0.99928841, 0.49322506],
-												 [	-6.27311238, -0.00044119, 0.00027030, 7.27267120, 0.99865226, 0.99928852, 0.49322507],
-												 [	-6.27311253, -0.00044113, 0.00027026, 7.27267141, 0.99865245, 0.99928862, 0.49322511],
-												 [	-6.27311269, -0.00044106, 0.00027022, 7.27267162, 0.99865264, 0.99928872, 0.49322515],
-												 [	-6.27311284, -0.00044100, 0.00027018, 7.27267184, 0.99865283, 0.99928882, 0.49322525],
-												 [	-6.27311299, -0.00044094, 0.00027014, 7.27267205, 0.99865302, 0.99928892, 0.49322511],
-												 [	-6.27311314, -0.00044087, 0.00027010, 7.27267226, 0.99865322, 0.99928902, 0.49322518],
-												 [	-6.27311329, -0.00044081, 0.00027006, 7.27267247, 0.99865341, 0.99928912, 0.49322526],
-												 [	-6.27311344, -0.00044075, 0.00027003, 7.27267269, 0.99865360, 0.99928922, 0.49322521],
-												 [	-6.27311359, -0.00044069, 0.00026999, 7.27267290, 0.99865379, 0.99928933, 0.49322528],
-												 [	-6.27311374, -0.00044062, 0.00026995, 7.27267311, 0.99865398, 0.99928943, 0.49322529],
-												 [	-6.27311389, -0.00044056, 0.00026991, 7.27267333, 0.99865418, 0.99928953, 0.49322527],
-												 [	-6.27311404, -0.00044050, 0.00026987, 7.27267354, 0.99865437, 0.99928963, 0.49322539],
-												 [	-6.27311419, -0.00044044, 0.00026983, 7.27267375, 0.99865456, 0.99928973, 0.49322538],
-												 [	-6.27311434, -0.00044037, 0.00026980, 7.27267396, 0.99865475, 0.99928983, 0.49322547],
-												 [	-6.27311449, -0.00044031, 0.00026976, 7.27267418, 0.99865494, 0.99928993, 0.49322544],
-												 [	-6.27311464, -0.00044025, 0.00026972, 7.27267439, 0.99865513, 0.99929003, 0.49322545],
-												 [	-6.27311479, -0.00044018, 0.00026968, 7.27267460, 0.99865532, 0.99929013, 0.49322545],
-												 [	-6.27311494, -0.00044012, 0.00026964, 7.27267481, 0.99865551, 0.99929024, 0.49322537],
-												 [	-6.27311509, -0.00044006, 0.00026960, 7.27267503, 0.99865571, 0.99929034, 0.49322549],
-												 [	-6.27311524, -0.00044000, 0.00026957, 7.27267524, 0.99865590, 0.99929044, 0.49322552],
-												 [	-6.27311539, -0.00043993, 0.00026953, 7.27267545, 0.99865609, 0.99929054, 0.49322561],
-												 [	-6.27311554, -0.00043987, 0.00026949, 7.27267566, 0.99865628, 0.99929064, 0.49322551],
-												 [	-6.27311569, -0.00043981, 0.00026945, 7.27267588, 0.99865647, 0.99929074, 0.49322559],
-												 [	-6.27311583, -0.00043975, 0.00026941, 7.27267609, 0.99865666, 0.99929084, 0.49322564],
-												 [	-6.27311598, -0.00043968, 0.00026937, 7.27267630, 0.99865685, 0.99929094, 0.49322558],
-												 [	-6.27311613, -0.00043962, 0.00026934, 7.27267651, 0.99865704, 0.99929104, 0.49322567],
-												 [	-6.27311628, -0.00043956, 0.00026930, 7.27267672, 0.99865723, 0.99929114, 0.49322564],
-												 [	-6.27311643, -0.00043950, 0.00026926, 7.27267693, 0.99865742, 0.99929124, 0.49322573],
-												 [	-6.27311658, -0.00043944, 0.00026922, 7.27267715, 0.99865762, 0.99929134, 0.49322571],
-												 [	-6.27311673, -0.00043937, 0.00026918, 7.27267736, 0.99865781, 0.99929144, 0.49322569],
-												 [	-6.27311688, -0.00043931, 0.00026914, 7.27267757, 0.99865800, 0.99929155, 0.49322578],
-												 [	-6.27311703, -0.00043925, 0.00026911, 7.27267778, 0.99865819, 0.99929165, 0.49322578],
-												 [	-6.27311718, -0.00043919, 0.00026907, 7.27267799, 0.99865838, 0.99929175, 0.49322584],
-												 [	-6.27311733, -0.00043912, 0.00026903, 7.27267820, 0.99865857, 0.99929185, 0.49322586],
-												 [	-6.27311748, -0.00043906, 0.00026899, 7.27267842, 0.99865876, 0.99929195, 0.49322590],
-												 [	-6.27311763, -0.00043900, 0.00026895, 7.27267863, 0.99865895, 0.99929205, 0.49322588],
-												 [	-6.27311777, -0.00043894, 0.00026892, 7.27267884, 0.99865914, 0.99929215, 0.49322594],
-												 [	-6.27311792, -0.00043887, 0.00026888, 7.27267905, 0.99865933, 0.99929225, 0.49322584],
-												 [	-6.27311807, -0.00043881, 0.00026884, 7.27267926, 0.99865952, 0.99929235, 0.49322593],
-												 [	-6.27311822, -0.00043875, 0.00026880, 7.27267947, 0.99865971, 0.99929245, 0.49322593],
-												 [	-6.27311837, -0.00043869, 0.00026876, 7.27267968, 0.99865990, 0.99929255, 0.49322599],
-												 [	-6.27311852, -0.00043863, 0.00026872, 7.27267989, 0.99866009, 0.99929265, 0.49322601],
-												 [	-6.27311867, -0.00043856, 0.00026869, 7.27268010, 0.99866028, 0.99929275, 0.49322609],
-												 [	-6.27311882, -0.00043850, 0.00026865, 7.27268032, 0.99866047, 0.99929285, 0.49322605],
-												 [	-6.27311897, -0.00043844, 0.00026861, 7.27268053, 0.99866066, 0.99929295, 0.49322609],
-												 [	-6.27311911, -0.00043838, 0.00026857, 7.27268074, 0.99866085, 0.99929305, 0.49322609],
-												 [	-6.27311926, -0.00043832, 0.00026853, 7.27268095, 0.99866104, 0.99929315, 0.49322617],
-												 [	-6.27311941, -0.00043825, 0.00026850, 7.27268116, 0.99866123, 0.99929325, 0.49322622],
-												 [	-6.27311956, -0.00043819, 0.00026846, 7.27268137, 0.99866142, 0.99929335, 0.49322614],
-												 [	-6.27311971, -0.00043813, 0.00026842, 7.27268158, 0.99866161, 0.99929345, 0.49322631],
-												 [	-6.27311986, -0.00043807, 0.00026838, 7.27268179, 0.99866180, 0.99929355, 0.49322620],
-												 [	-6.27312000, -0.00043800, 0.00026834, 7.27268200, 0.99866199, 0.99929365, 0.49322616],
-												 [	-6.27312015, -0.00043794, 0.00026831, 7.27268221, 0.99866217, 0.99929375, 0.49322624],
-												 [	-6.27312030, -0.00043788, 0.00026827, 7.27268242, 0.99866236, 0.99929385, 0.49322623],
-												 [	-6.27312045, -0.00043782, 0.00026823, 7.27268263, 0.99866255, 0.99929395, 0.49322635],
-												 [	-6.27312060, -0.00043776, 0.00026819, 7.27268284, 0.99866274, 0.99929405, 0.49322632],
-												 [	-6.27312075, -0.00043770, 0.00026815, 7.27268305, 0.99866293, 0.99929415, 0.49322635],
-												 [	-6.27312089, -0.00043763, 0.00026812, 7.27268326, 0.99866312, 0.99929425, 0.49322639],
-												 [	-6.27312104, -0.00043757, 0.00026808, 7.27268347, 0.99866331, 0.99929435, 0.49322639],
-												 [	-6.27312119, -0.00043751, 0.00026804, 7.27268368, 0.99866350, 0.99929445, 0.49322638],
-												 [	-6.27312134, -0.00043745, 0.00026800, 7.27268389, 0.99866369, 0.99929455, 0.49322647],
-												 [	-6.27312149, -0.00043739, 0.00026796, 7.27268410, 0.99866388, 0.99929465, 0.49322642],
-												 [	-6.27312163, -0.00043732, 0.00026793, 7.27268431, 0.99866407, 0.99929475, 0.49322644],
-												 [	-6.27312178, -0.00043726, 0.00026789, 7.27268452, 0.99866425, 0.99929485, 0.49322646],
-												 [	-6.27312193, -0.00043720, 0.00026785, 7.27268473, 0.99866444, 0.99929495, 0.49322653],
-												 [	-6.27312208, -0.00043714, 0.00026781, 7.27268494, 0.99866463, 0.99929505, 0.49322663],
-												 [	-6.27312223, -0.00043708, 0.00026778, 7.27268515, 0.99866482, 0.99929515, 0.49322655],
-												 [	-6.27312237, -0.00043702, 0.00026774, 7.27268536, 0.99866501, 0.99929525, 0.49322658],
-												 [	-6.27312252, -0.00043695, 0.00026770, 7.27268557, 0.99866520, 0.99929535, 0.49322660],
-												 [	-6.27312267, -0.00043689, 0.00026766, 7.27268578, 0.99866539, 0.99929545, 0.49322666],
-												 [	-6.27312282, -0.00043683, 0.00026762, 7.27268599, 0.99866557, 0.99929555, 0.49322663],
-												 [	-6.27312296, -0.00043677, 0.00026759, 7.27268619, 0.99866576, 0.99929564, 0.49322672],
-												 [	-6.27312311, -0.00043671, 0.00026755, 7.27268640, 0.99866595, 0.99929574, 0.49322669],
-												 [	-6.27312326, -0.00043665, 0.00026751, 7.27268661, 0.99866614, 0.99929584, 0.49322667],
-												 [	-6.27312341, -0.00043658, 0.00026747, 7.27268682, 0.99866633, 0.99929594, 0.49322665],
-												 [	-6.27312355, -0.00043652, 0.00026744, 7.27268703, 0.99866652, 0.99929604, 0.49322678],
-												 [	-6.27312370, -0.00043646, 0.00026740, 7.27268724, 0.99866670, 0.99929614, 0.49322680],
-												 [	-6.27312385, -0.00043640, 0.00026736, 7.27268745, 0.99866689, 0.99929624, 0.49322677],
-												 [	-6.27312399, -0.00043634, 0.00026732, 7.27268766, 0.99866708, 0.99929634, 0.49322687],
-												 [	-6.27312414, -0.00043628, 0.00026728, 7.27268787, 0.99866727, 0.99929644, 0.49322695],
-												 [	-6.27312429, -0.00043622, 0.00026725, 7.27268807, 0.99866746, 0.99929654, 0.49322684],
-												 [	-6.27312444, -0.00043615, 0.00026721, 7.27268828, 0.99866764, 0.99929664, 0.49322695],
-												 [	-6.27312458, -0.00043609, 0.00026717, 7.27268849, 0.99866783, 0.99929674, 0.49322694],
-												 [	-6.27312473, -0.00043603, 0.00026713, 7.27268870, 0.99866802, 0.99929684, 0.49322694],
-												 [	-6.27312488, -0.00043597, 0.00026710, 7.27268891, 0.99866821, 0.99929693, 0.49322692],
-												 [	-6.27312502, -0.00043591, 0.00026706, 7.27268912, 0.99866839, 0.99929703, 0.49322694],
-												 [	-6.27312517, -0.00043585, 0.00026702, 7.27268932, 0.99866858, 0.99929713, 0.49322699],
-												 [	-6.27312532, -0.00043579, 0.00026698, 7.27268953, 0.99866877, 0.99929723, 0.49322697],
-												 [	-6.27312546, -0.00043572, 0.00026695, 7.27268974, 0.99866896, 0.99929733, 0.49322709],
-												 [	-6.27312561, -0.00043566, 0.00026691, 7.27268995, 0.99866914, 0.99929743, 0.49322698],
-												 [	-6.27312576, -0.00043560, 0.00026687, 7.27269016, 0.99866933, 0.99929753, 0.49322713],
-												 [	-6.27312590, -0.00043554, 0.00026683, 7.27269037, 0.99866952, 0.99929763, 0.49322708],
-												 [	-6.27312605, -0.00043548, 0.00026680, 7.27269057, 0.99866971, 0.99929773, 0.49322723],
-												 [	-6.27312620, -0.00043542, 0.00026676, 7.27269078, 0.99866989, 0.99929782, 0.49322717],
-												 [	-6.27312634, -0.00043536, 0.00026672, 7.27269099, 0.99867008, 0.99929792, 0.49322722],
-												 [	-6.27312649, -0.00043529, 0.00026668, 7.27269120, 0.99867027, 0.99929802, 0.49322714],
-												 [	-6.27312664, -0.00043523, 0.00026665, 7.27269140, 0.99867045, 0.99929812, 0.49322725],
-												 [	-6.27312678, -0.00043517, 0.00026661, 7.27269161, 0.99867064, 0.99929822, 0.49322739],
-												 [	-6.27312693, -0.00043511, 0.00026657, 7.27269182, 0.99867083, 0.99929832, 0.49322721],
-												 [	-6.27312708, -0.00043505, 0.00026653, 7.27269203, 0.99867101, 0.99929842, 0.49322728],
-												 [	-6.27312722, -0.00043499, 0.00026650, 7.27269223, 0.99867120, 0.99929852, 0.49322731],
-												 [	-6.27312737, -0.00043493, 0.00026646, 7.27269244, 0.99867139, 0.99929861, 0.49322735],
-												 [	-6.27312752, -0.00043487, 0.00026642, 7.27269265, 0.99867158, 0.99929871, 0.49322737],
-												 [	-6.27312766, -0.00043481, 0.00026638, 7.27269286, 0.99867176, 0.99929881, 0.49322735],
-												 [	-6.27312781, -0.00043474, 0.00026635, 7.27269306, 0.99867195, 0.99929891, 0.49322744],
-												 [	-6.27312795, -0.00043468, 0.00026631, 7.27269327, 0.99867214, 0.99929901, 0.49322745],
-												 [	-6.27312810, -0.00043462, 0.00026627, 7.27269348, 0.99867232, 0.99929911, 0.49322747],
-												 [	-6.27312825, -0.00043456, 0.00026623, 7.27269368, 0.99867251, 0.99929920, 0.49322750],
-												 [	-6.27312839, -0.00043450, 0.00026620, 7.27269389, 0.99867269, 0.99929930, 0.49322745],
-												 [	-6.27312854, -0.00043444, 0.00026616, 7.27269410, 0.99867288, 0.99929940, 0.49322761],
-												 [	-6.27312868, -0.00043438, 0.00026612, 7.27269431, 0.99867307, 0.99929950, 0.49322746],
-												 [	-6.27312883, -0.00043432, 0.00026608, 7.27269451, 0.99867325, 0.99929960, 0.49322757],
-												 [	-6.27312898, -0.00043426, 0.00026605, 7.27269472, 0.99867344, 0.99929970, 0.49322765],
-												 [	-6.27312912, -0.00043420, 0.00026601, 7.27269493, 0.99867363, 0.99929979, 0.49322763],
-												 [	-6.27312927, -0.00043413, 0.00026597, 7.27269513, 0.99867381, 0.99929989, 0.49322751],
-												 [	-6.27312941, -0.00043407, 0.00026593, 7.27269534, 0.99867400, 0.99929999, 0.49322758],
-												 [	-6.27312956, -0.00043401, 0.00026590, 7.27269555, 0.99867418, 0.99930009, 0.49322771],
-												 [	-6.27312970, -0.00043395, 0.00026586, 7.27269575, 0.99867437, 0.99930019, 0.49322770],
-												 [	-6.27312985, -0.00043389, 0.00026582, 7.27269596, 0.99867456, 0.99930029, 0.49322772],
-												 [	-6.27313000, -0.00043383, 0.00026579, 7.27269616, 0.99867474, 0.99930038, 0.49322775],
-												 [	-6.27313014, -0.00043377, 0.00026575, 7.27269637, 0.99867493, 0.99930048, 0.49322776],
-												 [	-6.27313029, -0.00043371, 0.00026571, 7.27269658, 0.99867511, 0.99930058, 0.49322779],
-												 [	-6.27313043, -0.00043365, 0.00026567, 7.27269678, 0.99867530, 0.99930068, 0.49322775],
-												 [	-6.27313058, -0.00043359, 0.00026564, 7.27269699, 0.99867548, 0.99930078, 0.49322782],
-												 [	-6.27313072, -0.00043353, 0.00026560, 7.27269720, 0.99867567, 0.99930087, 0.49322777],
-												 [	-6.27313087, -0.00043347, 0.00026556, 7.27269740, 0.99867586, 0.99930097, 0.49322785],
-												 [	-6.27313101, -0.00043341, 0.00026552, 7.27269761, 0.99867604, 0.99930107, 0.49322785],
-												 [	-6.27313116, -0.00043335, 0.00026549, 7.27269781, 0.99867623, 0.99930117, 0.49322792],
-												 [	-6.27313130, -0.00043328, 0.00026545, 7.27269802, 0.99867641, 0.99930127, 0.49322802],
-												 [	-6.27313145, -0.00043322, 0.00026541, 7.27269823, 0.99867660, 0.99930136, 0.49322800],
-												 [	-6.27313159, -0.00043316, 0.00026538, 7.27269843, 0.99867678, 0.99930146, 0.49322801],
-												 [	-6.27313174, -0.00043310, 0.00026534, 7.27269864, 0.99867697, 0.99930156, 0.49322793],
-												 [	-6.27313188, -0.00043304, 0.00026530, 7.27269884, 0.99867715, 0.99930166, 0.49322797],
-												 [	-6.27313203, -0.00043298, 0.00026526, 7.27269905, 0.99867734, 0.99930175, 0.49322808],
-												 [	-6.27313217, -0.00043292, 0.00026523, 7.27269925, 0.99867752, 0.99930185, 0.49322805],
-												 [	-6.27313232, -0.00043286, 0.00026519, 7.27269946, 0.99867771, 0.99930195, 0.49322811],
-												 [	-6.27313246, -0.00043280, 0.00026515, 7.27269966, 0.99867789, 0.99930205, 0.49322809],
-												 [	-6.27313261, -0.00043274, 0.00026512, 7.27269987, 0.99867808, 0.99930214, 0.49322806],
-												 [	-6.27313275, -0.00043268, 0.00026508, 7.27270007, 0.99867826, 0.99930224, 0.49322819],
-												 [	-6.27313290, -0.00043262, 0.00026504, 7.27270028, 0.99867845, 0.99930234, 0.49322820],
-												 [	-6.27313304, -0.00043256, 0.00026501, 7.27270049, 0.99867863, 0.99930244, 0.49322821],
-												 [	-6.27313319, -0.00043250, 0.00026497, 7.27270069, 0.99867882, 0.99930253, 0.49322826],
-												 [	-6.27313333, -0.00043244, 0.00026493, 7.27270090, 0.99867900, 0.99930263, 0.49322825],
-												 [	-6.27313348, -0.00043238, 0.00026489, 7.27270110, 0.99867919, 0.99930273, 0.49322828],
-												 [	-6.27313362, -0.00043232, 0.00026486, 7.27270131, 0.99867937, 0.99930283, 0.49322824],
-												 [	-6.27313377, -0.00043226, 0.00026482, 7.27270151, 0.99867955, 0.99930292, 0.49322829],
-												 [	-6.27313391, -0.00043220, 0.00026478, 7.27270171, 0.99867974, 0.99930302, 0.49322833],
-												 [	-6.27313405, -0.00043214, 0.00026475, 7.27270192, 0.99867992, 0.99930312, 0.49322832],
-												 [	-6.27313420, -0.00043207, 0.00026471, 7.27270212, 0.99868011, 0.99930322, 0.49322832],
-												 [	-6.27313434, -0.00043201, 0.00026467, 7.27270233, 0.99868029, 0.99930331, 0.49322841],
-												 [	-6.27313449, -0.00043195, 0.00026464, 7.27270253, 0.99868048, 0.99930341, 0.49322842],
-												 [	-6.27313463, -0.00043189, 0.00026460, 7.27270274, 0.99868066, 0.99930351, 0.49322850],
-												 [	-6.27313478, -0.00043183, 0.00026456, 7.27270294, 0.99868084, 0.99930360, 0.49322849],
-												 [	-6.27313492, -0.00043177, 0.00026452, 7.27270315, 0.99868103, 0.99930370, 0.49322832],
-												 [	-6.27313506, -0.00043171, 0.00026449, 7.27270335, 0.99868121, 0.99930380, 0.49322850],
-												 [	-6.27313521, -0.00043165, 0.00026445, 7.27270356, 0.99868140, 0.99930390, 0.49322849],
-												 [	-6.27313535, -0.00043159, 0.00026441, 7.27270376, 0.99868158, 0.99930399, 0.49322851],
-												 [	-6.27313550, -0.00043153, 0.00026438, 7.27270396, 0.99868176, 0.99930409, 0.49322842],
-												 [	-6.27313564, -0.00043147, 0.00026434, 7.27270417, 0.99868195, 0.99930419, 0.49322856],
-												 [	-6.27313578, -0.00043141, 0.00026430, 7.27270437, 0.99868213, 0.99930428, 0.49322852],
-												 [	-6.27313593, -0.00043135, 0.00026427, 7.27270458, 0.99868232, 0.99930438, 0.49322857],
-												 [	-6.27313607, -0.00043129, 0.00026423, 7.27270478, 0.99868250, 0.99930448, 0.49322857],
-												 [	-6.27313622, -0.00043123, 0.00026419, 7.27270498, 0.99868268, 0.99930458, 0.49322862],
-												 [	-6.27313636, -0.00043117, 0.00026416, 7.27270519, 0.99868287, 0.99930467, 0.49322867],
-												 [	-6.27313650, -0.00043111, 0.00026412, 7.27270539, 0.99868305, 0.99930477, 0.49322876],
-												 [	-6.27313665, -0.00043105, 0.00026408, 7.27270560, 0.99868323, 0.99930487, 0.49322877],
-												 [	-6.27313679, -0.00043099, 0.00026405, 7.27270580, 0.99868342, 0.99930496, 0.49322873],
-												 [	-6.27313693, -0.00043093, 0.00026401, 7.27270600, 0.99868360, 0.99930506, 0.49322870],
-												 [	-6.27313708, -0.00043087, 0.00026397, 7.27270621, 0.99868378, 0.99930516, 0.49322877],
-												 [	-6.27313722, -0.00043081, 0.00026394, 7.27270641, 0.99868397, 0.99930525, 0.49322879],
-												 [	-6.27313737, -0.00043075, 0.00026390, 7.27270661, 0.99868415, 0.99930535, 0.49322891],
-												 [	-6.27313751, -0.00043069, 0.00026386, 7.27270682, 0.99868433, 0.99930545, 0.49322887],
-												 [	-6.27313765, -0.00043063, 0.00026382, 7.27270702, 0.99868452, 0.99930554, 0.49322881],
-												 [	-6.27313780, -0.00043057, 0.00026379, 7.27270722, 0.99868470, 0.99930564, 0.49322892],
-												 [	-6.27313794, -0.00043051, 0.00026375, 7.27270743, 0.99868488, 0.99930574, 0.49322891],
-												 [	-6.27313808, -0.00043045, 0.00026371, 7.27270763, 0.99868507, 0.99930583, 0.49322891],
-												 [	-6.27313823, -0.00043039, 0.00026368, 7.27270783, 0.99868525, 0.99930593, 0.49322893],
-												 [	-6.27313837, -0.00043033, 0.00026364, 7.27270804, 0.99868543, 0.99930603, 0.49322886],
-												 [	-6.27313851, -0.00043027, 0.00026360, 7.27270824, 0.99868561, 0.99930612, 0.49322902],
-												 [	-6.27313865, -0.00043021, 0.00026357, 7.27270844, 0.99868580, 0.99930622, 0.49322900],
-												 [	-6.27313880, -0.00043015, 0.00026353, 7.27270864, 0.99868598, 0.99930632, 0.49322904],
-												 [	-6.27313894, -0.00043009, 0.00026349, 7.27270885, 0.99868616, 0.99930641, 0.49322903],
-												 [	-6.27313908, -0.00043003, 0.00026346, 7.27270905, 0.99868634, 0.99930651, 0.49322900],
-												 [	-6.27313923, -0.00042997, 0.00026342, 7.27270925, 0.99868653, 0.99930660, 0.49322904],
-												 [	-6.27313937, -0.00042991, 0.00026338, 7.27270946, 0.99868671, 0.99930670, 0.49322912],
-												 [	-6.27313951, -0.00042985, 0.00026335, 7.27270966, 0.99868689, 0.99930680, 0.49322917],
-												 [	-6.27313966, -0.00042980, 0.00026331, 7.27270986, 0.99868707, 0.99930689, 0.49322903],
-												 [	-6.27313980, -0.00042974, 0.00026328, 7.27271006, 0.99868726, 0.99930699, 0.49322919],
-												 [	-6.27313994, -0.00042968, 0.00026324, 7.27271027, 0.99868744, 0.99930709, 0.49322915],
-												 [	-6.27314008, -0.00042962, 0.00026320, 7.27271047, 0.99868762, 0.99930718, 0.49322921],
-												 [	-6.27314023, -0.00042956, 0.00026317, 7.27271067, 0.99868780, 0.99930728, 0.49322918],
-												 [	-6.27314037, -0.00042950, 0.00026313, 7.27271087, 0.99868799, 0.99930737, 0.49322930],
-												 [	-6.27314051, -0.00042944, 0.00026309, 7.27271107, 0.99868817, 0.99930747, 0.49322927],
-												 [	-6.27314065, -0.00042938, 0.00026306, 7.27271128, 0.99868835, 0.99930757, 0.49322931],
-												 [	-6.27314080, -0.00042932, 0.00026302, 7.27271148, 0.99868853, 0.99930766, 0.49322934],
-												 [	-6.27314094, -0.00042926, 0.00026298, 7.27271168, 0.99868871, 0.99930776, 0.49322928],
-												 [	-6.27314108, -0.00042920, 0.00026295, 7.27271188, 0.99868890, 0.99930785, 0.49322942],
-												 [	-6.27314122, -0.00042914, 0.00026291, 7.27271208, 0.99868908, 0.99930795, 0.49322942],
-												 [	-6.27314137, -0.00042908, 0.00026287, 7.27271229, 0.99868926, 0.99930805, 0.49322944],
-												 [	-6.27314151, -0.00042902, 0.00026284, 7.27271249, 0.99868944, 0.99930814, 0.49322951],
-												 [	-6.27314165, -0.00042896, 0.00026280, 7.27271269, 0.99868962, 0.99930824, 0.49322944],
-												 [	-6.27314179, -0.00042890, 0.00026276, 7.27271289, 0.99868980, 0.99930833, 0.49322951],
-												 [	-6.27314194, -0.00042884, 0.00026273, 7.27271309, 0.99868999, 0.99930843, 0.49322954],
-												 [	-6.27314208, -0.00042878, 0.00026269, 7.27271329, 0.99869017, 0.99930853, 0.49322961],
-												 [	-6.27314222, -0.00042872, 0.00026265, 7.27271350, 0.99869035, 0.99930862, 0.49322958],
-												 [	-6.27314236, -0.00042866, 0.00026262, 7.27271370, 0.99869053, 0.99930872, 0.49322958],
-												 [	-6.27314250, -0.00042861, 0.00026258, 7.27271390, 0.99869071, 0.99930881, 0.49322960],
-												 [	-6.27314265, -0.00042855, 0.00026255, 7.27271410, 0.99869089, 0.99930891, 0.49322954],
-												 [	-6.27314279, -0.00042849, 0.00026251, 7.27271430, 0.99869107, 0.99930900, 0.49322960],
-												 [	-6.27314293, -0.00042843, 0.00026247, 7.27271450, 0.99869125, 0.99930910, 0.49322964],
-												 [	-6.27314307, -0.00042837, 0.00026244, 7.27271470, 0.99869144, 0.99930920, 0.49322967],
-												 [	-6.27314321, -0.00042831, 0.00026240, 7.27271491, 0.99869162, 0.99930929, 0.49322963],
-												 [	-6.27314336, -0.00042825, 0.00026236, 7.27271511, 0.99869180, 0.99930939, 0.49322972],
-												 [	-6.27314350, -0.00042819, 0.00026233, 7.27271531, 0.99869198, 0.99930948, 0.49322962],
-												 [	-6.27314364, -0.00042813, 0.00026229, 7.27271551, 0.99869216, 0.99930958, 0.49322977],
-												 [	-6.27314378, -0.00042807, 0.00026226, 7.27271571, 0.99869234, 0.99930967, 0.49322982],
-												 [	-6.27314392, -0.00042801, 0.00026222, 7.27271591, 0.99869252, 0.99930977, 0.49322974],
-												 [	-6.27314406, -0.00042795, 0.00026218, 7.27271611, 0.99869270, 0.99930986, 0.49322983],
-												 [	-6.27314421, -0.00042789, 0.00026215, 7.27271631, 0.99869288, 0.99930996, 0.49322981],
-												 [	-6.27314435, -0.00042783, 0.00026211, 7.27271651, 0.99869306, 0.99931005, 0.49322987],
-												 [	-6.27314449, -0.00042778, 0.00026207, 7.27271671, 0.99869325, 0.99931015, 0.49322991],
-												 [	-6.27314463, -0.00042772, 0.00026204, 7.27271691, 0.99869343, 0.99931025, 0.49322985],
-												 [	-6.27314477, -0.00042766, 0.00026200, 7.27271711, 0.99869361, 0.99931034, 0.49322989],
-												 [	-6.27314491, -0.00042760, 0.00026197, 7.27271731, 0.99869379, 0.99931044, 0.49322995],
-												 [	-6.27314505, -0.00042754, 0.00026193, 7.27271752, 0.99869397, 0.99931053, 0.49322998],
-												 [	-6.27314520, -0.00042748, 0.00026189, 7.27271772, 0.99869415, 0.99931063, 0.49322992],
-												 [	-6.27314534, -0.00042742, 0.00026186, 7.27271792, 0.99869433, 0.99931072, 0.49322999],
-												 [	-6.27314548, -0.00042736, 0.00026182, 7.27271812, 0.99869451, 0.99931082, 0.49323014],
-												 [	-6.27314562, -0.00042730, 0.00026178, 7.27271832, 0.99869469, 0.99931091, 0.49323001],
-												 [	-6.27314576, -0.00042724, 0.00026175, 7.27271852, 0.99869487, 0.99931101, 0.49323007],
-												 [	-6.27314590, -0.00042719, 0.00026171, 7.27271872, 0.99869505, 0.99931110, 0.49323010],
-												 [	-6.27314604, -0.00042713, 0.00026168, 7.27271892, 0.99869523, 0.99931120, 0.49323018],
-												 [	-6.27314618, -0.00042707, 0.00026164, 7.27271912, 0.99869541, 0.99931129, 0.49323018],
-												 [	-6.27314633, -0.00042701, 0.00026160, 7.27271932, 0.99869559, 0.99931139, 0.49323016],
-												 [	-6.27314647, -0.00042695, 0.00026157, 7.27271952, 0.99869577, 0.99931148, 0.49323007],
-												 [	-6.27314661, -0.00042689, 0.00026153, 7.27271972, 0.99869595, 0.99931158, 0.49323022],
-												 [	-6.27314675, -0.00042683, 0.00026150, 7.27271992, 0.99869613, 0.99931167, 0.49323025],
-												 [	-6.27314689, -0.00042677, 0.00026146, 7.27272012, 0.99869631, 0.99931177, 0.49323030],
-												 [	-6.27314703, -0.00042671, 0.00026142, 7.27272032, 0.99869649, 0.99931186, 0.49323027],
-												 [	-6.27314717, -0.00042666, 0.00026139, 7.27272051, 0.99869667, 0.99931196, 0.49323031],
-												 [	-6.27314731, -0.00042660, 0.00026135, 7.27272071, 0.99869685, 0.99931205, 0.49323029],
-												 [	-6.27314745, -0.00042654, 0.00026132, 7.27272091, 0.99869703, 0.99931215, 0.49323033],
-												 [	-6.27314759, -0.00042648, 0.00026128, 7.27272111, 0.99869721, 0.99931224, 0.49323043],
-												 [	-6.27314773, -0.00042642, 0.00026124, 7.27272131, 0.99869739, 0.99931234, 0.49323035],
-												 [	-6.27314787, -0.00042636, 0.00026121, 7.27272151, 0.99869757, 0.99931243, 0.49323032],
-												 [	-6.27314801, -0.00042630, 0.00026117, 7.27272171, 0.99869775, 0.99931253, 0.49323043],
-												 [	-6.27314815, -0.00042624, 0.00026114, 7.27272191, 0.99869792, 0.99931262, 0.49323038],
-												 [	-6.27314830, -0.00042619, 0.00026110, 7.27272211, 0.99869810, 0.99931272, 0.49323055],
-												 [	-6.27314844, -0.00042613, 0.00026106, 7.27272231, 0.99869828, 0.99931281, 0.49323047],
-												 [	-6.27314858, -0.00042607, 0.00026103, 7.27272251, 0.99869846, 0.99931290, 0.49323039],
-												 [	-6.27314872, -0.00042601, 0.00026099, 7.27272271, 0.99869864, 0.99931300, 0.49323039],
-												 [	-6.27314886, -0.00042595, 0.00026096, 7.27272291, 0.99869882, 0.99931309, 0.49323057],
-												 [	-6.27314900, -0.00042589, 0.00026092, 7.27272310, 0.99869900, 0.99931319, 0.49323051],
-												 [	-6.27314914, -0.00042583, 0.00026088, 7.27272330, 0.99869918, 0.99931328, 0.49323056],
-												 [	-6.27314928, -0.00042578, 0.00026085, 7.27272350, 0.99869936, 0.99931338, 0.49323064],
-												 [	-6.27314942, -0.00042572, 0.00026081, 7.27272370, 0.99869954, 0.99931347, 0.49323065],
-												 [	-6.27314956, -0.00042566, 0.00026078, 7.27272390, 0.99869972, 0.99931357, 0.49323065],
-												 [	-6.27314970, -0.00042560, 0.00026074, 7.27272410, 0.99869989, 0.99931366, 0.49323070],
-												 [	-6.27314984, -0.00042554, 0.00026070, 7.27272430, 0.99870007, 0.99931375, 0.49323062],
-												 [	-6.27314998, -0.00042548, 0.00026067, 7.27272450, 0.99870025, 0.99931385, 0.49323063],
-												 [	-6.27315012, -0.00042542, 0.00026063, 7.27272469, 0.99870043, 0.99931394, 0.49323075],
-												 [	-6.27315026, -0.00042537, 0.00026060, 7.27272489, 0.99870061, 0.99931404, 0.49323074],
-												 [	-6.27315040, -0.00042531, 0.00026056, 7.27272509, 0.99870079, 0.99931413, 0.49323081],
-												 [	-6.27315054, -0.00042525, 0.00026052, 7.27272529, 0.99870097, 0.99931423, 0.49323082],
-												 [	-6.27315068, -0.00042519, 0.00026049, 7.27272549, 0.99870115, 0.99931432, 0.49323079],
-												 [	-6.27315082, -0.00042513, 0.00026045, 7.27272569, 0.99870132, 0.99931441, 0.49323072],
-												 [	-6.27315096, -0.00042507, 0.00026042, 7.27272588, 0.99870150, 0.99931451, 0.49323088],
-												 [	-6.27315110, -0.00042502, 0.00026038, 7.27272608, 0.99870168, 0.99931460, 0.49323096],
-												 [	-6.27315124, -0.00042496, 0.00026035, 7.27272628, 0.99870186, 0.99931470, 0.49323088],
-												 [	-6.27315138, -0.00042490, 0.00026031, 7.27272648, 0.99870204, 0.99931479, 0.49323085],
-												 [	-6.27315152, -0.00042484, 0.00026027, 7.27272668, 0.99870222, 0.99931489, 0.49323089],
-												 [	-6.27315165, -0.00042478, 0.00026024, 7.27272687, 0.99870239, 0.99931498, 0.49323085],
-												 [	-6.27315179, -0.00042472, 0.00026020, 7.27272707, 0.99870257, 0.99931507, 0.49323101],
-												 [	-6.27315193, -0.00042467, 0.00026017, 7.27272727, 0.99870275, 0.99931517, 0.49323094],
-												 [	-6.27315207, -0.00042461, 0.00026013, 7.27272747, 0.99870293, 0.99931526, 0.49323104],
-												 [	-6.27315221, -0.00042455, 0.00026010, 7.27272766, 0.99870311, 0.99931535, 0.49323100],
-												 [	-6.27315235, -0.00042449, 0.00026006, 7.27272786, 0.99870328, 0.99931545, 0.49323105],
-												 [	-6.27315249, -0.00042443, 0.00026002, 7.27272806, 0.99870346, 0.99931554, 0.49323112],
-												 [	-6.27315263, -0.00042437, 0.00025999, 7.27272826, 0.99870364, 0.99931564, 0.49323100],
-												 [	-6.27315277, -0.00042432, 0.00025995, 7.27272845, 0.99870382, 0.99931573, 0.49323104],
-												 [	-6.27315291, -0.00042426, 0.00025992, 7.27272865, 0.99870399, 0.99931582, 0.49323113],
-												 [	-6.27315305, -0.00042420, 0.00025988, 7.27272885, 0.99870417, 0.99931592, 0.49323100],
-												 [	-6.27315319, -0.00042414, 0.00025985, 7.27272905, 0.99870435, 0.99931601, 0.49323118],
-												 [	-6.27315333, -0.00042408, 0.00025981, 7.27272924, 0.99870453, 0.99931611, 0.49323122],
-												 [	-6.27315347, -0.00042403, 0.00025978, 7.27272944, 0.99870470, 0.99931620, 0.49323123],
-												 [	-6.27315360, -0.00042397, 0.00025974, 7.27272964, 0.99870488, 0.99931629, 0.49323124],
-												 [	-6.27315374, -0.00042391, 0.00025970, 7.27272983, 0.99870506, 0.99931639, 0.49323127],
-												 [	-6.27315388, -0.00042385, 0.00025967, 7.27273003, 0.99870524, 0.99931648, 0.49323133],
-												 [	-6.27315402, -0.00042379, 0.00025963, 7.27273023, 0.99870541, 0.99931657, 0.49323140],
-												 [	-6.27315416, -0.00042374, 0.00025960, 7.27273042, 0.99870559, 0.99931667, 0.49323133],
-												 [	-6.27315430, -0.00042368, 0.00025956, 7.27273062, 0.99870577, 0.99931676, 0.49323138],
-												 [	-6.27315444, -0.00042362, 0.00025953, 7.27273082, 0.99870595, 0.99931685, 0.49323140],
-												 [	-6.27315458, -0.00042356, 0.00025949, 7.27273101, 0.99870612, 0.99931695, 0.49323145],
-												 [	-6.27315472, -0.00042350, 0.00025946, 7.27273121, 0.99870630, 0.99931704, 0.49323139],
-												 [	-6.27315485, -0.00042345, 0.00025942, 7.27273141, 0.99870648, 0.99931713, 0.49323136],
-												 [	-6.27315499, -0.00042339, 0.00025938, 7.27273160, 0.99870665, 0.99931723, 0.49323144],
-												 [	-6.27315513, -0.00042333, 0.00025935, 7.27273180, 0.99870683, 0.99931732, 0.49323141],
-												 [	-6.27315527, -0.00042327, 0.00025931, 7.27273200, 0.99870701, 0.99931741, 0.49323140],
-												 [	-6.27315541, -0.00042321, 0.00025928, 7.27273219, 0.99870719, 0.99931751, 0.49323155],
-												 [	-6.27315555, -0.00042316, 0.00025924, 7.27273239, 0.99870736, 0.99931760, 0.49323157],
-												 [	-6.27315569, -0.00042310, 0.00025921, 7.27273259, 0.99870754, 0.99931769, 0.49323161],
-												 [	-6.27315582, -0.00042304, 0.00025917, 7.27273278, 0.99870772, 0.99931779, 0.49323157],
-												 [	-6.27315596, -0.00042298, 0.00025914, 7.27273298, 0.99870789, 0.99931788, 0.49323162],
-												 [	-6.27315610, -0.00042292, 0.00025910, 7.27273318, 0.99870807, 0.99931797, 0.49323164],
-												 [	-6.27315624, -0.00042287, 0.00025907, 7.27273337, 0.99870825, 0.99931807, 0.49323172],
-												 [	-6.27315638, -0.00042281, 0.00025903, 7.27273357, 0.99870842, 0.99931816, 0.49323163],
-												 [	-6.27315652, -0.00042275, 0.00025899, 7.27273376, 0.99870860, 0.99931825, 0.49323158],
-												 [	-6.27315665, -0.00042269, 0.00025896, 7.27273396, 0.99870877, 0.99931835, 0.49323168],
-												 [	-6.27315679, -0.00042264, 0.00025892, 7.27273416, 0.99870895, 0.99931844, 0.49323175],
-												 [	-6.27315693, -0.00042258, 0.00025889, 7.27273435, 0.99870913, 0.99931853, 0.49323172],
-												 [	-6.27315707, -0.00042252, 0.00025885, 7.27273455, 0.99870930, 0.99931863, 0.49323175],
-												 [	-6.27315721, -0.00042246, 0.00025882, 7.27273474, 0.99870948, 0.99931872, 0.49323179],
-												 [	-6.27315734, -0.00042241, 0.00025878, 7.27273494, 0.99870966, 0.99931881, 0.49323178],
-												 [	-6.27315748, -0.00042235, 0.00025875, 7.27273513, 0.99870983, 0.99931891, 0.49323183],
-												 [	-6.27315762, -0.00042229, 0.00025871, 7.27273533, 0.99871001, 0.99931900, 0.49323180],
-												 [	-6.27315776, -0.00042223, 0.00025868, 7.27273552, 0.99871018, 0.99931909, 0.49323181],
-												 [	-6.27315790, -0.00042218, 0.00025864, 7.27273572, 0.99871036, 0.99931918, 0.49323188],
-												 [	-6.27315803, -0.00042212, 0.00025861, 7.27273592, 0.99871054, 0.99931928, 0.49323197],
-												 [	-6.27315817, -0.00042206, 0.00025857, 7.27273611, 0.99871071, 0.99931937, 0.49323190],
-												 [	-6.27315831, -0.00042200, 0.00025854, 7.27273631, 0.99871089, 0.99931946, 0.49323185],
-												 [	-6.27315845, -0.00042194, 0.00025850, 7.27273650, 0.99871106, 0.99931956, 0.49323199],
-												 [	-6.27315858, -0.00042189, 0.00025846, 7.27273670, 0.99871124, 0.99931965, 0.49323204],
-												 [	-6.27315872, -0.00042183, 0.00025843, 7.27273689, 0.99871141, 0.99931974, 0.49323191],
-												 [	-6.27315886, -0.00042177, 0.00025839, 7.27273709, 0.99871159, 0.99931983, 0.49323202],
-												 [	-6.27315900, -0.00042171, 0.00025836, 7.27273728, 0.99871177, 0.99931993, 0.49323199],
-												 [	-6.27315913, -0.00042166, 0.00025832, 7.27273748, 0.99871194, 0.99932002, 0.49323200],
-												 [	-6.27315927, -0.00042160, 0.00025829, 7.27273767, 0.99871212, 0.99932011, 0.49323212],
-												 [	-6.27315941, -0.00042154, 0.00025825, 7.27273787, 0.99871229, 0.99932020, 0.49323215],
-												 [	-6.27315955, -0.00042149, 0.00025822, 7.27273806, 0.99871247, 0.99932030, 0.49323211],
-												 [	-6.27315968, -0.00042143, 0.00025818, 7.27273826, 0.99871264, 0.99932039, 0.49323217],
-												 [	-6.27315982, -0.00042137, 0.00025815, 7.27273845, 0.99871282, 0.99932048, 0.49323219],
-												 [	-6.27315996, -0.00042131, 0.00025811, 7.27273864, 0.99871299, 0.99932057, 0.49323223],
-												 [	-6.27316010, -0.00042126, 0.00025808, 7.27273884, 0.99871317, 0.99932067, 0.49323224],
-												 [	-6.27316023, -0.00042120, 0.00025804, 7.27273903, 0.99871334, 0.99932076, 0.49323221],
-												 [	-6.27316037, -0.00042114, 0.00025801, 7.27273923, 0.99871352, 0.99932085, 0.49323224],
-												 [	-6.27316051, -0.00042108, 0.00025797, 7.27273942, 0.99871369, 0.99932094, 0.49323220],
-												 [	-6.27316064, -0.00042103, 0.00025794, 7.27273962, 0.99871387, 0.99932104, 0.49323229],
-												 [	-6.27316078, -0.00042097, 0.00025790, 7.27273981, 0.99871404, 0.99932113, 0.49323228],
-												 [	-6.27316092, -0.00042091, 0.00025787, 7.27274001, 0.99871422, 0.99932122, 0.49323228],
-												 [	-6.27316105, -0.00042085, 0.00025783, 7.27274020, 0.99871439, 0.99932131, 0.49323234],
-												 [	-6.27316119, -0.00042080, 0.00025780, 7.27274039, 0.99871457, 0.99932141, 0.49323243],
-												 [	-6.27316133, -0.00042074, 0.00025776, 7.27274059, 0.99871474, 0.99932150, 0.49323241],
-												 [	-6.27316147, -0.00042068, 0.00025773, 7.27274078, 0.99871492, 0.99932159, 0.49323242],
-												 [	-6.27316160, -0.00042063, 0.00025769, 7.27274098, 0.99871509, 0.99932168, 0.49323234],
-												 [	-6.27316174, -0.00042057, 0.00025766, 7.27274117, 0.99871527, 0.99932177, 0.49323243],
-												 [	-6.27316188, -0.00042051, 0.00025762, 7.27274136, 0.99871544, 0.99932187, 0.49323249],
-												 [	-6.27316201, -0.00042045, 0.00025759, 7.27274156, 0.99871562, 0.99932196, 0.49323249],
-												 [	-6.27316215, -0.00042040, 0.00025755, 7.27274175, 0.99871579, 0.99932205, 0.49323255],
-												 [	-6.27316229, -0.00042034, 0.00025752, 7.27274195, 0.99871597, 0.99932214, 0.49323261],
-												 [	-6.27316242, -0.00042028, 0.00025748, 7.27274214, 0.99871614, 0.99932223, 0.49323266],
-												 [	-6.27316256, -0.00042023, 0.00025745, 7.27274233, 0.99871631, 0.99932233, 0.49323261],
-												 [	-6.27316270, -0.00042017, 0.00025741, 7.27274253, 0.99871649, 0.99932242, 0.49323265],
-												 [	-6.27316283, -0.00042011, 0.00025738, 7.27274272, 0.99871666, 0.99932251, 0.49323261],
-												 [	-6.27316297, -0.00042006, 0.00025734, 7.27274291, 0.99871684, 0.99932260, 0.49323268],
-												 [	-6.27316311, -0.00042000, 0.00025731, 7.27274311, 0.99871701, 0.99932269, 0.49323261],
-												 [	-6.27316324, -0.00041994, 0.00025727, 7.27274330, 0.99871719, 0.99932279, 0.49323277],
-												 [	-6.27316338, -0.00041988, 0.00025724, 7.27274349, 0.99871736, 0.99932288, 0.49323278],
-												 [	-6.27316351, -0.00041983, 0.00025720, 7.27274369, 0.99871753, 0.99932297, 0.49323270],
-												 [	-6.27316365, -0.00041977, 0.00025717, 7.27274388, 0.99871771, 0.99932306, 0.49323262],
-												 [	-6.27316379, -0.00041971, 0.00025713, 7.27274407, 0.99871788, 0.99932315, 0.49323267],
-												 [	-6.27316392, -0.00041966, 0.00025710, 7.27274427, 0.99871806, 0.99932325, 0.49323282],
-												 [	-6.27316406, -0.00041960, 0.00025706, 7.27274446, 0.99871823, 0.99932334, 0.49323274],
-												 [	-6.27316420, -0.00041954, 0.00025703, 7.27274465, 0.99871840, 0.99932343, 0.49323276],
-												 [	-6.27316433, -0.00041949, 0.00025699, 7.27274485, 0.99871858, 0.99932352, 0.49323279],
-												 [	-6.27316447, -0.00041943, 0.00025696, 7.27274504, 0.99871875, 0.99932361, 0.49323285],
-												 [	-6.27316460, -0.00041937, 0.00025692, 7.27274523, 0.99871892, 0.99932370, 0.49323286],
-												 [	-6.27316474, -0.00041932, 0.00025689, 7.27274542, 0.99871910, 0.99932380, 0.49323296],
-												 [	-6.27316488, -0.00041926, 0.00025685, 7.27274562, 0.99871927, 0.99932389, 0.49323294],
-												 [	-6.27316501, -0.00041920, 0.00025682, 7.27274581, 0.99871944, 0.99932398, 0.49323292],
-												 [	-6.27316515, -0.00041915, 0.00025678, 7.27274600, 0.99871962, 0.99932407, 0.49323285],
-												 [	-6.27316528, -0.00041909, 0.00025675, 7.27274619, 0.99871979, 0.99932416, 0.49323292],
-												 [	-6.27316542, -0.00041903, 0.00025671, 7.27274639, 0.99871996, 0.99932425, 0.49323303],
-												 [	-6.27316555, -0.00041898, 0.00025668, 7.27274658, 0.99872014, 0.99932435, 0.49323312],
-												 [	-6.27316569, -0.00041892, 0.00025664, 7.27274677, 0.99872031, 0.99932444, 0.49323326],
-												 [	-6.27316583, -0.00041886, 0.00025661, 7.27274696, 0.99872048, 0.99932453, 0.49323308],
-												 [	-6.27316596, -0.00041881, 0.00025658, 7.27274716, 0.99872066, 0.99932462, 0.49323307],
-												 [	-6.27316610, -0.00041875, 0.00025654, 7.27274735, 0.99872083, 0.99932471, 0.49323314],
-												 [	-6.27316623, -0.00041869, 0.00025651, 7.27274754, 0.99872100, 0.99932480, 0.49323312],
-												 [	-6.27316637, -0.00041864, 0.00025647, 7.27274773, 0.99872118, 0.99932489, 0.49323320],
-												 [	-6.27316650, -0.00041858, 0.00025644, 7.27274793, 0.99872135, 0.99932498, 0.49323311],
-												 [	-6.27316664, -0.00041852, 0.00025640, 7.27274812, 0.99872152, 0.99932508, 0.49323311],
-												 [	-6.27316677, -0.00041847, 0.00025637, 7.27274831, 0.99872170, 0.99932517, 0.49323317],
-												 [	-6.27316691, -0.00041841, 0.00025633, 7.27274850, 0.99872187, 0.99932526, 0.49323323],
-												 [	-6.27316705, -0.00041835, 0.00025630, 7.27274869, 0.99872204, 0.99932535, 0.49323325],
-												 [	-6.27316718, -0.00041830, 0.00025626, 7.27274888, 0.99872221, 0.99932544, 0.49323334],
-												 [	-6.27316732, -0.00041824, 0.00025623, 7.27274908, 0.99872239, 0.99932553, 0.49323332],
-												 [	-6.27316745, -0.00041818, 0.00025619, 7.27274927, 0.99872256, 0.99932562, 0.49323331],
-												 [	-6.27316759, -0.00041813, 0.00025616, 7.27274946, 0.99872273, 0.99932571, 0.49323331],
-												 [	-6.27316772, -0.00041807, 0.00025612, 7.27274965, 0.99872290, 0.99932581, 0.49323346],
-												 [	-6.27316786, -0.00041801, 0.00025609, 7.27274984, 0.99872308, 0.99932590, 0.49323331],
-												 [	-6.27316799, -0.00041796, 0.00025606, 7.27275003, 0.99872325, 0.99932599, 0.49323339],
-												 [	-6.27316813, -0.00041790, 0.00025602, 7.27275023, 0.99872342, 0.99932608, 0.49323343],
-												 [	-6.27316826, -0.00041784, 0.00025599, 7.27275042, 0.99872359, 0.99932617, 0.49323337],
-												 [	-6.27316840, -0.00041779, 0.00025595, 7.27275061, 0.99872377, 0.99932626, 0.49323342],
-												 [	-6.27316853, -0.00041773, 0.00025592, 7.27275080, 0.99872394, 0.99932635, 0.49323347],
-												 [	-6.27316867, -0.00041768, 0.00025588, 7.27275099, 0.99872411, 0.99932644, 0.49323353],
-												 [	-6.27316880, -0.00041762, 0.00025585, 7.27275118, 0.99872428, 0.99932653, 0.49323349],
-												 [	-6.27316894, -0.00041756, 0.00025581, 7.27275137, 0.99872446, 0.99932662, 0.49323358],
-												 [	-6.27316907, -0.00041751, 0.00025578, 7.27275157, 0.99872463, 0.99932671, 0.49323354],
-												 [	-6.27316921, -0.00041745, 0.00025574, 7.27275176, 0.99872480, 0.99932681, 0.49323350],
-												 [	-6.27316934, -0.00041739, 0.00025571, 7.27275195, 0.99872497, 0.99932690, 0.49323356],
-												 [	-6.27316948, -0.00041734, 0.00025568, 7.27275214, 0.99872514, 0.99932699, 0.49323355],
-												 [	-6.27316961, -0.00041728, 0.00025564, 7.27275233, 0.99872532, 0.99932708, 0.49323359],
-												 [	-6.27316974, -0.00041722, 0.00025561, 7.27275252, 0.99872549, 0.99932717, 0.49323360],
-												 [	-6.27316988, -0.00041717, 0.00025557, 7.27275271, 0.99872566, 0.99932726, 0.49323362],
-												 [	-6.27317001, -0.00041711, 0.00025554, 7.27275290, 0.99872583, 0.99932735, 0.49323369],
-												 [	-6.27317015, -0.00041706, 0.00025550, 7.27275309, 0.99872600, 0.99932744, 0.49323369],
-												 [	-6.27317028, -0.00041700, 0.00025547, 7.27275328, 0.99872617, 0.99932753, 0.49323368],
-												 [	-6.27317042, -0.00041694, 0.00025543, 7.27275347, 0.99872635, 0.99932762, 0.49323375],
-												 [	-6.27317055, -0.00041689, 0.00025540, 7.27275366, 0.99872652, 0.99932771, 0.49323378],
-												 [	-6.27317069, -0.00041683, 0.00025537, 7.27275385, 0.99872669, 0.99932780, 0.49323373],
-												 [	-6.27317082, -0.00041678, 0.00025533, 7.27275405, 0.99872686, 0.99932789, 0.49323370],
-												 [	-6.27317095, -0.00041672, 0.00025530, 7.27275424, 0.99872703, 0.99932798, 0.49323379],
-												 [	-6.27317109, -0.00041666, 0.00025526, 7.27275443, 0.99872720, 0.99932807, 0.49323375],
-												 [	-6.27317122, -0.00041661, 0.00025523, 7.27275462, 0.99872738, 0.99932816, 0.49323392],
-												 [	-6.27317136, -0.00041655, 0.00025519, 7.27275481, 0.99872755, 0.99932826, 0.49323391],
-												 [	-6.27317149, -0.00041649, 0.00025516, 7.27275500, 0.99872772, 0.99932835, 0.49323391],
-												 [	-6.27317163, -0.00041644, 0.00025512, 7.27275519, 0.99872789, 0.99932844, 0.49323388],
-												 [	-6.27317176, -0.00041638, 0.00025509, 7.27275538, 0.99872806, 0.99932853, 0.49323395],
-												 [	-6.27317189, -0.00041633, 0.00025506, 7.27275557, 0.99872823, 0.99932862, 0.49323385],
-												 [	-6.27317203, -0.00041627, 0.00025502, 7.27275576, 0.99872840, 0.99932871, 0.49323392],
-												 [	-6.27317216, -0.00041621, 0.00025499, 7.27275595, 0.99872857, 0.99932880, 0.49323402],
-												 [	-6.27317230, -0.00041616, 0.00025495, 7.27275614, 0.99872874, 0.99932889, 0.49323405],
-												 [	-6.27317243, -0.00041610, 0.00025492, 7.27275633, 0.99872892, 0.99932898, 0.49323405],
-												 [	-6.27317256, -0.00041605, 0.00025488, 7.27275652, 0.99872909, 0.99932907, 0.49323408],
-												 [	-6.27317270, -0.00041599, 0.00025485, 7.27275671, 0.99872926, 0.99932916, 0.49323410],
-												 [	-6.27317283, -0.00041594, 0.00025482, 7.27275690, 0.99872943, 0.99932925, 0.49323410],
-												 [	-6.27317297, -0.00041588, 0.00025478, 7.27275709, 0.99872960, 0.99932934, 0.49323416],
-												 [	-6.27317310, -0.00041582, 0.00025475, 7.27275728, 0.99872977, 0.99932943, 0.49323413],
-												 [	-6.27317323, -0.00041577, 0.00025471, 7.27275746, 0.99872994, 0.99932952, 0.49323409],
-												 [	-6.27317337, -0.00041571, 0.00025468, 7.27275765, 0.99873011, 0.99932961, 0.49323425],
-												 [	-6.27317350, -0.00041566, 0.00025465, 7.27275784, 0.99873028, 0.99932970, 0.49323426],
-												 [	-6.27317363, -0.00041560, 0.00025461, 7.27275803, 0.99873045, 0.99932979, 0.49323421],
-												 [	-6.27317377, -0.00041554, 0.00025458, 7.27275822, 0.99873062, 0.99932988, 0.49323430],
-												 [	-6.27317390, -0.00041549, 0.00025454, 7.27275841, 0.99873079, 0.99932997, 0.49323422],
-												 [	-6.27317403, -0.00041543, 0.00025451, 7.27275860, 0.99873096, 0.99933006, 0.49323429],
-												 [	-6.27317417, -0.00041538, 0.00025447, 7.27275879, 0.99873113, 0.99933015, 0.49323420],
-												 [	-6.27317430, -0.00041532, 0.00025444, 7.27275898, 0.99873130, 0.99933024, 0.49323427],
-												 [	-6.27317443, -0.00041527, 0.00025441, 7.27275917, 0.99873147, 0.99933033, 0.49323431],
-												 [	-6.27317457, -0.00041521, 0.00025437, 7.27275936, 0.99873164, 0.99933042, 0.49323443],
-												 [	-6.27317470, -0.00041515, 0.00025434, 7.27275955, 0.99873181, 0.99933051, 0.49323428],
-												 [	-6.27317483, -0.00041510, 0.00025430, 7.27275974, 0.99873198, 0.99933060, 0.49323443],
-												 [	-6.27317497, -0.00041504, 0.00025427, 7.27275992, 0.99873215, 0.99933069, 0.49323437],
-												 [	-6.27317510, -0.00041499, 0.00025424, 7.27276011, 0.99873232, 0.99933078, 0.49323454],
-												 [	-6.27317523, -0.00041493, 0.00025420, 7.27276030, 0.99873249, 0.99933087, 0.49323446],
-												 [	-6.27317537, -0.00041488, 0.00025417, 7.27276049, 0.99873266, 0.99933096, 0.49323436],
-												 [	-6.27317550, -0.00041482, 0.00025413, 7.27276068, 0.99873283, 0.99933105, 0.49323455],
-												 [	-6.27317563, -0.00041476, 0.00025410, 7.27276087, 0.99873300, 0.99933114, 0.49323443],
-												 [	-6.27317577, -0.00041471, 0.00025406, 7.27276106, 0.99873317, 0.99933123, 0.49323444],
-												 [	-6.27317590, -0.00041465, 0.00025403, 7.27276124, 0.99873334, 0.99933132, 0.49323452],
-												 [	-6.27317603, -0.00041460, 0.00025400, 7.27276143, 0.99873351, 0.99933140, 0.49323465],
-												 [	-6.27317616, -0.00041454, 0.00025396, 7.27276162, 0.99873368, 0.99933149, 0.49323452],
-												 [	-6.27317630, -0.00041449, 0.00025393, 7.27276181, 0.99873385, 0.99933158, 0.49323459],
-												 [	-6.27317643, -0.00041443, 0.00025389, 7.27276200, 0.99873402, 0.99933167, 0.49323462],
-												 [	-6.27317656, -0.00041438, 0.00025386, 7.27276219, 0.99873419, 0.99933176, 0.49323457],
-												 [	-6.27317670, -0.00041432, 0.00025383, 7.27276237, 0.99873436, 0.99933185, 0.49323468],
-												 [	-6.27317683, -0.00041427, 0.00025379, 7.27276256, 0.99873453, 0.99933194, 0.49323479],
-												 [	-6.27317696, -0.00041421, 0.00025376, 7.27276275, 0.99873470, 0.99933203, 0.49323481],
-												 [	-6.27317709, -0.00041415, 0.00025372, 7.27276294, 0.99873487, 0.99933212, 0.49323465],
-												 [	-6.27317723, -0.00041410, 0.00025369, 7.27276313, 0.99873504, 0.99933221, 0.49323467],
-												 [	-6.27317736, -0.00041404, 0.00025366, 7.27276332, 0.99873521, 0.99933230, 0.49323474],
-												 [	-6.27317749, -0.00041399, 0.00025362, 7.27276350, 0.99873538, 0.99933239, 0.49323475],
-												 [	-6.27317762, -0.00041393, 0.00025359, 7.27276369, 0.99873555, 0.99933248, 0.49323489],
-												 [	-6.27317776, -0.00041388, 0.00025355, 7.27276388, 0.99873572, 0.99933257, 0.49323478],
-												 [	-6.27317789, -0.00041382, 0.00025352, 7.27276407, 0.99873588, 0.99933266, 0.49323490],
-												 [	-6.27317802, -0.00041377, 0.00025349, 7.27276425, 0.99873605, 0.99933275, 0.49323500],
-												 [	-6.27317815, -0.00041371, 0.00025345, 7.27276444, 0.99873622, 0.99933283, 0.49323486],
-												 [	-6.27317829, -0.00041366, 0.00025342, 7.27276463, 0.99873639, 0.99933292, 0.49323491],
-												 [	-6.27317842, -0.00041360, 0.00025339, 7.27276482, 0.99873656, 0.99933301, 0.49323473],
-												 [	-6.27317855, -0.00041355, 0.00025335, 7.27276500, 0.99873673, 0.99933310, 0.49323495],
-												 [	-6.27317868, -0.00041349, 0.00025332, 7.27276519, 0.99873690, 0.99933319, 0.49323495],
-												 [	-6.27317882, -0.00041344, 0.00025328, 7.27276538, 0.99873707, 0.99933328, 0.49323487],
-												 [	-6.27317895, -0.00041338, 0.00025325, 7.27276557, 0.99873724, 0.99933337, 0.49323500],
-												 [	-6.27317908, -0.00041333, 0.00025322, 7.27276575, 0.99873740, 0.99933346, 0.49323493],
-												 [	-6.27317921, -0.00041327, 0.00025318, 7.27276594, 0.99873757, 0.99933355, 0.49323497],
-												 [	-6.27317934, -0.00041321, 0.00025315, 7.27276613, 0.99873774, 0.99933364, 0.49323507],
-												 [	-6.27317948, -0.00041316, 0.00025311, 7.27276632, 0.99873791, 0.99933373, 0.49323512],
-												 [	-6.27317961, -0.00041310, 0.00025308, 7.27276650, 0.99873808, 0.99933381, 0.49323500],
-												 [	-6.27317974, -0.00041305, 0.00025305, 7.27276669, 0.99873825, 0.99933390, 0.49323510],
-												 [	-6.27317987, -0.00041299, 0.00025301, 7.27276688, 0.99873842, 0.99933399, 0.49323520],
-												 [	-6.27318000, -0.00041294, 0.00025298, 7.27276706, 0.99873858, 0.99933408, 0.49323515],
-												 [	-6.27318014, -0.00041288, 0.00025295, 7.27276725, 0.99873875, 0.99933417, 0.49323523],
-												 [	-6.27318027, -0.00041283, 0.00025291, 7.27276744, 0.99873892, 0.99933426, 0.49323516],
-												 [	-6.27318040, -0.00041277, 0.00025288, 7.27276762, 0.99873909, 0.99933435, 0.49323517],
-												 [	-6.27318053, -0.00041272, 0.00025284, 7.27276781, 0.99873926, 0.99933444, 0.49323519],
-												 [	-6.27318066, -0.00041266, 0.00025281, 7.27276800, 0.99873942, 0.99933453, 0.49323515],
-												 [	-6.27318079, -0.00041261, 0.00025278, 7.27276818, 0.99873959, 0.99933461, 0.49323538],
-												 [	-6.27318093, -0.00041255, 0.00025274, 7.27276837, 0.99873976, 0.99933470, 0.49323529],
-												 [	-6.27318106, -0.00041250, 0.00025271, 7.27276856, 0.99873993, 0.99933479, 0.49323537],
-												 [	-6.27318119, -0.00041244, 0.00025268, 7.27276874, 0.99874010, 0.99933488, 0.49323534],
-												 [	-6.27318132, -0.00041239, 0.00025264, 7.27276893, 0.99874026, 0.99933497, 0.49323537],
-												 [	-6.27318145, -0.00041233, 0.00025261, 7.27276912, 0.99874043, 0.99933506, 0.49323540],
-												 [	-6.27318158, -0.00041228, 0.00025258, 7.27276930, 0.99874060, 0.99933515, 0.49323539],
-												 [	-6.27318171, -0.00041222, 0.00025254, 7.27276949, 0.99874077, 0.99933523, 0.49323536],
-												 [	-6.27318185, -0.00041217, 0.00025251, 7.27276968, 0.99874094, 0.99933532, 0.49323541],
-												 [	-6.27318198, -0.00041211, 0.00025247, 7.27276986, 0.99874110, 0.99933541, 0.49323529],
-												 [	-6.27318211, -0.00041206, 0.00025244, 7.27277005, 0.99874127, 0.99933550, 0.49323554],
-												 [	-6.27318224, -0.00041200, 0.00025241, 7.27277023, 0.99874144, 0.99933559, 0.49323556],
-												 [	-6.27318237, -0.00041195, 0.00025237, 7.27277042, 0.99874161, 0.99933568, 0.49323548],
-												 [	-6.27318250, -0.00041190, 0.00025234, 7.27277061, 0.99874177, 0.99933577, 0.49323555],
-												 [	-6.27318263, -0.00041184, 0.00025231, 7.27277079, 0.99874194, 0.99933585, 0.49323555],
-												 [	-6.27318276, -0.00041179, 0.00025227, 7.27277098, 0.99874211, 0.99933594, 0.49323566],
-												 [	-6.27318290, -0.00041173, 0.00025224, 7.27277117, 0.99874228, 0.99933603, 0.49323552],
-												 [	-6.27318303, -0.00041168, 0.00025221, 7.27277135, 0.99874244, 0.99933612, 0.49323561],
-												 [	-6.27318316, -0.00041162, 0.00025217, 7.27277154, 0.99874261, 0.99933621, 0.49323566],
-												 [	-6.27318329, -0.00041157, 0.00025214, 7.27277172, 0.99874278, 0.99933630, 0.49323555],
-												 [	-6.27318342, -0.00041151, 0.00025210, 7.27277191, 0.99874294, 0.99933638, 0.49323560],
-												 [	-6.27318355, -0.00041146, 0.00025207, 7.27277209, 0.99874311, 0.99933647, 0.49323570],
-												 [	-6.27318368, -0.00041140, 0.00025204, 7.27277228, 0.99874328, 0.99933656, 0.49323566],
-												 [	-6.27318381, -0.00041135, 0.00025200, 7.27277246, 0.99874345, 0.99933665, 0.49323580],
-												 [	-6.27318394, -0.00041129, 0.00025197, 7.27277265, 0.99874361, 0.99933674, 0.49323573],
-												 [	-6.27318407, -0.00041124, 0.00025194, 7.27277284, 0.99874378, 0.99933682, 0.49323588],
-												 [	-6.27318420, -0.00041118, 0.00025190, 7.27277302, 0.99874395, 0.99933691, 0.49323574],
-												 [	-6.27318434, -0.00041113, 0.00025187, 7.27277321, 0.99874411, 0.99933700, 0.49323584],
-												 [	-6.27318447, -0.00041107, 0.00025184, 7.27277339, 0.99874428, 0.99933709, 0.49323574],
-												 [	-6.27318460, -0.00041102, 0.00025180, 7.27277358, 0.99874445, 0.99933718, 0.49323586],
-												 [	-6.27318473, -0.00041097, 0.00025177, 7.27277376, 0.99874461, 0.99933726, 0.49323593],
-												 [	-6.27318486, -0.00041091, 0.00025174, 7.27277395, 0.99874478, 0.99933735, 0.49323592],
-												 [	-6.27318499, -0.00041086, 0.00025170, 7.27277413, 0.99874495, 0.99933744, 0.49323598],
-												 [	-6.27318512, -0.00041080, 0.00025167, 7.27277432, 0.99874511, 0.99933753, 0.49323589],
-												 [	-6.27318525, -0.00041075, 0.00025164, 7.27277450, 0.99874528, 0.99933762, 0.49323587],
-												 [	-6.27318538, -0.00041069, 0.00025160, 7.27277469, 0.99874545, 0.99933770, 0.49323605],
-												 [	-6.27318551, -0.00041064, 0.00025157, 7.27277487, 0.99874561, 0.99933779, 0.49323594],
-												 [	-6.27318564, -0.00041058, 0.00025154, 7.27277506, 0.99874578, 0.99933788, 0.49323599],
-												 [	-6.27318577, -0.00041053, 0.00025150, 7.27277524, 0.99874595, 0.99933797, 0.49323604],
-												 [	-6.27318590, -0.00041048, 0.00025147, 7.27277543, 0.99874611, 0.99933806, 0.49323602],
-												 [	-6.27318603, -0.00041042, 0.00025144, 7.27277561, 0.99874628, 0.99933814, 0.49323601],
-												 [	-6.27318616, -0.00041037, 0.00025140, 7.27277580, 0.99874645, 0.99933823, 0.49323601],
-												 [	-6.27318629, -0.00041031, 0.00025137, 7.27277598, 0.99874661, 0.99933832, 0.49323608],
-												 [	-6.27318642, -0.00041026, 0.00025134, 7.27277616, 0.99874678, 0.99933841, 0.49323616],
-												 [	-6.27318655, -0.00041020, 0.00025130, 7.27277635, 0.99874694, 0.99933849, 0.49323617],
-												 [	-6.27318668, -0.00041015, 0.00025127, 7.27277653, 0.99874711, 0.99933858, 0.49323615],
-												 [	-6.27318681, -0.00041009, 0.00025124, 7.27277672, 0.99874728, 0.99933867, 0.49323614],
-												 [	-6.27318694, -0.00041004, 0.00025120, 7.27277690, 0.99874744, 0.99933876, 0.49323615],
-												 [	-6.27318707, -0.00040999, 0.00025117, 7.27277709, 0.99874761, 0.99933884, 0.49323610],
-												 [	-6.27318720, -0.00040993, 0.00025114, 7.27277727, 0.99874777, 0.99933893, 0.49323628],
-												 [	-6.27318733, -0.00040988, 0.00025110, 7.27277746, 0.99874794, 0.99933902, 0.49323634],
-												 [	-6.27318746, -0.00040982, 0.00025107, 7.27277764, 0.99874811, 0.99933911, 0.49323627],
-												 [	-6.27318759, -0.00040977, 0.00025104, 7.27277782, 0.99874827, 0.99933919, 0.49323622],
-												 [	-6.27318772, -0.00040971, 0.00025100, 7.27277801, 0.99874844, 0.99933928, 0.49323631],
-												 [	-6.27318785, -0.00040966, 0.00025097, 7.27277819, 0.99874860, 0.99933937, 0.49323628],
-												 [	-6.27318798, -0.00040961, 0.00025094, 7.27277838, 0.99874877, 0.99933946, 0.49323627],
-												 [	-6.27318811, -0.00040955, 0.00025090, 7.27277856, 0.99874893, 0.99933954, 0.49323637],
-												 [	-6.27318824, -0.00040950, 0.00025087, 7.27277874, 0.99874910, 0.99933963, 0.49323632],
-												 [	-6.27318837, -0.00040944, 0.00025084, 7.27277893, 0.99874927, 0.99933972, 0.49323640],
-												 [	-6.27318850, -0.00040939, 0.00025080, 7.27277911, 0.99874943, 0.99933981, 0.49323651],
-												 [	-6.27318863, -0.00040934, 0.00025077, 7.27277929, 0.99874960, 0.99933989, 0.49323644],
-												 [	-6.27318876, -0.00040928, 0.00025074, 7.27277948, 0.99874976, 0.99933998, 0.49323637],
-												 [	-6.27318889, -0.00040923, 0.00025070, 7.27277966, 0.99874993, 0.99934007, 0.49323647],
-												 [	-6.27318902, -0.00040917, 0.00025067, 7.27277985, 0.99875009, 0.99934016, 0.49323644],
-												 [	-6.27318915, -0.00040912, 0.00025064, 7.27278003, 0.99875026, 0.99934024, 0.49323643],
-												 [	-6.27318928, -0.00040906, 0.00025060, 7.27278021, 0.99875042, 0.99934033, 0.49323648],
-												 [	-6.27318941, -0.00040901, 0.00025057, 7.27278040, 0.99875059, 0.99934042, 0.49323655],
-												 [	-6.27318954, -0.00040896, 0.00025054, 7.27278058, 0.99875075, 0.99934050, 0.49323657],
-												 [	-6.27318967, -0.00040890, 0.00025051, 7.27278076, 0.99875092, 0.99934059, 0.49323664],
-												 [	-6.27318979, -0.00040885, 0.00025047, 7.27278095, 0.99875108, 0.99934068, 0.49323657],
-												 [	-6.27318992, -0.00040879, 0.00025044, 7.27278113, 0.99875125, 0.99934077, 0.49323666],
-												 [	-6.27319005, -0.00040874, 0.00025041, 7.27278131, 0.99875141, 0.99934085, 0.49323663],
-												 [	-6.27319018, -0.00040869, 0.00025037, 7.27278150, 0.99875158, 0.99934094, 0.49323672],
-												 [	-6.27319031, -0.00040863, 0.00025034, 7.27278168, 0.99875174, 0.99934103, 0.49323665],
-												 [	-6.27319044, -0.00040858, 0.00025031, 7.27278186, 0.99875191, 0.99934111, 0.49323670],
-												 [	-6.27319057, -0.00040852, 0.00025027, 7.27278204, 0.99875207, 0.99934120, 0.49323671],
-												 [	-6.27319070, -0.00040847, 0.00025024, 7.27278223, 0.99875224, 0.99934129, 0.49323673],
-												 [	-6.27319083, -0.00040842, 0.00025021, 7.27278241, 0.99875240, 0.99934137, 0.49323684],
-												 [	-6.27319096, -0.00040836, 0.00025017, 7.27278259, 0.99875257, 0.99934146, 0.49323687],
-												 [	-6.27319109, -0.00040831, 0.00025014, 7.27278278, 0.99875273, 0.99934155, 0.49323685],
-												 [	-6.27319121, -0.00040826, 0.00025011, 7.27278296, 0.99875290, 0.99934164, 0.49323688],
-												 [	-6.27319134, -0.00040820, 0.00025008, 7.27278314, 0.99875306, 0.99934172, 0.49323675],
-												 [	-6.27319147, -0.00040815, 0.00025004, 7.27278332, 0.99875322, 0.99934181, 0.49323678],
-												 [	-6.27319160, -0.00040809, 0.00025001, 7.27278351, 0.99875339, 0.99934190, 0.49323687],
-												 [	-6.27319173, -0.00040804, 0.00024998, 7.27278369, 0.99875355, 0.99934198, 0.49323686],
-												 [	-6.27319186, -0.00040799, 0.00024994, 7.27278387, 0.99875372, 0.99934207, 0.49323698],
-												 [	-6.27319199, -0.00040793, 0.00024991, 7.27278405, 0.99875388, 0.99934216, 0.49323692],
-												 [	-6.27319212, -0.00040788, 0.00024988, 7.27278424, 0.99875405, 0.99934224, 0.49323708],
-												 [	-6.27319224, -0.00040783, 0.00024985, 7.27278442, 0.99875421, 0.99934233, 0.49323704],
-												 [	-6.27319237, -0.00040777, 0.00024981, 7.27278460, 0.99875437, 0.99934242, 0.49323700],
-												 [	-6.27319250, -0.00040772, 0.00024978, 7.27278478, 0.99875454, 0.99934250, 0.49323693],
-												 [	-6.27319263, -0.00040766, 0.00024975, 7.27278497, 0.99875470, 0.99934259, 0.49323702],
-												 [	-6.27319276, -0.00040761, 0.00024971, 7.27278515, 0.99875487, 0.99934268, 0.49323716],
-												 [	-6.27319289, -0.00040756, 0.00024968, 7.27278533, 0.99875503, 0.99934276, 0.49323703],
-												 [	-6.27319302, -0.00040750, 0.00024965, 7.27278551, 0.99875519, 0.99934285, 0.49323706],
-												 [	-6.27319314, -0.00040745, 0.00024961, 7.27278569, 0.99875536, 0.99934294, 0.49323706],
-												 [	-6.27319327, -0.00040740, 0.00024958, 7.27278588, 0.99875552, 0.99934302, 0.49323714],
-												 [	-6.27319340, -0.00040734, 0.00024955, 7.27278606, 0.99875569, 0.99934311, 0.49323706],
-												 [	-6.27319353, -0.00040729, 0.00024952, 7.27278624, 0.99875585, 0.99934320, 0.49323708],
-												 [	-6.27319366, -0.00040724, 0.00024948, 7.27278642, 0.99875601, 0.99934328, 0.49323729],
-												 [	-6.27319379, -0.00040718, 0.00024945, 7.27278660, 0.99875618, 0.99934337, 0.49323724],
-												 [	-6.27319391, -0.00040713, 0.00024942, 7.27278679, 0.99875634, 0.99934345, 0.49323721],
-												 [	-6.27319404, -0.00040707, 0.00024938, 7.27278697, 0.99875650, 0.99934354, 0.49323728],
-												 [	-6.27319417, -0.00040702, 0.00024935, 7.27278715, 0.99875667, 0.99934363, 0.49323732],
-												 [	-6.27319430, -0.00040697, 0.00024932, 7.27278733, 0.99875683, 0.99934371, 0.49323735],
-												 [	-6.27319443, -0.00040691, 0.00024929, 7.27278751, 0.99875700, 0.99934380, 0.49323736],
-												 [	-6.27319455, -0.00040686, 0.00024925, 7.27278769, 0.99875716, 0.99934389, 0.49323725],
-												 [	-6.27319468, -0.00040681, 0.00024922, 7.27278788, 0.99875732, 0.99934397, 0.49323738],
-												 [	-6.27319481, -0.00040675, 0.00024919, 7.27278806, 0.99875749, 0.99934406, 0.49323735],
-												 [	-6.27319494, -0.00040670, 0.00024916, 7.27278824, 0.99875765, 0.99934414, 0.49323731],
-												 [	-6.27319507, -0.00040665, 0.00024912, 7.27278842, 0.99875781, 0.99934423, 0.49323743],
-												 [	-6.27319519, -0.00040659, 0.00024909, 7.27278860, 0.99875798, 0.99934432, 0.49323750],
-												 [	-6.27319532, -0.00040654, 0.00024906, 7.27278878, 0.99875814, 0.99934440, 0.49323738],
-												 [	-6.27319545, -0.00040649, 0.00024902, 7.27278896, 0.99875830, 0.99934449, 0.49323751],
-												 [	-6.27319558, -0.00040643, 0.00024899, 7.27278914, 0.99875846, 0.99934457, 0.49323752],
-												 [	-6.27319571, -0.00040638, 0.00024896, 7.27278933, 0.99875863, 0.99934466, 0.49323741],
-												 [	-6.27319583, -0.00040633, 0.00024893, 7.27278951, 0.99875879, 0.99934475, 0.49323749],
-												 [	-6.27319596, -0.00040627, 0.00024889, 7.27278969, 0.99875895, 0.99934483, 0.49323755],
-												 [	-6.27319609, -0.00040622, 0.00024886, 7.27278987, 0.99875912, 0.99934492, 0.49323762],
-												 [	-6.27319622, -0.00040617, 0.00024883, 7.27279005, 0.99875928, 0.99934501, 0.49323759],
-												 [	-6.27319634, -0.00040611, 0.00024880, 7.27279023, 0.99875944, 0.99934509, 0.49323760],
-												 [	-6.27319647, -0.00040606, 0.00024876, 7.27279041, 0.99875960, 0.99934518, 0.49323757],
-												 [	-6.27319660, -0.00040601, 0.00024873, 7.27279059, 0.99875977, 0.99934526, 0.49323761],
-												 [	-6.27319673, -0.00040595, 0.00024870, 7.27279077, 0.99875993, 0.99934535, 0.49323762],
-												 [	-6.27319685, -0.00040590, 0.00024867, 7.27279095, 0.99876009, 0.99934543, 0.49323771],
-												 [	-6.27319698, -0.00040585, 0.00024863, 7.27279113, 0.99876026, 0.99934552, 0.49323775],
-												 [	-6.27319711, -0.00040579, 0.00024860, 7.27279131, 0.99876042, 0.99934561, 0.49323777],
-												 [	-6.27319724, -0.00040574, 0.00024857, 7.27279149, 0.99876058, 0.99934569, 0.49323761],
-												 [	-6.27319736, -0.00040569, 0.00024853, 7.27279168, 0.99876074, 0.99934578, 0.49323772],
-												 [	-6.27319749, -0.00040563, 0.00024850, 7.27279186, 0.99876091, 0.99934586, 0.49323767],
-												 [	-6.27319762, -0.00040558, 0.00024847, 7.27279204, 0.99876107, 0.99934595, 0.49323779],
-												 [	-6.27319774, -0.00040553, 0.00024844, 7.27279222, 0.99876123, 0.99934603, 0.49323782],
-												 [	-6.27319787, -0.00040547, 0.00024840, 7.27279240, 0.99876139, 0.99934612, 0.49323776],
-												 [	-6.27319800, -0.00040542, 0.00024837, 7.27279258, 0.99876156, 0.99934621, 0.49323782],
-												 [	-6.27319813, -0.00040537, 0.00024834, 7.27279276, 0.99876172, 0.99934629, 0.49323787],
-												 [	-6.27319825, -0.00040532, 0.00024831, 7.27279294, 0.99876188, 0.99934638, 0.49323783],
-												 [	-6.27319838, -0.00040526, 0.00024827, 7.27279312, 0.99876204, 0.99934646, 0.49323795],
-												 [	-6.27319851, -0.00040521, 0.00024824, 7.27279330, 0.99876220, 0.99934655, 0.49323788],
-												 [	-6.27319863, -0.00040516, 0.00024821, 7.27279348, 0.99876237, 0.99934663, 0.49323798],
-												 [	-6.27319876, -0.00040510, 0.00024818, 7.27279366, 0.99876253, 0.99934672, 0.49323799],
-												 [	-6.27319889, -0.00040505, 0.00024814, 7.27279384, 0.99876269, 0.99934681, 0.49323794],
-												 [	-6.27319901, -0.00040500, 0.00024811, 7.27279402, 0.99876285, 0.99934689, 0.49323812],
-												 [	-6.27319914, -0.00040494, 0.00024808, 7.27279420, 0.99876301, 0.99934698, 0.49323800],
-												 [	-6.27319927, -0.00040489, 0.00024805, 7.27279438, 0.99876318, 0.99934706, 0.49323799],
-												 [	-6.27319939, -0.00040484, 0.00024801, 7.27279456, 0.99876334, 0.99934715, 0.49323807],
-												 [	-6.27319952, -0.00040479, 0.00024798, 7.27279474, 0.99876350, 0.99934723, 0.49323804],
-												 [	-6.27319965, -0.00040473, 0.00024795, 7.27279492, 0.99876366, 0.99934732, 0.49323807],
-												 [	-6.27319977, -0.00040468, 0.00024792, 7.27279510, 0.99876382, 0.99934740, 0.49323796],
-												 [	-6.27319990, -0.00040463, 0.00024788, 7.27279527, 0.99876398, 0.99934749, 0.49323820],
-												 [	-6.27320003, -0.00040457, 0.00024785, 7.27279545, 0.99876415, 0.99934757, 0.49323815],
-												 [	-6.27320015, -0.00040452, 0.00024782, 7.27279563, 0.99876431, 0.99934766, 0.49323813],
-												 [	-6.27320028, -0.00040447, 0.00024779, 7.27279581, 0.99876447, 0.99934774, 0.49323819],
-												 [	-6.27320041, -0.00040442, 0.00024776, 7.27279599, 0.99876463, 0.99934783, 0.49323817],
-												 [	-6.27320053, -0.00040436, 0.00024772, 7.27279617, 0.99876479, 0.99934791, 0.49323809],
-												 [	-6.27320066, -0.00040431, 0.00024769, 7.27279635, 0.99876495, 0.99934800, 0.49323823],
-												 [	-6.27320079, -0.00040426, 0.00024766, 7.27279653, 0.99876511, 0.99934809, 0.49323818],
-												 [	-6.27320091, -0.00040420, 0.00024763, 7.27279671, 0.99876528, 0.99934817, 0.49323822],
-												 [	-6.27320104, -0.00040415, 0.00024759, 7.27279689, 0.99876544, 0.99934826, 0.49323828],
-												 [	-6.27320117, -0.00040410, 0.00024756, 7.27279707, 0.99876560, 0.99934834, 0.49323852],
-												 [	-6.27320129, -0.00040405, 0.00024753, 7.27279725, 0.99876576, 0.99934843, 0.49323826],
-												 [	-6.27320142, -0.00040399, 0.00024750, 7.27279743, 0.99876592, 0.99934851, 0.49323833],
-												 [	-6.27320154, -0.00040394, 0.00024746, 7.27279760, 0.99876608, 0.99934860, 0.49323832],
-												 [	-6.27320167, -0.00040389, 0.00024743, 7.27279778, 0.99876624, 0.99934868, 0.49323839],
-												 [	-6.27320180, -0.00040383, 0.00024740, 7.27279796, 0.99876640, 0.99934877, 0.49323831],
-												 [	-6.27320192, -0.00040378, 0.00024737, 7.27279814, 0.99876656, 0.99934885, 0.49323847],
-												 [	-6.27320205, -0.00040373, 0.00024733, 7.27279832, 0.99876673, 0.99934894, 0.49323846],
-												 [	-6.27320217, -0.00040368, 0.00024730, 7.27279850, 0.99876689, 0.99934902, 0.49323853],
-												 [	-6.27320230, -0.00040362, 0.00024727, 7.27279868, 0.99876705, 0.99934911, 0.49323849],
-												 [	-6.27320243, -0.00040357, 0.00024724, 7.27279886, 0.99876721, 0.99934919, 0.49323847],
-												 [	-6.27320255, -0.00040352, 0.00024721, 7.27279903, 0.99876737, 0.99934928, 0.49323843],
-												 [	-6.27320268, -0.00040347, 0.00024717, 7.27279921, 0.99876753, 0.99934936, 0.49323854],
-												 [	-6.27320280, -0.00040341, 0.00024714, 7.27279939, 0.99876769, 0.99934944, 0.49323862],
-												 [	-6.27320293, -0.00040336, 0.00024711, 7.27279957, 0.99876785, 0.99934953, 0.49323861],
-												 [	-6.27320306, -0.00040331, 0.00024708, 7.27279975, 0.99876801, 0.99934961, 0.49323862],
-												 [	-6.27320318, -0.00040326, 0.00024704, 7.27279993, 0.99876817, 0.99934970, 0.49323859],
-												 [	-6.27320331, -0.00040320, 0.00024701, 7.27280010, 0.99876833, 0.99934978, 0.49323864],
-												 [	-6.27320343, -0.00040315, 0.00024698, 7.27280028, 0.99876849, 0.99934987, 0.49323872],
-												 [	-6.27320356, -0.00040310, 0.00024695, 7.27280046, 0.99876865, 0.99934995, 0.49323853],
-												 [	-6.27320368, -0.00040305, 0.00024692, 7.27280064, 0.99876881, 0.99935004, 0.49323874],
-												 [	-6.27320381, -0.00040299, 0.00024688, 7.27280082, 0.99876897, 0.99935012, 0.49323866],
-												 [	-6.27320394, -0.00040294, 0.00024685, 7.27280099, 0.99876913, 0.99935021, 0.49323878],
-												 [	-6.27320406, -0.00040289, 0.00024682, 7.27280117, 0.99876929, 0.99935029, 0.49323872],
-												 [	-6.27320419, -0.00040284, 0.00024679, 7.27280135, 0.99876945, 0.99935038, 0.49323872],
-												 [	-6.27320431, -0.00040278, 0.00024676, 7.27280153, 0.99876961, 0.99935046, 0.49323876],
-												 [	-6.27320444, -0.00040273, 0.00024672, 7.27280171, 0.99876978, 0.99935055, 0.49323884],
-												 [	-6.27320456, -0.00040268, 0.00024669, 7.27280188, 0.99876994, 0.99935063, 0.49323875],
-												 [	-6.27320469, -0.00040263, 0.00024666, 7.27280206, 0.99877010, 0.99935071, 0.49323881],
-												 [	-6.27320481, -0.00040257, 0.00024663, 7.27280224, 0.99877026, 0.99935080, 0.49323883],
-												 [	-6.27320494, -0.00040252, 0.00024659, 7.27280242, 0.99877042, 0.99935088, 0.49323893],
-												 [	-6.27320506, -0.00040247, 0.00024656, 7.27280259, 0.99877058, 0.99935097, 0.49323897],
-												 [	-6.27320519, -0.00040242, 0.00024653, 7.27280277, 0.99877073, 0.99935105, 0.49323888],
-												 [	-6.27320532, -0.00040237, 0.00024650, 7.27280295, 0.99877089, 0.99935114, 0.49323894],
-												 [	-6.27320544, -0.00040231, 0.00024647, 7.27280313, 0.99877105, 0.99935122, 0.49323891],
-												 [	-6.27320557, -0.00040226, 0.00024643, 7.27280330, 0.99877121, 0.99935130, 0.49323883],
-												 [	-6.27320569, -0.00040221, 0.00024640, 7.27280348, 0.99877137, 0.99935139, 0.49323900],
-												 [	-6.27320582, -0.00040216, 0.00024637, 7.27280366, 0.99877153, 0.99935147, 0.49323894],
-												 [	-6.27320594, -0.00040210, 0.00024634, 7.27280384, 0.99877169, 0.99935156, 0.49323913],
-												 [	-6.27320607, -0.00040205, 0.00024631, 7.27280401, 0.99877185, 0.99935164, 0.49323892],
-												 [	-6.27320619, -0.00040200, 0.00024627, 7.27280419, 0.99877201, 0.99935173, 0.49323905],
-												 [	-6.27320632, -0.00040195, 0.00024624, 7.27280437, 0.99877217, 0.99935181, 0.49323908],
-												 [	-6.27320644, -0.00040190, 0.00024621, 7.27280455, 0.99877233, 0.99935189, 0.49323912],
-												 [	-6.27320657, -0.00040184, 0.00024618, 7.27280472, 0.99877249, 0.99935198, 0.49323907],
-												 [	-6.27320669, -0.00040179, 0.00024615, 7.27280490, 0.99877265, 0.99935206, 0.49323901],
-												 [	-6.27320682, -0.00040174, 0.00024611, 7.27280508, 0.99877281, 0.99935215, 0.49323923],
-												 [	-6.27320694, -0.00040169, 0.00024608, 7.27280525, 0.99877297, 0.99935223, 0.49323914],
-												 [	-6.27320706, -0.00040163, 0.00024605, 7.27280543, 0.99877313, 0.99935231, 0.49323921],
-												 [	-6.27320719, -0.00040158, 0.00024602, 7.27280561, 0.99877329, 0.99935240, 0.49323926],
-												 [	-6.27320731, -0.00040153, 0.00024599, 7.27280578, 0.99877345, 0.99935248, 0.49323926],
-												 [	-6.27320744, -0.00040148, 0.00024595, 7.27280596, 0.99877361, 0.99935257, 0.49323918],
-												 [	-6.27320756, -0.00040143, 0.00024592, 7.27280614, 0.99877376, 0.99935265, 0.49323936],
-												 [	-6.27320769, -0.00040137, 0.00024589, 7.27280631, 0.99877392, 0.99935273, 0.49323929],
-												 [	-6.27320781, -0.00040132, 0.00024586, 7.27280649, 0.99877408, 0.99935282, 0.49323934],
-												 [	-6.27320794, -0.00040127, 0.00024583, 7.27280667, 0.99877424, 0.99935290, 0.49323932],
-												 [	-6.27320806, -0.00040122, 0.00024580, 7.27280684, 0.99877440, 0.99935299, 0.49323931],
-												 [	-6.27320819, -0.00040117, 0.00024576, 7.27280702, 0.99877456, 0.99935307, 0.49323926],
-												 [	-6.27320831, -0.00040111, 0.00024573, 7.27280720, 0.99877472, 0.99935315, 0.49323938],
-												 [	-6.27320843, -0.00040106, 0.00024570, 7.27280737, 0.99877488, 0.99935324, 0.49323939],
-												 [	-6.27320856, -0.00040101, 0.00024567, 7.27280755, 0.99877504, 0.99935332, 0.49323934],
-												 [	-6.27320868, -0.00040096, 0.00024564, 7.27280773, 0.99877519, 0.99935341, 0.49323939],
-												 [	-6.27320881, -0.00040091, 0.00024560, 7.27280790, 0.99877535, 0.99935349, 0.49323943],
-												 [	-6.27320893, -0.00040085, 0.00024557, 7.27280808, 0.99877551, 0.99935357, 0.49323942],
-												 [	-6.27320906, -0.00040080, 0.00024554, 7.27280825, 0.99877567, 0.99935366, 0.49323947],
-												 [	-6.27320918, -0.00040075, 0.00024551, 7.27280843, 0.99877583, 0.99935374, 0.49323951],
-												 [	-6.27320930, -0.00040070, 0.00024548, 7.27280861, 0.99877599, 0.99935382, 0.49323953],
-												 [	-6.27320943, -0.00040065, 0.00024545, 7.27280878, 0.99877615, 0.99935391, 0.49323955],
-												 [	-6.27320955, -0.00040059, 0.00024541, 7.27280896, 0.99877630, 0.99935399, 0.49323962],
-												 [	-6.27320968, -0.00040054, 0.00024538, 7.27280913, 0.99877646, 0.99935408, 0.49323956],
-												 [	-6.27320980, -0.00040049, 0.00024535, 7.27280931, 0.99877662, 0.99935416, 0.49323962],
-												 [	-6.27320993, -0.00040044, 0.00024532, 7.27280949, 0.99877678, 0.99935424, 0.49323958],
-												 [	-6.27321005, -0.00040039, 0.00024529, 7.27280966, 0.99877694, 0.99935433, 0.49323965],
-												 [	-6.27321017, -0.00040034, 0.00024525, 7.27280984, 0.99877710, 0.99935441, 0.49323969],
-												 [	-6.27321030, -0.00040028, 0.00024522, 7.27281001, 0.99877725, 0.99935449, 0.49323976],
-												 [	-6.27321042, -0.00040023, 0.00024519, 7.27281019, 0.99877741, 0.99935458, 0.49323970],
-												 [	-6.27321054, -0.00040018, 0.00024516, 7.27281036, 0.99877757, 0.99935466, 0.49323974],
-												 [	-6.27321067, -0.00040013, 0.00024513, 7.27281054, 0.99877773, 0.99935474, 0.49323974],
-												 [	-6.27321079, -0.00040008, 0.00024510, 7.27281072, 0.99877789, 0.99935483, 0.49323966],
-												 [	-6.27321092, -0.00040003, 0.00024506, 7.27281089, 0.99877804, 0.99935491, 0.49323980],
-												 [	-6.27321104, -0.00039997, 0.00024503, 7.27281107, 0.99877820, 0.99935499, 0.49323982],
-												 [	-6.27321116, -0.00039992, 0.00024500, 7.27281124, 0.99877836, 0.99935508, 0.49323984],
-												 [	-6.27321129, -0.00039987, 0.00024497, 7.27281142, 0.99877852, 0.99935516, 0.49323979],
-												 [	-6.27321141, -0.00039982, 0.00024494, 7.27281159, 0.99877868, 0.99935524, 0.49323984],
-												 [	-6.27321153, -0.00039977, 0.00024491, 7.27281177, 0.99877883, 0.99935533, 0.49323987],
-												 [	-6.27321166, -0.00039972, 0.00024487, 7.27281194, 0.99877899, 0.99935541, 0.49323994],
-												 [	-6.27321178, -0.00039966, 0.00024484, 7.27281212, 0.99877915, 0.99935549, 0.49323989],
-												 [	-6.27321191, -0.00039961, 0.00024481, 7.27281229, 0.99877931, 0.99935558, 0.49323986],
-												 [	-6.27321203, -0.00039956, 0.00024478, 7.27281247, 0.99877946, 0.99935566, 0.49323995],
-												 [	-6.27321215, -0.00039951, 0.00024475, 7.27281264, 0.99877962, 0.99935574, 0.49323997],
-												 [	-6.27321228, -0.00039946, 0.00024472, 7.27281282, 0.99877978, 0.99935583, 0.49323996],
-												 [	-6.27321240, -0.00039941, 0.00024468, 7.27281299, 0.99877994, 0.99935591, 0.49323998],
-												 [	-6.27321252, -0.00039935, 0.00024465, 7.27281317, 0.99878009, 0.99935599, 0.49323996],
-												 [	-6.27321265, -0.00039930, 0.00024462, 7.27281334, 0.99878025, 0.99935608, 0.49324002],
-												 [	-6.27321277, -0.00039925, 0.00024459, 7.27281352, 0.99878041, 0.99935616, 0.49323998],
-												 [	-6.27321289, -0.00039920, 0.00024456, 7.27281369, 0.99878057, 0.99935624, 0.49324001],
-												 [	-6.27321302, -0.00039915, 0.00024453, 7.27281387, 0.99878072, 0.99935632, 0.49324014],
-												 [	-6.27321314, -0.00039910, 0.00024450, 7.27281404, 0.99878088, 0.99935641, 0.49324019],
-												 [	-6.27321326, -0.00039905, 0.00024446, 7.27281422, 0.99878104, 0.99935649, 0.49324012],
-												 [	-6.27321338, -0.00039899, 0.00024443, 7.27281439, 0.99878120, 0.99935657, 0.49324003],
-												 [	-6.27321351, -0.00039894, 0.00024440, 7.27281457, 0.99878135, 0.99935666, 0.49324013],
-												 [	-6.27321363, -0.00039889, 0.00024437, 7.27281474, 0.99878151, 0.99935674, 0.49324013],
-												 [	-6.27321375, -0.00039884, 0.00024434, 7.27281491, 0.99878167, 0.99935682, 0.49324017],
-												 [	-6.27321388, -0.00039879, 0.00024431, 7.27281509, 0.99878182, 0.99935690, 0.49324022],
-												 [	-6.27321400, -0.00039874, 0.00024427, 7.27281526, 0.99878198, 0.99935699, 0.49324015],
-												 [	-6.27321412, -0.00039869, 0.00024424, 7.27281544, 0.99878214, 0.99935707, 0.49324036],
-												 [	-6.27321425, -0.00039863, 0.00024421, 7.27281561, 0.99878229, 0.99935715, 0.49324026],
-												 [	-6.27321437, -0.00039858, 0.00024418, 7.27281579, 0.99878245, 0.99935724, 0.49324022],
-												 [	-6.27321449, -0.00039853, 0.00024415, 7.27281596, 0.99878261, 0.99935732, 0.49324031],
-												 [	-6.27321461, -0.00039848, 0.00024412, 7.27281613, 0.99878277, 0.99935740, 0.49324028],
-												 [	-6.27321474, -0.00039843, 0.00024409, 7.27281631, 0.99878292, 0.99935748, 0.49324030],
-												 [	-6.27321486, -0.00039838, 0.00024405, 7.27281648, 0.99878308, 0.99935757, 0.49324023],
-												 [	-6.27321498, -0.00039833, 0.00024402, 7.27281666, 0.99878324, 0.99935765, 0.49324037],
-												 [	-6.27321511, -0.00039828, 0.00024399, 7.27281683, 0.99878339, 0.99935773, 0.49324036],
-												 [	-6.27321523, -0.00039822, 0.00024396, 7.27281700, 0.99878355, 0.99935782, 0.49324044],
-												 [	-6.27321535, -0.00039817, 0.00024393, 7.27281718, 0.99878370, 0.99935790, 0.49324039],
-												 [	-6.27321547, -0.00039812, 0.00024390, 7.27281735, 0.99878386, 0.99935798, 0.49324042],
-												 [	-6.27321560, -0.00039807, 0.00024387, 7.27281752, 0.99878402, 0.99935806, 0.49324055],
-												 [	-6.27321572, -0.00039802, 0.00024383, 7.27281770, 0.99878417, 0.99935815, 0.49324042],
-												 [	-6.27321584, -0.00039797, 0.00024380, 7.27281787, 0.99878433, 0.99935823, 0.49324044],
-												 [	-6.27321596, -0.00039792, 0.00024377, 7.27281805, 0.99878449, 0.99935831, 0.49324041],
-												 [	-6.27321609, -0.00039787, 0.00024374, 7.27281822, 0.99878464, 0.99935839, 0.49324060],
-												 [	-6.27321621, -0.00039781, 0.00024371, 7.27281839, 0.99878480, 0.99935848, 0.49324044],
-												 [	-6.27321633, -0.00039776, 0.00024368, 7.27281857, 0.99878496, 0.99935856, 0.49324054],
-												 [	-6.27321645, -0.00039771, 0.00024365, 7.27281874, 0.99878511, 0.99935864, 0.49324046],
-												 [	-6.27321658, -0.00039766, 0.00024362, 7.27281891, 0.99878527, 0.99935872, 0.49324052],
-												 [	-6.27321670, -0.00039761, 0.00024358, 7.27281909, 0.99878542, 0.99935881, 0.49324063],
-												 [	-6.27321682, -0.00039756, 0.00024355, 7.27281926, 0.99878558, 0.99935889, 0.49324081],
-												 [	-6.27321694, -0.00039751, 0.00024352, 7.27281943, 0.99878574, 0.99935897, 0.49324067],
-												 [	-6.27321706, -0.00039746, 0.00024349, 7.27281961, 0.99878589, 0.99935905, 0.49324080],
-												 [	-6.27321719, -0.00039741, 0.00024346, 7.27281978, 0.99878605, 0.99935913, 0.49324070],
-												 [	-6.27321731, -0.00039736, 0.00024343, 7.27281995, 0.99878620, 0.99935922, 0.49324061],
-												 [	-6.27321743, -0.00039730, 0.00024340, 7.27282013, 0.99878636, 0.99935930, 0.49324072],
-												 [	-6.27321755, -0.00039725, 0.00024337, 7.27282030, 0.99878652, 0.99935938, 0.49324071],
-												 [	-6.27321767, -0.00039720, 0.00024333, 7.27282047, 0.99878667, 0.99935946, 0.49324076],
-												 [	-6.27321780, -0.00039715, 0.00024330, 7.27282064, 0.99878683, 0.99935955, 0.49324084],
-												 [	-6.27321792, -0.00039710, 0.00024327, 7.27282082, 0.99878698, 0.99935963, 0.49324086],
-												 [	-6.27321804, -0.00039705, 0.00024324, 7.27282099, 0.99878714, 0.99935971, 0.49324068],
-												 [	-6.27321816, -0.00039700, 0.00024321, 7.27282116, 0.99878729, 0.99935979, 0.49324078],
-												 [	-6.27321828, -0.00039695, 0.00024318, 7.27282134, 0.99878745, 0.99935987, 0.49324088],
-												 [	-6.27321841, -0.00039690, 0.00024315, 7.27282151, 0.99878760, 0.99935996, 0.49324077],
-												 [	-6.27321853, -0.00039685, 0.00024312, 7.27282168, 0.99878776, 0.99936004, 0.49324091],
-												 [	-6.27321865, -0.00039680, 0.00024308, 7.27282185, 0.99878792, 0.99936012, 0.49324089],
-												 [	-6.27321877, -0.00039674, 0.00024305, 7.27282203, 0.99878807, 0.99936020, 0.49324098],
-												 [	-6.27321889, -0.00039669, 0.00024302, 7.27282220, 0.99878823, 0.99936028, 0.49324089],
-												 [	-6.27321901, -0.00039664, 0.00024299, 7.27282237, 0.99878838, 0.99936037, 0.49324096],
-												 [	-6.27321914, -0.00039659, 0.00024296, 7.27282254, 0.99878854, 0.99936045, 0.49324110],
-												 [	-6.27321926, -0.00039654, 0.00024293, 7.27282272, 0.99878869, 0.99936053, 0.49324104],
-												 [	-6.27321938, -0.00039649, 0.00024290, 7.27282289, 0.99878885, 0.99936061, 0.49324115],
-												 [	-6.27321950, -0.00039644, 0.00024287, 7.27282306, 0.99878900, 0.99936069, 0.49324105],
-												 [	-6.27321962, -0.00039639, 0.00024284, 7.27282323, 0.99878916, 0.99936078, 0.49324108],
-												 [	-6.27321974, -0.00039634, 0.00024280, 7.27282341, 0.99878931, 0.99936086, 0.49324101],
-												 [	-6.27321987, -0.00039629, 0.00024277, 7.27282358, 0.99878947, 0.99936094, 0.49324102],
-												 [	-6.27321999, -0.00039624, 0.00024274, 7.27282375, 0.99878962, 0.99936102, 0.49324113],
-												 [	-6.27322011, -0.00039619, 0.00024271, 7.27282392, 0.99878978, 0.99936110, 0.49324108],
-												 [	-6.27322023, -0.00039613, 0.00024268, 7.27282409, 0.99878993, 0.99936119, 0.49324117],
-												 [	-6.27322035, -0.00039608, 0.00024265, 7.27282427, 0.99879009, 0.99936127, 0.49324125],
-												 [	-6.27322047, -0.00039603, 0.00024262, 7.27282444, 0.99879024, 0.99936135, 0.49324106],
-												 [	-6.27322059, -0.00039598, 0.00024259, 7.27282461, 0.99879040, 0.99936143, 0.49324119],
-												 [	-6.27322071, -0.00039593, 0.00024256, 7.27282478, 0.99879055, 0.99936151, 0.49324110],
-												 [	-6.27322084, -0.00039588, 0.00024252, 7.27282495, 0.99879071, 0.99936159, 0.49324126],
-												 [	-6.27322096, -0.00039583, 0.00024249, 7.27282513, 0.99879086, 0.99936168, 0.49324122],
-												 [	-6.27322108, -0.00039578, 0.00024246, 7.27282530, 0.99879102, 0.99936176, 0.49324129],
-												 [	-6.27322120, -0.00039573, 0.00024243, 7.27282547, 0.99879117, 0.99936184, 0.49324129],
-												 [	-6.27322132, -0.00039568, 0.00024240, 7.27282564, 0.99879133, 0.99936192, 0.49324124],
-												 [	-6.27322144, -0.00039563, 0.00024237, 7.27282581, 0.99879148, 0.99936200, 0.49324135],
-												 [	-6.27322156, -0.00039558, 0.00024234, 7.27282598, 0.99879163, 0.99936208, 0.49324138],
-												 [	-6.27322168, -0.00039553, 0.00024231, 7.27282616, 0.99879179, 0.99936216, 0.49324133],
-												 [	-6.27322180, -0.00039548, 0.00024228, 7.27282633, 0.99879194, 0.99936225, 0.49324140],
-												 [	-6.27322193, -0.00039543, 0.00024225, 7.27282650, 0.99879210, 0.99936233, 0.49324130],
-												 [	-6.27322205, -0.00039538, 0.00024221, 7.27282667, 0.99879225, 0.99936241, 0.49324149],
-												 [	-6.27322217, -0.00039533, 0.00024218, 7.27282684, 0.99879241, 0.99936249, 0.49324143],
-												 [	-6.27322229, -0.00039528, 0.00024215, 7.27282701, 0.99879256, 0.99936257, 0.49324140],
-												 [	-6.27322241, -0.00039522, 0.00024212, 7.27282718, 0.99879271, 0.99936265, 0.49324158],
-												 [	-6.27322253, -0.00039517, 0.00024209, 7.27282736, 0.99879287, 0.99936273, 0.49324147],
-												 [	-6.27322265, -0.00039512, 0.00024206, 7.27282753, 0.99879302, 0.99936282, 0.49324156],
-												 [	-6.27322277, -0.00039507, 0.00024203, 7.27282770, 0.99879318, 0.99936290, 0.49324153],
-												 [	-6.27322289, -0.00039502, 0.00024200, 7.27282787, 0.99879333, 0.99936298, 0.49324143],
-												 [	-6.27322301, -0.00039497, 0.00024197, 7.27282804, 0.99879349, 0.99936306, 0.49324134],
-												 [	-6.27322313, -0.00039492, 0.00024194, 7.27282821, 0.99879364, 0.99936314, 0.49324161],
-												 [	-6.27322325, -0.00039487, 0.00024191, 7.27282838, 0.99879379, 0.99936322, 0.49324161],
-												 [	-6.27322337, -0.00039482, 0.00024187, 7.27282855, 0.99879395, 0.99936330, 0.49324164],
-												 [	-6.27322349, -0.00039477, 0.00024184, 7.27282872, 0.99879410, 0.99936339, 0.49324176],
-												 [	-6.27322362, -0.00039472, 0.00024181, 7.27282889, 0.99879425, 0.99936347, 0.49324160],
-												 [	-6.27322374, -0.00039467, 0.00024178, 7.27282907, 0.99879441, 0.99936355, 0.49324157],
-												 [	-6.27322386, -0.00039462, 0.00024175, 7.27282924, 0.99879456, 0.99936363, 0.49324158],
-												 [	-6.27322398, -0.00039457, 0.00024172, 7.27282941, 0.99879472, 0.99936371, 0.49324166],
-												 [	-6.27322410, -0.00039452, 0.00024169, 7.27282958, 0.99879487, 0.99936379, 0.49324172],
-												 [	-6.27322422, -0.00039447, 0.00024166, 7.27282975, 0.99879502, 0.99936387, 0.49324177],
-												 [	-6.27322434, -0.00039442, 0.00024163, 7.27282992, 0.99879518, 0.99936395, 0.49324175],
-												 [	-6.27322446, -0.00039437, 0.00024160, 7.27283009, 0.99879533, 0.99936403, 0.49324173],
-												 [	-6.27322458, -0.00039432, 0.00024157, 7.27283026, 0.99879548, 0.99936412, 0.49324183],
-												 [	-6.27322470, -0.00039427, 0.00024154, 7.27283043, 0.99879564, 0.99936420, 0.49324189],
-												 [	-6.27322482, -0.00039422, 0.00024150, 7.27283060, 0.99879579, 0.99936428, 0.49324183],
-												 [	-6.27322494, -0.00039417, 0.00024147, 7.27283077, 0.99879594, 0.99936436, 0.49324176],
-												 [	-6.27322506, -0.00039412, 0.00024144, 7.27283094, 0.99879610, 0.99936444, 0.49324183],
-												 [	-6.27322518, -0.00039407, 0.00024141, 7.27283111, 0.99879625, 0.99936452, 0.49324186],
-												 [	-6.27322530, -0.00039402, 0.00024138, 7.27283128, 0.99879640, 0.99936460, 0.49324198],
-												 [	-6.27322542, -0.00039397, 0.00024135, 7.27283145, 0.99879656, 0.99936468, 0.49324210],
-												 [	-6.27322554, -0.00039392, 0.00024132, 7.27283162, 0.99879671, 0.99936476, 0.49324198],
-												 [	-6.27322566, -0.00039387, 0.00024129, 7.27283179, 0.99879686, 0.99936484, 0.49324205],
-												 [	-6.27322578, -0.00039382, 0.00024126, 7.27283196, 0.99879702, 0.99936492, 0.49324207],
-												 [	-6.27322590, -0.00039377, 0.00024123, 7.27283213, 0.99879717, 0.99936501, 0.49324191],
-												 [	-6.27322602, -0.00039372, 0.00024120, 7.27283230, 0.99879732, 0.99936509, 0.49324201],
-												 [	-6.27322614, -0.00039367, 0.00024117, 7.27283247, 0.99879748, 0.99936517, 0.49324194],
-												 [	-6.27322626, -0.00039362, 0.00024114, 7.27283264, 0.99879763, 0.99936525, 0.49324211],
-												 [	-6.27322638, -0.00039357, 0.00024111, 7.27283281, 0.99879778, 0.99936533, 0.49324210],
-												 [	-6.27322650, -0.00039352, 0.00024107, 7.27283298, 0.99879793, 0.99936541, 0.49324195],
-												 [	-6.27322662, -0.00039347, 0.00024104, 7.27283315, 0.99879809, 0.99936549, 0.49324205],
-												 [	-6.27322674, -0.00039342, 0.00024101, 7.27283332, 0.99879824, 0.99936557, 0.49324210],
-												 [	-6.27322686, -0.00039337, 0.00024098, 7.27283349, 0.99879839, 0.99936565, 0.49324214],
-												 [	-6.27322698, -0.00039332, 0.00024095, 7.27283366, 0.99879855, 0.99936573, 0.49324202],
-												 [	-6.27322710, -0.00039327, 0.00024092, 7.27283383, 0.99879870, 0.99936581, 0.49324209],
-												 [	-6.27322722, -0.00039322, 0.00024089, 7.27283400, 0.99879885, 0.99936589, 0.49324208],
-												 [	-6.27322734, -0.00039317, 0.00024086, 7.27283417, 0.99879900, 0.99936597, 0.49324207],
-												 [	-6.27322746, -0.00039312, 0.00024083, 7.27283434, 0.99879916, 0.99936605, 0.49324215],
-												 [	-6.27322757, -0.00039307, 0.00024080, 7.27283451, 0.99879931, 0.99936613, 0.49324220],
-												 [	-6.27322769, -0.00039302, 0.00024077, 7.27283468, 0.99879946, 0.99936621, 0.49324229],
-												 [	-6.27322781, -0.00039297, 0.00024074, 7.27283485, 0.99879961, 0.99936630, 0.49324226],
-												 [	-6.27322793, -0.00039292, 0.00024071, 7.27283502, 0.99879977, 0.99936638, 0.49324230],
-												 [	-6.27322805, -0.00039287, 0.00024068, 7.27283519, 0.99879992, 0.99936646, 0.49324236],
-												 [	-6.27322817, -0.00039282, 0.00024065, 7.27283535, 0.99880007, 0.99936654, 0.49324229],
-												 [	-6.27322829, -0.00039277, 0.00024062, 7.27283552, 0.99880022, 0.99936662, 0.49324245],
-												 [	-6.27322841, -0.00039272, 0.00024059, 7.27283569, 0.99880038, 0.99936670, 0.49324230],
-												 [	-6.27322853, -0.00039267, 0.00024055, 7.27283586, 0.99880053, 0.99936678, 0.49324241],
-												 [	-6.27322865, -0.00039262, 0.00024052, 7.27283603, 0.99880068, 0.99936686, 0.49324234],
-												 [	-6.27322877, -0.00039257, 0.00024049, 7.27283620, 0.99880083, 0.99936694, 0.49324231],
-												 [	-6.27322889, -0.00039252, 0.00024046, 7.27283637, 0.99880098, 0.99936702, 0.49324244],
-												 [	-6.27322901, -0.00039247, 0.00024043, 7.27283654, 0.99880114, 0.99936710, 0.49324243],
-												 [	-6.27322913, -0.00039242, 0.00024040, 7.27283671, 0.99880129, 0.99936718, 0.49324251],
-												 [	-6.27322924, -0.00039237, 0.00024037, 7.27283688, 0.99880144, 0.99936726, 0.49324242],
-												 [	-6.27322936, -0.00039232, 0.00024034, 7.27283704, 0.99880159, 0.99936734, 0.49324245],
-												 [	-6.27322948, -0.00039227, 0.00024031, 7.27283721, 0.99880174, 0.99936742, 0.49324248],
-												 [	-6.27322960, -0.00039222, 0.00024028, 7.27283738, 0.99880190, 0.99936750, 0.49324240],
-												 [	-6.27322972, -0.00039217, 0.00024025, 7.27283755, 0.99880205, 0.99936758, 0.49324256],
-												 [	-6.27322984, -0.00039212, 0.00024022, 7.27283772, 0.99880220, 0.99936766, 0.49324270],
-												 [	-6.27322996, -0.00039207, 0.00024019, 7.27283789, 0.99880235, 0.99936774, 0.49324265],
-												 [	-6.27323008, -0.00039202, 0.00024016, 7.27283806, 0.99880250, 0.99936782, 0.49324254],
-												 [	-6.27323020, -0.00039197, 0.00024013, 7.27283822, 0.99880265, 0.99936790, 0.49324268],
-												 [	-6.27323032, -0.00039192, 0.00024010, 7.27283839, 0.99880281, 0.99936798, 0.49324263],
-												 [	-6.27323043, -0.00039187, 0.00024007, 7.27283856, 0.99880296, 0.99936806, 0.49324257],
-												 [	-6.27323055, -0.00039182, 0.00024004, 7.27283873, 0.99880311, 0.99936814, 0.49324271],
-												 [	-6.27323067, -0.00039177, 0.00024001, 7.27283890, 0.99880326, 0.99936822, 0.49324263],
-												 [	-6.27323079, -0.00039172, 0.00023998, 7.27283907, 0.99880341, 0.99936830, 0.49324259],
-												 [	-6.27323091, -0.00039167, 0.00023995, 7.27283923, 0.99880356, 0.99936838, 0.49324272],
-												 [	-6.27323103, -0.00039162, 0.00023992, 7.27283940, 0.99880372, 0.99936846, 0.49324266],
-												 [	-6.27323115, -0.00039158, 0.00023989, 7.27283957, 0.99880387, 0.99936854, 0.49324277],
-												 [	-6.27323126, -0.00039153, 0.00023985, 7.27283974, 0.99880402, 0.99936862, 0.49324283],
-												 [	-6.27323138, -0.00039148, 0.00023982, 7.27283991, 0.99880417, 0.99936870, 0.49324288],
-												 [	-6.27323150, -0.00039143, 0.00023979, 7.27284008, 0.99880432, 0.99936878, 0.49324274],
-												 [	-6.27323162, -0.00039138, 0.00023976, 7.27284024, 0.99880447, 0.99936886, 0.49324289],
-												 [	-6.27323174, -0.00039133, 0.00023973, 7.27284041, 0.99880462, 0.99936894, 0.49324287],
-												 [	-6.27323186, -0.00039128, 0.00023970, 7.27284058, 0.99880477, 0.99936902, 0.49324285],
-												 [	-6.27323198, -0.00039123, 0.00023967, 7.27284075, 0.99880493, 0.99936910, 0.49324283],
-												 [	-6.27323209, -0.00039118, 0.00023964, 7.27284091, 0.99880508, 0.99936918, 0.49324290],
-												 [	-6.27323221, -0.00039113, 0.00023961, 7.27284108, 0.99880523, 0.99936926, 0.49324280],
-												 [	-6.27323233, -0.00039108, 0.00023958, 7.27284125, 0.99880538, 0.99936934, 0.49324296],
-												 [	-6.27323245, -0.00039103, 0.00023955, 7.27284142, 0.99880553, 0.99936942, 0.49324284],
-												 [	-6.27323257, -0.00039098, 0.00023952, 7.27284159, 0.99880568, 0.99936950, 0.49324285],
-												 [	-6.27323268, -0.00039093, 0.00023949, 7.27284175, 0.99880583, 0.99936958, 0.49324302],
-												 [	-6.27323280, -0.00039088, 0.00023946, 7.27284192, 0.99880598, 0.99936966, 0.49324295],
-												 [	-6.27323292, -0.00039083, 0.00023943, 7.27284209, 0.99880613, 0.99936974, 0.49324320],
-												 [	-6.27323304, -0.00039078, 0.00023940, 7.27284226, 0.99880628, 0.99936982, 0.49324315],
-												 [	-6.27323316, -0.00039073, 0.00023937, 7.27284242, 0.99880643, 0.99936990, 0.49324296],
-												 [	-6.27323328, -0.00039069, 0.00023934, 7.27284259, 0.99880658, 0.99936997, 0.49324298],
-												 [	-6.27323339, -0.00039064, 0.00023931, 7.27284276, 0.99880674, 0.99937005, 0.49324310],
-												 [	-6.27323351, -0.00039059, 0.00023928, 7.27284292, 0.99880689, 0.99937013, 0.49324316],
-												 [	-6.27323363, -0.00039054, 0.00023925, 7.27284309, 0.99880704, 0.99937021, 0.49324305],
-												 [	-6.27323375, -0.00039049, 0.00023922, 7.27284326, 0.99880719, 0.99937029, 0.49324317],
-												 [	-6.27323387, -0.00039044, 0.00023919, 7.27284343, 0.99880734, 0.99937037, 0.49324316],
-												 [	-6.27323398, -0.00039039, 0.00023916, 7.27284359, 0.99880749, 0.99937045, 0.49324322],
-												 [	-6.27323410, -0.00039034, 0.00023913, 7.27284376, 0.99880764, 0.99937053, 0.49324310],
-												 [	-6.27323422, -0.00039029, 0.00023910, 7.27284393, 0.99880779, 0.99937061, 0.49324325],
-												 [	-6.27323434, -0.00039024, 0.00023907, 7.27284409, 0.99880794, 0.99937069, 0.49324319],
-												 [	-6.27323445, -0.00039019, 0.00023904, 7.27284426, 0.99880809, 0.99937077, 0.49324326],
-												 [	-6.27323457, -0.00039014, 0.00023901, 7.27284443, 0.99880824, 0.99937085, 0.49324329],
-												 [	-6.27323469, -0.00039009, 0.00023898, 7.27284460, 0.99880839, 0.99937093, 0.49324333],
-												 [	-6.27323481, -0.00039005, 0.00023895, 7.27284476, 0.99880854, 0.99937101, 0.49324318],
-												 [	-6.27323493, -0.00039000, 0.00023892, 7.27284493, 0.99880869, 0.99937109, 0.49324318],
-												 [	-6.27323504, -0.00038995, 0.00023889, 7.27284510, 0.99880884, 0.99937117, 0.49324337],
-												 [	-6.27323516, -0.00038990, 0.00023886, 7.27284526, 0.99880899, 0.99937124, 0.49324337],
-												 [	-6.27323528, -0.00038985, 0.00023883, 7.27284543, 0.99880914, 0.99937132, 0.49324350],
-												 [	-6.27323540, -0.00038980, 0.00023880, 7.27284560, 0.99880929, 0.99937140, 0.49324334],
-												 [	-6.27323551, -0.00038975, 0.00023877, 7.27284576, 0.99880944, 0.99937148, 0.49324341],
-												 [	-6.27323563, -0.00038970, 0.00023874, 7.27284593, 0.99880959, 0.99937156, 0.49324338],
-												 [	-6.27323575, -0.00038965, 0.00023871, 7.27284609, 0.99880974, 0.99937164, 0.49324344],
-												 [	-6.27323587, -0.00038960, 0.00023868, 7.27284626, 0.99880989, 0.99937172, 0.49324362],
-												 [	-6.27323598, -0.00038955, 0.00023865, 7.27284643, 0.99881004, 0.99937180, 0.49324347],
-												 [	-6.27323610, -0.00038951, 0.00023862, 7.27284659, 0.99881019, 0.99937188, 0.49324345],
-												 [	-6.27323622, -0.00038946, 0.00023859, 7.27284676, 0.99881034, 0.99937196, 0.49324353],
-												 [	-6.27323633, -0.00038941, 0.00023856, 7.27284693, 0.99881049, 0.99937204, 0.49324361],
-												 [	-6.27323645, -0.00038936, 0.00023853, 7.27284709, 0.99881064, 0.99937211, 0.49324364],
-												 [	-6.27323657, -0.00038931, 0.00023850, 7.27284726, 0.99881079, 0.99937219, 0.49324360],
-												 [	-6.27323669, -0.00038926, 0.00023847, 7.27284743, 0.99881094, 0.99937227, 0.49324354],
-												 [	-6.27323680, -0.00038921, 0.00023844, 7.27284759, 0.99881109, 0.99937235, 0.49324359],
-												 [	-6.27323692, -0.00038916, 0.00023841, 7.27284776, 0.99881124, 0.99937243, 0.49324355],
-												 [	-6.27323704, -0.00038911, 0.00023838, 7.27284792, 0.99881139, 0.99937251, 0.49324369],
-												 [	-6.27323715, -0.00038907, 0.00023835, 7.27284809, 0.99881154, 0.99937259, 0.49324366],
-												 [	-6.27323727, -0.00038902, 0.00023832, 7.27284826, 0.99881169, 0.99937267, 0.49324363],
-												 [	-6.27323739, -0.00038897, 0.00023829, 7.27284842, 0.99881184, 0.99937275, 0.49324368],
-												 [	-6.27323751, -0.00038892, 0.00023826, 7.27284859, 0.99881198, 0.99937282, 0.49324385],
-												 [	-6.27323762, -0.00038887, 0.00023823, 7.27284875, 0.99881213, 0.99937290, 0.49324375],
-												 [	-6.27323774, -0.00038882, 0.00023820, 7.27284892, 0.99881228, 0.99937298, 0.49324381],
-												 [	-6.27323786, -0.00038877, 0.00023817, 7.27284908, 0.99881243, 0.99937306, 0.49324383],
-												 [	-6.27323797, -0.00038872, 0.00023814, 7.27284925, 0.99881258, 0.99937314, 0.49324389],
-												 [	-6.27323809, -0.00038867, 0.00023811, 7.27284942, 0.99881273, 0.99937322, 0.49324387],
-												 [	-6.27323821, -0.00038863, 0.00023808, 7.27284958, 0.99881288, 0.99937330, 0.49324385],
-												 [	-6.27323832, -0.00038858, 0.00023805, 7.27284975, 0.99881303, 0.99937338, 0.49324378],
-												 [	-6.27323844, -0.00038853, 0.00023802, 7.27284991, 0.99881318, 0.99937345, 0.49324377],
-												 [	-6.27323856, -0.00038848, 0.00023799, 7.27285008, 0.99881333, 0.99937353, 0.49324388],
-												 [	-6.27323867, -0.00038843, 0.00023796, 7.27285024, 0.99881348, 0.99937361, 0.49324392],
-												 [	-6.27323879, -0.00038838, 0.00023793, 7.27285041, 0.99881362, 0.99937369, 0.49324396],
-												 [	-6.27323891, -0.00038833, 0.00023790, 7.27285057, 0.99881377, 0.99937377, 0.49324387],
-												 [	-6.27323902, -0.00038828, 0.00023787, 7.27285074, 0.99881392, 0.99937385, 0.49324395],
-												 [	-6.27323914, -0.00038824, 0.00023784, 7.27285090, 0.99881407, 0.99937393, 0.49324401],
-												 [	-6.27323926, -0.00038819, 0.00023781, 7.27285107, 0.99881422, 0.99937400, 0.49324397],
-												 [	-6.27323937, -0.00038814, 0.00023778, 7.27285124, 0.99881437, 0.99937408, 0.49324409],
-												 [	-6.27323949, -0.00038809, 0.00023775, 7.27285140, 0.99881452, 0.99937416, 0.49324390],
-												 [	-6.27323961, -0.00038804, 0.00023772, 7.27285157, 0.99881467, 0.99937424, 0.49324412],
-												 [	-6.27323972, -0.00038799, 0.00023769, 7.27285173, 0.99881481, 0.99937432, 0.49324405],
-												 [	-6.27323984, -0.00038794, 0.00023766, 7.27285190, 0.99881496, 0.99937440, 0.49324413],
-												 [	-6.27323996, -0.00038789, 0.00023763, 7.27285206, 0.99881511, 0.99937448, 0.49324398],
-												 [	-6.27324007, -0.00038785, 0.00023760, 7.27285223, 0.99881526, 0.99937455, 0.49324408],
-												 [	-6.27324019, -0.00038780, 0.00023757, 7.27285239, 0.99881541, 0.99937463, 0.49324411],
-												 [	-6.27324030, -0.00038775, 0.00023754, 7.27285256, 0.99881556, 0.99937471, 0.49324404],
-												 [	-6.27324042, -0.00038770, 0.00023751, 7.27285272, 0.99881571, 0.99937479, 0.49324417],
-												 [	-6.27324054, -0.00038765, 0.00023748, 7.27285289, 0.99881585, 0.99937487, 0.49324417],
-												 [	-6.27324065, -0.00038760, 0.00023745, 7.27285305, 0.99881600, 0.99937495, 0.49324417],
-												 [	-6.27324077, -0.00038755, 0.00023742, 7.27285321, 0.99881615, 0.99937502, 0.49324410],
-												 [	-6.27324089, -0.00038751, 0.00023739, 7.27285338, 0.99881630, 0.99937510, 0.49324415],
-												 [	-6.27324100, -0.00038746, 0.00023736, 7.27285354, 0.99881645, 0.99937518, 0.49324415],
-												 [	-6.27324112, -0.00038741, 0.00023733, 7.27285371, 0.99881660, 0.99937526, 0.49324428],
-												 [	-6.27324123, -0.00038736, 0.00023730, 7.27285387, 0.99881674, 0.99937534, 0.49324427],
-												 [	-6.27324135, -0.00038731, 0.00023727, 7.27285404, 0.99881689, 0.99937541, 0.49324429],
-												 [	-6.27324147, -0.00038726, 0.00023724, 7.27285420, 0.99881704, 0.99937549, 0.49324429],
-												 [	-6.27324158, -0.00038722, 0.00023721, 7.27285437, 0.99881719, 0.99937557, 0.49324431],
-												 [	-6.27324170, -0.00038717, 0.00023718, 7.27285453, 0.99881734, 0.99937565, 0.49324418],
-												 [	-6.27324181, -0.00038712, 0.00023715, 7.27285469, 0.99881748, 0.99937573, 0.49324436],
-												 [	-6.27324193, -0.00038707, 0.00023712, 7.27285486, 0.99881763, 0.99937581, 0.49324427],
-												 [	-6.27324205, -0.00038702, 0.00023709, 7.27285502, 0.99881778, 0.99937588, 0.49324438],
-												 [	-6.27324216, -0.00038697, 0.00023706, 7.27285519, 0.99881793, 0.99937596, 0.49324441],
-												 [	-6.27324228, -0.00038693, 0.00023704, 7.27285535, 0.99881807, 0.99937604, 0.49324425],
-												 [	-6.27324239, -0.00038688, 0.00023701, 7.27285552, 0.99881822, 0.99937612, 0.49324444],
-												 [	-6.27324251, -0.00038683, 0.00023698, 7.27285568, 0.99881837, 0.99937620, 0.49324437],
-												 [	-6.27324262, -0.00038678, 0.00023695, 7.27285584, 0.99881852, 0.99937627, 0.49324451],
-												 [	-6.27324274, -0.00038673, 0.00023692, 7.27285601, 0.99881867, 0.99937635, 0.49324443],
-												 [	-6.27324286, -0.00038668, 0.00023689, 7.27285617, 0.99881881, 0.99937643, 0.49324463],
-												 [	-6.27324297, -0.00038664, 0.00023686, 7.27285634, 0.99881896, 0.99937651, 0.49324464],
-												 [	-6.27324309, -0.00038659, 0.00023683, 7.27285650, 0.99881911, 0.99937659, 0.49324460],
-												 [	-6.27324320, -0.00038654, 0.00023680, 7.27285666, 0.99881926, 0.99937666, 0.49324474],
-												 [	-6.27324332, -0.00038649, 0.00023677, 7.27285683, 0.99881940, 0.99937674, 0.49324457],
-												 [	-6.27324343, -0.00038644, 0.00023674, 7.27285699, 0.99881955, 0.99937682, 0.49324464],
-												 [	-6.27324355, -0.00038639, 0.00023671, 7.27285716, 0.99881970, 0.99937690, 0.49324452],
-												 [	-6.27324366, -0.00038635, 0.00023668, 7.27285732, 0.99881985, 0.99937697, 0.49324451],
-												 [	-6.27324378, -0.00038630, 0.00023665, 7.27285748, 0.99881999, 0.99937705, 0.49324463],
-												 [	-6.27324390, -0.00038625, 0.00023662, 7.27285765, 0.99882014, 0.99937713, 0.49324460],
-												 [	-6.27324401, -0.00038620, 0.00023659, 7.27285781, 0.99882029, 0.99937721, 0.49324461],
-												 [	-6.27324413, -0.00038615, 0.00023656, 7.27285797, 0.99882043, 0.99937729, 0.49324473],
-												 [	-6.27324424, -0.00038610, 0.00023653, 7.27285814, 0.99882058, 0.99937736, 0.49324474],
-												 [	-6.27324436, -0.00038606, 0.00023650, 7.27285830, 0.99882073, 0.99937744, 0.49324465],
-												 [	-6.27324447, -0.00038601, 0.00023647, 7.27285846, 0.99882088, 0.99937752, 0.49324475],
-												 [	-6.27324459, -0.00038596, 0.00023644, 7.27285863, 0.99882102, 0.99937760, 0.49324482],
-												 [	-6.27324470, -0.00038591, 0.00023641, 7.27285879, 0.99882117, 0.99937767, 0.49324468],
-												 [	-6.27324482, -0.00038586, 0.00023638, 7.27285895, 0.99882132, 0.99937775, 0.49324472],
-												 [	-6.27324493, -0.00038582, 0.00023636, 7.27285912, 0.99882146, 0.99937783, 0.49324478],
-												 [	-6.27324505, -0.00038577, 0.00023633, 7.27285928, 0.99882161, 0.99937791, 0.49324486],
-												 [	-6.27324516, -0.00038572, 0.00023630, 7.27285944, 0.99882176, 0.99937798, 0.49324500],
-												 [	-6.27324528, -0.00038567, 0.00023627, 7.27285961, 0.99882190, 0.99937806, 0.49324482],
-												 [	-6.27324539, -0.00038562, 0.00023624, 7.27285977, 0.99882205, 0.99937814, 0.49324496],
-												 [	-6.27324551, -0.00038558, 0.00023621, 7.27285993, 0.99882220, 0.99937822, 0.49324495],
-												 [	-6.27324562, -0.00038553, 0.00023618, 7.27286009, 0.99882234, 0.99937829, 0.49324492],
-												 [	-6.27324574, -0.00038548, 0.00023615, 7.27286026, 0.99882249, 0.99937837, 0.49324476],
-												 [	-6.27324585, -0.00038543, 0.00023612, 7.27286042, 0.99882264, 0.99937845, 0.49324499],
-												 [	-6.27324597, -0.00038538, 0.00023609, 7.27286058, 0.99882278, 0.99937853, 0.49324495],
-												 [	-6.27324608, -0.00038534, 0.00023606, 7.27286075, 0.99882293, 0.99937860, 0.49324497],
-												 [	-6.27324620, -0.00038529, 0.00023603, 7.27286091, 0.99882308, 0.99937868, 0.49324499],
-												 [	-6.27324631, -0.00038524, 0.00023600, 7.27286107, 0.99882322, 0.99937876, 0.49324496],
-												 [	-6.27324643, -0.00038519, 0.00023597, 7.27286123, 0.99882337, 0.99937884, 0.49324507],
-												 [	-6.27324654, -0.00038514, 0.00023594, 7.27286140, 0.99882352, 0.99937891, 0.49324506],
-												 [	-6.27324666, -0.00038510, 0.00023591, 7.27286156, 0.99882366, 0.99937899, 0.49324519],
-												 [	-6.27324677, -0.00038505, 0.00023588, 7.27286172, 0.99882381, 0.99937907, 0.49324510],
-												 [	-6.27324689, -0.00038500, 0.00023586, 7.27286188, 0.99882396, 0.99937914, 0.49324509],
-												 [	-6.27324700, -0.00038495, 0.00023583, 7.27286205, 0.99882410, 0.99937922, 0.49324510],
-												 [	-6.27324711, -0.00038490, 0.00023580, 7.27286221, 0.99882425, 0.99937930, 0.49324517],
-												 [	-6.27324723, -0.00038486, 0.00023577, 7.27286237, 0.99882440, 0.99937938, 0.49324527],
-												 [	-6.27324734, -0.00038481, 0.00023574, 7.27286253, 0.99882454, 0.99937945, 0.49324519],
-												 [	-6.27324746, -0.00038476, 0.00023571, 7.27286270, 0.99882469, 0.99937953, 0.49324516],
-												 [	-6.27324757, -0.00038471, 0.00023568, 7.27286286, 0.99882483, 0.99937961, 0.49324513],
-												 [	-6.27324769, -0.00038467, 0.00023565, 7.27286302, 0.99882498, 0.99937968, 0.49324519],
-												 [	-6.27324780, -0.00038462, 0.00023562, 7.27286318, 0.99882513, 0.99937976, 0.49324509],
-												 [	-6.27324792, -0.00038457, 0.00023559, 7.27286335, 0.99882527, 0.99937984, 0.49324532],
-												 [	-6.27324803, -0.00038452, 0.00023556, 7.27286351, 0.99882542, 0.99937992, 0.49324518],
-												 [	-6.27324814, -0.00038447, 0.00023553, 7.27286367, 0.99882556, 0.99937999, 0.49324537],
-												 [	-6.27324826, -0.00038443, 0.00023550, 7.27286383, 0.99882571, 0.99938007, 0.49324536],
-												 [	-6.27324837, -0.00038438, 0.00023547, 7.27286399, 0.99882586, 0.99938015, 0.49324540],
-												 [	-6.27324849, -0.00038433, 0.00023545, 7.27286416, 0.99882600, 0.99938022, 0.49324531],
-												 [	-6.27324860, -0.00038428, 0.00023542, 7.27286432, 0.99882615, 0.99938030, 0.49324544],
-												 [	-6.27324872, -0.00038424, 0.00023539, 7.27286448, 0.99882629, 0.99938038, 0.49324534],
-												 [	-6.27324883, -0.00038419, 0.00023536, 7.27286464, 0.99882644, 0.99938045, 0.49324551],
-												 [	-6.27324894, -0.00038414, 0.00023533, 7.27286480, 0.99882658, 0.99938053, 0.49324541],
-												 [	-6.27324906, -0.00038409, 0.00023530, 7.27286497, 0.99882673, 0.99938061, 0.49324551],
-												 [	-6.27324917, -0.00038405, 0.00023527, 7.27286513, 0.99882688, 0.99938068, 0.49324541],
-												 [	-6.27324929, -0.00038400, 0.00023524, 7.27286529, 0.99882702, 0.99938076, 0.49324543],
-												 [	-6.27324940, -0.00038395, 0.00023521, 7.27286545, 0.99882717, 0.99938084, 0.49324548],
-												 [	-6.27324951, -0.00038390, 0.00023518, 7.27286561, 0.99882731, 0.99938092, 0.49324547],
-												 [	-6.27324963, -0.00038385, 0.00023515, 7.27286577, 0.99882746, 0.99938099, 0.49324552],
-												 [	-6.27324974, -0.00038381, 0.00023512, 7.27286594, 0.99882760, 0.99938107, 0.49324561],
-												 [	-6.27324986, -0.00038376, 0.00023509, 7.27286610, 0.99882775, 0.99938115, 0.49324575],
-												 [	-6.27324997, -0.00038371, 0.00023507, 7.27286626, 0.99882789, 0.99938122, 0.49324555],
-												 [	-6.27325008, -0.00038366, 0.00023504, 7.27286642, 0.99882804, 0.99938130, 0.49324561],
-												 [	-6.27325020, -0.00038362, 0.00023501, 7.27286658, 0.99882818, 0.99938138, 0.49324560],
-												 [	-6.27325031, -0.00038357, 0.00023498, 7.27286674, 0.99882833, 0.99938145, 0.49324567],
-												 [	-6.27325043, -0.00038352, 0.00023495, 7.27286690, 0.99882847, 0.99938153, 0.49324557],
-												 [	-6.27325054, -0.00038347, 0.00023492, 7.27286706, 0.99882862, 0.99938161, 0.49324572],
-												 [	-6.27325065, -0.00038343, 0.00023489, 7.27286723, 0.99882877, 0.99938168, 0.49324570],
-												 [	-6.27325077, -0.00038338, 0.00023486, 7.27286739, 0.99882891, 0.99938176, 0.49324576],
-												 [	-6.27325088, -0.00038333, 0.00023483, 7.27286755, 0.99882906, 0.99938184, 0.49324591],
-												 [	-6.27325099, -0.00038328, 0.00023480, 7.27286771, 0.99882920, 0.99938191, 0.49324569],
-												 [	-6.27325111, -0.00038324, 0.00023477, 7.27286787, 0.99882935, 0.99938199, 0.49324559],
-												 [	-6.27325122, -0.00038319, 0.00023475, 7.27286803, 0.99882949, 0.99938207, 0.49324564],
-												 [	-6.27325133, -0.00038314, 0.00023472, 7.27286819, 0.99882964, 0.99938214, 0.49324576],
-												 [	-6.27325145, -0.00038309, 0.00023469, 7.27286835, 0.99882978, 0.99938222, 0.49324581],
-												 [	-6.27325156, -0.00038305, 0.00023466, 7.27286851, 0.99882993, 0.99938229, 0.49324590],
-												 [	-6.27325168, -0.00038300, 0.00023463, 7.27286868, 0.99883007, 0.99938237, 0.49324573],
-												 [	-6.27325179, -0.00038295, 0.00023460, 7.27286884, 0.99883021, 0.99938245, 0.49324578],
-												 [	-6.27325190, -0.00038291, 0.00023457, 7.27286900, 0.99883036, 0.99938252, 0.49324585],
-												 [	-6.27325202, -0.00038286, 0.00023454, 7.27286916, 0.99883050, 0.99938260, 0.49324579],
-												 [	-6.27325213, -0.00038281, 0.00023451, 7.27286932, 0.99883065, 0.99938268, 0.49324589],
-												 [	-6.27325224, -0.00038276, 0.00023448, 7.27286948, 0.99883079, 0.99938275, 0.49324588],
-												 [	-6.27325236, -0.00038272, 0.00023446, 7.27286964, 0.99883094, 0.99938283, 0.49324586],
-												 [	-6.27325247, -0.00038267, 0.00023443, 7.27286980, 0.99883108, 0.99938291, 0.49324588],
-												 [	-6.27325258, -0.00038262, 0.00023440, 7.27286996, 0.99883123, 0.99938298, 0.49324600],
-												 [	-6.27325269, -0.00038257, 0.00023437, 7.27287012, 0.99883137, 0.99938306, 0.49324602],
-												 [	-6.27325281, -0.00038253, 0.00023434, 7.27287028, 0.99883152, 0.99938313, 0.49324593],
-												 [	-6.27325292, -0.00038248, 0.00023431, 7.27287044, 0.99883166, 0.99938321, 0.49324600],
-												 [	-6.27325303, -0.00038243, 0.00023428, 7.27287060, 0.99883180, 0.99938329, 0.49324594],
-												 [	-6.27325315, -0.00038238, 0.00023425, 7.27287076, 0.99883195, 0.99938336, 0.49324594],
-												 [	-6.27325326, -0.00038234, 0.00023422, 7.27287092, 0.99883209, 0.99938344, 0.49324616],
-												 [	-6.27325337, -0.00038229, 0.00023419, 7.27287108, 0.99883224, 0.99938352, 0.49324609],
-												 [	-6.27325349, -0.00038224, 0.00023417, 7.27287124, 0.99883238, 0.99938359, 0.49324615],
-												 [	-6.27325360, -0.00038220, 0.00023414, 7.27287140, 0.99883253, 0.99938367, 0.49324616],
-												 [	-6.27325371, -0.00038215, 0.00023411, 7.27287156, 0.99883267, 0.99938374, 0.49324616],
-												 [	-6.27325383, -0.00038210, 0.00023408, 7.27287172, 0.99883281, 0.99938382, 0.49324603],
-												 [	-6.27325394, -0.00038205, 0.00023405, 7.27287188, 0.99883296, 0.99938390, 0.49324614],
-												 [	-6.27325405, -0.00038201, 0.00023402, 7.27287204, 0.99883310, 0.99938397, 0.49324629],
-												 [	-6.27325416, -0.00038196, 0.00023399, 7.27287220, 0.99883325, 0.99938405, 0.49324628],
-												 [	-6.27325428, -0.00038191, 0.00023396, 7.27287236, 0.99883339, 0.99938412, 0.49324634],
-												 [	-6.27325439, -0.00038187, 0.00023393, 7.27287252, 0.99883353, 0.99938420, 0.49324618],
-												 [	-6.27325450, -0.00038182, 0.00023391, 7.27287268, 0.99883368, 0.99938428, 0.49324620],
-												 [	-6.27325462, -0.00038177, 0.00023388, 7.27287284, 0.99883382, 0.99938435, 0.49324621],
-												 [	-6.27325473, -0.00038172, 0.00023385, 7.27287300, 0.99883397, 0.99938443, 0.49324620],
-												 [	-6.27325484, -0.00038168, 0.00023382, 7.27287316, 0.99883411, 0.99938450, 0.49324631],
-												 [	-6.27325495, -0.00038163, 0.00023379, 7.27287332, 0.99883425, 0.99938458, 0.49324616],
-												 [	-6.27325507, -0.00038158, 0.00023376, 7.27287348, 0.99883440, 0.99938466, 0.49324629],
-												 [	-6.27325518, -0.00038154, 0.00023373, 7.27287364, 0.99883454, 0.99938473, 0.49324635],
-												 [	-6.27325529, -0.00038149, 0.00023370, 7.27287380, 0.99883469, 0.99938481, 0.49324648],
-												 [	-6.27325540, -0.00038144, 0.00023367, 7.27287396, 0.99883483, 0.99938488, 0.49324638],
-												 [	-6.27325552, -0.00038140, 0.00023365, 7.27287412, 0.99883497, 0.99938496, 0.49324637],
-												 [	-6.27325563, -0.00038135, 0.00023362, 7.27287428, 0.99883512, 0.99938503, 0.49324641],
-												 [	-6.27325574, -0.00038130, 0.00023359, 7.27287444, 0.99883526, 0.99938511, 0.49324645],
-												 [	-6.27325585, -0.00038125, 0.00023356, 7.27287460, 0.99883540, 0.99938519, 0.49324647],
-												 [	-6.27325597, -0.00038121, 0.00023353, 7.27287476, 0.99883555, 0.99938526, 0.49324642],
-												 [	-6.27325608, -0.00038116, 0.00023350, 7.27287492, 0.99883569, 0.99938534, 0.49324651],
-												 [	-6.27325619, -0.00038111, 0.00023347, 7.27287508, 0.99883583, 0.99938541, 0.49324649],
-												 [	-6.27325630, -0.00038107, 0.00023344, 7.27287524, 0.99883598, 0.99938549, 0.49324647],
-												 [	-6.27325642, -0.00038102, 0.00023342, 7.27287540, 0.99883612, 0.99938556, 0.49324658],
-												 [	-6.27325653, -0.00038097, 0.00023339, 7.27287555, 0.99883626, 0.99938564, 0.49324664],
-												 [	-6.27325664, -0.00038093, 0.00023336, 7.27287571, 0.99883641, 0.99938572, 0.49324649],
-												 [	-6.27325675, -0.00038088, 0.00023333, 7.27287587, 0.99883655, 0.99938579, 0.49324658],
-												 [	-6.27325686, -0.00038083, 0.00023330, 7.27287603, 0.99883669, 0.99938587, 0.49324653],
-												 [	-6.27325698, -0.00038079, 0.00023327, 7.27287619, 0.99883684, 0.99938594, 0.49324658],
-												 [	-6.27325709, -0.00038074, 0.00023324, 7.27287635, 0.99883698, 0.99938602, 0.49324649],
-												 [	-6.27325720, -0.00038069, 0.00023321, 7.27287651, 0.99883712, 0.99938609, 0.49324663],
-												 [	-6.27325731, -0.00038065, 0.00023319, 7.27287667, 0.99883727, 0.99938617, 0.49324670],
-												 [	-6.27325742, -0.00038060, 0.00023316, 7.27287683, 0.99883741, 0.99938624, 0.49324665],
-												 [	-6.27325754, -0.00038055, 0.00023313, 7.27287699, 0.99883755, 0.99938632, 0.49324681],
-												 [	-6.27325765, -0.00038050, 0.00023310, 7.27287714, 0.99883769, 0.99938640, 0.49324678],
-												 [	-6.27325776, -0.00038046, 0.00023307, 7.27287730, 0.99883784, 0.99938647, 0.49324668],
-												 [	-6.27325787, -0.00038041, 0.00023304, 7.27287746, 0.99883798, 0.99938655, 0.49324676],
-												 [	-6.27325798, -0.00038036, 0.00023301, 7.27287762, 0.99883812, 0.99938662, 0.49324679],
-												 [	-6.27325810, -0.00038032, 0.00023299, 7.27287778, 0.99883827, 0.99938670, 0.49324680],
-												 [	-6.27325821, -0.00038027, 0.00023296, 7.27287794, 0.99883841, 0.99938677, 0.49324686],
-												 [	-6.27325832, -0.00038022, 0.00023293, 7.27287810, 0.99883855, 0.99938685, 0.49324703],
-												 [	-6.27325843, -0.00038018, 0.00023290, 7.27287825, 0.99883869, 0.99938692, 0.49324683],
-												 [	-6.27325854, -0.00038013, 0.00023287, 7.27287841, 0.99883884, 0.99938700, 0.49324688],
-												 [	-6.27325866, -0.00038008, 0.00023284, 7.27287857, 0.99883898, 0.99938707, 0.49324687],
-												 [	-6.27325877, -0.00038004, 0.00023281, 7.27287873, 0.99883912, 0.99938715, 0.49324692],
-												 [	-6.27325888, -0.00037999, 0.00023279, 7.27287889, 0.99883926, 0.99938722, 0.49324678],
-												 [	-6.27325899, -0.00037994, 0.00023276, 7.27287905, 0.99883941, 0.99938730, 0.49324693],
-												 [	-6.27325910, -0.00037990, 0.00023273, 7.27287920, 0.99883955, 0.99938737, 0.49324693],
-												 [	-6.27325921, -0.00037985, 0.00023270, 7.27287936, 0.99883969, 0.99938745, 0.49324695],
-												 [	-6.27325932, -0.00037980, 0.00023267, 7.27287952, 0.99883983, 0.99938752, 0.49324704],
-												 [	-6.27325944, -0.00037976, 0.00023264, 7.27287968, 0.99883998, 0.99938760, 0.49324699],
-												 [	-6.27325955, -0.00037971, 0.00023261, 7.27287984, 0.99884012, 0.99938768, 0.49324702],
-												 [	-6.27325966, -0.00037966, 0.00023259, 7.27287999, 0.99884026, 0.99938775, 0.49324694],
-												 [	-6.27325977, -0.00037962, 0.00023256, 7.27288015, 0.99884040, 0.99938783, 0.49324708],
-												 [	-6.27325988, -0.00037957, 0.00023253, 7.27288031, 0.99884055, 0.99938790, 0.49324716],
-												 [	-6.27325999, -0.00037953, 0.00023250, 7.27288047, 0.99884069, 0.99938798, 0.49324712],
-												 [	-6.27326011, -0.00037948, 0.00023247, 7.27288063, 0.99884083, 0.99938805, 0.49324715],
-												 [	-6.27326022, -0.00037943, 0.00023244, 7.27288078, 0.99884097, 0.99938813, 0.49324707],
-												 [	-6.27326033, -0.00037939, 0.00023241, 7.27288094, 0.99884111, 0.99938820, 0.49324704],
-												 [	-6.27326044, -0.00037934, 0.00023239, 7.27288110, 0.99884126, 0.99938828, 0.49324718],
-												 [	-6.27326055, -0.00037929, 0.00023236, 7.27288126, 0.99884140, 0.99938835, 0.49324714],
-												 [	-6.27326066, -0.00037925, 0.00023233, 7.27288142, 0.99884154, 0.99938843, 0.49324726],
-												 [	-6.27326077, -0.00037920, 0.00023230, 7.27288157, 0.99884168, 0.99938850, 0.49324702],
-												 [	-6.27326088, -0.00037915, 0.00023227, 7.27288173, 0.99884182, 0.99938858, 0.49324721],
-												 [	-6.27326100, -0.00037911, 0.00023224, 7.27288189, 0.99884197, 0.99938865, 0.49324723],
-												 [	-6.27326111, -0.00037906, 0.00023221, 7.27288205, 0.99884211, 0.99938873, 0.49324718],
-												 [	-6.27326122, -0.00037901, 0.00023219, 7.27288220, 0.99884225, 0.99938880, 0.49324712],
-												 [	-6.27326133, -0.00037897, 0.00023216, 7.27288236, 0.99884239, 0.99938887, 0.49324742],
-												 [	-6.27326144, -0.00037892, 0.00023213, 7.27288252, 0.99884253, 0.99938895, 0.49324731],
-												 [	-6.27326155, -0.00037887, 0.00023210, 7.27288268, 0.99884267, 0.99938902, 0.49324731],
-												 [	-6.27326166, -0.00037883, 0.00023207, 7.27288283, 0.99884282, 0.99938910, 0.49324735],
-												 [	-6.27326177, -0.00037878, 0.00023204, 7.27288299, 0.99884296, 0.99938917, 0.49324724],
-												 [	-6.27326188, -0.00037874, 0.00023202, 7.27288315, 0.99884310, 0.99938925, 0.49324733],
-												 [	-6.27326199, -0.00037869, 0.00023199, 7.27288331, 0.99884324, 0.99938932, 0.49324726],
-												 [	-6.27326211, -0.00037864, 0.00023196, 7.27288346, 0.99884338, 0.99938940, 0.49324734],
-												 [	-6.27326222, -0.00037860, 0.00023193, 7.27288362, 0.99884352, 0.99938947, 0.49324737],
-												 [	-6.27326233, -0.00037855, 0.00023190, 7.27288378, 0.99884367, 0.99938955, 0.49324746],
-												 [	-6.27326244, -0.00037850, 0.00023187, 7.27288393, 0.99884381, 0.99938962, 0.49324742],
-												 [	-6.27326255, -0.00037846, 0.00023185, 7.27288409, 0.99884395, 0.99938970, 0.49324750],
-												 [	-6.27326266, -0.00037841, 0.00023182, 7.27288425, 0.99884409, 0.99938977, 0.49324754],
-												 [	-6.27326277, -0.00037837, 0.00023179, 7.27288441, 0.99884423, 0.99938985, 0.49324741],
-												 [	-6.27326288, -0.00037832, 0.00023176, 7.27288456, 0.99884437, 0.99938992, 0.49324760],
-												 [	-6.27326299, -0.00037827, 0.00023173, 7.27288472, 0.99884451, 0.99939000, 0.49324751],
-												 [	-6.27326310, -0.00037823, 0.00023170, 7.27288488, 0.99884466, 0.99939007, 0.49324747],
-												 [	-6.27326321, -0.00037818, 0.00023168, 7.27288503, 0.99884480, 0.99939014, 0.49324756],
-												 [	-6.27326332, -0.00037813, 0.00023165, 7.27288519, 0.99884494, 0.99939022, 0.49324744],
-												 [	-6.27326343, -0.00037809, 0.00023162, 7.27288535, 0.99884508, 0.99939029, 0.49324765],
-												 [	-6.27326354, -0.00037804, 0.00023159, 7.27288550, 0.99884522, 0.99939037, 0.49324755],
-												 [	-6.27326366, -0.00037800, 0.00023156, 7.27288566, 0.99884536, 0.99939044, 0.49324760],
-												 [	-6.27326377, -0.00037795, 0.00023153, 7.27288582, 0.99884550, 0.99939052, 0.49324764],
-												 [	-6.27326388, -0.00037790, 0.00023151, 7.27288597, 0.99884564, 0.99939059, 0.49324764],
-												 [	-6.27326399, -0.00037786, 0.00023148, 7.27288613, 0.99884578, 0.99939067, 0.49324768],
-												 [	-6.27326410, -0.00037781, 0.00023145, 7.27288629, 0.99884592, 0.99939074, 0.49324772],
-												 [	-6.27326421, -0.00037777, 0.00023142, 7.27288644, 0.99884607, 0.99939081, 0.49324775],
-												 [	-6.27326432, -0.00037772, 0.00023139, 7.27288660, 0.99884621, 0.99939089, 0.49324763],
-												 [	-6.27326443, -0.00037767, 0.00023136, 7.27288676, 0.99884635, 0.99939096, 0.49324773],
-												 [	-6.27326454, -0.00037763, 0.00023134, 7.27288691, 0.99884649, 0.99939104, 0.49324770],
-												 [	-6.27326465, -0.00037758, 0.00023131, 7.27288707, 0.99884663, 0.99939111, 0.49324772],
-												 [	-6.27326476, -0.00037753, 0.00023128, 7.27288722, 0.99884677, 0.99939119, 0.49324778],
-												 [	-6.27326487, -0.00037749, 0.00023125, 7.27288738, 0.99884691, 0.99939126, 0.49324783],
-												 [	-6.27326498, -0.00037744, 0.00023122, 7.27288754, 0.99884705, 0.99939133, 0.49324780],
-												 [	-6.27326509, -0.00037740, 0.00023120, 7.27288769, 0.99884719, 0.99939141, 0.49324776],
-												 [	-6.27326520, -0.00037735, 0.00023117, 7.27288785, 0.99884733, 0.99939148, 0.49324786],
-												 [	-6.27326531, -0.00037730, 0.00023114, 7.27288801, 0.99884747, 0.99939156, 0.49324788],
-												 [	-6.27326542, -0.00037726, 0.00023111, 7.27288816, 0.99884761, 0.99939163, 0.49324776],
-												 [	-6.27326553, -0.00037721, 0.00023108, 7.27288832, 0.99884775, 0.99939171, 0.49324788],
-												 [	-6.27326564, -0.00037717, 0.00023105, 7.27288847, 0.99884789, 0.99939178, 0.49324801],
-												 [	-6.27326575, -0.00037712, 0.00023103, 7.27288863, 0.99884803, 0.99939185, 0.49324790],
-												 [	-6.27326586, -0.00037707, 0.00023100, 7.27288879, 0.99884817, 0.99939193, 0.49324783],
-												 [	-6.27326597, -0.00037703, 0.00023097, 7.27288894, 0.99884831, 0.99939200, 0.49324795],
-												 [	-6.27326608, -0.00037698, 0.00023094, 7.27288910, 0.99884846, 0.99939208, 0.49324808],
-												 [	-6.27326619, -0.00037694, 0.00023091, 7.27288925, 0.99884860, 0.99939215, 0.49324796],
-												 [	-6.27326630, -0.00037689, 0.00023089, 7.27288941, 0.99884874, 0.99939222, 0.49324802],
-												 [	-6.27326641, -0.00037685, 0.00023086, 7.27288956, 0.99884888, 0.99939230, 0.49324786],
-												 [	-6.27326652, -0.00037680, 0.00023083, 7.27288972, 0.99884902, 0.99939237, 0.49324795],
-												 [	-6.27326663, -0.00037675, 0.00023080, 7.27288988, 0.99884916, 0.99939245, 0.49324822],
-												 [	-6.27326674, -0.00037671, 0.00023077, 7.27289003, 0.99884930, 0.99939252, 0.49324803],
-												 [	-6.27326685, -0.00037666, 0.00023074, 7.27289019, 0.99884944, 0.99939259, 0.49324799],
-												 [	-6.27326696, -0.00037662, 0.00023072, 7.27289034, 0.99884958, 0.99939267, 0.49324798],
-												 [	-6.27326707, -0.00037657, 0.00023069, 7.27289050, 0.99884972, 0.99939274, 0.49324802],
-												 [	-6.27326718, -0.00037652, 0.00023066, 7.27289065, 0.99884986, 0.99939282, 0.49324803],
-												 [	-6.27326729, -0.00037648, 0.00023063, 7.27289081, 0.99885000, 0.99939289, 0.49324811],
-												 [	-6.27326740, -0.00037643, 0.00023060, 7.27289096, 0.99885014, 0.99939296, 0.49324817],
-												 [	-6.27326751, -0.00037639, 0.00023058, 7.27289112, 0.99885028, 0.99939304, 0.49324821],
-												 [	-6.27326762, -0.00037634, 0.00023055, 7.27289127, 0.99885042, 0.99939311, 0.49324821],
-												 [	-6.27326773, -0.00037630, 0.00023052, 7.27289143, 0.99885056, 0.99939318, 0.49324827],
-												 [	-6.27326783, -0.00037625, 0.00023049, 7.27289159, 0.99885070, 0.99939326, 0.49324820],
-												 [	-6.27326794, -0.00037620, 0.00023046, 7.27289174, 0.99885084, 0.99939333, 0.49324832],
-												 [	-6.27326805, -0.00037616, 0.00023044, 7.27289190, 0.99885097, 0.99939341, 0.49324834],
-												 [	-6.27326816, -0.00037611, 0.00023041, 7.27289205, 0.99885111, 0.99939348, 0.49324841],
-												 [	-6.27326827, -0.00037607, 0.00023038, 7.27289221, 0.99885125, 0.99939355, 0.49324834],
-												 [	-6.27326838, -0.00037602, 0.00023035, 7.27289236, 0.99885139, 0.99939363, 0.49324834],
-												 [	-6.27326849, -0.00037598, 0.00023032, 7.27289252, 0.99885153, 0.99939370, 0.49324836],
-												 [	-6.27326860, -0.00037593, 0.00023030, 7.27289267, 0.99885167, 0.99939377, 0.49324838],
-												 [	-6.27326871, -0.00037588, 0.00023027, 7.27289283, 0.99885181, 0.99939385, 0.49324843],
-												 [	-6.27326882, -0.00037584, 0.00023024, 7.27289298, 0.99885195, 0.99939392, 0.49324818],
-												 [	-6.27326893, -0.00037579, 0.00023021, 7.27289314, 0.99885209, 0.99939399, 0.49324852],
-												 [	-6.27326904, -0.00037575, 0.00023018, 7.27289329, 0.99885223, 0.99939407, 0.49324850],
-												 [	-6.27326915, -0.00037570, 0.00023016, 7.27289345, 0.99885237, 0.99939414, 0.49324851],
-												 [	-6.27326926, -0.00037566, 0.00023013, 7.27289360, 0.99885251, 0.99939422, 0.49324838],
-												 [	-6.27326937, -0.00037561, 0.00023010, 7.27289375, 0.99885265, 0.99939429, 0.49324847],
-												 [	-6.27326947, -0.00037557, 0.00023007, 7.27289391, 0.99885279, 0.99939436, 0.49324849],
-												 [	-6.27326958, -0.00037552, 0.00023004, 7.27289406, 0.99885293, 0.99939444, 0.49324851],
-												 [	-6.27326969, -0.00037547, 0.00023002, 7.27289422, 0.99885307, 0.99939451, 0.49324844],
-												 [	-6.27326980, -0.00037543, 0.00022999, 7.27289437, 0.99885321, 0.99939458, 0.49324862],
-												 [	-6.27326991, -0.00037538, 0.00022996, 7.27289453, 0.99885334, 0.99939466, 0.49324845],
-												 [	-6.27327002, -0.00037534, 0.00022993, 7.27289468, 0.99885348, 0.99939473, 0.49324866],
-												 [	-6.27327013, -0.00037529, 0.00022991, 7.27289484, 0.99885362, 0.99939480, 0.49324850],
-												 [	-6.27327024, -0.00037525, 0.00022988, 7.27289499, 0.99885376, 0.99939488, 0.49324874],
-												 [	-6.27327035, -0.00037520, 0.00022985, 7.27289514, 0.99885390, 0.99939495, 0.49324863],
-												 [	-6.27327045, -0.00037516, 0.00022982, 7.27289530, 0.99885404, 0.99939502, 0.49324861],
-												 [	-6.27327056, -0.00037511, 0.00022979, 7.27289545, 0.99885418, 0.99939510, 0.49324863],
-												 [	-6.27327067, -0.00037506, 0.00022977, 7.27289561, 0.99885432, 0.99939517, 0.49324878],
-												 [	-6.27327078, -0.00037502, 0.00022974, 7.27289576, 0.99885446, 0.99939524, 0.49324852],
-												 [	-6.27327089, -0.00037497, 0.00022971, 7.27289592, 0.99885459, 0.99939532, 0.49324868],
-												 [	-6.27327100, -0.00037493, 0.00022968, 7.27289607, 0.99885473, 0.99939539, 0.49324870],
-												 [	-6.27327111, -0.00037488, 0.00022965, 7.27289622, 0.99885487, 0.99939546, 0.49324867],
-												 [	-6.27327122, -0.00037484, 0.00022963, 7.27289638, 0.99885501, 0.99939554, 0.49324861],
-												 [	-6.27327132, -0.00037479, 0.00022960, 7.27289653, 0.99885515, 0.99939561, 0.49324879],
-												 [	-6.27327143, -0.00037475, 0.00022957, 7.27289669, 0.99885529, 0.99939568, 0.49324878],
-												 [	-6.27327154, -0.00037470, 0.00022954, 7.27289684, 0.99885543, 0.99939576, 0.49324873],
-												 [	-6.27327165, -0.00037466, 0.00022952, 7.27289699, 0.99885557, 0.99939583, 0.49324877],
-												 [	-6.27327176, -0.00037461, 0.00022949, 7.27289715, 0.99885570, 0.99939590, 0.49324893],
-												 [	-6.27327187, -0.00037457, 0.00022946, 7.27289730, 0.99885584, 0.99939597, 0.49324876],
-												 [	-6.27327198, -0.00037452, 0.00022943, 7.27289746, 0.99885598, 0.99939605, 0.49324876],
-												 [	-6.27327208, -0.00037447, 0.00022940, 7.27289761, 0.99885612, 0.99939612, 0.49324883],
-												 [	-6.27327219, -0.00037443, 0.00022938, 7.27289776, 0.99885626, 0.99939619, 0.49324897],
-												 [	-6.27327230, -0.00037438, 0.00022935, 7.27289792, 0.99885640, 0.99939627, 0.49324903],
-												 [	-6.27327241, -0.00037434, 0.00022932, 7.27289807, 0.99885653, 0.99939634, 0.49324897],
-												 [	-6.27327252, -0.00037429, 0.00022929, 7.27289822, 0.99885667, 0.99939641, 0.49324915],
-												 [	-6.27327263, -0.00037425, 0.00022927, 7.27289838, 0.99885681, 0.99939649, 0.49324899],
-												 [	-6.27327273, -0.00037420, 0.00022924, 7.27289853, 0.99885695, 0.99939656, 0.49324895],
-												 [	-6.27327284, -0.00037416, 0.00022921, 7.27289869, 0.99885709, 0.99939663, 0.49324901],
-												 [	-6.27327295, -0.00037411, 0.00022918, 7.27289884, 0.99885723, 0.99939671, 0.49324899],
-												 [	-6.27327306, -0.00037407, 0.00022915, 7.27289899, 0.99885736, 0.99939678, 0.49324910],
-												 [	-6.27327317, -0.00037402, 0.00022913, 7.27289915, 0.99885750, 0.99939685, 0.49324893],
-												 [	-6.27327328, -0.00037398, 0.00022910, 7.27289930, 0.99885764, 0.99939692, 0.49324897],
-												 [	-6.27327338, -0.00037393, 0.00022907, 7.27289945, 0.99885778, 0.99939700, 0.49324903],
-												 [	-6.27327349, -0.00037389, 0.00022904, 7.27289961, 0.99885792, 0.99939707, 0.49324907],
-												 [	-6.27327360, -0.00037384, 0.00022902, 7.27289976, 0.99885805, 0.99939714, 0.49324912],
-												 [	-6.27327371, -0.00037380, 0.00022899, 7.27289991, 0.99885819, 0.99939722, 0.49324911],
-												 [	-6.27327382, -0.00037375, 0.00022896, 7.27290007, 0.99885833, 0.99939729, 0.49324918],
-												 [	-6.27327392, -0.00037371, 0.00022893, 7.27290022, 0.99885847, 0.99939736, 0.49324911],
-												 [	-6.27327403, -0.00037366, 0.00022891, 7.27290037, 0.99885861, 0.99939743, 0.49324922],
-												 [	-6.27327414, -0.00037362, 0.00022888, 7.27290052, 0.99885874, 0.99939751, 0.49324912],
-												 [	-6.27327425, -0.00037357, 0.00022885, 7.27290068, 0.99885888, 0.99939758, 0.49324914],
-												 [	-6.27327436, -0.00037353, 0.00022882, 7.27290083, 0.99885902, 0.99939765, 0.49324919],
-												 [	-6.27327446, -0.00037348, 0.00022880, 7.27290098, 0.99885916, 0.99939772, 0.49324915],
-												 [	-6.27327457, -0.00037344, 0.00022877, 7.27290114, 0.99885929, 0.99939780, 0.49324920],
-												 [	-6.27327468, -0.00037339, 0.00022874, 7.27290129, 0.99885943, 0.99939787, 0.49324914],
-												 [	-6.27327479, -0.00037335, 0.00022871, 7.27290144, 0.99885957, 0.99939794, 0.49324927],
-												 [	-6.27327490, -0.00037330, 0.00022868, 7.27290160, 0.99885971, 0.99939801, 0.49324924],
-												 [	-6.27327500, -0.00037326, 0.00022866, 7.27290175, 0.99885984, 0.99939809, 0.49324926],
-												 [	-6.27327511, -0.00037321, 0.00022863, 7.27290190, 0.99885998, 0.99939816, 0.49324920],
-												 [	-6.27327522, -0.00037317, 0.00022860, 7.27290205, 0.99886012, 0.99939823, 0.49324932],
-												 [	-6.27327533, -0.00037312, 0.00022857, 7.27290221, 0.99886026, 0.99939831, 0.49324939],
-												 [	-6.27327543, -0.00037308, 0.00022855, 7.27290236, 0.99886039, 0.99939838, 0.49324946],
-												 [	-6.27327554, -0.00037303, 0.00022852, 7.27290251, 0.99886053, 0.99939845, 0.49324935],
-												 [	-6.27327565, -0.00037299, 0.00022849, 7.27290266, 0.99886067, 0.99939852, 0.49324930],
-												 [	-6.27327576, -0.00037294, 0.00022846, 7.27290282, 0.99886081, 0.99939860, 0.49324950],
-												 [	-6.27327586, -0.00037290, 0.00022844, 7.27290297, 0.99886094, 0.99939867, 0.49324938],
-												 [	-6.27327597, -0.00037285, 0.00022841, 7.27290312, 0.99886108, 0.99939874, 0.49324942],
-												 [	-6.27327608, -0.00037281, 0.00022838, 7.27290327, 0.99886122, 0.99939881, 0.49324944],
-												 [	-6.27327619, -0.00037276, 0.00022835, 7.27290343, 0.99886136, 0.99939888, 0.49324942],
-												 [	-6.27327629, -0.00037272, 0.00022833, 7.27290358, 0.99886149, 0.99939896, 0.49324940],
-												 [	-6.27327640, -0.00037267, 0.00022830, 7.27290373, 0.99886163, 0.99939903, 0.49324954],
-												 [	-6.27327651, -0.00037263, 0.00022827, 7.27290388, 0.99886177, 0.99939910, 0.49324936],
-												 [	-6.27327662, -0.00037258, 0.00022824, 7.27290404, 0.99886190, 0.99939917, 0.49324945],
-												 [	-6.27327672, -0.00037254, 0.00022822, 7.27290419, 0.99886204, 0.99939925, 0.49324953],
-												 [	-6.27327683, -0.00037249, 0.00022819, 7.27290434, 0.99886218, 0.99939932, 0.49324957],
-												 [	-6.27327694, -0.00037245, 0.00022816, 7.27290449, 0.99886231, 0.99939939, 0.49324952],
-												 [	-6.27327705, -0.00037240, 0.00022813, 7.27290464, 0.99886245, 0.99939946, 0.49324959],
-												 [	-6.27327715, -0.00037236, 0.00022811, 7.27290480, 0.99886259, 0.99939954, 0.49324957],
-												 [	-6.27327726, -0.00037231, 0.00022808, 7.27290495, 0.99886273, 0.99939961, 0.49324964],
-												 [	-6.27327737, -0.00037227, 0.00022805, 7.27290510, 0.99886286, 0.99939968, 0.49324963],
-												 [	-6.27327747, -0.00037222, 0.00022802, 7.27290525, 0.99886300, 0.99939975, 0.49324974],
-												 [	-6.27327758, -0.00037218, 0.00022800, 7.27290540, 0.99886314, 0.99939982, 0.49324966],
-												 [	-6.27327769, -0.00037213, 0.00022797, 7.27290556, 0.99886327, 0.99939990, 0.49324952],
-												 [	-6.27327780, -0.00037209, 0.00022794, 7.27290571, 0.99886341, 0.99939997, 0.49324969],
-												 [	-6.27327790, -0.00037204, 0.00022791, 7.27290586, 0.99886355, 0.99940004, 0.49324970],
-												 [	-6.27327801, -0.00037200, 0.00022789, 7.27290601, 0.99886368, 0.99940011, 0.49324976],
-												 [	-6.27327812, -0.00037195, 0.00022786, 7.27290616, 0.99886382, 0.99940019, 0.49324984],
-												 [	-6.27327822, -0.00037191, 0.00022783, 7.27290631, 0.99886396, 0.99940026, 0.49324963],
-												 [	-6.27327833, -0.00037187, 0.00022781, 7.27290647, 0.99886409, 0.99940033, 0.49324968],
-												 [	-6.27327844, -0.00037182, 0.00022778, 7.27290662, 0.99886423, 0.99940040, 0.49324978],
-												 [	-6.27327855, -0.00037178, 0.00022775, 7.27290677, 0.99886436, 0.99940047, 0.49324985],
-												 [	-6.27327865, -0.00037173, 0.00022772, 7.27290692, 0.99886450, 0.99940055, 0.49325000],
-												 [	-6.27327876, -0.00037169, 0.00022770, 7.27290707, 0.99886464, 0.99940062, 0.49324984],
-												 [	-6.27327887, -0.00037164, 0.00022767, 7.27290722, 0.99886477, 0.99940069, 0.49324982],
-												 [	-6.27327897, -0.00037160, 0.00022764, 7.27290737, 0.99886491, 0.99940076, 0.49324988],
-												 [	-6.27327908, -0.00037155, 0.00022761, 7.27290753, 0.99886505, 0.99940083, 0.49325015],
-												 [	-6.27327919, -0.00037151, 0.00022759, 7.27290768, 0.99886518, 0.99940091, 0.49324977],
-												 [	-6.27327929, -0.00037146, 0.00022756, 7.27290783, 0.99886532, 0.99940098, 0.49324993],
-												 [	-6.27327940, -0.00037142, 0.00022753, 7.27290798, 0.99886546, 0.99940105, 0.49325002],
-												 [	-6.27327951, -0.00037137, 0.00022750, 7.27290813, 0.99886559, 0.99940112, 0.49324999],
-												 [	-6.27327961, -0.00037133, 0.00022748, 7.27290828, 0.99886573, 0.99940119, 0.49325000],
-												 [	-6.27327972, -0.00037129, 0.00022745, 7.27290843, 0.99886586, 0.99940126, 0.49325006],
-												 [	-6.27327983, -0.00037124, 0.00022742, 7.27290858, 0.99886600, 0.99940134, 0.49324994],
-												 [	-6.27327993, -0.00037120, 0.00022740, 7.27290874, 0.99886614, 0.99940141, 0.49324986],
-												 [	-6.27328004, -0.00037115, 0.00022737, 7.27290889, 0.99886627, 0.99940148, 0.49325009],
-												 [	-6.27328015, -0.00037111, 0.00022734, 7.27290904, 0.99886641, 0.99940155, 0.49325012],
-												 [	-6.27328025, -0.00037106, 0.00022731, 7.27290919, 0.99886654, 0.99940162, 0.49325015],
-												 [	-6.27328036, -0.00037102, 0.00022729, 7.27290934, 0.99886668, 0.99940170, 0.49325010],
-												 [	-6.27328047, -0.00037097, 0.00022726, 7.27290949, 0.99886682, 0.99940177, 0.49325020],
-												 [	-6.27328057, -0.00037093, 0.00022723, 7.27290964, 0.99886695, 0.99940184, 0.49325004],
-												 [	-6.27328068, -0.00037089, 0.00022720, 7.27290979, 0.99886709, 0.99940191, 0.49325014],
-												 [	-6.27328078, -0.00037084, 0.00022718, 7.27290994, 0.99886722, 0.99940198, 0.49325025],
-												 [	-6.27328089, -0.00037080, 0.00022715, 7.27291009, 0.99886736, 0.99940205, 0.49325008],
-												 [	-6.27328100, -0.00037075, 0.00022712, 7.27291024, 0.99886749, 0.99940213, 0.49325032],
-												 [	-6.27328110, -0.00037071, 0.00022710, 7.27291040, 0.99886763, 0.99940220, 0.49325016],
-												 [	-6.27328121, -0.00037066, 0.00022707, 7.27291055, 0.99886777, 0.99940227, 0.49325010],
-												 [	-6.27328132, -0.00037062, 0.00022704, 7.27291070, 0.99886790, 0.99940234, 0.49325006],
-												 [	-6.27328142, -0.00037057, 0.00022701, 7.27291085, 0.99886804, 0.99940241, 0.49325022],
-												 [	-6.27328153, -0.00037053, 0.00022699, 7.27291100, 0.99886817, 0.99940248, 0.49325031],
-												 [	-6.27328163, -0.00037049, 0.00022696, 7.27291115, 0.99886831, 0.99940255, 0.49325037],
-												 [	-6.27328174, -0.00037044, 0.00022693, 7.27291130, 0.99886844, 0.99940263, 0.49325027],
-												 [	-6.27328185, -0.00037040, 0.00022691, 7.27291145, 0.99886858, 0.99940270, 0.49325034],
-												 [	-6.27328195, -0.00037035, 0.00022688, 7.27291160, 0.99886871, 0.99940277, 0.49325020],
-												 [	-6.27328206, -0.00037031, 0.00022685, 7.27291175, 0.99886885, 0.99940284, 0.49325035],
-												 [	-6.27328217, -0.00037026, 0.00022682, 7.27291190, 0.99886898, 0.99940291, 0.49325022],
-												 [	-6.27328227, -0.00037022, 0.00022680, 7.27291205, 0.99886912, 0.99940298, 0.49325038],
-												 [	-6.27328238, -0.00037018, 0.00022677, 7.27291220, 0.99886926, 0.99940305, 0.49325045],
-												 [	-6.27328248, -0.00037013, 0.00022674, 7.27291235, 0.99886939, 0.99940313, 0.49325055],
-												 [	-6.27328259, -0.00037009, 0.00022672, 7.27291250, 0.99886953, 0.99940320, 0.49325042],
-												 [	-6.27328269, -0.00037004, 0.00022669, 7.27291265, 0.99886966, 0.99940327, 0.49325036],
-												 [	-6.27328280, -0.00037000, 0.00022666, 7.27291280, 0.99886980, 0.99940334, 0.49325057],
-												 [	-6.27328291, -0.00036995, 0.00022663, 7.27291295, 0.99886993, 0.99940341, 0.49325047],
-												 [	-6.27328301, -0.00036991, 0.00022661, 7.27291310, 0.99887007, 0.99940348, 0.49325050],
-												 [	-6.27328312, -0.00036987, 0.00022658, 7.27291325, 0.99887020, 0.99940355, 0.49325044],
-												 [	-6.27328322, -0.00036982, 0.00022655, 7.27291340, 0.99887034, 0.99940363, 0.49325060],
-												 [	-6.27328333, -0.00036978, 0.00022653, 7.27291355, 0.99887047, 0.99940370, 0.49325046],
-												 [	-6.27328344, -0.00036973, 0.00022650, 7.27291370, 0.99887061, 0.99940377, 0.49325049],
-												 [	-6.27328354, -0.00036969, 0.00022647, 7.27291385, 0.99887074, 0.99940384, 0.49325054],
-												 [	-6.27328365, -0.00036965, 0.00022644, 7.27291400, 0.99887088, 0.99940391, 0.49325051],
-												 [	-6.27328375, -0.00036960, 0.00022642, 7.27291415, 0.99887101, 0.99940398, 0.49325068],
-												 [	-6.27328386, -0.00036956, 0.00022639, 7.27291430, 0.99887115, 0.99940405, 0.49325059],
-												 [	-6.27328396, -0.00036951, 0.00022636, 7.27291445, 0.99887128, 0.99940412, 0.49325082],
-												 [	-6.27328407, -0.00036947, 0.00022634, 7.27291460, 0.99887142, 0.99940419, 0.49325077],
-												 [	-6.27328418, -0.00036942, 0.00022631, 7.27291475, 0.99887155, 0.99940427, 0.49325076],
-												 [	-6.27328428, -0.00036938, 0.00022628, 7.27291490, 0.99887168, 0.99940434, 0.49325073],
-												 [	-6.27328439, -0.00036934, 0.00022626, 7.27291505, 0.99887182, 0.99940441, 0.49325073],
-												 [	-6.27328449, -0.00036929, 0.00022623, 7.27291520, 0.99887195, 0.99940448, 0.49325059],
-												 [	-6.27328460, -0.00036925, 0.00022620, 7.27291535, 0.99887209, 0.99940455, 0.49325071],
-												 [	-6.27328470, -0.00036920, 0.00022617, 7.27291550, 0.99887222, 0.99940462, 0.49325075],
-												 [	-6.27328481, -0.00036916, 0.00022615, 7.27291565, 0.99887236, 0.99940469, 0.49325074],
-												 [	-6.27328491, -0.00036912, 0.00022612, 7.27291580, 0.99887249, 0.99940476, 0.49325076],
-												 [	-6.27328502, -0.00036907, 0.00022609, 7.27291595, 0.99887263, 0.99940483, 0.49325069],
-												 [	-6.27328512, -0.00036903, 0.00022607, 7.27291610, 0.99887276, 0.99940491, 0.49325089],
-												 [	-6.27328523, -0.00036898, 0.00022604, 7.27291624, 0.99887290, 0.99940498, 0.49325087],
-												 [	-6.27328533, -0.00036894, 0.00022601, 7.27291639, 0.99887303, 0.99940505, 0.49325089],
-												 [	-6.27328544, -0.00036890, 0.00022599, 7.27291654, 0.99887316, 0.99940512, 0.49325087],
-												 [	-6.27328555, -0.00036885, 0.00022596, 7.27291669, 0.99887330, 0.99940519, 0.49325085],
-												 [	-6.27328565, -0.00036881, 0.00022593, 7.27291684, 0.99887343, 0.99940526, 0.49325080],
-												 [	-6.27328576, -0.00036876, 0.00022590, 7.27291699, 0.99887357, 0.99940533, 0.49325071],
-												 [	-6.27328586, -0.00036872, 0.00022588, 7.27291714, 0.99887370, 0.99940540, 0.49325095],
-												 [	-6.27328597, -0.00036868, 0.00022585, 7.27291729, 0.99887384, 0.99940547, 0.49325080],
-												 [	-6.27328607, -0.00036863, 0.00022582, 7.27291744, 0.99887397, 0.99940554, 0.49325088],
-												 [	-6.27328618, -0.00036859, 0.00022580, 7.27291759, 0.99887410, 0.99940561, 0.49325100],
-												 [	-6.27328628, -0.00036855, 0.00022577, 7.27291774, 0.99887424, 0.99940568, 0.49325106],
-												 [	-6.27328639, -0.00036850, 0.00022574, 7.27291789, 0.99887437, 0.99940576, 0.49325085],
-												 [	-6.27328649, -0.00036846, 0.00022572, 7.27291803, 0.99887451, 0.99940583, 0.49325087],
-												 [	-6.27328660, -0.00036841, 0.00022569, 7.27291818, 0.99887464, 0.99940590, 0.49325084],
-												 [	-6.27328670, -0.00036837, 0.00022566, 7.27291833, 0.99887477, 0.99940597, 0.49325118],
-												 [	-6.27328681, -0.00036833, 0.00022564, 7.27291848, 0.99887491, 0.99940604, 0.49325112],
-												 [	-6.27328691, -0.00036828, 0.00022561, 7.27291863, 0.99887504, 0.99940611, 0.49325104],
-												 [	-6.27328702, -0.00036824, 0.00022558, 7.27291878, 0.99887518, 0.99940618, 0.49325104],
-												 [	-6.27328712, -0.00036819, 0.00022556, 7.27291893, 0.99887531, 0.99940625, 0.49325116],
-												 [	-6.27328723, -0.00036815, 0.00022553, 7.27291907, 0.99887544, 0.99940632, 0.49325111],
-												 [	-6.27328733, -0.00036811, 0.00022550, 7.27291922, 0.99887558, 0.99940639, 0.49325116],
-												 [	-6.27328744, -0.00036806, 0.00022547, 7.27291937, 0.99887571, 0.99940646, 0.49325108],
-												 [	-6.27328754, -0.00036802, 0.00022545, 7.27291952, 0.99887584, 0.99940653, 0.49325111],
-												 [	-6.27328764, -0.00036798, 0.00022542, 7.27291967, 0.99887598, 0.99940660, 0.49325113],
-												 [	-6.27328775, -0.00036793, 0.00022539, 7.27291982, 0.99887611, 0.99940667, 0.49325130],
-												 [	-6.27328785, -0.00036789, 0.00022537, 7.27291997, 0.99887625, 0.99940674, 0.49325114],
-												 [	-6.27328796, -0.00036784, 0.00022534, 7.27292011, 0.99887638, 0.99940681, 0.49325125],
-												 [	-6.27328806, -0.00036780, 0.00022531, 7.27292026, 0.99887651, 0.99940689, 0.49325120],
-												 [	-6.27328817, -0.00036776, 0.00022529, 7.27292041, 0.99887665, 0.99940696, 0.49325118],
-												 [	-6.27328827, -0.00036771, 0.00022526, 7.27292056, 0.99887678, 0.99940703, 0.49325120],
-												 [	-6.27328838, -0.00036767, 0.00022523, 7.27292071, 0.99887691, 0.99940710, 0.49325135],
-												 [	-6.27328848, -0.00036763, 0.00022521, 7.27292086, 0.99887705, 0.99940717, 0.49325134],
-												 [	-6.27328859, -0.00036758, 0.00022518, 7.27292100, 0.99887718, 0.99940724, 0.49325139],
-												 [	-6.27328869, -0.00036754, 0.00022515, 7.27292115, 0.99887731, 0.99940731, 0.49325135],
-												 [	-6.27328880, -0.00036749, 0.00022513, 7.27292130, 0.99887745, 0.99940738, 0.49325126],
-												 [	-6.27328890, -0.00036745, 0.00022510, 7.27292145, 0.99887758, 0.99940745, 0.49325131],
-												 [	-6.27328900, -0.00036741, 0.00022507, 7.27292160, 0.99887771, 0.99940752, 0.49325136],
-												 [	-6.27328911, -0.00036736, 0.00022505, 7.27292174, 0.99887785, 0.99940759, 0.49325152],
-												 [	-6.27328921, -0.00036732, 0.00022502, 7.27292189, 0.99887798, 0.99940766, 0.49325159],
-												 [	-6.27328932, -0.00036728, 0.00022499, 7.27292204, 0.99887811, 0.99940773, 0.49325140],
-												 [	-6.27328942, -0.00036723, 0.00022497, 7.27292219, 0.99887825, 0.99940780, 0.49325141],
-												 [	-6.27328953, -0.00036719, 0.00022494, 7.27292234, 0.99887838, 0.99940787, 0.49325131],
-												 [	-6.27328963, -0.00036715, 0.00022491, 7.27292248, 0.99887851, 0.99940794, 0.49325145],
-												 [	-6.27328973, -0.00036710, 0.00022489, 7.27292263, 0.99887864, 0.99940801, 0.49325145],
-												 [	-6.27328984, -0.00036706, 0.00022486, 7.27292278, 0.99887878, 0.99940808, 0.49325157],
-												 [	-6.27328994, -0.00036702, 0.00022483, 7.27292293, 0.99887891, 0.99940815, 0.49325149],
-												 [	-6.27329005, -0.00036697, 0.00022481, 7.27292307, 0.99887904, 0.99940822, 0.49325164],
-												 [	-6.27329015, -0.00036693, 0.00022478, 7.27292322, 0.99887918, 0.99940829, 0.49325155],
-												 [	-6.27329025, -0.00036689, 0.00022475, 7.27292337, 0.99887931, 0.99940836, 0.49325164],
-												 [	-6.27329036, -0.00036684, 0.00022473, 7.27292352, 0.99887944, 0.99940843, 0.49325151],
-												 [	-6.27329046, -0.00036680, 0.00022470, 7.27292366, 0.99887958, 0.99940850, 0.49325168],
-												 [	-6.27329057, -0.00036675, 0.00022467, 7.27292381, 0.99887971, 0.99940857, 0.49325138],
-												 [	-6.27329067, -0.00036671, 0.00022465, 7.27292396, 0.99887984, 0.99940864, 0.49325171],
-												 [	-6.27329078, -0.00036667, 0.00022462, 7.27292411, 0.99887997, 0.99940871, 0.49325159],
-												 [	-6.27329088, -0.00036662, 0.00022459, 7.27292425, 0.99888011, 0.99940878, 0.49325160],
-												 [	-6.27329098, -0.00036658, 0.00022457, 7.27292440, 0.99888024, 0.99940885, 0.49325177],
-												 [	-6.27329109, -0.00036654, 0.00022454, 7.27292455, 0.99888037, 0.99940892, 0.49325177],
-												 [	-6.27329119, -0.00036649, 0.00022451, 7.27292470, 0.99888050, 0.99940899, 0.49325164],
-												 [	-6.27329129, -0.00036645, 0.00022449, 7.27292484, 0.99888064, 0.99940906, 0.49325172],
-												 [	-6.27329140, -0.00036641, 0.00022446, 7.27292499, 0.99888077, 0.99940913, 0.49325179],
-												 [	-6.27329150, -0.00036636, 0.00022443, 7.27292514, 0.99888090, 0.99940920, 0.49325181],
-												 [	-6.27329161, -0.00036632, 0.00022441, 7.27292529, 0.99888103, 0.99940927, 0.49325178],
-												 [	-6.27329171, -0.00036628, 0.00022438, 7.27292543, 0.99888117, 0.99940934, 0.49325178],
-												 [	-6.27329181, -0.00036623, 0.00022435, 7.27292558, 0.99888130, 0.99940941, 0.49325183],
-												 [	-6.27329192, -0.00036619, 0.00022433, 7.27292573, 0.99888143, 0.99940948, 0.49325179],
-												 [	-6.27329202, -0.00036615, 0.00022430, 7.27292587, 0.99888156, 0.99940955, 0.49325183],
-												 [	-6.27329212, -0.00036610, 0.00022427, 7.27292602, 0.99888170, 0.99940962, 0.49325178],
-												 [	-6.27329223, -0.00036606, 0.00022425, 7.27292617, 0.99888183, 0.99940969, 0.49325167],
-												 [	-6.27329233, -0.00036602, 0.00022422, 7.27292631, 0.99888196, 0.99940976, 0.49325180],
-												 [	-6.27329244, -0.00036597, 0.00022419, 7.27292646, 0.99888209, 0.99940983, 0.49325201],
-												 [	-6.27329254, -0.00036593, 0.00022417, 7.27292661, 0.99888222, 0.99940990, 0.49325190],
-												 [	-6.27329264, -0.00036589, 0.00022414, 7.27292675, 0.99888236, 0.99940997, 0.49325201],
-												 [	-6.27329275, -0.00036584, 0.00022412, 7.27292690, 0.99888249, 0.99941004, 0.49325203],
-												 [	-6.27329285, -0.00036580, 0.00022409, 7.27292705, 0.99888262, 0.99941011, 0.49325195],
-												 [	-6.27329295, -0.00036576, 0.00022406, 7.27292720, 0.99888275, 0.99941018, 0.49325194],
-												 [	-6.27329306, -0.00036571, 0.00022404, 7.27292734, 0.99888289, 0.99941025, 0.49325187],
-												 [	-6.27329316, -0.00036567, 0.00022401, 7.27292749, 0.99888302, 0.99941032, 0.49325203],
-												 [	-6.27329326, -0.00036563, 0.00022398, 7.27292764, 0.99888315, 0.99941039, 0.49325193],
-												 [	-6.27329337, -0.00036559, 0.00022396, 7.27292778, 0.99888328, 0.99941046, 0.49325192],
-												 [	-6.27329347, -0.00036554, 0.00022393, 7.27292793, 0.99888341, 0.99941053, 0.49325212],
-												 [	-6.27329357, -0.00036550, 0.00022390, 7.27292807, 0.99888355, 0.99941060, 0.49325192],
-												 [	-6.27329368, -0.00036546, 0.00022388, 7.27292822, 0.99888368, 0.99941067, 0.49325204],
-												 [	-6.27329378, -0.00036541, 0.00022385, 7.27292837, 0.99888381, 0.99941074, 0.49325210],
-												 [	-6.27329388, -0.00036537, 0.00022382, 7.27292851, 0.99888394, 0.99941081, 0.49325200],
-												 [	-6.27329399, -0.00036533, 0.00022380, 7.27292866, 0.99888407, 0.99941088, 0.49325216],
-												 [	-6.27329409, -0.00036528, 0.00022377, 7.27292881, 0.99888420, 0.99941095, 0.49325212],
-												 [	-6.27329419, -0.00036524, 0.00022374, 7.27292895, 0.99888434, 0.99941102, 0.49325214],
-												 [	-6.27329430, -0.00036520, 0.00022372, 7.27292910, 0.99888447, 0.99941108, 0.49325208],
-												 [	-6.27329440, -0.00036515, 0.00022369, 7.27292925, 0.99888460, 0.99941115, 0.49325230],
-												 [	-6.27329450, -0.00036511, 0.00022367, 7.27292939, 0.99888473, 0.99941122, 0.49325225],
-												 [	-6.27329461, -0.00036507, 0.00022364, 7.27292954, 0.99888486, 0.99941129, 0.49325212],
-												 [	-6.27329471, -0.00036502, 0.00022361, 7.27292968, 0.99888499, 0.99941136, 0.49325221],
-												 [	-6.27329481, -0.00036498, 0.00022359, 7.27292983, 0.99888513, 0.99941143, 0.49325215],
-												 [	-6.27329491, -0.00036494, 0.00022356, 7.27292998, 0.99888526, 0.99941150, 0.49325228],
-												 [	-6.27329502, -0.00036490, 0.00022353, 7.27293012, 0.99888539, 0.99941157, 0.49325236],
-												 [	-6.27329512, -0.00036485, 0.00022351, 7.27293027, 0.99888552, 0.99941164, 0.49325238],
-												 [	-6.27329522, -0.00036481, 0.00022348, 7.27293041, 0.99888565, 0.99941171, 0.49325230],
-												 [	-6.27329533, -0.00036477, 0.00022345, 7.27293056, 0.99888578, 0.99941178, 0.49325233],
-												 [	-6.27329543, -0.00036472, 0.00022343, 7.27293071, 0.99888591, 0.99941185, 0.49325243],
-												 [	-6.27329553, -0.00036468, 0.00022340, 7.27293085, 0.99888605, 0.99941192, 0.49325248],
-												 [	-6.27329564, -0.00036464, 0.00022338, 7.27293100, 0.99888618, 0.99941199, 0.49325226],
-												 [	-6.27329574, -0.00036460, 0.00022335, 7.27293114, 0.99888631, 0.99941206, 0.49325247],
-												 [	-6.27329584, -0.00036455, 0.00022332, 7.27293129, 0.99888644, 0.99941213, 0.49325235],
-												 [	-6.27329594, -0.00036451, 0.00022330, 7.27293143, 0.99888657, 0.99941219, 0.49325238],
-												 [	-6.27329605, -0.00036447, 0.00022327, 7.27293158, 0.99888670, 0.99941226, 0.49325236],
-												 [	-6.27329615, -0.00036442, 0.00022324, 7.27293173, 0.99888683, 0.99941233, 0.49325251],
-												 [	-6.27329625, -0.00036438, 0.00022322, 7.27293187, 0.99888696, 0.99941240, 0.49325244],
-												 [	-6.27329635, -0.00036434, 0.00022319, 7.27293202, 0.99888709, 0.99941247, 0.49325243],
-												 [	-6.27329646, -0.00036429, 0.00022317, 7.27293216, 0.99888723, 0.99941254, 0.49325235],
-												 [	-6.27329656, -0.00036425, 0.00022314, 7.27293231, 0.99888736, 0.99941261, 0.49325265],
-												 [	-6.27329666, -0.00036421, 0.00022311, 7.27293245, 0.99888749, 0.99941268, 0.49325266],
-												 [	-6.27329677, -0.00036417, 0.00022309, 7.27293260, 0.99888762, 0.99941275, 0.49325241],
-												 [	-6.27329687, -0.00036412, 0.00022306, 7.27293274, 0.99888775, 0.99941282, 0.49325251],
-												 [	-6.27329697, -0.00036408, 0.00022303, 7.27293289, 0.99888788, 0.99941289, 0.49325244],
-												 [	-6.27329707, -0.00036404, 0.00022301, 7.27293304, 0.99888801, 0.99941295, 0.49325256],
-												 [	-6.27329718, -0.00036399, 0.00022298, 7.27293318, 0.99888814, 0.99941302, 0.49325261],
-												 [	-6.27329728, -0.00036395, 0.00022296, 7.27293333, 0.99888827, 0.99941309, 0.49325262],
-												 [	-6.27329738, -0.00036391, 0.00022293, 7.27293347, 0.99888840, 0.99941316, 0.49325272],
-												 [	-6.27329748, -0.00036387, 0.00022290, 7.27293362, 0.99888853, 0.99941323, 0.49325264],
-												 [	-6.27329758, -0.00036382, 0.00022288, 7.27293376, 0.99888866, 0.99941330, 0.49325271],
-												 [	-6.27329769, -0.00036378, 0.00022285, 7.27293391, 0.99888879, 0.99941337, 0.49325250],
-												 [	-6.27329779, -0.00036374, 0.00022282, 7.27293405, 0.99888893, 0.99941344, 0.49325276],
-												 [	-6.27329789, -0.00036370, 0.00022280, 7.27293420, 0.99888906, 0.99941351, 0.49325279],
-												 [	-6.27329799, -0.00036365, 0.00022277, 7.27293434, 0.99888919, 0.99941358, 0.49325256],
-												 [	-6.27329810, -0.00036361, 0.00022275, 7.27293449, 0.99888932, 0.99941364, 0.49325269],
-												 [	-6.27329820, -0.00036357, 0.00022272, 7.27293463, 0.99888945, 0.99941371, 0.49325274],
-												 [	-6.27329830, -0.00036352, 0.00022269, 7.27293478, 0.99888958, 0.99941378, 0.49325276],
-												 [	-6.27329840, -0.00036348, 0.00022267, 7.27293492, 0.99888971, 0.99941385, 0.49325275],
-												 [	-6.27329851, -0.00036344, 0.00022264, 7.27293507, 0.99888984, 0.99941392, 0.49325266],
-												 [	-6.27329861, -0.00036340, 0.00022261, 7.27293521, 0.99888997, 0.99941399, 0.49325274],
-												 [	-6.27329871, -0.00036335, 0.00022259, 7.27293536, 0.99889010, 0.99941406, 0.49325275],
-												 [	-6.27329881, -0.00036331, 0.00022256, 7.27293550, 0.99889023, 0.99941413, 0.49325279],
-												 [	-6.27329891, -0.00036327, 0.00022254, 7.27293565, 0.99889036, 0.99941420, 0.49325277],
-												 [	-6.27329902, -0.00036323, 0.00022251, 7.27293579, 0.99889049, 0.99941426, 0.49325299],
-												 [	-6.27329912, -0.00036318, 0.00022248, 7.27293593, 0.99889062, 0.99941433, 0.49325298],
-												 [	-6.27329922, -0.00036314, 0.00022246, 7.27293608, 0.99889075, 0.99941440, 0.49325274],
-												 [	-6.27329932, -0.00036310, 0.00022243, 7.27293622, 0.99889088, 0.99941447, 0.49325294],
-												 [	-6.27329942, -0.00036306, 0.00022241, 7.27293637, 0.99889101, 0.99941454, 0.49325297],
-												 [	-6.27329953, -0.00036301, 0.00022238, 7.27293651, 0.99889114, 0.99941461, 0.49325278],
-												 [	-6.27329963, -0.00036297, 0.00022235, 7.27293666, 0.99889127, 0.99941468, 0.49325281],
-												 [	-6.27329973, -0.00036293, 0.00022233, 7.27293680, 0.99889140, 0.99941474, 0.49325304],
-												 [	-6.27329983, -0.00036289, 0.00022230, 7.27293695, 0.99889153, 0.99941481, 0.49325295],
-												 [	-6.27329993, -0.00036284, 0.00022228, 7.27293709, 0.99889166, 0.99941488, 0.49325311],
-												 [	-6.27330004, -0.00036280, 0.00022225, 7.27293723, 0.99889179, 0.99941495, 0.49325291],
-												 [	-6.27330014, -0.00036276, 0.00022222, 7.27293738, 0.99889192, 0.99941502, 0.49325317],
-												 [	-6.27330024, -0.00036272, 0.00022220, 7.27293752, 0.99889205, 0.99941509, 0.49325298],
-												 [	-6.27330034, -0.00036267, 0.00022217, 7.27293767, 0.99889218, 0.99941516, 0.49325316],
-												 [	-6.27330044, -0.00036263, 0.00022215, 7.27293781, 0.99889231, 0.99941522, 0.49325310],
-												 [	-6.27330054, -0.00036259, 0.00022212, 7.27293796, 0.99889244, 0.99941529, 0.49325314],
-												 [	-6.27330065, -0.00036255, 0.00022209, 7.27293810, 0.99889257, 0.99941536, 0.49325310],
-												 [	-6.27330075, -0.00036250, 0.00022207, 7.27293824, 0.99889270, 0.99941543, 0.49325300],
-												 [	-6.27330085, -0.00036246, 0.00022204, 7.27293839, 0.99889283, 0.99941550, 0.49325323],
-												 [	-6.27330095, -0.00036242, 0.00022202, 7.27293853, 0.99889296, 0.99941557, 0.49325313],
-												 [	-6.27330105, -0.00036238, 0.00022199, 7.27293868, 0.99889309, 0.99941564, 0.49325318],
-												 [	-6.27330115, -0.00036233, 0.00022196, 7.27293882, 0.99889322, 0.99941570, 0.49325325],
-												 [	-6.27330126, -0.00036229, 0.00022194, 7.27293896, 0.99889335, 0.99941577, 0.49325315],
-												 [	-6.27330136, -0.00036225, 0.00022191, 7.27293911, 0.99889348, 0.99941584, 0.49325312],
-												 [	-6.27330146, -0.00036221, 0.00022189, 7.27293925, 0.99889361, 0.99941591, 0.49325327],
-												 [	-6.27330156, -0.00036216, 0.00022186, 7.27293940, 0.99889374, 0.99941598, 0.49325334],
-												 [	-6.27330166, -0.00036212, 0.00022183, 7.27293954, 0.99889387, 0.99941605, 0.49325318],
-												 [	-6.27330176, -0.00036208, 0.00022181, 7.27293968, 0.99889400, 0.99941611, 0.49325339],
-												 [	-6.27330186, -0.00036204, 0.00022178, 7.27293983, 0.99889412, 0.99941618, 0.49325320],
-												 [	-6.27330197, -0.00036199, 0.00022176, 7.27293997, 0.99889425, 0.99941625, 0.49325327],
-												 [	-6.27330207, -0.00036195, 0.00022173, 7.27294011, 0.99889438, 0.99941632, 0.49325329],
-												 [	-6.27330217, -0.00036191, 0.00022170, 7.27294026, 0.99889451, 0.99941639, 0.49325333],
-												 [	-6.27330227, -0.00036187, 0.00022168, 7.27294040, 0.99889464, 0.99941646, 0.49325330],
-												 [	-6.27330237, -0.00036182, 0.00022165, 7.27294055, 0.99889477, 0.99941652, 0.49325321],
-												 [	-6.27330247, -0.00036178, 0.00022163, 7.27294069, 0.99889490, 0.99941659, 0.49325343],
-												 [	-6.27330257, -0.00036174, 0.00022160, 7.27294083, 0.99889503, 0.99941666, 0.49325334],
-												 [	-6.27330267, -0.00036170, 0.00022157, 7.27294098, 0.99889516, 0.99941673, 0.49325333],
-												 [	-6.27330278, -0.00036166, 0.00022155, 7.27294112, 0.99889529, 0.99941680, 0.49325328],
-												 [	-6.27330288, -0.00036161, 0.00022152, 7.27294126, 0.99889542, 0.99941686, 0.49325344],
-												 [	-6.27330298, -0.00036157, 0.00022150, 7.27294141, 0.99889555, 0.99941693, 0.49325340],
-												 [	-6.27330308, -0.00036153, 0.00022147, 7.27294155, 0.99889568, 0.99941700, 0.49325337],
-												 [	-6.27330318, -0.00036149, 0.00022144, 7.27294169, 0.99889580, 0.99941707, 0.49325346],
-												 [	-6.27330328, -0.00036144, 0.00022142, 7.27294184, 0.99889593, 0.99941714, 0.49325350],
-												 [	-6.27330338, -0.00036140, 0.00022139, 7.27294198, 0.99889606, 0.99941720, 0.49325355],
-												 [	-6.27330348, -0.00036136, 0.00022137, 7.27294212, 0.99889619, 0.99941727, 0.49325362],
-												 [	-6.27330358, -0.00036132, 0.00022134, 7.27294227, 0.99889632, 0.99941734, 0.49325356],
-												 [	-6.27330368, -0.00036128, 0.00022132, 7.27294241, 0.99889645, 0.99941741, 0.49325360],
-												 [	-6.27330379, -0.00036123, 0.00022129, 7.27294255, 0.99889658, 0.99941748, 0.49325348],
-												 [	-6.27330389, -0.00036119, 0.00022126, 7.27294269, 0.99889671, 0.99941754, 0.49325378],
-												 [	-6.27330399, -0.00036115, 0.00022124, 7.27294284, 0.99889684, 0.99941761, 0.49325364],
-												 [	-6.27330409, -0.00036111, 0.00022121, 7.27294298, 0.99889696, 0.99941768, 0.49325361],
-												 [	-6.27330419, -0.00036107, 0.00022119, 7.27294312, 0.99889709, 0.99941775, 0.49325386],
-												 [	-6.27330429, -0.00036102, 0.00022116, 7.27294327, 0.99889722, 0.99941782, 0.49325359],
-												 [	-6.27330439, -0.00036098, 0.00022113, 7.27294341, 0.99889735, 0.99941788, 0.49325371],
-												 [	-6.27330449, -0.00036094, 0.00022111, 7.27294355, 0.99889748, 0.99941795, 0.49325375],
-												 [	-6.27330459, -0.00036090, 0.00022108, 7.27294370, 0.99889761, 0.99941802, 0.49325371],
-												 [	-6.27330469, -0.00036085, 0.00022106, 7.27294384, 0.99889774, 0.99941809, 0.49325378],
-												 [	-6.27330479, -0.00036081, 0.00022103, 7.27294398, 0.99889786, 0.99941816, 0.49325370],
-												 [	-6.27330489, -0.00036077, 0.00022101, 7.27294412, 0.99889799, 0.99941822, 0.49325364],
-												 [	-6.27330499, -0.00036073, 0.00022098, 7.27294427, 0.99889812, 0.99941829, 0.49325373],
-												 [	-6.27330510, -0.00036069, 0.00022095, 7.27294441, 0.99889825, 0.99941836, 0.49325372],
-												 [	-6.27330520, -0.00036064, 0.00022093, 7.27294455, 0.99889838, 0.99941843, 0.49325391],
-												 [	-6.27330530, -0.00036060, 0.00022090, 7.27294469, 0.99889851, 0.99941849, 0.49325378],
-												 [	-6.27330540, -0.00036056, 0.00022088, 7.27294484, 0.99889863, 0.99941856, 0.49325387],
-												 [	-6.27330550, -0.00036052, 0.00022085, 7.27294498, 0.99889876, 0.99941863, 0.49325370],
-												 [	-6.27330560, -0.00036048, 0.00022083, 7.27294512, 0.99889889, 0.99941870, 0.49325386],
-												 [	-6.27330570, -0.00036043, 0.00022080, 7.27294526, 0.99889902, 0.99941877, 0.49325387],
-												 [	-6.27330580, -0.00036039, 0.00022077, 7.27294541, 0.99889915, 0.99941883, 0.49325384],
-												 [	-6.27330590, -0.00036035, 0.00022075, 7.27294555, 0.99889928, 0.99941890, 0.49325392],
-												 [	-6.27330600, -0.00036031, 0.00022072, 7.27294569, 0.99889940, 0.99941897, 0.49325387],
-												 [	-6.27330610, -0.00036027, 0.00022070, 7.27294583, 0.99889953, 0.99941904, 0.49325390],
-												 [	-6.27330620, -0.00036023, 0.00022067, 7.27294598, 0.99889966, 0.99941910, 0.49325400],
-												 [	-6.27330630, -0.00036018, 0.00022065, 7.27294612, 0.99889979, 0.99941917, 0.49325409],
-												 [	-6.27330640, -0.00036014, 0.00022062, 7.27294626, 0.99889992, 0.99941924, 0.49325386],
-												 [	-6.27330650, -0.00036010, 0.00022059, 7.27294640, 0.99890004, 0.99941931, 0.49325408],
-												 [	-6.27330660, -0.00036006, 0.00022057, 7.27294654, 0.99890017, 0.99941937, 0.49325391],
-												 [	-6.27330670, -0.00036002, 0.00022054, 7.27294669, 0.99890030, 0.99941944, 0.49325389],
-												 [	-6.27330680, -0.00035997, 0.00022052, 7.27294683, 0.99890043, 0.99941951, 0.49325379],
-												 [	-6.27330690, -0.00035993, 0.00022049, 7.27294697, 0.99890056, 0.99941958, 0.49325409],
-												 [	-6.27330700, -0.00035989, 0.00022047, 7.27294711, 0.99890068, 0.99941964, 0.49325388],
-												 [	-6.27330710, -0.00035985, 0.00022044, 7.27294726, 0.99890081, 0.99941971, 0.49325402],
-												 [	-6.27330720, -0.00035981, 0.00022041, 7.27294740, 0.99890094, 0.99941978, 0.49325423],
-												 [	-6.27330730, -0.00035976, 0.00022039, 7.27294754, 0.99890107, 0.99941985, 0.49325405],
-												 [	-6.27330740, -0.00035972, 0.00022036, 7.27294768, 0.99890119, 0.99941991, 0.49325402],
-												 [	-6.27330750, -0.00035968, 0.00022034, 7.27294782, 0.99890132, 0.99941998, 0.49325409],
-												 [	-6.27330760, -0.00035964, 0.00022031, 7.27294796, 0.99890145, 0.99942005, 0.49325408],
-												 [	-6.27330770, -0.00035960, 0.00022029, 7.27294811, 0.99890158, 0.99942012, 0.49325430],
-												 [	-6.27330780, -0.00035956, 0.00022026, 7.27294825, 0.99890171, 0.99942018, 0.49325412],
-												 [	-6.27330790, -0.00035951, 0.00022024, 7.27294839, 0.99890183, 0.99942025, 0.49325410],
-												 [	-6.27330800, -0.00035947, 0.00022021, 7.27294853, 0.99890196, 0.99942032, 0.49325444],
-												 [	-6.27330810, -0.00035943, 0.00022018, 7.27294867, 0.99890209, 0.99942039, 0.49325431],
-												 [	-6.27330820, -0.00035939, 0.00022016, 7.27294882, 0.99890222, 0.99942045, 0.49325422],
-												 [	-6.27330830, -0.00035935, 0.00022013, 7.27294896, 0.99890234, 0.99942052, 0.49325435],
-												 [	-6.27330840, -0.00035931, 0.00022011, 7.27294910, 0.99890247, 0.99942059, 0.49325426],
-												 [	-6.27330850, -0.00035926, 0.00022008, 7.27294924, 0.99890260, 0.99942065, 0.49325433],
-												 [	-6.27330860, -0.00035922, 0.00022006, 7.27294938, 0.99890273, 0.99942072, 0.49325432],
-												 [	-6.27330870, -0.00035918, 0.00022003, 7.27294952, 0.99890285, 0.99942079, 0.49325444],
-												 [	-6.27330880, -0.00035914, 0.00022001, 7.27294966, 0.99890298, 0.99942086, 0.49325435],
-												 [	-6.27330890, -0.00035910, 0.00021998, 7.27294981, 0.99890311, 0.99942092, 0.49325422],
-												 [	-6.27330900, -0.00035906, 0.00021995, 7.27294995, 0.99890323, 0.99942099, 0.49325439],
-												 [	-6.27330910, -0.00035901, 0.00021993, 7.27295009, 0.99890336, 0.99942106, 0.49325438],
-												 [	-6.27330920, -0.00035897, 0.00021990, 7.27295023, 0.99890349, 0.99942113, 0.49325454],
-												 [	-6.27330930, -0.00035893, 0.00021988, 7.27295037, 0.99890362, 0.99942119, 0.49325448],
-												 [	-6.27330940, -0.00035889, 0.00021985, 7.27295051, 0.99890374, 0.99942126, 0.49325441],
-												 [	-6.27330950, -0.00035885, 0.00021983, 7.27295065, 0.99890387, 0.99942133, 0.49325438],
-												 [	-6.27330960, -0.00035881, 0.00021980, 7.27295079, 0.99890400, 0.99942139, 0.49325444],
-												 [	-6.27330970, -0.00035876, 0.00021978, 7.27295094, 0.99890412, 0.99942146, 0.49325455],
-												 [	-6.27330980, -0.00035872, 0.00021975, 7.27295108, 0.99890425, 0.99942153, 0.49325435],
-												 [	-6.27330990, -0.00035868, 0.00021972, 7.27295122, 0.99890438, 0.99942159, 0.49325446],
-												 [	-6.27331000, -0.00035864, 0.00021970, 7.27295136, 0.99890451, 0.99942166, 0.49325463],
-												 [	-6.27331010, -0.00035860, 0.00021967, 7.27295150, 0.99890463, 0.99942173, 0.49325459],
-												 [	-6.27331020, -0.00035856, 0.00021965, 7.27295164, 0.99890476, 0.99942180, 0.49325444],
-												 [	-6.27331030, -0.00035851, 0.00021962, 7.27295178, 0.99890489, 0.99942186, 0.49325446],
-												 [	-6.27331040, -0.00035847, 0.00021960, 7.27295192, 0.99890501, 0.99942193, 0.49325470],
-												 [	-6.27331050, -0.00035843, 0.00021957, 7.27295206, 0.99890514, 0.99942200, 0.49325447],
-												 [	-6.27331059, -0.00035839, 0.00021955, 7.27295220, 0.99890527, 0.99942206, 0.49325451],
-												 [	-6.27331069, -0.00035835, 0.00021952, 7.27295235, 0.99890539, 0.99942213, 0.49325471],
-												 [	-6.27331079, -0.00035831, 0.00021950, 7.27295249, 0.99890552, 0.99942220, 0.49325479],
-												 [	-6.27331089, -0.00035827, 0.00021947, 7.27295263, 0.99890565, 0.99942226, 0.49325465],
-												 [	-6.27331099, -0.00035822, 0.00021944, 7.27295277, 0.99890577, 0.99942233, 0.49325460],
-												 [	-6.27331109, -0.00035818, 0.00021942, 7.27295291, 0.99890590, 0.99942240, 0.49325463],
-												 [	-6.27331119, -0.00035814, 0.00021939, 7.27295305, 0.99890603, 0.99942246, 0.49325475],
-												 [	-6.27331129, -0.00035810, 0.00021937, 7.27295319, 0.99890615, 0.99942253, 0.49325484],
-												 [	-6.27331139, -0.00035806, 0.00021934, 7.27295333, 0.99890628, 0.99942260, 0.49325478],
-												 [	-6.27331149, -0.00035802, 0.00021932, 7.27295347, 0.99890641, 0.99942267, 0.49325476],
-												 [	-6.27331159, -0.00035798, 0.00021929, 7.27295361, 0.99890653, 0.99942273, 0.49325474],
-												 [	-6.27331169, -0.00035793, 0.00021927, 7.27295375, 0.99890666, 0.99942280, 0.49325471],
-												 [	-6.27331179, -0.00035789, 0.00021924, 7.27295389, 0.99890679, 0.99942287, 0.49325479],
-												 [	-6.27331188, -0.00035785, 0.00021922, 7.27295403, 0.99890691, 0.99942293, 0.49325475],
-												 [	-6.27331198, -0.00035781, 0.00021919, 7.27295417, 0.99890704, 0.99942300, 0.49325483],
-												 [	-6.27331208, -0.00035777, 0.00021917, 7.27295431, 0.99890717, 0.99942307, 0.49325488],
-												 [	-6.27331218, -0.00035773, 0.00021914, 7.27295445, 0.99890729, 0.99942313, 0.49325468],
-												 [	-6.27331228, -0.00035769, 0.00021911, 7.27295459, 0.99890742, 0.99942320, 0.49325487],
-												 [	-6.27331238, -0.00035764, 0.00021909, 7.27295473, 0.99890754, 0.99942327, 0.49325491],
-												 [	-6.27331248, -0.00035760, 0.00021906, 7.27295487, 0.99890767, 0.99942333, 0.49325485],
-												 [	-6.27331258, -0.00035756, 0.00021904, 7.27295501, 0.99890780, 0.99942340, 0.49325494],
-												 [	-6.27331268, -0.00035752, 0.00021901, 7.27295515, 0.99890792, 0.99942347, 0.49325489],
-												 [	-6.27331277, -0.00035748, 0.00021899, 7.27295529, 0.99890805, 0.99942353, 0.49325507],
-												 [	-6.27331287, -0.00035744, 0.00021896, 7.27295544, 0.99890818, 0.99942360, 0.49325487],
-												 [	-6.27331297, -0.00035740, 0.00021894, 7.27295558, 0.99890830, 0.99942367, 0.49325485],
-												 [	-6.27331307, -0.00035736, 0.00021891, 7.27295572, 0.99890843, 0.99942373, 0.49325494],
-												 [	-6.27331317, -0.00035731, 0.00021889, 7.27295586, 0.99890855, 0.99942380, 0.49325502],
-												 [	-6.27331327, -0.00035727, 0.00021886, 7.27295600, 0.99890868, 0.99942386, 0.49325506],
-												 [	-6.27331337, -0.00035723, 0.00021884, 7.27295614, 0.99890881, 0.99942393, 0.49325501],
-												 [	-6.27331347, -0.00035719, 0.00021881, 7.27295628, 0.99890893, 0.99942400, 0.49325503],
-												 [	-6.27331356, -0.00035715, 0.00021879, 7.27295642, 0.99890906, 0.99942406, 0.49325490],
-												 [	-6.27331366, -0.00035711, 0.00021876, 7.27295655, 0.99890918, 0.99942413, 0.49325500],
-												 [	-6.27331376, -0.00035707, 0.00021874, 7.27295669, 0.99890931, 0.99942420, 0.49325510],
-												 [	-6.27331386, -0.00035703, 0.00021871, 7.27295683, 0.99890943, 0.99942426, 0.49325499],
-												 [	-6.27331396, -0.00035698, 0.00021869, 7.27295697, 0.99890956, 0.99942433, 0.49325505],
-												 [	-6.27331406, -0.00035694, 0.00021866, 7.27295711, 0.99890969, 0.99942440, 0.49325506],
-												 [	-6.27331416, -0.00035690, 0.00021863, 7.27295725, 0.99890981, 0.99942446, 0.49325523],
-												 [	-6.27331425, -0.00035686, 0.00021861, 7.27295739, 0.99890994, 0.99942453, 0.49325511],
-												 [	-6.27331435, -0.00035682, 0.00021858, 7.27295753, 0.99891006, 0.99942460, 0.49325502],
-												 [	-6.27331445, -0.00035678, 0.00021856, 7.27295767, 0.99891019, 0.99942466, 0.49325512],
-												 [	-6.27331455, -0.00035674, 0.00021853, 7.27295781, 0.99891032, 0.99942473, 0.49325535],
-												 [	-6.27331465, -0.00035670, 0.00021851, 7.27295795, 0.99891044, 0.99942479, 0.49325526],
-												 [	-6.27331475, -0.00035666, 0.00021848, 7.27295809, 0.99891057, 0.99942486, 0.49325504],
-												 [	-6.27331485, -0.00035661, 0.00021846, 7.27295823, 0.99891069, 0.99942493, 0.49325512],
-												 [	-6.27331494, -0.00035657, 0.00021843, 7.27295837, 0.99891082, 0.99942499, 0.49325533],
-												 [	-6.27331504, -0.00035653, 0.00021841, 7.27295851, 0.99891094, 0.99942506, 0.49325523],
-												 [	-6.27331514, -0.00035649, 0.00021838, 7.27295865, 0.99891107, 0.99942513, 0.49325528],
-												 [	-6.27331524, -0.00035645, 0.00021836, 7.27295879, 0.99891119, 0.99942519, 0.49325526],
-												 [	-6.27331534, -0.00035641, 0.00021833, 7.27295893, 0.99891132, 0.99942526, 0.49325527],
-												 [	-6.27331543, -0.00035637, 0.00021831, 7.27295907, 0.99891144, 0.99942532, 0.49325541],
-												 [	-6.27331553, -0.00035633, 0.00021828, 7.27295921, 0.99891157, 0.99942539, 0.49325526],
-												 [	-6.27331563, -0.00035629, 0.00021826, 7.27295935, 0.99891169, 0.99942546, 0.49325518],
-												 [	-6.27331573, -0.00035625, 0.00021823, 7.27295948, 0.99891182, 0.99942552, 0.49325527],
-												 [	-6.27331583, -0.00035620, 0.00021821, 7.27295962, 0.99891195, 0.99942559, 0.49325543],
-												 [	-6.27331593, -0.00035616, 0.00021818, 7.27295976, 0.99891207, 0.99942566, 0.49325535],
-												 [	-6.27331602, -0.00035612, 0.00021816, 7.27295990, 0.99891220, 0.99942572, 0.49325531],
-												 [	-6.27331612, -0.00035608, 0.00021813, 7.27296004, 0.99891232, 0.99942579, 0.49325537],
-												 [	-6.27331622, -0.00035604, 0.00021811, 7.27296018, 0.99891245, 0.99942585, 0.49325536],
-												 [	-6.27331632, -0.00035600, 0.00021808, 7.27296032, 0.99891257, 0.99942592, 0.49325546],
-												 [	-6.27331642, -0.00035596, 0.00021806, 7.27296046, 0.99891270, 0.99942599, 0.49325549],
-												 [	-6.27331651, -0.00035592, 0.00021803, 7.27296060, 0.99891282, 0.99942605, 0.49325546],
-												 [	-6.27331661, -0.00035588, 0.00021801, 7.27296074, 0.99891295, 0.99942612, 0.49325542],
-												 [	-6.27331671, -0.00035584, 0.00021798, 7.27296087, 0.99891307, 0.99942618, 0.49325537],
-												 [	-6.27331681, -0.00035579, 0.00021796, 7.27296101, 0.99891320, 0.99942625, 0.49325535],
-												 [	-6.27331691, -0.00035575, 0.00021793, 7.27296115, 0.99891332, 0.99942632, 0.49325540],
-												 [	-6.27331700, -0.00035571, 0.00021791, 7.27296129, 0.99891345, 0.99942638, 0.49325546],
-												 [	-6.27331710, -0.00035567, 0.00021788, 7.27296143, 0.99891357, 0.99942645, 0.49325545],
-												 [	-6.27331720, -0.00035563, 0.00021786, 7.27296157, 0.99891370, 0.99942651, 0.49325569],
-												 [	-6.27331730, -0.00035559, 0.00021783, 7.27296171, 0.99891382, 0.99942658, 0.49325550],
-												 [	-6.27331740, -0.00035555, 0.00021781, 7.27296185, 0.99891395, 0.99942664, 0.49325563],
-												 [	-6.27331749, -0.00035551, 0.00021778, 7.27296198, 0.99891407, 0.99942671, 0.49325568],
-												 [	-6.27331759, -0.00035547, 0.00021776, 7.27296212, 0.99891420, 0.99942678, 0.49325547],
-												 [	-6.27331769, -0.00035543, 0.00021773, 7.27296226, 0.99891432, 0.99942684, 0.49325550],
-												 [	-6.27331779, -0.00035539, 0.00021771, 7.27296240, 0.99891444, 0.99942691, 0.49325571],
-												 [	-6.27331788, -0.00035535, 0.00021768, 7.27296254, 0.99891457, 0.99942697, 0.49325568],
-												 [	-6.27331798, -0.00035530, 0.00021766, 7.27296268, 0.99891469, 0.99942704, 0.49325562],
-												 [	-6.27331808, -0.00035526, 0.00021763, 7.27296281, 0.99891482, 0.99942711, 0.49325569],
-												 [	-6.27331818, -0.00035522, 0.00021761, 7.27296295, 0.99891494, 0.99942717, 0.49325576],
-												 [	-6.27331827, -0.00035518, 0.00021758, 7.27296309, 0.99891507, 0.99942724, 0.49325584],
-												 [	-6.27331837, -0.00035514, 0.00021756, 7.27296323, 0.99891519, 0.99942730, 0.49325572],
-												 [	-6.27331847, -0.00035510, 0.00021753, 7.27296337, 0.99891532, 0.99942737, 0.49325557],
-												 [	-6.27331857, -0.00035506, 0.00021751, 7.27296351, 0.99891544, 0.99942743, 0.49325555],
-												 [	-6.27331866, -0.00035502, 0.00021748, 7.27296364, 0.99891557, 0.99942750, 0.49325590],
-												 [	-6.27331876, -0.00035498, 0.00021746, 7.27296378, 0.99891569, 0.99942757, 0.49325582],
-												 [	-6.27331886, -0.00035494, 0.00021743, 7.27296392, 0.99891581, 0.99942763, 0.49325599],
-												 [	-6.27331896, -0.00035490, 0.00021741, 7.27296406, 0.99891594, 0.99942770, 0.49325596],
-												 [	-6.27331905, -0.00035486, 0.00021738, 7.27296420, 0.99891606, 0.99942776, 0.49325600],
-												 [	-6.27331915, -0.00035482, 0.00021736, 7.27296434, 0.99891619, 0.99942783, 0.49325578],
-												 [	-6.27331925, -0.00035478, 0.00021733, 7.27296447, 0.99891631, 0.99942789, 0.49325597],
-												 [	-6.27331935, -0.00035473, 0.00021731, 7.27296461, 0.99891644, 0.99942796, 0.49325578],
-												 [	-6.27331944, -0.00035469, 0.00021728, 7.27296475, 0.99891656, 0.99942802, 0.49325601],
-												 [	-6.27331954, -0.00035465, 0.00021726, 7.27296489, 0.99891668, 0.99942809, 0.49325574],
-												 [	-6.27331964, -0.00035461, 0.00021723, 7.27296503, 0.99891681, 0.99942816, 0.49325598],
-												 [	-6.27331974, -0.00035457, 0.00021721, 7.27296516, 0.99891693, 0.99942822, 0.49325602],
-												 [	-6.27331983, -0.00035453, 0.00021718, 7.27296530, 0.99891706, 0.99942829, 0.49325595],
-												 [	-6.27331993, -0.00035449, 0.00021716, 7.27296544, 0.99891718, 0.99942835, 0.49325608],
-												 [	-6.27332003, -0.00035445, 0.00021713, 7.27296558, 0.99891730, 0.99942842, 0.49325597],
-												 [	-6.27332012, -0.00035441, 0.00021711, 7.27296571, 0.99891743, 0.99942848, 0.49325598],
-												 [	-6.27332022, -0.00035437, 0.00021708, 7.27296585, 0.99891755, 0.99942855, 0.49325613],
-												 [	-6.27332032, -0.00035433, 0.00021706, 7.27296599, 0.99891768, 0.99942861, 0.49325588],
-												 [	-6.27332042, -0.00035429, 0.00021703, 7.27296613, 0.99891780, 0.99942868, 0.49325598],
-												 [	-6.27332051, -0.00035425, 0.00021701, 7.27296626, 0.99891792, 0.99942874, 0.49325592],
-												 [	-6.27332061, -0.00035421, 0.00021698, 7.27296640, 0.99891805, 0.99942881, 0.49325612],
-												 [	-6.27332071, -0.00035417, 0.00021696, 7.27296654, 0.99891817, 0.99942888, 0.49325620],
-												 [	-6.27332080, -0.00035413, 0.00021693, 7.27296668, 0.99891830, 0.99942894, 0.49325610],
-												 [	-6.27332090, -0.00035409, 0.00021691, 7.27296681, 0.99891842, 0.99942901, 0.49325614],
-												 [	-6.27332100, -0.00035405, 0.00021688, 7.27296695, 0.99891854, 0.99942907, 0.49325612],
-												 [	-6.27332109, -0.00035400, 0.00021686, 7.27296709, 0.99891867, 0.99942914, 0.49325613],
-												 [	-6.27332119, -0.00035396, 0.00021683, 7.27296723, 0.99891879, 0.99942920, 0.49325604],
-												 [	-6.27332129, -0.00035392, 0.00021681, 7.27296736, 0.99891891, 0.99942927, 0.49325626],
-												 [	-6.27332139, -0.00035388, 0.00021678, 7.27296750, 0.99891904, 0.99942933, 0.49325625],
-												 [	-6.27332148, -0.00035384, 0.00021676, 7.27296764, 0.99891916, 0.99942940, 0.49325605],
-												 [	-6.27332158, -0.00035380, 0.00021673, 7.27296778, 0.99891928, 0.99942946, 0.49325626],
-												 [	-6.27332168, -0.00035376, 0.00021671, 7.27296791, 0.99891941, 0.99942953, 0.49325629],
-												 [	-6.27332177, -0.00035372, 0.00021669, 7.27296805, 0.99891953, 0.99942959, 0.49325630],
-												 [	-6.27332187, -0.00035368, 0.00021666, 7.27296819, 0.99891966, 0.99942966, 0.49325628],
-												 [	-6.27332197, -0.00035364, 0.00021664, 7.27296833, 0.99891978, 0.99942972, 0.49325635],
-												 [	-6.27332206, -0.00035360, 0.00021661, 7.27296846, 0.99891990, 0.99942979, 0.49325625],
-												 [	-6.27332216, -0.00035356, 0.00021659, 7.27296860, 0.99892003, 0.99942985, 0.49325617],
-												 [	-6.27332226, -0.00035352, 0.00021656, 7.27296874, 0.99892015, 0.99942992, 0.49325641],
-												 [	-6.27332235, -0.00035348, 0.00021654, 7.27296887, 0.99892027, 0.99942998, 0.49325636],
-												 [	-6.27332245, -0.00035344, 0.00021651, 7.27296901, 0.99892040, 0.99943005, 0.49325630],
-												 [	-6.27332255, -0.00035340, 0.00021649, 7.27296915, 0.99892052, 0.99943011, 0.49325637],
-												 [	-6.27332264, -0.00035336, 0.00021646, 7.27296928, 0.99892064, 0.99943018, 0.49325631],
-												 [	-6.27332274, -0.00035332, 0.00021644, 7.27296942, 0.99892077, 0.99943024, 0.49325656],
-												 [	-6.27332284, -0.00035328, 0.00021641, 7.27296956, 0.99892089, 0.99943031, 0.49325631],
-												 [	-6.27332293, -0.00035324, 0.00021639, 7.27296970, 0.99892101, 0.99943037, 0.49325638],
-												 [	-6.27332303, -0.00035320, 0.00021636, 7.27296983, 0.99892114, 0.99943044, 0.49325647],
-												 [	-6.27332313, -0.00035316, 0.00021634, 7.27296997, 0.99892126, 0.99943050, 0.49325639],
-												 [	-6.27332322, -0.00035312, 0.00021631, 7.27297011, 0.99892138, 0.99943057, 0.49325638],
-												 [	-6.27332332, -0.00035308, 0.00021629, 7.27297024, 0.99892150, 0.99943063, 0.49325638],
-												 [	-6.27332341, -0.00035304, 0.00021626, 7.27297038, 0.99892163, 0.99943070, 0.49325643],
-												 [	-6.27332351, -0.00035300, 0.00021624, 7.27297052, 0.99892175, 0.99943076, 0.49325659],
-												 [	-6.27332361, -0.00035296, 0.00021622, 7.27297065, 0.99892187, 0.99943083, 0.49325672],
-												 [	-6.27332370, -0.00035291, 0.00021619, 7.27297079, 0.99892200, 0.99943089, 0.49325654],
-												 [	-6.27332380, -0.00035287, 0.00021617, 7.27297093, 0.99892212, 0.99943096, 0.49325642],
-												 [	-6.27332390, -0.00035283, 0.00021614, 7.27297106, 0.99892224, 0.99943102, 0.49325660],
-												 [	-6.27332399, -0.00035279, 0.00021612, 7.27297120, 0.99892237, 0.99943109, 0.49325667],
-												 [	-6.27332409, -0.00035275, 0.00021609, 7.27297133, 0.99892249, 0.99943115, 0.49325649],
-												 [	-6.27332418, -0.00035271, 0.00021607, 7.27297147, 0.99892261, 0.99943122, 0.49325655],
-												 [	-6.27332428, -0.00035267, 0.00021604, 7.27297161, 0.99892273, 0.99943128, 0.49325662],
-												 [	-6.27332438, -0.00035263, 0.00021602, 7.27297174, 0.99892286, 0.99943135, 0.49325664],
-												 [	-6.27332447, -0.00035259, 0.00021599, 7.27297188, 0.99892298, 0.99943141, 0.49325657],
-												 [	-6.27332457, -0.00035255, 0.00021597, 7.27297202, 0.99892310, 0.99943148, 0.49325670],
-												 [	-6.27332467, -0.00035251, 0.00021594, 7.27297215, 0.99892322, 0.99943154, 0.49325664],
-												 [	-6.27332476, -0.00035247, 0.00021592, 7.27297229, 0.99892335, 0.99943161, 0.49325680],
-												 [	-6.27332486, -0.00035243, 0.00021590, 7.27297243, 0.99892347, 0.99943167, 0.49325677],
-												 [	-6.27332495, -0.00035239, 0.00021587, 7.27297256, 0.99892359, 0.99943174, 0.49325674],
-												 [	-6.27332505, -0.00035235, 0.00021585, 7.27297270, 0.99892371, 0.99943180, 0.49325673],
-												 [	-6.27332515, -0.00035231, 0.00021582, 7.27297283, 0.99892384, 0.99943187, 0.49325687],
-												 [	-6.27332524, -0.00035227, 0.00021580, 7.27297297, 0.99892396, 0.99943193, 0.49325676],
-												 [	-6.27332534, -0.00035223, 0.00021577, 7.27297311, 0.99892408, 0.99943200, 0.49325694],
-												 [	-6.27332543, -0.00035219, 0.00021575, 7.27297324, 0.99892420, 0.99943206, 0.49325684],
-												 [	-6.27332553, -0.00035215, 0.00021572, 7.27297338, 0.99892433, 0.99943212, 0.49325673],
-												 [	-6.27332563, -0.00035211, 0.00021570, 7.27297351, 0.99892445, 0.99943219, 0.49325679],
-												 [	-6.27332572, -0.00035207, 0.00021567, 7.27297365, 0.99892457, 0.99943225, 0.49325687],
-												 [	-6.27332582, -0.00035203, 0.00021565, 7.27297379, 0.99892469, 0.99943232, 0.49325682],
-												 [	-6.27332591, -0.00035199, 0.00021563, 7.27297392, 0.99892482, 0.99943238, 0.49325693],
-												 [	-6.27332601, -0.00035195, 0.00021560, 7.27297406, 0.99892494, 0.99943245, 0.49325706],
-												 [	-6.27332611, -0.00035191, 0.00021558, 7.27297419, 0.99892506, 0.99943251, 0.49325679],
-												 [	-6.27332620, -0.00035187, 0.00021555, 7.27297433, 0.99892518, 0.99943258, 0.49325693],
-												 [	-6.27332630, -0.00035183, 0.00021553, 7.27297446, 0.99892531, 0.99943264, 0.49325690],
-												 [	-6.27332639, -0.00035179, 0.00021550, 7.27297460, 0.99892543, 0.99943271, 0.49325679],
-												 [	-6.27332649, -0.00035175, 0.00021548, 7.27297474, 0.99892555, 0.99943277, 0.49325703],
-												 [	-6.27332658, -0.00035171, 0.00021545, 7.27297487, 0.99892567, 0.99943283, 0.49325709],
-												 [	-6.27332668, -0.00035167, 0.00021543, 7.27297501, 0.99892579, 0.99943290, 0.49325716],
-												 [	-6.27332678, -0.00035163, 0.00021540, 7.27297514, 0.99892592, 0.99943296, 0.49325688],
-												 [	-6.27332687, -0.00035159, 0.00021538, 7.27297528, 0.99892604, 0.99943303, 0.49325701],
-												 [	-6.27332697, -0.00035155, 0.00021536, 7.27297541, 0.99892616, 0.99943309, 0.49325699],
-												 [	-6.27332706, -0.00035151, 0.00021533, 7.27297555, 0.99892628, 0.99943316, 0.49325716],
-												 [	-6.27332716, -0.00035147, 0.00021531, 7.27297569, 0.99892640, 0.99943322, 0.49325705],
-												 [	-6.27332725, -0.00035143, 0.00021528, 7.27297582, 0.99892653, 0.99943329, 0.49325714],
-												 [	-6.27332735, -0.00035139, 0.00021526, 7.27297596, 0.99892665, 0.99943335, 0.49325697],
-												 [	-6.27332744, -0.00035135, 0.00021523, 7.27297609, 0.99892677, 0.99943341, 0.49325706],
-												 [	-6.27332754, -0.00035131, 0.00021521, 7.27297623, 0.99892689, 0.99943348, 0.49325710],
-												 [	-6.27332763, -0.00035127, 0.00021518, 7.27297636, 0.99892701, 0.99943354, 0.49325718],
-												 [	-6.27332773, -0.00035123, 0.00021516, 7.27297650, 0.99892714, 0.99943361, 0.49325714],
-												 [	-6.27332783, -0.00035119, 0.00021514, 7.27297663, 0.99892726, 0.99943367, 0.49325704],
-												 [	-6.27332792, -0.00035115, 0.00021511, 7.27297677, 0.99892738, 0.99943374, 0.49325724],
-												 [	-6.27332802, -0.00035111, 0.00021509, 7.27297690, 0.99892750, 0.99943380, 0.49325727],
-												 [	-6.27332811, -0.00035107, 0.00021506, 7.27297704, 0.99892762, 0.99943386, 0.49325718],
-												 [	-6.27332821, -0.00035103, 0.00021504, 7.27297717, 0.99892774, 0.99943393, 0.49325715],
-												 [	-6.27332830, -0.00035099, 0.00021501, 7.27297731, 0.99892787, 0.99943399, 0.49325736],
-												 [	-6.27332840, -0.00035095, 0.00021499, 7.27297744, 0.99892799, 0.99943406, 0.49325725],
-												 [	-6.27332849, -0.00035091, 0.00021496, 7.27297758, 0.99892811, 0.99943412, 0.49325737],
-												 [	-6.27332859, -0.00035087, 0.00021494, 7.27297771, 0.99892823, 0.99943418, 0.49325733],
-												 [	-6.27332868, -0.00035084, 0.00021492, 7.27297785, 0.99892835, 0.99943425, 0.49325727],
-												 [	-6.27332878, -0.00035080, 0.00021489, 7.27297798, 0.99892847, 0.99943431, 0.49325722],
-												 [	-6.27332887, -0.00035076, 0.00021487, 7.27297812, 0.99892859, 0.99943438, 0.49325726],
-												 [	-6.27332897, -0.00035072, 0.00021484, 7.27297825, 0.99892872, 0.99943444, 0.49325746],
-												 [	-6.27332906, -0.00035068, 0.00021482, 7.27297839, 0.99892884, 0.99943451, 0.49325735],
-												 [	-6.27332916, -0.00035064, 0.00021479, 7.27297852, 0.99892896, 0.99943457, 0.49325729],
-												 [	-6.27332925, -0.00035060, 0.00021477, 7.27297866, 0.99892908, 0.99943463, 0.49325733],
-												 [	-6.27332935, -0.00035056, 0.00021475, 7.27297879, 0.99892920, 0.99943470, 0.49325743],
-												 [	-6.27332944, -0.00035052, 0.00021472, 7.27297893, 0.99892932, 0.99943476, 0.49325745],
-												 [	-6.27332954, -0.00035048, 0.00021470, 7.27297906, 0.99892944, 0.99943483, 0.49325763],
-												 [	-6.27332963, -0.00035044, 0.00021467, 7.27297920, 0.99892956, 0.99943489, 0.49325734],
-												 [	-6.27332973, -0.00035040, 0.00021465, 7.27297933, 0.99892969, 0.99943495, 0.49325743],
-												 [	-6.27332982, -0.00035036, 0.00021462, 7.27297947, 0.99892981, 0.99943502, 0.49325746],
-												 [	-6.27332992, -0.00035032, 0.00021460, 7.27297960, 0.99892993, 0.99943508, 0.49325750],
-												 [	-6.27333001, -0.00035028, 0.00021458, 7.27297973, 0.99893005, 0.99943515, 0.49325754],
-												 [	-6.27333011, -0.00035024, 0.00021455, 7.27297987, 0.99893017, 0.99943521, 0.49325751],
-												 [	-6.27333020, -0.00035020, 0.00021453, 7.27298000, 0.99893029, 0.99943527, 0.49325761],
-												 [	-6.27333030, -0.00035016, 0.00021450, 7.27298014, 0.99893041, 0.99943534, 0.49325752],
-												 [	-6.27333039, -0.00035012, 0.00021448, 7.27298027, 0.99893053, 0.99943540, 0.49325748],
-												 [	-6.27333049, -0.00035008, 0.00021445, 7.27298041, 0.99893065, 0.99943546, 0.49325770],
-												 [	-6.27333058, -0.00035004, 0.00021443, 7.27298054, 0.99893078, 0.99943553, 0.49325749],
-												 [	-6.27333068, -0.00035000, 0.00021441, 7.27298068, 0.99893090, 0.99943559, 0.49325754],
-												 [	-6.27333077, -0.00034996, 0.00021438, 7.27298081, 0.99893102, 0.99943566, 0.49325757],
-												 [	-6.27333087, -0.00034992, 0.00021436, 7.27298094, 0.99893114, 0.99943572, 0.49325772],
-												 [	-6.27333096, -0.00034988, 0.00021433, 7.27298108, 0.99893126, 0.99943578, 0.49325749],
-												 [	-6.27333106, -0.00034984, 0.00021431, 7.27298121, 0.99893138, 0.99943585, 0.49325746],
-												 [	-6.27333115, -0.00034980, 0.00021428, 7.27298135, 0.99893150, 0.99943591, 0.49325763],
-												 [	-6.27333125, -0.00034976, 0.00021426, 7.27298148, 0.99893162, 0.99943597, 0.49325780],
-												 [	-6.27333134, -0.00034973, 0.00021424, 7.27298162, 0.99893174, 0.99943604, 0.49325773],
-												 [	-6.27333144, -0.00034969, 0.00021421, 7.27298175, 0.99893186, 0.99943610, 0.49325774],
-												 [	-6.27333153, -0.00034965, 0.00021419, 7.27298188, 0.99893198, 0.99943617, 0.49325768],
-												 [	-6.27333162, -0.00034961, 0.00021416, 7.27298202, 0.99893210, 0.99943623, 0.49325772],
-												 [	-6.27333172, -0.00034957, 0.00021414, 7.27298215, 0.99893223, 0.99943629, 0.49325780],
-												 [	-6.27333181, -0.00034953, 0.00021412, 7.27298229, 0.99893235, 0.99943636, 0.49325790],
-												 [	-6.27333191, -0.00034949, 0.00021409, 7.27298242, 0.99893247, 0.99943642, 0.49325769],
-												 [	-6.27333200, -0.00034945, 0.00021407, 7.27298255, 0.99893259, 0.99943648, 0.49325784],
-												 [	-6.27333210, -0.00034941, 0.00021404, 7.27298269, 0.99893271, 0.99943655, 0.49325781],
-												 [	-6.27333219, -0.00034937, 0.00021402, 7.27298282, 0.99893283, 0.99943661, 0.49325781],
-												 [	-6.27333229, -0.00034933, 0.00021399, 7.27298296, 0.99893295, 0.99943668, 0.49325775],
-												 [	-6.27333238, -0.00034929, 0.00021397, 7.27298309, 0.99893307, 0.99943674, 0.49325777],
-												 [	-6.27333247, -0.00034925, 0.00021395, 7.27298322, 0.99893319, 0.99943680, 0.49325794],
-												 [	-6.27333257, -0.00034921, 0.00021392, 7.27298336, 0.99893331, 0.99943687, 0.49325786],
-												 [	-6.27333266, -0.00034917, 0.00021390, 7.27298349, 0.99893343, 0.99943693, 0.49325783],
-												 [	-6.27333276, -0.00034913, 0.00021387, 7.27298362, 0.99893355, 0.99943699, 0.49325777],
-												 [	-6.27333285, -0.00034909, 0.00021385, 7.27298376, 0.99893367, 0.99943706, 0.49325800],
-												 [	-6.27333295, -0.00034905, 0.00021383, 7.27298389, 0.99893379, 0.99943712, 0.49325788],
-												 [	-6.27333304, -0.00034902, 0.00021380, 7.27298402, 0.99893391, 0.99943718, 0.49325796],
-												 [	-6.27333313, -0.00034898, 0.00021378, 7.27298416, 0.99893403, 0.99943725, 0.49325777],
-												 [	-6.27333323, -0.00034894, 0.00021375, 7.27298429, 0.99893415, 0.99943731, 0.49325803],
-												 [	-6.27333332, -0.00034890, 0.00021373, 7.27298443, 0.99893427, 0.99943737, 0.49325799],
-												 [	-6.27333342, -0.00034886, 0.00021370, 7.27298456, 0.99893439, 0.99943744, 0.49325815],
-												 [	-6.27333351, -0.00034882, 0.00021368, 7.27298469, 0.99893451, 0.99943750, 0.49325810],
-												 [	-6.27333360, -0.00034878, 0.00021366, 7.27298483, 0.99893463, 0.99943756, 0.49325805],
-												 [	-6.27333370, -0.00034874, 0.00021363, 7.27298496, 0.99893475, 0.99943763, 0.49325805],
-												 [	-6.27333379, -0.00034870, 0.00021361, 7.27298509, 0.99893487, 0.99943769, 0.49325810],
-												 [	-6.27333389, -0.00034866, 0.00021358, 7.27298523, 0.99893499, 0.99943775, 0.49325812],
-												 [	-6.27333398, -0.00034862, 0.00021356, 7.27298536, 0.99893511, 0.99943782, 0.49325800],
-												 [	-6.27333408, -0.00034858, 0.00021354, 7.27298549, 0.99893523, 0.99943788, 0.49325798],
-												 [	-6.27333417, -0.00034854, 0.00021351, 7.27298563, 0.99893535, 0.99943794, 0.49325819],
-												 [	-6.27333426, -0.00034850, 0.00021349, 7.27298576, 0.99893547, 0.99943801, 0.49325809],
-												 [	-6.27333436, -0.00034847, 0.00021346, 7.27298589, 0.99893559, 0.99943807, 0.49325811],
-												 [	-6.27333445, -0.00034843, 0.00021344, 7.27298602, 0.99893571, 0.99943813, 0.49325804],
-												 [	-6.27333454, -0.00034839, 0.00021342, 7.27298616, 0.99893583, 0.99943820, 0.49325814],
-												 [	-6.27333464, -0.00034835, 0.00021339, 7.27298629, 0.99893595, 0.99943826, 0.49325817],
-												 [	-6.27333473, -0.00034831, 0.00021337, 7.27298642, 0.99893607, 0.99943832, 0.49325810],
-												 [	-6.27333483, -0.00034827, 0.00021334, 7.27298656, 0.99893619, 0.99943839, 0.49325810],
-												 [	-6.27333492, -0.00034823, 0.00021332, 7.27298669, 0.99893631, 0.99943845, 0.49325813],
-												 [	-6.27333501, -0.00034819, 0.00021330, 7.27298682, 0.99893643, 0.99943851, 0.49325821],
-												 [	-6.27333511, -0.00034815, 0.00021327, 7.27298696, 0.99893655, 0.99943858, 0.49325825],
-												 [	-6.27333520, -0.00034811, 0.00021325, 7.27298709, 0.99893667, 0.99943864, 0.49325802],
-												 [	-6.27333530, -0.00034807, 0.00021322, 7.27298722, 0.99893679, 0.99943870, 0.49325839],
-												 [	-6.27333539, -0.00034803, 0.00021320, 7.27298735, 0.99893691, 0.99943877, 0.49325824],
-												 [	-6.27333548, -0.00034800, 0.00021318, 7.27298749, 0.99893703, 0.99943883, 0.49325827],
-												 [	-6.27333558, -0.00034796, 0.00021315, 7.27298762, 0.99893715, 0.99943889, 0.49325830],
-												 [	-6.27333567, -0.00034792, 0.00021313, 7.27298775, 0.99893727, 0.99943895, 0.49325817],
-												 [	-6.27333576, -0.00034788, 0.00021310, 7.27298789, 0.99893739, 0.99943902, 0.49325841],
-												 [	-6.27333586, -0.00034784, 0.00021308, 7.27298802, 0.99893751, 0.99943908, 0.49325836],
-												 [	-6.27333595, -0.00034780, 0.00021306, 7.27298815, 0.99893763, 0.99943914, 0.49325836],
-												 [	-6.27333604, -0.00034776, 0.00021303, 7.27298828, 0.99893774, 0.99943921, 0.49325838],
-												 [	-6.27333614, -0.00034772, 0.00021301, 7.27298842, 0.99893786, 0.99943927, 0.49325845],
-												 [	-6.27333623, -0.00034768, 0.00021298, 7.27298855, 0.99893798, 0.99943933, 0.49325848],
-												 [	-6.27333632, -0.00034764, 0.00021296, 7.27298868, 0.99893810, 0.99943940, 0.49325833],
-												 [	-6.27333642, -0.00034760, 0.00021294, 7.27298881, 0.99893822, 0.99943946, 0.49325843],
-												 [	-6.27333651, -0.00034757, 0.00021291, 7.27298895, 0.99893834, 0.99943952, 0.49325849],
-												 [	-6.27333661, -0.00034753, 0.00021289, 7.27298908, 0.99893846, 0.99943958, 0.49325841],
-												 [	-6.27333670, -0.00034749, 0.00021286, 7.27298921, 0.99893858, 0.99943965, 0.49325856],
-												 [	-6.27333679, -0.00034745, 0.00021284, 7.27298934, 0.99893870, 0.99943971, 0.49325841],
-												 [	-6.27333689, -0.00034741, 0.00021282, 7.27298948, 0.99893882, 0.99943977, 0.49325845],
-												 [	-6.27333698, -0.00034737, 0.00021279, 7.27298961, 0.99893894, 0.99943984, 0.49325852],
-												 [	-6.27333707, -0.00034733, 0.00021277, 7.27298974, 0.99893906, 0.99943990, 0.49325863],
-												 [	-6.27333717, -0.00034729, 0.00021275, 7.27298987, 0.99893918, 0.99943996, 0.49325866],
-												 [	-6.27333726, -0.00034725, 0.00021272, 7.27299000, 0.99893929, 0.99944002, 0.49325856],
-												 [	-6.27333735, -0.00034721, 0.00021270, 7.27299014, 0.99893941, 0.99944009, 0.49325854],
-												 [	-6.27333745, -0.00034718, 0.00021267, 7.27299027, 0.99893953, 0.99944015, 0.49325858],
-												 [	-6.27333754, -0.00034714, 0.00021265, 7.27299040, 0.99893965, 0.99944021, 0.49325856],
-												 [	-6.27333763, -0.00034710, 0.00021263, 7.27299053, 0.99893977, 0.99944028, 0.49325873],
-												 [	-6.27333772, -0.00034706, 0.00021260, 7.27299067, 0.99893989, 0.99944034, 0.49325877],
-												 [	-6.27333782, -0.00034702, 0.00021258, 7.27299080, 0.99894001, 0.99944040, 0.49325864],
-												 [	-6.27333791, -0.00034698, 0.00021255, 7.27299093, 0.99894013, 0.99944046, 0.49325857],
-												 [	-6.27333800, -0.00034694, 0.00021253, 7.27299106, 0.99894025, 0.99944053, 0.49325852],
-												 [	-6.27333810, -0.00034690, 0.00021251, 7.27299119, 0.99894036, 0.99944059, 0.49325872],
-												 [	-6.27333819, -0.00034686, 0.00021248, 7.27299133, 0.99894048, 0.99944065, 0.49325865],
-												 [	-6.27333828, -0.00034683, 0.00021246, 7.27299146, 0.99894060, 0.99944072, 0.49325884],
-												 [	-6.27333838, -0.00034679, 0.00021244, 7.27299159, 0.99894072, 0.99944078, 0.49325864],
-												 [	-6.27333847, -0.00034675, 0.00021241, 7.27299172, 0.99894084, 0.99944084, 0.49325865],
-												 [	-6.27333856, -0.00034671, 0.00021239, 7.27299185, 0.99894096, 0.99944090, 0.49325871],
-												 [	-6.27333866, -0.00034667, 0.00021236, 7.27299199, 0.99894108, 0.99944097, 0.49325862],
-												 [	-6.27333875, -0.00034663, 0.00021234, 7.27299212, 0.99894120, 0.99944103, 0.49325892],
-												 [	-6.27333884, -0.00034659, 0.00021232, 7.27299225, 0.99894131, 0.99944109, 0.49325886],
-												 [	-6.27333893, -0.00034655, 0.00021229, 7.27299238, 0.99894143, 0.99944115, 0.49325892],
-												 [	-6.27333903, -0.00034652, 0.00021227, 7.27299251, 0.99894155, 0.99944122, 0.49325878],
-												 [	-6.27333912, -0.00034648, 0.00021225, 7.27299264, 0.99894167, 0.99944128, 0.49325893],
-												 [	-6.27333921, -0.00034644, 0.00021222, 7.27299278, 0.99894179, 0.99944134, 0.49325882],
-												 [	-6.27333931, -0.00034640, 0.00021220, 7.27299291, 0.99894191, 0.99944140, 0.49325880],
-												 [	-6.27333940, -0.00034636, 0.00021217, 7.27299304, 0.99894202, 0.99944147, 0.49325884],
-												 [	-6.27333949, -0.00034632, 0.00021215, 7.27299317, 0.99894214, 0.99944153, 0.49325871],
-												 [	-6.27333958, -0.00034628, 0.00021213, 7.27299330, 0.99894226, 0.99944159, 0.49325888],
-												 [	-6.27333968, -0.00034624, 0.00021210, 7.27299343, 0.99894238, 0.99944165, 0.49325907],
-												 [	-6.27333977, -0.00034620, 0.00021208, 7.27299356, 0.99894250, 0.99944172, 0.49325884],
-												 [	-6.27333986, -0.00034617, 0.00021206, 7.27299370, 0.99894262, 0.99944178, 0.49325906],
-												 [	-6.27333995, -0.00034613, 0.00021203, 7.27299383, 0.99894273, 0.99944184, 0.49325903],
-												 [	-6.27334005, -0.00034609, 0.00021201, 7.27299396, 0.99894285, 0.99944190, 0.49325895],
-												 [	-6.27334014, -0.00034605, 0.00021198, 7.27299409, 0.99894297, 0.99944197, 0.49325883],
-												 [	-6.27334023, -0.00034601, 0.00021196, 7.27299422, 0.99894309, 0.99944203, 0.49325893],
-												 [	-6.27334033, -0.00034597, 0.00021194, 7.27299435, 0.99894321, 0.99944209, 0.49325903],
-												 [	-6.27334042, -0.00034593, 0.00021191, 7.27299448, 0.99894333, 0.99944215, 0.49325919],
-												 [	-6.27334051, -0.00034590, 0.00021189, 7.27299461, 0.99894344, 0.99944222, 0.49325911],
-												 [	-6.27334060, -0.00034586, 0.00021187, 7.27299475, 0.99894356, 0.99944228, 0.49325916],
-												 [	-6.27334070, -0.00034582, 0.00021184, 7.27299488, 0.99894368, 0.99944234, 0.49325910],
-												 [	-6.27334079, -0.00034578, 0.00021182, 7.27299501, 0.99894380, 0.99944240, 0.49325905],
-												 [	-6.27334088, -0.00034574, 0.00021179, 7.27299514, 0.99894392, 0.99944246, 0.49325907],
-												 [	-6.27334097, -0.00034570, 0.00021177, 7.27299527, 0.99894403, 0.99944253, 0.49325918],
-												 [	-6.27334107, -0.00034566, 0.00021175, 7.27299540, 0.99894415, 0.99944259, 0.49325910],
-												 [	-6.27334116, -0.00034563, 0.00021172, 7.27299553, 0.99894427, 0.99944265, 0.49325909],
-												 [	-6.27334125, -0.00034559, 0.00021170, 7.27299566, 0.99894439, 0.99944271, 0.49325903],
-												 [	-6.27334134, -0.00034555, 0.00021168, 7.27299579, 0.99894451, 0.99944278, 0.49325934],
-												 [	-6.27334143, -0.00034551, 0.00021165, 7.27299593, 0.99894462, 0.99944284, 0.49325921],
-												 [	-6.27334153, -0.00034547, 0.00021163, 7.27299606, 0.99894474, 0.99944290, 0.49325916],
-												 [	-6.27334162, -0.00034543, 0.00021161, 7.27299619, 0.99894486, 0.99944296, 0.49325905],
-												 [	-6.27334171, -0.00034539, 0.00021158, 7.27299632, 0.99894498, 0.99944302, 0.49325932],
-												 [	-6.27334180, -0.00034536, 0.00021156, 7.27299645, 0.99894509, 0.99944309, 0.49325918],
-												 [	-6.27334190, -0.00034532, 0.00021153, 7.27299658, 0.99894521, 0.99944315, 0.49325928],
-												 [	-6.27334199, -0.00034528, 0.00021151, 7.27299671, 0.99894533, 0.99944321, 0.49325927],
-												 [	-6.27334208, -0.00034524, 0.00021149, 7.27299684, 0.99894545, 0.99944327, 0.49325910],
-												 [	-6.27334217, -0.00034520, 0.00021146, 7.27299697, 0.99894557, 0.99944334, 0.49325933],
-												 [	-6.27334226, -0.00034516, 0.00021144, 7.27299710, 0.99894568, 0.99944340, 0.49325931],
-												 [	-6.27334236, -0.00034512, 0.00021142, 7.27299723, 0.99894580, 0.99944346, 0.49325913],
-												 [	-6.27334245, -0.00034509, 0.00021139, 7.27299736, 0.99894592, 0.99944352, 0.49325935],
-												 [	-6.27334254, -0.00034505, 0.00021137, 7.27299749, 0.99894604, 0.99944358, 0.49325926],
-												 [	-6.27334263, -0.00034501, 0.00021135, 7.27299762, 0.99894615, 0.99944365, 0.49325931],
-												 [	-6.27334273, -0.00034497, 0.00021132, 7.27299776, 0.99894627, 0.99944371, 0.49325923],
-												 [	-6.27334282, -0.00034493, 0.00021130, 7.27299789, 0.99894639, 0.99944377, 0.49325932],
-												 [	-6.27334291, -0.00034489, 0.00021128, 7.27299802, 0.99894651, 0.99944383, 0.49325937],
-												 [	-6.27334300, -0.00034486, 0.00021125, 7.27299815, 0.99894662, 0.99944389, 0.49325925],
-												 [	-6.27334309, -0.00034482, 0.00021123, 7.27299828, 0.99894674, 0.99944396, 0.49325938],
-												 [	-6.27334319, -0.00034478, 0.00021120, 7.27299841, 0.99894686, 0.99944402, 0.49325937],
-												 [	-6.27334328, -0.00034474, 0.00021118, 7.27299854, 0.99894697, 0.99944408, 0.49325933],
-												 [	-6.27334337, -0.00034470, 0.00021116, 7.27299867, 0.99894709, 0.99944414, 0.49325964],
-												 [	-6.27334346, -0.00034466, 0.00021113, 7.27299880, 0.99894721, 0.99944420, 0.49325932],
-												 [	-6.27334355, -0.00034462, 0.00021111, 7.27299893, 0.99894733, 0.99944426, 0.49325939],
-												 [	-6.27334364, -0.00034459, 0.00021109, 7.27299906, 0.99894744, 0.99944433, 0.49325953],
-												 [	-6.27334374, -0.00034455, 0.00021106, 7.27299919, 0.99894756, 0.99944439, 0.49325955],
-												 [	-6.27334383, -0.00034451, 0.00021104, 7.27299932, 0.99894768, 0.99944445, 0.49325952],
-												 [	-6.27334392, -0.00034447, 0.00021102, 7.27299945, 0.99894780, 0.99944451, 0.49325957],
-												 [	-6.27334401, -0.00034443, 0.00021099, 7.27299958, 0.99894791, 0.99944457, 0.49325952],
-												 [	-6.27334410, -0.00034439, 0.00021097, 7.27299971, 0.99894803, 0.99944464, 0.49325948],
-												 [	-6.27334420, -0.00034436, 0.00021095, 7.27299984, 0.99894815, 0.99944470, 0.49325953],
-												 [	-6.27334429, -0.00034432, 0.00021092, 7.27299997, 0.99894826, 0.99944476, 0.49325969],
-												 [	-6.27334438, -0.00034428, 0.00021090, 7.27300010, 0.99894838, 0.99944482, 0.49325951],
-												 [	-6.27334447, -0.00034424, 0.00021088, 7.27300023, 0.99894850, 0.99944488, 0.49325964],
-												 [	-6.27334456, -0.00034420, 0.00021085, 7.27300036, 0.99894861, 0.99944494, 0.49325959],
-												 [	-6.27334465, -0.00034417, 0.00021083, 7.27300049, 0.99894873, 0.99944501, 0.49325984],
-												 [	-6.27334475, -0.00034413, 0.00021081, 7.27300062, 0.99894885, 0.99944507, 0.49325961],
-												 [	-6.27334484, -0.00034409, 0.00021078, 7.27300075, 0.99894897, 0.99944513, 0.49325970],
-												 [	-6.27334493, -0.00034405, 0.00021076, 7.27300088, 0.99894908, 0.99944519, 0.49325973],
-												 [	-6.27334502, -0.00034401, 0.00021073, 7.27300101, 0.99894920, 0.99944525, 0.49325965],
-												 [	-6.27334511, -0.00034397, 0.00021071, 7.27300114, 0.99894932, 0.99944531, 0.49325961],
-												 [	-6.27334520, -0.00034394, 0.00021069, 7.27300127, 0.99894943, 0.99944538, 0.49325970],
-												 [	-6.27334529, -0.00034390, 0.00021066, 7.27300140, 0.99894955, 0.99944544, 0.49325947],
-												 [	-6.27334539, -0.00034386, 0.00021064, 7.27300153, 0.99894967, 0.99944550, 0.49325970],
-												 [	-6.27334548, -0.00034382, 0.00021062, 7.27300166, 0.99894978, 0.99944556, 0.49325986],
-												 [	-6.27334557, -0.00034378, 0.00021059, 7.27300179, 0.99894990, 0.99944562, 0.49325975],
-												 [	-6.27334566, -0.00034374, 0.00021057, 7.27300192, 0.99895002, 0.99944568, 0.49325973],
-												 [	-6.27334575, -0.00034371, 0.00021055, 7.27300205, 0.99895013, 0.99944575, 0.49325990],
-												 [	-6.27334584, -0.00034367, 0.00021052, 7.27300217, 0.99895025, 0.99944581, 0.49325987],
-												 [	-6.27334593, -0.00034363, 0.00021050, 7.27300230, 0.99895037, 0.99944587, 0.49325975],
-												 [	-6.27334603, -0.00034359, 0.00021048, 7.27300243, 0.99895048, 0.99944593, 0.49325986],
-												 [	-6.27334612, -0.00034355, 0.00021045, 7.27300256, 0.99895060, 0.99944599, 0.49325980],
-												 [	-6.27334621, -0.00034352, 0.00021043, 7.27300269, 0.99895072, 0.99944605, 0.49325999],
-												 [	-6.27334630, -0.00034348, 0.00021041, 7.27300282, 0.99895083, 0.99944611, 0.49326005],
-												 [	-6.27334639, -0.00034344, 0.00021038, 7.27300295, 0.99895095, 0.99944618, 0.49325989],
-												 [	-6.27334648, -0.00034340, 0.00021036, 7.27300308, 0.99895106, 0.99944624, 0.49325982],
-												 [	-6.27334657, -0.00034336, 0.00021034, 7.27300321, 0.99895118, 0.99944630, 0.49326004],
-												 [	-6.27334666, -0.00034333, 0.00021031, 7.27300334, 0.99895130, 0.99944636, 0.49325987],
-												 [	-6.27334676, -0.00034329, 0.00021029, 7.27300347, 0.99895141, 0.99944642, 0.49326003],
-												 [	-6.27334685, -0.00034325, 0.00021027, 7.27300360, 0.99895153, 0.99944648, 0.49325986],
-												 [	-6.27334694, -0.00034321, 0.00021024, 7.27300373, 0.99895165, 0.99944654, 0.49326013],
-												 [	-6.27334703, -0.00034317, 0.00021022, 7.27300386, 0.99895176, 0.99944661, 0.49326001],
-												 [	-6.27334712, -0.00034313, 0.00021020, 7.27300399, 0.99895188, 0.99944667, 0.49325997],
-												 [	-6.27334721, -0.00034310, 0.00021017, 7.27300411, 0.99895199, 0.99944673, 0.49325982],
-												 [	-6.27334730, -0.00034306, 0.00021015, 7.27300424, 0.99895211, 0.99944679, 0.49326004],
-												 [	-6.27334739, -0.00034302, 0.00021013, 7.27300437, 0.99895223, 0.99944685, 0.49326000],
-												 [	-6.27334748, -0.00034298, 0.00021010, 7.27300450, 0.99895234, 0.99944691, 0.49326002],
-												 [	-6.27334758, -0.00034294, 0.00021008, 7.27300463, 0.99895246, 0.99944697, 0.49326019],
-												 [	-6.27334767, -0.00034291, 0.00021006, 7.27300476, 0.99895258, 0.99944704, 0.49326022],
-												 [	-6.27334776, -0.00034287, 0.00021003, 7.27300489, 0.99895269, 0.99944710, 0.49325991],
-												 [	-6.27334785, -0.00034283, 0.00021001, 7.27300502, 0.99895281, 0.99944716, 0.49326017],
-												 [	-6.27334794, -0.00034279, 0.00020999, 7.27300515, 0.99895292, 0.99944722, 0.49326012],
-												 [	-6.27334803, -0.00034276, 0.00020996, 7.27300527, 0.99895304, 0.99944728, 0.49326022],
-												 [	-6.27334812, -0.00034272, 0.00020994, 7.27300540, 0.99895316, 0.99944734, 0.49326001],
-												 [	-6.27334821, -0.00034268, 0.00020992, 7.27300553, 0.99895327, 0.99944740, 0.49326024],
-												 [	-6.27334830, -0.00034264, 0.00020989, 7.27300566, 0.99895339, 0.99944746, 0.49326021],
-												 [	-6.27334839, -0.00034260, 0.00020987, 7.27300579, 0.99895350, 0.99944753, 0.49326029],
-												 [	-6.27334848, -0.00034257, 0.00020985, 7.27300592, 0.99895362, 0.99944759, 0.49326016],
-												 [	-6.27334857, -0.00034253, 0.00020983, 7.27300605, 0.99895373, 0.99944765, 0.49326016],
-												 [	-6.27334867, -0.00034249, 0.00020980, 7.27300618, 0.99895385, 0.99944771, 0.49326045],
-												 [	-6.27334876, -0.00034245, 0.00020978, 7.27300630, 0.99895397, 0.99944777, 0.49326011],
-												 [	-6.27334885, -0.00034241, 0.00020976, 7.27300643, 0.99895408, 0.99944783, 0.49326023],
-												 [	-6.27334894, -0.00034238, 0.00020973, 7.27300656, 0.99895420, 0.99944789, 0.49326007],
-												 [	-6.27334903, -0.00034234, 0.00020971, 7.27300669, 0.99895431, 0.99944795, 0.49326021],
-												 [	-6.27334912, -0.00034230, 0.00020969, 7.27300682, 0.99895443, 0.99944801, 0.49326027],
-												 [	-6.27334921, -0.00034226, 0.00020966, 7.27300695, 0.99895454, 0.99944807, 0.49326040],
-												 [	-6.27334930, -0.00034222, 0.00020964, 7.27300708, 0.99895466, 0.99944814, 0.49326032],
-												 [	-6.27334939, -0.00034219, 0.00020962, 7.27300720, 0.99895478, 0.99944820, 0.49326028],
-												 [	-6.27334948, -0.00034215, 0.00020959, 7.27300733, 0.99895489, 0.99944826, 0.49326022],
-												 [	-6.27334957, -0.00034211, 0.00020957, 7.27300746, 0.99895501, 0.99944832, 0.49326044],
-												 [	-6.27334966, -0.00034207, 0.00020955, 7.27300759, 0.99895512, 0.99944838, 0.49326036],
-												 [	-6.27334975, -0.00034204, 0.00020952, 7.27300772, 0.99895524, 0.99944844, 0.49326052],
-												 [	-6.27334984, -0.00034200, 0.00020950, 7.27300785, 0.99895535, 0.99944850, 0.49326050],
-												 [	-6.27334993, -0.00034196, 0.00020948, 7.27300797, 0.99895547, 0.99944856, 0.49326047],
-												 [	-6.27335002, -0.00034192, 0.00020945, 7.27300810, 0.99895558, 0.99944862, 0.49326049],
-												 [	-6.27335011, -0.00034188, 0.00020943, 7.27300823, 0.99895570, 0.99944868, 0.49326038],
-												 [	-6.27335021, -0.00034185, 0.00020941, 7.27300836, 0.99895582, 0.99944875, 0.49326054],
-												 [	-6.27335030, -0.00034181, 0.00020938, 7.27300849, 0.99895593, 0.99944881, 0.49326041],
-												 [	-6.27335039, -0.00034177, 0.00020936, 7.27300861, 0.99895605, 0.99944887, 0.49326059],
-												 [	-6.27335048, -0.00034173, 0.00020934, 7.27300874, 0.99895616, 0.99944893, 0.49326058],
-												 [	-6.27335057, -0.00034170, 0.00020932, 7.27300887, 0.99895628, 0.99944899, 0.49326043],
-												 [	-6.27335066, -0.00034166, 0.00020929, 7.27300900, 0.99895639, 0.99944905, 0.49326062],
-												 [	-6.27335075, -0.00034162, 0.00020927, 7.27300913, 0.99895651, 0.99944911, 0.49326067],
-												 [	-6.27335084, -0.00034158, 0.00020925, 7.27300925, 0.99895662, 0.99944917, 0.49326078],
-												 [	-6.27335093, -0.00034154, 0.00020922, 7.27300938, 0.99895674, 0.99944923, 0.49326065],
-												 [	-6.27335102, -0.00034151, 0.00020920, 7.27300951, 0.99895685, 0.99944929, 0.49326059],
-												 [	-6.27335111, -0.00034147, 0.00020918, 7.27300964, 0.99895697, 0.99944935, 0.49326055],
-												 [	-6.27335120, -0.00034143, 0.00020915, 7.27300977, 0.99895708, 0.99944941, 0.49326066],
-												 [	-6.27335129, -0.00034139, 0.00020913, 7.27300989, 0.99895720, 0.99944948, 0.49326077],
-												 [	-6.27335138, -0.00034136, 0.00020911, 7.27301002, 0.99895731, 0.99944954, 0.49326066],
-												 [	-6.27335147, -0.00034132, 0.00020908, 7.27301015, 0.99895743, 0.99944960, 0.49326075],
-												 [	-6.27335156, -0.00034128, 0.00020906, 7.27301028, 0.99895754, 0.99944966, 0.49326055],
-												 [	-6.27335165, -0.00034124, 0.00020904, 7.27301040, 0.99895766, 0.99944972, 0.49326086],
-												 [	-6.27335174, -0.00034121, 0.00020902, 7.27301053, 0.99895777, 0.99944978, 0.49326055],
-												 [	-6.27335183, -0.00034117, 0.00020899, 7.27301066, 0.99895789, 0.99944984, 0.49326069],
-												 [	-6.27335192, -0.00034113, 0.00020897, 7.27301079, 0.99895800, 0.99944990, 0.49326076],
-												 [	-6.27335201, -0.00034109, 0.00020895, 7.27301092, 0.99895812, 0.99944996, 0.49326064],
-												 [	-6.27335210, -0.00034106, 0.00020892, 7.27301104, 0.99895823, 0.99945002, 0.49326064],
-												 [	-6.27335219, -0.00034102, 0.00020890, 7.27301117, 0.99895835, 0.99945008, 0.49326079],
-												 [	-6.27335228, -0.00034098, 0.00020888, 7.27301130, 0.99895846, 0.99945014, 0.49326094],
-												 [	-6.27335237, -0.00034094, 0.00020885, 7.27301143, 0.99895858, 0.99945020, 0.49326073],
-												 [	-6.27335246, -0.00034091, 0.00020883, 7.27301155, 0.99895869, 0.99945026, 0.49326067],
-												 [	-6.27335255, -0.00034087, 0.00020881, 7.27301168, 0.99895881, 0.99945032, 0.49326096],
-												 [	-6.27335264, -0.00034083, 0.00020878, 7.27301181, 0.99895892, 0.99945038, 0.49326074],
-												 [	-6.27335273, -0.00034079, 0.00020876, 7.27301194, 0.99895903, 0.99945045, 0.49326072],
-												 [	-6.27335282, -0.00034076, 0.00020874, 7.27301206, 0.99895915, 0.99945051, 0.49326097],
-												 [	-6.27335291, -0.00034072, 0.00020872, 7.27301219, 0.99895926, 0.99945057, 0.49326095],
-												 [	-6.27335300, -0.00034068, 0.00020869, 7.27301232, 0.99895938, 0.99945063, 0.49326083],
-												 [	-6.27335309, -0.00034064, 0.00020867, 7.27301244, 0.99895949, 0.99945069, 0.49326094],
-												 [	-6.27335318, -0.00034061, 0.00020865, 7.27301257, 0.99895961, 0.99945075, 0.49326071],
-												 [	-6.27335327, -0.00034057, 0.00020862, 7.27301270, 0.99895972, 0.99945081, 0.49326094],
-												 [	-6.27335336, -0.00034053, 0.00020860, 7.27301283, 0.99895984, 0.99945087, 0.49326119],
-												 [	-6.27335345, -0.00034049, 0.00020858, 7.27301295, 0.99895995, 0.99945093, 0.49326102],
-												 [	-6.27335354, -0.00034046, 0.00020856, 7.27301308, 0.99896007, 0.99945099, 0.49326095],
-												 [	-6.27335363, -0.00034042, 0.00020853, 7.27301321, 0.99896018, 0.99945105, 0.49326111],
-												 [	-6.27335372, -0.00034038, 0.00020851, 7.27301333, 0.99896029, 0.99945111, 0.49326093],
-												 [	-6.27335380, -0.00034034, 0.00020849, 7.27301346, 0.99896041, 0.99945117, 0.49326092],
-												 [	-6.27335389, -0.00034031, 0.00020846, 7.27301359, 0.99896052, 0.99945123, 0.49326086],
-												 [	-6.27335398, -0.00034027, 0.00020844, 7.27301372, 0.99896064, 0.99945129, 0.49326111],
-												 [	-6.27335407, -0.00034023, 0.00020842, 7.27301384, 0.99896075, 0.99945135, 0.49326085],
-												 [	-6.27335416, -0.00034019, 0.00020839, 7.27301397, 0.99896087, 0.99945141, 0.49326107],
-												 [	-6.27335425, -0.00034016, 0.00020837, 7.27301410, 0.99896098, 0.99945147, 0.49326138],
-												 [	-6.27335434, -0.00034012, 0.00020835, 7.27301422, 0.99896109, 0.99945153, 0.49326107],
-												 [	-6.27335443, -0.00034008, 0.00020833, 7.27301435, 0.99896121, 0.99945159, 0.49326110],
-												 [	-6.27335452, -0.00034004, 0.00020830, 7.27301448, 0.99896132, 0.99945165, 0.49326107],
-												 [	-6.27335461, -0.00034001, 0.00020828, 7.27301460, 0.99896144, 0.99945171, 0.49326111],
-												 [	-6.27335470, -0.00033997, 0.00020826, 7.27301473, 0.99896155, 0.99945177, 0.49326094],
-												 [	-6.27335479, -0.00033993, 0.00020823, 7.27301486, 0.99896166, 0.99945183, 0.49326116],
-												 [	-6.27335488, -0.00033989, 0.00020821, 7.27301498, 0.99896178, 0.99945189, 0.49326119],
-												 [	-6.27335497, -0.00033986, 0.00020819, 7.27301511, 0.99896189, 0.99945195, 0.49326130],
-												 [	-6.27335506, -0.00033982, 0.00020817, 7.27301524, 0.99896201, 0.99945201, 0.49326119],
-												 [	-6.27335515, -0.00033978, 0.00020814, 7.27301536, 0.99896212, 0.99945207, 0.49326105],
-												 [	-6.27335524, -0.00033975, 0.00020812, 7.27301549, 0.99896223, 0.99945213, 0.49326119],
-												 [	-6.27335533, -0.00033971, 0.00020810, 7.27301562, 0.99896235, 0.99945219, 0.49326118],
-												 [	-6.27335541, -0.00033967, 0.00020807, 7.27301574, 0.99896246, 0.99945225, 0.49326126],
-												 [	-6.27335550, -0.00033963, 0.00020805, 7.27301587, 0.99896258, 0.99945231, 0.49326104],
-												 [	-6.27335559, -0.00033960, 0.00020803, 7.27301600, 0.99896269, 0.99945237, 0.49326124],
-												 [	-6.27335568, -0.00033956, 0.00020801, 7.27301612, 0.99896280, 0.99945243, 0.49326121],
-												 [	-6.27335577, -0.00033952, 0.00020798, 7.27301625, 0.99896292, 0.99945249, 0.49326126],
-												 [	-6.27335586, -0.00033948, 0.00020796, 7.27301638, 0.99896303, 0.99945255, 0.49326146],
-												 [	-6.27335595, -0.00033945, 0.00020794, 7.27301650, 0.99896315, 0.99945261, 0.49326123],
-												 [	-6.27335604, -0.00033941, 0.00020791, 7.27301663, 0.99896326, 0.99945267, 0.49326137],
-												 [	-6.27335613, -0.00033937, 0.00020789, 7.27301675, 0.99896337, 0.99945274, 0.49326124],
-												 [	-6.27335622, -0.00033934, 0.00020787, 7.27301688, 0.99896349, 0.99945279, 0.49326144],
-												 [	-6.27335631, -0.00033930, 0.00020785, 7.27301701, 0.99896360, 0.99945286, 0.49326118],
-												 [	-6.27335639, -0.00033926, 0.00020782, 7.27301713, 0.99896371, 0.99945291, 0.49326131],
-												 [	-6.27335648, -0.00033922, 0.00020780, 7.27301726, 0.99896383, 0.99945297, 0.49326131],
-												 [	-6.27335657, -0.00033919, 0.00020778, 7.27301739, 0.99896394, 0.99945303, 0.49326137],
-												 [	-6.27335666, -0.00033915, 0.00020776, 7.27301751, 0.99896405, 0.99945309, 0.49326160],
-												 [	-6.27335675, -0.00033911, 0.00020773, 7.27301764, 0.99896417, 0.99945315, 0.49326160],
-												 [	-6.27335684, -0.00033908, 0.00020771, 7.27301776, 0.99896428, 0.99945321, 0.49326123],
-												 [	-6.27335693, -0.00033904, 0.00020769, 7.27301789, 0.99896439, 0.99945327, 0.49326161],
-												 [	-6.27335702, -0.00033900, 0.00020766, 7.27301802, 0.99896451, 0.99945333, 0.49326152],
-												 [	-6.27335711, -0.00033896, 0.00020764, 7.27301814, 0.99896462, 0.99945339, 0.49326143],
-												 [	-6.27335720, -0.00033893, 0.00020762, 7.27301827, 0.99896473, 0.99945345, 0.49326145],
-												 [	-6.27335728, -0.00033889, 0.00020760, 7.27301839, 0.99896485, 0.99945351, 0.49326173],
-												 [	-6.27335737, -0.00033885, 0.00020757, 7.27301852, 0.99896496, 0.99945357, 0.49326144],
-												 [	-6.27335746, -0.00033882, 0.00020755, 7.27301865, 0.99896507, 0.99945363, 0.49326151],
-												 [	-6.27335755, -0.00033878, 0.00020753, 7.27301877, 0.99896519, 0.99945369, 0.49326137],
-												 [	-6.27335764, -0.00033874, 0.00020751, 7.27301890, 0.99896530, 0.99945375, 0.49326159],
-												 [	-6.27335773, -0.00033870, 0.00020748, 7.27301902, 0.99896541, 0.99945381, 0.49326170],
-												 [	-6.27335782, -0.00033867, 0.00020746, 7.27301915, 0.99896553, 0.99945387, 0.49326167],
-												 [	-6.27335791, -0.00033863, 0.00020744, 7.27301927, 0.99896564, 0.99945393, 0.49326166],
-												 [	-6.27335799, -0.00033859, 0.00020741, 7.27301940, 0.99896575, 0.99945399, 0.49326169],
-												 [	-6.27335808, -0.00033856, 0.00020739, 7.27301953, 0.99896587, 0.99945405, 0.49326162],
-												 [	-6.27335817, -0.00033852, 0.00020737, 7.27301965, 0.99896598, 0.99945411, 0.49326183],
-												 [	-6.27335826, -0.00033848, 0.00020735, 7.27301978, 0.99896609, 0.99945417, 0.49326173],
-												 [	-6.27335835, -0.00033845, 0.00020732, 7.27301990, 0.99896621, 0.99945423, 0.49326171],
-												 [	-6.27335844, -0.00033841, 0.00020730, 7.27302003, 0.99896632, 0.99945429, 0.49326166],
-												 [	-6.27335853, -0.00033837, 0.00020728, 7.27302015, 0.99896643, 0.99945435, 0.49326165],
-												 [	-6.27335861, -0.00033833, 0.00020726, 7.27302028, 0.99896655, 0.99945441, 0.49326181],
-												 [	-6.27335870, -0.00033830, 0.00020723, 7.27302041, 0.99896666, 0.99945447, 0.49326156],
-												 [	-6.27335879, -0.00033826, 0.00020721, 7.27302053, 0.99896677, 0.99945453, 0.49326193],
-												 [	-6.27335888, -0.00033822, 0.00020719, 7.27302066, 0.99896688, 0.99945459, 0.49326181],
-												 [	-6.27335897, -0.00033819, 0.00020716, 7.27302078, 0.99896700, 0.99945465, 0.49326163],
-												 [	-6.27335906, -0.00033815, 0.00020714, 7.27302091, 0.99896711, 0.99945471, 0.49326173],
-												 [	-6.27335915, -0.00033811, 0.00020712, 7.27302103, 0.99896722, 0.99945477, 0.49326188],
-												 [	-6.27335923, -0.00033808, 0.00020710, 7.27302116, 0.99896734, 0.99945483, 0.49326193],
-												 [	-6.27335932, -0.00033804, 0.00020707, 7.27302128, 0.99896745, 0.99945489, 0.49326203],
-												 [	-6.27335941, -0.00033800, 0.00020705, 7.27302141, 0.99896756, 0.99945495, 0.49326181],
-												 [	-6.27335950, -0.00033797, 0.00020703, 7.27302153, 0.99896767, 0.99945501, 0.49326178],
-												 [	-6.27335959, -0.00033793, 0.00020701, 7.27302166, 0.99896779, 0.99945507, 0.49326183],
-												 [	-6.27335968, -0.00033789, 0.00020698, 7.27302178, 0.99896790, 0.99945512, 0.49326183],
-												 [	-6.27335976, -0.00033785, 0.00020696, 7.27302191, 0.99896801, 0.99945518, 0.49326190],
-												 [	-6.27335985, -0.00033782, 0.00020694, 7.27302203, 0.99896813, 0.99945524, 0.49326204],
-												 [	-6.27335994, -0.00033778, 0.00020692, 7.27302216, 0.99896824, 0.99945530, 0.49326197],
-												 [	-6.27336003, -0.00033774, 0.00020689, 7.27302228, 0.99896835, 0.99945536, 0.49326200],
-												 [	-6.27336012, -0.00033771, 0.00020687, 7.27302241, 0.99896846, 0.99945542, 0.49326187],
-												 [	-6.27336021, -0.00033767, 0.00020685, 7.27302253, 0.99896858, 0.99945548, 0.49326214],
-												 [	-6.27336029, -0.00033763, 0.00020683, 7.27302266, 0.99896869, 0.99945554, 0.49326210],
-												 [	-6.27336038, -0.00033760, 0.00020680, 7.27302278, 0.99896880, 0.99945560, 0.49326210],
-												 [	-6.27336047, -0.00033756, 0.00020678, 7.27302291, 0.99896891, 0.99945566, 0.49326201],
-												 [	-6.27336056, -0.00033752, 0.00020676, 7.27302303, 0.99896903, 0.99945572, 0.49326223],
-												 [	-6.27336065, -0.00033749, 0.00020674, 7.27302316, 0.99896914, 0.99945578, 0.49326214],
-												 [	-6.27336073, -0.00033745, 0.00020671, 7.27302328, 0.99896925, 0.99945584, 0.49326184],
-												 [	-6.27336082, -0.00033741, 0.00020669, 7.27302341, 0.99896936, 0.99945590, 0.49326190],
-												 [	-6.27336091, -0.00033738, 0.00020667, 7.27302353, 0.99896948, 0.99945596, 0.49326192],
-												 [	-6.27336100, -0.00033734, 0.00020665, 7.27302366, 0.99896959, 0.99945602, 0.49326215],
-												 [	-6.27336109, -0.00033730, 0.00020662, 7.27302378, 0.99896970, 0.99945607, 0.49326198],
-												 [	-6.27336117, -0.00033727, 0.00020660, 7.27302391, 0.99896981, 0.99945613, 0.49326211],
-												 [	-6.27336126, -0.00033723, 0.00020658, 7.27302403, 0.99896992, 0.99945619, 0.49326202],
-												 [	-6.27336135, -0.00033719, 0.00020656, 7.27302416, 0.99897004, 0.99945625, 0.49326208],
-												 [	-6.27336144, -0.00033716, 0.00020653, 7.27302428, 0.99897015, 0.99945631, 0.49326216],
-												 [	-6.27336153, -0.00033712, 0.00020651, 7.27302441, 0.99897026, 0.99945637, 0.49326199],
-												 [	-6.27336161, -0.00033708, 0.00020649, 7.27302453, 0.99897037, 0.99945643, 0.49326218],
-												 [	-6.27336170, -0.00033705, 0.00020647, 7.27302466, 0.99897049, 0.99945649, 0.49326214],
-												 [	-6.27336179, -0.00033701, 0.00020644, 7.27302478, 0.99897060, 0.99945655, 0.49326240],
-												 [	-6.27336188, -0.00033697, 0.00020642, 7.27302491, 0.99897071, 0.99945661, 0.49326199],
-												 [	-6.27336197, -0.00033694, 0.00020640, 7.27302503, 0.99897082, 0.99945667, 0.49326203],
-												 [	-6.27336205, -0.00033690, 0.00020638, 7.27302515, 0.99897093, 0.99945673, 0.49326224],
-												 [	-6.27336214, -0.00033686, 0.00020635, 7.27302528, 0.99897105, 0.99945679, 0.49326220],
-												 [	-6.27336223, -0.00033683, 0.00020633, 7.27302540, 0.99897116, 0.99945684, 0.49326222],
-												 [	-6.27336232, -0.00033679, 0.00020631, 7.27302553, 0.99897127, 0.99945690, 0.49326242],
-												 [	-6.27336240, -0.00033675, 0.00020629, 7.27302565, 0.99897138, 0.99945696, 0.49326213],
-												 [	-6.27336249, -0.00033672, 0.00020626, 7.27302578, 0.99897149, 0.99945702, 0.49326219],
-												 [	-6.27336258, -0.00033668, 0.00020624, 7.27302590, 0.99897161, 0.99945708, 0.49326219],
-												 [	-6.27336267, -0.00033664, 0.00020622, 7.27302603, 0.99897172, 0.99945714, 0.49326250],
-												 [	-6.27336275, -0.00033661, 0.00020620, 7.27302615, 0.99897183, 0.99945720, 0.49326244],
-												 [	-6.27336284, -0.00033657, 0.00020617, 7.27302627, 0.99897194, 0.99945726, 0.49326221],
-												 [	-6.27336293, -0.00033653, 0.00020615, 7.27302640, 0.99897205, 0.99945732, 0.49326264],
-												 [	-6.27336302, -0.00033650, 0.00020613, 7.27302652, 0.99897216, 0.99945738, 0.49326232],
-												 [	-6.27336311, -0.00033646, 0.00020611, 7.27302665, 0.99897228, 0.99945743, 0.49326230],
-												 [	-6.27336319, -0.00033642, 0.00020608, 7.27302677, 0.99897239, 0.99945749, 0.49326227],
-												 [	-6.27336328, -0.00033639, 0.00020606, 7.27302689, 0.99897250, 0.99945755, 0.49326245],
-												 [	-6.27336337, -0.00033635, 0.00020604, 7.27302702, 0.99897261, 0.99945761, 0.49326242],
-												 [	-6.27336346, -0.00033631, 0.00020602, 7.27302714, 0.99897272, 0.99945767, 0.49326246],
-												 [	-6.27336354, -0.00033628, 0.00020599, 7.27302727, 0.99897283, 0.99945773, 0.49326241],
-												 [	-6.27336363, -0.00033624, 0.00020597, 7.27302739, 0.99897295, 0.99945779, 0.49326240],
-												 [	-6.27336372, -0.00033620, 0.00020595, 7.27302751, 0.99897306, 0.99945785, 0.49326249],
-												 [	-6.27336381, -0.00033617, 0.00020593, 7.27302764, 0.99897317, 0.99945791, 0.49326270],
-												 [	-6.27336389, -0.00033613, 0.00020590, 7.27302776, 0.99897328, 0.99945797, 0.49326235],
-												 [	-6.27336398, -0.00033609, 0.00020588, 7.27302789, 0.99897339, 0.99945802, 0.49326239],
-												 [	-6.27336407, -0.00033606, 0.00020586, 7.27302801, 0.99897350, 0.99945808, 0.49326248],
-												 [	-6.27336415, -0.00033602, 0.00020584, 7.27302813, 0.99897362, 0.99945814, 0.49326264],
-												 [	-6.27336424, -0.00033598, 0.00020582, 7.27302826, 0.99897373, 0.99945820, 0.49326263],
-												 [	-6.27336433, -0.00033595, 0.00020579, 7.27302838, 0.99897384, 0.99945826, 0.49326243],
-												 [	-6.27336442, -0.00033591, 0.00020577, 7.27302851, 0.99897395, 0.99945832, 0.49326267],
-												 [	-6.27336450, -0.00033587, 0.00020575, 7.27302863, 0.99897406, 0.99945838, 0.49326234],
-												 [	-6.27336459, -0.00033584, 0.00020573, 7.27302875, 0.99897417, 0.99945844, 0.49326251],
-												 [	-6.27336468, -0.00033580, 0.00020570, 7.27302888, 0.99897428, 0.99945849, 0.49326259],
-												 [	-6.27336477, -0.00033577, 0.00020568, 7.27302900, 0.99897439, 0.99945855, 0.49326266],
-												 [	-6.27336485, -0.00033573, 0.00020566, 7.27302912, 0.99897451, 0.99945861, 0.49326257],
-												 [	-6.27336494, -0.00033569, 0.00020564, 7.27302925, 0.99897462, 0.99945867, 0.49326257],
-												 [	-6.27336503, -0.00033566, 0.00020561, 7.27302937, 0.99897473, 0.99945873, 0.49326264],
-												 [	-6.27336511, -0.00033562, 0.00020559, 7.27302949, 0.99897484, 0.99945879, 0.49326274],
-												 [	-6.27336520, -0.00033558, 0.00020557, 7.27302962, 0.99897495, 0.99945885, 0.49326286],
-												 [	-6.27336529, -0.00033555, 0.00020555, 7.27302974, 0.99897506, 0.99945891, 0.49326289],
-												 [	-6.27336538, -0.00033551, 0.00020553, 7.27302986, 0.99897517, 0.99945896, 0.49326274],
-												 [	-6.27336546, -0.00033547, 0.00020550, 7.27302999, 0.99897528, 0.99945902, 0.49326267],
-												 [	-6.27336555, -0.00033544, 0.00020548, 7.27303011, 0.99897540, 0.99945908, 0.49326282],
-												 [	-6.27336564, -0.00033540, 0.00020546, 7.27303023, 0.99897551, 0.99945914, 0.49326268],
-												 [	-6.27336572, -0.00033537, 0.00020544, 7.27303036, 0.99897562, 0.99945920, 0.49326305],
-												 [	-6.27336581, -0.00033533, 0.00020541, 7.27303048, 0.99897573, 0.99945926, 0.49326276],
-												 [	-6.27336590, -0.00033529, 0.00020539, 7.27303060, 0.99897584, 0.99945932, 0.49326281],
-												 [	-6.27336598, -0.00033526, 0.00020537, 7.27303073, 0.99897595, 0.99945937, 0.49326294],
-												 [	-6.27336607, -0.00033522, 0.00020535, 7.27303085, 0.99897606, 0.99945943, 0.49326286],
-												 [	-6.27336616, -0.00033518, 0.00020532, 7.27303097, 0.99897617, 0.99945949, 0.49326281],
-												 [	-6.27336625, -0.00033515, 0.00020530, 7.27303110, 0.99897628, 0.99945955, 0.49326286],
-												 [	-6.27336633, -0.00033511, 0.00020528, 7.27303122, 0.99897639, 0.99945961, 0.49326297],
-												 [	-6.27336642, -0.00033508, 0.00020526, 7.27303134, 0.99897650, 0.99945967, 0.49326279],
-												 [	-6.27336651, -0.00033504, 0.00020524, 7.27303147, 0.99897662, 0.99945973, 0.49326311],
-												 [	-6.27336659, -0.00033500, 0.00020521, 7.27303159, 0.99897673, 0.99945978, 0.49326289],
-												 [	-6.27336668, -0.00033497, 0.00020519, 7.27303171, 0.99897684, 0.99945984, 0.49326305],
-												 [	-6.27336677, -0.00033493, 0.00020517, 7.27303184, 0.99897695, 0.99945990, 0.49326297],
-												 [	-6.27336685, -0.00033489, 0.00020515, 7.27303196, 0.99897706, 0.99945996, 0.49326277],
-												 [	-6.27336694, -0.00033486, 0.00020512, 7.27303208, 0.99897717, 0.99946002, 0.49326308],
-												 [	-6.27336703, -0.00033482, 0.00020510, 7.27303221, 0.99897728, 0.99946008, 0.49326289],
-												 [	-6.27336711, -0.00033479, 0.00020508, 7.27303233, 0.99897739, 0.99946013, 0.49326298],
-												 [	-6.27336720, -0.00033475, 0.00020506, 7.27303245, 0.99897750, 0.99946019, 0.49326300],
-												 [	-6.27336729, -0.00033471, 0.00020504, 7.27303257, 0.99897761, 0.99946025, 0.49326304],
-												 [	-6.27336737, -0.00033468, 0.00020501, 7.27303270, 0.99897772, 0.99946031, 0.49326311],
-												 [	-6.27336746, -0.00033464, 0.00020499, 7.27303282, 0.99897783, 0.99946037, 0.49326309],
-												 [	-6.27336755, -0.00033460, 0.00020497, 7.27303294, 0.99897794, 0.99946043, 0.49326303],
-												 [	-6.27336763, -0.00033457, 0.00020495, 7.27303306, 0.99897805, 0.99946048, 0.49326308],
-												 [	-6.27336772, -0.00033453, 0.00020493, 7.27303319, 0.99897816, 0.99946054, 0.49326287],
-												 [	-6.27336781, -0.00033450, 0.00020490, 7.27303331, 0.99897827, 0.99946060, 0.49326314],
-												 [	-6.27336789, -0.00033446, 0.00020488, 7.27303343, 0.99897839, 0.99946066, 0.49326307],
-												 [	-6.27336798, -0.00033442, 0.00020486, 7.27303356, 0.99897850, 0.99946072, 0.49326307],
-												 [	-6.27336807, -0.00033439, 0.00020484, 7.27303368, 0.99897861, 0.99946078, 0.49326322],
-												 [	-6.27336815, -0.00033435, 0.00020481, 7.27303380, 0.99897872, 0.99946083, 0.49326311],
-												 [	-6.27336824, -0.00033432, 0.00020479, 7.27303392, 0.99897883, 0.99946089, 0.49326322],
-												 [	-6.27336833, -0.00033428, 0.00020477, 7.27303405, 0.99897894, 0.99946095, 0.49326339],
-												 [	-6.27336841, -0.00033424, 0.00020475, 7.27303417, 0.99897905, 0.99946101, 0.49326319],
-												 [	-6.27336850, -0.00033421, 0.00020473, 7.27303429, 0.99897916, 0.99946107, 0.49326315],
-												 [	-6.27336858, -0.00033417, 0.00020470, 7.27303441, 0.99897927, 0.99946113, 0.49326326],
-												 [	-6.27336867, -0.00033413, 0.00020468, 7.27303454, 0.99897938, 0.99946118, 0.49326320],
-												 [	-6.27336876, -0.00033410, 0.00020466, 7.27303466, 0.99897949, 0.99946124, 0.49326335],
-												 [	-6.27336884, -0.00033406, 0.00020464, 7.27303478, 0.99897960, 0.99946130, 0.49326321],
-												 [	-6.27336893, -0.00033403, 0.00020462, 7.27303490, 0.99897971, 0.99946136, 0.49326341],
-												 [	-6.27336902, -0.00033399, 0.00020459, 7.27303503, 0.99897982, 0.99946142, 0.49326319],
-												 [	-6.27336910, -0.00033395, 0.00020457, 7.27303515, 0.99897993, 0.99946147, 0.49326349],
-												 [	-6.27336919, -0.00033392, 0.00020455, 7.27303527, 0.99898004, 0.99946153, 0.49326330],
-												 [	-6.27336927, -0.00033388, 0.00020453, 7.27303539, 0.99898015, 0.99946159, 0.49326316],
-												 [	-6.27336936, -0.00033385, 0.00020451, 7.27303551, 0.99898026, 0.99946165, 0.49326319],
-												 [	-6.27336945, -0.00033381, 0.00020448, 7.27303564, 0.99898037, 0.99946171, 0.49326337],
-												 [	-6.27336953, -0.00033377, 0.00020446, 7.27303576, 0.99898048, 0.99946176, 0.49326350],
-												 [	-6.27336962, -0.00033374, 0.00020444, 7.27303588, 0.99898059, 0.99946182, 0.49326333],
-												 [	-6.27336971, -0.00033370, 0.00020442, 7.27303600, 0.99898070, 0.99946188, 0.49326343],
-												 [	-6.27336979, -0.00033367, 0.00020439, 7.27303613, 0.99898081, 0.99946194, 0.49326342],
-												 [	-6.27336988, -0.00033363, 0.00020437, 7.27303625, 0.99898092, 0.99946200, 0.49326348],
-												 [	-6.27336996, -0.00033359, 0.00020435, 7.27303637, 0.99898103, 0.99946205, 0.49326358],
-												 [	-6.27337005, -0.00033356, 0.00020433, 7.27303649, 0.99898114, 0.99946211, 0.49326344],
-												 [	-6.27337014, -0.00033352, 0.00020431, 7.27303661, 0.99898125, 0.99946217, 0.49326333],
-												 [	-6.27337022, -0.00033349, 0.00020428, 7.27303674, 0.99898136, 0.99946223, 0.49326344],
-												 [	-6.27337031, -0.00033345, 0.00020426, 7.27303686, 0.99898147, 0.99946229, 0.49326346],
-												 [	-6.27337039, -0.00033342, 0.00020424, 7.27303698, 0.99898158, 0.99946234, 0.49326354],
-												 [	-6.27337048, -0.00033338, 0.00020422, 7.27303710, 0.99898169, 0.99946240, 0.49326336],
-												 [	-6.27337057, -0.00033334, 0.00020420, 7.27303722, 0.99898180, 0.99946246, 0.49326349],
-												 [	-6.27337065, -0.00033331, 0.00020417, 7.27303734, 0.99898191, 0.99946252, 0.49326348],
-												 [	-6.27337074, -0.00033327, 0.00020415, 7.27303747, 0.99898202, 0.99946258, 0.49326342],
-												 [	-6.27337082, -0.00033324, 0.00020413, 7.27303759, 0.99898213, 0.99946263, 0.49326343],
-												 [	-6.27337091, -0.00033320, 0.00020411, 7.27303771, 0.99898224, 0.99946269, 0.49326362],
-												 [	-6.27337100, -0.00033316, 0.00020409, 7.27303783, 0.99898234, 0.99946275, 0.49326356],
-												 [	-6.27337108, -0.00033313, 0.00020406, 7.27303795, 0.99898245, 0.99946281, 0.49326362],
-												 [	-6.27337117, -0.00033309, 0.00020404, 7.27303808, 0.99898256, 0.99946287, 0.49326353],
-												 [	-6.27337125, -0.00033306, 0.00020402, 7.27303820, 0.99898267, 0.99946292, 0.49326384],
-												 [	-6.27337134, -0.00033302, 0.00020400, 7.27303832, 0.99898278, 0.99946298, 0.49326355],
-												 [	-6.27337142, -0.00033298, 0.00020398, 7.27303844, 0.99898289, 0.99946304, 0.49326361],
-												 [	-6.27337151, -0.00033295, 0.00020395, 7.27303856, 0.99898300, 0.99946310, 0.49326362],
-												 [	-6.27337160, -0.00033291, 0.00020393, 7.27303868, 0.99898311, 0.99946315, 0.49326349],
-												 [	-6.27337168, -0.00033288, 0.00020391, 7.27303880, 0.99898322, 0.99946321, 0.49326369],
-												 [	-6.27337177, -0.00033284, 0.00020389, 7.27303893, 0.99898333, 0.99946327, 0.49326369],
-												 [	-6.27337185, -0.00033281, 0.00020387, 7.27303905, 0.99898344, 0.99946333, 0.49326369],
-												 [	-6.27337194, -0.00033277, 0.00020385, 7.27303917, 0.99898355, 0.99946338, 0.49326367],
-												 [	-6.27337202, -0.00033273, 0.00020382, 7.27303929, 0.99898366, 0.99946344, 0.49326359],
-												 [	-6.27337211, -0.00033270, 0.00020380, 7.27303941, 0.99898377, 0.99946350, 0.49326376],
-												 [	-6.27337220, -0.00033266, 0.00020378, 7.27303953, 0.99898388, 0.99946356, 0.49326382],
-												 [	-6.27337228, -0.00033263, 0.00020376, 7.27303965, 0.99898399, 0.99946362, 0.49326384],
-												 [	-6.27337237, -0.00033259, 0.00020374, 7.27303978, 0.99898409, 0.99946367, 0.49326379],
-												 [	-6.27337245, -0.00033256, 0.00020371, 7.27303990, 0.99898420, 0.99946373, 0.49326389],
-												 [	-6.27337254, -0.00033252, 0.00020369, 7.27304002, 0.99898431, 0.99946379, 0.49326390],
-												 [	-6.27337262, -0.00033248, 0.00020367, 7.27304014, 0.99898442, 0.99946385, 0.49326379],
-												 [	-6.27337271, -0.00033245, 0.00020365, 7.27304026, 0.99898453, 0.99946390, 0.49326384],
-												 [	-6.27337279, -0.00033241, 0.00020363, 7.27304038, 0.99898464, 0.99946396, 0.49326381],
-												 [	-6.27337288, -0.00033238, 0.00020360, 7.27304050, 0.99898475, 0.99946402, 0.49326372],
-												 [	-6.27337297, -0.00033234, 0.00020358, 7.27304062, 0.99898486, 0.99946408, 0.49326377],
-												 [	-6.27337305, -0.00033231, 0.00020356, 7.27304075, 0.99898497, 0.99946413, 0.49326406],
-												 [	-6.27337314, -0.00033227, 0.00020354, 7.27304087, 0.99898508, 0.99946419, 0.49326380],
-												 [	-6.27337322, -0.00033223, 0.00020352, 7.27304099, 0.99898519, 0.99946425, 0.49326407],
-												 [	-6.27337331, -0.00033220, 0.00020350, 7.27304111, 0.99898529, 0.99946431, 0.49326377],
-												 [	-6.27337339, -0.00033216, 0.00020347, 7.27304123, 0.99898540, 0.99946436, 0.49326399],
-												 [	-6.27337348, -0.00033213, 0.00020345, 7.27304135, 0.99898551, 0.99946442, 0.49326392],
-												 [	-6.27337356, -0.00033209, 0.00020343, 7.27304147, 0.99898562, 0.99946448, 0.49326402],
-												 [	-6.27337365, -0.00033206, 0.00020341, 7.27304159, 0.99898573, 0.99946454, 0.49326407],
-												 [	-6.27337373, -0.00033202, 0.00020339, 7.27304171, 0.99898584, 0.99946459, 0.49326397],
-												 [	-6.27337382, -0.00033198, 0.00020336, 7.27304183, 0.99898595, 0.99946465, 0.49326388],
-												 [	-6.27337390, -0.00033195, 0.00020334, 7.27304196, 0.99898606, 0.99946471, 0.49326400],
-												 [	-6.27337399, -0.00033191, 0.00020332, 7.27304208, 0.99898616, 0.99946477, 0.49326405],
-												 [	-6.27337407, -0.00033188, 0.00020330, 7.27304220, 0.99898627, 0.99946482, 0.49326405],
-												 [	-6.27337416, -0.00033184, 0.00020328, 7.27304232, 0.99898638, 0.99946488, 0.49326395],
-												 [	-6.27337425, -0.00033181, 0.00020326, 7.27304244, 0.99898649, 0.99946494, 0.49326406],
-												 [	-6.27337433, -0.00033177, 0.00020323, 7.27304256, 0.99898660, 0.99946500, 0.49326412],
-												 [	-6.27337442, -0.00033174, 0.00020321, 7.27304268, 0.99898671, 0.99946505, 0.49326418],
-												 [	-6.27337450, -0.00033170, 0.00020319, 7.27304280, 0.99898682, 0.99946511, 0.49326405],
-												 [	-6.27337459, -0.00033166, 0.00020317, 7.27304292, 0.99898693, 0.99946517, 0.49326394],
-												 [	-6.27337467, -0.00033163, 0.00020315, 7.27304304, 0.99898703, 0.99946522, 0.49326407],
-												 [	-6.27337476, -0.00033159, 0.00020312, 7.27304316, 0.99898714, 0.99946528, 0.49326381],
-												 [	-6.27337484, -0.00033156, 0.00020310, 7.27304328, 0.99898725, 0.99946534, 0.49326400],
-												 [	-6.27337493, -0.00033152, 0.00020308, 7.27304340, 0.99898736, 0.99946540, 0.49326414],
-												 [	-6.27337501, -0.00033149, 0.00020306, 7.27304352, 0.99898747, 0.99946545, 0.49326426],
-												 [	-6.27337510, -0.00033145, 0.00020304, 7.27304364, 0.99898758, 0.99946551, 0.49326422],
-												 [	-6.27337518, -0.00033142, 0.00020302, 7.27304376, 0.99898768, 0.99946557, 0.49326412],
-												 [	-6.27337527, -0.00033138, 0.00020299, 7.27304389, 0.99898779, 0.99946563, 0.49326410],
-												 [	-6.27337535, -0.00033135, 0.00020297, 7.27304401, 0.99898790, 0.99946568, 0.49326415],
-												 [	-6.27337544, -0.00033131, 0.00020295, 7.27304413, 0.99898801, 0.99946574, 0.49326422],
-												 [	-6.27337552, -0.00033127, 0.00020293, 7.27304425, 0.99898812, 0.99946580, 0.49326416],
-												 [	-6.27337561, -0.00033124, 0.00020291, 7.27304437, 0.99898823, 0.99946585, 0.49326449],
-												 [	-6.27337569, -0.00033120, 0.00020289, 7.27304449, 0.99898833, 0.99946591, 0.49326425],
-												 [	-6.27337578, -0.00033117, 0.00020286, 7.27304461, 0.99898844, 0.99946597, 0.49326435],
-												 [	-6.27337586, -0.00033113, 0.00020284, 7.27304473, 0.99898855, 0.99946603, 0.49326445],
-												 [	-6.27337594, -0.00033110, 0.00020282, 7.27304485, 0.99898866, 0.99946608, 0.49326455],
-												 [	-6.27337603, -0.00033106, 0.00020280, 7.27304497, 0.99898877, 0.99946614, 0.49326433],
-												 [	-6.27337611, -0.00033103, 0.00020278, 7.27304509, 0.99898888, 0.99946620, 0.49326418],
-												 [	-6.27337620, -0.00033099, 0.00020275, 7.27304521, 0.99898898, 0.99946625, 0.49326429],
-												 [	-6.27337628, -0.00033096, 0.00020273, 7.27304533, 0.99898909, 0.99946631, 0.49326433],
-												 [	-6.27337637, -0.00033092, 0.00020271, 7.27304545, 0.99898920, 0.99946637, 0.49326438],
-												 [	-6.27337645, -0.00033088, 0.00020269, 7.27304557, 0.99898931, 0.99946643, 0.49326440],
-												 [	-6.27337654, -0.00033085, 0.00020267, 7.27304569, 0.99898942, 0.99946648, 0.49326448],
-												 [	-6.27337662, -0.00033081, 0.00020265, 7.27304581, 0.99898952, 0.99946654, 0.49326440],
-												 [	-6.27337671, -0.00033078, 0.00020262, 7.27304593, 0.99898963, 0.99946660, 0.49326441],
-												 [	-6.27337679, -0.00033074, 0.00020260, 7.27304605, 0.99898974, 0.99946665, 0.49326439],
-												 [	-6.27337688, -0.00033071, 0.00020258, 7.27304617, 0.99898985, 0.99946671, 0.49326444],
-												 [	-6.27337696, -0.00033067, 0.00020256, 7.27304629, 0.99898996, 0.99946677, 0.49326437],
-												 [	-6.27337705, -0.00033064, 0.00020254, 7.27304641, 0.99899006, 0.99946682, 0.49326463],
-												 [	-6.27337713, -0.00033060, 0.00020252, 7.27304653, 0.99899017, 0.99946688, 0.49326433],
-												 [	-6.27337721, -0.00033057, 0.00020250, 7.27304665, 0.99899028, 0.99946694, 0.49326452],
-												 [	-6.27337730, -0.00033053, 0.00020247, 7.27304677, 0.99899039, 0.99946700, 0.49326464],
-												 [	-6.27337738, -0.00033050, 0.00020245, 7.27304689, 0.99899050, 0.99946705, 0.49326462],
-												 [	-6.27337747, -0.00033046, 0.00020243, 7.27304701, 0.99899060, 0.99946711, 0.49326446],
-												 [	-6.27337755, -0.00033043, 0.00020241, 7.27304713, 0.99899071, 0.99946717, 0.49326448],
-												 [	-6.27337764, -0.00033039, 0.00020239, 7.27304725, 0.99899082, 0.99946722, 0.49326479],
-												 [	-6.27337772, -0.00033035, 0.00020237, 7.27304737, 0.99899093, 0.99946728, 0.49326445],
-												 [	-6.27337781, -0.00033032, 0.00020234, 7.27304749, 0.99899103, 0.99946734, 0.49326446],
-												 [	-6.27337789, -0.00033028, 0.00020232, 7.27304761, 0.99899114, 0.99946739, 0.49326446],
-												 [	-6.27337797, -0.00033025, 0.00020230, 7.27304773, 0.99899125, 0.99946745, 0.49326456],
-												 [	-6.27337806, -0.00033021, 0.00020228, 7.27304785, 0.99899136, 0.99946751, 0.49326462],
-												 [	-6.27337814, -0.00033018, 0.00020226, 7.27304796, 0.99899146, 0.99946756, 0.49326466],
-												 [	-6.27337823, -0.00033014, 0.00020224, 7.27304808, 0.99899157, 0.99946762, 0.49326469],
-												 [	-6.27337831, -0.00033011, 0.00020221, 7.27304820, 0.99899168, 0.99946768, 0.49326455],
-												 [	-6.27337840, -0.00033007, 0.00020219, 7.27304832, 0.99899179, 0.99946773, 0.49326445],
-												 [	-6.27337848, -0.00033004, 0.00020217, 7.27304844, 0.99899190, 0.99946779, 0.49326466],
-												 [	-6.27337856, -0.00033000, 0.00020215, 7.27304856, 0.99899200, 0.99946785, 0.49326467],
-												 [	-6.27337865, -0.00032997, 0.00020213, 7.27304868, 0.99899211, 0.99946790, 0.49326472],
-												 [	-6.27337873, -0.00032993, 0.00020211, 7.27304880, 0.99899222, 0.99946796, 0.49326465],
-												 [	-6.27337882, -0.00032990, 0.00020208, 7.27304892, 0.99899233, 0.99946802, 0.49326487],
-												 [	-6.27337890, -0.00032986, 0.00020206, 7.27304904, 0.99899243, 0.99946807, 0.49326453],
-												 [	-6.27337899, -0.00032983, 0.00020204, 7.27304916, 0.99899254, 0.99946813, 0.49326462],
-												 [	-6.27337907, -0.00032979, 0.00020202, 7.27304928, 0.99899265, 0.99946819, 0.49326466],
-												 [	-6.27337915, -0.00032976, 0.00020200, 7.27304940, 0.99899275, 0.99946824, 0.49326470],
-												 [	-6.27337924, -0.00032972, 0.00020198, 7.27304952, 0.99899286, 0.99946830, 0.49326485],
-												 [	-6.27337932, -0.00032969, 0.00020196, 7.27304964, 0.99899297, 0.99946836, 0.49326493],
-												 [	-6.27337941, -0.00032965, 0.00020193, 7.27304976, 0.99899308, 0.99946841, 0.49326472],
-												 [	-6.27337949, -0.00032962, 0.00020191, 7.27304987, 0.99899318, 0.99946847, 0.49326466],
-												 [	-6.27337957, -0.00032958, 0.00020189, 7.27304999, 0.99899329, 0.99946853, 0.49326475],
-												 [	-6.27337966, -0.00032955, 0.00020187, 7.27305011, 0.99899340, 0.99946858, 0.49326474],
-												 [	-6.27337974, -0.00032951, 0.00020185, 7.27305023, 0.99899351, 0.99946864, 0.49326494],
-												 [	-6.27337983, -0.00032948, 0.00020183, 7.27305035, 0.99899361, 0.99946870, 0.49326475],
-												 [	-6.27337991, -0.00032944, 0.00020181, 7.27305047, 0.99899372, 0.99946875, 0.49326504],
-												 [	-6.27337999, -0.00032941, 0.00020178, 7.27305059, 0.99899383, 0.99946881, 0.49326510],
-												 [	-6.27338008, -0.00032937, 0.00020176, 7.27305071, 0.99899393, 0.99946887, 0.49326506],
-												 [	-6.27338016, -0.00032934, 0.00020174, 7.27305083, 0.99899404, 0.99946892, 0.49326491],
-												 [	-6.27338025, -0.00032930, 0.00020172, 7.27305095, 0.99899415, 0.99946898, 0.49326495],
-												 [	-6.27338033, -0.00032927, 0.00020170, 7.27305106, 0.99899425, 0.99946904, 0.49326488],
-												 [	-6.27338041, -0.00032923, 0.00020168, 7.27305118, 0.99899436, 0.99946909, 0.49326492],
-												 [	-6.27338050, -0.00032920, 0.00020165, 7.27305130, 0.99899447, 0.99946915, 0.49326492],
-												 [	-6.27338058, -0.00032916, 0.00020163, 7.27305142, 0.99899458, 0.99946921, 0.49326493],
-												 [	-6.27338067, -0.00032913, 0.00020161, 7.27305154, 0.99899468, 0.99946926, 0.49326498],
-												 [	-6.27338075, -0.00032909, 0.00020159, 7.27305166, 0.99899479, 0.99946932, 0.49326509],
-												 [	-6.27338083, -0.00032906, 0.00020157, 7.27305178, 0.99899490, 0.99946938, 0.49326511],
-												 [	-6.27338092, -0.00032902, 0.00020155, 7.27305190, 0.99899500, 0.99946943, 0.49326491],
-												 [	-6.27338100, -0.00032899, 0.00020153, 7.27305201, 0.99899511, 0.99946949, 0.49326497],
-												 [	-6.27338108, -0.00032895, 0.00020150, 7.27305213, 0.99899522, 0.99946954, 0.49326517],
-												 [	-6.27338117, -0.00032892, 0.00020148, 7.27305225, 0.99899532, 0.99946960, 0.49326501],
-												 [	-6.27338125, -0.00032888, 0.00020146, 7.27305237, 0.99899543, 0.99946966, 0.49326506],
-												 [	-6.27338134, -0.00032885, 0.00020144, 7.27305249, 0.99899554, 0.99946971, 0.49326507],
-												 [	-6.27338142, -0.00032881, 0.00020142, 7.27305261, 0.99899564, 0.99946977, 0.49326497],
-												 [	-6.27338150, -0.00032878, 0.00020140, 7.27305273, 0.99899575, 0.99946983, 0.49326508],
-												 [	-6.27338159, -0.00032874, 0.00020138, 7.27305284, 0.99899586, 0.99946988, 0.49326522],
-												 [	-6.27338167, -0.00032871, 0.00020135, 7.27305296, 0.99899596, 0.99946994, 0.49326525],
-												 [	-6.27338175, -0.00032867, 0.00020133, 7.27305308, 0.99899607, 0.99946999, 0.49326527],
-												 [	-6.27338184, -0.00032864, 0.00020131, 7.27305320, 0.99899618, 0.99947005, 0.49326512],
-												 [	-6.27338192, -0.00032860, 0.00020129, 7.27305332, 0.99899628, 0.99947011, 0.49326544],
-												 [	-6.27338200, -0.00032857, 0.00020127, 7.27305344, 0.99899639, 0.99947016, 0.49326511],
-												 [	-6.27338209, -0.00032853, 0.00020125, 7.27305356, 0.99899650, 0.99947022, 0.49326525],
-												 [	-6.27338217, -0.00032850, 0.00020123, 7.27305367, 0.99899660, 0.99947028, 0.49326517],
-												 [	-6.27338225, -0.00032846, 0.00020121, 7.27305379, 0.99899671, 0.99947033, 0.49326515],
-												 [	-6.27338234, -0.00032843, 0.00020118, 7.27305391, 0.99899682, 0.99947039, 0.49326512],
-												 [	-6.27338242, -0.00032839, 0.00020116, 7.27305403, 0.99899692, 0.99947045, 0.49326510],
-												 [	-6.27338250, -0.00032836, 0.00020114, 7.27305415, 0.99899703, 0.99947050, 0.49326538],
-												 [	-6.27338259, -0.00032832, 0.00020112, 7.27305427, 0.99899714, 0.99947056, 0.49326526],
-												 [	-6.27338267, -0.00032829, 0.00020110, 7.27305438, 0.99899724, 0.99947061, 0.49326555],
-												 [	-6.27338275, -0.00032825, 0.00020108, 7.27305450, 0.99899735, 0.99947067, 0.49326559],
-												 [	-6.27338284, -0.00032822, 0.00020106, 7.27305462, 0.99899745, 0.99947073, 0.49326528],
-												 [	-6.27338292, -0.00032818, 0.00020103, 7.27305474, 0.99899756, 0.99947078, 0.49326542],
-												 [	-6.27338300, -0.00032815, 0.00020101, 7.27305486, 0.99899767, 0.99947084, 0.49326519],
-												 [	-6.27338309, -0.00032811, 0.00020099, 7.27305497, 0.99899777, 0.99947089, 0.49326536],
-												 [	-6.27338317, -0.00032808, 0.00020097, 7.27305509, 0.99899788, 0.99947095, 0.49326533],
-												 [	-6.27338325, -0.00032804, 0.00020095, 7.27305521, 0.99899799, 0.99947101, 0.49326540],
-												 [	-6.27338334, -0.00032801, 0.00020093, 7.27305533, 0.99899809, 0.99947106, 0.49326552],
-												 [	-6.27338342, -0.00032797, 0.00020091, 7.27305545, 0.99899820, 0.99947112, 0.49326543],
-												 [	-6.27338350, -0.00032794, 0.00020089, 7.27305556, 0.99899830, 0.99947117, 0.49326548],
-												 [	-6.27338359, -0.00032791, 0.00020086, 7.27305568, 0.99899841, 0.99947123, 0.49326555],
-												 [	-6.27338367, -0.00032787, 0.00020084, 7.27305580, 0.99899852, 0.99947129, 0.49326550],
-												 [	-6.27338375, -0.00032784, 0.00020082, 7.27305592, 0.99899862, 0.99947134, 0.49326539],
-												 [	-6.27338384, -0.00032780, 0.00020080, 7.27305604, 0.99899873, 0.99947140, 0.49326537],
-												 [	-6.27338392, -0.00032777, 0.00020078, 7.27305615, 0.99899884, 0.99947145, 0.49326540],
-												 [	-6.27338400, -0.00032773, 0.00020076, 7.27305627, 0.99899894, 0.99947151, 0.49326552],
-												 [	-6.27338409, -0.00032770, 0.00020074, 7.27305639, 0.99899905, 0.99947157, 0.49326544],
-												 [	-6.27338417, -0.00032766, 0.00020072, 7.27305651, 0.99899915, 0.99947162, 0.49326541],
-												 [	-6.27338425, -0.00032763, 0.00020069, 7.27305662, 0.99899926, 0.99947168, 0.49326544],
-												 [	-6.27338433, -0.00032759, 0.00020067, 7.27305674, 0.99899937, 0.99947173, 0.49326555],
-												 [	-6.27338442, -0.00032756, 0.00020065, 7.27305686, 0.99899947, 0.99947179, 0.49326592],
-												 [	-6.27338450, -0.00032752, 0.00020063, 7.27305698, 0.99899958, 0.99947185, 0.49326555],
-												 [	-6.27338458, -0.00032749, 0.00020061, 7.27305709, 0.99899968, 0.99947190, 0.49326556],
-												 [	-6.27338467, -0.00032745, 0.00020059, 7.27305721, 0.99899979, 0.99947196, 0.49326577],
-												 [	-6.27338475, -0.00032742, 0.00020057, 7.27305733, 0.99899989, 0.99947201, 0.49326572],
-												 [	-6.27338483, -0.00032739, 0.00020055, 7.27305745, 0.99900000, 0.99947207, 0.49326564],
-												 [	-6.27338492, -0.00032735, 0.00020052, 7.27305756, 0.99900011, 0.99947213, 0.49326574],
-												 [	-6.27338500, -0.00032732, 0.00020050, 7.27305768, 0.99900021, 0.99947218, 0.49326570],
-												 [	-6.27338508, -0.00032728, 0.00020048, 7.27305780, 0.99900032, 0.99947224, 0.49326585],
-												 [	-6.27338516, -0.00032725, 0.00020046, 7.27305792, 0.99900042, 0.99947229, 0.49326561],
-												 [	-6.27338525, -0.00032721, 0.00020044, 7.27305804, 0.99900053, 0.99947235, 0.49326554],
-												 [	-6.27338533, -0.00032718, 0.00020042, 7.27305815, 0.99900063, 0.99947240, 0.49326565],
-												 [	-6.27338541, -0.00032714, 0.00020040, 7.27305827, 0.99900074, 0.99947246, 0.49326560],
-												 [	-6.27338550, -0.00032711, 0.00020038, 7.27305839, 0.99900085, 0.99947252, 0.49326561],
-												 [	-6.27338558, -0.00032707, 0.00020035, 7.27305850, 0.99900095, 0.99947257, 0.49326588],
-												 [	-6.27338566, -0.00032704, 0.00020033, 7.27305862, 0.99900106, 0.99947263, 0.49326567],
-												 [	-6.27338574, -0.00032700, 0.00020031, 7.27305874, 0.99900116, 0.99947268, 0.49326573],
-												 [	-6.27338583, -0.00032697, 0.00020029, 7.27305886, 0.99900127, 0.99947274, 0.49326588],
-												 [	-6.27338591, -0.00032694, 0.00020027, 7.27305897, 0.99900137, 0.99947279, 0.49326587],
-												 [	-6.27338599, -0.00032690, 0.00020025, 7.27305909, 0.99900148, 0.99947285, 0.49326591],
-												 [	-6.27338607, -0.00032687, 0.00020023, 7.27305921, 0.99900158, 0.99947291, 0.49326568],
-												 [	-6.27338616, -0.00032683, 0.00020021, 7.27305932, 0.99900169, 0.99947296, 0.49326586],
-												 [	-6.27338624, -0.00032680, 0.00020019, 7.27305944, 0.99900180, 0.99947302, 0.49326595],
-												 [	-6.27338632, -0.00032676, 0.00020016, 7.27305956, 0.99900190, 0.99947307, 0.49326594],
-												 [	-6.27338640, -0.00032673, 0.00020014, 7.27305968, 0.99900201, 0.99947313, 0.49326576],
-												 [	-6.27338649, -0.00032669, 0.00020012, 7.27305979, 0.99900211, 0.99947318, 0.49326600],
-												 [	-6.27338657, -0.00032666, 0.00020010, 7.27305991, 0.99900222, 0.99947324, 0.49326567],
-												 [	-6.27338665, -0.00032663, 0.00020008, 7.27306003, 0.99900232, 0.99947330, 0.49326591],
-												 [	-6.27338674, -0.00032659, 0.00020006, 7.27306014, 0.99900243, 0.99947335, 0.49326584],
-												 [	-6.27338682, -0.00032656, 0.00020004, 7.27306026, 0.99900253, 0.99947341, 0.49326591],
-												 [	-6.27338690, -0.00032652, 0.00020002, 7.27306038, 0.99900264, 0.99947346, 0.49326598],
-												 [	-6.27338698, -0.00032649, 0.00020000, 7.27306050, 0.99900274, 0.99947352, 0.49326605],
-												 [	-6.27338706, -0.00032645, 0.00019997, 7.27306061, 0.99900285, 0.99947357, 0.49326584],
-												 [	-6.27338715, -0.00032642, 0.00019995, 7.27306073, 0.99900295, 0.99947363, 0.49326610],
-												 [	-6.27338723, -0.00032638, 0.00019993, 7.27306085, 0.99900306, 0.99947368, 0.49326584],
-												 [	-6.27338731, -0.00032635, 0.00019991, 7.27306096, 0.99900316, 0.99947374, 0.49326595],
-												 [	-6.27338739, -0.00032632, 0.00019989, 7.27306108, 0.99900327, 0.99947379, 0.49326574],
-												 [	-6.27338748, -0.00032628, 0.00019987, 7.27306120, 0.99900337, 0.99947385, 0.49326593],
-												 [	-6.27338756, -0.00032625, 0.00019985, 7.27306131, 0.99900348, 0.99947391, 0.49326617],
-												 [	-6.27338764, -0.00032621, 0.00019983, 7.27306143, 0.99900358, 0.99947396, 0.49326608],
-												 [	-6.27338772, -0.00032618, 0.00019981, 7.27306155, 0.99900369, 0.99947402, 0.49326601],
-												 [	-6.27338781, -0.00032614, 0.00019978, 7.27306166, 0.99900379, 0.99947407, 0.49326595],
-												 [	-6.27338789, -0.00032611, 0.00019976, 7.27306178, 0.99900390, 0.99947413, 0.49326615],
-												 [	-6.27338797, -0.00032607, 0.00019974, 7.27306190, 0.99900400, 0.99947418, 0.49326594],
-												 [	-6.27338805, -0.00032604, 0.00019972, 7.27306201, 0.99900411, 0.99947424, 0.49326623],
-												 [	-6.27338814, -0.00032601, 0.00019970, 7.27306213, 0.99900421, 0.99947429, 0.49326628],
-												 [	-6.27338822, -0.00032597, 0.00019968, 7.27306225, 0.99900432, 0.99947435, 0.49326618],
-												 [	-6.27338830, -0.00032594, 0.00019966, 7.27306236, 0.99900442, 0.99947440, 0.49326621],
-												 [	-6.27338838, -0.00032590, 0.00019964, 7.27306248, 0.99900453, 0.99947446, 0.49326598],
-												 [	-6.27338846, -0.00032587, 0.00019962, 7.27306260, 0.99900463, 0.99947452, 0.49326615],
-												 [	-6.27338855, -0.00032583, 0.00019960, 7.27306271, 0.99900474, 0.99947457, 0.49326647],
-												 [	-6.27338863, -0.00032580, 0.00019957, 7.27306283, 0.99900484, 0.99947463, 0.49326621],
-												 [	-6.27338871, -0.00032577, 0.00019955, 7.27306294, 0.99900495, 0.99947468, 0.49326643],
-												 [	-6.27338879, -0.00032573, 0.00019953, 7.27306306, 0.99900505, 0.99947474, 0.49326629],
-												 [	-6.27338887, -0.00032570, 0.00019951, 7.27306318, 0.99900516, 0.99947479, 0.49326635],
-												 [	-6.27338896, -0.00032566, 0.00019949, 7.27306329, 0.99900526, 0.99947485, 0.49326632],
-												 [	-6.27338904, -0.00032563, 0.00019947, 7.27306341, 0.99900537, 0.99947490, 0.49326626],
-												 [	-6.27338912, -0.00032559, 0.00019945, 7.27306353, 0.99900547, 0.99947496, 0.49326639],
-												 [	-6.27338920, -0.00032556, 0.00019943, 7.27306364, 0.99900558, 0.99947501, 0.49326627],
-												 [	-6.27338928, -0.00032553, 0.00019941, 7.27306376, 0.99900568, 0.99947507, 0.49326645],
-												 [	-6.27338937, -0.00032549, 0.00019939, 7.27306387, 0.99900578, 0.99947512, 0.49326623],
-												 [	-6.27338945, -0.00032546, 0.00019936, 7.27306399, 0.99900589, 0.99947518, 0.49326607],
-												 [	-6.27338953, -0.00032542, 0.00019934, 7.27306411, 0.99900599, 0.99947523, 0.49326641],
-												 [	-6.27338961, -0.00032539, 0.00019932, 7.27306422, 0.99900610, 0.99947529, 0.49326644],
-												 [	-6.27338969, -0.00032536, 0.00019930, 7.27306434, 0.99900620, 0.99947534, 0.49326635],
-												 [	-6.27338978, -0.00032532, 0.00019928, 7.27306446, 0.99900631, 0.99947540, 0.49326617],
-												 [	-6.27338986, -0.00032529, 0.00019926, 7.27306457, 0.99900641, 0.99947545, 0.49326647],
-												 [	-6.27338994, -0.00032525, 0.00019924, 7.27306469, 0.99900652, 0.99947551, 0.49326638],
-												 [	-6.27339002, -0.00032522, 0.00019922, 7.27306480, 0.99900662, 0.99947556, 0.49326625],
-												 [	-6.27339010, -0.00032518, 0.00019920, 7.27306492, 0.99900673, 0.99947562, 0.49326654],
-												 [	-6.27339019, -0.00032515, 0.00019918, 7.27306504, 0.99900683, 0.99947567, 0.49326643],
-												 [	-6.27339027, -0.00032512, 0.00019915, 7.27306515, 0.99900693, 0.99947573, 0.49326639],
-												 [	-6.27339035, -0.00032508, 0.00019913, 7.27306527, 0.99900704, 0.99947578, 0.49326643],
-												 [	-6.27339043, -0.00032505, 0.00019911, 7.27306538, 0.99900714, 0.99947584, 0.49326613],
-												 [	-6.27339051, -0.00032501, 0.00019909, 7.27306550, 0.99900725, 0.99947589, 0.49326635],
-												 [	-6.27339059, -0.00032498, 0.00019907, 7.27306561, 0.99900735, 0.99947595, 0.49326654],
-												 [	-6.27339068, -0.00032495, 0.00019905, 7.27306573, 0.99900746, 0.99947600, 0.49326649],
-												 [	-6.27339076, -0.00032491, 0.00019903, 7.27306585, 0.99900756, 0.99947606, 0.49326645],
-												 [	-6.27339084, -0.00032488, 0.00019901, 7.27306596, 0.99900766, 0.99947611, 0.49326635],
-												 [	-6.27339092, -0.00032484, 0.00019899, 7.27306608, 0.99900777, 0.99947617, 0.49326646],
-												 [	-6.27339100, -0.00032481, 0.00019897, 7.27306619, 0.99900787, 0.99947622, 0.49326660],
-												 [	-6.27339108, -0.00032477, 0.00019895, 7.27306631, 0.99900798, 0.99947628, 0.49326653],
-												 [	-6.27339117, -0.00032474, 0.00019892, 7.27306642, 0.99900808, 0.99947633, 0.49326655],
-												 [	-6.27339125, -0.00032471, 0.00019890, 7.27306654, 0.99900818, 0.99947639, 0.49326642],
-												 [	-6.27339133, -0.00032467, 0.00019888, 7.27306666, 0.99900829, 0.99947644, 0.49326648],
-												 [	-6.27339141, -0.00032464, 0.00019886, 7.27306677, 0.99900839, 0.99947650, 0.49326679],
-												 [	-6.27339149, -0.00032460, 0.00019884, 7.27306689, 0.99900850, 0.99947655, 0.49326686],
-												 [	-6.27339157, -0.00032457, 0.00019882, 7.27306700, 0.99900860, 0.99947661, 0.49326656],
-												 [	-6.27339165, -0.00032454, 0.00019880, 7.27306712, 0.99900870, 0.99947666, 0.49326662],
-												 [	-6.27339174, -0.00032450, 0.00019878, 7.27306723, 0.99900881, 0.99947672, 0.49326679],
-												 [	-6.27339182, -0.00032447, 0.00019876, 7.27306735, 0.99900891, 0.99947677, 0.49326673],
-												 [	-6.27339190, -0.00032443, 0.00019874, 7.27306746, 0.99900902, 0.99947683, 0.49326675],
-												 [	-6.27339198, -0.00032440, 0.00019872, 7.27306758, 0.99900912, 0.99947688, 0.49326682],
-												 [	-6.27339206, -0.00032437, 0.00019870, 7.27306770, 0.99900922, 0.99947694, 0.49326647],
-												 [	-6.27339214, -0.00032433, 0.00019867, 7.27306781, 0.99900933, 0.99947699, 0.49326653],
-												 [	-6.27339222, -0.00032430, 0.00019865, 7.27306793, 0.99900943, 0.99947705, 0.49326669],
-												 [	-6.27339231, -0.00032426, 0.00019863, 7.27306804, 0.99900954, 0.99947710, 0.49326657],
-												 [	-6.27339239, -0.00032423, 0.00019861, 7.27306816, 0.99900964, 0.99947716, 0.49326679],
-												 [	-6.27339247, -0.00032420, 0.00019859, 7.27306827, 0.99900974, 0.99947721, 0.49326690],
-												 [	-6.27339255, -0.00032416, 0.00019857, 7.27306839, 0.99900985, 0.99947727, 0.49326680],
-												 [	-6.27339263, -0.00032413, 0.00019855, 7.27306850, 0.99900995, 0.99947732, 0.49326670],
-												 [	-6.27339271, -0.00032409, 0.00019853, 7.27306862, 0.99901005, 0.99947738, 0.49326690],
-												 [	-6.27339279, -0.00032406, 0.00019851, 7.27306873, 0.99901016, 0.99947743, 0.49326682],
-												 [	-6.27339287, -0.00032403, 0.00019849, 7.27306885, 0.99901026, 0.99947749, 0.49326670],
-												 [	-6.27339296, -0.00032399, 0.00019847, 7.27306896, 0.99901036, 0.99947754, 0.49326689],
-												 [	-6.27339304, -0.00032396, 0.00019845, 7.27306908, 0.99901047, 0.99947760, 0.49326683],
-												 [	-6.27339312, -0.00032393, 0.00019843, 7.27306919, 0.99901057, 0.99947765, 0.49326682],
-												 [	-6.27339320, -0.00032389, 0.00019840, 7.27306931, 0.99901068, 0.99947770, 0.49326694],
-												 [	-6.27339328, -0.00032386, 0.00019838, 7.27306942, 0.99901078, 0.99947776, 0.49326682],
-												 [	-6.27339336, -0.00032382, 0.00019836, 7.27306954, 0.99901088, 0.99947781, 0.49326696],
-												 [	-6.27339344, -0.00032379, 0.00019834, 7.27306965, 0.99901099, 0.99947787, 0.49326703],
-												 [	-6.27339352, -0.00032376, 0.00019832, 7.27306977, 0.99901109, 0.99947792, 0.49326705],
-												 [	-6.27339360, -0.00032372, 0.00019830, 7.27306988, 0.99901119, 0.99947798, 0.49326683],
-												 [	-6.27339369, -0.00032369, 0.00019828, 7.27307000, 0.99901130, 0.99947803, 0.49326692],
-												 [	-6.27339377, -0.00032365, 0.00019826, 7.27307011, 0.99901140, 0.99947809, 0.49326694],
-												 [	-6.27339385, -0.00032362, 0.00019824, 7.27307023, 0.99901150, 0.99947814, 0.49326688],
-												 [	-6.27339393, -0.00032359, 0.00019822, 7.27307034, 0.99901161, 0.99947820, 0.49326687],
-												 [	-6.27339401, -0.00032355, 0.00019820, 7.27307046, 0.99901171, 0.99947825, 0.49326697],
-												 [	-6.27339409, -0.00032352, 0.00019818, 7.27307057, 0.99901181, 0.99947830, 0.49326717],
-												 [	-6.27339417, -0.00032349, 0.00019816, 7.27307069, 0.99901192, 0.99947836, 0.49326712],
-												 [	-6.27339425, -0.00032345, 0.00019813, 7.27307080, 0.99901202, 0.99947841, 0.49326703],
-												 [	-6.27339433, -0.00032342, 0.00019811, 7.27307092, 0.99901212, 0.99947847, 0.49326706],
-												 [	-6.27339441, -0.00032338, 0.00019809, 7.27307103, 0.99901223, 0.99947852, 0.49326716],
-												 [	-6.27339450, -0.00032335, 0.00019807, 7.27307115, 0.99901233, 0.99947858, 0.49326689],
-												 [	-6.27339458, -0.00032332, 0.00019805, 7.27307126, 0.99901243, 0.99947863, 0.49326699],
-												 [	-6.27339466, -0.00032328, 0.00019803, 7.27307137, 0.99901254, 0.99947869, 0.49326696],
-												 [	-6.27339474, -0.00032325, 0.00019801, 7.27307149, 0.99901264, 0.99947874, 0.49326718],
-												 [	-6.27339482, -0.00032321, 0.00019799, 7.27307160, 0.99901274, 0.99947880, 0.49326717],
-												 [	-6.27339490, -0.00032318, 0.00019797, 7.27307172, 0.99901285, 0.99947885, 0.49326705],
-												 [	-6.27339498, -0.00032315, 0.00019795, 7.27307183, 0.99901295, 0.99947890, 0.49326716],
-												 [	-6.27339506, -0.00032311, 0.00019793, 7.27307195, 0.99901305, 0.99947896, 0.49326730],
-												 [	-6.27339514, -0.00032308, 0.00019791, 7.27307206, 0.99901315, 0.99947901, 0.49326718],
-												 [	-6.27339522, -0.00032305, 0.00019789, 7.27307218, 0.99901326, 0.99947907, 0.49326722],
-												 [	-6.27339530, -0.00032301, 0.00019787, 7.27307229, 0.99901336, 0.99947912, 0.49326715],
-												 [	-6.27339538, -0.00032298, 0.00019785, 7.27307241, 0.99901346, 0.99947918, 0.49326728],
-												 [	-6.27339546, -0.00032295, 0.00019782, 7.27307252, 0.99901357, 0.99947923, 0.49326724],
-												 [	-6.27339555, -0.00032291, 0.00019780, 7.27307263, 0.99901367, 0.99947928, 0.49326701],
-												 [	-6.27339563, -0.00032288, 0.00019778, 7.27307275, 0.99901377, 0.99947934, 0.49326708],
-												 [	-6.27339571, -0.00032284, 0.00019776, 7.27307286, 0.99901388, 0.99947939, 0.49326726],
-												 [	-6.27339579, -0.00032281, 0.00019774, 7.27307298, 0.99901398, 0.99947945, 0.49326720],
-												 [	-6.27339587, -0.00032278, 0.00019772, 7.27307309, 0.99901408, 0.99947950, 0.49326714],
-												 [	-6.27339595, -0.00032274, 0.00019770, 7.27307321, 0.99901418, 0.99947956, 0.49326729],
-												 [	-6.27339603, -0.00032271, 0.00019768, 7.27307332, 0.99901429, 0.99947961, 0.49326744],
-												 [	-6.27339611, -0.00032268, 0.00019766, 7.27307343, 0.99901439, 0.99947966, 0.49326726],
-												 [	-6.27339619, -0.00032264, 0.00019764, 7.27307355, 0.99901449, 0.99947972, 0.49326746],
-												 [	-6.27339627, -0.00032261, 0.00019762, 7.27307366, 0.99901459, 0.99947977, 0.49326747],
-												 [	-6.27339635, -0.00032258, 0.00019760, 7.27307378, 0.99901470, 0.99947983, 0.49326746],
-												 [	-6.27339643, -0.00032254, 0.00019758, 7.27307389, 0.99901480, 0.99947988, 0.49326737],
-												 [	-6.27339651, -0.00032251, 0.00019756, 7.27307400, 0.99901490, 0.99947994, 0.49326725],
-												 [	-6.27339659, -0.00032247, 0.00019754, 7.27307412, 0.99901501, 0.99947999, 0.49326744],
-												 [	-6.27339667, -0.00032244, 0.00019752, 7.27307423, 0.99901511, 0.99948004, 0.49326734],
-												 [	-6.27339675, -0.00032241, 0.00019749, 7.27307435, 0.99901521, 0.99948010, 0.49326748],
-												 [	-6.27339683, -0.00032237, 0.00019747, 7.27307446, 0.99901531, 0.99948015, 0.49326735],
-												 [	-6.27339691, -0.00032234, 0.00019745, 7.27307457, 0.99901542, 0.99948021, 0.49326718],
-												 [	-6.27339699, -0.00032231, 0.00019743, 7.27307469, 0.99901552, 0.99948026, 0.49326726],
-												 [	-6.27339708, -0.00032227, 0.00019741, 7.27307480, 0.99901562, 0.99948031, 0.49326739],
-												 [	-6.27339716, -0.00032224, 0.00019739, 7.27307492, 0.99901572, 0.99948037, 0.49326736],
-												 [	-6.27339724, -0.00032221, 0.00019737, 7.27307503, 0.99901583, 0.99948042, 0.49326751],
-												 [	-6.27339732, -0.00032217, 0.00019735, 7.27307514, 0.99901593, 0.99948048, 0.49326746],
-												 [	-6.27339740, -0.00032214, 0.00019733, 7.27307526, 0.99901603, 0.99948053, 0.49326750],
-												 [	-6.27339748, -0.00032210, 0.00019731, 7.27307537, 0.99901613, 0.99948059, 0.49326720],
-												 [	-6.27339756, -0.00032207, 0.00019729, 7.27307549, 0.99901624, 0.99948064, 0.49326742],
-												 [	-6.27339764, -0.00032204, 0.00019727, 7.27307560, 0.99901634, 0.99948069, 0.49326770],
-												 [	-6.27339772, -0.00032200, 0.00019725, 7.27307571, 0.99901644, 0.99948075, 0.49326757],
-												 [	-6.27339780, -0.00032197, 0.00019723, 7.27307583, 0.99901654, 0.99948080, 0.49326750],
-												 [	-6.27339788, -0.00032194, 0.00019721, 7.27307594, 0.99901664, 0.99948086, 0.49326781],
-												 [	-6.27339796, -0.00032190, 0.00019719, 7.27307605, 0.99901675, 0.99948091, 0.49326776],
-												 [	-6.27339804, -0.00032187, 0.00019717, 7.27307617, 0.99901685, 0.99948096, 0.49326747],
-												 [	-6.27339812, -0.00032184, 0.00019715, 7.27307628, 0.99901695, 0.99948102, 0.49326778],
-												 [	-6.27339820, -0.00032180, 0.00019713, 7.27307639, 0.99901705, 0.99948107, 0.49326749],
-												 [	-6.27339828, -0.00032177, 0.00019710, 7.27307651, 0.99901716, 0.99948113, 0.49326751],
-												 [	-6.27339836, -0.00032174, 0.00019708, 7.27307662, 0.99901726, 0.99948118, 0.49326780],
-												 [	-6.27339844, -0.00032170, 0.00019706, 7.27307674, 0.99901736, 0.99948123, 0.49326747],
-												 [	-6.27339852, -0.00032167, 0.00019704, 7.27307685, 0.99901746, 0.99948129, 0.49326772],
-												 [	-6.27339860, -0.00032164, 0.00019702, 7.27307696, 0.99901756, 0.99948134, 0.49326768],
-												 [	-6.27339868, -0.00032160, 0.00019700, 7.27307708, 0.99901767, 0.99948139, 0.49326756],
-												 [	-6.27339876, -0.00032157, 0.00019698, 7.27307719, 0.99901777, 0.99948145, 0.49326753],
-												 [	-6.27339884, -0.00032154, 0.00019696, 7.27307730, 0.99901787, 0.99948150, 0.49326754],
-												 [	-6.27339892, -0.00032150, 0.00019694, 7.27307742, 0.99901797, 0.99948156, 0.49326763],
-												 [	-6.27339900, -0.00032147, 0.00019692, 7.27307753, 0.99901807, 0.99948161, 0.49326773],
-												 [	-6.27339908, -0.00032144, 0.00019690, 7.27307764, 0.99901818, 0.99948166, 0.49326760],
-												 [	-6.27339916, -0.00032140, 0.00019688, 7.27307776, 0.99901828, 0.99948172, 0.49326795],
-												 [	-6.27339924, -0.00032137, 0.00019686, 7.27307787, 0.99901838, 0.99948177, 0.49326781],
-												 [	-6.27339932, -0.00032134, 0.00019684, 7.27307798, 0.99901848, 0.99948183, 0.49326791],
-												 [	-6.27339940, -0.00032130, 0.00019682, 7.27307810, 0.99901858, 0.99948188, 0.49326782],
-												 [	-6.27339948, -0.00032127, 0.00019680, 7.27307821, 0.99901869, 0.99948193, 0.49326774],
-												 [	-6.27339956, -0.00032124, 0.00019678, 7.27307832, 0.99901879, 0.99948199, 0.49326801],
-												 [	-6.27339964, -0.00032120, 0.00019676, 7.27307843, 0.99901889, 0.99948204, 0.49326796],
-												 [	-6.27339972, -0.00032117, 0.00019674, 7.27307855, 0.99901899, 0.99948209, 0.49326796],
-												 [	-6.27339980, -0.00032114, 0.00019672, 7.27307866, 0.99901909, 0.99948215, 0.49326764],
-												 [	-6.27339988, -0.00032110, 0.00019670, 7.27307877, 0.99901920, 0.99948220, 0.49326786],
-												 [	-6.27339996, -0.00032107, 0.00019668, 7.27307889, 0.99901930, 0.99948226, 0.49326797],
-												 [	-6.27340004, -0.00032104, 0.00019665, 7.27307900, 0.99901940, 0.99948231, 0.49326772],
-												 [	-6.27340012, -0.00032100, 0.00019663, 7.27307911, 0.99901950, 0.99948236, 0.49326808],
-												 [	-6.27340020, -0.00032097, 0.00019661, 7.27307923, 0.99901960, 0.99948242, 0.49326793],
-												 [	-6.27340028, -0.00032094, 0.00019659, 7.27307934, 0.99901970, 0.99948247, 0.49326800],
-												 [	-6.27340036, -0.00032090, 0.00019657, 7.27307945, 0.99901981, 0.99948252, 0.49326818],
-												 [	-6.27340043, -0.00032087, 0.00019655, 7.27307956, 0.99901991, 0.99948258, 0.49326800],
-												 [	-6.27340051, -0.00032084, 0.00019653, 7.27307968, 0.99902001, 0.99948263, 0.49326833],
-												 [	-6.27340059, -0.00032080, 0.00019651, 7.27307979, 0.99902011, 0.99948268, 0.49326799],
-												 [	-6.27340067, -0.00032077, 0.00019649, 7.27307990, 0.99902021, 0.99948274, 0.49326805],
-												 [	-6.27340075, -0.00032074, 0.00019647, 7.27308002, 0.99902031, 0.99948279, 0.49326790],
-												 [	-6.27340083, -0.00032070, 0.00019645, 7.27308013, 0.99902042, 0.99948285, 0.49326822],
-												 [	-6.27340091, -0.00032067, 0.00019643, 7.27308024, 0.99902052, 0.99948290, 0.49326817],
-												 [	-6.27340099, -0.00032064, 0.00019641, 7.27308035, 0.99902062, 0.99948295, 0.49326820],
-												 [	-6.27340107, -0.00032060, 0.00019639, 7.27308047, 0.99902072, 0.99948301, 0.49326814],
-												 [	-6.27340115, -0.00032057, 0.00019637, 7.27308058, 0.99902082, 0.99948306, 0.49326794],
-												 [	-6.27340123, -0.00032054, 0.00019635, 7.27308069, 0.99902092, 0.99948311, 0.49326788],
-												 [	-6.27340131, -0.00032050, 0.00019633, 7.27308081, 0.99902102, 0.99948317, 0.49326824],
-												 [	-6.27340139, -0.00032047, 0.00019631, 7.27308092, 0.99902113, 0.99948322, 0.49326821],
-												 [	-6.27340147, -0.00032044, 0.00019629, 7.27308103, 0.99902123, 0.99948327, 0.49326804],
-												 [	-6.27340155, -0.00032040, 0.00019627, 7.27308114, 0.99902133, 0.99948333, 0.49326826],
-												 [	-6.27340163, -0.00032037, 0.00019625, 7.27308126, 0.99902143, 0.99948338, 0.49326837],
-												 [	-6.27340171, -0.00032034, 0.00019623, 7.27308137, 0.99902153, 0.99948343, 0.49326808],
-												 [	-6.27340179, -0.00032031, 0.00019621, 7.27308148, 0.99902163, 0.99948349, 0.49326814],
-												 [	-6.27340187, -0.00032027, 0.00019619, 7.27308159, 0.99902173, 0.99948354, 0.49326823],
-												 [	-6.27340194, -0.00032024, 0.00019617, 7.27308171, 0.99902183, 0.99948359, 0.49326820],
-												 [	-6.27340202, -0.00032021, 0.00019615, 7.27308182, 0.99902194, 0.99948365, 0.49326819],
-												 [	-6.27340210, -0.00032017, 0.00019613, 7.27308193, 0.99902204, 0.99948370, 0.49326828],
-												 [	-6.27340218, -0.00032014, 0.00019611, 7.27308204, 0.99902214, 0.99948376, 0.49326815],
-												 [	-6.27340226, -0.00032011, 0.00019608, 7.27308216, 0.99902224, 0.99948381, 0.49326833],
-												 [	-6.27340234, -0.00032007, 0.00019606, 7.27308227, 0.99902234, 0.99948386, 0.49326820],
-												 [	-6.27340242, -0.00032004, 0.00019604, 7.27308238, 0.99902244, 0.99948392, 0.49326839],
-												 [	-6.27340250, -0.00032001, 0.00019602, 7.27308249, 0.99902254, 0.99948397, 0.49326825],
-												 [	-6.27340258, -0.00031997, 0.00019600, 7.27308261, 0.99902264, 0.99948402, 0.49326820],
-												 [	-6.27340266, -0.00031994, 0.00019598, 7.27308272, 0.99902274, 0.99948408, 0.49326829],
-												 [	-6.27340274, -0.00031991, 0.00019596, 7.27308283, 0.99902285, 0.99948413, 0.49326838],
-												 [	-6.27340282, -0.00031987, 0.00019594, 7.27308294, 0.99902295, 0.99948418, 0.49326829],
-												 [	-6.27340290, -0.00031984, 0.00019592, 7.27308305, 0.99902305, 0.99948424, 0.49326812],
-												 [	-6.27340297, -0.00031981, 0.00019590, 7.27308317, 0.99902315, 0.99948429, 0.49326825],
-												 [	-6.27340305, -0.00031978, 0.00019588, 7.27308328, 0.99902325, 0.99948434, 0.49326844],
-												 [	-6.27340313, -0.00031974, 0.00019586, 7.27308339, 0.99902335, 0.99948440, 0.49326822],
-												 [	-6.27340321, -0.00031971, 0.00019584, 7.27308350, 0.99902345, 0.99948445, 0.49326848],
-												 [	-6.27340329, -0.00031968, 0.00019582, 7.27308361, 0.99902355, 0.99948450, 0.49326823],
-												 [	-6.27340337, -0.00031964, 0.00019580, 7.27308373, 0.99902365, 0.99948455, 0.49326831],
-												 [	-6.27340345, -0.00031961, 0.00019578, 7.27308384, 0.99902375, 0.99948461, 0.49326842],
-												 [	-6.27340353, -0.00031958, 0.00019576, 7.27308395, 0.99902385, 0.99948466, 0.49326833],
-												 [	-6.27340361, -0.00031954, 0.00019574, 7.27308406, 0.99902396, 0.99948471, 0.49326844],
-												 [	-6.27340369, -0.00031951, 0.00019572, 7.27308417, 0.99902406, 0.99948477, 0.49326841],
-												 [	-6.27340377, -0.00031948, 0.00019570, 7.27308429, 0.99902416, 0.99948482, 0.49326813],
-												 [	-6.27340384, -0.00031945, 0.00019568, 7.27308440, 0.99902426, 0.99948487, 0.49326861],
-												 [	-6.27340392, -0.00031941, 0.00019566, 7.27308451, 0.99902436, 0.99948493, 0.49326836],
-												 [	-6.27340400, -0.00031938, 0.00019564, 7.27308462, 0.99902446, 0.99948498, 0.49326869],
-												 [	-6.27340408, -0.00031935, 0.00019562, 7.27308473, 0.99902456, 0.99948503, 0.49326883],
-												 [	-6.27340416, -0.00031931, 0.00019560, 7.27308485, 0.99902466, 0.99948509, 0.49326857],
-												 [	-6.27340424, -0.00031928, 0.00019558, 7.27308496, 0.99902476, 0.99948514, 0.49326861],
-												 [	-6.27340432, -0.00031925, 0.00019556, 7.27308507, 0.99902486, 0.99948519, 0.49326841],
-												 [	-6.27340440, -0.00031922, 0.00019554, 7.27308518, 0.99902496, 0.99948525, 0.49326856],
-												 [	-6.27340448, -0.00031918, 0.00019552, 7.27308529, 0.99902506, 0.99948530, 0.49326867],
-												 [	-6.27340455, -0.00031915, 0.00019550, 7.27308540, 0.99902516, 0.99948535, 0.49326859],
-												 [	-6.27340463, -0.00031912, 0.00019548, 7.27308552, 0.99902526, 0.99948541, 0.49326854],
-												 [	-6.27340471, -0.00031908, 0.00019546, 7.27308563, 0.99902536, 0.99948546, 0.49326869],
-												 [	-6.27340479, -0.00031905, 0.00019544, 7.27308574, 0.99902546, 0.99948551, 0.49326853],
-												 [	-6.27340487, -0.00031902, 0.00019542, 7.27308585, 0.99902557, 0.99948556, 0.49326880],
-												 [	-6.27340495, -0.00031899, 0.00019540, 7.27308596, 0.99902567, 0.99948562, 0.49326872],
-												 [	-6.27340503, -0.00031895, 0.00019538, 7.27308607, 0.99902577, 0.99948567, 0.49326861],
-												 [	-6.27340511, -0.00031892, 0.00019536, 7.27308619, 0.99902587, 0.99948572, 0.49326878],
-												 [	-6.27340518, -0.00031889, 0.00019534, 7.27308630, 0.99902597, 0.99948578, 0.49326876],
-												 [	-6.27340526, -0.00031885, 0.00019532, 7.27308641, 0.99902607, 0.99948583, 0.49326873],
-												 [	-6.27340534, -0.00031882, 0.00019530, 7.27308652, 0.99902617, 0.99948588, 0.49326869],
-												 [	-6.27340542, -0.00031879, 0.00019528, 7.27308663, 0.99902627, 0.99948594, 0.49326868],
-												 [	-6.27340550, -0.00031876, 0.00019526, 7.27308674, 0.99902637, 0.99948599, 0.49326886],
-												 [	-6.27340558, -0.00031872, 0.00019524, 7.27308685, 0.99902647, 0.99948604, 0.49326868],
-												 [	-6.27340566, -0.00031869, 0.00019522, 7.27308697, 0.99902657, 0.99948609, 0.49326883],
-												 [	-6.27340573, -0.00031866, 0.00019520, 7.27308708, 0.99902667, 0.99948615, 0.49326876],
-												 [	-6.27340581, -0.00031862, 0.00019518, 7.27308719, 0.99902677, 0.99948620, 0.49326874],
-												 [	-6.27340589, -0.00031859, 0.00019516, 7.27308730, 0.99902687, 0.99948625, 0.49326882],
-												 [	-6.27340597, -0.00031856, 0.00019514, 7.27308741, 0.99902697, 0.99948631, 0.49326866],
-												 [	-6.27340605, -0.00031853, 0.00019512, 7.27308752, 0.99902707, 0.99948636, 0.49326860],
-												 [	-6.27340613, -0.00031849, 0.00019510, 7.27308763, 0.99902717, 0.99948641, 0.49326865],
-												 [	-6.27340621, -0.00031846, 0.00019508, 7.27308775, 0.99902727, 0.99948646, 0.49326872],
-												 [	-6.27340628, -0.00031843, 0.00019506, 7.27308786, 0.99902737, 0.99948652, 0.49326863],
-												 [	-6.27340636, -0.00031839, 0.00019504, 7.27308797, 0.99902747, 0.99948657, 0.49326869],
-												 [	-6.27340644, -0.00031836, 0.00019502, 7.27308808, 0.99902757, 0.99948662, 0.49326888],
-												 [	-6.27340652, -0.00031833, 0.00019500, 7.27308819, 0.99902767, 0.99948668, 0.49326895],
-												 [	-6.27340660, -0.00031830, 0.00019498, 7.27308830, 0.99902777, 0.99948673, 0.49326876],
-												 [	-6.27340668, -0.00031826, 0.00019496, 7.27308841, 0.99902787, 0.99948678, 0.49326889],
-												 [	-6.27340675, -0.00031823, 0.00019494, 7.27308852, 0.99902797, 0.99948683, 0.49326878],
-												 [	-6.27340683, -0.00031820, 0.00019492, 7.27308863, 0.99902807, 0.99948689, 0.49326887],
-												 [	-6.27340691, -0.00031817, 0.00019490, 7.27308875, 0.99902817, 0.99948694, 0.49326916],
-												 [	-6.27340699, -0.00031813, 0.00019488, 7.27308886, 0.99902827, 0.99948699, 0.49326908],
-												 [	-6.27340707, -0.00031810, 0.00019486, 7.27308897, 0.99902837, 0.99948704, 0.49326893],
-												 [	-6.27340715, -0.00031807, 0.00019484, 7.27308908, 0.99902847, 0.99948710, 0.49326890],
-												 [	-6.27340722, -0.00031803, 0.00019482, 7.27308919, 0.99902857, 0.99948715, 0.49326887],
-												 [	-6.27340730, -0.00031800, 0.00019480, 7.27308930, 0.99902867, 0.99948720, 0.49326878],
-												 [	-6.27340738, -0.00031797, 0.00019478, 7.27308941, 0.99902877, 0.99948726, 0.49326894],
-												 [	-6.27340746, -0.00031794, 0.00019476, 7.27308952, 0.99902887, 0.99948731, 0.49326894],
-												 [	-6.27340754, -0.00031790, 0.00019474, 7.27308963, 0.99902897, 0.99948736, 0.49326908],
-												 [	-6.27340761, -0.00031787, 0.00019472, 7.27308974, 0.99902907, 0.99948741, 0.49326876],
-												 [	-6.27340769, -0.00031784, 0.00019470, 7.27308985, 0.99902917, 0.99948747, 0.49326912],
-												 [	-6.27340777, -0.00031781, 0.00019468, 7.27308996, 0.99902927, 0.99948752, 0.49326904],
-												 [	-6.27340785, -0.00031777, 0.00019466, 7.27309008, 0.99902937, 0.99948757, 0.49326901],
-												 [	-6.27340793, -0.00031774, 0.00019464, 7.27309019, 0.99902947, 0.99948762, 0.49326930],
-												 [	-6.27340801, -0.00031771, 0.00019462, 7.27309030, 0.99902957, 0.99948768, 0.49326907],
-												 [	-6.27340808, -0.00031768, 0.00019460, 7.27309041, 0.99902967, 0.99948773, 0.49326924],
-												 [	-6.27340816, -0.00031764, 0.00019458, 7.27309052, 0.99902977, 0.99948778, 0.49326904],
-												 [	-6.27340824, -0.00031761, 0.00019456, 7.27309063, 0.99902987, 0.99948783, 0.49326893],
-												 [	-6.27340832, -0.00031758, 0.00019454, 7.27309074, 0.99902997, 0.99948789, 0.49326909],
-												 [	-6.27340840, -0.00031755, 0.00019452, 7.27309085, 0.99903006, 0.99948794, 0.49326930],
-												 [	-6.27340847, -0.00031751, 0.00019450, 7.27309096, 0.99903016, 0.99948799, 0.49326922],
-												 [	-6.27340855, -0.00031748, 0.00019448, 7.27309107, 0.99903026, 0.99948804, 0.49326913],
-												 [	-6.27340863, -0.00031745, 0.00019446, 7.27309118, 0.99903036, 0.99948810, 0.49326905],
-												 [	-6.27340871, -0.00031742, 0.00019444, 7.27309129, 0.99903046, 0.99948815, 0.49326923],
-												 [	-6.27340879, -0.00031738, 0.00019442, 7.27309140, 0.99903056, 0.99948820, 0.49326938],
-												 [	-6.27340886, -0.00031735, 0.00019440, 7.27309151, 0.99903066, 0.99948825, 0.49326909],
-												 [	-6.27340894, -0.00031732, 0.00019438, 7.27309162, 0.99903076, 0.99948831, 0.49326912],
-												 [	-6.27340902, -0.00031728, 0.00019436, 7.27309173, 0.99903086, 0.99948836, 0.49326920],
-												 [	-6.27340910, -0.00031725, 0.00019434, 7.27309184, 0.99903096, 0.99948841, 0.49326917],
-												 [	-6.27340917, -0.00031722, 0.00019432, 7.27309196, 0.99903106, 0.99948846, 0.49326921],
-												 [	-6.27340925, -0.00031719, 0.00019430, 7.27309207, 0.99903116, 0.99948852, 0.49326919],
-												 [	-6.27340933, -0.00031715, 0.00019428, 7.27309218, 0.99903126, 0.99948857, 0.49326928],
-												 [	-6.27340941, -0.00031712, 0.00019426, 7.27309229, 0.99903136, 0.99948862, 0.49326918],
-												 [	-6.27340949, -0.00031709, 0.00019424, 7.27309240, 0.99903146, 0.99948867, 0.49326958],
-												 [	-6.27340956, -0.00031706, 0.00019422, 7.27309251, 0.99903156, 0.99948873, 0.49326936],
-												 [	-6.27340964, -0.00031702, 0.00019420, 7.27309262, 0.99903165, 0.99948878, 0.49326927],
-												 [	-6.27340972, -0.00031699, 0.00019418, 7.27309273, 0.99903175, 0.99948883, 0.49326942],
-												 [	-6.27340980, -0.00031696, 0.00019416, 7.27309284, 0.99903185, 0.99948888, 0.49326912],
-												 [	-6.27340987, -0.00031693, 0.00019414, 7.27309295, 0.99903195, 0.99948894, 0.49326924],
-												 [	-6.27340995, -0.00031690, 0.00019412, 7.27309306, 0.99903205, 0.99948899, 0.49326951],
-												 [	-6.27341003, -0.00031686, 0.00019410, 7.27309317, 0.99903215, 0.99948904, 0.49326942],
-												 [	-6.27341011, -0.00031683, 0.00019408, 7.27309328, 0.99903225, 0.99948909, 0.49326925],
-												 [	-6.27341019, -0.00031680, 0.00019406, 7.27309339, 0.99903235, 0.99948914, 0.49326927],
-												 [	-6.27341026, -0.00031677, 0.00019404, 7.27309350, 0.99903245, 0.99948920, 0.49326936],
-												 [	-6.27341034, -0.00031673, 0.00019402, 7.27309361, 0.99903255, 0.99948925, 0.49326944],
-												 [	-6.27341042, -0.00031670, 0.00019400, 7.27309372, 0.99903265, 0.99948930, 0.49326949],
-												 [	-6.27341050, -0.00031667, 0.00019398, 7.27309383, 0.99903274, 0.99948935, 0.49326915],
-												 [	-6.27341057, -0.00031664, 0.00019396, 7.27309394, 0.99903284, 0.99948941, 0.49326929],
-												 [	-6.27341065, -0.00031660, 0.00019394, 7.27309405, 0.99903294, 0.99948946, 0.49326955],
-												 [	-6.27341073, -0.00031657, 0.00019392, 7.27309416, 0.99903304, 0.99948951, 0.49326921],
-												 [	-6.27341081, -0.00031654, 0.00019390, 7.27309427, 0.99903314, 0.99948956, 0.49326941],
-												 [	-6.27341088, -0.00031651, 0.00019388, 7.27309438, 0.99903324, 0.99948961, 0.49326954],
-												 [	-6.27341096, -0.00031647, 0.00019386, 7.27309449, 0.99903334, 0.99948967, 0.49326935],
-												 [	-6.27341104, -0.00031644, 0.00019384, 7.27309460, 0.99903344, 0.99948972, 0.49326969],
-												 [	-6.27341112, -0.00031641, 0.00019382, 7.27309471, 0.99903354, 0.99948977, 0.49326971],
-												 [	-6.27341119, -0.00031638, 0.00019380, 7.27309482, 0.99903363, 0.99948982, 0.49326945],
-												 [	-6.27341127, -0.00031634, 0.00019378, 7.27309493, 0.99903373, 0.99948988, 0.49326964],
-												 [	-6.27341135, -0.00031631, 0.00019376, 7.27309504, 0.99903383, 0.99948993, 0.49326955],
-												 [	-6.27341143, -0.00031628, 0.00019374, 7.27309515, 0.99903393, 0.99948998, 0.49326931],
-												 [	-6.27341150, -0.00031625, 0.00019372, 7.27309526, 0.99903403, 0.99949003, 0.49326939],
-												 [	-6.27341158, -0.00031622, 0.00019370, 7.27309537, 0.99903413, 0.99949008, 0.49326953],
-												 [	-6.27341166, -0.00031618, 0.00019368, 7.27309547, 0.99903423, 0.99949014, 0.49326974],
-												 [	-6.27341173, -0.00031615, 0.00019366, 7.27309558, 0.99903433, 0.99949019, 0.49326980],
-												 [	-6.27341181, -0.00031612, 0.00019364, 7.27309569, 0.99903442, 0.99949024, 0.49326965],
-												 [	-6.27341189, -0.00031609, 0.00019362, 7.27309580, 0.99903452, 0.99949029, 0.49326969],
-												 [	-6.27341197, -0.00031605, 0.00019360, 7.27309591, 0.99903462, 0.99949034, 0.49326954],
-												 [	-6.27341204, -0.00031602, 0.00019358, 7.27309602, 0.99903472, 0.99949040, 0.49326953],
-												 [	-6.27341212, -0.00031599, 0.00019356, 7.27309613, 0.99903482, 0.99949045, 0.49326986],
-												 [	-6.27341220, -0.00031596, 0.00019354, 7.27309624, 0.99903492, 0.99949050, 0.49326990],
-												 [	-6.27341228, -0.00031592, 0.00019352, 7.27309635, 0.99903502, 0.99949055, 0.49326950],
-												 [	-6.27341235, -0.00031589, 0.00019350, 7.27309646, 0.99903511, 0.99949060, 0.49326968],
-												 [	-6.27341243, -0.00031586, 0.00019348, 7.27309657, 0.99903521, 0.99949066, 0.49326946],
-												 [	-6.27341251, -0.00031583, 0.00019346, 7.27309668, 0.99903531, 0.99949071, 0.49326958],
-												 [	-6.27341258, -0.00031580, 0.00019344, 7.27309679, 0.99903541, 0.99949076, 0.49326990],
-												 [	-6.27341266, -0.00031576, 0.00019342, 7.27309690, 0.99903551, 0.99949081, 0.49326972],
-												 [	-6.27341274, -0.00031573, 0.00019340, 7.27309701, 0.99903561, 0.99949086, 0.49326980],
-												 [	-6.27341282, -0.00031570, 0.00019338, 7.27309712, 0.99903570, 0.99949092, 0.49327001],
-												 [	-6.27341289, -0.00031567, 0.00019336, 7.27309723, 0.99903580, 0.99949097, 0.49326985],
-												 [	-6.27341297, -0.00031563, 0.00019334, 7.27309734, 0.99903590, 0.99949102, 0.49326983],
-												 [	-6.27341305, -0.00031560, 0.00019333, 7.27309744, 0.99903600, 0.99949107, 0.49326985],
-												 [	-6.27341312, -0.00031557, 0.00019331, 7.27309755, 0.99903610, 0.99949112, 0.49327005],
-												 [	-6.27341320, -0.00031554, 0.00019329, 7.27309766, 0.99903620, 0.99949118, 0.49326985],
-												 [	-6.27341328, -0.00031551, 0.00019327, 7.27309777, 0.99903629, 0.99949123, 0.49326980],
-												 [	-6.27341336, -0.00031547, 0.00019325, 7.27309788, 0.99903639, 0.99949128, 0.49326990],
-												 [	-6.27341343, -0.00031544, 0.00019323, 7.27309799, 0.99903649, 0.99949133, 0.49326985],
-												 [	-6.27341351, -0.00031541, 0.00019321, 7.27309810, 0.99903659, 0.99949138, 0.49326999],
-												 [	-6.27341359, -0.00031538, 0.00019319, 7.27309821, 0.99903669, 0.99949144, 0.49326989],
-												 [	-6.27341366, -0.00031535, 0.00019317, 7.27309832, 0.99903679, 0.99949149, 0.49326987],
-												 [	-6.27341374, -0.00031531, 0.00019315, 7.27309843, 0.99903688, 0.99949154, 0.49327012],
-												 [	-6.27341382, -0.00031528, 0.00019313, 7.27309854, 0.99903698, 0.99949159, 0.49326994],
-												 [	-6.27341389, -0.00031525, 0.00019311, 7.27309864, 0.99903708, 0.99949164, 0.49327001],
-												 [	-6.27341397, -0.00031522, 0.00019309, 7.27309875, 0.99903718, 0.99949169, 0.49327008],
-												 [	-6.27341405, -0.00031519, 0.00019307, 7.27309886, 0.99903728, 0.99949175, 0.49327008],
-												 [	-6.27341412, -0.00031515, 0.00019305, 7.27309897, 0.99903737, 0.99949180, 0.49326970],
-												 [	-6.27341420, -0.00031512, 0.00019303, 7.27309908, 0.99903747, 0.99949185, 0.49326989],
-												 [	-6.27341428, -0.00031509, 0.00019301, 7.27309919, 0.99903757, 0.99949190, 0.49326992],
-												 [	-6.27341435, -0.00031506, 0.00019299, 7.27309930, 0.99903767, 0.99949195, 0.49327000],
-												 [	-6.27341443, -0.00031502, 0.00019297, 7.27309941, 0.99903777, 0.99949200, 0.49327006],
-												 [	-6.27341451, -0.00031499, 0.00019295, 7.27309952, 0.99903786, 0.99949206, 0.49327023],
-												 [	-6.27341459, -0.00031496, 0.00019293, 7.27309962, 0.99903796, 0.99949211, 0.49327002],
-												 [	-6.27341466, -0.00031493, 0.00019291, 7.27309973, 0.99903806, 0.99949216, 0.49327004],
-												 [	-6.27341474, -0.00031490, 0.00019289, 7.27309984, 0.99903816, 0.99949221, 0.49327010],
-												 [	-6.27341482, -0.00031486, 0.00019287, 7.27309995, 0.99903826, 0.99949226, 0.49327000],
-												 [	-6.27341489, -0.00031483, 0.00019285, 7.27310006, 0.99903835, 0.99949231, 0.49326994],
-												 [	-6.27341497, -0.00031480, 0.00019283, 7.27310017, 0.99903845, 0.99949237, 0.49327008],
-												 [	-6.27341505, -0.00031477, 0.00019281, 7.27310028, 0.99903855, 0.99949242, 0.49327002],
-												 [	-6.27341512, -0.00031474, 0.00019279, 7.27310039, 0.99903865, 0.99949247, 0.49327015],
-												 [	-6.27341520, -0.00031470, 0.00019277, 7.27310049, 0.99903874, 0.99949252, 0.49326998],
-												 [	-6.27341528, -0.00031467, 0.00019275, 7.27310060, 0.99903884, 0.99949257, 0.49327030],
-												 [	-6.27341535, -0.00031464, 0.00019274, 7.27310071, 0.99903894, 0.99949262, 0.49326995],
-												 [	-6.27341543, -0.00031461, 0.00019272, 7.27310082, 0.99903904, 0.99949268, 0.49327013],
-												 [	-6.27341550, -0.00031458, 0.00019270, 7.27310093, 0.99903914, 0.99949273, 0.49327030],
-												 [	-6.27341558, -0.00031454, 0.00019268, 7.27310104, 0.99903923, 0.99949278, 0.49327016],
-												 [	-6.27341566, -0.00031451, 0.00019266, 7.27310115, 0.99903933, 0.99949283, 0.49327003],
-												 [	-6.27341573, -0.00031448, 0.00019264, 7.27310125, 0.99903943, 0.99949288, 0.49327020],
-												 [	-6.27341581, -0.00031445, 0.00019262, 7.27310136, 0.99903953, 0.99949293, 0.49327016],
-												 [	-6.27341589, -0.00031442, 0.00019260, 7.27310147, 0.99903962, 0.99949298, 0.49327038],
-												 [	-6.27341596, -0.00031438, 0.00019258, 7.27310158, 0.99903972, 0.99949304, 0.49327020],
-												 [	-6.27341604, -0.00031435, 0.00019256, 7.27310169, 0.99903982, 0.99949309, 0.49326989],
-												 [	-6.27341612, -0.00031432, 0.00019254, 7.27310180, 0.99903992, 0.99949314, 0.49327033],
-												 [	-6.27341619, -0.00031429, 0.00019252, 7.27310190, 0.99904001, 0.99949319, 0.49327021],
-												 [	-6.27341627, -0.00031426, 0.00019250, 7.27310201, 0.99904011, 0.99949324, 0.49327047],
-												 [	-6.27341635, -0.00031423, 0.00019248, 7.27310212, 0.99904021, 0.99949329, 0.49327024],
-												 [	-6.27341642, -0.00031419, 0.00019246, 7.27310223, 0.99904031, 0.99949335, 0.49327034],
-												 [	-6.27341650, -0.00031416, 0.00019244, 7.27310234, 0.99904040, 0.99949340, 0.49327024],
-												 [	-6.27341658, -0.00031413, 0.00019242, 7.27310245, 0.99904050, 0.99949345, 0.49327049],
-												 [	-6.27341665, -0.00031410, 0.00019240, 7.27310255, 0.99904060, 0.99949350, 0.49327029],
-												 [	-6.27341673, -0.00031407, 0.00019238, 7.27310266, 0.99904070, 0.99949355, 0.49327027],
-												 [	-6.27341680, -0.00031403, 0.00019236, 7.27310277, 0.99904079, 0.99949360, 0.49327052],
-												 [	-6.27341688, -0.00031400, 0.00019234, 7.27310288, 0.99904089, 0.99949365, 0.49327062],
-												 [	-6.27341696, -0.00031397, 0.00019232, 7.27310299, 0.99904099, 0.99949370, 0.49327051],
-												 [	-6.27341703, -0.00031394, 0.00019231, 7.27310309, 0.99904108, 0.99949376, 0.49327035],
-												 [	-6.27341711, -0.00031391, 0.00019229, 7.27310320, 0.99904118, 0.99949381, 0.49327029],
-												 [	-6.27341719, -0.00031387, 0.00019227, 7.27310331, 0.99904128, 0.99949386, 0.49327040],
-												 [	-6.27341726, -0.00031384, 0.00019225, 7.27310342, 0.99904138, 0.99949391, 0.49327054],
-												 [	-6.27341734, -0.00031381, 0.00019223, 7.27310353, 0.99904147, 0.99949396, 0.49327057],
-												 [	-6.27341741, -0.00031378, 0.00019221, 7.27310363, 0.99904157, 0.99949401, 0.49327065],
-												 [	-6.27341749, -0.00031375, 0.00019219, 7.27310374, 0.99904167, 0.99949406, 0.49327055],
-												 [	-6.27341757, -0.00031372, 0.00019217, 7.27310385, 0.99904177, 0.99949412, 0.49327044],
-												 [	-6.27341764, -0.00031368, 0.00019215, 7.27310396, 0.99904186, 0.99949417, 0.49327060],
-												 [	-6.27341772, -0.00031365, 0.00019213, 7.27310407, 0.99904196, 0.99949422, 0.49327062],
-												 [	-6.27341779, -0.00031362, 0.00019211, 7.27310417, 0.99904206, 0.99949427, 0.49327057],
-												 [	-6.27341787, -0.00031359, 0.00019209, 7.27310428, 0.99904215, 0.99949432, 0.49327068],
-												 [	-6.27341795, -0.00031356, 0.00019207, 7.27310439, 0.99904225, 0.99949437, 0.49327087],
-												 [	-6.27341802, -0.00031353, 0.00019205, 7.27310450, 0.99904235, 0.99949442, 0.49327065],
-												 [	-6.27341810, -0.00031349, 0.00019203, 7.27310461, 0.99904244, 0.99949447, 0.49327040],
-												 [	-6.27341817, -0.00031346, 0.00019201, 7.27310471, 0.99904254, 0.99949453, 0.49327056],
-												 [	-6.27341825, -0.00031343, 0.00019199, 7.27310482, 0.99904264, 0.99949458, 0.49327057],
-												 [	-6.27341833, -0.00031340, 0.00019197, 7.27310493, 0.99904274, 0.99949463, 0.49327059],
-												 [	-6.27341840, -0.00031337, 0.00019195, 7.27310504, 0.99904283, 0.99949468, 0.49327075],
-												 [	-6.27341848, -0.00031333, 0.00019194, 7.27310514, 0.99904293, 0.99949473, 0.49327058],
-												 [	-6.27341855, -0.00031330, 0.00019192, 7.27310525, 0.99904303, 0.99949478, 0.49327073],
-												 [	-6.27341863, -0.00031327, 0.00019190, 7.27310536, 0.99904312, 0.99949483, 0.49327054],
-												 [	-6.27341871, -0.00031324, 0.00019188, 7.27310547, 0.99904322, 0.99949488, 0.49327048],
-												 [	-6.27341878, -0.00031321, 0.00019186, 7.27310557, 0.99904332, 0.99949493, 0.49327086],
-												 [	-6.27341886, -0.00031318, 0.00019184, 7.27310568, 0.99904341, 0.99949499, 0.49327056],
-												 [	-6.27341893, -0.00031314, 0.00019182, 7.27310579, 0.99904351, 0.99949504, 0.49327071],
-												 [	-6.27341901, -0.00031311, 0.00019180, 7.27310590, 0.99904361, 0.99949509, 0.49327045],
-												 [	-6.27341909, -0.00031308, 0.00019178, 7.27310600, 0.99904370, 0.99949514, 0.49327067],
-												 [	-6.27341916, -0.00031305, 0.00019176, 7.27310611, 0.99904380, 0.99949519, 0.49327067],
-												 [	-6.27341924, -0.00031302, 0.00019174, 7.27310622, 0.99904390, 0.99949524, 0.49327074],
-												 [	-6.27341931, -0.00031299, 0.00019172, 7.27310633, 0.99904399, 0.99949529, 0.49327107],
-												 [	-6.27341939, -0.00031295, 0.00019170, 7.27310643, 0.99904409, 0.99949534, 0.49327064],
-												 [	-6.27341946, -0.00031292, 0.00019168, 7.27310654, 0.99904419, 0.99949539, 0.49327063],
-												 [	-6.27341954, -0.00031289, 0.00019166, 7.27310665, 0.99904428, 0.99949545, 0.49327050],
-												 [	-6.27341962, -0.00031286, 0.00019164, 7.27310676, 0.99904438, 0.99949550, 0.49327069],
-												 [	-6.27341969, -0.00031283, 0.00019162, 7.27310686, 0.99904448, 0.99949555, 0.49327081],
-												 [	-6.27341977, -0.00031280, 0.00019161, 7.27310697, 0.99904457, 0.99949560, 0.49327077],
-												 [	-6.27341984, -0.00031276, 0.00019159, 7.27310708, 0.99904467, 0.99949565, 0.49327081],
-												 [	-6.27341992, -0.00031273, 0.00019157, 7.27310719, 0.99904477, 0.99949570, 0.49327088],
-												 [	-6.27341999, -0.00031270, 0.00019155, 7.27310729, 0.99904486, 0.99949575, 0.49327082],
-												 [	-6.27342007, -0.00031267, 0.00019153, 7.27310740, 0.99904496, 0.99949580, 0.49327067],
-												 [	-6.27342015, -0.00031264, 0.00019151, 7.27310751, 0.99904506, 0.99949585, 0.49327061],
-												 [	-6.27342022, -0.00031261, 0.00019149, 7.27310761, 0.99904515, 0.99949590, 0.49327079],
-												 [	-6.27342030, -0.00031258, 0.00019147, 7.27310772, 0.99904525, 0.99949595, 0.49327103],
-												 [	-6.27342037, -0.00031254, 0.00019145, 7.27310783, 0.99904535, 0.99949601, 0.49327107],
-												 [	-6.27342045, -0.00031251, 0.00019143, 7.27310794, 0.99904544, 0.99949606, 0.49327084],
-												 [	-6.27342052, -0.00031248, 0.00019141, 7.27310804, 0.99904554, 0.99949611, 0.49327096],
-												 [	-6.27342060, -0.00031245, 0.00019139, 7.27310815, 0.99904563, 0.99949616, 0.49327062],
-												 [	-6.27342067, -0.00031242, 0.00019137, 7.27310826, 0.99904573, 0.99949621, 0.49327088],
-												 [	-6.27342075, -0.00031239, 0.00019135, 7.27310836, 0.99904583, 0.99949626, 0.49327094],
-												 [	-6.27342083, -0.00031235, 0.00019133, 7.27310847, 0.99904592, 0.99949631, 0.49327095],
-												 [	-6.27342090, -0.00031232, 0.00019132, 7.27310858, 0.99904602, 0.99949636, 0.49327111],
-												 [	-6.27342098, -0.00031229, 0.00019130, 7.27310869, 0.99904612, 0.99949641, 0.49327066],
-												 [	-6.27342105, -0.00031226, 0.00019128, 7.27310879, 0.99904621, 0.99949646, 0.49327112],
-												 [	-6.27342113, -0.00031223, 0.00019126, 7.27310890, 0.99904631, 0.99949651, 0.49327094],
-												 [	-6.27342120, -0.00031220, 0.00019124, 7.27310901, 0.99904641, 0.99949656, 0.49327097],
-												 [	-6.27342128, -0.00031217, 0.00019122, 7.27310911, 0.99904650, 0.99949662, 0.49327094],
-												 [	-6.27342135, -0.00031213, 0.00019120, 7.27310922, 0.99904660, 0.99949667, 0.49327120],
-												 [	-6.27342143, -0.00031210, 0.00019118, 7.27310933, 0.99904669, 0.99949672, 0.49327123],
-												 [	-6.27342150, -0.00031207, 0.00019116, 7.27310943, 0.99904679, 0.99949677, 0.49327124],
-												 [	-6.27342158, -0.00031204, 0.00019114, 7.27310954, 0.99904689, 0.99949682, 0.49327089],
-												 [	-6.27342166, -0.00031201, 0.00019112, 7.27310965, 0.99904698, 0.99949687, 0.49327096],
-												 [	-6.27342173, -0.00031198, 0.00019110, 7.27310975, 0.99904708, 0.99949692, 0.49327093],
-												 [	-6.27342181, -0.00031195, 0.00019108, 7.27310986, 0.99904717, 0.99949697, 0.49327128],
-												 [	-6.27342188, -0.00031191, 0.00019106, 7.27310997, 0.99904727, 0.99949702, 0.49327122],
-												 [	-6.27342196, -0.00031188, 0.00019105, 7.27311007, 0.99904737, 0.99949707, 0.49327128],
-												 [	-6.27342203, -0.00031185, 0.00019103, 7.27311018, 0.99904746, 0.99949712, 0.49327113],
-												 [	-6.27342211, -0.00031182, 0.00019101, 7.27311029, 0.99904756, 0.99949717, 0.49327121],
-												 [	-6.27342218, -0.00031179, 0.00019099, 7.27311039, 0.99904765, 0.99949722, 0.49327115],
-												 [	-6.27342226, -0.00031176, 0.00019097, 7.27311050, 0.99904775, 0.99949727, 0.49327114],
-												 [	-6.27342233, -0.00031173, 0.00019095, 7.27311061, 0.99904785, 0.99949733, 0.49327102],
-												 [	-6.27342241, -0.00031169, 0.00019093, 7.27311071, 0.99904794, 0.99949738, 0.49327120],
-												 [	-6.27342248, -0.00031166, 0.00019091, 7.27311082, 0.99904804, 0.99949743, 0.49327130],
-												 [	-6.27342256, -0.00031163, 0.00019089, 7.27311093, 0.99904813, 0.99949748, 0.49327109],
-												 [	-6.27342263, -0.00031160, 0.00019087, 7.27311103, 0.99904823, 0.99949753, 0.49327132],
-												 [	-6.27342271, -0.00031157, 0.00019085, 7.27311114, 0.99904833, 0.99949758, 0.49327146],
-												 [	-6.27342278, -0.00031154, 0.00019083, 7.27311125, 0.99904842, 0.99949763, 0.49327090],
-												 [	-6.27342286, -0.00031151, 0.00019081, 7.27311135, 0.99904852, 0.99949768, 0.49327123],
-												 [	-6.27342293, -0.00031147, 0.00019080, 7.27311146, 0.99904861, 0.99949773, 0.49327134],
-												 [	-6.27342301, -0.00031144, 0.00019078, 7.27311156, 0.99904871, 0.99949778, 0.49327133],
-												 [	-6.27342308, -0.00031141, 0.00019076, 7.27311167, 0.99904880, 0.99949783, 0.49327117],
-												 [	-6.27342316, -0.00031138, 0.00019074, 7.27311178, 0.99904890, 0.99949788, 0.49327124],
-												 [	-6.27342323, -0.00031135, 0.00019072, 7.27311188, 0.99904900, 0.99949793, 0.49327116],
-												 [	-6.27342331, -0.00031132, 0.00019070, 7.27311199, 0.99904909, 0.99949798, 0.49327125],
-												 [	-6.27342338, -0.00031129, 0.00019068, 7.27311210, 0.99904919, 0.99949803, 0.49327132],
-												 [	-6.27342346, -0.00031126, 0.00019066, 7.27311220, 0.99904928, 0.99949808, 0.49327161],
-												 [	-6.27342353, -0.00031122, 0.00019064, 7.27311231, 0.99904938, 0.99949813, 0.49327137],
-												 [	-6.27342361, -0.00031119, 0.00019062, 7.27311242, 0.99904947, 0.99949818, 0.49327141],
-												 [	-6.27342368, -0.00031116, 0.00019060, 7.27311252, 0.99904957, 0.99949824, 0.49327151],
-												 [	-6.27342376, -0.00031113, 0.00019058, 7.27311263, 0.99904966, 0.99949829, 0.49327147],
-												 [	-6.27342383, -0.00031110, 0.00019057, 7.27311273, 0.99904976, 0.99949834, 0.49327157],
-												 [	-6.27342391, -0.00031107, 0.00019055, 7.27311284, 0.99904986, 0.99949839, 0.49327158],
-												 [	-6.27342398, -0.00031104, 0.00019053, 7.27311295, 0.99904995, 0.99949844, 0.49327140],
-												 [	-6.27342406, -0.00031101, 0.00019051, 7.27311305, 0.99905005, 0.99949849, 0.49327149],
-												 [	-6.27342413, -0.00031097, 0.00019049, 7.27311316, 0.99905014, 0.99949854, 0.49327130],
-												 [	-6.27342421, -0.00031094, 0.00019047, 7.27311326, 0.99905024, 0.99949859, 0.49327138],
-												 [	-6.27342428, -0.00031091, 0.00019045, 7.27311337, 0.99905033, 0.99949864, 0.49327154],
-												 [	-6.27342436, -0.00031088, 0.00019043, 7.27311348, 0.99905043, 0.99949869, 0.49327144],
-												 [	-6.27342443, -0.00031085, 0.00019041, 7.27311358, 0.99905052, 0.99949874, 0.49327149],
-												 [	-6.27342451, -0.00031082, 0.00019039, 7.27311369, 0.99905062, 0.99949879, 0.49327160],
-												 [	-6.27342458, -0.00031079, 0.00019037, 7.27311379, 0.99905071, 0.99949884, 0.49327162],
-												 [	-6.27342466, -0.00031076, 0.00019035, 7.27311390, 0.99905081, 0.99949889, 0.49327146],
-												 [	-6.27342473, -0.00031072, 0.00019034, 7.27311401, 0.99905091, 0.99949894, 0.49327178],
-												 [	-6.27342480, -0.00031069, 0.00019032, 7.27311411, 0.99905100, 0.99949899, 0.49327156],
-												 [	-6.27342488, -0.00031066, 0.00019030, 7.27311422, 0.99905110, 0.99949904, 0.49327151],
-												 [	-6.27342495, -0.00031063, 0.00019028, 7.27311432, 0.99905119, 0.99949909, 0.49327157],
-												 [	-6.27342503, -0.00031060, 0.00019026, 7.27311443, 0.99905129, 0.99949914, 0.49327162],
-												 [	-6.27342510, -0.00031057, 0.00019024, 7.27311453, 0.99905138, 0.99949919, 0.49327180],
-												 [	-6.27342518, -0.00031054, 0.00019022, 7.27311464, 0.99905148, 0.99949924, 0.49327153],
-												 [	-6.27342525, -0.00031051, 0.00019020, 7.27311475, 0.99905157, 0.99949929, 0.49327170],
-												 [	-6.27342533, -0.00031047, 0.00019018, 7.27311485, 0.99905167, 0.99949934, 0.49327164],
-												 [	-6.27342540, -0.00031044, 0.00019016, 7.27311496, 0.99905176, 0.99949939, 0.49327177],
-												 [	-6.27342548, -0.00031041, 0.00019014, 7.27311506, 0.99905186, 0.99949944, 0.49327171],
-												 [	-6.27342555, -0.00031038, 0.00019013, 7.27311517, 0.99905195, 0.99949949, 0.49327163],
-												 [	-6.27342563, -0.00031035, 0.00019011, 7.27311527, 0.99905205, 0.99949954, 0.49327148],
-												 [	-6.27342570, -0.00031032, 0.00019009, 7.27311538, 0.99905214, 0.99949959, 0.49327177],
-												 [	-6.27342577, -0.00031029, 0.00019007, 7.27311549, 0.99905224, 0.99949964, 0.49327190],
-												 [	-6.27342585, -0.00031026, 0.00019005, 7.27311559, 0.99905233, 0.99949969, 0.49327174],
-												 [	-6.27342592, -0.00031023, 0.00019003, 7.27311570, 0.99905243, 0.99949974, 0.49327179],
-												 [	-6.27342600, -0.00031019, 0.00019001, 7.27311580, 0.99905252, 0.99949979, 0.49327165],
-												 [	-6.27342607, -0.00031016, 0.00018999, 7.27311591, 0.99905262, 0.99949984, 0.49327180],
-												 [	-6.27342615, -0.00031013, 0.00018997, 7.27311601, 0.99905271, 0.99949989, 0.49327176],
-												 [	-6.27342622, -0.00031010, 0.00018995, 7.27311612, 0.99905281, 0.99949994, 0.49327155],
-												 [	-6.27342630, -0.00031007, 0.00018993, 7.27311622, 0.99905290, 0.99949999, 0.49327169],
-												 [	-6.27342637, -0.00031004, 0.00018992, 7.27311633, 0.99905300, 0.99950004, 0.49327184],
-												 [	-6.27342644, -0.00031001, 0.00018990, 7.27311644, 0.99905309, 0.99950009, 0.49327184],
-												 [	-6.27342652, -0.00030998, 0.00018988, 7.27311654, 0.99905319, 0.99950014, 0.49327176],
-												 [	-6.27342659, -0.00030995, 0.00018986, 7.27311665, 0.99905328, 0.99950019, 0.49327184],
-												 [	-6.27342667, -0.00030992, 0.00018984, 7.27311675, 0.99905338, 0.99950024, 0.49327166],
-												 [	-6.27342674, -0.00030988, 0.00018982, 7.27311686, 0.99905347, 0.99950029, 0.49327222],
-												 [	-6.27342682, -0.00030985, 0.00018980, 7.27311696, 0.99905357, 0.99950034, 0.49327211],
-												 [	-6.27342689, -0.00030982, 0.00018978, 7.27311707, 0.99905366, 0.99950039, 0.49327202],
-												 [	-6.27342696, -0.00030979, 0.00018976, 7.27311717, 0.99905376, 0.99950044, 0.49327179],
-												 [	-6.27342704, -0.00030976, 0.00018974, 7.27311728, 0.99905385, 0.99950049, 0.49327176],
-												 [	-6.27342711, -0.00030973, 0.00018973, 7.27311738, 0.99905394, 0.99950054, 0.49327202],
-												 [	-6.27342719, -0.00030970, 0.00018971, 7.27311749, 0.99905404, 0.99950059, 0.49327184],
-												 [	-6.27342726, -0.00030967, 0.00018969, 7.27311759, 0.99905413, 0.99950064, 0.49327198],
-												 [	-6.27342733, -0.00030964, 0.00018967, 7.27311770, 0.99905423, 0.99950069, 0.49327205],
-												 [	-6.27342741, -0.00030961, 0.00018965, 7.27311780, 0.99905432, 0.99950074, 0.49327200],
-												 [	-6.27342748, -0.00030957, 0.00018963, 7.27311791, 0.99905442, 0.99950079, 0.49327197],
-												 [	-6.27342756, -0.00030954, 0.00018961, 7.27311801, 0.99905451, 0.99950084, 0.49327183],
-												 [	-6.27342763, -0.00030951, 0.00018959, 7.27311812, 0.99905461, 0.99950089, 0.49327208],
-												 [	-6.27342771, -0.00030948, 0.00018957, 7.27311822, 0.99905470, 0.99950094, 0.49327205],
-												 [	-6.27342778, -0.00030945, 0.00018956, 7.27311833, 0.99905480, 0.99950099, 0.49327194]]);
-                                                                                                 
-        if value=='h':
-		series=love_numbers[:,0];
-	elif value=='k':
-		series=love_numbers[:,1];
-	elif value=='l':
-		series=love_numbers[:,2];
-	elif value=='gamma':
-		series=love_numbers[:,3];
-	elif value=='lambda':
-		series=love_numbers[:,4];
-	else:
-		raise RuntimeError(['love_numbers error message: unknow value:', value])
-	
-	# choose degree 1 term for CF reference system 
-        if frame=='CF': # from Blewitt, 2003, JGR 
-            if value=='h':
-                    series[1] = -0.269; 
-            elif value=='k':
-                    series[1] = 0.021;  
-            elif value=='l':
-                    series[1] = 0.134; 
+            raise RuntimeError('reference_frame should be one of ''CM'' or ''CF''')
+    else:
+        raise RuntimeError('love_numbers error message: bad usage')
 
-        return series
+    if value not in ['h', 'k', 'l', 'gamma', 'lambda']:
+        raise RuntimeError('value should be one of ''h'', ''k'', ''l'', ''gamma'' and ''lambda''')
 
+    if len(varargin) > 1:
+        raise RuntimeError('love_numbers error message: wrong usage')
+
+    love_numbers = np.array([[0, 0, 0, 0, 0, 0, 0],
+                             [- 1.28740059, -1.00000000, -0.89858519, 1.28740059, 0.42519882, 0.89858519, 0.00000000],
+                             [- 1.00025365, -0.30922675, 0.02060926, 1.69102690, 0.46358648, 0.67016399, 0.61829668],
+                             [- 1.06243501, -0.19927948, 0.06801636, 1.86315553, 0.55741597, 0.73270416, 0.56270589],
+                             [- 1.06779588, -0.13649834, 0.05667027, 1.93129754, 0.63672498, 0.80683140, 0.51132745],
+                             [- 1.10365923, -0.10736896, 0.04401221, 1.99629027, 0.68737906, 0.84861883, 0.48642259],
+                             [- 1.16440348, -0.09295485, 0.03638747, 2.07144863, 0.72031283, 0.87065768, 0.47898268],
+                             [- 1.23634156, -0.08469861, 0.03202759, 2.15164295, 0.74355796, 0.88327380, 0.47955214],
+                             [- 1.31140380, -0.07921412, 0.02937593, 2.23218968, 0.76126493, 0.89140995, 0.48323250],
+                             [- 1.38582399, -0.07513541, 0.02762338, 2.31068858, 0.77552290, 0.89724121, 0.48795424],
+                             [- 1.45807465, -0.07187005, 0.02638627, 2.38620460, 0.78744212, 0.90174369, 0.49291061],
+                             [- 1.52763314, -0.06913154, 0.02547640, 2.45850160, 0.79766475, 0.90539206, 0.49779422],
+                             [- 1.59437866, -0.06676258, 0.02479080, 2.52761607, 0.80659635, 0.90844662, 0.50248477],
+                             [- 1.65833071, -0.06466619, 0.02426511, 2.59366452, 0.81451271, 0.91106870, 0.50693175],
+                             [- 1.71954820, -0.06277732, 0.02385464, 2.65677088, 0.82161167, 0.91336804, 0.51111243],
+                             [- 1.77809640, -0.06105001, 0.02352654, 2.71704639, 0.82804049, 0.91542346, 0.51501712],
+                             [- 1.83403970, -0.05945081, 0.02325609, 2.77458889, 0.83391153, 0.91729309, 0.51864363],
+                             [- 1.88744242, -0.05795502, 0.02302469, 2.82948740, 0.83931209, 0.91902029, 0.52199490],
+                             [- 1.93837115, -0.05654418, 0.02281843, 2.88182697, 0.84431095, 0.92063739, 0.52507761],
+                             [- 1.98689666, -0.05520447, 0.02262706, 2.93169219, 0.84896295, 0.92216847, 0.52790108],
+                             [- 2.03309477, -0.05392545, 0.02244322, 2.97916932, 0.85331225, 0.92363132, 0.53047654],
+                             [- 2.07704643, -0.05269926, 0.02226173, 3.02434717, 0.85739480, 0.92503902, 0.53281639],
+                             [- 2.11883714, -0.05151988, 0.02207909, 3.06731726, 0.86124014, 0.92640103, 0.53493369],
+                             [- 2.15855611, -0.05038274, 0.02189307, 3.10817337, 0.86487276, 0.92772419, 0.53684176],
+                             [- 2.19629514, -0.04928430, 0.02170238, 3.14701084, 0.86831322, 0.92901331, 0.53855386],
+                             [- 2.23214747, -0.04822179, 0.02150643, 3.18392568, 0.87157886, 0.93027178, 0.54008294],
+                             [- 2.26620674, -0.04719301, 0.02130509, 3.21901373, 0.87468453, 0.93150190, 0.54144148],
+                             [- 2.29856595, -0.04619619, 0.02109858, 3.25236976, 0.87764301, 0.93270523, 0.54264140],
+                             [- 2.32931659, -0.04522983, 0.02088735, 3.28408675, 0.88046543, 0.93388282, 0.54369397],
+                             [- 2.35854794, -0.04429270, 0.02067197, 3.31425524, 0.88316156, 0.93503533, 0.54460979],
+                             [- 2.38634650, -0.04338368, 0.02045310, 3.34296281, 0.88574004, 0.93616321, 0.54539877],
+                             [- 2.41279547, -0.04250179, 0.02023142, 3.37029367, 0.88820859, 0.93726678, 0.54607015],
+                             [- 2.43797451, -0.04164613, 0.02000761, 3.39632839, 0.89057416, 0.93834626, 0.54663248],
+                             [- 2.46195951, -0.04081583, 0.01978231, 3.42114367, 0.89284301, 0.93940185, 0.54709369],
+                             [- 2.48482241, -0.04001011, 0.01955614, 3.44481230, 0.89502085, 0.94043375, 0.54746112],
+                             [- 2.50663126, -0.03922817, 0.01932966, 3.46740309, 0.89711291, 0.94144217, 0.54774153],
+                             [- 2.52745016, -0.03846928, 0.01910337, 3.48898088, 0.89912397, 0.94242735, 0.54794114],
+                             [- 2.54733938, -0.03773269, 0.01887774, 3.50960670, 0.90105847, 0.94338957, 0.54806571],
+                             [- 2.56635547, -0.03701769, 0.01865317, 3.52933779, 0.90292050, 0.94432915, 0.54812051],
+                             [- 2.58455138, -0.03632358, 0.01843000, 3.54822780, 0.90471386, 0.94524642, 0.54811044],
+                             [- 2.60197665, -0.03564968, 0.01820854, 3.56632697, 0.90644209, 0.94614178, 0.54803997],
+                             [- 2.61867756, -0.03499532, 0.01798905, 3.58368224, 0.90810850, 0.94701563, 0.54791326],
+                             [- 2.63469733, -0.03435985, 0.01777176, 3.60033748, 0.90971616, 0.94786840, 0.54773413],
+                             [- 2.65007629, -0.03374263, 0.01755683, 3.61633367, 0.91126798, 0.94870054, 0.54750610],
+                             [- 2.66485208, -0.03314303, 0.01734443, 3.63170905, 0.91276665, 0.94951253, 0.54723245],
+                             [- 2.67905981, -0.03256047, 0.01713468, 3.64649934, 0.91421471, 0.95030485, 0.54691620],
+                             [- 2.69273222, -0.03199435, 0.01692767, 3.66073787, 0.91561457, 0.95107798, 0.54656015],
+                             [- 2.70589990, -0.03144411, 0.01672347, 3.67445580, 0.91696845, 0.95183242, 0.54616691],
+                             [- 2.71859139, -0.03090919, 0.01652215, 3.68768220, 0.91827849, 0.95256866, 0.54573889],
+                             [- 2.73083334, -0.03038907, 0.01632374, 3.70044427, 0.91954667, 0.95328719, 0.54527835],
+                             [- 2.74265068, -0.02988323, 0.01612826, 3.71276745, 0.92077487, 0.95398851, 0.54478739],
+                             [- 2.75406669, -0.02939118, 0.01593573, 3.72467551, 0.92196486, 0.95467309, 0.54426797],
+                             [- 2.76510320, -0.02891245, 0.01574615, 3.73619076, 0.92311833, 0.95534141, 0.54372191],
+                             [- 2.77578063, -0.02844656, 0.01555950, 3.74733406, 0.92423685, 0.95599393, 0.54315095],
+                             [- 2.78611812, -0.02799309, 0.01537578, 3.75812503, 0.92532192, 0.95663113, 0.54255669],
+                             [- 2.79613364, -0.02755161, 0.01519496, 3.76858203, 0.92637496, 0.95725343, 0.54194065],
+                             [- 2.80584405, -0.02712170, 0.01501701, 3.77872235, 0.92739730, 0.95786128, 0.54130424],
+                             [- 2.81526521, -0.02670298, 0.01484191, 3.78856223, 0.92839022, 0.95845511, 0.54064880],
+                             [- 2.82441204, -0.02629506, 0.01466961, 3.79811697, 0.92935491, 0.95903532, 0.53997561],
+                             [- 2.83329857, -0.02589759, 0.01450009, 3.80740098, 0.93029251, 0.95960232, 0.53928586],
+                             [- 2.84193804, -0.02551021, 0.01433329, 3.81642782, 0.93120412, 0.96015649, 0.53858067],
+                             [- 2.85034293, -0.02513260, 0.01416919, 3.82521033, 0.93209074, 0.96069821, 0.53786112],
+                             [- 2.85852503, -0.02476443, 0.01400773, 3.83376061, 0.93295337, 0.96122784, 0.53712821],
+                             [- 2.86649548, -0.02440538, 0.01384888, 3.84209010, 0.93379291, 0.96174574, 0.53638291],
+                             [- 2.87426481, -0.02405518, 0.01369258, 3.85020963, 0.93461026, 0.96225224, 0.53562612],
+                             [- 2.88184299, -0.02371352, 0.01353880, 3.85812947, 0.93540625, 0.96274768, 0.53485873],
+                             [- 2.88923945, -0.02338014, 0.01338749, 3.86585931, 0.93618168, 0.96323236, 0.53408154],
+                             [- 2.89646316, -0.02305478, 0.01323861, 3.87340838, 0.93693730, 0.96370661, 0.53329534],
+                             [- 2.90352261, -0.02273718, 0.01309211, 3.88078542, 0.93767383, 0.96417071, 0.53250089],
+                             [- 2.91042585, -0.02242710, 0.01294795, 3.88799874, 0.93839197, 0.96462494, 0.53169888],
+                             [- 2.91718054, -0.02212431, 0.01280609, 3.89505623, 0.93909236, 0.96506960, 0.53089002],
+                             [- 2.92379397, -0.02182859, 0.01266648, 3.90196538, 0.93977564, 0.96550493, 0.53007493],
+                             [- 2.93027306, -0.02153971, 0.01252908, 3.90873334, 0.94044240, 0.96593120, 0.52925424],
+                             [- 2.93662439, -0.02125748, 0.01239386, 3.91536691, 0.94109322, 0.96634866, 0.52842854],
+                             [- 2.94285425, -0.02098169, 0.01226077, 3.92187256, 0.94172863, 0.96675754, 0.52759839],
+                             [- 2.94896860, -0.02071215, 0.01212977, 3.92825645, 0.94234915, 0.96715808, 0.52676434],
+                             [- 2.95497314, -0.02044868, 0.01200082, 3.93452446, 0.94295529, 0.96755050, 0.52592690],
+                             [- 2.96087331, -0.02019110, 0.01187388, 3.94068220, 0.94354752, 0.96793501, 0.52508656],
+                             [- 2.96667427, -0.01993924, 0.01174893, 3.94673503, 0.94412630, 0.96831183, 0.52424380],
+                             [- 2.97238097, -0.01969293, 0.01162591, 3.95268804, 0.94469206, 0.96868116, 0.52339906],
+                             [- 2.97799813, -0.01945201, 0.01150481, 3.95854612, 0.94524521, 0.96904318, 0.52255277],
+                             [- 2.98353025, -0.01921634, 0.01138557, 3.96431391, 0.94578617, 0.96939809, 0.52170535],
+                             [- 2.98898162, -0.01898576, 0.01126817, 3.96999586, 0.94631531, 0.96974607, 0.52085719],
+                             [- 2.99435636, -0.01876014, 0.01115257, 3.97559622, 0.94683300, 0.97008729, 0.52000868],
+                             [- 2.99965838, -0.01853932, 0.01103875, 3.98111905, 0.94733959, 0.97042193, 0.51916016],
+                             [- 3.00489143, -0.01832319, 0.01092666, 3.98656824, 0.94783543, 0.97075015, 0.51831198],
+                             [- 3.01005909, -0.01811161, 0.01081628, 3.99194748, 0.94832084, 0.97107211, 0.51746448],
+                             [- 3.01516479, -0.01790446, 0.01070757, 3.99726033, 0.94879613, 0.97138796, 0.51661796],
+                             [- 3.02021180, -0.01770162, 0.01060052, 4.00251017, 0.94926160, 0.97169786, 0.51577273],
+                             [- 3.02520323, -0.01750298, 0.01049508, 4.00770025, 0.94971755, 0.97200194, 0.51492908],
+                             [- 3.03014209, -0.01730842, 0.01039123, 4.01283367, 0.95016424, 0.97230035, 0.51408727],
+                             [- 3.03503122, -0.01711783, 0.01028894, 4.01791339, 0.95060195, 0.97259323, 0.51324758],
+                             [- 3.03987336, -0.01693111, 0.01018819, 4.02294225, 0.95103094, 0.97288070, 0.51241024],
+                             [- 3.04467112, -0.01674816, 0.01008894, 4.02792295, 0.95145145, 0.97316290, 0.51157550],
+                             [- 3.04942699, -0.01656889, 0.00999117, 4.03285810, 0.95186373, 0.97343995, 0.51074358],
+                             [- 3.05414335, -0.01639319, 0.00989485, 4.03775017, 0.95226799, 0.97371196, 0.50991471],
+                             [- 3.05882250, -0.01622097, 0.00979997, 4.04260153, 0.95266447, 0.97397906, 0.50908908],
+                             [- 3.06346660, -0.01605215, 0.00970649, 4.04741445, 0.95305338, 0.97424136, 0.50826689],
+                             [- 3.06807773, -0.01588664, 0.00961439, 4.05219109, 0.95343492, 0.97449897, 0.50744832],
+                             [- 3.07265789, -0.01572436, 0.00952364, 4.05693353, 0.95380929, 0.97475200, 0.50663356],
+                             [- 3.07720897, -0.01556522, 0.00943423, 4.06164375, 0.95417670, 0.97500055, 0.50582277],
+                             [- 3.08173279, -0.01540916, 0.00934613, 4.06632364, 0.95453731, 0.97524472, 0.50501611],
+                             [- 3.08623109, -0.01525608, 0.00925931, 4.07097501, 0.95489131, 0.97548461, 0.50421372],
+                             [- 3.09070551, -0.01510592, 0.00917376, 4.07559959, 0.95523888, 0.97572032, 0.50341576],
+                             [- 3.09515765, -0.01495861, 0.00908946, 4.08019904, 0.95558018, 0.97595193, 0.50262236],
+                             [- 3.09958899, -0.01481408, 0.00900637, 4.08477492, 0.95591537, 0.97617955, 0.50183364],
+                             [- 3.10400100, -0.01467225, 0.00892449, 4.08932875, 0.95624461, 0.97640325, 0.50104973],
+                             [- 3.10839504, -0.01453308, 0.00884379, 4.09386196, 0.95656806, 0.97662313, 0.50027073],
+                             [- 3.11277241, -0.01439648, 0.00876425, 4.09837593, 0.95688585, 0.97683927, 0.49949676],
+                             [- 3.11713438, -0.01426240, 0.00868586, 4.10287198, 0.95719812, 0.97705174, 0.49872791],
+                             [- 3.12148213, -0.01413079, 0.00860858, 4.10735134, 0.95750503, 0.97726063, 0.49796429],
+                             [- 3.12581680, -0.01400157, 0.00853241, 4.11181522, 0.95780669, 0.97746601, 0.49720597],
+                             [- 3.13013947, -0.01387471, 0.00845733, 4.11626476, 0.95810324, 0.97766796, 0.49645304],
+                             [- 3.13445117, -0.01375013, 0.00838331, 4.12070104, 0.95839480, 0.97786656, 0.49570558],
+                             [- 3.13875289, -0.01362779, 0.00831034, 4.12512510, 0.95868150, 0.97806186, 0.49496366],
+                             [- 3.14304556, -0.01350764, 0.00823841, 4.12953792, 0.95896344, 0.97825395, 0.49422734],
+                             [- 3.14733008, -0.01338963, 0.00816748, 4.13394045, 0.95924075, 0.97844289, 0.49349669],
+                             [- 3.15160728, -0.01327370, 0.00809756, 4.13833358, 0.95951352, 0.97862874, 0.49277177],
+                             [- 3.15587797, -0.01315981, 0.00802862, 4.14271816, 0.95978188, 0.97881157, 0.49205262],
+                             [- 3.16014293, -0.01304792, 0.00796064, 4.14709501, 0.96004592, 0.97899144, 0.49133930],
+                             [- 3.16440288, -0.01293797, 0.00789361, 4.15146491, 0.96030574, 0.97916842, 0.49063185],
+                             [- 3.16865852, -0.01282993, 0.00782751, 4.15582858, 0.96056144, 0.97934256, 0.48993030],
+                             [- 3.17291049, -0.01272375, 0.00776233, 4.16018673, 0.96081312, 0.97951392, 0.48923471],
+                             [- 3.17715942, -0.01261940, 0.00769805, 4.16454003, 0.96106086, 0.97968255, 0.48854509],
+                             [- 3.18140591, -0.01251682, 0.00763466, 4.16888910, 0.96130476, 0.97984852, 0.48786148],
+                             [- 3.18565052, -0.01241598, 0.00757215, 4.17323454, 0.96154490, 0.98001187, 0.48718390],
+                             [- 3.18989378, -0.01231685, 0.00751049, 4.17757693, 0.96178137, 0.98017266, 0.48651237],
+                             [- 3.19413619, -0.01221938, 0.00744968, 4.18191681, 0.96201424, 0.98033094, 0.48584692],
+                             [- 3.19837823, -0.01212354, 0.00738970, 4.18625469, 0.96224360, 0.98048676, 0.48518756],
+                             [- 3.20262035, -0.01202930, 0.00733053, 4.19059105, 0.96246952, 0.98064017, 0.48453431],
+                             [- 3.20686298, -0.01193661, 0.00727217, 4.19492637, 0.96269208, 0.98079121, 0.48388717],
+                             [- 3.21110653, -0.01184546, 0.00721461, 4.19926107, 0.96291135, 0.98093994, 0.48324615],
+                             [- 3.21535137, -0.01175579, 0.00715782, 4.20359557, 0.96312741, 0.98108639, 0.48261126],
+                             [- 3.21959786, -0.01166759, 0.00710179, 4.20793027, 0.96334031, 0.98123062, 0.48198250],
+                             [- 3.22384634, -0.01158082, 0.00704652, 4.21226552, 0.96355014, 0.98137266, 0.48135988],
+                             [- 3.22809714, -0.01149545, 0.00699199, 4.21660169, 0.96375694, 0.98151256, 0.48074338],
+                             [- 3.23235055, -0.01141146, 0.00693819, 4.22093909, 0.96396080, 0.98165035, 0.48013301],
+                             [- 3.23660685, -0.01132880, 0.00688511, 4.22527805, 0.96416176, 0.98178609, 0.47952876],
+                             [- 3.24086631, -0.01124746, 0.00683273, 4.22961885, 0.96435989, 0.98191980, 0.47893063],
+                             [- 3.24512918, -0.01116741, 0.00678105, 4.23396177, 0.96455525, 0.98205153, 0.47833860],
+                             [- 3.24939569, -0.01108862, 0.00673005, 4.23830707, 0.96474789, 0.98218132, 0.47775267],
+                             [- 3.25366606, -0.01101107, 0.00667973, 4.24265499, 0.96493787, 0.98230920, 0.47717282],
+                             [- 3.25794050, -0.01093473, 0.00663007, 4.24700577, 0.96512525, 0.98243520, 0.47659903],
+                             [- 3.26221918, -0.01085957, 0.00658106, 4.25135961, 0.96531007, 0.98255937, 0.47603130],
+                             [- 3.26650230, -0.01078557, 0.00653269, 4.25571672, 0.96549239, 0.98268174, 0.47546960],
+                             [- 3.27079000, -0.01071272, 0.00648495, 4.26007729, 0.96567225, 0.98280233, 0.47491391],
+                             [- 3.27508246, -0.01064097, 0.00643784, 4.26444149, 0.96584971, 0.98292119, 0.47436422],
+                             [- 3.27937980, -0.01057032, 0.00639134, 4.26880948, 0.96602482, 0.98303834, 0.47382051],
+                             [- 3.28368216, -0.01050074, 0.00634544, 4.27318141, 0.96619761, 0.98315382, 0.47328275],
+                             [- 3.28798965, -0.01043222, 0.00630013, 4.27755743, 0.96636814, 0.98326765, 0.47275091],
+                             [- 3.29230239, -0.01036472, 0.00625541, 4.28193767, 0.96653645, 0.98337988, 0.47222499],
+                             [- 3.29662047, -0.01029823, 0.00621126, 4.28632224, 0.96670258, 0.98349051, 0.47170494],
+                             [- 3.30094399, -0.01023273, 0.00616768, 4.29071126, 0.96686657, 0.98359960, 0.47119074],
+                             [- 3.30527303, -0.01016819, 0.00612465, 4.29510483, 0.96702847, 0.98370715, 0.47068237],
+                             [- 3.30960766, -0.01010461, 0.00608218, 4.29950304, 0.96718831, 0.98381321, 0.47017979],
+                             [- 3.31394795, -0.01004197, 0.00604024, 4.30390598, 0.96734614, 0.98391779, 0.46968299],
+                             [- 3.31829395, -0.00998024, 0.00599883, 4.30831372, 0.96750198, 0.98402093, 0.46919192],
+                             [- 3.32264573, -0.00991940, 0.00595795, 4.31272633, 0.96765588, 0.98412265, 0.46870656],
+                             [- 3.32700331, -0.00985945, 0.00591759, 4.31714387, 0.96780788, 0.98422297, 0.46822687],
+                             [- 3.33136675, -0.00980035, 0.00587773, 4.32156640, 0.96795801, 0.98432191, 0.46775284],
+                             [- 3.33573607, -0.00974211, 0.00583838, 4.32599396, 0.96810630, 0.98441951, 0.46728441],
+                             [- 3.34011130, -0.00968470, 0.00579951, 4.33042660, 0.96825278, 0.98451579, 0.46682157],
+                             [- 3.34449246, -0.00962810, 0.00576113, 4.33486436, 0.96839750, 0.98461077, 0.46636427],
+                             [- 3.34887956, -0.00957230, 0.00572323, 4.33930726, 0.96854048, 0.98470447, 0.46591248],
+                             [- 3.35327261, -0.00951729, 0.00568581, 4.34375533, 0.96868175, 0.98479691, 0.46546617],
+                             [- 3.35767163, -0.00946304, 0.00564884, 4.34820858, 0.96882135, 0.98488812, 0.46502531],
+                             [- 3.36207660, -0.00940956, 0.00561233, 4.35266704, 0.96895930, 0.98497811, 0.46458986],
+                             [- 3.36648753, -0.00935681, 0.00557627, 4.35713071, 0.96909563, 0.98506691, 0.46415977],
+                             [- 3.37090440, -0.00930480, 0.00554066, 4.36159960, 0.96923037, 0.98515454, 0.46373503],
+                             [- 3.37532721, -0.00925350, 0.00550548, 4.36607371, 0.96936355, 0.98524102, 0.46331559],
+                             [- 3.37975593, -0.00920290, 0.00547073, 4.37055303, 0.96949520, 0.98532636, 0.46290141],
+                             [- 3.38419056, -0.00915300, 0.00543641, 4.37503756, 0.96962535, 0.98541059, 0.46249246],
+                             [- 3.38863105, -0.00910377, 0.00540251, 4.37952729, 0.96975401, 0.98549373, 0.46208870],
+                             [- 3.39307740, -0.00905520, 0.00536901, 4.38402220, 0.96988122, 0.98557578, 0.46169009],
+                             [- 3.39752956, -0.00900729, 0.00533593, 4.38852227, 0.97000699, 0.98565678, 0.46129660],
+                             [- 3.40198751, -0.00896002, 0.00530324, 4.39302749, 0.97013137, 0.98573674, 0.46090819],
+                             [- 3.40645121, -0.00891338, 0.00527095, 4.39753783, 0.97025435, 0.98581567, 0.46052482],
+                             [- 3.41092063, -0.00886736, 0.00523904, 4.40205326, 0.97037598, 0.98589360, 0.46014645],
+                             [- 3.41539571, -0.00882195, 0.00520752, 4.40657376, 0.97049628, 0.98597053, 0.45977305],
+                             [- 3.41987643, -0.00877713, 0.00517637, 4.41109929, 0.97061526, 0.98604649, 0.45940458],
+                             [- 3.42436272, -0.00873290, 0.00514560, 4.41562982, 0.97073295, 0.98612149, 0.45904100],
+                             [- 3.42885456, -0.00868925, 0.00511520, 4.42016531, 0.97084936, 0.98619555, 0.45868227],
+                             [- 3.43335188, -0.00864617, 0.00508515, 4.42470571, 0.97096453, 0.98626868, 0.45832835],
+                             [- 3.43785464, -0.00860364, 0.00505546, 4.42925100, 0.97107847, 0.98634090, 0.45797921],
+                             [- 3.44236278, -0.00856166, 0.00502613, 4.43380112, 0.97119120, 0.98641222, 0.45763480],
+                             [- 3.44687625, -0.00852021, 0.00499714, 4.43835604, 0.97130274, 0.98648265, 0.45729509],
+                             [- 3.45139500, -0.00847930, 0.00496849, 4.44291570, 0.97141311, 0.98655221, 0.45696005],
+                             [- 3.45591895, -0.00843890, 0.00494017, 4.44748005, 0.97152233, 0.98662092, 0.45662962],
+                             [- 3.46044807, -0.00839902, 0.00491219, 4.45204905, 0.97163042, 0.98668879, 0.45630378],
+                             [- 3.46498227, -0.00835964, 0.00488454, 4.45662264, 0.97173739, 0.98675583, 0.45598249],
+                             [- 3.46952151, -0.00832075, 0.00485721, 4.46120077, 0.97184326, 0.98682205, 0.45566570],
+                             [- 3.47406572, -0.00828234, 0.00483019, 4.46578338, 0.97194805, 0.98688746, 0.45535338],
+                             [- 3.47861484, -0.00824442, 0.00480349, 4.47037042, 0.97205179, 0.98695209, 0.45504550],
+                             [- 3.48316880, -0.00820696, 0.00477710, 4.47496184, 0.97215447, 0.98701594, 0.45474201],
+                             [- 3.48772753, -0.00816996, 0.00475102, 4.47955756, 0.97225612, 0.98707902, 0.45444287],
+                             [- 3.49229097, -0.00813342, 0.00472523, 4.48415755, 0.97235676, 0.98714134, 0.45414806],
+                             [- 3.49685904, -0.00809733, 0.00469975, 4.48876172, 0.97245640, 0.98720293, 0.45385753],
+                             [- 3.50143169, -0.00806167, 0.00467455, 4.49337002, 0.97255506, 0.98726378, 0.45357123],
+                             [- 3.50600884, -0.00802644, 0.00464964, 4.49798240, 0.97265275, 0.98732391, 0.45328915],
+                             [- 3.51059042, -0.00799164, 0.00462502, 4.50259878, 0.97274949, 0.98738333, 0.45301123],
+                             [- 3.51517637, -0.00795726, 0.00460068, 4.50721911, 0.97284528, 0.98744206, 0.45273745],
+                             [- 3.51976660, -0.00792329, 0.00457662, 4.51184331, 0.97294015, 0.98750009, 0.45246776],
+                             [- 3.52436105, -0.00788972, 0.00455283, 4.51647133, 0.97303411, 0.98755745, 0.45220214],
+                             [- 3.52895964, -0.00785655, 0.00452930, 4.52110309, 0.97312718, 0.98761414, 0.45194053],
+                             [- 3.53356231, -0.00782377, 0.00450605, 4.52573854, 0.97321936, 0.98767018, 0.45168291],
+                             [- 3.53816898, -0.00779138, 0.00448306, 4.53037760, 0.97331067, 0.98772556, 0.45142923],
+                             [- 3.54277957, -0.00775937, 0.00446032, 4.53502021, 0.97340111, 0.98778031, 0.45117947],
+                             [- 3.54739402, -0.00772773, 0.00443784, 4.53966629, 0.97349072, 0.98783443, 0.45093359],
+                             [- 3.55201224, -0.00769645, 0.00441562, 4.54431579, 0.97357949, 0.98788793, 0.45069155],
+                             [- 3.55663417, -0.00766554, 0.00439364, 4.54896864, 0.97366744, 0.98794082, 0.45045331],
+                             [- 3.56125973, -0.00763498, 0.00437190, 4.55362475, 0.97375458, 0.98799311, 0.45021885],
+                             [- 3.56588885, -0.00760478, 0.00435041, 4.55828407, 0.97384092, 0.98804481, 0.44998812],
+                             [- 3.57052145, -0.00757491, 0.00432916, 4.56294653, 0.97392648, 0.98809593, 0.44976109],
+                             [- 3.57515745, -0.00754539, 0.00430814, 4.56761206, 0.97401126, 0.98814646, 0.44953772],
+                             [- 3.57979678, -0.00751620, 0.00428736, 4.57228058, 0.97409528, 0.98819644, 0.44931799],
+                             [- 3.58443937, -0.00748734, 0.00426681, 4.57695203, 0.97417854, 0.98824585, 0.44910185],
+                             [- 3.58908514, -0.00745880, 0.00424648, 4.58162633, 0.97426107, 0.98829472, 0.44888928],
+                             [- 3.59373401, -0.00743059, 0.00422637, 4.58630343, 0.97434286, 0.98834304, 0.44868023],
+                             [- 3.59838592, -0.00740268, 0.00420649, 4.59098323, 0.97442393, 0.98839083, 0.44847468],
+                             [- 3.60304078, -0.00737509, 0.00418682, 4.59566569, 0.97450428, 0.98843809, 0.44827259],
+                             [- 3.60769852, -0.00734780, 0.00416737, 4.60035072, 0.97458394, 0.98848483, 0.44807392],
+                             [- 3.61235907, -0.00732081, 0.00414813, 4.60503826, 0.97466290, 0.98853106, 0.44787865],
+                             [- 3.61702235, -0.00729411, 0.00412910, 4.60972823, 0.97474118, 0.98857678, 0.44768674],
+                             [- 3.62168828, -0.00726771, 0.00411028, 4.61442057, 0.97481879, 0.98862201, 0.44749816],
+                             [- 3.62635680, -0.00724159, 0.00409166, 4.61911521, 0.97489573, 0.98866675, 0.44731288],
+                             [- 3.63102782, -0.00721575, 0.00407325, 4.62381207, 0.97497202, 0.98871100, 0.44713086],
+                             [- 3.63570128, -0.00719020, 0.00405503, 4.62851108, 0.97504766, 0.98875478, 0.44695207],
+                             [- 3.64037709, -0.00716491, 0.00403700, 4.63321218, 0.97512267, 0.98879808, 0.44677649],
+                             [- 3.64505519, -0.00713990, 0.00401918, 4.63791530, 0.97519704, 0.98884093, 0.44660407],
+                             [- 3.64973550, -0.00711515, 0.00400154, 4.64262036, 0.97527080, 0.98888331, 0.44643478],
+                             [- 3.65441795, -0.00709066, 0.00398409, 4.64732729, 0.97534394, 0.98892525, 0.44626861],
+                             [- 3.65910247, -0.00706643, 0.00396683, 4.65203604, 0.97541648, 0.98896674, 0.44610551],
+                             [- 3.66378898, -0.00704246, 0.00394975, 4.65674652, 0.97548842, 0.98900779, 0.44594545],
+                             [- 3.66847740, -0.00701873, 0.00393286, 4.66145867, 0.97555978, 0.98904841, 0.44578841],
+                             [- 3.67316767, -0.00699526, 0.00391614, 4.66617242, 0.97563055, 0.98908860, 0.44563435],
+                             [- 3.67785972, -0.00697202, 0.00389960, 4.67088770, 0.97570076, 0.98912838, 0.44548324],
+                             [- 3.68255347, -0.00694903, 0.00388324, 4.67560444, 0.97577039, 0.98916773, 0.44533506],
+                             [- 3.68724885, -0.00692627, 0.00386705, 4.68032258, 0.97583947, 0.98920668, 0.44518977],
+                             [- 3.69194579, -0.00690374, 0.00385103, 4.68504204, 0.97590800, 0.98924523, 0.44504735],
+                             [- 3.69664421, -0.00688145, 0.00383518, 4.68976277, 0.97597598, 0.98928338, 0.44490776],
+                             [- 3.70134406, -0.00685938, 0.00381949, 4.69448468, 0.97604342, 0.98932113, 0.44477099],
+                             [- 3.70604525, -0.00683753, 0.00380397, 4.69920772, 0.97611034, 0.98935850, 0.44463698],
+                             [- 3.71074772, -0.00681590, 0.00378861, 4.70393182, 0.97617673, 0.98939548, 0.44450573],
+                             [- 3.71545140, -0.00679449, 0.00377342, 4.70865691, 0.97624261, 0.98943209, 0.44437720],
+                             [- 3.72015622, -0.00677330, 0.00375838, 4.71338292, 0.97630797, 0.98946833, 0.44425137],
+                             [- 3.72486211, -0.00675231, 0.00374349, 4.71810980, 0.97637283, 0.98950420, 0.44412820],
+                             [- 3.72956899, -0.00673153, 0.00372877, 4.72283746, 0.97643720, 0.98953970, 0.44400767],
+                             [- 3.73427682, -0.00671096, 0.00371419, 4.72756585, 0.97650107, 0.98957485, 0.44388975],
+                             [- 3.73898550, -0.00669059, 0.00369976, 4.73229491, 0.97656446, 0.98960965, 0.44377441],
+                             [- 3.74369498, -0.00667042, 0.00368549, 4.73702457, 0.97662737, 0.98964409, 0.44366163],
+                             [- 3.74840519, -0.00665044, 0.00367136, 4.74175475, 0.97668980, 0.98967820, 0.44355139],
+                             [- 3.75311607, -0.00663066, 0.00365738, 4.74648541, 0.97675177, 0.98971196, 0.44344364],
+                             [- 3.75782754, -0.00661107, 0.00364354, 4.75121648, 0.97681327, 0.98974540, 0.44333838],
+                             [- 3.76253955, -0.00659167, 0.00362984, 4.75594788, 0.97687432, 0.98977850, 0.44323557],
+                             [- 3.76725202, -0.00657245, 0.00361628, 4.76067957, 0.97693492, 0.98981127, 0.44313518],
+                             [- 3.77196489, -0.00655341, 0.00360286, 4.76541147, 0.97699508, 0.98984372, 0.44303720],
+                             [- 3.77667809, -0.00653456, 0.00358958, 4.77014353, 0.97705479, 0.98987586, 0.44294159],
+                             [- 3.78139156, -0.00651589, 0.00357643, 4.77487568, 0.97711407, 0.98990768, 0.44284833],
+                             [- 3.78610525, -0.00649739, 0.00356342, 4.77960786, 0.97717292, 0.98993920, 0.44275740],
+                             [- 3.79081907, -0.00647906, 0.00355053, 4.78434001, 0.97723134, 0.98997040, 0.44266877],
+                             [- 3.79553298, -0.00646091, 0.00353778, 4.78907207, 0.97728935, 0.99000131, 0.44258241],
+                             [- 3.80024690, -0.00644292, 0.00352516, 4.79380398, 0.97734694, 0.99003192, 0.44249831],
+                             [- 3.80496078, -0.00642510, 0.00351266, 4.79853567, 0.97740413, 0.99006223, 0.44241644],
+                             [- 3.80967455, -0.00640745, 0.00350029, 4.80326710, 0.97746090, 0.99009226, 0.44233677],
+                             [- 3.81438815, -0.00638996, 0.00348804, 4.80799819, 0.97751728, 0.99012200, 0.44225928],
+                             [- 3.81910152, -0.00637262, 0.00347592, 4.81272889, 0.97757326, 0.99015145, 0.44218395],
+                             [- 3.82381460, -0.00635545, 0.00346392, 4.81745915, 0.97762886, 0.99018063, 0.44211076],
+                             [- 3.82852732, -0.00633843, 0.00345204, 4.82218889, 0.97768406, 0.99020953, 0.44203968],
+                             [- 3.83323964, -0.00632157, 0.00344027, 4.82691808, 0.97773889, 0.99023816, 0.44197068],
+                             [- 3.83795149, -0.00630485, 0.00342863, 4.83164664, 0.97779333, 0.99026652, 0.44190376],
+                             [- 3.84266280, -0.00628829, 0.00341709, 4.83637452, 0.97784741, 0.99029462, 0.44183887],
+                             [- 3.84737353, -0.00627187, 0.00340568, 4.84110166, 0.97790111, 0.99032245, 0.44177601],
+                             [- 3.85208361, -0.00625560, 0.00339437, 4.84582801, 0.97795446, 0.99035003, 0.44171515],
+                             [- 3.85679299, -0.00623948, 0.00338318, 4.85055351, 0.97800744, 0.99037735, 0.44165627],
+                             [- 3.86150160, -0.00622349, 0.00337210, 4.85527811, 0.97806006, 0.99040441, 0.44159934],
+                             [- 3.86620939, -0.00620765, 0.00336112, 4.86000175, 0.97811233, 0.99043123, 0.44154435],
+                             [- 3.87091631, -0.00619194, 0.00335026, 4.86472437, 0.97816426, 0.99045780, 0.44149127],
+                             [- 3.87562229, -0.00617637, 0.00333950, 4.86944592, 0.97821584, 0.99048413, 0.44144009],
+                             [- 3.88032729, -0.00616094, 0.00332885, 4.87416635, 0.97826708, 0.99051022, 0.44139078],
+                             [- 3.88503124, -0.00614564, 0.00331830, 4.87888561, 0.97831798, 0.99053607, 0.44134332],
+                             [- 3.88973410, -0.00613047, 0.00330785, 4.88360363, 0.97836855, 0.99056168, 0.44129769],
+                             [- 3.89443580, -0.00611543, 0.00329750, 4.88832037, 0.97841879, 0.99058707, 0.44125387],
+                             [- 3.89913629, -0.00610051, 0.00328726, 4.89303577, 0.97846870, 0.99061223, 0.44121185],
+                             [- 3.90383552, -0.00608573, 0.00327711, 4.89774979, 0.97851829, 0.99063716, 0.44117159],
+                             [- 3.90853343, -0.00607107, 0.00326707, 4.90246236, 0.97856756, 0.99066187, 0.44113309],
+                             [- 3.91322998, -0.00605653, 0.00325712, 4.90717345, 0.97861652, 0.99068635, 0.44109632],
+                             [- 3.91792511, -0.00604212, 0.00324726, 4.91188299, 0.97866516, 0.99071062, 0.44106126],
+                             [- 3.92261876, -0.00602782, 0.00323750, 4.91659094, 0.97871350, 0.99073468, 0.44102790],
+                             [- 3.92731089, -0.00601364, 0.00322784, 4.92129724, 0.97876153, 0.99075852, 0.44099621],
+                             [- 3.93200144, -0.00599958, 0.00321826, 4.92600186, 0.97880926, 0.99078215, 0.44096618],
+                             [- 3.93669036, -0.00598564, 0.00320878, 4.93070472, 0.97885669, 0.99080558, 0.44093779],
+                             [- 3.94137761, -0.00597181, 0.00319939, 4.93540580, 0.97890383, 0.99082880, 0.44091101],
+                             [- 3.94606313, -0.00595809, 0.00319009, 4.94010504, 0.97895067, 0.99085182, 0.44088584],
+                             [- 3.95074687, -0.00594449, 0.00318088, 4.94480238, 0.97899722, 0.99087463, 0.44086225],
+                             [- 3.95542878, -0.00593099, 0.00317175, 4.94949779, 0.97904349, 0.99089725, 0.44084022],
+                             [- 3.96010882, -0.00591761, 0.00316271, 4.95419121, 0.97908947, 0.99091968, 0.44081975],
+                             [- 3.96478693, -0.00590433, 0.00315376, 4.95888260, 0.97913517, 0.99094191, 0.44080080],
+                             [- 3.96946306, -0.00589116, 0.00314489, 4.96357191, 0.97918060, 0.99096395, 0.44078336],
+                             [- 3.97413718, -0.00587809, 0.00313611, 4.96825909, 0.97922575, 0.99098581, 0.44076742],
+                             [- 3.97880922, -0.00586512, 0.00312740, 4.97294410, 0.97927063, 0.99100747, 0.44075296],
+                             [- 3.98347915, -0.00585226, 0.00311878, 4.97762689, 0.97931524, 0.99102895, 0.44073996],
+                             [- 3.98814692, -0.00583950, 0.00311024, 4.98230742, 0.97935959, 0.99105026, 0.44072841],
+                             [- 3.99281247, -0.00582684, 0.00310178, 4.98698564, 0.97940367, 0.99107138, 0.44071828],
+                             [- 3.99747577, -0.00581428, 0.00309340, 4.99166150, 0.97944749, 0.99109232, 0.44070956],
+                             [- 4.00213677, -0.00580181, 0.00308510, 4.99633496, 0.97949105, 0.99111309, 0.44070224],
+                             [- 4.00679542, -0.00578944, 0.00307688, 5.00100598, 0.97953436, 0.99113368, 0.44069630],
+                             [- 4.01145168, -0.00577717, 0.00306873, 5.00567451, 0.97957741, 0.99115410, 0.44069173],
+                             [- 4.01610551, -0.00576499, 0.00306065, 5.01034052, 0.97962021, 0.99117436, 0.44068850],
+                             [- 4.02075685, -0.00575290, 0.00305266, 5.01500395, 0.97966277, 0.99119444, 0.44068660],
+                             [- 4.02540567, -0.00574091, 0.00304473, 5.01966476, 0.97970508, 0.99121436, 0.44068602],
+                             [- 4.03005191, -0.00572900, 0.00303688, 5.02432291, 0.97974715, 0.99123412, 0.44068674],
+                             [- 4.03469555, -0.00571719, 0.00302910, 5.02897837, 0.97978897, 0.99125371, 0.44068875],
+                             [- 4.03933654, -0.00570546, 0.00302139, 5.03363108, 0.97983056, 0.99127315, 0.44069203],
+                             [- 4.04397482, -0.00569382, 0.00301375, 5.03828100, 0.97987192, 0.99129242, 0.44069657],
+                             [- 4.04861037, -0.00568227, 0.00300619, 5.04292810, 0.97991304, 0.99131154, 0.44070234],
+                             [- 4.05324314, -0.00567080, 0.00299869, 5.04757234, 0.97995393, 0.99133051, 0.44070935],
+                             [- 4.05787308, -0.00565942, 0.00299126, 5.05221367, 0.97999459, 0.99134932, 0.44071756],
+                             [- 4.06250017, -0.00564812, 0.00298390, 5.05685205, 0.98003502, 0.99136799, 0.44072698],
+                             [- 4.06712435, -0.00563690, 0.00297660, 5.06148744, 0.98007523, 0.99138650, 0.44073757],
+                             [- 4.07174558, -0.00562577, 0.00296937, 5.06611981, 0.98011522, 0.99140486, 0.44074934],
+                             [- 4.07636383, -0.00561471, 0.00296221, 5.07074912, 0.98015498, 0.99142308, 0.44076227],
+                             [- 4.08097906, -0.00560374, 0.00295511, 5.07537532, 0.98019453, 0.99144116, 0.44077633],
+                             [- 4.08559122, -0.00559284, 0.00294807, 5.07999838, 0.98023386, 0.99145909, 0.44079153],
+                             [- 4.09020028, -0.00558202, 0.00294110, 5.08461826, 0.98027298, 0.99147688, 0.44080784],
+                             [- 4.09480620, -0.00557128, 0.00293419, 5.08923492, 0.98031189, 0.99149453, 0.44082525],
+                             [- 4.09940894, -0.00556061, 0.00292734, 5.09384833, 0.98035059, 0.99151204, 0.44084375],
+                             [- 4.10400846, -0.00555002, 0.00292056, 5.09845844, 0.98038908, 0.99152942, 0.44086333],
+                             [- 4.10860473, -0.00553950, 0.00291383, 5.10306522, 0.98042736, 0.99154666, 0.44088396],
+                             [- 4.11319770, -0.00552906, 0.00290717, 5.10766864, 0.98046544, 0.99156377, 0.44090565],
+                             [- 4.11778734, -0.00551869, 0.00290056, 5.11226865, 0.98050332, 0.99158075, 0.44092838],
+                             [- 4.12237362, -0.00550839, 0.00289401, 5.11686523, 0.98054100, 0.99159760, 0.44095213],
+                             [- 4.12695649, -0.00549816, 0.00288752, 5.12145833, 0.98057848, 0.99161431, 0.44097689],
+                             [- 4.13153592, -0.00548801, 0.00288109, 5.12604792, 0.98061577, 0.99163090, 0.44100265],
+                             [- 4.13611188, -0.00547792, 0.00287471, 5.13063396, 0.98065286, 0.99164737, 0.44102940],
+                             [- 4.14068433, -0.00546790, 0.00286839, 5.13521643, 0.98068975, 0.99166371, 0.44105712],
+                             [- 4.14525323, -0.00545795, 0.00286213, 5.13979528, 0.98072646, 0.99167992, 0.44108581],
+                             [- 4.14981854, -0.00544806, 0.00285592, 5.14437048, 0.98076298, 0.99169602, 0.44111544],
+                             [- 4.15438025, -0.00543824, 0.00284976, 5.14894200, 0.98079931, 0.99171199, 0.44114602],
+                             [- 4.15893830, -0.00542849, 0.00284366, 5.15350981, 0.98083545, 0.99172785, 0.44117753],
+                             [- 4.16349267, -0.00541880, 0.00283761, 5.15807386, 0.98087141, 0.99174358, 0.44120995],
+                             [- 4.16804332, -0.00540918, 0.00283162, 5.16263414, 0.98090719, 0.99175920, 0.44124328],
+                             [- 4.17259021, -0.00539962, 0.00282567, 5.16719060, 0.98094278, 0.99177471, 0.44127750],
+                             [- 4.17713333, -0.00539012, 0.00281978, 5.17174321, 0.98097820, 0.99179010, 0.44131260],
+                             [- 4.18167262, -0.00538069, 0.00281394, 5.17629194, 0.98101344, 0.99180537, 0.44134857],
+                             [- 4.18620807, -0.00537131, 0.00280815, 5.18083676, 0.98104851, 0.99182054, 0.44138541],
+                             [- 4.19073963, -0.00536200, 0.00280241, 5.18537763, 0.98108340, 0.99183560, 0.44142309],
+                             [- 4.19526728, -0.00535274, 0.00279671, 5.18991453, 0.98111811, 0.99185054, 0.44146162],
+                             [- 4.19979098, -0.00534355, 0.00279107, 5.19444743, 0.98115266, 0.99186538, 0.44150097],
+                             [- 4.20431070, -0.00533441, 0.00278548, 5.19897629, 0.98118704, 0.99188011, 0.44154114],
+                             [- 4.20882641, -0.00532534, 0.00277993, 5.20350108, 0.98122125, 0.99189474, 0.44158211],
+                             [- 4.21333809, -0.00531632, 0.00277443, 5.20802177, 0.98125529, 0.99190926, 0.44162389],
+                             [- 4.21784569, -0.00530735, 0.00276897, 5.21253834, 0.98128916, 0.99192367, 0.44166645],
+                             [- 4.22234919, -0.00529845, 0.00276357, 5.21705075, 0.98132288, 0.99193799, 0.44170979],
+                             [- 4.22684856, -0.00528959, 0.00275820, 5.22155897, 0.98135643, 0.99195220, 0.44175389],
+                             [- 4.23134377, -0.00528080, 0.00275289, 5.22606297, 0.98138982, 0.99196631, 0.44179875],
+                             [- 4.23583479, -0.00527206, 0.00274762, 5.23056273, 0.98142305, 0.99198033, 0.44184436],
+                             [- 4.24032159, -0.00526337, 0.00274239, 5.23505822, 0.98145612, 0.99199424, 0.44189070],
+                             [- 4.24480413, -0.00525473, 0.00273720, 5.23954940, 0.98148904, 0.99200806, 0.44193777],
+                             [- 4.24928241, -0.00524615, 0.00273206, 5.24403626, 0.98152180, 0.99202179, 0.44198557],
+                             [- 4.25375637, -0.00523762, 0.00272697, 5.24851875, 0.98155440, 0.99203541, 0.44203406],
+                             [- 4.25822600, -0.00522914, 0.00272191, 5.25299686, 0.98158685, 0.99204895, 0.44208326],
+                             [- 4.26269127, -0.00522071, 0.00271690, 5.25747055, 0.98161916, 0.99206239, 0.44213315],
+                             [- 4.26715214, -0.00521233, 0.00271193, 5.26193981, 0.98165131, 0.99207574, 0.44218372],
+                             [- 4.27160860, -0.00520401, 0.00270700, 5.26640459, 0.98168331, 0.99208900, 0.44223496],
+                             [- 4.27606061, -0.00519573, 0.00270211, 5.27086489, 0.98171516, 0.99210217, 0.44228686],
+                             [- 4.28050816, -0.00518750, 0.00269726, 5.27532066, 0.98174687, 0.99211524, 0.44233942],
+                             [- 4.28495120, -0.00517932, 0.00269245, 5.27977188, 0.98177844, 0.99212824, 0.44239262],
+                             [- 4.28938971, -0.00517119, 0.00268767, 5.28421853, 0.98180986, 0.99214114, 0.44244646],
+                             [- 4.29382368, -0.00516310, 0.00268294, 5.28866058, 0.98184113, 0.99215396, 0.44250093],
+                             [- 4.29825306, -0.00515506, 0.00267825, 5.29309800, 0.98187227, 0.99216669, 0.44255601],
+                             [- 4.30267785, -0.00514707, 0.00267359, 5.29753078, 0.98190326, 0.99217934, 0.44261171],
+                             [- 4.30709800, -0.00513912, 0.00266898, 5.30195888, 0.98193412, 0.99219190, 0.44266801],
+                             [- 4.31151350, -0.00513122, 0.00266440, 5.30638227, 0.98196483, 0.99220438, 0.44272490],
+                             [- 4.31592431, -0.00512337, 0.00265985, 5.31080095, 0.98199542, 0.99221678, 0.44278238],
+                             [- 4.32033043, -0.00511555, 0.00265535, 5.31521487, 0.98202586, 0.99222910, 0.44284044],
+                             [- 4.32473181, -0.00510779, 0.00265088, 5.31962403, 0.98205617, 0.99224134, 0.44289907],
+                             [- 4.32912844, -0.00510006, 0.00264644, 5.32402838, 0.98208635, 0.99225350, 0.44295825],
+                             [- 4.33352030, -0.00509238, 0.00264204, 5.32842792, 0.98211639, 0.99226558, 0.44301800],
+                             [- 4.33790735, -0.00508474, 0.00263768, 5.33282261, 0.98214630, 0.99227758, 0.44307829],
+                             [- 4.34228957, -0.00507715, 0.00263335, 5.33721243, 0.98217609, 0.99228950, 0.44313911],
+                             [- 4.34666695, -0.00506959, 0.00262906, 5.34159736, 0.98220574, 0.99230135, 0.44320047],
+                             [- 4.35103946, -0.00506208, 0.00262479, 5.34597738, 0.98223526, 0.99231313, 0.44326235],
+                             [- 4.35540706, -0.00505461, 0.00262057, 5.35035246, 0.98226466, 0.99232483, 0.44332475],
+                             [- 4.35976976, -0.00504718, 0.00261637, 5.35472258, 0.98229393, 0.99233645, 0.44338766],
+                             [- 4.36412751, -0.00503978, 0.00261221, 5.35908772, 0.98232308, 0.99234800, 0.44345107],
+                             [- 4.36848029, -0.00503243, 0.00260808, 5.36344786, 0.98235210, 0.99235949, 0.44351497],
+                             [- 4.37282810, -0.00502512, 0.00260399, 5.36780298, 0.98238100, 0.99237089, 0.44357936],
+                             [- 4.37717089, -0.00501785, 0.00259992, 5.37215304, 0.98240977, 0.99238223, 0.44364422],
+                             [- 4.38150866, -0.00501061, 0.00259589, 5.37649804, 0.98243843, 0.99239350, 0.44370956],
+                             [- 4.38584137, -0.00500341, 0.00259189, 5.38083796, 0.98246696, 0.99240470, 0.44377537],
+                             [- 4.39016901, -0.00499626, 0.00258792, 5.38517276, 0.98249538, 0.99241583, 0.44384163],
+                             [- 4.39449156, -0.00498913, 0.00258397, 5.38950243, 0.98252368, 0.99242689, 0.44390835],
+                             [- 4.39880900, -0.00498205, 0.00258006, 5.39382695, 0.98255186, 0.99243789, 0.44397551],
+                             [- 4.40312130, -0.00497500, 0.00257618, 5.39814630, 0.98257992, 0.99244881, 0.44404311],
+                             [- 4.40742845, -0.00496799, 0.00257233, 5.40246046, 0.98260787, 0.99245968, 0.44411114],
+                             [- 4.41173042, -0.00496101, 0.00256851, 5.40676940, 0.98263570, 0.99247047, 0.44417960],
+                             [- 4.41602719, -0.00495407, 0.00256472, 5.41107312, 0.98266342, 0.99248121, 0.44424847],
+                             [- 4.42031875, -0.00494717, 0.00256096, 5.41537158, 0.98269102, 0.99249187, 0.44431776],
+                             [- 4.42460508, -0.00494030, 0.00255722, 5.41966478, 0.98271852, 0.99250248, 0.44438745],
+                             [- 4.42888615, -0.00493346, 0.00255351, 5.42395268, 0.98274590, 0.99251302, 0.44445755],
+                             [- 4.43316194, -0.00492666, 0.00254984, 5.42823528, 0.98277317, 0.99252350, 0.44452803],
+                             [- 4.43743244, -0.00491989, 0.00254618, 5.43251255, 0.98280033, 0.99253392, 0.44459891],
+                             [- 4.44169763, -0.00491316, 0.00254256, 5.43678447, 0.98282738, 0.99254428, 0.44467016],
+                             [- 4.44595749, -0.00490646, 0.00253896, 5.44105103, 0.98285433, 0.99255458, 0.44474179],
+                             [- 4.45021200, -0.00489979, 0.00253539, 5.44531221, 0.98288117, 0.99256482, 0.44481379],
+                             [- 4.45446115, -0.00489316, 0.00253185, 5.44956799, 0.98290790, 0.99257500, 0.44488616],
+                             [- 4.45870490, -0.00488655, 0.00252833, 5.45381835, 0.98293452, 0.99258512, 0.44495888],
+                             [- 4.46294326, -0.00487998, 0.00252484, 5.45806327, 0.98296105, 0.99259518, 0.44503195],
+                             [- 4.46717619, -0.00487344, 0.00252137, 5.46230275, 0.98298746, 0.99260519, 0.44510537],
+                             [- 4.47140368, -0.00486693, 0.00251793, 5.46653675, 0.98301378, 0.99261514, 0.44517912],
+                             [- 4.47562571, -0.00486046, 0.00251451, 5.47076526, 0.98303999, 0.99262503, 0.44525322],
+                             [- 4.47984227, -0.00485401, 0.00251112, 5.47498827, 0.98306610, 0.99263487, 0.44532764],
+                             [- 4.48405334, -0.00484759, 0.00250775, 5.47920575, 0.98309211, 0.99264465, 0.44540238],
+                             [- 4.48825891, -0.00484121, 0.00250441, 5.48341770, 0.98311802, 0.99265438, 0.44547744],
+                             [- 4.49245894, -0.00483485, 0.00250109, 5.48762409, 0.98314383, 0.99266406, 0.44555282],
+                             [- 4.49665344, -0.00482852, 0.00249780, 5.49182492, 0.98316954, 0.99267368, 0.44562850],
+                             [- 4.50084238, -0.00482223, 0.00249453, 5.49602015, 0.98319515, 0.99268325, 0.44570449],
+                             [- 4.50502575, -0.00481596, 0.00249128, 5.50020979, 0.98322067, 0.99269277, 0.44578077],
+                             [- 4.50920352, -0.00480972, 0.00248805, 5.50439380, 0.98324609, 0.99270223, 0.44585734],
+                             [- 4.51337569, -0.00480350, 0.00248485, 5.50857219, 0.98327141, 0.99271164, 0.44593420],
+                             [- 4.51754224, -0.00479732, 0.00248167, 5.51274492, 0.98329664, 0.99272101, 0.44601134],
+                             [- 4.52170315, -0.00479117, 0.00247851, 5.51691199, 0.98332177, 0.99273032, 0.44608876],
+                             [- 4.52585842, -0.00478504, 0.00247538, 5.52107338, 0.98334681, 0.99273958, 0.44616645],
+                             [- 4.53000801, -0.00477894, 0.00247227, 5.52522907, 0.98337176, 0.99274880, 0.44624440],
+                             [- 4.53415192, -0.00477286, 0.00246917, 5.52937906, 0.98339661, 0.99275796, 0.44632262],
+                             [- 4.53829014, -0.00476682, 0.00246610, 5.53352332, 0.98342137, 0.99276708, 0.44640109],
+                             [- 4.54242264, -0.00476080, 0.00246306, 5.53766184, 0.98344605, 0.99277615, 0.44647982],
+                             [- 4.54654942, -0.00475480, 0.00246003, 5.54179461, 0.98347063, 0.99278517, 0.44655879],
+                             [- 4.55067046, -0.00474884, 0.00245702, 5.54592162, 0.98349512, 0.99279414, 0.44663801],
+                             [- 4.55478574, -0.00474290, 0.00245404, 5.55004285, 0.98351952, 0.99280307, 0.44671746],
+                             [- 4.55889526, -0.00473698, 0.00245107, 5.55415828, 0.98354383, 0.99281195, 0.44679715],
+                             [- 4.56299899, -0.00473109, 0.00244812, 5.55826790, 0.98356806, 0.99282079, 0.44687706],
+                             [- 4.56709693, -0.00472522, 0.00244520, 5.56237170, 0.98359219, 0.99282958, 0.44695720],
+                             [- 4.57118906, -0.00471938, 0.00244229, 5.56646967, 0.98361625, 0.99283832, 0.44703756],
+                             [- 4.57527536, -0.00471357, 0.00243940, 5.57056179, 0.98364021, 0.99284703, 0.44711814],
+                             [- 4.57935583, -0.00470778, 0.00243654, 5.57464806, 0.98366409, 0.99285569, 0.44719893],
+                             [- 4.58343045, -0.00470201, 0.00243369, 5.57872844, 0.98368788, 0.99286430, 0.44727992],
+                             [- 4.58749921, -0.00469627, 0.00243086, 5.58280295, 0.98371159, 0.99287287, 0.44736112],
+                             [- 4.59156210, -0.00469055, 0.00242805, 5.58687155, 0.98373522, 0.99288140, 0.44744252],
+                             [- 4.59561910, -0.00468485, 0.00242526, 5.59093424, 0.98375876, 0.99288989, 0.44752411],
+                             [- 4.59967020, -0.00467918, 0.00242248, 5.59499102, 0.98378222, 0.99289833, 0.44760589],
+                             [- 4.60371538, -0.00467353, 0.00241973, 5.59904185, 0.98380560, 0.99290674, 0.44768785],
+                             [- 4.60775465, -0.00466791, 0.00241699, 5.60308674, 0.98382890, 0.99291510, 0.44777000],
+                             [- 4.61178797, -0.00466230, 0.00241427, 5.60712567, 0.98385211, 0.99292343, 0.44785233],
+                             [- 4.61581536, -0.00465672, 0.00241157, 5.61115863, 0.98387525, 0.99293171, 0.44793483],
+                             [- 4.61983678, -0.00465116, 0.00240889, 5.61518561, 0.98389830, 0.99293995, 0.44801750],
+                             [- 4.62385223, -0.00464563, 0.00240622, 5.61920660, 0.98392128, 0.99294815, 0.44810034],
+                             [- 4.62786170, -0.00464011, 0.00240357, 5.62322158, 0.98394418, 0.99295632, 0.44818334],
+                             [- 4.63186517, -0.00463462, 0.00240093, 5.62723055, 0.98396700, 0.99296444, 0.44826650],
+                             [- 4.63586264, -0.00462915, 0.00239832, 5.63123349, 0.98398974, 0.99297253, 0.44834982],
+                             [- 4.63985410, -0.00462370, 0.00239572, 5.63523040, 0.98401240, 0.99298058, 0.44843328],
+                             [- 4.64383953, -0.00461827, 0.00239313, 5.63922126, 0.98403499, 0.99298859, 0.44851690],
+                             [- 4.64781892, -0.00461286, 0.00239057, 5.64320606, 0.98405750, 0.99299657, 0.44860066],
+                             [- 4.65179227, -0.00460748, 0.00238802, 5.64718479, 0.98407993, 0.99300451, 0.44868455],
+                             [- 4.65575956, -0.00460211, 0.00238548, 5.65115744, 0.98410229, 0.99301241, 0.44876859],
+                             [- 4.65972078, -0.00459677, 0.00238296, 5.65512401, 0.98412458, 0.99302027, 0.44885276],
+                             [- 4.66367592, -0.00459144, 0.00238046, 5.65908448, 0.98414679, 0.99302810, 0.44893706],
+                             [- 4.66762497, -0.00458614, 0.00237797, 5.66303884, 0.98416893, 0.99303590, 0.44902148],
+                             [- 4.67156793, -0.00458085, 0.00237549, 5.66698708, 0.98419099, 0.99304366, 0.44910603],
+                             [- 4.67550478, -0.00457558, 0.00237303, 5.67092920, 0.98421298, 0.99305138, 0.44919070],
+                             [- 4.67943552, -0.00457034, 0.00237059, 5.67486518, 0.98423490, 0.99305907, 0.44927549],
+                             [- 4.68336012, -0.00456511, 0.00236816, 5.67879501, 0.98425675, 0.99306673, 0.44936038],
+                             [- 4.68727860, -0.00455990, 0.00236575, 5.68271869, 0.98427852, 0.99307435, 0.44944539],
+                             [- 4.69119092, -0.00455472, 0.00236335, 5.68663621, 0.98430023, 0.99308194, 0.44953051],
+                             [- 4.69509710, -0.00454955, 0.00236096, 5.69054755, 0.98432186, 0.99308949, 0.44961572],
+                             [- 4.69899711, -0.00454440, 0.00235859, 5.69445271, 0.98434343, 0.99309701, 0.44970104],
+                             [- 4.70289095, -0.00453926, 0.00235623, 5.69835168, 0.98436492, 0.99310450, 0.44978646],
+                             [- 4.70677861, -0.00453415, 0.00235389, 5.70224446, 0.98438635, 0.99311196, 0.44987197],
+                             [- 4.71066008, -0.00452905, 0.00235156, 5.70613103, 0.98440771, 0.99311939, 0.44995757],
+                             [- 4.71453535, -0.00452398, 0.00234924, 5.71001138, 0.98442899, 0.99312678, 0.45004326],
+                             [- 4.71840442, -0.00451892, 0.00234694, 5.71388551, 0.98445021, 0.99313414, 0.45012903],
+                             [- 4.72226728, -0.00451387, 0.00234465, 5.71775341, 0.98447137, 0.99314147, 0.45021488],
+                             [- 4.72612392, -0.00450885, 0.00234237, 5.72161507, 0.98449245, 0.99314877, 0.45030082],
+                             [- 4.72997433, -0.00450384, 0.00234011, 5.72547048, 0.98451347, 0.99315604, 0.45038683],
+                             [- 4.73381850, -0.00449885, 0.00233786, 5.72931964, 0.98453443, 0.99316328, 0.45047291],
+                             [- 4.73765643, -0.00449388, 0.00233562, 5.73316254, 0.98455532, 0.99317049, 0.45055907],
+                             [- 4.74148810, -0.00448893, 0.00233340, 5.73699917, 0.98457614, 0.99317767, 0.45064529],
+                             [- 4.74531352, -0.00448399, 0.00233119, 5.74082953, 0.98459690, 0.99318483, 0.45073158],
+                             [- 4.74913267, -0.00447907, 0.00232899, 5.74465360, 0.98461759, 0.99319195, 0.45081792],
+                             [- 4.75294555, -0.00447416, 0.00232680, 5.74847138, 0.98463822, 0.99319904, 0.45090433],
+                             [- 4.75675214, -0.00446927, 0.00232462, 5.75228287, 0.98465878, 0.99320610, 0.45099080],
+                             [- 4.76055246, -0.00446440, 0.00232246, 5.75608805, 0.98467929, 0.99321314, 0.45107732],
+                             [- 4.76434647, -0.00445955, 0.00232031, 5.75988693, 0.98469973, 0.99322015, 0.45116389],
+                             [- 4.76813419, -0.00445471, 0.00231816, 5.76367948, 0.98472010, 0.99322713, 0.45125051],
+                             [- 4.77191560, -0.00444988, 0.00231604, 5.76746572, 0.98474042, 0.99323408, 0.45133717],
+                             [- 4.77569070, -0.00444507, 0.00231392, 5.77124562, 0.98476067, 0.99324101, 0.45142388],
+                             [- 4.77945947, -0.00444028, 0.00231181, 5.77501919, 0.98478086, 0.99324791, 0.45151063],
+                             [- 4.78322192, -0.00443550, 0.00230972, 5.77878642, 0.98480099, 0.99325478, 0.45159742],
+                             [- 4.78697804, -0.00443074, 0.00230763, 5.78254730, 0.98482106, 0.99326162, 0.45168425],
+                             [- 4.79072783, -0.00442600, 0.00230556, 5.78630183, 0.98484107, 0.99326844, 0.45177111],
+                             [- 4.79447127, -0.00442127, 0.00230350, 5.79005000, 0.98486102, 0.99327523, 0.45185800],
+                             [- 4.79820836, -0.00441655, 0.00230145, 5.79379181, 0.98488091, 0.99328200, 0.45194492],
+                             [- 4.80193909, -0.00441185, 0.00229941, 5.79752724, 0.98490074, 0.99328874, 0.45203187],
+                             [- 4.80566347, -0.00440716, 0.00229738, 5.80125630, 0.98492051, 0.99329546, 0.45211884],
+                             [- 4.80938148, -0.00440249, 0.00229536, 5.80497899, 0.98494022, 0.99330215, 0.45220583],
+                             [- 4.81309312, -0.00439783, 0.00229335, 5.80869528, 0.98495988, 0.99330881, 0.45229285],
+                             [- 4.81679838, -0.00439319, 0.00229135, 5.81240519, 0.98497947, 0.99331546, 0.45237988],
+                             [- 4.82049726, -0.00438856, 0.00228937, 5.81610870, 0.98499901, 0.99332207, 0.45246692],
+                             [- 4.82418976, -0.00438395, 0.00228739, 5.81980581, 0.98501850, 0.99332866, 0.45255398],
+                             [- 4.82787587, -0.00437935, 0.00228542, 5.82349652, 0.98503792, 0.99333523, 0.45264105],
+                             [- 4.83155558, -0.00437476, 0.00228346, 5.82718082, 0.98505729, 0.99334178, 0.45272813],
+                             [- 4.83522889, -0.00437019, 0.00228151, 5.83085870, 0.98507660, 0.99334830, 0.45281521],
+                             [- 4.83889580, -0.00436563, 0.00227957, 5.83453017, 0.98509586, 0.99335480, 0.45290231],
+                             [- 4.84255630, -0.00436109, 0.00227764, 5.83819521, 0.98511506, 0.99336127, 0.45298940],
+                             [- 4.84621038, -0.00435656, 0.00227572, 5.84185383, 0.98513421, 0.99336772, 0.45307649],
+                             [- 4.84985805, -0.00435204, 0.00227381, 5.84550601, 0.98515330, 0.99337415, 0.45316358],
+                             [- 4.85349930, -0.00434753, 0.00227191, 5.84915177, 0.98517233, 0.99338056, 0.45325067],
+                             [- 4.85713412, -0.00434304, 0.00227002, 5.85279108, 0.98519132, 0.99338694, 0.45333775],
+                             [- 4.86076252, -0.00433856, 0.00226813, 5.85642396, 0.98521024, 0.99339330, 0.45342482],
+                             [- 4.86438448, -0.00433410, 0.00226626, 5.86005038, 0.98522912, 0.99339964, 0.45351189],
+                             [- 4.86800001, -0.00432965, 0.00226439, 5.86367036, 0.98524794, 0.99340596, 0.45359894],
+                             [- 4.87160909, -0.00432521, 0.00226253, 5.86728389, 0.98526671, 0.99341226, 0.45368598],
+                             [- 4.87521174, -0.00432078, 0.00226069, 5.87089096, 0.98528542, 0.99341853, 0.45377301],
+                             [- 4.87880793, -0.00431637, 0.00225885, 5.87449157, 0.98530409, 0.99342479, 0.45386001],
+                             [- 4.88239768, -0.00431196, 0.00225701, 5.87808572, 0.98532270, 0.99343102, 0.45394700],
+                             [- 4.88598098, -0.00430758, 0.00225519, 5.88167340, 0.98534126, 0.99343723, 0.45403397],
+                             [- 4.88955781, -0.00430320, 0.00225338, 5.88525462, 0.98535976, 0.99344342, 0.45412092],
+                             [- 4.89312819, -0.00429883, 0.00225157, 5.88882936, 0.98537822, 0.99344960, 0.45420784],
+                             [- 4.89669211, -0.00429448, 0.00224977, 5.89239763, 0.98539662, 0.99345575, 0.45429473],
+                             [- 4.90024957, -0.00429014, 0.00224798, 5.89595942, 0.98541498, 0.99346188, 0.45438160],
+                             [- 4.90380055, -0.00428581, 0.00224620, 5.89951474, 0.98543328, 0.99346799, 0.45446844],
+                             [- 4.90734507, -0.00428150, 0.00224442, 5.90306357, 0.98545154, 0.99347408, 0.45455524],
+                             [- 4.91088312, -0.00427719, 0.00224266, 5.90660592, 0.98546974, 0.99348015, 0.45464201],
+                             [- 4.91441469, -0.00427290, 0.00224090, 5.91014179, 0.98548790, 0.99348620, 0.45472875],
+                             [- 4.91793978, -0.00426862, 0.00223915, 5.91367116, 0.98550600, 0.99349224, 0.45481546],
+                             [- 4.92145840, -0.00426435, 0.00223740, 5.91719405, 0.98552406, 0.99349825, 0.45490212],
+                             [- 4.92497053, -0.00426009, 0.00223566, 5.92071044, 0.98554206, 0.99350425, 0.45498875],
+                             [- 4.92847618, -0.00425584, 0.00223394, 5.92422034, 0.98556002, 0.99351022, 0.45507533],
+                             [- 4.93197535, -0.00425160, 0.00223221, 5.92772375, 0.98557793, 0.99351618, 0.45516187],
+                             [- 4.93546803, -0.00424738, 0.00223050, 5.93122065, 0.98559579, 0.99352212, 0.45524837],
+                             [- 4.93895423, -0.00424317, 0.00222879, 5.93471106, 0.98561361, 0.99352804, 0.45533482],
+                             [- 4.94243393, -0.00423896, 0.00222709, 5.93819497, 0.98563138, 0.99353395, 0.45542123],
+                             [- 4.94590714, -0.00423477, 0.00222540, 5.94167237, 0.98564910, 0.99353983, 0.45550758],
+                             [- 4.94937386, -0.00423059, 0.00222371, 5.94514327, 0.98566677, 0.99354570, 0.45559389],
+                             [- 4.95283409, -0.00422642, 0.00222203, 5.94860767, 0.98568439, 0.99355155, 0.45568014],
+                             [- 4.95628782, -0.00422226, 0.00222036, 5.95206556, 0.98570197, 0.99355738, 0.45576634],
+                             [- 4.95973505, -0.00421811, 0.00221869, 5.95551694, 0.98571951, 0.99356320, 0.45585249],
+                             [- 4.96317579, -0.00421397, 0.00221703, 5.95896181, 0.98573699, 0.99356900, 0.45593858],
+                             [- 4.96661002, -0.00420984, 0.00221538, 5.96240018, 0.98575444, 0.99357478, 0.45602462],
+                             [- 4.97003776, -0.00420573, 0.00221373, 5.96583204, 0.98577183, 0.99358054, 0.45611059],
+                             [- 4.97345900, -0.00420162, 0.00221209, 5.96925738, 0.98578918, 0.99358629, 0.45619651],
+                             [- 4.97687374, -0.00419752, 0.00221046, 5.97267622, 0.98580649, 0.99359202, 0.45628236],
+                             [- 4.98028197, -0.00419344, 0.00220883, 5.97608854, 0.98582375, 0.99359774, 0.45636816],
+                             [- 4.98368371, -0.00418936, 0.00220721, 5.97949435, 0.98584096, 0.99360343, 0.45645388],
+                             [- 4.98707894, -0.00418529, 0.00220559, 5.98289365, 0.98585814, 0.99360912, 0.45653955],
+                             [- 4.99046767, -0.00418123, 0.00220398, 5.98628643, 0.98587526, 0.99361478, 0.45662514],
+                             [- 4.99384989, -0.00417719, 0.00220238, 5.98967270, 0.98589235, 0.99362043, 0.45671067],
+                             [- 4.99722561, -0.00417315, 0.00220078, 5.99305246, 0.98590939, 0.99362607, 0.45679613],
+                             [- 5.00059483, -0.00416912, 0.00219919, 5.99642571, 0.98592638, 0.99363169, 0.45688152],
+                             [- 5.00395754, -0.00416511, 0.00219761, 5.99979244, 0.98594334, 0.99363729, 0.45696684],
+                             [- 5.00731375, -0.00416110, 0.00219603, 6.00315266, 0.98596025, 0.99364288, 0.45705209],
+                             [- 5.01066346, -0.00415710, 0.00219445, 6.00650636, 0.98597712, 0.99364845, 0.45713726],
+                             [- 5.01400667, -0.00415311, 0.00219288, 6.00985356, 0.98599394, 0.99365401, 0.45722236],
+                             [- 5.01734337, -0.00414913, 0.00219132, 6.01319424, 0.98601072, 0.99365955, 0.45730738],
+                             [- 5.02067356, -0.00414516, 0.00218976, 6.01652841, 0.98602746, 0.99366508, 0.45739233],
+                             [- 5.02399726, -0.00414120, 0.00218821, 6.01985606, 0.98604416, 0.99367059, 0.45747719],
+                             [- 5.02731445, -0.00413724, 0.00218666, 6.02317721, 0.98606082, 0.99367609, 0.45756198],
+                             [- 5.03062515, -0.00413330, 0.00218512, 6.02649184, 0.98607744, 0.99368157, 0.45764669],
+                             [- 5.03392934, -0.00412937, 0.00218359, 6.02979997, 0.98609401, 0.99368704, 0.45773131],
+                             [- 5.03722703, -0.00412544, 0.00218206, 6.03310159, 0.98611054, 0.99369250, 0.45781585],
+                             [- 5.04051822, -0.00412153, 0.00218053, 6.03639670, 0.98612704, 0.99369794, 0.45790031],
+                             [- 5.04380292, -0.00411762, 0.00217901, 6.03968530, 0.98614349, 0.99370337, 0.45798469],
+                             [- 5.04708112, -0.00411372, 0.00217750, 6.04296739, 0.98615990, 0.99370878, 0.45806897],
+                             [- 5.05035282, -0.00410983, 0.00217599, 6.04624299, 0.98617627, 0.99371418, 0.45815318],
+                             [- 5.05361802, -0.00410595, 0.00217448, 6.04951207, 0.98619260, 0.99371957, 0.45823729],
+                             [- 5.05687674, -0.00410208, 0.00217298, 6.05277466, 0.98620889, 0.99372494, 0.45832131],
+                             [- 5.06012896, -0.00409821, 0.00217148, 6.05603074, 0.98622514, 0.99373030, 0.45840525],
+                             [- 5.06337469, -0.00409436, 0.00216999, 6.05928033, 0.98624135, 0.99373565, 0.45848909],
+                             [- 5.06661393, -0.00409051, 0.00216851, 6.06252341, 0.98625753, 0.99374098, 0.45857285],
+                             [- 5.06984668, -0.00408668, 0.00216703, 6.06576000, 0.98627366, 0.99374630, 0.45865651],
+                             [- 5.07307294, -0.00408285, 0.00216555, 6.06899010, 0.98628975, 0.99375161, 0.45874007],
+                             [- 5.07629272, -0.00407902, 0.00216408, 6.07221370, 0.98630581, 0.99375690, 0.45882355],
+                             [- 5.07950602, -0.00407521, 0.00216261, 6.07543081, 0.98632182, 0.99376218, 0.45890693],
+                             [- 5.08271283, -0.00407141, 0.00216115, 6.07864143, 0.98633780, 0.99376745, 0.45899021],
+                             [- 5.08591317, -0.00406761, 0.00215969, 6.08184556, 0.98635374, 0.99377270, 0.45907339],
+                             [- 5.08910703, -0.00406382, 0.00215823, 6.08504321, 0.98636965, 0.99377795, 0.45915648],
+                             [- 5.09229441, -0.00406004, 0.00215678, 6.08823437, 0.98638551, 0.99378318, 0.45923947],
+                             [- 5.09547532, -0.00405627, 0.00215534, 6.09141905, 0.98640134, 0.99378840, 0.45932235],
+                             [- 5.09864975, -0.00405250, 0.00215390, 6.09459725, 0.98641713, 0.99379360, 0.45940514],
+                             [- 5.10181772, -0.00404874, 0.00215246, 6.09776897, 0.98643288, 0.99379880, 0.45948783],
+                             [- 5.10497922, -0.00404500, 0.00215102, 6.10093422, 0.98644859, 0.99380398, 0.45957041],
+                             [- 5.10813425, -0.00404125, 0.00214960, 6.10409300, 0.98646427, 0.99380915, 0.45965289],
+                             [- 5.11128282, -0.00403752, 0.00214817, 6.10724530, 0.98647991, 0.99381431, 0.45973527],
+                             [- 5.11442494, -0.00403379, 0.00214675, 6.11039114, 0.98649552, 0.99381946, 0.45981755],
+                             [- 5.11756059, -0.00403008, 0.00214533, 6.11353051, 0.98651108, 0.99382459, 0.45989972],
+                             [- 5.12068979, -0.00402637, 0.00214392, 6.11666343, 0.98652662, 0.99382971, 0.45998178],
+                             [- 5.12381254, -0.00402266, 0.00214251, 6.11978988, 0.98654211, 0.99383483, 0.46006373],
+                             [- 5.12692884, -0.00401897, 0.00214110, 6.12290987, 0.98655757, 0.99383993, 0.46014558],
+                             [- 5.13003869, -0.00401528, 0.00213970, 6.12602341, 0.98657300, 0.99384502, 0.46022732],
+                             [- 5.13314210, -0.00401160, 0.00213831, 6.12913050, 0.98658838, 0.99385010, 0.46030896],
+                             [- 5.13623906, -0.00400792, 0.00213691, 6.13223114, 0.98660374, 0.99385516, 0.46039048],
+                             [- 5.13932959, -0.00400426, 0.00213552, 6.13532533, 0.98661906, 0.99386022, 0.46047189],
+                             [- 5.14241368, -0.00400060, 0.00213413, 6.13841308, 0.98663434, 0.99386527, 0.46055319],
+                             [- 5.14549135, -0.00399695, 0.00213275, 6.14149440, 0.98664959, 0.99387030, 0.46063438],
+                             [- 5.14856258, -0.00399330, 0.00213137, 6.14456928, 0.98666480, 0.99387532, 0.46071546],
+                             [- 5.15162739, -0.00398967, 0.00213000, 6.14763772, 0.98667998, 0.99388034, 0.46079643],
+                             [- 5.15468577, -0.00398604, 0.00212862, 6.15069974, 0.98669512, 0.99388534, 0.46087728],
+                             [- 5.15773774, -0.00398241, 0.00212725, 6.15375533, 0.98671023, 0.99389033, 0.46095802],
+                             [- 5.16078329, -0.00397880, 0.00212589, 6.15680449, 0.98672531, 0.99389532, 0.46103864],
+                             [- 5.16382243, -0.00397519, 0.00212453, 6.15984724, 0.98674035, 0.99390029, 0.46111915],
+                             [- 5.16685516, -0.00397159, 0.00212317, 6.16288358, 0.98675535, 0.99390525, 0.46119954],
+                             [- 5.16988149, -0.00396799, 0.00212181, 6.16591350, 0.98677033, 0.99391020, 0.46127982],
+                             [- 5.17290141, -0.00396440, 0.00212046, 6.16893701, 0.98678527, 0.99391514, 0.46135997],
+                             [- 5.17591494, -0.00396082, 0.00211911, 6.17195412, 0.98680017, 0.99392007, 0.46144001],
+                             [- 5.17892208, -0.00395724, 0.00211776, 6.17496483, 0.98681505, 0.99392499, 0.46151994],
+                             [- 5.18192282, -0.00395368, 0.00211642, 6.17796914, 0.98682989, 0.99392990, 0.46159974],
+                             [- 5.18491718, -0.00395011, 0.00211508, 6.18096706, 0.98684470, 0.99393481, 0.46167943],
+                             [- 5.18790516, -0.00394656, 0.00211374, 6.18395860, 0.98685947, 0.99393970, 0.46175899],
+                             [- 5.19088675, -0.00394301, 0.00211241, 6.18694374, 0.98687421, 0.99394458, 0.46183843],
+                             [- 5.19386198, -0.00393947, 0.00211108, 6.18992251, 0.98688892, 0.99394945, 0.46191776],
+                             [- 5.19683083, -0.00393593, 0.00210975, 6.19289490, 0.98690360, 0.99395432, 0.46199696],
+                             [- 5.19979332, -0.00393241, 0.00210843, 6.19586092, 0.98691824, 0.99395917, 0.46207604],
+                             [- 5.20274945, -0.00392888, 0.00210710, 6.19882057, 0.98693285, 0.99396401, 0.46215500],
+                             [- 5.20569922, -0.00392537, 0.00210578, 6.20177385, 0.98694743, 0.99396885, 0.46223383],
+                             [- 5.20864264, -0.00392186, 0.00210447, 6.20472078, 0.98696198, 0.99397367, 0.46231254],
+                             [- 5.21157971, -0.00391835, 0.00210315, 6.20766135, 0.98697650, 0.99397849, 0.46239113],
+                             [- 5.21451043, -0.00391486, 0.00210184, 6.21059558, 0.98699098, 0.99398330, 0.46246959],
+                             [- 5.21743482, -0.00391137, 0.00210054, 6.21352345, 0.98700544, 0.99398810, 0.46254793],
+                             [- 5.22035287, -0.00390788, 0.00209923, 6.21644499, 0.98701986, 0.99399289, 0.46262614],
+                             [- 5.22326459, -0.00390440, 0.00209793, 6.21936019, 0.98703425, 0.99399767, 0.46270423],
+                             [- 5.22616999, -0.00390093, 0.00209663, 6.22226905, 0.98704861, 0.99400244, 0.46278219],
+                             [- 5.22906906, -0.00389747, 0.00209533, 6.22517159, 0.98706294, 0.99400720, 0.46286003],
+                             [- 5.23196182, -0.00389401, 0.00209404, 6.22806781, 0.98707724, 0.99401196, 0.46293774],
+                             [- 5.23484826, -0.00389055, 0.00209274, 6.23095771, 0.98709151, 0.99401670, 0.46301532],
+                             [- 5.23772840, -0.00388711, 0.00209145, 6.23384129, 0.98710574, 0.99402144, 0.46309277],
+                             [- 5.24060224, -0.00388366, 0.00209017, 6.23671857, 0.98711995, 0.99402617, 0.46317009],
+                             [- 5.24346978, -0.00388023, 0.00208888, 6.23958955, 0.98713413, 0.99403089, 0.46324729],
+                             [- 5.24633103, -0.00387680, 0.00208760, 6.24245423, 0.98714827, 0.99403560, 0.46332436],
+                             [- 5.24918599, -0.00387338, 0.00208632, 6.24531261, 0.98716239, 0.99404030, 0.46340129],
+                             [- 5.25203467, -0.00386996, 0.00208504, 6.24816471, 0.98717648, 0.99404500, 0.46347810],
+                             [- 5.25487707, -0.00386655, 0.00208377, 6.25101053, 0.98719053, 0.99404969, 0.46355478],
+                             [- 5.25771320, -0.00386314, 0.00208250, 6.25385007, 0.98720456, 0.99405436, 0.46363133],
+                             [- 5.26054307, -0.00385974, 0.00208123, 6.25668333, 0.98721856, 0.99405904, 0.46370775],
+                             [- 5.26336668, -0.00385634, 0.00207996, 6.25951033, 0.98723253, 0.99406370, 0.46378403],
+                             [- 5.26618402, -0.00385295, 0.00207869, 6.26233107, 0.98724646, 0.99406835, 0.46386019],
+                             [- 5.26899512, -0.00384957, 0.00207743, 6.26514555, 0.98726037, 0.99407300, 0.46393621],
+                             [- 5.27179998, -0.00384619, 0.00207617, 6.26795379, 0.98727425, 0.99407764, 0.46401210],
+                             [- 5.27459860, -0.00384282, 0.00207491, 6.27075577, 0.98728810, 0.99408227, 0.46408786],
+                             [- 5.27739098, -0.00383945, 0.00207365, 6.27355152, 0.98730193, 0.99408689, 0.46416348],
+                             [- 5.28017713, -0.00383609, 0.00207240, 6.27634104, 0.98731572, 0.99409151, 0.46423898],
+                             [- 5.28295706, -0.00383274, 0.00207115, 6.27912432, 0.98732949, 0.99409612, 0.46431433],
+                             [- 5.28573078, -0.00382939, 0.00206989, 6.28190139, 0.98734322, 0.99410072, 0.46438956],
+                             [- 5.28849828, -0.00382604, 0.00206865, 6.28467224, 0.98735693, 0.99410531, 0.46446465],
+                             [- 5.29125958, -0.00382271, 0.00206740, 6.28743687, 0.98737061, 0.99410989, 0.46453961],
+                             [- 5.29401468, -0.00381937, 0.00206616, 6.29019530, 0.98738426, 0.99411447, 0.46461443],
+                             [- 5.29676358, -0.00381604, 0.00206491, 6.29294754, 0.98739789, 0.99411904, 0.46468912],
+                             [- 5.29950630, -0.00381272, 0.00206367, 6.29569358, 0.98741148, 0.99412361, 0.46476368],
+                             [- 5.30224283, -0.00380940, 0.00206243, 6.29843343, 0.98742505, 0.99412816, 0.46483809],
+                             [- 5.30497319, -0.00380609, 0.00206120, 6.30116710, 0.98743859, 0.99413271, 0.46491238],
+                             [- 5.30769738, -0.00380279, 0.00205996, 6.30389459, 0.98745210, 0.99413725, 0.46498652],
+                             [- 5.31041540, -0.00379948, 0.00205873, 6.30661592, 0.98746559, 0.99414179, 0.46506054],
+                             [- 5.31312727, -0.00379619, 0.00205750, 6.30933108, 0.98747905, 0.99414631, 0.46513441],
+                             [- 5.31583299, -0.00379290, 0.00205627, 6.31204009, 0.98749248, 0.99415083, 0.46520815],
+                             [- 5.31853255, -0.00378961, 0.00205504, 6.31474294, 0.98750588, 0.99415535, 0.46528175],
+                             [- 5.32122598, -0.00378633, 0.00205382, 6.31743965, 0.98751926, 0.99415985, 0.46535522],
+                             [- 5.32391328, -0.00378306, 0.00205259, 6.32013023, 0.98753261, 0.99416435, 0.46542855],
+                             [- 5.32659445, -0.00377979, 0.00205137, 6.32281466, 0.98754593, 0.99416884, 0.46550174],
+                             [- 5.32926950, -0.00377652, 0.00205015, 6.32549298, 0.98755923, 0.99417333, 0.46557479],
+                             [- 5.33193843, -0.00377326, 0.00204893, 6.32816517, 0.98757249, 0.99417781, 0.46564771],
+                             [- 5.33460126, -0.00377000, 0.00204772, 6.33083125, 0.98758574, 0.99418228, 0.46572049],
+                             [- 5.33725798, -0.00376675, 0.00204650, 6.33349123, 0.98759895, 0.99418674, 0.46579313],
+                             [- 5.33990861, -0.00376351, 0.00204529, 6.33614511, 0.98761214, 0.99419120, 0.46586563],
+                             [- 5.34255316, -0.00376027, 0.00204408, 6.33879289, 0.98762531, 0.99419565, 0.46593799],
+                             [- 5.34519162, -0.00375703, 0.00204287, 6.34143458, 0.98763844, 0.99420010, 0.46601022],
+                             [- 5.34782400, -0.00375380, 0.00204166, 6.34407020, 0.98765155, 0.99420454, 0.46608230],
+                             [- 5.35045032, -0.00375058, 0.00204045, 6.34669974, 0.98766464, 0.99420897, 0.46615425],
+                             [- 5.35307057, -0.00374736, 0.00203925, 6.34932321, 0.98767770, 0.99421340, 0.46622606],
+                             [- 5.35568477, -0.00374414, 0.00203804, 6.35194063, 0.98769073, 0.99421781, 0.46629773],
+                             [- 5.35829292, -0.00374093, 0.00203684, 6.35455199, 0.98770374, 0.99422223, 0.46636926],
+                             [- 5.36089503, -0.00373773, 0.00203564, 6.35715730, 0.98771672, 0.99422663, 0.46644065],
+                             [- 5.36349110, -0.00373453, 0.00203444, 6.35975657, 0.98772968, 0.99423103, 0.46651190],
+                             [- 5.36608114, -0.00373133, 0.00203324, 6.36234981, 0.98774261, 0.99423543, 0.46658301],
+                             [- 5.36866517, -0.00372814, 0.00203205, 6.36493703, 0.98775552, 0.99423982, 0.46665398],
+                             [- 5.37124318, -0.00372495, 0.00203085, 6.36751823, 0.98776840, 0.99424420, 0.46672482],
+                             [- 5.37381518, -0.00372177, 0.00202966, 6.37009341, 0.98778125, 0.99424857, 0.46679551],
+                             [- 5.37638118, -0.00371859, 0.00202847, 6.37266259, 0.98779408, 0.99425294, 0.46686606],
+                             [- 5.37894119, -0.00371542, 0.00202728, 6.37522577, 0.98780689, 0.99425730, 0.46693647],
+                             [- 5.38149521, -0.00371225, 0.00202609, 6.37778296, 0.98781967, 0.99426166, 0.46700674],
+                             [- 5.38404325, -0.00370909, 0.00202490, 6.38033416, 0.98783243, 0.99426601, 0.46707687],
+                             [- 5.38658532, -0.00370593, 0.00202371, 6.38287939, 0.98784516, 0.99427036, 0.46714686],
+                             [- 5.38912142, -0.00370278, 0.00202253, 6.38541865, 0.98785786, 0.99427470, 0.46721671],
+                             [- 5.39165157, -0.00369963, 0.00202134, 6.38795194, 0.98787055, 0.99427903, 0.46728642],
+                             [- 5.39417576, -0.00369648, 0.00202016, 6.39047928, 0.98788320, 0.99428336, 0.46735598],
+                             [- 5.39669401, -0.00369334, 0.00201898, 6.39300067, 0.98789584, 0.99428768, 0.46742541],
+                             [- 5.39920633, -0.00369021, 0.00201780, 6.39551612, 0.98790845, 0.99429200, 0.46749470],
+                             [- 5.40171272, -0.00368707, 0.00201662, 6.39802564, 0.98792103, 0.99429631, 0.46756384],
+                             [- 5.40421318, -0.00368395, 0.00201544, 6.40052923, 0.98793359, 0.99430061, 0.46763284],
+                             [- 5.40670773, -0.00368082, 0.00201427, 6.40302690, 0.98794613, 0.99430491, 0.46770170],
+                             [- 5.40919637, -0.00367771, 0.00201309, 6.40551867, 0.98795864, 0.99430920, 0.46777042],
+                             [- 5.41167912, -0.00367459, 0.00201192, 6.40800452, 0.98797113, 0.99431349, 0.46783900],
+                             [- 5.41415597, -0.00367148, 0.00201075, 6.41048448, 0.98798360, 0.99431777, 0.46790744],
+                             [- 5.41662693, -0.00366838, 0.00200957, 6.41295855, 0.98799604, 0.99432205, 0.46797574],
+                             [- 5.41909202, -0.00366528, 0.00200840, 6.41542674, 0.98800846, 0.99432632, 0.46804389],
+                             [- 5.42155124, -0.00366218, 0.00200724, 6.41788906, 0.98802085, 0.99433058, 0.46811190],
+                             [- 5.42400460, -0.00365909, 0.00200607, 6.42034551, 0.98803323, 0.99433484, 0.46817978],
+                             [- 5.42645210, -0.00365600, 0.00200490, 6.42279610, 0.98804557, 0.99433910, 0.46824751],
+                             [- 5.42889376, -0.00365292, 0.00200374, 6.42524084, 0.98805790, 0.99434334, 0.46831509],
+                             [- 5.43132958, -0.00364984, 0.00200257, 6.42767973, 0.98807020, 0.99434759, 0.46838254],
+                             [- 5.43375956, -0.00364677, 0.00200141, 6.43011279, 0.98808248, 0.99435183, 0.46844985],
+                             [- 5.43618372, -0.00364370, 0.00200024, 6.43254002, 0.98809474, 0.99435606, 0.46851701],
+                             [- 5.43860207, -0.00364063, 0.00199908, 6.43496143, 0.98810697, 0.99436029, 0.46858403],
+                             [- 5.44101460, -0.00363757, 0.00199792, 6.43737703, 0.98811918, 0.99436451, 0.46865091],
+                             [- 5.44342134, -0.00363451, 0.00199676, 6.43978683, 0.98813137, 0.99436872, 0.46871765],
+                             [- 5.44582228, -0.00363146, 0.00199561, 6.44219082, 0.98814353, 0.99437294, 0.46878424],
+                             [- 5.44821744, -0.00362841, 0.00199445, 6.44458903, 0.98815567, 0.99437714, 0.46885070],
+                             [- 5.45060682, -0.00362536, 0.00199329, 6.44698145, 0.98816779, 0.99438134, 0.46891701],
+                             [- 5.45299043, -0.00362232, 0.00199214, 6.44936811, 0.98817989, 0.99438554, 0.46898318],
+                             [- 5.45536828, -0.00361929, 0.00199098, 6.45174899, 0.98819196, 0.99438973, 0.46904921],
+                             [- 5.45774037, -0.00361625, 0.00198983, 6.45412412, 0.98820402, 0.99439392, 0.46911510],
+                             [- 5.46010672, -0.00361323, 0.00198868, 6.45649350, 0.98821605, 0.99439810, 0.46918084],
+                             [- 5.46246734, -0.00361020, 0.00198753, 6.45885714, 0.98822805, 0.99440227, 0.46924645],
+                             [- 5.46482222, -0.00360718, 0.00198638, 6.46121504, 0.98824004, 0.99440644, 0.46931191],
+                             [- 5.46717138, -0.00360417, 0.00198523, 6.46356722, 0.98825200, 0.99441061, 0.46937723],
+                             [- 5.46951483, -0.00360115, 0.00198408, 6.46591367, 0.98826395, 0.99441477, 0.46944241],
+                             [- 5.47185257, -0.00359814, 0.00198293, 6.46825442, 0.98827587, 0.99441892, 0.46950744],
+                             [- 5.47418461, -0.00359514, 0.00198178, 6.47058947, 0.98828776, 0.99442308, 0.46957234],
+                             [- 5.47651097, -0.00359214, 0.00198064, 6.47291883, 0.98829964, 0.99442722, 0.46963709],
+                             [- 5.47883164, -0.00358914, 0.00197949, 6.47524250, 0.98831150, 0.99443136, 0.46970170],
+                             [- 5.48114664, -0.00358615, 0.00197835, 6.47756049, 0.98832333, 0.99443550, 0.46976617],
+                             [- 5.48345598, -0.00358316, 0.00197721, 6.47987281, 0.98833514, 0.99443963, 0.46983050],
+                             [- 5.48575966, -0.00358018, 0.00197606, 6.48217948, 0.98834693, 0.99444376, 0.46989469],
+                             [- 5.48805769, -0.00357720, 0.00197492, 6.48448049, 0.98835870, 0.99444788, 0.46995873],
+                             [- 5.49035007, -0.00357422, 0.00197378, 6.48677585, 0.98837045, 0.99445200, 0.47002264],
+                             [- 5.49263683, -0.00357125, 0.00197264, 6.48906558, 0.98838217, 0.99445611, 0.47008640],
+                             [- 5.49491797, -0.00356828, 0.00197150, 6.49134968, 0.98839388, 0.99446022, 0.47015002],
+                             [- 5.49719348, -0.00356532, 0.00197036, 6.49362817, 0.98840556, 0.99446432, 0.47021350],
+                             [- 5.49946339, -0.00356236, 0.00196923, 6.49590104, 0.98841723, 0.99446842, 0.47027684],
+                             [- 5.50172771, -0.00355940, 0.00196809, 6.49816831, 0.98842887, 0.99447251, 0.47034004],
+                             [- 5.50398643, -0.00355645, 0.00196695, 6.50042998, 0.98844049, 0.99447660, 0.47040310],
+                             [- 5.50623957, -0.00355350, 0.00196582, 6.50268607, 0.98845209, 0.99448068, 0.47046602],
+                             [- 5.50848713, -0.00355055, 0.00196468, 6.50493658, 0.98846367, 0.99448476, 0.47052879],
+                             [- 5.51072913, -0.00354761, 0.00196355, 6.50718152, 0.98847523, 0.99448884, 0.47059143],
+                             [- 5.51296557, -0.00354467, 0.00196242, 6.50942090, 0.98848677, 0.99449291, 0.47065392],
+                             [- 5.51519647, -0.00354174, 0.00196129, 6.51165473, 0.98849828, 0.99449698, 0.47071627],
+                             [- 5.51742182, -0.00353881, 0.00196016, 6.51388301, 0.98850978, 0.99450104, 0.47077849],
+                             [- 5.51964164, -0.00353588, 0.00195902, 6.51610576, 0.98852126, 0.99450510, 0.47084056],
+                             [- 5.52185594, -0.00353296, 0.00195789, 6.51832298, 0.98853271, 0.99450915, 0.47090249],
+                             [- 5.52406473, -0.00353004, 0.00195677, 6.52053469, 0.98854415, 0.99451320, 0.47096428],
+                             [- 5.52626800, -0.00352712, 0.00195564, 6.52274088, 0.98855556, 0.99451724, 0.47102593],
+                             [- 5.52846578, -0.00352421, 0.00195451, 6.52494157, 0.98856696, 0.99452128, 0.47108744],
+                             [- 5.53065808, -0.00352130, 0.00195338, 6.52713677, 0.98857834, 0.99452532, 0.47114881],
+                             [- 5.53284489, -0.00351840, 0.00195226, 6.52932649, 0.98858969, 0.99452935, 0.47121004],
+                             [- 5.53502623, -0.00351550, 0.00195113, 6.53151073, 0.98860103, 0.99453337, 0.47127113],
+                             [- 5.53720210, -0.00351260, 0.00195001, 6.53368950, 0.98861234, 0.99453740, 0.47133208],
+                             [- 5.53937252, -0.00350971, 0.00194888, 6.53586282, 0.98862364, 0.99454141, 0.47139289],
+                             [- 5.54153750, -0.00350682, 0.00194776, 6.53803068, 0.98863491, 0.99454543, 0.47145356],
+                             [- 5.54369704, -0.00350393, 0.00194663, 6.54019311, 0.98864617, 0.99454944, 0.47151409],
+                             [- 5.54585115, -0.00350105, 0.00194551, 6.54235010, 0.98865740, 0.99455344, 0.47157449],
+                             [- 5.54799984, -0.00349817, 0.00194439, 6.54450167, 0.98866862, 0.99455744, 0.47163474],
+                             [- 5.55014311, -0.00349529, 0.00194327, 6.54664782, 0.98867982, 0.99456144, 0.47169485],
+                             [- 5.55228099, -0.00349242, 0.00194215, 6.54878857, 0.98869099, 0.99456543, 0.47175483],
+                             [- 5.55441347, -0.00348955, 0.00194103, 6.55092392, 0.98870215, 0.99456942, 0.47181466],
+                             [- 5.55654057, -0.00348669, 0.00193991, 6.55305388, 0.98871329, 0.99457340, 0.47187436],
+                             [- 5.55866229, -0.00348383, 0.00193879, 6.55517846, 0.98872441, 0.99457738, 0.47193391],
+                             [- 5.56077864, -0.00348097, 0.00193767, 6.55729767, 0.98873551, 0.99458136, 0.47199333],
+                             [- 5.56288964, -0.00347811, 0.00193655, 6.55941152, 0.98874659, 0.99458533, 0.47205261],
+                             [- 5.56499528, -0.00347526, 0.00193544, 6.56152002, 0.98875765, 0.99458930, 0.47211176],
+                             [- 5.56709558, -0.00347242, 0.00193432, 6.56362317, 0.98876869, 0.99459326, 0.47217076],
+                             [- 5.56919055, -0.00346957, 0.00193321, 6.56572098, 0.98877972, 0.99459722, 0.47222962],
+                             [- 5.57128020, -0.00346673, 0.00193209, 6.56781347, 0.98879072, 0.99460118, 0.47228835],
+                             [- 5.57336453, -0.00346390, 0.00193098, 6.56990064, 0.98880171, 0.99460513, 0.47234694],
+                             [- 5.57544356, -0.00346106, 0.00192986, 6.57198250, 0.98881267, 0.99460907, 0.47240539],
+                             [- 5.57751729, -0.00345823, 0.00192875, 6.57405906, 0.98882362, 0.99461302, 0.47246371],
+                             [- 5.57958573, -0.00345541, 0.00192764, 6.57613032, 0.98883455, 0.99461696, 0.47252188],
+                             [- 5.58164889, -0.00345259, 0.00192652, 6.57819631, 0.98884546, 0.99462089, 0.47257992],
+                             [- 5.58370679, -0.00344977, 0.00192541, 6.58025702, 0.98885635, 0.99462482, 0.47263782],
+                             [- 5.58575942, -0.00344695, 0.00192430, 6.58231247, 0.98886722, 0.99462875, 0.47269559],
+                             [- 5.58780679, -0.00344414, 0.00192319, 6.58436266, 0.98887808, 0.99463267, 0.47275321],
+                             [- 5.58984893, -0.00344133, 0.00192208, 6.58640760, 0.98888891, 0.99463659, 0.47281070],
+                             [- 5.59188583, -0.00343852, 0.00192097, 6.58844731, 0.98889973, 0.99464051, 0.47286806],
+                             [- 5.59391750, -0.00343572, 0.00191986, 6.59048178, 0.98891053, 0.99464442, 0.47292528],
+                             [- 5.59594396, -0.00343292, 0.00191875, 6.59251104, 0.98892131, 0.99464833, 0.47298236],
+                             [- 5.59796521, -0.00343013, 0.00191764, 6.59453508, 0.98893207, 0.99465223, 0.47303930],
+                             [- 5.59998126, -0.00342733, 0.00191653, 6.59655393, 0.98894281, 0.99465613, 0.47309611],
+                             [- 5.60199212, -0.00342455, 0.00191543, 6.59856758, 0.98895354, 0.99466003, 0.47315278],
+                             [- 5.60399781, -0.00342176, 0.00191432, 6.60057605, 0.98896425, 0.99466392, 0.47320932],
+                             [- 5.60599831, -0.00341898, 0.00191321, 6.60257934, 0.98897493, 0.99466781, 0.47326572],
+                             [- 5.60799366, -0.00341620, 0.00191211, 6.60457746, 0.98898561, 0.99467169, 0.47332198],
+                             [- 5.60998385, -0.00341342, 0.00191100, 6.60657043, 0.98899626, 0.99467557, 0.47337811],
+                             [- 5.61196890, -0.00341065, 0.00190990, 6.60855825, 0.98900689, 0.99467945, 0.47343411],
+                             [- 5.61394881, -0.00340788, 0.00190879, 6.61054093, 0.98901751, 0.99468332, 0.47348997],
+                             [- 5.61592360, -0.00340512, 0.00190769, 6.61251848, 0.98902811, 0.99468719, 0.47354569],
+                             [- 5.61789327, -0.00340235, 0.00190659, 6.61449091, 0.98903869, 0.99469106, 0.47360128],
+                             [- 5.61985783, -0.00339960, 0.00190548, 6.61645823, 0.98904926, 0.99469492, 0.47365674],
+                             [- 5.62181729, -0.00339684, 0.00190438, 6.61842045, 0.98905980, 0.99469878, 0.47371206],
+                             [- 5.62377166, -0.00339409, 0.00190328, 6.62037757, 0.98907033, 0.99470263, 0.47376724],
+                             [- 5.62572095, -0.00339134, 0.00190218, 6.62232961, 0.98908084, 0.99470648, 0.47382230],
+                             [- 5.62766517, -0.00338859, 0.00190108, 6.62427658, 0.98909133, 0.99471033, 0.47387721],
+                             [- 5.62960432, -0.00338585, 0.00189998, 6.62621847, 0.98910181, 0.99471417, 0.47393200],
+                             [- 5.63153842, -0.00338311, 0.00189888, 6.62815531, 0.98911227, 0.99471801, 0.47398665],
+                             [- 5.63346748, -0.00338037, 0.00189778, 6.63008711, 0.98912271, 0.99472185, 0.47404117],
+                             [- 5.63539150, -0.00337764, 0.00189668, 6.63201386, 0.98913313, 0.99472568, 0.47409555],
+                             [- 5.63731050, -0.00337491, 0.00189558, 6.63393558, 0.98914354, 0.99472951, 0.47414980],
+                             [- 5.63922447, -0.00337218, 0.00189448, 6.63585229, 0.98915393, 0.99473333, 0.47420392],
+                             [- 5.64113344, -0.00336946, 0.00189338, 6.63776398, 0.98916430, 0.99473716, 0.47425791],
+                             [- 5.64303741, -0.00336674, 0.00189229, 6.63967067, 0.98917466, 0.99474097, 0.47431176],
+                             [- 5.64493639, -0.00336402, 0.00189119, 6.64157237, 0.98918499, 0.99474479, 0.47436548],
+                             [- 5.64683039, -0.00336131, 0.00189009, 6.64346908, 0.98919531, 0.99474860, 0.47441907],
+                             [- 5.64871942, -0.00335860, 0.00188899, 6.64536082, 0.98920562, 0.99475241, 0.47447252],
+                             [- 5.65060348, -0.00335589, 0.00188790, 6.64724759, 0.98921590, 0.99475621, 0.47452585],
+                             [- 5.65248259, -0.00335319, 0.00188680, 6.64912941, 0.98922617, 0.99476001, 0.47457904],
+                             [- 5.65435676, -0.00335049, 0.00188571, 6.65100628, 0.98923642, 0.99476381, 0.47463210],
+                             [- 5.65622600, -0.00334779, 0.00188461, 6.65287821, 0.98924666, 0.99476760, 0.47468503],
+                             [- 5.65809030, -0.00334509, 0.00188352, 6.65474521, 0.98925688, 0.99477139, 0.47473783],
+                             [- 5.65994970, -0.00334240, 0.00188243, 6.65660729, 0.98926708, 0.99477517, 0.47479050],
+                             [- 5.66180418, -0.00333971, 0.00188133, 6.65846447, 0.98927727, 0.99477896, 0.47484303],
+                             [- 5.66365377, -0.00333703, 0.00188024, 6.66031674, 0.98928744, 0.99478273, 0.47489544],
+                             [- 5.66549846, -0.00333434, 0.00187915, 6.66216412, 0.98929759, 0.99478651, 0.47494772],
+                             [- 5.66733828, -0.00333166, 0.00187805, 6.66400662, 0.98930772, 0.99479028, 0.47499986],
+                             [- 5.66917323, -0.00332899, 0.00187696, 6.66584424, 0.98931784, 0.99479405, 0.47505187],
+                             [- 5.67100331, -0.00332631, 0.00187587, 6.66767700, 0.98932794, 0.99479781, 0.47510376],
+                             [- 5.67282855, -0.00332364, 0.00187478, 6.66950490, 0.98933803, 0.99480158, 0.47515552],
+                             [- 5.67464894, -0.00332098, 0.00187369, 6.67132796, 0.98934810, 0.99480533, 0.47520714],
+                             [- 5.67646450, -0.00331831, 0.00187260, 6.67314618, 0.98935815, 0.99480909, 0.47525864],
+                             [- 5.67827523, -0.00331565, 0.00187151, 6.67495958, 0.98936819, 0.99481284, 0.47531001],
+                             [- 5.68008115, -0.00331299, 0.00187042, 6.67676816, 0.98937821, 0.99481659, 0.47536125],
+                             [- 5.68188226, -0.00331034, 0.00186933, 6.67857192, 0.98938821, 0.99482033, 0.47541236],
+                             [- 5.68367858, -0.00330769, 0.00186824, 6.68037089, 0.98939820, 0.99482407, 0.47546334],
+                             [- 5.68547011, -0.00330504, 0.00186715, 6.68216507, 0.98940817, 0.99482781, 0.47551419],
+                             [- 5.68725686, -0.00330239, 0.00186606, 6.68395447, 0.98941813, 0.99483154, 0.47556492],
+                             [- 5.68903884, -0.00329975, 0.00186498, 6.68573909, 0.98942807, 0.99483527, 0.47561551],
+                             [- 5.69081606, -0.00329711, 0.00186389, 6.68751895, 0.98943799, 0.99483900, 0.47566598],
+                             [- 5.69258853, -0.00329447, 0.00186280, 6.68929406, 0.98944790, 0.99484272, 0.47571632],
+                             [- 5.69435627, -0.00329184, 0.00186172, 6.69106443, 0.98945779, 0.99484644, 0.47576654],
+                             [- 5.69611926, -0.00328921, 0.00186063, 6.69283005, 0.98946767, 0.99485016, 0.47581663],
+                             [- 5.69787754, -0.00328658, 0.00185954, 6.69459096, 0.98947753, 0.99485388, 0.47586659],
+                             [- 5.69963110, -0.00328396, 0.00185846, 6.69634715, 0.98948737, 0.99485759, 0.47591642],
+                             [- 5.70137996, -0.00328133, 0.00185737, 6.69809863, 0.98949720, 0.99486129, 0.47596613],
+                             [- 5.70312413, -0.00327872, 0.00185629, 6.69984541, 0.98950701, 0.99486500, 0.47601571],
+                             [- 5.70486360, -0.00327610, 0.00185520, 6.70158750, 0.98951681, 0.99486870, 0.47606516],
+                             [- 5.70659840, -0.00327349, 0.00185412, 6.70332492, 0.98952659, 0.99487239, 0.47611449],
+                             [- 5.70832854, -0.00327088, 0.00185304, 6.70505766, 0.98953636, 0.99487609, 0.47616370],
+                             [- 5.71005402, -0.00326827, 0.00185195, 6.70678575, 0.98954611, 0.99487978, 0.47621277],
+                             [- 5.71177484, -0.00326567, 0.00185087, 6.70850918, 0.98955584, 0.99488347, 0.47626172],
+                             [- 5.71349103, -0.00326306, 0.00184979, 6.71022797, 0.98956556, 0.99488715, 0.47631055],
+                             [- 5.71520259, -0.00326047, 0.00184870, 6.71194212, 0.98957526, 0.99489083, 0.47635925],
+                             [- 5.71690953, -0.00325787, 0.00184762, 6.71365166, 0.98958495, 0.99489451, 0.47640783],
+                             [- 5.71861185, -0.00325528, 0.00184654, 6.71535658, 0.98959462, 0.99489818, 0.47645628],
+                             [- 5.72030958, -0.00325269, 0.00184546, 6.71705689, 0.98960428, 0.99490185, 0.47650461],
+                             [- 5.72200271, -0.00325010, 0.00184438, 6.71875261, 0.98961392, 0.99490552, 0.47655282],
+                             [- 5.72369126, -0.00324752, 0.00184330, 6.72044374, 0.98962355, 0.99490918, 0.47660090],
+                             [- 5.72537523, -0.00324494, 0.00184222, 6.72213029, 0.98963316, 0.99491284, 0.47664886],
+                             [- 5.72705463, -0.00324236, 0.00184114, 6.72381227, 0.98964276, 0.99491650, 0.47669669],
+                             [- 5.72872948, -0.00323979, 0.00184006, 6.72548970, 0.98965234, 0.99492016, 0.47674440],
+                             [- 5.73039979, -0.00323721, 0.00183898, 6.72716257, 0.98966190, 0.99492381, 0.47679198],
+                             [- 5.73206555, -0.00323464, 0.00183790, 6.72883091, 0.98967145, 0.99492746, 0.47683945],
+                             [- 5.73372679, -0.00323208, 0.00183682, 6.73049471, 0.98968099, 0.99493110, 0.47688679],
+                             [- 5.73538351, -0.00322952, 0.00183574, 6.73215399, 0.98969051, 0.99493474, 0.47693401],
+                             [- 5.73703572, -0.00322695, 0.00183466, 6.73380876, 0.98970002, 0.99493838, 0.47698111],
+                             [- 5.73868343, -0.00322440, 0.00183359, 6.73545903, 0.98970951, 0.99494202, 0.47702808],
+                             [- 5.74032664, -0.00322184, 0.00183251, 6.73710480, 0.98971898, 0.99494565, 0.47707494],
+                             [- 5.74196538, -0.00321929, 0.00183143, 6.73874609, 0.98972844, 0.99494928, 0.47712167],
+                             [- 5.74359964, -0.00321674, 0.00183036, 6.74038290, 0.98973789, 0.99495290, 0.47716828],
+                             [- 5.74522943, -0.00321419, 0.00182928, 6.74201524, 0.98974732, 0.99495653, 0.47721477],
+                             [- 5.74685478, -0.00321165, 0.00182820, 6.74364312, 0.98975674, 0.99496014, 0.47726113],
+                             [- 5.74847567, -0.00320911, 0.00182713, 6.74526656, 0.98976614, 0.99496376, 0.47730738],
+                             [- 5.75009213, -0.00320657, 0.00182605, 6.74688556, 0.98977552, 0.99496737, 0.47735351],
+                             [- 5.75170417, -0.00320404, 0.00182498, 6.74850013, 0.98978490, 0.99497098, 0.47739952],
+                             [- 5.75331179, -0.00320151, 0.00182390, 6.75011028, 0.98979425, 0.99497459, 0.47744540],
+                             [- 5.75491499, -0.00319898, 0.00182283, 6.75171602, 0.98980360, 0.99497819, 0.47749117],
+                             [- 5.75651380, -0.00319645, 0.00182176, 6.75331735, 0.98981293, 0.99498179, 0.47753682],
+                             [- 5.75810822, -0.00319393, 0.00182068, 6.75491429, 0.98982224, 0.99498539, 0.47758234],
+                             [- 5.75969826, -0.00319141, 0.00181961, 6.75650685, 0.98983154, 0.99498899, 0.47762775],
+                             [- 5.76128392, -0.00318889, 0.00181854, 6.75809504, 0.98984082, 0.99499258, 0.47767304],
+                             [- 5.76286523, -0.00318637, 0.00181746, 6.75967886, 0.98985009, 0.99499616, 0.47771821],
+                             [- 5.76444218, -0.00318386, 0.00181639, 6.76125832, 0.98985935, 0.99499975, 0.47776327],
+                             [- 5.76601479, -0.00318135, 0.00181532, 6.76283343, 0.98986859, 0.99500333, 0.47780820],
+                             [- 5.76758306, -0.00317884, 0.00181425, 6.76440421, 0.98987782, 0.99500691, 0.47785302],
+                             [- 5.76914700, -0.00317634, 0.00181318, 6.76597066, 0.98988703, 0.99501049, 0.47789772],
+                             [- 5.77070663, -0.00317384, 0.00181210, 6.76753279, 0.98989623, 0.99501406, 0.47794230],
+                             [- 5.77226195, -0.00317134, 0.00181103, 6.76909061, 0.98990542, 0.99501763, 0.47798676],
+                             [- 5.77381298, -0.00316884, 0.00180996, 6.77064413, 0.98991459, 0.99502119, 0.47803110],
+                             [- 5.77535971, -0.00316635, 0.00180889, 6.77219336, 0.98992374, 0.99502476, 0.47807533],
+                             [- 5.77690216, -0.00316386, 0.00180782, 6.77373830, 0.98993289, 0.99502832, 0.47811945],
+                             [- 5.77844035, -0.00316137, 0.00180675, 6.77527898, 0.98994201, 0.99503187, 0.47816344],
+                             [- 5.77997427, -0.00315889, 0.00180569, 6.77681538, 0.98995113, 0.99503543, 0.47820732],
+                             [- 5.78150394, -0.00315640, 0.00180462, 6.77834753, 0.98996023, 0.99503898, 0.47825108],
+                             [- 5.78302936, -0.00315393, 0.00180355, 6.77987544, 0.98996931, 0.99504253, 0.47829473],
+                             [- 5.78455056, -0.00315145, 0.00180248, 6.78139911, 0.98997839, 0.99504607, 0.47833826],
+                             [- 5.78606752, -0.00314897, 0.00180141, 6.78291855, 0.98998744, 0.99504961, 0.47838168],
+                             [- 5.78758027, -0.00314650, 0.00180035, 6.78443377, 0.98999649, 0.99505315, 0.47842498],
+                             [- 5.78908882, -0.00314403, 0.00179928, 6.78594478, 0.99000552, 0.99505669, 0.47846816],
+                             [- 5.79059316, -0.00314157, 0.00179821, 6.78745159, 0.99001453, 0.99506022, 0.47851123],
+                             [- 5.79209332, -0.00313911, 0.00179715, 6.78895421, 0.99002354, 0.99506375, 0.47855419],
+                             [- 5.79358930, -0.00313665, 0.00179608, 6.79045265, 0.99003253, 0.99506727, 0.47859703],
+                             [- 5.79508110, -0.00313419, 0.00179501, 6.79194692, 0.99004150, 0.99507080, 0.47863976],
+                             [- 5.79656875, -0.00313173, 0.00179395, 6.79343702, 0.99005046, 0.99507432, 0.47868238],
+                             [- 5.79805224, -0.00312928, 0.00179288, 6.79492296, 0.99005941, 0.99507784, 0.47872487],
+                             [- 5.79953159, -0.00312683, 0.00179182, 6.79640476, 0.99006834, 0.99508135, 0.47876726],
+                             [- 5.80100681, -0.00312438, 0.00179075, 6.79788243, 0.99007726, 0.99508486, 0.47880954],
+                             [- 5.80247790, -0.00312194, 0.00178969, 6.79935596, 0.99008617, 0.99508837, 0.47885170],
+                             [- 5.80394487, -0.00311950, 0.00178863, 6.80082538, 0.99009506, 0.99509187, 0.47889374],
+                             [- 5.80540774, -0.00311706, 0.00178756, 6.80229068, 0.99010394, 0.99509538, 0.47893568],
+                             [- 5.80686651, -0.00311462, 0.00178650, 6.80375189, 0.99011281, 0.99509888, 0.47897750],
+                             [- 5.80832119, -0.00311219, 0.00178544, 6.80520900, 0.99012166, 0.99510237, 0.47901921],
+                             [- 5.80977179, -0.00310976, 0.00178438, 6.80666204, 0.99013050, 0.99510587, 0.47906081],
+                             [- 5.81121832, -0.00310733, 0.00178331, 6.80811099, 0.99013933, 0.99510936, 0.47910230],
+                             [- 5.81266079, -0.00310490, 0.00178225, 6.80955589, 0.99014814, 0.99511284, 0.47914367],
+                             [- 5.81409921, -0.00310248, 0.00178119, 6.81099673, 0.99015694, 0.99511633, 0.47918494],
+                             [- 5.81553358, -0.00310006, 0.00178013, 6.81243352, 0.99016573, 0.99511981, 0.47922609],
+                             [- 5.81696392, -0.00309764, 0.00177907, 6.81386627, 0.99017450, 0.99512329, 0.47926714],
+                             [- 5.81839023, -0.00309523, 0.00177801, 6.81529500, 0.99018326, 0.99512676, 0.47930807],
+                             [- 5.81981252, -0.00309282, 0.00177695, 6.81671970, 0.99019200, 0.99513024, 0.47934889],
+                             [- 5.82123081, -0.00309041, 0.00177589, 6.81814040, 0.99020074, 0.99513370, 0.47938960],
+                             [- 5.82264509, -0.00308800, 0.00177483, 6.81955709, 0.99020946, 0.99513717, 0.47943020],
+                             [- 5.82405539, -0.00308560, 0.00177377, 6.82096980, 0.99021816, 0.99514063, 0.47947070],
+                             [- 5.82546171, -0.00308319, 0.00177271, 6.82237851, 0.99022686, 0.99514410, 0.47951108],
+                             [- 5.82686405, -0.00308079, 0.00177165, 6.82378326, 0.99023554, 0.99514755, 0.47955135],
+                             [- 5.82826243, -0.00307840, 0.00177059, 6.82518403, 0.99024421, 0.99515101, 0.47959152],
+                             [- 5.82965686, -0.00307600, 0.00176954, 6.82658086, 0.99025286, 0.99515446, 0.47963157],
+                             [- 5.83104734, -0.00307361, 0.00176848, 6.82797373, 0.99026150, 0.99515791, 0.47967152],
+                             [- 5.83243389, -0.00307122, 0.00176742, 6.82936266, 0.99027013, 0.99516135, 0.47971136],
+                             [- 5.83381650, -0.00306884, 0.00176637, 6.83074767, 0.99027875, 0.99516480, 0.47975109],
+                             [- 5.83519520, -0.00306645, 0.00176531, 6.83212875, 0.99028735, 0.99516824, 0.47979072],
+                             [- 5.83656999, -0.00306407, 0.00176425, 6.83350592, 0.99029594, 0.99517167, 0.47983023],
+                             [- 5.83794088, -0.00306169, 0.00176320, 6.83487918, 0.99030451, 0.99517511, 0.47986964],
+                             [- 5.83930788, -0.00305932, 0.00176214, 6.83624856, 0.99031308, 0.99517854, 0.47990894],
+                             [- 5.84067099, -0.00305695, 0.00176109, 6.83761404, 0.99032163, 0.99518197, 0.47994814],
+                             [- 5.84203023, -0.00305458, 0.00176003, 6.83897565, 0.99033017, 0.99518539, 0.47998722],
+                             [- 5.84338560, -0.00305221, 0.00175898, 6.84033340, 0.99033869, 0.99518881, 0.48002620],
+                             [- 5.84473712, -0.00304984, 0.00175793, 6.84168728, 0.99034721, 0.99519223, 0.48006508],
+                             [- 5.84608479, -0.00304748, 0.00175687, 6.84303731, 0.99035571, 0.99519565, 0.48010385],
+                             [- 5.84742862, -0.00304512, 0.00175582, 6.84438350, 0.99036419, 0.99519906, 0.48014251],
+                             [- 5.84876862, -0.00304276, 0.00175477, 6.84572586, 0.99037267, 0.99520247, 0.48018107],
+                             [- 5.85010480, -0.00304041, 0.00175371, 6.84706439, 0.99038113, 0.99520588, 0.48021952],
+                             [- 5.85143717, -0.00303805, 0.00175266, 6.84839911, 0.99038958, 0.99520929, 0.48025787],
+                             [- 5.85276573, -0.00303570, 0.00175161, 6.84973003, 0.99039802, 0.99521269, 0.48029611],
+                             [- 5.85409050, -0.00303336, 0.00175056, 6.85105714, 0.99040644, 0.99521609, 0.48033425],
+                             [- 5.85541148, -0.00303101, 0.00174951, 6.85238047, 0.99041485, 0.99521948, 0.48037228],
+                             [- 5.85672868, -0.00302867, 0.00174846, 6.85370002, 0.99042325, 0.99522288, 0.48041021],
+                             [- 5.85804212, -0.00302633, 0.00174741, 6.85501579, 0.99043164, 0.99522627, 0.48044803],
+                             [- 5.85935180, -0.00302399, 0.00174636, 6.85632781, 0.99044002, 0.99522965, 0.48048575],
+                             [- 5.86065772, -0.00302166, 0.00174531, 6.85763607, 0.99044838, 0.99523304, 0.48052337],
+                             [- 5.86195991, -0.00301932, 0.00174426, 6.85894058, 0.99045673, 0.99523642, 0.48056088],
+                             [- 5.86325835, -0.00301699, 0.00174321, 6.86024136, 0.99046507, 0.99523980, 0.48059829],
+                             [- 5.86455308, -0.00301467, 0.00174216, 6.86153841, 0.99047339, 0.99524317, 0.48063560],
+                             [- 5.86584409, -0.00301234, 0.00174111, 6.86283174, 0.99048171, 0.99524655, 0.48067281],
+                             [- 5.86713139, -0.00301002, 0.00174006, 6.86412137, 0.99049001, 0.99524992, 0.48070991],
+                             [- 5.86841499, -0.00300770, 0.00173902, 6.86540729, 0.99049829, 0.99525328, 0.48074691],
+                             [- 5.86969490, -0.00300538, 0.00173797, 6.86668952, 0.99050657, 0.99525665, 0.48078381],
+                             [- 5.87097113, -0.00300307, 0.00173692, 6.86796806, 0.99051483, 0.99526001, 0.48082060],
+                             [- 5.87224368, -0.00300076, 0.00173588, 6.86924293, 0.99052309, 0.99526337, 0.48085730],
+                             [- 5.87351257, -0.00299845, 0.00173483, 6.87051413, 0.99053133, 0.99526672, 0.48089389],
+                             [- 5.87477781, -0.00299614, 0.00173378, 6.87178167, 0.99053955, 0.99527008, 0.48093038],
+                             [- 5.87603940, -0.00299383, 0.00173274, 6.87304557, 0.99054777, 0.99527343, 0.48096678],
+                             [- 5.87729735, -0.00299153, 0.00173169, 6.87430582, 0.99055597, 0.99527677, 0.48100307],
+                             [- 5.87855167, -0.00298923, 0.00173065, 6.87556244, 0.99056416, 0.99528012, 0.48103926],
+                             [- 5.87980237, -0.00298694, 0.00172961, 6.87681543, 0.99057234, 0.99528346, 0.48107535],
+                             [- 5.88104946, -0.00298464, 0.00172856, 6.87806482, 0.99058051, 0.99528680, 0.48111134],
+                             [- 5.88229294, -0.00298235, 0.00172752, 6.87931059, 0.99058867, 0.99529013, 0.48114723],
+                             [- 5.88353283, -0.00298006, 0.00172648, 6.88055277, 0.99059681, 0.99529347, 0.48118302],
+                             [- 5.88476913, -0.00297777, 0.00172543, 6.88179135, 0.99060494, 0.99529680, 0.48121871],
+                             [- 5.88600185, -0.00297549, 0.00172439, 6.88302636, 0.99061306, 0.99530012, 0.48125430],
+                             [- 5.88723100, -0.00297320, 0.00172335, 6.88425779, 0.99062117, 0.99530345, 0.48128980],
+                             [- 5.88845659, -0.00297093, 0.00172231, 6.88548566, 0.99062927, 0.99530677, 0.48132519],
+                             [- 5.88967862, -0.00296865, 0.00172127, 6.88670998, 0.99063735, 0.99531009, 0.48136049],
+                             [- 5.89089712, -0.00296637, 0.00172022, 6.88793074, 0.99064542, 0.99531340, 0.48139569],
+                             [- 5.89211207, -0.00296410, 0.00171918, 6.88914797, 0.99065348, 0.99531671, 0.48143079],
+                             [- 5.89332350, -0.00296183, 0.00171814, 6.89036167, 0.99066153, 0.99532002, 0.48146579],
+                             [- 5.89453141, -0.00295956, 0.00171710, 6.89157185, 0.99066957, 0.99532333, 0.48150069],
+                             [- 5.89573581, -0.00295730, 0.00171607, 6.89277851, 0.99067760, 0.99532664, 0.48153550],
+                             [- 5.89693670, -0.00295504, 0.00171503, 6.89398167, 0.99068561, 0.99532994, 0.48157021],
+                             [- 5.89813411, -0.00295278, 0.00171399, 6.89518133, 0.99069361, 0.99533324, 0.48160482],
+                             [- 5.89932802, -0.00295052, 0.00171295, 6.89637751, 0.99070160, 0.99533653, 0.48163934],
+                             [- 5.90051846, -0.00294826, 0.00171191, 6.89757020, 0.99070958, 0.99533983, 0.48167376],
+                             [- 5.90170544, -0.00294601, 0.00171088, 6.89875943, 0.99071755, 0.99534312, 0.48170809],
+                             [- 5.90288895, -0.00294376, 0.00170984, 6.89994519, 0.99072550, 0.99534640, 0.48174231],
+                             [- 5.90406901, -0.00294151, 0.00170880, 6.90112750, 0.99073345, 0.99534969, 0.48177645],
+                             [- 5.90524562, -0.00293927, 0.00170777, 6.90230636, 0.99074138, 0.99535297, 0.48181048],
+                             [- 5.90641881, -0.00293702, 0.00170673, 6.90348178, 0.99074930, 0.99535625, 0.48184443],
+                             [- 5.90758856, -0.00293478, 0.00170569, 6.90465378, 0.99075721, 0.99535952, 0.48187827],
+                             [- 5.90875490, -0.00293254, 0.00170466, 6.90582235, 0.99076511, 0.99536280, 0.48191202],
+                             [- 5.90991782, -0.00293031, 0.00170363, 6.90698751, 0.99077300, 0.99536607, 0.48194568],
+                             [- 5.91107735, -0.00292807, 0.00170259, 6.90814927, 0.99078087, 0.99536933, 0.48197924],
+                             [- 5.91223348, -0.00292584, 0.00170156, 6.90930763, 0.99078874, 0.99537260, 0.48201271],
+                             [- 5.91338622, -0.00292362, 0.00170052, 6.91046261, 0.99079659, 0.99537586, 0.48204608],
+                             [- 5.91453559, -0.00292139, 0.00169949, 6.91161420, 0.99080443, 0.99537912, 0.48207936],
+                             [- 5.91568159, -0.00291917, 0.00169846, 6.91276243, 0.99081226, 0.99538238, 0.48211255],
+                             [- 5.91682423, -0.00291694, 0.00169743, 6.91390729, 0.99082008, 0.99538563, 0.48214564],
+                             [- 5.91796352, -0.00291472, 0.00169639, 6.91504879, 0.99082789, 0.99538888, 0.48217864],
+                             [- 5.91909946, -0.00291251, 0.00169536, 6.91618695, 0.99083569, 0.99539213, 0.48221155],
+                             [- 5.92023207, -0.00291029, 0.00169433, 6.91732177, 0.99084347, 0.99539537, 0.48224436],
+                             [- 5.92136135, -0.00290808, 0.00169330, 6.91845327, 0.99085124, 0.99539862, 0.48227709],
+                             [- 5.92248731, -0.00290587, 0.00169227, 6.91958144, 0.99085901, 0.99540186, 0.48230971],
+                             [- 5.92360996, -0.00290367, 0.00169124, 6.92070629, 0.99086676, 0.99540509, 0.48234225],
+                             [- 5.92472930, -0.00290146, 0.00169021, 6.92182784, 0.99087450, 0.99540833, 0.48237470],
+                             [- 5.92584536, -0.00289926, 0.00168918, 6.92294610, 0.99088223, 0.99541156, 0.48240705],
+                             [- 5.92695812, -0.00289706, 0.00168816, 6.92406106, 0.99088995, 0.99541479, 0.48243931],
+                             [- 5.92806761, -0.00289486, 0.00168713, 6.92517274, 0.99089766, 0.99541801, 0.48247148],
+                             [- 5.92917382, -0.00289267, 0.00168610, 6.92628115, 0.99090535, 0.99542123, 0.48250356],
+                             [- 5.93027677, -0.00289047, 0.00168507, 6.92738630, 0.99091304, 0.99542445, 0.48253555],
+                             [- 5.93137647, -0.00288828, 0.00168405, 6.92848819, 0.99092071, 0.99542767, 0.48256745],
+                             [- 5.93247293, -0.00288610, 0.00168302, 6.92958683, 0.99092837, 0.99543089, 0.48259926],
+                             [- 5.93356614, -0.00288391, 0.00168199, 6.93068223, 0.99093603, 0.99543410, 0.48263098],
+                             [- 5.93465613, -0.00288173, 0.00168097, 6.93177440, 0.99094367, 0.99543731, 0.48266260],
+                             [- 5.93574289, -0.00287955, 0.00167994, 6.93286334, 0.99095130, 0.99544051, 0.48269414],
+                             [- 5.93682644, -0.00287737, 0.00167892, 6.93394907, 0.99095892, 0.99544371, 0.48272559],
+                             [- 5.93790678, -0.00287519, 0.00167789, 6.93503159, 0.99096653, 0.99544692, 0.48275695],
+                             [- 5.93898392, -0.00287302, 0.00167687, 6.93611091, 0.99097412, 0.99545011, 0.48278822],
+                             [- 5.94005788, -0.00287085, 0.00167585, 6.93718703, 0.99098171, 0.99545331, 0.48281940],
+                             [- 5.94112865, -0.00286868, 0.00167482, 6.93825997, 0.99098929, 0.99545650, 0.48285049],
+                             [- 5.94219625, -0.00286651, 0.00167380, 6.93932974, 0.99099685, 0.99545969, 0.48288150],
+                             [- 5.94326068, -0.00286435, 0.00167278, 6.94039634, 0.99100441, 0.99546288, 0.48291241],
+                             [- 5.94432196, -0.00286218, 0.00167176, 6.94145977, 0.99101195, 0.99546606, 0.48294324],
+                             [- 5.94538008, -0.00286002, 0.00167074, 6.94252006, 0.99101949, 0.99546924, 0.48297398],
+                             [- 5.94643506, -0.00285787, 0.00166971, 6.94357720, 0.99102701, 0.99547242, 0.48300463],
+                             [- 5.94748691, -0.00285571, 0.00166869, 6.94463120, 0.99103452, 0.99547559, 0.48303520],
+                             [- 5.94853563, -0.00285356, 0.00166767, 6.94568207, 0.99104202, 0.99547877, 0.48306568],
+                             [- 5.94958124, -0.00285141, 0.00166666, 6.94672983, 0.99104951, 0.99548194, 0.48309607],
+                             [- 5.95062373, -0.00284926, 0.00166564, 6.94777447, 0.99105699, 0.99548510, 0.48312637],
+                             [- 5.95166312, -0.00284711, 0.00166462, 6.94881600, 0.99106446, 0.99548827, 0.48315659],
+                             [- 5.95269941, -0.00284497, 0.00166360, 6.94985444, 0.99107192, 0.99549143, 0.48318672],
+                             [- 5.95373262, -0.00284283, 0.00166258, 6.95088979, 0.99107937, 0.99549459, 0.48321676],
+                             [- 5.95476275, -0.00284069, 0.00166156, 6.95192206, 0.99108681, 0.99549775, 0.48324672],
+                             [- 5.95578980, -0.00283855, 0.00166055, 6.95295125, 0.99109423, 0.99550090, 0.48327660],
+                             [- 5.95681380, -0.00283642, 0.00165953, 6.95397738, 0.99110165, 0.99550405, 0.48330638],
+                             [- 5.95783474, -0.00283429, 0.00165852, 6.95500045, 0.99110906, 0.99550720, 0.48333609],
+                             [- 5.95885262, -0.00283216, 0.00165750, 6.95602047, 0.99111645, 0.99551034, 0.48336571],
+                             [- 5.95986747, -0.00283003, 0.00165648, 6.95703744, 0.99112384, 0.99551348, 0.48339524],
+                             [- 5.96087929, -0.00282791, 0.00165547, 6.95805138, 0.99113121, 0.99551662, 0.48342469],
+                             [- 5.96188808, -0.00282578, 0.00165446, 6.95906230, 0.99113858, 0.99551976, 0.48345405],
+                             [- 5.96289385, -0.00282366, 0.00165344, 6.96007019, 0.99114593, 0.99552290, 0.48348333],
+                             [- 5.96389662, -0.00282154, 0.00165243, 6.96107507, 0.99115327, 0.99552603, 0.48351252],
+                             [- 5.96489638, -0.00281943, 0.00165142, 6.96207695, 0.99116061, 0.99552916, 0.48354163],
+                             [- 5.96589315, -0.00281732, 0.00165040, 6.96307584, 0.99116793, 0.99553228, 0.48357066],
+                             [- 5.96688693, -0.00281520, 0.00164939, 6.96407173, 0.99117524, 0.99553540, 0.48359961],
+                             [- 5.96787774, -0.00281310, 0.00164838, 6.96506464, 0.99118255, 0.99553852, 0.48362846],
+                             [- 5.96886557, -0.00281099, 0.00164737, 6.96605458, 0.99118984, 0.99554164, 0.48365724],
+                             [- 5.96985044, -0.00280888, 0.00164636, 6.96704156, 0.99119712, 0.99554476, 0.48368594],
+                             [- 5.97083235, -0.00280678, 0.00164535, 6.96802557, 0.99120439, 0.99554787, 0.48371455],
+                             [- 5.97181132, -0.00280468, 0.00164434, 6.96900664, 0.99121165, 0.99555098, 0.48374308],
+                             [- 5.97278734, -0.00280258, 0.00164333, 6.96998476, 0.99121891, 0.99555409, 0.48377153],
+                             [- 5.97376044, -0.00280049, 0.00164232, 6.97095995, 0.99122615, 0.99555719, 0.48379989],
+                             [- 5.97473060, -0.00279840, 0.00164131, 6.97193221, 0.99123338, 0.99556029, 0.48382818],
+                             [- 5.97569785, -0.00279631, 0.00164031, 6.97290155, 0.99124060, 0.99556339, 0.48385638],
+                             [- 5.97666219, -0.00279422, 0.00163930, 6.97386797, 0.99124781, 0.99556648, 0.48388450],
+                             [- 5.97762362, -0.00279213, 0.00163829, 6.97483149, 0.99125501, 0.99556958, 0.48391254],
+                             [- 5.97858216, -0.00279005, 0.00163729, 6.97579212, 0.99126220, 0.99557267, 0.48394050],
+                             [- 5.97953782, -0.00278796, 0.00163628, 6.97674985, 0.99126938, 0.99557576, 0.48396837],
+                             [- 5.98049059, -0.00278589, 0.00163527, 6.97770470, 0.99127655, 0.99557884, 0.48399617],
+                             [- 5.98144049, -0.00278381, 0.00163427, 6.97865668, 0.99128371, 0.99558192, 0.48402389],
+                             [- 5.98238752, -0.00278173, 0.00163326, 6.97960579, 0.99129087, 0.99558500, 0.48405152],
+                             [- 5.98333170, -0.00277966, 0.00163226, 6.98055204, 0.99129801, 0.99558808, 0.48407908],
+                             [- 5.98427302, -0.00277759, 0.00163126, 6.98149543, 0.99130514, 0.99559115, 0.48410655],
+                             [- 5.98521150, -0.00277552, 0.00163025, 6.98243598, 0.99131226, 0.99559422, 0.48413395],
+                             [- 5.98614715, -0.00277346, 0.00162925, 6.98337369, 0.99131937, 0.99559729, 0.48416127],
+                             [- 5.98707997, -0.00277139, 0.00162825, 6.98430858, 0.99132647, 0.99560036, 0.48418851],
+                             [- 5.98800996, -0.00276933, 0.00162725, 6.98524063, 0.99133356, 0.99560342, 0.48421567],
+                             [- 5.98893715, -0.00276727, 0.00162625, 6.98616988, 0.99134064, 0.99560648, 0.48424275],
+                             [- 5.98986153, -0.00276521, 0.00162525, 6.98709631, 0.99134771, 0.99560954, 0.48426975],
+                             [- 5.99078310, -0.00276316, 0.00162425, 6.98801995, 0.99135477, 0.99561259, 0.48429667],
+                             [- 5.99170189, -0.00276111, 0.00162325, 6.98894079, 0.99136183, 0.99561565, 0.48432352],
+                             [- 5.99261789, -0.00275906, 0.00162225, 6.98985884, 0.99136887, 0.99561870, 0.48435028],
+                             [- 5.99353112, -0.00275701, 0.00162125, 6.99077411, 0.99137590, 0.99562174, 0.48437697],
+                             [- 5.99444158, -0.00275496, 0.00162025, 6.99168662, 0.99138292, 0.99562479, 0.48440358],
+                             [- 5.99534927, -0.00275292, 0.00161925, 6.99259635, 0.99138994, 0.99562783, 0.48443012],
+                             [- 5.99625421, -0.00275088, 0.00161826, 6.99350334, 0.99139694, 0.99563087, 0.48445657],
+                             [- 5.99715640, -0.00274884, 0.00161726, 6.99440757, 0.99140393, 0.99563390, 0.48448295],
+                             [- 5.99805585, -0.00274680, 0.00161626, 6.99530906, 0.99141092, 0.99563694, 0.48450926],
+                             [- 5.99895257, -0.00274476, 0.00161527, 6.99620781, 0.99141789, 0.99563997, 0.48453548],
+                             [- 5.99984656, -0.00274273, 0.00161427, 6.99710383, 0.99142485, 0.99564299, 0.48456163],
+                             [- 6.00073784, -0.00274070, 0.00161328, 6.99799714, 0.99143181, 0.99564602, 0.48458771],
+                             [- 6.00162640, -0.00273867, 0.00161228, 6.99888773, 0.99143875, 0.99564904, 0.48461370],
+                             [- 6.00251225, -0.00273665, 0.00161129, 6.99977561, 0.99144569, 0.99565206, 0.48463962],
+                             [- 6.00339541, -0.00273462, 0.00161030, 7.00066079, 0.99145261, 0.99565508, 0.48466547],
+                             [- 6.00427588, -0.00273260, 0.00160931, 7.00154328, 0.99145953, 0.99565809, 0.48469124],
+                             [- 6.00515367, -0.00273058, 0.00160831, 7.00242309, 0.99146644, 0.99566111, 0.48471693],
+                             [- 6.00602878, -0.00272856, 0.00160732, 7.00330021, 0.99147334, 0.99566411, 0.48474255],
+                             [- 6.00690122, -0.00272655, 0.00160633, 7.00417467, 0.99148022, 0.99566712, 0.48476810],
+                             [- 6.00777100, -0.00272454, 0.00160534, 7.00504646, 0.99148710, 0.99567012, 0.48479357],
+                             [- 6.00863812, -0.00272252, 0.00160435, 7.00591560, 0.99149397, 0.99567313, 0.48481896],
+                             [- 6.00950260, -0.00272052, 0.00160336, 7.00678208, 0.99150083, 0.99567612, 0.48484429],
+                             [- 6.01036444, -0.00271851, 0.00160237, 7.00764593, 0.99150768, 0.99567912, 0.48486953],
+                             [- 6.01122364, -0.00271651, 0.00160138, 7.00850713, 0.99151452, 0.99568211, 0.48489471],
+                             [- 6.01208022, -0.00271450, 0.00160039, 7.00936571, 0.99152135, 0.99568510, 0.48491980],
+                             [- 6.01293417, -0.00271250, 0.00159941, 7.01022167, 0.99152817, 0.99568809, 0.48494483],
+                             [- 6.01378552, -0.00271051, 0.00159842, 7.01107501, 0.99153498, 0.99569107, 0.48496978],
+                             [- 6.01463426, -0.00270851, 0.00159743, 7.01192575, 0.99154179, 0.99569406, 0.48499466],
+                             [- 6.01548040, -0.00270652, 0.00159645, 7.01277388, 0.99154858, 0.99569704, 0.48501947],
+                             [- 6.01632394, -0.00270453, 0.00159546, 7.01361942, 0.99155537, 0.99570001, 0.48504420],
+                             [- 6.01716491, -0.00270254, 0.00159448, 7.01446237, 0.99156214, 0.99570299, 0.48506886],
+                             [- 6.01800329, -0.00270055, 0.00159349, 7.01530274, 0.99156891, 0.99570596, 0.48509345],
+                             [- 6.01883911, -0.00269856, 0.00159251, 7.01614055, 0.99157566, 0.99570893, 0.48511797],
+                             [- 6.01967236, -0.00269658, 0.00159153, 7.01697578, 0.99158241, 0.99571189, 0.48514241],
+                             [- 6.02050306, -0.00269460, 0.00159054, 7.01780845, 0.99158915, 0.99571486, 0.48516678],
+                             [- 6.02133120, -0.00269262, 0.00158956, 7.01863858, 0.99159588, 0.99571782, 0.48519108],
+                             [- 6.02215680, -0.00269065, 0.00158858, 7.01946615, 0.99160260, 0.99572077, 0.48521531],
+                             [- 6.02297987, -0.00268867, 0.00158760, 7.02029119, 0.99160931, 0.99572373, 0.48523947],
+                             [- 6.02380040, -0.00268670, 0.00158662, 7.02111370, 0.99161601, 0.99572668, 0.48526355],
+                             [- 6.02461841, -0.00268473, 0.00158564, 7.02193368, 0.99162270, 0.99572963, 0.48528757],
+                             [- 6.02543391, -0.00268276, 0.00158466, 7.02275115, 0.99162938, 0.99573258, 0.48531151],
+                             [- 6.02624690, -0.00268080, 0.00158368, 7.02356610, 0.99163606, 0.99573552, 0.48533539],
+                             [- 6.02705738, -0.00267883, 0.00158270, 7.02437855, 0.99164272, 0.99573847, 0.48535919],
+                             [- 6.02786537, -0.00267687, 0.00158172, 7.02518850, 0.99164938, 0.99574141, 0.48538292],
+                             [- 6.02867087, -0.00267491, 0.00158074, 7.02599596, 0.99165602, 0.99574434, 0.48540659],
+                             [- 6.02947389, -0.00267296, 0.00157977, 7.02680093, 0.99166266, 0.99574728, 0.48543018],
+                             [- 6.03027443, -0.00267100, 0.00157879, 7.02760343, 0.99166929, 0.99575021, 0.48545370],
+                             [- 6.03107251, -0.00266905, 0.00157781, 7.02840346, 0.99167591, 0.99575314, 0.48547716],
+                             [- 6.03186812, -0.00266710, 0.00157684, 7.02920102, 0.99168252, 0.99575606, 0.48550054],
+                             [- 6.03266127, -0.00266515, 0.00157586, 7.02999612, 0.99168912, 0.99575899, 0.48552386],
+                             [- 6.03345198, -0.00266320, 0.00157489, 7.03078878, 0.99169571, 0.99576191, 0.48554710],
+                             [- 6.03424025, -0.00266126, 0.00157391, 7.03157899, 0.99170230, 0.99576483, 0.48557028],
+                             [- 6.03502608, -0.00265932, 0.00157294, 7.03236676, 0.99170887, 0.99576774, 0.48559339],
+                             [- 6.03580948, -0.00265738, 0.00157197, 7.03315210, 0.99171544, 0.99577065, 0.48561643],
+                             [- 6.03659046, -0.00265544, 0.00157100, 7.03393502, 0.99172199, 0.99577356, 0.48563940],
+                             [- 6.03736903, -0.00265350, 0.00157002, 7.03471552, 0.99172854, 0.99577647, 0.48566231],
+                             [- 6.03814518, -0.00265157, 0.00156905, 7.03549361, 0.99173508, 0.99577938, 0.48568514],
+                             [- 6.03891894, -0.00264964, 0.00156808, 7.03626930, 0.99174161, 0.99578228, 0.48570791],
+                             [- 6.03969029, -0.00264771, 0.00156711, 7.03704258, 0.99174813, 0.99578518, 0.48573061],
+                             [- 6.04045926, -0.00264578, 0.00156614, 7.03781348, 0.99175464, 0.99578807, 0.48575324],
+                             [- 6.04122585, -0.00264386, 0.00156517, 7.03858199, 0.99176115, 0.99579097, 0.48577581],
+                             [- 6.04199006, -0.00264193, 0.00156421, 7.03934813, 0.99176764, 0.99579386, 0.48579831],
+                             [- 6.04275190, -0.00264001, 0.00156324, 7.04011189, 0.99177413, 0.99579675, 0.48582075],
+                             [- 6.04351138, -0.00263809, 0.00156227, 7.04087328, 0.99178061, 0.99579964, 0.48584311],
+                             [- 6.04426850, -0.00263618, 0.00156130, 7.04163232, 0.99178707, 0.99580252, 0.48586541],
+                             [- 6.04502327, -0.00263426, 0.00156034, 7.04238901, 0.99179353, 0.99580540, 0.48588765],
+                             [- 6.04577570, -0.00263235, 0.00155937, 7.04314335, 0.99179998, 0.99580828, 0.48590981],
+                             [- 6.04652579, -0.00263044, 0.00155841, 7.04389535, 0.99180643, 0.99581115, 0.48593191],
+                             [- 6.04727354, -0.00262853, 0.00155744, 7.04464502, 0.99181286, 0.99581403, 0.48595395],
+                             [- 6.04801898, -0.00262662, 0.00155648, 7.04539236, 0.99181929, 0.99581690, 0.48597592],
+                             [- 6.04876210, -0.00262472, 0.00155552, 7.04613738, 0.99182570, 0.99581977, 0.48599782],
+                             [- 6.04950290, -0.00262282, 0.00155455, 7.04688009, 0.99183211, 0.99582263, 0.48601966],
+                             [- 6.05024140, -0.00262092, 0.00155359, 7.04762049, 0.99183851, 0.99582549, 0.48604144],
+                             [- 6.05097760, -0.00261902, 0.00155263, 7.04835858, 0.99184490, 0.99582835, 0.48606315],
+                             [- 6.05171151, -0.00261712, 0.00155167, 7.04909439, 0.99185128, 0.99583121, 0.48608479],
+                             [- 6.05244313, -0.00261523, 0.00155071, 7.04982791, 0.99185765, 0.99583407, 0.48610637],
+                             [- 6.05317248, -0.00261334, 0.00154975, 7.05055914, 0.99186402, 0.99583692, 0.48612789],
+                             [- 6.05389955, -0.00261145, 0.00154879, 7.05128810, 0.99187037, 0.99583977, 0.48614934],
+                             [- 6.05462435, -0.00260956, 0.00154783, 7.05201479, 0.99187672, 0.99584261, 0.48617073],
+                             [- 6.05534689, -0.00260767, 0.00154687, 7.05273922, 0.99188306, 0.99584546, 0.48619205],
+                             [- 6.05606718, -0.00260579, 0.00154591, 7.05346139, 0.99188939, 0.99584830, 0.48621331],
+                             [- 6.05678521, -0.00260391, 0.00154495, 7.05418131, 0.99189571, 0.99585114, 0.48623450],
+                             [- 6.05750101, -0.00260203, 0.00154400, 7.05489898, 0.99190203, 0.99585398, 0.48625564],
+                             [- 6.05821457, -0.00260015, 0.00154304, 7.05561442, 0.99190833, 0.99585681, 0.48627671],
+                             [- 6.05892590, -0.00259827, 0.00154209, 7.05632763, 0.99191463, 0.99585964, 0.48629772],
+                             [- 6.05963501, -0.00259640, 0.00154113, 7.05703861, 0.99192092, 0.99586247, 0.48631866],
+                             [- 6.06034190, -0.00259453, 0.00154018, 7.05774737, 0.99192720, 0.99586529, 0.48633954],
+                             [- 6.06104657, -0.00259266, 0.00153922, 7.05845392, 0.99193347, 0.99586812, 0.48636036],
+                             [- 6.06174905, -0.00259079, 0.00153827, 7.05915826, 0.99193973, 0.99587094, 0.48638112],
+                             [- 6.06244932, -0.00258893, 0.00153732, 7.05986040, 0.99194598, 0.99587376, 0.48640181],
+                             [- 6.06314740, -0.00258706, 0.00153637, 7.06056034, 0.99195223, 0.99587657, 0.48642244],
+                             [- 6.06384330, -0.00258520, 0.00153541, 7.06125810, 0.99195847, 0.99587938, 0.48644301],
+                             [- 6.06453701, -0.00258334, 0.00153446, 7.06195367, 0.99196470, 0.99588220, 0.48646352],
+                             [- 6.06522855, -0.00258148, 0.00153351, 7.06264707, 0.99197092, 0.99588500, 0.48648397],
+                             [- 6.06591793, -0.00257963, 0.00153256, 7.06333830, 0.99197713, 0.99588781, 0.48650436],
+                             [- 6.06660514, -0.00257778, 0.00153161, 7.06402736, 0.99198334, 0.99589061, 0.48652468],
+                             [- 6.06729019, -0.00257592, 0.00153067, 7.06471427, 0.99198953, 0.99589341, 0.48654494],
+                             [- 6.06797309, -0.00257408, 0.00152972, 7.06539902, 0.99199572, 0.99589621, 0.48656515],
+                             [- 6.06865385, -0.00257223, 0.00152877, 7.06608163, 0.99200190, 0.99589900, 0.48658529],
+                             [- 6.06933248, -0.00257038, 0.00152782, 7.06676209, 0.99200807, 0.99590179, 0.48660537],
+                             [- 6.07000896, -0.00256854, 0.00152688, 7.06744043, 0.99201424, 0.99590458, 0.48662539],
+                             [- 6.07068333, -0.00256670, 0.00152593, 7.06811663, 0.99202039, 0.99590737, 0.48664535],
+                             [- 6.07135557, -0.00256486, 0.00152499, 7.06879071, 0.99202654, 0.99591015, 0.48666525],
+                             [- 6.07202570, -0.00256302, 0.00152404, 7.06946268, 0.99203268, 0.99591294, 0.48668509],
+                             [- 6.07269372, -0.00256119, 0.00152310, 7.07013254, 0.99203881, 0.99591572, 0.48670487],
+                             [- 6.07335964, -0.00255935, 0.00152215, 7.07080029, 0.99204493, 0.99591849, 0.48672460],
+                             [- 6.07402346, -0.00255752, 0.00152121, 7.07146594, 0.99205104, 0.99592127, 0.48674426],
+                             [- 6.07468520, -0.00255569, 0.00152027, 7.07212950, 0.99205715, 0.99592404, 0.48676386],
+                             [- 6.07534484, -0.00255387, 0.00151933, 7.07279098, 0.99206325, 0.99592681, 0.48678341],
+                             [- 6.07600241, -0.00255204, 0.00151839, 7.07345037, 0.99206934, 0.99592957, 0.48680289],
+                             [- 6.07665791, -0.00255022, 0.00151745, 7.07410769, 0.99207542, 0.99593234, 0.48682232],
+                             [- 6.07731134, -0.00254840, 0.00151651, 7.07476294, 0.99208149, 0.99593510, 0.48684169],
+                             [- 6.07796271, -0.00254658, 0.00151557, 7.07541613, 0.99208756, 0.99593786, 0.48686100],
+                             [- 6.07861202, -0.00254476, 0.00151463, 7.07606726, 0.99209362, 0.99594061, 0.48688025],
+                             [- 6.07925928, -0.00254294, 0.00151369, 7.07671634, 0.99209967, 0.99594336, 0.48689944],
+                             [- 6.07990450, -0.00254113, 0.00151275, 7.07736337, 0.99210571, 0.99594612, 0.48691858],
+                             [- 6.08054769, -0.00253932, 0.00151182, 7.07800837, 0.99211174, 0.99594886, 0.48693766],
+                             [- 6.08118884, -0.00253751, 0.00151088, 7.07865133, 0.99211777, 0.99595161, 0.48695668],
+                             [- 6.08182796, -0.00253570, 0.00150994, 7.07929226, 0.99212379, 0.99595435, 0.48697564],
+                             [- 6.08246507, -0.00253390, 0.00150901, 7.07993117, 0.99212980, 0.99595709, 0.48699454],
+                             [- 6.08310016, -0.00253210, 0.00150807, 7.08056806, 0.99213580, 0.99595983, 0.48701339],
+                             [- 6.08373324, -0.00253029, 0.00150714, 7.08120294, 0.99214179, 0.99596257, 0.48703218],
+                             [- 6.08436431, -0.00252849, 0.00150621, 7.08183582, 0.99214778, 0.99596530, 0.48705092],
+                             [- 6.08499339, -0.00252670, 0.00150527, 7.08246669, 0.99215376, 0.99596803, 0.48706960],
+                             [- 6.08562048, -0.00252490, 0.00150434, 7.08309558, 0.99215973, 0.99597076, 0.48708821],
+                             [- 6.08624558, -0.00252311, 0.00150341, 7.08372247, 0.99216569, 0.99597348, 0.48710678],
+                             [- 6.08686870, -0.00252132, 0.00150248, 7.08434738, 0.99217164, 0.99597620, 0.48712529],
+                             [- 6.08748985, -0.00251953, 0.00150155, 7.08497032, 0.99217759, 0.99597892, 0.48714374],
+                             [- 6.08810902, -0.00251774, 0.00150062, 7.08559128, 0.99218353, 0.99598164, 0.48716214],
+                             [- 6.08872624, -0.00251595, 0.00149969, 7.08621028, 0.99218946, 0.99598436, 0.48718048],
+                             [- 6.08934149, -0.00251417, 0.00149876, 7.08682732, 0.99219538, 0.99598707, 0.48719876],
+                             [- 6.08995479, -0.00251239, 0.00149784, 7.08744241, 0.99220130, 0.99598978, 0.48721699],
+                             [- 6.09056615, -0.00251061, 0.00149691, 7.08805554, 0.99220721, 0.99599248, 0.48723517],
+                             [- 6.09117556, -0.00250883, 0.00149598, 7.08866673, 0.99221310, 0.99599519, 0.48725329],
+                             [- 6.09178304, -0.00250705, 0.00149506, 7.08927599, 0.99221900, 0.99599789, 0.48727135],
+                             [- 6.09238859, -0.00250528, 0.00149413, 7.08988331, 0.99222488, 0.99600059, 0.48728936],
+                             [- 6.09299221, -0.00250351, 0.00149320, 7.09048871, 0.99223076, 0.99600329, 0.48730732],
+                             [- 6.09359392, -0.00250174, 0.00149228, 7.09109218, 0.99223663, 0.99600598, 0.48732522],
+                             [- 6.09419371, -0.00249997, 0.00149136, 7.09169374, 0.99224249, 0.99600867, 0.48734306],
+                             [- 6.09479159, -0.00249820, 0.00149043, 7.09229339, 0.99224834, 0.99601136, 0.48736085],
+                             [- 6.09538757, -0.00249644, 0.00148951, 7.09289113, 0.99225419, 0.99601405, 0.48737859],
+                             [- 6.09598165, -0.00249468, 0.00148859, 7.09348698, 0.99226003, 0.99601673, 0.48739628],
+                             [- 6.09657385, -0.00249292, 0.00148767, 7.09408093, 0.99226586, 0.99601942, 0.48741390],
+                             [- 6.09716415, -0.00249116, 0.00148675, 7.09467299, 0.99227168, 0.99602210, 0.48743148],
+                             [- 6.09775257, -0.00248940, 0.00148583, 7.09526317, 0.99227749, 0.99602477, 0.48744900],
+                             [- 6.09833912, -0.00248765, 0.00148491, 7.09585148, 0.99228330, 0.99602745, 0.48746647],
+                             [- 6.09892380, -0.00248589, 0.00148399, 7.09643791, 0.99228910, 0.99603012, 0.48748389],
+                             [- 6.09950662, -0.00248414, 0.00148307, 7.09702248, 0.99229489, 0.99603279, 0.48750125],
+                             [- 6.10008757, -0.00248239, 0.00148215, 7.09760518, 0.99230068, 0.99603545, 0.48751856],
+                             [- 6.10066667, -0.00248065, 0.00148124, 7.09818603, 0.99230646, 0.99603812, 0.48753582],
+                             [- 6.10124393, -0.00247890, 0.00148032, 7.09876503, 0.99231223, 0.99604078, 0.48755302],
+                             [- 6.10181934, -0.00247716, 0.00147941, 7.09934218, 0.99231799, 0.99604344, 0.48757018],
+                             [- 6.10239291, -0.00247542, 0.00147849, 7.09991749, 0.99232374, 0.99604609, 0.48758728],
+                             [- 6.10296465, -0.00247368, 0.00147758, 7.10049097, 0.99232949, 0.99604875, 0.48760432],
+                             [- 6.10353456, -0.00247194, 0.00147666, 7.10106262, 0.99233523, 0.99605140, 0.48762132],
+                             [- 6.10410265, -0.00247020, 0.00147575, 7.10163245, 0.99234096, 0.99605405, 0.48763826],
+                             [- 6.10466892, -0.00246847, 0.00147484, 7.10220045, 0.99234669, 0.99605669, 0.48765516],
+                             [- 6.10523338, -0.00246674, 0.00147393, 7.10276665, 0.99235240, 0.99605934, 0.48767200],
+                             [- 6.10579604, -0.00246501, 0.00147301, 7.10333103, 0.99235811, 0.99606198, 0.48768879],
+                             [- 6.10635689, -0.00246328, 0.00147210, 7.10389362, 0.99236382, 0.99606462, 0.48770552],
+                             [- 6.10691595, -0.00246155, 0.00147119, 7.10445440, 0.99236951, 0.99606725, 0.48772221],
+                             [- 6.10747322, -0.00245983, 0.00147028, 7.10501339, 0.99237520, 0.99606989, 0.48773885],
+                             [- 6.10802871, -0.00245811, 0.00146937, 7.10557060, 0.99238088, 0.99607252, 0.48775543],
+                             [- 6.10858241, -0.00245639, 0.00146847, 7.10612603, 0.99238655, 0.99607515, 0.48777197],
+                             [- 6.10913434, -0.00245467, 0.00146756, 7.10667967, 0.99239222, 0.99607777, 0.48778845],
+                             [- 6.10968450, -0.00245295, 0.00146665, 7.10723155, 0.99239787, 0.99608040, 0.48780488],
+                             [- 6.11023289, -0.00245123, 0.00146575, 7.10778166, 0.99240353, 0.99608302, 0.48782127],
+                             [- 6.11077953, -0.00244952, 0.00146484, 7.10833001, 0.99240917, 0.99608564, 0.48783760],
+                             [- 6.11132441, -0.00244781, 0.00146393, 7.10887660, 0.99241480, 0.99608825, 0.48785388],
+                             [- 6.11186754, -0.00244610, 0.00146303, 7.10942144, 0.99242043, 0.99609087, 0.48787012],
+                             [- 6.11240893, -0.00244439, 0.00146213, 7.10996454, 0.99242605, 0.99609348, 0.48788630],
+                             [- 6.11294858, -0.00244269, 0.00146122, 7.11050589, 0.99243167, 0.99609609, 0.48790243],
+                             [- 6.11348649, -0.00244098, 0.00146032, 7.11104551, 0.99243728, 0.99609869, 0.48791852],
+                             [- 6.11402268, -0.00243928, 0.00145942, 7.11158340, 0.99244288, 0.99610130, 0.48793455],
+                             [- 6.11455714, -0.00243758, 0.00145852, 7.11211956, 0.99244847, 0.99610390, 0.48795053],
+                             [- 6.11508989, -0.00243588, 0.00145762, 7.11265400, 0.99245405, 0.99610650, 0.48796647],
+                             [- 6.11562092, -0.00243419, 0.00145672, 7.11318673, 0.99245963, 0.99610909, 0.48798236],
+                             [- 6.11615024, -0.00243249, 0.00145582, 7.11371775, 0.99246520, 0.99611169, 0.48799820],
+                             [- 6.11667786, -0.00243080, 0.00145492, 7.11424706, 0.99247077, 0.99611428, 0.48801399],
+                             [- 6.11720378, -0.00242911, 0.00145402, 7.11477467, 0.99247632, 0.99611687, 0.48802973],
+                             [- 6.11772800, -0.00242742, 0.00145312, 7.11530058, 0.99248187, 0.99611945, 0.48804543],
+                             [- 6.11825054, -0.00242574, 0.00145223, 7.11582481, 0.99248741, 0.99612204, 0.48806107],
+                             [- 6.11877140, -0.00242405, 0.00145133, 7.11634735, 0.99249295, 0.99612462, 0.48807667],
+                             [- 6.11929057, -0.00242237, 0.00145043, 7.11686820, 0.99249847, 0.99612720, 0.48809222],
+                             [- 6.11980807, -0.00242069, 0.00144954, 7.11738739, 0.99250400, 0.99612978, 0.48810772],
+                             [- 6.12032390, -0.00241901, 0.00144864, 7.11790490, 0.99250951, 0.99613235, 0.48812317],
+                             [- 6.12083807, -0.00241733, 0.00144775, 7.11842074, 0.99251501, 0.99613492, 0.48813858],
+                             [- 6.12135058, -0.00241565, 0.00144686, 7.11893493, 0.99252051, 0.99613749, 0.48815394],
+                             [- 6.12186144, -0.00241398, 0.00144597, 7.11944746, 0.99252601, 0.99614006, 0.48816925],
+                             [- 6.12237064, -0.00241231, 0.00144507, 7.11995834, 0.99253149, 0.99614262, 0.48818451],
+                             [- 6.12287820, -0.00241064, 0.00144418, 7.12046757, 0.99253697, 0.99614518, 0.48819973],
+                             [- 6.12338412, -0.00240897, 0.00144329, 7.12097516, 0.99254244, 0.99614774, 0.48821490],
+                             [- 6.12388841, -0.00240730, 0.00144240, 7.12148111, 0.99254790, 0.99615030, 0.48823002],
+                             [- 6.12439107, -0.00240563, 0.00144151, 7.12198543, 0.99255336, 0.99615285, 0.48824510],
+                             [- 6.12489210, -0.00240397, 0.00144062, 7.12248813, 0.99255881, 0.99615540, 0.48826013],
+                             [- 6.12539151, -0.00240231, 0.00143974, 7.12298920, 0.99256425, 0.99615795, 0.48827512],
+                             [- 6.12588931, -0.00240065, 0.00143885, 7.12348866, 0.99256969, 0.99616050, 0.48829005],
+                             [- 6.12638549, -0.00239899, 0.00143796, 7.12398650, 0.99257512, 0.99616304, 0.48830495],
+                             [- 6.12688007, -0.00239734, 0.00143708, 7.12448273, 0.99258054, 0.99616559, 0.48831979],
+                             [- 6.12737305, -0.00239568, 0.00143619, 7.12497736, 0.99258596, 0.99616813, 0.48833460],
+                             [- 6.12786443, -0.00239403, 0.00143531, 7.12547040, 0.99259136, 0.99617066, 0.48834935],
+                             [- 6.12835422, -0.00239238, 0.00143442, 7.12596184, 0.99259676, 0.99617320, 0.48836406],
+                             [- 6.12884242, -0.00239073, 0.00143354, 7.12645169, 0.99260216, 0.99617573, 0.48837872],
+                             [- 6.12932904, -0.00238908, 0.00143266, 7.12693996, 0.99260755, 0.99617826, 0.48839334],
+                             [- 6.12981408, -0.00238744, 0.00143177, 7.12742664, 0.99261293, 0.99618079, 0.48840792],
+                             [- 6.13029755, -0.00238580, 0.00143089, 7.12791176, 0.99261830, 0.99618331, 0.48842244],
+                             [- 6.13077945, -0.00238416, 0.00143001, 7.12839530, 0.99262367, 0.99618583, 0.48843693],
+                             [- 6.13125979, -0.00238252, 0.00142913, 7.12887728, 0.99262903, 0.99618835, 0.48845136],
+                             [- 6.13173857, -0.00238088, 0.00142825, 7.12935769, 0.99263438, 0.99619087, 0.48846576],
+                             [- 6.13221579, -0.00237924, 0.00142737, 7.12983655, 0.99263972, 0.99619339, 0.48848011],
+                             [- 6.13269147, -0.00237761, 0.00142649, 7.13031386, 0.99264506, 0.99619590, 0.48849441],
+                             [- 6.13316560, -0.00237598, 0.00142562, 7.13078962, 0.99265040, 0.99619841, 0.48850867],
+                             [- 6.13363819, -0.00237434, 0.00142474, 7.13126384, 0.99265572, 0.99620092, 0.48852289],
+                             [- 6.13410924, -0.00237272, 0.00142386, 7.13173652, 0.99266104, 0.99620342, 0.48853706],
+                             [- 6.13457876, -0.00237109, 0.00142299, 7.13220767, 0.99266635, 0.99620593, 0.48855119],
+                             [- 6.13504676, -0.00236946, 0.00142211, 7.13267729, 0.99267166, 0.99620843, 0.48856528],
+                             [- 6.13551323, -0.00236784, 0.00142124, 7.13314539, 0.99267696, 0.99621092, 0.48857932],
+                             [- 6.13597818, -0.00236622, 0.00142036, 7.13361197, 0.99268225, 0.99621342, 0.48859332],
+                             [- 6.13644163, -0.00236460, 0.00141949, 7.13407703, 0.99268753, 0.99621591, 0.48860727],
+                             [- 6.13690356, -0.00236298, 0.00141862, 7.13454058, 0.99269281, 0.99621840, 0.48862118],
+                             [- 6.13736399, -0.00236136, 0.00141774, 7.13500263, 0.99269808, 0.99622089, 0.48863505],
+                             [- 6.13782292, -0.00235975, 0.00141687, 7.13546317, 0.99270335, 0.99622338, 0.48864888],
+                             [- 6.13828035, -0.00235814, 0.00141600, 7.13592222, 0.99270861, 0.99622586, 0.48866266],
+                             [- 6.13873630, -0.00235652, 0.00141513, 7.13637977, 0.99271386, 0.99622834, 0.48867640],
+                             [- 6.13919076, -0.00235492, 0.00141426, 7.13683584, 0.99271910, 0.99623082, 0.48869010],
+                             [- 6.13964373, -0.00235331, 0.00141339, 7.13729042, 0.99272434, 0.99623330, 0.48870375],
+                             [- 6.14009523, -0.00235170, 0.00141253, 7.13774353, 0.99272957, 0.99623577, 0.48871736],
+                             [- 6.14054526, -0.00235010, 0.00141166, 7.13819516, 0.99273480, 0.99623824, 0.48873093],
+                             [- 6.14099381, -0.00234850, 0.00141079, 7.13864532, 0.99274001, 0.99624071, 0.48874446],
+                             [- 6.14144091, -0.00234689, 0.00140993, 7.13909401, 0.99274523, 0.99624318, 0.48875794],
+                             [- 6.14188654, -0.00234530, 0.00140906, 7.13954125, 0.99275043, 0.99624564, 0.48877139],
+                             [- 6.14233072, -0.00234370, 0.00140820, 7.13998702, 0.99275563, 0.99624811, 0.48878479],
+                             [- 6.14277345, -0.00234210, 0.00140733, 7.14043134, 0.99276082, 0.99625057, 0.48879815],
+                             [- 6.14321473, -0.00234051, 0.00140647, 7.14087422, 0.99276601, 0.99625302, 0.48881147],
+                             [- 6.14365457, -0.00233892, 0.00140561, 7.14131565, 0.99277118, 0.99625548, 0.48882475],
+                             [- 6.14409297, -0.00233733, 0.00140474, 7.14175564, 0.99277636, 0.99625793, 0.48883798],
+                             [- 6.14452994, -0.00233574, 0.00140388, 7.14219420, 0.99278152, 0.99626038, 0.48885118],
+                             [- 6.14496548, -0.00233415, 0.00140302, 7.14263132, 0.99278668, 0.99626283, 0.48886433],
+                             [- 6.14539959, -0.00233257, 0.00140216, 7.14306702, 0.99279183, 0.99626527, 0.48887745],
+                             [- 6.14583228, -0.00233098, 0.00140130, 7.14350130, 0.99279698, 0.99626772, 0.48889052],
+                             [- 6.14626356, -0.00232940, 0.00140044, 7.14393416, 0.99280212, 0.99627016, 0.48890355],
+                             [- 6.14669342, -0.00232782, 0.00139958, 7.14436560, 0.99280725, 0.99627259, 0.48891654],
+                             [- 6.14712188, -0.00232625, 0.00139873, 7.14479564, 0.99281238, 0.99627503, 0.48892949],
+                             [- 6.14754894, -0.00232467, 0.00139787, 7.14522427, 0.99281750, 0.99627746, 0.48894240],
+                             [- 6.14797459, -0.00232309, 0.00139701, 7.14565150, 0.99282261, 0.99627989, 0.48895527],
+                             [- 6.14839885, -0.00232152, 0.00139616, 7.14607733, 0.99282772, 0.99628232, 0.48896810],
+                             [- 6.14882172, -0.00231995, 0.00139530, 7.14650177, 0.99283282, 0.99628475, 0.48898089],
+                             [- 6.14924320, -0.00231838, 0.00139445, 7.14692482, 0.99283791, 0.99628717, 0.48899364],
+                             [- 6.14966330, -0.00231681, 0.00139359, 7.14734649, 0.99284300, 0.99628959, 0.48900634],
+                             [- 6.15008202, -0.00231525, 0.00139274, 7.14776677, 0.99284808, 0.99629201, 0.48901902],
+                             [- 6.15049937, -0.00231368, 0.00139189, 7.14818569, 0.99285316, 0.99629443, 0.48903165],
+                             [- 6.15091535, -0.00231212, 0.00139104, 7.14860323, 0.99285823, 0.99629684, 0.48904424],
+                             [- 6.15132996, -0.00231056, 0.00139018, 7.14901940, 0.99286329, 0.99629926, 0.48905679],
+                             [- 6.15174321, -0.00230900, 0.00138933, 7.14943421, 0.99286834, 0.99630166, 0.48906930],
+                             [- 6.15215510, -0.00230744, 0.00138848, 7.14984766, 0.99287339, 0.99630407, 0.48908178],
+                             [- 6.15256564, -0.00230589, 0.00138763, 7.15025975, 0.99287844, 0.99630648, 0.48909421],
+                             [- 6.15297483, -0.00230433, 0.00138679, 7.15067050, 0.99288347, 0.99630888, 0.48910661],
+                             [- 6.15338268, -0.00230278, 0.00138594, 7.15107989, 0.99288850, 0.99631128, 0.48911897],
+                             [- 6.15378918, -0.00230123, 0.00138509, 7.15148795, 0.99289353, 0.99631368, 0.48913128],
+                             [- 6.15419435, -0.00229968, 0.00138424, 7.15189467, 0.99289855, 0.99631607, 0.48914356],
+                             [- 6.15459818, -0.00229814, 0.00138340, 7.15230005, 0.99290356, 0.99631847, 0.48915581],
+                             [- 6.15500069, -0.00229659, 0.00138255, 7.15270410, 0.99290856, 0.99632086, 0.48916801],
+                             [- 6.15540187, -0.00229505, 0.00138171, 7.15310682, 0.99291356, 0.99632324, 0.48918017],
+                             [- 6.15580173, -0.00229350, 0.00138087, 7.15350822, 0.99291855, 0.99632563, 0.48919230],
+                             [- 6.15620027, -0.00229196, 0.00138002, 7.15390831, 0.99292354, 0.99632801, 0.48920439],
+                             [- 6.15659750, -0.00229042, 0.00137918, 7.15430708, 0.99292852, 0.99633040, 0.48921644],
+                             [- 6.15699342, -0.00228889, 0.00137834, 7.15470454, 0.99293349, 0.99633278, 0.48922846],
+                             [- 6.15738804, -0.00228735, 0.00137750, 7.15510069, 0.99293846, 0.99633515, 0.48924043],
+                             [- 6.15778136, -0.00228582, 0.00137666, 7.15549554, 0.99294342, 0.99633753, 0.48925237],
+                             [- 6.15817338, -0.00228429, 0.00137582, 7.15588909, 0.99294838, 0.99633990, 0.48926427],
+                             [- 6.15856410, -0.00228276, 0.00137498, 7.15628135, 0.99295333, 0.99634227, 0.48927613],
+                             [- 6.15895354, -0.00228123, 0.00137414, 7.15667231, 0.99295827, 0.99634464, 0.48928796],
+                             [- 6.15934170, -0.00227970, 0.00137330, 7.15706199, 0.99296321, 0.99634700, 0.48929975],
+                             [- 6.15972857, -0.00227818, 0.00137246, 7.15745039, 0.99296814, 0.99634936, 0.48931151],
+                             [- 6.16011416, -0.00227665, 0.00137162, 7.15783751, 0.99297306, 0.99635172, 0.48932322],
+                             [- 6.16049848, -0.00227513, 0.00137079, 7.15822335, 0.99297798, 0.99635408, 0.48933490],
+                             [- 6.16088154, -0.00227361, 0.00136995, 7.15860793, 0.99298289, 0.99635644, 0.48934654],
+                             [- 6.16126332, -0.00227209, 0.00136912, 7.15899123, 0.99298780, 0.99635879, 0.48935815],
+                             [- 6.16164385, -0.00227057, 0.00136828, 7.15937328, 0.99299270, 0.99636114, 0.48936972],
+                             [- 6.16202312, -0.00226906, 0.00136745, 7.15975406, 0.99299759, 0.99636349, 0.48938125],
+                             [- 6.16240113, -0.00226754, 0.00136662, 7.16013359, 0.99300248, 0.99636584, 0.48939275],
+                             [- 6.16277790, -0.00226603, 0.00136579, 7.16051186, 0.99300736, 0.99636818, 0.48940421],
+                             [- 6.16315341, -0.00226452, 0.00136495, 7.16088889, 0.99301224, 0.99637052, 0.48941563],
+                             [- 6.16352769, -0.00226301, 0.00136412, 7.16126468, 0.99301711, 0.99637286, 0.48942702],
+                             [- 6.16390073, -0.00226151, 0.00136329, 7.16163922, 0.99302197, 0.99637520, 0.48943837],
+                             [- 6.16427253, -0.00226000, 0.00136246, 7.16201253, 0.99302683, 0.99637753, 0.48944969],
+                             [- 6.16464310, -0.00225850, 0.00136164, 7.16238461, 0.99303168, 0.99637987, 0.48946098],
+                             [- 6.16501245, -0.00225700, 0.00136081, 7.16275545, 0.99303653, 0.99638220, 0.48947222],
+                             [- 6.16538057, -0.00225549, 0.00135998, 7.16312507, 0.99304136, 0.99638453, 0.48948343],
+                             [- 6.16574747, -0.00225400, 0.00135915, 7.16349348, 0.99304620, 0.99638685, 0.48949461],
+                             [- 6.16611316, -0.00225250, 0.00135833, 7.16386066, 0.99305103, 0.99638918, 0.48950575],
+                             [- 6.16647763, -0.00225100, 0.00135750, 7.16422663, 0.99305585, 0.99639150, 0.48951685],
+                             [- 6.16684090, -0.00224951, 0.00135668, 7.16459139, 0.99306066, 0.99639382, 0.48952792],
+                             [- 6.16720296, -0.00224802, 0.00135585, 7.16495494, 0.99306547, 0.99639613, 0.48953896],
+                             [- 6.16756382, -0.00224653, 0.00135503, 7.16531729, 0.99307027, 0.99639845, 0.48954996],
+                             [- 6.16792348, -0.00224504, 0.00135421, 7.16567845, 0.99307507, 0.99640076, 0.48956093],
+                             [- 6.16828195, -0.00224355, 0.00135338, 7.16603840, 0.99307986, 0.99640307, 0.48957186],
+                             [- 6.16863923, -0.00224206, 0.00135256, 7.16639717, 0.99308465, 0.99640538, 0.48958276],
+                             [- 6.16899533, -0.00224058, 0.00135174, 7.16675475, 0.99308943, 0.99640768, 0.48959363],
+                             [- 6.16935024, -0.00223910, 0.00135092, 7.16711114, 0.99309420, 0.99640998, 0.48960445],
+                             [- 6.16970397, -0.00223762, 0.00135010, 7.16746636, 0.99309897, 0.99641228, 0.48961525],
+                             [- 6.17005653, -0.00223614, 0.00134928, 7.16782039, 0.99310373, 0.99641458, 0.48962601],
+                             [- 6.17040791, -0.00223466, 0.00134846, 7.16817326, 0.99310849, 0.99641688, 0.48963673],
+                             [- 6.17075813, -0.00223318, 0.00134765, 7.16852495, 0.99311324, 0.99641917, 0.48964743],
+                             [- 6.17110719, -0.00223171, 0.00134683, 7.16887548, 0.99311798, 0.99642146, 0.48965809],
+                             [- 6.17145508, -0.00223024, 0.00134601, 7.16922484, 0.99312272, 0.99642375, 0.48966871],
+                             [- 6.17180182, -0.00222876, 0.00134520, 7.16957305, 0.99312745, 0.99642604, 0.48967931],
+                             [- 6.17214740, -0.00222729, 0.00134438, 7.16992010, 0.99313218, 0.99642832, 0.48968987],
+                             [- 6.17249183, -0.00222583, 0.00134357, 7.17026601, 0.99313690, 0.99643061, 0.48970039],
+                             [- 6.17283512, -0.00222436, 0.00134275, 7.17061076, 0.99314162, 0.99643289, 0.48971088],
+                             [- 6.17317726, -0.00222289, 0.00134194, 7.17095437, 0.99314633, 0.99643517, 0.48972134],
+                             [- 6.17351827, -0.00222143, 0.00134113, 7.17129683, 0.99315103, 0.99643744, 0.48973177],
+                             [- 6.17385813, -0.00221997, 0.00134032, 7.17163816, 0.99315573, 0.99643971, 0.48974217],
+                             [- 6.17419687, -0.00221851, 0.00133950, 7.17197836, 0.99316042, 0.99644199, 0.48975252],
+                             [- 6.17453448, -0.00221705, 0.00133869, 7.17231743, 0.99316511, 0.99644425, 0.48976285],
+                             [- 6.17487096, -0.00221559, 0.00133788, 7.17265537, 0.99316979, 0.99644652, 0.48977314],
+                             [- 6.17520632, -0.00221414, 0.00133708, 7.17299218, 0.99317446, 0.99644879, 0.48978341],
+                             [- 6.17554056, -0.00221269, 0.00133627, 7.17332788, 0.99317913, 0.99645105, 0.48979364],
+                             [- 6.17587369, -0.00221123, 0.00133546, 7.17366246, 0.99318379, 0.99645331, 0.48980384],
+                             [- 6.17620571, -0.00220978, 0.00133465, 7.17399593, 0.99318845, 0.99645557, 0.48981400],
+                             [- 6.17653662, -0.00220833, 0.00133385, 7.17432829, 0.99319310, 0.99645782, 0.48982414],
+                             [- 6.17686642, -0.00220689, 0.00133304, 7.17465954, 0.99319775, 0.99646007, 0.48983424],
+                             [- 6.17719513, -0.00220544, 0.00133223, 7.17498969, 0.99320239, 0.99646233, 0.48984431],
+                             [- 6.17752273, -0.00220400, 0.00133143, 7.17531874, 0.99320702, 0.99646457, 0.48985434],
+                             [- 6.17784925, -0.00220255, 0.00133063, 7.17564669, 0.99321165, 0.99646682, 0.48986435],
+                             [- 6.17817467, -0.00220111, 0.00132982, 7.17597356, 0.99321628, 0.99646906, 0.48987432],
+                             [- 6.17849900, -0.00219967, 0.00132902, 7.17629933, 0.99322089, 0.99647131, 0.48988427],
+                             [- 6.17882225, -0.00219823, 0.00132822, 7.17662402, 0.99322551, 0.99647355, 0.48989418],
+                             [- 6.17914442, -0.00219680, 0.00132742, 7.17694762, 0.99323011, 0.99647578, 0.48990406],
+                             [- 6.17946552, -0.00219536, 0.00132662, 7.17727015, 0.99323471, 0.99647802, 0.48991391],
+                             [- 6.17978554, -0.00219393, 0.00132582, 7.17759161, 0.99323931, 0.99648025, 0.48992373],
+                             [- 6.18010448, -0.00219250, 0.00132502, 7.17791199, 0.99324390, 0.99648248, 0.48993351],
+                             [- 6.18042237, -0.00219107, 0.00132422, 7.17823130, 0.99324848, 0.99648471, 0.48994327],
+                             [- 6.18073919, -0.00218964, 0.00132342, 7.17854955, 0.99325306, 0.99648694, 0.48995299],
+                             [- 6.18105494, -0.00218821, 0.00132262, 7.17886673, 0.99325763, 0.99648916, 0.48996269],
+                             [- 6.18136964, -0.00218679, 0.00132183, 7.17918286, 0.99326220, 0.99649139, 0.48997235],
+                             [- 6.18168329, -0.00218536, 0.00132103, 7.17949793, 0.99326676, 0.99649361, 0.48998198],
+                             [- 6.18199589, -0.00218394, 0.00132024, 7.17981195, 0.99327132, 0.99649582, 0.48999158],
+                             [- 6.18230744, -0.00218252, 0.00131944, 7.18012492, 0.99327587, 0.99649804, 0.49000115],
+                             [- 6.18261795, -0.00218110, 0.00131865, 7.18043684, 0.99328041, 0.99650025, 0.49001070],
+                             [- 6.18292741, -0.00217968, 0.00131785, 7.18074773, 0.99328495, 0.99650246, 0.49002020],
+                             [- 6.18323584, -0.00217827, 0.00131706, 7.18105757, 0.99328949, 0.99650467, 0.49002969],
+                             [- 6.18354323, -0.00217685, 0.00131627, 7.18136638, 0.99329401, 0.99650688, 0.49003913],
+                             [- 6.18384960, -0.00217544, 0.00131548, 7.18167416, 0.99329854, 0.99650908, 0.49004855],
+                             [- 6.18415493, -0.00217403, 0.00131469, 7.18198091, 0.99330305, 0.99651129, 0.49005794],
+                             [- 6.18445924, -0.00217262, 0.00131390, 7.18228663, 0.99330757, 0.99651349, 0.49006730],
+                             [- 6.18476253, -0.00217121, 0.00131311, 7.18259133, 0.99331207, 0.99651568, 0.49007664],
+                             [- 6.18506481, -0.00216980, 0.00131232, 7.18289501, 0.99331657, 0.99651788, 0.49008594],
+                             [- 6.18536606, -0.00216840, 0.00131153, 7.18319767, 0.99332107, 0.99652007, 0.49009521],
+                             [- 6.18566631, -0.00216699, 0.00131074, 7.18349932, 0.99332556, 0.99652226, 0.49010445],
+                             [- 6.18596555, -0.00216559, 0.00130996, 7.18379996, 0.99333004, 0.99652445, 0.49011367],
+                             [- 6.18626378, -0.00216419, 0.00130917, 7.18409959, 0.99333452, 0.99652664, 0.49012285],
+                             [- 6.18656101, -0.00216279, 0.00130839, 7.18439822, 0.99333900, 0.99652882, 0.49013200],
+                             [- 6.18685724, -0.00216139, 0.00130760, 7.18469585, 0.99334346, 0.99653101, 0.49014113],
+                             [- 6.18715248, -0.00216000, 0.00130682, 7.18499249, 0.99334793, 0.99653319, 0.49015022],
+                             [- 6.18744673, -0.00215860, 0.00130603, 7.18528812, 0.99335238, 0.99653537, 0.49015929],
+                             [- 6.18773998, -0.00215721, 0.00130525, 7.18558277, 0.99335684, 0.99653754, 0.49016833],
+                             [- 6.18803225, -0.00215582, 0.00130447, 7.18587643, 0.99336128, 0.99653972, 0.49017734],
+                             [- 6.18832353, -0.00215443, 0.00130369, 7.18616911, 0.99336572, 0.99654189, 0.49018632],
+                             [- 6.18861384, -0.00215304, 0.00130291, 7.18646080, 0.99337016, 0.99654406, 0.49019527],
+                             [- 6.18890316, -0.00215165, 0.00130213, 7.18675152, 0.99337459, 0.99654622, 0.49020420],
+                             [- 6.18919152, -0.00215026, 0.00130135, 7.18704125, 0.99337901, 0.99654839, 0.49021309],
+                             [- 6.18947890, -0.00214888, 0.00130057, 7.18733002, 0.99338343, 0.99655055, 0.49022196],
+                             [- 6.18976532, -0.00214750, 0.00129979, 7.18761782, 0.99338785, 0.99655271, 0.49023080],
+                             [- 6.19005077, -0.00214612, 0.00129901, 7.18790465, 0.99339226, 0.99655487, 0.49023961],
+                             [- 6.19033526, -0.00214474, 0.00129823, 7.18819052, 0.99339666, 0.99655703, 0.49024839],
+                             [- 6.19061879, -0.00214336, 0.00129746, 7.18847543, 0.99340106, 0.99655918, 0.49025714],
+                             [- 6.19090136, -0.00214198, 0.00129668, 7.18875938, 0.99340545, 0.99656134, 0.49026588],
+                             [- 6.19118298, -0.00214061, 0.00129591, 7.18904238, 0.99340984, 0.99656349, 0.49027457],
+                             [- 6.19146366, -0.00213923, 0.00129513, 7.18932442, 0.99341422, 0.99656563, 0.49028324],
+                             [- 6.19174338, -0.00213786, 0.00129436, 7.18960552, 0.99341860, 0.99656778, 0.49029189],
+                             [- 6.19202217, -0.00213649, 0.00129359, 7.18988568, 0.99342297, 0.99656992, 0.49030051],
+                             [- 6.19230001, -0.00213512, 0.00129281, 7.19016489, 0.99342734, 0.99657207, 0.49030909],
+                             [- 6.19257691, -0.00213375, 0.00129204, 7.19044316, 0.99343170, 0.99657421, 0.49031766],
+                             [- 6.19285288, -0.00213239, 0.00129127, 7.19072050, 0.99343606, 0.99657634, 0.49032619],
+                             [- 6.19312792, -0.00213102, 0.00129050, 7.19099690, 0.99344041, 0.99657848, 0.49033470],
+                             [- 6.19340203, -0.00212966, 0.00128973, 7.19127237, 0.99344475, 0.99658061, 0.49034317],
+                             [- 6.19367521, -0.00212830, 0.00128896, 7.19154692, 0.99344909, 0.99658274, 0.49035163],
+                             [- 6.19394748, -0.00212694, 0.00128819, 7.19182054, 0.99345343, 0.99658487, 0.49036006],
+                             [- 6.19421882, -0.00212558, 0.00128743, 7.19209324, 0.99345776, 0.99658700, 0.49036845],
+                             [- 6.19448924, -0.00212422, 0.00128666, 7.19236502, 0.99346208, 0.99658912, 0.49037683],
+                             [- 6.19475875, -0.00212286, 0.00128589, 7.19263589, 0.99346640, 0.99659124, 0.49038517],
+                             [- 6.19502735, -0.00212151, 0.00128513, 7.19290584, 0.99347072, 0.99659336, 0.49039349],
+                             [- 6.19529504, -0.00212016, 0.00128436, 7.19317489, 0.99347503, 0.99659548, 0.49040178],
+                             [- 6.19556183, -0.00211880, 0.00128360, 7.19344302, 0.99347933, 0.99659760, 0.49041005],
+                             [- 6.19582771, -0.00211745, 0.00128283, 7.19371026, 0.99348363, 0.99659971, 0.49041829],
+                             [- 6.19609270, -0.00211611, 0.00128207, 7.19397659, 0.99348792, 0.99660182, 0.49042650],
+                             [- 6.19635678, -0.00211476, 0.00128131, 7.19424203, 0.99349221, 0.99660393, 0.49043469],
+                             [- 6.19661998, -0.00211341, 0.00128054, 7.19450656, 0.99349650, 0.99660604, 0.49044285],
+                             [- 6.19688228, -0.00211207, 0.00127978, 7.19477021, 0.99350077, 0.99660815, 0.49045099],
+                             [- 6.19714369, -0.00211073, 0.00127902, 7.19503297, 0.99350505, 0.99661025, 0.49045909],
+                             [- 6.19740422, -0.00210938, 0.00127826, 7.19529484, 0.99350932, 0.99661235, 0.49046717],
+                             [- 6.19766387, -0.00210804, 0.00127750, 7.19555583, 0.99351358, 0.99661445, 0.49047523],
+                             [- 6.19792264, -0.00210671, 0.00127674, 7.19581593, 0.99351784, 0.99661655, 0.49048326],
+                             [- 6.19818053, -0.00210537, 0.00127599, 7.19607516, 0.99352209, 0.99661864, 0.49049127],
+                             [- 6.19843754, -0.00210403, 0.00127523, 7.19633351, 0.99352634, 0.99662074, 0.49049925],
+                             [- 6.19869369, -0.00210270, 0.00127447, 7.19659099, 0.99353058, 0.99662283, 0.49050720],
+                             [- 6.19894896, -0.00210137, 0.00127372, 7.19684760, 0.99353482, 0.99662492, 0.49051513],
+                             [- 6.19920337, -0.00210004, 0.00127296, 7.19710334, 0.99353905, 0.99662700, 0.49052303],
+                             [- 6.19945692, -0.00209871, 0.00127221, 7.19735822, 0.99354328, 0.99662909, 0.49053091],
+                             [- 6.19970961, -0.00209738, 0.00127145, 7.19761223, 0.99354750, 0.99663117, 0.49053876],
+                             [- 6.19996144, -0.00209605, 0.00127070, 7.19786539, 0.99355172, 0.99663325, 0.49054659],
+                             [- 6.20021242, -0.00209473, 0.00126995, 7.19811769, 0.99355593, 0.99663533, 0.49055439],
+                             [- 6.20046254, -0.00209340, 0.00126919, 7.19836914, 0.99356014, 0.99663741, 0.49056217],
+                             [- 6.20071181, -0.00209208, 0.00126844, 7.19861973, 0.99356434, 0.99663948, 0.49056992],
+                             [- 6.20096024, -0.00209076, 0.00126769, 7.19886948, 0.99356854, 0.99664155, 0.49057765],
+                             [- 6.20120782, -0.00208944, 0.00126694, 7.19911839, 0.99357273, 0.99664362, 0.49058536],
+                             [- 6.20145457, -0.00208812, 0.00126619, 7.19936645, 0.99357692, 0.99664569, 0.49059304],
+                             [- 6.20170047, -0.00208680, 0.00126544, 7.19961367, 0.99358110, 0.99664776, 0.49060069],
+                             [- 6.20194554, -0.00208549, 0.00126469, 7.19986005, 0.99358528, 0.99664982, 0.49060832],
+                             [- 6.20218978, -0.00208417, 0.00126395, 7.20010560, 0.99358945, 0.99665188, 0.49061593],
+                             [- 6.20243318, -0.00208286, 0.00126320, 7.20035032, 0.99359362, 0.99665394, 0.49062351],
+                             [- 6.20267576, -0.00208155, 0.00126245, 7.20059421, 0.99359778, 0.99665600, 0.49063106],
+                             [- 6.20291751, -0.00208024, 0.00126171, 7.20083727, 0.99360194, 0.99665805, 0.49063859],
+                             [- 6.20315844, -0.00207893, 0.00126096, 7.20107951, 0.99360609, 0.99666011, 0.49064611],
+                             [- 6.20339855, -0.00207762, 0.00126022, 7.20132093, 0.99361024, 0.99666216, 0.49065358],
+                             [- 6.20363785, -0.00207632, 0.00125947, 7.20156153, 0.99361438, 0.99666421, 0.49066104],
+                             [- 6.20387633, -0.00207501, 0.00125873, 7.20180131, 0.99361852, 0.99666626, 0.49066848],
+                             [- 6.20411399, -0.00207371, 0.00125799, 7.20204028, 0.99362265, 0.99666830, 0.49067589],
+                             [- 6.20435085, -0.00207241, 0.00125725, 7.20227844, 0.99362678, 0.99667034, 0.49068328],
+                             [- 6.20458690, -0.00207111, 0.00125650, 7.20251579, 0.99363090, 0.99667238, 0.49069064],
+                             [- 6.20482215, -0.00206981, 0.00125576, 7.20275234, 0.99363502, 0.99667442, 0.49069799],
+                             [- 6.20505660, -0.00206852, 0.00125502, 7.20298808, 0.99363914, 0.99667646, 0.49070530],
+                             [- 6.20529024, -0.00206722, 0.00125428, 7.20322302, 0.99364325, 0.99667850, 0.49071260],
+                             [- 6.20552310, -0.00206593, 0.00125355, 7.20345717, 0.99364735, 0.99668053, 0.49071987],
+                             [- 6.20575515, -0.00206463, 0.00125281, 7.20369052, 0.99365145, 0.99668256, 0.49072711],
+                             [- 6.20598642, -0.00206334, 0.00125207, 7.20392308, 0.99365554, 0.99668459, 0.49073434],
+                             [- 6.20621690, -0.00206205, 0.00125133, 7.20415485, 0.99365963, 0.99668662, 0.49074154],
+                             [- 6.20644659, -0.00206076, 0.00125060, 7.20438583, 0.99366372, 0.99668864, 0.49074872],
+                             [- 6.20667550, -0.00205947, 0.00124986, 7.20461602, 0.99366780, 0.99669066, 0.49075587],
+                             [- 6.20690362, -0.00205819, 0.00124913, 7.20484543, 0.99367187, 0.99669268, 0.49076300],
+                             [- 6.20713097, -0.00205690, 0.00124839, 7.20507407, 0.99367594, 0.99669470, 0.49077011],
+                             [- 6.20735754, -0.00205562, 0.00124766, 7.20530192, 0.99368001, 0.99669672, 0.49077720],
+                             [- 6.20758334, -0.00205434, 0.00124693, 7.20552900, 0.99368407, 0.99669873, 0.49078426],
+                             [- 6.20780837, -0.00205306, 0.00124619, 7.20575531, 0.99368812, 0.99670075, 0.49079130],
+                             [- 6.20803263, -0.00205178, 0.00124546, 7.20598085, 0.99369217, 0.99670276, 0.49079832],
+                             [- 6.20825612, -0.00205050, 0.00124473, 7.20620562, 0.99369622, 0.99670477, 0.49080531],
+                             [- 6.20847885, -0.00204923, 0.00124400, 7.20642963, 0.99370026, 0.99670677, 0.49081228],
+                             [- 6.20870082, -0.00204795, 0.00124327, 7.20665287, 0.99370430, 0.99670878, 0.49081924],
+                             [- 6.20892203, -0.00204668, 0.00124254, 7.20687536, 0.99370833, 0.99671078, 0.49082617],
+                             [- 6.20914249, -0.00204540, 0.00124181, 7.20709708, 0.99371236, 0.99671278, 0.49083307],
+                             [- 6.20936219, -0.00204413, 0.00124109, 7.20731805, 0.99371638, 0.99671478, 0.49083996],
+                             [- 6.20958114, -0.00204286, 0.00124036, 7.20753827, 0.99372040, 0.99671678, 0.49084681],
+                             [- 6.20979934, -0.00204160, 0.00123963, 7.20775774, 0.99372441, 0.99671877, 0.49085365],
+                             [- 6.21001679, -0.00204033, 0.00123891, 7.20797646, 0.99372842, 0.99672076, 0.49086047],
+                             [- 6.21023350, -0.00203906, 0.00123818, 7.20819444, 0.99373242, 0.99672275, 0.49086727],
+                             [- 6.21044947, -0.00203780, 0.00123746, 7.20841167, 0.99373642, 0.99672474, 0.49087404],
+                             [- 6.21066470, -0.00203654, 0.00123673, 7.20862816, 0.99374042, 0.99672673, 0.49088079],
+                             [- 6.21087920, -0.00203528, 0.00123601, 7.20884392, 0.99374441, 0.99672871, 0.49088752],
+                             [- 6.21109295, -0.00203402, 0.00123529, 7.20905894, 0.99374839, 0.99673070, 0.49089423],
+                             [- 6.21130598, -0.00203276, 0.00123456, 7.20927322, 0.99375237, 0.99673268, 0.49090092],
+                             [- 6.21151828, -0.00203150, 0.00123384, 7.20948678, 0.99375635, 0.99673466, 0.49090759],
+                             [- 6.21172985, -0.00203024, 0.00123312, 7.20969960, 0.99376032, 0.99673663, 0.49091423],
+                             [- 6.21194069, -0.00202899, 0.00123240, 7.20991170, 0.99376428, 0.99673861, 0.49092085],
+                             [- 6.21215082, -0.00202774, 0.00123168, 7.21012308, 0.99376825, 0.99674058, 0.49092745],
+                             [- 6.21236022, -0.00202648, 0.00123096, 7.21033373, 0.99377220, 0.99674255, 0.49093403],
+                             [- 6.21256890, -0.00202523, 0.00123025, 7.21054367, 0.99377616, 0.99674452, 0.49094059],
+                             [- 6.21277687, -0.00202398, 0.00122953, 7.21075289, 0.99378010, 0.99674649, 0.49094712],
+                             [- 6.21298413, -0.00202274, 0.00122881, 7.21096139, 0.99378405, 0.99674845, 0.49095364],
+                             [- 6.21319067, -0.00202149, 0.00122809, 7.21116918, 0.99378798, 0.99675042, 0.49096013],
+                             [- 6.21339651, -0.00202025, 0.00122738, 7.21137627, 0.99379192, 0.99675238, 0.49096661],
+                             [- 6.21360164, -0.00201900, 0.00122666, 7.21158264, 0.99379585, 0.99675434, 0.49097306],
+                             [- 6.21380607, -0.00201776, 0.00122595, 7.21178831, 0.99379977, 0.99675629, 0.49097950],
+                             [- 6.21400979, -0.00201652, 0.00122523, 7.21199328, 0.99380369, 0.99675825, 0.49098591],
+                             [- 6.21421282, -0.00201528, 0.00122452, 7.21219754, 0.99380761, 0.99676020, 0.49099230],
+                             [- 6.21441515, -0.00201404, 0.00122381, 7.21240111, 0.99381152, 0.99676215, 0.49099867],
+                             [- 6.21461678, -0.00201280, 0.00122310, 7.21260398, 0.99381543, 0.99676410, 0.49100502],
+                             [- 6.21481773, -0.00201157, 0.00122239, 7.21280616, 0.99381933, 0.99676605, 0.49101135],
+                             [- 6.21501798, -0.00201033, 0.00122167, 7.21300765, 0.99382323, 0.99676799, 0.49101767],
+                             [- 6.21521754, -0.00200910, 0.00122096, 7.21320844, 0.99382712, 0.99676994, 0.49102395],
+                             [- 6.21541642, -0.00200787, 0.00122026, 7.21340855, 0.99383101, 0.99677188, 0.49103022],
+                             [- 6.21561461, -0.00200664, 0.00121955, 7.21360798, 0.99383489, 0.99677382, 0.49103647],
+                             [- 6.21581213, -0.00200541, 0.00121884, 7.21380672, 0.99383877, 0.99677575, 0.49104269],
+                             [- 6.21600896, -0.00200418, 0.00121813, 7.21400478, 0.99384265, 0.99677769, 0.49104891],
+                             [- 6.21620512, -0.00200295, 0.00121742, 7.21420217, 0.99384652, 0.99677962, 0.49105509],
+                             [- 6.21640060, -0.00200173, 0.00121672, 7.21439887, 0.99385038, 0.99678156, 0.49106126],
+                             [- 6.21659541, -0.00200050, 0.00121601, 7.21459491, 0.99385424, 0.99678349, 0.49106741],
+                             [- 6.21678955, -0.00199928, 0.00121531, 7.21479027, 0.99385810, 0.99678541, 0.49107353],
+                             [- 6.21698302, -0.00199806, 0.00121460, 7.21498497, 0.99386195, 0.99678734, 0.49107964],
+                             [- 6.21717583, -0.00199684, 0.00121390, 7.21517899, 0.99386580, 0.99678926, 0.49108574],
+                             [- 6.21736797, -0.00199562, 0.00121320, 7.21537235, 0.99386965, 0.99679119, 0.49109180],
+                             [- 6.21755945, -0.00199440, 0.00121249, 7.21556505, 0.99387349, 0.99679311, 0.49109786],
+                             [- 6.21775028, -0.00199319, 0.00121179, 7.21575709, 0.99387732, 0.99679502, 0.49110388],
+                             [- 6.21794044, -0.00199197, 0.00121109, 7.21594847, 0.99388115, 0.99679694, 0.49110989],
+                             [- 6.21812995, -0.00199076, 0.00121039, 7.21613919, 0.99388498, 0.99679885, 0.49111588],
+                             [- 6.21831881, -0.00198955, 0.00120969, 7.21632926, 0.99388880, 0.99680077, 0.49112186],
+                             [- 6.21850702, -0.00198833, 0.00120899, 7.21651868, 0.99389261, 0.99680268, 0.49112781],
+                             [- 6.21869457, -0.00198712, 0.00120829, 7.21670745, 0.99389643, 0.99680459, 0.49113374],
+                             [- 6.21888149, -0.00198592, 0.00120759, 7.21689557, 0.99390024, 0.99680649, 0.49113965],
+                             [- 6.21906775, -0.00198471, 0.00120689, 7.21708304, 0.99390404, 0.99680840, 0.49114555],
+                             [- 6.21925338, -0.00198350, 0.00120620, 7.21726987, 0.99390784, 0.99681030, 0.49115142],
+                             [- 6.21943836, -0.00198230, 0.00120550, 7.21745606, 0.99391163, 0.99681220, 0.49115728],
+                             [- 6.21962271, -0.00198110, 0.00120481, 7.21764161, 0.99391542, 0.99681410, 0.49116312],
+                             [- 6.21980642, -0.00197989, 0.00120411, 7.21782653, 0.99391921, 0.99681600, 0.49116895],
+                             [- 6.21998950, -0.00197869, 0.00120342, 7.21801081, 0.99392299, 0.99681789, 0.49117474],
+                             [- 6.22017194, -0.00197749, 0.00120272, 7.21819445, 0.99392677, 0.99681979, 0.49118052],
+                             [- 6.22035376, -0.00197630, 0.00120203, 7.21837746, 0.99393054, 0.99682168, 0.49118629],
+                             [- 6.22053495, -0.00197510, 0.00120134, 7.21855985, 0.99393431, 0.99682357, 0.49119203],
+                             [- 6.22071551, -0.00197390, 0.00120064, 7.21874161, 0.99393808, 0.99682545, 0.49119776],
+                             [- 6.22089545, -0.00197271, 0.00119995, 7.21892274, 0.99394184, 0.99682734, 0.49120347],
+                             [- 6.22107477, -0.00197152, 0.00119926, 7.21910325, 0.99394559, 0.99682922, 0.49120916],
+                             [- 6.22125347, -0.00197032, 0.00119857, 7.21928314, 0.99394935, 0.99683111, 0.49121482],
+                             [- 6.22143155, -0.00196913, 0.00119788, 7.21946242, 0.99395309, 0.99683299, 0.49122047],
+                             [- 6.22160902, -0.00196794, 0.00119719, 7.21964107, 0.99395684, 0.99683486, 0.49122611],
+                             [- 6.22178587, -0.00196676, 0.00119650, 7.21981911, 0.99396058, 0.99683674, 0.49123173],
+                             [- 6.22196211, -0.00196557, 0.00119582, 7.21999654, 0.99396431, 0.99683861, 0.49123732],
+                             [- 6.22213774, -0.00196438, 0.00119513, 7.22017336, 0.99396804, 0.99684049, 0.49124290],
+                             [- 6.22231277, -0.00196320, 0.00119444, 7.22034957, 0.99397177, 0.99684236, 0.49124846],
+                             [- 6.22248719, -0.00196202, 0.00119376, 7.22052517, 0.99397549, 0.99684423, 0.49125400],
+                             [- 6.22266101, -0.00196083, 0.00119307, 7.22070017, 0.99397920, 0.99684609, 0.49125953],
+                             [- 6.22283422, -0.00195965, 0.00119239, 7.22087457, 0.99398292, 0.99684796, 0.49126504],
+                             [- 6.22300684, -0.00195848, 0.00119170, 7.22104836, 0.99398663, 0.99684982, 0.49127053],
+                             [- 6.22317886, -0.00195730, 0.00119102, 7.22122156, 0.99399033, 0.99685168, 0.49127600],
+                             [- 6.22335028, -0.00195612, 0.00119034, 7.22139416, 0.99399403, 0.99685354, 0.49128145],
+                             [- 6.22352111, -0.00195495, 0.00118965, 7.22156617, 0.99399773, 0.99685540, 0.49128689],
+                             [- 6.22369135, -0.00195377, 0.00118897, 7.22173758, 0.99400142, 0.99685726, 0.49129231],
+                             [- 6.22386100, -0.00195260, 0.00118829, 7.22190841, 0.99400511, 0.99685911, 0.49129771],
+                             [- 6.22403007, -0.00195143, 0.00118761, 7.22207864, 0.99400879, 0.99686096, 0.49130310],
+                             [- 6.22419854, -0.00195026, 0.00118693, 7.22224829, 0.99401247, 0.99686281, 0.49130846],
+                             [- 6.22436644, -0.00194909, 0.00118625, 7.22241735, 0.99401615, 0.99686466, 0.49131381],
+                             [- 6.22453375, -0.00194792, 0.00118557, 7.22258583, 0.99401982, 0.99686651, 0.49131914],
+                             [- 6.22470048, -0.00194675, 0.00118490, 7.22275373, 0.99402348, 0.99686835, 0.49132446],
+                             [- 6.22486664, -0.00194559, 0.00118422, 7.22292105, 0.99402715, 0.99687019, 0.49132975],
+                             [- 6.22503222, -0.00194442, 0.00118354, 7.22308780, 0.99403081, 0.99687204, 0.49133503],
+                             [- 6.22519722, -0.00194326, 0.00118287, 7.22325396, 0.99403446, 0.99687387, 0.49134030],
+                             [- 6.22536166, -0.00194210, 0.00118219, 7.22341956, 0.99403811, 0.99687571, 0.49134554],
+                             [- 6.22552552, -0.00194094, 0.00118152, 7.22358458, 0.99404176, 0.99687755, 0.49135077],
+                             [- 6.22568881, -0.00193978, 0.00118084, 7.22374904, 0.99404540, 0.99687938, 0.49135598],
+                             [- 6.22585154, -0.00193862, 0.00118017, 7.22391292, 0.99404904, 0.99688121, 0.49136117],
+                             [- 6.22601370, -0.00193746, 0.00117950, 7.22407624, 0.99405267, 0.99688304, 0.49136635],
+                             [- 6.22617531, -0.00193631, 0.00117882, 7.22423900, 0.99405630, 0.99688487, 0.49137152],
+                             [- 6.22633635, -0.00193515, 0.00117815, 7.22440119, 0.99405992, 0.99688670, 0.49137666],
+                             [- 6.22649683, -0.00193400, 0.00117748, 7.22456283, 0.99406354, 0.99688852, 0.49138179],
+                             [- 6.22665675, -0.00193285, 0.00117681, 7.22472390, 0.99406716, 0.99689034, 0.49138690],
+                             [- 6.22681612, -0.00193170, 0.00117614, 7.22488442, 0.99407077, 0.99689216, 0.49139199],
+                             [- 6.22697494, -0.00193055, 0.00117547, 7.22504439, 0.99407438, 0.99689398, 0.49139707],
+                             [- 6.22713320, -0.00192940, 0.00117480, 7.22520380, 0.99407799, 0.99689580, 0.49140214],
+                             [- 6.22729092, -0.00192825, 0.00117413, 7.22536266, 0.99408159, 0.99689762, 0.49140718],
+                             [- 6.22744808, -0.00192711, 0.00117346, 7.22552098, 0.99408519, 0.99689943, 0.49141221],
+                             [- 6.22760470, -0.00192596, 0.00117280, 7.22567874, 0.99408878, 0.99690124, 0.49141723],
+                             [- 6.22776078, -0.00192482, 0.00117213, 7.22583596, 0.99409237, 0.99690305, 0.49142222],
+                             [- 6.22791631, -0.00192368, 0.00117147, 7.22599264, 0.99409595, 0.99690486, 0.49142719],
+                             [- 6.22807131, -0.00192253, 0.00117080, 7.22614877, 0.99409953, 0.99690667, 0.49143216],
+                             [- 6.22822576, -0.00192139, 0.00117014, 7.22630437, 0.99410311, 0.99690847, 0.49143711],
+                             [- 6.22837968, -0.00192026, 0.00116947, 7.22645942, 0.99410668, 0.99691027, 0.49144204],
+                             [- 6.22853306, -0.00191912, 0.00116881, 7.22661394, 0.99411025, 0.99691207, 0.49144696],
+                             [- 6.22868591, -0.00191798, 0.00116815, 7.22676793, 0.99411381, 0.99691387, 0.49145186],
+                             [- 6.22883823, -0.00191685, 0.00116748, 7.22692138, 0.99411737, 0.99691567, 0.49145674],
+                             [- 6.22899002, -0.00191571, 0.00116682, 7.22707430, 0.99412093, 0.99691747, 0.49146161],
+                             [- 6.22914128, -0.00191458, 0.00116616, 7.22722670, 0.99412448, 0.99691926, 0.49146647],
+                             [- 6.22929201, -0.00191345, 0.00116550, 7.22737856, 0.99412803, 0.99692105, 0.49147130],
+                             [- 6.22944222, -0.00191232, 0.00116484, 7.22752990, 0.99413157, 0.99692284, 0.49147613],
+                             [- 6.22959190, -0.00191119, 0.00116418, 7.22768071, 0.99413511, 0.99692463, 0.49148093],
+                             [- 6.22974107, -0.00191006, 0.00116352, 7.22783101, 0.99413865, 0.99692642, 0.49148571],
+                             [- 6.22988971, -0.00190893, 0.00116286, 7.22798078, 0.99414218, 0.99692820, 0.49149049],
+                             [- 6.23003784, -0.00190781, 0.00116221, 7.22813003, 0.99414571, 0.99692998, 0.49149525],
+                             [- 6.23018545, -0.00190669, 0.00116155, 7.22827877, 0.99414924, 0.99693176, 0.49149999],
+                             [- 6.23033255, -0.00190556, 0.00116089, 7.22842699, 0.99415276, 0.99693354, 0.49150472],
+                             [- 6.23047913, -0.00190444, 0.00116024, 7.22857469, 0.99415627, 0.99693532, 0.49150944],
+                             [- 6.23062521, -0.00190332, 0.00115958, 7.22872189, 0.99415978, 0.99693710, 0.49151413],
+                             [- 6.23077077, -0.00190220, 0.00115893, 7.22886857, 0.99416329, 0.99693887, 0.49151881],
+                             [- 6.23091583, -0.00190108, 0.00115828, 7.22901475, 0.99416680, 0.99694064, 0.49152348],
+                             [- 6.23106038, -0.00189996, 0.00115762, 7.22916042, 0.99417030, 0.99694241, 0.49152813],
+                             [- 6.23120443, -0.00189885, 0.00115697, 7.22930558, 0.99417379, 0.99694418, 0.49153277],
+                             [- 6.23134798, -0.00189773, 0.00115632, 7.22945024, 0.99417729, 0.99694595, 0.49153739],
+                             [- 6.23149102, -0.00189662, 0.00115567, 7.22959440, 0.99418078, 0.99694772, 0.49154200],
+                             [- 6.23163357, -0.00189551, 0.00115501, 7.22973806, 0.99418426, 0.99694948, 0.49154659],
+                             [- 6.23177562, -0.00189439, 0.00115436, 7.22988122, 0.99418774, 0.99695124, 0.49155116],
+                             [- 6.23191717, -0.00189328, 0.00115371, 7.23002389, 0.99419122, 0.99695300, 0.49155572],
+                             [- 6.23205823, -0.00189218, 0.00115307, 7.23016606, 0.99419469, 0.99695476, 0.49156028],
+                             [- 6.23219880, -0.00189107, 0.00115242, 7.23030773, 0.99419816, 0.99695652, 0.49156481],
+                             [- 6.23233888, -0.00188996, 0.00115177, 7.23044891, 0.99420163, 0.99695827, 0.49156932],
+                             [- 6.23247846, -0.00188886, 0.00115112, 7.23058961, 0.99420509, 0.99696002, 0.49157383],
+                             [- 6.23261756, -0.00188775, 0.00115047, 7.23072981, 0.99420855, 0.99696177, 0.49157832],
+                             [- 6.23275618, -0.00188665, 0.00114983, 7.23086953, 0.99421200, 0.99696352, 0.49158279],
+                             [- 6.23289431, -0.00188555, 0.00114918, 7.23100876, 0.99421545, 0.99696527, 0.49158725],
+                             [- 6.23303196, -0.00188444, 0.00114854, 7.23114751, 0.99421890, 0.99696702, 0.49159170],
+                             [- 6.23316912, -0.00188334, 0.00114789, 7.23128578, 0.99422234, 0.99696876, 0.49159612],
+                             [- 6.23330581, -0.00188225, 0.00114725, 7.23142357, 0.99422578, 0.99697050, 0.49160053],
+                             [- 6.23344202, -0.00188115, 0.00114661, 7.23156087, 0.99422921, 0.99697225, 0.49160494],
+                             [- 6.23357776, -0.00188005, 0.00114596, 7.23169771, 0.99423264, 0.99697398, 0.49160932],
+                             [- 6.23371302, -0.00187896, 0.00114532, 7.23183406, 0.99423607, 0.99697572, 0.49161370],
+                             [- 6.23384781, -0.00187786, 0.00114468, 7.23196994, 0.99423949, 0.99697746, 0.49161806],
+                             [- 6.23398212, -0.00187677, 0.00114404, 7.23210535, 0.99424291, 0.99697919, 0.49162241],
+                             [- 6.23411597, -0.00187568, 0.00114340, 7.23224029, 0.99424633, 0.99698092, 0.49162674],
+                             [- 6.23424935, -0.00187459, 0.00114276, 7.23237476, 0.99424974, 0.99698265, 0.49163105],
+                             [- 6.23438226, -0.00187350, 0.00114212, 7.23250876, 0.99425315, 0.99698438, 0.49163535],
+                             [- 6.23451471, -0.00187241, 0.00114148, 7.23264230, 0.99425655, 0.99698611, 0.49163964],
+                             [- 6.23464669, -0.00187132, 0.00114084, 7.23277537, 0.99425995, 0.99698783, 0.49164392],
+                             [- 6.23477821, -0.00187024, 0.00114021, 7.23290797, 0.99426335, 0.99698956, 0.49164818],
+                             [- 6.23490927, -0.00186915, 0.00113957, 7.23304012, 0.99426674, 0.99699128, 0.49165242],
+                             [- 6.23503988, -0.00186807, 0.00113893, 7.23317181, 0.99427013, 0.99699300, 0.49165666],
+                             [- 6.23517002, -0.00186698, 0.00113830, 7.23330304, 0.99427352, 0.99699472, 0.49166087],
+                             [- 6.23529971, -0.00186590, 0.00113766, 7.23343381, 0.99427690, 0.99699644, 0.49166508],
+                             [- 6.23542895, -0.00186482, 0.00113703, 7.23356413, 0.99428028, 0.99699815, 0.49166927],
+                             [- 6.23555773, -0.00186374, 0.00113639, 7.23369399, 0.99428365, 0.99699986, 0.49167345],
+                             [- 6.23568606, -0.00186267, 0.00113576, 7.23382340, 0.99428702, 0.99700157, 0.49167762],
+                             [- 6.23581395, -0.00186159, 0.00113513, 7.23395236, 0.99429039, 0.99700328, 0.49168176],
+                             [- 6.23594138, -0.00186051, 0.00113449, 7.23408087, 0.99429375, 0.99700499, 0.49168591],
+                             [- 6.23606837, -0.00185944, 0.00113386, 7.23420893, 0.99429711, 0.99700670, 0.49169003],
+                             [- 6.23619491, -0.00185836, 0.00113323, 7.23433655, 0.99430047, 0.99700840, 0.49169415],
+                             [- 6.23632102, -0.00185729, 0.00113260, 7.23446372, 0.99430382, 0.99701011, 0.49169823],
+                             [- 6.23644667, -0.00185622, 0.00113197, 7.23459045, 0.99430717, 0.99701181, 0.49170232],
+                             [- 6.23657189, -0.00185515, 0.00113134, 7.23471674, 0.99431051, 0.99701351, 0.49170640],
+                             [- 6.23669667, -0.00185408, 0.00113071, 7.23484259, 0.99431385, 0.99701521, 0.49171044],
+                             [- 6.23682101, -0.00185301, 0.00113009, 7.23496800, 0.99431719, 0.99701690, 0.49171449],
+                             [- 6.23694492, -0.00185195, 0.00112946, 7.23509297, 0.99432052, 0.99701860, 0.49171853],
+                             [- 6.23706839, -0.00185088, 0.00112883, 7.23521751, 0.99432385, 0.99702029, 0.49172254],
+                             [- 6.23719143, -0.00184981, 0.00112820, 7.23534161, 0.99432718, 0.99702198, 0.49172655],
+                             [- 6.23731403, -0.00184875, 0.00112758, 7.23546528, 0.99433050, 0.99702367, 0.49173054],
+                             [- 6.23743621, -0.00184769, 0.00112695, 7.23558852, 0.99433382, 0.99702536, 0.49173452],
+                             [- 6.23755795, -0.00184663, 0.00112633, 7.23571133, 0.99433713, 0.99702705, 0.49173848],
+                             [- 6.23767927, -0.00184557, 0.00112570, 7.23583371, 0.99434044, 0.99702873, 0.49174243],
+                             [- 6.23780017, -0.00184451, 0.00112508, 7.23595566, 0.99434375, 0.99703041, 0.49174639],
+                             [- 6.23792064, -0.00184345, 0.00112446, 7.23607719, 0.99434706, 0.99703209, 0.49175031],
+                             [- 6.23804068, -0.00184239, 0.00112383, 7.23619829, 0.99435036, 0.99703377, 0.49175422],
+                             [- 6.23816031, -0.00184134, 0.00112321, 7.23631897, 0.99435365, 0.99703545, 0.49175813],
+                             [- 6.23827952, -0.00184028, 0.00112259, 7.23643923, 0.99435695, 0.99703713, 0.49176201],
+                             [- 6.23839830, -0.00183923, 0.00112197, 7.23655907, 0.99436024, 0.99703880, 0.49176589],
+                             [- 6.23851667, -0.00183817, 0.00112135, 7.23667850, 0.99436352, 0.99704048, 0.49176975],
+                             [- 6.23863462, -0.00183712, 0.00112073, 7.23679750, 0.99436680, 0.99704215, 0.49177361],
+                             [- 6.23875216, -0.00183607, 0.00112011, 7.23691609, 0.99437008, 0.99704382, 0.49177744],
+                             [- 6.23886929, -0.00183502, 0.00111949, 7.23703427, 0.99437336, 0.99704548, 0.49178127],
+                             [- 6.23898600, -0.00183398, 0.00111887, 7.23715203, 0.99437663, 0.99704715, 0.49178508],
+                             [- 6.23910231, -0.00183293, 0.00111826, 7.23726938, 0.99437990, 0.99704881, 0.49178889],
+                             [- 6.23921820, -0.00183188, 0.00111764, 7.23738632, 0.99438316, 0.99705048, 0.49179268],
+                             [- 6.23933369, -0.00183084, 0.00111702, 7.23750286, 0.99438642, 0.99705214, 0.49179645],
+                             [- 6.23944877, -0.00182979, 0.00111641, 7.23761898, 0.99438968, 0.99705380, 0.49180022],
+                             [- 6.23956345, -0.00182875, 0.00111579, 7.23773470, 0.99439293, 0.99705546, 0.49180397],
+                             [- 6.23967773, -0.00182771, 0.00111518, 7.23785002, 0.99439618, 0.99705711, 0.49180771],
+                             [- 6.23979160, -0.00182667, 0.00111456, 7.23796493, 0.99439943, 0.99705877, 0.49181144],
+                             [- 6.23990507, -0.00182563, 0.00111395, 7.23807944, 0.99440267, 0.99706042, 0.49181516],
+                             [- 6.24001814, -0.00182459, 0.00111334, 7.23819355, 0.99440591, 0.99706207, 0.49181886],
+                             [- 6.24013082, -0.00182355, 0.00111273, 7.23830726, 0.99440915, 0.99706372, 0.49182255],
+                             [- 6.24024309, -0.00182251, 0.00111211, 7.23842058, 0.99441238, 0.99706537, 0.49182623],
+                             [- 6.24035498, -0.00182148, 0.00111150, 7.23853350, 0.99441561, 0.99706702, 0.49182990],
+                             [- 6.24046647, -0.00182045, 0.00111089, 7.23864602, 0.99441884, 0.99706866, 0.49183355],
+                             [- 6.24057756, -0.00181941, 0.00111028, 7.23875815, 0.99442206, 0.99707031, 0.49183719],
+                             [- 6.24068827, -0.00181838, 0.00110967, 7.23886989, 0.99442528, 0.99707195, 0.49184083],
+                             [- 6.24079858, -0.00181735, 0.00110906, 7.23898123, 0.99442849, 0.99707359, 0.49184446],
+                             [- 6.24090851, -0.00181632, 0.00110846, 7.23909219, 0.99443170, 0.99707523, 0.49184806],
+                             [- 6.24101805, -0.00181529, 0.00110785, 7.23920276, 0.99443491, 0.99707686, 0.49185165],
+                             [- 6.24112720, -0.00181426, 0.00110724, 7.23931294, 0.99443812, 0.99707850, 0.49185524],
+                             [- 6.24123597, -0.00181324, 0.00110663, 7.23942274, 0.99444132, 0.99708013, 0.49185881],
+                             [- 6.24134436, -0.00181221, 0.00110603, 7.23953215, 0.99444451, 0.99708176, 0.49186237],
+                             [- 6.24145237, -0.00181118, 0.00110542, 7.23964118, 0.99444771, 0.99708339, 0.49186593],
+                             [- 6.24155999, -0.00181016, 0.00110482, 7.23974983, 0.99445090, 0.99708502, 0.49186947],
+                             [- 6.24166723, -0.00180914, 0.00110421, 7.23985810, 0.99445408, 0.99708665, 0.49187299],
+                             [- 6.24177410, -0.00180812, 0.00110361, 7.23996598, 0.99445727, 0.99708828, 0.49187651],
+                             [- 6.24188059, -0.00180710, 0.00110300, 7.24007349, 0.99446045, 0.99708990, 0.49188001],
+                             [- 6.24198671, -0.00180608, 0.00110240, 7.24018063, 0.99446363, 0.99709152, 0.49188351],
+                             [- 6.24209245, -0.00180506, 0.00110180, 7.24028739, 0.99446680, 0.99709314, 0.49188699],
+                             [- 6.24219781, -0.00180404, 0.00110120, 7.24039377, 0.99446997, 0.99709476, 0.49189046],
+                             [- 6.24230281, -0.00180302, 0.00110060, 7.24049978, 0.99447313, 0.99709638, 0.49189392],
+                             [- 6.24240743, -0.00180201, 0.00110000, 7.24060543, 0.99447630, 0.99709800, 0.49189737],
+                             [- 6.24251169, -0.00180100, 0.00109940, 7.24071070, 0.99447946, 0.99709961, 0.49190081],
+                             [- 6.24261558, -0.00179998, 0.00109880, 7.24081560, 0.99448261, 0.99710122, 0.49190424],
+                             [- 6.24271910, -0.00179897, 0.00109820, 7.24092013, 0.99448577, 0.99710283, 0.49190765],
+                             [- 6.24282226, -0.00179796, 0.00109760, 7.24102430, 0.99448891, 0.99710444, 0.49191105],
+                             [- 6.24292505, -0.00179695, 0.00109700, 7.24112810, 0.99449206, 0.99710605, 0.49191444],
+                             [- 6.24302748, -0.00179594, 0.00109640, 7.24123154, 0.99449520, 0.99710766, 0.49191782],
+                             [- 6.24312955, -0.00179493, 0.00109581, 7.24133462, 0.99449834, 0.99710926, 0.49192119],
+                             [- 6.24323126, -0.00179392, 0.00109521, 7.24143733, 0.99450148, 0.99711087, 0.49192455],
+                             [- 6.24333261, -0.00179292, 0.00109461, 7.24153969, 0.99450461, 0.99711247, 0.49192789],
+                             [- 6.24343360, -0.00179191, 0.00109402, 7.24164168, 0.99450774, 0.99711407, 0.49193123],
+                             [- 6.24353423, -0.00179091, 0.00109342, 7.24174332, 0.99451086, 0.99711567, 0.49193456],
+                             [- 6.24363451, -0.00178991, 0.00109283, 7.24184460, 0.99451399, 0.99711726, 0.49193787],
+                             [- 6.24373444, -0.00178891, 0.00109224, 7.24194553, 0.99451711, 0.99711886, 0.49194119],
+                             [- 6.24383401, -0.00178790, 0.00109164, 7.24204610, 0.99452022, 0.99712045, 0.49194448],
+                             [- 6.24393323, -0.00178690, 0.00109105, 7.24214632, 0.99452333, 0.99712204, 0.49194776],
+                             [- 6.24403210, -0.00178591, 0.00109046, 7.24224619, 0.99452644, 0.99712364, 0.49195103],
+                             [- 6.24413062, -0.00178491, 0.00108987, 7.24234571, 0.99452955, 0.99712522, 0.49195429],
+                             [- 6.24422879, -0.00178391, 0.00108928, 7.24244488, 0.99453265, 0.99712681, 0.49195755],
+                             [- 6.24432661, -0.00178292, 0.00108869, 7.24254370, 0.99453575, 0.99712840, 0.49196079],
+                             [- 6.24442409, -0.00178192, 0.00108810, 7.24264217, 0.99453884, 0.99712998, 0.49196402],
+                             [- 6.24452123, -0.00178093, 0.00108751, 7.24274030, 0.99454194, 0.99713157, 0.49196723],
+                             [- 6.24461802, -0.00177993, 0.00108692, 7.24283808, 0.99454502, 0.99713315, 0.49197045],
+                             [- 6.24471446, -0.00177894, 0.00108633, 7.24293552, 0.99454811, 0.99713473, 0.49197365],
+                             [- 6.24481057, -0.00177795, 0.00108574, 7.24303262, 0.99455119, 0.99713630, 0.49197684],
+                             [- 6.24490634, -0.00177696, 0.00108516, 7.24312938, 0.99455427, 0.99713788, 0.49198002],
+                             [- 6.24500177, -0.00177597, 0.00108457, 7.24322579, 0.99455735, 0.99713946, 0.49198318],
+                             [- 6.24509686, -0.00177499, 0.00108398, 7.24332187, 0.99456042, 0.99714103, 0.49198634],
+                             [- 6.24519161, -0.00177400, 0.00108340, 7.24341761, 0.99456349, 0.99714260, 0.49198949],
+                             [- 6.24528603, -0.00177301, 0.00108281, 7.24351302, 0.99456655, 0.99714417, 0.49199263],
+                             [- 6.24538012, -0.00177203, 0.00108223, 7.24360809, 0.99456961, 0.99714574, 0.49199575],
+                             [- 6.24547387, -0.00177105, 0.00108164, 7.24370283, 0.99457267, 0.99714731, 0.49199887],
+                             [- 6.24556729, -0.00177006, 0.00108106, 7.24379723, 0.99457573, 0.99714887, 0.49200198],
+                             [- 6.24566038, -0.00176908, 0.00108048, 7.24389130, 0.99457878, 0.99715044, 0.49200507],
+                             [- 6.24575314, -0.00176810, 0.00107990, 7.24398504, 0.99458183, 0.99715200, 0.49200817],
+                             [- 6.24584557, -0.00176712, 0.00107931, 7.24407845, 0.99458488, 0.99715356, 0.49201123],
+                             [- 6.24593768, -0.00176614, 0.00107873, 7.24417153, 0.99458792, 0.99715512, 0.49201431],
+                             [- 6.24602946, -0.00176517, 0.00107815, 7.24426429, 0.99459096, 0.99715668, 0.49201737],
+                             [- 6.24612091, -0.00176419, 0.00107757, 7.24435672, 0.99459400, 0.99715824, 0.49202041],
+                             [- 6.24621204, -0.00176321, 0.00107699, 7.24444883, 0.99459703, 0.99715979, 0.49202344],
+                             [- 6.24630285, -0.00176224, 0.00107641, 7.24454061, 0.99460006, 0.99716135, 0.49202647],
+                             [- 6.24639333, -0.00176127, 0.00107584, 7.24463206, 0.99460309, 0.99716290, 0.49202949],
+                             [- 6.24648350, -0.00176029, 0.00107526, 7.24472320, 0.99460611, 0.99716445, 0.49203250],
+                             [- 6.24657334, -0.00175932, 0.00107468, 7.24481402, 0.99460913, 0.99716600, 0.49203550],
+                             [- 6.24666287, -0.00175835, 0.00107410, 7.24490451, 0.99461215, 0.99716755, 0.49203848],
+                             [- 6.24675208, -0.00175738, 0.00107353, 7.24499469, 0.99461516, 0.99716909, 0.49204146],
+                             [- 6.24684097, -0.00175641, 0.00107295, 7.24508455, 0.99461817, 0.99717064, 0.49204443],
+                             [- 6.24692955, -0.00175545, 0.00107238, 7.24517410, 0.99462118, 0.99717218, 0.49204739],
+                             [- 6.24701781, -0.00175448, 0.00107180, 7.24526333, 0.99462418, 0.99717372, 0.49205033],
+                             [- 6.24710576, -0.00175351, 0.00107123, 7.24535225, 0.99462718, 0.99717526, 0.49205328],
+                             [- 6.24719340, -0.00175255, 0.00107065, 7.24544085, 0.99463018, 0.99717680, 0.49205621],
+                             [- 6.24728073, -0.00175158, 0.00107008, 7.24552914, 0.99463317, 0.99717834, 0.49205913],
+                             [- 6.24736775, -0.00175062, 0.00106951, 7.24561712, 0.99463617, 0.99717987, 0.49206204],
+                             [- 6.24745446, -0.00174966, 0.00106893, 7.24570479, 0.99463915, 0.99718141, 0.49206494],
+                             [- 6.24754086, -0.00174870, 0.00106836, 7.24579216, 0.99464214, 0.99718294, 0.49206783],
+                             [- 6.24762695, -0.00174774, 0.00106779, 7.24587921, 0.99464512, 0.99718447, 0.49207072],
+                             [- 6.24771274, -0.00174678, 0.00106722, 7.24596596, 0.99464810, 0.99718600, 0.49207359],
+                             [- 6.24779823, -0.00174582, 0.00106665, 7.24605241, 0.99465108, 0.99718753, 0.49207645],
+                             [- 6.24788341, -0.00174487, 0.00106608, 7.24613854, 0.99465405, 0.99718905, 0.49207931],
+                             [- 6.24796829, -0.00174391, 0.00106551, 7.24622438, 0.99465702, 0.99719058, 0.49208216],
+                             [- 6.24805287, -0.00174296, 0.00106494, 7.24630991, 0.99465998, 0.99719210, 0.49208499],
+                             [- 6.24813715, -0.00174200, 0.00106438, 7.24639515, 0.99466295, 0.99719362, 0.49208783],
+                             [- 6.24822113, -0.00174105, 0.00106381, 7.24648008, 0.99466591, 0.99719514, 0.49209064],
+                             [- 6.24830481, -0.00174010, 0.00106324, 7.24656471, 0.99466886, 0.99719666, 0.49209345],
+                             [- 6.24838819, -0.00173915, 0.00106267, 7.24664905, 0.99467182, 0.99719818, 0.49209625],
+                             [- 6.24847128, -0.00173819, 0.00106211, 7.24673309, 0.99467477, 0.99719970, 0.49209904],
+                             [- 6.24855407, -0.00173725, 0.00106154, 7.24681683, 0.99467771, 0.99720121, 0.49210182],
+                             [- 6.24863657, -0.00173630, 0.00106098, 7.24690027, 0.99468066, 0.99720272, 0.49210459],
+                             [- 6.24871878, -0.00173535, 0.00106041, 7.24698343, 0.99468360, 0.99720424, 0.49210735],
+                             [- 6.24880069, -0.00173440, 0.00105985, 7.24706629, 0.99468654, 0.99720575, 0.49211010],
+                             [- 6.24888231, -0.00173346, 0.00105929, 7.24714886, 0.99468947, 0.99720725, 0.49211286],
+                             [- 6.24896365, -0.00173251, 0.00105872, 7.24723113, 0.99469240, 0.99720876, 0.49211559],
+                             [- 6.24904469, -0.00173157, 0.00105816, 7.24731312, 0.99469533, 0.99721027, 0.49211832],
+                             [- 6.24912545, -0.00173063, 0.00105760, 7.24739482, 0.99469826, 0.99721177, 0.49212104],
+                             [- 6.24920591, -0.00172969, 0.00105704, 7.24747623, 0.99470118, 0.99721327, 0.49212375],
+                             [- 6.24928610, -0.00172875, 0.00105648, 7.24755735, 0.99470410, 0.99721478, 0.49212645],
+                             [- 6.24936599, -0.00172781, 0.00105592, 7.24763819, 0.99470702, 0.99721628, 0.49212915],
+                             [- 6.24944561, -0.00172687, 0.00105536, 7.24771874, 0.99470993, 0.99721777, 0.49213183],
+                             [- 6.24952494, -0.00172593, 0.00105480, 7.24779901, 0.99471284, 0.99721927, 0.49213451],
+                             [- 6.24960399, -0.00172499, 0.00105424, 7.24787899, 0.99471575, 0.99722077, 0.49213717],
+                             [- 6.24968275, -0.00172406, 0.00105368, 7.24795870, 0.99471865, 0.99722226, 0.49213983],
+                             [- 6.24976124, -0.00172312, 0.00105312, 7.24803812, 0.99472155, 0.99722375, 0.49214248],
+                             [- 6.24983945, -0.00172219, 0.00105257, 7.24811726, 0.99472445, 0.99722524, 0.49214512],
+                             [- 6.24991738, -0.00172126, 0.00105201, 7.24819612, 0.99472735, 0.99722673, 0.49214776],
+                             [- 6.24999503, -0.00172032, 0.00105145, 7.24827471, 0.99473024, 0.99722822, 0.49215038],
+                             [- 6.25007241, -0.00171939, 0.00105090, 7.24835302, 0.99473313, 0.99722971, 0.49215299],
+                             [- 6.25014951, -0.00171846, 0.00105034, 7.24843105, 0.99473601, 0.99723119, 0.49215561],
+                             [- 6.25022634, -0.00171753, 0.00104979, 7.24850880, 0.99473890, 0.99723268, 0.49215820],
+                             [- 6.25030289, -0.00171660, 0.00104923, 7.24858628, 0.99474178, 0.99723416, 0.49216079],
+                             [- 6.25037917, -0.00171568, 0.00104868, 7.24866349, 0.99474465, 0.99723564, 0.49216338],
+                             [- 6.25045518, -0.00171475, 0.00104813, 7.24874043, 0.99474753, 0.99723712, 0.49216595],
+                             [- 6.25053092, -0.00171382, 0.00104758, 7.24881709, 0.99475040, 0.99723860, 0.49216851],
+                             [- 6.25060639, -0.00171290, 0.00104702, 7.24889349, 0.99475327, 0.99724008, 0.49217106],
+                             [- 6.25068159, -0.00171198, 0.00104647, 7.24896961, 0.99475613, 0.99724155, 0.49217362],
+                             [- 6.25075652, -0.00171105, 0.00104592, 7.24904547, 0.99475899, 0.99724303, 0.49217616],
+                             [- 6.25083119, -0.00171013, 0.00104537, 7.24912106, 0.99476185, 0.99724450, 0.49217869],
+                             [- 6.25090559, -0.00170921, 0.00104482, 7.24919638, 0.99476471, 0.99724597, 0.49218121],
+                             [- 6.25097972, -0.00170829, 0.00104427, 7.24927143, 0.99476756, 0.99724744, 0.49218373],
+                             [- 6.25105359, -0.00170737, 0.00104372, 7.24934622, 0.99477041, 0.99724891, 0.49218624],
+                             [- 6.25112720, -0.00170645, 0.00104317, 7.24942075, 0.99477326, 0.99725037, 0.49218873],
+                             [- 6.25120055, -0.00170554, 0.00104262, 7.24949501, 0.99477610, 0.99725184, 0.49219122],
+                             [- 6.25127363, -0.00170462, 0.00104208, 7.24956901, 0.99477894, 0.99725330, 0.49219371],
+                             [- 6.25134646, -0.00170370, 0.00104153, 7.24964275, 0.99478178, 0.99725477, 0.49219618],
+                             [- 6.25141902, -0.00170279, 0.00104098, 7.24971623, 0.99478462, 0.99725623, 0.49219865],
+                             [- 6.25149133, -0.00170188, 0.00104044, 7.24978945, 0.99478745, 0.99725769, 0.49220112],
+                             [- 6.25156338, -0.00170096, 0.00103989, 7.24986241, 0.99479028, 0.99725915, 0.49220356],
+                             [- 6.25163517, -0.00170005, 0.00103935, 7.24993512, 0.99479311, 0.99726060, 0.49220600],
+                             [- 6.25170670, -0.00169914, 0.00103880, 7.25000756, 0.99479593, 0.99726206, 0.49220844],
+                             [- 6.25177798, -0.00169823, 0.00103826, 7.25007975, 0.99479875, 0.99726351, 0.49221087],
+                             [- 6.25184901, -0.00169732, 0.00103771, 7.25015169, 0.99480157, 0.99726496, 0.49221329],
+                             [- 6.25191978, -0.00169641, 0.00103717, 7.25022337, 0.99480438, 0.99726642, 0.49221570],
+                             [- 6.25199031, -0.00169551, 0.00103663, 7.25029480, 0.99480719, 0.99726787, 0.49221811],
+                             [- 6.25206057, -0.00169460, 0.00103609, 7.25036598, 0.99481000, 0.99726931, 0.49222050],
+                             [- 6.25213059, -0.00169369, 0.00103555, 7.25043690, 0.99481281, 0.99727076, 0.49222289],
+                             [- 6.25220036, -0.00169279, 0.00103500, 7.25050757, 0.99481561, 0.99727221, 0.49222527],
+                             [- 6.25226988, -0.00169189, 0.00103446, 7.25057800, 0.99481841, 0.99727365, 0.49222765],
+                             [- 6.25233916, -0.00169098, 0.00103392, 7.25064817, 0.99482121, 0.99727509, 0.49223001],
+                             [- 6.25240818, -0.00169008, 0.00103338, 7.25071810, 0.99482400, 0.99727653, 0.49223237],
+                             [- 6.25247696, -0.00168918, 0.00103285, 7.25078778, 0.99482680, 0.99727797, 0.49223472],
+                             [- 6.25254550, -0.00168828, 0.00103231, 7.25085722, 0.99482958, 0.99727941, 0.49223706],
+                             [- 6.25261379, -0.00168738, 0.00103177, 7.25092640, 0.99483237, 0.99728085, 0.49223939],
+                             [- 6.25268183, -0.00168648, 0.00103123, 7.25099535, 0.99483515, 0.99728229, 0.49224172],
+                             [- 6.25274963, -0.00168559, 0.00103069, 7.25106405, 0.99483793, 0.99728372, 0.49224404],
+                             [- 6.25281720, -0.00168469, 0.00103016, 7.25113251, 0.99484071, 0.99728515, 0.49224636],
+                             [- 6.25288452, -0.00168379, 0.00102962, 7.25120072, 0.99484348, 0.99728659, 0.49224866],
+                             [- 6.25295160, -0.00168290, 0.00102909, 7.25126870, 0.99484626, 0.99728802, 0.49225097],
+                             [- 6.25301844, -0.00168200, 0.00102855, 7.25133643, 0.99484902, 0.99728945, 0.49225325],
+                             [- 6.25308504, -0.00168111, 0.00102802, 7.25140393, 0.99485179, 0.99729087, 0.49225553],
+                             [- 6.25315140, -0.00168022, 0.00102748, 7.25147118, 0.99485455, 0.99729230, 0.49225780],
+                             [- 6.25321753, -0.00167933, 0.00102695, 7.25153820, 0.99485731, 0.99729372, 0.49226008],
+                             [- 6.25328342, -0.00167844, 0.00102641, 7.25160498, 0.99486007, 0.99729515, 0.49226233],
+                             [- 6.25334907, -0.00167755, 0.00102588, 7.25167153, 0.99486282, 0.99729657, 0.49226459],
+                             [- 6.25341450, -0.00167666, 0.00102535, 7.25173784, 0.99486558, 0.99729799, 0.49226684],
+                             [- 6.25347968, -0.00167577, 0.00102482, 7.25180391, 0.99486832, 0.99729941, 0.49226907],
+                             [- 6.25354464, -0.00167489, 0.00102429, 7.25186975, 0.99487107, 0.99730083, 0.49227131],
+                             [- 6.25360936, -0.00167400, 0.00102376, 7.25193536, 0.99487381, 0.99730224, 0.49227354],
+                             [- 6.25367385, -0.00167312, 0.00102323, 7.25200074, 0.99487655, 0.99730366, 0.49227575],
+                             [- 6.25373811, -0.00167223, 0.00102270, 7.25206588, 0.99487929, 0.99730507, 0.49227796],
+                             [- 6.25380215, -0.00167135, 0.00102217, 7.25213080, 0.99488202, 0.99730649, 0.49228016],
+                             [- 6.25386595, -0.00167047, 0.00102164, 7.25219548, 0.99488476, 0.99730790, 0.49228236],
+                             [- 6.25392952, -0.00166958, 0.00102111, 7.25225994, 0.99488749, 0.99730931, 0.49228455],
+                             [- 6.25399287, -0.00166870, 0.00102058, 7.25232417, 0.99489021, 0.99731072, 0.49228673],
+                             [- 6.25405599, -0.00166782, 0.00102005, 7.25238817, 0.99489294, 0.99731212, 0.49228892],
+                             [- 6.25411889, -0.00166694, 0.00101953, 7.25245194, 0.99489566, 0.99731353, 0.49229108],
+                             [- 6.25418156, -0.00166607, 0.00101900, 7.25251549, 0.99489837, 0.99731493, 0.49229324],
+                             [- 6.25424401, -0.00166519, 0.00101847, 7.25257882, 0.99490109, 0.99731634, 0.49229539],
+                             [- 6.25430623, -0.00166431, 0.00101795, 7.25264192, 0.99490380, 0.99731774, 0.49229754],
+                             [- 6.25436823, -0.00166344, 0.00101742, 7.25270479, 0.99490651, 0.99731914, 0.49229968],
+                             [- 6.25443001, -0.00166256, 0.00101690, 7.25276745, 0.99490922, 0.99732054, 0.49230182],
+                             [- 6.25449157, -0.00166169, 0.00101638, 7.25282988, 0.99491192, 0.99732194, 0.49230394],
+                             [- 6.25455291, -0.00166082, 0.00101585, 7.25289209, 0.99491462, 0.99732333, 0.49230606],
+                             [- 6.25461403, -0.00165994, 0.00101533, 7.25295408, 0.99491732, 0.99732473, 0.49230817],
+                             [- 6.25467493, -0.00165907, 0.00101481, 7.25301586, 0.99492002, 0.99732612, 0.49231027],
+                             [- 6.25473561, -0.00165820, 0.00101428, 7.25307741, 0.99492271, 0.99732751, 0.49231238],
+                             [- 6.25479608, -0.00165733, 0.00101376, 7.25313874, 0.99492540, 0.99732890, 0.49231446],
+                             [- 6.25485633, -0.00165647, 0.00101324, 7.25319986, 0.99492809, 0.99733029, 0.49231656],
+                             [- 6.25491636, -0.00165560, 0.00101272, 7.25326076, 0.99493077, 0.99733168, 0.49231863],
+                             [- 6.25497618, -0.00165473, 0.00101220, 7.25332145, 0.99493345, 0.99733307, 0.49232070],
+                             [- 6.25503579, -0.00165386, 0.00101168, 7.25338192, 0.99493613, 0.99733445, 0.49232277],
+                             [- 6.25509518, -0.00165300, 0.00101116, 7.25344218, 0.99493881, 0.99733584, 0.49232483],
+                             [- 6.25515436, -0.00165214, 0.00101064, 7.25350222, 0.99494148, 0.99733722, 0.49232688],
+                             [- 6.25521333, -0.00165127, 0.00101012, 7.25356206, 0.99494415, 0.99733860, 0.49232894],
+                             [- 6.25527209, -0.00165041, 0.00100961, 7.25362168, 0.99494682, 0.99733998, 0.49233097],
+                             [- 6.25533063, -0.00164955, 0.00100909, 7.25368108, 0.99494949, 0.99734136, 0.49233301],
+                             [- 6.25538897, -0.00164869, 0.00100857, 7.25374028, 0.99495215, 0.99734274, 0.49233504],
+                             [- 6.25544710, -0.00164783, 0.00100806, 7.25379927, 0.99495481, 0.99734412, 0.49233704],
+                             [- 6.25550502, -0.00164697, 0.00100754, 7.25385805, 0.99495747, 0.99734549, 0.49233906],
+                             [- 6.25556273, -0.00164611, 0.00100702, 7.25391662, 0.99496012, 0.99734687, 0.49234107],
+                             [- 6.25562024, -0.00164525, 0.00100651, 7.25397499, 0.99496278, 0.99734824, 0.49234308],
+                             [- 6.25567754, -0.00164440, 0.00100599, 7.25403314, 0.99496543, 0.99734961, 0.49234506],
+                             [- 6.25573464, -0.00164354, 0.00100548, 7.25409110, 0.99496807, 0.99735098, 0.49234706],
+                             [- 6.25579153, -0.00164268, 0.00100497, 7.25414884, 0.99497072, 0.99735235, 0.49234904],
+                             [- 6.25584821, -0.00164183, 0.00100445, 7.25420638, 0.99497336, 0.99735372, 0.49235101],
+                             [- 6.25590470, -0.00164098, 0.00100394, 7.25426372, 0.99497600, 0.99735508, 0.49235297],
+                             [- 6.25596098, -0.00164012, 0.00100343, 7.25432086, 0.99497863, 0.99735645, 0.49235495],
+                             [- 6.25601706, -0.00163927, 0.00100292, 7.25437779, 0.99498127, 0.99735781, 0.49235690],
+                             [- 6.25607294, -0.00163842, 0.00100241, 7.25443452, 0.99498390, 0.99735917, 0.49235884],
+                             [- 6.25612862, -0.00163757, 0.00100189, 7.25449105, 0.99498652, 0.99736053, 0.49236079],
+                             [- 6.25618410, -0.00163672, 0.00100138, 7.25454738, 0.99498915, 0.99736189, 0.49236272],
+                             [- 6.25623938, -0.00163587, 0.00100087, 7.25460351, 0.99499177, 0.99736325, 0.49236466],
+                             [- 6.25629447, -0.00163503, 0.00100036, 7.25465944, 0.99499439, 0.99736461, 0.49236658],
+                             [- 6.25634936, -0.00163418, 0.00099986, 7.25471518, 0.99499701, 0.99736596, 0.49236850],
+                             [- 6.25640405, -0.00163333, 0.00099935, 7.25477071, 0.99499963, 0.99736732, 0.49237042],
+                             [- 6.25645854, -0.00163249, 0.00099884, 7.25482605, 0.99500224, 0.99736867, 0.49237232],
+                             [- 6.25651284, -0.00163164, 0.00099833, 7.25488119, 0.99500485, 0.99737002, 0.49237422],
+                             [- 6.25656694, -0.00163080, 0.00099782, 7.25493614, 0.99500745, 0.99737137, 0.49237612],
+                             [- 6.25662085, -0.00162996, 0.00099732, 7.25499089, 0.99501006, 0.99737272, 0.49237800],
+                             [- 6.25667457, -0.00162912, 0.00099681, 7.25504545, 0.99501266, 0.99737407, 0.49237989],
+                             [- 6.25672809, -0.00162828, 0.00099631, 7.25509982, 0.99501526, 0.99737542, 0.49238176],
+                             [- 6.25678143, -0.00162744, 0.00099580, 7.25515399, 0.99501786, 0.99737676, 0.49238364],
+                             [- 6.25683457, -0.00162660, 0.00099530, 7.25520797, 0.99502045, 0.99737811, 0.49238550],
+                             [- 6.25688752, -0.00162576, 0.00099479, 7.25526176, 0.99502304, 0.99737945, 0.49238736],
+                             [- 6.25694028, -0.00162492, 0.00099429, 7.25531536, 0.99502563, 0.99738079, 0.49238921],
+                             [- 6.25699285, -0.00162408, 0.00099378, 7.25536877, 0.99502822, 0.99738213, 0.49239105],
+                             [- 6.25704524, -0.00162325, 0.00099328, 7.25542199, 0.99503080, 0.99738347, 0.49239289],
+                             [- 6.25709743, -0.00162241, 0.00099278, 7.25547502, 0.99503338, 0.99738481, 0.49239473],
+                             [- 6.25714944, -0.00162158, 0.00099228, 7.25552786, 0.99503596, 0.99738615, 0.49239656],
+                             [- 6.25720127, -0.00162074, 0.00099177, 7.25558052, 0.99503853, 0.99738748, 0.49239838],
+                             [- 6.25725290, -0.00161991, 0.00099127, 7.25563299, 0.99504111, 0.99738881, 0.49240020],
+                             [- 6.25730435, -0.00161908, 0.00099077, 7.25568527, 0.99504368, 0.99739015, 0.49240201],
+                             [- 6.25735562, -0.00161825, 0.00099027, 7.25573737, 0.99504625, 0.99739148, 0.49240381],
+                             [- 6.25740670, -0.00161742, 0.00098977, 7.25578929, 0.99504881, 0.99739281, 0.49240561],
+                             [- 6.25745761, -0.00161659, 0.00098927, 7.25584102, 0.99505137, 0.99739414, 0.49240741],
+                             [- 6.25750832, -0.00161576, 0.00098877, 7.25589256, 0.99505393, 0.99739547, 0.49240919],
+                             [- 6.25755886, -0.00161493, 0.00098828, 7.25594393, 0.99505649, 0.99739679, 0.49241098],
+                             [- 6.25760921, -0.00161411, 0.00098778, 7.25599511, 0.99505905, 0.99739812, 0.49241276],
+                             [- 6.25765939, -0.00161328, 0.00098728, 7.25604611, 0.99506160, 0.99739944, 0.49241453],
+                             [- 6.25770938, -0.00161245, 0.00098678, 7.25609693, 0.99506415, 0.99740076, 0.49241630],
+                             [- 6.25775920, -0.00161163, 0.00098629, 7.25614757, 0.99506670, 0.99740209, 0.49241806],
+                             [- 6.25780883, -0.00161080, 0.00098579, 7.25619803, 0.99506924, 0.99740341, 0.49241981],
+                             [- 6.25785829, -0.00160998, 0.00098529, 7.25624831, 0.99507179, 0.99740472, 0.49242156],
+                             [- 6.25790757, -0.00160916, 0.00098480, 7.25629841, 0.99507433, 0.99740604, 0.49242330],
+                             [- 6.25795667, -0.00160834, 0.00098430, 7.25634834, 0.99507686, 0.99740736, 0.49242504],
+                             [- 6.25800560, -0.00160752, 0.00098381, 7.25639808, 0.99507940, 0.99740867, 0.49242678],
+                             [- 6.25805435, -0.00160670, 0.00098332, 7.25644766, 0.99508193, 0.99740999, 0.49242849],
+                             [- 6.25810293, -0.00160588, 0.00098282, 7.25649705, 0.99508446, 0.99741130, 0.49243022],
+                             [- 6.25815133, -0.00160506, 0.00098233, 7.25654627, 0.99508699, 0.99741261, 0.49243193],
+                             [- 6.25819956, -0.00160424, 0.00098184, 7.25659532, 0.99508951, 0.99741392, 0.49243365],
+                             [- 6.25824762, -0.00160342, 0.00098134, 7.25664419, 0.99509203, 0.99741523, 0.49243535],
+                             [- 6.25829550, -0.00160261, 0.00098085, 7.25669289, 0.99509455, 0.99741654, 0.49243704],
+                             [- 6.25834321, -0.00160179, 0.00098036, 7.25674142, 0.99509707, 0.99741784, 0.49243875],
+                             [- 6.25839075, -0.00160098, 0.00097987, 7.25678978, 0.99509959, 0.99741915, 0.49244043],
+                             [- 6.25843812, -0.00160017, 0.00097938, 7.25683796, 0.99510210, 0.99742045, 0.49244213],
+                             [- 6.25848532, -0.00159935, 0.00097889, 7.25688597, 0.99510461, 0.99742176, 0.49244379],
+                             [- 6.25853235, -0.00159854, 0.00097840, 7.25693381, 0.99510712, 0.99742306, 0.49244547],
+                             [- 6.25857922, -0.00159773, 0.00097791, 7.25698149, 0.99510962, 0.99742436, 0.49244714],
+                             [- 6.25862591, -0.00159692, 0.00097742, 7.25702899, 0.99511212, 0.99742566, 0.49244880],
+                             [- 6.25867244, -0.00159611, 0.00097693, 7.25707633, 0.99511462, 0.99742696, 0.49245046],
+                             [- 6.25871879, -0.00159530, 0.00097645, 7.25712350, 0.99511712, 0.99742825, 0.49245210],
+                             [- 6.25876499, -0.00159449, 0.00097596, 7.25717050, 0.99511962, 0.99742955, 0.49245376],
+                             [- 6.25881101, -0.00159368, 0.00097547, 7.25721733, 0.99512211, 0.99743084, 0.49245539],
+                             [- 6.25885688, -0.00159288, 0.00097499, 7.25726400, 0.99512460, 0.99743214, 0.49245702],
+                             [- 6.25890257, -0.00159207, 0.00097450, 7.25731050, 0.99512709, 0.99743343, 0.49245866],
+                             [- 6.25894810, -0.00159127, 0.00097402, 7.25735684, 0.99512957, 0.99743472, 0.49246028],
+                             [- 6.25899347, -0.00159046, 0.00097353, 7.25740301, 0.99513205, 0.99743601, 0.49246190],
+                             [- 6.25903868, -0.00158966, 0.00097305, 7.25744902, 0.99513453, 0.99743730, 0.49246352],
+                             [- 6.25908372, -0.00158886, 0.00097256, 7.25749487, 0.99513701, 0.99743858, 0.49246513],
+                             [- 6.25912861, -0.00158805, 0.00097208, 7.25754055, 0.99513949, 0.99743987, 0.49246673],
+                             [- 6.25917333, -0.00158725, 0.00097159, 7.25758607, 0.99514196, 0.99744115, 0.49246833],
+                             [- 6.25921789, -0.00158645, 0.00097111, 7.25763144, 0.99514443, 0.99744244, 0.49246993],
+                             [- 6.25926229, -0.00158565, 0.00097063, 7.25767664, 0.99514690, 0.99744372, 0.49247152],
+                             [- 6.25930653, -0.00158485, 0.00097015, 7.25772168, 0.99514936, 0.99744500, 0.49247309],
+                             [- 6.25935061, -0.00158406, 0.00096966, 7.25776656, 0.99515183, 0.99744628, 0.49247468],
+                             [- 6.25939453, -0.00158326, 0.00096918, 7.25781128, 0.99515429, 0.99744756, 0.49247625],
+                             [- 6.25943830, -0.00158246, 0.00096870, 7.25785584, 0.99515675, 0.99744884, 0.49247782],
+                             [- 6.25948191, -0.00158167, 0.00096822, 7.25790024, 0.99515920, 0.99745011, 0.49247939],
+                             [- 6.25952536, -0.00158087, 0.00096774, 7.25794449, 0.99516165, 0.99745139, 0.49248095],
+                             [- 6.25956866, -0.00158008, 0.00096726, 7.25798858, 0.99516411, 0.99745266, 0.49248251],
+                             [- 6.25961180, -0.00157928, 0.00096678, 7.25803252, 0.99516655, 0.99745393, 0.49248405],
+                             [- 6.25965478, -0.00157849, 0.00096631, 7.25807629, 0.99516900, 0.99745521, 0.49248560],
+                             [- 6.25969761, -0.00157770, 0.00096583, 7.25811992, 0.99517144, 0.99745648, 0.49248715],
+                             [- 6.25974029, -0.00157691, 0.00096535, 7.25816339, 0.99517389, 0.99745774, 0.49248867],
+                             [- 6.25978282, -0.00157612, 0.00096487, 7.25820670, 0.99517633, 0.99745901, 0.49249021],
+                             [- 6.25982519, -0.00157533, 0.00096440, 7.25824986, 0.99517876, 0.99746028, 0.49249174],
+                             [- 6.25986741, -0.00157454, 0.00096392, 7.25829287, 0.99518120, 0.99746154, 0.49249325],
+                             [- 6.25990947, -0.00157375, 0.00096344, 7.25833572, 0.99518363, 0.99746281, 0.49249477],
+                             [- 6.25995139, -0.00157296, 0.00096297, 7.25837843, 0.99518606, 0.99746407, 0.49249628],
+                             [- 6.25999315, -0.00157217, 0.00096249, 7.25842098, 0.99518848, 0.99746533, 0.49249779],
+                             [- 6.26003477, -0.00157139, 0.00096202, 7.25846338, 0.99519091, 0.99746659, 0.49249929],
+                             [- 6.26007624, -0.00157060, 0.00096154, 7.25850563, 0.99519333, 0.99746785, 0.49250079],
+                             [- 6.26011755, -0.00156982, 0.00096107, 7.25854773, 0.99519575, 0.99746911, 0.49250228],
+                             [- 6.26015872, -0.00156903, 0.00096060, 7.25858969, 0.99519817, 0.99747037, 0.49250377],
+                             [- 6.26019974, -0.00156825, 0.00096012, 7.25863149, 0.99520058, 0.99747163, 0.49250524],
+                             [- 6.26024061, -0.00156747, 0.00095965, 7.25867315, 0.99520300, 0.99747288, 0.49250672],
+                             [- 6.26028134, -0.00156669, 0.00095918, 7.25871465, 0.99520541, 0.99747414, 0.49250819],
+                             [- 6.26032192, -0.00156591, 0.00095871, 7.25875601, 0.99520782, 0.99747539, 0.49250967],
+                             [- 6.26036235, -0.00156513, 0.00095823, 7.25879723, 0.99521022, 0.99747664, 0.49251114],
+                             [- 6.26040264, -0.00156435, 0.00095776, 7.25883830, 0.99521263, 0.99747789, 0.49251259],
+                             [- 6.26044279, -0.00156357, 0.00095729, 7.25887922, 0.99521503, 0.99747914, 0.49251404],
+                             [- 6.26048279, -0.00156279, 0.00095682, 7.25892000, 0.99521743, 0.99748039, 0.49251549],
+                             [- 6.26052264, -0.00156201, 0.00095635, 7.25896063, 0.99521982, 0.99748163, 0.49251694],
+                             [- 6.26056235, -0.00156124, 0.00095588, 7.25900112, 0.99522222, 0.99748288, 0.49251838],
+                             [- 6.26060192, -0.00156046, 0.00095542, 7.25904146, 0.99522461, 0.99748412, 0.49251982],
+                             [- 6.26064135, -0.00155969, 0.00095495, 7.25908167, 0.99522700, 0.99748537, 0.49252125],
+                             [- 6.26068064, -0.00155891, 0.00095448, 7.25912173, 0.99522939, 0.99748661, 0.49252269],
+                             [- 6.26071978, -0.00155814, 0.00095401, 7.25916164, 0.99523177, 0.99748785, 0.49252410],
+                             [- 6.26075879, -0.00155737, 0.00095354, 7.25920142, 0.99523415, 0.99748909, 0.49252552],
+                             [- 6.26079765, -0.00155659, 0.00095308, 7.25924106, 0.99523653, 0.99749033, 0.49252694],
+                             [- 6.26083637, -0.00155582, 0.00095261, 7.25928055, 0.99523891, 0.99749157, 0.49252834],
+                             [- 6.26087496, -0.00155505, 0.00095215, 7.25931991, 0.99524129, 0.99749280, 0.49252975],
+                             [- 6.26091341, -0.00155428, 0.00095168, 7.25935912, 0.99524366, 0.99749404, 0.49253116],
+                             [- 6.26095171, -0.00155351, 0.00095122, 7.25939820, 0.99524603, 0.99749527, 0.49253255],
+                             [- 6.26098988, -0.00155274, 0.00095075, 7.25943714, 0.99524840, 0.99749651, 0.49253394],
+                             [- 6.26102792, -0.00155198, 0.00095029, 7.25947594, 0.99525077, 0.99749774, 0.49253533],
+                             [- 6.26106581, -0.00155121, 0.00094982, 7.25951460, 0.99525313, 0.99749897, 0.49253672],
+                             [- 6.26110357, -0.00155044, 0.00094936, 7.25955313, 0.99525549, 0.99750020, 0.49253810],
+                             [- 6.26114120, -0.00154968, 0.00094890, 7.25959152, 0.99525785, 0.99750143, 0.49253947],
+                             [- 6.26117869, -0.00154891, 0.00094843, 7.25962977, 0.99526021, 0.99750265, 0.49254085],
+                             [- 6.26121604, -0.00154815, 0.00094797, 7.25966789, 0.99526256, 0.99750388, 0.49254220],
+                             [- 6.26125326, -0.00154739, 0.00094751, 7.25970587, 0.99526492, 0.99750510, 0.49254357],
+                             [- 6.26129035, -0.00154662, 0.00094705, 7.25974372, 0.99526727, 0.99750633, 0.49254493],
+                             [- 6.26132730, -0.00154586, 0.00094659, 7.25978144, 0.99526962, 0.99750755, 0.49254628],
+                             [- 6.26136412, -0.00154510, 0.00094613, 7.25981902, 0.99527196, 0.99750877, 0.49254763],
+                             [- 6.26140081, -0.00154434, 0.00094567, 7.25985647, 0.99527431, 0.99750999, 0.49254897],
+                             [- 6.26143736, -0.00154358, 0.00094521, 7.25989378, 0.99527665, 0.99751121, 0.49255032],
+                             [- 6.26147379, -0.00154282, 0.00094475, 7.25993097, 0.99527899, 0.99751243, 0.49255166],
+                             [- 6.26151008, -0.00154206, 0.00094429, 7.25996802, 0.99528132, 0.99751365, 0.49255299],
+                             [- 6.26154624, -0.00154131, 0.00094383, 7.26000494, 0.99528366, 0.99751486, 0.49255432],
+                             [- 6.26158228, -0.00154055, 0.00094337, 7.26004173, 0.99528599, 0.99751608, 0.49255564],
+                             [- 6.26161818, -0.00153979, 0.00094292, 7.26007839, 0.99528832, 0.99751729, 0.49255696],
+                             [- 6.26165395, -0.00153904, 0.00094246, 7.26011492, 0.99529065, 0.99751851, 0.49255828],
+                             [- 6.26168960, -0.00153828, 0.00094200, 7.26015132, 0.99529297, 0.99751972, 0.49255958],
+                             [- 6.26172512, -0.00153753, 0.00094155, 7.26018759, 0.99529530, 0.99752093, 0.49256090],
+                             [- 6.26176051, -0.00153677, 0.00094109, 7.26022373, 0.99529762, 0.99752214, 0.49256219],
+                             [- 6.26179577, -0.00153602, 0.00094063, 7.26025975, 0.99529994, 0.99752334, 0.49256349],
+                             [- 6.26183090, -0.00153527, 0.00094018, 7.26029563, 0.99530226, 0.99752455, 0.49256478],
+                             [- 6.26186591, -0.00153452, 0.00093972, 7.26033139, 0.99530457, 0.99752576, 0.49256609],
+                             [- 6.26190080, -0.00153377, 0.00093927, 7.26036703, 0.99530688, 0.99752696, 0.49256738],
+                             [- 6.26193555, -0.00153302, 0.00093882, 7.26040254, 0.99530919, 0.99752817, 0.49256866],
+                             [- 6.26197019, -0.00153227, 0.00093836, 7.26043792, 0.99531150, 0.99752937, 0.49256993],
+                             [- 6.26200470, -0.00153152, 0.00093791, 7.26047317, 0.99531381, 0.99753057, 0.49257121],
+                             [- 6.26203908, -0.00153077, 0.00093746, 7.26050831, 0.99531611, 0.99753177, 0.49257249],
+                             [- 6.26207334, -0.00153003, 0.00093700, 7.26054331, 0.99531841, 0.99753297, 0.49257375],
+                             [- 6.26210748, -0.00152928, 0.00093655, 7.26057820, 0.99532071, 0.99753417, 0.49257501],
+                             [- 6.26214149, -0.00152853, 0.00093610, 7.26061296, 0.99532301, 0.99753537, 0.49257629],
+                             [- 6.26217539, -0.00152779, 0.00093565, 7.26064760, 0.99532530, 0.99753656, 0.49257754],
+                             [- 6.26220916, -0.00152705, 0.00093520, 7.26068211, 0.99532759, 0.99753776, 0.49257879],
+                             [- 6.26224280, -0.00152630, 0.00093475, 7.26071650, 0.99532988, 0.99753895, 0.49258003],
+                             [- 6.26227633, -0.00152556, 0.00093430, 7.26075077, 0.99533217, 0.99754014, 0.49258128],
+                             [- 6.26230974, -0.00152482, 0.00093385, 7.26078492, 0.99533446, 0.99754133, 0.49258252],
+                             [- 6.26234303, -0.00152408, 0.00093340, 7.26081895, 0.99533674, 0.99754253, 0.49258376],
+                             [- 6.26237620, -0.00152333, 0.00093295, 7.26085286, 0.99533902, 0.99754372, 0.49258498],
+                             [- 6.26240924, -0.00152259, 0.00093250, 7.26088665, 0.99534130, 0.99754490, 0.49258622],
+                             [- 6.26244217, -0.00152186, 0.00093205, 7.26092032, 0.99534358, 0.99754609, 0.49258745],
+                             [- 6.26247499, -0.00152112, 0.00093161, 7.26095387, 0.99534586, 0.99754728, 0.49258868],
+                             [- 6.26250768, -0.00152038, 0.00093116, 7.26098730, 0.99534813, 0.99754846, 0.49258989],
+                             [- 6.26254025, -0.00151964, 0.00093071, 7.26102061, 0.99535040, 0.99754965, 0.49259110],
+                             [- 6.26257271, -0.00151890, 0.00093027, 7.26105381, 0.99535267, 0.99755083, 0.49259230],
+                             [- 6.26260505, -0.00151817, 0.00092982, 7.26108689, 0.99535493, 0.99755201, 0.49259351],
+                             [- 6.26263728, -0.00151743, 0.00092937, 7.26111985, 0.99535720, 0.99755319, 0.49259471],
+                             [- 6.26266939, -0.00151670, 0.00092893, 7.26115269, 0.99535946, 0.99755437, 0.49259592],
+                             [- 6.26270138, -0.00151596, 0.00092848, 7.26118542, 0.99536172, 0.99755555, 0.49259711],
+                             [- 6.26273326, -0.00151523, 0.00092804, 7.26121803, 0.99536398, 0.99755673, 0.49259829],
+                             [- 6.26276503, -0.00151450, 0.00092760, 7.26125053, 0.99536623, 0.99755790, 0.49259950],
+                             [- 6.26279668, -0.00151377, 0.00092715, 7.26128291, 0.99536849, 0.99755908, 0.49260067],
+                             [- 6.26282822, -0.00151304, 0.00092671, 7.26131518, 0.99537074, 0.99756025, 0.49260186],
+                             [- 6.26285964, -0.00151231, 0.00092627, 7.26134733, 0.99537299, 0.99756143, 0.49260303],
+                             [- 6.26289095, -0.00151158, 0.00092582, 7.26137937, 0.99537524, 0.99756260, 0.49260421],
+                             [- 6.26292215, -0.00151085, 0.00092538, 7.26141130, 0.99537748, 0.99756377, 0.49260538],
+                             [- 6.26295323, -0.00151012, 0.00092494, 7.26144311, 0.99537972, 0.99756494, 0.49260653],
+                             [- 6.26298421, -0.00150939, 0.00092450, 7.26147481, 0.99538196, 0.99756611, 0.49260770],
+                             [- 6.26301507, -0.00150866, 0.00092406, 7.26150640, 0.99538420, 0.99756728, 0.49260887],
+                             [- 6.26304582, -0.00150794, 0.00092362, 7.26153788, 0.99538644, 0.99756844, 0.49261002],
+                             [- 6.26307646, -0.00150721, 0.00092318, 7.26156925, 0.99538867, 0.99756961, 0.49261117],
+                             [- 6.26310699, -0.00150649, 0.00092274, 7.26160050, 0.99539091, 0.99757078, 0.49261231],
+                             [- 6.26313741, -0.00150576, 0.00092230, 7.26163165, 0.99539314, 0.99757194, 0.49261347],
+                             [- 6.26316772, -0.00150504, 0.00092186, 7.26166269, 0.99539536, 0.99757310, 0.49261461],
+                             [- 6.26319793, -0.00150431, 0.00092142, 7.26169361, 0.99539759, 0.99757426, 0.49261575],
+                             [- 6.26322802, -0.00150359, 0.00092098, 7.26172443, 0.99539981, 0.99757542, 0.49261688],
+                             [- 6.26325801, -0.00150287, 0.00092055, 7.26175513, 0.99540204, 0.99757658, 0.49261801],
+                             [- 6.26328788, -0.00150215, 0.00092011, 7.26178573, 0.99540426, 0.99757774, 0.49261913],
+                             [- 6.26331765, -0.00150143, 0.00091967, 7.26181623, 0.99540647, 0.99757890, 0.49262025],
+                             [- 6.26334732, -0.00150071, 0.00091924, 7.26184661, 0.99540869, 0.99758006, 0.49262138],
+                             [- 6.26337687, -0.00149999, 0.00091880, 7.26187688, 0.99541090, 0.99758121, 0.49262250],
+                             [- 6.26340633, -0.00149927, 0.00091836, 7.26190705, 0.99541311, 0.99758236, 0.49262361],
+                             [- 6.26343567, -0.00149855, 0.00091793, 7.26193712, 0.99541532, 0.99758352, 0.49262472],
+                             [- 6.26346491, -0.00149784, 0.00091749, 7.26196707, 0.99541753, 0.99758467, 0.49262583],
+                             [- 6.26349404, -0.00149712, 0.00091706, 7.26199692, 0.99541974, 0.99758582, 0.49262693],
+                             [- 6.26352307, -0.00149640, 0.00091662, 7.26202667, 0.99542194, 0.99758697, 0.49262803],
+                             [- 6.26355200, -0.00149569, 0.00091619, 7.26205631, 0.99542414, 0.99758812, 0.49262913],
+                             [- 6.26358082, -0.00149498, 0.00091576, 7.26208585, 0.99542634, 0.99758927, 0.49263021],
+                             [- 6.26360954, -0.00149426, 0.00091532, 7.26211528, 0.99542854, 0.99759042, 0.49263131],
+                             [- 6.26363815, -0.00149355, 0.00091489, 7.26214460, 0.99543073, 0.99759156, 0.49263239],
+                             [- 6.26366666, -0.00149284, 0.00091446, 7.26217383, 0.99543292, 0.99759271, 0.49263348],
+                             [- 6.26369507, -0.00149212, 0.00091403, 7.26220295, 0.99543511, 0.99759385, 0.49263456],
+                             [- 6.26372338, -0.00149141, 0.00091359, 7.26223197, 0.99543730, 0.99759499, 0.49263563],
+                             [- 6.26375159, -0.00149070, 0.00091316, 7.26226088, 0.99543949, 0.99759613, 0.49263671],
+                             [- 6.26377969, -0.00148999, 0.00091273, 7.26228970, 0.99544167, 0.99759728, 0.49263778],
+                             [- 6.26380769, -0.00148928, 0.00091230, 7.26231841, 0.99544386, 0.99759841, 0.49263884],
+                             [- 6.26383560, -0.00148857, 0.00091187, 7.26234702, 0.99544604, 0.99759955, 0.49263991],
+                             [- 6.26386340, -0.00148787, 0.00091144, 7.26237553, 0.99544821, 0.99760069, 0.49264097],
+                             [- 6.26389110, -0.00148716, 0.00091101, 7.26240394, 0.99545039, 0.99760183, 0.49264203],
+                             [- 6.26391870, -0.00148645, 0.00091058, 7.26243225, 0.99545257, 0.99760296, 0.49264308],
+                             [- 6.26394621, -0.00148575, 0.00091016, 7.26246046, 0.99545474, 0.99760410, 0.49264413],
+                             [- 6.26397361, -0.00148504, 0.00090973, 7.26248857, 0.99545691, 0.99760523, 0.49264518],
+                             [- 6.26400092, -0.00148434, 0.00090930, 7.26251658, 0.99545908, 0.99760636, 0.49264622],
+                             [- 6.26402813, -0.00148363, 0.00090887, 7.26254449, 0.99546124, 0.99760750, 0.49264726],
+                             [- 6.26405524, -0.00148293, 0.00090844, 7.26257231, 0.99546341, 0.99760863, 0.49264830],
+                             [- 6.26408225, -0.00148223, 0.00090802, 7.26260002, 0.99546557, 0.99760976, 0.49264934],
+                             [- 6.26410916, -0.00148152, 0.00090759, 7.26262764, 0.99546773, 0.99761088, 0.49265036],
+                             [- 6.26413598, -0.00148082, 0.00090717, 7.26265516, 0.99546989, 0.99761201, 0.49265140],
+                             [- 6.26416271, -0.00148012, 0.00090674, 7.26268258, 0.99547204, 0.99761314, 0.49265242],
+                             [- 6.26418933, -0.00147942, 0.00090631, 7.26270991, 0.99547420, 0.99761426, 0.49265345],
+                             [- 6.26421586, -0.00147872, 0.00090589, 7.26273714, 0.99547635, 0.99761539, 0.49265447],
+                             [- 6.26424230, -0.00147802, 0.00090547, 7.26276428, 0.99547850, 0.99761651, 0.49265547],
+                             [- 6.26426864, -0.00147733, 0.00090504, 7.26279132, 0.99548065, 0.99761763, 0.49265649],
+                             [- 6.26429489, -0.00147663, 0.00090462, 7.26281826, 0.99548279, 0.99761875, 0.49265751],
+                             [- 6.26432104, -0.00147593, 0.00090419, 7.26284511, 0.99548494, 0.99761987, 0.49265851],
+                             [- 6.26434710, -0.00147523, 0.00090377, 7.26287186, 0.99548708, 0.99762099, 0.49265951],
+                             [- 6.26437306, -0.00147454, 0.00090335, 7.26289852, 0.99548922, 0.99762211, 0.49266051],
+                             [- 6.26439893, -0.00147384, 0.00090293, 7.26292509, 0.99549136, 0.99762323, 0.49266151],
+                             [- 6.26442471, -0.00147315, 0.00090250, 7.26295156, 0.99549349, 0.99762435, 0.49266249],
+                             [- 6.26445040, -0.00147246, 0.00090208, 7.26297794, 0.99549563, 0.99762546, 0.49266350],
+                             [- 6.26447599, -0.00147176, 0.00090166, 7.26300423, 0.99549776, 0.99762658, 0.49266448],
+                             [- 6.26450150, -0.00147107, 0.00090124, 7.26303043, 0.99549989, 0.99762769, 0.49266547],
+                             [- 6.26452691, -0.00147038, 0.00090082, 7.26305653, 0.99550202, 0.99762880, 0.49266646],
+                             [- 6.26455222, -0.00146969, 0.00090040, 7.26308254, 0.99550415, 0.99762991, 0.49266744],
+                             [- 6.26457745, -0.00146900, 0.00089998, 7.26310846, 0.99550627, 0.99763102, 0.49266841],
+                             [- 6.26460259, -0.00146831, 0.00089956, 7.26313428, 0.99550839, 0.99763213, 0.49266939],
+                             [- 6.26462764, -0.00146762, 0.00089914, 7.26316002, 0.99551051, 0.99763324, 0.49267035],
+                             [- 6.26465259, -0.00146693, 0.00089872, 7.26318567, 0.99551263, 0.99763435, 0.49267132],
+                             [- 6.26467746, -0.00146624, 0.00089831, 7.26321122, 0.99551475, 0.99763545, 0.49267230],
+                             [- 6.26470224, -0.00146555, 0.00089789, 7.26323669, 0.99551686, 0.99763656, 0.49267325],
+                             [- 6.26472693, -0.00146486, 0.00089747, 7.26326207, 0.99551898, 0.99763766, 0.49267421],
+                             [- 6.26475153, -0.00146418, 0.00089705, 7.26328735, 0.99552109, 0.99763877, 0.49267517],
+                             [- 6.26477604, -0.00146349, 0.00089664, 7.26331255, 0.99552319, 0.99763987, 0.49267611],
+                             [- 6.26480047, -0.00146281, 0.00089622, 7.26333766, 0.99552530, 0.99764097, 0.49267707],
+                             [- 6.26482481, -0.00146212, 0.00089580, 7.26336268, 0.99552741, 0.99764207, 0.49267802],
+                             [- 6.26484906, -0.00146144, 0.00089539, 7.26338762, 0.99552951, 0.99764317, 0.49267897],
+                             [- 6.26487322, -0.00146076, 0.00089497, 7.26341246, 0.99553161, 0.99764427, 0.49267991],
+                             [- 6.26489730, -0.00146007, 0.00089456, 7.26343722, 0.99553371, 0.99764537, 0.49268085],
+                             [- 6.26492129, -0.00145939, 0.00089414, 7.26346189, 0.99553581, 0.99764646, 0.49268179],
+                             [- 6.26494519, -0.00145871, 0.00089373, 7.26348648, 0.99553790, 0.99764756, 0.49268272],
+                             [- 6.26496901, -0.00145803, 0.00089332, 7.26351098, 0.99553999, 0.99764865, 0.49268365],
+                             [- 6.26499274, -0.00145735, 0.00089290, 7.26353539, 0.99554209, 0.99764975, 0.49268458],
+                             [- 6.26501639, -0.00145667, 0.00089249, 7.26355972, 0.99554417, 0.99765084, 0.49268549],
+                             [- 6.26503995, -0.00145599, 0.00089208, 7.26358396, 0.99554626, 0.99765193, 0.49268643],
+                             [- 6.26506343, -0.00145531, 0.00089166, 7.26360811, 0.99554835, 0.99765302, 0.49268735],
+                             [- 6.26508682, -0.00145463, 0.00089125, 7.26363219, 0.99555043, 0.99765411, 0.49268826],
+                             [- 6.26511013, -0.00145396, 0.00089084, 7.26365617, 0.99555251, 0.99765520, 0.49268918],
+                             [- 6.26513336, -0.00145328, 0.00089043, 7.26368008, 0.99555459, 0.99765629, 0.49269008],
+                             [- 6.26515650, -0.00145261, 0.00089002, 7.26370389, 0.99555667, 0.99765738, 0.49269099],
+                             [- 6.26517956, -0.00145193, 0.00088961, 7.26372763, 0.99555875, 0.99765846, 0.49269190],
+                             [- 6.26520254, -0.00145126, 0.00088920, 7.26375128, 0.99556082, 0.99765955, 0.49269281],
+                             [- 6.26522543, -0.00145058, 0.00088879, 7.26377485, 0.99556289, 0.99766063, 0.49269370],
+                             [- 6.26524824, -0.00144991, 0.00088838, 7.26379834, 0.99556496, 0.99766171, 0.49269460],
+                             [- 6.26527098, -0.00144924, 0.00088797, 7.26382174, 0.99556703, 0.99766280, 0.49269550],
+                             [- 6.26529363, -0.00144856, 0.00088756, 7.26384506, 0.99556910, 0.99766388, 0.49269640],
+                             [- 6.26531619, -0.00144789, 0.00088715, 7.26386830, 0.99557116, 0.99766496, 0.49269728],
+                             [- 6.26533868, -0.00144722, 0.00088674, 7.26389146, 0.99557323, 0.99766604, 0.49269817],
+                             [- 6.26536109, -0.00144655, 0.00088634, 7.26391454, 0.99557529, 0.99766711, 0.49269905],
+                             [- 6.26538341, -0.00144588, 0.00088593, 7.26393753, 0.99557735, 0.99766819, 0.49269994],
+                             [- 6.26540566, -0.00144521, 0.00088552, 7.26396045, 0.99557940, 0.99766927, 0.49270083],
+                             [- 6.26542783, -0.00144454, 0.00088511, 7.26398329, 0.99558146, 0.99767034, 0.49270168],
+                             [- 6.26544992, -0.00144387, 0.00088471, 7.26400604, 0.99558351, 0.99767142, 0.49270256],
+                             [- 6.26547192, -0.00144321, 0.00088430, 7.26402872, 0.99558556, 0.99767249, 0.49270344],
+                             [- 6.26549385, -0.00144254, 0.00088390, 7.26405131, 0.99558761, 0.99767356, 0.49270431],
+                             [- 6.26551570, -0.00144187, 0.00088349, 7.26407383, 0.99558966, 0.99767463, 0.49270518],
+                             [- 6.26553748, -0.00144121, 0.00088309, 7.26409627, 0.99559171, 0.99767571, 0.49270604],
+                             [- 6.26555917, -0.00144054, 0.00088268, 7.26411863, 0.99559375, 0.99767678, 0.49270690],
+                             [- 6.26558079, -0.00143988, 0.00088228, 7.26414091, 0.99559579, 0.99767784, 0.49270776],
+                             [- 6.26560233, -0.00143922, 0.00088187, 7.26416311, 0.99559783, 0.99767891, 0.49270862],
+                             [- 6.26562379, -0.00143855, 0.00088147, 7.26418524, 0.99559987, 0.99767998, 0.49270947],
+                             [- 6.26564518, -0.00143789, 0.00088107, 7.26420729, 0.99560191, 0.99768104, 0.49271032],
+                             [- 6.26566648, -0.00143723, 0.00088066, 7.26422926, 0.99560394, 0.99768211, 0.49271118],
+                             [- 6.26568772, -0.00143657, 0.00088026, 7.26425115, 0.99560598, 0.99768317, 0.49271202],
+                             [- 6.26570887, -0.00143590, 0.00087986, 7.26427297, 0.99560801, 0.99768424, 0.49271286],
+                             [- 6.26572995, -0.00143524, 0.00087946, 7.26429471, 0.99561004, 0.99768530, 0.49271371],
+                             [- 6.26575096, -0.00143458, 0.00087906, 7.26431637, 0.99561206, 0.99768636, 0.49271455],
+                             [- 6.26577189, -0.00143393, 0.00087865, 7.26433796, 0.99561409, 0.99768742, 0.49271537],
+                             [- 6.26579274, -0.00143327, 0.00087825, 7.26435948, 0.99561611, 0.99768848, 0.49271621],
+                             [- 6.26581352, -0.00143261, 0.00087785, 7.26438092, 0.99561813, 0.99768954, 0.49271704],
+                             [- 6.26583423, -0.00143195, 0.00087745, 7.26440228, 0.99562015, 0.99769059, 0.49271787],
+                             [- 6.26585486, -0.00143130, 0.00087705, 7.26442357, 0.99562217, 0.99769165, 0.49271871],
+                             [- 6.26587542, -0.00143064, 0.00087665, 7.26444478, 0.99562419, 0.99769271, 0.49271954],
+                             [- 6.26589591, -0.00142998, 0.00087626, 7.26446592, 0.99562620, 0.99769376, 0.49272035],
+                             [- 6.26591632, -0.00142933, 0.00087586, 7.26448699, 0.99562822, 0.99769482, 0.49272117],
+                             [- 6.26593666, -0.00142867, 0.00087546, 7.26450798, 0.99563023, 0.99769587, 0.49272198],
+                             [- 6.26595692, -0.00142802, 0.00087506, 7.26452890, 0.99563224, 0.99769692, 0.49272279],
+                             [- 6.26597711, -0.00142737, 0.00087466, 7.26454975, 0.99563424, 0.99769797, 0.49272362],
+                             [- 6.26599724, -0.00142671, 0.00087426, 7.26457052, 0.99563625, 0.99769902, 0.49272441],
+                             [- 6.26601728, -0.00142606, 0.00087387, 7.26459122, 0.99563825, 0.99770007, 0.49272522],
+                             [- 6.26603726, -0.00142541, 0.00087347, 7.26461185, 0.99564025, 0.99770112, 0.49272604],
+                             [- 6.26605717, -0.00142476, 0.00087307, 7.26463241, 0.99564225, 0.99770217, 0.49272683],
+                             [- 6.26607700, -0.00142411, 0.00087268, 7.26465289, 0.99564425, 0.99770321, 0.49272764],
+                             [- 6.26609676, -0.00142346, 0.00087228, 7.26467331, 0.99564625, 0.99770426, 0.49272843],
+                             [- 6.26611646, -0.00142281, 0.00087189, 7.26469365, 0.99564824, 0.99770530, 0.49272921],
+                             [- 6.26613608, -0.00142216, 0.00087149, 7.26471392, 0.99565024, 0.99770635, 0.49273003],
+                             [- 6.26615563, -0.00142151, 0.00087110, 7.26473412, 0.99565223, 0.99770739, 0.49273081],
+                             [- 6.26617512, -0.00142087, 0.00087070, 7.26475425, 0.99565422, 0.99770843, 0.49273160],
+                             [- 6.26619453, -0.00142022, 0.00087031, 7.26477431, 0.99565620, 0.99770947, 0.49273238],
+                             [- 6.26621387, -0.00141957, 0.00086992, 7.26479430, 0.99565819, 0.99771051, 0.49273317],
+                             [- 6.26623315, -0.00141893, 0.00086952, 7.26481422, 0.99566017, 0.99771155, 0.49273396],
+                             [- 6.26625235, -0.00141828, 0.00086913, 7.26483407, 0.99566216, 0.99771259, 0.49273473],
+                             [- 6.26627149, -0.00141764, 0.00086874, 7.26485385, 0.99566414, 0.99771362, 0.49273551],
+                             [- 6.26629056, -0.00141699, 0.00086835, 7.26487356, 0.99566612, 0.99771466, 0.49273628],
+                             [- 6.26630956, -0.00141635, 0.00086795, 7.26489321, 0.99566809, 0.99771570, 0.49273706],
+                             [- 6.26632849, -0.00141571, 0.00086756, 7.26491278, 0.99567007, 0.99771673, 0.49273783],
+                             [- 6.26634735, -0.00141506, 0.00086717, 7.26493229, 0.99567204, 0.99771776, 0.49273859],
+                             [- 6.26636615, -0.00141442, 0.00086678, 7.26495173, 0.99567401, 0.99771880, 0.49273935],
+                             [- 6.26638488, -0.00141378, 0.00086639, 7.26497110, 0.99567598, 0.99771983, 0.49274013],
+                             [- 6.26640355, -0.00141314, 0.00086600, 7.26499041, 0.99567795, 0.99772086, 0.49274089],
+                             [- 6.26642214, -0.00141250, 0.00086561, 7.26500964, 0.99567992, 0.99772189, 0.49274164],
+                             [- 6.26644067, -0.00141186, 0.00086522, 7.26502881, 0.99568188, 0.99772292, 0.49274241],
+                             [- 6.26645914, -0.00141122, 0.00086483, 7.26504792, 0.99568384, 0.99772395, 0.49274316],
+                             [- 6.26647754, -0.00141058, 0.00086444, 7.26506695, 0.99568580, 0.99772497, 0.49274392],
+                             [- 6.26649587, -0.00140995, 0.00086405, 7.26508592, 0.99568776, 0.99772600, 0.49274466],
+                             [- 6.26651414, -0.00140931, 0.00086366, 7.26510483, 0.99568972, 0.99772703, 0.49274542],
+                             [- 6.26653234, -0.00140867, 0.00086328, 7.26512367, 0.99569168, 0.99772805, 0.49274618],
+                             [- 6.26655048, -0.00140804, 0.00086289, 7.26514244, 0.99569363, 0.99772908, 0.49274690],
+                             [- 6.26656855, -0.00140740, 0.00086250, 7.26516115, 0.99569558, 0.99773010, 0.49274765],
+                             [- 6.26658656, -0.00140677, 0.00086211, 7.26517979, 0.99569753, 0.99773112, 0.49274839],
+                             [- 6.26660450, -0.00140613, 0.00086173, 7.26519837, 0.99569948, 0.99773214, 0.49274912],
+                             [- 6.26662238, -0.00140550, 0.00086134, 7.26521688, 0.99570143, 0.99773316, 0.49274986],
+                             [- 6.26664020, -0.00140486, 0.00086096, 7.26523533, 0.99570337, 0.99773418, 0.49275059],
+                             [- 6.26665795, -0.00140423, 0.00086057, 7.26525372, 0.99570532, 0.99773520, 0.49275132],
+                             [- 6.26667564, -0.00140360, 0.00086018, 7.26527204, 0.99570726, 0.99773622, 0.49275206],
+                             [- 6.26669326, -0.00140297, 0.00085980, 7.26529030, 0.99570920, 0.99773723, 0.49275276],
+                             [- 6.26671083, -0.00140234, 0.00085942, 7.26530849, 0.99571114, 0.99773825, 0.49275350],
+                             [- 6.26672833, -0.00140171, 0.00085903, 7.26532662, 0.99571307, 0.99773926, 0.49275423],
+                             [- 6.26674577, -0.00140108, 0.00085865, 7.26534469, 0.99571501, 0.99774028, 0.49275495],
+                             [- 6.26676314, -0.00140045, 0.00085826, 7.26536270, 0.99571694, 0.99774129, 0.49275567],
+                             [- 6.26678046, -0.00139982, 0.00085788, 7.26538064, 0.99571887, 0.99774230, 0.49275639],
+                             [- 6.26679771, -0.00139919, 0.00085750, 7.26539852, 0.99572080, 0.99774331, 0.49275711],
+                             [- 6.26681490, -0.00139856, 0.00085711, 7.26541634, 0.99572273, 0.99774433, 0.49275782],
+                             [- 6.26683203, -0.00139793, 0.00085673, 7.26543410, 0.99572466, 0.99774533, 0.49275852],
+                             [- 6.26684910, -0.00139731, 0.00085635, 7.26545179, 0.99572658, 0.99774634, 0.49275924],
+                             [- 6.26686611, -0.00139668, 0.00085597, 7.26546943, 0.99572851, 0.99774735, 0.49275995],
+                             [- 6.26688306, -0.00139605, 0.00085559, 7.26548700, 0.99573043, 0.99774836, 0.49276065],
+                             [- 6.26689994, -0.00139543, 0.00085521, 7.26550451, 0.99573235, 0.99774936, 0.49276134],
+                             [- 6.26691677, -0.00139481, 0.00085482, 7.26552196, 0.99573426, 0.99775037, 0.49276204],
+                             [- 6.26693354, -0.00139418, 0.00085444, 7.26553936, 0.99573618, 0.99775137, 0.49276274],
+                             [- 6.26695024, -0.00139356, 0.00085406, 7.26555669, 0.99573809, 0.99775238, 0.49276344],
+                             [- 6.26696689, -0.00139293, 0.00085368, 7.26557396, 0.99574001, 0.99775338, 0.49276413],
+                             [- 6.26698348, -0.00139231, 0.00085331, 7.26559117, 0.99574192, 0.99775438, 0.49276484],
+                             [- 6.26700001, -0.00139169, 0.00085293, 7.26560832, 0.99574383, 0.99775538, 0.49276553],
+                             [- 6.26701648, -0.00139107, 0.00085255, 7.26562541, 0.99574574, 0.99775638, 0.49276621],
+                             [- 6.26703289, -0.00139045, 0.00085217, 7.26564245, 0.99574764, 0.99775738, 0.49276691],
+                             [- 6.26704925, -0.00138983, 0.00085179, 7.26565942, 0.99574955, 0.99775838, 0.49276759],
+                             [- 6.26706554, -0.00138921, 0.00085141, 7.26567633, 0.99575145, 0.99775938, 0.49276826],
+                             [- 6.26708178, -0.00138859, 0.00085104, 7.26569319, 0.99575335, 0.99776038, 0.49276895],
+                             [- 6.26709796, -0.00138797, 0.00085066, 7.26570999, 0.99575525, 0.99776137, 0.49276963],
+                             [- 6.26711408, -0.00138735, 0.00085028, 7.26572673, 0.99575715, 0.99776237, 0.49277030],
+                             [- 6.26713015, -0.00138674, 0.00084990, 7.26574341, 0.99575904, 0.99776336, 0.49277097],
+                             [- 6.26714616, -0.00138612, 0.00084953, 7.26576004, 0.99576094, 0.99776435, 0.49277165],
+                             [- 6.26716211, -0.00138550, 0.00084915, 7.26577661, 0.99576283, 0.99776535, 0.49277232],
+                             [- 6.26717800, -0.00138489, 0.00084878, 7.26579312, 0.99576472, 0.99776634, 0.49277298],
+                             [- 6.26719384, -0.00138427, 0.00084840, 7.26580957, 0.99576661, 0.99776733, 0.49277366],
+                             [- 6.26720962, -0.00138366, 0.00084803, 7.26582597, 0.99576850, 0.99776832, 0.49277432],
+                             [- 6.26722535, -0.00138304, 0.00084765, 7.26584231, 0.99577038, 0.99776931, 0.49277499],
+                             [- 6.26724102, -0.00138243, 0.00084728, 7.26585859, 0.99577227, 0.99777029, 0.49277565],
+                             [- 6.26725663, -0.00138181, 0.00084690, 7.26587482, 0.99577415, 0.99777128, 0.49277630],
+                             [- 6.26727219, -0.00138120, 0.00084653, 7.26589099, 0.99577603, 0.99777227, 0.49277698],
+                             [- 6.26728769, -0.00138059, 0.00084616, 7.26590710, 0.99577791, 0.99777325, 0.49277763],
+                             [- 6.26730314, -0.00137998, 0.00084578, 7.26592316, 0.99577979, 0.99777424, 0.49277828],
+                             [- 6.26731854, -0.00137937, 0.00084541, 7.26593917, 0.99578166, 0.99777522, 0.49277893],
+                             [- 6.26733388, -0.00137876, 0.00084504, 7.26595512, 0.99578354, 0.99777621, 0.49277959],
+                             [- 6.26734916, -0.00137815, 0.00084467, 7.26597101, 0.99578541, 0.99777719, 0.49278024],
+                             [- 6.26736439, -0.00137754, 0.00084429, 7.26598685, 0.99578728, 0.99777817, 0.49278088],
+                             [- 6.26737957, -0.00137693, 0.00084392, 7.26600264, 0.99578915, 0.99777915, 0.49278153],
+                             [- 6.26739469, -0.00137632, 0.00084355, 7.26601837, 0.99579102, 0.99778013, 0.49278219],
+                             [- 6.26740976, -0.00137571, 0.00084318, 7.26603405, 0.99579289, 0.99778111, 0.49278281],
+                             [- 6.26742477, -0.00137510, 0.00084281, 7.26604967, 0.99579475, 0.99778209, 0.49278347],
+                             [- 6.26743974, -0.00137450, 0.00084244, 7.26606524, 0.99579661, 0.99778306, 0.49278410],
+                             [- 6.26745464, -0.00137389, 0.00084207, 7.26608075, 0.99579847, 0.99778404, 0.49278472],
+                             [- 6.26746950, -0.00137328, 0.00084170, 7.26609622, 0.99580033, 0.99778502, 0.49278536],
+                             [- 6.26748430, -0.00137268, 0.00084133, 7.26611162, 0.99580219, 0.99778599, 0.49278600],
+                             [- 6.26749906, -0.00137207, 0.00084096, 7.26612698, 0.99580405, 0.99778696, 0.49278663],
+                             [- 6.26751375, -0.00137147, 0.00084059, 7.26614228, 0.99580590, 0.99778794, 0.49278724],
+                             [- 6.26752840, -0.00137087, 0.00084022, 7.26615753, 0.99580776, 0.99778891, 0.49278789],
+                             [- 6.26754300, -0.00137026, 0.00083986, 7.26617273, 0.99580961, 0.99778988, 0.49278852],
+                             [- 6.26755754, -0.00136966, 0.00083949, 7.26618788, 0.99581146, 0.99779085, 0.49278914],
+                             [- 6.26757203, -0.00136906, 0.00083912, 7.26620297, 0.99581331, 0.99779182, 0.49278975],
+                             [- 6.26758647, -0.00136846, 0.00083875, 7.26621801, 0.99581515, 0.99779279, 0.49279037],
+                             [- 6.26760086, -0.00136786, 0.00083839, 7.26623300, 0.99581700, 0.99779376, 0.49279099],
+                             [- 6.26761520, -0.00136725, 0.00083802, 7.26624794, 0.99581884, 0.99779472, 0.49279161],
+                             [- 6.26762949, -0.00136665, 0.00083765, 7.26626283, 0.99582068, 0.99779569, 0.49279223],
+                             [- 6.26764372, -0.00136605, 0.00083729, 7.26627767, 0.99582252, 0.99779666, 0.49279284],
+                             [- 6.26765791, -0.00136546, 0.00083692, 7.26629245, 0.99582436, 0.99779762, 0.49279345],
+                             [- 6.26767205, -0.00136486, 0.00083656, 7.26630719, 0.99582620, 0.99779859, 0.49279407],
+                             [- 6.26768613, -0.00136426, 0.00083619, 7.26632187, 0.99582804, 0.99779955, 0.49279468],
+                             [- 6.26770017, -0.00136366, 0.00083583, 7.26633651, 0.99582987, 0.99780051, 0.49279528],
+                             [- 6.26771416, -0.00136306, 0.00083546, 7.26635109, 0.99583170, 0.99780147, 0.49279588],
+                             [- 6.26772809, -0.00136247, 0.00083510, 7.26636562, 0.99583353, 0.99780243, 0.49279649],
+                             [- 6.26774198, -0.00136187, 0.00083474, 7.26638011, 0.99583536, 0.99780339, 0.49279710],
+                             [- 6.26775582, -0.00136128, 0.00083437, 7.26639454, 0.99583719, 0.99780435, 0.49279770],
+                             [- 6.26776961, -0.00136068, 0.00083401, 7.26640893, 0.99583902, 0.99780531, 0.49279829],
+                             [- 6.26778335, -0.00136009, 0.00083365, 7.26642326, 0.99584084, 0.99780627, 0.49279888],
+                             [- 6.26779704, -0.00135949, 0.00083328, 7.26643755, 0.99584266, 0.99780722, 0.49279946],
+                             [- 6.26781069, -0.00135890, 0.00083292, 7.26645179, 0.99584449, 0.99780818, 0.49280008],
+                             [- 6.26782428, -0.00135831, 0.00083256, 7.26646598, 0.99584631, 0.99780913, 0.49280067],
+                             [- 6.26783783, -0.00135771, 0.00083220, 7.26648012, 0.99584812, 0.99781009, 0.49280125],
+                             [- 6.26785133, -0.00135712, 0.00083184, 7.26649421, 0.99584994, 0.99781104, 0.49280185],
+                             [- 6.26786479, -0.00135653, 0.00083148, 7.26650826, 0.99585175, 0.99781199, 0.49280244],
+                             [- 6.26787819, -0.00135594, 0.00083111, 7.26652225, 0.99585357, 0.99781295, 0.49280301],
+                             [- 6.26789155, -0.00135535, 0.00083075, 7.26653620, 0.99585538, 0.99781390, 0.49280360],
+                             [- 6.26790486, -0.00135476, 0.00083039, 7.26655010, 0.99585719, 0.99781485, 0.49280419],
+                             [- 6.26791812, -0.00135417, 0.00083003, 7.26656395, 0.99585900, 0.99781580, 0.49280476],
+                             [- 6.26793134, -0.00135358, 0.00082967, 7.26657776, 0.99586081, 0.99781675, 0.49280534],
+                             [- 6.26794451, -0.00135299, 0.00082931, 7.26659152, 0.99586261, 0.99781769, 0.49280594],
+                             [- 6.26795764, -0.00135240, 0.00082896, 7.26660523, 0.99586442, 0.99781864, 0.49280650],
+                             [- 6.26797071, -0.00135182, 0.00082860, 7.26661890, 0.99586622, 0.99781959, 0.49280708],
+                             [- 6.26798374, -0.00135123, 0.00082824, 7.26663252, 0.99586802, 0.99782053, 0.49280764],
+                             [- 6.26799673, -0.00135064, 0.00082788, 7.26664609, 0.99586982, 0.99782148, 0.49280822],
+                             [- 6.26800967, -0.00135006, 0.00082752, 7.26665961, 0.99587162, 0.99782242, 0.49280878],
+                             [- 6.26802256, -0.00134947, 0.00082717, 7.26667309, 0.99587341, 0.99782336, 0.49280935],
+                             [- 6.26803541, -0.00134889, 0.00082681, 7.26668653, 0.99587521, 0.99782431, 0.49280992],
+                             [- 6.26804822, -0.00134830, 0.00082645, 7.26669991, 0.99587700, 0.99782525, 0.49281048],
+                             [- 6.26806098, -0.00134772, 0.00082609, 7.26671326, 0.99587879, 0.99782619, 0.49281107],
+                             [- 6.26807369, -0.00134713, 0.00082574, 7.26672655, 0.99588058, 0.99782713, 0.49281162],
+                             [- 6.26808636, -0.00134655, 0.00082538, 7.26673981, 0.99588237, 0.99782807, 0.49281218],
+                             [- 6.26809898, -0.00134597, 0.00082503, 7.26675301, 0.99588416, 0.99782900, 0.49281274],
+                             [- 6.26811156, -0.00134539, 0.00082467, 7.26676617, 0.99588595, 0.99782994, 0.49281329],
+                             [- 6.26812410, -0.00134481, 0.00082432, 7.26677929, 0.99588773, 0.99783088, 0.49281384],
+                             [- 6.26813659, -0.00134422, 0.00082396, 7.26679236, 0.99588951, 0.99783181, 0.49281439],
+                             [- 6.26814904, -0.00134364, 0.00082361, 7.26680539, 0.99589129, 0.99783275, 0.49281496],
+                             [- 6.26816144, -0.00134306, 0.00082325, 7.26681838, 0.99589307, 0.99783368, 0.49281552],
+                             [- 6.26817380, -0.00134248, 0.00082290, 7.26683132, 0.99589485, 0.99783462, 0.49281605],
+                             [- 6.26818612, -0.00134191, 0.00082255, 7.26684421, 0.99589663, 0.99783555, 0.49281661],
+                             [- 6.26819839, -0.00134133, 0.00082219, 7.26685706, 0.99589840, 0.99783648, 0.49281716],
+                             [- 6.26821062, -0.00134075, 0.00082184, 7.26686987, 0.99590018, 0.99783741, 0.49281769],
+                             [- 6.26822281, -0.00134017, 0.00082149, 7.26688264, 0.99590195, 0.99783834, 0.49281824],
+                             [- 6.26823495, -0.00133959, 0.00082113, 7.26689536, 0.99590372, 0.99783927, 0.49281878],
+                             [- 6.26824705, -0.00133902, 0.00082078, 7.26690804, 0.99590549, 0.99784020, 0.49281933],
+                             [- 6.26825911, -0.00133844, 0.00082043, 7.26692067, 0.99590725, 0.99784113, 0.49281987],
+                             [- 6.26827113, -0.00133787, 0.00082008, 7.26693326, 0.99590902, 0.99784206, 0.49282040],
+                             [- 6.26828310, -0.00133729, 0.00081973, 7.26694581, 0.99591078, 0.99784298, 0.49282094],
+                             [- 6.26829504, -0.00133672, 0.00081938, 7.26695832, 0.99591255, 0.99784391, 0.49282147],
+                             [- 6.26830693, -0.00133614, 0.00081902, 7.26697079, 0.99591431, 0.99784483, 0.49282201],
+                             [- 6.26831878, -0.00133557, 0.00081867, 7.26698321, 0.99591607, 0.99784576, 0.49282254],
+                             [- 6.26833058, -0.00133499, 0.00081832, 7.26699559, 0.99591783, 0.99784668, 0.49282308],
+                             [- 6.26834235, -0.00133442, 0.00081797, 7.26700793, 0.99591958, 0.99784760, 0.49282360],
+                             [- 6.26835407, -0.00133385, 0.00081762, 7.26702023, 0.99592134, 0.99784853, 0.49282414],
+                             [- 6.26836576, -0.00133328, 0.00081728, 7.26703248, 0.99592309, 0.99784945, 0.49282465],
+                             [- 6.26837740, -0.00133271, 0.00081693, 7.26704469, 0.99592485, 0.99785037, 0.49282520],
+                             [- 6.26838900, -0.00133214, 0.00081658, 7.26705687, 0.99592660, 0.99785129, 0.49282572],
+                             [- 6.26840056, -0.00133157, 0.00081623, 7.26706900, 0.99592835, 0.99785221, 0.49282624],
+                             [- 6.26841209, -0.00133100, 0.00081588, 7.26708109, 0.99593009, 0.99785312, 0.49282676],
+                             [- 6.26842357, -0.00133043, 0.00081553, 7.26709314, 0.99593184, 0.99785404, 0.49282728],
+                             [- 6.26843501, -0.00132986, 0.00081519, 7.26710515, 0.99593359, 0.99785496, 0.49282780],
+                             [- 6.26844641, -0.00132929, 0.00081484, 7.26711712, 0.99593533, 0.99785587, 0.49282829],
+                             [- 6.26845777, -0.00132872, 0.00081449, 7.26712905, 0.99593707, 0.99785679, 0.49282883],
+                             [- 6.26846909, -0.00132815, 0.00081414, 7.26714093, 0.99593881, 0.99785770, 0.49282934],
+                             [- 6.26848037, -0.00132759, 0.00081380, 7.26715278, 0.99594055, 0.99785862, 0.49282986],
+                             [- 6.26849161, -0.00132702, 0.00081345, 7.26716459, 0.99594229, 0.99785953, 0.49283037],
+                             [- 6.26850281, -0.00132645, 0.00081311, 7.26717636, 0.99594402, 0.99786044, 0.49283087],
+                             [- 6.26851397, -0.00132589, 0.00081276, 7.26718809, 0.99594576, 0.99786135, 0.49283138],
+                             [- 6.26852510, -0.00132532, 0.00081242, 7.26719977, 0.99594749, 0.99786226, 0.49283189],
+                             [- 6.26853618, -0.00132476, 0.00081207, 7.26721142, 0.99594922, 0.99786317, 0.49283239],
+                             [- 6.26854723, -0.00132419, 0.00081173, 7.26722303, 0.99595095, 0.99786408, 0.49283291],
+                             [- 6.26855824, -0.00132363, 0.00081138, 7.26723461, 0.99595268, 0.99786499, 0.49283341],
+                             [- 6.26856921, -0.00132307, 0.00081104, 7.26724614, 0.99595441, 0.99786590, 0.49283391],
+                             [- 6.26858014, -0.00132251, 0.00081069, 7.26725763, 0.99595614, 0.99786680, 0.49283441],
+                             [- 6.26859103, -0.00132194, 0.00081035, 7.26726909, 0.99595786, 0.99786771, 0.49283490],
+                             [- 6.26860188, -0.00132138, 0.00081001, 7.26728050, 0.99595958, 0.99786861, 0.49283543],
+                             [- 6.26861270, -0.00132082, 0.00080966, 7.26729188, 0.99596131, 0.99786952, 0.49283590],
+                             [- 6.26862348, -0.00132026, 0.00080932, 7.26730322, 0.99596303, 0.99787042, 0.49283641],
+                             [- 6.26863422, -0.00131970, 0.00080898, 7.26731452, 0.99596474, 0.99787132, 0.49283690],
+                             [- 6.26864493, -0.00131914, 0.00080864, 7.26732579, 0.99596646, 0.99787223, 0.49283740],
+                             [- 6.26865559, -0.00131858, 0.00080829, 7.26733701, 0.99596818, 0.99787313, 0.49283789],
+                             [- 6.26866622, -0.00131802, 0.00080795, 7.26734820, 0.99596989, 0.99787403, 0.49283838],
+                             [- 6.26867681, -0.00131746, 0.00080761, 7.26735935, 0.99597160, 0.99787493, 0.49283886],
+                             [- 6.26868737, -0.00131690, 0.00080727, 7.26737047, 0.99597332, 0.99787583, 0.49283935],
+                             [- 6.26869789, -0.00131635, 0.00080693, 7.26738154, 0.99597503, 0.99787673, 0.49283983],
+                             [- 6.26870837, -0.00131579, 0.00080659, 7.26739258, 0.99597673, 0.99787762, 0.49284032],
+                             [- 6.26871882, -0.00131523, 0.00080625, 7.26740358, 0.99597844, 0.99787852, 0.49284083],
+                             [- 6.26872923, -0.00131468, 0.00080591, 7.26741455, 0.99598015, 0.99787942, 0.49284129],
+                             [- 6.26873960, -0.00131412, 0.00080557, 7.26742548, 0.99598185, 0.99788031, 0.49284178],
+                             [- 6.26874993, -0.00131357, 0.00080523, 7.26743637, 0.99598355, 0.99788121, 0.49284226],
+                             [- 6.26876024, -0.00131301, 0.00080489, 7.26744723, 0.99598526, 0.99788210, 0.49284273],
+                             [- 6.26877050, -0.00131246, 0.00080455, 7.26745804, 0.99598696, 0.99788299, 0.49284320],
+                             [- 6.26878073, -0.00131190, 0.00080421, 7.26746883, 0.99598865, 0.99788389, 0.49284369],
+                             [- 6.26879092, -0.00131135, 0.00080387, 7.26747958, 0.99599035, 0.99788478, 0.49284417],
+                             [- 6.26880108, -0.00131080, 0.00080354, 7.26749029, 0.99599205, 0.99788567, 0.49284465],
+                             [- 6.26881120, -0.00131024, 0.00080320, 7.26750096, 0.99599374, 0.99788656, 0.49284510],
+                             [- 6.26882129, -0.00130969, 0.00080286, 7.26751160, 0.99599543, 0.99788745, 0.49284559],
+                             [- 6.26883135, -0.00130914, 0.00080252, 7.26752221, 0.99599713, 0.99788834, 0.49284606],
+                             [- 6.26884136, -0.00130859, 0.00080219, 7.26753278, 0.99599882, 0.99788923, 0.49284653],
+                             [- 6.26885135, -0.00130804, 0.00080185, 7.26754331, 0.99600050, 0.99789011, 0.49284699],
+                             [- 6.26886129, -0.00130749, 0.00080151, 7.26755381, 0.99600219, 0.99789100, 0.49284746],
+                             [- 6.26887121, -0.00130694, 0.00080118, 7.26756427, 0.99600388, 0.99789189, 0.49284793],
+                             [- 6.26888109, -0.00130639, 0.00080084, 7.26757470, 0.99600556, 0.99789277, 0.49284838],
+                             [- 6.26889093, -0.00130584, 0.00080051, 7.26758509, 0.99600724, 0.99789365, 0.49284885],
+                             [- 6.26890074, -0.00130529, 0.00080017, 7.26759545, 0.99600893, 0.99789454, 0.49284932],
+                             [- 6.26891052, -0.00130474, 0.00079984, 7.26760578, 0.99601061, 0.99789542, 0.49284977],
+                             [- 6.26892026, -0.00130420, 0.00079950, 7.26761607, 0.99601228, 0.99789630, 0.49285024],
+                             [- 6.26892997, -0.00130365, 0.00079917, 7.26762633, 0.99601396, 0.99789719, 0.49285069],
+                             [- 6.26893965, -0.00130310, 0.00079883, 7.26763655, 0.99601564, 0.99789807, 0.49285114],
+                             [- 6.26894929, -0.00130256, 0.00079850, 7.26764674, 0.99601731, 0.99789895, 0.49285162],
+                             [- 6.26895890, -0.00130201, 0.00079816, 7.26765689, 0.99601899, 0.99789983, 0.49285206],
+                             [- 6.26896848, -0.00130146, 0.00079783, 7.26766701, 0.99602066, 0.99790070, 0.49285251],
+                             [- 6.26897802, -0.00130092, 0.00079750, 7.26767710, 0.99602233, 0.99790158, 0.49285297],
+                             [- 6.26898753, -0.00130038, 0.00079717, 7.26768715, 0.99602400, 0.99790246, 0.49285344],
+                             [- 6.26899700, -0.00129983, 0.00079683, 7.26769717, 0.99602566, 0.99790334, 0.49285388],
+                             [- 6.26900645, -0.00129929, 0.00079650, 7.26770716, 0.99602733, 0.99790421, 0.49285432],
+                             [- 6.26901586, -0.00129875, 0.00079617, 7.26771711, 0.99602900, 0.99790509, 0.49285477],
+                             [- 6.26902524, -0.00129820, 0.00079584, 7.26772703, 0.99603066, 0.99790596, 0.49285523],
+                             [- 6.26903458, -0.00129766, 0.00079550, 7.26773692, 0.99603232, 0.99790683, 0.49285566],
+                             [- 6.26904390, -0.00129712, 0.00079517, 7.26774678, 0.99603398, 0.99790771, 0.49285611],
+                             [- 6.26905318, -0.00129658, 0.00079484, 7.26775660, 0.99603564, 0.99790858, 0.49285655],
+                             [- 6.26906243, -0.00129604, 0.00079451, 7.26776639, 0.99603730, 0.99790945, 0.49285701],
+                             [- 6.26907164, -0.00129550, 0.00079418, 7.26777615, 0.99603896, 0.99791032, 0.49285743],
+                             [- 6.26908083, -0.00129496, 0.00079385, 7.26778587, 0.99604061, 0.99791119, 0.49285787],
+                             [- 6.26908998, -0.00129442, 0.00079352, 7.26779557, 0.99604227, 0.99791206, 0.49285833],
+                             [- 6.26909911, -0.00129388, 0.00079319, 7.26780523, 0.99604392, 0.99791293, 0.49285876],
+                             [- 6.26910820, -0.00129334, 0.00079286, 7.26781486, 0.99604557, 0.99791380, 0.49285921],
+                             [- 6.26911726, -0.00129280, 0.00079253, 7.26782446, 0.99604722, 0.99791467, 0.49285963],
+                             [- 6.26912629, -0.00129226, 0.00079220, 7.26783402, 0.99604887, 0.99791553, 0.49286007],
+                             [- 6.26913528, -0.00129173, 0.00079188, 7.26784356, 0.99605051, 0.99791640, 0.49286049],
+                             [- 6.26914425, -0.00129119, 0.00079155, 7.26785306, 0.99605216, 0.99791726, 0.49286093],
+                             [- 6.26915318, -0.00129065, 0.00079122, 7.26786253, 0.99605380, 0.99791813, 0.49286138],
+                             [- 6.26916209, -0.00129012, 0.00079089, 7.26787197, 0.99605545, 0.99791899, 0.49286178],
+                             [- 6.26917096, -0.00128958, 0.00079056, 7.26788138, 0.99605709, 0.99791985, 0.49286223],
+                             [- 6.26917981, -0.00128905, 0.00079024, 7.26789076, 0.99605873, 0.99792072, 0.49286266],
+                             [- 6.26918862, -0.00128851, 0.00078991, 7.26790011, 0.99606037, 0.99792158, 0.49286308],
+                             [- 6.26919740, -0.00128798, 0.00078958, 7.26790942, 0.99606201, 0.99792244, 0.49286350],
+                             [- 6.26920615, -0.00128744, 0.00078926, 7.26791871, 0.99606364, 0.99792330, 0.49286392],
+                             [- 6.26921488, -0.00128691, 0.00078893, 7.26792797, 0.99606528, 0.99792416, 0.49286436],
+                             [- 6.26922357, -0.00128638, 0.00078860, 7.26793719, 0.99606691, 0.99792502, 0.49286478],
+                             [- 6.26923223, -0.00128585, 0.00078828, 7.26794639, 0.99606854, 0.99792588, 0.49286521],
+                             [- 6.26924086, -0.00128531, 0.00078795, 7.26795555, 0.99607017, 0.99792673, 0.49286564],
+                             [- 6.26924947, -0.00128478, 0.00078763, 7.26796468, 0.99607180, 0.99792759, 0.49286605],
+                             [- 6.26925804, -0.00128425, 0.00078730, 7.26797379, 0.99607343, 0.99792845, 0.49286646],
+                             [- 6.26926658, -0.00128372, 0.00078698, 7.26798286, 0.99607506, 0.99792930, 0.49286689],
+                             [- 6.26927510, -0.00128319, 0.00078665, 7.26799191, 0.99607668, 0.99793016, 0.49286730],
+                             [- 6.26928358, -0.00128266, 0.00078633, 7.26800092, 0.99607831, 0.99793101, 0.49286770],
+                             [- 6.26929204, -0.00128213, 0.00078601, 7.26800991, 0.99607993, 0.99793186, 0.49286812],
+                             [- 6.26930047, -0.00128160, 0.00078568, 7.26801887, 0.99608155, 0.99793272, 0.49286854],
+                             [- 6.26930887, -0.00128107, 0.00078536, 7.26802779, 0.99608317, 0.99793357, 0.49286895],
+                             [- 6.26931724, -0.00128054, 0.00078504, 7.26803669, 0.99608479, 0.99793442, 0.49286937],
+                             [- 6.26932558, -0.00128002, 0.00078471, 7.26804556, 0.99608641, 0.99793527, 0.49286977],
+                             [- 6.26933389, -0.00127949, 0.00078439, 7.26805440, 0.99608802, 0.99793612, 0.49287019],
+                             [- 6.26934217, -0.00127896, 0.00078407, 7.26806321, 0.99608964, 0.99793697, 0.49287058],
+                             [- 6.26935043, -0.00127844, 0.00078375, 7.26807199, 0.99609125, 0.99793782, 0.49287100],
+                             [- 6.26935866, -0.00127791, 0.00078342, 7.26808075, 0.99609287, 0.99793867, 0.49287142],
+                             [- 6.26936686, -0.00127738, 0.00078310, 7.26808947, 0.99609448, 0.99793951, 0.49287182],
+                             [- 6.26937503, -0.00127686, 0.00078278, 7.26809817, 0.99609609, 0.99794036, 0.49287224],
+                             [- 6.26938317, -0.00127634, 0.00078246, 7.26810683, 0.99609769, 0.99794120, 0.49287263],
+                             [- 6.26939129, -0.00127581, 0.00078214, 7.26811547, 0.99609930, 0.99794205, 0.49287302],
+                             [- 6.26939937, -0.00127529, 0.00078182, 7.26812409, 0.99610091, 0.99794289, 0.49287345],
+                             [- 6.26940743, -0.00127476, 0.00078150, 7.26813267, 0.99610251, 0.99794374, 0.49287384],
+                             [- 6.26941547, -0.00127424, 0.00078118, 7.26814123, 0.99610411, 0.99794458, 0.49287423],
+                             [- 6.26942347, -0.00127372, 0.00078086, 7.26814975, 0.99610572, 0.99794542, 0.49287464],
+                             [- 6.26943145, -0.00127320, 0.00078054, 7.26815825, 0.99610732, 0.99794626, 0.49287504],
+                             [- 6.26943940, -0.00127267, 0.00078022, 7.26816673, 0.99610892, 0.99794711, 0.49287543],
+                             [- 6.26944732, -0.00127215, 0.00077990, 7.26817517, 0.99611051, 0.99794795, 0.49287581],
+                             [- 6.26945522, -0.00127163, 0.00077958, 7.26818359, 0.99611211, 0.99794879, 0.49287621],
+                             [- 6.26946309, -0.00127111, 0.00077926, 7.26819198, 0.99611370, 0.99794962, 0.49287661],
+                             [- 6.26947093, -0.00127059, 0.00077895, 7.26820034, 0.99611530, 0.99795046, 0.49287701],
+                             [- 6.26947875, -0.00127007, 0.00077863, 7.26820868, 0.99611689, 0.99795130, 0.49287739],
+                             [- 6.26948654, -0.00126955, 0.00077831, 7.26821698, 0.99611848, 0.99795214, 0.49287779],
+                             [- 6.26949430, -0.00126903, 0.00077799, 7.26822527, 0.99612007, 0.99795297, 0.49287817],
+                             [- 6.26950204, -0.00126852, 0.00077768, 7.26823352, 0.99612166, 0.99795381, 0.49287857],
+                             [- 6.26950975, -0.00126800, 0.00077736, 7.26824175, 0.99612325, 0.99795464, 0.49287896],
+                             [- 6.26951743, -0.00126748, 0.00077704, 7.26824995, 0.99612484, 0.99795548, 0.49287934],
+                             [- 6.26952509, -0.00126696, 0.00077673, 7.26825813, 0.99612642, 0.99795631, 0.49287973],
+                             [- 6.26953272, -0.00126645, 0.00077641, 7.26826627, 0.99612800, 0.99795714, 0.49288012],
+                             [- 6.26954033, -0.00126593, 0.00077609, 7.26827440, 0.99612959, 0.99795798, 0.49288050],
+                             [- 6.26954791, -0.00126541, 0.00077578, 7.26828249, 0.99613117, 0.99795881, 0.49288087],
+                             [- 6.26955546, -0.00126490, 0.00077546, 7.26829056, 0.99613275, 0.99795964, 0.49288126],
+                             [- 6.26956299, -0.00126438, 0.00077515, 7.26829860, 0.99613433, 0.99796047, 0.49288164],
+                             [- 6.26957049, -0.00126387, 0.00077483, 7.26830662, 0.99613590, 0.99796130, 0.49288203],
+                             [- 6.26957797, -0.00126335, 0.00077452, 7.26831461, 0.99613748, 0.99796213, 0.49288240],
+                             [- 6.26958542, -0.00126284, 0.00077420, 7.26832258, 0.99613905, 0.99796296, 0.49288278],
+                             [- 6.26959285, -0.00126233, 0.00077389, 7.26833052, 0.99614063, 0.99796378, 0.49288317],
+                             [- 6.26960025, -0.00126181, 0.00077357, 7.26833844, 0.99614220, 0.99796461, 0.49288354],
+                             [- 6.26960763, -0.00126130, 0.00077326, 7.26834632, 0.99614377, 0.99796544, 0.49288392],
+                             [- 6.26961498, -0.00126079, 0.00077295, 7.26835419, 0.99614534, 0.99796626, 0.49288432],
+                             [- 6.26962230, -0.00126028, 0.00077263, 7.26836203, 0.99614691, 0.99796709, 0.49288467],
+                             [- 6.26962961, -0.00125977, 0.00077232, 7.26836984, 0.99614847, 0.99796791, 0.49288504],
+                             [- 6.26963688, -0.00125926, 0.00077201, 7.26837763, 0.99615004, 0.99796874, 0.49288540],
+                             [- 6.26964414, -0.00125874, 0.00077170, 7.26838539, 0.99615160, 0.99796956, 0.49288580],
+                             [- 6.26965137, -0.00125823, 0.00077138, 7.26839313, 0.99615317, 0.99797038, 0.49288618],
+                             [- 6.26965857, -0.00125772, 0.00077107, 7.26840084, 0.99615473, 0.99797120, 0.49288651],
+                             [- 6.26966575, -0.00125722, 0.00077076, 7.26840853, 0.99615629, 0.99797202, 0.49288691],
+                             [- 6.26967290, -0.00125671, 0.00077045, 7.26841620, 0.99615785, 0.99797284, 0.49288729],
+                             [- 6.26968003, -0.00125620, 0.00077014, 7.26842384, 0.99615941, 0.99797366, 0.49288765],
+                             [- 6.26968714, -0.00125569, 0.00076983, 7.26843145, 0.99616097, 0.99797448, 0.49288801],
+                             [- 6.26969422, -0.00125518, 0.00076952, 7.26843904, 0.99616252, 0.99797530, 0.49288835],
+                             [- 6.26970128, -0.00125468, 0.00076920, 7.26844661, 0.99616408, 0.99797612, 0.49288872],
+                             [- 6.26970832, -0.00125417, 0.00076889, 7.26845415, 0.99616563, 0.99797694, 0.49288910],
+                             [- 6.26971533, -0.00125366, 0.00076858, 7.26846167, 0.99616718, 0.99797775, 0.49288946],
+                             [- 6.26972232, -0.00125316, 0.00076827, 7.26846916, 0.99616873, 0.99797857, 0.49288983],
+                             [- 6.26972928, -0.00125265, 0.00076797, 7.26847663, 0.99617028, 0.99797938, 0.49289019],
+                             [- 6.26973622, -0.00125214, 0.00076766, 7.26848408, 0.99617183, 0.99798020, 0.49289056],
+                             [- 6.26974314, -0.00125164, 0.00076735, 7.26849150, 0.99617338, 0.99798101, 0.49289092],
+                             [- 6.26975003, -0.00125114, 0.00076704, 7.26849890, 0.99617492, 0.99798183, 0.49289126],
+                             [- 6.26975691, -0.00125063, 0.00076673, 7.26850627, 0.99617647, 0.99798264, 0.49289162],
+                             [- 6.26976375, -0.00125013, 0.00076642, 7.26851363, 0.99617801, 0.99798345, 0.49289199],
+                             [- 6.26977058, -0.00124962, 0.00076611, 7.26852095, 0.99617955, 0.99798426, 0.49289234],
+                             [- 6.26977738, -0.00124912, 0.00076581, 7.26852826, 0.99618109, 0.99798507, 0.49289269],
+                             [- 6.26978416, -0.00124862, 0.00076550, 7.26853554, 0.99618263, 0.99798588, 0.49289304],
+                             [- 6.26979092, -0.00124812, 0.00076519, 7.26854280, 0.99618417, 0.99798669, 0.49289341],
+                             [- 6.26979765, -0.00124762, 0.00076488, 7.26855003, 0.99618571, 0.99798750, 0.49289376],
+                             [- 6.26980436, -0.00124711, 0.00076458, 7.26855725, 0.99618724, 0.99798831, 0.49289409],
+                             [- 6.26981105, -0.00124661, 0.00076427, 7.26856444, 0.99618878, 0.99798912, 0.49289444],
+                             [- 6.26981772, -0.00124611, 0.00076396, 7.26857160, 0.99619031, 0.99798992, 0.49289482],
+                             [- 6.26982436, -0.00124561, 0.00076366, 7.26857875, 0.99619184, 0.99799073, 0.49289516],
+                             [- 6.26983098, -0.00124511, 0.00076335, 7.26858587, 0.99619337, 0.99799154, 0.49289554],
+                             [- 6.26983758, -0.00124461, 0.00076305, 7.26859297, 0.99619490, 0.99799234, 0.49289586],
+                             [- 6.26984416, -0.00124412, 0.00076274, 7.26860004, 0.99619643, 0.99799314, 0.49289620],
+                             [- 6.26985071, -0.00124362, 0.00076244, 7.26860710, 0.99619796, 0.99799395, 0.49289657],
+                             [- 6.26985725, -0.00124312, 0.00076213, 7.26861413, 0.99619949, 0.99799475, 0.49289690],
+                             [- 6.26986376, -0.00124262, 0.00076183, 7.26862114, 0.99620101, 0.99799555, 0.49289724],
+                             [- 6.26987025, -0.00124212, 0.00076152, 7.26862812, 0.99620253, 0.99799636, 0.49289757],
+                             [- 6.26987672, -0.00124163, 0.00076122, 7.26863509, 0.99620406, 0.99799716, 0.49289792],
+                             [- 6.26988316, -0.00124113, 0.00076091, 7.26864203, 0.99620558, 0.99799796, 0.49289828],
+                             [- 6.26988959, -0.00124063, 0.00076061, 7.26864895, 0.99620710, 0.99799876, 0.49289862],
+                             [- 6.26989599, -0.00124014, 0.00076031, 7.26865585, 0.99620862, 0.99799956, 0.49289895],
+                             [- 6.26990237, -0.00123964, 0.00076000, 7.26866273, 0.99621013, 0.99800035, 0.49289931],
+                             [- 6.26990873, -0.00123915, 0.00075970, 7.26866958, 0.99621165, 0.99800115, 0.49289965],
+                             [- 6.26991507, -0.00123865, 0.00075940, 7.26867642, 0.99621317, 0.99800195, 0.49289998],
+                             [- 6.26992139, -0.00123816, 0.00075909, 7.26868323, 0.99621468, 0.99800275, 0.49290032],
+                             [- 6.26992769, -0.00123767, 0.00075879, 7.26869002, 0.99621619, 0.99800354, 0.49290066],
+                             [- 6.26993396, -0.00123717, 0.00075849, 7.26869679, 0.99621770, 0.99800434, 0.49290100],
+                             [- 6.26994022, -0.00123668, 0.00075819, 7.26870354, 0.99621921, 0.99800513, 0.49290132],
+                             [- 6.26994645, -0.00123619, 0.00075789, 7.26871027, 0.99622072, 0.99800593, 0.49290166],
+                             [- 6.26995267, -0.00123569, 0.00075758, 7.26871697, 0.99622223, 0.99800672, 0.49290199],
+                             [- 6.26995886, -0.00123520, 0.00075728, 7.26872366, 0.99622374, 0.99800751, 0.49290231],
+                             [- 6.26996503, -0.00123471, 0.00075698, 7.26873032, 0.99622524, 0.99800831, 0.49290268],
+                             [- 6.26997119, -0.00123422, 0.00075668, 7.26873697, 0.99622675, 0.99800910, 0.49290298],
+                             [- 6.26997732, -0.00123373, 0.00075638, 7.26874359, 0.99622825, 0.99800989, 0.49290333],
+                             [- 6.26998343, -0.00123324, 0.00075608, 7.26875019, 0.99622975, 0.99801068, 0.49290366],
+                             [- 6.26998952, -0.00123275, 0.00075578, 7.26875677, 0.99623126, 0.99801147, 0.49290397],
+                             [- 6.26999559, -0.00123226, 0.00075548, 7.26876333, 0.99623275, 0.99801226, 0.49290432],
+                             [- 6.27000164, -0.00123177, 0.00075518, 7.26876987, 0.99623425, 0.99801305, 0.49290464],
+                             [- 6.27000767, -0.00123128, 0.00075488, 7.26877639, 0.99623575, 0.99801384, 0.49290499],
+                             [- 6.27001368, -0.00123079, 0.00075458, 7.26878289, 0.99623725, 0.99801462, 0.49290530],
+                             [- 6.27001968, -0.00123031, 0.00075428, 7.26878937, 0.99623874, 0.99801541, 0.49290562],
+                             [- 6.27002565, -0.00122982, 0.00075399, 7.26879583, 0.99624024, 0.99801620, 0.49290596],
+                             [- 6.27003160, -0.00122933, 0.00075369, 7.26880227, 0.99624173, 0.99801698, 0.49290628],
+                             [- 6.27003753, -0.00122884, 0.00075339, 7.26880869, 0.99624322, 0.99801777, 0.49290660],
+                             [- 6.27004344, -0.00122836, 0.00075309, 7.26881508, 0.99624471, 0.99801855, 0.49290693],
+                             [- 6.27004933, -0.00122787, 0.00075279, 7.26882146, 0.99624620, 0.99801934, 0.49290725],
+                             [- 6.27005521, -0.00122739, 0.00075250, 7.26882782, 0.99624769, 0.99802012, 0.49290756],
+                             [- 6.27006106, -0.00122690, 0.00075220, 7.26883416, 0.99624917, 0.99802090, 0.49290790],
+                             [- 6.27006690, -0.00122642, 0.00075190, 7.26884048, 0.99625066, 0.99802168, 0.49290821],
+                             [- 6.27007271, -0.00122593, 0.00075160, 7.26884678, 0.99625214, 0.99802246, 0.49290851],
+                             [- 6.27007851, -0.00122545, 0.00075131, 7.26885306, 0.99625363, 0.99802324, 0.49290885],
+                             [- 6.27008428, -0.00122496, 0.00075101, 7.26885932, 0.99625511, 0.99802402, 0.49290916],
+                             [- 6.27009004, -0.00122448, 0.00075072, 7.26886556, 0.99625659, 0.99802480, 0.49290948],
+                             [- 6.27009578, -0.00122400, 0.00075042, 7.26887178, 0.99625807, 0.99802558, 0.49290980],
+                             [- 6.27010150, -0.00122351, 0.00075012, 7.26887799, 0.99625955, 0.99802636, 0.49291012],
+                             [- 6.27010720, -0.00122303, 0.00074983, 7.26888417, 0.99626102, 0.99802714, 0.49291045],
+                             [- 6.27011288, -0.00122255, 0.00074953, 7.26889033, 0.99626250, 0.99802792, 0.49291075],
+                             [- 6.27011855, -0.00122207, 0.00074924, 7.26889648, 0.99626398, 0.99802869, 0.49291108],
+                             [- 6.27012419, -0.00122159, 0.00074894, 7.26890260, 0.99626545, 0.99802947, 0.49291137],
+                             [- 6.27012982, -0.00122111, 0.00074865, 7.26890871, 0.99626692, 0.99803024, 0.49291169],
+                             [- 6.27013543, -0.00122063, 0.00074836, 7.26891480, 0.99626839, 0.99803102, 0.49291199],
+                             [- 6.27014102, -0.00122015, 0.00074806, 7.26892087, 0.99626986, 0.99803179, 0.49291232],
+                             [- 6.27014659, -0.00121967, 0.00074777, 7.26892692, 0.99627133, 0.99803257, 0.49291262],
+                             [- 6.27015214, -0.00121919, 0.00074747, 7.26893295, 0.99627280, 0.99803334, 0.49291295],
+                             [- 6.27015767, -0.00121871, 0.00074718, 7.26893897, 0.99627427, 0.99803411, 0.49291325],
+                             [- 6.27016319, -0.00121823, 0.00074689, 7.26894496, 0.99627574, 0.99803488, 0.49291356],
+                             [- 6.27016869, -0.00121775, 0.00074659, 7.26895094, 0.99627720, 0.99803565, 0.49291386],
+                             [- 6.27017417, -0.00121727, 0.00074630, 7.26895690, 0.99627866, 0.99803642, 0.49291418],
+                             [- 6.27017963, -0.00121680, 0.00074601, 7.26896284, 0.99628013, 0.99803719, 0.49291448],
+                             [- 6.27018508, -0.00121632, 0.00074572, 7.26896876, 0.99628159, 0.99803796, 0.49291478],
+                             [- 6.27019050, -0.00121584, 0.00074543, 7.26897466, 0.99628305, 0.99803873, 0.49291509],
+                             [- 6.27019591, -0.00121537, 0.00074513, 7.26898055, 0.99628451, 0.99803950, 0.49291539],
+                             [- 6.27020130, -0.00121489, 0.00074484, 7.26898641, 0.99628596, 0.99804027, 0.49291571],
+                             [- 6.27020668, -0.00121441, 0.00074455, 7.26899226, 0.99628742, 0.99804103, 0.49291599],
+                             [- 6.27021203, -0.00121394, 0.00074426, 7.26899810, 0.99628888, 0.99804180, 0.49291629],
+                             [- 6.27021737, -0.00121346, 0.00074397, 7.26900391, 0.99629033, 0.99804257, 0.49291660],
+                             [- 6.27022270, -0.00121299, 0.00074368, 7.26900971, 0.99629178, 0.99804333, 0.49291688],
+                             [- 6.27022800, -0.00121252, 0.00074339, 7.26901548, 0.99629324, 0.99804410, 0.49291722],
+                             [- 6.27023329, -0.00121204, 0.00074310, 7.26902124, 0.99629469, 0.99804486, 0.49291750],
+                             [- 6.27023856, -0.00121157, 0.00074281, 7.26902699, 0.99629614, 0.99804562, 0.49291781],
+                             [- 6.27024381, -0.00121110, 0.00074252, 7.26903271, 0.99629759, 0.99804639, 0.49291812],
+                             [- 6.27024904, -0.00121062, 0.00074223, 7.26903842, 0.99629903, 0.99804715, 0.49291840],
+                             [- 6.27025426, -0.00121015, 0.00074194, 7.26904411, 0.99630048, 0.99804791, 0.49291870],
+                             [- 6.27025946, -0.00120968, 0.00074165, 7.26904979, 0.99630193, 0.99804867, 0.49291902],
+                             [- 6.27026465, -0.00120921, 0.00074136, 7.26905544, 0.99630337, 0.99804943, 0.49291932],
+                             [- 6.27026982, -0.00120874, 0.00074107, 7.26906108, 0.99630481, 0.99805019, 0.49291960],
+                             [- 6.27027497, -0.00120827, 0.00074078, 7.26906670, 0.99630626, 0.99805095, 0.49291988],
+                             [- 6.27028010, -0.00120780, 0.00074050, 7.26907231, 0.99630770, 0.99805171, 0.49292018],
+                             [- 6.27028522, -0.00120732, 0.00074021, 7.26907789, 0.99630914, 0.99805247, 0.49292047],
+                             [- 6.27029032, -0.00120686, 0.00073992, 7.26908347, 0.99631057, 0.99805322, 0.49292077],
+                             [- 6.27029541, -0.00120639, 0.00073963, 7.26908902, 0.99631201, 0.99805398, 0.49292106],
+                             [- 6.27030047, -0.00120592, 0.00073934, 7.26909456, 0.99631345, 0.99805474, 0.49292137],
+                             [- 6.27030552, -0.00120545, 0.00073906, 7.26910008, 0.99631488, 0.99805549, 0.49292164],
+                             [- 6.27031056, -0.00120498, 0.00073877, 7.26910558, 0.99631632, 0.99805625, 0.49292193],
+                             [- 6.27031558, -0.00120451, 0.00073848, 7.26911107, 0.99631775, 0.99805700, 0.49292223],
+                             [- 6.27032058, -0.00120404, 0.00073820, 7.26911654, 0.99631918, 0.99805776, 0.49292252],
+                             [- 6.27032557, -0.00120358, 0.00073791, 7.26912199, 0.99632061, 0.99805851, 0.49292278],
+                             [- 6.27033054, -0.00120311, 0.00073763, 7.26912743, 0.99632204, 0.99805926, 0.49292312],
+                             [- 6.27033549, -0.00120264, 0.00073734, 7.26913285, 0.99632347, 0.99806002, 0.49292338],
+                             [- 6.27034043, -0.00120218, 0.00073705, 7.26913825, 0.99632490, 0.99806077, 0.49292367],
+                             [- 6.27034536, -0.00120171, 0.00073677, 7.26914364, 0.99632633, 0.99806152, 0.49292394],
+                             [- 6.27035026, -0.00120125, 0.00073648, 7.26914902, 0.99632775, 0.99806227, 0.49292425],
+                             [- 6.27035515, -0.00120078, 0.00073620, 7.26915437, 0.99632918, 0.99806302, 0.49292452],
+                             [- 6.27036003, -0.00120032, 0.00073591, 7.26915971, 0.99633060, 0.99806377, 0.49292480],
+                             [- 6.27036489, -0.00119985, 0.00073563, 7.26916504, 0.99633202, 0.99806452, 0.49292511],
+                             [- 6.27036973, -0.00119939, 0.00073535, 7.26917034, 0.99633344, 0.99806527, 0.49292536],
+                             [- 6.27037456, -0.00119892, 0.00073506, 7.26917564, 0.99633486, 0.99806601, 0.49292567],
+                             [- 6.27037937, -0.00119846, 0.00073478, 7.26918091, 0.99633628, 0.99806676, 0.49292595],
+                             [- 6.27038417, -0.00119800, 0.00073449, 7.26918617, 0.99633770, 0.99806751, 0.49292622],
+                             [- 6.27038895, -0.00119754, 0.00073421, 7.26919142, 0.99633912, 0.99806825, 0.49292651],
+                             [- 6.27039372, -0.00119707, 0.00073393, 7.26919664, 0.99634053, 0.99806900, 0.49292678],
+                             [- 6.27039847, -0.00119661, 0.00073364, 7.26920186, 0.99634195, 0.99806974, 0.49292707],
+                             [- 6.27040321, -0.00119615, 0.00073336, 7.26920706, 0.99634336, 0.99807049, 0.49292736],
+                             [- 6.27040793, -0.00119569, 0.00073308, 7.26921224, 0.99634477, 0.99807123, 0.49292762],
+                             [- 6.27041263, -0.00119523, 0.00073280, 7.26921740, 0.99634618, 0.99807198, 0.49292790],
+                             [- 6.27041732, -0.00119477, 0.00073251, 7.26922256, 0.99634759, 0.99807272, 0.49292816],
+                             [- 6.27042200, -0.00119431, 0.00073223, 7.26922769, 0.99634900, 0.99807346, 0.49292845],
+                             [- 6.27042666, -0.00119385, 0.00073195, 7.26923281, 0.99635041, 0.99807420, 0.49292873],
+                             [- 6.27043131, -0.00119339, 0.00073167, 7.26923792, 0.99635182, 0.99807494, 0.49292902],
+                             [- 6.27043594, -0.00119293, 0.00073139, 7.26924301, 0.99635322, 0.99807568, 0.49292929],
+                             [- 6.27044055, -0.00119247, 0.00073111, 7.26924808, 0.99635463, 0.99807642, 0.49292955],
+                             [- 6.27044516, -0.00119201, 0.00073083, 7.26925314, 0.99635603, 0.99807716, 0.49292983],
+                             [- 6.27044974, -0.00119155, 0.00073054, 7.26925819, 0.99635743, 0.99807790, 0.49293011],
+                             [- 6.27045432, -0.00119110, 0.00073026, 7.26926322, 0.99635884, 0.99807864, 0.49293037],
+                             [- 6.27045887, -0.00119064, 0.00072998, 7.26926823, 0.99636024, 0.99807938, 0.49293066],
+                             [- 6.27046342, -0.00119018, 0.00072970, 7.26927323, 0.99636164, 0.99808011, 0.49293095],
+                             [- 6.27046795, -0.00118973, 0.00072942, 7.26927822, 0.99636303, 0.99808085, 0.49293118],
+                             [- 6.27047246, -0.00118927, 0.00072914, 7.26928319, 0.99636443, 0.99808158, 0.49293146],
+                             [- 6.27047696, -0.00118881, 0.00072887, 7.26928815, 0.99636583, 0.99808232, 0.49293175],
+                             [- 6.27048145, -0.00118836, 0.00072859, 7.26929309, 0.99636722, 0.99808305, 0.49293201],
+                             [- 6.27048592, -0.00118790, 0.00072831, 7.26929802, 0.99636862, 0.99808379, 0.49293228],
+                             [- 6.27049038, -0.00118745, 0.00072803, 7.26930293, 0.99637001, 0.99808452, 0.49293255],
+                             [- 6.27049482, -0.00118699, 0.00072775, 7.26930783, 0.99637140, 0.99808526, 0.49293281],
+                             [- 6.27049925, -0.00118654, 0.00072747, 7.26931271, 0.99637279, 0.99808599, 0.49293309],
+                             [- 6.27050366, -0.00118609, 0.00072719, 7.26931758, 0.99637418, 0.99808672, 0.49293334],
+                             [- 6.27050807, -0.00118563, 0.00072692, 7.26932243, 0.99637557, 0.99808745, 0.49293360],
+                             [- 6.27051245, -0.00118518, 0.00072664, 7.26932727, 0.99637696, 0.99808818, 0.49293390],
+                             [- 6.27051683, -0.00118473, 0.00072636, 7.26933210, 0.99637835, 0.99808891, 0.49293415],
+                             [- 6.27052119, -0.00118427, 0.00072608, 7.26933691, 0.99637973, 0.99808964, 0.49293444],
+                             [- 6.27052553, -0.00118382, 0.00072581, 7.26934171, 0.99638112, 0.99809037, 0.49293467],
+                             [- 6.27052986, -0.00118337, 0.00072553, 7.26934649, 0.99638250, 0.99809110, 0.49293494],
+                             [- 6.27053418, -0.00118292, 0.00072525, 7.26935126, 0.99638388, 0.99809183, 0.49293521],
+                             [- 6.27053849, -0.00118247, 0.00072498, 7.26935602, 0.99638526, 0.99809256, 0.49293547],
+                             [- 6.27054278, -0.00118202, 0.00072470, 7.26936076, 0.99638664, 0.99809328, 0.49293575],
+                             [- 6.27054706, -0.00118157, 0.00072442, 7.26936549, 0.99638802, 0.99809401, 0.49293600],
+                             [- 6.27055132, -0.00118112, 0.00072415, 7.26937020, 0.99638940, 0.99809474, 0.49293625],
+                             [- 6.27055557, -0.00118067, 0.00072387, 7.26937491, 0.99639078, 0.99809546, 0.49293651],
+                             [- 6.27055981, -0.00118022, 0.00072360, 7.26937959, 0.99639215, 0.99809619, 0.49293677],
+                             [- 6.27056403, -0.00117977, 0.00072332, 7.26938427, 0.99639353, 0.99809691, 0.49293703],
+                             [- 6.27056825, -0.00117932, 0.00072305, 7.26938893, 0.99639490, 0.99809763, 0.49293729],
+                             [- 6.27057244, -0.00117887, 0.00072277, 7.26939357, 0.99639628, 0.99809836, 0.49293754],
+                             [- 6.27057663, -0.00117842, 0.00072250, 7.26939820, 0.99639765, 0.99809908, 0.49293783],
+                             [- 6.27058080, -0.00117798, 0.00072222, 7.26940282, 0.99639902, 0.99809980, 0.49293807],
+                             [- 6.27058496, -0.00117753, 0.00072195, 7.26940743, 0.99640039, 0.99810052, 0.49293833],
+                             [- 6.27058910, -0.00117708, 0.00072167, 7.26941202, 0.99640176, 0.99810124, 0.49293858],
+                             [- 6.27059324, -0.00117663, 0.00072140, 7.26941660, 0.99640312, 0.99810196, 0.49293885],
+                             [- 6.27059736, -0.00117619, 0.00072113, 7.26942117, 0.99640449, 0.99810268, 0.49293910],
+                             [- 6.27060146, -0.00117574, 0.00072085, 7.26942572, 0.99640586, 0.99810340, 0.49293936],
+                             [- 6.27060556, -0.00117530, 0.00072058, 7.26943026, 0.99640722, 0.99810412, 0.49293961],
+                             [- 6.27060964, -0.00117485, 0.00072031, 7.26943479, 0.99640859, 0.99810484, 0.49293988],
+                             [- 6.27061371, -0.00117441, 0.00072004, 7.26943930, 0.99640995, 0.99810556, 0.49294014],
+                             [- 6.27061776, -0.00117396, 0.00071976, 7.26944380, 0.99641131, 0.99810628, 0.49294037],
+                             [- 6.27062180, -0.00117352, 0.00071949, 7.26944829, 0.99641267, 0.99810699, 0.49294061],
+                             [- 6.27062583, -0.00117307, 0.00071922, 7.26945276, 0.99641403, 0.99810771, 0.49294091],
+                             [- 6.27062985, -0.00117263, 0.00071895, 7.26945722, 0.99641539, 0.99810842, 0.49294113],
+                             [- 6.27063386, -0.00117219, 0.00071867, 7.26946167, 0.99641675, 0.99810914, 0.49294137],
+                             [- 6.27063785, -0.00117174, 0.00071840, 7.26946611, 0.99641810, 0.99810985, 0.49294161],
+                             [- 6.27064183, -0.00117130, 0.00071813, 7.26947053, 0.99641946, 0.99811057, 0.49294187],
+                             [- 6.27064580, -0.00117086, 0.00071786, 7.26947494, 0.99642081, 0.99811128, 0.49294216],
+                             [- 6.27064976, -0.00117042, 0.00071759, 7.26947934, 0.99642217, 0.99811199, 0.49294239],
+                             [- 6.27065370, -0.00116997, 0.00071732, 7.26948372, 0.99642352, 0.99811271, 0.49294263],
+                             [- 6.27065763, -0.00116953, 0.00071705, 7.26948810, 0.99642487, 0.99811342, 0.49294289],
+                             [- 6.27066155, -0.00116909, 0.00071678, 7.26949246, 0.99642622, 0.99811413, 0.49294314],
+                             [- 6.27066546, -0.00116865, 0.00071651, 7.26949680, 0.99642757, 0.99811484, 0.49294338],
+                             [- 6.27066935, -0.00116821, 0.00071624, 7.26950114, 0.99642892, 0.99811555, 0.49294362],
+                             [- 6.27067323, -0.00116777, 0.00071597, 7.26950546, 0.99643026, 0.99811626, 0.49294387],
+                             [- 6.27067711, -0.00116733, 0.00071570, 7.26950977, 0.99643161, 0.99811697, 0.49294414],
+                             [- 6.27068096, -0.00116689, 0.00071543, 7.26951407, 0.99643296, 0.99811768, 0.49294435],
+                             [- 6.27068481, -0.00116645, 0.00071516, 7.26951836, 0.99643430, 0.99811839, 0.49294462],
+                             [- 6.27068865, -0.00116601, 0.00071489, 7.26952263, 0.99643564, 0.99811909, 0.49294486],
+                             [- 6.27069247, -0.00116558, 0.00071462, 7.26952689, 0.99643699, 0.99811980, 0.49294512],
+                             [- 6.27069628, -0.00116514, 0.00071435, 7.26953114, 0.99643833, 0.99812051, 0.49294533],
+                             [- 6.27070008, -0.00116470, 0.00071409, 7.26953538, 0.99643967, 0.99812121, 0.49294559],
+                             [- 6.27070387, -0.00116426, 0.00071382, 7.26953961, 0.99644101, 0.99812192, 0.49294582],
+                             [- 6.27070765, -0.00116383, 0.00071355, 7.26954382, 0.99644235, 0.99812262, 0.49294607],
+                             [- 6.27071141, -0.00116339, 0.00071328, 7.26954802, 0.99644368, 0.99812333, 0.49294633],
+                             [- 6.27071516, -0.00116295, 0.00071301, 7.26955221, 0.99644502, 0.99812403, 0.49294657],
+                             [- 6.27071891, -0.00116252, 0.00071275, 7.26955639, 0.99644635, 0.99812474, 0.49294678],
+                             [- 6.27072264, -0.00116208, 0.00071248, 7.26956056, 0.99644769, 0.99812544, 0.49294701],
+                             [- 6.27072636, -0.00116165, 0.00071221, 7.26956471, 0.99644902, 0.99812614, 0.49294726],
+                             [- 6.27073006, -0.00116121, 0.00071195, 7.26956885, 0.99645035, 0.99812684, 0.49294753],
+                             [- 6.27073376, -0.00116078, 0.00071168, 7.26957298, 0.99645169, 0.99812755, 0.49294774],
+                             [- 6.27073744, -0.00116034, 0.00071141, 7.26957710, 0.99645302, 0.99812825, 0.49294799],
+                             [- 6.27074112, -0.00115991, 0.00071115, 7.26958121, 0.99645434, 0.99812895, 0.49294824],
+                             [- 6.27074478, -0.00115947, 0.00071088, 7.26958531, 0.99645567, 0.99812965, 0.49294849],
+                             [- 6.27074843, -0.00115904, 0.00071062, 7.26958939, 0.99645700, 0.99813035, 0.49294867],
+                             [- 6.27075207, -0.00115861, 0.00071035, 7.26959347, 0.99645833, 0.99813104, 0.49294894],
+                             [- 6.27075570, -0.00115817, 0.00071008, 7.26959753, 0.99645965, 0.99813174, 0.49294918],
+                             [- 6.27075932, -0.00115774, 0.00070982, 7.26960158, 0.99646098, 0.99813244, 0.49294940],
+                             [- 6.27076293, -0.00115731, 0.00070955, 7.26960562, 0.99646230, 0.99813314, 0.49294966],
+                             [- 6.27076652, -0.00115688, 0.00070929, 7.26960965, 0.99646362, 0.99813383, 0.49294988],
+                             [- 6.27077011, -0.00115644, 0.00070902, 7.26961366, 0.99646494, 0.99813453, 0.49295014],
+                             [- 6.27077368, -0.00115601, 0.00070876, 7.26961767, 0.99646626, 0.99813523, 0.49295035],
+                             [- 6.27077724, -0.00115558, 0.00070850, 7.26962166, 0.99646758, 0.99813592, 0.49295058],
+                             [- 6.27078080, -0.00115515, 0.00070823, 7.26962565, 0.99646890, 0.99813662, 0.49295081],
+                             [- 6.27078434, -0.00115472, 0.00070797, 7.26962962, 0.99647022, 0.99813731, 0.49295107],
+                             [- 6.27078787, -0.00115429, 0.00070770, 7.26963358, 0.99647154, 0.99813800, 0.49295129],
+                             [- 6.27079139, -0.00115386, 0.00070744, 7.26963753, 0.99647285, 0.99813870, 0.49295151],
+                             [- 6.27079490, -0.00115343, 0.00070718, 7.26964147, 0.99647417, 0.99813939, 0.49295175],
+                             [- 6.27079840, -0.00115300, 0.00070692, 7.26964540, 0.99647548, 0.99814008, 0.49295200],
+                             [- 6.27080189, -0.00115257, 0.00070665, 7.26964931, 0.99647679, 0.99814077, 0.49295221],
+                             [- 6.27080537, -0.00115215, 0.00070639, 7.26965322, 0.99647810, 0.99814146, 0.49295246],
+                             [- 6.27080883, -0.00115172, 0.00070613, 7.26965711, 0.99647941, 0.99814215, 0.49295267],
+                             [- 6.27081229, -0.00115129, 0.00070586, 7.26966100, 0.99648072, 0.99814284, 0.49295289],
+                             [- 6.27081574, -0.00115086, 0.00070560, 7.26966487, 0.99648203, 0.99814353, 0.49295314],
+                             [- 6.27081917, -0.00115044, 0.00070534, 7.26966874, 0.99648334, 0.99814422, 0.49295337],
+                             [- 6.27082260, -0.00115001, 0.00070508, 7.26967259, 0.99648465, 0.99814491, 0.49295357],
+                             [- 6.27082601, -0.00114958, 0.00070482, 7.26967643, 0.99648595, 0.99814560, 0.49295381],
+                             [- 6.27082942, -0.00114916, 0.00070456, 7.26968026, 0.99648726, 0.99814629, 0.49295404],
+                             [- 6.27083281, -0.00114873, 0.00070430, 7.26968408, 0.99648856, 0.99814697, 0.49295428],
+                             [- 6.27083620, -0.00114830, 0.00070403, 7.26968789, 0.99648986, 0.99814766, 0.49295451],
+                             [- 6.27083957, -0.00114788, 0.00070377, 7.26969169, 0.99649117, 0.99814835, 0.49295473],
+                             [- 6.27084294, -0.00114745, 0.00070351, 7.26969548, 0.99649247, 0.99814903, 0.49295497],
+                             [- 6.27084629, -0.00114703, 0.00070325, 7.26969926, 0.99649377, 0.99814972, 0.49295518],
+                             [- 6.27084964, -0.00114661, 0.00070299, 7.26970303, 0.99649507, 0.99815040, 0.49295540],
+                             [- 6.27085297, -0.00114618, 0.00070273, 7.26970679, 0.99649636, 0.99815109, 0.49295563],
+                             [- 6.27085630, -0.00114576, 0.00070247, 7.26971054, 0.99649766, 0.99815177, 0.49295584],
+                             [- 6.27085961, -0.00114533, 0.00070221, 7.26971428, 0.99649896, 0.99815245, 0.49295609],
+                             [- 6.27086292, -0.00114491, 0.00070195, 7.26971800, 0.99650025, 0.99815313, 0.49295629],
+                             [- 6.27086621, -0.00114449, 0.00070169, 7.26972172, 0.99650155, 0.99815382, 0.49295653],
+                             [- 6.27086950, -0.00114407, 0.00070144, 7.26972543, 0.99650284, 0.99815450, 0.49295673],
+                             [- 6.27087277, -0.00114364, 0.00070118, 7.26972913, 0.99650413, 0.99815518, 0.49295696],
+                             [- 6.27087604, -0.00114322, 0.00070092, 7.26973281, 0.99650542, 0.99815586, 0.49295720],
+                             [- 6.27087929, -0.00114280, 0.00070066, 7.26973649, 0.99650671, 0.99815654, 0.49295739],
+                             [- 6.27088254, -0.00114238, 0.00070040, 7.26974016, 0.99650800, 0.99815722, 0.49295764],
+                             [- 6.27088577, -0.00114196, 0.00070014, 7.26974382, 0.99650929, 0.99815790, 0.49295785],
+                             [- 6.27088900, -0.00114154, 0.00069989, 7.26974746, 0.99651058, 0.99815858, 0.49295811],
+                             [- 6.27089222, -0.00114112, 0.00069963, 7.26975110, 0.99651187, 0.99815925, 0.49295829],
+                             [- 6.27089543, -0.00114070, 0.00069937, 7.26975473, 0.99651315, 0.99815993, 0.49295850],
+                             [- 6.27089862, -0.00114028, 0.00069911, 7.26975835, 0.99651444, 0.99816061, 0.49295875],
+                             [- 6.27090181, -0.00113986, 0.00069886, 7.26976195, 0.99651572, 0.99816129, 0.49295895],
+                             [- 6.27090499, -0.00113944, 0.00069860, 7.26976555, 0.99651700, 0.99816196, 0.49295918],
+                             [- 6.27090816, -0.00113902, 0.00069834, 7.26976914, 0.99651829, 0.99816264, 0.49295938],
+                             [- 6.27091132, -0.00113860, 0.00069809, 7.26977272, 0.99651957, 0.99816331, 0.49295963],
+                             [- 6.27091447, -0.00113818, 0.00069783, 7.26977629, 0.99652085, 0.99816399, 0.49295982],
+                             [- 6.27091762, -0.00113777, 0.00069757, 7.26977985, 0.99652213, 0.99816466, 0.49296003],
+                             [- 6.27092075, -0.00113735, 0.00069732, 7.26978340, 0.99652340, 0.99816533, 0.49296028],
+                             [- 6.27092387, -0.00113693, 0.00069706, 7.26978694, 0.99652468, 0.99816601, 0.49296049],
+                             [- 6.27092699, -0.00113651, 0.00069681, 7.26979047, 0.99652596, 0.99816668, 0.49296071],
+                             [- 6.27093009, -0.00113610, 0.00069655, 7.26979399, 0.99652723, 0.99816735, 0.49296091],
+                             [- 6.27093319, -0.00113568, 0.00069629, 7.26979751, 0.99652851, 0.99816802, 0.49296112],
+                             [- 6.27093627, -0.00113527, 0.00069604, 7.26980101, 0.99652978, 0.99816869, 0.49296137],
+                             [- 6.27093935, -0.00113485, 0.00069578, 7.26980450, 0.99653105, 0.99816937, 0.49296155],
+                             [- 6.27094242, -0.00113443, 0.00069553, 7.26980799, 0.99653232, 0.99817004, 0.49296176],
+                             [- 6.27094548, -0.00113402, 0.00069528, 7.26981146, 0.99653360, 0.99817070, 0.49296198],
+                             [- 6.27094853, -0.00113360, 0.00069502, 7.26981493, 0.99653487, 0.99817137, 0.49296221],
+                             [- 6.27095157, -0.00113319, 0.00069477, 7.26981838, 0.99653613, 0.99817204, 0.49296241],
+                             [- 6.27095461, -0.00113278, 0.00069451, 7.26982183, 0.99653740, 0.99817271, 0.49296261],
+                             [- 6.27095763, -0.00113236, 0.00069426, 7.26982527, 0.99653867, 0.99817338, 0.49296284],
+                             [- 6.27096065, -0.00113195, 0.00069401, 7.26982870, 0.99653994, 0.99817405, 0.49296306],
+                             [- 6.27096365, -0.00113154, 0.00069375, 7.26983212, 0.99654120, 0.99817471, 0.49296324],
+                             [- 6.27096665, -0.00113112, 0.00069350, 7.26983553, 0.99654246, 0.99817538, 0.49296349],
+                             [- 6.27096964, -0.00113071, 0.00069325, 7.26983893, 0.99654373, 0.99817604, 0.49296367],
+                             [- 6.27097262, -0.00113030, 0.00069299, 7.26984232, 0.99654499, 0.99817671, 0.49296390],
+                             [- 6.27097559, -0.00112989, 0.00069274, 7.26984571, 0.99654625, 0.99817737, 0.49296411],
+                             [- 6.27097856, -0.00112947, 0.00069249, 7.26984908, 0.99654751, 0.99817804, 0.49296432],
+                             [- 6.27098151, -0.00112906, 0.00069224, 7.26985245, 0.99654877, 0.99817870, 0.49296451],
+                             [- 6.27098446, -0.00112865, 0.00069198, 7.26985581, 0.99655003, 0.99817937, 0.49296475],
+                             [- 6.27098739, -0.00112824, 0.00069173, 7.26985915, 0.99655129, 0.99818003, 0.49296493],
+                             [- 6.27099032, -0.00112783, 0.00069148, 7.26986249, 0.99655255, 0.99818069, 0.49296516],
+                             [- 6.27099324, -0.00112742, 0.00069123, 7.26986583, 0.99655380, 0.99818135, 0.49296535],
+                             [- 6.27099616, -0.00112701, 0.00069098, 7.26986915, 0.99655506, 0.99818202, 0.49296556],
+                             [- 6.27099906, -0.00112660, 0.00069072, 7.26987246, 0.99655631, 0.99818268, 0.49296577],
+                             [- 6.27100196, -0.00112619, 0.00069047, 7.26987577, 0.99655756, 0.99818334, 0.49296597],
+                             [- 6.27100484, -0.00112578, 0.00069022, 7.26987906, 0.99655882, 0.99818400, 0.49296619],
+                             [- 6.27100772, -0.00112537, 0.00068997, 7.26988235, 0.99656007, 0.99818466, 0.49296639],
+                             [- 6.27101059, -0.00112496, 0.00068972, 7.26988563, 0.99656132, 0.99818532, 0.49296663],
+                             [- 6.27101345, -0.00112455, 0.00068947, 7.26988890, 0.99656257, 0.99818597, 0.49296681],
+                             [- 6.27101631, -0.00112415, 0.00068922, 7.26989216, 0.99656382, 0.99818663, 0.49296699],
+                             [- 6.27101915, -0.00112374, 0.00068897, 7.26989541, 0.99656506, 0.99818729, 0.49296722],
+                             [- 6.27102199, -0.00112333, 0.00068872, 7.26989866, 0.99656631, 0.99818795, 0.49296743],
+                             [- 6.27102482, -0.00112292, 0.00068847, 7.26990189, 0.99656756, 0.99818860, 0.49296764],
+                             [- 6.27102764, -0.00112252, 0.00068822, 7.26990512, 0.99656880, 0.99818926, 0.49296783],
+                             [- 6.27103045, -0.00112211, 0.00068797, 7.26990834, 0.99657005, 0.99818992, 0.49296802],
+                             [- 6.27103326, -0.00112171, 0.00068772, 7.26991155, 0.99657129, 0.99819057, 0.49296822],
+                             [- 6.27103606, -0.00112130, 0.00068747, 7.26991476, 0.99657253, 0.99819123, 0.49296843],
+                             [- 6.27103885, -0.00112089, 0.00068723, 7.26991795, 0.99657377, 0.99819188, 0.49296863],
+                             [- 6.27104163, -0.00112049, 0.00068698, 7.26992114, 0.99657501, 0.99819253, 0.49296882],
+                             [- 6.27104440, -0.00112008, 0.00068673, 7.26992432, 0.99657625, 0.99819319, 0.49296903],
+                             [- 6.27104717, -0.00111968, 0.00068648, 7.26992749, 0.99657749, 0.99819384, 0.49296925],
+                             [- 6.27104992, -0.00111927, 0.00068623, 7.26993065, 0.99657873, 0.99819449, 0.49296948],
+                             [- 6.27105267, -0.00111887, 0.00068599, 7.26993380, 0.99657997, 0.99819514, 0.49296966],
+                             [- 6.27105541, -0.00111847, 0.00068574, 7.26993695, 0.99658120, 0.99819580, 0.49296986],
+                             [- 6.27105815, -0.00111806, 0.00068549, 7.26994009, 0.99658244, 0.99819645, 0.49297006],
+                             [- 6.27106088, -0.00111766, 0.00068524, 7.26994322, 0.99658367, 0.99819710, 0.49297025],
+                             [- 6.27106359, -0.00111726, 0.00068500, 7.26994634, 0.99658491, 0.99819775, 0.49297043],
+                             [- 6.27106630, -0.00111685, 0.00068475, 7.26994945, 0.99658614, 0.99819840, 0.49297064],
+                             [- 6.27106901, -0.00111645, 0.00068450, 7.26995256, 0.99658737, 0.99819905, 0.49297085],
+                             [- 6.27107170, -0.00111605, 0.00068426, 7.26995565, 0.99658860, 0.99819970, 0.49297106],
+                             [- 6.27107439, -0.00111565, 0.00068401, 7.26995874, 0.99658983, 0.99820034, 0.49297123],
+                             [- 6.27107707, -0.00111525, 0.00068376, 7.26996183, 0.99659106, 0.99820099, 0.49297145],
+                             [- 6.27107974, -0.00111484, 0.00068352, 7.26996490, 0.99659229, 0.99820164, 0.49297165],
+                             [- 6.27108241, -0.00111444, 0.00068327, 7.26996797, 0.99659352, 0.99820229, 0.49297182],
+                             [- 6.27108507, -0.00111404, 0.00068302, 7.26997103, 0.99659474, 0.99820293, 0.49297202],
+                             [- 6.27108772, -0.00111364, 0.00068278, 7.26997408, 0.99659597, 0.99820358, 0.49297222],
+                             [- 6.27109036, -0.00111324, 0.00068253, 7.26997712, 0.99659719, 0.99820422, 0.49297241],
+                             [- 6.27109300, -0.00111284, 0.00068229, 7.26998015, 0.99659842, 0.99820487, 0.49297262],
+                             [- 6.27109562, -0.00111244, 0.00068204, 7.26998318, 0.99659964, 0.99820551, 0.49297281],
+                             [- 6.27109825, -0.00111204, 0.00068180, 7.26998620, 0.99660086, 0.99820616, 0.49297301],
+                             [- 6.27110086, -0.00111164, 0.00068155, 7.26998921, 0.99660208, 0.99820680, 0.49297320],
+                             [- 6.27110347, -0.00111125, 0.00068131, 7.26999222, 0.99660330, 0.99820744, 0.49297339],
+                             [- 6.27110606, -0.00111085, 0.00068106, 7.26999522, 0.99660452, 0.99820809, 0.49297359],
+                             [- 6.27110866, -0.00111045, 0.00068082, 7.26999821, 0.99660574, 0.99820873, 0.49297380],
+                             [- 6.27111124, -0.00111005, 0.00068058, 7.27000119, 0.99660696, 0.99820937, 0.49297397],
+                             [- 6.27111382, -0.00110965, 0.00068033, 7.27000416, 0.99660818, 0.99821001, 0.49297417],
+                             [- 6.27111639, -0.00110926, 0.00068009, 7.27000713, 0.99660939, 0.99821065, 0.49297437],
+                             [- 6.27111895, -0.00110886, 0.00067985, 7.27001009, 0.99661061, 0.99821129, 0.49297456],
+                             [- 6.27112151, -0.00110846, 0.00067960, 7.27001304, 0.99661182, 0.99821193, 0.49297477],
+                             [- 6.27112405, -0.00110807, 0.00067936, 7.27001599, 0.99661303, 0.99821257, 0.49297493],
+                             [- 6.27112660, -0.00110767, 0.00067912, 7.27001892, 0.99661425, 0.99821321, 0.49297516],
+                             [- 6.27112913, -0.00110728, 0.00067887, 7.27002185, 0.99661546, 0.99821385, 0.49297533],
+                             [- 6.27113166, -0.00110688, 0.00067863, 7.27002478, 0.99661667, 0.99821449, 0.49297550],
+                             [- 6.27113418, -0.00110648, 0.00067839, 7.27002769, 0.99661788, 0.99821513, 0.49297572],
+                             [- 6.27113669, -0.00110609, 0.00067815, 7.27003060, 0.99661909, 0.99821576, 0.49297589],
+                             [- 6.27113920, -0.00110569, 0.00067790, 7.27003350, 0.99662030, 0.99821640, 0.49297607],
+                             [- 6.27114170, -0.00110530, 0.00067766, 7.27003640, 0.99662150, 0.99821704, 0.49297628],
+                             [- 6.27114419, -0.00110491, 0.00067742, 7.27003928, 0.99662271, 0.99821767, 0.49297646],
+                             [- 6.27114668, -0.00110451, 0.00067718, 7.27004216, 0.99662392, 0.99821831, 0.49297664],
+                             [- 6.27114915, -0.00110412, 0.00067694, 7.27004504, 0.99662512, 0.99821894, 0.49297684],
+                             [- 6.27115163, -0.00110372, 0.00067670, 7.27004790, 0.99662632, 0.99821958, 0.49297702],
+                             [- 6.27115409, -0.00110333, 0.00067646, 7.27005076, 0.99662753, 0.99822021, 0.49297723],
+                             [- 6.27115655, -0.00110294, 0.00067621, 7.27005361, 0.99662873, 0.99822085, 0.49297742],
+                             [- 6.27115900, -0.00110255, 0.00067597, 7.27005646, 0.99662993, 0.99822148, 0.49297759],
+                             [- 6.27116145, -0.00110215, 0.00067573, 7.27005929, 0.99663113, 0.99822211, 0.49297781],
+                             [- 6.27116389, -0.00110176, 0.00067549, 7.27006212, 0.99663233, 0.99822274, 0.49297799],
+                             [- 6.27116632, -0.00110137, 0.00067525, 7.27006495, 0.99663353, 0.99822338, 0.49297818],
+                             [- 6.27116874, -0.00110098, 0.00067501, 7.27006776, 0.99663473, 0.99822401, 0.49297837],
+                             [- 6.27117116, -0.00110059, 0.00067477, 7.27007057, 0.99663592, 0.99822464, 0.49297853],
+                             [- 6.27117357, -0.00110020, 0.00067453, 7.27007338, 0.99663712, 0.99822527, 0.49297873],
+                             [- 6.27117598, -0.00109981, 0.00067429, 7.27007617, 0.99663832, 0.99822590, 0.49297890],
+                             [- 6.27117838, -0.00109942, 0.00067405, 7.27007896, 0.99663951, 0.99822653, 0.49297910],
+                             [- 6.27118077, -0.00109903, 0.00067381, 7.27008174, 0.99664070, 0.99822716, 0.49297929],
+                             [- 6.27118315, -0.00109864, 0.00067358, 7.27008452, 0.99664190, 0.99822779, 0.49297945],
+                             [- 6.27118553, -0.00109825, 0.00067334, 7.27008729, 0.99664309, 0.99822842, 0.49297965],
+                             [- 6.27118791, -0.00109786, 0.00067310, 7.27009005, 0.99664428, 0.99822904, 0.49297987],
+                             [- 6.27119027, -0.00109747, 0.00067286, 7.27009280, 0.99664547, 0.99822967, 0.49298005],
+                             [- 6.27119263, -0.00109708, 0.00067262, 7.27009555, 0.99664666, 0.99823030, 0.49298023],
+                             [- 6.27119499, -0.00109669, 0.00067238, 7.27009829, 0.99664785, 0.99823092, 0.49298041],
+                             [- 6.27119733, -0.00109630, 0.00067214, 7.27010103, 0.99664904, 0.99823155, 0.49298056],
+                             [- 6.27119968, -0.00109592, 0.00067191, 7.27010376, 0.99665022, 0.99823218, 0.49298074],
+                             [- 6.27120201, -0.00109553, 0.00067167, 7.27010648, 0.99665141, 0.99823280, 0.49298095],
+                             [- 6.27120434, -0.00109514, 0.00067143, 7.27010920, 0.99665259, 0.99823343, 0.49298115],
+                             [- 6.27120666, -0.00109475, 0.00067119, 7.27011190, 0.99665378, 0.99823405, 0.49298131],
+                             [- 6.27120898, -0.00109437, 0.00067096, 7.27011461, 0.99665496, 0.99823467, 0.49298149],
+                             [- 6.27121129, -0.00109398, 0.00067072, 7.27011730, 0.99665614, 0.99823530, 0.49298166],
+                             [- 6.27121359, -0.00109360, 0.00067048, 7.27011999, 0.99665733, 0.99823592, 0.49298185],
+                             [- 6.27121589, -0.00109321, 0.00067025, 7.27012268, 0.99665851, 0.99823654, 0.49298202],
+                             [- 6.27121818, -0.00109282, 0.00067001, 7.27012535, 0.99665969, 0.99823717, 0.49298224],
+                             [- 6.27122046, -0.00109244, 0.00066977, 7.27012802, 0.99666087, 0.99823779, 0.49298236],
+                             [- 6.27122274, -0.00109205, 0.00066954, 7.27013069, 0.99666205, 0.99823841, 0.49298260],
+                             [- 6.27122501, -0.00109167, 0.00066930, 7.27013334, 0.99666322, 0.99823903, 0.49298275],
+                             [- 6.27122728, -0.00109128, 0.00066907, 7.27013600, 0.99666440, 0.99823965, 0.49298294],
+                             [- 6.27122954, -0.00109090, 0.00066883, 7.27013864, 0.99666558, 0.99824027, 0.49298313],
+                             [- 6.27123179, -0.00109052, 0.00066859, 7.27014128, 0.99666675, 0.99824089, 0.49298330],
+                             [- 6.27123404, -0.00109013, 0.00066836, 7.27014391, 0.99666793, 0.99824151, 0.49298351],
+                             [- 6.27123629, -0.00108975, 0.00066812, 7.27014654, 0.99666910, 0.99824213, 0.49298363],
+                             [- 6.27123852, -0.00108937, 0.00066789, 7.27014916, 0.99667027, 0.99824275, 0.49298382],
+                             [- 6.27124075, -0.00108898, 0.00066765, 7.27015177, 0.99667144, 0.99824336, 0.49298401],
+                             [- 6.27124298, -0.00108860, 0.00066742, 7.27015438, 0.99667261, 0.99824398, 0.49298420],
+                             [- 6.27124520, -0.00108822, 0.00066718, 7.27015698, 0.99667379, 0.99824460, 0.49298438],
+                             [- 6.27124741, -0.00108784, 0.00066695, 7.27015957, 0.99667495, 0.99824521, 0.49298453],
+                             [- 6.27124962, -0.00108745, 0.00066672, 7.27016216, 0.99667612, 0.99824583, 0.49298471],
+                             [- 6.27125182, -0.00108707, 0.00066648, 7.27016475, 0.99667729, 0.99824645, 0.49298491],
+                             [- 6.27125401, -0.00108669, 0.00066625, 7.27016732, 0.99667846, 0.99824706, 0.49298510],
+                             [- 6.27125620, -0.00108631, 0.00066601, 7.27016989, 0.99667962, 0.99824768, 0.49298524],
+                             [- 6.27125839, -0.00108593, 0.00066578, 7.27017246, 0.99668079, 0.99824829, 0.49298544],
+                             [- 6.27126057, -0.00108555, 0.00066555, 7.27017502, 0.99668195, 0.99824890, 0.49298562],
+                             [- 6.27126274, -0.00108517, 0.00066531, 7.27017757, 0.99668312, 0.99824952, 0.49298575],
+                             [- 6.27126490, -0.00108479, 0.00066508, 7.27018012, 0.99668428, 0.99825013, 0.49298596],
+                             [- 6.27126707, -0.00108441, 0.00066485, 7.27018266, 0.99668544, 0.99825074, 0.49298614],
+                             [- 6.27126922, -0.00108403, 0.00066461, 7.27018519, 0.99668660, 0.99825136, 0.49298629],
+                             [- 6.27127137, -0.00108365, 0.00066438, 7.27018772, 0.99668776, 0.99825197, 0.49298647],
+                             [- 6.27127351, -0.00108327, 0.00066415, 7.27019024, 0.99668892, 0.99825258, 0.49298665],
+                             [- 6.27127565, -0.00108289, 0.00066392, 7.27019276, 0.99669008, 0.99825319, 0.49298685],
+                             [- 6.27127779, -0.00108251, 0.00066369, 7.27019527, 0.99669124, 0.99825380, 0.49298701],
+                             [- 6.27127991, -0.00108214, 0.00066345, 7.27019778, 0.99669240, 0.99825441, 0.49298719],
+                             [- 6.27128204, -0.00108176, 0.00066322, 7.27020028, 0.99669356, 0.99825502, 0.49298735],
+                             [- 6.27128415, -0.00108138, 0.00066299, 7.27020277, 0.99669471, 0.99825563, 0.49298754],
+                             [- 6.27128626, -0.00108100, 0.00066276, 7.27020526, 0.99669587, 0.99825624, 0.49298772],
+                             [- 6.27128837, -0.00108063, 0.00066253, 7.27020774, 0.99669702, 0.99825685, 0.49298787],
+                             [- 6.27129047, -0.00108025, 0.00066230, 7.27021022, 0.99669817, 0.99825746, 0.49298806],
+                             [- 6.27129256, -0.00107987, 0.00066206, 7.27021269, 0.99669933, 0.99825806, 0.49298822],
+                             [- 6.27129465, -0.00107950, 0.00066183, 7.27021516, 0.99670048, 0.99825867, 0.49298838],
+                             [- 6.27129674, -0.00107912, 0.00066160, 7.27021762, 0.99670163, 0.99825928, 0.49298857],
+                             [- 6.27129881, -0.00107874, 0.00066137, 7.27022007, 0.99670278, 0.99825988, 0.49298872],
+                             [- 6.27130089, -0.00107837, 0.00066114, 7.27022252, 0.99670393, 0.99826049, 0.49298890],
+                             [- 6.27130295, -0.00107799, 0.00066091, 7.27022496, 0.99670508, 0.99826109, 0.49298906],
+                             [- 6.27130502, -0.00107762, 0.00066068, 7.27022740, 0.99670622, 0.99826170, 0.49298921],
+                             [- 6.27130707, -0.00107724, 0.00066045, 7.27022983, 0.99670737, 0.99826230, 0.49298942],
+                             [- 6.27130913, -0.00107687, 0.00066022, 7.27023226, 0.99670852, 0.99826291, 0.49298958],
+                             [- 6.27131117, -0.00107649, 0.00065999, 7.27023468, 0.99670966, 0.99826351, 0.49298977],
+                             [- 6.27131321, -0.00107612, 0.00065976, 7.27023709, 0.99671081, 0.99826412, 0.49298992],
+                             [- 6.27131525, -0.00107575, 0.00065953, 7.27023950, 0.99671195, 0.99826472, 0.49299011],
+                             [- 6.27131728, -0.00107537, 0.00065931, 7.27024191, 0.99671309, 0.99826532, 0.49299028],
+                             [- 6.27131930, -0.00107500, 0.00065908, 7.27024430, 0.99671423, 0.99826592, 0.49299042],
+                             [- 6.27132133, -0.00107463, 0.00065885, 7.27024670, 0.99671538, 0.99826653, 0.49299058],
+                             [- 6.27132334, -0.00107425, 0.00065862, 7.27024909, 0.99671652, 0.99826713, 0.49299077],
+                             [- 6.27132535, -0.00107388, 0.00065839, 7.27025147, 0.99671766, 0.99826773, 0.49299096],
+                             [- 6.27132736, -0.00107351, 0.00065816, 7.27025385, 0.99671879, 0.99826833, 0.49299111],
+                             [- 6.27132936, -0.00107314, 0.00065793, 7.27025622, 0.99671993, 0.99826893, 0.49299126],
+                             [- 6.27133135, -0.00107277, 0.00065771, 7.27025858, 0.99672107, 0.99826953, 0.49299144],
+                             [- 6.27133334, -0.00107239, 0.00065748, 7.27026094, 0.99672221, 0.99827013, 0.49299160],
+                             [- 6.27133532, -0.00107202, 0.00065725, 7.27026330, 0.99672334, 0.99827073, 0.49299180],
+                             [- 6.27133730, -0.00107165, 0.00065702, 7.27026565, 0.99672448, 0.99827132, 0.49299193],
+                             [- 6.27133928, -0.00107128, 0.00065680, 7.27026800, 0.99672561, 0.99827192, 0.49299212],
+                             [- 6.27134125, -0.00107091, 0.00065657, 7.27027034, 0.99672674, 0.99827252, 0.49299227],
+                             [- 6.27134321, -0.00107054, 0.00065634, 7.27027267, 0.99672788, 0.99827312, 0.49299243],
+                             [- 6.27134517, -0.00107017, 0.00065611, 7.27027500, 0.99672901, 0.99827371, 0.49299259],
+                             [- 6.27134713, -0.00106980, 0.00065589, 7.27027733, 0.99673014, 0.99827431, 0.49299280],
+                             [- 6.27134908, -0.00106943, 0.00065566, 7.27027964, 0.99673127, 0.99827491, 0.49299296],
+                             [- 6.27135102, -0.00106906, 0.00065543, 7.27028196, 0.99673240, 0.99827550, 0.49299309],
+                             [- 6.27135296, -0.00106870, 0.00065521, 7.27028427, 0.99673353, 0.99827610, 0.49299327],
+                             [- 6.27135490, -0.00106833, 0.00065498, 7.27028657, 0.99673466, 0.99827669, 0.49299344],
+                             [- 6.27135683, -0.00106796, 0.00065476, 7.27028887, 0.99673578, 0.99827729, 0.49299361],
+                             [- 6.27135875, -0.00106759, 0.00065453, 7.27029116, 0.99673691, 0.99827788, 0.49299378],
+                             [- 6.27136067, -0.00106722, 0.00065430, 7.27029345, 0.99673804, 0.99827847, 0.49299395],
+                             [- 6.27136259, -0.00106685, 0.00065408, 7.27029574, 0.99673916, 0.99827907, 0.49299413],
+                             [- 6.27136450, -0.00106649, 0.00065385, 7.27029801, 0.99674028, 0.99827966, 0.49299427],
+                             [- 6.27136641, -0.00106612, 0.00065363, 7.27030029, 0.99674141, 0.99828025, 0.49299442],
+                             [- 6.27136831, -0.00106575, 0.00065340, 7.27030256, 0.99674253, 0.99828084, 0.49299460],
+                             [- 6.27137021, -0.00106539, 0.00065318, 7.27030482, 0.99674365, 0.99828143, 0.49299474],
+                             [- 6.27137210, -0.00106502, 0.00065295, 7.27030708, 0.99674477, 0.99828203, 0.49299490],
+                             [- 6.27137399, -0.00106465, 0.00065273, 7.27030933, 0.99674589, 0.99828262, 0.49299509],
+                             [- 6.27137587, -0.00106429, 0.00065250, 7.27031158, 0.99674701, 0.99828321, 0.49299525],
+                             [- 6.27137775, -0.00106392, 0.00065228, 7.27031382, 0.99674813, 0.99828380, 0.49299541],
+                             [- 6.27137962, -0.00106356, 0.00065206, 7.27031606, 0.99674925, 0.99828439, 0.49299561],
+                             [- 6.27138149, -0.00106319, 0.00065183, 7.27031830, 0.99675037, 0.99828497, 0.49299573],
+                             [- 6.27138335, -0.00106283, 0.00065161, 7.27032053, 0.99675148, 0.99828556, 0.49299589],
+                             [- 6.27138521, -0.00106246, 0.00065139, 7.27032275, 0.99675260, 0.99828615, 0.49299603],
+                             [- 6.27138707, -0.00106210, 0.00065116, 7.27032497, 0.99675371, 0.99828674, 0.49299621],
+                             [- 6.27138892, -0.00106173, 0.00065094, 7.27032719, 0.99675483, 0.99828733, 0.49299635],
+                             [- 6.27139077, -0.00106137, 0.00065072, 7.27032940, 0.99675594, 0.99828791, 0.49299653],
+                             [- 6.27139261, -0.00106101, 0.00065049, 7.27033160, 0.99675705, 0.99828850, 0.49299670],
+                             [- 6.27139445, -0.00106064, 0.00065027, 7.27033380, 0.99675816, 0.99828909, 0.49299687],
+                             [- 6.27139628, -0.00106028, 0.00065005, 7.27033600, 0.99675928, 0.99828967, 0.49299705],
+                             [- 6.27139811, -0.00105992, 0.00064982, 7.27033819, 0.99676039, 0.99829026, 0.49299718],
+                             [- 6.27139993, -0.00105956, 0.00064960, 7.27034037, 0.99676150, 0.99829084, 0.49299736],
+                             [- 6.27140175, -0.00105919, 0.00064938, 7.27034256, 0.99676260, 0.99829143, 0.49299751],
+                             [- 6.27140356, -0.00105883, 0.00064916, 7.27034473, 0.99676371, 0.99829201, 0.49299765],
+                             [- 6.27140537, -0.00105847, 0.00064893, 7.27034690, 0.99676482, 0.99829260, 0.49299782],
+                             [- 6.27140718, -0.00105811, 0.00064871, 7.27034907, 0.99676593, 0.99829318, 0.49299800],
+                             [- 6.27140898, -0.00105775, 0.00064849, 7.27035123, 0.99676703, 0.99829376, 0.49299816],
+                             [- 6.27141078, -0.00105739, 0.00064827, 7.27035339, 0.99676814, 0.99829434, 0.49299833],
+                             [- 6.27141257, -0.00105702, 0.00064805, 7.27035555, 0.99676924, 0.99829493, 0.49299845],
+                             [- 6.27141436, -0.00105666, 0.00064783, 7.27035770, 0.99677034, 0.99829551, 0.49299862],
+                             [- 6.27141614, -0.00105630, 0.00064761, 7.27035984, 0.99677145, 0.99829609, 0.49299878],
+                             [- 6.27141792, -0.00105594, 0.00064739, 7.27036198, 0.99677255, 0.99829667, 0.49299891],
+                             [- 6.27141970, -0.00105558, 0.00064716, 7.27036412, 0.99677365, 0.99829725, 0.49299912],
+                             [- 6.27142147, -0.00105522, 0.00064694, 7.27036625, 0.99677475, 0.99829783, 0.49299926],
+                             [- 6.27142324, -0.00105486, 0.00064672, 7.27036837, 0.99677585, 0.99829841, 0.49299943],
+                             [- 6.27142500, -0.00105451, 0.00064650, 7.27037050, 0.99677695, 0.99829899, 0.49299955],
+                             [- 6.27142676, -0.00105415, 0.00064628, 7.27037261, 0.99677805, 0.99829957, 0.49299971],
+                             [- 6.27142851, -0.00105379, 0.00064606, 7.27037473, 0.99677914, 0.99830015, 0.49299984],
+                             [- 6.27143026, -0.00105343, 0.00064584, 7.27037683, 0.99678024, 0.99830073, 0.49300001],
+                             [- 6.27143201, -0.00105307, 0.00064562, 7.27037894, 0.99678134, 0.99830131, 0.49300017],
+                             [- 6.27143375, -0.00105271, 0.00064540, 7.27038104, 0.99678243, 0.99830188, 0.49300033],
+                             [- 6.27143549, -0.00105236, 0.00064518, 7.27038313, 0.99678353, 0.99830246, 0.49300050],
+                             [- 6.27143722, -0.00105200, 0.00064496, 7.27038522, 0.99678462, 0.99830304, 0.49300065],
+                             [- 6.27143895, -0.00105164, 0.00064475, 7.27038731, 0.99678571, 0.99830361, 0.49300081],
+                             [- 6.27144068, -0.00105128, 0.00064453, 7.27038939, 0.99678681, 0.99830419, 0.49300096],
+                             [- 6.27144240, -0.00105093, 0.00064431, 7.27039147, 0.99678790, 0.99830477, 0.49300112],
+                             [- 6.27144412, -0.00105057, 0.00064409, 7.27039355, 0.99678899, 0.99830534, 0.49300126],
+                             [- 6.27144583, -0.00105021, 0.00064387, 7.27039561, 0.99679008, 0.99830592, 0.49300141],
+                             [- 6.27144754, -0.00104986, 0.00064365, 7.27039768, 0.99679117, 0.99830649, 0.49300158],
+                             [- 6.27144924, -0.00104950, 0.00064343, 7.27039974, 0.99679226, 0.99830706, 0.49300174],
+                             [- 6.27145094, -0.00104915, 0.00064322, 7.27040180, 0.99679334, 0.99830764, 0.49300191],
+                             [- 6.27145264, -0.00104879, 0.00064300, 7.27040385, 0.99679443, 0.99830821, 0.49300203],
+                             [- 6.27145433, -0.00104844, 0.00064278, 7.27040590, 0.99679552, 0.99830878, 0.49300220],
+                             [- 6.27145602, -0.00104808, 0.00064256, 7.27040794, 0.99679660, 0.99830936, 0.49300234],
+                             [- 6.27145771, -0.00104773, 0.00064234, 7.27040998, 0.99679769, 0.99830993, 0.49300248],
+                             [- 6.27145939, -0.00104737, 0.00064213, 7.27041202, 0.99679877, 0.99831050, 0.49300264],
+                             [- 6.27146107, -0.00104702, 0.00064191, 7.27041405, 0.99679986, 0.99831107, 0.49300280],
+                             [- 6.27146274, -0.00104667, 0.00064169, 7.27041607, 0.99680094, 0.99831164, 0.49300294],
+                             [- 6.27146441, -0.00104631, 0.00064148, 7.27041810, 0.99680202, 0.99831221, 0.49300310],
+                             [- 6.27146607, -0.00104596, 0.00064126, 7.27042012, 0.99680310, 0.99831278, 0.49300325],
+                             [- 6.27146774, -0.00104561, 0.00064104, 7.27042213, 0.99680418, 0.99831335, 0.49300340],
+                             [- 6.27146939, -0.00104525, 0.00064083, 7.27042414, 0.99680526, 0.99831392, 0.49300357],
+                             [- 6.27147105, -0.00104490, 0.00064061, 7.27042615, 0.99680634, 0.99831449, 0.49300370],
+                             [- 6.27147270, -0.00104455, 0.00064039, 7.27042815, 0.99680742, 0.99831506, 0.49300390],
+                             [- 6.27147434, -0.00104420, 0.00064018, 7.27043015, 0.99680850, 0.99831563, 0.49300402],
+                             [- 6.27147599, -0.00104384, 0.00063996, 7.27043214, 0.99680957, 0.99831620, 0.49300417],
+                             [- 6.27147762, -0.00104349, 0.00063975, 7.27043413, 0.99681065, 0.99831676, 0.49300431],
+                             [- 6.27147926, -0.00104314, 0.00063953, 7.27043612, 0.99681172, 0.99831733, 0.49300449],
+                             [- 6.27148089, -0.00104279, 0.00063931, 7.27043810, 0.99681280, 0.99831790, 0.49300460],
+                             [- 6.27148252, -0.00104244, 0.00063910, 7.27044008, 0.99681387, 0.99831846, 0.49300478],
+                             [- 6.27148414, -0.00104209, 0.00063888, 7.27044205, 0.99681495, 0.99831903, 0.49300494],
+                             [- 6.27148576, -0.00104174, 0.00063867, 7.27044402, 0.99681602, 0.99831959, 0.49300507],
+                             [- 6.27148738, -0.00104139, 0.00063845, 7.27044599, 0.99681709, 0.99832016, 0.49300523],
+                             [- 6.27148899, -0.00104104, 0.00063824, 7.27044795, 0.99681816, 0.99832072, 0.49300537],
+                             [- 6.27149060, -0.00104069, 0.00063802, 7.27044991, 0.99681923, 0.99832129, 0.49300552],
+                             [- 6.27149220, -0.00104034, 0.00063781, 7.27045186, 0.99682030, 0.99832185, 0.49300567],
+                             [- 6.27149380, -0.00103999, 0.00063760, 7.27045382, 0.99682137, 0.99832242, 0.49300583],
+                             [- 6.27149540, -0.00103964, 0.00063738, 7.27045576, 0.99682244, 0.99832298, 0.49300595],
+                             [- 6.27149699, -0.00103929, 0.00063717, 7.27045771, 0.99682351, 0.99832354, 0.49300609],
+                             [- 6.27149859, -0.00103894, 0.00063695, 7.27045964, 0.99682457, 0.99832411, 0.49300627],
+                             [- 6.27150017, -0.00103859, 0.00063674, 7.27046158, 0.99682564, 0.99832467, 0.49300642],
+                             [- 6.27150175, -0.00103824, 0.00063653, 7.27046351, 0.99682670, 0.99832523, 0.49300653],
+                             [- 6.27150333, -0.00103790, 0.00063631, 7.27046544, 0.99682777, 0.99832579, 0.49300671],
+                             [- 6.27150491, -0.00103755, 0.00063610, 7.27046736, 0.99682883, 0.99832635, 0.49300686],
+                             [- 6.27150648, -0.00103720, 0.00063589, 7.27046928, 0.99682990, 0.99832691, 0.49300700],
+                             [- 6.27150805, -0.00103685, 0.00063567, 7.27047120, 0.99683096, 0.99832747, 0.49300717],
+                             [- 6.27150962, -0.00103651, 0.00063546, 7.27047311, 0.99683202, 0.99832803, 0.49300731],
+                             [- 6.27151118, -0.00103616, 0.00063525, 7.27047502, 0.99683308, 0.99832859, 0.49300742],
+                             [- 6.27151274, -0.00103581, 0.00063503, 7.27047692, 0.99683414, 0.99832915, 0.49300759],
+                             [- 6.27151429, -0.00103547, 0.00063482, 7.27047882, 0.99683520, 0.99832971, 0.49300775],
+                             [- 6.27151584, -0.00103512, 0.00063461, 7.27048072, 0.99683626, 0.99833027, 0.49300787],
+                             [- 6.27151739, -0.00103478, 0.00063440, 7.27048262, 0.99683732, 0.99833083, 0.49300803],
+                             [- 6.27151893, -0.00103443, 0.00063419, 7.27048451, 0.99683838, 0.99833138, 0.49300818],
+                             [- 6.27152048, -0.00103408, 0.00063397, 7.27048639, 0.99683943, 0.99833194, 0.49300831],
+                             [- 6.27152201, -0.00103374, 0.00063376, 7.27048827, 0.99684049, 0.99833250, 0.49300846],
+                             [- 6.27152355, -0.00103339, 0.00063355, 7.27049015, 0.99684154, 0.99833306, 0.49300863],
+                             [- 6.27152508, -0.00103305, 0.00063334, 7.27049203, 0.99684260, 0.99833361, 0.49300877],
+                             [- 6.27152660, -0.00103270, 0.00063313, 7.27049390, 0.99684365, 0.99833417, 0.49300891],
+                             [- 6.27152813, -0.00103236, 0.00063292, 7.27049577, 0.99684471, 0.99833472, 0.49300907],
+                             [- 6.27152965, -0.00103202, 0.00063271, 7.27049763, 0.99684576, 0.99833528, 0.49300922],
+                             [- 6.27153117, -0.00103167, 0.00063249, 7.27049949, 0.99684681, 0.99833583, 0.49300935],
+                             [- 6.27153268, -0.00103133, 0.00063228, 7.27050135, 0.99684786, 0.99833639, 0.49300949],
+                             [- 6.27153419, -0.00103099, 0.00063207, 7.27050320, 0.99684891, 0.99833694, 0.49300966],
+                             [- 6.27153570, -0.00103064, 0.00063186, 7.27050505, 0.99684996, 0.99833749, 0.49300980],
+                             [- 6.27153720, -0.00103030, 0.00063165, 7.27050690, 0.99685101, 0.99833805, 0.49300992],
+                             [- 6.27153870, -0.00102996, 0.00063144, 7.27050874, 0.99685206, 0.99833860, 0.49301003],
+                             [- 6.27154020, -0.00102961, 0.00063123, 7.27051058, 0.99685311, 0.99833915, 0.49301024],
+                             [- 6.27154169, -0.00102927, 0.00063102, 7.27051242, 0.99685415, 0.99833971, 0.49301036],
+                             [- 6.27154318, -0.00102893, 0.00063081, 7.27051425, 0.99685520, 0.99834026, 0.49301051],
+                             [- 6.27154467, -0.00102859, 0.00063060, 7.27051608, 0.99685625, 0.99834081, 0.49301064],
+                             [- 6.27154615, -0.00102825, 0.00063039, 7.27051791, 0.99685729, 0.99834136, 0.49301076],
+                             [- 6.27154763, -0.00102791, 0.00063018, 7.27051973, 0.99685834, 0.99834191, 0.49301089],
+                             [- 6.27154911, -0.00102756, 0.00062997, 7.27052155, 0.99685938, 0.99834246, 0.49301105],
+                             [- 6.27155059, -0.00102722, 0.00062976, 7.27052336, 0.99686042, 0.99834301, 0.49301119],
+                             [- 6.27155206, -0.00102688, 0.00062956, 7.27052517, 0.99686146, 0.99834356, 0.49301134],
+                             [- 6.27155352, -0.00102654, 0.00062935, 7.27052698, 0.99686251, 0.99834411, 0.49301148],
+                             [- 6.27155499, -0.00102620, 0.00062914, 7.27052879, 0.99686355, 0.99834466, 0.49301163],
+                             [- 6.27155645, -0.00102586, 0.00062893, 7.27053059, 0.99686459, 0.99834521, 0.49301176],
+                             [- 6.27155791, -0.00102552, 0.00062872, 7.27053239, 0.99686563, 0.99834576, 0.49301188],
+                             [- 6.27155936, -0.00102518, 0.00062851, 7.27053418, 0.99686666, 0.99834630, 0.49301206],
+                             [- 6.27156082, -0.00102484, 0.00062830, 7.27053597, 0.99686770, 0.99834685, 0.49301220],
+                             [- 6.27156226, -0.00102451, 0.00062810, 7.27053776, 0.99686874, 0.99834740, 0.49301233],
+                             [- 6.27156371, -0.00102417, 0.00062789, 7.27053954, 0.99686978, 0.99834794, 0.49301246],
+                             [- 6.27156515, -0.00102383, 0.00062768, 7.27054132, 0.99687081, 0.99834849, 0.49301262],
+                             [- 6.27156659, -0.00102349, 0.00062747, 7.27054310, 0.99687185, 0.99834904, 0.49301280],
+                             [- 6.27156803, -0.00102315, 0.00062727, 7.27054488, 0.99687288, 0.99834958, 0.49301294],
+                             [- 6.27156946, -0.00102281, 0.00062706, 7.27054665, 0.99687392, 0.99835013, 0.49301309],
+                             [- 6.27157089, -0.00102248, 0.00062685, 7.27054842, 0.99687495, 0.99835067, 0.49301319],
+                             [- 6.27157232, -0.00102214, 0.00062664, 7.27055018, 0.99687598, 0.99835122, 0.49301335],
+                             [- 6.27157374, -0.00102180, 0.00062644, 7.27055194, 0.99687701, 0.99835176, 0.49301345],
+                             [- 6.27157517, -0.00102146, 0.00062623, 7.27055370, 0.99687805, 0.99835231, 0.49301362],
+                             [- 6.27157658, -0.00102113, 0.00062602, 7.27055546, 0.99687908, 0.99835285, 0.49301372],
+                             [- 6.27157800, -0.00102079, 0.00062582, 7.27055721, 0.99688011, 0.99835339, 0.49301383],
+                             [- 6.27157941, -0.00102045, 0.00062561, 7.27055896, 0.99688113, 0.99835393, 0.49301405],
+                             [- 6.27158082, -0.00102012, 0.00062540, 7.27056070, 0.99688216, 0.99835448, 0.49301418],
+                             [- 6.27158223, -0.00101978, 0.00062520, 7.27056244, 0.99688319, 0.99835502, 0.49301433],
+                             [- 6.27158363, -0.00101945, 0.00062499, 7.27056418, 0.99688422, 0.99835556, 0.49301444],
+                             [- 6.27158503, -0.00101911, 0.00062479, 7.27056592, 0.99688524, 0.99835610, 0.49301454],
+                             [- 6.27158643, -0.00101878, 0.00062458, 7.27056765, 0.99688627, 0.99835664, 0.49301468],
+                             [- 6.27158782, -0.00101844, 0.00062438, 7.27056938, 0.99688730, 0.99835718, 0.49301483],
+                             [- 6.27158921, -0.00101811, 0.00062417, 7.27057111, 0.99688832, 0.99835772, 0.49301499],
+                             [- 6.27159060, -0.00101777, 0.00062396, 7.27057283, 0.99688934, 0.99835826, 0.49301513],
+                             [- 6.27159199, -0.00101744, 0.00062376, 7.27057455, 0.99689037, 0.99835880, 0.49301528],
+                             [- 6.27159337, -0.00101710, 0.00062355, 7.27057627, 0.99689139, 0.99835934, 0.49301541],
+                             [- 6.27159475, -0.00101677, 0.00062335, 7.27057798, 0.99689241, 0.99835988, 0.49301553],
+                             [- 6.27159613, -0.00101644, 0.00062314, 7.27057969, 0.99689343, 0.99836042, 0.49301569],
+                             [- 6.27159750, -0.00101610, 0.00062294, 7.27058140, 0.99689445, 0.99836096, 0.49301584],
+                             [- 6.27159887, -0.00101577, 0.00062274, 7.27058310, 0.99689547, 0.99836150, 0.49301593],
+                             [- 6.27160024, -0.00101544, 0.00062253, 7.27058480, 0.99689649, 0.99836203, 0.49301608],
+                             [- 6.27160160, -0.00101510, 0.00062233, 7.27058650, 0.99689751, 0.99836257, 0.49301621],
+                             [- 6.27160297, -0.00101477, 0.00062212, 7.27058820, 0.99689853, 0.99836311, 0.49301634],
+                             [- 6.27160433, -0.00101444, 0.00062192, 7.27058989, 0.99689954, 0.99836364, 0.49301647],
+                             [- 6.27160568, -0.00101410, 0.00062171, 7.27059158, 0.99690056, 0.99836418, 0.49301663],
+                             [- 6.27160704, -0.00101377, 0.00062151, 7.27059327, 0.99690158, 0.99836472, 0.49301679],
+                             [- 6.27160839, -0.00101344, 0.00062131, 7.27059495, 0.99690259, 0.99836525, 0.49301693],
+                             [- 6.27160974, -0.00101311, 0.00062110, 7.27059663, 0.99690361, 0.99836579, 0.49301706],
+                             [- 6.27161108, -0.00101278, 0.00062090, 7.27059831, 0.99690462, 0.99836632, 0.49301722],
+                             [- 6.27161243, -0.00101245, 0.00062070, 7.27059998, 0.99690563, 0.99836686, 0.49301730],
+                             [- 6.27161377, -0.00101212, 0.00062049, 7.27060165, 0.99690664, 0.99836739, 0.49301748],
+                             [- 6.27161511, -0.00101179, 0.00062029, 7.27060332, 0.99690766, 0.99836792, 0.49301757],
+                             [- 6.27161644, -0.00101146, 0.00062009, 7.27060499, 0.99690867, 0.99836846, 0.49301772],
+                             [- 6.27161777, -0.00101112, 0.00061989, 7.27060665, 0.99690968, 0.99836899, 0.49301787],
+                             [- 6.27161910, -0.00101079, 0.00061968, 7.27060831, 0.99691069, 0.99836952, 0.49301798],
+                             [- 6.27162043, -0.00101046, 0.00061948, 7.27060996, 0.99691170, 0.99837005, 0.49301811],
+                             [- 6.27162175, -0.00101014, 0.00061928, 7.27061162, 0.99691271, 0.99837059, 0.49301825],
+                             [- 6.27162307, -0.00100981, 0.00061908, 7.27061327, 0.99691371, 0.99837112, 0.49301840],
+                             [- 6.27162439, -0.00100948, 0.00061887, 7.27061492, 0.99691472, 0.99837165, 0.49301855],
+                             [- 6.27162571, -0.00100915, 0.00061867, 7.27061656, 0.99691573, 0.99837218, 0.49301866],
+                             [- 6.27162702, -0.00100882, 0.00061847, 7.27061820, 0.99691673, 0.99837271, 0.49301881],
+                             [- 6.27162833, -0.00100849, 0.00061827, 7.27061984, 0.99691774, 0.99837324, 0.49301892],
+                             [- 6.27162964, -0.00100816, 0.00061807, 7.27062148, 0.99691874, 0.99837377, 0.49301906],
+                             [- 6.27163095, -0.00100783, 0.00061787, 7.27062311, 0.99691975, 0.99837430, 0.49301923],
+                             [- 6.27163225, -0.00100751, 0.00061767, 7.27062474, 0.99692075, 0.99837483, 0.49301935],
+                             [- 6.27163355, -0.00100718, 0.00061746, 7.27062637, 0.99692175, 0.99837536, 0.49301944],
+                             [- 6.27163485, -0.00100685, 0.00061726, 7.27062800, 0.99692275, 0.99837589, 0.49301961],
+                             [- 6.27163614, -0.00100652, 0.00061706, 7.27062962, 0.99692375, 0.99837641, 0.49301974],
+                             [- 6.27163743, -0.00100620, 0.00061686, 7.27063124, 0.99692476, 0.99837694, 0.49301990],
+                             [- 6.27163872, -0.00100587, 0.00061666, 7.27063285, 0.99692576, 0.99837747, 0.49301996],
+                             [- 6.27164001, -0.00100554, 0.00061646, 7.27063447, 0.99692675, 0.99837800, 0.49302013],
+                             [- 6.27164130, -0.00100522, 0.00061626, 7.27063608, 0.99692775, 0.99837852, 0.49302024],
+                             [- 6.27164258, -0.00100489, 0.00061606, 7.27063769, 0.99692875, 0.99837905, 0.49302039],
+                             [- 6.27164386, -0.00100456, 0.00061586, 7.27063929, 0.99692975, 0.99837957, 0.49302050],
+                             [- 6.27164513, -0.00100424, 0.00061566, 7.27064090, 0.99693075, 0.99838010, 0.49302064],
+                             [- 6.27164641, -0.00100391, 0.00061546, 7.27064250, 0.99693174, 0.99838063, 0.49302080],
+                             [- 6.27164768, -0.00100359, 0.00061526, 7.27064409, 0.99693274, 0.99838115, 0.49302092],
+                             [- 6.27164895, -0.00100326, 0.00061506, 7.27064569, 0.99693373, 0.99838168, 0.49302106],
+                             [- 6.27165022, -0.00100294, 0.00061486, 7.27064728, 0.99693473, 0.99838220, 0.49302117],
+                             [- 6.27165148, -0.00100261, 0.00061466, 7.27064887, 0.99693572, 0.99838272, 0.49302135],
+                             [- 6.27165274, -0.00100229, 0.00061446, 7.27065045, 0.99693671, 0.99838325, 0.49302147],
+                             [- 6.27165400, -0.00100196, 0.00061427, 7.27065204, 0.99693770, 0.99838377, 0.49302161],
+                             [- 6.27165526, -0.00100164, 0.00061407, 7.27065362, 0.99693870, 0.99838429, 0.49302174],
+                             [- 6.27165651, -0.00100132, 0.00061387, 7.27065520, 0.99693969, 0.99838482, 0.49302182],
+                             [- 6.27165777, -0.00100099, 0.00061367, 7.27065677, 0.99694068, 0.99838534, 0.49302200],
+                             [- 6.27165902, -0.00100067, 0.00061347, 7.27065835, 0.99694167, 0.99838586, 0.49302214],
+                             [- 6.27166026, -0.00100035, 0.00061327, 7.27065992, 0.99694266, 0.99838638, 0.49302227],
+                             [- 6.27166151, -0.00100002, 0.00061307, 7.27066149, 0.99694364, 0.99838690, 0.49302237],
+                             [- 6.27166275, -0.00099970, 0.00061288, 7.27066305, 0.99694463, 0.99838742, 0.49302253],
+                             [- 6.27166399, -0.00099938, 0.00061268, 7.27066461, 0.99694562, 0.99838795, 0.49302264],
+                             [- 6.27166523, -0.00099905, 0.00061248, 7.27066617, 0.99694660, 0.99838847, 0.49302277],
+                             [- 6.27166646, -0.00099873, 0.00061228, 7.27066773, 0.99694759, 0.99838899, 0.49302290],
+                             [- 6.27166770, -0.00099841, 0.00061208, 7.27066928, 0.99694858, 0.99838951, 0.49302301],
+                             [- 6.27166893, -0.00099809, 0.00061189, 7.27067084, 0.99694956, 0.99839002, 0.49302315],
+                             [- 6.27167015, -0.00099777, 0.00061169, 7.27067239, 0.99695054, 0.99839054, 0.49302331],
+                             [- 6.27167138, -0.00099745, 0.00061149, 7.27067393, 0.99695153, 0.99839106, 0.49302343],
+                             [- 6.27167260, -0.00099712, 0.00061130, 7.27067548, 0.99695251, 0.99839158, 0.49302354],
+                             [- 6.27167382, -0.00099680, 0.00061110, 7.27067702, 0.99695349, 0.99839210, 0.49302367],
+                             [- 6.27167504, -0.00099648, 0.00061090, 7.27067856, 0.99695447, 0.99839262, 0.49302378],
+                             [- 6.27167626, -0.00099616, 0.00061070, 7.27068010, 0.99695545, 0.99839313, 0.49302391],
+                             [- 6.27167747, -0.00099584, 0.00061051, 7.27068163, 0.99695643, 0.99839365, 0.49302405],
+                             [- 6.27167868, -0.00099552, 0.00061031, 7.27068316, 0.99695741, 0.99839417, 0.49302418],
+                             [- 6.27167989, -0.00099520, 0.00061012, 7.27068469, 0.99695839, 0.99839468, 0.49302428],
+                             [- 6.27168110, -0.00099488, 0.00060992, 7.27068622, 0.99695937, 0.99839520, 0.49302442],
+                             [- 6.27168231, -0.00099456, 0.00060972, 7.27068774, 0.99696035, 0.99839571, 0.49302457],
+                             [- 6.27168351, -0.00099424, 0.00060953, 7.27068927, 0.99696133, 0.99839623, 0.49302469],
+                             [- 6.27168471, -0.00099392, 0.00060933, 7.27069078, 0.99696230, 0.99839674, 0.49302483],
+                             [- 6.27168591, -0.00099360, 0.00060914, 7.27069230, 0.99696328, 0.99839726, 0.49302493],
+                             [- 6.27168710, -0.00099329, 0.00060894, 7.27069382, 0.99696425, 0.99839777, 0.49302510],
+                             [- 6.27168829, -0.00099297, 0.00060874, 7.27069533, 0.99696523, 0.99839829, 0.49302519],
+                             [- 6.27168949, -0.00099265, 0.00060855, 7.27069684, 0.99696620, 0.99839880, 0.49302531],
+                             [- 6.27169067, -0.00099233, 0.00060835, 7.27069834, 0.99696717, 0.99839931, 0.49302546],
+                             [- 6.27169186, -0.00099201, 0.00060816, 7.27069985, 0.99696815, 0.99839983, 0.49302559],
+                             [- 6.27169305, -0.00099170, 0.00060796, 7.27070135, 0.99696912, 0.99840034, 0.49302572],
+                             [- 6.27169423, -0.00099138, 0.00060777, 7.27070285, 0.99697009, 0.99840085, 0.49302581],
+                             [- 6.27169541, -0.00099106, 0.00060757, 7.27070435, 0.99697106, 0.99840137, 0.49302594],
+                             [- 6.27169659, -0.00099074, 0.00060738, 7.27070584, 0.99697203, 0.99840188, 0.49302606],
+                             [- 6.27169776, -0.00099043, 0.00060719, 7.27070734, 0.99697300, 0.99840239, 0.49302620],
+                             [- 6.27169893, -0.00099011, 0.00060699, 7.27070883, 0.99697397, 0.99840290, 0.49302635],
+                             [- 6.27170011, -0.00098979, 0.00060680, 7.27071031, 0.99697494, 0.99840341, 0.49302644],
+                             [- 6.27170128, -0.00098948, 0.00060660, 7.27071180, 0.99697590, 0.99840392, 0.49302662],
+                             [- 6.27170244, -0.00098916, 0.00060641, 7.27071328, 0.99697687, 0.99840443, 0.49302676],
+                             [- 6.27170361, -0.00098884, 0.00060622, 7.27071476, 0.99697784, 0.99840494, 0.49302682],
+                             [- 6.27170477, -0.00098853, 0.00060602, 7.27071624, 0.99697880, 0.99840545, 0.49302696],
+                             [- 6.27170593, -0.00098821, 0.00060583, 7.27071772, 0.99697977, 0.99840596, 0.49302711],
+                             [- 6.27170709, -0.00098790, 0.00060563, 7.27071919, 0.99698073, 0.99840647, 0.49302721],
+                             [- 6.27170825, -0.00098758, 0.00060544, 7.27072066, 0.99698170, 0.99840698, 0.49302733],
+                             [- 6.27170940, -0.00098727, 0.00060525, 7.27072213, 0.99698266, 0.99840748, 0.49302748],
+                             [- 6.27171055, -0.00098695, 0.00060505, 7.27072360, 0.99698362, 0.99840799, 0.49302765],
+                             [- 6.27171170, -0.00098664, 0.00060486, 7.27072506, 0.99698459, 0.99840850, 0.49302773],
+                             [- 6.27171285, -0.00098633, 0.00060467, 7.27072652, 0.99698555, 0.99840901, 0.49302786],
+                             [- 6.27171399, -0.00098601, 0.00060448, 7.27072798, 0.99698651, 0.99840951, 0.49302797],
+                             [- 6.27171514, -0.00098570, 0.00060428, 7.27072944, 0.99698747, 0.99841002, 0.49302811],
+                             [- 6.27171628, -0.00098538, 0.00060409, 7.27073090, 0.99698843, 0.99841053, 0.49302824],
+                             [- 6.27171742, -0.00098507, 0.00060390, 7.27073235, 0.99698939, 0.99841103, 0.49302835],
+                             [- 6.27171856, -0.00098476, 0.00060371, 7.27073380, 0.99699035, 0.99841154, 0.49302848],
+                             [- 6.27171969, -0.00098444, 0.00060351, 7.27073525, 0.99699130, 0.99841204, 0.49302858],
+                             [- 6.27172082, -0.00098413, 0.00060332, 7.27073669, 0.99699226, 0.99841255, 0.49302871],
+                             [- 6.27172196, -0.00098382, 0.00060313, 7.27073814, 0.99699322, 0.99841305, 0.49302887],
+                             [- 6.27172309, -0.00098351, 0.00060294, 7.27073958, 0.99699417, 0.99841356, 0.49302895],
+                             [- 6.27172421, -0.00098319, 0.00060275, 7.27074102, 0.99699513, 0.99841406, 0.49302912],
+                             [- 6.27172534, -0.00098288, 0.00060256, 7.27074246, 0.99699608, 0.99841456, 0.49302925],
+                             [- 6.27172646, -0.00098257, 0.00060236, 7.27074389, 0.99699704, 0.99841507, 0.49302935],
+                             [- 6.27172758, -0.00098226, 0.00060217, 7.27074532, 0.99699799, 0.99841557, 0.49302945],
+                             [- 6.27172870, -0.00098195, 0.00060198, 7.27074676, 0.99699894, 0.99841607, 0.49302959],
+                             [- 6.27172982, -0.00098163, 0.00060179, 7.27074818, 0.99699990, 0.99841657, 0.49302970],
+                             [- 6.27173093, -0.00098132, 0.00060160, 7.27074961, 0.99700085, 0.99841708, 0.49302981],
+                             [- 6.27173205, -0.00098101, 0.00060141, 7.27075103, 0.99700180, 0.99841758, 0.49302992],
+                             [- 6.27173316, -0.00098070, 0.00060122, 7.27075246, 0.99700275, 0.99841808, 0.49303009],
+                             [- 6.27173427, -0.00098039, 0.00060103, 7.27075388, 0.99700370, 0.99841858, 0.49303019],
+                             [- 6.27173537, -0.00098008, 0.00060084, 7.27075529, 0.99700465, 0.99841908, 0.49303031],
+                             [- 6.27173648, -0.00097977, 0.00060065, 7.27075671, 0.99700560, 0.99841958, 0.49303044],
+                             [- 6.27173758, -0.00097946, 0.00060046, 7.27075812, 0.99700655, 0.99842008, 0.49303056],
+                             [- 6.27173868, -0.00097915, 0.00060027, 7.27075953, 0.99700749, 0.99842058, 0.49303069],
+                             [- 6.27173978, -0.00097884, 0.00060008, 7.27076094, 0.99700844, 0.99842108, 0.49303080],
+                             [- 6.27174088, -0.00097853, 0.00059989, 7.27076235, 0.99700939, 0.99842158, 0.49303094],
+                             [- 6.27174198, -0.00097822, 0.00059970, 7.27076375, 0.99701033, 0.99842208, 0.49303107],
+                             [- 6.27174307, -0.00097791, 0.00059951, 7.27076516, 0.99701128, 0.99842258, 0.49303120],
+                             [- 6.27174416, -0.00097761, 0.00059932, 7.27076656, 0.99701222, 0.99842308, 0.49303132],
+                             [- 6.27174525, -0.00097730, 0.00059913, 7.27076795, 0.99701317, 0.99842357, 0.49303142],
+                             [- 6.27174634, -0.00097699, 0.00059894, 7.27076935, 0.99701411, 0.99842407, 0.49303154],
+                             [- 6.27174743, -0.00097668, 0.00059875, 7.27077075, 0.99701505, 0.99842457, 0.49303168],
+                             [- 6.27174851, -0.00097637, 0.00059856, 7.27077214, 0.99701599, 0.99842507, 0.49303176],
+                             [- 6.27174959, -0.00097606, 0.00059837, 7.27077353, 0.99701693, 0.99842556, 0.49303192],
+                             [- 6.27175067, -0.00097576, 0.00059818, 7.27077491, 0.99701788, 0.99842606, 0.49303205],
+                             [- 6.27175175, -0.00097545, 0.00059800, 7.27077630, 0.99701882, 0.99842656, 0.49303212],
+                             [- 6.27175283, -0.00097514, 0.00059781, 7.27077769, 0.99701976, 0.99842705, 0.49303223],
+                             [- 6.27175390, -0.00097484, 0.00059762, 7.27077907, 0.99702070, 0.99842755, 0.49303239],
+                             [- 6.27175497, -0.00097453, 0.00059743, 7.27078045, 0.99702163, 0.99842804, 0.49303247],
+                             [- 6.27175605, -0.00097422, 0.00059724, 7.27078182, 0.99702257, 0.99842854, 0.49303263],
+                             [- 6.27175712, -0.00097392, 0.00059705, 7.27078320, 0.99702351, 0.99842903, 0.49303277],
+                             [- 6.27175818, -0.00097361, 0.00059687, 7.27078457, 0.99702445, 0.99842952, 0.49303287],
+                             [- 6.27175925, -0.00097330, 0.00059668, 7.27078595, 0.99702538, 0.99843002, 0.49303298],
+                             [- 6.27176031, -0.00097300, 0.00059649, 7.27078731, 0.99702632, 0.99843051, 0.49303309],
+                             [- 6.27176137, -0.00097269, 0.00059630, 7.27078868, 0.99702725, 0.99843101, 0.49303324],
+                             [- 6.27176243, -0.00097239, 0.00059612, 7.27079005, 0.99702819, 0.99843150, 0.49303337],
+                             [- 6.27176349, -0.00097208, 0.00059593, 7.27079141, 0.99702912, 0.99843199, 0.49303342],
+                             [- 6.27176455, -0.00097178, 0.00059574, 7.27079277, 0.99703005, 0.99843248, 0.49303355],
+                             [- 6.27176560, -0.00097147, 0.00059555, 7.27079413, 0.99703099, 0.99843298, 0.49303367],
+                             [- 6.27176666, -0.00097117, 0.00059537, 7.27079549, 0.99703192, 0.99843347, 0.49303384],
+                             [- 6.27176771, -0.00097086, 0.00059518, 7.27079685, 0.99703285, 0.99843396, 0.49303391],
+                             [- 6.27176876, -0.00097056, 0.00059499, 7.27079820, 0.99703378, 0.99843445, 0.49303404],
+                             [- 6.27176980, -0.00097025, 0.00059481, 7.27079955, 0.99703471, 0.99843494, 0.49303417],
+                             [- 6.27177085, -0.00096995, 0.00059462, 7.27080090, 0.99703564, 0.99843543, 0.49303426],
+                             [- 6.27177189, -0.00096965, 0.00059443, 7.27080225, 0.99703657, 0.99843592, 0.49303442],
+                             [- 6.27177294, -0.00096934, 0.00059425, 7.27080359, 0.99703750, 0.99843641, 0.49303454],
+                             [- 6.27177398, -0.00096904, 0.00059406, 7.27080494, 0.99703843, 0.99843690, 0.49303464],
+                             [- 6.27177502, -0.00096874, 0.00059388, 7.27080628, 0.99703936, 0.99843739, 0.49303476],
+                             [- 6.27177605, -0.00096843, 0.00059369, 7.27080762, 0.99704028, 0.99843788, 0.49303487],
+                             [- 6.27177709, -0.00096813, 0.00059350, 7.27080896, 0.99704121, 0.99843837, 0.49303501],
+                             [- 6.27177812, -0.00096783, 0.00059332, 7.27081030, 0.99704213, 0.99843886, 0.49303512],
+                             [- 6.27177915, -0.00096752, 0.00059313, 7.27081163, 0.99704306, 0.99843934, 0.49303521],
+                             [- 6.27178018, -0.00096722, 0.00059295, 7.27081296, 0.99704398, 0.99843983, 0.49303537],
+                             [- 6.27178121, -0.00096692, 0.00059276, 7.27081429, 0.99704491, 0.99844032, 0.49303546],
+                             [- 6.27178224, -0.00096662, 0.00059258, 7.27081562, 0.99704583, 0.99844081, 0.49303558],
+                             [- 6.27178326, -0.00096632, 0.00059239, 7.27081695, 0.99704675, 0.99844129, 0.49303575],
+                             [- 6.27178429, -0.00096602, 0.00059221, 7.27081827, 0.99704768, 0.99844178, 0.49303581],
+                             [- 6.27178531, -0.00096571, 0.00059202, 7.27081960, 0.99704860, 0.99844227, 0.49303591],
+                             [- 6.27178633, -0.00096541, 0.00059184, 7.27082092, 0.99704952, 0.99844275, 0.49303609],
+                             [- 6.27178735, -0.00096511, 0.00059165, 7.27082224, 0.99705044, 0.99844324, 0.49303618],
+                             [- 6.27178836, -0.00096481, 0.00059147, 7.27082355, 0.99705136, 0.99844372, 0.49303628],
+                             [- 6.27178938, -0.00096451, 0.00059128, 7.27082487, 0.99705228, 0.99844421, 0.49303641],
+                             [- 6.27179039, -0.00096421, 0.00059110, 7.27082618, 0.99705320, 0.99844469, 0.49303652],
+                             [- 6.27179140, -0.00096391, 0.00059091, 7.27082749, 0.99705412, 0.99844518, 0.49303666],
+                             [- 6.27179242, -0.00096361, 0.00059073, 7.27082881, 0.99705503, 0.99844566, 0.49303673],
+                             [- 6.27179342, -0.00096331, 0.00059055, 7.27083011, 0.99705595, 0.99844614, 0.49303690],
+                             [- 6.27179443, -0.00096301, 0.00059036, 7.27083142, 0.99705687, 0.99844663, 0.49303700],
+                             [- 6.27179544, -0.00096271, 0.00059018, 7.27083272, 0.99705778, 0.99844711, 0.49303712],
+                             [- 6.27179644, -0.00096241, 0.00058999, 7.27083403, 0.99705870, 0.99844759, 0.49303722],
+                             [- 6.27179744, -0.00096211, 0.00058981, 7.27083533, 0.99705961, 0.99844808, 0.49303732],
+                             [- 6.27179844, -0.00096181, 0.00058963, 7.27083663, 0.99706053, 0.99844856, 0.49303745],
+                             [- 6.27179944, -0.00096152, 0.00058944, 7.27083792, 0.99706144, 0.99844904, 0.49303757],
+                             [- 6.27180044, -0.00096122, 0.00058926, 7.27083922, 0.99706235, 0.99844952, 0.49303771],
+                             [- 6.27180143, -0.00096092, 0.00058908, 7.27084051, 0.99706327, 0.99845000, 0.49303777],
+                             [- 6.27180243, -0.00096062, 0.00058890, 7.27084181, 0.99706418, 0.99845048, 0.49303795],
+                             [- 6.27180342, -0.00096032, 0.00058871, 7.27084310, 0.99706509, 0.99845097, 0.49303802],
+                             [- 6.27180441, -0.00096002, 0.00058853, 7.27084438, 0.99706600, 0.99845145, 0.49303815],
+                             [- 6.27180540, -0.00095973, 0.00058835, 7.27084567, 0.99706691, 0.99845193, 0.49303827],
+                             [- 6.27180639, -0.00095943, 0.00058816, 7.27084696, 0.99706782, 0.99845241, 0.49303836],
+                             [- 6.27180737, -0.00095913, 0.00058798, 7.27084824, 0.99706873, 0.99845289, 0.49303844],
+                             [- 6.27180836, -0.00095884, 0.00058780, 7.27084952, 0.99706964, 0.99845336, 0.49303861],
+                             [- 6.27180934, -0.00095854, 0.00058762, 7.27085080, 0.99707055, 0.99845384, 0.49303868],
+                             [- 6.27181032, -0.00095824, 0.00058744, 7.27085208, 0.99707145, 0.99845432, 0.49303884],
+                             [- 6.27181130, -0.00095795, 0.00058725, 7.27085335, 0.99707236, 0.99845480, 0.49303895],
+                             [- 6.27181228, -0.00095765, 0.00058707, 7.27085463, 0.99707327, 0.99845528, 0.49303908],
+                             [- 6.27181325, -0.00095735, 0.00058689, 7.27085590, 0.99707417, 0.99845576, 0.49303915],
+                             [- 6.27181423, -0.00095706, 0.00058671, 7.27085717, 0.99707508, 0.99845623, 0.49303928],
+                             [- 6.27181520, -0.00095676, 0.00058653, 7.27085844, 0.99707598, 0.99845671, 0.49303940],
+                             [- 6.27181618, -0.00095647, 0.00058635, 7.27085971, 0.99707689, 0.99845719, 0.49303950],
+                             [- 6.27181715, -0.00095617, 0.00058616, 7.27086098, 0.99707779, 0.99845766, 0.49303965],
+                             [- 6.27181811, -0.00095588, 0.00058598, 7.27086224, 0.99707869, 0.99845814, 0.49303979],
+                             [- 6.27181908, -0.00095558, 0.00058580, 7.27086350, 0.99707960, 0.99845862, 0.49303989],
+                             [- 6.27182005, -0.00095529, 0.00058562, 7.27086476, 0.99708050, 0.99845909, 0.49303994],
+                             [- 6.27182101, -0.00095499, 0.00058544, 7.27086602, 0.99708140, 0.99845957, 0.49304006],
+                             [- 6.27182198, -0.00095470, 0.00058526, 7.27086728, 0.99708230, 0.99846004, 0.49304023],
+                             [- 6.27182294, -0.00095440, 0.00058508, 7.27086854, 0.99708320, 0.99846052, 0.49304031],
+                             [- 6.27182390, -0.00095411, 0.00058490, 7.27086979, 0.99708410, 0.99846099, 0.49304040],
+                             [- 6.27182486, -0.00095381, 0.00058472, 7.27087104, 0.99708500, 0.99846147, 0.49304052],
+                             [- 6.27182581, -0.00095352, 0.00058454, 7.27087229, 0.99708590, 0.99846194, 0.49304066],
+                             [- 6.27182677, -0.00095323, 0.00058436, 7.27087354, 0.99708680, 0.99846242, 0.49304078],
+                             [- 6.27182772, -0.00095293, 0.00058418, 7.27087479, 0.99708769, 0.99846289, 0.49304090],
+                             [- 6.27182867, -0.00095264, 0.00058400, 7.27087603, 0.99708859, 0.99846336, 0.49304102],
+                             [- 6.27182963, -0.00095235, 0.00058382, 7.27087728, 0.99708949, 0.99846383, 0.49304112],
+                             [- 6.27183058, -0.00095205, 0.00058364, 7.27087852, 0.99709038, 0.99846431, 0.49304120],
+                             [- 6.27183152, -0.00095176, 0.00058346, 7.27087976, 0.99709128, 0.99846478, 0.49304129],
+                             [- 6.27183247, -0.00095147, 0.00058328, 7.27088100, 0.99709217, 0.99846525, 0.49304145],
+                             [- 6.27183342, -0.00095118, 0.00058310, 7.27088224, 0.99709307, 0.99846572, 0.49304157],
+                             [- 6.27183436, -0.00095088, 0.00058292, 7.27088348, 0.99709396, 0.99846619, 0.49304165],
+                             [- 6.27183530, -0.00095059, 0.00058274, 7.27088471, 0.99709485, 0.99846667, 0.49304175],
+                             [- 6.27183624, -0.00095030, 0.00058256, 7.27088594, 0.99709575, 0.99846714, 0.49304190],
+                             [- 6.27183718, -0.00095001, 0.00058238, 7.27088717, 0.99709664, 0.99846761, 0.49304204],
+                             [- 6.27183812, -0.00094972, 0.00058221, 7.27088840, 0.99709753, 0.99846808, 0.49304212],
+                             [- 6.27183906, -0.00094943, 0.00058203, 7.27088963, 0.99709842, 0.99846855, 0.49304222],
+                             [- 6.27183999, -0.00094914, 0.00058185, 7.27089086, 0.99709931, 0.99846902, 0.49304233],
+                             [- 6.27184093, -0.00094884, 0.00058167, 7.27089208, 0.99710020, 0.99846949, 0.49304245],
+                             [- 6.27184186, -0.00094855, 0.00058149, 7.27089331, 0.99710109, 0.99846996, 0.49304255],
+                             [- 6.27184279, -0.00094826, 0.00058131, 7.27089453, 0.99710198, 0.99847042, 0.49304263],
+                             [- 6.27184372, -0.00094797, 0.00058113, 7.27089575, 0.99710287, 0.99847089, 0.49304277],
+                             [- 6.27184465, -0.00094768, 0.00058096, 7.27089697, 0.99710375, 0.99847136, 0.49304288],
+                             [- 6.27184558, -0.00094739, 0.00058078, 7.27089818, 0.99710464, 0.99847183, 0.49304302],
+                             [- 6.27184650, -0.00094710, 0.00058060, 7.27089940, 0.99710553, 0.99847230, 0.49304309],
+                             [- 6.27184743, -0.00094681, 0.00058042, 7.27090061, 0.99710641, 0.99847276, 0.49304322],
+                             [- 6.27184835, -0.00094652, 0.00058025, 7.27090182, 0.99710730, 0.99847323, 0.49304332],
+                             [- 6.27184927, -0.00094623, 0.00058007, 7.27090304, 0.99710818, 0.99847370, 0.49304348],
+                             [- 6.27185019, -0.00094595, 0.00057989, 7.27090424, 0.99710907, 0.99847416, 0.49304351],
+                             [- 6.27185111, -0.00094566, 0.00057971, 7.27090545, 0.99710995, 0.99847463, 0.49304363],
+                             [- 6.27185203, -0.00094537, 0.00057954, 7.27090666, 0.99711083, 0.99847510, 0.49304378],
+                             [- 6.27185294, -0.00094508, 0.00057936, 7.27090786, 0.99711172, 0.99847556, 0.49304390],
+                             [- 6.27185386, -0.00094479, 0.00057918, 7.27090907, 0.99711260, 0.99847603, 0.49304399],
+                             [- 6.27185477, -0.00094450, 0.00057901, 7.27091027, 0.99711348, 0.99847649, 0.49304412],
+                             [- 6.27185568, -0.00094421, 0.00057883, 7.27091147, 0.99711436, 0.99847696, 0.49304419],
+                             [- 6.27185659, -0.00094393, 0.00057865, 7.27091267, 0.99711524, 0.99847742, 0.49304433],
+                             [- 6.27185750, -0.00094364, 0.00057848, 7.27091386, 0.99711612, 0.99847789, 0.49304445],
+                             [- 6.27185841, -0.00094335, 0.00057830, 7.27091506, 0.99711700, 0.99847835, 0.49304453],
+                             [- 6.27185932, -0.00094306, 0.00057812, 7.27091625, 0.99711788, 0.99847881, 0.49304463],
+                             [- 6.27186022, -0.00094278, 0.00057795, 7.27091745, 0.99711876, 0.99847928, 0.49304471],
+                             [- 6.27186113, -0.00094249, 0.00057777, 7.27091864, 0.99711964, 0.99847974, 0.49304488],
+                             [- 6.27186203, -0.00094220, 0.00057759, 7.27091983, 0.99712051, 0.99848020, 0.49304496],
+                             [- 6.27186293, -0.00094192, 0.00057742, 7.27092101, 0.99712139, 0.99848067, 0.49304509],
+                             [- 6.27186383, -0.00094163, 0.00057724, 7.27092220, 0.99712227, 0.99848113, 0.49304521],
+                             [- 6.27186473, -0.00094134, 0.00057707, 7.27092339, 0.99712314, 0.99848159, 0.49304528],
+                             [- 6.27186563, -0.00094106, 0.00057689, 7.27092457, 0.99712402, 0.99848205, 0.49304542],
+                             [- 6.27186652, -0.00094077, 0.00057672, 7.27092575, 0.99712489, 0.99848251, 0.49304552],
+                             [- 6.27186742, -0.00094049, 0.00057654, 7.27092693, 0.99712577, 0.99848297, 0.49304562],
+                             [- 6.27186831, -0.00094020, 0.00057636, 7.27092811, 0.99712664, 0.99848344, 0.49304571],
+                             [- 6.27186920, -0.00093991, 0.00057619, 7.27092929, 0.99712751, 0.99848390, 0.49304585],
+                             [- 6.27187010, -0.00093963, 0.00057601, 7.27093047, 0.99712839, 0.99848436, 0.49304595],
+                             [- 6.27187098, -0.00093934, 0.00057584, 7.27093164, 0.99712926, 0.99848482, 0.49304606],
+                             [- 6.27187187, -0.00093906, 0.00057567, 7.27093281, 0.99713013, 0.99848528, 0.49304619],
+                             [- 6.27187276, -0.00093877, 0.00057549, 7.27093399, 0.99713100, 0.99848574, 0.49304625],
+                             [- 6.27187365, -0.00093849, 0.00057532, 7.27093516, 0.99713187, 0.99848619, 0.49304638],
+                             [- 6.27187453, -0.00093821, 0.00057514, 7.27093633, 0.99713274, 0.99848665, 0.49304650],
+                             [- 6.27187541, -0.00093792, 0.00057497, 7.27093749, 0.99713361, 0.99848711, 0.49304662],
+                             [- 6.27187630, -0.00093764, 0.00057479, 7.27093866, 0.99713448, 0.99848757, 0.49304675],
+                             [- 6.27187718, -0.00093735, 0.00057462, 7.27093983, 0.99713535, 0.99848803, 0.49304680],
+                             [- 6.27187806, -0.00093707, 0.00057444, 7.27094099, 0.99713622, 0.99848849, 0.49304696],
+                             [- 6.27187894, -0.00093679, 0.00057427, 7.27094215, 0.99713708, 0.99848894, 0.49304701],
+                             [- 6.27187981, -0.00093650, 0.00057410, 7.27094331, 0.99713795, 0.99848940, 0.49304717],
+                             [- 6.27188069, -0.00093622, 0.00057392, 7.27094447, 0.99713882, 0.99848986, 0.49304726],
+                             [- 6.27188156, -0.00093594, 0.00057375, 7.27094563, 0.99713968, 0.99849031, 0.49304734],
+                             [- 6.27188244, -0.00093565, 0.00057358, 7.27094678, 0.99714055, 0.99849077, 0.49304749],
+                             [- 6.27188331, -0.00093537, 0.00057340, 7.27094794, 0.99714141, 0.99849123, 0.49304756],
+                             [- 6.27188418, -0.00093509, 0.00057323, 7.27094909, 0.99714228, 0.99849168, 0.49304769],
+                             [- 6.27188505, -0.00093481, 0.00057306, 7.27095025, 0.99714314, 0.99849214, 0.49304781],
+                             [- 6.27188592, -0.00093452, 0.00057288, 7.27095140, 0.99714400, 0.99849259, 0.49304789],
+                             [- 6.27188679, -0.00093424, 0.00057271, 7.27095255, 0.99714486, 0.99849305, 0.49304797],
+                             [- 6.27188765, -0.00093396, 0.00057254, 7.27095369, 0.99714573, 0.99849350, 0.49304811],
+                             [- 6.27188852, -0.00093368, 0.00057236, 7.27095484, 0.99714659, 0.99849396, 0.49304819],
+                             [- 6.27188938, -0.00093340, 0.00057219, 7.27095599, 0.99714745, 0.99849441, 0.49304832],
+                             [- 6.27189025, -0.00093312, 0.00057202, 7.27095713, 0.99714831, 0.99849487, 0.49304841],
+                             [- 6.27189111, -0.00093283, 0.00057185, 7.27095827, 0.99714917, 0.99849532, 0.49304852],
+                             [- 6.27189197, -0.00093255, 0.00057167, 7.27095942, 0.99715003, 0.99849577, 0.49304861],
+                             [- 6.27189283, -0.00093227, 0.00057150, 7.27096056, 0.99715089, 0.99849623, 0.49304875],
+                             [- 6.27189369, -0.00093199, 0.00057133, 7.27096169, 0.99715175, 0.99849668, 0.49304884],
+                             [- 6.27189454, -0.00093171, 0.00057116, 7.27096283, 0.99715260, 0.99849713, 0.49304894],
+                             [- 6.27189540, -0.00093143, 0.00057098, 7.27096397, 0.99715346, 0.99849758, 0.49304909],
+                             [- 6.27189625, -0.00093115, 0.00057081, 7.27096510, 0.99715432, 0.99849804, 0.49304918],
+                             [- 6.27189711, -0.00093087, 0.00057064, 7.27096624, 0.99715517, 0.99849849, 0.49304926],
+                             [- 6.27189796, -0.00093059, 0.00057047, 7.27096737, 0.99715603, 0.99849894, 0.49304941],
+                             [- 6.27189881, -0.00093031, 0.00057030, 7.27096850, 0.99715689, 0.99849939, 0.49304950],
+                             [- 6.27189966, -0.00093003, 0.00057013, 7.27096963, 0.99715774, 0.99849984, 0.49304958],
+                             [- 6.27190051, -0.00092975, 0.00056995, 7.27097076, 0.99715860, 0.99850029, 0.49304964],
+                             [- 6.27190136, -0.00092947, 0.00056978, 7.27097188, 0.99715945, 0.99850074, 0.49304982],
+                             [- 6.27190220, -0.00092919, 0.00056961, 7.27097301, 0.99716030, 0.99850119, 0.49304989],
+                             [- 6.27190305, -0.00092892, 0.00056944, 7.27097413, 0.99716115, 0.99850164, 0.49305004],
+                             [- 6.27190389, -0.00092864, 0.00056927, 7.27097525, 0.99716201, 0.99850209, 0.49305011],
+                             [- 6.27190474, -0.00092836, 0.00056910, 7.27097638, 0.99716286, 0.99850254, 0.49305025],
+                             [- 6.27190558, -0.00092808, 0.00056893, 7.27097750, 0.99716371, 0.99850299, 0.49305033],
+                             [- 6.27190642, -0.00092780, 0.00056876, 7.27097862, 0.99716456, 0.99850344, 0.49305045],
+                             [- 6.27190726, -0.00092752, 0.00056859, 7.27097973, 0.99716541, 0.99850389, 0.49305056],
+                             [- 6.27190810, -0.00092725, 0.00056842, 7.27098085, 0.99716626, 0.99850434, 0.49305065],
+                             [- 6.27190893, -0.00092697, 0.00056825, 7.27098197, 0.99716711, 0.99850478, 0.49305076],
+                             [- 6.27190977, -0.00092669, 0.00056808, 7.27098308, 0.99716796, 0.99850523, 0.49305085],
+                             [- 6.27191061, -0.00092641, 0.00056791, 7.27098419, 0.99716881, 0.99850568, 0.49305094],
+                             [- 6.27191144, -0.00092614, 0.00056774, 7.27098530, 0.99716965, 0.99850613, 0.49305108],
+                             [- 6.27191227, -0.00092586, 0.00056757, 7.27098641, 0.99717050, 0.99850657, 0.49305115],
+                             [- 6.27191311, -0.00092558, 0.00056740, 7.27098752, 0.99717135, 0.99850702, 0.49305125],
+                             [- 6.27191394, -0.00092531, 0.00056723, 7.27098863, 0.99717219, 0.99850747, 0.49305139],
+                             [- 6.27191477, -0.00092503, 0.00056706, 7.27098974, 0.99717304, 0.99850791, 0.49305148],
+                             [- 6.27191559, -0.00092475, 0.00056689, 7.27099084, 0.99717389, 0.99850836, 0.49305158],
+                             [- 6.27191642, -0.00092448, 0.00056672, 7.27099194, 0.99717473, 0.99850880, 0.49305167],
+                             [- 6.27191725, -0.00092420, 0.00056655, 7.27099305, 0.99717557, 0.99850925, 0.49305181],
+                             [- 6.27191807, -0.00092393, 0.00056638, 7.27099415, 0.99717642, 0.99850969, 0.49305190],
+                             [- 6.27191890, -0.00092365, 0.00056621, 7.27099525, 0.99717726, 0.99851014, 0.49305201],
+                             [- 6.27191972, -0.00092338, 0.00056604, 7.27099635, 0.99717810, 0.99851058, 0.49305208],
+                             [- 6.27192054, -0.00092310, 0.00056587, 7.27099744, 0.99717895, 0.99851103, 0.49305223],
+                             [- 6.27192136, -0.00092282, 0.00056570, 7.27099854, 0.99717979, 0.99851147, 0.49305232],
+                             [- 6.27192218, -0.00092255, 0.00056553, 7.27099964, 0.99718063, 0.99851192, 0.49305243],
+                             [- 6.27192300, -0.00092227, 0.00056537, 7.27100073, 0.99718147, 0.99851236, 0.49305250],
+                             [- 6.27192382, -0.00092200, 0.00056520, 7.27100182, 0.99718231, 0.99851280, 0.49305258],
+                             [- 6.27192464, -0.00092173, 0.00056503, 7.27100291, 0.99718315, 0.99851325, 0.49305275],
+                             [- 6.27192545, -0.00092145, 0.00056486, 7.27100400, 0.99718399, 0.99851369, 0.49305278],
+                             [- 6.27192627, -0.00092118, 0.00056469, 7.27100509, 0.99718483, 0.99851413, 0.49305295],
+                             [- 6.27192708, -0.00092090, 0.00056452, 7.27100618, 0.99718566, 0.99851457, 0.49305299],
+                             [- 6.27192790, -0.00092063, 0.00056436, 7.27100727, 0.99718650, 0.99851502, 0.49305314],
+                             [- 6.27192871, -0.00092036, 0.00056419, 7.27100835, 0.99718734, 0.99851546, 0.49305323],
+                             [- 6.27192952, -0.00092008, 0.00056402, 7.27100944, 0.99718818, 0.99851590, 0.49305333],
+                             [- 6.27193033, -0.00091981, 0.00056385, 7.27101052, 0.99718901, 0.99851634, 0.49305345],
+                             [- 6.27193114, -0.00091954, 0.00056368, 7.27101160, 0.99718985, 0.99851678, 0.49305349],
+                             [- 6.27193194, -0.00091926, 0.00056352, 7.27101268, 0.99719068, 0.99851722, 0.49305365],
+                             [- 6.27193275, -0.00091899, 0.00056335, 7.27101376, 0.99719152, 0.99851766, 0.49305371],
+                             [- 6.27193356, -0.00091872, 0.00056318, 7.27101484, 0.99719235, 0.99851810, 0.49305382],
+                             [- 6.27193436, -0.00091844, 0.00056301, 7.27101592, 0.99719318, 0.99851854, 0.49305392],
+                             [- 6.27193516, -0.00091817, 0.00056285, 7.27101699, 0.99719402, 0.99851898, 0.49305400],
+                             [- 6.27193597, -0.00091790, 0.00056268, 7.27101807, 0.99719485, 0.99851942, 0.49305415],
+                             [- 6.27193677, -0.00091763, 0.00056251, 7.27101914, 0.99719568, 0.99851986, 0.49305427],
+                             [- 6.27193757, -0.00091736, 0.00056235, 7.27102021, 0.99719651, 0.99852030, 0.49305437],
+                             [- 6.27193837, -0.00091708, 0.00056218, 7.27102128, 0.99719735, 0.99852074, 0.49305443],
+                             [- 6.27193917, -0.00091681, 0.00056201, 7.27102235, 0.99719818, 0.99852117, 0.49305458],
+                             [- 6.27193996, -0.00091654, 0.00056185, 7.27102342, 0.99719901, 0.99852161, 0.49305464],
+                             [- 6.27194076, -0.00091627, 0.00056168, 7.27102449, 0.99719984, 0.99852205, 0.49305472],
+                             [- 6.27194155, -0.00091600, 0.00056151, 7.27102556, 0.99720066, 0.99852249, 0.49305485],
+                             [- 6.27194235, -0.00091573, 0.00056135, 7.27102662, 0.99720149, 0.99852292, 0.49305488],
+                             [- 6.27194314, -0.00091546, 0.00056118, 7.27102769, 0.99720232, 0.99852336, 0.49305501],
+                             [- 6.27194394, -0.00091519, 0.00056102, 7.27102875, 0.99720315, 0.99852380, 0.49305520],
+                             [- 6.27194473, -0.00091492, 0.00056085, 7.27102981, 0.99720398, 0.99852423, 0.49305527],
+                             [- 6.27194552, -0.00091465, 0.00056068, 7.27103087, 0.99720480, 0.99852467, 0.49305537],
+                             [- 6.27194631, -0.00091438, 0.00056052, 7.27103193, 0.99720563, 0.99852511, 0.49305541],
+                             [- 6.27194710, -0.00091411, 0.00056035, 7.27103299, 0.99720646, 0.99852554, 0.49305558],
+                             [- 6.27194788, -0.00091384, 0.00056019, 7.27103405, 0.99720728, 0.99852598, 0.49305568],
+                             [- 6.27194867, -0.00091357, 0.00056002, 7.27103510, 0.99720811, 0.99852641, 0.49305582],
+                             [- 6.27194946, -0.00091330, 0.00055986, 7.27103616, 0.99720893, 0.99852685, 0.49305585],
+                             [- 6.27195024, -0.00091303, 0.00055969, 7.27103721, 0.99720975, 0.99852728, 0.49305599],
+                             [- 6.27195102, -0.00091276, 0.00055953, 7.27103827, 0.99721058, 0.99852772, 0.49305606],
+                             [- 6.27195181, -0.00091249, 0.00055936, 7.27103932, 0.99721140, 0.99852815, 0.49305614],
+                             [- 6.27195259, -0.00091222, 0.00055920, 7.27104037, 0.99721222, 0.99852858, 0.49305629],
+                             [- 6.27195337, -0.00091195, 0.00055903, 7.27104142, 0.99721304, 0.99852902, 0.49305636],
+                             [- 6.27195415, -0.00091168, 0.00055887, 7.27104247, 0.99721387, 0.99852945, 0.49305643],
+                             [- 6.27195493, -0.00091141, 0.00055870, 7.27104351, 0.99721469, 0.99852988, 0.49305655],
+                             [- 6.27195571, -0.00091115, 0.00055854, 7.27104456, 0.99721551, 0.99853032, 0.49305663],
+                             [- 6.27195648, -0.00091088, 0.00055837, 7.27104561, 0.99721633, 0.99853075, 0.49305679],
+                             [- 6.27195726, -0.00091061, 0.00055821, 7.27104665, 0.99721715, 0.99853118, 0.49305682],
+                             [- 6.27195803, -0.00091034, 0.00055804, 7.27104769, 0.99721796, 0.99853161, 0.49305696],
+                             [- 6.27195881, -0.00091007, 0.00055788, 7.27104873, 0.99721878, 0.99853205, 0.49305711],
+                             [- 6.27195958, -0.00090981, 0.00055771, 7.27104978, 0.99721960, 0.99853248, 0.49305719],
+                             [- 6.27196035, -0.00090954, 0.00055755, 7.27105081, 0.99722042, 0.99853291, 0.49305721],
+                             [- 6.27196113, -0.00090927, 0.00055739, 7.27105185, 0.99722124, 0.99853334, 0.49305736],
+                             [- 6.27196190, -0.00090901, 0.00055722, 7.27105289, 0.99722205, 0.99853377, 0.49305741],
+                             [- 6.27196267, -0.00090874, 0.00055706, 7.27105393, 0.99722287, 0.99853420, 0.49305756],
+                             [- 6.27196344, -0.00090847, 0.00055690, 7.27105496, 0.99722368, 0.99853463, 0.49305766],
+                             [- 6.27196420, -0.00090821, 0.00055673, 7.27105600, 0.99722450, 0.99853506, 0.49305779],
+                             [- 6.27196497, -0.00090794, 0.00055657, 7.27105703, 0.99722531, 0.99853549, 0.49305788],
+                             [- 6.27196574, -0.00090767, 0.00055641, 7.27105806, 0.99722613, 0.99853592, 0.49305797],
+                             [- 6.27196650, -0.00090741, 0.00055624, 7.27105909, 0.99722694, 0.99853635, 0.49305806],
+                             [- 6.27196726, -0.00090714, 0.00055608, 7.27106012, 0.99722776, 0.99853678, 0.49305817],
+                             [- 6.27196803, -0.00090688, 0.00055592, 7.27106115, 0.99722857, 0.99853721, 0.49305825],
+                             [- 6.27196879, -0.00090661, 0.00055575, 7.27106218, 0.99722938, 0.99853764, 0.49305840],
+                             [- 6.27196955, -0.00090634, 0.00055559, 7.27106321, 0.99723019, 0.99853807, 0.49305847],
+                             [- 6.27197031, -0.00090608, 0.00055543, 7.27106423, 0.99723100, 0.99853849, 0.49305859],
+                             [- 6.27197107, -0.00090581, 0.00055526, 7.27106526, 0.99723181, 0.99853892, 0.49305865],
+                             [- 6.27197183, -0.00090555, 0.00055510, 7.27106628, 0.99723262, 0.99853935, 0.49305875],
+                             [- 6.27197259, -0.00090528, 0.00055494, 7.27106730, 0.99723343, 0.99853978, 0.49305889],
+                             [- 6.27197335, -0.00090502, 0.00055478, 7.27106833, 0.99723424, 0.99854020, 0.49305896],
+                             [- 6.27197410, -0.00090476, 0.00055461, 7.27106935, 0.99723505, 0.99854063, 0.49305906],
+                             [- 6.27197486, -0.00090449, 0.00055445, 7.27107037, 0.99723586, 0.99854106, 0.49305911],
+                             [- 6.27197561, -0.00090423, 0.00055429, 7.27107138, 0.99723667, 0.99854148, 0.49305929],
+                             [- 6.27197637, -0.00090396, 0.00055413, 7.27107240, 0.99723748, 0.99854191, 0.49305933],
+                             [- 6.27197712, -0.00090370, 0.00055397, 7.27107342, 0.99723828, 0.99854233, 0.49305943],
+                             [- 6.27197787, -0.00090344, 0.00055380, 7.27107443, 0.99723909, 0.99854276, 0.49305954],
+                             [- 6.27197862, -0.00090317, 0.00055364, 7.27107545, 0.99723990, 0.99854319, 0.49305965],
+                             [- 6.27197937, -0.00090291, 0.00055348, 7.27107646, 0.99724070, 0.99854361, 0.49305972],
+                             [- 6.27198012, -0.00090264, 0.00055332, 7.27107748, 0.99724151, 0.99854404, 0.49305986],
+                             [- 6.27198087, -0.00090238, 0.00055316, 7.27107849, 0.99724231, 0.99854446, 0.49305996],
+                             [- 6.27198162, -0.00090212, 0.00055300, 7.27107950, 0.99724312, 0.99854488, 0.49306003],
+                             [- 6.27198236, -0.00090186, 0.00055284, 7.27108051, 0.99724392, 0.99854531, 0.49306014],
+                             [- 6.27198311, -0.00090159, 0.00055267, 7.27108151, 0.99724472, 0.99854573, 0.49306027],
+                             [- 6.27198385, -0.00090133, 0.00055251, 7.27108252, 0.99724553, 0.99854616, 0.49306036],
+                             [- 6.27198460, -0.00090107, 0.00055235, 7.27108353, 0.99724633, 0.99854658, 0.49306043],
+                             [- 6.27198534, -0.00090081, 0.00055219, 7.27108453, 0.99724713, 0.99854700, 0.49306047],
+                             [- 6.27198608, -0.00090054, 0.00055203, 7.27108554, 0.99724793, 0.99854742, 0.49306066],
+                             [- 6.27198682, -0.00090028, 0.00055187, 7.27108654, 0.99724873, 0.99854785, 0.49306072],
+                             [- 6.27198756, -0.00090002, 0.00055171, 7.27108754, 0.99724953, 0.99854827, 0.49306079],
+                             [- 6.27198830, -0.00089976, 0.00055155, 7.27108855, 0.99725033, 0.99854869, 0.49306090],
+                             [- 6.27198904, -0.00089950, 0.00055139, 7.27108955, 0.99725113, 0.99854911, 0.49306100],
+                             [- 6.27198978, -0.00089924, 0.00055123, 7.27109054, 0.99725193, 0.99854954, 0.49306107],
+                             [- 6.27199052, -0.00089898, 0.00055107, 7.27109154, 0.99725273, 0.99854996, 0.49306122],
+                             [- 6.27199126, -0.00089871, 0.00055091, 7.27109254, 0.99725353, 0.99855038, 0.49306129],
+                             [- 6.27199199, -0.00089845, 0.00055075, 7.27109354, 0.99725433, 0.99855080, 0.49306135],
+                             [- 6.27199273, -0.00089819, 0.00055059, 7.27109453, 0.99725512, 0.99855122, 0.49306146],
+                             [- 6.27199346, -0.00089793, 0.00055043, 7.27109553, 0.99725592, 0.99855164, 0.49306163],
+                             [- 6.27199419, -0.00089767, 0.00055027, 7.27109652, 0.99725672, 0.99855206, 0.49306163],
+                             [- 6.27199493, -0.00089741, 0.00055011, 7.27109751, 0.99725751, 0.99855248, 0.49306178],
+                             [- 6.27199566, -0.00089715, 0.00054995, 7.27109851, 0.99725831, 0.99855290, 0.49306188],
+                             [- 6.27199639, -0.00089689, 0.00054979, 7.27109950, 0.99725910, 0.99855332, 0.49306196],
+                             [- 6.27199712, -0.00089663, 0.00054963, 7.27110049, 0.99725990, 0.99855374, 0.49306206],
+                             [- 6.27199785, -0.00089637, 0.00054947, 7.27110147, 0.99726069, 0.99855416, 0.49306218],
+                             [- 6.27199857, -0.00089611, 0.00054931, 7.27110246, 0.99726149, 0.99855458, 0.49306227],
+                             [- 6.27199930, -0.00089585, 0.00054915, 7.27110345, 0.99726228, 0.99855499, 0.49306238],
+                             [- 6.27200003, -0.00089559, 0.00054899, 7.27110443, 0.99726307, 0.99855541, 0.49306244],
+                             [- 6.27200076, -0.00089534, 0.00054883, 7.27110542, 0.99726386, 0.99855583, 0.49306254],
+                             [- 6.27200148, -0.00089508, 0.00054868, 7.27110640, 0.99726465, 0.99855625, 0.49306260],
+                             [- 6.27200220, -0.00089482, 0.00054852, 7.27110739, 0.99726545, 0.99855667, 0.49306270],
+                             [- 6.27200293, -0.00089456, 0.00054836, 7.27110837, 0.99726624, 0.99855708, 0.49306284],
+                             [- 6.27200365, -0.00089430, 0.00054820, 7.27110935, 0.99726703, 0.99855750, 0.49306289],
+                             [- 6.27200437, -0.00089404, 0.00054804, 7.27111033, 0.99726782, 0.99855792, 0.49306299],
+                             [- 6.27200509, -0.00089378, 0.00054788, 7.27111131, 0.99726861, 0.99855833, 0.49306315],
+                             [- 6.27200581, -0.00089353, 0.00054772, 7.27111229, 0.99726940, 0.99855875, 0.49306325],
+                             [- 6.27200653, -0.00089327, 0.00054757, 7.27111326, 0.99727018, 0.99855916, 0.49306334],
+                             [- 6.27200725, -0.00089301, 0.00054741, 7.27111424, 0.99727097, 0.99855958, 0.49306342],
+                             [- 6.27200797, -0.00089275, 0.00054725, 7.27111522, 0.99727176, 0.99856000, 0.49306348],
+                             [- 6.27200869, -0.00089250, 0.00054709, 7.27111619, 0.99727255, 0.99856041, 0.49306360],
+                             [- 6.27200940, -0.00089224, 0.00054693, 7.27111717, 0.99727333, 0.99856083, 0.49306368],
+                             [- 6.27201012, -0.00089198, 0.00054678, 7.27111814, 0.99727412, 0.99856124, 0.49306382],
+                             [- 6.27201083, -0.00089172, 0.00054662, 7.27111911, 0.99727491, 0.99856166, 0.49306389],
+                             [- 6.27201155, -0.00089147, 0.00054646, 7.27112008, 0.99727569, 0.99856207, 0.49306395],
+                             [- 6.27201226, -0.00089121, 0.00054630, 7.27112105, 0.99727648, 0.99856248, 0.49306405],
+                             [- 6.27201297, -0.00089095, 0.00054615, 7.27112202, 0.99727726, 0.99856290, 0.49306415],
+                             [- 6.27201369, -0.00089070, 0.00054599, 7.27112299, 0.99727804, 0.99856331, 0.49306425],
+                             [- 6.27201440, -0.00089044, 0.00054583, 7.27112395, 0.99727883, 0.99856373, 0.49306438],
+                             [- 6.27201511, -0.00089019, 0.00054568, 7.27112492, 0.99727961, 0.99856414, 0.49306445],
+                             [- 6.27201582, -0.00088993, 0.00054552, 7.27112589, 0.99728039, 0.99856455, 0.49306454],
+                             [- 6.27201653, -0.00088967, 0.00054536, 7.27112685, 0.99728118, 0.99856496, 0.49306460],
+                             [- 6.27201723, -0.00088942, 0.00054520, 7.27112782, 0.99728196, 0.99856538, 0.49306473],
+                             [- 6.27201794, -0.00088916, 0.00054505, 7.27112878, 0.99728274, 0.99856579, 0.49306481],
+                             [- 6.27201865, -0.00088891, 0.00054489, 7.27112974, 0.99728352, 0.99856620, 0.49306490],
+                             [- 6.27201935, -0.00088865, 0.00054473, 7.27113070, 0.99728430, 0.99856661, 0.49306499],
+                             [- 6.27202006, -0.00088840, 0.00054458, 7.27113166, 0.99728508, 0.99856702, 0.49306507],
+                             [- 6.27202076, -0.00088814, 0.00054442, 7.27113262, 0.99728586, 0.99856744, 0.49306519],
+                             [- 6.27202147, -0.00088789, 0.00054427, 7.27113358, 0.99728664, 0.99856785, 0.49306522],
+                             [- 6.27202217, -0.00088763, 0.00054411, 7.27113454, 0.99728742, 0.99856826, 0.49306541],
+                             [- 6.27202287, -0.00088738, 0.00054395, 7.27113549, 0.99728820, 0.99856867, 0.49306548],
+                             [- 6.27202357, -0.00088713, 0.00054380, 7.27113645, 0.99728897, 0.99856908, 0.49306558],
+                             [- 6.27202427, -0.00088687, 0.00054364, 7.27113740, 0.99728975, 0.99856949, 0.49306563],
+                             [- 6.27202497, -0.00088662, 0.00054349, 7.27113836, 0.99729053, 0.99856990, 0.49306575],
+                             [- 6.27202567, -0.00088636, 0.00054333, 7.27113931, 0.99729130, 0.99857031, 0.49306582],
+                             [- 6.27202637, -0.00088611, 0.00054317, 7.27114026, 0.99729208, 0.99857072, 0.49306593],
+                             [- 6.27202707, -0.00088586, 0.00054302, 7.27114121, 0.99729285, 0.99857113, 0.49306602],
+                             [- 6.27202777, -0.00088560, 0.00054286, 7.27114216, 0.99729363, 0.99857153, 0.49306615],
+                             [- 6.27202846, -0.00088535, 0.00054271, 7.27114311, 0.99729440, 0.99857194, 0.49306620],
+                             [- 6.27202916, -0.00088510, 0.00054255, 7.27114406, 0.99729518, 0.99857235, 0.49306631],
+                             [- 6.27202985, -0.00088484, 0.00054240, 7.27114501, 0.99729595, 0.99857276, 0.49306638],
+                             [- 6.27203055, -0.00088459, 0.00054224, 7.27114596, 0.99729673, 0.99857317, 0.49306650],
+                             [- 6.27203124, -0.00088434, 0.00054209, 7.27114690, 0.99729750, 0.99857358, 0.49306661],
+                             [- 6.27203193, -0.00088409, 0.00054193, 7.27114785, 0.99729827, 0.99857398, 0.49306664],
+                             [- 6.27203262, -0.00088383, 0.00054178, 7.27114879, 0.99729904, 0.99857439, 0.49306674],
+                             [- 6.27203332, -0.00088358, 0.00054162, 7.27114973, 0.99729981, 0.99857480, 0.49306687],
+                             [- 6.27203401, -0.00088333, 0.00054147, 7.27115068, 0.99730059, 0.99857520, 0.49306699],
+                             [- 6.27203470, -0.00088308, 0.00054131, 7.27115162, 0.99730136, 0.99857561, 0.49306701],
+                             [- 6.27203539, -0.00088282, 0.00054116, 7.27115256, 0.99730213, 0.99857602, 0.49306713],
+                             [- 6.27203607, -0.00088257, 0.00054100, 7.27115350, 0.99730290, 0.99857642, 0.49306721],
+                             [- 6.27203676, -0.00088232, 0.00054085, 7.27115444, 0.99730366, 0.99857683, 0.49306728],
+                             [- 6.27203745, -0.00088207, 0.00054069, 7.27115538, 0.99730443, 0.99857724, 0.49306742],
+                             [- 6.27203813, -0.00088182, 0.00054054, 7.27115632, 0.99730520, 0.99857764, 0.49306753],
+                             [- 6.27203882, -0.00088157, 0.00054039, 7.27115725, 0.99730597, 0.99857805, 0.49306761],
+                             [- 6.27203950, -0.00088132, 0.00054023, 7.27115819, 0.99730674, 0.99857845, 0.49306769],
+                             [- 6.27204019, -0.00088107, 0.00054008, 7.27115912, 0.99730750, 0.99857886, 0.49306776],
+                             [- 6.27204087, -0.00088082, 0.00053992, 7.27116006, 0.99730827, 0.99857926, 0.49306785],
+                             [- 6.27204156, -0.00088056, 0.00053977, 7.27116099, 0.99730904, 0.99857966, 0.49306801],
+                             [- 6.27204224, -0.00088031, 0.00053962, 7.27116192, 0.99730980, 0.99858007, 0.49306813],
+                             [- 6.27204292, -0.00088006, 0.00053946, 7.27116286, 0.99731057, 0.99858047, 0.49306816],
+                             [- 6.27204360, -0.00087981, 0.00053931, 7.27116379, 0.99731133, 0.99858088, 0.49306827],
+                             [- 6.27204428, -0.00087956, 0.00053916, 7.27116472, 0.99731210, 0.99858128, 0.49306833],
+                             [- 6.27204496, -0.00087931, 0.00053900, 7.27116565, 0.99731286, 0.99858168, 0.49306842],
+                             [- 6.27204564, -0.00087906, 0.00053885, 7.27116657, 0.99731363, 0.99858209, 0.49306852],
+                             [- 6.27204632, -0.00087881, 0.00053870, 7.27116750, 0.99731439, 0.99858249, 0.49306865],
+                             [- 6.27204699, -0.00087857, 0.00053854, 7.27116843, 0.99731515, 0.99858289, 0.49306872],
+                             [- 6.27204767, -0.00087832, 0.00053839, 7.27116935, 0.99731591, 0.99858329, 0.49306875],
+                             [- 6.27204835, -0.00087807, 0.00053824, 7.27117028, 0.99731668, 0.99858369, 0.49306889],
+                             [- 6.27204902, -0.00087782, 0.00053809, 7.27117120, 0.99731744, 0.99858410, 0.49306899],
+                             [- 6.27204970, -0.00087757, 0.00053793, 7.27117213, 0.99731820, 0.99858450, 0.49306909],
+                             [- 6.27205037, -0.00087732, 0.00053778, 7.27117305, 0.99731896, 0.99858490, 0.49306915],
+                             [- 6.27205104, -0.00087707, 0.00053763, 7.27117397, 0.99731972, 0.99858530, 0.49306931],
+                             [- 6.27205172, -0.00087682, 0.00053748, 7.27117489, 0.99732048, 0.99858570, 0.49306931],
+                             [- 6.27205239, -0.00087658, 0.00053732, 7.27117581, 0.99732124, 0.99858610, 0.49306947],
+                             [- 6.27205306, -0.00087633, 0.00053717, 7.27117673, 0.99732200, 0.99858650, 0.49306949],
+                             [- 6.27205373, -0.00087608, 0.00053702, 7.27117765, 0.99732276, 0.99858690, 0.49306961],
+                             [- 6.27205440, -0.00087583, 0.00053687, 7.27117857, 0.99732351, 0.99858730, 0.49306974],
+                             [- 6.27205507, -0.00087558, 0.00053671, 7.27117949, 0.99732427, 0.99858770, 0.49306982],
+                             [- 6.27205574, -0.00087534, 0.00053656, 7.27118040, 0.99732503, 0.99858810, 0.49306986],
+                             [- 6.27205641, -0.00087509, 0.00053641, 7.27118132, 0.99732579, 0.99858850, 0.49306997],
+                             [- 6.27205707, -0.00087484, 0.00053626, 7.27118223, 0.99732654, 0.99858890, 0.49307002],
+                             [- 6.27205774, -0.00087459, 0.00053611, 7.27118315, 0.99732730, 0.99858930, 0.49307020],
+                             [- 6.27205841, -0.00087435, 0.00053596, 7.27118406, 0.99732805, 0.99858970, 0.49307021],
+                             [- 6.27205907, -0.00087410, 0.00053580, 7.27118497, 0.99732881, 0.99859010, 0.49307035],
+                             [- 6.27205974, -0.00087385, 0.00053565, 7.27118588, 0.99732956, 0.99859049, 0.49307047],
+                             [- 6.27206040, -0.00087361, 0.00053550, 7.27118679, 0.99733032, 0.99859089, 0.49307051],
+                             [- 6.27206106, -0.00087336, 0.00053535, 7.27118770, 0.99733107, 0.99859129, 0.49307062],
+                             [- 6.27206173, -0.00087311, 0.00053520, 7.27118861, 0.99733182, 0.99859169, 0.49307069],
+                             [- 6.27206239, -0.00087287, 0.00053505, 7.27118952, 0.99733258, 0.99859208, 0.49307080],
+                             [- 6.27206305, -0.00087262, 0.00053490, 7.27119043, 0.99733333, 0.99859248, 0.49307089],
+                             [- 6.27206371, -0.00087238, 0.00053475, 7.27119134, 0.99733408, 0.99859288, 0.49307096],
+                             [- 6.27206437, -0.00087213, 0.00053460, 7.27119224, 0.99733483, 0.99859327, 0.49307103],
+                             [- 6.27206503, -0.00087188, 0.00053445, 7.27119315, 0.99733558, 0.99859367, 0.49307121],
+                             [- 6.27206569, -0.00087164, 0.00053429, 7.27119405, 0.99733633, 0.99859407, 0.49307121],
+                             [- 6.27206635, -0.00087139, 0.00053414, 7.27119496, 0.99733709, 0.99859446, 0.49307131],
+                             [- 6.27206701, -0.00087115, 0.00053399, 7.27119586, 0.99733783, 0.99859486, 0.49307143],
+                             [- 6.27206767, -0.00087090, 0.00053384, 7.27119676, 0.99733858, 0.99859525, 0.49307152],
+                             [- 6.27206832, -0.00087066, 0.00053369, 7.27119766, 0.99733933, 0.99859565, 0.49307163],
+                             [- 6.27206898, -0.00087041, 0.00053354, 7.27119856, 0.99734008, 0.99859604, 0.49307170],
+                             [- 6.27206963, -0.00087017, 0.00053339, 7.27119946, 0.99734083, 0.99859644, 0.49307178],
+                             [- 6.27207029, -0.00086992, 0.00053324, 7.27120036, 0.99734158, 0.99859683, 0.49307182],
+                             [- 6.27207094, -0.00086968, 0.00053309, 7.27120126, 0.99734233, 0.99859723, 0.49307196],
+                             [- 6.27207160, -0.00086944, 0.00053294, 7.27120216, 0.99734307, 0.99859762, 0.49307197],
+                             [- 6.27207225, -0.00086919, 0.00053279, 7.27120306, 0.99734382, 0.99859802, 0.49307220],
+                             [- 6.27207290, -0.00086895, 0.00053264, 7.27120395, 0.99734457, 0.99859841, 0.49307226],
+                             [- 6.27207355, -0.00086870, 0.00053249, 7.27120485, 0.99734531, 0.99859880, 0.49307233],
+                             [- 6.27207420, -0.00086846, 0.00053234, 7.27120574, 0.99734606, 0.99859920, 0.49307241],
+                             [- 6.27207485, -0.00086822, 0.00053219, 7.27120664, 0.99734680, 0.99859959, 0.49307252],
+                             [- 6.27207550, -0.00086797, 0.00053205, 7.27120753, 0.99734755, 0.99859998, 0.49307258],
+                             [- 6.27207615, -0.00086773, 0.00053190, 7.27120842, 0.99734829, 0.99860037, 0.49307271],
+                             [- 6.27207680, -0.00086749, 0.00053175, 7.27120931, 0.99734903, 0.99860077, 0.49307274],
+                             [- 6.27207745, -0.00086724, 0.00053160, 7.27121021, 0.99734978, 0.99860116, 0.49307287],
+                             [- 6.27207810, -0.00086700, 0.00053145, 7.27121110, 0.99735052, 0.99860155, 0.49307293],
+                             [- 6.27207874, -0.00086676, 0.00053130, 7.27121199, 0.99735126, 0.99860194, 0.49307303],
+                             [- 6.27207939, -0.00086652, 0.00053115, 7.27121287, 0.99735200, 0.99860233, 0.49307313],
+                             [- 6.27208004, -0.00086627, 0.00053100, 7.27121376, 0.99735275, 0.99860273, 0.49307325],
+                             [- 6.27208068, -0.00086603, 0.00053085, 7.27121465, 0.99735349, 0.99860312, 0.49307329],
+                             [- 6.27208132, -0.00086579, 0.00053070, 7.27121554, 0.99735423, 0.99860351, 0.49307333],
+                             [- 6.27208197, -0.00086555, 0.00053056, 7.27121642, 0.99735497, 0.99860390, 0.49307349],
+                             [- 6.27208261, -0.00086530, 0.00053041, 7.27121731, 0.99735571, 0.99860429, 0.49307355],
+                             [- 6.27208325, -0.00086506, 0.00053026, 7.27121819, 0.99735645, 0.99860468, 0.49307366],
+                             [- 6.27208390, -0.00086482, 0.00053011, 7.27121907, 0.99735719, 0.99860507, 0.49307376],
+                             [- 6.27208454, -0.00086458, 0.00052996, 7.27121996, 0.99735792, 0.99860546, 0.49307384],
+                             [- 6.27208518, -0.00086434, 0.00052981, 7.27122084, 0.99735866, 0.99860585, 0.49307389],
+                             [- 6.27208582, -0.00086410, 0.00052967, 7.27122172, 0.99735940, 0.99860624, 0.49307398],
+                             [- 6.27208646, -0.00086386, 0.00052952, 7.27122260, 0.99736014, 0.99860663, 0.49307410],
+                             [- 6.27208710, -0.00086361, 0.00052937, 7.27122348, 0.99736088, 0.99860701, 0.49307418],
+                             [- 6.27208774, -0.00086337, 0.00052922, 7.27122436, 0.99736161, 0.99860740, 0.49307431],
+                             [- 6.27208837, -0.00086313, 0.00052908, 7.27122524, 0.99736235, 0.99860779, 0.49307430],
+                             [- 6.27208901, -0.00086289, 0.00052893, 7.27122612, 0.99736308, 0.99860818, 0.49307450],
+                             [- 6.27208965, -0.00086265, 0.00052878, 7.27122700, 0.99736382, 0.99860857, 0.49307452],
+                             [- 6.27209028, -0.00086241, 0.00052863, 7.27122787, 0.99736455, 0.99860896, 0.49307461],
+                             [- 6.27209092, -0.00086217, 0.00052849, 7.27122875, 0.99736529, 0.99860934, 0.49307473],
+                             [- 6.27209155, -0.00086193, 0.00052834, 7.27122962, 0.99736602, 0.99860973, 0.49307476],
+                             [- 6.27209219, -0.00086169, 0.00052819, 7.27123050, 0.99736676, 0.99861012, 0.49307493],
+                             [- 6.27209282, -0.00086145, 0.00052804, 7.27123137, 0.99736749, 0.99861050, 0.49307491],
+                             [- 6.27209346, -0.00086121, 0.00052790, 7.27123224, 0.99736822, 0.99861089, 0.49307506],
+                             [- 6.27209409, -0.00086097, 0.00052775, 7.27123312, 0.99736896, 0.99861128, 0.49307515],
+                             [- 6.27209472, -0.00086073, 0.00052760, 7.27123399, 0.99736969, 0.99861166, 0.49307527],
+                             [- 6.27209535, -0.00086049, 0.00052746, 7.27123486, 0.99737042, 0.99861205, 0.49307528],
+                             [- 6.27209598, -0.00086025, 0.00052731, 7.27123573, 0.99737115, 0.99861244, 0.49307544],
+                             [- 6.27209661, -0.00086002, 0.00052716, 7.27123660, 0.99737188, 0.99861282, 0.49307551],
+                             [- 6.27209724, -0.00085978, 0.00052702, 7.27123747, 0.99737261, 0.99861321, 0.49307555],
+                             [- 6.27209787, -0.00085954, 0.00052687, 7.27123833, 0.99737334, 0.99861359, 0.49307566],
+                             [- 6.27209850, -0.00085930, 0.00052672, 7.27123920, 0.99737407, 0.99861398, 0.49307570],
+                             [- 6.27209913, -0.00085906, 0.00052658, 7.27124007, 0.99737480, 0.99861436, 0.49307581],
+                             [- 6.27209976, -0.00085882, 0.00052643, 7.27124094, 0.99737553, 0.99861475, 0.49307599],
+                             [- 6.27210038, -0.00085858, 0.00052628, 7.27124180, 0.99737626, 0.99861513, 0.49307598],
+                             [- 6.27210101, -0.00085835, 0.00052614, 7.27124266, 0.99737699, 0.99861551, 0.49307614],
+                             [- 6.27210164, -0.00085811, 0.00052599, 7.27124353, 0.99737771, 0.99861590, 0.49307614],
+                             [- 6.27210226, -0.00085787, 0.00052585, 7.27124439, 0.99737844, 0.99861628, 0.49307625],
+                             [- 6.27210289, -0.00085763, 0.00052570, 7.27124525, 0.99737917, 0.99861667, 0.49307637],
+                             [- 6.27210351, -0.00085740, 0.00052555, 7.27124612, 0.99737989, 0.99861705, 0.49307645],
+                             [- 6.27210414, -0.00085716, 0.00052541, 7.27124698, 0.99738062, 0.99861743, 0.49307653],
+                             [- 6.27210476, -0.00085692, 0.00052526, 7.27124784, 0.99738135, 0.99861782, 0.49307663],
+                             [- 6.27210538, -0.00085668, 0.00052512, 7.27124870, 0.99738207, 0.99861820, 0.49307669],
+                             [- 6.27210600, -0.00085645, 0.00052497, 7.27124956, 0.99738280, 0.99861858, 0.49307677],
+                             [- 6.27210663, -0.00085621, 0.00052483, 7.27125042, 0.99738352, 0.99861896, 0.49307688],
+                             [- 6.27210725, -0.00085597, 0.00052468, 7.27125127, 0.99738424, 0.99861934, 0.49307699],
+                             [- 6.27210787, -0.00085574, 0.00052454, 7.27125213, 0.99738497, 0.99861973, 0.49307706],
+                             [- 6.27210849, -0.00085550, 0.00052439, 7.27125299, 0.99738569, 0.99862011, 0.49307704],
+                             [- 6.27210911, -0.00085526, 0.00052425, 7.27125384, 0.99738641, 0.99862049, 0.49307723],
+                             [- 6.27210973, -0.00085503, 0.00052410, 7.27125470, 0.99738714, 0.99862087, 0.49307731],
+                             [- 6.27211034, -0.00085479, 0.00052396, 7.27125555, 0.99738786, 0.99862125, 0.49307742],
+                             [- 6.27211096, -0.00085456, 0.00052381, 7.27125641, 0.99738858, 0.99862163, 0.49307753],
+                             [- 6.27211158, -0.00085432, 0.00052367, 7.27125726, 0.99738930, 0.99862201, 0.49307753],
+                             [- 6.27211220, -0.00085408, 0.00052352, 7.27125811, 0.99739002, 0.99862239, 0.49307764],
+                             [- 6.27211281, -0.00085385, 0.00052338, 7.27125896, 0.99739074, 0.99862277, 0.49307770],
+                             [- 6.27211343, -0.00085361, 0.00052323, 7.27125981, 0.99739146, 0.99862315, 0.49307780],
+                             [- 6.27211404, -0.00085338, 0.00052309, 7.27126067, 0.99739218, 0.99862353, 0.49307792],
+                             [- 6.27211466, -0.00085314, 0.00052295, 7.27126152, 0.99739290, 0.99862391, 0.49307794],
+                             [- 6.27211527, -0.00085291, 0.00052280, 7.27126236, 0.99739362, 0.99862429, 0.49307803],
+                             [- 6.27211589, -0.00085267, 0.00052266, 7.27126321, 0.99739434, 0.99862467, 0.49307820],
+                             [- 6.27211650, -0.00085244, 0.00052251, 7.27126406, 0.99739506, 0.99862505, 0.49307827],
+                             [- 6.27211711, -0.00085220, 0.00052237, 7.27126491, 0.99739577, 0.99862543, 0.49307830],
+                             [- 6.27211772, -0.00085197, 0.00052222, 7.27126575, 0.99739649, 0.99862581, 0.49307839],
+                             [- 6.27211833, -0.00085173, 0.00052208, 7.27126660, 0.99739721, 0.99862618, 0.49307851],
+                             [- 6.27211895, -0.00085150, 0.00052194, 7.27126745, 0.99739792, 0.99862656, 0.49307861],
+                             [- 6.27211956, -0.00085127, 0.00052179, 7.27126829, 0.99739864, 0.99862694, 0.49307868],
+                             [- 6.27212017, -0.00085103, 0.00052165, 7.27126913, 0.99739936, 0.99862732, 0.49307878],
+                             [- 6.27212078, -0.00085080, 0.00052151, 7.27126998, 0.99740007, 0.99862770, 0.49307884],
+                             [- 6.27212138, -0.00085056, 0.00052136, 7.27127082, 0.99740079, 0.99862807, 0.49307888],
+                             [- 6.27212199, -0.00085033, 0.00052122, 7.27127166, 0.99740150, 0.99862845, 0.49307902],
+                             [- 6.27212260, -0.00085010, 0.00052108, 7.27127250, 0.99740221, 0.99862883, 0.49307911],
+                             [- 6.27212321, -0.00084986, 0.00052093, 7.27127334, 0.99740293, 0.99862920, 0.49307920],
+                             [- 6.27212381, -0.00084963, 0.00052079, 7.27127418, 0.99740364, 0.99862958, 0.49307926],
+                             [- 6.27212442, -0.00084940, 0.00052065, 7.27127502, 0.99740435, 0.99862996, 0.49307935],
+                             [- 6.27212503, -0.00084916, 0.00052050, 7.27127586, 0.99740507, 0.99863033, 0.49307944],
+                             [- 6.27212563, -0.00084893, 0.00052036, 7.27127670, 0.99740578, 0.99863071, 0.49307944],
+                             [- 6.27212624, -0.00084870, 0.00052022, 7.27127754, 0.99740649, 0.99863108, 0.49307954],
+                             [- 6.27212684, -0.00084847, 0.00052008, 7.27127837, 0.99740720, 0.99863146, 0.49307961],
+                             [- 6.27212744, -0.00084823, 0.00051993, 7.27127921, 0.99740791, 0.99863183, 0.49307978],
+                             [- 6.27212805, -0.00084800, 0.00051979, 7.27128005, 0.99740862, 0.99863221, 0.49307983],
+                             [- 6.27212865, -0.00084777, 0.00051965, 7.27128088, 0.99740933, 0.99863258, 0.49307996],
+                             [- 6.27212925, -0.00084754, 0.00051951, 7.27128172, 0.99741004, 0.99863296, 0.49308005],
+                             [- 6.27212986, -0.00084730, 0.00051936, 7.27128255, 0.99741075, 0.99863333, 0.49308014],
+                             [- 6.27213046, -0.00084707, 0.00051922, 7.27128338, 0.99741146, 0.99863371, 0.49308018],
+                             [- 6.27213106, -0.00084684, 0.00051908, 7.27128422, 0.99741217, 0.99863408, 0.49308030],
+                             [- 6.27213166, -0.00084661, 0.00051894, 7.27128505, 0.99741288, 0.99863445, 0.49308040],
+                             [- 6.27213226, -0.00084638, 0.00051879, 7.27128588, 0.99741359, 0.99863483, 0.49308040],
+                             [- 6.27213286, -0.00084615, 0.00051865, 7.27128671, 0.99741429, 0.99863520, 0.49308050],
+                             [- 6.27213345, -0.00084592, 0.00051851, 7.27128754, 0.99741500, 0.99863557, 0.49308061],
+                             [- 6.27213405, -0.00084568, 0.00051837, 7.27128837, 0.99741571, 0.99863595, 0.49308064],
+                             [- 6.27213465, -0.00084545, 0.00051823, 7.27128920, 0.99741641, 0.99863632, 0.49308083],
+                             [- 6.27213525, -0.00084522, 0.00051809, 7.27129003, 0.99741712, 0.99863669, 0.49308089],
+                             [- 6.27213585, -0.00084499, 0.00051794, 7.27129085, 0.99741783, 0.99863706, 0.49308103],
+                             [- 6.27213644, -0.00084476, 0.00051780, 7.27129168, 0.99741853, 0.99863744, 0.49308104],
+                             [- 6.27213704, -0.00084453, 0.00051766, 7.27129251, 0.99741924, 0.99863781, 0.49308114],
+                             [- 6.27213763, -0.00084430, 0.00051752, 7.27129333, 0.99741994, 0.99863818, 0.49308122],
+                             [- 6.27213823, -0.00084407, 0.00051738, 7.27129416, 0.99742064, 0.99863855, 0.49308125],
+                             [- 6.27213882, -0.00084384, 0.00051724, 7.27129498, 0.99742135, 0.99863892, 0.49308128],
+                             [- 6.27213942, -0.00084361, 0.00051710, 7.27129581, 0.99742205, 0.99863929, 0.49308149],
+                             [- 6.27214001, -0.00084338, 0.00051696, 7.27129663, 0.99742275, 0.99863966, 0.49308153],
+                             [- 6.27214060, -0.00084315, 0.00051681, 7.27129745, 0.99742346, 0.99864003, 0.49308160],
+                             [- 6.27214120, -0.00084292, 0.00051667, 7.27129827, 0.99742416, 0.99864041, 0.49308174],
+                             [- 6.27214179, -0.00084269, 0.00051653, 7.27129910, 0.99742486, 0.99864078, 0.49308171],
+                             [- 6.27214238, -0.00084246, 0.00051639, 7.27129992, 0.99742556, 0.99864115, 0.49308189],
+                             [- 6.27214297, -0.00084223, 0.00051625, 7.27130074, 0.99742626, 0.99864152, 0.49308189],
+                             [- 6.27214356, -0.00084200, 0.00051611, 7.27130156, 0.99742696, 0.99864188, 0.49308208],
+                             [- 6.27214415, -0.00084178, 0.00051597, 7.27130237, 0.99742766, 0.99864225, 0.49308218],
+                             [- 6.27214474, -0.00084155, 0.00051583, 7.27130319, 0.99742836, 0.99864262, 0.49308217],
+                             [- 6.27214533, -0.00084132, 0.00051569, 7.27130401, 0.99742906, 0.99864299, 0.49308225],
+                             [- 6.27214592, -0.00084109, 0.00051555, 7.27130483, 0.99742976, 0.99864336, 0.49308239],
+                             [- 6.27214651, -0.00084086, 0.00051541, 7.27130564, 0.99743046, 0.99864373, 0.49308247],
+                             [- 6.27214709, -0.00084063, 0.00051527, 7.27130646, 0.99743116, 0.99864410, 0.49308255],
+                             [- 6.27214768, -0.00084040, 0.00051513, 7.27130728, 0.99743186, 0.99864447, 0.49308258],
+                             [- 6.27214827, -0.00084018, 0.00051499, 7.27130809, 0.99743255, 0.99864483, 0.49308266],
+                             [- 6.27214885, -0.00083995, 0.00051485, 7.27130891, 0.99743325, 0.99864520, 0.49308274],
+                             [- 6.27214944, -0.00083972, 0.00051471, 7.27130972, 0.99743395, 0.99864557, 0.49308290],
+                             [- 6.27215002, -0.00083949, 0.00051457, 7.27131053, 0.99743464, 0.99864594, 0.49308290],
+                             [- 6.27215061, -0.00083926, 0.00051443, 7.27131134, 0.99743534, 0.99864631, 0.49308300],
+                             [- 6.27215119, -0.00083904, 0.00051429, 7.27131216, 0.99743604, 0.99864667, 0.49308315],
+                             [- 6.27215178, -0.00083881, 0.00051415, 7.27131297, 0.99743673, 0.99864704, 0.49308314],
+                             [- 6.27215236, -0.00083858, 0.00051401, 7.27131378, 0.99743743, 0.99864741, 0.49308324],
+                             [- 6.27215294, -0.00083836, 0.00051387, 7.27131459, 0.99743812, 0.99864777, 0.49308338],
+                             [- 6.27215353, -0.00083813, 0.00051373, 7.27131540, 0.99743881, 0.99864814, 0.49308338],
+                             [- 6.27215411, -0.00083790, 0.00051359, 7.27131621, 0.99743951, 0.99864850, 0.49308350],
+                             [- 6.27215469, -0.00083768, 0.00051345, 7.27131702, 0.99744020, 0.99864887, 0.49308357],
+                             [- 6.27215527, -0.00083745, 0.00051332, 7.27131782, 0.99744089, 0.99864924, 0.49308374],
+                             [- 6.27215585, -0.00083722, 0.00051318, 7.27131863, 0.99744159, 0.99864960, 0.49308379],
+                             [- 6.27215643, -0.00083700, 0.00051304, 7.27131944, 0.99744228, 0.99864997, 0.49308384],
+                             [- 6.27215701, -0.00083677, 0.00051290, 7.27132024, 0.99744297, 0.99865033, 0.49308393],
+                             [- 6.27215759, -0.00083654, 0.00051276, 7.27132105, 0.99744366, 0.99865070, 0.49308399],
+                             [- 6.27215817, -0.00083632, 0.00051262, 7.27132185, 0.99744435, 0.99865106, 0.49308412],
+                             [- 6.27215875, -0.00083609, 0.00051248, 7.27132266, 0.99744504, 0.99865143, 0.49308421],
+                             [- 6.27215933, -0.00083587, 0.00051234, 7.27132346, 0.99744574, 0.99865179, 0.49308425],
+                             [- 6.27215990, -0.00083564, 0.00051221, 7.27132426, 0.99744643, 0.99865215, 0.49308434],
+                             [- 6.27216048, -0.00083541, 0.00051207, 7.27132507, 0.99744711, 0.99865252, 0.49308442],
+                             [- 6.27216106, -0.00083519, 0.00051193, 7.27132587, 0.99744780, 0.99865288, 0.49308450],
+                             [- 6.27216164, -0.00083496, 0.00051179, 7.27132667, 0.99744849, 0.99865324, 0.49308461],
+                             [- 6.27216221, -0.00083474, 0.00051165, 7.27132747, 0.99744918, 0.99865361, 0.49308467],
+                             [- 6.27216279, -0.00083451, 0.00051151, 7.27132827, 0.99744987, 0.99865397, 0.49308473],
+                             [- 6.27216336, -0.00083429, 0.00051138, 7.27132907, 0.99745056, 0.99865433, 0.49308483],
+                             [- 6.27216394, -0.00083406, 0.00051124, 7.27132987, 0.99745124, 0.99865470, 0.49308489],
+                             [- 6.27216451, -0.00083384, 0.00051110, 7.27133067, 0.99745193, 0.99865506, 0.49308501],
+                             [- 6.27216508, -0.00083361, 0.00051096, 7.27133147, 0.99745262, 0.99865542, 0.49308509],
+                             [- 6.27216566, -0.00083339, 0.00051083, 7.27133227, 0.99745330, 0.99865578, 0.49308519],
+                             [- 6.27216623, -0.00083317, 0.00051069, 7.27133306, 0.99745399, 0.99865615, 0.49308520],
+                             [- 6.27216680, -0.00083294, 0.00051055, 7.27133386, 0.99745468, 0.99865651, 0.49308532],
+                             [- 6.27216737, -0.00083272, 0.00051041, 7.27133465, 0.99745536, 0.99865687, 0.49308537],
+                             [- 6.27216794, -0.00083249, 0.00051028, 7.27133545, 0.99745605, 0.99865723, 0.49308548],
+                             [- 6.27216851, -0.00083227, 0.00051014, 7.27133624, 0.99745673, 0.99865759, 0.49308555],
+                             [- 6.27216909, -0.00083205, 0.00051000, 7.27133704, 0.99745741, 0.99865795, 0.49308568],
+                             [- 6.27216966, -0.00083182, 0.00050986, 7.27133783, 0.99745810, 0.99865831, 0.49308575],
+                             [- 6.27217022, -0.00083160, 0.00050973, 7.27133863, 0.99745878, 0.99865867, 0.49308580],
+                             [- 6.27217079, -0.00083138, 0.00050959, 7.27133942, 0.99745946, 0.99865903, 0.49308589],
+                             [- 6.27217136, -0.00083115, 0.00050945, 7.27134021, 0.99746015, 0.99865939, 0.49308593],
+                             [- 6.27217193, -0.00083093, 0.00050932, 7.27134100, 0.99746083, 0.99865975, 0.49308603],
+                             [- 6.27217250, -0.00083071, 0.00050918, 7.27134179, 0.99746151, 0.99866011, 0.49308603],
+                             [- 6.27217307, -0.00083048, 0.00050904, 7.27134258, 0.99746219, 0.99866047, 0.49308626],
+                             [- 6.27217363, -0.00083026, 0.00050891, 7.27134337, 0.99746287, 0.99866083, 0.49308628],
+                             [- 6.27217420, -0.00083004, 0.00050877, 7.27134416, 0.99746355, 0.99866119, 0.49308633],
+                             [- 6.27217477, -0.00082982, 0.00050863, 7.27134495, 0.99746424, 0.99866155, 0.49308648],
+                             [- 6.27217533, -0.00082959, 0.00050850, 7.27134574, 0.99746492, 0.99866191, 0.49308650],
+                             [- 6.27217590, -0.00082937, 0.00050836, 7.27134653, 0.99746559, 0.99866227, 0.49308659],
+                             [- 6.27217646, -0.00082915, 0.00050822, 7.27134731, 0.99746627, 0.99866263, 0.49308664],
+                             [- 6.27217703, -0.00082893, 0.00050809, 7.27134810, 0.99746695, 0.99866299, 0.49308674],
+                             [- 6.27217759, -0.00082871, 0.00050795, 7.27134888, 0.99746763, 0.99866334, 0.49308688],
+                             [- 6.27217815, -0.00082848, 0.00050782, 7.27134967, 0.99746831, 0.99866370, 0.49308691],
+                             [- 6.27217872, -0.00082826, 0.00050768, 7.27135045, 0.99746899, 0.99866406, 0.49308700],
+                             [- 6.27217928, -0.00082804, 0.00050754, 7.27135124, 0.99746967, 0.99866442, 0.49308706],
+                             [- 6.27217984, -0.00082782, 0.00050741, 7.27135202, 0.99747034, 0.99866477, 0.49308711],
+                             [- 6.27218040, -0.00082760, 0.00050727, 7.27135281, 0.99747102, 0.99866513, 0.49308731],
+                             [- 6.27218097, -0.00082738, 0.00050714, 7.27135359, 0.99747170, 0.99866549, 0.49308733],
+                             [- 6.27218153, -0.00082716, 0.00050700, 7.27135437, 0.99747237, 0.99866584, 0.49308746],
+                             [- 6.27218209, -0.00082693, 0.00050686, 7.27135515, 0.99747305, 0.99866620, 0.49308753],
+                             [- 6.27218265, -0.00082671, 0.00050673, 7.27135593, 0.99747372, 0.99866656, 0.49308759],
+                             [- 6.27218321, -0.00082649, 0.00050659, 7.27135671, 0.99747440, 0.99866691, 0.49308757],
+                             [- 6.27218377, -0.00082627, 0.00050646, 7.27135749, 0.99747507, 0.99866727, 0.49308770],
+                             [- 6.27218433, -0.00082605, 0.00050632, 7.27135827, 0.99747575, 0.99866763, 0.49308772],
+                             [- 6.27218488, -0.00082583, 0.00050619, 7.27135905, 0.99747642, 0.99866798, 0.49308784],
+                             [- 6.27218544, -0.00082561, 0.00050605, 7.27135983, 0.99747709, 0.99866834, 0.49308794],
+                             [- 6.27218600, -0.00082539, 0.00050592, 7.27136061, 0.99747777, 0.99866869, 0.49308810],
+                             [- 6.27218656, -0.00082517, 0.00050578, 7.27136139, 0.99747844, 0.99866905, 0.49308812],
+                             [- 6.27218711, -0.00082495, 0.00050565, 7.27136216, 0.99747911, 0.99866940, 0.49308821],
+                             [- 6.27218767, -0.00082473, 0.00050551, 7.27136294, 0.99747978, 0.99866976, 0.49308825],
+                             [- 6.27218823, -0.00082451, 0.00050538, 7.27136371, 0.99748046, 0.99867011, 0.49308833],
+                             [- 6.27218878, -0.00082429, 0.00050524, 7.27136449, 0.99748113, 0.99867046, 0.49308847],
+                             [- 6.27218934, -0.00082407, 0.00050511, 7.27136526, 0.99748180, 0.99867082, 0.49308860],
+                             [- 6.27218989, -0.00082385, 0.00050497, 7.27136604, 0.99748247, 0.99867117, 0.49308859],
+                             [- 6.27219045, -0.00082363, 0.00050484, 7.27136681, 0.99748314, 0.99867153, 0.49308869],
+                             [- 6.27219100, -0.00082341, 0.00050471, 7.27136759, 0.99748381, 0.99867188, 0.49308873],
+                             [- 6.27219155, -0.00082320, 0.00050457, 7.27136836, 0.99748448, 0.99867223, 0.49308878],
+                             [- 6.27219211, -0.00082298, 0.00050444, 7.27136913, 0.99748515, 0.99867259, 0.49308888],
+                             [- 6.27219266, -0.00082276, 0.00050430, 7.27136990, 0.99748582, 0.99867294, 0.49308897],
+                             [- 6.27219321, -0.00082254, 0.00050417, 7.27137067, 0.99748649, 0.99867329, 0.49308901],
+                             [- 6.27219376, -0.00082232, 0.00050403, 7.27137144, 0.99748715, 0.99867364, 0.49308913],
+                             [- 6.27219432, -0.00082210, 0.00050390, 7.27137221, 0.99748782, 0.99867400, 0.49308916],
+                             [- 6.27219487, -0.00082188, 0.00050377, 7.27137298, 0.99748849, 0.99867435, 0.49308935],
+                             [- 6.27219542, -0.00082167, 0.00050363, 7.27137375, 0.99748916, 0.99867470, 0.49308938],
+                             [- 6.27219597, -0.00082145, 0.00050350, 7.27137452, 0.99748982, 0.99867505, 0.49308944],
+                             [- 6.27219652, -0.00082123, 0.00050337, 7.27137529, 0.99749049, 0.99867540, 0.49308959],
+                             [- 6.27219707, -0.00082101, 0.00050323, 7.27137606, 0.99749116, 0.99867576, 0.49308961],
+                             [- 6.27219762, -0.00082080, 0.00050310, 7.27137682, 0.99749182, 0.99867611, 0.49308966],
+                             [- 6.27219817, -0.00082058, 0.00050296, 7.27137759, 0.99749249, 0.99867646, 0.49308979],
+                             [- 6.27219872, -0.00082036, 0.00050283, 7.27137836, 0.99749315, 0.99867681, 0.49308985],
+                             [- 6.27219926, -0.00082014, 0.00050270, 7.27137912, 0.99749382, 0.99867716, 0.49308989],
+                             [- 6.27219981, -0.00081993, 0.00050256, 7.27137989, 0.99749448, 0.99867751, 0.49309002],
+                             [- 6.27220036, -0.00081971, 0.00050243, 7.27138065, 0.99749514, 0.99867786, 0.49309006],
+                             [- 6.27220091, -0.00081949, 0.00050230, 7.27138141, 0.99749581, 0.99867821, 0.49309016],
+                             [- 6.27220145, -0.00081927, 0.00050216, 7.27138218, 0.99749647, 0.99867856, 0.49309022],
+                             [- 6.27220200, -0.00081906, 0.00050203, 7.27138294, 0.99749713, 0.99867891, 0.49309028],
+                             [- 6.27220254, -0.00081884, 0.00050190, 7.27138370, 0.99749780, 0.99867926, 0.49309037],
+                             [- 6.27220309, -0.00081862, 0.00050177, 7.27138446, 0.99749846, 0.99867961, 0.49309053],
+                             [- 6.27220363, -0.00081841, 0.00050163, 7.27138523, 0.99749912, 0.99867996, 0.49309055],
+                             [- 6.27220418, -0.00081819, 0.00050150, 7.27138599, 0.99749978, 0.99868031, 0.49309069],
+                             [- 6.27220472, -0.00081798, 0.00050137, 7.27138675, 0.99750044, 0.99868066, 0.49309070],
+                             [- 6.27220527, -0.00081776, 0.00050124, 7.27138751, 0.99750110, 0.99868100, 0.49309083],
+                             [- 6.27220581, -0.00081754, 0.00050110, 7.27138827, 0.99750176, 0.99868135, 0.49309090],
+                             [- 6.27220635, -0.00081733, 0.00050097, 7.27138902, 0.99750242, 0.99868170, 0.49309098],
+                             [- 6.27220690, -0.00081711, 0.00050084, 7.27138978, 0.99750308, 0.99868205, 0.49309101],
+                             [- 6.27220744, -0.00081690, 0.00050071, 7.27139054, 0.99750374, 0.99868240, 0.49309113],
+                             [- 6.27220798, -0.00081668, 0.00050057, 7.27139130, 0.99750440, 0.99868275, 0.49309116],
+                             [- 6.27220852, -0.00081647, 0.00050044, 7.27139205, 0.99750506, 0.99868309, 0.49309123],
+                             [- 6.27220906, -0.00081625, 0.00050031, 7.27139281, 0.99750572, 0.99868344, 0.49309142],
+                             [- 6.27220960, -0.00081604, 0.00050018, 7.27139357, 0.99750638, 0.99868379, 0.49309142],
+                             [- 6.27221014, -0.00081582, 0.00050005, 7.27139432, 0.99750703, 0.99868413, 0.49309146],
+                             [- 6.27221068, -0.00081561, 0.00049991, 7.27139508, 0.99750769, 0.99868448, 0.49309158],
+                             [- 6.27221122, -0.00081539, 0.00049978, 7.27139583, 0.99750835, 0.99868483, 0.49309166],
+                             [- 6.27221176, -0.00081518, 0.00049965, 7.27139659, 0.99750901, 0.99868517, 0.49309171],
+                             [- 6.27221230, -0.00081496, 0.00049952, 7.27139734, 0.99750966, 0.99868552, 0.49309183],
+                             [- 6.27221284, -0.00081475, 0.00049939, 7.27139809, 0.99751032, 0.99868587, 0.49309186],
+                             [- 6.27221338, -0.00081453, 0.00049926, 7.27139884, 0.99751097, 0.99868621, 0.49309196],
+                             [- 6.27221391, -0.00081432, 0.00049912, 7.27139960, 0.99751163, 0.99868656, 0.49309197],
+                             [- 6.27221445, -0.00081410, 0.00049899, 7.27140035, 0.99751228, 0.99868690, 0.49309212],
+                             [- 6.27221499, -0.00081389, 0.00049886, 7.27140110, 0.99751294, 0.99868725, 0.49309226],
+                             [- 6.27221552, -0.00081368, 0.00049873, 7.27140185, 0.99751359, 0.99868759, 0.49309233],
+                             [- 6.27221606, -0.00081346, 0.00049860, 7.27140260, 0.99751425, 0.99868794, 0.49309240],
+                             [- 6.27221660, -0.00081325, 0.00049847, 7.27140335, 0.99751490, 0.99868828, 0.49309241],
+                             [- 6.27221713, -0.00081303, 0.00049834, 7.27140410, 0.99751555, 0.99868863, 0.49309250],
+                             [- 6.27221767, -0.00081282, 0.00049821, 7.27140485, 0.99751621, 0.99868897, 0.49309252],
+                             [- 6.27221820, -0.00081261, 0.00049807, 7.27140559, 0.99751686, 0.99868932, 0.49309262],
+                             [- 6.27221874, -0.00081239, 0.00049794, 7.27140634, 0.99751751, 0.99868966, 0.49309274],
+                             [- 6.27221927, -0.00081218, 0.00049781, 7.27140709, 0.99751816, 0.99869001, 0.49309277],
+                             [- 6.27221980, -0.00081197, 0.00049768, 7.27140784, 0.99751881, 0.99869035, 0.49309287],
+                             [- 6.27222034, -0.00081176, 0.00049755, 7.27140858, 0.99751946, 0.99869069, 0.49309295],
+                             [- 6.27222087, -0.00081154, 0.00049742, 7.27140933, 0.99752012, 0.99869104, 0.49309305],
+                             [- 6.27222140, -0.00081133, 0.00049729, 7.27141007, 0.99752077, 0.99869138, 0.49309311],
+                             [- 6.27222193, -0.00081112, 0.00049716, 7.27141082, 0.99752142, 0.99869172, 0.49309317],
+                             [- 6.27222247, -0.00081090, 0.00049703, 7.27141156, 0.99752207, 0.99869207, 0.49309328],
+                             [- 6.27222300, -0.00081069, 0.00049690, 7.27141230, 0.99752271, 0.99869241, 0.49309332],
+                             [- 6.27222353, -0.00081048, 0.00049677, 7.27141305, 0.99752336, 0.99869275, 0.49309344],
+                             [- 6.27222406, -0.00081027, 0.00049664, 7.27141379, 0.99752401, 0.99869309, 0.49309341],
+                             [- 6.27222459, -0.00081006, 0.00049651, 7.27141453, 0.99752466, 0.99869344, 0.49309354],
+                             [- 6.27222512, -0.00080984, 0.00049638, 7.27141527, 0.99752531, 0.99869378, 0.49309361],
+                             [- 6.27222565, -0.00080963, 0.00049625, 7.27141602, 0.99752596, 0.99869412, 0.49309375],
+                             [- 6.27222618, -0.00080942, 0.00049612, 7.27141676, 0.99752660, 0.99869446, 0.49309380],
+                             [- 6.27222671, -0.00080921, 0.00049599, 7.27141750, 0.99752725, 0.99869480, 0.49309382],
+                             [- 6.27222723, -0.00080900, 0.00049586, 7.27141824, 0.99752790, 0.99869514, 0.49309395],
+                             [- 6.27222776, -0.00080879, 0.00049573, 7.27141898, 0.99752854, 0.99869548, 0.49309403],
+                             [- 6.27222829, -0.00080857, 0.00049560, 7.27141972, 0.99752919, 0.99869582, 0.49309409],
+                             [- 6.27222882, -0.00080836, 0.00049547, 7.27142045, 0.99752984, 0.99869617, 0.49309410],
+                             [- 6.27222934, -0.00080815, 0.00049534, 7.27142119, 0.99753048, 0.99869651, 0.49309425],
+                             [- 6.27222987, -0.00080794, 0.00049521, 7.27142193, 0.99753113, 0.99869685, 0.49309434],
+                             [- 6.27223040, -0.00080773, 0.00049508, 7.27142267, 0.99753177, 0.99869719, 0.49309443],
+                             [- 6.27223092, -0.00080752, 0.00049495, 7.27142340, 0.99753241, 0.99869753, 0.49309447],
+                             [- 6.27223145, -0.00080731, 0.00049482, 7.27142414, 0.99753306, 0.99869787, 0.49309457],
+                             [- 6.27223197, -0.00080710, 0.00049469, 7.27142488, 0.99753370, 0.99869821, 0.49309459],
+                             [- 6.27223250, -0.00080689, 0.00049457, 7.27142561, 0.99753435, 0.99869855, 0.49309463],
+                             [- 6.27223302, -0.00080668, 0.00049444, 7.27142635, 0.99753499, 0.99869888, 0.49309473],
+                             [- 6.27223355, -0.00080647, 0.00049431, 7.27142708, 0.99753563, 0.99869922, 0.49309486],
+                             [- 6.27223407, -0.00080626, 0.00049418, 7.27142781, 0.99753627, 0.99869956, 0.49309496],
+                             [- 6.27223460, -0.00080605, 0.00049405, 7.27142855, 0.99753692, 0.99869990, 0.49309501],
+                             [- 6.27223512, -0.00080584, 0.00049392, 7.27142928, 0.99753756, 0.99870024, 0.49309506],
+                             [- 6.27223564, -0.00080563, 0.00049379, 7.27143001, 0.99753820, 0.99870058, 0.49309510],
+                             [- 6.27223616, -0.00080542, 0.00049366, 7.27143074, 0.99753884, 0.99870092, 0.49309524],
+                             [- 6.27223669, -0.00080521, 0.00049354, 7.27143148, 0.99753948, 0.99870125, 0.49309538],
+                             [- 6.27223721, -0.00080500, 0.00049341, 7.27143221, 0.99754012, 0.99870159, 0.49309541],
+                             [- 6.27223773, -0.00080479, 0.00049328, 7.27143294, 0.99754076, 0.99870193, 0.49309547],
+                             [- 6.27223825, -0.00080458, 0.00049315, 7.27143367, 0.99754140, 0.99870227, 0.49309552],
+                             [- 6.27223877, -0.00080437, 0.00049302, 7.27143440, 0.99754204, 0.99870260, 0.49309562],
+                             [- 6.27223929, -0.00080416, 0.00049289, 7.27143513, 0.99754268, 0.99870294, 0.49309564],
+                             [- 6.27223981, -0.00080395, 0.00049277, 7.27143586, 0.99754332, 0.99870328, 0.49309575],
+                             [- 6.27224033, -0.00080375, 0.00049264, 7.27143658, 0.99754395, 0.99870362, 0.49309585],
+                             [- 6.27224085, -0.00080354, 0.00049251, 7.27143731, 0.99754459, 0.99870395, 0.49309591],
+                             [- 6.27224137, -0.00080333, 0.00049238, 7.27143804, 0.99754523, 0.99870429, 0.49309595],
+                             [- 6.27224189, -0.00080312, 0.00049225, 7.27143877, 0.99754587, 0.99870463, 0.49309610],
+                             [- 6.27224241, -0.00080291, 0.00049213, 7.27143949, 0.99754650, 0.99870496, 0.49309609],
+                             [- 6.27224292, -0.00080270, 0.00049200, 7.27144022, 0.99754714, 0.99870530, 0.49309625],
+                             [- 6.27224344, -0.00080250, 0.00049187, 7.27144094, 0.99754778, 0.99870563, 0.49309625],
+                             [- 6.27224396, -0.00080229, 0.00049174, 7.27144167, 0.99754841, 0.99870597, 0.49309632],
+                             [- 6.27224447, -0.00080208, 0.00049162, 7.27144239, 0.99754905, 0.99870630, 0.49309639],
+                             [- 6.27224499, -0.00080187, 0.00049149, 7.27144312, 0.99754968, 0.99870664, 0.49309648],
+                             [- 6.27224551, -0.00080166, 0.00049136, 7.27144384, 0.99755032, 0.99870697, 0.49309655],
+                             [- 6.27224602, -0.00080146, 0.00049123, 7.27144457, 0.99755095, 0.99870731, 0.49309667],
+                             [- 6.27224654, -0.00080125, 0.00049111, 7.27144529, 0.99755159, 0.99870764, 0.49309666],
+                             [- 6.27224705, -0.00080104, 0.00049098, 7.27144601, 0.99755222, 0.99870798, 0.49309679],
+                             [- 6.27224757, -0.00080084, 0.00049085, 7.27144673, 0.99755286, 0.99870831, 0.49309687],
+                             [- 6.27224808, -0.00080063, 0.00049072, 7.27144746, 0.99755349, 0.99870865, 0.49309695],
+                             [- 6.27224860, -0.00080042, 0.00049060, 7.27144818, 0.99755412, 0.99870898, 0.49309704],
+                             [- 6.27224911, -0.00080021, 0.00049047, 7.27144890, 0.99755476, 0.99870932, 0.49309706],
+                             [- 6.27224962, -0.00080001, 0.00049034, 7.27144962, 0.99755539, 0.99870965, 0.49309713],
+                             [- 6.27225014, -0.00079980, 0.00049022, 7.27145034, 0.99755602, 0.99870998, 0.49309722],
+                             [- 6.27225065, -0.00079959, 0.00049009, 7.27145106, 0.99755665, 0.99871032, 0.49309728],
+                             [- 6.27225116, -0.00079939, 0.00048996, 7.27145178, 0.99755728, 0.99871065, 0.49309738],
+                             [- 6.27225168, -0.00079918, 0.00048984, 7.27145249, 0.99755791, 0.99871098, 0.49309747],
+                             [- 6.27225219, -0.00079897, 0.00048971, 7.27145321, 0.99755854, 0.99871131, 0.49309753],
+                             [- 6.27225270, -0.00079877, 0.00048958, 7.27145393, 0.99755918, 0.99871165, 0.49309771],
+                             [- 6.27225321, -0.00079856, 0.00048946, 7.27145465, 0.99755981, 0.99871198, 0.49309765],
+                             [- 6.27225372, -0.00079836, 0.00048933, 7.27145536, 0.99756044, 0.99871231, 0.49309782],
+                             [- 6.27225423, -0.00079815, 0.00048921, 7.27145608, 0.99756106, 0.99871264, 0.49309784],
+                             [- 6.27225474, -0.00079795, 0.00048908, 7.27145680, 0.99756169, 0.99871298, 0.49309793],
+                             [- 6.27225525, -0.00079774, 0.00048895, 7.27145751, 0.99756232, 0.99871331, 0.49309799],
+                             [- 6.27225576, -0.00079753, 0.00048883, 7.27145823, 0.99756295, 0.99871364, 0.49309812],
+                             [- 6.27225627, -0.00079733, 0.00048870, 7.27145894, 0.99756358, 0.99871397, 0.49309805],
+                             [- 6.27225678, -0.00079712, 0.00048857, 7.27145966, 0.99756421, 0.99871430, 0.49309821],
+                             [- 6.27225729, -0.00079692, 0.00048845, 7.27146037, 0.99756483, 0.99871463, 0.49309831],
+                             [- 6.27225780, -0.00079671, 0.00048832, 7.27146108, 0.99756546, 0.99871496, 0.49309836],
+                             [- 6.27225830, -0.00079651, 0.00048820, 7.27146180, 0.99756609, 0.99871529, 0.49309842],
+                             [- 6.27225881, -0.00079630, 0.00048807, 7.27146251, 0.99756671, 0.99871563, 0.49309856],
+                             [- 6.27225932, -0.00079610, 0.00048795, 7.27146322, 0.99756734, 0.99871596, 0.49309861],
+                             [- 6.27225983, -0.00079589, 0.00048782, 7.27146393, 0.99756797, 0.99871629, 0.49309861],
+                             [- 6.27226033, -0.00079569, 0.00048769, 7.27146464, 0.99756859, 0.99871662, 0.49309873],
+                             [- 6.27226084, -0.00079548, 0.00048757, 7.27146535, 0.99756922, 0.99871695, 0.49309877],
+                             [- 6.27226134, -0.00079528, 0.00048744, 7.27146606, 0.99756984, 0.99871728, 0.49309886],
+                             [- 6.27226185, -0.00079508, 0.00048732, 7.27146677, 0.99757047, 0.99871761, 0.49309893],
+                             [- 6.27226235, -0.00079487, 0.00048719, 7.27146748, 0.99757109, 0.99871793, 0.49309902],
+                             [- 6.27226286, -0.00079467, 0.00048707, 7.27146819, 0.99757172, 0.99871826, 0.49309912],
+                             [- 6.27226336, -0.00079446, 0.00048694, 7.27146890, 0.99757234, 0.99871859, 0.49309921],
+                             [- 6.27226387, -0.00079426, 0.00048682, 7.27146961, 0.99757296, 0.99871892, 0.49309921],
+                             [- 6.27226437, -0.00079406, 0.00048669, 7.27147032, 0.99757359, 0.99871925, 0.49309928],
+                             [- 6.27226488, -0.00079385, 0.00048657, 7.27147102, 0.99757421, 0.99871958, 0.49309939],
+                             [- 6.27226538, -0.00079365, 0.00048644, 7.27147173, 0.99757483, 0.99871991, 0.49309945],
+                             [- 6.27226588, -0.00079345, 0.00048632, 7.27147244, 0.99757545, 0.99872024, 0.49309958],
+                             [- 6.27226639, -0.00079324, 0.00048619, 7.27147314, 0.99757607, 0.99872056, 0.49309958],
+                             [- 6.27226689, -0.00079304, 0.00048607, 7.27147385, 0.99757670, 0.99872089, 0.49309961],
+                             [- 6.27226739, -0.00079284, 0.00048594, 7.27147455, 0.99757732, 0.99872122, 0.49309967],
+                             [- 6.27226789, -0.00079263, 0.00048582, 7.27147526, 0.99757794, 0.99872155, 0.49309986],
+                             [- 6.27226839, -0.00079243, 0.00048570, 7.27147596, 0.99757856, 0.99872187, 0.49309996],
+                             [- 6.27226889, -0.00079223, 0.00048557, 7.27147667, 0.99757918, 0.99872220, 0.49309999],
+                             [- 6.27226939, -0.00079202, 0.00048545, 7.27147737, 0.99757980, 0.99872253, 0.49310010],
+                             [- 6.27226990, -0.00079182, 0.00048532, 7.27147807, 0.99758042, 0.99872286, 0.49310015],
+                             [- 6.27227040, -0.00079162, 0.00048520, 7.27147878, 0.99758104, 0.99872318, 0.49310022],
+                             [- 6.27227090, -0.00079142, 0.00048507, 7.27147948, 0.99758166, 0.99872351, 0.49310023],
+                             [- 6.27227139, -0.00079121, 0.00048495, 7.27148018, 0.99758227, 0.99872384, 0.49310029],
+                             [- 6.27227189, -0.00079101, 0.00048483, 7.27148088, 0.99758289, 0.99872416, 0.49310038],
+                             [- 6.27227239, -0.00079081, 0.00048470, 7.27148158, 0.99758351, 0.99872449, 0.49310046],
+                             [- 6.27227289, -0.00079061, 0.00048458, 7.27148228, 0.99758413, 0.99872481, 0.49310052],
+                             [- 6.27227339, -0.00079041, 0.00048445, 7.27148298, 0.99758474, 0.99872514, 0.49310058],
+                             [- 6.27227389, -0.00079020, 0.00048433, 7.27148368, 0.99758536, 0.99872546, 0.49310064],
+                             [- 6.27227439, -0.00079000, 0.00048421, 7.27148438, 0.99758598, 0.99872579, 0.49310077],
+                             [- 6.27227488, -0.00078980, 0.00048408, 7.27148508, 0.99758659, 0.99872612, 0.49310085],
+                             [- 6.27227538, -0.00078960, 0.00048396, 7.27148578, 0.99758721, 0.99872644, 0.49310092],
+                             [- 6.27227588, -0.00078940, 0.00048384, 7.27148648, 0.99758783, 0.99872677, 0.49310100],
+                             [- 6.27227637, -0.00078920, 0.00048371, 7.27148717, 0.99758844, 0.99872709, 0.49310112],
+                             [- 6.27227687, -0.00078900, 0.00048359, 7.27148787, 0.99758906, 0.99872741, 0.49310113],
+                             [- 6.27227736, -0.00078880, 0.00048347, 7.27148857, 0.99758967, 0.99872774, 0.49310122],
+                             [- 6.27227786, -0.00078859, 0.00048334, 7.27148927, 0.99759029, 0.99872806, 0.49310127],
+                             [- 6.27227836, -0.00078839, 0.00048322, 7.27148996, 0.99759090, 0.99872839, 0.49310130],
+                             [- 6.27227885, -0.00078819, 0.00048310, 7.27149066, 0.99759151, 0.99872871, 0.49310141],
+                             [- 6.27227934, -0.00078799, 0.00048297, 7.27149135, 0.99759213, 0.99872903, 0.49310152],
+                             [- 6.27227984, -0.00078779, 0.00048285, 7.27149205, 0.99759274, 0.99872936, 0.49310152],
+                             [- 6.27228033, -0.00078759, 0.00048273, 7.27149274, 0.99759335, 0.99872968, 0.49310163],
+                             [- 6.27228083, -0.00078739, 0.00048260, 7.27149344, 0.99759397, 0.99873001, 0.49310168],
+                             [- 6.27228132, -0.00078719, 0.00048248, 7.27149413, 0.99759458, 0.99873033, 0.49310178],
+                             [- 6.27228181, -0.00078699, 0.00048236, 7.27149482, 0.99759519, 0.99873065, 0.49310189],
+                             [- 6.27228231, -0.00078679, 0.00048224, 7.27149552, 0.99759580, 0.99873097, 0.49310191],
+                             [- 6.27228280, -0.00078659, 0.00048211, 7.27149621, 0.99759641, 0.99873130, 0.49310203],
+                             [- 6.27228329, -0.00078639, 0.00048199, 7.27149690, 0.99759702, 0.99873162, 0.49310202],
+                             [- 6.27228378, -0.00078619, 0.00048187, 7.27149759, 0.99759763, 0.99873194, 0.49310216],
+                             [- 6.27228427, -0.00078599, 0.00048175, 7.27149828, 0.99759825, 0.99873226, 0.49310220],
+                             [- 6.27228476, -0.00078579, 0.00048162, 7.27149897, 0.99759886, 0.99873259, 0.49310228],
+                             [- 6.27228526, -0.00078559, 0.00048150, 7.27149966, 0.99759946, 0.99873291, 0.49310231],
+                             [- 6.27228575, -0.00078539, 0.00048138, 7.27150035, 0.99760007, 0.99873323, 0.49310245],
+                             [- 6.27228624, -0.00078519, 0.00048126, 7.27150104, 0.99760068, 0.99873355, 0.49310250],
+                             [- 6.27228673, -0.00078500, 0.00048113, 7.27150173, 0.99760129, 0.99873387, 0.49310256],
+                             [- 6.27228722, -0.00078480, 0.00048101, 7.27150242, 0.99760190, 0.99873419, 0.49310269],
+                             [- 6.27228771, -0.00078460, 0.00048089, 7.27150311, 0.99760251, 0.99873451, 0.49310278],
+                             [- 6.27228819, -0.00078440, 0.00048077, 7.27150380, 0.99760312, 0.99873483, 0.49310277],
+                             [- 6.27228868, -0.00078420, 0.00048065, 7.27150448, 0.99760372, 0.99873515, 0.49310291],
+                             [- 6.27228917, -0.00078400, 0.00048052, 7.27150517, 0.99760433, 0.99873548, 0.49310291],
+                             [- 6.27228966, -0.00078380, 0.00048040, 7.27150586, 0.99760494, 0.99873580, 0.49310301],
+                             [- 6.27229015, -0.00078360, 0.00048028, 7.27150654, 0.99760555, 0.99873612, 0.49310307],
+                             [- 6.27229064, -0.00078341, 0.00048016, 7.27150723, 0.99760615, 0.99873644, 0.49310321],
+                             [- 6.27229112, -0.00078321, 0.00048004, 7.27150792, 0.99760676, 0.99873676, 0.49310322],
+                             [- 6.27229161, -0.00078301, 0.00047992, 7.27150860, 0.99760736, 0.99873707, 0.49310330],
+                             [- 6.27229210, -0.00078281, 0.00047979, 7.27150929, 0.99760797, 0.99873739, 0.49310330],
+                             [- 6.27229258, -0.00078261, 0.00047967, 7.27150997, 0.99760857, 0.99873771, 0.49310340],
+                             [- 6.27229307, -0.00078242, 0.00047955, 7.27151065, 0.99760918, 0.99873803, 0.49310344],
+                             [- 6.27229356, -0.00078222, 0.00047943, 7.27151134, 0.99760978, 0.99873835, 0.49310362],
+                             [- 6.27229404, -0.00078202, 0.00047931, 7.27151202, 0.99761039, 0.99873867, 0.49310362],
+                             [- 6.27229453, -0.00078182, 0.00047919, 7.27151270, 0.99761099, 0.99873899, 0.49310369],
+                             [- 6.27229501, -0.00078163, 0.00047907, 7.27151339, 0.99761160, 0.99873931, 0.49310382],
+                             [- 6.27229550, -0.00078143, 0.00047895, 7.27151407, 0.99761220, 0.99873963, 0.49310378],
+                             [- 6.27229598, -0.00078123, 0.00047882, 7.27151475, 0.99761280, 0.99873994, 0.49310395],
+                             [- 6.27229646, -0.00078103, 0.00047870, 7.27151543, 0.99761340, 0.99874026, 0.49310398],
+                             [- 6.27229695, -0.00078084, 0.00047858, 7.27151611, 0.99761401, 0.99874058, 0.49310409],
+                             [- 6.27229743, -0.00078064, 0.00047846, 7.27151679, 0.99761461, 0.99874090, 0.49310410],
+                             [- 6.27229791, -0.00078044, 0.00047834, 7.27151747, 0.99761521, 0.99874122, 0.49310419],
+                             [- 6.27229840, -0.00078025, 0.00047822, 7.27151815, 0.99761581, 0.99874153, 0.49310426],
+                             [- 6.27229888, -0.00078005, 0.00047810, 7.27151883, 0.99761641, 0.99874185, 0.49310431],
+                             [- 6.27229936, -0.00077985, 0.00047798, 7.27151951, 0.99761701, 0.99874217, 0.49310439],
+                             [- 6.27229984, -0.00077966, 0.00047786, 7.27152019, 0.99761762, 0.99874248, 0.49310456],
+                             [- 6.27230033, -0.00077946, 0.00047774, 7.27152087, 0.99761822, 0.99874280, 0.49310453],
+                             [- 6.27230081, -0.00077926, 0.00047762, 7.27152154, 0.99761882, 0.99874312, 0.49310456],
+                             [- 6.27230129, -0.00077907, 0.00047750, 7.27152222, 0.99761942, 0.99874343, 0.49310472],
+                             [- 6.27230177, -0.00077887, 0.00047738, 7.27152290, 0.99762001, 0.99874375, 0.49310478],
+                             [- 6.27230225, -0.00077868, 0.00047726, 7.27152357, 0.99762061, 0.99874407, 0.49310482],
+                             [- 6.27230273, -0.00077848, 0.00047714, 7.27152425, 0.99762121, 0.99874438, 0.49310485],
+                             [- 6.27230321, -0.00077828, 0.00047702, 7.27152493, 0.99762181, 0.99874470, 0.49310496],
+                             [- 6.27230369, -0.00077809, 0.00047690, 7.27152560, 0.99762241, 0.99874501, 0.49310508],
+                             [- 6.27230417, -0.00077789, 0.00047678, 7.27152628, 0.99762301, 0.99874533, 0.49310514],
+                             [- 6.27230465, -0.00077770, 0.00047666, 7.27152695, 0.99762360, 0.99874564, 0.49310512],
+                             [- 6.27230513, -0.00077750, 0.00047654, 7.27152763, 0.99762420, 0.99874596, 0.49310522],
+                             [- 6.27230561, -0.00077731, 0.00047642, 7.27152830, 0.99762480, 0.99874627, 0.49310530],
+                             [- 6.27230609, -0.00077711, 0.00047630, 7.27152897, 0.99762540, 0.99874659, 0.49310543],
+                             [- 6.27230656, -0.00077692, 0.00047618, 7.27152965, 0.99762599, 0.99874690, 0.49310543],
+                             [- 6.27230704, -0.00077672, 0.00047606, 7.27153032, 0.99762659, 0.99874722, 0.49310556],
+                             [- 6.27230752, -0.00077653, 0.00047594, 7.27153099, 0.99762718, 0.99874753, 0.49310555],
+                             [- 6.27230800, -0.00077633, 0.00047582, 7.27153166, 0.99762778, 0.99874785, 0.49310570],
+                             [- 6.27230847, -0.00077614, 0.00047570, 7.27153233, 0.99762837, 0.99874816, 0.49310570],
+                             [- 6.27230895, -0.00077594, 0.00047558, 7.27153301, 0.99762897, 0.99874848, 0.49310582],
+                             [- 6.27230943, -0.00077575, 0.00047546, 7.27153368, 0.99762956, 0.99874879, 0.49310585],
+                             [- 6.27230990, -0.00077556, 0.00047534, 7.27153435, 0.99763016, 0.99874910, 0.49310599],
+                             [- 6.27231038, -0.00077536, 0.00047522, 7.27153502, 0.99763075, 0.99874942, 0.49310605],
+                             [- 6.27231085, -0.00077517, 0.00047510, 7.27153569, 0.99763135, 0.99874973, 0.49310608],
+                             [- 6.27231133, -0.00077497, 0.00047498, 7.27153636, 0.99763194, 0.99875004, 0.49310612],
+                             [- 6.27231180, -0.00077478, 0.00047487, 7.27153702, 0.99763253, 0.99875036, 0.49310624],
+                             [- 6.27231228, -0.00077458, 0.00047475, 7.27153769, 0.99763312, 0.99875067, 0.49310622],
+                             [- 6.27231275, -0.00077439, 0.00047463, 7.27153836, 0.99763372, 0.99875098, 0.49310639],
+                             [- 6.27231323, -0.00077420, 0.00047451, 7.27153903, 0.99763431, 0.99875129, 0.49310643],
+                             [- 6.27231370, -0.00077400, 0.00047439, 7.27153970, 0.99763490, 0.99875161, 0.49310644],
+                             [- 6.27231417, -0.00077381, 0.00047427, 7.27154036, 0.99763549, 0.99875192, 0.49310654],
+                             [- 6.27231465, -0.00077362, 0.00047415, 7.27154103, 0.99763608, 0.99875223, 0.49310665],
+                             [- 6.27231512, -0.00077342, 0.00047403, 7.27154170, 0.99763668, 0.99875254, 0.49310674],
+                             [- 6.27231559, -0.00077323, 0.00047392, 7.27154236, 0.99763727, 0.99875285, 0.49310670],
+                             [- 6.27231607, -0.00077304, 0.00047380, 7.27154303, 0.99763786, 0.99875317, 0.49310684],
+                             [- 6.27231654, -0.00077284, 0.00047368, 7.27154369, 0.99763845, 0.99875348, 0.49310692],
+                             [- 6.27231701, -0.00077265, 0.00047356, 7.27154436, 0.99763904, 0.99875379, 0.49310699],
+                             [- 6.27231748, -0.00077246, 0.00047344, 7.27154502, 0.99763963, 0.99875410, 0.49310700],
+                             [- 6.27231795, -0.00077227, 0.00047332, 7.27154569, 0.99764021, 0.99875441, 0.49310703],
+                             [- 6.27231842, -0.00077207, 0.00047321, 7.27154635, 0.99764080, 0.99875472, 0.49310722],
+                             [- 6.27231889, -0.00077188, 0.00047309, 7.27154701, 0.99764139, 0.99875503, 0.49310725],
+                             [- 6.27231936, -0.00077169, 0.00047297, 7.27154768, 0.99764198, 0.99875534, 0.49310729],
+                             [- 6.27231984, -0.00077150, 0.00047285, 7.27154834, 0.99764257, 0.99875565, 0.49310745],
+                             [- 6.27232031, -0.00077130, 0.00047273, 7.27154900, 0.99764316, 0.99875596, 0.49310751],
+                             [- 6.27232077, -0.00077111, 0.00047262, 7.27154966, 0.99764374, 0.99875627, 0.49310749],
+                             [- 6.27232124, -0.00077092, 0.00047250, 7.27155032, 0.99764433, 0.99875658, 0.49310765],
+                             [- 6.27232171, -0.00077073, 0.00047238, 7.27155099, 0.99764492, 0.99875689, 0.49310767],
+                             [- 6.27232218, -0.00077054, 0.00047226, 7.27155165, 0.99764550, 0.99875720, 0.49310775],
+                             [- 6.27232265, -0.00077034, 0.00047215, 7.27155231, 0.99764609, 0.99875751, 0.49310781],
+                             [- 6.27232312, -0.00077015, 0.00047203, 7.27155297, 0.99764668, 0.99875782, 0.49310787],
+                             [- 6.27232359, -0.00076996, 0.00047191, 7.27155363, 0.99764726, 0.99875813, 0.49310796],
+                             [- 6.27232406, -0.00076977, 0.00047179, 7.27155429, 0.99764785, 0.99875844, 0.49310787],
+                             [- 6.27232452, -0.00076958, 0.00047168, 7.27155494, 0.99764843, 0.99875875, 0.49310807],
+                             [- 6.27232499, -0.00076939, 0.00047156, 7.27155560, 0.99764902, 0.99875906, 0.49310819],
+                             [- 6.27232546, -0.00076920, 0.00047144, 7.27155626, 0.99764960, 0.99875936, 0.49310824],
+                             [- 6.27232592, -0.00076900, 0.00047132, 7.27155692, 0.99765019, 0.99875967, 0.49310831],
+                             [- 6.27232639, -0.00076881, 0.00047121, 7.27155758, 0.99765077, 0.99875998, 0.49310826],
+                             [- 6.27232686, -0.00076862, 0.00047109, 7.27155823, 0.99765135, 0.99876029, 0.49310841],
+                             [- 6.27232732, -0.00076843, 0.00047097, 7.27155889, 0.99765194, 0.99876060, 0.49310851],
+                             [- 6.27232779, -0.00076824, 0.00047086, 7.27155955, 0.99765252, 0.99876090, 0.49310855],
+                             [- 6.27232825, -0.00076805, 0.00047074, 7.27156020, 0.99765310, 0.99876121, 0.49310862],
+                             [- 6.27232872, -0.00076786, 0.00047062, 7.27156086, 0.99765369, 0.99876152, 0.49310868],
+                             [- 6.27232918, -0.00076767, 0.00047050, 7.27156151, 0.99765427, 0.99876183, 0.49310870],
+                             [- 6.27232965, -0.00076748, 0.00047039, 7.27156217, 0.99765485, 0.99876213, 0.49310885],
+                             [- 6.27233011, -0.00076729, 0.00047027, 7.27156282, 0.99765543, 0.99876244, 0.49310881],
+                             [- 6.27233058, -0.00076710, 0.00047015, 7.27156348, 0.99765601, 0.99876275, 0.49310901],
+                             [- 6.27233104, -0.00076691, 0.00047004, 7.27156413, 0.99765660, 0.99876305, 0.49310905],
+                             [- 6.27233150, -0.00076672, 0.00046992, 7.27156478, 0.99765718, 0.99876336, 0.49310906],
+                             [- 6.27233197, -0.00076653, 0.00046981, 7.27156544, 0.99765776, 0.99876367, 0.49310915],
+                             [- 6.27233243, -0.00076634, 0.00046969, 7.27156609, 0.99765834, 0.99876397, 0.49310926],
+                             [- 6.27233289, -0.00076615, 0.00046957, 7.27156674, 0.99765892, 0.99876428, 0.49310922],
+                             [- 6.27233336, -0.00076596, 0.00046946, 7.27156740, 0.99765950, 0.99876458, 0.49310945],
+                             [- 6.27233382, -0.00076577, 0.00046934, 7.27156805, 0.99766008, 0.99876489, 0.49310949],
+                             [- 6.27233428, -0.00076558, 0.00046922, 7.27156870, 0.99766065, 0.99876520, 0.49310955],
+                             [- 6.27233474, -0.00076539, 0.00046911, 7.27156935, 0.99766123, 0.99876550, 0.49310960],
+                             [- 6.27233520, -0.00076520, 0.00046899, 7.27157000, 0.99766181, 0.99876581, 0.49310966],
+                             [- 6.27233566, -0.00076501, 0.00046888, 7.27157065, 0.99766239, 0.99876611, 0.49310976],
+                             [- 6.27233612, -0.00076482, 0.00046876, 7.27157130, 0.99766297, 0.99876642, 0.49310982],
+                             [- 6.27233658, -0.00076464, 0.00046864, 7.27157195, 0.99766355, 0.99876672, 0.49310988],
+                             [- 6.27233705, -0.00076445, 0.00046853, 7.27157260, 0.99766412, 0.99876703, 0.49310995],
+                             [- 6.27233751, -0.00076426, 0.00046841, 7.27157325, 0.99766470, 0.99876733, 0.49310998],
+                             [- 6.27233797, -0.00076407, 0.00046830, 7.27157390, 0.99766528, 0.99876763, 0.49311004],
+                             [- 6.27233843, -0.00076388, 0.00046818, 7.27157454, 0.99766585, 0.99876794, 0.49311017],
+                             [- 6.27233888, -0.00076369, 0.00046806, 7.27157519, 0.99766643, 0.99876824, 0.49311019],
+                             [- 6.27233934, -0.00076350, 0.00046795, 7.27157584, 0.99766701, 0.99876855, 0.49311023],
+                             [- 6.27233980, -0.00076332, 0.00046783, 7.27157649, 0.99766758, 0.99876885, 0.49311028],
+                             [- 6.27234026, -0.00076313, 0.00046772, 7.27157713, 0.99766816, 0.99876915, 0.49311042],
+                             [- 6.27234072, -0.00076294, 0.00046760, 7.27157778, 0.99766873, 0.99876946, 0.49311047],
+                             [- 6.27234118, -0.00076275, 0.00046749, 7.27157843, 0.99766931, 0.99876976, 0.49311045],
+                             [- 6.27234163, -0.00076256, 0.00046737, 7.27157907, 0.99766988, 0.99877006, 0.49311061],
+                             [- 6.27234209, -0.00076238, 0.00046726, 7.27157972, 0.99767046, 0.99877037, 0.49311059],
+                             [- 6.27234255, -0.00076219, 0.00046714, 7.27158036, 0.99767103, 0.99877067, 0.49311072],
+                             [- 6.27234301, -0.00076200, 0.00046703, 7.27158101, 0.99767160, 0.99877097, 0.49311081],
+                             [- 6.27234346, -0.00076181, 0.00046691, 7.27158165, 0.99767218, 0.99877128, 0.49311088],
+                             [- 6.27234392, -0.00076163, 0.00046680, 7.27158229, 0.99767275, 0.99877158, 0.49311099],
+                             [- 6.27234438, -0.00076144, 0.00046668, 7.27158294, 0.99767332, 0.99877188, 0.49311100],
+                             [- 6.27234483, -0.00076125, 0.00046657, 7.27158358, 0.99767389, 0.99877218, 0.49311108],
+                             [- 6.27234529, -0.00076106, 0.00046645, 7.27158422, 0.99767447, 0.99877248, 0.49311114],
+                             [- 6.27234574, -0.00076088, 0.00046634, 7.27158487, 0.99767504, 0.99877279, 0.49311126],
+                             [- 6.27234620, -0.00076069, 0.00046622, 7.27158551, 0.99767561, 0.99877309, 0.49311118],
+                             [- 6.27234665, -0.00076050, 0.00046611, 7.27158615, 0.99767618, 0.99877339, 0.49311132],
+                             [- 6.27234711, -0.00076032, 0.00046599, 7.27158679, 0.99767675, 0.99877369, 0.49311134],
+                             [- 6.27234756, -0.00076013, 0.00046588, 7.27158743, 0.99767732, 0.99877399, 0.49311138],
+                             [- 6.27234802, -0.00075994, 0.00046576, 7.27158807, 0.99767789, 0.99877429, 0.49311158],
+                             [- 6.27234847, -0.00075976, 0.00046565, 7.27158872, 0.99767846, 0.99877459, 0.49311152],
+                             [- 6.27234892, -0.00075957, 0.00046554, 7.27158935, 0.99767903, 0.99877489, 0.49311170],
+                             [- 6.27234938, -0.00075938, 0.00046542, 7.27158999, 0.99767960, 0.99877519, 0.49311176],
+                             [- 6.27234983, -0.00075920, 0.00046531, 7.27159063, 0.99768017, 0.99877550, 0.49311184],
+                             [- 6.27235028, -0.00075901, 0.00046519, 7.27159127, 0.99768074, 0.99877580, 0.49311180],
+                             [- 6.27235074, -0.00075882, 0.00046508, 7.27159191, 0.99768131, 0.99877610, 0.49311187],
+                             [- 6.27235119, -0.00075864, 0.00046496, 7.27159255, 0.99768188, 0.99877640, 0.49311206],
+                             [- 6.27235164, -0.00075845, 0.00046485, 7.27159319, 0.99768245, 0.99877670, 0.49311212],
+                             [- 6.27235209, -0.00075827, 0.00046474, 7.27159383, 0.99768302, 0.99877700, 0.49311212],
+                             [- 6.27235255, -0.00075808, 0.00046462, 7.27159446, 0.99768358, 0.99877730, 0.49311214],
+                             [- 6.27235300, -0.00075790, 0.00046451, 7.27159510, 0.99768415, 0.99877759, 0.49311223],
+                             [- 6.27235345, -0.00075771, 0.00046440, 7.27159574, 0.99768472, 0.99877789, 0.49311231],
+                             [- 6.27235390, -0.00075753, 0.00046428, 7.27159637, 0.99768529, 0.99877819, 0.49311242],
+                             [- 6.27235435, -0.00075734, 0.00046417, 7.27159701, 0.99768585, 0.99877849, 0.49311242],
+                             [- 6.27235480, -0.00075715, 0.00046405, 7.27159765, 0.99768642, 0.99877879, 0.49311257],
+                             [- 6.27235525, -0.00075697, 0.00046394, 7.27159828, 0.99768699, 0.99877909, 0.49311263],
+                             [- 6.27235570, -0.00075678, 0.00046383, 7.27159892, 0.99768755, 0.99877939, 0.49311265],
+                             [- 6.27235615, -0.00075660, 0.00046371, 7.27159955, 0.99768812, 0.99877969, 0.49311271],
+                             [- 6.27235660, -0.00075641, 0.00046360, 7.27160019, 0.99768868, 0.99877999, 0.49311273],
+                             [- 6.27235705, -0.00075623, 0.00046349, 7.27160082, 0.99768925, 0.99878028, 0.49311292],
+                             [- 6.27235750, -0.00075605, 0.00046337, 7.27160145, 0.99768981, 0.99878058, 0.49311290],
+                             [- 6.27235795, -0.00075586, 0.00046326, 7.27160209, 0.99769038, 0.99878088, 0.49311294],
+                             [- 6.27235840, -0.00075568, 0.00046315, 7.27160272, 0.99769094, 0.99878118, 0.49311305],
+                             [- 6.27235884, -0.00075549, 0.00046303, 7.27160335, 0.99769150, 0.99878147, 0.49311309],
+                             [- 6.27235929, -0.00075531, 0.00046292, 7.27160398, 0.99769207, 0.99878177, 0.49311327],
+                             [- 6.27235974, -0.00075512, 0.00046281, 7.27160462, 0.99769263, 0.99878207, 0.49311324],
+                             [- 6.27236019, -0.00075494, 0.00046269, 7.27160525, 0.99769319, 0.99878237, 0.49311327],
+                             [- 6.27236063, -0.00075475, 0.00046258, 7.27160588, 0.99769376, 0.99878266, 0.49311333],
+                             [- 6.27236108, -0.00075457, 0.00046247, 7.27160651, 0.99769432, 0.99878296, 0.49311348],
+                             [- 6.27236153, -0.00075439, 0.00046236, 7.27160714, 0.99769488, 0.99878326, 0.49311361],
+                             [- 6.27236197, -0.00075420, 0.00046224, 7.27160777, 0.99769544, 0.99878355, 0.49311357],
+                             [- 6.27236242, -0.00075402, 0.00046213, 7.27160840, 0.99769601, 0.99878385, 0.49311362],
+                             [- 6.27236287, -0.00075384, 0.00046202, 7.27160903, 0.99769657, 0.99878415, 0.49311367],
+                             [- 6.27236331, -0.00075365, 0.00046191, 7.27160966, 0.99769713, 0.99878444, 0.49311366],
+                             [- 6.27236376, -0.00075347, 0.00046179, 7.27161029, 0.99769769, 0.99878474, 0.49311384],
+                             [- 6.27236420, -0.00075329, 0.00046168, 7.27161092, 0.99769825, 0.99878503, 0.49311393],
+                             [- 6.27236465, -0.00075310, 0.00046157, 7.27161155, 0.99769881, 0.99878533, 0.49311405],
+                             [- 6.27236509, -0.00075292, 0.00046146, 7.27161217, 0.99769937, 0.99878563, 0.49311410],
+                             [- 6.27236554, -0.00075274, 0.00046134, 7.27161280, 0.99769993, 0.99878592, 0.49311401],
+                             [- 6.27236598, -0.00075255, 0.00046123, 7.27161343, 0.99770049, 0.99878622, 0.49311424],
+                             [- 6.27236643, -0.00075237, 0.00046112, 7.27161406, 0.99770105, 0.99878651, 0.49311425],
+                             [- 6.27236687, -0.00075219, 0.00046101, 7.27161468, 0.99770161, 0.99878681, 0.49311423],
+                             [- 6.27236731, -0.00075200, 0.00046089, 7.27161531, 0.99770217, 0.99878710, 0.49311442],
+                             [- 6.27236776, -0.00075182, 0.00046078, 7.27161594, 0.99770272, 0.99878740, 0.49311431],
+                             [- 6.27236820, -0.00075164, 0.00046067, 7.27161656, 0.99770328, 0.99878769, 0.49311449],
+                             [- 6.27236864, -0.00075146, 0.00046056, 7.27161719, 0.99770384, 0.99878798, 0.49311451],
+                             [- 6.27236909, -0.00075127, 0.00046045, 7.27161781, 0.99770440, 0.99878828, 0.49311462],
+                             [- 6.27236953, -0.00075109, 0.00046034, 7.27161844, 0.99770496, 0.99878857, 0.49311465],
+                             [- 6.27236997, -0.00075091, 0.00046022, 7.27161906, 0.99770551, 0.99878887, 0.49311479],
+                             [- 6.27237041, -0.00075073, 0.00046011, 7.27161968, 0.99770607, 0.99878916, 0.49311488],
+                             [- 6.27237085, -0.00075055, 0.00046000, 7.27162031, 0.99770663, 0.99878945, 0.49311489],
+                             [- 6.27237130, -0.00075036, 0.00045989, 7.27162093, 0.99770718, 0.99878975, 0.49311496],
+                             [- 6.27237174, -0.00075018, 0.00045978, 7.27162155, 0.99770774, 0.99879004, 0.49311494],
+                             [- 6.27237218, -0.00075000, 0.00045967, 7.27162218, 0.99770829, 0.99879033, 0.49311510],
+                             [- 6.27237262, -0.00074982, 0.00045955, 7.27162280, 0.99770885, 0.99879063, 0.49311504],
+                             [- 6.27237306, -0.00074964, 0.00045944, 7.27162342, 0.99770941, 0.99879092, 0.49311523],
+                             [- 6.27237350, -0.00074946, 0.00045933, 7.27162404, 0.99770996, 0.99879121, 0.49311526],
+                             [- 6.27237394, -0.00074927, 0.00045922, 7.27162466, 0.99771051, 0.99879151, 0.49311531],
+                             [- 6.27237438, -0.00074909, 0.00045911, 7.27162529, 0.99771107, 0.99879180, 0.49311549],
+                             [- 6.27237482, -0.00074891, 0.00045900, 7.27162591, 0.99771162, 0.99879209, 0.49311546],
+                             [- 6.27237526, -0.00074873, 0.00045889, 7.27162653, 0.99771218, 0.99879238, 0.49311554],
+                             [- 6.27237570, -0.00074855, 0.00045878, 7.27162715, 0.99771273, 0.99879268, 0.49311557],
+                             [- 6.27237614, -0.00074837, 0.00045866, 7.27162777, 0.99771328, 0.99879297, 0.49311573],
+                             [- 6.27237657, -0.00074819, 0.00045855, 7.27162839, 0.99771384, 0.99879326, 0.49311571],
+                             [- 6.27237701, -0.00074801, 0.00045844, 7.27162901, 0.99771439, 0.99879355, 0.49311580],
+                             [- 6.27237745, -0.00074783, 0.00045833, 7.27162962, 0.99771494, 0.99879384, 0.49311585],
+                             [- 6.27237789, -0.00074765, 0.00045822, 7.27163024, 0.99771549, 0.99879413, 0.49311592],
+                             [- 6.27237833, -0.00074747, 0.00045811, 7.27163086, 0.99771605, 0.99879442, 0.49311607],
+                             [- 6.27237876, -0.00074728, 0.00045800, 7.27163148, 0.99771660, 0.99879472, 0.49311608],
+                             [- 6.27237920, -0.00074710, 0.00045789, 7.27163210, 0.99771715, 0.99879501, 0.49311612],
+                             [- 6.27237964, -0.00074692, 0.00045778, 7.27163271, 0.99771770, 0.99879530, 0.49311622],
+                             [- 6.27238007, -0.00074674, 0.00045767, 7.27163333, 0.99771825, 0.99879559, 0.49311623],
+                             [- 6.27238051, -0.00074656, 0.00045756, 7.27163395, 0.99771880, 0.99879588, 0.49311629],
+                             [- 6.27238095, -0.00074638, 0.00045745, 7.27163456, 0.99771935, 0.99879617, 0.49311629],
+                             [- 6.27238138, -0.00074620, 0.00045734, 7.27163518, 0.99771990, 0.99879646, 0.49311644],
+                             [- 6.27238182, -0.00074602, 0.00045723, 7.27163580, 0.99772045, 0.99879675, 0.49311641],
+                             [- 6.27238225, -0.00074584, 0.00045712, 7.27163641, 0.99772100, 0.99879704, 0.49311653],
+                             [- 6.27238269, -0.00074566, 0.00045701, 7.27163703, 0.99772155, 0.99879733, 0.49311671],
+                             [- 6.27238312, -0.00074548, 0.00045690, 7.27163764, 0.99772210, 0.99879762, 0.49311673],
+                             [- 6.27238356, -0.00074531, 0.00045679, 7.27163825, 0.99772265, 0.99879791, 0.49311683],
+                             [- 6.27238399, -0.00074513, 0.00045668, 7.27163887, 0.99772320, 0.99879820, 0.49311676],
+                             [- 6.27238443, -0.00074495, 0.00045657, 7.27163948, 0.99772375, 0.99879849, 0.49311684],
+                             [- 6.27238486, -0.00074477, 0.00045646, 7.27164010, 0.99772429, 0.99879878, 0.49311690],
+                             [- 6.27238530, -0.00074459, 0.00045635, 7.27164071, 0.99772484, 0.99879907, 0.49311703],
+                             [- 6.27238573, -0.00074441, 0.00045624, 7.27164132, 0.99772539, 0.99879936, 0.49311710],
+                             [- 6.27238616, -0.00074423, 0.00045613, 7.27164193, 0.99772594, 0.99879964, 0.49311708],
+                             [- 6.27238660, -0.00074405, 0.00045602, 7.27164255, 0.99772648, 0.99879993, 0.49311725],
+                             [- 6.27238703, -0.00074387, 0.00045591, 7.27164316, 0.99772703, 0.99880022, 0.49311732],
+                             [- 6.27238746, -0.00074369, 0.00045580, 7.27164377, 0.99772758, 0.99880051, 0.49311738],
+                             [- 6.27238790, -0.00074352, 0.00045569, 7.27164438, 0.99772812, 0.99880080, 0.49311739],
+                             [- 6.27238833, -0.00074334, 0.00045558, 7.27164499, 0.99772867, 0.99880109, 0.49311746],
+                             [- 6.27238876, -0.00074316, 0.00045547, 7.27164560, 0.99772921, 0.99880137, 0.49311752],
+                             [- 6.27238919, -0.00074298, 0.00045536, 7.27164621, 0.99772976, 0.99880166, 0.49311758],
+                             [- 6.27238962, -0.00074280, 0.00045525, 7.27164682, 0.99773030, 0.99880195, 0.49311766],
+                             [- 6.27239006, -0.00074262, 0.00045514, 7.27164743, 0.99773085, 0.99880224, 0.49311772],
+                             [- 6.27239049, -0.00074245, 0.00045503, 7.27164804, 0.99773139, 0.99880252, 0.49311777],
+                             [- 6.27239092, -0.00074227, 0.00045492, 7.27164865, 0.99773194, 0.99880281, 0.49311785],
+                             [- 6.27239135, -0.00074209, 0.00045481, 7.27164926, 0.99773248, 0.99880310, 0.49311791],
+                             [- 6.27239178, -0.00074191, 0.00045470, 7.27164987, 0.99773303, 0.99880339, 0.49311797],
+                             [- 6.27239221, -0.00074173, 0.00045459, 7.27165048, 0.99773357, 0.99880367, 0.49311806],
+                             [- 6.27239264, -0.00074156, 0.00045449, 7.27165108, 0.99773411, 0.99880396, 0.49311809],
+                             [- 6.27239307, -0.00074138, 0.00045438, 7.27165169, 0.99773466, 0.99880425, 0.49311816],
+                             [- 6.27239350, -0.00074120, 0.00045427, 7.27165230, 0.99773520, 0.99880453, 0.49311824],
+                             [- 6.27239393, -0.00074102, 0.00045416, 7.27165291, 0.99773574, 0.99880482, 0.49311829],
+                             [- 6.27239436, -0.00074085, 0.00045405, 7.27165351, 0.99773628, 0.99880510, 0.49311835],
+                             [- 6.27239479, -0.00074067, 0.00045394, 7.27165412, 0.99773683, 0.99880539, 0.49311839],
+                             [- 6.27239522, -0.00074049, 0.00045383, 7.27165472, 0.99773737, 0.99880568, 0.49311849],
+                             [- 6.27239564, -0.00074031, 0.00045372, 7.27165533, 0.99773791, 0.99880596, 0.49311853],
+                             [- 6.27239607, -0.00074014, 0.00045362, 7.27165593, 0.99773845, 0.99880625, 0.49311862],
+                             [- 6.27239650, -0.00073996, 0.00045351, 7.27165654, 0.99773899, 0.99880653, 0.49311867],
+                             [- 6.27239693, -0.00073978, 0.00045340, 7.27165714, 0.99773953, 0.99880682, 0.49311873],
+                             [- 6.27239736, -0.00073961, 0.00045329, 7.27165775, 0.99774007, 0.99880710, 0.49311878],
+                             [- 6.27239778, -0.00073943, 0.00045318, 7.27165835, 0.99774061, 0.99880739, 0.49311885],
+                             [- 6.27239821, -0.00073925, 0.00045307, 7.27165896, 0.99774115, 0.99880767, 0.49311891],
+                             [- 6.27239864, -0.00073908, 0.00045296, 7.27165956, 0.99774169, 0.99880796, 0.49311897],
+                             [- 6.27239906, -0.00073890, 0.00045286, 7.27166016, 0.99774223, 0.99880824, 0.49311905],
+                             [- 6.27239949, -0.00073872, 0.00045275, 7.27166077, 0.99774277, 0.99880853, 0.49311912],
+                             [- 6.27239992, -0.00073855, 0.00045264, 7.27166137, 0.99774331, 0.99880881, 0.49311918],
+                             [- 6.27240034, -0.00073837, 0.00045253, 7.27166197, 0.99774385, 0.99880910, 0.49311924],
+                             [- 6.27240077, -0.00073820, 0.00045242, 7.27166257, 0.99774439, 0.99880938, 0.49311929],
+                             [- 6.27240119, -0.00073802, 0.00045232, 7.27166317, 0.99774492, 0.99880966, 0.49311935],
+                             [- 6.27240162, -0.00073784, 0.00045221, 7.27166378, 0.99774546, 0.99880995, 0.49311941],
+                             [- 6.27240205, -0.00073767, 0.00045210, 7.27166438, 0.99774600, 0.99881023, 0.49311949],
+                             [- 6.27240247, -0.00073749, 0.00045199, 7.27166498, 0.99774654, 0.99881051, 0.49311956],
+                             [- 6.27240289, -0.00073732, 0.00045188, 7.27166558, 0.99774707, 0.99881080, 0.49311961],
+                             [- 6.27240332, -0.00073714, 0.00045178, 7.27166618, 0.99774761, 0.99881108, 0.49311968],
+                             [- 6.27240374, -0.00073697, 0.00045167, 7.27166678, 0.99774815, 0.99881136, 0.49311975],
+                             [- 6.27240417, -0.00073679, 0.00045156, 7.27166738, 0.99774868, 0.99881165, 0.49311980],
+                             [- 6.27240459, -0.00073662, 0.00045145, 7.27166798, 0.99774922, 0.99881193, 0.49311987],
+                             [- 6.27240502, -0.00073644, 0.00045135, 7.27166858, 0.99774976, 0.99881221, 0.49311992],
+                             [- 6.27240544, -0.00073626, 0.00045124, 7.27166917, 0.99775029, 0.99881250, 0.49312000],
+                             [- 6.27240586, -0.00073609, 0.00045113, 7.27166977, 0.99775083, 0.99881278, 0.49312006],
+                             [- 6.27240628, -0.00073591, 0.00045102, 7.27167037, 0.99775136, 0.99881306, 0.49312011],
+                             [- 6.27240671, -0.00073574, 0.00045092, 7.27167097, 0.99775190, 0.99881334, 0.49312017],
+                             [- 6.27240713, -0.00073556, 0.00045081, 7.27167157, 0.99775243, 0.99881362, 0.49312022],
+                             [- 6.27240755, -0.00073539, 0.00045070, 7.27167216, 0.99775297, 0.99881391, 0.49312031],
+                             [- 6.27240797, -0.00073522, 0.00045060, 7.27167276, 0.99775350, 0.99881419, 0.49312033],
+                             [- 6.27240840, -0.00073504, 0.00045049, 7.27167336, 0.99775403, 0.99881447, 0.49312043],
+                             [- 6.27240882, -0.00073487, 0.00045038, 7.27167395, 0.99775457, 0.99881475, 0.49312049],
+                             [- 6.27240924, -0.00073469, 0.00045027, 7.27167455, 0.99775510, 0.99881503, 0.49312054],
+                             [- 6.27240966, -0.00073452, 0.00045017, 7.27167514, 0.99775563, 0.99881531, 0.49312061],
+                             [- 6.27241008, -0.00073434, 0.00045006, 7.27167574, 0.99775617, 0.99881560, 0.49312068],
+                             [- 6.27241050, -0.00073417, 0.00044995, 7.27167633, 0.99775670, 0.99881588, 0.49312074],
+                             [- 6.27241092, -0.00073400, 0.00044985, 7.27167693, 0.99775723, 0.99881616, 0.49312080],
+                             [- 6.27241134, -0.00073382, 0.00044974, 7.27167752, 0.99775776, 0.99881644, 0.49312087],
+                             [- 6.27241176, -0.00073365, 0.00044963, 7.27167812, 0.99775829, 0.99881672, 0.49312093],
+                             [- 6.27241218, -0.00073347, 0.00044953, 7.27167871, 0.99775883, 0.99881700, 0.49312099],
+                             [- 6.27241260, -0.00073330, 0.00044942, 7.27167930, 0.99775936, 0.99881728, 0.49312106],
+                             [- 6.27241302, -0.00073313, 0.00044931, 7.27167990, 0.99775989, 0.99881756, 0.49312110],
+                             [- 6.27241344, -0.00073295, 0.00044921, 7.27168049, 0.99776042, 0.99881784, 0.49312117],
+                             [- 6.27241386, -0.00073278, 0.00044910, 7.27168108, 0.99776095, 0.99881812, 0.49312124],
+                             [- 6.27241428, -0.00073261, 0.00044899, 7.27168167, 0.99776148, 0.99881840, 0.49312129],
+                             [- 6.27241470, -0.00073243, 0.00044889, 7.27168227, 0.99776201, 0.99881868, 0.49312137],
+                             [- 6.27241512, -0.00073226, 0.00044878, 7.27168286, 0.99776254, 0.99881896, 0.49312141],
+                             [- 6.27241554, -0.00073209, 0.00044868, 7.27168345, 0.99776307, 0.99881924, 0.49312147],
+                             [- 6.27241595, -0.00073191, 0.00044857, 7.27168404, 0.99776360, 0.99881952, 0.49312156],
+                             [- 6.27241637, -0.00073174, 0.00044846, 7.27168463, 0.99776413, 0.99881980, 0.49312161],
+                             [- 6.27241679, -0.00073157, 0.00044836, 7.27168522, 0.99776466, 0.99882008, 0.49312166],
+                             [- 6.27241721, -0.00073139, 0.00044825, 7.27168581, 0.99776518, 0.99882035, 0.49312172],
+                             [- 6.27241762, -0.00073122, 0.00044815, 7.27168640, 0.99776571, 0.99882063, 0.49312178],
+                             [- 6.27241804, -0.00073105, 0.00044804, 7.27168699, 0.99776624, 0.99882091, 0.49312185],
+                             [- 6.27241846, -0.00073088, 0.00044793, 7.27168758, 0.99776677, 0.99882119, 0.49312193],
+                             [- 6.27241887, -0.00073070, 0.00044783, 7.27168817, 0.99776730, 0.99882147, 0.49312197],
+                             [- 6.27241929, -0.00073053, 0.00044772, 7.27168876, 0.99776782, 0.99882175, 0.49312203],
+                             [- 6.27241971, -0.00073036, 0.00044762, 7.27168935, 0.99776835, 0.99882202, 0.49312211],
+                             [- 6.27242012, -0.00073019, 0.00044751, 7.27168994, 0.99776888, 0.99882230, 0.49312215],
+                             [- 6.27242054, -0.00073001, 0.00044741, 7.27169052, 0.99776940, 0.99882258, 0.49312222],
+                             [- 6.27242095, -0.00072984, 0.00044730, 7.27169111, 0.99776993, 0.99882286, 0.49312230],
+                             [- 6.27242137, -0.00072967, 0.00044719, 7.27169170, 0.99777045, 0.99882314, 0.49312233],
+                             [- 6.27242178, -0.00072950, 0.00044709, 7.27169229, 0.99777098, 0.99882341, 0.49312241],
+                             [- 6.27242220, -0.00072933, 0.00044698, 7.27169287, 0.99777151, 0.99882369, 0.49312246],
+                             [- 6.27242261, -0.00072915, 0.00044688, 7.27169346, 0.99777203, 0.99882397, 0.49312253],
+                             [- 6.27242303, -0.00072898, 0.00044677, 7.27169405, 0.99777256, 0.99882424, 0.49312260],
+                             [- 6.27242344, -0.00072881, 0.00044667, 7.27169463, 0.99777308, 0.99882452, 0.49312265],
+                             [- 6.27242386, -0.00072864, 0.00044656, 7.27169522, 0.99777361, 0.99882480, 0.49312272],
+                             [- 6.27242427, -0.00072847, 0.00044646, 7.27169580, 0.99777413, 0.99882508, 0.49312276],
+                             [- 6.27242468, -0.00072830, 0.00044635, 7.27169639, 0.99777465, 0.99882535, 0.49312285],
+                             [- 6.27242510, -0.00072813, 0.00044625, 7.27169697, 0.99777518, 0.99882563, 0.49312291],
+                             [- 6.27242551, -0.00072795, 0.00044614, 7.27169756, 0.99777570, 0.99882590, 0.49312295],
+                             [- 6.27242592, -0.00072778, 0.00044604, 7.27169814, 0.99777622, 0.99882618, 0.49312303],
+                             [- 6.27242634, -0.00072761, 0.00044593, 7.27169872, 0.99777675, 0.99882646, 0.49312307],
+                             [- 6.27242675, -0.00072744, 0.00044583, 7.27169931, 0.99777727, 0.99882673, 0.49312312],
+                             [- 6.27242716, -0.00072727, 0.00044572, 7.27169989, 0.99777779, 0.99882701, 0.49312319],
+                             [- 6.27242757, -0.00072710, 0.00044562, 7.27170047, 0.99777831, 0.99882728, 0.49312326],
+                             [- 6.27242798, -0.00072693, 0.00044551, 7.27170106, 0.99777884, 0.99882756, 0.49312335],
+                             [- 6.27242840, -0.00072676, 0.00044541, 7.27170164, 0.99777936, 0.99882783, 0.49312338],
+                             [- 6.27242881, -0.00072659, 0.00044530, 7.27170222, 0.99777988, 0.99882811, 0.49312345],
+                             [- 6.27242922, -0.00072642, 0.00044520, 7.27170280, 0.99778040, 0.99882838, 0.49312349],
+                             [- 6.27242963, -0.00072625, 0.00044509, 7.27170338, 0.99778092, 0.99882866, 0.49312358],
+                             [- 6.27243004, -0.00072608, 0.00044499, 7.27170397, 0.99778144, 0.99882893, 0.49312364],
+                             [- 6.27243045, -0.00072591, 0.00044488, 7.27170455, 0.99778196, 0.99882921, 0.49312368],
+                             [- 6.27243086, -0.00072574, 0.00044478, 7.27170513, 0.99778248, 0.99882948, 0.49312376],
+                             [- 6.27243127, -0.00072557, 0.00044468, 7.27170571, 0.99778300, 0.99882976, 0.49312381],
+                             [- 6.27243168, -0.00072540, 0.00044457, 7.27170629, 0.99778352, 0.99883003, 0.49312388],
+                             [- 6.27243209, -0.00072523, 0.00044447, 7.27170687, 0.99778404, 0.99883031, 0.49312394],
+                             [- 6.27243250, -0.00072506, 0.00044436, 7.27170745, 0.99778456, 0.99883058, 0.49312397],
+                             [- 6.27243291, -0.00072489, 0.00044426, 7.27170803, 0.99778508, 0.99883086, 0.49312405],
+                             [- 6.27243332, -0.00072472, 0.00044416, 7.27170860, 0.99778560, 0.99883113, 0.49312410],
+                             [- 6.27243373, -0.00072455, 0.00044405, 7.27170918, 0.99778612, 0.99883140, 0.49312419],
+                             [- 6.27243414, -0.00072438, 0.00044395, 7.27170976, 0.99778664, 0.99883168, 0.49312424],
+                             [- 6.27243455, -0.00072421, 0.00044384, 7.27171034, 0.99778716, 0.99883195, 0.49312429],
+                             [- 6.27243496, -0.00072404, 0.00044374, 7.27171092, 0.99778767, 0.99883222, 0.49312436],
+                             [- 6.27243536, -0.00072387, 0.00044364, 7.27171150, 0.99778819, 0.99883250, 0.49312441],
+                             [- 6.27243577, -0.00072370, 0.00044353, 7.27171207, 0.99778871, 0.99883277, 0.49312447],
+                             [- 6.27243618, -0.00072353, 0.00044343, 7.27171265, 0.99778923, 0.99883304, 0.49312454],
+                             [- 6.27243659, -0.00072336, 0.00044332, 7.27171323, 0.99778974, 0.99883331, 0.49312460],
+                             [- 6.27243700, -0.00072319, 0.00044322, 7.27171380, 0.99779026, 0.99883359, 0.49312464],
+                             [- 6.27243740, -0.00072302, 0.00044312, 7.27171438, 0.99779078, 0.99883386, 0.49312471],
+                             [- 6.27243781, -0.00072285, 0.00044301, 7.27171495, 0.99779129, 0.99883413, 0.49312476],
+                             [- 6.27243822, -0.00072269, 0.00044291, 7.27171553, 0.99779181, 0.99883440, 0.49312483],
+                             [- 6.27243862, -0.00072252, 0.00044281, 7.27171611, 0.99779232, 0.99883468, 0.49312489],
+                             [- 6.27243903, -0.00072235, 0.00044270, 7.27171668, 0.99779284, 0.99883495, 0.49312495],
+                             [- 6.27243944, -0.00072218, 0.00044260, 7.27171726, 0.99779336, 0.99883522, 0.49312500],
+                             [- 6.27243984, -0.00072201, 0.00044250, 7.27171783, 0.99779387, 0.99883549, 0.49312508],
+                             [- 6.27244025, -0.00072184, 0.00044239, 7.27171840, 0.99779438, 0.99883576, 0.49312514],
+                             [- 6.27244065, -0.00072167, 0.00044229, 7.27171898, 0.99779490, 0.99883604, 0.49312518],
+                             [- 6.27244106, -0.00072151, 0.00044219, 7.27171955, 0.99779541, 0.99883631, 0.49312525],
+                             [- 6.27244146, -0.00072134, 0.00044208, 7.27172012, 0.99779593, 0.99883658, 0.49312531],
+                             [- 6.27244187, -0.00072117, 0.00044198, 7.27172070, 0.99779644, 0.99883685, 0.49312537],
+                             [- 6.27244227, -0.00072100, 0.00044188, 7.27172127, 0.99779696, 0.99883712, 0.49312544],
+                             [- 6.27244268, -0.00072083, 0.00044177, 7.27172184, 0.99779747, 0.99883739, 0.49312550],
+                             [- 6.27244308, -0.00072067, 0.00044167, 7.27172242, 0.99779798, 0.99883766, 0.49312555],
+                             [- 6.27244349, -0.00072050, 0.00044157, 7.27172299, 0.99779849, 0.99883793, 0.49312563],
+                             [- 6.27244389, -0.00072033, 0.00044147, 7.27172356, 0.99779901, 0.99883820, 0.49312567],
+                             [- 6.27244429, -0.00072016, 0.00044136, 7.27172413, 0.99779952, 0.99883847, 0.49312573],
+                             [- 6.27244470, -0.00072000, 0.00044126, 7.27172470, 0.99780003, 0.99883874, 0.49312578],
+                             [- 6.27244510, -0.00071983, 0.00044116, 7.27172527, 0.99780054, 0.99883901, 0.49312585],
+                             [- 6.27244550, -0.00071966, 0.00044105, 7.27172584, 0.99780105, 0.99883928, 0.49312592],
+                             [- 6.27244591, -0.00071949, 0.00044095, 7.27172641, 0.99780157, 0.99883955, 0.49312598],
+                             [- 6.27244631, -0.00071933, 0.00044085, 7.27172698, 0.99780208, 0.99883982, 0.49312604],
+                             [- 6.27244671, -0.00071916, 0.00044075, 7.27172755, 0.99780259, 0.99884009, 0.49312608],
+                             [- 6.27244712, -0.00071899, 0.00044064, 7.27172812, 0.99780310, 0.99884036, 0.49312614],
+                             [- 6.27244752, -0.00071883, 0.00044054, 7.27172869, 0.99780361, 0.99884063, 0.49312622],
+                             [- 6.27244792, -0.00071866, 0.00044044, 7.27172926, 0.99780412, 0.99884090, 0.49312626],
+                             [- 6.27244832, -0.00071849, 0.00044034, 7.27172983, 0.99780463, 0.99884117, 0.49312632],
+                             [- 6.27244872, -0.00071833, 0.00044024, 7.27173040, 0.99780514, 0.99884144, 0.49312638],
+                             [- 6.27244912, -0.00071816, 0.00044013, 7.27173097, 0.99780565, 0.99884171, 0.49312645],
+                             [- 6.27244953, -0.00071799, 0.00044003, 7.27173153, 0.99780616, 0.99884198, 0.49312649],
+                             [- 6.27244993, -0.00071783, 0.00043993, 7.27173210, 0.99780667, 0.99884225, 0.49312657],
+                             [- 6.27245033, -0.00071766, 0.00043983, 7.27173267, 0.99780718, 0.99884251, 0.49312664],
+                             [- 6.27245073, -0.00071749, 0.00043972, 7.27173323, 0.99780768, 0.99884278, 0.49312669],
+                             [- 6.27245113, -0.00071733, 0.00043962, 7.27173380, 0.99780819, 0.99884305, 0.49312674],
+                             [- 6.27245153, -0.00071716, 0.00043952, 7.27173437, 0.99780870, 0.99884332, 0.49312680],
+                             [- 6.27245193, -0.00071699, 0.00043942, 7.27173493, 0.99780921, 0.99884359, 0.49312685],
+                             [- 6.27245233, -0.00071683, 0.00043932, 7.27173550, 0.99780972, 0.99884385, 0.49312691],
+                             [- 6.27245273, -0.00071666, 0.00043922, 7.27173607, 0.99781022, 0.99884412, 0.49312701],
+                             [- 6.27245313, -0.00071650, 0.00043911, 7.27173663, 0.99781073, 0.99884439, 0.49312703],
+                             [- 6.27245353, -0.00071633, 0.00043901, 7.27173720, 0.99781124, 0.99884466, 0.49312710],
+                             [- 6.27245393, -0.00071617, 0.00043891, 7.27173776, 0.99781174, 0.99884492, 0.49312716],
+                             [- 6.27245432, -0.00071600, 0.00043881, 7.27173833, 0.99781225, 0.99884519, 0.49312722],
+                             [- 6.27245472, -0.00071583, 0.00043871, 7.27173889, 0.99781276, 0.99884546, 0.49312728],
+                             [- 6.27245512, -0.00071567, 0.00043861, 7.27173945, 0.99781326, 0.99884573, 0.49312736],
+                             [- 6.27245552, -0.00071550, 0.00043850, 7.27174002, 0.99781377, 0.99884599, 0.49312741],
+                             [- 6.27245592, -0.00071534, 0.00043840, 7.27174058, 0.99781427, 0.99884626, 0.49312745],
+                             [- 6.27245632, -0.00071517, 0.00043830, 7.27174114, 0.99781478, 0.99884653, 0.49312752],
+                             [- 6.27245671, -0.00071501, 0.00043820, 7.27174171, 0.99781528, 0.99884679, 0.49312756],
+                             [- 6.27245711, -0.00071484, 0.00043810, 7.27174227, 0.99781579, 0.99884706, 0.49312763],
+                             [- 6.27245751, -0.00071468, 0.00043800, 7.27174283, 0.99781629, 0.99884733, 0.49312770],
+                             [- 6.27245791, -0.00071451, 0.00043790, 7.27174339, 0.99781680, 0.99884759, 0.49312773],
+                             [- 6.27245830, -0.00071435, 0.00043779, 7.27174396, 0.99781730, 0.99884786, 0.49312781],
+                             [- 6.27245870, -0.00071418, 0.00043769, 7.27174452, 0.99781781, 0.99884812, 0.49312788],
+                             [- 6.27245910, -0.00071402, 0.00043759, 7.27174508, 0.99781831, 0.99884839, 0.49312794],
+                             [- 6.27245949, -0.00071385, 0.00043749, 7.27174564, 0.99781881, 0.99884866, 0.49312798],
+                             [- 6.27245989, -0.00071369, 0.00043739, 7.27174620, 0.99781932, 0.99884892, 0.49312802],
+                             [- 6.27246028, -0.00071352, 0.00043729, 7.27174676, 0.99781982, 0.99884919, 0.49312810],
+                             [- 6.27246068, -0.00071336, 0.00043719, 7.27174732, 0.99782032, 0.99884945, 0.49312816],
+                             [- 6.27246108, -0.00071320, 0.00043709, 7.27174788, 0.99782083, 0.99884972, 0.49312820],
+                             [- 6.27246147, -0.00071303, 0.00043699, 7.27174844, 0.99782133, 0.99884998, 0.49312828],
+                             [- 6.27246187, -0.00071287, 0.00043689, 7.27174900, 0.99782183, 0.99885025, 0.49312834],
+                             [- 6.27246226, -0.00071270, 0.00043679, 7.27174956, 0.99782233, 0.99885051, 0.49312839],
+                             [- 6.27246266, -0.00071254, 0.00043669, 7.27175012, 0.99782283, 0.99885078, 0.49312847],
+                             [- 6.27246305, -0.00071237, 0.00043658, 7.27175068, 0.99782333, 0.99885104, 0.49312849],
+                             [- 6.27246345, -0.00071221, 0.00043648, 7.27175123, 0.99782384, 0.99885131, 0.49312857],
+                             [- 6.27246384, -0.00071205, 0.00043638, 7.27175179, 0.99782434, 0.99885157, 0.49312862],
+                             [- 6.27246423, -0.00071188, 0.00043628, 7.27175235, 0.99782484, 0.99885183, 0.49312870],
+                             [- 6.27246463, -0.00071172, 0.00043618, 7.27175291, 0.99782534, 0.99885210, 0.49312875],
+                             [- 6.27246502, -0.00071156, 0.00043608, 7.27175347, 0.99782584, 0.99885236, 0.49312878],
+                             [- 6.27246541, -0.00071139, 0.00043598, 7.27175402, 0.99782634, 0.99885263, 0.49312886],
+                             [- 6.27246581, -0.00071123, 0.00043588, 7.27175458, 0.99782684, 0.99885289, 0.49312892],
+                             [- 6.27246620, -0.00071107, 0.00043578, 7.27175514, 0.99782734, 0.99885315, 0.49312899],
+                             [- 6.27246659, -0.00071090, 0.00043568, 7.27175569, 0.99782784, 0.99885342, 0.49312906],
+                             [- 6.27246699, -0.00071074, 0.00043558, 7.27175625, 0.99782833, 0.99885368, 0.49312908],
+                             [- 6.27246738, -0.00071058, 0.00043548, 7.27175680, 0.99782883, 0.99885394, 0.49312914],
+                             [- 6.27246777, -0.00071041, 0.00043538, 7.27175736, 0.99782933, 0.99885421, 0.49312922],
+                             [- 6.27246816, -0.00071025, 0.00043528, 7.27175791, 0.99782983, 0.99885447, 0.49312926],
+                             [- 6.27246856, -0.00071009, 0.00043518, 7.27175847, 0.99783033, 0.99885473, 0.49312934],
+                             [- 6.27246895, -0.00070992, 0.00043508, 7.27175902, 0.99783083, 0.99885499, 0.49312938],
+                             [- 6.27246934, -0.00070976, 0.00043498, 7.27175958, 0.99783132, 0.99885526, 0.49312944],
+                             [- 6.27246973, -0.00070960, 0.00043488, 7.27176013, 0.99783182, 0.99885552, 0.49312948],
+                             [- 6.27247012, -0.00070944, 0.00043478, 7.27176069, 0.99783232, 0.99885578, 0.49312957],
+                             [- 6.27247051, -0.00070927, 0.00043468, 7.27176124, 0.99783282, 0.99885604, 0.49312962],
+                             [- 6.27247090, -0.00070911, 0.00043458, 7.27176179, 0.99783331, 0.99885631, 0.49312968],
+                             [- 6.27247129, -0.00070895, 0.00043448, 7.27176235, 0.99783381, 0.99885657, 0.49312972],
+                             [- 6.27247168, -0.00070879, 0.00043438, 7.27176290, 0.99783431, 0.99885683, 0.49312980],
+                             [- 6.27247207, -0.00070862, 0.00043428, 7.27176345, 0.99783480, 0.99885709, 0.49312985],
+                             [- 6.27247246, -0.00070846, 0.00043418, 7.27176400, 0.99783530, 0.99885735, 0.49312992],
+                             [- 6.27247285, -0.00070830, 0.00043409, 7.27176456, 0.99783579, 0.99885762, 0.49312999],
+                             [- 6.27247324, -0.00070814, 0.00043399, 7.27176511, 0.99783629, 0.99885788, 0.49313003],
+                             [- 6.27247363, -0.00070798, 0.00043389, 7.27176566, 0.99783678, 0.99885814, 0.49313009],
+                             [- 6.27247402, -0.00070781, 0.00043379, 7.27176621, 0.99783728, 0.99885840, 0.49313014],
+                             [- 6.27247441, -0.00070765, 0.00043369, 7.27176676, 0.99783777, 0.99885866, 0.49313021],
+                             [- 6.27247480, -0.00070749, 0.00043359, 7.27176731, 0.99783827, 0.99885892, 0.49313025],
+                             [- 6.27247519, -0.00070733, 0.00043349, 7.27176786, 0.99783876, 0.99885918, 0.49313031],
+                             [- 6.27247558, -0.00070717, 0.00043339, 7.27176841, 0.99783926, 0.99885944, 0.49313036],
+                             [- 6.27247597, -0.00070701, 0.00043329, 7.27176896, 0.99783975, 0.99885970, 0.49313043],
+                             [- 6.27247636, -0.00070684, 0.00043319, 7.27176951, 0.99784024, 0.99885996, 0.49313047],
+                             [- 6.27247674, -0.00070668, 0.00043309, 7.27177006, 0.99784074, 0.99886022, 0.49313056],
+                             [- 6.27247713, -0.00070652, 0.00043299, 7.27177061, 0.99784123, 0.99886048, 0.49313062],
+                             [- 6.27247752, -0.00070636, 0.00043290, 7.27177116, 0.99784172, 0.99886074, 0.49313067],
+                             [- 6.27247791, -0.00070620, 0.00043280, 7.27177171, 0.99784222, 0.99886100, 0.49313072],
+                             [- 6.27247829, -0.00070604, 0.00043270, 7.27177226, 0.99784271, 0.99886126, 0.49313077],
+                             [- 6.27247868, -0.00070588, 0.00043260, 7.27177280, 0.99784320, 0.99886152, 0.49313084],
+                             [- 6.27247907, -0.00070572, 0.00043250, 7.27177335, 0.99784369, 0.99886178, 0.49313089],
+                             [- 6.27247945, -0.00070556, 0.00043240, 7.27177390, 0.99784418, 0.99886204, 0.49313094],
+                             [- 6.27247984, -0.00070539, 0.00043230, 7.27177445, 0.99784468, 0.99886230, 0.49313101],
+                             [- 6.27248023, -0.00070523, 0.00043220, 7.27177499, 0.99784517, 0.99886256, 0.49313105],
+                             [- 6.27248061, -0.00070507, 0.00043211, 7.27177554, 0.99784566, 0.99886282, 0.49313111],
+                             [- 6.27248100, -0.00070491, 0.00043201, 7.27177609, 0.99784615, 0.99886308, 0.49313117],
+                             [- 6.27248139, -0.00070475, 0.00043191, 7.27177663, 0.99784664, 0.99886334, 0.49313123],
+                             [- 6.27248177, -0.00070459, 0.00043181, 7.27177718, 0.99784713, 0.99886360, 0.49313129],
+                             [- 6.27248216, -0.00070443, 0.00043171, 7.27177773, 0.99784762, 0.99886386, 0.49313133],
+                             [- 6.27248254, -0.00070427, 0.00043161, 7.27177827, 0.99784811, 0.99886411, 0.49313142],
+                             [- 6.27248293, -0.00070411, 0.00043152, 7.27177882, 0.99784860, 0.99886437, 0.49313147],
+                             [- 6.27248331, -0.00070395, 0.00043142, 7.27177936, 0.99784909, 0.99886463, 0.49313152],
+                             [- 6.27248370, -0.00070379, 0.00043132, 7.27177991, 0.99784958, 0.99886489, 0.49313157],
+                             [- 6.27248408, -0.00070363, 0.00043122, 7.27178045, 0.99785007, 0.99886515, 0.49313161],
+                             [- 6.27248447, -0.00070347, 0.00043112, 7.27178099, 0.99785056, 0.99886541, 0.49313168],
+                             [- 6.27248485, -0.00070331, 0.00043103, 7.27178154, 0.99785104, 0.99886566, 0.49313174],
+                             [- 6.27248523, -0.00070315, 0.00043093, 7.27178208, 0.99785153, 0.99886592, 0.49313183],
+                             [- 6.27248562, -0.00070299, 0.00043083, 7.27178263, 0.99785202, 0.99886618, 0.49313186],
+                             [- 6.27248600, -0.00070283, 0.00043073, 7.27178317, 0.99785251, 0.99886644, 0.49313191],
+                             [- 6.27248638, -0.00070267, 0.00043063, 7.27178371, 0.99785300, 0.99886669, 0.49313198],
+                             [- 6.27248677, -0.00070251, 0.00043054, 7.27178425, 0.99785348, 0.99886695, 0.49313204],
+                             [- 6.27248715, -0.00070235, 0.00043044, 7.27178480, 0.99785397, 0.99886721, 0.49313208],
+                             [- 6.27248753, -0.00070219, 0.00043034, 7.27178534, 0.99785446, 0.99886747, 0.49313214],
+                             [- 6.27248792, -0.00070203, 0.00043024, 7.27178588, 0.99785495, 0.99886772, 0.49313220],
+                             [- 6.27248830, -0.00070188, 0.00043014, 7.27178642, 0.99785543, 0.99886798, 0.49313224],
+                             [- 6.27248868, -0.00070172, 0.00043005, 7.27178696, 0.99785592, 0.99886824, 0.49313233],
+                             [- 6.27248906, -0.00070156, 0.00042995, 7.27178751, 0.99785641, 0.99886849, 0.49313235],
+                             [- 6.27248945, -0.00070140, 0.00042985, 7.27178805, 0.99785689, 0.99886875, 0.49313243],
+                             [- 6.27248983, -0.00070124, 0.00042975, 7.27178859, 0.99785738, 0.99886901, 0.49313250],
+                             [- 6.27249021, -0.00070108, 0.00042966, 7.27178913, 0.99785786, 0.99886926, 0.49313254],
+                             [- 6.27249059, -0.00070092, 0.00042956, 7.27178967, 0.99785835, 0.99886952, 0.49313259],
+                             [- 6.27249097, -0.00070076, 0.00042946, 7.27179021, 0.99785883, 0.99886977, 0.49313265],
+                             [- 6.27249135, -0.00070060, 0.00042937, 7.27179075, 0.99785932, 0.99887003, 0.49313270],
+                             [- 6.27249173, -0.00070045, 0.00042927, 7.27179129, 0.99785980, 0.99887029, 0.49313277],
+                             [- 6.27249211, -0.00070029, 0.00042917, 7.27179183, 0.99786029, 0.99887054, 0.49313282],
+                             [- 6.27249250, -0.00070013, 0.00042907, 7.27179237, 0.99786077, 0.99887080, 0.49313289],
+                             [- 6.27249288, -0.00069997, 0.00042898, 7.27179290, 0.99786126, 0.99887105, 0.49313291],
+                             [- 6.27249326, -0.00069981, 0.00042888, 7.27179344, 0.99786174, 0.99887131, 0.49313301],
+                             [- 6.27249364, -0.00069965, 0.00042878, 7.27179398, 0.99786222, 0.99887156, 0.49313305],
+                             [- 6.27249402, -0.00069950, 0.00042869, 7.27179452, 0.99786271, 0.99887182, 0.49313311],
+                             [- 6.27249440, -0.00069934, 0.00042859, 7.27179506, 0.99786319, 0.99887207, 0.49313316],
+                             [- 6.27249477, -0.00069918, 0.00042849, 7.27179559, 0.99786367, 0.99887233, 0.49313322],
+                             [- 6.27249515, -0.00069902, 0.00042840, 7.27179613, 0.99786415, 0.99887258, 0.49313329],
+                             [- 6.27249553, -0.00069887, 0.00042830, 7.27179667, 0.99786464, 0.99887284, 0.49313333],
+                             [- 6.27249591, -0.00069871, 0.00042820, 7.27179720, 0.99786512, 0.99887309, 0.49313340],
+                             [- 6.27249629, -0.00069855, 0.00042810, 7.27179774, 0.99786560, 0.99887335, 0.49313343],
+                             [- 6.27249667, -0.00069839, 0.00042801, 7.27179828, 0.99786608, 0.99887360, 0.49313349],
+                             [- 6.27249705, -0.00069823, 0.00042791, 7.27179881, 0.99786656, 0.99887385, 0.49313355],
+                             [- 6.27249743, -0.00069808, 0.00042781, 7.27179935, 0.99786705, 0.99887411, 0.49313361],
+                             [- 6.27249780, -0.00069792, 0.00042772, 7.27179988, 0.99786753, 0.99887436, 0.49313365],
+                             [- 6.27249818, -0.00069776, 0.00042762, 7.27180042, 0.99786801, 0.99887462, 0.49313373],
+                             [- 6.27249856, -0.00069761, 0.00042753, 7.27180095, 0.99786849, 0.99887487, 0.49313378],
+                             [- 6.27249894, -0.00069745, 0.00042743, 7.27180149, 0.99786897, 0.99887512, 0.49313382],
+                             [- 6.27249931, -0.00069729, 0.00042733, 7.27180202, 0.99786945, 0.99887538, 0.49313387],
+                             [- 6.27249969, -0.00069713, 0.00042724, 7.27180256, 0.99786993, 0.99887563, 0.49313395],
+                             [- 6.27250007, -0.00069698, 0.00042714, 7.27180309, 0.99787041, 0.99887588, 0.49313401],
+                             [- 6.27250045, -0.00069682, 0.00042704, 7.27180363, 0.99787089, 0.99887614, 0.49313405],
+                             [- 6.27250082, -0.00069666, 0.00042695, 7.27180416, 0.99787137, 0.99887639, 0.49313411],
+                             [- 6.27250120, -0.00069651, 0.00042685, 7.27180469, 0.99787185, 0.99887664, 0.49313417],
+                             [- 6.27250158, -0.00069635, 0.00042676, 7.27180523, 0.99787233, 0.99887689, 0.49313425],
+                             [- 6.27250195, -0.00069619, 0.00042666, 7.27180576, 0.99787281, 0.99887715, 0.49313428],
+                             [- 6.27250233, -0.00069604, 0.00042656, 7.27180629, 0.99787328, 0.99887740, 0.49313433],
+                             [- 6.27250270, -0.00069588, 0.00042647, 7.27180682, 0.99787376, 0.99887765, 0.49313436],
+                             [- 6.27250308, -0.00069572, 0.00042637, 7.27180736, 0.99787424, 0.99887790, 0.49313447],
+                             [- 6.27250345, -0.00069557, 0.00042628, 7.27180789, 0.99787472, 0.99887816, 0.49313453],
+                             [- 6.27250383, -0.00069541, 0.00042618, 7.27180842, 0.99787520, 0.99887841, 0.49313456],
+                             [- 6.27250420, -0.00069525, 0.00042608, 7.27180895, 0.99787567, 0.99887866, 0.49313463],
+                             [- 6.27250458, -0.00069510, 0.00042599, 7.27180948, 0.99787615, 0.99887891, 0.49313466],
+                             [- 6.27250495, -0.00069494, 0.00042589, 7.27181001, 0.99787663, 0.99887916, 0.49313471],
+                             [- 6.27250533, -0.00069479, 0.00042580, 7.27181054, 0.99787711, 0.99887942, 0.49313478],
+                             [- 6.27250570, -0.00069463, 0.00042570, 7.27181107, 0.99787758, 0.99887967, 0.49313484],
+                             [- 6.27250608, -0.00069447, 0.00042561, 7.27181160, 0.99787806, 0.99887992, 0.49313489],
+                             [- 6.27250645, -0.00069432, 0.00042551, 7.27181213, 0.99787854, 0.99888017, 0.49313499],
+                             [- 6.27250683, -0.00069416, 0.00042541, 7.27181266, 0.99787901, 0.99888042, 0.49313500],
+                             [- 6.27250720, -0.00069401, 0.00042532, 7.27181319, 0.99787949, 0.99888067, 0.49313506],
+                             [- 6.27250757, -0.00069385, 0.00042522, 7.27181372, 0.99787996, 0.99888092, 0.49313510],
+                             [- 6.27250795, -0.00069370, 0.00042513, 7.27181425, 0.99788044, 0.99888117, 0.49313518],
+                             [- 6.27250832, -0.00069354, 0.00042503, 7.27181478, 0.99788091, 0.99888143, 0.49313523],
+                             [- 6.27250869, -0.00069339, 0.00042494, 7.27181531, 0.99788139, 0.99888168, 0.49313528],
+                             [- 6.27250906, -0.00069323, 0.00042484, 7.27181583, 0.99788186, 0.99888193, 0.49313532],
+                             [- 6.27250944, -0.00069308, 0.00042475, 7.27181636, 0.99788234, 0.99888218, 0.49313537],
+                             [- 6.27250981, -0.00069292, 0.00042465, 7.27181689, 0.99788281, 0.99888243, 0.49313545],
+                             [- 6.27251018, -0.00069277, 0.00042456, 7.27181742, 0.99788329, 0.99888268, 0.49313551],
+                             [- 6.27251055, -0.00069261, 0.00042446, 7.27181794, 0.99788376, 0.99888293, 0.49313557],
+                             [- 6.27251093, -0.00069246, 0.00042437, 7.27181847, 0.99788423, 0.99888318, 0.49313560],
+                             [- 6.27251130, -0.00069230, 0.00042427, 7.27181900, 0.99788471, 0.99888343, 0.49313566],
+                             [- 6.27251167, -0.00069215, 0.00042418, 7.27181952, 0.99788518, 0.99888368, 0.49313574],
+                             [- 6.27251204, -0.00069199, 0.00042408, 7.27182005, 0.99788565, 0.99888393, 0.49313579],
+                             [- 6.27251241, -0.00069184, 0.00042399, 7.27182058, 0.99788613, 0.99888418, 0.49313583],
+                             [- 6.27251278, -0.00069168, 0.00042389, 7.27182110, 0.99788660, 0.99888443, 0.49313587],
+                             [- 6.27251315, -0.00069153, 0.00042380, 7.27182163, 0.99788707, 0.99888468, 0.49313593],
+                             [- 6.27251353, -0.00069137, 0.00042370, 7.27182215, 0.99788754, 0.99888492, 0.49313600],
+                             [- 6.27251390, -0.00069122, 0.00042361, 7.27182268, 0.99788801, 0.99888517, 0.49313604],
+                             [- 6.27251427, -0.00069106, 0.00042351, 7.27182320, 0.99788849, 0.99888542, 0.49313613],
+                             [- 6.27251464, -0.00069091, 0.00042342, 7.27182373, 0.99788896, 0.99888567, 0.49313616],
+                             [- 6.27251501, -0.00069076, 0.00042332, 7.27182425, 0.99788943, 0.99888592, 0.49313621],
+                             [- 6.27251538, -0.00069060, 0.00042323, 7.27182478, 0.99788990, 0.99888617, 0.49313628],
+                             [- 6.27251575, -0.00069045, 0.00042314, 7.27182530, 0.99789037, 0.99888642, 0.49313634],
+                             [- 6.27251612, -0.00069029, 0.00042304, 7.27182582, 0.99789084, 0.99888667, 0.49313637],
+                             [- 6.27251649, -0.00069014, 0.00042295, 7.27182635, 0.99789131, 0.99888691, 0.49313644],
+                             [- 6.27251685, -0.00068999, 0.00042285, 7.27182687, 0.99789178, 0.99888716, 0.49313651],
+                             [- 6.27251722, -0.00068983, 0.00042276, 7.27182739, 0.99789225, 0.99888741, 0.49313656],
+                             [- 6.27251759, -0.00068968, 0.00042266, 7.27182791, 0.99789272, 0.99888766, 0.49313664],
+                             [- 6.27251796, -0.00068952, 0.00042257, 7.27182844, 0.99789319, 0.99888791, 0.49313666],
+                             [- 6.27251833, -0.00068937, 0.00042248, 7.27182896, 0.99789366, 0.99888815, 0.49313670],
+                             [- 6.27251870, -0.00068922, 0.00042238, 7.27182948, 0.99789413, 0.99888840, 0.49313677],
+                             [- 6.27251907, -0.00068906, 0.00042229, 7.27183000, 0.99789460, 0.99888865, 0.49313683],
+                             [- 6.27251943, -0.00068891, 0.00042219, 7.27183052, 0.99789507, 0.99888890, 0.49313687],
+                             [- 6.27251980, -0.00068876, 0.00042210, 7.27183104, 0.99789554, 0.99888914, 0.49313691],
+                             [- 6.27252017, -0.00068860, 0.00042200, 7.27183157, 0.99789601, 0.99888939, 0.49313700],
+                             [- 6.27252054, -0.00068845, 0.00042191, 7.27183209, 0.99789647, 0.99888964, 0.49313706],
+                             [- 6.27252091, -0.00068830, 0.00042182, 7.27183261, 0.99789694, 0.99888988, 0.49313707],
+                             [- 6.27252127, -0.00068815, 0.00042172, 7.27183313, 0.99789741, 0.99889013, 0.49313711],
+                             [- 6.27252164, -0.00068799, 0.00042163, 7.27183365, 0.99789788, 0.99889038, 0.49313720],
+                             [- 6.27252201, -0.00068784, 0.00042154, 7.27183417, 0.99789835, 0.99889062, 0.49313727],
+                             [- 6.27252237, -0.00068769, 0.00042144, 7.27183469, 0.99789881, 0.99889087, 0.49313733],
+                             [- 6.27252274, -0.00068753, 0.00042135, 7.27183521, 0.99789928, 0.99889112, 0.49313737],
+                             [- 6.27252311, -0.00068738, 0.00042125, 7.27183572, 0.99789975, 0.99889136, 0.49313744],
+                             [- 6.27252347, -0.00068723, 0.00042116, 7.27183624, 0.99790021, 0.99889161, 0.49313749],
+                             [- 6.27252384, -0.00068708, 0.00042107, 7.27183676, 0.99790068, 0.99889186, 0.49313754],
+                             [- 6.27252420, -0.00068692, 0.00042097, 7.27183728, 0.99790115, 0.99889210, 0.49313760],
+                             [- 6.27252457, -0.00068677, 0.00042088, 7.27183780, 0.99790161, 0.99889235, 0.49313767],
+                             [- 6.27252494, -0.00068662, 0.00042079, 7.27183832, 0.99790208, 0.99889259, 0.49313771],
+                             [- 6.27252530, -0.00068647, 0.00042069, 7.27183883, 0.99790254, 0.99889284, 0.49313775],
+                             [- 6.27252567, -0.00068631, 0.00042060, 7.27183935, 0.99790301, 0.99889309, 0.49313782],
+                             [- 6.27252603, -0.00068616, 0.00042051, 7.27183987, 0.99790347, 0.99889333, 0.49313786],
+                             [- 6.27252640, -0.00068601, 0.00042041, 7.27184039, 0.99790394, 0.99889358, 0.49313791],
+                             [- 6.27252676, -0.00068586, 0.00042032, 7.27184090, 0.99790440, 0.99889382, 0.49313797],
+                             [- 6.27252712, -0.00068571, 0.00042023, 7.27184142, 0.99790487, 0.99889407, 0.49313801],
+                             [- 6.27252749, -0.00068555, 0.00042013, 7.27184193, 0.99790533, 0.99889431, 0.49313810],
+                             [- 6.27252785, -0.00068540, 0.00042004, 7.27184245, 0.99790579, 0.99889456, 0.49313815],
+                             [- 6.27252822, -0.00068525, 0.00041995, 7.27184297, 0.99790626, 0.99889480, 0.49313818],
+                             [- 6.27252858, -0.00068510, 0.00041985, 7.27184348, 0.99790672, 0.99889505, 0.49313824],
+                             [- 6.27252895, -0.00068495, 0.00041976, 7.27184400, 0.99790719, 0.99889529, 0.49313828],
+                             [- 6.27252931, -0.00068480, 0.00041967, 7.27184451, 0.99790765, 0.99889553, 0.49313835],
+                             [- 6.27252967, -0.00068464, 0.00041958, 7.27184503, 0.99790811, 0.99889578, 0.49313842],
+                             [- 6.27253004, -0.00068449, 0.00041948, 7.27184554, 0.99790857, 0.99889602, 0.49313845],
+                             [- 6.27253040, -0.00068434, 0.00041939, 7.27184606, 0.99790904, 0.99889627, 0.49313853],
+                             [- 6.27253076, -0.00068419, 0.00041930, 7.27184657, 0.99790950, 0.99889651, 0.49313854],
+                             [- 6.27253112, -0.00068404, 0.00041920, 7.27184708, 0.99790996, 0.99889676, 0.49313861],
+                             [- 6.27253149, -0.00068389, 0.00041911, 7.27184760, 0.99791042, 0.99889700, 0.49313867],
+                             [- 6.27253185, -0.00068374, 0.00041902, 7.27184811, 0.99791089, 0.99889724, 0.49313874],
+                             [- 6.27253221, -0.00068359, 0.00041893, 7.27184862, 0.99791135, 0.99889749, 0.49313876],
+                             [- 6.27253257, -0.00068344, 0.00041883, 7.27184914, 0.99791181, 0.99889773, 0.49313881],
+                             [- 6.27253293, -0.00068328, 0.00041874, 7.27184965, 0.99791227, 0.99889797, 0.49313886],
+                             [- 6.27253330, -0.00068313, 0.00041865, 7.27185016, 0.99791273, 0.99889822, 0.49313893],
+                             [- 6.27253366, -0.00068298, 0.00041856, 7.27185068, 0.99791319, 0.99889846, 0.49313897],
+                             [- 6.27253402, -0.00068283, 0.00041846, 7.27185119, 0.99791365, 0.99889870, 0.49313904],
+                             [- 6.27253438, -0.00068268, 0.00041837, 7.27185170, 0.99791411, 0.99889895, 0.49313909],
+                             [- 6.27253474, -0.00068253, 0.00041828, 7.27185221, 0.99791457, 0.99889919, 0.49313915],
+                             [- 6.27253510, -0.00068238, 0.00041819, 7.27185272, 0.99791503, 0.99889943, 0.49313920],
+                             [- 6.27253546, -0.00068223, 0.00041810, 7.27185323, 0.99791549, 0.99889967, 0.49313924],
+                             [- 6.27253582, -0.00068208, 0.00041800, 7.27185374, 0.99791595, 0.99889992, 0.49313932],
+                             [- 6.27253618, -0.00068193, 0.00041791, 7.27185425, 0.99791641, 0.99890016, 0.49313937],
+                             [- 6.27253654, -0.00068178, 0.00041782, 7.27185477, 0.99791687, 0.99890040, 0.49313944],
+                             [- 6.27253690, -0.00068163, 0.00041773, 7.27185528, 0.99791733, 0.99890064, 0.49313947],
+                             [- 6.27253726, -0.00068148, 0.00041763, 7.27185579, 0.99791779, 0.99890089, 0.49313953],
+                             [- 6.27253762, -0.00068133, 0.00041754, 7.27185630, 0.99791825, 0.99890113, 0.49313960],
+                             [- 6.27253798, -0.00068118, 0.00041745, 7.27185680, 0.99791871, 0.99890137, 0.49313964],
+                             [- 6.27253834, -0.00068103, 0.00041736, 7.27185731, 0.99791916, 0.99890161, 0.49313969],
+                             [- 6.27253870, -0.00068088, 0.00041727, 7.27185782, 0.99791962, 0.99890185, 0.49313973],
+                             [- 6.27253906, -0.00068073, 0.00041718, 7.27185833, 0.99792008, 0.99890209, 0.49313978],
+                             [- 6.27253942, -0.00068058, 0.00041708, 7.27185884, 0.99792054, 0.99890234, 0.49313983],
+                             [- 6.27253978, -0.00068043, 0.00041699, 7.27185935, 0.99792099, 0.99890258, 0.49313991],
+                             [- 6.27254014, -0.00068028, 0.00041690, 7.27185986, 0.99792145, 0.99890282, 0.49313998],
+                             [- 6.27254050, -0.00068013, 0.00041681, 7.27186036, 0.99792191, 0.99890306, 0.49314002],
+                             [- 6.27254086, -0.00067998, 0.00041672, 7.27186087, 0.99792237, 0.99890330, 0.49314008],
+                             [- 6.27254121, -0.00067983, 0.00041662, 7.27186138, 0.99792282, 0.99890354, 0.49314012],
+                             [- 6.27254157, -0.00067968, 0.00041653, 7.27186189, 0.99792328, 0.99890378, 0.49314018],
+                             [- 6.27254193, -0.00067953, 0.00041644, 7.27186239, 0.99792373, 0.99890402, 0.49314019],
+                             [- 6.27254229, -0.00067939, 0.00041635, 7.27186290, 0.99792419, 0.99890426, 0.49314025],
+                             [- 6.27254264, -0.00067924, 0.00041626, 7.27186341, 0.99792465, 0.99890450, 0.49314034],
+                             [- 6.27254300, -0.00067909, 0.00041617, 7.27186391, 0.99792510, 0.99890474, 0.49314040],
+                             [- 6.27254336, -0.00067894, 0.00041608, 7.27186442, 0.99792556, 0.99890499, 0.49314044],
+                             [- 6.27254372, -0.00067879, 0.00041598, 7.27186493, 0.99792601, 0.99890523, 0.49314049],
+                             [- 6.27254407, -0.00067864, 0.00041589, 7.27186543, 0.99792647, 0.99890547, 0.49314054],
+                             [- 6.27254443, -0.00067849, 0.00041580, 7.27186594, 0.99792692, 0.99890571, 0.49314058],
+                             [- 6.27254479, -0.00067834, 0.00041571, 7.27186644, 0.99792738, 0.99890595, 0.49314062],
+                             [- 6.27254514, -0.00067819, 0.00041562, 7.27186695, 0.99792783, 0.99890618, 0.49314070],
+                             [- 6.27254550, -0.00067805, 0.00041553, 7.27186745, 0.99792828, 0.99890642, 0.49314075],
+                             [- 6.27254585, -0.00067790, 0.00041544, 7.27186796, 0.99792874, 0.99890666, 0.49314079],
+                             [- 6.27254621, -0.00067775, 0.00041535, 7.27186846, 0.99792919, 0.99890690, 0.49314085],
+                             [- 6.27254657, -0.00067760, 0.00041526, 7.27186897, 0.99792965, 0.99890714, 0.49314090],
+                             [- 6.27254692, -0.00067745, 0.00041516, 7.27186947, 0.99793010, 0.99890738, 0.49314094],
+                             [- 6.27254728, -0.00067730, 0.00041507, 7.27186997, 0.99793055, 0.99890762, 0.49314100],
+                             [- 6.27254763, -0.00067716, 0.00041498, 7.27187048, 0.99793101, 0.99890786, 0.49314106],
+                             [- 6.27254799, -0.00067701, 0.00041489, 7.27187098, 0.99793146, 0.99890810, 0.49314111],
+                             [- 6.27254834, -0.00067686, 0.00041480, 7.27187148, 0.99793191, 0.99890834, 0.49314118],
+                             [- 6.27254870, -0.00067671, 0.00041471, 7.27187199, 0.99793236, 0.99890858, 0.49314123],
+                             [- 6.27254905, -0.00067656, 0.00041462, 7.27187249, 0.99793282, 0.99890882, 0.49314127],
+                             [- 6.27254941, -0.00067642, 0.00041453, 7.27187299, 0.99793327, 0.99890905, 0.49314132],
+                             [- 6.27254976, -0.00067627, 0.00041444, 7.27187349, 0.99793372, 0.99890929, 0.49314138],
+                             [- 6.27255012, -0.00067612, 0.00041435, 7.27187399, 0.99793417, 0.99890953, 0.49314144],
+                             [- 6.27255047, -0.00067597, 0.00041426, 7.27187450, 0.99793462, 0.99890977, 0.49314149],
+                             [- 6.27255082, -0.00067583, 0.00041417, 7.27187500, 0.99793507, 0.99891001, 0.49314155],
+                             [- 6.27255118, -0.00067568, 0.00041408, 7.27187550, 0.99793552, 0.99891025, 0.49314159],
+                             [- 6.27255153, -0.00067553, 0.00041399, 7.27187600, 0.99793597, 0.99891048, 0.49314164],
+                             [- 6.27255188, -0.00067538, 0.00041390, 7.27187650, 0.99793643, 0.99891072, 0.49314169],
+                             [- 6.27255224, -0.00067524, 0.00041381, 7.27187700, 0.99793688, 0.99891096, 0.49314176],
+                             [- 6.27255259, -0.00067509, 0.00041372, 7.27187750, 0.99793733, 0.99891120, 0.49314181],
+                             [- 6.27255294, -0.00067494, 0.00041362, 7.27187800, 0.99793778, 0.99891143, 0.49314185],
+                             [- 6.27255330, -0.00067479, 0.00041353, 7.27187850, 0.99793823, 0.99891167, 0.49314190],
+                             [- 6.27255365, -0.00067465, 0.00041344, 7.27187900, 0.99793868, 0.99891191, 0.49314197],
+                             [- 6.27255400, -0.00067450, 0.00041335, 7.27187950, 0.99793912, 0.99891215, 0.49314200],
+                             [- 6.27255435, -0.00067435, 0.00041326, 7.27188000, 0.99793957, 0.99891238, 0.49314208],
+                             [- 6.27255470, -0.00067421, 0.00041317, 7.27188050, 0.99794002, 0.99891262, 0.49314213],
+                             [- 6.27255506, -0.00067406, 0.00041308, 7.27188100, 0.99794047, 0.99891286, 0.49314217],
+                             [- 6.27255541, -0.00067391, 0.00041299, 7.27188150, 0.99794092, 0.99891309, 0.49314220],
+                             [- 6.27255576, -0.00067377, 0.00041290, 7.27188199, 0.99794137, 0.99891333, 0.49314225],
+                             [- 6.27255611, -0.00067362, 0.00041281, 7.27188249, 0.99794182, 0.99891357, 0.49314232],
+                             [- 6.27255646, -0.00067347, 0.00041272, 7.27188299, 0.99794227, 0.99891380, 0.49314238],
+                             [- 6.27255681, -0.00067333, 0.00041263, 7.27188349, 0.99794271, 0.99891404, 0.49314241],
+                             [- 6.27255717, -0.00067318, 0.00041254, 7.27188398, 0.99794316, 0.99891428, 0.49314247],
+                             [- 6.27255752, -0.00067303, 0.00041245, 7.27188448, 0.99794361, 0.99891451, 0.49314253],
+                             [- 6.27255787, -0.00067289, 0.00041236, 7.27188498, 0.99794406, 0.99891475, 0.49314258],
+                             [- 6.27255822, -0.00067274, 0.00041228, 7.27188548, 0.99794450, 0.99891498, 0.49314263],
+                             [- 6.27255857, -0.00067260, 0.00041219, 7.27188597, 0.99794495, 0.99891522, 0.49314268],
+                             [- 6.27255892, -0.00067245, 0.00041210, 7.27188647, 0.99794540, 0.99891545, 0.49314274],
+                             [- 6.27255927, -0.00067230, 0.00041201, 7.27188696, 0.99794584, 0.99891569, 0.49314280],
+                             [- 6.27255962, -0.00067216, 0.00041192, 7.27188746, 0.99794629, 0.99891593, 0.49314284],
+                             [- 6.27255997, -0.00067201, 0.00041183, 7.27188796, 0.99794673, 0.99891616, 0.49314287],
+                             [- 6.27256032, -0.00067187, 0.00041174, 7.27188845, 0.99794718, 0.99891640, 0.49314297],
+                             [- 6.27256067, -0.00067172, 0.00041165, 7.27188895, 0.99794763, 0.99891663, 0.49314303],
+                             [- 6.27256102, -0.00067157, 0.00041156, 7.27188944, 0.99794807, 0.99891687, 0.49314307],
+                             [- 6.27256137, -0.00067143, 0.00041147, 7.27188994, 0.99794852, 0.99891710, 0.49314312],
+                             [- 6.27256171, -0.00067128, 0.00041138, 7.27189043, 0.99794896, 0.99891734, 0.49314315],
+                             [- 6.27256206, -0.00067114, 0.00041129, 7.27189093, 0.99794941, 0.99891757, 0.49314322],
+                             [- 6.27256241, -0.00067099, 0.00041120, 7.27189142, 0.99794985, 0.99891781, 0.49314325],
+                             [- 6.27256276, -0.00067085, 0.00041111, 7.27189191, 0.99795030, 0.99891804, 0.49314333],
+                             [- 6.27256311, -0.00067070, 0.00041102, 7.27189241, 0.99795074, 0.99891828, 0.49314337],
+                             [- 6.27256346, -0.00067056, 0.00041093, 7.27189290, 0.99795119, 0.99891851, 0.49314340],
+                             [- 6.27256381, -0.00067041, 0.00041085, 7.27189339, 0.99795163, 0.99891874, 0.49314348],
+                             [- 6.27256415, -0.00067027, 0.00041076, 7.27189389, 0.99795207, 0.99891898, 0.49314353],
+                             [- 6.27256450, -0.00067012, 0.00041067, 7.27189438, 0.99795252, 0.99891921, 0.49314358],
+                             [- 6.27256485, -0.00066998, 0.00041058, 7.27189487, 0.99795296, 0.99891945, 0.49314365],
+                             [- 6.27256520, -0.00066983, 0.00041049, 7.27189537, 0.99795340, 0.99891968, 0.49314368],
+                             [- 6.27256554, -0.00066969, 0.00041040, 7.27189586, 0.99795385, 0.99891991, 0.49314376],
+                             [- 6.27256589, -0.00066954, 0.00041031, 7.27189635, 0.99795429, 0.99892015, 0.49314379],
+                             [- 6.27256624, -0.00066940, 0.00041022, 7.27189684, 0.99795473, 0.99892038, 0.49314383],
+                             [- 6.27256658, -0.00066925, 0.00041013, 7.27189733, 0.99795517, 0.99892061, 0.49314389],
+                             [- 6.27256693, -0.00066911, 0.00041005, 7.27189782, 0.99795562, 0.99892085, 0.49314395],
+                             [- 6.27256728, -0.00066896, 0.00040996, 7.27189832, 0.99795606, 0.99892108, 0.49314398],
+                             [- 6.27256762, -0.00066882, 0.00040987, 7.27189881, 0.99795650, 0.99892131, 0.49314403],
+                             [- 6.27256797, -0.00066867, 0.00040978, 7.27189930, 0.99795694, 0.99892155, 0.49314409],
+                             [- 6.27256832, -0.00066853, 0.00040969, 7.27189979, 0.99795738, 0.99892178, 0.49314415],
+                             [- 6.27256866, -0.00066838, 0.00040960, 7.27190028, 0.99795782, 0.99892201, 0.49314419],
+                             [- 6.27256901, -0.00066824, 0.00040951, 7.27190077, 0.99795827, 0.99892225, 0.49314425],
+                             [- 6.27256935, -0.00066810, 0.00040943, 7.27190126, 0.99795871, 0.99892248, 0.49314428],
+                             [- 6.27256970, -0.00066795, 0.00040934, 7.27190175, 0.99795915, 0.99892271, 0.49314436],
+                             [- 6.27257004, -0.00066781, 0.00040925, 7.27190224, 0.99795959, 0.99892294, 0.49314439],
+                             [- 6.27257039, -0.00066766, 0.00040916, 7.27190273, 0.99796003, 0.99892318, 0.49314446],
+                             [- 6.27257073, -0.00066752, 0.00040907, 7.27190322, 0.99796047, 0.99892341, 0.49314452],
+                             [- 6.27257108, -0.00066738, 0.00040898, 7.27190370, 0.99796091, 0.99892364, 0.49314453],
+                             [- 6.27257142, -0.00066723, 0.00040890, 7.27190419, 0.99796135, 0.99892387, 0.49314460],
+                             [- 6.27257177, -0.00066709, 0.00040881, 7.27190468, 0.99796179, 0.99892410, 0.49314466],
+                             [- 6.27257211, -0.00066694, 0.00040872, 7.27190517, 0.99796223, 0.99892434, 0.49314470],
+                             [- 6.27257246, -0.00066680, 0.00040863, 7.27190566, 0.99796267, 0.99892457, 0.49314476],
+                             [- 6.27257280, -0.00066666, 0.00040854, 7.27190615, 0.99796311, 0.99892480, 0.49314482],
+                             [- 6.27257315, -0.00066651, 0.00040846, 7.27190663, 0.99796354, 0.99892503, 0.49314486],
+                             [- 6.27257349, -0.00066637, 0.00040837, 7.27190712, 0.99796398, 0.99892526, 0.49314490],
+                             [- 6.27257383, -0.00066623, 0.00040828, 7.27190761, 0.99796442, 0.99892549, 0.49314498],
+                             [- 6.27257418, -0.00066608, 0.00040819, 7.27190809, 0.99796486, 0.99892573, 0.49314501],
+                             [- 6.27257452, -0.00066594, 0.00040810, 7.27190858, 0.99796530, 0.99892596, 0.49314505],
+                             [- 6.27257486, -0.00066580, 0.00040802, 7.27190907, 0.99796574, 0.99892619, 0.49314512],
+                             [- 6.27257521, -0.00066565, 0.00040793, 7.27190955, 0.99796617, 0.99892642, 0.49314515],
+                             [- 6.27257555, -0.00066551, 0.00040784, 7.27191004, 0.99796661, 0.99892665, 0.49314521],
+                             [- 6.27257589, -0.00066537, 0.00040775, 7.27191053, 0.99796705, 0.99892688, 0.49314528],
+                             [- 6.27257623, -0.00066522, 0.00040766, 7.27191101, 0.99796748, 0.99892711, 0.49314532],
+                             [- 6.27257658, -0.00066508, 0.00040758, 7.27191150, 0.99796792, 0.99892734, 0.49314537],
+                             [- 6.27257692, -0.00066494, 0.00040749, 7.27191198, 0.99796836, 0.99892757, 0.49314541],
+                             [- 6.27257726, -0.00066480, 0.00040740, 7.27191247, 0.99796880, 0.99892780, 0.49314547],
+                             [- 6.27257760, -0.00066465, 0.00040731, 7.27191295, 0.99796923, 0.99892803, 0.49314555],
+                             [- 6.27257795, -0.00066451, 0.00040723, 7.27191344, 0.99796967, 0.99892826, 0.49314558],
+                             [- 6.27257829, -0.00066437, 0.00040714, 7.27191392, 0.99797010, 0.99892849, 0.49314564],
+                             [- 6.27257863, -0.00066422, 0.00040705, 7.27191440, 0.99797054, 0.99892872, 0.49314568],
+                             [- 6.27257897, -0.00066408, 0.00040696, 7.27191489, 0.99797098, 0.99892895, 0.49314573],
+                             [- 6.27257931, -0.00066394, 0.00040688, 7.27191537, 0.99797141, 0.99892918, 0.49314579],
+                             [- 6.27257965, -0.00066380, 0.00040679, 7.27191586, 0.99797185, 0.99892941, 0.49314582],
+                             [- 6.27257999, -0.00066366, 0.00040670, 7.27191634, 0.99797228, 0.99892964, 0.49314588],
+                             [- 6.27258033, -0.00066351, 0.00040662, 7.27191682, 0.99797272, 0.99892987, 0.49314593],
+                             [- 6.27258068, -0.00066337, 0.00040653, 7.27191730, 0.99797315, 0.99893010, 0.49314598],
+                             [- 6.27258102, -0.00066323, 0.00040644, 7.27191779, 0.99797358, 0.99893033, 0.49314603],
+                             [- 6.27258136, -0.00066309, 0.00040635, 7.27191827, 0.99797402, 0.99893056, 0.49314608],
+                             [- 6.27258170, -0.00066294, 0.00040627, 7.27191875, 0.99797445, 0.99893079, 0.49314611],
+                             [- 6.27258204, -0.00066280, 0.00040618, 7.27191923, 0.99797489, 0.99893102, 0.49314621],
+                             [- 6.27258238, -0.00066266, 0.00040609, 7.27191972, 0.99797532, 0.99893125, 0.49314623],
+                             [- 6.27258272, -0.00066252, 0.00040601, 7.27192020, 0.99797575, 0.99893148, 0.49314626],
+                             [- 6.27258306, -0.00066238, 0.00040592, 7.27192068, 0.99797619, 0.99893170, 0.49314635],
+                             [- 6.27258340, -0.00066224, 0.00040583, 7.27192116, 0.99797662, 0.99893193, 0.49314639],
+                             [- 6.27258373, -0.00066209, 0.00040574, 7.27192164, 0.99797705, 0.99893216, 0.49314644],
+                             [- 6.27258407, -0.00066195, 0.00040566, 7.27192212, 0.99797749, 0.99893239, 0.49314649],
+                             [- 6.27258441, -0.00066181, 0.00040557, 7.27192260, 0.99797792, 0.99893262, 0.49314651],
+                             [- 6.27258475, -0.00066167, 0.00040548, 7.27192308, 0.99797835, 0.99893285, 0.49314660],
+                             [- 6.27258509, -0.00066153, 0.00040540, 7.27192356, 0.99797878, 0.99893307, 0.49314663],
+                             [- 6.27258543, -0.00066139, 0.00040531, 7.27192404, 0.99797922, 0.99893330, 0.49314669],
+                             [- 6.27258577, -0.00066125, 0.00040522, 7.27192452, 0.99797965, 0.99893353, 0.49314673],
+                             [- 6.27258611, -0.00066110, 0.00040514, 7.27192500, 0.99798008, 0.99893376, 0.49314679],
+                             [- 6.27258644, -0.00066096, 0.00040505, 7.27192548, 0.99798051, 0.99893399, 0.49314686],
+                             [- 6.27258678, -0.00066082, 0.00040496, 7.27192596, 0.99798094, 0.99893421, 0.49314689],
+                             [- 6.27258712, -0.00066068, 0.00040488, 7.27192644, 0.99798137, 0.99893444, 0.49314694],
+                             [- 6.27258746, -0.00066054, 0.00040479, 7.27192692, 0.99798181, 0.99893467, 0.49314700],
+                             [- 6.27258780, -0.00066040, 0.00040471, 7.27192740, 0.99798224, 0.99893490, 0.49314705],
+                             [- 6.27258813, -0.00066026, 0.00040462, 7.27192788, 0.99798267, 0.99893512, 0.49314708],
+                             [- 6.27258847, -0.00066012, 0.00040453, 7.27192835, 0.99798310, 0.99893535, 0.49314712],
+                             [- 6.27258881, -0.00065998, 0.00040445, 7.27192883, 0.99798353, 0.99893558, 0.49314719],
+                             [- 6.27258914, -0.00065984, 0.00040436, 7.27192931, 0.99798396, 0.99893580, 0.49314727],
+                             [- 6.27258948, -0.00065970, 0.00040427, 7.27192979, 0.99798439, 0.99893603, 0.49314727],
+                             [- 6.27258982, -0.00065955, 0.00040419, 7.27193026, 0.99798482, 0.99893626, 0.49314731],
+                             [- 6.27259015, -0.00065941, 0.00040410, 7.27193074, 0.99798525, 0.99893648, 0.49314740],
+                             [- 6.27259049, -0.00065927, 0.00040401, 7.27193122, 0.99798568, 0.99893671, 0.49314745],
+                             [- 6.27259083, -0.00065913, 0.00040393, 7.27193169, 0.99798610, 0.99893694, 0.49314746],
+                             [- 6.27259116, -0.00065899, 0.00040384, 7.27193217, 0.99798653, 0.99893716, 0.49314754],
+                             [- 6.27259150, -0.00065885, 0.00040376, 7.27193265, 0.99798696, 0.99893739, 0.49314761],
+                             [- 6.27259184, -0.00065871, 0.00040367, 7.27193312, 0.99798739, 0.99893762, 0.49314766],
+                             [- 6.27259217, -0.00065857, 0.00040358, 7.27193360, 0.99798782, 0.99893784, 0.49314769],
+                             [- 6.27259251, -0.00065843, 0.00040350, 7.27193407, 0.99798825, 0.99893807, 0.49314775],
+                             [- 6.27259284, -0.00065829, 0.00040341, 7.27193455, 0.99798868, 0.99893829, 0.49314778],
+                             [- 6.27259318, -0.00065815, 0.00040333, 7.27193502, 0.99798910, 0.99893852, 0.49314784],
+                             [- 6.27259351, -0.00065801, 0.00040324, 7.27193550, 0.99798953, 0.99893875, 0.49314788],
+                             [- 6.27259385, -0.00065787, 0.00040316, 7.27193597, 0.99798996, 0.99893897, 0.49314794],
+                             [- 6.27259418, -0.00065773, 0.00040307, 7.27193645, 0.99799039, 0.99893920, 0.49314799],
+                             [- 6.27259452, -0.00065759, 0.00040298, 7.27193692, 0.99799081, 0.99893942, 0.49314805],
+                             [- 6.27259485, -0.00065745, 0.00040290, 7.27193740, 0.99799124, 0.99893965, 0.49314807],
+                             [- 6.27259519, -0.00065731, 0.00040281, 7.27193787, 0.99799167, 0.99893987, 0.49314813],
+                             [- 6.27259552, -0.00065717, 0.00040273, 7.27193835, 0.99799209, 0.99894010, 0.49314822],
+                             [- 6.27259585, -0.00065703, 0.00040264, 7.27193882, 0.99799252, 0.99894032, 0.49314825],
+                             [- 6.27259619, -0.00065690, 0.00040256, 7.27193929, 0.99799295, 0.99894055, 0.49314830],
+                             [- 6.27259652, -0.00065676, 0.00040247, 7.27193977, 0.99799337, 0.99894077, 0.49314836],
+                             [- 6.27259686, -0.00065662, 0.00040239, 7.27194024, 0.99799380, 0.99894100, 0.49314839],
+                             [- 6.27259719, -0.00065648, 0.00040230, 7.27194071, 0.99799422, 0.99894122, 0.49314844],
+                             [- 6.27259752, -0.00065634, 0.00040221, 7.27194118, 0.99799465, 0.99894145, 0.49314848],
+                             [- 6.27259786, -0.00065620, 0.00040213, 7.27194166, 0.99799507, 0.99894167, 0.49314852],
+                             [- 6.27259819, -0.00065606, 0.00040204, 7.27194213, 0.99799550, 0.99894190, 0.49314858],
+                             [- 6.27259852, -0.00065592, 0.00040196, 7.27194260, 0.99799593, 0.99894212, 0.49314864],
+                             [- 6.27259885, -0.00065578, 0.00040187, 7.27194307, 0.99799635, 0.99894234, 0.49314867],
+                             [- 6.27259919, -0.00065564, 0.00040179, 7.27194354, 0.99799677, 0.99894257, 0.49314872],
+                             [- 6.27259952, -0.00065550, 0.00040170, 7.27194402, 0.99799720, 0.99894279, 0.49314880],
+                             [- 6.27259985, -0.00065537, 0.00040162, 7.27194449, 0.99799762, 0.99894302, 0.49314880],
+                             [- 6.27260018, -0.00065523, 0.00040153, 7.27194496, 0.99799805, 0.99894324, 0.49314888],
+                             [- 6.27260052, -0.00065509, 0.00040145, 7.27194543, 0.99799847, 0.99894346, 0.49314897],
+                             [- 6.27260085, -0.00065495, 0.00040136, 7.27194590, 0.99799889, 0.99894369, 0.49314899],
+                             [- 6.27260118, -0.00065481, 0.00040128, 7.27194637, 0.99799932, 0.99894391, 0.49314902],
+                             [- 6.27260151, -0.00065467, 0.00040119, 7.27194684, 0.99799974, 0.99894413, 0.49314908],
+                             [- 6.27260184, -0.00065453, 0.00040111, 7.27194731, 0.99800016, 0.99894436, 0.49314911],
+                             [- 6.27260217, -0.00065440, 0.00040102, 7.27194778, 0.99800059, 0.99894458, 0.49314920],
+                             [- 6.27260251, -0.00065426, 0.00040094, 7.27194825, 0.99800101, 0.99894480, 0.49314922],
+                             [- 6.27260284, -0.00065412, 0.00040085, 7.27194872, 0.99800143, 0.99894503, 0.49314928],
+                             [- 6.27260317, -0.00065398, 0.00040077, 7.27194919, 0.99800186, 0.99894525, 0.49314931],
+                             [- 6.27260350, -0.00065384, 0.00040068, 7.27194966, 0.99800228, 0.99894547, 0.49314937],
+                             [- 6.27260383, -0.00065370, 0.00040060, 7.27195013, 0.99800270, 0.99894570, 0.49314942],
+                             [- 6.27260416, -0.00065357, 0.00040051, 7.27195059, 0.99800312, 0.99894592, 0.49314947],
+                             [- 6.27260449, -0.00065343, 0.00040043, 7.27195106, 0.99800354, 0.99894614, 0.49314952],
+                             [- 6.27260482, -0.00065329, 0.00040035, 7.27195153, 0.99800397, 0.99894636, 0.49314960],
+                             [- 6.27260515, -0.00065315, 0.00040026, 7.27195200, 0.99800439, 0.99894659, 0.49314963],
+                             [- 6.27260548, -0.00065302, 0.00040018, 7.27195247, 0.99800481, 0.99894681, 0.49314965],
+                             [- 6.27260581, -0.00065288, 0.00040009, 7.27195293, 0.99800523, 0.99894703, 0.49314972],
+                             [- 6.27260614, -0.00065274, 0.00040001, 7.27195340, 0.99800565, 0.99894725, 0.49314975],
+                             [- 6.27260647, -0.00065260, 0.00039992, 7.27195387, 0.99800607, 0.99894747, 0.49314983],
+                             [- 6.27260680, -0.00065246, 0.00039984, 7.27195434, 0.99800649, 0.99894770, 0.49314987],
+                             [- 6.27260713, -0.00065233, 0.00039975, 7.27195480, 0.99800691, 0.99894792, 0.49314994],
+                             [- 6.27260746, -0.00065219, 0.00039967, 7.27195527, 0.99800733, 0.99894814, 0.49314996],
+                             [- 6.27260779, -0.00065205, 0.00039959, 7.27195573, 0.99800775, 0.99894836, 0.49314998],
+                             [- 6.27260812, -0.00065192, 0.00039950, 7.27195620, 0.99800817, 0.99894858, 0.49315004],
+                             [- 6.27260844, -0.00065178, 0.00039942, 7.27195667, 0.99800859, 0.99894880, 0.49315011],
+                             [- 6.27260877, -0.00065164, 0.00039933, 7.27195713, 0.99800901, 0.99894903, 0.49315016],
+                             [- 6.27260910, -0.00065150, 0.00039925, 7.27195760, 0.99800943, 0.99894925, 0.49315020],
+                             [- 6.27260943, -0.00065137, 0.00039917, 7.27195806, 0.99800985, 0.99894947, 0.49315028],
+                             [- 6.27260976, -0.00065123, 0.00039908, 7.27195853, 0.99801027, 0.99894969, 0.49315027],
+                             [- 6.27261009, -0.00065109, 0.00039900, 7.27195899, 0.99801069, 0.99894991, 0.49315035],
+                             [- 6.27261041, -0.00065096, 0.00039891, 7.27195946, 0.99801110, 0.99895013, 0.49315041],
+                             [- 6.27261074, -0.00065082, 0.00039883, 7.27195992, 0.99801152, 0.99895035, 0.49315047],
+                             [- 6.27261107, -0.00065068, 0.00039875, 7.27196039, 0.99801194, 0.99895057, 0.49315053],
+                             [- 6.27261140, -0.00065055, 0.00039866, 7.27196085, 0.99801236, 0.99895079, 0.49315055],
+                             [- 6.27261172, -0.00065041, 0.00039858, 7.27196132, 0.99801278, 0.99895101, 0.49315059],
+                             [- 6.27261205, -0.00065027, 0.00039849, 7.27196178, 0.99801320, 0.99895123, 0.49315063],
+                             [- 6.27261238, -0.00065014, 0.00039841, 7.27196224, 0.99801361, 0.99895145, 0.49315070],
+                             [- 6.27261271, -0.00065000, 0.00039833, 7.27196271, 0.99801403, 0.99895167, 0.49315074],
+                             [- 6.27261303, -0.00064986, 0.00039824, 7.27196317, 0.99801445, 0.99895189, 0.49315081],
+                             [- 6.27261336, -0.00064973, 0.00039816, 7.27196363, 0.99801486, 0.99895212, 0.49315083],
+                             [- 6.27261369, -0.00064959, 0.00039808, 7.27196410, 0.99801528, 0.99895233, 0.49315088],
+                             [- 6.27261401, -0.00064945, 0.00039799, 7.27196456, 0.99801570, 0.99895255, 0.49315095],
+                             [- 6.27261434, -0.00064932, 0.00039791, 7.27196502, 0.99801611, 0.99895277, 0.49315102],
+                             [- 6.27261466, -0.00064918, 0.00039782, 7.27196548, 0.99801653, 0.99895299, 0.49315101],
+                             [- 6.27261499, -0.00064904, 0.00039774, 7.27196595, 0.99801695, 0.99895321, 0.49315109],
+                             [- 6.27261532, -0.00064891, 0.00039766, 7.27196641, 0.99801736, 0.99895343, 0.49315112],
+                             [- 6.27261564, -0.00064877, 0.00039757, 7.27196687, 0.99801778, 0.99895365, 0.49315120],
+                             [- 6.27261597, -0.00064864, 0.00039749, 7.27196733, 0.99801819, 0.99895387, 0.49315122],
+                             [- 6.27261629, -0.00064850, 0.00039741, 7.27196779, 0.99801861, 0.99895409, 0.49315129],
+                             [- 6.27261662, -0.00064836, 0.00039732, 7.27196825, 0.99801902, 0.99895431, 0.49315134],
+                             [- 6.27261694, -0.00064823, 0.00039724, 7.27196871, 0.99801944, 0.99895453, 0.49315136],
+                             [- 6.27261727, -0.00064809, 0.00039716, 7.27196917, 0.99801985, 0.99895475, 0.49315141],
+                             [- 6.27261759, -0.00064796, 0.00039707, 7.27196963, 0.99802027, 0.99895497, 0.49315149],
+                             [- 6.27261792, -0.00064782, 0.00039699, 7.27197009, 0.99802068, 0.99895519, 0.49315153],
+                             [- 6.27261824, -0.00064769, 0.00039691, 7.27197056, 0.99802110, 0.99895540, 0.49315156],
+                             [- 6.27261857, -0.00064755, 0.00039683, 7.27197101, 0.99802151, 0.99895562, 0.49315162],
+                             [- 6.27261889, -0.00064742, 0.00039674, 7.27197147, 0.99802193, 0.99895584, 0.49315167],
+                             [- 6.27261921, -0.00064728, 0.00039666, 7.27197193, 0.99802234, 0.99895606, 0.49315173],
+                             [- 6.27261954, -0.00064715, 0.00039658, 7.27197239, 0.99802275, 0.99895628, 0.49315176],
+                             [- 6.27261986, -0.00064701, 0.00039649, 7.27197285, 0.99802317, 0.99895650, 0.49315180],
+                             [- 6.27262019, -0.00064687, 0.00039641, 7.27197331, 0.99802358, 0.99895671, 0.49315186],
+                             [- 6.27262051, -0.00064674, 0.00039633, 7.27197377, 0.99802399, 0.99895693, 0.49315191],
+                             [- 6.27262083, -0.00064660, 0.00039624, 7.27197423, 0.99802441, 0.99895715, 0.49315198],
+                             [- 6.27262116, -0.00064647, 0.00039616, 7.27197469, 0.99802482, 0.99895737, 0.49315200],
+                             [- 6.27262148, -0.00064633, 0.00039608, 7.27197515, 0.99802523, 0.99895759, 0.49315204],
+                             [- 6.27262180, -0.00064620, 0.00039600, 7.27197560, 0.99802564, 0.99895780, 0.49315211],
+                             [- 6.27262213, -0.00064606, 0.00039591, 7.27197606, 0.99802606, 0.99895802, 0.49315216],
+                             [- 6.27262245, -0.00064593, 0.00039583, 7.27197652, 0.99802647, 0.99895824, 0.49315219],
+                             [- 6.27262277, -0.00064579, 0.00039575, 7.27197698, 0.99802688, 0.99895846, 0.49315225],
+                             [- 6.27262309, -0.00064566, 0.00039567, 7.27197743, 0.99802729, 0.99895867, 0.49315226],
+                             [- 6.27262342, -0.00064553, 0.00039558, 7.27197789, 0.99802770, 0.99895889, 0.49315233],
+                             [- 6.27262374, -0.00064539, 0.00039550, 7.27197835, 0.99802812, 0.99895911, 0.49315238],
+                             [- 6.27262406, -0.00064526, 0.00039542, 7.27197880, 0.99802853, 0.99895933, 0.49315244],
+                             [- 6.27262438, -0.00064512, 0.00039534, 7.27197926, 0.99802894, 0.99895954, 0.49315248],
+                             [- 6.27262470, -0.00064499, 0.00039525, 7.27197972, 0.99802935, 0.99895976, 0.49315254],
+                             [- 6.27262503, -0.00064485, 0.00039517, 7.27198017, 0.99802976, 0.99895998, 0.49315255],
+                             [- 6.27262535, -0.00064472, 0.00039509, 7.27198063, 0.99803017, 0.99896019, 0.49315260],
+                             [- 6.27262567, -0.00064458, 0.00039501, 7.27198108, 0.99803058, 0.99896041, 0.49315266],
+                             [- 6.27262599, -0.00064445, 0.00039492, 7.27198154, 0.99803099, 0.99896063, 0.49315272],
+                             [- 6.27262631, -0.00064432, 0.00039484, 7.27198199, 0.99803140, 0.99896084, 0.49315276],
+                             [- 6.27262663, -0.00064418, 0.00039476, 7.27198245, 0.99803181, 0.99896106, 0.49315283],
+                             [- 6.27262695, -0.00064405, 0.00039468, 7.27198290, 0.99803222, 0.99896127, 0.49315287],
+                             [- 6.27262727, -0.00064391, 0.00039460, 7.27198336, 0.99803263, 0.99896149, 0.49315291],
+                             [- 6.27262759, -0.00064378, 0.00039451, 7.27198381, 0.99803304, 0.99896171, 0.49315298],
+                             [- 6.27262792, -0.00064365, 0.00039443, 7.27198427, 0.99803345, 0.99896192, 0.49315301],
+                             [- 6.27262824, -0.00064351, 0.00039435, 7.27198472, 0.99803386, 0.99896214, 0.49315305],
+                             [- 6.27262856, -0.00064338, 0.00039427, 7.27198518, 0.99803427, 0.99896235, 0.49315310],
+                             [- 6.27262888, -0.00064325, 0.00039418, 7.27198563, 0.99803468, 0.99896257, 0.49315315],
+                             [- 6.27262920, -0.00064311, 0.00039410, 7.27198608, 0.99803508, 0.99896279, 0.49315320],
+                             [- 6.27262952, -0.00064298, 0.00039402, 7.27198654, 0.99803549, 0.99896300, 0.49315324],
+                             [- 6.27262984, -0.00064284, 0.00039394, 7.27198699, 0.99803590, 0.99896322, 0.49315329],
+                             [- 6.27263015, -0.00064271, 0.00039386, 7.27198744, 0.99803631, 0.99896343, 0.49315335],
+                             [- 6.27263047, -0.00064258, 0.00039378, 7.27198790, 0.99803672, 0.99896365, 0.49315341],
+                             [- 6.27263079, -0.00064244, 0.00039369, 7.27198835, 0.99803712, 0.99896386, 0.49315341],
+                             [- 6.27263111, -0.00064231, 0.00039361, 7.27198880, 0.99803753, 0.99896408, 0.49315348],
+                             [- 6.27263143, -0.00064218, 0.00039353, 7.27198925, 0.99803794, 0.99896429, 0.49315355],
+                             [- 6.27263175, -0.00064204, 0.00039345, 7.27198971, 0.99803835, 0.99896451, 0.49315360],
+                             [- 6.27263207, -0.00064191, 0.00039337, 7.27199016, 0.99803875, 0.99896472, 0.49315362],
+                             [- 6.27263239, -0.00064178, 0.00039329, 7.27199061, 0.99803916, 0.99896494, 0.49315366],
+                             [- 6.27263271, -0.00064165, 0.00039320, 7.27199106, 0.99803957, 0.99896515, 0.49315370],
+                             [- 6.27263302, -0.00064151, 0.00039312, 7.27199151, 0.99803997, 0.99896537, 0.49315378],
+                             [- 6.27263334, -0.00064138, 0.00039304, 7.27199196, 0.99804038, 0.99896558, 0.49315382],
+                             [- 6.27263366, -0.00064125, 0.00039296, 7.27199241, 0.99804079, 0.99896579, 0.49315384],
+                             [- 6.27263398, -0.00064111, 0.00039288, 7.27199287, 0.99804119, 0.99896601, 0.49315390],
+                             [- 6.27263430, -0.00064098, 0.00039280, 7.27199332, 0.99804160, 0.99896622, 0.49315398],
+                             [- 6.27263461, -0.00064085, 0.00039271, 7.27199377, 0.99804200, 0.99896644, 0.49315398],
+                             [- 6.27263493, -0.00064072, 0.00039263, 7.27199422, 0.99804241, 0.99896665, 0.49315402],
+                             [- 6.27263525, -0.00064058, 0.00039255, 7.27199467, 0.99804281, 0.99896686, 0.49315410],
+                             [- 6.27263557, -0.00064045, 0.00039247, 7.27199512, 0.99804322, 0.99896708, 0.49315415],
+                             [- 6.27263588, -0.00064032, 0.00039239, 7.27199557, 0.99804362, 0.99896729, 0.49315420],
+                             [- 6.27263620, -0.00064019, 0.00039231, 7.27199602, 0.99804403, 0.99896751, 0.49315423],
+                             [- 6.27263652, -0.00064005, 0.00039223, 7.27199646, 0.99804443, 0.99896772, 0.49315429],
+                             [- 6.27263683, -0.00063992, 0.00039215, 7.27199691, 0.99804484, 0.99896793, 0.49315433],
+                             [- 6.27263715, -0.00063979, 0.00039206, 7.27199736, 0.99804524, 0.99896815, 0.49315438],
+                             [- 6.27263747, -0.00063966, 0.00039198, 7.27199781, 0.99804565, 0.99896836, 0.49315441],
+                             [- 6.27263778, -0.00063952, 0.00039190, 7.27199826, 0.99804605, 0.99896857, 0.49315445],
+                             [- 6.27263810, -0.00063939, 0.00039182, 7.27199871, 0.99804645, 0.99896879, 0.49315452],
+                             [- 6.27263842, -0.00063926, 0.00039174, 7.27199916, 0.99804686, 0.99896900, 0.49315453],
+                             [- 6.27263873, -0.00063913, 0.00039166, 7.27199960, 0.99804726, 0.99896921, 0.49315461],
+                             [- 6.27263905, -0.00063900, 0.00039158, 7.27200005, 0.99804766, 0.99896942, 0.49315465],
+                             [- 6.27263936, -0.00063886, 0.00039150, 7.27200050, 0.99804807, 0.99896964, 0.49315471],
+                             [- 6.27263968, -0.00063873, 0.00039142, 7.27200095, 0.99804847, 0.99896985, 0.49315476],
+                             [- 6.27263999, -0.00063860, 0.00039134, 7.27200139, 0.99804887, 0.99897006, 0.49315480],
+                             [- 6.27264031, -0.00063847, 0.00039126, 7.27200184, 0.99804928, 0.99897028, 0.49315486],
+                             [- 6.27264063, -0.00063834, 0.00039117, 7.27200229, 0.99804968, 0.99897049, 0.49315489],
+                             [- 6.27264094, -0.00063821, 0.00039109, 7.27200273, 0.99805008, 0.99897070, 0.49315491],
+                             [- 6.27264126, -0.00063807, 0.00039101, 7.27200318, 0.99805048, 0.99897091, 0.49315503],
+                             [- 6.27264157, -0.00063794, 0.00039093, 7.27200363, 0.99805088, 0.99897112, 0.49315504],
+                             [- 6.27264188, -0.00063781, 0.00039085, 7.27200407, 0.99805129, 0.99897134, 0.49315507],
+                             [- 6.27264220, -0.00063768, 0.00039077, 7.27200452, 0.99805169, 0.99897155, 0.49315512],
+                             [- 6.27264251, -0.00063755, 0.00039069, 7.27200496, 0.99805209, 0.99897176, 0.49315517],
+                             [- 6.27264283, -0.00063742, 0.00039061, 7.27200541, 0.99805249, 0.99897197, 0.49315521],
+                             [- 6.27264314, -0.00063729, 0.00039053, 7.27200586, 0.99805289, 0.99897218, 0.49315529],
+                             [- 6.27264346, -0.00063716, 0.00039045, 7.27200630, 0.99805329, 0.99897240, 0.49315533],
+                             [- 6.27264377, -0.00063702, 0.00039037, 7.27200675, 0.99805369, 0.99897261, 0.49315538],
+                             [- 6.27264408, -0.00063689, 0.00039029, 7.27200719, 0.99805409, 0.99897282, 0.49315540],
+                             [- 6.27264440, -0.00063676, 0.00039021, 7.27200764, 0.99805450, 0.99897303, 0.49315545],
+                             [- 6.27264471, -0.00063663, 0.00039013, 7.27200808, 0.99805490, 0.99897324, 0.49315550],
+                             [- 6.27264502, -0.00063650, 0.00039005, 7.27200852, 0.99805530, 0.99897345, 0.49315556],
+                             [- 6.27264534, -0.00063637, 0.00038997, 7.27200897, 0.99805570, 0.99897366, 0.49315563],
+                             [- 6.27264565, -0.00063624, 0.00038989, 7.27200941, 0.99805610, 0.99897387, 0.49315563],
+                             [- 6.27264596, -0.00063611, 0.00038981, 7.27200986, 0.99805649, 0.99897409, 0.49315568],
+                             [- 6.27264628, -0.00063598, 0.00038973, 7.27201030, 0.99805689, 0.99897430, 0.49315572],
+                             [- 6.27264659, -0.00063585, 0.00038965, 7.27201074, 0.99805729, 0.99897451, 0.49315579],
+                             [- 6.27264690, -0.00063572, 0.00038957, 7.27201119, 0.99805769, 0.99897472, 0.49315582],
+                             [- 6.27264721, -0.00063559, 0.00038949, 7.27201163, 0.99805809, 0.99897493, 0.49315589],
+                             [- 6.27264753, -0.00063545, 0.00038941, 7.27201207, 0.99805849, 0.99897514, 0.49315595],
+                             [- 6.27264784, -0.00063532, 0.00038933, 7.27201251, 0.99805889, 0.99897535, 0.49315600],
+                             [- 6.27264815, -0.00063519, 0.00038925, 7.27201296, 0.99805929, 0.99897556, 0.49315603],
+                             [- 6.27264846, -0.00063506, 0.00038917, 7.27201340, 0.99805969, 0.99897577, 0.49315606],
+                             [- 6.27264877, -0.00063493, 0.00038909, 7.27201384, 0.99806008, 0.99897598, 0.49315609],
+                             [- 6.27264909, -0.00063480, 0.00038901, 7.27201428, 0.99806048, 0.99897619, 0.49315614],
+                             [- 6.27264940, -0.00063467, 0.00038893, 7.27201472, 0.99806088, 0.99897640, 0.49315621],
+                             [- 6.27264971, -0.00063454, 0.00038885, 7.27201517, 0.99806128, 0.99897661, 0.49315622],
+                             [- 6.27265002, -0.00063441, 0.00038877, 7.27201561, 0.99806168, 0.99897682, 0.49315632],
+                             [- 6.27265033, -0.00063428, 0.00038869, 7.27201605, 0.99806207, 0.99897703, 0.49315636],
+                             [- 6.27265064, -0.00063415, 0.00038861, 7.27201649, 0.99806247, 0.99897724, 0.49315639],
+                             [- 6.27265095, -0.00063402, 0.00038853, 7.27201693, 0.99806287, 0.99897745, 0.49315644],
+                             [- 6.27265126, -0.00063389, 0.00038845, 7.27201737, 0.99806326, 0.99897766, 0.49315648],
+                             [- 6.27265157, -0.00063376, 0.00038837, 7.27201781, 0.99806366, 0.99897787, 0.49315654],
+                             [- 6.27265189, -0.00063363, 0.00038829, 7.27201825, 0.99806406, 0.99897808, 0.49315656],
+                             [- 6.27265220, -0.00063350, 0.00038821, 7.27201869, 0.99806445, 0.99897829, 0.49315663],
+                             [- 6.27265251, -0.00063337, 0.00038813, 7.27201913, 0.99806485, 0.99897849, 0.49315664],
+                             [- 6.27265282, -0.00063324, 0.00038805, 7.27201957, 0.99806525, 0.99897870, 0.49315672],
+                             [- 6.27265313, -0.00063312, 0.00038797, 7.27202001, 0.99806564, 0.99897891, 0.49315678],
+                             [- 6.27265344, -0.00063299, 0.00038789, 7.27202045, 0.99806604, 0.99897912, 0.49315679],
+                             [- 6.27265375, -0.00063286, 0.00038781, 7.27202089, 0.99806643, 0.99897933, 0.49315682],
+                             [- 6.27265406, -0.00063273, 0.00038773, 7.27202133, 0.99806683, 0.99897954, 0.49315688],
+                             [- 6.27265436, -0.00063260, 0.00038765, 7.27202177, 0.99806722, 0.99897975, 0.49315697],
+                             [- 6.27265467, -0.00063247, 0.00038758, 7.27202221, 0.99806762, 0.99897996, 0.49315698],
+                             [- 6.27265498, -0.00063234, 0.00038750, 7.27202264, 0.99806801, 0.99898016, 0.49315705],
+                             [- 6.27265529, -0.00063221, 0.00038742, 7.27202308, 0.99806841, 0.99898037, 0.49315710],
+                             [- 6.27265560, -0.00063208, 0.00038734, 7.27202352, 0.99806880, 0.99898058, 0.49315714],
+                             [- 6.27265591, -0.00063195, 0.00038726, 7.27202396, 0.99806920, 0.99898079, 0.49315716],
+                             [- 6.27265622, -0.00063182, 0.00038718, 7.27202440, 0.99806959, 0.99898100, 0.49315722],
+                             [- 6.27265653, -0.00063169, 0.00038710, 7.27202483, 0.99806999, 0.99898121, 0.49315726],
+                             [- 6.27265684, -0.00063157, 0.00038702, 7.27202527, 0.99807038, 0.99898141, 0.49315731],
+                             [- 6.27265714, -0.00063144, 0.00038694, 7.27202571, 0.99807077, 0.99898162, 0.49315737],
+                             [- 6.27265745, -0.00063131, 0.00038686, 7.27202614, 0.99807117, 0.99898183, 0.49315740],
+                             [- 6.27265776, -0.00063118, 0.00038678, 7.27202658, 0.99807156, 0.99898204, 0.49315744],
+                             [- 6.27265807, -0.00063105, 0.00038671, 7.27202702, 0.99807195, 0.99898224, 0.49315747],
+                             [- 6.27265838, -0.00063092, 0.00038663, 7.27202745, 0.99807235, 0.99898245, 0.49315751],
+                             [- 6.27265868, -0.00063079, 0.00038655, 7.27202789, 0.99807274, 0.99898266, 0.49315758],
+                             [- 6.27265899, -0.00063066, 0.00038647, 7.27202833, 0.99807313, 0.99898287, 0.49315760],
+                             [- 6.27265930, -0.00063054, 0.00038639, 7.27202876, 0.99807353, 0.99898307, 0.49315770],
+                             [- 6.27265961, -0.00063041, 0.00038631, 7.27202920, 0.99807392, 0.99898328, 0.49315771],
+                             [- 6.27265991, -0.00063028, 0.00038623, 7.27202963, 0.99807431, 0.99898349, 0.49315780],
+                             [- 6.27266022, -0.00063015, 0.00038615, 7.27203007, 0.99807470, 0.99898369, 0.49315780],
+                             [- 6.27266053, -0.00063002, 0.00038608, 7.27203051, 0.99807510, 0.99898390, 0.49315786],
+                             [- 6.27266083, -0.00062989, 0.00038600, 7.27203094, 0.99807549, 0.99898411, 0.49315792],
+                             [- 6.27266114, -0.00062977, 0.00038592, 7.27203138, 0.99807588, 0.99898432, 0.49315794],
+                             [- 6.27266145, -0.00062964, 0.00038584, 7.27203181, 0.99807627, 0.99898452, 0.49315802],
+                             [- 6.27266175, -0.00062951, 0.00038576, 7.27203224, 0.99807666, 0.99898473, 0.49315805],
+                             [- 6.27266206, -0.00062938, 0.00038568, 7.27203268, 0.99807705, 0.99898493, 0.49315808],
+                             [- 6.27266237, -0.00062925, 0.00038560, 7.27203311, 0.99807744, 0.99898514, 0.49315812],
+                             [- 6.27266267, -0.00062913, 0.00038553, 7.27203355, 0.99807784, 0.99898535, 0.49315818],
+                             [- 6.27266298, -0.00062900, 0.00038545, 7.27203398, 0.99807823, 0.99898555, 0.49315821],
+                             [- 6.27266329, -0.00062887, 0.00038537, 7.27203441, 0.99807862, 0.99898576, 0.49315828],
+                             [- 6.27266359, -0.00062874, 0.00038529, 7.27203485, 0.99807901, 0.99898597, 0.49315830],
+                             [- 6.27266390, -0.00062862, 0.00038521, 7.27203528, 0.99807940, 0.99898617, 0.49315836],
+                             [- 6.27266420, -0.00062849, 0.00038513, 7.27203571, 0.99807979, 0.99898638, 0.49315841],
+                             [- 6.27266451, -0.00062836, 0.00038506, 7.27203615, 0.99808018, 0.99898658, 0.49315847],
+                             [- 6.27266481, -0.00062823, 0.00038498, 7.27203658, 0.99808057, 0.99898679, 0.49315850],
+                             [- 6.27266512, -0.00062811, 0.00038490, 7.27203701, 0.99808096, 0.99898700, 0.49315856],
+                             [- 6.27266542, -0.00062798, 0.00038482, 7.27203744, 0.99808135, 0.99898720, 0.49315859],
+                             [- 6.27266573, -0.00062785, 0.00038474, 7.27203788, 0.99808174, 0.99898741, 0.49315862],
+                             [- 6.27266603, -0.00062772, 0.00038467, 7.27203831, 0.99808213, 0.99898761, 0.49315867],
+                             [- 6.27266634, -0.00062760, 0.00038459, 7.27203874, 0.99808251, 0.99898782, 0.49315875],
+                             [- 6.27266664, -0.00062747, 0.00038451, 7.27203917, 0.99808290, 0.99898802, 0.49315880],
+                             [- 6.27266695, -0.00062734, 0.00038443, 7.27203960, 0.99808329, 0.99898823, 0.49315883],
+                             [- 6.27266725, -0.00062721, 0.00038435, 7.27204004, 0.99808368, 0.99898843, 0.49315887],
+                             [- 6.27266755, -0.00062709, 0.00038428, 7.27204047, 0.99808407, 0.99898864, 0.49315892],
+                             [- 6.27266786, -0.00062696, 0.00038420, 7.27204090, 0.99808446, 0.99898884, 0.49315895],
+                             [- 6.27266816, -0.00062683, 0.00038412, 7.27204133, 0.99808485, 0.99898905, 0.49315899],
+                             [- 6.27266847, -0.00062671, 0.00038404, 7.27204176, 0.99808523, 0.99898925, 0.49315906],
+                             [- 6.27266877, -0.00062658, 0.00038396, 7.27204219, 0.99808562, 0.99898946, 0.49315910],
+                             [- 6.27266907, -0.00062645, 0.00038389, 7.27204262, 0.99808601, 0.99898966, 0.49315911],
+                             [- 6.27266938, -0.00062633, 0.00038381, 7.27204305, 0.99808640, 0.99898987, 0.49315917],
+                             [- 6.27266968, -0.00062620, 0.00038373, 7.27204348, 0.99808678, 0.99899007, 0.49315922],
+                             [- 6.27266998, -0.00062607, 0.00038365, 7.27204391, 0.99808717, 0.99899027, 0.49315926],
+                             [- 6.27267028, -0.00062595, 0.00038358, 7.27204434, 0.99808756, 0.99899048, 0.49315930],
+                             [- 6.27267059, -0.00062582, 0.00038350, 7.27204477, 0.99808794, 0.99899068, 0.49315934],
+                             [- 6.27267089, -0.00062569, 0.00038342, 7.27204520, 0.99808833, 0.99899089, 0.49315940],
+                             [- 6.27267119, -0.00062557, 0.00038334, 7.27204563, 0.99808872, 0.99899109, 0.49315945],
+                             [- 6.27267150, -0.00062544, 0.00038327, 7.27204606, 0.99808910, 0.99899129, 0.49315950],
+                             [- 6.27267180, -0.00062531, 0.00038319, 7.27204648, 0.99808949, 0.99899150, 0.49315953],
+                             [- 6.27267210, -0.00062519, 0.00038311, 7.27204691, 0.99808988, 0.99899170, 0.49315956],
+                             [- 6.27267240, -0.00062506, 0.00038303, 7.27204734, 0.99809026, 0.99899191, 0.49315961],
+                             [- 6.27267270, -0.00062494, 0.00038296, 7.27204777, 0.99809065, 0.99899211, 0.49315968],
+                             [- 6.27267301, -0.00062481, 0.00038288, 7.27204820, 0.99809103, 0.99899231, 0.49315973],
+                             [- 6.27267331, -0.00062468, 0.00038280, 7.27204863, 0.99809142, 0.99899252, 0.49315977],
+                             [- 6.27267361, -0.00062456, 0.00038272, 7.27204905, 0.99809180, 0.99899272, 0.49315980],
+                             [- 6.27267391, -0.00062443, 0.00038265, 7.27204948, 0.99809219, 0.99899292, 0.49315984],
+                             [- 6.27267421, -0.00062431, 0.00038257, 7.27204991, 0.99809257, 0.99899313, 0.49315989],
+                             [- 6.27267451, -0.00062418, 0.00038249, 7.27205033, 0.99809296, 0.99899333, 0.49315993],
+                             [- 6.27267481, -0.00062405, 0.00038241, 7.27205076, 0.99809334, 0.99899353, 0.49315999],
+                             [- 6.27267512, -0.00062393, 0.00038234, 7.27205119, 0.99809373, 0.99899373, 0.49316004],
+                             [- 6.27267542, -0.00062380, 0.00038226, 7.27205162, 0.99809411, 0.99899394, 0.49316007],
+                             [- 6.27267572, -0.00062368, 0.00038218, 7.27205204, 0.99809450, 0.99899414, 0.49316011],
+                             [- 6.27267602, -0.00062355, 0.00038211, 7.27205247, 0.99809488, 0.99899434, 0.49316016],
+                             [- 6.27267632, -0.00062342, 0.00038203, 7.27205289, 0.99809527, 0.99899455, 0.49316020],
+                             [- 6.27267662, -0.00062330, 0.00038195, 7.27205332, 0.99809565, 0.99899475, 0.49316023],
+                             [- 6.27267692, -0.00062317, 0.00038188, 7.27205375, 0.99809603, 0.99899495, 0.49316033],
+                             [- 6.27267722, -0.00062305, 0.00038180, 7.27205417, 0.99809642, 0.99899515, 0.49316032],
+                             [- 6.27267752, -0.00062292, 0.00038172, 7.27205460, 0.99809680, 0.99899536, 0.49316037],
+                             [- 6.27267782, -0.00062280, 0.00038164, 7.27205502, 0.99809718, 0.99899556, 0.49316043],
+                             [- 6.27267812, -0.00062267, 0.00038157, 7.27205545, 0.99809757, 0.99899576, 0.49316049],
+                             [- 6.27267842, -0.00062255, 0.00038149, 7.27205587, 0.99809795, 0.99899596, 0.49316053],
+                             [- 6.27267872, -0.00062242, 0.00038141, 7.27205630, 0.99809833, 0.99899616, 0.49316060],
+                             [- 6.27267902, -0.00062230, 0.00038134, 7.27205672, 0.99809871, 0.99899637, 0.49316061],
+                             [- 6.27267932, -0.00062217, 0.00038126, 7.27205715, 0.99809910, 0.99899657, 0.49316068],
+                             [- 6.27267962, -0.00062205, 0.00038118, 7.27205757, 0.99809948, 0.99899677, 0.49316072],
+                             [- 6.27267992, -0.00062192, 0.00038111, 7.27205799, 0.99809986, 0.99899697, 0.49316074],
+                             [- 6.27268021, -0.00062180, 0.00038103, 7.27205842, 0.99810024, 0.99899717, 0.49316079],
+                             [- 6.27268051, -0.00062167, 0.00038095, 7.27205884, 0.99810062, 0.99899737, 0.49316083],
+                             [- 6.27268081, -0.00062155, 0.00038088, 7.27205927, 0.99810100, 0.99899757, 0.49316088],
+                             [- 6.27268111, -0.00062142, 0.00038080, 7.27205969, 0.99810139, 0.99899778, 0.49316090],
+                             [- 6.27268141, -0.00062130, 0.00038072, 7.27206011, 0.99810177, 0.99899798, 0.49316099],
+                             [- 6.27268171, -0.00062117, 0.00038065, 7.27206053, 0.99810215, 0.99899818, 0.49316102],
+                             [- 6.27268201, -0.00062105, 0.00038057, 7.27206096, 0.99810253, 0.99899838, 0.49316107],
+                             [- 6.27268230, -0.00062092, 0.00038050, 7.27206138, 0.99810291, 0.99899858, 0.49316107],
+                             [- 6.27268260, -0.00062080, 0.00038042, 7.27206180, 0.99810329, 0.99899878, 0.49316112],
+                             [- 6.27268290, -0.00062067, 0.00038034, 7.27206223, 0.99810367, 0.99899898, 0.49316121],
+                             [- 6.27268320, -0.00062055, 0.00038027, 7.27206265, 0.99810405, 0.99899918, 0.49316122],
+                             [- 6.27268350, -0.00062043, 0.00038019, 7.27206307, 0.99810443, 0.99899938, 0.49316127],
+                             [- 6.27268379, -0.00062030, 0.00038011, 7.27206349, 0.99810481, 0.99899958, 0.49316133],
+                             [- 6.27268409, -0.00062018, 0.00038004, 7.27206391, 0.99810519, 0.99899978, 0.49316137],
+                             [- 6.27268439, -0.00062005, 0.00037996, 7.27206433, 0.99810557, 0.99899999, 0.49316141],
+                             [- 6.27268468, -0.00061993, 0.00037989, 7.27206476, 0.99810595, 0.99900019, 0.49316145],
+                             [- 6.27268498, -0.00061980, 0.00037981, 7.27206518, 0.99810633, 0.99900039, 0.49316150],
+                             [- 6.27268528, -0.00061968, 0.00037973, 7.27206560, 0.99810671, 0.99900059, 0.49316152],
+                             [- 6.27268558, -0.00061956, 0.00037966, 7.27206602, 0.99810709, 0.99900079, 0.49316158],
+                             [- 6.27268587, -0.00061943, 0.00037958, 7.27206644, 0.99810747, 0.99900099, 0.49316160],
+                             [- 6.27268617, -0.00061931, 0.00037951, 7.27206686, 0.99810785, 0.99900119, 0.49316174],
+                             [- 6.27268647, -0.00061919, 0.00037943, 7.27206728, 0.99810823, 0.99900139, 0.49316174],
+                             [- 6.27268676, -0.00061906, 0.00037935, 7.27206770, 0.99810860, 0.99900159, 0.49316173],
+                             [- 6.27268706, -0.00061894, 0.00037928, 7.27206812, 0.99810898, 0.99900179, 0.49316182],
+                             [- 6.27268735, -0.00061881, 0.00037920, 7.27206854, 0.99810936, 0.99900198, 0.49316185],
+                             [- 6.27268765, -0.00061869, 0.00037913, 7.27206896, 0.99810974, 0.99900218, 0.49316190],
+                             [- 6.27268795, -0.00061857, 0.00037905, 7.27206938, 0.99811012, 0.99900238, 0.49316194],
+                             [- 6.27268824, -0.00061844, 0.00037897, 7.27206980, 0.99811049, 0.99900258, 0.49316199],
+                             [- 6.27268854, -0.00061832, 0.00037890, 7.27207022, 0.99811087, 0.99900278, 0.49316201],
+                             [- 6.27268883, -0.00061820, 0.00037882, 7.27207064, 0.99811125, 0.99900298, 0.49316207],
+                             [- 6.27268913, -0.00061807, 0.00037875, 7.27207106, 0.99811163, 0.99900318, 0.49316215],
+                             [- 6.27268942, -0.00061795, 0.00037867, 7.27207147, 0.99811200, 0.99900338, 0.49316215],
+                             [- 6.27268972, -0.00061783, 0.00037860, 7.27207189, 0.99811238, 0.99900358, 0.49316222],
+                             [- 6.27269001, -0.00061770, 0.00037852, 7.27207231, 0.99811276, 0.99900378, 0.49316225],
+                             [- 6.27269031, -0.00061758, 0.00037844, 7.27207273, 0.99811313, 0.99900398, 0.49316226],
+                             [- 6.27269060, -0.00061746, 0.00037837, 7.27207315, 0.99811351, 0.99900418, 0.49316232],
+                             [- 6.27269090, -0.00061733, 0.00037829, 7.27207356, 0.99811389, 0.99900437, 0.49316241],
+                             [- 6.27269119, -0.00061721, 0.00037822, 7.27207398, 0.99811426, 0.99900457, 0.49316240],
+                             [- 6.27269149, -0.00061709, 0.00037814, 7.27207440, 0.99811464, 0.99900477, 0.49316244],
+                             [- 6.27269178, -0.00061696, 0.00037807, 7.27207482, 0.99811502, 0.99900497, 0.49316250],
+                             [- 6.27269208, -0.00061684, 0.00037799, 7.27207523, 0.99811539, 0.99900517, 0.49316255],
+                             [- 6.27269237, -0.00061672, 0.00037792, 7.27207565, 0.99811577, 0.99900537, 0.49316260],
+                             [- 6.27269266, -0.00061660, 0.00037784, 7.27207607, 0.99811614, 0.99900556, 0.49316268],
+                             [- 6.27269296, -0.00061647, 0.00037777, 7.27207648, 0.99811652, 0.99900576, 0.49316264],
+                             [- 6.27269325, -0.00061635, 0.00037769, 7.27207690, 0.99811689, 0.99900596, 0.49316274],
+                             [- 6.27269354, -0.00061623, 0.00037762, 7.27207732, 0.99811727, 0.99900616, 0.49316275],
+                             [- 6.27269384, -0.00061610, 0.00037754, 7.27207773, 0.99811764, 0.99900636, 0.49316280],
+                             [- 6.27269413, -0.00061598, 0.00037746, 7.27207815, 0.99811802, 0.99900655, 0.49316280],
+                             [- 6.27269442, -0.00061586, 0.00037739, 7.27207857, 0.99811839, 0.99900675, 0.49316288],
+                             [- 6.27269472, -0.00061574, 0.00037731, 7.27207898, 0.99811877, 0.99900695, 0.49316293],
+                             [- 6.27269501, -0.00061561, 0.00037724, 7.27207940, 0.99811914, 0.99900715, 0.49316299],
+                             [- 6.27269530, -0.00061549, 0.00037716, 7.27207981, 0.99811952, 0.99900734, 0.49316305],
+                             [- 6.27269560, -0.00061537, 0.00037709, 7.27208023, 0.99811989, 0.99900754, 0.49316305],
+                             [- 6.27269589, -0.00061525, 0.00037701, 7.27208064, 0.99812026, 0.99900774, 0.49316309],
+                             [- 6.27269618, -0.00061512, 0.00037694, 7.27208106, 0.99812064, 0.99900794, 0.49316319],
+                             [- 6.27269647, -0.00061500, 0.00037686, 7.27208147, 0.99812101, 0.99900813, 0.49316320],
+                             [- 6.27269677, -0.00061488, 0.00037679, 7.27208189, 0.99812138, 0.99900833, 0.49316326],
+                             [- 6.27269706, -0.00061476, 0.00037671, 7.27208230, 0.99812176, 0.99900853, 0.49316331],
+                             [- 6.27269735, -0.00061464, 0.00037664, 7.27208271, 0.99812213, 0.99900872, 0.49316334],
+                             [- 6.27269764, -0.00061451, 0.00037656, 7.27208313, 0.99812250, 0.99900892, 0.49316337],
+                             [- 6.27269793, -0.00061439, 0.00037649, 7.27208354, 0.99812288, 0.99900912, 0.49316343],
+                             [- 6.27269823, -0.00061427, 0.00037642, 7.27208396, 0.99812325, 0.99900931, 0.49316350],
+                             [- 6.27269852, -0.00061415, 0.00037634, 7.27208437, 0.99812362, 0.99900951, 0.49316348],
+                             [- 6.27269881, -0.00061403, 0.00037627, 7.27208478, 0.99812399, 0.99900971, 0.49316356],
+                             [- 6.27269910, -0.00061390, 0.00037619, 7.27208520, 0.99812437, 0.99900990, 0.49316359],
+                             [- 6.27269939, -0.00061378, 0.00037612, 7.27208561, 0.99812474, 0.99901010, 0.49316364],
+                             [- 6.27269968, -0.00061366, 0.00037604, 7.27208602, 0.99812511, 0.99901030, 0.49316368],
+                             [- 6.27269997, -0.00061354, 0.00037597, 7.27208643, 0.99812548, 0.99901049, 0.49316372],
+                             [- 6.27270027, -0.00061342, 0.00037589, 7.27208685, 0.99812585, 0.99901069, 0.49316379],
+                             [- 6.27270056, -0.00061330, 0.00037582, 7.27208726, 0.99812623, 0.99901089, 0.49316380],
+                             [- 6.27270085, -0.00061318, 0.00037574, 7.27208767, 0.99812660, 0.99901108, 0.49316383],
+                             [- 6.27270114, -0.00061305, 0.00037567, 7.27208808, 0.99812697, 0.99901128, 0.49316392],
+                             [- 6.27270143, -0.00061293, 0.00037559, 7.27208850, 0.99812734, 0.99901147, 0.49316393],
+                             [- 6.27270172, -0.00061281, 0.00037552, 7.27208891, 0.99812771, 0.99901167, 0.49316398],
+                             [- 6.27270201, -0.00061269, 0.00037545, 7.27208932, 0.99812808, 0.99901186, 0.49316403],
+                             [- 6.27270230, -0.00061257, 0.00037537, 7.27208973, 0.99812845, 0.99901206, 0.49316407],
+                             [- 6.27270259, -0.00061245, 0.00037530, 7.27209014, 0.99812882, 0.99901226, 0.49316411],
+                             [- 6.27270288, -0.00061233, 0.00037522, 7.27209055, 0.99812919, 0.99901245, 0.49316419],
+                             [- 6.27270317, -0.00061221, 0.00037515, 7.27209096, 0.99812956, 0.99901265, 0.49316420],
+                             [- 6.27270346, -0.00061208, 0.00037507, 7.27209137, 0.99812993, 0.99901284, 0.49316424],
+                             [- 6.27270375, -0.00061196, 0.00037500, 7.27209178, 0.99813030, 0.99901304, 0.49316431],
+                             [- 6.27270404, -0.00061184, 0.00037493, 7.27209219, 0.99813067, 0.99901323, 0.49316432],
+                             [- 6.27270433, -0.00061172, 0.00037485, 7.27209260, 0.99813104, 0.99901343, 0.49316435],
+                             [- 6.27270462, -0.00061160, 0.00037478, 7.27209301, 0.99813141, 0.99901362, 0.49316437],
+                             [- 6.27270490, -0.00061148, 0.00037470, 7.27209342, 0.99813178, 0.99901382, 0.49316447],
+                             [- 6.27270519, -0.00061136, 0.00037463, 7.27209383, 0.99813215, 0.99901401, 0.49316452],
+                             [- 6.27270548, -0.00061124, 0.00037456, 7.27209424, 0.99813252, 0.99901421, 0.49316453],
+                             [- 6.27270577, -0.00061112, 0.00037448, 7.27209465, 0.99813289, 0.99901440, 0.49316460],
+                             [- 6.27270606, -0.00061100, 0.00037441, 7.27209506, 0.99813326, 0.99901460, 0.49316462],
+                             [- 6.27270635, -0.00061088, 0.00037433, 7.27209547, 0.99813362, 0.99901479, 0.49316468],
+                             [- 6.27270664, -0.00061076, 0.00037426, 7.27209588, 0.99813399, 0.99901498, 0.49316472],
+                             [- 6.27270692, -0.00061064, 0.00037419, 7.27209629, 0.99813436, 0.99901518, 0.49316476],
+                             [- 6.27270721, -0.00061051, 0.00037411, 7.27209670, 0.99813473, 0.99901537, 0.49316483],
+                             [- 6.27270750, -0.00061039, 0.00037404, 7.27209711, 0.99813510, 0.99901557, 0.49316482],
+                             [- 6.27270779, -0.00061027, 0.00037396, 7.27209751, 0.99813547, 0.99901576, 0.49316493],
+                             [- 6.27270808, -0.00061015, 0.00037389, 7.27209792, 0.99813583, 0.99901596, 0.49316495],
+                             [- 6.27270836, -0.00061003, 0.00037382, 7.27209833, 0.99813620, 0.99901615, 0.49316498],
+                             [- 6.27270865, -0.00060991, 0.00037374, 7.27209874, 0.99813657, 0.99901634, 0.49316501],
+                             [- 6.27270894, -0.00060979, 0.00037367, 7.27209915, 0.99813694, 0.99901654, 0.49316504],
+                             [- 6.27270923, -0.00060967, 0.00037360, 7.27209955, 0.99813730, 0.99901673, 0.49316509],
+                             [- 6.27270951, -0.00060955, 0.00037352, 7.27209996, 0.99813767, 0.99901692, 0.49316516],
+                             [- 6.27270980, -0.00060943, 0.00037345, 7.27210037, 0.99813804, 0.99901712, 0.49316521],
+                             [- 6.27271009, -0.00060931, 0.00037338, 7.27210078, 0.99813840, 0.99901731, 0.49316522],
+                             [- 6.27271038, -0.00060919, 0.00037330, 7.27210118, 0.99813877, 0.99901751, 0.49316529],
+                             [- 6.27271066, -0.00060907, 0.00037323, 7.27210159, 0.99813914, 0.99901770, 0.49316533],
+                             [- 6.27271095, -0.00060895, 0.00037315, 7.27210200, 0.99813950, 0.99901789, 0.49316538],
+                             [- 6.27271124, -0.00060883, 0.00037308, 7.27210240, 0.99813987, 0.99901808, 0.49316545],
+                             [- 6.27271152, -0.00060871, 0.00037301, 7.27210281, 0.99814023, 0.99901828, 0.49316550],
+                             [- 6.27271181, -0.00060859, 0.00037293, 7.27210321, 0.99814060, 0.99901847, 0.49316550],
+                             [- 6.27271209, -0.00060847, 0.00037286, 7.27210362, 0.99814097, 0.99901866, 0.49316554],
+                             [- 6.27271238, -0.00060836, 0.00037279, 7.27210403, 0.99814133, 0.99901886, 0.49316555],
+                             [- 6.27271267, -0.00060824, 0.00037271, 7.27210443, 0.99814170, 0.99901905, 0.49316564],
+                             [- 6.27271295, -0.00060812, 0.00037264, 7.27210484, 0.99814206, 0.99901924, 0.49316569],
+                             [- 6.27271324, -0.00060800, 0.00037257, 7.27210524, 0.99814243, 0.99901944, 0.49316569],
+                             [- 6.27271352, -0.00060788, 0.00037249, 7.27210565, 0.99814279, 0.99901963, 0.49316572],
+                             [- 6.27271381, -0.00060776, 0.00037242, 7.27210605, 0.99814316, 0.99901982, 0.49316582],
+                             [- 6.27271410, -0.00060764, 0.00037235, 7.27210646, 0.99814352, 0.99902001, 0.49316585],
+                             [- 6.27271438, -0.00060752, 0.00037228, 7.27210686, 0.99814389, 0.99902021, 0.49316587],
+                             [- 6.27271467, -0.00060740, 0.00037220, 7.27210727, 0.99814425, 0.99902040, 0.49316592],
+                             [- 6.27271495, -0.00060728, 0.00037213, 7.27210767, 0.99814461, 0.99902059, 0.49316598],
+                             [- 6.27271524, -0.00060716, 0.00037206, 7.27210807, 0.99814498, 0.99902078, 0.49316599],
+                             [- 6.27271552, -0.00060704, 0.00037198, 7.27210848, 0.99814534, 0.99902097, 0.49316604],
+                             [- 6.27271581, -0.00060692, 0.00037191, 7.27210888, 0.99814571, 0.99902117, 0.49316608],
+                             [- 6.27271609, -0.00060680, 0.00037184, 7.27210929, 0.99814607, 0.99902136, 0.49316611],
+                             [- 6.27271637, -0.00060669, 0.00037176, 7.27210969, 0.99814643, 0.99902155, 0.49316616],
+                             [- 6.27271666, -0.00060657, 0.00037169, 7.27211009, 0.99814680, 0.99902174, 0.49316618],
+                             [- 6.27271694, -0.00060645, 0.00037162, 7.27211050, 0.99814716, 0.99902193, 0.49316624],
+                             [- 6.27271723, -0.00060633, 0.00037155, 7.27211090, 0.99814752, 0.99902213, 0.49316630],
+                             [- 6.27271751, -0.00060621, 0.00037147, 7.27211130, 0.99814789, 0.99902232, 0.49316633],
+                             [- 6.27271780, -0.00060609, 0.00037140, 7.27211170, 0.99814825, 0.99902251, 0.49316640],
+                             [- 6.27271808, -0.00060597, 0.00037133, 7.27211211, 0.99814861, 0.99902270, 0.49316642],
+                             [- 6.27271836, -0.00060585, 0.00037125, 7.27211251, 0.99814897, 0.99902289, 0.49316649],
+                             [- 6.27271865, -0.00060574, 0.00037118, 7.27211291, 0.99814934, 0.99902308, 0.49316653],
+                             [- 6.27271893, -0.00060562, 0.00037111, 7.27211331, 0.99814970, 0.99902327, 0.49316657],
+                             [- 6.27271921, -0.00060550, 0.00037104, 7.27211371, 0.99815006, 0.99902346, 0.49316659],
+                             [- 6.27271950, -0.00060538, 0.00037096, 7.27211412, 0.99815042, 0.99902366, 0.49316664],
+                             [- 6.27271978, -0.00060526, 0.00037089, 7.27211452, 0.99815079, 0.99902385, 0.49316670],
+                             [- 6.27272006, -0.00060514, 0.00037082, 7.27211492, 0.99815115, 0.99902404, 0.49316670],
+                             [- 6.27272035, -0.00060503, 0.00037075, 7.27211532, 0.99815151, 0.99902423, 0.49316673],
+                             [- 6.27272063, -0.00060491, 0.00037067, 7.27211572, 0.99815187, 0.99902442, 0.49316679],
+                             [- 6.27272091, -0.00060479, 0.00037060, 7.27211612, 0.99815223, 0.99902461, 0.49316685],
+                             [- 6.27272120, -0.00060467, 0.00037053, 7.27211652, 0.99815259, 0.99902480, 0.49316688],
+                             [- 6.27272148, -0.00060455, 0.00037046, 7.27211692, 0.99815295, 0.99902499, 0.49316692],
+                             [- 6.27272176, -0.00060444, 0.00037038, 7.27211732, 0.99815331, 0.99902518, 0.49316699],
+                             [- 6.27272204, -0.00060432, 0.00037031, 7.27211773, 0.99815367, 0.99902537, 0.49316698],
+                             [- 6.27272232, -0.00060420, 0.00037024, 7.27211813, 0.99815404, 0.99902556, 0.49316707],
+                             [- 6.27272261, -0.00060408, 0.00037017, 7.27211853, 0.99815440, 0.99902575, 0.49316710],
+                             [- 6.27272289, -0.00060396, 0.00037009, 7.27211893, 0.99815476, 0.99902594, 0.49316715],
+                             [- 6.27272317, -0.00060385, 0.00037002, 7.27211933, 0.99815512, 0.99902613, 0.49316718],
+                             [- 6.27272345, -0.00060373, 0.00036995, 7.27211972, 0.99815548, 0.99902632, 0.49316722],
+                             [- 6.27272373, -0.00060361, 0.00036988, 7.27212012, 0.99815584, 0.99902651, 0.49316726],
+                             [- 6.27272402, -0.00060349, 0.00036981, 7.27212052, 0.99815620, 0.99902670, 0.49316729],
+                             [- 6.27272430, -0.00060337, 0.00036973, 7.27212092, 0.99815656, 0.99902689, 0.49316735],
+                             [- 6.27272458, -0.00060326, 0.00036966, 7.27212132, 0.99815691, 0.99902708, 0.49316741],
+                             [- 6.27272486, -0.00060314, 0.00036959, 7.27212172, 0.99815727, 0.99902727, 0.49316741],
+                             [- 6.27272514, -0.00060302, 0.00036952, 7.27212212, 0.99815763, 0.99902746, 0.49316748],
+                             [- 6.27272542, -0.00060290, 0.00036945, 7.27212252, 0.99815799, 0.99902765, 0.49316753],
+                             [- 6.27272570, -0.00060279, 0.00036937, 7.27212292, 0.99815835, 0.99902784, 0.49316756],
+                             [- 6.27272598, -0.00060267, 0.00036930, 7.27212331, 0.99815871, 0.99902803, 0.49316761],
+                             [- 6.27272626, -0.00060255, 0.00036923, 7.27212371, 0.99815907, 0.99902822, 0.49316767],
+                             [- 6.27272654, -0.00060244, 0.00036916, 7.27212411, 0.99815943, 0.99902841, 0.49316768],
+                             [- 6.27272683, -0.00060232, 0.00036909, 7.27212451, 0.99815978, 0.99902860, 0.49316772],
+                             [- 6.27272711, -0.00060220, 0.00036901, 7.27212490, 0.99816014, 0.99902879, 0.49316778],
+                             [- 6.27272739, -0.00060208, 0.00036894, 7.27212530, 0.99816050, 0.99902897, 0.49316778],
+                             [- 6.27272767, -0.00060197, 0.00036887, 7.27212570, 0.99816086, 0.99902916, 0.49316783],
+                             [- 6.27272795, -0.00060185, 0.00036880, 7.27212610, 0.99816122, 0.99902935, 0.49316788],
+                             [- 6.27272823, -0.00060173, 0.00036873, 7.27212649, 0.99816157, 0.99902954, 0.49316787],
+                             [- 6.27272851, -0.00060162, 0.00036865, 7.27212689, 0.99816193, 0.99902973, 0.49316799],
+                             [- 6.27272879, -0.00060150, 0.00036858, 7.27212729, 0.99816229, 0.99902992, 0.49316801],
+                             [- 6.27272907, -0.00060138, 0.00036851, 7.27212768, 0.99816265, 0.99903011, 0.49316805],
+                             [- 6.27272934, -0.00060127, 0.00036844, 7.27212808, 0.99816300, 0.99903029, 0.49316810],
+                             [- 6.27272962, -0.00060115, 0.00036837, 7.27212848, 0.99816336, 0.99903048, 0.49316812],
+                             [- 6.27272990, -0.00060103, 0.00036830, 7.27212887, 0.99816372, 0.99903067, 0.49316815],
+                             [- 6.27273018, -0.00060092, 0.00036823, 7.27212927, 0.99816407, 0.99903086, 0.49316824],
+                             [- 6.27273046, -0.00060080, 0.00036815, 7.27212966, 0.99816443, 0.99903105, 0.49316825],
+                             [- 6.27273074, -0.00060068, 0.00036808, 7.27213006, 0.99816479, 0.99903124, 0.49316832],
+                             [- 6.27273102, -0.00060057, 0.00036801, 7.27213045, 0.99816514, 0.99903142, 0.49316835],
+                             [- 6.27273130, -0.00060045, 0.00036794, 7.27213085, 0.99816550, 0.99903161, 0.49316839],
+                             [- 6.27273158, -0.00060033, 0.00036787, 7.27213124, 0.99816585, 0.99903180, 0.49316844],
+                             [- 6.27273186, -0.00060022, 0.00036780, 7.27213164, 0.99816621, 0.99903199, 0.49316848],
+                             [- 6.27273213, -0.00060010, 0.00036773, 7.27213203, 0.99816657, 0.99903218, 0.49316850],
+                             [- 6.27273241, -0.00059998, 0.00036765, 7.27213243, 0.99816692, 0.99903236, 0.49316856],
+                             [- 6.27273269, -0.00059987, 0.00036758, 7.27213282, 0.99816728, 0.99903255, 0.49316861],
+                             [- 6.27273297, -0.00059975, 0.00036751, 7.27213322, 0.99816763, 0.99903274, 0.49316864],
+                             [- 6.27273325, -0.00059963, 0.00036744, 7.27213361, 0.99816799, 0.99903293, 0.49316869],
+                             [- 6.27273352, -0.00059952, 0.00036737, 7.27213401, 0.99816834, 0.99903311, 0.49316872],
+                             [- 6.27273380, -0.00059940, 0.00036730, 7.27213440, 0.99816870, 0.99903330, 0.49316876],
+                             [- 6.27273408, -0.00059929, 0.00036723, 7.27213479, 0.99816905, 0.99903349, 0.49316877],
+                             [- 6.27273436, -0.00059917, 0.00036716, 7.27213519, 0.99816941, 0.99903367, 0.49316887],
+                             [- 6.27273463, -0.00059905, 0.00036708, 7.27213558, 0.99816976, 0.99903386, 0.49316888],
+                             [- 6.27273491, -0.00059894, 0.00036701, 7.27213597, 0.99817012, 0.99903405, 0.49316895],
+                             [- 6.27273519, -0.00059882, 0.00036694, 7.27213637, 0.99817047, 0.99903424, 0.49316897],
+                             [- 6.27273547, -0.00059871, 0.00036687, 7.27213676, 0.99817082, 0.99903442, 0.49316901],
+                             [- 6.27273574, -0.00059859, 0.00036680, 7.27213715, 0.99817118, 0.99903461, 0.49316906],
+                             [- 6.27273602, -0.00059848, 0.00036673, 7.27213754, 0.99817153, 0.99903480, 0.49316911],
+                             [- 6.27273630, -0.00059836, 0.00036666, 7.27213794, 0.99817189, 0.99903498, 0.49316913],
+                             [- 6.27273657, -0.00059824, 0.00036659, 7.27213833, 0.99817224, 0.99903517, 0.49316914],
+                             [- 6.27273685, -0.00059813, 0.00036652, 7.27213872, 0.99817259, 0.99903535, 0.49316924],
+                             [- 6.27273713, -0.00059801, 0.00036645, 7.27213911, 0.99817295, 0.99903554, 0.49316926],
+                             [- 6.27273740, -0.00059790, 0.00036637, 7.27213951, 0.99817330, 0.99903573, 0.49316930],
+                             [- 6.27273768, -0.00059778, 0.00036630, 7.27213990, 0.99817365, 0.99903591, 0.49316938],
+                             [- 6.27273796, -0.00059767, 0.00036623, 7.27214029, 0.99817400, 0.99903610, 0.49316938],
+                             [- 6.27273823, -0.00059755, 0.00036616, 7.27214068, 0.99817436, 0.99903629, 0.49316938],
+                             [- 6.27273851, -0.00059744, 0.00036609, 7.27214107, 0.99817471, 0.99903647, 0.49316946],
+                             [- 6.27273878, -0.00059732, 0.00036602, 7.27214146, 0.99817506, 0.99903666, 0.49316948],
+                             [- 6.27273906, -0.00059721, 0.00036595, 7.27214185, 0.99817541, 0.99903684, 0.49316954],
+                             [- 6.27273933, -0.00059709, 0.00036588, 7.27214224, 0.99817577, 0.99903703, 0.49316961],
+                             [- 6.27273961, -0.00059698, 0.00036581, 7.27214263, 0.99817612, 0.99903722, 0.49316964],
+                             [- 6.27273989, -0.00059686, 0.00036574, 7.27214303, 0.99817647, 0.99903740, 0.49316966],
+                             [- 6.27274016, -0.00059674, 0.00036567, 7.27214342, 0.99817682, 0.99903759, 0.49316973],
+                             [- 6.27274044, -0.00059663, 0.00036560, 7.27214381, 0.99817717, 0.99903777, 0.49316976],
+                             [- 6.27274071, -0.00059651, 0.00036553, 7.27214420, 0.99817752, 0.99903796, 0.49316978],
+                             [- 6.27274099, -0.00059640, 0.00036546, 7.27214459, 0.99817788, 0.99903814, 0.49316985],
+                             [- 6.27274126, -0.00059629, 0.00036539, 7.27214498, 0.99817823, 0.99903833, 0.49316985],
+                             [- 6.27274154, -0.00059617, 0.00036532, 7.27214537, 0.99817858, 0.99903851, 0.49316990],
+                             [- 6.27274181, -0.00059606, 0.00036525, 7.27214575, 0.99817893, 0.99903870, 0.49316996],
+                             [- 6.27274208, -0.00059594, 0.00036517, 7.27214614, 0.99817928, 0.99903888, 0.49317001],
+                             [- 6.27274236, -0.00059583, 0.00036510, 7.27214653, 0.99817963, 0.99903907, 0.49317000],
+                             [- 6.27274263, -0.00059571, 0.00036503, 7.27214692, 0.99817998, 0.99903925, 0.49317004],
+                             [- 6.27274291, -0.00059560, 0.00036496, 7.27214731, 0.99818033, 0.99903944, 0.49317008],
+                             [- 6.27274318, -0.00059548, 0.00036489, 7.27214770, 0.99818068, 0.99903962, 0.49317014],
+                             [- 6.27274346, -0.00059537, 0.00036482, 7.27214809, 0.99818103, 0.99903981, 0.49317022],
+                             [- 6.27274373, -0.00059525, 0.00036475, 7.27214848, 0.99818138, 0.99903999, 0.49317024],
+                             [- 6.27274400, -0.00059514, 0.00036468, 7.27214886, 0.99818173, 0.99904018, 0.49317029],
+                             [- 6.27274428, -0.00059502, 0.00036461, 7.27214925, 0.99818208, 0.99904036, 0.49317032],
+                             [- 6.27274455, -0.00059491, 0.00036454, 7.27214964, 0.99818243, 0.99904055, 0.49317037],
+                             [- 6.27274482, -0.00059480, 0.00036447, 7.27215003, 0.99818278, 0.99904073, 0.49317042],
+                             [- 6.27274510, -0.00059468, 0.00036440, 7.27215042, 0.99818313, 0.99904092, 0.49317048],
+                             [- 6.27274537, -0.00059457, 0.00036433, 7.27215080, 0.99818348, 0.99904110, 0.49317047],
+                             [- 6.27274564, -0.00059445, 0.00036426, 7.27215119, 0.99818383, 0.99904128, 0.49317056],
+                             [- 6.27274592, -0.00059434, 0.00036419, 7.27215158, 0.99818418, 0.99904147, 0.49317055],
+                             [- 6.27274619, -0.00059422, 0.00036412, 7.27215197, 0.99818452, 0.99904165, 0.49317062],
+                             [- 6.27274646, -0.00059411, 0.00036405, 7.27215235, 0.99818487, 0.99904184, 0.49317064],
+                             [- 6.27274674, -0.00059400, 0.00036398, 7.27215274, 0.99818522, 0.99904202, 0.49317066],
+                             [- 6.27274701, -0.00059388, 0.00036391, 7.27215313, 0.99818557, 0.99904220, 0.49317073],
+                             [- 6.27274728, -0.00059377, 0.00036384, 7.27215351, 0.99818592, 0.99904239, 0.49317076],
+                             [- 6.27274755, -0.00059365, 0.00036377, 7.27215390, 0.99818627, 0.99904257, 0.49317082],
+                             [- 6.27274783, -0.00059354, 0.00036370, 7.27215428, 0.99818661, 0.99904276, 0.49317086],
+                             [- 6.27274810, -0.00059343, 0.00036363, 7.27215467, 0.99818696, 0.99904294, 0.49317091],
+                             [- 6.27274837, -0.00059331, 0.00036356, 7.27215506, 0.99818731, 0.99904312, 0.49317096],
+                             [- 6.27274864, -0.00059320, 0.00036349, 7.27215544, 0.99818766, 0.99904331, 0.49317092],
+                             [- 6.27274891, -0.00059309, 0.00036342, 7.27215583, 0.99818800, 0.99904349, 0.49317097],
+                             [- 6.27274919, -0.00059297, 0.00036335, 7.27215621, 0.99818835, 0.99904367, 0.49317108],
+                             [- 6.27274946, -0.00059286, 0.00036329, 7.27215660, 0.99818870, 0.99904386, 0.49317108],
+                             [- 6.27274973, -0.00059275, 0.00036322, 7.27215698, 0.99818905, 0.99904404, 0.49317113],
+                             [- 6.27275000, -0.00059263, 0.00036315, 7.27215737, 0.99818939, 0.99904422, 0.49317119],
+                             [- 6.27275027, -0.00059252, 0.00036308, 7.27215775, 0.99818974, 0.99904440, 0.49317125],
+                             [- 6.27275054, -0.00059241, 0.00036301, 7.27215814, 0.99819009, 0.99904459, 0.49317124],
+                             [- 6.27275081, -0.00059229, 0.00036294, 7.27215852, 0.99819043, 0.99904477, 0.49317130],
+                             [- 6.27275109, -0.00059218, 0.00036287, 7.27215891, 0.99819078, 0.99904495, 0.49317131],
+                             [- 6.27275136, -0.00059207, 0.00036280, 7.27215929, 0.99819113, 0.99904514, 0.49317136],
+                             [- 6.27275163, -0.00059195, 0.00036273, 7.27215968, 0.99819147, 0.99904532, 0.49317137],
+                             [- 6.27275190, -0.00059184, 0.00036266, 7.27216006, 0.99819182, 0.99904550, 0.49317148],
+                             [- 6.27275217, -0.00059173, 0.00036259, 7.27216044, 0.99819216, 0.99904568, 0.49317152],
+                             [- 6.27275244, -0.00059161, 0.00036252, 7.27216083, 0.99819251, 0.99904587, 0.49317157],
+                             [- 6.27275271, -0.00059150, 0.00036245, 7.27216121, 0.99819285, 0.99904605, 0.49317157],
+                             [- 6.27275298, -0.00059139, 0.00036238, 7.27216159, 0.99819320, 0.99904623, 0.49317163],
+                             [- 6.27275325, -0.00059127, 0.00036231, 7.27216198, 0.99819355, 0.99904641, 0.49317168],
+                             [- 6.27275352, -0.00059116, 0.00036224, 7.27216236, 0.99819389, 0.99904660, 0.49317166],
+                             [- 6.27275379, -0.00059105, 0.00036217, 7.27216274, 0.99819424, 0.99904678, 0.49317177],
+                             [- 6.27275406, -0.00059094, 0.00036211, 7.27216313, 0.99819458, 0.99904696, 0.49317179],
+                             [- 6.27275433, -0.00059082, 0.00036204, 7.27216351, 0.99819493, 0.99904714, 0.49317185],
+                             [- 6.27275460, -0.00059071, 0.00036197, 7.27216389, 0.99819527, 0.99904732, 0.49317189],
+                             [- 6.27275487, -0.00059060, 0.00036190, 7.27216427, 0.99819561, 0.99904751, 0.49317188],
+                             [- 6.27275514, -0.00059048, 0.00036183, 7.27216466, 0.99819596, 0.99904769, 0.49317197],
+                             [- 6.27275541, -0.00059037, 0.00036176, 7.27216504, 0.99819630, 0.99904787, 0.49317199],
+                             [- 6.27275568, -0.00059026, 0.00036169, 7.27216542, 0.99819665, 0.99904805, 0.49317206],
+                             [- 6.27275595, -0.00059015, 0.00036162, 7.27216580, 0.99819699, 0.99904823, 0.49317206],
+                             [- 6.27275622, -0.00059003, 0.00036155, 7.27216618, 0.99819733, 0.99904841, 0.49317210],
+                             [- 6.27275649, -0.00058992, 0.00036148, 7.27216656, 0.99819768, 0.99904859, 0.49317215],
+                             [- 6.27275675, -0.00058981, 0.00036141, 7.27216695, 0.99819802, 0.99904878, 0.49317218],
+                             [- 6.27275702, -0.00058970, 0.00036135, 7.27216733, 0.99819837, 0.99904896, 0.49317220],
+                             [- 6.27275729, -0.00058958, 0.00036128, 7.27216771, 0.99819871, 0.99904914, 0.49317224],
+                             [- 6.27275756, -0.00058947, 0.00036121, 7.27216809, 0.99819905, 0.99904932, 0.49317231],
+                             [- 6.27275783, -0.00058936, 0.00036114, 7.27216847, 0.99819939, 0.99904950, 0.49317228],
+                             [- 6.27275810, -0.00058925, 0.00036107, 7.27216885, 0.99819974, 0.99904968, 0.49317238],
+                             [- 6.27275837, -0.00058914, 0.00036100, 7.27216923, 0.99820008, 0.99904986, 0.49317241],
+                             [- 6.27275863, -0.00058902, 0.00036093, 7.27216961, 0.99820042, 0.99905004, 0.49317245],
+                             [- 6.27275890, -0.00058891, 0.00036086, 7.27216999, 0.99820077, 0.99905022, 0.49317253],
+                             [- 6.27275917, -0.00058880, 0.00036080, 7.27217037, 0.99820111, 0.99905040, 0.49317256],
+                             [- 6.27275944, -0.00058869, 0.00036073, 7.27217075, 0.99820145, 0.99905059, 0.49317260],
+                             [- 6.27275971, -0.00058858, 0.00036066, 7.27217113, 0.99820179, 0.99905077, 0.49317263],
+                             [- 6.27275997, -0.00058846, 0.00036059, 7.27217151, 0.99820213, 0.99905095, 0.49317270],
+                             [- 6.27276024, -0.00058835, 0.00036052, 7.27217189, 0.99820248, 0.99905113, 0.49317272],
+                             [- 6.27276051, -0.00058824, 0.00036045, 7.27217227, 0.99820282, 0.99905131, 0.49317275],
+                             [- 6.27276078, -0.00058813, 0.00036038, 7.27217265, 0.99820316, 0.99905149, 0.49317277],
+                             [- 6.27276104, -0.00058802, 0.00036032, 7.27217303, 0.99820350, 0.99905167, 0.49317281],
+                             [- 6.27276131, -0.00058790, 0.00036025, 7.27217341, 0.99820384, 0.99905185, 0.49317287],
+                             [- 6.27276158, -0.00058779, 0.00036018, 7.27217378, 0.99820418, 0.99905203, 0.49317289],
+                             [- 6.27276184, -0.00058768, 0.00036011, 7.27217416, 0.99820453, 0.99905221, 0.49317299],
+                             [- 6.27276211, -0.00058757, 0.00036004, 7.27217454, 0.99820487, 0.99905239, 0.49317296],
+                             [- 6.27276238, -0.00058746, 0.00035997, 7.27217492, 0.99820521, 0.99905257, 0.49317302],
+                             [- 6.27276265, -0.00058735, 0.00035991, 7.27217530, 0.99820555, 0.99905275, 0.49317307],
+                             [- 6.27276291, -0.00058724, 0.00035984, 7.27217568, 0.99820589, 0.99905293, 0.49317310],
+                             [- 6.27276318, -0.00058712, 0.00035977, 7.27217605, 0.99820623, 0.99905311, 0.49317316],
+                             [- 6.27276344, -0.00058701, 0.00035970, 7.27217643, 0.99820657, 0.99905329, 0.49317319],
+                             [- 6.27276371, -0.00058690, 0.00035963, 7.27217681, 0.99820691, 0.99905347, 0.49317321],
+                             [- 6.27276398, -0.00058679, 0.00035956, 7.27217719, 0.99820725, 0.99905365, 0.49317328],
+                             [- 6.27276424, -0.00058668, 0.00035950, 7.27217756, 0.99820759, 0.99905383, 0.49317329],
+                             [- 6.27276451, -0.00058657, 0.00035943, 7.27217794, 0.99820793, 0.99905400, 0.49317335],
+                             [- 6.27276478, -0.00058646, 0.00035936, 7.27217832, 0.99820827, 0.99905418, 0.49317337],
+                             [- 6.27276504, -0.00058635, 0.00035929, 7.27217870, 0.99820861, 0.99905436, 0.49317339],
+                             [- 6.27276531, -0.00058623, 0.00035922, 7.27217907, 0.99820895, 0.99905454, 0.49317346],
+                             [- 6.27276557, -0.00058612, 0.00035916, 7.27217945, 0.99820929, 0.99905472, 0.49317350],
+                             [- 6.27276584, -0.00058601, 0.00035909, 7.27217982, 0.99820963, 0.99905490, 0.49317354],
+                             [- 6.27276610, -0.00058590, 0.00035902, 7.27218020, 0.99820997, 0.99905508, 0.49317358],
+                             [- 6.27276637, -0.00058579, 0.00035895, 7.27218058, 0.99821030, 0.99905526, 0.49317361],
+                             [- 6.27276663, -0.00058568, 0.00035888, 7.27218095, 0.99821064, 0.99905544, 0.49317361],
+                             [- 6.27276690, -0.00058557, 0.00035882, 7.27218133, 0.99821098, 0.99905562, 0.49317370],
+                             [- 6.27276716, -0.00058546, 0.00035875, 7.27218170, 0.99821132, 0.99905579, 0.49317372],
+                             [- 6.27276743, -0.00058535, 0.00035868, 7.27218208, 0.99821166, 0.99905597, 0.49317378],
+                             [- 6.27276769, -0.00058524, 0.00035861, 7.27218246, 0.99821200, 0.99905615, 0.49317376],
+                             [- 6.27276796, -0.00058513, 0.00035854, 7.27218283, 0.99821233, 0.99905633, 0.49317387],
+                             [- 6.27276822, -0.00058502, 0.00035848, 7.27218321, 0.99821267, 0.99905651, 0.49317387],
+                             [- 6.27276849, -0.00058491, 0.00035841, 7.27218358, 0.99821301, 0.99905669, 0.49317394],
+                             [- 6.27276875, -0.00058480, 0.00035834, 7.27218396, 0.99821335, 0.99905686, 0.49317397],
+                             [- 6.27276902, -0.00058468, 0.00035827, 7.27218433, 0.99821369, 0.99905704, 0.49317398],
+                             [- 6.27276928, -0.00058457, 0.00035820, 7.27218471, 0.99821402, 0.99905722, 0.49317402],
+                             [- 6.27276954, -0.00058446, 0.00035814, 7.27218508, 0.99821436, 0.99905740, 0.49317408],
+                             [- 6.27276981, -0.00058435, 0.00035807, 7.27218545, 0.99821470, 0.99905758, 0.49317410],
+                             [- 6.27277007, -0.00058424, 0.00035800, 7.27218583, 0.99821504, 0.99905775, 0.49317417],
+                             [- 6.27277034, -0.00058413, 0.00035793, 7.27218620, 0.99821537, 0.99905793, 0.49317422],
+                             [- 6.27277060, -0.00058402, 0.00035787, 7.27218658, 0.99821571, 0.99905811, 0.49317425],
+                             [- 6.27277086, -0.00058391, 0.00035780, 7.27218695, 0.99821605, 0.99905829, 0.49317429],
+                             [- 6.27277113, -0.00058380, 0.00035773, 7.27218732, 0.99821638, 0.99905847, 0.49317428],
+                             [- 6.27277139, -0.00058369, 0.00035766, 7.27218770, 0.99821672, 0.99905864, 0.49317437],
+                             [- 6.27277165, -0.00058358, 0.00035760, 7.27218807, 0.99821706, 0.99905882, 0.49317446],
+                             [- 6.27277192, -0.00058347, 0.00035753, 7.27218844, 0.99821739, 0.99905900, 0.49317445],
+                             [- 6.27277218, -0.00058336, 0.00035746, 7.27218882, 0.99821773, 0.99905918, 0.49317449],
+                             [- 6.27277244, -0.00058325, 0.00035739, 7.27218919, 0.99821806, 0.99905935, 0.49317453],
+                             [- 6.27277270, -0.00058314, 0.00035733, 7.27218956, 0.99821840, 0.99905953, 0.49317457],
+                             [- 6.27277297, -0.00058303, 0.00035726, 7.27218993, 0.99821874, 0.99905971, 0.49317458],
+                             [- 6.27277323, -0.00058292, 0.00035719, 7.27219031, 0.99821907, 0.99905988, 0.49317467],
+                             [- 6.27277349, -0.00058281, 0.00035712, 7.27219068, 0.99821941, 0.99906006, 0.49317464],
+                             [- 6.27277376, -0.00058270, 0.00035706, 7.27219105, 0.99821974, 0.99906024, 0.49317472],
+                             [- 6.27277402, -0.00058259, 0.00035699, 7.27219142, 0.99822008, 0.99906042, 0.49317476],
+                             [- 6.27277428, -0.00058248, 0.00035692, 7.27219180, 0.99822041, 0.99906059, 0.49317478],
+                             [- 6.27277454, -0.00058237, 0.00035686, 7.27219217, 0.99822075, 0.99906077, 0.49317481],
+                             [- 6.27277480, -0.00058227, 0.00035679, 7.27219254, 0.99822108, 0.99906095, 0.49317486],
+                             [- 6.27277507, -0.00058216, 0.00035672, 7.27219291, 0.99822142, 0.99906112, 0.49317492],
+                             [- 6.27277533, -0.00058205, 0.00035665, 7.27219328, 0.99822175, 0.99906130, 0.49317497],
+                             [- 6.27277559, -0.00058194, 0.00035659, 7.27219365, 0.99822209, 0.99906148, 0.49317500],
+                             [- 6.27277585, -0.00058183, 0.00035652, 7.27219402, 0.99822242, 0.99906165, 0.49317504],
+                             [- 6.27277611, -0.00058172, 0.00035645, 7.27219440, 0.99822275, 0.99906183, 0.49317502],
+                             [- 6.27277637, -0.00058161, 0.00035639, 7.27219477, 0.99822309, 0.99906200, 0.49317510],
+                             [- 6.27277664, -0.00058150, 0.00035632, 7.27219514, 0.99822342, 0.99906218, 0.49317515],
+                             [- 6.27277690, -0.00058139, 0.00035625, 7.27219551, 0.99822376, 0.99906236, 0.49317515],
+                             [- 6.27277716, -0.00058128, 0.00035619, 7.27219588, 0.99822409, 0.99906253, 0.49317527],
+                             [- 6.27277742, -0.00058117, 0.00035612, 7.27219625, 0.99822442, 0.99906271, 0.49317521],
+                             [- 6.27277768, -0.00058106, 0.00035605, 7.27219662, 0.99822476, 0.99906289, 0.49317533],
+                             [- 6.27277794, -0.00058095, 0.00035598, 7.27219699, 0.99822509, 0.99906306, 0.49317536],
+                             [- 6.27277820, -0.00058084, 0.00035592, 7.27219736, 0.99822542, 0.99906324, 0.49317532],
+                             [- 6.27277846, -0.00058074, 0.00035585, 7.27219773, 0.99822576, 0.99906341, 0.49317542],
+                             [- 6.27277872, -0.00058063, 0.00035578, 7.27219810, 0.99822609, 0.99906359, 0.49317544],
+                             [- 6.27277898, -0.00058052, 0.00035572, 7.27219847, 0.99822642, 0.99906376, 0.49317549],
+                             [- 6.27277924, -0.00058041, 0.00035565, 7.27219884, 0.99822675, 0.99906394, 0.49317552],
+                             [- 6.27277950, -0.00058030, 0.00035558, 7.27219920, 0.99822709, 0.99906412, 0.49317558],
+                             [- 6.27277977, -0.00058019, 0.00035552, 7.27219957, 0.99822742, 0.99906429, 0.49317562],
+                             [- 6.27278003, -0.00058008, 0.00035545, 7.27219994, 0.99822775, 0.99906447, 0.49317566],
+                             [- 6.27278029, -0.00057997, 0.00035538, 7.27220031, 0.99822808, 0.99906464, 0.49317568],
+                             [- 6.27278055, -0.00057987, 0.00035532, 7.27220068, 0.99822842, 0.99906482, 0.49317573],
+                             [- 6.27278080, -0.00057976, 0.00035525, 7.27220105, 0.99822875, 0.99906499, 0.49317574],
+                             [- 6.27278106, -0.00057965, 0.00035518, 7.27220142, 0.99822908, 0.99906517, 0.49317581],
+                             [- 6.27278132, -0.00057954, 0.00035512, 7.27220178, 0.99822941, 0.99906534, 0.49317584],
+                             [- 6.27278158, -0.00057943, 0.00035505, 7.27220215, 0.99822974, 0.99906552, 0.49317591],
+                             [- 6.27278184, -0.00057932, 0.00035498, 7.27220252, 0.99823008, 0.99906569, 0.49317591],
+                             [- 6.27278210, -0.00057921, 0.00035492, 7.27220289, 0.99823041, 0.99906587, 0.49317595],
+                             [- 6.27278236, -0.00057911, 0.00035485, 7.27220326, 0.99823074, 0.99906604, 0.49317597],
+                             [- 6.27278262, -0.00057900, 0.00035479, 7.27220362, 0.99823107, 0.99906622, 0.49317601],
+                             [- 6.27278288, -0.00057889, 0.00035472, 7.27220399, 0.99823140, 0.99906639, 0.49317609],
+                             [- 6.27278314, -0.00057878, 0.00035465, 7.27220436, 0.99823173, 0.99906657, 0.49317610],
+                             [- 6.27278340, -0.00057867, 0.00035459, 7.27220472, 0.99823206, 0.99906674, 0.49317615],
+                             [- 6.27278366, -0.00057857, 0.00035452, 7.27220509, 0.99823239, 0.99906691, 0.49317621],
+                             [- 6.27278392, -0.00057846, 0.00035445, 7.27220546, 0.99823272, 0.99906709, 0.49317622],
+                             [- 6.27278417, -0.00057835, 0.00035439, 7.27220582, 0.99823305, 0.99906726, 0.49317632],
+                             [- 6.27278443, -0.00057824, 0.00035432, 7.27220619, 0.99823338, 0.99906744, 0.49317629],
+                             [- 6.27278469, -0.00057813, 0.00035425, 7.27220656, 0.99823371, 0.99906761, 0.49317636],
+                             [- 6.27278495, -0.00057802, 0.00035419, 7.27220692, 0.99823404, 0.99906779, 0.49317638],
+                             [- 6.27278521, -0.00057792, 0.00035412, 7.27220729, 0.99823437, 0.99906796, 0.49317641],
+                             [- 6.27278547, -0.00057781, 0.00035406, 7.27220766, 0.99823470, 0.99906813, 0.49317644],
+                             [- 6.27278572, -0.00057770, 0.00035399, 7.27220802, 0.99823503, 0.99906831, 0.49317646],
+                             [- 6.27278598, -0.00057759, 0.00035392, 7.27220839, 0.99823536, 0.99906848, 0.49317651],
+                             [- 6.27278624, -0.00057749, 0.00035386, 7.27220875, 0.99823569, 0.99906866, 0.49317654],
+                             [- 6.27278650, -0.00057738, 0.00035379, 7.27220912, 0.99823602, 0.99906883, 0.49317660],
+                             [- 6.27278675, -0.00057727, 0.00035373, 7.27220948, 0.99823635, 0.99906900, 0.49317666],
+                             [- 6.27278701, -0.00057716, 0.00035366, 7.27220985, 0.99823668, 0.99906918, 0.49317668],
+                             [- 6.27278727, -0.00057706, 0.00035359, 7.27221021, 0.99823701, 0.99906935, 0.49317676],
+                             [- 6.27278753, -0.00057695, 0.00035353, 7.27221058, 0.99823734, 0.99906952, 0.49317676],
+                             [- 6.27278778, -0.00057684, 0.00035346, 7.27221094, 0.99823766, 0.99906970, 0.49317678],
+                             [- 6.27278804, -0.00057673, 0.00035340, 7.27221131, 0.99823799, 0.99906987, 0.49317683],
+                             [- 6.27278830, -0.00057663, 0.00035333, 7.27221167, 0.99823832, 0.99907004, 0.49317687],
+                             [- 6.27278855, -0.00057652, 0.00035326, 7.27221204, 0.99823865, 0.99907022, 0.49317691],
+                             [- 6.27278881, -0.00057641, 0.00035320, 7.27221240, 0.99823898, 0.99907039, 0.49317697],
+                             [- 6.27278907, -0.00057630, 0.00035313, 7.27221277, 0.99823931, 0.99907056, 0.49317699],
+                             [- 6.27278933, -0.00057620, 0.00035307, 7.27221313, 0.99823963, 0.99907074, 0.49317702],
+                             [- 6.27278958, -0.00057609, 0.00035300, 7.27221349, 0.99823996, 0.99907091, 0.49317708],
+                             [- 6.27278984, -0.00057598, 0.00035294, 7.27221386, 0.99824029, 0.99907108, 0.49317710],
+                             [- 6.27279009, -0.00057587, 0.00035287, 7.27221422, 0.99824062, 0.99907126, 0.49317717],
+                             [- 6.27279035, -0.00057577, 0.00035280, 7.27221458, 0.99824094, 0.99907143, 0.49317720],
+                             [- 6.27279061, -0.00057566, 0.00035274, 7.27221495, 0.99824127, 0.99907160, 0.49317720],
+                             [- 6.27279086, -0.00057555, 0.00035267, 7.27221531, 0.99824160, 0.99907177, 0.49317727],
+                             [- 6.27279112, -0.00057545, 0.00035261, 7.27221567, 0.99824193, 0.99907195, 0.49317735],
+                             [- 6.27279137, -0.00057534, 0.00035254, 7.27221604, 0.99824225, 0.99907212, 0.49317732],
+                             [- 6.27279163, -0.00057523, 0.00035248, 7.27221640, 0.99824258, 0.99907229, 0.49317739],
+                             [- 6.27279189, -0.00057513, 0.00035241, 7.27221676, 0.99824291, 0.99907246, 0.49317738],
+                             [- 6.27279214, -0.00057502, 0.00035235, 7.27221712, 0.99824323, 0.99907264, 0.49317745],
+                             [- 6.27279240, -0.00057491, 0.00035228, 7.27221749, 0.99824356, 0.99907281, 0.49317748],
+                             [- 6.27279265, -0.00057480, 0.00035221, 7.27221785, 0.99824389, 0.99907298, 0.49317752],
+                             [- 6.27279291, -0.00057470, 0.00035215, 7.27221821, 0.99824421, 0.99907315, 0.49317757],
+                             [- 6.27279316, -0.00057459, 0.00035208, 7.27221857, 0.99824454, 0.99907332, 0.49317760],
+                             [- 6.27279342, -0.00057448, 0.00035202, 7.27221893, 0.99824486, 0.99907350, 0.49317764],
+                             [- 6.27279367, -0.00057438, 0.00035195, 7.27221930, 0.99824519, 0.99907367, 0.49317766],
+                             [- 6.27279393, -0.00057427, 0.00035189, 7.27221966, 0.99824551, 0.99907384, 0.49317770],
+                             [- 6.27279418, -0.00057417, 0.00035182, 7.27222002, 0.99824584, 0.99907401, 0.49317777],
+                             [- 6.27279444, -0.00057406, 0.00035176, 7.27222038, 0.99824617, 0.99907418, 0.49317774],
+                             [- 6.27279469, -0.00057395, 0.00035169, 7.27222074, 0.99824649, 0.99907436, 0.49317781],
+                             [- 6.27279495, -0.00057385, 0.00035163, 7.27222110, 0.99824682, 0.99907453, 0.49317792],
+                             [- 6.27279520, -0.00057374, 0.00035156, 7.27222146, 0.99824714, 0.99907470, 0.49317788],
+                             [- 6.27279546, -0.00057363, 0.00035150, 7.27222182, 0.99824747, 0.99907487, 0.49317793],
+                             [- 6.27279571, -0.00057353, 0.00035143, 7.27222218, 0.99824779, 0.99907504, 0.49317800],
+                             [- 6.27279596, -0.00057342, 0.00035137, 7.27222254, 0.99824812, 0.99907521, 0.49317798],
+                             [- 6.27279622, -0.00057331, 0.00035130, 7.27222290, 0.99824844, 0.99907538, 0.49317810],
+                             [- 6.27279647, -0.00057321, 0.00035124, 7.27222326, 0.99824877, 0.99907556, 0.49317811],
+                             [- 6.27279673, -0.00057310, 0.00035117, 7.27222362, 0.99824909, 0.99907573, 0.49317808],
+                             [- 6.27279698, -0.00057300, 0.00035111, 7.27222398, 0.99824941, 0.99907590, 0.49317818],
+                             [- 6.27279723, -0.00057289, 0.00035104, 7.27222434, 0.99824974, 0.99907607, 0.49317820],
+                             [- 6.27279749, -0.00057278, 0.00035098, 7.27222470, 0.99825006, 0.99907624, 0.49317824],
+                             [- 6.27279774, -0.00057268, 0.00035091, 7.27222506, 0.99825039, 0.99907641, 0.49317828],
+                             [- 6.27279799, -0.00057257, 0.00035085, 7.27222542, 0.99825071, 0.99907658, 0.49317828],
+                             [- 6.27279825, -0.00057247, 0.00035078, 7.27222578, 0.99825103, 0.99907675, 0.49317836],
+                             [- 6.27279850, -0.00057236, 0.00035072, 7.27222614, 0.99825136, 0.99907692, 0.49317841],
+                             [- 6.27279875, -0.00057225, 0.00035065, 7.27222650, 0.99825168, 0.99907709, 0.49317844],
+                             [- 6.27279901, -0.00057215, 0.00035059, 7.27222686, 0.99825200, 0.99907727, 0.49317846],
+                             [- 6.27279926, -0.00057204, 0.00035052, 7.27222722, 0.99825233, 0.99907744, 0.49317853],
+                             [- 6.27279951, -0.00057194, 0.00035046, 7.27222758, 0.99825265, 0.99907761, 0.49317855],
+                             [- 6.27279977, -0.00057183, 0.00035039, 7.27222793, 0.99825297, 0.99907778, 0.49317862],
+                             [- 6.27280002, -0.00057173, 0.00035033, 7.27222829, 0.99825330, 0.99907795, 0.49317862],
+                             [- 6.27280027, -0.00057162, 0.00035026, 7.27222865, 0.99825362, 0.99907812, 0.49317865],
+                             [- 6.27280052, -0.00057152, 0.00035020, 7.27222901, 0.99825394, 0.99907829, 0.49317872],
+                             [- 6.27280078, -0.00057141, 0.00035013, 7.27222937, 0.99825426, 0.99907846, 0.49317874],
+                             [- 6.27280103, -0.00057130, 0.00035007, 7.27222972, 0.99825459, 0.99907863, 0.49317875],
+                             [- 6.27280128, -0.00057120, 0.00035000, 7.27223008, 0.99825491, 0.99907880, 0.49317879],
+                             [- 6.27280153, -0.00057109, 0.00034994, 7.27223044, 0.99825523, 0.99907897, 0.49317885],
+                             [- 6.27280178, -0.00057099, 0.00034987, 7.27223080, 0.99825555, 0.99907914, 0.49317886],
+                             [- 6.27280204, -0.00057088, 0.00034981, 7.27223115, 0.99825587, 0.99907931, 0.49317891],
+                             [- 6.27280229, -0.00057078, 0.00034974, 7.27223151, 0.99825620, 0.99907948, 0.49317896],
+                             [- 6.27280254, -0.00057067, 0.00034968, 7.27223187, 0.99825652, 0.99907965, 0.49317901],
+                             [- 6.27280279, -0.00057057, 0.00034962, 7.27223222, 0.99825684, 0.99907982, 0.49317904],
+                             [- 6.27280304, -0.00057046, 0.00034955, 7.27223258, 0.99825716, 0.99907999, 0.49317904],
+                             [- 6.27280329, -0.00057036, 0.00034949, 7.27223294, 0.99825748, 0.99908016, 0.49317910],
+                             [- 6.27280355, -0.00057025, 0.00034942, 7.27223329, 0.99825780, 0.99908033, 0.49317919],
+                             [- 6.27280380, -0.00057015, 0.00034936, 7.27223365, 0.99825812, 0.99908050, 0.49317919],
+                             [- 6.27280405, -0.00057004, 0.00034929, 7.27223401, 0.99825844, 0.99908066, 0.49317919],
+                             [- 6.27280430, -0.00056994, 0.00034923, 7.27223436, 0.99825877, 0.99908083, 0.49317929],
+                             [- 6.27280455, -0.00056983, 0.00034916, 7.27223472, 0.99825909, 0.99908100, 0.49317932],
+                             [- 6.27280480, -0.00056973, 0.00034910, 7.27223507, 0.99825941, 0.99908117, 0.49317933],
+                             [- 6.27280505, -0.00056962, 0.00034904, 7.27223543, 0.99825973, 0.99908134, 0.49317936],
+                             [- 6.27280530, -0.00056952, 0.00034897, 7.27223579, 0.99826005, 0.99908151, 0.49317942],
+                             [- 6.27280555, -0.00056941, 0.00034891, 7.27223614, 0.99826037, 0.99908168, 0.49317941],
+                             [- 6.27280580, -0.00056931, 0.00034884, 7.27223650, 0.99826069, 0.99908185, 0.49317944],
+                             [- 6.27280606, -0.00056920, 0.00034878, 7.27223685, 0.99826101, 0.99908202, 0.49317951],
+                             [- 6.27280631, -0.00056910, 0.00034872, 7.27223721, 0.99826133, 0.99908219, 0.49317958],
+                             [- 6.27280656, -0.00056899, 0.00034865, 7.27223756, 0.99826165, 0.99908235, 0.49317962],
+                             [- 6.27280681, -0.00056889, 0.00034859, 7.27223792, 0.99826197, 0.99908252, 0.49317961],
+                             [- 6.27280706, -0.00056878, 0.00034852, 7.27223827, 0.99826229, 0.99908269, 0.49317963],
+                             [- 6.27280731, -0.00056868, 0.00034846, 7.27223863, 0.99826261, 0.99908286, 0.49317970],
+                             [- 6.27280756, -0.00056858, 0.00034839, 7.27223898, 0.99826293, 0.99908303, 0.49317974],
+                             [- 6.27280781, -0.00056847, 0.00034833, 7.27223933, 0.99826324, 0.99908320, 0.49317978],
+                             [- 6.27280806, -0.00056837, 0.00034827, 7.27223969, 0.99826356, 0.99908337, 0.49317977],
+                             [- 6.27280830, -0.00056826, 0.00034820, 7.27224004, 0.99826388, 0.99908353, 0.49317984],
+                             [- 6.27280855, -0.00056816, 0.00034814, 7.27224040, 0.99826420, 0.99908370, 0.49317991],
+                             [- 6.27280880, -0.00056805, 0.00034807, 7.27224075, 0.99826452, 0.99908387, 0.49317993],
+                             [- 6.27280905, -0.00056795, 0.00034801, 7.27224110, 0.99826484, 0.99908404, 0.49317997],
+                             [- 6.27280930, -0.00056785, 0.00034795, 7.27224146, 0.99826516, 0.99908421, 0.49317999],
+                             [- 6.27280955, -0.00056774, 0.00034788, 7.27224181, 0.99826547, 0.99908438, 0.49318004],
+                             [- 6.27280980, -0.00056764, 0.00034782, 7.27224216, 0.99826579, 0.99908454, 0.49318009],
+                             [- 6.27281005, -0.00056753, 0.00034776, 7.27224252, 0.99826611, 0.99908471, 0.49318013],
+                             [- 6.27281030, -0.00056743, 0.00034769, 7.27224287, 0.99826643, 0.99908488, 0.49318014],
+                             [- 6.27281055, -0.00056733, 0.00034763, 7.27224322, 0.99826675, 0.99908505, 0.49318020],
+                             [- 6.27281080, -0.00056722, 0.00034756, 7.27224357, 0.99826706, 0.99908521, 0.49318023],
+                             [- 6.27281104, -0.00056712, 0.00034750, 7.27224393, 0.99826738, 0.99908538, 0.49318021],
+                             [- 6.27281129, -0.00056701, 0.00034744, 7.27224428, 0.99826770, 0.99908555, 0.49318033],
+                             [- 6.27281154, -0.00056691, 0.00034737, 7.27224463, 0.99826802, 0.99908572, 0.49318033],
+                             [- 6.27281179, -0.00056681, 0.00034731, 7.27224498, 0.99826833, 0.99908588, 0.49318036],
+                             [- 6.27281204, -0.00056670, 0.00034725, 7.27224534, 0.99826865, 0.99908605, 0.49318042],
+                             [- 6.27281229, -0.00056660, 0.00034718, 7.27224569, 0.99826897, 0.99908622, 0.49318046],
+                             [- 6.27281253, -0.00056649, 0.00034712, 7.27224604, 0.99826929, 0.99908639, 0.49318048],
+                             [- 6.27281278, -0.00056639, 0.00034706, 7.27224639, 0.99826960, 0.99908655, 0.49318053],
+                             [- 6.27281303, -0.00056629, 0.00034699, 7.27224674, 0.99826992, 0.99908672, 0.49318056],
+                             [- 6.27281328, -0.00056618, 0.00034693, 7.27224709, 0.99827024, 0.99908689, 0.49318059],
+                             [- 6.27281353, -0.00056608, 0.00034686, 7.27224745, 0.99827055, 0.99908705, 0.49318066],
+                             [- 6.27281377, -0.00056598, 0.00034680, 7.27224780, 0.99827087, 0.99908722, 0.49318067],
+                             [- 6.27281402, -0.00056587, 0.00034674, 7.27224815, 0.99827119, 0.99908739, 0.49318073],
+                             [- 6.27281427, -0.00056577, 0.00034667, 7.27224850, 0.99827150, 0.99908756, 0.49318072],
+                             [- 6.27281452, -0.00056567, 0.00034661, 7.27224885, 0.99827182, 0.99908772, 0.49318077],
+                             [- 6.27281476, -0.00056556, 0.00034655, 7.27224920, 0.99827213, 0.99908789, 0.49318079],
+                             [- 6.27281501, -0.00056546, 0.00034648, 7.27224955, 0.99827245, 0.99908806, 0.49318086],
+                             [- 6.27281526, -0.00056536, 0.00034642, 7.27224990, 0.99827276, 0.99908822, 0.49318086],
+                             [- 6.27281550, -0.00056525, 0.00034636, 7.27225025, 0.99827308, 0.99908839, 0.49318091],
+                             [- 6.27281575, -0.00056515, 0.00034629, 7.27225060, 0.99827340, 0.99908856, 0.49318093],
+                             [- 6.27281600, -0.00056505, 0.00034623, 7.27225095, 0.99827371, 0.99908872, 0.49318097],
+                             [- 6.27281624, -0.00056494, 0.00034617, 7.27225130, 0.99827403, 0.99908889, 0.49318102],
+                             [- 6.27281649, -0.00056484, 0.00034610, 7.27225165, 0.99827434, 0.99908905, 0.49318109],
+                             [- 6.27281674, -0.00056474, 0.00034604, 7.27225200, 0.99827466, 0.99908922, 0.49318111],
+                             [- 6.27281698, -0.00056463, 0.00034598, 7.27225235, 0.99827497, 0.99908939, 0.49318114],
+                             [- 6.27281723, -0.00056453, 0.00034592, 7.27225270, 0.99827529, 0.99908955, 0.49318118],
+                             [- 6.27281748, -0.00056443, 0.00034585, 7.27225305, 0.99827560, 0.99908972, 0.49318122],
+                             [- 6.27281772, -0.00056433, 0.00034579, 7.27225340, 0.99827591, 0.99908988, 0.49318124],
+                             [- 6.27281797, -0.00056422, 0.00034573, 7.27225375, 0.99827623, 0.99909005, 0.49318128],
+                             [- 6.27281822, -0.00056412, 0.00034566, 7.27225409, 0.99827654, 0.99909022, 0.49318131],
+                             [- 6.27281846, -0.00056402, 0.00034560, 7.27225444, 0.99827686, 0.99909038, 0.49318135],
+                             [- 6.27281871, -0.00056391, 0.00034554, 7.27225479, 0.99827717, 0.99909055, 0.49318140],
+                             [- 6.27281895, -0.00056381, 0.00034547, 7.27225514, 0.99827749, 0.99909071, 0.49318139],
+                             [- 6.27281920, -0.00056371, 0.00034541, 7.27225549, 0.99827780, 0.99909088, 0.49318148],
+                             [- 6.27281944, -0.00056361, 0.00034535, 7.27225584, 0.99827811, 0.99909105, 0.49318152],
+                             [- 6.27281969, -0.00056350, 0.00034528, 7.27225619, 0.99827843, 0.99909121, 0.49318156],
+                             [- 6.27281993, -0.00056340, 0.00034522, 7.27225653, 0.99827874, 0.99909138, 0.49318159],
+                             [- 6.27282018, -0.00056330, 0.00034516, 7.27225688, 0.99827905, 0.99909154, 0.49318163],
+                             [- 6.27282043, -0.00056320, 0.00034510, 7.27225723, 0.99827937, 0.99909171, 0.49318166],
+                             [- 6.27282067, -0.00056309, 0.00034503, 7.27225758, 0.99827968, 0.99909187, 0.49318168],
+                             [- 6.27282092, -0.00056299, 0.00034497, 7.27225792, 0.99827999, 0.99909204, 0.49318179],
+                             [- 6.27282116, -0.00056289, 0.00034491, 7.27225827, 0.99828031, 0.99909220, 0.49318171],
+                             [- 6.27282141, -0.00056279, 0.00034485, 7.27225862, 0.99828062, 0.99909237, 0.49318177],
+                             [- 6.27282165, -0.00056268, 0.00034478, 7.27225897, 0.99828093, 0.99909253, 0.49318188],
+                             [- 6.27282189, -0.00056258, 0.00034472, 7.27225931, 0.99828124, 0.99909270, 0.49318185],
+                             [- 6.27282214, -0.00056248, 0.00034466, 7.27225966, 0.99828156, 0.99909286, 0.49318190],
+                             [- 6.27282238, -0.00056238, 0.00034459, 7.27226001, 0.99828187, 0.99909303, 0.49318196],
+                             [- 6.27282263, -0.00056228, 0.00034453, 7.27226035, 0.99828218, 0.99909319, 0.49318197],
+                             [- 6.27282287, -0.00056217, 0.00034447, 7.27226070, 0.99828249, 0.99909336, 0.49318203],
+                             [- 6.27282312, -0.00056207, 0.00034441, 7.27226104, 0.99828281, 0.99909352, 0.49318204],
+                             [- 6.27282336, -0.00056197, 0.00034434, 7.27226139, 0.99828312, 0.99909369, 0.49318210],
+                             [- 6.27282360, -0.00056187, 0.00034428, 7.27226174, 0.99828343, 0.99909385, 0.49318213],
+                             [- 6.27282385, -0.00056177, 0.00034422, 7.27226208, 0.99828374, 0.99909402, 0.49318217],
+                             [- 6.27282409, -0.00056166, 0.00034416, 7.27226243, 0.99828405, 0.99909418, 0.49318219],
+                             [- 6.27282434, -0.00056156, 0.00034409, 7.27226277, 0.99828436, 0.99909434, 0.49318217],
+                             [- 6.27282458, -0.00056146, 0.00034403, 7.27226312, 0.99828467, 0.99909451, 0.49318229],
+                             [- 6.27282482, -0.00056136, 0.00034397, 7.27226347, 0.99828499, 0.99909467, 0.49318235],
+                             [- 6.27282507, -0.00056126, 0.00034391, 7.27226381, 0.99828530, 0.99909484, 0.49318234],
+                             [- 6.27282531, -0.00056115, 0.00034384, 7.27226416, 0.99828561, 0.99909500, 0.49318238],
+                             [- 6.27282555, -0.00056105, 0.00034378, 7.27226450, 0.99828592, 0.99909516, 0.49318244],
+                             [- 6.27282580, -0.00056095, 0.00034372, 7.27226485, 0.99828623, 0.99909533, 0.49318245],
+                             [- 6.27282604, -0.00056085, 0.00034366, 7.27226519, 0.99828654, 0.99909549, 0.49318251],
+                             [- 6.27282628, -0.00056075, 0.00034360, 7.27226554, 0.99828685, 0.99909566, 0.49318249],
+                             [- 6.27282653, -0.00056065, 0.00034353, 7.27226588, 0.99828716, 0.99909582, 0.49318260],
+                             [- 6.27282677, -0.00056055, 0.00034347, 7.27226622, 0.99828747, 0.99909598, 0.49318256],
+                             [- 6.27282701, -0.00056044, 0.00034341, 7.27226657, 0.99828778, 0.99909615, 0.49318268],
+                             [- 6.27282725, -0.00056034, 0.00034335, 7.27226691, 0.99828809, 0.99909631, 0.49318269],
+                             [- 6.27282750, -0.00056024, 0.00034328, 7.27226726, 0.99828840, 0.99909648, 0.49318273],
+                             [- 6.27282774, -0.00056014, 0.00034322, 7.27226760, 0.99828871, 0.99909664, 0.49318276],
+                             [- 6.27282798, -0.00056004, 0.00034316, 7.27226794, 0.99828902, 0.99909680, 0.49318278],
+                             [- 6.27282822, -0.00055994, 0.00034310, 7.27226829, 0.99828933, 0.99909697, 0.49318281],
+                             [- 6.27282847, -0.00055984, 0.00034304, 7.27226863, 0.99828964, 0.99909713, 0.49318285],
+                             [- 6.27282871, -0.00055973, 0.00034297, 7.27226898, 0.99828995, 0.99909729, 0.49318289],
+                             [- 6.27282895, -0.00055963, 0.00034291, 7.27226932, 0.99829026, 0.99909746, 0.49318294],
+                             [- 6.27282919, -0.00055953, 0.00034285, 7.27226966, 0.99829057, 0.99909762, 0.49318296],
+                             [- 6.27282944, -0.00055943, 0.00034279, 7.27227000, 0.99829088, 0.99909778, 0.49318295],
+                             [- 6.27282968, -0.00055933, 0.00034273, 7.27227035, 0.99829119, 0.99909794, 0.49318302],
+                             [- 6.27282992, -0.00055923, 0.00034266, 7.27227069, 0.99829150, 0.99909811, 0.49318310],
+                             [- 6.27283016, -0.00055913, 0.00034260, 7.27227103, 0.99829180, 0.99909827, 0.49318311],
+                             [- 6.27283040, -0.00055903, 0.00034254, 7.27227138, 0.99829211, 0.99909843, 0.49318314],
+                             [- 6.27283064, -0.00055893, 0.00034248, 7.27227172, 0.99829242, 0.99909860, 0.49318318],
+                             [- 6.27283089, -0.00055882, 0.00034242, 7.27227206, 0.99829273, 0.99909876, 0.49318320],
+                             [- 6.27283113, -0.00055872, 0.00034235, 7.27227240, 0.99829304, 0.99909892, 0.49318320],
+                             [- 6.27283137, -0.00055862, 0.00034229, 7.27227274, 0.99829335, 0.99909908, 0.49318327],
+                             [- 6.27283161, -0.00055852, 0.00034223, 7.27227309, 0.99829365, 0.99909925, 0.49318333],
+                             [- 6.27283185, -0.00055842, 0.00034217, 7.27227343, 0.99829396, 0.99909941, 0.49318333],
+                             [- 6.27283209, -0.00055832, 0.00034211, 7.27227377, 0.99829427, 0.99909957, 0.49318336],
+                             [- 6.27283233, -0.00055822, 0.00034204, 7.27227411, 0.99829458, 0.99909973, 0.49318343],
+                             [- 6.27283257, -0.00055812, 0.00034198, 7.27227445, 0.99829489, 0.99909990, 0.49318344],
+                             [- 6.27283281, -0.00055802, 0.00034192, 7.27227479, 0.99829519, 0.99910006, 0.49318351],
+                             [- 6.27283305, -0.00055792, 0.00034186, 7.27227514, 0.99829550, 0.99910022, 0.49318353],
+                             [- 6.27283329, -0.00055782, 0.00034180, 7.27227548, 0.99829581, 0.99910038, 0.49318358],
+                             [- 6.27283353, -0.00055772, 0.00034174, 7.27227582, 0.99829611, 0.99910055, 0.49318362],
+                             [- 6.27283378, -0.00055762, 0.00034168, 7.27227616, 0.99829642, 0.99910071, 0.49318360],
+                             [- 6.27283402, -0.00055752, 0.00034161, 7.27227650, 0.99829673, 0.99910087, 0.49318367],
+                             [- 6.27283426, -0.00055742, 0.00034155, 7.27227684, 0.99829704, 0.99910103, 0.49318371],
+                             [- 6.27283450, -0.00055732, 0.00034149, 7.27227718, 0.99829734, 0.99910119, 0.49318374],
+                             [- 6.27283474, -0.00055722, 0.00034143, 7.27227752, 0.99829765, 0.99910136, 0.49318380],
+                             [- 6.27283498, -0.00055712, 0.00034137, 7.27227786, 0.99829796, 0.99910152, 0.49318376],
+                             [- 6.27283522, -0.00055701, 0.00034131, 7.27227820, 0.99829826, 0.99910168, 0.49318386],
+                             [- 6.27283546, -0.00055691, 0.00034124, 7.27227854, 0.99829857, 0.99910184, 0.49318389],
+                             [- 6.27283570, -0.00055681, 0.00034118, 7.27227888, 0.99829887, 0.99910200, 0.49318390],
+                             [- 6.27283593, -0.00055671, 0.00034112, 7.27227922, 0.99829918, 0.99910216, 0.49318396],
+                             [- 6.27283617, -0.00055661, 0.00034106, 7.27227956, 0.99829949, 0.99910233, 0.49318401],
+                             [- 6.27283641, -0.00055651, 0.00034100, 7.27227990, 0.99829979, 0.99910249, 0.49318410],
+                             [- 6.27283665, -0.00055641, 0.00034094, 7.27228024, 0.99830010, 0.99910265, 0.49318407],
+                             [- 6.27283689, -0.00055631, 0.00034088, 7.27228058, 0.99830040, 0.99910281, 0.49318407],
+                             [- 6.27283713, -0.00055621, 0.00034081, 7.27228092, 0.99830071, 0.99910297, 0.49318414],
+                             [- 6.27283737, -0.00055611, 0.00034075, 7.27228126, 0.99830101, 0.99910313, 0.49318415],
+                             [- 6.27283761, -0.00055601, 0.00034069, 7.27228159, 0.99830132, 0.99910329, 0.49318423],
+                             [- 6.27283785, -0.00055591, 0.00034063, 7.27228193, 0.99830163, 0.99910345, 0.49318423],
+                             [- 6.27283809, -0.00055581, 0.00034057, 7.27228227, 0.99830193, 0.99910362, 0.49318427],
+                             [- 6.27283833, -0.00055571, 0.00034051, 7.27228261, 0.99830224, 0.99910378, 0.49318428],
+                             [- 6.27283856, -0.00055562, 0.00034045, 7.27228295, 0.99830254, 0.99910394, 0.49318433],
+                             [- 6.27283880, -0.00055552, 0.00034039, 7.27228329, 0.99830285, 0.99910410, 0.49318443],
+                             [- 6.27283904, -0.00055542, 0.00034033, 7.27228363, 0.99830315, 0.99910426, 0.49318443],
+                             [- 6.27283928, -0.00055532, 0.00034026, 7.27228396, 0.99830345, 0.99910442, 0.49318449],
+                             [- 6.27283952, -0.00055522, 0.00034020, 7.27228430, 0.99830376, 0.99910458, 0.49318449],
+                             [- 6.27283976, -0.00055512, 0.00034014, 7.27228464, 0.99830406, 0.99910474, 0.49318454],
+                             [- 6.27283999, -0.00055502, 0.00034008, 7.27228498, 0.99830437, 0.99910490, 0.49318457],
+                             [- 6.27284023, -0.00055492, 0.00034002, 7.27228531, 0.99830467, 0.99910506, 0.49318459],
+                             [- 6.27284047, -0.00055482, 0.00033996, 7.27228565, 0.99830498, 0.99910522, 0.49318460],
+                             [- 6.27284071, -0.00055472, 0.00033990, 7.27228599, 0.99830528, 0.99910538, 0.49318465],
+                             [- 6.27284095, -0.00055462, 0.00033984, 7.27228633, 0.99830558, 0.99910554, 0.49318472],
+                             [- 6.27284118, -0.00055452, 0.00033978, 7.27228666, 0.99830589, 0.99910570, 0.49318477],
+                             [- 6.27284142, -0.00055442, 0.00033972, 7.27228700, 0.99830619, 0.99910586, 0.49318479],
+                             [- 6.27284166, -0.00055432, 0.00033965, 7.27228734, 0.99830649, 0.99910602, 0.49318483],
+                             [- 6.27284190, -0.00055422, 0.00033959, 7.27228767, 0.99830680, 0.99910618, 0.49318487],
+                             [- 6.27284213, -0.00055412, 0.00033953, 7.27228801, 0.99830710, 0.99910634, 0.49318489],
+                             [- 6.27284237, -0.00055402, 0.00033947, 7.27228835, 0.99830740, 0.99910650, 0.49318490],
+                             [- 6.27284261, -0.00055393, 0.00033941, 7.27228868, 0.99830771, 0.99910666, 0.49318496],
+                             [- 6.27284285, -0.00055383, 0.00033935, 7.27228902, 0.99830801, 0.99910682, 0.49318499],
+                             [- 6.27284308, -0.00055373, 0.00033929, 7.27228936, 0.99830831, 0.99910698, 0.49318499],
+                             [- 6.27284332, -0.00055363, 0.00033923, 7.27228969, 0.99830861, 0.99910714, 0.49318509],
+                             [- 6.27284356, -0.00055353, 0.00033917, 7.27229003, 0.99830892, 0.99910730, 0.49318511],
+                             [- 6.27284379, -0.00055343, 0.00033911, 7.27229036, 0.99830922, 0.99910746, 0.49318515],
+                             [- 6.27284403, -0.00055333, 0.00033905, 7.27229070, 0.99830952, 0.99910762, 0.49318516],
+                             [- 6.27284427, -0.00055323, 0.00033899, 7.27229103, 0.99830982, 0.99910778, 0.49318524],
+                             [- 6.27284450, -0.00055313, 0.00033893, 7.27229137, 0.99831013, 0.99910794, 0.49318524],
+                             [- 6.27284474, -0.00055303, 0.00033887, 7.27229170, 0.99831043, 0.99910810, 0.49318528],
+                             [- 6.27284498, -0.00055294, 0.00033880, 7.27229204, 0.99831073, 0.99910826, 0.49318529],
+                             [- 6.27284521, -0.00055284, 0.00033874, 7.27229237, 0.99831103, 0.99910842, 0.49318533],
+                             [- 6.27284545, -0.00055274, 0.00033868, 7.27229271, 0.99831133, 0.99910858, 0.49318539],
+                             [- 6.27284568, -0.00055264, 0.00033862, 7.27229304, 0.99831164, 0.99910874, 0.49318542],
+                             [- 6.27284592, -0.00055254, 0.00033856, 7.27229338, 0.99831194, 0.99910890, 0.49318543],
+                             [- 6.27284616, -0.00055244, 0.00033850, 7.27229371, 0.99831224, 0.99910906, 0.49318547],
+                             [- 6.27284639, -0.00055234, 0.00033844, 7.27229405, 0.99831254, 0.99910921, 0.49318555],
+                             [- 6.27284663, -0.00055225, 0.00033838, 7.27229438, 0.99831284, 0.99910937, 0.49318557],
+                             [- 6.27284686, -0.00055215, 0.00033832, 7.27229472, 0.99831314, 0.99910953, 0.49318561],
+                             [- 6.27284710, -0.00055205, 0.00033826, 7.27229505, 0.99831344, 0.99910969, 0.49318565],
+                             [- 6.27284733, -0.00055195, 0.00033820, 7.27229538, 0.99831374, 0.99910985, 0.49318570],
+                             [- 6.27284757, -0.00055185, 0.00033814, 7.27229572, 0.99831404, 0.99911001, 0.49318569],
+                             [- 6.27284781, -0.00055175, 0.00033808, 7.27229605, 0.99831435, 0.99911017, 0.49318574],
+                             [- 6.27284804, -0.00055165, 0.00033802, 7.27229639, 0.99831465, 0.99911033, 0.49318575],
+                             [- 6.27284828, -0.00055156, 0.00033796, 7.27229672, 0.99831495, 0.99911048, 0.49318581],
+                             [- 6.27284851, -0.00055146, 0.00033790, 7.27229705, 0.99831525, 0.99911064, 0.49318582],
+                             [- 6.27284875, -0.00055136, 0.00033784, 7.27229739, 0.99831555, 0.99911080, 0.49318586],
+                             [- 6.27284898, -0.00055126, 0.00033778, 7.27229772, 0.99831585, 0.99911096, 0.49318588],
+                             [- 6.27284922, -0.00055116, 0.00033772, 7.27229805, 0.99831615, 0.99911112, 0.49318595],
+                             [- 6.27284945, -0.00055107, 0.00033766, 7.27229838, 0.99831645, 0.99911128, 0.49318599],
+                             [- 6.27284968, -0.00055097, 0.00033760, 7.27229872, 0.99831675, 0.99911143, 0.49318604],
+                             [- 6.27284992, -0.00055087, 0.00033754, 7.27229905, 0.99831705, 0.99911159, 0.49318604],
+                             [- 6.27285015, -0.00055077, 0.00033748, 7.27229938, 0.99831735, 0.99911175, 0.49318612],
+                             [- 6.27285039, -0.00055067, 0.00033742, 7.27229971, 0.99831765, 0.99911191, 0.49318613],
+                             [- 6.27285062, -0.00055058, 0.00033736, 7.27230005, 0.99831794, 0.99911207, 0.49318622],
+                             [- 6.27285086, -0.00055048, 0.00033730, 7.27230038, 0.99831824, 0.99911223, 0.49318623],
+                             [- 6.27285109, -0.00055038, 0.00033724, 7.27230071, 0.99831854, 0.99911238, 0.49318626],
+                             [- 6.27285133, -0.00055028, 0.00033718, 7.27230104, 0.99831884, 0.99911254, 0.49318626],
+                             [- 6.27285156, -0.00055018, 0.00033712, 7.27230138, 0.99831914, 0.99911270, 0.49318628],
+                             [- 6.27285179, -0.00055009, 0.00033706, 7.27230171, 0.99831944, 0.99911286, 0.49318633],
+                             [- 6.27285203, -0.00054999, 0.00033700, 7.27230204, 0.99831974, 0.99911301, 0.49318637],
+                             [- 6.27285226, -0.00054989, 0.00033694, 7.27230237, 0.99832004, 0.99911317, 0.49318637],
+                             [- 6.27285249, -0.00054979, 0.00033688, 7.27230270, 0.99832034, 0.99911333, 0.49318644],
+                             [- 6.27285273, -0.00054970, 0.00033682, 7.27230303, 0.99832063, 0.99911349, 0.49318645],
+                             [- 6.27285296, -0.00054960, 0.00033676, 7.27230336, 0.99832093, 0.99911364, 0.49318646],
+                             [- 6.27285319, -0.00054950, 0.00033670, 7.27230369, 0.99832123, 0.99911380, 0.49318651],
+                             [- 6.27285343, -0.00054940, 0.00033664, 7.27230403, 0.99832153, 0.99911396, 0.49318650],
+                             [- 6.27285366, -0.00054931, 0.00033658, 7.27230436, 0.99832183, 0.99911412, 0.49318659],
+                             [- 6.27285389, -0.00054921, 0.00033652, 7.27230469, 0.99832212, 0.99911427, 0.49318666],
+                             [- 6.27285413, -0.00054911, 0.00033646, 7.27230502, 0.99832242, 0.99911443, 0.49318665],
+                             [- 6.27285436, -0.00054901, 0.00033640, 7.27230535, 0.99832272, 0.99911459, 0.49318670],
+                             [- 6.27285459, -0.00054892, 0.00033634, 7.27230568, 0.99832302, 0.99911474, 0.49318673],
+                             [- 6.27285483, -0.00054882, 0.00033628, 7.27230601, 0.99832332, 0.99911490, 0.49318677],
+                             [- 6.27285506, -0.00054872, 0.00033622, 7.27230634, 0.99832361, 0.99911506, 0.49318685],
+                             [- 6.27285529, -0.00054862, 0.00033616, 7.27230667, 0.99832391, 0.99911522, 0.49318683],
+                             [- 6.27285552, -0.00054853, 0.00033610, 7.27230700, 0.99832421, 0.99911537, 0.49318692],
+                             [- 6.27285576, -0.00054843, 0.00033604, 7.27230733, 0.99832450, 0.99911553, 0.49318690],
+                             [- 6.27285599, -0.00054833, 0.00033598, 7.27230766, 0.99832480, 0.99911569, 0.49318694],
+                             [- 6.27285622, -0.00054824, 0.00033592, 7.27230799, 0.99832510, 0.99911584, 0.49318700],
+                             [- 6.27285645, -0.00054814, 0.00033586, 7.27230832, 0.99832539, 0.99911600, 0.49318701],
+                             [- 6.27285669, -0.00054804, 0.00033580, 7.27230865, 0.99832569, 0.99911616, 0.49318705],
+                             [- 6.27285692, -0.00054794, 0.00033574, 7.27230897, 0.99832599, 0.99911631, 0.49318711],
+                             [- 6.27285715, -0.00054785, 0.00033568, 7.27230930, 0.99832628, 0.99911647, 0.49318708],
+                             [- 6.27285738, -0.00054775, 0.00033563, 7.27230963, 0.99832658, 0.99911662, 0.49318719],
+                             [- 6.27285761, -0.00054765, 0.00033557, 7.27230996, 0.99832688, 0.99911678, 0.49318717],
+                             [- 6.27285785, -0.00054756, 0.00033551, 7.27231029, 0.99832717, 0.99911694, 0.49318724],
+                             [- 6.27285808, -0.00054746, 0.00033545, 7.27231062, 0.99832747, 0.99911709, 0.49318723],
+                             [- 6.27285831, -0.00054736, 0.00033539, 7.27231095, 0.99832776, 0.99911725, 0.49318729],
+                             [- 6.27285854, -0.00054727, 0.00033533, 7.27231127, 0.99832806, 0.99911741, 0.49318737],
+                             [- 6.27285877, -0.00054717, 0.00033527, 7.27231160, 0.99832836, 0.99911756, 0.49318736],
+                             [- 6.27285900, -0.00054707, 0.00033521, 7.27231193, 0.99832865, 0.99911772, 0.49318737],
+                             [- 6.27285923, -0.00054698, 0.00033515, 7.27231226, 0.99832895, 0.99911787, 0.49318744],
+                             [- 6.27285947, -0.00054688, 0.00033509, 7.27231259, 0.99832924, 0.99911803, 0.49318747],
+                             [- 6.27285970, -0.00054678, 0.00033503, 7.27231291, 0.99832954, 0.99911819, 0.49318750],
+                             [- 6.27285993, -0.00054669, 0.00033497, 7.27231324, 0.99832983, 0.99911834, 0.49318752],
+                             [- 6.27286016, -0.00054659, 0.00033491, 7.27231357, 0.99833013, 0.99911850, 0.49318756],
+                             [- 6.27286039, -0.00054649, 0.00033485, 7.27231390, 0.99833042, 0.99911865, 0.49318760],
+                             [- 6.27286062, -0.00054640, 0.00033480, 7.27231422, 0.99833072, 0.99911881, 0.49318765],
+                             [- 6.27286085, -0.00054630, 0.00033474, 7.27231455, 0.99833101, 0.99911896, 0.49318766],
+                             [- 6.27286108, -0.00054620, 0.00033468, 7.27231488, 0.99833131, 0.99911912, 0.49318767],
+                             [- 6.27286131, -0.00054611, 0.00033462, 7.27231521, 0.99833160, 0.99911927, 0.49318769],
+                             [- 6.27286154, -0.00054601, 0.00033456, 7.27231553, 0.99833190, 0.99911943, 0.49318777],
+                             [- 6.27286177, -0.00054591, 0.00033450, 7.27231586, 0.99833219, 0.99911959, 0.49318778],
+                             [- 6.27286200, -0.00054582, 0.00033444, 7.27231619, 0.99833248, 0.99911974, 0.49318783],
+                             [- 6.27286223, -0.00054572, 0.00033438, 7.27231651, 0.99833278, 0.99911990, 0.49318785],
+                             [- 6.27286246, -0.00054563, 0.00033432, 7.27231684, 0.99833307, 0.99912005, 0.49318790],
+                             [- 6.27286269, -0.00054553, 0.00033426, 7.27231716, 0.99833337, 0.99912021, 0.49318796],
+                             [- 6.27286292, -0.00054543, 0.00033420, 7.27231749, 0.99833366, 0.99912036, 0.49318798],
+                             [- 6.27286315, -0.00054534, 0.00033415, 7.27231782, 0.99833395, 0.99912052, 0.49318802],
+                             [- 6.27286338, -0.00054524, 0.00033409, 7.27231814, 0.99833425, 0.99912067, 0.49318801],
+                             [- 6.27286361, -0.00054515, 0.00033403, 7.27231847, 0.99833454, 0.99912083, 0.49318810],
+                             [- 6.27286384, -0.00054505, 0.00033397, 7.27231879, 0.99833483, 0.99912098, 0.49318815],
+                             [- 6.27286407, -0.00054495, 0.00033391, 7.27231912, 0.99833513, 0.99912114, 0.49318815],
+                             [- 6.27286430, -0.00054486, 0.00033385, 7.27231944, 0.99833542, 0.99912129, 0.49318821],
+                             [- 6.27286453, -0.00054476, 0.00033379, 7.27231977, 0.99833571, 0.99912145, 0.49318820],
+                             [- 6.27286476, -0.00054467, 0.00033373, 7.27232010, 0.99833601, 0.99912160, 0.49318828],
+                             [- 6.27286499, -0.00054457, 0.00033368, 7.27232042, 0.99833630, 0.99912175, 0.49318827],
+                             [- 6.27286522, -0.00054447, 0.00033362, 7.27232075, 0.99833659, 0.99912191, 0.49318830],
+                             [- 6.27286545, -0.00054438, 0.00033356, 7.27232107, 0.99833689, 0.99912206, 0.49318834],
+                             [- 6.27286568, -0.00054428, 0.00033350, 7.27232139, 0.99833718, 0.99912222, 0.49318840],
+                             [- 6.27286591, -0.00054419, 0.00033344, 7.27232172, 0.99833747, 0.99912237, 0.49318849],
+                             [- 6.27286614, -0.00054409, 0.00033338, 7.27232204, 0.99833776, 0.99912253, 0.49318845],
+                             [- 6.27286636, -0.00054400, 0.00033332, 7.27232237, 0.99833805, 0.99912268, 0.49318852],
+                             [- 6.27286659, -0.00054390, 0.00033326, 7.27232269, 0.99833835, 0.99912283, 0.49318851],
+                             [- 6.27286682, -0.00054380, 0.00033321, 7.27232302, 0.99833864, 0.99912299, 0.49318855],
+                             [- 6.27286705, -0.00054371, 0.00033315, 7.27232334, 0.99833893, 0.99912314, 0.49318857],
+                             [- 6.27286728, -0.00054361, 0.00033309, 7.27232366, 0.99833922, 0.99912330, 0.49318863],
+                             [- 6.27286751, -0.00054352, 0.00033303, 7.27232399, 0.99833951, 0.99912345, 0.49318865],
+                             [- 6.27286774, -0.00054342, 0.00033297, 7.27232431, 0.99833981, 0.99912360, 0.49318871],
+                             [- 6.27286796, -0.00054333, 0.00033291, 7.27232464, 0.99834010, 0.99912376, 0.49318871],
+                             [- 6.27286819, -0.00054323, 0.00033286, 7.27232496, 0.99834039, 0.99912391, 0.49318882],
+                             [- 6.27286842, -0.00054314, 0.00033280, 7.27232528, 0.99834068, 0.99912407, 0.49318885],
+                             [- 6.27286865, -0.00054304, 0.00033274, 7.27232561, 0.99834097, 0.99912422, 0.49318882],
+                             [- 6.27286888, -0.00054295, 0.00033268, 7.27232593, 0.99834126, 0.99912437, 0.49318888],
+                             [- 6.27286910, -0.00054285, 0.00033262, 7.27232625, 0.99834155, 0.99912453, 0.49318890],
+                             [- 6.27286933, -0.00054276, 0.00033256, 7.27232657, 0.99834184, 0.99912468, 0.49318892],
+                             [- 6.27286956, -0.00054266, 0.00033250, 7.27232690, 0.99834214, 0.99912483, 0.49318896],
+                             [- 6.27286979, -0.00054257, 0.00033245, 7.27232722, 0.99834243, 0.99912499, 0.49318900],
+                             [- 6.27287001, -0.00054247, 0.00033239, 7.27232754, 0.99834272, 0.99912514, 0.49318899],
+                             [- 6.27287024, -0.00054238, 0.00033233, 7.27232787, 0.99834301, 0.99912529, 0.49318908],
+                             [- 6.27287047, -0.00054228, 0.00033227, 7.27232819, 0.99834330, 0.99912545, 0.49318910],
+                             [- 6.27287070, -0.00054219, 0.00033221, 7.27232851, 0.99834359, 0.99912560, 0.49318913],
+                             [- 6.27287092, -0.00054209, 0.00033216, 7.27232883, 0.99834388, 0.99912575, 0.49318913],
+                             [- 6.27287115, -0.00054200, 0.00033210, 7.27232915, 0.99834417, 0.99912591, 0.49318919],
+                             [- 6.27287138, -0.00054190, 0.00033204, 7.27232948, 0.99834446, 0.99912606, 0.49318918],
+                             [- 6.27287160, -0.00054181, 0.00033198, 7.27232980, 0.99834475, 0.99912621, 0.49318924],
+                             [- 6.27287183, -0.00054171, 0.00033192, 7.27233012, 0.99834504, 0.99912637, 0.49318928],
+                             [- 6.27287206, -0.00054162, 0.00033186, 7.27233044, 0.99834533, 0.99912652, 0.49318937],
+                             [- 6.27287228, -0.00054152, 0.00033181, 7.27233076, 0.99834562, 0.99912667, 0.49318939],
+                             [- 6.27287251, -0.00054143, 0.00033175, 7.27233108, 0.99834591, 0.99912682, 0.49318942],
+                             [- 6.27287274, -0.00054133, 0.00033169, 7.27233140, 0.99834620, 0.99912698, 0.49318944],
+                             [- 6.27287296, -0.00054124, 0.00033163, 7.27233173, 0.99834649, 0.99912713, 0.49318945],
+                             [- 6.27287319, -0.00054114, 0.00033157, 7.27233205, 0.99834677, 0.99912728, 0.49318948],
+                             [- 6.27287342, -0.00054105, 0.00033152, 7.27233237, 0.99834706, 0.99912744, 0.49318948],
+                             [- 6.27287364, -0.00054095, 0.00033146, 7.27233269, 0.99834735, 0.99912759, 0.49318960],
+                             [- 6.27287387, -0.00054086, 0.00033140, 7.27233301, 0.99834764, 0.99912774, 0.49318965],
+                             [- 6.27287409, -0.00054076, 0.00033134, 7.27233333, 0.99834793, 0.99912789, 0.49318963],
+                             [- 6.27287432, -0.00054067, 0.00033128, 7.27233365, 0.99834822, 0.99912805, 0.49318967],
+                             [- 6.27287455, -0.00054058, 0.00033123, 7.27233397, 0.99834851, 0.99912820, 0.49318974],
+                             [- 6.27287477, -0.00054048, 0.00033117, 7.27233429, 0.99834880, 0.99912835, 0.49318975],
+                             [- 6.27287500, -0.00054039, 0.00033111, 7.27233461, 0.99834908, 0.99912850, 0.49318982],
+                             [- 6.27287522, -0.00054029, 0.00033105, 7.27233493, 0.99834937, 0.99912865, 0.49318976],
+                             [- 6.27287545, -0.00054020, 0.00033100, 7.27233525, 0.99834966, 0.99912881, 0.49318982],
+                             [- 6.27287568, -0.00054010, 0.00033094, 7.27233557, 0.99834995, 0.99912896, 0.49318990],
+                             [- 6.27287590, -0.00054001, 0.00033088, 7.27233589, 0.99835024, 0.99912911, 0.49318991],
+                             [- 6.27287613, -0.00053992, 0.00033082, 7.27233621, 0.99835052, 0.99912926, 0.49318988],
+                             [- 6.27287635, -0.00053982, 0.00033076, 7.27233653, 0.99835081, 0.99912941, 0.49319001],
+                             [- 6.27287658, -0.00053973, 0.00033071, 7.27233685, 0.99835110, 0.99912957, 0.49318998],
+                             [- 6.27287680, -0.00053963, 0.00033065, 7.27233717, 0.99835139, 0.99912972, 0.49319007],
+                             [- 6.27287703, -0.00053954, 0.00033059, 7.27233749, 0.99835168, 0.99912987, 0.49319009],
+                             [- 6.27287725, -0.00053945, 0.00033053, 7.27233781, 0.99835196, 0.99913002, 0.49319013],
+                             [- 6.27287748, -0.00053935, 0.00033048, 7.27233812, 0.99835225, 0.99913017, 0.49319012],
+                             [- 6.27287770, -0.00053926, 0.00033042, 7.27233844, 0.99835254, 0.99913032, 0.49319022],
+                             [- 6.27287793, -0.00053916, 0.00033036, 7.27233876, 0.99835282, 0.99913048, 0.49319019],
+                             [- 6.27287815, -0.00053907, 0.00033030, 7.27233908, 0.99835311, 0.99913063, 0.49319021],
+                             [- 6.27287838, -0.00053898, 0.00033025, 7.27233940, 0.99835340, 0.99913078, 0.49319029],
+                             [- 6.27287860, -0.00053888, 0.00033019, 7.27233972, 0.99835368, 0.99913093, 0.49319029],
+                             [- 6.27287882, -0.00053879, 0.00033013, 7.27234004, 0.99835397, 0.99913108, 0.49319033],
+                             [- 6.27287905, -0.00053869, 0.00033007, 7.27234035, 0.99835426, 0.99913123, 0.49319038],
+                             [- 6.27287927, -0.00053860, 0.00033002, 7.27234067, 0.99835454, 0.99913138, 0.49319044],
+                             [- 6.27287950, -0.00053851, 0.00032996, 7.27234099, 0.99835483, 0.99913153, 0.49319044],
+                             [- 6.27287972, -0.00053841, 0.00032990, 7.27234131, 0.99835512, 0.99913169, 0.49319052],
+                             [- 6.27287994, -0.00053832, 0.00032984, 7.27234162, 0.99835540, 0.99913184, 0.49319053],
+                             [- 6.27288017, -0.00053823, 0.00032979, 7.27234194, 0.99835569, 0.99913199, 0.49319055],
+                             [- 6.27288039, -0.00053813, 0.00032973, 7.27234226, 0.99835598, 0.99913214, 0.49319059],
+                             [- 6.27288062, -0.00053804, 0.00032967, 7.27234258, 0.99835626, 0.99913229, 0.49319064],
+                             [- 6.27288084, -0.00053795, 0.00032961, 7.27234289, 0.99835655, 0.99913244, 0.49319065],
+                             [- 6.27288106, -0.00053785, 0.00032956, 7.27234321, 0.99835683, 0.99913259, 0.49319063],
+                             [- 6.27288129, -0.00053776, 0.00032950, 7.27234353, 0.99835712, 0.99913274, 0.49319073],
+                             [- 6.27288151, -0.00053767, 0.00032944, 7.27234385, 0.99835740, 0.99913289, 0.49319071],
+                             [- 6.27288173, -0.00053757, 0.00032938, 7.27234416, 0.99835769, 0.99913304, 0.49319080],
+                             [- 6.27288196, -0.00053748, 0.00032933, 7.27234448, 0.99835797, 0.99913319, 0.49319079],
+                             [- 6.27288218, -0.00053739, 0.00032927, 7.27234480, 0.99835826, 0.99913334, 0.49319084],
+                             [- 6.27288240, -0.00053729, 0.00032921, 7.27234511, 0.99835854, 0.99913349, 0.49319094],
+                             [- 6.27288263, -0.00053720, 0.00032916, 7.27234543, 0.99835883, 0.99913365, 0.49319090],
+                             [- 6.27288285, -0.00053711, 0.00032910, 7.27234574, 0.99835911, 0.99913380, 0.49319093],
+                             [- 6.27288307, -0.00053701, 0.00032904, 7.27234606, 0.99835940, 0.99913395, 0.49319095],
+                             [- 6.27288330, -0.00053692, 0.00032898, 7.27234638, 0.99835968, 0.99913410, 0.49319102],
+                             [- 6.27288352, -0.00053683, 0.00032893, 7.27234669, 0.99835997, 0.99913425, 0.49319110],
+                             [- 6.27288374, -0.00053673, 0.00032887, 7.27234701, 0.99836025, 0.99913440, 0.49319107],
+                             [- 6.27288396, -0.00053664, 0.00032881, 7.27234732, 0.99836054, 0.99913455, 0.49319115],
+                             [- 6.27288419, -0.00053655, 0.00032876, 7.27234764, 0.99836082, 0.99913470, 0.49319113],
+                             [- 6.27288441, -0.00053645, 0.00032870, 7.27234795, 0.99836111, 0.99913485, 0.49319119],
+                             [- 6.27288463, -0.00053636, 0.00032864, 7.27234827, 0.99836139, 0.99913500, 0.49319119],
+                             [- 6.27288485, -0.00053627, 0.00032859, 7.27234859, 0.99836167, 0.99913515, 0.49319124],
+                             [- 6.27288508, -0.00053618, 0.00032853, 7.27234890, 0.99836196, 0.99913530, 0.49319131],
+                             [- 6.27288530, -0.00053608, 0.00032847, 7.27234922, 0.99836224, 0.99913545, 0.49319132],
+                             [- 6.27288552, -0.00053599, 0.00032841, 7.27234953, 0.99836253, 0.99913560, 0.49319134],
+                             [- 6.27288574, -0.00053590, 0.00032836, 7.27234985, 0.99836281, 0.99913575, 0.49319141],
+                             [- 6.27288596, -0.00053580, 0.00032830, 7.27235016, 0.99836309, 0.99913590, 0.49319142],
+                             [- 6.27288619, -0.00053571, 0.00032824, 7.27235047, 0.99836338, 0.99913604, 0.49319138],
+                             [- 6.27288641, -0.00053562, 0.00032819, 7.27235079, 0.99836366, 0.99913619, 0.49319145],
+                             [- 6.27288663, -0.00053553, 0.00032813, 7.27235110, 0.99836394, 0.99913634, 0.49319149],
+                             [- 6.27288685, -0.00053543, 0.00032807, 7.27235142, 0.99836423, 0.99913649, 0.49319155],
+                             [- 6.27288707, -0.00053534, 0.00032802, 7.27235173, 0.99836451, 0.99913664, 0.49319156],
+                             [- 6.27288729, -0.00053525, 0.00032796, 7.27235205, 0.99836479, 0.99913679, 0.49319156],
+                             [- 6.27288752, -0.00053516, 0.00032790, 7.27235236, 0.99836507, 0.99913694, 0.49319162],
+                             [- 6.27288774, -0.00053506, 0.00032785, 7.27235267, 0.99836536, 0.99913709, 0.49319169],
+                             [- 6.27288796, -0.00053497, 0.00032779, 7.27235299, 0.99836564, 0.99913724, 0.49319169],
+                             [- 6.27288818, -0.00053488, 0.00032773, 7.27235330, 0.99836592, 0.99913739, 0.49319176],
+                             [- 6.27288840, -0.00053479, 0.00032768, 7.27235361, 0.99836620, 0.99913754, 0.49319177],
+                             [- 6.27288862, -0.00053469, 0.00032762, 7.27235393, 0.99836649, 0.99913769, 0.49319182],
+                             [- 6.27288884, -0.00053460, 0.00032756, 7.27235424, 0.99836677, 0.99913784, 0.49319183],
+                             [- 6.27288906, -0.00053451, 0.00032751, 7.27235455, 0.99836705, 0.99913798, 0.49319186],
+                             [- 6.27288928, -0.00053442, 0.00032745, 7.27235487, 0.99836733, 0.99913813, 0.49319195],
+                             [- 6.27288950, -0.00053432, 0.00032739, 7.27235518, 0.99836762, 0.99913828, 0.49319191],
+                             [- 6.27288973, -0.00053423, 0.00032734, 7.27235549, 0.99836790, 0.99913843, 0.49319195],
+                             [- 6.27288995, -0.00053414, 0.00032728, 7.27235581, 0.99836818, 0.99913858, 0.49319198],
+                             [- 6.27289017, -0.00053405, 0.00032722, 7.27235612, 0.99836846, 0.99913873, 0.49319204],
+                             [- 6.27289039, -0.00053396, 0.00032717, 7.27235643, 0.99836874, 0.99913888, 0.49319208],
+                             [- 6.27289061, -0.00053386, 0.00032711, 7.27235674, 0.99836902, 0.99913903, 0.49319213],
+                             [- 6.27289083, -0.00053377, 0.00032705, 7.27235706, 0.99836931, 0.99913917, 0.49319212],
+                             [- 6.27289105, -0.00053368, 0.00032700, 7.27235737, 0.99836959, 0.99913932, 0.49319218],
+                             [- 6.27289127, -0.00053359, 0.00032694, 7.27235768, 0.99836987, 0.99913947, 0.49319222],
+                             [- 6.27289149, -0.00053350, 0.00032689, 7.27235799, 0.99837015, 0.99913962, 0.49319223],
+                             [- 6.27289171, -0.00053340, 0.00032683, 7.27235830, 0.99837043, 0.99913977, 0.49319229],
+                             [- 6.27289193, -0.00053331, 0.00032677, 7.27235862, 0.99837071, 0.99913992, 0.49319228],
+                             [- 6.27289215, -0.00053322, 0.00032672, 7.27235893, 0.99837099, 0.99914006, 0.49319230],
+                             [- 6.27289237, -0.00053313, 0.00032666, 7.27235924, 0.99837127, 0.99914021, 0.49319236],
+                             [- 6.27289259, -0.00053304, 0.00032660, 7.27235955, 0.99837155, 0.99914036, 0.49319240],
+                             [- 6.27289281, -0.00053294, 0.00032655, 7.27235986, 0.99837183, 0.99914051, 0.49319244],
+                             [- 6.27289303, -0.00053285, 0.00032649, 7.27236017, 0.99837211, 0.99914066, 0.49319243],
+                             [- 6.27289325, -0.00053276, 0.00032643, 7.27236048, 0.99837239, 0.99914080, 0.49319249],
+                             [- 6.27289346, -0.00053267, 0.00032638, 7.27236080, 0.99837267, 0.99914095, 0.49319257],
+                             [- 6.27289368, -0.00053258, 0.00032632, 7.27236111, 0.99837295, 0.99914110, 0.49319253],
+                             [- 6.27289390, -0.00053249, 0.00032627, 7.27236142, 0.99837323, 0.99914125, 0.49319261],
+                             [- 6.27289412, -0.00053239, 0.00032621, 7.27236173, 0.99837351, 0.99914140, 0.49319263],
+                             [- 6.27289434, -0.00053230, 0.00032615, 7.27236204, 0.99837379, 0.99914154, 0.49319267],
+                             [- 6.27289456, -0.00053221, 0.00032610, 7.27236235, 0.99837407, 0.99914169, 0.49319271],
+                             [- 6.27289478, -0.00053212, 0.00032604, 7.27236266, 0.99837435, 0.99914184, 0.49319271],
+                             [- 6.27289500, -0.00053203, 0.00032599, 7.27236297, 0.99837463, 0.99914199, 0.49319270],
+                             [- 6.27289522, -0.00053194, 0.00032593, 7.27236328, 0.99837491, 0.99914213, 0.49319278],
+                             [- 6.27289544, -0.00053185, 0.00032587, 7.27236359, 0.99837519, 0.99914228, 0.49319281],
+                             [- 6.27289565, -0.00053175, 0.00032582, 7.27236390, 0.99837547, 0.99914243, 0.49319284],
+                             [- 6.27289587, -0.00053166, 0.00032576, 7.27236421, 0.99837575, 0.99914258, 0.49319286],
+                             [- 6.27289609, -0.00053157, 0.00032571, 7.27236452, 0.99837603, 0.99914272, 0.49319287],
+                             [- 6.27289631, -0.00053148, 0.00032565, 7.27236483, 0.99837631, 0.99914287, 0.49319297],
+                             [- 6.27289653, -0.00053139, 0.00032559, 7.27236514, 0.99837659, 0.99914302, 0.49319300],
+                             [- 6.27289675, -0.00053130, 0.00032554, 7.27236545, 0.99837687, 0.99914316, 0.49319302],
+                             [- 6.27289696, -0.00053121, 0.00032548, 7.27236576, 0.99837714, 0.99914331, 0.49319305],
+                             [- 6.27289718, -0.00053112, 0.00032543, 7.27236607, 0.99837742, 0.99914346, 0.49319306],
+                             [- 6.27289740, -0.00053102, 0.00032537, 7.27236638, 0.99837770, 0.99914361, 0.49319318],
+                             [- 6.27289762, -0.00053093, 0.00032531, 7.27236668, 0.99837798, 0.99914375, 0.49319313],
+                             [- 6.27289784, -0.00053084, 0.00032526, 7.27236699, 0.99837826, 0.99914390, 0.49319318],
+                             [- 6.27289805, -0.00053075, 0.00032520, 7.27236730, 0.99837854, 0.99914405, 0.49319320],
+                             [- 6.27289827, -0.00053066, 0.00032515, 7.27236761, 0.99837881, 0.99914419, 0.49319315],
+                             [- 6.27289849, -0.00053057, 0.00032509, 7.27236792, 0.99837909, 0.99914434, 0.49319329],
+                             [- 6.27289871, -0.00053048, 0.00032504, 7.27236823, 0.99837937, 0.99914449, 0.49319329],
+                             [- 6.27289892, -0.00053039, 0.00032498, 7.27236854, 0.99837965, 0.99914463, 0.49319336],
+                             [- 6.27289914, -0.00053030, 0.00032492, 7.27236884, 0.99837993, 0.99914478, 0.49319338],
+                             [- 6.27289936, -0.00053021, 0.00032487, 7.27236915, 0.99838020, 0.99914493, 0.49319340],
+                             [- 6.27289958, -0.00053012, 0.00032481, 7.27236946, 0.99838048, 0.99914507, 0.49319339],
+                             [- 6.27289979, -0.00053002, 0.00032476, 7.27236977, 0.99838076, 0.99914522, 0.49319350],
+                             [- 6.27290001, -0.00052993, 0.00032470, 7.27237008, 0.99838104, 0.99914536, 0.49319352],
+                             [- 6.27290023, -0.00052984, 0.00032465, 7.27237038, 0.99838131, 0.99914551, 0.49319359],
+                             [- 6.27290044, -0.00052975, 0.00032459, 7.27237069, 0.99838159, 0.99914566, 0.49319354],
+                             [- 6.27290066, -0.00052966, 0.00032453, 7.27237100, 0.99838187, 0.99914580, 0.49319355],
+                             [- 6.27290088, -0.00052957, 0.00032448, 7.27237131, 0.99838214, 0.99914595, 0.49319365],
+                             [- 6.27290109, -0.00052948, 0.00032442, 7.27237161, 0.99838242, 0.99914610, 0.49319372],
+                             [- 6.27290131, -0.00052939, 0.00032437, 7.27237192, 0.99838270, 0.99914624, 0.49319371],
+                             [- 6.27290153, -0.00052930, 0.00032431, 7.27237223, 0.99838297, 0.99914639, 0.49319369],
+                             [- 6.27290174, -0.00052921, 0.00032426, 7.27237254, 0.99838325, 0.99914653, 0.49319379],
+                             [- 6.27290196, -0.00052912, 0.00032420, 7.27237284, 0.99838353, 0.99914668, 0.49319379],
+                             [- 6.27290218, -0.00052903, 0.00032415, 7.27237315, 0.99838380, 0.99914683, 0.49319387],
+                             [- 6.27290239, -0.00052894, 0.00032409, 7.27237346, 0.99838408, 0.99914697, 0.49319384],
+                             [- 6.27290261, -0.00052885, 0.00032404, 7.27237376, 0.99838436, 0.99914712, 0.49319390],
+                             [- 6.27290283, -0.00052876, 0.00032398, 7.27237407, 0.99838463, 0.99914726, 0.49319391],
+                             [- 6.27290304, -0.00052867, 0.00032392, 7.27237438, 0.99838491, 0.99914741, 0.49319397],
+                             [- 6.27290326, -0.00052858, 0.00032387, 7.27237468, 0.99838518, 0.99914755, 0.49319399],
+                             [- 6.27290347, -0.00052849, 0.00032381, 7.27237499, 0.99838546, 0.99914770, 0.49319399],
+                             [- 6.27290369, -0.00052840, 0.00032376, 7.27237529, 0.99838574, 0.99914785, 0.49319402],
+                             [- 6.27290391, -0.00052831, 0.00032370, 7.27237560, 0.99838601, 0.99914799, 0.49319410],
+                             [- 6.27290412, -0.00052822, 0.00032365, 7.27237591, 0.99838629, 0.99914814, 0.49319411],
+                             [- 6.27290434, -0.00052813, 0.00032359, 7.27237621, 0.99838656, 0.99914828, 0.49319417],
+                             [- 6.27290455, -0.00052804, 0.00032354, 7.27237652, 0.99838684, 0.99914843, 0.49319421],
+                             [- 6.27290477, -0.00052795, 0.00032348, 7.27237682, 0.99838711, 0.99914857, 0.49319423],
+                             [- 6.27290498, -0.00052786, 0.00032343, 7.27237713, 0.99838739, 0.99914872, 0.49319424],
+                             [- 6.27290520, -0.00052777, 0.00032337, 7.27237743, 0.99838766, 0.99914886, 0.49319429],
+                             [- 6.27290541, -0.00052768, 0.00032332, 7.27237774, 0.99838794, 0.99914901, 0.49319426],
+                             [- 6.27290563, -0.00052759, 0.00032326, 7.27237804, 0.99838821, 0.99914915, 0.49319434],
+                             [- 6.27290584, -0.00052750, 0.00032321, 7.27237835, 0.99838849, 0.99914930, 0.49319436],
+                             [- 6.27290606, -0.00052741, 0.00032315, 7.27237865, 0.99838876, 0.99914944, 0.49319441],
+                             [- 6.27290627, -0.00052732, 0.00032310, 7.27237896, 0.99838904, 0.99914959, 0.49319443],
+                             [- 6.27290649, -0.00052723, 0.00032304, 7.27237926, 0.99838931, 0.99914973, 0.49319450],
+                             [- 6.27290670, -0.00052714, 0.00032299, 7.27237957, 0.99838959, 0.99914988, 0.49319447],
+                             [- 6.27290692, -0.00052705, 0.00032293, 7.27237987, 0.99838986, 0.99915002, 0.49319454],
+                             [- 6.27290713, -0.00052696, 0.00032288, 7.27238018, 0.99839013, 0.99915017, 0.49319453],
+                             [- 6.27290735, -0.00052687, 0.00032282, 7.27238048, 0.99839041, 0.99915031, 0.49319457],
+                             [- 6.27290756, -0.00052678, 0.00032277, 7.27238078, 0.99839068, 0.99915046, 0.49319463],
+                             [- 6.27290778, -0.00052669, 0.00032271, 7.27238109, 0.99839096, 0.99915060, 0.49319468],
+                             [- 6.27290799, -0.00052660, 0.00032266, 7.27238139, 0.99839123, 0.99915075, 0.49319471],
+                             [- 6.27290821, -0.00052651, 0.00032260, 7.27238170, 0.99839150, 0.99915089, 0.49319472],
+                             [- 6.27290842, -0.00052642, 0.00032255, 7.27238200, 0.99839178, 0.99915103, 0.49319477],
+                             [- 6.27290863, -0.00052633, 0.00032249, 7.27238230, 0.99839205, 0.99915118, 0.49319479],
+                             [- 6.27290885, -0.00052624, 0.00032244, 7.27238261, 0.99839232, 0.99915132, 0.49319479],
+                             [- 6.27290906, -0.00052615, 0.00032238, 7.27238291, 0.99839260, 0.99915147, 0.49319486],
+                             [- 6.27290928, -0.00052606, 0.00032233, 7.27238321, 0.99839287, 0.99915161, 0.49319496],
+                             [- 6.27290949, -0.00052597, 0.00032227, 7.27238352, 0.99839314, 0.99915176, 0.49319494],
+                             [- 6.27290970, -0.00052588, 0.00032222, 7.27238382, 0.99839342, 0.99915190, 0.49319490],
+                             [- 6.27290992, -0.00052579, 0.00032216, 7.27238412, 0.99839369, 0.99915204, 0.49319495],
+                             [- 6.27291013, -0.00052570, 0.00032211, 7.27238443, 0.99839396, 0.99915219, 0.49319503],
+                             [- 6.27291034, -0.00052561, 0.00032205, 7.27238473, 0.99839424, 0.99915233, 0.49319499],
+                             [- 6.27291056, -0.00052553, 0.00032200, 7.27238503, 0.99839451, 0.99915248, 0.49319506],
+                             [- 6.27291077, -0.00052544, 0.00032194, 7.27238534, 0.99839478, 0.99915262, 0.49319516],
+                             [- 6.27291098, -0.00052535, 0.00032189, 7.27238564, 0.99839505, 0.99915276, 0.49319515],
+                             [- 6.27291120, -0.00052526, 0.00032183, 7.27238594, 0.99839533, 0.99915291, 0.49319519],
+                             [- 6.27291141, -0.00052517, 0.00032178, 7.27238624, 0.99839560, 0.99915305, 0.49319519],
+                             [- 6.27291162, -0.00052508, 0.00032173, 7.27238654, 0.99839587, 0.99915320, 0.49319522],
+                             [- 6.27291184, -0.00052499, 0.00032167, 7.27238685, 0.99839614, 0.99915334, 0.49319528],
+                             [- 6.27291205, -0.00052490, 0.00032162, 7.27238715, 0.99839642, 0.99915348, 0.49319533],
+                             [- 6.27291226, -0.00052481, 0.00032156, 7.27238745, 0.99839669, 0.99915363, 0.49319536],
+                             [- 6.27291248, -0.00052472, 0.00032151, 7.27238775, 0.99839696, 0.99915377, 0.49319537],
+                             [- 6.27291269, -0.00052463, 0.00032145, 7.27238805, 0.99839723, 0.99915391, 0.49319544],
+                             [- 6.27291290, -0.00052455, 0.00032140, 7.27238836, 0.99839750, 0.99915406, 0.49319545],
+                             [- 6.27291311, -0.00052446, 0.00032134, 7.27238866, 0.99839777, 0.99915420, 0.49319547],
+                             [- 6.27291333, -0.00052437, 0.00032129, 7.27238896, 0.99839805, 0.99915434, 0.49319547],
+                             [- 6.27291354, -0.00052428, 0.00032123, 7.27238926, 0.99839832, 0.99915449, 0.49319552],
+                             [- 6.27291375, -0.00052419, 0.00032118, 7.27238956, 0.99839859, 0.99915463, 0.49319555],
+                             [- 6.27291396, -0.00052410, 0.00032113, 7.27238986, 0.99839886, 0.99915477, 0.49319555],
+                             [- 6.27291418, -0.00052401, 0.00032107, 7.27239016, 0.99839913, 0.99915492, 0.49319565],
+                             [- 6.27291439, -0.00052392, 0.00032102, 7.27239046, 0.99839940, 0.99915506, 0.49319563],
+                             [- 6.27291460, -0.00052384, 0.00032096, 7.27239077, 0.99839967, 0.99915520, 0.49319565],
+                             [- 6.27291481, -0.00052375, 0.00032091, 7.27239107, 0.99839994, 0.99915534, 0.49319571],
+                             [- 6.27291503, -0.00052366, 0.00032085, 7.27239137, 0.99840021, 0.99915549, 0.49319576],
+                             [- 6.27291524, -0.00052357, 0.00032080, 7.27239167, 0.99840049, 0.99915563, 0.49319577],
+                             [- 6.27291545, -0.00052348, 0.00032075, 7.27239197, 0.99840076, 0.99915577, 0.49319579],
+                             [- 6.27291566, -0.00052339, 0.00032069, 7.27239227, 0.99840103, 0.99915592, 0.49319582],
+                             [- 6.27291587, -0.00052330, 0.00032064, 7.27239257, 0.99840130, 0.99915606, 0.49319587],
+                             [- 6.27291608, -0.00052322, 0.00032058, 7.27239287, 0.99840157, 0.99915620, 0.49319592],
+                             [- 6.27291630, -0.00052313, 0.00032053, 7.27239317, 0.99840184, 0.99915634, 0.49319593],
+                             [- 6.27291651, -0.00052304, 0.00032047, 7.27239347, 0.99840211, 0.99915649, 0.49319594],
+                             [- 6.27291672, -0.00052295, 0.00032042, 7.27239377, 0.99840238, 0.99915663, 0.49319596],
+                             [- 6.27291693, -0.00052286, 0.00032037, 7.27239407, 0.99840265, 0.99915677, 0.49319602],
+                             [- 6.27291714, -0.00052277, 0.00032031, 7.27239437, 0.99840292, 0.99915691, 0.49319607],
+                             [- 6.27291735, -0.00052269, 0.00032026, 7.27239467, 0.99840319, 0.99915706, 0.49319609],
+                             [- 6.27291756, -0.00052260, 0.00032020, 7.27239497, 0.99840346, 0.99915720, 0.49319609],
+                             [- 6.27291777, -0.00052251, 0.00032015, 7.27239526, 0.99840373, 0.99915734, 0.49319619],
+                             [- 6.27291799, -0.00052242, 0.00032010, 7.27239556, 0.99840400, 0.99915748, 0.49319624],
+                             [- 6.27291820, -0.00052233, 0.00032004, 7.27239586, 0.99840427, 0.99915763, 0.49319616],
+                             [- 6.27291841, -0.00052225, 0.00031999, 7.27239616, 0.99840453, 0.99915777, 0.49319625],
+                             [- 6.27291862, -0.00052216, 0.00031993, 7.27239646, 0.99840480, 0.99915791, 0.49319632],
+                             [- 6.27291883, -0.00052207, 0.00031988, 7.27239676, 0.99840507, 0.99915805, 0.49319625],
+                             [- 6.27291904, -0.00052198, 0.00031983, 7.27239706, 0.99840534, 0.99915819, 0.49319634],
+                             [- 6.27291925, -0.00052189, 0.00031977, 7.27239736, 0.99840561, 0.99915834, 0.49319638],
+                             [- 6.27291946, -0.00052180, 0.00031972, 7.27239766, 0.99840588, 0.99915848, 0.49319640],
+                             [- 6.27291967, -0.00052172, 0.00031966, 7.27239795, 0.99840615, 0.99915862, 0.49319643],
+                             [- 6.27291988, -0.00052163, 0.00031961, 7.27239825, 0.99840642, 0.99915876, 0.49319646],
+                             [- 6.27292009, -0.00052154, 0.00031956, 7.27239855, 0.99840669, 0.99915890, 0.49319643],
+                             [- 6.27292030, -0.00052145, 0.00031950, 7.27239885, 0.99840695, 0.99915904, 0.49319651],
+                             [- 6.27292051, -0.00052137, 0.00031945, 7.27239915, 0.99840722, 0.99915919, 0.49319652],
+                             [- 6.27292072, -0.00052128, 0.00031939, 7.27239944, 0.99840749, 0.99915933, 0.49319657],
+                             [- 6.27292093, -0.00052119, 0.00031934, 7.27239974, 0.99840776, 0.99915947, 0.49319663],
+                             [- 6.27292114, -0.00052110, 0.00031929, 7.27240004, 0.99840803, 0.99915961, 0.49319665],
+                             [- 6.27292135, -0.00052101, 0.00031923, 7.27240034, 0.99840830, 0.99915975, 0.49319671],
+                             [- 6.27292156, -0.00052093, 0.00031918, 7.27240063, 0.99840856, 0.99915989, 0.49319676],
+                             [- 6.27292177, -0.00052084, 0.00031913, 7.27240093, 0.99840883, 0.99916004, 0.49319677],
+                             [- 6.27292198, -0.00052075, 0.00031907, 7.27240123, 0.99840910, 0.99916018, 0.49319672],
+                             [- 6.27292219, -0.00052066, 0.00031902, 7.27240153, 0.99840937, 0.99916032, 0.49319676],
+                             [- 6.27292240, -0.00052058, 0.00031896, 7.27240182, 0.99840964, 0.99916046, 0.49319684],
+                             [- 6.27292261, -0.00052049, 0.00031891, 7.27240212, 0.99840990, 0.99916060, 0.49319683],
+                             [- 6.27292282, -0.00052040, 0.00031886, 7.27240242, 0.99841017, 0.99916074, 0.49319688],
+                             [- 6.27292303, -0.00052031, 0.00031880, 7.27240271, 0.99841044, 0.99916088, 0.49319696],
+                             [- 6.27292324, -0.00052023, 0.00031875, 7.27240301, 0.99841070, 0.99916102, 0.49319696],
+                             [- 6.27292345, -0.00052014, 0.00031870, 7.27240331, 0.99841097, 0.99916117, 0.49319698],
+                             [- 6.27292366, -0.00052005, 0.00031864, 7.27240360, 0.99841124, 0.99916131, 0.49319702],
+                             [- 6.27292386, -0.00051996, 0.00031859, 7.27240390, 0.99841151, 0.99916145, 0.49319705],
+                             [- 6.27292407, -0.00051988, 0.00031854, 7.27240420, 0.99841177, 0.99916159, 0.49319708],
+                             [- 6.27292428, -0.00051979, 0.00031848, 7.27240449, 0.99841204, 0.99916173, 0.49319705],
+                             [- 6.27292449, -0.00051970, 0.00031843, 7.27240479, 0.99841231, 0.99916187, 0.49319715],
+                             [- 6.27292470, -0.00051962, 0.00031837, 7.27240508, 0.99841257, 0.99916201, 0.49319716],
+                             [- 6.27292491, -0.00051953, 0.00031832, 7.27240538, 0.99841284, 0.99916215, 0.49319722],
+                             [- 6.27292512, -0.00051944, 0.00031827, 7.27240568, 0.99841311, 0.99916229, 0.49319725],
+                             [- 6.27292533, -0.00051935, 0.00031821, 7.27240597, 0.99841337, 0.99916243, 0.49319725],
+                             [- 6.27292553, -0.00051927, 0.00031816, 7.27240627, 0.99841364, 0.99916257, 0.49319734],
+                             [- 6.27292574, -0.00051918, 0.00031811, 7.27240656, 0.99841390, 0.99916271, 0.49319744],
+                             [- 6.27292595, -0.00051909, 0.00031805, 7.27240686, 0.99841417, 0.99916285, 0.49319739],
+                             [- 6.27292616, -0.00051901, 0.00031800, 7.27240715, 0.99841444, 0.99916299, 0.49319736],
+                             [- 6.27292637, -0.00051892, 0.00031795, 7.27240745, 0.99841470, 0.99916313, 0.49319748],
+                             [- 6.27292658, -0.00051883, 0.00031789, 7.27240774, 0.99841497, 0.99916327, 0.49319747],
+                             [- 6.27292678, -0.00051874, 0.00031784, 7.27240804, 0.99841523, 0.99916341, 0.49319748],
+                             [- 6.27292699, -0.00051866, 0.00031779, 7.27240833, 0.99841550, 0.99916355, 0.49319753],
+                             [- 6.27292720, -0.00051857, 0.00031773, 7.27240863, 0.99841577, 0.99916369, 0.49319759],
+                             [- 6.27292741, -0.00051848, 0.00031768, 7.27240892, 0.99841603, 0.99916384, 0.49319759],
+                             [- 6.27292762, -0.00051840, 0.00031763, 7.27240922, 0.99841630, 0.99916398, 0.49319759],
+                             [- 6.27292782, -0.00051831, 0.00031757, 7.27240951, 0.99841656, 0.99916412, 0.49319764],
+                             [- 6.27292803, -0.00051822, 0.00031752, 7.27240981, 0.99841683, 0.99916426, 0.49319769],
+                             [- 6.27292824, -0.00051814, 0.00031747, 7.27241010, 0.99841709, 0.99916440, 0.49319768],
+                             [- 6.27292845, -0.00051805, 0.00031742, 7.27241040, 0.99841736, 0.99916453, 0.49319773],
+                             [- 6.27292865, -0.00051796, 0.00031736, 7.27241069, 0.99841762, 0.99916467, 0.49319777],
+                             [- 6.27292886, -0.00051788, 0.00031731, 7.27241098, 0.99841789, 0.99916481, 0.49319789],
+                             [- 6.27292907, -0.00051779, 0.00031726, 7.27241128, 0.99841815, 0.99916495, 0.49319781],
+                             [- 6.27292927, -0.00051770, 0.00031720, 7.27241157, 0.99841842, 0.99916509, 0.49319785],
+                             [- 6.27292948, -0.00051762, 0.00031715, 7.27241186, 0.99841868, 0.99916523, 0.49319784],
+                             [- 6.27292969, -0.00051753, 0.00031710, 7.27241216, 0.99841895, 0.99916537, 0.49319795],
+                             [- 6.27292990, -0.00051744, 0.00031704, 7.27241245, 0.99841921, 0.99916551, 0.49319794],
+                             [- 6.27293010, -0.00051736, 0.00031699, 7.27241275, 0.99841947, 0.99916565, 0.49319797],
+                             [- 6.27293031, -0.00051727, 0.00031694, 7.27241304, 0.99841974, 0.99916579, 0.49319807],
+                             [- 6.27293052, -0.00051718, 0.00031688, 7.27241333, 0.99842000, 0.99916593, 0.49319800],
+                             [- 6.27293072, -0.00051710, 0.00031683, 7.27241363, 0.99842027, 0.99916607, 0.49319809],
+                             [- 6.27293093, -0.00051701, 0.00031678, 7.27241392, 0.99842053, 0.99916621, 0.49319811],
+                             [- 6.27293114, -0.00051693, 0.00031673, 7.27241421, 0.99842079, 0.99916635, 0.49319811],
+                             [- 6.27293134, -0.00051684, 0.00031667, 7.27241450, 0.99842106, 0.99916649, 0.49319817],
+                             [- 6.27293155, -0.00051675, 0.00031662, 7.27241480, 0.99842132, 0.99916663, 0.49319820],
+                             [- 6.27293176, -0.00051667, 0.00031657, 7.27241509, 0.99842159, 0.99916677, 0.49319821],
+                             [- 6.27293196, -0.00051658, 0.00031651, 7.27241538, 0.99842185, 0.99916691, 0.49319833],
+                             [- 6.27293217, -0.00051649, 0.00031646, 7.27241567, 0.99842211, 0.99916704, 0.49319829],
+                             [- 6.27293237, -0.00051641, 0.00031641, 7.27241597, 0.99842238, 0.99916718, 0.49319831],
+                             [- 6.27293258, -0.00051632, 0.00031636, 7.27241626, 0.99842264, 0.99916732, 0.49319838],
+                             [- 6.27293279, -0.00051624, 0.00031630, 7.27241655, 0.99842290, 0.99916746, 0.49319843],
+                             [- 6.27293299, -0.00051615, 0.00031625, 7.27241684, 0.99842316, 0.99916760, 0.49319840],
+                             [- 6.27293320, -0.00051606, 0.00031620, 7.27241713, 0.99842343, 0.99916774, 0.49319841],
+                             [- 6.27293340, -0.00051598, 0.00031614, 7.27241743, 0.99842369, 0.99916788, 0.49319849],
+                             [- 6.27293361, -0.00051589, 0.00031609, 7.27241772, 0.99842395, 0.99916802, 0.49319850],
+                             [- 6.27293382, -0.00051581, 0.00031604, 7.27241801, 0.99842422, 0.99916816, 0.49319856],
+                             [- 6.27293402, -0.00051572, 0.00031599, 7.27241830, 0.99842448, 0.99916829, 0.49319860],
+                             [- 6.27293423, -0.00051563, 0.00031593, 7.27241859, 0.99842474, 0.99916843, 0.49319855],
+                             [- 6.27293443, -0.00051555, 0.00031588, 7.27241888, 0.99842500, 0.99916857, 0.49319861],
+                             [- 6.27293464, -0.00051546, 0.00031583, 7.27241918, 0.99842527, 0.99916871, 0.49319870],
+                             [- 6.27293484, -0.00051538, 0.00031578, 7.27241947, 0.99842553, 0.99916885, 0.49319866],
+                             [- 6.27293505, -0.00051529, 0.00031572, 7.27241976, 0.99842579, 0.99916899, 0.49319873],
+                             [- 6.27293525, -0.00051520, 0.00031567, 7.27242005, 0.99842605, 0.99916912, 0.49319872],
+                             [- 6.27293546, -0.00051512, 0.00031562, 7.27242034, 0.99842632, 0.99916926, 0.49319875],
+                             [- 6.27293566, -0.00051503, 0.00031557, 7.27242063, 0.99842658, 0.99916940, 0.49319885],
+                             [- 6.27293587, -0.00051495, 0.00031551, 7.27242092, 0.99842684, 0.99916954, 0.49319881],
+                             [- 6.27293607, -0.00051486, 0.00031546, 7.27242121, 0.99842710, 0.99916968, 0.49319885],
+                             [- 6.27293628, -0.00051478, 0.00031541, 7.27242150, 0.99842736, 0.99916982, 0.49319897],
+                             [- 6.27293648, -0.00051469, 0.00031536, 7.27242179, 0.99842762, 0.99916995, 0.49319898],
+                             [- 6.27293669, -0.00051461, 0.00031530, 7.27242208, 0.99842789, 0.99917009, 0.49319895],
+                             [- 6.27293689, -0.00051452, 0.00031525, 7.27242237, 0.99842815, 0.99917023, 0.49319902],
+                             [- 6.27293710, -0.00051443, 0.00031520, 7.27242266, 0.99842841, 0.99917037, 0.49319899],
+                             [- 6.27293730, -0.00051435, 0.00031515, 7.27242295, 0.99842867, 0.99917051, 0.49319907],
+                             [- 6.27293751, -0.00051426, 0.00031509, 7.27242324, 0.99842893, 0.99917064, 0.49319910],
+                             [- 6.27293771, -0.00051418, 0.00031504, 7.27242353, 0.99842919, 0.99917078, 0.49319911],
+                             [- 6.27293792, -0.00051409, 0.00031499, 7.27242382, 0.99842945, 0.99917092, 0.49319911],
+                             [- 6.27293812, -0.00051401, 0.00031494, 7.27242411, 0.99842971, 0.99917106, 0.49319918],
+                             [- 6.27293832, -0.00051392, 0.00031488, 7.27242440, 0.99842997, 0.99917119, 0.49319923],
+                             [- 6.27293853, -0.00051384, 0.00031483, 7.27242469, 0.99843024, 0.99917133, 0.49319919],
+                             [- 6.27293873, -0.00051375, 0.00031478, 7.27242498, 0.99843050, 0.99917147, 0.49319924],
+                             [- 6.27293894, -0.00051367, 0.00031473, 7.27242527, 0.99843076, 0.99917161, 0.49319925],
+                             [- 6.27293914, -0.00051358, 0.00031467, 7.27242556, 0.99843102, 0.99917174, 0.49319934],
+                             [- 6.27293934, -0.00051350, 0.00031462, 7.27242585, 0.99843128, 0.99917188, 0.49319932],
+                             [- 6.27293955, -0.00051341, 0.00031457, 7.27242614, 0.99843154, 0.99917202, 0.49319938],
+                             [- 6.27293975, -0.00051333, 0.00031452, 7.27242643, 0.99843180, 0.99917216, 0.49319942],
+                             [- 6.27293995, -0.00051324, 0.00031447, 7.27242671, 0.99843206, 0.99917229, 0.49319947],
+                             [- 6.27294016, -0.00051315, 0.00031441, 7.27242700, 0.99843232, 0.99917243, 0.49319948],
+                             [- 6.27294036, -0.00051307, 0.00031436, 7.27242729, 0.99843258, 0.99917257, 0.49319954],
+                             [- 6.27294057, -0.00051298, 0.00031431, 7.27242758, 0.99843284, 0.99917271, 0.49319956],
+                             [- 6.27294077, -0.00051290, 0.00031426, 7.27242787, 0.99843310, 0.99917284, 0.49319957],
+                             [- 6.27294097, -0.00051281, 0.00031421, 7.27242816, 0.99843336, 0.99917298, 0.49319962],
+                             [- 6.27294118, -0.00051273, 0.00031415, 7.27242845, 0.99843362, 0.99917312, 0.49319969],
+                             [- 6.27294138, -0.00051265, 0.00031410, 7.27242873, 0.99843388, 0.99917325, 0.49319972],
+                             [- 6.27294158, -0.00051256, 0.00031405, 7.27242902, 0.99843414, 0.99917339, 0.49319967],
+                             [- 6.27294178, -0.00051248, 0.00031400, 7.27242931, 0.99843439, 0.99917353, 0.49319971],
+                             [- 6.27294199, -0.00051239, 0.00031395, 7.27242960, 0.99843465, 0.99917366, 0.49319975],
+                             [- 6.27294219, -0.00051231, 0.00031389, 7.27242988, 0.99843491, 0.99917380, 0.49319976],
+                             [- 6.27294239, -0.00051222, 0.00031384, 7.27243017, 0.99843517, 0.99917394, 0.49319985],
+                             [- 6.27294260, -0.00051214, 0.00031379, 7.27243046, 0.99843543, 0.99917407, 0.49319980],
+                             [- 6.27294280, -0.00051205, 0.00031374, 7.27243075, 0.99843569, 0.99917421, 0.49319987],
+                             [- 6.27294300, -0.00051197, 0.00031369, 7.27243103, 0.99843595, 0.99917435, 0.49319991],
+                             [- 6.27294320, -0.00051188, 0.00031363, 7.27243132, 0.99843621, 0.99917448, 0.49319996],
+                             [- 6.27294341, -0.00051180, 0.00031358, 7.27243161, 0.99843647, 0.99917462, 0.49320001],
+                             [- 6.27294361, -0.00051171, 0.00031353, 7.27243190, 0.99843673, 0.99917476, 0.49319998],
+                             [- 6.27294381, -0.00051163, 0.00031348, 7.27243218, 0.99843698, 0.99917489, 0.49320000],
+                             [- 6.27294401, -0.00051154, 0.00031343, 7.27243247, 0.99843724, 0.99917503, 0.49320003],
+                             [- 6.27294422, -0.00051146, 0.00031337, 7.27243276, 0.99843750, 0.99917517, 0.49320007],
+                             [- 6.27294442, -0.00051137, 0.00031332, 7.27243304, 0.99843776, 0.99917530, 0.49320006],
+                             [- 6.27294462, -0.00051129, 0.00031327, 7.27243333, 0.99843802, 0.99917544, 0.49320012],
+                             [- 6.27294482, -0.00051121, 0.00031322, 7.27243362, 0.99843827, 0.99917558, 0.49320018],
+                             [- 6.27294502, -0.00051112, 0.00031317, 7.27243390, 0.99843853, 0.99917571, 0.49320018],
+                             [- 6.27294523, -0.00051104, 0.00031312, 7.27243419, 0.99843879, 0.99917585, 0.49320017],
+                             [- 6.27294543, -0.00051095, 0.00031306, 7.27243448, 0.99843905, 0.99917598, 0.49320022],
+                             [- 6.27294563, -0.00051087, 0.00031301, 7.27243476, 0.99843931, 0.99917612, 0.49320033],
+                             [- 6.27294583, -0.00051078, 0.00031296, 7.27243505, 0.99843956, 0.99917626, 0.49320035],
+                             [- 6.27294603, -0.00051070, 0.00031291, 7.27243533, 0.99843982, 0.99917639, 0.49320035],
+                             [- 6.27294623, -0.00051062, 0.00031286, 7.27243562, 0.99844008, 0.99917653, 0.49320037],
+                             [- 6.27294644, -0.00051053, 0.00031281, 7.27243590, 0.99844034, 0.99917666, 0.49320040],
+                             [- 6.27294664, -0.00051045, 0.00031275, 7.27243619, 0.99844059, 0.99917680, 0.49320046],
+                             [- 6.27294684, -0.00051036, 0.00031270, 7.27243648, 0.99844085, 0.99917693, 0.49320050],
+                             [- 6.27294704, -0.00051028, 0.00031265, 7.27243676, 0.99844111, 0.99917707, 0.49320049],
+                             [- 6.27294724, -0.00051019, 0.00031260, 7.27243705, 0.99844136, 0.99917721, 0.49320054],
+                             [- 6.27294744, -0.00051011, 0.00031255, 7.27243733, 0.99844162, 0.99917734, 0.49320055],
+                             [- 6.27294764, -0.00051003, 0.00031250, 7.27243762, 0.99844188, 0.99917748, 0.49320064],
+                             [- 6.27294784, -0.00050994, 0.00031244, 7.27243790, 0.99844214, 0.99917761, 0.49320065],
+                             [- 6.27294805, -0.00050986, 0.00031239, 7.27243819, 0.99844239, 0.99917775, 0.49320067],
+                             [- 6.27294825, -0.00050977, 0.00031234, 7.27243847, 0.99844265, 0.99917788, 0.49320073],
+                             [- 6.27294845, -0.00050969, 0.00031229, 7.27243876, 0.99844291, 0.99917802, 0.49320072],
+                             [- 6.27294865, -0.00050961, 0.00031224, 7.27243904, 0.99844316, 0.99917815, 0.49320076],
+                             [- 6.27294885, -0.00050952, 0.00031219, 7.27243933, 0.99844342, 0.99917829, 0.49320077],
+                             [- 6.27294905, -0.00050944, 0.00031214, 7.27243961, 0.99844367, 0.99917843, 0.49320076],
+                             [- 6.27294925, -0.00050936, 0.00031208, 7.27243989, 0.99844393, 0.99917856, 0.49320084],
+                             [- 6.27294945, -0.00050927, 0.00031203, 7.27244018, 0.99844419, 0.99917870, 0.49320087],
+                             [- 6.27294965, -0.00050919, 0.00031198, 7.27244046, 0.99844444, 0.99917883, 0.49320088],
+                             [- 6.27294985, -0.00050910, 0.00031193, 7.27244075, 0.99844470, 0.99917897, 0.49320097],
+                             [- 6.27295005, -0.00050902, 0.00031188, 7.27244103, 0.99844495, 0.99917910, 0.49320091],
+                             [- 6.27295025, -0.00050894, 0.00031183, 7.27244132, 0.99844521, 0.99917924, 0.49320097],
+                             [- 6.27295045, -0.00050885, 0.00031178, 7.27244160, 0.99844547, 0.99917937, 0.49320101],
+                             [- 6.27295065, -0.00050877, 0.00031173, 7.27244188, 0.99844572, 0.99917951, 0.49320102],
+                             [- 6.27295085, -0.00050869, 0.00031167, 7.27244217, 0.99844598, 0.99917964, 0.49320101],
+                             [- 6.27295105, -0.00050860, 0.00031162, 7.27244245, 0.99844623, 0.99917978, 0.49320112],
+                             [- 6.27295125, -0.00050852, 0.00031157, 7.27244273, 0.99844649, 0.99917991, 0.49320117],
+                             [- 6.27295145, -0.00050844, 0.00031152, 7.27244302, 0.99844674, 0.99918004, 0.49320117],
+                             [- 6.27295165, -0.00050835, 0.00031147, 7.27244330, 0.99844700, 0.99918018, 0.49320119],
+                             [- 6.27295185, -0.00050827, 0.00031142, 7.27244358, 0.99844725, 0.99918031, 0.49320122],
+                             [- 6.27295205, -0.00050818, 0.00031137, 7.27244387, 0.99844751, 0.99918045, 0.49320128],
+                             [- 6.27295225, -0.00050810, 0.00031132, 7.27244415, 0.99844776, 0.99918058, 0.49320130],
+                             [- 6.27295245, -0.00050802, 0.00031126, 7.27244443, 0.99844802, 0.99918072, 0.49320132],
+                             [- 6.27295265, -0.00050793, 0.00031121, 7.27244472, 0.99844827, 0.99918085, 0.49320130],
+                             [- 6.27295285, -0.00050785, 0.00031116, 7.27244500, 0.99844853, 0.99918099, 0.49320137],
+                             [- 6.27295305, -0.00050777, 0.00031111, 7.27244528, 0.99844878, 0.99918112, 0.49320141],
+                             [- 6.27295325, -0.00050768, 0.00031106, 7.27244556, 0.99844904, 0.99918126, 0.49320145],
+                             [- 6.27295345, -0.00050760, 0.00031101, 7.27244585, 0.99844929, 0.99918139, 0.49320144],
+                             [- 6.27295365, -0.00050752, 0.00031096, 7.27244613, 0.99844955, 0.99918152, 0.49320149],
+                             [- 6.27295385, -0.00050743, 0.00031091, 7.27244641, 0.99844980, 0.99918166, 0.49320154],
+                             [- 6.27295404, -0.00050735, 0.00031086, 7.27244669, 0.99845005, 0.99918179, 0.49320156],
+                             [- 6.27295424, -0.00050727, 0.00031081, 7.27244697, 0.99845031, 0.99918193, 0.49320161],
+                             [- 6.27295444, -0.00050719, 0.00031075, 7.27244726, 0.99845056, 0.99918206, 0.49320163],
+                             [- 6.27295464, -0.00050710, 0.00031070, 7.27244754, 0.99845082, 0.99918219, 0.49320168],
+                             [- 6.27295484, -0.00050702, 0.00031065, 7.27244782, 0.99845107, 0.99918233, 0.49320163],
+                             [- 6.27295504, -0.00050694, 0.00031060, 7.27244810, 0.99845132, 0.99918246, 0.49320171],
+                             [- 6.27295524, -0.00050685, 0.00031055, 7.27244838, 0.99845158, 0.99918260, 0.49320174],
+                             [- 6.27295544, -0.00050677, 0.00031050, 7.27244867, 0.99845183, 0.99918273, 0.49320177],
+                             [- 6.27295563, -0.00050669, 0.00031045, 7.27244895, 0.99845208, 0.99918286, 0.49320176],
+                             [- 6.27295583, -0.00050660, 0.00031040, 7.27244923, 0.99845234, 0.99918300, 0.49320182],
+                             [- 6.27295603, -0.00050652, 0.00031035, 7.27244951, 0.99845259, 0.99918313, 0.49320186],
+                             [- 6.27295623, -0.00050644, 0.00031030, 7.27244979, 0.99845284, 0.99918327, 0.49320185],
+                             [- 6.27295643, -0.00050636, 0.00031025, 7.27245007, 0.99845310, 0.99918340, 0.49320186],
+                             [- 6.27295663, -0.00050627, 0.00031019, 7.27245035, 0.99845335, 0.99918353, 0.49320197],
+                             [- 6.27295682, -0.00050619, 0.00031014, 7.27245063, 0.99845360, 0.99918367, 0.49320197],
+                             [- 6.27295702, -0.00050611, 0.00031009, 7.27245091, 0.99845386, 0.99918380, 0.49320194],
+                             [- 6.27295722, -0.00050602, 0.00031004, 7.27245120, 0.99845411, 0.99918393, 0.49320202],
+                             [- 6.27295742, -0.00050594, 0.00030999, 7.27245148, 0.99845436, 0.99918407, 0.49320205],
+                             [- 6.27295762, -0.00050586, 0.00030994, 7.27245176, 0.99845462, 0.99918420, 0.49320207],
+                             [- 6.27295781, -0.00050578, 0.00030989, 7.27245204, 0.99845487, 0.99918433, 0.49320207],
+                             [- 6.27295801, -0.00050569, 0.00030984, 7.27245232, 0.99845512, 0.99918447, 0.49320217],
+                             [- 6.27295821, -0.00050561, 0.00030979, 7.27245260, 0.99845537, 0.99918460, 0.49320221],
+                             [- 6.27295841, -0.00050553, 0.00030974, 7.27245288, 0.99845563, 0.99918473, 0.49320219],
+                             [- 6.27295860, -0.00050545, 0.00030969, 7.27245316, 0.99845588, 0.99918487, 0.49320222],
+                             [- 6.27295880, -0.00050536, 0.00030964, 7.27245344, 0.99845613, 0.99918500, 0.49320228],
+                             [- 6.27295900, -0.00050528, 0.00030959, 7.27245372, 0.99845638, 0.99918513, 0.49320230],
+                             [- 6.27295920, -0.00050520, 0.00030954, 7.27245400, 0.99845663, 0.99918526, 0.49320235],
+                             [- 6.27295939, -0.00050512, 0.00030949, 7.27245428, 0.99845689, 0.99918540, 0.49320231],
+                             [- 6.27295959, -0.00050503, 0.00030944, 7.27245456, 0.99845714, 0.99918553, 0.49320239],
+                             [- 6.27295979, -0.00050495, 0.00030938, 7.27245484, 0.99845739, 0.99918566, 0.49320239],
+                             [- 6.27295998, -0.00050487, 0.00030933, 7.27245512, 0.99845764, 0.99918580, 0.49320243],
+                             [- 6.27296018, -0.00050479, 0.00030928, 7.27245539, 0.99845789, 0.99918593, 0.49320240],
+                             [- 6.27296038, -0.00050470, 0.00030923, 7.27245567, 0.99845814, 0.99918606, 0.49320248],
+                             [- 6.27296058, -0.00050462, 0.00030918, 7.27245595, 0.99845840, 0.99918619, 0.49320254],
+                             [- 6.27296077, -0.00050454, 0.00030913, 7.27245623, 0.99845865, 0.99918633, 0.49320254],
+                             [- 6.27296097, -0.00050446, 0.00030908, 7.27245651, 0.99845890, 0.99918646, 0.49320257],
+                             [- 6.27296117, -0.00050438, 0.00030903, 7.27245679, 0.99845915, 0.99918659, 0.49320260],
+                             [- 6.27296136, -0.00050429, 0.00030898, 7.27245707, 0.99845940, 0.99918673, 0.49320260],
+                             [- 6.27296156, -0.00050421, 0.00030893, 7.27245735, 0.99845965, 0.99918686, 0.49320264],
+                             [- 6.27296176, -0.00050413, 0.00030888, 7.27245763, 0.99845990, 0.99918699, 0.49320270],
+                             [- 6.27296195, -0.00050405, 0.00030883, 7.27245790, 0.99846015, 0.99918712, 0.49320271],
+                             [- 6.27296215, -0.00050397, 0.00030878, 7.27245818, 0.99846040, 0.99918726, 0.49320271],
+                             [- 6.27296234, -0.00050388, 0.00030873, 7.27245846, 0.99846066, 0.99918739, 0.49320279],
+                             [- 6.27296254, -0.00050380, 0.00030868, 7.27245874, 0.99846091, 0.99918752, 0.49320285],
+                             [- 6.27296274, -0.00050372, 0.00030863, 7.27245902, 0.99846116, 0.99918765, 0.49320278],
+                             [- 6.27296293, -0.00050364, 0.00030858, 7.27245930, 0.99846141, 0.99918778, 0.49320286],
+                             [- 6.27296313, -0.00050356, 0.00030853, 7.27245957, 0.99846166, 0.99918792, 0.49320284],
+                             [- 6.27296332, -0.00050347, 0.00030848, 7.27245985, 0.99846191, 0.99918805, 0.49320294],
+                             [- 6.27296352, -0.00050339, 0.00030843, 7.27246013, 0.99846216, 0.99918818, 0.49320297],
+                             [- 6.27296372, -0.00050331, 0.00030838, 7.27246041, 0.99846241, 0.99918831, 0.49320295],
+                             [- 6.27296391, -0.00050323, 0.00030833, 7.27246068, 0.99846266, 0.99918844, 0.49320301],
+                             [- 6.27296411, -0.00050315, 0.00030828, 7.27246096, 0.99846291, 0.99918858, 0.49320303],
+                             [- 6.27296430, -0.00050306, 0.00030823, 7.27246124, 0.99846316, 0.99918871, 0.49320305],
+                             [- 6.27296450, -0.00050298, 0.00030818, 7.27246152, 0.99846341, 0.99918884, 0.49320310],
+                             [- 6.27296469, -0.00050290, 0.00030813, 7.27246179, 0.99846366, 0.99918897, 0.49320314],
+                             [- 6.27296489, -0.00050282, 0.00030808, 7.27246207, 0.99846391, 0.99918910, 0.49320318],
+                             [- 6.27296509, -0.00050274, 0.00030803, 7.27246235, 0.99846416, 0.99918924, 0.49320319],
+                             [- 6.27296528, -0.00050266, 0.00030798, 7.27246263, 0.99846441, 0.99918937, 0.49320326],
+                             [- 6.27296548, -0.00050257, 0.00030793, 7.27246290, 0.99846466, 0.99918950, 0.49320325],
+                             [- 6.27296567, -0.00050249, 0.00030788, 7.27246318, 0.99846490, 0.99918963, 0.49320329],
+                             [- 6.27296587, -0.00050241, 0.00030783, 7.27246346, 0.99846515, 0.99918976, 0.49320330],
+                             [- 6.27296606, -0.00050233, 0.00030778, 7.27246373, 0.99846540, 0.99918989, 0.49320333],
+                             [- 6.27296626, -0.00050225, 0.00030773, 7.27246401, 0.99846565, 0.99919002, 0.49320339],
+                             [- 6.27296645, -0.00050217, 0.00030768, 7.27246429, 0.99846590, 0.99919016, 0.49320339],
+                             [- 6.27296665, -0.00050209, 0.00030763, 7.27246456, 0.99846615, 0.99919029, 0.49320338],
+                             [- 6.27296684, -0.00050200, 0.00030758, 7.27246484, 0.99846640, 0.99919042, 0.49320344],
+                             [- 6.27296704, -0.00050192, 0.00030753, 7.27246511, 0.99846665, 0.99919055, 0.49320353],
+                             [- 6.27296723, -0.00050184, 0.00030748, 7.27246539, 0.99846690, 0.99919068, 0.49320349],
+                             [- 6.27296743, -0.00050176, 0.00030743, 7.27246567, 0.99846715, 0.99919081, 0.49320357],
+                             [- 6.27296762, -0.00050168, 0.00030738, 7.27246594, 0.99846739, 0.99919094, 0.49320354],
+                             [- 6.27296781, -0.00050160, 0.00030733, 7.27246622, 0.99846764, 0.99919108, 0.49320360],
+                             [- 6.27296801, -0.00050152, 0.00030728, 7.27246649, 0.99846789, 0.99919121, 0.49320366],
+                             [- 6.27296820, -0.00050143, 0.00030723, 7.27246677, 0.99846814, 0.99919134, 0.49320363],
+                             [- 6.27296840, -0.00050135, 0.00030718, 7.27246704, 0.99846839, 0.99919147, 0.49320369],
+                             [- 6.27296859, -0.00050127, 0.00030713, 7.27246732, 0.99846864, 0.99919160, 0.49320376],
+                             [- 6.27296879, -0.00050119, 0.00030708, 7.27246760, 0.99846888, 0.99919173, 0.49320377],
+                             [- 6.27296898, -0.00050111, 0.00030703, 7.27246787, 0.99846913, 0.99919186, 0.49320381],
+                             [- 6.27296917, -0.00050103, 0.00030698, 7.27246815, 0.99846938, 0.99919199, 0.49320377],
+                             [- 6.27296937, -0.00050095, 0.00030693, 7.27246842, 0.99846963, 0.99919212, 0.49320384],
+                             [- 6.27296956, -0.00050087, 0.00030688, 7.27246870, 0.99846987, 0.99919225, 0.49320380],
+                             [- 6.27296976, -0.00050079, 0.00030683, 7.27246897, 0.99847012, 0.99919238, 0.49320387],
+                             [- 6.27296995, -0.00050070, 0.00030678, 7.27246925, 0.99847037, 0.99919251, 0.49320387],
+                             [- 6.27297014, -0.00050062, 0.00030673, 7.27246952, 0.99847062, 0.99919265, 0.49320397],
+                             [- 6.27297034, -0.00050054, 0.00030668, 7.27246980, 0.99847086, 0.99919278, 0.49320397],
+                             [- 6.27297053, -0.00050046, 0.00030663, 7.27247007, 0.99847111, 0.99919291, 0.49320399],
+                             [- 6.27297073, -0.00050038, 0.00030658, 7.27247034, 0.99847136, 0.99919304, 0.49320405],
+                             [- 6.27297092, -0.00050030, 0.00030653, 7.27247062, 0.99847161, 0.99919317, 0.49320409],
+                             [- 6.27297111, -0.00050022, 0.00030648, 7.27247089, 0.99847185, 0.99919330, 0.49320412],
+                             [- 6.27297131, -0.00050014, 0.00030643, 7.27247117, 0.99847210, 0.99919343, 0.49320414],
+                             [- 6.27297150, -0.00050006, 0.00030638, 7.27247144, 0.99847235, 0.99919356, 0.49320414],
+                             [- 6.27297169, -0.00049998, 0.00030633, 7.27247172, 0.99847259, 0.99919369, 0.49320417],
+                             [- 6.27297189, -0.00049990, 0.00030629, 7.27247199, 0.99847284, 0.99919382, 0.49320418],
+                             [- 6.27297208, -0.00049982, 0.00030624, 7.27247226, 0.99847309, 0.99919395, 0.49320420],
+                             [- 6.27297227, -0.00049973, 0.00030619, 7.27247254, 0.99847333, 0.99919408, 0.49320426],
+                             [- 6.27297246, -0.00049965, 0.00030614, 7.27247281, 0.99847358, 0.99919421, 0.49320420],
+                             [- 6.27297266, -0.00049957, 0.00030609, 7.27247308, 0.99847383, 0.99919434, 0.49320435],
+                             [- 6.27297285, -0.00049949, 0.00030604, 7.27247336, 0.99847407, 0.99919447, 0.49320431],
+                             [- 6.27297304, -0.00049941, 0.00030599, 7.27247363, 0.99847432, 0.99919460, 0.49320437],
+                             [- 6.27297324, -0.00049933, 0.00030594, 7.27247390, 0.99847457, 0.99919473, 0.49320437],
+                             [- 6.27297343, -0.00049925, 0.00030589, 7.27247418, 0.99847481, 0.99919486, 0.49320443],
+                             [- 6.27297362, -0.00049917, 0.00030584, 7.27247445, 0.99847506, 0.99919499, 0.49320448],
+                             [- 6.27297381, -0.00049909, 0.00030579, 7.27247472, 0.99847530, 0.99919512, 0.49320448],
+                             [- 6.27297401, -0.00049901, 0.00030574, 7.27247500, 0.99847555, 0.99919525, 0.49320449],
+                             [- 6.27297420, -0.00049893, 0.00030569, 7.27247527, 0.99847580, 0.99919538, 0.49320451],
+                             [- 6.27297439, -0.00049885, 0.00030564, 7.27247554, 0.99847604, 0.99919551, 0.49320453],
+                             [- 6.27297458, -0.00049877, 0.00030559, 7.27247582, 0.99847629, 0.99919564, 0.49320461],
+                             [- 6.27297478, -0.00049869, 0.00030554, 7.27247609, 0.99847653, 0.99919577, 0.49320461],
+                             [- 6.27297497, -0.00049861, 0.00030550, 7.27247636, 0.99847678, 0.99919590, 0.49320465],
+                             [- 6.27297516, -0.00049853, 0.00030545, 7.27247663, 0.99847702, 0.99919603, 0.49320475],
+                             [- 6.27297535, -0.00049845, 0.00030540, 7.27247691, 0.99847727, 0.99919616, 0.49320473],
+                             [- 6.27297554, -0.00049837, 0.00030535, 7.27247718, 0.99847751, 0.99919629, 0.49320474],
+                             [- 6.27297574, -0.00049829, 0.00030530, 7.27247745, 0.99847776, 0.99919641, 0.49320475],
+                             [- 6.27297593, -0.00049821, 0.00030525, 7.27247772, 0.99847800, 0.99919654, 0.49320486],
+                             [- 6.27297612, -0.00049813, 0.00030520, 7.27247799, 0.99847825, 0.99919667, 0.49320483],
+                             [- 6.27297631, -0.00049805, 0.00030515, 7.27247827, 0.99847849, 0.99919680, 0.49320494],
+                             [- 6.27297650, -0.00049797, 0.00030510, 7.27247854, 0.99847874, 0.99919693, 0.49320494],
+                             [- 6.27297670, -0.00049789, 0.00030505, 7.27247881, 0.99847898, 0.99919706, 0.49320488],
+                             [- 6.27297689, -0.00049781, 0.00030500, 7.27247908, 0.99847923, 0.99919719, 0.49320497],
+                             [- 6.27297708, -0.00049773, 0.00030495, 7.27247935, 0.99847947, 0.99919732, 0.49320498],
+                             [- 6.27297727, -0.00049765, 0.00030491, 7.27247962, 0.99847972, 0.99919745, 0.49320504],
+                             [- 6.27297746, -0.00049757, 0.00030486, 7.27247990, 0.99847996, 0.99919758, 0.49320498],
+                             [- 6.27297765, -0.00049749, 0.00030481, 7.27248017, 0.99848021, 0.99919771, 0.49320508],
+                             [- 6.27297784, -0.00049741, 0.00030476, 7.27248044, 0.99848045, 0.99919784, 0.49320506],
+                             [- 6.27297804, -0.00049733, 0.00030471, 7.27248071, 0.99848070, 0.99919796, 0.49320512],
+                             [- 6.27297823, -0.00049725, 0.00030466, 7.27248098, 0.99848094, 0.99919809, 0.49320520],
+                             [- 6.27297842, -0.00049717, 0.00030461, 7.27248125, 0.99848118, 0.99919822, 0.49320518],
+                             [- 6.27297861, -0.00049709, 0.00030456, 7.27248152, 0.99848143, 0.99919835, 0.49320519],
+                             [- 6.27297880, -0.00049701, 0.00030451, 7.27248179, 0.99848167, 0.99919848, 0.49320524],
+                             [- 6.27297899, -0.00049693, 0.00030446, 7.27248206, 0.99848192, 0.99919861, 0.49320527],
+                             [- 6.27297918, -0.00049685, 0.00030442, 7.27248233, 0.99848216, 0.99919874, 0.49320529],
+                             [- 6.27297937, -0.00049677, 0.00030437, 7.27248260, 0.99848240, 0.99919887, 0.49320530],
+                             [- 6.27297956, -0.00049669, 0.00030432, 7.27248288, 0.99848265, 0.99919899, 0.49320533],
+                             [- 6.27297975, -0.00049661, 0.00030427, 7.27248315, 0.99848289, 0.99919912, 0.49320533],
+                             [- 6.27297994, -0.00049653, 0.00030422, 7.27248342, 0.99848313, 0.99919925, 0.49320545],
+                             [- 6.27298013, -0.00049645, 0.00030417, 7.27248369, 0.99848338, 0.99919938, 0.49320550],
+                             [- 6.27298033, -0.00049637, 0.00030412, 7.27248396, 0.99848362, 0.99919951, 0.49320544],
+                             [- 6.27298052, -0.00049629, 0.00030407, 7.27248423, 0.99848386, 0.99919964, 0.49320542],
+                             [- 6.27298071, -0.00049621, 0.00030403, 7.27248450, 0.99848411, 0.99919976, 0.49320549],
+                             [- 6.27298090, -0.00049613, 0.00030398, 7.27248477, 0.99848435, 0.99919989, 0.49320553],
+                             [- 6.27298109, -0.00049605, 0.00030393, 7.27248504, 0.99848459, 0.99920002, 0.49320549],
+                             [- 6.27298128, -0.00049597, 0.00030388, 7.27248531, 0.99848484, 0.99920015, 0.49320559],
+                             [- 6.27298147, -0.00049589, 0.00030383, 7.27248557, 0.99848508, 0.99920028, 0.49320560],
+                             [- 6.27298166, -0.00049581, 0.00030378, 7.27248584, 0.99848532, 0.99920041, 0.49320562],
+                             [- 6.27298185, -0.00049573, 0.00030373, 7.27248611, 0.99848556, 0.99920053, 0.49320572],
+                             [- 6.27298204, -0.00049565, 0.00030368, 7.27248638, 0.99848581, 0.99920066, 0.49320570],
+                             [- 6.27298223, -0.00049557, 0.00030364, 7.27248665, 0.99848605, 0.99920079, 0.49320571],
+                             [- 6.27298242, -0.00049550, 0.00030359, 7.27248692, 0.99848629, 0.99920092, 0.49320573],
+                             [- 6.27298261, -0.00049542, 0.00030354, 7.27248719, 0.99848653, 0.99920105, 0.49320576],
+                             [- 6.27298280, -0.00049534, 0.00030349, 7.27248746, 0.99848678, 0.99920117, 0.49320585],
+                             [- 6.27298299, -0.00049526, 0.00030344, 7.27248773, 0.99848702, 0.99920130, 0.49320584],
+                             [- 6.27298318, -0.00049518, 0.00030339, 7.27248800, 0.99848726, 0.99920143, 0.49320590],
+                             [- 6.27298336, -0.00049510, 0.00030334, 7.27248827, 0.99848750, 0.99920156, 0.49320592],
+                             [- 6.27298355, -0.00049502, 0.00030330, 7.27248853, 0.99848774, 0.99920168, 0.49320594],
+                             [- 6.27298374, -0.00049494, 0.00030325, 7.27248880, 0.99848799, 0.99920181, 0.49320595],
+                             [- 6.27298393, -0.00049486, 0.00030320, 7.27248907, 0.99848823, 0.99920194, 0.49320597],
+                             [- 6.27298412, -0.00049478, 0.00030315, 7.27248934, 0.99848847, 0.99920207, 0.49320596],
+                             [- 6.27298431, -0.00049470, 0.00030310, 7.27248961, 0.99848871, 0.99920220, 0.49320603],
+                             [- 6.27298450, -0.00049462, 0.00030305, 7.27248988, 0.99848895, 0.99920232, 0.49320613],
+                             [- 6.27298469, -0.00049455, 0.00030300, 7.27249014, 0.99848919, 0.99920245, 0.49320607],
+                             [- 6.27298488, -0.00049447, 0.00030296, 7.27249041, 0.99848944, 0.99920258, 0.49320616],
+                             [- 6.27298507, -0.00049439, 0.00030291, 7.27249068, 0.99848968, 0.99920270, 0.49320618],
+                             [- 6.27298526, -0.00049431, 0.00030286, 7.27249095, 0.99848992, 0.99920283, 0.49320613],
+                             [- 6.27298545, -0.00049423, 0.00030281, 7.27249122, 0.99849016, 0.99920296, 0.49320620],
+                             [- 6.27298563, -0.00049415, 0.00030276, 7.27249148, 0.99849040, 0.99920309, 0.49320622],
+                             [- 6.27298582, -0.00049407, 0.00030271, 7.27249175, 0.99849064, 0.99920321, 0.49320626],
+                             [- 6.27298601, -0.00049399, 0.00030267, 7.27249202, 0.99849088, 0.99920334, 0.49320625],
+                             [- 6.27298620, -0.00049391, 0.00030262, 7.27249229, 0.99849112, 0.99920347, 0.49320640],
+                             [- 6.27298639, -0.00049384, 0.00030257, 7.27249255, 0.99849136, 0.99920360, 0.49320640],
+                             [- 6.27298658, -0.00049376, 0.00030252, 7.27249282, 0.99849161, 0.99920372, 0.49320636],
+                             [- 6.27298677, -0.00049368, 0.00030247, 7.27249309, 0.99849185, 0.99920385, 0.49320641],
+                             [- 6.27298695, -0.00049360, 0.00030242, 7.27249336, 0.99849209, 0.99920398, 0.49320644],
+                             [- 6.27298714, -0.00049352, 0.00030238, 7.27249362, 0.99849233, 0.99920410, 0.49320643],
+                             [- 6.27298733, -0.00049344, 0.00030233, 7.27249389, 0.99849257, 0.99920423, 0.49320647],
+                             [- 6.27298752, -0.00049336, 0.00030228, 7.27249416, 0.99849281, 0.99920436, 0.49320649],
+                             [- 6.27298771, -0.00049328, 0.00030223, 7.27249442, 0.99849305, 0.99920448, 0.49320659],
+                             [- 6.27298790, -0.00049321, 0.00030218, 7.27249469, 0.99849329, 0.99920461, 0.49320657],
+                             [- 6.27298808, -0.00049313, 0.00030214, 7.27249496, 0.99849353, 0.99920474, 0.49320661],
+                             [- 6.27298827, -0.00049305, 0.00030209, 7.27249522, 0.99849377, 0.99920486, 0.49320660],
+                             [- 6.27298846, -0.00049297, 0.00030204, 7.27249549, 0.99849401, 0.99920499, 0.49320663],
+                             [- 6.27298865, -0.00049289, 0.00030199, 7.27249576, 0.99849425, 0.99920512, 0.49320673],
+                             [- 6.27298883, -0.00049281, 0.00030194, 7.27249602, 0.99849449, 0.99920524, 0.49320673],
+                             [- 6.27298902, -0.00049273, 0.00030189, 7.27249629, 0.99849473, 0.99920537, 0.49320669],
+                             [- 6.27298921, -0.00049266, 0.00030185, 7.27249655, 0.99849497, 0.99920550, 0.49320677],
+                             [- 6.27298940, -0.00049258, 0.00030180, 7.27249682, 0.99849521, 0.99920562, 0.49320680],
+                             [- 6.27298959, -0.00049250, 0.00030175, 7.27249709, 0.99849545, 0.99920575, 0.49320687],
+                             [- 6.27298977, -0.00049242, 0.00030170, 7.27249735, 0.99849569, 0.99920588, 0.49320693],
+                             [- 6.27298996, -0.00049234, 0.00030165, 7.27249762, 0.99849593, 0.99920600, 0.49320681],
+                             [- 6.27299015, -0.00049226, 0.00030161, 7.27249788, 0.99849616, 0.99920613, 0.49320699],
+                             [- 6.27299033, -0.00049219, 0.00030156, 7.27249815, 0.99849640, 0.99920626, 0.49320687],
+                             [- 6.27299052, -0.00049211, 0.00030151, 7.27249841, 0.99849664, 0.99920638, 0.49320699],
+                             [- 6.27299071, -0.00049203, 0.00030146, 7.27249868, 0.99849688, 0.99920651, 0.49320705],
+                             [- 6.27299090, -0.00049195, 0.00030141, 7.27249894, 0.99849712, 0.99920663, 0.49320709],
+                             [- 6.27299108, -0.00049187, 0.00030137, 7.27249921, 0.99849736, 0.99920676, 0.49320704],
+                             [- 6.27299127, -0.00049180, 0.00030132, 7.27249948, 0.99849760, 0.99920689, 0.49320700],
+                             [- 6.27299146, -0.00049172, 0.00030127, 7.27249974, 0.99849784, 0.99920701, 0.49320709],
+                             [- 6.27299164, -0.00049164, 0.00030122, 7.27250001, 0.99849808, 0.99920714, 0.49320722],
+                             [- 6.27299183, -0.00049156, 0.00030118, 7.27250027, 0.99849831, 0.99920726, 0.49320713],
+                             [- 6.27299202, -0.00049148, 0.00030113, 7.27250053, 0.99849855, 0.99920739, 0.49320717],
+                             [- 6.27299220, -0.00049140, 0.00030108, 7.27250080, 0.99849879, 0.99920752, 0.49320720],
+                             [- 6.27299239, -0.00049133, 0.00030103, 7.27250106, 0.99849903, 0.99920764, 0.49320724],
+                             [- 6.27299258, -0.00049125, 0.00030098, 7.27250133, 0.99849927, 0.99920777, 0.49320731],
+                             [- 6.27299276, -0.00049117, 0.00030094, 7.27250159, 0.99849951, 0.99920789, 0.49320733],
+                             [- 6.27299295, -0.00049109, 0.00030089, 7.27250186, 0.99849974, 0.99920802, 0.49320736],
+                             [- 6.27299314, -0.00049102, 0.00030084, 7.27250212, 0.99849998, 0.99920814, 0.49320742],
+                             [- 6.27299332, -0.00049094, 0.00030079, 7.27250239, 0.99850022, 0.99920827, 0.49320737],
+                             [- 6.27299351, -0.00049086, 0.00030075, 7.27250265, 0.99850046, 0.99920840, 0.49320741],
+                             [- 6.27299370, -0.00049078, 0.00030070, 7.27250291, 0.99850070, 0.99920852, 0.49320747],
+                             [- 6.27299388, -0.00049070, 0.00030065, 7.27250318, 0.99850093, 0.99920865, 0.49320746],
+                             [- 6.27299407, -0.00049063, 0.00030060, 7.27250344, 0.99850117, 0.99920877, 0.49320747],
+                             [- 6.27299425, -0.00049055, 0.00030055, 7.27250371, 0.99850141, 0.99920890, 0.49320753],
+                             [- 6.27299444, -0.00049047, 0.00030051, 7.27250397, 0.99850165, 0.99920902, 0.49320754],
+                             [- 6.27299463, -0.00049039, 0.00030046, 7.27250423, 0.99850188, 0.99920915, 0.49320761],
+                             [- 6.27299481, -0.00049032, 0.00030041, 7.27250450, 0.99850212, 0.99920927, 0.49320761],
+                             [- 6.27299500, -0.00049024, 0.00030036, 7.27250476, 0.99850236, 0.99920940, 0.49320763],
+                             [- 6.27299518, -0.00049016, 0.00030032, 7.27250502, 0.99850260, 0.99920952, 0.49320763],
+                             [- 6.27299537, -0.00049008, 0.00030027, 7.27250529, 0.99850283, 0.99920965, 0.49320764],
+                             [- 6.27299556, -0.00049000, 0.00030022, 7.27250555, 0.99850307, 0.99920977, 0.49320768],
+                             [- 6.27299574, -0.00048993, 0.00030017, 7.27250581, 0.99850331, 0.99920990, 0.49320774],
+                             [- 6.27299593, -0.00048985, 0.00030013, 7.27250608, 0.99850354, 0.99921002, 0.49320770],
+                             [- 6.27299611, -0.00048977, 0.00030008, 7.27250634, 0.99850378, 0.99921015, 0.49320782],
+                             [- 6.27299630, -0.00048969, 0.00030003, 7.27250660, 0.99850402, 0.99921027, 0.49320781],
+                             [- 6.27299648, -0.00048962, 0.00029998, 7.27250687, 0.99850426, 0.99921040, 0.49320784],
+                             [- 6.27299667, -0.00048954, 0.00029994, 7.27250713, 0.99850449, 0.99921052, 0.49320787],
+                             [- 6.27299685, -0.00048946, 0.00029989, 7.27250739, 0.99850473, 0.99921065, 0.49320791],
+                             [- 6.27299704, -0.00048938, 0.00029984, 7.27250765, 0.99850496, 0.99921077, 0.49320794],
+                             [- 6.27299722, -0.00048931, 0.00029979, 7.27250792, 0.99850520, 0.99921090, 0.49320795],
+                             [- 6.27299741, -0.00048923, 0.00029975, 7.27250818, 0.99850544, 0.99921102, 0.49320801],
+                             [- 6.27299759, -0.00048915, 0.00029970, 7.27250844, 0.99850567, 0.99921115, 0.49320802],
+                             [- 6.27299778, -0.00048908, 0.00029965, 7.27250870, 0.99850591, 0.99921127, 0.49320805],
+                             [- 6.27299796, -0.00048900, 0.00029960, 7.27250896, 0.99850615, 0.99921140, 0.49320810],
+                             [- 6.27299815, -0.00048892, 0.00029956, 7.27250923, 0.99850638, 0.99921152, 0.49320806],
+                             [- 6.27299833, -0.00048884, 0.00029951, 7.27250949, 0.99850662, 0.99921165, 0.49320815],
+                             [- 6.27299852, -0.00048877, 0.00029946, 7.27250975, 0.99850685, 0.99921177, 0.49320816],
+                             [- 6.27299870, -0.00048869, 0.00029941, 7.27251001, 0.99850709, 0.99921190, 0.49320817],
+                             [- 6.27299889, -0.00048861, 0.00029937, 7.27251027, 0.99850733, 0.99921202, 0.49320820],
+                             [- 6.27299907, -0.00048854, 0.00029932, 7.27251054, 0.99850756, 0.99921214, 0.49320826],
+                             [- 6.27299926, -0.00048846, 0.00029927, 7.27251080, 0.99850780, 0.99921227, 0.49320827],
+                             [- 6.27299944, -0.00048838, 0.00029923, 7.27251106, 0.99850803, 0.99921239, 0.49320823],
+                             [- 6.27299962, -0.00048830, 0.00029918, 7.27251132, 0.99850827, 0.99921252, 0.49320833],
+                             [- 6.27299981, -0.00048823, 0.00029913, 7.27251158, 0.99850850, 0.99921264, 0.49320833],
+                             [- 6.27299999, -0.00048815, 0.00029908, 7.27251184, 0.99850874, 0.99921277, 0.49320839],
+                             [- 6.27300018, -0.00048807, 0.00029904, 7.27251210, 0.99850897, 0.99921289, 0.49320841],
+                             [- 6.27300036, -0.00048800, 0.00029899, 7.27251236, 0.99850921, 0.99921301, 0.49320850],
+                             [- 6.27300055, -0.00048792, 0.00029894, 7.27251263, 0.99850944, 0.99921314, 0.49320846],
+                             [- 6.27300073, -0.00048784, 0.00029890, 7.27251289, 0.99850968, 0.99921326, 0.49320848],
+                             [- 6.27300091, -0.00048777, 0.00029885, 7.27251315, 0.99850991, 0.99921339, 0.49320847],
+                             [- 6.27300110, -0.00048769, 0.00029880, 7.27251341, 0.99851015, 0.99921351, 0.49320858],
+                             [- 6.27300128, -0.00048761, 0.00029875, 7.27251367, 0.99851038, 0.99921363, 0.49320864],
+                             [- 6.27300146, -0.00048754, 0.00029871, 7.27251393, 0.99851062, 0.99921376, 0.49320855],
+                             [- 6.27300165, -0.00048746, 0.00029866, 7.27251419, 0.99851085, 0.99921388, 0.49320856],
+                             [- 6.27300183, -0.00048738, 0.00029861, 7.27251445, 0.99851109, 0.99921401, 0.49320863],
+                             [- 6.27300202, -0.00048730, 0.00029857, 7.27251471, 0.99851132, 0.99921413, 0.49320867],
+                             [- 6.27300220, -0.00048723, 0.00029852, 7.27251497, 0.99851156, 0.99921425, 0.49320861],
+                             [- 6.27300238, -0.00048715, 0.00029847, 7.27251523, 0.99851179, 0.99921438, 0.49320874],
+                             [- 6.27300257, -0.00048707, 0.00029842, 7.27251549, 0.99851202, 0.99921450, 0.49320874],
+                             [- 6.27300275, -0.00048700, 0.00029838, 7.27251575, 0.99851226, 0.99921462, 0.49320881],
+                             [- 6.27300293, -0.00048692, 0.00029833, 7.27251601, 0.99851249, 0.99921475, 0.49320880],
+                             [- 6.27300312, -0.00048685, 0.00029828, 7.27251627, 0.99851273, 0.99921487, 0.49320887],
+                             [- 6.27300330, -0.00048677, 0.00029824, 7.27251653, 0.99851296, 0.99921499, 0.49320886],
+                             [- 6.27300348, -0.00048669, 0.00029819, 7.27251679, 0.99851320, 0.99921512, 0.49320893],
+                             [- 6.27300367, -0.00048662, 0.00029814, 7.27251705, 0.99851343, 0.99921524, 0.49320893],
+                             [- 6.27300385, -0.00048654, 0.00029810, 7.27251731, 0.99851366, 0.99921536, 0.49320895],
+                             [- 6.27300403, -0.00048646, 0.00029805, 7.27251757, 0.99851390, 0.99921549, 0.49320892],
+                             [- 6.27300421, -0.00048639, 0.00029800, 7.27251783, 0.99851413, 0.99921561, 0.49320898],
+                             [- 6.27300440, -0.00048631, 0.00029796, 7.27251809, 0.99851436, 0.99921573, 0.49320901],
+                             [- 6.27300458, -0.00048623, 0.00029791, 7.27251835, 0.99851460, 0.99921586, 0.49320901],
+                             [- 6.27300476, -0.00048616, 0.00029786, 7.27251861, 0.99851483, 0.99921598, 0.49320912],
+                             [- 6.27300495, -0.00048608, 0.00029782, 7.27251886, 0.99851506, 0.99921610, 0.49320910],
+                             [- 6.27300513, -0.00048600, 0.00029777, 7.27251912, 0.99851530, 0.99921623, 0.49320913],
+                             [- 6.27300531, -0.00048593, 0.00029772, 7.27251938, 0.99851553, 0.99921635, 0.49320917],
+                             [- 6.27300549, -0.00048585, 0.00029768, 7.27251964, 0.99851576, 0.99921647, 0.49320916],
+                             [- 6.27300568, -0.00048578, 0.00029763, 7.27251990, 0.99851600, 0.99921660, 0.49320920],
+                             [- 6.27300586, -0.00048570, 0.00029758, 7.27252016, 0.99851623, 0.99921672, 0.49320924],
+                             [- 6.27300604, -0.00048562, 0.00029753, 7.27252042, 0.99851646, 0.99921684, 0.49320926],
+                             [- 6.27300622, -0.00048555, 0.00029749, 7.27252068, 0.99851669, 0.99921696, 0.49320930],
+                             [- 6.27300640, -0.00048547, 0.00029744, 7.27252093, 0.99851693, 0.99921709, 0.49320931],
+                             [- 6.27300659, -0.00048539, 0.00029739, 7.27252119, 0.99851716, 0.99921721, 0.49320938],
+                             [- 6.27300677, -0.00048532, 0.00029735, 7.27252145, 0.99851739, 0.99921733, 0.49320939],
+                             [- 6.27300695, -0.00048524, 0.00029730, 7.27252171, 0.99851763, 0.99921746, 0.49320948],
+                             [- 6.27300713, -0.00048517, 0.00029725, 7.27252197, 0.99851786, 0.99921758, 0.49320954],
+                             [- 6.27300732, -0.00048509, 0.00029721, 7.27252222, 0.99851809, 0.99921770, 0.49320950],
+                             [- 6.27300750, -0.00048501, 0.00029716, 7.27252248, 0.99851832, 0.99921782, 0.49320952],
+                             [- 6.27300768, -0.00048494, 0.00029712, 7.27252274, 0.99851855, 0.99921795, 0.49320954],
+                             [- 6.27300786, -0.00048486, 0.00029707, 7.27252300, 0.99851879, 0.99921807, 0.49320960],
+                             [- 6.27300804, -0.00048479, 0.00029702, 7.27252326, 0.99851902, 0.99921819, 0.49320959],
+                             [- 6.27300822, -0.00048471, 0.00029698, 7.27252351, 0.99851925, 0.99921831, 0.49320958],
+                             [- 6.27300841, -0.00048463, 0.00029693, 7.27252377, 0.99851948, 0.99921844, 0.49320965],
+                             [- 6.27300859, -0.00048456, 0.00029688, 7.27252403, 0.99851971, 0.99921856, 0.49320967],
+                             [- 6.27300877, -0.00048448, 0.00029684, 7.27252429, 0.99851995, 0.99921868, 0.49320972],
+                             [- 6.27300895, -0.00048441, 0.00029679, 7.27252454, 0.99852018, 0.99921880, 0.49320973],
+                             [- 6.27300913, -0.00048433, 0.00029674, 7.27252480, 0.99852041, 0.99921893, 0.49320972],
+                             [- 6.27300931, -0.00048426, 0.00029670, 7.27252506, 0.99852064, 0.99921905, 0.49320980],
+                             [- 6.27300949, -0.00048418, 0.00029665, 7.27252531, 0.99852087, 0.99921917, 0.49320981],
+                             [- 6.27300968, -0.00048410, 0.00029660, 7.27252557, 0.99852110, 0.99921929, 0.49320974],
+                             [- 6.27300986, -0.00048403, 0.00029656, 7.27252583, 0.99852134, 0.99921941, 0.49320985],
+                             [- 6.27301004, -0.00048395, 0.00029651, 7.27252608, 0.99852157, 0.99921954, 0.49320992],
+                             [- 6.27301022, -0.00048388, 0.00029646, 7.27252634, 0.99852180, 0.99921966, 0.49320992],
+                             [- 6.27301040, -0.00048380, 0.00029642, 7.27252660, 0.99852203, 0.99921978, 0.49320993],
+                             [- 6.27301058, -0.00048373, 0.00029637, 7.27252685, 0.99852226, 0.99921990, 0.49320993],
+                             [- 6.27301076, -0.00048365, 0.00029633, 7.27252711, 0.99852249, 0.99922002, 0.49321001],
+                             [- 6.27301094, -0.00048357, 0.00029628, 7.27252737, 0.99852272, 0.99922015, 0.49321003],
+                             [- 6.27301112, -0.00048350, 0.00029623, 7.27252762, 0.99852295, 0.99922027, 0.49321005],
+                             [- 6.27301130, -0.00048342, 0.00029619, 7.27252788, 0.99852318, 0.99922039, 0.49321008],
+                             [- 6.27301148, -0.00048335, 0.00029614, 7.27252814, 0.99852341, 0.99922051, 0.49321008],
+                             [- 6.27301166, -0.00048327, 0.00029609, 7.27252839, 0.99852364, 0.99922063, 0.49321010],
+                             [- 6.27301185, -0.00048320, 0.00029605, 7.27252865, 0.99852388, 0.99922075, 0.49321017],
+                             [- 6.27301203, -0.00048312, 0.00029600, 7.27252890, 0.99852411, 0.99922088, 0.49321023],
+                             [- 6.27301221, -0.00048305, 0.00029596, 7.27252916, 0.99852434, 0.99922100, 0.49321020],
+                             [- 6.27301239, -0.00048297, 0.00029591, 7.27252942, 0.99852457, 0.99922112, 0.49321023],
+                             [- 6.27301257, -0.00048290, 0.00029586, 7.27252967, 0.99852480, 0.99922124, 0.49321024],
+                             [- 6.27301275, -0.00048282, 0.00029582, 7.27252993, 0.99852503, 0.99922136, 0.49321030],
+                             [- 6.27301293, -0.00048275, 0.00029577, 7.27253018, 0.99852526, 0.99922148, 0.49321031],
+                             [- 6.27301311, -0.00048267, 0.00029572, 7.27253044, 0.99852549, 0.99922161, 0.49321030],
+                             [- 6.27301329, -0.00048259, 0.00029568, 7.27253069, 0.99852572, 0.99922173, 0.49321030],
+                             [- 6.27301347, -0.00048252, 0.00029563, 7.27253095, 0.99852595, 0.99922185, 0.49321039],
+                             [- 6.27301365, -0.00048244, 0.00029559, 7.27253120, 0.99852618, 0.99922197, 0.49321037],
+                             [- 6.27301383, -0.00048237, 0.00029554, 7.27253146, 0.99852641, 0.99922209, 0.49321046],
+                             [- 6.27301401, -0.00048229, 0.00029549, 7.27253171, 0.99852664, 0.99922221, 0.49321048],
+                             [- 6.27301419, -0.00048222, 0.00029545, 7.27253197, 0.99852687, 0.99922233, 0.49321049],
+                             [- 6.27301437, -0.00048214, 0.00029540, 7.27253222, 0.99852710, 0.99922245, 0.49321046],
+                             [- 6.27301455, -0.00048207, 0.00029536, 7.27253248, 0.99852732, 0.99922258, 0.49321053],
+                             [- 6.27301473, -0.00048199, 0.00029531, 7.27253273, 0.99852755, 0.99922270, 0.49321060],
+                             [- 6.27301491, -0.00048192, 0.00029526, 7.27253299, 0.99852778, 0.99922282, 0.49321066],
+                             [- 6.27301509, -0.00048184, 0.00029522, 7.27253324, 0.99852801, 0.99922294, 0.49321062],
+                             [- 6.27301526, -0.00048177, 0.00029517, 7.27253350, 0.99852824, 0.99922306, 0.49321065],
+                             [- 6.27301544, -0.00048169, 0.00029513, 7.27253375, 0.99852847, 0.99922318, 0.49321069],
+                             [- 6.27301562, -0.00048162, 0.00029508, 7.27253400, 0.99852870, 0.99922330, 0.49321066],
+                             [- 6.27301580, -0.00048154, 0.00029503, 7.27253426, 0.99852893, 0.99922342, 0.49321075],
+                             [- 6.27301598, -0.00048147, 0.00029499, 7.27253451, 0.99852916, 0.99922354, 0.49321074],
+                             [- 6.27301616, -0.00048139, 0.00029494, 7.27253477, 0.99852939, 0.99922366, 0.49321082],
+                             [- 6.27301634, -0.00048132, 0.00029490, 7.27253502, 0.99852962, 0.99922378, 0.49321081],
+                             [- 6.27301652, -0.00048124, 0.00029485, 7.27253528, 0.99852984, 0.99922391, 0.49321083],
+                             [- 6.27301670, -0.00048117, 0.00029480, 7.27253553, 0.99853007, 0.99922403, 0.49321094],
+                             [- 6.27301688, -0.00048109, 0.00029476, 7.27253578, 0.99853030, 0.99922415, 0.49321096],
+                             [- 6.27301706, -0.00048102, 0.00029471, 7.27253604, 0.99853053, 0.99922427, 0.49321093],
+                             [- 6.27301724, -0.00048095, 0.00029467, 7.27253629, 0.99853076, 0.99922439, 0.49321094],
+                             [- 6.27301741, -0.00048087, 0.00029462, 7.27253654, 0.99853099, 0.99922451, 0.49321098],
+                             [- 6.27301759, -0.00048080, 0.00029458, 7.27253680, 0.99853121, 0.99922463, 0.49321102],
+                             [- 6.27301777, -0.00048072, 0.00029453, 7.27253705, 0.99853144, 0.99922475, 0.49321101],
+                             [- 6.27301795, -0.00048065, 0.00029448, 7.27253730, 0.99853167, 0.99922487, 0.49321109],
+                             [- 6.27301813, -0.00048057, 0.00029444, 7.27253756, 0.99853190, 0.99922499, 0.49321107],
+                             [- 6.27301831, -0.00048050, 0.00029439, 7.27253781, 0.99853213, 0.99922511, 0.49321107],
+                             [- 6.27301849, -0.00048042, 0.00029435, 7.27253806, 0.99853235, 0.99922523, 0.49321110],
+                             [- 6.27301866, -0.00048035, 0.00029430, 7.27253832, 0.99853258, 0.99922535, 0.49321118],
+                             [- 6.27301884, -0.00048027, 0.00029426, 7.27253857, 0.99853281, 0.99922547, 0.49321119],
+                             [- 6.27301902, -0.00048020, 0.00029421, 7.27253882, 0.99853304, 0.99922559, 0.49321116],
+                             [- 6.27301920, -0.00048012, 0.00029416, 7.27253907, 0.99853327, 0.99922571, 0.49321127],
+                             [- 6.27301938, -0.00048005, 0.00029412, 7.27253933, 0.99853349, 0.99922583, 0.49321123],
+                             [- 6.27301956, -0.00047998, 0.00029407, 7.27253958, 0.99853372, 0.99922595, 0.49321129],
+                             [- 6.27301973, -0.00047990, 0.00029403, 7.27253983, 0.99853395, 0.99922607, 0.49321135],
+                             [- 6.27301991, -0.00047983, 0.00029398, 7.27254008, 0.99853418, 0.99922619, 0.49321135],
+                             [- 6.27302009, -0.00047975, 0.00029394, 7.27254034, 0.99853440, 0.99922631, 0.49321139],
+                             [- 6.27302027, -0.00047968, 0.00029389, 7.27254059, 0.99853463, 0.99922643, 0.49321146],
+                             [- 6.27302044, -0.00047960, 0.00029384, 7.27254084, 0.99853486, 0.99922655, 0.49321142],
+                             [- 6.27302062, -0.00047953, 0.00029380, 7.27254109, 0.99853508, 0.99922667, 0.49321144],
+                             [- 6.27302080, -0.00047946, 0.00029375, 7.27254135, 0.99853531, 0.99922679, 0.49321144],
+                             [- 6.27302098, -0.00047938, 0.00029371, 7.27254160, 0.99853554, 0.99922691, 0.49321157],
+                             [- 6.27302116, -0.00047931, 0.00029366, 7.27254185, 0.99853577, 0.99922703, 0.49321152],
+                             [- 6.27302133, -0.00047923, 0.00029362, 7.27254210, 0.99853599, 0.99922715, 0.49321153],
+                             [- 6.27302151, -0.00047916, 0.00029357, 7.27254235, 0.99853622, 0.99922727, 0.49321157],
+                             [- 6.27302169, -0.00047908, 0.00029353, 7.27254260, 0.99853645, 0.99922739, 0.49321160],
+                             [- 6.27302187, -0.00047901, 0.00029348, 7.27254286, 0.99853667, 0.99922751, 0.49321170],
+                             [- 6.27302204, -0.00047894, 0.00029344, 7.27254311, 0.99853690, 0.99922763, 0.49321172],
+                             [- 6.27302222, -0.00047886, 0.00029339, 7.27254336, 0.99853712, 0.99922775, 0.49321163],
+                             [- 6.27302240, -0.00047879, 0.00029334, 7.27254361, 0.99853735, 0.99922787, 0.49321166],
+                             [- 6.27302257, -0.00047871, 0.00029330, 7.27254386, 0.99853758, 0.99922799, 0.49321175],
+                             [- 6.27302275, -0.00047864, 0.00029325, 7.27254411, 0.99853780, 0.99922811, 0.49321177],
+                             [- 6.27302293, -0.00047857, 0.00029321, 7.27254436, 0.99853803, 0.99922823, 0.49321185],
+                             [- 6.27302311, -0.00047849, 0.00029316, 7.27254461, 0.99853826, 0.99922834, 0.49321182],
+                             [- 6.27302328, -0.00047842, 0.00029312, 7.27254486, 0.99853848, 0.99922846, 0.49321190],
+                             [- 6.27302346, -0.00047834, 0.00029307, 7.27254512, 0.99853871, 0.99922858, 0.49321191],
+                             [- 6.27302364, -0.00047827, 0.00029303, 7.27254537, 0.99853893, 0.99922870, 0.49321187],
+                             [- 6.27302381, -0.00047820, 0.00029298, 7.27254562, 0.99853916, 0.99922882, 0.49321186],
+                             [- 6.27302399, -0.00047812, 0.00029294, 7.27254587, 0.99853939, 0.99922894, 0.49321193],
+                             [- 6.27302417, -0.00047805, 0.00029289, 7.27254612, 0.99853961, 0.99922906, 0.49321201],
+                             [- 6.27302434, -0.00047797, 0.00029285, 7.27254637, 0.99853984, 0.99922918, 0.49321205],
+                             [- 6.27302452, -0.00047790, 0.00029280, 7.27254662, 0.99854006, 0.99922930, 0.49321210],
+                             [- 6.27302470, -0.00047783, 0.00029276, 7.27254687, 0.99854029, 0.99922942, 0.49321211],
+                             [- 6.27302487, -0.00047775, 0.00029271, 7.27254712, 0.99854051, 0.99922954, 0.49321206],
+                             [- 6.27302505, -0.00047768, 0.00029267, 7.27254737, 0.99854074, 0.99922965, 0.49321212],
+                             [- 6.27302523, -0.00047761, 0.00029262, 7.27254762, 0.99854096, 0.99922977, 0.49321212],
+                             [- 6.27302540, -0.00047753, 0.00029257, 7.27254787, 0.99854119, 0.99922989, 0.49321221],
+                             [- 6.27302558, -0.00047746, 0.00029253, 7.27254812, 0.99854141, 0.99923001, 0.49321218],
+                             [- 6.27302575, -0.00047739, 0.00029248, 7.27254837, 0.99854164, 0.99923013, 0.49321223],
+                             [- 6.27302593, -0.00047731, 0.00029244, 7.27254862, 0.99854186, 0.99923025, 0.49321227],
+                             [- 6.27302611, -0.00047724, 0.00029239, 7.27254887, 0.99854209, 0.99923037, 0.49321227],
+                             [- 6.27302628, -0.00047716, 0.00029235, 7.27254912, 0.99854231, 0.99923049, 0.49321226],
+                             [- 6.27302646, -0.00047709, 0.00029230, 7.27254937, 0.99854254, 0.99923060, 0.49321229],
+                             [- 6.27302664, -0.00047702, 0.00029226, 7.27254962, 0.99854276, 0.99923072, 0.49321232],
+                             [- 6.27302681, -0.00047694, 0.00029221, 7.27254987, 0.99854299, 0.99923084, 0.49321239],
+                             [- 6.27302699, -0.00047687, 0.00029217, 7.27255012, 0.99854321, 0.99923096, 0.49321240],
+                             [- 6.27302716, -0.00047680, 0.00029212, 7.27255037, 0.99854344, 0.99923108, 0.49321246],
+                             [- 6.27302734, -0.00047672, 0.00029208, 7.27255061, 0.99854366, 0.99923120, 0.49321244],
+                             [- 6.27302751, -0.00047665, 0.00029203, 7.27255086, 0.99854388, 0.99923132, 0.49321242],
+                             [- 6.27302769, -0.00047658, 0.00029199, 7.27255111, 0.99854411, 0.99923143, 0.49321242],
+                             [- 6.27302787, -0.00047650, 0.00029194, 7.27255136, 0.99854433, 0.99923155, 0.49321258],
+                             [- 6.27302804, -0.00047643, 0.00029190, 7.27255161, 0.99854456, 0.99923167, 0.49321251],
+                             [- 6.27302822, -0.00047636, 0.00029185, 7.27255186, 0.99854478, 0.99923179, 0.49321261],
+                             [- 6.27302839, -0.00047628, 0.00029181, 7.27255211, 0.99854501, 0.99923191, 0.49321264],
+                             [- 6.27302857, -0.00047621, 0.00029176, 7.27255236, 0.99854523, 0.99923203, 0.49321265],
+                             [- 6.27302874, -0.00047614, 0.00029172, 7.27255261, 0.99854545, 0.99923214, 0.49321268],
+                             [- 6.27302892, -0.00047606, 0.00029167, 7.27255285, 0.99854568, 0.99923226, 0.49321269],
+                             [- 6.27302909, -0.00047599, 0.00029163, 7.27255310, 0.99854590, 0.99923238, 0.49321277],
+                             [- 6.27302927, -0.00047592, 0.00029158, 7.27255335, 0.99854612, 0.99923250, 0.49321272],
+                             [- 6.27302944, -0.00047584, 0.00029154, 7.27255360, 0.99854635, 0.99923262, 0.49321278],
+                             [- 6.27302962, -0.00047577, 0.00029150, 7.27255385, 0.99854657, 0.99923273, 0.49321287],
+                             [- 6.27302979, -0.00047570, 0.00029145, 7.27255410, 0.99854679, 0.99923285, 0.49321280],
+                             [- 6.27302997, -0.00047562, 0.00029141, 7.27255434, 0.99854702, 0.99923297, 0.49321291],
+                             [- 6.27303014, -0.00047555, 0.00029136, 7.27255459, 0.99854724, 0.99923309, 0.49321279],
+                             [- 6.27303032, -0.00047548, 0.00029132, 7.27255484, 0.99854746, 0.99923321, 0.49321284],
+                             [- 6.27303049, -0.00047541, 0.00029127, 7.27255509, 0.99854769, 0.99923332, 0.49321288],
+                             [- 6.27303067, -0.00047533, 0.00029123, 7.27255533, 0.99854791, 0.99923344, 0.49321294],
+                             [- 6.27303084, -0.00047526, 0.00029118, 7.27255558, 0.99854813, 0.99923356, 0.49321292],
+                             [- 6.27303102, -0.00047519, 0.00029114, 7.27255583, 0.99854836, 0.99923368, 0.49321300],
+                             [- 6.27303119, -0.00047511, 0.00029109, 7.27255608, 0.99854858, 0.99923379, 0.49321302],
+                             [- 6.27303137, -0.00047504, 0.00029105, 7.27255632, 0.99854880, 0.99923391, 0.49321303],
+                             [- 6.27303154, -0.00047497, 0.00029100, 7.27255657, 0.99854903, 0.99923403, 0.49321311],
+                             [- 6.27303171, -0.00047490, 0.00029096, 7.27255682, 0.99854925, 0.99923415, 0.49321311],
+                             [- 6.27303189, -0.00047482, 0.00029091, 7.27255707, 0.99854947, 0.99923426, 0.49321315],
+                             [- 6.27303206, -0.00047475, 0.00029087, 7.27255731, 0.99854969, 0.99923438, 0.49321319],
+                             [- 6.27303224, -0.00047468, 0.00029082, 7.27255756, 0.99854992, 0.99923450, 0.49321317],
+                             [- 6.27303241, -0.00047460, 0.00029078, 7.27255781, 0.99855014, 0.99923462, 0.49321321],
+                             [- 6.27303259, -0.00047453, 0.00029073, 7.27255805, 0.99855036, 0.99923473, 0.49321326],
+                             [- 6.27303276, -0.00047446, 0.00029069, 7.27255830, 0.99855058, 0.99923485, 0.49321318],
+                             [- 6.27303293, -0.00047439, 0.00029065, 7.27255855, 0.99855081, 0.99923497, 0.49321326],
+                             [- 6.27303311, -0.00047431, 0.00029060, 7.27255879, 0.99855103, 0.99923509, 0.49321333],
+                             [- 6.27303328, -0.00047424, 0.00029056, 7.27255904, 0.99855125, 0.99923520, 0.49321333],
+                             [- 6.27303345, -0.00047417, 0.00029051, 7.27255929, 0.99855147, 0.99923532, 0.49321344],
+                             [- 6.27303363, -0.00047410, 0.00029047, 7.27255953, 0.99855169, 0.99923544, 0.49321337],
+                             [- 6.27303380, -0.00047402, 0.00029042, 7.27255978, 0.99855192, 0.99923555, 0.49321345],
+                             [- 6.27303398, -0.00047395, 0.00029038, 7.27256003, 0.99855214, 0.99923567, 0.49321337],
+                             [- 6.27303415, -0.00047388, 0.00029033, 7.27256027, 0.99855236, 0.99923579, 0.49321344],
+                             [- 6.27303432, -0.00047380, 0.00029029, 7.27256052, 0.99855258, 0.99923591, 0.49321346],
+                             [- 6.27303450, -0.00047373, 0.00029025, 7.27256076, 0.99855280, 0.99923602, 0.49321354],
+                             [- 6.27303467, -0.00047366, 0.00029020, 7.27256101, 0.99855302, 0.99923614, 0.49321353],
+                             [- 6.27303484, -0.00047359, 0.00029016, 7.27256126, 0.99855325, 0.99923626, 0.49321361],
+                             [- 6.27303502, -0.00047351, 0.00029011, 7.27256150, 0.99855347, 0.99923637, 0.49321358],
+                             [- 6.27303519, -0.00047344, 0.00029007, 7.27256175, 0.99855369, 0.99923649, 0.49321363],
+                             [- 6.27303536, -0.00047337, 0.00029002, 7.27256199, 0.99855391, 0.99923661, 0.49321367],
+                             [- 6.27303554, -0.00047330, 0.00028998, 7.27256224, 0.99855413, 0.99923672, 0.49321364],
+                             [- 6.27303571, -0.00047323, 0.00028993, 7.27256248, 0.99855435, 0.99923684, 0.49321377],
+                             [- 6.27303588, -0.00047315, 0.00028989, 7.27256273, 0.99855457, 0.99923696, 0.49321375],
+                             [- 6.27303606, -0.00047308, 0.00028985, 7.27256298, 0.99855479, 0.99923707, 0.49321379],
+                             [- 6.27303623, -0.00047301, 0.00028980, 7.27256322, 0.99855501, 0.99923719, 0.49321377],
+                             [- 6.27303640, -0.00047294, 0.00028976, 7.27256347, 0.99855524, 0.99923731, 0.49321372],
+                             [- 6.27303658, -0.00047286, 0.00028971, 7.27256371, 0.99855546, 0.99923742, 0.49321383],
+                             [- 6.27303675, -0.00047279, 0.00028967, 7.27256396, 0.99855568, 0.99923754, 0.49321384],
+                             [- 6.27303692, -0.00047272, 0.00028962, 7.27256420, 0.99855590, 0.99923766, 0.49321394],
+                             [- 6.27303709, -0.00047265, 0.00028958, 7.27256445, 0.99855612, 0.99923777, 0.49321386],
+                             [- 6.27303727, -0.00047258, 0.00028954, 7.27256469, 0.99855634, 0.99923789, 0.49321390],
+                             [- 6.27303744, -0.00047250, 0.00028949, 7.27256494, 0.99855656, 0.99923801, 0.49321401],
+                             [- 6.27303761, -0.00047243, 0.00028945, 7.27256518, 0.99855678, 0.99923812, 0.49321394],
+                             [- 6.27303778, -0.00047236, 0.00028940, 7.27256543, 0.99855700, 0.99923824, 0.49321395],
+                             [- 6.27303796, -0.00047229, 0.00028936, 7.27256567, 0.99855722, 0.99923835, 0.49321400],
+                             [- 6.27303813, -0.00047221, 0.00028931, 7.27256591, 0.99855744, 0.99923847, 0.49321392],
+                             [- 6.27303830, -0.00047214, 0.00028927, 7.27256616, 0.99855766, 0.99923859, 0.49321409],
+                             [- 6.27303847, -0.00047207, 0.00028923, 7.27256640, 0.99855788, 0.99923870, 0.49321404],
+                             [- 6.27303865, -0.00047200, 0.00028918, 7.27256665, 0.99855810, 0.99923882, 0.49321416],
+                             [- 6.27303882, -0.00047193, 0.00028914, 7.27256689, 0.99855832, 0.99923893, 0.49321409],
+                             [- 6.27303899, -0.00047185, 0.00028909, 7.27256714, 0.99855854, 0.99923905, 0.49321418],
+                             [- 6.27303916, -0.00047178, 0.00028905, 7.27256738, 0.99855876, 0.99923917, 0.49321418],
+                             [- 6.27303933, -0.00047171, 0.00028901, 7.27256762, 0.99855898, 0.99923928, 0.49321424],
+                             [- 6.27303951, -0.00047164, 0.00028896, 7.27256787, 0.99855920, 0.99923940, 0.49321434],
+                             [- 6.27303968, -0.00047157, 0.00028892, 7.27256811, 0.99855942, 0.99923951, 0.49321431],
+                             [- 6.27303985, -0.00047150, 0.00028887, 7.27256835, 0.99855964, 0.99923963, 0.49321429],
+                             [- 6.27304002, -0.00047142, 0.00028883, 7.27256860, 0.99855986, 0.99923975, 0.49321428],
+                             [- 6.27304019, -0.00047135, 0.00028879, 7.27256884, 0.99856008, 0.99923986, 0.49321434],
+                             [- 6.27304037, -0.00047128, 0.00028874, 7.27256909, 0.99856030, 0.99923998, 0.49321435],
+                             [- 6.27304054, -0.00047121, 0.00028870, 7.27256933, 0.99856052, 0.99924009, 0.49321437],
+                             [- 6.27304071, -0.00047114, 0.00028865, 7.27256957, 0.99856073, 0.99924021, 0.49321446],
+                             [- 6.27304088, -0.00047106, 0.00028861, 7.27256982, 0.99856095, 0.99924032, 0.49321442],
+                             [- 6.27304105, -0.00047099, 0.00028857, 7.27257006, 0.99856117, 0.99924044, 0.49321442],
+                             [- 6.27304122, -0.00047092, 0.00028852, 7.27257030, 0.99856139, 0.99924056, 0.49321451],
+                             [- 6.27304139, -0.00047085, 0.00028848, 7.27257054, 0.99856161, 0.99924067, 0.49321455],
+                             [- 6.27304157, -0.00047078, 0.00028843, 7.27257079, 0.99856183, 0.99924079, 0.49321455],
+                             [- 6.27304174, -0.00047071, 0.00028839, 7.27257103, 0.99856205, 0.99924090, 0.49321459],
+                             [- 6.27304191, -0.00047064, 0.00028835, 7.27257127, 0.99856227, 0.99924102, 0.49321464],
+                             [- 6.27304208, -0.00047056, 0.00028830, 7.27257152, 0.99856249, 0.99924113, 0.49321460],
+                             [- 6.27304225, -0.00047049, 0.00028826, 7.27257176, 0.99856270, 0.99924125, 0.49321463],
+                             [- 6.27304242, -0.00047042, 0.00028822, 7.27257200, 0.99856292, 0.99924136, 0.49321476],
+                             [- 6.27304259, -0.00047035, 0.00028817, 7.27257224, 0.99856314, 0.99924148, 0.49321475],
+                             [- 6.27304276, -0.00047028, 0.00028813, 7.27257249, 0.99856336, 0.99924159, 0.49321471],
+                             [- 6.27304294, -0.00047021, 0.00028808, 7.27257273, 0.99856358, 0.99924171, 0.49321475],
+                             [- 6.27304311, -0.00047013, 0.00028804, 7.27257297, 0.99856380, 0.99924183, 0.49321476],
+                             [- 6.27304328, -0.00047006, 0.00028800, 7.27257321, 0.99856401, 0.99924194, 0.49321484],
+                             [- 6.27304345, -0.00046999, 0.00028795, 7.27257346, 0.99856423, 0.99924206, 0.49321477],
+                             [- 6.27304362, -0.00046992, 0.00028791, 7.27257370, 0.99856445, 0.99924217, 0.49321483],
+                             [- 6.27304379, -0.00046985, 0.00028787, 7.27257394, 0.99856467, 0.99924229, 0.49321495],
+                             [- 6.27304396, -0.00046978, 0.00028782, 7.27257418, 0.99856489, 0.99924240, 0.49321491],
+                             [- 6.27304413, -0.00046971, 0.00028778, 7.27257442, 0.99856510, 0.99924252, 0.49321493],
+                             [- 6.27304430, -0.00046964, 0.00028773, 7.27257467, 0.99856532, 0.99924263, 0.49321498],
+                             [- 6.27304447, -0.00046956, 0.00028769, 7.27257491, 0.99856554, 0.99924275, 0.49321496],
+                             [- 6.27304464, -0.00046949, 0.00028765, 7.27257515, 0.99856576, 0.99924286, 0.49321502],
+                             [- 6.27304481, -0.00046942, 0.00028760, 7.27257539, 0.99856597, 0.99924298, 0.49321503],
+                             [- 6.27304498, -0.00046935, 0.00028756, 7.27257563, 0.99856619, 0.99924309, 0.49321507],
+                             [- 6.27304515, -0.00046928, 0.00028752, 7.27257587, 0.99856641, 0.99924320, 0.49321515],
+                             [- 6.27304532, -0.00046921, 0.00028747, 7.27257611, 0.99856663, 0.99924332, 0.49321508],
+                             [- 6.27304549, -0.00046914, 0.00028743, 7.27257636, 0.99856684, 0.99924343, 0.49321514],
+                             [- 6.27304566, -0.00046907, 0.00028738, 7.27257660, 0.99856706, 0.99924355, 0.49321526],
+                             [- 6.27304583, -0.00046900, 0.00028734, 7.27257684, 0.99856728, 0.99924366, 0.49321521],
+                             [- 6.27304600, -0.00046892, 0.00028730, 7.27257708, 0.99856750, 0.99924378, 0.49321521],
+                             [- 6.27304617, -0.00046885, 0.00028725, 7.27257732, 0.99856771, 0.99924389, 0.49321523],
+                             [- 6.27304634, -0.00046878, 0.00028721, 7.27257756, 0.99856793, 0.99924401, 0.49321526],
+                             [- 6.27304651, -0.00046871, 0.00028717, 7.27257780, 0.99856815, 0.99924412, 0.49321530],
+                             [- 6.27304668, -0.00046864, 0.00028712, 7.27257804, 0.99856836, 0.99924424, 0.49321535],
+                             [- 6.27304685, -0.00046857, 0.00028708, 7.27257828, 0.99856858, 0.99924435, 0.49321541],
+                             [- 6.27304702, -0.00046850, 0.00028704, 7.27257852, 0.99856880, 0.99924446, 0.49321529],
+                             [- 6.27304719, -0.00046843, 0.00028699, 7.27257876, 0.99856901, 0.99924458, 0.49321541],
+                             [- 6.27304736, -0.00046836, 0.00028695, 7.27257901, 0.99856923, 0.99924469, 0.49321535],
+                             [- 6.27304753, -0.00046829, 0.00028691, 7.27257925, 0.99856945, 0.99924481, 0.49321543],
+                             [- 6.27304770, -0.00046821, 0.00028686, 7.27257949, 0.99856966, 0.99924492, 0.49321548],
+                             [- 6.27304787, -0.00046814, 0.00028682, 7.27257973, 0.99856988, 0.99924504, 0.49321551],
+                             [- 6.27304804, -0.00046807, 0.00028678, 7.27257997, 0.99857010, 0.99924515, 0.49321545],
+                             [- 6.27304821, -0.00046800, 0.00028673, 7.27258021, 0.99857031, 0.99924526, 0.49321554],
+                             [- 6.27304838, -0.00046793, 0.00028669, 7.27258045, 0.99857053, 0.99924538, 0.49321557],
+                             [- 6.27304855, -0.00046786, 0.00028665, 7.27258069, 0.99857074, 0.99924549, 0.49321561],
+                             [- 6.27304872, -0.00046779, 0.00028660, 7.27258093, 0.99857096, 0.99924561, 0.49321567],
+                             [- 6.27304889, -0.00046772, 0.00028656, 7.27258117, 0.99857118, 0.99924572, 0.49321567],
+                             [- 6.27304906, -0.00046765, 0.00028652, 7.27258141, 0.99857139, 0.99924583, 0.49321571],
+                             [- 6.27304922, -0.00046758, 0.00028647, 7.27258165, 0.99857161, 0.99924595, 0.49321566],
+                             [- 6.27304939, -0.00046751, 0.00028643, 7.27258189, 0.99857182, 0.99924606, 0.49321576],
+                             [- 6.27304956, -0.00046744, 0.00028639, 7.27258213, 0.99857204, 0.99924618, 0.49321567],
+                             [- 6.27304973, -0.00046737, 0.00028634, 7.27258236, 0.99857226, 0.99924629, 0.49321585],
+                             [- 6.27304990, -0.00046730, 0.00028630, 7.27258260, 0.99857247, 0.99924640, 0.49321576],
+                             [- 6.27305007, -0.00046723, 0.00028626, 7.27258284, 0.99857269, 0.99924652, 0.49321581],
+                             [- 6.27305024, -0.00046715, 0.00028621, 7.27258308, 0.99857290, 0.99924663, 0.49321580],
+                             [- 6.27305041, -0.00046708, 0.00028617, 7.27258332, 0.99857312, 0.99924675, 0.49321590],
+                             [- 6.27305057, -0.00046701, 0.00028613, 7.27258356, 0.99857333, 0.99924686, 0.49321582],
+                             [- 6.27305074, -0.00046694, 0.00028608, 7.27258380, 0.99857355, 0.99924697, 0.49321587],
+                             [- 6.27305091, -0.00046687, 0.00028604, 7.27258404, 0.99857376, 0.99924709, 0.49321595],
+                             [- 6.27305108, -0.00046680, 0.00028600, 7.27258428, 0.99857398, 0.99924720, 0.49321595],
+                             [- 6.27305125, -0.00046673, 0.00028595, 7.27258452, 0.99857419, 0.99924731, 0.49321600],
+                             [- 6.27305142, -0.00046666, 0.00028591, 7.27258476, 0.99857441, 0.99924743, 0.49321598],
+                             [- 6.27305159, -0.00046659, 0.00028587, 7.27258499, 0.99857462, 0.99924754, 0.49321613],
+                             [- 6.27305175, -0.00046652, 0.00028582, 7.27258523, 0.99857484, 0.99924765, 0.49321611],
+                             [- 6.27305192, -0.00046645, 0.00028578, 7.27258547, 0.99857505, 0.99924777, 0.49321600],
+                             [- 6.27305209, -0.00046638, 0.00028574, 7.27258571, 0.99857527, 0.99924788, 0.49321621],
+                             [- 6.27305226, -0.00046631, 0.00028570, 7.27258595, 0.99857548, 0.99924799, 0.49321615],
+                             [- 6.27305243, -0.00046624, 0.00028565, 7.27258619, 0.99857570, 0.99924811, 0.49321620],
+                             [- 6.27305259, -0.00046617, 0.00028561, 7.27258642, 0.99857591, 0.99924822, 0.49321625],
+                             [- 6.27305276, -0.00046610, 0.00028557, 7.27258666, 0.99857613, 0.99924833, 0.49321621],
+                             [- 6.27305293, -0.00046603, 0.00028552, 7.27258690, 0.99857634, 0.99924845, 0.49321630],
+                             [- 6.27305310, -0.00046596, 0.00028548, 7.27258714, 0.99857656, 0.99924856, 0.49321623],
+                             [- 6.27305327, -0.00046589, 0.00028544, 7.27258738, 0.99857677, 0.99924867, 0.49321633],
+                             [- 6.27305343, -0.00046582, 0.00028539, 7.27258761, 0.99857698, 0.99924879, 0.49321637],
+                             [- 6.27305360, -0.00046575, 0.00028535, 7.27258785, 0.99857720, 0.99924890, 0.49321640],
+                             [- 6.27305377, -0.00046568, 0.00028531, 7.27258809, 0.99857741, 0.99924901, 0.49321641],
+                             [- 6.27305394, -0.00046561, 0.00028527, 7.27258833, 0.99857763, 0.99924913, 0.49321644],
+                             [- 6.27305410, -0.00046554, 0.00028522, 7.27258857, 0.99857784, 0.99924924, 0.49321640],
+                             [- 6.27305427, -0.00046547, 0.00028518, 7.27258880, 0.99857805, 0.99924935, 0.49321644],
+                             [- 6.27305444, -0.00046540, 0.00028514, 7.27258904, 0.99857827, 0.99924946, 0.49321647],
+                             [- 6.27305461, -0.00046533, 0.00028509, 7.27258928, 0.99857848, 0.99924958, 0.49321655],
+                             [- 6.27305477, -0.00046526, 0.00028505, 7.27258952, 0.99857870, 0.99924969, 0.49321652],
+                             [- 6.27305494, -0.00046519, 0.00028501, 7.27258975, 0.99857891, 0.99924980, 0.49321651],
+                             [- 6.27305511, -0.00046512, 0.00028497, 7.27258999, 0.99857912, 0.99924992, 0.49321656],
+                             [- 6.27305528, -0.00046505, 0.00028492, 7.27259023, 0.99857934, 0.99925003, 0.49321656],
+                             [- 6.27305544, -0.00046498, 0.00028488, 7.27259046, 0.99857955, 0.99925014, 0.49321665],
+                             [- 6.27305561, -0.00046491, 0.00028484, 7.27259070, 0.99857976, 0.99925025, 0.49321668],
+                             [- 6.27305578, -0.00046484, 0.00028479, 7.27259094, 0.99857998, 0.99925037, 0.49321665],
+                             [- 6.27305594, -0.00046477, 0.00028475, 7.27259117, 0.99858019, 0.99925048, 0.49321672],
+                             [- 6.27305611, -0.00046470, 0.00028471, 7.27259141, 0.99858040, 0.99925059, 0.49321675],
+                             [- 6.27305628, -0.00046463, 0.00028467, 7.27259165, 0.99858062, 0.99925070, 0.49321677],
+                             [- 6.27305645, -0.00046456, 0.00028462, 7.27259188, 0.99858083, 0.99925082, 0.49321675],
+                             [- 6.27305661, -0.00046449, 0.00028458, 7.27259212, 0.99858104, 0.99925093, 0.49321677],
+                             [- 6.27305678, -0.00046442, 0.00028454, 7.27259236, 0.99858126, 0.99925104, 0.49321687],
+                             [- 6.27305695, -0.00046435, 0.00028449, 7.27259259, 0.99858147, 0.99925115, 0.49321692],
+                             [- 6.27305711, -0.00046428, 0.00028445, 7.27259283, 0.99858168, 0.99925127, 0.49321690],
+                             [- 6.27305728, -0.00046421, 0.00028441, 7.27259307, 0.99858189, 0.99925138, 0.49321690],
+                             [- 6.27305745, -0.00046414, 0.00028437, 7.27259330, 0.99858211, 0.99925149, 0.49321703],
+                             [- 6.27305761, -0.00046407, 0.00028432, 7.27259354, 0.99858232, 0.99925160, 0.49321695],
+                             [- 6.27305778, -0.00046400, 0.00028428, 7.27259377, 0.99858253, 0.99925171, 0.49321702],
+                             [- 6.27305795, -0.00046393, 0.00028424, 7.27259401, 0.99858275, 0.99925183, 0.49321702],
+                             [- 6.27305811, -0.00046386, 0.00028420, 7.27259425, 0.99858296, 0.99925194, 0.49321707],
+                             [- 6.27305828, -0.00046380, 0.00028415, 7.27259448, 0.99858317, 0.99925205, 0.49321711],
+                             [- 6.27305844, -0.00046373, 0.00028411, 7.27259472, 0.99858338, 0.99925216, 0.49321702],
+                             [- 6.27305861, -0.00046366, 0.00028407, 7.27259495, 0.99858359, 0.99925227, 0.49321714],
+                             [- 6.27305878, -0.00046359, 0.00028403, 7.27259519, 0.99858381, 0.99925239, 0.49321714],
+                             [- 6.27305894, -0.00046352, 0.00028398, 7.27259543, 0.99858402, 0.99925250, 0.49321712],
+                             [- 6.27305911, -0.00046345, 0.00028394, 7.27259566, 0.99858423, 0.99925261, 0.49321724],
+                             [- 6.27305927, -0.00046338, 0.00028390, 7.27259590, 0.99858444, 0.99925272, 0.49321723],
+                             [- 6.27305944, -0.00046331, 0.00028386, 7.27259613, 0.99858465, 0.99925283, 0.49321718],
+                             [- 6.27305961, -0.00046324, 0.00028381, 7.27259637, 0.99858487, 0.99925295, 0.49321725],
+                             [- 6.27305977, -0.00046317, 0.00028377, 7.27259660, 0.99858508, 0.99925306, 0.49321729],
+                             [- 6.27305994, -0.00046310, 0.00028373, 7.27259684, 0.99858529, 0.99925317, 0.49321728],
+                             [- 6.27306010, -0.00046303, 0.00028369, 7.27259707, 0.99858550, 0.99925328, 0.49321728],
+                             [- 6.27306027, -0.00046296, 0.00028364, 7.27259731, 0.99858571, 0.99925339, 0.49321738],
+                             [- 6.27306044, -0.00046289, 0.00028360, 7.27259754, 0.99858593, 0.99925351, 0.49321730],
+                             [- 6.27306060, -0.00046282, 0.00028356, 7.27259778, 0.99858614, 0.99925362, 0.49321736],
+                             [- 6.27306077, -0.00046276, 0.00028352, 7.27259801, 0.99858635, 0.99925373, 0.49321743],
+                             [- 6.27306093, -0.00046269, 0.00028347, 7.27259825, 0.99858656, 0.99925384, 0.49321740],
+                             [- 6.27306110, -0.00046262, 0.00028343, 7.27259848, 0.99858677, 0.99925395, 0.49321757],
+                             [- 6.27306126, -0.00046255, 0.00028339, 7.27259872, 0.99858698, 0.99925406, 0.49321754],
+                             [- 6.27306143, -0.00046248, 0.00028335, 7.27259895, 0.99858719, 0.99925417, 0.49321760],
+                             [- 6.27306159, -0.00046241, 0.00028330, 7.27259918, 0.99858740, 0.99925429, 0.49321757],
+                             [- 6.27306176, -0.00046234, 0.00028326, 7.27259942, 0.99858762, 0.99925440, 0.49321761],
+                             [- 6.27306192, -0.00046227, 0.00028322, 7.27259965, 0.99858783, 0.99925451, 0.49321757],
+                             [- 6.27306209, -0.00046220, 0.00028318, 7.27259989, 0.99858804, 0.99925462, 0.49321764],
+                             [- 6.27306225, -0.00046213, 0.00028314, 7.27260012, 0.99858825, 0.99925473, 0.49321769],
+                             [- 6.27306242, -0.00046206, 0.00028309, 7.27260036, 0.99858846, 0.99925484, 0.49321767],
+                             [- 6.27306259, -0.00046200, 0.00028305, 7.27260059, 0.99858867, 0.99925495, 0.49321773],
+                             [- 6.27306275, -0.00046193, 0.00028301, 7.27260082, 0.99858888, 0.99925506, 0.49321772],
+                             [- 6.27306292, -0.00046186, 0.00028297, 7.27260106, 0.99858909, 0.99925518, 0.49321771],
+                             [- 6.27306308, -0.00046179, 0.00028292, 7.27260129, 0.99858930, 0.99925529, 0.49321779],
+                             [- 6.27306324, -0.00046172, 0.00028288, 7.27260152, 0.99858951, 0.99925540, 0.49321779],
+                             [- 6.27306341, -0.00046165, 0.00028284, 7.27260176, 0.99858972, 0.99925551, 0.49321780],
+                             [- 6.27306357, -0.00046158, 0.00028280, 7.27260199, 0.99858993, 0.99925562, 0.49321791],
+                             [- 6.27306374, -0.00046151, 0.00028275, 7.27260223, 0.99859014, 0.99925573, 0.49321791],
+                             [- 6.27306390, -0.00046144, 0.00028271, 7.27260246, 0.99859035, 0.99925584, 0.49321788],
+                             [- 6.27306407, -0.00046138, 0.00028267, 7.27260269, 0.99859056, 0.99925595, 0.49321791],
+                             [- 6.27306423, -0.00046131, 0.00028263, 7.27260293, 0.99859077, 0.99925606, 0.49321799],
+                             [- 6.27306440, -0.00046124, 0.00028259, 7.27260316, 0.99859098, 0.99925618, 0.49321795],
+                             [- 6.27306456, -0.00046117, 0.00028254, 7.27260339, 0.99859119, 0.99925629, 0.49321797],
+                             [- 6.27306473, -0.00046110, 0.00028250, 7.27260363, 0.99859140, 0.99925640, 0.49321800],
+                             [- 6.27306489, -0.00046103, 0.00028246, 7.27260386, 0.99859161, 0.99925651, 0.49321804],
+                             [- 6.27306505, -0.00046096, 0.00028242, 7.27260409, 0.99859182, 0.99925662, 0.49321800],
+                             [- 6.27306522, -0.00046090, 0.00028238, 7.27260432, 0.99859203, 0.99925673, 0.49321804],
+                             [- 6.27306538, -0.00046083, 0.00028233, 7.27260456, 0.99859224, 0.99925684, 0.49321806],
+                             [- 6.27306555, -0.00046076, 0.00028229, 7.27260479, 0.99859245, 0.99925695, 0.49321814],
+                             [- 6.27306571, -0.00046069, 0.00028225, 7.27260502, 0.99859266, 0.99925706, 0.49321818],
+                             [- 6.27306588, -0.00046062, 0.00028221, 7.27260525, 0.99859287, 0.99925717, 0.49321811],
+                             [- 6.27306604, -0.00046055, 0.00028217, 7.27260549, 0.99859308, 0.99925728, 0.49321821],
+                             [- 6.27306620, -0.00046048, 0.00028212, 7.27260572, 0.99859329, 0.99925739, 0.49321828],
+                             [- 6.27306637, -0.00046042, 0.00028208, 7.27260595, 0.99859350, 0.99925750, 0.49321829],
+                             [- 6.27306653, -0.00046035, 0.00028204, 7.27260618, 0.99859371, 0.99925761, 0.49321826],
+                             [- 6.27306670, -0.00046028, 0.00028200, 7.27260642, 0.99859392, 0.99925772, 0.49321833],
+                             [- 6.27306686, -0.00046021, 0.00028196, 7.27260665, 0.99859413, 0.99925783, 0.49321833],
+                             [- 6.27306702, -0.00046014, 0.00028191, 7.27260688, 0.99859434, 0.99925794, 0.49321830],
+                             [- 6.27306719, -0.00046007, 0.00028187, 7.27260711, 0.99859455, 0.99925805, 0.49321842],
+                             [- 6.27306735, -0.00046000, 0.00028183, 7.27260735, 0.99859475, 0.99925817, 0.49321838],
+                             [- 6.27306751, -0.00045994, 0.00028179, 7.27260758, 0.99859496, 0.99925828, 0.49321849],
+                             [- 6.27306768, -0.00045987, 0.00028175, 7.27260781, 0.99859517, 0.99925839, 0.49321848],
+                             [- 6.27306784, -0.00045980, 0.00028170, 7.27260804, 0.99859538, 0.99925850, 0.49321848],
+                             [- 6.27306800, -0.00045973, 0.00028166, 7.27260827, 0.99859559, 0.99925861, 0.49321852],
+                             [- 6.27306817, -0.00045966, 0.00028162, 7.27260850, 0.99859580, 0.99925872, 0.49321855],
+                             [- 6.27306833, -0.00045959, 0.00028158, 7.27260874, 0.99859601, 0.99925883, 0.49321849],
+                             [- 6.27306849, -0.00045953, 0.00028154, 7.27260897, 0.99859622, 0.99925894, 0.49321861],
+                             [- 6.27306866, -0.00045946, 0.00028150, 7.27260920, 0.99859642, 0.99925905, 0.49321858],
+                             [- 6.27306882, -0.00045939, 0.00028145, 7.27260943, 0.99859663, 0.99925916, 0.49321869],
+                             [- 6.27306898, -0.00045932, 0.00028141, 7.27260966, 0.99859684, 0.99925927, 0.49321873],
+                             [- 6.27306915, -0.00045925, 0.00028137, 7.27260989, 0.99859705, 0.99925938, 0.49321868],
+                             [- 6.27306931, -0.00045919, 0.00028133, 7.27261012, 0.99859726, 0.99925949, 0.49321872],
+                             [- 6.27306947, -0.00045912, 0.00028129, 7.27261035, 0.99859746, 0.99925960, 0.49321879],
+                             [- 6.27306964, -0.00045905, 0.00028124, 7.27261059, 0.99859767, 0.99925971, 0.49321873],
+                             [- 6.27306980, -0.00045898, 0.00028120, 7.27261082, 0.99859788, 0.99925982, 0.49321881],
+                             [- 6.27306996, -0.00045891, 0.00028116, 7.27261105, 0.99859809, 0.99925993, 0.49321869],
+                             [- 6.27307012, -0.00045885, 0.00028112, 7.27261128, 0.99859830, 0.99926003, 0.49321889],
+                             [- 6.27307029, -0.00045878, 0.00028108, 7.27261151, 0.99859850, 0.99926014, 0.49321883],
+                             [- 6.27307045, -0.00045871, 0.00028104, 7.27261174, 0.99859871, 0.99926025, 0.49321889],
+                             [- 6.27307061, -0.00045864, 0.00028099, 7.27261197, 0.99859892, 0.99926036, 0.49321886],
+                             [- 6.27307078, -0.00045857, 0.00028095, 7.27261220, 0.99859913, 0.99926047, 0.49321894],
+                             [- 6.27307094, -0.00045851, 0.00028091, 7.27261243, 0.99859934, 0.99926058, 0.49321894],
+                             [- 6.27307110, -0.00045844, 0.00028087, 7.27261266, 0.99859954, 0.99926069, 0.49321891],
+                             [- 6.27307126, -0.00045837, 0.00028083, 7.27261289, 0.99859975, 0.99926080, 0.49321907],
+                             [- 6.27307142, -0.00045830, 0.00028079, 7.27261312, 0.99859996, 0.99926091, 0.49321892],
+                             [- 6.27307159, -0.00045823, 0.00028074, 7.27261335, 0.99860016, 0.99926102, 0.49321904],
+                             [- 6.27307175, -0.00045817, 0.00028070, 7.27261358, 0.99860037, 0.99926113, 0.49321907],
+                             [- 6.27307191, -0.00045810, 0.00028066, 7.27261381, 0.99860058, 0.99926124, 0.49321903],
+                             [- 6.27307207, -0.00045803, 0.00028062, 7.27261404, 0.99860079, 0.99926135, 0.49321912],
+                             [- 6.27307224, -0.00045796, 0.00028058, 7.27261427, 0.99860099, 0.99926146, 0.49321912],
+                             [- 6.27307240, -0.00045790, 0.00028054, 7.27261450, 0.99860120, 0.99926157, 0.49321912],
+                             [- 6.27307256, -0.00045783, 0.00028050, 7.27261473, 0.99860141, 0.99926168, 0.49321924],
+                             [- 6.27307272, -0.00045776, 0.00028045, 7.27261496, 0.99860161, 0.99926179, 0.49321924],
+                             [- 6.27307288, -0.00045769, 0.00028041, 7.27261519, 0.99860182, 0.99926190, 0.49321921],
+                             [- 6.27307305, -0.00045762, 0.00028037, 7.27261542, 0.99860203, 0.99926200, 0.49321927],
+                             [- 6.27307321, -0.00045756, 0.00028033, 7.27261565, 0.99860223, 0.99926211, 0.49321925],
+                             [- 6.27307337, -0.00045749, 0.00028029, 7.27261588, 0.99860244, 0.99926222, 0.49321926],
+                             [- 6.27307353, -0.00045742, 0.00028025, 7.27261611, 0.99860265, 0.99926233, 0.49321932],
+                             [- 6.27307369, -0.00045735, 0.00028021, 7.27261634, 0.99860285, 0.99926244, 0.49321935],
+                             [- 6.27307386, -0.00045729, 0.00028016, 7.27261657, 0.99860306, 0.99926255, 0.49321931],
+                             [- 6.27307402, -0.00045722, 0.00028012, 7.27261680, 0.99860327, 0.99926266, 0.49321940],
+                             [- 6.27307418, -0.00045715, 0.00028008, 7.27261703, 0.99860347, 0.99926277, 0.49321940],
+                             [- 6.27307434, -0.00045708, 0.00028004, 7.27261726, 0.99860368, 0.99926288, 0.49321938],
+                             [- 6.27307450, -0.00045702, 0.00028000, 7.27261749, 0.99860389, 0.99926299, 0.49321955],
+                             [- 6.27307466, -0.00045695, 0.00027996, 7.27261771, 0.99860409, 0.99926309, 0.49321946],
+                             [- 6.27307482, -0.00045688, 0.00027992, 7.27261794, 0.99860430, 0.99926320, 0.49321952],
+                             [- 6.27307499, -0.00045681, 0.00027987, 7.27261817, 0.99860450, 0.99926331, 0.49321956],
+                             [- 6.27307515, -0.00045675, 0.00027983, 7.27261840, 0.99860471, 0.99926342, 0.49321950],
+                             [- 6.27307531, -0.00045668, 0.00027979, 7.27261863, 0.99860492, 0.99926353, 0.49321959],
+                             [- 6.27307547, -0.00045661, 0.00027975, 7.27261886, 0.99860512, 0.99926364, 0.49321954],
+                             [- 6.27307563, -0.00045654, 0.00027971, 7.27261909, 0.99860533, 0.99926375, 0.49321964],
+                             [- 6.27307579, -0.00045648, 0.00027967, 7.27261931, 0.99860553, 0.99926385, 0.49321960],
+                             [- 6.27307595, -0.00045641, 0.00027963, 7.27261954, 0.99860574, 0.99926396, 0.49321972],
+                             [- 6.27307611, -0.00045634, 0.00027959, 7.27261977, 0.99860595, 0.99926407, 0.49321973],
+                             [- 6.27307628, -0.00045628, 0.00027954, 7.27262000, 0.99860615, 0.99926418, 0.49321968],
+                             [- 6.27307644, -0.00045621, 0.00027950, 7.27262023, 0.99860636, 0.99926429, 0.49321967],
+                             [- 6.27307660, -0.00045614, 0.00027946, 7.27262046, 0.99860656, 0.99926440, 0.49321972],
+                             [- 6.27307676, -0.00045607, 0.00027942, 7.27262068, 0.99860677, 0.99926451, 0.49321981],
+                             [- 6.27307692, -0.00045601, 0.00027938, 7.27262091, 0.99860697, 0.99926461, 0.49321979],
+                             [- 6.27307708, -0.00045594, 0.00027934, 7.27262114, 0.99860718, 0.99926472, 0.49321986],
+                             [- 6.27307724, -0.00045587, 0.00027930, 7.27262137, 0.99860738, 0.99926483, 0.49321988],
+                             [- 6.27307740, -0.00045581, 0.00027926, 7.27262160, 0.99860759, 0.99926494, 0.49321990],
+                             [- 6.27307756, -0.00045574, 0.00027921, 7.27262182, 0.99860779, 0.99926505, 0.49321998],
+                             [- 6.27307772, -0.00045567, 0.00027917, 7.27262205, 0.99860800, 0.99926516, 0.49322003],
+                             [- 6.27307788, -0.00045560, 0.00027913, 7.27262228, 0.99860820, 0.99926526, 0.49321994],
+                             [- 6.27307804, -0.00045554, 0.00027909, 7.27262251, 0.99860841, 0.99926537, 0.49322002],
+                             [- 6.27307820, -0.00045547, 0.00027905, 7.27262273, 0.99860861, 0.99926548, 0.49321999],
+                             [- 6.27307836, -0.00045540, 0.00027901, 7.27262296, 0.99860882, 0.99926559, 0.49322005],
+                             [- 6.27307852, -0.00045534, 0.00027897, 7.27262319, 0.99860902, 0.99926570, 0.49322007],
+                             [- 6.27307868, -0.00045527, 0.00027893, 7.27262342, 0.99860923, 0.99926580, 0.49322002],
+                             [- 6.27307884, -0.00045520, 0.00027889, 7.27262364, 0.99860943, 0.99926591, 0.49322013],
+                             [- 6.27307900, -0.00045514, 0.00027884, 7.27262387, 0.99860964, 0.99926602, 0.49322009],
+                             [- 6.27307916, -0.00045507, 0.00027880, 7.27262410, 0.99860984, 0.99926613, 0.49322010],
+                             [- 6.27307932, -0.00045500, 0.00027876, 7.27262432, 0.99861004, 0.99926624, 0.49322020],
+                             [- 6.27307949, -0.00045493, 0.00027872, 7.27262455, 0.99861025, 0.99926634, 0.49322020],
+                             [- 6.27307964, -0.00045487, 0.00027868, 7.27262478, 0.99861045, 0.99926645, 0.49322021],
+                             [- 6.27307980, -0.00045480, 0.00027864, 7.27262500, 0.99861066, 0.99926656, 0.49322031],
+                             [- 6.27307996, -0.00045473, 0.00027860, 7.27262523, 0.99861086, 0.99926667, 0.49322031],
+                             [- 6.27308012, -0.00045467, 0.00027856, 7.27262546, 0.99861107, 0.99926677, 0.49322033],
+                             [- 6.27308028, -0.00045460, 0.00027852, 7.27262568, 0.99861127, 0.99926688, 0.49322029],
+                             [- 6.27308044, -0.00045453, 0.00027848, 7.27262591, 0.99861147, 0.99926699, 0.49322034],
+                             [- 6.27308060, -0.00045447, 0.00027844, 7.27262614, 0.99861168, 0.99926710, 0.49322033],
+                             [- 6.27308076, -0.00045440, 0.00027839, 7.27262636, 0.99861188, 0.99926721, 0.49322036],
+                             [- 6.27308092, -0.00045433, 0.00027835, 7.27262659, 0.99861209, 0.99926731, 0.49322047],
+                             [- 6.27308108, -0.00045427, 0.00027831, 7.27262682, 0.99861229, 0.99926742, 0.49322045],
+                             [- 6.27308124, -0.00045420, 0.00027827, 7.27262704, 0.99861249, 0.99926753, 0.49322049],
+                             [- 6.27308140, -0.00045413, 0.00027823, 7.27262727, 0.99861270, 0.99926764, 0.49322055],
+                             [- 6.27308156, -0.00045407, 0.00027819, 7.27262749, 0.99861290, 0.99926774, 0.49322054],
+                             [- 6.27308172, -0.00045400, 0.00027815, 7.27262772, 0.99861310, 0.99926785, 0.49322056],
+                             [- 6.27308188, -0.00045393, 0.00027811, 7.27262795, 0.99861331, 0.99926796, 0.49322059],
+                             [- 6.27308204, -0.00045387, 0.00027807, 7.27262817, 0.99861351, 0.99926807, 0.49322050],
+                             [- 6.27308220, -0.00045380, 0.00027803, 7.27262840, 0.99861371, 0.99926817, 0.49322063],
+                             [- 6.27308236, -0.00045373, 0.00027799, 7.27262862, 0.99861392, 0.99926828, 0.49322066],
+                             [- 6.27308252, -0.00045367, 0.00027795, 7.27262885, 0.99861412, 0.99926839, 0.49322063],
+                             [- 6.27308268, -0.00045360, 0.00027790, 7.27262907, 0.99861432, 0.99926849, 0.49322070],
+                             [- 6.27308284, -0.00045353, 0.00027786, 7.27262930, 0.99861453, 0.99926860, 0.49322066],
+                             [- 6.27308299, -0.00045347, 0.00027782, 7.27262953, 0.99861473, 0.99926871, 0.49322073],
+                             [- 6.27308315, -0.00045340, 0.00027778, 7.27262975, 0.99861493, 0.99926882, 0.49322074],
+                             [- 6.27308331, -0.00045334, 0.00027774, 7.27262998, 0.99861514, 0.99926892, 0.49322073],
+                             [- 6.27308347, -0.00045327, 0.00027770, 7.27263020, 0.99861534, 0.99926903, 0.49322080],
+                             [- 6.27308363, -0.00045320, 0.00027766, 7.27263043, 0.99861554, 0.99926914, 0.49322087],
+                             [- 6.27308379, -0.00045314, 0.00027762, 7.27263065, 0.99861574, 0.99926924, 0.49322079],
+                             [- 6.27308395, -0.00045307, 0.00027758, 7.27263088, 0.99861595, 0.99926935, 0.49322088],
+                             [- 6.27308411, -0.00045300, 0.00027754, 7.27263110, 0.99861615, 0.99926946, 0.49322089],
+                             [- 6.27308426, -0.00045294, 0.00027750, 7.27263133, 0.99861635, 0.99926956, 0.49322091],
+                             [- 6.27308442, -0.00045287, 0.00027746, 7.27263155, 0.99861655, 0.99926967, 0.49322099],
+                             [- 6.27308458, -0.00045281, 0.00027742, 7.27263178, 0.99861676, 0.99926978, 0.49322093],
+                             [- 6.27308474, -0.00045274, 0.00027738, 7.27263200, 0.99861696, 0.99926989, 0.49322094],
+                             [- 6.27308490, -0.00045267, 0.00027734, 7.27263223, 0.99861716, 0.99926999, 0.49322104],
+                             [- 6.27308506, -0.00045261, 0.00027729, 7.27263245, 0.99861736, 0.99927010, 0.49322101],
+                             [- 6.27308522, -0.00045254, 0.00027725, 7.27263268, 0.99861757, 0.99927021, 0.49322100],
+                             [- 6.27308537, -0.00045247, 0.00027721, 7.27263290, 0.99861777, 0.99927031, 0.49322109],
+                             [- 6.27308553, -0.00045241, 0.00027717, 7.27263312, 0.99861797, 0.99927042, 0.49322112],
+                             [- 6.27308569, -0.00045234, 0.00027713, 7.27263335, 0.99861817, 0.99927053, 0.49322118],
+                             [- 6.27308585, -0.00045228, 0.00027709, 7.27263357, 0.99861837, 0.99927063, 0.49322108],
+                             [- 6.27308601, -0.00045221, 0.00027705, 7.27263380, 0.99861858, 0.99927074, 0.49322119],
+                             [- 6.27308616, -0.00045214, 0.00027701, 7.27263402, 0.99861878, 0.99927085, 0.49322124],
+                             [- 6.27308632, -0.00045208, 0.00027697, 7.27263424, 0.99861898, 0.99927095, 0.49322120],
+                             [- 6.27308648, -0.00045201, 0.00027693, 7.27263447, 0.99861918, 0.99927106, 0.49322125],
+                             [- 6.27308664, -0.00045195, 0.00027689, 7.27263469, 0.99861938, 0.99927116, 0.49322131],
+                             [- 6.27308680, -0.00045188, 0.00027685, 7.27263492, 0.99861959, 0.99927127, 0.49322139],
+                             [- 6.27308695, -0.00045181, 0.00027681, 7.27263514, 0.99861979, 0.99927138, 0.49322128],
+                             [- 6.27308711, -0.00045175, 0.00027677, 7.27263536, 0.99861999, 0.99927148, 0.49322133],
+                             [- 6.27308727, -0.00045168, 0.00027673, 7.27263559, 0.99862019, 0.99927159, 0.49322134],
+                             [- 6.27308743, -0.00045162, 0.00027669, 7.27263581, 0.99862039, 0.99927170, 0.49322141],
+                             [- 6.27308759, -0.00045155, 0.00027665, 7.27263604, 0.99862059, 0.99927180, 0.49322137],
+                             [- 6.27308774, -0.00045148, 0.00027661, 7.27263626, 0.99862079, 0.99927191, 0.49322148],
+                             [- 6.27308790, -0.00045142, 0.00027657, 7.27263648, 0.99862099, 0.99927202, 0.49322145],
+                             [- 6.27308806, -0.00045135, 0.00027653, 7.27263671, 0.99862120, 0.99927212, 0.49322138],
+                             [- 6.27308822, -0.00045129, 0.00027649, 7.27263693, 0.99862140, 0.99927223, 0.49322155],
+                             [- 6.27308837, -0.00045122, 0.00027645, 7.27263715, 0.99862160, 0.99927233, 0.49322147],
+                             [- 6.27308853, -0.00045116, 0.00027641, 7.27263737, 0.99862180, 0.99927244, 0.49322164],
+                             [- 6.27308869, -0.00045109, 0.00027636, 7.27263760, 0.99862200, 0.99927255, 0.49322155],
+                             [- 6.27308884, -0.00045102, 0.00027632, 7.27263782, 0.99862220, 0.99927265, 0.49322156],
+                             [- 6.27308900, -0.00045096, 0.00027628, 7.27263804, 0.99862240, 0.99927276, 0.49322154],
+                             [- 6.27308916, -0.00045089, 0.00027624, 7.27263827, 0.99862260, 0.99927286, 0.49322167],
+                             [- 6.27308932, -0.00045083, 0.00027620, 7.27263849, 0.99862280, 0.99927297, 0.49322165],
+                             [- 6.27308947, -0.00045076, 0.00027616, 7.27263871, 0.99862300, 0.99927308, 0.49322177],
+                             [- 6.27308963, -0.00045070, 0.00027612, 7.27263894, 0.99862320, 0.99927318, 0.49322172],
+                             [- 6.27308979, -0.00045063, 0.00027608, 7.27263916, 0.99862340, 0.99927329, 0.49322177],
+                             [- 6.27308994, -0.00045056, 0.00027604, 7.27263938, 0.99862360, 0.99927339, 0.49322171],
+                             [- 6.27309010, -0.00045050, 0.00027600, 7.27263960, 0.99862381, 0.99927350, 0.49322172],
+                             [- 6.27309026, -0.00045043, 0.00027596, 7.27263983, 0.99862401, 0.99927360, 0.49322182],
+                             [- 6.27309042, -0.00045037, 0.00027592, 7.27264005, 0.99862421, 0.99927371, 0.49322183],
+                             [- 6.27309057, -0.00045030, 0.00027588, 7.27264027, 0.99862441, 0.99927382, 0.49322187],
+                             [- 6.27309073, -0.00045024, 0.00027584, 7.27264049, 0.99862461, 0.99927392, 0.49322184],
+                             [- 6.27309089, -0.00045017, 0.00027580, 7.27264071, 0.99862481, 0.99927403, 0.49322189],
+                             [- 6.27309104, -0.00045011, 0.00027576, 7.27264094, 0.99862501, 0.99927413, 0.49322190],
+                             [- 6.27309120, -0.00045004, 0.00027572, 7.27264116, 0.99862521, 0.99927424, 0.49322188],
+                             [- 6.27309136, -0.00044997, 0.00027568, 7.27264138, 0.99862541, 0.99927434, 0.49322197],
+                             [- 6.27309151, -0.00044991, 0.00027564, 7.27264160, 0.99862561, 0.99927445, 0.49322195],
+                             [- 6.27309167, -0.00044984, 0.00027560, 7.27264182, 0.99862581, 0.99927455, 0.49322198],
+                             [- 6.27309183, -0.00044978, 0.00027556, 7.27264205, 0.99862601, 0.99927466, 0.49322195],
+                             [- 6.27309198, -0.00044971, 0.00027552, 7.27264227, 0.99862621, 0.99927477, 0.49322211],
+                             [- 6.27309214, -0.00044965, 0.00027548, 7.27264249, 0.99862641, 0.99927487, 0.49322215],
+                             [- 6.27309229, -0.00044958, 0.00027544, 7.27264271, 0.99862660, 0.99927498, 0.49322209],
+                             [- 6.27309245, -0.00044952, 0.00027540, 7.27264293, 0.99862680, 0.99927508, 0.49322211],
+                             [- 6.27309261, -0.00044945, 0.00027536, 7.27264315, 0.99862700, 0.99927519, 0.49322213],
+                             [- 6.27309276, -0.00044939, 0.00027532, 7.27264338, 0.99862720, 0.99927529, 0.49322220],
+                             [- 6.27309292, -0.00044932, 0.00027528, 7.27264360, 0.99862740, 0.99927540, 0.49322206],
+                             [- 6.27309307, -0.00044926, 0.00027524, 7.27264382, 0.99862760, 0.99927550, 0.49322222],
+                             [- 6.27309323, -0.00044919, 0.00027520, 7.27264404, 0.99862780, 0.99927561, 0.49322230],
+                             [- 6.27309339, -0.00044913, 0.00027516, 7.27264426, 0.99862800, 0.99927571, 0.49322233],
+                             [- 6.27309354, -0.00044906, 0.00027512, 7.27264448, 0.99862820, 0.99927582, 0.49322226],
+                             [- 6.27309370, -0.00044900, 0.00027508, 7.27264470, 0.99862840, 0.99927592, 0.49322237],
+                             [- 6.27309385, -0.00044893, 0.00027504, 7.27264492, 0.99862860, 0.99927603, 0.49322238],
+                             [- 6.27309401, -0.00044887, 0.00027500, 7.27264514, 0.99862880, 0.99927613, 0.49322229],
+                             [- 6.27309417, -0.00044880, 0.00027496, 7.27264537, 0.99862899, 0.99927624, 0.49322245],
+                             [- 6.27309432, -0.00044874, 0.00027492, 7.27264559, 0.99862919, 0.99927634, 0.49322245],
+                             [- 6.27309448, -0.00044867, 0.00027488, 7.27264581, 0.99862939, 0.99927645, 0.49322246],
+                             [- 6.27309463, -0.00044861, 0.00027484, 7.27264603, 0.99862959, 0.99927655, 0.49322247],
+                             [- 6.27309479, -0.00044854, 0.00027480, 7.27264625, 0.99862979, 0.99927666, 0.49322254],
+                             [- 6.27309494, -0.00044848, 0.00027476, 7.27264647, 0.99862999, 0.99927676, 0.49322253],
+                             [- 6.27309510, -0.00044841, 0.00027472, 7.27264669, 0.99863019, 0.99927687, 0.49322258],
+                             [- 6.27309526, -0.00044835, 0.00027468, 7.27264691, 0.99863039, 0.99927697, 0.49322250],
+                             [- 6.27309541, -0.00044828, 0.00027464, 7.27264713, 0.99863058, 0.99927708, 0.49322253],
+                             [- 6.27309557, -0.00044822, 0.00027460, 7.27264735, 0.99863078, 0.99927718, 0.49322260],
+                             [- 6.27309572, -0.00044815, 0.00027456, 7.27264757, 0.99863098, 0.99927729, 0.49322265],
+                             [- 6.27309588, -0.00044809, 0.00027452, 7.27264779, 0.99863118, 0.99927739, 0.49322261],
+                             [- 6.27309603, -0.00044802, 0.00027448, 7.27264801, 0.99863138, 0.99927750, 0.49322265],
+                             [- 6.27309619, -0.00044796, 0.00027444, 7.27264823, 0.99863158, 0.99927760, 0.49322274],
+                             [- 6.27309634, -0.00044789, 0.00027440, 7.27264845, 0.99863177, 0.99927770, 0.49322271],
+                             [- 6.27309650, -0.00044783, 0.00027436, 7.27264867, 0.99863197, 0.99927781, 0.49322271],
+                             [- 6.27309665, -0.00044776, 0.00027432, 7.27264889, 0.99863217, 0.99927791, 0.49322277],
+                             [- 6.27309681, -0.00044770, 0.00027429, 7.27264911, 0.99863237, 0.99927802, 0.49322282],
+                             [- 6.27309696, -0.00044763, 0.00027425, 7.27264933, 0.99863256, 0.99927812, 0.49322277],
+                             [- 6.27309712, -0.00044757, 0.00027421, 7.27264955, 0.99863276, 0.99927823, 0.49322279],
+                             [- 6.27309727, -0.00044750, 0.00027417, 7.27264977, 0.99863296, 0.99927833, 0.49322290],
+                             [- 6.27309743, -0.00044744, 0.00027413, 7.27264999, 0.99863316, 0.99927844, 0.49322286],
+                             [- 6.27309758, -0.00044737, 0.00027409, 7.27265021, 0.99863336, 0.99927854, 0.49322289],
+                             [- 6.27309774, -0.00044731, 0.00027405, 7.27265043, 0.99863355, 0.99927864, 0.49322292],
+                             [- 6.27309789, -0.00044724, 0.00027401, 7.27265065, 0.99863375, 0.99927875, 0.49322303],
+                             [- 6.27309805, -0.00044718, 0.00027397, 7.27265087, 0.99863395, 0.99927885, 0.49322297],
+                             [- 6.27309820, -0.00044712, 0.00027393, 7.27265108, 0.99863415, 0.99927896, 0.49322299],
+                             [- 6.27309835, -0.00044705, 0.00027389, 7.27265130, 0.99863434, 0.99927906, 0.49322300],
+                             [- 6.27309851, -0.00044699, 0.00027385, 7.27265152, 0.99863454, 0.99927916, 0.49322302],
+                             [- 6.27309866, -0.00044692, 0.00027381, 7.27265174, 0.99863474, 0.99927927, 0.49322302],
+                             [- 6.27309882, -0.00044686, 0.00027377, 7.27265196, 0.99863493, 0.99927937, 0.49322309],
+                             [- 6.27309897, -0.00044679, 0.00027373, 7.27265218, 0.99863513, 0.99927948, 0.49322304],
+                             [- 6.27309913, -0.00044673, 0.00027369, 7.27265240, 0.99863533, 0.99927958, 0.49322317],
+                             [- 6.27309928, -0.00044666, 0.00027365, 7.27265262, 0.99863553, 0.99927968, 0.49322317],
+                             [- 6.27309944, -0.00044660, 0.00027361, 7.27265284, 0.99863572, 0.99927979, 0.49322320],
+                             [- 6.27309959, -0.00044653, 0.00027357, 7.27265305, 0.99863592, 0.99927989, 0.49322325],
+                             [- 6.27309974, -0.00044647, 0.00027353, 7.27265327, 0.99863612, 0.99928000, 0.49322322],
+                             [- 6.27309990, -0.00044641, 0.00027349, 7.27265349, 0.99863631, 0.99928010, 0.49322331],
+                             [- 6.27310005, -0.00044634, 0.00027345, 7.27265371, 0.99863651, 0.99928020, 0.49322327],
+                             [- 6.27310021, -0.00044628, 0.00027341, 7.27265393, 0.99863671, 0.99928031, 0.49322319],
+                             [- 6.27310036, -0.00044621, 0.00027338, 7.27265415, 0.99863690, 0.99928041, 0.49322336],
+                             [- 6.27310051, -0.00044615, 0.00027334, 7.27265436, 0.99863710, 0.99928052, 0.49322341],
+                             [- 6.27310067, -0.00044608, 0.00027330, 7.27265458, 0.99863730, 0.99928062, 0.49322335],
+                             [- 6.27310082, -0.00044602, 0.00027326, 7.27265480, 0.99863749, 0.99928072, 0.49322336],
+                             [- 6.27310097, -0.00044596, 0.00027322, 7.27265502, 0.99863769, 0.99928083, 0.49322343],
+                             [- 6.27310113, -0.00044589, 0.00027318, 7.27265524, 0.99863789, 0.99928093, 0.49322345],
+                             [- 6.27310128, -0.00044583, 0.00027314, 7.27265546, 0.99863808, 0.99928103, 0.49322341],
+                             [- 6.27310144, -0.00044576, 0.00027310, 7.27265567, 0.99863828, 0.99928114, 0.49322343],
+                             [- 6.27310159, -0.00044570, 0.00027306, 7.27265589, 0.99863847, 0.99928124, 0.49322353],
+                             [- 6.27310174, -0.00044563, 0.00027302, 7.27265611, 0.99863867, 0.99928134, 0.49322355],
+                             [- 6.27310190, -0.00044557, 0.00027298, 7.27265633, 0.99863887, 0.99928145, 0.49322359],
+                             [- 6.27310205, -0.00044551, 0.00027294, 7.27265654, 0.99863906, 0.99928155, 0.49322357],
+                             [- 6.27310220, -0.00044544, 0.00027290, 7.27265676, 0.99863926, 0.99928165, 0.49322365],
+                             [- 6.27310236, -0.00044538, 0.00027286, 7.27265698, 0.99863945, 0.99928176, 0.49322365],
+                             [- 6.27310251, -0.00044531, 0.00027282, 7.27265720, 0.99863965, 0.99928186, 0.49322366],
+                             [- 6.27310266, -0.00044525, 0.00027279, 7.27265741, 0.99863984, 0.99928196, 0.49322350],
+                             [- 6.27310282, -0.00044519, 0.00027275, 7.27265763, 0.99864004, 0.99928207, 0.49322363],
+                             [- 6.27310297, -0.00044512, 0.00027271, 7.27265785, 0.99864024, 0.99928217, 0.49322376],
+                             [- 6.27310312, -0.00044506, 0.00027267, 7.27265807, 0.99864043, 0.99928227, 0.49322376],
+                             [- 6.27310328, -0.00044499, 0.00027263, 7.27265828, 0.99864063, 0.99928238, 0.49322386],
+                             [- 6.27310343, -0.00044493, 0.00027259, 7.27265850, 0.99864082, 0.99928248, 0.49322387],
+                             [- 6.27310358, -0.00044487, 0.00027255, 7.27265872, 0.99864102, 0.99928258, 0.49322377],
+                             [- 6.27310374, -0.00044480, 0.00027251, 7.27265893, 0.99864121, 0.99928269, 0.49322371],
+                             [- 6.27310389, -0.00044474, 0.00027247, 7.27265915, 0.99864141, 0.99928279, 0.49322385],
+                             [- 6.27310404, -0.00044467, 0.00027243, 7.27265937, 0.99864160, 0.99928289, 0.49322391],
+                             [- 6.27310419, -0.00044461, 0.00027239, 7.27265958, 0.99864180, 0.99928300, 0.49322388],
+                             [- 6.27310435, -0.00044455, 0.00027235, 7.27265980, 0.99864199, 0.99928310, 0.49322387],
+                             [- 6.27310450, -0.00044448, 0.00027231, 7.27266002, 0.99864219, 0.99928320, 0.49322394],
+                             [- 6.27310465, -0.00044442, 0.00027228, 7.27266023, 0.99864238, 0.99928330, 0.49322403],
+                             [- 6.27310481, -0.00044436, 0.00027224, 7.27266045, 0.99864258, 0.99928341, 0.49322393],
+                             [- 6.27310496, -0.00044429, 0.00027220, 7.27266067, 0.99864277, 0.99928351, 0.49322396],
+                             [- 6.27310511, -0.00044423, 0.00027216, 7.27266088, 0.99864297, 0.99928361, 0.49322397],
+                             [- 6.27310526, -0.00044416, 0.00027212, 7.27266110, 0.99864316, 0.99928372, 0.49322408],
+                             [- 6.27310542, -0.00044410, 0.00027208, 7.27266132, 0.99864336, 0.99928382, 0.49322399],
+                             [- 6.27310557, -0.00044404, 0.00027204, 7.27266153, 0.99864355, 0.99928392, 0.49322405],
+                             [- 6.27310572, -0.00044397, 0.00027200, 7.27266175, 0.99864375, 0.99928402, 0.49322411],
+                             [- 6.27310587, -0.00044391, 0.00027196, 7.27266196, 0.99864394, 0.99928413, 0.49322415],
+                             [- 6.27310603, -0.00044385, 0.00027192, 7.27266218, 0.99864414, 0.99928423, 0.49322414],
+                             [- 6.27310618, -0.00044378, 0.00027189, 7.27266240, 0.99864433, 0.99928433, 0.49322429],
+                             [- 6.27310633, -0.00044372, 0.00027185, 7.27266261, 0.99864453, 0.99928444, 0.49322422],
+                             [- 6.27310648, -0.00044365, 0.00027181, 7.27266283, 0.99864472, 0.99928454, 0.49322422],
+                             [- 6.27310663, -0.00044359, 0.00027177, 7.27266304, 0.99864491, 0.99928464, 0.49322418],
+                             [- 6.27310679, -0.00044353, 0.00027173, 7.27266326, 0.99864511, 0.99928474, 0.49322426],
+                             [- 6.27310694, -0.00044346, 0.00027169, 7.27266347, 0.99864530, 0.99928485, 0.49322432],
+                             [- 6.27310709, -0.00044340, 0.00027165, 7.27266369, 0.99864550, 0.99928495, 0.49322429],
+                             [- 6.27310724, -0.00044334, 0.00027161, 7.27266391, 0.99864569, 0.99928505, 0.49322440],
+                             [- 6.27310739, -0.00044327, 0.00027157, 7.27266412, 0.99864589, 0.99928515, 0.49322431],
+                             [- 6.27310755, -0.00044321, 0.00027153, 7.27266434, 0.99864608, 0.99928526, 0.49322435],
+                             [- 6.27310770, -0.00044315, 0.00027150, 7.27266455, 0.99864627, 0.99928536, 0.49322446],
+                             [- 6.27310785, -0.00044308, 0.00027146, 7.27266477, 0.99864647, 0.99928546, 0.49322440],
+                             [- 6.27310800, -0.00044302, 0.00027142, 7.27266498, 0.99864666, 0.99928556, 0.49322441],
+                             [- 6.27310815, -0.00044296, 0.00027138, 7.27266520, 0.99864685, 0.99928566, 0.49322447],
+                             [- 6.27310831, -0.00044289, 0.00027134, 7.27266541, 0.99864705, 0.99928577, 0.49322449],
+                             [- 6.27310846, -0.00044283, 0.00027130, 7.27266563, 0.99864724, 0.99928587, 0.49322455],
+                             [- 6.27310861, -0.00044277, 0.00027126, 7.27266584, 0.99864744, 0.99928597, 0.49322455],
+                             [- 6.27310876, -0.00044270, 0.00027122, 7.27266606, 0.99864763, 0.99928607, 0.49322448],
+                             [- 6.27310891, -0.00044264, 0.00027119, 7.27266627, 0.99864782, 0.99928618, 0.49322460],
+                             [- 6.27310906, -0.00044258, 0.00027115, 7.27266649, 0.99864802, 0.99928628, 0.49322463],
+                             [- 6.27310921, -0.00044251, 0.00027111, 7.27266670, 0.99864821, 0.99928638, 0.49322466],
+                             [- 6.27310937, -0.00044245, 0.00027107, 7.27266692, 0.99864840, 0.99928648, 0.49322476],
+                             [- 6.27310952, -0.00044239, 0.00027103, 7.27266713, 0.99864860, 0.99928658, 0.49322465],
+                             [- 6.27310967, -0.00044232, 0.00027099, 7.27266735, 0.99864879, 0.99928669, 0.49322471],
+                             [- 6.27310982, -0.00044226, 0.00027095, 7.27266756, 0.99864898, 0.99928679, 0.49322475],
+                             [- 6.27310997, -0.00044220, 0.00027091, 7.27266777, 0.99864917, 0.99928689, 0.49322474],
+                             [- 6.27311012, -0.00044213, 0.00027088, 7.27266799, 0.99864937, 0.99928699, 0.49322474],
+                             [- 6.27311027, -0.00044207, 0.00027084, 7.27266820, 0.99864956, 0.99928709, 0.49322480],
+                             [- 6.27311042, -0.00044201, 0.00027080, 7.27266842, 0.99864975, 0.99928719, 0.49322485],
+                             [- 6.27311058, -0.00044194, 0.00027076, 7.27266863, 0.99864995, 0.99928730, 0.49322481],
+                             [- 6.27311073, -0.00044188, 0.00027072, 7.27266884, 0.99865014, 0.99928740, 0.49322488],
+                             [- 6.27311088, -0.00044182, 0.00027068, 7.27266906, 0.99865033, 0.99928750, 0.49322485],
+                             [- 6.27311103, -0.00044176, 0.00027064, 7.27266927, 0.99865052, 0.99928760, 0.49322488],
+                             [- 6.27311118, -0.00044169, 0.00027060, 7.27266949, 0.99865072, 0.99928770, 0.49322494],
+                             [- 6.27311133, -0.00044163, 0.00027057, 7.27266970, 0.99865091, 0.99928780, 0.49322492],
+                             [- 6.27311148, -0.00044157, 0.00027053, 7.27266991, 0.99865110, 0.99928791, 0.49322499],
+                             [- 6.27311163, -0.00044150, 0.00027049, 7.27267013, 0.99865129, 0.99928801, 0.49322490],
+                             [- 6.27311178, -0.00044144, 0.00027045, 7.27267034, 0.99865149, 0.99928811, 0.49322494],
+                             [- 6.27311193, -0.00044138, 0.00027041, 7.27267056, 0.99865168, 0.99928821, 0.49322503],
+                             [- 6.27311208, -0.00044131, 0.00027037, 7.27267077, 0.99865187, 0.99928831, 0.49322507],
+                             [- 6.27311223, -0.00044125, 0.00027033, 7.27267098, 0.99865206, 0.99928841, 0.49322506],
+                             [- 6.27311238, -0.00044119, 0.00027030, 7.27267120, 0.99865226, 0.99928852, 0.49322507],
+                             [- 6.27311253, -0.00044113, 0.00027026, 7.27267141, 0.99865245, 0.99928862, 0.49322511],
+                             [- 6.27311269, -0.00044106, 0.00027022, 7.27267162, 0.99865264, 0.99928872, 0.49322515],
+                             [- 6.27311284, -0.00044100, 0.00027018, 7.27267184, 0.99865283, 0.99928882, 0.49322525],
+                             [- 6.27311299, -0.00044094, 0.00027014, 7.27267205, 0.99865302, 0.99928892, 0.49322511],
+                             [- 6.27311314, -0.00044087, 0.00027010, 7.27267226, 0.99865322, 0.99928902, 0.49322518],
+                             [- 6.27311329, -0.00044081, 0.00027006, 7.27267247, 0.99865341, 0.99928912, 0.49322526],
+                             [- 6.27311344, -0.00044075, 0.00027003, 7.27267269, 0.99865360, 0.99928922, 0.49322521],
+                             [- 6.27311359, -0.00044069, 0.00026999, 7.27267290, 0.99865379, 0.99928933, 0.49322528],
+                             [- 6.27311374, -0.00044062, 0.00026995, 7.27267311, 0.99865398, 0.99928943, 0.49322529],
+                             [- 6.27311389, -0.00044056, 0.00026991, 7.27267333, 0.99865418, 0.99928953, 0.49322527],
+                             [- 6.27311404, -0.00044050, 0.00026987, 7.27267354, 0.99865437, 0.99928963, 0.49322539],
+                             [- 6.27311419, -0.00044044, 0.00026983, 7.27267375, 0.99865456, 0.99928973, 0.49322538],
+                             [- 6.27311434, -0.00044037, 0.00026980, 7.27267396, 0.99865475, 0.99928983, 0.49322547],
+                             [- 6.27311449, -0.00044031, 0.00026976, 7.27267418, 0.99865494, 0.99928993, 0.49322544],
+                             [- 6.27311464, -0.00044025, 0.00026972, 7.27267439, 0.99865513, 0.99929003, 0.49322545],
+                             [- 6.27311479, -0.00044018, 0.00026968, 7.27267460, 0.99865532, 0.99929013, 0.49322545],
+                             [- 6.27311494, -0.00044012, 0.00026964, 7.27267481, 0.99865551, 0.99929024, 0.49322537],
+                             [- 6.27311509, -0.00044006, 0.00026960, 7.27267503, 0.99865571, 0.99929034, 0.49322549],
+                             [- 6.27311524, -0.00044000, 0.00026957, 7.27267524, 0.99865590, 0.99929044, 0.49322552],
+                             [- 6.27311539, -0.00043993, 0.00026953, 7.27267545, 0.99865609, 0.99929054, 0.49322561],
+                             [- 6.27311554, -0.00043987, 0.00026949, 7.27267566, 0.99865628, 0.99929064, 0.49322551],
+                             [- 6.27311569, -0.00043981, 0.00026945, 7.27267588, 0.99865647, 0.99929074, 0.49322559],
+                             [- 6.27311583, -0.00043975, 0.00026941, 7.27267609, 0.99865666, 0.99929084, 0.49322564],
+                             [- 6.27311598, -0.00043968, 0.00026937, 7.27267630, 0.99865685, 0.99929094, 0.49322558],
+                             [- 6.27311613, -0.00043962, 0.00026934, 7.27267651, 0.99865704, 0.99929104, 0.49322567],
+                             [- 6.27311628, -0.00043956, 0.00026930, 7.27267672, 0.99865723, 0.99929114, 0.49322564],
+                             [- 6.27311643, -0.00043950, 0.00026926, 7.27267693, 0.99865742, 0.99929124, 0.49322573],
+                             [- 6.27311658, -0.00043944, 0.00026922, 7.27267715, 0.99865762, 0.99929134, 0.49322571],
+                             [- 6.27311673, -0.00043937, 0.00026918, 7.27267736, 0.99865781, 0.99929144, 0.49322569],
+                             [- 6.27311688, -0.00043931, 0.00026914, 7.27267757, 0.99865800, 0.99929155, 0.49322578],
+                             [- 6.27311703, -0.00043925, 0.00026911, 7.27267778, 0.99865819, 0.99929165, 0.49322578],
+                             [- 6.27311718, -0.00043919, 0.00026907, 7.27267799, 0.99865838, 0.99929175, 0.49322584],
+                             [- 6.27311733, -0.00043912, 0.00026903, 7.27267820, 0.99865857, 0.99929185, 0.49322586],
+                             [- 6.27311748, -0.00043906, 0.00026899, 7.27267842, 0.99865876, 0.99929195, 0.49322590],
+                             [- 6.27311763, -0.00043900, 0.00026895, 7.27267863, 0.99865895, 0.99929205, 0.49322588],
+                             [- 6.27311777, -0.00043894, 0.00026892, 7.27267884, 0.99865914, 0.99929215, 0.49322594],
+                             [- 6.27311792, -0.00043887, 0.00026888, 7.27267905, 0.99865933, 0.99929225, 0.49322584],
+                             [- 6.27311807, -0.00043881, 0.00026884, 7.27267926, 0.99865952, 0.99929235, 0.49322593],
+                             [- 6.27311822, -0.00043875, 0.00026880, 7.27267947, 0.99865971, 0.99929245, 0.49322593],
+                             [- 6.27311837, -0.00043869, 0.00026876, 7.27267968, 0.99865990, 0.99929255, 0.49322599],
+                             [- 6.27311852, -0.00043863, 0.00026872, 7.27267989, 0.99866009, 0.99929265, 0.49322601],
+                             [- 6.27311867, -0.00043856, 0.00026869, 7.27268010, 0.99866028, 0.99929275, 0.49322609],
+                             [- 6.27311882, -0.00043850, 0.00026865, 7.27268032, 0.99866047, 0.99929285, 0.49322605],
+                             [- 6.27311897, -0.00043844, 0.00026861, 7.27268053, 0.99866066, 0.99929295, 0.49322609],
+                             [- 6.27311911, -0.00043838, 0.00026857, 7.27268074, 0.99866085, 0.99929305, 0.49322609],
+                             [- 6.27311926, -0.00043832, 0.00026853, 7.27268095, 0.99866104, 0.99929315, 0.49322617],
+                             [- 6.27311941, -0.00043825, 0.00026850, 7.27268116, 0.99866123, 0.99929325, 0.49322622],
+                             [- 6.27311956, -0.00043819, 0.00026846, 7.27268137, 0.99866142, 0.99929335, 0.49322614],
+                             [- 6.27311971, -0.00043813, 0.00026842, 7.27268158, 0.99866161, 0.99929345, 0.49322631],
+                             [- 6.27311986, -0.00043807, 0.00026838, 7.27268179, 0.99866180, 0.99929355, 0.49322620],
+                             [- 6.27312000, -0.00043800, 0.00026834, 7.27268200, 0.99866199, 0.99929365, 0.49322616],
+                             [- 6.27312015, -0.00043794, 0.00026831, 7.27268221, 0.99866217, 0.99929375, 0.49322624],
+                             [- 6.27312030, -0.00043788, 0.00026827, 7.27268242, 0.99866236, 0.99929385, 0.49322623],
+                             [- 6.27312045, -0.00043782, 0.00026823, 7.27268263, 0.99866255, 0.99929395, 0.49322635],
+                             [- 6.27312060, -0.00043776, 0.00026819, 7.27268284, 0.99866274, 0.99929405, 0.49322632],
+                             [- 6.27312075, -0.00043770, 0.00026815, 7.27268305, 0.99866293, 0.99929415, 0.49322635],
+                             [- 6.27312089, -0.00043763, 0.00026812, 7.27268326, 0.99866312, 0.99929425, 0.49322639],
+                             [- 6.27312104, -0.00043757, 0.00026808, 7.27268347, 0.99866331, 0.99929435, 0.49322639],
+                             [- 6.27312119, -0.00043751, 0.00026804, 7.27268368, 0.99866350, 0.99929445, 0.49322638],
+                             [- 6.27312134, -0.00043745, 0.00026800, 7.27268389, 0.99866369, 0.99929455, 0.49322647],
+                             [- 6.27312149, -0.00043739, 0.00026796, 7.27268410, 0.99866388, 0.99929465, 0.49322642],
+                             [- 6.27312163, -0.00043732, 0.00026793, 7.27268431, 0.99866407, 0.99929475, 0.49322644],
+                             [- 6.27312178, -0.00043726, 0.00026789, 7.27268452, 0.99866425, 0.99929485, 0.49322646],
+                             [- 6.27312193, -0.00043720, 0.00026785, 7.27268473, 0.99866444, 0.99929495, 0.49322653],
+                             [- 6.27312208, -0.00043714, 0.00026781, 7.27268494, 0.99866463, 0.99929505, 0.49322663],
+                             [- 6.27312223, -0.00043708, 0.00026778, 7.27268515, 0.99866482, 0.99929515, 0.49322655],
+                             [- 6.27312237, -0.00043702, 0.00026774, 7.27268536, 0.99866501, 0.99929525, 0.49322658],
+                             [- 6.27312252, -0.00043695, 0.00026770, 7.27268557, 0.99866520, 0.99929535, 0.49322660],
+                             [- 6.27312267, -0.00043689, 0.00026766, 7.27268578, 0.99866539, 0.99929545, 0.49322666],
+                             [- 6.27312282, -0.00043683, 0.00026762, 7.27268599, 0.99866557, 0.99929555, 0.49322663],
+                             [- 6.27312296, -0.00043677, 0.00026759, 7.27268619, 0.99866576, 0.99929564, 0.49322672],
+                             [- 6.27312311, -0.00043671, 0.00026755, 7.27268640, 0.99866595, 0.99929574, 0.49322669],
+                             [- 6.27312326, -0.00043665, 0.00026751, 7.27268661, 0.99866614, 0.99929584, 0.49322667],
+                             [- 6.27312341, -0.00043658, 0.00026747, 7.27268682, 0.99866633, 0.99929594, 0.49322665],
+                             [- 6.27312355, -0.00043652, 0.00026744, 7.27268703, 0.99866652, 0.99929604, 0.49322678],
+                             [- 6.27312370, -0.00043646, 0.00026740, 7.27268724, 0.99866670, 0.99929614, 0.49322680],
+                             [- 6.27312385, -0.00043640, 0.00026736, 7.27268745, 0.99866689, 0.99929624, 0.49322677],
+                             [- 6.27312399, -0.00043634, 0.00026732, 7.27268766, 0.99866708, 0.99929634, 0.49322687],
+                             [- 6.27312414, -0.00043628, 0.00026728, 7.27268787, 0.99866727, 0.99929644, 0.49322695],
+                             [- 6.27312429, -0.00043622, 0.00026725, 7.27268807, 0.99866746, 0.99929654, 0.49322684],
+                             [- 6.27312444, -0.00043615, 0.00026721, 7.27268828, 0.99866764, 0.99929664, 0.49322695],
+                             [- 6.27312458, -0.00043609, 0.00026717, 7.27268849, 0.99866783, 0.99929674, 0.49322694],
+                             [- 6.27312473, -0.00043603, 0.00026713, 7.27268870, 0.99866802, 0.99929684, 0.49322694],
+                             [- 6.27312488, -0.00043597, 0.00026710, 7.27268891, 0.99866821, 0.99929693, 0.49322692],
+                             [- 6.27312502, -0.00043591, 0.00026706, 7.27268912, 0.99866839, 0.99929703, 0.49322694],
+                             [- 6.27312517, -0.00043585, 0.00026702, 7.27268932, 0.99866858, 0.99929713, 0.49322699],
+                             [- 6.27312532, -0.00043579, 0.00026698, 7.27268953, 0.99866877, 0.99929723, 0.49322697],
+                             [- 6.27312546, -0.00043572, 0.00026695, 7.27268974, 0.99866896, 0.99929733, 0.49322709],
+                             [- 6.27312561, -0.00043566, 0.00026691, 7.27268995, 0.99866914, 0.99929743, 0.49322698],
+                             [- 6.27312576, -0.00043560, 0.00026687, 7.27269016, 0.99866933, 0.99929753, 0.49322713],
+                             [- 6.27312590, -0.00043554, 0.00026683, 7.27269037, 0.99866952, 0.99929763, 0.49322708],
+                             [- 6.27312605, -0.00043548, 0.00026680, 7.27269057, 0.99866971, 0.99929773, 0.49322723],
+                             [- 6.27312620, -0.00043542, 0.00026676, 7.27269078, 0.99866989, 0.99929782, 0.49322717],
+                             [- 6.27312634, -0.00043536, 0.00026672, 7.27269099, 0.99867008, 0.99929792, 0.49322722],
+                             [- 6.27312649, -0.00043529, 0.00026668, 7.27269120, 0.99867027, 0.99929802, 0.49322714],
+                             [- 6.27312664, -0.00043523, 0.00026665, 7.27269140, 0.99867045, 0.99929812, 0.49322725],
+                             [- 6.27312678, -0.00043517, 0.00026661, 7.27269161, 0.99867064, 0.99929822, 0.49322739],
+                             [- 6.27312693, -0.00043511, 0.00026657, 7.27269182, 0.99867083, 0.99929832, 0.49322721],
+                             [- 6.27312708, -0.00043505, 0.00026653, 7.27269203, 0.99867101, 0.99929842, 0.49322728],
+                             [- 6.27312722, -0.00043499, 0.00026650, 7.27269223, 0.99867120, 0.99929852, 0.49322731],
+                             [- 6.27312737, -0.00043493, 0.00026646, 7.27269244, 0.99867139, 0.99929861, 0.49322735],
+                             [- 6.27312752, -0.00043487, 0.00026642, 7.27269265, 0.99867158, 0.99929871, 0.49322737],
+                             [- 6.27312766, -0.00043481, 0.00026638, 7.27269286, 0.99867176, 0.99929881, 0.49322735],
+                             [- 6.27312781, -0.00043474, 0.00026635, 7.27269306, 0.99867195, 0.99929891, 0.49322744],
+                             [- 6.27312795, -0.00043468, 0.00026631, 7.27269327, 0.99867214, 0.99929901, 0.49322745],
+                             [- 6.27312810, -0.00043462, 0.00026627, 7.27269348, 0.99867232, 0.99929911, 0.49322747],
+                             [- 6.27312825, -0.00043456, 0.00026623, 7.27269368, 0.99867251, 0.99929920, 0.49322750],
+                             [- 6.27312839, -0.00043450, 0.00026620, 7.27269389, 0.99867269, 0.99929930, 0.49322745],
+                             [- 6.27312854, -0.00043444, 0.00026616, 7.27269410, 0.99867288, 0.99929940, 0.49322761],
+                             [- 6.27312868, -0.00043438, 0.00026612, 7.27269431, 0.99867307, 0.99929950, 0.49322746],
+                             [- 6.27312883, -0.00043432, 0.00026608, 7.27269451, 0.99867325, 0.99929960, 0.49322757],
+                             [- 6.27312898, -0.00043426, 0.00026605, 7.27269472, 0.99867344, 0.99929970, 0.49322765],
+                             [- 6.27312912, -0.00043420, 0.00026601, 7.27269493, 0.99867363, 0.99929979, 0.49322763],
+                             [- 6.27312927, -0.00043413, 0.00026597, 7.27269513, 0.99867381, 0.99929989, 0.49322751],
+                             [- 6.27312941, -0.00043407, 0.00026593, 7.27269534, 0.99867400, 0.99929999, 0.49322758],
+                             [- 6.27312956, -0.00043401, 0.00026590, 7.27269555, 0.99867418, 0.99930009, 0.49322771],
+                             [- 6.27312970, -0.00043395, 0.00026586, 7.27269575, 0.99867437, 0.99930019, 0.49322770],
+                             [- 6.27312985, -0.00043389, 0.00026582, 7.27269596, 0.99867456, 0.99930029, 0.49322772],
+                             [- 6.27313000, -0.00043383, 0.00026579, 7.27269616, 0.99867474, 0.99930038, 0.49322775],
+                             [- 6.27313014, -0.00043377, 0.00026575, 7.27269637, 0.99867493, 0.99930048, 0.49322776],
+                             [- 6.27313029, -0.00043371, 0.00026571, 7.27269658, 0.99867511, 0.99930058, 0.49322779],
+                             [- 6.27313043, -0.00043365, 0.00026567, 7.27269678, 0.99867530, 0.99930068, 0.49322775],
+                             [- 6.27313058, -0.00043359, 0.00026564, 7.27269699, 0.99867548, 0.99930078, 0.49322782],
+                             [- 6.27313072, -0.00043353, 0.00026560, 7.27269720, 0.99867567, 0.99930087, 0.49322777],
+                             [- 6.27313087, -0.00043347, 0.00026556, 7.27269740, 0.99867586, 0.99930097, 0.49322785],
+                             [- 6.27313101, -0.00043341, 0.00026552, 7.27269761, 0.99867604, 0.99930107, 0.49322785],
+                             [- 6.27313116, -0.00043335, 0.00026549, 7.27269781, 0.99867623, 0.99930117, 0.49322792],
+                             [- 6.27313130, -0.00043328, 0.00026545, 7.27269802, 0.99867641, 0.99930127, 0.49322802],
+                             [- 6.27313145, -0.00043322, 0.00026541, 7.27269823, 0.99867660, 0.99930136, 0.49322800],
+                             [- 6.27313159, -0.00043316, 0.00026538, 7.27269843, 0.99867678, 0.99930146, 0.49322801],
+                             [- 6.27313174, -0.00043310, 0.00026534, 7.27269864, 0.99867697, 0.99930156, 0.49322793],
+                             [- 6.27313188, -0.00043304, 0.00026530, 7.27269884, 0.99867715, 0.99930166, 0.49322797],
+                             [- 6.27313203, -0.00043298, 0.00026526, 7.27269905, 0.99867734, 0.99930175, 0.49322808],
+                             [- 6.27313217, -0.00043292, 0.00026523, 7.27269925, 0.99867752, 0.99930185, 0.49322805],
+                             [- 6.27313232, -0.00043286, 0.00026519, 7.27269946, 0.99867771, 0.99930195, 0.49322811],
+                             [- 6.27313246, -0.00043280, 0.00026515, 7.27269966, 0.99867789, 0.99930205, 0.49322809],
+                             [- 6.27313261, -0.00043274, 0.00026512, 7.27269987, 0.99867808, 0.99930214, 0.49322806],
+                             [- 6.27313275, -0.00043268, 0.00026508, 7.27270007, 0.99867826, 0.99930224, 0.49322819],
+                             [- 6.27313290, -0.00043262, 0.00026504, 7.27270028, 0.99867845, 0.99930234, 0.49322820],
+                             [- 6.27313304, -0.00043256, 0.00026501, 7.27270049, 0.99867863, 0.99930244, 0.49322821],
+                             [- 6.27313319, -0.00043250, 0.00026497, 7.27270069, 0.99867882, 0.99930253, 0.49322826],
+                             [- 6.27313333, -0.00043244, 0.00026493, 7.27270090, 0.99867900, 0.99930263, 0.49322825],
+                             [- 6.27313348, -0.00043238, 0.00026489, 7.27270110, 0.99867919, 0.99930273, 0.49322828],
+                             [- 6.27313362, -0.00043232, 0.00026486, 7.27270131, 0.99867937, 0.99930283, 0.49322824],
+                             [- 6.27313377, -0.00043226, 0.00026482, 7.27270151, 0.99867955, 0.99930292, 0.49322829],
+                             [- 6.27313391, -0.00043220, 0.00026478, 7.27270171, 0.99867974, 0.99930302, 0.49322833],
+                             [- 6.27313405, -0.00043214, 0.00026475, 7.27270192, 0.99867992, 0.99930312, 0.49322832],
+                             [- 6.27313420, -0.00043207, 0.00026471, 7.27270212, 0.99868011, 0.99930322, 0.49322832],
+                             [- 6.27313434, -0.00043201, 0.00026467, 7.27270233, 0.99868029, 0.99930331, 0.49322841],
+                             [- 6.27313449, -0.00043195, 0.00026464, 7.27270253, 0.99868048, 0.99930341, 0.49322842],
+                             [- 6.27313463, -0.00043189, 0.00026460, 7.27270274, 0.99868066, 0.99930351, 0.49322850],
+                             [- 6.27313478, -0.00043183, 0.00026456, 7.27270294, 0.99868084, 0.99930360, 0.49322849],
+                             [- 6.27313492, -0.00043177, 0.00026452, 7.27270315, 0.99868103, 0.99930370, 0.49322832],
+                             [- 6.27313506, -0.00043171, 0.00026449, 7.27270335, 0.99868121, 0.99930380, 0.49322850],
+                             [- 6.27313521, -0.00043165, 0.00026445, 7.27270356, 0.99868140, 0.99930390, 0.49322849],
+                             [- 6.27313535, -0.00043159, 0.00026441, 7.27270376, 0.99868158, 0.99930399, 0.49322851],
+                             [- 6.27313550, -0.00043153, 0.00026438, 7.27270396, 0.99868176, 0.99930409, 0.49322842],
+                             [- 6.27313564, -0.00043147, 0.00026434, 7.27270417, 0.99868195, 0.99930419, 0.49322856],
+                             [- 6.27313578, -0.00043141, 0.00026430, 7.27270437, 0.99868213, 0.99930428, 0.49322852],
+                             [- 6.27313593, -0.00043135, 0.00026427, 7.27270458, 0.99868232, 0.99930438, 0.49322857],
+                             [- 6.27313607, -0.00043129, 0.00026423, 7.27270478, 0.99868250, 0.99930448, 0.49322857],
+                             [- 6.27313622, -0.00043123, 0.00026419, 7.27270498, 0.99868268, 0.99930458, 0.49322862],
+                             [- 6.27313636, -0.00043117, 0.00026416, 7.27270519, 0.99868287, 0.99930467, 0.49322867],
+                             [- 6.27313650, -0.00043111, 0.00026412, 7.27270539, 0.99868305, 0.99930477, 0.49322876],
+                             [- 6.27313665, -0.00043105, 0.00026408, 7.27270560, 0.99868323, 0.99930487, 0.49322877],
+                             [- 6.27313679, -0.00043099, 0.00026405, 7.27270580, 0.99868342, 0.99930496, 0.49322873],
+                             [- 6.27313693, -0.00043093, 0.00026401, 7.27270600, 0.99868360, 0.99930506, 0.49322870],
+                             [- 6.27313708, -0.00043087, 0.00026397, 7.27270621, 0.99868378, 0.99930516, 0.49322877],
+                             [- 6.27313722, -0.00043081, 0.00026394, 7.27270641, 0.99868397, 0.99930525, 0.49322879],
+                             [- 6.27313737, -0.00043075, 0.00026390, 7.27270661, 0.99868415, 0.99930535, 0.49322891],
+                             [- 6.27313751, -0.00043069, 0.00026386, 7.27270682, 0.99868433, 0.99930545, 0.49322887],
+                             [- 6.27313765, -0.00043063, 0.00026382, 7.27270702, 0.99868452, 0.99930554, 0.49322881],
+                             [- 6.27313780, -0.00043057, 0.00026379, 7.27270722, 0.99868470, 0.99930564, 0.49322892],
+                             [- 6.27313794, -0.00043051, 0.00026375, 7.27270743, 0.99868488, 0.99930574, 0.49322891],
+                             [- 6.27313808, -0.00043045, 0.00026371, 7.27270763, 0.99868507, 0.99930583, 0.49322891],
+                             [- 6.27313823, -0.00043039, 0.00026368, 7.27270783, 0.99868525, 0.99930593, 0.49322893],
+                             [- 6.27313837, -0.00043033, 0.00026364, 7.27270804, 0.99868543, 0.99930603, 0.49322886],
+                             [- 6.27313851, -0.00043027, 0.00026360, 7.27270824, 0.99868561, 0.99930612, 0.49322902],
+                             [- 6.27313865, -0.00043021, 0.00026357, 7.27270844, 0.99868580, 0.99930622, 0.49322900],
+                             [- 6.27313880, -0.00043015, 0.00026353, 7.27270864, 0.99868598, 0.99930632, 0.49322904],
+                             [- 6.27313894, -0.00043009, 0.00026349, 7.27270885, 0.99868616, 0.99930641, 0.49322903],
+                             [- 6.27313908, -0.00043003, 0.00026346, 7.27270905, 0.99868634, 0.99930651, 0.49322900],
+                             [- 6.27313923, -0.00042997, 0.00026342, 7.27270925, 0.99868653, 0.99930660, 0.49322904],
+                             [- 6.27313937, -0.00042991, 0.00026338, 7.27270946, 0.99868671, 0.99930670, 0.49322912],
+                             [- 6.27313951, -0.00042985, 0.00026335, 7.27270966, 0.99868689, 0.99930680, 0.49322917],
+                             [- 6.27313966, -0.00042980, 0.00026331, 7.27270986, 0.99868707, 0.99930689, 0.49322903],
+                             [- 6.27313980, -0.00042974, 0.00026328, 7.27271006, 0.99868726, 0.99930699, 0.49322919],
+                             [- 6.27313994, -0.00042968, 0.00026324, 7.27271027, 0.99868744, 0.99930709, 0.49322915],
+                             [- 6.27314008, -0.00042962, 0.00026320, 7.27271047, 0.99868762, 0.99930718, 0.49322921],
+                             [- 6.27314023, -0.00042956, 0.00026317, 7.27271067, 0.99868780, 0.99930728, 0.49322918],
+                             [- 6.27314037, -0.00042950, 0.00026313, 7.27271087, 0.99868799, 0.99930737, 0.49322930],
+                             [- 6.27314051, -0.00042944, 0.00026309, 7.27271107, 0.99868817, 0.99930747, 0.49322927],
+                             [- 6.27314065, -0.00042938, 0.00026306, 7.27271128, 0.99868835, 0.99930757, 0.49322931],
+                             [- 6.27314080, -0.00042932, 0.00026302, 7.27271148, 0.99868853, 0.99930766, 0.49322934],
+                             [- 6.27314094, -0.00042926, 0.00026298, 7.27271168, 0.99868871, 0.99930776, 0.49322928],
+                             [- 6.27314108, -0.00042920, 0.00026295, 7.27271188, 0.99868890, 0.99930785, 0.49322942],
+                             [- 6.27314122, -0.00042914, 0.00026291, 7.27271208, 0.99868908, 0.99930795, 0.49322942],
+                             [- 6.27314137, -0.00042908, 0.00026287, 7.27271229, 0.99868926, 0.99930805, 0.49322944],
+                             [- 6.27314151, -0.00042902, 0.00026284, 7.27271249, 0.99868944, 0.99930814, 0.49322951],
+                             [- 6.27314165, -0.00042896, 0.00026280, 7.27271269, 0.99868962, 0.99930824, 0.49322944],
+                             [- 6.27314179, -0.00042890, 0.00026276, 7.27271289, 0.99868980, 0.99930833, 0.49322951],
+                             [- 6.27314194, -0.00042884, 0.00026273, 7.27271309, 0.99868999, 0.99930843, 0.49322954],
+                             [- 6.27314208, -0.00042878, 0.00026269, 7.27271329, 0.99869017, 0.99930853, 0.49322961],
+                             [- 6.27314222, -0.00042872, 0.00026265, 7.27271350, 0.99869035, 0.99930862, 0.49322958],
+                             [- 6.27314236, -0.00042866, 0.00026262, 7.27271370, 0.99869053, 0.99930872, 0.49322958],
+                             [- 6.27314250, -0.00042861, 0.00026258, 7.27271390, 0.99869071, 0.99930881, 0.49322960],
+                             [- 6.27314265, -0.00042855, 0.00026255, 7.27271410, 0.99869089, 0.99930891, 0.49322954],
+                             [- 6.27314279, -0.00042849, 0.00026251, 7.27271430, 0.99869107, 0.99930900, 0.49322960],
+                             [- 6.27314293, -0.00042843, 0.00026247, 7.27271450, 0.99869125, 0.99930910, 0.49322964],
+                             [- 6.27314307, -0.00042837, 0.00026244, 7.27271470, 0.99869144, 0.99930920, 0.49322967],
+                             [- 6.27314321, -0.00042831, 0.00026240, 7.27271491, 0.99869162, 0.99930929, 0.49322963],
+                             [- 6.27314336, -0.00042825, 0.00026236, 7.27271511, 0.99869180, 0.99930939, 0.49322972],
+                             [- 6.27314350, -0.00042819, 0.00026233, 7.27271531, 0.99869198, 0.99930948, 0.49322962],
+                             [- 6.27314364, -0.00042813, 0.00026229, 7.27271551, 0.99869216, 0.99930958, 0.49322977],
+                             [- 6.27314378, -0.00042807, 0.00026226, 7.27271571, 0.99869234, 0.99930967, 0.49322982],
+                             [- 6.27314392, -0.00042801, 0.00026222, 7.27271591, 0.99869252, 0.99930977, 0.49322974],
+                             [- 6.27314406, -0.00042795, 0.00026218, 7.27271611, 0.99869270, 0.99930986, 0.49322983],
+                             [- 6.27314421, -0.00042789, 0.00026215, 7.27271631, 0.99869288, 0.99930996, 0.49322981],
+                             [- 6.27314435, -0.00042783, 0.00026211, 7.27271651, 0.99869306, 0.99931005, 0.49322987],
+                             [- 6.27314449, -0.00042778, 0.00026207, 7.27271671, 0.99869325, 0.99931015, 0.49322991],
+                             [- 6.27314463, -0.00042772, 0.00026204, 7.27271691, 0.99869343, 0.99931025, 0.49322985],
+                             [- 6.27314477, -0.00042766, 0.00026200, 7.27271711, 0.99869361, 0.99931034, 0.49322989],
+                             [- 6.27314491, -0.00042760, 0.00026197, 7.27271731, 0.99869379, 0.99931044, 0.49322995],
+                             [- 6.27314505, -0.00042754, 0.00026193, 7.27271752, 0.99869397, 0.99931053, 0.49322998],
+                             [- 6.27314520, -0.00042748, 0.00026189, 7.27271772, 0.99869415, 0.99931063, 0.49322992],
+                             [- 6.27314534, -0.00042742, 0.00026186, 7.27271792, 0.99869433, 0.99931072, 0.49322999],
+                             [- 6.27314548, -0.00042736, 0.00026182, 7.27271812, 0.99869451, 0.99931082, 0.49323014],
+                             [- 6.27314562, -0.00042730, 0.00026178, 7.27271832, 0.99869469, 0.99931091, 0.49323001],
+                             [- 6.27314576, -0.00042724, 0.00026175, 7.27271852, 0.99869487, 0.99931101, 0.49323007],
+                             [- 6.27314590, -0.00042719, 0.00026171, 7.27271872, 0.99869505, 0.99931110, 0.49323010],
+                             [- 6.27314604, -0.00042713, 0.00026168, 7.27271892, 0.99869523, 0.99931120, 0.49323018],
+                             [- 6.27314618, -0.00042707, 0.00026164, 7.27271912, 0.99869541, 0.99931129, 0.49323018],
+                             [- 6.27314633, -0.00042701, 0.00026160, 7.27271932, 0.99869559, 0.99931139, 0.49323016],
+                             [- 6.27314647, -0.00042695, 0.00026157, 7.27271952, 0.99869577, 0.99931148, 0.49323007],
+                             [- 6.27314661, -0.00042689, 0.00026153, 7.27271972, 0.99869595, 0.99931158, 0.49323022],
+                             [- 6.27314675, -0.00042683, 0.00026150, 7.27271992, 0.99869613, 0.99931167, 0.49323025],
+                             [- 6.27314689, -0.00042677, 0.00026146, 7.27272012, 0.99869631, 0.99931177, 0.49323030],
+                             [- 6.27314703, -0.00042671, 0.00026142, 7.27272032, 0.99869649, 0.99931186, 0.49323027],
+                             [- 6.27314717, -0.00042666, 0.00026139, 7.27272051, 0.99869667, 0.99931196, 0.49323031],
+                             [- 6.27314731, -0.00042660, 0.00026135, 7.27272071, 0.99869685, 0.99931205, 0.49323029],
+                             [- 6.27314745, -0.00042654, 0.00026132, 7.27272091, 0.99869703, 0.99931215, 0.49323033],
+                             [- 6.27314759, -0.00042648, 0.00026128, 7.27272111, 0.99869721, 0.99931224, 0.49323043],
+                             [- 6.27314773, -0.00042642, 0.00026124, 7.27272131, 0.99869739, 0.99931234, 0.49323035],
+                             [- 6.27314787, -0.00042636, 0.00026121, 7.27272151, 0.99869757, 0.99931243, 0.49323032],
+                             [- 6.27314801, -0.00042630, 0.00026117, 7.27272171, 0.99869775, 0.99931253, 0.49323043],
+                             [- 6.27314815, -0.00042624, 0.00026114, 7.27272191, 0.99869792, 0.99931262, 0.49323038],
+                             [- 6.27314830, -0.00042619, 0.00026110, 7.27272211, 0.99869810, 0.99931272, 0.49323055],
+                             [- 6.27314844, -0.00042613, 0.00026106, 7.27272231, 0.99869828, 0.99931281, 0.49323047],
+                             [- 6.27314858, -0.00042607, 0.00026103, 7.27272251, 0.99869846, 0.99931290, 0.49323039],
+                             [- 6.27314872, -0.00042601, 0.00026099, 7.27272271, 0.99869864, 0.99931300, 0.49323039],
+                             [- 6.27314886, -0.00042595, 0.00026096, 7.27272291, 0.99869882, 0.99931309, 0.49323057],
+                             [- 6.27314900, -0.00042589, 0.00026092, 7.27272310, 0.99869900, 0.99931319, 0.49323051],
+                             [- 6.27314914, -0.00042583, 0.00026088, 7.27272330, 0.99869918, 0.99931328, 0.49323056],
+                             [- 6.27314928, -0.00042578, 0.00026085, 7.27272350, 0.99869936, 0.99931338, 0.49323064],
+                             [- 6.27314942, -0.00042572, 0.00026081, 7.27272370, 0.99869954, 0.99931347, 0.49323065],
+                             [- 6.27314956, -0.00042566, 0.00026078, 7.27272390, 0.99869972, 0.99931357, 0.49323065],
+                             [- 6.27314970, -0.00042560, 0.00026074, 7.27272410, 0.99869989, 0.99931366, 0.49323070],
+                             [- 6.27314984, -0.00042554, 0.00026070, 7.27272430, 0.99870007, 0.99931375, 0.49323062],
+                             [- 6.27314998, -0.00042548, 0.00026067, 7.27272450, 0.99870025, 0.99931385, 0.49323063],
+                             [- 6.27315012, -0.00042542, 0.00026063, 7.27272469, 0.99870043, 0.99931394, 0.49323075],
+                             [- 6.27315026, -0.00042537, 0.00026060, 7.27272489, 0.99870061, 0.99931404, 0.49323074],
+                             [- 6.27315040, -0.00042531, 0.00026056, 7.27272509, 0.99870079, 0.99931413, 0.49323081],
+                             [- 6.27315054, -0.00042525, 0.00026052, 7.27272529, 0.99870097, 0.99931423, 0.49323082],
+                             [- 6.27315068, -0.00042519, 0.00026049, 7.27272549, 0.99870115, 0.99931432, 0.49323079],
+                             [- 6.27315082, -0.00042513, 0.00026045, 7.27272569, 0.99870132, 0.99931441, 0.49323072],
+                             [- 6.27315096, -0.00042507, 0.00026042, 7.27272588, 0.99870150, 0.99931451, 0.49323088],
+                             [- 6.27315110, -0.00042502, 0.00026038, 7.27272608, 0.99870168, 0.99931460, 0.49323096],
+                             [- 6.27315124, -0.00042496, 0.00026035, 7.27272628, 0.99870186, 0.99931470, 0.49323088],
+                             [- 6.27315138, -0.00042490, 0.00026031, 7.27272648, 0.99870204, 0.99931479, 0.49323085],
+                             [- 6.27315152, -0.00042484, 0.00026027, 7.27272668, 0.99870222, 0.99931489, 0.49323089],
+                             [- 6.27315165, -0.00042478, 0.00026024, 7.27272687, 0.99870239, 0.99931498, 0.49323085],
+                             [- 6.27315179, -0.00042472, 0.00026020, 7.27272707, 0.99870257, 0.99931507, 0.49323101],
+                             [- 6.27315193, -0.00042467, 0.00026017, 7.27272727, 0.99870275, 0.99931517, 0.49323094],
+                             [- 6.27315207, -0.00042461, 0.00026013, 7.27272747, 0.99870293, 0.99931526, 0.49323104],
+                             [- 6.27315221, -0.00042455, 0.00026010, 7.27272766, 0.99870311, 0.99931535, 0.49323100],
+                             [- 6.27315235, -0.00042449, 0.00026006, 7.27272786, 0.99870328, 0.99931545, 0.49323105],
+                             [- 6.27315249, -0.00042443, 0.00026002, 7.27272806, 0.99870346, 0.99931554, 0.49323112],
+                             [- 6.27315263, -0.00042437, 0.00025999, 7.27272826, 0.99870364, 0.99931564, 0.49323100],
+                             [- 6.27315277, -0.00042432, 0.00025995, 7.27272845, 0.99870382, 0.99931573, 0.49323104],
+                             [- 6.27315291, -0.00042426, 0.00025992, 7.27272865, 0.99870399, 0.99931582, 0.49323113],
+                             [- 6.27315305, -0.00042420, 0.00025988, 7.27272885, 0.99870417, 0.99931592, 0.49323100],
+                             [- 6.27315319, -0.00042414, 0.00025985, 7.27272905, 0.99870435, 0.99931601, 0.49323118],
+                             [- 6.27315333, -0.00042408, 0.00025981, 7.27272924, 0.99870453, 0.99931611, 0.49323122],
+                             [- 6.27315347, -0.00042403, 0.00025978, 7.27272944, 0.99870470, 0.99931620, 0.49323123],
+                             [- 6.27315360, -0.00042397, 0.00025974, 7.27272964, 0.99870488, 0.99931629, 0.49323124],
+                             [- 6.27315374, -0.00042391, 0.00025970, 7.27272983, 0.99870506, 0.99931639, 0.49323127],
+                             [- 6.27315388, -0.00042385, 0.00025967, 7.27273003, 0.99870524, 0.99931648, 0.49323133],
+                             [- 6.27315402, -0.00042379, 0.00025963, 7.27273023, 0.99870541, 0.99931657, 0.49323140],
+                             [- 6.27315416, -0.00042374, 0.00025960, 7.27273042, 0.99870559, 0.99931667, 0.49323133],
+                             [- 6.27315430, -0.00042368, 0.00025956, 7.27273062, 0.99870577, 0.99931676, 0.49323138],
+                             [- 6.27315444, -0.00042362, 0.00025953, 7.27273082, 0.99870595, 0.99931685, 0.49323140],
+                             [- 6.27315458, -0.00042356, 0.00025949, 7.27273101, 0.99870612, 0.99931695, 0.49323145],
+                             [- 6.27315472, -0.00042350, 0.00025946, 7.27273121, 0.99870630, 0.99931704, 0.49323139],
+                             [- 6.27315485, -0.00042345, 0.00025942, 7.27273141, 0.99870648, 0.99931713, 0.49323136],
+                             [- 6.27315499, -0.00042339, 0.00025938, 7.27273160, 0.99870665, 0.99931723, 0.49323144],
+                             [- 6.27315513, -0.00042333, 0.00025935, 7.27273180, 0.99870683, 0.99931732, 0.49323141],
+                             [- 6.27315527, -0.00042327, 0.00025931, 7.27273200, 0.99870701, 0.99931741, 0.49323140],
+                             [- 6.27315541, -0.00042321, 0.00025928, 7.27273219, 0.99870719, 0.99931751, 0.49323155],
+                             [- 6.27315555, -0.00042316, 0.00025924, 7.27273239, 0.99870736, 0.99931760, 0.49323157],
+                             [- 6.27315569, -0.00042310, 0.00025921, 7.27273259, 0.99870754, 0.99931769, 0.49323161],
+                             [- 6.27315582, -0.00042304, 0.00025917, 7.27273278, 0.99870772, 0.99931779, 0.49323157],
+                             [- 6.27315596, -0.00042298, 0.00025914, 7.27273298, 0.99870789, 0.99931788, 0.49323162],
+                             [- 6.27315610, -0.00042292, 0.00025910, 7.27273318, 0.99870807, 0.99931797, 0.49323164],
+                             [- 6.27315624, -0.00042287, 0.00025907, 7.27273337, 0.99870825, 0.99931807, 0.49323172],
+                             [- 6.27315638, -0.00042281, 0.00025903, 7.27273357, 0.99870842, 0.99931816, 0.49323163],
+                             [- 6.27315652, -0.00042275, 0.00025899, 7.27273376, 0.99870860, 0.99931825, 0.49323158],
+                             [- 6.27315665, -0.00042269, 0.00025896, 7.27273396, 0.99870877, 0.99931835, 0.49323168],
+                             [- 6.27315679, -0.00042264, 0.00025892, 7.27273416, 0.99870895, 0.99931844, 0.49323175],
+                             [- 6.27315693, -0.00042258, 0.00025889, 7.27273435, 0.99870913, 0.99931853, 0.49323172],
+                             [- 6.27315707, -0.00042252, 0.00025885, 7.27273455, 0.99870930, 0.99931863, 0.49323175],
+                             [- 6.27315721, -0.00042246, 0.00025882, 7.27273474, 0.99870948, 0.99931872, 0.49323179],
+                             [- 6.27315734, -0.00042241, 0.00025878, 7.27273494, 0.99870966, 0.99931881, 0.49323178],
+                             [- 6.27315748, -0.00042235, 0.00025875, 7.27273513, 0.99870983, 0.99931891, 0.49323183],
+                             [- 6.27315762, -0.00042229, 0.00025871, 7.27273533, 0.99871001, 0.99931900, 0.49323180],
+                             [- 6.27315776, -0.00042223, 0.00025868, 7.27273552, 0.99871018, 0.99931909, 0.49323181],
+                             [- 6.27315790, -0.00042218, 0.00025864, 7.27273572, 0.99871036, 0.99931918, 0.49323188],
+                             [- 6.27315803, -0.00042212, 0.00025861, 7.27273592, 0.99871054, 0.99931928, 0.49323197],
+                             [- 6.27315817, -0.00042206, 0.00025857, 7.27273611, 0.99871071, 0.99931937, 0.49323190],
+                             [- 6.27315831, -0.00042200, 0.00025854, 7.27273631, 0.99871089, 0.99931946, 0.49323185],
+                             [- 6.27315845, -0.00042194, 0.00025850, 7.27273650, 0.99871106, 0.99931956, 0.49323199],
+                             [- 6.27315858, -0.00042189, 0.00025846, 7.27273670, 0.99871124, 0.99931965, 0.49323204],
+                             [- 6.27315872, -0.00042183, 0.00025843, 7.27273689, 0.99871141, 0.99931974, 0.49323191],
+                             [- 6.27315886, -0.00042177, 0.00025839, 7.27273709, 0.99871159, 0.99931983, 0.49323202],
+                             [- 6.27315900, -0.00042171, 0.00025836, 7.27273728, 0.99871177, 0.99931993, 0.49323199],
+                             [- 6.27315913, -0.00042166, 0.00025832, 7.27273748, 0.99871194, 0.99932002, 0.49323200],
+                             [- 6.27315927, -0.00042160, 0.00025829, 7.27273767, 0.99871212, 0.99932011, 0.49323212],
+                             [- 6.27315941, -0.00042154, 0.00025825, 7.27273787, 0.99871229, 0.99932020, 0.49323215],
+                             [- 6.27315955, -0.00042149, 0.00025822, 7.27273806, 0.99871247, 0.99932030, 0.49323211],
+                             [- 6.27315968, -0.00042143, 0.00025818, 7.27273826, 0.99871264, 0.99932039, 0.49323217],
+                             [- 6.27315982, -0.00042137, 0.00025815, 7.27273845, 0.99871282, 0.99932048, 0.49323219],
+                             [- 6.27315996, -0.00042131, 0.00025811, 7.27273864, 0.99871299, 0.99932057, 0.49323223],
+                             [- 6.27316010, -0.00042126, 0.00025808, 7.27273884, 0.99871317, 0.99932067, 0.49323224],
+                             [- 6.27316023, -0.00042120, 0.00025804, 7.27273903, 0.99871334, 0.99932076, 0.49323221],
+                             [- 6.27316037, -0.00042114, 0.00025801, 7.27273923, 0.99871352, 0.99932085, 0.49323224],
+                             [- 6.27316051, -0.00042108, 0.00025797, 7.27273942, 0.99871369, 0.99932094, 0.49323220],
+                             [- 6.27316064, -0.00042103, 0.00025794, 7.27273962, 0.99871387, 0.99932104, 0.49323229],
+                             [- 6.27316078, -0.00042097, 0.00025790, 7.27273981, 0.99871404, 0.99932113, 0.49323228],
+                             [- 6.27316092, -0.00042091, 0.00025787, 7.27274001, 0.99871422, 0.99932122, 0.49323228],
+                             [- 6.27316105, -0.00042085, 0.00025783, 7.27274020, 0.99871439, 0.99932131, 0.49323234],
+                             [- 6.27316119, -0.00042080, 0.00025780, 7.27274039, 0.99871457, 0.99932141, 0.49323243],
+                             [- 6.27316133, -0.00042074, 0.00025776, 7.27274059, 0.99871474, 0.99932150, 0.49323241],
+                             [- 6.27316147, -0.00042068, 0.00025773, 7.27274078, 0.99871492, 0.99932159, 0.49323242],
+                             [- 6.27316160, -0.00042063, 0.00025769, 7.27274098, 0.99871509, 0.99932168, 0.49323234],
+                             [- 6.27316174, -0.00042057, 0.00025766, 7.27274117, 0.99871527, 0.99932177, 0.49323243],
+                             [- 6.27316188, -0.00042051, 0.00025762, 7.27274136, 0.99871544, 0.99932187, 0.49323249],
+                             [- 6.27316201, -0.00042045, 0.00025759, 7.27274156, 0.99871562, 0.99932196, 0.49323249],
+                             [- 6.27316215, -0.00042040, 0.00025755, 7.27274175, 0.99871579, 0.99932205, 0.49323255],
+                             [- 6.27316229, -0.00042034, 0.00025752, 7.27274195, 0.99871597, 0.99932214, 0.49323261],
+                             [- 6.27316242, -0.00042028, 0.00025748, 7.27274214, 0.99871614, 0.99932223, 0.49323266],
+                             [- 6.27316256, -0.00042023, 0.00025745, 7.27274233, 0.99871631, 0.99932233, 0.49323261],
+                             [- 6.27316270, -0.00042017, 0.00025741, 7.27274253, 0.99871649, 0.99932242, 0.49323265],
+                             [- 6.27316283, -0.00042011, 0.00025738, 7.27274272, 0.99871666, 0.99932251, 0.49323261],
+                             [- 6.27316297, -0.00042006, 0.00025734, 7.27274291, 0.99871684, 0.99932260, 0.49323268],
+                             [- 6.27316311, -0.00042000, 0.00025731, 7.27274311, 0.99871701, 0.99932269, 0.49323261],
+                             [- 6.27316324, -0.00041994, 0.00025727, 7.27274330, 0.99871719, 0.99932279, 0.49323277],
+                             [- 6.27316338, -0.00041988, 0.00025724, 7.27274349, 0.99871736, 0.99932288, 0.49323278],
+                             [- 6.27316351, -0.00041983, 0.00025720, 7.27274369, 0.99871753, 0.99932297, 0.49323270],
+                             [- 6.27316365, -0.00041977, 0.00025717, 7.27274388, 0.99871771, 0.99932306, 0.49323262],
+                             [- 6.27316379, -0.00041971, 0.00025713, 7.27274407, 0.99871788, 0.99932315, 0.49323267],
+                             [- 6.27316392, -0.00041966, 0.00025710, 7.27274427, 0.99871806, 0.99932325, 0.49323282],
+                             [- 6.27316406, -0.00041960, 0.00025706, 7.27274446, 0.99871823, 0.99932334, 0.49323274],
+                             [- 6.27316420, -0.00041954, 0.00025703, 7.27274465, 0.99871840, 0.99932343, 0.49323276],
+                             [- 6.27316433, -0.00041949, 0.00025699, 7.27274485, 0.99871858, 0.99932352, 0.49323279],
+                             [- 6.27316447, -0.00041943, 0.00025696, 7.27274504, 0.99871875, 0.99932361, 0.49323285],
+                             [- 6.27316460, -0.00041937, 0.00025692, 7.27274523, 0.99871892, 0.99932370, 0.49323286],
+                             [- 6.27316474, -0.00041932, 0.00025689, 7.27274542, 0.99871910, 0.99932380, 0.49323296],
+                             [- 6.27316488, -0.00041926, 0.00025685, 7.27274562, 0.99871927, 0.99932389, 0.49323294],
+                             [- 6.27316501, -0.00041920, 0.00025682, 7.27274581, 0.99871944, 0.99932398, 0.49323292],
+                             [- 6.27316515, -0.00041915, 0.00025678, 7.27274600, 0.99871962, 0.99932407, 0.49323285],
+                             [- 6.27316528, -0.00041909, 0.00025675, 7.27274619, 0.99871979, 0.99932416, 0.49323292],
+                             [- 6.27316542, -0.00041903, 0.00025671, 7.27274639, 0.99871996, 0.99932425, 0.49323303],
+                             [- 6.27316555, -0.00041898, 0.00025668, 7.27274658, 0.99872014, 0.99932435, 0.49323312],
+                             [- 6.27316569, -0.00041892, 0.00025664, 7.27274677, 0.99872031, 0.99932444, 0.49323326],
+                             [- 6.27316583, -0.00041886, 0.00025661, 7.27274696, 0.99872048, 0.99932453, 0.49323308],
+                             [- 6.27316596, -0.00041881, 0.00025658, 7.27274716, 0.99872066, 0.99932462, 0.49323307],
+                             [- 6.27316610, -0.00041875, 0.00025654, 7.27274735, 0.99872083, 0.99932471, 0.49323314],
+                             [- 6.27316623, -0.00041869, 0.00025651, 7.27274754, 0.99872100, 0.99932480, 0.49323312],
+                             [- 6.27316637, -0.00041864, 0.00025647, 7.27274773, 0.99872118, 0.99932489, 0.49323320],
+                             [- 6.27316650, -0.00041858, 0.00025644, 7.27274793, 0.99872135, 0.99932498, 0.49323311],
+                             [- 6.27316664, -0.00041852, 0.00025640, 7.27274812, 0.99872152, 0.99932508, 0.49323311],
+                             [- 6.27316677, -0.00041847, 0.00025637, 7.27274831, 0.99872170, 0.99932517, 0.49323317],
+                             [- 6.27316691, -0.00041841, 0.00025633, 7.27274850, 0.99872187, 0.99932526, 0.49323323],
+                             [- 6.27316705, -0.00041835, 0.00025630, 7.27274869, 0.99872204, 0.99932535, 0.49323325],
+                             [- 6.27316718, -0.00041830, 0.00025626, 7.27274888, 0.99872221, 0.99932544, 0.49323334],
+                             [- 6.27316732, -0.00041824, 0.00025623, 7.27274908, 0.99872239, 0.99932553, 0.49323332],
+                             [- 6.27316745, -0.00041818, 0.00025619, 7.27274927, 0.99872256, 0.99932562, 0.49323331],
+                             [- 6.27316759, -0.00041813, 0.00025616, 7.27274946, 0.99872273, 0.99932571, 0.49323331],
+                             [- 6.27316772, -0.00041807, 0.00025612, 7.27274965, 0.99872290, 0.99932581, 0.49323346],
+                             [- 6.27316786, -0.00041801, 0.00025609, 7.27274984, 0.99872308, 0.99932590, 0.49323331],
+                             [- 6.27316799, -0.00041796, 0.00025606, 7.27275003, 0.99872325, 0.99932599, 0.49323339],
+                             [- 6.27316813, -0.00041790, 0.00025602, 7.27275023, 0.99872342, 0.99932608, 0.49323343],
+                             [- 6.27316826, -0.00041784, 0.00025599, 7.27275042, 0.99872359, 0.99932617, 0.49323337],
+                             [- 6.27316840, -0.00041779, 0.00025595, 7.27275061, 0.99872377, 0.99932626, 0.49323342],
+                             [- 6.27316853, -0.00041773, 0.00025592, 7.27275080, 0.99872394, 0.99932635, 0.49323347],
+                             [- 6.27316867, -0.00041768, 0.00025588, 7.27275099, 0.99872411, 0.99932644, 0.49323353],
+                             [- 6.27316880, -0.00041762, 0.00025585, 7.27275118, 0.99872428, 0.99932653, 0.49323349],
+                             [- 6.27316894, -0.00041756, 0.00025581, 7.27275137, 0.99872446, 0.99932662, 0.49323358],
+                             [- 6.27316907, -0.00041751, 0.00025578, 7.27275157, 0.99872463, 0.99932671, 0.49323354],
+                             [- 6.27316921, -0.00041745, 0.00025574, 7.27275176, 0.99872480, 0.99932681, 0.49323350],
+                             [- 6.27316934, -0.00041739, 0.00025571, 7.27275195, 0.99872497, 0.99932690, 0.49323356],
+                             [- 6.27316948, -0.00041734, 0.00025568, 7.27275214, 0.99872514, 0.99932699, 0.49323355],
+                             [- 6.27316961, -0.00041728, 0.00025564, 7.27275233, 0.99872532, 0.99932708, 0.49323359],
+                             [- 6.27316974, -0.00041722, 0.00025561, 7.27275252, 0.99872549, 0.99932717, 0.49323360],
+                             [- 6.27316988, -0.00041717, 0.00025557, 7.27275271, 0.99872566, 0.99932726, 0.49323362],
+                             [- 6.27317001, -0.00041711, 0.00025554, 7.27275290, 0.99872583, 0.99932735, 0.49323369],
+                             [- 6.27317015, -0.00041706, 0.00025550, 7.27275309, 0.99872600, 0.99932744, 0.49323369],
+                             [- 6.27317028, -0.00041700, 0.00025547, 7.27275328, 0.99872617, 0.99932753, 0.49323368],
+                             [- 6.27317042, -0.00041694, 0.00025543, 7.27275347, 0.99872635, 0.99932762, 0.49323375],
+                             [- 6.27317055, -0.00041689, 0.00025540, 7.27275366, 0.99872652, 0.99932771, 0.49323378],
+                             [- 6.27317069, -0.00041683, 0.00025537, 7.27275385, 0.99872669, 0.99932780, 0.49323373],
+                             [- 6.27317082, -0.00041678, 0.00025533, 7.27275405, 0.99872686, 0.99932789, 0.49323370],
+                             [- 6.27317095, -0.00041672, 0.00025530, 7.27275424, 0.99872703, 0.99932798, 0.49323379],
+                             [- 6.27317109, -0.00041666, 0.00025526, 7.27275443, 0.99872720, 0.99932807, 0.49323375],
+                             [- 6.27317122, -0.00041661, 0.00025523, 7.27275462, 0.99872738, 0.99932816, 0.49323392],
+                             [- 6.27317136, -0.00041655, 0.00025519, 7.27275481, 0.99872755, 0.99932826, 0.49323391],
+                             [- 6.27317149, -0.00041649, 0.00025516, 7.27275500, 0.99872772, 0.99932835, 0.49323391],
+                             [- 6.27317163, -0.00041644, 0.00025512, 7.27275519, 0.99872789, 0.99932844, 0.49323388],
+                             [- 6.27317176, -0.00041638, 0.00025509, 7.27275538, 0.99872806, 0.99932853, 0.49323395],
+                             [- 6.27317189, -0.00041633, 0.00025506, 7.27275557, 0.99872823, 0.99932862, 0.49323385],
+                             [- 6.27317203, -0.00041627, 0.00025502, 7.27275576, 0.99872840, 0.99932871, 0.49323392],
+                             [- 6.27317216, -0.00041621, 0.00025499, 7.27275595, 0.99872857, 0.99932880, 0.49323402],
+                             [- 6.27317230, -0.00041616, 0.00025495, 7.27275614, 0.99872874, 0.99932889, 0.49323405],
+                             [- 6.27317243, -0.00041610, 0.00025492, 7.27275633, 0.99872892, 0.99932898, 0.49323405],
+                             [- 6.27317256, -0.00041605, 0.00025488, 7.27275652, 0.99872909, 0.99932907, 0.49323408],
+                             [- 6.27317270, -0.00041599, 0.00025485, 7.27275671, 0.99872926, 0.99932916, 0.49323410],
+                             [- 6.27317283, -0.00041594, 0.00025482, 7.27275690, 0.99872943, 0.99932925, 0.49323410],
+                             [- 6.27317297, -0.00041588, 0.00025478, 7.27275709, 0.99872960, 0.99932934, 0.49323416],
+                             [- 6.27317310, -0.00041582, 0.00025475, 7.27275728, 0.99872977, 0.99932943, 0.49323413],
+                             [- 6.27317323, -0.00041577, 0.00025471, 7.27275746, 0.99872994, 0.99932952, 0.49323409],
+                             [- 6.27317337, -0.00041571, 0.00025468, 7.27275765, 0.99873011, 0.99932961, 0.49323425],
+                             [- 6.27317350, -0.00041566, 0.00025465, 7.27275784, 0.99873028, 0.99932970, 0.49323426],
+                             [- 6.27317363, -0.00041560, 0.00025461, 7.27275803, 0.99873045, 0.99932979, 0.49323421],
+                             [- 6.27317377, -0.00041554, 0.00025458, 7.27275822, 0.99873062, 0.99932988, 0.49323430],
+                             [- 6.27317390, -0.00041549, 0.00025454, 7.27275841, 0.99873079, 0.99932997, 0.49323422],
+                             [- 6.27317403, -0.00041543, 0.00025451, 7.27275860, 0.99873096, 0.99933006, 0.49323429],
+                             [- 6.27317417, -0.00041538, 0.00025447, 7.27275879, 0.99873113, 0.99933015, 0.49323420],
+                             [- 6.27317430, -0.00041532, 0.00025444, 7.27275898, 0.99873130, 0.99933024, 0.49323427],
+                             [- 6.27317443, -0.00041527, 0.00025441, 7.27275917, 0.99873147, 0.99933033, 0.49323431],
+                             [- 6.27317457, -0.00041521, 0.00025437, 7.27275936, 0.99873164, 0.99933042, 0.49323443],
+                             [- 6.27317470, -0.00041515, 0.00025434, 7.27275955, 0.99873181, 0.99933051, 0.49323428],
+                             [- 6.27317483, -0.00041510, 0.00025430, 7.27275974, 0.99873198, 0.99933060, 0.49323443],
+                             [- 6.27317497, -0.00041504, 0.00025427, 7.27275992, 0.99873215, 0.99933069, 0.49323437],
+                             [- 6.27317510, -0.00041499, 0.00025424, 7.27276011, 0.99873232, 0.99933078, 0.49323454],
+                             [- 6.27317523, -0.00041493, 0.00025420, 7.27276030, 0.99873249, 0.99933087, 0.49323446],
+                             [- 6.27317537, -0.00041488, 0.00025417, 7.27276049, 0.99873266, 0.99933096, 0.49323436],
+                             [- 6.27317550, -0.00041482, 0.00025413, 7.27276068, 0.99873283, 0.99933105, 0.49323455],
+                             [- 6.27317563, -0.00041476, 0.00025410, 7.27276087, 0.99873300, 0.99933114, 0.49323443],
+                             [- 6.27317577, -0.00041471, 0.00025406, 7.27276106, 0.99873317, 0.99933123, 0.49323444],
+                             [- 6.27317590, -0.00041465, 0.00025403, 7.27276124, 0.99873334, 0.99933132, 0.49323452],
+                             [- 6.27317603, -0.00041460, 0.00025400, 7.27276143, 0.99873351, 0.99933140, 0.49323465],
+                             [- 6.27317616, -0.00041454, 0.00025396, 7.27276162, 0.99873368, 0.99933149, 0.49323452],
+                             [- 6.27317630, -0.00041449, 0.00025393, 7.27276181, 0.99873385, 0.99933158, 0.49323459],
+                             [- 6.27317643, -0.00041443, 0.00025389, 7.27276200, 0.99873402, 0.99933167, 0.49323462],
+                             [- 6.27317656, -0.00041438, 0.00025386, 7.27276219, 0.99873419, 0.99933176, 0.49323457],
+                             [- 6.27317670, -0.00041432, 0.00025383, 7.27276237, 0.99873436, 0.99933185, 0.49323468],
+                             [- 6.27317683, -0.00041427, 0.00025379, 7.27276256, 0.99873453, 0.99933194, 0.49323479],
+                             [- 6.27317696, -0.00041421, 0.00025376, 7.27276275, 0.99873470, 0.99933203, 0.49323481],
+                             [- 6.27317709, -0.00041415, 0.00025372, 7.27276294, 0.99873487, 0.99933212, 0.49323465],
+                             [- 6.27317723, -0.00041410, 0.00025369, 7.27276313, 0.99873504, 0.99933221, 0.49323467],
+                             [- 6.27317736, -0.00041404, 0.00025366, 7.27276332, 0.99873521, 0.99933230, 0.49323474],
+                             [- 6.27317749, -0.00041399, 0.00025362, 7.27276350, 0.99873538, 0.99933239, 0.49323475],
+                             [- 6.27317762, -0.00041393, 0.00025359, 7.27276369, 0.99873555, 0.99933248, 0.49323489],
+                             [- 6.27317776, -0.00041388, 0.00025355, 7.27276388, 0.99873572, 0.99933257, 0.49323478],
+                             [- 6.27317789, -0.00041382, 0.00025352, 7.27276407, 0.99873588, 0.99933266, 0.49323490],
+                             [- 6.27317802, -0.00041377, 0.00025349, 7.27276425, 0.99873605, 0.99933275, 0.49323500],
+                             [- 6.27317815, -0.00041371, 0.00025345, 7.27276444, 0.99873622, 0.99933283, 0.49323486],
+                             [- 6.27317829, -0.00041366, 0.00025342, 7.27276463, 0.99873639, 0.99933292, 0.49323491],
+                             [- 6.27317842, -0.00041360, 0.00025339, 7.27276482, 0.99873656, 0.99933301, 0.49323473],
+                             [- 6.27317855, -0.00041355, 0.00025335, 7.27276500, 0.99873673, 0.99933310, 0.49323495],
+                             [- 6.27317868, -0.00041349, 0.00025332, 7.27276519, 0.99873690, 0.99933319, 0.49323495],
+                             [- 6.27317882, -0.00041344, 0.00025328, 7.27276538, 0.99873707, 0.99933328, 0.49323487],
+                             [- 6.27317895, -0.00041338, 0.00025325, 7.27276557, 0.99873724, 0.99933337, 0.49323500],
+                             [- 6.27317908, -0.00041333, 0.00025322, 7.27276575, 0.99873740, 0.99933346, 0.49323493],
+                             [- 6.27317921, -0.00041327, 0.00025318, 7.27276594, 0.99873757, 0.99933355, 0.49323497],
+                             [- 6.27317934, -0.00041321, 0.00025315, 7.27276613, 0.99873774, 0.99933364, 0.49323507],
+                             [- 6.27317948, -0.00041316, 0.00025311, 7.27276632, 0.99873791, 0.99933373, 0.49323512],
+                             [- 6.27317961, -0.00041310, 0.00025308, 7.27276650, 0.99873808, 0.99933381, 0.49323500],
+                             [- 6.27317974, -0.00041305, 0.00025305, 7.27276669, 0.99873825, 0.99933390, 0.49323510],
+                             [- 6.27317987, -0.00041299, 0.00025301, 7.27276688, 0.99873842, 0.99933399, 0.49323520],
+                             [- 6.27318000, -0.00041294, 0.00025298, 7.27276706, 0.99873858, 0.99933408, 0.49323515],
+                             [- 6.27318014, -0.00041288, 0.00025295, 7.27276725, 0.99873875, 0.99933417, 0.49323523],
+                             [- 6.27318027, -0.00041283, 0.00025291, 7.27276744, 0.99873892, 0.99933426, 0.49323516],
+                             [- 6.27318040, -0.00041277, 0.00025288, 7.27276762, 0.99873909, 0.99933435, 0.49323517],
+                             [- 6.27318053, -0.00041272, 0.00025284, 7.27276781, 0.99873926, 0.99933444, 0.49323519],
+                             [- 6.27318066, -0.00041266, 0.00025281, 7.27276800, 0.99873942, 0.99933453, 0.49323515],
+                             [- 6.27318079, -0.00041261, 0.00025278, 7.27276818, 0.99873959, 0.99933461, 0.49323538],
+                             [- 6.27318093, -0.00041255, 0.00025274, 7.27276837, 0.99873976, 0.99933470, 0.49323529],
+                             [- 6.27318106, -0.00041250, 0.00025271, 7.27276856, 0.99873993, 0.99933479, 0.49323537],
+                             [- 6.27318119, -0.00041244, 0.00025268, 7.27276874, 0.99874010, 0.99933488, 0.49323534],
+                             [- 6.27318132, -0.00041239, 0.00025264, 7.27276893, 0.99874026, 0.99933497, 0.49323537],
+                             [- 6.27318145, -0.00041233, 0.00025261, 7.27276912, 0.99874043, 0.99933506, 0.49323540],
+                             [- 6.27318158, -0.00041228, 0.00025258, 7.27276930, 0.99874060, 0.99933515, 0.49323539],
+                             [- 6.27318171, -0.00041222, 0.00025254, 7.27276949, 0.99874077, 0.99933523, 0.49323536],
+                             [- 6.27318185, -0.00041217, 0.00025251, 7.27276968, 0.99874094, 0.99933532, 0.49323541],
+                             [- 6.27318198, -0.00041211, 0.00025247, 7.27276986, 0.99874110, 0.99933541, 0.49323529],
+                             [- 6.27318211, -0.00041206, 0.00025244, 7.27277005, 0.99874127, 0.99933550, 0.49323554],
+                             [- 6.27318224, -0.00041200, 0.00025241, 7.27277023, 0.99874144, 0.99933559, 0.49323556],
+                             [- 6.27318237, -0.00041195, 0.00025237, 7.27277042, 0.99874161, 0.99933568, 0.49323548],
+                             [- 6.27318250, -0.00041190, 0.00025234, 7.27277061, 0.99874177, 0.99933577, 0.49323555],
+                             [- 6.27318263, -0.00041184, 0.00025231, 7.27277079, 0.99874194, 0.99933585, 0.49323555],
+                             [- 6.27318276, -0.00041179, 0.00025227, 7.27277098, 0.99874211, 0.99933594, 0.49323566],
+                             [- 6.27318290, -0.00041173, 0.00025224, 7.27277117, 0.99874228, 0.99933603, 0.49323552],
+                             [- 6.27318303, -0.00041168, 0.00025221, 7.27277135, 0.99874244, 0.99933612, 0.49323561],
+                             [- 6.27318316, -0.00041162, 0.00025217, 7.27277154, 0.99874261, 0.99933621, 0.49323566],
+                             [- 6.27318329, -0.00041157, 0.00025214, 7.27277172, 0.99874278, 0.99933630, 0.49323555],
+                             [- 6.27318342, -0.00041151, 0.00025210, 7.27277191, 0.99874294, 0.99933638, 0.49323560],
+                             [- 6.27318355, -0.00041146, 0.00025207, 7.27277209, 0.99874311, 0.99933647, 0.49323570],
+                             [- 6.27318368, -0.00041140, 0.00025204, 7.27277228, 0.99874328, 0.99933656, 0.49323566],
+                             [- 6.27318381, -0.00041135, 0.00025200, 7.27277246, 0.99874345, 0.99933665, 0.49323580],
+                             [- 6.27318394, -0.00041129, 0.00025197, 7.27277265, 0.99874361, 0.99933674, 0.49323573],
+                             [- 6.27318407, -0.00041124, 0.00025194, 7.27277284, 0.99874378, 0.99933682, 0.49323588],
+                             [- 6.27318420, -0.00041118, 0.00025190, 7.27277302, 0.99874395, 0.99933691, 0.49323574],
+                             [- 6.27318434, -0.00041113, 0.00025187, 7.27277321, 0.99874411, 0.99933700, 0.49323584],
+                             [- 6.27318447, -0.00041107, 0.00025184, 7.27277339, 0.99874428, 0.99933709, 0.49323574],
+                             [- 6.27318460, -0.00041102, 0.00025180, 7.27277358, 0.99874445, 0.99933718, 0.49323586],
+                             [- 6.27318473, -0.00041097, 0.00025177, 7.27277376, 0.99874461, 0.99933726, 0.49323593],
+                             [- 6.27318486, -0.00041091, 0.00025174, 7.27277395, 0.99874478, 0.99933735, 0.49323592],
+                             [- 6.27318499, -0.00041086, 0.00025170, 7.27277413, 0.99874495, 0.99933744, 0.49323598],
+                             [- 6.27318512, -0.00041080, 0.00025167, 7.27277432, 0.99874511, 0.99933753, 0.49323589],
+                             [- 6.27318525, -0.00041075, 0.00025164, 7.27277450, 0.99874528, 0.99933762, 0.49323587],
+                             [- 6.27318538, -0.00041069, 0.00025160, 7.27277469, 0.99874545, 0.99933770, 0.49323605],
+                             [- 6.27318551, -0.00041064, 0.00025157, 7.27277487, 0.99874561, 0.99933779, 0.49323594],
+                             [- 6.27318564, -0.00041058, 0.00025154, 7.27277506, 0.99874578, 0.99933788, 0.49323599],
+                             [- 6.27318577, -0.00041053, 0.00025150, 7.27277524, 0.99874595, 0.99933797, 0.49323604],
+                             [- 6.27318590, -0.00041048, 0.00025147, 7.27277543, 0.99874611, 0.99933806, 0.49323602],
+                             [- 6.27318603, -0.00041042, 0.00025144, 7.27277561, 0.99874628, 0.99933814, 0.49323601],
+                             [- 6.27318616, -0.00041037, 0.00025140, 7.27277580, 0.99874645, 0.99933823, 0.49323601],
+                             [- 6.27318629, -0.00041031, 0.00025137, 7.27277598, 0.99874661, 0.99933832, 0.49323608],
+                             [- 6.27318642, -0.00041026, 0.00025134, 7.27277616, 0.99874678, 0.99933841, 0.49323616],
+                             [- 6.27318655, -0.00041020, 0.00025130, 7.27277635, 0.99874694, 0.99933849, 0.49323617],
+                             [- 6.27318668, -0.00041015, 0.00025127, 7.27277653, 0.99874711, 0.99933858, 0.49323615],
+                             [- 6.27318681, -0.00041009, 0.00025124, 7.27277672, 0.99874728, 0.99933867, 0.49323614],
+                             [- 6.27318694, -0.00041004, 0.00025120, 7.27277690, 0.99874744, 0.99933876, 0.49323615],
+                             [- 6.27318707, -0.00040999, 0.00025117, 7.27277709, 0.99874761, 0.99933884, 0.49323610],
+                             [- 6.27318720, -0.00040993, 0.00025114, 7.27277727, 0.99874777, 0.99933893, 0.49323628],
+                             [- 6.27318733, -0.00040988, 0.00025110, 7.27277746, 0.99874794, 0.99933902, 0.49323634],
+                             [- 6.27318746, -0.00040982, 0.00025107, 7.27277764, 0.99874811, 0.99933911, 0.49323627],
+                             [- 6.27318759, -0.00040977, 0.00025104, 7.27277782, 0.99874827, 0.99933919, 0.49323622],
+                             [- 6.27318772, -0.00040971, 0.00025100, 7.27277801, 0.99874844, 0.99933928, 0.49323631],
+                             [- 6.27318785, -0.00040966, 0.00025097, 7.27277819, 0.99874860, 0.99933937, 0.49323628],
+                             [- 6.27318798, -0.00040961, 0.00025094, 7.27277838, 0.99874877, 0.99933946, 0.49323627],
+                             [- 6.27318811, -0.00040955, 0.00025090, 7.27277856, 0.99874893, 0.99933954, 0.49323637],
+                             [- 6.27318824, -0.00040950, 0.00025087, 7.27277874, 0.99874910, 0.99933963, 0.49323632],
+                             [- 6.27318837, -0.00040944, 0.00025084, 7.27277893, 0.99874927, 0.99933972, 0.49323640],
+                             [- 6.27318850, -0.00040939, 0.00025080, 7.27277911, 0.99874943, 0.99933981, 0.49323651],
+                             [- 6.27318863, -0.00040934, 0.00025077, 7.27277929, 0.99874960, 0.99933989, 0.49323644],
+                             [- 6.27318876, -0.00040928, 0.00025074, 7.27277948, 0.99874976, 0.99933998, 0.49323637],
+                             [- 6.27318889, -0.00040923, 0.00025070, 7.27277966, 0.99874993, 0.99934007, 0.49323647],
+                             [- 6.27318902, -0.00040917, 0.00025067, 7.27277985, 0.99875009, 0.99934016, 0.49323644],
+                             [- 6.27318915, -0.00040912, 0.00025064, 7.27278003, 0.99875026, 0.99934024, 0.49323643],
+                             [- 6.27318928, -0.00040906, 0.00025060, 7.27278021, 0.99875042, 0.99934033, 0.49323648],
+                             [- 6.27318941, -0.00040901, 0.00025057, 7.27278040, 0.99875059, 0.99934042, 0.49323655],
+                             [- 6.27318954, -0.00040896, 0.00025054, 7.27278058, 0.99875075, 0.99934050, 0.49323657],
+                             [- 6.27318967, -0.00040890, 0.00025051, 7.27278076, 0.99875092, 0.99934059, 0.49323664],
+                             [- 6.27318979, -0.00040885, 0.00025047, 7.27278095, 0.99875108, 0.99934068, 0.49323657],
+                             [- 6.27318992, -0.00040879, 0.00025044, 7.27278113, 0.99875125, 0.99934077, 0.49323666],
+                             [- 6.27319005, -0.00040874, 0.00025041, 7.27278131, 0.99875141, 0.99934085, 0.49323663],
+                             [- 6.27319018, -0.00040869, 0.00025037, 7.27278150, 0.99875158, 0.99934094, 0.49323672],
+                             [- 6.27319031, -0.00040863, 0.00025034, 7.27278168, 0.99875174, 0.99934103, 0.49323665],
+                             [- 6.27319044, -0.00040858, 0.00025031, 7.27278186, 0.99875191, 0.99934111, 0.49323670],
+                             [- 6.27319057, -0.00040852, 0.00025027, 7.27278204, 0.99875207, 0.99934120, 0.49323671],
+                             [- 6.27319070, -0.00040847, 0.00025024, 7.27278223, 0.99875224, 0.99934129, 0.49323673],
+                             [- 6.27319083, -0.00040842, 0.00025021, 7.27278241, 0.99875240, 0.99934137, 0.49323684],
+                             [- 6.27319096, -0.00040836, 0.00025017, 7.27278259, 0.99875257, 0.99934146, 0.49323687],
+                             [- 6.27319109, -0.00040831, 0.00025014, 7.27278278, 0.99875273, 0.99934155, 0.49323685],
+                             [- 6.27319121, -0.00040826, 0.00025011, 7.27278296, 0.99875290, 0.99934164, 0.49323688],
+                             [- 6.27319134, -0.00040820, 0.00025008, 7.27278314, 0.99875306, 0.99934172, 0.49323675],
+                             [- 6.27319147, -0.00040815, 0.00025004, 7.27278332, 0.99875322, 0.99934181, 0.49323678],
+                             [- 6.27319160, -0.00040809, 0.00025001, 7.27278351, 0.99875339, 0.99934190, 0.49323687],
+                             [- 6.27319173, -0.00040804, 0.00024998, 7.27278369, 0.99875355, 0.99934198, 0.49323686],
+                             [- 6.27319186, -0.00040799, 0.00024994, 7.27278387, 0.99875372, 0.99934207, 0.49323698],
+                             [- 6.27319199, -0.00040793, 0.00024991, 7.27278405, 0.99875388, 0.99934216, 0.49323692],
+                             [- 6.27319212, -0.00040788, 0.00024988, 7.27278424, 0.99875405, 0.99934224, 0.49323708],
+                             [- 6.27319224, -0.00040783, 0.00024985, 7.27278442, 0.99875421, 0.99934233, 0.49323704],
+                             [- 6.27319237, -0.00040777, 0.00024981, 7.27278460, 0.99875437, 0.99934242, 0.49323700],
+                             [- 6.27319250, -0.00040772, 0.00024978, 7.27278478, 0.99875454, 0.99934250, 0.49323693],
+                             [- 6.27319263, -0.00040766, 0.00024975, 7.27278497, 0.99875470, 0.99934259, 0.49323702],
+                             [- 6.27319276, -0.00040761, 0.00024971, 7.27278515, 0.99875487, 0.99934268, 0.49323716],
+                             [- 6.27319289, -0.00040756, 0.00024968, 7.27278533, 0.99875503, 0.99934276, 0.49323703],
+                             [- 6.27319302, -0.00040750, 0.00024965, 7.27278551, 0.99875519, 0.99934285, 0.49323706],
+                             [- 6.27319314, -0.00040745, 0.00024961, 7.27278569, 0.99875536, 0.99934294, 0.49323706],
+                             [- 6.27319327, -0.00040740, 0.00024958, 7.27278588, 0.99875552, 0.99934302, 0.49323714],
+                             [- 6.27319340, -0.00040734, 0.00024955, 7.27278606, 0.99875569, 0.99934311, 0.49323706],
+                             [- 6.27319353, -0.00040729, 0.00024952, 7.27278624, 0.99875585, 0.99934320, 0.49323708],
+                             [- 6.27319366, -0.00040724, 0.00024948, 7.27278642, 0.99875601, 0.99934328, 0.49323729],
+                             [- 6.27319379, -0.00040718, 0.00024945, 7.27278660, 0.99875618, 0.99934337, 0.49323724],
+                             [- 6.27319391, -0.00040713, 0.00024942, 7.27278679, 0.99875634, 0.99934345, 0.49323721],
+                             [- 6.27319404, -0.00040707, 0.00024938, 7.27278697, 0.99875650, 0.99934354, 0.49323728],
+                             [- 6.27319417, -0.00040702, 0.00024935, 7.27278715, 0.99875667, 0.99934363, 0.49323732],
+                             [- 6.27319430, -0.00040697, 0.00024932, 7.27278733, 0.99875683, 0.99934371, 0.49323735],
+                             [- 6.27319443, -0.00040691, 0.00024929, 7.27278751, 0.99875700, 0.99934380, 0.49323736],
+                             [- 6.27319455, -0.00040686, 0.00024925, 7.27278769, 0.99875716, 0.99934389, 0.49323725],
+                             [- 6.27319468, -0.00040681, 0.00024922, 7.27278788, 0.99875732, 0.99934397, 0.49323738],
+                             [- 6.27319481, -0.00040675, 0.00024919, 7.27278806, 0.99875749, 0.99934406, 0.49323735],
+                             [- 6.27319494, -0.00040670, 0.00024916, 7.27278824, 0.99875765, 0.99934414, 0.49323731],
+                             [- 6.27319507, -0.00040665, 0.00024912, 7.27278842, 0.99875781, 0.99934423, 0.49323743],
+                             [- 6.27319519, -0.00040659, 0.00024909, 7.27278860, 0.99875798, 0.99934432, 0.49323750],
+                             [- 6.27319532, -0.00040654, 0.00024906, 7.27278878, 0.99875814, 0.99934440, 0.49323738],
+                             [- 6.27319545, -0.00040649, 0.00024902, 7.27278896, 0.99875830, 0.99934449, 0.49323751],
+                             [- 6.27319558, -0.00040643, 0.00024899, 7.27278914, 0.99875846, 0.99934457, 0.49323752],
+                             [- 6.27319571, -0.00040638, 0.00024896, 7.27278933, 0.99875863, 0.99934466, 0.49323741],
+                             [- 6.27319583, -0.00040633, 0.00024893, 7.27278951, 0.99875879, 0.99934475, 0.49323749],
+                             [- 6.27319596, -0.00040627, 0.00024889, 7.27278969, 0.99875895, 0.99934483, 0.49323755],
+                             [- 6.27319609, -0.00040622, 0.00024886, 7.27278987, 0.99875912, 0.99934492, 0.49323762],
+                             [- 6.27319622, -0.00040617, 0.00024883, 7.27279005, 0.99875928, 0.99934501, 0.49323759],
+                             [- 6.27319634, -0.00040611, 0.00024880, 7.27279023, 0.99875944, 0.99934509, 0.49323760],
+                             [- 6.27319647, -0.00040606, 0.00024876, 7.27279041, 0.99875960, 0.99934518, 0.49323757],
+                             [- 6.27319660, -0.00040601, 0.00024873, 7.27279059, 0.99875977, 0.99934526, 0.49323761],
+                             [- 6.27319673, -0.00040595, 0.00024870, 7.27279077, 0.99875993, 0.99934535, 0.49323762],
+                             [- 6.27319685, -0.00040590, 0.00024867, 7.27279095, 0.99876009, 0.99934543, 0.49323771],
+                             [- 6.27319698, -0.00040585, 0.00024863, 7.27279113, 0.99876026, 0.99934552, 0.49323775],
+                             [- 6.27319711, -0.00040579, 0.00024860, 7.27279131, 0.99876042, 0.99934561, 0.49323777],
+                             [- 6.27319724, -0.00040574, 0.00024857, 7.27279149, 0.99876058, 0.99934569, 0.49323761],
+                             [- 6.27319736, -0.00040569, 0.00024853, 7.27279168, 0.99876074, 0.99934578, 0.49323772],
+                             [- 6.27319749, -0.00040563, 0.00024850, 7.27279186, 0.99876091, 0.99934586, 0.49323767],
+                             [- 6.27319762, -0.00040558, 0.00024847, 7.27279204, 0.99876107, 0.99934595, 0.49323779],
+                             [- 6.27319774, -0.00040553, 0.00024844, 7.27279222, 0.99876123, 0.99934603, 0.49323782],
+                             [- 6.27319787, -0.00040547, 0.00024840, 7.27279240, 0.99876139, 0.99934612, 0.49323776],
+                             [- 6.27319800, -0.00040542, 0.00024837, 7.27279258, 0.99876156, 0.99934621, 0.49323782],
+                             [- 6.27319813, -0.00040537, 0.00024834, 7.27279276, 0.99876172, 0.99934629, 0.49323787],
+                             [- 6.27319825, -0.00040532, 0.00024831, 7.27279294, 0.99876188, 0.99934638, 0.49323783],
+                             [- 6.27319838, -0.00040526, 0.00024827, 7.27279312, 0.99876204, 0.99934646, 0.49323795],
+                             [- 6.27319851, -0.00040521, 0.00024824, 7.27279330, 0.99876220, 0.99934655, 0.49323788],
+                             [- 6.27319863, -0.00040516, 0.00024821, 7.27279348, 0.99876237, 0.99934663, 0.49323798],
+                             [- 6.27319876, -0.00040510, 0.00024818, 7.27279366, 0.99876253, 0.99934672, 0.49323799],
+                             [- 6.27319889, -0.00040505, 0.00024814, 7.27279384, 0.99876269, 0.99934681, 0.49323794],
+                             [- 6.27319901, -0.00040500, 0.00024811, 7.27279402, 0.99876285, 0.99934689, 0.49323812],
+                             [- 6.27319914, -0.00040494, 0.00024808, 7.27279420, 0.99876301, 0.99934698, 0.49323800],
+                             [- 6.27319927, -0.00040489, 0.00024805, 7.27279438, 0.99876318, 0.99934706, 0.49323799],
+                             [- 6.27319939, -0.00040484, 0.00024801, 7.27279456, 0.99876334, 0.99934715, 0.49323807],
+                             [- 6.27319952, -0.00040479, 0.00024798, 7.27279474, 0.99876350, 0.99934723, 0.49323804],
+                             [- 6.27319965, -0.00040473, 0.00024795, 7.27279492, 0.99876366, 0.99934732, 0.49323807],
+                             [- 6.27319977, -0.00040468, 0.00024792, 7.27279510, 0.99876382, 0.99934740, 0.49323796],
+                             [- 6.27319990, -0.00040463, 0.00024788, 7.27279527, 0.99876398, 0.99934749, 0.49323820],
+                             [- 6.27320003, -0.00040457, 0.00024785, 7.27279545, 0.99876415, 0.99934757, 0.49323815],
+                             [- 6.27320015, -0.00040452, 0.00024782, 7.27279563, 0.99876431, 0.99934766, 0.49323813],
+                             [- 6.27320028, -0.00040447, 0.00024779, 7.27279581, 0.99876447, 0.99934774, 0.49323819],
+                             [- 6.27320041, -0.00040442, 0.00024776, 7.27279599, 0.99876463, 0.99934783, 0.49323817],
+                             [- 6.27320053, -0.00040436, 0.00024772, 7.27279617, 0.99876479, 0.99934791, 0.49323809],
+                             [- 6.27320066, -0.00040431, 0.00024769, 7.27279635, 0.99876495, 0.99934800, 0.49323823],
+                             [- 6.27320079, -0.00040426, 0.00024766, 7.27279653, 0.99876511, 0.99934809, 0.49323818],
+                             [- 6.27320091, -0.00040420, 0.00024763, 7.27279671, 0.99876528, 0.99934817, 0.49323822],
+                             [- 6.27320104, -0.00040415, 0.00024759, 7.27279689, 0.99876544, 0.99934826, 0.49323828],
+                             [- 6.27320117, -0.00040410, 0.00024756, 7.27279707, 0.99876560, 0.99934834, 0.49323852],
+                             [- 6.27320129, -0.00040405, 0.00024753, 7.27279725, 0.99876576, 0.99934843, 0.49323826],
+                             [- 6.27320142, -0.00040399, 0.00024750, 7.27279743, 0.99876592, 0.99934851, 0.49323833],
+                             [- 6.27320154, -0.00040394, 0.00024746, 7.27279760, 0.99876608, 0.99934860, 0.49323832],
+                             [- 6.27320167, -0.00040389, 0.00024743, 7.27279778, 0.99876624, 0.99934868, 0.49323839],
+                             [- 6.27320180, -0.00040383, 0.00024740, 7.27279796, 0.99876640, 0.99934877, 0.49323831],
+                             [- 6.27320192, -0.00040378, 0.00024737, 7.27279814, 0.99876656, 0.99934885, 0.49323847],
+                             [- 6.27320205, -0.00040373, 0.00024733, 7.27279832, 0.99876673, 0.99934894, 0.49323846],
+                             [- 6.27320217, -0.00040368, 0.00024730, 7.27279850, 0.99876689, 0.99934902, 0.49323853],
+                             [- 6.27320230, -0.00040362, 0.00024727, 7.27279868, 0.99876705, 0.99934911, 0.49323849],
+                             [- 6.27320243, -0.00040357, 0.00024724, 7.27279886, 0.99876721, 0.99934919, 0.49323847],
+                             [- 6.27320255, -0.00040352, 0.00024721, 7.27279903, 0.99876737, 0.99934928, 0.49323843],
+                             [- 6.27320268, -0.00040347, 0.00024717, 7.27279921, 0.99876753, 0.99934936, 0.49323854],
+                             [- 6.27320280, -0.00040341, 0.00024714, 7.27279939, 0.99876769, 0.99934944, 0.49323862],
+                             [- 6.27320293, -0.00040336, 0.00024711, 7.27279957, 0.99876785, 0.99934953, 0.49323861],
+                             [- 6.27320306, -0.00040331, 0.00024708, 7.27279975, 0.99876801, 0.99934961, 0.49323862],
+                             [- 6.27320318, -0.00040326, 0.00024704, 7.27279993, 0.99876817, 0.99934970, 0.49323859],
+                             [- 6.27320331, -0.00040320, 0.00024701, 7.27280010, 0.99876833, 0.99934978, 0.49323864],
+                             [- 6.27320343, -0.00040315, 0.00024698, 7.27280028, 0.99876849, 0.99934987, 0.49323872],
+                             [- 6.27320356, -0.00040310, 0.00024695, 7.27280046, 0.99876865, 0.99934995, 0.49323853],
+                             [- 6.27320368, -0.00040305, 0.00024692, 7.27280064, 0.99876881, 0.99935004, 0.49323874],
+                             [- 6.27320381, -0.00040299, 0.00024688, 7.27280082, 0.99876897, 0.99935012, 0.49323866],
+                             [- 6.27320394, -0.00040294, 0.00024685, 7.27280099, 0.99876913, 0.99935021, 0.49323878],
+                             [- 6.27320406, -0.00040289, 0.00024682, 7.27280117, 0.99876929, 0.99935029, 0.49323872],
+                             [- 6.27320419, -0.00040284, 0.00024679, 7.27280135, 0.99876945, 0.99935038, 0.49323872],
+                             [- 6.27320431, -0.00040278, 0.00024676, 7.27280153, 0.99876961, 0.99935046, 0.49323876],
+                             [- 6.27320444, -0.00040273, 0.00024672, 7.27280171, 0.99876978, 0.99935055, 0.49323884],
+                             [- 6.27320456, -0.00040268, 0.00024669, 7.27280188, 0.99876994, 0.99935063, 0.49323875],
+                             [- 6.27320469, -0.00040263, 0.00024666, 7.27280206, 0.99877010, 0.99935071, 0.49323881],
+                             [- 6.27320481, -0.00040257, 0.00024663, 7.27280224, 0.99877026, 0.99935080, 0.49323883],
+                             [- 6.27320494, -0.00040252, 0.00024659, 7.27280242, 0.99877042, 0.99935088, 0.49323893],
+                             [- 6.27320506, -0.00040247, 0.00024656, 7.27280259, 0.99877058, 0.99935097, 0.49323897],
+                             [- 6.27320519, -0.00040242, 0.00024653, 7.27280277, 0.99877073, 0.99935105, 0.49323888],
+                             [- 6.27320532, -0.00040237, 0.00024650, 7.27280295, 0.99877089, 0.99935114, 0.49323894],
+                             [- 6.27320544, -0.00040231, 0.00024647, 7.27280313, 0.99877105, 0.99935122, 0.49323891],
+                             [- 6.27320557, -0.00040226, 0.00024643, 7.27280330, 0.99877121, 0.99935130, 0.49323883],
+                             [- 6.27320569, -0.00040221, 0.00024640, 7.27280348, 0.99877137, 0.99935139, 0.49323900],
+                             [- 6.27320582, -0.00040216, 0.00024637, 7.27280366, 0.99877153, 0.99935147, 0.49323894],
+                             [- 6.27320594, -0.00040210, 0.00024634, 7.27280384, 0.99877169, 0.99935156, 0.49323913],
+                             [- 6.27320607, -0.00040205, 0.00024631, 7.27280401, 0.99877185, 0.99935164, 0.49323892],
+                             [- 6.27320619, -0.00040200, 0.00024627, 7.27280419, 0.99877201, 0.99935173, 0.49323905],
+                             [- 6.27320632, -0.00040195, 0.00024624, 7.27280437, 0.99877217, 0.99935181, 0.49323908],
+                             [- 6.27320644, -0.00040190, 0.00024621, 7.27280455, 0.99877233, 0.99935189, 0.49323912],
+                             [- 6.27320657, -0.00040184, 0.00024618, 7.27280472, 0.99877249, 0.99935198, 0.49323907],
+                             [- 6.27320669, -0.00040179, 0.00024615, 7.27280490, 0.99877265, 0.99935206, 0.49323901],
+                             [- 6.27320682, -0.00040174, 0.00024611, 7.27280508, 0.99877281, 0.99935215, 0.49323923],
+                             [- 6.27320694, -0.00040169, 0.00024608, 7.27280525, 0.99877297, 0.99935223, 0.49323914],
+                             [- 6.27320706, -0.00040163, 0.00024605, 7.27280543, 0.99877313, 0.99935231, 0.49323921],
+                             [- 6.27320719, -0.00040158, 0.00024602, 7.27280561, 0.99877329, 0.99935240, 0.49323926],
+                             [- 6.27320731, -0.00040153, 0.00024599, 7.27280578, 0.99877345, 0.99935248, 0.49323926],
+                             [- 6.27320744, -0.00040148, 0.00024595, 7.27280596, 0.99877361, 0.99935257, 0.49323918],
+                             [- 6.27320756, -0.00040143, 0.00024592, 7.27280614, 0.99877376, 0.99935265, 0.49323936],
+                             [- 6.27320769, -0.00040137, 0.00024589, 7.27280631, 0.99877392, 0.99935273, 0.49323929],
+                             [- 6.27320781, -0.00040132, 0.00024586, 7.27280649, 0.99877408, 0.99935282, 0.49323934],
+                             [- 6.27320794, -0.00040127, 0.00024583, 7.27280667, 0.99877424, 0.99935290, 0.49323932],
+                             [- 6.27320806, -0.00040122, 0.00024580, 7.27280684, 0.99877440, 0.99935299, 0.49323931],
+                             [- 6.27320819, -0.00040117, 0.00024576, 7.27280702, 0.99877456, 0.99935307, 0.49323926],
+                             [- 6.27320831, -0.00040111, 0.00024573, 7.27280720, 0.99877472, 0.99935315, 0.49323938],
+                             [- 6.27320843, -0.00040106, 0.00024570, 7.27280737, 0.99877488, 0.99935324, 0.49323939],
+                             [- 6.27320856, -0.00040101, 0.00024567, 7.27280755, 0.99877504, 0.99935332, 0.49323934],
+                             [- 6.27320868, -0.00040096, 0.00024564, 7.27280773, 0.99877519, 0.99935341, 0.49323939],
+                             [- 6.27320881, -0.00040091, 0.00024560, 7.27280790, 0.99877535, 0.99935349, 0.49323943],
+                             [- 6.27320893, -0.00040085, 0.00024557, 7.27280808, 0.99877551, 0.99935357, 0.49323942],
+                             [- 6.27320906, -0.00040080, 0.00024554, 7.27280825, 0.99877567, 0.99935366, 0.49323947],
+                             [- 6.27320918, -0.00040075, 0.00024551, 7.27280843, 0.99877583, 0.99935374, 0.49323951],
+                             [- 6.27320930, -0.00040070, 0.00024548, 7.27280861, 0.99877599, 0.99935382, 0.49323953],
+                             [- 6.27320943, -0.00040065, 0.00024545, 7.27280878, 0.99877615, 0.99935391, 0.49323955],
+                             [- 6.27320955, -0.00040059, 0.00024541, 7.27280896, 0.99877630, 0.99935399, 0.49323962],
+                             [- 6.27320968, -0.00040054, 0.00024538, 7.27280913, 0.99877646, 0.99935408, 0.49323956],
+                             [- 6.27320980, -0.00040049, 0.00024535, 7.27280931, 0.99877662, 0.99935416, 0.49323962],
+                             [- 6.27320993, -0.00040044, 0.00024532, 7.27280949, 0.99877678, 0.99935424, 0.49323958],
+                             [- 6.27321005, -0.00040039, 0.00024529, 7.27280966, 0.99877694, 0.99935433, 0.49323965],
+                             [- 6.27321017, -0.00040034, 0.00024525, 7.27280984, 0.99877710, 0.99935441, 0.49323969],
+                             [- 6.27321030, -0.00040028, 0.00024522, 7.27281001, 0.99877725, 0.99935449, 0.49323976],
+                             [- 6.27321042, -0.00040023, 0.00024519, 7.27281019, 0.99877741, 0.99935458, 0.49323970],
+                             [- 6.27321054, -0.00040018, 0.00024516, 7.27281036, 0.99877757, 0.99935466, 0.49323974],
+                             [- 6.27321067, -0.00040013, 0.00024513, 7.27281054, 0.99877773, 0.99935474, 0.49323974],
+                             [- 6.27321079, -0.00040008, 0.00024510, 7.27281072, 0.99877789, 0.99935483, 0.49323966],
+                             [- 6.27321092, -0.00040003, 0.00024506, 7.27281089, 0.99877804, 0.99935491, 0.49323980],
+                             [- 6.27321104, -0.00039997, 0.00024503, 7.27281107, 0.99877820, 0.99935499, 0.49323982],
+                             [- 6.27321116, -0.00039992, 0.00024500, 7.27281124, 0.99877836, 0.99935508, 0.49323984],
+                             [- 6.27321129, -0.00039987, 0.00024497, 7.27281142, 0.99877852, 0.99935516, 0.49323979],
+                             [- 6.27321141, -0.00039982, 0.00024494, 7.27281159, 0.99877868, 0.99935524, 0.49323984],
+                             [- 6.27321153, -0.00039977, 0.00024491, 7.27281177, 0.99877883, 0.99935533, 0.49323987],
+                             [- 6.27321166, -0.00039972, 0.00024487, 7.27281194, 0.99877899, 0.99935541, 0.49323994],
+                             [- 6.27321178, -0.00039966, 0.00024484, 7.27281212, 0.99877915, 0.99935549, 0.49323989],
+                             [- 6.27321191, -0.00039961, 0.00024481, 7.27281229, 0.99877931, 0.99935558, 0.49323986],
+                             [- 6.27321203, -0.00039956, 0.00024478, 7.27281247, 0.99877946, 0.99935566, 0.49323995],
+                             [- 6.27321215, -0.00039951, 0.00024475, 7.27281264, 0.99877962, 0.99935574, 0.49323997],
+                             [- 6.27321228, -0.00039946, 0.00024472, 7.27281282, 0.99877978, 0.99935583, 0.49323996],
+                             [- 6.27321240, -0.00039941, 0.00024468, 7.27281299, 0.99877994, 0.99935591, 0.49323998],
+                             [- 6.27321252, -0.00039935, 0.00024465, 7.27281317, 0.99878009, 0.99935599, 0.49323996],
+                             [- 6.27321265, -0.00039930, 0.00024462, 7.27281334, 0.99878025, 0.99935608, 0.49324002],
+                             [- 6.27321277, -0.00039925, 0.00024459, 7.27281352, 0.99878041, 0.99935616, 0.49323998],
+                             [- 6.27321289, -0.00039920, 0.00024456, 7.27281369, 0.99878057, 0.99935624, 0.49324001],
+                             [- 6.27321302, -0.00039915, 0.00024453, 7.27281387, 0.99878072, 0.99935632, 0.49324014],
+                             [- 6.27321314, -0.00039910, 0.00024450, 7.27281404, 0.99878088, 0.99935641, 0.49324019],
+                             [- 6.27321326, -0.00039905, 0.00024446, 7.27281422, 0.99878104, 0.99935649, 0.49324012],
+                             [- 6.27321338, -0.00039899, 0.00024443, 7.27281439, 0.99878120, 0.99935657, 0.49324003],
+                             [- 6.27321351, -0.00039894, 0.00024440, 7.27281457, 0.99878135, 0.99935666, 0.49324013],
+                             [- 6.27321363, -0.00039889, 0.00024437, 7.27281474, 0.99878151, 0.99935674, 0.49324013],
+                             [- 6.27321375, -0.00039884, 0.00024434, 7.27281491, 0.99878167, 0.99935682, 0.49324017],
+                             [- 6.27321388, -0.00039879, 0.00024431, 7.27281509, 0.99878182, 0.99935690, 0.49324022],
+                             [- 6.27321400, -0.00039874, 0.00024427, 7.27281526, 0.99878198, 0.99935699, 0.49324015],
+                             [- 6.27321412, -0.00039869, 0.00024424, 7.27281544, 0.99878214, 0.99935707, 0.49324036],
+                             [- 6.27321425, -0.00039863, 0.00024421, 7.27281561, 0.99878229, 0.99935715, 0.49324026],
+                             [- 6.27321437, -0.00039858, 0.00024418, 7.27281579, 0.99878245, 0.99935724, 0.49324022],
+                             [- 6.27321449, -0.00039853, 0.00024415, 7.27281596, 0.99878261, 0.99935732, 0.49324031],
+                             [- 6.27321461, -0.00039848, 0.00024412, 7.27281613, 0.99878277, 0.99935740, 0.49324028],
+                             [- 6.27321474, -0.00039843, 0.00024409, 7.27281631, 0.99878292, 0.99935748, 0.49324030],
+                             [- 6.27321486, -0.00039838, 0.00024405, 7.27281648, 0.99878308, 0.99935757, 0.49324023],
+                             [- 6.27321498, -0.00039833, 0.00024402, 7.27281666, 0.99878324, 0.99935765, 0.49324037],
+                             [- 6.27321511, -0.00039828, 0.00024399, 7.27281683, 0.99878339, 0.99935773, 0.49324036],
+                             [- 6.27321523, -0.00039822, 0.00024396, 7.27281700, 0.99878355, 0.99935782, 0.49324044],
+                             [- 6.27321535, -0.00039817, 0.00024393, 7.27281718, 0.99878370, 0.99935790, 0.49324039],
+                             [- 6.27321547, -0.00039812, 0.00024390, 7.27281735, 0.99878386, 0.99935798, 0.49324042],
+                             [- 6.27321560, -0.00039807, 0.00024387, 7.27281752, 0.99878402, 0.99935806, 0.49324055],
+                             [- 6.27321572, -0.00039802, 0.00024383, 7.27281770, 0.99878417, 0.99935815, 0.49324042],
+                             [- 6.27321584, -0.00039797, 0.00024380, 7.27281787, 0.99878433, 0.99935823, 0.49324044],
+                             [- 6.27321596, -0.00039792, 0.00024377, 7.27281805, 0.99878449, 0.99935831, 0.49324041],
+                             [- 6.27321609, -0.00039787, 0.00024374, 7.27281822, 0.99878464, 0.99935839, 0.49324060],
+                             [- 6.27321621, -0.00039781, 0.00024371, 7.27281839, 0.99878480, 0.99935848, 0.49324044],
+                             [- 6.27321633, -0.00039776, 0.00024368, 7.27281857, 0.99878496, 0.99935856, 0.49324054],
+                             [- 6.27321645, -0.00039771, 0.00024365, 7.27281874, 0.99878511, 0.99935864, 0.49324046],
+                             [- 6.27321658, -0.00039766, 0.00024362, 7.27281891, 0.99878527, 0.99935872, 0.49324052],
+                             [- 6.27321670, -0.00039761, 0.00024358, 7.27281909, 0.99878542, 0.99935881, 0.49324063],
+                             [- 6.27321682, -0.00039756, 0.00024355, 7.27281926, 0.99878558, 0.99935889, 0.49324081],
+                             [- 6.27321694, -0.00039751, 0.00024352, 7.27281943, 0.99878574, 0.99935897, 0.49324067],
+                             [- 6.27321706, -0.00039746, 0.00024349, 7.27281961, 0.99878589, 0.99935905, 0.49324080],
+                             [- 6.27321719, -0.00039741, 0.00024346, 7.27281978, 0.99878605, 0.99935913, 0.49324070],
+                             [- 6.27321731, -0.00039736, 0.00024343, 7.27281995, 0.99878620, 0.99935922, 0.49324061],
+                             [- 6.27321743, -0.00039730, 0.00024340, 7.27282013, 0.99878636, 0.99935930, 0.49324072],
+                             [- 6.27321755, -0.00039725, 0.00024337, 7.27282030, 0.99878652, 0.99935938, 0.49324071],
+                             [- 6.27321767, -0.00039720, 0.00024333, 7.27282047, 0.99878667, 0.99935946, 0.49324076],
+                             [- 6.27321780, -0.00039715, 0.00024330, 7.27282064, 0.99878683, 0.99935955, 0.49324084],
+                             [- 6.27321792, -0.00039710, 0.00024327, 7.27282082, 0.99878698, 0.99935963, 0.49324086],
+                             [- 6.27321804, -0.00039705, 0.00024324, 7.27282099, 0.99878714, 0.99935971, 0.49324068],
+                             [- 6.27321816, -0.00039700, 0.00024321, 7.27282116, 0.99878729, 0.99935979, 0.49324078],
+                             [- 6.27321828, -0.00039695, 0.00024318, 7.27282134, 0.99878745, 0.99935987, 0.49324088],
+                             [- 6.27321841, -0.00039690, 0.00024315, 7.27282151, 0.99878760, 0.99935996, 0.49324077],
+                             [- 6.27321853, -0.00039685, 0.00024312, 7.27282168, 0.99878776, 0.99936004, 0.49324091],
+                             [- 6.27321865, -0.00039680, 0.00024308, 7.27282185, 0.99878792, 0.99936012, 0.49324089],
+                             [- 6.27321877, -0.00039674, 0.00024305, 7.27282203, 0.99878807, 0.99936020, 0.49324098],
+                             [- 6.27321889, -0.00039669, 0.00024302, 7.27282220, 0.99878823, 0.99936028, 0.49324089],
+                             [- 6.27321901, -0.00039664, 0.00024299, 7.27282237, 0.99878838, 0.99936037, 0.49324096],
+                             [- 6.27321914, -0.00039659, 0.00024296, 7.27282254, 0.99878854, 0.99936045, 0.49324110],
+                             [- 6.27321926, -0.00039654, 0.00024293, 7.27282272, 0.99878869, 0.99936053, 0.49324104],
+                             [- 6.27321938, -0.00039649, 0.00024290, 7.27282289, 0.99878885, 0.99936061, 0.49324115],
+                             [- 6.27321950, -0.00039644, 0.00024287, 7.27282306, 0.99878900, 0.99936069, 0.49324105],
+                             [- 6.27321962, -0.00039639, 0.00024284, 7.27282323, 0.99878916, 0.99936078, 0.49324108],
+                             [- 6.27321974, -0.00039634, 0.00024280, 7.27282341, 0.99878931, 0.99936086, 0.49324101],
+                             [- 6.27321987, -0.00039629, 0.00024277, 7.27282358, 0.99878947, 0.99936094, 0.49324102],
+                             [- 6.27321999, -0.00039624, 0.00024274, 7.27282375, 0.99878962, 0.99936102, 0.49324113],
+                             [- 6.27322011, -0.00039619, 0.00024271, 7.27282392, 0.99878978, 0.99936110, 0.49324108],
+                             [- 6.27322023, -0.00039613, 0.00024268, 7.27282409, 0.99878993, 0.99936119, 0.49324117],
+                             [- 6.27322035, -0.00039608, 0.00024265, 7.27282427, 0.99879009, 0.99936127, 0.49324125],
+                             [- 6.27322047, -0.00039603, 0.00024262, 7.27282444, 0.99879024, 0.99936135, 0.49324106],
+                             [- 6.27322059, -0.00039598, 0.00024259, 7.27282461, 0.99879040, 0.99936143, 0.49324119],
+                             [- 6.27322071, -0.00039593, 0.00024256, 7.27282478, 0.99879055, 0.99936151, 0.49324110],
+                             [- 6.27322084, -0.00039588, 0.00024252, 7.27282495, 0.99879071, 0.99936159, 0.49324126],
+                             [- 6.27322096, -0.00039583, 0.00024249, 7.27282513, 0.99879086, 0.99936168, 0.49324122],
+                             [- 6.27322108, -0.00039578, 0.00024246, 7.27282530, 0.99879102, 0.99936176, 0.49324129],
+                             [- 6.27322120, -0.00039573, 0.00024243, 7.27282547, 0.99879117, 0.99936184, 0.49324129],
+                             [- 6.27322132, -0.00039568, 0.00024240, 7.27282564, 0.99879133, 0.99936192, 0.49324124],
+                             [- 6.27322144, -0.00039563, 0.00024237, 7.27282581, 0.99879148, 0.99936200, 0.49324135],
+                             [- 6.27322156, -0.00039558, 0.00024234, 7.27282598, 0.99879163, 0.99936208, 0.49324138],
+                             [- 6.27322168, -0.00039553, 0.00024231, 7.27282616, 0.99879179, 0.99936216, 0.49324133],
+                             [- 6.27322180, -0.00039548, 0.00024228, 7.27282633, 0.99879194, 0.99936225, 0.49324140],
+                             [- 6.27322193, -0.00039543, 0.00024225, 7.27282650, 0.99879210, 0.99936233, 0.49324130],
+                             [- 6.27322205, -0.00039538, 0.00024221, 7.27282667, 0.99879225, 0.99936241, 0.49324149],
+                             [- 6.27322217, -0.00039533, 0.00024218, 7.27282684, 0.99879241, 0.99936249, 0.49324143],
+                             [- 6.27322229, -0.00039528, 0.00024215, 7.27282701, 0.99879256, 0.99936257, 0.49324140],
+                             [- 6.27322241, -0.00039522, 0.00024212, 7.27282718, 0.99879271, 0.99936265, 0.49324158],
+                             [- 6.27322253, -0.00039517, 0.00024209, 7.27282736, 0.99879287, 0.99936273, 0.49324147],
+                             [- 6.27322265, -0.00039512, 0.00024206, 7.27282753, 0.99879302, 0.99936282, 0.49324156],
+                             [- 6.27322277, -0.00039507, 0.00024203, 7.27282770, 0.99879318, 0.99936290, 0.49324153],
+                             [- 6.27322289, -0.00039502, 0.00024200, 7.27282787, 0.99879333, 0.99936298, 0.49324143],
+                             [- 6.27322301, -0.00039497, 0.00024197, 7.27282804, 0.99879349, 0.99936306, 0.49324134],
+                             [- 6.27322313, -0.00039492, 0.00024194, 7.27282821, 0.99879364, 0.99936314, 0.49324161],
+                             [- 6.27322325, -0.00039487, 0.00024191, 7.27282838, 0.99879379, 0.99936322, 0.49324161],
+                             [- 6.27322337, -0.00039482, 0.00024187, 7.27282855, 0.99879395, 0.99936330, 0.49324164],
+                             [- 6.27322349, -0.00039477, 0.00024184, 7.27282872, 0.99879410, 0.99936339, 0.49324176],
+                             [- 6.27322362, -0.00039472, 0.00024181, 7.27282889, 0.99879425, 0.99936347, 0.49324160],
+                             [- 6.27322374, -0.00039467, 0.00024178, 7.27282907, 0.99879441, 0.99936355, 0.49324157],
+                             [- 6.27322386, -0.00039462, 0.00024175, 7.27282924, 0.99879456, 0.99936363, 0.49324158],
+                             [- 6.27322398, -0.00039457, 0.00024172, 7.27282941, 0.99879472, 0.99936371, 0.49324166],
+                             [- 6.27322410, -0.00039452, 0.00024169, 7.27282958, 0.99879487, 0.99936379, 0.49324172],
+                             [- 6.27322422, -0.00039447, 0.00024166, 7.27282975, 0.99879502, 0.99936387, 0.49324177],
+                             [- 6.27322434, -0.00039442, 0.00024163, 7.27282992, 0.99879518, 0.99936395, 0.49324175],
+                             [- 6.27322446, -0.00039437, 0.00024160, 7.27283009, 0.99879533, 0.99936403, 0.49324173],
+                             [- 6.27322458, -0.00039432, 0.00024157, 7.27283026, 0.99879548, 0.99936412, 0.49324183],
+                             [- 6.27322470, -0.00039427, 0.00024154, 7.27283043, 0.99879564, 0.99936420, 0.49324189],
+                             [- 6.27322482, -0.00039422, 0.00024150, 7.27283060, 0.99879579, 0.99936428, 0.49324183],
+                             [- 6.27322494, -0.00039417, 0.00024147, 7.27283077, 0.99879594, 0.99936436, 0.49324176],
+                             [- 6.27322506, -0.00039412, 0.00024144, 7.27283094, 0.99879610, 0.99936444, 0.49324183],
+                             [- 6.27322518, -0.00039407, 0.00024141, 7.27283111, 0.99879625, 0.99936452, 0.49324186],
+                             [- 6.27322530, -0.00039402, 0.00024138, 7.27283128, 0.99879640, 0.99936460, 0.49324198],
+                             [- 6.27322542, -0.00039397, 0.00024135, 7.27283145, 0.99879656, 0.99936468, 0.49324210],
+                             [- 6.27322554, -0.00039392, 0.00024132, 7.27283162, 0.99879671, 0.99936476, 0.49324198],
+                             [- 6.27322566, -0.00039387, 0.00024129, 7.27283179, 0.99879686, 0.99936484, 0.49324205],
+                             [- 6.27322578, -0.00039382, 0.00024126, 7.27283196, 0.99879702, 0.99936492, 0.49324207],
+                             [- 6.27322590, -0.00039377, 0.00024123, 7.27283213, 0.99879717, 0.99936501, 0.49324191],
+                             [- 6.27322602, -0.00039372, 0.00024120, 7.27283230, 0.99879732, 0.99936509, 0.49324201],
+                             [- 6.27322614, -0.00039367, 0.00024117, 7.27283247, 0.99879748, 0.99936517, 0.49324194],
+                             [- 6.27322626, -0.00039362, 0.00024114, 7.27283264, 0.99879763, 0.99936525, 0.49324211],
+                             [- 6.27322638, -0.00039357, 0.00024111, 7.27283281, 0.99879778, 0.99936533, 0.49324210],
+                             [- 6.27322650, -0.00039352, 0.00024107, 7.27283298, 0.99879793, 0.99936541, 0.49324195],
+                             [- 6.27322662, -0.00039347, 0.00024104, 7.27283315, 0.99879809, 0.99936549, 0.49324205],
+                             [- 6.27322674, -0.00039342, 0.00024101, 7.27283332, 0.99879824, 0.99936557, 0.49324210],
+                             [- 6.27322686, -0.00039337, 0.00024098, 7.27283349, 0.99879839, 0.99936565, 0.49324214],
+                             [- 6.27322698, -0.00039332, 0.00024095, 7.27283366, 0.99879855, 0.99936573, 0.49324202],
+                             [- 6.27322710, -0.00039327, 0.00024092, 7.27283383, 0.99879870, 0.99936581, 0.49324209],
+                             [- 6.27322722, -0.00039322, 0.00024089, 7.27283400, 0.99879885, 0.99936589, 0.49324208],
+                             [- 6.27322734, -0.00039317, 0.00024086, 7.27283417, 0.99879900, 0.99936597, 0.49324207],
+                             [- 6.27322746, -0.00039312, 0.00024083, 7.27283434, 0.99879916, 0.99936605, 0.49324215],
+                             [- 6.27322757, -0.00039307, 0.00024080, 7.27283451, 0.99879931, 0.99936613, 0.49324220],
+                             [- 6.27322769, -0.00039302, 0.00024077, 7.27283468, 0.99879946, 0.99936621, 0.49324229],
+                             [- 6.27322781, -0.00039297, 0.00024074, 7.27283485, 0.99879961, 0.99936630, 0.49324226],
+                             [- 6.27322793, -0.00039292, 0.00024071, 7.27283502, 0.99879977, 0.99936638, 0.49324230],
+                             [- 6.27322805, -0.00039287, 0.00024068, 7.27283519, 0.99879992, 0.99936646, 0.49324236],
+                             [- 6.27322817, -0.00039282, 0.00024065, 7.27283535, 0.99880007, 0.99936654, 0.49324229],
+                             [- 6.27322829, -0.00039277, 0.00024062, 7.27283552, 0.99880022, 0.99936662, 0.49324245],
+                             [- 6.27322841, -0.00039272, 0.00024059, 7.27283569, 0.99880038, 0.99936670, 0.49324230],
+                             [- 6.27322853, -0.00039267, 0.00024055, 7.27283586, 0.99880053, 0.99936678, 0.49324241],
+                             [- 6.27322865, -0.00039262, 0.00024052, 7.27283603, 0.99880068, 0.99936686, 0.49324234],
+                             [- 6.27322877, -0.00039257, 0.00024049, 7.27283620, 0.99880083, 0.99936694, 0.49324231],
+                             [- 6.27322889, -0.00039252, 0.00024046, 7.27283637, 0.99880098, 0.99936702, 0.49324244],
+                             [- 6.27322901, -0.00039247, 0.00024043, 7.27283654, 0.99880114, 0.99936710, 0.49324243],
+                             [- 6.27322913, -0.00039242, 0.00024040, 7.27283671, 0.99880129, 0.99936718, 0.49324251],
+                             [- 6.27322924, -0.00039237, 0.00024037, 7.27283688, 0.99880144, 0.99936726, 0.49324242],
+                             [- 6.27322936, -0.00039232, 0.00024034, 7.27283704, 0.99880159, 0.99936734, 0.49324245],
+                             [- 6.27322948, -0.00039227, 0.00024031, 7.27283721, 0.99880174, 0.99936742, 0.49324248],
+                             [- 6.27322960, -0.00039222, 0.00024028, 7.27283738, 0.99880190, 0.99936750, 0.49324240],
+                             [- 6.27322972, -0.00039217, 0.00024025, 7.27283755, 0.99880205, 0.99936758, 0.49324256],
+                             [- 6.27322984, -0.00039212, 0.00024022, 7.27283772, 0.99880220, 0.99936766, 0.49324270],
+                             [- 6.27322996, -0.00039207, 0.00024019, 7.27283789, 0.99880235, 0.99936774, 0.49324265],
+                             [- 6.27323008, -0.00039202, 0.00024016, 7.27283806, 0.99880250, 0.99936782, 0.49324254],
+                             [- 6.27323020, -0.00039197, 0.00024013, 7.27283822, 0.99880265, 0.99936790, 0.49324268],
+                             [- 6.27323032, -0.00039192, 0.00024010, 7.27283839, 0.99880281, 0.99936798, 0.49324263],
+                             [- 6.27323043, -0.00039187, 0.00024007, 7.27283856, 0.99880296, 0.99936806, 0.49324257],
+                             [- 6.27323055, -0.00039182, 0.00024004, 7.27283873, 0.99880311, 0.99936814, 0.49324271],
+                             [- 6.27323067, -0.00039177, 0.00024001, 7.27283890, 0.99880326, 0.99936822, 0.49324263],
+                             [- 6.27323079, -0.00039172, 0.00023998, 7.27283907, 0.99880341, 0.99936830, 0.49324259],
+                             [- 6.27323091, -0.00039167, 0.00023995, 7.27283923, 0.99880356, 0.99936838, 0.49324272],
+                             [- 6.27323103, -0.00039162, 0.00023992, 7.27283940, 0.99880372, 0.99936846, 0.49324266],
+                             [- 6.27323115, -0.00039158, 0.00023989, 7.27283957, 0.99880387, 0.99936854, 0.49324277],
+                             [- 6.27323126, -0.00039153, 0.00023985, 7.27283974, 0.99880402, 0.99936862, 0.49324283],
+                             [- 6.27323138, -0.00039148, 0.00023982, 7.27283991, 0.99880417, 0.99936870, 0.49324288],
+                             [- 6.27323150, -0.00039143, 0.00023979, 7.27284008, 0.99880432, 0.99936878, 0.49324274],
+                             [- 6.27323162, -0.00039138, 0.00023976, 7.27284024, 0.99880447, 0.99936886, 0.49324289],
+                             [- 6.27323174, -0.00039133, 0.00023973, 7.27284041, 0.99880462, 0.99936894, 0.49324287],
+                             [- 6.27323186, -0.00039128, 0.00023970, 7.27284058, 0.99880477, 0.99936902, 0.49324285],
+                             [- 6.27323198, -0.00039123, 0.00023967, 7.27284075, 0.99880493, 0.99936910, 0.49324283],
+                             [- 6.27323209, -0.00039118, 0.00023964, 7.27284091, 0.99880508, 0.99936918, 0.49324290],
+                             [- 6.27323221, -0.00039113, 0.00023961, 7.27284108, 0.99880523, 0.99936926, 0.49324280],
+                             [- 6.27323233, -0.00039108, 0.00023958, 7.27284125, 0.99880538, 0.99936934, 0.49324296],
+                             [- 6.27323245, -0.00039103, 0.00023955, 7.27284142, 0.99880553, 0.99936942, 0.49324284],
+                             [- 6.27323257, -0.00039098, 0.00023952, 7.27284159, 0.99880568, 0.99936950, 0.49324285],
+                             [- 6.27323268, -0.00039093, 0.00023949, 7.27284175, 0.99880583, 0.99936958, 0.49324302],
+                             [- 6.27323280, -0.00039088, 0.00023946, 7.27284192, 0.99880598, 0.99936966, 0.49324295],
+                             [- 6.27323292, -0.00039083, 0.00023943, 7.27284209, 0.99880613, 0.99936974, 0.49324320],
+                             [- 6.27323304, -0.00039078, 0.00023940, 7.27284226, 0.99880628, 0.99936982, 0.49324315],
+                             [- 6.27323316, -0.00039073, 0.00023937, 7.27284242, 0.99880643, 0.99936990, 0.49324296],
+                             [- 6.27323328, -0.00039069, 0.00023934, 7.27284259, 0.99880658, 0.99936997, 0.49324298],
+                             [- 6.27323339, -0.00039064, 0.00023931, 7.27284276, 0.99880674, 0.99937005, 0.49324310],
+                             [- 6.27323351, -0.00039059, 0.00023928, 7.27284292, 0.99880689, 0.99937013, 0.49324316],
+                             [- 6.27323363, -0.00039054, 0.00023925, 7.27284309, 0.99880704, 0.99937021, 0.49324305],
+                             [- 6.27323375, -0.00039049, 0.00023922, 7.27284326, 0.99880719, 0.99937029, 0.49324317],
+                             [- 6.27323387, -0.00039044, 0.00023919, 7.27284343, 0.99880734, 0.99937037, 0.49324316],
+                             [- 6.27323398, -0.00039039, 0.00023916, 7.27284359, 0.99880749, 0.99937045, 0.49324322],
+                             [- 6.27323410, -0.00039034, 0.00023913, 7.27284376, 0.99880764, 0.99937053, 0.49324310],
+                             [- 6.27323422, -0.00039029, 0.00023910, 7.27284393, 0.99880779, 0.99937061, 0.49324325],
+                             [- 6.27323434, -0.00039024, 0.00023907, 7.27284409, 0.99880794, 0.99937069, 0.49324319],
+                             [- 6.27323445, -0.00039019, 0.00023904, 7.27284426, 0.99880809, 0.99937077, 0.49324326],
+                             [- 6.27323457, -0.00039014, 0.00023901, 7.27284443, 0.99880824, 0.99937085, 0.49324329],
+                             [- 6.27323469, -0.00039009, 0.00023898, 7.27284460, 0.99880839, 0.99937093, 0.49324333],
+                             [- 6.27323481, -0.00039005, 0.00023895, 7.27284476, 0.99880854, 0.99937101, 0.49324318],
+                             [- 6.27323493, -0.00039000, 0.00023892, 7.27284493, 0.99880869, 0.99937109, 0.49324318],
+                             [- 6.27323504, -0.00038995, 0.00023889, 7.27284510, 0.99880884, 0.99937117, 0.49324337],
+                             [- 6.27323516, -0.00038990, 0.00023886, 7.27284526, 0.99880899, 0.99937124, 0.49324337],
+                             [- 6.27323528, -0.00038985, 0.00023883, 7.27284543, 0.99880914, 0.99937132, 0.49324350],
+                             [- 6.27323540, -0.00038980, 0.00023880, 7.27284560, 0.99880929, 0.99937140, 0.49324334],
+                             [- 6.27323551, -0.00038975, 0.00023877, 7.27284576, 0.99880944, 0.99937148, 0.49324341],
+                             [- 6.27323563, -0.00038970, 0.00023874, 7.27284593, 0.99880959, 0.99937156, 0.49324338],
+                             [- 6.27323575, -0.00038965, 0.00023871, 7.27284609, 0.99880974, 0.99937164, 0.49324344],
+                             [- 6.27323587, -0.00038960, 0.00023868, 7.27284626, 0.99880989, 0.99937172, 0.49324362],
+                             [- 6.27323598, -0.00038955, 0.00023865, 7.27284643, 0.99881004, 0.99937180, 0.49324347],
+                             [- 6.27323610, -0.00038951, 0.00023862, 7.27284659, 0.99881019, 0.99937188, 0.49324345],
+                             [- 6.27323622, -0.00038946, 0.00023859, 7.27284676, 0.99881034, 0.99937196, 0.49324353],
+                             [- 6.27323633, -0.00038941, 0.00023856, 7.27284693, 0.99881049, 0.99937204, 0.49324361],
+                             [- 6.27323645, -0.00038936, 0.00023853, 7.27284709, 0.99881064, 0.99937211, 0.49324364],
+                             [- 6.27323657, -0.00038931, 0.00023850, 7.27284726, 0.99881079, 0.99937219, 0.49324360],
+                             [- 6.27323669, -0.00038926, 0.00023847, 7.27284743, 0.99881094, 0.99937227, 0.49324354],
+                             [- 6.27323680, -0.00038921, 0.00023844, 7.27284759, 0.99881109, 0.99937235, 0.49324359],
+                             [- 6.27323692, -0.00038916, 0.00023841, 7.27284776, 0.99881124, 0.99937243, 0.49324355],
+                             [- 6.27323704, -0.00038911, 0.00023838, 7.27284792, 0.99881139, 0.99937251, 0.49324369],
+                             [- 6.27323715, -0.00038907, 0.00023835, 7.27284809, 0.99881154, 0.99937259, 0.49324366],
+                             [- 6.27323727, -0.00038902, 0.00023832, 7.27284826, 0.99881169, 0.99937267, 0.49324363],
+                             [- 6.27323739, -0.00038897, 0.00023829, 7.27284842, 0.99881184, 0.99937275, 0.49324368],
+                             [- 6.27323751, -0.00038892, 0.00023826, 7.27284859, 0.99881198, 0.99937282, 0.49324385],
+                             [- 6.27323762, -0.00038887, 0.00023823, 7.27284875, 0.99881213, 0.99937290, 0.49324375],
+                             [- 6.27323774, -0.00038882, 0.00023820, 7.27284892, 0.99881228, 0.99937298, 0.49324381],
+                             [- 6.27323786, -0.00038877, 0.00023817, 7.27284908, 0.99881243, 0.99937306, 0.49324383],
+                             [- 6.27323797, -0.00038872, 0.00023814, 7.27284925, 0.99881258, 0.99937314, 0.49324389],
+                             [- 6.27323809, -0.00038867, 0.00023811, 7.27284942, 0.99881273, 0.99937322, 0.49324387],
+                             [- 6.27323821, -0.00038863, 0.00023808, 7.27284958, 0.99881288, 0.99937330, 0.49324385],
+                             [- 6.27323832, -0.00038858, 0.00023805, 7.27284975, 0.99881303, 0.99937338, 0.49324378],
+                             [- 6.27323844, -0.00038853, 0.00023802, 7.27284991, 0.99881318, 0.99937345, 0.49324377],
+                             [- 6.27323856, -0.00038848, 0.00023799, 7.27285008, 0.99881333, 0.99937353, 0.49324388],
+                             [- 6.27323867, -0.00038843, 0.00023796, 7.27285024, 0.99881348, 0.99937361, 0.49324392],
+                             [- 6.27323879, -0.00038838, 0.00023793, 7.27285041, 0.99881362, 0.99937369, 0.49324396],
+                             [- 6.27323891, -0.00038833, 0.00023790, 7.27285057, 0.99881377, 0.99937377, 0.49324387],
+                             [- 6.27323902, -0.00038828, 0.00023787, 7.27285074, 0.99881392, 0.99937385, 0.49324395],
+                             [- 6.27323914, -0.00038824, 0.00023784, 7.27285090, 0.99881407, 0.99937393, 0.49324401],
+                             [- 6.27323926, -0.00038819, 0.00023781, 7.27285107, 0.99881422, 0.99937400, 0.49324397],
+                             [- 6.27323937, -0.00038814, 0.00023778, 7.27285124, 0.99881437, 0.99937408, 0.49324409],
+                             [- 6.27323949, -0.00038809, 0.00023775, 7.27285140, 0.99881452, 0.99937416, 0.49324390],
+                             [- 6.27323961, -0.00038804, 0.00023772, 7.27285157, 0.99881467, 0.99937424, 0.49324412],
+                             [- 6.27323972, -0.00038799, 0.00023769, 7.27285173, 0.99881481, 0.99937432, 0.49324405],
+                             [- 6.27323984, -0.00038794, 0.00023766, 7.27285190, 0.99881496, 0.99937440, 0.49324413],
+                             [- 6.27323996, -0.00038789, 0.00023763, 7.27285206, 0.99881511, 0.99937448, 0.49324398],
+                             [- 6.27324007, -0.00038785, 0.00023760, 7.27285223, 0.99881526, 0.99937455, 0.49324408],
+                             [- 6.27324019, -0.00038780, 0.00023757, 7.27285239, 0.99881541, 0.99937463, 0.49324411],
+                             [- 6.27324030, -0.00038775, 0.00023754, 7.27285256, 0.99881556, 0.99937471, 0.49324404],
+                             [- 6.27324042, -0.00038770, 0.00023751, 7.27285272, 0.99881571, 0.99937479, 0.49324417],
+                             [- 6.27324054, -0.00038765, 0.00023748, 7.27285289, 0.99881585, 0.99937487, 0.49324417],
+                             [- 6.27324065, -0.00038760, 0.00023745, 7.27285305, 0.99881600, 0.99937495, 0.49324417],
+                             [- 6.27324077, -0.00038755, 0.00023742, 7.27285321, 0.99881615, 0.99937502, 0.49324410],
+                             [- 6.27324089, -0.00038751, 0.00023739, 7.27285338, 0.99881630, 0.99937510, 0.49324415],
+                             [- 6.27324100, -0.00038746, 0.00023736, 7.27285354, 0.99881645, 0.99937518, 0.49324415],
+                             [- 6.27324112, -0.00038741, 0.00023733, 7.27285371, 0.99881660, 0.99937526, 0.49324428],
+                             [- 6.27324123, -0.00038736, 0.00023730, 7.27285387, 0.99881674, 0.99937534, 0.49324427],
+                             [- 6.27324135, -0.00038731, 0.00023727, 7.27285404, 0.99881689, 0.99937541, 0.49324429],
+                             [- 6.27324147, -0.00038726, 0.00023724, 7.27285420, 0.99881704, 0.99937549, 0.49324429],
+                             [- 6.27324158, -0.00038722, 0.00023721, 7.27285437, 0.99881719, 0.99937557, 0.49324431],
+                             [- 6.27324170, -0.00038717, 0.00023718, 7.27285453, 0.99881734, 0.99937565, 0.49324418],
+                             [- 6.27324181, -0.00038712, 0.00023715, 7.27285469, 0.99881748, 0.99937573, 0.49324436],
+                             [- 6.27324193, -0.00038707, 0.00023712, 7.27285486, 0.99881763, 0.99937581, 0.49324427],
+                             [- 6.27324205, -0.00038702, 0.00023709, 7.27285502, 0.99881778, 0.99937588, 0.49324438],
+                             [- 6.27324216, -0.00038697, 0.00023706, 7.27285519, 0.99881793, 0.99937596, 0.49324441],
+                             [- 6.27324228, -0.00038693, 0.00023704, 7.27285535, 0.99881807, 0.99937604, 0.49324425],
+                             [- 6.27324239, -0.00038688, 0.00023701, 7.27285552, 0.99881822, 0.99937612, 0.49324444],
+                             [- 6.27324251, -0.00038683, 0.00023698, 7.27285568, 0.99881837, 0.99937620, 0.49324437],
+                             [- 6.27324262, -0.00038678, 0.00023695, 7.27285584, 0.99881852, 0.99937627, 0.49324451],
+                             [- 6.27324274, -0.00038673, 0.00023692, 7.27285601, 0.99881867, 0.99937635, 0.49324443],
+                             [- 6.27324286, -0.00038668, 0.00023689, 7.27285617, 0.99881881, 0.99937643, 0.49324463],
+                             [- 6.27324297, -0.00038664, 0.00023686, 7.27285634, 0.99881896, 0.99937651, 0.49324464],
+                             [- 6.27324309, -0.00038659, 0.00023683, 7.27285650, 0.99881911, 0.99937659, 0.49324460],
+                             [- 6.27324320, -0.00038654, 0.00023680, 7.27285666, 0.99881926, 0.99937666, 0.49324474],
+                             [- 6.27324332, -0.00038649, 0.00023677, 7.27285683, 0.99881940, 0.99937674, 0.49324457],
+                             [- 6.27324343, -0.00038644, 0.00023674, 7.27285699, 0.99881955, 0.99937682, 0.49324464],
+                             [- 6.27324355, -0.00038639, 0.00023671, 7.27285716, 0.99881970, 0.99937690, 0.49324452],
+                             [- 6.27324366, -0.00038635, 0.00023668, 7.27285732, 0.99881985, 0.99937697, 0.49324451],
+                             [- 6.27324378, -0.00038630, 0.00023665, 7.27285748, 0.99881999, 0.99937705, 0.49324463],
+                             [- 6.27324390, -0.00038625, 0.00023662, 7.27285765, 0.99882014, 0.99937713, 0.49324460],
+                             [- 6.27324401, -0.00038620, 0.00023659, 7.27285781, 0.99882029, 0.99937721, 0.49324461],
+                             [- 6.27324413, -0.00038615, 0.00023656, 7.27285797, 0.99882043, 0.99937729, 0.49324473],
+                             [- 6.27324424, -0.00038610, 0.00023653, 7.27285814, 0.99882058, 0.99937736, 0.49324474],
+                             [- 6.27324436, -0.00038606, 0.00023650, 7.27285830, 0.99882073, 0.99937744, 0.49324465],
+                             [- 6.27324447, -0.00038601, 0.00023647, 7.27285846, 0.99882088, 0.99937752, 0.49324475],
+                             [- 6.27324459, -0.00038596, 0.00023644, 7.27285863, 0.99882102, 0.99937760, 0.49324482],
+                             [- 6.27324470, -0.00038591, 0.00023641, 7.27285879, 0.99882117, 0.99937767, 0.49324468],
+                             [- 6.27324482, -0.00038586, 0.00023638, 7.27285895, 0.99882132, 0.99937775, 0.49324472],
+                             [- 6.27324493, -0.00038582, 0.00023636, 7.27285912, 0.99882146, 0.99937783, 0.49324478],
+                             [- 6.27324505, -0.00038577, 0.00023633, 7.27285928, 0.99882161, 0.99937791, 0.49324486],
+                             [- 6.27324516, -0.00038572, 0.00023630, 7.27285944, 0.99882176, 0.99937798, 0.49324500],
+                             [- 6.27324528, -0.00038567, 0.00023627, 7.27285961, 0.99882190, 0.99937806, 0.49324482],
+                             [- 6.27324539, -0.00038562, 0.00023624, 7.27285977, 0.99882205, 0.99937814, 0.49324496],
+                             [- 6.27324551, -0.00038558, 0.00023621, 7.27285993, 0.99882220, 0.99937822, 0.49324495],
+                             [- 6.27324562, -0.00038553, 0.00023618, 7.27286009, 0.99882234, 0.99937829, 0.49324492],
+                             [- 6.27324574, -0.00038548, 0.00023615, 7.27286026, 0.99882249, 0.99937837, 0.49324476],
+                             [- 6.27324585, -0.00038543, 0.00023612, 7.27286042, 0.99882264, 0.99937845, 0.49324499],
+                             [- 6.27324597, -0.00038538, 0.00023609, 7.27286058, 0.99882278, 0.99937853, 0.49324495],
+                             [- 6.27324608, -0.00038534, 0.00023606, 7.27286075, 0.99882293, 0.99937860, 0.49324497],
+                             [- 6.27324620, -0.00038529, 0.00023603, 7.27286091, 0.99882308, 0.99937868, 0.49324499],
+                             [- 6.27324631, -0.00038524, 0.00023600, 7.27286107, 0.99882322, 0.99937876, 0.49324496],
+                             [- 6.27324643, -0.00038519, 0.00023597, 7.27286123, 0.99882337, 0.99937884, 0.49324507],
+                             [- 6.27324654, -0.00038514, 0.00023594, 7.27286140, 0.99882352, 0.99937891, 0.49324506],
+                             [- 6.27324666, -0.00038510, 0.00023591, 7.27286156, 0.99882366, 0.99937899, 0.49324519],
+                             [- 6.27324677, -0.00038505, 0.00023588, 7.27286172, 0.99882381, 0.99937907, 0.49324510],
+                             [- 6.27324689, -0.00038500, 0.00023586, 7.27286188, 0.99882396, 0.99937914, 0.49324509],
+                             [- 6.27324700, -0.00038495, 0.00023583, 7.27286205, 0.99882410, 0.99937922, 0.49324510],
+                             [- 6.27324711, -0.00038490, 0.00023580, 7.27286221, 0.99882425, 0.99937930, 0.49324517],
+                             [- 6.27324723, -0.00038486, 0.00023577, 7.27286237, 0.99882440, 0.99937938, 0.49324527],
+                             [- 6.27324734, -0.00038481, 0.00023574, 7.27286253, 0.99882454, 0.99937945, 0.49324519],
+                             [- 6.27324746, -0.00038476, 0.00023571, 7.27286270, 0.99882469, 0.99937953, 0.49324516],
+                             [- 6.27324757, -0.00038471, 0.00023568, 7.27286286, 0.99882483, 0.99937961, 0.49324513],
+                             [- 6.27324769, -0.00038467, 0.00023565, 7.27286302, 0.99882498, 0.99937968, 0.49324519],
+                             [- 6.27324780, -0.00038462, 0.00023562, 7.27286318, 0.99882513, 0.99937976, 0.49324509],
+                             [- 6.27324792, -0.00038457, 0.00023559, 7.27286335, 0.99882527, 0.99937984, 0.49324532],
+                             [- 6.27324803, -0.00038452, 0.00023556, 7.27286351, 0.99882542, 0.99937992, 0.49324518],
+                             [- 6.27324814, -0.00038447, 0.00023553, 7.27286367, 0.99882556, 0.99937999, 0.49324537],
+                             [- 6.27324826, -0.00038443, 0.00023550, 7.27286383, 0.99882571, 0.99938007, 0.49324536],
+                             [- 6.27324837, -0.00038438, 0.00023547, 7.27286399, 0.99882586, 0.99938015, 0.49324540],
+                             [- 6.27324849, -0.00038433, 0.00023545, 7.27286416, 0.99882600, 0.99938022, 0.49324531],
+                             [- 6.27324860, -0.00038428, 0.00023542, 7.27286432, 0.99882615, 0.99938030, 0.49324544],
+                             [- 6.27324872, -0.00038424, 0.00023539, 7.27286448, 0.99882629, 0.99938038, 0.49324534],
+                             [- 6.27324883, -0.00038419, 0.00023536, 7.27286464, 0.99882644, 0.99938045, 0.49324551],
+                             [- 6.27324894, -0.00038414, 0.00023533, 7.27286480, 0.99882658, 0.99938053, 0.49324541],
+                             [- 6.27324906, -0.00038409, 0.00023530, 7.27286497, 0.99882673, 0.99938061, 0.49324551],
+                             [- 6.27324917, -0.00038405, 0.00023527, 7.27286513, 0.99882688, 0.99938068, 0.49324541],
+                             [- 6.27324929, -0.00038400, 0.00023524, 7.27286529, 0.99882702, 0.99938076, 0.49324543],
+                             [- 6.27324940, -0.00038395, 0.00023521, 7.27286545, 0.99882717, 0.99938084, 0.49324548],
+                             [- 6.27324951, -0.00038390, 0.00023518, 7.27286561, 0.99882731, 0.99938092, 0.49324547],
+                             [- 6.27324963, -0.00038385, 0.00023515, 7.27286577, 0.99882746, 0.99938099, 0.49324552],
+                             [- 6.27324974, -0.00038381, 0.00023512, 7.27286594, 0.99882760, 0.99938107, 0.49324561],
+                             [- 6.27324986, -0.00038376, 0.00023509, 7.27286610, 0.99882775, 0.99938115, 0.49324575],
+                             [- 6.27324997, -0.00038371, 0.00023507, 7.27286626, 0.99882789, 0.99938122, 0.49324555],
+                             [- 6.27325008, -0.00038366, 0.00023504, 7.27286642, 0.99882804, 0.99938130, 0.49324561],
+                             [- 6.27325020, -0.00038362, 0.00023501, 7.27286658, 0.99882818, 0.99938138, 0.49324560],
+                             [- 6.27325031, -0.00038357, 0.00023498, 7.27286674, 0.99882833, 0.99938145, 0.49324567],
+                             [- 6.27325043, -0.00038352, 0.00023495, 7.27286690, 0.99882847, 0.99938153, 0.49324557],
+                             [- 6.27325054, -0.00038347, 0.00023492, 7.27286706, 0.99882862, 0.99938161, 0.49324572],
+                             [- 6.27325065, -0.00038343, 0.00023489, 7.27286723, 0.99882877, 0.99938168, 0.49324570],
+                             [- 6.27325077, -0.00038338, 0.00023486, 7.27286739, 0.99882891, 0.99938176, 0.49324576],
+                             [- 6.27325088, -0.00038333, 0.00023483, 7.27286755, 0.99882906, 0.99938184, 0.49324591],
+                             [- 6.27325099, -0.00038328, 0.00023480, 7.27286771, 0.99882920, 0.99938191, 0.49324569],
+                             [- 6.27325111, -0.00038324, 0.00023477, 7.27286787, 0.99882935, 0.99938199, 0.49324559],
+                             [- 6.27325122, -0.00038319, 0.00023475, 7.27286803, 0.99882949, 0.99938207, 0.49324564],
+                             [- 6.27325133, -0.00038314, 0.00023472, 7.27286819, 0.99882964, 0.99938214, 0.49324576],
+                             [- 6.27325145, -0.00038309, 0.00023469, 7.27286835, 0.99882978, 0.99938222, 0.49324581],
+                             [- 6.27325156, -0.00038305, 0.00023466, 7.27286851, 0.99882993, 0.99938229, 0.49324590],
+                             [- 6.27325168, -0.00038300, 0.00023463, 7.27286868, 0.99883007, 0.99938237, 0.49324573],
+                             [- 6.27325179, -0.00038295, 0.00023460, 7.27286884, 0.99883021, 0.99938245, 0.49324578],
+                             [- 6.27325190, -0.00038291, 0.00023457, 7.27286900, 0.99883036, 0.99938252, 0.49324585],
+                             [- 6.27325202, -0.00038286, 0.00023454, 7.27286916, 0.99883050, 0.99938260, 0.49324579],
+                             [- 6.27325213, -0.00038281, 0.00023451, 7.27286932, 0.99883065, 0.99938268, 0.49324589],
+                             [- 6.27325224, -0.00038276, 0.00023448, 7.27286948, 0.99883079, 0.99938275, 0.49324588],
+                             [- 6.27325236, -0.00038272, 0.00023446, 7.27286964, 0.99883094, 0.99938283, 0.49324586],
+                             [- 6.27325247, -0.00038267, 0.00023443, 7.27286980, 0.99883108, 0.99938291, 0.49324588],
+                             [- 6.27325258, -0.00038262, 0.00023440, 7.27286996, 0.99883123, 0.99938298, 0.49324600],
+                             [- 6.27325269, -0.00038257, 0.00023437, 7.27287012, 0.99883137, 0.99938306, 0.49324602],
+                             [- 6.27325281, -0.00038253, 0.00023434, 7.27287028, 0.99883152, 0.99938313, 0.49324593],
+                             [- 6.27325292, -0.00038248, 0.00023431, 7.27287044, 0.99883166, 0.99938321, 0.49324600],
+                             [- 6.27325303, -0.00038243, 0.00023428, 7.27287060, 0.99883180, 0.99938329, 0.49324594],
+                             [- 6.27325315, -0.00038238, 0.00023425, 7.27287076, 0.99883195, 0.99938336, 0.49324594],
+                             [- 6.27325326, -0.00038234, 0.00023422, 7.27287092, 0.99883209, 0.99938344, 0.49324616],
+                             [- 6.27325337, -0.00038229, 0.00023419, 7.27287108, 0.99883224, 0.99938352, 0.49324609],
+                             [- 6.27325349, -0.00038224, 0.00023417, 7.27287124, 0.99883238, 0.99938359, 0.49324615],
+                             [- 6.27325360, -0.00038220, 0.00023414, 7.27287140, 0.99883253, 0.99938367, 0.49324616],
+                             [- 6.27325371, -0.00038215, 0.00023411, 7.27287156, 0.99883267, 0.99938374, 0.49324616],
+                             [- 6.27325383, -0.00038210, 0.00023408, 7.27287172, 0.99883281, 0.99938382, 0.49324603],
+                             [- 6.27325394, -0.00038205, 0.00023405, 7.27287188, 0.99883296, 0.99938390, 0.49324614],
+                             [- 6.27325405, -0.00038201, 0.00023402, 7.27287204, 0.99883310, 0.99938397, 0.49324629],
+                             [- 6.27325416, -0.00038196, 0.00023399, 7.27287220, 0.99883325, 0.99938405, 0.49324628],
+                             [- 6.27325428, -0.00038191, 0.00023396, 7.27287236, 0.99883339, 0.99938412, 0.49324634],
+                             [- 6.27325439, -0.00038187, 0.00023393, 7.27287252, 0.99883353, 0.99938420, 0.49324618],
+                             [- 6.27325450, -0.00038182, 0.00023391, 7.27287268, 0.99883368, 0.99938428, 0.49324620],
+                             [- 6.27325462, -0.00038177, 0.00023388, 7.27287284, 0.99883382, 0.99938435, 0.49324621],
+                             [- 6.27325473, -0.00038172, 0.00023385, 7.27287300, 0.99883397, 0.99938443, 0.49324620],
+                             [- 6.27325484, -0.00038168, 0.00023382, 7.27287316, 0.99883411, 0.99938450, 0.49324631],
+                             [- 6.27325495, -0.00038163, 0.00023379, 7.27287332, 0.99883425, 0.99938458, 0.49324616],
+                             [- 6.27325507, -0.00038158, 0.00023376, 7.27287348, 0.99883440, 0.99938466, 0.49324629],
+                             [- 6.27325518, -0.00038154, 0.00023373, 7.27287364, 0.99883454, 0.99938473, 0.49324635],
+                             [- 6.27325529, -0.00038149, 0.00023370, 7.27287380, 0.99883469, 0.99938481, 0.49324648],
+                             [- 6.27325540, -0.00038144, 0.00023367, 7.27287396, 0.99883483, 0.99938488, 0.49324638],
+                             [- 6.27325552, -0.00038140, 0.00023365, 7.27287412, 0.99883497, 0.99938496, 0.49324637],
+                             [- 6.27325563, -0.00038135, 0.00023362, 7.27287428, 0.99883512, 0.99938503, 0.49324641],
+                             [- 6.27325574, -0.00038130, 0.00023359, 7.27287444, 0.99883526, 0.99938511, 0.49324645],
+                             [- 6.27325585, -0.00038125, 0.00023356, 7.27287460, 0.99883540, 0.99938519, 0.49324647],
+                             [- 6.27325597, -0.00038121, 0.00023353, 7.27287476, 0.99883555, 0.99938526, 0.49324642],
+                             [- 6.27325608, -0.00038116, 0.00023350, 7.27287492, 0.99883569, 0.99938534, 0.49324651],
+                             [- 6.27325619, -0.00038111, 0.00023347, 7.27287508, 0.99883583, 0.99938541, 0.49324649],
+                             [- 6.27325630, -0.00038107, 0.00023344, 7.27287524, 0.99883598, 0.99938549, 0.49324647],
+                             [- 6.27325642, -0.00038102, 0.00023342, 7.27287540, 0.99883612, 0.99938556, 0.49324658],
+                             [- 6.27325653, -0.00038097, 0.00023339, 7.27287555, 0.99883626, 0.99938564, 0.49324664],
+                             [- 6.27325664, -0.00038093, 0.00023336, 7.27287571, 0.99883641, 0.99938572, 0.49324649],
+                             [- 6.27325675, -0.00038088, 0.00023333, 7.27287587, 0.99883655, 0.99938579, 0.49324658],
+                             [- 6.27325686, -0.00038083, 0.00023330, 7.27287603, 0.99883669, 0.99938587, 0.49324653],
+                             [- 6.27325698, -0.00038079, 0.00023327, 7.27287619, 0.99883684, 0.99938594, 0.49324658],
+                             [- 6.27325709, -0.00038074, 0.00023324, 7.27287635, 0.99883698, 0.99938602, 0.49324649],
+                             [- 6.27325720, -0.00038069, 0.00023321, 7.27287651, 0.99883712, 0.99938609, 0.49324663],
+                             [- 6.27325731, -0.00038065, 0.00023319, 7.27287667, 0.99883727, 0.99938617, 0.49324670],
+                             [- 6.27325742, -0.00038060, 0.00023316, 7.27287683, 0.99883741, 0.99938624, 0.49324665],
+                             [- 6.27325754, -0.00038055, 0.00023313, 7.27287699, 0.99883755, 0.99938632, 0.49324681],
+                             [- 6.27325765, -0.00038050, 0.00023310, 7.27287714, 0.99883769, 0.99938640, 0.49324678],
+                             [- 6.27325776, -0.00038046, 0.00023307, 7.27287730, 0.99883784, 0.99938647, 0.49324668],
+                             [- 6.27325787, -0.00038041, 0.00023304, 7.27287746, 0.99883798, 0.99938655, 0.49324676],
+                             [- 6.27325798, -0.00038036, 0.00023301, 7.27287762, 0.99883812, 0.99938662, 0.49324679],
+                             [- 6.27325810, -0.00038032, 0.00023299, 7.27287778, 0.99883827, 0.99938670, 0.49324680],
+                             [- 6.27325821, -0.00038027, 0.00023296, 7.27287794, 0.99883841, 0.99938677, 0.49324686],
+                             [- 6.27325832, -0.00038022, 0.00023293, 7.27287810, 0.99883855, 0.99938685, 0.49324703],
+                             [- 6.27325843, -0.00038018, 0.00023290, 7.27287825, 0.99883869, 0.99938692, 0.49324683],
+                             [- 6.27325854, -0.00038013, 0.00023287, 7.27287841, 0.99883884, 0.99938700, 0.49324688],
+                             [- 6.27325866, -0.00038008, 0.00023284, 7.27287857, 0.99883898, 0.99938707, 0.49324687],
+                             [- 6.27325877, -0.00038004, 0.00023281, 7.27287873, 0.99883912, 0.99938715, 0.49324692],
+                             [- 6.27325888, -0.00037999, 0.00023279, 7.27287889, 0.99883926, 0.99938722, 0.49324678],
+                             [- 6.27325899, -0.00037994, 0.00023276, 7.27287905, 0.99883941, 0.99938730, 0.49324693],
+                             [- 6.27325910, -0.00037990, 0.00023273, 7.27287920, 0.99883955, 0.99938737, 0.49324693],
+                             [- 6.27325921, -0.00037985, 0.00023270, 7.27287936, 0.99883969, 0.99938745, 0.49324695],
+                             [- 6.27325932, -0.00037980, 0.00023267, 7.27287952, 0.99883983, 0.99938752, 0.49324704],
+                             [- 6.27325944, -0.00037976, 0.00023264, 7.27287968, 0.99883998, 0.99938760, 0.49324699],
+                             [- 6.27325955, -0.00037971, 0.00023261, 7.27287984, 0.99884012, 0.99938768, 0.49324702],
+                             [- 6.27325966, -0.00037966, 0.00023259, 7.27287999, 0.99884026, 0.99938775, 0.49324694],
+                             [- 6.27325977, -0.00037962, 0.00023256, 7.27288015, 0.99884040, 0.99938783, 0.49324708],
+                             [- 6.27325988, -0.00037957, 0.00023253, 7.27288031, 0.99884055, 0.99938790, 0.49324716],
+                             [- 6.27325999, -0.00037953, 0.00023250, 7.27288047, 0.99884069, 0.99938798, 0.49324712],
+                             [- 6.27326011, -0.00037948, 0.00023247, 7.27288063, 0.99884083, 0.99938805, 0.49324715],
+                             [- 6.27326022, -0.00037943, 0.00023244, 7.27288078, 0.99884097, 0.99938813, 0.49324707],
+                             [- 6.27326033, -0.00037939, 0.00023241, 7.27288094, 0.99884111, 0.99938820, 0.49324704],
+                             [- 6.27326044, -0.00037934, 0.00023239, 7.27288110, 0.99884126, 0.99938828, 0.49324718],
+                             [- 6.27326055, -0.00037929, 0.00023236, 7.27288126, 0.99884140, 0.99938835, 0.49324714],
+                             [- 6.27326066, -0.00037925, 0.00023233, 7.27288142, 0.99884154, 0.99938843, 0.49324726],
+                             [- 6.27326077, -0.00037920, 0.00023230, 7.27288157, 0.99884168, 0.99938850, 0.49324702],
+                             [- 6.27326088, -0.00037915, 0.00023227, 7.27288173, 0.99884182, 0.99938858, 0.49324721],
+                             [- 6.27326100, -0.00037911, 0.00023224, 7.27288189, 0.99884197, 0.99938865, 0.49324723],
+                             [- 6.27326111, -0.00037906, 0.00023221, 7.27288205, 0.99884211, 0.99938873, 0.49324718],
+                             [- 6.27326122, -0.00037901, 0.00023219, 7.27288220, 0.99884225, 0.99938880, 0.49324712],
+                             [- 6.27326133, -0.00037897, 0.00023216, 7.27288236, 0.99884239, 0.99938887, 0.49324742],
+                             [- 6.27326144, -0.00037892, 0.00023213, 7.27288252, 0.99884253, 0.99938895, 0.49324731],
+                             [- 6.27326155, -0.00037887, 0.00023210, 7.27288268, 0.99884267, 0.99938902, 0.49324731],
+                             [- 6.27326166, -0.00037883, 0.00023207, 7.27288283, 0.99884282, 0.99938910, 0.49324735],
+                             [- 6.27326177, -0.00037878, 0.00023204, 7.27288299, 0.99884296, 0.99938917, 0.49324724],
+                             [- 6.27326188, -0.00037874, 0.00023202, 7.27288315, 0.99884310, 0.99938925, 0.49324733],
+                             [- 6.27326199, -0.00037869, 0.00023199, 7.27288331, 0.99884324, 0.99938932, 0.49324726],
+                             [- 6.27326211, -0.00037864, 0.00023196, 7.27288346, 0.99884338, 0.99938940, 0.49324734],
+                             [- 6.27326222, -0.00037860, 0.00023193, 7.27288362, 0.99884352, 0.99938947, 0.49324737],
+                             [- 6.27326233, -0.00037855, 0.00023190, 7.27288378, 0.99884367, 0.99938955, 0.49324746],
+                             [- 6.27326244, -0.00037850, 0.00023187, 7.27288393, 0.99884381, 0.99938962, 0.49324742],
+                             [- 6.27326255, -0.00037846, 0.00023185, 7.27288409, 0.99884395, 0.99938970, 0.49324750],
+                             [- 6.27326266, -0.00037841, 0.00023182, 7.27288425, 0.99884409, 0.99938977, 0.49324754],
+                             [- 6.27326277, -0.00037837, 0.00023179, 7.27288441, 0.99884423, 0.99938985, 0.49324741],
+                             [- 6.27326288, -0.00037832, 0.00023176, 7.27288456, 0.99884437, 0.99938992, 0.49324760],
+                             [- 6.27326299, -0.00037827, 0.00023173, 7.27288472, 0.99884451, 0.99939000, 0.49324751],
+                             [- 6.27326310, -0.00037823, 0.00023170, 7.27288488, 0.99884466, 0.99939007, 0.49324747],
+                             [- 6.27326321, -0.00037818, 0.00023168, 7.27288503, 0.99884480, 0.99939014, 0.49324756],
+                             [- 6.27326332, -0.00037813, 0.00023165, 7.27288519, 0.99884494, 0.99939022, 0.49324744],
+                             [- 6.27326343, -0.00037809, 0.00023162, 7.27288535, 0.99884508, 0.99939029, 0.49324765],
+                             [- 6.27326354, -0.00037804, 0.00023159, 7.27288550, 0.99884522, 0.99939037, 0.49324755],
+                             [- 6.27326366, -0.00037800, 0.00023156, 7.27288566, 0.99884536, 0.99939044, 0.49324760],
+                             [- 6.27326377, -0.00037795, 0.00023153, 7.27288582, 0.99884550, 0.99939052, 0.49324764],
+                             [- 6.27326388, -0.00037790, 0.00023151, 7.27288597, 0.99884564, 0.99939059, 0.49324764],
+                             [- 6.27326399, -0.00037786, 0.00023148, 7.27288613, 0.99884578, 0.99939067, 0.49324768],
+                             [- 6.27326410, -0.00037781, 0.00023145, 7.27288629, 0.99884592, 0.99939074, 0.49324772],
+                             [- 6.27326421, -0.00037777, 0.00023142, 7.27288644, 0.99884607, 0.99939081, 0.49324775],
+                             [- 6.27326432, -0.00037772, 0.00023139, 7.27288660, 0.99884621, 0.99939089, 0.49324763],
+                             [- 6.27326443, -0.00037767, 0.00023136, 7.27288676, 0.99884635, 0.99939096, 0.49324773],
+                             [- 6.27326454, -0.00037763, 0.00023134, 7.27288691, 0.99884649, 0.99939104, 0.49324770],
+                             [- 6.27326465, -0.00037758, 0.00023131, 7.27288707, 0.99884663, 0.99939111, 0.49324772],
+                             [- 6.27326476, -0.00037753, 0.00023128, 7.27288722, 0.99884677, 0.99939119, 0.49324778],
+                             [- 6.27326487, -0.00037749, 0.00023125, 7.27288738, 0.99884691, 0.99939126, 0.49324783],
+                             [- 6.27326498, -0.00037744, 0.00023122, 7.27288754, 0.99884705, 0.99939133, 0.49324780],
+                             [- 6.27326509, -0.00037740, 0.00023120, 7.27288769, 0.99884719, 0.99939141, 0.49324776],
+                             [- 6.27326520, -0.00037735, 0.00023117, 7.27288785, 0.99884733, 0.99939148, 0.49324786],
+                             [- 6.27326531, -0.00037730, 0.00023114, 7.27288801, 0.99884747, 0.99939156, 0.49324788],
+                             [- 6.27326542, -0.00037726, 0.00023111, 7.27288816, 0.99884761, 0.99939163, 0.49324776],
+                             [- 6.27326553, -0.00037721, 0.00023108, 7.27288832, 0.99884775, 0.99939171, 0.49324788],
+                             [- 6.27326564, -0.00037717, 0.00023105, 7.27288847, 0.99884789, 0.99939178, 0.49324801],
+                             [- 6.27326575, -0.00037712, 0.00023103, 7.27288863, 0.99884803, 0.99939185, 0.49324790],
+                             [- 6.27326586, -0.00037707, 0.00023100, 7.27288879, 0.99884817, 0.99939193, 0.49324783],
+                             [- 6.27326597, -0.00037703, 0.00023097, 7.27288894, 0.99884831, 0.99939200, 0.49324795],
+                             [- 6.27326608, -0.00037698, 0.00023094, 7.27288910, 0.99884846, 0.99939208, 0.49324808],
+                             [- 6.27326619, -0.00037694, 0.00023091, 7.27288925, 0.99884860, 0.99939215, 0.49324796],
+                             [- 6.27326630, -0.00037689, 0.00023089, 7.27288941, 0.99884874, 0.99939222, 0.49324802],
+                             [- 6.27326641, -0.00037685, 0.00023086, 7.27288956, 0.99884888, 0.99939230, 0.49324786],
+                             [- 6.27326652, -0.00037680, 0.00023083, 7.27288972, 0.99884902, 0.99939237, 0.49324795],
+                             [- 6.27326663, -0.00037675, 0.00023080, 7.27288988, 0.99884916, 0.99939245, 0.49324822],
+                             [- 6.27326674, -0.00037671, 0.00023077, 7.27289003, 0.99884930, 0.99939252, 0.49324803],
+                             [- 6.27326685, -0.00037666, 0.00023074, 7.27289019, 0.99884944, 0.99939259, 0.49324799],
+                             [- 6.27326696, -0.00037662, 0.00023072, 7.27289034, 0.99884958, 0.99939267, 0.49324798],
+                             [- 6.27326707, -0.00037657, 0.00023069, 7.27289050, 0.99884972, 0.99939274, 0.49324802],
+                             [- 6.27326718, -0.00037652, 0.00023066, 7.27289065, 0.99884986, 0.99939282, 0.49324803],
+                             [- 6.27326729, -0.00037648, 0.00023063, 7.27289081, 0.99885000, 0.99939289, 0.49324811],
+                             [- 6.27326740, -0.00037643, 0.00023060, 7.27289096, 0.99885014, 0.99939296, 0.49324817],
+                             [- 6.27326751, -0.00037639, 0.00023058, 7.27289112, 0.99885028, 0.99939304, 0.49324821],
+                             [- 6.27326762, -0.00037634, 0.00023055, 7.27289127, 0.99885042, 0.99939311, 0.49324821],
+                             [- 6.27326773, -0.00037630, 0.00023052, 7.27289143, 0.99885056, 0.99939318, 0.49324827],
+                             [- 6.27326783, -0.00037625, 0.00023049, 7.27289159, 0.99885070, 0.99939326, 0.49324820],
+                             [- 6.27326794, -0.00037620, 0.00023046, 7.27289174, 0.99885084, 0.99939333, 0.49324832],
+                             [- 6.27326805, -0.00037616, 0.00023044, 7.27289190, 0.99885097, 0.99939341, 0.49324834],
+                             [- 6.27326816, -0.00037611, 0.00023041, 7.27289205, 0.99885111, 0.99939348, 0.49324841],
+                             [- 6.27326827, -0.00037607, 0.00023038, 7.27289221, 0.99885125, 0.99939355, 0.49324834],
+                             [- 6.27326838, -0.00037602, 0.00023035, 7.27289236, 0.99885139, 0.99939363, 0.49324834],
+                             [- 6.27326849, -0.00037598, 0.00023032, 7.27289252, 0.99885153, 0.99939370, 0.49324836],
+                             [- 6.27326860, -0.00037593, 0.00023030, 7.27289267, 0.99885167, 0.99939377, 0.49324838],
+                             [- 6.27326871, -0.00037588, 0.00023027, 7.27289283, 0.99885181, 0.99939385, 0.49324843],
+                             [- 6.27326882, -0.00037584, 0.00023024, 7.27289298, 0.99885195, 0.99939392, 0.49324818],
+                             [- 6.27326893, -0.00037579, 0.00023021, 7.27289314, 0.99885209, 0.99939399, 0.49324852],
+                             [- 6.27326904, -0.00037575, 0.00023018, 7.27289329, 0.99885223, 0.99939407, 0.49324850],
+                             [- 6.27326915, -0.00037570, 0.00023016, 7.27289345, 0.99885237, 0.99939414, 0.49324851],
+                             [- 6.27326926, -0.00037566, 0.00023013, 7.27289360, 0.99885251, 0.99939422, 0.49324838],
+                             [- 6.27326937, -0.00037561, 0.00023010, 7.27289375, 0.99885265, 0.99939429, 0.49324847],
+                             [- 6.27326947, -0.00037557, 0.00023007, 7.27289391, 0.99885279, 0.99939436, 0.49324849],
+                             [- 6.27326958, -0.00037552, 0.00023004, 7.27289406, 0.99885293, 0.99939444, 0.49324851],
+                             [- 6.27326969, -0.00037547, 0.00023002, 7.27289422, 0.99885307, 0.99939451, 0.49324844],
+                             [- 6.27326980, -0.00037543, 0.00022999, 7.27289437, 0.99885321, 0.99939458, 0.49324862],
+                             [- 6.27326991, -0.00037538, 0.00022996, 7.27289453, 0.99885334, 0.99939466, 0.49324845],
+                             [- 6.27327002, -0.00037534, 0.00022993, 7.27289468, 0.99885348, 0.99939473, 0.49324866],
+                             [- 6.27327013, -0.00037529, 0.00022991, 7.27289484, 0.99885362, 0.99939480, 0.49324850],
+                             [- 6.27327024, -0.00037525, 0.00022988, 7.27289499, 0.99885376, 0.99939488, 0.49324874],
+                             [- 6.27327035, -0.00037520, 0.00022985, 7.27289514, 0.99885390, 0.99939495, 0.49324863],
+                             [- 6.27327045, -0.00037516, 0.00022982, 7.27289530, 0.99885404, 0.99939502, 0.49324861],
+                             [- 6.27327056, -0.00037511, 0.00022979, 7.27289545, 0.99885418, 0.99939510, 0.49324863],
+                             [- 6.27327067, -0.00037506, 0.00022977, 7.27289561, 0.99885432, 0.99939517, 0.49324878],
+                             [- 6.27327078, -0.00037502, 0.00022974, 7.27289576, 0.99885446, 0.99939524, 0.49324852],
+                             [- 6.27327089, -0.00037497, 0.00022971, 7.27289592, 0.99885459, 0.99939532, 0.49324868],
+                             [- 6.27327100, -0.00037493, 0.00022968, 7.27289607, 0.99885473, 0.99939539, 0.49324870],
+                             [- 6.27327111, -0.00037488, 0.00022965, 7.27289622, 0.99885487, 0.99939546, 0.49324867],
+                             [- 6.27327122, -0.00037484, 0.00022963, 7.27289638, 0.99885501, 0.99939554, 0.49324861],
+                             [- 6.27327132, -0.00037479, 0.00022960, 7.27289653, 0.99885515, 0.99939561, 0.49324879],
+                             [- 6.27327143, -0.00037475, 0.00022957, 7.27289669, 0.99885529, 0.99939568, 0.49324878],
+                             [- 6.27327154, -0.00037470, 0.00022954, 7.27289684, 0.99885543, 0.99939576, 0.49324873],
+                             [- 6.27327165, -0.00037466, 0.00022952, 7.27289699, 0.99885557, 0.99939583, 0.49324877],
+                             [- 6.27327176, -0.00037461, 0.00022949, 7.27289715, 0.99885570, 0.99939590, 0.49324893],
+                             [- 6.27327187, -0.00037457, 0.00022946, 7.27289730, 0.99885584, 0.99939597, 0.49324876],
+                             [- 6.27327198, -0.00037452, 0.00022943, 7.27289746, 0.99885598, 0.99939605, 0.49324876],
+                             [- 6.27327208, -0.00037447, 0.00022940, 7.27289761, 0.99885612, 0.99939612, 0.49324883],
+                             [- 6.27327219, -0.00037443, 0.00022938, 7.27289776, 0.99885626, 0.99939619, 0.49324897],
+                             [- 6.27327230, -0.00037438, 0.00022935, 7.27289792, 0.99885640, 0.99939627, 0.49324903],
+                             [- 6.27327241, -0.00037434, 0.00022932, 7.27289807, 0.99885653, 0.99939634, 0.49324897],
+                             [- 6.27327252, -0.00037429, 0.00022929, 7.27289822, 0.99885667, 0.99939641, 0.49324915],
+                             [- 6.27327263, -0.00037425, 0.00022927, 7.27289838, 0.99885681, 0.99939649, 0.49324899],
+                             [- 6.27327273, -0.00037420, 0.00022924, 7.27289853, 0.99885695, 0.99939656, 0.49324895],
+                             [- 6.27327284, -0.00037416, 0.00022921, 7.27289869, 0.99885709, 0.99939663, 0.49324901],
+                             [- 6.27327295, -0.00037411, 0.00022918, 7.27289884, 0.99885723, 0.99939671, 0.49324899],
+                             [- 6.27327306, -0.00037407, 0.00022915, 7.27289899, 0.99885736, 0.99939678, 0.49324910],
+                             [- 6.27327317, -0.00037402, 0.00022913, 7.27289915, 0.99885750, 0.99939685, 0.49324893],
+                             [- 6.27327328, -0.00037398, 0.00022910, 7.27289930, 0.99885764, 0.99939692, 0.49324897],
+                             [- 6.27327338, -0.00037393, 0.00022907, 7.27289945, 0.99885778, 0.99939700, 0.49324903],
+                             [- 6.27327349, -0.00037389, 0.00022904, 7.27289961, 0.99885792, 0.99939707, 0.49324907],
+                             [- 6.27327360, -0.00037384, 0.00022902, 7.27289976, 0.99885805, 0.99939714, 0.49324912],
+                             [- 6.27327371, -0.00037380, 0.00022899, 7.27289991, 0.99885819, 0.99939722, 0.49324911],
+                             [- 6.27327382, -0.00037375, 0.00022896, 7.27290007, 0.99885833, 0.99939729, 0.49324918],
+                             [- 6.27327392, -0.00037371, 0.00022893, 7.27290022, 0.99885847, 0.99939736, 0.49324911],
+                             [- 6.27327403, -0.00037366, 0.00022891, 7.27290037, 0.99885861, 0.99939743, 0.49324922],
+                             [- 6.27327414, -0.00037362, 0.00022888, 7.27290052, 0.99885874, 0.99939751, 0.49324912],
+                             [- 6.27327425, -0.00037357, 0.00022885, 7.27290068, 0.99885888, 0.99939758, 0.49324914],
+                             [- 6.27327436, -0.00037353, 0.00022882, 7.27290083, 0.99885902, 0.99939765, 0.49324919],
+                             [- 6.27327446, -0.00037348, 0.00022880, 7.27290098, 0.99885916, 0.99939772, 0.49324915],
+                             [- 6.27327457, -0.00037344, 0.00022877, 7.27290114, 0.99885929, 0.99939780, 0.49324920],
+                             [- 6.27327468, -0.00037339, 0.00022874, 7.27290129, 0.99885943, 0.99939787, 0.49324914],
+                             [- 6.27327479, -0.00037335, 0.00022871, 7.27290144, 0.99885957, 0.99939794, 0.49324927],
+                             [- 6.27327490, -0.00037330, 0.00022868, 7.27290160, 0.99885971, 0.99939801, 0.49324924],
+                             [- 6.27327500, -0.00037326, 0.00022866, 7.27290175, 0.99885984, 0.99939809, 0.49324926],
+                             [- 6.27327511, -0.00037321, 0.00022863, 7.27290190, 0.99885998, 0.99939816, 0.49324920],
+                             [- 6.27327522, -0.00037317, 0.00022860, 7.27290205, 0.99886012, 0.99939823, 0.49324932],
+                             [- 6.27327533, -0.00037312, 0.00022857, 7.27290221, 0.99886026, 0.99939831, 0.49324939],
+                             [- 6.27327543, -0.00037308, 0.00022855, 7.27290236, 0.99886039, 0.99939838, 0.49324946],
+                             [- 6.27327554, -0.00037303, 0.00022852, 7.27290251, 0.99886053, 0.99939845, 0.49324935],
+                             [- 6.27327565, -0.00037299, 0.00022849, 7.27290266, 0.99886067, 0.99939852, 0.49324930],
+                             [- 6.27327576, -0.00037294, 0.00022846, 7.27290282, 0.99886081, 0.99939860, 0.49324950],
+                             [- 6.27327586, -0.00037290, 0.00022844, 7.27290297, 0.99886094, 0.99939867, 0.49324938],
+                             [- 6.27327597, -0.00037285, 0.00022841, 7.27290312, 0.99886108, 0.99939874, 0.49324942],
+                             [- 6.27327608, -0.00037281, 0.00022838, 7.27290327, 0.99886122, 0.99939881, 0.49324944],
+                             [- 6.27327619, -0.00037276, 0.00022835, 7.27290343, 0.99886136, 0.99939888, 0.49324942],
+                             [- 6.27327629, -0.00037272, 0.00022833, 7.27290358, 0.99886149, 0.99939896, 0.49324940],
+                             [- 6.27327640, -0.00037267, 0.00022830, 7.27290373, 0.99886163, 0.99939903, 0.49324954],
+                             [- 6.27327651, -0.00037263, 0.00022827, 7.27290388, 0.99886177, 0.99939910, 0.49324936],
+                             [- 6.27327662, -0.00037258, 0.00022824, 7.27290404, 0.99886190, 0.99939917, 0.49324945],
+                             [- 6.27327672, -0.00037254, 0.00022822, 7.27290419, 0.99886204, 0.99939925, 0.49324953],
+                             [- 6.27327683, -0.00037249, 0.00022819, 7.27290434, 0.99886218, 0.99939932, 0.49324957],
+                             [- 6.27327694, -0.00037245, 0.00022816, 7.27290449, 0.99886231, 0.99939939, 0.49324952],
+                             [- 6.27327705, -0.00037240, 0.00022813, 7.27290464, 0.99886245, 0.99939946, 0.49324959],
+                             [- 6.27327715, -0.00037236, 0.00022811, 7.27290480, 0.99886259, 0.99939954, 0.49324957],
+                             [- 6.27327726, -0.00037231, 0.00022808, 7.27290495, 0.99886273, 0.99939961, 0.49324964],
+                             [- 6.27327737, -0.00037227, 0.00022805, 7.27290510, 0.99886286, 0.99939968, 0.49324963],
+                             [- 6.27327747, -0.00037222, 0.00022802, 7.27290525, 0.99886300, 0.99939975, 0.49324974],
+                             [- 6.27327758, -0.00037218, 0.00022800, 7.27290540, 0.99886314, 0.99939982, 0.49324966],
+                             [- 6.27327769, -0.00037213, 0.00022797, 7.27290556, 0.99886327, 0.99939990, 0.49324952],
+                             [- 6.27327780, -0.00037209, 0.00022794, 7.27290571, 0.99886341, 0.99939997, 0.49324969],
+                             [- 6.27327790, -0.00037204, 0.00022791, 7.27290586, 0.99886355, 0.99940004, 0.49324970],
+                             [- 6.27327801, -0.00037200, 0.00022789, 7.27290601, 0.99886368, 0.99940011, 0.49324976],
+                             [- 6.27327812, -0.00037195, 0.00022786, 7.27290616, 0.99886382, 0.99940019, 0.49324984],
+                             [- 6.27327822, -0.00037191, 0.00022783, 7.27290631, 0.99886396, 0.99940026, 0.49324963],
+                             [- 6.27327833, -0.00037187, 0.00022781, 7.27290647, 0.99886409, 0.99940033, 0.49324968],
+                             [- 6.27327844, -0.00037182, 0.00022778, 7.27290662, 0.99886423, 0.99940040, 0.49324978],
+                             [- 6.27327855, -0.00037178, 0.00022775, 7.27290677, 0.99886436, 0.99940047, 0.49324985],
+                             [- 6.27327865, -0.00037173, 0.00022772, 7.27290692, 0.99886450, 0.99940055, 0.49325000],
+                             [- 6.27327876, -0.00037169, 0.00022770, 7.27290707, 0.99886464, 0.99940062, 0.49324984],
+                             [- 6.27327887, -0.00037164, 0.00022767, 7.27290722, 0.99886477, 0.99940069, 0.49324982],
+                             [- 6.27327897, -0.00037160, 0.00022764, 7.27290737, 0.99886491, 0.99940076, 0.49324988],
+                             [- 6.27327908, -0.00037155, 0.00022761, 7.27290753, 0.99886505, 0.99940083, 0.49325015],
+                             [- 6.27327919, -0.00037151, 0.00022759, 7.27290768, 0.99886518, 0.99940091, 0.49324977],
+                             [- 6.27327929, -0.00037146, 0.00022756, 7.27290783, 0.99886532, 0.99940098, 0.49324993],
+                             [- 6.27327940, -0.00037142, 0.00022753, 7.27290798, 0.99886546, 0.99940105, 0.49325002],
+                             [- 6.27327951, -0.00037137, 0.00022750, 7.27290813, 0.99886559, 0.99940112, 0.49324999],
+                             [- 6.27327961, -0.00037133, 0.00022748, 7.27290828, 0.99886573, 0.99940119, 0.49325000],
+                             [- 6.27327972, -0.00037129, 0.00022745, 7.27290843, 0.99886586, 0.99940126, 0.49325006],
+                             [- 6.27327983, -0.00037124, 0.00022742, 7.27290858, 0.99886600, 0.99940134, 0.49324994],
+                             [- 6.27327993, -0.00037120, 0.00022740, 7.27290874, 0.99886614, 0.99940141, 0.49324986],
+                             [- 6.27328004, -0.00037115, 0.00022737, 7.27290889, 0.99886627, 0.99940148, 0.49325009],
+                             [- 6.27328015, -0.00037111, 0.00022734, 7.27290904, 0.99886641, 0.99940155, 0.49325012],
+                             [- 6.27328025, -0.00037106, 0.00022731, 7.27290919, 0.99886654, 0.99940162, 0.49325015],
+                             [- 6.27328036, -0.00037102, 0.00022729, 7.27290934, 0.99886668, 0.99940170, 0.49325010],
+                             [- 6.27328047, -0.00037097, 0.00022726, 7.27290949, 0.99886682, 0.99940177, 0.49325020],
+                             [- 6.27328057, -0.00037093, 0.00022723, 7.27290964, 0.99886695, 0.99940184, 0.49325004],
+                             [- 6.27328068, -0.00037089, 0.00022720, 7.27290979, 0.99886709, 0.99940191, 0.49325014],
+                             [- 6.27328078, -0.00037084, 0.00022718, 7.27290994, 0.99886722, 0.99940198, 0.49325025],
+                             [- 6.27328089, -0.00037080, 0.00022715, 7.27291009, 0.99886736, 0.99940205, 0.49325008],
+                             [- 6.27328100, -0.00037075, 0.00022712, 7.27291024, 0.99886749, 0.99940213, 0.49325032],
+                             [- 6.27328110, -0.00037071, 0.00022710, 7.27291040, 0.99886763, 0.99940220, 0.49325016],
+                             [- 6.27328121, -0.00037066, 0.00022707, 7.27291055, 0.99886777, 0.99940227, 0.49325010],
+                             [- 6.27328132, -0.00037062, 0.00022704, 7.27291070, 0.99886790, 0.99940234, 0.49325006],
+                             [- 6.27328142, -0.00037057, 0.00022701, 7.27291085, 0.99886804, 0.99940241, 0.49325022],
+                             [- 6.27328153, -0.00037053, 0.00022699, 7.27291100, 0.99886817, 0.99940248, 0.49325031],
+                             [- 6.27328163, -0.00037049, 0.00022696, 7.27291115, 0.99886831, 0.99940255, 0.49325037],
+                             [- 6.27328174, -0.00037044, 0.00022693, 7.27291130, 0.99886844, 0.99940263, 0.49325027],
+                             [- 6.27328185, -0.00037040, 0.00022691, 7.27291145, 0.99886858, 0.99940270, 0.49325034],
+                             [- 6.27328195, -0.00037035, 0.00022688, 7.27291160, 0.99886871, 0.99940277, 0.49325020],
+                             [- 6.27328206, -0.00037031, 0.00022685, 7.27291175, 0.99886885, 0.99940284, 0.49325035],
+                             [- 6.27328217, -0.00037026, 0.00022682, 7.27291190, 0.99886898, 0.99940291, 0.49325022],
+                             [- 6.27328227, -0.00037022, 0.00022680, 7.27291205, 0.99886912, 0.99940298, 0.49325038],
+                             [- 6.27328238, -0.00037018, 0.00022677, 7.27291220, 0.99886926, 0.99940305, 0.49325045],
+                             [- 6.27328248, -0.00037013, 0.00022674, 7.27291235, 0.99886939, 0.99940313, 0.49325055],
+                             [- 6.27328259, -0.00037009, 0.00022672, 7.27291250, 0.99886953, 0.99940320, 0.49325042],
+                             [- 6.27328269, -0.00037004, 0.00022669, 7.27291265, 0.99886966, 0.99940327, 0.49325036],
+                             [- 6.27328280, -0.00037000, 0.00022666, 7.27291280, 0.99886980, 0.99940334, 0.49325057],
+                             [- 6.27328291, -0.00036995, 0.00022663, 7.27291295, 0.99886993, 0.99940341, 0.49325047],
+                             [- 6.27328301, -0.00036991, 0.00022661, 7.27291310, 0.99887007, 0.99940348, 0.49325050],
+                             [- 6.27328312, -0.00036987, 0.00022658, 7.27291325, 0.99887020, 0.99940355, 0.49325044],
+                             [- 6.27328322, -0.00036982, 0.00022655, 7.27291340, 0.99887034, 0.99940363, 0.49325060],
+                             [- 6.27328333, -0.00036978, 0.00022653, 7.27291355, 0.99887047, 0.99940370, 0.49325046],
+                             [- 6.27328344, -0.00036973, 0.00022650, 7.27291370, 0.99887061, 0.99940377, 0.49325049],
+                             [- 6.27328354, -0.00036969, 0.00022647, 7.27291385, 0.99887074, 0.99940384, 0.49325054],
+                             [- 6.27328365, -0.00036965, 0.00022644, 7.27291400, 0.99887088, 0.99940391, 0.49325051],
+                             [- 6.27328375, -0.00036960, 0.00022642, 7.27291415, 0.99887101, 0.99940398, 0.49325068],
+                             [- 6.27328386, -0.00036956, 0.00022639, 7.27291430, 0.99887115, 0.99940405, 0.49325059],
+                             [- 6.27328396, -0.00036951, 0.00022636, 7.27291445, 0.99887128, 0.99940412, 0.49325082],
+                             [- 6.27328407, -0.00036947, 0.00022634, 7.27291460, 0.99887142, 0.99940419, 0.49325077],
+                             [- 6.27328418, -0.00036942, 0.00022631, 7.27291475, 0.99887155, 0.99940427, 0.49325076],
+                             [- 6.27328428, -0.00036938, 0.00022628, 7.27291490, 0.99887168, 0.99940434, 0.49325073],
+                             [- 6.27328439, -0.00036934, 0.00022626, 7.27291505, 0.99887182, 0.99940441, 0.49325073],
+                             [- 6.27328449, -0.00036929, 0.00022623, 7.27291520, 0.99887195, 0.99940448, 0.49325059],
+                             [- 6.27328460, -0.00036925, 0.00022620, 7.27291535, 0.99887209, 0.99940455, 0.49325071],
+                             [- 6.27328470, -0.00036920, 0.00022617, 7.27291550, 0.99887222, 0.99940462, 0.49325075],
+                             [- 6.27328481, -0.00036916, 0.00022615, 7.27291565, 0.99887236, 0.99940469, 0.49325074],
+                             [- 6.27328491, -0.00036912, 0.00022612, 7.27291580, 0.99887249, 0.99940476, 0.49325076],
+                             [- 6.27328502, -0.00036907, 0.00022609, 7.27291595, 0.99887263, 0.99940483, 0.49325069],
+                             [- 6.27328512, -0.00036903, 0.00022607, 7.27291610, 0.99887276, 0.99940491, 0.49325089],
+                             [- 6.27328523, -0.00036898, 0.00022604, 7.27291624, 0.99887290, 0.99940498, 0.49325087],
+                             [- 6.27328533, -0.00036894, 0.00022601, 7.27291639, 0.99887303, 0.99940505, 0.49325089],
+                             [- 6.27328544, -0.00036890, 0.00022599, 7.27291654, 0.99887316, 0.99940512, 0.49325087],
+                             [- 6.27328555, -0.00036885, 0.00022596, 7.27291669, 0.99887330, 0.99940519, 0.49325085],
+                             [- 6.27328565, -0.00036881, 0.00022593, 7.27291684, 0.99887343, 0.99940526, 0.49325080],
+                             [- 6.27328576, -0.00036876, 0.00022590, 7.27291699, 0.99887357, 0.99940533, 0.49325071],
+                             [- 6.27328586, -0.00036872, 0.00022588, 7.27291714, 0.99887370, 0.99940540, 0.49325095],
+                             [- 6.27328597, -0.00036868, 0.00022585, 7.27291729, 0.99887384, 0.99940547, 0.49325080],
+                             [- 6.27328607, -0.00036863, 0.00022582, 7.27291744, 0.99887397, 0.99940554, 0.49325088],
+                             [- 6.27328618, -0.00036859, 0.00022580, 7.27291759, 0.99887410, 0.99940561, 0.49325100],
+                             [- 6.27328628, -0.00036855, 0.00022577, 7.27291774, 0.99887424, 0.99940568, 0.49325106],
+                             [- 6.27328639, -0.00036850, 0.00022574, 7.27291789, 0.99887437, 0.99940576, 0.49325085],
+                             [- 6.27328649, -0.00036846, 0.00022572, 7.27291803, 0.99887451, 0.99940583, 0.49325087],
+                             [- 6.27328660, -0.00036841, 0.00022569, 7.27291818, 0.99887464, 0.99940590, 0.49325084],
+                             [- 6.27328670, -0.00036837, 0.00022566, 7.27291833, 0.99887477, 0.99940597, 0.49325118],
+                             [- 6.27328681, -0.00036833, 0.00022564, 7.27291848, 0.99887491, 0.99940604, 0.49325112],
+                             [- 6.27328691, -0.00036828, 0.00022561, 7.27291863, 0.99887504, 0.99940611, 0.49325104],
+                             [- 6.27328702, -0.00036824, 0.00022558, 7.27291878, 0.99887518, 0.99940618, 0.49325104],
+                             [- 6.27328712, -0.00036819, 0.00022556, 7.27291893, 0.99887531, 0.99940625, 0.49325116],
+                             [- 6.27328723, -0.00036815, 0.00022553, 7.27291907, 0.99887544, 0.99940632, 0.49325111],
+                             [- 6.27328733, -0.00036811, 0.00022550, 7.27291922, 0.99887558, 0.99940639, 0.49325116],
+                             [- 6.27328744, -0.00036806, 0.00022547, 7.27291937, 0.99887571, 0.99940646, 0.49325108],
+                             [- 6.27328754, -0.00036802, 0.00022545, 7.27291952, 0.99887584, 0.99940653, 0.49325111],
+                             [- 6.27328764, -0.00036798, 0.00022542, 7.27291967, 0.99887598, 0.99940660, 0.49325113],
+                             [- 6.27328775, -0.00036793, 0.00022539, 7.27291982, 0.99887611, 0.99940667, 0.49325130],
+                             [- 6.27328785, -0.00036789, 0.00022537, 7.27291997, 0.99887625, 0.99940674, 0.49325114],
+                             [- 6.27328796, -0.00036784, 0.00022534, 7.27292011, 0.99887638, 0.99940681, 0.49325125],
+                             [- 6.27328806, -0.00036780, 0.00022531, 7.27292026, 0.99887651, 0.99940689, 0.49325120],
+                             [- 6.27328817, -0.00036776, 0.00022529, 7.27292041, 0.99887665, 0.99940696, 0.49325118],
+                             [- 6.27328827, -0.00036771, 0.00022526, 7.27292056, 0.99887678, 0.99940703, 0.49325120],
+                             [- 6.27328838, -0.00036767, 0.00022523, 7.27292071, 0.99887691, 0.99940710, 0.49325135],
+                             [- 6.27328848, -0.00036763, 0.00022521, 7.27292086, 0.99887705, 0.99940717, 0.49325134],
+                             [- 6.27328859, -0.00036758, 0.00022518, 7.27292100, 0.99887718, 0.99940724, 0.49325139],
+                             [- 6.27328869, -0.00036754, 0.00022515, 7.27292115, 0.99887731, 0.99940731, 0.49325135],
+                             [- 6.27328880, -0.00036749, 0.00022513, 7.27292130, 0.99887745, 0.99940738, 0.49325126],
+                             [- 6.27328890, -0.00036745, 0.00022510, 7.27292145, 0.99887758, 0.99940745, 0.49325131],
+                             [- 6.27328900, -0.00036741, 0.00022507, 7.27292160, 0.99887771, 0.99940752, 0.49325136],
+                             [- 6.27328911, -0.00036736, 0.00022505, 7.27292174, 0.99887785, 0.99940759, 0.49325152],
+                             [- 6.27328921, -0.00036732, 0.00022502, 7.27292189, 0.99887798, 0.99940766, 0.49325159],
+                             [- 6.27328932, -0.00036728, 0.00022499, 7.27292204, 0.99887811, 0.99940773, 0.49325140],
+                             [- 6.27328942, -0.00036723, 0.00022497, 7.27292219, 0.99887825, 0.99940780, 0.49325141],
+                             [- 6.27328953, -0.00036719, 0.00022494, 7.27292234, 0.99887838, 0.99940787, 0.49325131],
+                             [- 6.27328963, -0.00036715, 0.00022491, 7.27292248, 0.99887851, 0.99940794, 0.49325145],
+                             [- 6.27328973, -0.00036710, 0.00022489, 7.27292263, 0.99887864, 0.99940801, 0.49325145],
+                             [- 6.27328984, -0.00036706, 0.00022486, 7.27292278, 0.99887878, 0.99940808, 0.49325157],
+                             [- 6.27328994, -0.00036702, 0.00022483, 7.27292293, 0.99887891, 0.99940815, 0.49325149],
+                             [- 6.27329005, -0.00036697, 0.00022481, 7.27292307, 0.99887904, 0.99940822, 0.49325164],
+                             [- 6.27329015, -0.00036693, 0.00022478, 7.27292322, 0.99887918, 0.99940829, 0.49325155],
+                             [- 6.27329025, -0.00036689, 0.00022475, 7.27292337, 0.99887931, 0.99940836, 0.49325164],
+                             [- 6.27329036, -0.00036684, 0.00022473, 7.27292352, 0.99887944, 0.99940843, 0.49325151],
+                             [- 6.27329046, -0.00036680, 0.00022470, 7.27292366, 0.99887958, 0.99940850, 0.49325168],
+                             [- 6.27329057, -0.00036675, 0.00022467, 7.27292381, 0.99887971, 0.99940857, 0.49325138],
+                             [- 6.27329067, -0.00036671, 0.00022465, 7.27292396, 0.99887984, 0.99940864, 0.49325171],
+                             [- 6.27329078, -0.00036667, 0.00022462, 7.27292411, 0.99887997, 0.99940871, 0.49325159],
+                             [- 6.27329088, -0.00036662, 0.00022459, 7.27292425, 0.99888011, 0.99940878, 0.49325160],
+                             [- 6.27329098, -0.00036658, 0.00022457, 7.27292440, 0.99888024, 0.99940885, 0.49325177],
+                             [- 6.27329109, -0.00036654, 0.00022454, 7.27292455, 0.99888037, 0.99940892, 0.49325177],
+                             [- 6.27329119, -0.00036649, 0.00022451, 7.27292470, 0.99888050, 0.99940899, 0.49325164],
+                             [- 6.27329129, -0.00036645, 0.00022449, 7.27292484, 0.99888064, 0.99940906, 0.49325172],
+                             [- 6.27329140, -0.00036641, 0.00022446, 7.27292499, 0.99888077, 0.99940913, 0.49325179],
+                             [- 6.27329150, -0.00036636, 0.00022443, 7.27292514, 0.99888090, 0.99940920, 0.49325181],
+                             [- 6.27329161, -0.00036632, 0.00022441, 7.27292529, 0.99888103, 0.99940927, 0.49325178],
+                             [- 6.27329171, -0.00036628, 0.00022438, 7.27292543, 0.99888117, 0.99940934, 0.49325178],
+                             [- 6.27329181, -0.00036623, 0.00022435, 7.27292558, 0.99888130, 0.99940941, 0.49325183],
+                             [- 6.27329192, -0.00036619, 0.00022433, 7.27292573, 0.99888143, 0.99940948, 0.49325179],
+                             [- 6.27329202, -0.00036615, 0.00022430, 7.27292587, 0.99888156, 0.99940955, 0.49325183],
+                             [- 6.27329212, -0.00036610, 0.00022427, 7.27292602, 0.99888170, 0.99940962, 0.49325178],
+                             [- 6.27329223, -0.00036606, 0.00022425, 7.27292617, 0.99888183, 0.99940969, 0.49325167],
+                             [- 6.27329233, -0.00036602, 0.00022422, 7.27292631, 0.99888196, 0.99940976, 0.49325180],
+                             [- 6.27329244, -0.00036597, 0.00022419, 7.27292646, 0.99888209, 0.99940983, 0.49325201],
+                             [- 6.27329254, -0.00036593, 0.00022417, 7.27292661, 0.99888222, 0.99940990, 0.49325190],
+                             [- 6.27329264, -0.00036589, 0.00022414, 7.27292675, 0.99888236, 0.99940997, 0.49325201],
+                             [- 6.27329275, -0.00036584, 0.00022412, 7.27292690, 0.99888249, 0.99941004, 0.49325203],
+                             [- 6.27329285, -0.00036580, 0.00022409, 7.27292705, 0.99888262, 0.99941011, 0.49325195],
+                             [- 6.27329295, -0.00036576, 0.00022406, 7.27292720, 0.99888275, 0.99941018, 0.49325194],
+                             [- 6.27329306, -0.00036571, 0.00022404, 7.27292734, 0.99888289, 0.99941025, 0.49325187],
+                             [- 6.27329316, -0.00036567, 0.00022401, 7.27292749, 0.99888302, 0.99941032, 0.49325203],
+                             [- 6.27329326, -0.00036563, 0.00022398, 7.27292764, 0.99888315, 0.99941039, 0.49325193],
+                             [- 6.27329337, -0.00036559, 0.00022396, 7.27292778, 0.99888328, 0.99941046, 0.49325192],
+                             [- 6.27329347, -0.00036554, 0.00022393, 7.27292793, 0.99888341, 0.99941053, 0.49325212],
+                             [- 6.27329357, -0.00036550, 0.00022390, 7.27292807, 0.99888355, 0.99941060, 0.49325192],
+                             [- 6.27329368, -0.00036546, 0.00022388, 7.27292822, 0.99888368, 0.99941067, 0.49325204],
+                             [- 6.27329378, -0.00036541, 0.00022385, 7.27292837, 0.99888381, 0.99941074, 0.49325210],
+                             [- 6.27329388, -0.00036537, 0.00022382, 7.27292851, 0.99888394, 0.99941081, 0.49325200],
+                             [- 6.27329399, -0.00036533, 0.00022380, 7.27292866, 0.99888407, 0.99941088, 0.49325216],
+                             [- 6.27329409, -0.00036528, 0.00022377, 7.27292881, 0.99888420, 0.99941095, 0.49325212],
+                             [- 6.27329419, -0.00036524, 0.00022374, 7.27292895, 0.99888434, 0.99941102, 0.49325214],
+                             [- 6.27329430, -0.00036520, 0.00022372, 7.27292910, 0.99888447, 0.99941108, 0.49325208],
+                             [- 6.27329440, -0.00036515, 0.00022369, 7.27292925, 0.99888460, 0.99941115, 0.49325230],
+                             [- 6.27329450, -0.00036511, 0.00022367, 7.27292939, 0.99888473, 0.99941122, 0.49325225],
+                             [- 6.27329461, -0.00036507, 0.00022364, 7.27292954, 0.99888486, 0.99941129, 0.49325212],
+                             [- 6.27329471, -0.00036502, 0.00022361, 7.27292968, 0.99888499, 0.99941136, 0.49325221],
+                             [- 6.27329481, -0.00036498, 0.00022359, 7.27292983, 0.99888513, 0.99941143, 0.49325215],
+                             [- 6.27329491, -0.00036494, 0.00022356, 7.27292998, 0.99888526, 0.99941150, 0.49325228],
+                             [- 6.27329502, -0.00036490, 0.00022353, 7.27293012, 0.99888539, 0.99941157, 0.49325236],
+                             [- 6.27329512, -0.00036485, 0.00022351, 7.27293027, 0.99888552, 0.99941164, 0.49325238],
+                             [- 6.27329522, -0.00036481, 0.00022348, 7.27293041, 0.99888565, 0.99941171, 0.49325230],
+                             [- 6.27329533, -0.00036477, 0.00022345, 7.27293056, 0.99888578, 0.99941178, 0.49325233],
+                             [- 6.27329543, -0.00036472, 0.00022343, 7.27293071, 0.99888591, 0.99941185, 0.49325243],
+                             [- 6.27329553, -0.00036468, 0.00022340, 7.27293085, 0.99888605, 0.99941192, 0.49325248],
+                             [- 6.27329564, -0.00036464, 0.00022338, 7.27293100, 0.99888618, 0.99941199, 0.49325226],
+                             [- 6.27329574, -0.00036460, 0.00022335, 7.27293114, 0.99888631, 0.99941206, 0.49325247],
+                             [- 6.27329584, -0.00036455, 0.00022332, 7.27293129, 0.99888644, 0.99941213, 0.49325235],
+                             [- 6.27329594, -0.00036451, 0.00022330, 7.27293143, 0.99888657, 0.99941219, 0.49325238],
+                             [- 6.27329605, -0.00036447, 0.00022327, 7.27293158, 0.99888670, 0.99941226, 0.49325236],
+                             [- 6.27329615, -0.00036442, 0.00022324, 7.27293173, 0.99888683, 0.99941233, 0.49325251],
+                             [- 6.27329625, -0.00036438, 0.00022322, 7.27293187, 0.99888696, 0.99941240, 0.49325244],
+                             [- 6.27329635, -0.00036434, 0.00022319, 7.27293202, 0.99888709, 0.99941247, 0.49325243],
+                             [- 6.27329646, -0.00036429, 0.00022317, 7.27293216, 0.99888723, 0.99941254, 0.49325235],
+                             [- 6.27329656, -0.00036425, 0.00022314, 7.27293231, 0.99888736, 0.99941261, 0.49325265],
+                             [- 6.27329666, -0.00036421, 0.00022311, 7.27293245, 0.99888749, 0.99941268, 0.49325266],
+                             [- 6.27329677, -0.00036417, 0.00022309, 7.27293260, 0.99888762, 0.99941275, 0.49325241],
+                             [- 6.27329687, -0.00036412, 0.00022306, 7.27293274, 0.99888775, 0.99941282, 0.49325251],
+                             [- 6.27329697, -0.00036408, 0.00022303, 7.27293289, 0.99888788, 0.99941289, 0.49325244],
+                             [- 6.27329707, -0.00036404, 0.00022301, 7.27293304, 0.99888801, 0.99941295, 0.49325256],
+                             [- 6.27329718, -0.00036399, 0.00022298, 7.27293318, 0.99888814, 0.99941302, 0.49325261],
+                             [- 6.27329728, -0.00036395, 0.00022296, 7.27293333, 0.99888827, 0.99941309, 0.49325262],
+                             [- 6.27329738, -0.00036391, 0.00022293, 7.27293347, 0.99888840, 0.99941316, 0.49325272],
+                             [- 6.27329748, -0.00036387, 0.00022290, 7.27293362, 0.99888853, 0.99941323, 0.49325264],
+                             [- 6.27329758, -0.00036382, 0.00022288, 7.27293376, 0.99888866, 0.99941330, 0.49325271],
+                             [- 6.27329769, -0.00036378, 0.00022285, 7.27293391, 0.99888879, 0.99941337, 0.49325250],
+                             [- 6.27329779, -0.00036374, 0.00022282, 7.27293405, 0.99888893, 0.99941344, 0.49325276],
+                             [- 6.27329789, -0.00036370, 0.00022280, 7.27293420, 0.99888906, 0.99941351, 0.49325279],
+                             [- 6.27329799, -0.00036365, 0.00022277, 7.27293434, 0.99888919, 0.99941358, 0.49325256],
+                             [- 6.27329810, -0.00036361, 0.00022275, 7.27293449, 0.99888932, 0.99941364, 0.49325269],
+                             [- 6.27329820, -0.00036357, 0.00022272, 7.27293463, 0.99888945, 0.99941371, 0.49325274],
+                             [- 6.27329830, -0.00036352, 0.00022269, 7.27293478, 0.99888958, 0.99941378, 0.49325276],
+                             [- 6.27329840, -0.00036348, 0.00022267, 7.27293492, 0.99888971, 0.99941385, 0.49325275],
+                             [- 6.27329851, -0.00036344, 0.00022264, 7.27293507, 0.99888984, 0.99941392, 0.49325266],
+                             [- 6.27329861, -0.00036340, 0.00022261, 7.27293521, 0.99888997, 0.99941399, 0.49325274],
+                             [- 6.27329871, -0.00036335, 0.00022259, 7.27293536, 0.99889010, 0.99941406, 0.49325275],
+                             [- 6.27329881, -0.00036331, 0.00022256, 7.27293550, 0.99889023, 0.99941413, 0.49325279],
+                             [- 6.27329891, -0.00036327, 0.00022254, 7.27293565, 0.99889036, 0.99941420, 0.49325277],
+                             [- 6.27329902, -0.00036323, 0.00022251, 7.27293579, 0.99889049, 0.99941426, 0.49325299],
+                             [- 6.27329912, -0.00036318, 0.00022248, 7.27293593, 0.99889062, 0.99941433, 0.49325298],
+                             [- 6.27329922, -0.00036314, 0.00022246, 7.27293608, 0.99889075, 0.99941440, 0.49325274],
+                             [- 6.27329932, -0.00036310, 0.00022243, 7.27293622, 0.99889088, 0.99941447, 0.49325294],
+                             [- 6.27329942, -0.00036306, 0.00022241, 7.27293637, 0.99889101, 0.99941454, 0.49325297],
+                             [- 6.27329953, -0.00036301, 0.00022238, 7.27293651, 0.99889114, 0.99941461, 0.49325278],
+                             [- 6.27329963, -0.00036297, 0.00022235, 7.27293666, 0.99889127, 0.99941468, 0.49325281],
+                             [- 6.27329973, -0.00036293, 0.00022233, 7.27293680, 0.99889140, 0.99941474, 0.49325304],
+                             [- 6.27329983, -0.00036289, 0.00022230, 7.27293695, 0.99889153, 0.99941481, 0.49325295],
+                             [- 6.27329993, -0.00036284, 0.00022228, 7.27293709, 0.99889166, 0.99941488, 0.49325311],
+                             [- 6.27330004, -0.00036280, 0.00022225, 7.27293723, 0.99889179, 0.99941495, 0.49325291],
+                             [- 6.27330014, -0.00036276, 0.00022222, 7.27293738, 0.99889192, 0.99941502, 0.49325317],
+                             [- 6.27330024, -0.00036272, 0.00022220, 7.27293752, 0.99889205, 0.99941509, 0.49325298],
+                             [- 6.27330034, -0.00036267, 0.00022217, 7.27293767, 0.99889218, 0.99941516, 0.49325316],
+                             [- 6.27330044, -0.00036263, 0.00022215, 7.27293781, 0.99889231, 0.99941522, 0.49325310],
+                             [- 6.27330054, -0.00036259, 0.00022212, 7.27293796, 0.99889244, 0.99941529, 0.49325314],
+                             [- 6.27330065, -0.00036255, 0.00022209, 7.27293810, 0.99889257, 0.99941536, 0.49325310],
+                             [- 6.27330075, -0.00036250, 0.00022207, 7.27293824, 0.99889270, 0.99941543, 0.49325300],
+                             [- 6.27330085, -0.00036246, 0.00022204, 7.27293839, 0.99889283, 0.99941550, 0.49325323],
+                             [- 6.27330095, -0.00036242, 0.00022202, 7.27293853, 0.99889296, 0.99941557, 0.49325313],
+                             [- 6.27330105, -0.00036238, 0.00022199, 7.27293868, 0.99889309, 0.99941564, 0.49325318],
+                             [- 6.27330115, -0.00036233, 0.00022196, 7.27293882, 0.99889322, 0.99941570, 0.49325325],
+                             [- 6.27330126, -0.00036229, 0.00022194, 7.27293896, 0.99889335, 0.99941577, 0.49325315],
+                             [- 6.27330136, -0.00036225, 0.00022191, 7.27293911, 0.99889348, 0.99941584, 0.49325312],
+                             [- 6.27330146, -0.00036221, 0.00022189, 7.27293925, 0.99889361, 0.99941591, 0.49325327],
+                             [- 6.27330156, -0.00036216, 0.00022186, 7.27293940, 0.99889374, 0.99941598, 0.49325334],
+                             [- 6.27330166, -0.00036212, 0.00022183, 7.27293954, 0.99889387, 0.99941605, 0.49325318],
+                             [- 6.27330176, -0.00036208, 0.00022181, 7.27293968, 0.99889400, 0.99941611, 0.49325339],
+                             [- 6.27330186, -0.00036204, 0.00022178, 7.27293983, 0.99889412, 0.99941618, 0.49325320],
+                             [- 6.27330197, -0.00036199, 0.00022176, 7.27293997, 0.99889425, 0.99941625, 0.49325327],
+                             [- 6.27330207, -0.00036195, 0.00022173, 7.27294011, 0.99889438, 0.99941632, 0.49325329],
+                             [- 6.27330217, -0.00036191, 0.00022170, 7.27294026, 0.99889451, 0.99941639, 0.49325333],
+                             [- 6.27330227, -0.00036187, 0.00022168, 7.27294040, 0.99889464, 0.99941646, 0.49325330],
+                             [- 6.27330237, -0.00036182, 0.00022165, 7.27294055, 0.99889477, 0.99941652, 0.49325321],
+                             [- 6.27330247, -0.00036178, 0.00022163, 7.27294069, 0.99889490, 0.99941659, 0.49325343],
+                             [- 6.27330257, -0.00036174, 0.00022160, 7.27294083, 0.99889503, 0.99941666, 0.49325334],
+                             [- 6.27330267, -0.00036170, 0.00022157, 7.27294098, 0.99889516, 0.99941673, 0.49325333],
+                             [- 6.27330278, -0.00036166, 0.00022155, 7.27294112, 0.99889529, 0.99941680, 0.49325328],
+                             [- 6.27330288, -0.00036161, 0.00022152, 7.27294126, 0.99889542, 0.99941686, 0.49325344],
+                             [- 6.27330298, -0.00036157, 0.00022150, 7.27294141, 0.99889555, 0.99941693, 0.49325340],
+                             [- 6.27330308, -0.00036153, 0.00022147, 7.27294155, 0.99889568, 0.99941700, 0.49325337],
+                             [- 6.27330318, -0.00036149, 0.00022144, 7.27294169, 0.99889580, 0.99941707, 0.49325346],
+                             [- 6.27330328, -0.00036144, 0.00022142, 7.27294184, 0.99889593, 0.99941714, 0.49325350],
+                             [- 6.27330338, -0.00036140, 0.00022139, 7.27294198, 0.99889606, 0.99941720, 0.49325355],
+                             [- 6.27330348, -0.00036136, 0.00022137, 7.27294212, 0.99889619, 0.99941727, 0.49325362],
+                             [- 6.27330358, -0.00036132, 0.00022134, 7.27294227, 0.99889632, 0.99941734, 0.49325356],
+                             [- 6.27330368, -0.00036128, 0.00022132, 7.27294241, 0.99889645, 0.99941741, 0.49325360],
+                             [- 6.27330379, -0.00036123, 0.00022129, 7.27294255, 0.99889658, 0.99941748, 0.49325348],
+                             [- 6.27330389, -0.00036119, 0.00022126, 7.27294269, 0.99889671, 0.99941754, 0.49325378],
+                             [- 6.27330399, -0.00036115, 0.00022124, 7.27294284, 0.99889684, 0.99941761, 0.49325364],
+                             [- 6.27330409, -0.00036111, 0.00022121, 7.27294298, 0.99889696, 0.99941768, 0.49325361],
+                             [- 6.27330419, -0.00036107, 0.00022119, 7.27294312, 0.99889709, 0.99941775, 0.49325386],
+                             [- 6.27330429, -0.00036102, 0.00022116, 7.27294327, 0.99889722, 0.99941782, 0.49325359],
+                             [- 6.27330439, -0.00036098, 0.00022113, 7.27294341, 0.99889735, 0.99941788, 0.49325371],
+                             [- 6.27330449, -0.00036094, 0.00022111, 7.27294355, 0.99889748, 0.99941795, 0.49325375],
+                             [- 6.27330459, -0.00036090, 0.00022108, 7.27294370, 0.99889761, 0.99941802, 0.49325371],
+                             [- 6.27330469, -0.00036085, 0.00022106, 7.27294384, 0.99889774, 0.99941809, 0.49325378],
+                             [- 6.27330479, -0.00036081, 0.00022103, 7.27294398, 0.99889786, 0.99941816, 0.49325370],
+                             [- 6.27330489, -0.00036077, 0.00022101, 7.27294412, 0.99889799, 0.99941822, 0.49325364],
+                             [- 6.27330499, -0.00036073, 0.00022098, 7.27294427, 0.99889812, 0.99941829, 0.49325373],
+                             [- 6.27330510, -0.00036069, 0.00022095, 7.27294441, 0.99889825, 0.99941836, 0.49325372],
+                             [- 6.27330520, -0.00036064, 0.00022093, 7.27294455, 0.99889838, 0.99941843, 0.49325391],
+                             [- 6.27330530, -0.00036060, 0.00022090, 7.27294469, 0.99889851, 0.99941849, 0.49325378],
+                             [- 6.27330540, -0.00036056, 0.00022088, 7.27294484, 0.99889863, 0.99941856, 0.49325387],
+                             [- 6.27330550, -0.00036052, 0.00022085, 7.27294498, 0.99889876, 0.99941863, 0.49325370],
+                             [- 6.27330560, -0.00036048, 0.00022083, 7.27294512, 0.99889889, 0.99941870, 0.49325386],
+                             [- 6.27330570, -0.00036043, 0.00022080, 7.27294526, 0.99889902, 0.99941877, 0.49325387],
+                             [- 6.27330580, -0.00036039, 0.00022077, 7.27294541, 0.99889915, 0.99941883, 0.49325384],
+                             [- 6.27330590, -0.00036035, 0.00022075, 7.27294555, 0.99889928, 0.99941890, 0.49325392],
+                             [- 6.27330600, -0.00036031, 0.00022072, 7.27294569, 0.99889940, 0.99941897, 0.49325387],
+                             [- 6.27330610, -0.00036027, 0.00022070, 7.27294583, 0.99889953, 0.99941904, 0.49325390],
+                             [- 6.27330620, -0.00036023, 0.00022067, 7.27294598, 0.99889966, 0.99941910, 0.49325400],
+                             [- 6.27330630, -0.00036018, 0.00022065, 7.27294612, 0.99889979, 0.99941917, 0.49325409],
+                             [- 6.27330640, -0.00036014, 0.00022062, 7.27294626, 0.99889992, 0.99941924, 0.49325386],
+                             [- 6.27330650, -0.00036010, 0.00022059, 7.27294640, 0.99890004, 0.99941931, 0.49325408],
+                             [- 6.27330660, -0.00036006, 0.00022057, 7.27294654, 0.99890017, 0.99941937, 0.49325391],
+                             [- 6.27330670, -0.00036002, 0.00022054, 7.27294669, 0.99890030, 0.99941944, 0.49325389],
+                             [- 6.27330680, -0.00035997, 0.00022052, 7.27294683, 0.99890043, 0.99941951, 0.49325379],
+                             [- 6.27330690, -0.00035993, 0.00022049, 7.27294697, 0.99890056, 0.99941958, 0.49325409],
+                             [- 6.27330700, -0.00035989, 0.00022047, 7.27294711, 0.99890068, 0.99941964, 0.49325388],
+                             [- 6.27330710, -0.00035985, 0.00022044, 7.27294726, 0.99890081, 0.99941971, 0.49325402],
+                             [- 6.27330720, -0.00035981, 0.00022041, 7.27294740, 0.99890094, 0.99941978, 0.49325423],
+                             [- 6.27330730, -0.00035976, 0.00022039, 7.27294754, 0.99890107, 0.99941985, 0.49325405],
+                             [- 6.27330740, -0.00035972, 0.00022036, 7.27294768, 0.99890119, 0.99941991, 0.49325402],
+                             [- 6.27330750, -0.00035968, 0.00022034, 7.27294782, 0.99890132, 0.99941998, 0.49325409],
+                             [- 6.27330760, -0.00035964, 0.00022031, 7.27294796, 0.99890145, 0.99942005, 0.49325408],
+                             [- 6.27330770, -0.00035960, 0.00022029, 7.27294811, 0.99890158, 0.99942012, 0.49325430],
+                             [- 6.27330780, -0.00035956, 0.00022026, 7.27294825, 0.99890171, 0.99942018, 0.49325412],
+                             [- 6.27330790, -0.00035951, 0.00022024, 7.27294839, 0.99890183, 0.99942025, 0.49325410],
+                             [- 6.27330800, -0.00035947, 0.00022021, 7.27294853, 0.99890196, 0.99942032, 0.49325444],
+                             [- 6.27330810, -0.00035943, 0.00022018, 7.27294867, 0.99890209, 0.99942039, 0.49325431],
+                             [- 6.27330820, -0.00035939, 0.00022016, 7.27294882, 0.99890222, 0.99942045, 0.49325422],
+                             [- 6.27330830, -0.00035935, 0.00022013, 7.27294896, 0.99890234, 0.99942052, 0.49325435],
+                             [- 6.27330840, -0.00035931, 0.00022011, 7.27294910, 0.99890247, 0.99942059, 0.49325426],
+                             [- 6.27330850, -0.00035926, 0.00022008, 7.27294924, 0.99890260, 0.99942065, 0.49325433],
+                             [- 6.27330860, -0.00035922, 0.00022006, 7.27294938, 0.99890273, 0.99942072, 0.49325432],
+                             [- 6.27330870, -0.00035918, 0.00022003, 7.27294952, 0.99890285, 0.99942079, 0.49325444],
+                             [- 6.27330880, -0.00035914, 0.00022001, 7.27294966, 0.99890298, 0.99942086, 0.49325435],
+                             [- 6.27330890, -0.00035910, 0.00021998, 7.27294981, 0.99890311, 0.99942092, 0.49325422],
+                             [- 6.27330900, -0.00035906, 0.00021995, 7.27294995, 0.99890323, 0.99942099, 0.49325439],
+                             [- 6.27330910, -0.00035901, 0.00021993, 7.27295009, 0.99890336, 0.99942106, 0.49325438],
+                             [- 6.27330920, -0.00035897, 0.00021990, 7.27295023, 0.99890349, 0.99942113, 0.49325454],
+                             [- 6.27330930, -0.00035893, 0.00021988, 7.27295037, 0.99890362, 0.99942119, 0.49325448],
+                             [- 6.27330940, -0.00035889, 0.00021985, 7.27295051, 0.99890374, 0.99942126, 0.49325441],
+                             [- 6.27330950, -0.00035885, 0.00021983, 7.27295065, 0.99890387, 0.99942133, 0.49325438],
+                             [- 6.27330960, -0.00035881, 0.00021980, 7.27295079, 0.99890400, 0.99942139, 0.49325444],
+                             [- 6.27330970, -0.00035876, 0.00021978, 7.27295094, 0.99890412, 0.99942146, 0.49325455],
+                             [- 6.27330980, -0.00035872, 0.00021975, 7.27295108, 0.99890425, 0.99942153, 0.49325435],
+                             [- 6.27330990, -0.00035868, 0.00021972, 7.27295122, 0.99890438, 0.99942159, 0.49325446],
+                             [- 6.27331000, -0.00035864, 0.00021970, 7.27295136, 0.99890451, 0.99942166, 0.49325463],
+                             [- 6.27331010, -0.00035860, 0.00021967, 7.27295150, 0.99890463, 0.99942173, 0.49325459],
+                             [- 6.27331020, -0.00035856, 0.00021965, 7.27295164, 0.99890476, 0.99942180, 0.49325444],
+                             [- 6.27331030, -0.00035851, 0.00021962, 7.27295178, 0.99890489, 0.99942186, 0.49325446],
+                             [- 6.27331040, -0.00035847, 0.00021960, 7.27295192, 0.99890501, 0.99942193, 0.49325470],
+                             [- 6.27331050, -0.00035843, 0.00021957, 7.27295206, 0.99890514, 0.99942200, 0.49325447],
+                             [- 6.27331059, -0.00035839, 0.00021955, 7.27295220, 0.99890527, 0.99942206, 0.49325451],
+                             [- 6.27331069, -0.00035835, 0.00021952, 7.27295235, 0.99890539, 0.99942213, 0.49325471],
+                             [- 6.27331079, -0.00035831, 0.00021950, 7.27295249, 0.99890552, 0.99942220, 0.49325479],
+                             [- 6.27331089, -0.00035827, 0.00021947, 7.27295263, 0.99890565, 0.99942226, 0.49325465],
+                             [- 6.27331099, -0.00035822, 0.00021944, 7.27295277, 0.99890577, 0.99942233, 0.49325460],
+                             [- 6.27331109, -0.00035818, 0.00021942, 7.27295291, 0.99890590, 0.99942240, 0.49325463],
+                             [- 6.27331119, -0.00035814, 0.00021939, 7.27295305, 0.99890603, 0.99942246, 0.49325475],
+                             [- 6.27331129, -0.00035810, 0.00021937, 7.27295319, 0.99890615, 0.99942253, 0.49325484],
+                             [- 6.27331139, -0.00035806, 0.00021934, 7.27295333, 0.99890628, 0.99942260, 0.49325478],
+                             [- 6.27331149, -0.00035802, 0.00021932, 7.27295347, 0.99890641, 0.99942267, 0.49325476],
+                             [- 6.27331159, -0.00035798, 0.00021929, 7.27295361, 0.99890653, 0.99942273, 0.49325474],
+                             [- 6.27331169, -0.00035793, 0.00021927, 7.27295375, 0.99890666, 0.99942280, 0.49325471],
+                             [- 6.27331179, -0.00035789, 0.00021924, 7.27295389, 0.99890679, 0.99942287, 0.49325479],
+                             [- 6.27331188, -0.00035785, 0.00021922, 7.27295403, 0.99890691, 0.99942293, 0.49325475],
+                             [- 6.27331198, -0.00035781, 0.00021919, 7.27295417, 0.99890704, 0.99942300, 0.49325483],
+                             [- 6.27331208, -0.00035777, 0.00021917, 7.27295431, 0.99890717, 0.99942307, 0.49325488],
+                             [- 6.27331218, -0.00035773, 0.00021914, 7.27295445, 0.99890729, 0.99942313, 0.49325468],
+                             [- 6.27331228, -0.00035769, 0.00021911, 7.27295459, 0.99890742, 0.99942320, 0.49325487],
+                             [- 6.27331238, -0.00035764, 0.00021909, 7.27295473, 0.99890754, 0.99942327, 0.49325491],
+                             [- 6.27331248, -0.00035760, 0.00021906, 7.27295487, 0.99890767, 0.99942333, 0.49325485],
+                             [- 6.27331258, -0.00035756, 0.00021904, 7.27295501, 0.99890780, 0.99942340, 0.49325494],
+                             [- 6.27331268, -0.00035752, 0.00021901, 7.27295515, 0.99890792, 0.99942347, 0.49325489],
+                             [- 6.27331277, -0.00035748, 0.00021899, 7.27295529, 0.99890805, 0.99942353, 0.49325507],
+                             [- 6.27331287, -0.00035744, 0.00021896, 7.27295544, 0.99890818, 0.99942360, 0.49325487],
+                             [- 6.27331297, -0.00035740, 0.00021894, 7.27295558, 0.99890830, 0.99942367, 0.49325485],
+                             [- 6.27331307, -0.00035736, 0.00021891, 7.27295572, 0.99890843, 0.99942373, 0.49325494],
+                             [- 6.27331317, -0.00035731, 0.00021889, 7.27295586, 0.99890855, 0.99942380, 0.49325502],
+                             [- 6.27331327, -0.00035727, 0.00021886, 7.27295600, 0.99890868, 0.99942386, 0.49325506],
+                             [- 6.27331337, -0.00035723, 0.00021884, 7.27295614, 0.99890881, 0.99942393, 0.49325501],
+                             [- 6.27331347, -0.00035719, 0.00021881, 7.27295628, 0.99890893, 0.99942400, 0.49325503],
+                             [- 6.27331356, -0.00035715, 0.00021879, 7.27295642, 0.99890906, 0.99942406, 0.49325490],
+                             [- 6.27331366, -0.00035711, 0.00021876, 7.27295655, 0.99890918, 0.99942413, 0.49325500],
+                             [- 6.27331376, -0.00035707, 0.00021874, 7.27295669, 0.99890931, 0.99942420, 0.49325510],
+                             [- 6.27331386, -0.00035703, 0.00021871, 7.27295683, 0.99890943, 0.99942426, 0.49325499],
+                             [- 6.27331396, -0.00035698, 0.00021869, 7.27295697, 0.99890956, 0.99942433, 0.49325505],
+                             [- 6.27331406, -0.00035694, 0.00021866, 7.27295711, 0.99890969, 0.99942440, 0.49325506],
+                             [- 6.27331416, -0.00035690, 0.00021863, 7.27295725, 0.99890981, 0.99942446, 0.49325523],
+                             [- 6.27331425, -0.00035686, 0.00021861, 7.27295739, 0.99890994, 0.99942453, 0.49325511],
+                             [- 6.27331435, -0.00035682, 0.00021858, 7.27295753, 0.99891006, 0.99942460, 0.49325502],
+                             [- 6.27331445, -0.00035678, 0.00021856, 7.27295767, 0.99891019, 0.99942466, 0.49325512],
+                             [- 6.27331455, -0.00035674, 0.00021853, 7.27295781, 0.99891032, 0.99942473, 0.49325535],
+                             [- 6.27331465, -0.00035670, 0.00021851, 7.27295795, 0.99891044, 0.99942479, 0.49325526],
+                             [- 6.27331475, -0.00035666, 0.00021848, 7.27295809, 0.99891057, 0.99942486, 0.49325504],
+                             [- 6.27331485, -0.00035661, 0.00021846, 7.27295823, 0.99891069, 0.99942493, 0.49325512],
+                             [- 6.27331494, -0.00035657, 0.00021843, 7.27295837, 0.99891082, 0.99942499, 0.49325533],
+                             [- 6.27331504, -0.00035653, 0.00021841, 7.27295851, 0.99891094, 0.99942506, 0.49325523],
+                             [- 6.27331514, -0.00035649, 0.00021838, 7.27295865, 0.99891107, 0.99942513, 0.49325528],
+                             [- 6.27331524, -0.00035645, 0.00021836, 7.27295879, 0.99891119, 0.99942519, 0.49325526],
+                             [- 6.27331534, -0.00035641, 0.00021833, 7.27295893, 0.99891132, 0.99942526, 0.49325527],
+                             [- 6.27331543, -0.00035637, 0.00021831, 7.27295907, 0.99891144, 0.99942532, 0.49325541],
+                             [- 6.27331553, -0.00035633, 0.00021828, 7.27295921, 0.99891157, 0.99942539, 0.49325526],
+                             [- 6.27331563, -0.00035629, 0.00021826, 7.27295935, 0.99891169, 0.99942546, 0.49325518],
+                             [- 6.27331573, -0.00035625, 0.00021823, 7.27295948, 0.99891182, 0.99942552, 0.49325527],
+                             [- 6.27331583, -0.00035620, 0.00021821, 7.27295962, 0.99891195, 0.99942559, 0.49325543],
+                             [- 6.27331593, -0.00035616, 0.00021818, 7.27295976, 0.99891207, 0.99942566, 0.49325535],
+                             [- 6.27331602, -0.00035612, 0.00021816, 7.27295990, 0.99891220, 0.99942572, 0.49325531],
+                             [- 6.27331612, -0.00035608, 0.00021813, 7.27296004, 0.99891232, 0.99942579, 0.49325537],
+                             [- 6.27331622, -0.00035604, 0.00021811, 7.27296018, 0.99891245, 0.99942585, 0.49325536],
+                             [- 6.27331632, -0.00035600, 0.00021808, 7.27296032, 0.99891257, 0.99942592, 0.49325546],
+                             [- 6.27331642, -0.00035596, 0.00021806, 7.27296046, 0.99891270, 0.99942599, 0.49325549],
+                             [- 6.27331651, -0.00035592, 0.00021803, 7.27296060, 0.99891282, 0.99942605, 0.49325546],
+                             [- 6.27331661, -0.00035588, 0.00021801, 7.27296074, 0.99891295, 0.99942612, 0.49325542],
+                             [- 6.27331671, -0.00035584, 0.00021798, 7.27296087, 0.99891307, 0.99942618, 0.49325537],
+                             [- 6.27331681, -0.00035579, 0.00021796, 7.27296101, 0.99891320, 0.99942625, 0.49325535],
+                             [- 6.27331691, -0.00035575, 0.00021793, 7.27296115, 0.99891332, 0.99942632, 0.49325540],
+                             [- 6.27331700, -0.00035571, 0.00021791, 7.27296129, 0.99891345, 0.99942638, 0.49325546],
+                             [- 6.27331710, -0.00035567, 0.00021788, 7.27296143, 0.99891357, 0.99942645, 0.49325545],
+                             [- 6.27331720, -0.00035563, 0.00021786, 7.27296157, 0.99891370, 0.99942651, 0.49325569],
+                             [- 6.27331730, -0.00035559, 0.00021783, 7.27296171, 0.99891382, 0.99942658, 0.49325550],
+                             [- 6.27331740, -0.00035555, 0.00021781, 7.27296185, 0.99891395, 0.99942664, 0.49325563],
+                             [- 6.27331749, -0.00035551, 0.00021778, 7.27296198, 0.99891407, 0.99942671, 0.49325568],
+                             [- 6.27331759, -0.00035547, 0.00021776, 7.27296212, 0.99891420, 0.99942678, 0.49325547],
+                             [- 6.27331769, -0.00035543, 0.00021773, 7.27296226, 0.99891432, 0.99942684, 0.49325550],
+                             [- 6.27331779, -0.00035539, 0.00021771, 7.27296240, 0.99891444, 0.99942691, 0.49325571],
+                             [- 6.27331788, -0.00035535, 0.00021768, 7.27296254, 0.99891457, 0.99942697, 0.49325568],
+                             [- 6.27331798, -0.00035530, 0.00021766, 7.27296268, 0.99891469, 0.99942704, 0.49325562],
+                             [- 6.27331808, -0.00035526, 0.00021763, 7.27296281, 0.99891482, 0.99942711, 0.49325569],
+                             [- 6.27331818, -0.00035522, 0.00021761, 7.27296295, 0.99891494, 0.99942717, 0.49325576],
+                             [- 6.27331827, -0.00035518, 0.00021758, 7.27296309, 0.99891507, 0.99942724, 0.49325584],
+                             [- 6.27331837, -0.00035514, 0.00021756, 7.27296323, 0.99891519, 0.99942730, 0.49325572],
+                             [- 6.27331847, -0.00035510, 0.00021753, 7.27296337, 0.99891532, 0.99942737, 0.49325557],
+                             [- 6.27331857, -0.00035506, 0.00021751, 7.27296351, 0.99891544, 0.99942743, 0.49325555],
+                             [- 6.27331866, -0.00035502, 0.00021748, 7.27296364, 0.99891557, 0.99942750, 0.49325590],
+                             [- 6.27331876, -0.00035498, 0.00021746, 7.27296378, 0.99891569, 0.99942757, 0.49325582],
+                             [- 6.27331886, -0.00035494, 0.00021743, 7.27296392, 0.99891581, 0.99942763, 0.49325599],
+                             [- 6.27331896, -0.00035490, 0.00021741, 7.27296406, 0.99891594, 0.99942770, 0.49325596],
+                             [- 6.27331905, -0.00035486, 0.00021738, 7.27296420, 0.99891606, 0.99942776, 0.49325600],
+                             [- 6.27331915, -0.00035482, 0.00021736, 7.27296434, 0.99891619, 0.99942783, 0.49325578],
+                             [- 6.27331925, -0.00035478, 0.00021733, 7.27296447, 0.99891631, 0.99942789, 0.49325597],
+                             [- 6.27331935, -0.00035473, 0.00021731, 7.27296461, 0.99891644, 0.99942796, 0.49325578],
+                             [- 6.27331944, -0.00035469, 0.00021728, 7.27296475, 0.99891656, 0.99942802, 0.49325601],
+                             [- 6.27331954, -0.00035465, 0.00021726, 7.27296489, 0.99891668, 0.99942809, 0.49325574],
+                             [- 6.27331964, -0.00035461, 0.00021723, 7.27296503, 0.99891681, 0.99942816, 0.49325598],
+                             [- 6.27331974, -0.00035457, 0.00021721, 7.27296516, 0.99891693, 0.99942822, 0.49325602],
+                             [- 6.27331983, -0.00035453, 0.00021718, 7.27296530, 0.99891706, 0.99942829, 0.49325595],
+                             [- 6.27331993, -0.00035449, 0.00021716, 7.27296544, 0.99891718, 0.99942835, 0.49325608],
+                             [- 6.27332003, -0.00035445, 0.00021713, 7.27296558, 0.99891730, 0.99942842, 0.49325597],
+                             [- 6.27332012, -0.00035441, 0.00021711, 7.27296571, 0.99891743, 0.99942848, 0.49325598],
+                             [- 6.27332022, -0.00035437, 0.00021708, 7.27296585, 0.99891755, 0.99942855, 0.49325613],
+                             [- 6.27332032, -0.00035433, 0.00021706, 7.27296599, 0.99891768, 0.99942861, 0.49325588],
+                             [- 6.27332042, -0.00035429, 0.00021703, 7.27296613, 0.99891780, 0.99942868, 0.49325598],
+                             [- 6.27332051, -0.00035425, 0.00021701, 7.27296626, 0.99891792, 0.99942874, 0.49325592],
+                             [- 6.27332061, -0.00035421, 0.00021698, 7.27296640, 0.99891805, 0.99942881, 0.49325612],
+                             [- 6.27332071, -0.00035417, 0.00021696, 7.27296654, 0.99891817, 0.99942888, 0.49325620],
+                             [- 6.27332080, -0.00035413, 0.00021693, 7.27296668, 0.99891830, 0.99942894, 0.49325610],
+                             [- 6.27332090, -0.00035409, 0.00021691, 7.27296681, 0.99891842, 0.99942901, 0.49325614],
+                             [- 6.27332100, -0.00035405, 0.00021688, 7.27296695, 0.99891854, 0.99942907, 0.49325612],
+                             [- 6.27332109, -0.00035400, 0.00021686, 7.27296709, 0.99891867, 0.99942914, 0.49325613],
+                             [- 6.27332119, -0.00035396, 0.00021683, 7.27296723, 0.99891879, 0.99942920, 0.49325604],
+                             [- 6.27332129, -0.00035392, 0.00021681, 7.27296736, 0.99891891, 0.99942927, 0.49325626],
+                             [- 6.27332139, -0.00035388, 0.00021678, 7.27296750, 0.99891904, 0.99942933, 0.49325625],
+                             [- 6.27332148, -0.00035384, 0.00021676, 7.27296764, 0.99891916, 0.99942940, 0.49325605],
+                             [- 6.27332158, -0.00035380, 0.00021673, 7.27296778, 0.99891928, 0.99942946, 0.49325626],
+                             [- 6.27332168, -0.00035376, 0.00021671, 7.27296791, 0.99891941, 0.99942953, 0.49325629],
+                             [- 6.27332177, -0.00035372, 0.00021669, 7.27296805, 0.99891953, 0.99942959, 0.49325630],
+                             [- 6.27332187, -0.00035368, 0.00021666, 7.27296819, 0.99891966, 0.99942966, 0.49325628],
+                             [- 6.27332197, -0.00035364, 0.00021664, 7.27296833, 0.99891978, 0.99942972, 0.49325635],
+                             [- 6.27332206, -0.00035360, 0.00021661, 7.27296846, 0.99891990, 0.99942979, 0.49325625],
+                             [- 6.27332216, -0.00035356, 0.00021659, 7.27296860, 0.99892003, 0.99942985, 0.49325617],
+                             [- 6.27332226, -0.00035352, 0.00021656, 7.27296874, 0.99892015, 0.99942992, 0.49325641],
+                             [- 6.27332235, -0.00035348, 0.00021654, 7.27296887, 0.99892027, 0.99942998, 0.49325636],
+                             [- 6.27332245, -0.00035344, 0.00021651, 7.27296901, 0.99892040, 0.99943005, 0.49325630],
+                             [- 6.27332255, -0.00035340, 0.00021649, 7.27296915, 0.99892052, 0.99943011, 0.49325637],
+                             [- 6.27332264, -0.00035336, 0.00021646, 7.27296928, 0.99892064, 0.99943018, 0.49325631],
+                             [- 6.27332274, -0.00035332, 0.00021644, 7.27296942, 0.99892077, 0.99943024, 0.49325656],
+                             [- 6.27332284, -0.00035328, 0.00021641, 7.27296956, 0.99892089, 0.99943031, 0.49325631],
+                             [- 6.27332293, -0.00035324, 0.00021639, 7.27296970, 0.99892101, 0.99943037, 0.49325638],
+                             [- 6.27332303, -0.00035320, 0.00021636, 7.27296983, 0.99892114, 0.99943044, 0.49325647],
+                             [- 6.27332313, -0.00035316, 0.00021634, 7.27296997, 0.99892126, 0.99943050, 0.49325639],
+                             [- 6.27332322, -0.00035312, 0.00021631, 7.27297011, 0.99892138, 0.99943057, 0.49325638],
+                             [- 6.27332332, -0.00035308, 0.00021629, 7.27297024, 0.99892150, 0.99943063, 0.49325638],
+                             [- 6.27332341, -0.00035304, 0.00021626, 7.27297038, 0.99892163, 0.99943070, 0.49325643],
+                             [- 6.27332351, -0.00035300, 0.00021624, 7.27297052, 0.99892175, 0.99943076, 0.49325659],
+                             [- 6.27332361, -0.00035296, 0.00021622, 7.27297065, 0.99892187, 0.99943083, 0.49325672],
+                             [- 6.27332370, -0.00035291, 0.00021619, 7.27297079, 0.99892200, 0.99943089, 0.49325654],
+                             [- 6.27332380, -0.00035287, 0.00021617, 7.27297093, 0.99892212, 0.99943096, 0.49325642],
+                             [- 6.27332390, -0.00035283, 0.00021614, 7.27297106, 0.99892224, 0.99943102, 0.49325660],
+                             [- 6.27332399, -0.00035279, 0.00021612, 7.27297120, 0.99892237, 0.99943109, 0.49325667],
+                             [- 6.27332409, -0.00035275, 0.00021609, 7.27297133, 0.99892249, 0.99943115, 0.49325649],
+                             [- 6.27332418, -0.00035271, 0.00021607, 7.27297147, 0.99892261, 0.99943122, 0.49325655],
+                             [- 6.27332428, -0.00035267, 0.00021604, 7.27297161, 0.99892273, 0.99943128, 0.49325662],
+                             [- 6.27332438, -0.00035263, 0.00021602, 7.27297174, 0.99892286, 0.99943135, 0.49325664],
+                             [- 6.27332447, -0.00035259, 0.00021599, 7.27297188, 0.99892298, 0.99943141, 0.49325657],
+                             [- 6.27332457, -0.00035255, 0.00021597, 7.27297202, 0.99892310, 0.99943148, 0.49325670],
+                             [- 6.27332467, -0.00035251, 0.00021594, 7.27297215, 0.99892322, 0.99943154, 0.49325664],
+                             [- 6.27332476, -0.00035247, 0.00021592, 7.27297229, 0.99892335, 0.99943161, 0.49325680],
+                             [- 6.27332486, -0.00035243, 0.00021590, 7.27297243, 0.99892347, 0.99943167, 0.49325677],
+                             [- 6.27332495, -0.00035239, 0.00021587, 7.27297256, 0.99892359, 0.99943174, 0.49325674],
+                             [- 6.27332505, -0.00035235, 0.00021585, 7.27297270, 0.99892371, 0.99943180, 0.49325673],
+                             [- 6.27332515, -0.00035231, 0.00021582, 7.27297283, 0.99892384, 0.99943187, 0.49325687],
+                             [- 6.27332524, -0.00035227, 0.00021580, 7.27297297, 0.99892396, 0.99943193, 0.49325676],
+                             [- 6.27332534, -0.00035223, 0.00021577, 7.27297311, 0.99892408, 0.99943200, 0.49325694],
+                             [- 6.27332543, -0.00035219, 0.00021575, 7.27297324, 0.99892420, 0.99943206, 0.49325684],
+                             [- 6.27332553, -0.00035215, 0.00021572, 7.27297338, 0.99892433, 0.99943212, 0.49325673],
+                             [- 6.27332563, -0.00035211, 0.00021570, 7.27297351, 0.99892445, 0.99943219, 0.49325679],
+                             [- 6.27332572, -0.00035207, 0.00021567, 7.27297365, 0.99892457, 0.99943225, 0.49325687],
+                             [- 6.27332582, -0.00035203, 0.00021565, 7.27297379, 0.99892469, 0.99943232, 0.49325682],
+                             [- 6.27332591, -0.00035199, 0.00021563, 7.27297392, 0.99892482, 0.99943238, 0.49325693],
+                             [- 6.27332601, -0.00035195, 0.00021560, 7.27297406, 0.99892494, 0.99943245, 0.49325706],
+                             [- 6.27332611, -0.00035191, 0.00021558, 7.27297419, 0.99892506, 0.99943251, 0.49325679],
+                             [- 6.27332620, -0.00035187, 0.00021555, 7.27297433, 0.99892518, 0.99943258, 0.49325693],
+                             [- 6.27332630, -0.00035183, 0.00021553, 7.27297446, 0.99892531, 0.99943264, 0.49325690],
+                             [- 6.27332639, -0.00035179, 0.00021550, 7.27297460, 0.99892543, 0.99943271, 0.49325679],
+                             [- 6.27332649, -0.00035175, 0.00021548, 7.27297474, 0.99892555, 0.99943277, 0.49325703],
+                             [- 6.27332658, -0.00035171, 0.00021545, 7.27297487, 0.99892567, 0.99943283, 0.49325709],
+                             [- 6.27332668, -0.00035167, 0.00021543, 7.27297501, 0.99892579, 0.99943290, 0.49325716],
+                             [- 6.27332678, -0.00035163, 0.00021540, 7.27297514, 0.99892592, 0.99943296, 0.49325688],
+                             [- 6.27332687, -0.00035159, 0.00021538, 7.27297528, 0.99892604, 0.99943303, 0.49325701],
+                             [- 6.27332697, -0.00035155, 0.00021536, 7.27297541, 0.99892616, 0.99943309, 0.49325699],
+                             [- 6.27332706, -0.00035151, 0.00021533, 7.27297555, 0.99892628, 0.99943316, 0.49325716],
+                             [- 6.27332716, -0.00035147, 0.00021531, 7.27297569, 0.99892640, 0.99943322, 0.49325705],
+                             [- 6.27332725, -0.00035143, 0.00021528, 7.27297582, 0.99892653, 0.99943329, 0.49325714],
+                             [- 6.27332735, -0.00035139, 0.00021526, 7.27297596, 0.99892665, 0.99943335, 0.49325697],
+                             [- 6.27332744, -0.00035135, 0.00021523, 7.27297609, 0.99892677, 0.99943341, 0.49325706],
+                             [- 6.27332754, -0.00035131, 0.00021521, 7.27297623, 0.99892689, 0.99943348, 0.49325710],
+                             [- 6.27332763, -0.00035127, 0.00021518, 7.27297636, 0.99892701, 0.99943354, 0.49325718],
+                             [- 6.27332773, -0.00035123, 0.00021516, 7.27297650, 0.99892714, 0.99943361, 0.49325714],
+                             [- 6.27332783, -0.00035119, 0.00021514, 7.27297663, 0.99892726, 0.99943367, 0.49325704],
+                             [- 6.27332792, -0.00035115, 0.00021511, 7.27297677, 0.99892738, 0.99943374, 0.49325724],
+                             [- 6.27332802, -0.00035111, 0.00021509, 7.27297690, 0.99892750, 0.99943380, 0.49325727],
+                             [- 6.27332811, -0.00035107, 0.00021506, 7.27297704, 0.99892762, 0.99943386, 0.49325718],
+                             [- 6.27332821, -0.00035103, 0.00021504, 7.27297717, 0.99892774, 0.99943393, 0.49325715],
+                             [- 6.27332830, -0.00035099, 0.00021501, 7.27297731, 0.99892787, 0.99943399, 0.49325736],
+                             [- 6.27332840, -0.00035095, 0.00021499, 7.27297744, 0.99892799, 0.99943406, 0.49325725],
+                             [- 6.27332849, -0.00035091, 0.00021496, 7.27297758, 0.99892811, 0.99943412, 0.49325737],
+                             [- 6.27332859, -0.00035087, 0.00021494, 7.27297771, 0.99892823, 0.99943418, 0.49325733],
+                             [- 6.27332868, -0.00035084, 0.00021492, 7.27297785, 0.99892835, 0.99943425, 0.49325727],
+                             [- 6.27332878, -0.00035080, 0.00021489, 7.27297798, 0.99892847, 0.99943431, 0.49325722],
+                             [- 6.27332887, -0.00035076, 0.00021487, 7.27297812, 0.99892859, 0.99943438, 0.49325726],
+                             [- 6.27332897, -0.00035072, 0.00021484, 7.27297825, 0.99892872, 0.99943444, 0.49325746],
+                             [- 6.27332906, -0.00035068, 0.00021482, 7.27297839, 0.99892884, 0.99943451, 0.49325735],
+                             [- 6.27332916, -0.00035064, 0.00021479, 7.27297852, 0.99892896, 0.99943457, 0.49325729],
+                             [- 6.27332925, -0.00035060, 0.00021477, 7.27297866, 0.99892908, 0.99943463, 0.49325733],
+                             [- 6.27332935, -0.00035056, 0.00021475, 7.27297879, 0.99892920, 0.99943470, 0.49325743],
+                             [- 6.27332944, -0.00035052, 0.00021472, 7.27297893, 0.99892932, 0.99943476, 0.49325745],
+                             [- 6.27332954, -0.00035048, 0.00021470, 7.27297906, 0.99892944, 0.99943483, 0.49325763],
+                             [- 6.27332963, -0.00035044, 0.00021467, 7.27297920, 0.99892956, 0.99943489, 0.49325734],
+                             [- 6.27332973, -0.00035040, 0.00021465, 7.27297933, 0.99892969, 0.99943495, 0.49325743],
+                             [- 6.27332982, -0.00035036, 0.00021462, 7.27297947, 0.99892981, 0.99943502, 0.49325746],
+                             [- 6.27332992, -0.00035032, 0.00021460, 7.27297960, 0.99892993, 0.99943508, 0.49325750],
+                             [- 6.27333001, -0.00035028, 0.00021458, 7.27297973, 0.99893005, 0.99943515, 0.49325754],
+                             [- 6.27333011, -0.00035024, 0.00021455, 7.27297987, 0.99893017, 0.99943521, 0.49325751],
+                             [- 6.27333020, -0.00035020, 0.00021453, 7.27298000, 0.99893029, 0.99943527, 0.49325761],
+                             [- 6.27333030, -0.00035016, 0.00021450, 7.27298014, 0.99893041, 0.99943534, 0.49325752],
+                             [- 6.27333039, -0.00035012, 0.00021448, 7.27298027, 0.99893053, 0.99943540, 0.49325748],
+                             [- 6.27333049, -0.00035008, 0.00021445, 7.27298041, 0.99893065, 0.99943546, 0.49325770],
+                             [- 6.27333058, -0.00035004, 0.00021443, 7.27298054, 0.99893078, 0.99943553, 0.49325749],
+                             [- 6.27333068, -0.00035000, 0.00021441, 7.27298068, 0.99893090, 0.99943559, 0.49325754],
+                             [- 6.27333077, -0.00034996, 0.00021438, 7.27298081, 0.99893102, 0.99943566, 0.49325757],
+                             [- 6.27333087, -0.00034992, 0.00021436, 7.27298094, 0.99893114, 0.99943572, 0.49325772],
+                             [- 6.27333096, -0.00034988, 0.00021433, 7.27298108, 0.99893126, 0.99943578, 0.49325749],
+                             [- 6.27333106, -0.00034984, 0.00021431, 7.27298121, 0.99893138, 0.99943585, 0.49325746],
+                             [- 6.27333115, -0.00034980, 0.00021428, 7.27298135, 0.99893150, 0.99943591, 0.49325763],
+                             [- 6.27333125, -0.00034976, 0.00021426, 7.27298148, 0.99893162, 0.99943597, 0.49325780],
+                             [- 6.27333134, -0.00034973, 0.00021424, 7.27298162, 0.99893174, 0.99943604, 0.49325773],
+                             [- 6.27333144, -0.00034969, 0.00021421, 7.27298175, 0.99893186, 0.99943610, 0.49325774],
+                             [- 6.27333153, -0.00034965, 0.00021419, 7.27298188, 0.99893198, 0.99943617, 0.49325768],
+                             [- 6.27333162, -0.00034961, 0.00021416, 7.27298202, 0.99893210, 0.99943623, 0.49325772],
+                             [- 6.27333172, -0.00034957, 0.00021414, 7.27298215, 0.99893223, 0.99943629, 0.49325780],
+                             [- 6.27333181, -0.00034953, 0.00021412, 7.27298229, 0.99893235, 0.99943636, 0.49325790],
+                             [- 6.27333191, -0.00034949, 0.00021409, 7.27298242, 0.99893247, 0.99943642, 0.49325769],
+                             [- 6.27333200, -0.00034945, 0.00021407, 7.27298255, 0.99893259, 0.99943648, 0.49325784],
+                             [- 6.27333210, -0.00034941, 0.00021404, 7.27298269, 0.99893271, 0.99943655, 0.49325781],
+                             [- 6.27333219, -0.00034937, 0.00021402, 7.27298282, 0.99893283, 0.99943661, 0.49325781],
+                             [- 6.27333229, -0.00034933, 0.00021399, 7.27298296, 0.99893295, 0.99943668, 0.49325775],
+                             [- 6.27333238, -0.00034929, 0.00021397, 7.27298309, 0.99893307, 0.99943674, 0.49325777],
+                             [- 6.27333247, -0.00034925, 0.00021395, 7.27298322, 0.99893319, 0.99943680, 0.49325794],
+                             [- 6.27333257, -0.00034921, 0.00021392, 7.27298336, 0.99893331, 0.99943687, 0.49325786],
+                             [- 6.27333266, -0.00034917, 0.00021390, 7.27298349, 0.99893343, 0.99943693, 0.49325783],
+                             [- 6.27333276, -0.00034913, 0.00021387, 7.27298362, 0.99893355, 0.99943699, 0.49325777],
+                             [- 6.27333285, -0.00034909, 0.00021385, 7.27298376, 0.99893367, 0.99943706, 0.49325800],
+                             [- 6.27333295, -0.00034905, 0.00021383, 7.27298389, 0.99893379, 0.99943712, 0.49325788],
+                             [- 6.27333304, -0.00034902, 0.00021380, 7.27298402, 0.99893391, 0.99943718, 0.49325796],
+                             [- 6.27333313, -0.00034898, 0.00021378, 7.27298416, 0.99893403, 0.99943725, 0.49325777],
+                             [- 6.27333323, -0.00034894, 0.00021375, 7.27298429, 0.99893415, 0.99943731, 0.49325803],
+                             [- 6.27333332, -0.00034890, 0.00021373, 7.27298443, 0.99893427, 0.99943737, 0.49325799],
+                             [- 6.27333342, -0.00034886, 0.00021370, 7.27298456, 0.99893439, 0.99943744, 0.49325815],
+                             [- 6.27333351, -0.00034882, 0.00021368, 7.27298469, 0.99893451, 0.99943750, 0.49325810],
+                             [- 6.27333360, -0.00034878, 0.00021366, 7.27298483, 0.99893463, 0.99943756, 0.49325805],
+                             [- 6.27333370, -0.00034874, 0.00021363, 7.27298496, 0.99893475, 0.99943763, 0.49325805],
+                             [- 6.27333379, -0.00034870, 0.00021361, 7.27298509, 0.99893487, 0.99943769, 0.49325810],
+                             [- 6.27333389, -0.00034866, 0.00021358, 7.27298523, 0.99893499, 0.99943775, 0.49325812],
+                             [- 6.27333398, -0.00034862, 0.00021356, 7.27298536, 0.99893511, 0.99943782, 0.49325800],
+                             [- 6.27333408, -0.00034858, 0.00021354, 7.27298549, 0.99893523, 0.99943788, 0.49325798],
+                             [- 6.27333417, -0.00034854, 0.00021351, 7.27298563, 0.99893535, 0.99943794, 0.49325819],
+                             [- 6.27333426, -0.00034850, 0.00021349, 7.27298576, 0.99893547, 0.99943801, 0.49325809],
+                             [- 6.27333436, -0.00034847, 0.00021346, 7.27298589, 0.99893559, 0.99943807, 0.49325811],
+                             [- 6.27333445, -0.00034843, 0.00021344, 7.27298602, 0.99893571, 0.99943813, 0.49325804],
+                             [- 6.27333454, -0.00034839, 0.00021342, 7.27298616, 0.99893583, 0.99943820, 0.49325814],
+                             [- 6.27333464, -0.00034835, 0.00021339, 7.27298629, 0.99893595, 0.99943826, 0.49325817],
+                             [- 6.27333473, -0.00034831, 0.00021337, 7.27298642, 0.99893607, 0.99943832, 0.49325810],
+                             [- 6.27333483, -0.00034827, 0.00021334, 7.27298656, 0.99893619, 0.99943839, 0.49325810],
+                             [- 6.27333492, -0.00034823, 0.00021332, 7.27298669, 0.99893631, 0.99943845, 0.49325813],
+                             [- 6.27333501, -0.00034819, 0.00021330, 7.27298682, 0.99893643, 0.99943851, 0.49325821],
+                             [- 6.27333511, -0.00034815, 0.00021327, 7.27298696, 0.99893655, 0.99943858, 0.49325825],
+                             [- 6.27333520, -0.00034811, 0.00021325, 7.27298709, 0.99893667, 0.99943864, 0.49325802],
+                             [- 6.27333530, -0.00034807, 0.00021322, 7.27298722, 0.99893679, 0.99943870, 0.49325839],
+                             [- 6.27333539, -0.00034803, 0.00021320, 7.27298735, 0.99893691, 0.99943877, 0.49325824],
+                             [- 6.27333548, -0.00034800, 0.00021318, 7.27298749, 0.99893703, 0.99943883, 0.49325827],
+                             [- 6.27333558, -0.00034796, 0.00021315, 7.27298762, 0.99893715, 0.99943889, 0.49325830],
+                             [- 6.27333567, -0.00034792, 0.00021313, 7.27298775, 0.99893727, 0.99943895, 0.49325817],
+                             [- 6.27333576, -0.00034788, 0.00021310, 7.27298789, 0.99893739, 0.99943902, 0.49325841],
+                             [- 6.27333586, -0.00034784, 0.00021308, 7.27298802, 0.99893751, 0.99943908, 0.49325836],
+                             [- 6.27333595, -0.00034780, 0.00021306, 7.27298815, 0.99893763, 0.99943914, 0.49325836],
+                             [- 6.27333604, -0.00034776, 0.00021303, 7.27298828, 0.99893774, 0.99943921, 0.49325838],
+                             [- 6.27333614, -0.00034772, 0.00021301, 7.27298842, 0.99893786, 0.99943927, 0.49325845],
+                             [- 6.27333623, -0.00034768, 0.00021298, 7.27298855, 0.99893798, 0.99943933, 0.49325848],
+                             [- 6.27333632, -0.00034764, 0.00021296, 7.27298868, 0.99893810, 0.99943940, 0.49325833],
+                             [- 6.27333642, -0.00034760, 0.00021294, 7.27298881, 0.99893822, 0.99943946, 0.49325843],
+                             [- 6.27333651, -0.00034757, 0.00021291, 7.27298895, 0.99893834, 0.99943952, 0.49325849],
+                             [- 6.27333661, -0.00034753, 0.00021289, 7.27298908, 0.99893846, 0.99943958, 0.49325841],
+                             [- 6.27333670, -0.00034749, 0.00021286, 7.27298921, 0.99893858, 0.99943965, 0.49325856],
+                             [- 6.27333679, -0.00034745, 0.00021284, 7.27298934, 0.99893870, 0.99943971, 0.49325841],
+                             [- 6.27333689, -0.00034741, 0.00021282, 7.27298948, 0.99893882, 0.99943977, 0.49325845],
+                             [- 6.27333698, -0.00034737, 0.00021279, 7.27298961, 0.99893894, 0.99943984, 0.49325852],
+                             [- 6.27333707, -0.00034733, 0.00021277, 7.27298974, 0.99893906, 0.99943990, 0.49325863],
+                             [- 6.27333717, -0.00034729, 0.00021275, 7.27298987, 0.99893918, 0.99943996, 0.49325866],
+                             [- 6.27333726, -0.00034725, 0.00021272, 7.27299000, 0.99893929, 0.99944002, 0.49325856],
+                             [- 6.27333735, -0.00034721, 0.00021270, 7.27299014, 0.99893941, 0.99944009, 0.49325854],
+                             [- 6.27333745, -0.00034718, 0.00021267, 7.27299027, 0.99893953, 0.99944015, 0.49325858],
+                             [- 6.27333754, -0.00034714, 0.00021265, 7.27299040, 0.99893965, 0.99944021, 0.49325856],
+                             [- 6.27333763, -0.00034710, 0.00021263, 7.27299053, 0.99893977, 0.99944028, 0.49325873],
+                             [- 6.27333772, -0.00034706, 0.00021260, 7.27299067, 0.99893989, 0.99944034, 0.49325877],
+                             [- 6.27333782, -0.00034702, 0.00021258, 7.27299080, 0.99894001, 0.99944040, 0.49325864],
+                             [- 6.27333791, -0.00034698, 0.00021255, 7.27299093, 0.99894013, 0.99944046, 0.49325857],
+                             [- 6.27333800, -0.00034694, 0.00021253, 7.27299106, 0.99894025, 0.99944053, 0.49325852],
+                             [- 6.27333810, -0.00034690, 0.00021251, 7.27299119, 0.99894036, 0.99944059, 0.49325872],
+                             [- 6.27333819, -0.00034686, 0.00021248, 7.27299133, 0.99894048, 0.99944065, 0.49325865],
+                             [- 6.27333828, -0.00034683, 0.00021246, 7.27299146, 0.99894060, 0.99944072, 0.49325884],
+                             [- 6.27333838, -0.00034679, 0.00021244, 7.27299159, 0.99894072, 0.99944078, 0.49325864],
+                             [- 6.27333847, -0.00034675, 0.00021241, 7.27299172, 0.99894084, 0.99944084, 0.49325865],
+                             [- 6.27333856, -0.00034671, 0.00021239, 7.27299185, 0.99894096, 0.99944090, 0.49325871],
+                             [- 6.27333866, -0.00034667, 0.00021236, 7.27299199, 0.99894108, 0.99944097, 0.49325862],
+                             [- 6.27333875, -0.00034663, 0.00021234, 7.27299212, 0.99894120, 0.99944103, 0.49325892],
+                             [- 6.27333884, -0.00034659, 0.00021232, 7.27299225, 0.99894131, 0.99944109, 0.49325886],
+                             [- 6.27333893, -0.00034655, 0.00021229, 7.27299238, 0.99894143, 0.99944115, 0.49325892],
+                             [- 6.27333903, -0.00034652, 0.00021227, 7.27299251, 0.99894155, 0.99944122, 0.49325878],
+                             [- 6.27333912, -0.00034648, 0.00021225, 7.27299264, 0.99894167, 0.99944128, 0.49325893],
+                             [- 6.27333921, -0.00034644, 0.00021222, 7.27299278, 0.99894179, 0.99944134, 0.49325882],
+                             [- 6.27333931, -0.00034640, 0.00021220, 7.27299291, 0.99894191, 0.99944140, 0.49325880],
+                             [- 6.27333940, -0.00034636, 0.00021217, 7.27299304, 0.99894202, 0.99944147, 0.49325884],
+                             [- 6.27333949, -0.00034632, 0.00021215, 7.27299317, 0.99894214, 0.99944153, 0.49325871],
+                             [- 6.27333958, -0.00034628, 0.00021213, 7.27299330, 0.99894226, 0.99944159, 0.49325888],
+                             [- 6.27333968, -0.00034624, 0.00021210, 7.27299343, 0.99894238, 0.99944165, 0.49325907],
+                             [- 6.27333977, -0.00034620, 0.00021208, 7.27299356, 0.99894250, 0.99944172, 0.49325884],
+                             [- 6.27333986, -0.00034617, 0.00021206, 7.27299370, 0.99894262, 0.99944178, 0.49325906],
+                             [- 6.27333995, -0.00034613, 0.00021203, 7.27299383, 0.99894273, 0.99944184, 0.49325903],
+                             [- 6.27334005, -0.00034609, 0.00021201, 7.27299396, 0.99894285, 0.99944190, 0.49325895],
+                             [- 6.27334014, -0.00034605, 0.00021198, 7.27299409, 0.99894297, 0.99944197, 0.49325883],
+                             [- 6.27334023, -0.00034601, 0.00021196, 7.27299422, 0.99894309, 0.99944203, 0.49325893],
+                             [- 6.27334033, -0.00034597, 0.00021194, 7.27299435, 0.99894321, 0.99944209, 0.49325903],
+                             [- 6.27334042, -0.00034593, 0.00021191, 7.27299448, 0.99894333, 0.99944215, 0.49325919],
+                             [- 6.27334051, -0.00034590, 0.00021189, 7.27299461, 0.99894344, 0.99944222, 0.49325911],
+                             [- 6.27334060, -0.00034586, 0.00021187, 7.27299475, 0.99894356, 0.99944228, 0.49325916],
+                             [- 6.27334070, -0.00034582, 0.00021184, 7.27299488, 0.99894368, 0.99944234, 0.49325910],
+                             [- 6.27334079, -0.00034578, 0.00021182, 7.27299501, 0.99894380, 0.99944240, 0.49325905],
+                             [- 6.27334088, -0.00034574, 0.00021179, 7.27299514, 0.99894392, 0.99944246, 0.49325907],
+                             [- 6.27334097, -0.00034570, 0.00021177, 7.27299527, 0.99894403, 0.99944253, 0.49325918],
+                             [- 6.27334107, -0.00034566, 0.00021175, 7.27299540, 0.99894415, 0.99944259, 0.49325910],
+                             [- 6.27334116, -0.00034563, 0.00021172, 7.27299553, 0.99894427, 0.99944265, 0.49325909],
+                             [- 6.27334125, -0.00034559, 0.00021170, 7.27299566, 0.99894439, 0.99944271, 0.49325903],
+                             [- 6.27334134, -0.00034555, 0.00021168, 7.27299579, 0.99894451, 0.99944278, 0.49325934],
+                             [- 6.27334143, -0.00034551, 0.00021165, 7.27299593, 0.99894462, 0.99944284, 0.49325921],
+                             [- 6.27334153, -0.00034547, 0.00021163, 7.27299606, 0.99894474, 0.99944290, 0.49325916],
+                             [- 6.27334162, -0.00034543, 0.00021161, 7.27299619, 0.99894486, 0.99944296, 0.49325905],
+                             [- 6.27334171, -0.00034539, 0.00021158, 7.27299632, 0.99894498, 0.99944302, 0.49325932],
+                             [- 6.27334180, -0.00034536, 0.00021156, 7.27299645, 0.99894509, 0.99944309, 0.49325918],
+                             [- 6.27334190, -0.00034532, 0.00021153, 7.27299658, 0.99894521, 0.99944315, 0.49325928],
+                             [- 6.27334199, -0.00034528, 0.00021151, 7.27299671, 0.99894533, 0.99944321, 0.49325927],
+                             [- 6.27334208, -0.00034524, 0.00021149, 7.27299684, 0.99894545, 0.99944327, 0.49325910],
+                             [- 6.27334217, -0.00034520, 0.00021146, 7.27299697, 0.99894557, 0.99944334, 0.49325933],
+                             [- 6.27334226, -0.00034516, 0.00021144, 7.27299710, 0.99894568, 0.99944340, 0.49325931],
+                             [- 6.27334236, -0.00034512, 0.00021142, 7.27299723, 0.99894580, 0.99944346, 0.49325913],
+                             [- 6.27334245, -0.00034509, 0.00021139, 7.27299736, 0.99894592, 0.99944352, 0.49325935],
+                             [- 6.27334254, -0.00034505, 0.00021137, 7.27299749, 0.99894604, 0.99944358, 0.49325926],
+                             [- 6.27334263, -0.00034501, 0.00021135, 7.27299762, 0.99894615, 0.99944365, 0.49325931],
+                             [- 6.27334273, -0.00034497, 0.00021132, 7.27299776, 0.99894627, 0.99944371, 0.49325923],
+                             [- 6.27334282, -0.00034493, 0.00021130, 7.27299789, 0.99894639, 0.99944377, 0.49325932],
+                             [- 6.27334291, -0.00034489, 0.00021128, 7.27299802, 0.99894651, 0.99944383, 0.49325937],
+                             [- 6.27334300, -0.00034486, 0.00021125, 7.27299815, 0.99894662, 0.99944389, 0.49325925],
+                             [- 6.27334309, -0.00034482, 0.00021123, 7.27299828, 0.99894674, 0.99944396, 0.49325938],
+                             [- 6.27334319, -0.00034478, 0.00021120, 7.27299841, 0.99894686, 0.99944402, 0.49325937],
+                             [- 6.27334328, -0.00034474, 0.00021118, 7.27299854, 0.99894697, 0.99944408, 0.49325933],
+                             [- 6.27334337, -0.00034470, 0.00021116, 7.27299867, 0.99894709, 0.99944414, 0.49325964],
+                             [- 6.27334346, -0.00034466, 0.00021113, 7.27299880, 0.99894721, 0.99944420, 0.49325932],
+                             [- 6.27334355, -0.00034462, 0.00021111, 7.27299893, 0.99894733, 0.99944426, 0.49325939],
+                             [- 6.27334364, -0.00034459, 0.00021109, 7.27299906, 0.99894744, 0.99944433, 0.49325953],
+                             [- 6.27334374, -0.00034455, 0.00021106, 7.27299919, 0.99894756, 0.99944439, 0.49325955],
+                             [- 6.27334383, -0.00034451, 0.00021104, 7.27299932, 0.99894768, 0.99944445, 0.49325952],
+                             [- 6.27334392, -0.00034447, 0.00021102, 7.27299945, 0.99894780, 0.99944451, 0.49325957],
+                             [- 6.27334401, -0.00034443, 0.00021099, 7.27299958, 0.99894791, 0.99944457, 0.49325952],
+                             [- 6.27334410, -0.00034439, 0.00021097, 7.27299971, 0.99894803, 0.99944464, 0.49325948],
+                             [- 6.27334420, -0.00034436, 0.00021095, 7.27299984, 0.99894815, 0.99944470, 0.49325953],
+                             [- 6.27334429, -0.00034432, 0.00021092, 7.27299997, 0.99894826, 0.99944476, 0.49325969],
+                             [- 6.27334438, -0.00034428, 0.00021090, 7.27300010, 0.99894838, 0.99944482, 0.49325951],
+                             [- 6.27334447, -0.00034424, 0.00021088, 7.27300023, 0.99894850, 0.99944488, 0.49325964],
+                             [- 6.27334456, -0.00034420, 0.00021085, 7.27300036, 0.99894861, 0.99944494, 0.49325959],
+                             [- 6.27334465, -0.00034417, 0.00021083, 7.27300049, 0.99894873, 0.99944501, 0.49325984],
+                             [- 6.27334475, -0.00034413, 0.00021081, 7.27300062, 0.99894885, 0.99944507, 0.49325961],
+                             [- 6.27334484, -0.00034409, 0.00021078, 7.27300075, 0.99894897, 0.99944513, 0.49325970],
+                             [- 6.27334493, -0.00034405, 0.00021076, 7.27300088, 0.99894908, 0.99944519, 0.49325973],
+                             [- 6.27334502, -0.00034401, 0.00021073, 7.27300101, 0.99894920, 0.99944525, 0.49325965],
+                             [- 6.27334511, -0.00034397, 0.00021071, 7.27300114, 0.99894932, 0.99944531, 0.49325961],
+                             [- 6.27334520, -0.00034394, 0.00021069, 7.27300127, 0.99894943, 0.99944538, 0.49325970],
+                             [- 6.27334529, -0.00034390, 0.00021066, 7.27300140, 0.99894955, 0.99944544, 0.49325947],
+                             [- 6.27334539, -0.00034386, 0.00021064, 7.27300153, 0.99894967, 0.99944550, 0.49325970],
+                             [- 6.27334548, -0.00034382, 0.00021062, 7.27300166, 0.99894978, 0.99944556, 0.49325986],
+                             [- 6.27334557, -0.00034378, 0.00021059, 7.27300179, 0.99894990, 0.99944562, 0.49325975],
+                             [- 6.27334566, -0.00034374, 0.00021057, 7.27300192, 0.99895002, 0.99944568, 0.49325973],
+                             [- 6.27334575, -0.00034371, 0.00021055, 7.27300205, 0.99895013, 0.99944575, 0.49325990],
+                             [- 6.27334584, -0.00034367, 0.00021052, 7.27300217, 0.99895025, 0.99944581, 0.49325987],
+                             [- 6.27334593, -0.00034363, 0.00021050, 7.27300230, 0.99895037, 0.99944587, 0.49325975],
+                             [- 6.27334603, -0.00034359, 0.00021048, 7.27300243, 0.99895048, 0.99944593, 0.49325986],
+                             [- 6.27334612, -0.00034355, 0.00021045, 7.27300256, 0.99895060, 0.99944599, 0.49325980],
+                             [- 6.27334621, -0.00034352, 0.00021043, 7.27300269, 0.99895072, 0.99944605, 0.49325999],
+                             [- 6.27334630, -0.00034348, 0.00021041, 7.27300282, 0.99895083, 0.99944611, 0.49326005],
+                             [- 6.27334639, -0.00034344, 0.00021038, 7.27300295, 0.99895095, 0.99944618, 0.49325989],
+                             [- 6.27334648, -0.00034340, 0.00021036, 7.27300308, 0.99895106, 0.99944624, 0.49325982],
+                             [- 6.27334657, -0.00034336, 0.00021034, 7.27300321, 0.99895118, 0.99944630, 0.49326004],
+                             [- 6.27334666, -0.00034333, 0.00021031, 7.27300334, 0.99895130, 0.99944636, 0.49325987],
+                             [- 6.27334676, -0.00034329, 0.00021029, 7.27300347, 0.99895141, 0.99944642, 0.49326003],
+                             [- 6.27334685, -0.00034325, 0.00021027, 7.27300360, 0.99895153, 0.99944648, 0.49325986],
+                             [- 6.27334694, -0.00034321, 0.00021024, 7.27300373, 0.99895165, 0.99944654, 0.49326013],
+                             [- 6.27334703, -0.00034317, 0.00021022, 7.27300386, 0.99895176, 0.99944661, 0.49326001],
+                             [- 6.27334712, -0.00034313, 0.00021020, 7.27300399, 0.99895188, 0.99944667, 0.49325997],
+                             [- 6.27334721, -0.00034310, 0.00021017, 7.27300411, 0.99895199, 0.99944673, 0.49325982],
+                             [- 6.27334730, -0.00034306, 0.00021015, 7.27300424, 0.99895211, 0.99944679, 0.49326004],
+                             [- 6.27334739, -0.00034302, 0.00021013, 7.27300437, 0.99895223, 0.99944685, 0.49326000],
+                             [- 6.27334748, -0.00034298, 0.00021010, 7.27300450, 0.99895234, 0.99944691, 0.49326002],
+                             [- 6.27334758, -0.00034294, 0.00021008, 7.27300463, 0.99895246, 0.99944697, 0.49326019],
+                             [- 6.27334767, -0.00034291, 0.00021006, 7.27300476, 0.99895258, 0.99944704, 0.49326022],
+                             [- 6.27334776, -0.00034287, 0.00021003, 7.27300489, 0.99895269, 0.99944710, 0.49325991],
+                             [- 6.27334785, -0.00034283, 0.00021001, 7.27300502, 0.99895281, 0.99944716, 0.49326017],
+                             [- 6.27334794, -0.00034279, 0.00020999, 7.27300515, 0.99895292, 0.99944722, 0.49326012],
+                             [- 6.27334803, -0.00034276, 0.00020996, 7.27300527, 0.99895304, 0.99944728, 0.49326022],
+                             [- 6.27334812, -0.00034272, 0.00020994, 7.27300540, 0.99895316, 0.99944734, 0.49326001],
+                             [- 6.27334821, -0.00034268, 0.00020992, 7.27300553, 0.99895327, 0.99944740, 0.49326024],
+                             [- 6.27334830, -0.00034264, 0.00020989, 7.27300566, 0.99895339, 0.99944746, 0.49326021],
+                             [- 6.27334839, -0.00034260, 0.00020987, 7.27300579, 0.99895350, 0.99944753, 0.49326029],
+                             [- 6.27334848, -0.00034257, 0.00020985, 7.27300592, 0.99895362, 0.99944759, 0.49326016],
+                             [- 6.27334857, -0.00034253, 0.00020983, 7.27300605, 0.99895373, 0.99944765, 0.49326016],
+                             [- 6.27334867, -0.00034249, 0.00020980, 7.27300618, 0.99895385, 0.99944771, 0.49326045],
+                             [- 6.27334876, -0.00034245, 0.00020978, 7.27300630, 0.99895397, 0.99944777, 0.49326011],
+                             [- 6.27334885, -0.00034241, 0.00020976, 7.27300643, 0.99895408, 0.99944783, 0.49326023],
+                             [- 6.27334894, -0.00034238, 0.00020973, 7.27300656, 0.99895420, 0.99944789, 0.49326007],
+                             [- 6.27334903, -0.00034234, 0.00020971, 7.27300669, 0.99895431, 0.99944795, 0.49326021],
+                             [- 6.27334912, -0.00034230, 0.00020969, 7.27300682, 0.99895443, 0.99944801, 0.49326027],
+                             [- 6.27334921, -0.00034226, 0.00020966, 7.27300695, 0.99895454, 0.99944807, 0.49326040],
+                             [- 6.27334930, -0.00034222, 0.00020964, 7.27300708, 0.99895466, 0.99944814, 0.49326032],
+                             [- 6.27334939, -0.00034219, 0.00020962, 7.27300720, 0.99895478, 0.99944820, 0.49326028],
+                             [- 6.27334948, -0.00034215, 0.00020959, 7.27300733, 0.99895489, 0.99944826, 0.49326022],
+                             [- 6.27334957, -0.00034211, 0.00020957, 7.27300746, 0.99895501, 0.99944832, 0.49326044],
+                             [- 6.27334966, -0.00034207, 0.00020955, 7.27300759, 0.99895512, 0.99944838, 0.49326036],
+                             [- 6.27334975, -0.00034204, 0.00020952, 7.27300772, 0.99895524, 0.99944844, 0.49326052],
+                             [- 6.27334984, -0.00034200, 0.00020950, 7.27300785, 0.99895535, 0.99944850, 0.49326050],
+                             [- 6.27334993, -0.00034196, 0.00020948, 7.27300797, 0.99895547, 0.99944856, 0.49326047],
+                             [- 6.27335002, -0.00034192, 0.00020945, 7.27300810, 0.99895558, 0.99944862, 0.49326049],
+                             [- 6.27335011, -0.00034188, 0.00020943, 7.27300823, 0.99895570, 0.99944868, 0.49326038],
+                             [- 6.27335021, -0.00034185, 0.00020941, 7.27300836, 0.99895582, 0.99944875, 0.49326054],
+                             [- 6.27335030, -0.00034181, 0.00020938, 7.27300849, 0.99895593, 0.99944881, 0.49326041],
+                             [- 6.27335039, -0.00034177, 0.00020936, 7.27300861, 0.99895605, 0.99944887, 0.49326059],
+                             [- 6.27335048, -0.00034173, 0.00020934, 7.27300874, 0.99895616, 0.99944893, 0.49326058],
+                             [- 6.27335057, -0.00034170, 0.00020932, 7.27300887, 0.99895628, 0.99944899, 0.49326043],
+                             [- 6.27335066, -0.00034166, 0.00020929, 7.27300900, 0.99895639, 0.99944905, 0.49326062],
+                             [- 6.27335075, -0.00034162, 0.00020927, 7.27300913, 0.99895651, 0.99944911, 0.49326067],
+                             [- 6.27335084, -0.00034158, 0.00020925, 7.27300925, 0.99895662, 0.99944917, 0.49326078],
+                             [- 6.27335093, -0.00034154, 0.00020922, 7.27300938, 0.99895674, 0.99944923, 0.49326065],
+                             [- 6.27335102, -0.00034151, 0.00020920, 7.27300951, 0.99895685, 0.99944929, 0.49326059],
+                             [- 6.27335111, -0.00034147, 0.00020918, 7.27300964, 0.99895697, 0.99944935, 0.49326055],
+                             [- 6.27335120, -0.00034143, 0.00020915, 7.27300977, 0.99895708, 0.99944941, 0.49326066],
+                             [- 6.27335129, -0.00034139, 0.00020913, 7.27300989, 0.99895720, 0.99944948, 0.49326077],
+                             [- 6.27335138, -0.00034136, 0.00020911, 7.27301002, 0.99895731, 0.99944954, 0.49326066],
+                             [- 6.27335147, -0.00034132, 0.00020908, 7.27301015, 0.99895743, 0.99944960, 0.49326075],
+                             [- 6.27335156, -0.00034128, 0.00020906, 7.27301028, 0.99895754, 0.99944966, 0.49326055],
+                             [- 6.27335165, -0.00034124, 0.00020904, 7.27301040, 0.99895766, 0.99944972, 0.49326086],
+                             [- 6.27335174, -0.00034121, 0.00020902, 7.27301053, 0.99895777, 0.99944978, 0.49326055],
+                             [- 6.27335183, -0.00034117, 0.00020899, 7.27301066, 0.99895789, 0.99944984, 0.49326069],
+                             [- 6.27335192, -0.00034113, 0.00020897, 7.27301079, 0.99895800, 0.99944990, 0.49326076],
+                             [- 6.27335201, -0.00034109, 0.00020895, 7.27301092, 0.99895812, 0.99944996, 0.49326064],
+                             [- 6.27335210, -0.00034106, 0.00020892, 7.27301104, 0.99895823, 0.99945002, 0.49326064],
+                             [- 6.27335219, -0.00034102, 0.00020890, 7.27301117, 0.99895835, 0.99945008, 0.49326079],
+                             [- 6.27335228, -0.00034098, 0.00020888, 7.27301130, 0.99895846, 0.99945014, 0.49326094],
+                             [- 6.27335237, -0.00034094, 0.00020885, 7.27301143, 0.99895858, 0.99945020, 0.49326073],
+                             [- 6.27335246, -0.00034091, 0.00020883, 7.27301155, 0.99895869, 0.99945026, 0.49326067],
+                             [- 6.27335255, -0.00034087, 0.00020881, 7.27301168, 0.99895881, 0.99945032, 0.49326096],
+                             [- 6.27335264, -0.00034083, 0.00020878, 7.27301181, 0.99895892, 0.99945038, 0.49326074],
+                             [- 6.27335273, -0.00034079, 0.00020876, 7.27301194, 0.99895903, 0.99945045, 0.49326072],
+                             [- 6.27335282, -0.00034076, 0.00020874, 7.27301206, 0.99895915, 0.99945051, 0.49326097],
+                             [- 6.27335291, -0.00034072, 0.00020872, 7.27301219, 0.99895926, 0.99945057, 0.49326095],
+                             [- 6.27335300, -0.00034068, 0.00020869, 7.27301232, 0.99895938, 0.99945063, 0.49326083],
+                             [- 6.27335309, -0.00034064, 0.00020867, 7.27301244, 0.99895949, 0.99945069, 0.49326094],
+                             [- 6.27335318, -0.00034061, 0.00020865, 7.27301257, 0.99895961, 0.99945075, 0.49326071],
+                             [- 6.27335327, -0.00034057, 0.00020862, 7.27301270, 0.99895972, 0.99945081, 0.49326094],
+                             [- 6.27335336, -0.00034053, 0.00020860, 7.27301283, 0.99895984, 0.99945087, 0.49326119],
+                             [- 6.27335345, -0.00034049, 0.00020858, 7.27301295, 0.99895995, 0.99945093, 0.49326102],
+                             [- 6.27335354, -0.00034046, 0.00020856, 7.27301308, 0.99896007, 0.99945099, 0.49326095],
+                             [- 6.27335363, -0.00034042, 0.00020853, 7.27301321, 0.99896018, 0.99945105, 0.49326111],
+                             [- 6.27335372, -0.00034038, 0.00020851, 7.27301333, 0.99896029, 0.99945111, 0.49326093],
+                             [- 6.27335380, -0.00034034, 0.00020849, 7.27301346, 0.99896041, 0.99945117, 0.49326092],
+                             [- 6.27335389, -0.00034031, 0.00020846, 7.27301359, 0.99896052, 0.99945123, 0.49326086],
+                             [- 6.27335398, -0.00034027, 0.00020844, 7.27301372, 0.99896064, 0.99945129, 0.49326111],
+                             [- 6.27335407, -0.00034023, 0.00020842, 7.27301384, 0.99896075, 0.99945135, 0.49326085],
+                             [- 6.27335416, -0.00034019, 0.00020839, 7.27301397, 0.99896087, 0.99945141, 0.49326107],
+                             [- 6.27335425, -0.00034016, 0.00020837, 7.27301410, 0.99896098, 0.99945147, 0.49326138],
+                             [- 6.27335434, -0.00034012, 0.00020835, 7.27301422, 0.99896109, 0.99945153, 0.49326107],
+                             [- 6.27335443, -0.00034008, 0.00020833, 7.27301435, 0.99896121, 0.99945159, 0.49326110],
+                             [- 6.27335452, -0.00034004, 0.00020830, 7.27301448, 0.99896132, 0.99945165, 0.49326107],
+                             [- 6.27335461, -0.00034001, 0.00020828, 7.27301460, 0.99896144, 0.99945171, 0.49326111],
+                             [- 6.27335470, -0.00033997, 0.00020826, 7.27301473, 0.99896155, 0.99945177, 0.49326094],
+                             [- 6.27335479, -0.00033993, 0.00020823, 7.27301486, 0.99896166, 0.99945183, 0.49326116],
+                             [- 6.27335488, -0.00033989, 0.00020821, 7.27301498, 0.99896178, 0.99945189, 0.49326119],
+                             [- 6.27335497, -0.00033986, 0.00020819, 7.27301511, 0.99896189, 0.99945195, 0.49326130],
+                             [- 6.27335506, -0.00033982, 0.00020817, 7.27301524, 0.99896201, 0.99945201, 0.49326119],
+                             [- 6.27335515, -0.00033978, 0.00020814, 7.27301536, 0.99896212, 0.99945207, 0.49326105],
+                             [- 6.27335524, -0.00033975, 0.00020812, 7.27301549, 0.99896223, 0.99945213, 0.49326119],
+                             [- 6.27335533, -0.00033971, 0.00020810, 7.27301562, 0.99896235, 0.99945219, 0.49326118],
+                             [- 6.27335541, -0.00033967, 0.00020807, 7.27301574, 0.99896246, 0.99945225, 0.49326126],
+                             [- 6.27335550, -0.00033963, 0.00020805, 7.27301587, 0.99896258, 0.99945231, 0.49326104],
+                             [- 6.27335559, -0.00033960, 0.00020803, 7.27301600, 0.99896269, 0.99945237, 0.49326124],
+                             [- 6.27335568, -0.00033956, 0.00020801, 7.27301612, 0.99896280, 0.99945243, 0.49326121],
+                             [- 6.27335577, -0.00033952, 0.00020798, 7.27301625, 0.99896292, 0.99945249, 0.49326126],
+                             [- 6.27335586, -0.00033948, 0.00020796, 7.27301638, 0.99896303, 0.99945255, 0.49326146],
+                             [- 6.27335595, -0.00033945, 0.00020794, 7.27301650, 0.99896315, 0.99945261, 0.49326123],
+                             [- 6.27335604, -0.00033941, 0.00020791, 7.27301663, 0.99896326, 0.99945267, 0.49326137],
+                             [- 6.27335613, -0.00033937, 0.00020789, 7.27301675, 0.99896337, 0.99945274, 0.49326124],
+                             [- 6.27335622, -0.00033934, 0.00020787, 7.27301688, 0.99896349, 0.99945279, 0.49326144],
+                             [- 6.27335631, -0.00033930, 0.00020785, 7.27301701, 0.99896360, 0.99945286, 0.49326118],
+                             [- 6.27335639, -0.00033926, 0.00020782, 7.27301713, 0.99896371, 0.99945291, 0.49326131],
+                             [- 6.27335648, -0.00033922, 0.00020780, 7.27301726, 0.99896383, 0.99945297, 0.49326131],
+                             [- 6.27335657, -0.00033919, 0.00020778, 7.27301739, 0.99896394, 0.99945303, 0.49326137],
+                             [- 6.27335666, -0.00033915, 0.00020776, 7.27301751, 0.99896405, 0.99945309, 0.49326160],
+                             [- 6.27335675, -0.00033911, 0.00020773, 7.27301764, 0.99896417, 0.99945315, 0.49326160],
+                             [- 6.27335684, -0.00033908, 0.00020771, 7.27301776, 0.99896428, 0.99945321, 0.49326123],
+                             [- 6.27335693, -0.00033904, 0.00020769, 7.27301789, 0.99896439, 0.99945327, 0.49326161],
+                             [- 6.27335702, -0.00033900, 0.00020766, 7.27301802, 0.99896451, 0.99945333, 0.49326152],
+                             [- 6.27335711, -0.00033896, 0.00020764, 7.27301814, 0.99896462, 0.99945339, 0.49326143],
+                             [- 6.27335720, -0.00033893, 0.00020762, 7.27301827, 0.99896473, 0.99945345, 0.49326145],
+                             [- 6.27335728, -0.00033889, 0.00020760, 7.27301839, 0.99896485, 0.99945351, 0.49326173],
+                             [- 6.27335737, -0.00033885, 0.00020757, 7.27301852, 0.99896496, 0.99945357, 0.49326144],
+                             [- 6.27335746, -0.00033882, 0.00020755, 7.27301865, 0.99896507, 0.99945363, 0.49326151],
+                             [- 6.27335755, -0.00033878, 0.00020753, 7.27301877, 0.99896519, 0.99945369, 0.49326137],
+                             [- 6.27335764, -0.00033874, 0.00020751, 7.27301890, 0.99896530, 0.99945375, 0.49326159],
+                             [- 6.27335773, -0.00033870, 0.00020748, 7.27301902, 0.99896541, 0.99945381, 0.49326170],
+                             [- 6.27335782, -0.00033867, 0.00020746, 7.27301915, 0.99896553, 0.99945387, 0.49326167],
+                             [- 6.27335791, -0.00033863, 0.00020744, 7.27301927, 0.99896564, 0.99945393, 0.49326166],
+                             [- 6.27335799, -0.00033859, 0.00020741, 7.27301940, 0.99896575, 0.99945399, 0.49326169],
+                             [- 6.27335808, -0.00033856, 0.00020739, 7.27301953, 0.99896587, 0.99945405, 0.49326162],
+                             [- 6.27335817, -0.00033852, 0.00020737, 7.27301965, 0.99896598, 0.99945411, 0.49326183],
+                             [- 6.27335826, -0.00033848, 0.00020735, 7.27301978, 0.99896609, 0.99945417, 0.49326173],
+                             [- 6.27335835, -0.00033845, 0.00020732, 7.27301990, 0.99896621, 0.99945423, 0.49326171],
+                             [- 6.27335844, -0.00033841, 0.00020730, 7.27302003, 0.99896632, 0.99945429, 0.49326166],
+                             [- 6.27335853, -0.00033837, 0.00020728, 7.27302015, 0.99896643, 0.99945435, 0.49326165],
+                             [- 6.27335861, -0.00033833, 0.00020726, 7.27302028, 0.99896655, 0.99945441, 0.49326181],
+                             [- 6.27335870, -0.00033830, 0.00020723, 7.27302041, 0.99896666, 0.99945447, 0.49326156],
+                             [- 6.27335879, -0.00033826, 0.00020721, 7.27302053, 0.99896677, 0.99945453, 0.49326193],
+                             [- 6.27335888, -0.00033822, 0.00020719, 7.27302066, 0.99896688, 0.99945459, 0.49326181],
+                             [- 6.27335897, -0.00033819, 0.00020716, 7.27302078, 0.99896700, 0.99945465, 0.49326163],
+                             [- 6.27335906, -0.00033815, 0.00020714, 7.27302091, 0.99896711, 0.99945471, 0.49326173],
+                             [- 6.27335915, -0.00033811, 0.00020712, 7.27302103, 0.99896722, 0.99945477, 0.49326188],
+                             [- 6.27335923, -0.00033808, 0.00020710, 7.27302116, 0.99896734, 0.99945483, 0.49326193],
+                             [- 6.27335932, -0.00033804, 0.00020707, 7.27302128, 0.99896745, 0.99945489, 0.49326203],
+                             [- 6.27335941, -0.00033800, 0.00020705, 7.27302141, 0.99896756, 0.99945495, 0.49326181],
+                             [- 6.27335950, -0.00033797, 0.00020703, 7.27302153, 0.99896767, 0.99945501, 0.49326178],
+                             [- 6.27335959, -0.00033793, 0.00020701, 7.27302166, 0.99896779, 0.99945507, 0.49326183],
+                             [- 6.27335968, -0.00033789, 0.00020698, 7.27302178, 0.99896790, 0.99945512, 0.49326183],
+                             [- 6.27335976, -0.00033785, 0.00020696, 7.27302191, 0.99896801, 0.99945518, 0.49326190],
+                             [- 6.27335985, -0.00033782, 0.00020694, 7.27302203, 0.99896813, 0.99945524, 0.49326204],
+                             [- 6.27335994, -0.00033778, 0.00020692, 7.27302216, 0.99896824, 0.99945530, 0.49326197],
+                             [- 6.27336003, -0.00033774, 0.00020689, 7.27302228, 0.99896835, 0.99945536, 0.49326200],
+                             [- 6.27336012, -0.00033771, 0.00020687, 7.27302241, 0.99896846, 0.99945542, 0.49326187],
+                             [- 6.27336021, -0.00033767, 0.00020685, 7.27302253, 0.99896858, 0.99945548, 0.49326214],
+                             [- 6.27336029, -0.00033763, 0.00020683, 7.27302266, 0.99896869, 0.99945554, 0.49326210],
+                             [- 6.27336038, -0.00033760, 0.00020680, 7.27302278, 0.99896880, 0.99945560, 0.49326210],
+                             [- 6.27336047, -0.00033756, 0.00020678, 7.27302291, 0.99896891, 0.99945566, 0.49326201],
+                             [- 6.27336056, -0.00033752, 0.00020676, 7.27302303, 0.99896903, 0.99945572, 0.49326223],
+                             [- 6.27336065, -0.00033749, 0.00020674, 7.27302316, 0.99896914, 0.99945578, 0.49326214],
+                             [- 6.27336073, -0.00033745, 0.00020671, 7.27302328, 0.99896925, 0.99945584, 0.49326184],
+                             [- 6.27336082, -0.00033741, 0.00020669, 7.27302341, 0.99896936, 0.99945590, 0.49326190],
+                             [- 6.27336091, -0.00033738, 0.00020667, 7.27302353, 0.99896948, 0.99945596, 0.49326192],
+                             [- 6.27336100, -0.00033734, 0.00020665, 7.27302366, 0.99896959, 0.99945602, 0.49326215],
+                             [- 6.27336109, -0.00033730, 0.00020662, 7.27302378, 0.99896970, 0.99945607, 0.49326198],
+                             [- 6.27336117, -0.00033727, 0.00020660, 7.27302391, 0.99896981, 0.99945613, 0.49326211],
+                             [- 6.27336126, -0.00033723, 0.00020658, 7.27302403, 0.99896992, 0.99945619, 0.49326202],
+                             [- 6.27336135, -0.00033719, 0.00020656, 7.27302416, 0.99897004, 0.99945625, 0.49326208],
+                             [- 6.27336144, -0.00033716, 0.00020653, 7.27302428, 0.99897015, 0.99945631, 0.49326216],
+                             [- 6.27336153, -0.00033712, 0.00020651, 7.27302441, 0.99897026, 0.99945637, 0.49326199],
+                             [- 6.27336161, -0.00033708, 0.00020649, 7.27302453, 0.99897037, 0.99945643, 0.49326218],
+                             [- 6.27336170, -0.00033705, 0.00020647, 7.27302466, 0.99897049, 0.99945649, 0.49326214],
+                             [- 6.27336179, -0.00033701, 0.00020644, 7.27302478, 0.99897060, 0.99945655, 0.49326240],
+                             [- 6.27336188, -0.00033697, 0.00020642, 7.27302491, 0.99897071, 0.99945661, 0.49326199],
+                             [- 6.27336197, -0.00033694, 0.00020640, 7.27302503, 0.99897082, 0.99945667, 0.49326203],
+                             [- 6.27336205, -0.00033690, 0.00020638, 7.27302515, 0.99897093, 0.99945673, 0.49326224],
+                             [- 6.27336214, -0.00033686, 0.00020635, 7.27302528, 0.99897105, 0.99945679, 0.49326220],
+                             [- 6.27336223, -0.00033683, 0.00020633, 7.27302540, 0.99897116, 0.99945684, 0.49326222],
+                             [- 6.27336232, -0.00033679, 0.00020631, 7.27302553, 0.99897127, 0.99945690, 0.49326242],
+                             [- 6.27336240, -0.00033675, 0.00020629, 7.27302565, 0.99897138, 0.99945696, 0.49326213],
+                             [- 6.27336249, -0.00033672, 0.00020626, 7.27302578, 0.99897149, 0.99945702, 0.49326219],
+                             [- 6.27336258, -0.00033668, 0.00020624, 7.27302590, 0.99897161, 0.99945708, 0.49326219],
+                             [- 6.27336267, -0.00033664, 0.00020622, 7.27302603, 0.99897172, 0.99945714, 0.49326250],
+                             [- 6.27336275, -0.00033661, 0.00020620, 7.27302615, 0.99897183, 0.99945720, 0.49326244],
+                             [- 6.27336284, -0.00033657, 0.00020617, 7.27302627, 0.99897194, 0.99945726, 0.49326221],
+                             [- 6.27336293, -0.00033653, 0.00020615, 7.27302640, 0.99897205, 0.99945732, 0.49326264],
+                             [- 6.27336302, -0.00033650, 0.00020613, 7.27302652, 0.99897216, 0.99945738, 0.49326232],
+                             [- 6.27336311, -0.00033646, 0.00020611, 7.27302665, 0.99897228, 0.99945743, 0.49326230],
+                             [- 6.27336319, -0.00033642, 0.00020608, 7.27302677, 0.99897239, 0.99945749, 0.49326227],
+                             [- 6.27336328, -0.00033639, 0.00020606, 7.27302689, 0.99897250, 0.99945755, 0.49326245],
+                             [- 6.27336337, -0.00033635, 0.00020604, 7.27302702, 0.99897261, 0.99945761, 0.49326242],
+                             [- 6.27336346, -0.00033631, 0.00020602, 7.27302714, 0.99897272, 0.99945767, 0.49326246],
+                             [- 6.27336354, -0.00033628, 0.00020599, 7.27302727, 0.99897283, 0.99945773, 0.49326241],
+                             [- 6.27336363, -0.00033624, 0.00020597, 7.27302739, 0.99897295, 0.99945779, 0.49326240],
+                             [- 6.27336372, -0.00033620, 0.00020595, 7.27302751, 0.99897306, 0.99945785, 0.49326249],
+                             [- 6.27336381, -0.00033617, 0.00020593, 7.27302764, 0.99897317, 0.99945791, 0.49326270],
+                             [- 6.27336389, -0.00033613, 0.00020590, 7.27302776, 0.99897328, 0.99945797, 0.49326235],
+                             [- 6.27336398, -0.00033609, 0.00020588, 7.27302789, 0.99897339, 0.99945802, 0.49326239],
+                             [- 6.27336407, -0.00033606, 0.00020586, 7.27302801, 0.99897350, 0.99945808, 0.49326248],
+                             [- 6.27336415, -0.00033602, 0.00020584, 7.27302813, 0.99897362, 0.99945814, 0.49326264],
+                             [- 6.27336424, -0.00033598, 0.00020582, 7.27302826, 0.99897373, 0.99945820, 0.49326263],
+                             [- 6.27336433, -0.00033595, 0.00020579, 7.27302838, 0.99897384, 0.99945826, 0.49326243],
+                             [- 6.27336442, -0.00033591, 0.00020577, 7.27302851, 0.99897395, 0.99945832, 0.49326267],
+                             [- 6.27336450, -0.00033587, 0.00020575, 7.27302863, 0.99897406, 0.99945838, 0.49326234],
+                             [- 6.27336459, -0.00033584, 0.00020573, 7.27302875, 0.99897417, 0.99945844, 0.49326251],
+                             [- 6.27336468, -0.00033580, 0.00020570, 7.27302888, 0.99897428, 0.99945849, 0.49326259],
+                             [- 6.27336477, -0.00033577, 0.00020568, 7.27302900, 0.99897439, 0.99945855, 0.49326266],
+                             [- 6.27336485, -0.00033573, 0.00020566, 7.27302912, 0.99897451, 0.99945861, 0.49326257],
+                             [- 6.27336494, -0.00033569, 0.00020564, 7.27302925, 0.99897462, 0.99945867, 0.49326257],
+                             [- 6.27336503, -0.00033566, 0.00020561, 7.27302937, 0.99897473, 0.99945873, 0.49326264],
+                             [- 6.27336511, -0.00033562, 0.00020559, 7.27302949, 0.99897484, 0.99945879, 0.49326274],
+                             [- 6.27336520, -0.00033558, 0.00020557, 7.27302962, 0.99897495, 0.99945885, 0.49326286],
+                             [- 6.27336529, -0.00033555, 0.00020555, 7.27302974, 0.99897506, 0.99945891, 0.49326289],
+                             [- 6.27336538, -0.00033551, 0.00020553, 7.27302986, 0.99897517, 0.99945896, 0.49326274],
+                             [- 6.27336546, -0.00033547, 0.00020550, 7.27302999, 0.99897528, 0.99945902, 0.49326267],
+                             [- 6.27336555, -0.00033544, 0.00020548, 7.27303011, 0.99897540, 0.99945908, 0.49326282],
+                             [- 6.27336564, -0.00033540, 0.00020546, 7.27303023, 0.99897551, 0.99945914, 0.49326268],
+                             [- 6.27336572, -0.00033537, 0.00020544, 7.27303036, 0.99897562, 0.99945920, 0.49326305],
+                             [- 6.27336581, -0.00033533, 0.00020541, 7.27303048, 0.99897573, 0.99945926, 0.49326276],
+                             [- 6.27336590, -0.00033529, 0.00020539, 7.27303060, 0.99897584, 0.99945932, 0.49326281],
+                             [- 6.27336598, -0.00033526, 0.00020537, 7.27303073, 0.99897595, 0.99945937, 0.49326294],
+                             [- 6.27336607, -0.00033522, 0.00020535, 7.27303085, 0.99897606, 0.99945943, 0.49326286],
+                             [- 6.27336616, -0.00033518, 0.00020532, 7.27303097, 0.99897617, 0.99945949, 0.49326281],
+                             [- 6.27336625, -0.00033515, 0.00020530, 7.27303110, 0.99897628, 0.99945955, 0.49326286],
+                             [- 6.27336633, -0.00033511, 0.00020528, 7.27303122, 0.99897639, 0.99945961, 0.49326297],
+                             [- 6.27336642, -0.00033508, 0.00020526, 7.27303134, 0.99897650, 0.99945967, 0.49326279],
+                             [- 6.27336651, -0.00033504, 0.00020524, 7.27303147, 0.99897662, 0.99945973, 0.49326311],
+                             [- 6.27336659, -0.00033500, 0.00020521, 7.27303159, 0.99897673, 0.99945978, 0.49326289],
+                             [- 6.27336668, -0.00033497, 0.00020519, 7.27303171, 0.99897684, 0.99945984, 0.49326305],
+                             [- 6.27336677, -0.00033493, 0.00020517, 7.27303184, 0.99897695, 0.99945990, 0.49326297],
+                             [- 6.27336685, -0.00033489, 0.00020515, 7.27303196, 0.99897706, 0.99945996, 0.49326277],
+                             [- 6.27336694, -0.00033486, 0.00020512, 7.27303208, 0.99897717, 0.99946002, 0.49326308],
+                             [- 6.27336703, -0.00033482, 0.00020510, 7.27303221, 0.99897728, 0.99946008, 0.49326289],
+                             [- 6.27336711, -0.00033479, 0.00020508, 7.27303233, 0.99897739, 0.99946013, 0.49326298],
+                             [- 6.27336720, -0.00033475, 0.00020506, 7.27303245, 0.99897750, 0.99946019, 0.49326300],
+                             [- 6.27336729, -0.00033471, 0.00020504, 7.27303257, 0.99897761, 0.99946025, 0.49326304],
+                             [- 6.27336737, -0.00033468, 0.00020501, 7.27303270, 0.99897772, 0.99946031, 0.49326311],
+                             [- 6.27336746, -0.00033464, 0.00020499, 7.27303282, 0.99897783, 0.99946037, 0.49326309],
+                             [- 6.27336755, -0.00033460, 0.00020497, 7.27303294, 0.99897794, 0.99946043, 0.49326303],
+                             [- 6.27336763, -0.00033457, 0.00020495, 7.27303306, 0.99897805, 0.99946048, 0.49326308],
+                             [- 6.27336772, -0.00033453, 0.00020493, 7.27303319, 0.99897816, 0.99946054, 0.49326287],
+                             [- 6.27336781, -0.00033450, 0.00020490, 7.27303331, 0.99897827, 0.99946060, 0.49326314],
+                             [- 6.27336789, -0.00033446, 0.00020488, 7.27303343, 0.99897839, 0.99946066, 0.49326307],
+                             [- 6.27336798, -0.00033442, 0.00020486, 7.27303356, 0.99897850, 0.99946072, 0.49326307],
+                             [- 6.27336807, -0.00033439, 0.00020484, 7.27303368, 0.99897861, 0.99946078, 0.49326322],
+                             [- 6.27336815, -0.00033435, 0.00020481, 7.27303380, 0.99897872, 0.99946083, 0.49326311],
+                             [- 6.27336824, -0.00033432, 0.00020479, 7.27303392, 0.99897883, 0.99946089, 0.49326322],
+                             [- 6.27336833, -0.00033428, 0.00020477, 7.27303405, 0.99897894, 0.99946095, 0.49326339],
+                             [- 6.27336841, -0.00033424, 0.00020475, 7.27303417, 0.99897905, 0.99946101, 0.49326319],
+                             [- 6.27336850, -0.00033421, 0.00020473, 7.27303429, 0.99897916, 0.99946107, 0.49326315],
+                             [- 6.27336858, -0.00033417, 0.00020470, 7.27303441, 0.99897927, 0.99946113, 0.49326326],
+                             [- 6.27336867, -0.00033413, 0.00020468, 7.27303454, 0.99897938, 0.99946118, 0.49326320],
+                             [- 6.27336876, -0.00033410, 0.00020466, 7.27303466, 0.99897949, 0.99946124, 0.49326335],
+                             [- 6.27336884, -0.00033406, 0.00020464, 7.27303478, 0.99897960, 0.99946130, 0.49326321],
+                             [- 6.27336893, -0.00033403, 0.00020462, 7.27303490, 0.99897971, 0.99946136, 0.49326341],
+                             [- 6.27336902, -0.00033399, 0.00020459, 7.27303503, 0.99897982, 0.99946142, 0.49326319],
+                             [- 6.27336910, -0.00033395, 0.00020457, 7.27303515, 0.99897993, 0.99946147, 0.49326349],
+                             [- 6.27336919, -0.00033392, 0.00020455, 7.27303527, 0.99898004, 0.99946153, 0.49326330],
+                             [- 6.27336927, -0.00033388, 0.00020453, 7.27303539, 0.99898015, 0.99946159, 0.49326316],
+                             [- 6.27336936, -0.00033385, 0.00020451, 7.27303551, 0.99898026, 0.99946165, 0.49326319],
+                             [- 6.27336945, -0.00033381, 0.00020448, 7.27303564, 0.99898037, 0.99946171, 0.49326337],
+                             [- 6.27336953, -0.00033377, 0.00020446, 7.27303576, 0.99898048, 0.99946176, 0.49326350],
+                             [- 6.27336962, -0.00033374, 0.00020444, 7.27303588, 0.99898059, 0.99946182, 0.49326333],
+                             [- 6.27336971, -0.00033370, 0.00020442, 7.27303600, 0.99898070, 0.99946188, 0.49326343],
+                             [- 6.27336979, -0.00033367, 0.00020439, 7.27303613, 0.99898081, 0.99946194, 0.49326342],
+                             [- 6.27336988, -0.00033363, 0.00020437, 7.27303625, 0.99898092, 0.99946200, 0.49326348],
+                             [- 6.27336996, -0.00033359, 0.00020435, 7.27303637, 0.99898103, 0.99946205, 0.49326358],
+                             [- 6.27337005, -0.00033356, 0.00020433, 7.27303649, 0.99898114, 0.99946211, 0.49326344],
+                             [- 6.27337014, -0.00033352, 0.00020431, 7.27303661, 0.99898125, 0.99946217, 0.49326333],
+                             [- 6.27337022, -0.00033349, 0.00020428, 7.27303674, 0.99898136, 0.99946223, 0.49326344],
+                             [- 6.27337031, -0.00033345, 0.00020426, 7.27303686, 0.99898147, 0.99946229, 0.49326346],
+                             [- 6.27337039, -0.00033342, 0.00020424, 7.27303698, 0.99898158, 0.99946234, 0.49326354],
+                             [- 6.27337048, -0.00033338, 0.00020422, 7.27303710, 0.99898169, 0.99946240, 0.49326336],
+                             [- 6.27337057, -0.00033334, 0.00020420, 7.27303722, 0.99898180, 0.99946246, 0.49326349],
+                             [- 6.27337065, -0.00033331, 0.00020417, 7.27303734, 0.99898191, 0.99946252, 0.49326348],
+                             [- 6.27337074, -0.00033327, 0.00020415, 7.27303747, 0.99898202, 0.99946258, 0.49326342],
+                             [- 6.27337082, -0.00033324, 0.00020413, 7.27303759, 0.99898213, 0.99946263, 0.49326343],
+                             [- 6.27337091, -0.00033320, 0.00020411, 7.27303771, 0.99898224, 0.99946269, 0.49326362],
+                             [- 6.27337100, -0.00033316, 0.00020409, 7.27303783, 0.99898234, 0.99946275, 0.49326356],
+                             [- 6.27337108, -0.00033313, 0.00020406, 7.27303795, 0.99898245, 0.99946281, 0.49326362],
+                             [- 6.27337117, -0.00033309, 0.00020404, 7.27303808, 0.99898256, 0.99946287, 0.49326353],
+                             [- 6.27337125, -0.00033306, 0.00020402, 7.27303820, 0.99898267, 0.99946292, 0.49326384],
+                             [- 6.27337134, -0.00033302, 0.00020400, 7.27303832, 0.99898278, 0.99946298, 0.49326355],
+                             [- 6.27337142, -0.00033298, 0.00020398, 7.27303844, 0.99898289, 0.99946304, 0.49326361],
+                             [- 6.27337151, -0.00033295, 0.00020395, 7.27303856, 0.99898300, 0.99946310, 0.49326362],
+                             [- 6.27337160, -0.00033291, 0.00020393, 7.27303868, 0.99898311, 0.99946315, 0.49326349],
+                             [- 6.27337168, -0.00033288, 0.00020391, 7.27303880, 0.99898322, 0.99946321, 0.49326369],
+                             [- 6.27337177, -0.00033284, 0.00020389, 7.27303893, 0.99898333, 0.99946327, 0.49326369],
+                             [- 6.27337185, -0.00033281, 0.00020387, 7.27303905, 0.99898344, 0.99946333, 0.49326369],
+                             [- 6.27337194, -0.00033277, 0.00020385, 7.27303917, 0.99898355, 0.99946338, 0.49326367],
+                             [- 6.27337202, -0.00033273, 0.00020382, 7.27303929, 0.99898366, 0.99946344, 0.49326359],
+                             [- 6.27337211, -0.00033270, 0.00020380, 7.27303941, 0.99898377, 0.99946350, 0.49326376],
+                             [- 6.27337220, -0.00033266, 0.00020378, 7.27303953, 0.99898388, 0.99946356, 0.49326382],
+                             [- 6.27337228, -0.00033263, 0.00020376, 7.27303965, 0.99898399, 0.99946362, 0.49326384],
+                             [- 6.27337237, -0.00033259, 0.00020374, 7.27303978, 0.99898409, 0.99946367, 0.49326379],
+                             [- 6.27337245, -0.00033256, 0.00020371, 7.27303990, 0.99898420, 0.99946373, 0.49326389],
+                             [- 6.27337254, -0.00033252, 0.00020369, 7.27304002, 0.99898431, 0.99946379, 0.49326390],
+                             [- 6.27337262, -0.00033248, 0.00020367, 7.27304014, 0.99898442, 0.99946385, 0.49326379],
+                             [- 6.27337271, -0.00033245, 0.00020365, 7.27304026, 0.99898453, 0.99946390, 0.49326384],
+                             [- 6.27337279, -0.00033241, 0.00020363, 7.27304038, 0.99898464, 0.99946396, 0.49326381],
+                             [- 6.27337288, -0.00033238, 0.00020360, 7.27304050, 0.99898475, 0.99946402, 0.49326372],
+                             [- 6.27337297, -0.00033234, 0.00020358, 7.27304062, 0.99898486, 0.99946408, 0.49326377],
+                             [- 6.27337305, -0.00033231, 0.00020356, 7.27304075, 0.99898497, 0.99946413, 0.49326406],
+                             [- 6.27337314, -0.00033227, 0.00020354, 7.27304087, 0.99898508, 0.99946419, 0.49326380],
+                             [- 6.27337322, -0.00033223, 0.00020352, 7.27304099, 0.99898519, 0.99946425, 0.49326407],
+                             [- 6.27337331, -0.00033220, 0.00020350, 7.27304111, 0.99898529, 0.99946431, 0.49326377],
+                             [- 6.27337339, -0.00033216, 0.00020347, 7.27304123, 0.99898540, 0.99946436, 0.49326399],
+                             [- 6.27337348, -0.00033213, 0.00020345, 7.27304135, 0.99898551, 0.99946442, 0.49326392],
+                             [- 6.27337356, -0.00033209, 0.00020343, 7.27304147, 0.99898562, 0.99946448, 0.49326402],
+                             [- 6.27337365, -0.00033206, 0.00020341, 7.27304159, 0.99898573, 0.99946454, 0.49326407],
+                             [- 6.27337373, -0.00033202, 0.00020339, 7.27304171, 0.99898584, 0.99946459, 0.49326397],
+                             [- 6.27337382, -0.00033198, 0.00020336, 7.27304183, 0.99898595, 0.99946465, 0.49326388],
+                             [- 6.27337390, -0.00033195, 0.00020334, 7.27304196, 0.99898606, 0.99946471, 0.49326400],
+                             [- 6.27337399, -0.00033191, 0.00020332, 7.27304208, 0.99898616, 0.99946477, 0.49326405],
+                             [- 6.27337407, -0.00033188, 0.00020330, 7.27304220, 0.99898627, 0.99946482, 0.49326405],
+                             [- 6.27337416, -0.00033184, 0.00020328, 7.27304232, 0.99898638, 0.99946488, 0.49326395],
+                             [- 6.27337425, -0.00033181, 0.00020326, 7.27304244, 0.99898649, 0.99946494, 0.49326406],
+                             [- 6.27337433, -0.00033177, 0.00020323, 7.27304256, 0.99898660, 0.99946500, 0.49326412],
+                             [- 6.27337442, -0.00033174, 0.00020321, 7.27304268, 0.99898671, 0.99946505, 0.49326418],
+                             [- 6.27337450, -0.00033170, 0.00020319, 7.27304280, 0.99898682, 0.99946511, 0.49326405],
+                             [- 6.27337459, -0.00033166, 0.00020317, 7.27304292, 0.99898693, 0.99946517, 0.49326394],
+                             [- 6.27337467, -0.00033163, 0.00020315, 7.27304304, 0.99898703, 0.99946522, 0.49326407],
+                             [- 6.27337476, -0.00033159, 0.00020312, 7.27304316, 0.99898714, 0.99946528, 0.49326381],
+                             [- 6.27337484, -0.00033156, 0.00020310, 7.27304328, 0.99898725, 0.99946534, 0.49326400],
+                             [- 6.27337493, -0.00033152, 0.00020308, 7.27304340, 0.99898736, 0.99946540, 0.49326414],
+                             [- 6.27337501, -0.00033149, 0.00020306, 7.27304352, 0.99898747, 0.99946545, 0.49326426],
+                             [- 6.27337510, -0.00033145, 0.00020304, 7.27304364, 0.99898758, 0.99946551, 0.49326422],
+                             [- 6.27337518, -0.00033142, 0.00020302, 7.27304376, 0.99898768, 0.99946557, 0.49326412],
+                             [- 6.27337527, -0.00033138, 0.00020299, 7.27304389, 0.99898779, 0.99946563, 0.49326410],
+                             [- 6.27337535, -0.00033135, 0.00020297, 7.27304401, 0.99898790, 0.99946568, 0.49326415],
+                             [- 6.27337544, -0.00033131, 0.00020295, 7.27304413, 0.99898801, 0.99946574, 0.49326422],
+                             [- 6.27337552, -0.00033127, 0.00020293, 7.27304425, 0.99898812, 0.99946580, 0.49326416],
+                             [- 6.27337561, -0.00033124, 0.00020291, 7.27304437, 0.99898823, 0.99946585, 0.49326449],
+                             [- 6.27337569, -0.00033120, 0.00020289, 7.27304449, 0.99898833, 0.99946591, 0.49326425],
+                             [- 6.27337578, -0.00033117, 0.00020286, 7.27304461, 0.99898844, 0.99946597, 0.49326435],
+                             [- 6.27337586, -0.00033113, 0.00020284, 7.27304473, 0.99898855, 0.99946603, 0.49326445],
+                             [- 6.27337594, -0.00033110, 0.00020282, 7.27304485, 0.99898866, 0.99946608, 0.49326455],
+                             [- 6.27337603, -0.00033106, 0.00020280, 7.27304497, 0.99898877, 0.99946614, 0.49326433],
+                             [- 6.27337611, -0.00033103, 0.00020278, 7.27304509, 0.99898888, 0.99946620, 0.49326418],
+                             [- 6.27337620, -0.00033099, 0.00020275, 7.27304521, 0.99898898, 0.99946625, 0.49326429],
+                             [- 6.27337628, -0.00033096, 0.00020273, 7.27304533, 0.99898909, 0.99946631, 0.49326433],
+                             [- 6.27337637, -0.00033092, 0.00020271, 7.27304545, 0.99898920, 0.99946637, 0.49326438],
+                             [- 6.27337645, -0.00033088, 0.00020269, 7.27304557, 0.99898931, 0.99946643, 0.49326440],
+                             [- 6.27337654, -0.00033085, 0.00020267, 7.27304569, 0.99898942, 0.99946648, 0.49326448],
+                             [- 6.27337662, -0.00033081, 0.00020265, 7.27304581, 0.99898952, 0.99946654, 0.49326440],
+                             [- 6.27337671, -0.00033078, 0.00020262, 7.27304593, 0.99898963, 0.99946660, 0.49326441],
+                             [- 6.27337679, -0.00033074, 0.00020260, 7.27304605, 0.99898974, 0.99946665, 0.49326439],
+                             [- 6.27337688, -0.00033071, 0.00020258, 7.27304617, 0.99898985, 0.99946671, 0.49326444],
+                             [- 6.27337696, -0.00033067, 0.00020256, 7.27304629, 0.99898996, 0.99946677, 0.49326437],
+                             [- 6.27337705, -0.00033064, 0.00020254, 7.27304641, 0.99899006, 0.99946682, 0.49326463],
+                             [- 6.27337713, -0.00033060, 0.00020252, 7.27304653, 0.99899017, 0.99946688, 0.49326433],
+                             [- 6.27337721, -0.00033057, 0.00020250, 7.27304665, 0.99899028, 0.99946694, 0.49326452],
+                             [- 6.27337730, -0.00033053, 0.00020247, 7.27304677, 0.99899039, 0.99946700, 0.49326464],
+                             [- 6.27337738, -0.00033050, 0.00020245, 7.27304689, 0.99899050, 0.99946705, 0.49326462],
+                             [- 6.27337747, -0.00033046, 0.00020243, 7.27304701, 0.99899060, 0.99946711, 0.49326446],
+                             [- 6.27337755, -0.00033043, 0.00020241, 7.27304713, 0.99899071, 0.99946717, 0.49326448],
+                             [- 6.27337764, -0.00033039, 0.00020239, 7.27304725, 0.99899082, 0.99946722, 0.49326479],
+                             [- 6.27337772, -0.00033035, 0.00020237, 7.27304737, 0.99899093, 0.99946728, 0.49326445],
+                             [- 6.27337781, -0.00033032, 0.00020234, 7.27304749, 0.99899103, 0.99946734, 0.49326446],
+                             [- 6.27337789, -0.00033028, 0.00020232, 7.27304761, 0.99899114, 0.99946739, 0.49326446],
+                             [- 6.27337797, -0.00033025, 0.00020230, 7.27304773, 0.99899125, 0.99946745, 0.49326456],
+                             [- 6.27337806, -0.00033021, 0.00020228, 7.27304785, 0.99899136, 0.99946751, 0.49326462],
+                             [- 6.27337814, -0.00033018, 0.00020226, 7.27304796, 0.99899146, 0.99946756, 0.49326466],
+                             [- 6.27337823, -0.00033014, 0.00020224, 7.27304808, 0.99899157, 0.99946762, 0.49326469],
+                             [- 6.27337831, -0.00033011, 0.00020221, 7.27304820, 0.99899168, 0.99946768, 0.49326455],
+                             [- 6.27337840, -0.00033007, 0.00020219, 7.27304832, 0.99899179, 0.99946773, 0.49326445],
+                             [- 6.27337848, -0.00033004, 0.00020217, 7.27304844, 0.99899190, 0.99946779, 0.49326466],
+                             [- 6.27337856, -0.00033000, 0.00020215, 7.27304856, 0.99899200, 0.99946785, 0.49326467],
+                             [- 6.27337865, -0.00032997, 0.00020213, 7.27304868, 0.99899211, 0.99946790, 0.49326472],
+                             [- 6.27337873, -0.00032993, 0.00020211, 7.27304880, 0.99899222, 0.99946796, 0.49326465],
+                             [- 6.27337882, -0.00032990, 0.00020208, 7.27304892, 0.99899233, 0.99946802, 0.49326487],
+                             [- 6.27337890, -0.00032986, 0.00020206, 7.27304904, 0.99899243, 0.99946807, 0.49326453],
+                             [- 6.27337899, -0.00032983, 0.00020204, 7.27304916, 0.99899254, 0.99946813, 0.49326462],
+                             [- 6.27337907, -0.00032979, 0.00020202, 7.27304928, 0.99899265, 0.99946819, 0.49326466],
+                             [- 6.27337915, -0.00032976, 0.00020200, 7.27304940, 0.99899275, 0.99946824, 0.49326470],
+                             [- 6.27337924, -0.00032972, 0.00020198, 7.27304952, 0.99899286, 0.99946830, 0.49326485],
+                             [- 6.27337932, -0.00032969, 0.00020196, 7.27304964, 0.99899297, 0.99946836, 0.49326493],
+                             [- 6.27337941, -0.00032965, 0.00020193, 7.27304976, 0.99899308, 0.99946841, 0.49326472],
+                             [- 6.27337949, -0.00032962, 0.00020191, 7.27304987, 0.99899318, 0.99946847, 0.49326466],
+                             [- 6.27337957, -0.00032958, 0.00020189, 7.27304999, 0.99899329, 0.99946853, 0.49326475],
+                             [- 6.27337966, -0.00032955, 0.00020187, 7.27305011, 0.99899340, 0.99946858, 0.49326474],
+                             [- 6.27337974, -0.00032951, 0.00020185, 7.27305023, 0.99899351, 0.99946864, 0.49326494],
+                             [- 6.27337983, -0.00032948, 0.00020183, 7.27305035, 0.99899361, 0.99946870, 0.49326475],
+                             [- 6.27337991, -0.00032944, 0.00020181, 7.27305047, 0.99899372, 0.99946875, 0.49326504],
+                             [- 6.27337999, -0.00032941, 0.00020178, 7.27305059, 0.99899383, 0.99946881, 0.49326510],
+                             [- 6.27338008, -0.00032937, 0.00020176, 7.27305071, 0.99899393, 0.99946887, 0.49326506],
+                             [- 6.27338016, -0.00032934, 0.00020174, 7.27305083, 0.99899404, 0.99946892, 0.49326491],
+                             [- 6.27338025, -0.00032930, 0.00020172, 7.27305095, 0.99899415, 0.99946898, 0.49326495],
+                             [- 6.27338033, -0.00032927, 0.00020170, 7.27305106, 0.99899425, 0.99946904, 0.49326488],
+                             [- 6.27338041, -0.00032923, 0.00020168, 7.27305118, 0.99899436, 0.99946909, 0.49326492],
+                             [- 6.27338050, -0.00032920, 0.00020165, 7.27305130, 0.99899447, 0.99946915, 0.49326492],
+                             [- 6.27338058, -0.00032916, 0.00020163, 7.27305142, 0.99899458, 0.99946921, 0.49326493],
+                             [- 6.27338067, -0.00032913, 0.00020161, 7.27305154, 0.99899468, 0.99946926, 0.49326498],
+                             [- 6.27338075, -0.00032909, 0.00020159, 7.27305166, 0.99899479, 0.99946932, 0.49326509],
+                             [- 6.27338083, -0.00032906, 0.00020157, 7.27305178, 0.99899490, 0.99946938, 0.49326511],
+                             [- 6.27338092, -0.00032902, 0.00020155, 7.27305190, 0.99899500, 0.99946943, 0.49326491],
+                             [- 6.27338100, -0.00032899, 0.00020153, 7.27305201, 0.99899511, 0.99946949, 0.49326497],
+                             [- 6.27338108, -0.00032895, 0.00020150, 7.27305213, 0.99899522, 0.99946954, 0.49326517],
+                             [- 6.27338117, -0.00032892, 0.00020148, 7.27305225, 0.99899532, 0.99946960, 0.49326501],
+                             [- 6.27338125, -0.00032888, 0.00020146, 7.27305237, 0.99899543, 0.99946966, 0.49326506],
+                             [- 6.27338134, -0.00032885, 0.00020144, 7.27305249, 0.99899554, 0.99946971, 0.49326507],
+                             [- 6.27338142, -0.00032881, 0.00020142, 7.27305261, 0.99899564, 0.99946977, 0.49326497],
+                             [- 6.27338150, -0.00032878, 0.00020140, 7.27305273, 0.99899575, 0.99946983, 0.49326508],
+                             [- 6.27338159, -0.00032874, 0.00020138, 7.27305284, 0.99899586, 0.99946988, 0.49326522],
+                             [- 6.27338167, -0.00032871, 0.00020135, 7.27305296, 0.99899596, 0.99946994, 0.49326525],
+                             [- 6.27338175, -0.00032867, 0.00020133, 7.27305308, 0.99899607, 0.99946999, 0.49326527],
+                             [- 6.27338184, -0.00032864, 0.00020131, 7.27305320, 0.99899618, 0.99947005, 0.49326512],
+                             [- 6.27338192, -0.00032860, 0.00020129, 7.27305332, 0.99899628, 0.99947011, 0.49326544],
+                             [- 6.27338200, -0.00032857, 0.00020127, 7.27305344, 0.99899639, 0.99947016, 0.49326511],
+                             [- 6.27338209, -0.00032853, 0.00020125, 7.27305356, 0.99899650, 0.99947022, 0.49326525],
+                             [- 6.27338217, -0.00032850, 0.00020123, 7.27305367, 0.99899660, 0.99947028, 0.49326517],
+                             [- 6.27338225, -0.00032846, 0.00020121, 7.27305379, 0.99899671, 0.99947033, 0.49326515],
+                             [- 6.27338234, -0.00032843, 0.00020118, 7.27305391, 0.99899682, 0.99947039, 0.49326512],
+                             [- 6.27338242, -0.00032839, 0.00020116, 7.27305403, 0.99899692, 0.99947045, 0.49326510],
+                             [- 6.27338250, -0.00032836, 0.00020114, 7.27305415, 0.99899703, 0.99947050, 0.49326538],
+                             [- 6.27338259, -0.00032832, 0.00020112, 7.27305427, 0.99899714, 0.99947056, 0.49326526],
+                             [- 6.27338267, -0.00032829, 0.00020110, 7.27305438, 0.99899724, 0.99947061, 0.49326555],
+                             [- 6.27338275, -0.00032825, 0.00020108, 7.27305450, 0.99899735, 0.99947067, 0.49326559],
+                             [- 6.27338284, -0.00032822, 0.00020106, 7.27305462, 0.99899745, 0.99947073, 0.49326528],
+                             [- 6.27338292, -0.00032818, 0.00020103, 7.27305474, 0.99899756, 0.99947078, 0.49326542],
+                             [- 6.27338300, -0.00032815, 0.00020101, 7.27305486, 0.99899767, 0.99947084, 0.49326519],
+                             [- 6.27338309, -0.00032811, 0.00020099, 7.27305497, 0.99899777, 0.99947089, 0.49326536],
+                             [- 6.27338317, -0.00032808, 0.00020097, 7.27305509, 0.99899788, 0.99947095, 0.49326533],
+                             [- 6.27338325, -0.00032804, 0.00020095, 7.27305521, 0.99899799, 0.99947101, 0.49326540],
+                             [- 6.27338334, -0.00032801, 0.00020093, 7.27305533, 0.99899809, 0.99947106, 0.49326552],
+                             [- 6.27338342, -0.00032797, 0.00020091, 7.27305545, 0.99899820, 0.99947112, 0.49326543],
+                             [- 6.27338350, -0.00032794, 0.00020089, 7.27305556, 0.99899830, 0.99947117, 0.49326548],
+                             [- 6.27338359, -0.00032791, 0.00020086, 7.27305568, 0.99899841, 0.99947123, 0.49326555],
+                             [- 6.27338367, -0.00032787, 0.00020084, 7.27305580, 0.99899852, 0.99947129, 0.49326550],
+                             [- 6.27338375, -0.00032784, 0.00020082, 7.27305592, 0.99899862, 0.99947134, 0.49326539],
+                             [- 6.27338384, -0.00032780, 0.00020080, 7.27305604, 0.99899873, 0.99947140, 0.49326537],
+                             [- 6.27338392, -0.00032777, 0.00020078, 7.27305615, 0.99899884, 0.99947145, 0.49326540],
+                             [- 6.27338400, -0.00032773, 0.00020076, 7.27305627, 0.99899894, 0.99947151, 0.49326552],
+                             [- 6.27338409, -0.00032770, 0.00020074, 7.27305639, 0.99899905, 0.99947157, 0.49326544],
+                             [- 6.27338417, -0.00032766, 0.00020072, 7.27305651, 0.99899915, 0.99947162, 0.49326541],
+                             [- 6.27338425, -0.00032763, 0.00020069, 7.27305662, 0.99899926, 0.99947168, 0.49326544],
+                             [- 6.27338433, -0.00032759, 0.00020067, 7.27305674, 0.99899937, 0.99947173, 0.49326555],
+                             [- 6.27338442, -0.00032756, 0.00020065, 7.27305686, 0.99899947, 0.99947179, 0.49326592],
+                             [- 6.27338450, -0.00032752, 0.00020063, 7.27305698, 0.99899958, 0.99947185, 0.49326555],
+                             [- 6.27338458, -0.00032749, 0.00020061, 7.27305709, 0.99899968, 0.99947190, 0.49326556],
+                             [- 6.27338467, -0.00032745, 0.00020059, 7.27305721, 0.99899979, 0.99947196, 0.49326577],
+                             [- 6.27338475, -0.00032742, 0.00020057, 7.27305733, 0.99899989, 0.99947201, 0.49326572],
+                             [- 6.27338483, -0.00032739, 0.00020055, 7.27305745, 0.99900000, 0.99947207, 0.49326564],
+                             [- 6.27338492, -0.00032735, 0.00020052, 7.27305756, 0.99900011, 0.99947213, 0.49326574],
+                             [- 6.27338500, -0.00032732, 0.00020050, 7.27305768, 0.99900021, 0.99947218, 0.49326570],
+                             [- 6.27338508, -0.00032728, 0.00020048, 7.27305780, 0.99900032, 0.99947224, 0.49326585],
+                             [- 6.27338516, -0.00032725, 0.00020046, 7.27305792, 0.99900042, 0.99947229, 0.49326561],
+                             [- 6.27338525, -0.00032721, 0.00020044, 7.27305804, 0.99900053, 0.99947235, 0.49326554],
+                             [- 6.27338533, -0.00032718, 0.00020042, 7.27305815, 0.99900063, 0.99947240, 0.49326565],
+                             [- 6.27338541, -0.00032714, 0.00020040, 7.27305827, 0.99900074, 0.99947246, 0.49326560],
+                             [- 6.27338550, -0.00032711, 0.00020038, 7.27305839, 0.99900085, 0.99947252, 0.49326561],
+                             [- 6.27338558, -0.00032707, 0.00020035, 7.27305850, 0.99900095, 0.99947257, 0.49326588],
+                             [- 6.27338566, -0.00032704, 0.00020033, 7.27305862, 0.99900106, 0.99947263, 0.49326567],
+                             [- 6.27338574, -0.00032700, 0.00020031, 7.27305874, 0.99900116, 0.99947268, 0.49326573],
+                             [- 6.27338583, -0.00032697, 0.00020029, 7.27305886, 0.99900127, 0.99947274, 0.49326588],
+                             [- 6.27338591, -0.00032694, 0.00020027, 7.27305897, 0.99900137, 0.99947279, 0.49326587],
+                             [- 6.27338599, -0.00032690, 0.00020025, 7.27305909, 0.99900148, 0.99947285, 0.49326591],
+                             [- 6.27338607, -0.00032687, 0.00020023, 7.27305921, 0.99900158, 0.99947291, 0.49326568],
+                             [- 6.27338616, -0.00032683, 0.00020021, 7.27305932, 0.99900169, 0.99947296, 0.49326586],
+                             [- 6.27338624, -0.00032680, 0.00020019, 7.27305944, 0.99900180, 0.99947302, 0.49326595],
+                             [- 6.27338632, -0.00032676, 0.00020016, 7.27305956, 0.99900190, 0.99947307, 0.49326594],
+                             [- 6.27338640, -0.00032673, 0.00020014, 7.27305968, 0.99900201, 0.99947313, 0.49326576],
+                             [- 6.27338649, -0.00032669, 0.00020012, 7.27305979, 0.99900211, 0.99947318, 0.49326600],
+                             [- 6.27338657, -0.00032666, 0.00020010, 7.27305991, 0.99900222, 0.99947324, 0.49326567],
+                             [- 6.27338665, -0.00032663, 0.00020008, 7.27306003, 0.99900232, 0.99947330, 0.49326591],
+                             [- 6.27338674, -0.00032659, 0.00020006, 7.27306014, 0.99900243, 0.99947335, 0.49326584],
+                             [- 6.27338682, -0.00032656, 0.00020004, 7.27306026, 0.99900253, 0.99947341, 0.49326591],
+                             [- 6.27338690, -0.00032652, 0.00020002, 7.27306038, 0.99900264, 0.99947346, 0.49326598],
+                             [- 6.27338698, -0.00032649, 0.00020000, 7.27306050, 0.99900274, 0.99947352, 0.49326605],
+                             [- 6.27338706, -0.00032645, 0.00019997, 7.27306061, 0.99900285, 0.99947357, 0.49326584],
+                             [- 6.27338715, -0.00032642, 0.00019995, 7.27306073, 0.99900295, 0.99947363, 0.49326610],
+                             [- 6.27338723, -0.00032638, 0.00019993, 7.27306085, 0.99900306, 0.99947368, 0.49326584],
+                             [- 6.27338731, -0.00032635, 0.00019991, 7.27306096, 0.99900316, 0.99947374, 0.49326595],
+                             [- 6.27338739, -0.00032632, 0.00019989, 7.27306108, 0.99900327, 0.99947379, 0.49326574],
+                             [- 6.27338748, -0.00032628, 0.00019987, 7.27306120, 0.99900337, 0.99947385, 0.49326593],
+                             [- 6.27338756, -0.00032625, 0.00019985, 7.27306131, 0.99900348, 0.99947391, 0.49326617],
+                             [- 6.27338764, -0.00032621, 0.00019983, 7.27306143, 0.99900358, 0.99947396, 0.49326608],
+                             [- 6.27338772, -0.00032618, 0.00019981, 7.27306155, 0.99900369, 0.99947402, 0.49326601],
+                             [- 6.27338781, -0.00032614, 0.00019978, 7.27306166, 0.99900379, 0.99947407, 0.49326595],
+                             [- 6.27338789, -0.00032611, 0.00019976, 7.27306178, 0.99900390, 0.99947413, 0.49326615],
+                             [- 6.27338797, -0.00032607, 0.00019974, 7.27306190, 0.99900400, 0.99947418, 0.49326594],
+                             [- 6.27338805, -0.00032604, 0.00019972, 7.27306201, 0.99900411, 0.99947424, 0.49326623],
+                             [- 6.27338814, -0.00032601, 0.00019970, 7.27306213, 0.99900421, 0.99947429, 0.49326628],
+                             [- 6.27338822, -0.00032597, 0.00019968, 7.27306225, 0.99900432, 0.99947435, 0.49326618],
+                             [- 6.27338830, -0.00032594, 0.00019966, 7.27306236, 0.99900442, 0.99947440, 0.49326621],
+                             [- 6.27338838, -0.00032590, 0.00019964, 7.27306248, 0.99900453, 0.99947446, 0.49326598],
+                             [- 6.27338846, -0.00032587, 0.00019962, 7.27306260, 0.99900463, 0.99947452, 0.49326615],
+                             [- 6.27338855, -0.00032583, 0.00019960, 7.27306271, 0.99900474, 0.99947457, 0.49326647],
+                             [- 6.27338863, -0.00032580, 0.00019957, 7.27306283, 0.99900484, 0.99947463, 0.49326621],
+                             [- 6.27338871, -0.00032577, 0.00019955, 7.27306294, 0.99900495, 0.99947468, 0.49326643],
+                             [- 6.27338879, -0.00032573, 0.00019953, 7.27306306, 0.99900505, 0.99947474, 0.49326629],
+                             [- 6.27338887, -0.00032570, 0.00019951, 7.27306318, 0.99900516, 0.99947479, 0.49326635],
+                             [- 6.27338896, -0.00032566, 0.00019949, 7.27306329, 0.99900526, 0.99947485, 0.49326632],
+                             [- 6.27338904, -0.00032563, 0.00019947, 7.27306341, 0.99900537, 0.99947490, 0.49326626],
+                             [- 6.27338912, -0.00032559, 0.00019945, 7.27306353, 0.99900547, 0.99947496, 0.49326639],
+                             [- 6.27338920, -0.00032556, 0.00019943, 7.27306364, 0.99900558, 0.99947501, 0.49326627],
+                             [- 6.27338928, -0.00032553, 0.00019941, 7.27306376, 0.99900568, 0.99947507, 0.49326645],
+                             [- 6.27338937, -0.00032549, 0.00019939, 7.27306387, 0.99900578, 0.99947512, 0.49326623],
+                             [- 6.27338945, -0.00032546, 0.00019936, 7.27306399, 0.99900589, 0.99947518, 0.49326607],
+                             [- 6.27338953, -0.00032542, 0.00019934, 7.27306411, 0.99900599, 0.99947523, 0.49326641],
+                             [- 6.27338961, -0.00032539, 0.00019932, 7.27306422, 0.99900610, 0.99947529, 0.49326644],
+                             [- 6.27338969, -0.00032536, 0.00019930, 7.27306434, 0.99900620, 0.99947534, 0.49326635],
+                             [- 6.27338978, -0.00032532, 0.00019928, 7.27306446, 0.99900631, 0.99947540, 0.49326617],
+                             [- 6.27338986, -0.00032529, 0.00019926, 7.27306457, 0.99900641, 0.99947545, 0.49326647],
+                             [- 6.27338994, -0.00032525, 0.00019924, 7.27306469, 0.99900652, 0.99947551, 0.49326638],
+                             [- 6.27339002, -0.00032522, 0.00019922, 7.27306480, 0.99900662, 0.99947556, 0.49326625],
+                             [- 6.27339010, -0.00032518, 0.00019920, 7.27306492, 0.99900673, 0.99947562, 0.49326654],
+                             [- 6.27339019, -0.00032515, 0.00019918, 7.27306504, 0.99900683, 0.99947567, 0.49326643],
+                             [- 6.27339027, -0.00032512, 0.00019915, 7.27306515, 0.99900693, 0.99947573, 0.49326639],
+                             [- 6.27339035, -0.00032508, 0.00019913, 7.27306527, 0.99900704, 0.99947578, 0.49326643],
+                             [- 6.27339043, -0.00032505, 0.00019911, 7.27306538, 0.99900714, 0.99947584, 0.49326613],
+                             [- 6.27339051, -0.00032501, 0.00019909, 7.27306550, 0.99900725, 0.99947589, 0.49326635],
+                             [- 6.27339059, -0.00032498, 0.00019907, 7.27306561, 0.99900735, 0.99947595, 0.49326654],
+                             [- 6.27339068, -0.00032495, 0.00019905, 7.27306573, 0.99900746, 0.99947600, 0.49326649],
+                             [- 6.27339076, -0.00032491, 0.00019903, 7.27306585, 0.99900756, 0.99947606, 0.49326645],
+                             [- 6.27339084, -0.00032488, 0.00019901, 7.27306596, 0.99900766, 0.99947611, 0.49326635],
+                             [- 6.27339092, -0.00032484, 0.00019899, 7.27306608, 0.99900777, 0.99947617, 0.49326646],
+                             [- 6.27339100, -0.00032481, 0.00019897, 7.27306619, 0.99900787, 0.99947622, 0.49326660],
+                             [- 6.27339108, -0.00032477, 0.00019895, 7.27306631, 0.99900798, 0.99947628, 0.49326653],
+                             [- 6.27339117, -0.00032474, 0.00019892, 7.27306642, 0.99900808, 0.99947633, 0.49326655],
+                             [- 6.27339125, -0.00032471, 0.00019890, 7.27306654, 0.99900818, 0.99947639, 0.49326642],
+                             [- 6.27339133, -0.00032467, 0.00019888, 7.27306666, 0.99900829, 0.99947644, 0.49326648],
+                             [- 6.27339141, -0.00032464, 0.00019886, 7.27306677, 0.99900839, 0.99947650, 0.49326679],
+                             [- 6.27339149, -0.00032460, 0.00019884, 7.27306689, 0.99900850, 0.99947655, 0.49326686],
+                             [- 6.27339157, -0.00032457, 0.00019882, 7.27306700, 0.99900860, 0.99947661, 0.49326656],
+                             [- 6.27339165, -0.00032454, 0.00019880, 7.27306712, 0.99900870, 0.99947666, 0.49326662],
+                             [- 6.27339174, -0.00032450, 0.00019878, 7.27306723, 0.99900881, 0.99947672, 0.49326679],
+                             [- 6.27339182, -0.00032447, 0.00019876, 7.27306735, 0.99900891, 0.99947677, 0.49326673],
+                             [- 6.27339190, -0.00032443, 0.00019874, 7.27306746, 0.99900902, 0.99947683, 0.49326675],
+                             [- 6.27339198, -0.00032440, 0.00019872, 7.27306758, 0.99900912, 0.99947688, 0.49326682],
+                             [- 6.27339206, -0.00032437, 0.00019870, 7.27306770, 0.99900922, 0.99947694, 0.49326647],
+                             [- 6.27339214, -0.00032433, 0.00019867, 7.27306781, 0.99900933, 0.99947699, 0.49326653],
+                             [- 6.27339222, -0.00032430, 0.00019865, 7.27306793, 0.99900943, 0.99947705, 0.49326669],
+                             [- 6.27339231, -0.00032426, 0.00019863, 7.27306804, 0.99900954, 0.99947710, 0.49326657],
+                             [- 6.27339239, -0.00032423, 0.00019861, 7.27306816, 0.99900964, 0.99947716, 0.49326679],
+                             [- 6.27339247, -0.00032420, 0.00019859, 7.27306827, 0.99900974, 0.99947721, 0.49326690],
+                             [- 6.27339255, -0.00032416, 0.00019857, 7.27306839, 0.99900985, 0.99947727, 0.49326680],
+                             [- 6.27339263, -0.00032413, 0.00019855, 7.27306850, 0.99900995, 0.99947732, 0.49326670],
+                             [- 6.27339271, -0.00032409, 0.00019853, 7.27306862, 0.99901005, 0.99947738, 0.49326690],
+                             [- 6.27339279, -0.00032406, 0.00019851, 7.27306873, 0.99901016, 0.99947743, 0.49326682],
+                             [- 6.27339287, -0.00032403, 0.00019849, 7.27306885, 0.99901026, 0.99947749, 0.49326670],
+                             [- 6.27339296, -0.00032399, 0.00019847, 7.27306896, 0.99901036, 0.99947754, 0.49326689],
+                             [- 6.27339304, -0.00032396, 0.00019845, 7.27306908, 0.99901047, 0.99947760, 0.49326683],
+                             [- 6.27339312, -0.00032393, 0.00019843, 7.27306919, 0.99901057, 0.99947765, 0.49326682],
+                             [- 6.27339320, -0.00032389, 0.00019840, 7.27306931, 0.99901068, 0.99947770, 0.49326694],
+                             [- 6.27339328, -0.00032386, 0.00019838, 7.27306942, 0.99901078, 0.99947776, 0.49326682],
+                             [- 6.27339336, -0.00032382, 0.00019836, 7.27306954, 0.99901088, 0.99947781, 0.49326696],
+                             [- 6.27339344, -0.00032379, 0.00019834, 7.27306965, 0.99901099, 0.99947787, 0.49326703],
+                             [- 6.27339352, -0.00032376, 0.00019832, 7.27306977, 0.99901109, 0.99947792, 0.49326705],
+                             [- 6.27339360, -0.00032372, 0.00019830, 7.27306988, 0.99901119, 0.99947798, 0.49326683],
+                             [- 6.27339369, -0.00032369, 0.00019828, 7.27307000, 0.99901130, 0.99947803, 0.49326692],
+                             [- 6.27339377, -0.00032365, 0.00019826, 7.27307011, 0.99901140, 0.99947809, 0.49326694],
+                             [- 6.27339385, -0.00032362, 0.00019824, 7.27307023, 0.99901150, 0.99947814, 0.49326688],
+                             [- 6.27339393, -0.00032359, 0.00019822, 7.27307034, 0.99901161, 0.99947820, 0.49326687],
+                             [- 6.27339401, -0.00032355, 0.00019820, 7.27307046, 0.99901171, 0.99947825, 0.49326697],
+                             [- 6.27339409, -0.00032352, 0.00019818, 7.27307057, 0.99901181, 0.99947830, 0.49326717],
+                             [- 6.27339417, -0.00032349, 0.00019816, 7.27307069, 0.99901192, 0.99947836, 0.49326712],
+                             [- 6.27339425, -0.00032345, 0.00019813, 7.27307080, 0.99901202, 0.99947841, 0.49326703],
+                             [- 6.27339433, -0.00032342, 0.00019811, 7.27307092, 0.99901212, 0.99947847, 0.49326706],
+                             [- 6.27339441, -0.00032338, 0.00019809, 7.27307103, 0.99901223, 0.99947852, 0.49326716],
+                             [- 6.27339450, -0.00032335, 0.00019807, 7.27307115, 0.99901233, 0.99947858, 0.49326689],
+                             [- 6.27339458, -0.00032332, 0.00019805, 7.27307126, 0.99901243, 0.99947863, 0.49326699],
+                             [- 6.27339466, -0.00032328, 0.00019803, 7.27307137, 0.99901254, 0.99947869, 0.49326696],
+                             [- 6.27339474, -0.00032325, 0.00019801, 7.27307149, 0.99901264, 0.99947874, 0.49326718],
+                             [- 6.27339482, -0.00032321, 0.00019799, 7.27307160, 0.99901274, 0.99947880, 0.49326717],
+                             [- 6.27339490, -0.00032318, 0.00019797, 7.27307172, 0.99901285, 0.99947885, 0.49326705],
+                             [- 6.27339498, -0.00032315, 0.00019795, 7.27307183, 0.99901295, 0.99947890, 0.49326716],
+                             [- 6.27339506, -0.00032311, 0.00019793, 7.27307195, 0.99901305, 0.99947896, 0.49326730],
+                             [- 6.27339514, -0.00032308, 0.00019791, 7.27307206, 0.99901315, 0.99947901, 0.49326718],
+                             [- 6.27339522, -0.00032305, 0.00019789, 7.27307218, 0.99901326, 0.99947907, 0.49326722],
+                             [- 6.27339530, -0.00032301, 0.00019787, 7.27307229, 0.99901336, 0.99947912, 0.49326715],
+                             [- 6.27339538, -0.00032298, 0.00019785, 7.27307241, 0.99901346, 0.99947918, 0.49326728],
+                             [- 6.27339546, -0.00032295, 0.00019782, 7.27307252, 0.99901357, 0.99947923, 0.49326724],
+                             [- 6.27339555, -0.00032291, 0.00019780, 7.27307263, 0.99901367, 0.99947928, 0.49326701],
+                             [- 6.27339563, -0.00032288, 0.00019778, 7.27307275, 0.99901377, 0.99947934, 0.49326708],
+                             [- 6.27339571, -0.00032284, 0.00019776, 7.27307286, 0.99901388, 0.99947939, 0.49326726],
+                             [- 6.27339579, -0.00032281, 0.00019774, 7.27307298, 0.99901398, 0.99947945, 0.49326720],
+                             [- 6.27339587, -0.00032278, 0.00019772, 7.27307309, 0.99901408, 0.99947950, 0.49326714],
+                             [- 6.27339595, -0.00032274, 0.00019770, 7.27307321, 0.99901418, 0.99947956, 0.49326729],
+                             [- 6.27339603, -0.00032271, 0.00019768, 7.27307332, 0.99901429, 0.99947961, 0.49326744],
+                             [- 6.27339611, -0.00032268, 0.00019766, 7.27307343, 0.99901439, 0.99947966, 0.49326726],
+                             [- 6.27339619, -0.00032264, 0.00019764, 7.27307355, 0.99901449, 0.99947972, 0.49326746],
+                             [- 6.27339627, -0.00032261, 0.00019762, 7.27307366, 0.99901459, 0.99947977, 0.49326747],
+                             [- 6.27339635, -0.00032258, 0.00019760, 7.27307378, 0.99901470, 0.99947983, 0.49326746],
+                             [- 6.27339643, -0.00032254, 0.00019758, 7.27307389, 0.99901480, 0.99947988, 0.49326737],
+                             [- 6.27339651, -0.00032251, 0.00019756, 7.27307400, 0.99901490, 0.99947994, 0.49326725],
+                             [- 6.27339659, -0.00032247, 0.00019754, 7.27307412, 0.99901501, 0.99947999, 0.49326744],
+                             [- 6.27339667, -0.00032244, 0.00019752, 7.27307423, 0.99901511, 0.99948004, 0.49326734],
+                             [- 6.27339675, -0.00032241, 0.00019749, 7.27307435, 0.99901521, 0.99948010, 0.49326748],
+                             [- 6.27339683, -0.00032237, 0.00019747, 7.27307446, 0.99901531, 0.99948015, 0.49326735],
+                             [- 6.27339691, -0.00032234, 0.00019745, 7.27307457, 0.99901542, 0.99948021, 0.49326718],
+                             [- 6.27339699, -0.00032231, 0.00019743, 7.27307469, 0.99901552, 0.99948026, 0.49326726],
+                             [- 6.27339708, -0.00032227, 0.00019741, 7.27307480, 0.99901562, 0.99948031, 0.49326739],
+                             [- 6.27339716, -0.00032224, 0.00019739, 7.27307492, 0.99901572, 0.99948037, 0.49326736],
+                             [- 6.27339724, -0.00032221, 0.00019737, 7.27307503, 0.99901583, 0.99948042, 0.49326751],
+                             [- 6.27339732, -0.00032217, 0.00019735, 7.27307514, 0.99901593, 0.99948048, 0.49326746],
+                             [- 6.27339740, -0.00032214, 0.00019733, 7.27307526, 0.99901603, 0.99948053, 0.49326750],
+                             [- 6.27339748, -0.00032210, 0.00019731, 7.27307537, 0.99901613, 0.99948059, 0.49326720],
+                             [- 6.27339756, -0.00032207, 0.00019729, 7.27307549, 0.99901624, 0.99948064, 0.49326742],
+                             [- 6.27339764, -0.00032204, 0.00019727, 7.27307560, 0.99901634, 0.99948069, 0.49326770],
+                             [- 6.27339772, -0.00032200, 0.00019725, 7.27307571, 0.99901644, 0.99948075, 0.49326757],
+                             [- 6.27339780, -0.00032197, 0.00019723, 7.27307583, 0.99901654, 0.99948080, 0.49326750],
+                             [- 6.27339788, -0.00032194, 0.00019721, 7.27307594, 0.99901664, 0.99948086, 0.49326781],
+                             [- 6.27339796, -0.00032190, 0.00019719, 7.27307605, 0.99901675, 0.99948091, 0.49326776],
+                             [- 6.27339804, -0.00032187, 0.00019717, 7.27307617, 0.99901685, 0.99948096, 0.49326747],
+                             [- 6.27339812, -0.00032184, 0.00019715, 7.27307628, 0.99901695, 0.99948102, 0.49326778],
+                             [- 6.27339820, -0.00032180, 0.00019713, 7.27307639, 0.99901705, 0.99948107, 0.49326749],
+                             [- 6.27339828, -0.00032177, 0.00019710, 7.27307651, 0.99901716, 0.99948113, 0.49326751],
+                             [- 6.27339836, -0.00032174, 0.00019708, 7.27307662, 0.99901726, 0.99948118, 0.49326780],
+                             [- 6.27339844, -0.00032170, 0.00019706, 7.27307674, 0.99901736, 0.99948123, 0.49326747],
+                             [- 6.27339852, -0.00032167, 0.00019704, 7.27307685, 0.99901746, 0.99948129, 0.49326772],
+                             [- 6.27339860, -0.00032164, 0.00019702, 7.27307696, 0.99901756, 0.99948134, 0.49326768],
+                             [- 6.27339868, -0.00032160, 0.00019700, 7.27307708, 0.99901767, 0.99948139, 0.49326756],
+                             [- 6.27339876, -0.00032157, 0.00019698, 7.27307719, 0.99901777, 0.99948145, 0.49326753],
+                             [- 6.27339884, -0.00032154, 0.00019696, 7.27307730, 0.99901787, 0.99948150, 0.49326754],
+                             [- 6.27339892, -0.00032150, 0.00019694, 7.27307742, 0.99901797, 0.99948156, 0.49326763],
+                             [- 6.27339900, -0.00032147, 0.00019692, 7.27307753, 0.99901807, 0.99948161, 0.49326773],
+                             [- 6.27339908, -0.00032144, 0.00019690, 7.27307764, 0.99901818, 0.99948166, 0.49326760],
+                             [- 6.27339916, -0.00032140, 0.00019688, 7.27307776, 0.99901828, 0.99948172, 0.49326795],
+                             [- 6.27339924, -0.00032137, 0.00019686, 7.27307787, 0.99901838, 0.99948177, 0.49326781],
+                             [- 6.27339932, -0.00032134, 0.00019684, 7.27307798, 0.99901848, 0.99948183, 0.49326791],
+                             [- 6.27339940, -0.00032130, 0.00019682, 7.27307810, 0.99901858, 0.99948188, 0.49326782],
+                             [- 6.27339948, -0.00032127, 0.00019680, 7.27307821, 0.99901869, 0.99948193, 0.49326774],
+                             [- 6.27339956, -0.00032124, 0.00019678, 7.27307832, 0.99901879, 0.99948199, 0.49326801],
+                             [- 6.27339964, -0.00032120, 0.00019676, 7.27307843, 0.99901889, 0.99948204, 0.49326796],
+                             [- 6.27339972, -0.00032117, 0.00019674, 7.27307855, 0.99901899, 0.99948209, 0.49326796],
+                             [- 6.27339980, -0.00032114, 0.00019672, 7.27307866, 0.99901909, 0.99948215, 0.49326764],
+                             [- 6.27339988, -0.00032110, 0.00019670, 7.27307877, 0.99901920, 0.99948220, 0.49326786],
+                             [- 6.27339996, -0.00032107, 0.00019668, 7.27307889, 0.99901930, 0.99948226, 0.49326797],
+                             [- 6.27340004, -0.00032104, 0.00019665, 7.27307900, 0.99901940, 0.99948231, 0.49326772],
+                             [- 6.27340012, -0.00032100, 0.00019663, 7.27307911, 0.99901950, 0.99948236, 0.49326808],
+                             [- 6.27340020, -0.00032097, 0.00019661, 7.27307923, 0.99901960, 0.99948242, 0.49326793],
+                             [- 6.27340028, -0.00032094, 0.00019659, 7.27307934, 0.99901970, 0.99948247, 0.49326800],
+                             [- 6.27340036, -0.00032090, 0.00019657, 7.27307945, 0.99901981, 0.99948252, 0.49326818],
+                             [- 6.27340043, -0.00032087, 0.00019655, 7.27307956, 0.99901991, 0.99948258, 0.49326800],
+                             [- 6.27340051, -0.00032084, 0.00019653, 7.27307968, 0.99902001, 0.99948263, 0.49326833],
+                             [- 6.27340059, -0.00032080, 0.00019651, 7.27307979, 0.99902011, 0.99948268, 0.49326799],
+                             [- 6.27340067, -0.00032077, 0.00019649, 7.27307990, 0.99902021, 0.99948274, 0.49326805],
+                             [- 6.27340075, -0.00032074, 0.00019647, 7.27308002, 0.99902031, 0.99948279, 0.49326790],
+                             [- 6.27340083, -0.00032070, 0.00019645, 7.27308013, 0.99902042, 0.99948285, 0.49326822],
+                             [- 6.27340091, -0.00032067, 0.00019643, 7.27308024, 0.99902052, 0.99948290, 0.49326817],
+                             [- 6.27340099, -0.00032064, 0.00019641, 7.27308035, 0.99902062, 0.99948295, 0.49326820],
+                             [- 6.27340107, -0.00032060, 0.00019639, 7.27308047, 0.99902072, 0.99948301, 0.49326814],
+                             [- 6.27340115, -0.00032057, 0.00019637, 7.27308058, 0.99902082, 0.99948306, 0.49326794],
+                             [- 6.27340123, -0.00032054, 0.00019635, 7.27308069, 0.99902092, 0.99948311, 0.49326788],
+                             [- 6.27340131, -0.00032050, 0.00019633, 7.27308081, 0.99902102, 0.99948317, 0.49326824],
+                             [- 6.27340139, -0.00032047, 0.00019631, 7.27308092, 0.99902113, 0.99948322, 0.49326821],
+                             [- 6.27340147, -0.00032044, 0.00019629, 7.27308103, 0.99902123, 0.99948327, 0.49326804],
+                             [- 6.27340155, -0.00032040, 0.00019627, 7.27308114, 0.99902133, 0.99948333, 0.49326826],
+                             [- 6.27340163, -0.00032037, 0.00019625, 7.27308126, 0.99902143, 0.99948338, 0.49326837],
+                             [- 6.27340171, -0.00032034, 0.00019623, 7.27308137, 0.99902153, 0.99948343, 0.49326808],
+                             [- 6.27340179, -0.00032031, 0.00019621, 7.27308148, 0.99902163, 0.99948349, 0.49326814],
+                             [- 6.27340187, -0.00032027, 0.00019619, 7.27308159, 0.99902173, 0.99948354, 0.49326823],
+                             [- 6.27340194, -0.00032024, 0.00019617, 7.27308171, 0.99902183, 0.99948359, 0.49326820],
+                             [- 6.27340202, -0.00032021, 0.00019615, 7.27308182, 0.99902194, 0.99948365, 0.49326819],
+                             [- 6.27340210, -0.00032017, 0.00019613, 7.27308193, 0.99902204, 0.99948370, 0.49326828],
+                             [- 6.27340218, -0.00032014, 0.00019611, 7.27308204, 0.99902214, 0.99948376, 0.49326815],
+                             [- 6.27340226, -0.00032011, 0.00019608, 7.27308216, 0.99902224, 0.99948381, 0.49326833],
+                             [- 6.27340234, -0.00032007, 0.00019606, 7.27308227, 0.99902234, 0.99948386, 0.49326820],
+                             [- 6.27340242, -0.00032004, 0.00019604, 7.27308238, 0.99902244, 0.99948392, 0.49326839],
+                             [- 6.27340250, -0.00032001, 0.00019602, 7.27308249, 0.99902254, 0.99948397, 0.49326825],
+                             [- 6.27340258, -0.00031997, 0.00019600, 7.27308261, 0.99902264, 0.99948402, 0.49326820],
+                             [- 6.27340266, -0.00031994, 0.00019598, 7.27308272, 0.99902274, 0.99948408, 0.49326829],
+                             [- 6.27340274, -0.00031991, 0.00019596, 7.27308283, 0.99902285, 0.99948413, 0.49326838],
+                             [- 6.27340282, -0.00031987, 0.00019594, 7.27308294, 0.99902295, 0.99948418, 0.49326829],
+                             [- 6.27340290, -0.00031984, 0.00019592, 7.27308305, 0.99902305, 0.99948424, 0.49326812],
+                             [- 6.27340297, -0.00031981, 0.00019590, 7.27308317, 0.99902315, 0.99948429, 0.49326825],
+                             [- 6.27340305, -0.00031978, 0.00019588, 7.27308328, 0.99902325, 0.99948434, 0.49326844],
+                             [- 6.27340313, -0.00031974, 0.00019586, 7.27308339, 0.99902335, 0.99948440, 0.49326822],
+                             [- 6.27340321, -0.00031971, 0.00019584, 7.27308350, 0.99902345, 0.99948445, 0.49326848],
+                             [- 6.27340329, -0.00031968, 0.00019582, 7.27308361, 0.99902355, 0.99948450, 0.49326823],
+                             [- 6.27340337, -0.00031964, 0.00019580, 7.27308373, 0.99902365, 0.99948455, 0.49326831],
+                             [- 6.27340345, -0.00031961, 0.00019578, 7.27308384, 0.99902375, 0.99948461, 0.49326842],
+                             [- 6.27340353, -0.00031958, 0.00019576, 7.27308395, 0.99902385, 0.99948466, 0.49326833],
+                             [- 6.27340361, -0.00031954, 0.00019574, 7.27308406, 0.99902396, 0.99948471, 0.49326844],
+                             [- 6.27340369, -0.00031951, 0.00019572, 7.27308417, 0.99902406, 0.99948477, 0.49326841],
+                             [- 6.27340377, -0.00031948, 0.00019570, 7.27308429, 0.99902416, 0.99948482, 0.49326813],
+                             [- 6.27340384, -0.00031945, 0.00019568, 7.27308440, 0.99902426, 0.99948487, 0.49326861],
+                             [- 6.27340392, -0.00031941, 0.00019566, 7.27308451, 0.99902436, 0.99948493, 0.49326836],
+                             [- 6.27340400, -0.00031938, 0.00019564, 7.27308462, 0.99902446, 0.99948498, 0.49326869],
+                             [- 6.27340408, -0.00031935, 0.00019562, 7.27308473, 0.99902456, 0.99948503, 0.49326883],
+                             [- 6.27340416, -0.00031931, 0.00019560, 7.27308485, 0.99902466, 0.99948509, 0.49326857],
+                             [- 6.27340424, -0.00031928, 0.00019558, 7.27308496, 0.99902476, 0.99948514, 0.49326861],
+                             [- 6.27340432, -0.00031925, 0.00019556, 7.27308507, 0.99902486, 0.99948519, 0.49326841],
+                             [- 6.27340440, -0.00031922, 0.00019554, 7.27308518, 0.99902496, 0.99948525, 0.49326856],
+                             [- 6.27340448, -0.00031918, 0.00019552, 7.27308529, 0.99902506, 0.99948530, 0.49326867],
+                             [- 6.27340455, -0.00031915, 0.00019550, 7.27308540, 0.99902516, 0.99948535, 0.49326859],
+                             [- 6.27340463, -0.00031912, 0.00019548, 7.27308552, 0.99902526, 0.99948541, 0.49326854],
+                             [- 6.27340471, -0.00031908, 0.00019546, 7.27308563, 0.99902536, 0.99948546, 0.49326869],
+                             [- 6.27340479, -0.00031905, 0.00019544, 7.27308574, 0.99902546, 0.99948551, 0.49326853],
+                             [- 6.27340487, -0.00031902, 0.00019542, 7.27308585, 0.99902557, 0.99948556, 0.49326880],
+                             [- 6.27340495, -0.00031899, 0.00019540, 7.27308596, 0.99902567, 0.99948562, 0.49326872],
+                             [- 6.27340503, -0.00031895, 0.00019538, 7.27308607, 0.99902577, 0.99948567, 0.49326861],
+                             [- 6.27340511, -0.00031892, 0.00019536, 7.27308619, 0.99902587, 0.99948572, 0.49326878],
+                             [- 6.27340518, -0.00031889, 0.00019534, 7.27308630, 0.99902597, 0.99948578, 0.49326876],
+                             [- 6.27340526, -0.00031885, 0.00019532, 7.27308641, 0.99902607, 0.99948583, 0.49326873],
+                             [- 6.27340534, -0.00031882, 0.00019530, 7.27308652, 0.99902617, 0.99948588, 0.49326869],
+                             [- 6.27340542, -0.00031879, 0.00019528, 7.27308663, 0.99902627, 0.99948594, 0.49326868],
+                             [- 6.27340550, -0.00031876, 0.00019526, 7.27308674, 0.99902637, 0.99948599, 0.49326886],
+                             [- 6.27340558, -0.00031872, 0.00019524, 7.27308685, 0.99902647, 0.99948604, 0.49326868],
+                             [- 6.27340566, -0.00031869, 0.00019522, 7.27308697, 0.99902657, 0.99948609, 0.49326883],
+                             [- 6.27340573, -0.00031866, 0.00019520, 7.27308708, 0.99902667, 0.99948615, 0.49326876],
+                             [- 6.27340581, -0.00031862, 0.00019518, 7.27308719, 0.99902677, 0.99948620, 0.49326874],
+                             [- 6.27340589, -0.00031859, 0.00019516, 7.27308730, 0.99902687, 0.99948625, 0.49326882],
+                             [- 6.27340597, -0.00031856, 0.00019514, 7.27308741, 0.99902697, 0.99948631, 0.49326866],
+                             [- 6.27340605, -0.00031853, 0.00019512, 7.27308752, 0.99902707, 0.99948636, 0.49326860],
+                             [- 6.27340613, -0.00031849, 0.00019510, 7.27308763, 0.99902717, 0.99948641, 0.49326865],
+                             [- 6.27340621, -0.00031846, 0.00019508, 7.27308775, 0.99902727, 0.99948646, 0.49326872],
+                             [- 6.27340628, -0.00031843, 0.00019506, 7.27308786, 0.99902737, 0.99948652, 0.49326863],
+                             [- 6.27340636, -0.00031839, 0.00019504, 7.27308797, 0.99902747, 0.99948657, 0.49326869],
+                             [- 6.27340644, -0.00031836, 0.00019502, 7.27308808, 0.99902757, 0.99948662, 0.49326888],
+                             [- 6.27340652, -0.00031833, 0.00019500, 7.27308819, 0.99902767, 0.99948668, 0.49326895],
+                             [- 6.27340660, -0.00031830, 0.00019498, 7.27308830, 0.99902777, 0.99948673, 0.49326876],
+                             [- 6.27340668, -0.00031826, 0.00019496, 7.27308841, 0.99902787, 0.99948678, 0.49326889],
+                             [- 6.27340675, -0.00031823, 0.00019494, 7.27308852, 0.99902797, 0.99948683, 0.49326878],
+                             [- 6.27340683, -0.00031820, 0.00019492, 7.27308863, 0.99902807, 0.99948689, 0.49326887],
+                             [- 6.27340691, -0.00031817, 0.00019490, 7.27308875, 0.99902817, 0.99948694, 0.49326916],
+                             [- 6.27340699, -0.00031813, 0.00019488, 7.27308886, 0.99902827, 0.99948699, 0.49326908],
+                             [- 6.27340707, -0.00031810, 0.00019486, 7.27308897, 0.99902837, 0.99948704, 0.49326893],
+                             [- 6.27340715, -0.00031807, 0.00019484, 7.27308908, 0.99902847, 0.99948710, 0.49326890],
+                             [- 6.27340722, -0.00031803, 0.00019482, 7.27308919, 0.99902857, 0.99948715, 0.49326887],
+                             [- 6.27340730, -0.00031800, 0.00019480, 7.27308930, 0.99902867, 0.99948720, 0.49326878],
+                             [- 6.27340738, -0.00031797, 0.00019478, 7.27308941, 0.99902877, 0.99948726, 0.49326894],
+                             [- 6.27340746, -0.00031794, 0.00019476, 7.27308952, 0.99902887, 0.99948731, 0.49326894],
+                             [- 6.27340754, -0.00031790, 0.00019474, 7.27308963, 0.99902897, 0.99948736, 0.49326908],
+                             [- 6.27340761, -0.00031787, 0.00019472, 7.27308974, 0.99902907, 0.99948741, 0.49326876],
+                             [- 6.27340769, -0.00031784, 0.00019470, 7.27308985, 0.99902917, 0.99948747, 0.49326912],
+                             [- 6.27340777, -0.00031781, 0.00019468, 7.27308996, 0.99902927, 0.99948752, 0.49326904],
+                             [- 6.27340785, -0.00031777, 0.00019466, 7.27309008, 0.99902937, 0.99948757, 0.49326901],
+                             [- 6.27340793, -0.00031774, 0.00019464, 7.27309019, 0.99902947, 0.99948762, 0.49326930],
+                             [- 6.27340801, -0.00031771, 0.00019462, 7.27309030, 0.99902957, 0.99948768, 0.49326907],
+                             [- 6.27340808, -0.00031768, 0.00019460, 7.27309041, 0.99902967, 0.99948773, 0.49326924],
+                             [- 6.27340816, -0.00031764, 0.00019458, 7.27309052, 0.99902977, 0.99948778, 0.49326904],
+                             [- 6.27340824, -0.00031761, 0.00019456, 7.27309063, 0.99902987, 0.99948783, 0.49326893],
+                             [- 6.27340832, -0.00031758, 0.00019454, 7.27309074, 0.99902997, 0.99948789, 0.49326909],
+                             [- 6.27340840, -0.00031755, 0.00019452, 7.27309085, 0.99903006, 0.99948794, 0.49326930],
+                             [- 6.27340847, -0.00031751, 0.00019450, 7.27309096, 0.99903016, 0.99948799, 0.49326922],
+                             [- 6.27340855, -0.00031748, 0.00019448, 7.27309107, 0.99903026, 0.99948804, 0.49326913],
+                             [- 6.27340863, -0.00031745, 0.00019446, 7.27309118, 0.99903036, 0.99948810, 0.49326905],
+                             [- 6.27340871, -0.00031742, 0.00019444, 7.27309129, 0.99903046, 0.99948815, 0.49326923],
+                             [- 6.27340879, -0.00031738, 0.00019442, 7.27309140, 0.99903056, 0.99948820, 0.49326938],
+                             [- 6.27340886, -0.00031735, 0.00019440, 7.27309151, 0.99903066, 0.99948825, 0.49326909],
+                             [- 6.27340894, -0.00031732, 0.00019438, 7.27309162, 0.99903076, 0.99948831, 0.49326912],
+                             [- 6.27340902, -0.00031728, 0.00019436, 7.27309173, 0.99903086, 0.99948836, 0.49326920],
+                             [- 6.27340910, -0.00031725, 0.00019434, 7.27309184, 0.99903096, 0.99948841, 0.49326917],
+                             [- 6.27340917, -0.00031722, 0.00019432, 7.27309196, 0.99903106, 0.99948846, 0.49326921],
+                             [- 6.27340925, -0.00031719, 0.00019430, 7.27309207, 0.99903116, 0.99948852, 0.49326919],
+                             [- 6.27340933, -0.00031715, 0.00019428, 7.27309218, 0.99903126, 0.99948857, 0.49326928],
+                             [- 6.27340941, -0.00031712, 0.00019426, 7.27309229, 0.99903136, 0.99948862, 0.49326918],
+                             [- 6.27340949, -0.00031709, 0.00019424, 7.27309240, 0.99903146, 0.99948867, 0.49326958],
+                             [- 6.27340956, -0.00031706, 0.00019422, 7.27309251, 0.99903156, 0.99948873, 0.49326936],
+                             [- 6.27340964, -0.00031702, 0.00019420, 7.27309262, 0.99903165, 0.99948878, 0.49326927],
+                             [- 6.27340972, -0.00031699, 0.00019418, 7.27309273, 0.99903175, 0.99948883, 0.49326942],
+                             [- 6.27340980, -0.00031696, 0.00019416, 7.27309284, 0.99903185, 0.99948888, 0.49326912],
+                             [- 6.27340987, -0.00031693, 0.00019414, 7.27309295, 0.99903195, 0.99948894, 0.49326924],
+                             [- 6.27340995, -0.00031690, 0.00019412, 7.27309306, 0.99903205, 0.99948899, 0.49326951],
+                             [- 6.27341003, -0.00031686, 0.00019410, 7.27309317, 0.99903215, 0.99948904, 0.49326942],
+                             [- 6.27341011, -0.00031683, 0.00019408, 7.27309328, 0.99903225, 0.99948909, 0.49326925],
+                             [- 6.27341019, -0.00031680, 0.00019406, 7.27309339, 0.99903235, 0.99948914, 0.49326927],
+                             [- 6.27341026, -0.00031677, 0.00019404, 7.27309350, 0.99903245, 0.99948920, 0.49326936],
+                             [- 6.27341034, -0.00031673, 0.00019402, 7.27309361, 0.99903255, 0.99948925, 0.49326944],
+                             [- 6.27341042, -0.00031670, 0.00019400, 7.27309372, 0.99903265, 0.99948930, 0.49326949],
+                             [- 6.27341050, -0.00031667, 0.00019398, 7.27309383, 0.99903274, 0.99948935, 0.49326915],
+                             [- 6.27341057, -0.00031664, 0.00019396, 7.27309394, 0.99903284, 0.99948941, 0.49326929],
+                             [- 6.27341065, -0.00031660, 0.00019394, 7.27309405, 0.99903294, 0.99948946, 0.49326955],
+                             [- 6.27341073, -0.00031657, 0.00019392, 7.27309416, 0.99903304, 0.99948951, 0.49326921],
+                             [- 6.27341081, -0.00031654, 0.00019390, 7.27309427, 0.99903314, 0.99948956, 0.49326941],
+                             [- 6.27341088, -0.00031651, 0.00019388, 7.27309438, 0.99903324, 0.99948961, 0.49326954],
+                             [- 6.27341096, -0.00031647, 0.00019386, 7.27309449, 0.99903334, 0.99948967, 0.49326935],
+                             [- 6.27341104, -0.00031644, 0.00019384, 7.27309460, 0.99903344, 0.99948972, 0.49326969],
+                             [- 6.27341112, -0.00031641, 0.00019382, 7.27309471, 0.99903354, 0.99948977, 0.49326971],
+                             [- 6.27341119, -0.00031638, 0.00019380, 7.27309482, 0.99903363, 0.99948982, 0.49326945],
+                             [- 6.27341127, -0.00031634, 0.00019378, 7.27309493, 0.99903373, 0.99948988, 0.49326964],
+                             [- 6.27341135, -0.00031631, 0.00019376, 7.27309504, 0.99903383, 0.99948993, 0.49326955],
+                             [- 6.27341143, -0.00031628, 0.00019374, 7.27309515, 0.99903393, 0.99948998, 0.49326931],
+                             [- 6.27341150, -0.00031625, 0.00019372, 7.27309526, 0.99903403, 0.99949003, 0.49326939],
+                             [- 6.27341158, -0.00031622, 0.00019370, 7.27309537, 0.99903413, 0.99949008, 0.49326953],
+                             [- 6.27341166, -0.00031618, 0.00019368, 7.27309547, 0.99903423, 0.99949014, 0.49326974],
+                             [- 6.27341173, -0.00031615, 0.00019366, 7.27309558, 0.99903433, 0.99949019, 0.49326980],
+                             [- 6.27341181, -0.00031612, 0.00019364, 7.27309569, 0.99903442, 0.99949024, 0.49326965],
+                             [- 6.27341189, -0.00031609, 0.00019362, 7.27309580, 0.99903452, 0.99949029, 0.49326969],
+                             [- 6.27341197, -0.00031605, 0.00019360, 7.27309591, 0.99903462, 0.99949034, 0.49326954],
+                             [- 6.27341204, -0.00031602, 0.00019358, 7.27309602, 0.99903472, 0.99949040, 0.49326953],
+                             [- 6.27341212, -0.00031599, 0.00019356, 7.27309613, 0.99903482, 0.99949045, 0.49326986],
+                             [- 6.27341220, -0.00031596, 0.00019354, 7.27309624, 0.99903492, 0.99949050, 0.49326990],
+                             [- 6.27341228, -0.00031592, 0.00019352, 7.27309635, 0.99903502, 0.99949055, 0.49326950],
+                             [- 6.27341235, -0.00031589, 0.00019350, 7.27309646, 0.99903511, 0.99949060, 0.49326968],
+                             [- 6.27341243, -0.00031586, 0.00019348, 7.27309657, 0.99903521, 0.99949066, 0.49326946],
+                             [- 6.27341251, -0.00031583, 0.00019346, 7.27309668, 0.99903531, 0.99949071, 0.49326958],
+                             [- 6.27341258, -0.00031580, 0.00019344, 7.27309679, 0.99903541, 0.99949076, 0.49326990],
+                             [- 6.27341266, -0.00031576, 0.00019342, 7.27309690, 0.99903551, 0.99949081, 0.49326972],
+                             [- 6.27341274, -0.00031573, 0.00019340, 7.27309701, 0.99903561, 0.99949086, 0.49326980],
+                             [- 6.27341282, -0.00031570, 0.00019338, 7.27309712, 0.99903570, 0.99949092, 0.49327001],
+                             [- 6.27341289, -0.00031567, 0.00019336, 7.27309723, 0.99903580, 0.99949097, 0.49326985],
+                             [- 6.27341297, -0.00031563, 0.00019334, 7.27309734, 0.99903590, 0.99949102, 0.49326983],
+                             [- 6.27341305, -0.00031560, 0.00019333, 7.27309744, 0.99903600, 0.99949107, 0.49326985],
+                             [- 6.27341312, -0.00031557, 0.00019331, 7.27309755, 0.99903610, 0.99949112, 0.49327005],
+                             [- 6.27341320, -0.00031554, 0.00019329, 7.27309766, 0.99903620, 0.99949118, 0.49326985],
+                             [- 6.27341328, -0.00031551, 0.00019327, 7.27309777, 0.99903629, 0.99949123, 0.49326980],
+                             [- 6.27341336, -0.00031547, 0.00019325, 7.27309788, 0.99903639, 0.99949128, 0.49326990],
+                             [- 6.27341343, -0.00031544, 0.00019323, 7.27309799, 0.99903649, 0.99949133, 0.49326985],
+                             [- 6.27341351, -0.00031541, 0.00019321, 7.27309810, 0.99903659, 0.99949138, 0.49326999],
+                             [- 6.27341359, -0.00031538, 0.00019319, 7.27309821, 0.99903669, 0.99949144, 0.49326989],
+                             [- 6.27341366, -0.00031535, 0.00019317, 7.27309832, 0.99903679, 0.99949149, 0.49326987],
+                             [- 6.27341374, -0.00031531, 0.00019315, 7.27309843, 0.99903688, 0.99949154, 0.49327012],
+                             [- 6.27341382, -0.00031528, 0.00019313, 7.27309854, 0.99903698, 0.99949159, 0.49326994],
+                             [- 6.27341389, -0.00031525, 0.00019311, 7.27309864, 0.99903708, 0.99949164, 0.49327001],
+                             [- 6.27341397, -0.00031522, 0.00019309, 7.27309875, 0.99903718, 0.99949169, 0.49327008],
+                             [- 6.27341405, -0.00031519, 0.00019307, 7.27309886, 0.99903728, 0.99949175, 0.49327008],
+                             [- 6.27341412, -0.00031515, 0.00019305, 7.27309897, 0.99903737, 0.99949180, 0.49326970],
+                             [- 6.27341420, -0.00031512, 0.00019303, 7.27309908, 0.99903747, 0.99949185, 0.49326989],
+                             [- 6.27341428, -0.00031509, 0.00019301, 7.27309919, 0.99903757, 0.99949190, 0.49326992],
+                             [- 6.27341435, -0.00031506, 0.00019299, 7.27309930, 0.99903767, 0.99949195, 0.49327000],
+                             [- 6.27341443, -0.00031502, 0.00019297, 7.27309941, 0.99903777, 0.99949200, 0.49327006],
+                             [- 6.27341451, -0.00031499, 0.00019295, 7.27309952, 0.99903786, 0.99949206, 0.49327023],
+                             [- 6.27341459, -0.00031496, 0.00019293, 7.27309962, 0.99903796, 0.99949211, 0.49327002],
+                             [- 6.27341466, -0.00031493, 0.00019291, 7.27309973, 0.99903806, 0.99949216, 0.49327004],
+                             [- 6.27341474, -0.00031490, 0.00019289, 7.27309984, 0.99903816, 0.99949221, 0.49327010],
+                             [- 6.27341482, -0.00031486, 0.00019287, 7.27309995, 0.99903826, 0.99949226, 0.49327000],
+                             [- 6.27341489, -0.00031483, 0.00019285, 7.27310006, 0.99903835, 0.99949231, 0.49326994],
+                             [- 6.27341497, -0.00031480, 0.00019283, 7.27310017, 0.99903845, 0.99949237, 0.49327008],
+                             [- 6.27341505, -0.00031477, 0.00019281, 7.27310028, 0.99903855, 0.99949242, 0.49327002],
+                             [- 6.27341512, -0.00031474, 0.00019279, 7.27310039, 0.99903865, 0.99949247, 0.49327015],
+                             [- 6.27341520, -0.00031470, 0.00019277, 7.27310049, 0.99903874, 0.99949252, 0.49326998],
+                             [- 6.27341528, -0.00031467, 0.00019275, 7.27310060, 0.99903884, 0.99949257, 0.49327030],
+                             [- 6.27341535, -0.00031464, 0.00019274, 7.27310071, 0.99903894, 0.99949262, 0.49326995],
+                             [- 6.27341543, -0.00031461, 0.00019272, 7.27310082, 0.99903904, 0.99949268, 0.49327013],
+                             [- 6.27341550, -0.00031458, 0.00019270, 7.27310093, 0.99903914, 0.99949273, 0.49327030],
+                             [- 6.27341558, -0.00031454, 0.00019268, 7.27310104, 0.99903923, 0.99949278, 0.49327016],
+                             [- 6.27341566, -0.00031451, 0.00019266, 7.27310115, 0.99903933, 0.99949283, 0.49327003],
+                             [- 6.27341573, -0.00031448, 0.00019264, 7.27310125, 0.99903943, 0.99949288, 0.49327020],
+                             [- 6.27341581, -0.00031445, 0.00019262, 7.27310136, 0.99903953, 0.99949293, 0.49327016],
+                             [- 6.27341589, -0.00031442, 0.00019260, 7.27310147, 0.99903962, 0.99949298, 0.49327038],
+                             [- 6.27341596, -0.00031438, 0.00019258, 7.27310158, 0.99903972, 0.99949304, 0.49327020],
+                             [- 6.27341604, -0.00031435, 0.00019256, 7.27310169, 0.99903982, 0.99949309, 0.49326989],
+                             [- 6.27341612, -0.00031432, 0.00019254, 7.27310180, 0.99903992, 0.99949314, 0.49327033],
+                             [- 6.27341619, -0.00031429, 0.00019252, 7.27310190, 0.99904001, 0.99949319, 0.49327021],
+                             [- 6.27341627, -0.00031426, 0.00019250, 7.27310201, 0.99904011, 0.99949324, 0.49327047],
+                             [- 6.27341635, -0.00031423, 0.00019248, 7.27310212, 0.99904021, 0.99949329, 0.49327024],
+                             [- 6.27341642, -0.00031419, 0.00019246, 7.27310223, 0.99904031, 0.99949335, 0.49327034],
+                             [- 6.27341650, -0.00031416, 0.00019244, 7.27310234, 0.99904040, 0.99949340, 0.49327024],
+                             [- 6.27341658, -0.00031413, 0.00019242, 7.27310245, 0.99904050, 0.99949345, 0.49327049],
+                             [- 6.27341665, -0.00031410, 0.00019240, 7.27310255, 0.99904060, 0.99949350, 0.49327029],
+                             [- 6.27341673, -0.00031407, 0.00019238, 7.27310266, 0.99904070, 0.99949355, 0.49327027],
+                             [- 6.27341680, -0.00031403, 0.00019236, 7.27310277, 0.99904079, 0.99949360, 0.49327052],
+                             [- 6.27341688, -0.00031400, 0.00019234, 7.27310288, 0.99904089, 0.99949365, 0.49327062],
+                             [- 6.27341696, -0.00031397, 0.00019232, 7.27310299, 0.99904099, 0.99949370, 0.49327051],
+                             [- 6.27341703, -0.00031394, 0.00019231, 7.27310309, 0.99904108, 0.99949376, 0.49327035],
+                             [- 6.27341711, -0.00031391, 0.00019229, 7.27310320, 0.99904118, 0.99949381, 0.49327029],
+                             [- 6.27341719, -0.00031387, 0.00019227, 7.27310331, 0.99904128, 0.99949386, 0.49327040],
+                             [- 6.27341726, -0.00031384, 0.00019225, 7.27310342, 0.99904138, 0.99949391, 0.49327054],
+                             [- 6.27341734, -0.00031381, 0.00019223, 7.27310353, 0.99904147, 0.99949396, 0.49327057],
+                             [- 6.27341741, -0.00031378, 0.00019221, 7.27310363, 0.99904157, 0.99949401, 0.49327065],
+                             [- 6.27341749, -0.00031375, 0.00019219, 7.27310374, 0.99904167, 0.99949406, 0.49327055],
+                             [- 6.27341757, -0.00031372, 0.00019217, 7.27310385, 0.99904177, 0.99949412, 0.49327044],
+                             [- 6.27341764, -0.00031368, 0.00019215, 7.27310396, 0.99904186, 0.99949417, 0.49327060],
+                             [- 6.27341772, -0.00031365, 0.00019213, 7.27310407, 0.99904196, 0.99949422, 0.49327062],
+                             [- 6.27341779, -0.00031362, 0.00019211, 7.27310417, 0.99904206, 0.99949427, 0.49327057],
+                             [- 6.27341787, -0.00031359, 0.00019209, 7.27310428, 0.99904215, 0.99949432, 0.49327068],
+                             [- 6.27341795, -0.00031356, 0.00019207, 7.27310439, 0.99904225, 0.99949437, 0.49327087],
+                             [- 6.27341802, -0.00031353, 0.00019205, 7.27310450, 0.99904235, 0.99949442, 0.49327065],
+                             [- 6.27341810, -0.00031349, 0.00019203, 7.27310461, 0.99904244, 0.99949447, 0.49327040],
+                             [- 6.27341817, -0.00031346, 0.00019201, 7.27310471, 0.99904254, 0.99949453, 0.49327056],
+                             [- 6.27341825, -0.00031343, 0.00019199, 7.27310482, 0.99904264, 0.99949458, 0.49327057],
+                             [- 6.27341833, -0.00031340, 0.00019197, 7.27310493, 0.99904274, 0.99949463, 0.49327059],
+                             [- 6.27341840, -0.00031337, 0.00019195, 7.27310504, 0.99904283, 0.99949468, 0.49327075],
+                             [- 6.27341848, -0.00031333, 0.00019194, 7.27310514, 0.99904293, 0.99949473, 0.49327058],
+                             [- 6.27341855, -0.00031330, 0.00019192, 7.27310525, 0.99904303, 0.99949478, 0.49327073],
+                             [- 6.27341863, -0.00031327, 0.00019190, 7.27310536, 0.99904312, 0.99949483, 0.49327054],
+                             [- 6.27341871, -0.00031324, 0.00019188, 7.27310547, 0.99904322, 0.99949488, 0.49327048],
+                             [- 6.27341878, -0.00031321, 0.00019186, 7.27310557, 0.99904332, 0.99949493, 0.49327086],
+                             [- 6.27341886, -0.00031318, 0.00019184, 7.27310568, 0.99904341, 0.99949499, 0.49327056],
+                             [- 6.27341893, -0.00031314, 0.00019182, 7.27310579, 0.99904351, 0.99949504, 0.49327071],
+                             [- 6.27341901, -0.00031311, 0.00019180, 7.27310590, 0.99904361, 0.99949509, 0.49327045],
+                             [- 6.27341909, -0.00031308, 0.00019178, 7.27310600, 0.99904370, 0.99949514, 0.49327067],
+                             [- 6.27341916, -0.00031305, 0.00019176, 7.27310611, 0.99904380, 0.99949519, 0.49327067],
+                             [- 6.27341924, -0.00031302, 0.00019174, 7.27310622, 0.99904390, 0.99949524, 0.49327074],
+                             [- 6.27341931, -0.00031299, 0.00019172, 7.27310633, 0.99904399, 0.99949529, 0.49327107],
+                             [- 6.27341939, -0.00031295, 0.00019170, 7.27310643, 0.99904409, 0.99949534, 0.49327064],
+                             [- 6.27341946, -0.00031292, 0.00019168, 7.27310654, 0.99904419, 0.99949539, 0.49327063],
+                             [- 6.27341954, -0.00031289, 0.00019166, 7.27310665, 0.99904428, 0.99949545, 0.49327050],
+                             [- 6.27341962, -0.00031286, 0.00019164, 7.27310676, 0.99904438, 0.99949550, 0.49327069],
+                             [- 6.27341969, -0.00031283, 0.00019162, 7.27310686, 0.99904448, 0.99949555, 0.49327081],
+                             [- 6.27341977, -0.00031280, 0.00019161, 7.27310697, 0.99904457, 0.99949560, 0.49327077],
+                             [- 6.27341984, -0.00031276, 0.00019159, 7.27310708, 0.99904467, 0.99949565, 0.49327081],
+                             [- 6.27341992, -0.00031273, 0.00019157, 7.27310719, 0.99904477, 0.99949570, 0.49327088],
+                             [- 6.27341999, -0.00031270, 0.00019155, 7.27310729, 0.99904486, 0.99949575, 0.49327082],
+                             [- 6.27342007, -0.00031267, 0.00019153, 7.27310740, 0.99904496, 0.99949580, 0.49327067],
+                             [- 6.27342015, -0.00031264, 0.00019151, 7.27310751, 0.99904506, 0.99949585, 0.49327061],
+                             [- 6.27342022, -0.00031261, 0.00019149, 7.27310761, 0.99904515, 0.99949590, 0.49327079],
+                             [- 6.27342030, -0.00031258, 0.00019147, 7.27310772, 0.99904525, 0.99949595, 0.49327103],
+                             [- 6.27342037, -0.00031254, 0.00019145, 7.27310783, 0.99904535, 0.99949601, 0.49327107],
+                             [- 6.27342045, -0.00031251, 0.00019143, 7.27310794, 0.99904544, 0.99949606, 0.49327084],
+                             [- 6.27342052, -0.00031248, 0.00019141, 7.27310804, 0.99904554, 0.99949611, 0.49327096],
+                             [- 6.27342060, -0.00031245, 0.00019139, 7.27310815, 0.99904563, 0.99949616, 0.49327062],
+                             [- 6.27342067, -0.00031242, 0.00019137, 7.27310826, 0.99904573, 0.99949621, 0.49327088],
+                             [- 6.27342075, -0.00031239, 0.00019135, 7.27310836, 0.99904583, 0.99949626, 0.49327094],
+                             [- 6.27342083, -0.00031235, 0.00019133, 7.27310847, 0.99904592, 0.99949631, 0.49327095],
+                             [- 6.27342090, -0.00031232, 0.00019132, 7.27310858, 0.99904602, 0.99949636, 0.49327111],
+                             [- 6.27342098, -0.00031229, 0.00019130, 7.27310869, 0.99904612, 0.99949641, 0.49327066],
+                             [- 6.27342105, -0.00031226, 0.00019128, 7.27310879, 0.99904621, 0.99949646, 0.49327112],
+                             [- 6.27342113, -0.00031223, 0.00019126, 7.27310890, 0.99904631, 0.99949651, 0.49327094],
+                             [- 6.27342120, -0.00031220, 0.00019124, 7.27310901, 0.99904641, 0.99949656, 0.49327097],
+                             [- 6.27342128, -0.00031217, 0.00019122, 7.27310911, 0.99904650, 0.99949662, 0.49327094],
+                             [- 6.27342135, -0.00031213, 0.00019120, 7.27310922, 0.99904660, 0.99949667, 0.49327120],
+                             [- 6.27342143, -0.00031210, 0.00019118, 7.27310933, 0.99904669, 0.99949672, 0.49327123],
+                             [- 6.27342150, -0.00031207, 0.00019116, 7.27310943, 0.99904679, 0.99949677, 0.49327124],
+                             [- 6.27342158, -0.00031204, 0.00019114, 7.27310954, 0.99904689, 0.99949682, 0.49327089],
+                             [- 6.27342166, -0.00031201, 0.00019112, 7.27310965, 0.99904698, 0.99949687, 0.49327096],
+                             [- 6.27342173, -0.00031198, 0.00019110, 7.27310975, 0.99904708, 0.99949692, 0.49327093],
+                             [- 6.27342181, -0.00031195, 0.00019108, 7.27310986, 0.99904717, 0.99949697, 0.49327128],
+                             [- 6.27342188, -0.00031191, 0.00019106, 7.27310997, 0.99904727, 0.99949702, 0.49327122],
+                             [- 6.27342196, -0.00031188, 0.00019105, 7.27311007, 0.99904737, 0.99949707, 0.49327128],
+                             [- 6.27342203, -0.00031185, 0.00019103, 7.27311018, 0.99904746, 0.99949712, 0.49327113],
+                             [- 6.27342211, -0.00031182, 0.00019101, 7.27311029, 0.99904756, 0.99949717, 0.49327121],
+                             [- 6.27342218, -0.00031179, 0.00019099, 7.27311039, 0.99904765, 0.99949722, 0.49327115],
+                             [- 6.27342226, -0.00031176, 0.00019097, 7.27311050, 0.99904775, 0.99949727, 0.49327114],
+                             [- 6.27342233, -0.00031173, 0.00019095, 7.27311061, 0.99904785, 0.99949733, 0.49327102],
+                             [- 6.27342241, -0.00031169, 0.00019093, 7.27311071, 0.99904794, 0.99949738, 0.49327120],
+                             [- 6.27342248, -0.00031166, 0.00019091, 7.27311082, 0.99904804, 0.99949743, 0.49327130],
+                             [- 6.27342256, -0.00031163, 0.00019089, 7.27311093, 0.99904813, 0.99949748, 0.49327109],
+                             [- 6.27342263, -0.00031160, 0.00019087, 7.27311103, 0.99904823, 0.99949753, 0.49327132],
+                             [- 6.27342271, -0.00031157, 0.00019085, 7.27311114, 0.99904833, 0.99949758, 0.49327146],
+                             [- 6.27342278, -0.00031154, 0.00019083, 7.27311125, 0.99904842, 0.99949763, 0.49327090],
+                             [- 6.27342286, -0.00031151, 0.00019081, 7.27311135, 0.99904852, 0.99949768, 0.49327123],
+                             [- 6.27342293, -0.00031147, 0.00019080, 7.27311146, 0.99904861, 0.99949773, 0.49327134],
+                             [- 6.27342301, -0.00031144, 0.00019078, 7.27311156, 0.99904871, 0.99949778, 0.49327133],
+                             [- 6.27342308, -0.00031141, 0.00019076, 7.27311167, 0.99904880, 0.99949783, 0.49327117],
+                             [- 6.27342316, -0.00031138, 0.00019074, 7.27311178, 0.99904890, 0.99949788, 0.49327124],
+                             [- 6.27342323, -0.00031135, 0.00019072, 7.27311188, 0.99904900, 0.99949793, 0.49327116],
+                             [- 6.27342331, -0.00031132, 0.00019070, 7.27311199, 0.99904909, 0.99949798, 0.49327125],
+                             [- 6.27342338, -0.00031129, 0.00019068, 7.27311210, 0.99904919, 0.99949803, 0.49327132],
+                             [- 6.27342346, -0.00031126, 0.00019066, 7.27311220, 0.99904928, 0.99949808, 0.49327161],
+                             [- 6.27342353, -0.00031122, 0.00019064, 7.27311231, 0.99904938, 0.99949813, 0.49327137],
+                             [- 6.27342361, -0.00031119, 0.00019062, 7.27311242, 0.99904947, 0.99949818, 0.49327141],
+                             [- 6.27342368, -0.00031116, 0.00019060, 7.27311252, 0.99904957, 0.99949824, 0.49327151],
+                             [- 6.27342376, -0.00031113, 0.00019058, 7.27311263, 0.99904966, 0.99949829, 0.49327147],
+                             [- 6.27342383, -0.00031110, 0.00019057, 7.27311273, 0.99904976, 0.99949834, 0.49327157],
+                             [- 6.27342391, -0.00031107, 0.00019055, 7.27311284, 0.99904986, 0.99949839, 0.49327158],
+                             [- 6.27342398, -0.00031104, 0.00019053, 7.27311295, 0.99904995, 0.99949844, 0.49327140],
+                             [- 6.27342406, -0.00031101, 0.00019051, 7.27311305, 0.99905005, 0.99949849, 0.49327149],
+                             [- 6.27342413, -0.00031097, 0.00019049, 7.27311316, 0.99905014, 0.99949854, 0.49327130],
+                             [- 6.27342421, -0.00031094, 0.00019047, 7.27311326, 0.99905024, 0.99949859, 0.49327138],
+                             [- 6.27342428, -0.00031091, 0.00019045, 7.27311337, 0.99905033, 0.99949864, 0.49327154],
+                             [- 6.27342436, -0.00031088, 0.00019043, 7.27311348, 0.99905043, 0.99949869, 0.49327144],
+                             [- 6.27342443, -0.00031085, 0.00019041, 7.27311358, 0.99905052, 0.99949874, 0.49327149],
+                             [- 6.27342451, -0.00031082, 0.00019039, 7.27311369, 0.99905062, 0.99949879, 0.49327160],
+                             [- 6.27342458, -0.00031079, 0.00019037, 7.27311379, 0.99905071, 0.99949884, 0.49327162],
+                             [- 6.27342466, -0.00031076, 0.00019035, 7.27311390, 0.99905081, 0.99949889, 0.49327146],
+                             [- 6.27342473, -0.00031072, 0.00019034, 7.27311401, 0.99905091, 0.99949894, 0.49327178],
+                             [- 6.27342480, -0.00031069, 0.00019032, 7.27311411, 0.99905100, 0.99949899, 0.49327156],
+                             [- 6.27342488, -0.00031066, 0.00019030, 7.27311422, 0.99905110, 0.99949904, 0.49327151],
+                             [- 6.27342495, -0.00031063, 0.00019028, 7.27311432, 0.99905119, 0.99949909, 0.49327157],
+                             [- 6.27342503, -0.00031060, 0.00019026, 7.27311443, 0.99905129, 0.99949914, 0.49327162],
+                             [- 6.27342510, -0.00031057, 0.00019024, 7.27311453, 0.99905138, 0.99949919, 0.49327180],
+                             [- 6.27342518, -0.00031054, 0.00019022, 7.27311464, 0.99905148, 0.99949924, 0.49327153],
+                             [- 6.27342525, -0.00031051, 0.00019020, 7.27311475, 0.99905157, 0.99949929, 0.49327170],
+                             [- 6.27342533, -0.00031047, 0.00019018, 7.27311485, 0.99905167, 0.99949934, 0.49327164],
+                             [- 6.27342540, -0.00031044, 0.00019016, 7.27311496, 0.99905176, 0.99949939, 0.49327177],
+                             [- 6.27342548, -0.00031041, 0.00019014, 7.27311506, 0.99905186, 0.99949944, 0.49327171],
+                             [- 6.27342555, -0.00031038, 0.00019013, 7.27311517, 0.99905195, 0.99949949, 0.49327163],
+                             [- 6.27342563, -0.00031035, 0.00019011, 7.27311527, 0.99905205, 0.99949954, 0.49327148],
+                             [- 6.27342570, -0.00031032, 0.00019009, 7.27311538, 0.99905214, 0.99949959, 0.49327177],
+                             [- 6.27342577, -0.00031029, 0.00019007, 7.27311549, 0.99905224, 0.99949964, 0.49327190],
+                             [- 6.27342585, -0.00031026, 0.00019005, 7.27311559, 0.99905233, 0.99949969, 0.49327174],
+                             [- 6.27342592, -0.00031023, 0.00019003, 7.27311570, 0.99905243, 0.99949974, 0.49327179],
+                             [- 6.27342600, -0.00031019, 0.00019001, 7.27311580, 0.99905252, 0.99949979, 0.49327165],
+                             [- 6.27342607, -0.00031016, 0.00018999, 7.27311591, 0.99905262, 0.99949984, 0.49327180],
+                             [- 6.27342615, -0.00031013, 0.00018997, 7.27311601, 0.99905271, 0.99949989, 0.49327176],
+                             [- 6.27342622, -0.00031010, 0.00018995, 7.27311612, 0.99905281, 0.99949994, 0.49327155],
+                             [- 6.27342630, -0.00031007, 0.00018993, 7.27311622, 0.99905290, 0.99949999, 0.49327169],
+                             [- 6.27342637, -0.00031004, 0.00018992, 7.27311633, 0.99905300, 0.99950004, 0.49327184],
+                             [- 6.27342644, -0.00031001, 0.00018990, 7.27311644, 0.99905309, 0.99950009, 0.49327184],
+                             [- 6.27342652, -0.00030998, 0.00018988, 7.27311654, 0.99905319, 0.99950014, 0.49327176],
+                             [- 6.27342659, -0.00030995, 0.00018986, 7.27311665, 0.99905328, 0.99950019, 0.49327184],
+                             [- 6.27342667, -0.00030992, 0.00018984, 7.27311675, 0.99905338, 0.99950024, 0.49327166],
+                             [- 6.27342674, -0.00030988, 0.00018982, 7.27311686, 0.99905347, 0.99950029, 0.49327222],
+                             [- 6.27342682, -0.00030985, 0.00018980, 7.27311696, 0.99905357, 0.99950034, 0.49327211],
+                             [- 6.27342689, -0.00030982, 0.00018978, 7.27311707, 0.99905366, 0.99950039, 0.49327202],
+                             [- 6.27342696, -0.00030979, 0.00018976, 7.27311717, 0.99905376, 0.99950044, 0.49327179],
+                             [- 6.27342704, -0.00030976, 0.00018974, 7.27311728, 0.99905385, 0.99950049, 0.49327176],
+                             [- 6.27342711, -0.00030973, 0.00018973, 7.27311738, 0.99905394, 0.99950054, 0.49327202],
+                             [- 6.27342719, -0.00030970, 0.00018971, 7.27311749, 0.99905404, 0.99950059, 0.49327184],
+                             [- 6.27342726, -0.00030967, 0.00018969, 7.27311759, 0.99905413, 0.99950064, 0.49327198],
+                             [- 6.27342733, -0.00030964, 0.00018967, 7.27311770, 0.99905423, 0.99950069, 0.49327205],
+                             [- 6.27342741, -0.00030961, 0.00018965, 7.27311780, 0.99905432, 0.99950074, 0.49327200],
+                             [- 6.27342748, -0.00030957, 0.00018963, 7.27311791, 0.99905442, 0.99950079, 0.49327197],
+                             [- 6.27342756, -0.00030954, 0.00018961, 7.27311801, 0.99905451, 0.99950084, 0.49327183],
+                             [- 6.27342763, -0.00030951, 0.00018959, 7.27311812, 0.99905461, 0.99950089, 0.49327208],
+                             [- 6.27342771, -0.00030948, 0.00018957, 7.27311822, 0.99905470, 0.99950094, 0.49327205],
+                             [- 6.27342778, -0.00030945, 0.00018956, 7.27311833, 0.99905480, 0.99950099, 0.49327194]])
+
+    if value == 'h':
+        series = love_numbers[:, 0]
+    elif value == 'k':
+        series = love_numbers[:, 1]
+    elif value == 'l':
+        series = love_numbers[:, 2]
+    elif value == 'gamma':
+        series = love_numbers[:, 3]
+    elif value == 'lambda':
+        series = love_numbers[:, 4]
+    else:
+        raise RuntimeError(['love_numbers error message: unknow value:', value])
+
+    # choose degree 1 term for CF reference system
+    if frame == 'CF':  # from Blewitt, 2003, JGR
+        if value == 'h':
+            series[1] = -0.269
+        elif value == 'k':
+            series[1] = 0.021
+        elif value == 'l':
+            series[1] = 0.134
+
+    return series
Index: /issm/trunk/src/m/classes/SMBcomponents.m
===================================================================
--- /issm/trunk/src/m/classes/SMBcomponents.m	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBcomponents.m	(revision 24313)
@@ -5,9 +5,11 @@
 
 classdef SMBcomponents
-	properties (SetAccess=public) 
+	properties (SetAccess=public)
+		isclimatology = 0;
 		accumulation = NaN;
 		runoff = NaN;
 		evaporation = NaN;
-		requested_outputs      = {};
+		steps_per_step = 1;
+		requested_outputs     = {};
 	end
 	methods
@@ -35,13 +37,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
 
@@ -51,27 +53,31 @@
 			if ismember('MasstransportAnalysis',analyses),
 				md = checkfield(md,'fieldname','smb.accumulation','timeseries',1,'NaN',1,'Inf',1);
+				md = checkfield(md,'fieldname','smb.runoff','timeseries',1,'NaN',1,'Inf',1);
+				md = checkfield(md,'fieldname','smb.evaporation','timeseries',1,'NaN',1,'Inf',1);
 			end
 			if ismember('BalancethicknessAnalysis',analyses),
 				md = checkfield(md,'fieldname','smb.accumulation','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			end
-			if ismember('MasstransportAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.runoff','timeseries',1,'NaN',1,'Inf',1);
-			end
-			if ismember('BalancethicknessAnalysis',analyses),
 				md = checkfield(md,'fieldname','smb.runoff','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			end
-			if ismember('MasstransportAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.evaporation','timeseries',1,'NaN',1,'Inf',1);
-			end
-			if ismember('BalancethicknessAnalysis',analyses),
 				md = checkfield(md,'fieldname','smb.evaporation','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
 			end
+			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
+			md = checkfield(md,'fieldname','smb.isclimatology','values',[0 1]);
+			if (self.isclimatology)
+				md = checkfield(md,'fieldname', 'smb.accumulation', 'size',[md.mesh.numberofvertices+1],...
+						'message',['accumulation must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
+				md = checkfield(md,'fieldname', 'smb.runoff', 'size',[md.mesh.numberofvertices+1],...
+						'message',['runoff must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
+				md = checkfield(md,'fieldname', 'smb.evaporation', 'size',[md.mesh.numberofvertices+1],...
+						'message',['evaporation must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
+			end
 		end % }}}
 		function disp(self) % {{{
-			disp(sprintf('   surface forcings parameters (SMB=accumulation-runoff-evaporation) :'));
+			disp(sprintf('	  surface forcings parameters (SMB=accumulation-runoff-evaporation) :'));
 			fielddisplay(self,'accumulation','accumulated snow [m/yr ice eq]');
 			fielddisplay(self,'runoff','amount of ice melt lost from the ice column [m/yr ice eq]');
 			fielddisplay(self,'evaporation','amount of ice lost to evaporative processes [m/yr ice eq]');
+			fielddisplay(self,'isclimatology','repeat all forcings when past last forcing time (default false)');
+			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
 			fielddisplay(self,'requested_outputs','additional outputs requested');
 		end % }}}
@@ -84,13 +90,14 @@
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','runoff','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			
+			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
 			%process requested outputs
 			outputs = self.requested_outputs;
 			pos  = find(ismember(outputs,'default'));
 			if ~isempty(pos),
-				outputs(pos) = [];                         %remove 'default' from outputs
-				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
+				outputs(pos) = [];			       %remove 'default' from outputs
+				outputs	 = [outputs defaultoutputs(self,md)]; %add defaults
 			end
 			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isclimatology','format','Boolean');
 
 		end % }}}
Index: /issm/trunk/src/m/classes/SMBcomponents.py
===================================================================
--- /issm/trunk/src/m/classes/SMBcomponents.py	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBcomponents.py	(revision 24313)
@@ -4,92 +4,97 @@
 from WriteData import *
 
+
 class SMBcomponents(object):
-	"""
-	SMBcomponents Class definition
+    """
+    SMBcomponents Class definition
 
-	   Usage:
-	      SMBcomponents=SMBcomponents();
-	"""
+       Usage:
+          SMBcomponents = SMBcomponents()
+    """
 
-	def __init__(self): # {{{
-		self.accumulation = float('NaN')
-		self.runoff = float('NaN')
-		self.evaporation = float('NaN')
-		self.requested_outputs      = []
-		#}}}
-	def __repr__(self): # {{{
-		string="   surface forcings parameters (SMB=accumulation-runoff-evaporation) :"
-		string="%s\n%s"%(string,fielddisplay(self,'accumulation','accumulated snow [m/yr ice eq]'))
-		string="%s\n%s"%(string,fielddisplay(self,'runoff','amount of ice melt lost from the ice column [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,'requested_outputs','additional outputs requested'))
-		return string
-		#}}}
-	def extrude(self,md): # {{{
+    def __init__(self):  # {{{
+        self.accumulation = float('NaN')
+        self.runoff = float('NaN')
+        self.evaporation = float('NaN')
+        self.isclimatology = 0
+        self.steps_per_step = 1
+        self.requested_outputs = []
+        #}}}
 
-		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');
-		return self
-	#}}}
-	def defaultoutputs(self,md): # {{{
-		return []
-	#}}}
-	def initialize(self,md): # {{{
+    def __repr__(self):  # {{{
+        string = "   surface forcings parameters (SMB = accumulation-runoff-evaporation) :"
+        string = "%s\n%s" % (string, fielddisplay(self, 'accumulation', 'accumulated snow [m/yr ice eq]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'runoff', 'amount of ice melt lost from the ice column [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, 'isclimatology', 'repeat all forcings when past last forcing time (default false)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+        return string
+        #}}}
 
-		if np.all(np.isnan(self.accumulation)):
-			self.accumulation=np.zeros((md.mesh.numberofvertices))
-			print "      no SMB.accumulation specified: values set as zero"
+    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')
+        return self
+    #}}}
 
-		if np.all(np.isnan(self.runoff)):
-			self.runoff=np.zeros((md.mesh.numberofvertices))
-			print "      no SMB.runoff specified: values set as zero"
+    def defaultoutputs(self, md):  # {{{
+        return []
+    #}}}
 
-		if np.all(np.isnan(self.evaporation)):
-			self.evaporation=np.zeros((md.mesh.numberofvertices))
-			print "      no SMB.evaporation specified: values set as zero"
+    def initialize(self, md):  # {{{
+        if np.all(np.isnan(self.accumulation)):
+            self.accumulation = np.zeros((md.mesh.numberofvertices))
+            print("      no SMB.accumulation specified: values set as zero")
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+        if np.all(np.isnan(self.runoff)):
+            self.runoff = np.zeros((md.mesh.numberofvertices))
+            print("      no SMB.runoff specified: values set as zero")
 
-		if 'MasstransportAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.accumulation','timeseries',1,'NaN',1,'Inf',1)
+        if np.all(np.isnan(self.evaporation)):
+            self.evaporation = np.zeros((md.mesh.numberofvertices))
+            print("      no SMB.evaporation specified: values set as zero")
 
-		if 'BalancethicknessAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.accumulation','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
+        return self
+    #}}}
 
-		if 'MasstransportAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.runoff','timeseries',1,'NaN',1,'Inf',1)
+    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.runoff', '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.runoff', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.evaporation', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
 
-		if 'BalancethicknessAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.runoff','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
+        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
+        md = checkfield(md, 'fieldname', 'smb.isclimatology', 'values', [0, 1])
 
-		if 'MasstransportAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.evaporation','timeseries',1,'NaN',1,'Inf',1)
+        return md
+    # }}}
 
-		if 'BalancethicknessAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.evaporation','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
-		
-		md = checkfield(md,'fieldname','masstransport.requested_outputs','stringrow',1)
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+        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, 'fieldname', 'steps_per_step', 'format', 'Integer')
+    #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isclimatology', 'format', 'Boolean')
+        if (self.isclimatology > 0):
+            md = checkfield(md, 'fieldname', 'smb.accumulation', 'size', [md.mesh.numberofvertices + 1], 'message', 'accumulation must have md.mesh.numberofvertices + 1 rows in order to force a climatology')
+            md = checkfield(md, 'fieldname', 'smb.runoff', 'size', [md.mesh.numberofvertices + 1], 'message', 'runoff must have md.mesh.numberofvertices + 1 rows in order to force a climatology')
+            md = checkfield(md, 'fieldname', 'smb.evaporation', 'size', [md.mesh.numberofvertices + 1], 'message', 'evaporation must have md.mesh.numberofvertices + 1 rows in order to force a climatology')
 
-		yts=md.constants.yts
-
-		WriteData(fid,prefix,'name','md.smb.model','data',2,'format','Integer');
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','runoff','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray')
-
-	# }}}
+    # }}}
Index: /issm/trunk/src/m/classes/SMBd18opdd.m
===================================================================
--- /issm/trunk/src/m/classes/SMBd18opdd.m	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBd18opdd.m	(revision 24313)
@@ -5,11 +5,12 @@
 
 classdef SMBd18opdd
-	properties (SetAccess=public) 
+	properties (SetAccess=public)
+
 		desfac                    = 0;
 		s0p                       = NaN;
 		s0t                       = NaN;
 		rlaps                     = 0;
-		rlapslgm                  = 0; 
-		dpermil                   = 0; 
+		rlapslgm                  = 0;
+		dpermil                   = 0;
 		f                         = 0;
 		Tdiff                     = NaN;
@@ -28,5 +29,6 @@
 		pddfac_snow               = NaN;
 		pddfac_ice                = NaN;
-		requested_outputs      = {};
+		steps_per_step            = 1;
+		requested_outputs         = {};
 	end
 	methods
@@ -50,5 +52,5 @@
 
 		end % }}}
-	 function list = defaultoutputs(self,md) % {{{
+		function list = defaultoutputs(self,md) % {{{
 
 			list = {''};
@@ -56,8 +58,8 @@
 		end % }}}
 		function self = initialize(self,md) % {{{
-                    
+
 			if isnan(self.s0p),
-			 	self.s0p=zeros(md.mesh.numberofvertices,1);
-			 	disp('      no SMBd18opdd.s0p specified: values set as zero');
+				self.s0p=zeros(md.mesh.numberofvertices,1);
+				disp('      no SMBd18opdd.s0p specified: values set as zero');
 			end
 			if isnan(self.s0t),
@@ -69,15 +71,15 @@
 		function self = setdefaultparameters(self) % {{{
 
-		  self.ismungsm   = 0;
-		  self.isd18opd   = 1;
-		  self.istemperaturescaled = 1;
-		  self.isprecipscaled = 1;
-		  self.desfac     = 0.5;
-		  self.rlaps      = 6.5;
-		  self.rlapslgm   = 6.5;
-		  self.dpermil    = 2.4;
-		  self.f          = 0.169;
-		  self.issetpddfac = 0;
-                  
+			self.ismungsm   = 0;
+			self.isd18opd   = 1;
+			self.istemperaturescaled = 1;
+			self.isprecipscaled = 1;
+			self.desfac     = 0.5;
+			self.rlaps      = 6.5;
+			self.rlapslgm   = 6.5;
+			self.dpermil    = 2.4;
+			self.f          = 0.169;
+			self.issetpddfac = 0;
+
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
@@ -89,5 +91,6 @@
 				md = checkfield(md,'fieldname','smb.rlaps','>=',0,'numel',1);
 				md = checkfield(md,'fieldname','smb.rlapslgm','>=',0,'numel',1);
-				if(self.isd18opd==1) 
+
+				if(self.isd18opd==1)
 					md = checkfield(md,'fieldname','smb.temperatures_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1,'Inf',1,'timeseries',1);
 					md = checkfield(md,'fieldname','smb.precipitations_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1,'Inf',1,'timeseries',1);
@@ -104,5 +107,5 @@
 					md = checkfield(md,'fieldname','smb.delta18o','NaN',1,'Inf',1,'size',[2,NaN],'singletimeseries',1);
 					md = checkfield(md,'fieldname','smb.dpermil','>=',0,'numel',1);
-				   md = checkfield(md,'fieldname','smb.f','>=',0,'numel',1);
+					md = checkfield(md,'fieldname','smb.f','>=',0,'numel',1);
 					if(self.istemperaturescaled==0)
 						lent=size(self.temperatures_reconstructed,2);
@@ -121,4 +124,5 @@
 				end
 			end
+			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
 		end % }}}
@@ -133,5 +137,5 @@
 			fielddisplay(self,'s0t','should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]');
 			fielddisplay(self,'rlaps','present day lapse rate [degree/km]');
-			if(self.isd18opd==1) 
+			if(self.isd18opd==1)
 				fielddisplay(self,'temperatures_presentday','monthly present day surface temperatures [K], required if delta18o/mungsm/d18opd is activated');
 				fielddisplay(self,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if delta18o/mungsm/d18opd is activated');
@@ -144,7 +148,7 @@
 					fielddisplay(self,'precipitations_reconstructed','monthly historical precipitation [m/yr water eq], required if delta18o/mungsm/d18opd is activated and isprecipscaled is not activated');
 				end
-				fielddisplay(self,'delta18o','delta18o [per mil], required if pdd is activated and d18opd activated');  
-				fielddisplay(self,'dpermil','degree per mil, required if d18opd is activated');                            
-			   fielddisplay(self,'f','precip/temperature scaling factor, required if d18opd is activated');
+				fielddisplay(self,'delta18o','delta18o [per mil], required if pdd is activated and d18opd activated');
+				fielddisplay(self,'dpermil','degree per mil, required if d18opd is activated');
+				fielddisplay(self,'f','precip/temperature scaling factor, required if d18opd is activated');
 			end
 			if(self.issetpddfac==1)
@@ -152,4 +156,5 @@
 				fielddisplay(self,'pddfac_ice','Pdd factor for ice, at each vertex [mm ice equiv/day/degree C]');
 			end
+			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
 			fielddisplay(self,'requested_outputs','additional outputs requested');
 			% No need to display rlapslgm, Tdiff, ismungsm
@@ -173,4 +178,5 @@
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts);
+			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
 
 			if self.isd18opd
@@ -181,5 +187,5 @@
 				WriteData(fid,prefix,'object',self,'class','smb','fieldname','delta18o','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts);
 				WriteData(fid,prefix,'object',self,'class','smb','fieldname','dpermil','format','Double');
-			   WriteData(fid,prefix,'object',self,'class','smb','fieldname','f','format','Double');
+				WriteData(fid,prefix,'object',self,'class','smb','fieldname','f','format','Double');
 				if self.istemperaturescaled==0
 					WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_reconstructed','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
@@ -193,5 +199,5 @@
 				WriteData(fid,prefix,'object',self,'class','smb','fieldname','pddfac_ice','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 			end
-			
+
 			%process requested outputs
 			outputs = self.requested_outputs;
Index: /issm/trunk/src/m/classes/SMBd18opdd.py
===================================================================
--- /issm/trunk/src/m/classes/SMBd18opdd.py	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBd18opdd.py	(revision 24313)
@@ -5,199 +5,208 @@
 from project3d import project3d
 
+
 class SMBd18opdd(object):
-	"""
-	SMBd18opdd Class definition
-
-	   Usage:
-	      SMBd18opdd=SMBd18opdd();
-	"""
-
-	def __init__(self): # {{{
-		self.desfac                    = 0.
-		self.s0p                       = float('NaN')
-		self.s0t                       = float('NaN')
-		self.rlaps                     = 0.
-		self.rlapslgm                  = 0.
-		self.dpermil                   = 0.
-		self.f                         = 0.
-		self.Tdiff                     = float('NaN')
-		self.sealev                    = float('NaN')
-		self.ismungsm                  = 0
-		self.isd18opd                  = 0
-		self.issetpddfac               = 0
-		self.istemperaturescaled       = 0
-		self.isprecipscaled            = 0
-		self.delta18o                  = float('NaN')
-		self.delta18o_surface          = float('NaN')
-		self.temperatures_presentday   = float('NaN')
-		self.precipitations_presentday = float('NaN')
-		self.temperatures_reconstructed   = float('NaN')
-		self.precipitations_reconstructed = float('NaN')
-		self.pddfac_snow               = float('NaN')
-		self.pddfac_ice                = float('NaN')
-
-		#set defaults
-		self.setdefaultparameters()
-		self.requested_outputs      = []
-		#}}}
-	def __repr__(self): # {{{
-		string="   surface forcings parameters:"
-
-		string="%s\n%s"%(string,fielddisplay(self,'isd18opd','is delta18o parametrisation from present day temperature and precipitation activated (0 or 1, default is 0)'))
-		string="%s\n%s"%(string,fielddisplay(self,'issetpddfac','is user passing in defined pdd factors at each vertex (0 or 1, default is 0)'))
-		string="%s\n%s"%(string,fielddisplay(self,'desfac','desertification elevation factor (between 0 and 1, default is 0.5) [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'s0p','should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'s0t','should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'rlaps','present day lapse rate [degree/km]'))
-		if self.isd18opd:
-			string="%s\n%s"%(string,fielddisplay(self,'temperatures_presentday','monthly present day surface temperatures [K], required if delta18o/mungsm is activated'))
-			string="%s\n%s"%(string,fielddisplay(self,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'))
-			string="%s\n%s"%(string,fielddisplay(self,'istemperaturescaled','if delta18o parametrisation from present day temperature and precipitation is activated, is temperature scaled to delta18o value? (0 or 1, default is 1)'))
-			string="%s\n%s"%(string,fielddisplay(self,'isprecipscaled','if delta18o parametrisation from present day temperature and precipitation is activated, is precipitation scaled to delta18o value? (0 or 1, default is 1)'))
-			
-			if self.istemperaturescaled==0:
-				string="%s\n%s"%(string,fielddisplay(self,'temperatures_reconstructed','monthly historical surface temperatures [K], required if delta18o/mungsm/d18opd is activated and istemperaturescaled is not activated'))
-				
-			if self.isprecipscaled==0:
-				string="%s\n%s"%(string,fielddisplay(self,'precipitations_reconstructed','monthly historical precipitation [m/yr water eq], required if delta18o/mungsm/d18opd is activated and isprecipscaled is not activated'))
-
-			string="%s\n%s"%(string,fielddisplay(self,'delta18o','delta18o [per mil], required if pdd is activated and delta18o activated'))
-			string="%s\n%s"%(string,fielddisplay(self,'dpermil','degree per mil, required if d18opd is activated'))
-			string="%s\n%s"%(string,fielddisplay(self,'f','precip/temperature scaling factor, required if d18opd is activated'))
-
-		if self.issetpddfac==1:
-			string="%s\n%s"%(string,fielddisplay(self,'pddfac_snow','Pdd factor for snow, at each vertex [mm ice equiv/day/degree C]'))
-			string="%s\n%s"%(string,fielddisplay(self,'pddfac_ice','Pdd factor for ice, at each vertex [mm ice equiv/day/degree C]'))
-		string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested'))
-
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-
-		if self.isd18opd: self.temperatures_presentday=project3d(md,'vector',self.temperatures_presentday,'type','node')
-		if self.isd18opd: self.precipitations_presentday=project3d(md,'vector',self.precipitations_presentday,'type','node')
-		if self.istemperaturescaled==0: self.temperatures_reconstructed=project3d(md,'vector',self.temperatures_reconstructed,'type','node')
-		if self.isprecipscaled==0: self.temperatures_reconstructed=project3d(md,'vector',self.precipitations_reconstructed,'type','node')
-		if self.isd18opd: self.precipitations_presentday=project3d(md,'vector',self.precipitations_presentday,'type','node')
-		if self.issetpddfac: self.pddfac_snow=project3d(md,'vector',self.pddfac_snow,'type','node')
-		if self.issetpddfac: self.pddfac_ice=project3d(md,'vector',self.pddfac_ice,'type','node')
-		self.s0p=project3d(md,'vector',self.s0p,'type','node')
-		self.s0t=project3d(md,'vector',self.s0t,'type','node')
-
-		return self
-	#}}}
-	def defaultoutputs(self,md): # {{{
-		return []
-	#}}}
-	def initialize(self,md): # {{{
-
-		if np.all(np.isnan(self.s0p)):
-			self.s0p=np.zeros((md.mesh.numberofvertices))
-			print "      no SMBd18opdd.s0p specified: values set as zero"
-
-		if np.all(np.isnan(self.s0t)):
-			self.s0t=np.zeros((md.mesh.numberofvertices))
-			print "      no SMBd18opdd.s0t specified: values set as zero"
-			
-		return self
-	# }}}
-	def setdefaultparameters(self): # {{{
-
-		#pdd method not used in default mode
-		self.ismungsm   = 0
-		self.isd18opd   = 1
-		self.istemperaturescaled = 1
-		self.isprecipscaled = 1
-		self.desfac     = 0.5
-		self.rlaps      = 6.5 
-		self.rlapslgm   = 6.5
-		self.dpermil    = 2.4
-		self.f          = 0.169
-		self.issetpddfac = 0
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-
-		if 'MasstransportAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.desfac','<=',1,'numel',[1])
-			md = checkfield(md,'fieldname','smb.s0p','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-			md = checkfield(md,'fieldname','smb.s0t','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-			md = checkfield(md,'fieldname','smb.rlaps','>=',0,'numel',[1])
-			md = checkfield(md,'fieldname','smb.rlapslgm','>=',0,'numel',[1])
-
-			if self.isd18opd:
-				lent=float(np.size(self.temperatures_presentday,1))
-				lenp=float(np.size(self.precipitations_presentday,1))
-				multt=np.ceil(lent/12.)*12.
-				multp=np.ceil(lenp/12.)*12.
-				md = checkfield(md,'fieldname','smb.temperatures_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1,'Inf',1,'timeseries',1)
-				md = checkfield(md,'fieldname','smb.precipitations_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1,'Inf',1,'timeseries',1)
-
-				if self.istemperaturescaled==0:
-					lent=float(np.size(self.temperatures_reconstructed,1))
-					multt=np.ceil(lent/12.)*12.
-					md = checkfield(md,'fieldname','smb.temperatures_reconstructed','size',[md.mesh.numberofvertices+1,multt],'NaN',1,'Inf',1,'timeseries',1)
-
-				if self.isprecipscaled==0:
-					lenp=float(np.size(self.precipitations_reconstructed,1))
-					multp=np.ceil(lent/12.)*12.
-					md = checkfield(md,'fieldname','smb.precipitations_reconstructed','size',[md.mesh.numberofvertices+1,multt],'NaN',1,'Inf',1,'timeseries',1)
-
-				md = checkfield(md,'fieldname','smb.delta18o','NaN',1,'Inf',1,'size',[2,np.nan],'singletimeseries',1)
-				md = checkfield(md,'fieldname','smb.dpermil','>=',0,'numel',[1])
-				md = checkfield(md,'fieldname','smb.f','>=',0,'numel',[1])
-
-			if self.issetpddfac:
-				md = checkfield(md,'fieldname','smb.pddfac_snow','>=',0,'NaN',1,'Inf',1)
-				md = checkfield(md,'fieldname','smb.pddfac_ice','>=',0,'NaN',1,'Inf',1)
-
-		md = checkfield(md,'fieldname','masstransport.requested_outputs','stringrow',1)
-
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-
-		yts=md.constants.yts
-
-		WriteData(fid,prefix,'name','md.smb.model','data',5,'format','Integer')
-
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','ismungsm','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','isd18opd','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','issetpddfac','format','Boolean');
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','desfac','format','Double')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0p','format','DoubleMat','mattype',1);
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0t','format','DoubleMat','mattype',1);
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlaps','format','Double')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlapslgm','format','Double')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts)
-
-		if self.isd18opd:
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','istemperaturescaled','format','Boolean')
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isprecipscaled','format','Boolean')
-
-			if self.istemperaturescaled==0:
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_reconstructed','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-
-			if self.isprecipscaled==0:
-				WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_reconstructed','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','delta18o','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dpermil','format','Double')
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','f','format','Double')
-
-		if self.issetpddfac:
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','pddfac_snow','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','pddfac_ice','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray')
-
-	# }}}
+    """
+    SMBd18opdd Class definition
+
+       Usage:
+          SMBd18opdd = SMBd18opdd()
+    """
+    def __init__(self):  # {{{
+        self.desfac = 0.
+        self.s0p = float('NaN')
+        self.s0t = float('NaN')
+        self.rlaps = 0.
+        self.rlapslgm = 0.
+        self.dpermil = 0.
+        self.f = 0.
+        self.Tdiff = float('NaN')
+        self.sealev = float('NaN')
+        self.ismungsm = 0
+        self.isd18opd = 0
+        self.issetpddfac = 0
+        self.istemperaturescaled = 0
+        self.isprecipscaled = 0
+        self.delta18o = float('NaN')
+        self.delta18o_surface = float('NaN')
+        self.temperatures_presentday = float('NaN')
+        self.precipitations_presentday = float('NaN')
+        self.temperatures_reconstructed = float('NaN')
+        self.precipitations_reconstructed = float('NaN')
+        self.pddfac_snow = float('NaN')
+        self.pddfac_ice = float('NaN')
+        self.steps_per_step = 1
+
+    #set defaults
+        self.setdefaultparameters()
+        self.requested_outputs = []
+    #}}}
+
+    def __repr__(self):  # {{{
+        string = "   surface forcings parameters:"
+
+        string = "%s\n%s" % (string, fielddisplay(self, 'isd18opd', 'is delta18o parametrisation from present day temperature and precipitation activated (0 or 1, default is 0)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'issetpddfac', 'is user passing in defined pdd factors at each vertex (0 or 1, default is 0)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'desfac', 'desertification elevation factor (between 0 and 1, default is 0.5) [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 's0p', 'should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 's0t', 'should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'rlaps', 'present day lapse rate [degree/km]'))
+        if self.isd18opd:
+            string = "%s\n%s" % (string, fielddisplay(self, 'temperatures_presentday', 'monthly present day surface temperatures [K], required if delta18o/mungsm is activated'))
+            string = "%s\n%s" % (string, fielddisplay(self, 'precipitations_presentday', 'monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'))
+            string = "%s\n%s" % (string, fielddisplay(self, 'istemperaturescaled', 'if delta18o parametrisation from present day temperature and precipitation is activated, is temperature scaled to delta18o value? (0 or 1, default is 1)'))
+            string = "%s\n%s" % (string, fielddisplay(self, 'isprecipscaled', 'if delta18o parametrisation from present day temperature and precipitation is activated, is precipitation scaled to delta18o value? (0 or 1, default is 1)'))
+
+            if self.istemperaturescaled == 0:
+                string = "%s\n%s" % (string, fielddisplay(self, 'temperatures_reconstructed', 'monthly historical surface temperatures [K], required if delta18o/mungsm/d18opd is activated and istemperaturescaled is not activated'))
+
+            if self.isprecipscaled == 0:
+                string = "%s\n%s" % (string, fielddisplay(self, 'precipitations_reconstructed', 'monthly historical precipitation [m/yr water eq], required if delta18o/mungsm/d18opd is activated and isprecipscaled is not activated'))
+
+            string = "%s\n%s" % (string, fielddisplay(self, 'delta18o', 'delta18o [per mil], required if pdd is activated and delta18o activated'))
+            string = "%s\n%s" % (string, fielddisplay(self, 'dpermil', 'degree per mil, required if d18opd is activated'))
+            string = "%s\n%s" % (string, fielddisplay(self, 'f', 'precip/temperature scaling factor, required if d18opd is activated'))
+
+        if self.issetpddfac == 1:
+            string = "%s\n%s" % (string, fielddisplay(self, 'pddfac_snow', 'Pdd factor for snow, at each vertex [mm ice equiv/day/degree C]'))
+            string = "%s\n%s" % (string, fielddisplay(self, 'pddfac_ice', 'Pdd factor for ice, at each vertex [mm ice equiv/day/degree C]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+
+        return string
+    #}}}
+
+    def extrude(self, md):  # {{{
+        if self.isd18opd:
+            self.temperatures_presentday = project3d(md, 'vector', self.temperatures_presentday, 'type', 'node')
+        if self.isd18opd:
+            self.precipitations_presentday = project3d(md, 'vector', self.precipitations_presentday, 'type', 'node')
+        if self.istemperaturescaled == 0:
+            self.temperatures_reconstructed = project3d(md, 'vector', self.temperatures_reconstructed, 'type', 'node')
+        if self.isprecipscaled == 0:
+            self.temperatures_reconstructed = project3d(md, 'vector', self.precipitations_reconstructed, 'type', 'node')
+        if self.isd18opd:
+            self.precipitations_presentday = project3d(md, 'vector', self.precipitations_presentday, 'type', 'node')
+        if self.issetpddfac:
+            self.pddfac_snow = project3d(md, 'vector', self.pddfac_snow, 'type', 'node')
+        if self.issetpddfac:
+            self.pddfac_ice = project3d(md, 'vector', self.pddfac_ice, 'type', 'node')
+        self.s0p = project3d(md, 'vector', self.s0p, 'type', 'node')
+        self.s0t = project3d(md, 'vector', self.s0t, 'type', 'node')
+        return self
+    #}}}
+
+    def defaultoutputs(self, md):  # {{{
+        return []
+    #}}}
+
+    def initialize(self, md):  # {{{
+        if np.all(np.isnan(self.s0p)):
+            self.s0p = np.zeros((md.mesh.numberofvertices))
+            print("      no SMBd18opdd.s0p specified: values set as zero")
+
+        if np.all(np.isnan(self.s0t)):
+            self.s0t = np.zeros((md.mesh.numberofvertices))
+            print("      no SMBd18opdd.s0t specified: values set as zero")
+        return self
+    # }}}
+
+    def setdefaultparameters(self):  # {{{
+        #pdd method not used in default mode
+        self.ismungsm = 0
+        self.isd18opd = 1
+        self.istemperaturescaled = 1
+        self.isprecipscaled = 1
+        self.desfac = 0.5
+        self.rlaps = 6.5
+        self.rlapslgm = 6.5
+        self.dpermil = 2.4
+        self.f = 0.169
+        self.issetpddfac = 0
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if 'MasstransportAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'smb.desfac', '<=', 1, 'numel', [1])
+            md = checkfield(md, 'fieldname', 'smb.s0p', '>=', 0, 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'smb.s0t', '>=', 0, 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'smb.rlaps', '>=', 0, 'numel', [1])
+            md = checkfield(md, 'fieldname', 'smb.rlapslgm', '>=', 0, 'numel', [1])
+            md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
+
+            if self.isd18opd:
+                lent = float(np.size(self.temperatures_presentday, 1))
+                lenp = float(np.size(self.precipitations_presentday, 1))
+                multt = np.ceil(lent / 12.) * 12.
+                multp = np.ceil(lenp / 12.) * 12.
+                md = checkfield(md, 'fieldname', 'smb.temperatures_presentday', 'size', [md.mesh.numberofvertices + 1, 12], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+                md = checkfield(md, 'fieldname', 'smb.precipitations_presentday', 'size', [md.mesh.numberofvertices + 1, 12], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+
+                if self.istemperaturescaled == 0:
+                    lent = float(np.size(self.temperatures_reconstructed, 1))
+                    multt = np.ceil(lent / 12.) * 12.
+                    md = checkfield(md, 'fieldname', 'smb.temperatures_reconstructed', 'size', [md.mesh.numberofvertices + 1, multt], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+
+                if self.isprecipscaled == 0:
+                    lenp = float(np.size(self.precipitations_reconstructed, 1))
+                    multp = np.ceil(lent / 12.) * 12.
+                    md = checkfield(md, 'fieldname', 'smb.precipitations_reconstructed', 'size', [md.mesh.numberofvertices + 1, multp], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+
+                md = checkfield(md, 'fieldname', 'smb.delta18o', 'NaN', 1, 'Inf', 1, 'size', [2, np.nan], 'singletimeseries', 1)
+                md = checkfield(md, 'fieldname', 'smb.dpermil', '>=', 0, 'numel', [1])
+                md = checkfield(md, 'fieldname', 'smb.f', '>=', 0, 'numel', [1])
+
+            if self.issetpddfac:
+                md = checkfield(md, 'fieldname', 'smb.pddfac_snow', '>=', 0, 'NaN', 1, 'Inf', 1)
+                md = checkfield(md, 'fieldname', 'smb.pddfac_ice', '>=', 0, 'NaN', 1, 'Inf', 1)
+
+        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
+
+        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 5, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ismungsm', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isd18opd', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'issetpddfac', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'desfac', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 's0p', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 's0t', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'rlaps', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'rlapslgm', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Tdiff', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'sealev', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
+
+        if self.isd18opd:
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'temperatures_presentday', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitations_presentday', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'istemperaturescaled', 'format', 'Boolean')
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isprecipscaled', 'format', 'Boolean')
+
+            if self.istemperaturescaled == 0:
+                WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'temperatures_reconstructed', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+
+            if self.isprecipscaled == 0:
+                WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitations_reconstructed', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'delta18o', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dpermil', 'format', 'Double')
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'f', 'format', 'Double')
+
+        if self.issetpddfac:
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'pddfac_snow', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'pddfac_ice', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+
+    #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
+
+    # }}}
Index: /issm/trunk/src/m/classes/SMBforcing.m
===================================================================
--- /issm/trunk/src/m/classes/SMBforcing.m	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBforcing.m	(revision 24313)
@@ -5,7 +5,9 @@
 
 classdef SMBforcing
-	properties (SetAccess=public) 
-		mass_balance = NaN;
-		requested_outputs      = {};
+	properties (SetAccess=public)
+		isclimatology     = 0;
+		mass_balance      = NaN;
+		steps_per_step    = 1;
+		requested_outputs = {};
 	end
 	methods
@@ -49,5 +51,5 @@
 
 			if (strcmp(solution,'TransientSolution') & md.transient.issmb == 0), return; end
-			
+
 			if ismember('MasstransportAnalysis',analyses),
 				md = checkfield(md,'fieldname','smb.mass_balance','timeseries',1,'NaN',1,'Inf',1);
@@ -56,9 +58,17 @@
 				md = checkfield(md,'fieldname','smb.mass_balance','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
 			end
+			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
+			md = checkfield(md,'fieldname','smb.isclimatology','values',[0 1]);
+			if (self.isclimatology)
+				md = checkfield(md,'fieldname', 'smb.mass_balance', 'size',[md.mesh.numberofvertices+1],...
+						'message',['mass_balance must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
+			end
 		end % }}}
 		function disp(self) % {{{
 			disp(sprintf('   surface forcings parameters:'));
 			fielddisplay(self,'mass_balance','surface mass balance [m/yr ice eq]');
+			fielddisplay(self,'isclimatology','repeat all forcings when past last forcing time (default false)');
+			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
 			fielddisplay(self,'requested_outputs','additional outputs requested');
 		end % }}}
@@ -70,5 +80,6 @@
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 			%WriteData(fid,prefix,'object',self,'class','smb','fieldname','mass_balance','format','CompressedMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			
+			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
+
 			%process requested outputs
 			outputs = self.requested_outputs;
@@ -79,10 +90,12 @@
 			end
 			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isclimatology','format','Boolean');
 
 		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
-		
+
 			writejs1Darray(fid,[modelname '.smb.mass_balance'],self.mass_balance);
 			writejscellstring(fid,[modelname '.smb.requested_outputs'],self.requested_outputs);
+			writejs1Darray(fid,[modelname '.smb.isclimatology'],self.isclimatology);
 
 		end % }}}
Index: /issm/trunk/src/m/classes/SMBforcing.py
===================================================================
--- /issm/trunk/src/m/classes/SMBforcing.py	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBforcing.py	(revision 24313)
@@ -5,64 +5,77 @@
 from project3d import project3d
 
+
 class SMBforcing(object):
-	"""
-	SMBforcing Class definition
+    """
+    SMBforcing Class definition
 
-	   Usage:
-	      SMB=SMBforcing();
-	"""
+       Usage:
+          SMB = SMBforcing()
+    """
 
-	def __init__(self): # {{{
-		self.mass_balance = float('NaN')
-		self.requested_outputs      = []
-		#}}}
-	def __repr__(self): # {{{
-		string="   surface forcings parameters:"
-		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'))
-		return string
-		#}}}
-	def extrude(self,md): # {{{
+    def __init__(self):  # {{{
+        self.mass_balance = float('NaN')
+        self.requested_outputs = []
+        self.isclimatology = 0
+        self.steps_per_step = 1
+    #}}}
 
-		self.mass_balance=project3d(md,'vector',self.mass_balance,'type','node');
-		return self
-	#}}}
-	def defaultoutputs(self,md): # {{{
-		return []
-	#}}}
-	def initialize(self,md): # {{{
+    def __repr__(self):  # {{{
+        string = "   surface forcings parameters:"
+        string = "%s\n%s" % (string, fielddisplay(self, 'mass_balance', 'surface mass balance [m/yr ice eq]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isclimatology', 'repeat all forcings when past last forcing time (default false)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+        return string
+    #}}}
 
-		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"
+    def extrude(self, md):  # {{{
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+        self.mass_balance = project3d(md, 'vector', self.mass_balance, 'type', 'node')
+        return self
+    #}}}
 
-		if 'MasstransportAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.mass_balance','timeseries',1,'NaN',1,'Inf',1)
+    def defaultoutputs(self, md):  # {{{
+        return []
+    #}}}
 
-		if 'BalancethicknessAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.mass_balance','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
+    def initialize(self, md):  # {{{
+        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")
 
-		md = checkfield(md,'fieldname','masstransport.requested_outputs','stringrow',1)
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+        return self
+    #}}}
 
-		yts=md.constants.yts
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if 'MasstransportAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'smb.mass_balance', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
 
-		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',md.constants.yts)
-		#WriteData(fid,prefix,'object',self,'class','smb','fieldname','mass_balance','format','CompressedMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-		
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray')
+        if 'BalancethicknessAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'smb.mass_balance', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
 
-	# }}}
+        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
+        md = checkfield(md, 'fieldname', 'smb.isclimatology', 'values', [0, 1])
+        if (self.isclimatology > 0):
+            md = checkfield(md, 'fieldname', 'smb.mass_balance', 'size', [md.mesh.numberofvertices + 1], 'message', 'mass_balance must have md.mesh.numberofvertices + 1 rows in order to force a climatology')
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):    # {{{
+        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, 'fieldname', 'steps_per_step', 'format', 'Integer')
+
+        #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isclimatology', 'format', 'Boolean')
+
+    # }}}
Index: /issm/trunk/src/m/classes/SMBgemb.m
===================================================================
--- /issm/trunk/src/m/classes/SMBgemb.m	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBgemb.m	(revision 24313)
@@ -1,14 +1,14 @@
-%SMBgemb Class definition. 
-%   This is the class that hosts all the inputs for the Alberta Glacier Surface Mass Balance Model 
+%SMBgemb Class definition.
+%   This is the class that hosts all the inputs for the Alberta Glacier Surface Mass Balance Model
 %   Alex Gardner, University of Alberta.
-%   
+%
 %   Usage:
 %      SMBgemb=SMBgemb();
 
 classdef SMBgemb
-	properties (SetAccess=public)  
-	% {{{
-		%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 
+	properties (SetAccess=public)
+		% {{{
+		%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. )
 
@@ -21,7 +21,8 @@
 		ismelt;
 		isdensification;
-		isturbulentflux;    
-
-		%inputs: 
+		isturbulentflux;
+		isclimatology;
+
+		%inputs:
 		Ta    = NaN; %2 m air temperature, in Kelvin
 		V     = NaN; %wind speed (m/s-1)
@@ -31,14 +32,15 @@
 		eAir  = NaN; %screen level vapor pressure [Pa]
 		pAir  = NaN; %surface pressure [Pa]
-		
+
 		Tmean = NaN; %mean annual temperature [K]
+		Vmean = NaN; %mean annual wind velocity [m s-1]
 		C     = NaN; %mean annual snow accumulation [kg m-2 yr-1]
 		Tz    = NaN; %height above ground at which temperature (T) was sampled [m]
-		Vz    = NaN; %height above ground at which wind (V) eas sampled [m]
+		Vz    = NaN; %height above ground at which wind (V) was sampled [m]
 
 		%optional inputs:
 		aValue = NaN; %Albedo forcing at every element.  Used only if aIdx == 0.
 		teValue = NaN; %Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)
-        
+
 		% Initialization of snow properties
 		Dzini = NaN; %cell depth (m)
@@ -53,44 +55,52 @@
 		Sizeini = NaN; %Number of layers
 
-		%settings: 
+		%settings:
 		aIdx   = NaN; %method for calculating albedo and subsurface absorption (default is 1)
-		           % 0: direct input from aValue parameter
-		           % 1: effective grain radius [Gardner & Sharp, 2009]
-					  % 2: effective grain radius [Brun et al., 2009]
-					  % 3: density and cloud amount [Greuell & Konzelmann, 1994]
-					  % 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
+			      % 0: direct input from aValue parameter
+			      % 1: effective grain radius [Gardner & Sharp, 2009]
+			      % 2: effective grain radius [Brun et al., 2009]
+			      % 3: density and cloud amount [Greuell & Konzelmann, 1994]
+			      % 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
 
 		swIdx  = NaN; % apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1)
 
 		denIdx = NaN; %densification model to use (default is 2):
-					% 1 = emperical model of Herron and Langway (1980)
-					% 2 = semi-emperical model of Anthern et al. (2010)
-					% 3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)
-					% 4 = DO NOT USE: emperical model of Li and Zwally (2004)
-					% 5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)
-					% 6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)
-					% 7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)
+			      % 1 = emperical model of Herron and Langway (1980)
+			      % 2 = semi-emperical model of Anthern et al. (2010)
+			      % 3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)
+			      % 4 = DO NOT USE: emperical model of Li and Zwally (2004)
+			      % 5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)
+			      % 6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)
+			      % 7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)
+
+		dsnowIdx = NaN; %model for fresh snow accumulation density (default is 1):
+				% 0 = Original GEMB value, 150 kg/m^3
+				% 1 = Antarctica value of fresh snow density, 350 kg/m^3
+				% 2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2008)
+				% 3 = Antarctica model of Kaspers et al. (2004)
+				% 4 = Greenland model of Kuipers Munneke et al. (2015)
 
 		zTop  = NaN; % depth over which grid length is constant at the top of the snopack (default 10) [m]
-		dzTop = NaN; % initial top vertical grid spacing (default .05) [m] 
-		dzMin = NaN; % initial min vertical allowable grid spacing (default dzMin/2) [m] 
+		dzTop = NaN; % initial top vertical grid spacing (default .05) [m]
+		dzMin = NaN; % initial min vertical allowable grid spacing (default dzMin/2) [m]
+
 		zY    = NaN; % strech grid cells bellow top_z by a [top_dz * y ^ (cells bellow top_z)]
-		zMax = NaN; %initial max model depth (default is min(thickness,500)) [m]
-		zMin = NaN; %initial min model depth (default is min(thickness,30)) [m]
+		zMax = NaN; %initial max model depth (default is min(thickness,250)) [m]
+		zMin = NaN; %initial min model depth (default is min(thickness,130)) [m]
 		outputFreq = NaN; %output frequency in days (default is monthly, 30)
 
-		%specific albedo parameters: 
-		%Method 1 and 2: 
+		%specific albedo parameters:
+		%Method 1 and 2:
 		aSnow = NaN; % new snow albedo (0.64 - 0.89)
 		aIce  = NaN; % range 0.27-0.58 for old snow
-		%Method 3: Radiation Correction Factors -> only used for met station data and Greuell & Konzelmann, 1994 albedo
+			     %Method 3: Radiation Correction Factors -> only used for met station data and Greuell & Konzelmann, 1994 albedo
 		cldFrac = NaN; % average cloud amount
-		%Method 4: additonal tuning parameters albedo as a funtion of age and water content (Bougamont et al., 2005)
-		t0wet = NaN; % time scale for wet snow (15-21.9) 
-		t0dry = NaN; % warm snow timescale (30) 
-		K     = NaN; % time scale temperature coef. (7) 
+			       %Method 4: additonal tuning parameters albedo as a funtion of age and water content (Bougamont et al., 2005)
+		t0wet = NaN; % time scale for wet snow (15-21.9)
+		t0dry = NaN; % warm snow timescale (30)
+		K     = NaN; % time scale temperature coef. (7)
 		adThresh = NaN; %Apply aIdx method to all areas with densities below this value,
 		                %or else apply direct input value from aValue, allowing albedo to be altered.
-							 %Default value is rho water (1023 kg m-3).
+				%Default value is rho water (1023 kg m-3).
 
 		%densities:
@@ -99,10 +109,11 @@
 		%thermal:
 		ThermoDeltaTScaling= NaN; %scaling factor to multiply the thermal diffusion timestep (delta t)
-		
+
+		steps_per_step = 1;
 		requested_outputs      = {};
 
-		%Several fields are missing from the standard GEMB model, which are capture intrinsically by ISSM. 
-		%dateN: that's the last row of the above fields. 
-		%dt:    included in dateN. Not an input.  
+		%Several fields are missing from the standard GEMB model, which are capture intrinsically by ISSM.
+		%dateN: that's the last row of the above fields.
+		%dt:    included in dateN. Not an input.
 		%elev:  this is taken from the ISSM surface itself.
 
@@ -112,6 +123,6 @@
 			switch nargin
 				case 2
-					mesh=varargin{1}; 
-					geometry=varargin{2}; 
+					mesh=varargin{1};
+					geometry=varargin{2};
 					self=setdefaultparameters(self,mesh,geometry);
 				otherwise
@@ -143,51 +154,55 @@
 		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.aIdx = 1;
-		self.swIdx = 1;
-		self.denIdx = 2;
-		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.zMax=250*ones(mesh.numberofelements,1);
-		self.zMin=130*ones(mesh.numberofelements,1);
-		self.zY = 1.10*ones(mesh.numberofelements,1);
-		self.outputFreq = 30;
-		
-		%additional albedo parameters
-		self.aSnow = 0.85;
-		self.aIce = 0.48;
-		self.cldFrac = 0.1; 
-		self.t0wet = 15;
-		self.t0dry = 30;
-		self.K = 7;
-		self.adThresh = 1023;
-
-		self.teValue = ones(mesh.numberofelements,1);
-		self.aValue = self.aSnow*ones(mesh.numberofelements,1);
-        
-		self.Dzini=0.05*ones(mesh.numberofelements,2);
-		self.Dini=910.0*ones(mesh.numberofelements,2); 
-		self.Reini=2.5*ones(mesh.numberofelements,2);
-		self.Gdnini=0.0*ones(mesh.numberofelements,2);
-		self.Gspini=0.0*ones(mesh.numberofelements,2);
-		self.ECini=0.0*ones(mesh.numberofelements,1);
-		self.Wini=0.0*ones(mesh.numberofelements,2);
-		self.Aini=self.aSnow*ones(mesh.numberofelements,2); 
-		self.Tini=273.15*ones(mesh.numberofelements,2); 
-% 		/!\ Default value of Tini must be equal to Tmean but don't know Tmean yet (computed when atmospheric forcings are interpolated on mesh). 
-% 		If initialization without restart, this value will be overwritten when snow parameters are retrieved in Element.cpp 
-		self.Sizeini=2*ones(mesh.numberofelements,1);
+			self.isgraingrowth=1;
+			self.isalbedo=1;
+			self.isshortwave=1;
+			self.isthermal=1;
+			self.isaccumulation=1;
+			self.ismelt=1;
+			self.isdensification=1;
+			self.isturbulentflux=1;
+			self.isclimatology=0;
+
+			self.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.10*ones(mesh.numberofelements,1);
+			self.outputFreq = 30;
+
+			%additional albedo parameters
+			self.aSnow = 0.85;
+			self.aIce = 0.48;
+			self.cldFrac = 0.1;
+			self.t0wet = 15;
+			self.t0dry = 30;
+			self.K = 7;
+			self.adThresh = 1023;
+
+			self.teValue = ones(mesh.numberofelements,1);
+			self.aValue = self.aSnow*ones(mesh.numberofelements,1);
+
+			self.Dzini=0.05*ones(mesh.numberofelements,2);
+			self.Dini=910.0*ones(mesh.numberofelements,2);
+			self.Reini=2.5*ones(mesh.numberofelements,2);
+			self.Gdnini=0.0*ones(mesh.numberofelements,2);
+			self.Gspini=0.0*ones(mesh.numberofelements,2);
+			self.ECini=0.0*ones(mesh.numberofelements,1);
+			self.Wini=0.0*ones(mesh.numberofelements,2);
+			self.Aini=self.aSnow*ones(mesh.numberofelements,2);
+			self.Tini=273.15*ones(mesh.numberofelements,2);
+			% 		/!\ Default value of Tini must be equal to Tmean but don't know Tmean yet (computed when atmospheric forcings are interpolated on mesh).
+			% 		If initialization without restart, this value will be overwritten when snow parameters are retrieved in Element.cpp
+			self.Sizeini=2*ones(mesh.numberofelements,1);
 
 		end % }}}
@@ -202,16 +217,33 @@
 			md = checkfield(md,'fieldname','smb.isdensification','values',[0 1]);
 			md = checkfield(md,'fieldname','smb.isturbulentflux','values',[0 1]);
+			md = checkfield(md,'fieldname','smb.isclimatology','values',[0 1]);
 
 			md = checkfield(md,'fieldname','smb.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); %max 500 km/h
-			md = checkfield(md,'fieldname','smb.dswrf','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1400);
-			md = checkfield(md,'fieldname','smb.dlwrf','timeseries',1,'NaN',1,'Inf',1,'>=',0);
-			md = checkfield(md,'fieldname','smb.P','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',100);
-			md = checkfield(md,'fieldname','smb.eAir','timeseries',1,'NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','smb.V','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<',45,'size',size(self.Ta)); %max 500 km/h
+			md = checkfield(md,'fieldname','smb.dswrf','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1400,'size',size(self.Ta));
+			md = checkfield(md,'fieldname','smb.dlwrf','timeseries',1,'NaN',1,'Inf',1,'>=',0,'size',size(self.Ta));
+			md = checkfield(md,'fieldname','smb.P','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',100,'size',size(self.Ta));
+			md = checkfield(md,'fieldname','smb.eAir','timeseries',1,'NaN',1,'Inf',1,'size',size(self.Ta));
+
+			if (self.isclimatology)
+				md = checkfield(md,'fieldname', 'smb.Ta', 'size',[md.mesh.numberofelements+1],...
+						'message',['Ta must have md.mesh.numberofelements+1 rows in order to force a climatology']);
+				md = checkfield(md,'fieldname', 'smb.V', 'size',[md.mesh.numberofelements+1],...
+						'message',['V must have md.mesh.numberofelements+1 rows in order to force a climatology']);
+				md = checkfield(md,'fieldname', 'smb.dswrf', 'size',[md.mesh.numberofelements+1],...
+						'message',['dswrf must have md.mesh.numberofelements+1 rows in order to force a climatology']);
+				md = checkfield(md,'fieldname', 'smb.dlwrf', 'size',[md.mesh.numberofelements+1],...
+						'message',['dlwrf must have md.mesh.numberofelements+1 rows in order to force a climatology']);
+				md = checkfield(md,'fieldname', 'smb.P', 'size',[md.mesh.numberofelements+1],...
+						'message',['P must have md.mesh.numberofelements+1 rows in order to force a climatology']);
+				md = checkfield(md,'fieldname', 'smb.eAir', 'size',[md.mesh.numberofelements+1],...
+						'message',['eAir must have md.mesh.numberofelements+1 rows in order to force a climatology']);
+			end
 
 			md = checkfield(md,'fieldname','smb.Tmean','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>',273-100,'<',273+100); %-100/100 celsius min/max value
-			md = checkfield(md,'fieldname','smb.C','size',[md.mesh.numberofelements 1],'NaN',1,'Inf',1,'>=',0); 
-			md = checkfield(md,'fieldname','smb.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.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);
@@ -220,4 +252,5 @@
 			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);
@@ -225,5 +258,5 @@
 			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.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);
@@ -249,11 +282,12 @@
 				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.requested_outputs','stringrow',1);
 
 		end % }}}
 		function disp(self) % {{{
-			
+
 			disp(sprintf('   surface forcings for SMB GEMB model :'));
-			
+
 			fielddisplay(self,'isgraingrowth','run grain growth module (default true)');
 			fielddisplay(self,'isalbedo','run albedo module (default true)');
@@ -264,6 +298,7 @@
 			fielddisplay(self,'isdensification','run densification module (default true)');
 			fielddisplay(self,'isturbulentflux','run turbulant heat fluxes module (default true)');
+			fielddisplay(self,'isclimatology','repeat all forcings when past last forcing time (default false)');
 			fielddisplay(self,'Ta','2 m air temperature, in Kelvin');
-			fielddisplay(self,'V','wind speed (m/s-1)');
+			fielddisplay(self,'V','wind speed (m s-1)');
 			fielddisplay(self,'dlwrf','downward shortwave radiation flux [W/m^2]');
 			fielddisplay(self,'dswrf','downward longwave radiation flux [W/m^2]');
@@ -273,6 +308,7 @@
 			fielddisplay(self,'Tmean','mean annual temperature [K]');
 			fielddisplay(self,'C','mean annual snow accumulation [kg m-2 yr-1]');
+			fielddisplay(self,'Vmean','mean annual wind speed [m s-1] (default 10 m/s)');
 			fielddisplay(self,'Tz','height above ground at which temperature (T) was sampled [m]');
-			fielddisplay(self,'Vz','height above ground at which wind (V) eas sampled [m]');
+			fielddisplay(self,'Vz','height above ground at which wind (V) was sampled [m]');
 			fielddisplay(self,'zTop','depth over which grid length is constant at the top of the snopack (default 10) [m]');
 			fielddisplay(self,'dzTop','initial top vertical grid spacing (default .05) [m] ');
@@ -286,12 +322,12 @@
 			fielddisplay(self,'adThresh',{'Apply aIdx method to all areas with densities below this value,','or else apply direct input value from aValue, allowing albedo to be altered.'});
 			fielddisplay(self,'aIdx',{'method for calculating albedo and subsurface absorption (default is 1)',...
-				'0: direct input from aValue parameter',...
-				'1: effective grain radius [Gardner & Sharp, 2009]',...
-				'2: effective grain radius [Brun et al., 2009]',...
-				'3: density and cloud amount [Greuell & Konzelmann, 1994]',...
-				'4: exponential time decay & wetness [Bougamont & Bamber, 2005]'})
+					    '0: direct input from aValue parameter',...
+					    '1: effective grain radius [Gardner & Sharp, 2009]',...
+					    '2: effective grain radius [Brun et al., 2009]',...
+					    '3: density and cloud amount [Greuell & Konzelmann, 1994]',...
+					    '4: exponential time decay & wetness [Bougamont & Bamber, 2005]'})
 
 			fielddisplay(self,'teValue','Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)');
-                                
+
 			%snow properties init
 			fielddisplay(self,'Dzini','Initial cell depth when restart [m]');
@@ -305,33 +341,41 @@
 			fielddisplay(self,'Tini','Initial snow temperature when restart [K]');
 			fielddisplay(self,'Sizeini','Initial number of layers when restart [K]');
-            
-            
-			%additional albedo parameters: 
+
+
+			%additional albedo parameters:
 			switch self.aIdx
-			case {0 5}
-				fielddisplay(self,'aValue','Albedo forcing at every element.  Used only if aIdx == {0,5}.');
-			case {1 2}
-				fielddisplay(self,'aSnow','new snow albedo (0.64 - 0.89)');
-				fielddisplay(self,'aIce','albedo of ice (0.27-0.58)');
-			case 3
-				fielddisplay(self,'cldFrac','average cloud amount');
-			case 4
-				fielddisplay(self,'t0wet','time scale for wet snow (15-21.9) [d]');
-				fielddisplay(self,'t0dry','warm snow timescale (30) [d]');
-				fielddisplay(self,'K','time scale temperature coef. (7) [d]');
+				case {0 5}
+					fielddisplay(self,'aValue','Albedo forcing at every element.  Used only if aIdx == {0,5}.');
+				case {1 2}
+					fielddisplay(self,'aSnow','new snow albedo (0.64 - 0.89)');
+					fielddisplay(self,'aIce','albedo of ice (0.27-0.58)');
+				case 3
+					fielddisplay(self,'cldFrac','average cloud amount');
+				case 4
+					fielddisplay(self,'t0wet','time scale for wet snow (15-21.9) [d]');
+					fielddisplay(self,'t0dry','warm snow timescale (30) [d]');
+					fielddisplay(self,'K','time scale temperature coef. (7) [d]');
 			end
 
 			fielddisplay(self,'swIdx','apply all SW to top grid cell (0) or allow SW to penetrate surface (1) [default 1]');
 			fielddisplay(self,'denIdx',{'densification model to use (default is 2):',...
-									'1 = emperical model of Herron and Langway (1980)',...
-									'2 = semi-emperical model of Anthern et al. (2010)',...
-									'3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)',...
-									'4 = DO NOT USE: emperical model of Li and Zwally (2004)',...
-									'5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)',...
-									'6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)',...
-									'7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)'});
+					    '1 = emperical model of Herron and Langway (1980)',...
+					    '2 = semi-emperical model of Anthern et al. (2010)',...
+					    '3 = DO NOT USE: physical model from Appendix B of Anthern et al. (2010)',...
+					    '4 = DO NOT USE: emperical model of Li and Zwally (2004)',...
+					    '5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)',...
+					    '6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)',...
+					    '7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)'});
+			fielddisplay(self,'dsnowIdx',{'model for fresh snow accumulation density (default is 1):',...
+					    '0 = Original GEMB value, 150 kg/m^3',...
+					    '1 = Antarctica value of fresh snow density, 350 kg/m^3',...
+					    '2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2008)',...
+					    '3 = Antarctica model of Kaspers et al. (2004), Make sure to set Vmean accurately',...
+					    '4 = Greenland model of Kuipers Munneke et al. (2015)'});
+
+			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
 			fielddisplay(self,'requested_outputs','additional outputs requested');
-									
-			
+
+
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
@@ -340,5 +384,5 @@
 
 			WriteData(fid,prefix,'name','md.smb.model','data',8,'format','Integer');
-			
+
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isgraingrowth','format','Boolean');
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isalbedo','format','Boolean');
@@ -349,5 +393,6 @@
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isdensification','format','Boolean');
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isturbulentflux','format','Boolean');
-            
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isclimatology','format','Boolean');
+
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Ta','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','V','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
@@ -356,8 +401,9 @@
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','P','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','eAir','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','pAir','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);         
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','pAir','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
 
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tmean','format','DoubleMat','mattype',2);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','C','format','DoubleMat','mattype',2);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Vmean','format','DoubleMat','mattype',2);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tz','format','DoubleMat','mattype',2);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Vz','format','DoubleMat','mattype',2);
@@ -368,8 +414,9 @@
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','zMax','format','DoubleMat','mattype',2);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','zMin','format','DoubleMat','mattype',2);
-		
+
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','aIdx','format','Integer');
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','swIdx','format','Integer');
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','denIdx','format','Integer');
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dsnowIdx','format','Integer');
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','InitDensityScaling','format','Double');
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','ThermoDeltaTScaling','format','Double');
@@ -385,5 +432,5 @@
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','aValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','teValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-            
+
 			%snow properties init
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Dzini','format','DoubleMat','mattype',3);
@@ -397,17 +444,17 @@
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tini','format','DoubleMat','mattype',3);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Sizeini','format','IntMat','mattype',2);
-
-			%figure out dt from forcings: 
+			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
+			%figure out dt from forcings:
 			time=self.Ta(end,:); %assume all forcings are on the same time step
 			dtime=diff(time,1);
 			dt=min(dtime);
-            
+
 			WriteData(fid,prefix,'data',dt,'name','md.smb.dt','format','Double','scale',yts);
 
 			% Check if smb_dt goes evenly into transient core time step
 			if (mod(md.timestepping.time_step,dt) >= 1e-10)
-                error('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);
-			end
-			
+				error('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);
+			end
+
 			%process requested outputs
 			outputs = self.requested_outputs;
Index: /issm/trunk/src/m/classes/SMBgemb.py
===================================================================
--- /issm/trunk/src/m/classes/SMBgemb.py	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBgemb.py	(revision 24313)
@@ -5,412 +5,423 @@
 from project3d import project3d
 
+
 class SMBgemb(object):
-	"""
-	SMBgemb Class definition
-
-	   Usage:
-	      SMB = SMBgemb()
-	"""
-
-	def __init__(self): # {{{
-		#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:
-		#isgraingrowth
-		#isalbedo
-		#isshortwave
-		#isthermal
-		#isaccumulation
-		#ismelt
-		#isdensification
-		#isturbulentflux    
-
-		#inputs: 
-		Ta    = float('NaN')	#2 m air temperature, in Kelvin
-		V     = float('NaN')	#wind speed (m/s-1)
-		dswrf = float('NaN')	#downward shortwave radiation flux [W/m^2]
-		dlwrf = float('NaN')	#downward longwave radiation flux [W/m^2]
-		P     = float('NaN')	#precipitation [mm w.e. / m^2]
-		eAir  = float('NaN')	#screen level vapor pressure [Pa]
-		pAir  = float('NaN')	#surface pressure [Pa]
-		
-		Tmean = float('NaN')	#mean annual temperature [K]
-		C     = float('NaN')	#mean annual snow accumulation [kg m-2 yr-1]
-		Tz    = float('NaN')	#height above ground at which temperature (T) was sampled [m]
-		Vz    = float('NaN')	#height above ground at which wind (V) eas sampled [m]
-
-		#optional inputs:
-		aValue  = float('NaN') #Albedo forcing at every element.  Used only if aIdx == 0.
-		teValue = float('NaN') #Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)
-        
-		# Initialization of snow properties
-		Dzini = float('NaN')	#cell depth (m)
-		Dini = float('NaN')	#snow density (kg m-3)
-		Reini = float('NaN')	#effective grain size (mm)
-		Gdnini = float('NaN')	#grain dricity (0-1)
-		Gspini = float('NaN')	#grain sphericity (0-1)
-		ECini = float('NaN')	#evaporation/condensation (kg m-2)
-		Wini = float('NaN')	#Water content (kg m-2)
-		Aini = float('NaN')	#albedo (0-1)
-		Tini = float('NaN')	#snow temperature (K)
-		Sizeini = float('NaN')	#Number of layers
-
-		#settings: 
-		aIdx   = float('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., 2009]
-					  # 3: density and cloud amount [Greuell & Konzelmann, 1994]
-					  # 4: exponential time decay & wetness [Bougamont & Bamber, 2005]
-					  # 5: ingest MODIS mode, direct input from aValue parameter applied to surface ice only
-
-		swIdx  = float('NaN')	# apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1)
-
-		denIdx = float('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 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)
-
-		zTop  = float('NaN')	# depth over which grid length is constant at the top of the snopack (default 10) [m]
-		dzTop = float('NaN')	# initial top vertical grid spacing (default .05) [m] 
-		dzMin = float('NaN')	# initial min vertical allowable grid spacing (default dzMin/2) [m] 
-		zY    = float('NaN')	# strech grid cells bellow top_z by a [top_dz * y ^ (cells bellow top_z)]
-		zMax = float('NaN')	#initial max model depth (default is min(thickness,500)) [m]
-		zMin = float('NaN')	#initial min model depth (default is min(thickness,30)) [m]
-		outputFreq = float('NaN')	#output frequency in days (default is monthly, 30)
-
-		#specific albedo parameters: 
-		#Method 1 and 2: 
-		aSnow = float('NaN')	# new snow albedo (0.64 - 0.89)
-		aIce  = float('NaN')	# range 0.27-0.58 for old snow
-			#Method 3: Radiation Correction Factors -> only used for met station data and Greuell & Konzelmann, 1994 albedo
-		cldFrac = float('NaN')	# average cloud amount
-			#Method 4: additonal tuning parameters albedo as a funtion of age and water content (Bougamont et al., 2005)
-		t0wet = float('NaN')	# time scale for wet snow (15-21.9) 
-		t0dry = float('NaN')	# warm snow timescale (30) 
-		K     = float('NaN')	# time scale temperature coef. (7) 
-		adThresh = float('NaN') # Apply aIdx method to all areas with densities below this value,
-		                        # or else apply direct input value from aValue, allowing albedo to be altered.
-										# Default value is rho water (1023 kg m-3).
-
-		#densities:
-		InitDensityScaling =  float('NaN')	#initial scaling factor multiplying the density of ice, which describes the density of the snowpack.
-
-		#thermo:
-		ThermoDeltaTScaling = float('NaN') #scaling factor to multiply the thermal diffusion timestep (delta t)
-		
-		requested_outputs      = []
-
-		#Several fields are missing from the standard GEMB model, which are capture intrinsically by ISSM. 
-		#dateN: that's the last row of the above fields. 
-		#dt:    included in dateN. Not an input.  
-		#elev:  this is taken from the ISSM surface itself.
-
-		#}}}
-	def __repr__(self): # {{{
-		#string = "   surface forcings parameters:"
-		#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,'Ta','2 m air temperature, in Kelvin'))
-		string = "%s\n%s"%(string,fielddisplay(self,'V','wind speed (m/s-1)'))
-		string = "%s\n%s"%(string,fielddisplay(self,'dlwrf','downward shortwave radiation flux [W/m^2]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'dswrf','downward longwave radiation flux [W/m^2]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'P','precipitation [mm w.e. / m^2]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'eAir','screen level vapor pressure [Pa]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'pAir','surface pressure [Pa]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'Tmean','mean annual temperature [K]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'C','mean annual snow accumulation [kg m-2 yr-1]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'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., 2009]',
-						'3: density and cloud amount [Greuell & Konzelmann, 1994]',
-						'4: exponential time decay & wetness [Bougamont & Bamber, 2005]']))
-
-		string = "%s\n%s"%(string,fielddisplay(self,'teValue','Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)'))
-                               
-		#snow properties init
-		string = "%s\n%s"%(string,fielddisplay(self,'Dzini','Initial cell depth when restart [m]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'Dini','Initial snow density when restart [kg m-3]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'Reini','Initial grain size when restart [mm]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'Gdnini','Initial grain dricity when restart [-]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'Gspini','Initial grain sphericity when restart [-]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'ECini','Initial evaporation/condensation when restart [kg m-2]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'Wini','Initial snow water content when restart [kg m-2]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'Aini','Initial albedo when restart [-]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'Tini','Initial snow temperature when restart [K]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'Sizeini','Initial number of layers when restart [K]'))
-                        
-		#additional albedo parameters: 
-		if type(self.aIdx) == list or type(self.aIdx) == type(np.array([1,2])) and (self.aIdx == [1,2] or (1 in self.aIdx and 2 in self.aIdx)):
-			string = "%s\n%s"%(string,fielddisplay(self,'aSnow','new snow albedo (0.64 - 0.89)'))
-			string = "%s\n%s"%(string,fielddisplay(self,'aIce','albedo of ice (0.27-0.58)'))
-		elif elf.aIdx == 0:
-			string = "%s\n%s"%(string,fielddisplay(self,'aValue','Albedo forcing at every element.  Used only if aIdx == {0,5}'))
-		elif elf.aIdx == 5:
-			string = "%s\n%s"%(string,fielddisplay(self,'aValue','Albedo forcing at every element.  Used only if aIdx == {0,5}'))
-		elif self.aIdx == 3:
-			string = "%s\n%s"%(string,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]'))
-		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,'requested_outputs','additional outputs requested'))
-		return string
-	#}}}
-
-	def extrude(self,md): # {{{
-
-		self.Ta = project3d(md,'vector',self.Ta,'type','node')
-		self.V = project3d(md,'vector',self.V,'type','node')
-		self.dswrf = project3d(md,'vector',self.dswrf,'type','node')
-		self.dswrf = project3d(md,'vector',self.dswrf,'type','node')
-		self.P = project3d(md,'vector',self.P,'type','node')
-		self.eAir = project3d(md,'vector',self.eAir,'type','node')
-		self.pAir = project3d(md,'vector',self.pAir,'type','node')
-
-		if (aIdx == 0) and np.isnan(self.aValue):
-			self.aValue=project3d(md,'vector',self.aValue,'type','node');
-		if np.isnan(self.teValue):
-			self.teValue=project3d(md,'vector',self.teValue,'type','node');
-
-		return self
-	#}}}
-	def defaultoutputs(self,md): # {{{
-		return ['SmbMassBalance']
-	#}}}
-
-	def 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.aIdx = 1
-		self.swIdx = 1
-		self.denIdx = 2
-		self.zTop = 10*np.ones((mesh.numberofelements,))
-		self.dzTop = .05* np.ones((mesh.numberofelements,))
-		self.dzMin = self.dzTop/2
-		self.InitDensityScaling = 1.0
-		self.ThermoDeltaTScaling = 1/11.0
-		
-		self.zMax = 250*np.ones((mesh.numberofelements,))
-		self.zMin = 130*np.ones((mesh.numberofelements,))
-		self.zY = 1.10*np.ones((mesh.numberofelements,))
-		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 = np.ones((mesh.numberofelements,));
-		self.aValue = self.aSnow*np.ones(mesh.numberofelements,);
-        
-		self.Dzini = 0.05*np.ones((mesh.numberofelements,2))
-		self.Dini = 910.0*np.ones((mesh.numberofelements,2)) 
-		self.Reini = 2.5*np.ones((mesh.numberofelements,2))
-		self.Gdnini = 0.0*np.ones((mesh.numberofelements,2))
-		self.Gspini = 0.0*np.ones((mesh.numberofelements,2))
-		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.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 
-		self.Sizeini = 2*np.ones((mesh.numberofelements,))
-	#}}}
-
-	def 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.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) #max 500 km/h
-		md = checkfield(md,'fieldname','smb.dswrf','timeseries',1,'NaN',1,'Inf',1,'> = ',0,'< = ',1400)
-		md = checkfield(md,'fieldname','smb.dlwrf','timeseries',1,'NaN',1,'Inf',1,'> = ',0)
-		md = checkfield(md,'fieldname','smb.P','timeseries',1,'NaN',1,'Inf',1,'> = ',0,'< = ',100)
-		md = checkfield(md,'fieldname','smb.eAir','timeseries',1,'NaN',1,'Inf',1)
-
-		md = checkfield(md,'fieldname','smb.Tmean','size',[md.mesh.numberofelements],'NaN',1,'Inf',1,'>',273-100,'<',273+100) #-100/100 celsius min/max value
-		md = checkfield(md,'fieldname','smb.C','size',[md.mesh.numberofelements],'NaN',1,'Inf',1,'> = ',0) 
-		md = checkfield(md,'fieldname','smb.Tz','size',[md.mesh.numberofelements],'NaN',1,'Inf',1,'> = ',0,'< = ',5000) 
-		md = checkfield(md,'fieldname','smb.Vz','size',[md.mesh.numberofelements],'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.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)
-
-		if type(self.aIdx) == list or type(self.aIdx) == type(np.array([1,2])) and (self.aIdx == [1,2] or (1 in self.aIdx and 2 in self.aIdx)):
-			md = checkfield(md,'fieldname','smb.aSnow','NaN',1,'Inf',1,'> = ',.64,'< = ',.89)
-			md = checkfield(md,'fieldname','smb.aIce','NaN',1,'Inf',1,'> = ',.27,'< = ',.58)
-		elif self.aIdx == 0:
-			md = checkfield(md,'fieldname','smb.aValue','timeseries',1,'NaN',1,'Inf',1,'>=',0,'<=',1);
-		elif self.aIdx == 3:
-			md = checkfield(md,'fieldname','smb.cldFrac','NaN',1,'Inf',1,'> = ',0,'< = ',1)
-		elif self.aIdx == 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)
-			
-
-		#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):
-			error('SMBgemb consistency check error: zTop should be smaller than local ice thickness')
-		
-		md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1)
-		return md
-	# }}}
-
-	def marshall(self,prefix,md,fid):    # {{{
-
-		yts = md.constants.yts
-
-		WriteData(fid,prefix,'name','md.smb.model','data',8,'format','Integer')
-			
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','isgraingrowth','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','isalbedo','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','isshortwave','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','isthermal','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','isaccumulation','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','ismelt','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','isdensification','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','isturbulentflux','format','Boolean')
-            
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Ta','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','V','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','dswrf','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','dlwrf','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','P','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','eAir','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','pAir','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)         
-
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tmean','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','C','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tz','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Vz','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','zTop','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','dzTop','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','dzMin','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','zY','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','zMax','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','zMin','format','DoubleMat','mattype',2)
-		
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','aIdx','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','swIdx','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','denIdx','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','InitDensityScaling','format','Double')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','ThermoDeltaTScaling','format','Double')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','outputFreq','format','Double')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','aSnow','format','Double')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','aIce','format','Double')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','cldFrac','format','Double')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','t0wet','format','Double')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','t0dry','format','Double')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','K','format','Double')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','adThresh','format','Double');
-
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','aValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','teValue','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
-            
-		#snow properties init
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Dzini','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Dini','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Reini','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Gdnini','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Gspini','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','ECini','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Wini','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Aini','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tini','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','Sizeini','format','IntMat','mattype',2)
-
-		#figure out dt from forcings: 
-		time = self.Ta[-1] #assume all forcings are on the same time step
-		dtime = np.diff(time,n=1,axis=0)
-		dt = min(dtime) / yts
-            
-		WriteData(fid,prefix,'data',dt,'name','md.smb.dt','format','Double','scale',yts)
-
-		# Check if smb_dt goes evenly into transient core time step
-		if (md.timestepping.time_step % dt >=  1e-10):
-	                error('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
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		
-		WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray')
-	# }}}
-
+    """
+    SMBgemb Class definition
+
+       Usage:
+          SMB = SMBgemb()
+    """
+
+    def __init__(self):  # {{{
+        #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:
+        #isgraingrowth
+        #isalbedo
+        #isshortwave
+        #isthermal
+        #isaccumulation
+        #ismelt
+        #isdensification
+        #isturbulentflux
+
+        #inputs:
+        self.Ta = float('NaN')       #2 m air temperature, in Kelvin
+        self.V = float('NaN')        #wind speed (m/s-1)
+        self.dswrf = float('NaN')    #downward shortwave radiation flux [W/m^2]
+        self.dlwrf = float('NaN')    #downward longwave radiation flux [W/m^2]
+        self.P = float('NaN')        #precipitation [mm w.e. / m^2]
+        self.eAir = float('NaN')     #screen level vapor pressure [Pa]
+        self.pAir = float('NaN')     #surface pressure [Pa]
+        self.Tmean = float('NaN')    #mean annual temperature [K]
+        self.Vmean = float('NaN')    #mean annual wind velocity [m s-1]
+        self.C = float('NaN')        #mean annual snow accumulation [kg m-2 yr-1]
+        self.Tz = float('NaN')       #height above ground at which temperature (T) was sampled [m]
+        self.Vz = float('NaN')       #height above ground at which wind (V) eas sampled [m]
+
+        #optional inputs:
+        self.aValue = float('NaN')  #Albedo forcing at every element.  Used only if aIdx == 0.
+        self.teValue = float('NaN')  #Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)
+
+        # Initialization of snow properties
+        self.Dzini = float('NaN')    #cell depth (m)
+        self.Dini = float('NaN')     #snow density (kg m-3)
+        self.Reini = float('NaN')    #effective grain size (mm)
+        self.Gdnini = float('NaN')   #grain dricity (0-1)
+        self.Gspini = float('NaN')   #grain sphericity (0-1)
+        self.ECini = float('NaN')    #evaporation/condensation (kg m-2)
+        self.Wini = float('NaN')     #Water content (kg m-2)
+        self.Aini = float('NaN')     #albedo (0-1)
+        self.Tini = float('NaN')     #snow temperature (K)
+        self.Sizeini = float('NaN')  #Number of layers
+
+        #settings:
+        self.aIdx = float('NaN')     #method for calculating albedo and subsurface absorption (default is 1)
+        self.swIdx = float('NaN')    # apply all SW to top grid cell (0) or allow SW to penetrate surface (1) (default 1)
+        self.denIdx = float('NaN')   #densification model to use (default is 2):
+        self.dsnowIdx = float('NaN')  #model for fresh snow accumulation density (default is 1):
+        self.zTop = float('NaN')     # depth over which grid length is constant at the top of the snopack (default 10) [m]
+        self.dzTop = float('NaN')    # initial top vertical grid spacing (default .05) [m]
+        self.dzMin = float('NaN')    # initial min vertical allowable grid spacing (default dzMin/2) [m]
+        self.zY = float('NaN')       # strech grid cells bellow top_z by a [top_dz * y ^ (cells bellow top_z)]
+        self.zMax = float('NaN')     #initial max model depth (default is min(thickness, 500)) [m]
+        self.zMin = float('NaN')     #initial min model depth (default is min(thickness, 30)) [m]
+        self.outputFreq = float('NaN')       #output frequency in days (default is monthly, 30)
+
+        #specific albedo parameters:
+        #Method 1 and 2:
+        self.aSnow = float('NaN')    # new snow albedo (0.64 - 0.89)
+        self.aIce = float('NaN')     # range 0.27-0.58 for old snow
+        #Method 3: Radiation Correction Factors -> only used for met station data and Greuell & Konzelmann, 1994 albedo
+        self.cldFrac = float('NaN')  # average cloud amount
+        #Method 4: additonal tuning parameters albedo as a funtion of age and water content (Bougamont et al., 2005)
+        self.t0wet = float('NaN')    # time scale for wet snow (15-21.9)
+        self.t0dry = float('NaN')    # warm snow timescale (30)
+        self.K = float('NaN')        # time scale temperature coef. (7)
+        self.adThresh = float('NaN')  # Apply aIdx method to all areas with densities below this value,
+        # or else apply direct input value from aValue, allowing albedo to be altered.
+        # Default value is rho water (1023 kg m-3).
+
+        #densities:
+        self.InitDensityScaling = float('NaN')       #initial scaling factor multiplying the density of ice, which describes the density of the snowpack.
+
+        #thermo:
+        self.ThermoDeltaTScaling = float('NaN')  #scaling factor to multiply the thermal diffusion timestep (delta t)
+
+        self.steps_per_step = 1
+        self.requested_outputs = []
+
+        #Several fields are missing from the standard GEMB model, which are capture intrinsically by ISSM.
+        #dateN: that's the last row of the above fields.
+        #dt:    included in dateN. Not an input.
+        #elev:  this is taken from the ISSM surface itself.
+
+        #}}}
+
+
+    def __repr__(self):  # {{{
+        #string = "   surface forcings parameters:"
+        #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, 'isclimatology', 'repeat all forcings when past last forcing time (default false)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'Ta', '2 m air temperature, in Kelvin'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'V', 'wind speed (m s-1)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'dlwrf', 'downward shortwave radiation flux [W/m^2]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'dswrf', 'downward longwave radiation flux [W/m^2]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'P', 'precipitation [mm w.e. / m^2]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'eAir', 'screen level vapor pressure [Pa]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'pAir', 'surface pressure [Pa]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'Tmean', 'mean annual temperature [K]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'C', 'mean annual snow accumulation [kg m-2 yr-1]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'Vmean', 'mean annual temperature [m s-1] (default 10 m/s)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'Tz', 'height above ground at which temperature (T) was sampled [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'Vz', 'height above ground at which wind (V) eas sampled [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'zTop', 'depth over which grid length is constant at the top of the snopack (default 10) [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'dzTop', 'initial top vertical grid spacing (default .05) [m] '))
+        string = "%s\n%s" % (string, fielddisplay(self, 'dzMin', 'initial min vertical allowable grid spacing (default dzMin/2) [m] '))
+        string = "%s\n%s" % (string, fielddisplay(self, 'zMax', 'initial max model depth (default is min(thickness, 500)) [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'zMin', 'initial min model depth (default is min(thickness, 30)) [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'zY', 'strech grid cells bellow top_z by a [top_dz * y ^ (cells bellow top_z)]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'InitDensityScaling', ['initial scaling factor multiplying the density of ice', 'which describes the density of the snowpack.']))
+        string = "%s\n%s" % (string, fielddisplay(self, 'ThermoDeltaTScaling', 'scaling factor to multiply the thermal diffusion timestep (delta t)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'outputFreq', 'output frequency in days (default is monthly, 30)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'adThresh', 'Apply aIdx method to all areas with densities below this value, ', 'or else apply direct input value from aValue, allowing albedo to be altered.'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'aIdx', ['method for calculating albedo and subsurface absorption (default is 1)',
+                                                                 '0: direct input from aValue parameter',
+                                                                 '1: effective grain radius [Gardner & Sharp, 2009]',
+                                                                 '2: effective grain radius [Brun et al., 2009]',
+                                                                 '3: density and cloud amount [Greuell & Konzelmann, 1994]',
+                                                                 '4: exponential time decay & wetness [Bougamont & Bamber, 2005]']))
+        string = "%s\n%s" % (string, fielddisplay(self, 'teValue', 'Outward longwave radiation thermal emissivity forcing at every element (default in code is 1)'))
+        #snow properties init
+        string = "%s\n%s" % (string, fielddisplay(self, 'Dzini', 'Initial cell depth when restart [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'Dini', 'Initial snow density when restart [kg m-3]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'Reini', 'Initial grain size when restart [mm]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'Gdnini', 'Initial grain dricity when restart [-]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'Gspini', 'Initial grain sphericity when restart [-]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'ECini', 'Initial evaporation/condensation when restart [kg m-2]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'Wini', 'Initial snow water content when restart [kg m-2]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'Aini', 'Initial albedo when restart [-]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'Tini', 'Initial snow temperature when restart [K]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'Sizeini', 'Initial number of layers when restart [K]'))
+
+        #additional albedo parameters:
+        if isinstance(self.aIdx, (list, type(np.array([1, 2])))) and (self.aIdx == [1, 2] or (1 in self.aIdx and 2 in self.aIdx)):
+            string = "%s\n%s" % (string, fielddisplay(self, 'aSnow', 'new snow albedo (0.64 - 0.89)'))
+            string = "%s\n%s" % (string, fielddisplay(self, 'aIce', 'albedo of ice (0.27-0.58)'))
+        elif self.aIdx == 0:
+            string = "%s\n%s" % (string, fielddisplay(self, 'aValue', 'Albedo forcing at every element.  Used only if aIdx == {0, 5}'))
+        elif self.aIdx == 5:
+            string = "%s\n%s" % (string, fielddisplay(self, 'aValue', 'Albedo forcing at every element.  Used only if aIdx == {0, 5}'))
+        elif self.aIdx == 3:
+            string = "%s\n%s" % (string, 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]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'denIdx', ['densification model to use (default is 2):',
+                                                                   '1 = emperical model of Herron and Langway (1980)',
+                                                                   '2 = semi-emperical model of Anthern et al. (2010)',
+                                                                   '3 = DO NOT USE: physical model from Appix B of Anthern et al. (2010)',
+                                                                   '4 = DO NOT USE: emperical model of Li and Zwally (2004)',
+                                                                   '5 = DO NOT USE: modified emperical model (4) by Helsen et al. (2008)',
+                                                                   '6 = Antarctica semi-emperical model of Ligtenberg et al. (2011)',
+                                                                   '7 = Greenland semi-emperical model of Kuipers Munneke et al. (2015)']))
+        string = "%s\n%s" % (string, fielddisplay(self, 'dsnowIdx', ['model for fresh snow accumulation density (default is 1):',
+                                                                     '0 = Original GEMB value, 150 kg/m^3',
+                                                                     '1 = Antarctica value of fresh snow density, 350 kg/m^3',
+                                                                     '2 = Greenland value of fresh snow density, 315 kg/m^3, Fausto et al. (2008)',
+                                                                     '3 = Antarctica model of Kaspers et al. (2004), Make sure to set Vmean accurately',
+                                                                     '4 = Greenland model of Kuipers Munneke et al. (2015)']))
+        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+        return string
+    #}}}
+
+    def extrude(self, md):  # {{{
+        self.Ta = project3d(md, 'vector', self.Ta, 'type', 'node')
+        self.V = project3d(md, 'vector', self.V, 'type', 'node')
+        self.dswrf = project3d(md, 'vector', self.dswrf, 'type', 'node')
+        self.dswrf = project3d(md, 'vector', self.dswrf, 'type', 'node')
+        self.P = project3d(md, 'vector', self.P, 'type', 'node')
+        self.eAir = project3d(md, 'vector', self.eAir, 'type', 'node')
+        self.pAir = project3d(md, 'vector', self.pAir, 'type', 'node')
+
+        if (self.aIdx == 0) and np.isnan(self.aValue):
+            self.aValue = project3d(md, 'vector', self.aValue, 'type', 'node')
+        if np.isnan(self.teValue):
+            self.teValue = project3d(md, 'vector', self.teValue, 'type', 'node')
+
+        return self
+    #}}}
+
+    def defaultoutputs(self, md):  # {{{
+        return ['SmbMassBalance']
+    #}}}
+
+    def setdefaultparameters(self, mesh, geometry):  # {{{
+        self.isgraingrowth = 1
+        self.isalbedo = 1
+        self.isshortwave = 1
+        self.isthermal = 1
+        self.isaccumulation = 1
+        self.ismelt = 1
+        self.isdensification = 1
+        self.isturbulentflux = 1
+        self.isclimatology = 0
+
+        self.aIdx = 1
+        self.swIdx = 1
+        self.denIdx = 2
+        self.dsnowIdx = 1
+        self.zTop = 10 * np.ones((mesh.numberofelements,))
+        self.dzTop = .05 * np.ones((mesh.numberofelements,))
+        self.dzMin = self.dzTop / 2
+        self.InitDensityScaling = 1.0
+        self.ThermoDeltaTScaling = 1 / 11.0
+
+        self.Vmean = 10 * np.ones((mesh.numberofelements,))
+
+        self.zMax = 250 * np.ones((mesh.numberofelements,))
+        self.zMin = 130 * np.ones((mesh.numberofelements,))
+        self.zY = 1.10 * np.ones((mesh.numberofelements,))
+        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 = np.ones((mesh.numberofelements,))
+        self.aValue = self.aSnow * np.ones(mesh.numberofelements,)
+
+        self.Dzini = 0.05 * np.ones((mesh.numberofelements, 2))
+        self.Dini = 910.0 * np.ones((mesh.numberofelements, 2))
+        self.Reini = 2.5 * np.ones((mesh.numberofelements, 2))
+        self.Gdnini = 0.0 * np.ones((mesh.numberofelements, 2))
+        self.Gspini = 0.0 * np.ones((mesh.numberofelements, 2))
+        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.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
+        self.Sizeini = 2 * np.ones((mesh.numberofelements,))
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):    # {{{
+
+        md = checkfield(md, 'fieldname', 'smb.isgraingrowth', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'smb.isalbedo', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'smb.isshortwave', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'smb.isthermal', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'smb.isaccumulation', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'smb.ismelt', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'smb.isdensification', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'smb.isturbulentflux', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'smb.isclimatology', 'values', [0, 1])
+
+        md = checkfield(md, 'fieldname', 'smb.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', np.shape(self.Ta))  #max 500 km/h
+        md = checkfield(md, 'fieldname', 'smb.dswrf', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 1400, 'size', np.shape(self.Ta))
+        md = checkfield(md, 'fieldname', 'smb.dlwrf', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '> = ', 0, 'size', np.shape(self.Ta))
+        md = checkfield(md, 'fieldname', 'smb.P', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 100, 'size', np.shape(self.Ta))
+        md = checkfield(md, 'fieldname', 'smb.eAir', 'timeseries', 1, 'NaN', 1, 'Inf', 1, 'size', np.shape(self.Ta))
+
+        if (self.isclimatology > 0):
+            md = checkfield(md, 'fieldname', 'smb.Ta', 'size', [md.mesh.numberofelements + 1], 'message', 'Ta must have md.mesh.numberofelements+1 rows in order to force a climatology')
+            md = checkfield(md, 'fieldname', 'smb.V', 'size', [md.mesh.numberofelements + 1], 'message', 'V must have md.mesh.numberofelements+1 rows in order to force a climatology')
+            md = checkfield(md, 'fieldname', 'smb.dswrf', 'size', [md.mesh.numberofelements + 1], 'message', 'dswrf must have md.mesh.numberofelements+1 rows in order to force a climatology')
+            md = checkfield(md, 'fieldname', 'smb.dlwrf', 'size', [md.mesh.numberofelements + 1], 'message', 'dlwrf must have md.mesh.numberofelements+1 rows in order to force a climatology')
+            md = checkfield(md, 'fieldname', 'smb.P', 'size', [md.mesh.numberofelements + 1], 'message', 'P must have md.mesh.numberofelements+1 rows in order to force a climatology')
+            md = checkfield(md, 'fieldname', 'smb.eAir', 'size', [md.mesh.numberofelements + 1], 'message', 'eAir must have md.mesh.numberofelements+1 rows in order to force a climatology')
+
+        md = checkfield(md, 'fieldname', 'smb.Tmean', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '>', 273 - 100, '<', 273 + 100)  #-100/100 celsius min/max value
+        md = checkfield(md, 'fieldname', 'smb.C', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> = ', 0)
+        md = checkfield(md, 'fieldname', 'smb.Vmean', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> = ', 0)
+        md = checkfield(md, 'fieldname', 'smb.Tz', 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 5000)
+        md = checkfield(md, 'fieldname', 'smb.Vz', 'size', [md.mesh.numberofelements], '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)
+
+        if isinstance(self.aIdx, (list, type(np.array([1, 2])))) and (self.aIdx == [1, 2] or (1 in self.aIdx and 2 in self.aIdx)):
+            md = checkfield(md, 'fieldname', 'smb.aSnow', 'NaN', 1, 'Inf', 1, '> = ', .64, '< = ', .89)
+            md = checkfield(md, 'fieldname', 'smb.aIce', 'NaN', 1, 'Inf', 1, '> = ', .27, '< = ', .58)
+        elif self.aIdx == 0:
+            md = checkfield(md, 'fieldname', 'smb.aValue', 'timeseries', 1, 'NaN', 1, 'Inf', 1, '>=', 0, '<=', 1)
+        elif self.aIdx == 3:
+            md = checkfield(md, 'fieldname', 'smb.cldFrac', 'NaN', 1, 'Inf', 1, '> = ', 0, '< = ', 1)
+        elif self.aIdx == 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)
+
+        #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):
+            raise IOError('SMBgemb consistency check error: zTop should be smaller than local ice thickness')
+        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):    # {{{
+
+        yts = md.constants.yts
+
+        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 8, 'format', 'Integer')
+
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isgraingrowth', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isalbedo', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isshortwave', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isthermal', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isaccumulation', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ismelt', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isdensification', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isturbulentflux', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isclimatology', 'format', 'Boolean')
+
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Ta', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'V', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dswrf', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dlwrf', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'P', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'eAir', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'pAir', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Tmean', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'C', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Vmean', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Tz', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Vz', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'zTop', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dzTop', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dzMin', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'zY', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'zMax', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'zMin', 'format', 'DoubleMat', 'mattype', 2)
+
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'aIdx', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'swIdx', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'denIdx', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'dsnowIdx', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'InitDensityScaling', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ThermoDeltaTScaling', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'outputFreq', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'aSnow', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'aIce', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'cldFrac', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 't0wet', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 't0dry', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'K', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'adThresh', 'format', 'Double')
+
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'aValue', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'teValue', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+
+        #snow properties init
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Dzini', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Dini', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Reini', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Gdnini', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Gspini', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ECini', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Wini', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Aini', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Tini', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Sizeini', 'format', 'IntMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
+        #figure out dt from forcings:
+        time = self.Ta[-1]  #assume all forcings are on the same time step
+        dtime = np.diff(time, n=1, axis=0)
+        dt = min(dtime) / yts
+
+        WriteData(fid, prefix, 'data', dt, 'name', 'md.smb.dt', 'format', 'Double', 'scale', yts)
+
+        # 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
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
+    # }}}
Index: /issm/trunk/src/m/classes/SMBgradients.m
===================================================================
--- /issm/trunk/src/m/classes/SMBgradients.m	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBgradients.m	(revision 24313)
@@ -5,10 +5,11 @@
 
 classdef SMBgradients
-	properties (SetAccess=public) 
-		href   = NaN;
-		smbref = NaN;
-		b_pos  = NaN;
-		b_neg  = NaN;
-		requested_outputs      = {};
+	properties (SetAccess=public)
+		href              = NaN;
+		smbref            = NaN;
+		b_pos             = NaN;
+		b_neg             = NaN;
+		steps_per_step    = 1;
+		requested_outputs = {};
 	end
 	methods
@@ -47,4 +48,5 @@
 				md = checkfield(md,'fieldname','smb.b_neg','timeseries',1,'NaN',1,'Inf',1);
 			end
+			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
 		end % }}}
@@ -57,4 +59,5 @@
 			fielddisplay(self,'b_pos',' slope of hs - smb regression line for accumulation regime required if smb gradients is activated');
 			fielddisplay(self,'b_neg',' slope of hs - smb regression line for ablation regime required if smb gradients is activated');
+			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
 			fielddisplay(self,'requested_outputs','additional outputs requested');
 
@@ -68,6 +71,8 @@
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_pos','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_neg','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_neg','format','DoubleMat','mattype',1,'scale',1./yts, ...
+				  'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
+
 			%process requested outputs
 			outputs = self.requested_outputs;
Index: /issm/trunk/src/m/classes/SMBgradients.py
===================================================================
--- /issm/trunk/src/m/classes/SMBgradients.py	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBgradients.py	(revision 24313)
@@ -2,75 +2,80 @@
 from checkfield import checkfield
 from WriteData import WriteData
-from project3d import project3d
+
 
 class SMBgradients(object):
-	"""
-	SMBgradients Class definition
+    """
+    SMBgradients Class definition
 
-	   Usage:
-	      SMBgradients=SMBgradients();
-	"""
+       Usage:
+          SMBgradients = SMBgradients();
+    """
 
-	def __init__(self): # {{{
-		self.href    = float('NaN')
-		self.smbref  = float('NaN')
-		self.b_pos   = float('NaN')
-		self.b_neg   = float('NaN')
-		self.requested_outputs      = []
-		#}}}
-	def __repr__(self): # {{{
-		string="   surface forcings parameters:"
+    def __init__(self):  # {{{
+        self.href = float('NaN')
+        self.smbref = float('NaN')
+        self.b_pos = float('NaN')
+        self.b_neg = float('NaN')
+        self.steps_per_step = 1
+        self.requested_outputs = []
+    #}}}
 
-		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,'href',' reference elevation from which deviation is used to calculate SMB adjustment in smb gradients method'))
-		string="%s\n%s"%(string,fielddisplay(self,'smbref',' reference smb from which deviation is calculated in smb gradients method'))
-		string="%s\n%s"%(string,fielddisplay(self,'b_pos',' slope of hs - smb regression line for accumulation regime required if smb gradients is activated'))
-		string="%s\n%s"%(string,fielddisplay(self,'b_neg',' slope of hs - smb regression line for ablation regime required if smb gradients is activated'))
-		string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested'))
+    def __repr__(self):  # {{{
+        string = "   surface forcings parameters:"
 
-		return string
-		#}}}
-	def extrude(self,md): # {{{
+        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, 'href', ' reference elevation from which deviation is used to calculate SMB adjustment in smb gradients method'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'smbref', ' reference smb from which deviation is calculated in smb gradients method'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'b_pos', ' slope of hs - smb regression line for accumulation regime required if smb gradients is activated'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'b_neg', ' slope of hs - smb regression line for ablation regime required if smb gradients is activated'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
 
-		#Nothing for now
-		return self
-	#}}}
-	def defaultoutputs(self,md): # {{{
-		return []
-	#}}}
-	def initialize(self,md): # {{{
+        return string
+    #}}}
 
-		#Nothing for now
+    def extrude(self, md):  # {{{
+        #Nothing for now
+        return self
+    #}}}
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+    def defaultoutputs(self, md):  # {{{
+        return []
+    #}}}
 
-		if 'MasstransportAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.href','timeseries',1,'NaN',1,'Inf',1)
-			md = checkfield(md,'fieldname','smb.smbref','timeseries',1,'NaN',1,'Inf',1)
-			md = checkfield(md,'fieldname','smb.b_pos','timeseries',1,'NaN',1,'Inf',1)
-			md = checkfield(md,'fieldname','smb.b_neg','timeseries',1,'NaN',1,'Inf',1)
+    def initialize(self, md):  # {{{
+        #Nothing for now
+        return self
+    #}}}
 
-		md = checkfield(md,'fieldname','masstransport.requested_outputs','stringrow',1)
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+    def checkconsistency(self, md, solution, analyses):    # {{{
+        if 'MasstransportAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'smb.href', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.smbref', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.b_pos', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.b_neg', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
 
-		yts=md.constants.yts
+        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
+        return md
+    # }}}
 
-		WriteData(fid,prefix,'name','md.smb.model','data',6,'format','Integer');
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','href','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_pos','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_neg','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray')
+    def marshall(self, prefix, md, fid):    # {{{
+        yts = md.constants.yts
 
-	# }}}
+        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 6, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'href', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'smbref', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'b_pos', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'b_neg', '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')
+
+        #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
+
+    # }}}
Index: /issm/trunk/src/m/classes/SMBgradientscomponents.m
===================================================================
--- /issm/trunk/src/m/classes/SMBgradientscomponents.m	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBgradientscomponents.m	(revision 24313)
@@ -6,10 +6,12 @@
 classdef SMBgradientscomponents
 	properties (SetAccess=public)
-		accuref					  = NaN;
-		accualti				  = NaN;
-		accugrad				  = NaN;
-		runoffref				  = NaN;
-		runoffalti			  = NaN;
-		runoffgrad			  = NaN;
+
+		accuref           = NaN;
+		accualti          = NaN;
+		accugrad          = NaN;
+		runoffref         = NaN;
+		runoffalti        = NaN;
+		runoffgrad        = NaN;
+		steps_per_step    = 1;
 		requested_outputs = {};
 	end
@@ -51,4 +53,5 @@
 				md = checkfield(md,'fieldname','smb.runoffgrad','numel',1,'NaN',1,'Inf',1);
 			end
+			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
 			md = checkfield(md,'fieldname','masstransport.requested_outputs','stringrow',1);
 		end % }}}
@@ -63,4 +66,5 @@
 			fielddisplay(self,'runoffalti',' Altitude at which the runoff is equal to the reference value');
 			fielddisplay(self,'runoffgrad',' Gradient of the variation of the runoff (0 for uniform runoff) m w.e. m-1 y-1 (lpase rate times ddf)');
+			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
 			fielddisplay(self,'requested_outputs','additional outputs requested');
 
@@ -75,5 +79,7 @@
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','runoffalti','format','Double');
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','runoffgrad', ...
-								'format','Double','scale',1./md.constants.yts);
+				  'format','Double','scale',1./md.constants.yts);
+			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
+
 
 			%process requested outputs
Index: /issm/trunk/src/m/classes/SMBgradientscomponents.py
===================================================================
--- /issm/trunk/src/m/classes/SMBgradientscomponents.py	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBgradientscomponents.py	(revision 24313)
@@ -2,77 +2,89 @@
 from checkfield import checkfield
 from WriteData import WriteData
-from project3d import project3d
+
 
 class SMBgradientscomponents(object):
-	"""
-	SMBgradients Class definition
+    """
+    SMBgradients Class definition
 
-	   Usage:
-	      SMBgradients=SMBgradientscomponents();
-	For now it has accumulation, runoff ans retention which could be aither refreezing and/or evaporation
-	"""
+       Usage:
+          SMBgradients = SMBgradientscomponents();
+    For now it has accumulation, runoff ans retention which could be aither refreezing and/or evaporation
+    """
 
-	def __init__(self): # {{{
-		self.accuref					 = float('NaN')
-		self.accualti					 = float('NaN')
-		self.accugrad					 = float('NaN')
-		self.runoffref				 = float('NaN')
-		self.runoffalti				 = float('NaN')
-		self.runoffgrad				 = float('NaN')
-		self.requested_outputs = ['default']
-		#}}}
-	def __repr__(self): # {{{
-		string="   surface forcings parameters:"
-		string="%s\n%s"%(string,fielddisplay(self,'accuref',' reference value of the accumulation'))
-		string="%s\n%s"%(string,fielddisplay(self,'accualti',' Altitude at which the accumulation is equal to the reference value'))
-		string="%s\n%s"%(string,fielddisplay(self,'accugrad',' Gradient of the variation of the accumulation (0 for uniform accumulation)'))
-		string="%s\n%s"%(string,fielddisplay(self,'runoffref',' reference value of the runoff m w.e. y-1 (temperature times ddf)'))
-		string="%s\n%s"%(string,fielddisplay(self,'runoffalti',' Altitude at which the runoff is equal to the reference value'))
-		string="%s\n%s"%(string,fielddisplay(self,'runoffgrad',' Gradient of the variation of the runoff (0 for uniform runoff) m w.e. m-1 y-1 (lpase rate times ddf)'))
-		string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested'))
+    def __init__(self):  # {{{
+        self.accuref = float('NaN')
+        self.accualti = float('NaN')
+        self.accugrad = float('NaN')
+        self.runoffref = float('NaN')
+        self.runoffalti = float('NaN')
+        self.runoffgrad = float('NaN')
+        self.steps_per_step = 1
+        self.requested_outputs = ['default']
+    #}}}
 
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		#Nothing for now
-		return self
-	#}}}
-	def defaultoutputs(self,md): # {{{
-		return ['SmbMassBalance','SmbRunoff']
-	#}}}
-	def initialize(self,md): # {{{
-		#Nothing for now
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		if 'MasstransportAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.accuref','singletimeseries',1,'NaN',1,'Inf',1)
-			md = checkfield(md,'fieldname','smb.accualti','numel',[1],'NaN',1,'Inf',1)
-			md = checkfield(md,'fieldname','smb.accugrad','numel',[1],'NaN',1,'Inf',1)
-			md = checkfield(md,'fieldname','smb.runoffref','singletimeseries',1,'NaN',1,'Inf',1)
-			md = checkfield(md,'fieldname','smb.runoffalti','numel',[1],'NaN',1,'Inf',1)
-			md = checkfield(md,'fieldname','smb.runoffgrad','numel',[1],'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','masstransport.requested_outputs','stringrow',1)
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+    def __repr__(self):  # {{{
+        string = "   surface forcings parameters:"
+        string = "%s\n%s" % (string, fielddisplay(self, 'accuref', ' reference value of the accumulation'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'accualti', ' Altitude at which the accumulation is equal to the reference value'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'accugrad', ' Gradient of the variation of the accumulation (0 for uniform accumulation)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'runoffref', ' reference value of the runoff m w.e. y-1 (temperature times ddf)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'runoffalti', ' Altitude at which the runoff is equal to the reference value'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'runoffgrad', ' Gradient of the variation of the runoff (0 for uniform runoff) m w.e. m-1 y-1 (lapse rate times ddf)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
 
-		yts=md.constants.yts
+        return string
+    #}}}
 
-		WriteData(fid,prefix,'name','md.smb.model','data',11,'format','Integer')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','accuref','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts,'scale',1./md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','accualti','format','Double')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','accugrad','format','Double','scale',1./md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','runoffref','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts,'scale',1./md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','runoffalti','format','Double')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','runoffgrad','format','Double','scale',1./md.constants.yts)
+    def extrude(self, md):  # {{{
+        #Nothing for now
+        return self
+    #}}}
 
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray')
+    def defaultoutputs(self, md):  # {{{
+        list = ['SmbMassBalance', 'SmbRunoff']
+        if self.steps_per_step > 1:
+            list.extend(['SmbMassBalanceSubstep', 'SmbRunoffSubstep'])
+        return list
+    #}}}
 
-	# }}}
+    def initialize(self, md):  # {{{
+        #Nothing for now
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if 'MasstransportAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'smb.accuref', 'singletimeseries', 1, 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.accualti', 'numel', [1], 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.accugrad', 'numel', [1], 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.runoffref', 'singletimeseries', 1, 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.runoffalti', 'numel', [1], 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.runoffgrad', 'numel', [1], 'NaN', 1, 'Inf', 1)
+
+        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):    # {{{
+        yts = md.constants.yts
+        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 11, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'accuref', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', yts, 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'accualti', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'accugrad', 'format', 'Double', 'scale', 1. / md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'runoffref', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', yts, 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'runoffalti', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'runoffgrad', 'format', 'Double', 'scale', 1. / md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
+
+        #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
+
+    # }}}
Index: /issm/trunk/src/m/classes/SMBgradientsela.m
===================================================================
--- /issm/trunk/src/m/classes/SMBgradientsela.m	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBgradientsela.m	(revision 24313)
@@ -5,11 +5,12 @@
 
 classdef SMBgradientsela
-	properties (SetAccess=public) 
-		ela    = NaN;
-		b_pos  = NaN;
-		b_neg  = NaN;
-		b_max  = NaN;
-		b_min  = NaN;
-		requested_outputs      = {};
+	properties (SetAccess=public)
+		ela               = NaN;
+		b_pos             = NaN;
+		b_neg             = NaN;
+		b_max             = NaN;
+		b_min             = NaN;
+		steps_per_step    = 1;
+		requested_outputs = {};
 	end
 	methods
@@ -24,5 +25,5 @@
 		function self = extrude(self,md) % {{{
 
-			%Nothing for now
+		%Nothing for now
 
 		end % }}}
@@ -32,5 +33,5 @@
 		function self = initialize(self,md) % {{{
 
-			%Nothing done for now
+		%Nothing done for now
 
 		end % }}}
@@ -50,4 +51,5 @@
 				md = checkfield(md,'fieldname','smb.b_min','timeseries',1,'NaN',1,'Inf',1);
 			end
+			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
 		end % }}}
@@ -61,4 +63,5 @@
 			fielddisplay(self,'b_max',' upper cap on smb rate, default: 9999 (no cap) [m ice eq./yr] ');
 			fielddisplay(self,'b_min',' lower cap on smb rate, default: -9999 (no cap) [m ice eq./yr]');
+			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
 			fielddisplay(self,'requested_outputs','additional outputs requested');
 
@@ -73,6 +76,8 @@
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_neg','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_max','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_min','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_min','format','DoubleMat','mattype',1,'scale',1./yts, ...
+				  'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
+
 			%process requested outputs
 			outputs = self.requested_outputs;
Index: /issm/trunk/src/m/classes/SMBgradientsela.py
===================================================================
--- /issm/trunk/src/m/classes/SMBgradientsela.py	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBgradientsela.py	(revision 24313)
@@ -2,85 +2,90 @@
 from checkfield import checkfield
 from WriteData import WriteData
-from project3d import project3d
+
 
 class SMBgradientsela(object):
-	"""
-	SMBgradientsela Class definition
+    """
+    SMBgradientsela Class definition
 
-	   Usage:
-	      SMBgradientsela=SMBgradientsela()
-	"""
+       Usage:
+          SMBgradientsela = SMBgradientsela()
+    """
 
-	def __init__(self): # {{{
-		self.ela     = float('NaN')
-		self.b_pos   = float('NaN')
-		self.b_neg   = float('NaN')
-		self.b_max   = float('NaN')
-		self.b_min   = float('NaN')
-		self.requested_outputs      = []
-		self.setdefaultparameters()
-		#}}}
-	def __repr__(self): # {{{
-		string = "   surface forcings parameters:"
-		string+= '\n   SMB gradients ela parameters:'
+    def __init__(self):  # {{{
+        self.ela = float('NaN')
+        self.b_pos = float('NaN')
+        self.b_neg = float('NaN')
+        self.b_max = float('NaN')
+        self.b_min = float('NaN')
+        self.steps_per_step = 1
+        self.requested_outputs = []
+        self.setdefaultparameters()
+    #}}}
 
-		string="%s\n%s"%(string,fielddisplay(self,'ela',' equilibrium line altitude from which deviation is used to calculate smb using the smb gradients ela method [m a.s.l.]'))
-		string="%s\n%s"%(string,fielddisplay(self,'b_pos',' vertical smb gradient (dB/dz) above ela'))
-		string="%s\n%s"%(string,fielddisplay(self,'b_neg',' vertical smb gradient (dB/dz) below ela'))
-		string="%s\n%s"%(string,fielddisplay(self,'b_max',' upper cap on smb rate, default: 9999 (no cap) [m ice eq./yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'b_min',' lower cap on smb rate, default: -9999 (no cap) [m ice eq./yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested'))
+    def __repr__(self):  # {{{
+        string = "   surface forcings parameters:"
+        string += '\n   SMB gradients ela parameters:'
 
-		return string
-		#}}}
-	def extrude(self,md): # {{{
+        string = "%s\n%s" % (string, fielddisplay(self, 'ela', ' equilibrium line altitude from which deviation is used to calculate smb using the smb gradients ela method [m a.s.l.]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'b_pos', ' vertical smb gradient (dB/dz) above ela'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'b_neg', ' vertical smb gradient (dB/dz) below ela'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'b_max', ' upper cap on smb rate, default: 9999 (no cap) [m ice eq./yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'b_min', ' lower cap on smb rate, default: -9999 (no cap) [m ice eq./yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+        return string
+    #}}}
 
-		#Nothing for now
-		return self
-	#}}}
-	def defaultoutputs(self,md): # {{{
-		return []
-	#}}}
-	def initialize(self,md): # {{{
+    def extrude(self, md):  # {{{
+        #Nothing for now
+        return self
+    #}}}
 
-		#Nothing for now
+    def defaultoutputs(self, md):  # {{{
+        return []
+    #}}}
 
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
-		self.b_max=9999.
-		self.b_min=-9999.
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+    def initialize(self, md):  # {{{
+        #Nothing for now
+        return self
+    #}}}
 
-		if 'MasstransportAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.ela','timeseries',1,'NaN',1,'Inf',1)
-			md = checkfield(md,'fieldname','smb.b_pos','timeseries',1,'NaN',1,'Inf',1)
-			md = checkfield(md,'fieldname','smb.b_neg','timeseries',1,'NaN',1,'Inf',1)
-			md = checkfield(md,'fieldname','smb.b_max','timeseries',1,'NaN',1,'Inf',1)
-			md = checkfield(md,'fieldname','smb.b_min','timeseries',1,'NaN',1,'Inf',1)
+    def setdefaultparameters(self):  # {{{
+        self.b_max = 9999.
+        self.b_min = -9999.
+        return self
+    #}}}
 
-		md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1)
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+    def checkconsistency(self, md, solution, analyses):    # {{{
+        if 'MasstransportAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'smb.ela', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.b_pos', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.b_neg', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.b_max', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'smb.b_min', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
 
-		yts=md.constants.yts
+        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
+        return md
+    # }}}
+    def marshall(self, prefix, md, fid):    # {{{
 
-		WriteData(fid,prefix,'name','md.smb.model','data',9,'format','Integer');
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','ela','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_pos','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_neg','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_max','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_min','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray')
+        yts = md.constants.yts
 
-	# }}}
+        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 9, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ela', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'b_pos', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'b_neg', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'b_max', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'b_min', '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')
+
+        #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
+
+    # }}}
Index: /issm/trunk/src/m/classes/SMBhenning.m
===================================================================
--- /issm/trunk/src/m/classes/SMBhenning.m	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBhenning.m	(revision 24313)
@@ -5,6 +5,7 @@
 
 classdef SMBhenning
-	properties (SetAccess=public) 
+	properties (SetAccess=public)
 		smbref = NaN;
+		steps_per_step=1;
 		requested_outputs      = {};
 	end
@@ -16,11 +17,11 @@
 					inputstruct=varargin{1};
 					list1 = properties('SMBhenning');
-					list2 = fieldnames(inputstruct);
-					for i=1:length(list1)
-						fieldname = list1{i};
-						if ismember(fieldname,list2),
-							self.(fieldname) = inputstruct.(fieldname);
+						list2 = fieldnames(inputstruct);
+						for i=1:length(list1)
+							fieldname = list1{i};
+							if ismember(fieldname,list2),
+								self.(fieldname) = inputstruct.(fieldname);
+							end
 						end
-					end
 				otherwise
 					error('constructor not supported');
@@ -51,4 +52,5 @@
 				md = checkfield(md,'fieldname','smb.smbref','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
 			end
+			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
 		end % }}}
@@ -56,4 +58,5 @@
 			disp(sprintf('   surface forcings parameters:'));
 			fielddisplay(self,'smbref','reference smb from which deviation is calculated [m/yr ice eq]');
+			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
 			fielddisplay(self,'requested_outputs','additional outputs requested');
 		end % }}}
@@ -64,5 +67,6 @@
 			WriteData(fid,prefix,'name','md.smb.model','data',7,'format','Integer');
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			
+			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
+
 			%process requested outputs
 			outputs = self.requested_outputs;
Index: /issm/trunk/src/m/classes/SMBmeltcomponents.m
===================================================================
--- /issm/trunk/src/m/classes/SMBmeltcomponents.m	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBmeltcomponents.m	(revision 24313)
@@ -5,9 +5,11 @@
 
 classdef SMBmeltcomponents
-	properties (SetAccess=public) 
+	properties (SetAccess=public)
+		isclimatology = 0;
 		accumulation = NaN;
 		evaporation = NaN;
 		melt = NaN;
 		refreeze = NaN;
+		steps_per_step=1;
 		requested_outputs      = {};
 	end
@@ -55,27 +57,27 @@
 			if ismember('MasstransportAnalysis',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);
 			end
 			if ismember('BalancethicknessAnalysis',analyses),
 				md = checkfield(md,'fieldname','smb.accumulation','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			end
-			if ismember('MasstransportAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.evaporation','timeseries',1,'NaN',1,'Inf',1);
-			end
-			if ismember('BalancethicknessAnalysis',analyses),
 				md = checkfield(md,'fieldname','smb.evaporation','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			end
-			if ismember('MasstransportAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.refreeze','timeseries',1,'NaN',1,'Inf',1);
-			end
-			if ismember('BalancethicknessAnalysis',analyses),
 				md = checkfield(md,'fieldname','smb.refreeze','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
-			end
-			if ismember('MasstransportAnalysis',analyses),
-				md = checkfield(md,'fieldname','smb.melt','timeseries',1,'NaN',1,'Inf',1);
-			end
-			if ismember('BalancethicknessAnalysis',analyses),
 				md = checkfield(md,'fieldname','smb.melt','size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
 			end
+			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
+			md = checkfield(md,'fieldname','smb.isclimatology','values',[0 1]);
+			if (self.isclimatology)
+				md = checkfield(md,'fieldname', 'smb.accumulation', 'size',[md.mesh.numberofvertices+1],...
+						'message',['accumulation must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
+				md = checkfield(md,'fieldname', 'smb.melt', 'size',[md.mesh.numberofvertices+1],...
+						'message',['melt must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
+				md = checkfield(md,'fieldname', 'smb.refreeze', 'size',[md.mesh.numberofvertices+1],...
+						'message',['refreeze must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
+				md = checkfield(md,'fieldname', 'smb.evaporation', 'size',[md.mesh.numberofvertices+1],...
+						'message',['evaporation must have md.mesh.numberofvertices+1 rows in order to force a climatology']);
+			end
 		end % }}}
 		function disp(self) % {{{
@@ -85,4 +87,6 @@
 			fielddisplay(self,'melt','amount of ice melt in ice column [m/yr ice eq]');
 			fielddisplay(self,'refreeze','amount of ice melt refrozen in ice column [m/yr ice eq]');
+			fielddisplay(self,'isclimatology','repeat all forcings when past last forcing time (default false)');
+			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
 			fielddisplay(self,'requested_outputs','additional outputs requested');
 		end % }}}
@@ -96,5 +100,6 @@
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','melt','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','refreeze','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			
+			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
+
 			%process requested outputs
 			outputs = self.requested_outputs;
@@ -105,4 +110,5 @@
 			end
 			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','isclimatology','format','Boolean');
 
 		end % }}}
Index: /issm/trunk/src/m/classes/SMBmeltcomponents.py
===================================================================
--- /issm/trunk/src/m/classes/SMBmeltcomponents.py	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBmeltcomponents.py	(revision 24313)
@@ -4,104 +4,108 @@
 from WriteData import *
 
+
 class SMBmeltcomponents(object):
-	"""
-	SMBmeltcomponents Class definition
+    """
+    SMBmeltcomponents Class definition
 
-	   Usage:
-	      SMBmeltcomponents=SMBmeltcomponents();
-	"""
+       Usage:
+          SMBmeltcomponents = SMBmeltcomponents();
+    """
 
-	def __init__(self): # {{{
-		self.accumulation = float('NaN')
-		self.runoff = float('NaN')
-		self.evaporation = float('NaN')
-		self.requested_outputs      = []
-		#}}}
-	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,'requested_outputs','additional outputs requested'))
-		return string
-		#}}}
-	def extrude(self,md): # {{{
+    def __init__(self):  # {{{
+        self.accumulation = float('NaN')
+        self.runoff = float('NaN')
+        self.evaporation = float('NaN')
+        self.isclimatology = 0
+        self.steps_per_step = 1
+        self.requested_outputs = []
+    #}}}
 
-		self.accumulation=project3d(md,'vector',self.accumulation,'type','node');
-		self.evaporation=project3d(md,'vector',self.evaporation,'type','node');
-		self.melt=project3d(md,'vector',self.melt,'type','node');
-		self.refreeze=project3d(md,'vector',self.refreeze,'type','node');
-		return self
-	#}}}
-	def defaultoutputs(self,md): # {{{
-		return []
-	#}}}
-	def initialize(self,md): # {{{
+    def __repr__(self):  # {{{
+        string = "   surface forcings parameters with melt (SMB = accumulation-evaporation-melt+refreeze) :"
+        string = "%s\n%s" % (string, fielddisplay(self, 'accumulation', 'accumulated snow [m/yr ice eq]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'evaporation', 'mount of ice lost to evaporative processes [m/yr ice eq]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'melt', 'amount of ice melt in the ice column [m/yr ice eq]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'refreeze', 'amount of ice melt refrozen in the ice column [m/yr ice eq]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isclimatology', 'repeat all forcings when past last forcing time (default false)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+        return string
+    #}}}
 
-		if np.all(np.isnan(self.accumulation)):
-			self.accumulation=np.zeros((md.mesh.numberofvertices))
-			print "      no SMB.accumulation specified: values set as zero"
+    def extrude(self, md):  # {{{
+        self.accumulation = project3d(md, 'vector', self.accumulation, 'type', 'node')
+        self.evaporation = project3d(md, 'vector', self.evaporation, 'type', 'node')
+        self.melt = project3d(md, 'vector', self.melt, 'type', 'node')
+        self.refreeze = project3d(md, 'vector', self.refreeze, 'type', 'node')
+        return self
+    #}}}
 
-		if np.all(np.isnan(self.evaporation)):
-			self.evaporation=np.zeros((md.mesh.numberofvertices))
-			print "      no SMB.evaporation specified: values set as zero"
+    def defaultoutputs(self, md):  # {{{
+        return []
+    #}}}
 
-		if np.all(np.isnan(self.melt)):
-			self.melt=np.zeros((md.mesh.numberofvertices))
-			print "      no SMB.melt specified: values set as zero"
+    def initialize(self, md):  # {{{
+        if np.all(np.isnan(self.accumulation)):
+            self.accumulation = np.zeros((md.mesh.numberofvertices))
+            print("      no SMB.accumulation 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.evaporation)):
+            self.evaporation = np.zeros((md.mesh.numberofvertices))
+            print("      no SMB.evaporation specified: values set as zero")
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+        if np.all(np.isnan(self.melt)):
+            self.melt = np.zeros((md.mesh.numberofvertices))
+            print("      no SMB.melt specified: values set as zero")
 
-		if 'MasstransportAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.accumulation','timeseries',1,'NaN',1,'Inf',1)
+        if np.all(np.isnan(self.refreeze)):
+            self.refreeze = np.zeros((md.mesh.numberofvertices))
+            print("      no SMB.refreeze specified: values set as zero")
 
-		if 'BalancethicknessAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.accumulation','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
+        return self
+    #}}}
 
-		if 'MasstransportAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.melt','timeseries',1,'NaN',1,'Inf',1)
+    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.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.melt','size',[md.mesh.numberofvertices],'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.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)
 
-		if 'MasstransportAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.refreeze','timeseries',1,'NaN',1,'Inf',1)
+        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
+        md = checkfield(md, 'fieldname', 'smb.isclimatology', 'values', [0, 1])
+        return md
+    # }}}
+    def marshall(self, prefix, md, fid):    # {{{
 
-		if 'BalancethicknessAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.refreeze','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
+        yts = md.constants.yts
 
-		if 'MasstransportAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.evaporation','timeseries',1,'NaN',1,'Inf',1)
+        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, 'fieldname', 'steps_per_step', 'format', 'Integer')
 
-		if 'BalancethicknessAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.evaporation','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
+        #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isclimatology', 'format', 'Boolean')
+        if (self.isclimatology > 0):
+            md = checkfield(md, 'fieldname', 'smb.accumulation', 'size', [md.mesh.numberofvertices + 1], 'message', 'accumulation must have md.mesh.numberofvertices+1 rows in order to force a climatology')
+            md = checkfield(md, 'fieldname', 'smb.melt', 'size', [md.mesh.numberofvertices + 1], 'message', 'melt must have md.mesh.numberofvertices+1 rows in order to force a climatology')
+            md = checkfield(md, 'fieldname', 'smb.refreeze', 'size', [md.mesh.numberofvertices + 1], 'message', 'refreeze must have md.mesh.numberofvertices+1 rows in order to force a climatology')
+            md = checkfield(md, 'fieldname', 'smb.evaporation', 'size', [md.mesh.numberofvertices + 1], 'message', 'evaporation must have md.mesh.numberofvertices+1 rows in order to force a climatology')
 
-		md = checkfield(md,'fieldname','masstransport.requested_outputs','stringrow',1)
-		return md
-	# }}}
-	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',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','melt','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','refreeze','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray')
-
-	# }}}
+    # }}}
Index: /issm/trunk/src/m/classes/SMBpdd.m
===================================================================
--- /issm/trunk/src/m/classes/SMBpdd.m	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBpdd.m	(revision 24313)
@@ -5,5 +5,5 @@
 
 classdef SMBpdd
-	properties (SetAccess=public) 
+	properties (SetAccess=public)
 		precipitation             = NaN;
 		monthlytemperatures       = NaN;
@@ -12,5 +12,5 @@
 		s0t                       = NaN;
 		rlaps                     = 0;
-		rlapslgm                  = 0; 
+		rlapslgm                  = 0;
 		Pfac                      = NaN;
 		Tdiff                     = NaN;
@@ -25,5 +25,6 @@
 		precipitations_presentday = NaN;
 		precipitations_lgm        = NaN;
-		requested_outputs      = {};
+		steps_per_step            = 1;
+		requested_outputs         = {};
 	end
 	methods
@@ -55,5 +56,5 @@
 		end % }}}
 		function self = initialize(self,md) % {{{
-                    
+
 			if isnan(self.s0p),
 				self.s0p=zeros(md.mesh.numberofvertices,1);
@@ -73,5 +74,5 @@
 		  self.rlaps      = 6.5;
 		  self.rlapslgm   = 6.5;
-                  
+
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
@@ -86,5 +87,5 @@
 					md = checkfield(md,'fieldname','smb.monthlytemperatures','timeseries',1,'NaN',1,'Inf',1);
 					md = checkfield(md,'fieldname','smb.precipitation','timeseries',1,'NaN',1,'Inf',1);
-				elseif(self.isdelta18o==1) 
+				elseif(self.isdelta18o==1)
 					md = checkfield(md,'fieldname','smb.delta18o','NaN',1,'Inf',1,'size',[2,NaN],'singletimeseries',1);
 					md = checkfield(md,'fieldname','smb.delta18o_surface','NaN',1,'Inf',1,'size',[2,NaN],'singletimeseries',1);
@@ -92,12 +93,12 @@
 					md = checkfield(md,'fieldname','smb.temperatures_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1,'Inf',1,'timeseries',1);
 					md = checkfield(md,'fieldname','smb.precipitations_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1,'Inf',1,'timeseries',1);
-					md = checkfield(md,'fieldname','smb.precipitations_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1,'Inf',1,'timeseries',1);                                       
+					md = checkfield(md,'fieldname','smb.precipitations_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1,'Inf',1,'timeseries',1);
 					md = checkfield(md,'fieldname','smb.Tdiff','NaN',1,'Inf',1,'size',[2,NaN],'singletimeseries',1);
 					md = checkfield(md,'fieldname','smb.sealev','NaN',1,'Inf',1,'size',[2,NaN],'singletimeseries',1);
-				elseif(self.ismungsm==1) 
+				elseif(self.ismungsm==1)
 					md = checkfield(md,'fieldname','smb.temperatures_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1,'Inf',1,'timeseries',1);
 					md = checkfield(md,'fieldname','smb.temperatures_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1,'Inf',1,'timeseries',1);
 					md = checkfield(md,'fieldname','smb.precipitations_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1,'Inf',1,'timeseries',1);
-					md = checkfield(md,'fieldname','smb.precipitations_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1,'Inf',1,'timeseries',1);                                       
+					md = checkfield(md,'fieldname','smb.precipitations_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1,'Inf',1,'timeseries',1);
 					md = checkfield(md,'fieldname','smb.Pfac','NaN',1,'Inf',1,'size',[2,NaN],'singletimeseries',1);
 					md = checkfield(md,'fieldname','smb.Tdiff','NaN',1,'Inf',1,'size',[2,NaN],'singletimeseries',1);
@@ -105,6 +106,7 @@
 				end
 			end
+			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-			
+
 		end % }}}
 		function disp(self) % {{{
@@ -140,4 +142,5 @@
 				fielddisplay(self,'sealev','sea level [m], 1D(year), required if mungsm is activated');
 			end
+			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
 			fielddisplay(self,'requested_outputs','additional outputs requested');
 		end % }}}
@@ -156,5 +159,5 @@
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlaps','format','Double');
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlapslgm','format','Double');
-
+			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
 			if(self.isdelta18o==0 & self.ismungsm==0)
 				%WriteData(fid,prefix,'object',self,'class','smb','fieldname','monthlytemperatures','format','DoubleMat','mattype',1);
@@ -179,5 +182,5 @@
 				WriteData(fid,prefix,'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts);
 			end
-			
+
 			%process requested outputs
 			outputs = self.requested_outputs;
Index: /issm/trunk/src/m/classes/SMBpdd.py
===================================================================
--- /issm/trunk/src/m/classes/SMBpdd.py	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBpdd.py	(revision 24313)
@@ -5,191 +5,205 @@
 from project3d import project3d
 
+
 class SMBpdd(object):
-	"""
-	SMBpdd Class definition
-
-	   Usage:
-	      SMBpdd=SMBpdd();
-	"""
-
-	def __init__(self): # {{{
-		self.precipitation             = float('NaN')
-		self.monthlytemperatures       = float('NaN')
-		self.desfac                    = 0.
-		self.s0p                       = float('NaN')
-		self.s0t                       = float('NaN')
-		self.rlaps                     = 0.
-		self.rlapslgm                  = 0.
-		self.Pfac                      = float('NaN')
-		self.Tdiff                     = float('NaN')
-		self.sealev                    = float('NaN')
-		self.isdelta18o                = 0
-		self.ismungsm                  = 0
-		self.issetpddfac               = 0
-		self.delta18o                  = float('NaN')
-		self.delta18o_surface          = float('NaN')
-		self.temperatures_presentday   = float('NaN')
-		self.temperatures_lgm          = float('NaN')
-		self.precipitations_presentday = float('NaN')
-		self.precipitations_lgm        = float('NaN')
-
-		#set defaults
-		self.setdefaultparameters()
-		self.requested_outputs      = []
-		#}}}
-	def __repr__(self): # {{{
-		string="   surface forcings parameters:"
-
-		string="%s\n%s"%(string,fielddisplay(self,'isdelta18o','is temperature and precipitation delta18o parametrisation activated (0 or 1, default is 0)'))
-		string="%s\n%s"%(string,fielddisplay(self,'ismungsm','is temperature and precipitation mungsm parametrisation activated (0 or 1, default is 0)'))
-		string="%s\n%s"%(string,fielddisplay(self,'desfac','desertification elevation factor (between 0 and 1, default is 0.5) [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'s0p','should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'s0t','should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'rlaps','present day lapse rate [degree/km]'))
-		string="%s\n%s"%(string,fielddisplay(self,'rlapslgm','LGM lapse rate [degree/km]'))
-		if not (self.isdelta18o and self.ismungsm):
-			string="%s\n%s"%(string,fielddisplay(self,'monthlytemperatures',['monthly surface temperatures [K], required if pdd is activated and delta18o not activated']))
-			string="%s\n%s"%(string,fielddisplay(self,'precipitation',['monthly surface precipitation [m/yr water eq], required if pdd is activated and delta18o or mungsm not activated']))
-			if self.isdelta18o:
-				string="%s\n%s"%(string,fielddisplay(self,'delta18o','delta18o [per mil], required if pdd is activated and delta18o activated'))
-				string="%s\n%s"%(string,fielddisplay(self,'delta18o_surface','surface elevation of the delta18o site, required if pdd is activated and delta18o activated'))
-				string="%s\n%s"%(string,fielddisplay(self,'temperatures_presentday','monthly present day surface temperatures [K], required if delta18o/mungsm is activated'))
-				string="%s\n%s"%(string,fielddisplay(self,'temperatures_lgm','monthly LGM surface temperatures [K], required if delta18o or mungsm is activated'))
-				string="%s\n%s"%(string,fielddisplay(self,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'))
-				string="%s\n%s"%(string,fielddisplay(self,'precipitations_lgm','monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'))
-				string="%s\n%s"%(string,fielddisplay(self,'Tdiff','time interpolation parameter for temperature, 1D(year), required if mungsm is activated'))
-				string="%s\n%s"%(string,fielddisplay(self,'sealev','sea level [m], 1D(year), required if mungsm is activated'))
-			if self.ismungsm:
-				string="%s\n%s"%(string,fielddisplay(self,'temperatures_presentday','monthly present day surface temperatures [K], required if delta18o/mungsm is activated'))
-				string="%s\n%s"%(string,fielddisplay(self,'temperatures_lgm','monthly LGM surface temperatures [K], required if delta18o or mungsm is activated'))
-				string="%s\n%s"%(string,fielddisplay(self,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'))
-				string="%s\n%s"%(string,fielddisplay(self,'precipitations_lgm','monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'))
-				string="%s\n%s"%(string,fielddisplay(self,'Pfac','time interpolation parameter for precipitation, 1D(year), required if mungsm is activated'))
-				string="%s\n%s"%(string,fielddisplay(self,'Tdiff','time interpolation parameter for temperature, 1D(year), required if mungsm is activated'))
-				string="%s\n%s"%(string,fielddisplay(self,'sealev','sea level [m], 1D(year), required if mungsm is activated'))
-		string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested'))
-				
-		return string
-	# }}}
-	def extrude(self,md): # {{{
-
-		if not (self.isdelta18o and self.ismungsm):
-			self.precipitation=project3d(md,'vector',self.precipitation,'type','node')
-			self.monthlytemperatures=project3d(md,'vector',self.monthlytemperatures,'type','node')
-		if self.isdelta18o: self.temperatures_lgm=project3d(md,'vector',self.temperatures_lgm,'type','node')
-		if self.isdelta18o: self.temperatures_presentday=project3d(md,'vector',self.temperatures_presentday,'type','node')
-		if self.isdelta18o: self.precipitations_presentday=project3d(md,'vector',self.precipitations_presentday,'type','node')
-		if self.isdelta18o: self.precipitations_lgm=project3d(md,'vector',self.precipitations_lgm,'type','node')
-		if self.ismungsm: self.temperatures_lgm=project3d(md,'vector',self.temperatures_lgm,'type','node')
-		if self.ismungsm: self.temperatures_presentday=project3d(md,'vector',self.temperatures_presentday,'type','node')
-		if self.ismungsm: self.precipitations_presentday=project3d(md,'vector',self.precipitations_presentday,'type','node')
-		if self.ismungsm: self.precipitations_lgm=project3d(md,'vector',self.precipitations_lgm,'type','node')
-		self.s0p=project3d(md,'vector',self.s0p,'type','node')
-		self.s0t=project3d(md,'vector',self.s0t,'type','node')
-
-		return self
-	#}}}
-	def defaultoutputs(self,md): # {{{
-		return []
-	#}}}
-	def initialize(self,md): # {{{
-
-		if np.all(np.isnan(self.s0p)):
-			self.s0p=np.zeros((md.mesh.numberofvertices))
-			print "      no SMBpdd.s0p specified: values set as zero"
-
-		if np.all(np.isnan(self.s0t)):
-			self.s0t=np.zeros((md.mesh.numberofvertices))
-			print "      no SMBpdd.s0t specified: values set as zero"
-
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
-
-		#pdd method not used in default mode
-		self.isdelta18o = 0
-		self.ismungsm   = 0
-		self.desfac     = 0.5
-		self.rlaps      = 6.5 
-		self.rlapslgm   = 6.5
-
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-
-		if 'MasstransportAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.desfac','<=',1,'numel',[1])
-			md = checkfield(md,'fieldname','smb.s0p','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-			md = checkfield(md,'fieldname','smb.s0t','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-			md = checkfield(md,'fieldname','smb.rlaps','>=',0,'numel',[1])
-			md = checkfield(md,'fieldname','smb.rlapslgm','>=',0,'numel',[1])
-
-			if (self.isdelta18o==0 and self.ismungsm==0):
-				md = checkfield(md,'fieldname','smb.monthlytemperatures','NaN',1,'Inf',1,'timeseries',1)
-				md = checkfield(md,'fieldname','smb.precipitation','NaN',1,'Inf',1,'timeseries',1)
-			elif self.isdelta18o:
-				md = checkfield(md,'fieldname','smb.delta18o','NaN',1,'Inf',1,'size',[2,np.nan],'singletimeseries',1)
-				md = checkfield(md,'fieldname','smb.delta18o_surface','NaN',1,'Inf',1,'size',[2,np.nan],'singletimeseries',1)
-				md = checkfield(md,'fieldname','smb.temperatures_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1,'Inf',1,'timeseries',1)
-				md = checkfield(md,'fieldname','smb.temperatures_lgm','size',[md.mesh.numberofvertices+1,12],'NaN',1,'Inf',1,'timeseries',1)
-				md = checkfield(md,'fieldname','smb.precipitations_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1,'Inf',1,'timeseries',1)
-				md = checkfield(md,'fieldname','smb.precipitations_lgm','size',[md.mesh.numberofvertices+1,12],'NaN',1,'Inf',1,'timeseries',1)                                       
-				md = checkfield(md,'fieldname','smb.Tdiff','NaN',1,'Inf',1,'size',[2,np.nan],'singletimeseries',1)
-				md = checkfield(md,'fieldname','smb.sealev','NaN',1,'Inf',1,'size',[2,np.nan],'singletimeseries',1)
-			elif self.ismungsm:
-				md = checkfield(md,'fieldname','smb.temperatures_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1,'Inf',1,'timeseries',1)
-				md = checkfield(md,'fieldname','smb.temperatures_lgm','size',[md.mesh.numberofvertices+1,12],'NaN',1,'Inf',1,'timeseries',1)
-				md = checkfield(md,'fieldname','smb.precipitations_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1,'Inf',1,'timeseries',1)
-				md = checkfield(md,'fieldname','smb.precipitations_lgm','size',[md.mesh.numberofvertices+1,12],'NaN',1,'Inf',1,'timeseries',1)                                       
-				md = checkfield(md,'fieldname','smb.Pfac','NaN',1,'Inf',1,'size',[2,np.nan],'singletimeseries',1)
-				md = checkfield(md,'fieldname','smb.Tdiff','NaN',1,'Inf',1,'size',[2,np.nan],'singletimeseries',1)
-				md = checkfield(md,'fieldname','smb.sealev','NaN',1,'Inf',1,'size',[2,np.nan],'singletimeseries',1)
-
-		md = checkfield(md,'fieldname','masstransport.requested_outputs','stringrow',1)
-		return md
-	#}}}
-	def marshall(self,prefix,md,fid):    # {{{
-
-		yts=md.constants.yts
-
-		WriteData(fid,prefix,'name','md.smb.model','data',4,'format','Integer')
-
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','isdelta18o','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','ismungsm','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','issetpddfac','format','Boolean');
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','desfac','format','Double')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0p','format','DoubleMat','mattype',1);
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0t','format','DoubleMat','mattype',1);
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlaps','format','Double')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlapslgm','format','Double')
-
-		if (self.isdelta18o==0 and self.ismungsm==0):
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		elif self.isdelta18o:
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_lgm','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_lgm','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','delta18o_surface','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','delta18o','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts)			
-		elif self.ismungsm:
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_lgm','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_lgm','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Pfac','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts)
-			
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray')
-
-	# }}}
+    """
+    SMBpdd Class definition
+
+       Usage:
+          SMBpdd = SMBpdd()
+    """
+
+    def __init__(self):  # {{{
+        self.precipitation = float('NaN')
+        self.monthlytemperatures = float('NaN')
+        self.desfac = 0.
+        self.s0p = float('NaN')
+        self.s0t = float('NaN')
+        self.rlaps = 0.
+        self.rlapslgm = 0.
+        self.Pfac = float('NaN')
+        self.Tdiff = float('NaN')
+        self.sealev = float('NaN')
+        self.isdelta18o = 0
+        self.ismungsm = 0
+        self.issetpddfac = 0
+        self.delta18o = float('NaN')
+        self.delta18o_surface = float('NaN')
+        self.temperatures_presentday = float('NaN')
+        self.temperatures_lgm = float('NaN')
+        self.precipitations_presentday = float('NaN')
+        self.precipitations_lgm = float('NaN')
+        self.steps_per_step = 1
+
+    #set defaults
+        self.setdefaultparameters()
+        self.requested_outputs = []
+    #}}}
+
+    def __repr__(self):  # {{{
+        string = "   surface forcings parameters:"
+
+        string = "%s\n%s" % (string, fielddisplay(self, 'isdelta18o', 'is temperature and precipitation delta18o parametrisation activated (0 or 1, default is 0)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'ismungsm', 'is temperature and precipitation mungsm parametrisation activated (0 or 1, default is 0)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'desfac', 'desertification elevation factor (between 0 and 1, default is 0.5) [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 's0p', 'should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 's0t', 'should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'rlaps', 'present day lapse rate [degree/km]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'rlapslgm', 'LGM lapse rate [degree/km]'))
+        if not (self.isdelta18o and self.ismungsm):
+            string = "%s\n%s" % (string, fielddisplay(self, 'monthlytemperatures', 'monthly surface temperatures [K], required if pdd is activated and delta18o not activated'))
+            string = "%s\n%s" % (string, fielddisplay(self, 'precipitation', 'monthly surface precipitation [m/yr water eq], required if pdd is activated and delta18o or mungsm not activated'))
+            if self.isdelta18o:
+                string = "%s\n%s" % (string, fielddisplay(self, 'delta18o', 'delta18o [per mil], required if pdd is activated and delta18o activated'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'delta18o_surface', 'surface elevation of the delta18o site, required if pdd is activated and delta18o activated'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'temperatures_presentday', 'monthly present day surface temperatures [K], required if delta18o/mungsm is activated'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'temperatures_lgm', 'monthly LGM surface temperatures [K], required if delta18o or mungsm is activated'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'precipitations_presentday', 'monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'precipitations_lgm', 'monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'Tdiff', 'time interpolation parameter for temperature, 1D(year), required if mungsm is activated'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'sealev', 'sea level [m], 1D(year), required if mungsm is activated'))
+
+            if self.ismungsm:
+                string = "%s\n%s" % (string, fielddisplay(self, 'temperatures_presentday', 'monthly present day surface temperatures [K], required if delta18o/mungsm is activated'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'temperatures_lgm', 'monthly LGM surface temperatures [K], required if delta18o or mungsm is activated'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'precipitations_presentday', 'monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'precipitations_lgm', 'monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'Pfac', 'time interpolation parameter for precipitation, 1D(year), required if mungsm is activated'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'Tdiff', 'time interpolation parameter for temperature, 1D(year), required if mungsm is activated'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'sealev', 'sea level [m], 1D(year), required if mungsm is activated'))
+
+        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+
+        return string
+    # }}}
+
+    def extrude(self, md):  # {{{
+        if not (self.isdelta18o and self.ismungsm):
+            self.precipitation = project3d(md, 'vector', self.precipitation, 'type', 'node')
+            self.monthlytemperatures = project3d(md, 'vector', self.monthlytemperatures, 'type', 'node')
+
+        if self.isdelta18o:
+            self.temperatures_lgm = project3d(md, 'vector', self.temperatures_lgm, 'type', 'node')
+            self.temperatures_presentday = project3d(md, 'vector', self.temperatures_presentday, 'type', 'node')
+            self.precipitations_presentday = project3d(md, 'vector', self.precipitations_presentday, 'type', 'node')
+            self.precipitations_lgm = project3d(md, 'vector', self.precipitations_lgm, 'type', 'node')
+
+        if self.ismungsm:
+            self.temperatures_lgm = project3d(md, 'vector', self.temperatures_lgm, 'type', 'node')
+            self.temperatures_presentday = project3d(md, 'vector', self.temperatures_presentday, 'type', 'node')
+            self.precipitations_presentday = project3d(md, 'vector', self.precipitations_presentday, 'type', 'node')
+            self.precipitations_lgm = project3d(md, 'vector', self.precipitations_lgm, 'type', 'node')
+
+        self.s0p = project3d(md, 'vector', self.s0p, 'type', 'node')
+        self.s0t = project3d(md, 'vector', self.s0t, 'type', 'node')
+        return self
+    #}}}
+
+    def defaultoutputs(self, md):  # {{{
+        return []
+    #}}}
+
+    def initialize(self, md):  # {{{
+        if np.all(np.isnan(self.s0p)):
+            self.s0p = np.zeros((md.mesh.numberofvertices))
+            print("      no SMBpdd.s0p specified: values set as zero")
+
+        if np.all(np.isnan(self.s0t)):
+            self.s0t = np.zeros((md.mesh.numberofvertices))
+            print("      no SMBpdd.s0t specified: values set as zero")
+
+        return self
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+        #pdd method not used in default mode
+        self.isdelta18o = 0
+        self.ismungsm = 0
+        self.desfac = 0.5
+        self.rlaps = 6.5
+        self.rlapslgm = 6.5
+
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):    # {{{
+
+        if 'MasstransportAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'smb.desfac', '<=', 1, 'numel', [1])
+            md = checkfield(md, 'fieldname', 'smb.s0p', '>=', 0, 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'smb.s0t', '>=', 0, 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'smb.rlaps', '>=', 0, 'numel', [1])
+            md = checkfield(md, 'fieldname', 'smb.rlapslgm', '>=', 0, 'numel', [1])
+
+            if (self.isdelta18o == 0 and self.ismungsm == 0):
+                md = checkfield(md, 'fieldname', 'smb.monthlytemperatures', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+                md = checkfield(md, 'fieldname', 'smb.precipitation', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+            elif self.isdelta18o:
+                md = checkfield(md, 'fieldname', 'smb.delta18o', 'NaN', 1, 'Inf', 1, 'size', [2, np.nan], 'singletimeseries', 1)
+                md = checkfield(md, 'fieldname', 'smb.delta18o_surface', 'NaN', 1, 'Inf', 1, 'size', [2, np.nan], 'singletimeseries', 1)
+                md = checkfield(md, 'fieldname', 'smb.temperatures_presentday', 'size', [md.mesh.numberofvertices + 1, 12], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+                md = checkfield(md, 'fieldname', 'smb.temperatures_lgm', 'size', [md.mesh.numberofvertices + 1, 12], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+                md = checkfield(md, 'fieldname', 'smb.precipitations_presentday', 'size', [md.mesh.numberofvertices + 1, 12], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+                md = checkfield(md, 'fieldname', 'smb.precipitations_lgm', 'size', [md.mesh.numberofvertices + 1, 12], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+                md = checkfield(md, 'fieldname', 'smb.Tdiff', 'NaN', 1, 'Inf', 1, 'size', [2, np.nan], 'singletimeseries', 1)
+                md = checkfield(md, 'fieldname', 'smb.sealev', 'NaN', 1, 'Inf', 1, 'size', [2, np.nan], 'singletimeseries', 1)
+            elif self.ismungsm:
+                md = checkfield(md, 'fieldname', 'smb.temperatures_presentday', 'size', [md.mesh.numberofvertices + 1, 12], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+                md = checkfield(md, 'fieldname', 'smb.temperatures_lgm', 'size', [md.mesh.numberofvertices + 1, 12], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+                md = checkfield(md, 'fieldname', 'smb.precipitations_presentday', 'size', [md.mesh.numberofvertices + 1, 12], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+                md = checkfield(md, 'fieldname', 'smb.precipitations_lgm', 'size', [md.mesh.numberofvertices + 1, 12], 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+                md = checkfield(md, 'fieldname', 'smb.Pfac', 'NaN', 1, 'Inf', 1, 'size', [2, np.nan], 'singletimeseries', 1)
+                md = checkfield(md, 'fieldname', 'smb.Tdiff', 'NaN', 1, 'Inf', 1, 'size', [2, np.nan], 'singletimeseries', 1)
+                md = checkfield(md, 'fieldname', 'smb.sealev', 'NaN', 1, 'Inf', 1, 'size', [2, np.nan], 'singletimeseries', 1)
+
+        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
+        return md
+    #}}}
+
+    def marshall(self, prefix, md, fid):    # {{{
+        yts = md.constants.yts
+
+        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 4, 'format', 'Integer')
+
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isdelta18o', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'ismungsm', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'issetpddfac', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'desfac', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 's0p', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 's0t', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'rlaps', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'rlapslgm', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
+
+        if (self.isdelta18o == 0 and self.ismungsm == 0):
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'monthlytemperatures', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        elif self.isdelta18o:
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'temperatures_presentday', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'temperatures_lgm', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitations_presentday', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitations_lgm', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'delta18o_surface', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'delta18o', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Tdiff', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'sealev', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
+        elif self.ismungsm:
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'temperatures_presentday', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'temperatures_lgm', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitations_presentday', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitations_lgm', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Pfac', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Tdiff', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
+            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'sealev', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
+
+        #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
+
+    # }}}
Index: /issm/trunk/src/m/classes/SMBpddSicopolis.m
===================================================================
--- /issm/trunk/src/m/classes/SMBpddSicopolis.m	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBpddSicopolis.m	(revision 24313)
@@ -5,5 +5,5 @@
 
 classdef SMBpddSicopolis
-	properties (SetAccess=public) 
+	properties (SetAccess=public)
 		precipitation					= NaN;
 		monthlytemperatures			= NaN;
@@ -16,4 +16,5 @@
 		rlaps								= 0;
 		isfirnwarming					= 0;
+		steps_per_step=1
 		requested_outputs				= {};
 	end
@@ -41,5 +42,5 @@
 		end % }}}
 		function self = initialize(self,md) % {{{
-                    
+
 			if isnan(self.s0p),
 				self.s0p=zeros(md.mesh.numberofvertices,1);
@@ -66,8 +67,8 @@
 		function self = setdefaultparameters(self) % {{{
 
-		  self.isfirnwarming		= 1;
-		  self.desfac				= -log(2.0)/1000;
-		  self.rlaps				= 7.4;
-                  
+			self.isfirnwarming		= 1;
+			self.desfac				= -log(2.0)/1000;
+			self.rlaps				= 7.4;
+
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
@@ -82,7 +83,9 @@
 				md = checkfield(md,'fieldname','smb.monthlytemperatures','timeseries',1,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices+1 12]);
 				md = checkfield(md,'fieldname','smb.precipitation','timeseries',1,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices+1 12]);
+
 			end
+			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
 			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
-			
+
 		end % }}}
 		function disp(self) % {{{
@@ -100,4 +103,5 @@
 			fielddisplay(self,'desfac','desertification elevation factor (default is -log(2.0)/1000)');
 			fielddisplay(self,'isfirnwarming','is firnwarming (Reeh 1991) activated (0 or 1, default is 1)');
+			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
 			fielddisplay(self,'requested_outputs','additional outputs requested (TemperaturePDD, SmbAccumulation, SmbMelt)');
 		end % }}}
@@ -119,4 +123,5 @@
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitation_anomaly','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'class','smb','fieldname','smb_corr','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
 
 			%process requested outputs
Index: /issm/trunk/src/m/classes/SMBpddSicopolis.py
===================================================================
--- /issm/trunk/src/m/classes/SMBpddSicopolis.py	(revision 24312)
+++ /issm/trunk/src/m/classes/SMBpddSicopolis.py	(revision 24313)
@@ -7,147 +7,148 @@
 from helpers import *
 
+
 class SMBpddSicopolis(object):
-	"""
-	SMBpddSicopolis Class definition
+    """
+    SMBpddSicopolis Class definition
 
-	Usage:
-		SMBpddSicopolis=SMBpddSicopolis()
+    Usage:
+        SMBpddSicopolis = SMBpddSicopolis()
 """
 
-	def __init__(self): # {{{
-		self.precipitation			= float('NaN')
-		self.monthlytemperatures		= float('NaN')
-		self.temperature_anomaly		= float('NaN')
-		self.precipitation_anomaly		= float('NaN')
-		self.smb_corr				= float('NaN')
-		self.desfac				= 0
-		self.s0p				= float('NaN')
-		self.s0t				= float('NaN')
-		self.rlaps				= 0
-		self.isfirnwarming			= 0
-		self.requested_outputs			= []
-		
-		self.setdefaultparameters()
-	# }}}
-	
-	@staticmethod
-	def SMBpddSicopolis(*args): # {{{
-		nargin = len(args)
+    def __init__(self):  # {{{
+        self.precipitation = float('NaN')
+        self.monthlytemperatures = float('NaN')
+        self.temperature_anomaly = float('NaN')
+        self.precipitation_anomaly = float('NaN')
+        self.smb_corr = float('NaN')
+        self.desfac = 0
+        self.s0p = float('NaN')
+        self.s0t = float('NaN')
+        self.rlaps = 0
+        self.isfirnwarming = 0
+        self.steps_per_step = 1
+        self.requested_outputs = []
 
-		if nargin == 0:
-			return SMBpddSicopolis()
-		else:
-			raise RuntimeError('SMBpddSicopolis: constructor not supported')
-	# }}}
+        self.setdefaultparameters()
+    # }}}
 
-	def extrude(self,md): # {{{
-		self.precipitation = project3d(md,'vector',self.precipitation,'type','node')
-		self.monthlytemperatures = project3d(md,'vector',self.monthlytemperatures,'type','node')
-		self.temperature_anomaly = project3d(md,'vector',self.temperature_anomaly,'type','node')
-		self.precipitation_anomaly = project3d(md,'vector',self.precipitation_anomaly,'type','node')
-		self.smb_corr = project3d(md,'vector',self.smb_corr,'type','node')
-		self.s0p = project3d(md,'vector',self.s0p,'type','node')
-		self.s0t = project3d(md,'vector',self.s0t,'type','node')
-	# }}}
+    @staticmethod
+    def SMBpddSicopolis(*args):  # {{{
+        nargin = len(args)
 
-	def defaultoutputs(self,md): # {{{
-		l = ['']
-		return l
-	# }}}
+        if nargin == 0:
+            return SMBpddSicopolis()
+        else:
+            raise RuntimeError('SMBpddSicopolis: constructor not supported')
+    # }}}
 
-	def initialize(self,md): # {{{
-            
-		if np.isnan(self.s0p):
-			self.s0p = np.zeros((md.mesh.numberofvertices,))
-			print '      no SMBpddSicopolis.s0p specified: values set as zero'
-		
-		if np.isnan(self.s0t):
-			self.s0t = np.zeros((md.mesh.numberofvertices,))
-			print '      no SMBpddSicopolis.s0t specified: values set as zero'
-		
-		if np.isnan(self.temperature_anomaly):
-			self.temperature_anomaly = np.zeros((md.mesh.numberofvertices,))
-			print '      no SMBpddSicopolis.temperature_anomaly specified: values set as zero'
-		
-		if np.isnan(self.precipitation_anomaly):
-			self.precipitation_anomaly = np.ones((md.mesh.numberofvertices,))
-			print '      no SMBpddSicopolis.precipitation_anomaly specified: values set as ones'
-		
-		if np.isnan(self.smb_corr):
-			self.smb_corr = np.zeros((md.mesh.numberofvertices,))
-			print '      no SMBpddSicopolis.smb_corr specified: values set as zero'
-	# }}}
+    def extrude(self, md):  # {{{
+        self.precipitation = project3d(md, 'vector', self.precipitation, 'type', 'node')
+        self.monthlytemperatures = project3d(md, 'vector', self.monthlytemperatures, 'type', 'node')
+        self.temperature_anomaly = project3d(md, 'vector', self.temperature_anomaly, 'type', 'node')
+        self.precipitation_anomaly = project3d(md, 'vector', self.precipitation_anomaly, 'type', 'node')
+        self.smb_corr = project3d(md, 'vector', self.smb_corr, 'type', 'node')
+        self.s0p = project3d(md, 'vector', self.s0p, 'type', 'node')
+        self.s0t = project3d(md, 'vector', self.s0t, 'type', 'node')
+    # }}}
 
-	def setdefaultparameters(self): # {{{
+    def defaultoutputs(self, md):  # {{{
+        listing = ['']
+        return listing
+    # }}}
 
-	  self.isfirnwarming	= 1
-	  self.desfac		= -np.log(2.0)/1000
-	  self.rlaps		= 7.4
-          
-	# }}}
+    def initialize(self, md):  # {{{
 
-	def checkconsistency(self,md,solution,analyses): # {{{
+        if np.isnan(self.s0p):
+            self.s0p = np.zeros((md.mesh.numberofvertices, ))
+            print('      no SMBpddSicopolis.s0p specified: values set as zero')
 
-		if (strcmp(solution,'TransientSolution') and md.transient.issmb == 0):
-			return 
+        if np.isnan(self.s0t):
+            self.s0t = np.zeros((md.mesh.numberofvertices, ))
+            print('      no SMBpddSicopolis.s0t specified: values set as zero')
 
-		if 'MasstransportAnalysis' in analyses:
-			md = checkfield(md,'fieldname','smb.desfac','<=',1,'numel',1)
-			md = checkfield(md,'fieldname','smb.s0p','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices,1])
-			md = checkfield(md,'fieldname','smb.s0t','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices,1])
-			md = checkfield(md,'fieldname','smb.rlaps','>=',0,'numel',1)
-			md = checkfield(md,'fieldname','smb.monthlytemperatures','timeseries',1,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices+1,12])
-			md = checkfield(md,'fieldname','smb.precipitation','timeseries',1,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices+1,12])
-		
-		md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1)
-		
-		return md
-	# }}}
+        if np.isnan(self.temperature_anomaly):
+            self.temperature_anomaly = np.zeros((md.mesh.numberofvertices, ))
+            print('      no SMBpddSicopolis.temperature_anomaly specified: values set as zero')
 
-	def __repr__(self): # {{{
-		string = '   surface forcings parameters:'
-		string += '\n   SICOPOLIS PDD scheme (Calov & Greve, 2005) :'
+        if np.isnan(self.precipitation_anomaly):
+            self.precipitation_anomaly = np.ones((md.mesh.numberofvertices, ))
+            print('      no SMBpddSicopolis.precipitation_anomaly specified: values set as ones')
 
-		string = "%s\n%s"%(string,fielddisplay(self,'monthlytemperatures','monthly surface temperatures [K]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'precipitation','monthly surface precipitation [m/yr water eq]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'temperature_anomaly','anomaly to monthly reference temperature (additive [K])'))
-		string = "%s\n%s"%(string,fielddisplay(self,'precipitation_anomaly','anomaly to monthly precipitation (multiplicative, e.g. q=q0*exp(0.070458*DeltaT) after Huybrechts (2002)) [no unit])'))
-		string = "%s\n%s"%(string,fielddisplay(self,'smb_corr','correction of smb after PDD call [m/a]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'s0p','should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'s0t','should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]'))
-		string = "%s\n%s"%(string,fielddisplay(self,'rlaps','present day lapse rate (default is 7.4 degree/km)'))
-		string = "%s\n%s"%(string,fielddisplay(self,'desfac','desertification elevation factor (default is -log(2.0)/1000)'))
-		string = "%s\n%s"%(string,fielddisplay(self,'isfirnwarming','is firnwarming (Reeh 1991) activated (0 or 1, default is 1)'))
-		string = "%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested (TemperaturePDD, SmbAccumulation, SmbMelt)'))
-	# }}}
+        if np.isnan(self.smb_corr):
+            self.smb_corr = np.zeros((md.mesh.numberofvertices, ))
+            print('      no SMBpddSicopolis.smb_corr specified: values set as zero')
+    # }}}
 
-	def marshall(self,prefix,md,fid): # {{{
+    def setdefaultparameters(self):  # {{{
+        self.isfirnwarming = 1
+        self.desfac = -np.log(2.0) / 1000
+        self.rlaps = 7.4
 
-		yts=md.constants.yts
+    # }}}
 
-		WriteData(fid,prefix,'name','md.smb.model','data',10,'format','Integer')
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if (strcmp(solution, 'TransientSolution') and md.transient.issmb == 0):
+            return
 
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','isfirnwarming','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','desfac','format','Double')
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0p','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0t','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlaps','format','Double')
+        if 'MasstransportAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'smb.desfac', '<=', 1, 'numel', 1)
+            md = checkfield(md, 'fieldname', 'smb.s0p', '>=', 0, 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices, 1])
+            md = checkfield(md, 'fieldname', 'smb.s0t', '>=', 0, 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices, 1])
+            md = checkfield(md, 'fieldname', 'smb.rlaps', '>=', 0, 'numel', 1)
+            md = checkfield(md, 'fieldname', 'smb.monthlytemperatures', 'timeseries', 1, 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices + 1, 12])
+            md = checkfield(md, 'fieldname', 'smb.precipitation', 'timeseries', 1, 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices + 1, 12])
 
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperature_anomaly','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitation_anomaly','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','smb','fieldname','smb_corr','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
+        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'smb.requested_outputs', 'stringrow', 1)
 
-		#process requested outputs
-		outputs = self.requested_outputs
-		pos  = np.where('default' in outputs)
-		if not isempty(pos):
-			outputs[pos] = []                         #remove 'default' from outputs
-			outputs      = [outputs,defaultoutputs(self,md)] #add defaults
-		
-		WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray')
+        return md
+    # }}}
 
-	# }}}
-	
+    def __repr__(self):  # {{{
+        string = '   surface forcings parameters:'
+        string += '\n   SICOPOLIS PDD scheme (Calov & Greve, 2005) :'
 
+        string = "%s\n%s" % (string, fielddisplay(self, 'monthlytemperatures', 'monthly surface temperatures [K]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'precipitation', 'monthly surface precipitation [m/yr water eq]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'temperature_anomaly', 'anomaly to monthly reference temperature (additive [K])'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'precipitation_anomaly', 'anomaly to monthly precipitation (multiplicative, e.g. q = q0*exp(0.070458*DeltaT) after Huybrechts (2002)) [no unit])'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'smb_corr', 'correction of smb after PDD call [m/a]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 's0p', 'should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 's0t', 'should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'rlaps', 'present day lapse rate (default is 7.4 degree/km)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'desfac', 'desertification elevation factor (default is -log(2.0)/1000)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isfirnwarming', 'is firnwarming (Reeh 1991) activated (0 or 1, default is 1)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested (TemperaturePDD, SmbAccumulation, SmbMelt)'))
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+
+        yts = md.constants.yts
+
+        WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 10, 'format', 'Integer')
+
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'isfirnwarming', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'desfac', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 's0p', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 's0t', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'rlaps', 'format', 'Double')
+
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'monthlytemperatures', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitation', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'temperature_anomaly', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'precipitation_anomaly', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'smb_corr', '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')
+
+        #process requested outputs
+        outputs = self.requested_outputs
+        pos = np.where('default' in outputs)
+        if not isempty(pos):
+            outputs[pos] = []  #remove 'default' from outputs
+            outputs = [outputs, defaultoutputs(self, md)]  #add defaults
+
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray')
+
+    # }}}
Index: /issm/trunk/src/m/classes/SMBsemic.m
===================================================================
--- /issm/trunk/src/m/classes/SMBsemic.m	(revision 24313)
+++ /issm/trunk/src/m/classes/SMBsemic.m	(revision 24313)
@@ -0,0 +1,137 @@
+%SMBsemic Class definition
+%
+%   Usage:
+%      SMBsemic=SMBsemic();
+
+classdef SMBsemic
+	properties (SetAccess=public)
+		dailysnowfall		= NaN;
+		dailyrainfall		= NaN;
+		dailydsradiation	= NaN;
+		dailydlradiation	= NaN;
+		dailywindspeed		= NaN;
+		dailypressure		= NaN;
+		dailyairdensity	= NaN;
+		dailyairhumidity	= NaN;
+		dailytemperature	= NaN;
+		desfac				= 0;
+		rlaps					= 0;
+		rdl					= 0;
+		s0gcm					= NaN;
+		steps_per_step = 1;
+		requested_outputs = {};
+	end
+	methods
+		function self = SMBsemic(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function self = extrude(self,md) % {{{
+			self.dailysnowfall=project3d(md,'vector',self.dailysnowfall,'type','node');
+			self.dailyrainfall=project3d(md,'vector',self.dailyrainfall,'type','node');
+			self.dailydsradiation=project3d(md,'vector',self.dailydsradiation,'type','node');
+			self.dailydlradiation=project3d(md,'vector',self.dailydlradiation,'type','node');
+			self.dailywindspeed=project3d(md,'vector',self.dailywindspeed,'type','node');
+			self.dailypressure=project3d(md,'vector',self.dailypressure,'type','node');
+			self.dailyairdensity=project3d(md,'vector',self.dailyairdensity,'type','node');
+			self.dailyairhumidity=project3d(md,'vector',self.dailyairhumidity,'type','node');
+			self.dailytemperature=project3d(md,'vector',self.dailytemperature,'type','node');
+			self.s0gcm=project3d(md,'vector',self.s0gcm,'type','node');
+
+		end % }}}
+		function list = defaultoutputs(self,md) % {{{
+			list = {''};
+		end % }}}
+		function self = initialize(self,md) % {{{
+
+			if isnan(self.s0gcm),
+				self.s0gcm=zeros(md.mesh.numberofvertices,1);
+				disp('      no SMBsemic.s0gcm specified: values set as zero');
+			end
+
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+
+			self.desfac		= -log(2.0)/1000;
+			self.rlaps		= 7.4;
+			self.rdl			= 0.29;
+
+		end % }}}zo
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			if ismember('MasstransportAnalysis',analyses),
+				md = checkfield(md,'fieldname','smb.desfac','<=',1,'numel',1);
+				md = checkfield(md,'fieldname','smb.s0gcm','>=',0,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+				md = checkfield(md,'fieldname','smb.rlaps','>=',0,'numel',1);
+				md = checkfield(md,'fieldname','smb.rdl','>=',0,'numel',1);
+				md = checkfield(md,'fieldname','smb.dailysnowfall','timeseries',1,'NaN',1,'Inf',1);
+				md = checkfield(md,'fieldname','smb.dailyrainfall','timeseries',1,'NaN',1,'Inf',1);
+				md = checkfield(md,'fieldname','smb.dailydsradiation','timeseries',1,'NaN',1,'Inf',1);
+				md = checkfield(md,'fieldname','smb.dailydlradiation','timeseries',1,'NaN',1,'Inf',1);
+				md = checkfield(md,'fieldname','smb.dailywindspeed','timeseries',1,'NaN',1,'Inf',1);
+				md = checkfield(md,'fieldname','smb.dailypressure','timeseries',1,'NaN',1,'Inf',1);
+				md = checkfield(md,'fieldname','smb.dailyairdensity','timeseries',1,'NaN',1,'Inf',1);
+				md = checkfield(md,'fieldname','smb.dailyairhumidity','timeseries',1,'NaN',1,'Inf',1);
+				md = checkfield(md,'fieldname','smb.dailytemperature','timeseries',1,'NaN',1,'Inf',1);
+			end
+			md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
+			md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
+
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   surface forcings parameters:'));
+
+			disp(sprintf('   Interface for coupling GCM data to the energy balance model SEMIC (Krapp et al (2017) https://doi.org/10.5194/tc-11-1519-2017).'));
+			disp(sprintf('   The implemented coupling uses daily mean GCM input to calculate yearly mean smb, accumulation, ablation, and surface temperature.'));
+			disp(sprintf('   smb and temperatures are updated every year'));
+			disp(sprintf('\n   SEMIC parameters:'));
+			fielddisplay(self,'dailysnowfall','daily surface dailysnowfall [m/s]');
+			fielddisplay(self,'dailyrainfall','daily surface dailyrainfall [m/s]');
+			fielddisplay(self,'dailydsradiation','daily downwelling shortwave radiation [W/m2]');
+			fielddisplay(self,'dailydlradiation','daily downwelling longwave radiation [W/m2]');
+			fielddisplay(self,'dailywindspeed','daily surface wind speed [m/s]');
+			fielddisplay(self,'dailypressure','daily surface pressure [Pa]');
+			fielddisplay(self,'dailyairdensity','daily air density [kg/m3]');
+			fielddisplay(self,'dailyairhumidity','daily air specific humidity [kg/kg]');
+			fielddisplay(self,'dailytemperature','daily surface air temperature [K]');
+			fielddisplay(self,'rlaps','present day lapse rate (default is 7.4 [degree/km]; )Erokhina et al. 2017)');
+			fielddisplay(self,'desfac','desertification elevation factor (default is -log(2.0)/1000 [1/km]; Vizcaino et al. 2010)');
+			fielddisplay(self,'rdl','longwave downward radiation decrease (default is 0.29 [W/m^2/km]; Marty et al. 2002)');
+			fielddisplay(self,'s0gcm','GCM reference elevation; (default is 0) [m]');
+			fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
+			fielddisplay(self,'requested_outputs','additional outputs requested');
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+
+			WriteData(fid,prefix,'name','md.smb.model','data',12,'format','Integer');
+
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','desfac','format','Double');
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0gcm','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlaps','format','Double');
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','rdl','format','Double');
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailysnowfall','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailyrainfall','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailydsradiation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailydlradiation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailywindspeed','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailypressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailyairdensity','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailyairhumidity','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailytemperature','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer');
+			%process requested outputs
+			outputs = self.requested_outputs;
+			pos  = find(ismember(outputs,'default'));
+			if ~isempty(pos),
+				outputs(pos) = []; %remove 'default' from outputs
+				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
+			end
+			WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray');
+
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/amr.py
===================================================================
--- /issm/trunk/src/m/classes/amr.py	(revision 24312)
+++ /issm/trunk/src/m/classes/amr.py	(revision 24313)
@@ -2,4 +2,5 @@
 from checkfield import checkfield
 from WriteData import WriteData
+
 
 class amr(object):
@@ -8,114 +9,118 @@
 
     Usage:
-        amr=amr();
+        amr = amr()
     """
 
-    def __init__(self): # {{{
-        self.hmin										= 0.
-        self.hmax										= 0.
-        self.fieldname								=''
-        self.err 										= 0.
-        self.keepmetric								= 0.
-        self.gradation 								= 0.
-        self.groundingline_resolution 			= 0.
-        self.groundingline_distance 			= 0.
-        self.icefront_resolution 				= 0.
-        self.icefront_distance 					= 0.
-        self.thicknesserror_resolution 		= 0.
-        self.thicknesserror_threshold 			= 0.
-        self.thicknesserror_groupthreshold	= 0.
-        self.thicknesserror_maximum				= 0.
-        self.deviatoricerror_resolution		= 0.
-        self.deviatoricerror_threshold			= 0.
-        self.deviatoricerror_groupthreshold	= 0.
-        self.deviatoricerror_maximum			= 0.
-        self.restart                         = 0.
-        #set defaults
+    def __init__(self):  # {{{
+        self.hmin = 0.
+        self.hmax = 0.
+        self.fieldname = ''
+        self.err = 0.
+        self.keepmetric = 0.
+        self.gradation = 0.
+        self.groundingline_resolution = 0.
+        self.groundingline_distance = 0.
+        self.icefront_resolution = 0.
+        self.icefront_distance = 0.
+        self.thicknesserror_resolution = 0.
+        self.thicknesserror_threshold = 0.
+        self.thicknesserror_groupthreshold = 0.
+        self.thicknesserror_maximum = 0.
+        self.deviatoricerror_resolution = 0.
+        self.deviatoricerror_threshold = 0.
+        self.deviatoricerror_groupthreshold = 0.
+        self.deviatoricerror_maximum = 0.
+        self.restart = 0.
+    #set defaults
         self.setdefaultparameters()
     #}}}
-    def __repr__(self): # {{{
-        string="   amr parameters:"
-        string="%s\n%s"%(string,fielddisplay(self,"hmin","minimum element length"))
-        string="%s\n%s"%(string,fielddisplay(self,"hmax","maximum element length"))
-        string="%s\n%s"%(string,fielddisplay(self,"fieldname","name of input that will be used to compute the metric (should be an input of FemModel)"))
-        string="%s\n%s"%(string,fielddisplay(self,"keepmetric","indicates whether the metric should be kept every remeshing time"))
-        string="%s\n%s"%(string,fielddisplay(self,"gradation","maximum ratio between two adjacent edges"))
-        string="%s\n%s"%(string,fielddisplay(self,"groundingline_resolution","element length near the grounding line"))
-        string="%s\n%s"%(string,fielddisplay(self,"groundingline_distance","distance around the grounding line which elements will be refined"))
-        string="%s\n%s"%(string,fielddisplay(self,"icefront_resolution","element length near the ice front"))
-        string="%s\n%s"%(string,fielddisplay(self,"icefront_distance","distance around the ice front which elements will be refined"))
-        string="%s\n%s"%(string,fielddisplay(self,"thicknesserror_resolution","element length when thickness error estimator is used"))
-        string="%s\n%s"%(string,fielddisplay(self,"thicknesserror_threshold","maximum threshold thickness error permitted"))
-        string="%s\n%s"%(string,fielddisplay(self,"thicknesserror_groupthreshold","maximum group threshold thickness error permitted"))
-        string="%s\n%s"%(string,fielddisplay(self,"thicknesserror_maximum","maximum thickness error permitted"))
-        string="%s\n%s"%(string,fielddisplay(self,"deviatoricerror_resolution","element length when deviatoric stress error estimator is used"))
-        string="%s\n%s"%(string,fielddisplay(self,"deviatoricerror_threshold","maximum threshold deviatoricstress error permitted"))
-        string="%s\n%s"%(string,fielddisplay(self,"deviatoricerror_groupthreshold","maximum group threshold deviatoric stress error permitted"))
-        string="%s\n%s"%(string,fielddisplay(self,"deviatoricerror_maximum","maximum deviatoricstress error permitted"))
-        string="%s\n%s"%(string,fielddisplay(self,"restart","indicates if ReMesh() will call before first time step"))
+
+    def __repr__(self):  # {{{
+        string = "   amr parameters:"
+        string = "%s\n%s" % (string, fielddisplay(self, "hmin", "minimum element length"))
+        string = "%s\n%s" % (string, fielddisplay(self, "hmax", "maximum element length"))
+        string = "%s\n%s" % (string, fielddisplay(self, "fieldname", "name of input that will be used to compute the metric (should be an input of FemModel)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "keepmetric", "indicates whether the metric should be kept every remeshing time"))
+        string = "%s\n%s" % (string, fielddisplay(self, "gradation", "maximum ratio between two adjacent edges"))
+        string = "%s\n%s" % (string, fielddisplay(self, "groundingline_resolution", "element length near the grounding line"))
+        string = "%s\n%s" % (string, fielddisplay(self, "groundingline_distance", "distance around the grounding line which elements will be refined"))
+        string = "%s\n%s" % (string, fielddisplay(self, "icefront_resolution", "element length near the ice front"))
+        string = "%s\n%s" % (string, fielddisplay(self, "icefront_distance", "distance around the ice front which elements will be refined"))
+        string = "%s\n%s" % (string, fielddisplay(self, "thicknesserror_resolution", "element length when thickness error estimator is used"))
+        string = "%s\n%s" % (string, fielddisplay(self, "thicknesserror_threshold", "maximum threshold thickness error permitted"))
+        string = "%s\n%s" % (string, fielddisplay(self, "thicknesserror_groupthreshold", "maximum group threshold thickness error permitted"))
+        string = "%s\n%s" % (string, fielddisplay(self, "thicknesserror_maximum", "maximum thickness error permitted"))
+        string = "%s\n%s" % (string, fielddisplay(self, "deviatoricerror_resolution", "element length when deviatoric stress error estimator is used"))
+        string = "%s\n%s" % (string, fielddisplay(self, "deviatoricerror_threshold", "maximum threshold deviatoricstress error permitted"))
+        string = "%s\n%s" % (string, fielddisplay(self, "deviatoricerror_groupthreshold", "maximum group threshold deviatoric stress error permitted"))
+        string = "%s\n%s" % (string, fielddisplay(self, "deviatoricerror_maximum", "maximum deviatoricstress error permitted"))
+        string = "%s\n%s" % (string, fielddisplay(self, "restart", "indicates if ReMesh() will call before first time step"))
         return string
     #}}}
-    def setdefaultparameters(self): # {{{
-        self.hmin										= 100.
-        self.hmax										= 100.e3
-        self.fieldname								= 'Vel'
-        self.err 										= 3.
-        self.keepmetric								= 1
-        self.gradation 								= 1.5
-        self.groundingline_resolution 			= 500.
-        self.groundingline_distance 			= 0
-        self.icefront_resolution 				= 500.
-        self.icefront_distance 					= 0
-        self.thicknesserror_resolution 		= 500.
-        self.thicknesserror_threshold 			= 0
-        self.thicknesserror_groupthreshold 	= 0
-        self.thicknesserror_maximum				= 0
-        self.deviatoricerror_resolution		= 500.
-        self.deviatoricerror_threshold			= 0
-        self.deviatoricerror_groupthreshold	= 0
-        self.deviatoricerror_maximum			= 0
-        self.restart									= 0.
+
+    def setdefaultparameters(self):  # {{{
+        self.hmin = 100.
+        self.hmax = 100.e3
+        self.fieldname = 'Vel'
+        self.err = 3.
+        self.keepmetric = 1
+        self.gradation = 1.5
+        self.groundingline_resolution = 500.
+        self.groundingline_distance = 0
+        self.icefront_resolution = 500.
+        self.icefront_distance = 0
+        self.thicknesserror_resolution = 500.
+        self.thicknesserror_threshold = 0
+        self.thicknesserror_groupthreshold = 0
+        self.thicknesserror_maximum = 0
+        self.deviatoricerror_resolution = 500.
+        self.deviatoricerror_threshold = 0
+        self.deviatoricerror_groupthreshold = 0
+        self.deviatoricerror_maximum = 0
+        self.restart = 0.
         return self
     #}}}
-    def checkconsistency(self,md,solution,analyses):    # {{{
-        md = checkfield(md,'fieldname','amr.hmax','numel',[1],'>',0,'NaN',1)
-        md = checkfield(md,'fieldname','amr.hmin','numel',[1],'>',0,'<',self.hmax,'NaN',1)
-        md = checkfield(md,'fieldname','amr.keepmetric','numel',[1],'>=',0,'<=',1,'NaN',1);
-        md = checkfield(md,'fieldname','amr.gradation','numel',[1],'>=',1.1,'<=',5,'NaN',1);
-        md = checkfield(md,'fieldname','amr.groundingline_resolution','numel',[1],'>',0,'<',self.hmax,'NaN',1);
-        md = checkfield(md,'fieldname','amr.groundingline_distance','numel',[1],'>=',0,'NaN',1,'Inf',1);
-        md = checkfield(md,'fieldname','amr.icefront_resolution','numel',[1],'>',0,'<',self.hmax,'NaN',1);
-        md = checkfield(md,'fieldname','amr.icefront_distance','numel',[1],'>=',0,'NaN',1,'Inf',1);
-        md = checkfield(md,'fieldname','amr.thicknesserror_resolution','numel',[1],'>',0,'<',self.hmax,'NaN',1);
-        md = checkfield(md,'fieldname','amr.thicknesserror_threshold','numel',[1],'>=',0,'<=',1,'NaN',1);
-        md = checkfield(md,'fieldname','amr.thicknesserror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1);
-        md = checkfield(md,'fieldname','amr.thicknesserror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1);
-        md = checkfield(md,'fieldname','amr.deviatoricerror_resolution','numel',[1],'>',0,'<',self.hmax,'NaN',1);
-        md = checkfield(md,'fieldname','amr.deviatoricerror_threshold','numel',[1],'>=',0,'<=',1,'NaN',1);        
-        md = checkfield(md,'fieldname','amr.deviatoricerror_groupthreshold','numel',[1],'>=',0,'<=',1,'NaN',1);        
-        md = checkfield(md,'fieldname','amr.deviatoricerror_maximum','numel',[1],'>=',0,'NaN',1,'Inf',1);
-        md = checkfield(md,'fieldname','amr.restart','numel',[1],'>=',0,'<=',1,'NaN',1)
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        md = checkfield(md, 'fieldname', 'amr.hmax', 'numel', [1], '>', 0, 'NaN', 1)
+        md = checkfield(md, 'fieldname', 'amr.hmin', 'numel', [1], '>', 0, '<', self.hmax, 'NaN', 1)
+        md = checkfield(md, 'fieldname', 'amr.keepmetric', 'numel', [1], '>=', 0, '<=', 1, 'NaN', 1)
+        md = checkfield(md, 'fieldname', 'amr.gradation', 'numel', [1], '>=', 1.1, '<=', 5, 'NaN', 1)
+        md = checkfield(md, 'fieldname', 'amr.groundingline_resolution', 'numel', [1], '>', 0, '<', self.hmax, 'NaN', 1)
+        md = checkfield(md, 'fieldname', 'amr.groundingline_distance', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'amr.icefront_resolution', 'numel', [1], '>', 0, '<', self.hmax, 'NaN', 1)
+        md = checkfield(md, 'fieldname', 'amr.icefront_distance', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'amr.thicknesserror_resolution', 'numel', [1], '>', 0, '<', self.hmax, 'NaN', 1)
+        md = checkfield(md, 'fieldname', 'amr.thicknesserror_threshold', 'numel', [1], '>=', 0, '<=', 1, 'NaN', 1)
+        md = checkfield(md, 'fieldname', 'amr.thicknesserror_groupthreshold', 'numel', [1], '>=', 0, '<=', 1, 'NaN', 1)
+        md = checkfield(md, 'fieldname', 'amr.thicknesserror_maximum', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'amr.deviatoricerror_resolution', 'numel', [1], '>', 0, '<', self.hmax, 'NaN', 1)
+        md = checkfield(md, 'fieldname', 'amr.deviatoricerror_threshold', 'numel', [1], '>=', 0, '<=', 1, 'NaN', 1)
+        md = checkfield(md, 'fieldname', 'amr.deviatoricerror_groupthreshold', 'numel', [1], '>=', 0, '<=', 1, 'NaN', 1)
+        md = checkfield(md, 'fieldname', 'amr.deviatoricerror_maximum', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'amr.restart', 'numel', [1], '>=', 0, '<=', 1, 'NaN', 1)
         return md
     # }}}
-    def marshall(self,prefix,md,fid):    # {{{
-        WriteData(fid,prefix,'name','md.amr.type','data',1,'format','Integer')
-        WriteData(fid,prefix,'object',self,'fieldname','hmin','format','Double');
-        WriteData(fid,prefix,'object',self,'fieldname','hmax','format','Double');
-        WriteData(fid,prefix,'object',self,'fieldname','fieldname','format','String');
-        WriteData(fid,prefix,'object',self,'fieldname','err','format','Double');
-        WriteData(fid,prefix,'object',self,'fieldname','keepmetric','format','Integer');
-        WriteData(fid,prefix,'object',self,'fieldname','gradation','format','Double');
-        WriteData(fid,prefix,'object',self,'fieldname','groundingline_resolution','format','Double');
-        WriteData(fid,prefix,'object',self,'fieldname','groundingline_distance','format','Double');
-        WriteData(fid,prefix,'object',self,'fieldname','icefront_resolution','format','Double');
-        WriteData(fid,prefix,'object',self,'fieldname','icefront_distance','format','Double');
-        WriteData(fid,prefix,'object',self,'fieldname','thicknesserror_resolution','format','Double');
-        WriteData(fid,prefix,'object',self,'fieldname','thicknesserror_threshold','format','Double');
-        WriteData(fid,prefix,'object',self,'fieldname','thicknesserror_groupthreshold','format','Double');
-        WriteData(fid,prefix,'object',self,'fieldname','thicknesserror_maximum','format','Double');
-        WriteData(fid,prefix,'object',self,'fieldname','deviatoricerror_resolution','format','Double');
-        WriteData(fid,prefix,'object',self,'fieldname','deviatoricerror_threshold','format','Double'); 
-        WriteData(fid,prefix,'object',self,'fieldname','deviatoricerror_groupthreshold','format','Double'); 
-        WriteData(fid,prefix,'object',self,'fieldname','deviatoricerror_maximum','format','Double'); 
-        WriteData(fid,prefix,'object',self,'class','amr','fieldname','restart','format','Integer')
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'name', 'md.amr.type', 'data', 1, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'hmin', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'hmax', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'fieldname', 'format', 'String')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'err', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'keepmetric', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'gradation', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundingline_resolution', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundingline_distance', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'icefront_resolution', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'icefront_distance', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'thicknesserror_resolution', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'thicknesserror_threshold', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'thicknesserror_groupthreshold', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'thicknesserror_maximum', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'deviatoricerror_resolution', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'deviatoricerror_threshold', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'deviatoricerror_groupthreshold', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'deviatoricerror_maximum', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'amr', 'fieldname', 'restart', 'format', 'Integer')
     # }}}
Index: /issm/trunk/src/m/classes/autodiff.py
===================================================================
--- /issm/trunk/src/m/classes/autodiff.py	(revision 24312)
+++ /issm/trunk/src/m/classes/autodiff.py	(revision 24313)
@@ -5,216 +5,217 @@
 from checkfield import checkfield
 from WriteData import WriteData
-from MatlabFuncs import *
+from MatlabArray import *
+
 
 class autodiff(object):
-	"""
-	AUTODIFF class definition
-
-	   Usage:
-	      autodiff=autodiff();
-	"""
-	def __init__(self,*args):    # {{{
-		self.isautodiff   = False
-		self.dependents   = []
-		self.independents = []
-		self.driver       = 'fos_forward'
-		self.obufsize     = float('NaN')
-		self.lbufsize     = float('NaN')
-		self.cbufsize     = float('NaN')
-		self.tbufsize     = float('NaN')
-		self.gcTriggerMaxSize     = float('NaN')
-		self.gcTriggerRatio     = float('NaN')
-                self.tapeAlloc = float('NaN')
-		if not len(args):
-			self.setdefaultparameters()
-		else:
-			raise RuntimeError("constructor not supported")
-	# }}}
-	def __repr__(self):    # {{{
-		s ="      automatic differentiation parameters:\n"
-
-		s+="%s\n" % fielddisplay(self,'isautodiff',"indicates if the automatic differentiation is activated")
-		s+="%s\n" % fielddisplay(self,'dependents',"list of dependent variables")
-		s+="%s\n" % fielddisplay(self,'independents',"list of independent variables")
-		s+="%s\n" % fielddisplay(self,'driver',"ADOLC driver ('fos_forward' or 'fov_forward')")
-		s+="%s\n" % fielddisplay(self,'obufsize',"Number of operations per buffer (==OBUFSIZE in usrparms.h)")
-		s+="%s\n" % fielddisplay(self,'lbufsize',"Number of locations per buffer (==LBUFSIZE in usrparms.h)")
-		s+="%s\n" % fielddisplay(self,'cbufsize',"Number of values per buffer (==CBUFSIZE in usrparms.h)")
-		s+="%s\n" % fielddisplay(self,'tbufsize',"Number of taylors per buffer (<=TBUFSIZE in usrparms.h)")
-		s+="%s\n" % fielddisplay(self,'gcTriggerRatio',"free location block sorting/consolidation triggered if the ratio between allocated and used locations exceeds gcTriggerRatio")
-		s+="%s\n" % fielddisplay(self,'gcTriggerMaxSize',"free location block sorting/consolidation triggered if the allocated locations exceed gcTriggerMaxSize)")
-                s+="%s\n" % fielddisplay(self,'tapeAlloc','Iteration count of a priori memory allocation of the AD tape');
-
-		return s
-	# }}}
-	def setdefaultparameters(self):    # {{{
-		
-		self.obufsize     = 524288
-		self.lbufsize     = 524288
-		self.cbufsize     = 524288
-		self.tbufsize     = 524288
-		self.gcTriggerRatio=2.0
-		self.gcTriggerMaxSize=65536
-                self.tapeAlloc    = 15000000;
-		return self
-	# }}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-
-		#Early return 
-		if not self.isautodiff:
-			return md 
-		
-		md = checkfield(md,'fieldname','autodiff.obufsize','>=',524288)
-		md = checkfield(md,'fieldname','autodiff.lbufsize','>=',524288)
-		md = checkfield(md,'fieldname','autodiff.cbufsize','>=',524288)
-		md = checkfield(md,'fieldname','autodiff.tbufsize','>=',524288)
-		md = checkfield(md,'fieldname','autodiff.gcTriggerRatio','>=',2.0)
-		md = checkfield(md,'fieldname','autodiff.gcTriggerMaxSize','>=',65536)
-                md = checkfield(md,'fieldname','autodiff.tapeAlloc','>=',0);
-
-		#Driver value:
-		md = checkfield(md,'fieldname','autodiff.driver','values',['fos_forward','fov_forward','fov_forward_all','fos_reverse','fov_reverse','fov_reverse_all'])
-
-		#go through our dependents and independents and check consistency: 
-		for dep in self.dependents:
-			dep.checkconsistency(md,solution,analyses)
-		for i,indep in enumerate(self.independents):
-			indep.checkconsistency(md,i,solution,analyses,self.driver)
-
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'object',self,'fieldname','isautodiff','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','driver','format','String')
-
-		#early return
-		if not self.isautodiff:
-			WriteData(fid,prefix,'data',False,'name','md.autodiff.mass_flux_segments_present','format','Boolean')
-			WriteData(fid,prefix,'data',False,'name','md.autodiff.keep','format','Boolean')
-			return
-			
-		#buffer sizes {{{
-		WriteData(fid,prefix,'object',self,'fieldname','obufsize','format','Double');
-		WriteData(fid,prefix,'object',self,'fieldname','lbufsize','format','Double');
-		WriteData(fid,prefix,'object',self,'fieldname','cbufsize','format','Double');
-		WriteData(fid,prefix,'object',self,'fieldname','tbufsize','format','Double');
-		WriteData(fid,prefix,'object',self,'fieldname','gcTriggerRatio','format','Double');
-		WriteData(fid,prefix,'object',self,'fieldname','gcTriggerMaxSize','format','Double');
-                WriteData(fid,prefix,'object',self,'fieldname','tapeAlloc','format','Integer');
-                #}}}
-		#process dependent variables {{{
-		num_dependent_objects=len(self.dependents)
-		WriteData(fid,prefix,'data',num_dependent_objects,'name','md.autodiff.num_dependent_objects','format','Integer')
-
-		if num_dependent_objects:
-			names=[]
-			types=np.zeros(num_dependent_objects)
-			indices=np.zeros(num_dependent_objects)
-
-			for i,dep in enumerate(self.dependents):
-				names.append(dep.name)
-				types[i]=dep.typetoscalar()
-				indices[i]=dep.index
-
-			WriteData(fid,prefix,'data',names,'name','md.autodiff.dependent_object_names','format','StringArray')
-			WriteData(fid,prefix,'data',types,'name','md.autodiff.dependent_object_types','format','IntMat','mattype',3)
-			WriteData(fid,prefix,'data',indices,'name','md.autodiff.dependent_object_indices','format','IntMat','mattype',3)
-		#}}}
-		#process independent variables {{{
-		num_independent_objects=len(self.independents)
-		WriteData(fid,prefix,'data',num_independent_objects,'name','md.autodiff.num_independent_objects','format','Integer')
-
-		if num_independent_objects:
-			names=[None] * num_independent_objects
-			types=np.zeros(num_independent_objects)
-
-			for i,indep in enumerate(self.independents):
-				names[i]=indep.name
-				types[i]=indep.typetoscalar()
-
-			WriteData(fid,prefix,'data',names,'name','md.autodiff.independent_object_names','format','StringArray')
-			WriteData(fid,prefix,'data',types,'name','md.autodiff.independent_object_types','format','IntMat','mattype',3)
-		#}}}
-		#if driver is fos_forward, build index:  {{{
-		if strcmpi(self.driver,'fos_forward'):
-			index=0
-
-			for indep in self.independents:
-				if not np.isnan(indep.fos_forward_index):
-					index+=indep.fos_forward_index
-					break
-				else:
-					if strcmpi(indep.type,'scalar'):
-						index+=1
-					else:
-						index+=indep.nods
-
-			index-=1    #get c-index numbering going
-			WriteData(fid,prefix,'data',index,'name','md.autodiff.fos_forward_index','format','Integer')
-		#}}}
-		#if driver is fos_reverse, build index:  {{{
-		if strcmpi(self.driver,'fos_reverse'):
-			index=0
-
-			for dep in self.dependents:
-				if not np.isnan(dep.fos_reverse_index):
-					index+=dep.fos_reverse_index
-					break
-				else:
-					if strcmpi(dep.type,'scalar'):
-						index+=1
-					else:
-						index+=dep.nods
-
-			index-=1    #get c-index numbering going
-			WriteData(fid,prefix,'data',index,'name','md.autodiff.fos_reverse_index','format','Integer')
-		#}}}
-		#if driver is fov_forward, build indices:  {{{
-		if strcmpi(self.driver,'fov_forward'):
-			indices=0
-
-			for indep in self.independents:
-				if indep.fos_forward_index:
-					indices+=indep.fov_forward_indices
-					break
-				else:
-					if strcmpi(indep.type,'scalar'):
-						indices+=1
-					else:
-						indices+=indep.nods
-
-			indices-=1    #get c-indices numbering going
-			WriteData(fid,prefix,'data',indices,'name','md.autodiff.fov_forward_indices','format','IntMat','mattype',3)
-		#}}}
-		#deal with mass fluxes:  {{{
-		mass_flux_segments=[dep.segments for dep in self.dependents if strcmpi(dep.name,'MassFlux')]
-
-		if mass_flux_segments:
-			WriteData(fid,prefix,'data',mass_flux_segments,'name','md.autodiff.mass_flux_segments','format','MatArray')
-			flag=True
-		else:
-			flag=False
-		WriteData(fid,prefix,'data',flag,'name','md.autodiff.mass_flux_segments_present','format','Boolean')
-		#}}}
-		#deal with trace keep on: {{{
-		keep=False
-
-		#From ADOLC userdoc: 
-		# The optional integer argument keep of trace on determines whether the numerical values of all active variables are 
-		# recorded in a buffered temporary array or file called the taylor stack. This option takes effect if keep = 1 and 
-		# prepares the scene for an immediately following gradient evaluation by a call to a routine implementing the reverse 
-		# mode as described in the Section 4 and Section 5. 
-		#
-
-		if len(self.driver)<=3:
-			keep=False    #there is no "_reverse" string within the driver string: 
-		else:
-			if strncmpi(self.driver[3:],'_reverse',8):
-				keep=True
-			else:
-				keep=False
-		WriteData(fid,prefix,'data',keep,'name','md.autodiff.keep','format','Boolean')
-		#}}}
-
-		return
-	# }}}
+    """
+    AUTODIFF class definition
+
+       Usage:
+          autodiff = autodiff()
+    """
+    def __init__(self, *args):  # {{{
+        self.isautodiff = False
+        self.dependents = []
+        self.independents = []
+        self.driver = 'fos_forward'
+        self.obufsize = float('NaN')
+        self.lbufsize = float('NaN')
+        self.cbufsize = float('NaN')
+        self.tbufsize = float('NaN')
+        self.gcTriggerMaxSize = float('NaN')
+        self.gcTriggerRatio = float('NaN')
+        self.tapeAlloc = float('NaN')
+        if not len(args):
+            self.setdefaultparameters()
+        else:
+            raise RuntimeError("constructor not supported")
+    # }}}
+
+    def __repr__(self):  # {{{
+        s = "      automatic differentiation parameters:\n"
+        s += "%s\n" % fielddisplay(self, 'isautodiff', "indicates if the automatic differentiation is activated")
+        s += "%s\n" % fielddisplay(self, 'dependents', "list of dependent variables")
+        s += "%s\n" % fielddisplay(self, 'independents', "list of independent variables")
+        s += "%s\n" % fielddisplay(self, 'driver', "ADOLC driver ('fos_forward' or 'fov_forward')")
+        s += "%s\n" % fielddisplay(self, 'obufsize', "Number of operations per buffer (== OBUFSIZE in usrparms.h)")
+        s += "%s\n" % fielddisplay(self, 'lbufsize', "Number of locations per buffer (== LBUFSIZE in usrparms.h)")
+        s += "%s\n" % fielddisplay(self, 'cbufsize', "Number of values per buffer (== CBUFSIZE in usrparms.h)")
+        s += "%s\n" % fielddisplay(self, 'tbufsize', "Number of taylors per buffer (<=TBUFSIZE in usrparms.h)")
+        s += "%s\n" % fielddisplay(self, 'gcTriggerRatio', "free location block sorting / consolidation triggered if the ratio between allocated and used locations exceeds gcTriggerRatio")
+        s += "%s\n" % fielddisplay(self, 'gcTriggerMaxSize', "free location block sorting / consolidation triggered if the allocated locations exceed gcTriggerMaxSize)")
+        s += "%s\n" % fielddisplay(self, 'tapeAlloc', 'Iteration count of a priori memory allocation of the AD tape')
+
+        return s
+    # }}}
+
+    def setdefaultparameters(self):  # {{{
+        self.obufsize = 524288
+        self.lbufsize = 524288
+        self.cbufsize = 524288
+        self.tbufsize = 524288
+        self.gcTriggerRatio = 2.0
+        self.gcTriggerMaxSize = 65536
+        self.tapeAlloc = 15000000
+        return self
+    # }}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if not self.isautodiff:
+            return md
+
+        md = checkfield(md, 'fieldname', 'autodiff.obufsize', '>=', 524288)
+        md = checkfield(md, 'fieldname', 'autodiff.lbufsize', '>=', 524288)
+        md = checkfield(md, 'fieldname', 'autodiff.cbufsize', '>=', 524288)
+        md = checkfield(md, 'fieldname', 'autodiff.tbufsize', '>=', 524288)
+        md = checkfield(md, 'fieldname', 'autodiff.gcTriggerRatio', '>=', 2.0)
+        md = checkfield(md, 'fieldname', 'autodiff.gcTriggerMaxSize', '>=', 65536)
+        md = checkfield(md, 'fieldname', 'autodiff.tapeAlloc', '>=', 0)
+
+    #Driver value:
+        md = checkfield(md, 'fieldname', 'autodiff.driver', 'values', ['fos_forward', 'fov_forward', 'fov_forward_all', 'fos_reverse', 'fov_reverse', 'fov_reverse_all'])
+
+    #go through our dependents and independents and check consistency:
+        for dep in self.dependents:
+            dep.checkconsistency(md, solution, analyses)
+        for i, indep in enumerate(self.independents):
+            indep.checkconsistency(md, i, solution, analyses, self.driver)
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isautodiff', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'driver', 'format', 'String')
+
+        #early return
+        if not self.isautodiff:
+            WriteData(fid, prefix, 'data', False, 'name', 'md.autodiff.mass_flux_segments_present', 'format', 'Boolean')
+            WriteData(fid, prefix, 'data', False, 'name', 'md.autodiff.keep', 'format', 'Boolean')
+            return
+
+        #buffer sizes {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'obufsize', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'lbufsize', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'cbufsize', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'tbufsize', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'gcTriggerRatio', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'gcTriggerMaxSize', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'tapeAlloc', 'format', 'Integer')
+        #}}}
+        #process dependent variables {{{
+        num_dependent_objects = len(self.dependents)
+        WriteData(fid, prefix, 'data', num_dependent_objects, 'name', 'md.autodiff.num_dependent_objects', 'format', 'Integer')
+
+        if num_dependent_objects:
+            names = []
+            types = np.zeros(num_dependent_objects)
+            indices = np.zeros(num_dependent_objects)
+
+            for i, dep in enumerate(self.dependents):
+                names.append(dep.name)
+                types[i] = dep.typetoscalar()
+                indices[i] = dep.index
+
+            WriteData(fid, prefix, 'data', names, 'name', 'md.autodiff.dependent_object_names', 'format', 'StringArray')
+            WriteData(fid, prefix, 'data', types, 'name', 'md.autodiff.dependent_object_types', 'format', 'IntMat', 'mattype', 3)
+            WriteData(fid, prefix, 'data', indices, 'name', 'md.autodiff.dependent_object_indices', 'format', 'IntMat', 'mattype', 3)
+            #}}}
+        #process independent variables {{{
+        num_independent_objects = len(self.independents)
+        WriteData(fid, prefix, 'data', num_independent_objects, 'name', 'md.autodiff.num_independent_objects', 'format', 'Integer')
+
+        if num_independent_objects:
+            names = [None] * num_independent_objects
+            types = np.zeros(num_independent_objects)
+
+            for i, indep in enumerate(self.independents):
+                names[i] = indep.name
+                types[i] = indep.typetoscalar()
+
+            WriteData(fid, prefix, 'data', names, 'name', 'md.autodiff.independent_object_names', 'format', 'StringArray')
+            WriteData(fid, prefix, 'data', types, 'name', 'md.autodiff.independent_object_types', 'format', 'IntMat', 'mattype', 3)
+            #}}}
+        #if driver is fos_forward, build index:  {{{
+        if strcmpi(self.driver, 'fos_forward'):
+            index = 0
+
+            for indep in self.independents:
+                if not np.isnan(indep.fos_forward_index):
+                    index += indep.fos_forward_index
+                    break
+                else:
+                    if strcmpi(indep.type, 'scalar'):
+                        index += 1
+                    else:
+                        index += indep.nods
+
+            index -= 1  #get c - index numbering going
+            WriteData(fid, prefix, 'data', index, 'name', 'md.autodiff.fos_forward_index', 'format', 'Integer')
+            #}}}
+        #if driver is fos_reverse, build index:  {{{
+        if strcmpi(self.driver, 'fos_reverse'):
+            index = 0
+
+            for dep in self.dependents:
+                if not np.isnan(dep.fos_reverse_index):
+                    index += dep.fos_reverse_index
+                    break
+                else:
+                    if strcmpi(dep.type, 'scalar'):
+                        index += 1
+                    else:
+                        index += dep.nods
+
+            index -= 1  #get c - index numbering going
+            WriteData(fid, prefix, 'data', index, 'name', 'md.autodiff.fos_reverse_index', 'format', 'Integer')
+            #}}}
+        #if driver is fov_forward, build indices:  {{{
+        if strcmpi(self.driver, 'fov_forward'):
+            indices = 0
+
+            for indep in self.independents:
+                if indep.fos_forward_index:
+                    indices += indep.fov_forward_indices
+                    break
+                else:
+                    if strcmpi(indep.type, 'scalar'):
+                        indices += 1
+                    else:
+                        indices += indep.nods
+
+            indices -= 1  #get c - indices numbering going
+            WriteData(fid, prefix, 'data', indices, 'name', 'md.autodiff.fov_forward_indices', 'format', 'IntMat', 'mattype', 3)
+            #}}}
+        #deal with mass fluxes:  {{{
+        mass_flux_segments = [dep.segments for dep in self.dependents if strcmpi(dep.name, 'MassFlux')]
+
+        if mass_flux_segments:
+            WriteData(fid, prefix, 'data', mass_flux_segments, 'name', 'md.autodiff.mass_flux_segments', 'format', 'MatArray')
+            flag = True
+        else:
+            flag = False
+        WriteData(fid, prefix, 'data', flag, 'name', 'md.autodiff.mass_flux_segments_present', 'format', 'Boolean')
+        #}}}
+        #deal with trace keep on: {{{
+        keep = False
+
+        #From ADOLC userdoc:
+        # The optional integer argument keep of trace on determines whether the numerical values of all active variables are
+        # recorded in a buffered temporary array or file called the taylor stack. This option takes effect if keep = 1 and
+        # prepares the scene for an immediately following gradient evaluation by a call to a routine implementing the reverse
+        # mode as described in the Section 4 and Section 5.
+        #
+        if len(self.driver) <= 3:
+            keep = False  #there is no "_reverse" string within the driver string:
+        else:
+            if strncmpi(self.driver[3:], '_reverse', 8):
+                keep = True
+            else:
+                keep = False
+        WriteData(fid, prefix, 'data', keep, 'name', 'md.autodiff.keep', 'format', 'Boolean')
+    #}}}
+
+        return
+    # }}}
Index: /issm/trunk/src/m/classes/balancethickness.py
===================================================================
--- /issm/trunk/src/m/classes/balancethickness.py	(revision 24312)
+++ /issm/trunk/src/m/classes/balancethickness.py	(revision 24313)
@@ -3,61 +3,60 @@
 from WriteData import WriteData
 
+
 class balancethickness(object):
-	"""
-	BALANCETHICKNESS class definition
+    """
+    BALANCETHICKNESS class definition
 
-	   Usage:
-	      balancethickness=balancethickness();
-	"""
+       Usage:
+          balancethickness = balancethickness()
+    """
 
-	def __init__(self): # {{{
-		self.spcthickness      = float('NaN')
-		self.thickening_rate   = float('NaN')
-		self.stabilization     = 0
-		
-		self.omega	       = float('NaN')
-		self.slopex	       = float('NaN')
-		self.slopey	       = float('NaN')
+    def __init__(self):  # {{{
+        self.spcthickness = float('NaN')
+        self.thickening_rate = float('NaN')
+        self.stabilization = 0
+        self.omega = float('NaN')
+        self.slopex = float('NaN')
+        self.slopey = float('NaN')
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		
-		string='   balance thickness solution parameters:' 
-		
-		string="%s\n%s"%(string,fielddisplay(self,'spcthickness','thickness constraints (NaN means no constraint) [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'thickening_rate','ice thickening rate used in the mass conservation (dh/dt) [m/yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'stabilization',"0: None, 1: SU, 2: SSA's artificial diffusivity, 3:DG"))
-		return string
-		#}}}
-	def setdefaultparameters(self): # {{{
-		
-		#Type of stabilization used
-		self.stabilization=1
+    #}}}
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		#Early return
-		if not solution=='BalancethicknessSolution':
-			return md
+    def __repr__(self):  # {{{
+        string = '   balance thickness solution parameters:'
 
-		md = checkfield(md,'fieldname','balancethickness.spcthickness')
-		md = checkfield(md,'fieldname','balancethickness.thickening_rate','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','balancethickness.stabilization','size',[1],'values',[0,1,2,3])
-		#md = checkfield(md,'fieldname','balancethickness.omega','size', [md.mesh.numberofvertices],'NaN',1,'Inf',1,'>=',0);
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+        string = "%s\n%s" % (string, fielddisplay(self, 'spcthickness', 'thickness constraints (NaN means no constraint) [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'thickening_rate', 'ice thickening rate used in the mass conservation (dh / dt) [m / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'stabilization', "0: None, 1: SU, 2: SSA's artificial diffusivity, 3:DG"))
+        return string
+    #}}}
 
-		yts=md.constants.yts
+    def setdefaultparameters(self):  # {{{
+        #Type of stabilization used
+        self.stabilization = 1
+        return self
+    #}}}
 
-		WriteData(fid,prefix,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','thickening_rate','format','DoubleMat','mattype',1,'scale',1./yts)
-		WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','slopex','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','slopey','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','omega','format','DoubleMat','mattype',1)
-	# }}}
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if not solution == 'BalancethicknessSolution':
+            return md
+
+        md = checkfield(md, 'fieldname', 'balancethickness.spcthickness')
+        md = checkfield(md, 'fieldname', 'balancethickness.thickening_rate', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'balancethickness.stabilization', 'size', [1], 'values', [0, 1, 2, 3])
+    #md = checkfield(md, 'fieldname', 'balancethickness.omega', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1, '>=', 0)
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'spcthickness', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'thickening_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'stabilization', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'slopex', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'slopey', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'omega', 'format', 'DoubleMat', 'mattype', 1)
+    # }}}
Index: /issm/trunk/src/m/classes/bamggeom.py
===================================================================
--- /issm/trunk/src/m/classes/bamggeom.py	(revision 24312)
+++ /issm/trunk/src/m/classes/bamggeom.py	(revision 24313)
@@ -1,45 +1,47 @@
 import numpy as np
 
+
 class bamggeom(object):
-	"""
-	BAMGGEOM class definition
+    """
+    BAMGGEOM class definition
 
-	   Usage:
-	      bamggeom(varargin)
-	"""
+       Usage:
+          bamggeom(varargin)
+    """
 
-	def __init__(self,*args):    # {{{
-		self.Vertices=np.empty((0,3))
-		self.Edges=np.empty((0,3))
-		self.TangentAtEdges=np.empty((0,4))
-		self.Corners=np.empty((0,1))
-		self.RequiredVertices=np.empty((0,1))
-		self.RequiredEdges=np.empty((0,1))
-		self.CrackedEdges=np.empty((0,0))
-		self.SubDomains=np.empty((0,4))
+    def __init__(self, *args):  # {{{
+        self.Vertices = np.empty((0, 3))
+        self.Edges = np.empty((0, 3))
+        self.TangentAtEdges = np.empty((0, 4))
+        self.Corners = np.empty((0, 1))
+        self.RequiredVertices = np.empty((0, 1))
+        self.RequiredEdges = np.empty((0, 1))
+        self.CrackedEdges = np.empty((0, 0))
+        self.SubDomains = np.empty((0, 4))
 
-		if not len(args):
-			# if no input arguments, create a default object
-			pass
+        if not len(args):
+            # if no input arguments, create a default object
+            pass
 
-		elif len(args) == 1:
-			object=args[0]
-			for field in object.iterkeys():
-				if field in vars(self):
-					setattr(self,field,object[field])
+        elif len(args) == 1:
+            object = args[0]
+            for field in list(object.keys()):
+                if field in vars(self):
+                    setattr(self, field, object[field])
 
-		else:
-			raise TypeError("bamggeom constructor error message: unknown type of constructor call")
-	# }}}
-	def __repr__(self):    # {{{
-		s ="class '%s' object '%s' = \n" % (type(self),'self')
-		s+="    Vertices: %s\n" % str(self.Vertices)
-		s+="    Edges: %s\n" % str(self.Edges)
-		s+="    TangentAtEdges: %s\n" % str(self.TangentAtEdges)
-		s+="    Corners: %s\n" % str(self.Corners)
-		s+="    RequiredVertices: %s\n" % str(self.RequiredVertices)
-		s+="    RequiredEdges: %s\n" % str(self.RequiredEdges)
-		s+="    CrackedEdges: %s\n" % str(self.CrackedEdges)
-		s+="    SubDomains: %s\n" % str(self.SubDomains)
-		return s
-	# }}}
+        else:
+            raise TypeError("bamggeom constructor error message: unknown type of constructor call")
+    # }}}
+
+    def __repr__(self):  # {{{
+        s = "class '%s' object '%s'=\n" % (type(self), 'self')
+        s += "    Vertices: %s\n" % str(self.Vertices)
+        s += "    Edges: %s\n" % str(self.Edges)
+        s += "    TangentAtEdges: %s\n" % str(self.TangentAtEdges)
+        s += "    Corners: %s\n" % str(self.Corners)
+        s += "    RequiredVertices: %s\n" % str(self.RequiredVertices)
+        s += "    RequiredEdges: %s\n" % str(self.RequiredEdges)
+        s += "    CrackedEdges: %s\n" % str(self.CrackedEdges)
+        s += "    SubDomains: %s\n" % str(self.SubDomains)
+        return s
+    # }}}
Index: /issm/trunk/src/m/classes/bamgmesh.py
===================================================================
--- /issm/trunk/src/m/classes/bamgmesh.py	(revision 24312)
+++ /issm/trunk/src/m/classes/bamgmesh.py	(revision 24313)
@@ -1,59 +1,61 @@
 import numpy as np
 
+
 class bamgmesh(object):
-	"""
-	BAMGMESH class definition
+    """
+    BAMGMESH class definition
 
-	   Usage:
-	      bamgmesh(varargin)
-	"""
+       Usage:
+          bamgmesh(varargin)
+    """
 
-	def __init__(self,*args):    # {{{
-		self.Vertices=np.empty((0,3))
-		self.Edges=np.empty((0,3))
-		self.Triangles=np.empty((0,0))
-		self.IssmEdges=np.empty((0,0))
-		self.IssmSegments=np.empty((0,0))
-		self.VerticesOnGeomVertex=np.empty((0,0))
-		self.VerticesOnGeomEdge=np.empty((0,0))
-		self.EdgesOnGeomEdge=np.empty((0,0))
-		self.SubDomains=np.empty((0,4))
-		self.SubDomainsFromGeom=np.empty((0,0))
-		self.ElementConnectivity=np.empty((0,0))
-		self.NodalConnectivity=np.empty((0,0))
-		self.NodalElementConnectivity=np.empty((0,0))
-		self.CrackedVertices=np.empty((0,0))
-		self.CrackedEdges=np.empty((0,0))
+    def __init__(self, *args):  # {{{
+        self.Vertices = np.empty((0, 3))
+        self.Edges = np.empty((0, 3))
+        self.Triangles = np.empty((0, 0))
+        self.IssmEdges = np.empty((0, 0))
+        self.IssmSegments = np.empty((0, 0))
+        self.VerticesOnGeomVertex = np.empty((0, 0))
+        self.VerticesOnGeomEdge = np.empty((0, 0))
+        self.EdgesOnGeomEdge = np.empty((0, 0))
+        self.SubDomains = np.empty((0, 4))
+        self.SubDomainsFromGeom = np.empty((0, 0))
+        self.ElementConnectivity = np.empty((0, 0))
+        self.NodalConnectivity = np.empty((0, 0))
+        self.NodalElementConnectivity = np.empty((0, 0))
+        self.CrackedVertices = np.empty((0, 0))
+        self.CrackedEdges = np.empty((0, 0))
 
-		if not len(args):
-			# if no input arguments, create a default object
-			pass
+        if not len(args):
+            # if no input arguments, create a default object
+            pass
 
-		elif len(args) == 1:
-			object=args[0]
-			for field in object.iterkeys():
-				if field in vars(self):
-					setattr(self,field,object[field])
+        elif len(args) == 1:
+            object = args[0]
+            for field in list(object.keys()):
+                if field in vars(self):
+                    setattr(self, field, object[field])
 
-		else:
-			raise TypeError("bamgmesh constructor error message: unknown type of constructor call")
-	# }}}
-	def __repr__(self):    # {{{
-		s ="class '%s' object '%s' = \n" % (type(self),'self')
-		s+="    Vertices: %s\n" % str(self.Vertices)
-		s+="    Edges: %s\n" % str(self.Edges)
-		s+="    Triangles: %s\n" % str(self.Triangles)
-		s+="    IssmEdges: %s\n" % str(self.IssmEdges)
-		s+="    IssmSegments: %s\n" % str(self.IssmSegments)
-		s+="    VerticesOnGeomVertex: %s\n" % str(self.VerticesOnGeomVertex)
-		s+="    VerticesOnGeomEdge: %s\n" % str(self.VerticesOnGeomEdge)
-		s+="    EdgesOnGeomEdge: %s\n" % str(self.EdgesOnGeomEdge)
-		s+="    SubDomains: %s\n" % str(self.SubDomains)
-		s+="    SubDomainsFromGeom: %s\n" % str(self.SubDomainsFromGeom)
-		s+="    ElementConnectivity: %s\n" % str(self.ElementConnectivity)
-		s+="    NodalConnectivity: %s\n" % str(self.NodalConnectivity)
-		s+="    NodalElementConnectivity: %s\n" % str(self.NodalElementConnectivity)
-		s+="    CrackedVertices: %s\n" % str(self.CrackedVertices)
-		s+="    CrackedEdges: %s\n" % str(self.CrackedEdges)
-		return s
-	# }}}
+        else:
+            raise TypeError("bamgmesh constructor error message: unknown type of constructor call")
+    # }}}
+
+    def __repr__(self):  # {{{
+        s = "class '%s' object '%s' = \n" % (type(self), 'self')
+        s += "    Vertices: %s\n" % str(self.Vertices)
+        s += "    Edges: %s\n" % str(self.Edges)
+        s += "    Triangles: %s\n" % str(self.Triangles)
+        s += "    IssmEdges: %s\n" % str(self.IssmEdges)
+        s += "    IssmSegments: %s\n" % str(self.IssmSegments)
+        s += "    VerticesOnGeomVertex: %s\n" % str(self.VerticesOnGeomVertex)
+        s += "    VerticesOnGeomEdge: %s\n" % str(self.VerticesOnGeomEdge)
+        s += "    EdgesOnGeomEdge: %s\n" % str(self.EdgesOnGeomEdge)
+        s += "    SubDomains: %s\n" % str(self.SubDomains)
+        s += "    SubDomainsFromGeom: %s\n" % str(self.SubDomainsFromGeom)
+        s += "    ElementConnectivity: %s\n" % str(self.ElementConnectivity)
+        s += "    NodalConnectivity: %s\n" % str(self.NodalConnectivity)
+        s += "    NodalElementConnectivity: %s\n" % str(self.NodalElementConnectivity)
+        s += "    CrackedVertices: %s\n" % str(self.CrackedVertices)
+        s += "    CrackedEdges: %s\n" % str(self.CrackedEdges)
+        return s
+    # }}}
Index: /issm/trunk/src/m/classes/basalforcings.py
===================================================================
--- /issm/trunk/src/m/classes/basalforcings.py	(revision 24312)
+++ /issm/trunk/src/m/classes/basalforcings.py	(revision 24313)
@@ -5,77 +5,83 @@
 import numpy as np
 
+
 class basalforcings(object):
-	"""
-	BASAL FORCINGS class definition
+    """
+    BASAL FORCINGS class definition
 
-	   Usage:
-	      basalforcings=basalforcings();
-	"""
+       Usage:
+          basalforcings = basalforcings()
+    """
 
-	def __init__(self): # {{{
-		self.groundedice_melting_rate  = float('NaN')
-		self.floatingice_melting_rate  = float('NaN')
-		self.geothermalflux            = float('NaN')
+    def __init__(self):  # {{{
+        self.groundedice_melting_rate = float('NaN')
+        self.floatingice_melting_rate = float('NaN')
+        self.geothermalflux = float('NaN')
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		string="   basal forcings parameters:"
+    #}}}
 
-		string="%s\n%s"%(string,fielddisplay(self,"groundedice_melting_rate","basal melting rate (positive if melting) [m/yr]"))
-		string="%s\n%s"%(string,fielddisplay(self,"floatingice_melting_rate","basal melting rate (positive if melting) [m/yr]"))
-		string="%s\n%s"%(string,fielddisplay(self,"geothermalflux","geothermal heat flux [W/m^2]"))
-		return string
-		#}}}
-	def 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
-		return self
-	#}}}
-	def initialize(self,md): # {{{
+    def __repr__(self):  # {{{
+        string = "   basal forcings parameters:"
 
-		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"
+        string = "%s\n%s" % (string, fielddisplay(self, "groundedice_melting_rate", "basal melting rate (positive if melting) [m / yr]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "floatingice_melting_rate", "basal melting rate (positive if melting) [m / yr]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "geothermalflux", "geothermal heat flux [W / m^2]"))
+        return string
+    #}}}
 
-		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"
-		#if np.all(np.isnan(self.geothermalflux)):
-			#self.geothermalflux=np.zeros((md.mesh.numberofvertices))
-			#print "      no basalforcings.geothermalflux specified: values set as zero"
+    def 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
+        return self
+    #}}}
 
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+    def initialize(self, md):  # {{{
+        if np.all(np.isnan(self.groundedice_melting_rate)):
+            self.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices))
+            print("      no basalforcings.groundedice_melting_rate specified: values set as zero")
 
-		if 'MasstransportAnalysis' in analyses and not (solution=='TransientSolution' and not md.transient.ismasstransport):
-			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1)
-			md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'Inf',1,'timeseries',1)
+        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")
+    #if np.all(np.isnan(self.geothermalflux)):
+    #self.geothermalflux = np.zeros((md.mesh.numberofvertices))
+    #print "      no basalforcings.geothermalflux specified: values set as zero"
 
-		if 'BalancethicknessAnalysis' in analyses:
-			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-			md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
+        return self
+    #}}}
 
-		if 'ThermalAnalysis' in analyses and not (solution=='TransientSolution' and not md.transient.isthermal):
-			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1)
-			md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'Inf',1,'timeseries',1)
-			md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'timeseries',1,'>=',0)
+    def setdefaultparameters(self):  # {{{
+        return self
+    #}}}
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+    def checkconsistency(self, md, solution, analyses):  # {{{
 
-		yts=md.constants.yts
+        if 'MasstransportAnalysis' in analyses and not (solution == 'TransientSolution' and not md.transient.ismasstransport):
+            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.floatingice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
 
-		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)
-	# }}}
+        if 'BalancethicknessAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'basalforcings.floatingice_melting_rate', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+
+        if 'ThermalAnalysis' in analyses and not (solution == 'TransientSolution' and not md.transient.isthermal):
+            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.floatingice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.geothermalflux', 'NaN', 1, 'Inf', 1, 'timeseries', 1, '>=', 0)
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+
+        yts = md.constants.yts
+
+        WriteData(fid, prefix, 'name', 'md.basalforcings.model', 'data', 1, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundedice_melting_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'floatingice_melting_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'geothermalflux', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+    # }}}
Index: /issm/trunk/src/m/classes/basalforcingsbeckmanngoosse.m
===================================================================
--- /issm/trunk/src/m/classes/basalforcingsbeckmanngoosse.m	(revision 24313)
+++ /issm/trunk/src/m/classes/basalforcingsbeckmanngoosse.m	(revision 24313)
@@ -0,0 +1,110 @@
+%MISMIP BASAL FORCINGS class definition
+%
+%   Usage:
+%      basalforcingsbeckmanngoosse=basalforcingsbeckmanngoosse();
+
+classdef basalforcingsbeckmanngoosse
+	properties (SetAccess=public) 
+		groundedice_melting_rate  = NaN;
+		geothermalflux            = NaN;
+		meltrate_factor           = NaN;
+		ocean_temp                = NaN;
+		ocean_salinity            = NaN;
+	end
+	methods
+		function createxml(self,fid) % {{{
+			fprintf(fid, '\n\n');
+			fprintf(fid, '%s\n', '<!-- basalforcings -->');
+		        fprintf(fid,'%s%s%s%s%s\n%s\n%s\n','<parameter key ="geothermalflux" type="',class(self.geothermalflux),'" default="',num2str(self.geothermalflux),'">', '     <section name="basalforcings" />','     <help> geothermal heat flux [W/m^2] </help>','</parameter>');
+			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','<parameter key ="melting_rate" type="',class(self.melting_rate),'" default="',num2str(self.melting_rate),'">','     <section name="basalforcings" />','     <help> basal melting rate (positive if melting) [m/yr] </help>','</parameter>');
+			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','<parameter key ="ocean_temp" type="',class(self.ocean_temp),'" default="',num2str(self.ocean_temp),'">','     <section name="basalforcings" />','     <help> ocean_temp [degC] </help>','</parameter>');
+		        fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','<parameter key ="ocean_salinity" type="',class(self.ocean_salinity),'" default="',num2str(self.ocean_salinity),'">','     <section name="basalforcings" />','     <help> ocean_salinity [psu] </help>','</parameter>');
+        	end % }}}
+		function self = extrude(self,md) % {{{
+			self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_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 = basalforcingsbeckmanngoosse(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				case 1
+					self=structtoobj(basalforcingsbeckmanngoosse(),varargin{1});
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function self = initialize(self,md) % {{{
+
+			if isnan(self.groundedice_melting_rate),
+				self.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+				disp('      no basalforcings.groundedice_melting_rate specified: values set as zero');
+			end
+			if isnan(self.ocean_temp),
+				self.ocean_temp=-1.7*ones(md.mesh.numberofvertices,1);
+				disp('      no basalforcings.ocean_temp specified: values set as -1.7degC');
+			end
+			if isnan(self.ocean_salinity),
+				self.ocean_salinity=35.0*ones(md.mesh.numberofvertices,1);
+				disp('      no basalforcings.ocean_salinity specified: values set as 35 psu');
+			end
+
+
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+
+			%default values for melting parameterization
+			self.meltrate_factor        = 0.5;
+
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			if ismember('MasstransportAnalysis',analyses) & ~(solution=='TransientSolution' & md.transient.ismasstransport==0),
+				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
+				md = checkfield(md,'fieldname','basalforcings.ocean_temp','NaN',1,'Inf',1,'timeseries',1);
+				md = checkfield(md,'fieldname','basalforcings.ocean_salinity','NaN',1,'Inf',1,'timeseries',1);	
+				md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'numel',1);
+			end
+			if ismember('BalancethicknessAnalysis',analyses),
+				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+				md = checkfield(md,'fieldname','basalforcings.ocean_temp','NaN',1,'Inf',1,'timeseries',1);
+				md = checkfield(md,'fieldname','basalforcings.ocean_salinity','NaN',1,'Inf',1,'timeseries',1);
+				md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'numel',1);
+			end
+			if ismember('ThermalAnalysis',analyses) & ~(solution=='TransientSolution' & md.transient.isthermal==0),
+				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
+				md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'numel',1);
+				md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'timeseries',1,'>=',0);
+			end
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   Beckmann & Goosse (2003) basal melt parameterization:'));
+
+			fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) (m/yr)');
+			fielddisplay(self,'geothermalflux','geothermal heat flux (W/m^2)');
+			fielddisplay(self,'meltrate_factor','Melt-rate rate factor');
+			fielddisplay(self,'ocean_temp','ocean temperature (degC)');
+			fielddisplay(self,'ocean_salinity','ocean ocean_salinity (psu)');
+
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+
+			yts=365.2422*24.0*3600.0;
+
+			floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+			T_f=(0.0939 - 0.057 * md.basalforcings.ocean_salinity + 7.64e-4 * md.geometry.base);
+			ocean_heat_flux = 1.5 * md.materials.rho_water * md.materials.mixed_layer_capacity * md.materials.thermal_exchange_velocity  * (md.basalforcings.ocean_temp - T_f);
+			floatingice_melting_rate=ocean_heat_flux/(md.materials.latentheat*md.materials.rho_ice);
+
+
+WriteData(fid,prefix,'name','md.basalforcings.model','data',8,'format','Integer');
+			WriteData(fid,prefix,'data',floatingice_melting_rate,'format','DoubleMat','name','md.basalforcings.floatingice_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)
+			WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','name','md.basalforcings.groundedice_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)
+			WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','name','md.basalforcings.geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);
+			WriteData(fid,prefix,'object',self,'fieldname','meltrate_factor','format','Double','name','md.basalforcings.meltrate_factor');
+			WriteData(fid,prefix,'object',self,'fieldname','ocean_temp','format','DoubleMat','name','md.basalforcings.ocean_temp','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);
+			WriteData(fid,prefix,'object',self,'fieldname','ocean_salinity','format','DoubleMat','name','md.basalforcings.ocean_salinity','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);
+
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/basalforcingsismip6.m
===================================================================
--- /issm/trunk/src/m/classes/basalforcingsismip6.m	(revision 24313)
+++ /issm/trunk/src/m/classes/basalforcingsismip6.m	(revision 24313)
@@ -0,0 +1,107 @@
+%ISMIP6 BASAL FORCINGS class definition
+%
+%   Usage:
+%      basalforcingsismip6=basalforcingsismip6();
+
+classdef basalforcingsismip6
+	properties (SetAccess=public) 
+		num_basins                = 0;
+		basin_id                  = NaN;
+		gamma_0                   = 0.;
+		tf                        = NaN;
+		tf_depths                 = NaN;
+		delta_t                   = NaN;
+		islocal                   = 0;
+		geothermalflux            = NaN;
+		groundedice_melting_rate  = NaN;
+		melt_anomaly              = NaN;
+	end
+	methods
+		function self = extrude(self,md) % {{{
+			self.basin_id=project3d(md,'vector',self.basin_id,'type','element','layer',1);
+			%self.tf=project3d(md,'vector',self.tf,'type','element','layer',1);
+			%self.delta_t=project3d(md,'vector',self.delta_t,'type','element','layer',1);
+			self.tf=project3d(md,'vector',self.tf,'type','node');
+			self.geothermalflux=project3d(md,'vector',self.geothermalflux,'type','element','layer',1); %bedrock only gets geothermal flux
+			self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_melting_rate,'type','node','layer',1);
+			self.melt_anomaly=project3d(md,'vector',self.melt_anomaly,'type','element','layer',1); %bedrock only gets geothermal flux
+		end % }}}
+		function self = basalforcingsismip6(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				case 1
+					self=setdefaultparameters(self);
+					self=structtoobj(self,varargin{1});
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function self = initialize(self,md) % {{{
+			if self.gamma_0 == 0,
+				self.gamma_0 = 14477;
+				disp('      no basalforcings.gamma_0 specified: value set to 14477 m/yr');
+			end
+			if isnan(self.groundedice_melting_rate),
+				self.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+				disp('      no basalforcings.groundedice_melting_rate specified: values set as zero');
+			end
+
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+			self.gamma_0 = 14477; %m/yr
+			self.islocal = false;
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			md = checkfield(md,'fieldname','basalforcings.num_basins','numel',1,'NaN',1,'Inf',1,'>',0);
+			md = checkfield(md,'fieldname','basalforcings.basin_id','Inf',1,'>=',0,'<=',md.basalforcings.num_basins,'size',[md.mesh.numberofelements 1]);
+			md = checkfield(md,'fieldname','basalforcings.gamma_0','numel',1,'NaN',1,'Inf',1,'>',0);
+			md = checkfield(md,'fieldname','basalforcings.tf_depths','NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','basalforcings.delta_t','NaN',1,'Inf',1,'numel',md.basalforcings.num_basins);
+			md = checkfield(md,'fieldname','basalforcings.islocal','values',[0 1]);
+			md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'>=',0,'timeseries',1);
+			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
+			if length(md.basalforcings.melt_anomaly)>1,
+				md = checkfield(md,'fieldname','basalforcings.melt_anomaly','NaN',1,'Inf',1,'timeseries',1);
+			end
+
+			md = checkfield(md,'fieldname','basalforcings.tf','size',[1,1,numel(md.basalforcings.tf_depths)]);
+			for i=1:numel(md.basalforcings.tf_depths)
+				md = checkfield(md,'fieldname',['basalforcings.tf{' num2str(i) '}'],'field',md.basalforcings.tf{i},'size',[md.mesh.numberofvertices+1 NaN],'NaN',1,'Inf',1,'>=',0,'timeseries',1);
+			end
+
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   ISMIP6 basal melt rate parameterization:'));
+			fielddisplay(self,'num_basins','number of basins the model domain is partitioned into [unitless]');
+			fielddisplay(self,'basin_id','basin number assigned to each node (unitless)');
+			fielddisplay(self,'gamma_0','melt rate coefficient (m/yr)');
+			fielddisplay(self,'tf_depths','Number of vertical layers in ocean thermal forcing dataset');
+			fielddisplay(self,'tf','thermal forcing (ocean temperature minus freezing point) (degrees C)');
+			fielddisplay(self,'delta_t','Ocean temperature correction per basin (degrees C)');
+			fielddisplay(self,'islocal','boolean to use the local version of the ISMIP6 melt rate parameterization (default false)');
+			fielddisplay(self,'geothermalflux','geothermal heat flux (W/m^2)');
+			fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) (m/yr)');
+			fielddisplay(self,'melt_anomaly','floating ice basal melt anomaly (m/yr)');
+
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+
+			yts=md.constants.yts;
+
+			WriteData(fid,prefix,'name','md.basalforcings.model','data',7,'format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','num_basins','format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','basin_id','data',self.basin_id-1,'name','md.basalforcings.basin_id','format','IntMat','mattype',2);   %0-indexed
+			WriteData(fid,prefix,'object',self,'fieldname','gamma_0','format','Double','scale',1./yts);
+			WriteData(fid,prefix,'object',self,'fieldname','tf_depths','format','DoubleMat','name','md.basalforcings.tf_depths');
+			WriteData(fid,prefix,'object',self,'fieldname','tf','format','MatArray','name','md.basalforcings.tf','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'fieldname','delta_t','format','DoubleMat','name','md.basalforcings.delta_t','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'fieldname','islocal','format','Boolean');
+			WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','format','DoubleMat','name','md.basalforcings.geothermalflux','mattype',1,'timeserieslength',md.mesh.numberofelements+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',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'fieldname','melt_anomaly','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/basalforcingspico.m
===================================================================
--- /issm/trunk/src/m/classes/basalforcingspico.m	(revision 24312)
+++ /issm/trunk/src/m/classes/basalforcingspico.m	(revision 24313)
@@ -13,5 +13,5 @@
 		farocean_temperature      = NaN;
 		farocean_salinity         = NaN;
-		isplume                   = NaN;
+		isplume                   = 0;
 		geothermalflux            = NaN;
 		groundedice_melting_rate  = NaN;
@@ -68,5 +68,5 @@
 				md = checkfield(md,'fieldname','basalforcings.overturning_coeff','numel',1,'NaN',1,'Inf',1,'>',0);
 				md = checkfield(md,'fieldname','basalforcings.gamma_T','numel',1,'NaN',1,'Inf',1,'>',0);
-				md = checkfield(md,'fieldname','basalforcings.farocean_temperature','NaN',1,'Inf',1,'>',0,'size',[md.basalforcings.num_basins+1 NaN]);
+				md = checkfield(md,'fieldname','basalforcings.farocean_temperature','NaN',1,'Inf',1,'size',[md.basalforcings.num_basins+1 NaN]);
 				md = checkfield(md,'fieldname','basalforcings.farocean_salinity','NaN',1,'Inf',1,'>',0,'size',[md.basalforcings.num_basins+1 NaN]);
 				md = checkfield(md,'fieldname','basalforcings.isplume','values',[0 1]);
Index: /issm/trunk/src/m/classes/basin.m
===================================================================
--- /issm/trunk/src/m/classes/basin.m	(revision 24313)
+++ /issm/trunk/src/m/classes/basin.m	(revision 24313)
@@ -0,0 +1,177 @@
+%BASIN class definition
+%
+%   Usage:
+%      basin=basin();
+
+classdef basin
+	properties (SetAccess=public) 
+		boundaries        = {};
+		epsg              = 3426;
+		name              = '';
+		continent         = '';
+	end
+	methods (Static)
+		function self = loadobj(self) % {{{
+			% This function is directly called by matlab when a model object is
+			% loaded. Update old properties here
+		end% }}}
+	end
+	methods
+		function self = basin(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				otherwise
+
+					self=setdefaultparameters(self);
+					options=pairoptions(varargin{:}); 
+			
+					%recover field values: 
+					self.boundaries=getfieldvalue(options,'boundaries',{});
+					self.name=getfieldvalue(options,'name','');
+					self.continent=getfieldvalue(options,'continent','');
+					self.epsg=getfieldvalue(options,'epsg',3426);
+			end
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+			self.name='';
+			self.continent='';
+			self.epsg=3426;
+			self.boundaries={};
+
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   basin parameters:'));
+			fielddisplay(self,'continent','continent name');
+			fielddisplay(self,'name','basin name');
+			fielddisplay(self,'epsg','epsg projection number for the entire basin');
+			fielddisplay(self,'boundaries','list of boundary objects');
+			for i=1:length(self.boundaries),
+				disp(sprintf('             boundary #%i: %s',i,self.boundaries{i}.name));
+			end
+
+		end % }}}
+		function boolean=isnameany(self,varargin) % {{{
+			boolean=0;
+			for  i=1:length(varargin),
+				if strcmpi(self.name,varargin{i}), 
+					boolean=1;
+					break;
+				end
+			end
+		end % }}}
+		function boolean=iscontinentany(self,varargin) % {{{
+			boolean=0;
+			for  i=1:length(varargin),
+				if strcmpi(self.continent,varargin{i}), 
+					boolean=1;
+					break;
+				end
+			end
+		end % }}}
+		function output=outputname(self,varargin) % {{{
+		
+			%recover options
+			options=pairoptions(varargin{:});
+			extension=getfieldvalue(options,'extension',1);
+
+			[path,nme,ext]=fileparts(self.name);
+			if extension,
+				output=[nme ext];
+			else
+				output=nme;
+			end
+		end % }}}
+		function plot(self,varargin) % {{{
+	
+			%add option: 
+			for i=1:length(self.boundaries),
+				self.boundaries{i}.plot('epsg',self.epsg,varargin{:});
+			end
+
+		end % }}}
+		function plot3d(self,varargin) % {{{
+	
+			%add option: 
+			for i=1:length(self.boundaries),
+				self.boundaries{i}.plot3d(varargin{:});
+			end
+
+		end % }}}
+		function out=contour(self,varargin) % {{{
+		
+			%recover options
+			options=pairoptions(varargin{:});
+			x=[]; y=[];
+
+			%go through boundaries, recover edges and project them in the basin epsg reference frame: 
+			for i=1:length(self.boundaries),
+				boundary=self.boundaries{i};
+				contour=boundary.edges();
+				[contour.x,contour.y]=gdaltransform(contour.x,contour.y,sprintf('EPSG:%i',boundary.epsg),sprintf('EPSG:%i',self.epsg));
+				x=[x;contour.x];
+				y=[y;contour.y];
+			end
+			%close the contour: 
+			if x(end)~=x(1) | y(end)~=y(1), 
+				x(end)=x(1); y(end)=y(1);
+			end
+
+			out.x=x;
+			out.y=y;
+			out.nods=length(x);
+		end % }}}
+		function output=shapefilecrop(self,varargin) % {{{
+
+			%recover options
+			options=pairoptions(varargin{:});
+			threshold=getfieldvalue(options,'threshold',.65); %.65 degrees lat,long
+			inshapefile=getfieldvalue(options,'shapefile');
+			outputshapefile=getfieldvalue(options,'outputshapefile','');
+			epsgshapefile=getfieldvalue(options,'epsgshapefile');
+
+			%create list of contours that have critical length > threshold:  (in lat,long)
+			contours=shpread(inshapefile);
+			llist=[];
+			for i=1:length(contours),
+				contour=contours(i);
+				carea=polyarea(contour.x,contour.y);
+				clength=sqrt(carea);
+				if clength<threshold,
+					llist=[llist;i];
+				end
+			end
+			contours(llist)=[];
+
+			%project onto reference frame:
+			if self.epsg~=epsgshapefile,
+				for i=1:length(contours),
+					h=contours(i);
+					[h.x,h.y]=gdaltransform(h.x,h.y,sprintf('EPSG:%i',epsgshapefile),sprintf('EPSG:%i',self.epsg));
+					contours(i).x=h.x;
+					contours(i).y=h.y;
+				end
+			end
+
+			%only keep the contours that are inside the basin (take centroids): 
+			ba=self.contour();
+			flags=zeros(length(contours),1);
+			for i=1:length(contours),
+				h=contours(i); 
+				in=inpolygon(h.x,h.y,ba.x,ba.y); 
+				if ~isempty(find(in==0)),
+					flags(i)=1;
+				end
+			end
+			pos=find(flags);  contours(pos)=[];
+
+			%Two options: 
+			if strcmpi(outputshapefile,''),
+				output=contours;
+			else
+				shpwrite(contours,outputshapefile);
+			end
+
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/boundary.m
===================================================================
--- /issm/trunk/src/m/classes/boundary.m	(revision 24313)
+++ /issm/trunk/src/m/classes/boundary.m	(revision 24313)
@@ -0,0 +1,213 @@
+%BOUNDARY class definition
+%
+%   Usage:
+%      boundary=boundary();
+
+classdef boundary
+	properties (SetAccess=public) 
+		shppath           = '';
+		shpfilename       = '';
+		orientation       = 'normal';  %other value is 'reverse'
+		epsg              = 4326; %EPSG number, default value is WGS 84 Lat,Long reference frame.
+	end
+	methods (Static)
+		function self = loadobj(self) % {{{
+			% This function is directly called by matlab when a model object is
+			% loaded. Update old properties here
+		end% }}}
+	end
+	methods
+		function self = boundary(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				otherwise
+					self=setdefaultparameters(self);
+					options=pairoptions(varargin{:}); 
+			
+					%recover field values: 
+					self.shppath=getfieldvalue(options,'shppath','');
+					self.shpfilename=getfieldvalue(options,'shpfilename','');
+					self.orientation=getfieldvalue(options,'orientation','normal');
+					self.epsg=getfieldvalue(options,'epsg',4326);
+			end
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+		self.shppath='';
+		self.shpfilename='';
+		self.orientation='normal';
+		self.epsg=4326;
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   boundary parameters:'));
+
+			fielddisplay(self,'shppath','path to filename for this boundary');
+			fielddisplay(self,'shpfilename','shape file name');
+			fielddisplay(self,'orientation','orientation (default is ''normal'', can be ''reverse'')');
+			fielddisplay(self,'epsg','EPSG number defining projection for the shape file');
+
+		end % }}}
+		function output=name(self) % {{{
+			output=self.shpfilename;
+		end % }}}
+		function output=edges(self) % {{{
+		
+		%read domain:
+		[path,name,ext]=fileparts(self.shpfilename);
+		if ~strcmpi(ext,'shp'),
+			ext='shp';
+		end
+		output=shpread([self.shppath '/' name '.' ext]);
+
+		%do we reverse? 
+		if strcmpi(self.orientation,'reverse'),
+			output.x=flipud(output.x);
+			output.y=flipud(output.y);
+		end
+		end % }}}
+		function plot(self,varargin) % {{{
+			%recover options
+		
+			options=pairoptions(varargin{:});
+
+			%parse input:
+			figurenumber=getfieldvalue(options,'figure',1);
+			color=getfieldvalue(options,'color','r');
+			linewidth=getfieldvalue(options,'linewidth',1);
+			markersize=getfieldvalue(options,'markersize',1);
+			unitmultiplier=getfieldvalue(options,'unit',1);
+			epsg=getfieldvalue(options,'epsg',4326);
+			radius=getfieldvalue(options,'radius',6371012);
+			aboveground=getfieldvalue(options,'aboveground',1000);
+			offset=getfieldvalue(options,'offset',.1);
+			fontsize=getfieldvalue(options,'fontsize',10);
+
+			%read domain:
+			[path,name,ext]=fileparts(self.shpfilename);
+			if ~strcmpi(ext,'shp'),
+				ext='shp';
+			end
+			domain=shpread([self.shppath '/' name '.' ext]);
+
+			%convert boundary to another reference frame:  {{{
+
+			for i=1:length(domain),
+				try, 
+					[x,y] = gdaltransform(domain(i).x,domain(i).y,sprintf('EPSG:%i',self.epsg),sprintf('EPSG:%i',epsg));
+				catch me
+					disp(me.message());
+					self.disp();
+				end
+				domain(i).x=x; domain(i).y=y;
+			end
+
+			for i=1:length(domain),
+				hold on;
+				if length(x)==1,
+					p=plot(x,y,'k*'); 
+					set(p,'MarkerSize',markersize);
+					t=text(x,y,self.shpfilename,'FontSize',fontsize);
+				else
+					p=plot(x,y,'k-'); 
+					text(sum(x)/length(x),sum(y)/length(y),self.shpfilename,'FontSize',fontsize);
+				end
+				set(p,'Color',color);
+				set(p,'LineWidth',linewidth);
+			end
+			%}}}
+		end % }}}
+		function plot3d(self,varargin) % {{{
+			%recover options
+		
+			options=pairoptions(varargin{:});
+
+			%parse input:
+			figurenumber=getfieldvalue(options,'figure',1);
+			color=getfieldvalue(options,'color','r');
+			linewidth=getfieldvalue(options,'linewidth',1);
+			markersize=getfieldvalue(options,'markersize',1);
+			unitmultiplier=getfieldvalue(options,'unit',1);
+			epsg=getfieldvalue(options,'epsg',4326);
+			radius=getfieldvalue(options,'radius',6371012);
+			aboveground=getfieldvalue(options,'aboveground',1000);
+			offset=getfieldvalue(options,'offset',.1);
+			fontsize=getfieldvalue(options,'fontsize',10);
+
+			%read domain:
+			[path,name,ext]=fileparts(self.shpfilename);
+			if ~strcmpi(ext,'shp'),
+				ext='shp';
+			end
+			domain=shpread([self.shppath '/' name '.' ext]);
+
+			if epsg==4326,
+				%convert boundary to lat,long: {{{
+
+				for i=1:length(domain),
+					try, 
+						[lat,long] = gdaltransform(domain(i).x,domain(i).y,sprintf('EPSG:%i',self.epsg),'EPSG:4326');
+					catch me
+						disp(me.message());
+						self.disp();
+					end
+					domain(i).x=long; domain(i).y=lat;
+				end
+
+				for i=1:length(domain),
+
+					%make sure lat,long are what they are supposed to be: 
+					%if any(domain(i).x>90 | domain(i).x<-90), 
+					%	long=domain(i).x; lat=domain(i).y;
+					%else
+					%	long=domain(i).y; lat=domain(i).x;
+					%end
+
+					%project on x,y,z reference frame.
+					[x,y,z]=AboveGround(domain(i).x,domain(i).y,radius,aboveground);
+					[xt,yt,zt]=AboveGround(domain(i).x+offset,domain(i).y+offset,radius,300000);
+					hold on;
+					if length(x)==1,
+						p=plot3(x,y,z,'k*'); 
+						set(p,'MarkerSize',markersize);
+						t=text(xt,yt,zt,self.shpfilename,'FontSize',fontsize);
+					else
+						p=plot3(x,y,z,'k-'); 
+						mid=floor(length(xt)/2);
+						text(xt(mid),yt(mid),zt(mid),self.shpfilename,'FontSize',fontsize);
+					end
+					set(p,'Color',color);
+					set(p,'LineWidth',linewidth);
+
+				end
+				%}}}
+			else
+				%convert boundary to another reference frame:  {{{
+
+				for i=1:length(domain),
+					try, 
+						[x,y] = gdaltransform(domain(i).x,domain(i).y,sprintf('EPSG:%i',self.epsg),sprintf('EPSG:%i',epsg));
+					catch me
+						disp(me.message());
+						self.disp();
+					end
+					domain(i).x=x; domain(i).y=y;
+				end
+
+				for i=1:length(domain),
+					hold on;
+					if length(x)==1,
+						p=plot(x,y,'k*'); 
+						set(p,'MarkerSize',markersize);
+						t=text(x,y,self.shpfilename,'FontSize',fontsize);
+					else
+						p=plot(x,y,'k-'); 
+						text(sum(x)/length(x),sum(y)/length(y),self.shpfilename,'FontSize',fontsize);
+					end
+					set(p,'Color',color);
+					set(p,'LineWidth',linewidth);
+				end
+				%}}}
+			end
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/calving.js
===================================================================
--- /issm/trunk/src/m/classes/calving.js	(revision 24312)
+++ /issm/trunk/src/m/classes/calving.js	(revision 24313)
@@ -13,10 +13,8 @@
 		console.log(sprintf('   Calving parameters:'));
 		fielddisplay(this,'calvingrate','calving rate at given location [m/a]');
-		fielddisplay(this,'meltingrate','melting rate at given location [m/a]');
 
 	}// }}}
     this.extrude = function(md) {//{{{
         this.calvingrate=project3d(md,'vector',this.calvingrate,'type','node');
-        this.meltingrate=project3d(md,'vector',this.meltingrate,'type','node');
         return this;
     }//}}}
@@ -29,5 +27,4 @@
 
 		checkfield(md,'fieldname','calving.calvingrate(1:md.mesh.numberofvertices,:)','>=',0,'timeseries',1,'NaN',1,'Inf',1);
-		checkfield(md,'fieldname','calving.meltingrate(1:md.mesh.numberofvertices,:)','>=',0,'timeseries',1,'NaN',1,'Inf',1);
 	} //}}}
 		this.marshall=function(md,prefix,fid) { //{{{
@@ -35,9 +32,7 @@
 			WriteData(fid,prefix,'name','md.calving.law','data',1,'format','Integer');
 			WriteData(fid,prefix,'object',this,'fieldname','calvingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
-			WriteData(fid,prefix,'object',this,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
 		}//}}}
 		this.fix=function() { //{{{
 			this.calvingrate=NullFix(this.calvingrate,NaN);
-			this.meltingrate=NullFix(this.meltingrate,NaN);
 		}//}}}
 	//properties 
@@ -45,5 +40,4 @@
 
 	this.calvingrate   = NaN;
-	this.meltingrate   = NaN;
 
 	this.setdefaultparameters();
Index: /issm/trunk/src/m/classes/calving.m
===================================================================
--- /issm/trunk/src/m/classes/calving.m	(revision 24312)
+++ /issm/trunk/src/m/classes/calving.m	(revision 24313)
@@ -7,5 +7,4 @@
 	properties (SetAccess=public) 
 		calvingrate   = NaN;
-		meltingrate   = NaN;
 	end
 	methods
@@ -30,5 +29,4 @@
 		function self = extrude(self,md) % {{{
 			self.calvingrate=project3d(md,'vector',self.calvingrate,'type','node');
-			self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node');
 		end % }}}
 		function self = setdefaultparameters(self) % {{{
@@ -40,10 +38,8 @@
 
 			md = checkfield(md,'fieldname','calving.calvingrate','>=',0,'timeseries',1,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','calving.meltingrate','>=',0,'timeseries',1,'NaN',1,'Inf',1);
 		end % }}}
 		function disp(self) % {{{
 			disp(sprintf('   Calving parameters:'));
 			fielddisplay(self,'calvingrate','calving rate at given location [m/a]');
-			fielddisplay(self,'meltingrate','melting rate at given location [m/a]');
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
@@ -51,10 +47,8 @@
 			WriteData(fid,prefix,'name','md.calving.law','data',1,'format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','calvingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
-			WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
 		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
 		
 			writejs1Darray(fid,[modelname '.calving.calvingrate'],self.calvingrate);
-			writejs1Darray(fid,[modelname '.calving.meltingrate'],self.meltingrate);
 
 		end % }}}
Index: /issm/trunk/src/m/classes/calving.py
===================================================================
--- /issm/trunk/src/m/classes/calving.py	(revision 24312)
+++ /issm/trunk/src/m/classes/calving.py	(revision 24313)
@@ -4,54 +4,52 @@
 from WriteData import WriteData
 
+
 class calving(object):
-	"""
-	CALVING class definition
+    """
+    CALVING class definition
 
-	   Usage:
-	      calving=calving();
-	"""
+       Usage:
+          calving = calving()
+    """
 
-	def __init__(self): # {{{
+    def __init__(self):  # {{{
 
-		self.calvingrate   = float('NaN')
-		self.meltingrate   = float('NaN')
+        self.calvingrate = float('NaN')
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		string='   Calving parameters:'
-		string="%s\n%s"%(string,fielddisplay(self,'calvingrate','calving rate at given location [m/a]'))
-		string="%s\n%s"%(string,fielddisplay(self,'meltingrate','melting rate at given location [m/a]'))
+    #}}}
 
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		self.calvingrate=project3d(md,'vector',self.calvingrate,'type','node')
-		self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node')
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
+    def __repr__(self):  # {{{
+        string = '   Calving parameters:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'calvingrate', 'calving rate at given location [m / a]'))
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+        return string
+    #}}}
 
-		#Early return
-		if (solution!='TransientSolution') or (not md.transient.ismovingfront):
-			return md
+    def extrude(self, md):  # {{{
+        self.calvingrate = project3d(md, 'vector', self.calvingrate, 'type', 'node')
+        return self
+    #}}}
 
-		md = checkfield(md,'fieldname','calving.calvingrate','>=',0,'timeseries',1,'NaN',1,'Inf',1);
-		md = checkfield(md,'fieldname','calving.meltingrate','>=',0,'timeseries',1,'NaN',1,'Inf',1);
+    def setdefaultparameters(self):  # {{{
+        return self
+    #}}}
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if (solution != 'TransientSolution') or (not md.transient.ismovingfront):
+            return md
 
-		yts=md.constants.yts
+        md = checkfield(md, 'fieldname', 'calving.calvingrate', '>=', 0, 'timeseries', 1, 'NaN', 1, 'Inf', 1)
 
-		WriteData(fid,prefix,'name','md.calving.law','data',1,'format','Integer');
-		WriteData(fid,prefix,'object',self,'fieldname','calvingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts)
-		WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts)
-	# }}}
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
+
+        WriteData(fid, prefix, 'name', 'md.calving.law', 'data', 1, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'calvingrate', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts, 'scale', 1. / yts)
+    # }}}
Index: /issm/trunk/src/m/classes/calvingcrevassedepth.m
===================================================================
--- /issm/trunk/src/m/classes/calvingcrevassedepth.m	(revision 24312)
+++ /issm/trunk/src/m/classes/calvingcrevassedepth.m	(revision 24313)
@@ -6,7 +6,6 @@
 classdef calvingcrevassedepth
 	properties (SetAccess=public) 
-		critical_fraction = 0.;
+		crevasse_opening_stress=1.;
 		water_height = 0.;
-		meltingrate   = NaN;
 	end
 	methods
@@ -30,11 +29,9 @@
 		end % }}}
 		function self = extrude(self,md) % {{{
-			self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node');
 		end % }}}
 		function self = setdefaultparameters(self) % {{{
-
-			% crticial fraction of thickness that surface and basal crevasses penetrate for calving onset
-			self.critical_fraction = 1.;
+			
 			self.water_height = 0.;
+			crevasse_opening_stress=1.;
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
@@ -42,13 +39,11 @@
 			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
 
-			md = checkfield(md,'fieldname','calving.critical_fraction','>',0,'NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','calving.crevasse_opening_stress','numel',[1],'values',[0,1]);
 			md = checkfield(md,'fieldname','calving.water_height','NaN',1,'Inf',1,'timeseries',1,'>=',0);
-			md = checkfield(md,'fieldname','calving.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0);
 		end % }}}
 		function disp(self) % {{{
 			disp(sprintf('   Calving Pi parameters:'));
-			fielddisplay(self,'critical_fraction','critical fraction of thickness that surface and basal crevasses penetrate for calving onset');
+			fielddisplay(self,'crevasse_opening_stress','0: stress only in the ice-flow direction, 1: max principal');
 			fielddisplay(self,'water_height','water height in the crevasse [m]');
-			fielddisplay(self,'meltingrate','melting rate at given location [m/a]');
 
 		end % }}}
@@ -56,7 +51,6 @@
 			yts=md.constants.yts;
 			WriteData(fid,prefix,'name','md.calving.law','data',6,'format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','critical_fraction','format','Double');
+			WriteData(fid,prefix,'object',self,'fieldname','crevasse_opening_stress','format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','water_height','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
-			WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
 		end % }}}
 	end
Index: /issm/trunk/src/m/classes/calvingdev.py
===================================================================
--- /issm/trunk/src/m/classes/calvingdev.py	(revision 24312)
+++ /issm/trunk/src/m/classes/calvingdev.py	(revision 24313)
@@ -4,57 +4,58 @@
 from WriteData import WriteData
 
+
 class calvingdev(object):
-	"""
-	CALVINGDEV class definition
+    """
+    CALVINGDEV class definition
 
-	   Usage:
-	      calvingdev=calvingdev();
-	"""
+       Usage:
+          calvingdev = calvingdev()
+    """
 
-	def __init__(self): # {{{
+    def __init__(self):  # {{{
 
-		self.stress_threshold_groundedice = 0.
-		self.stress_threshold_floatingice = 0.
-		self.meltingrate   = float('NaN')
+        self.stress_threshold_groundedice = 0.
+        self.stress_threshold_floatingice = 0.
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-	#}}}
-	def __repr__(self): # {{{
-		string='   Calving Pi parameters:'
-		string="%s\n%s"%(string,fielddisplay(self,'stress_threshold_groundedice','sigma_max applied to grounded ice only [Pa]'))
-		string="%s\n%s"%(string,fielddisplay(self,'stress_threshold_floatingice','sigma_max applied to floating ice only [Pa]'))
+    #}}}
 
-		string="%s\n%s"%(string,fielddisplay(self,'meltingrate','melting rate at given location [m/a]'))
-		return string
-	#}}}
-	def extrude(self,md): # {{{
-		self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node')
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
-		#Default sigma max
-		self.stress_threshold_groundedice = 1e6
-		self.stress_threshold_floatingice = 150e3
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		#Early return
-		if solution == 'TransientSolution' or md.transient.ismovingfront == 0:
-			return
+    def __repr__(self):  # {{{
+        string = '   Calving Pi parameters:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'stress_threshold_groundedice', 'sigma_max applied to grounded ice only [Pa]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'stress_threshold_floatingice', 'sigma_max applied to floating ice only [Pa]'))
 
-		md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'nan',1,'Inf',1)
-		md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'nan',1,'Inf',1)
-		md = checkfield(md,'fieldname','calving.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0)
+        return string
+    #}}}
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		yts=md.constants.yts
+    def extrude(self, md):  # {{{
+        return self
+    #}}}
 
-		WriteData(fid,prefix,'name','md.calving.law','data',2,'format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_groundedice','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_floatingice','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts)
-	# }}}
+    def setdefaultparameters(self):  # {{{
+        #Default sigma max
+        self.stress_threshold_groundedice = 1e6
+        self.stress_threshold_floatingice = 150e3
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if solution == 'TransientSolution' or md.transient.ismovingfront == 0:
+            return
+
+        md = checkfield(md, 'fieldname', 'calving.stress_threshold_groundedice', '>', 0, 'nan', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'calving.stress_threshold_floatingice', '>', 0, 'nan', 1, 'Inf', 1)
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
+
+        WriteData(fid, prefix, 'name', 'md.calving.law', 'data', 2, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'stress_threshold_groundedice', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'stress_threshold_floatingice', 'format', 'DoubleMat', 'mattype', 1)
+    # }}}
Index: /issm/trunk/src/m/classes/calvingdev2.m
===================================================================
--- /issm/trunk/src/m/classes/calvingdev2.m	(revision 24312)
+++ /issm/trunk/src/m/classes/calvingdev2.m	(revision 24313)
@@ -9,5 +9,4 @@
 		stress_threshold_floatingice = 0.;
 		height_above_floatation = 0.;
-		meltingrate   = NaN;
 	end
 	methods
@@ -31,5 +30,4 @@
 		end % }}}
 		function self = extrude(self,md) % {{{
-			self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node');
 		end % }}}
 		function self = setdefaultparameters(self) % {{{
@@ -39,5 +37,4 @@
 			self.stress_threshold_floatingice = 150.e3;
 			self.height_above_floatation= 0.;
-			self.meltingrate= 0.;
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
@@ -48,5 +45,4 @@
 			md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'nan',1,'Inf',1);
 			md = checkfield(md,'fieldname','calving.height_above_floatation','<=',0);
-			md = checkfield(md,'fieldname','calving.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0);
 		end % }}}
 		function disp(self) % {{{
@@ -55,5 +51,4 @@
 			fielddisplay(self,'stress_threshold_floatingice','sigma_max applied to floating ice only [Pa]');
 			fielddisplay(self,'height_above_floatation','height above floatation that the ice tongue must reach before it can calve [m]');
-			fielddisplay(self,'meltingrate','frontal undercutting melting rate at given location [m/a]');
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
@@ -63,5 +58,4 @@
 			WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_floatingice','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1, 'yts', md.constants.yts);
 			WriteData(fid,prefix,'object',self,'fieldname','height_above_floatation', 'format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
 		end % }}}
 	end
Index: /issm/trunk/src/m/classes/calvinghab.m
===================================================================
--- /issm/trunk/src/m/classes/calvinghab.m	(revision 24312)
+++ /issm/trunk/src/m/classes/calvinghab.m	(revision 24313)
@@ -7,5 +7,4 @@
 	properties (SetAccess=public) 
 		flotation_fraction = 0.;
-		meltingrate   = NaN;
 	end
 	methods
@@ -29,5 +28,4 @@
 		end % }}}
 		function self = extrude(self,md) % {{{
-			self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node');
 		end % }}}
 		function self = setdefaultparameters(self) % {{{
@@ -41,10 +39,8 @@
 
 			md = checkfield(md,'fieldname','calving.flotation_fraction','>=',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','calving.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0);
 		end % }}}
 		function disp(self) % {{{
 			disp(sprintf('   Calving Pi parameters:'));
 			fielddisplay(self,'flotation_fraction','fraction of flotation thickness at the terminus');
-			fielddisplay(self,'meltingrate','melting rate at given location [m/a]');
 
 		end % }}}
@@ -53,5 +49,4 @@
 			WriteData(fid,prefix,'name','md.calving.law','data',5,'format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','flotation_fraction','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
 		end % }}}
 	end
Index: /issm/trunk/src/m/classes/calvinglevermann.m
===================================================================
--- /issm/trunk/src/m/classes/calvinglevermann.m	(revision 24312)
+++ /issm/trunk/src/m/classes/calvinglevermann.m	(revision 24313)
@@ -7,5 +7,4 @@
 	properties (SetAccess=public) 
 		coeff         = NaN;
-		meltingrate   = NaN;
 	end
 	methods
@@ -30,5 +29,4 @@
 		function self = extrude(self,md) % {{{
 			self.coeff=project3d(md,'vector',self.coeff,'type','node');
-			self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node');
 		end % }}}
 		function self = setdefaultparameters(self) % {{{
@@ -42,10 +40,8 @@
 
 			md = checkfield(md,'fieldname','calving.coeff','>',0,'size',[md.mesh.numberofvertices 1]);
-			md = checkfield(md,'fieldname','calving.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0);
 		end % }}}
 		function disp(self) % {{{
 			disp(sprintf('   Calving Levermann parameters:'));
 			fielddisplay(self,'coeff','proportionality coefficient in Levermann model');
-			fielddisplay(self,'meltingrate','melting rate at given location [m/a]');
 
 		end % }}}
@@ -54,5 +50,4 @@
 			WriteData(fid,prefix,'name','md.calving.law','data',3,'format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','coeff','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
 		end % }}}
 	end
Index: /issm/trunk/src/m/classes/calvinglevermann.py
===================================================================
--- /issm/trunk/src/m/classes/calvinglevermann.py	(revision 24312)
+++ /issm/trunk/src/m/classes/calvinglevermann.py	(revision 24313)
@@ -2,53 +2,52 @@
 from checkfield import checkfield
 from WriteData import WriteData
+from project3d import project3d
+
 
 class calvinglevermann(object):
-	"""
-	CALVINGLEVERMANN class definition
+    """
+    CALVINGLEVERMANN class definition
 
-	   Usage:
-	      calvinglevermann=calvinglevermann();
-	"""
+       Usage:
+          calvinglevermann = calvinglevermann()
+    """
 
-	def __init__(self): # {{{
+    def __init__(self):  # {{{
 
-		self.coeff         = float('NaN')
-		self.meltingrate   = float('NaN')
+        self.coeff = float('NaN')
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		string='   Calving Levermann parameters:'
-		string="%s\n%s"%(string,fielddisplay(self,'coeff','proportionality coefficient in Levermann model'))
-		string="%s\n%s"%(string,fielddisplay(self,'meltingrate','melting rate at given location [m/a]'))
+    #}}}
 
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		self.coeff=project3d(md,'vector',self.coeff,'type','node')
-		self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node')
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
+    def __repr__(self):  # {{{
+        string = '   Calving Levermann parameters:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'coeff', 'proportionality coefficient in Levermann model'))
 
-		#Proportionality coefficient in Levermann model
-		self.coeff=2e13;
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+        return string
+    #}}}
 
-		#Early return
-		if (solution!='TransientSolution') or (not md.transient.ismovingfront):
-			return md
+    def extrude(self, md):  # {{{
+        self.coeff = project3d(md, 'vector', self.coeff, 'type', 'node')
+        return self
+    #}}}
 
-		md = checkfield(md,'fieldname','calving.coeff','size',[md.mesh.numberofvertices],'>',0)
-		md = checkfield(md,'fieldname','calving.meltingrate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices],'>=',0)
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		yts=md.constants.yts
-		WriteData(fid,prefix,'name','md.calving.law','data',3,'format','Integer');
-		WriteData(fid,prefix,'object',self,'fieldname','coeff','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts)
-	# }}}
+    def setdefaultparameters(self):  # {{{
+        #Proportionality coefficient in Levermann model
+        self.coeff = 2e13
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if (solution != 'TransientSolution') or (not md.transient.ismovingfront):
+            return md
+
+        md = checkfield(md, 'fieldname', 'calving.coeff', 'size', [md.mesh.numberofvertices], '>', 0)
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'name', 'md.calving.law', 'data', 3, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'coeff', 'format', 'DoubleMat', 'mattype', 1)
+    # }}}
Index: /issm/trunk/src/m/classes/calvingminthickness.m
===================================================================
--- /issm/trunk/src/m/classes/calvingminthickness.m	(revision 24312)
+++ /issm/trunk/src/m/classes/calvingminthickness.m	(revision 24313)
@@ -7,5 +7,4 @@
 	properties (SetAccess=public) 
 		min_thickness = 0.;
-		meltingrate   = NaN;
 	end
 	methods
@@ -29,5 +28,4 @@
 		end % }}}
 		function self = extrude(self,md) % {{{
-			self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node');
 		end % }}}
 		function self = setdefaultparameters(self) % {{{
@@ -40,11 +38,9 @@
 			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
 
-			md = checkfield(md,'fieldname','calving.min_thickness','>',0,'NaN',1,'Inf',1);
-			md = checkfield(md,'fieldname','calving.meltingrate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>=',0);
+			md = checkfield(md,'fieldname','calving.min_thickness','>',0,'NaN',1,'Inf',1,'numel',1);
 		end % }}}
 		function disp(self) % {{{
 			disp(sprintf('   Calving Minimum thickness:'));
-			fielddisplay(self,'min_thickness','minimum thickness below which no ice is allowed');
-			fielddisplay(self,'meltingrate','melting rate at given location [m/a]');
+			fielddisplay(self,'min_thickness','minimum thickness below which no ice is allowed [m]');
 
 		end % }}}
@@ -53,5 +49,4 @@
 			WriteData(fid,prefix,'name','md.calving.law','data',4,'format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','min_thickness','format','Double');
-			WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts);
 		end % }}}
 	end
Index: /issm/trunk/src/m/classes/calvingminthickness.py
===================================================================
--- /issm/trunk/src/m/classes/calvingminthickness.py	(revision 24312)
+++ /issm/trunk/src/m/classes/calvingminthickness.py	(revision 24313)
@@ -3,50 +3,48 @@
 from WriteData import WriteData
 
+
 class calvingminthickness(object):
-	"""
-	CALVINGMINTHICKNESS class definition
+    """
+    CALVINGMINTHICKNESS class definition
 
-	   Usage:
-	      calvingminthickness=calvingminthickness()
-	"""
+       Usage:
+          calvingminthickness = calvingminthickness()
+    """
 
-	def __init__(self): # {{{
+    def __init__(self):  # {{{
 
-		self.min_thickness = 0.
-		self.meltingrate   = float('NaN')
+        self.min_thickness = 0.
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-	#}}}
-	def __repr__(self): # {{{
-		string='   Calving Minimum thickness:'
-		string="%s\n%s"%(string,fielddisplay(self,'min_thickness','minimum thickness below which no ice is allowed'))
-		string="%s\n%s"%(string,fielddisplay(self,'meltingrate','melting rate at given location [m/a]'))
-		return string
-	#}}}
-	def extrude(self,md): # {{{
-		self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node')
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
+    #}}}
 
-		#minimum thickness is 100 m by default
-		self.min_thickness = 100.
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+    def __repr__(self):  # {{{
+        string = '   Calving Minimum thickness:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'min_thickness', 'minimum thickness below which no ice is allowed'))
+        return string
+    #}}}
 
-		#Early return
-		if solution == 'TransientSolution' or md.transient.ismovingfront == 0:
-			return
+    def extrude(self, md):  # {{{
+        return self
+    #}}}
 
-		md = checkfield(md,'fieldname','calving.min_thickness','>',0,'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','calving.meltingrate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices],'>=',0)
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		yts=md.constants.yts
-		WriteData(fid,prefix,'name','md.calving.law','data',4,'format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','min_thickness','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts)
-	# }}}
+    def setdefaultparameters(self):  # {{{
+        #minimum thickness is 100 m by default
+        self.min_thickness = 100.
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if solution == 'TransientSolution' or md.transient.ismovingfront == 0:
+            return
+
+        md = checkfield(md, 'fieldname', 'calving.min_thickness', '>', 0, 'NaN', 1, 'Inf', 1)
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'name', 'md.calving.law', 'data', 4, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'min_thickness', 'format', 'Double')
+    # }}}
Index: /issm/trunk/src/m/classes/calvingvonmises.m
===================================================================
--- /issm/trunk/src/m/classes/calvingvonmises.m	(revision 24312)
+++ /issm/trunk/src/m/classes/calvingvonmises.m	(revision 24313)
@@ -8,5 +8,5 @@
 		stress_threshold_groundedice = 0.;
 		stress_threshold_floatingice = 0.;
-		meltingrate   = NaN;
+		min_thickness = 0.;
 	end
 	methods
@@ -30,5 +30,4 @@
 		end % }}}
 		function self = extrude(self,md) % {{{
-			self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node');
 		end % }}}
 		function self = setdefaultparameters(self) % {{{
@@ -37,4 +36,7 @@
 			self.stress_threshold_groundedice = 1e6;
 			self.stress_threshold_floatingice = 150e3;
+
+			%For now we turn this off by setting the threshold to 0
+			self.min_thickness = 0.;
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
@@ -44,5 +46,5 @@
 			md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'nan',1,'Inf',1);
 			md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'nan',1,'Inf',1);
-			md = checkfield(md,'fieldname','calving.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0);
+			md = checkfield(md,'fieldname','calving.min_thickness','>=',0,'NaN',1,'Inf',1,'numel',1);
 		end % }}}
 		function disp(self) % {{{
@@ -50,5 +52,5 @@
 			fielddisplay(self,'stress_threshold_groundedice','sigma_max applied to grounded ice only [Pa]');
 			fielddisplay(self,'stress_threshold_floatingice','sigma_max applied to floating ice only [Pa]');
-			fielddisplay(self,'meltingrate','melting rate at given location [m/a]');
+			fielddisplay(self,'min_thickness','minimum thickness below which no ice is allowed [m]');
 
 		end % }}}
@@ -58,5 +60,5 @@
 			WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_groundedice','format','DoubleMat','mattype',1);
 			WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_floatingice','format','DoubleMat','mattype',1);
-			WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
+			WriteData(fid,prefix,'object',self,'fieldname','min_thickness','format','Double');
 		end % }}}
 	end
Index: /issm/trunk/src/m/classes/calvingvonmises.py
===================================================================
--- /issm/trunk/src/m/classes/calvingvonmises.py	(revision 24312)
+++ /issm/trunk/src/m/classes/calvingvonmises.py	(revision 24313)
@@ -1,60 +1,65 @@
 from fielddisplay import fielddisplay
-from project3d import project3d
 from checkfield import checkfield
 from WriteData import WriteData
 
+
 class calvingvonmises(object):
-	"""
-	CALVINGVONMISES class definition
+    """
+    CALVINGVONMISES class definition
 
-	   Usage:
-	      calvingvonmises=calvingvonmises()
-	"""
+       Usage:
+          calvingvonmises = calvingvonmises()
+    """
 
-	def __init__(self): # {{{
+    def __init__(self):  # {{{
 
-		self.stress_threshold_groundedice = 0.
-		self.stress_threshold_floatingice = 0.
-		self.meltingrate   = float('NaN')
+        self.stress_threshold_groundedice = 0.
+        self.stress_threshold_floatingice = 0.
+        self.min_thickness = 0.
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-	#}}}
-	def __repr__(self): # {{{
-		string='   Calving VonMises parameters:'
-		string="%s\n%s"%(string,fielddisplay(self,'stress_threshold_groundedice','sigma_max applied to grounded ice only [Pa]'))
-		string="%s\n%s"%(string,fielddisplay(self,'stress_threshold_floatingice','sigma_max applied to floating ice only [Pa]'))
+    #}}}
 
-		string="%s\n%s"%(string,fielddisplay(self,'meltingrate','melting rate at given location [m/a]'))
-		return string
-	#}}}
-	def extrude(self,md): # {{{
-		self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node')
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
-		#Default sigma max
-		self.stress_threshold_groundedice = 1e6
-		self.stress_threshold_floatingice = 150e3
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		#Early return
-		if solution == 'TransientSolution' or md.transient.ismovingfront == 0:
-			return
+    def __repr__(self):  # {{{
+        string = '   Calving VonMises parameters:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'stress_threshold_groundedice', 'sigma_max applied to grounded ice only [Pa]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'stress_threshold_floatingice', 'sigma_max applied to floating ice only [Pa]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'min_thickness', 'minimum thickness below which no ice is allowed [m]'))
 
-		md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'nan',1,'Inf',1)
-		md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'nan',1,'Inf',1)
-		md = checkfield(md,'fieldname','calving.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0)
+        return string
+    #}}}
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		yts=md.constants.yts
+    def extrude(self, md):  # {{{
+        return self
+    #}}}
 
-		WriteData(fid,prefix,'name','md.calving.law','data',2,'format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_groundedice','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_floatingice','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts)
-	# }}}
+    def setdefaultparameters(self):  # {{{
+        #Default sigma max
+        self.stress_threshold_groundedice = 1e6
+        self.stress_threshold_floatingice = 150e3
+
+        #turn off min_thickness by default.
+        self.min_thickness = 0.
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if solution == 'TransientSolution' or md.transient.ismovingfront == 0:
+            return
+
+        md = checkfield(md, 'fieldname', 'calving.stress_threshold_groundedice', '>', 0, 'nan', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'calving.stress_threshold_floatingice', '>', 0, 'nan', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'calving.min_thickness', '>=', 0, 'NaN', 1, 'Inf', 1, 'numel', [1])
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'name', 'md.calving.law', 'data', 2, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'stress_threshold_groundedice', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'stress_threshold_floatingice', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'min_thickness', 'format', 'Double')
+    # }}}
Index: /issm/trunk/src/m/classes/clusters/aurora.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/aurora.m	(revision 24313)
+++ /issm/trunk/src/m/classes/clusters/aurora.m	(revision 24313)
@@ -0,0 +1,134 @@
+%AURORA class definition
+%
+%   Usage:
+%      cluster=aurora();
+%      cluster=aurora('np',3);
+%      cluster=aurora('np',3,'login','username');
+
+classdef aurora
+    properties (SetAccess=public) 
+		 % {{{
+		 name='aurora.jpl.nasa.gov'
+		 login='username';
+		 numnodes = 1;
+		 cpuspernode = 24;
+		 modules = {'intel/cluster-toolkit-2013.5.192'};
+		 port=1070;
+		 queue='shortq';
+		 time=3*60;
+		 codepath='~/issm/trunk/';
+		 executionpath='~/issm/trunk/execution/';
+		 mpipath='/opt/intel/impi/4.1.3/intel64/bin/';
+		 %}}}
+	 end
+	 methods
+		 function cluster=aurora(varargin) % {{{
+
+			 %initialize cluster using default settings if provided
+			 if (exist('aurora_settings')==2), aurora_settings; end
+
+			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		 end
+		 %}}}
+		 function disp(cluster) % {{{
+			 %  display the object
+			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			 disp(sprintf('    name: %s',cluster.name));
+			 disp(sprintf('    login: %s',cluster.login));
+			 disp(sprintf('    numnodes: %i',cluster.numnodes));
+			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+			 disp(sprintf('    port: %i',cluster.port));
+			 disp(sprintf('    queue: %s',cluster.queue));
+			 disp(sprintf('    time: %i',cluster.time));
+			 disp(sprintf('    codepath: %s',cluster.codepath));
+			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+		 end
+		 %}}}
+		 function numprocs=np(cluster) % {{{
+			 %compute number of processors
+			 numprocs=cluster.numnodes*cluster.cpuspernode;
+		 end
+		 %}}}
+		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+
+			 available_queues={'debugq','shortq','mediumq','longq','verylongq'};
+			 queue_requirements_time=[60*1 60*3 60*12 60*48 60*192];
+			 queue_requirements_np=[16 256 256 128 128];
+
+			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.numnodes.*cluster.cpuspernode,cluster.time)
+		 end
+		 %}}}
+		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+
+			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+			 executable='issm.exe';
+			 if isdakota,
+				 version=IssmConfig('_DAKOTA_VERSION_'); version=str2num(version(1:3));
+				 if (version>=6),
+					 executable='issm_dakota.exe';
+				 end
+			 end
+			 if isoceancoupling,
+				 executable='issm_ocean.exe';
+			 end
+
+			 %write queuing script 
+			 fid=fopen([modelname '.queue'],'w');
+			 fprintf(fid,'#!/bin/bash\n');
+			 fprintf(fid,'#PBS -l select=%i:ncpus=%i\n',cluster.numnodes,cluster.cpuspernode);
+			 fprintf(fid,'#PBS -N %s\n',modelname);
+			 fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
+			 fprintf(fid,'#PBS -q %s\n',cluster.queue);
+			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+			 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
+			 fprintf(fid,'source /usr/share/Modules/init/bash\n');
+			 for i=1:numel(cluster.modules), fprintf(fid,['module load ' cluster.modules{i} '\n\n']); end
+			 fprintf(fid,'export PATH="$PATH:."\n\n');
+			 fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
+			 fprintf(fid,'export MPI_UNBUFFERED_STDIO=true\n\n');
+			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath);
+			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');      
+			 fprintf(fid,'export PATH="$PATH:.:%s"\n',cluster.mpipath);
+			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]);
+			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
+			 fprintf(fid,'mpirun -n %i %s/%s %s %s %s',cluster.np(),cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+			 fclose(fid);
+
+		 end
+		 %}}}
+		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+
+			 %compress the files into one zip.
+			 compressstring=['tar -zcf ' dirname '.tar.gz '];
+			 for i=1:numel(filelist),
+				 compressstring = [compressstring ' ' filelist{i}];
+			 end
+			 system(compressstring);
+
+			 disp('uploading input file and queueing script');
+			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+
+		 end %}}}
+		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
+
+			 if ~isempty(restart)
+				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
+			 else
+				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
+			 end
+
+			 disp('launching solution sequence on remote cluster');
+			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+
+		 end %}}}
+		 function Download(cluster,dirname,filelist)% {{{
+
+			 %copy files from cluster to current directory
+			 directory=[cluster.executionpath '/' dirname '/'];
+			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+
+		 end %}}}
+	end
+end
Index: /issm/trunk/src/m/classes/clusters/cyclone.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/cyclone.py	(revision 24312)
+++ /issm/trunk/src/m/classes/clusters/cyclone.py	(revision 24313)
@@ -5,120 +5,107 @@
 from issmscpin import issmscpin
 from issmscpout import issmscpout
-from QueueRequirements import QueueRequirements
-import datetime
 try:
-	from cyclone_settings import cyclone_settings
+    from cyclone_settings import cyclone_settings
 except ImportError:
-	print 'You need cyclone_settings.py to proceed, check presence and sys.path'
-	
+    print('You need cyclone_settings.py to proceed, check presence and sys.path')
+
+
 class cyclone(object):
-	"""
-	Be aware that this is not a cluster as we usually know them. There is no scheduling and ressources are pretty low.
-	The Computer have 20 cpus and 512Gb of memory used by a number of person so be respectful with your usage.
-	I putted some restrictive upper limits to avoid over-use. (Basile)
- 
-	   Usage:
-	      cluster=cyclone();
-	"""
+    """
+    Be aware that this is not a cluster as we usually know them. There is no scheduling and ressources are pretty low.
+    The Computer have 20 cpus and 512Gb of memory used by a number of person so be respectful with your usage.
+    I putted some restrictive upper limits to avoid over - use. (Basile)
 
-	def __init__(self,*args):
-		# {{{
-		self.name           = 'cyclone'
-		self.login          = ''
-		self.np             = 2
-		self.time           = 100
-		self.codepath       = ''
-		self.executionpath  = ''
-		self.port           = ''
-		self.interactive    = 0
+       Usage:
+          cluster = cyclone()
+    """
 
-		#use provided options to change fields
-		options=pairoptions(*args)
+    def __init__(self, *args):    # {{{
+        self.name = 'cyclone'
+        self.login = ''
+        self.np = 2
+        self.time = 100
+        self.codepath = ''
+        self.executionpath = ''
+        self.port = ''
+        self.interactive = 0
 
-		#initialize cluster using user settings if provided
-		self=cyclone_settings(self)
-		#OK get other fields
-		self=options.AssignObjectFields(self)
-		
-		# }}}
+    #use provided options to change fields
+        options = pairoptions(*args)
 
-	def __repr__(self):
-	# {{{
-		#  display the object
-		s = "class cyclone object:"
-		s = "%s\n%s"%(s,fielddisplay(self,'name','name of the cluster'))
-		s = "%s\n%s"%(s,fielddisplay(self,'login','login'))
-		s = "%s\n%s"%(s,fielddisplay(self,'np','number of processes'))
-		s = "%s\n%s"%(s,fielddisplay(self,'time','walltime requested in minutes'))
-		s = "%s\n%s"%(s,fielddisplay(self,'codepath','code path on the cluster'))
-		s = "%s\n%s"%(s,fielddisplay(self,'executionpath','execution path on the cluster'))
-		return s
-	# }}}
+    #initialize cluster using user settings if provided
+        self = cyclone_settings(self)
+    #OK get other fields
+        self = options.AssignObjectFields(self)
 
-	def checkconsistency(self,md,solution,analyses):
-		# {{{
-		#Miscelaneous
-		if not self.login:
-			md = md.checkmessage('login empty')
-		if not self.codepath:
-			md = md.checkmessage('codepath empty')
-		if not self.executionpath:
-			md = md.checkmessage('executionpath empty')
-		if self.time>72:
-			md = md.checkmessage('walltime exceeds 72h for niceness this is not allowed, if you need more time consider shifting to one of the Notur systems')
-		if self.np >10:
-			md = md.checkmessage('number of process excess 10, if you need more processing power consider shifting to one of the Notur systems')
+    # }}}
 
-		return self
-                # }}}
-	def BuildQueueScript(self,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling):
-		# {{{
+    def __repr__(self):    # {{{
+        #  display the object
+        s = "class cyclone object:"
+        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'np', 'number of processes'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested in minutes'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', 'code path on the cluster'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'execution path on the cluster'))
+        return s
+    # }}}
 
-		executable='issm.exe'
-		
-		#write queuing script 
-		shortname=modelname[0:min(12,len(modelname))]
-		fid=open(modelname+'.queue','w')
-		fid.write('export ISSM_DIR="%s/../"\n' % self.codepath)
-		fid.write('source $ISSM_DIR/etc/environment.sh\n')
-		fid.write('INTELLIBS="/opt/intel/intelcompiler-12.04/composerxe-2011.4.191/compiler/lib/intel64"\n')
-		fid.write('export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/:$INTELLIBS\n')
-		fid.write('export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/include/x86_64-linux-gnu/c++/4.8\n')
-		fid.write('cd %s/%s/\n\n' % (self.executionpath,dirname))
-		rundir=self.executionpath+'/'+dirname
-		runfile=self.executionpath+'/'+dirname+'/'+modelname
-		fid.write('mpiexec -np %i %s/%s %s %s %s >%s.outlog 2>%s.errlog\n' % (self.np,self.codepath,executable,str(solution),rundir,modelname,runfile,runfile))
-		fid.close()
+    def checkconsistency(self, md, solution, analyses):    # {{{
+        #Miscelaneous
+        if not self.login:
+            md = md.checkmessage('login empty')
+        if not self.codepath:
+            md = md.checkmessage('codepath empty')
+        if not self.executionpath:
+            md = md.checkmessage('executionpath empty')
+        if self.time > 72:
+            md = md.checkmessage('walltime exceeds 72h for niceness this is not allowed, if you need more time consider shifting to one of the Notur systems')
+        if self.np > 10:
+            md = md.checkmessage('number of process excess 10, if you need more processing power consider shifting to one of the Notur systems')
 
-		# }}}
-	def UploadQueueJob(self,modelname,dirname,filelist):
-		# {{{
+        return self
+    # }}}
 
-		#compress the files into one zip.
-		compressstring='tar -zcf %s.tar.gz ' % dirname
-		for file in filelist:
-			compressstring += ' %s' % file
-		subprocess.call(compressstring,shell=True)
+    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):    # {{{
+        executable = 'issm.exe'
+        #write queuing script
+        fid = open(modelname + '.queue', 'w')
+        fid.write('export ISSM_DIR="%s/../ "\n' % self.codepath)
+        fid.write('source $ISSM_DIR/etc/environment.sh\n')
+        fid.write('INTELLIBS = "/opt/intel/intelcompiler-12.04/composerxe-2011.4.191/compiler/lib/intel64"\n')
+        fid.write('export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/:$INTELLIBS\n')
+        fid.write('export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/include/x86_64-linux-gnu/c++/4.8\n')
+        fid.write('cd %s/%s/ \n\n' % (self.executionpath, dirname))
+        rundir = self.executionpath + '/' + dirname
+        runfile = self.executionpath + '/' + dirname + '/' + modelname
+        fid.write('mpiexec -np %i %s/%s %s %s %s>%s.outlog 2>%s.errlog\n' % (self.np, self.codepath, executable, str(solution), rundir, modelname, runfile, runfile))
+        fid.close()
 
-		print 'uploading input file and queueing script'
-		issmscpout(self.name,self.executionpath,self.login,self.port,[dirname+'.tar.gz'])
+    # }}}
+    def UploadQueueJob(self, modelname, dirname, filelist):    # {{{
+        #compress the files into one zip.
+        compressstring = 'tar -zcf %s.tar.gz ' % dirname
+        for file in filelist:
+            compressstring += ' %s' % file
+        subprocess.call(compressstring, shell=True)
 
-		# }}}
-	def LaunchQueueJob(self,modelname,dirname,filelist,restart,batch):
-                # {{{
+        print('uploading input file and queueing script')
+        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
 
-		print 'launching solution sequence on remote cluster'
-		if restart:
-			launchcommand='cd %s && cd %s && qsub %s.queue' % (self.executionpath,dirname,modelname)
-		else:
-			launchcommand='cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && chmod +x ./%s.queue && ./%s.queue' % (self.executionpath,dirname,dirname,dirname,dirname,dirname,modelname,modelname)
-		issmssh(self.name,self.login,self.port,launchcommand)
+    # }}}
+    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):    # {{{
+        print('launching solution sequence on remote cluster')
+        if restart:
+            launchcommand = 'cd %s && cd %s && qsub %s.queue' % (self.executionpath, dirname, modelname)
+        else:
+            launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && chmod +x ./%s.queue && ./%s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname, modelname)
+        issmssh(self.name, self.login, self.port, launchcommand)
 
-		# }}}
-	def Download(self,dirname,filelist):
-		# {{{
-
-		#copy files from cluster to current directory
-		directory='%s/%s/' % (self.executionpath,dirname)
-		issmscpin(self.name,self.login,self.port,directory,filelist)
-		# }}}
+    # }}}
+    def Download(self, dirname, filelist):    # {{{
+        #copy files from cluster to current directory
+        directory = '%s/%s/' % (self.executionpath, dirname)
+        issmscpin(self.name, self.login, self.port, directory, filelist)
+    # }}}
Index: /issm/trunk/src/m/classes/clusters/fram.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/fram.py	(revision 24312)
+++ /issm/trunk/src/m/classes/clusters/fram.py	(revision 24313)
@@ -7,160 +7,154 @@
 from issmscpout import issmscpout
 from QueueRequirements import QueueRequirements
-import datetime
+from IssmConfig import IssmConfig
 try:
-	from fram_settings import fram_settings
+    from fram_settings import fram_settings
 except ImportError:
-	print 'You need fram_settings.py to proceed, check presence and sys.path'
-	
+    print('You need fram_settings.py to proceed, check presence and sys.path')
+
+
 class fram(object):
-	"""
-	Fram cluster class definition
-	This is a SLURM queue
-	The priorities are based on a point system, reservation when reaching 20000 and earning 1 point per min.
-	  -Devel queue starts at 19990
-	  -Normal starts at 19940
-	  -Normal unpri atarts at 19400
+    """
+    Fram cluster class definition
+    This is a SLURM queue
+    The priorities are based on a point system, reservation when reaching 20000 and earning 1 point per min.
+     - Devel queue starts at 19990
+     - Normal starts at 19940
+     - Normal unpri atarts at 19400
 
-	Jobs can be:
-	  -normal (4 to 30 nodes, more if asked, 48h max walltime, 60Gb per nodes)
-	  -bigmem for big memory nodes (8 512Gb nodes and 2 6Tb nodes, shared nodes, 14days max walltime
+    Jobs can be:
+     - normal (4 to 30 nodes, more if asked, 48h max walltime, 60Gb per nodes)
+     - bigmem for big memory nodes (8 512Gb nodes and 2 6Tb nodes, shared nodes, 14days max walltime
 
-	   Usage:
-	      cluster=stallo();
-	"""
+       Usage:
+          cluster = stallo()
+    """
 
-	def __init__(self,*args):
-	# {{{
-		self.name           = 'fram'
-		self.login          = ''
-		self.numnodes       = 2
-		self.cpuspernode    = 20
-		self.mem            = 1.6
-		self.queue          = 'normal'
-		self.time           = 2*60
-		self.codepath       = ''
-		self.executionpath  = ''
-		self.interactive    = 0
-		self.port           = []
-		self.accountname    = ''
-		self.profiling      = 0
-		#use provided options to change fields
-		options=pairoptions(*args)
+    def __init__(self, *args):    # {{{
+        self.name = 'fram'
+        self.login = ''
+        self.numnodes = 2
+        self.cpuspernode = 20
+        self.mem = 1.6
+        self.queue = 'normal'
+        self.time = 2 * 60
+        self.codepath = ''
+        self.executionpath = ''
+        self.interactive = 0
+        self.port = []
+        self.accountname = ''
+        self.profiling = 0
+    #use provided options to change fields
+        options = pairoptions(*args)
 
-		#initialize cluster using user settings if provided
-		self=stallo_settings(self)
-		#OK get other fields
-		self=options.AssignObjectFields(self)
-		self.np=self.numnodes*self.cpuspernode		
-	# }}}
-	
-	def __repr__(self):
-	# {{{
-		#  display the object
-		s = "class vilje object:"
-		s = "%s\n%s"%(s,fielddisplay(self,'name','name of the cluster'))
-		s = "%s\n%s"%(s,fielddisplay(self,'login','login'))
-		s = "%s\n%s"%(s,fielddisplay(self,'numnodes','number of nodes'))
-		s = "%s\n%s"%(s,fielddisplay(self,'cpuspernode','number of nodes per CPUs'))
-		s = "%s\n%s"%(s,fielddisplay(self,'mem','memory per CPU'))
-		s = "%s\n%s"%(s,fielddisplay(self,'queue','name of the queue (normal (D), short,singlenode,multinode,devel)'))
-		s = "%s\n%s"%(s,fielddisplay(self,'time','walltime requested in minutes'))
-		s = "%s\n%s"%(s,fielddisplay(self,'codepath','code path on the cluster'))
-		s = "%s\n%s"%(s,fielddisplay(self,'executionpath','execution path on the cluster'))
-		s = "%s\n%s"%(s,fielddisplay(self,'interactive',''))
-		s = "%s\n%s"%(s,fielddisplay(self,'accountname','your cluster account'))
-		s = "%s\n%s"%(s,fielddisplay(self,'profiling','enable profiling if 1 default is 0'))
-		return s
-	# }}}
-	def checkconsistency(self,md,solution,analyses):
-	# {{{
-		#Queue dictionarry  gives queue name as key and max walltime and cpus as var
-		queuedict = {'normal':[2*24*60,2048],
-								 'devel':[4*60,2048]}
-		QueueRequirements(queuedict,self.queue,self.np,self.time)
+    #initialize cluster using user settings if provided
+        self = fram_settings(self)
+    #OK get other fields
+        self = options.AssignObjectFields(self)
+        self.np = self.numnodes * self.cpuspernode
+    # }}}
 
-		#Miscelaneous
-		if not self.login:
-			md = md.checkmessage('login empty')
-		if not self.codepath:
-			md = md.checkmessage('codepath empty')
-		if not self.executionpath:
-			md = md.checkmessage('executionpath empty')
-		if self.interactive==1:
-			md = md.checkmessage('interactive mode not implemented')
-		return self
-		# }}}
-	def BuildQueueScript(self,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling):
-		# {{{
+    def __repr__(self):    # {{{
+        #  display the object
+        s = "class vilje object:"
+        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'numnodes', 'number of nodes'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'cpuspernode', 'number of nodes per CPUs'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'mem', 'memory per CPU'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'queue', 'name of the queue (normal (D), short, singlenode, multinode, devel)'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested in minutes'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', 'code path on the cluster'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'execution path on the cluster'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'interactive', ''))
+        s = "%s\n%s" % (s, fielddisplay(self, 'accountname', 'your cluster account'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'profiling', 'enable profiling if 1 default is 0'))
+        return s
+    # }}}
 
-		executable='issm.exe'
-		if isdakota:
-			version=IssmConfig('_DAKOTA_VERSION_')[0:2]
-			version=float(version)
-			if version>=6:
-				executable='issm_dakota.exe'
-		if isoceancoupling:
-			executable='issm_ocean.exe'
-		#write queuing script 
-		shortname=modelname[0:min(12,len(modelname))]
-		fid=open(modelname+'.queue','w')
-									
-		fid.write('#!/bin/bash -l\n')
-		fid.write('#SBATCH --job-name=%s \n' % shortname)
-		fid.write('#SBATCH --partition %s \n' % self.queue)
-		fid.write('#SBATCH --nodes=%i' % self.numnodes)
-		fid.write('#SBATCH --ntasks-per-nodes==%i \n' % self.cpuspernode)									
-		fid.write('#SBATCH --time=%s\n' % self.time) #walltime is minutes
-		fid.write('#SBATCH --mem-per-cpu=%iGB\n' % self.mem)# mem is in GB
-		if (np.mod(self.np,16)+np.mod(self.np,20))==0:
-			fid.write('#SBATCH --ntask=%i\n' % self.np)
-		fid.write('#SBATCH --account=%s\n' % self.accountname) 
-		fid.write('#SBATCH --output %s/%s/%s.outlog \n' % (self.executionpath,dirname,modelname))
-		fid.write('#SBATCH --error %s/%s/%s.errlog \n\n' % (self.executionpath,dirname,modelname))
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Queue dictionarry  gives queue name as key and max walltime and cpus as var
+        queuedict = {'normal': [2 * 24 * 60, 2048],
+                     'devel': [4 * 60, 2048]}
+        QueueRequirements(queuedict, self.queue, self.np, self.time)
 
-		fid.write('export ISSM_DIR="%s/../"\n' % self.codepath)
-		fid.write('module restore system\n')
-		fid.write('module load load Automake/1.15.1-GCCcore-6.3.0\n')
-		fid.write('module load libtool/2.4.6-GCCcore-6.3.0\n')
-		fid.write('module load CMake/3.9.1\n')
-		fid.write('module load PETSc/3.8.0-intel-2017a-Python-2.7.13\n')
-		fid.write('module load ParMETIS/4.0.3-intel-2017a\n')
-		fid.write('cd %s/%s/\n\n' % (self.executionpath,dirname))
-		if self.profiling==1:
-			fid.write('module load perf-report\n')
-			fid.write('perf-report mpirun -np %i %s/%s %s %s/%s %s\n' % (self.np,self.codepath,executable,str(solution),self.executionpath,dirname,modelname))
-		else:
-			fid.write('mpirun -np %i %s/%s %s %s/%s %s\n' % (self.np,self.codepath,executable,str(solution),self.executionpath,dirname,modelname))
-		fid.close()
+    #Miscelaneous
+        if not self.login:
+            md = md.checkmessage('login empty')
+        if not self.codepath:
+            md = md.checkmessage('codepath empty')
+        if not self.executionpath:
+            md = md.checkmessage('executionpath empty')
+        if self.interactive == 1:
+            md = md.checkmessage('interactive mode not implemented')
+        return self
+    # }}}
 
-		# }}}
-	def UploadQueueJob(self,modelname,dirname,filelist):
-		# {{{
-		#compress the files into one zip.
-		compressstring='tar -zcf %s.tar.gz ' % dirname
-		for file in filelist:
-			compressstring += ' %s' % file
-		subprocess.call(compressstring,shell=True)
+    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):    # {{{
+        executable = 'issm.exe'
+        if isdakota:
+            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
+            version = float(version)
+            if version >= 6:
+                executable = 'issm_dakota.exe'
+        if isoceancoupling:
+            executable = 'issm_ocean.exe'
+    #write queuing script
+        shortname = modelname[0:min(12, len(modelname))]
+        fid = open(modelname + '.queue', 'w')
 
-		print 'uploading input file and queueing script'
-		issmscpout(self.name,self.executionpath,self.login,self.port,[dirname+'.tar.gz'])
+        fid.write('#!/bin/bash -l\n')
+        fid.write('#SBATCH --job-name=%s \n' % shortname)
+        fid.write('#SBATCH --partition %s \n' % self.queue)
+        fid.write('#SBATCH --nodes=%i' % self.numnodes)
+        fid.write('#SBATCH --ntasks-per-nodes==%i \n' % self.cpuspernode)
+        fid.write('#SBATCH --time=%s\n' % self.time)  #walltime is minutes
+        fid.write('#SBATCH --mem-per-cpu=%iGB\n' % self.mem)  # mem is in GB
+        if (np.mod(self.np, 16) + np.mod(self.np, 20)) == 0:
+            fid.write('#SBATCH --ntask=%i\n' % self.np)
+        fid.write('#SBATCH --account=%s\n' % self.accountname)
+        fid.write('#SBATCH --output %s/%s /%s.outlog \n' % (self.executionpath, dirname, modelname))
+        fid.write('#SBATCH --error %s/%s /%s.errlog \n\n' % (self.executionpath, dirname, modelname))
 
-		# }}}
-	def LaunchQueueJob(self,modelname,dirname,filelist,restart,batch):
-		# {{{
+        fid.write('export ISSM_DIR="%s/../ "\n' % self.codepath)
+        fid.write('module restore system\n')
+        fid.write('module load load Automake/1.15.1-GCCcore-6.3.0\n')
+        fid.write('module load libtool/2.4.6-GCCcore-6.3.0\n')
+        fid.write('module load CMake/3.9.1\n')
+        fid.write('module load PETSc/3.8.0-intel-2017a-Python-2.7.13\n')
+        fid.write('module load ParMETIS/4.0.3-intel-2017a\n')
+        fid.write('cd %s/%s/ \n\n' % (self.executionpath, dirname))
+        if self.profiling == 1:
+            fid.write('module load perf-report\n')
+            fid.write('perf-report mpirun -np %i %s/%s %s %s/%s %s\n' % (self.np, self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
+        else:
+            fid.write('mpirun -np %i %s/%s %s %s/%s %s\n' % (self.np, self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
+        fid.close()
 
-		print 'launching solution sequence on remote cluster'
-		if restart:
-			launchcommand='cd %s && cd %s && sbatch %s.queue' % (self.executionpath,dirname,modelname)
-		else:
-			launchcommand='cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && sbatch %s.queue' % (self.executionpath,dirname,dirname,dirname,dirname,dirname,modelname)
-		issmssh(self.name,self.login,self.port,launchcommand)
+    # }}}
 
-		# }}}
-	def Download(self,dirname,filelist):
-		# {{{
+    def UploadQueueJob(self, modelname, dirname, filelist):    # {{{
+        #compress the files into one zip.
+        compressstring = 'tar -zcf %s.tar.gz ' % dirname
+        for file in filelist:
+            compressstring += ' %s' % file
+        subprocess.call(compressstring, shell=True)
 
-		#copy files from cluster to current directory
-		directory='%s/%s/' % (self.executionpath,dirname)
-		issmscpin(self.name,self.login,self.port,directory,filelist)
-		# }}}
+        print('uploading input file and queueing script')
+        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
+
+    # }}}
+    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):    # {{{
+        print('launching solution sequence on remote cluster')
+        if restart:
+            launchcommand = 'cd %s && cd %s && sbatch %s.queue' % (self.executionpath, dirname, modelname)
+        else:
+            launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && sbatch %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+        issmssh(self.name, self.login, self.port, launchcommand)
+
+    # }}}
+    def Download(self, dirname, filelist):    # {{{
+        #copy files from cluster to current directory
+        directory = '%s/%s/' % (self.executionpath, dirname)
+        issmscpin(self.name, self.login, self.port, directory, filelist)
+    # }}}
Index: /issm/trunk/src/m/classes/clusters/generic.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/generic.py	(revision 24312)
+++ /issm/trunk/src/m/classes/clusters/generic.py	(revision 24313)
@@ -11,199 +11,196 @@
 import MatlabFuncs as m
 
+
 class generic(object):
-	"""
-	GENERIC cluster class definition
- 
-	   Usage:
-	      cluster=generic('name','astrid','np',3);
-	      cluster=generic('name',gethostname(),'np',3,'login','username');
-	"""
-
-	def __init__(self,*args):    # {{{
-
-		self.name=''
-		self.login=''
-		self.np=1
-		self.port=0
-		self.interactive=1
-		self.codepath=IssmConfig('ISSM_PREFIX')[0]+'/bin'
-		self.executionpath=issmdir()+'/execution'
-		self.valgrind=issmdir()+'/externalpackages/valgrind/install/bin/valgrind'
-		self.valgrindlib=issmdir()+'/externalpackages/valgrind/install/lib/libmpidebug.so'
-		self.valgrindsup=issmdir()+'/externalpackages/valgrind/issm.supp'
-
-		#use provided options to change fields
-		options=pairoptions(*args)
-
-		#get name
-		self.name=socket.gethostname()
-
-		#initialize cluster using user settings if provided
-		if os.path.exists(self.name+'_settings.py'):
-			execfile(self.name+'_settings.py',globals())
-
-		#OK get other fields
-		self=options.AssignObjectFields(self)
-	# }}}
-	def __repr__(self):    # {{{
-		#  display the object
-		s ="class '%s' object '%s' = \n" % (type(self),'self')
-		s+="    name: %s\n" % self.name
-		s+="    login: %s\n" % self.login
-		s+="    np: %i\n" % self.np
-		s+="    port: %i\n" % self.port
-		s+="    codepath: %s\n" % self.codepath
-		s+="    executionpath: %s\n" % self.executionpath
-		s+="    valgrind: %s\n" % self.valgrind
-		s+="    valgrindlib: %s\n" % self.valgrindlib
-		s+="    valgrindsup: %s\n" % self.valgrindsup
-		return s
-	# }}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		if self.np<1:
-			md = checkmessage(md,'number of processors should be at least 1')
-		if math.isnan(self.np):
-			md = checkmessage(md,'number of processors should not be NaN!')
-
-		return md
-	# }}}
-	def BuildQueueScript(self,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling):    # {{{
-
-		executable='issm.exe';
-		if isdakota:
-			version=IssmConfig('_DAKOTA_VERSION_')
-			version=float(version[0])
-			if version>=6:
-				executable='issm_dakota.exe'
-		if isoceancoupling:
-			executable='issm_ocean.exe'
-
-		#write queuing script 
-		if not m.ispc():
-
-			fid=open(modelname+'.queue','w')
-			fid.write('#!/bin/sh\n')
-			if not isvalgrind:
-				if self.interactive: 
-					if IssmConfig('_HAVE_MPI_')[0]:
-						fid.write('mpiexec -np %i %s/%s %s %s/%s %s ' % (self.np,self.codepath,executable,solution,self.executionpath,dirname,modelname))
-					else:
-						fid.write('%s/%s %s %s/%s %s ' % (self.codepath,executable,solution,self.executionpath,dirname,modelname))
-				else:
-					if IssmConfig('_HAVE_MPI_')[0]:
-						fid.write('mpiexec -np %i %s/%s %s %s/%s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,executable,solution,self.executionpath,dirname,modelname,modelname,modelname))
-					else:
-						fid.write('%s/%s %s %s/%s %s 2> %s.errlog >%s.outlog ' % (self.codepath,executable,solution,self.executionpath,dirname,modelname,modelname,modelname))
-			elif isgprof:
-				fid.write('\n gprof %s/%s gmon.out > %s.performance' % (self.codepath,executable,modelname))
-			else:
-				#Add --gen-suppressions=all to get suppression lines
-				fid.write('LD_PRELOAD=%s \\\n' % self.valgrindlib)
-				if IssmConfig('_HAVE_MPI_')[0]:
-					fid.write('mpiexec -np %i %s --leak-check=full --suppressions=%s %s/%s %s %s/%s %s 2> %s.errlog >%s.outlog ' % \
-							(self.np,self.valgrind,self.valgrindsup,self.codepath,executable,solution,self.executionpath,dirname,modelname,modelname,modelname))
-				else:	
-					fid.write('%s --leak-check=full --suppressions=%s %s/%s %s %s/%s %s 2> %s.errlog >%s.outlog ' % \
-							(self.valgrind,self.valgrindsup,self.codepath,executable,solution,self.executionpath,dirname,modelname,modelname,modelname))
-
-			if not io_gather:    #concatenate the output files:
-				fid.write('\ncat %s.outbin.* > %s.outbin' % (modelname,modelname))
-			fid.close()
-
-		else:    # Windows
-
-			fid=open(modelname+'.bat','w')
-			fid.write('@echo off\n')
-			if self.interactive:
-				fid.write('"%s/%s" %s "%s/%s" %s ' % (self.codepath,executable,solution,self.executionpath,dirname,modelname))
-			else:
-				fid.write('"%s/%s" %s "%s/%s" %s 2> %s.errlog >%s.outlog' % \
-					(self.codepath,executable,solution,self.executionpath,dirname,modelname,modelname,modelname))
-			fid.close()
-
-		#in interactive mode, create a run file, and errlog and outlog file
-		if self.interactive:
-			fid=open(modelname+'.errlog','w')
-			fid.close()
-			fid=open(modelname+'.outlog','w')
-			fid.close()
-	# }}}
-	def BuildKrigingQueueScript(self,modelname,solution,io_gather,isvalgrind,isgprof):    # {{{
-
-		#write queuing script 
-		if not m.ispc():
-
-			fid=open(modelname+'.queue','w')
-			fid.write('#!/bin/sh\n')
-			if not isvalgrind:
-				if self.interactive:
-					fid.write('mpiexec -np %i %s/kriging.exe %s/%s %s ' % (self.np,self.codepath,self.executionpath,modelname,modelname))
-				else:
-					fid.write('mpiexec -np %i %s/kriging.exe %s/%s %s 2> %s.errlog >%s.outlog ' % (self.np,self.codepath,self.executionpath,modelname,modelname,modelname,modelname))
-			elif isgprof:
-				fid.write('\n gprof %s/kriging.exe gmon.out > %s.performance' & (self.codepath,modelname))
-			else:
-				#Add --gen-suppressions=all to get suppression lines
-				fid.write('LD_PRELOAD=%s \\\n' % self.valgrindlib)
-				fid.write('mpiexec -np %i %s --leak-check=full --suppressions=%s %s/kriging.exe %s/%s %s 2> %s.errlog >%s.outlog ' % \
-					(self.np,self.valgrind,self.valgrindsup,self.codepath,self.executionpath,modelname,modelname,modelname,modelname))
-			if not io_gather:    #concatenate the output files:
-				fid.write('\ncat %s.outbin.* > %s.outbin' % (modelname,modelname))
-			fid.close()
-
-		else:    # Windows
-
-			fid=open(modelname+'.bat','w')
-			fid.write('@echo off\n')
-			if self.interactive:
-				fid.write('"%s/issm.exe" %s "%s/%s" %s ' % (self.codepath,solution,self.executionpath,modelname,modelname))
-			else:
-				fid.write('"%s/issm.exe" %s "%s/%s" %s 2> %s.errlog >%s.outlog' % \
-					(self.codepath,solution,self.executionpath,modelname,modelname,modelname,modelname))
-			fid.close()
-
-		#in interactive mode, create a run file, and errlog and outlog file
-		if self.interactive:
-			fid=open(modelname+'.errlog','w')
-			fid.close()
-			fid=open(modelname+'.outlog','w')
-			fid.close()
-	# }}}
-	def UploadQueueJob(self,modelname,dirname,filelist):    # {{{
-
-		#compress the files into one zip.
-		compressstring='tar -zcf %s.tar.gz ' % dirname
-		for file in filelist:
-			compressstring += ' %s' % file
-		if self.interactive:
-			compressstring += ' %s.errlog %s.outlog ' % (modelname,modelname)
-		subprocess.call(compressstring,shell=True)
-
-		print 'uploading input file and queueing script'
-		issmscpout(self.name,self.executionpath,self.login,self.port,[dirname+'.tar.gz'])
-
-	# }}}
-	def LaunchQueueJob(self,modelname,dirname,filelist,restart,batch):    # {{{
-
-		print 'launching solution sequence on remote cluster'
-		if restart:
-			launchcommand='cd %s && cd %s chmod 777 %s.queue && ./%s.queue' % (self.executionpath,dirname,modelname,modelname)
-		else:
-			if batch:
-				launchcommand='cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz' % \
-						(self.executionpath,dirname,dirname,dirname,dirname,dirname)
-			else:
-				launchcommand='cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && chmod 777 %s.queue && ./%s.queue' % \
-					(self.executionpath,dirname,dirname,dirname,dirname,dirname,modelname,modelname)
-		issmssh(self.name,self.login,self.port,launchcommand)
-	# }}}
-	def Download(self,dirname,filelist):     # {{{
-
-		if m.ispc():
-			#do nothing
-			return
-
-		#copy files from cluster to current directory
-		directory='%s/%s/' % (self.executionpath,dirname)
-		issmscpin(self.name,self.login,self.port,directory,filelist)
-	# }}}
+    """
+    GENERIC cluster class definition
+
+       Usage:
+          cluster = generic('name', 'astrid', 'np', 3)
+          cluster = generic('name', gethostname(), 'np', 3, 'login', 'username')
+    """
+
+    def __init__(self, *args):  # {{{
+        self.name = ''
+        self.login = ''
+        self.np = 1
+        self.port = 0
+        self.interactive = 1
+        self.codepath = IssmConfig('ISSM_PREFIX')[0] + '/bin'
+        self.executionpath = issmdir() + '/execution'
+        self.valgrind = issmdir() + '/externalpackages/valgrind/install/bin/valgrind'
+        self.valgrindlib = issmdir() + '/externalpackages/valgrind/install/lib/libmpidebug.so'
+        self.valgrindsup = issmdir() + '/externalpackages/valgrind/issm.supp'
+
+        #use provided options to change fields
+        options = pairoptions(*args)
+
+        #get name
+        self.name = socket.gethostname()
+
+        #initialize cluster using user settings if provided
+        if os.path.exists(self.name + '_settings.py'):
+            exec(compile(open(self.name + '_settings.py').read(), self.name + '_settings.py', 'exec'), globals())
+
+        #OK get other fields
+        self = options.AssignObjectFields(self)
+    # }}}
+
+    def __repr__(self):  # {{{
+        #  display the object
+        s = "class '%s' object '%s' = \n" % (type(self), 'self')
+        s += "    name: %s\n" % self.name
+        s += "    login: %s\n" % self.login
+        s += "    np: %i\n" % self.np
+        s += "    port: %i\n" % self.port
+        s += "    codepath: %s\n" % self.codepath
+        s += "    executionpath: %s\n" % self.executionpath
+        s += "    valgrind: %s\n" % self.valgrind
+        s += "    valgrindlib: %s\n" % self.valgrindlib
+        s += "    valgrindsup: %s\n" % self.valgrindsup
+        return s
+    # }}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if self.np < 1:
+            md = checkmessage(md, 'number of processors should be at least 1')
+        if math.isnan(self.np):
+            md = checkmessage(md, 'number of processors should not be NaN!')
+
+        return md
+    # }}}
+    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):  # {{{
+
+        executable = 'issm.exe'
+        if isdakota:
+            version = IssmConfig('_DAKOTA_VERSION_')
+            version = float(version[0])
+            if version >= 6:
+                executable = 'issm_dakota.exe'
+        if isoceancoupling:
+            executable = 'issm_ocean.exe'
+
+        #write queuing script
+        if not m.ispc():
+            fid = open(modelname + '.queue', 'w')
+            fid.write('#!/bin/sh\n')
+            if not isvalgrind:
+                if self.interactive:
+                    if IssmConfig('_HAVE_MPI_')[0]:
+                        fid.write('mpiexec -np {} {}/{} {} {}/{} {}'.format(self.np, self.codepath, executable, solution, self.executionpath, dirname, modelname))
+                    else:
+                        fid.write('{}/{} {} {}/{} {} '.format(self.codepath, executable, solution, self.executionpath, dirname, modelname))
+                else:
+                    if IssmConfig('_HAVE_MPI_')[0]:
+                        fid.write('mpiexec -np {} {}/{} {} {}/{} {} 2>{}.errlog>{}.outlog'.
+                                  format(self.np, self.codepath, executable, solution, self.executionpath, dirname, modelname, modelname, modelname))
+                    else:
+                        fid.write('{}/{} {} {}/{} {} 2>{}.errlog>{}.outlog '.
+                                  format(self.codepath, executable, solution, self.executionpath, dirname, modelname, modelname, modelname))
+            elif isgprof:
+                fid.write('\n gprof {}/{} gmon.out > {}.performance'.format(self.codepath, executable, modelname))
+            else:
+                #Add --gen -suppressions = all to get suppression lines
+                fid.write('LD_PRELOAD={} \\\n'.format(self.valgrindlib))
+                if IssmConfig('_HAVE_MPI_')[0]:
+                    fid.write('mpiexec -np {} {} --leak-check=full --suppressions={} {}/{} {} {}/{} {} 2>{}.errlog>{}.outlog '.
+                              format(self.np, self.valgrind, self.valgrindsup, self.codepath, executable, solution, self.executionpath, dirname, modelname, modelname, modelname))
+                else:
+                    fid.write('{} --leak-check=full --suppressions={} {}/{} {} {}/{} {} 2>{}.errlog>{}.outlog '.
+                              format(self.valgrind, self.valgrindsup, self.codepath, executable, solution, self.executionpath, dirname, modelname, modelname, modelname))
+
+            if not io_gather:  #concatenate the output files:
+                fid.write('\ncat {}.outbin .*>{}.outbin'.format(modelname, modelname))
+            fid.close()
+
+        else:  # Windows
+            fid = open(modelname + '.bat', 'w')
+            fid.write('@echo off\n')
+            if self.interactive:
+                fid.write('"{}/{}" {} "{}/{}" {} '.format(self.codepath, executable, solution, self.executionpath, dirname, modelname))
+            else:
+                fid.write('"{}/{}" {} "{}/{}" {} 2>{}.errlog>{}.outlog'.
+                          format(self.codepath, executable, solution, self.executionpath, dirname, modelname, modelname, modelname))
+            fid.close()
+
+            #in interactive mode, create a run file, and errlog and outlog file
+        if self.interactive:
+            fid = open(modelname + '.errlog', 'w')
+            fid.close()
+            fid = open(modelname + '.outlog', 'w')
+            fid.close()
+    # }}}
+
+    def BuildKrigingQueueScript(self, modelname, solution, io_gather, isvalgrind, isgprof):  # {{{
+        #write queuing script
+        if not m.ispc():
+            fid = open(modelname + '.queue', 'w')
+            fid.write('#!/bin/sh\n')
+            if not isvalgrind:
+                if self.interactive:
+                    fid.write('mpiexec -np {} {}/kriging.exe {}/{} {} '.format(self.np, self.codepath, self.executionpath, modelname, modelname))
+                else:
+                    fid.write('mpiexec -np {} {}/kriging.exe {}/{} {} 2>{}.errlog>{}.outlog '.format(self.np, self.codepath, self.executionpath, modelname, modelname, modelname, modelname))
+            elif isgprof:
+                fid.write('\n gprof {}/kriging.exe gmon.out>{}.performance'.format(self.codepath, modelname))
+            else:
+                #Add - -    gen - suppressions = all to get suppression lines
+                #fid.write('LD_PRELOAD={} \\\n'.format(self.valgrindlib))
+                fid.write('mpiexec -np {} {} --leak -check=full --suppressions={} {}/kriging.exe {}/{} {} 2 > {}.errlog > {}.outlog ' .format
+                          (self.np, self.valgrind, self.valgrindsup, self.codepath, self.executionpath, modelname, modelname, modelname, modelname))
+            if not io_gather:    #concatenate the output files:
+                fid.write('\ncat {}.outbin. *>{}.outbin'.format(modelname, modelname))
+            fid.close()
+
+        else:    # Windows
+            fid = open(modelname + '.bat', 'w')
+            fid.write('@echo off\n')
+            if self.interactive:
+                fid.write('"{}/issm.exe" {} "{}/{}" {} '.format(self.codepath, solution, self.executionpath, modelname, modelname))
+            else:
+                fid.write('"{}/issm.exe" {} "{}/{}" {} 2>{}.errlog>{}.outlog'.format
+                          (self.codepath, solution, self.executionpath, modelname, modelname, modelname, modelname))
+            fid.close()
+
+        #in interactive mode, create a run file, and errlog and outlog file
+        if self.interactive:
+            fid = open(modelname + '.errlog', 'w')
+            fid.close()
+            fid = open(modelname + '.outlog', 'w')
+            fid.close()
+    # }}}
+
+    def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
+        #compress the files into one zip.
+        compressstring = 'tar -zcf {}.tar.gz '.format(dirname)
+        for file in filelist:
+            compressstring += ' {}'.format(file)
+        if self.interactive:
+            compressstring += ' {}.errlog {}.outlog '.format(modelname, modelname)
+        subprocess.call(compressstring, shell=True)
+
+        print('uploading input file and queueing script')
+        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
+
+    # }}}
+
+    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
+        print('launching solution sequence on remote cluster')
+        if restart:
+            launchcommand = 'cd {} && cd {} chmod 777 {}.queue && ./{}.queue'.format(self.executionpath, dirname, modelname, modelname)
+        else:
+            if batch:
+                launchcommand = 'cd {} && rm -rf ./{} && mkdir {} && cd {} && mv ../{}.tar.gz ./&& tar -zxf {}.tar.gz'.format(self.executionpath, dirname, dirname, dirname, dirname, dirname)
+            else:
+                launchcommand = 'cd {} && rm -rf ./{} && mkdir {} && cd {} && mv ../{}.tar.gz ./&& tar -zxf {}.tar.gz  && chmod 777 {}.queue && ./{}.queue'.format(self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname, modelname)
+        issmssh(self.name, self.login, self.port, launchcommand)
+    # }}}
+
+    def Download(self, dirname, filelist):  # {{{
+        if m.ispc():
+            #do nothing
+            return
+        #copy files from cluster to current directory
+        directory = '{}/{}/'.format(self.executionpath, dirname)
+        issmscpin(self.name, self.login, self.port, directory, filelist)
+    # }}}
Index: /issm/trunk/src/m/classes/clusters/greenplanet.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/greenplanet.m	(revision 24312)
+++ /issm/trunk/src/m/classes/clusters/greenplanet.m	(revision 24313)
@@ -56,5 +56,5 @@
 		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
 
-			 available_queues={'c6145','default'};
+			 available_queues={'c6145','ilg2.3','default'};
 			 queue_requirements_time=[Inf Inf];
 			 queue_requirements_np=[80 80];
@@ -94,5 +94,5 @@
 		 end
 		 %}}}
-		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota) % {{{
+		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
 
 			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
@@ -112,5 +112,5 @@
 			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
 			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
-			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+			 fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
 			 if ~io_gather, %concatenate the output files:
 				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
@@ -121,5 +121,5 @@
 			 if cluster.interactive,
 				 fid=fopen([modelname '.run'],'w');
-				 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+				 fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
 				 if ~io_gather, %concatenate the output files:
 					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
@@ -152,8 +152,8 @@
 			 disp('launching solution sequence on remote cluster');
 			 if ~isempty(restart)
-				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && qsub ' modelname '.queue '];
+				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
 			 else
 				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && qsub ' modelname '.queue '];
+					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
 			 end
 			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
Index: /issm/trunk/src/m/classes/clusters/hexagon.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/hexagon.py	(revision 24312)
+++ /issm/trunk/src/m/classes/clusters/hexagon.py	(revision 24313)
@@ -5,147 +5,141 @@
 from issmscpin import issmscpin
 from issmscpout import issmscpout
-from QueueRequirements import QueueRequirements
+from IssmConfig import IssmConfig
 import datetime
 try:
-	from hexagon_settings import hexagon_settings
+    from hexagon_settings import hexagon_settings
 except ImportError:
-	print 'You need hexagon_settings.py to proceed, check presence and sys.path'
-	
+    print('You need hexagon_settings.py to proceed, check presence and sys.path')
+
+
 class hexagon(object):
-	"""
-	Hexagon cluster class definition
-	Hexagon have nodes built of 2*16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway. 
-	You can reduce this number if you run out of memory as the total node memory is divided by the number of procs
-	   Usage:
-	      cluster=hexagon();
-	"""
+    """
+    Hexagon cluster class definition
+    Hexagon have nodes built of 2 * 16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway.
+    You can reduce this number if you run out of memory as the total node memory is divided by the number of procs
+       Usage:
+          cluster = hexagon()
+    """
 
-	def __init__(self,*args):
-		# {{{
-		self.name           = 'hexagon'
-		self.login          = ''
-		self.numnodes       = 2
-		self.procspernodes  = 32
-		self.mem            = 32000
-		self.queue          = 'batch'
-		self.time           = 2*60
-		self.codepath       = ''
-		self.executionpath  = ''
-		self.interactive    = 0
-		self.port           = []
-		self.accountname    = ''
+    def __init__(self, *args):  # {{{
+        self.name = 'hexagon'
+        self.login = ''
+        self.numnodes = 2
+        self.procspernodes = 32
+        self.mem = 32000
+        self.queue = 'batch'
+        self.time = 2 * 60
+        self.codepath = ''
+        self.executionpath = ''
+        self.interactive = 0
+        self.port = []
+        self.accountname = ''
 
-		#use provided options to change fields
-		options=pairoptions(*args)
+    #use provided options to change fields
+        options = pairoptions(*args)
 
-		#initialize cluster using user settings if provided
-		self=hexagon_settings(self)
+    #initialize cluster using user settings if provided
+        self = hexagon_settings(self)
 
-		#OK get other fields
-		self=options.AssignObjectFields(self)
-		self.np=self.numnodes*self.procspernodes
-		# }}}
-	def __repr__(self):
-		# {{{
-		#  display the object
-		s = "class hexagon object:"
-		s = "%s\n%s"%(s,fielddisplay(self,'name','name of the cluster'))
-		s = "%s\n%s"%(s,fielddisplay(self,'login','login'))
-		s = "%s\n%s"%(s,fielddisplay(self,'numnodes','number of nodes'))
-		s = "%s\n%s"%(s,fielddisplay(self,'procspernodes','number of mpi procs per nodes  default and optimal is 32'))
-		s = "%s\n%s"%(s,fielddisplay(self,'mem','Total node memory'))
-		s = "%s\n%s"%(s,fielddisplay(self,'queue','name of the queue'))
-		s = "%s\n%s"%(s,fielddisplay(self,'time','walltime requested in minutes'))
-		s = "%s\n%s"%(s,fielddisplay(self,'codepath','code path on the cluster'))
-		s = "%s\n%s"%(s,fielddisplay(self,'executionpath','execution path on the cluster'))
-		s = "%s\n%s"%(s,fielddisplay(self,'interactive',''))
-		s = "%s\n%s"%(s,fielddisplay(self,'accountname','your cluster account'))
-		return s
-                # }}}
-	def checkconsistency(self,md,solution,analyses):
-		# {{{
-		#mem should not be over 32000mb
-		#numprocs should not be over 4096
-		#we have cpupernodes*numberofcpus=mppwidth and mppnppn=cpupernodes, 
-		#Miscelaneous
-		if not self.login:
-			md = md.checkmessage('login empty')
-		if not self.codepath:
-			md = md.checkmessage('codepath empty')
-		if not self.executionpath:
-			md = md.checkmessage('executionpath empty')
-		if self.interactive==1:
-			md = md.checkmessage('interactive mode not implemented')
-		if self.mem>32000:
-			md = md.checkmessage('asking too much memory max is 32000 per node')
-		return self
-                # }}}
-	def BuildQueueScript(self,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling):
-		# {{{
+    #OK get other fields
+        self = options.AssignObjectFields(self)
+        self.np = self.numnodes * self.procspernodes
+    # }}}
 
-		executable='issm.exe'
-		if isdakota:
-			version=IssmConfig('_DAKOTA_VERSION_')[0:2]
-			version=float(version)
-			if version>=6:
-				executable='issm_dakota.exe'
-		if isoceancoupling:
-			executable='issm_ocean.exe'
+    def __repr__(self):      # {{{
+        #  display the object
+        s = "class hexagon object:"
+        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'numnodes', 'number of nodes'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'procspernodes', 'number of mpi procs per nodes  default and optimal is 32'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'mem', 'Total node memory'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'queue', 'name of the queue'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested in minutes'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', 'code path on the cluster'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'execution path on the cluster'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'interactive', ''))
+        s = "%s\n%s" % (s, fielddisplay(self, 'accountname', 'your cluster account'))
+        return s
+    # }}}
 
-		#write queuing script 
-		shortname=modelname[0:min(12,len(modelname))]
-		fid=open(modelname+'.queue','w')
-		fid.write('#!/bin/bash\n')
-		fid.write('#PBS -N %s \n' % shortname)
-		fid.write('#PBS -l mppwidth=%i,mppnppn=%i\n' % (self.np,self.procspernodes))
-                timeobj=datetime.timedelta(minutes=self.time)
-                m,s=divmod(timeobj.total_seconds(), 60)
-                h,m=divmod(m, 60)
-                timestring="%02d:%02d:%02d" % (h, m, s)
-		fid.write('#PBS -l walltime=%s\n' % timestring) #walltime is hh:mm:ss
-		fid.write('#PBS -l mppmem=%imb\n' % int(self.mem/self.procspernodes))
-		fid.write('#PBS -A %s\n' % self.accountname) 
-		fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath,dirname,modelname))
-		fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath,dirname,modelname))
-		fid.write('export ISSM_DIR="%s/../"\n' % self.codepath)
-		fid.write('export CRAY_ROOTFS=DSL\n')
-		fid.write('module swap PrgEnv-cray/5.2.40 PrgEnv-gnu\n')
-		fid.write('module load cray-petsc\n')
-		fid.write('module load cray-tpsl\n')
-		fid.write('module load cray-mpich\n')
-		fid.write('module load gsl\n')
-		fid.write('cd %s/%s/\n\n' % (self.executionpath,dirname))
-		fid.write('aprun -B %s/%s %s %s/%s %s\n' % (self.codepath,executable,str(solution),self.executionpath,dirname,modelname))
-		fid.close()
+    def checkconsistency(self, md, solution, analyses):      # {{{
+        #mem should not be over 32000mb
+        #numprocs should not be over 4096
+        #we have cpupernodes * numberofcpus = mppwidth and mppnppn = cpupernodes,
+        #Miscelaneous
+        if not self.login:
+            md = md.checkmessage('login empty')
+        if not self.codepath:
+            md = md.checkmessage('codepath empty')
+        if not self.executionpath:
+            md = md.checkmessage('executionpath empty')
+        if self.interactive == 1:
+            md = md.checkmessage('interactive mode not implemented')
+        if self.mem > 32000:
+            md = md.checkmessage('asking too much memory max is 32000 per node')
+        return self
+    # }}}
 
-		# }}}
-	def UploadQueueJob(self,modelname,dirname,filelist):
-		# {{{
+    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):    # {{{
+        executable = 'issm.exe'
+        if isdakota:
+            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
+            version = float(version)
+            if version >= 6:
+                executable = 'issm_dakota.exe'
+        if isoceancoupling:
+            executable = 'issm_ocean.exe'
 
-		#compress the files into one zip.
-		compressstring='tar -zcf %s.tar.gz ' % dirname
-		for file in filelist:
-			compressstring += ' %s' % file
-		subprocess.call(compressstring,shell=True)
+    #write queuing script
+        shortname = modelname[0:min(12, len(modelname))]
+        fid = open(modelname + '.queue', 'w')
+        fid.write('  #!/bin/bash\n')
+        fid.write('  #PBS - N %s \n' % shortname)
+        fid.write('  #PBS - l mppwidth=%i, mppnppn=%i\n' % (self.np, self.procspernodes))
+        timeobj = datetime.timedelta(minutes=self.time)
+        m, s = divmod(timeobj.total_seconds(), 60)
+        h, m = divmod(m, 60)
+        timestring = "%02d:%02d:%02d" % (h, m, s)
+        fid.write('#PBS -l walltime=%s\n' % timestring)  #walltime is hh:mm:ss
+        fid.write('#PBS -l mppmem=%imb\n' % int(self.mem / self.procspernodes))
+        fid.write('#PBS -A %s\n' % self.accountname)
+        fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath, dirname, modelname))
+        fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath, dirname, modelname))
+        fid.write('export ISSM_DIR="%s/../"\n' % self.codepath)
+        fid.write('export CRAY_ROOTFS=DSL\n')
+        fid.write('module swap PrgEnv-cray / 5.2.40 PrgEnv - gnu\n')
+        fid.write('module load cray-petsc\n')
+        fid.write('module load cray-tpsl\n')
+        fid.write('module load cray-mpich\n')
+        fid.write('module load gsl\n')
+        fid.write('cd %s/%s/\n\n' % (self.executionpath, dirname))
+        fid.write('aprun -B %s/%s %s %s/%s %s\n' % (self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
+        fid.close()
+    # }}}
 
-		print 'uploading input file and queueing script'
-		issmscpout(self.name,self.executionpath,self.login,self.port,[dirname+'.tar.gz'])
+    def UploadQueueJob(self, modelname, dirname, filelist):    # {{{
+        #compress the files into one zip.
+        compressstring = 'tar -zcf %s.tar.gz ' % dirname
+        for file in filelist:
+            compressstring += ' %s' % file
+        subprocess.call(compressstring, shell=True)
 
-		# }}}
-	def LaunchQueueJob(self,modelname,dirname,filelist,restart,batch):
-		# {{{
+        print('uploading input file and queueing script')
+        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
+    # }}}
 
-		print 'launching solution sequence on remote cluster'
-		if restart:
-			launchcommand='cd %s && cd %s && qsub %s.queue' % (self.executionpath,dirname,modelname)
-		else:
-			launchcommand='cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && qsub %s.queue' % (self.executionpath,dirname,dirname,dirname,dirname,dirname,modelname)
-		issmssh(self.name,self.login,self.port,launchcommand)
+    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):    # {{{
+        print('launching solution sequence on remote cluster')
+        if restart:
+            launchcommand = 'cd %s && cd %s && qsub %s.queue' % (self.executionpath, dirname, modelname)
+        else:
+            launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && qsub %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+        issmssh(self.name, self.login, self.port, launchcommand)
+    # }}}
 
-		# }}}
-	def Download(self,dirname,filelist):
-		# {{{
-		#copy files from cluster to current directory
-		directory='%s/%s/' % (self.executionpath,dirname)
-		issmscpin(self.name,self.login,self.port,directory,filelist)
-		# }}}
+    def Download(self, dirname, filelist):    # {{{
+        #copy files from cluster to current directory
+        directory = '%s/%s/' % (self.executionpath, dirname)
+        issmscpin(self.name, self.login, self.port, directory, filelist)
+    # }}}
Index: /issm/trunk/src/m/classes/clusters/hpc.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/hpc.m	(revision 24312)
+++ /issm/trunk/src/m/classes/clusters/hpc.m	(revision 24313)
@@ -144,5 +144,5 @@
 
 		 end %}}}
-		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart)% {{{
+		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
 
 			 disp('launching solution sequence on remote cluster');
Index: /issm/trunk/src/m/classes/clusters/lonestar.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/lonestar.m	(revision 24312)
+++ /issm/trunk/src/m/classes/clusters/lonestar.m	(revision 24313)
@@ -11,8 +11,8 @@
 		 name          = 'ls5.tacc.utexas.edu'
 		 login         = '';
-		 modules        = {};
+		 modules        = {'intel/16.0.1'};
 		 numnodes      = 1;
 		 cpuspernode   = 24;
-		 port          = 0;
+		 port          = 1099;
 		 queue         = 'normal';
 		 codepath      = '';
@@ -120,5 +120,5 @@
 			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
 			 fprintf(fid,'#SBATCH -e %s.errlog \n',modelname);
-			 fprintf(fid,'#SBATCH -n %i \n',cluster.numnodes*cluster.cpuspernode);
+			 fprintf(fid,'#SBATCH -n %i \n',cluster.numnodes*max(cluster.numnodes,24));
 			 fprintf(fid,'#SBATCH -N %i \n',cluster.numnodes);
 			 fprintf(fid,'#SBATCH -t %02i:%02i:00 \n\n',floor(cluster.time/3600),floor(mod(cluster.time,3600)/60));
@@ -127,11 +127,13 @@
 			 end
 
-			 %fprintf(fid,'export KMP_AFFINITY="granularity=fine,compact,verbose" \n\n');
+			 if isdakota,
+				 fprintf(fid,'export KMP_AFFINITY="granularity=fine,compact,verbose" \n\n');
+			 end
 
 			 if length(find(cluster.email=='@'))>0
-				 %fprintf(fid,'#SBATCH --mail-user=%s \n',cluster.email);
-				 %fprintf(fid,'#SBATCH --mail-type=end \n\n');
-
-				 fprintf(fid,'ssh login1 "mail -s ''SLURM Jobid=${SLURM_JOBID} Name=${SLURM_JOB_NAME} Began on Lonestar 5.'' %s <<< ''Job Started'' " \n\n',cluster.email);
+				 fprintf(fid,'#SBATCH --mail-user=%s \n',cluster.email);
+				 fprintf(fid,'#SBATCH --mail-type=end \n\n');
+
+				 %fprintf(fid,'ssh login1 "mail -s ''SLURM Jobid=${SLURM_JOBID} Name=${SLURM_JOB_NAME} Began on Lonestar 5.'' %s <<< ''Job Started'' " \n\n',cluster.email);
 			 end
 
@@ -145,8 +147,4 @@
 			 end
 
-			 if length(find(cluster.email=='@'))>0
-				 fprintf(fid,'\n');
-				 fprintf(fid,'ssh login1 "mail -s ''SLURM Jobid=${SLURM_JOBID} Name=${SLURM_JOB_NAME} Ended on Lonestar 5.'' %s <<< ''Job Ended'' " \n\n',cluster.email);
-			 end
 			 fclose(fid);
 
Index: /issm/trunk/src/m/classes/clusters/pfe.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/pfe.py	(revision 24312)
+++ /issm/trunk/src/m/classes/clusters/pfe.py	(revision 24313)
@@ -1,5 +1,2 @@
-# import socket
-# import os
-# import math
 import subprocess
 from fielddisplay import fielddisplay
@@ -9,192 +6,182 @@
 from issmscpout import issmscpout
 from QueueRequirements import QueueRequirements
+from IssmConfig import IssmConfig
 try:
-	from pfe_settings import pfe_settings
+    from pfe_settings import pfe_settings
 except ImportError:
-	print 'You need pfe_settings.py to proceed, check presence and sys.path'
-	
-class pfe(object):
-	"""
-	PFE cluster class definition
- 
-	   Usage:
-	      cluster=pfe();
-	      cluster=pfe('np',3);
-	      cluster=pfe('np',3,'login','username');
-	"""
-
-	def __init__(self,*args):
-		# {{{
-
-		self.name           = 'pfe'
-		self.login          = ''
-		self.numnodes       = 20
-		self.cpuspernode    = 8
-		self.port           = 1025
-		self.queue          = 'long'
-		self.time           = 12*60
-		self.processor      = 'wes'
-		self.codepath       = ''
-		self.executionpath  = ''
-		self.grouplist      = 's1010'
-		self.interactive    = 0
-		self.bbftp          = 0
-		self.numstreams     = 8
-		self.hyperthreading = 0
-
-		#use provided options to change fields
-		options=pairoptions(*args)
-
-		#initialize cluster using user settings if provided
-		self=pfe_settings(self)
-		self.np=self.nprocs()
-		#OK get other fields
-		self=options.AssignObjectFields(self)
-		
-		# }}}
-
-	def __repr__(self):
-		# {{{
-		#  display the object
-		s = "class pfe object:"
-		s	= "%s\n%s"%(s,fielddisplay(self,'name','name of the cluster'))
-		s	= "%s\n%s"%(s,fielddisplay(self,'login','login'))
-		s = "%s\n%s"%(s,fielddisplay(self,'numnodes','number of nodes'))
-		s = "%s\n%s"%(s,fielddisplay(self,'cpuspernode','number of nodes per CPUs'))
-		s = "%s\n%s"%(s,fielddisplay(self,'np','number of CPUs'))
-		s = "%s\n%s"%(s,fielddisplay(self,'port','machine access port'))
-		s = "%s\n%s"%(s,fielddisplay(self,'codepath','code path on the cluster'))
-		s = "%s\n%s"%(s,fielddisplay(self,'executionpath','execution path on the cluster'))
-		s = "%s\n%s"%(s,fielddisplay(self,'queue','name of the queue'))
-		s = "%s\n%s"%(s,fielddisplay(self,'time','walltime requested'))
-		s = "%s\n%s"%(s,fielddisplay(self,'processor','type of processor'))
-		s = "%s\n%s"%(s,fielddisplay(self,'grouplist','name of the group'))
-		s = "%s\n%s"%(s,fielddisplay(self,'interactive',''))
-		s = "%s\n%s"%(s,fielddisplay(self,'bbftp',''))
-		s = "%s\n%s"%(s,fielddisplay(self,'numstreams',''))
-		s = "%s\n%s"%(s,fielddisplay(self,'hyperthreading',''))
-		return s
-	# }}}
-
-	def nprocs(self):
-		# {{{
-		self.np=self.numnodes*self.cpuspernode
-		return self.np
-		# }}}
-	def checkconsistency(self,md,solution,analyses):
-		# {{{
+    print('You need pfe_settings.py to proceed, check presence and sys.path')
 
 
-		queuedict = {'long': [5*24*60, 2048],
-								 'normal': [8*60, 2048],
-								 'debug':[2*60,150],
-								 'devel':[2*60,150]}
-		QueueRequirements(queuedict,self.queue,self.nprocs(),self.time)
+class pfe(object):
+    """
+    PFE cluster class definition
 
-		#now, check cluster.cpuspernode according to processor type
-		if self.processor=='har' or self.processor=='neh':
-			if self.hyperthreading:
-				if not 0<self.cpuspernode<17:
-					md = md.checkmessage('cpuspernode should be between 1 and 16 for ''neh'' and ''har'' processors in hyperthreading mode')
-			else:
-				if not 0<self.cpuspernode<9:
-					md = md.checkmessage('cpuspernode should be between 1 and 8 for ''neh'' and ''har'' processors')
+       Usage:
+          cluster = pfe()
+          cluster = pfe('np', 3)
+          cluster = pfe('np', 3, 'login', 'username')
+    """
 
-		elif self.processor=='wes':
-			if self.hyperthreading:
-				if not 0<self.cpuspernode<25:
-					md = md.checkmessage('cpuspernode should be between 1 and 24 for ''wes'' processors in hyperthreading mode')
-			else:
-				if not 0<self.cpuspernode<13:
-					md = md.checkmessage('cpuspernode should be between 1 and 12 for ''wes'' processors')
+    def __init__(self, *args):    # {{{
+        self.name = 'pfe'
+        self.login = ''
+        self.numnodes = 20
+        self.cpuspernode = 8
+        self.port = 1025
+        self.queue = 'long'
+        self.time = 12 * 60
+        self.processor = 'wes'
+        self.codepath = ''
+        self.executionpath = ''
+        self.grouplist = 's1010'
+        self.interactive = 0
+        self.bbftp = 0
+        self.numstreams = 8
+        self.hyperthreading = 0
 
-		elif self.processor=='ivy':
-			if self.hyperthreading:
-				if not 0<self.cpuspernode<41:
-					md = md.checkmessage('cpuspernode should be between 1 and 40 for ''ivy'' processors in hyperthreading mode')
-			else:
-				if not 0<self.cpuspernode<21:
-					md = md.checkmessage('cpuspernode should be between 1 and 20 for ''ivy'' processors')
-		else:
-			md = md.checkmessage('unknown processor type, should be ''neh'',''wes'' or ''har'' or ''ivy''')
-	
-		#Miscelaneous
-		if not self.login:
-			md = md.checkmessage('login empty')
-		if not self.codepath:
-			md = md.checkmessage('codepath empty')
-		if not self.executionpath:
-			md = md.checkmessage('executionpath empty')
-		if not self.grouplist:
-			md = md.checkmessage('grouplist empty')
-		if self.interactive==1:
-			md = md.checkmessage('interactive mode not implemented')
-			
-		return self
-	# }}}
-	def BuildQueueScript(self,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling):
-		# {{{
+        #use provided options to change fields
+        options = pairoptions(*args)
 
-		executable='issm.exe'
-		if isdakota:
-			version=IssmConfig('_DAKOTA_VERSION_')[0:2]
-			version=float(version)
-			if version>=6:
-				executable='issm_dakota.exe'
-		if isoceancoupling:
-			executable='issm_ocean.exe'
+        #initialize cluster using user settings if provided
+        self = pfe_settings(self)
+        self.np = self.nprocs()
+        #OK get other fields
+        self = options.AssignObjectFields(self)
 
-		#write queuing script 
-		fid=open(modelname+'.queue','w')
-		fid.write('#PBS -S /bin/bash\n')
-		fid.write('#PBS -l select=%i:ncpus=%i:model=%s\n' % (self.numnodes,self.cpuspernode,self.processor))
-		fid.write('#PBS -l walltime=%i\n' % (self.time*60))
-		fid.write('#PBS -q %s \n' % self.queue)
-		fid.write('#PBS -W group_list=%s\n' % self.grouplist)
-		fid.write('#PBS -m e\n')
-		fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath,dirname,modelname))
-		fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath,dirname,modelname))
-		fid.write('. /usr/share/modules/init/bash\n\n')
-		fid.write('module load comp-intel/2015.0.090\n')
-		fid.write('module load mpi-sgi/mpt.2.11r13\n')
-		fid.write('export PATH="$PATH:."\n\n')
-		fid.write('export MPI_GROUP_MAX=64\n\n')
-		fid.write('export ISSM_DIR="%s/../"\n' % self.codepath)
-		fid.write('source $ISSM_DIR/etc/environment.sh\n')
-		fid.write('cd %s/%s/\n\n' % (self.executionpath,dirname))
-		fid.write('mpiexec -np %i %s/%s %s %s/%s %s\n' % (self.nprocs(),self.codepath,executable,str(solution),self.executionpath,dirname,modelname))
-		
-		fid.close()
+    # }}}
 
-	# }}}
-	def UploadQueueJob(self,modelname,dirname,filelist):
-			# {{{
+    def __repr__(self):    # {{{
+        #  display the object
+        s = "class pfe object:"
+        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'numnodes', 'number of nodes'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'cpuspernode', 'number of nodes per CPUs'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'np', 'number of CPUs'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'port', 'machine access port'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', 'code path on the cluster'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'execution path on the cluster'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'queue', 'name of the queue'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'processor', 'type of processor'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'grouplist', 'name of the group'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'interactive', ''))
+        s = "%s\n%s" % (s, fielddisplay(self, 'bbftp', ''))
+        s = "%s\n%s" % (s, fielddisplay(self, 'numstreams', ''))
+        s = "%s\n%s" % (s, fielddisplay(self, 'hyperthreading', ''))
+        return s
+    # }}}
 
-		#compress the files into one zip.
-		compressstring='tar -zcf %s.tar.gz ' % dirname
-		for file in filelist:
-			compressstring += ' %s' % file
-		subprocess.call(compressstring,shell=True)
+    def nprocs(self):    # {{{
+        self.np = self.numnodes * self.cpuspernode
+        return self.np
+    # }}}
 
-		print 'uploading input file and queueing script'
-		issmscpout(self.name,self.executionpath,self.login,self.port,[dirname+'.tar.gz'])
+    def checkconsistency(self, md, solution, analyses):    # {{{
+        queuedict = {'long': [5 * 24 * 60, 2048],
+                     'normal': [8 * 60, 2048],
+                     'debug': [2 * 60, 150],
+                     'devel': [2 * 60, 150]}
+        QueueRequirements(queuedict, self.queue, self.nprocs(), self.time)
 
-		# }}}
-	def LaunchQueueJob(self,modelname,dirname,filelist,restart,batch):
-			# {{{
+        #now, check cluster.cpuspernode according to processor type
+        if self.processor == 'har' or self.processor == 'neh':
+            if self.hyperthreading:
+                if not 0 < self.cpuspernode < 17:
+                    md = md.checkmessage('cpuspernode should be between 1 and 16 for ''neh'' and ''har'' processors in hyperthreading mode')
+            else:
+                if not 0 < self.cpuspernode < 9:
+                    md = md.checkmessage('cpuspernode should be between 1 and 8 for ''neh'' and ''har'' processors')
 
-		print 'launching solution sequence on remote cluster'
-		if restart:
-			launchcommand='cd %s && cd %s && qsub %s.queue' % (self.executionpath,dirname,modelname)
-		else:
-			launchcommand='cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && qsub %s.queue' % (self.executionpath,dirname,dirname,dirname,dirname,dirname,modelname)
-		issmssh(self.name,self.login,self.port,launchcommand)
+        elif self.processor == 'wes':
+            if self.hyperthreading:
+                if not 0 < self.cpuspernode < 25:
+                    md = md.checkmessage('cpuspernode should be between 1 and 24 for ''wes'' processors in hyperthreading mode')
+            else:
+                if not 0 < self.cpuspernode < 13:
+                    md = md.checkmessage('cpuspernode should be between 1 and 12 for ''wes'' processors')
 
-		# }}}
-	def Download(self,dirname,filelist):
-		# {{{
+        elif self.processor == 'ivy':
+            if self.hyperthreading:
+                if not 0 < self.cpuspernode < 41:
+                    md = md.checkmessage('cpuspernode should be between 1 and 40 for ''ivy'' processors in hyperthreading mode')
+            else:
+                if not 0 < self.cpuspernode < 21:
+                    md = md.checkmessage('cpuspernode should be between 1 and 20 for ''ivy'' processors')
+        else:
+            md = md.checkmessage('unknown processor type, should be ''neh'', ''wes'' or ''har'' or ''ivy''')
 
-		#copy files from cluster to current directory
-		directory='%s/%s/' % (self.executionpath,dirname)
-		issmscpin(self.name,self.login,self.port,directory,filelist)
-	# }}}
+    #Miscelaneous
+        if not self.login:
+            md = md.checkmessage('login empty')
+        if not self.codepath:
+            md = md.checkmessage('codepath empty')
+        if not self.executionpath:
+            md = md.checkmessage('executionpath empty')
+        if not self.grouplist:
+            md = md.checkmessage('grouplist empty')
+        if self.interactive == 1:
+            md = md.checkmessage('interactive mode not implemented')
+
+        return self
+    # }}}
+
+    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):    # {{{
+        executable = 'issm.exe'
+        if isdakota:
+            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
+            version = float(version)
+            if version >= 6:
+                executable = 'issm_dakota.exe'
+        if isoceancoupling:
+            executable = 'issm_ocean.exe'
+
+    #write queuing script
+        fid = open(modelname + '.queue', 'w')
+        fid.write('#PBS -S / bin / bash\n')
+        fid.write('#PBS -l select=%i:ncpus=%i:model=%s\n' % (self.numnodes, self.cpuspernode, self.processor))
+        fid.write('#PBS -l walltime=%i\n' % (self.time * 60))
+        fid.write('#PBS -q %s \n' % self.queue)
+        fid.write('#PBS -W group_list=%s\n' % self.grouplist)
+        fid.write('#PBS -m e\n')
+        fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath, dirname, modelname))
+        fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath, dirname, modelname))
+        fid.write('./usr/share/modules/init/bash\n\n')
+        fid.write('module load comp-intel/2015.0.090\n')
+        fid.write('module load mpi-sgi/mpt.2.11r13\n')
+        fid.write('export PATH="$PATH:."\n\n')
+        fid.write('export MPI_GROUP_MAX=64\n\n')
+        fid.write('export ISSM_DIR="%s/../ "\n' % self.codepath)
+        fid.write('source $ISSM_DIR/etc/environment.sh\n')
+        fid.write('cd %s/%s/ \n\n' % (self.executionpath, dirname))
+        fid.write('mpiexec - np %i %s/%s %s %s/%s %s\n' % (self.nprocs(), self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
+
+        fid.close()
+
+    # }}}
+
+    def UploadQueueJob(self, modelname, dirname, filelist):    # {{{
+        #compress the files into one zip.
+        compressstring = 'tar -zcf %s.tar.gz ' % dirname
+        for file in filelist:
+            compressstring += ' %s' % file
+        subprocess.call(compressstring, shell=True)
+
+        print('uploading input file and queueing script')
+        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
+
+    # }}}
+    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):    # {{{
+        print('launching solution sequence on remote cluster')
+        if restart:
+            launchcommand = 'cd %s && cd %s && qsub %s.queue' % (self.executionpath, dirname, modelname)
+        else:
+            launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && qsub %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+        issmssh(self.name, self.login, self.port, launchcommand)
+
+    # }}}
+    def Download(self, dirname, filelist):    # {{{
+        #copy files from cluster to current directory
+        directory = '%s/%s/' % (self.executionpath, dirname)
+        issmscpin(self.name, self.login, self.port, directory, filelist)
+    # }}}
Index: /issm/trunk/src/m/classes/clusters/sherlock.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/sherlock.m	(revision 24313)
+++ /issm/trunk/src/m/classes/clusters/sherlock.m	(revision 24313)
@@ -0,0 +1,160 @@
+%PFE class definition
+%
+%   Usage:
+%      cluster=sherlock();
+%      cluster=sherlock('np',3);
+%      cluster=sherlock('np',3,'login','username');
+
+classdef sherlock
+    properties (SetAccess=public)  
+		 % {{{
+		 name          = 'sherlock'
+		 login         = '';
+		 numnodes      = 1;
+		 cpuspernode   = 24;
+		 port          = 0;
+		 codepath      = '';
+		 executionpath = '';
+		 interactive   = 0;
+		 time          = 30;
+		 memory        = 2;
+	 end
+	 %}}}
+	 methods
+		 function cluster=sherlock(varargin) % {{{
+
+			 %initialize cluster using default settings if provided
+			 if (exist('sherlock_settings')==2), sherlock_settings; end
+
+			 %use provided options to change fields
+			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		 end
+		 %}}}
+		 function disp(cluster) % {{{
+			 %  display the object
+			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			 disp(sprintf('    name: %s',cluster.name));
+			 disp(sprintf('    login: %s',cluster.login));
+			 disp(sprintf('    port: %i',cluster.port));
+			 disp(sprintf('    numnodes: %i',cluster.numnodes));
+			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
+			 disp(sprintf('    codepath: %s',cluster.codepath));
+			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+			 disp(sprintf('    interactive: %i',cluster.interactive));
+			 disp(sprintf('    time: %i',cluster.time));
+			 disp(sprintf('    memory: %i',cluster.memory));
+		 end
+		 %}}}
+		 function numprocs=np(cluster) % {{{
+			 %compute number of processors
+			 numprocs=cluster.numnodes*cluster.cpuspernode;
+		 end
+		 %}}}
+		 function md = checkconsistency(cluster,md,solution,analyses) % {{{
+
+			 %Miscelaneous
+			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
+			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
+			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+
+		 end
+		 %}}}
+		 function BuildKrigingQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+
+			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+
+			 %write queuing script 
+			 fid=fopen([modelname '.queue'],'w');
+			 fprintf(fid,'#!/bin/bash\n');
+			 fprintf(fid,'#SBATCH --job-name=%s\n',mdelname);
+			 fprintf(fid,'#SBATCH -p %s \n',cluster.queue);
+			 fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
+			 fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60); %walltime is in seconds.
+			 fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
+			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
+			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+			 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
+			 if ~io_gather, %concatenate the output files:
+				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			 end
+			 fclose(fid);
+		 end
+		 %}}}
+		 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{
+
+			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+
+			 %write queuing script 
+			 fid=fopen([modelname '.queue'],'w');
+			 fprintf(fid,'#!/bin/bash\n');
+			 fprintf(fid,'#SBATCH --job-name=%s\n',modelname);
+			 fprintf(fid,'#SBATCH -N %i -n %i\n',cluster.numnodes,cluster.cpuspernode);
+			 fprintf(fid,'#SBATCH --time=%i\n',cluster.time*60); %walltime is in seconds.
+			 fprintf(fid,'#SBATCH --mem-per-cpu=%igb\n',cluster.memory);
+			 fprintf(fid,'#SBATCH -o %s.outlog \n',modelname);
+			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',modelname);
+			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
+			 fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+			 if ~io_gather, %concatenate the output files:
+				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			 end
+			 fclose(fid);
+
+			 %in interactive mode, create a run file, and errlog and outlog file
+			 if cluster.interactive,
+				 fid=fopen([modelname '.run'],'w');
+				 fprintf(fid,'mpiexec -n %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+				 if ~io_gather, %concatenate the output files:
+					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+				 end
+				 fclose(fid);
+				 fid=fopen([modelname '.errlog'],'w');
+				 fclose(fid);
+				 fid=fopen([modelname '.outlog'],'w');
+				 fclose(fid);
+			 end
+		 end %}}}
+		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
+
+			 %compress the files into one zip.
+			 compressstring=['tar -zcf ' dirname '.tar.gz '];
+			 for i=1:numel(filelist),
+				 compressstring = [compressstring ' ' filelist{i}];
+			 end
+			 if cluster.interactive,
+				 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+			 end
+			 system(compressstring);
+
+			 disp('uploading input file and queueing script');
+			 issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+
+		 end %}}}
+		 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
+
+			 disp('launching solution sequence on remote cluster');
+			 if ~isempty(restart)
+				 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && hostname && sbatch ' modelname '.queue '];
+			 else
+				 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+					 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && hostname && sbatch ' modelname '.queue '];
+			 end
+			 issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		 end %}}}
+		 function Download(cluster,dirname,filelist)% {{{
+
+			 %copy files from cluster to current directory
+			 directory=[cluster.executionpath '/' dirname '/'];
+			 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+
+		 end %}}}
+	end
+end
Index: /issm/trunk/src/m/classes/clusters/stallo.m
===================================================================
--- /issm/trunk/src/m/classes/clusters/stallo.m	(revision 24312)
+++ /issm/trunk/src/m/classes/clusters/stallo.m	(revision 24313)
@@ -49,5 +49,5 @@
 			 disp(sprintf('    name: %s',cluster.name));
 			 disp(sprintf('    login: %s',cluster.login));
-       disp(sprintf('    accountname: %s',cluster.accountname));
+			 disp(sprintf('    accountname: %s',cluster.accountname));
 			 disp(sprintf('    numnodes: %i',cluster.numnodes));
 			 disp(sprintf('    cpuspernode: %i, cpu per nodes',cluster.cpuspernode));
@@ -71,5 +71,5 @@
 			 %Miscelaneous
 			 if isempty(cluster.login), md = checkmessage(md,'login empty'); end
-       if isempty(cluster.accountname), md = checkmessage(md,'accountname empty'); end
+			 if isempty(cluster.accountname), md = checkmessage(md,'accountname empty'); end
 			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
 			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
@@ -115,6 +115,6 @@
 			 end
 			 fprintf(fid,'#SBATCH --account=%s\n',cluster.accountname);
- 			 fprintf(fid,'#SBATCH --output %s/%s/%s.outlog \n',cluster.executionpath,dirname,modelname);
- 			 fprintf(fid,'#SBATCH --error %s/%s/%s.errlog \n\n',cluster.executionpath,dirname,modelname);
+ 			 fprintf(fid,'#SBATCH -o %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
+ 			 fprintf(fid,'#SBATCH -e %s.errlog \n\n',[cluster.executionpath '/' dirname '/' modelname]);
 
  			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath);%FIXME
@@ -133,5 +133,4 @@
 			 	fprintf(fid,'mpirun -np %i %s/%s %s %s/%s %s\n',cluster.np,cluster.codepath,executable,solution,cluster.executionpath,dirname,modelname);
 			 end
-			 %}}}
 			 if ~io_gather, %concatenate the output files:
 				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
@@ -153,6 +152,5 @@
 			 end
 		 end
-
-
+		 %}}}
 		 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
 
@@ -187,8 +185,8 @@
 			 if ~cluster.interactive,
 				 if ~isempty(restart)
-					 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
+					 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && sbatch ' modelname '.queue '];
 				 else
 					 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
-						 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
+						 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && sbatch ' modelname '.queue '];
 				 end
 			 else
Index: /issm/trunk/src/m/classes/clusters/stallo.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/stallo.py	(revision 24312)
+++ /issm/trunk/src/m/classes/clusters/stallo.py	(revision 24313)
@@ -7,168 +7,164 @@
 from issmscpout import issmscpout
 from QueueRequirements import QueueRequirements
+from IssmConfig import IssmConfig
 import datetime
 try:
-	from stallo_settings import stallo_settings
+    from stallo_settings import stallo_settings
 except ImportError:
-	print 'You need stallo_settings.py to proceed, check presence and sys.path'
+    print('You need stallo_settings.py to proceed, check presence and sys.path')
+
 
 class stallo(object):
-	"""
-	Stallo cluster class definition
-	This is a SLURM queue
-	The priorities are given to:
-	   - Large jobs
-	   - Short jobs
-	   - small number of job per user
+    """
+    Stallo cluster class definition
+    This is a SLURM queue
+    The priorities are given to:
+ - Large jobs
+ - Short jobs
+ - small number of job per user
 
-	There are some 20cpu nodes and 16cpu nodes, with 32GB (a few with 128GB) mem per node, you can ask for part of a node if you need more memory.(1 node, 2 CPUS and 10GB per cpu for example)
+    There are some 20cpu nodes and 16cpu nodes, with 32GB (a few with 128GB) mem per node, you can ask for part of a node if you need more memory.(1 node, 2 CPUS and 10GB per cpu for example)
 
 
-	   Usage:
-	      cluster=stallo();
-	"""
+       Usage:
+          cluster = stallo()
+    """
 
-	def __init__(self,*args):
-	# {{{
-		self.name           = 'stallo'
-		self.login          = ''
-		self.numnodes       = 2
-		self.cpuspernode    = 20
-		self.mem            = 1.6
-		self.queue          = 'normal'
-		self.time           = 2*60
-		self.codepath       = ''
-		self.executionpath  = ''
-		self.interactive    = 0
-		self.port           = []
-		self.accountname    = ''
-		self.profiling      = 0
-		#use provided options to change fields
-		options=pairoptions(*args)
+    def __init__(self, *args):  # {{{
+        self.name = 'stallo'
+        self.login = ''
+        self.numnodes = 2
+        self.cpuspernode = 20
+        self.mem = 1.6
+        self.queue = 'normal'
+        self.time = 2 * 60
+        self.codepath = ''
+        self.executionpath = ''
+        self.interactive = 0
+        self.port = []
+        self.accountname = ''
+        self.profiling = 0
+    #use provided options to change fields
+        options = pairoptions(*args)
+    #initialize cluster using user settings if provided
+        self = stallo_settings(self)
+    #OK get other fields
+        self = options.AssignObjectFields(self)
+        self.np = self.numnodes * self.cpuspernode
+    # }}}
 
-		#initialize cluster using user settings if provided
-		self=stallo_settings(self)
-		#OK get other fields
-		self=options.AssignObjectFields(self)
-		self.np=self.numnodes*self.cpuspernode
-	# }}}
+    def __repr__(self):  # {{{
+        #  display the object
+        s = "class vilje object:"
+        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'numnodes', 'number of nodes'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'cpuspernode', 'number of CPUs per nodes'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'mem', 'memory per CPU'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'queue', 'name of the queue (normal (D), short, singlenode, multinode, devel)'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested in minutes'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', 'code path on the cluster'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'execution path on the cluster'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'interactive', ''))
+        s = "%s\n%s" % (s, fielddisplay(self, 'accountname', 'your cluster account'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'profiling', 'enable profiling if 1 default is 0'))
+        return s
+    # }}}
 
-	def __repr__(self):
-	# {{{
-		#  display the object
-		s = "class vilje object:"
-		s = "%s\n%s"%(s,fielddisplay(self,'name','name of the cluster'))
-		s = "%s\n%s"%(s,fielddisplay(self,'login','login'))
-		s = "%s\n%s"%(s,fielddisplay(self,'numnodes','number of nodes'))
-		s = "%s\n%s"%(s,fielddisplay(self,'cpuspernode','number of CPUs per nodes'))
-		s = "%s\n%s"%(s,fielddisplay(self,'mem','memory per CPU'))
-		s = "%s\n%s"%(s,fielddisplay(self,'queue','name of the queue (normal (D), short,singlenode,multinode,devel)'))
-		s = "%s\n%s"%(s,fielddisplay(self,'time','walltime requested in minutes'))
-		s = "%s\n%s"%(s,fielddisplay(self,'codepath','code path on the cluster'))
-		s = "%s\n%s"%(s,fielddisplay(self,'executionpath','execution path on the cluster'))
-		s = "%s\n%s"%(s,fielddisplay(self,'interactive',''))
-		s = "%s\n%s"%(s,fielddisplay(self,'accountname','your cluster account'))
-		s = "%s\n%s"%(s,fielddisplay(self,'profiling','enable profiling if 1 default is 0'))
-		return s
-	# }}}
-	def checkconsistency(self,md,solution,analyses):
-	# {{{
-		#Queue dictionarry  gives queue name as key and max walltime and cpus as var
-		queuedict = {'short':[60, 2048],
-								 'normal':[2*24*60,2048],
-								 'singlenode':[28*24*60,20],
-								 'multinode':[28*24*60,2048],
-								 'devel':[4*60,2048]}
-		QueueRequirements(queuedict,self.queue,self.np,self.time)
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Queue dictionarry  gives queue name as key and max walltime and cpus as var
+        queuedict = {'short': [60, 2048],
+                     'normal': [2 * 24 * 60, 2048],
+                     'singlenode': [28 * 24 * 60, 20],
+                     'multinode': [28 * 24 * 60, 2048],
+                     'devel': [4 * 60, 2048]}
+        QueueRequirements(queuedict, self.queue, self.np, self.time)
 
-		#Miscelaneous
-		if not self.login:
-			md = md.checkmessage('login empty')
-		if not self.codepath:
-			md = md.checkmessage('codepath empty')
-		if not self.executionpath:
-			md = md.checkmessage('executionpath empty')
-		if self.interactive==1:
-			md = md.checkmessage('interactive mode not implemented')
-		return self
-		# }}}
-	def BuildQueueScript(self,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling):
-		# {{{
+    #Miscelaneous
+        if not self.login:
+            md = md.checkmessage('login empty')
+        if not self.codepath:
+            md = md.checkmessage('codepath empty')
+        if not self.executionpath:
+            md = md.checkmessage('executionpath empty')
+        if self.interactive == 1:
+            md = md.checkmessage('interactive mode not implemented')
+        return self
+    # }}}
 
-		executable='issm.exe'
-		if isdakota:
-			version=IssmConfig('_DAKOTA_VERSION_')[0:2]
-			version=float(version)
-			if version>=6:
-				executable='issm_dakota.exe'
-		if isoceancoupling:
-			executable='issm_ocean.exe'
-		#write queuing script
-		shortname=modelname[0:min(12,len(modelname))]
-		timeobj=datetime.timedelta(minutes=self.time)
-		m,s=divmod(timeobj.total_seconds(), 60)
-		h,m=divmod(m, 60)
-		d,h=divmod(h, 60)
-		timestring="%02d-%02d:%02d:%02d" % (d, h, m, s)
+    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):  # {{{
 
-		fid=open(modelname+'.queue','w')
-		fid.write('#!/bin/bash -l\n')
-		fid.write('#SBATCH --job-name=%s \n' % shortname)
-		fid.write('#SBATCH --qos=%s \n' % self.queue)
-		fid.write('#SBATCH --nodes=%i \n' % self.numnodes)
-		fid.write('#SBATCH --ntasks-per-node=%i \n' % self.cpuspernode)
-		fid.write('#SBATCH --time={}\n'.format(timestring)) #walltime is minutes
-		fid.write('#SBATCH --mem-per-cpu={}MB\n'.format(int(1000*self.mem)))# mem is in MB
-		if (np.mod(self.np,16)+np.mod(self.np,20))==0:
-			fid.write('#SBATCH --ntask=%i\n' % self.np)
-		fid.write('#SBATCH --account=%s\n' % self.accountname)
-		fid.write('#SBATCH --output %s/%s/%s.outlog \n' % (self.executionpath,dirname,modelname))
-		fid.write('#SBATCH --error %s/%s/%s.errlog \n\n' % (self.executionpath,dirname,modelname))
+        executable = 'issm.exe'
+        if isdakota:
+            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
+            version = float(version)
+            if version >= 6:
+                executable = 'issm_dakota.exe'
+        if isoceancoupling:
+            executable = 'issm_ocean.exe'
+    #write queuing script
+        shortname = modelname[0:min(12, len(modelname))]
+        timeobj = datetime.timedelta(minutes=self.time)
+        m, s = divmod(timeobj.total_seconds(), 60)
+        h, m = divmod(m, 60)
+        d, h = divmod(h, 60)
+        timestring = "%02d-%02d:%02d:%02d" % (d, h, m, s)
+        fid = open(modelname + '.queue', 'w')
+        fid.write('#!/bin/bash -l\n')
+        fid.write('#SBATCH --job-name=%s \n' % shortname)
+        fid.write('#SBATCH --qos=%s \n' % self.queue)
+        fid.write('#SBATCH --nodes=%i \n' % self.numnodes)
+        fid.write('#SBATCH --ntasks-per-node=%i \n' % self.cpuspernode)
+        fid.write('#SBATCH --time={}\n'.format(timestring))  #walltime is minutes
+        fid.write('#SBATCH --mem-per-cpu={}MB\n'.format(int(1000 * self.mem)))  # mem is in MB
+        if (np.mod(self.np, 16) + np.mod(self.np, 20)) == 0:
+            fid.write('  #SBATCH --ntask=%i\n' % self.np)
+        fid.write('#SBATCH --account=%s\n' % self.accountname)
+        fid.write('#SBATCH --output %s/%s/%s.outlog \n' % (self.executionpath, dirname, modelname))
+        fid.write('#SBATCH --error %s/%s/%s.errlog \n\n' % (self.executionpath, dirname, modelname))
 
-		fid.write('export ISSM_DIR="%s/../"\n' % self.codepath)
-		fid.write('module purge\n')
-		fid.write('module load CMake/3.8.0-GCCcore-6.3.0\n')
-		fid.write('module load Automake/1.15.1-GCCcore-6.3.0\n')
-		fid.write('module load libtool/2.4.6\n')
-		fid.write('module load OpenSSL/1.1.0e-intel-2017a\n')
-		fid.write('module load PETSc/3.7.5-intel-2017a-downloaded-deps\n')
+        fid.write('export ISSM_DIR="%s/../"\n' % self.codepath)
+        fid.write('module purge\n')
+        fid.write('module load CMake/3.8.0-GCCcore-6.3.0\n')
+        fid.write('module load Automake/1.15.1-GCCcore-6.3.0\n')
+        fid.write('module load libtool/2.4.6\n')
+        fid.write('module load OpenSSL/1.1.0e-intel-2017a\n')
+        fid.write('module load PETSc/3.7.5-intel-2017a-downloaded-deps\n')
 
-		fid.write('cd %s/%s/\n\n' % (self.executionpath,dirname))
-		if self.profiling==1:
-			fid.write('module load perf-report\n')
-			fid.write('perf-report mpirun -np %i %s/%s %s %s/%s %s\n' % (self.np,self.codepath,executable,str(solution),self.executionpath,dirname,modelname))
-		else:
-			fid.write('mpirun -np %i %s/%s %s %s/%s %s\n' % (self.np,self.codepath,executable,str(solution),self.executionpath,dirname,modelname))
-		fid.close()
+        fid.write('cd %s/%s/ \n\n' % (self.executionpath, dirname))
+        if self.profiling == 1:
+            fid.write('module load perf-report\n')
+            fid.write('perf-report mpirun -np %i %s/%s %s %s/%s %s\n' % (self.np, self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
+        else:
+            fid.write('mpirun -np %i %s/%s %s %s/%s %s\n' % (self.np, self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
+        fid.close()
 
-		# }}}
-	def UploadQueueJob(self,modelname,dirname,filelist):
-		# {{{
-		#compress the files into one zip.
-		compressstring='tar -zcf %s.tar.gz ' % dirname
-		for file in filelist:
-			compressstring += ' %s' % file
-		subprocess.call(compressstring,shell=True)
+    # }}}
+    def UploadQueueJob(self, modelname, dirname, filelist):  # {{{
+        #compress the files into one zip.
+        compressstring = 'tar -zcf %s.tar.gz ' % dirname
+        for file in filelist:
+            compressstring += ' %s' % file
+        subprocess.call(compressstring, shell=True)
 
-		print 'uploading input file and queueing script'
-		issmscpout(self.name,self.executionpath,self.login,self.port,[dirname+'.tar.gz'])
+        print('uploading input file and queueing script')
+        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
 
-		# }}}
-	def LaunchQueueJob(self,modelname,dirname,filelist,restart,batch):
-		# {{{
+    # }}}
 
-		print 'launching solution sequence on remote cluster'
-		if restart:
-			launchcommand='cd %s && cd %s && sbatch %s.queue' % (self.executionpath,dirname,modelname)
-		else:
-			launchcommand='cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && sbatch %s.queue' % (self.executionpath,dirname,dirname,dirname,dirname,dirname,modelname)
-		issmssh(self.name,self.login,self.port,launchcommand)
+    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):  # {{{
 
-		# }}}
-	def Download(self,dirname,filelist):
-		# {{{
+        print('launching solution sequence on remote cluster')
+        if restart:
+            launchcommand = 'cd %s && cd %s && sbatch %s.queue' % (self.executionpath, dirname, modelname)
+        else:
+            launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && sbatch %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+        issmssh(self.name, self.login, self.port, launchcommand)
 
-		#copy files from cluster to current directory
-		directory='%s/%s/' % (self.executionpath,dirname)
-		issmscpin(self.name,self.login,self.port,directory,filelist)
-		# }}}
+    # }}}
+
+    def Download(self, dirname, filelist):  # {{{
+        #copy files from cluster to current directory
+        directory = '%s/%s/' % (self.executionpath, dirname)
+        issmscpin(self.name, self.login, self.port, directory, filelist)
+    # }}}
Index: /issm/trunk/src/m/classes/clusters/vilje.py
===================================================================
--- /issm/trunk/src/m/classes/clusters/vilje.py	(revision 24312)
+++ /issm/trunk/src/m/classes/clusters/vilje.py	(revision 24313)
@@ -6,146 +6,140 @@
 from issmscpout import issmscpout
 from QueueRequirements import QueueRequirements
+from IssmConfig import IssmConfig
 import datetime
 try:
-	from vilje_settings import vilje_settings
+    from vilje_settings import vilje_settings
 except ImportError:
-	print 'You need vilje_settings.py to proceed, check presence and sys.path'
-	
+    print('You need vilje_settings.py to proceed, check presence and sys.path')
+
+
 class vilje(object):
-	"""
-	Vilje cluster class definition
- 
-	   Usage:
-	      cluster=vilje();
-	"""
+    """
+    Vilje cluster class definition
 
-	def __init__(self,*args):
-		# {{{
-		self.name           = 'vilje'
-		self.login          = ''
-		self.numnodes       = 2
-		self.cpuspernode    = 32
-		self.procspernodes  = 16
-		self.mem            = 28
-		self.queue          = 'workq'
-		self.time           = 2*60
-		self.codepath       = ''
-		self.executionpath  = ''
-		self.interactive    = 0
-		self.port           = []
-		self.accountname    = ''
+       Usage:
+          cluster = vilje()
+    """
 
-		#use provided options to change fields
-		options=pairoptions(*args)
+    def __init__(self, *args):    # {{{
+        self.name = 'vilje'
+        self.login = ''
+        self.numnodes = 2
+        self.cpuspernode = 32
+        self.procspernodes = 16
+        self.mem = 28
+        self.queue = 'workq'
+        self.time = 2 * 60
+        self.codepath = ''
+        self.executionpath = ''
+        self.interactive = 0
+        self.port = []
+        self.accountname = ''
 
-		#initialize cluster using user settings if provided
-		self=vilje_settings(self)
-		#OK get other fields
-		self=options.AssignObjectFields(self)
-		self.np=self.numnodes*self.procspernodes		
-		# }}}
-	def __repr__(self):
-		# {{{
-		#  display the object
-		s = "class vilje object:"
-		s = "%s\n%s"%(s,fielddisplay(self,'name','name of the cluster'))
-		s = "%s\n%s"%(s,fielddisplay(self,'login','login'))
-		s = "%s\n%s"%(s,fielddisplay(self,'numnodes','number of nodes'))
-		s = "%s\n%s"%(s,fielddisplay(self,'cpuspernode','number of nodes per CPUs (32)'))
-		s = "%s\n%s"%(s,fielddisplay(self,'procspernodes','number of mpi procs per nodes'))
-		s = "%s\n%s"%(s,fielddisplay(self,'mem','node memory'))
-		s = "%s\n%s"%(s,fielddisplay(self,'queue','name of the queue (test is an option, workq the default)'))
-		s = "%s\n%s"%(s,fielddisplay(self,'time','walltime requested in minutes'))
-		s = "%s\n%s"%(s,fielddisplay(self,'codepath','code path on the cluster'))
-		s = "%s\n%s"%(s,fielddisplay(self,'executionpath','execution path on the cluster'))
-		s = "%s\n%s"%(s,fielddisplay(self,'interactive',''))
-		s = "%s\n%s"%(s,fielddisplay(self,'accountname','your cluster account'))
-		return s
-                # }}}
-	def checkconsistency(self,md,solution,analyses):
-		# {{{
-                #Queue dictionarry  gives queu name as key and max walltime and cpus as var
-		queuedict = {'workq':[5*24*60, 30],
-								 'test':[30,4]}
-		QueueRequirements(queuedict,self.queue,self.np,self.time)
+    #use provided options to change fields
+        options = pairoptions(*args)
 
-		#Miscelaneous
-		if not self.login:
-			md = md.checkmessage('login empty')
-		if not self.codepath:
-			md = md.checkmessage('codepath empty')
-		if not self.executionpath:
-			md = md.checkmessage('executionpath empty')
-		if self.interactive==1:
-			md = md.checkmessage('interactive mode not implemented')
-		return self
-                # }}}
-	def BuildQueueScript(self,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling):
-		# {{{
+    #initialize cluster using user settings if provided
+        self = vilje_settings(self)
+    #OK get other fields
+        self = options.AssignObjectFields(self)
+        self.np = self.numnodes * self.procspernodes
+    # }}}
 
-		executable='issm.exe'
-		if isdakota:
-			version=IssmConfig('_DAKOTA_VERSION_')[0:2]
-			version=float(version)
-			if version>=6:
-				executable='issm_dakota.exe'
-		if isoceancoupling:
-			executable='issm_ocean.exe'
+    def __repr__(self):    # {{{
+        #  display the object
+        s = "class vilje object:"
+        s = "%s\n%s" % (s, fielddisplay(self, 'name', 'name of the cluster'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'login', 'login'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'numnodes', 'number of nodes'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'cpuspernode', 'number of nodes per CPUs (32)'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'procspernodes', 'number of mpi procs per nodes'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'mem', 'node memory'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'queue', 'name of the queue (test is an option, workq the default)'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'time', 'walltime requested in minutes'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'codepath', 'code path on the cluster'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'executionpath', 'execution path on the cluster'))
+        s = "%s\n%s" % (s, fielddisplay(self, 'interactive', ''))
+        s = "%s\n%s" % (s, fielddisplay(self, 'accountname', 'your cluster account'))
+        return s
+    # }}}
 
-		#write queuing script 
-		shortname=modelname[0:min(12,len(modelname))]
-		fid=open(modelname+'.queue','w')
-		fid.write('#PBS -S /bin/bash\n')
-		fid.write('#PBS -N %s \n' % shortname)
-		fid.write('#PBS -q %s \n' % self.queue)
-		fid.write('#PBS -l select=%i:ncpus=%i:mpiprocs=%s\n' % (self.numnodes,self.cpuspernode,self.procspernodes))
-		timeobj=datetime.timedelta(minutes=self.time)
-		m,s=divmod(timeobj.total_seconds(), 60)
-		h,m=divmod(m, 60)
-		timestring="%02d:%02d:%02d" % (h, m, s)
-		fid.write('#PBS -l walltime=%s\n' % timestring) #walltime is hh:mm:ss
-		#fid.write('#PBS -l mem=%igb\n' % self.mem)
-		fid.write('#PBS -A %s\n' % self.accountname) 
-		fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath,dirname,modelname))
-		fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath,dirname,modelname))
-		fid.write('export ISSM_DIR="%s/../"\n' % self.codepath)
-		fid.write('module load intelcomp/17.0.0\n') 
-		fid.write('module load mpt/2.14\n')
-		fid.write('module load petsc/3.7.4d\n')
-		fid.write('module load parmetis/4.0.3\n') 
-		fid.write('module load mumps/5.0.2\n')
-		fid.write('cd %s/%s/\n\n' % (self.executionpath,dirname))
-		fid.write('mpiexec_mpt -np %i %s/%s %s %s/%s %s\n' % (self.np,self.codepath,executable,str(solution),self.executionpath,dirname,modelname))
-                fid.close()
+    def checkconsistency(self, md, solution, analyses):    # {{{
+        #Queue dictionarry  gives queu name as key and max walltime and cpus as var
+        queuedict = {'workq': [5 * 24 * 60, 30],
+                     'test': [30, 4]}
+        QueueRequirements(queuedict, self.queue, self.np, self.time)
 
-		# }}}
-	def UploadQueueJob(self,modelname,dirname,filelist):
-		# {{{
-		#compress the files into one zip.
-		compressstring='tar -zcf %s.tar.gz ' % dirname
-		for file in filelist:
-			compressstring += ' %s' % file
-		subprocess.call(compressstring,shell=True)
+    #Miscelaneous
+        if not self.login:
+            md = md.checkmessage('login empty')
+        if not self.codepath:
+            md = md.checkmessage('codepath empty')
+        if not self.executionpath:
+            md = md.checkmessage('executionpath empty')
+        if self.interactive == 1:
+            md = md.checkmessage('interactive mode not implemented')
+        return self
+    # }}}
 
-		print 'uploading input file and queueing script'
-		issmscpout(self.name,self.executionpath,self.login,self.port,[dirname+'.tar.gz'])
+    def BuildQueueScript(self, dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling):    # {{{
+        executable = 'issm.exe'
+        if isdakota:
+            version = IssmConfig('_DAKOTA_VERSION_')[0:2]
+            version = float(version)
+            if version >= 6:
+                executable = 'issm_dakota.exe'
+        if isoceancoupling:
+            executable = 'issm_ocean.exe'
 
-		# }}}
-	def LaunchQueueJob(self,modelname,dirname,filelist,restart,batch):
-		# {{{
+    #write queuing script
+        shortname = modelname[0:min(12, len(modelname))]
+        fid = open(modelname + '.queue', 'w')
+        fid.write('#PBS -S / bin / bash\n')
+        fid.write('#PBS -N %s \n' % shortname)
+        fid.write('#PBS -q %s \n' % self.queue)
+        fid.write('#PBS -l select=%i:ncpus=%i:mpiprocs=%s\n' % (self.numnodes, self.cpuspernode, self.procspernodes))
+        timeobj = datetime.timedelta(minutes=self.time)
+        m, s = divmod(timeobj.total_seconds(), 60)
+        h, m = divmod(m, 60)
+        timestring = "%02d:%02d:%02d" % (h, m, s)
+        fid.write('#PBS -l walltime=%s\n' % timestring)  #walltime is hh:mm:ss
+        fid.write('#PBS -A %s\n' % self.accountname)
+        fid.write('#PBS -o %s/%s/%s.outlog \n' % (self.executionpath, dirname, modelname))
+        fid.write('#PBS -e %s/%s/%s.errlog \n\n' % (self.executionpath, dirname, modelname))
+        fid.write('export ISSM_DIR="%s/../ "\n' % self.codepath)
+        fid.write('module load intelcomp/17.0.0\n')
+        fid.write('module load mpt/2.14\n')
+        fid.write('module load petsc/3.7.4d\n')
+        fid.write('module load parmetis/4.0.3\n')
+        fid.write('module load mumps/5.0.2\n')
+        fid.write('cd %s/%s/\n\n' % (self.executionpath, dirname))
+        fid.write('mpiexec_mpt -np %i %s/%s %s %s/%s %s\n' % (self.np, self.codepath, executable, str(solution), self.executionpath, dirname, modelname))
+        fid.close()
+    # }}}
 
-		print 'launching solution sequence on remote cluster'
-		if restart:
-			launchcommand='cd %s && cd %s && qsub %s.queue' % (self.executionpath,dirname,modelname)
-		else:
-			launchcommand='cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && qsub %s.queue' % (self.executionpath,dirname,dirname,dirname,dirname,dirname,modelname)
-		issmssh(self.name,self.login,self.port,launchcommand)
+    def UploadQueueJob(self, modelname, dirname, filelist):    # {{{
+        #compress the files into one zip.
+        compressstring = 'tar -zcf %s.tar.gz ' % dirname
+        for file in filelist:
+            compressstring += ' %s' % file
+        subprocess.call(compressstring, shell=True)
 
-		# }}}
-	def Download(self,dirname,filelist):
-		# {{{
+        print('uploading input file and queueing script')
+        issmscpout(self.name, self.executionpath, self.login, self.port, [dirname + '.tar.gz'])
+    # }}}
 
-		#copy files from cluster to current directory
-		directory='%s/%s/' % (self.executionpath,dirname)
-		issmscpin(self.name,self.login,self.port,directory,filelist)
-                # }}}
+    def LaunchQueueJob(self, modelname, dirname, filelist, restart, batch):    # {{{
+        print('launching solution sequence on remote cluster')
+        if restart:
+            launchcommand = 'cd %s && cd %s && qsub %s.queue' % (self.executionpath, dirname, modelname)
+        else:
+            launchcommand = 'cd %s && rm -rf ./%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxf %s.tar.gz  && qsub %s.queue' % (self.executionpath, dirname, dirname, dirname, dirname, dirname, modelname)
+        issmssh(self.name, self.login, self.port, launchcommand)
+    # }}}
+
+    def Download(self, dirname, filelist):    # {{{
+        #copy files from cluster to current directory
+        directory = '%s/%s/' % (self.executionpath, dirname)
+        issmscpin(self.name, self.login, self.port, directory, filelist)
+    # }}}
Index: /issm/trunk/src/m/classes/constants.py
===================================================================
--- /issm/trunk/src/m/classes/constants.py	(revision 24312)
+++ /issm/trunk/src/m/classes/constants.py	(revision 24313)
@@ -3,60 +3,62 @@
 from WriteData import WriteData
 
+
 class constants(object):
-	"""
-	CONSTANTS class definition
+    """
+    CONSTANTS class definition
 
-	   Usage:
-	      constants=constants();
-	"""
+       Usage:
+          constants = constants()
+    """
 
-	def __init__(self): # {{{
-		self.g                    = 0.
-		self.omega                = 0.
-		self.yts                  = 0.
-		self.referencetemperature = 0.
-		
-		#set defaults
-		self.setdefaultparameters()
+    def __init__(self):  # {{{
+        self.g = 0.
+        self.omega = 0.
+        self.yts = 0.
+        self.referencetemperature = 0.
 
-		#}}}
-	def __repr__(self): # {{{
-		string="   constants parameters:"
+    #set defaults
+        self.setdefaultparameters()
 
-		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]"))
+    #}}}
+    def __repr__(self):  # {{{
+        string = "   constants parameters:"
 
-		return string
-		#}}}
-	def setdefaultparameters(self): # {{{
-		
-		#acceleration due to gravity (m/s^2)
-		self.g=9.81
+        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]"))
 
-		#Earth's rotation speed 
-		self.omega = 7.292*1e-5;
+        return string
+    #}}}
 
-		#converstion from year to seconds
-		self.yts=365.*24.*3600.
+    def setdefaultparameters(self):  # {{{
+        #acceleration due to gravity (m / s^2)
+        self.g = 9.81
 
-		#the reference temperature for enthalpy model (cf Aschwanden)
-		self.referencetemperature=223.15
+        #Earth's rotation speed
+        self.omega = 7.292 * 1e-5
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+        #converstion from year to seconds
+        self.yts = 365. * 24. * 3600.
 
-		md = checkfield(md,'fieldname','constants.g','>=',0,'size',[1,1])
-		md = checkfield(md,'fieldname','constants.omega','>=',0,'size',[1,1])
-		md = checkfield(md,'fieldname','constants.yts','>',0,'size',[1,1])
-		md = checkfield(md,'fieldname','constants.referencetemperature','size',[1,1])
+        #the reference temperature for enthalpy model (cf Aschwanden)
+        self.referencetemperature = 223.15
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'object',self,'fieldname','g','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','yts','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','referencetemperature','format','Double')
-	# }}}
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        md = checkfield(md, 'fieldname', 'constants.g', '>=', 0, 'size', [1])
+        md = checkfield(md, 'fieldname', 'constants.omega', '>=', 0, 'size', [1])
+        md = checkfield(md, 'fieldname', 'constants.yts', '>', 0, 'size', [1])
+        md = checkfield(md, 'fieldname', 'constants.referencetemperature', 'size', [1])
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'g', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'yts', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'referencetemperature', 'format', 'Double')
+    # }}}
Index: /issm/trunk/src/m/classes/damage.m
===================================================================
--- /issm/trunk/src/m/classes/damage.m	(revision 24312)
+++ /issm/trunk/src/m/classes/damage.m	(revision 24313)
@@ -20,4 +20,5 @@
 		%general parameters for evolution law: 
 		stress_threshold    = 0;
+		stress_ubound       = 0;
 		kappa               = 0;
 		c1                  = 0;
@@ -88,5 +89,5 @@
 			md = checkfield(md,'fieldname','damage.isdamage','values',[1,0]);
 			if self.isdamage,
-				md = checkfield(md,'fieldname','damage.law','numel',[1],'values',[0,1,2]);
+				md = checkfield(md,'fieldname','damage.law','numel',[1],'values',[0,1,2,3]);
 				md = checkfield(md,'fieldname','damage.D','>=',0,'<=',self.max_damage,'size',[md.mesh.numberofvertices 1]);
 				md = checkfield(md,'fieldname','damage.spcdamage','Inf',1,'timeseries',1);
@@ -96,4 +97,5 @@
 				md = checkfield(md,'fieldname','damage.elementinterp','values',{'P1','P2'});
 				md = checkfield(md,'fieldname','damage.stress_threshold','>=',0);
+				md = checkfield(md,'fieldname','damage.stress_ubound','>=',0);
 				md = checkfield(md,'fieldname','damage.kappa','>',1);
 				md = checkfield(md,'fieldname','damage.healing','>=',0);
@@ -131,5 +133,6 @@
 				fielddisplay(self,'maxiter','maximum number of non linear iterations');
 				fielddisplay(self,'elementinterp','interpolation scheme for finite elements {''P1'',''P2''}');
-				fielddisplay(self,'stress_threshold','stress threshold for damage initiation [Pa]');
+				fielddisplay(self,'stress_threshold','stress threshold for damage initiation (Pa)');
+				fielddisplay(self,'stress_ubound','stress upper bound for damage healing (Pa), arctan law');
 				fielddisplay(self,'kappa','ductility parameter for stress softening and damage');
 				fielddisplay(self,'c1','damage parameter 1');
@@ -156,4 +159,5 @@
 				WriteData(fid,prefix,'name','md.damage.elementinterp','data',self.elementinterp,'format','String');
 				WriteData(fid,prefix,'object',self,'fieldname','stress_threshold','format','Double');
+				WriteData(fid,prefix,'object',self,'fieldname','stress_ubound','format','Double');
 				WriteData(fid,prefix,'object',self,'fieldname','kappa','format','Double');
 				WriteData(fid,prefix,'object',self,'fieldname','c1','format','Double');
Index: /issm/trunk/src/m/classes/damage.py
===================================================================
--- /issm/trunk/src/m/classes/damage.py	(revision 24312)
+++ /issm/trunk/src/m/classes/damage.py	(revision 24313)
@@ -3,171 +3,166 @@
 from checkfield import checkfield
 from WriteData import WriteData
-import MatlabFuncs as m
+
 
 class damage(object):
-	"""
-	DAMAGE class definition
+    """
+    DAMAGE class definition
 
-	   Usage:
-	      damage=damage()
-	"""
+       Usage:
+          damage = damage()
+    """
 
-	def __init__(self,*args):    # {{{
-			
-		#damage: 
-		self.isdamage           = 0.
-		self.D			= float('NaN')
-		self.law		= float('NaN')
-		self.spcdamage		= float('NaN')
-		self.max_damage		= float('NaN')
-		
-		#numerical
-		self.stabilization	= float('NaN')
-		self.maxiter		= float('NaN')
-		self.elementinterp      = ''
+    def __init__(self, *args):  # {{{
+        #damage:
+        self.isdamage = 0.
+        self.D = float('NaN')
+        self.law = float('NaN')
+        self.spcdamage = float('NaN')
+        self.max_damage = float('NaN')
 
-		#general parameters for evolution law: 
-		self.stress_threshold   = float('NaN')
-		self.kappa              = float('NaN')
-		self.c1                 = float('NaN')
-		self.c2                 = float('NaN')
-		self.c3                 = float('NaN')
-		self.c4                 = float('NaN')
-		self.healing		= float('NaN')
-		self.equiv_stress       = float('NaN')
-		self.requested_outputs  = []
+        #numerical
+        self.stabilization = float('NaN')
+        self.maxiter = float('NaN')
+        self.elementinterp = ''
 
-		if not len(args):
-			self.setdefaultparameters()
-		else:
-			raise RuntimeError("constructor not supported")
+        #general parameters for evolution law:
+        self.stress_threshold = float('NaN')
+        self.stress_ubound = float('NaN')
+        self.kappa = float('NaN')
+        self.c1 = float('NaN')
+        self.c2 = float('NaN')
+        self.c3 = float('NaN')
+        self.c4 = float('NaN')
+        self.healing = float('NaN')
+        self.equiv_stress = float('NaN')
+        self.requested_outputs = []
 
-	# }}}
-	def __repr__(self):    # {{{
-		s ='   Damage:\n'
-		
-		s+="%s\n" % fielddisplay(self,"isdamage","is damage mechanics being used? [0 (default) or 1]")
-		if self.isdamage:
-			s+="%s\n" % fielddisplay(self,"D","damage tensor (scalar for now)")
-			s+="%s\n" % fielddisplay(self,"law","damage law ['0: analytical','1: pralong']")
-			s+="%s\n" % fielddisplay(self,"spcdamage","damage constraints (NaN means no constraint)")
-			s+="%s\n" % fielddisplay(self,"max_damage","maximum possible damage (0<=max_damage<1)")
+        if not len(args):
+            self.setdefaultparameters()
+        else:
+            raise RuntimeError("constructor not supported")
+    # }}}
 
-                        s+="%s\n" % fielddisplay(self,"stabilization","0: no, 1: artificial_diffusivity, 2: SUPG (not working), 4: Flux corrected transport")
-			s+="%s\n" % fielddisplay(self,"maxiter","maximum number of non linear iterations")
-			s+="%s\n" %	fielddisplay(self,"elementinterp","interpolation scheme for finite elements [''P1'',''P2'']")
-			s+="%s\n" % fielddisplay(self,"stress_threshold","stress threshold for damage initiation [Pa]")
-			s+="%s\n" % fielddisplay(self,"kappa","ductility parameter for stress softening and damage [>1]")
-			s+="%s\n" % fielddisplay(self,"c1","damage parameter 1 ")
-			s+="%s\n" % fielddisplay(self,"c2","damage parameter 2 ")
-			s+="%s\n" % fielddisplay(self,"c3","damage parameter 3 ")
-			s+="%s\n" % fielddisplay(self,"c4","damage parameter 4 ")
-			s+="%s\n" % fielddisplay(self,"healing","damage healing parameter")
-			s+="%s\n" % fielddisplay(self,"equiv_stress","0: von Mises, 1: max principal")
-			s+="%s\n" % fielddisplay(self,'requested_outputs','additional outputs requested')
+    def __repr__(self):  # {{{
+        s = '   Damage:\n'
+        s += "%s\n" % fielddisplay(self, "isdamage", "is damage mechanics being used? [0 (default) or 1]")
+        if self.isdamage:
+            s += "%s\n" % fielddisplay(self, "D", "damage tensor (scalar for now)")
+            s += "%s\n" % fielddisplay(self, "law", "damage law ['0: analytical', '1: pralong']")
+            s += "%s\n" % fielddisplay(self, "spcdamage", "damage constraints (NaN means no constraint)")
+            s += "%s\n" % fielddisplay(self, "max_damage", "maximum possible damage (0 <=max_damage < 1)")
+            s += "%s\n" % fielddisplay(self, "stabilization", "0: no, 1: artificial_diffusivity, 2: SUPG (not working), 4: Flux corrected transport")
+            s += "%s\n" % fielddisplay(self, "maxiter", "maximum number of non linear iterations")
+            s += "%s\n" % fielddisplay(self, "elementinterp", "interpolation scheme for finite elements [''P1'', ''P2'']")
+            s += "%s\n" % fielddisplay(self, "stress_threshold", "stress threshold for damage initiation (Pa)")
+            s += "%s\n" % fielddisplay(self, "stress_ubound", "stress upper bound for damage healing (Pa)")
+            s += "%s\n" % fielddisplay(self, "kappa", "ductility parameter for stress softening and damage [ > 1]")
+            s += "%s\n" % fielddisplay(self, "c1", "damage parameter 1 ")
+            s += "%s\n" % fielddisplay(self, "c2", "damage parameter 2 ")
+            s += "%s\n" % fielddisplay(self, "c3", "damage parameter 3 ")
+            s += "%s\n" % fielddisplay(self, "c4", "damage parameter 4 ")
+            s += "%s\n" % fielddisplay(self, "healing", "damage healing parameter")
+            s += "%s\n" % fielddisplay(self, "equiv_stress", "0: von Mises, 1: max principal")
+            s += "%s\n" % fielddisplay(self, 'requested_outputs', 'additional outputs requested')
 
-		return s
-	# }}}
-	def extrude(self,md): # {{{
-		self.D=project3d(md,'vector',self.D,'type','node')
-		self.spcdamage=project3d(md,'vector',self.spcdamage,'type','node')
-		return self
-	#}}}
-	def setdefaultparameters(self):    # {{{
+        return s
+    # }}}
 
-		#damage parameters: 
-		self.isdamage=0
-		self.D=0
-		self.law=0
+    def extrude(self, md):  # {{{
+        self.D = project3d(md, 'vector', self.D, 'type', 'node')
+        self.spcdamage = project3d(md, 'vector', self.spcdamage, 'type', 'node')
+        return self
+    #}}}
 
-		self.max_damage=1-1e-5 #if damage reaches 1, solve becomes singular, as viscosity becomes nil
-		
-		#Type of stabilization used
-		self.stabilization=4
-			
-		#Maximum number of iterations
-		self.maxiter=100
+    def setdefaultparameters(self):  # {{{
+        #damage parameters:
+        self.isdamage = 0
+        self.D = 0
+        self.law = 0
+        self.max_damage = 1 - 1e-5  #if damage reaches 1, solve becomes singular, as viscosity becomes nil
+        #Type of stabilization used
+        self.stabilization = 4
+        #Maximum number of iterations
+        self.maxiter = 100
+        #finite element interpolation
+        self.elementinterp = 'P1'
+        #damage evolution parameters
+        self.stress_threshold = 1.3e5
+        self.kappa = 2.8
+        self.c1 = 0
+        self.c2 = 0
+        self.c3 = 0
+        self.c4 = 0
+        self.healing = 0
+        self.equiv_stress = 0
+        #output default:
+        self.requested_outputs = ['default']
 
-		#finite element interpolation
-		self.elementinterp='P1'
+        return self
+    # }}}
 
-		#damage evolution parameters 
-		self.stress_threshold=1.3e5
-		self.kappa=2.8
-		self.c1=0
-		self.c2=0
-		self.c3=0
-		self.c4=0
-		self.healing=0
-		self.equiv_stress=0
+    def defaultoutputs(self, md):  # {{{
+        if md.mesh.domaintype().lower() == '2dhorizontal':
+            list = ['DamageDbar']
+        else:
+            list = ['DamageD']
+        return list
+    #}}}
 
-		#output default:
-		self.requested_outputs=['default']
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        md = checkfield(md, 'fieldname', 'damage.isdamage', 'numel', [1], 'values', [0, 1])
+        if self.isdamage:
+            md = checkfield(md, 'fieldname', 'damage.D', '>=', 0, '<=', self.max_damage, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'damage.max_damage', '<', 1, '>=', 0)
+            md = checkfield(md, 'fieldname', 'damage.law', 'numel', [1], 'values', [0, 1, 2, 3])
+            md = checkfield(md, 'fieldname', 'damage.spcdamage', 'Inf', 1, 'timeseries', 1)
+            md = checkfield(md, 'fieldname', 'damage.stabilization', 'numel', [1], 'values', [0, 1, 2, 4])
+            md = checkfield(md, 'fieldname', 'damage.maxiter', ' >= 0', 0)
+            md = checkfield(md, 'fieldname', 'damage.elementinterp', 'values', ['P1', 'P2'])
+            md = checkfield(md, 'fieldname', 'damage.stress_threshold', '>=', 0)
+            md = checkfield(md, 'fieldname', 'damage.stress_ubound', '>=', 0)
+            md = checkfield(md, 'fieldname', 'damage.kappa', '>', 1)
+            md = checkfield(md, 'fieldname', 'damage.healing', '>=', 0)
+            md = checkfield(md, 'fieldname', 'damage.c1', '>=', 0)
+            md = checkfield(md, 'fieldname', 'damage.c2', '>=', 0)
+            md = checkfield(md, 'fieldname', 'damage.c3', '>=', 0)
+            md = checkfield(md, 'fieldname', 'damage.c4', '>=', 0)
+            md = checkfield(md, 'fieldname', 'damage.healing', '>=', 0)
+            md = checkfield(md, 'fieldname', 'damage.equiv_stress', 'numel', [1], 'values', [0, 1])
+            md = checkfield(md, 'fieldname', 'damage.requested_outputs', 'stringrow', 1)
+        elif self.law != 0:
+            if (solution == 'DamageEvolutionSolution'):
+                raise RuntimeError('Invalid evolution law (md.damage.law) for a damage solution')
 
-		return self
-	# }}}
-	def defaultoutputs(self,md): # {{{
-		
-		if md.mesh.domaintype().lower()=='2dhorizontal':
-			list = ['DamageDbar']
-		else:
-			list = ['DamageD']
-		return list
+        return md
+    # }}}
 
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isdamage', 'format', 'Boolean')
+        if self.isdamage:
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'D', 'format', 'DoubleMat', 'mattype', 1)
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'law', 'format', 'Integer')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'spcdamage', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'max_damage', 'format', 'Double')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'stabilization', 'format', 'Integer')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter', 'format', 'Integer')
+            WriteData(fid, prefix, 'name', 'md.damage.elementinterp', 'data', self.elementinterp, 'format', 'String')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'stress_threshold', 'format', 'Double')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'stress_ubound', 'format', 'Double')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'kappa', 'format', 'Double')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'c1', 'format', 'Double')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'c2', 'format', 'Double')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'c3', 'format', 'Double')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'c4', 'format', 'Double')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'healing', 'format', 'Double')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'equiv_stress', 'format', 'Integer')
 
-		md = checkfield(md,'fieldname','damage.isdamage','numel',[1],'values',[0,1])
-		if self.isdamage:
-			md = checkfield(md,'fieldname','damage.D','>=',0,'<=',self.max_damage,'size',[md.mesh.numberofvertices])
-			md = checkfield(md,'fieldname','damage.max_damage','<',1,'>=',0)
-			md = checkfield(md,'fieldname','damage.law','numel',[1],'values',[0,1,2,3])
-			md = checkfield(md,'fieldname','damage.spcdamage','Inf',1,'timeseries',1)
-			md = checkfield(md,'fieldname','damage.stabilization','numel',[1],'values',[0,1,2,4])
-			md = checkfield(md,'fieldname','damage.maxiter','>=0',0)
-			md = checkfield(md,'fieldname','damage.elementinterp','values',['P1','P2'])
-			md = checkfield(md,'fieldname','damage.stress_threshold','>=',0)
-			md = checkfield(md,'fieldname','damage.kappa','>',1)
-			md = checkfield(md,'fieldname','damage.healing','>=',0)
-			md = checkfield(md,'fieldname','damage.c1','>=',0)
-			md = checkfield(md,'fieldname','damage.c2','>=',0)
-			md = checkfield(md,'fieldname','damage.c3','>=',0)
-			md = checkfield(md,'fieldname','damage.c4','>=',0)
-			md = checkfield(md,'fieldname','damage.healing','>=',0)
-			md = checkfield(md,'fieldname','damage.equiv_stress','numel',[1],'values',[0,1])
-			md = checkfield(md,'fieldname','damage.requested_outputs','stringrow',1)
-		elif self.law != 0:
-			if (solution=='DamageEvolutionSolution'):
-				raise RuntimeError('Invalid evolution law (md.damage.law) for a damage solution')
-
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-
-		WriteData(fid,prefix,'object',self,'fieldname','isdamage','format','Boolean')
-		if self.isdamage:
-			WriteData(fid,prefix,'object',self,'fieldname','D','format','DoubleMat','mattype',1)
-			WriteData(fid,prefix,'object',self,'fieldname','law','format','Integer')
-			WriteData(fid,prefix,'object',self,'fieldname','spcdamage','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'fieldname','max_damage','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer')
-			WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer')
-			WriteData(fid,prefix,'name','md.damage.elementinterp','data',self.elementinterp,'format','String')
-			WriteData(fid,prefix,'object',self,'fieldname','stress_threshold','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','kappa','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','c1','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','c2','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','c3','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','c4','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','healing','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','equiv_stress','format','Integer')
-			
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		if self.isdamage:
-			WriteData(fid,prefix,'data',outputs,'name','md.damage.requested_outputs','format','StringArray')
-	# }}}
+    #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        if self.isdamage:
+            WriteData(fid, prefix, 'data', outputs, 'name', 'md.damage.requested_outputs', 'format', 'StringArray')
+    # }}}
Index: /issm/trunk/src/m/classes/debug.py
===================================================================
--- /issm/trunk/src/m/classes/debug.py	(revision 24312)
+++ /issm/trunk/src/m/classes/debug.py	(revision 24313)
@@ -2,33 +2,37 @@
 from WriteData import *
 
+
 class debug(object):
-	"""
-	DEBUG class definition
+    """
+    DEBUG class definition
 
-	   Usage:
-	      debug=debug();
-	"""
+       Usage:
+          debug = debug()
+    """
 
-	def __init__(self): # {{{
-		self.valgrind  = False
-		self.gprof     = False
-		self.profiling = False
-		
-		#set defaults
-		self.setdefaultparameters()
+    def __init__(self):  # {{{
+        self.valgrind = False
+        self.gprof = False
+        self.profiling = False
 
-		#}}}
-	def __repr__(self): # {{{
-		string="   debug parameters:"
+    #set defaults
+        self.setdefaultparameters()
 
-		string="%s\n%s"%(string,fielddisplay(self,"valgrind","use Valgrind to debug (0 or 1)"))
-		string="%s\n%s"%(string,fielddisplay(self,"gprof","use gnu-profiler to find out where the time is spent"))
-		string="%s\n%s"%(string,fielddisplay(self,'profiling','enables profiling (memory, flops, time)'))
-		return string
-		#}}}
-	def setdefaultparameters(self): # {{{
-		return self
-	#}}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'object',self,'fieldname','profiling','format','Boolean')
-	# }}}
+    #}}}
+
+    def __repr__(self):  # {{{
+        string = "   debug parameters:"
+
+        string = "%s\n%s" % (string, fielddisplay(self, "valgrind", "use Valgrind to debug (0 or 1)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "gprof", "use gnu - profiler to find out where the time is spent"))
+        string = "%s\n%s" % (string, fielddisplay(self, 'profiling', 'enables profiling (memory, flops, time)'))
+        return string
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+        return self
+    #}}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'profiling', 'format', 'Boolean')
+    # }}}
Index: /issm/trunk/src/m/classes/dependent.py
===================================================================
--- /issm/trunk/src/m/classes/dependent.py	(revision 24312)
+++ /issm/trunk/src/m/classes/dependent.py	(revision 24313)
@@ -6,82 +6,87 @@
 from MeshProfileIntersection import MeshProfileIntersection
 
+
 class dependent(object):
-	"""
-	DEPENDENT class definition
+    """
+    DEPENDENT class definition
 
-	   Usage:
-	      dependent=dependent();
-	"""
+       Usage:
+          dependent = dependent()
+    """
 
-	def __init__(self,*args):    # {{{
-		self.name                 = ''
-		self.type                 = ''
-		self.fos_reverse_index    = float('NaN')
-		self.exp                  = ''
-		self.segments             = []
-		self.index                = -1
-		self.nods                 = 0
+    def __init__(self, *args):  # {{{
+        self.name = ''
+        self.type = ''
+        self.fos_reverse_index = float('NaN')
+        self.exp = ''
+        self.segments = []
+        self.index = -1
+        self.nods = 0
 
-		#set defaults 
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#use provided options to change fields
-		options=pairoptions(*args)
+    #use provided options to change fields
+        options = pairoptions(*args)
 
-		self.name=options.getfieldvalue('name','')
-		self.type=options.getfieldvalue('type','')
-		self.exp=options.getfieldvalue('exp','')
-		self.segments=options.getfieldvalue('segments',[])
-		self.index=options.getfieldvalue('index',-1)
-		self.nods=options.getfieldvalue('nods',0)
+        self.name = options.getfieldvalue('name', '')
+        self.type = options.getfieldvalue('type', '')
+        self.exp = options.getfieldvalue('exp', '')
+        self.segments = options.getfieldvalue('segments', [])
+        self.index = options.getfieldvalue('index', -1)
+        self.nods = options.getfieldvalue('nods', 0)
 
-		#if name is mass flux: 
-		if strcmpi(self.name,'MassFlux'):
-			#make sure that we supplied a file and that it exists! 
-			if not os.path.exists(self.exp):
-				raise IOError("dependent checkconsistency: specified 'exp' file does not exist!")
-			#process the file and retrieve segments
-			mesh=options.getfieldvalue('mesh')
-			self.segments=MeshProfileIntersection(mesh.elements,mesh.x,mesh.y,self.exp)[0]
-	# }}}
-	def __repr__(self):    # {{{
-		s ="   dependent variable:\n"
+        #if name is mass flux:
+        if strcmpi(self.name, 'MassFlux'):
+            #make sure that we supplied a file and that it exists!
+            if not os.path.exists(self.exp):
+                raise IOError("dependent checkconsistency: specified 'exp' file does not exist!")
+            #process the file and retrieve segments
+            mesh = options.getfieldvalue('mesh')
+            self.segments = MeshProfileIntersection(mesh.elements, mesh.x, mesh.y, self.exp)[0]
+    # }}}
 
-		s+="%s\n" % fielddisplay(self,'name',"variable name (must match corresponding String)")
-		s+="%s\n" % fielddisplay(self,'type',"type of variable ('vertex' or 'scalar')")
+    def __repr__(self):  # {{{
+        s = "   dependent variable:\n"
 
-		if not np.isnan(self.fos_reverse_index):
-			s+="%s\n" % fielddisplay(self,'fos_reverse_index',"index for fos_reverse driver of ADOLC")
-		if self.exp:
-			s+="%s\n" % fielddisplay(self,'exp',"file needed to compute dependent variable")
-			s+="%s\n" % fielddisplay(self,'segments',"mass flux segments")
+        s += "%s\n" % fielddisplay(self, 'name', "variable name (must match corresponding String)")
+        s += "%s\n" % fielddisplay(self, 'type', "type of variable ('vertex' or 'scalar')")
 
-		return s
-	# }}}
-	def setdefaultparameters(self):    # {{{
-		#do nothing
-		return self
-	# }}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		if strcmpi(self.name,'MassFlux'):
-			if not self.segments:
-				raise RuntimeError("dependent checkconsistency error: need segments to compute this dependent response")
-			if self.index<0:
-				raise RuntimeError("dependent checkconsistency error: index for segments should be >=0")
+        if not np.isnan(self.fos_reverse_index):
+            s += "%s\n" % fielddisplay(self, 'fos_reverse_index', "index for fos_reverse driver of ADOLC")
+        if self.exp:
+            s += "%s\n" % fielddisplay(self, 'exp', "file needed to compute dependent variable")
+            s += "%s\n" % fielddisplay(self, 'segments', "mass flux segments")
 
-		if not np.isnan(self.fos_reverse_index):
-			if not strcmpi(driver,'fos_reverse'):
-				raise TypeError("cannot declare a dependent with a fos_reverse_index when the driver is not fos_reverse!")
-			if self.nods==0:
-				raise TypeError("dependent checkconsistency error: nods should be set to the size of the independent variable")
+        return s
+    # }}}
 
-		return md
-	# }}}
-	def typetoscalar(self):    # {{{
-		if   strcmpi(self.type,'scalar'):
-			scalar=0
-		elif strcmpi(self.type,'vertex'):
-			scalar=1
+    def setdefaultparameters(self):  # {{{
+        #do nothing
+        return self
+    # }}}
 
-		return scalar
-	# }}}
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if strcmpi(self.name, 'MassFlux'):
+            if not self.segments:
+                raise RuntimeError("dependent checkconsistency error: need segments to compute this dependent response")
+            if self.index < 0:
+                raise RuntimeError("dependent checkconsistency error: index for segments should be >= 0")
+
+        if not np.isnan(self.fos_reverse_index):
+            if not strcmpi(driver, 'fos_reverse'):
+                raise TypeError("cannot declare a dependent with a fos_reverse_index when the driver is not fos_reverse!")
+            if self.nods == 0:
+                raise TypeError("dependent checkconsistency error: nods should be set to the size of the independent variable")
+
+        return md
+    # }}}
+
+    def typetoscalar(self):  # {{{
+        if strcmpi(self.type, 'scalar'):
+            scalar = 0
+        elif strcmpi(self.type, 'vertex'):
+            scalar = 1
+
+        return scalar
+    # }}}
Index: /issm/trunk/src/m/classes/esa.py
===================================================================
--- /issm/trunk/src/m/classes/esa.py	(revision 24312)
+++ /issm/trunk/src/m/classes/esa.py	(revision 24313)
@@ -2,93 +2,92 @@
 from MatlabFuncs import *
 from model import *
-import numpy as np
 from checkfield import checkfield
 from WriteData import WriteData
 
+
 class esa(object):
-	"""
-	ESA class definition
-	
-		Usage:
-		  esa=esa();
-	"""
-	
-	def __init__(self): # {{{
-		self.deltathickness    = float('NaN')
-		self.love_h            = 0 #provided by PREM model()
-		self.love_l            = 0 #ideam
-		self.hemisphere        = 0
-		self.degacc            = 0
-		self.requested_outputs = []
-		self.transitions       = []
-		
-		#set defaults
-		self.setdefaultparameters()
-		#}}}
-	def __repr__(self): # {{{
-			string='   esa parameters:'
-			string="%s\n%s"%(string,fielddisplay(self,'deltathickness','thickness change: ice height equivalent [m]'))
-			string="%s\n%s"%(string,fielddisplay(self,'love_h','load Love number for radial displacement'))
-			string="%s\n%s"%(string,fielddisplay(self,'love_l','load Love number for horizontal displaements'))
-                        string="%s\n%s"%(string,fielddisplay(self,'hemisphere','North-south, East-west components of 2-D horiz displacement vector: -1 south, 1 north'))
-			string="%s\n%s"%(string,fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions'))
-			string="%s\n%s"%(string,fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps'))
-			string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested (default: EsaUmotion)'))
+    """
+    ESA class definition
 
-			return string
-		# }}}
-	def setdefaultparameters(self): # {{{
-		
-		#numerical discretization accuracy
-		self.degacc=.01
-	
-                #computational flags:
-                self.hemisphere=0;
+        Usage:
+          esa = esa();
+    """
 
-		#output default:
-		self.requested_outputs=['default']
+    def __init__(self):  # {{{
+        self.deltathickness = float('NaN')
+        self.love_h = 0  #provided by PREM model()
+        self.love_l = 0  #ideam
+        self.hemisphere = 0
+        self.degacc = 0
+        self.requested_outputs = []
+        self.transitions = []
 
-		#transitions should be a cell array of vectors: 
-		self.transitions=[]
+    #set defaults
+        self.setdefaultparameters()
+    #}}}
 
-		#default output
-		self.requested_outputs=['default']
-		return self
-		#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+    def __repr__(self):  # {{{
+        string = '   esa parameters:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'deltathickness', 'thickness change: ice height equivalent [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'love_h', 'load Love number for radial displacement'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'love_l', 'load Love number for horizontal displaements'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'hemisphere', 'North-south, East-west components of 2-D horiz displacement vector:-1 south, 1 north'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'degacc', 'accuracy (default .01 deg) for numerical discretization of the Green''s functions'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'transitions', 'indices into parts of the mesh that will be icecaps'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested (default: EsaUmotion)'))
 
-		#Early return
-		if (solution!='EsaAnalysis'):
-			return md
+        return string
+    # }}}
 
-		md = checkfield(md,'fieldname','esa.deltathickness','NaN',1,'Inf',1,'size',[md.mesh.numberofelements,1])
-		md = checkfield(md,'fieldname','esa.love_h','NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','esa.love_l','NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','esa.hemisphere','NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','esa.degacc','size',[1,1],'>=',1e-10)
-		md = checkfield(md,'fieldname','esa.requested_outputs','stringrow',1)
+    def setdefaultparameters(self):  # {{{
+        #numerical discretization accuracy
+        self.degacc = 0.01
+        #computational flags:
+        self.hemisphere = 0
+        #output default:
+        self.requested_outputs = ['default']
+        #transitions should be a cell array of vectors:
+        self.transitions = []
+        #default output
+        self.requested_outputs = ['default']
+        return self
+    #}}}
 
-		#check that love numbers are provided at the same level of accuracy: 
-		if (size(self.love_h,0) != size(self.love_l,0)):
-			error('esa error message: love numbers should be provided at the same level of accuracy')
-		return md
-	# }}}
-	def defaultoutputs(self,md): # {{{
-		return ['EsaUmotion']
-	# }}}
-	def marshall(self,prefix,md,fid): # {{{
-		WriteData(fid,prefix,'object',self,'fieldname','deltathickness','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'fieldname','love_h','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','love_l','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','hemisphere','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','degacc','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','transitions','format','MatArray')
-	
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.esa.requested_outputs','format','StringArray')
-	# }}}
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if (solution != 'EsaAnalysis'):
+            return md
+
+        md = checkfield(md, 'fieldname', 'esa.deltathickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements, 1])
+        md = checkfield(md, 'fieldname', 'esa.love_h', 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'esa.love_l', 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'esa.hemisphere', 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'esa.degacc', 'size', [1, 1], '>=', 1e-10)
+        md = checkfield(md, 'fieldname', 'esa.requested_outputs', 'stringrow', 1)
+
+    #check that love numbers are provided at the same level of accuracy:
+        if (size(self.love_h, 0) != size(self.love_l, 0)):
+            error('esa error message: love numbers should be provided at the same level of accuracy')
+        return md
+    # }}}
+
+    def defaultoutputs(self, md):  # {{{
+        return ['EsaUmotion']
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'deltathickness', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'love_h', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'love_l', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'hemisphere', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'degacc', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'transitions', 'format', 'MatArray')
+
+    #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.esa.requested_outputs', 'format', 'StringArray')
+    # }}}
Index: /issm/trunk/src/m/classes/flowequation.py
===================================================================
--- /issm/trunk/src/m/classes/flowequation.py	(revision 24312)
+++ /issm/trunk/src/m/classes/flowequation.py	(revision 24313)
@@ -1,4 +1,3 @@
 import numpy as np
-import copy
 from project3d import project3d
 from fielddisplay import fielddisplay
@@ -7,139 +6,144 @@
 import MatlabFuncs as m
 
+
 class flowequation(object):
-	"""
-	FLOWEQUATION class definition
+    """
+    FLOWEQUATION class definition
 
-	   Usage:
-	      flowequation=flowequation();
-	"""
+       Usage:
+          flowequation = flowequation()
+    """
 
-	def __init__(self): # {{{
-		
-		self.isSIA                          = 0
-		self.isSSA                          = 0
-		self.isL1L2                         = 0
-		self.isHO                           = 0
-		self.isFS                           = 0
-		self.fe_SSA                         = ''
-		self.fe_HO                          = ''
-		self.fe_FS                          = ''
-		self.augmented_lagrangian_r         = 1.
-		self.augmented_lagrangian_rhop      = 1.
-		self.augmented_lagrangian_rlambda   = 1.
-		self.augmented_lagrangian_rholambda = 1.
-		self.XTH_theta                      = 0.
-		self.vertex_equation                = float('NaN')
-		self.element_equation               = float('NaN')
-		self.borderSSA                      = float('NaN')
-		self.borderHO                       = float('NaN')
-		self.borderFS                       = float('NaN')
+    def __init__(self):  # {{{
 
-		#set defaults
-		self.setdefaultparameters()
+        self.isSIA = 0
+        self.isSSA = 0
+        self.isL1L2 = 0
+        self.isHO = 0
+        self.isFS = 0
+        self.fe_SSA = ''
+        self.fe_HO = ''
+        self.fe_FS = ''
+        self.augmented_lagrangian_r = 1.
+        self.augmented_lagrangian_rhop = 1.
+        self.augmented_lagrangian_rlambda = 1.
+        self.augmented_lagrangian_rholambda = 1.
+        self.XTH_theta = 0.
+        self.vertex_equation = float('NaN')
+        self.element_equation = float('NaN')
+        self.borderSSA = float('NaN')
+        self.borderHO = float('NaN')
+        self.borderFS = float('NaN')
 
-		#}}}
-	def __repr__(self): # {{{
-		string='   flow equation parameters:'
+    #set defaults
+        self.setdefaultparameters()
 
-		string="%s\n%s"%(string,fielddisplay(self,'isSIA',"is the Shallow Ice Approximation (SIA) used ?"))
-		string="%s\n%s"%(string,fielddisplay(self,'isSSA',"is the Shelfy-Stream Approximation (SSA) used ?"))
-		string="%s\n%s"%(string,fielddisplay(self,'isL1L2',"are L1L2 equations used ?"))
-		string="%s\n%s"%(string,fielddisplay(self,'isHO',"is the Higher-Order (HO) approximation used ?"))
-		string="%s\n%s"%(string,fielddisplay(self,'isFS',"are the Full-FS (FS) equations used ?"))
-		string="%s\n%s"%(string,fielddisplay(self,'fe_SSA',"Finite Element for SSA: 'P1', 'P1bubble' 'P1bubblecondensed' 'P2'"))
-		string="%s\n%s"%(string,fielddisplay(self,'fe_HO' ,"Finite Element for HO:  'P1' 'P1bubble' 'P1bubblecondensed' 'P1xP2' 'P2xP1' 'P2'"))
-		string="%s\n%s"%(string,fielddisplay(self,'fe_FS' ,"Finite Element for FS:  'P1P1' (debugging only) 'P1P1GLS' 'MINIcondensed' 'MINI' 'TaylorHood' 'LATaylorHood' 'XTaylorHood'"))
-		string="%s\n%s"%(string,fielddisplay(self,'vertex_equation',"flow equation for each vertex"))
-		string="%s\n%s"%(string,fielddisplay(self,'element_equation',"flow equation for each element"))
-		string="%s\n%s"%(string,fielddisplay(self,'borderSSA',"vertices on SSA's border (for tiling)"))
-		string="%s\n%s"%(string,fielddisplay(self,'borderHO',"vertices on HO's border (for tiling)"))
-		string="%s\n%s"%(string,fielddisplay(self,'borderFS',"vertices on FS' border (for tiling)"))
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		self.element_equation=project3d(md,'vector',self.element_equation,'type','element')
-		self.vertex_equation=project3d(md,'vector',self.vertex_equation,'type','node')
-		self.borderSSA=project3d(md,'vector',self.borderSSA,'type','node')
-		self.borderHO=project3d(md,'vector',self.borderHO,'type','node')
-		self.borderFS=project3d(md,'vector',self.borderFS,'type','node')
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
+    #}}}
 
-		#P1 for SSA
-		self.fe_SSA= 'P1';
+    def __repr__(self):  # {{{
+        string = '   flow equation parameters:'
 
-		#P1 for HO
-		self.fe_HO= 'P1';
+        string = "%s\n%s" % (string, fielddisplay(self, 'isSIA', "is the Shallow Ice Approximation (SIA) used ?"))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isSSA', "is the Shelfy - Stream Approximation (SSA) used ?"))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isL1L2', "are L1L2 equations used ?"))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isHO', "is the Higher - Order (HO) approximation used ?"))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isFS', "are the Full - FS (FS) equations used ?"))
+        string = "%s\n%s" % (string, fielddisplay(self, 'fe_SSA', "Finite Element for SSA: 'P1', 'P1bubble' 'P1bubblecondensed' 'P2'"))
+        string = "%s\n%s" % (string, fielddisplay(self, 'fe_HO', "Finite Element for HO:  'P1', 'P1bubble', 'P1bubblecondensed', 'P1xP2', 'P2xP1', 'P2', 'P2bubble', 'P1xP3', 'P2xP4'"))
+        string = "%s\n%s" % (string, fielddisplay(self, 'fe_FS', "Finite Element for FS:  'P1P1' (debugging only) 'P1P1GLS' 'MINIcondensed' 'MINI' 'TaylorHood' 'LATaylorHood' 'XTaylorHood'"))
+        string = "%s\n%s" % (string, fielddisplay(self, 'vertex_equation', "flow equation for each vertex"))
+        string = "%s\n%s" % (string, fielddisplay(self, 'element_equation', "flow equation for each element"))
+        string = "%s\n%s" % (string, fielddisplay(self, 'borderSSA', "vertices on SSA's border (for tiling)"))
+        string = "%s\n%s" % (string, fielddisplay(self, 'borderHO', "vertices on HO's border (for tiling)"))
+        string = "%s\n%s" % (string, fielddisplay(self, 'borderFS', "vertices on FS' border (for tiling)"))
+        return string
+    #}}}
 
-		#MINI condensed element for FS by default
-		self.fe_FS = 'MINIcondensed';
+    def extrude(self, md):  # {{{
+        self.element_equation = project3d(md, 'vector', self.element_equation, 'type', 'element')
+        self.vertex_equation = project3d(md, 'vector', self.vertex_equation, 'type', 'node')
+        self.borderSSA = project3d(md, 'vector', self.borderSSA, 'type', 'node')
+        self.borderHO = project3d(md, 'vector', self.borderHO, 'type', 'node')
+        self.borderFS = project3d(md, 'vector', self.borderFS, 'type', 'node')
+        return self
+    #}}}
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+    def setdefaultparameters(self):  # {{{
+        #P1 for SSA
+        self.fe_SSA = 'P1'
 
-		#Early return
-		if ('StressbalanceAnalysis' not in analyses and 'StressbalanceSIAAnalysis' not in analyses) or (solution=='TransientSolution' and not md.transient.isstressbalance):
-			return md
+        #P1 for HO
+        self.fe_HO = 'P1'
 
-		md = checkfield(md,'fieldname','flowequation.isSIA','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','flowequation.isSSA','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','flowequation.isL1L2','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','flowequation.isHO','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','flowequation.fe_SSA','values',['P1','P1bubble','P1bubblecondensed','P2','P2bubble'])
-		md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',['P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P2xP4'])
-		md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',['P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','LATaylorHood','XTaylorHood','OneLayerP4z','CrouzeixRaviart','LACrouzeixRaviart'])
-		md = checkfield(md,'fieldname','flowequation.borderSSA','size',[md.mesh.numberofvertices],'values',[0,1])
-		md = checkfield(md,'fieldname','flowequation.borderHO','size',[md.mesh.numberofvertices],'values',[0,1])
-		md = checkfield(md,'fieldname','flowequation.borderFS','size',[md.mesh.numberofvertices],'values',[0,1])
-		md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_r','numel',[1],'>',0.)
-		md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rhop','numel',[1],'>',0.)
-		md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rlambda','numel',[1],'>',0.)
-		md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rholambda','numel',[1],'>',0.)
-		md = checkfield(md,'fieldname','flowequation.XTH_theta','numel',[1],'>=',0.,'<',.5)
-		if m.strcmp(md.mesh.domaintype(),'2Dhorizontal'):
-			md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices],'values',[1,2])
-			md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements],'values',[1,2])
-		elif m.strcmp(md.mesh.domaintype(),'2Dvertical'):
-			md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices],'values',[2,4,5])
-			md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements],'values',[2,4,5])
-		elif m.strcmp(md.mesh.domaintype(),'3D'):
-			md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices],'values',np.arange(0,8+1))
-			md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements],'values',np.arange(0,8+1))
-		else:
-			raise RuntimeError('mesh type not supported yet')
-		if not (self.isSIA or self.isSSA or self.isL1L2 or self.isHO or self.isFS):
-			md.checkmessage("no element types set for this model")
+        #MINI condensed element for FS by default
+        self.fe_FS = 'MINIcondensed'
 
-		if 'StressbalanceSIAAnalysis' in analyses:
-			if any(self.element_equation==1):
-				if np.any(np.logical_and(self.vertex_equation,md.mask.groundedice_levelset)):
-					print "\n !!! Warning: SIA's model is not consistent on ice shelves !!!\n"
+        return self
+    #}}}
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'object',self,'fieldname','isSIA','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','isSSA','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','isL1L2','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','isHO','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','isFS','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','fe_SSA','data',self.fe_SSA,'format','String')
-		WriteData(fid,prefix,'object',self,'fieldname','fe_HO','data',self.fe_HO,'format','String')
-		WriteData(fid,prefix,'object',self,'fieldname','fe_FS','data',self.fe_FS ,'format','String')
-		WriteData(fid,prefix,'object',self,'fieldname','augmented_lagrangian_r','format','Double');
-		WriteData(fid,prefix,'object',self,'fieldname','augmented_lagrangian_rhop','format','Double');
-		WriteData(fid,prefix,'object',self,'fieldname','augmented_lagrangian_rlambda','format','Double');
-		WriteData(fid,prefix,'object',self,'fieldname','augmented_lagrangian_rholambda','format','Double');
-		WriteData(fid,prefix,'object',self,'fieldname','XTH_theta','data',self.XTH_theta ,'format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','borderSSA','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','borderHO','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','borderFS','format','DoubleMat','mattype',1)
-		#convert approximations to enums
-		WriteData(fid,prefix,'data',self.vertex_equation,'name','md.flowequation.vertex_equation','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'data',self.element_equation,'name','md.flowequation.element_equation','format','DoubleMat','mattype',2)
+    def checkconsistency(self, md, solution, analyses):  # {{{
 
-	# }}}
+        #Early return
+        if ('StressbalanceAnalysis' not in analyses and 'StressbalanceSIAAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isstressbalance):
+            return md
+
+        md = checkfield(md, 'fieldname', 'flowequation.isSIA', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'flowequation.isSSA', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'flowequation.isL1L2', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'flowequation.isHO', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'flowequation.isFS', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'flowequation.fe_SSA', 'values', ['P1', 'P1bubble', 'P1bubblecondensed', 'P2', 'P2bubble'])
+        md = checkfield(md, 'fieldname', 'flowequation.fe_HO', 'values', ['P1', 'P1bubble', 'P1bubblecondensed', 'P1xP2', 'P2xP1', 'P2', 'P2bubble', 'P1xP3', 'P2xP4'])
+        md = checkfield(md, 'fieldname', 'flowequation.fe_FS', 'values', ['P1P1', 'P1P1GLS', 'MINIcondensed', 'MINI', 'TaylorHood', 'LATaylorHood', 'XTaylorHood', 'OneLayerP4z', 'CrouzeixRaviart', 'LACrouzeixRaviart'])
+        md = checkfield(md, 'fieldname', 'flowequation.borderSSA', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'flowequation.borderHO', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'flowequation.borderFS', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'flowequation.augmented_lagrangian_r', 'numel', [1], '>', 0.)
+        md = checkfield(md, 'fieldname', 'flowequation.augmented_lagrangian_rhop', 'numel', [1], '>', 0.)
+        md = checkfield(md, 'fieldname', 'flowequation.augmented_lagrangian_rlambda', 'numel', [1], '>', 0.)
+        md = checkfield(md, 'fieldname', 'flowequation.augmented_lagrangian_rholambda', 'numel', [1], '>', 0.)
+        md = checkfield(md, 'fieldname', 'flowequation.XTH_theta', 'numel', [1], '>=', 0., '<', .5)
+        if m.strcmp(md.mesh.domaintype(), '2Dhorizontal'):
+            md = checkfield(md, 'fieldname', 'flowequation.vertex_equation', 'size', [md.mesh.numberofvertices], 'values', [1, 2])
+            md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', [1, 2])
+        elif m.strcmp(md.mesh.domaintype(), '2Dvertical'):
+            md = checkfield(md, 'fieldname', 'flowequation.vertex_equation', 'size', [md.mesh.numberofvertices], 'values', [2, 4, 5])
+            md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', [2, 4, 5])
+        elif m.strcmp(md.mesh.domaintype(), '3D'):
+            md = checkfield(md, 'fieldname', 'flowequation.vertex_equation', 'size', [md.mesh.numberofvertices], 'values', np.arange(0, 8 + 1))
+            md = checkfield(md, 'fieldname', 'flowequation.element_equation', 'size', [md.mesh.numberofelements], 'values', np.arange(0, 8 + 1))
+        else:
+            raise RuntimeError('mesh type not supported yet')
+        if not (self.isSIA or self.isSSA or self.isL1L2 or self.isHO or self.isFS):
+            md.checkmessage("no element types set for this model")
+
+        if 'StressbalanceSIAAnalysis' in analyses:
+            if any(self.element_equation == 1):
+                if np.any(np.logical_and(self.vertex_equation, md.mask.groundedice_levelset)):
+                    print("\n !!! Warning: SIA's model is not consistent on ice shelves !!!\n")
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isSIA', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isSSA', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isL1L2', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isHO', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isFS', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'fe_SSA', 'data', self.fe_SSA, 'format', 'String')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'fe_HO', 'data', self.fe_HO, 'format', 'String')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'fe_FS', 'data', self.fe_FS, 'format', 'String')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'augmented_lagrangian_r', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'augmented_lagrangian_rhop', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'augmented_lagrangian_rlambda', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'augmented_lagrangian_rholambda', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'XTH_theta', 'data', self.XTH_theta, 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'borderSSA', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'borderHO', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'borderFS', 'format', 'DoubleMat', 'mattype', 1)
+        #convert approximations to enums
+        WriteData(fid, prefix, 'data', self.vertex_equation, 'name', 'md.flowequation.vertex_equation', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'data', self.element_equation, 'name', 'md.flowequation.element_equation', 'format', 'DoubleMat', 'mattype', 2)
+
+    # }}}
Index: /issm/trunk/src/m/classes/fourierlove.py
===================================================================
--- /issm/trunk/src/m/classes/fourierlove.py	(revision 24312)
+++ /issm/trunk/src/m/classes/fourierlove.py	(revision 24313)
@@ -3,107 +3,103 @@
 from WriteData import WriteData
 
+
 class fourierlove(object):
-	"""
-	Fourier Love Number class definition
+    """
+    Fourier Love Number class definition
 
-	   Usage:
-	      fourierlove=fourierlove();
-	"""
+       Usage:
+          fourierlove = fourierlove()
+    """
+    def __init__(self):  # {{{
+        self.nfreq = 0
+        self.frequencies = 0
+        self.sh_nmax = 0
+        self.sh_nmin = 0
+        self.g0 = 0
+        self.r0 = 0
+        self.mu0 = 0
+        self.allow_layer_deletion = 0
+        self.love_kernels = 0
+        self.forcing_type = 0
 
-	def __init__(self): # {{{
-                self.nfreq                =  0;
-		self.frequencies          =  0;
-		self.sh_nmax              =  0;
-		self.sh_nmin              =  0;
-		self.g0                   =  0; 
-		self.r0                   =  0; 
-		self.mu0                  =  0;
-                self.allow_layer_deletion =  0;
-                self.love_kernels 	  =  0;
-		self.forcing_type         =  0;
+    #set defaults
+        self.setdefaultparameters()
+    #}}}
 
-		#set defaults
-		self.setdefaultparameters()
+    def __repr__(self):  # {{{
+        string = '   Fourier Love class:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'nfreq', 'number of frequencies sampled (default 1, elastic) [Hz]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'frequencies', 'frequencies sampled (convention defaults to 0 for the elastic case) [Hz]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'sh_nmax', 'maximum spherical harmonic degree (default 256, .35 deg, or 40 km at equator)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'sh_nmin', 'minimum spherical harmonic degree (default 1)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'g0', 'adimensioning constant for gravity (default 10) [m / s^2]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'r0', 'adimensioning constant for radius (default 6378 * 1.0e3) [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'mu0', 'adimensioning constant for stress (default 1.0e11) [Pa]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'allow_layer_deletion', 'allow for migration of the integration boundary with increasing spherical harmonics degree (default 1)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'love_kernels', 'compute love numbers at depth? (default 0)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'forcing_type', 'integer indicating the nature and depth of the forcing for the Love number calculation (default 11) :'))
+        string = "%s\n%s" % (string, '                                                     1:  Inner core boundary -- Volumic Potential')
+        string = "%s\n%s" % (string, '                                                     2:  Inner core boundary --  Pressure')
+        string = "%s\n%s" % (string, '                                                     3:  Inner core boundary --  Loading')
+        string = "%s\n%s" % (string, '                                                     4:  Inner core boundary --  Tangential traction')
+        string = "%s\n%s" % (string, '                                                     5:  Core mantle boundary --  Volumic Potential')
+        string = "%s\n%s" % (string, '                                                     6:  Core mantle boundary --  Pressure')
+        string = "%s\n%s" % (string, '                                                     7:  Core mantle boundary --  Loading')
+        string = "%s\n%s" % (string, '                                                     8:  Core mantle boundary --  Tangential traction')
+        string = "%s\n%s" % (string, '                                                     9:  Surface--  Volumic Potential')
+        string = "%s\n%s" % (string, '                                                     10: Surface--  Pressure')
+        string = "%s\n%s" % (string, '                                                     11: Surface--  Loading')
+        string = "%s\n%s" % (string, '                                                     12: Surface--  Tangential traction ')
 
-		#}}}
-	def __repr__(self): # {{{
-		
-		string='   Fourier Love class:' 
-		
-                string="%s\n%s"%(string,fielddisplay(self,'nfreq','number of frequencies sampled (default 1, elastic) [Hz]'))
-                string="%s\n%s"%(string,fielddisplay(self,'frequencies','frequencies sampled (convention defaults to 0 for the elastic case) [Hz]'))
-                string="%s\n%s"%(string,fielddisplay(self,'sh_nmax','maximum spherical harmonic degree (default 256, .35 deg, or 40 km at equator)'))
-                string="%s\n%s"%(string,fielddisplay(self,'sh_nmin','minimum spherical harmonic degree (default 1)'))
-                string="%s\n%s"%(string,fielddisplay(self,'g0','adimensioning constant for gravity (default 10) [m/s^2]'))
-                string="%s\n%s"%(string,fielddisplay(self,'r0','adimensioning constant for radius (default 6378*10^3) [m]'))
-                string="%s\n%s"%(string,fielddisplay(self,'mu0','adimensioning constant for stress (default 10^11) [Pa]'))
-                string="%s\n%s"%(string,fielddisplay(self,'allow_layer_deletion','allow for migration of the integration boundary with increasing spherical harmonics degree (default 1)'))
-                string="%s\n%s"%(string,fielddisplay(self,'love_kernels','compute love numbers at depth? (default 0)'))
-                string="%s\n%s"%(string,fielddisplay(self,'forcing_type','integer indicating the nature and depth of the forcing for the Love number calculation (default 11) :'))
-                string="%s\n%s"%(string,'                                                     1:  Inner core boundary -- Volumic Potential')
-                string="%s\n%s"%(string,'                                                     2:  Inner core boundary -- Pressure')
-                string="%s\n%s"%(string,'                                                     3:  Inner core boundary -- Loading')
-                string="%s\n%s"%(string,'                                                     4:  Inner core boundary -- Tangential traction')
-                string="%s\n%s"%(string,'                                                     5:  Core mantle boundary -- Volumic Potential')
-                string="%s\n%s"%(string,'                                                     6:  Core mantle boundary -- Pressure')
-                string="%s\n%s"%(string,'                                                     7:  Core mantle boundary -- Loading')
-                string="%s\n%s"%(string,'                                                     8:  Core mantle boundary -- Tangential traction')
-                string="%s\n%s"%(string,'                                                     9:  Surface -- Volumic Potential')
-                string="%s\n%s"%(string,'                                                     10: Surface -- Pressure')
-                string="%s\n%s"%(string,'                                                     11: Surface -- Loading')
-                string="%s\n%s"%(string,'                                                     12: Surface -- Tangential traction ')
+        return string
+    #}}}
 
-                return string;
+    def extrude(self, md):  # {{{
+        return self
+    #}}}
 
+    def setdefaultparameters(self):  # {{{
+        #we setup an elastic love number computation by default.
+        self.nfreq = 1
+        self.frequencies = [0]  #Hz
+        self.sh_nmax = 256  # .35 degree, 40 km at the equator.
+        self.sh_nmin = 1
+        self.g0 = 10  # m / s^2
+        self.r0 = 6378 * 1e3  #m
+        self.mu0 = 1e11  # Pa
+        self.allow_layer_deletion = 1
+        self.love_kernels = 0
+        self.forcing_type = 11
 
-		#}}}
-	def extrude(self,md): # {{{
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
+        return self
+    #}}}
 
-            #we setup an elastic love number computation by default.
-            self.nfreq=1
-            self.frequencies=[0]; #Hz
-            self.sh_nmax=256 # .35 degree, 40 km at the equator.
-            self.sh_nmin=1
-            self.g0=10 # m/s^2
-            self.r0=6378*1e3 #m
-            self.mu0=1e11 # Pa
-            self.allow_layer_deletion=1
-            self.love_kernels=0 
-            self.forcing_type = 11
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        md = checkfield(md, 'fieldname', 'love.nfreq', 'NaN', 1, 'Inf', 1, 'numel', [1], '>', 0)
+        md = checkfield(md, 'fieldname', 'love.frequencies', 'NaN', 1, 'Inf', 1, 'numel', [md.love.nfreq])
+        md = checkfield(md, 'fieldname', 'love.sh_nmax', 'NaN', 1, 'Inf', 1, 'numel', [1], '>', 0)
+        md = checkfield(md, 'fieldname', 'love.sh_nmin', 'NaN', 1, 'Inf', 1, 'numel', [1], '>', 0)
+        md = checkfield(md, 'fieldname', 'love.g0', 'NaN', 1, 'Inf', 1, 'numel', [1], '>', 0)
+        md = checkfield(md, 'fieldname', 'love.r0', 'NaN', 1, 'Inf', 1, 'numel', [1], '>', 0)
+        md = checkfield(md, 'fieldname', 'love.mu0', 'NaN', 1, 'Inf', 1, 'numel', [1], '>', 0)
+        md = checkfield(md, 'fieldname', 'love.allow_layer_deletion', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'love.love_kernels', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'love.forcing_type', 'NaN', 1, 'Inf', 1, 'numel', [1], '>', 0, '<=', 12)
+        if md.love.sh_nmin <= 1 and md.love.forcing_type == 9:
+            raise RuntimeError("Degree 1 not supported for Volumetric Potential forcing. Use sh_min >= 2 for this kind of calculation.")
 
-            return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+        return md
+    # }}}
 
-            md = checkfield(md,'fieldname','love.nfreq','NaN',1,'Inf',1,'numel',[1],'>',0);
-            md = checkfield(md,'fieldname','love.frequencies','NaN',1,'Inf',1,'numel',[md.love.nfreq]);
-            md = checkfield(md,'fieldname','love.sh_nmax','NaN',1,'Inf',1,'numel',[1],'>',0);
-            md = checkfield(md,'fieldname','love.sh_nmin','NaN',1,'Inf',1,'numel',[1],'>',0);
-            md = checkfield(md,'fieldname','love.g0','NaN',1,'Inf',1,'numel',[1],'>',0);
-            md = checkfield(md,'fieldname','love.r0','NaN',1,'Inf',1,'numel',[1],'>',0);
-            md = checkfield(md,'fieldname','love.mu0','NaN',1,'Inf',1,'numel',[1],'>',0);
-            md = checkfield(md,'fieldname','love.allow_layer_deletion','values',[0,1]);
-            md = checkfield(md,'fieldname','love.love_kernels','values',[0,1]);
-            md = checkfield(md,'fieldname','love.forcing_type','NaN',1,'Inf',1,'numel',[1],'>',0, '<=', 12);
-            if md.love.sh_nmin<=1 and md.love.forcing_type==9:
-                raise RuntimeError("Degree 1 not supported for Volumetric Potential forcing. Use sh_min>=2 for this kind of calculation.")
-
-            return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-            
-            WriteData(fid,prefix,'object',self,'fieldname','nfreq','format','Integer');
-            WriteData(fid,prefix,'object',self,'fieldname','frequencies','format','DoubleMat','mattype',3);
-            WriteData(fid,prefix,'object',self,'fieldname','sh_nmax','format','Integer');
-            WriteData(fid,prefix,'object',self,'fieldname','sh_nmin','format','Integer');
-            WriteData(fid,prefix,'object',self,'fieldname','g0','format','Double');
-            WriteData(fid,prefix,'object',self,'fieldname','r0','format','Double');
-            WriteData(fid,prefix,'object',self,'fieldname','mu0','format','Double');
-            WriteData(fid,prefix,'object',self,'fieldname','allow_layer_deletion','format','Boolean');
-            WriteData(fid,prefix,'object',self,'fieldname','love_kernels','format','Boolean');
-            WriteData(fid,prefix,'object',self,'fieldname','forcing_type','format','Integer');
-
-	# }}}
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'nfreq', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'frequencies', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'sh_nmax', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'sh_nmin', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'g0', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'r0', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'mu0', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'allow_layer_deletion', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'love_kernels', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'forcing_type', 'format', 'Integer')
+    # }}}
Index: /issm/trunk/src/m/classes/friction.m
===================================================================
--- /issm/trunk/src/m/classes/friction.m	(revision 24312)
+++ /issm/trunk/src/m/classes/friction.m	(revision 24313)
@@ -24,5 +24,5 @@
 					self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
 				case 4
-					error('not implemented yet');
+					self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
 				otherwise
 					error('not supported yet');		
@@ -61,5 +61,5 @@
 					md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1);
 				case 4
-					error('not implemented yet');
+				
 				otherwise
 					error('not supported yet');		
@@ -72,5 +72,5 @@
 			fielddisplay(self,'q','q exponent');
 			fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
-			fielddisplay(self,'coupling','Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: used coupled model (not implemented yet)');
+			fielddisplay(self,'coupling','Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: use coupled model (not implemented yet)');
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
@@ -89,5 +89,5 @@
 					WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 				case 4
-					error('not implemented yet');
+					WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
 				otherwise
 					error('not supported yet');		
Index: /issm/trunk/src/m/classes/friction.py
===================================================================
--- /issm/trunk/src/m/classes/friction.py	(revision 24312)
+++ /issm/trunk/src/m/classes/friction.py	(revision 24313)
@@ -1,3 +1,2 @@
-import numpy as np
 from fielddisplay import fielddisplay
 from project3d import project3d
@@ -5,71 +4,95 @@
 from WriteData import WriteData
 
+
 class friction(object):
-	"""
-	FRICTION class definition
+    """
+    FRICTION class definition
 
-	   Usage:
-	      friction=friction()
-	"""
+       Usage:
+          friction = friction()
+    """
 
-	def __init__(self): # {{{
-		self.coefficient = float('NaN')
-		self.p           = float('NaN')
-		self.q           = float('NaN')
-		self.coupling  	 = 0
-		self.effective_pressure	= float('NaN')
-		#set defaults
-		self.setdefaultparameters()
+    def __init__(self):  # {{{
+        self.coefficient = float('NaN')
+        self.p = float('NaN')
+        self.q = float('NaN')
+        self.coupling = 0
+        self.effective_pressure = float('NaN')
+    #set defaults
+        self.setdefaultparameters()
+        self.requested_outputs = []
+    #}}}
 
-		#}}}
-	def __repr__(self): # {{{
-		string="Basal shear stress parameters: Sigma_b = coefficient^2 * Neff ^r * |u_b|^(s-1) * u_b,\n(effective stress Neff=rho_ice*g*thickness+rho_water*g*base, r=q/p and s=1/p)"
+    def __repr__(self):  # {{{
+        string = "Basal shear stress parameters: Sigma_b = coefficient^2 * Neff ^r * |u_b|^(s - 1) * u_b, \n(effective stress Neff = rho_ice * g * thickness + rho_water * g * base, r = q / p and s = 1 / p)"
 
-		string="%s\n%s"%(string,fielddisplay(self,"coefficient","friction coefficient [SI]"))
-		string="%s\n%s"%(string,fielddisplay(self,"p","p exponent"))
-		string="%s\n%s"%(string,fielddisplay(self,"q","q exponent"))
-                string="%s\n%s"%(string,fielddisplay(self,'coupling','Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: used coupled model (not implemented yet)'))
-		string="%s\n%s"%(string,fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]'))
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1)
-		self.p=project3d(md,'vector',self.p,'type','element')
-		self.q=project3d(md,'vector',self.q,'type','element')
-		#if self.coupling==0: #doesnt work with empty loop, so just skip it?
-		if self.coupling in[3,4]:
-			self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1)
-		elif self.coupling > 4:
-			raise ValueError('md.friction.coupling larger than 4, not supported yet')
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+        string = "%s\n%s" % (string, fielddisplay(self, "coefficient", "friction coefficient [SI]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "p", "p exponent"))
+        string = "%s\n%s" % (string, fielddisplay(self, "q", "q exponent"))
+        string = "%s\n%s" % (string, fielddisplay(self, 'coupling', 'Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: used coupled model (not implemented yet)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'effective_pressure', 'Effective Pressure for the forcing if not coupled [Pa]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+        return string
+    #}}}
 
-		#Early return
-		if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
-			return md
+    def extrude(self, md):  # {{{
+        self.coefficient = project3d(md, 'vector', self.coefficient, 'type', 'node', 'layer', 1)
+        self.p = project3d(md, 'vector', self.p, 'type', 'element')
+        self.q = project3d(md, 'vector', self.q, 'type', 'element')
+    #if self.coupling == 0:  #doesnt work with empty loop, so just skip it?
+        if self.coupling in[3, 4]:
+            self.effective_pressure = project3d(md, 'vector', self.effective_pressure, 'type', 'node', 'layer', 1)
+        elif self.coupling > 4:
+            raise ValueError('md.friction.coupling larger than 4, not supported yet')
+        return self
+    #}}}
 
-		md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
-		md = checkfield(md,'fieldname','friction.p','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
-		md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0,1,2,3,4])
-		if self.coupling==3:
-			md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1)
-		elif self.coupling > 4:
-			raise ValueError('md.friction.coupling larger than 4, not supported yet')
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'name','md.friction.law','data',1,'format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','p','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'fieldname','q','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer')
-		if self.coupling in[3,4]:
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		elif self.coupling > 4:
-			raise ValueError('md.friction.coupling larger than 4, not supported yet')
-	# }}}
+    def setdefaultparameters(self):  # {{{
+        self.requested_outputs = ['default']
+        return self
+    #}}}
+
+    def defaultoutputs(self, md):  # {{{
+        list = []
+        return list
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+
+        #Early return
+        if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
+            return md
+
+        md = checkfield(md, 'fieldname', 'friction.coefficient', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'friction.q', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
+        md = checkfield(md, 'fieldname', 'friction.p', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
+        md = checkfield(md, 'fieldname', 'friction.coupling', 'numel', [1], 'values', [0, 1, 2, 3, 4])
+        if self.coupling == 3:
+            md = checkfield(md, 'fieldname', 'friction.effective_pressure', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+        elif self.coupling > 4:
+            raise ValueError('md.friction.coupling larger than 4, not supported yet')
+        md = checkfield(md, 'fieldname', 'friction.requested_outputs', 'stringrow', 1)
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'name', 'md.friction.law', 'data', 1, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'coefficient', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'p', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'q', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'coupling', 'format', 'Integer')
+        if self.coupling == 3:
+            WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'effective_pressure', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        if self.coupling == 4:
+            WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'effective_pressure', 'format', 'DoubleMat', 'mattype', 1)
+        elif self.coupling > 4:
+            raise ValueError('md.friction.coupling larger than 4, not supported yet')
+
+    #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.friction.requested_outputs', 'format', 'StringArray')
+    # }}}
Index: /issm/trunk/src/m/classes/frictioncoulomb.py
===================================================================
--- /issm/trunk/src/m/classes/frictioncoulomb.py	(revision 24312)
+++ /issm/trunk/src/m/classes/frictioncoulomb.py	(revision 24313)
@@ -3,4 +3,5 @@
 from checkfield import checkfield
 from WriteData import WriteData
+
 
 class frictioncoulomb(object):
@@ -9,76 +10,77 @@
 
     Usage:
-        frictioncoulomb=frictioncoulomb()
+    frictioncoulomb = frictioncoulomb()
     """
 
-    def __init__(self): # {{{
+    def __init__(self):  # {{{
         self.coefficient = float('NaN')
         self.coefficientcoulomb = float('NaN')
         self.p = float('NaN')
-	self.q = float('NaN')
-	self.coupling  	 = 0
-	self.effective_pressure	= float('NaN')
-	#set defaults
-	self.setdefaultparameters()
+        self.q = float('NaN')
+        self.coupling = 0
+        self.effective_pressure = float('NaN')
+    #set defaults
+        self.setdefaultparameters()
+    #}}}
 
+    def __repr__(self):  # {{{
+        string = "Basal shear stress parameters: Sigma_b = min(coefficient^2 * Neff ^r * |u_b|^(s - 1) * u_b, \n coefficientcoulomb^2 * rho_i * g * (h - h_f)), (effective stress Neff = rho_ice * g * thickness + rho_water * g * bed, r = q / p and s = 1 / p)."
+        string = "%s\n%s" % (string, fielddisplay(self, "coefficient", "power law (Weertman) friction coefficient [SI]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "coefficientcoulomb", "Coulomb friction coefficient [SI]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "p", "p exponent"))
+        string = "%s\n%s" % (string, fielddisplay(self, "q", "q exponent"))
+        string = "%s\n%s" % (string, fielddisplay(self, 'coupling', 'Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled(not implemented yet)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'effective_pressure', 'Effective Pressure for the forcing if not coupled [Pa]'))
+        return string
     #}}}
-    def __repr__(self): # {{{
-	string="Basal shear stress parameters: Sigma_b = min(coefficient^2 * Neff ^r * |u_b|^(s-1) * u_b,\n coefficientcoulomb^2 * rho_i * g * (h-h_f)), (effective stress Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p)."
 
-	string="%s\n%s"%(string,fielddisplay(self,"coefficient","power law (Weertman) friction coefficient [SI]"))
-	string="%s\n%s"%(string,fielddisplay(self,"coefficientcoulomb","Coulomb friction coefficient [SI]"))
-	string="%s\n%s"%(string,fielddisplay(self,"p","p exponent"))
-	string="%s\n%s"%(string,fielddisplay(self,"q","q exponent"))
-	string="%s\n%s"%(string,fielddisplay(self,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled(not implemented yet)'))
-	string="%s\n%s"%(string,fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]'))
-	return string
+    def extrude(self, md):  # {{{
+        self.coefficient = project3d(md, 'vector', self.coefficient, 'type', 'node', 'layer', 1)
+        self.coefficientcoulomb = project3d(md, 'vector', self.coefficientcoulomb, 'type', 'node', 'layer', 1)
+        self.p = project3d(md, 'vector', self.p, 'type', 'element')
+        self.q = project3d(md, 'vector', self.q, 'type', 'element')
+        if self.coupling == 1:
+            self.effective_pressure = project3d(md, 'vector', self.effective_pressure, 'type', 'node', 'layer', 1)
+        elif self.coupling == 2:
+            raise ValueError('coupling not supported yet')
+        elif self.coupling > 2:
+            raise ValueError('md.friction.coupling larger than 2, not supported yet')
+        return self
     #}}}
-    def extrude(self,md): # {{{
-	self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1)
-	self.coefficientcoulomb=project3d(md,'vector',self.coefficientcoulomb,'type','node','layer',1)
-	self.p=project3d(md,'vector',self.p,'type','element')
-	self.q=project3d(md,'vector',self.q,'type','element')
-	if self.coupling==1:
-		self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1)
-	elif self.coupling==2:
-		raise ValueError('coupling not supported yet')
-	elif self.coupling > 2:
-		raise ValueError('md.friction.coupling larger than 2, not supported yet')	
-	return self
+
+    def setdefaultparameters(self):  # {{{
+        return self
     #}}}
-    def setdefaultparameters(self): # {{{
-	return self
-    #}}}
-    def checkconsistency(self,md,solution,analyses):    # {{{
 
-	#Early return
-	if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
-	    return md
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
+            return md
 
-	md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1)
-	md = checkfield(md,'fieldname','friction.coefficientcoulomb','timeseries',1,'NaN',1,'Inf',1)
-	md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
-	md = checkfield(md,'fieldname','friction.p','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
-	if self.coupling==1:
-		md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1)
-	elif self.coupling==2:
-		raise ValueError('coupling not supported yet')
-	elif self.coupling > 2:
-		raise ValueError('md.friction.coupling larger than 2, not supported yet')
-	return md
+        md = checkfield(md, 'fieldname', 'friction.coefficient', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'friction.coefficientcoulomb', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'friction.q', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
+        md = checkfield(md, 'fieldname', 'friction.p', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
+        if self.coupling == 1:
+            md = checkfield(md, 'fieldname', 'friction.effective_pressure', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+        elif self.coupling == 2:
+            raise ValueError('coupling not supported yet')
+        elif self.coupling > 2:
+            raise ValueError('md.friction.coupling larger than 2, not supported yet')
+        return md
+    # }}}
 
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'name', 'md.friction.law', 'data', 7, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'coefficient', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'coefficientcoulomb', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'p', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'q', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'coupling', 'format', 'Integer')
+        if self.coupling == 1:
+            WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'effective_pressure', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        elif self.coupling == 2:
+            raise ValueError('coupling not supported yet')
+        elif self.coupling > 2:
+            raise ValueError('md.friction.coupling larger than 2, not supported yet')
     # }}}
-    def marshall(self,prefix,md,fid):    # {{{
-	WriteData(fid,prefix,'name','md.friction.law','data',7,'format','Integer')
-	WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-	WriteData(fid,prefix,'object',self,'fieldname','coefficientcoulomb','format','DoubleMat','mattype',1)
-	WriteData(fid,prefix,'object',self,'fieldname','p','format','DoubleMat','mattype',2)
-	WriteData(fid,prefix,'object',self,'fieldname','q','format','DoubleMat','mattype',2)
-	WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer')
-	if self.coupling==1:
-		WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-	elif self.coupling==2:
-		raise ValueError('coupling not supported yet')
-	elif self.coupling > 2:
-		raise ValueError('md.friction.coupling larger than 2, not supported yet')	
-    # }}}
Index: /issm/trunk/src/m/classes/frictionhydro.py
===================================================================
--- /issm/trunk/src/m/classes/frictionhydro.py	(revision 24312)
+++ /issm/trunk/src/m/classes/frictionhydro.py	(revision 24313)
@@ -7,87 +7,74 @@
 
 class frictionhydro(object):
-	"""
-	FRICTIONWEERTMAN class definition
+    """
+    friction hydro is the friction law from Schoof 2005 or Gagliardini2007
 
-	Usage:
-		friction=frictionhydro();
-	"""
-	def __init__(self): # {{{
-		self.coupling  		  		= 0
-		self.q    				= float('NaN')
-		self.C    				= float('NaN')
-		self.As    				= float('NaN')
-		self.effective_pressure			= float('NaN')
-		#set defaults
-		self.setdefaultparameters()
-	#}}}
+    Usage:
+        friction = frictionhydro()
+    """
+    def __init__(self):  # {{{
+        self.coupling = 0
+        self.q = np.nan
+        self.C = np.nan
+        self.As = np.nan
+        self.effective_pressure = np.nan
+    #set defaults
 
-		#what is this:
-		#function self = frictionhydro(varargin) % {{{
-		#	switch nargin
-		#		case 0
-		#			self=setdefaultparameters(self);
-		#		otherwise
-		#			error('constructor not supported');
-		#	end
-		#end % }}}
-		
-	def checkconsistency(self,md,solution,analyses): #{{{ 
+        self.setdefaultparameters()
+    # }}}
 
-		#Early return
-		if 'StressbalanceAnalysis' in analyses and 'ThermalAnalysis' in analyses:
-			return md
-		
-		md = checkfield(md,'fieldname','friction.coupling','numel',[1],'values',[0,1,2])
-		md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements,1])
-		md = checkfield(md,'fieldname','friction.C','NaN',1,'Inf',1,'size',[md.mesh.numberofelements,1])
-		md = checkfield(md,'fieldname','friction.As','NaN',1,'Inf',1,'size',[md.mesh.numberofelements,1])
-		if self.coupling==1:
-			md = checkfield(md,'fieldname','friction.effective_pressure','NaN',1,'Inf',1,'timeseries',1)
-		elif self.coupling==2:
-			raise ValueError('coupling not supported yet')
-		elif self.coupling > 2:
-			raise ValueError('md.friction.coupling larger than 2, not supported yet')
-	# }}}
+    def __repr__(self):  # {{{
+        string = 'Effective Pressure based friction law described in Gagliardini 2007'
+        string = "%s\n%s" % (string, fielddisplay(self, 'coupling', 'Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: used coupled model (not implemented yet)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'q', 'friction law exponent q >= 1'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'C', 'friction law max value (Iken bound)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'As', 'Sliding Parameter without cavitation [m Pa^ - n s^ - 1]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'effective_pressure', 'Effective Pressure for the forcing if not coupled [Pa]'))
 
-	def extrude(self,md): # {{{
-		self.q=project3d(md,'vector',self.q,'type','element')
-		self.C=project3d(md,'vector',self.C,'type','element')
-		self.As=project3d(md,'vector',self.As,'type','element')
-		if self.coupling==1:
-			self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1)
-		elif self.coupling==2:
-			raise ValueError('coupling not supported yet')
-		elif self.coupling > 2:
-			raise ValueError('md.friction.coupling larger than 2, not supported yet')		
-		return self	
-	 # }}} 
+        return string
+    # }}}
 
+    def extrude(self, md):  # {{{
+        self.q = project3d(md, 'vector', self.q, 'type', 'element')
+        self.C = project3d(md, 'vector', self.C, 'type', 'element')
+        self.As = project3d(md, 'vector', self.As, 'type', 'element')
+        if self.coupling in[3, 4]:
+            self.effective_pressure = project3d(md, 'vector', self.effective_pressure, 'type', 'node', 'layer', 1)
+        elif self.coupling > 4:
+            raise ValueError('md.friction.coupling larger than 4, not supported yet')
+        return self
+    # }}}
 
-	def __repr__(self): # {{{
-		string='Effective Pressure based friction law described in Gagliardini 2007'
-		string="%s\n%s"%(string,fielddisplay(self,'coupling','Coupling flag: 0 for default, 1 for forcing(provide md.friction.effective_pressure)  and 2 for coupled(not implemented yet)'))
-		string="%s\n%s"%(string,fielddisplay(self,'q','friction law exponent q>=1'))
-		string="%s\n%s"%(string,fielddisplay(self,'C','friction law max value [SI]'))
-		string="%s\n%s"%(string,fielddisplay(self,'As','Sliding Parameter without cavitation [m Pa^-n s^-1]'))
-		string="%s\n%s"%(string,fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]'))
+    def setdefaultparameters(self):  # {{{
+        self.coupling = 0
+        self.effective_pressure = np.nan
 
-		return string
-	#}}}
+        return self
+    # }}}
 
+    def checkconsistency(self, md, solution, analyses):  #{{{
+        #Early return
+        if 'StressbalanceAnalysis' in analyses and 'ThermalAnalysis' in analyses:
+            return md
 
-	def marshall(self,prefix,md,fid): #{{{
-		WriteData(fid,prefix,'name','md.friction.law','data',3,'format','Integer')
-		WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer')
-		WriteData(fid,prefix,'class','friction','object',self,'fieldname','q','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'class','friction','object',self,'fieldname','As','format','DoubleMat','mattype',2)
-		if self.coupling==1:
-			WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		elif self.coupling==2:
-			raise ValueError('coupling not supported yet')
-		elif self.coupling > 2:
-			raise ValueError('md.friction.coupling larger than 2, not supported yet')
-	#}}}
+        md = checkfield(md, 'fieldname', 'friction.coupling', 'numel', [1], 'values', [0, 1, 2, 3, 4])
+        md = checkfield(md, 'fieldname', 'friction.q', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
+        md = checkfield(md, 'fieldname', 'friction.C', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
+        md = checkfield(md, 'fieldname', 'friction.As', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
+        if self.coupling == 3:
+            md = checkfield(md, 'fieldname', 'friction.effective_pressure', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+        elif self.coupling > 4:
+            raise ValueError('md.friction.coupling larger than 4, not supported yet')
+    # }}}
 
-
+    def marshall(self, prefix, md, fid):  #{{{
+        WriteData(fid, prefix, 'name', 'md.friction.law', 'data', 3, 'format', 'Integer')
+        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'coupling', 'format', 'Integer')
+        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'q', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'C', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'As', 'format', 'DoubleMat', 'mattype', 2)
+        if self.coupling in[3, 4]:
+            WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'effective_pressure', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        elif self.coupling > 4:
+            raise ValueError('md.friction.coupling larger than 4, not supported yet')
+    #}}}
Index: /issm/trunk/src/m/classes/frictionschoof.m
===================================================================
--- /issm/trunk/src/m/classes/frictionschoof.m	(revision 24313)
+++ /issm/trunk/src/m/classes/frictionschoof.m	(revision 24313)
@@ -0,0 +1,59 @@
+%FRICTIONSCHOOF class definition
+%
+%   Usage:
+%      frictionschoof=frictionschoof();
+
+classdef frictionschoof
+	properties (SetAccess=public) 
+		C    = NaN;
+		Cmax = NaN;
+		m    = NaN;
+	end
+	methods
+		function self = frictionschoof(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				case 1
+					self=structtoobj(frictionschoof(),varargin{1});
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function self = extrude(self,md) % {{{
+			md.friction.C    = project3d(md,'vector',md.friction.C,'type','node','layer',1);
+			md.friction.Cmax = project3d(md,'vector',md.friction.Cmax,'type','node','layer',1);
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			%Early return
+			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
+			md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1,'>',0.);
+			md = checkfield(md,'fieldname','friction.Cmax','timeseries',1,'NaN',1,'Inf',1,'>',0.);
+			md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'>',0.,'size',[md.mesh.numberofelements,1]);
+		end % }}}
+		function disp(self) % {{{
+			%See Brondex et al. 2019 https://www.the-cryosphere.net/13/177/2019/
+			disp('Schoof sliding law parameters:');
+			disp('   Schoof''s sliding law reads:');
+			disp('                         C |u_b|^(m-1)                ');
+			disp('      tau_b = - _____________________________   u_b   ');
+			disp('               (1+(C/(Cmax N))^1/m |u_b| )^m          ');
+			disp(' ');
+			fielddisplay(self,'C','friction coefficient [SI]');
+			fielddisplay(self,'Cmax','Iken''s bound (typically between 0.17 and 0.84) [SI]');
+			fielddisplay(self,'m','m exponent (generally taken as m = 1/n = 1/3)');
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+			yts=md.constants.yts;
+
+			WriteData(fid,prefix,'name','md.friction.law','data',11,'format','Integer');
+			WriteData(fid,prefix,'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'class','friction','object',self,'fieldname','Cmax','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'class','friction','object',self,'fieldname','m','format','DoubleMat','mattype',2);
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/frictionshakti.py
===================================================================
--- /issm/trunk/src/m/classes/frictionshakti.py	(revision 24312)
+++ /issm/trunk/src/m/classes/frictionshakti.py	(revision 24313)
@@ -3,4 +3,5 @@
 from checkfield import checkfield
 from WriteData import WriteData
+
 
 class frictionshakti(object):
@@ -9,39 +10,39 @@
 
     Usage:
-        friction=frictionshakti()
+    friction = frictionshakti()
     """
 
-    def __init__(self,md): # {{{
+    def __init__(self, md):  # {{{
         self.coefficient = md.friction.coefficient
-	#set defaults
-	self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
+    #}}}
 
+    def __repr__(self):  # {{{
+        string = "Basal shear stress parameters: Sigma_b = coefficient^2 * Neff * u_b\n(effective stress Neff = rho_ice * g * thickness + rho_water * g * (head - b))"
+        string = "%s\n%s" % (string, fielddisplay(self, "coefficient", "friction coefficient [SI]"))
+        return string
     #}}}
-    def __repr__(self): # {{{
-	string="Basal shear stress parameters: Sigma_b = coefficient^2 * Neff * u_b\n(effective stress Neff=rho_ice*g*thickness+rho_water*g*(head-b))"
 
-	string="%s\n%s"%(string,fielddisplay(self,"coefficient","friction coefficient [SI]"))
-	return string
+    def extrude(self, md):  # {{{
+        self.coefficient = project3d(md, 'vector', self.coefficient, 'type', 'node', 'layer', 1)
+        return self
     #}}}
-    def extrude(self,md): # {{{
-	self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1)	
-	return self
+
+    def setdefaultparameters(self):  # {{{
+        return self
     #}}}
-    def setdefaultparameters(self): # {{{
-	return self
-    #}}}
-    def checkconsistency(self,md,solution,analyses):    # {{{
 
-	#Early return
-	if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
-	    return md
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
+            return md
 
-	md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1)
-	return md
+        md = checkfield(md, 'fieldname', 'friction.coefficient', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+        return md
+    # }}}
 
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'name', 'md.friction.law', 'data', 8, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'coefficient', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
     # }}}
-    def marshall(self,prefix,md,fid):    # {{{
-	yts=md.constants.yts
-	WriteData(fid,prefix,'name','md.friction.law','data',8,'format','Integer')
-	WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)	
-    # }}}
Index: /issm/trunk/src/m/classes/frictiontemp.m
===================================================================
--- /issm/trunk/src/m/classes/frictiontemp.m	(revision 24312)
+++ /issm/trunk/src/m/classes/frictiontemp.m	(revision 24313)
@@ -10,4 +10,6 @@
 		p           = NaN;
 		q           = NaN;
+		coupling    = 0;
+                effective_pressure = NaN;
 	end
 	methods
@@ -16,4 +18,15 @@
 			self.p=project3d(md,'vector',self.p,'type','element');
 			self.q=project3d(md,'vector',self.q,'type','element');
+			switch self.coupling
+				case 0
+				case 1
+				case 2
+				case 3
+					self.effective_pressure=project3d(md,'vector',self.effective_pressure,'type','node','layer',1);
+				case 4
+					error('not implemented yet');
+				otherwise
+					error('not supported yet');
+			end
 		end % }}}
 		function self = frictiontemp(varargin) % {{{
@@ -31,5 +44,5 @@
 			%By default gamma = 1;
 			self.gamma = 1;
-
+			self.coupling = 0;
 
 		end % }}}
@@ -53,4 +66,6 @@
 			fielddisplay(self,'p','p exponent');
 			fielddisplay(self,'q','q exponent');
+			fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]');
+			fielddisplay(self,'coupling','Coupling flag 0: uniform sheet (negative pressure ok, default), 1: ice pressure only, 2: water pressure assuming uniform sheet (no negative pressure), 3: use provided effective_pressure, 4: used coupled model (not implemented yet)');
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
@@ -61,4 +76,16 @@
 			WriteData(fid,prefix,'class','friction','object',self,'fieldname','p','format','DoubleMat','mattype',2);
 			WriteData(fid,prefix,'class','friction','object',self,'fieldname','q','format','DoubleMat','mattype',2);
+			WriteData(fid,prefix,'class','friction','object',self,'fieldname','coupling','format','Integer');
+			switch self.coupling
+				case 0
+				case 1
+				case 2
+				case 3
+					WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+				case 4
+					error('not implemented yet');
+				otherwise
+					error('not supported yet');
+			end
 		end % }}}
 	end
Index: /issm/trunk/src/m/classes/frictiontsai.m
===================================================================
--- /issm/trunk/src/m/classes/frictiontsai.m	(revision 24313)
+++ /issm/trunk/src/m/classes/frictiontsai.m	(revision 24313)
@@ -0,0 +1,59 @@
+%FRICTIONTSAI class definition
+%
+%   Usage:
+%      frictiontsai=frictiontsai();
+
+classdef frictiontsai
+	properties (SetAccess=public) 
+		C = NaN;
+		f = NaN;
+		m = NaN;
+	end
+	methods
+		function self = frictiontsai(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				case 1
+					self=structtoobj(frictiontsai(),varargin{1});
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function self = extrude(self,md) % {{{
+			md.friction.C    = project3d(md,'vector',md.friction.C,'type','node','layer',1);
+			md.friction.f = project3d(md,'vector',md.friction.f,'type','node','layer',1);
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			%Early return
+			if ~ismember('StressbalanceAnalysis',analyses) & ~ismember('ThermalAnalysis',analyses), return; end
+			md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1,'>',0.);
+			md = checkfield(md,'fieldname','friction.f','timeseries',1,'NaN',1,'Inf',1,'>',0.);
+			md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'>',0.,'size',[md.mesh.numberofelements,1]);
+		end % }}}
+		function disp(self) % {{{
+			%See Brondex et al. 2017 
+			disp('Tsai sliding law parameters:');
+			disp('   Tsai''s sliding law reads:');
+			disp('     ');
+			disp('      tau_b = -  min(C |ub|^(m-1) , f N) u_b   ');
+			disp('                                                   ');
+			disp(' ');
+			fielddisplay(self,'C','friction coefficient [SI]');
+			fielddisplay(self,'f','Iken''s bound (typically between 0.17 and 0.84) [SI]');
+			fielddisplay(self,'m','m exponent (generally taken as m = 1/n = 1/3)');
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+			yts=md.constants.yts;
+
+			WriteData(fid,prefix,'name','md.friction.law','data',12,'format','Integer');
+			WriteData(fid,prefix,'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'class','friction','object',self,'fieldname','f','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'class','friction','object',self,'fieldname','m','format','DoubleMat','mattype',2);
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/frictionwaterlayer.py
===================================================================
--- /issm/trunk/src/m/classes/frictionwaterlayer.py	(revision 24312)
+++ /issm/trunk/src/m/classes/frictionwaterlayer.py	(revision 24313)
@@ -1,3 +1,2 @@
-import numpy as np
 from project3d import project3d
 from fielddisplay import fielddisplay
@@ -7,61 +6,56 @@
 
 class frictionwaterlayer(object):
-	"""
-	frictionwaterlayer class definition
+    """
+    frictionwaterlayer class definition
 
-	Usage:
-		friction=frictionwaterlayer(md);
-	"""
-	def __init__(self,md): # {{{
-		self.coefficient  		  	= md.friction.coefficient
-		self.f    				= float('NaN')
-		self.p    				= md.friction.p
-		self.q    				= md.friction.q
-		self.water_layer    			= float('NaN')
-	#}}}
-		
-	def checkconsistency(self,md,solution,analyses): #{{{ 
-		#Early return
-		if ('StressbalanceAnalysis' not in analyses) and ('ThermalAnalysis' not in analyses):
-			return
+    Usage:
+        friction = frictionwaterlayer(md)
+    """
+    def __init__(self, md):  # {{{
+        self.coefficient = md.friction.coefficient
+        self.f = float('NaN')
+        self.p = md.friction.p
+        self.q = md.friction.q
+        self.water_layer = float('NaN')
+    #}}}
 
-		md = checkfield(md,'fieldname','friction.coefficient','timeseries',1,'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','friction.f','size',[1,1],'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','friction.q','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
-		md = checkfield(md,'fieldname','friction.p','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
-		md = checkfield(md,'fieldname','thermal.spctemperature','Inf',1,'timeseries',1,'>=',0.)
-	# }}}
+    def checkconsistency(self, md, solution, analyses):  #{{{
+        #Early return
+        if ('StressbalanceAnalysis' not in analyses) and ('ThermalAnalysis' not in analyses):
+            return
 
-	def extrude(self,md): # {{{
-		self.coefficient=project3d(md,'vector',self.coefficient,'type','node','layer',1)
-		self.p=project3d(md,'vector',self.p,'type','element')
-		self.q=project3d(md,'vector',self.q,'type','element')
-		self.water_layer=project3d(md,'vector',self.water_layer,'type','node','layer',1)
-		return self	
-	 # }}} 
+        md = checkfield(md, 'fieldname', 'friction.coefficient', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'friction.f', 'size', [1], 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'friction.q', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
+        md = checkfield(md, 'fieldname', 'friction.p', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
+        md = checkfield(md, 'fieldname', 'thermal.spctemperature', 'Inf', 1, 'timeseries', 1, '>=', 0.)
+    # }}}
 
+    def extrude(self, md):  # {{{
+        self.coefficient = project3d(md, 'vector', self.coefficient, 'type', 'node', 'layer', 1)
+        self.p = project3d(md, 'vector', self.p, 'type', 'element')
+        self.q = project3d(md, 'vector', self.q, 'type', 'element')
+        self.water_layer = project3d(md, 'vector', self.water_layer, 'type', 'node', 'layer', 1)
+        return self
+    # }}}
 
-	def __repr__(self): # {{{
-		string='Basal shear stress parameters: tau_b = coefficient^2 * Neff ^r * |u_b|^(s-1) * u_b * 1/f(T)\n(effective stress Neff=rho_ice*g*thickness+rho_water*g*(bed+water_layer), r=q/p and s=1/p)'
-		string="%s\n%s"%(string,fielddisplay(self,'coefficient','frictiontemp coefficient [SI]'))
-		string="%s\n%s"%(string,fielddisplay(self,'f','f variable for effective pressure'))
-		string="%s\n%s"%(string,fielddisplay(self,'p','p exponent'))
-		string="%s\n%s"%(string,fielddisplay(self,'q','q exponent'))
-		string="%s\n%s"%(string,fielddisplay(self,'water_layer','water thickness at the base of the ice (m)'))
+    def __repr__(self):  # {{{
+        string = 'Basal shear stress parameters: tau_b = coefficient^2 * Neff ^r * |u_b|^(s - 1) * u_b * 1 / f(T)\n(effective stress Neff = rho_ice * g * thickness + rho_water * g * (bed + water_layer), r = q / p and s = 1 / p)'
+        string = "%s\n%s" % (string, fielddisplay(self, 'coefficient', 'frictiontemp coefficient [SI]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'f', 'f variable for effective pressure'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'p', 'p exponent'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'q', 'q exponent'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'water_layer', 'water thickness at the base of the ice (m)'))
 
-		return string
-	#}}}
+        return string
+    #}}}
 
-
-	def marshall(self,prefix,md,fid): #{{{
-		yts=md.constants.yts
-		
-		WriteData(fid,prefix,'name','md.friction.law','data',5,'format','Integer')
-		WriteData(fid,prefix,'class','friction','object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'class','friction','object',self,'fieldname','f','format','Double')
-		WriteData(fid,prefix,'class','friction','object',self,'fieldname','p','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'class','friction','object',self,'fieldname','q','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'class','friction','object',self,'fieldname','water_layer','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-	#}}}
-
-
+    def marshall(self, prefix, md, fid):  #{{{
+        yts = md.constants.yts
+        WriteData(fid, prefix, 'name', 'md.friction.law', 'data', 5, 'format', 'Integer')
+        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'coefficient', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'f', 'format', 'Double')
+        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'p', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'q', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'water_layer', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+    #}}}
Index: /issm/trunk/src/m/classes/frictionweertman.py
===================================================================
--- /issm/trunk/src/m/classes/frictionweertman.py	(revision 24312)
+++ /issm/trunk/src/m/classes/frictionweertman.py	(revision 24313)
@@ -1,47 +1,51 @@
 from fielddisplay import fielddisplay
-from project3d import project3d
 from checkfield import checkfield
 from WriteData import WriteData
 
+
 class frictionweertman(object):
-	"""
-	FRICTIONWEERTMAN class definition
+    """
+    FRICTIONWEERTMAN class definition
 
-	   Usage:
-	      frictionweertman=frictionweertman();
-	"""
+       Usage:
+          frictionweertman = frictionweertman()
+    """
 
-	def __init__(self): # {{{
-		self.C = float('NaN')
-		self.m = float('NaN')
+    def __init__(self):  # {{{
+        self.C = float('NaN')
+        self.m = float('NaN')
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		string="Weertman sliding law parameters: Sigma_b = C^(-1/m) * |u_b|^(1/m-1) * u_b"
+    #}}}
 
-		string="%s\n%s"%(string,fielddisplay(self,"C","friction coefficient [SI]"))
-		string="%s\n%s"%(string,fielddisplay(self,"m","m exponent"))
-		return string
-		#}}}
-	def setdefaultparameters(self): # {{{
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+    def __repr__(self):  # {{{
+        string = "Weertman sliding law parameters: Sigma_b = C^(-1 / m) * |u_b|^(1 / m - 1) * u_b"
 
-		#Early return
-		if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
-			return md
+        string = "%s\n%s" % (string, fielddisplay(self, "C", "friction coefficient [SI]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "m", "m exponent"))
+        return string
+    #}}}
 
-		md = checkfield(md,'fieldname','friction.C','timeseries',1,'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','friction.m','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
+    def setdefaultparameters(self):  # {{{
+        return self
+    #}}}
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'name','md.friction.law','data',2,'format','Integer')
-		WriteData(fid,prefix,'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'class','friction','object',self,'fieldname','m','format','DoubleMat','mattype',2)
-	# }}}
+    def checkconsistency(self, md, solution, analyses):  # {{{
+
+        #Early return
+        if 'StressbalanceAnalysis' not in analyses and 'ThermalAnalysis' not in analyses:
+            return md
+
+        md = checkfield(md, 'fieldname', 'friction.C', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'friction.m', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'name', 'md.friction.law', 'data', 2, 'format', 'Integer')
+        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'C', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'class', 'friction', 'object', self, 'fieldname', 'm', 'format', 'DoubleMat', 'mattype', 2)
+    # }}}
Index: /issm/trunk/src/m/classes/frontalforcings.m
===================================================================
--- /issm/trunk/src/m/classes/frontalforcings.m	(revision 24313)
+++ /issm/trunk/src/m/classes/frontalforcings.m	(revision 24313)
@@ -0,0 +1,53 @@
+%FRONTAL FORCINGS class definition
+%
+%   Usage:
+%      frontalforcings=frontalforcings();
+
+classdef frontalforcings
+	properties (SetAccess=public) 
+		meltingrate   = NaN;
+	end
+	methods
+		function self = frontalforcings(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				case 1
+					inputstruct=varargin{1};
+					list1 = properties('frontalforcings');
+					list2 = fieldnames(inputstruct);
+					for i=1:length(list1)
+						fieldname = list1{i};
+						if ismember(fieldname,list2),
+							self.(fieldname) = inputstruct.(fieldname);
+						end
+					end
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function self = extrude(self,md) % {{{
+			self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node');
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+
+			meltingrate   = NaN;
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+			%Early return
+			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
+
+			md = checkfield(md,'fieldname','frontalforcings.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0);
+
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   Frontalforcings parameters:'));
+			fielddisplay(self,'meltingrate','melting rate at given location [m/a]');
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+			yts=md.constants.yts;
+			WriteData(fid,prefix,'name','md.frontalforcings.parameterization','data',1,'format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/frontalforcings.py
===================================================================
--- /issm/trunk/src/m/classes/frontalforcings.py	(revision 24313)
+++ /issm/trunk/src/m/classes/frontalforcings.py	(revision 24313)
@@ -0,0 +1,51 @@
+from fielddisplay import fielddisplay
+from project3d import project3d
+from checkfield import checkfield
+from WriteData import WriteData
+
+
+class frontalforcings(object):
+    """
+    FRONTAL FORCINGS class definition
+
+       Usage:
+          frontalforcings = frontalforcings()
+    """
+
+    def __init__(self):  # {{{
+        self.meltingrate = float('NaN')
+
+    #set defaults
+        self.setdefaultparameters()
+    #}}}
+
+    def __repr__(self):  # {{{
+        string = '   Frontalforcings parameters:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'meltingrate', 'melting rate at given location [m / a]'))
+
+        return string
+    #}}}
+
+    def extrude(self, md):  # {{{
+        self.meltingrate = project3d(md, 'vector', self.meltingrate, 'type', 'node')
+        return self
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if (solution != 'TransientSolution') or (not md.transient.ismovingfront):
+            return md
+
+        md = checkfield(md, 'fieldname', 'frontalforcings.meltingrate', 'NaN', 1, 'Inf', 1, 'timeseries', 1, '>=', 0)
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
+        WriteData(fid, prefix, 'name', 'md.frontalforcings.parameterization', 'data', 1, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'meltingrate', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts, 'scale', 1. / yts)
+    # }}}
Index: /issm/trunk/src/m/classes/frontalforcingsrignot.m
===================================================================
--- /issm/trunk/src/m/classes/frontalforcingsrignot.m	(revision 24313)
+++ /issm/trunk/src/m/classes/frontalforcingsrignot.m	(revision 24313)
@@ -0,0 +1,67 @@
+%FRONTAL FORCINGS rignot class definition
+%
+%   Usage:
+%      frontalforcingsrignot=frontalforcingsrignot();
+
+classdef frontalforcingsrignot
+	properties (SetAccess=public) 
+		basin= NaN;
+		numberofbasins=0;
+		subglacial_discharge= NaN;
+		thermalforcing=NaN;
+	end
+	methods
+		function self = frontalforcingsrignot(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				case 1
+					inputstruct=varargin{1};
+					list1 = properties('frontalforcingsrignot');
+					list2 = fieldnames(inputstruct);
+					for i=1:length(list1)
+						fieldname = list1{i};
+						if ismember(fieldname,list2),
+							self.(fieldname) = inputstruct.(fieldname);
+						end
+					end
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function self = extrude(self,md) % {{{
+		    % nothing for now
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+
+			basin=NaN;
+			numberofbasins=0;
+			subglacial_discharge=NaN;
+			thermalforcing=NaN;
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+			%Early return
+			if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
+
+			md = checkfield(md,'fieldname','frontalforcings.basin','>',0,'nan',1,'Inf',1);
+			md = checkfield(md,'fieldname','frontalforcings.numberofbasins','numel',[1]);
+			md = checkfield(md,'fieldname','frontalforcings.subglacial_discharge','>=',0,'nan',1,'Inf',1,'timeseries',1);
+			md = checkfield(md,'fieldname','frontalforcings.thermalforcing','nan',1,'Inf',1,'timeseries',1);
+
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   Frontalforcings parameters:'));
+			fielddisplay(self,'basin','basin ID for vertices');
+			fielddisplay(self,'numberofbasins', 'number of basins');
+			fielddisplay(self,'subglacial_discharge','sum of subglacial discharge for each basin [m/d]');
+			fielddisplay(self,'thermalforcing','thermal forcing [∘C]');
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+			WriteData(fid,prefix,'name','md.frontalforcings.parameterization','data',2,'format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','basin','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',self,'fieldname','numberofbasins','format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','subglacial_discharge','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'fieldname','thermalforcing','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/frontalforcingsrignot.py
===================================================================
--- /issm/trunk/src/m/classes/frontalforcingsrignot.py	(revision 24313)
+++ /issm/trunk/src/m/classes/frontalforcingsrignot.py	(revision 24313)
@@ -0,0 +1,63 @@
+from checkfield import checkfield
+from WriteData import WriteData
+from fielddisplay import fielddisplay
+
+
+class frontalforcingsrignot(object):
+    """
+    FRONTAL FORCINGS Rignot class definition
+
+       Usage:
+          frontalforcingsrignot = frontalforcingsrignot()
+    """
+
+    def __init__(self):  # {{{
+        self.basin = float('NaN')
+        self.numberofbasins = 0.
+        self.subglacial_discharge = float('NaN')
+        self.thermalforcing = float('NaN')
+
+    #set defaults
+        self.setdefaultparameters()
+
+    #}}}
+
+    def __repr__(self):  # {{{
+        string = '   Frontalforcings parameters:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'basin', 'basin ID for vertices'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'numberofbasins', 'number of basins'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'subglacial_discharge', 'sum of subglacial discharge for each basin [m / d]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'thermalforcing', 'thermal forcing [C]'))
+
+        return string
+    #}}}
+
+    def extrude(self, md):  # {{{
+        return self
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if (solution != 'TransientSolution') or (not md.transient.ismovingfront):
+            return md
+
+        md = checkfield(md, 'fieldname', 'frontalforcings.basin', '>', 0, 'nan', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'frontalforcings.numberofbasins', 'numel', [1])
+        md = checkfield(md, 'fieldname', 'frontalforcings.subglacial_discharge', '>=', 0, 'nan', 1, 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'frontalforcings.thermalforcing', 'nan', 1, 'Inf', 1, 'timeseries', 1)
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'name', 'md.frontalforcings.parameterization', 'data', 2, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'basin', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'numberofbasins', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'subglacial_discharge', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'thermalforcing', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1)
+
+    # }}}
Index: /issm/trunk/src/m/classes/geometry.js
===================================================================
--- /issm/trunk/src/m/classes/geometry.js	(revision 24312)
+++ /issm/trunk/src/m/classes/geometry.js	(revision 24313)
@@ -30,5 +30,5 @@
 
 			if ((solution=='TransientSolution' & md.trans.isgia) | (solution=='GiaSolution')){
-				checkfield(md,'fieldname','geometry.thickness','timeseries',1,'NaN',1,'Inf',1,'>=',0);
+				checkfield(md,'fieldname','geometry.thickness','timeseries',1,'NaN',1,'Inf',1);
 			}
 			else{
Index: /issm/trunk/src/m/classes/geometry.m
===================================================================
--- /issm/trunk/src/m/classes/geometry.m	(revision 24312)
+++ /issm/trunk/src/m/classes/geometry.m	(revision 24313)
@@ -54,5 +54,5 @@
 
 			if (strcmp(solution,'TransientSolution') & md.transient.isgia) | strcmp(solution,'GiaSolution'),
-				md = checkfield(md,'fieldname','geometry.thickness','timeseries',1,'NaN',1,'Inf',1,'>=',0);
+				md = checkfield(md,'fieldname','geometry.thickness','timeseries',1,'NaN',1,'Inf',1);
 			elseif strcmpi(solution,'LoveSolution')
 				return; 
@@ -65,4 +65,12 @@
 				end 
 				if strcmp(solution,'TransientSolution') & md.transient.isgroundingline,
+					md = checkfield(md,'fieldname','geometry.bed','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+					if any(self.bed-self.base>10^-12),
+						md = checkmessage(md,['base<bed on one or more vertex']);
+					end 
+					pos = find(md.mask.groundedice_levelset>0);
+					if any(abs(self.bed(pos)-self.base(pos))>10^-9),
+						md = checkmessage(md,['equality base=bed on grounded ice violated']);
+					end 
 					md = checkfield(md,'fieldname','geometry.bed','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
 				end
Index: /issm/trunk/src/m/classes/geometry.py
===================================================================
--- /issm/trunk/src/m/classes/geometry.py	(revision 24312)
+++ /issm/trunk/src/m/classes/geometry.py	(revision 24313)
@@ -1,2 +1,3 @@
+import numpy as np
 from project3d import project3d
 from fielddisplay import fielddisplay
@@ -4,65 +5,76 @@
 from WriteData import WriteData
 
+
 class geometry(object):
-	"""
-	GEOMETRY class definition
+    """
+    GEOMETRY class definition
 
-	   Usage:
-	      geometry=geometry();
-	"""
+       Usage:
+          geometry = geometry()
+    """
 
-	def __init__(self): # {{{
-		self.surface		= float('NaN')
-		self.thickness		= float('NaN')
-		self.base               = float('NaN')
-		self.bed		= float('NaN')
-		self.hydrostatic_ratio	= float('NaN')
+    def __init__(self):  # {{{
+        self.surface = float('NaN')
+        self.thickness = float('NaN')
+        self.base = float('NaN')
+        self.bed = float('NaN')
+        self.hydrostatic_ratio = float('NaN')
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
+    #}}}
 
-		string="   geometry parameters:"
-		string="%s\n%s"%(string,fielddisplay(self,'surface','ice upper surface elevation [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'thickness','ice thickness [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'base','ice base elevation [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'bed','bed elevation [m]'))
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		self.surface=project3d(md,'vector',self.surface,'type','node')
-		self.thickness=project3d(md,'vector',self.thickness,'type','node')
-		self.hydrostatic_ratio=project3d(md,'vector',self.hydrostatic_ratio,'type','node')
-		self.base=project3d(md,'vector',self.base,'type','node')
-		self.bed=project3d(md,'vector',self.bed,'type','node')
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+    def __repr__(self):  # {{{
 
-		if (solution=='TransientSolution' and md.transient.isgia) or (solution=='GiaSolution'):
-			md = checkfield(md,'fieldname','geometry.thickness','NaN',1,'Inf',1,'>=',0,'timeseries',1)
-		elif solution=='LoveSolution':
-			return
-		else:
-			md = checkfield(md,'fieldname','geometry.surface'  ,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-			md = checkfield(md,'fieldname','geometry.base'      ,'NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-			md = checkfield(md,'fieldname','geometry.thickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices],'>',0,'timeseries',1)
-			if any(abs(self.thickness-self.surface+self.base)>10**-9):
-				md.checkmessage("equality thickness=surface-base violated")
-			if solution=='TransientSolution' and md.transient.isgroundingline:
-				md = checkfield(md,'fieldname','geometry.bed','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
+        string = "   geometry parameters:"
+        string = "%s\n%s" % (string, fielddisplay(self, 'surface', 'ice upper surface elevation [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'thickness', 'ice thickness [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'base', 'ice base elevation [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'bed', 'bed elevation [m]'))
+        return string
+    #}}}
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'object',self,'fieldname','surface','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'fieldname','base','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','bed','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1)
-	# }}}
+    def extrude(self, md):  # {{{
+        self.surface = project3d(md, 'vector', self.surface, 'type', 'node')
+        self.thickness = project3d(md, 'vector', self.thickness, 'type', 'node')
+        self.hydrostatic_ratio = project3d(md, 'vector', self.hydrostatic_ratio, 'type', 'node')
+        self.base = project3d(md, 'vector', self.base, 'type', 'node')
+        self.bed = project3d(md, 'vector', self.bed, 'type', 'node')
+        return self
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if (solution == 'TransientSolution' and md.transient.isgia) or (solution == 'GiaSolution'):
+            md = checkfield(md, 'fieldname', 'geometry.thickness', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+        elif solution == 'LoveSolution':
+            return
+        else:
+            md = checkfield(md, 'fieldname', 'geometry.surface', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'geometry.base', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'geometry.thickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices], '>', 0, 'timeseries', 1)
+            if any(abs(self.thickness - self.surface + self.base) > 10**-9):
+                md.checkmessage("equality thickness = surface-base violated")
+            if solution == 'TransientSolution' and md.transient.isgroundingline:
+                md = checkfield(md, 'fieldname', 'geometry.bed', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+                if np.any(self.bed - self.base > 10**-12):
+                    md.checkmessage('base < bed on one or more vertex')
+                pos = np.where(md.mask.groundedice_levelset > 0)
+                if np.any(np.abs(self.bed[pos] - self.base[pos]) > 10**-9):
+                    md.checkmessage('equality base = bed on grounded ice violated')
+                md = checkfield(md, 'fieldname', 'geometry.bed', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'surface', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'base', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'bed', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'hydrostatic_ratio', 'format', 'DoubleMat', 'mattype', 1)
+    # }}}
Index: /issm/trunk/src/m/classes/giaivins.py
===================================================================
--- /issm/trunk/src/m/classes/giaivins.py	(revision 24312)
+++ /issm/trunk/src/m/classes/giaivins.py	(revision 24313)
@@ -4,60 +4,62 @@
 from WriteData import WriteData
 
+
 class giaivins(object):
-	"""
-	GIA class definition
+    """
+    GIA class definition
 
-	   Usage:
-	      giaivins=giaivins();
-	"""
+       Usage:
+          giaivins = giaivins()
+    """
 
-	def __init__(self): # {{{
-		self.mantle_viscosity              = float('NaN');
-		self.lithosphere_thickness         = float('NaN');
-		self.cross_section_shape           = 0;
-	
-		#set defaults
-		self.setdefaultparameters()
+    def __init__(self):  # {{{
+        self.mantle_viscosity = float('NaN')
+        self.lithosphere_thickness = float('NaN')
+        self.cross_section_shape = 0
 
-		#}}}
-	def __repr__(self): # {{{
-		
-		string='   giaivins solution parameters:' 
-		
-		string="%s\n%s"%(string,fielddisplay(self,'mantle_viscosity','mantle viscosity constraints (NaN means no constraint) (Pa s)'))
-		string="%s\n%s"%(string,fielddisplay(self,'lithosphere_thickness','lithosphere thickness constraints (NaN means no constraint) (m)'))
-		string="%s\n%s"%(string,fielddisplay(self,'cross_section_shape',"1: square-edged, 2: elliptical-edged surface"))
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		self.mantle_viscosity=project3d(md,'vector',self.mantle_viscosity,'type','node')
-		self.lithosphere_thickness=project3d(md,'vector',self.lithosphere_thickness,'type','node')
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
+    #set defaults
+        self.setdefaultparameters()
 
-		self.cross_section_shape=1; 
+    #}}}
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+    def __repr__(self):  # {{{
+        string = '   giaivins solution parameters:'
 
-		# Early return 
-		if ('GiaAnalysis' not in  analyses):
-			return md 
-		
-		md = checkfield(md,'fieldname','gia.mantle_viscosity','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices],'>',0)
-		md = checkfield(md,'fieldname','gia.lithosphere_thickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices],'>',0)
-		md = checkfield(md,'fieldname','gia.cross_section_shape','numel',[1],'values',[1,2])
+        string = "%s\n%s" % (string, fielddisplay(self, 'mantle_viscosity', 'mantle viscosity constraints (NaN means no constraint) (Pa s)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'lithosphere_thickness', 'lithosphere thickness constraints (NaN means no constraint) (m)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'cross_section_shape', "1: square-edged, 2: elliptical - edged surface"))
+        return string
+    #}}}
 
-		#be sure that if we are running a masstransport ice flow model coupled with giaivins, that thickness forcings 
-		#are not provided into the future.
+    def extrude(self, md):  # {{{
+        self.mantle_viscosity = project3d(md, 'vector', self.mantle_viscosity, 'type', 'node')
+        self.lithosphere_thickness = project3d(md, 'vector', self.lithosphere_thickness, 'type', 'node')
+        return self
+    #}}}
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+    def setdefaultparameters(self):  # {{{
+        self.cross_section_shape = 1
+        return self
+    #}}}
 
-		WriteData(fid,prefix,'object',self,'fieldname','mantle_viscosity','format','DoubleMat','mattype',1);
-		WriteData(fid,prefix,'object',self,'fieldname','lithosphere_thickness','format','DoubleMat','mattype',1,'scale',10.**3.);
-		WriteData(fid,prefix,'object',self,'fieldname','cross_section_shape','format','Integer');
-	# }}}
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        # Early return
+        if ('GiaAnalysis' not in analyses):
+            return md
+
+        md = checkfield(md, 'fieldname', 'gia.mantle_viscosity', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices], '>', 0)
+        md = checkfield(md, 'fieldname', 'gia.lithosphere_thickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices], '>', 0)
+        md = checkfield(md, 'fieldname', 'gia.cross_section_shape', 'numel', [1], 'values', [1, 2])
+
+        #be sure that if we are running a masstransport ice flow model coupled with giaivins, that thickness forcings
+        #are not provided into the future.
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'mantle_viscosity', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'lithosphere_thickness', 'format', 'DoubleMat', 'mattype', 1, 'scale', 10.**3.)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'cross_section_shape', 'format', 'Integer')
+    # }}}
Index: /issm/trunk/src/m/classes/groundingline.py
===================================================================
--- /issm/trunk/src/m/classes/groundingline.py	(revision 24312)
+++ /issm/trunk/src/m/classes/groundingline.py	(revision 24313)
@@ -5,58 +5,63 @@
 import MatlabFuncs as m
 
+
 class groundingline(object):
-	"""
-	GROUNDINGLINE class definition
+    """
+    GROUNDINGLINE class definition
 
-	   Usage:
-	      groundingline=groundingline();
-	"""
+       Usage:
+          groundingline = groundingline()
+    """
 
-	def __init__(self): # {{{
-		self.migration=''
-		self.friction_interpolation=''
-		self.melt_interpolation=''
+    def __init__(self):  # {{{
+        self.migration = ''
+        self.friction_interpolation = ''
+        self.melt_interpolation = ''
 
-		#set defaults
-		self.setdefaultparameters()
+    #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
-		#}}}	
-	def setdefaultparameters(self): # {{{
+    def __repr__(self):  # {{{
+        string = '   grounding line migration parameters:'
 
-		#Type of migration
-		self.migration='SubelementMigration'
-		self.friction_interpolation='SubelementFriction1'
-		self.melt_interpolation='NoMeltOnPartiallyFloating'
+        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
+    #}}}
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+    def setdefaultparameters(self):  # {{{
 
-		md = checkfield(md,'fieldname','groundingline.migration','values',['None','SubelementMigration','AggressiveMigration','SoftMigration','Contact','GroundingOnly'])
-		md = checkfield(md,'fieldname','groundingline.friction_interpolation','values',['SubelementFriction1','SubelementFriction2','NoFrictionOnPartiallyFloating'])
-		md = checkfield(md,'fieldname','groundingline.melt_interpolation','values',['SubelementMelt1','SubelementMelt2','NoMeltOnPartiallyFloating','FullMeltOnPartiallyFloating'])
+        #Type of migration
+        self.migration = 'SubelementMigration'
+        self.friction_interpolation = 'SubelementFriction1'
+        self.melt_interpolation = 'NoMeltOnPartiallyFloating'
 
-		if(not m.strcmp(self.migration,'None') and md.transient.isgroundingline and solution=='TransientSolution'):
-			if np.any(np.isnan(md.geometry.bed)):
-				md.checkmessage("requesting grounding line migration, but bathymetry is absent!")
-			pos=np.nonzero(md.mask.groundedice_levelset>0.)[0]
-			if any(np.abs(md.geometry.base[pos]-md.geometry.bed[pos])>10**-10):
-				md.checkmessage("base not equal to bed on grounded ice!")
-			if any(md.geometry.bed - md.geometry.base > 10**-9):
-				md.checkmessage("bed superior to base on floating ice!")
+        return self
+    #}}}
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'data',self.migration,'name','md.groundingline.migration','format','String')
-		WriteData(fid,prefix,'data',self.friction_interpolation,'name','md.groundingline.friction_interpolation','format','String')
-		WriteData(fid,prefix,'data',self.melt_interpolation,'name','md.groundingline.melt_interpolation','format','String')
-	# }}}
+    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'])
+        md = checkfield(md, 'fieldname', 'groundingline.melt_interpolation', 'values', ['SubelementMelt1', 'SubelementMelt2', 'NoMeltOnPartiallyFloating', 'FullMeltOnPartiallyFloating'])
+
+        if(not m.strcmp(self.migration, 'None') and md.transient.isgroundingline and solution == 'TransientSolution'):
+            if np.any(np.isnan(md.geometry.bed)):
+                md.checkmessage("requesting grounding line migration, but bathymetry is absent!")
+            pos = np.nonzero(md.mask.groundedice_levelset > 0.)[0]
+            if any(np.abs(md.geometry.base[pos] - md.geometry.bed[pos]) > 10**-10):
+                md.checkmessage("base not equal to bed on grounded ice!")
+            if any(md.geometry.bed - md.geometry.base > 10**-9):
+                md.checkmessage("bed superior to base on floating ice!")
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'data', self.migration, 'name', 'md.groundingline.migration', 'format', 'String')
+        WriteData(fid, prefix, 'data', self.friction_interpolation, 'name', 'md.groundingline.friction_interpolation', 'format', 'String')
+        WriteData(fid, prefix, 'data', self.melt_interpolation, 'name', 'md.groundingline.melt_interpolation', 'format', 'String')
+    # }}}
Index: /issm/trunk/src/m/classes/hydrologydc.m
===================================================================
--- /issm/trunk/src/m/classes/hydrologydc.m	(revision 24312)
+++ /issm/trunk/src/m/classes/hydrologydc.m	(revision 24313)
@@ -64,12 +64,12 @@
 		% }}}
     function list = defaultoutputs(self,md) % {{{
-        list = {'SedimentHeadHydrostep','SedimentHeadResidual','EffectivePressureHydrostep'};
+        list = {'SedimentHead','SedimentHeadResidual','EffectivePressure'};
         if self.isefficientlayer,
-            list=[list,{'EplHeadHydrostep','HydrologydcMaskEplactiveNode','HydrologydcMaskEplactiveElt','EplHeadSlopeX','EplHeadSlopeY','HydrologydcEplThicknessHydrostep'}];
+            list=[list,{'EplHead','HydrologydcMaskEplactiveNode','HydrologydcMaskEplactiveElt','EplHeadSlopeX','EplHeadSlopeY','HydrologydcEplThickness'}];
         end
         if self.steps_per_step>1,
-            list = [list,'EffectivePressure','SedimentHead'];
+            list = [list,'EffectivePressureSubstep','SedimentHeadSubstep'];
             if self.isefficientlayer,
-                list = [list,'EplHead','HydrologydcEplThickness'];
+                list = [list,'EplHeadSubstep','HydrologydcEplThicknessSubstep'];
             end
         end
@@ -98,7 +98,7 @@
 			self.sedimentlimit_flag       = 0;
 			self.sedimentlimit            = 0;
-			self.transfer_flag            = 0;
+			self.transfer_flag            = 1;
 			self.unconfined_flag          = 0;
-			self.leakage_factor           = 10.0;
+			self.leakage_factor           = 1.0e-10;
       self.requested_outputs        = {'default'};
 
Index: /issm/trunk/src/m/classes/hydrologydc.py
===================================================================
--- /issm/trunk/src/m/classes/hydrologydc.py	(revision 24312)
+++ /issm/trunk/src/m/classes/hydrologydc.py	(revision 24313)
@@ -5,254 +5,257 @@
 from WriteData import WriteData
 
+
 class hydrologydc(object):
-	"""
-	Hydrologydc class definition
-
-	Usage:
-		hydrologydc=hydrologydc();
-	"""
-
-	def __init__(self): # {{{
-		self.water_compressibility    = 0
-		self.isefficientlayer         = 0
-		self.penalty_factor           = 0
-		self.penalty_lock             = 0
-		self.rel_tol                  = 0
-		self.max_iter                 = 0
-		self.steps_per_step           = 0
-		self.sedimentlimit_flag       = 0
-		self.sedimentlimit            = 0
-		self.transfer_flag            = 0
-		self.unconfined_flag          = 0
-		self.leakage_factor           = 0
-		self.basal_moulin_input       = np.nan
-		self.requested_outputs        = []
-
-		self.spcsediment_head         = np.nan
-		self.mask_thawed_node         = np.nan
-		self.sediment_transmitivity   = np.nan
-		self.sediment_compressibility = 0
-		self.sediment_porosity        = 0
-		self.sediment_thickness       = 0
-
-		self.spcepl_head              = np.nan
-		self.mask_eplactive_node      = np.nan
-		self.epl_compressibility      = 0
-		self.epl_porosity             = 0
-		self.epl_initial_thickness    = 0
-		self.epl_colapse_thickness    = 0
-		self.epl_thick_comp           = 0
-		self.epl_max_thickness        = 0
-		self.epl_conductivity         = 0
-		self.eplflip_lock             = 0
-
-		#set defaults
-		self.setdefaultparameters()
-	#}}}
-	def __repr__(self): # {{{
-		string='   hydrology Dual Porous Continuum Equivalent parameters:'
-		string='   - general parameters'
-		string="%s\n%s"%(string,fielddisplay(self,'water_compressibility','compressibility of water [Pa^-1]'))
-		string="%s\n%s"%(string,fielddisplay(self,'isefficientlayer','do we use an efficient drainage system [1: true 0: false]'))
-		string="%s\n%s"%(string,fielddisplay(self,'penalty_factor','exponent of the value used in the penalisation method [dimensionless]'))
-		string="%s\n%s"%(string,fielddisplay(self,'penalty_lock','stabilize unstable constraints that keep zigzagging after n iteration (default is 0, no stabilization)'))
-		string="%s\n%s"%(string,fielddisplay(self,'rel_tol','tolerance of the nonlinear iteration for the transfer between layers [dimensionless]'))
-		string="%s\n%s"%(string,fielddisplay(self,'max_iter','maximum number of nonlinear iteration'))
-		string="%s\n%s"%(string,fielddisplay(self,'steps_per_step','number of hydrology steps per time step'))
-		string="%s\n%s"%(string,fielddisplay(self,'basal_moulin_input','water flux at a given point [m3 s-1]'))
-		string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested'))
-		string="%s\n%s"%(string,fielddisplay(self,'sedimentlimit_flag','what kind of upper limit is applied for the inefficient layer'))
-		string="%s\n\t\t%s"%(string,'0: no limit')
-		string="%s\n\t\t%s"%(string,'1: user defined sedimentlimit')
-		string="%s\n\t\t%s"%(string,'2: hydrostatic pressure')
-		string="%s\n\t\t%s"%(string,'3: normal stress')
-
-		if self.sedimentlimit_flag==1:
-			string="%s\n%s"%(string,fielddisplay(self,'sedimentlimit','user defined upper limit for the inefficient layer [m]'))
-
-		string="%s\n%s"%(string,fielddisplay(self,'transfer_flag','what kind of transfer method is applied between the layers'))
-		string="%s\n\t\t%s"%(string,'0: no transfer')
-		string="%s\n\t\t%s"%(string,'1: constant leakage factor: leakage_factor')
-
-		if self.transfer_flag is 1:
-			string="%s\n%s"%(string,fielddisplay(self,'leakage_factor','user defined leakage factor [m]'))
-
-		string="%s\n%s"%(string,fielddisplay(self,'unconfined_flag','using an unconfined scheme or not (transitory)'))
-		string="%s\n\t\t%s"%(string,'0: Confined only')
-		string="%s\n\t\t%s"%(string,'1: Confined-Unconfined')
-
-		string="%s\n%s"%(string,'   - for the sediment layer')
-		string="%s\n%s"%(string,fielddisplay(self,'spcsediment_head','sediment water head constraints (NaN means no constraint) [m above MSL]'))
-		string="%s\n%s"%(string,fielddisplay(self,'sediment_compressibility','sediment compressibility [Pa^-1]'))
-		string="%s\n%s"%(string,fielddisplay(self,'sediment_porosity','sediment [dimensionless]'))
-		string="%s\n%s"%(string,fielddisplay(self,'sediment_thickness','sediment thickness [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'sediment_transmitivity','sediment transmitivity [m^2/s]'))
-		string="%s\n%s"%(string,fielddisplay(self,'mask_thawed_node','IDS is deactivaed (0) on frozen nodes'))
-
-		if self.isefficientlayer==1:
-			string="%s\n%s"%(string,'   - for the epl layer')
-			string="%s\n%s"%(string,fielddisplay(self,'spcepl_head','epl water head constraints (NaN means no constraint) [m above MSL]'))
-			string="%s\n%s"%(string,fielddisplay(self,'mask_eplactive_node','active (1) or not (0) EPL'))
-			string="%s\n%s"%(string,fielddisplay(self,'epl_compressibility','epl compressibility [Pa^-1]'))
-			string="%s\n%s"%(string,fielddisplay(self,'epl_porosity','epl [dimensionless]'))
-			string="%s\n%s"%(string,fielddisplay(self,'epl_max_thickness','epl maximal thickness [m]'))
-			string="%s\n%s"%(string,fielddisplay(self,'epl_initial_thickness','epl initial thickness [m]'))
-			string="%s\n%s"%(string,fielddisplay(self,'epl_colapse_thickness','epl colapsing thickness [m]'))
-			string="%s\n%s"%(string,fielddisplay(self,'epl_thick_comp','epl thickness computation flag'))
-			string="%s\n%s"%(string,fielddisplay(self,'epl_conductivity','epl conductivity [m^2/s]'))
-			string="%s\n%s"%(string,fielddisplay(self,'eplflip_lock','lock epl activity to avoid flip-floping (default is 0, no stabilization)'))
-		return string
-#}}}
-	def extrude(self,md): # {{{
-		self.spcsediment_head=project3d(md,'vector',self.spcsediment_head,'type','node','layer',1)
-		self.sediment_transmitivity=project3d(md,'vector',self.sediment_transmitivity,'type','node','layer',1)
-		self.basal_moulin_input=project3d(md,'vector',self.basal_moulin_input,'type','node','layer',1)
-		self.mask_thawed_node=project3d(md,'vector',self.mask_thawed_node,'type','node','layer',1)
-		if self.isefficientlayer==1 :
-			self.spcepl_head=project3d(md,'vector',self.spcepl_head,'type','node','layer',1)
-			self.mask_eplactive_node=project3d(md,'vector',self.mask_eplactive_node,'type','node','layer',1)
-		return self
-	#}}}
-	def setdefaultparameters(self): #{{{
-		#Parameters from de Fleurian 2014
-		self.water_compressibility    = 5.04e-10
-		self.isefficientlayer         = 1
-		self.penalty_factor           = 3
-		self.penalty_lock             = 0
-		self.rel_tol                  = 1.0e-06
-		self.max_iter                 = 100
-		self.steps_per_step           = 1
-		self.sedimentlimit_flag       = 0
-		self.sedimentlimit            = 0
-		self.transfer_flag            = 0
-		self.unconfined_flag          = 0
-		self.leakage_factor           = 10.0
-		self.requested_outputs        = ['default']
-
-		self.sediment_compressibility = 1.0e-08
-		self.sediment_porosity        = 0.4
-		self.sediment_thickness       = 20.0
-		self.sediment_transmitivity   = 8.0e-04
-
-		self.epl_compressibility      = 1.0e-08
-		self.epl_conductivity         = 8.0e-02
-		self.epl_porosity             = 0.4
-		self.epl_initial_thickness    = 1.0
-		self.epl_colapse_thickness    = self.sediment_transmitivity/self.epl_conductivity
-		self.epl_thick_comp           = 1
-		self.epl_max_thickness        = 5.0
-		self.eplflip_lock             = 0
-
-		return self
-	# }}}
-
-	def defaultoutputs(self,md): # {{{
-		list = ['SedimentHeadHydrostep','SedimentHeadResidual','EffectivePressureHydrostep']
-		if self.isefficientlayer==1:
-			list.extend(['EplHeadHydrostep','HydrologydcMaskEplactiveNode','HydrologydcMaskEplactiveElt','EplHeadSlopeX','EplHeadSlopeY','HydrologydcEplThicknessHydrostep'])
-		if self.steps_per_step>1:
-			list.extend(['EffectivePressure','SedimentHead'])
-			if self.isefficientlayer==1:
-				list.extend(['EplHead','HydrologydcEplThickness'])
-		return list
-	#}}}
-
-	def initialize(self,md): # {{{
-		self.epl_colapse_thickness = self.sediment_transmitivity/self.epl_conductivity
-		if np.all(np.isnan(self.basal_moulin_input)):
-			self.basal_moulin_input=np.zeros((md.mesh.numberofvertices))
-			print"      no hydrology.basal_moulin_input specified: values set as zero"
-
-		return self
-	# }}}
-	def checkconsistency(self,md,solution,analyses): #{{{
-
-		#Early return
-		if 'HydrologyDCInefficientAnalysis' not in analyses and 'HydrologyDCEfficientAnalysis' not in analyses:
-			return md
-
-		md = checkfield(md,'fieldname','hydrology.water_compressibility','numel',[1],'>',0.)
-		md = checkfield(md,'fieldname','hydrology.isefficientlayer','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','hydrology.penalty_factor','>',0.,'numel',[1])
-		md = checkfield(md,'fieldname','hydrology.penalty_lock','>=',0.,'numel',[1])
-		md = checkfield(md,'fieldname','hydrology.rel_tol','>',0.,'numel',[1])
-		md = checkfield(md,'fieldname','hydrology.max_iter','>',0.,'numel',[1])
-		md = checkfield(md,'fieldname','hydrology.steps_per_step','>',0.,'numel',[1])
-		md = checkfield(md,'fieldname','hydrology.sedimentlimit_flag','numel',[1],'values',[0,1,2,3])
-		md = checkfield(md,'fieldname','hydrology.transfer_flag','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','hydrology.unconfined_flag','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','hydrology.requested_outputs','stringrow',1)
-
-		if self.sedimentlimit_flag==1:
-			md = checkfield(md,'fieldname','hydrology.sedimentlimit','>',0.,'numel',[1])
-
-		if self.transfer_flag==1:
-			md = checkfield(md,'fieldname','hydrology.leakage_factor','>',0.,'numel',[1])
-
-		md = checkfield(md,'fieldname','hydrology.basal_moulin_input','NaN',1,'Inf',1,'timeseries',1)
-		md = checkfield(md,'fieldname','hydrology.spcsediment_head','Inf',1,'timeseries',1)
-		md = checkfield(md,'fieldname','hydrology.sediment_compressibility','>',0.,'numel',[1])
-		md = checkfield(md,'fieldname','hydrology.sediment_porosity','>',0.,'numel',[1])
-		md = checkfield(md,'fieldname','hydrology.sediment_thickness','>',0.,'numel',[1])
-		md = checkfield(md,'fieldname','hydrology.sediment_transmitivity','>=',0,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','hydrology.mask_thawed_node','size',[md.mesh.numberofvertices],'values',[0,1])
-		if self.isefficientlayer==1:
-			md = checkfield(md,'fieldname','hydrology.spcepl_head','Inf',1,'timeseries',1)
-			md = checkfield(md,'fieldname','hydrology.mask_eplactive_node','size',[md.mesh.numberofvertices],'values',[0,1])
-			md = checkfield(md,'fieldname','hydrology.epl_compressibility','>',0.,'numel',[1])
-			md = checkfield(md,'fieldname','hydrology.epl_porosity','>',0.,'numel',[1])
-			md = checkfield(md,'fieldname','hydrology.epl_max_thickness','numel',[1],'>',0.)
-			md = checkfield(md,'fieldname','hydrology.epl_initial_thickness','numel',[1],'>',0.)
-			md = checkfield(md,'fieldname','hydrology.epl_colapse_thickness','numel',[1],'>',0.)
-			md = checkfield(md,'fieldname','hydrology.epl_thick_comp','numel',[1],'values',[0,1])
-			md = checkfield(md,'fieldname','hydrology.eplflip_lock','>=',0.,'numel',[1])
-			if self.epl_colapse_thickness > self.epl_initial_thickness:
-				md.checkmessage('Colapsing thickness for EPL larger than initial thickness')
-			md = checkfield(md,'fieldname','hydrology.epl_conductivity','numel',[1],'>',0.)
-	# }}}
-	def marshall(self,prefix,md,fid): #{{{
-		WriteData(fid,prefix,'name','md.hydrology.model','data',1,'format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','water_compressibility','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','isefficientlayer','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','penalty_factor','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','penalty_lock','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','rel_tol','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','max_iter','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','sedimentlimit_flag','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','transfer_flag','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','unconfined_flag','format','Integer')
-		if self.sedimentlimit_flag==1:
-			WriteData(fid,prefix,'object',self,'fieldname','sedimentlimit','format','Double')
-
-		if self.transfer_flag==1:
-			WriteData(fid,prefix,'object',self,'fieldname','leakage_factor','format','Double')
-
-		WriteData(fid,prefix,'object',self,'fieldname','basal_moulin_input','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'fieldname','spcsediment_head','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'fieldname','sediment_compressibility','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','sediment_porosity','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','sediment_thickness','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','sediment_transmitivity','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','mask_thawed_node','format','DoubleMat','mattype',1)
-
-		if self.isefficientlayer==1:
-			WriteData(fid,prefix,'object',self,'fieldname','spcepl_head','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-			WriteData(fid,prefix,'object',self,'fieldname','mask_eplactive_node','format','DoubleMat','mattype',1)
-			WriteData(fid,prefix,'object',self,'fieldname','epl_compressibility','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','epl_porosity','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','epl_max_thickness','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','epl_initial_thickness','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','epl_colapse_thickness','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','epl_thick_comp','format','Integer')
-			WriteData(fid,prefix,'object',self,'fieldname','epl_conductivity','format','Double')
-			WriteData(fid,prefix,'object',self,'fieldname','eplflip_lock','format','Integer')
-
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray')
-	# }}}
+    """
+    Hydrologydc class definition
+
+    Usage:
+            hydrologydc = hydrologydc()
+    """
+
+    def __init__(self):  # {{{
+        self.water_compressibility = 0
+        self.isefficientlayer = 0
+        self.penalty_factor = 0
+        self.penalty_lock = 0
+        self.rel_tol = 0
+        self.max_iter = 0
+        self.steps_per_step = 0
+        self.sedimentlimit_flag = 0
+        self.sedimentlimit = 0
+        self.transfer_flag = 0
+        self.unconfined_flag = 0
+        self.leakage_factor = 0
+        self.basal_moulin_input = np.nan
+        self.requested_outputs = []
+
+        self.spcsediment_head = np.nan
+        self.mask_thawed_node = np.nan
+        self.sediment_transmitivity = np.nan
+        self.sediment_compressibility = 0
+        self.sediment_porosity = 0
+        self.sediment_thickness = 0
+
+        self.spcepl_head = np.nan
+        self.mask_eplactive_node = np.nan
+        self.epl_compressibility = 0
+        self.epl_porosity = 0
+        self.epl_initial_thickness = 0
+        self.epl_colapse_thickness = 0
+        self.epl_thick_comp = 0
+        self.epl_max_thickness = 0
+        self.epl_conductivity = 0
+        self.eplflip_lock = 0
+
+    #set defaults
+        self.setdefaultparameters()
+    #}}}
+
+    def __repr__(self):  # {{{
+        string = '   hydrology Dual Porous Continuum Equivalent parameters:'
+        string = ' - general parameters'
+        string = "%s\n%s" % (string, fielddisplay(self, 'water_compressibility', 'compressibility of water [Pa^ - 1]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isefficientlayer', 'do we use an efficient drainage system [1: true 0: false]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'penalty_factor', 'exponent of the value used in the penalisation method [dimensionless]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'penalty_lock', 'stabilize unstable constraints that keep zigzagging after n iteration (default is 0, no stabilization)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'rel_tol', 'tolerance of the nonlinear iteration for the transfer between layers [dimensionless]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'max_iter', 'maximum number of nonlinear iteration'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of hydrology steps per time step'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'basal_moulin_input', 'water flux at a given point [m3 s - 1]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'sedimentlimit_flag', 'what kind of upper limit is applied for the inefficient layer'))
+        string = "%s\n\t\t%s" % (string, '0: no limit')
+        string = "%s\n\t\t%s" % (string, '1: user defined sedimentlimit')
+        string = "%s\n\t\t%s" % (string, '2: hydrostatic pressure')
+        string = "%s\n\t\t%s" % (string, '3: normal stress')
+
+        if self.sedimentlimit_flag == 1:
+            string = "%s\n%s" % (string, fielddisplay(self, 'sedimentlimit', 'user defined upper limit for the inefficient layer [m]'))
+
+        string = "%s\n%s" % (string, fielddisplay(self, 'transfer_flag', 'what kind of transfer method is applied between the layers'))
+        string = "%s\n\t\t%s" % (string, '0: no transfer')
+        string = "%s\n\t\t%s" % (string, '1: constant leakage factor: leakage_factor')
+
+        if self.transfer_flag == 1:
+            string = "%s\n%s" % (string, fielddisplay(self, 'leakage_factor', 'user defined leakage factor [m]'))
+
+        string = "%s\n%s" % (string, fielddisplay(self, 'unconfined_flag', 'using an unconfined scheme or not (transitory)'))
+        string = "%s\n\t\t%s" % (string, '0: Confined only')
+        string = "%s\n\t\t%s" % (string, '1: Confined - Unconfined')
+
+        string = "%s\n%s" % (string, ' - for the sediment layer')
+        string = "%s\n%s" % (string, fielddisplay(self, 'spcsediment_head', 'sediment water head constraints (NaN means no constraint) [m above MSL]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'sediment_compressibility', 'sediment compressibility [Pa^ - 1]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'sediment_porosity', 'sediment [dimensionless]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'sediment_thickness', 'sediment thickness [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'sediment_transmitivity', 'sediment transmitivity [m^2 / s]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'mask_thawed_node', 'IDS is deactivaed (0) on frozen nodes'))
+
+        if self.isefficientlayer == 1:
+            string = "%s\n%s" % (string, ' - for the epl layer')
+            string = "%s\n%s" % (string, fielddisplay(self, 'spcepl_head', 'epl water head constraints (NaN means no constraint) [m above MSL]'))
+            string = "%s\n%s" % (string, fielddisplay(self, 'mask_eplactive_node', 'active (1) or not (0) EPL'))
+            string = "%s\n%s" % (string, fielddisplay(self, 'epl_compressibility', 'epl compressibility [Pa^ - 1]'))
+            string = "%s\n%s" % (string, fielddisplay(self, 'epl_porosity', 'epl [dimensionless]'))
+            string = "%s\n%s" % (string, fielddisplay(self, 'epl_max_thickness', 'epl maximal thickness [m]'))
+            string = "%s\n%s" % (string, fielddisplay(self, 'epl_initial_thickness', 'epl initial thickness [m]'))
+            string = "%s\n%s" % (string, fielddisplay(self, 'epl_colapse_thickness', 'epl colapsing thickness [m]'))
+            string = "%s\n%s" % (string, fielddisplay(self, 'epl_thick_comp', 'epl thickness computation flag'))
+            string = "%s\n%s" % (string, fielddisplay(self, 'epl_conductivity', 'epl conductivity [m^2 / s]'))
+            string = "%s\n%s" % (string, fielddisplay(self, 'eplflip_lock', 'lock epl activity to avoid flip - floping (default is 0, no stabilization)'))
+        return string
+
+    def extrude(self, md):  # {{{
+        self.spcsediment_head = project3d(md, 'vector', self.spcsediment_head, 'type', 'node', 'layer', 1)
+        self.sediment_transmitivity = project3d(md, 'vector', self.sediment_transmitivity, 'type', 'node', 'layer', 1)
+        self.basal_moulin_input = project3d(md, 'vector', self.basal_moulin_input, 'type', 'node', 'layer', 1)
+        self.mask_thawed_node = project3d(md, 'vector', self.mask_thawed_node, 'type', 'node', 'layer', 1)
+        if self.isefficientlayer == 1:
+            self.spcepl_head = project3d(md, 'vector', self.spcepl_head, 'type', 'node', 'layer', 1)
+            self.mask_eplactive_node = project3d(md, 'vector', self.mask_eplactive_node, 'type', 'node', 'layer', 1)
+        return self
+    #}}}
+
+    def setdefaultparameters(self):  #{{{
+        #Parameters from de Fleurian 2014
+        self.water_compressibility = 5.04e-10
+        self.isefficientlayer = 1
+        self.penalty_factor = 3
+        self.penalty_lock = 0
+        self.rel_tol = 1.0e-06
+        self.max_iter = 100
+        self.steps_per_step = 1
+        self.sedimentlimit_flag = 0
+        self.sedimentlimit = 0
+        self.transfer_flag = 1
+        self.unconfined_flag = 0
+        self.leakage_factor = 1.0e-10
+        self.requested_outputs = ['default']
+        self.sediment_compressibility = 1.0e-08
+        self.sediment_porosity = 0.4
+        self.sediment_thickness = 20.0
+        self.sediment_transmitivity = 8.0e-04
+
+        self.epl_compressibility = 1.0e-08
+        self.epl_conductivity = 8.0e-02
+        self.epl_porosity = 0.4
+        self.epl_initial_thickness = 1.0
+        self.epl_colapse_thickness = self.sediment_transmitivity / self.epl_conductivity
+        self.epl_thick_comp = 1
+        self.epl_max_thickness = 5.0
+        self.eplflip_lock = 0
+
+        return self
+    # }}}
+
+    def defaultoutputs(self, md):  # {{{
+        list = ['SedimentHead', 'SedimentHeadResidual', 'EffectivePressure']
+        if self.isefficientlayer == 1:
+            list.extend(['EplHead', 'HydrologydcMaskEplactiveNode', 'HydrologydcMaskEplactiveElt', 'EplHeadSlopeX', 'EplHeadSlopeY', 'HydrologydcEplThickness'])
+        if self.steps_per_step > 1:
+            list.extend(['EffectivePressureSubstep', 'SedimentHeadSubstep'])
+            if self.isefficientlayer == 1:
+                list.extend(['EplHeadSubstep', 'HydrologydcEplThicknessSubstep'])
+        return list
+    #}}}
+
+    def initialize(self, md):  # {{{
+        self.epl_colapse_thickness = self.sediment_transmitivity / self.epl_conductivity
+        if np.all(np.isnan(self.basal_moulin_input)):
+            self.basal_moulin_input = np.zeros((md.mesh.numberofvertices))
+            print("      no hydrology.basal_moulin_input specified: values set as zero")
+
+        return self
+    # }}}
+
+    def checkconsistency(self, md, solution, analyses):  #{{{
+        #Early return
+        if 'HydrologyDCInefficientAnalysis' not in analyses and 'HydrologyDCEfficientAnalysis' not in analyses:
+            return md
+
+        md = checkfield(md, 'fieldname', 'hydrology.water_compressibility', 'numel', [1], '>', 0.)
+        md = checkfield(md, 'fieldname', 'hydrology.isefficientlayer', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'hydrology.penalty_factor', '>', 0., 'numel', [1])
+        md = checkfield(md, 'fieldname', 'hydrology.penalty_lock', '>=', 0., 'numel', [1])
+        md = checkfield(md, 'fieldname', 'hydrology.rel_tol', '>', 0., 'numel', [1])
+        md = checkfield(md, 'fieldname', 'hydrology.max_iter', '>', 0., 'numel', [1])
+        md = checkfield(md, 'fieldname', 'hydrology.steps_per_step', '>=', 1, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'hydrology.sedimentlimit_flag', 'numel', [1], 'values', [0, 1, 2, 3])
+        md = checkfield(md, 'fieldname', 'hydrology.transfer_flag', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'hydrology.unconfined_flag', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'hydrology.requested_outputs', 'stringrow', 1)
+
+        if self.sedimentlimit_flag == 1:
+            md = checkfield(md, 'fieldname', 'hydrology.sedimentlimit', '>', 0., 'numel', [1])
+
+        if self.transfer_flag == 1:
+            md = checkfield(md, 'fieldname', 'hydrology.leakage_factor', '>', 0., 'numel', [1])
+
+        md = checkfield(md, 'fieldname', 'hydrology.basal_moulin_input', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'hydrology.spcsediment_head', 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'hydrology.sediment_compressibility', '>', 0., 'numel', [1])
+        md = checkfield(md, 'fieldname', 'hydrology.sediment_porosity', '>', 0., 'numel', [1])
+        md = checkfield(md, 'fieldname', 'hydrology.sediment_thickness', '>', 0., 'numel', [1])
+        md = checkfield(md, 'fieldname', 'hydrology.sediment_transmitivity', '>=', 0, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'hydrology.mask_thawed_node', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
+        if self.isefficientlayer == 1:
+            md = checkfield(md, 'fieldname', 'hydrology.spcepl_head', 'Inf', 1, 'timeseries', 1)
+            md = checkfield(md, 'fieldname', 'hydrology.mask_eplactive_node', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
+            md = checkfield(md, 'fieldname', 'hydrology.epl_compressibility', '>', 0., 'numel', [1])
+            md = checkfield(md, 'fieldname', 'hydrology.epl_porosity', '>', 0., 'numel', [1])
+            md = checkfield(md, 'fieldname', 'hydrology.epl_max_thickness', 'numel', [1], '>', 0.)
+            md = checkfield(md, 'fieldname', 'hydrology.epl_initial_thickness', 'numel', [1], '>', 0.)
+            md = checkfield(md, 'fieldname', 'hydrology.epl_colapse_thickness', 'numel', [1], '>', 0.)
+            md = checkfield(md, 'fieldname', 'hydrology.epl_thick_comp', 'numel', [1], 'values', [0, 1])
+            md = checkfield(md, 'fieldname', 'hydrology.eplflip_lock', '>=', 0., 'numel', [1])
+            if self.epl_colapse_thickness > self.epl_initial_thickness:
+                md.checkmessage('Colapsing thickness for EPL larger than initial thickness')
+            md = checkfield(md, 'fieldname', 'hydrology.epl_conductivity', 'numel', [1], '>', 0.)
+    # }}}
+
+    def marshall(self, prefix, md, fid):  #{{{
+        WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 1, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'water_compressibility', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isefficientlayer', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'penalty_factor', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'penalty_lock', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'rel_tol', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'max_iter', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'sedimentlimit_flag', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'transfer_flag', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'unconfined_flag', 'format', 'Integer')
+        if self.sedimentlimit_flag == 1:
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'sedimentlimit', 'format', 'Double')
+
+        if self.transfer_flag == 1:
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'leakage_factor', 'format', 'Double')
+
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'basal_moulin_input', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'spcsediment_head', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'sediment_compressibility', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'sediment_porosity', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'sediment_thickness', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'sediment_transmitivity', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'mask_thawed_node', 'format', 'DoubleMat', 'mattype', 1)
+
+        if self.isefficientlayer == 1:
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'spcepl_head', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'mask_eplactive_node', 'format', 'DoubleMat', 'mattype', 1)
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_compressibility', 'format', 'Double')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_porosity', 'format', 'Double')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_max_thickness', 'format', 'Double')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_initial_thickness', 'format', 'Double')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_colapse_thickness', 'format', 'Double')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_thick_comp', 'format', 'Integer')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_conductivity', 'format', 'Double')
+            WriteData(fid, prefix, 'object', self, 'fieldname', 'eplflip_lock', 'format', 'Integer')
+
+    #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.hydrology.requested_outputs', 'format', 'StringArray')
+    # }}}
Index: /issm/trunk/src/m/classes/hydrologyglads.m
===================================================================
--- /issm/trunk/src/m/classes/hydrologyglads.m	(revision 24313)
+++ /issm/trunk/src/m/classes/hydrologyglads.m	(revision 24313)
@@ -0,0 +1,138 @@
+%HYDROLOGYGLADS class definition
+%
+%   Usage:
+%      hydrologyglads=hydrologyglads();
+
+classdef hydrologyglads
+	properties (SetAccess=public) 
+		%Sheet
+		pressure_melt_coefficient = 0.;
+		sheet_conductivity        = NaN;
+		cavity_spacing            = 0.;
+		bump_height               = NaN;
+
+		%Channels
+		ischannels           = 0;
+		channel_conductivity = 0.;
+		channel_sheet_width  = 0.;
+
+		%Other
+		spcphi               = NaN;
+		moulin_input         = NaN;
+		neumannflux          = NaN;
+		englacial_void_ratio = 0.;
+		requested_outputs    = {};
+		melt_flag            = 0;
+	end
+	methods
+		function self = hydrologyglads(varargin) % {{{
+			switch nargin
+				case 0
+					self=setdefaultparameters(self);
+				case 1
+					self=structtoobj(self,varargin{1});
+				otherwise
+					error('constructor not supported');
+			end
+		end % }}}
+		function list = defaultoutputs(self,md) % {{{
+			list = {'EffectivePressure','HydraulicPotential','HydrologySheetThickness','ChannelArea'};
+		end % }}}    
+
+		function self = setdefaultparameters(self) % {{{
+
+			%Sheet parameters
+			self.pressure_melt_coefficient = 7.5e-8; %K/Pa (See table 1 in Erder et al. 2013)
+			self.cavity_spacing = 2.; %m
+
+			%Channel parameters
+			self.ischannels=false;
+			self.channel_conductivity = 5.e-2; %Dow's default, Table uses 0.1
+			self.channel_sheet_width = 2.; %m
+
+			%Other
+			self.englacial_void_ratio = 1.e-5;% Dow's default, Table from Werder et al. uses 1e-3;
+			self.requested_outputs={'default'};
+			self.melt_flag=0;
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+
+			%Early return
+			if ~ismember('HydrologyGladsAnalysis',analyses)
+				return;
+			end
+
+			%Sheet
+			md = checkfield(md,'fieldname','hydrology.pressure_melt_coefficient','numel',[1],'>=',0);	
+			md = checkfield(md,'fieldname','hydrology.sheet_conductivity','size',[md.mesh.numberofvertices 1],'>',0,'NaN',1,'Inf',1);	
+			md = checkfield(md,'fieldname','hydrology.cavity_spacing','numel',[1],'>',0);	
+			md = checkfield(md,'fieldname','hydrology.bump_height','size',[md.mesh.numberofvertices 1],'>=',0,'NaN',1,'Inf',1);
+
+			%Channels
+			md = checkfield(md,'fieldname','hydrology.ischannels','numel',[1],'values',[0 1]);
+			md = checkfield(md,'fieldname','hydrology.channel_conductivity','numel',[1],'>',0);	
+			md = checkfield(md,'fieldname','hydrology.channel_sheet_width','numel',[1],'>=',0);	
+
+			%Other
+			md = checkfield(md,'fieldname','hydrology.spcphi','Inf',1,'timeseries',1);
+			md = checkfield(md,'fieldname','hydrology.englacial_void_ratio','numel',[1],'>=',0);
+			md = checkfield(md,'fieldname','hydrology.moulin_input','size',[md.mesh.numberofvertices 1],'>=',0,'NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','hydrology.neumannflux','timeseries',1,'NaN',1,'Inf',1);
+			md = checkfield(md,'fieldname','hydrology.requested_outputs','stringrow',1);
+			md = checkfield(md,'fieldname','hydrology.melt_flag','numel',[1],'values',[0 1]);
+			if self.melt_flag
+				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
+			end
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   GlaDS (hydrologyglads) solution parameters:'));
+			disp(sprintf('      SHEET'));
+			fielddisplay(self,'pressure_melt_coefficient','Pressure melt coefficient (c_t) [K Pa^-1]');
+			fielddisplay(self,'sheet_conductivity','sheet conductivity (k) [m^(7/4) kg^(-1/2)]');
+			fielddisplay(self,'cavity_spacing','cavity spacing (l_r) [m]');
+			fielddisplay(self,'bump_height','typical bump height (h_r) [m]');
+			disp(sprintf('      CHANNELS'));
+			fielddisplay(self,'ischannels','Do we allow for channels? 1: yes, 0: no');
+			fielddisplay(self,'channel_conductivity','channel conductivity (k_c) [m^(3/2) kg^(-1/2)]');
+			disp(sprintf('      OTHER'));
+			fielddisplay(self,'spcphi','Hydraulic potential Dirichlet constraints [Pa]');
+			fielddisplay(self,'neumannflux','water flux applied along the model boundary (m^2/s)');
+			fielddisplay(self,'moulin_input','moulin input (Q_s) [m^3/s]');
+			fielddisplay(self,'englacial_void_ratio','englacial void ratio (e_v)');
+			fielddisplay(self,'requested_outputs','additional outputs requested');
+			fielddisplay(self,'melt_flag','User specified basal melt? 0: no (default), 1: use md.basalforcings.groundedice_melting_rate');
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+
+			yts=md.constants.yts;
+
+			%Marshall model code first
+			WriteData(fid,prefix,'name','md.hydrology.model','data',5,'format','Integer');
+
+			%Sheet
+			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','pressure_melt_coefficient','format','Double');
+			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','sheet_conductivity','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','cavity_spacing','format','Double');
+			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','bump_height','format','DoubleMat','mattype',1);
+
+			%Channels
+			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','ischannels','format','Boolean');
+			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','channel_conductivity','format','Double');
+			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','channel_sheet_width','format','Double');
+
+			%Others
+			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','spcphi','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','neumannflux','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
+			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','moulin_input','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','englacial_void_ratio','format','Double');
+			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','melt_flag','format','Boolean');
+			outputs = self.requested_outputs;
+			pos  = find(ismember(outputs,'default'));
+			if ~isempty(pos),
+				outputs(pos) = [];  %remove 'default' from outputs
+				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
+			end
+			WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
+		end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/hydrologypism.m
===================================================================
--- /issm/trunk/src/m/classes/hydrologypism.m	(revision 24312)
+++ /issm/trunk/src/m/classes/hydrologypism.m	(revision 24313)
@@ -25,5 +25,4 @@
 			list = {'Watercolumn'};
 		end % }}}    
-
 		function self = setdefaultparameters(self) % {{{
 
Index: /issm/trunk/src/m/classes/hydrologyshakti.m
===================================================================
--- /issm/trunk/src/m/classes/hydrologyshakti.m	(revision 24312)
+++ /issm/trunk/src/m/classes/hydrologyshakti.m	(revision 24313)
@@ -17,5 +17,5 @@
 		relaxation      = 0;
 		storage         = 0;
-    requested_outputs = {};
+		requested_outputs = {};
 	end
 	methods
@@ -32,13 +32,13 @@
 			end
 		end % }}}
-    function list = defaultoutputs(self,md) % {{{
-        list = {'HydrologyHead','HydrologyGapHeight','EffectivePressure','HydrologyBasalFlux','DegreeOfChannelization'};
-    end % }}}    
+		function list = defaultoutputs(self,md) % {{{
+			list = {'HydrologyHead','HydrologyGapHeight','EffectivePressure','HydrologyBasalFlux','DegreeOfChannelization'};
+		end % }}}    
 
 		function self = setdefaultparameters(self) % {{{
-	      % Set under-relaxation parameter to be 1 (no under-relaxation of nonlinear iteration)	
+			% Set under-relaxation parameter to be 1 (no under-relaxation of nonlinear iteration)	
 			self.relaxation=1;
 			self.storage=0;
-      self.requested_outputs={'default'};
+			self.requested_outputs={'default'};
 		end % }}}
 		function md = checkconsistency(self,md,solution,analyses) % {{{
@@ -58,7 +58,7 @@
 			md = checkfield(md,'fieldname','hydrology.neumannflux','timeseries',1,'NaN',1,'Inf',1);
 			md = checkfield(md,'fieldname','hydrology.spchead','size',[md.mesh.numberofvertices 1]);	
-         md = checkfield(md,'fieldname','hydrology.relaxation','>=',0);	
+			md = checkfield(md,'fieldname','hydrology.relaxation','>=',0);	
 			md = checkfield(md,'fieldname','hydrology.storage','>=',0);
-      md = checkfield(md,'fieldname','hydrology.requested_outputs','stringrow',1);
+			md = checkfield(md,'fieldname','hydrology.requested_outputs','stringrow',1);
 		end % }}}
 		function disp(self) % {{{
@@ -75,5 +75,5 @@
 			fielddisplay(self,'relaxation','under-relaxation coefficient for nonlinear iteration');
 			fielddisplay(self,'storage','englacial storage coefficient (void ratio)');
-      fielddisplay(self,'requested_outputs','additional outputs requested');
+			fielddisplay(self,'requested_outputs','additional outputs requested');
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
@@ -91,13 +91,13 @@
 			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','neumannflux','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts);
 			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','spchead','format','DoubleMat','mattype',1);
-      WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','relaxation','format','Double');
+			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','relaxation','format','Double');
 			WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','storage','format','Double');
-      outputs = self.requested_outputs;
-      pos  = find(ismember(outputs,'default'));
-      if ~isempty(pos),
-        outputs(pos) = [];  %remove 'default' from outputs
-        outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-      end
-      WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
+			outputs = self.requested_outputs;
+			pos  = find(ismember(outputs,'default'));
+			if ~isempty(pos),
+				outputs(pos) = [];  %remove 'default' from outputs
+				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
+			end
+			WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
 		end % }}}
 	end
Index: /issm/trunk/src/m/classes/hydrologyshakti.py
===================================================================
--- /issm/trunk/src/m/classes/hydrologyshakti.py	(revision 24312)
+++ /issm/trunk/src/m/classes/hydrologyshakti.py	(revision 24313)
@@ -3,104 +3,106 @@
 from WriteData import WriteData
 
+
 class hydrologyshakti(object):
-	"""
-	HYDROLOGYSHAKTI class definition
+    """
+    HYDROLOGYSHAKTI class definition
 
-	   Usage:
-	      hydrologyshakti=hydrologyshakti()
-	"""
+       Usage:
+          hydrologyshakti = hydrologyshakti()
+    """
 
-	def __init__(self): # {{{
-		self.head            = float('NaN')
-		self.gap_height      = float('NaN')
-		self.bump_spacing    = float('NaN')
-		self.bump_height     = float('NaN')
-		self.englacial_input = float('NaN')
-		self.moulin_input    = float('NaN')
-		self.reynolds        = float('NaN')
-		self.spchead         = float('NaN')
-		self.neumannflux     = float('NaN')
-		self.relaxation      = 0
-		self.storage         = 0
-		self.requested_outputs = []
+    def __init__(self):  # {{{
+        self.head = float('NaN')
+        self.gap_height = float('NaN')
+        self.bump_spacing = float('NaN')
+        self.bump_height = float('NaN')
+        self.englacial_input = float('NaN')
+        self.moulin_input = float('NaN')
+        self.reynolds = float('NaN')
+        self.spchead = float('NaN')
+        self.neumannflux = float('NaN')
+        self.relaxation = 0
+        self.storage = 0
+        self.requested_outputs = []
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		
-		string='   hydrologyshakti solution parameters:'
-		string="%s\n%s"%(string,fielddisplay(self,'head','subglacial hydrology water head (m)'))
-		string="%s\n%s"%(string,fielddisplay(self,'gap_height','height of gap separating ice to bed (m)'))
-		string="%s\n%s"%(string,fielddisplay(self,'bump_spacing','characteristic bedrock bump spacing (m)'))
-		string="%s\n%s"%(string,fielddisplay(self,'bump_height','characteristic bedrock bump height (m)'))
-		string="%s\n%s"%(string,fielddisplay(self,'englacial_input','liquid water input from englacial to subglacial system (m/yr)'))
-		string="%s\n%s"%(string,fielddisplay(self,'moulin_input','liquid water input from moulins (at the vertices) to subglacial system (m^3/s)'))
-		string="%s\n%s"%(string,fielddisplay(self,'reynolds','Reynolds'' number'))
-		string="%s\n%s"%(string,fielddisplay(self,'neumannflux','water flux applied along the model boundary (m^2/s)'))
-		string="%s\n%s"%(string,fielddisplay(self,'spchead','water head constraints (NaN means no constraint) (m)'))
-		string="%s\n%s"%(string,fielddisplay(self,'relaxation','under-relaxation coefficient for nonlinear iteration'))
-		string="%s\n%s"%(string,fielddisplay(self,'storage','englacial storage coefficient (void ratio)'))
-		string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested'))
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
-		# Set under-relaxation parameter to be 1 (no under-relaxation of nonlinear iteration)	
-		self.relaxation=1
-		self.storage=0
-		self.requested_outputs=['default']
-		return self
-	#}}}
-	def defaultoutputs(self,md): # {{{
-		list = ['HydrologyHead','HydrologyGapHeight','EffectivePressure','HydrologyBasalFlux','DegreeOfChannelization']
-		return list
-	#}}}
+    #}}}
+    def __repr__(self):  # {{{
+        string = '   hydrologyshakti solution parameters:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'head', 'subglacial hydrology water head (m)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'gap_height', 'height of gap separating ice to bed (m)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'bump_spacing', 'characteristic bedrock bump spacing (m)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'bump_height', 'characteristic bedrock bump height (m)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'englacial_input', 'liquid water input from englacial to subglacial system (m / yr)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'moulin_input', 'liquid water input from moulins (at the vertices) to subglacial system (m^3 / s)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'reynolds', 'Reynolds'' number'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'neumannflux', 'water flux applied along the model boundary (m^2 / s)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'spchead', 'water head constraints (NaN means no constraint) (m)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'relaxation', 'under - relaxation coefficient for nonlinear iteration'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'storage', 'englacial storage coefficient (void ratio)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+        return string
+    #}}}
 
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		
-		#Early return
-		if 'HydrologyShaktiAnalysis' not in analyses:
-			return md
+    def extrude(self, md):  # {{{
+        return self
+    #}}}
 
-		md = checkfield(md,'fieldname','hydrology.head','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','hydrology.gap_height','>=',0,'size',[md.mesh.numberofelements],'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','hydrology.bump_spacing','>',0,'size',[md.mesh.numberofelements],'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','hydrology.bump_height','>=',0,'size',[md.mesh.numberofelements],'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','hydrology.englacial_input','>=',0,'NaN',1,'Inf',1,'timeseries',1)
-		md = checkfield(md,'fieldname','hydrology.moulin_input','>=',0,'NaN',1,'Inf',1,'timeseries',1)
-		md = checkfield(md,'fieldname','hydrology.reynolds','>',0,'size',[md.mesh.numberofelements],'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','hydrology.neumannflux','timeseries',1,'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','hydrology.spchead','size',[md.mesh.numberofvertices])
-         	md = checkfield(md,'fieldname','hydrology.relaxation','>=',0)	
-		md = checkfield(md,'fieldname','hydrology.storage','>=',0)
-		md = checkfield(md,'fieldname','hydrology.requested_outputs','stringrow',1)
+    def setdefaultparameters(self):  # {{{
+        # Set under - relaxation parameter to be 1 (no under - relaxation of nonlinear iteration)
+        self.relaxation = 1
+        self.storage = 0
+        self.requested_outputs = ['default']
+        return self
+    #}}}
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		yts=md.constants.yts
+    def defaultoutputs(self, md):  # {{{
+        list = ['HydrologyHead', 'HydrologyGapHeight', 'EffectivePressure', 'HydrologyBasalFlux', 'DegreeOfChannelization']
+        return list
+    #}}}
 
-		WriteData(fid,prefix,'name','md.hydrology.model','data',3,'format','Integer')
-		WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','head','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','gap_height','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','bump_spacing','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','bump_height','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','englacial_input','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','moulin_input','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','reynolds','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','neumannflux','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','spchead','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','relaxation','format','Double')
-		WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','storage','format','Double')
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray')
-	# }}}
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if 'HydrologyShaktiAnalysis' not in analyses:
+            return md
+
+        md = checkfield(md, 'fieldname', 'hydrology.head', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'hydrology.gap_height', '>=', 0, 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'hydrology.bump_spacing', '>', 0, 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'hydrology.bump_height', '>=', 0, 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'hydrology.englacial_input', '>=', 0, 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'hydrology.moulin_input', '>=', 0, 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'hydrology.reynolds', '>', 0, 'size', [md.mesh.numberofelements], 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'hydrology.neumannflux', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'hydrology.spchead', 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'hydrology.relaxation', '>=', 0)
+        md = checkfield(md, 'fieldname', 'hydrology.storage', '>=', 0)
+        md = checkfield(md, 'fieldname', 'hydrology.requested_outputs', 'stringrow', 1)
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
+
+        WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 3, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'head', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'gap_height', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'bump_spacing', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'bump_height', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'englacial_input', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'moulin_input', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'reynolds', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'neumannflux', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'spchead', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'relaxation', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'hydrology', 'fieldname', 'storage', 'format', 'Double')
+    #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.hydrology.requested_outputs', 'format', 'StringArray')
+    # }}}
Index: /issm/trunk/src/m/classes/hydrologyshreve.py
===================================================================
--- /issm/trunk/src/m/classes/hydrologyshreve.py	(revision 24312)
+++ /issm/trunk/src/m/classes/hydrologyshreve.py	(revision 24313)
@@ -3,65 +3,69 @@
 from WriteData import WriteData
 
+
 class hydrologyshreve(object):
-	"""
-	HYDROLOGYSHREVE class definition
+    """
+    HYDROLOGYSHREVE class definition
 
-	   Usage:
-	      hydrologyshreve=hydrologyshreve();
-	"""
+       Usage:
+          hydrologyshreve = hydrologyshreve()
+    """
 
-	def __init__(self): # {{{
-		self.spcwatercolumn = float('NaN')
-		self.stabilization  = 0
-		self.requested_outputs = []
-		#set defaults
-		self.setdefaultparameters()
+    def __init__(self):  # {{{
+        self.spcwatercolumn = float('NaN')
+        self.stabilization = 0
+        self.requested_outputs = []
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		
-		string='   hydrologyshreve solution parameters:'
-		string="%s\n%s"%(string,fielddisplay(self,'spcwatercolumn','water thickness constraints (NaN means no constraint) [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'stabilization','artificial diffusivity (default is 1). can be more than 1 to increase diffusivity.'))
-		string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested'))
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
-		
-		#Type of stabilization to use 0:nothing 1:artificial_diffusivity
-		self.stabilization=1
-		self.requested_outputs= ['default']
-		return self
-	#}}}
-	def defaultoutputs(self,md): # {{{
-		list = ['Watercolumn','HydrologyWaterVx','HydrologyWaterVy']
-		return list
-	#}}}
+    #}}}
 
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		
-		#Early return
-		if 'HydrologyShreveAnalysis' not in analyses:
-			return md
+    def __repr__(self):  # {{{
 
-		md = checkfield(md,'fieldname','hydrology.spcwatercolumn','Inf',1,'timeseries',1)
-		md = checkfield(md,'fieldname','hydrology.stabilization','>=',0)
-		md = checkfield(md,'fieldname','hydrology.requested_outputs','stringrow',1)
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'name','md.hydrology.model','data',2,'format','Integer');
-		WriteData(fid,prefix,'object',self,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Double')
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray')
+        string = '   hydrologyshreve solution parameters:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'spcwatercolumn', 'water thickness constraints (NaN means no constraint) [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'stabilization', 'artificial diffusivity (default is 1). can be more than 1 to increase diffusivity.'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+        return string
+    #}}}
 
-	# }}}
+    def extrude(self, md):  # {{{
+        return self
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+        #Type of stabilization to use 0:nothing 1:artificial_diffusivity
+        self.stabilization = 1
+        self.requested_outputs = ['default']
+        return self
+    #}}}
+
+    def defaultoutputs(self, md):  # {{{
+        list = ['Watercolumn', 'HydrologyWaterVx', 'HydrologyWaterVy']
+        return list
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if 'HydrologyShreveAnalysis' not in analyses:
+            return md
+
+        md = checkfield(md, 'fieldname', 'hydrology.spcwatercolumn', 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'hydrology.stabilization', '>=', 0)
+        md = checkfield(md, 'fieldname', 'hydrology.requested_outputs', 'stringrow', 1)
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 2, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'spcwatercolumn', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'stabilization', 'format', 'Double')
+    #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.hydrology.requested_outputs', 'format', 'StringArray')
+
+    # }}}
Index: /issm/trunk/src/m/classes/independent.py
===================================================================
--- /issm/trunk/src/m/classes/independent.py	(revision 24312)
+++ /issm/trunk/src/m/classes/independent.py	(revision 24313)
@@ -5,66 +5,71 @@
 from MatlabFuncs import *
 
+
 class independent(object):
-	"""
-	INDEPENDENT class definition
+    """
+    INDEPENDENT class definition
 
-	   Usage:
-	      independent=independent();
-	"""
+       Usage:
+          independent = independent()
+    """
 
-	def __init__(self,*args):    # {{{
-		self.name                 = ''
-		self.type                 = ''
-		self.fos_forward_index    = float('NaN')
-		self.fov_forward_indices  = np.array([])
-		self.nods                 = 0
+    def __init__(self, *args):  # {{{
+        self.name = ''
+        self.type = ''
+        self.fos_forward_index = float('NaN')
+        self.fov_forward_indices = np.array([])
+        self.nods = 0
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#use provided options to change fields
-		options=pairoptions(*args)
+    #use provided options to change fields
+        options = pairoptions(*args)
 
-		#OK get other fields
-		self=options.AssignObjectFields(self)
-	# }}}
-	def __repr__(self):    # {{{
-		s ="   independent variable:\n"
+    #OK get other fields
+        self = options.AssignObjectFields(self)
+    # }}}
 
-		s+="%s\n" % fielddisplay(self,'name',"variable name (must match corresponding String)")
-		s+="%s\n" % fielddisplay(self,'type',"type of variable ('vertex' or 'scalar')")
-		if not np.isnan(self.fos_forward_index):
-			s+="%s\n" % fielddisplay(self,'fos_forward_index',"index for fos_foward driver of ADOLC")
-		if np.any(np.logical_not(np.isnan(self.fov_forward_indices))):
-			s+="%s\n" % fielddisplay(self,'fov_forward_indices',"indices for fov_foward driver of ADOLC")
+    def __repr__(self):  # {{{
+        s = "   independent variable:\n"
 
-		return s
-	# }}}
-	def setdefaultparameters(self):    # {{{
-		#do nothing
-		return self
-	# }}}
-	def checkconsistency(self,md,i,solution,analyses,driver):    # {{{
-		if not np.isnan(self.fos_forward_index):
-			if not strcmpi(driver,'fos_forward'):
-				raise TypeError("cannot declare an independent with a fos_forward_index when the driver is not fos_forward!")
-			if self.nods==0:
-				raise TypeError("independent checkconsistency error: nods should be set to the size of the independent variable")
+        s += "%s\n" % fielddisplay(self, 'name', "variable name (must match corresponding String)")
+        s += "%s\n" % fielddisplay(self, 'type', "type of variable ('vertex' or 'scalar')")
+        if not np.isnan(self.fos_forward_index):
+            s += "%s\n" % fielddisplay(self, 'fos_forward_index', "index for fos_foward driver of ADOLC")
+        if np.any(np.logical_not(np.isnan(self.fov_forward_indices))):
+            s += "%s\n" % fielddisplay(self, 'fov_forward_indices', "indices for fov_foward driver of ADOLC")
 
-		if len(self.fov_forward_indices) > 0:
-			if not strcmpi(driver,'fov_forward'):
-				raise TypeError("cannot declare an independent with fov_forward_indices when the driver is not fov_forward!")
-			if self.nods==0:
-				raise TypeError("independent checkconsistency error: nods should be set to the size of the independent variable")
-			md = checkfield(md,'fieldname',"autodiff.independents[%d].fov_forward_indices" % i,'>=',1,'<=',self.nods)
+        return s
+    # }}}
 
-		return md
-	# }}}
-	def typetoscalar(self):    # {{{
-		if   strcmpi(self.type,'scalar'):
-			scalar=0
-		elif strcmpi(self.type,'vertex'):
-			scalar=1
+    def setdefaultparameters(self):  # {{{
+        #do nothing
+        return self
+    # }}}
 
-		return scalar
-	# }}}
+    def checkconsistency(self, md, i, solution, analyses, driver):  # {{{
+        if not np.isnan(self.fos_forward_index):
+            if not strcmpi(driver, 'fos_forward'):
+                raise TypeError("cannot declare an independent with a fos_forward_index when the driver is not fos_forward!")
+            if self.nods == 0:
+                raise TypeError("independent checkconsistency error: nods should be set to the size of the independent variable")
+
+        if len(self.fov_forward_indices) > 0:
+            if not strcmpi(driver, 'fov_forward'):
+                raise TypeError("cannot declare an independent with fov_forward_indices when the driver is not fov_forward!")
+            if self.nods == 0:
+                raise TypeError("independent checkconsistency error: nods should be set to the size of the independent variable")
+            md = checkfield(md, 'fieldname', "autodiff.independents[%d].fov_forward_indices" % i, '>=', 1, '<=', self.nods)
+
+        return md
+    # }}}
+
+    def typetoscalar(self):  # {{{
+        if strcmpi(self.type, 'scalar'):
+            scalar = 0
+        elif strcmpi(self.type, 'vertex'):
+            scalar = 1
+
+        return scalar
+    # }}}
Index: /issm/trunk/src/m/classes/initialization.m
===================================================================
--- /issm/trunk/src/m/classes/initialization.m	(revision 24312)
+++ /issm/trunk/src/m/classes/initialization.m	(revision 24313)
@@ -6,15 +6,18 @@
 classdef initialization
 	properties (SetAccess=public) 
-		vx            = NaN;
-		vy            = NaN;
-		vz            = NaN;
-		vel           = NaN;
-		pressure      = NaN;
-		temperature   = NaN;
-		waterfraction = NaN;
-		sediment_head = NaN;
-		epl_head      = NaN;
-		epl_thickness = NaN;
-		watercolumn   = NaN;
+		vx                  = NaN;
+		vy                  = NaN;
+		vz                  = NaN;
+		vel                 = NaN;
+		pressure            = NaN;
+		temperature         = NaN;
+		enthalpy            = NaN;
+		waterfraction       = NaN;
+		sediment_head       = NaN;
+		epl_head            = NaN;
+		epl_thickness       = NaN;
+		watercolumn         = NaN;
+		hydraulic_potential = NaN;
+		channelarea         = NaN;
 	end
 	methods
@@ -25,4 +28,5 @@
 			self.vel=project3d(md,'vector',self.vel,'type','node');
 			self.temperature=project3d(md,'vector',self.temperature,'type','node');
+			self.enthalpy=project3d(md,'vector',self.enthalpy,'type','node');
 			self.waterfraction=project3d(md,'vector',self.waterfraction,'type','node');
 			self.watercolumn=project3d(md,'vector',self.watercolumn,'type','node','layer',1);
@@ -87,4 +91,11 @@
 				end
 			end
+			if ismember('HydrologyGlaDSAnalysis',analyses),
+				if isa(md.hydrology,'hydrologyglads'),
+					md = checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+					md = checkfield(md,'fieldname','initialization.hydraulic_potential','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+					md = checkfield(md,'fieldname','initialization.channelarea','NaN',1,'Inf',1,'>=',0,'size',[md.mesh.numberofedges 1]);
+				end
+			end
 			if ismember('HydrologyDCInefficientAnalysis',analyses),
 				if isa(md.hydrology,'hydrologydc'),
@@ -110,9 +121,12 @@
 			fielddisplay(self,'pressure','pressure field [Pa]');
 			fielddisplay(self,'temperature','temperature [K]');
+			fielddisplay(self,'enthalpy','enthalpy [J]');
 			fielddisplay(self,'waterfraction','fraction of water in the ice');
 			fielddisplay(self,'sediment_head','sediment water head of subglacial system [m]');
 			fielddisplay(self,'epl_head','epl water head of subglacial system [m]');
 			fielddisplay(self,'epl_thickness','epl layer thickness [m]');
-			fielddisplay(self,'watercolumn','thickness of subglacial water [m]');
+			fielddisplay(self,'watercolumn','subglacial water sheet thickness (for Shreve and GlaDS) [m]');
+			fielddisplay(self,'hydraulic_potential','Hydraulic potential (for GlaDS) [Pa]');
+			fielddisplay(self,'channelarea','subglacial water channel area (for GlaDS) [m2]');
 
 		end % }}}
@@ -131,10 +145,17 @@
 			WriteData(fid,prefix,'object',self,'fieldname','epl_thickness','format','DoubleMat','mattype',1);
 			WriteData(fid,prefix,'object',self,'fieldname','watercolumn','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',self,'fieldname','channelarea','format','DoubleMat','mattype',1);
+			WriteData(fid,prefix,'object',self,'fieldname','hydraulic_potential','format','DoubleMat','mattype',1);
 
 			if md.thermal.isenthalpy,
-				tpmp = md.materials.meltingpoint - md.materials.beta*md.initialization.pressure;
-				pos  = find(md.initialization.waterfraction>0.);
-				enthalpy      = md.materials.heatcapacity*(md.initialization.temperature-md.constants.referencetemperature);
-				enthalpy(pos) = md.materials.heatcapacity*(tpmp(pos) - md.constants.referencetemperature) + md.materials.latentheat*md.initialization.waterfraction(pos);
+				if numel(self.enthalpy) <= 1,
+					%reconstruct enthalpy
+					tpmp = md.materials.meltingpoint - md.materials.beta*md.initialization.pressure;
+					pos  = find(md.initialization.waterfraction>0.);
+					enthalpy      = md.materials.heatcapacity*(md.initialization.temperature-md.constants.referencetemperature);
+					enthalpy(pos) = md.materials.heatcapacity*(tpmp(pos) - md.constants.referencetemperature) + md.materials.latentheat*md.initialization.waterfraction(pos);
+				else
+					enthalpy = self.enthalpy;
+				end
 				WriteData(fid,prefix,'data',enthalpy,'format','DoubleMat','mattype',1,'name','md.initialization.enthalpy');
 			end
@@ -148,4 +169,5 @@
 			writejs1Darray(fid,[modelname '.initialization.pressure'],self.pressure);
 			writejs1Darray(fid,[modelname '.initialization.temperature'],self.temperature);
+			writejs1Darray(fid,[modelname '.initialization.enthalpy'],self.enthalpy);
 			writejs1Darray(fid,[modelname '.initialization.waterfraction'],self.waterfraction);
 			writejs1Darray(fid,[modelname '.initialization.sediment_head'],self.sediment_head);
@@ -153,4 +175,6 @@
 			writejs1Darray(fid,[modelname '.initialization.epl_thickness'],self.epl_thickness);
 			writejs1Darray(fid,[modelname '.initialization.watercolumn'],self.watercolumn);
+			writejs1Darray(fid,[modelname '.initialization.hydraulic_potential'],self.hydraulic_potential);
+			writejs1Darray(fid,[modelname '.initialization.channel'],self.channelarea);
 
 		end % }}}
Index: /issm/trunk/src/m/classes/initialization.py
===================================================================
--- /issm/trunk/src/m/classes/initialization.py	(revision 24312)
+++ /issm/trunk/src/m/classes/initialization.py	(revision 24313)
@@ -4,138 +4,147 @@
 from checkfield import checkfield
 from WriteData import WriteData
-import MatlabFuncs as m
+
 
 class initialization(object):
-	"""
-	INITIALIZATION class definition
-	
-	Usage:
-	initialization=initialization();
-	"""
+    """
+    INITIALIZATION class definition
 
-	def __init__(self): # {{{
-					
-		self.vx            = float('NaN')
-		self.vy            = float('NaN')
-		self.vz            = float('NaN')
-		self.vel           = float('NaN')
-		self.pressure      = float('NaN')
-		self.temperature   = float('NaN')
-		self.waterfraction = float('NaN')
-		self.watercolumn   = float('NaN')
-		self.sediment_head = float('NaN')
-		self.epl_head      = float('NaN')
-		self.epl_thickness = float('NaN')
+    Usage:
+    initialization = initialization()
+    """
 
-		#set defaults
-		self.setdefaultparameters()
+    def __init__(self):  # {{{
 
-		#}}}
-	def __repr__(self): # {{{
-		string='   initial field values:'
-		string="%s\n%s"%(string,fielddisplay(self,'vx','x component of velocity [m/yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'vy','y component of velocity [m/yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'vz','z component of velocity [m/yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'vel','velocity norm [m/yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'pressure','pressure [Pa]'))
-		string="%s\n%s"%(string,fielddisplay(self,'temperature','temperature [K]'))
-		string="%s\n%s"%(string,fielddisplay(self,'waterfraction','fraction of water in the ice'))
-		string="%s\n%s"%(string,fielddisplay(self,'watercolumn','thickness of subglacial water [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'sediment_head','sediment water head of subglacial system [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'epl_head','epl water head of subglacial system [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'epl_thickness','thickness of the epl [m]'))
+        self.vx = float('NaN')
+        self.vy = float('NaN')
+        self.vz = float('NaN')
+        self.vel = float('NaN')
+        self.enthalpy = float('NaN')
+        self.pressure = float('NaN')
+        self.temperature = float('NaN')
+        self.waterfraction = float('NaN')
+        self.watercolumn = float('NaN')
+        self.sediment_head = float('NaN')
+        self.epl_head = float('NaN')
+        self.epl_thickness = float('NaN')
 
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		self.vx=project3d(md,'vector',self.vx,'type','node')
-		self.vy=project3d(md,'vector',self.vy,'type','node')
-		self.vz=project3d(md,'vector',self.vz,'type','node')
-		self.vel=project3d(md,'vector',self.vel,'type','node')
-		self.temperature=project3d(md,'vector',self.temperature,'type','node')
-		self.waterfraction=project3d(md,'vector',self.waterfraction,'type','node')
-		self.watercolumn=project3d(md,'vector',self.watercolumn,'type','node')
-		self.sediment_head=project3d(md,'vector',self.sediment_head,'type','node','layer',1)
-		self.epl_head=project3d(md,'vector',self.epl_head,'type','node','layer',1)
-		self.epl_thickness=project3d(md,'vector',self.epl_thickness,'type','node','layer',1)
+    #set defaults
+        self.setdefaultparameters()
 
-		#Lithostatic pressure by default
-		#		self.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface[:,0]-md.mesh.z)
-		#self.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.z.reshape(-1,))
+    #}}}
 
-		if np.ndim(md.geometry.surface)==2:
-			print('Reshaping md.geometry.surface for you convenience but you should fix it in you files')
-			self.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface.reshape(-1,)-md.mesh.z)
-		else:
-			self.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.z)
+    def __repr__(self):  # {{{
+        string = '   initial field values:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'vx', 'x component of velocity [m / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'vy', 'y component of velocity [m / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'vz', 'z component of velocity [m / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'vel', 'velocity norm [m / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'pressure', 'pressure [Pa]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'temperature', 'temperature [K]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'enthalpy', 'enthalpy [J]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'waterfraction', 'fraction of water in the ice'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'watercolumn', 'thickness of subglacial water [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'sediment_head', 'sediment water head of subglacial system [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'epl_head', 'epl water head of subglacial system [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'epl_thickness', 'thickness of the epl [m]'))
 
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		if 'StressbalanceAnalysis' in analyses:
-			if not np.any(np.logical_or(np.isnan(md.initialization.vx),np.isnan(md.initialization.vy))):
-				md = checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-				md = checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		if 'MasstransportAnalysis' in analyses:
-			md = checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-			md = checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		if 'BalancethicknessAnalysis' in analyses:
-			md = checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-			md = checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-			#Triangle with zero velocity
-			if np.any(np.logical_and(np.sum(np.abs(md.initialization.vx[md.mesh.elements-1]),axis=1)==0,\
-			                               np.sum(np.abs(md.initialization.vy[md.mesh.elements-1]),axis=1)==0)):
-				md.checkmessage("at least one triangle has all its vertices with a zero velocity")
-		if 'ThermalAnalysis' in analyses:
-			md = checkfield(md,'fieldname','initialization.vx','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-			md = checkfield(md,'fieldname','initialization.vy','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-			md = checkfield(md,'fieldname','initialization.temperature','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-			if md.mesh.dimension()==3:
-				md = checkfield(md,'fieldname','initialization.vz','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-			md = checkfield(md,'fieldname','initialization.pressure','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-			if ('EnthalpyAnalysis' in analyses and md.thermal.isenthalpy):
-				md = checkfield(md,'fieldname','initialization.waterfraction','>=',0,'size',[md.mesh.numberofvertices])
-				md = checkfield(md,'fieldname','initialization.watercolumn'  ,'>=',0,'size',[md.mesh.numberofvertices])
-				pos = np.nonzero(md.initialization.waterfraction > 0.)[0]
-				if(pos.size):
-					md = checkfield(md,'fieldname', 'delta Tpmp', 'field', np.absolute(md.initialization.temperature[pos]-(md.materials.meltingpoint-md.materials.beta*md.initialization.pressure[pos])),'<',1e-11,	'message','set temperature to pressure melting point at locations with waterfraction>0');
-		if 'HydrologyShreveAnalysis' in analyses:
-			if hasattr(md.hydrology,'hydrologyshreve'):
-				md = checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		if 'HydrologyDCInefficientAnalysis' in analyses:
-			if hasattr(md.hydrology,'hydrologydc'):
-				md = checkfield(md,'fieldname','initialization.sediment_head','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		if 'HydrologyDCEfficientAnalysis' in analyses:
-			if hasattr(md.hydrology,'hydrologydc'):
-				if md.hydrology.isefficientlayer==1:
-					md = checkfield(md,'fieldname','initialization.epl_head','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-					md = checkfield(md,'fieldname','initialization.epl_thickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
+        return string
+    #}}}
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+    def extrude(self, md):  # {{{
+        self.vx = project3d(md, 'vector', self.vx, 'type', 'node')
+        self.vy = project3d(md, 'vector', self.vy, 'type', 'node')
+        self.vz = project3d(md, 'vector', self.vz, 'type', 'node')
+        self.vel = project3d(md, 'vector', self.vel, 'type', 'node')
+        self.temperature = project3d(md, 'vector', self.temperature, 'type', 'node')
+        self.enthalpy = project3d(md, 'vector', self.enthalpy, 'type', 'node')
+        self.waterfraction = project3d(md, 'vector', self.waterfraction, 'type', 'node')
+        self.watercolumn = project3d(md, 'vector', self.watercolumn, 'type', 'node')
+        self.sediment_head = project3d(md, 'vector', self.sediment_head, 'type', 'node', 'layer', 1)
+        self.epl_head = project3d(md, 'vector', self.epl_head, 'type', 'node', 'layer', 1)
+        self.epl_thickness = project3d(md, 'vector', self.epl_thickness, 'type', 'node', 'layer', 1)
 
-		yts=md.constants.yts
+        #Lithostatic pressure by default
+        #        self.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface[:, 0] - md.mesh.z)
+        #self.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface-md.mesh.z.reshape(-1, ))
 
-		WriteData(fid,prefix,'object',self,'fieldname','vx','format','DoubleMat','mattype',1,'scale',1./yts)
-		WriteData(fid,prefix,'object',self,'fieldname','vy','format','DoubleMat','mattype',1,'scale',1./yts)
-		WriteData(fid,prefix,'object',self,'fieldname','vz','format','DoubleMat','mattype',1,'scale',1./yts)
-		WriteData(fid,prefix,'object',self,'fieldname','pressure','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','temperature','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','waterfraction','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','sediment_head','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','epl_head','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','epl_thickness','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','watercolumn','format','DoubleMat','mattype',1)
-		
-		if md.thermal.isenthalpy:
-			tpmp = md.materials.meltingpoint - md.materials.beta*md.initialization.pressure;
-			pos  = np.nonzero(md.initialization.waterfraction > 0.)[0]
-			enthalpy      = md.materials.heatcapacity*(md.initialization.temperature-md.constants.referencetemperature);
-			enthalpy[pos] = md.materials.heatcapacity*(tpmp[pos].reshape(-1,) - md.constants.referencetemperature) + md.materials.latentheat*md.initialization.waterfraction[pos].reshape(-1,)
-			WriteData(fid,prefix,'data',enthalpy,'format','DoubleMat','mattype',1,'name','md.initialization.enthalpy');
+        if np.ndim(md.geometry.surface) == 2:
+            print('Reshaping md.geometry.surface for you convenience but you should fix it in you files')
+            self.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface.reshape(-1, ) - md.mesh.z)
+        else:
+            self.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface - md.mesh.z)
 
-	# }}}
+        return self
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if 'StressbalanceAnalysis' in analyses:
+            if not np.any(np.logical_or(np.isnan(md.initialization.vx), np.isnan(md.initialization.vy))):
+                md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+                md = checkfield(md, 'fieldname', 'initialization.vy', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        if 'MasstransportAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'initialization.vy', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        if 'BalancethicknessAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'initialization.vy', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            #Triangle with zero velocity
+            if np.any(np.logical_and(np.sum(np.abs(md.initialization.vx[md.mesh.elements - 1]), axis=1) == 0,
+                                     np.sum(np.abs(md.initialization.vy[md.mesh.elements - 1]), axis=1) == 0)):
+                md.checkmessage("at least one triangle has all its vertices with a zero velocity")
+        if 'ThermalAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'initialization.vy', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'initialization.temperature', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            if md.mesh.dimension() == 3:
+                md = checkfield(md, 'fieldname', 'initialization.vz', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'initialization.pressure', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            if ('EnthalpyAnalysis' in analyses and md.thermal.isenthalpy):
+                md = checkfield(md, 'fieldname', 'initialization.waterfraction', '>=', 0, 'size', [md.mesh.numberofvertices])
+                md = checkfield(md, 'fieldname', 'initialization.watercolumn', '>=', 0, 'size', [md.mesh.numberofvertices])
+                pos = np.nonzero(md.initialization.waterfraction > 0.)[0]
+                if(pos.size):
+                    md = checkfield(md, 'fieldname', 'delta Tpmp', 'field', np.absolute(md.initialization.temperature[pos] - (md.materials.meltingpoint - md.materials.beta * md.initialization.pressure[pos])), '<', 1e-11, 'message', 'set temperature to pressure melting point at locations with waterfraction > 0')
+        if 'HydrologyShreveAnalysis' in analyses:
+            if hasattr(md.hydrology, 'hydrologyshreve'):
+                md = checkfield(md, 'fieldname', 'initialization.watercolumn', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        if 'HydrologyDCInefficientAnalysis' in analyses:
+            if hasattr(md.hydrology, 'hydrologydc'):
+                md = checkfield(md, 'fieldname', 'initialization.sediment_head', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        if 'HydrologyDCEfficientAnalysis' in analyses:
+            if hasattr(md.hydrology, 'hydrologydc'):
+                if md.hydrology.isefficientlayer == 1:
+                    md = checkfield(md, 'fieldname', 'initialization.epl_head', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+                    md = checkfield(md, 'fieldname', 'initialization.epl_thickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+
+        yts = md.constants.yts
+
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'vx', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'vy', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'vz', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'pressure', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'temperature', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'waterfraction', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'sediment_head', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_head', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'epl_thickness', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'watercolumn', 'format', 'DoubleMat', 'mattype', 1)
+
+        if md.thermal.isenthalpy:
+            if (np.size(self.enthalpy) <= 1):
+                tpmp = md.materials.meltingpoint - md.materials.beta * md.initialization.pressure
+                pos = np.nonzero(md.initialization.waterfraction > 0.)[0]
+                self.enthalpy = md.materials.heatcapacity * (md.initialization.temperature - md.constants.referencetemperature)
+                self.enthalpy[pos] = md.materials.heatcapacity * (tpmp[pos].reshape(-1, ) - md.constants.referencetemperature) + md.materials.latentheat * md.initialization.waterfraction[pos].reshape(-1, )
+
+            WriteData(fid, prefix, 'data', self.enthalpy, 'format', 'DoubleMat', 'mattype', 1, 'name', 'md.initialization.enthalpy')
+    # }}}
Index: /issm/trunk/src/m/classes/inversion.py
===================================================================
--- /issm/trunk/src/m/classes/inversion.py	(revision 24312)
+++ /issm/trunk/src/m/classes/inversion.py	(revision 24313)
@@ -8,185 +8,182 @@
 from marshallcostfunctions import marshallcostfunctions
 
+
 class inversion(object):
-	"""
-	INVERSION class definition
+    """
+    INVERSION class definition
 
-	   Usage:
-	      inversion=inversion()
-	"""
+       Usage:
+          inversion = inversion()
+    """
 
-	def __init__(self): # {{{
-		self.iscontrol                   = 0
-		self.incomplete_adjoint          = 0
-		self.control_parameters          = float('NaN')
-		self.nsteps                      = 0
-		self.maxiter_per_step            = float('NaN')
-		self.cost_functions              = '' 
-		self.cost_functions_coefficients = float('NaN')
-		self.gradient_scaling            = float('NaN')
-		self.cost_function_threshold     = 0
-		self.min_parameters              = float('NaN')
-		self.max_parameters              = float('NaN')
-		self.step_threshold              = float('NaN')
-		self.vx_obs                      = float('NaN')
-		self.vy_obs                      = float('NaN')
-		self.vz_obs                      = float('NaN')
-		self.vel_obs                     = float('NaN')
-		self.thickness_obs               = float('NaN')
-		self.surface_obs                 = float('NaN')
+    def __init__(self):  # {{{
+        self.iscontrol = 0
+        self.incomplete_adjoint = 0
+        self.control_parameters = float('NaN')
+        self.nsteps = 0
+        self.maxiter_per_step = float('NaN')
+        self.cost_functions = ''
+        self.cost_functions_coefficients = float('NaN')
+        self.gradient_scaling = float('NaN')
+        self.cost_function_threshold = 0
+        self.min_parameters = float('NaN')
+        self.max_parameters = float('NaN')
+        self.step_threshold = float('NaN')
+        self.vx_obs = float('NaN')
+        self.vy_obs = float('NaN')
+        self.vz_obs = float('NaN')
+        self.vel_obs = float('NaN')
+        self.thickness_obs = float('NaN')
+        self.surface_obs = float('NaN')
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		string='   inversion parameters:'
-		string="%s\n%s"%(string,fielddisplay(self,'iscontrol','is inversion activated?'))
-		string="%s\n%s"%(string,fielddisplay(self,'incomplete_adjoint','1: linear viscosity, 0: non-linear viscosity'))
-		string="%s\n%s"%(string,fielddisplay(self,'control_parameters','ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}'))
-		string="%s\n%s"%(string,fielddisplay(self,'nsteps','number of optimization searches'))
-		string="%s\n%s"%(string,fielddisplay(self,'cost_functions','indicate the type of response for each optimization step'))
-		string="%s\n%s"%(string,fielddisplay(self,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter'))
-		string="%s\n%s"%(string,fielddisplay(self,'cost_function_threshold','misfit convergence criterion. Default is 1%, NaN if not applied'))
-		string="%s\n%s"%(string,fielddisplay(self,'maxiter_per_step','maximum iterations during each optimization step'))
-		string="%s\n%s"%(string,fielddisplay(self,'gradient_scaling','scaling factor on gradient direction during optimization, for each optimization step'))
-		string="%s\n%s"%(string,fielddisplay(self,'step_threshold','decrease threshold for misfit, default is 30%'))
-		string="%s\n%s"%(string,fielddisplay(self,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex'))
-		string="%s\n%s"%(string,fielddisplay(self,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex'))
-		string="%s\n%s"%(string,fielddisplay(self,'vx_obs','observed velocity x component [m/yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'vy_obs','observed velocity y component [m/yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'vel_obs','observed velocity magnitude [m/yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'thickness_obs','observed thickness [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'surface_obs','observed surface elevation [m]'))
-		string="%s\n%s"%(string,'Available cost functions:')
-		string="%s\n%s"%(string,'   101: SurfaceAbsVelMisfit')
-		string="%s\n%s"%(string,'   102: SurfaceRelVelMisfit')
-		string="%s\n%s"%(string,'   103: SurfaceLogVelMisfit')
-		string="%s\n%s"%(string,'   104: SurfaceLogVxVyMisfit')
-		string="%s\n%s"%(string,'   105: SurfaceAverageVelMisfit')
-		string="%s\n%s"%(string,'   201: ThicknessAbsMisfit')
-		string="%s\n%s"%(string,'   501: DragCoefficientAbsGradient')
-		string="%s\n%s"%(string,'   502: RheologyBbarAbsGradient')
-		string="%s\n%s"%(string,'   503: ThicknessAbsGradient')
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		self.vx_obs=project3d(md,'vector',self.vx_obs,'type','node')
-		self.vy_obs=project3d(md,'vector',self.vy_obs,'type','node')
-		self.vel_obs=project3d(md,'vector',self.vel_obs,'type','node')
-		self.thickness_obs=project3d(md,'vector',self.thickness_obs,'type','node')
-		if not np.any(np.isnan(self.cost_functions_coefficients)):
-			self.cost_functions_coefficients=project3d(md,'vector',self.cost_functions_coefficients,'type','node')
-		if not np.any(np.isnan(self.min_parameters)):
-			self.min_parameters=project3d(md,'vector',self.min_parameters,'type','node')
-		if not np.any(np.isnan(self.max_parameters)):
-			self.max_parameters=project3d(md,'vector',self.max_parameters,'type','node')
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
-		
-		#default is incomplete adjoint for now
-		self.incomplete_adjoint=1
+    #}}}
 
-		#parameter to be inferred by control methods (only
-		#drag and B are supported yet)
-		self.control_parameters='FrictionCoefficient'
+    def __repr__(self):  # {{{
+        string = '   inversion parameters:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'iscontrol', 'is inversion activated?'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'incomplete_adjoint', '1: linear viscosity, 0: non - linear viscosity'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'control_parameters', 'ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'nsteps', 'number of optimization searches'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'cost_functions', 'indicate the type of response for each optimization step'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'cost_functions_coefficients', 'cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'cost_function_threshold', 'misfit convergence criterion. Default is 1%, NaN if not applied'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'maxiter_per_step', 'maximum iterations during each optimization step'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'gradient_scaling', 'scaling factor on gradient direction during optimization, for each optimization step'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'step_threshold', 'decrease threshold for misfit, default is 30%'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'min_parameters', 'absolute minimum acceptable value of the inversed parameter on each vertex'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'max_parameters', 'absolute maximum acceptable value of the inversed parameter on each vertex'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'vx_obs', 'observed velocity x component [m / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'vy_obs', 'observed velocity y component [m / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'vel_obs', 'observed velocity magnitude [m / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'thickness_obs', 'observed thickness [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'surface_obs', 'observed surface elevation [m]'))
+        string = "%s\n%s" % (string, 'Available cost functions:')
+        string = "%s\n%s" % (string, '   101: SurfaceAbsVelMisfit')
+        string = "%s\n%s" % (string, '   102: SurfaceRelVelMisfit')
+        string = "%s\n%s" % (string, '   103: SurfaceLogVelMisfit')
+        string = "%s\n%s" % (string, '   104: SurfaceLogVxVyMisfit')
+        string = "%s\n%s" % (string, '   105: SurfaceAverageVelMisfit')
+        string = "%s\n%s" % (string, '   201: ThicknessAbsMisfit')
+        string = "%s\n%s" % (string, '   501: DragCoefficientAbsGradient')
+        string = "%s\n%s" % (string, '   502: RheologyBbarAbsGradient')
+        string = "%s\n%s" % (string, '   503: ThicknessAbsGradient')
+        return string
+    #}}}
 
-		#number of steps in the control methods
-		self.nsteps=20
+    def extrude(self, md):  # {{{
+        self.vx_obs = project3d(md, 'vector', self.vx_obs, 'type', 'node')
+        self.vy_obs = project3d(md, 'vector', self.vy_obs, 'type', 'node')
+        self.vel_obs = project3d(md, 'vector', self.vel_obs, 'type', 'node')
+        self.thickness_obs = project3d(md, 'vector', self.thickness_obs, 'type', 'node')
+        if not np.any(np.isnan(self.cost_functions_coefficients)):
+            self.cost_functions_coefficients = project3d(md, 'vector', self.cost_functions_coefficients, 'type', 'node')
+        if not np.any(np.isnan(self.min_parameters)):
+            self.min_parameters = project3d(md, 'vector', self.min_parameters, 'type', 'node')
+        if not np.any(np.isnan(self.max_parameters)):
+            self.max_parameters = project3d(md, 'vector', self.max_parameters, 'type', 'node')
+        return self
+    #}}}
 
-		#maximum number of iteration in the optimization algorithm for
-		#each step
-		self.maxiter_per_step=20*np.ones(self.nsteps)
+    def setdefaultparameters(self):  # {{{
 
-		#the inversed parameter is updated as follows:
-		#new_par=old_par + gradient_scaling(n)*C*gradient with C in [0 1];
-		#usually the gradient_scaling must be of the order of magnitude of the 
-		#inversed parameter (10^8 for B, 50 for drag) and can be decreased
-		#after the first iterations
-		self.gradient_scaling=50*np.ones((self.nsteps,1))
+        #default is incomplete adjoint for now
+        self.incomplete_adjoint = 1
+        #parameter to be inferred by control methods (only
+        #drag and B are supported yet)
+        self.control_parameters = 'FrictionCoefficient'
+        #number of steps in the control methods
+        self.nsteps = 20
+        #maximum number of iteration in the optimization algorithm for
+        #each step
+        self.maxiter_per_step = 20 * np.ones(self.nsteps)
+        #the inversed parameter is updated as follows:
+        #new_par = old_par + gradient_scaling(n) * C * gradient with C in [0 1]
+        #usually the gradient_scaling must be of the order of magnitude of the
+        #inversed parameter (1.0e8 for B, 50 for drag) and can be decreased
+        #after the first iterations
+        self.gradient_scaling = 50 * np.ones((self.nsteps, 1))
+        #several responses can be used:
+        self.cost_functions = [101, ]
+        #step_threshold is used to speed up control method. When
+        #misfit(1) / misfit(0) < self.step_threshold, we go directly to
+        #the next step
+        self.step_threshold = 0.7 * np.ones(self.nsteps)  #30 per cent decrement
+        #cost_function_threshold is a criteria to stop the control methods.
+        #if J[n] - J[n - 1] / J[n] < criteria, the control run stops
+        #NaN if not applied
+        self.cost_function_threshold = float('NaN')  #not activated
 
-		#several responses can be used:
-		self.cost_functions=[101,]
+        return self
+    #}}}
 
-		#step_threshold is used to speed up control method. When
-		#misfit(1)/misfit(0) < self.step_threshold, we go directly to
-		#the next step
-		self.step_threshold=.7*np.ones(self.nsteps) #30 per cent decrement
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if not self.iscontrol:
+            return md
 
-		#cost_function_threshold is a criteria to stop the control methods.
-		#if J[n]-J[n-1]/J[n] < criteria, the control run stops
-		#NaN if not applied
-		self.cost_function_threshold=float('NaN')    #not activated 
+        num_controls = np.size(md.inversion.control_parameters)
+        num_costfunc = np.size(md.inversion.cost_functions)
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+        md = checkfield(md, 'fieldname', 'inversion.iscontrol', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'inversion.incomplete_adjoint', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'inversion.control_parameters', 'cell', 1, 'values', supportedcontrols())
+        md = checkfield(md, 'fieldname', 'inversion.nsteps', 'numel', [1], '>=', 0)
+        md = checkfield(md, 'fieldname', 'inversion.maxiter_per_step', 'size', [md.inversion.nsteps], '>=', 0)
+        md = checkfield(md, 'fieldname', 'inversion.step_threshold', 'size', [md.inversion.nsteps])
+        md = checkfield(md, 'fieldname', 'inversion.cost_functions', 'size', [num_costfunc], 'values', supportedcostfunctions())
+        md = checkfield(md, 'fieldname', 'inversion.cost_functions_coefficients', 'size', [md.mesh.numberofvertices, num_costfunc], '>=', 0)
+        md = checkfield(md, 'fieldname', 'inversion.gradient_scaling', 'size', [md.inversion.nsteps, num_controls])
+        md = checkfield(md, 'fieldname', 'inversion.min_parameters', 'size', [md.mesh.numberofvertices, num_controls])
+        md = checkfield(md, 'fieldname', 'inversion.max_parameters', 'size', [md.mesh.numberofvertices, num_controls])
 
-		#Early return
-		if not self.iscontrol:
-			return md
+    #Only SSA, HO and FS are supported right now
+        if solution == 'StressbalanceSolution':
+            if not (md.flowequation.isSSA or md.flowequation.isHO or md.flowequation.isFS or md.flowequation.isL1L2):
+                md.checkmessage("'inversion can only be performed for SSA, HO or FS ice flow models")
 
-		num_controls=np.size(md.inversion.control_parameters)
-		num_costfunc=np.size(md.inversion.cost_functions)
+        if solution == 'BalancethicknessSolution':
+            md = checkfield(md, 'fieldname', 'inversion.thickness_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+        else:
+            md = checkfield(md, 'fieldname', 'inversion.vx_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'inversion.vy_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
 
-		md = checkfield(md,'fieldname','inversion.iscontrol','values',[0,1])
-		md = checkfield(md,'fieldname','inversion.incomplete_adjoint','values',[0,1])
-		md = checkfield(md,'fieldname','inversion.control_parameters','cell',1,'values',supportedcontrols())
-		md = checkfield(md,'fieldname','inversion.nsteps','numel',[1],'>=',0)
-		md = checkfield(md,'fieldname','inversion.maxiter_per_step','size',[md.inversion.nsteps],'>=',0)
-		md = checkfield(md,'fieldname','inversion.step_threshold','size',[md.inversion.nsteps])
-		md = checkfield(md,'fieldname','inversion.cost_functions','size',[num_costfunc],'values',supportedcostfunctions())
-		md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices,num_costfunc],'>=',0)
-		md = checkfield(md,'fieldname','inversion.gradient_scaling','size',[md.inversion.nsteps,num_controls])
-		md = checkfield(md,'fieldname','inversion.min_parameters','size',[md.mesh.numberofvertices,num_controls])
-		md = checkfield(md,'fieldname','inversion.max_parameters','size',[md.mesh.numberofvertices,num_controls])
+        return md
+    # }}}
 
-		#Only SSA, HO and FS are supported right now
-		if solution=='StressbalanceSolution':
-			if not (md.flowequation.isSSA or md.flowequation.isHO or md.flowequation.isFS or md.flowequation.isL1L2):
-				md.checkmessage("'inversion can only be performed for SSA, HO or FS ice flow models");
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
 
-		if solution=='BalancethicknessSolution':
-			md = checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
-		else:
-			md = checkfield(md,'fieldname','inversion.vx_obs','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
-			md = checkfield(md,'fieldname','inversion.vy_obs','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
+        WriteData(fid, prefix, 'name', 'md.inversion.type', 'data', 0, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'iscontrol', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'incomplete_adjoint', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'vel_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+        if not self.iscontrol:
+            return
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'nsteps', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter_per_step', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'cost_functions_coefficients', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'gradient_scaling', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'cost_function_threshold', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'min_parameters', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'max_parameters', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'step_threshold', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'vx_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'vy_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'vz_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness_obs', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'surface_obs', 'format', 'DoubleMat', 'mattype', 1)
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+    #process control parameters
+        num_control_parameters = len(self.control_parameters)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'control_parameters', 'format', 'StringArray')
+        WriteData(fid, prefix, 'data', num_control_parameters, 'name', 'md.inversion.num_control_parameters', 'format', 'Integer')
 
-		yts=md.constants.yts
-
-		WriteData(fid,prefix,'name','md.inversion.type','data',0,'format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','iscontrol','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','incomplete_adjoint','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','vel_obs','format','DoubleMat','mattype',1,'scale',1./yts)
-		if not self.iscontrol:
-			return
-		WriteData(fid,prefix,'object',self,'fieldname','nsteps','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','maxiter_per_step','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','gradient_scaling','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'fieldname','cost_function_threshold','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','min_parameters','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'fieldname','max_parameters','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'fieldname','step_threshold','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts)
-		WriteData(fid,prefix,'object',self,'fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts)
-		WriteData(fid,prefix,'object',self,'fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts)
-		WriteData(fid,prefix,'object',self,'fieldname','thickness_obs','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','surface_obs','format','DoubleMat','mattype',1)
-
-		#process control parameters
-		num_control_parameters=len(self.control_parameters)
-		WriteData(fid,prefix,'object',self,'fieldname','control_parameters','format','StringArray')
-		WriteData(fid,prefix,'data',num_control_parameters,'name','md.inversion.num_control_parameters','format','Integer')
-
-		#process cost functions
-		num_cost_functions=np.size(self.cost_functions)
-		data=marshallcostfunctions(self.cost_functions)
-		WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','StringArray')
-		WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer')
-	# }}}
+    #process cost functions
+        num_cost_functions = np.size(self.cost_functions)
+        data = marshallcostfunctions(self.cost_functions)
+        WriteData(fid, prefix, 'data', data, 'name', 'md.inversion.cost_functions', 'format', 'StringArray')
+        WriteData(fid, prefix, 'data', num_cost_functions, 'name', 'md.inversion.num_cost_functions', 'format', 'Integer')
+    # }}}
Index: /issm/trunk/src/m/classes/issmsettings.m
===================================================================
--- /issm/trunk/src/m/classes/issmsettings.m	(revision 24312)
+++ /issm/trunk/src/m/classes/issmsettings.m	(revision 24313)
@@ -6,8 +6,9 @@
 classdef issmsettings
 	properties (SetAccess=public) 
-		results_on_nodes    = 0;
+		results_on_nodes    = {};
 		io_gather           = 0;
 		lowmem              = 0;
 		output_frequency    = 0;
+		sb_coupling_frequency   = 0;
 		recording_frequency   = 0;
 		waitonlock          = 0;
@@ -39,4 +40,7 @@
 			self.output_frequency=1;
 
+			%coupling frequency of the stress balance solver by default every step
+			self.sb_coupling_frequency=1;
+			
 			%checkpoints frequency, by default never: 
 			self.recording_frequency=0;
@@ -57,8 +61,9 @@
 		function md = checkconsistency(self,md,solution,analyses) % {{{
 
-			md = checkfield(md,'fieldname','settings.results_on_nodes','numel',[1],'values',[0 1]);
+			md = checkfield(md,'fieldname','settings.results_on_nodes','stringrow',1);
 			md = checkfield(md,'fieldname','settings.io_gather','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','settings.lowmem','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','settings.output_frequency','numel',[1],'>=',1);
+			md = checkfield(md,'fieldname','settings.sb_coupling_frequency','numel',[1],'>=',1);
 			md = checkfield(md,'fieldname','settings.recording_frequency','numel',[1],'>=',0);
 			md = checkfield(md,'fieldname','settings.waitonlock','numel',[1]);
@@ -69,8 +74,9 @@
 			disp(sprintf('   general issmsettings parameters:'));
 
-			fielddisplay(self,'results_on_nodes','results are output for all the nodes of each element');
+			fielddisplay(self,'results_on_nodes','list of output for which results will be output for all the nodes of each element, Use ''all'' for all output on nodes.');
 			fielddisplay(self,'io_gather','I/O gathering strategy for result outputs (default 1)');
 			fielddisplay(self,'lowmem','is the memory limited ? (0 or 1)');
 			fielddisplay(self,'output_frequency','frequency at which results are saved in all solutions with multiple time_steps');
+			fielddisplay(self,'sb_coupling_frequency','frequency at which StressBalance solver is coupled (default 1)');
 			fielddisplay(self,'recording_frequency','frequency at which the runs are being recorded, allowing for a restart');
 			fielddisplay(self,'waitonlock','maximum number of minutes to wait for batch results (NaN to deactivate)');
@@ -84,8 +90,9 @@
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
-			WriteData(fid,prefix,'object',self,'class','settings','fieldname','results_on_nodes','format','Boolean');
+			WriteData(fid,prefix,'data',self.results_on_nodes,'name','md.settings.results_on_nodes','format','StringArray');
 			WriteData(fid,prefix,'object',self,'class','settings','fieldname','io_gather','format','Boolean');
 			WriteData(fid,prefix,'object',self,'class','settings','fieldname','lowmem','format','Boolean');
 			WriteData(fid,prefix,'object',self,'class','settings','fieldname','output_frequency','format','Integer');
+			WriteData(fid,prefix,'object',self,'class','settings','fieldname','sb_coupling_frequency','format','Integer');
 			WriteData(fid,prefix,'object',self,'class','settings','fieldname','recording_frequency','format','Integer');
 			WriteData(fid,prefix,'object',self,'class','settings','fieldname','waitonlock','data',self.waitonlock>0,'format','Boolean');
@@ -94,8 +101,9 @@
 		function savemodeljs(self,fid,modelname) % {{{
 		
-			writejsdouble(fid,[modelname '.settings.results_on_nodes'],self.results_on_nodes);
+			writejscellstring(fid,[modelname '.settings.results_on_nodes'],self.results_on_nodes);
 			writejsdouble(fid,[modelname '.settings.io_gather'],self.io_gather);
 			writejsdouble(fid,[modelname '.settings.lowmem'],self.lowmem);
 			writejsdouble(fid,[modelname '.settings.output_frequency'],self.output_frequency);
+			writejsdouble(fid,[modelname '.settings.sb_coupling_frequency'],self.sb_coupling_frequency);
 			writejsdouble(fid,[modelname '.settings.recording_frequency'],self.recording_frequency);
 			writejsdouble(fid,[modelname '.settings.waitonlock'],self.waitonlock);
Index: /issm/trunk/src/m/classes/issmsettings.py
===================================================================
--- /issm/trunk/src/m/classes/issmsettings.py	(revision 24312)
+++ /issm/trunk/src/m/classes/issmsettings.py	(revision 24313)
@@ -3,85 +3,89 @@
 from WriteData import WriteData
 
+
 class issmsettings(object):
-	"""
-	ISSMSETTINGS class definition
+    """
+    ISSMSETTINGS class definition
 
-	   Usage:
-	      issmsettings=issmsettings();
-	"""
+       Usage:
+          issmsettings = issmsettings()
+    """
 
-	def __init__(self): # {{{
-		self.results_on_nodes    = 0
-		self.io_gather           = 0
-		self.lowmem              = 0
-		self.output_frequency    = 0
-		self.recording_frequency = 0
-		self.waitonlock          = 0
-		self.solver_residue_threshold = 0
+    def __init__(self):  # {{{
+        self.results_on_nodes = []
+        self.io_gather = 0
+        self.lowmem = 0
+        self.output_frequency = 0
+        self.coupling_frequency = 0
+        self.recording_frequency = 0
+        self.waitonlock = 0
+        self.solver_residue_threshold = 0
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		string="   general issmsettings parameters:"
+    #}}}
 
-		string="%s\n%s"%(string,fielddisplay(self,"results_on_nodes","results are output for all the nodes of each element"))
-		string="%s\n%s"%(string,fielddisplay(self,"io_gather","I/O gathering strategy for result outputs (default 1)"))
-		string="%s\n%s"%(string,fielddisplay(self,"lowmem","is the memory limited ? (0 or 1)"))
-		string="%s\n%s"%(string,fielddisplay(self,"output_frequency","frequency at which results are saved in all solutions with multiple time_steps"))
-		string="%s\n%s"%(string,fielddisplay(self,"recording_frequency","frequency at which the runs are being recorded, allowing for a restart"))
-		string="%s\n%s"%(string,fielddisplay(self,"waitonlock","maximum number of minutes to wait for batch results, or return 0"))
-		string="%s\n%s"%(string,fielddisplay(self,"solver_residue_threshold","throw an error if solver residue exceeds this value (NaN to deactivate)"))
-		return string
-		#}}}
-	def setdefaultparameters(self): # {{{
-		
-		#are we short in memory ? (0 faster but requires more memory)
-		self.lowmem=0
+    def __repr__(self):  # {{{
+        string = "   general issmsettings parameters:"
 
-		#i/o:
-		self.io_gather=1
+        string = "%s\n%s" % (string, fielddisplay(self, "results_on_nodes", "list of output for which results will be output for all the nodes of each element, Use 'all' for all output on nodes."))
+        string = "%s\n%s" % (string, fielddisplay(self, "io_gather", "I / O gathering strategy for result outputs (default 1)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "lowmem", "is the memory limited ? (0 or 1)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "output_frequency", "frequency at which results are saved in all solutions with multiple time_steps"))
+        string = "%s\n%s" % (string, fielddisplay(self, "sb_coupling_frequency", "frequency at which StressBalance solver is coupled (default 1)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "recording_frequency", "frequency at which the runs are being recorded, allowing for a restart"))
+        string = "%s\n%s" % (string, fielddisplay(self, "waitonlock", "maximum number of minutes to wait for batch results, or return 0"))
+        string = "%s\n%s" % (string, fielddisplay(self, "solver_residue_threshold", "throw an error if solver residue exceeds this value (NaN to deactivate)"))
+        return string
+    #}}}
 
-		#results frequency by default every step
-		self.output_frequency=1
+    def setdefaultparameters(self):  # {{{
+        #are we short in memory ? (0 faster but requires more memory)
+        self.lowmem = 0
+        #i / o:
+        self.io_gather = 1
+        #results frequency by default every step
+        self.output_frequency = 1
+        #coupling frequency of the stress balance solver by default every step
+        self.sb_coupling_frequency = 1
+        #checkpoints frequency, by default never:
+        self.recording_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
+        self.solver_residue_threshold = 1e-6
 
-		#checkpoints frequency, by default never: 
-		self.recording_frequency=0
+        return self
+    #}}}
 
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        md = checkfield(md, 'fieldname', 'settings.results_on_nodes', 'stringrow', 1)
+        md = checkfield(md, 'fieldname', 'settings.io_gather', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'settings.lowmem', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'settings.output_frequency', 'numel', [1], '>=', 1)
+        md = checkfield(md, 'fieldname', 'settings.sb_coupling_frequency', 'numel', [1], '>=', 1)
+        md = checkfield(md, 'fieldname', 'settings.recording_frequency', 'numel', [1], '>=', 0)
+        md = checkfield(md, 'fieldname', 'settings.waitonlock', 'numel', [1])
+        md = checkfield(md, 'fieldname', 'settings.solver_residue_threshold', 'numel', [1], '>', 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
+        return md
+    # }}}
 
-      #throw an error if solver residue exceeds this value
-		self.solver_residue_threshold=1e-6;
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'data', self.results_on_nodes, 'name', 'md.settings.results_on_nodes', 'format', 'StringArray')
+        WriteData(fid, prefix, 'object', self, 'class', 'settings', 'fieldname', 'io_gather', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'settings', 'fieldname', 'lowmem', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'settings', 'fieldname', 'output_frequency', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'settings', 'fieldname', 'sb_coupling_frequency', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'settings', 'fieldname', 'recording_frequency', 'format', 'Integer')
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		md = checkfield(md,'fieldname','settings.results_on_nodes','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','settings.io_gather','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','settings.lowmem','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','settings.output_frequency','numel',[1],'>=',1)
-		md = checkfield(md,'fieldname','settings.recording_frequency','numel',[1],'>=',0)
-		md = checkfield(md,'fieldname','settings.waitonlock','numel',[1])
-		md = checkfield(md,'fieldname','settings.solver_residue_threshold','numel',[1],'>',0)
-
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'object',self,'class','settings','fieldname','results_on_nodes','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','settings','fieldname','io_gather','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','settings','fieldname','lowmem','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','settings','fieldname','output_frequency','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','settings','fieldname','recording_frequency','format','Integer')
-		
-		if self.waitonlock>0:
-			WriteData(fid,prefix,'name','md.settings.waitonlock','data',True,'format','Boolean')
-		else:
-			WriteData(fid,prefix,'name','md.settings.waitonlock','data',False,'format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','solver_residue_threshold','format','Double')
-	# }}}
+        if self.waitonlock > 0:
+            WriteData(fid, prefix, 'name', 'md.settings.waitonlock', 'data', True, 'format', 'Boolean')
+        else:
+            WriteData(fid, prefix, 'name', 'md.settings.waitonlock', 'data', False, 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'solver_residue_threshold', 'format', 'Double')
+    # }}}
Index: /issm/trunk/src/m/classes/levelset.js
===================================================================
--- /issm/trunk/src/m/classes/levelset.js	(revision 24312)
+++ /issm/trunk/src/m/classes/levelset.js	(revision 24313)
@@ -21,8 +21,8 @@
 
 	}// }}}
-    this.extrude = function(md) {//{{{
-        this.spclevelset=project3d(md,'vector',this.spclevelset,'type','node');
-        return this;
-    }//}}}
+	this.extrude = function(md) {//{{{
+		this.spclevelset=project3d(md,'vector',this.spclevelset,'type','node');
+		return this;
+	}//}}}
 	this.classname= function(){// {{{
 		return "levelset";
@@ -41,7 +41,7 @@
 
 	}//}}}
-		this.fix=function() { //{{{
-			this.spclevelset=NullFix(this.spclevelset,NaN);
-		}//}}}
+	this.fix=function() { //{{{
+		this.spclevelset=NullFix(this.spclevelset,NaN);
+	}//}}}
 	//properties 
 	// {{{
Index: /issm/trunk/src/m/classes/levelset.m
===================================================================
--- /issm/trunk/src/m/classes/levelset.m	(revision 24312)
+++ /issm/trunk/src/m/classes/levelset.m	(revision 24313)
@@ -9,4 +9,5 @@
 		spclevelset			= NaN;
 		reinit_frequency	= 5;
+		kill_icebergs     = 0;
 		calving_max       = 0.;
 		fe                = 'P1';
@@ -40,4 +41,5 @@
 			self.stabilization    = 1;
 			self.reinit_frequency = 5;
+			self.kill_icebergs    = 1;
 			self.calving_max      = 3000.;
 
@@ -52,4 +54,5 @@
 			md = checkfield(md,'fieldname','levelset.spclevelset','Inf',1,'timeseries',1);
 			md = checkfield(md,'fieldname','levelset.stabilization','values',[0 1 2]);
+			md = checkfield(md,'fieldname','levelset.kill_icebergs','numel',1,'values',[0 1]);
 			md = checkfield(md,'fieldname','levelset.calving_max','numel',1,'NaN',1,'Inf',1,'>',0);
 			md = checkfield(md,'fieldname','levelset.fe','values',{'P1','P2'});
@@ -60,4 +63,5 @@
 			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,'calving_max','maximum allowed calving rate (m/a)');
 			fielddisplay(self,'fe','Finite Element type: ''P1'' (default), or ''P2''');
@@ -70,14 +74,14 @@
 			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','reinit_frequency','format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','kill_icebergs','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','calving_max','format','Double','scale',1./yts);
 			WriteData(fid,prefix,'object',self,'fieldname','fe','format','String');
 		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
-		
 			writejsdouble(fid,[modelname '.levelset.stabilization'],self.stabilization);
 			writejs1Darray(fid,[modelname '.levelset.spclevelset'],self.spclevelset);
 			writejs1Darray(fid,[modelname '.levelset.reinit_frequency'],self.reinit_frequency);
+			writejsdouble(fid,[modelname '.levelset.kill_icebergs'],self.kill_icebergs);
 			writejsdouble(fid,[modelname '.levelset.calving_max'],self.calving_max);
-
 		end % }}}
 	end
Index: /issm/trunk/src/m/classes/levelset.py
===================================================================
--- /issm/trunk/src/m/classes/levelset.py	(revision 24312)
+++ /issm/trunk/src/m/classes/levelset.py	(revision 24313)
@@ -4,71 +4,78 @@
 from WriteData import WriteData
 
+
 class levelset(object):
-	"""
-	LEVELSET class definition
+    """
+    LEVELSET class definition
 
-	   Usage:
-	      levelset=levelset();
-	"""
+       Usage:
+          levelset = levelset()
+    """
 
-	def __init__(self): # {{{
+    def __init__(self):  # {{{
 
-		self.stabilization    = 0
-		self.spclevelset      = float('NaN')
-		self.reinit_frequency = 0
-		self.calving_max      = 0.
-                self.fe               = 'P1'
+        self.stabilization = 0
+        self.spclevelset = float('NaN')
+        self.reinit_frequency = 0
+        self.kill_icebergs = 0
+        self.calving_max = 0.
+        self.fe = 'P1'
 
-		#set defaults
-		self.setdefaultparameters()
+    #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,'calving_max','maximum allowed calving rate (m/a)'))
-                string="%s\n%s"%(string,fielddisplay(self,'fe','Finite Element type: ''P1'' (default), or ''P2'''))
+    #}}}
+    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, 'calving_max', 'maximum allowed calving rate (m / a)'))
+        string = "%s\n%s" % (string, 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
-	#}}}
-	def setdefaultparameters(self): # {{{
+        return string
+    #}}}
 
-		#stabilization = 1 by default
-		self.stabilization = 1
-		self.reinit_frequency = 5
-		self.calving_max      = 3000.
+    def extrude(self, md):  # {{{
+        self.spclevelset = project3d(md, 'vector', self.spclevelset, 'type', 'node')
+        return self
+    #}}}
 
-                #Linear elements by default
-                self.fe='P1'
+    def setdefaultparameters(self):  # {{{
+        #stabilization = 1 by default
+        self.stabilization = 1
+        self.reinit_frequency = 5
+        self.kill_icebergs = 1
+        self.calving_max = 3000.
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+    #Linear elements by default
+        self.fe = 'P1'
 
-		#Early return
-		if (solution!='TransientSolution') or (not md.transient.ismovingfront):
-			return md
+        return self
+    #}}}
 
-		md = checkfield(md,'fieldname','levelset.spclevelset','Inf',1,'timeseries',1)
-		md = checkfield(md,'fieldname','levelset.stabilization','values',[0,1,2]);
-		md = checkfield(md,'fieldname','levelset.calving_max','NaN',1,'Inf',1,'>',0);
-                md = checkfield(md,'fieldname','levelset.fe','values',['P1','P2']);
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if (solution != 'TransientSolution') or (not md.transient.ismovingfront):
+            return md
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+        md = checkfield(md, 'fieldname', 'levelset.spclevelset', 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'levelset.stabilization', 'numel', [1], 'values', [0, 1, 2])
+        md = checkfield(md, 'fieldname', 'levelset.kill_icebergs', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'levelset.calving_max', 'numel', [1], 'NaN', 1, 'Inf', 1, '>', 0)
+        md = checkfield(md, 'fieldname', 'levelset.fe', 'values', ['P1', 'P2'])
 
-		yts=md.constants.yts;
+        return md
+    # }}}
 
-		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','reinit_frequency','format','Integer');
-		WriteData(fid,prefix,'object',self,'fieldname','calving_max','format','Double','scale',1./yts);
-                WriteData(fid,prefix,'object',self,'fieldname','fe','format','String');
-	# }}}
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
+
+        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', yts)
+        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', 'calving_max', 'format', 'Double', 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'fe', 'format', 'String')
+    # }}}
Index: /issm/trunk/src/m/classes/linearbasalforcings.m
===================================================================
--- /issm/trunk/src/m/classes/linearbasalforcings.m	(revision 24312)
+++ /issm/trunk/src/m/classes/linearbasalforcings.m	(revision 24313)
@@ -6,8 +6,9 @@
 classdef linearbasalforcings
 	properties (SetAccess=public) 
-		groundedice_melting_rate  = NaN;
 		deepwater_melting_rate    = 0.;
+		upperwater_melting_rate   = 0.;
 		deepwater_elevation       = 0.;
 		upperwater_elevation      = 0.;
+		groundedice_melting_rate  = NaN;
 		geothermalflux            = NaN;
 	end
@@ -38,7 +39,8 @@
 
 			%default values for melting parameterization
-			self.deepwater_melting_rate = 50;
-			self.deepwater_elevation    = -800;
-			self.upperwater_elevation   = -400;
+			self.deepwater_melting_rate = 50.;
+			self.upperwater_melting_rate = 0.;
+			self.deepwater_elevation    = -800.;
+			self.upperwater_elevation   = -400.;
 
 		end % }}}
@@ -48,4 +50,5 @@
 				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
 				md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'singletimeseries',1);
+				md = checkfield(md,'fieldname','basalforcings.upperwater_melting_rate','>=',0,'singletimeseries',1);
 				md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','singletimeseries',1);
 				md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<=',0,'singletimeseries',1);
@@ -54,4 +57,5 @@
 				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
 				md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'singletimeseries',1);
+				md = checkfield(md,'fieldname','basalforcings.upperwater_melting_rate','>=',0,'singletimeseries',1);
 				md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','singletimeseries',1);
 				md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<=',0,'singletimeseries',1);
@@ -60,4 +64,5 @@
 				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1);
 				md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'singletimeseries',1);
+				md = checkfield(md,'fieldname','basalforcings.upperwater_melting_rate','>=',0,'singletimeseries',1);
 				md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','singletimeseries',1);
 				md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<=',0,'singletimeseries',1);
@@ -68,8 +73,9 @@
 			disp(sprintf('   basal forcings parameters:'));
 
-			fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) [m/yr]');
 			fielddisplay(self,'deepwater_melting_rate','basal melting rate (positive if melting applied for floating ice whith base < deepwater_elevation) [m/yr]');
 			fielddisplay(self,'deepwater_elevation','elevation of ocean deepwater [m]');
+			fielddisplay(self,'upperwater_melting_rate','basal melting rate (positive if melting applied for floating ice whith base >= upperwater_elevation) [m/yr]');
 			fielddisplay(self,'upperwater_elevation','elevation of ocean upperwater [m]');
+			fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) [m/yr]');
 			fielddisplay(self,'geothermalflux','geothermal heat flux [W/m^2]');
 
@@ -84,4 +90,5 @@
 			WriteData(fid,prefix,'object',self,'fieldname','deepwater_melting_rate','format','DoubleMat','mattype',3,'timeserieslength',2,'name','md.basalforcings.deepwater_melting_rate','scale',1./yts,'yts',md.constants.yts)
 			WriteData(fid,prefix,'object',self,'fieldname','deepwater_elevation','format','DoubleMat','mattype',3,'name','md.basalforcings.deepwater_elevation','yts',md.constants.yts)
+			WriteData(fid,prefix,'object',self,'fieldname','upperwater_melting_rate','format','DoubleMat','mattype',3,'timeserieslength',2,'name','md.basalforcings.upperwater_melting_rate','scale',1./yts,'yts',md.constants.yts)
 			WriteData(fid,prefix,'object',self,'fieldname','upperwater_elevation','format','DoubleMat','mattype',3,'name','md.basalforcings.upperwater_elevation','yts',md.constants.yts)
 		end % }}}
Index: /issm/trunk/src/m/classes/linearbasalforcings.py
===================================================================
--- /issm/trunk/src/m/classes/linearbasalforcings.py	(revision 24312)
+++ /issm/trunk/src/m/classes/linearbasalforcings.py	(revision 24313)
@@ -4,97 +4,104 @@
 import numpy as np
 
+
 class linearbasalforcings(object):
-	"""
-	LINEAR BASAL FORCINGS class definition
+    """
+    LINEAR BASAL FORCINGS class definition
 
-	   Usage:
-	      basalforcings=linearbasalforcings();
-	"""
+       Usage:
+          basalforcings = linearbasalforcings()
+    """
 
-	def __init__(self,*args): # {{{
+    def __init__(self, *args):  # {{{
 
-		if not len(args):
-			print 'empty init'
-			self.groundedice_melting_rate  = float('NaN')
-			self.deepwater_melting_rate    = 0.
-			self.deepwater_elevation       = 0.
-			self.upperwater_elevation      = 0.
-			self.geothermalflux            = float('NaN')
+        if not len(args):
+            print('empty init')
+            self.groundedice_melting_rate = float('NaN')
+            self.deepwater_melting_rate = 0.
+            self.deepwater_elevation = 0.
+            self.upperwater_melting_rate = 0.
+            self.upperwater_elevation = 0.
+            self.geothermalflux = float('NaN')
 
-			#set defaults
-			self.setdefaultparameters()
-		elif len(args)==1 and args[0].__module__=='basalforcings':
-			print 'converting basalforings to linearbasalforcings'
-			inv=args[0]
-			self.groundedice_melting_rate  = inv.groundedice_melting_rate
-			self.geothermalflux            = inv.geothermalflux
-			self.deepwater_melting_rate    = 0.
-			self.deepwater_elevation       = 0.
-			self.upperwater_elevation      = 0.
+    #set defaults
+            self.setdefaultparameters()
+        elif len(args) == 1 and args[0].__module__ == 'basalforcings':
+            print('converting basalforings to linearbasalforcings')
+            inv = args[0]
+            self.groundedice_melting_rate = inv.groundedice_melting_rate
+            self.geothermalflux = inv.geothermalflux
+            self.deepwater_melting_rate = 0.
+            self.deepwater_elevation = 0.
+            self.upperwater_melting_rate = 0.
+            self.upperwater_elevation = 0.
 
-			#set defaults
-			self.setdefaultparameters()
-		else:
-			raise Exception('constructor not supported')
+    #set defaults
+            self.setdefaultparameters()
+        else:
+            raise Exception('constructor not supported')
+    #}}}
 
-		#}}}
-	def __repr__(self): # {{{
-		string="   linear basal forcings parameters:"
+    def __repr__(self):  # {{{
+        string = "   linear basal forcings parameters:"
+        string = "%s\n%s" % (string, fielddisplay(self, "deepwater_melting_rate", "basal melting rate (positive if melting applied for floating ice whith base < deepwater_elevation) [m/yr]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "deepwater_elevation", "elevation of ocean deepwater [m]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "upperwater_melting_rate", "upper melting rate (positive if melting applied for floating ice whith base >= upperwater_elevation) [m/yr]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "upperwater_elevation", "elevation of ocean upper water [m]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "groundedice_melting_rate", "basal melting rate (positive if melting) [m/yr]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "geothermalflux", "geothermal heat flux [W/m^2]"))
+        return string
+    #}}}
 
-		string="%s\n%s"%(string,fielddisplay(self,"groundedice_melting_rate","basal melting rate (positive if melting) [m/yr]"))
-		string="%s\n%s"%(string,fielddisplay(self,"deepwater_melting_rate","basal melting rate (positive if melting applied for floating ice whith base < deepwater_elevation) [m/yr]"))
-		string="%s\n%s"%(string,fielddisplay(self,"deepwater_elevation","elevation of ocean deepwater [m]"))
-		string="%s\n%s"%(string,fielddisplay(self,"upperwater_elevation","elevation of ocean upper water [m]"))
-		string="%s\n%s"%(string,fielddisplay(self,"geothermalflux","geothermal heat flux [W/m^2]"))
-		return string
-		#}}}
-	def initialize(self,md): # {{{
+    def initialize(self, md):  # {{{
+        if np.all(np.isnan(self.groundedice_melting_rate)):
+            self.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices))
+            print("      no basalforcings.groundedice_melting_rate specified: values set as zero")
+        return self
+    #}}}
 
-		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"
+    def setdefaultparameters(self):  # {{{
+        self.deepwater_melting_rate = 50.0
+        self.deepwater_elevation = -800.0
+        self.upperwater_melting_rate = 0.0
+        self.upperwater_elevation = -400.0
 
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
+        return self
+    #}}}
 
-		self.deepwater_melting_rate   = 50.0
-		self.deepwater_elevation      = -800.0
-		self.upperwater_elevation     = -400.0
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if 'MasstransportAnalysis' in analyses and not (solution == 'TransientSolution' and not md.transient.ismasstransport):
+            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_melting_rate', '>=', 0, 'singletimeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_melting_rate', '>=', 0, 'singletimeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_elevation', '<', 'basalforcings.upperwater_elevation', 'singletimeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_elevation', '<=', 0, 'singletimeseries', 1)
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+        if 'BalancethicknessAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_melting_rate', '>=', 0, 'singletimeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_melting_rate', '>=', 0, 'singletimeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_elevation', '<', 'basalforcings.upperwater_elevation', 'singletimeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_elevation', '<=', 0, 'singletimeseries', 1)
 
-		if 'MasstransportAnalysis' in analyses and not (solution=='TransientSolution' and not md.transient.ismasstransport):
-			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1)
-			md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'singletimeseries',1)
-			md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','singletimeseries',1)
-			md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<=',0,'singletimeseries',1)
+        if 'ThermalAnalysis' in analyses and not (solution == 'TransientSolution' and not md.transient.isthermal):
+            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_melting_rate', '>=', 0, 'singletimeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_melting_rate', '>=', 0, 'singletimeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.deepwater_elevation', '<', 'basalforcings.upperwater_elevation', 'singletimeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.upperwater_elevation', '<=', 0, 'singletimeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.geothermalflux', 'NaN', 1, 'Inf', 1, 'timeseries', 1, '>=', 0)
 
-		if 'BalancethicknessAnalysis' in analyses:
-			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-			md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'singletimeseries',1)
-			md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','singletimeseries',1)
-			md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<=',0,'singletimeseries',1)
+        return md
+    # }}}
 
-		if 'ThermalAnalysis' in analyses and not (solution=='TransientSolution' and not md.transient.isthermal):
-			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1)
-			md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'singletimeseries',1)
-			md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','singletimeseries',1)
-			md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<=',0,'singletimeseries',1)
-			md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'timeseries',1,'>=',0)
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-
-		yts=md.constants.yts
-
-		WriteData(fid,prefix,'name','md.basalforcings.model','data',2,'format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','name','md.basalforcings.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','geothermalflux','name','md.basalforcings.geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'fieldname','deepwater_melting_rate','format','DoubleMat','mattype',3,'timeserieslength',2,'name','md.basalforcings.deepwater_melting_rate','scale',1./yts,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'fieldname','deepwater_elevation','format','DoubleMat','mattype',3,'name','md.basalforcings.deepwater_elevation','yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'fieldname','upperwater_elevation','format','DoubleMat','mattype',3,'name','md.basalforcings.upperwater_elevation','yts',md.constants.yts)
-	# }}}
+        WriteData(fid, prefix, 'name', 'md.basalforcings.model', 'data', 2, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundedice_melting_rate', 'name', 'md.basalforcings.groundedice_melting_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'geothermalflux', 'name', 'md.basalforcings.geothermalflux', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'deepwater_melting_rate', 'format', 'DoubleMat', 'mattype', 3, 'timeserieslength', 2, 'name', 'md.basalforcings.deepwater_melting_rate', 'scale', 1. / yts, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'deepwater_elevation', 'format', 'DoubleMat', 'mattype', 3, 'name', 'md.basalforcings.deepwater_elevation', 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'upperwater_melting_rate', 'format', 'DoubleMat', 'mattype', 3, 'timeserieslength', 2, 'name', 'md.basalforcings.upperwater_melting_rate', 'scale', 1. / yts, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'upperwater_elevation', 'format', 'DoubleMat', 'mattype', 3, 'name', 'md.basalforcings.upperwater_elevation', 'yts', yts)
+    # }}}
Index: /issm/trunk/src/m/classes/m1qn3inversion.py
===================================================================
--- /issm/trunk/src/m/classes/m1qn3inversion.py	(revision 24312)
+++ /issm/trunk/src/m/classes/m1qn3inversion.py	(revision 24313)
@@ -8,188 +8,185 @@
 from marshallcostfunctions import marshallcostfunctions
 
+
 class m1qn3inversion(object):
-	'''
-	M1QN3 class definition
+    '''
+    M1QN3 class definition
 
    Usage:
-      m1qn3inversion=m1qn3inversion()
-	'''
+      m1qn3inversion = m1qn3inversion()
+    '''
 
-	def __init__(self,*args): # {{{
+    def __init__(self, *args):  # {{{
 
-		if not len(args):
-			print 'empty init'
-			self.iscontrol                   = 0
-			self.incomplete_adjoint          = 0
-			self.control_parameters          = float('NaN')
-			self.control_scaling_factors     = float('NaN')
-			self.maxsteps                    = 0
-			self.maxiter                     = 0
-			self.dxmin                       = 0.
-			self.gttol                       = 0.
-			self.cost_functions              = float('NaN')
-			self.cost_functions_coefficients = float('NaN')
-			self.min_parameters              = float('NaN')
-			self.max_parameters              = float('NaN')
-			self.vx_obs                      = float('NaN')
-			self.vy_obs                      = float('NaN')
-			self.vz_obs                      = float('NaN')
-			self.vel_obs                     = float('NaN')
-			self.thickness_obs               = float('NaN')
+        if not len(args):
+            print('empty init')
+            self.iscontrol = 0
+            self.incomplete_adjoint = 0
+            self.control_parameters = float('NaN')
+            self.control_scaling_factors = float('NaN')
+            self.maxsteps = 0
+            self.maxiter = 0
+            self.dxmin = 0.
+            self.gttol = 0.
+            self.cost_functions = float('NaN')
+            self.cost_functions_coefficients = float('NaN')
+            self.min_parameters = float('NaN')
+            self.max_parameters = float('NaN')
+            self.vx_obs = float('NaN')
+            self.vy_obs = float('NaN')
+            self.vz_obs = float('NaN')
+            self.vel_obs = float('NaN')
+            self.thickness_obs = float('NaN')
 
-			#set defaults
-			self.setdefaultparameters()
-		elif len(args)==1 and args[0].__module__=='inversion':
-			print 'converting inversion to m1qn3inversion'
-			inv=args[0]
-			#first call setdefaultparameters: 
-			self.setdefaultparameters()
+            #set defaults
+            self.setdefaultparameters()
+        elif len(args) == 1 and args[0].__module__ == 'inversion':
+            print('converting inversion to m1qn3inversion')
+            inv = args[0]
+            #first call setdefaultparameters:
+            self.setdefaultparameters()
 
-			#then go fish whatever is available in the inversion object provided to the constructor
-			self.iscontrol                   = inv.iscontrol
-			self.incomplete_adjoint          = inv.incomplete_adjoint
-			self.control_parameters          = inv.control_parameters
-			self.maxsteps                    = inv.nsteps
-			self.cost_functions              = inv.cost_functions
-			self.cost_functions_coefficients = inv.cost_functions_coefficients
-			self.min_parameters              = inv.min_parameters
-			self.max_parameters              = inv.max_parameters
-			self.vx_obs                      = inv.vx_obs
-			self.vy_obs                      = inv.vy_obs
-			self.vz_obs                      = inv.vz_obs
-			self.vel_obs                     = inv.vel_obs
-			self.thickness_obs               = inv.thickness_obs
-		else:
-			raise Exception('constructor not supported')
-		#}}}
-	def __repr__(self): # {{{
-		string='   m1qn3inversion parameters:'
-		string="%s\n%s"%(string,fielddisplay(self,'iscontrol','is inversion activated?'))
-		string="%s\n%s"%(string,fielddisplay(self,'incomplete_adjoint','1: linear viscosity, 0: non-linear viscosity'))
-		string="%s\n%s"%(string,fielddisplay(self,'control_parameters','ex: [''FrictionCoefficient''], or [''MaterialsRheologyBbar'']'))
-		string="%s\n%s"%(string,fielddisplay(self,'control_scaling_factors','order of magnitude of each control (useful for multi-parameter optimization)'))
-		string="%s\n%s"%(string,fielddisplay(self,'maxsteps','maximum number of iterations (gradient computation)'))
-		string="%s\n%s"%(string,fielddisplay(self,'maxiter','maximum number of Function evaluation (forward run)'))
-		string="%s\n%s"%(string,fielddisplay(self,'dxmin','convergence criterion: two points less than dxmin from eachother (sup-norm) are considered identical'))
-		string="%s\n%s"%(string,fielddisplay(self,'gttol','||g(X)||/||g(X0)|| (g(X0): gradient at initial guess X0)'))
-		string="%s\n%s"%(string,fielddisplay(self,'cost_functions','indicate the type of response for each optimization step'))
-		string="%s\n%s"%(string,fielddisplay(self,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter'))
-		string="%s\n%s"%(string,fielddisplay(self,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex'))
-		string="%s\n%s"%(string,fielddisplay(self,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex'))
-		string="%s\n%s"%(string,fielddisplay(self,'vx_obs','observed velocity x component [m/yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'vy_obs','observed velocity y component [m/yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'vel_obs','observed velocity magnitude [m/yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'thickness_obs','observed thickness [m]'))
-		string="%s\n%s"%(string,'Available cost functions:')
-		string="%s\n%s"%(string,'   101: SurfaceAbsVelMisfit')
-		string="%s\n%s"%(string,'   102: SurfaceRelVelMisfit')
-		string="%s\n%s"%(string,'   103: SurfaceLogVelMisfit')
-		string="%s\n%s"%(string,'   104: SurfaceLogVxVyMisfit')
-		string="%s\n%s"%(string,'   105: SurfaceAverageVelMisfit')
-		string="%s\n%s"%(string,'   201: ThicknessAbsMisfit')
-		string="%s\n%s"%(string,'   501: DragCoefficientAbsGradient')
-		string="%s\n%s"%(string,'   502: RheologyBbarAbsGradient')
-		string="%s\n%s"%(string,'   503: ThicknessAbsGradient')
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		self.vx_obs=project3d(md,'vector',self.vx_obs,'type','node')
-		self.vy_obs=project3d(md,'vector',self.vy_obs,'type','node')
-		self.vel_obs=project3d(md,'vector',self.vel_obs,'type','node')
-		self.thickness_obs=project3d(md,'vector',self.thickness_obs,'type','node')
-		if not np.any(np.isnan(self.cost_functions_coefficients)):
-			self.cost_functions_coefficients=project3d(md,'vector',self.cost_functions_coefficients,'type','node')
-		if not np.any(np.isnan(self.min_parameters)):
-			self.min_parameters=project3d(md,'vector',self.min_parameters,'type','node')
-		if not np.any(np.isnan(self.max_parameters)):
-			self.max_parameters=project3d(md,'vector',self.max_parameters,'type','node')
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
-		
-		#default is incomplete adjoint for now
-		self.incomplete_adjoint=1
+            #then go fish whatever is available in the inversion object provided to the constructor
+            self.iscontrol = inv.iscontrol
+            self.incomplete_adjoint = inv.incomplete_adjoint
+            self.control_parameters = inv.control_parameters
+            self.maxsteps = inv.nsteps
+            self.cost_functions = inv.cost_functions
+            self.cost_functions_coefficients = inv.cost_functions_coefficients
+            self.min_parameters = inv.min_parameters
+            self.max_parameters = inv.max_parameters
+            self.vx_obs = inv.vx_obs
+            self.vy_obs = inv.vy_obs
+            self.vz_obs = inv.vz_obs
+            self.vel_obs = inv.vel_obs
+            self.thickness_obs = inv.thickness_obs
+        else:
+            raise Exception('constructor not supported')
+    #}}}
 
-		#parameter to be inferred by control methods (only
-		#drag and B are supported yet)
-		self.control_parameters='FrictionCoefficient'
-		
-		#Scaling factor for each control
-		self.control_scaling_factors=1
+    def __repr__(self):  # {{{
+        string = '   m1qn3inversion parameters:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'iscontrol', 'is inversion activated?'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'incomplete_adjoint', '1: linear viscosity, 0: non - linear viscosity'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'control_parameters', 'ex: [''FrictionCoefficient''], or [''MaterialsRheologyBbar'']'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'control_scaling_factors', 'order of magnitude of each control (useful for multi - parameter optimization)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'maxsteps', 'maximum number of iterations (gradient computation)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'maxiter', 'maximum number of Function evaluation (forward run)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'dxmin', 'convergence criterion: two points less than dxmin from eachother (sup - norm) are considered identical'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'gttol', '||g(X)||/||g(X0)|| (g(X0): gradient at initial guess X0)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'cost_functions', 'indicate the type of response for each optimization step'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'cost_functions_coefficients', 'cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'min_parameters', 'absolute minimum acceptable value of the inversed parameter on each vertex'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'max_parameters', 'absolute maximum acceptable value of the inversed parameter on each vertex'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'vx_obs', 'observed velocity x component [m / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'vy_obs', 'observed velocity y component [m / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'vel_obs', 'observed velocity magnitude [m / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'thickness_obs', 'observed thickness [m]'))
+        string = "%s\n%s" % (string, 'Available cost functions:')
+        string = "%s\n%s" % (string, '   101: SurfaceAbsVelMisfit')
+        string = "%s\n%s" % (string, '   102: SurfaceRelVelMisfit')
+        string = "%s\n%s" % (string, '   103: SurfaceLogVelMisfit')
+        string = "%s\n%s" % (string, '   104: SurfaceLogVxVyMisfit')
+        string = "%s\n%s" % (string, '   105: SurfaceAverageVelMisfit')
+        string = "%s\n%s" % (string, '   201: ThicknessAbsMisfit')
+        string = "%s\n%s" % (string, '   501: DragCoefficientAbsGradient')
+        string = "%s\n%s" % (string, '   502: RheologyBbarAbsGradient')
+        string = "%s\n%s" % (string, '   503: ThicknessAbsGradient')
+        return string
+    #}}}
 
-		#number of iterations
-		self.maxsteps=20
-		self.maxiter=40
+    def extrude(self, md):  # {{{
+        self.vx_obs = project3d(md, 'vector', self.vx_obs, 'type', 'node')
+        self.vy_obs = project3d(md, 'vector', self.vy_obs, 'type', 'node')
+        self.vel_obs = project3d(md, 'vector', self.vel_obs, 'type', 'node')
+        self.thickness_obs = project3d(md, 'vector', self.thickness_obs, 'type', 'node')
+        if not np.any(np.isnan(self.cost_functions_coefficients)):
+            self.cost_functions_coefficients = project3d(md, 'vector', self.cost_functions_coefficients, 'type', 'node')
+        if not np.any(np.isnan(self.min_parameters)):
+            self.min_parameters = project3d(md, 'vector', self.min_parameters, 'type', 'node')
+        if not np.any(np.isnan(self.max_parameters)):
+            self.max_parameters = project3d(md, 'vector', self.max_parameters, 'type', 'node')
+        return self
+    #}}}
 
-		#several responses can be used:
-		self.cost_functions=101
+    def setdefaultparameters(self):  # {{{
+        #default is incomplete adjoint for now
+        self.incomplete_adjoint = 1
+        #parameter to be inferred by control methods (only
+        #drag and B are supported yet)
+        self.control_parameters = 'FrictionCoefficient'
+        #Scaling factor for each control
+        self.control_scaling_factors = 1
+        #number of iterations
+        self.maxsteps = 20
+        self.maxiter = 40
+        #several responses can be used:
+        self.cost_functions = 101
+        #m1qn3 parameters
+        self.dxmin = 0.1
+        self.gttol = 1e-4
 
-		#m1qn3 parameters
-		self.dxmin  = 0.1
-		self.gttol = 1e-4
+        return self
+    #}}}
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if not self.iscontrol:
+            return md
 
-		#Early return
-		if not self.iscontrol:
-			return md
+        num_controls = np.size(md.inversion.control_parameters)
+        num_costfunc = np.size(md.inversion.cost_functions)
 
-		num_controls=np.size(md.inversion.control_parameters)
-		num_costfunc=np.size(md.inversion.cost_functions)
+        md = checkfield(md, 'fieldname', 'inversion.iscontrol', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'inversion.incomplete_adjoint', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'inversion.control_parameters', 'cell', 1, 'values', supportedcontrols())
+        md = checkfield(md, 'fieldname', 'inversion.control_scaling_factors', 'size', [num_controls], '>', 0, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'inversion.maxsteps', 'numel', [1], '>=', 0)
+        md = checkfield(md, 'fieldname', 'inversion.maxiter', 'numel', [1], '>=', 0)
+        md = checkfield(md, 'fieldname', 'inversion.dxmin', 'numel', [1], '>', 0.)
+        md = checkfield(md, 'fieldname', 'inversion.gttol', 'numel', [1], '>', 0.)
+        md = checkfield(md, 'fieldname', 'inversion.cost_functions', 'size', [num_costfunc], 'values', supportedcostfunctions())
+        md = checkfield(md, 'fieldname', 'inversion.cost_functions_coefficients', 'size', [md.mesh.numberofvertices, num_costfunc], '>=', 0)
+        md = checkfield(md, 'fieldname', 'inversion.min_parameters', 'size', [md.mesh.numberofvertices, num_controls])
+        md = checkfield(md, 'fieldname', 'inversion.max_parameters', 'size', [md.mesh.numberofvertices, num_controls])
 
-		md = checkfield(md,'fieldname','inversion.iscontrol','values',[0,1])
-		md = checkfield(md,'fieldname','inversion.incomplete_adjoint','values',[0,1])
-		md = checkfield(md,'fieldname','inversion.control_parameters','cell',1,'values',supportedcontrols())
-		md = checkfield(md,'fieldname','inversion.control_scaling_factors','size',[num_controls],'>',0,'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','inversion.maxsteps','numel',[1],'>=',0)
-		md = checkfield(md,'fieldname','inversion.maxiter','numel',[1],'>=',0)
-		md = checkfield(md,'fieldname','inversion.dxmin','numel',[1],'>',0.)
-		md = checkfield(md,'fieldname','inversion.gttol','numel',[1],'>',0.)
-		md = checkfield(md,'fieldname','inversion.cost_functions','size',[num_costfunc],'values',supportedcostfunctions())
-		md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices,num_costfunc],'>=',0)
-		md = checkfield(md,'fieldname','inversion.min_parameters','size',[md.mesh.numberofvertices,num_controls])
-		md = checkfield(md,'fieldname','inversion.max_parameters','size',[md.mesh.numberofvertices,num_controls])
+        if solution == 'BalancethicknessSolution':
+            md = checkfield(md, 'fieldname', 'inversion.thickness_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+        else:
+            md = checkfield(md, 'fieldname', 'inversion.vx_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'inversion.vy_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
 
-		if solution=='BalancethicknessSolution':
-			md = checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
-		else:
-			md = checkfield(md,'fieldname','inversion.vx_obs','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
-			md = checkfield(md,'fieldname','inversion.vy_obs','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
+        return md
+    # }}}
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'iscontrol', 'format', 'Boolean')
+        WriteData(fid, prefix, 'name', 'md.inversion.type', 'data', 2, 'format', 'Integer')
+        if not self.iscontrol:
+            return
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'incomplete_adjoint', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'control_scaling_factors', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'maxsteps', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'maxiter', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'dxmin', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'gttol', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'cost_functions_coefficients', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'min_parameters', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'max_parameters', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'vx_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'vy_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'vz_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'thickness_obs', 'format', 'DoubleMat', 'mattype', 1)
 
-		yts=md.constants.yts
+    #process control parameters
+        num_control_parameters = len(self.control_parameters)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'control_parameters', 'format', 'StringArray')
+        WriteData(fid, prefix, 'data', num_control_parameters, 'name', 'md.inversion.num_control_parameters', 'format', 'Integer')
 
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','iscontrol','format','Boolean')
-		WriteData(fid,prefix,'name','md.inversion.type','data',2,'format','Integer')
-		if not self.iscontrol:
-			return
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','incomplete_adjoint','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','control_scaling_factors','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxsteps','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxiter','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','dxmin','format','Double')
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','gttol','format','Double')
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts)
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts)
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts)
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',1)
-
-		#process control parameters
-		num_control_parameters=len(self.control_parameters)
-		WriteData(fid,prefix,'object',self,'fieldname','control_parameters','format','StringArray')
-		WriteData(fid,prefix,'data',num_control_parameters,'name','md.inversion.num_control_parameters','format','Integer')
-
-		#process cost functions
-		num_cost_functions=np.size(self.cost_functions)
-		data=marshallcostfunctions(self.cost_functions)
-		WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','StringArray')
-		WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer')
-	# }}}
+    #process cost functions
+        num_cost_functions = np.size(self.cost_functions)
+        data = marshallcostfunctions(self.cost_functions)
+        WriteData(fid, prefix, 'data', data, 'name', 'md.inversion.cost_functions', 'format', 'StringArray')
+        WriteData(fid, prefix, 'data', num_cost_functions, 'name', 'md.inversion.num_cost_functions', 'format', 'Integer')
+    # }}}
Index: /issm/trunk/src/m/classes/mask.m
===================================================================
--- /issm/trunk/src/m/classes/mask.m	(revision 24312)
+++ /issm/trunk/src/m/classes/mask.m	(revision 24313)
@@ -40,5 +40,5 @@
 			if strcmpi(solution,'LoveSolution'), return; end;
 
-			md = checkfield(md,'fieldname','mask.groundedice_levelset','forcing',1,'NaN',1);
+			md = checkfield(md,'fieldname','mask.groundedice_levelset','timeseries',1,'NaN',1);
 			md = checkfield(md,'fieldname','mask.ice_levelset','NaN',1,'size',[md.mesh.numberofvertices 1]);
 			isice=(md.mask.ice_levelset<=0);
Index: /issm/trunk/src/m/classes/mask.py
===================================================================
--- /issm/trunk/src/m/classes/mask.py	(revision 24312)
+++ /issm/trunk/src/m/classes/mask.py	(revision 24313)
@@ -4,50 +4,55 @@
 from checkfield import checkfield
 from WriteData import WriteData
-import MatlabFuncs as m
+
 
 class mask(object):
-	"""
-	MASK class definition
+    """
+    MASK class definition
 
-	   Usage:
-	      mask=mask();
-	"""
+       Usage:
+          mask = mask()
+    """
 
-	def __init__(self): # {{{
-		self.ice_levelset         = float('NaN')
-		self.groundedice_levelset = float('NaN')
+    def __init__(self):  # {{{
+        self.ice_levelset = float('NaN')
+        self.groundedice_levelset = float('NaN')
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		string="   masks:"
+    #}}}
 
-		string="%s\n%s"%(string,fielddisplay(self,"groundedice_levelset","is ice grounded ? grounded ice if > 0, grounding line position if = 0, floating ice if < 0"))
-		string="%s\n%s"%(string,fielddisplay(self,"ice_levelset","presence of ice if < 0, icefront position if = 0, no ice if > 0"))
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		self.ice_levelset=project3d(md,'vector',self.ice_levelset,'type','node')
-		self.groundedice_levelset=project3d(md,'vector',self.groundedice_levelset,'type','node')
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		if(solution=='LoveSolution'):
-			return
+    def __repr__(self):  # {{{
+        string = "   masks:"
 
-		md = checkfield(md,'fieldname','mask.ice_levelset'        ,'size',[md.mesh.numberofvertices])
-		isice=np.array(md.mask.ice_levelset<=0,int)
-		if np.sum(isice)==0:
-			raise TypeError("no ice present in the domain")
+        string = "%s\n%s" % (string, fielddisplay(self, "groundedice_levelset", "is ice grounded ? grounded ice if > 0, grounding line position if = 0, floating ice if < 0"))
+        string = "%s\n%s" % (string, fielddisplay(self, "ice_levelset", "presence of ice if < 0, icefront position if = 0, no ice if > 0"))
+        return string
+    #}}}
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'object',self,'fieldname','groundedice_levelset','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','ice_levelset','format','DoubleMat','mattype',1)
-	# }}}
+    def extrude(self, md):  # {{{
+        self.ice_levelset = project3d(md, 'vector', self.ice_levelset, 'type', 'node')
+        self.groundedice_levelset = project3d(md, 'vector', self.groundedice_levelset, 'type', 'node')
+        return self
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if(solution == 'LoveSolution'):
+            return
+
+        md = checkfield(md, 'fieldname', 'mask.ice_levelset', 'size', [md.mesh.numberofvertices])
+        isice = np.array(md.mask.ice_levelset <= 0, int)
+        if np.sum(isice) == 0:
+            raise TypeError("no ice present in the domain")
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundedice_levelset', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'ice_levelset', 'format', 'DoubleMat', 'mattype', 1)
+    # }}}
Index: /issm/trunk/src/m/classes/maskpsl.py
===================================================================
--- /issm/trunk/src/m/classes/maskpsl.py	(revision 24312)
+++ /issm/trunk/src/m/classes/maskpsl.py	(revision 24313)
@@ -6,94 +6,98 @@
 from WriteData import WriteData
 
+
 class maskpsl(object):
-#MASKPSL class definition
-#
-#   Usage:
-#      maskpsl=maskpsl();
+    #MASKPSL class definition
+    #
+    #   Usage:
+    #      maskpsl = maskpsl()
 
-	def __init__(self,*args): # {{{
-		self.groundedice_levelset = float('NaN')
-		self.ice_levelset         = float('NaN')
-		self.ocean_levelset = float('NaN')
-		self.land_levelset = float('NaN')
+    def __init__(self, *args):  # {{{
+        self.groundedice_levelset = float('NaN')
+        self.ice_levelset = float('NaN')
+        self.ocean_levelset = float('NaN')
+        self.land_levelset = float('NaN')
 
-		if not len(args):
-			self.setdefaultparameters()
-		else:
-			raise RuntimeError('constructor not supported')
-	# }}}
-	def __repr__(self): # {{{
-		string='   masks:'
-		string="%s\n%s"%(string,fielddisplay(self,'groundedice_levelset','is ice grounded ? grounded ice if > 0, grounding line position if = 0, floating ice if < 0'))
-		string="%s\n%s"%(string,fielddisplay(self,'ice_levelset','presence of ice if < 0, icefront position if = 0, no ice if > 0'))
-		string="%s\n%s"%(string,fielddisplay(self,'ocean_levelset','is the vertex on the ocean ? yes if = 1, no if = 0'))
-		string="%s\n%s"%(string,fielddisplay(self,'land_levelset','is the vertex on the land ? yes if = 1, no if = 0'))
-		return string
+        if not len(args):
+            self.setdefaultparameters()
+        else:
+            raise RuntimeError('constructor not supported')
+    # }}}
 
-	# }}}	
-	def loadobj(self): # {{{
-		# This def is directly called by matlab when a model object is
-		# loaded. Update old properties here
-		#2014 February 5th
-		if numel(self.ice_levelset)>1 and all(self.ice_levelset>=0):
-			print('WARNING: md.mask.ice_levelset>=0, you probably need to change the sign of this levelset')
-		return self
-	# }}}
+    def __repr__(self):  # {{{
+        string = '   masks:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'groundedice_levelset', 'is ice grounded ? grounded ice if > 0, grounding line position if = 0, floating ice if < 0'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'ice_levelset', 'presence of ice if < 0, icefront position if = 0, no ice if > 0'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'ocean_levelset', 'is the vertex on the ocean ? yes if = 1, no if = 0'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'land_levelset', 'is the vertex on the land ? yes if = 1, no if = 0'))
+        return string
 
-	def setdefaultparameters(self): # {{{
-		return self
+    # }}}
 
-	# }}}
+    def loadobj(self):  # {{{
+        # This def is directly called by matlab when a model object is
+        # loaded. Update old properties here
+        #2014 February 5th
+        if numel(self.ice_levelset) > 1 and all(self.ice_levelset >= 0):
+            print('WARNING: md.mask.ice_levelset >= 0, you probably need to change the sign of this levelset')
+        return self
+    # }}}
 
-	def checkconsistency(self,md,solution,analyses): # {{{
-		md = checkfield(md,'fieldname','mask.groundedice_levelset','size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','mask.ice_levelset'        ,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','mask.ocean_levelset','size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','mask.land_levelset','size',[md.mesh.numberofvertices])
-		isice=(md.mask.ice_levelset<=0)
-		if sum(isice)==0:
-			print('no ice present in the domain')
+    def setdefaultparameters(self):  # {{{
+        return self
 
-		if max(md.mask.ice_levelset)<0:
-			print('no ice front provided')
+    # }}}
 
-		elements=md.mesh.elements-1; elements=elements.astype(np.int32, copy=False);
-		icefront=np.sum(md.mask.ice_levelset[elements]==0,axis=1)
-		if (max(icefront)==3 & m.strcmp(md.mesh.elementtype(),'Tria')) or (max(icefront==6) & m.strcmp(md.mesh.elementtype(),'Penta')):
-			raise RuntimeError('At least one element has all nodes on ice front, change md.mask.ice_levelset to fix it')
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        md = checkfield(md, 'fieldname', 'mask.groundedice_levelset', 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'mask.ice_levelset', 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'mask.ocean_levelset', 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'mask.land_levelset', 'size', [md.mesh.numberofvertices])
+        isice = (md.mask.ice_levelset <= 0)
+        if sum(isice) == 0:
+            print('no ice present in the domain')
 
-		return md
+        if max(md.mask.ice_levelset) < 0:
+            print('no ice front provided')
 
-	# }}}
+        elements = md.mesh.elements - 1
+        elements = elements.astype(np.int32, copy=False)
+        icefront = np.sum(md.mask.ice_levelset[elements] == 0, axis=1)
+        if (max(icefront) == 3 & m.strcmp(md.mesh.elementtype(), 'Tria')) or (max(icefront == 6) & m.strcmp(md.mesh.elementtype(), 'Penta')):
+            raise RuntimeError('At least one element has all nodes on ice front, change md.mask.ice_levelset to fix it')
 
-	def extrude(self,md): # {{{
-		self.groundedice_levelset=project3d(md,'vector',self.groundedice_levelset,'type','node')
-		self.ice_levelset=project3d(md,'vector',self.ice_levelset,'type','node')
-		self.ocean_levelset=project3d(md,'vector',self.ocean_levelset,'type','node')
-		self.land_levelset=project3d(md,'vector',self.land_levelset,'type','node')
-		return self
-	# }}}
+        return md
 
-	def mask(*args): # {{{
-		if not len(args):
-			self.setdefaultparameters()
-		else:
-			raise RuntimeError('constructor not supported')
-		return self
+    # }}}
 
-	# }}}
+    def extrude(self, md):  # {{{
+        self.groundedice_levelset = project3d(md, 'vector', self.groundedice_levelset, 'type', 'node')
+        self.ice_levelset = project3d(md, 'vector', self.ice_levelset, 'type', 'node')
+        self.ocean_levelset = project3d(md, 'vector', self.ocean_levelset, 'type', 'node')
+        self.land_levelset = project3d(md, 'vector', self.land_levelset, 'type', 'node')
+        return self
+    # }}}
 
-	def marshall(self,prefix,md,fid): # {{{
-		WriteData(fid,prefix,'name','md.mask.type','data',type(md.mask).__name__,'format','String')
-		WriteData(fid,prefix,'object',self,'class','mask','fieldname','groundedice_levelset','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','mask','fieldname','ice_levelset','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','mask','fieldname','ocean_levelset','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','mask','fieldname','land_levelset','format','DoubleMat','mattype',1)
-	# }}}
-	def savemodeljs(self,fid,modelname): # {{{
-		writejs1Darray(fid,[modelname, '.mask.groundedice_levelset'],self.groundedice_levelset)
-		writejs1Darray(fid,[modelname, '.mask.ice_levelset'],self.ice_levelset)
-		writejs1Darray(fid,[modelname, '.mask.ocean_levelset'],self.ocean_levelset)
-		writejs1Darray(fid,[modelname, '.mask.land_levelset'],self.land_levelset)
-	# }}}
+    def mask(*args):  # {{{
+        if not len(args):
+            self.setdefaultparameters()
+        else:
+            raise RuntimeError('constructor not supported')
+        return self
 
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'name', 'md.mask.type', 'data', type(md.mask).__name__, 'format', 'String')
+        WriteData(fid, prefix, 'object', self, 'class', 'mask', 'fieldname', 'groundedice_levelset', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'mask', 'fieldname', 'ice_levelset', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'mask', 'fieldname', 'ocean_levelset', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'mask', 'fieldname', 'land_levelset', 'format', 'DoubleMat', 'mattype', 1)
+    # }}}
+
+    def savemodeljs(self, fid, modelname):  # {{{
+        writejs1Darray(fid, [modelname, '.mask.groundedice_levelset'], self.groundedice_levelset)
+        writejs1Darray(fid, [modelname, '.mask.ice_levelset'], self.ice_levelset)
+        writejs1Darray(fid, [modelname, '.mask.ocean_levelset'], self.ocean_levelset)
+        writejs1Darray(fid, [modelname, '.mask.land_levelset'], self.land_levelset)
+    # }}}
Index: /issm/trunk/src/m/classes/massfluxatgate.py
===================================================================
--- /issm/trunk/src/m/classes/massfluxatgate.py	(revision 24312)
+++ /issm/trunk/src/m/classes/massfluxatgate.py	(revision 24313)
@@ -6,73 +6,77 @@
 import os
 
+
 class massfluxatgate(object):
-	"""
-	MASSFLUXATEGATE class definition
+    """
+    MASSFLUXATEGATE class definition
 
-	   Usage:
-		  massfluxatgate=massfluxatgate('GateName','PathToExpFile')
-	"""
+       Usage:
+          massfluxatgate = massfluxatgate('GateName', 'PathToExpFile')
+    """
 
-	def __init__(self,*args): # {{{
+    def __init__(self, *args):  # {{{
 
-		self.name            = ''
-		self.definitionstring  = ''
-		self.profilename     = ''
-		self.segments        = float('NaN')
+        self.name = ''
+        self.definitionstring = ''
+        self.profilename = ''
+        self.segments = float('NaN')
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#use provided options to change fields
-		options=pairoptions(*args)
+    #use provided options to change fields
+        options = pairoptions(*args)
 
-		#OK get other fields
-		self=options.AssignObjectFields(self)
+    #OK get other fields
+        self = options.AssignObjectFields(self)
 
-		#}}}
-	def __repr__(self): # {{{
+    #}}}
 
-		string="   Massfluxatgate:"
-		string="%s\n%s"%(string,fielddisplay(self,'name','identifier for this massfluxatgate response'))
-		string="%s\n%s"%(string,fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from Outputdefinition[1-100]'))
-		string="%s\n%s"%(string,fielddisplay(self,'profilename','name of file (shapefile or argus file) defining a profile (or gate)'))
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		return self
-	   #}}}
-	def setdefaultparameters(self): # {{{
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		
-		if  not isinstance(self.name, basestring):
-			raise RuntimeError("massfluxatgate error message: 'name' field should be a string!")
-			
-		if  not isinstance(self.profilename, basestring):
-			raise RuntimeError("massfluxatgate error message: 'profilename' field should be a string!") 
-		
-		OutputdefinitionStringArray=[]
-		for i in range(1,100):
-			x='Outputdefinition'+str(i)
-			OutputdefinitionStringArray.append(x)
-			
-		md = checkfield(md,'field',self.definitionstring,'values',OutputdefinitionStringArray)
-		
-		#check the profilename points to a file!: 
-		if not os.path.isfile(self.profilename):
-			raise RuntimeError("massfluxatgate error message: file name for profile corresponding to gate does not point to a legitimate file on disk!")
+    def __repr__(self):  # {{{
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		
-		#before marshalling, we need to create the segments out of the profilename: 
-		self.segments=MeshProfileIntersection(md.mesh.elements,md.mesh.x,md.mesh.y,self.profilename)[0]
+        string = "   Massfluxatgate:"
+        string = "%s\n%s" % (string, fielddisplay(self, 'name', 'identifier for this massfluxatgate response'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'definitionstring', 'string that identifies this output definition uniquely, from Outputdefinition[1 - 100]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'profilename', 'name of file (shapefile or argus file) defining a profile (or gate)'))
+        return string
+    #}}}
 
-		#ok, marshall name and segments: 
-		WriteData(fid,prefix,'data',self.name,'name','md.massfluxatgate.name','format','String');
-		WriteData(fid,prefix,'data',self.definitionstring,'name','md.massfluxatgate.definitionstring','format','String');
-		WriteData(fid,prefix,'data',self.segments,'name','md.massfluxatgate.segments','format','DoubleMat','mattype',1);
+    def extrude(self, md):  # {{{
+        return self
+    #}}}
 
-	# }}}
+    def setdefaultparameters(self):  # {{{
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if not isinstance(self.name, str):
+            raise RuntimeError("massfluxatgate error message: 'name' field should be a string!")
+
+        if not isinstance(self.profilename, str):
+            raise RuntimeError("massfluxatgate error message: 'profilename' field should be a string!")
+
+        OutputdefinitionStringArray = []
+        for i in range(1, 100):
+            x = 'Outputdefinition' + str(i)
+            OutputdefinitionStringArray.append(x)
+
+        md = checkfield(md, 'field', self.definitionstring, 'values', OutputdefinitionStringArray)
+
+        #check the profilename points to a file!:
+        if not os.path.isfile(self.profilename):
+            raise RuntimeError("massfluxatgate error message: file name for profile corresponding to gate does not point to a legitimate file on disk!")
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        #before marshalling, we need to create the segments out of the profilename:
+        self.segments = MeshProfileIntersection(md.mesh.elements, md.mesh.x, md.mesh.y, self.profilename)[0]
+
+    #ok, marshall name and segments:
+        WriteData(fid, prefix, 'data', self.name, 'name', 'md.massfluxatgate.name', 'format', 'String')
+        WriteData(fid, prefix, 'data', self.definitionstring, 'name', 'md.massfluxatgate.definitionstring', 'format', 'String')
+        WriteData(fid, prefix, 'data', self.segments, 'name', 'md.massfluxatgate.segments', 'format', 'DoubleMat', 'mattype', 1)
+
+    # }}}
Index: /issm/trunk/src/m/classes/masstransport.js
===================================================================
--- /issm/trunk/src/m/classes/masstransport.js	(revision 24312)
+++ /issm/trunk/src/m/classes/masstransport.js	(revision 24313)
@@ -27,5 +27,5 @@
 		console.log(sprintf('   Masstransport solution parameters:'));
 		fielddisplay(this,'spcthickness','thickness constraints (NaN means no constraint) [m]');
-		fielddisplay(this,'isfreesurface','do we use free surfaces (FS only) are mass conservation');
+		fielddisplay(this,'isfreesurface','do we use free surfaces (FS only) or mass conservation');
 		fielddisplay(this,'min_thickness','minimum ice thickness allowed [m]');
 		fielddisplay(this,'hydrostatic_adjustment',"adjustment of ice shelves surface and bed elevations: 'Incremental' or 'Absolute' ");
Index: /issm/trunk/src/m/classes/masstransport.m
===================================================================
--- /issm/trunk/src/m/classes/masstransport.m	(revision 24312)
+++ /issm/trunk/src/m/classes/masstransport.m	(revision 24313)
@@ -5,5 +5,5 @@
 
 classdef masstransport
-	properties (SetAccess=public) 
+	properties (SetAccess=public)
 		 spcthickness           = NaN;
 		 isfreesurface          = 0;
@@ -92,16 +92,18 @@
 			md = checkfield(md,'fieldname','masstransport.isfreesurface','values',[0 1]);
 			md = checkfield(md,'fieldname','masstransport.hydrostatic_adjustment','values',{'Absolute' 'Incremental'});
-			md = checkfield(md,'fieldname','masstransport.stabilization','values',[0 1 2 3 4]);
+			md = checkfield(md,'fieldname','masstransport.stabilization','values',[0 1 2 3 4 5]);
 			md = checkfield(md,'fieldname','masstransport.min_thickness','>',0);
 			md = checkfield(md,'fieldname','masstransport.requested_outputs','stringrow',1);
-
+			if ~any(isnan(md.stressbalance.vertex_pairing)),
+				md = checkfield(md,'fieldname','stressbalance.vertex_pairing','>',0);
+			end
 		end % }}}
 		function disp(self) % {{{
 			disp(sprintf('   Masstransport solution parameters:'));
 			fielddisplay(self,'spcthickness','thickness constraints (NaN means no constraint) [m]');
-			fielddisplay(self,'isfreesurface','do we use free surfaces (FS only) are mass conservation');
+			fielddisplay(self,'isfreesurface','do we use free surfaces (FS only) or mass conservation');
 			fielddisplay(self,'min_thickness','minimum ice thickness allowed [m]');
 			fielddisplay(self,'hydrostatic_adjustment','adjustment of ice shelves surface and bed elevations: ''Incremental'' or ''Absolute'' ');
-			fielddisplay(self,'stabilization','0: no, 1: artificial_diffusivity, 2: streamline upwinding, 3: discontinuous Galerkin, 4: Flux Correction Transport');
+			fielddisplay(self,'stabilization','0: no, 1: artificial_diffusivity, 2: streamline upwinding, 3: discontinuous Galerkin, 4: Flux Correction Transport, 5: streamline upwind Petrov-Galerkin (SUPG)');
 
 			disp(sprintf('\n      %s','Penalty options:'));
@@ -122,5 +124,5 @@
 			WriteData(fid,prefix,'object',self,'fieldname','vertex_pairing','format','DoubleMat','mattype',3);
 			WriteData(fid,prefix,'object',self,'fieldname','penalty_factor','format','Double');
-			
+
 			%process requested outputs
 			outputs = self.requested_outputs;
@@ -133,5 +135,5 @@
 		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
-		
+
 			writejs1Darray(fid,[modelname '.masstransport.spcthickness'],self.spcthickness);
 			writejsdouble(fid,[modelname '.masstransport.isfreesurface'],self.isfreesurface);
Index: /issm/trunk/src/m/classes/masstransport.py
===================================================================
--- /issm/trunk/src/m/classes/masstransport.py	(revision 24312)
+++ /issm/trunk/src/m/classes/masstransport.py	(revision 24313)
@@ -1,2 +1,3 @@
+import numpy as np
 from fielddisplay import fielddisplay
 from project3d import project3d
@@ -4,97 +5,95 @@
 from WriteData import WriteData
 
+
 class masstransport(object):
-	"""
-	MASSTRANSPORT class definition
+    """
+    MASSTRANSPORT class definition
 
-	   Usage:
-	      masstransport=masstransport();
-	"""
+       Usage:
+          masstransport = masstransport()
+    """
 
-	def __init__(self): # {{{
-		self.spcthickness           = float('NaN')
-		self.isfreesurface          = 0
-		self.min_thickness          = 0.
-		self.hydrostatic_adjustment = 0
-		self.stabilization          = 0
-		self.vertex_pairing         = float('NaN')
-		self.penalty_factor         = 0
-		self.requested_outputs      = []
+    def __init__(self):  # {{{
+        self.spcthickness = float('NaN')
+        self.isfreesurface = 0
+        self.min_thickness = 0.
+        self.hydrostatic_adjustment = 0
+        self.stabilization = 0
+        self.vertex_pairing = float('NaN')
+        self.penalty_factor = 0
+        self.requested_outputs = []
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		string='   Masstransport solution parameters:'
-		string="%s\n%s"%(string,fielddisplay(self,'spcthickness','thickness constraints (NaN means no constraint) [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'isfreesurface','do we use free surfaces (FS only) are mass conservation'))
-		string="%s\n%s"%(string,fielddisplay(self,'min_thickness','minimum ice thickness allowed [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'hydrostatic_adjustment','adjustment of ice shelves surface and bed elevations: ''Incremental'' or ''Absolute'' '))
-		string="%s\n%s"%(string,fielddisplay(self,'stabilization','0: no, 1: artificial_diffusivity, 2: streamline upwinding, 3: discontinuous Galerkin, 4: Flux Correction Transport'))
-		string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested'))
+    #}}}
 
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		self.spcthickness=project3d(md,'vector',self.spcthickness,'type','node')
-		return self
-	#}}}
-	def defaultoutputs(self,md): # {{{
+    def __repr__(self):  # {{{
+        string = '   Masstransport solution parameters:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'spcthickness', 'thickness constraints (NaN means no constraint) [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isfreesurface', 'do we use free surfaces (FS only) or mass conservation'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'min_thickness', 'minimum ice thickness allowed [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'hydrostatic_adjustment', 'adjustment of ice shelves surface and bed elevations: ''Incremental'' or ''Absolute'' '))
+        string = "%s\n%s" % (string, fielddisplay(self, 'stabilization', '0: no, 1: artificial_diffusivity, 2: streamline upwinding, 3: discontinuous Galerkin, 4: Flux Correction Transport'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
 
-		return ['Thickness','Surface','Base']
+        return string
+    #}}}
 
-	#}}}
-	def setdefaultparameters(self): # {{{
+    def extrude(self, md):  # {{{
+        self.spcthickness = project3d(md, 'vector', self.spcthickness, 'type', 'node')
+        return self
+    #}}}
 
-		#Type of stabilization to use 0:nothing 1:artificial_diffusivity 3:Discontinuous Galerkin
-		self.stabilization=1
+    def defaultoutputs(self, md):  # {{{
+        return ['Thickness', 'Surface', 'Base']
 
-		#Factor applied to compute the penalties kappa=max(stiffness matrix)*10^penalty_factor
-		self.penalty_factor=3
+    #}}}
+    def setdefaultparameters(self):  # {{{
+        #Type of stabilization to use 0:nothing 1:artificial_diffusivity 3:Discontinuous Galerkin
+        self.stabilization = 1
+        #Factor applied to compute the penalties kappa = max(stiffness matrix) * 1.0**penalty_factor
+        self.penalty_factor = 3
+        #Minimum ice thickness that can be used
+        self.min_thickness = 1
+        #Hydrostatic adjustment
+        self.hydrostatic_adjustment = 'Absolute'
+        #default output
+        self.requested_outputs = ['default']
+        return self
+    #}}}
 
-		#Minimum ice thickness that can be used
-		self.min_thickness=1
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if ('MasstransportAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.ismasstransport):
+            return md
 
-		#Hydrostatic adjustment
-		self.hydrostatic_adjustment='Absolute'
+        md = checkfield(md, 'fieldname', 'masstransport.spcthickness', 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'masstransport.isfreesurface', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'masstransport.hydrostatic_adjustment', 'values', ['Absolute', 'Incremental'])
+        md = checkfield(md, 'fieldname', 'masstransport.stabilization', 'values', [0, 1, 2, 3, 4])
+        md = checkfield(md, 'fieldname', 'masstransport.min_thickness', '>', 0)
+        md = checkfield(md, 'fieldname', 'masstransport.requested_outputs', 'stringrow', 1)
+        if not np.any(np.isnan(self.vertex_pairing)) and len(self.vertex_pairing) > 0:
+            md = checkfield(md, 'fieldname', 'stressbalance.vertex_pairing', '>', 0)
 
-		#default output
-		self.requested_outputs=['default']
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+        return md
+    # }}}
 
-		#Early return
-		if ('MasstransportAnalysis' not in analyses) or (solution=='TransientSolution' and not md.transient.ismasstransport):
-			return md
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'spcthickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isfreesurface', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'min_thickness', 'format', 'Double')
+        WriteData(fid, prefix, 'data', self.hydrostatic_adjustment, 'format', 'String', 'name', 'md.masstransport.hydrostatic_adjustment')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'stabilization', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'vertex_pairing', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'penalty_factor', 'format', 'Double')
 
-		md = checkfield(md,'fieldname','masstransport.spcthickness','Inf',1,'timeseries',1)
-		md = checkfield(md,'fieldname','masstransport.isfreesurface','values',[0,1])
-		md = checkfield(md,'fieldname','masstransport.hydrostatic_adjustment','values',['Absolute','Incremental'])
-		md = checkfield(md,'fieldname','masstransport.stabilization','values',[0,1,2,3,4])
-		md = checkfield(md,'fieldname','masstransport.min_thickness','>',0)
-		md = checkfield(md,'fieldname','masstransport.requested_outputs','stringrow',1)
-
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-
-		yts=md.constants.yts
-
-		WriteData(fid,prefix,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'fieldname','isfreesurface','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','min_thickness','format','Double')
-		WriteData(fid,prefix,'data',self.hydrostatic_adjustment,'format','String','name','md.masstransport.hydrostatic_adjustment')
-		WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','vertex_pairing','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'fieldname','penalty_factor','format','Double')
-
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.masstransport.requested_outputs','format','StringArray')
-	# }}}
+    #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.masstransport.requested_outputs', 'format', 'StringArray')
+    # }}}
Index: /issm/trunk/src/m/classes/matdamageice.m
===================================================================
--- /issm/trunk/src/m/classes/matdamageice.m	(revision 24312)
+++ /issm/trunk/src/m/classes/matdamageice.m	(revision 24313)
@@ -14,4 +14,5 @@
 		thermalconductivity        = 0.;
 		temperateiceconductivity   = 0.;
+		effectiveconductivity_averaging = 0.;
 		meltingpoint               = 0.;
 		beta                       = 0.;
@@ -81,4 +82,7 @@
 			self.temperateiceconductivity=.24;
 
+			%computation of effective conductivity
+			self.effectiveconductivity_averaging=1;
+            
 			%the melting point of ice at 1 atmosphere of pressure in K
 			self.meltingpoint=273.15;
@@ -115,5 +119,6 @@
 			md = checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements 1]);
 			md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval'});
-
+			md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
+            
 			if ismember('GiaAnalysis',analyses),
 				md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1);
@@ -138,4 +143,5 @@
 			fielddisplay(self,'thermalconductivity',['ice thermal conductivity [W/m/K]']);
 			fielddisplay(self,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
+			fielddisplay(self,'effectiveconductivity_averaging','computation of effective conductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)');
 			fielddisplay(self,'meltingpoint','melting point of ice at 1atm in K');
 			fielddisplay(self,'latentheat','latent heat of fusion [J/kg]');
@@ -162,4 +168,5 @@
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double');
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double');
+			WriteData(fid,prefix,'object',self,'class','materials','fieldname','effectiveconductivity_averaging','format','Integer');
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double');
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double');
Index: /issm/trunk/src/m/classes/matdamageice.py
===================================================================
--- /issm/trunk/src/m/classes/matdamageice.py	(revision 24312)
+++ /issm/trunk/src/m/classes/matdamageice.py	(revision 24313)
@@ -4,165 +4,156 @@
 from WriteData import WriteData
 
+
 class matdamageice(object):
-	"""
-	MATICE class definition
+    """
+    MATICE class definition
 
-	   Usage:
-	      matdamagice=matdamageice();
-	"""
+       Usage:
+          matdamagice = matdamageice()
+    """
 
-	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.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.rheology_law              = ''
+    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_B = float('NaN')
+        self.rheology_n = float('NaN')
+        self.rheology_law = ''
 
-		#giaivins: 
-		self.lithosphere_shear_modulus  = 0.
-		self.lithosphere_density        = 0.
-		self.mantle_shear_modulus       = 0.
-		self.mantle_density             = 0.
-		
-		#SLR
-		self.earth_density= 5512;  # average density of the Earth, (kg/m^3)
+    #giaivins:
+        self.lithosphere_shear_modulus = 0.
+        self.lithosphere_density = 0.
+        self.mantle_shear_modulus = 0.
+        self.mantle_density = 0.
 
+    #SLR
+        self.earth_density = 5512  # average density of the Earth, (kg / m^3)
+        self.setdefaultparameters()
+    #}}}
 
-		self.setdefaultparameters()
-		#}}}
-	def __repr__(self): # {{{
-		string="   Materials:"
+    def __repr__(self):  # {{{
+        string = "   Materials:"
+        string = "%s\n%s" % (string, fielddisplay(self, "rho_ice", "ice density [kg / m^3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "rho_water", "water density [kg / m^3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "rho_freshwater", "fresh water density [kg / m^3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "mu_water", "water viscosity [N s / m^2]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "heatcapacity", "heat capacity [J / kg / K]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "thermalconductivity", "ice thermal conductivity [W / m / K]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "temperateiceconductivity", "temperate ice thermal conductivity [W / m / K]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "effectiveconductivity_averaging", "computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "meltingpoint", "melting point of ice at 1atm in K"))
+        string = "%s\n%s" % (string, fielddisplay(self, "latentheat", "latent heat of fusion [J / m^3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "beta", "rate of change of melting point with pressure [K / Pa]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "mixed_layer_capacity", "mixed layer capacity [W / kg / K]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "thermal_exchange_velocity", "thermal exchange velocity [m / s]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "rheology_B", "flow law parameter [Pa s^(1 / n)]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "rheology_n", "Glen's flow law exponent"))
+        string = "%s\n%s" % (string, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'"))
+        string = "%s\n%s" % (string, fielddisplay(self, "lithosphere_shear_modulus", "Lithosphere shear modulus [Pa]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "lithosphere_density", "Lithosphere density [g / cm^ - 3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "mantle_shear_modulus", "Mantle shear modulus [Pa]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "mantle_density", "Mantle density [g / cm^ - 3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "earth_density", "Mantle density [kg / m^ - 3]"))
+        return string
+    #}}}
 
-		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,"meltingpoint","melting point of ice at 1atm in K"))
-		string="%s\n%s"%(string,fielddisplay(self,"latentheat","latent heat of fusion [J/m^3]"))
-		string="%s\n%s"%(string,fielddisplay(self,"beta","rate of change of melting point with pressure [K/Pa]"))
-		string="%s\n%s"%(string,fielddisplay(self,"mixed_layer_capacity","mixed layer capacity [W/kg/K]"))
-		string="%s\n%s"%(string,fielddisplay(self,"thermal_exchange_velocity","thermal exchange velocity [m/s]"))
-		string="%s\n%s"%(string,fielddisplay(self,"rheology_B","flow law parameter [Pa s^(1/n)]"))
-		string="%s\n%s"%(string,fielddisplay(self,"rheology_n","Glen's flow law exponent"))
-		string="%s\n%s"%(string,fielddisplay(self,"rheology_law","law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'"))
-		string="%s\n%s"%(string,fielddisplay(self,"lithosphere_shear_modulus","Lithosphere shear modulus [Pa]"))
-		string="%s\n%s"%(string,fielddisplay(self,"lithosphere_density","Lithosphere density [g/cm^-3]"))
-		string="%s\n%s"%(string,fielddisplay(self,"mantle_shear_modulus","Mantle shear modulus [Pa]"))
-		string="%s\n%s"%(string,fielddisplay(self,"mantle_density","Mantle density [g/cm^-3]"))
-		string="%s\n%s"%(string,fielddisplay(self,"earth_density","Mantle density [kg/m^-3]"))
+    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)
+        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 * 1.0e5
+        #ice thermal conductivity (W / m / K)
+        self.thermalconductivity = 2.4
+        #temperate ice thermal conductivity (W / m / K)
+        self.temperateiceconductivity = 0.24
+        #computation of effective conductivity
+        self.effectiveconductivity_averaging = 1
+        #the melting point of ice at 1 atmosphere of pressure in K
+        self.meltingpoint = 273.15
+        #rate of change of melting point with pressure (K / Pa)
+        self.beta = 9.8 * 1.0e-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 * 1.0e-4
+        #Rheology law: what is the temperature dependence of B with T
+        #available: none, paterson and arrhenius
+        self.rheology_law = 'Paterson'
 
-		return string
-		#}}}
-	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.
+        # GIA:
+        self.lithosphere_shear_modulus = 6.7 * 1.0e10  # (Pa)
+        self.lithosphere_density = 3.32  # (g / cm^ - 3)
+        self.mantle_shear_modulus = 1.45 * 1.0e11  # (Pa)
+        self.mantle_density = 3.34  # (g / cm^ - 3)
 
-		#ocean water density (kg/m^3)
-		self.rho_water=1023.
+        #SLR
+        self.earth_density = 5512  #average density of the Earth, (kg / m^3)
+        return self
+    #}}}
 
-		#fresh water density (kg/m^3)
-		self.rho_freshwater=1000.
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
+        md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
+        md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0)
+        md = checkfield(md, 'fieldname', 'materials.mu_water', '>', 0)
+        md = checkfield(md, 'fieldname', 'materials.rheology_B', '>', 0, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, 'size', [md.mesh.numberofelements])
+        md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval'])
+        md = checkfield(md, 'fieldname', 'materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2])
+        md = checkfield(md, 'fieldname', 'materials.lithosphere_shear_modulus', '>', 0, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'materials.lithosphere_density', '>', 0, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'materials.mantle_shear_modulus', '>', 0, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'materials.mantle_density', '>', 0, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', [1])
+        return md
+    # }}}
 
-		#water viscosity (N.s/m^2)
-		self.mu_water=0.001787  
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 1, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mu_water', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'heatcapacity', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'latentheat', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermalconductivity', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'temperateiceconductivity', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'effectiveconductivity_averaging', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'meltingpoint', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'beta', 'format', 'Double')
+        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)
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_n', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_shear_modulus', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_density', 'format', 'Double', 'scale', 10.**3.)
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_shear_modulus', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_density', 'format', 'Double', 'scale', 10.**3.)
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double')
 
-		#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)
-		self.thermalconductivity=2.4
-
-		#temperate ice thermal conductivity (W/m/K)
-		self.temperateiceconductivity=0.24
-
-		#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
-		self.rheology_law='Paterson'
-
-		# GIA:
-		self.lithosphere_shear_modulus  = 6.7*10**10  # (Pa)
-		self.lithosphere_density        = 3.32        # (g/cm^-3)
-		self.mantle_shear_modulus       = 1.45*10**11 # (Pa)
-		self.mantle_density             = 3.34        # (g/cm^-3)
-		
-		#SLR
-		self.earth_density= 5512;  #average density of the Earth, (kg/m^3)
-
-
-		return self
-		#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		md = checkfield(md,'fieldname','materials.rho_ice','>',0)
-		md = checkfield(md,'fieldname','materials.rho_water','>',0)
-		md = checkfield(md,'fieldname','materials.rho_freshwater','>',0)
-		md = checkfield(md,'fieldname','materials.mu_water','>',0)
-		md = checkfield(md,'fieldname','materials.rheology_B','>',0,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements])
-		md = checkfield(md,'fieldname','materials.rheology_law','values',['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson','Arrhenius','LliboutryDuval'])
-		md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',[1]);
-		md = checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',[1]);
-		md = checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',[1]);
-		md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',[1]);
-		md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',[1]);
-
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'name','md.materials.type','data',1,'format','Integer');
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','mu_water','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','heatcapacity','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','latentheat','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double')
-		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)
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String')
-
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10.**3.);
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double');
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10.**3.);
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double');
-
-	# }}}
+    # }}}
Index: /issm/trunk/src/m/classes/matenhancedice.m
===================================================================
--- /issm/trunk/src/m/classes/matenhancedice.m	(revision 24312)
+++ /issm/trunk/src/m/classes/matenhancedice.m	(revision 24313)
@@ -14,4 +14,5 @@
 		thermalconductivity        = 0.;
 		temperateiceconductivity   = 0.;
+		effectiveconductivity_averaging = 0.;
 		meltingpoint               = 0.;
 		beta                       = 0.;
@@ -83,4 +84,7 @@
 			self.temperateiceconductivity=.24;
 
+			%computation of effective conductivity
+			self.effectiveconductivity_averaging=1;
+            
 			%the melting point of ice at 1 atmosphere of pressure in K
 			self.meltingpoint=273.15;
@@ -118,5 +122,6 @@
 			md = checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements 1]);
 			md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval'});
-
+			md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
+            
 			if ismember('GiaAnalysis',analyses),
 				md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1);
@@ -140,4 +145,5 @@
 			fielddisplay(self,'thermalconductivity',['ice thermal conductivity [W/m/K]']);
 			fielddisplay(self,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
+			fielddisplay(self,'effectiveconductivity_averaging','computation of effective conductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)');
 			fielddisplay(self,'meltingpoint','melting point of ice at 1atm in K');
 			fielddisplay(self,'latentheat','latent heat of fusion [J/kg]');
@@ -165,4 +171,5 @@
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double');
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double');
+			WriteData(fid,prefix,'object',self,'class','materials','fieldname','effectiveconductivity_averaging','format','Integer');
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double');
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double');
@@ -190,4 +197,5 @@
 			writejsdouble(fid,[modelname '.materials.thermalconductivity'],self.thermalconductivity);
 			writejsdouble(fid,[modelname '.materials.temperateiceconductivity'],self.temperateiceconductivity);
+			writejsdouble(fid,[modelname '.materials.effectiveconductivity_averaging'],self.effectiveconductivity_averaging);
 			writejsdouble(fid,[modelname '.materials.meltingpoint'],self.meltingpoint);
 			writejsdouble(fid,[modelname '.materials.beta'],self.beta);
Index: /issm/trunk/src/m/classes/matenhancedice.py
===================================================================
--- /issm/trunk/src/m/classes/matenhancedice.py	(revision 24312)
+++ /issm/trunk/src/m/classes/matenhancedice.py	(revision 24313)
@@ -4,168 +4,164 @@
 from WriteData import WriteData
 
+
 class matenhancedice(object):
-	"""
-	MATICE class definition
+    """
+    MATICE class definition
 
-	   Usage:
-	      matenhancedice=matenhancedice();
-	"""
+       Usage:
+          matenhancedice = matenhancedice()
+    """
 
-	def __init__(self): # {{{
-		self.rho_ice                   = 0.
-		self.rho_water                 = 0.
-		self.rho_freshwater            = 0.
-		self.mu_water                  = 0.
-		self.heatcapacity              = 0.
-		self.latentheat                = 0.
-		self.thermalconductivity       = 0.
-		self.temperateiceconductivity  = 0.
-		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.rheology_law              = ''
+    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.rheology_law = ''
 
-		#giaivins: 
-		self.lithosphere_shear_modulus  = 0.
-		self.lithosphere_density        = 0.
-		self.mantle_shear_modulus       = 0.
-		self.mantle_density             = 0.
-		
-		#SLR
-		self.earth_density= 0  # average density of the Earth, (kg/m^3)
+    #giaivins:
+        self.lithosphere_shear_modulus = 0.
+        self.lithosphere_density = 0.
+        self.mantle_shear_modulus = 0.
+        self.mantle_density = 0.
 
-		self.setdefaultparameters()
-		#}}}
-	def __repr__(self): # {{{
-		string="   Materials:"
+    #SLR
+        self.earth_density = 0  # average density of the Earth, (kg / m^3)
+        self.setdefaultparameters()
+    #}}}
 
-		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,"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_E","enhancement factor"))
-		string="%s\n%s"%(string,fielddisplay(self,"rheology_B","flow law parameter [Pa s^(1/n)]"))
-		string="%s\n%s"%(string,fielddisplay(self,"rheology_n","Glen's flow law exponent"))
-		string="%s\n%s"%(string,fielddisplay(self,"rheology_law","law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'"))
-		string="%s\n%s"%(string,fielddisplay(self,"lithosphere_shear_modulus","Lithosphere shear modulus [Pa]"))
-		string="%s\n%s"%(string,fielddisplay(self,"lithosphere_density","Lithosphere density [g/cm^-3]"))
-		string="%s\n%s"%(string,fielddisplay(self,"mantle_shear_modulus","Mantle shear modulus [Pa]"))
-		string="%s\n%s"%(string,fielddisplay(self,"mantle_density","Mantle density [g/cm^-3]"))
-		string="%s\n%s"%(string,fielddisplay(self,"earth_density","Mantle density [kg/m^-3]"))
+    def __repr__(self):  # {{{
+        string = "   Materials:"
+        string = "%s\n%s" % (string, fielddisplay(self, "rho_ice", "ice density [kg / m^3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "rho_water", "water density [kg / m^3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "rho_freshwater", "fresh water density [kg / m^3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "mu_water", "water viscosity [N s / m^2]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "heatcapacity", "heat capacity [J / kg / K]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "thermalconductivity", "ice thermal conductivity [W / m / K]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "temperateiceconductivity", "temperate ice thermal conductivity [W / m / K]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "effectiveconductivity_averaging", "computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "meltingpoint", "melting point of ice at 1atm in K"))
+        string = "%s\n%s" % (string, fielddisplay(self, "latentheat", "latent heat of fusion [J / m^3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "beta", "rate of change of melting point with pressure [K / Pa]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "mixed_layer_capacity", "mixed layer capacity [W / kg / K]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "thermal_exchange_velocity", "thermal exchange velocity [m / s]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "rheology_E", "enhancement factor"))
+        string = "%s\n%s" % (string, fielddisplay(self, "rheology_B", "flow law parameter [Pa s^(1 / n)]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "rheology_n", "Glen's flow law exponent"))
+        string = "%s\n%s" % (string, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'"))
+        string = "%s\n%s" % (string, fielddisplay(self, "lithosphere_shear_modulus", "Lithosphere shear modulus [Pa]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "lithosphere_density", "Lithosphere density [g / cm^ - 3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "mantle_shear_modulus", "Mantle shear modulus [Pa]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "mantle_density", "Mantle density [g / cm^ - 3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "earth_density", "Mantle density [kg / m^ - 3]"))
+        return string
+    #}}}
 
-		return string
-		#}}}
-	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.
+    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
+    #}}}
 
-		#ocean water density (kg/m^3)
-		self.rho_water=1023.
+    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)
+        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)
+        self.thermalconductivity = 2.4
+        #temperate ice thermal conductivity (W / m / K)
+        self.temperateiceconductivity = 0.24
+        #computation of effective conductivity
+        self.effectiveconductivity_averaging = 1
+        #the melting point of ice at 1 atmosphere of pressure in K
+        self.meltingpoint = 273.15
+        #rate of change of melting point with pressure (K / Pa)
+        self.beta = 9.8 * 10**-8
+        #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
+        self.rheology_law = 'Paterson'
 
-		#fresh water density (kg/m^3)
-		self.rho_freshwater=1000.
+    # 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)
 
-		#water viscosity (N.s/m^2)
-		self.mu_water=0.001787  
+    #SLR
+        self.earth_density = 5512  #average density of the Earth, (kg / m^3)
 
-		#ice heat capacity cp (J/kg/K)
-		self.heatcapacity=2093.
+        return self
+    #}}}
 
-		#ice latent heat of fusion L (J/kg)
-		self.latentheat=3.34*10**5
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
+        md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
+        md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0)
+        md = checkfield(md, 'fieldname', 'materials.mu_water', '>', 0)
+        md = checkfield(md, 'fieldname', 'materials.rheology_E', '>', 0, 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'materials.rheology_B', '>', 0, 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, 'size', [md.mesh.numberofelements])
+        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])
 
-		#ice thermal conductivity (W/m/K)
-		self.thermalconductivity=2.4
+        if 'GiaAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'materials.lithosphere_shear_modulus', '>', 0, 'numel', 1)
+            md = checkfield(md, 'fieldname', 'materials.lithosphere_density', '>', 0, 'numel', 1)
+            md = checkfield(md, 'fieldname', 'materials.mantle_shear_modulus', '>', 0, 'numel', 1)
+            md = checkfield(md, 'fieldname', 'materials.mantle_density', '>', 0, 'numel', 1)
+        if 'SealevelriseAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1)
+        return md
+    # }}}
 
-		#temperate ice thermal conductivity (W/m/K)
-		self.temperateiceconductivity=0.24
-
-		#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
-		self.rheology_law='Paterson'
-
-		# GIA:
-		self.lithosphere_shear_modulus  = 6.7*10**10  # (Pa)
-		self.lithosphere_density        = 3.32        # (g/cm^-3)
-		self.mantle_shear_modulus       = 1.45*10**11 # (Pa)
-		self.mantle_density             = 3.34        # (g/cm^-3)
-		
-		#SLR
-		self.earth_density= 5512  #average density of the Earth, (kg/m^3)
-
-		return self
-		#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		md = checkfield(md,'fieldname','materials.rho_ice','>',0)
-		md = checkfield(md,'fieldname','materials.rho_water','>',0)
-		md = checkfield(md,'fieldname','materials.rho_freshwater','>',0)
-		md = checkfield(md,'fieldname','materials.mu_water','>',0)
-		md = checkfield(md,'fieldname','materials.rheology_E','>',0,'timeseries',1,'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','materials.rheology_B','>',0,'timeseries',1,'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements])
-		md = checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka','Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval'])
-
-		if 'GiaAnalysis' in analyses:
-			md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1)
-			md = checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',1)
-			md = checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1)
-			md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1)
-		if 'SealevelriseAnalysis' in analyses:
-			md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1)
-		return md
-	# }}}
-	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')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','mu_water','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','heatcapacity','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','latentheat','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double')
-		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_E','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String')
-
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3)
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10^3)
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double')
-	# }}}
+    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')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mu_water', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'heatcapacity', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'latentheat', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermalconductivity', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'temperateiceconductivity', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'effectiveconductivity_averaging', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'meltingpoint', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'beta', 'format', 'Double')
+        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_E', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_B', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_n', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_shear_modulus', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_density', 'format', 'Double', 'scale', 10**3)
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_shear_modulus', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_density', 'format', 'Double', 'scale', 10**3)
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double')
+    # }}}
Index: /issm/trunk/src/m/classes/materials.m
===================================================================
--- /issm/trunk/src/m/classes/materials.m	(revision 24312)
+++ /issm/trunk/src/m/classes/materials.m	(revision 24313)
@@ -153,5 +153,5 @@
 					fielddisplay(self,'rheology_B','flow law parameter [Pa s^(1/n)]');
 					fielddisplay(self,'rheology_n','Glen''s flow law exponent');
-					fielddisplay(self,'rheology_law',['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'' or ''LliboutryDuval''']);
+					fielddisplay(self,'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:'));
@@ -183,5 +183,5 @@
 					md = checkfield(md,'fieldname','materials.rheology_B','>',0,'timeseries',1,'NaN',1,'Inf',1);
 					md = checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements 1]);
-					md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval'});
+					md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval' 'NyeCO2' 'NyeH2O'});
 				case 'litho'
 					if ~ismember('LoveAnalysis',analyses), return; end
Index: /issm/trunk/src/m/classes/materials.py
===================================================================
--- /issm/trunk/src/m/classes/materials.py	(revision 24312)
+++ /issm/trunk/src/m/classes/materials.py	(revision 24313)
@@ -4,277 +4,267 @@
 from checkfield import checkfield
 from WriteData import WriteData
-		
-def naturetointeger(strnat): #{{{
-    
-    intnat=np.zeros(len(strnat))
+
+
+def naturetointeger(strnat):  #{{{
+
+    intnat = np.zeros(len(strnat))
     for i in range(len(intnat)):
-        if strnat[i]=='damageice':
-            intnat[i]=1
-        elif strnat[i]=='estar':
-            intnat[i]=2 
-        elif strnat[i]=='ice':
-            intnat[i]=3 
-        elif strnat[i]=='enhancedice':
-            intnat[i]=4 
-        elif strnat[i]=='litho':
-            intnat[i]=5
-        else: 
-            raise RuntimeError("materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'')");
-    
-    return intnat
-# }}}
+        if strnat[i] == 'damageice':
+            intnat[i] = 1
+        elif strnat[i] == 'estar':
+            intnat[i] = 2
+        elif strnat[i] == 'ice':
+            intnat[i] = 3
+        elif strnat[i] == 'enhancedice':
+            intnat[i] = 4
+        elif strnat[i] == 'litho':
+            intnat[i] = 5
+        else:
+            raise RuntimeError("materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'')")
+
+        return intnat
+    # }}}
+
+
 class materials(object):
-	"""
-	MATERIALS class definition
-
-	   Usage:
-	      materials=materials();
-	"""
-
-	def __init__(self,*args): # {{{
-		
-                self.nature                    = []
-
-                if not len(args):
-                    self.nature=['ice']
-                else:
-                    self.nature=args
-
-                for i in range(len(self.nature)):
-                    if not(self.nature[i] == 'litho' or self.nature[i]=='ice'):
-                        raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho')")
-                    
-                #start filling in the dynamic fields: 
-                for i in range(len(self.nature)):
-                    nat=self.nature[i]; 
-                    if nat=='ice':
-                        setattr(self,'rho_ice',0)
-                        setattr(self,'rho_ice',0);
-                        setattr(self,'rho_water',0);
-                        setattr(self,'rho_freshwater',0);
-                        setattr(self,'mu_water',0);
-                        setattr(self,'heatcapacity',0);
-                        setattr(self,'latentheat',0);
-                        setattr(self,'thermalconductivity',0);
-                        setattr(self,'temperateiceconductivity',0);
-                        setattr(self,'meltingpoint',0);
-                        setattr(self,'beta',0);
-                        setattr(self,'mixed_layer_capacity',0);
-                        setattr(self,'thermal_exchange_velocity',0);
-                        setattr(self,'rheology_B',0);
-                        setattr(self,'rheology_n',0);
-                        setattr(self,'rheology_law',0);
-                    elif nat=='litho':
-                        setattr(self,'numlayers',0);
-                        setattr(self,'radius',0);
-                        setattr(self,'viscosity',0);
-                        setattr(self,'lame_lambda',0);
-                        setattr(self,'lame_mu',0);
-                        setattr(self,'burgers_viscosity',0);
-                        setattr(self,'burgers_mu',0);
-                        setattr(self,'isburgers',0);
-                        setattr(self,'density',0);
-                        setattr(self,'issolid',0);
-                    else:
-                        raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho')");
-                #set default parameters:
-		self.setdefaultparameters()
-		#}}}
-	def __repr__(self): # {{{
-		string="   Materials:"
-                for i in range(len(self.nature)):
-                    nat=self.nature[i]; 
-                    if nat=='ice':
-                        string="%s\n%s"%(string,'Ice:');
-                        string="%s\n%s"%(string,fielddisplay(self,"rho_ice","ice density [kg/m^3]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"rho_water","water density [kg/m^3]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"rho_freshwater","fresh water density [kg/m^3]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"mu_water","water viscosity [N s/m^2]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"heatcapacity","heat capacity [J/kg/K]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"thermalconductivity","ice thermal conductivity [W/m/K]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"temperateiceconductivity","temperate ice thermal conductivity [W/m/K]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"meltingpoint","melting point of ice at 1atm in K"))
-                        string="%s\n%s"%(string,fielddisplay(self,"latentheat","latent heat of fusion [J/m^3]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"beta","rate of change of melting point with pressure [K/Pa]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"mixed_layer_capacity","mixed layer capacity [W/kg/K]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"thermal_exchange_velocity","thermal exchange velocity [m/s]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"rheology_B","flow law parameter [Pa s^(1/n)]"))
-                        string="%s\n%s"%(string,fielddisplay(self,"rheology_n","Glen's flow law exponent"))
-                        string="%s\n%s"%(string,fielddisplay(self,"rheology_law","law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'"))
-                    elif nat=='litho':
-                        string="%s\n%s"%(string,'Litho:');
-                        string="%s\n%s"%(string,fielddisplay(self,'numlayers','number of layers (default 2)'))
-                        string="%s\n%s"%(string,fielddisplay(self,'radius','array describing the radius for each interface (numlayers+1) [m]'))
-                        string="%s\n%s"%(string,fielddisplay(self,'viscosity','array describing each layer''s viscosity (numlayers) [Pa.s]'))
-                        string="%s\n%s"%(string,fielddisplay(self,'lame_lambda','array describing the lame lambda parameter (numlayers) [Pa]'))
-                        string="%s\n%s"%(string,fielddisplay(self,'lame_mu','array describing the shear modulus for each layers (numlayers) [Pa]'))
-                        string="%s\n%s"%(string,fielddisplay(self,'burgers_viscosity','array describing each layer''s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]'))
-                        string="%s\n%s"%(string,fielddisplay(self,'burgers_mu','array describing each layer''s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]'))
-                        string="%s\n%s"%(string,fielddisplay(self,'isburgers','array describing whether we adopt a MaxWell (0) or Burgers (1) rheology (default 0)'))
-                        string="%s\n%s"%(string,fielddisplay(self,'density','array describing each layer''s density (numlayers) [kg/m^3]'))
-                        string="%s\n%s"%(string,fielddisplay(self,'issolid','array describing whether the layer is solid or liquid (default 1) (numlayers)'))
-
-                    else:
-                        raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho')");
-
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-            for i in range(len(self.nature)):
-                nat=self.nature[i]; 
-                if nat=='ice':
-                    self.rheology_B=project3d(md,'vector',self.rheology_B,'type','node')
-                    self.rheology_n=project3d(md,'vector',self.rheology_n,'type','element')
+    """
+    MATERIALS class definition
+
+       Usage:
+          materials = materials()
+    """
+
+    def __init__(self, *args):  # {{{
+        self.nature = []
+        if not len(args):
+            self.nature = ['ice']
+        else:
+            self.nature = args
+
+        for i in range(len(self.nature)):
+            if not(self.nature[i] == 'litho' or self.nature[i] == 'ice'):
+                raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho')")
+
+        #start filling in the dynamic fields:
+        for i in range(len(self.nature)):
+            nat = self.nature[i]
+            if nat == 'ice':
+                setattr(self, 'rho_ice', 0)
+                setattr(self, 'rho_ice', 0)
+                setattr(self, 'rho_water', 0)
+                setattr(self, 'rho_freshwater', 0)
+                setattr(self, 'mu_water', 0)
+                setattr(self, 'heatcapacity', 0)
+                setattr(self, 'latentheat', 0)
+                setattr(self, 'thermalconductivity', 0)
+                setattr(self, 'temperateiceconductivity', 0)
+                setattr(self, 'meltingpoint', 0)
+                setattr(self, 'beta', 0)
+                setattr(self, 'mixed_layer_capacity', 0)
+                setattr(self, 'thermal_exchange_velocity', 0)
+                setattr(self, 'rheology_B', 0)
+                setattr(self, 'rheology_n', 0)
+                setattr(self, 'rheology_law', 0)
+            elif nat == 'litho':
+                setattr(self, 'numlayers', 0)
+                setattr(self, 'radius', 0)
+                setattr(self, 'viscosity', 0)
+                setattr(self, 'lame_lambda', 0)
+                setattr(self, 'lame_mu', 0)
+                setattr(self, 'burgers_viscosity', 0)
+                setattr(self, 'burgers_mu', 0)
+                setattr(self, 'isburgers', 0)
+                setattr(self, 'density', 0)
+                setattr(self, 'issolid', 0)
+            else:
+                raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho')")
+    #set default parameters:
+        self.setdefaultparameters()
+    #}}}
+
+    def __repr__(self):  # {{{
+        string = "   Materials:"
+        for i in range(len(self.nature)):
+            nat = self.nature[i]
+            if nat == 'ice':
+                string = "%s\n%s" % (string, 'Ice:')
+                string = "%s\n%s" % (string, fielddisplay(self, "rho_ice", "ice density [kg / m^3]"))
+                string = "%s\n%s" % (string, fielddisplay(self, "rho_water", "water density [kg / m^3]"))
+                string = "%s\n%s" % (string, fielddisplay(self, "rho_freshwater", "fresh water density [kg / m^3]"))
+                string = "%s\n%s" % (string, fielddisplay(self, "mu_water", "water viscosity [N s / m^2]"))
+                string = "%s\n%s" % (string, fielddisplay(self, "heatcapacity", "heat capacity [J / kg / K]"))
+                string = "%s\n%s" % (string, fielddisplay(self, "thermalconductivity", "ice thermal conductivity [W / m / K]"))
+                string = "%s\n%s" % (string, fielddisplay(self, "temperateiceconductivity", "temperate ice thermal conductivity [W / m / K]"))
+                string = "%s\n%s" % (string, fielddisplay(self, "meltingpoint", "melting point of ice at 1atm in K"))
+                string = "%s\n%s" % (string, fielddisplay(self, "latentheat", "latent heat of fusion [J / m^3]"))
+                string = "%s\n%s" % (string, fielddisplay(self, "beta", "rate of change of melting point with pressure [K / Pa]"))
+                string = "%s\n%s" % (string, fielddisplay(self, "mixed_layer_capacity", "mixed layer capacity [W / kg / K]"))
+                string = "%s\n%s" % (string, fielddisplay(self, "thermal_exchange_velocity", "thermal exchange velocity [m / s]"))
+                string = "%s\n%s" % (string, fielddisplay(self, "rheology_B", "flow law parameter [Pa s^(1 / n)]"))
+                string = "%s\n%s" % (string, fielddisplay(self, "rheology_n", "Glen's flow law exponent"))
+                string = "%s\n%s" % (string, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', or 'NyeH2O'"))
+            elif nat == 'litho':
+                string = "%s\n%s" % (string, 'Litho:')
+                string = "%s\n%s" % (string, fielddisplay(self, 'numlayers', 'number of layers (default 2)'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'radius', 'array describing the radius for each interface (numlayers + 1) [m]'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'viscosity', 'array describing each layer''s viscosity (numlayers) [Pa.s]'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'lame_lambda', 'array describing the lame lambda parameter (numlayers) [Pa]'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'lame_mu', 'array describing the shear modulus for each layers (numlayers) [Pa]'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'burgers_viscosity', 'array describing each layer''s transient viscosity, only for Burgers rheologies  (numlayers) [Pa.s]'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'burgers_mu', 'array describing each layer''s transient shear modulus, only for Burgers rheologies  (numlayers) [Pa]'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'isburgers', 'array describing whether we adopt a MaxWell (0) or Burgers (1) rheology (default 0)'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'density', 'array describing each layer''s density (numlayers) [kg / m^3]'))
+                string = "%s\n%s" % (string, fielddisplay(self, 'issolid', 'array describing whether the layer is solid or liquid (default 1) (numlayers)'))
+
+            else:
+                raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho')")
+
+        return string
+    #}}}
+
+    def extrude(self, md):  # {{{
+        for i in range(len(self.nature)):
+            nat = self.nature[i]
+            if nat == 'ice':
+                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): # {{{
-            for i in range(len(self.nature)):
-                nat=self.nature[i]; 
-                if nat=='ice':
-                    #ice density (kg/m^3)
-                    self.rho_ice=917.
-
-                    #ocean water density (kg/m^3)
-                    self.rho_water=1023.
-
-                    #fresh water density (kg/m^3)
-                    self.rho_freshwater=1000.
-
-                    #water viscosity (N.s/m^2)
-                    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)
-                    self.thermalconductivity=2.4
-                    
-                    #wet ice thermal conductivity (W/m/K)
-                    self.temperateiceconductivity=.24
-
-                    #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
-                    self.rheology_law='Paterson'
-
-                elif nat=='litho':
-                    #we default to a configuration that enables running GIA solutions using giacaron and/or giaivins. 
-                    self.numlayers=2
-
-                    #center of the earth (approximation, must not be 0), then the lab (lithosphere/asthenosphere boundary) then the surface
-                    #(with 1d3 to avoid numerical singularities) 
-                    self.radius=[1e3,6278*1e3,6378*1e3]
-
-                    self.viscosity=[1e21,1e40] #mantle and lithosphere viscosity (respectively) [Pa.s]
-                    self.lame_mu=[1.45*1e11,6.7*1e10]  # (Pa) #lithosphere and mantle shear modulus (respectively) [Pa]
-                    self.lame_lambda=self.lame_mu  # (Pa) #mantle and lithosphere lamba parameter (respectively) [Pa]
-                    self.burgers_viscosity=[np.nan,np.nan]
-                    self.burgers_mu=[np.nan,np.nan]
-                    self.isburgers=[0,0]
-                    self.density=[5.51*1e3,5.50*1e3]  # (Pa) #mantle and lithosphere density [kg/m^3]
-                    self.issolid=[1,1] # is layer solid or liquid.
-
-                else:
-                    raise RuntimeError("materials setdefaultparameters error message: nature of the material not supported yet! ('ice' or 'litho')");
-
-		return self
-		#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-            for i in range(len(self.nature)):
-                nat=self.nature[i]; 
-                if nat=='ice':
-                    md = checkfield(md,'fieldname','materials.rho_ice','>',0)
-                    md = checkfield(md,'fieldname','materials.rho_water','>',0)
-                    md = checkfield(md,'fieldname','materials.rho_freshwater','>',0)
-                    md = checkfield(md,'fieldname','materials.mu_water','>',0)
-                    md = checkfield(md,'fieldname','materials.rheology_B','>',0,'timeseries',1,'NaN',1,'Inf',1)
-                    md = checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements])
-                    md = checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka','Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval'])
-                elif nat=='litho':
-                    if 'LoveAnalysis' not in analyses: 
-                        return md
-
-                    md = checkfield(md,'fieldname','materials.numlayers','NaN',1,'Inf',1,'>',0,'numel',[1])
-                    md = checkfield(md,'fieldname','materials.radius','NaN',1,'Inf',1,'size',[md.materials.numlayers+1,1],'>',0)
-                    md = checkfield(md,'fieldname','materials.lame_mu','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>=',0)
-                    md = checkfield(md,'fieldname','materials.lame_lambda','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>=',0)
-                    md = checkfield(md,'fieldname','materials.issolid','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>=',0,'<',2)
-                    md = checkfield(md,'fieldname','materials.density','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>',0)
-                    md = checkfield(md,'fieldname','materials.viscosity','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>=',0)
-                    md = checkfield(md,'fieldname','materials.isburgers','NaN',1,'Inf',1,'size',[md.materials.numlayers,1],'>=',0,'<=',1)
-                    md = checkfield(md,'fieldname','materials.burgers_viscosity','Inf',1,'size',[md.materials.numlayers,1],'>=',0)
-                    md = checkfield(md,'fieldname','materials.burgers_mu','Inf',1,'size',[md.materials.numlayers,1],'>=',0)
-
-                    for i in range(md.materials.numlayers):
-                        if md.materials.isburgers[i] and (np.isnan(md.materials.burgers_viscosity[i] or np.isnan(md.materials.burgers_mu[i]))):
-                            raise RuntimeError("materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with isburgers choice")
-                        
-                    if md.materials.issolid[0]==0 or md.materials.lame_mu[0]==0:
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+        for i in range(len(self.nature)):
+            nat = self.nature[i]
+            if nat == 'ice':
+                #ice density (kg / m^3)
+                self.rho_ice = 917.
+                #ocean water density (kg / m^3)
+                self.rho_water = 1023.
+                #fresh water density (kg / m^3)
+                self.rho_freshwater = 1000.
+                #water viscosity (N.s / m^2)
+                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 * 1.0e5
+                #ice thermal conductivity (W / m / K)
+                self.thermalconductivity = 2.4
+                #wet ice thermal conductivity (W / m / K)
+                self.temperateiceconductivity = 0.24
+                #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 * 1.0e-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 * 1.0e-4
+                #Rheology law: what is the temperature dependence of B with T
+                #available: none, paterson and arrhenius
+                self.rheology_law = 'Paterson'
+
+            elif nat == 'litho':
+                #we default to a configuration that enables running GIA solutions using giacaron and / or giaivins.
+                self.numlayers = 2
+                #center of the earth (approximation, must not be 0), then the lab (lithosphere / asthenosphere boundary) then the surface
+                #(with 1d3 to avoid numerical singularities)
+                self.radius = [1e3, 6278 * 1e3, 6378 * 1e3]
+                self.viscosity = [1e21, 1e40]  #mantle and lithosphere viscosity (respectively) [Pa.s]
+                self.lame_mu = [1.45 * 1e11, 6.7 * 1e10]  # (Pa)  #lithosphere and mantle shear modulus (respectively) [Pa]
+                self.lame_lambda = self.lame_mu  # (Pa)  #mantle and lithosphere lamba parameter (respectively) [Pa]
+                self.burgers_viscosity = [np.nan, np.nan]
+                self.burgers_mu = [np.nan, np.nan]
+                self.isburgers = [0, 0]
+                self.density = [5.51 * 1e3, 5.50 * 1e3]  # (Pa)  #mantle and lithosphere density [kg / m^3]
+                self.issolid = [1, 1]  # is layer solid or liquid.
+
+            else:
+                raise RuntimeError("materials setdefaultparameters error message: nature of the material not supported yet! ('ice' or 'litho')")
+
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        for i in range(len(self.nature)):
+            nat = self.nature[i]
+            if nat == 'ice':
+                md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
+                md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
+                md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0)
+                md = checkfield(md, 'fieldname', 'materials.mu_water', '>', 0)
+                md = checkfield(md, 'fieldname', 'materials.rheology_B', '>', 0, 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+                md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, 'size', [md.mesh.numberofelements])
+                md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', 'NyeH2O'])
+
+            elif nat == 'litho':
+                if 'LoveAnalysis' not in analyses:
+                    return md
+
+                md = checkfield(md, 'fieldname', 'materials.numlayers', 'NaN', 1, 'Inf', 1, '>', 0, 'numel', [1])
+                md = checkfield(md, 'fieldname', 'materials.radius', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers + 1, 1], '>', 0)
+                md = checkfield(md, 'fieldname', 'materials.lame_mu', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
+                md = checkfield(md, 'fieldname', 'materials.lame_lambda', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
+                md = checkfield(md, 'fieldname', 'materials.issolid', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0, '<', 2)
+                md = checkfield(md, 'fieldname', 'materials.density', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>', 0)
+                md = checkfield(md, 'fieldname', 'materials.viscosity', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
+                md = checkfield(md, 'fieldname', 'materials.isburgers', 'NaN', 1, 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0, '<=', 1)
+                md = checkfield(md, 'fieldname', 'materials.burgers_viscosity', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
+                md = checkfield(md, 'fieldname', 'materials.burgers_mu', 'Inf', 1, 'size', [md.materials.numlayers, 1], '>=', 0)
+
+                for i in range(md.materials.numlayers):
+                    if md.materials.isburgers[i] and (np.isnan(md.materials.burgers_viscosity[i] or np.isnan(md.materials.burgers_mu[i]))):
+                        raise RuntimeError("materials checkconsistency error message: Litho burgers_viscosity or burgers_mu has NaN values, inconsistent with isburgers choice")
+
+                    if md.materials.issolid[0] == 0 or md.materials.lame_mu[0] == 0:
                         raise RuntimeError('First layer must be solid (issolid(1) > 0 AND lame_mu(1) > 0). Add a weak inner core if necessary.')
-                    
-                    for i in range(md.materials.numlayers-1):
-                        if (not md.materials.issolid[i]) and (not md.materials.issolid[i+1]): #if there are at least two consecutive indices that contain issolid = 0
-                            raise RuntimeError("%s%i%s"%('2 or more adjacent fluid layers detected starting at layer ',i,'. This is not supported yet. Consider merging them.'))
-
-                else:
-                    raise RuntimeError("materials checkconsistency error message: nature of the material not supported yet! ('ice' or 'litho')");
-
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-
-            #1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum 
-            WriteData(fid,prefix,'name','md.materials.type','data',6,'format','Integer')
-            WriteData(fid,prefix,'name','md.materials.nature','data',naturetointeger(self.nature),'format','IntMat','mattype',3)
-
-            for i in range(len(self.nature)):
-                nat=self.nature[i]; 
-                if nat=='ice':
-
-                    WriteData(fid,prefix,'name','md.materials.type','data',3,'format','Integer')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','mu_water','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','heatcapacity','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','latentheat','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double')
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double')
-                    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)
-                    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')
-
-                elif nat=='litho':
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','numlayers','format','Integer') 
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','radius','format','DoubleMat','mattype',3)
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','lame_mu','format','DoubleMat','mattype',3)
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','lame_lambda','format','DoubleMat','mattype',3)
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','issolid','format','DoubleMat','mattype',3)
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','density','format','DoubleMat','mattype',3) 
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','viscosity','format','DoubleMat','mattype',3) 
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','isburgers','format','DoubleMat','mattype',3) 
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','burgers_viscosity','format','DoubleMat','mattype',3) 
-                    WriteData(fid,prefix,'object',self,'class','materials','fieldname','burgers_mu','format','DoubleMat','mattype',3)
-
-                else:
-                    raise RuntimeError("materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'')")
-
-	# }}}
+
+                    for i in range(md.materials.numlayers - 1):
+                        if (not md.materials.issolid[i]) and (not md.materials.issolid[i + 1]):  #if there are at least two consecutive indices that contain issolid = 0
+                            raise RuntimeError("%s%i%s" % ('2 or more adjacent fluid layers detected starting at layer ', i, '. This is not supported yet. Consider merging them.'))
+
+            else:
+                raise RuntimeError("materials checkconsistency error message: nature of the material not supported yet! ('ice' or 'litho')")
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        #1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum
+        WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 6, 'format', 'Integer')
+        WriteData(fid, prefix, 'name', 'md.materials.nature', 'data', naturetointeger(self.nature), 'format', 'IntMat', 'mattype', 3)
+
+        for i in range(len(self.nature)):
+            nat = self.nature[i]
+            if nat == 'ice':
+                WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 3, 'format', 'Integer')
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double')
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double')
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mu_water', 'format', 'Double')
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'heatcapacity', 'format', 'Double')
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'latentheat', 'format', 'Double')
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermalconductivity', 'format', 'Double')
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'temperateiceconductivity', 'format', 'Double')
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'meltingpoint', 'format', 'Double')
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'beta', 'format', 'Double')
+                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)
+                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')
+
+            elif nat == 'litho':
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'numlayers', 'format', 'Integer')
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'radius', 'format', 'DoubleMat', 'mattype', 3)
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lame_mu', 'format', 'DoubleMat', 'mattype', 3)
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lame_lambda', 'format', 'DoubleMat', 'mattype', 3)
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'issolid', 'format', 'DoubleMat', 'mattype', 3)
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'density', 'format', 'DoubleMat', 'mattype', 3)
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'viscosity', 'format', 'DoubleMat', 'mattype', 3)
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'isburgers', 'format', 'DoubleMat', 'mattype', 3)
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'burgers_viscosity', 'format', 'DoubleMat', 'mattype', 3)
+                WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'burgers_mu', 'format', 'DoubleMat', 'mattype', 3)
+
+            else:
+                raise RuntimeError("materials constructor error message: nature of the material not supported yet! (''ice'' or ''litho'')")
+    # }}}
Index: /issm/trunk/src/m/classes/matestar.m
===================================================================
--- /issm/trunk/src/m/classes/matestar.m	(revision 24312)
+++ /issm/trunk/src/m/classes/matestar.m	(revision 24313)
@@ -14,4 +14,5 @@
 		thermalconductivity        = 0.;
 		temperateiceconductivity   = 0.;
+		effectiveconductivity_averaging = 0;
 		meltingpoint               = 0.;
 		beta                       = 0.;
@@ -90,4 +91,7 @@
 			self.temperateiceconductivity=.24;
 
+			%computation of effective conductivity
+			self.effectiveconductivity_averaging=1;
+            
 			%the melting point of ice at 1 atmosphere of pressure in K
 			self.meltingpoint=273.15;
@@ -125,5 +129,6 @@
 			md = checkfield(md,'fieldname','materials.rheology_Es','>',0,'size',[md.mesh.numberofvertices 1],'NaN',1,'Inf',1);
 			md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval'});
-
+			md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
+            
 			if ismember('GiaAnalysis',analyses),
 				md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1);
@@ -147,4 +152,5 @@
 			fielddisplay(self,'thermalconductivity',['ice thermal conductivity [W/m/K]']);
 			fielddisplay(self,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
+			fielddisplay(self,'effectiveconductivity_averaging','computation of effective conductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)');
 			fielddisplay(self,'meltingpoint','melting point of ice at 1atm in K');
 			fielddisplay(self,'latentheat','latent heat of fusion [J/kg]');
@@ -172,4 +178,5 @@
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double');
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double');
+			WriteData(fid,prefix,'object',self,'class','materials','fieldname','effectiveconductivity_averaging','format','Integer');
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double');
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double');
@@ -197,4 +204,5 @@
 			writejsdouble(fid,[modelname '.materials.thermalconductivity'],self.thermalconductivity);
 			writejsdouble(fid,[modelname '.materials.temperateiceconductivity'],self.temperateiceconductivity);
+			writejsdouble(fid,[modelname '.materials.effectiveconductivity_averaging'],self.effectiveconductivity_averaging);
 			writejsdouble(fid,[modelname '.materials.meltingpoint'],self.meltingpoint);
 			writejsdouble(fid,[modelname '.materials.beta'],self.beta);
Index: /issm/trunk/src/m/classes/matestar.py
===================================================================
--- /issm/trunk/src/m/classes/matestar.py	(revision 24312)
+++ /issm/trunk/src/m/classes/matestar.py	(revision 24313)
@@ -1,3 +1,2 @@
-import numpy as np
 from fielddisplay import fielddisplay
 from project3d import project3d
@@ -5,171 +4,166 @@
 from WriteData import WriteData
 
+
 class matestar(object):
-	"""
-	matestar class definition
+    """
+    matestar class definition
 
-	   Usage:
-	      matestar=matestar()
-	"""
+       Usage:
+          matestar = matestar()
+    """
 
-	def __init__(self): # {{{
-		
-		rho_ice                    = 0.
-		rho_water                  = 0.
-		rho_freshwater             = 0.
-		mu_water                   = 0.
-		heatcapacity               = 0.
-		latentheat                 = 0.
-		thermalconductivity        = 0.
-		temperateiceconductivity   = 0.
-		meltingpoint               = 0.
-		beta                       = 0.
-		mixed_layer_capacity       = 0.
-		thermal_exchange_velocity  = 0.
-		rheology_B    = float('NaN')
-		rheology_Ec   = float('NaN')
-		rheology_Es   = float('NaN')
-		rheology_law = ''
+    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_B = float('NaN')
+        self.rheology_Ec = float('NaN')
+        self.rheology_Es = float('NaN')
+        self.rheology_law = ''
 
-		#giaivins: 
-		lithosphere_shear_modulus  = 0.
-		lithosphere_density        = 0.
-		mantle_shear_modulus       = 0.
-		mantle_density             = 0.
+        #giaivins:
+        self.lithosphere_shear_modulus = 0.
+        self.lithosphere_density = 0.
+        self.mantle_shear_modulus = 0.
+        self.mantle_density = 0.
 
-		#slr
-		earth_density              = 0
+        #slr
+        self.earth_density = 0
 
-                #set default parameters:
-		self.setdefaultparameters()
-	#}}}
-	def __repr__(self): # {{{
-		string="   Materials:"
+        #set default parameters:
+        self.setdefaultparameters()
+    #}}}
 
-		string="%s\n%s"%(string,fielddisplay(self,'rho_ice','ice density [kg/m^3]'))
-		string="%s\n%s"%(string,fielddisplay(self,'rho_water','ocean water density [kg/m^3]'))
-		string="%s\n%s"%(string,fielddisplay(self,'rho_freshwater','fresh water density [kg/m^3]'))
-		string="%s\n%s"%(string,fielddisplay(self,'mu_water','water viscosity [N s/m^2]'))
-		string="%s\n%s"%(string,fielddisplay(self,'heatcapacity','heat capacity [J/kg/K]'))
-		string="%s\n%s"%(string,fielddisplay(self,'thermalconductivity',['ice thermal conductivity [W/m/K]']))
-		string="%s\n%s"%(string,fielddisplay(self,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]'))
-		string="%s\n%s"%(string,fielddisplay(self,'meltingpoint','melting point of ice at 1atm in K'))
-		string="%s\n%s"%(string,fielddisplay(self,'latentheat','latent heat of fusion [J/kg]'))
-		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/3)]'))
-		string="%s\n%s"%(string,fielddisplay(self,'rheology_Ec','compressive enhancement factor'))
-		string="%s\n%s"%(string,fielddisplay(self,'rheology_Es','shear enhancement factor'))
-		string="%s\n%s"%(string,fielddisplay(self,'rheology_law',['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', ''Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'' or ''LliboutryDuval''']))
-		string="%s\n%s"%(string,fielddisplay(self,'lithosphere_shear_modulus','Lithosphere shear modulus [Pa]'))
-		string="%s\n%s"%(string,fielddisplay(self,'lithosphere_density','Lithosphere density [g/cm^-3]'))
-		string="%s\n%s"%(string,fielddisplay(self,'mantle_shear_modulus','Mantle shear modulus [Pa]'))
-		string="%s\n%s"%(string,fielddisplay(self,'mantle_density','Mantle density [g/cm^-3]'))
-		string="%s\n%s"%(string,fielddisplay(self,'earth_density','Mantle density [kg/m^-3]'))
+    def __repr__(self):  # {{{
+        string = "   Materials:"
+        string = "%s\n%s" % (string, fielddisplay(self, 'rho_ice', 'ice density [kg / m^3]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'rho_water', 'ocean water density [kg / m^3]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'rho_freshwater', 'fresh water density [kg / m^3]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'mu_water', 'water viscosity [N s / m^2]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'heatcapacity', 'heat capacity [J / kg / K]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'thermalconductivity', ['ice thermal conductivity [W / m / K]']))
+        string = "%s\n%s" % (string, fielddisplay(self, 'temperateiceconductivity', 'temperate ice thermal conductivity [W / m / K]'))
+        string = "%s\n%s" % (string, fielddisplay(self, "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 / kg]'))
+        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 / 3)]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'rheology_Ec', 'compressive enhancement factor'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'rheology_Es', 'shear enhancement factor'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'rheology_law', ['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', ''Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'' or ''LliboutryDuval''']))
+        string = "%s\n%s" % (string, fielddisplay(self, 'lithosphere_shear_modulus', 'Lithosphere shear modulus [Pa]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'lithosphere_density', 'Lithosphere density [g / cm^ - 3]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'mantle_shear_modulus', 'Mantle shear modulus [Pa]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'mantle_density', 'Mantle density [g / cm^ - 3]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'earth_density', 'Mantle density [kg / m^ - 3]'))
+        return string
+    #}}}
 
-		return string
-	#}}}
-	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')
-		self.rheology_Es=project3d(md,'vector',self.rheology_Es,'type','node')
-       		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
-		#ice density (kg/m^3)
-		self.rho_ice=917.
+    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')
+        self.rheology_Es = project3d(md, 'vector', self.rheology_Es, 'type', 'node')
+        return self
+    #}}}
 
-		#ocean water density (kg/m^3)
-		self.rho_water=1023.
+    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)
+        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 * 1.0e5
+        #ice thermal conductivity (W / m / K)
+        self.thermalconductivity = 2.4
+        #wet ice thermal conductivity (W / m / K)
+        self.temperateiceconductivity = 0.24
+        #computation of effective conductivity
+        self.effectiveconductivity_averaging = 1
+        #the melting point of ice at 1 atmosphere of pressure in K
+        self.meltingpoint = 273.15
+        #rate of change of melting point with pressure (K / Pa)
+        self.beta = 9.8 * 1.0e-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 * 1.0e-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 * 1.0e10  # (Pa)
+        self.lithosphere_density = 3.32  # (g / cm^ - 3)
+        self.mantle_shear_modulus = 1.45 * 1.0e11  # (Pa)
+        self.mantle_density = 3.34  # (g / cm^ - 3)
+    #SLR
+        self.earth_density = 5512  # average density of the Earth, (kg / m^3)
 
-		#fresh water density (kg/m^3)
-		self.rho_freshwater=1000.
+        return self
+    #}}}
 
-		#water viscosity (N.s/m^2)
-		self.mu_water=0.001787 
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
+        md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
+        md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0)
+        md = checkfield(md, 'fieldname', 'materials.mu_water', '>', 0)
+        md = checkfield(md, 'fieldname', 'materials.rheology_B', '>', 0, 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'materials.rheology_Ec', '>', 0, 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'materials.rheology_Es', '>', 0, 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+        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])
 
-		#ice heat capacity cp (J/kg/K)
-		self.heatcapacity=2093.
+        if 'GiaAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'materials.lithosphere_shear_modulus', '>', 0, 'numel', 1)
+            md = checkfield(md, 'fieldname', 'materials.lithosphere_density', '>', 0, 'numel', 1)
+            md = checkfield(md, 'fieldname', 'materials.mantle_shear_modulus', '>', 0, 'numel', 1)
+            md = checkfield(md, 'fieldname', 'materials.mantle_density', '>', 0, 'numel', 1)
 
-		#ice latent heat of fusion L (J/kg)
-		self.latentheat=3.34*10**5
+        if 'SealevelriseAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1)
 
-		#ice thermal conductivity (W/m/K)
-		self.thermalconductivity=2.4
-			
-		#wet ice thermal conductivity (W/m/K)
-		self.temperateiceconductivity=.24
+        return md
+    # }}}
 
-		#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
-		self.rheology_law='Paterson'
-
-		# GIA:
-		self.lithosphere_shear_modulus  = 6.7*10**10  # (Pa)
-		self.lithosphere_density        = 3.32      # (g/cm^-3)
-		self.mantle_shear_modulus       = 1.45*10**11 # (Pa)
-		self.mantle_density             = 3.34      # (g/cm^-3)
-
-		#SLR
-		self.earth_density= 5512  # average density of the Earth, (kg/m^3)
-
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		md = checkfield(md,'fieldname','materials.rho_ice','>',0)
-		md = checkfield(md,'fieldname','materials.rho_water','>',0)
-		md = checkfield(md,'fieldname','materials.rho_freshwater','>',0)
-		md = checkfield(md,'fieldname','materials.mu_water','>',0)
-		md = checkfield(md,'fieldname','materials.rheology_B','>',0,'size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','materials.rheology_Ec','>',0,'size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','materials.rheology_Es','>',0,'size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka', 'Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval'])
-
-		if 'GiaAnalysis' in analyses:
-			md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',1)
-			md = checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',1)
-			md = checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',1)
-			md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',1)
-		if 'SealevelriseAnalysis' in analyses:
-			md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1)
-
-		return md
-	# }}}
-	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')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','mu_water','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','heatcapacity','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','latentheat','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double')
-		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)
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_Ec','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_Es','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String')
-
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3)
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10**3)
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double')
-	# }}}
+    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')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mu_water', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'heatcapacity', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'latentheat', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermalconductivity', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'temperateiceconductivity', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'effectiveconductivity_averaging', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'meltingpoint', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'beta', 'format', 'Double')
+        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)
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_Ec', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_Es', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_shear_modulus', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_density', 'format', 'Double', 'scale', 1.0e3)
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_shear_modulus', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_density', 'format', 'Double', 'scale', 1.0e3)
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double')
+    # }}}
Index: /issm/trunk/src/m/classes/matice.js
===================================================================
--- /issm/trunk/src/m/classes/matice.js	(revision 24312)
+++ /issm/trunk/src/m/classes/matice.js	(revision 24313)
@@ -76,5 +76,5 @@
 		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' or 'LliboutryDuval'");
+		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]');
@@ -99,5 +99,5 @@
 		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']);
+		checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka','Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval','NyeH2O','NyeCO2']);
 
 		if(ArrayAnyEqual(ArrayIsMember('GiaAnalysis',analyses),1)){
Index: /issm/trunk/src/m/classes/matice.m
===================================================================
--- /issm/trunk/src/m/classes/matice.m	(revision 24312)
+++ /issm/trunk/src/m/classes/matice.m	(revision 24313)
@@ -14,4 +14,5 @@
 		thermalconductivity        = 0.;
 		temperateiceconductivity   = 0.;
+		effectiveconductivity_averaging = 0.;
 		meltingpoint               = 0.;
 		beta                       = 0.;
@@ -80,4 +81,7 @@
 			%wet ice thermal conductivity (W/m/K)
 			self.temperateiceconductivity=.24;
+			
+			%computation of effective conductivity
+			self.effectiveconductivity_averaging=1;
 
 			%the melting point of ice at 1 atmosphere of pressure in K
@@ -114,5 +118,6 @@
 			md = checkfield(md,'fieldname','materials.rheology_B','>',0,'timeseries',1,'NaN',1,'Inf',1);
 			md = checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements 1]);
-			md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval'});
+			md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval' 'NyeCO2' 'NyeH2O'});
+			md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]);
 
 			if ismember('GiaAnalysis',analyses),
@@ -137,4 +142,5 @@
 			fielddisplay(self,'thermalconductivity',['ice thermal conductivity [W/m/K]']);
 			fielddisplay(self,'temperateiceconductivity','temperate ice thermal conductivity [W/m/K]');
+			fielddisplay(self,'effectiveconductivity_averaging','computation of effective conductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)');
 			fielddisplay(self,'meltingpoint','melting point of ice at 1atm in K');
 			fielddisplay(self,'latentheat','latent heat of fusion [J/kg]');
@@ -144,5 +150,5 @@
 			fielddisplay(self,'rheology_B','flow law parameter [Pa s^(1/n)]');
 			fielddisplay(self,'rheology_n','Glen''s flow law exponent');
-			fielddisplay(self,'rheology_law',['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'' or ''LliboutryDuval''']);
+			fielddisplay(self,'rheology_law',['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'', ''LliboutryDuval'', ''NyeH2O'', or ''NyeCO2''']);
 			fielddisplay(self,'lithosphere_shear_modulus','Lithosphere shear modulus [Pa]');
 			fielddisplay(self,'lithosphere_density','Lithosphere density [g/cm^-3]');
@@ -161,4 +167,5 @@
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double');
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double');
+			WriteData(fid,prefix,'object',self,'class','materials','fieldname','effectiveconductivity_averaging','format','Integer');
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double');
 			WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double');
@@ -185,4 +192,5 @@
 			writejsdouble(fid,[modelname '.materials.thermalconductivity'],self.thermalconductivity);
 			writejsdouble(fid,[modelname '.materials.temperateiceconductivity'],self.temperateiceconductivity);
+			writejsdouble(fid,[modelname '.materials.effectiveconductivity_averaging'],self.effectiveconductivity_averaging);
 			writejsdouble(fid,[modelname '.materials.meltingpoint'],self.meltingpoint);
 			writejsdouble(fid,[modelname '.materials.beta'],self.beta);
Index: /issm/trunk/src/m/classes/matice.py
===================================================================
--- /issm/trunk/src/m/classes/matice.py	(revision 24312)
+++ /issm/trunk/src/m/classes/matice.py	(revision 24313)
@@ -4,166 +4,158 @@
 from WriteData import WriteData
 
+
 class matice(object):
-	"""
-	MATICE class definition
+    """
+    MATICE class definition
 
-	   Usage:
-	      matice=matice();
-	"""
+       Usage:
+          matice = matice()
+    """
 
-	def __init__(self): # {{{
-		self.rho_ice                   = 0.
-		self.rho_water                 = 0.
-		self.rho_freshwater            = 0.
-		self.mu_water                  = 0.
-		self.heatcapacity              = 0.
-		self.latentheat                = 0.
-		self.thermalconductivity       = 0.
-		self.temperateiceconductivity  = 0.
-		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.rheology_law              = ''
+    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_B = float('NaN')
+        self.rheology_n = float('NaN')
+        self.rheology_law = ''
 
-		#giaivins: 
-		self.lithosphere_shear_modulus  = 0.
-		self.lithosphere_density        = 0.
-		self.mantle_shear_modulus       = 0.
-		self.mantle_density             = 0.  
-		
-		#SLR
-		self.earth_density= 5512;  
+        #giaivins:
+        self.lithosphere_shear_modulus = 0.
+        self.lithosphere_density = 0.
+        self.mantle_shear_modulus = 0.
+        self.mantle_density = 0.
 
+        #SLR
+        self.earth_density = 5512
+        self.setdefaultparameters()
+    #}}}
 
+    def __repr__(self):  # {{{
+        string = "   Materials:"
 
-		self.setdefaultparameters()
-		#}}}
-	def __repr__(self): # {{{
-		string="   Materials:"
+        string = "%s\n%s" % (string, fielddisplay(self, "rho_ice", "ice density [kg / m^3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "rho_water", "water density [kg / m^3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "rho_freshwater", "fresh water density [kg / m^3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "mu_water", "water viscosity [N s / m^2]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "heatcapacity", "heat capacity [J / kg / K]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "thermalconductivity", "ice thermal conductivity [W / m / K]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "temperateiceconductivity", "temperate ice thermal conductivity [W / m / K]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "effectiveconductivity_averaging", "computation of effectiveconductivity: (0) arithmetic mean, (1) harmonic mean, (2) geometric mean (default)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "meltingpoint", "melting point of ice at 1atm in K"))
+        string = "%s\n%s" % (string, fielddisplay(self, "latentheat", "latent heat of fusion [J / m^3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "beta", "rate of change of melting point with pressure [K / Pa]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "mixed_layer_capacity", "mixed layer capacity [W / kg / K]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "thermal_exchange_velocity", "thermal exchange velocity [m / s]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "rheology_B", "flow law parameter [Pa s^(1 / n)]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "rheology_n", "Glen's flow law exponent"))
+        string = "%s\n%s" % (string, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', or 'NyeH2O'"))
+        string = "%s\n%s" % (string, fielddisplay(self, "lithosphere_shear_modulus", "Lithosphere shear modulus [Pa]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "lithosphere_density", "Lithosphere density [g / cm^ - 3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "mantle_shear_modulus", "Mantle shear modulus [Pa]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "mantle_density", "Mantle density [g / cm^ - 3]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "earth_density", "Mantle density [kg / m^ - 3]"))
+        return string
+    #}}}
 
-		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,"meltingpoint","melting point of ice at 1atm in K"))
-		string="%s\n%s"%(string,fielddisplay(self,"latentheat","latent heat of fusion [J/m^3]"))
-		string="%s\n%s"%(string,fielddisplay(self,"beta","rate of change of melting point with pressure [K/Pa]"))
-		string="%s\n%s"%(string,fielddisplay(self,"mixed_layer_capacity","mixed layer capacity [W/kg/K]"))
-		string="%s\n%s"%(string,fielddisplay(self,"thermal_exchange_velocity","thermal exchange velocity [m/s]"))
-		string="%s\n%s"%(string,fielddisplay(self,"rheology_B","flow law parameter [Pa s^(1/n)]"))
-		string="%s\n%s"%(string,fielddisplay(self,"rheology_n","Glen's flow law exponent"))
-		string="%s\n%s"%(string,fielddisplay(self,"rheology_law","law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'"))
-		string="%s\n%s"%(string,fielddisplay(self,"lithosphere_shear_modulus","Lithosphere shear modulus [Pa]"))
-		string="%s\n%s"%(string,fielddisplay(self,"lithosphere_density","Lithosphere density [g/cm^-3]"))
-		string="%s\n%s"%(string,fielddisplay(self,"mantle_shear_modulus","Mantle shear modulus [Pa]"))
-		string="%s\n%s"%(string,fielddisplay(self,"mantle_density","Mantle density [g/cm^-3]"))
-		string="%s\n%s"%(string,fielddisplay(self,"earth_density","Mantle density [kg/m^-3]"))
+    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)
+        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 * 1.0e5
+        #ice thermal conductivity (W / m / K)
+        self.thermalconductivity = 2.4
+        #computation of effective conductivity
+        self.effectiveconductivity_averaging = 1
+        #temperate ice thermal conductivity (W / m / K)
+        self.temperateiceconductivity = 0.24
+        #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 * 1.0e-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 * 1.0e-4
+        #Rheology law: what is the temperature dependence of B with T
+        #available: none, paterson and arrhenius
+        self.rheology_law = 'Paterson'
 
-		return string
-		#}}}
-	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.
+        # GIA:
+        self.lithosphere_shear_modulus = 6.7 * 1.0e10  # (Pa)
+        self.lithosphere_density = 3.32  # (g / cm^ - 3)
+        self.mantle_shear_modulus = 1.45 * 1.0e11  # (Pa)
+        self.mantle_density = 3.34  # (g / cm^ - 3)
 
-		#ocean water density (kg/m^3)
-		self.rho_water=1023.
+        #SLR
+        self.earth_density = 5512  # average density of the Earth, (kg / m^3)
+        return self
+    #}}}
 
-		#fresh water density (kg/m^3)
-		self.rho_freshwater=1000.
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0)
+        md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0)
+        md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0)
+        md = checkfield(md, 'fieldname', 'materials.mu_water', '>', 0)
+        md = checkfield(md, 'fieldname', 'materials.rheology_B', '>', 0, 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, 'size', [md.mesh.numberofelements])
+        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.lithosphere_shear_modulus', '>', 0, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'materials.lithosphere_density', '>', 0, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'materials.mantle_shear_modulus', '>', 0, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'materials.mantle_density', '>', 0, 'numel', [1])
+        md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', [1])
+        return md
+    # }}}
 
-		#water viscosity (N.s/m^2)
-		self.mu_water=0.001787  
+    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')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mu_water', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'heatcapacity', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'latentheat', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermalconductivity', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'temperateiceconductivity', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'effectiveconductivity_averaging', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'meltingpoint', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'beta', 'format', 'Double')
+        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)
+        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')
 
-		#ice heat capacity cp (J/kg/K)
-		self.heatcapacity=2093.
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_shear_modulus', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_density', 'format', 'Double', 'scale', 10.**3.)
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_shear_modulus', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_density', 'format', 'Double', 'scale', 10.**3.)
+        WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double')
 
-		#ice latent heat of fusion L (J/kg)
-		self.latentheat=3.34*10**5
-
-		#ice thermal conductivity (W/m/K)
-		self.thermalconductivity=2.4
-
-		#temperate ice thermal conductivity (W/m/K)
-		self.temperateiceconductivity=0.24
-
-		#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
-		self.rheology_law='Paterson'
-
-		# GIA:
-		self.lithosphere_shear_modulus  = 6.7*10**10  # (Pa)
-		self.lithosphere_density        = 3.32        # (g/cm^-3)
-		self.mantle_shear_modulus       = 1.45*10**11 # (Pa)
-		self.mantle_density             = 3.34        # (g/cm^-3)
-		
-		#SLR
-		self.earth_density= 5512;  # average density of the Earth, (kg/m^3)
-
-
-		return self
-		#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		md = checkfield(md,'fieldname','materials.rho_ice','>',0)
-		md = checkfield(md,'fieldname','materials.rho_water','>',0)
-		md = checkfield(md,'fieldname','materials.rho_freshwater','>',0)
-		md = checkfield(md,'fieldname','materials.mu_water','>',0)
-		md = checkfield(md,'fieldname','materials.rheology_B','>',0,'timeseries',1,'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','materials.rheology_n','>',0,'size',[md.mesh.numberofelements])
-		md = checkfield(md,'fieldname','materials.rheology_law','values',['None','BuddJacka','Cuffey','CuffeyTemperate','Paterson','Arrhenius','LliboutryDuval'])
-		md = checkfield(md,'fieldname','materials.lithosphere_shear_modulus','>',0,'numel',[1]);
-		md = checkfield(md,'fieldname','materials.lithosphere_density','>',0,'numel',[1]);
-		md = checkfield(md,'fieldname','materials.mantle_shear_modulus','>',0,'numel',[1]);
-		md = checkfield(md,'fieldname','materials.mantle_density','>',0,'numel',[1]);
-		md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',[1]);
-
-		return md
-	# }}}
-	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')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','mu_water','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','heatcapacity','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','latentheat','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double')
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double')
-		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)
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'data',self.rheology_law,'name','md.materials.rheology_law','format','String')
-
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10.**3.);
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double');
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10.**3.);
-		WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double');
-
-	# }}}
+    # }}}
Index: /issm/trunk/src/m/classes/mesh2d.py
===================================================================
--- /issm/trunk/src/m/classes/mesh2d.py	(revision 24312)
+++ /issm/trunk/src/m/classes/mesh2d.py	(revision 24313)
@@ -5,129 +5,136 @@
 from WriteData import WriteData
 
+
 class mesh2d(object):
-	"""
-	MESH2D class definition
+    """
+    MESH2D class definition
 
-	   Usage:
-	      mesh2d=mesh2d();
-	"""
+       Usage:
+          mesh2d = mesh2d()
+    """
 
-	def __init__(self): # {{{
-		self.x                           = float('NaN');
-		self.y                           = float('NaN');
-		self.elements                    = float('NaN');
-		self.numberofelements            = 0;
-		self.numberofvertices            = 0;
-		self.numberofedges               = 0;
-		
-		self.lat                         = float('NaN');
-		self.long                        = float('NaN');
-		self.epsg                        = 0;
-		self.scale_factor                = float('NaN');
+    def __init__(self):  # {{{
+        self.x = float('NaN')
+        self.y = float('NaN')
+        self.elements = float('NaN')
+        self.numberofelements = 0
+        self.numberofvertices = 0
+        self.numberofedges = 0
 
-		self.vertexonboundary            = float('NaN');
-		self.edges                       = float('NaN');
-		self.segments                    = float('NaN');
-		self.segmentmarkers              = float('NaN');
-		self.vertexconnectivity          = float('NaN');
-		self.elementconnectivity         = float('NaN');
-		self.average_vertex_connectivity = 0;
+        self.lat = float('NaN')
+        self.long = float('NaN')
+        self.epsg = 0
+        self.scale_factor = float('NaN')
 
-		self.extractedvertices           = float('NaN');
-		self.extractedelements           = float('NaN');
+        self.vertexonboundary = float('NaN')
+        self.edges = float('NaN')
+        self.segments = float('NaN')
+        self.segmentmarkers = float('NaN')
+        self.vertexconnectivity = float('NaN')
+        self.elementconnectivity = float('NaN')
+        self.average_vertex_connectivity = 0
 
-		#set defaults
-		self.setdefaultparameters()
+        self.extractedvertices = float('NaN')
+        self.extractedelements = float('NaN')
 
-		#}}}
-	def __repr__(self): # {{{
-		string="   2D tria Mesh (horizontal):" 
+    #set defaults
+        self.setdefaultparameters()
 
-		string="%s\n%s"%(string,"\n      Elements and vertices:")
-		string="%s\n%s"%(string,fielddisplay(self,"numberofelements","number of elements"))
-		string="%s\n%s"%(string,fielddisplay(self,"numberofvertices","number of vertices"))
-		string="%s\n%s"%(string,fielddisplay(self,"elements","vertex indices of the mesh elements"))
-		string="%s\n%s"%(string,fielddisplay(self,"x","vertices x coordinate [m]"))
-		string="%s\n%s"%(string,fielddisplay(self,"y","vertices y coordinate [m]"))
-		string="%s\n%s"%(string,fielddisplay(self,"edges","edges of the 2d mesh (vertex1 vertex2 element1 element2)"))
-		string="%s\n%s"%(string,fielddisplay(self,"numberofedges","number of edges of the 2d mesh"))
+    #}}}
 
-		string="%s%s"%(string,"\n\n      Properties:")
-		string="%s\n%s"%(string,fielddisplay(self,"vertexonboundary","vertices on the boundary of the domain flag list"))
-		string="%s\n%s"%(string,fielddisplay(self,"segments","edges on domain boundary (vertex1 vertex2 element)"))
-		string="%s\n%s"%(string,fielddisplay(self,"segmentmarkers","number associated to each segment"))
-		string="%s\n%s"%(string,fielddisplay(self,"vertexconnectivity","list of elements connected to vertex_i"))
-		string="%s\n%s"%(string,fielddisplay(self,"elementconnectivity","list of elements adjacent to element_i"))
-		string="%s\n%s"%(string,fielddisplay(self,"average_vertex_connectivity","average number of vertices connected to one vertex"))
+    def __repr__(self):  # {{{
+        string = "   2D tria Mesh (horizontal):"
 
-		string="%s%s"%(string,"\n\n      Extracted model:")
-		string="%s\n%s"%(string,fielddisplay(self,"extractedvertices","vertices extracted from the model"))
-		string="%s\n%s"%(string,fielddisplay(self,"extractedelements","elements extracted from the model"))
+        string = "%s\n%s" % (string, "\n      Elements and vertices:")
+        string = "%s\n%s" % (string, fielddisplay(self, "numberofelements", "number of elements"))
+        string = "%s\n%s" % (string, fielddisplay(self, "numberofvertices", "number of vertices"))
+        string = "%s\n%s" % (string, fielddisplay(self, "elements", "vertex indices of the mesh elements"))
+        string = "%s\n%s" % (string, fielddisplay(self, "x", "vertices x coordinate [m]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "y", "vertices y coordinate [m]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "edges", "edges of the 2d mesh (vertex1 vertex2 element1 element2)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "numberofedges", "number of edges of the 2d mesh"))
 
-		string="%s%s"%(string,"\n\n      Projection:")
-		string="%s\n%s"%(string,fielddisplay(self,"lat","vertices latitude [degrees]"))
-		string="%s\n%s"%(string,fielddisplay(self,"long","vertices longitude [degrees]"))
-		string="%s\n%s"%(string,fielddisplay(self,"epsg","EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)"))
-		string="%s\n%s"%(string,fielddisplay(self,"scale_factor","Projection correction for volume, area, etc. computation"))
-		return string
-		#}}}
-	def setdefaultparameters(self): # {{{
-		
-		#the connectivity is the averaged number of nodes linked to a
-		#given node through an edge. This connectivity is used to initially
-		#allocate memory to the stiffness matrix. A value of 16 seems to
-		#give a good memory/time ration. This value can be checked in
-		#trunk/test/Miscellaneous/runme.m
-		self.average_vertex_connectivity=25
+        string = "%s%s" % (string, "\n\n      Properties:")
+        string = "%s\n%s" % (string, fielddisplay(self, "vertexonboundary", "vertices on the boundary of the domain flag list"))
+        string = "%s\n%s" % (string, fielddisplay(self, "segments", "edges on domain boundary (vertex1 vertex2 element)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "segmentmarkers", "number associated to each segment"))
+        string = "%s\n%s" % (string, fielddisplay(self, "vertexconnectivity", "list of elements connected to vertex_i"))
+        string = "%s\n%s" % (string, fielddisplay(self, "elementconnectivity", "list of elements adjacent to element_i"))
+        string = "%s\n%s" % (string, fielddisplay(self, "average_vertex_connectivity", "average number of vertices connected to one vertex"))
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		if(solution=='LoveSolution'):
-			return
+        string = "%s%s" % (string, "\n\n      Extracted model:")
+        string = "%s\n%s" % (string, fielddisplay(self, "extractedvertices", "vertices extracted from the model"))
+        string = "%s\n%s" % (string, fielddisplay(self, "extractedelements", "elements extracted from the model"))
 
-		md = checkfield(md,'fieldname','mesh.x','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','mesh.y','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','mesh.elements','NaN',1,'Inf',1,'>',0,'values',np.arange(1,md.mesh.numberofvertices+1))
-		md = checkfield(md,'fieldname','mesh.elements','size',[md.mesh.numberofelements,3])
-		if np.any(np.logical_not(m.ismember(np.arange(1,md.mesh.numberofvertices+1),md.mesh.elements))):
-			md.checkmessage("orphan nodes have been found. Check the mesh outline")
-		md = checkfield(md,'fieldname','mesh.numberofelements','>',0)
-		md = checkfield(md,'fieldname','mesh.numberofvertices','>',0)
-		md = checkfield(md,'fieldname','mesh.average_vertex_connectivity','>=',9,'message',"'mesh.average_vertex_connectivity' should be at least 9 in 2d")
-		md = checkfield(md,'fieldname','mesh.segments','NaN',1,'Inf',1,'>',0,'size',[np.nan,3]);
-		if(np.size(self.scale_factor)>1):
-                        md = checkfield(md,'fieldname','mesh.scale_factor','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-                
-		if solution=='ThermalSolution':
-			md.checkmessage("thermal not supported for 2d mesh")
+        string = "%s%s" % (string, "\n\n      Projection:")
+        string = "%s\n%s" % (string, fielddisplay(self, "lat", "vertices latitude [degrees]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "long", "vertices longitude [degrees]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "epsg", "EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "scale_factor", "Projection correction for volume, area, etc. computation"))
+        return string
+    #}}}
 
-		return md
-	# }}}
-	def domaintype(self): # {{{
-		return "2Dhorizontal"
-	#}}}
-	def dimension(self): # {{{
-		return 2
-	#}}}
-	def elementtype(self): # {{{
-		return "Tria"
-	#}}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'name','md.mesh.domain_type','data',"Domain"+self.domaintype(),'format','String');
-		WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',self.dimension(),'format','Integer');
-		WriteData(fid,prefix,'name','md.mesh.elementtype','data',self.elementtype(),'format','String');
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'name','md.mesh.z','data',np.zeros(self.numberofvertices),'format','DoubleMat','mattype',1);
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonboundary','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','segments','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','scale_factor','format','DoubleMat','mattype',1)
-		if md.transient.isoceancoupling:
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','lat','format','DoubleMat','mattype',1)
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','long','format','DoubleMat','mattype',1)
-	# }}}
+    def setdefaultparameters(self):  # {{{
+        #the connectivity is the averaged number of nodes linked to a
+        #given node through an edge. This connectivity is used to initially
+        #allocate memory to the stiffness matrix. A value of 16 seems to
+        #give a good memory / time ration. This value can be checked in
+        #trunk / test / Miscellaneous / runme.m
+        self.average_vertex_connectivity = 25
+
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if(solution == 'LoveSolution'):
+            return
+
+        md = checkfield(md, 'fieldname', 'mesh.x', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'mesh.y', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'mesh.elements', 'NaN', 1, 'Inf', 1, '>', 0, 'values', np.arange(1, md.mesh.numberofvertices + 1))
+        md = checkfield(md, 'fieldname', 'mesh.elements', 'size', [md.mesh.numberofelements, 3])
+        if np.any(np.logical_not(m.ismember(np.arange(1, md.mesh.numberofvertices + 1), md.mesh.elements))):
+            md.checkmessage("orphan nodes have been found. Check the mesh outline")
+        md = checkfield(md, 'fieldname', 'mesh.numberofelements', '>', 0)
+        md = checkfield(md, 'fieldname', 'mesh.numberofvertices', '>', 0)
+        md = checkfield(md, 'fieldname', 'mesh.average_vertex_connectivity', '>=', 9, 'message', "'mesh.average_vertex_connectivity' should be at least 9 in 2d")
+        md = checkfield(md, 'fieldname', 'mesh.segments', 'NaN', 1, 'Inf', 1, '>', 0, 'size', [np.nan, 3])
+        if(np.size(self.scale_factor) > 1):
+            md = checkfield(md, 'fieldname', 'mesh.scale_factor', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+
+        if solution == 'ThermalSolution':
+            md.checkmessage("thermal not supported for 2d mesh")
+
+        return md
+    # }}}
+
+    def domaintype(self):  # {{{
+        return "2Dhorizontal"
+    #}}}
+
+    def dimension(self):  # {{{
+        return 2
+    #}}}
+
+    def elementtype(self):  # {{{
+        return "Tria"
+    #}}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'name', 'md.mesh.domain_type', 'data', "Domain" + self.domaintype(), 'format', 'String')
+        WriteData(fid, prefix, 'name', 'md.mesh.domain_dimension', 'data', self.dimension(), 'format', 'Integer')
+        WriteData(fid, prefix, 'name', 'md.mesh.elementtype', 'data', self.elementtype(), 'format', 'String')
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'x', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'y', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'name', 'md.mesh.z', 'data', np.zeros(self.numberofvertices), 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'elements', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberofelements', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberofvertices', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'average_vertex_connectivity', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'vertexonboundary', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'segments', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'scale_factor', 'format', 'DoubleMat', 'mattype', 1)
+        if md.transient.isoceancoupling:
+            WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'lat', 'format', 'DoubleMat', 'mattype', 1)
+            WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'long', 'format', 'DoubleMat', 'mattype', 1)
+    # }}}
Index: /issm/trunk/src/m/classes/mesh2dvertical.py
===================================================================
--- /issm/trunk/src/m/classes/mesh2dvertical.py	(revision 24312)
+++ /issm/trunk/src/m/classes/mesh2dvertical.py	(revision 24313)
@@ -5,131 +5,138 @@
 from WriteData import WriteData
 
+
 class mesh2dvertical(object):
-	"""
-	MESH2DVERTICAL class definition
+    """
+    MESH2DVERTICAL class definition
 
-	   Usage:
-	      mesh2dvertical=mesh2dvertical();
-	"""
+       Usage:
+          mesh2dvertical = mesh2dvertical()
+    """
 
-	def __init__(self): # {{{
-		self.x                           = float('NaN')
-		self.y                           = float('NaN')
-		self.elements                    = float('NaN')
-		self.numberofelements            = 0
-		self.numberofvertices            = 0
-		self.numberofedges               = 0
-		
-		self.lat                         = float('NaN')
-		self.long                        = float('NaN')
-		self.epsg                        = float('NaN')
-		self.scale_factor                = float('NaN');
+    def __init__(self):  # {{{
+        self.x = float('NaN')
+        self.y = float('NaN')
+        self.elements = float('NaN')
+        self.numberofelements = 0
+        self.numberofvertices = 0
+        self.numberofedges = 0
 
-		self.vertexonboundary            = float('NaN')
-		self.vertexonbase            	 = float('NaN')
-		self.vertexonsurface             = float('NaN')
+        self.lat = float('NaN')
+        self.long = float('NaN')
+        self.epsg = float('NaN')
+        self.scale_factor = float('NaN')
 
-		self.edges                       = float('NaN')
-		self.segments                    = float('NaN')
-		self.segmentmarkers              = float('NaN')
-		self.vertexconnectivity          = float('NaN')
-		self.elementconnectivity         = float('NaN')
-		self.average_vertex_connectivity = 0
+        self.vertexonboundary = float('NaN')
+        self.vertexonbase = float('NaN')
+        self.vertexonsurface = float('NaN')
 
-		#set defaults
-		self.setdefaultparameters()
+        self.edges = float('NaN')
+        self.segments = float('NaN')
+        self.segmentmarkers = float('NaN')
+        self.vertexconnectivity = float('NaN')
+        self.elementconnectivity = float('NaN')
+        self.average_vertex_connectivity = 0
 
-		#}}}
-	def __repr__(self): # {{{
-		string="   2D tria Mesh (vertical):" 
+    #set defaults
+        self.setdefaultparameters()
 
-		string="%s\n%s"%(string,"\n      Elements and vertices:")
-		string="%s\n%s"%(string,fielddisplay(self,"numberofelements","number of elements"))
-		string="%s\n%s"%(string,fielddisplay(self,"numberofvertices","number of vertices"))
-		string="%s\n%s"%(string,fielddisplay(self,"elements","vertex indices of the mesh elements"))
-		string="%s\n%s"%(string,fielddisplay(self,"x","vertices x coordinate [m]"))
-		string="%s\n%s"%(string,fielddisplay(self,"y","vertices y coordinate [m]"))
-		string="%s\n%s"%(string,fielddisplay(self,"edges","edges of the 2d mesh (vertex1 vertex2 element1 element2)"))
-		string="%s\n%s"%(string,fielddisplay(self,"numberofedges","number of edges of the 2d mesh"))
+    #}}}
+    def __repr__(self):  # {{{
+        string = "   2D tria Mesh (vertical):"
 
-		string="%s%s"%(string,"\n\n      Properties:")
-		string="%s\n%s"%(string,fielddisplay(self,"vertexonboundary","vertices on the boundary of the domain flag list"))
-		string="%s\n%s"%(string,fielddisplay(self,'vertexonbase','vertices on the bed of the domain flag list'))
-		string="%s\n%s"%(string,fielddisplay(self,'vertexonsurface','vertices on the surface of the domain flag list'))
-		string="%s\n%s"%(string,fielddisplay(self,"segments","edges on domain boundary (vertex1 vertex2 element)"))
-		string="%s\n%s"%(string,fielddisplay(self,"segmentmarkers","number associated to each segment"))
-		string="%s\n%s"%(string,fielddisplay(self,"vertexconnectivity","list of elements connected to vertex_i"))
-		string="%s\n%s"%(string,fielddisplay(self,"elementconnectivity","list of elements adjacent to element_i"))
-		string="%s\n%s"%(string,fielddisplay(self,"average_vertex_connectivity","average number of vertices connected to one vertex"))
+        string = "%s\n%s" % (string, "\n      Elements and vertices:")
+        string = "%s\n%s" % (string, fielddisplay(self, "numberofelements", "number of elements"))
+        string = "%s\n%s" % (string, fielddisplay(self, "numberofvertices", "number of vertices"))
+        string = "%s\n%s" % (string, fielddisplay(self, "elements", "vertex indices of the mesh elements"))
+        string = "%s\n%s" % (string, fielddisplay(self, "x", "vertices x coordinate [m]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "y", "vertices y coordinate [m]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "edges", "edges of the 2d mesh (vertex1 vertex2 element1 element2)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "numberofedges", "number of edges of the 2d mesh"))
 
-		string="%s%s"%(string,"\n\n      Projection:")
-		string="%s\n%s"%(string,fielddisplay(self,"lat","vertices latitude [degrees]"))
-		string="%s\n%s"%(string,fielddisplay(self,"long","vertices longitude [degrees]"))
-		string="%s\n%s"%(string,fielddisplay(self,"epsg","EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)"))
-		string="%s\n%s"%(string,fielddisplay(self,"scale_factor","Projection correction for volume, area, etc. computation"))
-		return string
-		#}}}
-	def setdefaultparameters(self): # {{{
-		
-		#the connectivity is the averaged number of nodes linked to a
-		#given node through an edge. This connectivity is used to initially
-		#allocate memory to the stiffness matrix. A value of 16 seems to
-		#give a good memory/time ration. This value can be checked in
-		#trunk/test/Miscellaneous/runme.m
-		self.average_vertex_connectivity=25.
+        string = "%s%s" % (string, "\n\n      Properties:")
+        string = "%s\n%s" % (string, fielddisplay(self, "vertexonboundary", "vertices on the boundary of the domain flag list"))
+        string = "%s\n%s" % (string, fielddisplay(self, 'vertexonbase', 'vertices on the bed of the domain flag list'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'vertexonsurface', 'vertices on the surface of the domain flag list'))
+        string = "%s\n%s" % (string, fielddisplay(self, "segments", "edges on domain boundary (vertex1 vertex2 element)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "segmentmarkers", "number associated to each segment"))
+        string = "%s\n%s" % (string, fielddisplay(self, "vertexconnectivity", "list of elements connected to vertex_i"))
+        string = "%s\n%s" % (string, fielddisplay(self, "elementconnectivity", "list of elements adjacent to element_i"))
+        string = "%s\n%s" % (string, fielddisplay(self, "average_vertex_connectivity", "average number of vertices connected to one vertex"))
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		if(solution=='LoveSolution'):
-			return
+        string = "%s%s" % (string, "\n\n      Projection:")
+        string = "%s\n%s" % (string, fielddisplay(self, "lat", "vertices latitude [degrees]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "long", "vertices longitude [degrees]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "epsg", "EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "scale_factor", "Projection correction for volume, area, etc. computation"))
+        return string
+    #}}}
 
-		md = checkfield(md,'fieldname','mesh.x','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','mesh.y','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','mesh.elements','NaN',1,'Inf',1,'>',0,'values',np.arange(1,md.mesh.numberofvertices+1))
-		md = checkfield(md,'fieldname','mesh.elements','size',[md.mesh.numberofelements,3])
-		if np.any(np.logical_not(m.ismember(np.arange(1,md.mesh.numberofvertices+1),md.mesh.elements))):
-			md.checkmessage("orphan nodes have been found. Check the mesh outline")
-		md = checkfield(md,'fieldname','mesh.numberofelements','>',0)
-		md = checkfield(md,'fieldname','mesh.numberofvertices','>',0)
-		md = checkfield(md,'fieldname','mesh.vertexonbase','size',[md.mesh.numberofvertices],'values',[0,1])
-		md = checkfield(md,'fieldname','mesh.vertexonsurface','size',[md.mesh.numberofvertices],'values',[0,1])
-		md = checkfield(md,'fieldname','mesh.average_vertex_connectivity','>=',9,'message',"'mesh.average_vertex_connectivity' should be at least 9 in 2d")
-		if(np.size(self.scale_factor)>1):
-                        md = checkfield(md,'fieldname','mesh.scale_factor','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
+    def setdefaultparameters(self):  # {{{
+        #the connectivity is the averaged number of nodes linked to a
+        #given node through an edge. This connectivity is used to initially
+        #allocate memory to the stiffness matrix. A value of 16 seems to
+        #give a good memory / time ration. This value can be checked in
+        #trunk / test / Miscellaneous / runme.m
+        self.average_vertex_connectivity = 25.
 
-		if solution=='ThermalSolution':
-			md.checkmessage("thermal not supported for 2d mesh")
+        return self
+    #}}}
 
-		return md
-	# }}}
-	def domaintype(self): # {{{
-		return "2Dvertical"
-	#}}}
-	def dimension(self): # {{{
-		return 2
-	#}}}
-	def elementtype(self): # {{{
-		return "Tria"
-	#}}}
-	def vertexflags(self,value): # {{{
-		flags = np.zeros((self.numberofvertices,))
-		pos   = self.segments[np.where(self.segmentmarkers==value),0:2]-1
-		flags[pos] = 1
-		return flags
-	#}}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'name','md.mesh.domain_type','data',"Domain"+self.domaintype(),'format','String');
-		WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',self.dimension(),'format','Integer');
-		WriteData(fid,prefix,'name','md.mesh.elementtype','data',self.elementtype(),'format','String');
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'name','md.mesh.z','data',np.zeros(self.numberofvertices),'format','DoubleMat','mattype',1);
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonbase','format','BooleanMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonsurface','format','BooleanMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','scale_factor','format','DoubleMat','mattype',1)
-	# }}}
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if(solution == 'LoveSolution'):
+            return
+
+        md = checkfield(md, 'fieldname', 'mesh.x', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'mesh.y', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'mesh.elements', 'NaN', 1, 'Inf', 1, '>', 0, 'values', np.arange(1, md.mesh.numberofvertices + 1))
+        md = checkfield(md, 'fieldname', 'mesh.elements', 'size', [md.mesh.numberofelements, 3])
+        if np.any(np.logical_not(m.ismember(np.arange(1, md.mesh.numberofvertices + 1), md.mesh.elements))):
+            md.checkmessage("orphan nodes have been found. Check the mesh outline")
+        md = checkfield(md, 'fieldname', 'mesh.numberofelements', '>', 0)
+        md = checkfield(md, 'fieldname', 'mesh.numberofvertices', '>', 0)
+        md = checkfield(md, 'fieldname', 'mesh.vertexonbase', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'mesh.vertexonsurface', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'mesh.average_vertex_connectivity', '>=', 9, 'message', "'mesh.average_vertex_connectivity' should be at least 9 in 2d")
+        if(np.size(self.scale_factor) > 1):
+            md = checkfield(md, 'fieldname', 'mesh.scale_factor', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+
+        if solution == 'ThermalSolution':
+            md.checkmessage("thermal not supported for 2d mesh")
+
+        return md
+    # }}}
+
+    def domaintype(self):  # {{{
+        return "2Dvertical"
+    #}}}
+
+    def dimension(self):  # {{{
+        return 2
+    #}}}
+
+    def elementtype(self):  # {{{
+        return "Tria"
+    #}}}
+
+    def vertexflags(self, value):  # {{{
+        flags = np.zeros((self.numberofvertices, ))
+        pos = self.segments[np.where(self.segmentmarkers == value), 0:2] - 1
+        flags[pos] = 1
+        return flags
+    #}}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'name', 'md.mesh.domain_type', 'data', "Domain" + self.domaintype(), 'format', 'String')
+        WriteData(fid, prefix, 'name', 'md.mesh.domain_dimension', 'data', self.dimension(), 'format', 'Integer')
+        WriteData(fid, prefix, 'name', 'md.mesh.elementtype', 'data', self.elementtype(), 'format', 'String')
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'x', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'y', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'name', 'md.mesh.z', 'data', np.zeros(self.numberofvertices), 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'elements', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberofelements', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberofvertices', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'vertexonbase', 'format', 'BooleanMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'vertexonsurface', 'format', 'BooleanMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'average_vertex_connectivity', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'scale_factor', 'format', 'DoubleMat', 'mattype', 1)
+    # }}}
Index: /issm/trunk/src/m/classes/mesh3dprisms.m
===================================================================
--- /issm/trunk/src/m/classes/mesh3dprisms.m	(revision 24312)
+++ /issm/trunk/src/m/classes/mesh3dprisms.m	(revision 24313)
@@ -105,4 +105,5 @@
 			md = checkfield(md,'fieldname','mesh.numberofelements','>',0);
 			md = checkfield(md,'fieldname','mesh.numberofvertices','>',0);
+			md = checkfield(md,'fieldname','mesh.vertexonboundary','size',[md.mesh.numberofvertices 1],'values',[0 1]);
 			md = checkfield(md,'fieldname','mesh.vertexonbase','size',[md.mesh.numberofvertices 1],'values',[0 1]);
 			md = checkfield(md,'fieldname','mesh.vertexonsurface','size',[md.mesh.numberofvertices 1],'values',[0 1]);
@@ -178,4 +179,5 @@
 			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements','format','Integer');
 			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices','format','Integer');
+			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonboundary','format','BooleanMat','mattype',1);
 			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonbase','format','BooleanMat','mattype',1);
 			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonsurface','format','BooleanMat','mattype',1);
Index: /issm/trunk/src/m/classes/mesh3dprisms.py
===================================================================
--- /issm/trunk/src/m/classes/mesh3dprisms.py	(revision 24312)
+++ /issm/trunk/src/m/classes/mesh3dprisms.py	(revision 24313)
@@ -5,155 +5,161 @@
 from WriteData import WriteData
 
+
 class mesh3dprisms(object):
-	"""
-	MESH3DPRISMS class definition
+    """
+    MESH3DPRISMS class definition
 
-	   Usage:
-	      mesh3d=mesh3dprisms();
-	"""
+       Usage:
+          mesh3d = mesh3dprisms()
+    """
 
-	def __init__(self): # {{{
-		self.x                           = float('NaN');
-		self.y                           = float('NaN');
-		self.z                           = float('NaN');
-		self.elements                    = float('NaN');
-		self.numberoflayers              = 0;
-		self.numberofelements            = 0;
-		self.numberofvertices            = 0;
-		
-		self.lat                         = float('NaN');
-		self.long                        = float('NaN');
-		self.epsg                        = 0;
-		self.scale_factor                = float('NaN');
+    def __init__(self):  # {{{
+        self.x = float('NaN')
+        self.y = float('NaN')
+        self.z = float('NaN')
+        self.elements = float('NaN')
+        self.numberoflayers = 0
+        self.numberofelements = 0
+        self.numberofvertices = 0
 
-		self.vertexonbase                = float('NaN');
-		self.vertexonsurface             = float('NaN');
-		self.lowerelements               = float('NaN');
-		self.lowervertex                 = float('NaN');
-		self.upperelements               = float('NaN');
-		self.uppervertex                 = float('NaN');
-		self.vertexonboundary            = float('NaN');
+        self.lat = float('NaN')
+        self.long = float('NaN')
+        self.epsg = 0
+        self.scale_factor = float('NaN')
 
-		self.vertexconnectivity          = float('NaN');
-		self.elementconnectivity         = float('NaN');
-		self.average_vertex_connectivity = 0;
+        self.vertexonbase = float('NaN')
+        self.vertexonsurface = float('NaN')
+        self.lowerelements = float('NaN')
+        self.lowervertex = float('NaN')
+        self.upperelements = float('NaN')
+        self.uppervertex = float('NaN')
+        self.vertexonboundary = float('NaN')
 
-		self.x2d                         = float('NaN');
-		self.y2d                         = float('NaN');
-		self.elements2d                  = float('NaN');
-		self.numberofvertices2d          = 0;
-		self.numberofelements2d          = 0;
+        self.vertexconnectivity = float('NaN')
+        self.elementconnectivity = float('NaN')
+        self.average_vertex_connectivity = 0
 
-		self.extractedvertices           = float('NaN');
-		self.extractedelements           = float('NaN');
+        self.x2d = float('NaN')
+        self.y2d = float('NaN')
+        self.elements2d = float('NaN')
+        self.numberofvertices2d = 0
+        self.numberofelements2d = 0
 
-		#set defaults
-		self.setdefaultparameters()
-		#}}}
-	def __repr__(self): # {{{
-		string="   3D prism Mesh:" 
+        self.extractedvertices = float('NaN')
+        self.extractedelements = float('NaN')
 
-		string="%s\n%s"%(string,"\n      Elements and vertices of the original 2d mesh3dprisms:")
-		
-		string="%s\n%s"%(string,fielddisplay(self,"numberofelements2d","number of elements"))
-		string="%s\n%s"%(string,fielddisplay(self,"numberofvertices2d","number of vertices"))
-		string="%s\n%s"%(string,fielddisplay(self,"elements2d","vertex indices of the mesh3dprisms elements"))
-		string="%s\n%s"%(string,fielddisplay(self,"x2d","vertices x coordinate [m]"))
-		string="%s\n%s"%(string,fielddisplay(self,"y2d","vertices y coordinate [m]"))
+    #set defaults
+        self.setdefaultparameters()
+    #}}}
 
-		string="%s\n%s"%(string,"\n\n      Elements and vertices of the extruded 3d mesh3dprisms:")
-		string="%s\n%s"%(string,fielddisplay(self,"numberofelements","number of elements"))
-		string="%s\n%s"%(string,fielddisplay(self,"numberofvertices","number of vertices"))
-		string="%s\n%s"%(string,fielddisplay(self,"elements","vertex indices of the mesh3dprisms elements"))
-		string="%s\n%s"%(string,fielddisplay(self,"x","vertices x coordinate [m]"))
-		string="%s\n%s"%(string,fielddisplay(self,"y","vertices y coordinate [m]"))
-		string="%s\n%s"%(string,fielddisplay(self,"z","vertices z coordinate [m]"))
+    def __repr__(self):  # {{{
+        string = "   3D prism Mesh:"
 
-		string="%s%s"%(string,"\n\n      Properties:")
-		string="%s\n%s"%(string,fielddisplay(self,"numberoflayers","number of extrusion layers"))
-		string="%s\n%s"%(string,fielddisplay(self,"vertexonbase","lower vertices flags list"))
-		string="%s\n%s"%(string,fielddisplay(self,"vertexonsurface","upper vertices flags list"))
-		string="%s\n%s"%(string,fielddisplay(self,"uppervertex","upper vertex list (NaN for vertex on the upper surface)"))
-		string="%s\n%s"%(string,fielddisplay(self,"upperelements","upper element list (NaN for element on the upper layer)"))
-		string="%s\n%s"%(string,fielddisplay(self,"lowervertex","lower vertex list (NaN for vertex on the lower surface)"))
-		string="%s\n%s"%(string,fielddisplay(self,"lowerelements","lower element list (NaN for element on the lower layer)"))
-		string="%s\n%s"%(string,fielddisplay(self,"vertexonboundary","vertices on the boundary of the domain flag list"))
-		string="%s\n%s"%(string,fielddisplay(self,"vertexconnectivity","list of elements connected to vertex_i"))
-		string="%s\n%s"%(string,fielddisplay(self,"elementconnectivity","list of elements adjacent to element_i"))
-		string="%s\n%s"%(string,fielddisplay(self,"average_vertex_connectivity","average number of vertices connected to one vertex"))
+        string = "%s\n%s" % (string, "\n      Elements and vertices of the original 2d mesh3dprisms:")
 
-		string="%s%s"%(string,"\n\n      Extracted model:")
-		string="%s\n%s"%(string,fielddisplay(self,"extractedvertices","vertices extracted from the model"))
-		string="%s\n%s"%(string,fielddisplay(self,"extractedelements","elements extracted from the model"))
+        string = "%s\n%s" % (string, fielddisplay(self, "numberofelements2d", "number of elements"))
+        string = "%s\n%s" % (string, fielddisplay(self, "numberofvertices2d", "number of vertices"))
+        string = "%s\n%s" % (string, fielddisplay(self, "elements2d", "vertex indices of the mesh3dprisms elements"))
+        string = "%s\n%s" % (string, fielddisplay(self, "x2d", "vertices x coordinate [m]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "y2d", "vertices y coordinate [m]"))
 
-		string="%s%s"%(string,"\n\n      Projection:")
-		string="%s\n%s"%(string,fielddisplay(self,"lat","vertices latitude [degrees]"))
-		string="%s\n%s"%(string,fielddisplay(self,"long","vertices longitude [degrees]"))
-		string="%s\n%s"%(string,fielddisplay(self,"epsg","EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)"))
-		string="%s\n%s"%(string,fielddisplay(self,"scale_factor","Projection correction for volume, area, etc. computation"))
-		return string
-		#}}}
-	def setdefaultparameters(self): # {{{
-		
-		#the connectivity is the averaged number of nodes linked to a
-		#given node through an edge. This connectivity is used to initially
-		#allocate memory to the stiffness matrix. A value of 16 seems to
-		#give a good memory/time ration. This value can be checked in
-		#trunk/test/Miscellaneous/runme.m
-		self.average_vertex_connectivity=25
+        string = "%s\n%s" % (string, "\n\n      Elements and vertices of the extruded 3d mesh3dprisms:")
+        string = "%s\n%s" % (string, fielddisplay(self, "numberofelements", "number of elements"))
+        string = "%s\n%s" % (string, fielddisplay(self, "numberofvertices", "number of vertices"))
+        string = "%s\n%s" % (string, fielddisplay(self, "elements", "vertex indices of the mesh3dprisms elements"))
+        string = "%s\n%s" % (string, fielddisplay(self, "x", "vertices x coordinate [m]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "y", "vertices y coordinate [m]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "z", "vertices z coordinate [m]"))
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+        string = "%s%s" % (string, "\n\n      Properties:")
+        string = "%s\n%s" % (string, fielddisplay(self, "numberoflayers", "number of extrusion layers"))
+        string = "%s\n%s" % (string, fielddisplay(self, "vertexonbase", "lower vertices flags list"))
+        string = "%s\n%s" % (string, fielddisplay(self, "vertexonsurface", "upper vertices flags list"))
+        string = "%s\n%s" % (string, fielddisplay(self, "uppervertex", "upper vertex list (NaN for vertex on the upper surface)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "upperelements", "upper element list (NaN for element on the upper layer)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "lowervertex", "lower vertex list (NaN for vertex on the lower surface)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "lowerelements", "lower element list (NaN for element on the lower layer)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "vertexonboundary", "vertices on the boundary of the domain flag list"))
+        string = "%s\n%s" % (string, fielddisplay(self, "vertexconnectivity", "list of elements connected to vertex_i"))
+        string = "%s\n%s" % (string, fielddisplay(self, "elementconnectivity", "list of elements adjacent to element_i"))
+        string = "%s\n%s" % (string, fielddisplay(self, "average_vertex_connectivity", "average number of vertices connected to one vertex"))
 
-		md = checkfield(md,'fieldname','mesh.x','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','mesh.y','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','mesh.z','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','mesh.elements','NaN',1,'Inf',1,'>',0,'values',np.arange(1,md.mesh.numberofvertices+1))
-		md = checkfield(md,'fieldname','mesh.elements','size',[md.mesh.numberofelements,6])
-		if np.any(np.logical_not(m.ismember(np.arange(1,md.mesh.numberofvertices+1),md.mesh.elements))):
-			md.checkmessage("orphan nodes have been found. Check the mesh3dprisms outline")
-		md = checkfield(md,'fieldname','mesh.numberoflayers','>=',0)
-		md = checkfield(md,'fieldname','mesh.numberofelements','>',0)
-		md = checkfield(md,'fieldname','mesh.numberofvertices','>',0)
-		md = checkfield(md,'fieldname','mesh.vertexonbase','size',[md.mesh.numberofvertices],'values',[0,1])
-		md = checkfield(md,'fieldname','mesh.vertexonsurface','size',[md.mesh.numberofvertices],'values',[0,1])
-		md = checkfield(md,'fieldname','mesh.average_vertex_connectivity','>=',24,'message',"'mesh.average_vertex_connectivity' should be at least 24 in 3d")
-		if(np.size(self.scale_factor)>1):
-                        md = checkfield(md,'fieldname','mesh.scale_factor','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
+        string = "%s%s" % (string, "\n\n      Extracted model:")
+        string = "%s\n%s" % (string, fielddisplay(self, "extractedvertices", "vertices extracted from the model"))
+        string = "%s\n%s" % (string, fielddisplay(self, "extractedelements", "elements extracted from the model"))
 
-		return md
-	# }}}
-	def domaintype(self): # {{{
-		return "3D"
-	#}}}
-	def dimension(self): # {{{
-		return 3
-	#}}}
-	def elementtype(self): # {{{
-		return "Penta"
-	#}}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'name','md.mesh.domain_type','data',"Domain"+self.domaintype(),'format','String');
-		WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',self.dimension(),'format','Integer');
-		WriteData(fid,prefix,'name','md.mesh.elementtype','data',self.elementtype(),'format','String');
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','z','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberoflayers','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonbase','format','BooleanMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonsurface','format','BooleanMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','lowerelements','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','upperelements','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements2d','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices2d','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements2d','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','mesh','fieldname','scale_factor','format','DoubleMat','mattype',1)
-		if md.transient.isoceancoupling:
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','lat','format','DoubleMat','mattype',1)
-			WriteData(fid,prefix,'object',self,'class','mesh','fieldname','long','format','DoubleMat','mattype',1)
-	# }}}
+        string = "%s%s" % (string, "\n\n      Projection:")
+        string = "%s\n%s" % (string, fielddisplay(self, "lat", "vertices latitude [degrees]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "long", "vertices longitude [degrees]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "epsg", "EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "scale_factor", "Projection correction for volume, area, etc. computation"))
+        return string
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+        #the connectivity is the averaged number of nodes linked to a
+        #given node through an edge. This connectivity is used to initially
+        #allocate memory to the stiffness matrix. A value of 16 seems to
+        #give a good memory / time ration. This value can be checked in
+        #trunk / test / Miscellaneous / runme.m
+        self.average_vertex_connectivity = 25
+
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        md = checkfield(md, 'fieldname', 'mesh.x', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'mesh.y', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'mesh.z', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'mesh.elements', 'NaN', 1, 'Inf', 1, '>', 0, 'values', np.arange(1, md.mesh.numberofvertices + 1))
+        md = checkfield(md, 'fieldname', 'mesh.elements', 'size', [md.mesh.numberofelements, 6])
+        if np.any(np.logical_not(m.ismember(np.arange(1, md.mesh.numberofvertices + 1), md.mesh.elements))):
+            md.checkmessage("orphan nodes have been found. Check the mesh3dprisms outline")
+        md = checkfield(md, 'fieldname', 'mesh.numberoflayers', '>=', 0)
+        md = checkfield(md, 'fieldname', 'mesh.numberofelements', '>', 0)
+        md = checkfield(md, 'fieldname', 'mesh.numberofvertices', '>', 0)
+        md = checkfield(md, 'fieldname', 'mesh.vertexonbase', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'mesh.vertexonsurface', 'size', [md.mesh.numberofvertices], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'mesh.average_vertex_connectivity', '>=', 24, 'message', "'mesh.average_vertex_connectivity' should be at least 24 in 3d")
+        if(np.size(self.scale_factor) > 1):
+            md = checkfield(md, 'fieldname', 'mesh.scale_factor', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+
+        return md
+    # }}}
+
+    def domaintype(self):  # {{{
+        return "3D"
+    #}}}
+
+    def dimension(self):  # {{{
+        return 3
+    #}}}
+
+    def elementtype(self):  # {{{
+        return "Penta"
+    #}}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'name', 'md.mesh.domain_type', 'data', "Domain" + self.domaintype(), 'format', 'String')
+        WriteData(fid, prefix, 'name', 'md.mesh.domain_dimension', 'data', self.dimension(), 'format', 'Integer')
+        WriteData(fid, prefix, 'name', 'md.mesh.elementtype', 'data', self.elementtype(), 'format', 'String')
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'x', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'y', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'z', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'elements', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberoflayers', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberofelements', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberofvertices', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'vertexonbase', 'format', 'BooleanMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'vertexonsurface', 'format', 'BooleanMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'lowerelements', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'upperelements', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'average_vertex_connectivity', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'elements2d', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberofvertices2d', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'numberofelements2d', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'scale_factor', 'format', 'DoubleMat', 'mattype', 1)
+        if md.transient.isoceancoupling:
+            WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'lat', 'format', 'DoubleMat', 'mattype', 1)
+            WriteData(fid, prefix, 'object', self, 'class', 'mesh', 'fieldname', 'long', 'format', 'DoubleMat', 'mattype', 1)
+    # }}}
Index: /issm/trunk/src/m/classes/mesh3dsurface.m
===================================================================
--- /issm/trunk/src/m/classes/mesh3dsurface.m	(revision 24312)
+++ /issm/trunk/src/m/classes/mesh3dsurface.m	(revision 24313)
@@ -17,4 +17,5 @@
 		long                        = NaN;
 		r                           = NaN;
+		area                        = NaN;
 
 		vertexonboundary            = NaN;
@@ -115,4 +116,5 @@
 			fielddisplay(obj,'long','vertices longitude [degrees]');
 			fielddisplay(obj,'r','vertices radius [m]');
+			fielddisplay(obj,'area','elemental areas [m^2]');
 			
 			fielddisplay(obj,'edges','edges of the 2d mesh (vertex1 vertex2 element1 element2)');
@@ -180,4 +182,5 @@
 			writejs1Darray(fid,[modelname '.mesh.long'],self.long);
 			writejs1Darray(fid,[modelname '.mesh.r'],self.r);
+			writejs1Darray(fid,[modelname '.mesh.area'],self.area);
 			writejs1Darray(fid,[modelname '.mesh.vertexonboundary'],self.vertexonboundary);
 			writejs2Darray(fid,[modelname '.mesh.edges'],self.edges);
Index: /issm/trunk/src/m/classes/mesh3dsurface.py
===================================================================
--- /issm/trunk/src/m/classes/mesh3dsurface.py	(revision 24312)
+++ /issm/trunk/src/m/classes/mesh3dsurface.py	(revision 24313)
@@ -6,187 +6,193 @@
 from WriteData import WriteData
 
+
 class mesh3dsurface(object):
-#MESH3DSURFACE class definition
-#
-#   Usage:
-#      mesh3dsurface=mesh3dsurface();
-	def __init__(self,*args): # {{{
-		self.x                           = np.nan
-		self.y                           = np.nan
-		self.z                           = np.nan
-		self.elements                    = np.nan
-		self.numberofelements            = 0
-		self.numberofvertices            = 0
-		self.numberofedges               = 0
+    #MESH3DSURFACE class definition
+    #
+    #   Usage:
+    #      mesh3dsurface = mesh3dsurface();
+    def __init__(self, *args):  # {{{
+        self.x = np.nan
+        self.y = np.nan
+        self.z = np.nan
+        self.elements = np.nan
+        self.numberofelements = 0
+        self.numberofvertices = 0
+        self.numberofedges = 0
 
-		self.lat                         = np.nan
-		self.long                        = np.nan
-		self.r                           = np.nan
+        self.lat = np.nan
+        self.long = np.nan
+        self.r = np.nan
 
-		self.vertexonboundary            = np.nan
-		self.edges                       = np.nan
-		self.segments                    = np.nan
-		self.segmentmarkers              = np.nan
-		self.vertexconnectivity          = np.nan
-		self.elementconnectivity         = np.nan
-		self.average_vertex_connectivity = 0
+        self.vertexonboundary = np.nan
+        self.edges = np.nan
+        self.segments = np.nan
+        self.segmentmarkers = np.nan
+        self.vertexconnectivity = np.nan
+        self.elementconnectivity = np.nan
+        self.average_vertex_connectivity = 0
 
-		self.extractedvertices           = np.nan
-		self.extractedelements           = np.nan
-		
-		if not len(args):
-			self.setdefaultparameters()
-		elif len(args)==1:
-			self=mesh3dsurface()
-			arg=args[1]
-			fields=fieldnames(arg)
-			for i in range(len(fields)):
-				field=fields[i]
-				if ismember(field,properties('mesh3dsurface')):
-					self.field=arg.field
-		else:
-			raise RuntimeError('constructor not supported')	
+        self.extractedvertices = np.nan
+        self.extractedelements = np.nan
 
-	# }}}
-	def __repr__(self): # {{{
-		string='   2D tria Mesh (horizontal):'
-		
-		string+='\n      Elements and vertices:'
-		string="%s\n%s"%(string,fielddisplay(self,'numberofelements','number of elements'))
-		string="%s\n%s"%(string,fielddisplay(self,'numberofvertices','number of vertices'))
-		string="%s\n%s"%(string,fielddisplay(self,'elements','vertex indices of the mesh elements'))
-		string="%s\n%s"%(string,fielddisplay(self,'x','vertices x coordinate [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'y','vertices y coordinate [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'z','vertices z coordinate [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'lat','vertices latitude [degrees]'))
-		string="%s\n%s"%(string,fielddisplay(self,'long','vertices longitude [degrees]'))
-		string="%s\n%s"%(string,fielddisplay(self,'r','vertices radius [m]'))
-		
-		string="%s\n%s"%(string,fielddisplay(self,'edges','edges of the 2d mesh (vertex1 vertex2 element1 element2)'))
-		string="%s\n%s"%(string,fielddisplay(self,'numberofedges','number of edges of the 2d mesh'))
+        if not len(args):
+            self.setdefaultparameters()
+        elif len(args) == 1:
+            self = mesh3dsurface()
+            arg = args[1]
+            fields = fieldnames(arg)
+            for i in range(len(fields)):
+                field = fields[i]
+                if ismember(field, properties('mesh3dsurface')):
+                    self.field = arg.field
+        else:
+            raise RuntimeError('constructor not supported')
 
-		string+='\n      Properties:'
-		string="%s\n%s"%(string,fielddisplay(self,'vertexonboundary','vertices on the boundary of the domain flag list'))
-		string="%s\n%s"%(string,fielddisplay(self,'segments','edges on domain boundary (vertex1 vertex2 element)'))
-		string="%s\n%s"%(string,fielddisplay(self,'segmentmarkers','number associated to each segment'))
-		string="%s\n%s"%(string,fielddisplay(self,'vertexconnectivity','list of elements connected to vertex_i'))
-		string="%s\n%s"%(string,fielddisplay(self,'elementconnectivity','list of elements adjacent to element_i'))
-		string="%s\n%s"%(string,fielddisplay(self,'average_vertex_connectivity','average number of vertices connected to one vertex'))
+    # }}}
 
-		string+='\n      Extracted model():'
-		string="%s\n%s"%(string,fielddisplay(self,'extractedvertices','vertices extracted from the model()'))
-		string="%s\n%s"%(string,fielddisplay(self,'extractedelements','elements extracted from the model()')) 
-		
-		return string
-	# }}}
-	def loadobj(self): # {{{
-		# This def is directly called by matlab when a model() selfect is
-		# loaded. Update old properties here
+    def __repr__(self):  # {{{
+        string = '   2D tria Mesh (horizontal):'
 
-		#2014 Oct. 1st
-		if isstruct(self):
-			oldself=self
-			#Assign property values from struct
-			self=structtoobj(mesh3dsurface(),oldself)
-			if isfield(oldself,'hemisphere'):
-				print ('md.mesh.hemisphere has been automatically converted to EPSG code')
-				if strcmpi(oldself.hemisphere,'n'):
-					self.epsg=3413
-				else:
-					self.epsg=3031
-		return self
-	# }}}
-	def setdefaultparameters(self): # {{{
+        string += '\n      Elements and vertices:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'numberofelements', 'number of elements'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'numberofvertices', 'number of vertices'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'elements', 'vertex indices of the mesh elements'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'x', 'vertices x coordinate [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'y', 'vertices y coordinate [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'z', 'vertices z coordinate [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'lat', 'vertices latitude [degrees]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'long', 'vertices longitude [degrees]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'r', 'vertices radius [m]'))
 
-		#the connectivity is the averaged number of nodes linked to a
-		#given node through an edge. This connectivity is used to initially
-		#allocate memory to the stiffness matrix. A value of 16 seems to
-		#give a good memory/time ration. This value can be checked in
-		#trunk/test/Miscellaneous/runme.m
-		self.average_vertex_connectivity=25
-		return self
-	# }}}
-	def checkconsistency(self,md,solution,analyses): # {{{
+        string = "%s\n%s" % (string, fielddisplay(self, 'edges', 'edges of the 2d mesh (vertex1 vertex2 element1 element2)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'numberofedges', 'number of edges of the 2d mesh'))
 
-		md = checkfield(md,'fieldname','mesh.x','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','mesh.y','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','mesh.z','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','mesh.lat','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','mesh.long','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','mesh.r','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','mesh.elements','NaN',1,'Inf',1,'>',0,'values',np.arange(1,md.mesh.numberofvertices+1))
-		md = checkfield(md,'fieldname','mesh.elements','size',[md.mesh.numberofelements,3])
-		if np.any(np.logical_not(np.in1d(np.arange(1,md.mesh.numberofvertices+1),md.mesh.elements.flat))):
-			md = checkmessage(md,'orphan nodes have been found. Check the mesh outline')
-		
-		md = checkfield(md,'fieldname','mesh.numberofelements','>',0)
-		md = checkfield(md,'fieldname','mesh.numberofvertices','>',0)
-		md = checkfield(md,'fieldname','mesh.average_vertex_connectivity','>=',9,'message','"mesh.average_vertex_connectivity" should be at least 9 in 2d')
+        string += '\n      Properties:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'vertexonboundary', 'vertices on the boundary of the domain flag list'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'segments', 'edges on domain boundary (vertex1 vertex2 element)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'segmentmarkers', 'number associated to each segment'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'vertexconnectivity', 'list of elements connected to vertex_i'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'elementconnectivity', 'list of elements adjacent to element_i'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'average_vertex_connectivity', 'average number of vertices connected to one vertex'))
 
-		if (solution=='ThermalSolution'):
-			md = checkmessage(md,'thermal not supported for 2d mesh');
-			
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid): # {{{
-		WriteData(fid,prefix,'name','md.mesh.domain_type','data','Domain' + self.domaintype(),'format','String')
-		WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',self.dimension(),'format','Integer')
-		WriteData(fid,prefix,'name','md.mesh.elementtype','data',self.elementtype(),'format','String')
-		WriteData(fid,prefix,'object',self,'fieldname','x','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','y','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','z','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','lat','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','long','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','r','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'name','md.mesh.z','data',np.zeros(md.mesh.numberofvertices),'format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','elements','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'fieldname','numberofelements','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','numberofvertices','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','average_vertex_connectivity','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','vertexonboundary','format','DoubleMat','mattype',1)
-	# }}}
-	def domaintype(self): # {{{
-		return '3Dsurface'
-	# }}}
-	def dimension(self): # {{{
-		return 2
-	# }}}
-	def elementtype(self): # {{{
-		return 'Tria'
-	# }}}
-	def processmesh(self,options): # {{{
-	
-		isplanet = 1
-		is2d     = 0
+        string += '\n      Extracted model():'
+        string = "%s\n%s" % (string, fielddisplay(self, 'extractedvertices', 'vertices extracted from the model()'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'extractedelements', 'elements extracted from the model()'))
 
-		elements = self.elements
-		x        = self.x
-		y        = self.y
-		z        = self.z
-		return [x, y, z, elements, is2d, isplanet]
-	# }}}
-	def savemodeljs(self,fid,modelname): # {{{
-	
-		fid.write('#s.mesh=new mesh3dsurface()\n'%modelname)
-		writejs1Darray(fid,[modelname, '.mesh.x'],self.x)
-		writejs1Darray(fid,[modelname, '.mesh.y'],self.y)
-		writejs1Darray(fid,[modelname, '.mesh.z'],self.z)
-		writejs2Darray(fid,[modelname, '.mesh.elements'],self.elements)
-		writejsdouble(fid,[modelname, '.mesh.numberofelements'],self.numberofelements)
-		writejsdouble(fid,[modelname, '.mesh.numberofvertices'],self.numberofvertices)
-		writejsdouble(fid,[modelname, '.mesh.numberofedges'],self.numberofedges)
-		writejs1Darray(fid,[modelname, '.mesh.lat'],self.lat)
-		writejs1Darray(fid,[modelname, '.mesh.long'],self.long)
-		writejs1Darray(fid,[modelname, '.mesh.r'],self.r)
-		writejs1Darray(fid,[modelname, '.mesh.vertexonboundary'],self.vertexonboundary)
-		writejs2Darray(fid,[modelname, '.mesh.edges'],self.edges)
-		writejs2Darray(fid,[modelname, '.mesh.segments'],self.segments)
-		writejs2Darray(fid,[modelname, '.mesh.segmentmarkers'],self.segmentmarkers)
-		writejs2Darray(fid,[modelname, '.mesh.vertexconnectivity'],self.vertexconnectivity)
-		writejs2Darray(fid,[modelname, '.mesh.elementconnectivity'],self.elementconnectivity)
-		writejsdouble(fid,[modelname, '.mesh.average_vertex_connectivity'],self.average_vertex_connectivity)
-		writejs1Darray(fid,[modelname, '.mesh.extractedvertices'],self.extractedvertices)
-		writejs1Darray(fid,[modelname, '.mesh.extractedelements'],self.extractedelements)
+        return string
+    # }}}
 
-	# }}}
-	
+    def loadobj(self):  # {{{
+        # This def is directly called by matlab when a model() selfect is
+        # loaded. Update old properties here
+
+        #2014 Oct. 1st
+        if isstruct(self):
+            oldself = self
+            #Assign property values from struct
+            self = structtoobj(mesh3dsurface(), oldself)
+            if isfield(oldself, 'hemisphere'):
+                print('md.mesh.hemisphere has been automatically converted to EPSG code')
+                if strcmpi(oldself.hemisphere, 'n'):
+                    self.epsg = 3413
+                else:
+                    self.epsg = 3031
+        return self
+    # }}}
+
+    def setdefaultparameters(self):  # {{{
+        #the connectivity is the averaged number of nodes linked to a
+        #given node through an edge. This connectivity is used to initially
+        #allocate memory to the stiffness matrix. A value of 16 seems to
+        #give a good memory / time ration. This value can be checked in
+        #trunk / test / Miscellaneous / runme.m
+        self.average_vertex_connectivity = 25
+        return self
+    # }}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        md = checkfield(md, 'fieldname', 'mesh.x', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'mesh.y', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'mesh.z', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'mesh.lat', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'mesh.long', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'mesh.r', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'mesh.elements', 'NaN', 1, 'Inf', 1, '>', 0, 'values', np.arange(1, md.mesh.numberofvertices + 1))
+        md = checkfield(md, 'fieldname', 'mesh.elements', 'size', [md.mesh.numberofelements, 3])
+        if np.any(np.logical_not(np.in1d(np.arange(1, md.mesh.numberofvertices + 1), md.mesh.elements.flat))):
+            md = checkmessage(md, 'orphan nodes have been found. Check the mesh outline')
+
+        md = checkfield(md, 'fieldname', 'mesh.numberofelements', '>', 0)
+        md = checkfield(md, 'fieldname', 'mesh.numberofvertices', '>', 0)
+        md = checkfield(md, 'fieldname', 'mesh.average_vertex_connectivity', '>=', 9, 'message', '"mesh.average_vertex_connectivity" should be at least 9 in 2d')
+
+        if (solution == 'ThermalSolution'):
+            md = checkmessage(md, 'thermal not supported for 2d mesh')
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'name', 'md.mesh.domain_type', 'data', 'Domain' + self.domaintype(), 'format', 'String')
+        WriteData(fid, prefix, 'name', 'md.mesh.domain_dimension', 'data', self.dimension(), 'format', 'Integer')
+        WriteData(fid, prefix, 'name', 'md.mesh.elementtype', 'data', self.elementtype(), 'format', 'String')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'x', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'y', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'z', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'lat', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'long', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'r', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'name', 'md.mesh.z', 'data', np.zeros(md.mesh.numberofvertices), 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'elements', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'numberofelements', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'numberofvertices', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'average_vertex_connectivity', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'vertexonboundary', 'format', 'DoubleMat', 'mattype', 1)
+    # }}}
+
+    def domaintype(self):  # {{{
+        return '3Dsurface'
+    # }}}
+
+    def dimension(self):  # {{{
+        return 2
+    # }}}
+
+    def elementtype(self):  # {{{
+        return 'Tria'
+    # }}}
+
+    def processmesh(self, options):  # {{{
+        isplanet = 1
+        is2d = 0
+
+        elements = self.elements
+        x = self.x
+        y = self.y
+        z = self.z
+        return [x, y, z, elements, is2d, isplanet]
+    # }}}
+
+    def savemodeljs(self, fid, modelname):  # {{{
+        fid.write('  #s.mesh = new mesh3dsurface()\n' % modelname)
+        writejs1Darray(fid, [modelname, '.mesh.x'], self.x)
+        writejs1Darray(fid, [modelname, '.mesh.y'], self.y)
+        writejs1Darray(fid, [modelname, '.mesh.z'], self.z)
+        writejs2Darray(fid, [modelname, '.mesh.elements'], self.elements)
+        writejsdouble(fid, [modelname, '.mesh.numberofelements'], self.numberofelements)
+        writejsdouble(fid, [modelname, '.mesh.numberofvertices'], self.numberofvertices)
+        writejsdouble(fid, [modelname, '.mesh.numberofedges'], self.numberofedges)
+        writejs1Darray(fid, [modelname, '.mesh.lat'], self.lat)
+        writejs1Darray(fid, [modelname, '.mesh.long'], self.long)
+        writejs1Darray(fid, [modelname, '.mesh.r'], self.r)
+        writejs1Darray(fid, [modelname, '.mesh.vertexonboundary'], self.vertexonboundary)
+        writejs2Darray(fid, [modelname, '.mesh.edges'], self.edges)
+        writejs2Darray(fid, [modelname, '.mesh.segments'], self.segments)
+        writejs2Darray(fid, [modelname, '.mesh.segmentmarkers'], self.segmentmarkers)
+        writejs2Darray(fid, [modelname, '.mesh.vertexconnectivity'], self.vertexconnectivity)
+        writejs2Darray(fid, [modelname, '.mesh.elementconnectivity'], self.elementconnectivity)
+        writejsdouble(fid, [modelname, '.mesh.average_vertex_connectivity'], self.average_vertex_connectivity)
+        writejs1Darray(fid, [modelname, '.mesh.extractedvertices'], self.extractedvertices)
+        writejs1Darray(fid, [modelname, '.mesh.extractedelements'], self.extractedelements)
+
+    # }}}
Index: /issm/trunk/src/m/classes/miscellaneous.py
===================================================================
--- /issm/trunk/src/m/classes/miscellaneous.py	(revision 24312)
+++ /issm/trunk/src/m/classes/miscellaneous.py	(revision 24313)
@@ -4,37 +4,41 @@
 from WriteData import WriteData
 
+
 class miscellaneous(object):
-	"""
-	MISCELLANEOUS class definition
+    """
+    MISCELLANEOUS class definition
 
-	   Usage:
-	      miscellaneous=miscellaneous();
-	"""
+       Usage:
+          miscellaneous = miscellaneous()
+    """
 
-	def __init__(self): # {{{
-		self.notes = ''
-		self.name  = ''
-		self.dummy = OrderedDict()
+    def __init__(self):  # {{{
+        self.notes = ''
+        self.name = ''
+        self.dummy = OrderedDict()
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		string='   miscellaneous parameters:'
+    #}}}
+    def __repr__(self):  # {{{
+        string = '   miscellaneous parameters:'
 
-		string="%s\n%s"%(string,fielddisplay(self,'notes','notes in a cell of strings'))
-		string="%s\n%s"%(string,fielddisplay(self,'name','model name'))
-		string="%s\n%s"%(string,fielddisplay(self,'dummy','empty field to store some data'))
-		return string
-		#}}}
-	def setdefaultparameters(self): # {{{
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		md = checkfield(md,'fieldname','miscellaneous.name','empty',1)
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    #  {{{
-		WriteData(fid,prefix,'object',self,'fieldname','name','format','String');
-	# }}}
+        string = "%s\n%s" % (string, fielddisplay(self, 'notes', 'notes in a cell of strings'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'name', 'model name'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'dummy', 'empty field to store some data'))
+        return string
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        md = checkfield(md, 'fieldname', 'miscellaneous.name', 'empty', 1)
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  #  {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'name', 'format', 'String')
+    # }}}
Index: /issm/trunk/src/m/classes/misfit.py
===================================================================
--- /issm/trunk/src/m/classes/misfit.py	(revision 24312)
+++ /issm/trunk/src/m/classes/misfit.py	(revision 24313)
@@ -1,6 +1,4 @@
 import numpy as np
 from project3d import project3d
-from pairoptions import *
-from collections import OrderedDict
 from fielddisplay import fielddisplay
 from checkfield import checkfield
@@ -9,101 +7,91 @@
 
 class misfit(object):
-	"""
-	MISFIT class definition
+    """
+    MISFIT class definition
 
-	Usage:
-		misfit=misfit()
-		misfit=misfit(name='SurfaceAltimetry',
-                	definitionstring='Outputdefinition1',
-			model_string='Surface',
-	                observation_string='SurfaceObservations',
- 	            	observation=md.geometry.surface,
-                    	timeinterpolation='nearestneighbor',
-                    	local=1,
-                    	weights=np.ones((md.mesh.numberofvertices,1)),
-                    	weights_string='WeightsSurfaceObservations')
-	"""
+    Usage:
+        misfit = misfit()
+        misfit = misfit(name = 'SurfaceAltimetry',
+                    definitionstring = 'Outputdefinition1',
+            model_string = 'Surface',
+                    observation_string = 'SurfaceObservations',
+                     observation = md.geometry.surface,
+                        timeinterpolation = 'nearestneighbor',
+                        local = 1,
+                        weights = np.ones((md.mesh.numberofvertices, 1)),
+                        weights_string = 'WeightsSurfaceObservations')
+    """
 
-	def __init__(self, name = None, definitionstring = None, model_string = None, observation = None, observation_string = None, timeinterpolation = None, local = None, weights = None, weights_string = None, cumulated = None):
-		# {{{
-		self.name = name if name is not None else ''
+    def __init__(self, name=None, definitionstring=None, model_string=None, observation=None, observation_string=None, timeinterpolation=None, local=None, weights=None, weights_string=None, cumulated=None):  # {{{
+        self.name = name if name is not None else ''
+        #string that identifies this output definition uniquely, from 'Outputdefinition[1 - 100]'
+        self.definitionstring = definitionstring if definitionstring is not None else ''
+        #string for field that is modeled
+        self.model_string = model_string if model_string is not None else ''
+        #observed field that we compare the model against
+        self.observation = observation if observation is not None else float('NaN')
+        #string for observed field.
+        self.observation_string = observation_string if observation_string is not None else ''
+        self.timeinterpolation = timeinterpolation if timeinterpolation is not None else 'nearestneighbor'
+        self.local = local if local is not None else 1
+        #weight coefficients for every vertex
+        self.weights = weights if weights is not None else float('NaN')
+        #string to identify this particular set of weights
+        self.weights_string = weights_string if weights_string is not None else ''
+        #do we cumulate misfit through time?
+        self.cumulated = cumulated if cumulated is not None else float('NaN')
+    #}}}
 
-		#string that identifies this output definition uniquely, from 'Outputdefinition[1-100]'
-		self.definitionstring = definitionstring if definitionstring is not None else ''
+    def __repr__(self):  # {{{
+        string = '   Misfit:'
 
-		#string for field that is modeled
-		self.model_string = model_string if model_string is not None else ''
+        string = "%s\n%s" % (string, fielddisplay(self, 'name', 'identifier for this misfit response'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'definitionstring', 'string that identifies this output definition uniquely, from "Outputdefinition[1 - 10]"'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'model_string', 'string for field that is modeled'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'observation', 'observed field that we compare the model against'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'observation_string', 'observation string'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'local', 'is the response local to the elements, or global? (default is 1)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'timeinterpolation', 'interpolation routine used to interpolate misfit between two time steps (default is "nearestneighbor"'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'weights', 'weights (at vertices) to apply to the misfit'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'weights_string', 'string for weights for identification purposes'))
+        return string
+    #}}}
 
-		#observed field that we compare the model against
-		self.observation = observation if observation is not None else float('NaN')
+    def extrude(self, md):  # {{{
+        if not np.any(np.isnan(self.weights)):
+            self.weights = project3d(md, 'vector', self.weights, 'type', 'node')
+        if not np.any(np.isnan(self.observation)):
+            self.observation = project3d(md, 'vector', self.observation, 'type', 'node')
+        return self
+    #}}}
 
-		#string for observed field.
-		self.observation_string = observation_string if observation_string is not None else ''
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if type(self.name) != str:
+            raise TypeError('misfit error message: "name" field should be a string!')
 
-		self.timeinterpolation = timeinterpolation if timeinterpolation is not None else 'nearestneighbor'
+        OutputdefinitionStringArray = []
+        for i in range(100):
+            OutputdefinitionStringArray.append('Outputdefinition' + str(i))
 
-		self.local = local if local is not None else 1
+        md = checkfield(md, 'fieldname', 'self.definitionstring', 'field', self.definitionstring, 'values', OutputdefinitionStringArray)
+        if type(self.timeinterpolation) != str:
+            raise TypeError('misfit error message: "timeinterpolation" field should be a string!')
 
-		#weight coefficients for every vertex
-		self.weights = weights if weights is not None else float('NaN')
+        md = checkfield(md, 'fieldname', 'self.observation', 'field', self.observation, 'timeseries', 1, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'self.timeinterpolation', 'field', self.timeinterpolation, 'values', ['nearestneighbor'])
+        md = checkfield(md, 'fieldname', 'self.weights', 'field', self.weights, 'timeseries', 1, 'NaN', 1, 'Inf', 1)
 
-		#string to identify this particular set of weights
-		self.weights_string = weights_string if weights_string is not None else ''
+        return md
+    # }}}
 
-		#do we cumulate misfit through time?
-		self.cumulated = cumulated if cumulated is not None else float('NaN')		
-		#}}}
-
-	def __repr__(self): # {{{
-		string='   Misfit:'
-
-		string="%s\n%s"%(string,fielddisplay(self,'name','identifier for this misfit response'))
-		string="%s\n%s"%(string,fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from "Outputdefinition[1-10]"'))
-		string="%s\n%s"%(string,fielddisplay(self,'model_string','string for field that is modeled'))
-		string="%s\n%s"%(string,fielddisplay(self,'observation','observed field that we compare the model against'))
-		string="%s\n%s"%(string,fielddisplay(self,'observation_string','observation string'))
-		string="%s\n%s"%(string,fielddisplay(self,'local','is the response local to the elements, or global? (default is 1)'))
-		string="%s\n%s"%(string,fielddisplay(self,'timeinterpolation','interpolation routine used to interpolate misfit between two time steps (default is "nearestneighbor"'))
-		string="%s\n%s"%(string,fielddisplay(self,'weights','weights (at vertices) to apply to the misfit'))
-		string="%s\n%s"%(string,fielddisplay(self,'weights_string','string for weights for identification purposes'))
-		return string
-		#}}}
-
-	def extrude(self,md): # {{{
-		if not np.any(np.isnan(self.weights)):
-			self.weights = project3d(md,'vector',self.weights,'type','node')
-		if not np.any(np.isnan(self.observation)):
-			self.observation = project3d(md,'vector',self.observation,'type','node')
-		return self
-	#}}}
-
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		if type(self.name) != str:
-			raise TypeError('misfit error message: "name" field should be a string!')
-
-		OutputdefinitionStringArray = []
-		for i in range(100):
-			OutputdefinitionStringArray.append('Outputdefinition' + str(i))
-
-		md = checkfield(md,'fieldname','self.definitionstring','field',self.definitionstring,'values',OutputdefinitionStringArray)
-		if type(self.timeinterpolation) != str:
-			raise TypeError('misfit error message: "timeinterpolation" field should be a string!')
-
-		md = checkfield(md,'fieldname','self.observation','field',self.observation,'timeseries',1,'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','self.timeinterpolation','field',self.timeinterpolation,'values',['nearestneighbor'])
-		md = checkfield(md,'fieldname','self.weights','field',self.weights,'timeseries',1,'NaN',1,'Inf',1)
-
-		return md
-	# }}}
-
-	def marshall(self,prefix,md,fid):    #  {{{
-		WriteData(fid,prefix,'data',self.name,'name','md.misfit.name','format','String')
-		WriteData(fid,prefix,'data',self.definitionstring,'name','md.misfit.definitionstring','format','String')
-		WriteData(fid,prefix,'data',self.model_string,'name','md.misfit.model_string','format','String')
-		WriteData(fid,prefix,'data',self.observation,'name','md.misfit.observation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'data',self.observation_string,'name','md.misfit.observation_string','format','String')
-		WriteData(fid,prefix,'data',self.local,'name','md.misfit.local','format','Integer')
-		WriteData(fid,prefix,'data',self.timeinterpolation,'name','md.misfit.timeinterpolation','format','String')
-		WriteData(fid,prefix,'data',self.weights,'name','md.misfit.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'data',self.weights_string,'name','md.misfit.weights_string','format','String')
-	# }}}
+    def marshall(self, prefix, md, fid):  #  {{{
+        WriteData(fid, prefix, 'data', self.name, 'name', 'md.misfit.name', 'format', 'String')
+        WriteData(fid, prefix, 'data', self.definitionstring, 'name', 'md.misfit.definitionstring', 'format', 'String')
+        WriteData(fid, prefix, 'data', self.model_string, 'name', 'md.misfit.model_string', 'format', 'String')
+        WriteData(fid, prefix, 'data', self.observation, 'name', 'md.misfit.observation', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'data', self.observation_string, 'name', 'md.misfit.observation_string', 'format', 'String')
+        WriteData(fid, prefix, 'data', self.local, 'name', 'md.misfit.local', 'format', 'Integer')
+        WriteData(fid, prefix, 'data', self.timeinterpolation, 'name', 'md.misfit.timeinterpolation', 'format', 'String')
+        WriteData(fid, prefix, 'data', self.weights, 'name', 'md.misfit.weights', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'data', self.weights_string, 'name', 'md.misfit.weights_string', 'format', 'String')
+    # }}}
Index: /issm/trunk/src/m/classes/mismipbasalforcings.py
===================================================================
--- /issm/trunk/src/m/classes/mismipbasalforcings.py	(revision 24312)
+++ /issm/trunk/src/m/classes/mismipbasalforcings.py	(revision 24313)
@@ -5,14 +5,14 @@
 import numpy as np
 
+
 class mismipbasalforcings(object):
-    """ 
+    """
     MISMIP Basal Forcings class definition
 
-        Usage:
-	    mismipbasalforcings=mismipbasalforcings()
+    Usage:
+    mismipbasalforcings = mismipbasalforcings()
     """
 
-    def __init__(self): # {{{
-
+    def __init__(self):  # {{{
         self.groundedice_melting_rate = float('NaN')
         self.meltrate_factor = float('NaN')
@@ -20,76 +20,75 @@
         self.upperdepth_melt = float('NaN')
         self.geothermalflux = float('NaN')
-
-	self.setdefaultparameters()
+        self.setdefaultparameters()
 
     #}}}
-    def __repr__(self): # {{{
-        string=" MISMIP+ basal melt parameterization\n"
-        string="%s\n%s"%(string,fielddisplay(self,"groundedice_melting_rate","basal melting rate (positive if melting) [m/yr]"))
-        string="%s\n%s"%(string,fielddisplay(self,"meltrate_factor","Melt-rate rate factor [1/yr] (sign is opposite to MISMIP+ benchmark to remain consistent with ISSM convention of positive values for melting)"))
-        string="%s\n%s"%(string,fielddisplay(self,"threshold_thickness","Threshold thickness for saturation of basal melting [m]"))
-        string="%s\n%s"%(string,fielddisplay(self,"upperdepth_melt","Depth above which melt rate is zero [m]"))
-        string="%s\n%s"%(string,fielddisplay(self,"geothermalflux","Geothermal heat flux [W/m^2]"))
-	return string
+
+    def __repr__(self):  # {{{
+        string = " MISMIP + basal melt parameterization\n"
+        string = "%s\n%s" % (string, fielddisplay(self, "groundedice_melting_rate", "basal melting rate (positive if melting) [m / yr]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "meltrate_factor", "Melt - rate rate factor [1 / yr] (sign is opposite to MISMIP + benchmark to remain consistent with ISSM convention of positive values for melting)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "threshold_thickness", "Threshold thickness for saturation of basal melting [m]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "upperdepth_melt", "Depth above which melt rate is zero [m]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "geothermalflux", "Geothermal heat flux [W / m^2]"))
+        return string
     #}}}
-    def extrude(self,md): # {{{
-        self.groundedice_melting_rate=project3d(md,'vector',self.groundedice_melting_rate,'type','node','layer',1)
-        self.geothermalflux=project3d(md,'vector',self.geothermalflux,'type','node','layer',1)    #bedrock only gets geothermal flux
-	return self
-    #}}}
-    def initialize(self,md): # {{{
-        if np.all(np.isnan(self.groundedice_melting_rate)):
-            self.groundedice_melting_rate=np.zeros((md.mesh.numberofvertices))
-            print ' no basalforcings.groundedice_melting_rate specified: values set as zero'
-	if np.all(np.isnan(self.geothermalflux)):
-			self.geothermalflux=np.zeros((md.mesh.numberofvertices))
-			print "      no basalforcings.geothermalflux specified: values set as zero"
+
+    def extrude(self, md):  # {{{
+        self.groundedice_melting_rate = project3d(md, 'vector', self.groundedice_melting_rate, 'type', 'node', 'layer', 1)
+        self.geothermalflux = project3d(md, 'vector', self.geothermalflux, 'type', 'node', 'layer', 1)  #bedrock only gets geothermal flux
         return self
     #}}}
-    def setdefaultparameters(self): # {{{
+
+    def initialize(self, md):  # {{{
+        if np.all(np.isnan(self.groundedice_melting_rate)):
+            self.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices))
+            print(' no basalforcings.groundedice_melting_rate specified: values set as zero')
+        if np.all(np.isnan(self.geothermalflux)):
+            self.geothermalflux = np.zeros((md.mesh.numberofvertices))
+            print("      no basalforcings.geothermalflux specified: values set as zero")
+        return self
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
         # default values for melting parameterization
         self.meltrate_factor = 0.2
         self.threshold_thickness = 75.
         self.upperdepth_melt = -100.
-	return self
+        return self
     #}}}
-    def checkconsistency(self,md,solution,analyses):    # {{{
 
-	#Early return
-        if 'MasstransportAnalysis' in analyses and not (solution=='TransientSolution' and md.transient.ismasstransport==0):
-
-	    md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1)
-	    md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'numel',[1])
-	    md = checkfield(md,'fieldname','basalforcings.threshold_thickness','>=',0,'numel',[1])
-	    md = checkfield(md,'fieldname','basalforcings.upperdepth_melt','<=',0,'numel',[1])
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if 'MasstransportAnalysis' in analyses and not (solution == 'TransientSolution' and md.transient.ismasstransport == 0):
+            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.meltrate_factor', '>=', 0, 'numel', [1])
+            md = checkfield(md, 'fieldname', 'basalforcings.threshold_thickness', '>=', 0, 'numel', [1])
+            md = checkfield(md, 'fieldname', 'basalforcings.upperdepth_melt', '<=', 0, 'numel', [1])
 
         if 'BalancethicknessAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'basalforcings.meltrate_factor', '>=', 0, 'numel', [1])
+            md = checkfield(md, 'fieldname', 'basalforcings.threshold_thickness', '>=', 0, 'numel', [1])
+            md = checkfield(md, 'fieldname', 'basalforcings.upperdepth_melt', '<=', 0, 'numel', [1])
 
-	    md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-	    md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'numel',[1])
-	    md = checkfield(md,'fieldname','basalforcings.threshold_thickness','>=',0,'numel',[1])
-	    md = checkfield(md,'fieldname','basalforcings.upperdepth_melt','<=',0,'numel',[1])
+        if 'ThermalAnalysis' in analyses and not (solution == 'TransientSolution' and md.transient.isthermal == 0):
+            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'Inf', 1, 'timeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.meltrate_factor', '>=', 0, 'numel', [1])
+            md = checkfield(md, 'fieldname', 'basalforcings.threshold_thickness', '>=', 0, 'numel', [1])
+            md = checkfield(md, 'fieldname', 'basalforcings.upperdepth_melt', '<=', 0, 'numel', [1])
+            md = checkfield(md, 'fieldname', 'basalforcings.geothermalflux', 'NaN', 1, 'Inf', 1, 'timeseries', 1, '>=', 0)
+        return md
+    # }}}
 
-        if 'ThermalAnalysis' in analyses and not (solution=='TransientSolution' and md.transient.isthermal==0):
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
+        if yts != 365.2422 * 24. * 3600.:
+            print('WARNING: value of yts for MISMIP + runs different from ISSM default!')
 
-	    md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1)
-	    md = checkfield(md,'fieldname','basalforcings.meltrate_factor','>=',0,'numel',[1])
-	    md = checkfield(md,'fieldname','basalforcings.threshold_thickness','>=',0,'numel',[1])
-	    md = checkfield(md,'fieldname','basalforcings.upperdepth_melt','<=',0,'numel',[1])
-	    md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'timeseries',1,'>=',0)
-	return md
+        WriteData(fid, prefix, 'name', 'md.basalforcings.model', 'data', 3, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundedice_melting_rate', 'format', 'DoubleMat', 'name', 'md.basalforcings.groundedice_melting_rate', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'geothermalflux', 'name', 'md.basalforcings.geothermalflux', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'meltrate_factor', 'format', 'Double', 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'threshold_thickness', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'upperdepth_melt', 'format', 'Double')
     # }}}
-    def marshall(self,prefix,md,fid):    # {{{
-
-        yts=md.constants.yts
-        if yts!=365.2422*24.*3600.:
-            print 'WARNING: value of yts for MISMIP+ runs different from ISSM default!'
-
-	WriteData(fid,prefix,'name','md.basalforcings.model','data',3,'format','Integer')
-	WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','name','md.basalforcings.groundedice_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-	WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','name','md.basalforcings.geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-	WriteData(fid,prefix,'object',self,'fieldname','meltrate_factor','format','Double','scale',1./yts)
-	WriteData(fid,prefix,'object',self,'fieldname','threshold_thickness','format','Double')
-	WriteData(fid,prefix,'object',self,'fieldname','upperdepth_melt','format','Double')
-
-    # }}}
Index: /issm/trunk/src/m/classes/model.m
===================================================================
--- /issm/trunk/src/m/classes/model.m	(revision 24312)
+++ /issm/trunk/src/m/classes/model.m	(revision 24313)
@@ -40,4 +40,5 @@
 		levelset			  = 0;
 		calving          = 0;
+		frontalforcings  = 0;
 		love			     = 0;
 		gia				  = 0;
@@ -128,6 +129,8 @@
 			if isa(md.esa,'double'); md.esa=esa(); end
 			%2017 February 10th
-			if md.settings.solver_residue_threshold==0,
-				md.settings.solver_residue_threshold = 1e-6;
+			if isa(md.settings,'settings'), %this 'isa' verification: 2018 October 24th
+				if md.settings.solver_residue_threshold==0,
+					md.settings.solver_residue_threshold = 1e-6;
+				end
 			end
 			%2017 April 10th
@@ -147,5 +150,31 @@
 				md.settings = issmsettings();
 			end
-
+			%2018 Dec 1st
+			if md.settings.sb_coupling_frequency==0
+				md.settings.sb_coupling_frequency=1;
+			end
+			%2019 Jan..
+			if isa(md.frontalforcings,'double');
+				if(~isnan(md.calving.meltingrate))
+					disp('Warning: md.calving.meltingrate is now in md.frontalforcings');
+				end
+				md.frontalforcings=frontalforcings(md.calving); 
+			end
+			%2019 Feb 26
+			if isa(md.settings.results_on_nodes,'double')
+				if md.settings.results_on_nodes == 0
+					md.settings.results_on_nodes = {};
+				else
+					md.settings.results_on_nodes = {'all'};
+				end
+			end
+			%2019 Mar 28
+			if isa(md.smb,'SMBcomponents') | isa(md.smb,'SMBmeltcomponents') | isa(md.smb,'SMBforcing') | isa(md.smb,'SMBgemb') 
+				if isa(md.smb.isclimatology,'double')
+					if prod(size(md.smb.isclimatology)) ~= 1
+						md.smb.isclimatology = 0;
+					end
+				end
+			end
 		end% }}}
 	end
@@ -301,6 +330,6 @@
 				md.calving.coeff=project2d(md,md.calving.coeff,1); 
 			end
-			if isprop(md.calving,'meltingrate') & ~isnan(md.calving.meltingrate),
-				md.calving.meltingrate=project2d(md,md.calving.meltingrate,1); 
+			if isprop(md.frontalforcings,'meltingrate') & ~isnan(md.frontalforcings.meltingrate),
+				md.frontalforcings.meltingrate=project2d(md,md.frontalforcings.meltingrate,1); 
 			end
 
@@ -599,5 +628,5 @@
 			nodestoflag1=intersect(orphans_node,pos_node);
 			nodestoflag2=Pnode(nodestoflag1);
-			if numel(md1.stressbalance.spcvx)>1 & numel(md1.stressbalance.spcvy)>2 & numel(md1.stressbalance.spcvz)>2,
+			if numel(md1.stressbalance.spcvx)>1 & numel(md1.stressbalance.spcvy)>1 & numel(md1.stressbalance.spcvz)>1,
 				if numel(md1.inversion.vx_obs)>1 & numel(md1.inversion.vy_obs)>1
 					md2.stressbalance.spcvx(nodestoflag2)=md2.inversion.vx_obs(nodestoflag2); 
@@ -624,14 +653,18 @@
 					if isstruct(md1.results.(solutionfields{i}))
 						%get subfields
-						solutionsubfields=fields(md1.results.(solutionfields{i}));
-						for j=1:length(solutionsubfields),
-							field=md1.results.(solutionfields{i}).(solutionsubfields{j});
+						% loop over time steps
+						for p=1:length(md1.results.(solutionfields{i}))
+						    current = md1.results.(solutionfields{i})(p);
+						    solutionsubfields=fields(current);
+						    for j=1:length(solutionsubfields),
+							field=md1.results.(solutionfields{i})(p).(solutionsubfields{j});
 							if length(field)==numberofvertices1,
-								md2.results.(solutionfields{i}).(solutionsubfields{j})=field(pos_node);
+							    md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field(pos_node);
 							elseif length(field)==numberofelements1,
-								md2.results.(solutionfields{i}).(solutionsubfields{j})=field(pos_elem);
+							    md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field(pos_elem);
 							else
-								md2.results.(solutionfields{i}).(solutionsubfields{j})=field;
+							    md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field;
 							end
+						    end
 						end
 					else
@@ -834,4 +867,5 @@
 			md.levelset=extrude(md.levelset,md);
 			md.calving=extrude(md.calving,md);
+			md.frontalforcings=extrude(md.frontalforcings,md);
 			md.hydrology = extrude(md.hydrology,md);
 			md.slr = extrude(md.slr,md);
@@ -1142,5 +1176,4 @@
 				md.smb=SMBhenning(structmd.surfaceforcings);
 			end
-
 		end% }}}
 		function md = setdefaultparameters(md) % {{{
@@ -1176,4 +1209,5 @@
 			md.levelset         = levelset();
 			md.calving          = calving();
+			md.frontalforcings  = frontalforcings();
 			md.gia				  = giaivins();
 			md.esa              = esa();
@@ -1351,4 +1385,5 @@
 			disp(sprintf('%19s: %-22s -- %s','levelset'        ,['[1x1 ' class(self.levelset) ']'],'parameters for moving boundaries (level-set method)'));
 			disp(sprintf('%19s: %-22s -- %s','calving'         ,['[1x1 ' class(self.calving) ']'],'parameters for calving'));
+			disp(sprintf('%19s: %-22s -- %s','frontalforcings' ,['[1x1 ' class(self.frontalforcings) ']'],'parameters for frontalforcings'));
 			disp(sprintf('%19s: %-22s -- %s','gia'             ,['[1x1 ' class(self.gia) ']'],'parameters for gia solution'));
 			disp(sprintf('%19s: %-22s -- %s','esa'             ,['[1x1 ' class(self.esa) ']'],'parameters for elastic adjustment solution'));
Index: /issm/trunk/src/m/classes/model.py
===================================================================
--- /issm/trunk/src/m/classes/model.py	(revision 24312)
+++ /issm/trunk/src/m/classes/model.py	(revision 24313)
@@ -16,9 +16,10 @@
 from basalforcings import basalforcings
 from matice import matice
-from levelset import levelset 
+from levelset import levelset
 from calving import calving
 from fourierlove import fourierlove
 from calvinglevermann import calvinglevermann
 #from calvingpi import calvingpi
+from frontalforcings import frontalforcings
 from damage import damage
 from friction import friction
@@ -70,802 +71,810 @@
 #}}}
 
+
 class model(object):
-	#properties
-	def __init__(self):#{{{
-
-		# classtype=model.properties
-				
-		# for classe in dict.keys(classtype):
-		# 	print classe
-		# 	self.__dict__[classe] = classtype[str(classe)]
-
-		self.mesh             = mesh2d()
-		self.mask             = mask()
-		self.geometry         = geometry()
-		self.constants        = constants()
-		self.smb              = SMBforcing()
-		self.basalforcings    = basalforcings()
-		self.materials        = matice()
-		self.damage           = damage()
-		self.friction         = friction()
-		self.flowequation     = flowequation()
-		self.timestepping     = timestepping()
-		self.initialization   = initialization()
-		self.rifts            = rifts()
-		self.slr              = slr()
-
-		self.debug            = debug()
-		self.verbose          = verbose()
-		self.settings         = issmsettings()
-		self.toolkits         = toolkits()
-		self.cluster          = generic()
-
-		self.balancethickness = balancethickness()
-		self.stressbalance    = stressbalance()
-		self.groundingline    = groundingline()
-		self.hydrology        = hydrologyshreve()
-		self.masstransport    = masstransport()
-		self.thermal          = thermal()
-		self.steadystate      = steadystate()
-		self.transient        = transient()
-		self.levelset         = levelset()
-		self.calving          = calving()
-		self.gia              = giaivins()
-		self.love             = fourierlove()
-		self.esa	      = esa()
-		self.autodiff         = autodiff()
-		self.inversion        = inversion()
-		self.qmu              = qmu()
-		self.amr					 = amr()
-
-		self.results          = results()
-		self.outputdefinition = outputdefinition()
-		self.radaroverlay     = radaroverlay()
-		self.miscellaneous    = miscellaneous()
-		self.private          = private()
-		#}}}
-	def properties(self):    # {{{
-		# ordered list of properties since vars(self) is random
-                return ['mesh',
-		        'mask',
-		        'geometry',
-		        'constants',
-		        'smb',
-		        'basalforcings',
-		        'materials',
-		        'damage',
-		        'friction',
-		        'flowequation',
-		        'timestepping',
-		        'initialization',
-		        'rifts',
-		        'slr',
-		        'debug',
-		        'verbose',
-		        'settings',
-		        'toolkits',
-		        'cluster',
-		        'balancethickness',
-		        'stressbalance',
-		        'groundingline',
-		        'hydrology',
-		        'masstransport',
-		        'thermal',
-		        'steadystate',
-		        'transient',
-		        'levelset',
-		        'calving',
-			'love',
-			'gia',
-			'esa',
-		        'autodiff',
-		        'inversion',
-		        'qmu',
-		        'amr',
-		        'outputdefinition',
-		        'results',
-		        'radaroverlay',
-		        'miscellaneous',
-		        'private']
-	# }}}
-	def __repr__(obj): #{{{
-		#print "Here %s the number: %d" % ("is", 37)
-		string="%19s: %-22s -- %s" % ("mesh","[%s,%s]" % ("1x1",obj.mesh.__class__.__name__),"mesh properties")
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("mask","[%s,%s]" % ("1x1",obj.mask.__class__.__name__),"defines grounded and floating elements"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("geometry","[%s,%s]" % ("1x1",obj.geometry.__class__.__name__),"surface elevation, bedrock topography, ice thickness,..."))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("constants","[%s,%s]" % ("1x1",obj.constants.__class__.__name__),"physical constants"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("smb","[%s,%s]" % ("1x1",obj.smb.__class__.__name__),"surface mass balance"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("basalforcings","[%s,%s]" % ("1x1",obj.basalforcings.__class__.__name__),"bed forcings"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("materials","[%s,%s]" % ("1x1",obj.materials.__class__.__name__),"material properties"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("damage","[%s,%s]" % ("1x1",obj.damage.__class__.__name__),"damage propagation laws"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("friction","[%s,%s]" % ("1x1",obj.friction.__class__.__name__),"basal friction/drag properties"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("flowequation","[%s,%s]" % ("1x1",obj.flowequation.__class__.__name__),"flow equations"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("timestepping","[%s,%s]" % ("1x1",obj.timestepping.__class__.__name__),"time stepping for transient models"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("initialization","[%s,%s]" % ("1x1",obj.initialization.__class__.__name__),"initial guess/state"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("rifts","[%s,%s]" % ("1x1",obj.rifts.__class__.__name__),"rifts properties"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("slr","[%s,%s]" % ("1x1",obj.slr.__class__.__name__),"slr forcings"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("debug","[%s,%s]" % ("1x1",obj.debug.__class__.__name__),"debugging tools (valgrind, gprof)"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("verbose","[%s,%s]" % ("1x1",obj.verbose.__class__.__name__),"verbosity level in solve"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("settings","[%s,%s]" % ("1x1",obj.settings.__class__.__name__),"settings properties"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("toolkits","[%s,%s]" % ("1x1",obj.toolkits.__class__.__name__),"PETSc options for each solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("cluster","[%s,%s]" % ("1x1",obj.cluster.__class__.__name__),"cluster parameters (number of cpus...)"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("balancethickness","[%s,%s]" % ("1x1",obj.balancethickness.__class__.__name__),"parameters for balancethickness solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("stressbalance","[%s,%s]" % ("1x1",obj.stressbalance.__class__.__name__),"parameters for stressbalance solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("groundingline","[%s,%s]" % ("1x1",obj.groundingline.__class__.__name__),"parameters for groundingline solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("hydrology","[%s,%s]" % ("1x1",obj.hydrology.__class__.__name__),"parameters for hydrology solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("masstransport","[%s,%s]" % ("1x1",obj.masstransport.__class__.__name__),"parameters for masstransport solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("thermal","[%s,%s]" % ("1x1",obj.thermal.__class__.__name__),"parameters for thermal solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("steadystate","[%s,%s]" % ("1x1",obj.steadystate.__class__.__name__),"parameters for steadystate solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("transient","[%s,%s]" % ("1x1",obj.transient.__class__.__name__),"parameters for transient solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("levelset","[%s,%s]" % ("1x1",obj.levelset.__class__.__name__),"parameters for moving boundaries (level-set method)"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("calving","[%s,%s]" % ("1x1",obj.calving.__class__.__name__),"parameters for calving"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("gia","[%s,%s]" % ("1x1",obj.gia.__class__.__name__),"parameters for gia solution"))
-		string="%s\n%s" % (string,'%19s: %-22s -- %s' % ("love","[%s,%s]" % ("1x1",obj.love.__class__.__name__),"parameters for love solution"))
-		string="%s\n%s" % (string,'%19s: %-22s -- %s' % ("esa","[%s,%s]" % ("1x1",obj.esa.__class__.__name__),"parameters for elastic adjustment solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("autodiff","[%s,%s]" % ("1x1",obj.autodiff.__class__.__name__),"automatic differentiation parameters"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("inversion","[%s,%s]" % ("1x1",obj.inversion.__class__.__name__),"parameters for inverse methods"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("qmu","[%s,%s]" % ("1x1",obj.qmu.__class__.__name__),"dakota properties"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("amr","[%s,%s]" % ("1x1",obj.amr.__class__.__name__),"adaptive mesh refinement properties"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("outputdefinition","[%s,%s]" % ("1x1",obj.outputdefinition.__class__.__name__),"output definition"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("results","[%s,%s]" % ("1x1",obj.results.__class__.__name__),"model results"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("radaroverlay","[%s,%s]" % ("1x1",obj.radaroverlay.__class__.__name__),"radar image for plot overlay"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("miscellaneous","[%s,%s]" % ("1x1",obj.miscellaneous.__class__.__name__),"miscellaneous fields"))
-		return string
-	# }}}
-	def checkmessage(self,string):    # {{{
-		print "model not consistent: ", string
-		self.private.isconsistent=False
-		return self
-	# }}}
-	#@staticmethod
-	def extract(self,area):    # {{{
-		"""
-		extract - extract a model according to an Argus contour or flag list
-
-		   This routine extracts a submodel from a bigger model with respect to a given contour
-		   md must be followed by the corresponding exp file or flags list
-		   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
-		   If user wants every element outside the domain to be 
-		   extract2d, add '~' to the name of the domain file (ex: '~HO.exp')
-		   an empty string '' will be considered as an empty domain
-		   a string 'all' will be considered as the entire domain
-
-		   Usage:
-		      md2=extract(md,area)
-
-		   Examples:
-		      md2=extract(md,'Domain.exp')
-
-		   See also: EXTRUDE, COLLAPSE
-		"""
-
-		#copy model
-		md1=copy.deepcopy(self)
-
-		#get elements that are inside area
-		flag_elem=FlagElements(md1,area)
-		if not np.any(flag_elem):
-			raise RuntimeError("extracted model is empty")
-
-		#kick out all elements with 3 dirichlets
-		spc_elem=np.nonzero(np.logical_not(flag_elem))[0]
-		spc_node=np.unique(md1.mesh.elements[spc_elem,:])-1
-		flag=np.ones(md1.mesh.numberofvertices)
-		flag[spc_node]=0
-		pos=np.nonzero(np.logical_not(np.sum(flag[md1.mesh.elements-1],axis=1)))[0]
-		flag_elem[pos]=0
-
-		#extracted elements and nodes lists
-		pos_elem=np.nonzero(flag_elem)[0]
-		pos_node=np.unique(md1.mesh.elements[pos_elem,:])-1
-
-		#keep track of some fields
-		numberofvertices1=md1.mesh.numberofvertices
-		numberofelements1=md1.mesh.numberofelements
-		numberofvertices2=np.size(pos_node)
-		numberofelements2=np.size(pos_elem)
-		flag_node=np.zeros(numberofvertices1)
-		flag_node[pos_node]=1
-
-		#Create Pelem and Pnode (transform old nodes in new nodes and same thing for the elements)
-		Pelem=np.zeros(numberofelements1,int)
-		Pelem[pos_elem]=np.arange(1,numberofelements2+1)
-		Pnode=np.zeros(numberofvertices1,int)
-		Pnode[pos_node]=np.arange(1,numberofvertices2+1)
-
-		#renumber the elements (some node won't exist anymore)
-		elements_1=copy.deepcopy(md1.mesh.elements)
-		elements_2=elements_1[pos_elem,:]
-		elements_2[:,0]=Pnode[elements_2[:,0]-1]
-		elements_2[:,1]=Pnode[elements_2[:,1]-1]
-		elements_2[:,2]=Pnode[elements_2[:,2]-1]
-		if md1.mesh.__class__.__name__=='mesh3dprisms':
-			elements_2[:,3]=Pnode[elements_2[:,3]-1]
-			elements_2[:,4]=Pnode[elements_2[:,4]-1]
-			elements_2[:,5]=Pnode[elements_2[:,5]-1]
-
-		#OK, now create the new model!
-
-		#take every field from model
-		md2=copy.deepcopy(md1)
-
-		#automatically modify fields
-
-		#loop over model fields
-		model_fields=vars(md1)
-		for fieldi in model_fields:
-			#get field
-			field=getattr(md1,fieldi)
-			fieldsize=np.shape(field)
-			if hasattr(field,'__dict__') and not fieldi in ['results']:    #recursive call
-				object_fields=vars(field)
-				for fieldj in object_fields:
-					#get field
-					field=getattr(getattr(md1,fieldi),fieldj)
-					fieldsize=np.shape(field)
-					if len(fieldsize):
-						#size = number of nodes * n
-						if fieldsize[0]==numberofvertices1:
-							setattr(getattr(md2,fieldi),fieldj,field[pos_node])
-						elif fieldsize[0]==numberofvertices1+1:
-							setattr(getattr(md2,fieldi),fieldj,np.vstack((field[pos_node],field[-1,:])))
-						#size = number of elements * n
-						elif fieldsize[0]==numberofelements1:
-							setattr(getattr(md2,fieldi),fieldj,field[pos_elem])
-			else:
-				if len(fieldsize):
-					#size = number of nodes * n
-					if fieldsize[0]==numberofvertices1:
-						setattr(md2,fieldi,field[pos_node])
-					elif fieldsize[0]==numberofvertices1+1:
-						setattr(md2,fieldi,np.hstack((field[pos_node],field[-1,:])))
-					#size = number of elements * n
-					elif fieldsize[0]==numberofelements1:
-						setattr(md2,fieldi,field[pos_elem])
-
-		#modify some specific fields
-
-		#Mesh
-		md2.mesh.numberofelements=numberofelements2
-		md2.mesh.numberofvertices=numberofvertices2
-		md2.mesh.elements=elements_2
-
-		#mesh.uppervertex mesh.lowervertex
-		if md1.mesh.__class__.__name__=='mesh3dprisms':
-			md2.mesh.uppervertex=md1.mesh.uppervertex[pos_node]
-			pos=np.where(~np.isnan(md2.mesh.uppervertex))[0]
-			md2.mesh.uppervertex[pos]=Pnode[md2.mesh.uppervertex[pos].astype(int)-1]
-
-			md2.mesh.lowervertex=md1.mesh.lowervertex[pos_node]
-			pos=np.where(~np.isnan(md2.mesh.lowervertex))[0]
-			md2.mesh.lowervertex[pos]=Pnode[md2.mesh.lowervertex[pos].astype(int)-1]
-
-			md2.mesh.upperelements=md1.mesh.upperelements[pos_elem]
-			pos=np.where(~np.isnan(md2.mesh.upperelements))[0]
-			md2.mesh.upperelements[pos]=Pelem[md2.mesh.upperelements[pos].astype(int)-1]
-
-			md2.mesh.lowerelements=md1.mesh.lowerelements[pos_elem]
-			pos=np.where(~np.isnan(md2.mesh.lowerelements))[0]
-			md2.mesh.lowerelements[pos]=Pelem[md2.mesh.lowerelements[pos].astype(int)-1]
-
-		#Initial 2d mesh 
-		if md1.mesh.__class__.__name__=='mesh3dprisms':
-			flag_elem_2d=flag_elem[np.arange(0,md1.mesh.numberofelements2d)]
-			pos_elem_2d=np.nonzero(flag_elem_2d)[0]
-			flag_node_2d=flag_node[np.arange(0,md1.mesh.numberofvertices2d)]
-			pos_node_2d=np.nonzero(flag_node_2d)[0]
-
-			md2.mesh.numberofelements2d=np.size(pos_elem_2d)
-			md2.mesh.numberofvertices2d=np.size(pos_node_2d)
-			md2.mesh.elements2d=md1.mesh.elements2d[pos_elem_2d,:]
-			md2.mesh.elements2d[:,0]=Pnode[md2.mesh.elements2d[:,0]-1]
-			md2.mesh.elements2d[:,1]=Pnode[md2.mesh.elements2d[:,1]-1]
-			md2.mesh.elements2d[:,2]=Pnode[md2.mesh.elements2d[:,2]-1]
-
-			md2.mesh.x2d=md1.mesh.x[pos_node_2d]
-			md2.mesh.y2d=md1.mesh.y[pos_node_2d]
-
-		#Edges
-		if md1.mesh.domaintype()=='2Dhorizontal':
-			if np.ndim(md2.mesh.edges)>1 and np.size(md2.mesh.edges,axis=1)>1:    #do not use ~isnan because there are some np.nans...
-				#renumber first two columns
-				pos=np.nonzero(md2.mesh.edges[:,3]!=-1)[0]
-				md2.mesh.edges[:,0]=Pnode[md2.mesh.edges[:,0]-1]
-				md2.mesh.edges[:,1]=Pnode[md2.mesh.edges[:,1]-1]
-				md2.mesh.edges[:,2]=Pelem[md2.mesh.edges[:,2]-1]
-				md2.mesh.edges[pos,3]=Pelem[md2.mesh.edges[pos,3]-1]
-				#remove edges when the 2 vertices are not in the domain.
-				md2.mesh.edges=md2.mesh.edges[np.nonzero(np.logical_and(md2.mesh.edges[:,0],md2.mesh.edges[:,1]))[0],:]
-				#Replace all zeros by -1 in the last two columns
-				pos=np.nonzero(md2.mesh.edges[:,2]==0)[0]
-				md2.mesh.edges[pos,2]=-1
-				pos=np.nonzero(md2.mesh.edges[:,3]==0)[0]
-				md2.mesh.edges[pos,3]=-1
-				#Invert -1 on the third column with last column (Also invert first two columns!!)
-				pos=np.nonzero(md2.mesh.edges[:,2]==-1)[0]
-				md2.mesh.edges[pos,2]=md2.mesh.edges[pos,3]
-				md2.mesh.edges[pos,3]=-1
-				values=md2.mesh.edges[pos,1]
-				md2.mesh.edges[pos,1]=md2.mesh.edges[pos,0]
-				md2.mesh.edges[pos,0]=values
-				#Finally remove edges that do not belong to any element
-				pos=np.nonzero(np.logical_and(md2.mesh.edges[:,1]==-1,md2.mesh.edges[:,2]==-1))[0]
-				md2.mesh.edges=np.delete(md2.mesh.edges,pos,axis=0)
-
-		#Penalties
-		if np.any(np.logical_not(np.isnan(md2.stressbalance.vertex_pairing))):
-			for i in xrange(np.size(md1.stressbalance.vertex_pairing,axis=0)):
-				md2.stressbalance.vertex_pairing[i,:]=Pnode[md1.stressbalance.vertex_pairing[i,:]]
-			md2.stressbalance.vertex_pairing=md2.stressbalance.vertex_pairing[np.nonzero(md2.stressbalance.vertex_pairing[:,0])[0],:]
-		if np.any(np.logical_not(np.isnan(md2.masstransport.vertex_pairing))):
-			for i in xrange(np.size(md1.masstransport.vertex_pairing,axis=0)):
-				md2.masstransport.vertex_pairing[i,:]=Pnode[md1.masstransport.vertex_pairing[i,:]]
-			md2.masstransport.vertex_pairing=md2.masstransport.vertex_pairing[np.nonzero(md2.masstransport.vertex_pairing[:,0])[0],:]
-
-		#recreate segments
-		if md1.mesh.__class__.__name__=='mesh2d':
-			md2.mesh.vertexconnectivity=NodeConnectivity(md2.mesh.elements,md2.mesh.numberofvertices)[0]
-			md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements,md2.mesh.vertexconnectivity)[0]
-			md2.mesh.segments=contourenvelope(md2)
-			md2.mesh.vertexonboundary=np.zeros(numberofvertices2,bool)
-			md2.mesh.vertexonboundary[md2.mesh.segments[:,0:2]-1]=True
-		else:
-			#First do the connectivity for the contourenvelope in 2d
-			md2.mesh.vertexconnectivity=NodeConnectivity(md2.mesh.elements2d,md2.mesh.numberofvertices2d)[0]
-			md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements2d,md2.mesh.vertexconnectivity)[0]
-			segments=contourenvelope(md2)
-			md2.mesh.vertexonboundary=np.zeros(numberofvertices2/md2.mesh.numberoflayers,bool)
-			md2.mesh.vertexonboundary[segments[:,0:2]-1]=True
-			md2.mesh.vertexonboundary=np.tile(md2.mesh.vertexonboundary,md2.mesh.numberoflayers)
-			#Then do it for 3d as usual
-			md2.mesh.vertexconnectivity=NodeConnectivity(md2.mesh.elements,md2.mesh.numberofvertices)[0]
-			md2.mesh.elementconnectivity=ElementConnectivity(md2.mesh.elements,md2.mesh.vertexconnectivity)[0]
-
-		#Boundary conditions: Dirichlets on new boundary
-		#Catch the elements that have not been extracted
-		orphans_elem=np.nonzero(np.logical_not(flag_elem))[0]
-		orphans_node=np.unique(md1.mesh.elements[orphans_elem,:])-1
-		#Figure out which node are on the boundary between md2 and md1
-		nodestoflag1=np.intersect1d(orphans_node,pos_node)
-		nodestoflag2=Pnode[nodestoflag1].astype(int)-1
-		if np.size(md1.stressbalance.spcvx)>1 and np.size(md1.stressbalance.spcvy)>2 and np.size(md1.stressbalance.spcvz)>2:
-			if np.size(md1.inversion.vx_obs)>1 and np.size(md1.inversion.vy_obs)>1:
-				md2.stressbalance.spcvx[nodestoflag2]=md2.inversion.vx_obs[nodestoflag2] 
-				md2.stressbalance.spcvy[nodestoflag2]=md2.inversion.vy_obs[nodestoflag2]
-			else:
-				md2.stressbalance.spcvx[nodestoflag2]=np.nan
-				md2.stressbalance.spcvy[nodestoflag2]=np.nan
-				print "\n!! extract warning: spc values should be checked !!\n\n"
-			#put 0 for vz
-			md2.stressbalance.spcvz[nodestoflag2]=0
-		if np.any(np.logical_not(np.isnan(md1.thermal.spctemperature))):
-			md2.thermal.spctemperature[nodestoflag2]=1
-
-		#Results fields
-		if md1.results:
-			md2.results=results()
-			for solutionfield,field in md1.results.__dict__.iteritems():
-				if   isinstance(field,list):
-					setattr(md2.results,solutionfield,[])
-					#get time step
-					for i,fieldi in enumerate(field):
-						if isinstance(fieldi,results) and fieldi:
-							getattr(md2.results,solutionfield).append(results())
-							fieldr=getattr(md2.results,solutionfield)[i]
-							#get subfields
-							for solutionsubfield,subfield in fieldi.__dict__.iteritems():
-								if   np.size(subfield)==numberofvertices1:
-									setattr(fieldr,solutionsubfield,subfield[pos_node])
-								elif np.size(subfield)==numberofelements1:
-									setattr(fieldr,solutionsubfield,subfield[pos_elem])
-								else:
-									setattr(fieldr,solutionsubfield,subfield)
-						else:
-							getattr(md2.results,solutionfield).append(None)
-				elif isinstance(field,results):
-					setattr(md2.results,solutionfield,results())
-					if isinstance(field,results) and field:
-						fieldr=getattr(md2.results,solutionfield)
-						#get subfields
-						for solutionsubfield,subfield in field.__dict__.iteritems():
-							if   np.size(subfield)==numberofvertices1:
-								setattr(fieldr,solutionsubfield,subfield[pos_node])
-							elif np.size(subfield)==numberofelements1:
-								setattr(fieldr,solutionsubfield,subfield[pos_elem])
-							else:
-								setattr(fieldr,solutionsubfield,subfield)
-
-		#OutputDefinitions fields
-		if md1.outputdefinition.definitions:
-			for solutionfield,field in md1.outputdefinition.__dict__.iteritems():
-				if isinstance(field,list):
-					#get each definition
-					for i,fieldi in enumerate(field):
-						if fieldi:
-							fieldr=getattr(md2.outputdefinition,solutionfield)[i]
-							#get subfields
-							for solutionsubfield,subfield in fieldi.__dict__.iteritems():
-								if   np.size(subfield)==numberofvertices1:
-									setattr(fieldr,solutionsubfield,subfield[pos_node])
-								elif np.size(subfield)==numberofelements1:
-									setattr(fieldr,solutionsubfield,subfield[pos_elem])
-								else:
-									setattr(fieldr,solutionsubfield,subfield)
-
-		#Keep track of pos_node and pos_elem
-		md2.mesh.extractedvertices=pos_node+1
-		md2.mesh.extractedelements=pos_elem+1
-
-		return md2
-	# }}}
-	def extrude(md,*args):    # {{{
-		"""
-		EXTRUDE - vertically extrude a 2d mesh
-
-		   vertically extrude a 2d mesh and create corresponding 3d mesh.
-		   The vertical distribution can:
-		    - follow a polynomial law
-		    - follow two polynomial laws, one for the lower part and one for the upper part of the mesh
-		    - be discribed by a list of coefficients (between 0 and 1)
- 
-
-		   Usage:
-		      md=extrude(md,numlayers,extrusionexponent)
-		      md=extrude(md,numlayers,lowerexponent,upperexponent)
-		      md=extrude(md,listofcoefficients)
-
-		   Example:
-				md=extrude(md,15,1.3);
-				md=extrude(md,15,1.3,1.2);
-				md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1])
-
-		   See also: MODELEXTRACT, COLLAPSE
-		"""
-
-		#some checks on list of arguments
-		if len(args)>3 or len(args)<1:
-			raise RuntimeError("extrude error message")
-
-		#Extrude the mesh
-		if   len(args)==1:    #list of coefficients
-			clist=args[0]
-			if any(clist<0) or any(clist>1):
-				raise TypeError("extrusioncoefficients must be between 0 and 1")
-			clist.extend([0.,1.])
-			clist.sort()
-			extrusionlist=list(set(clist))
-			numlayers=len(extrusionlist)
-
-		elif len(args)==2:    #one polynomial law
-			if args[1]<=0:
-				raise TypeError("extrusionexponent must be >=0")
-			numlayers=args[0]
-			extrusionlist=(np.arange(0.,float(numlayers-1)+1.,1.)/float(numlayers-1))**args[1]
-
-		elif len(args)==3:    #two polynomial laws
-			numlayers=args[0]
-			lowerexp=args[1]
-			upperexp=args[2]
-
-			if args[1]<=0 or args[2]<=0:
-				raise TypeError("lower and upper extrusionexponents must be >=0")
-
-			lowerextrusionlist=(np.arange(0.,1.+2./float(numlayers-1),2./float(numlayers-1)))**lowerexp/2.
-			upperextrusionlist=(np.arange(0.,1.+2./float(numlayers-1),2./float(numlayers-1)))**upperexp/2.
-			extrusionlist=np.unique(np.concatenate((lowerextrusionlist,1.-upperextrusionlist)))
-
-		if numlayers<2:
-			raise TypeError("number of layers should be at least 2")
-		if md.mesh.__class__.__name__=='mesh3dprisms':
-			raise TypeError("Cannot extrude a 3d mesh (extrude cannot be called more than once)")
-
-		#Initialize with the 2d mesh
-		mesh2d = md.mesh
-		md.mesh=mesh3dprisms()
-		md.mesh.x                           = mesh2d.x
-		md.mesh.y                           = mesh2d.y
-		md.mesh.elements                    = mesh2d.elements
-		md.mesh.numberofelements            = mesh2d.numberofelements
-		md.mesh.numberofvertices            = mesh2d.numberofvertices
-
-		md.mesh.lat                         = mesh2d.lat
-		md.mesh.long                        = mesh2d.long
-		md.mesh.epsg                        = mesh2d.epsg
-		md.mesh.scale_factor                = mesh2d.scale_factor
-
-		md.mesh.vertexonboundary            = mesh2d.vertexonboundary
-		md.mesh.vertexconnectivity          = mesh2d.vertexconnectivity
-		md.mesh.elementconnectivity         = mesh2d.elementconnectivity
-		md.mesh.average_vertex_connectivity = mesh2d.average_vertex_connectivity
-
-		md.mesh.extractedvertices           = mesh2d.extractedvertices
-		md.mesh.extractedelements           = mesh2d.extractedelements
-
-		x3d=np.empty((0))
-		y3d=np.empty((0))
-		z3d=np.empty((0))    #the lower node is on the bed
-		thickness3d=md.geometry.thickness    #thickness and bed for these nodes
-		bed3d=md.geometry.base
-
-		#Create the new layers
-		for i in xrange(numlayers):
-			x3d=np.concatenate((x3d,md.mesh.x))
-			y3d=np.concatenate((y3d,md.mesh.y))
-			#nodes are distributed between bed and surface accordingly to the given exponent
-			z3d=np.concatenate((z3d,(bed3d+thickness3d*extrusionlist[i]).reshape(-1)))
-		number_nodes3d=np.size(x3d)    #number of 3d nodes for the non extruded part of the mesh
-
-		#Extrude elements 
-		elements3d=np.empty((0,6),int)
-		for i in xrange(numlayers-1):
-			elements3d=np.vstack((elements3d,np.hstack((md.mesh.elements+i*md.mesh.numberofvertices,md.mesh.elements+(i+1)*md.mesh.numberofvertices))))    #Create the elements of the 3d mesh for the non extruded part
-		number_el3d=np.size(elements3d,axis=0)    #number of 3d nodes for the non extruded part of the mesh
-
-		#Keep a trace of lower and upper nodes
-		lowervertex=np.nan*np.ones(number_nodes3d,int)
-		uppervertex=np.nan*np.ones(number_nodes3d,int)
-		lowervertex[md.mesh.numberofvertices:]=np.arange(1,(numlayers-1)*md.mesh.numberofvertices+1)
-		uppervertex[:(numlayers-1)*md.mesh.numberofvertices]=np.arange(md.mesh.numberofvertices+1,number_nodes3d+1)
-		md.mesh.lowervertex=lowervertex
-		md.mesh.uppervertex=uppervertex
-
-		#same for lower and upper elements
-		lowerelements=np.nan*np.ones(number_el3d,int)
-		upperelements=np.nan*np.ones(number_el3d,int)
-		lowerelements[md.mesh.numberofelements:]=np.arange(1,(numlayers-2)*md.mesh.numberofelements+1)
-		upperelements[:(numlayers-2)*md.mesh.numberofelements]=np.arange(md.mesh.numberofelements+1,(numlayers-1)*md.mesh.numberofelements+1)
-		md.mesh.lowerelements=lowerelements
-		md.mesh.upperelements=upperelements
-
-		#Save old mesh 
-		md.mesh.x2d=md.mesh.x
-		md.mesh.y2d=md.mesh.y
-		md.mesh.elements2d=md.mesh.elements
-		md.mesh.numberofelements2d=md.mesh.numberofelements
-		md.mesh.numberofvertices2d=md.mesh.numberofvertices
-
-		#Build global 3d mesh 
-		md.mesh.elements=elements3d
-		md.mesh.x=x3d
-		md.mesh.y=y3d
-		md.mesh.z=z3d
-		md.mesh.numberofelements=number_el3d
-		md.mesh.numberofvertices=number_nodes3d
-		md.mesh.numberoflayers=numlayers
-
-		#Ok, now deal with the other fields from the 2d mesh:
-
-		#bedinfo and surface info
-		md.mesh.vertexonbase=project3d(md,'vector',np.ones(md.mesh.numberofvertices2d,bool),'type','node','layer',1)
-		md.mesh.vertexonsurface=project3d(md,'vector',np.ones(md.mesh.numberofvertices2d,bool),'type','node','layer',md.mesh.numberoflayers)
-		md.mesh.vertexonboundary=project3d(md,'vector',md.mesh.vertexonboundary,'type','node')
-
-		#lat long
-		md.mesh.lat=project3d(md,'vector',md.mesh.lat,'type','node')
-		md.mesh.long=project3d(md,'vector',md.mesh.long,'type','node')
-		md.mesh.scale_factor=project3d(md,'vector',md.mesh.scale_factor,'type','node')
-
-		md.geometry.extrude(md)
-		md.friction.extrude(md)
-		md.inversion.extrude(md)
-		md.smb.extrude(md)
-		md.initialization.extrude(md)
-		md.flowequation.extrude(md)
-
-		md.stressbalance.extrude(md)
-		md.thermal.extrude(md)
-		md.masstransport.extrude(md)
-
-		# Calving variables
-		md.hydrology.extrude(md)
-		md.levelset.extrude(md)
-		md.calving.extrude(md)
-
-		#connectivity
-		md.mesh.elementconnectivity=np.tile(md.mesh.elementconnectivity,(numlayers-1,1))
-		md.mesh.elementconnectivity[np.nonzero(md.mesh.elementconnectivity==0)]=-sys.maxint-1
-		if not np.isnan(md.mesh.elementconnectivity).all():
-			for i in xrange(1,numlayers-1):
-				md.mesh.elementconnectivity[i*md.mesh.numberofelements2d:(i+1)*md.mesh.numberofelements2d,:] \
-						=md.mesh.elementconnectivity[i*md.mesh.numberofelements2d:(i+1)*md.mesh.numberofelements2d,:]+md.mesh.numberofelements2d
-				md.mesh.elementconnectivity[np.nonzero(md.mesh.elementconnectivity<0)]=0
-
-		md.materials.extrude(md)
-		md.damage.extrude(md)
-		md.gia.extrude(md)
-		md.mask.extrude(md)
-		md.qmu.extrude(md)
-		md.basalforcings.extrude(md)
-		md.outputdefinition.extrude(md)
-
-		#increase connectivity if less than 25:
-		if md.mesh.average_vertex_connectivity<=25:
-			md.mesh.average_vertex_connectivity=100
-
-		return md
-		# }}}
-	def collapse(md): #{{{
-		'''
-		collapses a 3d mesh into a 2d mesh
-			
-		This routine collapses a 3d model into a 2d model and collapses all
-		the fileds of the 3d model by taking their depth-averaged values
-			
-		Usage:
-			md=collapse(md)
-		'''	
-
-		#Check that the model is really a 3d model
-		if md.mesh.domaintype().lower() != '3d':
-			raise StandardError("only a 3D model can be collapsed")
-		
-		#dealing with the friction law
-		#drag is limited to nodes that are on the bedrock.
-		if hasattr(md.friction,'coefficient'): 
-			md.friction.coefficient=project2d(md,md.friction.coefficient,1)
-
-		#p and q (same deal, except for element that are on the bedrock: )
-		if hasattr(md.friction,'p'): 
-			md.friction.p=project2d(md,md.friction.p,1)
-		if hasattr(md.friction,'q'): 
-			md.friction.q=project2d(md,md.friction.q,1)
-		
-		if hasattr(md.friction,'coefficientcoulomb'): 
-			md.friction.coefficientcoulomb=project2d(md,md.friction.coefficientcoulomb,1)
-		if hasattr(md.friction,'C'): 
-			md.friction.C=project2d(md,md.friction.C,1)
-		if hasattr(md.friction,'As'): 
-			md.friction.As=project2d(md,md.friction.As,1)
-		if hasattr(md.friction,'effective_pressure') and not np.isnan(md.friction.effective_pressure).all():
-			md.friction.effective_pressure=project2d(md,md.friction.effective_pressure,1)
-		if hasattr(md.friction,'water_layer'): 
-			md.friction.water_layer=project2d(md,md.friction.water_layer,1)
-		if hasattr(md.friction,'m'): 
-			md.friction.m=project2d(md,md.friction.m,1)
-
-		#observations
-		if not np.isnan(md.inversion.vx_obs).all(): 
-			md.inversion.vx_obs=project2d(md,md.inversion.vx_obs,md.mesh.numberoflayers) 
-		if not np.isnan(md.inversion.vy_obs).all(): 
-			md.inversion.vy_obs=project2d(md,md.inversion.vy_obs,md.mesh.numberoflayers) 
-		if not np.isnan(md.inversion.vel_obs).all(): 
-			md.inversion.vel_obs=project2d(md,md.inversion.vel_obs,md.mesh.numberoflayers) 
-		if not np.isnan(md.inversion.cost_functions_coefficients).all(): 
-			md.inversion.cost_functions_coefficients=project2d(md,md.inversion.cost_functions_coefficients,md.mesh.numberoflayers) 
-		if isinstance(md.inversion.min_parameters,np.ndarray):
-			if md.inversion.min_parameters.size>1: 
-				md.inversion.min_parameters=project2d(md,md.inversion.min_parameters,md.mesh.numberoflayers) 
-		if isinstance(md.inversion.max_parameters,np.ndarray):
-			if md.inversion.max_parameters.size>1: 
-				md.inversion.max_parameters=project2d(md,md.inversion.max_parameters,md.mesh.numberoflayers) 
-		if not np.isnan(md.smb.mass_balance).all():
-			md.smb.mass_balance=project2d(md,md.smb.mass_balance,md.mesh.numberoflayers) 
-		
-		#results
-		if not np.isnan(md.initialization.vx).all(): 
-			md.initialization.vx=DepthAverage(md,md.initialization.vx)
-		if not np.isnan(md.initialization.vy).all(): 
-			md.initialization.vy=DepthAverage(md,md.initialization.vy)
-		if not np.isnan(md.initialization.vz).all(): 
-			md.initialization.vz=DepthAverage(md,md.initialization.vz)
-		if not np.isnan(md.initialization.vel).all(): 
-			md.initialization.vel=DepthAverage(md,md.initialization.vel)
-		if not np.isnan(md.initialization.temperature).all(): 
-			md.initialization.temperature=DepthAverage(md,md.initialization.temperature)
-		if not np.isnan(md.initialization.pressure).all(): 
-			md.initialization.pressure=project2d(md,md.initialization.pressure,1)
-		if not np.isnan(md.initialization.sediment_head).all(): 
-			md.initialization.sediment_head=project2d(md,md.initialization.sediment_head,1)
-		if not np.isnan(md.initialization.epl_head).all(): 
-			md.initialization.epl_head=project2d(md,md.initialization.epl_head,1)
-		if not np.isnan(md.initialization.epl_thickness).all(): 
-			md.initialization.epl_thickness=project2d(md,md.initialization.epl_thickness,1)
-
-		#giaivins
-		if not np.isnan(md.gia.mantle_viscosity).all(): 
-			md.gia.mantle_viscosity=project2d(md,md.gia.mantle_viscosity,1) 
-		if not np.isnan(md.gia.lithosphere_thickness).all(): 
-			md.gia.lithosphere_thickness=project2d(md,md.gia.lithosphere_thickness,1) 
-
-		#elementstype
-		if not np.isnan(md.flowequation.element_equation).all():
-			md.flowequation.element_equation=project2d(md,md.flowequation.element_equation,1)
-			md.flowequation.vertex_equation=project2d(md,md.flowequation.vertex_equation,1)
-			md.flowequation.borderSSA=project2d(md,md.flowequation.borderSSA,1)
-			md.flowequation.borderHO=project2d(md,md.flowequation.borderHO,1)
-			md.flowequation.borderFS=project2d(md,md.flowequation.borderFS,1)
-
-		# Hydrologydc variables
-		if hasattr(md.hydrology,'hydrologydc'):
-			md.hydrology.spcsediment_head=project2d(md,md.hydrology.spcsediment_head,1)
-			md.hydrology.mask_eplactive_node=project2d(md,md.hydrology.mask_eplactive_node,1)
-			md.hydrology.sediment_transmitivity=project2d(md,md.hydrology.sediment_transmitivity,1)
-			md.hydrology.basal_moulin_input=project2d(md,md.hydrology.basal_moulin_input,1)
-			if md.hydrology.isefficientlayer == 1:
-				md.hydrology.spcepl_head=project2d(md,md.hydrology.spcepl_head,1)
-
-		#boundary conditions
-		md.stressbalance.spcvx=project2d(md,md.stressbalance.spcvx,md.mesh.numberoflayers)
-		md.stressbalance.spcvy=project2d(md,md.stressbalance.spcvy,md.mesh.numberoflayers)
-		md.stressbalance.spcvz=project2d(md,md.stressbalance.spcvz,md.mesh.numberoflayers)
-		md.stressbalance.referential=project2d(md,md.stressbalance.referential,md.mesh.numberoflayers)
-		md.stressbalance.loadingforce=project2d(md,md.stressbalance.loadingforce,md.mesh.numberoflayers)
-		md.masstransport.spcthickness=project2d(md,md.masstransport.spcthickness,md.mesh.numberoflayers)
-		md.thermal.spctemperature=project2d(md,md.thermal.spctemperature,md.mesh.numberoflayers-1)
-		if not np.isnan(md.damage.spcdamage).all(): 
-			md.damage.spcdamage=project2d(md,md.damage.spcdamage,md.mesh.numberoflayers-1)
-
-		#materials
-		md.materials.rheology_B=DepthAverage(md,md.materials.rheology_B)
-		md.materials.rheology_n=project2d(md,md.materials.rheology_n,1)
-		
-		#damage: 
-		if md.damage.isdamage:
-			md.damage.D=DepthAverage(md,md.damage.D)
-
-		#special for thermal modeling:
-		md.basalforcings.groundedice_melting_rate=project2d(md,md.basalforcings.groundedice_melting_rate,1) 
-		md.basalforcings.floatingice_melting_rate=project2d(md,md.basalforcings.floatingice_melting_rate,1) 
-		md.basalforcings.geothermalflux=project2d(md,md.basalforcings.geothermalflux,1) #bedrock only gets geothermal flux
-
-		#update of connectivity matrix
-		md.mesh.average_vertex_connectivity=25
-
-		#Collapse the mesh
-		nodes2d=md.mesh.numberofvertices2d
-		elements2d=md.mesh.numberofelements2d
-
-		#parameters
-		md.geometry.surface=project2d(md,md.geometry.surface,1)
-		md.geometry.thickness=project2d(md,md.geometry.thickness,1)
-		md.geometry.base=project2d(md,md.geometry.base,1)
-		if isinstance(md.geometry.bed,np.ndarray):
-			md.geometry.bed=project2d(md,md.geometry.bed,1)
-		md.mask.groundedice_levelset=project2d(md,md.mask.groundedice_levelset,1)
-		md.mask.ice_levelset=project2d(md,md.mask.ice_levelset,1)
-
-		#OutputDefinitions
-		if md.outputdefinition.definitions:
-			for solutionfield,field in md.outputdefinition.__dict__.iteritems():
-				if isinstance(field,list):
-					#get each definition
-					for i,fieldi in enumerate(field):
-						if fieldi:
-							fieldr=getattr(md.outputdefinition,solutionfield)[i]
-							#get subfields
-							for solutionsubfield,subfield in fieldi.__dict__.iteritems():
-								if   np.size(subfield)==md.mesh.numberofvertices:
-									setattr(fieldr,solutionsubfield,project2d(md,subfield,1))
-								elif np.size(subfield)==md.mesh.numberofelements:
-									setattr(fieldr,solutionsubfield,project2d(md,subfield,1))
-
-
-		#Initialize with the 2d mesh
-		mesh=mesh2d()
-		mesh.x=md.mesh.x2d
-		mesh.y=md.mesh.y2d
-		mesh.numberofvertices=md.mesh.numberofvertices2d
-		mesh.numberofelements=md.mesh.numberofelements2d
-		mesh.elements=md.mesh.elements2d
-		if not np.isnan(md.mesh.vertexonboundary).all(): 
-			mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1)
-		if not np.isnan(md.mesh.elementconnectivity).all(): 
-			mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1)
-		if isinstance(md.mesh.lat,np.ndarray):
-			if md.mesh.lat.size==md.mesh.numberofvertices:  
-				mesh.lat=project2d(md,md.mesh.lat,1) 
-		if isinstance(md.mesh.long,np.ndarray):
-			if md.mesh.long.size==md.mesh.numberofvertices: 
-				md.mesh.long=project2d(md,md.mesh.long,1) 
-		mesh.epsg=md.mesh.epsg
-		if isinstance(md.mesh.scale_factor,np.ndarray):
-			if md.mesh.scale_factor.size==md.mesh.numberofvertices: 
-				md.mesh.scale_factor=project2d(md,md.mesh.scale_factor,1) 
-		md.mesh=mesh
-		md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices)[0]
-		md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity)[0]
-		md.mesh.segments=contourenvelope(md)
-
-		return md
-
-#}}}
+    #properties
+    def __init__(self):  #{{{
+        ''' classtype = model.properties
+         for classe in dict.keys(classtype):
+               print classe
+               self.__dict__[classe] = classtype[str(classe)]
+        '''
+        self.mesh = mesh2d()
+        self.mask = mask()
+        self.geometry = geometry()
+        self.constants = constants()
+        self.smb = SMBforcing()
+        self.basalforcings = basalforcings()
+        self.materials = matice()
+        self.damage = damage()
+        self.friction = friction()
+        self.flowequation = flowequation()
+        self.timestepping = timestepping()
+        self.initialization = initialization()
+        self.rifts = rifts()
+        self.slr = slr()
+
+        self.debug = debug()
+        self.verbose = verbose()
+        self.settings = issmsettings()
+        self.toolkits = toolkits()
+        self.cluster = generic()
+
+        self.balancethickness = balancethickness()
+        self.stressbalance = stressbalance()
+        self.groundingline = groundingline()
+        self.hydrology = hydrologyshreve()
+        self.masstransport = masstransport()
+        self.thermal = thermal()
+        self.steadystate = steadystate()
+        self.transient = transient()
+        self.levelset = levelset()
+        self.calving = calving()
+        self.frontalforcings = frontalforcings()
+        self.gia = giaivins()
+        self.love = fourierlove()
+        self.esa = esa()
+        self.autodiff = autodiff()
+        self.inversion = inversion()
+        self.qmu = qmu()
+        self.amr = amr()
+
+        self.results = results()
+        self.outputdefinition = outputdefinition()
+        self.radaroverlay = radaroverlay()
+        self.miscellaneous = miscellaneous()
+        self.private = private()
+    #}}}
+
+    def properties(self):  # {{{
+        # ordered list of properties since vars(self) is random
+        return ['mesh',
+                'mask',
+                'geometry',
+                'constants',
+                'smb',
+                'basalforcings',
+                'materials',
+                'damage',
+                'friction',
+                'flowequation',
+                'timestepping',
+                'initialization',
+                'rifts',
+                'slr',
+                'debug',
+                'verbose',
+                'settings',
+                'toolkits',
+                'cluster',
+                'balancethickness',
+                'stressbalance',
+                'groundingline',
+                'hydrology',
+                'masstransport',
+                'thermal',
+                'steadystate',
+                'transient',
+                'levelset',
+                'calving',
+                'frontalforcings',
+                'love',
+                'gia',
+                'esa',
+                'autodiff',
+                'inversion',
+                'qmu',
+                'amr',
+                'outputdefinition',
+                'results',
+                'radaroverlay',
+                'miscellaneous',
+                'private']
+    # }}}
+
+    def __repr__(obj):  #{{{
+        #print "Here %s the number: %d" % ("is", 37)
+        string = "%19s: % - 22s - -  %s" % ("mesh", "[%s, %s]" % ("1x1", obj.mesh.__class__.__name__), "mesh properties")
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("mask", "[%s, %s]" % ("1x1", obj.mask.__class__.__name__), "defines grounded and floating elements"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("geometry", "[%s, %s]" % ("1x1", obj.geometry.__class__.__name__), "surface elevation, bedrock topography, ice thickness, ..."))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("constants", "[%s, %s]" % ("1x1", obj.constants.__class__.__name__), "physical constants"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("smb", "[%s, %s]" % ("1x1", obj.smb.__class__.__name__), "surface mass balance"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("basalforcings", "[%s, %s]" % ("1x1", obj.basalforcings.__class__.__name__), "bed forcings"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("materials", "[%s, %s]" % ("1x1", obj.materials.__class__.__name__), "material properties"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("damage", "[%s, %s]" % ("1x1", obj.damage.__class__.__name__), "damage propagation laws"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("friction", "[%s, %s]" % ("1x1", obj.friction.__class__.__name__), "basal friction / drag properties"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("flowequation", "[%s, %s]" % ("1x1", obj.flowequation.__class__.__name__), "flow equations"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("timestepping", "[%s, %s]" % ("1x1", obj.timestepping.__class__.__name__), "time stepping for transient models"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("initialization", "[%s, %s]" % ("1x1", obj.initialization.__class__.__name__), "initial guess / state"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("rifts", "[%s, %s]" % ("1x1", obj.rifts.__class__.__name__), "rifts properties"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("slr", "[%s, %s]" % ("1x1", obj.slr.__class__.__name__), "slr forcings"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("debug", "[%s, %s]" % ("1x1", obj.debug.__class__.__name__), "debugging tools (valgrind, gprof)"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("verbose", "[%s, %s]" % ("1x1", obj.verbose.__class__.__name__), "verbosity level in solve"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("settings", "[%s, %s]" % ("1x1", obj.settings.__class__.__name__), "settings properties"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("toolkits", "[%s, %s]" % ("1x1", obj.toolkits.__class__.__name__), "PETSc options for each solution"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("cluster", "[%s, %s]" % ("1x1", obj.cluster.__class__.__name__), "cluster parameters (number of cpus...)"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("balancethickness", "[%s, %s]" % ("1x1", obj.balancethickness.__class__.__name__), "parameters for balancethickness solution"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("stressbalance", "[%s, %s]" % ("1x1", obj.stressbalance.__class__.__name__), "parameters for stressbalance solution"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("groundingline", "[%s, %s]" % ("1x1", obj.groundingline.__class__.__name__), "parameters for groundingline solution"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("hydrology", "[%s, %s]" % ("1x1", obj.hydrology.__class__.__name__), "parameters for hydrology solution"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("masstransport", "[%s, %s]" % ("1x1", obj.masstransport.__class__.__name__), "parameters for masstransport solution"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("thermal", "[%s, %s]" % ("1x1", obj.thermal.__class__.__name__), "parameters for thermal solution"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("steadystate", "[%s, %s]" % ("1x1", obj.steadystate.__class__.__name__), "parameters for steadystate solution"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("transient", "[%s, %s]" % ("1x1", obj.transient.__class__.__name__), "parameters for transient solution"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("levelset", "[%s, %s]" % ("1x1", obj.levelset.__class__.__name__), "parameters for moving boundaries (level - set method)"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("calving", "[%s, %s]" % ("1x1", obj.calving.__class__.__name__), "parameters for calving"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("frontalforcings", "[%s, %s]" % ("1x1", obj.frontalforcings.__class__.__name__), "parameters for frontalforcings"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("gia", "[%s, %s]" % ("1x1", obj.gia.__class__.__name__), "parameters for gia solution"))
+        string = "%s\n%s" % (string, '%19s: % - 22s - -  %s' % ("love", "[%s, %s]" % ("1x1", obj.love.__class__.__name__), "parameters for love solution"))
+        string = "%s\n%s" % (string, '%19s: % - 22s - -  %s' % ("esa", "[%s, %s]" % ("1x1", obj.esa.__class__.__name__), "parameters for elastic adjustment solution"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("autodiff", "[%s, %s]" % ("1x1", obj.autodiff.__class__.__name__), "automatic differentiation parameters"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("inversion", "[%s, %s]" % ("1x1", obj.inversion.__class__.__name__), "parameters for inverse methods"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("qmu", "[%s, %s]" % ("1x1", obj.qmu.__class__.__name__), "dakota properties"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("amr", "[%s, %s]" % ("1x1", obj.amr.__class__.__name__), "adaptive mesh refinement properties"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("outputdefinition", "[%s, %s]" % ("1x1", obj.outputdefinition.__class__.__name__), "output definition"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("results", "[%s, %s]" % ("1x1", obj.results.__class__.__name__), "model results"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("radaroverlay", "[%s, %s]" % ("1x1", obj.radaroverlay.__class__.__name__), "radar image for plot overlay"))
+        string = "%s\n%s" % (string, "%19s: % - 22s - -  %s" % ("miscellaneous", "[%s, %s]" % ("1x1", obj.miscellaneous.__class__.__name__), "miscellaneous fields"))
+        return string
+    # }}}
+
+    def checkmessage(self, string):  # {{{
+        print("model not consistent: {}".format(string))
+        self.private.isconsistent = False
+        return self
+    # }}}
+    #@staticmethod
+
+    def extract(self, area):  # {{{
+        """
+        extract - extract a model according to an Argus contour or flag list
+
+           This routine extracts a submodel from a bigger model with respect to a given contour
+           md must be followed by the corresponding exp file or flags list
+           It can either be a domain file (argus type, .exp extension), or an array of element flags.
+           If user wants every element outside the domain to be
+           extract2d, add '~' to the name of the domain file (ex: '~HO.exp')
+           an empty string '' will be considered as an empty domain
+           a string 'all' will be considered as the entire domain
+
+           Usage:
+              md2 = extract(md, area)
+
+           Examples:
+              md2 = extract(md, 'Domain.exp')
+
+           See also: EXTRUDE, COLLAPSE
+        """
+
+    #copy model
+        md1 = copy.deepcopy(self)
+
+    #get elements that are inside area
+        flag_elem = FlagElements(md1, area)
+        if not np.any(flag_elem):
+            raise RuntimeError("extracted model is empty")
+
+    #kick out all elements with 3 dirichlets
+        spc_elem = np.nonzero(np.logical_not(flag_elem))[0]
+        spc_node = np.unique(md1.mesh.elements[spc_elem, :]) - 1
+        flag = np.ones(md1.mesh.numberofvertices)
+        flag[spc_node] = 0
+        pos = np.nonzero(np.logical_not(np.sum(flag[md1.mesh.elements - 1], axis=1)))[0]
+        flag_elem[pos] = 0
+
+    #extracted elements and nodes lists
+        pos_elem = np.nonzero(flag_elem)[0]
+        pos_node = np.unique(md1.mesh.elements[pos_elem, :]) - 1
+
+    #keep track of some fields
+        numberofvertices1 = md1.mesh.numberofvertices
+        numberofelements1 = md1.mesh.numberofelements
+        numberofvertices2 = np.size(pos_node)
+        numberofelements2 = np.size(pos_elem)
+        flag_node = np.zeros(numberofvertices1)
+        flag_node[pos_node] = 1
+
+    #Create Pelem and Pnode (transform old nodes in new nodes and same thing for the elements)
+        Pelem = np.zeros(numberofelements1, int)
+        Pelem[pos_elem] = np.arange(1, numberofelements2 + 1)
+        Pnode = np.zeros(numberofvertices1, int)
+        Pnode[pos_node] = np.arange(1, numberofvertices2 + 1)
+
+    #renumber the elements (some node won't exist anymore)
+        elements_1 = copy.deepcopy(md1.mesh.elements)
+        elements_2 = elements_1[pos_elem, :]
+        elements_2[:, 0] = Pnode[elements_2[:, 0] - 1]
+        elements_2[:, 1] = Pnode[elements_2[:, 1] - 1]
+        elements_2[:, 2] = Pnode[elements_2[:, 2] - 1]
+        if md1.mesh.__class__.__name__ == 'mesh3dprisms':
+            elements_2[:, 3] = Pnode[elements_2[:, 3] - 1]
+            elements_2[:, 4] = Pnode[elements_2[:, 4] - 1]
+            elements_2[:, 5] = Pnode[elements_2[:, 5] - 1]
+
+    #OK, now create the new model!
+
+    #take every field from model
+        md2 = copy.deepcopy(md1)
+
+    #automatically modify fields
+
+    #loop over model fields
+        model_fields = vars(md1)
+        for fieldi in model_fields:
+            #get field
+            field = getattr(md1, fieldi)
+            fieldsize = np.shape(field)
+            if hasattr(field, '__dict__') and fieldi not in ['results']:  #recursive call
+                object_fields = vars(field)
+                for fieldj in object_fields:
+                    #get field
+                    field = getattr(getattr(md1, fieldi), fieldj)
+                    fieldsize = np.shape(field)
+                    if len(fieldsize):
+                        #size = number of nodes * n
+                        if fieldsize[0] == numberofvertices1:
+                            setattr(getattr(md2, fieldi), fieldj, field[pos_node])
+                        elif fieldsize[0] == numberofvertices1 + 1:
+                            setattr(getattr(md2, fieldi), fieldj, np.vstack((field[pos_node], field[-1, :])))
+                        #size = number of elements * n
+                        elif fieldsize[0] == numberofelements1:
+                            setattr(getattr(md2, fieldi), fieldj, field[pos_elem])
+            else:
+                if len(fieldsize):
+                    #size = number of nodes * n
+                    if fieldsize[0] == numberofvertices1:
+                        setattr(md2, fieldi, field[pos_node])
+                    elif fieldsize[0] == numberofvertices1 + 1:
+                        setattr(md2, fieldi, np.hstack((field[pos_node], field[-1, :])))
+                    #size = number of elements * n
+                    elif fieldsize[0] == numberofelements1:
+                        setattr(md2, fieldi, field[pos_elem])
+
+        #modify some specific fields
+        #Mesh
+        md2.mesh.numberofelements = numberofelements2
+        md2.mesh.numberofvertices = numberofvertices2
+        md2.mesh.elements = elements_2
+
+        #mesh.uppervertex mesh.lowervertex
+        if md1.mesh.__class__.__name__ == 'mesh3dprisms':
+            md2.mesh.uppervertex = md1.mesh.uppervertex[pos_node]
+            pos = np.where(~np.isnan(md2.mesh.uppervertex))[0]
+            md2.mesh.uppervertex[pos] = Pnode[md2.mesh.uppervertex[pos].astype(int) - 1]
+
+            md2.mesh.lowervertex = md1.mesh.lowervertex[pos_node]
+            pos = np.where(~np.isnan(md2.mesh.lowervertex))[0]
+            md2.mesh.lowervertex[pos] = Pnode[md2.mesh.lowervertex[pos].astype(int) - 1]
+
+            md2.mesh.upperelements = md1.mesh.upperelements[pos_elem]
+            pos = np.where(~np.isnan(md2.mesh.upperelements))[0]
+            md2.mesh.upperelements[pos] = Pelem[md2.mesh.upperelements[pos].astype(int) - 1]
+
+            md2.mesh.lowerelements = md1.mesh.lowerelements[pos_elem]
+            pos = np.where(~np.isnan(md2.mesh.lowerelements))[0]
+            md2.mesh.lowerelements[pos] = Pelem[md2.mesh.lowerelements[pos].astype(int) - 1]
+
+        #Initial 2d mesh
+        if md1.mesh.__class__.__name__ == 'mesh3dprisms':
+            flag_elem_2d = flag_elem[np.arange(0, md1.mesh.numberofelements2d)]
+            pos_elem_2d = np.nonzero(flag_elem_2d)[0]
+            flag_node_2d = flag_node[np.arange(0, md1.mesh.numberofvertices2d)]
+            pos_node_2d = np.nonzero(flag_node_2d)[0]
+
+            md2.mesh.numberofelements2d = np.size(pos_elem_2d)
+            md2.mesh.numberofvertices2d = np.size(pos_node_2d)
+            md2.mesh.elements2d = md1.mesh.elements2d[pos_elem_2d, :]
+            md2.mesh.elements2d[:, 0] = Pnode[md2.mesh.elements2d[:, 0] - 1]
+            md2.mesh.elements2d[:, 1] = Pnode[md2.mesh.elements2d[:, 1] - 1]
+            md2.mesh.elements2d[:, 2] = Pnode[md2.mesh.elements2d[:, 2] - 1]
+
+            md2.mesh.x2d = md1.mesh.x[pos_node_2d]
+            md2.mesh.y2d = md1.mesh.y[pos_node_2d]
+
+        #Edges
+        if md1.mesh.domaintype() == '2Dhorizontal':
+            if np.ndim(md2.mesh.edges) > 1 and np.size(md2.mesh.edges, axis=1) > 1:  #do not use ~isnan because there are some np.nans...
+                #renumber first two columns
+                pos = np.nonzero(md2.mesh.edges[:, 3] != -1)[0]
+                md2.mesh.edges[:, 0] = Pnode[md2.mesh.edges[:, 0] - 1]
+                md2.mesh.edges[:, 1] = Pnode[md2.mesh.edges[:, 1] - 1]
+                md2.mesh.edges[:, 2] = Pelem[md2.mesh.edges[:, 2] - 1]
+                md2.mesh.edges[pos, 3] = Pelem[md2.mesh.edges[pos, 3] - 1]
+                #remove edges when the 2 vertices are not in the domain.
+                md2.mesh.edges = md2.mesh.edges[np.nonzero(np.logical_and(md2.mesh.edges[:, 0], md2.mesh.edges[:, 1]))[0], :]
+                #Replace all zeros by - 1 in the last two columns
+                pos = np.nonzero(md2.mesh.edges[:, 2] == 0)[0]
+                md2.mesh.edges[pos, 2] = -1
+                pos = np.nonzero(md2.mesh.edges[:, 3] == 0)[0]
+                md2.mesh.edges[pos, 3] = -1
+                #Invert - 1 on the third column with last column (Also invert first two columns!!)
+                pos = np.nonzero(md2.mesh.edges[:, 2] == -1)[0]
+                md2.mesh.edges[pos, 2] = md2.mesh.edges[pos, 3]
+                md2.mesh.edges[pos, 3] = -1
+                values = md2.mesh.edges[pos, 1]
+                md2.mesh.edges[pos, 1] = md2.mesh.edges[pos, 0]
+                md2.mesh.edges[pos, 0] = values
+                #Finally remove edges that do not belong to any element
+                pos = np.nonzero(np.logical_and(md2.mesh.edges[:, 1] == -1, md2.mesh.edges[:, 2] == -1))[0]
+                md2.mesh.edges = np.delete(md2.mesh.edges, pos, axis=0)
+
+        #Penalties
+        if np.any(np.logical_not(np.isnan(md2.stressbalance.vertex_pairing))):
+            for i in range(np.size(md1.stressbalance.vertex_pairing, axis=0)):
+                md2.stressbalance.vertex_pairing[i, :] = Pnode[md1.stressbalance.vertex_pairing[i, :]]
+            md2.stressbalance.vertex_pairing = md2.stressbalance.vertex_pairing[np.nonzero(md2.stressbalance.vertex_pairing[:, 0])[0], :]
+        if np.any(np.logical_not(np.isnan(md2.masstransport.vertex_pairing))):
+            for i in range(np.size(md1.masstransport.vertex_pairing, axis=0)):
+                md2.masstransport.vertex_pairing[i, :] = Pnode[md1.masstransport.vertex_pairing[i, :]]
+            md2.masstransport.vertex_pairing = md2.masstransport.vertex_pairing[np.nonzero(md2.masstransport.vertex_pairing[:, 0])[0], :]
+
+        #recreate segments
+        if md1.mesh.__class__.__name__ == 'mesh2d':
+            md2.mesh.vertexconnectivity = NodeConnectivity(md2.mesh.elements, md2.mesh.numberofvertices)[0]
+            md2.mesh.elementconnectivity = ElementConnectivity(md2.mesh.elements, md2.mesh.vertexconnectivity)[0]
+            md2.mesh.segments = contourenvelope(md2)
+            md2.mesh.vertexonboundary = np.zeros(numberofvertices2, bool)
+            md2.mesh.vertexonboundary[md2.mesh.segments[:, 0:2] - 1] = True
+        else:
+            #First do the connectivity for the contourenvelope in 2d
+            md2.mesh.vertexconnectivity = NodeConnectivity(md2.mesh.elements2d, md2.mesh.numberofvertices2d)[0]
+            md2.mesh.elementconnectivity = ElementConnectivity(md2.mesh.elements2d, md2.mesh.vertexconnectivity)[0]
+            segments = contourenvelope(md2)
+            md2.mesh.vertexonboundary = np.zeros(int(numberofvertices2 / md2.mesh.numberoflayers), bool)
+            md2.mesh.vertexonboundary[segments[:, 0:2] - 1] = True
+            md2.mesh.vertexonboundary = np.tile(md2.mesh.vertexonboundary, md2.mesh.numberoflayers)
+            #Then do it for 3d as usual
+            md2.mesh.vertexconnectivity = NodeConnectivity(md2.mesh.elements, md2.mesh.numberofvertices)[0]
+            md2.mesh.elementconnectivity = ElementConnectivity(md2.mesh.elements, md2.mesh.vertexconnectivity)[0]
+
+        #Boundary conditions: Dirichlets on new boundary
+        #Catch the elements that have not been extracted
+        orphans_elem = np.nonzero(np.logical_not(flag_elem))[0]
+        orphans_node = np.unique(md1.mesh.elements[orphans_elem, :]) - 1
+        #Figure out which node are on the boundary between md2 and md1
+        nodestoflag1 = np.intersect1d(orphans_node, pos_node)
+        nodestoflag2 = Pnode[nodestoflag1].astype(int) - 1
+        if np.size(md1.stressbalance.spcvx) > 1 and np.size(md1.stressbalance.spcvy) > 2 and np.size(md1.stressbalance.spcvz) > 2:
+            if np.size(md1.inversion.vx_obs) > 1 and np.size(md1.inversion.vy_obs) > 1:
+                md2.stressbalance.spcvx[nodestoflag2] = md2.inversion.vx_obs[nodestoflag2]
+                md2.stressbalance.spcvy[nodestoflag2] = md2.inversion.vy_obs[nodestoflag2]
+            else:
+                md2.stressbalance.spcvx[nodestoflag2] = np.nan
+                md2.stressbalance.spcvy[nodestoflag2] = np.nan
+                print("\n!! extract warning: spc values should be checked !!\n\n")
+            #put 0 for vz
+            md2.stressbalance.spcvz[nodestoflag2] = 0
+        if np.any(np.logical_not(np.isnan(md1.thermal.spctemperature))):
+            md2.thermal.spctemperature[nodestoflag2] = 1
+
+        #Results fields
+        if md1.results:
+            md2.results = results()
+            for solutionfield, field in list(md1.results.__dict__.items()):
+                if isinstance(field, list):
+                    setattr(md2.results, solutionfield, [])
+                    #get time step
+                    for i, fieldi in enumerate(field):
+                        if isinstance(fieldi, results) and fieldi:
+                            getattr(md2.results, solutionfield).append(results())
+                            fieldr = getattr(md2.results, solutionfield)[i]
+                            #get subfields
+                            for solutionsubfield, subfield in list(fieldi.__dict__.items()):
+                                if np.size(subfield) == numberofvertices1:
+                                    setattr(fieldr, solutionsubfield, subfield[pos_node])
+                                elif np.size(subfield) == numberofelements1:
+                                    setattr(fieldr, solutionsubfield, subfield[pos_elem])
+                                else:
+                                    setattr(fieldr, solutionsubfield, subfield)
+                        else:
+                            getattr(md2.results, solutionfield).append(None)
+                elif isinstance(field, results):
+                    setattr(md2.results, solutionfield, results())
+                    if isinstance(field, results) and field:
+                        fieldr = getattr(md2.results, solutionfield)
+                        #get subfields
+                        for solutionsubfield, subfield in list(field.__dict__.items()):
+                            if np.size(subfield) == numberofvertices1:
+                                setattr(fieldr, solutionsubfield, subfield[pos_node])
+                            elif np.size(subfield) == numberofelements1:
+                                setattr(fieldr, solutionsubfield, subfield[pos_elem])
+                            else:
+                                setattr(fieldr, solutionsubfield, subfield)
+
+        #OutputDefinitions fields
+        if md1.outputdefinition.definitions:
+            for solutionfield, field in list(md1.outputdefinition.__dict__.items()):
+                if isinstance(field, list):
+                    #get each definition
+                    for i, fieldi in enumerate(field):
+                        if fieldi:
+                            fieldr = getattr(md2.outputdefinition, solutionfield)[i]
+                            #get subfields
+                            for solutionsubfield, subfield in list(fieldi.__dict__.items()):
+                                if np.size(subfield) == numberofvertices1:
+                                    setattr(fieldr, solutionsubfield, subfield[pos_node])
+                                elif np.size(subfield) == numberofelements1:
+                                    setattr(fieldr, solutionsubfield, subfield[pos_elem])
+                                else:
+                                    setattr(fieldr, solutionsubfield, subfield)
+
+    #Keep track of pos_node and pos_elem
+        md2.mesh.extractedvertices = pos_node + 1
+        md2.mesh.extractedelements = pos_elem + 1
+
+        return md2
+    # }}}
+
+    def extrude(md, *args):  # {{{
+        """
+        EXTRUDE - vertically extrude a 2d mesh
+
+           vertically extrude a 2d mesh and create corresponding 3d mesh.
+           The vertical distribution can:
+        - follow a polynomial law
+        - follow two polynomial laws, one for the lower part and one for the upper part of the mesh
+        - be discribed by a list of coefficients (between 0 and 1)
+
+
+           Usage:
+              md = extrude(md, numlayers, extrusionexponent)
+              md = extrude(md, numlayers, lowerexponent, upperexponent)
+              md = extrude(md, listofcoefficients)
+
+           Example:
+                        md = extrude(md, 15, 1.3)
+                        md = extrude(md, 15, 1.3, 1.2)
+                        md = extrude(md, [0 0.2 0.5 0.7 0.9 0.95 1])
+
+           See also: MODELEXTRACT, COLLAPSE
+        """
+        #some checks on list of arguments
+        if len(args) > 3 or len(args) < 1:
+            raise RuntimeError("extrude error message")
+
+        #Extrude the mesh
+        if len(args) == 1:  #list of coefficients
+            clist = args[0]
+            if any(clist < 0) or any(clist > 1):
+                raise TypeError("extrusioncoefficients must be between 0 and 1")
+            clist.extend([0., 1.])
+            clist.sort()
+            extrusionlist = list(set(clist))
+            numlayers = len(extrusionlist)
+
+        elif len(args) == 2:  #one polynomial law
+            if args[1] <= 0:
+                raise TypeError("extrusionexponent must be >= 0")
+            numlayers = args[0]
+            extrusionlist = (np.arange(0., float(numlayers - 1) + 1., 1.) / float(numlayers - 1))**args[1]
+
+        elif len(args) == 3:  #two polynomial laws
+            numlayers = args[0]
+            lowerexp = args[1]
+            upperexp = args[2]
+
+            if args[1] <= 0 or args[2] <= 0:
+                raise TypeError("lower and upper extrusionexponents must be >= 0")
+
+            lowerextrusionlist = (np.arange(0., 1. + 2. / float(numlayers - 1), 2. / float(numlayers - 1)))**lowerexp / 2.
+            upperextrusionlist = (np.arange(0., 1. + 2. / float(numlayers - 1), 2. / float(numlayers - 1)))**upperexp / 2.
+            extrusionlist = np.unique(np.concatenate((lowerextrusionlist, 1. - upperextrusionlist)))
+
+        if numlayers < 2:
+            raise TypeError("number of layers should be at least 2")
+        if md.mesh.__class__.__name__ == 'mesh3dprisms':
+            raise TypeError("Cannot extrude a 3d mesh (extrude cannot be called more than once)")
+
+        #Initialize with the 2d mesh
+        mesh2d = md.mesh
+        md.mesh = mesh3dprisms()
+        md.mesh.x = mesh2d.x
+        md.mesh.y = mesh2d.y
+        md.mesh.elements = mesh2d.elements
+        md.mesh.numberofelements = mesh2d.numberofelements
+        md.mesh.numberofvertices = mesh2d.numberofvertices
+
+        md.mesh.lat = mesh2d.lat
+        md.mesh.long = mesh2d.long
+        md.mesh.epsg = mesh2d.epsg
+        md.mesh.scale_factor = mesh2d.scale_factor
+
+        md.mesh.vertexonboundary = mesh2d.vertexonboundary
+        md.mesh.vertexconnectivity = mesh2d.vertexconnectivity
+        md.mesh.elementconnectivity = mesh2d.elementconnectivity
+        md.mesh.average_vertex_connectivity = mesh2d.average_vertex_connectivity
+
+        md.mesh.extractedvertices = mesh2d.extractedvertices
+        md.mesh.extractedelements = mesh2d.extractedelements
+
+        x3d = np.empty((0))
+        y3d = np.empty((0))
+        z3d = np.empty((0))  #the lower node is on the bed
+        thickness3d = md.geometry.thickness  #thickness and bed for these nodes
+        bed3d = md.geometry.base
+
+        #Create the new layers
+        for i in range(numlayers):
+            x3d = np.concatenate((x3d, md.mesh.x))
+            y3d = np.concatenate((y3d, md.mesh.y))
+            #nodes are distributed between bed and surface accordingly to the given exponent
+            z3d = np.concatenate((z3d, (bed3d + thickness3d * extrusionlist[i]).reshape(-1)))
+        number_nodes3d = np.size(x3d)  #number of 3d nodes for the non extruded part of the mesh
+
+        #Extrude elements
+        elements3d = np.empty((0, 6), int)
+        for i in range(numlayers - 1):
+            elements3d = np.vstack((elements3d, np.hstack((md.mesh.elements + i * md.mesh.numberofvertices,
+                                                           md.mesh.elements + (i + 1) * md.mesh.numberofvertices))))  #Create the elements of the 3d mesh for the non extruded part
+        number_el3d = np.size(elements3d, axis=0)  #number of 3d nodes for the non extruded part of the mesh
+
+        #Keep a trace of lower and upper nodes
+        lowervertex = np.nan * np.ones(number_nodes3d, int)
+        uppervertex = np.nan * np.ones(number_nodes3d, int)
+        lowervertex[md.mesh.numberofvertices:] = np.arange(1, (numlayers - 1) * md.mesh.numberofvertices + 1)
+        uppervertex[:(numlayers - 1) * md.mesh.numberofvertices] = np.arange(md.mesh.numberofvertices + 1, number_nodes3d + 1)
+        md.mesh.lowervertex = lowervertex
+        md.mesh.uppervertex = uppervertex
+
+        #same for lower and upper elements
+        lowerelements = np.nan * np.ones(number_el3d, int)
+        upperelements = np.nan * np.ones(number_el3d, int)
+        lowerelements[md.mesh.numberofelements:] = np.arange(1, (numlayers - 2) * md.mesh.numberofelements + 1)
+        upperelements[:(numlayers - 2) * md.mesh.numberofelements] = np.arange(md.mesh.numberofelements + 1, (numlayers - 1) * md.mesh.numberofelements + 1)
+        md.mesh.lowerelements = lowerelements
+        md.mesh.upperelements = upperelements
+
+        #Save old mesh
+        md.mesh.x2d = md.mesh.x
+        md.mesh.y2d = md.mesh.y
+        md.mesh.elements2d = md.mesh.elements
+        md.mesh.numberofelements2d = md.mesh.numberofelements
+        md.mesh.numberofvertices2d = md.mesh.numberofvertices
+
+        #Build global 3d mesh
+        md.mesh.elements = elements3d
+        md.mesh.x = x3d
+        md.mesh.y = y3d
+        md.mesh.z = z3d
+        md.mesh.numberofelements = number_el3d
+        md.mesh.numberofvertices = number_nodes3d
+        md.mesh.numberoflayers = numlayers
+
+        #Ok, now deal with the other fields from the 2d mesh:
+        #bedinfo and surface info
+        md.mesh.vertexonbase = project3d(md, 'vector', np.ones(md.mesh.numberofvertices2d, bool), 'type', 'node', 'layer', 1)
+        md.mesh.vertexonsurface = project3d(md, 'vector', np.ones(md.mesh.numberofvertices2d, bool), 'type', 'node', 'layer', md.mesh.numberoflayers)
+        md.mesh.vertexonboundary = project3d(md, 'vector', md.mesh.vertexonboundary, 'type', 'node')
+
+        #lat long
+        md.mesh.lat = project3d(md, 'vector', md.mesh.lat, 'type', 'node')
+        md.mesh.long = project3d(md, 'vector', md.mesh.long, 'type', 'node')
+        md.mesh.scale_factor = project3d(md, 'vector', md.mesh.scale_factor, 'type', 'node')
+
+        md.geometry.extrude(md)
+        md.friction.extrude(md)
+        md.inversion.extrude(md)
+        md.smb.extrude(md)
+        md.initialization.extrude(md)
+        md.flowequation.extrude(md)
+
+        md.stressbalance.extrude(md)
+        md.thermal.extrude(md)
+        md.masstransport.extrude(md)
+
+        # Calving variables
+        md.hydrology.extrude(md)
+        md.levelset.extrude(md)
+        md.calving.extrude(md)
+        md.frontalforcings.extrude(md)
+
+        #connectivity
+        md.mesh.elementconnectivity = np.tile(md.mesh.elementconnectivity, (numlayers - 1, 1))
+        md.mesh.elementconnectivity[np.nonzero(md.mesh.elementconnectivity == 0)] = -sys.maxsize - 1
+        if not np.isnan(md.mesh.elementconnectivity).all():
+            for i in range(1, numlayers - 1):
+                connect1 = i * md.mesh.numberofelements2d
+                connect2 = (i + 1) * md.mesh.numberofelements2d
+                md.mesh.elementconnectivity[connect1:connect2, :] = md.mesh.elementconnectivity[connect1:connect2, :] + md.mesh.numberofelements2d
+                md.mesh.elementconnectivity[np.nonzero(md.mesh.elementconnectivity < 0)] = 0
+
+        md.materials.extrude(md)
+        if md.damage.isdamage == 1:
+            md.damage.extrude(md)
+        md.gia.extrude(md)
+        md.mask.extrude(md)
+        md.qmu.extrude(md)
+        md.basalforcings.extrude(md)
+        md.outputdefinition.extrude(md)
+
+        #increase connectivity if less than 25:
+        if md.mesh.average_vertex_connectivity <= 25:
+            md.mesh.average_vertex_connectivity = 100
+
+        return md
+    # }}}
+
+    def collapse(md):  #{{{
+        '''
+        collapses a 3d mesh into a 2d mesh
+
+        This routine collapses a 3d model into a 2d model and collapses all
+        the fileds of the 3d model by taking their depth - averaged values
+
+        Usage:
+                md = collapse(md)
+        '''
+
+        #Check that the model is really a 3d model
+        if md.mesh.domaintype().lower() != '3d':
+            raise Exception("only a 3D model can be collapsed")
+
+        #dealing with the friction law
+        #drag is limited to nodes that are on the bedrock.
+        if hasattr(md.friction, 'coefficient'):
+            md.friction.coefficient = project2d(md, md.friction.coefficient, 1)
+
+        #p and q (same deal, except for element that are on the bedrock: )
+        if hasattr(md.friction, 'p'):
+            md.friction.p = project2d(md, md.friction.p, 1)
+        if hasattr(md.friction, 'q'):
+            md.friction.q = project2d(md, md.friction.q, 1)
+
+        if hasattr(md.friction, 'coefficientcoulomb'):
+            md.friction.coefficientcoulomb = project2d(md, md.friction.coefficientcoulomb, 1)
+        if hasattr(md.friction, 'C'):
+            md.friction.C = project2d(md, md.friction.C, 1)
+        if hasattr(md.friction, 'As'):
+            md.friction.As = project2d(md, md.friction.As, 1)
+        if hasattr(md.friction, 'effective_pressure') and not np.isnan(md.friction.effective_pressure).all():
+            md.friction.effective_pressure = project2d(md, md.friction.effective_pressure, 1)
+        if hasattr(md.friction, 'water_layer'):
+            md.friction.water_layer = project2d(md, md.friction.water_layer, 1)
+        if hasattr(md.friction, 'm'):
+            md.friction.m = project2d(md, md.friction.m, 1)
+
+        #observations
+        if not np.isnan(md.inversion.vx_obs).all():
+            md.inversion.vx_obs = project2d(md, md.inversion.vx_obs, md.mesh.numberoflayers)
+        if not np.isnan(md.inversion.vy_obs).all():
+            md.inversion.vy_obs = project2d(md, md.inversion.vy_obs, md.mesh.numberoflayers)
+        if not np.isnan(md.inversion.vel_obs).all():
+            md.inversion.vel_obs = project2d(md, md.inversion.vel_obs, md.mesh.numberoflayers)
+        if not np.isnan(md.inversion.cost_functions_coefficients).all():
+            md.inversion.cost_functions_coefficients = project2d(md, md.inversion.cost_functions_coefficients, md.mesh.numberoflayers)
+        if isinstance(md.inversion.min_parameters, np.ndarray):
+            if md.inversion.min_parameters.size > 1:
+                md.inversion.min_parameters = project2d(md, md.inversion.min_parameters, md.mesh.numberoflayers)
+        if isinstance(md.inversion.max_parameters, np.ndarray):
+            if md.inversion.max_parameters.size > 1:
+                md.inversion.max_parameters = project2d(md, md.inversion.max_parameters, md.mesh.numberoflayers)
+        if hasattr(md.smb, 'mass_balance'):
+            if not np.isnan(md.smb.mass_balance).all():
+                md.smb.mass_balance = project2d(md, md.smb.mass_balance, md.mesh.numberoflayers)
+
+        #results
+        if not np.isnan(md.initialization.vx).all():
+            md.initialization.vx = DepthAverage(md, md.initialization.vx)
+        if not np.isnan(md.initialization.vy).all():
+            md.initialization.vy = DepthAverage(md, md.initialization.vy)
+        if not np.isnan(md.initialization.vz).all():
+            md.initialization.vz = DepthAverage(md, md.initialization.vz)
+        if not np.isnan(md.initialization.vel).all():
+            md.initialization.vel = DepthAverage(md, md.initialization.vel)
+        if not np.isnan(md.initialization.temperature).all():
+            md.initialization.temperature = DepthAverage(md, md.initialization.temperature)
+        if not np.isnan(md.initialization.pressure).all():
+            md.initialization.pressure = project2d(md, md.initialization.pressure, 1)
+        if not np.isnan(md.initialization.sediment_head).all():
+            md.initialization.sediment_head = project2d(md, md.initialization.sediment_head, 1)
+        if not np.isnan(md.initialization.epl_head).all():
+            md.initialization.epl_head = project2d(md, md.initialization.epl_head, 1)
+        if not np.isnan(md.initialization.epl_thickness).all():
+            md.initialization.epl_thickness = project2d(md, md.initialization.epl_thickness, 1)
+
+        #giaivins
+        if not np.isnan(md.gia.mantle_viscosity).all():
+            md.gia.mantle_viscosity = project2d(md, md.gia.mantle_viscosity, 1)
+        if not np.isnan(md.gia.lithosphere_thickness).all():
+            md.gia.lithosphere_thickness = project2d(md, md.gia.lithosphere_thickness, 1)
+
+        #elementstype
+        if not np.isnan(md.flowequation.element_equation).all():
+            md.flowequation.element_equation = project2d(md, md.flowequation.element_equation, 1)
+            md.flowequation.vertex_equation = project2d(md, md.flowequation.vertex_equation, 1)
+            md.flowequation.borderSSA = project2d(md, md.flowequation.borderSSA, 1)
+            md.flowequation.borderHO = project2d(md, md.flowequation.borderHO, 1)
+            md.flowequation.borderFS = project2d(md, md.flowequation.borderFS, 1)
+
+        # Hydrologydc variables
+        hydrofields = md.hydrology.__dict__.keys()
+        for field in hydrofields:
+            try:
+                isvector = np.logical_or(np.shape(md.hydrology.__dict__[field])[0] == md.mesh.numberofelements,
+                                         np.shape(md.hydrology.__dict__[field])[0] == md.mesh.numberofvertices)
+            except IndexError:
+                isvector = False
+            #we colpase only fields that are vertices or element based
+            if isvector:
+                md.hydrology.__dict__[field] = project2d(md, md.hydrology.__dict__[field], 1)
+
+        #boundary conditions
+        md.stressbalance.spcvx = project2d(md, md.stressbalance.spcvx, md.mesh.numberoflayers)
+        md.stressbalance.spcvy = project2d(md, md.stressbalance.spcvy, md.mesh.numberoflayers)
+        md.stressbalance.spcvz = project2d(md, md.stressbalance.spcvz, md.mesh.numberoflayers)
+        md.stressbalance.referential = project2d(md, md.stressbalance.referential, md.mesh.numberoflayers)
+        md.stressbalance.loadingforce = project2d(md, md.stressbalance.loadingforce, md.mesh.numberoflayers)
+        md.masstransport.spcthickness = project2d(md, md.masstransport.spcthickness, md.mesh.numberoflayers)
+        md.thermal.spctemperature = project2d(md, md.thermal.spctemperature, md.mesh.numberoflayers - 1)
+        if not np.isnan(md.damage.spcdamage).all():
+            md.damage.spcdamage = project2d(md, md.damage.spcdamage, md.mesh.numberoflayers - 1)
+
+        #materials
+        md.materials.rheology_B = DepthAverage(md, md.materials.rheology_B)
+        md.materials.rheology_n = project2d(md, md.materials.rheology_n, 1)
+
+        #damage:
+        if md.damage.isdamage:
+            md.damage.D = DepthAverage(md, md.damage.D)
+
+        #special for thermal modeling:
+        md.basalforcings.groundedice_melting_rate = project2d(md, md.basalforcings.groundedice_melting_rate, 1)
+        md.basalforcings.floatingice_melting_rate = project2d(md, md.basalforcings.floatingice_melting_rate, 1)
+        md.basalforcings.geothermalflux = project2d(md, md.basalforcings.geothermalflux, 1)  #bedrock only gets geothermal flux
+
+        #update of connectivity matrix
+        md.mesh.average_vertex_connectivity = 25
+
+        #parameters
+        md.geometry.surface = project2d(md, md.geometry.surface, 1)
+        md.geometry.thickness = project2d(md, md.geometry.thickness, 1)
+        md.geometry.base = project2d(md, md.geometry.base, 1)
+        if isinstance(md.geometry.bed, np.ndarray):
+            md.geometry.bed = project2d(md, md.geometry.bed, 1)
+        md.mask.groundedice_levelset = project2d(md, md.mask.groundedice_levelset, 1)
+        md.mask.ice_levelset = project2d(md, md.mask.ice_levelset, 1)
+
+        #OutputDefinitions
+        if md.outputdefinition.definitions:
+            for solutionfield, field in list(md.outputdefinition.__dict__.items()):
+                if isinstance(field, list):
+                    #get each definition
+                    for i, fieldi in enumerate(field):
+                        if fieldi:
+                            fieldr = getattr(md.outputdefinition, solutionfield)[i]
+                            #get subfields
+                            for solutionsubfield, subfield in list(fieldi.__dict__.items()):
+                                if np.size(subfield) == md.mesh.numberofvertices:
+                                    setattr(fieldr, solutionsubfield, project2d(md, subfield, 1))
+                                elif np.size(subfield) == md.mesh.numberofelements:
+                                    setattr(fieldr, solutionsubfield, project2d(md, subfield, 1))
+
+        #Initialize with the 2d mesh
+        mesh = mesh2d()
+        mesh.x = md.mesh.x2d
+        mesh.y = md.mesh.y2d
+        mesh.numberofvertices = md.mesh.numberofvertices2d
+        mesh.numberofelements = md.mesh.numberofelements2d
+        mesh.elements = md.mesh.elements2d
+        if not np.isnan(md.mesh.vertexonboundary).all():
+            mesh.vertexonboundary = project2d(md, md.mesh.vertexonboundary, 1)
+        if not np.isnan(md.mesh.elementconnectivity).all():
+            mesh.elementconnectivity = project2d(md, md.mesh.elementconnectivity, 1)
+        if isinstance(md.mesh.lat, np.ndarray):
+            if md.mesh.lat.size == md.mesh.numberofvertices:
+                mesh.lat = project2d(md, md.mesh.lat, 1)
+        if isinstance(md.mesh.long, np.ndarray):
+            if md.mesh.long.size == md.mesh.numberofvertices:
+                md.mesh.long = project2d(md, md.mesh.long, 1)
+        mesh.epsg = md.mesh.epsg
+        if isinstance(md.mesh.scale_factor, np.ndarray):
+            if md.mesh.scale_factor.size == md.mesh.numberofvertices:
+                md.mesh.scale_factor = project2d(md, md.mesh.scale_factor, 1)
+        md.mesh = mesh
+        md.mesh.vertexconnectivity = NodeConnectivity(md.mesh.elements, md.mesh.numberofvertices)[0]
+        md.mesh.elementconnectivity = ElementConnectivity(md.mesh.elements, md.mesh.vertexconnectivity)[0]
+        md.mesh.segments = contourenvelope(md)
+
+        return md
+
+    #}}}
Index: /issm/trunk/src/m/classes/organizer.m
===================================================================
--- /issm/trunk/src/m/classes/organizer.m	(revision 24312)
+++ /issm/trunk/src/m/classes/organizer.m	(revision 24313)
@@ -14,5 +14,5 @@
 
 classdef organizer < handle
-    properties (SetAccess=private) 
+	properties (SetAccess=private) 
 		% {{{
 		currentstep   =0;
@@ -23,4 +23,5 @@
 		color         ='';
 		steps         =[];
+		skipio        = false;
 		requestedsteps=[0];
 		%}}}
@@ -50,4 +51,6 @@
 			org.requestedsteps=getfieldvalue(options,'steps',0);
 
+			%Skip io?
+			org.skipio=getfieldvalue(options,'skipio',0);
 		end
 		%}}}
@@ -56,4 +59,5 @@
 			disp(sprintf('   Prefix:     ''%s''\n',org.prefix));
 			disp(sprintf('   Color:      ''%s''\n',org.color));
+			disp(sprintf('   skipio:     %i\n',org.skipio));
 			if isempty(org.steps)
 				disp('   no step');
@@ -70,4 +74,11 @@
 			if ~ischar(string), error('argument provided is not a string'); end
 			path=[org.repository '/' org.prefix string];
+
+			%Skip if requested
+			if org.skipio,
+				disp(['WARNING: Skipping loading ' path]);
+				md = evalin('base', 'md');
+				return;
+			end
 
 			%figure out if the model is there
@@ -92,4 +103,11 @@
 			if ~ischar(string), error('argument provided is not a string'); end
 			path=[org.repository '/' org.prefix string];
+
+			%Skip if requested
+			if org.skipio,
+				disp(['WARNING: Skipping loading ' path]);
+				md = evalin('base', 'md');
+				return;
+			end
 
 			%figure out if the model is there, otherwise, we have to use the default path supplied by user.
@@ -175,4 +193,10 @@
 			disp(['saving model as: ' name]);
 
+			%Skip if requested
+			if org.skipio,
+				disp(['WARNING: Skipping saving ' name]);
+				return;
+			end
+
 			%check that md is a model
 			if ~isa(md,'model') & ~isa(md,'sealevelmodel'), warning('second argument is not a model'); end
@@ -190,4 +214,10 @@
 			name=[org.repository '/' org.prefix org.steps(org.currentstep).string ];
 			disp(['saving data in: ' name]);
+
+			%Skip if requested
+			if org.skipio,
+				disp(['WARNING: Skipping saving ' name]);
+				return;
+			end
 
 			%check that md is a model
Index: /issm/trunk/src/m/classes/organizer.py
===================================================================
--- /issm/trunk/src/m/classes/organizer.py	(revision 24312)
+++ /issm/trunk/src/m/classes/organizer.py	(revision 24313)
@@ -6,174 +6,182 @@
 from savevars import savevars
 from model import model
-from whichdb import whichdb
+#hack to keep python 2 compatipility
+try:
+    #py3 import
+    from dbm.ndbm import whichdb
+except ImportError:
+    #py2 import
+    from whichdb import whichdb
+
 import MatlabFuncs as m
 
+
 class organizer(object):
-	"""
-	ORGANIZER class definition
+    """
+    ORGANIZER class definition
 
-	   Supported options:
-	      repository: directory where all models will be saved
-	      prefix:     prefix for saved model names
-	      steps:      requested steps
-	      trunkprefix:prefix of previous run with a different prefix. Used to branch.
+       Supported options:
+          repository: directory where all models will be saved
+          prefix:     prefix for saved model names
+          steps:      requested steps
+          trunkprefix:prefix of previous run with a different prefix. Used to branch.
 
-	   Usage:
-	      org = organizer(varargin)
+       Usage:
+          org = organizer(varargin)
 
-	   Examples:
-	      org = organizer('repository','Models/','prefix','AGU2015','steps',0);  %build an empty organizer object with a given repository
-	"""
+       Examples:
+          org = organizer('repository', 'Models/', 'prefix', 'AGU2015', 'steps', 0);  %build an empty organizer object with a given repository
+    """
 
-	def __init__(self,*args):    # {{{
-		self._currentstep  =0
-		self.repository    ='./'
-		self.prefix        ='model.'
-		self.trunkprefix   =''
-		self.steps         =[]
-		self.requestedsteps=[0]
+    def __init__(self, *args):  # {{{
+        self._currentstep = 0
+        self.repository = './'
+        self.prefix = 'model.'
+        self.trunkprefix = ''
+        self.steps = []
+        self.requestedsteps = [0]
 
-		#process options
-		options=pairoptions.pairoptions(*args)
+        #process options
+        options = pairoptions.pairoptions(*args)
 
-		#Get prefix
-		prefix=options.getfieldvalue('prefix','model.')
-		if not isinstance(prefix,(str,unicode)):
-			raise TypeError("prefix is not a string")
-		if not m.strcmp(prefix,prefix.strip()) or len(prefix.split()) > 1:
-			raise TypeError("prefix should not have any white space")
-		self.prefix=prefix
+        #Get prefix
+        prefix = options.getfieldvalue('prefix', 'model.')
+        if not isinstance(prefix, str):
+            raise TypeError("prefix is not a string")
+        if not m.strcmp(prefix, prefix.strip()) or len(prefix.split()) > 1:
+            raise TypeError("prefix should not have any white space")
+        self.prefix = prefix
 
-		#Get repository
-		repository=options.getfieldvalue('repository','./')
-		if not isinstance(repository,(str,unicode)):
-			raise TypeError("repository is not a string")
-		if not os.path.isdir(repository):
-			raise IOError("Directory '%s' not found" % repository)
-		self.repository=repository
+        #Get repository
+        repository = options.getfieldvalue('repository', './')
+        if not isinstance(repository, str):
+            raise TypeError("repository is not a string")
+        if not os.path.isdir(repository):
+            raise IOError("Directory '%s' not found" % repository)
+        self.repository = repository
 
-		#Get steps
-		self.requestedsteps=options.getfieldvalue('steps',[0])
-		
-		#Get trunk prefix (only if provided by user)
-		if options.exist('trunkprefix'):
-			trunkprefix=options.getfieldvalue('trunkprefix','')
-			if not isinstance(trunkprefix,(str,unicode)):
-				raise TypeError("trunkprefix is not a string")
-			if not m.strcmp(trunkprefix,trunkprefix.strip()) or len(trunkprefix.split()) > 1:
-				raise TypeError("trunkprefix should not have any white space")
-			self.trunkprefix=trunkprefix
-	#}}}
-	def __repr__(self):    # {{{
-		s =""
+        #Get steps
+        self.requestedsteps = options.getfieldvalue('steps', [0])
 
-		s+="%s\n" % "   Repository: '%s'" % self.repository
-		s+="%s\n" % "   Prefix:     '%s'" % self.prefix
-		if not self.steps:
-			s+="%s\n" % "   no step"
-		else:
-			for step in self.steps:
-				s+="%s\n" % "   step #%2i: '%s'",step['id'],step['string']
-	#}}}
-	def load(self,string):    # {{{
+        #Get trunk prefix (only if provided by user)
+        if options.exist('trunkprefix'):
+            trunkprefix = options.getfieldvalue('trunkprefix', '')
+            if not isinstance(trunkprefix, str):
+                raise TypeError("trunkprefix is not a string")
+            if not m.strcmp(trunkprefix, trunkprefix.strip()) or len(trunkprefix.split()) > 1:
+                raise TypeError("trunkprefix should not have any white space")
+            self.trunkprefix = trunkprefix
+    #}}}
 
-		#Get model path
-		if not isinstance(string,(str,unicode)):
-			raise TypeError("argument provided is not a string")
-		path=os.path.join(self.repository,self.prefix+string)
+    def __repr__(self):  # {{{
+        s = ""
+        s += "%s\n" % "   Repository: '%s'" % self.repository
+        s += "%s\n" % "   Prefix:     '%s'" % self.prefix
+        if not self.steps:
+            s += "%s\n" % "   no step"
+        else:
+            for step in self.steps:
+                s += "%s\n" % "   step  #%2i: '%s'", step['id'], step['string']
+    #}}}
 
-		#figure out if the model is there
-		if os.path.exists(path):
-			struc=loadvars(path)
-			name=name=[key for key in struc.iterkeys()]
-			md=struc.name[0]
-		else:
-			raise IOError("Could not find '%s'" % path)
+    def load(self, string):  # {{{
+        #Get model path
+        if not isinstance(string, str):
+            raise TypeError("argument provided is not a string")
+        path = os.path.join(self.repository, self.prefix + string)
 
-		return md
-	#}}}
-	def loadmodel(self,string):    # {{{
+        #figure out if the model is there
+        if os.path.exists(path):
+            struc = loadvars(path)
+            name = name = [key for key in list(struc.keys())]
+            md = struc.name[0]
+        else:
+            raise IOError("Could not find '%s'" % path)
 
-		#Get model path
-		if not isinstance(string,(str,unicode)):
-			raise TypeError("argument provided is not a string")
-		path1=os.path.join(self.repository,self.prefix+string+'.python')
-		path2=os.path.join(self.repository,string)
+        return md
+    #}}}
 
-		#figure out if the model is there, otherwise, we have to use the default path supplied by user.
-		if whichdb(path1):
-			md=loadmodel(path1)
-			return md
-                elif whichdb(path2):
-                        md=loadmodel(path2)
-                        return md
+    def loadmodel(self, string):  # {{{
+        #Get model path
+        if not isinstance(string, str):
+            raise TypeError("argument provided is not a string")
+        path1 = os.path.join(self.repository, self.prefix + string + '.python')
+        path2 = os.path.join(self.repository, string)
 
-		#If we are here, the model has not been found. Try trunk prefix if provided
-		if self.trunkprefix:
-			path2=os.path.join(self.repository,self.trunkprefix+string)
-			if not os.path.exists(path2):
-				raise IOError("Could find neither '%s' nor '%s'" % (path,path2))
-			else:
-				print "--> Branching '%s' from trunk '%s'" % (self.prefix,self.trunkprefix)
-				md=loadmodel(path2)
-				return md
-		else:
-			raise IOError("Could not find '%s'" % path1)
-	#}}}
-	def perform(self,string):    # {{{
+        #figure out if the model is there, otherwise, we have to use the default path supplied by user.
+        if whichdb(path1):
+            md = loadmodel(path1)
+            return md
+        elif whichdb(path2):
+            md = loadmodel(path2)
+            return md
 
-		bool=False
+    #If we are here, the model has not been found. Try trunk prefix if provided
+        if self.trunkprefix:
+            path2 = os.path.join(self.repository, self.trunkprefix + string)
+            if not os.path.exists(path2):
+                raise IOError("Could find neither '%s' nor '%s'" % (path1, path2))
+            else:
+                print(("--> Branching '%s' from trunk '%s'" % (self.prefix, self.trunkprefix)))
+                md = loadmodel(path2)
+                return md
+        else:
+            raise IOError("Could not find '%s'" % path1)
+    #}}}
 
-		#Some checks
-		if not isinstance(string,(str,unicode)):
-			raise TypeError("Step provided should be a string")
-		if not m.strcmp(string,string.strip()) or len(string.split()) > 1:
-			raise TypeError("Step provided should not have any white space")
-		if self._currentstep>0 and string in [step['string'] for step in self.steps]:
-			raise RuntimeError("Step '%s' already present. Change name" % string) 
+    def perform(self, string):  # {{{
+        bool = False
 
-		#Add step
-		self.steps.append(OrderedDict())
-		self.steps[-1]['id']=len(self.steps)
-		self.steps[-1]['string']=string
-		self._currentstep+=1
+        #Some checks
+        if not isinstance(string, str):
+            raise TypeError("Step provided should be a string")
+        if not m.strcmp(string, string.strip()) or len(string.split()) > 1:
+            raise TypeError("Step provided should not have any white space")
+        if self._currentstep > 0 and string in [step['string'] for step in self.steps]:
+            raise RuntimeError("Step '%s' already present. Change name" % string)
 
-		#if requestedsteps = 0, print all steps in self 
-		if 0 in self.requestedsteps:
-			if self._currentstep==1:
-				print "   prefix: %s" % self.prefix
-			print "   step #%i : %s" % (self.steps[self._currentstep-1]['id'],self.steps[self._currentstep-1]['string'])
+        #Add step
+        self.steps.append(OrderedDict())
+        self.steps[-1]['id'] = len(self.steps)
+        self.steps[-1]['string'] = string
+        self._currentstep += 1
 
-		#Ok, now if _currentstep is a member of steps, return true
-		if self._currentstep in self.requestedsteps:
-			print "\n   step #%i : %s\n" % (self.steps[self._currentstep-1]['id'],self.steps[self._currentstep-1]['string'])
-			bool=True
+        #if requestedsteps = 0, print all steps in self
+        if 0 in self.requestedsteps:
+            if self._currentstep == 1:
+                print(("   prefix: %s" % self.prefix))
+            print(("   step  #%i : %s" % (self.steps[self._currentstep - 1]['id'], self.steps[self._currentstep - 1]['string'])))
 
-		#assign self back to calling workspace
-		# (no need, since Python modifies class instance directly)
+    #Ok, now if _currentstep is a member of steps, return true
+        if self._currentstep in self.requestedsteps:
+            print(("\n   step  #%i : %s\n" % (self.steps[self._currentstep - 1]['id'], self.steps[self._currentstep - 1]['string'])))
+            bool = True
 
-		return bool
-	#}}}
-	def savemodel(self,md, name='default'):    # {{{
+    #assign self back to calling workspace
+    # (no need, since Python modifies class instance directly)
 
-		#check
-		if self._currentstep==0:
-			raise RuntimeError("Cannot save model because organizer (org) is empty! Make sure you did not skip any perform call")
-		if self._currentstep>len(self.steps):
-			raise RuntimeError("Cannot save model because organizer (org) is not up to date!")
+        return bool
+    #}}}
 
-		if (name=='default'):
-			name=os.path.join(self.repository,self.prefix+self.steps[self._currentstep-1]['string']+'.python')
-		else:
-			name=os.path.join(self.repository,name)
-		print "saving model as: '%s'" % name
+    def savemodel(self, md, name='default'):  # {{{
+        #check
+        if self._currentstep == 0:
+            raise RuntimeError("Cannot save model because organizer (org) is empty! Make sure you did not skip any perform call")
+        if self._currentstep > len(self.steps):
+            raise RuntimeError("Cannot save model because organizer (org) is not up to date!")
 
-		#check that md is a model
-		if not isinstance(md,model):
-			print("second argument is not a model")
-		if self._currentstep>len(self.steps):
-			raise RuntimeError("organizer error message: element with id %d not found" % self._currentstep)
+        if (name == 'default'):
+            name = os.path.join(self.repository, self.prefix + self.steps[self._currentstep - 1]['string'] + '.python')
+        else:
+            name = os.path.join(self.repository, name)
+        print(("saving model as: '%s'" % name))
 
-		#save model
-		savevars(name,'md',md)
-	#}}}
+    #check that md is a model
+        if not isinstance(md, model):
+            print("second argument is not a model")
+        if self._currentstep > len(self.steps):
+            raise RuntimeError("organizer error message: element with id %d not found" % self._currentstep)
+
+    #save model
+        savevars(name, 'md', md)
+    #}}}
Index: /issm/trunk/src/m/classes/outputdefinition.py
===================================================================
--- /issm/trunk/src/m/classes/outputdefinition.py	(revision 24312)
+++ /issm/trunk/src/m/classes/outputdefinition.py	(revision 24313)
@@ -2,49 +2,55 @@
 from checkfield import checkfield
 from WriteData import WriteData
-import numpy as  np
+import numpy as np
+
 
 class outputdefinition(object):
-	"""
-	OUTPUTDEFINITION class definition
+    """
+    OUTPUTDEFINITION class definition
 
-	   Usage:
-	      outputdefinition=outputdefinition();
-	"""
+       Usage:
+          outputdefinition = outputdefinition()
+    """
 
-	def __init__(self): # {{{
-		self.definitions                   = []
-		#}}}
-	def __repr__(self): # {{{
-		string="   Outputdefinitions:"
+    def __init__(self):  # {{{
+        self.definitions = []
+    #}}}
 
-		string="%s\n%s"%(string,fielddisplay(self,"definitions","list of potential outputs that can be requested, but which need additional data to be defined"))
+    def __repr__(self):  # {{{
+        string = "   Outputdefinitions:"
 
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		for definition in self.definitions:
-			definition.extrude(md);
+        string = "%s\n%s" % (string, fielddisplay(self, "definitions", "list of potential outputs that can be requested, but which need additional data to be defined"))
 
-		return self
-	 #}}}
-	def setdefaultparameters(self): # {{{
-		return self
-		#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		
-		md = checkfield(md,'fieldname','outputdefinition.definitions','cell',1)
-		for definition in self.definitions:
-			definition.checkconsistency(md,solution,analyses);
+        return string
+    #}}}
 
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		data=[];
-		for i in range(len(self.definitions)):
-			self.definitions[i].marshall(prefix,md,fid);
-			classdefinition=self.definitions[i].__class__.__name__;
-			classdefinition=classdefinition[0].upper()+classdefinition[1:]
-			data.append(classdefinition)
+    def extrude(self, md):  # {{{
+        for definition in self.definitions:
+            definition.extrude(md)
 
-		data=np.unique(data);
-		WriteData(fid,prefix,'data',data,'name','md.outputdefinition.list','format','StringArray');
-	# }}}
+        return self
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+
+        md = checkfield(md, 'fieldname', 'outputdefinition.definitions', 'cell', 1)
+        for definition in self.definitions:
+            definition.checkconsistency(md, solution, analyses)
+
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        data = []
+        for i in range(len(self.definitions)):
+            self.definitions[i].marshall(prefix, md, fid)
+            classdefinition = self.definitions[i].__class__.__name__
+            classdefinition = classdefinition[0].upper() + classdefinition[1:]
+            data.append(classdefinition)
+
+        data = np.unique(data)
+        WriteData(fid, prefix, 'data', data, 'name', 'md.outputdefinition.list', 'format', 'StringArray')
+    # }}}
Index: /issm/trunk/src/m/classes/pairoptions.py
===================================================================
--- /issm/trunk/src/m/classes/pairoptions.py	(revision 24312)
+++ /issm/trunk/src/m/classes/pairoptions.py	(revision 24313)
@@ -1,172 +1,177 @@
 from collections import OrderedDict
-from WriteData import WriteData
 
 class pairoptions(object):
-	"""
-	PAIROPTIONS class definition
- 
-	   Usage:
-	      pairoptions=pairoptions();
-	      pairoptions=pairoptions('module',true,'solver',false);
-	"""
+    """
+    PAIROPTIONS class definition
 
-	def __init__(self,*arg): # {{{
-		self.functionname = ''
-		self.list         = OrderedDict()
+       Usage:
+          pairoptions = pairoptions()
+          pairoptions = pairoptions('module', true, 'solver', false)
+    """
 
-		#get calling function name
-		import inspect
-		if len(inspect.stack()) > 1:
-			self.functionname=inspect.stack()[1][3]
+    def __init__(self, * arg):  # {{{
+        self.functionname = ''
+        self.list = OrderedDict()
 
-		#initialize list
-		if not len(arg):
-			pass    #Do nothing,
-		else:
-			self.buildlist(*arg)
-	# }}}
-	def __repr__(self):    # {{{
-		s="   functionname: '%s'\n" % self.functionname
-		if self.list:
-			s+="   list: (%ix%i)\n\n" % (len(self.list),2)
-			for item in self.list.iteritems():
-				if   isinstance(item[1],(str,unicode)):
-					s+="     field: %-10s value: '%s'\n" % (item[0],item[1])
-				elif isinstance(item[1],(bool,int,long,float)):
-					s+="     field: %-10s value: %g\n" % (item[0],item[1])
-				else:
-					s+="     field: %-10s value: %s\n" % (item[0],type(item[1]))
-		else:
-			s+="   list: empty\n"
-		return s
-	# }}}
-	def buildlist(self,*arg):    # {{{
-		"""BUILDLIST - build list of objects from input"""
+    #get calling function name
+        import inspect
+        if len(inspect.stack()) > 1:
+            self.functionname = inspect.stack()[1][3]
 
-		#check length of input
-		if len(arg) % 2:
-			raise TypeError('Invalid parameter/value pair arguments') 
-		numoptions = len(arg)/2
+    #initialize list
+        if not len(arg):
+            pass  #Do nothing,
+        else:
+            self.buildlist(* arg)
+    # }}}
 
-		#go through arg and build list of objects
-		for i in xrange(numoptions):
-			if isinstance(arg[2*i],(str,unicode)):
-				self.list[arg[2*i]] = arg[2*i+1];
-			else:
-				#option is not a string, ignore it
-				print "WARNING: option number %d is not a string and will be ignored." % (i+1)
-	# }}}
-	def addfield(self,field,value):    # {{{
-		"""ADDFIELD - add a field to an options list"""
-		if isinstance(field,(str,unicode)):
-			if field in self.list:
-				print "WARNING: field '%s' with value=%s exists and will be overwritten with value=%s." % (field,str(self.list[field]),str(value))
-			self.list[field] = value
-	# }}}
-	def addfielddefault(self,field,value):    # {{{
-		"""ADDFIELDDEFAULT - add a field to an options list if it does not already exist"""
-		if isinstance(field,(str,unicode)):
-			if field not in self.list:
-				self.list[field] = value
-	# }}}
-	def AssignObjectFields(self,obj2):    # {{{
-		"""ASSIGNOBJECTFIELDS - assign object fields from options"""
-		for item in self.list.iteritems():
-			if item[0] in dir(obj2):
-				setattr(obj2,item[0],item[1])
-			else:
-				print "WARNING: field '%s' is not a property of '%s'." % (item[0],type(obj2))
-		return obj2
-	# }}}
-	def changefieldvalue(self,field,newvalue):    # {{{
-		"""CHANGEOPTIONVALUE - change the value of an option in an option list"""
+    def __repr__(self):  # {{{
+        s = "   functionname: '{}'\n".format(self.functionname)
+        if self.list:
+            s += "   list: ({}x{}) \n\n".format(len(self.list), 2)
+            for item in self.list.items():
+                s += "     field: {} value: '{}'\n".format(item[0], item[1])
+            print(s)
+        else:
+            s += "   list: empty\n"
+        return s
+    # }}}
 
-		self.list[field]=newvalue;
-	# }}}
-	def exist(self,field):    # {{{
-		"""EXIST - check if the option exist"""
+    def buildlist(self, * arg):  # {{{
+        """BUILDLIST - build list of objects from input"""
 
-		#some argument checking: 
-		if field == None or field == '':
-			raise ValueError('exist error message: bad usage');
-		if not isinstance(field,(str,unicode)):
-			raise TypeError("exist error message: field '%s' should be a string." % str(field));
+        #check length of input
+        if len(arg) % 2:
+            raise TypeError('Invalid parameter / value pair arguments')
+        numoptions = int(len(arg) / 2)
 
-		#Recover option
-		if field in self.list:
-			return True
-		else:
-			return False
-	# }}}
-	def getfieldvalue(self,field,default=None):    # {{{
-		"""
-		GETOPTION - get the value of an option
-	
-		Usage:
-		   value=options.getfieldvalue(field,default)
-	 
-		Find an option value from a field. A default option
-		can be given in input if the field does not exist
-	 
-		Examples:
-		   value=options.getfieldvalue(options,'caxis')
-		   value=options.getfieldvalue(options,'caxis',[0 2])
-		"""
+        #go through arg and build list of objects
+        for i in range(numoptions):
+            if isinstance(arg[2 * i], str):
+                self.list[arg[2 * i]] = arg[2 * i + 1]
+            else:
+                #option is not a string, ignore it
+                print(("WARNING: option number {} is not a string and will be ignored.".format(i + 1)))
+    # }}}
 
-		#some argument checking: 
-		if field == None or field == '':
-			raise ValueError('getfieldvalue error message: bad usage');
-		if not isinstance(field,(str,unicode)):
-			raise TypeError("getfieldvalue error message: field '%s' should be a string." % str(field));
+    def addfield(self, field, value):  # {{{
+        """ADDFIELD - add a field to an options list"""
+        if isinstance(field, str):
+            if field in self.list:
+                print(("WARNING: field '{}' with value={} exists and will be overwritten with value={}.".format(field, str(self.list[field]), str(value))))
+            self.list[field] = value
+    # }}}
 
-		#Recover option
-		if field in self.list:
-			value=self.list[field]
-		else:
-			if not default == None:
-				value=default
-			else:
-				raise KeyError("error message: field '%s' has not been provided by user (and no default value has been specified)." % field)
+    def addfielddefault(self, field, value):  # {{{
+        """ADDFIELDDEFAULT - add a field to an options list if it does not already exist"""
+        if isinstance(field, str):
+            if field not in self.list:
+                self.list[field] = value
+    # }}}
 
-		return value
-	# }}}
-	def removefield(self,field,warn):    # {{{
-		"""
-		REMOVEFIELD - delete a field in an option list
-	 
-		Usage:
-		   obj=removefield(self,field,warn)
-	 
-		if warn==1 display an info message to warn user that
-		some of his options have been removed.
-		"""
+    def AssignObjectFields(self, obj2):  # {{{
+        """ASSIGNOBJECTFIELDS - assign object fields from options"""
+        for item in list(self.list.items()):
+            if item[0] in dir(obj2):
+                setattr(obj2, item[0], item[1])
+            else:
+                print(("WARNING: field '%s' is not a property of '%s'." % (item[0], type(obj2))))
+        return obj2
+    # }}}
 
-		#check if field exist
-		if field in self.list:
+    def changefieldvalue(self, field, newvalue):  # {{{
+        """CHANGEOPTIONVALUE - change the value of an option in an option list"""
 
-			#remove duplicates from the options list
-			del self.list[field]
+        self.list[field] = newvalue
+    # }}}
 
-			#warn user if requested
-			if warn:
-				print "removefield info: option '%s' has been removed from the list of options." % field
-	# }}}
-	def marshall(self,md,fid,firstindex):    # {{{
+    def exist(self, field):  # {{{
+        """EXIST - check if the option exist"""
 
-		for i,item in enumerate(self.list.iteritems()):
-			name  = item[0]
-			value = item[1]
+        #some argument checking:
+        if field is None or field == '':
+            raise ValueError('exist error message: bad usage')
+        if not isinstance(field, str):
+            raise TypeError("exist error message: field '%s' should be a string." % str(field))
 
-			raise NameError('need to sync with MATLAB')
+        #Recover option
+        if field in self.list:
+            return True
+        else:
+            return False
+    # }}}
 
-			##Write option name
-			#WriteData(fid,prefix,'enum',(firstindex-1)+2*i+1,'data',name,'format','String')
+    def getfieldvalue(self, field, default=None):  # {{{
+        """
+        GETOPTION - get the value of an option
 
-			##Write option value
-			#if   isinstance(value,(str,unicode)):
-			#	WriteData(fid,prefix,'enum',(firstindex-1)+2*i+2,'data',value,'format','String')
-			#elif isinstance(value,(bool,int,long,float)):
-			#	WriteData(fid,prefix,'enum',(firstindex-1)+2*i+2,'data',value,'format','Double')
-			#else:
-				#raise TypeError("Cannot marshall option '%s': format not supported yet." % name)
-	# }}}
+        Usage:
+           value = options.getfieldvalue(field, default)
+
+        Find an option value from a field. A default option
+        can be given in input if the field does not exist
+
+        Examples:
+           value = options.getfieldvalue(options, 'caxis')
+           value = options.getfieldvalue(options, 'caxis', [0 2])
+        """
+
+    #some argument checking:
+        if field is None or field == '':
+            raise ValueError('getfieldvalue error message: bad usage')
+        if not isinstance(field, str):
+            raise TypeError("getfieldvalue error message: field '%s' should be a string." % str(field))
+
+    #Recover option
+        if field in self.list:
+            value = self.list[field]
+        else:
+            if default is not None:
+                value = default
+            else:
+                raise KeyError("error message: field '%s' has not been provided by user (and no default value has been specified)." % field)
+
+        return value
+    # }}}
+
+    def removefield(self, field, warn):  # {{{
+        """
+        REMOVEFIELD - delete a field in an option list
+
+        Usage:
+           obj = removefield(self, field, warn)
+
+        if warn == 1 display an info message to warn user that
+        some of his options have been removed.
+        """
+
+        #check if field exist
+        if field in self.list:
+
+            #remove duplicates from the options list
+            del self.list[field]
+
+            #warn user if requested
+            if warn:
+                print(("removefield info: option '%s' has been removed from the list of options." % field))
+    # }}}
+
+    def marshall(self, md, fid, firstindex):  # {{{
+
+        for i, item in enumerate(self.list.items()):
+            name = item[0]
+            value = item[1]
+
+            raise NameError('need to sync with MATLAB')
+
+        #Write option name
+        #WriteData(fid, prefix, 'enum', (firstindex - 1) + 2 * i + 1, 'data', name, 'format', 'String')
+
+        #Write option value
+        #if   isinstance(value, (str, unicode)):
+        #    WriteData(fid, prefix, 'enum', (firstindex - 1) + 2 * i + 2, 'data', value, 'format', 'String')
+        #elif isinstance(value, (bool, int, long, float)):
+        #    WriteData(fid, prefix, 'enum', (firstindex - 1) + 2 * i + 2, 'data', value, 'format', 'Double')
+        #else:
+        #raise TypeError("Cannot marshall option '%s': format not supported yet." % name)
+    # }}}
Index: /issm/trunk/src/m/classes/plotoptions.py
===================================================================
--- /issm/trunk/src/m/classes/plotoptions.py	(revision 24312)
+++ /issm/trunk/src/m/classes/plotoptions.py	(revision 24313)
@@ -1,128 +1,126 @@
-from collections import OrderedDict, Counter, defaultdict
+from collections import OrderedDict
 import pairoptions
 
+
 class plotoptions(object):
-	'''
-	PLOTOPTIONS class definition
+    '''
+    PLOTOPTIONS class definition
 
-		Usage:
-			plotoptions=plotoptions(*arg)
-	'''
+        Usage:
+            plotoptions = plotoptions(* arg)
+    '''
 
-	def __init__(self,*arg):# {{{
-		self.numberofplots = 0
-		self.figurenumber  = 1
-		self.list          = OrderedDict()
+    def __init__(self, * arg):  # {{{
+        self.numberofplots = 0
+        self.figurenumber = 1
+        self.list = OrderedDict()
 
-		self.buildlist(*arg)
-		#}}}
-	def __repr__(self): #{{{
-		s="\n"
-		s+="	numberofplots: %i\n" % self.numberofplots
-		s+="	figurenumber: %i\n"  % self.figurenumber
-		if self.list:
-			s+="	list: (%ix%i)\n" % (len(self.list),2)
-			for item in self.list.iteritems():
-				#s+="	options of plot number %i\n" % item
-				if   isinstance(item[1],(str,unicode)):
-					s+="	field: %-10s value: '%s'\n" % (item[0],item[1])
-				elif isinstance(item[1],(bool,int,long,float)):
-					s+="	field: %-10s value: '%g'\n" % (item[0],item[1])
-				else:
-					s+="	field: %-10s value: '%s'\n" % (item[0],item[1])
-		else:
-			s+="	list: empty\n"
-		return s
-	#}}}
-	def buildlist(self,*arg): #{{{
-		#check length of input
-		if len(arg) % 2:
-			raise TypeError('Invalid parameter/value pair arguments')
+        self.buildlist(* arg)
+    #}}}
 
-		#go through args and build list (like pairoptions)
-		rawoptions=pairoptions.pairoptions(*arg)
-		numoptions=len(arg)/2
-		rawlist=[] # cannot be a dict since they do not support duplicate keys
+    def __repr__(self):  #{{{
+        s = "\n"
+        s += "    numberofplots: %i\n" % self.numberofplots
+        s += "    figurenumber: %i\n" % self.figurenumber
+        if self.list:
+            s += "    list: (%ix%i)\n" % (len(self.list), 2)
+            for item in list(self.list.items()):
+                s += "    field: {:10} value: '{}'\n".format(item[0], item[1])
+            print(s)
+        else:
+            s += "    list: empty\n"
+        return s
+    #}}}
 
-		for i in xrange(numoptions):
-			if isinstance(arg[2*i],(str,unicode)):
-				rawlist.append([arg[2*i],arg[2*i+1]])
-			else:
-				#option is not a string, ignore it
-				print "WARNING: option number %d is not a string and will be ignored." % (i+1)
+    def buildlist(self, * arg):  #{{{
+        #check length of input
+        if len(arg) % 2:
+            raise TypeError('Invalid parameter / value pair arguments')
 
-		#get figure number 
-		self.figurenumber=rawoptions.getfieldvalue('figure',1)
-		rawoptions.removefield('figure',0)
+        #go through args and build list (like pairoptions)
+        rawoptions = pairoptions.pairoptions(* arg)
+        numoptions = int(len(arg) / 2)
+        rawlist = []  # cannot be a dict since they do not support duplicate keys
 
-		#get number of subplots 
-		numberofplots=Counter(x for sublist in rawlist for x in sublist if isinstance(x,(str,unicode)))['data']
-		self.numberofplots=numberofplots
+        for i in range(numoptions):
+            if isinstance(arg[2 * i], str):
+                rawlist.append([arg[2 * i], arg[2 * i + 1]])
+            else:
+                #option is not a string, ignore it
+                print(("WARNING: option number %d is not a string and will be ignored." % (i + 1)))
 
-		#figure out whether alloptions flag is on
-		if rawoptions.getfieldvalue('alloptions','off') is 'on':
-			allflag=1
-		else:
-			allflag=0
+        #get figure number
+        self.figurenumber = rawoptions.getfieldvalue('figure', 1)
+        rawoptions.removefield('figure', 0)
 
-		#initialize self.list (will need a list of dict's (or nested dict) for numberofplots>1)
-		#self.list=defaultdict(dict)
-		for i in xrange(numberofplots):
-			self.list[i]=pairoptions.pairoptions()
+        #get number of subplots
+        numberofplots = len([1 for sublist in rawlist for x in sublist if str(x) == 'data'])
+        self.numberofplots = numberofplots
 
-		#process plot options
-		for i in xrange(len(rawlist)):
+        #figure out whether alloptions flag is on
+        if rawoptions.getfieldvalue('alloptions', 'off') == 'on':
+            allflag = 1
+        else:
+            allflag = 0
 
-			#if alloptions flag is on, apply to all plots
-			if (allflag and 'data' not in rawlist[i][0] and '#' not in rawlist[i][0]):
-				
-				for j in xrange(numberofplots):
-					self.list[j].addfield(rawlist[i][0],rawlist[i][1])
+        #initialize self.list (will need a list of dict's (or nested dict) for numberofplots > 1)
+        #self.list = defaultdict(dict)
+        for i in range(numberofplots):
+            self.list[i] = pairoptions.pairoptions()
 
-			elif '#' in rawlist[i][0]:
+        #process plot options
+        for i in range(len(rawlist)):
 
-				#get subplots associated
-				string=rawlist[i][0].split('#')
-				plotnums=string[-1].split(',')
-				field=string[0]
+            #if alloptions flag is on, apply to all plots
+            if (allflag and 'data' not in rawlist[i][0] and '  #' not in rawlist[i][0]):
 
-				#loop over plotnums
-				for k in xrange(len(plotnums)):
-					plotnum=plotnums[k]
+                for j in range(numberofplots):
+                    self.list[j].addfield(rawlist[i][0], rawlist[i][1])
 
-					#Empty
-					if not plotnum: continue
+            elif '  #' in rawlist[i][0]:
+                #get subplots associated
+                string = rawlist[i][0].split('  #')
+                plotnums = string[-1].split(', ')
+                field = string[0]
 
-					# '#all'
-					elif 'all' in plotnum:
-						for j in xrange(numberofplots):
-							self.list[j].addfield(field,rawlist[i][1])
+                #loop over plotnums
+                for k in range(len(plotnums)):
+                    plotnum = plotnums[k]
 
-					# '#i-j'
-					elif '-' in plotnum:
-						nums=plotnum.split('-')
-						if len(nums)!=2: continue
-						if False in [x.isdigit() for x in nums]:
-							raise ValueError('error: in option i-j both i and j must be integers')
-						for j in xrange(int(nums[0])-1,int(nums[1])):
-							self.list[j].addfield(field,rawlist[i][1])	
+                    #Empty
+                    if not plotnum:
+                        continue
 
-					# Deal with #i
-					else:
-						#assign to subplot
-						if int(plotnum)>numberofplots:
-							raise ValueError('error: %s cannot be assigned %d which exceeds the number of subplots' % (field,plotnum))
-						self.list[int(plotnum)-1].addfield(field,rawlist[i][1])
-			else:
-				
-				#go through all subplots and assign key-value pairs
-				j=0
-				while j <= numberofplots-1:
-					if not self.list[j].exist(rawlist[i][0]):
-						self.list[j].addfield(rawlist[i][0],rawlist[i][1])
-						break
-					else:
-						j=j+1
-				if j+1>numberofplots:
-					print "WARNING: too many instances of '%s' in options" % rawlist[i][0]
-	#}}}
+                    # '  #all'
+                    elif 'all' in plotnum:
+                        for j in range(numberofplots):
+                            self.list[j].addfield(field, rawlist[i][1])
+
+                    # '  #i - j'
+                    elif '-' in plotnum:
+                        nums = plotnum.split(' - ')
+                        if len(nums) != 2:
+                            continue
+                        if False in [x.isdigit() for x in nums]:
+                            raise ValueError('error: in option i - j both i and j must be integers')
+                        for j in range(int(nums[0]) - 1, int(nums[1])):
+                            self.list[j].addfield(field, rawlist[i][1])
+
+                    # Deal with  #i
+                    else:
+                        #assign to subplot
+                        if int(plotnum) > numberofplots:
+                            raise ValueError('error: %s cannot be assigned %d which exceeds the number of subplots' % (field, plotnum))
+                        self.list[int(plotnum) - 1].addfield(field, rawlist[i][1])
+            else:
+                #go through all subplots and assign key - value pairs
+                j = 0
+                while j <= numberofplots - 1:
+                    if not self.list[j].exist(rawlist[i][0]):
+                        self.list[j].addfield(rawlist[i][0], rawlist[i][1])
+                        break
+                    else:
+                        j = j + 1
+                if j + 1 > numberofplots:
+                    print(("WARNING: too many instances of '%s' in options" % rawlist[i][0]))
+    #}}}
Index: /issm/trunk/src/m/classes/plumebasalforcings.py
===================================================================
--- /issm/trunk/src/m/classes/plumebasalforcings.py	(revision 24312)
+++ /issm/trunk/src/m/classes/plumebasalforcings.py	(revision 24313)
@@ -1,2 +1,3 @@
+import numpy as np
 from fielddisplay import fielddisplay
 from checkfield import checkfield
@@ -4,123 +5,125 @@
 from project3d import project3d
 
+
 class plumebasalforcings(object):
-	'''
-	PLUME BASAL FORCINGS class definition
+    '''
+    PLUME BASAL FORCINGS class definition
 
-		Usage:
-			plumebasalforcings=plumebasalforcings()
-	'''
+        Usage:
+            plumebasalforcings = plumebasalforcings()
+    '''
 
-	def __init__(self): # {{{
-		floatingice_melting_rate  = float('NaN')
-		groundedice_melting_rate  = float('NaN')
-		mantleconductivity        = float('NaN')
-		nusselt                   = float('NaN')
-		dtbg                      = float('NaN')
-		plumeradius               = float('NaN')
-		topplumedepth             = float('NaN')
-		bottomplumedepth          = float('NaN')
-		plumex                    = float('NaN')
-		plumey                    = float('NaN')
-		crustthickness            = float('NaN')
-		uppercrustthickness       = float('NaN')
-		uppercrustheat            = float('NaN')
-		lowercrustheat            = float('NaN')
+    def __init__(self):  # {{{
+        self.floatingice_melting_rate = float('NaN')
+        self.groundedice_melting_rate = float('NaN')
+        self.mantleconductivity = float('NaN')
+        self.nusselt = float('NaN')
+        self.dtbg = float('NaN')
+        self.plumeradius = float('NaN')
+        self.topplumedepth = float('NaN')
+        self.bottomplumedepth = float('NaN')
+        self.plumex = float('NaN')
+        self.plumey = float('NaN')
+        self.crustthickness = float('NaN')
+        self.uppercrustthickness = float('NaN')
+        self.uppercrustheat = float('NaN')
+        self.lowercrustheat = float('NaN')
 
-		self.setdefaultparameters()
-	#}}}
+        self.setdefaultparameters()
+    #}}}
 
-	def __repr__(self): # {{{
-		print '   mantle plume basal melt parameterization:'
+    def __repr__(self):  # {{{
+        string = '   mantle plume basal melt parameterization:'
 
-		string="%s\n%s"%(string,fielddisplay(self,'groundedice_melting_rate','basal melting rate (positive if melting) [m/yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'floatingice_melting_rate','basal melting rate (positive if melting) [m/yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'mantleconductivity','mantle heat conductivity [W/m^3]'))
-		string="%s\n%s"%(string,fielddisplay(self,'nusselt','nusselt number, ratio of mantle to plume [1]'))
-		string="%s\n%s"%(string,fielddisplay(self,'dtbg','background temperature gradient [degree/m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'plumeradius','radius of the mantle plume [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'topplumedepth','depth of the mantle plume top below the crust [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'bottomplumedepth','depth of the mantle plume base below the crust [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'plumex','x coordinate of the center of the plume [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'plumey','y coordinate of the center of the plume [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'crustthickness','thickness of the crust [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'uppercrustthickness','thickness of the upper crust [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'uppercrustheat','volumic heat of the upper crust [w/m^3]'))
-		string="%s\n%s"%(string,fielddisplay(self,'lowercrustheat','volumic heat of the lowercrust [w/m^3]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'groundedice_melting_rate', 'basal melting rate (positive if melting) [m / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'floatingice_melting_rate', 'basal melting rate (positive if melting) [m / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'mantleconductivity', 'mantle heat conductivity [W / m^3]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'nusselt', 'nusselt number, ratio of mantle to plume [1]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'dtbg', 'background temperature gradient [degree / m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'plumeradius', 'radius of the mantle plume [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'topplumedepth', 'depth of the mantle plume top below the crust [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'bottomplumedepth', 'depth of the mantle plume base below the crust [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'plumex', 'x coordinate of the center of the plume [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'plumey', 'y coordinate of the center of the plume [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'crustthickness', 'thickness of the crust [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'uppercrustthickness', 'thickness of the upper crust [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'uppercrustheat', 'volumic heat of the upper crust [w / m^3]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'lowercrustheat', 'volumic heat of the lowercrust [w / m^3]'))
 
-		return string
-	#}}}
+        return string
+    #}}}
 
-	def initialize(self,md): #{{{
-		if np.all(np.isnan(self.groundedice_melting_rate)):
-			self.groundedice_melting_rate=np.zeros((md.mesh.numberofvertices,))
-			print '      no basalforcings.groundedice_melting_rate specified: values set as zero'
-		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'
-		return
-	#}}}
+    def initialize(self, md):  #{{{
+        if np.all(np.isnan(self.groundedice_melting_rate)):
+            self.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
+            print('      no basalforcings.groundedice_melting_rate specified: values set as zero')
+        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')
+        return
+    #}}}
 
-	def 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);
-		return self
-	#}}}
+    def 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)
+        return self
+    #}}}
 
-	def setdefaultparameters(self): # {{{
-		#default values for melting parameterization
-		self.mantleconductivity     = 2.2
-		self.nusselt                = 300
-		self.dtbg                   = 11/1000.
-		self.plumeradius            = 100000
-		self.topplumedepth          = 10000
-		self.bottomplumedepth       = 1050000
-		self.crustthickness         = 30000
-		self.uppercrustthickness    = 14000
-		self.uppercrustheat         = 1.7*10**-6
-		self.lowercrustheat         = 0.4*10**-6
-		return self
-	#}}}
+    def setdefaultparameters(self):  # {{{
+        #default values for melting parameterization
+        self.mantleconductivity = 2.2
+        self.nusselt = 300
+        self.dtbg = 11 / 1000.
+        self.plumeradius = 100000
+        self.topplumedepth = 10000
+        self.bottomplumedepth = 1050000
+        self.crustthickness = 30000
+        self.uppercrustthickness = 14000
+        self.uppercrustheat = 1.7 * 10**-6
+        self.lowercrustheat = 0.4 * 10**-6
+        return self
+    #}}}
 
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		if 'MasstransportAnalysis' in analyses and not (solution == 'TransientSolution' and md.transient.ismasstransport==0):
-			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'timeseries',1)
-			md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'timeseries',1)
-		if 'BalancethicknessAnalysis' in analyses:
-			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'size',[md.mesh.numberofvertices])
-			md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'size',[md.mesh.numberofvertices])
-		if 'ThermalAnalysis' in analyses and not (solution == 'TransientSolution' and md.transient.isthermal==0):
-			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'timeseries',1)
-			md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'timeseries',1)
-			md = checkfield(md,'fieldname','basalforcings.mantleconductivity','>=',0,'numel',1)
-			md = checkfield(md,'fieldname','basalforcings.nusselt','>',0,'numel',1)
-			md = checkfield(md,'fieldname','basalforcings.dtbg','>',0,'numel',1)
-			md = checkfield(md,'fieldname','basalforcings.topplumedepth','>',0,'numel',1)
-			md = checkfield(md,'fieldname','basalforcings.bottomplumedepth','>',0,'numel',1)
-			md = checkfield(md,'fieldname','basalforcings.plumex','numel',1)
-			md = checkfield(md,'fieldname','basalforcings.plumey','numel',1)
-			md = checkfield(md,'fieldname','basalforcings.crustthickness','>',0,'numel',1)
-			md = checkfield(md,'fieldname','basalforcings.uppercrustthickness','>',0,'numel',1)
-			md = checkfield(md,'fieldname','basalforcings.uppercrustheat','>',0,'numel',1)
-			md = checkfield(md,'fieldname','basalforcings.lowercrustheat','>',0,'numel',1)
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		yts=md.constants.yts
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if 'MasstransportAnalysis' in analyses and not (solution == 'TransientSolution' and md.transient.ismasstransport == 0):
+            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'timeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.floatingice_melting_rate', 'NaN', 1, 'timeseries', 1)
+        if 'BalancethicknessAnalysis' in analyses:
+            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'size', [md.mesh.numberofvertices])
+            md = checkfield(md, 'fieldname', 'basalforcings.floatingice_melting_rate', 'NaN', 1, 'size', [md.mesh.numberofvertices])
+        if 'ThermalAnalysis' in analyses and not (solution == 'TransientSolution' and md.transient.isthermal == 0):
+            md = checkfield(md, 'fieldname', 'basalforcings.groundedice_melting_rate', 'NaN', 1, 'timeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.floatingice_melting_rate', 'NaN', 1, 'timeseries', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.mantleconductivity', '>=', 0, 'numel', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.nusselt', '>', 0, 'numel', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.dtbg', '>', 0, 'numel', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.topplumedepth', '>', 0, 'numel', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.bottomplumedepth', '>', 0, 'numel', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.plumex', 'numel', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.plumey', 'numel', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.crustthickness', '>', 0, 'numel', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.uppercrustthickness', '>', 0, 'numel', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.uppercrustheat', '>', 0, 'numel', 1)
+            md = checkfield(md, 'fieldname', 'basalforcings.lowercrustheat', '>', 0, 'numel', 1)
+        return md
+    # }}}
 
-		WriteData(fid,prefix,'name','md.basalforcings.model','data',4,'format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','floatingice_melting_rate','format','DoubleMat','name','md.basalforcings.floatingice_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','name','md.basalforcings.groundedice_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'fieldname','mantleconductivity','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','nusselt','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','dtbg','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','plumeradius','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','topplumedepth','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','bottomplumedepth','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','plumex','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','plumey','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','crustthickness','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','uppercrustthickness','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','uppercrustheat','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','lowercrustheat','format','Double')
-	# }}}
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
+
+        WriteData(fid, prefix, 'name', 'md.basalforcings.model', 'data', 4, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'floatingice_melting_rate', 'format', 'DoubleMat', 'name', 'md.basalforcings.floatingice_melting_rate', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'groundedice_melting_rate', 'format', 'DoubleMat', 'name', 'md.basalforcings.groundedice_melting_rate', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'mantleconductivity', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'nusselt', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'dtbg', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'plumeradius', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'topplumedepth', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'bottomplumedepth', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'plumex', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'plumey', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'crustthickness', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'uppercrustthickness', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'uppercrustheat', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'lowercrustheat', 'format', 'Double')
+    # }}}
Index: /issm/trunk/src/m/classes/private.py
===================================================================
--- /issm/trunk/src/m/classes/private.py	(revision 24312)
+++ /issm/trunk/src/m/classes/private.py	(revision 24313)
@@ -1,37 +1,40 @@
 from collections import OrderedDict
 from fielddisplay import fielddisplay
-from checkfield import checkfield
+
 
 class private(object):
-	"""
-	PRIVATE class definition
+    """
+    PRIVATE class definition
 
-	   Usage:
-	      private=private();
-	"""
+       Usage:
+          private = private()
+    """
 
-	def __init__(self): # {{{
-		self.isconsistent = True
-		self.runtimename  = ''
-		self.bamg         = OrderedDict()
-		self.solution     = ''
+    def __init__(self):  # {{{
+        self.isconsistent = True
+        self.runtimename = ''
+        self.bamg = OrderedDict()
+        self.solution = ''
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		string='   private parameters: do not change'
+    #}}}
 
-		string="%s\n%s"%(string,fielddisplay(self,'isconsistent','is model self consistent'))
-		string="%s\n%s"%(string,fielddisplay(self,'runtimename','name of the run launched'))
-		string="%s\n%s"%(string,fielddisplay(self,'bamg','structure with mesh properties constructed if bamg is used to mesh the domain'))
-		string="%s\n%s"%(string,fielddisplay(self,'solution','type of solution launched'))
-		return string
-		#}}}
-	def setdefaultparameters(self): # {{{
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		return md
-	# }}}
+    def __repr__(self):  # {{{
+        string = '   private parameters: do not change'
+
+        string = "%s\n%s" % (string, fielddisplay(self, 'isconsistent', 'is model self consistent'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'runtimename', 'name of the run launched'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'bamg', 'structure with mesh properties constructed if bamg is used to mesh the domain'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'solution', 'type of solution launched'))
+        return string
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        return md
+    # }}}
Index: /issm/trunk/src/m/classes/qmu.m
===================================================================
--- /issm/trunk/src/m/classes/qmu.m	(revision 24312)
+++ /issm/trunk/src/m/classes/qmu.m	(revision 24313)
@@ -12,5 +12,6 @@
 		params                      = struct();
 		results                     = struct();
-		partition                   = NaN;
+		vpartition                   = NaN;
+		epartition                   = NaN;
 		numberofpartitions          = 0;
 		numberofresponses           = 0;
@@ -25,5 +26,6 @@
 	methods
 		function self = extrude(self,md) % {{{
-			self.partition=project3d(md,'vector',self.partition','type','node');
+			self.vpartition=project3d(md,'vector',self.vpartition','type','node');
+			self.epartition=project3d(md,'vector',self.epartition','type','element');
 		end % }}}
 		function self = qmu(varargin) % {{{
@@ -61,17 +63,31 @@
 				end
 				if mod(md.cluster.np-1,self.params.processors_per_evaluation), 
-					md = checkmessage(md,['in parallel library mode, the requirement is for md.cluster.np = md.qmu.params.processors_per_evaluation * number_of_slaves, where number_of_slaves will automatically be determined by Dakota. Modify md.cluster.np accordingly']);
-				end
-			end
-			if ~isempty(md.qmu.partition),
-				if numel(md.qmu.partition)~=md.mesh.numberofvertices & numel(md.qmu.partition)~=md.mesh.numberofelements,
-					md = checkmessage(md,['user supplied partition for qmu analysis should have size md.mesh.numberofvertices x 1 or md.mesh.numberofelements x 1']);
-				end
-				if min(md.qmu.partition)~=0,
-					md = checkmessage(md,['partition vector not indexed from 0 on']);
-				end
-				if max(md.qmu.partition)>=md.qmu.numberofpartitions,
-					md = checkmessage(md,['for qmu analysis, partitioning vector cannot go over npart, number of partition areas']);
-				end
+					%md = checkmessage(md,['in parallel library mode, the requirement is for md.cluster.np = md.qmu.params.processors_per_evaluation * number_of_slaves, where number_of_slaves will automatically be determined by Dakota. Modify md.cluster.np accordingly']);
+				end
+			end
+			if ~isempty(md.qmu.vpartition) & ~any(isnan(md.qmu.vpartition)),
+				if size(md.qmu.vpartition,1)~=md.mesh.numberofvertices  
+					md = checkmessage(md,['user supplied vertex partition for qmu analysis should have size md.mesh.numberofvertices x 1']);
+				end
+				if min(md.qmu.vpartition)~=0,
+					md = checkmessage(md,['vertex partition vector not indexed from 0 on']);
+				end
+				if max(md.qmu.vpartition)>=md.qmu.numberofpartitions,
+					md = checkmessage(md,['for qmu analysis, vertex partitioning vector cannot go over npart, number of partition areas']);
+				end
+			end
+			if ~isempty(md.qmu.epartition) & ~any(isnan(md.qmu.epartition)),
+				if size(md.qmu.epartition,1)~=md.mesh.numberofelements, 
+					md = checkmessage(md,['user supplied element partition for qmu analysis should have size md.mesh.numberofelements x 1']);
+				end
+				if min(md.qmu.epartition)~=0,
+					md = checkmessage(md,['element partition vector not indexed from 0 on']);
+				end
+				if max(md.qmu.epartition)>=md.qmu.numberofpartitions,
+					md = checkmessage(md,['for qmu analysis, element partitioning vector cannot go over npart, number of partition areas']);
+				end
+			end
+			if isempty(md.qmu.vpartition) | any(isnan(md.qmu.vpartition)) | isempty(md.qmu.epartition) | any(isnan(md.qmu.epartition)),
+				md = checkmessage(md,['for qmu analysis, both an element and partitioning vectors need to be supplied with no nan values! One can be defaulted to all zeros.']);
 			end
 
@@ -144,5 +160,6 @@
 				end
 			end
-			fielddisplay(self,'partition','user provided mesh partitioning, defaults to metis if not specified') 
+			fielddisplay(self,'vpartition','user provided mesh partitioning (vertex based)');
+			fielddisplay(self,'epartition','user provided mesh partitioning (element based)');
 			fielddisplay(self,'numberofpartitions','number of partitions for semi-discrete qmu') 
 			fielddisplay(self,'variabledescriptors','');
@@ -162,5 +179,6 @@
 				return; 
 			end
-			WriteData(fid,prefix,'object',self,'fieldname','partition','format','DoubleMat','mattype',2);
+			WriteData(fid,prefix,'object',self,'fieldname','vpartition','format','DoubleMat','mattype',2);
+			WriteData(fid,prefix,'object',self,'fieldname','epartition','format','DoubleMat','mattype',2);
 			WriteData(fid,prefix,'object',self,'fieldname','numberofpartitions','format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','numberofresponses','format','Integer');
Index: /issm/trunk/src/m/classes/qmu.py
===================================================================
--- /issm/trunk/src/m/classes/qmu.py	(revision 24312)
+++ /issm/trunk/src/m/classes/qmu.py	(revision 24313)
@@ -8,160 +8,192 @@
 from WriteData import WriteData
 from helpers import *
+from dakota_method import *
+
 
 class qmu(object):
-	"""
-	QMU class definition
+    """
+    QMU class definition
 
-	   Usage:
-	      qmu=qmu();
-	"""
+       Usage:
+          qmu = qmu()
+    """
 
-	def __init__(self): # {{{
-		self.isdakota                    = 0
-		self.variables                   = OrderedStruct()
-		self.responses                   = OrderedStruct()
-		self.method                      = OrderedDict()
-		self.params                      = OrderedDict()
-		self.results                     = OrderedDict()
-		self.partition                   = float('NaN')
-		self.numberofpartitions          = 0
-		self.numberofresponses           = 0
-		self.variabledescriptors         = []
-		self.responsedescriptors         = []
-		self.mass_flux_profile_directory = float('NaN')
-		self.mass_flux_profiles          = float('NaN')
-		self.mass_flux_segments          = []
-		self.adjacency                   = float('NaN')
-		self.vertex_weight               = float('NaN')
+    def __init__(self):  # {{{
+        self.isdakota = 0
+        self.variables = OrderedStruct()
+        self.responses = OrderedStruct()
+        self.method = OrderedDict()
+        self.params = OrderedStruct()
+        self.results = OrderedDict()
+        self.vpartition = float('NaN')
+        self.epartition = float('NaN')
+        self.numberofpartitions = 0
+        self.numberofresponses = 0
+        self.variabledescriptors = []
+        self.responsedescriptors = []
+        self.mass_flux_profile_directory = float('NaN')
+        self.mass_flux_profiles = float('NaN')
+        self.mass_flux_segments = []
+        self.adjacency = float('NaN')
+        self.vertex_weight = float('NaN')
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self):    # {{{
-		s ='   qmu parameters:\n'
+    #}}}
+    def __repr__(self):  # {{{
+        s = '   qmu parameters:\n'
 
-		s+="%s\n" % fielddisplay(self,'isdakota','is qmu analysis activated?')
-		for variable in self.variables:
-			s+="         variables%s:  (arrays of each variable class)\n" % len(variable)
-			fnames=vars(variable)
-			maxlen=0
-			for fname in fnames:
-				maxlen=max(maxlen,len(fname))
+        s += "%s\n" % fielddisplay(self, 'isdakota', 'is qmu analysis activated?')
+        maxlen = 0
+        s += "         variables:  (arrays of each variable class)\n"
 
-			for fname in fnames:
-				s+="'            %-*s:    [%ix%i]    '%s'\n" % \
-						(maxlen+1,fname,size(getattr(variable,fname)),type(getattr(variable,fname)))
+    # OrderedStruct's iterator returns individual name / array - of - functions pairs
+        for variable in self.variables:
+            fname = variable[0]
+            maxlen = max(maxlen, len(fname))
+            size = np.shape(variable[1])
+            a = size[0]
+            b = 1 if len(size) < 2 else size[1]
+            s += "            %-*s:    [%ix%i]    '%s'\n" % (maxlen + 1, fname, a, b, type(variable[1][0]))
 
-		for response in self.responses:
-			s+="         responses%s:  (arrays of each response class)\n" % len(responses)
-			fnames=vars(response)
-			maxlen=0
-			for fname in fnames:
-				maxlen=max(maxlen,len(fname))
+        s += "         responses:  (arrays of each response class)\n"
+        for response in self.responses:
+            fname = response[0]
+            maxlen = max(maxlen, len(fname))
+            size = np.shape(response[1])
+            a = size[0]
+            b = 1 if len(size) < 2 else size[1]
+            s += "            %-*s:    [%ix%i]    '%s'\n" % (maxlen + 1, fname, a, b, type(response[1][0]))
 
-			for fname in fnames:
-				s+="            %-*s:    [%ix%i]    '%s'\n" % \
-						(maxlen+1,fname,size(getattr(response,fname)),type(getattr(response,fname)))
+        s += "%s\n" % fielddisplay(self, 'numberofresponses', 'number of responses')
 
-		s+="%s\n" % fielddisplay(self,'numberofresponses','number of responses') 
+        if type(self.method) != OrderedDict:
+            self.method = [self.method]
+    # self.method must be iterable
+        for method in self.method:
+            if isinstance(method, dakota_method):
+                s += "            method :    '%s'\n" % (method.method)
 
-		for method in self.method:
-			if isinstance(method,'dakota_method'):
-				s+="            method%s :    '%s'\n" % \
-						(len(method),method.method)
+    # params could be have a number of forms (mainly 1 struct or many)
+        if type(self.params) == OrderedStruct:
+            params = [self.params]
+        else:
+            params = np.hstack(np.atleast_1d(np.array(self.params)))
+        for param in params:
+            print(type(param))
+            print(param)
+            s += "         params:  (array of method - independent parameters)\n"
+            fnames = vars(param)
+            maxlen = 0
+            for fname in fnames:
+                maxlen = max(maxlen, len(fname))
 
-		for param in self.params:
-			s+="         params%s:  (array of method-independent parameters)\n" % len(param)
-			fnames=vars(param)
-			maxlen=0
-			for fname in fnames:
-				maxlen=max(maxlen,len(fname))
+            for fname in fnames:
+                s += "            %-*s: %s\n" % (maxlen + 1, fname, str(getattr(param, fname)))
 
-			for fname in fnames:
-				s+="            %-*s: %s\n" % \
-						(maxlen+1,fname,any2str(getattr(param,fname)))
+    # results could be have a number of forms (mainly 1 struct or many)
+        results = np.hstack(np.atleast_1d(np.array(self.results)))
+        for result in results:
+            s += "         results:  (information from dakota files)\n"
+            fnames = vars(result)
+            maxlen = 0
+            for fname in fnames:
+                maxlen = max(maxlen, len(fname))
 
-		for result in self.results:
-			s+="         results%s:  (information from dakota files)\n" % len(self.result)
-			fnames=vars(result)
-			maxlen=0
-			for fname in fnames:
-				maxlen=max(maxlen,len(fname))
+            for fname in fnames:
+                size = np.shape(response[1])
+                a = size[0]
+                b = 0 if len(size) < 2 else size[1]
+                size = np.shape(getattr(result, fname))
+                s += "            %-*s:    [%ix%i]    '%s'\n" % (maxlen + 1, fname, a, b, type(getattr(result, fname)))
 
-			for fname in fnames:
-				s+="            %-*s:    [%ix%i]    '%s'\n" % \
-						(maxlen+1,fname,size(getattr(result,fname)),type(getattr(result,fname)))
+        s += "%s\n" % fielddisplay(self, 'vpartition', 'user provided mesh partitioning (vertex based)')
+        s += "%s\n" % fielddisplay(self, 'epartition', 'user provided mesh partitioning (element based)')
+        s += "%s\n" % fielddisplay(self, 'numberofpartitions', 'number of partitions for semi - discrete qmu')
+        s += "%s\n" % fielddisplay(self, 'variabledescriptors', '')
+        s += "%s\n" % fielddisplay(self, 'responsedescriptors', '')
+        s += "%s\n" % fielddisplay(self, 'method', 'array of dakota_method class')
+        s += "%s\n" % fielddisplay(self, 'mass_flux_profile_directory', 'directory for mass flux profiles')
+        s += "%s\n" % fielddisplay(self, 'mass_flux_profiles', 'list of mass_flux profiles')
+        s += "%s\n" % fielddisplay(self, 'mass_flux_segments', '')
+        s += "%s\n" % fielddisplay(self, 'adjacency', '')
+        s += "%s\n" % fielddisplay(self, 'vertex_weight', 'weight applied to each mesh vertex')
 
-		s+="%s\n" % fielddisplay(self,'partition','user provided mesh partitioning, defaults to metis if not specified') 
-		s+="%s\n" % fielddisplay(self,'numberofpartitions','number of partitions for semi-discrete qmu') 
-		s+="%s\n" % fielddisplay(self,'variabledescriptors','')
-		s+="%s\n" % fielddisplay(self,'responsedescriptors','')
-		s+="%s\n" % fielddisplay(self,'method','array of dakota_method class')
-		s+="%s\n" % fielddisplay(self,'mass_flux_profile_directory','directory for mass flux profiles')
-		s+="%s\n" % fielddisplay(self,'mass_flux_profiles','list of mass_flux profiles')
-		s+="%s\n" % fielddisplay(self,'mass_flux_segments','')
-		s+="%s\n" % fielddisplay(self,'adjacency','')
-		s+="%s\n" % fielddisplay(self,'vertex_weight','weight applied to each mesh vertex')
+        return s
+    # }}}
 
-		return s
-	# }}}
-	def extrude(self,md): # {{{
-		self.partition=project3d(md,'vector',np.transpose(self.partition),'type','node')
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+    def extrude(self, md):  # {{{
+        self.vpartition = project3d(md, 'vector', np.transpose(self.vpartition), 'type', 'node')
+        self.epartition = project3d(md, 'vector', np.transpose(self.epartition), 'type', 'element')
+        return self
+    #}}}
 
-		#Early return
-		if not md.qmu.isdakota:
-			return
+    def setdefaultparameters(self):  # {{{
+        return self
+    #}}}
 
-		version=IssmConfig('_DAKOTA_VERSION_')
-		version=float(version[0])
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if not md.qmu.isdakota:
+            return
 
-		if version < 6:
-			if not md.qmu.params.evaluation_concurrency==1:
-				md.checkmessage("concurrency should be set to 1 when running dakota in library mode")
-		else:
-			if not strcmpi(self.params.evaluation_scheduling,'master'):
-				md.checkmessage('evaluation_scheduling in qmu.params should be set to "master"')
+        version = IssmConfig('_DAKOTA_VERSION_')
+        version = float(version[0])
 
-			if md.cluster.np <= 1:
-				md.checkmessage('in parallel library mode, Dakota needs to run on at least 2 cpus, 1 cpu for the master, 1 cpu for the slave. Modify md.cluser.np accordingly.')
-					
-			if self.params.processors_per_evaluation < 1:
-				md.checkmessage('in parallel library mode, Dakota needs to run at least one slave on one cpu (md.qmu.params.processors_per_evaluation >=1)!')
-				
-			if np.mod(md.cluster.np-1,self.params.processors_per_evaluation):
-				md.checkmessage('in parallel library mode, the requirement is for md.cluster.np = md.qmu.params.processors_per_evaluation * number_of_slaves, where number_of_slaves will automatically be determined by Dakota. Modify md.cluster.np accordingly')
-		
-		if np.size(md.qmu.partition) > 0:
-			if np.size(md.qmu.partition)!=md.mesh.numberofvertices and np.size(md.qmu.partition) != md.mesh.numberofelements:
-				md.checkmessage("user supplied partition for qmu analysis should have size (md.mesh.numberofvertices x 1) or (md.mesh.numberofelements x 1)")
-			if not min(md.qmu.partition.flatten())==0:
-				md.checkmessage("partition vector not indexed from 0 on")
-			if max(md.qmu.partition.flatten())>=md.qmu.numberofpartitions:
-				md.checkmessage("for qmu analysis, partitioning vector cannot go over npart, number of partition areas")
+        if version < 6:
+            if not md.qmu.params.evaluation_concurrency == 1:
+                md.checkmessage("concurrency should be set to 1 when running dakota in library mode")
+        else:
+            if not strcmpi(self.params.evaluation_scheduling, 'master'):
+                md.checkmessage('evaluation_scheduling in qmu.params should be set to "master"')
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'object',self,'fieldname','isdakota','format','Boolean')
-		if not self.isdakota:
-			WriteData(fid,prefix,'data',False,'name','md.qmu.mass_flux_segments_present','format','Boolean');
-			return
-		WriteData(fid,prefix,'object',self,'fieldname','partition','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'fieldname','numberofpartitions','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','numberofresponses','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','variabledescriptors','format','StringArray')
-		WriteData(fid,prefix,'object',self,'fieldname','responsedescriptors','format','StringArray')
-		if not isempty(self.mass_flux_segments):
-			WriteData(fid,prefix,'data',self.mass_flux_segments,'name','md.qmu.mass_flux_segments','format','MatArray');
-			flag=True; 
-		else:
-			flag=False; 
-		WriteData(fid,prefix,'data',flag,'name','md.qmu.mass_flux_segments_present','format','Boolean');
-	# }}}
+            if md.cluster.np <= 1:
+                md.checkmessage('in parallel library mode, Dakota needs to run on at least 2 cpus, 1 cpu for the master, 1 cpu for the slave. Modify md.cluser.np accordingly.')
+
+            if self.params.processors_per_evaluation < 1:
+                md.checkmessage('in parallel library mode, Dakota needs to run at least one slave on one cpu (md.qmu.params.processors_per_evaluation >= 1)!')
+
+            if np.mod(md.cluster.np - 1, self.params.processors_per_evaluation):
+                md.checkmessage('in parallel library mode, the requirement is for md.cluster.np = md.qmu.params.processors_per_evaluation * number_of_slaves, where number_of_slaves will automatically be determined by Dakota. Modify md.cluster.np accordingly')
+
+        if np.size(md.qmu.vpartition) > 0:
+            if np.size(md.qmu.vpartition, 0) != md.mesh.numberofvertices:
+                md.checkmessage("user supplied vertex partition for qmu analysis should have size (md.mesh.numberofvertices x 1)")
+            if not min(md.qmu.vpartition.flatten()) == 0:
+                md.checkmessage("vertex partition vector not indexed from 0 on")
+            if max(md.qmu.vpartition.flatten()) >= md.qmu.numberofpartitions:
+                md.checkmessage("for qmu analysis, vertex partitioning vector cannot go over npart, number of partition areas")
+
+                if np.size(md.qmu.epartition) > 0:
+                    if np.size(md.qmu.epartition, 0) != md.mesh.numberofelements:
+                        md.checkmessage("user supplied element partition for qmu analysis should have size (md.mesh.numberofelements x 1)")
+                    if not min(md.qmu.epartition.flatten()) == 0:
+                        md.checkmessage("elememtn partition vector not indexed from 0 on")
+                    if max(md.qmu.epartition.flatten()) >= md.qmu.numberofpartitions:
+                        md.checkmessage("for qmu analysis, element partitioning vector cannot go over npart, number of partition areas")
+
+                if np.size(md.qmu.vpartition) == 0 or np.any(np.isnan(md.qmu.vpartition)) or np.size(md.qmu.epartition) == 0 or np.any(np.isnan(md.qmu.epartition)):
+                    md.checkmessage("for qmu analysis, both an element and partitioning vectors need to be supplied with no nan values! One can be defaulted to all zeros.")
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isdakota', 'format', 'Boolean')
+        if not self.isdakota:
+            WriteData(fid, prefix, 'data', False, 'name', 'md.qmu.mass_flux_segments_present', 'format', 'Boolean')
+            return
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'vpartition', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'epartition', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'numberofpartitions', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'numberofresponses', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'variabledescriptors', 'format', 'StringArray')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'responsedescriptors', 'format', 'StringArray')
+        if not isempty(self.mass_flux_segments):
+            WriteData(fid, prefix, 'data', self.mass_flux_segments, 'name', 'md.qmu.mass_flux_segments', 'format', 'MatArray')
+            flag = True
+        else:
+            flag = False
+        WriteData(fid, prefix, 'data', flag, 'name', 'md.qmu.mass_flux_segments_present', 'format', 'Boolean')
+    # }}}
Index: /issm/trunk/src/m/classes/qmu/@dakota_method/dakota_method.py
===================================================================
--- /issm/trunk/src/m/classes/qmu/@dakota_method/dakota_method.py	(revision 24312)
+++ /issm/trunk/src/m/classes/qmu/@dakota_method/dakota_method.py	(revision 24313)
@@ -5,9 +5,10 @@
 import numpy as np
 
+
 class dakota_method(object):
-	'''
+    '''
   definition for the dakota_method class.
 
-  [dm]=dakota_method(method)
+  [dm] = dakota_method(method)
 
   where the required input is:
@@ -21,5 +22,5 @@
     responses    (cell array, applicable response types, [])
     ghspec       (cell array, gradient and hessian specs, [])
-    params       (structure, method-depent parameters, [])
+    params       (structure, method - depent parameters, [])
 
   this class is used to guide the writing of a dakota input
@@ -43,852 +44,863 @@
   authority as may be required before exporting such np.information
   to foreign countries or providing access to foreign persons."
-	'''
-
-	def __init__(self,*args):
-		self.method   =''
-		self.type     =''
-		self.variables=[]
-		self.lcspec   =[]
-		self.responses=[]
-		self.ghspec   =[]
-		#properites
-		self.params   =struct()
-	
-	@staticmethod
-	def dakota_method(*args):
-
-		dm = dakota_method()
-
-		#  return a default object
-		if len(args) == 0:
-			return dm
-
-		#  copy the object or create the object from the input
-		elif len(args) == 1:
-			method = args[0]
-
-			#given argument was a method, copy it
-			if isinstance(method,dakota_method):
-				#dm=method
-				object=method
-				for field in object.iterkeys():
-					if field in vars(dm):
-						setattr(dm,field,object[field])
-				return dm
-
-			#given argument was a way of constructing a method
-			else:
-				mlist=[
-		                    'dot_bfgs',
-		                    'dot_frcg',
-		                    'dot_mmfd',
-		                    'dot_slp',
-		                    'dot_sqp',
-		                    'npsol_sqp',
-		                    'conmin_frcg',
-		                    'conmin_mfd',
-		                    'optpp_cg',
-		                    'optpp_q_newton',
-		                    'optpp_fd_newton',
-		                    'optpp_newton',
-		                    'optpp_pds',
-		                    'asynch_pattern_search',
-		                    'coliny_cobyla',
-		                    'coliny_direct',
-		                    'coliny_ea',
-		                    'coliny_pattern_search',
-		                    'coliny_solis_wets',
-		                    'ncsu_direct',
-		                    'surrogate_based_local',
-		                    'surrogate_based_global',
-		                    'moga',
-		                    'soga',
-		                    'nl2sol',
-		                    'nlssol_sqp',
-		                    'optpp_g_newton',
-		                    'nond_sampling',
-		                    'nond_local_reliability',
-		                    'nond_global_reliability',
-		                    'nond_polynomial_chaos',
-		                    'nond_stoch_collocation',
-		                    'nond_evidence',
-		                    'dace',
-		                    'fsu_quasi_mc',
-		                    'fsu_cvt',
-		                    'vector_parameter_study',
-		                    'list_parameter_study',
-		                    'centered_parameter_study',
-		                    'multidim_parameter_study',
-				    'bayes_calibration']
-
-		                mlist2=[]
-				for i in range(len(mlist)):
-		                	if strncmpi(method,mlist[i],len(method)):
-		                        	mlist2.append(mlist[i])
-
-				#  check for a unique match in the list of methods
-
-		                l = len(mlist2)
-		                if l == 0:
-		                        raise RuntimeError('Unrecognized method: '+str(method)+'.')
-		                elif l == 1:
-		                        dm.method=mlist2[0]
-		                else:
-		                        raise RuntimeError('Non-unique method: '+str(method)+' matches '+string_cell(mlist2))
-		                
-				#  assign the default values for the method
-		                #switch dm.method
-		                if dm.method in ['dot_bfgs',
-		                         	   'dot_frcg']:
-		                        dm.type     ='dot'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.constraint_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-		                        dm.params.optimization_type='minimize'
-		                elif dm.method in ['dot_mmfd',
-		                          	     'dot_slp',
-		                          	     'dot_sqp']:
-		                        dm.type     ='dot'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.constraint_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-		                        dm.params.optimization_type='minimize'
-
-				elif dm.method == 'npsol_sqp':
-					dm.type     ='npsol'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.constraint_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-		                        dm.params.verify_level=-1
-		                        dm.params.function_precision=1.0e-10
-		                        dm.params.linesearch_tolerance=0.9
-
-				elif dm.method == 'conmin_frcg':
-		                        dm.type     ='conmin'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.constraint_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-				elif dm.method == 'conmin_mfd':
-		                        dm.type     ='conmin'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.constraint_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-
-				elif dm.method == 'optpp_cg':
-		                        dm.type     ='optpp'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-		                        dm.params.max_step=1000.
-		                        dm.params.gradient_tolerance=1.0e-4
-				elif dm.method in ['optpp_q_newton',
-		                          	    'optpp_fd_newton',
-		                         	    'optpp_newton']:
-		                        dm.type     ='optpp'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-		                        dm.params.value_based_line_search=False
-		                        dm.params.gradient_based_line_search=False
-		                        dm.params.trust_region=False
-		                        dm.params.tr_pds=False
-		                        dm.params.max_step=1000.
-		                        dm.params.gradient_tolerance=1.0e-4
-		                        dm.params.merit_function='argaez_tapia'
-		                        dm.params.central_path=dm.params.merit_function
-		                        dm.params.steplength_to_boundary=0.99995
-		                        dm.params.centering_parameter=0.2
-				elif dm.method == 'optpp_pds':
-		                        dm.type     ='optpp'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-		                        dm.params.search_scheme_size=32
-
-				elif dm.method == 'asynch_pattern_search':
-		                        dm.type     ='apps'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.constraint_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.initial_delta=1.0
-		                        dm.params.threshold_delta=0.01
-		                        dm.params.contraction_factor=0.5
-		                        dm.params.solution_target=False
-		                        dm.params.synchronization='nonblocking'
-		                        dm.params.merit_function='merit2_smooth'
-		                        dm.params.constraint_penalty=1.0
-		                        dm.params.smoothing_factor=1.0
-
-				elif dm.method == 'coliny_cobyla':
-		                        dm.type     ='coliny'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.show_misc_options=False
-		                        dm.params.misc_options=[]
-		                        dm.params.solution_accuracy=-np.inf
-		                        dm.params.initial_delta=[]
-		                        dm.params.threshold_delta=[]
-				elif dm.method == 'coliny_direct':
-		                        dm.type     ='coliny'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.show_misc_options=False
-		                        dm.params.misc_options=[]
-		                        dm.params.solution_accuracy=-np.inf
-		                        dm.params.division='major_dimension'
-		                        dm.params.global_balance_parameter=0.0
-		                        dm.params.local_balance_parameter=1.0e-8
-		                        dm.params.max_boxsize_limit=0.0
-		                        dm.params.min_boxsize_limit=0.0001
-		                        dm.params.constraint_penalty=1000.0
-				elif dm.method == 'coliny_ea':
-		                        dm.type     ='coliny'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.show_misc_options=False
-		                        dm.params.misc_options=[]
-		                        dm.params.solution_accuracy=-np.inf
-		                        dm.params.seed=False
-		                        dm.params.population_size=50
-		                        dm.params.initialization_type='unique_random'
-		                        dm.params.fitness_type='linear_rank'
-		                        dm.params.replacement_type='elitist'
-		                        dm.params.random=[]
-		                        dm.params.chc=[]
-		                        dm.params.elitist=[]
-		                        dm.params.new_solutions_generated='population_size - replacement_size'
-		                        dm.params.crossover_type='two_point'
-		                        dm.params.crossover_rate=0.8
-		                        dm.params.mutation_type='offset_normal'
-		                        dm.params.mutation_scale=0.1
-		                        dm.params.mutation_range=1
-		                        dm.params.dimension_ratio=1.0
-		                        dm.params.mutation_rate=1.0
-		                        dm.params.non_adaptive=False
-				elif dm.method == 'coliny_pattern_search':
-		                        dm.type     ='coliny'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.show_misc_options=False
-		                        dm.params.misc_options=[]
-		                        dm.params.solution_accuracy=-np.inf
-		                        dm.params.stochastic=False
-		                        dm.params.seed=False
-		                        dm.params.initial_delta=[]
-		                        dm.params.threshold_delta=[]
-		                        dm.params.constraint_penalty=1.0
-		                        dm.params.constant_penalty=False
-		                        dm.params.pattern_basis='coordinate'
-		                        dm.params.total_pattern_size=False
-		                        dm.params.no_expansion=False
-		                        dm.params.expand_after_success=1
-		                        dm.params.contraction_factor=0.5
-		                        dm.params.synchronization='nonblocking'
-		                        dm.params.exploratory_moves='basic_pattern'
-				elif dm.method == 'coliny_solis_wets':
-		                        dm.type     ='coliny'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.show_misc_options=False
-		                        dm.params.misc_options=[]
-		                        dm.params.solution_accuracy=-np.inf
-		                        dm.params.seed=False
-		                        dm.params.initial_delta=[]
-		                        dm.params.threshold_delta=[]
-		                        dm.params.no_expansion=False
-		                        dm.params.expand_after_success=5
-		                        dm.params.contract_after_failure=3
-		                        dm.params.contraction_factor=0.5
-		                        dm.params.constraint_penalty=1.0
-		                        dm.params.constant_penalty=False
-
-				elif dm.method == 'ncsu_direct':
-		                        dm.type     ='ncsu'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']  #  ?
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']  #  ?
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.scaling=False
-		                        dm.params.solution_accuracy=0.
-		                        dm.params.min_boxsize_limit=1.0e-8
-		                        dm.params.vol_boxsize_limit=1.0e-8
-
-	#                               if dm.method in ['surrogate_based_local',
-	#                                   		   'surrogate_based_global']:
-
-				elif dm.method == 'moga':
-		                        dm.type     ='jega'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.seed=False
-		                        dm.params.log_file='JEGAGlobal.log'
-		                        dm.params.population_size=50
-		                        dm.params.print_each_pop=False
-	#                               according to documentation, uses method-indepent control
-	#                               dm.params.output='normal'
-		                        dm.params.initialization_type='unique_random'
-		                        dm.params.mutation_type='replace_uniform'
-		                        dm.params.mutation_scale=0.15
-		                        dm.params.mutation_rate=0.08
-		                        dm.params.replacement_type=''
-		                        dm.params.below_limit=6
-		                        dm.params.shrinkage_percentage=0.9
-		                        dm.params.crossover_type='shuffle_random'
-		                        dm.params.multi_point_binary=[]
-		                        dm.params.multi_point_parameterized_binary=[]
-		                        dm.params.multi_point_real=[]
-		                        dm.params.shuffle_random=[]
-		                        dm.params.num_parents=2
-		                        dm.params.num_offspring=2
-		                        dm.params.crossover_rate=0.8
-		                        dm.params.fitness_type=''
-		                        dm.params.niching_type=False
-		                        dm.params.radial=[0.01]
-		                        dm.params.distance=[0.01]
-		                        dm.params.metric_tracker=False
-		                        dm.params.percent_change=0.1
-		                        dm.params.num_generations=10
-		                        dm.params.postprocessor_type=False
-		                        dm.params.orthogonal_distance=[0.01]
-				elif dm.method == 'soga':
-		                        dm.type     ='jega'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['objective_function',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.seed=False
-		                        dm.params.log_file='JEGAGlobal.log'
-		                        dm.params.population_size=50
-		                        dm.params.print_each_pop=False
-		                        dm.params.output='normal'
-		                        dm.params.initialization_type='unique_random'
-		                        dm.params.mutation_type='replace_uniform'
-		                        dm.params.mutation_scale=0.15
-		                        dm.params.mutation_rate=0.08
-		                        dm.params.replacement_type=''
-		                        dm.params.below_limit=6
-		                        dm.params.shrinkage_percentage=0.9
-		                        dm.params.crossover_type='shuffle_random'
-		                        dm.params.multi_point_binary=[]
-		                        dm.params.multi_point_parameterized_binary=[]
-		                        dm.params.multi_point_real=[]
-		                        dm.params.shuffle_random=[]
-		                        dm.params.num_parents=2
-		                        dm.params.num_offspring=2
-		                        dm.params.crossover_rate=0.8
-		                        dm.params.fitness_type='merit_function'
-		                        dm.params.constraint_penalty=1.0
-		                        dm.params.replacement_type=''
-		                        dm.params.convergence_type=False
-		                        dm.params.num_generations=10
-		                        dm.params.percent_change=0.1
-
-				elif dm.method == 'nl2sol':
-		                        dm.type     ='lsq'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['least_squares_term']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.scaling=False
-		                        dm.params.function_precision=1.0e-10
-		                        dm.params.absolute_conv_tol=-1.
-		                        dm.params.x_conv_tol=-1.
-		                        dm.params.singular_conv_tol=-1.
-		                        dm.params.singular_radius=-1.
-		                        dm.params.False_conv_tol=-1.
-		                        dm.params.initial_trust_radius=-1.
-		                        dm.params.covariance=0
-		                        dm.params.regression_stressbalances=False
-				elif dm.method == 'nlssol_sqp':
-		                        dm.type     ='lsq'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['least_squares_term',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.constraint_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-		                        dm.params.verify_level=-1
-		                        dm.params.function_precision=1.0e-10
-		                        dm.params.linesearch_tolerance=0.9
-				elif dm.method == 'optpp_g_newton':
-		                        dm.type     ='lsq'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =['linear_inequality_constraint',
-		                                        'linear_equality_constraint']
-		                        dm.responses=['least_squares_term',
-		                                        'nonlinear_inequality_constraint',
-		                                        'nonlinear_equality_constraint']
-		                        dm.ghspec   =['grad']
-		                        dm.params.max_iterations=False
-		                        dm.params.max_function_evaluations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.output=False
-		                        dm.params.speculative=False
-		                        dm.params.scaling=False
-		                        dm.params.value_based_line_search=False
-		                        dm.params.gradient_based_line_search=False
-		                        dm.params.trust_region=False
-		                        dm.params.tr_pds=False
-		                        dm.params.max_step=1000.
-		                        dm.params.gradient_tolerance=1.0e-4
-		                        dm.params.merit_function='argaez_tapia'
-		                        dm.params.central_path=dm.params.merit_function
-		                        dm.params.steplength_to_boundary=0.99995
-		                        dm.params.centering_parameter=0.2
-
-				elif dm.method == 'nond_sampling':
-		                        dm.type     ='nond'
-		                        dm.variables=['normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['response_function']
-		                        dm.ghspec   =[]
-	#                               not documented, but apparently works
-		                        dm.params.output=False
-		                        dm.params.seed=False
-		                        dm.params.fixed_seed=False
-		                        dm.params.rng=False
-		                        dm.params.samples=False
-		                        dm.params.sample_type='lhs'
-		                        dm.params.all_variables=False
-		                        dm.params.variance_based_decomp=False
-		                        dm.params.previous_samples=0
-				elif dm.method == 'nond_local_reliability':
-		                        dm.type     ='nond'
-		                        dm.variables=['normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['response_function']
-		                        dm.ghspec   =['grad']
-	#                               not documented, but may work
-		                        dm.params.output=False
-		                        dm.params.max_iterations=False
-		                        dm.params.convergence_tolerance=False
-		                        dm.params.mpp_search=False
-		                        dm.params.sqp=False
-		                        dm.params.nip=False
-		                        dm.params.integration='first_order'
-		                        dm.params.refinement=False
-		                        dm.params.samples=0
-		                        dm.params.seed=False
-				elif dm.method == 'nond_global_reliability':
-		                        dm.type     ='nond'
-		                        dm.variables=['normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['response_function']
-		                        dm.ghspec   =['grad']
-	#                               not documented, but may work
-		                        dm.params.output=False
-		                        dm.params.x_gaussian_process=False
-		                        dm.params.u_gaussian_process=False
-		                        dm.params.all_variables=False
-		                        dm.params.seed=False
-				elif dm.method == 'nond_polynomial_chaos':
-		                        dm.type     ='nond'
-		                        dm.variables=['normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['response_function']
-		                        dm.ghspec   =['grad']
-	#                               not documented, but may work
-		                        dm.params.output=False
-		                        dm.params.expansion_order=[]
-		                        dm.params.expansion_terms=[]
-		                        dm.params.quadrature_order=[]
-		                        dm.params.sparse_grid_level=[]
-		                        dm.params.expansion_samples=[]
-		                        dm.params.incremental_lhs=False
-		                        dm.params.collocation_points=[]
-		                        dm.params.collocation_ratio=[]
-		                        dm.params.reuse_samples=False
-		                        dm.params.expansion_import_file=''
-		                        dm.params.seed=False
-		                        dm.params.fixed_seed=False
-		                        dm.params.samples=0
-		                        dm.params.sample_type='lhs'
-		                        dm.params.all_variables=False
-				elif dm.method == 'nond_stoch_collocation':
-		                        dm.type     ='nond'
-		                        dm.variables=['normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['response_function']
-		                        dm.ghspec   =['grad']
-	#                               not documented, but may work
-		                        dm.params.output=False
-		                        dm.params.quadrature_order=[]
-		                        dm.params.sparse_grid_level=[]
-		                        dm.params.seed=False
-		                        dm.params.fixed_seed=False
-		                        dm.params.samples=0
-		                        dm.params.sample_type='lhs'
-		                        dm.params.all_variables=False
-				elif dm.method == 'nond_evidence':
-		                        dm.type     ='nond'
-		                        dm.variables=['normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['response_function']
-		                        dm.ghspec   =['grad']
-	#                               not documented, but may work
-		                        dm.params.output=False
-		                        dm.params.seed=False
-		                        dm.params.samples=10000
-
-				elif dm.method == 'dace':
-		                        dm.type     ='dace'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'response_function']
-		                        dm.ghspec   =[]
-		                        dm.params.grid=False
-		                        dm.params.random=False
-		                        dm.params.oas=False
-		                        dm.params.lhs=False
-		                        dm.params.oa_lhs=False
-		                        dm.params.box_behnken=False
-		                        dm.params.central_composite=False
-		                        dm.params.seed=False
-		                        dm.params.fixed_seed=False
-		                        dm.params.samples=False
-		                        dm.params.symbols=False
-		                        dm.params.quality_metrics=False
-		                        dm.params.variance_based_decomp=False
-				elif dm.method == 'fsu_quasi_mc':
-		                        dm.type     ='dace'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'response_function']
-		                        dm.ghspec   =[]
-		                        dm.params.halton=False
-		                        dm.params.hammersley=False
-		                        dm.params.samples=0
-		                        dm.params.sequence_start=[0]
-		                        dm.params.sequence_leap=[1]
-		                        dm.params.prime_base=False
-		                        dm.params.fixed_sequence=False
-		                        dm.params.latinize=False
-		                        dm.params.variance_based_decomp=False
-		                        dm.params.quality_metrics=False
-				elif dm.method == 'fsu_cvt':
-		                        dm.type     ='dace'
-		                        dm.variables=['continuous_design',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'response_function']
-		                        dm.ghspec   =[]
-		                        dm.params.seed=False
-		                        dm.params.fixed_seed=False
-		                        dm.params.samples=0
-		                        dm.params.num_trials=10000
-		                        dm.params.trial_type='random'
-		                        dm.params.latinize=False
-		                        dm.params.variance_based_decomp=False
-		                        dm.params.quality_metrics=False
-
-				elif dm.method == 'vector_parameter_study':
-		                        dm.type     ='param'
-		                        dm.variables=['continuous_design',
-		                                        'normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'response_function']
-		                        dm.ghspec   =[]
-		                        dm.params.output=False
-		                        dm.params.final_point=[]
-		                        dm.params.step_length=[]
-		                        dm.params.num_steps=[]
-		                        dm.params.step_vector=[]
-		                        dm.params.num_steps=[]
-				elif dm.method == 'list_parameter_study':
-		                        dm.type     ='param'
-		                        dm.variables=['continuous_design',
-		                                        'normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'response_function']
-		                        dm.ghspec   =[]
-		                        dm.params.output=False
-		                        dm.params.list_of_points=[]
-				elif dm.method == 'centered_parameter_study':
-		                        dm.type     ='param'
-		                        dm.variables=['continuous_design',
-		                                        'normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'response_function']
-		                        dm.ghspec   =[]
-		                        dm.params.output=False
-		                        dm.params.percent_delta=[]
-		                        dm.params.deltas_per_variable=[]
-				elif dm.method == 'multidim_parameter_study':
-		                        dm.type     ='param'
-		                        dm.variables=['continuous_design',
-		                                        'normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'response_function']
-		                        dm.ghspec   =[]
-		                        dm.params.output=False
-		                        dm.params.partitions=[]
-				elif dm.method == 'bayes_calibration':
-		                        dm.type     ='bayes'
-		                        dm.variables=['continuous_design',
-		                                        'normal_uncertain',
-		                                        'uniform_uncertain',
-		                                        'continuous_state']
-		                        dm.lcspec   =[]
-		                        dm.responses=['objective_function',
-		                                        'response_function',
-																'calibration_function']
-		                        dm.ghspec   =[]
-		                        dm.params.queso=False
-					dm.params.dream=False
-					dm.params.gpmsa=False
-		                        dm.params.samples=0
-					dm.params.seed=False
-					dm.params.output=False
-					
-					dm.params.metropolis_hastings=False
-					
-					dm.params.proposal_covariance=False
-					dm.params.diagonal=False
-					dm.params.values=[]
-
-				else:
-					raise RuntimeError('Unimplemented method: '+str(dm.method)+'.')
-
-		#  if more than one argument, issue warning
-		else:
-			print 'Warning: dakota_method:extra_arg: Extra arguments for object of class '+str(type(dm))+'.'
-		return dm
-
-	def __repr__(dm):
-
-		#  display the object
-		string = '\nclass dakota_method object = \n'
-		string += '       method: '+str(dm.method) + '\n'
-		string += '         type: '+str(dm.type) + '\n'
-		string += '    variables: '+str(dm.variables) + '\n'
-		string += '       lcspec: '+str(dm.lcspec) + '\n'
-		string += '    responses: '+str(dm.responses) + '\n'
-		string += '       ghspec: '+str(dm.ghspec) + '\n'
-
-		#  display the parameters within the object
-
-		fnames=fieldnames(dm.params)
-		#get rid of stuff we aren't using
-		try:
-			fnames.remove('__module__')
-		except ValueError:
-			pass
-
-		maxlen=0
-		for i in range(len(fnames)):
-			maxlen=max(maxlen,len(fnames[i]))
-		        
-		for i in fnames:
-			string += '       params.{:{space}s}: {}\n'.format(str(i),str(dm.params.__dict__[i]),space=maxlen+1)
-			#params.x   : y
-			#with maxlen+1 spaces between x and :
-		return string
-
+    '''
+
+    def __init__(self, *args):
+        self.method = ''
+        self.type = ''
+        self.variables = []
+        self.lcspec = []
+        self.responses = []
+        self.ghspec = []
+    #properites
+        self.params = struct()
+
+    @staticmethod
+    def dakota_method(*args):
+        dm = dakota_method()
+    #  return a default object
+        if len(args) == 0:
+            return dm
+
+    #  copy the object or create the object from the input
+        elif len(args) == 1:
+            method = args[0]
+
+            #given argument was a method, copy it
+            if isinstance(method, dakota_method):
+                #dm = method
+                object = method
+                for field in object.keys():
+                    if field in vars(dm):
+                        setattr(dm, field, object[field])
+                return dm
+
+    #given argument was a way of constructing a method
+            else:
+                mlist = ['dot_bfgs',
+                         'dot_frcg',
+                         'dot_mmfd',
+                         'dot_slp',
+                         'dot_sqp',
+                         'npsol_sqp',
+                         'conmin_frcg',
+                         'conmin_mfd',
+                         'optpp_cg',
+                         'optpp_q_newton',
+                         'optpp_fd_newton',
+                         'optpp_newton',
+                         'optpp_pds',
+                         'asynch_pattern_search',
+                         'coliny_cobyla',
+                         'coliny_direct',
+                         'coliny_ea',
+                         'coliny_pattern_search',
+                         'coliny_solis_wets',
+                         'ncsu_direct',
+                         'surrogate_based_local',
+                         'surrogate_based_global',
+                         'moga',
+                         'soga',
+                         'nl2sol',
+                         'nlssol_sqp',
+                         'optpp_g_newton',
+                         'nond_sampling',
+                         'nond_local_reliability',
+                         'nond_global_reliability',
+                         'nond_polynomial_chaos',
+                         'nond_stoch_collocation',
+                         'nond_evidence',
+                         'dace',
+                         'fsu_quasi_mc',
+                         'fsu_cvt',
+                         'vector_parameter_study',
+                         'list_parameter_study',
+                         'centered_parameter_study',
+                         'multidim_parameter_study',
+                         'bayes_calibration']
+
+                mlist2 = []
+                for i in range(len(mlist)):
+                    if strncmpi(method, mlist[i], len(method)):
+                        mlist2.append(mlist[i])
+    #  check for a unique match in the list of methods
+                length = len(mlist2)
+                if length == 0:
+                    raise RuntimeError('Unrecognized method: ' + str(method) + '.')
+                elif length == 1:
+                    dm.method = mlist2[0]
+                else:
+                    raise RuntimeError('Non - unique method: ' + str(method) + ' matches ' + string_cell(mlist2))
+
+    #  assign the default values for the method
+    # switch dm.method
+                if dm.method in ['dot_bfgs', 'dot_frcg']:
+                    dm.type = 'dot'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['objective_function']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.convergence_tolerance = False
+                    dm.params.constraint_tolerance = False
+                    dm.params.output = False
+                    dm.params.speculative = False
+                    dm.params.scaling = False
+                    dm.params.optimization_type = 'minimize'
+
+                elif dm.method in ['dot_mmfd', 'dot_slp', 'dot_sqp']:
+                    dm.type = 'dot'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = ['linear_inequality_constraint',
+                                 'linear_equality_constraint']
+                    dm.responses = ['objective_function',
+                                    'nonlinear_inequality_constraint',
+                                    'nonlinear_equality_constraint']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.convergence_tolerance = False
+                    dm.params.constraint_tolerance = False
+                    dm.params.output = False
+                    dm.params.speculative = False
+                    dm.params.scaling = False
+                    dm.params.optimization_type = 'minimize'
+
+                elif dm.method == 'npsol_sqp':
+                    dm.type = 'npsol'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = ['linear_inequality_constraint',
+                                 'linear_equality_constraint']
+                    dm.responses = ['objective_function',
+                                    'nonlinear_inequality_constraint',
+                                    'nonlinear_equality_constraint']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.convergence_tolerance = False
+                    dm.params.constraint_tolerance = False
+                    dm.params.output = False
+                    dm.params.speculative = False
+                    dm.params.scaling = False
+                    dm.params.verify_level = -1
+                    dm.params.function_precision = 1.0e-10
+                    dm.params.linesearch_tolerance = 0.9
+
+                elif dm.method == 'conmin_frcg':
+                    dm.type = 'conmin'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['objective_function']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.convergence_tolerance = False
+                    dm.params.constraint_tolerance = False
+                    dm.params.output = False
+                    dm.params.speculative = False
+                    dm.params.scaling = False
+
+                elif dm.method == 'conmin_mfd':
+                    dm.type = 'conmin'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = ['linear_inequality_constraint',
+                                 'linear_equality_constraint']
+                    dm.responses = ['objective_function',
+                                    'nonlinear_inequality_constraint',
+                                    'nonlinear_equality_constraint']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.convergence_tolerance = False
+                    dm.params.constraint_tolerance = False
+                    dm.params.output = False
+                    dm.params.speculative = False
+                    dm.params.scaling = False
+
+                elif dm.method == 'optpp_cg':
+                    dm.type = 'optpp'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['objective_function']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.convergence_tolerance = False
+                    dm.params.output = False
+                    dm.params.speculative = False
+                    dm.params.scaling = False
+                    dm.params.max_step = 1000.
+                    dm.params.gradient_tolerance = 1.0e-4
+
+                elif dm.method in ['optpp_q_newton',
+                                   'optpp_fd_newton',
+                                   'optpp_newton']:
+                    dm.type = 'optpp'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = ['linear_inequality_constraint',
+                                 'linear_equality_constraint']
+                    dm.responses = ['objective_function',
+                                    'nonlinear_inequality_constraint',
+                                    'nonlinear_equality_constraint']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.convergence_tolerance = False
+                    dm.params.output = False
+                    dm.params.speculative = False
+                    dm.params.scaling = False
+                    dm.params.value_based_line_search = False
+                    dm.params.gradient_based_line_search = False
+                    dm.params.trust_region = False
+                    dm.params.tr_pds = False
+                    dm.params.max_step = 1000.
+                    dm.params.gradient_tolerance = 1.0e-4
+                    dm.params.merit_function = 'argaez_tapia'
+                    dm.params.central_path = dm.params.merit_function
+                    dm.params.steplength_to_boundary = 0.99995
+                    dm.params.centering_parameter = 0.2
+
+                elif dm.method == 'optpp_pds':
+                    dm.type = 'optpp'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['objective_function']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.convergence_tolerance = False
+                    dm.params.output = False
+                    dm.params.speculative = False
+                    dm.params.scaling = False
+                    dm.params.search_scheme_size = 32
+
+                elif dm.method == 'asynch_pattern_search':
+                    dm.type = 'apps'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = ['linear_inequality_constraint',
+                                 'linear_equality_constraint']
+                    dm.responses = ['objective_function',
+                                    'nonlinear_inequality_constraint',
+                                    'nonlinear_equality_constraint']
+                    dm.ghspec = ['grad']
+                    dm.params.max_function_evaluations = False
+                    dm.params.constraint_tolerance = False
+                    dm.params.output = False
+                    dm.params.scaling = False
+                    dm.params.initial_delta = 1.0
+                    dm.params.threshold_delta = 0.01
+                    dm.params.contraction_factor = 0.5
+                    dm.params.solution_target = False
+                    dm.params.synchronization = 'nonblocking'
+                    dm.params.merit_function = 'merit2_smooth'
+                    dm.params.constraint_penalty = 1.0
+                    dm.params.smoothing_factor = 1.0
+
+                elif dm.method == 'coliny_cobyla':
+                    dm.type = 'coliny'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['objective_function',
+                                    'nonlinear_inequality_constraint',
+                                    'nonlinear_equality_constraint']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.convergence_tolerance = False
+                    dm.params.output = False
+                    dm.params.scaling = False
+                    dm.params.show_misc_options = False
+                    dm.params.misc_options = []
+                    dm.params.solution_accuracy = -np.inf
+                    dm.params.initial_delta = []
+                    dm.params.threshold_delta = []
+
+                elif dm.method == 'coliny_direct':
+                    dm.type = 'coliny'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['objective_function',
+                                    'nonlinear_inequality_constraint',
+                                    'nonlinear_equality_constraint']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.convergence_tolerance = False
+                    dm.params.output = False
+                    dm.params.scaling = False
+                    dm.params.show_misc_options = False
+                    dm.params.misc_options = []
+                    dm.params.solution_accuracy = -np.inf
+                    dm.params.division = 'major_dimension'
+                    dm.params.global_balance_parameter = 0.0
+                    dm.params.local_balance_parameter = 1.0e-8
+                    dm.params.max_boxsize_limit = 0.0
+                    dm.params.min_boxsize_limit = 0.0001
+                    dm.params.constraint_penalty = 1000.0
+
+                elif dm.method == 'coliny_ea':
+                    dm.type = 'coliny'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['objective_function',
+                                    'nonlinear_inequality_constraint',
+                                    'nonlinear_equality_constraint']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.convergence_tolerance = False
+                    dm.params.output = False
+                    dm.params.scaling = False
+                    dm.params.show_misc_options = False
+                    dm.params.misc_options = []
+                    dm.params.solution_accuracy = -np.inf
+                    dm.params.seed = False
+                    dm.params.population_size = 50
+                    dm.params.initialization_type = 'unique_random'
+                    dm.params.fitness_type = 'linear_rank'
+                    dm.params.replacement_type = 'elitist'
+                    dm.params.random = []
+                    dm.params.chc = []
+                    dm.params.elitist = []
+                    dm.params.new_solutions_generated = 'population_size-replacement_size'
+                    dm.params.crossover_type = 'two_point'
+                    dm.params.crossover_rate = 0.8
+                    dm.params.mutation_type = 'offset_normal'
+                    dm.params.mutation_scale = 0.1
+                    dm.params.mutation_range = 1
+                    dm.params.dimension_ratio = 1.0
+                    dm.params.mutation_rate = 1.0
+                    dm.params.non_adaptive = False
+
+                elif dm.method == 'coliny_pattern_search':
+                    dm.type = 'coliny'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['objective_function',
+                                    'nonlinear_inequality_constraint',
+                                    'nonlinear_equality_constraint']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.convergence_tolerance = False
+                    dm.params.output = False
+                    dm.params.scaling = False
+                    dm.params.show_misc_options = False
+                    dm.params.misc_options = []
+                    dm.params.solution_accuracy = -np.inf
+                    dm.params.stochastic = False
+                    dm.params.seed = False
+                    dm.params.initial_delta = []
+                    dm.params.threshold_delta = []
+                    dm.params.constraint_penalty = 1.0
+                    dm.params.constant_penalty = False
+                    dm.params.pattern_basis = 'coordinate'
+                    dm.params.total_pattern_size = False
+                    dm.params.no_expansion = False
+                    dm.params.expand_after_success = 1
+                    dm.params.contraction_factor = 0.5
+                    dm.params.synchronization = 'nonblocking'
+                    dm.params.exploratory_moves = 'basic_pattern'
+
+                elif dm.method == 'coliny_solis_wets':
+                    dm.type = 'coliny'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['objective_function',
+                                    'nonlinear_inequality_constraint',
+                                    'nonlinear_equality_constraint']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.convergence_tolerance = False
+                    dm.params.output = False
+                    dm.params.scaling = False
+                    dm.params.show_misc_options = False
+                    dm.params.misc_options = []
+                    dm.params.solution_accuracy = -np.inf
+                    dm.params.seed = False
+                    dm.params.initial_delta = []
+                    dm.params.threshold_delta = []
+                    dm.params.no_expansion = False
+                    dm.params.expand_after_success = 5
+                    dm.params.contract_after_failure = 3
+                    dm.params.contraction_factor = 0.5
+                    dm.params.constraint_penalty = 1.0
+                    dm.params.constant_penalty = False
+
+                elif dm.method == 'ncsu_direct':
+                    dm.type = 'ncsu'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = ['linear_inequality_constraint',
+                                 'linear_equality_constraint']  #  ?
+                    dm.responses = ['objective_function',
+                                    'nonlinear_inequality_constraint',
+                                    'nonlinear_equality_constraint']  #  ?
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.scaling = False
+                    dm.params.solution_accuracy = 0.
+                    dm.params.min_boxsize_limit = 1.0e-8
+                    dm.params.vol_boxsize_limit = 1.0e-8
+
+    #if dm.method in ['surrogate_based_local',
+    #'surrogate_based_global']:
+
+                elif dm.method == 'moga':
+                    dm.type = 'jega'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = ['linear_inequality_constraint',
+                                 'linear_equality_constraint']
+                    dm.responses = ['objective_function',
+                                    'nonlinear_inequality_constraint',
+                                    'nonlinear_equality_constraint']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.output = False
+                    dm.params.scaling = False
+                    dm.params.seed = False
+                    dm.params.log_file = 'JEGAGlobal.log'
+                    dm.params.population_size = 50
+                    dm.params.print_each_pop = False
+    #according to documentation, uses method - indepent control
+    #dm.params.output = 'normal'
+                    dm.params.initialization_type = 'unique_random'
+                    dm.params.mutation_type = 'replace_uniform'
+                    dm.params.mutation_scale = 0.15
+                    dm.params.mutation_rate = 0.08
+                    dm.params.replacement_type = ''
+                    dm.params.below_limit = 6
+                    dm.params.shrinkage_percentage = 0.9
+                    dm.params.crossover_type = 'shuffle_random'
+                    dm.params.multi_point_binary = []
+                    dm.params.multi_point_parameterized_binary = []
+                    dm.params.multi_point_real = []
+                    dm.params.shuffle_random = []
+                    dm.params.num_parents = 2
+                    dm.params.num_offspring = 2
+                    dm.params.crossover_rate = 0.8
+                    dm.params.fitness_type = ''
+                    dm.params.niching_type = False
+                    dm.params.radial = [0.01]
+                    dm.params.distance = [0.01]
+                    dm.params.metric_tracker = False
+                    dm.params.percent_change = 0.1
+                    dm.params.num_generations = 10
+                    dm.params.postprocessor_type = False
+                    dm.params.orthogonal_distance = [0.01]
+
+                elif dm.method == 'soga':
+                    dm.type = 'jega'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = ['linear_inequality_constraint',
+                                 'linear_equality_constraint']
+                    dm.responses = ['objective_function',
+                                    'nonlinear_inequality_constraint',
+                                    'nonlinear_equality_constraint']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.output = False
+                    dm.params.scaling = False
+                    dm.params.seed = False
+                    dm.params.log_file = 'JEGAGlobal.log'
+                    dm.params.population_size = 50
+                    dm.params.print_each_pop = False
+                    dm.params.output = 'normal'
+                    dm.params.initialization_type = 'unique_random'
+                    dm.params.mutation_type = 'replace_uniform'
+                    dm.params.mutation_scale = 0.15
+                    dm.params.mutation_rate = 0.08
+                    dm.params.replacement_type = ''
+                    dm.params.below_limit = 6
+                    dm.params.shrinkage_percentage = 0.9
+                    dm.params.crossover_type = 'shuffle_random'
+                    dm.params.multi_point_binary = []
+                    dm.params.multi_point_parameterized_binary = []
+                    dm.params.multi_point_real = []
+                    dm.params.shuffle_random = []
+                    dm.params.num_parents = 2
+                    dm.params.num_offspring = 2
+                    dm.params.crossover_rate = 0.8
+                    dm.params.fitness_type = 'merit_function'
+                    dm.params.constraint_penalty = 1.0
+                    dm.params.replacement_type = ''
+                    dm.params.convergence_type = False
+                    dm.params.num_generations = 10
+                    dm.params.percent_change = 0.1
+
+                elif dm.method == 'nl2sol':
+                    dm.type = 'lsq'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['least_squares_term']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.convergence_tolerance = False
+                    dm.params.output = False
+                    dm.params.scaling = False
+                    dm.params.function_precision = 1.0e-10
+                    dm.params.absolute_conv_tol = -1.
+                    dm.params.x_conv_tol = -1.
+                    dm.params.singular_conv_tol = -1.
+                    dm.params.singular_radius = -1.
+                    dm.params.False_conv_tol = -1.
+                    dm.params.initial_trust_radius = -1.
+                    dm.params.covariance = 0
+                    dm.params.regression_stressbalances = False
+
+                elif dm.method == 'nlssol_sqp':
+                    dm.type = 'lsq'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = ['linear_inequality_constraint',
+                                 'linear_equality_constraint']
+                    dm.responses = ['least_squares_term',
+                                    'nonlinear_inequality_constraint',
+                                    'nonlinear_equality_constraint']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.convergence_tolerance = False
+                    dm.params.constraint_tolerance = False
+                    dm.params.output = False
+                    dm.params.speculative = False
+                    dm.params.scaling = False
+                    dm.params.verify_level = -1
+                    dm.params.function_precision = 1.0e-10
+                    dm.params.linesearch_tolerance = 0.9
+
+                elif dm.method == 'optpp_g_newton':
+                    dm.type = 'lsq'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = ['linear_inequality_constraint',
+                                 'linear_equality_constraint']
+                    dm.responses = ['least_squares_term',
+                                    'nonlinear_inequality_constraint',
+                                    'nonlinear_equality_constraint']
+                    dm.ghspec = ['grad']
+                    dm.params.max_iterations = False
+                    dm.params.max_function_evaluations = False
+                    dm.params.convergence_tolerance = False
+                    dm.params.output = False
+                    dm.params.speculative = False
+                    dm.params.scaling = False
+                    dm.params.value_based_line_search = False
+                    dm.params.gradient_based_line_search = False
+                    dm.params.trust_region = False
+                    dm.params.tr_pds = False
+                    dm.params.max_step = 1000.
+                    dm.params.gradient_tolerance = 1.0e-4
+                    dm.params.merit_function = 'argaez_tapia'
+                    dm.params.central_path = dm.params.merit_function
+                    dm.params.steplength_to_boundary = 0.99995
+                    dm.params.centering_parameter = 0.2
+
+                elif dm.method == 'nond_sampling':
+                    dm.type = 'nond'
+                    dm.variables = ['normal_uncertain',
+                                    'uniform_uncertain',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['response_function']
+                    dm.ghspec = []
+    #                               not documented, but apparently works
+                    dm.params.output = False
+                    dm.params.seed = False
+                    dm.params.fixed_seed = False
+                    dm.params.rng = False
+                    dm.params.samples = False
+                    dm.params.sample_type = 'lhs'
+                    dm.params.all_variables = False
+                    dm.params.variance_based_decomp = False
+                    dm.params.previous_samples = 0
+
+                elif dm.method == 'nond_local_reliability':
+                    dm.type = 'nond'
+                    dm.variables = ['normal_uncertain',
+                                    'uniform_uncertain',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['response_function']
+                    dm.ghspec = ['grad']
+    #                               not documented, but may work
+                    dm.params.output = False
+                    dm.params.max_iterations = False
+                    dm.params.convergence_tolerance = False
+                    dm.params.mpp_search = False
+                    dm.params.sqp = False
+                    dm.params.nip = False
+                    dm.params.integration = 'first_order'
+                    dm.params.refinement = False
+                    dm.params.samples = 0
+                    dm.params.seed = False
+
+                elif dm.method == 'nond_global_reliability':
+                    dm.type = 'nond'
+                    dm.variables = ['normal_uncertain',
+                                    'uniform_uncertain',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['response_function']
+                    dm.ghspec = ['grad']
+    #                               not documented, but may work
+                    dm.params.output = False
+                    dm.params.x_gaussian_process = False
+                    dm.params.u_gaussian_process = False
+                    dm.params.all_variables = False
+                    dm.params.seed = False
+
+                elif dm.method == 'nond_polynomial_chaos':
+                    dm.type = 'nond'
+                    dm.variables = ['normal_uncertain',
+                                    'uniform_uncertain',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['response_function']
+                    dm.ghspec = ['grad']
+    #                               not documented, but may work
+                    dm.params.output = False
+                    dm.params.expansion_order = []
+                    dm.params.expansion_terms = []
+                    dm.params.quadrature_order = []
+                    dm.params.sparse_grid_level = []
+                    dm.params.expansion_samples = []
+                    dm.params.incremental_lhs = False
+                    dm.params.collocation_points = []
+                    dm.params.collocation_ratio = []
+                    dm.params.reuse_samples = False
+                    dm.params.expansion_import_file = ''
+                    dm.params.seed = False
+                    dm.params.fixed_seed = False
+                    dm.params.samples = 0
+                    dm.params.sample_type = 'lhs'
+                    dm.params.all_variables = False
+
+                elif dm.method == 'nond_stoch_collocation':
+                    dm.type = 'nond'
+                    dm.variables = ['normal_uncertain',
+                                    'uniform_uncertain',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['response_function']
+                    dm.ghspec = ['grad']
+    #                               not documented, but may work
+                    dm.params.output = False
+                    dm.params.quadrature_order = []
+                    dm.params.sparse_grid_level = []
+                    dm.params.seed = False
+                    dm.params.fixed_seed = False
+                    dm.params.samples = 0
+                    dm.params.sample_type = 'lhs'
+                    dm.params.all_variables = False
+
+                elif dm.method == 'nond_evidence':
+                    dm.type = 'nond'
+                    dm.variables = ['normal_uncertain',
+                                    'uniform_uncertain',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['response_function']
+                    dm.ghspec = ['grad']
+    #                               not documented, but may work
+                    dm.params.output = False
+                    dm.params.seed = False
+                    dm.params.samples = 10000
+
+                elif dm.method == 'dace':
+                    dm.type = 'dace'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['objective_function',
+                                    'response_function']
+                    dm.ghspec = []
+                    dm.params.grid = False
+                    dm.params.random = False
+                    dm.params.oas = False
+                    dm.params.lhs = False
+                    dm.params.oa_lhs = False
+                    dm.params.box_behnken = False
+                    dm.params.central_composite = False
+                    dm.params.seed = False
+                    dm.params.fixed_seed = False
+                    dm.params.samples = False
+                    dm.params.symbols = False
+                    dm.params.quality_metrics = False
+                    dm.params.variance_based_decomp = False
+
+                elif dm.method == 'fsu_quasi_mc':
+                    dm.type = 'dace'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['objective_function',
+                                    'response_function']
+                    dm.ghspec = []
+                    dm.params.halton = False
+                    dm.params.hammersley = False
+                    dm.params.samples = 0
+                    dm.params.sequence_start = [0]
+                    dm.params.sequence_leap = [1]
+                    dm.params.prime_base = False
+                    dm.params.fixed_sequence = False
+                    dm.params.latinize = False
+                    dm.params.variance_based_decomp = False
+                    dm.params.quality_metrics = False
+
+                elif dm.method == 'fsu_cvt':
+                    dm.type = 'dace'
+                    dm.variables = ['continuous_design',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['objective_function',
+                                    'response_function']
+                    dm.ghspec = []
+                    dm.params.seed = False
+                    dm.params.fixed_seed = False
+                    dm.params.samples = 0
+                    dm.params.num_trials = 10000
+                    dm.params.trial_type = 'random'
+                    dm.params.latinize = False
+                    dm.params.variance_based_decomp = False
+                    dm.params.quality_metrics = False
+
+                elif dm.method == 'vector_parameter_study':
+                    dm.type = 'param'
+                    dm.variables = ['continuous_design',
+                                    'normal_uncertain',
+                                    'uniform_uncertain',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['objective_function',
+                                    'response_function']
+                    dm.ghspec = []
+                    dm.params.output = False
+                    dm.params.final_point = []
+                    dm.params.step_length = []
+                    dm.params.num_steps = []
+                    dm.params.step_vector = []
+                    dm.params.num_steps = []
+
+                elif dm.method == 'list_parameter_study':
+                    dm.type = 'param'
+                    dm.variables = ['continuous_design',
+                                    'normal_uncertain',
+                                    'uniform_uncertain',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['objective_function',
+                                    'response_function']
+                    dm.ghspec = []
+                    dm.params.output = False
+                    dm.params.list_of_points = []
+
+                elif dm.method == 'centered_parameter_study':
+                    dm.type = 'param'
+                    dm.variables = ['continuous_design',
+                                    'normal_uncertain',
+                                    'uniform_uncertain',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['objective_function',
+                                    'response_function']
+                    dm.ghspec = []
+                    dm.params.output = False
+                    dm.params.percent_delta = []
+                    dm.params.deltas_per_variable = []
+
+                elif dm.method == 'multidim_parameter_study':
+                    dm.type = 'param'
+                    dm.variables = ['continuous_design',
+                                    'normal_uncertain',
+                                    'uniform_uncertain',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['objective_function',
+                                    'response_function']
+                    dm.ghspec = []
+                    dm.params.output = False
+                    dm.params.partitions = []
+
+                elif dm.method == 'bayes_calibration':
+                    dm.type = 'bayes'
+                    dm.variables = ['continuous_design',
+                                    'normal_uncertain',
+                                    'uniform_uncertain',
+                                    'continuous_state']
+                    dm.lcspec = []
+                    dm.responses = ['objective_function',
+                                    'response_function',
+                                    'calibration_function']
+                    dm.ghspec = []
+                    dm.params.queso = False
+                    dm.params.dream = False
+                    dm.params.gpmsa = False
+                    dm.params.samples = 0
+                    dm.params.seed = False
+                    dm.params.output = False
+                    dm.params.metropolis_hastings = False
+                    dm.params.proposal_covariance = False
+                    dm.params.diagonal = False
+                    dm.params.values = []
+
+                else:
+                    raise RuntimeError('Unimplemented method: {}.'.format(dm.method))
+
+    #  if more than one argument, issue warning
+        else:
+            print('Warning: dakota_method:extra_arg: Extra arguments for object of class ' + str(type(dm)) + '.')
+        return dm
+
+    def __repr__(dm):
+
+        #  display the object
+        string = '\nclass dakota_method object = \n'
+        string += '       method: ' + str(dm.method) + '\n'
+        string += '         type: ' + str(dm.type) + '\n'
+        string += '    variables: ' + str(dm.variables) + '\n'
+        string += '       lcspec: ' + str(dm.lcspec) + '\n'
+        string += '    responses: ' + str(dm.responses) + '\n'
+        string += '       ghspec: ' + str(dm.ghspec) + '\n'
+
+    #  display the parameters within the object
+
+        fnames = fieldnames(dm.params)
+    #get rid of stuff we aren't using
+        try:
+            fnames.remove('__module__')
+        except ValueError:
+            pass
+
+        maxlen = 0
+        for i in range(len(fnames)):
+            maxlen = max(maxlen, len(fnames[i]))
+
+        for i in fnames:
+            string += '       params.{:{space}s}: {}\n'.format(str(i), str(dm.params.__dict__[i]), space=maxlen + 1)
+    #params.x   : y
+    #with maxlen + 1 spaces between x and :
+        return string
Index: /issm/trunk/src/m/classes/qmu/@dakota_method/dmeth_params_set.py
===================================================================
--- /issm/trunk/src/m/classes/qmu/@dakota_method/dmeth_params_set.py	(revision 24312)
+++ /issm/trunk/src/m/classes/qmu/@dakota_method/dmeth_params_set.py	(revision 24313)
@@ -2,26 +2,23 @@
 from dakota_method import *
 
-def dmeth_params_set(dm,*args):
-#
-#  set parameters of a dakota_method object.
-#
-#  dm=dmeth_params_set(dm,*args)
-#
 
-	if not isinstance(dm,dakota_method):
-		raise RuntimeError('Provided object is a \''+str(type(dm))+'\' class object, not \'dakota_method\'')
+def dmeth_params_set(dm, *args):
+    #
+    #  set parameters of a dakota_method object.
+    #
+    #  dm = dmeth_params_set(dm, *args)
+    #
 
-	#  loop through each parameter field in the input list
-	for i in range(0,len(args),2):
-		if isfield(dm.params,args[i]):
-			#vars(dresp)[fnames[i]]
-	    		exec('dm.params.%s = args[i+1]')%(args[i])
-			#vars(dm.params)[args[i]]=args[i+1]
-		else:
-			print 'WARNING: dmeth_params_set:unknown_param No parameter \''+str(args[i])+'\' for dakota_method \''+str(dm.method)+'\'.'
+    if not isinstance(dm, dakota_method):
+        raise RuntimeError('Provided object is a \'' + str(type(dm)) + '\' class object, not \'dakota_method\'')
 
-	return dm
-    
+    #  loop through each parameter field in the input list
+    for i in range(0, len(args), 2):
+        if isfield(dm.params, args[i]):
+            #vars(dresp)[fnames[i]]
+            exec(('dm.params.%s = args[i + 1]') % (args[i]))
+    #vars(dm.params)[args[i]] = args[i + 1]
+        else:
+            print('WARNING: dmeth_params_set:unknown_param No parameter \'' + str(args[i]) + '\' for dakota_method \'' + str(dm.method) + '\'.')
 
-
-
+    return dm
Index: /issm/trunk/src/m/classes/qmu/@dakota_method/dmeth_params_write.py
===================================================================
--- /issm/trunk/src/m/classes/qmu/@dakota_method/dmeth_params_write.py	(revision 24312)
+++ /issm/trunk/src/m/classes/qmu/@dakota_method/dmeth_params_write.py	(revision 24313)
@@ -2,586 +2,537 @@
 from MatlabFuncs import *
 from IssmConfig import *
-
 #move this later:
 from helpers import *
 
-#
-#  write the parameters from a dakota_method object.
-#
-#  []=dmeth_params_write(dm,fid,sbeg)
-#
-def dmeth_params_write(dm,fid,sbeg='\t  '):
-
-	if not isinstance(dm,dakota_method):
-		raise RuntimeError('Object '+str(dm)+' is a '+type(dm)+' class object, not <dakota_method>.')
-
-	if sbeg == None or sbeg =='':
-		sbeg='\t  '
-
-	#  perform some error checking, but leave the rest to dakota.
-	#  unfortunately this prevents merely looping through the fields
-	#  of the parameters structure.
-
-	#  write method-indepent controls
-
-	# param_write(fid,sbeg,'id_method','                = ','\n',dm.params)
-	# param_write(fid,sbeg,'model_pointer','            = ','\n',dm.params)
-
-	#  write method-depent controls
-
-	#switch dm.type
-	if dm.type == 'dot':
-		param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
-		param_write(fid,sbeg,'max_function_evaluations',' = ','\n',dm.params)
-		param_write(fid,sbeg,'convergence_tolerance','    = ','\n',dm.params)
-		param_write(fid,sbeg,'constraint_tolerance','     = ','\n',dm.params)
-		param_write(fid,sbeg,'output',' ','\n',dm.params)
-		param_write(fid,sbeg,'speculative','','\n',dm.params)
-		param_write(fid,sbeg,'scaling','','\n',dm.params)
-		#switch dm.method
-		if dm.method in ['dot_bfgs',
-		        	 'dot_frcg',
-		         	 'dot_mmfd',
-		         	 'dot_slp',
-		         	 'dot_sqp']:
-		        param_write(fid,sbeg,'optimization_type',' = ','\n',dm.params)
-
-		else:
-		        raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
-
-	elif dm.type == 'npsol':
-		param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
-		param_write(fid,sbeg,'max_function_evaluations',' = ','\n',dm.params)
-		param_write(fid,sbeg,'convergence_tolerance','    = ','\n',dm.params)
-		param_write(fid,sbeg,'constraint_tolerance','     = ','\n',dm.params)
-		param_write(fid,sbeg,'output',' ','\n',dm.params)
-		param_write(fid,sbeg,'speculative','','\n',dm.params)
-		param_write(fid,sbeg,'scaling','','\n',dm.params)
-		#switch dm.method
-		if dm.method == 'npsol_sqp':
-			param_write(fid,sbeg,'verify_level','         = ','\n',dm.params)
-			param_write(fid,sbeg,'function_precision','   = ','\n',dm.params)
-			param_write(fid,sbeg,'linesearch_tolerance',' = ','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
-
-	elif dm.type == 'conmin':
-		param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
-		param_write(fid,sbeg,'max_function_evaluations',' = ','\n',dm.params)
-		param_write(fid,sbeg,'convergence_tolerance','    = ','\n',dm.params)
-		param_write(fid,sbeg,'constraint_tolerance','     = ','\n',dm.params)
-		param_write(fid,sbeg,'output',' ','\n',dm.params)
-		param_write(fid,sbeg,'speculative','','\n',dm.params)
-		param_write(fid,sbeg,'scaling','','\n',dm.params)
-		#switch dm.method
-		if dm.method in ['conmin_frcg',
-		          'conmin_mfd']:
-			pass
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
-
-	elif dm.type == 'optpp':
-		param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
-		param_write(fid,sbeg,'max_function_evaluations',' = ','\n',dm.params)
-		param_write(fid,sbeg,'convergence_tolerance','    = ','\n',dm.params)
-		param_write(fid,sbeg,'output',' ','\n',dm.params)
-		param_write(fid,sbeg,'speculative','','\n',dm.params)
-		param_write(fid,sbeg,'scaling','','\n',dm.params)
-		#switch dm.method
-		if dm.method == 'optpp_cg':
-		        param_write(fid,sbeg,'max_step','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'gradient_tolerance',' = ','\n',dm.params)
-
-		elif dm.method in ['optpp_q_newton',
-		          'optpp_fd_newton',
-		          'optpp_newton']:
-		        if (dm.params.value_based_line_search + 
-		            dm.params.gradient_based_line_search + 
-		            dm.params.trust_region + 
-		            dm.params.tr_pds > 1):
-		        	raise RuntimeError('#s'' method must have only one algorithm.',
-		                	dm.method)
-		        
-		        param_write(fid,sbeg,'value_based_line_search','','\n',dm.params)
-		        param_write(fid,sbeg,'gradient_based_line_search','','\n',dm.params)
-		        param_write(fid,sbeg,'trust_region','','\n',dm.params)
-		        param_write(fid,sbeg,'tr_pds','','\n',dm.params)
-		        param_write(fid,sbeg,'max_step','               = ','\n',dm.params)
-		        param_write(fid,sbeg,'gradient_tolerance','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'merit_function','         = ','\n',dm.params)
-		        param_write(fid,sbeg,'central_path','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'steplength_to_boundary',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'centering_parameter','    = ','\n',dm.params)
-
-		elif dm.method == 'optpp_pds':
-		        param_write(fid,sbeg,'search_scheme_size',' = ','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
-
-	elif dm.type == 'apps':
-		param_write(fid,sbeg,'max_function_evaluations',' = ','\n',dm.params)
-		param_write(fid,sbeg,'constraint_tolerance','     = ','\n',dm.params)
-		param_write(fid,sbeg,'output',' ','\n',dm.params)
-		param_write(fid,sbeg,'scaling','','\n',dm.params)
-		#switch dm.method
-		if dm.method == 'asynch_pattern_search':
-		        param_write(fid,sbeg,'initial_delta','      = ','\n',dm.params)
-		        param_write(fid,sbeg,'threshold_delta','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'contraction_factor',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'solution_target','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'synchronization','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'merit_function','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'constraint_penalty',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'smoothing_factor','   = ','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
-
-	elif dm.type == 'coliny':
-		param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
-		param_write(fid,sbeg,'max_function_evaluations',' = ','\n',dm.params)
-		param_write(fid,sbeg,'convergence_tolerance','    = ','\n',dm.params)
-		param_write(fid,sbeg,'output',' ','\n',dm.params)
-		param_write(fid,sbeg,'scaling','','\n',dm.params)
-
-		param_write(fid,sbeg,'show_misc_options','','\n',dm.params)
-		param_write(fid,sbeg,'misc_options','      = ','\n',dm.params)
-		param_write(fid,sbeg,'solution_accuracy',' = ','\n',dm.params)
-		#switch dm.method
-		if dm.method == 'coliny_cobyla':
-		        param_write(fid,sbeg,'initial_delta','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'threshold_delta',' = ','\n',dm.params)
-
-		elif dm.method == 'coliny_direct':
-		        param_write(fid,sbeg,'division','                 = ','\n',dm.params)
-		        param_write(fid,sbeg,'global_balance_parameter',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'local_balance_parameter','  = ','\n',dm.params)
-		        param_write(fid,sbeg,'max_boxsize_limit','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'min_boxsize_limit','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'constraint_penalty','       = ','\n',dm.params)
-
-		elif dm.method == 'coliny_ea':
-		        param_write(fid,sbeg,'seed','                    = ','\n',dm.params)
-		        param_write(fid,sbeg,'population_size','         = ','\n',dm.params)
-		        param_write(fid,sbeg,'initialization_type','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'fitness_type','            = ','\n',dm.params)
-		        param_write(fid,sbeg,'replacement_type','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'random','                  = ','\n',dm.params)
-		        param_write(fid,sbeg,'chc','                     = ','\n',dm.params)
-		        param_write(fid,sbeg,'elitist','                 = ','\n',dm.params)
-		        param_write(fid,sbeg,'new_solutions_generated',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'crossover_type','          = ','\n',dm.params)
-		        param_write(fid,sbeg,'crossover_rate','          = ','\n',dm.params)
-		        param_write(fid,sbeg,'mutation_type','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'mutation_scale','          = ','\n',dm.params)
-		        param_write(fid,sbeg,'mutation_range','          = ','\n',dm.params)
-		        param_write(fid,sbeg,'dimension_ratio','         = ','\n',dm.params)
-		        param_write(fid,sbeg,'mutation_rate','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'non_adaptive','','\n',dm.params)
-
-		elif dm.method == 'coliny_pattern_search':
-		        param_write(fid,sbeg,'stochastic','','\n',dm.params)
-		        param_write(fid,sbeg,'seed','                 = ','\n',dm.params)
-		        param_write(fid,sbeg,'initial_delta','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'threshold_delta','      = ','\n',dm.params)
-		        param_write(fid,sbeg,'constraint_penalty','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'constant_penalty','','\n',dm.params)
-		        param_write(fid,sbeg,'pattern_basis','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'total_pattern_size','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'no_expansion','','\n',dm.params)
-		        param_write(fid,sbeg,'expand_after_success',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'contraction_factor','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'synchronization','      = ','\n',dm.params)
-		        param_write(fid,sbeg,'exploratory_moves','    = ','\n',dm.params)
-
-		elif dm.method == 'coliny_solis_wets':
-		        param_write(fid,sbeg,'seed','                   = ','\n',dm.params)
-		        param_write(fid,sbeg,'initial_delta','          = ','\n',dm.params)
-		        param_write(fid,sbeg,'threshold_delta','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'no_expansion','','\n',dm.params)
-		        param_write(fid,sbeg,'expand_after_success','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'contract_after_failure',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'contraction_factor','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'constraint_penalty','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'constant_penalty','','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
-
-	elif dm.type == 'ncsu':
-		param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
-		param_write(fid,sbeg,'max_function_evaluations',' = ','\n',dm.params)
-		param_write(fid,sbeg,'scaling','','\n',dm.params)
-		#switch dm.method
-		if dm.method == 'ncsu_direct':
-		        param_write(fid,sbeg,'solution_accuracy',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'min_boxsize_limit',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'vol_boxsize_limit',' = ','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
-
-	elif dm.type == 'jega':
-		param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
-		param_write(fid,sbeg,'max_function_evaluations',' = ','\n',dm.params)
-		param_write(fid,sbeg,'output',' ','\n',dm.params)
-		param_write(fid,sbeg,'scaling','','\n',dm.params)
-
-		param_write(fid,sbeg,'seed','                             = ','\n',dm.params)
-		param_write(fid,sbeg,'log_file','                         = ','\n',dm.params)
-		param_write(fid,sbeg,'population_size','                  = ','\n',dm.params)
-		param_write(fid,sbeg,'print_each_pop','','\n',dm.params)
-		param_write(fid,sbeg,'output','                           = ','\n',dm.params)
-		param_write(fid,sbeg,'initialization_type','              = ','\n',dm.params)
-		param_write(fid,sbeg,'mutation_type','                    = ','\n',dm.params)
-		param_write(fid,sbeg,'mutation_scale','                   = ','\n',dm.params)
-		param_write(fid,sbeg,'mutation_rate','                    = ','\n',dm.params)
-		param_write(fid,sbeg,'replacement_type','                 = ','\n',dm.params)
-		param_write(fid,sbeg,'below_limit','                      = ','\n',dm.params)
-		param_write(fid,sbeg,'shrinkage_percentage','             = ','\n',dm.params)
-		param_write(fid,sbeg,'crossover_type','                   = ','\n',dm.params)
-		param_write(fid,sbeg,'multi_point_binary','               = ','\n',dm.params)
-		param_write(fid,sbeg,'multi_point_parameterized_binary',' = ','\n',dm.params)
-		param_write(fid,sbeg,'multi_point_real','                 = ','\n',dm.params)
-		param_write(fid,sbeg,'shuffle_random','                   = ','\n',dm.params)
-		param_write(fid,sbeg,'num_parents','                      = ','\n',dm.params)
-		param_write(fid,sbeg,'num_offspring','                    = ','\n',dm.params)
-		param_write(fid,sbeg,'crossover_rate','                   = ','\n',dm.params)
-
-		#switch dm.method
-		if dm.method == 'moga':
-		        param_write(fid,sbeg,'fitness_type','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'niching_type','        = ','\n',dm.params)
-		        if not isempty(dm.params.radial) and not isempty(dm.params.distance):
-		        	raise RuntimeError('#s'' method must have only one niching distance.',
-		        		dm.method)
-		        
-		        param_write(fid,sbeg,'radial','              = ','\n',dm.params)
-		        param_write(fid,sbeg,'distance','            = ','\n',dm.params)
-		        param_write(fid,sbeg,'metric_tracker','','\n',dm.params)
-		        param_write(fid,sbeg,'percent_change','      = ','\n',dm.params)
-		        param_write(fid,sbeg,'num_generations','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'postprocessor_type','  = ','\n',dm.params)
-		        param_write(fid,sbeg,'orthogonal_distance',' = ','\n',dm.params)
-
-		elif dm.method == 'soga':
-		        param_write(fid,sbeg,'fitness_type','       = ','\n',dm.params)
-		        param_write(fid,sbeg,'constraint_penalty',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'replacement_type','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'convergence_type','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'num_generations','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'percent_change','     = ','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
-
-	elif dm.type == 'lsq':
-		#switch dm.method
-		if dm.method == 'nl2sol':
-		        param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'max_function_evaluations',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'convergence_tolerance','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'output',' ','\n',dm.params)
-		        param_write(fid,sbeg,'scaling','','\n',dm.params)
-
-		        param_write(fid,sbeg,'function_precision','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'absolute_conv_tol','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'x_conv_tol','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'singular_conv_tol','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'singular_radius','      = ','\n',dm.params)
-		        param_write(fid,sbeg,'false_conv_tol','       = ','\n',dm.params)
-		        param_write(fid,sbeg,'initial_trust_radius',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'covariance','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'regression_stressbalances','','\n',dm.params)
-
-		elif dm.method == 'nlssol_sqp':
-		        param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'max_function_evaluations',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'convergence_tolerance','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'constraint_tolerance','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'output',' ','\n',dm.params)
-		        param_write(fid,sbeg,'speculative','','\n',dm.params)
-		        param_write(fid,sbeg,'scaling','','\n',dm.params)
-
-		        param_write(fid,sbeg,'verify_level','         = ','\n',dm.params)
-		        param_write(fid,sbeg,'function_precision','   = ','\n',dm.params)
-		        param_write(fid,sbeg,'linesearch_tolerance',' = ','\n',dm.params)
-
-		elif dm.method == 'optpp_g_newton':
-		        param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'max_function_evaluations',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'convergence_tolerance','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'output',' ','\n',dm.params)
-		        param_write(fid,sbeg,'speculative','','\n',dm.params)
-		        param_write(fid,sbeg,'scaling','','\n',dm.params)
-
-		        if (dm.params.value_based_line_search + 
-		            dm.params.gradient_based_line_search + 
-		            dm.params.trust_region + 
-		            dm.params.tr_pds > 1):
-		        	raise RuntimeError('#s'' method must have only one algorithm.',
-		                	dm.method)
-		        
-		        param_write(fid,sbeg,'value_based_line_search','','\n',dm.params)
-		        param_write(fid,sbeg,'gradient_based_line_search','','\n',dm.params)
-		        param_write(fid,sbeg,'trust_region','','\n',dm.params)
-		        param_write(fid,sbeg,'tr_pds','','\n',dm.params)
-		        param_write(fid,sbeg,'max_step','               = ','\n',dm.params)
-		        param_write(fid,sbeg,'gradient_tolerance','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'merit_function','         = ','\n',dm.params)
-		        param_write(fid,sbeg,'central_path','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'steplength_to_boundary',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'centering_parameter','    = ','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
-
-	elif dm.type == 'nond':
-		#switch dm.method
-		if dm.method == 'nond_sampling':
-		        param_write(fid,sbeg,'seed','             = ','\n',dm.params)
-		        param_write(fid,sbeg,'fixed_seed','','\n',dm.params)
-			dver = str(IssmConfig('_DAKOTA_VERSION_')[0])
-		        if ((int(dver[0])==4 and int(dver[2])>2) or int(dver[0])>4):
-		        	param_write(fid,sbeg,'rng','                ','\n',dm.params)
-		        
-		        param_write(fid,sbeg,'samples','          = ','\n',dm.params)
-		        param_write(fid,sbeg,'sample_type','        ','\n',dm.params)
-		        param_write(fid,sbeg,'all_variables','','\n',dm.params)
-		        param_write(fid,sbeg,'variance_based_decomp','','\n',dm.params)
-		        if strcmp(dm.params.sample_type,'incremental_random') or strcmp(dm.params.sample_type,'incremental_lhs'):
-		        	param_write(fid,sbeg,'previous_samples',' = ','\n',dm.params)
-		        
-		        param_write(fid,sbeg,'output',' ','\n',dm.params)
-
-		elif dm.method == 'nond_local_reliability':
-		        param_write(fid,sbeg,'max_iterations','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'convergence_tolerance','    = ','\n',dm.params)
-
-		        param_write(fid,sbeg,'mpp_search','  = ','\n',dm.params)
-		        if type(dm.params.mpp_search) == str:
-		        	if (dm.params.sqp + 
-		                    dm.params.nip > 1):
-		                	raise RuntimeError('#s'' method must have only one algorithm.',
-		                    		dm.method)
-		            
-				param_write(fid,sbeg,'sqp','','\n',dm.params)
-				param_write(fid,sbeg,'nip','','\n',dm.params)
-				param_write(fid,sbeg,'integration','   ','\n',dm.params)
-				param_write(fid,sbeg,'refinement','  = ','\n',dm.params)
-		        	if type(dm.params.refinement) == str:
-		            		param_write(fid,sbeg,'samples','     = ','\n',dm.params)
-		            		param_write(fid,sbeg,'seed','        = ','\n',dm.params)
-		            
-		        
-		        param_write(fid,sbeg,'output',' ','\n',dm.params)
-
-		elif dm.method == 'nond_global_reliability':
-			if (dm.params.x_gaussian_process + dm.params.u_gaussian_process != 1):
-		        	raise RuntimeError('#s'' method must have one and only one algorithm.',
-		                	dm.method)
-		        
-		        param_write(fid,sbeg,'x_gaussian_process','','\n',dm.params)
-		        param_write(fid,sbeg,'u_gaussian_process','','\n',dm.params)
-		        param_write(fid,sbeg,'all_variables','','\n',dm.params)
-		        param_write(fid,sbeg,'seed',' = ','\n',dm.params)
-
-		elif dm.method == 'nond_polynomial_chaos':
-		        param_write(fid,sbeg,'expansion_order','       = ','\n',dm.params)
-		        param_write(fid,sbeg,'expansion_terms','       = ','\n',dm.params)
-		        param_write(fid,sbeg,'quadrature_order','      = ','\n',dm.params)
-		        param_write(fid,sbeg,'sparse_grid_level','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'expansion_samples','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'incremental_lhs','','\n',dm.params)
-		        param_write(fid,sbeg,'collocation_points','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'collocation_ratio','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'reuse_samples','','\n',dm.params)
-		        param_write(fid,sbeg,'expansion_import_file',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'seed','                  = ','\n',dm.params)
-		        param_write(fid,sbeg,'fixed_seed','','\n',dm.params)
-		        param_write(fid,sbeg,'samples','               = ','\n',dm.params)
-		        param_write(fid,sbeg,'sample_type','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'all_variables','','\n',dm.params)
-
-		elif dm.method == 'nond_stoch_collocation':
-		        param_write(fid,sbeg,'quadrature_order','  = ','\n',dm.params)
-		        param_write(fid,sbeg,'sparse_grid_level',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'seed','              = ','\n',dm.params)
-		        param_write(fid,sbeg,'fixed_seed','','\n',dm.params)
-		        param_write(fid,sbeg,'samples','           = ','\n',dm.params)
-		        param_write(fid,sbeg,'sample_type','       = ','\n',dm.params)
-		        param_write(fid,sbeg,'all_variables','','\n',dm.params)
-
-		elif dm.method == 'nond_evidence':
-		        param_write(fid,sbeg,'seed','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'samples',' = ','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
-
-	elif dm.type == 'dace':
-		#switch dm.method
-		if dm.method == 'dace':
-			if (dm.params.grid + dm.params.random + dm.params.oas + dm.params.lhs + dm.params.oa_lhs + dm.params.box_behnken + dm.params.central_composite != 1):
-		        	raise RuntimeError('#s'' method must have one and only one algorithm.',
-		                	dm.method)
-		        
-		        param_write(fid,sbeg,'grid','','\n',dm.params)
-		        param_write(fid,sbeg,'random','','\n',dm.params)
-		        param_write(fid,sbeg,'oas','','\n',dm.params)
-		        param_write(fid,sbeg,'lhs','','\n',dm.params)
-		        param_write(fid,sbeg,'oa_lhs','','\n',dm.params)
-		        param_write(fid,sbeg,'box_behnken','','\n',dm.params)
-		        param_write(fid,sbeg,'central_composite','','\n',dm.params)
-		        param_write(fid,sbeg,'seed','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'fixed_seed','','\n',dm.params)
-		        param_write(fid,sbeg,'samples',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'symbols',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'quality_metrics','','\n',dm.params)
-		        param_write(fid,sbeg,'variance_based_decomp','','\n',dm.params)
-
-		elif dm.method == 'fsu_quasi_mc':
-		        if (dm.params.halton + dm.params.hammersley != 1):
-		        	raise RuntimeError('#s'' method must have one and only one sequence type.',dm.method)
-		        
-		        param_write(fid,sbeg,'halton','','\n',dm.params)
-		        param_write(fid,sbeg,'hammersley','','\n',dm.params)
-		        param_write(fid,sbeg,'samples','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'sequence_start',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'sequence_leap','  = ','\n',dm.params)
-		        param_write(fid,sbeg,'prime_base','     = ','\n',dm.params)
-		        param_write(fid,sbeg,'fixed_sequence','','\n',dm.params)
-		        param_write(fid,sbeg,'latinize','','\n',dm.params)
-		        param_write(fid,sbeg,'variance_based_decomp','','\n',dm.params)
-		        param_write(fid,sbeg,'quality_metrics','','\n',dm.params)
-
-		elif dm.method == 'fsu_cvt':
-		        param_write(fid,sbeg,'seed','       = ','\n',dm.params)
-		        param_write(fid,sbeg,'fixed_seed','','\n',dm.params)
-		        param_write(fid,sbeg,'samples','    = ','\n',dm.params)
-		        param_write(fid,sbeg,'num_trials',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'trial_type',' = ','\n',dm.params)
-		        param_write(fid,sbeg,'latinize','','\n',dm.params)
-		        param_write(fid,sbeg,'variance_based_decomp','','\n',dm.params)
-		        param_write(fid,sbeg,'quality_metrics','','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
-
-	elif dm.type == 'param':
-		param_write(fid,sbeg,'output',' ','\n',dm.params)
-		#switch dm.method
-		if dm.method == 'vector_parameter_study':
-		        if not np.logical_xor(isempty(dm.params.final_point),isempty(dm.params.step_vector)):
-		        	raise RuntimeError(str(dm.method)+' method must have one and only one specification.')
-		        
-		        if not isempty(dm.params.final_point):
-		        	param_write(fid,sbeg,'final_point',' = ','\n',dm.params)
-		        	param_write(fid,sbeg,'step_length',' = ','\n',dm.params)
-			        param_write(fid,sbeg,'num_steps','   = ','\n',dm.params)
-		        elif not isempty(dm.params.step_vector):
-		        	param_write(fid,sbeg,'step_vector',' = ','\n',dm.params)
-		        	param_write(fid,sbeg,'num_steps','   = ','\n',dm.params)
-		        
-
-		elif dm.method == 'list_parameter_study':
-		        param_write(fid,sbeg,'list_of_points',' = ','\n',dm.params)
-
-		elif dm.method == 'centered_parameter_study':
-		        param_write(fid,sbeg,'percent_delta','       = ','\n',dm.params)
-		        param_write(fid,sbeg,'deltas_per_variable',' = ','\n',dm.params)
-
-		elif dm.method == 'multidim_parameter_study':
-		        param_write(fid,sbeg,'partitions',' = ','\n',dm.params)
-
-		else:
-			raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-		
-
-	elif dm.type == 'bayes':
-		#switch dm.method
-		if dm.method == 'bayes_calibration':
-		# if (dm.params.queso + 
-		#    dm.params.dream + 
-		#	 dm.params.gpmsa ~= 1)
-		#    raise RuntimeError('''#s'' method must have one and only one bayes type. YOU SUCK',
-		#       dm.method)
-		# 
-			param_write(fid,sbeg,'queso','','\n',dm.params)
-		        param_write(fid,sbeg,'dream','','\n',dm.params)
-		        param_write(fid,sbeg,'gpmsa','','\n',dm.params)
-		        param_write(fid,sbeg,'samples','        = ','\n',dm.params)
-		        param_write(fid,sbeg,'seed','      = ','\n',dm.params)
-			param_write(fid,sbeg,'output','    =','\n',dm.params)
-			param_write(fid,sbeg,'metropolis_hastings','','\n',dm.params)
-			param_write(fid,sbeg,'proposal_covariance','','\n',dm.params)
-			param_write(fid,sbeg,'diagonal','','\n',dm.params)
-			param_write(fid,sbeg,'values','     = ','\n',dm.params)
-		
-	else:
-		raise RuntimeError('Unrecognized '+dm.type+' method: '+dm.method+'.')
-
-
-##  function to write a structure of parameters
-
-def param_struc_write(fidi,sbeg,smid,s,params):
-
-	#  loop through each parameter field in the structure
-
-	fnames=fieldnames(params)
-
-	for i in range(np.size(fnames)):
-		param_write(fidi,sbeg,fnames[i],smid,s,params)
-
-	return
-
-##  function to write a parameter
-
-def param_write(fidi,sbeg,pname,smid,s,params):
-
-	#  check for errors
-
-	if not isfield(params,pname):
-		warning('param_write:param_not_found',
-		'Parameter '+str(pname)+' not found in '+params+'.')
-		return
-	elif type(vars(params)[pname]) == bool and not vars(params)[pname]:
-		return
-	elif isempty(vars(params)[pname]):
-		print 'Warning: param_write:param_empty: Parameter '+pname+' requires input of type '+type(vars(params)[pname])+'.'
-		return
-
-
-	#  construct the parameter string based on type
-
-	if type(vars(params)[pname]) == bool:
-		fidi.write(sbeg+str(pname)+s)
-	elif type(vars(params)[pname]) in [int,float]:
-		fidi.write(sbeg+str(pname)+smid+str(vars(params)[pname])+s)
-	elif type(vars(params)[pname]) == list:
-		fidi.write(sbeg+str(pname)+smid+str(vars(params)[pname][0]))
-		for i in range(1,np.size(vars(params)[pname])):
-			fidi.write(' '+str(vars(params)[pname][i]))
-    
-		fidi.write(s)
-	elif type(vars(params)[pname]) == str:
-		fidi.write(sbeg+str(pname)+smid+str(vars(params)[pname])+s)
-	else:
-		print 'Warning: param_write:param_unrecog: Parameter '+pname+' is of unrecognized type '+type(vars(params)[pname])+'.'
-		return
-
-
-
+
+def dmeth_params_write(dm, fid, sbeg='\t  '):
+    '''  write the parameters from a dakota_method object.
+    [] = dmeth_params_write(dm, fid, sbeg)
+    '''
+
+    if not isinstance(dm, dakota_method):
+        raise RuntimeError('Object ' + str(dm) + ' is a ' + type(dm) + ' class object, not < dakota_method > .')
+
+    if sbeg is None or sbeg == '':
+        sbeg = '\t  '
+
+    #  perform some error checking, but leave the rest to dakota.
+    #  unfortunately this prevents merely looping through the fields
+    #  of the parameters structure.
+
+    #  write method - indepent controls
+
+    # param_write(fid, sbeg, 'id_method', ' = ', '\n', dm.params)
+    # param_write(fid, sbeg, 'model_pointer', ' = ', '\n', dm.params)
+
+    #  write method - depent controls
+
+    #switch dm.type
+    if dm.type == 'dot':
+        param_write(fid, sbeg, 'max_iterations', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'max_function_evaluations', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'convergence_tolerance', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'constraint_tolerance', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'output', ' ', '\n', dm.params)
+        param_write(fid, sbeg, 'speculative', '', '\n', dm.params)
+        param_write(fid, sbeg, 'scaling', '', '\n', dm.params)
+    #switch dm.method
+        if dm.method in ['dot_bfgs',
+                         'dot_frcg',
+                         'dot_mmfd',
+                         'dot_slp',
+                         'dot_sqp']:
+            param_write(fid, sbeg, 'optimization_type', ' = ', '\n', dm.params)
+
+        else:
+            raise RuntimeError('Unrecognized ' + dm.type + ' method: ' + dm.method + '.')
+
+    elif dm.type == 'npsol':
+        param_write(fid, sbeg, 'max_iterations', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'max_function_evaluations', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'convergence_tolerance', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'constraint_tolerance', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'output', ' ', '\n', dm.params)
+        param_write(fid, sbeg, 'speculative', '', '\n', dm.params)
+        param_write(fid, sbeg, 'scaling', '', '\n', dm.params)
+    #switch dm.method
+        if dm.method == 'npsol_sqp':
+            param_write(fid, sbeg, 'verify_level', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'function_precision', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'linesearch_tolerance', ' = ', '\n', dm.params)
+
+        else:
+            raise RuntimeError('Unrecognized ' + dm.type + ' method: ' + dm.method + '.')
+
+    elif dm.type == 'conmin':
+        param_write(fid, sbeg, 'max_iterations', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'max_function_evaluations', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'convergence_tolerance', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'constraint_tolerance', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'output', ' ', '\n', dm.params)
+        param_write(fid, sbeg, 'speculative', '', '\n', dm.params)
+        param_write(fid, sbeg, 'scaling', '', '\n', dm.params)
+    #switch dm.method
+        if dm.method in ['conmin_frcg', 'conmin_mfd']:
+            pass
+        else:
+            raise RuntimeError('Unrecognized ' + dm.type + ' method: ' + dm.method + '.')
+
+    elif dm.type == 'optpp':
+        param_write(fid, sbeg, 'max_iterations', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'max_function_evaluations', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'convergence_tolerance', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'output', ' ', '\n', dm.params)
+        param_write(fid, sbeg, 'speculative', '', '\n', dm.params)
+        param_write(fid, sbeg, 'scaling', '', '\n', dm.params)
+    #switch dm.method
+        if dm.method == 'optpp_cg':
+            param_write(fid, sbeg, 'max_step', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'gradient_tolerance', ' = ', '\n', dm.params)
+
+        elif dm.method in ['optpp_q_newton', 'optpp_fd_newton', 'optpp_newton']:
+            if (dm.params.value_based_line_search + dm.params.gradient_based_line_search + dm.params.trust_region + dm.params.tr_pds > 1):
+                raise RuntimeError('  #s'' method must have only one algorithm.', dm.method)
+            param_write(fid, sbeg, 'value_based_line_search', '', '\n', dm.params)
+            param_write(fid, sbeg, 'gradient_based_line_search', '', '\n', dm.params)
+            param_write(fid, sbeg, 'trust_region', '', '\n', dm.params)
+            param_write(fid, sbeg, 'tr_pds', '', '\n', dm.params)
+            param_write(fid, sbeg, 'max_step', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'gradient_tolerance', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'merit_function', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'central_path', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'steplength_to_boundary', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'centering_parameter', ' = ', '\n', dm.params)
+
+        elif dm.method == 'optpp_pds':
+            param_write(fid, sbeg, 'search_scheme_size', ' = ', '\n', dm.params)
+
+        else:
+            raise RuntimeError('Unrecognized ' + dm.type + ' method: ' + dm.method + '.')
+
+    elif dm.type == 'apps':
+        param_write(fid, sbeg, 'max_function_evaluations', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'constraint_tolerance', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'output', ' ', '\n', dm.params)
+        param_write(fid, sbeg, 'scaling', '', '\n', dm.params)
+    #switch dm.method
+        if dm.method == 'asynch_pattern_search':
+            param_write(fid, sbeg, 'initial_delta', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'threshold_delta', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'contraction_factor', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'solution_target', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'synchronization', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'merit_function', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'constraint_penalty', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'smoothing_factor', ' = ', '\n', dm.params)
+
+        else:
+            raise RuntimeError('Unrecognized ' + dm.type + ' method: ' + dm.method + '.')
+
+    elif dm.type == 'coliny':
+        param_write(fid, sbeg, 'max_iterations', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'max_function_evaluations', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'convergence_tolerance', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'output', ' ', '\n', dm.params)
+        param_write(fid, sbeg, 'scaling', '', '\n', dm.params)
+        param_write(fid, sbeg, 'show_misc_options', '', '\n', dm.params)
+        param_write(fid, sbeg, 'misc_options', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'solution_accuracy', ' = ', '\n', dm.params)
+    #switch dm.method
+        if dm.method == 'coliny_cobyla':
+            param_write(fid, sbeg, 'initial_delta', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'threshold_delta', ' = ', '\n', dm.params)
+
+        elif dm.method == 'coliny_direct':
+            param_write(fid, sbeg, 'division', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'global_balance_parameter', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'local_balance_parameter', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'max_boxsize_limit', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'min_boxsize_limit', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'constraint_penalty', ' = ', '\n', dm.params)
+
+        elif dm.method == 'coliny_ea':
+            param_write(fid, sbeg, 'seed', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'population_size', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'initialization_type', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'fitness_type', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'replacement_type', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'random', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'chc', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'elitist', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'new_solutions_generated', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'crossover_type', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'crossover_rate', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'mutation_type', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'mutation_scale', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'mutation_range', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'dimension_ratio', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'mutation_rate', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'non_adaptive', '', '\n', dm.params)
+
+        elif dm.method == 'coliny_pattern_search':
+            param_write(fid, sbeg, 'stochastic', '', '\n', dm.params)
+            param_write(fid, sbeg, 'seed', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'initial_delta', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'threshold_delta', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'constraint_penalty', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'constant_penalty', '', '\n', dm.params)
+            param_write(fid, sbeg, 'pattern_basis', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'total_pattern_size', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'no_expansion', '', '\n', dm.params)
+            param_write(fid, sbeg, 'expand_after_success', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'contraction_factor', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'synchronization', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'exploratory_moves', ' = ', '\n', dm.params)
+
+        elif dm.method == 'coliny_solis_wets':
+            param_write(fid, sbeg, 'seed', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'initial_delta', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'threshold_delta', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'no_expansion', '', '\n', dm.params)
+            param_write(fid, sbeg, 'expand_after_success', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'contract_after_failure', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'contraction_factor', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'constraint_penalty', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'constant_penalty', '', '\n', dm.params)
+
+        else:
+            raise RuntimeError('Unrecognized ' + dm.type + ' method: ' + dm.method + '.')
+
+    elif dm.type == 'ncsu':
+        param_write(fid, sbeg, 'max_iterations', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'max_function_evaluations', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'scaling', '', '\n', dm.params)
+    #switch dm.method
+        if dm.method == 'ncsu_direct':
+            param_write(fid, sbeg, 'solution_accuracy', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'min_boxsize_limit', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'vol_boxsize_limit', ' = ', '\n', dm.params)
+
+        else:
+            raise RuntimeError('Unrecognized ' + dm.type + ' method: ' + dm.method + '.')
+
+    elif dm.type == 'jega':
+        param_write(fid, sbeg, 'max_iterations', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'max_function_evaluations', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'output', ' ', '\n', dm.params)
+        param_write(fid, sbeg, 'scaling', '', '\n', dm.params)
+        param_write(fid, sbeg, 'seed', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'log_file', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'population_size', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'print_each_pop', '', '\n', dm.params)
+        param_write(fid, sbeg, 'output', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'initialization_type', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'mutation_type', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'mutation_scale', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'mutation_rate', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'replacement_type', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'below_limit', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'shrinkage_percentage', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'crossover_type', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'multi_point_binary', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'multi_point_parameterized_binary', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'multi_point_real', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'shuffle_random', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'num_parents', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'num_offspring', ' = ', '\n', dm.params)
+        param_write(fid, sbeg, 'crossover_rate', ' = ', '\n', dm.params)
+
+    #switch dm.method
+        if dm.method == 'moga':
+            param_write(fid, sbeg, 'fitness_type', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'niching_type', ' = ', '\n', dm.params)
+            if not isempty(dm.params.radial) and not isempty(dm.params.distance):
+                raise RuntimeError('  #s'' method must have only one niching distance.', dm.method)
+            param_write(fid, sbeg, 'radial', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'distance', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'metric_tracker', '', '\n', dm.params)
+            param_write(fid, sbeg, 'percent_change', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'num_generations', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'postprocessor_type', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'orthogonal_distance', ' = ', '\n', dm.params)
+
+        elif dm.method == 'soga':
+            param_write(fid, sbeg, 'fitness_type', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'constraint_penalty', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'replacement_type', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'convergence_type', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'num_generations', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'percent_change', ' = ', '\n', dm.params)
+
+        else:
+            raise RuntimeError('Unrecognized ' + dm.type + ' method: ' + dm.method + '.')
+
+    elif dm.type == 'lsq':
+        #switch dm.method
+        if dm.method == 'nl2sol':
+            param_write(fid, sbeg, 'max_iterations', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'max_function_evaluations', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'convergence_tolerance', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'output', ' ', '\n', dm.params)
+            param_write(fid, sbeg, 'scaling', '', '\n', dm.params)
+            param_write(fid, sbeg, 'function_precision', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'absolute_conv_tol', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'x_conv_tol', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'singular_conv_tol', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'singular_radius', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'false_conv_tol', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'initial_trust_radius', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'covariance', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'regression_stressbalances', '', '\n', dm.params)
+
+        elif dm.method == 'nlssol_sqp':
+            param_write(fid, sbeg, 'max_iterations', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'max_function_evaluations', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'convergence_tolerance', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'constraint_tolerance', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'output', ' ', '\n', dm.params)
+            param_write(fid, sbeg, 'speculative', '', '\n', dm.params)
+            param_write(fid, sbeg, 'scaling', '', '\n', dm.params)
+            param_write(fid, sbeg, 'verify_level', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'function_precision', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'linesearch_tolerance', ' = ', '\n', dm.params)
+
+        elif dm.method == 'optpp_g_newton':
+            param_write(fid, sbeg, 'max_iterations', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'max_function_evaluations', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'convergence_tolerance', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'output', ' ', '\n', dm.params)
+            param_write(fid, sbeg, 'speculative', '', '\n', dm.params)
+            param_write(fid, sbeg, 'scaling', '', '\n', dm.params)
+
+            if (dm.params.value_based_line_search + dm.params.gradient_based_line_search + dm.params.trust_region + dm.params.tr_pds > 1):
+                raise RuntimeError('  #s'' method must have only one algorithm.', dm.method)
+
+            param_write(fid, sbeg, 'value_based_line_search', '', '\n', dm.params)
+            param_write(fid, sbeg, 'gradient_based_line_search', '', '\n', dm.params)
+            param_write(fid, sbeg, 'trust_region', '', '\n', dm.params)
+            param_write(fid, sbeg, 'tr_pds', '', '\n', dm.params)
+            param_write(fid, sbeg, 'max_step', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'gradient_tolerance', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'merit_function', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'central_path', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'steplength_to_boundary', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'centering_parameter', ' = ', '\n', dm.params)
+
+        else:
+            raise RuntimeError('Unrecognized ' + dm.type + ' method: ' + dm.method + '.')
+
+    elif dm.type == 'nond':
+        #switch dm.method
+        if dm.method == 'nond_sampling':
+            param_write(fid, sbeg, 'seed', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'fixed_seed', '', '\n', dm.params)
+            dver = str(IssmConfig('_DAKOTA_VERSION_')[0])
+            if ((int(dver[0]) == 4 and int(dver[2]) > 2) or int(dver[0]) > 4):
+                param_write(fid, sbeg, 'rng', '                ', '\n', dm.params)
+                param_write(fid, sbeg, 'samples', ' = ', '\n', dm.params)
+                param_write(fid, sbeg, 'sample_type', '        ', '\n', dm.params)
+                param_write(fid, sbeg, 'all_variables', '', '\n', dm.params)
+                param_write(fid, sbeg, 'variance_based_decomp', '', '\n', dm.params)
+                if strcmp(dm.params.sample_type, 'incremental_random') or strcmp(dm.params.sample_type, 'incremental_lhs'):
+                    param_write(fid, sbeg, 'previous_samples', ' = ', '\n', dm.params)
+                    param_write(fid, sbeg, 'output', ' ', '\n', dm.params)
+
+        elif dm.method == 'nond_local_reliability':
+            param_write(fid, sbeg, 'max_iterations', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'convergence_tolerance', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'mpp_search', ' = ', '\n', dm.params)
+            if type(dm.params.mpp_search) == str:
+                if (dm.params.sqp + dm.params.nip > 1):
+                    raise RuntimeError('  #s'' method must have only one algorithm.', dm.method)
+
+                param_write(fid, sbeg, 'sqp', '', '\n', dm.params)
+                param_write(fid, sbeg, 'nip', '', '\n', dm.params)
+                param_write(fid, sbeg, 'integration', '   ', '\n', dm.params)
+                param_write(fid, sbeg, 'refinement', ' = ', '\n', dm.params)
+                if type(dm.params.refinement) == str:
+                    param_write(fid, sbeg, 'samples', ' = ', '\n', dm.params)
+                    param_write(fid, sbeg, 'seed', ' = ', '\n', dm.params)
+                    param_write(fid, sbeg, 'output', ' ', '\n', dm.params)
+
+        elif dm.method == 'nond_global_reliability':
+            if (dm.params.x_gaussian_process + dm.params.u_gaussian_process != 1):
+                raise RuntimeError('  #s'' method must have one and only one algorithm.', dm.method)
+
+            param_write(fid, sbeg, 'x_gaussian_process', '', '\n', dm.params)
+            param_write(fid, sbeg, 'u_gaussian_process', '', '\n', dm.params)
+            param_write(fid, sbeg, 'all_variables', '', '\n', dm.params)
+            param_write(fid, sbeg, 'seed', ' = ', '\n', dm.params)
+
+        elif dm.method == 'nond_polynomial_chaos':
+            param_write(fid, sbeg, 'expansion_order', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'expansion_terms', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'quadrature_order', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'sparse_grid_level', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'expansion_samples', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'incremental_lhs', '', '\n', dm.params)
+            param_write(fid, sbeg, 'collocation_points', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'collocation_ratio', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'reuse_samples', '', '\n', dm.params)
+            param_write(fid, sbeg, 'expansion_import_file', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'seed', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'fixed_seed', '', '\n', dm.params)
+            param_write(fid, sbeg, 'samples', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'sample_type', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'all_variables', '', '\n', dm.params)
+
+        elif dm.method == 'nond_stoch_collocation':
+            param_write(fid, sbeg, 'quadrature_order', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'sparse_grid_level', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'seed', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'fixed_seed', '', '\n', dm.params)
+            param_write(fid, sbeg, 'samples', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'sample_type', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'all_variables', '', '\n', dm.params)
+
+        elif dm.method == 'nond_evidence':
+            param_write(fid, sbeg, 'seed', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'samples', ' = ', '\n', dm.params)
+
+        else:
+            raise RuntimeError('Unrecognized ' + dm.type + ' method: ' + dm.method + '.')
+
+    elif dm.type == 'dace':
+        #switch dm.method
+        if dm.method == 'dace':
+            if (dm.params.grid + dm.params.random + dm.params.oas + dm.params.lhs + dm.params.oa_lhs + dm.params.box_behnken + dm.params.central_composite != 1):
+                raise RuntimeError('  #s'' method must have one and only one algorithm.', dm.method)
+
+            param_write(fid, sbeg, 'grid', '', '\n', dm.params)
+            param_write(fid, sbeg, 'random', '', '\n', dm.params)
+            param_write(fid, sbeg, 'oas', '', '\n', dm.params)
+            param_write(fid, sbeg, 'lhs', '', '\n', dm.params)
+            param_write(fid, sbeg, 'oa_lhs', '', '\n', dm.params)
+            param_write(fid, sbeg, 'box_behnken', '', '\n', dm.params)
+            param_write(fid, sbeg, 'central_composite', '', '\n', dm.params)
+            param_write(fid, sbeg, 'seed', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'fixed_seed', '', '\n', dm.params)
+            param_write(fid, sbeg, 'samples', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'symbols', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'quality_metrics', '', '\n', dm.params)
+            param_write(fid, sbeg, 'variance_based_decomp', '', '\n', dm.params)
+
+        elif dm.method == 'fsu_quasi_mc':
+            if (dm.params.halton + dm.params.hammersley != 1):
+                raise RuntimeError('  #s'' method must have one and only one sequence type.', dm.method)
+
+            param_write(fid, sbeg, 'halton', '', '\n', dm.params)
+            param_write(fid, sbeg, 'hammersley', '', '\n', dm.params)
+            param_write(fid, sbeg, 'samples', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'sequence_start', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'sequence_leap', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'prime_base', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'fixed_sequence', '', '\n', dm.params)
+            param_write(fid, sbeg, 'latinize', '', '\n', dm.params)
+            param_write(fid, sbeg, 'variance_based_decomp', '', '\n', dm.params)
+            param_write(fid, sbeg, 'quality_metrics', '', '\n', dm.params)
+
+        elif dm.method == 'fsu_cvt':
+            param_write(fid, sbeg, 'seed', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'fixed_seed', '', '\n', dm.params)
+            param_write(fid, sbeg, 'samples', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'num_trials', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'trial_type', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'latinize', '', '\n', dm.params)
+            param_write(fid, sbeg, 'variance_based_decomp', '', '\n', dm.params)
+            param_write(fid, sbeg, 'quality_metrics', '', '\n', dm.params)
+
+        else:
+            raise RuntimeError('Unrecognized ' + dm.type + ' method: ' + dm.method + '.')
+
+    elif dm.type == 'param':
+        param_write(fid, sbeg, 'output', ' ', '\n', dm.params)
+    #switch dm.method
+        if dm.method == 'vector_parameter_study':
+            if not np.logical_xor(isempty(dm.params.final_point), isempty(dm.params.step_vector)):
+                raise RuntimeError(str(dm.method) + ' method must have one and only one specification.')
+
+            if not isempty(dm.params.final_point):
+                param_write(fid, sbeg, 'final_point', ' = ', '\n', dm.params)
+                param_write(fid, sbeg, 'step_length', ' = ', '\n', dm.params)
+                param_write(fid, sbeg, 'num_steps', ' = ', '\n', dm.params)
+
+            elif not isempty(dm.params.step_vector):
+                param_write(fid, sbeg, 'step_vector', ' = ', '\n', dm.params)
+                param_write(fid, sbeg, 'num_steps', ' = ', '\n', dm.params)
+
+        elif dm.method == 'list_parameter_study':
+            param_write(fid, sbeg, 'list_of_points', ' = ', '\n', dm.params)
+
+        elif dm.method == 'centered_parameter_study':
+            param_write(fid, sbeg, 'percent_delta', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'deltas_per_variable', ' = ', '\n', dm.params)
+
+        elif dm.method == 'multidim_parameter_study':
+            param_write(fid, sbeg, 'partitions', ' = ', '\n', dm.params)
+
+        else:
+            raise RuntimeError('Unrecognized ' + dm.type + ' method: ' + dm.method + '.')
+
+    elif dm.type == 'bayes':
+        #switch dm.method
+        if dm.method == 'bayes_calibration':
+            # if (dm.params.queso +
+            #    dm.params.dream +
+            #     dm.params.gpmsa ~= 1)
+            #    raise RuntimeError('''  #s'' method must have one and only one bayes type. YOU SUCK',
+            #       dm.method)
+            #
+            param_write(fid, sbeg, 'queso', '', '\n', dm.params)
+            param_write(fid, sbeg, 'dream', '', '\n', dm.params)
+            param_write(fid, sbeg, 'gpmsa', '', '\n', dm.params)
+            param_write(fid, sbeg, 'samples', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'seed', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'output', ' = ', '\n', dm.params)
+            param_write(fid, sbeg, 'metropolis_hastings', '', '\n', dm.params)
+            param_write(fid, sbeg, 'proposal_covariance', '', '\n', dm.params)
+            param_write(fid, sbeg, 'diagonal', '', '\n', dm.params)
+            param_write(fid, sbeg, 'values', ' = ', '\n', dm.params)
+
+    else:
+        raise RuntimeError('Unrecognized ' + dm.type + ' method: ' + dm.method + '.')
+
+
+#  function to write a structure of parameters
+def param_struc_write(fidi, sbeg, smid, s, params):
+    #  loop through each parameter field in the structure
+    fnames = fieldnames(params)
+    for i in range(np.size(fnames)):
+        param_write(fidi, sbeg, fnames[i], smid, s, params)
+
+    return
+
+
+#  function to write a parameter
+def param_write(fidi, sbeg, pname, smid, s, params):
+    #  check for errors
+    if not isfield(params, pname):
+        warning('param_write:param_not_found', 'Parameter ' + str(pname) + ' not found in ' + params + '.')
+        return
+    elif type(vars(params)[pname]) == bool and not vars(params)[pname]:
+        return
+    elif isempty(vars(params)[pname]):
+        print('Warning: param_write:param_empty: Parameter {} requires input of type {}.'.format(pname, type(vars(params)[pname])))
+        return
+
+    #  construct the parameter string based on type
+    if type(vars(params)[pname]) == bool:
+        fidi.write(sbeg + str(pname) + s)
+
+    elif type(vars(params)[pname]) in [int, float]:
+        fidi.write(sbeg + str(pname) + smid + str(vars(params)[pname]) + s)
+
+    elif type(vars(params)[pname]) == list:
+        fidi.write(sbeg + str(pname) + smid + str(vars(params)[pname][0]))
+        for i in range(1, np.size(vars(params)[pname])):
+            fidi.write(' ' + str(vars(params)[pname][i]))
+
+        fidi.write(s)
+
+    elif type(vars(params)[pname]) == str:
+        fidi.write(sbeg + str(pname) + smid + str(vars(params)[pname]) + s)
+
+    else:
+        print('Warning: param_write:param_unrecog: Parameter {} is of unrecognized type {}.'.format(pname, type(vars(params)[pname])))
+        return
Index: /issm/trunk/src/m/classes/qmu/calibration_function.py
===================================================================
--- /issm/trunk/src/m/classes/qmu/calibration_function.py	(revision 24312)
+++ /issm/trunk/src/m/classes/qmu/calibration_function.py	(revision 24313)
@@ -3,10 +3,11 @@
 from MatlabArray import *
 
+
 class calibration_function(object):
-	'''
+    '''
   definition for the calibration_function class.
 
   [cf] = calibration_function.calibration_function(args)
-   cf  = calibration_function()
+   cf = calibration_function()
 
   where the required args are:
@@ -21,123 +22,120 @@
   arguments constructs a new instance from the arguments.
 '''
-	def __init__(self):
-		self.descriptor = ''
-		self.scale_type = 'none'
-		self.scale      = 1.
-		self.weight     = 1.
+    def __init__(self):
+        self.descriptor = ''
+        self.scale_type = 'none'
+        self.scale = 1.
+        self.weight = 1.
 
-	@staticmethod
-	def calibration_function(*args):
-		nargin = len(args)
+    @staticmethod
+    def calibration_function(*args):
+        nargin = len(args)
 
-		# create a default object
-		if nargin == 0:
-			return calibration_function()
+    # create a default object
+        if nargin == 0:
+            return calibration_function()
 
-		# copy the object or create the object from the input
-		else:
-			if (nargin == 1) and isinstance(args[0],calibration_function):
-				cf = args[0]
-			else:
-				asizec = array_size(*args[0:min(nargin,4)])
-				cf = [calibration_function() for i in range(asizec[0]) for j in range(asizec[1])]
-								
-			for i in range(np.size(cf)):
-				if (np.size(args[0]) > 1):
-					cf[i].descriptor = args[0][i]
-				else:
-					cf[i].descriptor = str(args[0])+string_dim(cf,i,'vector')
+    # copy the object or create the object from the input
+        else:
+            if (nargin == 1) and isinstance(args[0], calibration_function):
+                cf = args[0]
+            else:
+                asizec = array_size(*args[0:min(nargin, 4)])
+                cf = [calibration_function() for i in range(asizec[0]) for j in range(asizec[1])]
 
-			if nargin >= 2:
-				for i in range(np.size(cf)):
-					cf[i].scale_type = str(args[1])
-			if nargin >= 3:
-				for i in range(np.size(cf)):
-					cf[i].scale = args[2]
-			if nargin >= 4:
-				for i in range(np.size(cf)):
-					cf[i].weight = args[3]
-			if nargin > 4:
-				print 'WARNING: calibration_function:extra_arg: Extra arguments for object of class '+str(type(cf))+'.'		
+            for i in range(np.size(cf)):
+                if (np.size(args[0]) > 1):
+                    cf[i].descriptor = args[0][i]
+                else:
+                    cf[i].descriptor = str(args[0]) + string_dim(cf, i, 'vector')
 
-		return cf
+            if nargin >= 2:
+                for i in range(np.size(cf)):
+                    cf[i].scale_type = str(args[1])
+            if nargin >= 3:
+                for i in range(np.size(cf)):
+                    cf[i].scale = args[2]
+            if nargin >= 4:
+                for i in range(np.size(cf)):
+                    cf[i].weight = args[3]
+            if nargin > 4:
+                print('WARNING: calibration_function:extra_arg: Extra arguments for object of class ' + str(type(cf)) + '.')
 
-	def __repr__(self):
-		# display the object
-		string = '\n'
-		string += 'class "calibration_function" object = \n'
-		string += '    descriptor: '+str(self.descriptor) + '\n'
-		string += '    scale_type: '+str(self.scale_type) + '\n'
-		string += '         scale: '+str(self.scale) + '\n'
-		string += '        weight: '+str(self.weight) + '\n'
+        return cf
 
-		return string
+    def __repr__(self):
+        # display the object
+        string = '\n'
+        string += 'class "calibration_function" object = \n'
+        string += '    descriptor: ' + str(self.descriptor) + '\n'
+        string += '    scale_type: ' + str(self.scale_type) + '\n'
+        string += '         scale: ' + str(self.scale) + '\n'
+        string += '        weight: ' + str(self.weight) + '\n'
+        return string
 
-	# from here on, cf is either a single, or a 1d vector of, calibration_function
+    # from here on, cf is either a single, or a 1d vector of, calibration_function
+    @staticmethod
+    def prop_desc(cf, dstr):
+        if type(cf) not in [list, np.ndarray]:
+            if cf.descriptor != '' or type(cf.descriptor) != str:
+                desc = str(cf.descriptor)
+            elif dstr != '':
+                desc = str(dstr)
+            else:
+                desc = 'cf'
+            return desc
 
-    	@staticmethod
-        def prop_desc(cf,dstr):
-		if type(cf) not in [list,np.ndarray]:
-			if cf.descriptor != '' or type(cf.descriptor) != str:
-				desc = str(cf.descriptor)
-			elif dstr != '':
-				desc = str(dstr)
-			else:
-				desc = 'cf'
-			return desc
+        desc = ['' for i in range(np.size(cf))]
+        for i in range(np.size(cf)):
+            if cf[i].descriptor != '' or type(cf[i].descriptor) != str:
+                desc[i] = str(cf[i].descriptor)
+            elif dstr != '':
+                desc[i] = str(dstr) + str(string_dim(cf, i, 'vector'))
+            else:
+                desc[i] = 'cf' + str(string_dim(cf, i, 'vector'))
 
-		desc = ['' for i in range(np.size(cf))]
-		for i in range(np.size(cf)):
-			if cf[i].descriptor != '' or type(cf[i].descriptor) != str:
-				desc[i] = str(cf[i].descriptor)
-			elif dstr != '':
-				desc[i] = str(dstr)+str(string_dim(cf,i,'vector'))
-			else:
-				desc[i] = 'cf'+str(string_dim(cf,i,'vector'))
-                
-		desc = allempty(desc)
+        desc = allempty(desc)
+        return desc
 
-		return desc
+    @staticmethod
+    def prop_stype(cf):
+        stype = ''
+        return stype
 
-    	@staticmethod	
-	def prop_stype(cf):
-		stype=''
-		return stype
+    @staticmethod
+    def prop_weight(cf):
+        weight = []
+        return weight
 
-    	@staticmethod
-	def prop_weight(cf):
-		weight=[]
-		return weight
+    @staticmethod
+    def prop_lower(cf):
+        lower = []
+        return lower
 
-    	@staticmethod
-	def prop_lower(cf):
-		lower=[]
-		return lower
+    @staticmethod
+    def prop_upper(cf):
+        upper = []
+        return upper
 
-    	@staticmethod
-	def prop_upper(cf):
-		upper=[]
-		return upper
+    @staticmethod
+    def prop_target(cf):
+        target = []
+        return target
 
-    	@staticmethod
-	def prop_target(cf):
-		target=[]
-		return target
+    @staticmethod
+    def prop_scale(cf):
+        scale = []
+        return scale
 
-    	@staticmethod
-	def prop_scale(cf):
-		scale=[]
-		return scale
+    @staticmethod
+    def dakota_write(fidi, dresp, rdesc):
+        # collect only the responses of the appropriate class
+        cf = [struc_class(i, 'calibration_function', 'cf') for i in dresp]
 
-    	@staticmethod
-        def dakota_write(fidi,dresp,rdesc):
-		# collect only the responses of the appropriate class
-		cf = [struc_class(i,'calibration_function','cf') for i in dresp]
+        # write responses
+        rdesc = rlist_write(fidi, 'calibration_terms', 'calibration_function', cf, rdesc)
+        return rdesc
 
-		# write responses
-		rdesc = rlist_write(fidi,'calibration_terms','calibration_function',cf,rdesc)
-		return rdesc
-
-    	@staticmethod
-	def dakota_rlev_write(fidi,dresp,params):
-		return
+    @staticmethod
+    def dakota_rlev_write(fidi, dresp, params):
+        return
Index: /issm/trunk/src/m/classes/qmu/continuous_design.py
===================================================================
--- /issm/trunk/src/m/classes/qmu/continuous_design.py	(revision 24312)
+++ /issm/trunk/src/m/classes/qmu/continuous_design.py	(revision 24313)
@@ -3,10 +3,11 @@
 from MatlabArray import *
 
+
 class continuous_design(object):
-	'''
+    '''
   definition for the continuous_design class.
 
   [cdv] = continuous_design.continuous_design(args)
-   cdv  = continuous_design()
+   cdv = continuous_design()
 
   where the required args are:
@@ -15,5 +16,5 @@
   and the optional args and defaults are:
     lower         (double, lower bound, -Inf)
-    upper         (double, upper bound,  Inf)
+    upper         (double, upper bound, Inf)
     scale_type    (char, scaling type, 'none')
     scale         (double, scaling factor, 1.)
@@ -24,208 +25,205 @@
 '''
 
-	def __init__(self):
-		self.descriptor = ''
-		self.initpt     =  0.
-		self.lower      = -np.inf
-		self.upper      =  np.inf
-		self.scale_type = 'none'
-		self.scale      =  1.
-	
-	@staticmethod
-	def continuous_design(*args):
-		nargin = len(args)
-
-		#  create a default object
-		if nargin == 0:
-			return continuous_design()
-
-		#  copy the object
-		if nargin == 1:
-			if isinstance(args[0],continuous_design):
-				cdv = args[0]
-			else:
-				raise RuntimeError('Object is a '+str(type(args[0]))+' class object, not "continuous_design".')
-					
-		#  create the object from the input
-		else:
-			shapec = array_size(*args[0:min(nargin,6)])
-			cdv = [continuous_design() for i in range(shapec[0]) for j in range(shapec[1])]	
-			# in case cdv doesn't use array-like args			
-			#cdv = continuous_design()
-
-			for i in range(np.size(cdv)):
-				if (np.size(args[0]) > 1):
-					cdv[i].descriptor = args[0][i]
-				else:
-					cdv[i].descriptor = str(args[0])+string_dim(cdv,i,'vector')
-
-			if (nargin >= 2):
-				for i in range(np.size(cdv)):
-					if (np.size(args[1]) > 1):
-						cdv[i].initpt    = args[1][i]
-					else:
-						cdv[i].initpt    = args[1]
-
-			if (nargin >= 3):
-				for i in range(np.size(cdv)):
-					if (np.size(args[2]) > 1):
-						cdv[i].lower     = args[2][i]
-					else:
-						cdv[i].lower     = args[2]
-									
-			if (nargin >= 4):
-				for i in range(np.size(cdv)):
-					if (np.size(args[3]) > 1):
-						cdv[i].upper     = args[3][i]
-					else:
-						cdv[i].upper     = args[3]
-												
-			if (nargin >= 5):
-				for i in range(np.size(cdv)):
-					if (np.size(args[4]) > 1):
-						cdv[i].scale_type = args[4][i]
-					else:
-						cdv[i].scale_type = str(args[4])
-														
-			if (nargin >= 6):
-				for i in range(np.size(cdv)):
-					if (np.size(args[5]) > 1):
-						cdv[i].scale     = args[5][i]
-					else:
-						cdv[i].scale     = args[5]
-
-			if (nargin > 6):
-				print 'WARNING: continuous_design:extra_arg: Extra arguments for object of class '+str(type(cdv))+'.'
-
-		return cdv
-										
-
-	def __repr__(self):
-		#  display the object
-		string = '\n'
-		string += 'class "continuous_design" object = \n'
-		string += '    descriptor: ' +str(self.descriptor) + '\n'
-		string += '        initpt: ' +str(self.initpt) + '\n'
-		string += '         lower: ' +str(self.lower) + '\n'
-		string += '         upper: ' +str(self.upper) + '\n'
-		string += '    scale_type: ' +str(self.scale_type) + '\n'
-		string += '         scale: ' +str(self.scale) + '\n'
-
-		return string
-
-	@staticmethod
-	def prop_desc(cdv,dstr):
-		if type(cdv) not in [list,np.ndarray]:
-			cdv = [cdv]
-			# in case cdv doesn't use array-like args
-			#if cdv.descriptor != '' or type(cdv.descriptor) != str:
-				#desc = str(cdv.descriptor)
-			#elif dstr != '':
-				#desc = str(dstr)
-			#else:
-				#desc = 'cdv'
-			#return desc
-
-		desc = ['' for i in range(np.size(cdv))]
-		for i in range(np.size(cdv)):
-			if cdv[i].descriptor != '' or type(cdv[i].descriptor) != str:
-				desc[i] = str(cdv[i].descriptor)
-			elif dstr != '':
-				desc[i] = str(dstr)+str(string_dim(cdv,i,'vector'))
-			else:
-				desc[i] = 'cdv'+str(string_dim(cdv,i,'vector'))
-			
-		desc = allempty(desc)
-
-		return desc
-
-	@staticmethod	
-	def prop_initpt(cdv):
-		if type(cdv) not in [list,np.ndarray]:
-			return cdv.initpt
-
-		initpt = np.zeros(np.size(cdv))
-		for i in range(np.size(cdv)):
-			initpt[i] = cdv[i].initpt
-			
-		initpt = allequal(initpt,0.)
-
-		return initpt
-
-	@staticmethod
-	def prop_lower(cdv):
-		if type(cdv) not in [list,np.ndarray]:
-			return cdv.lower
-
-		lower = np.zeros(np.size(cdv))
-		for i in range(np.size(cdv)):
-			lower[i] = cdv[i].lower
-			
-		lower = allequal(lower,-np.inf)
-
-		return lower
-
-	@staticmethod	
-	def prop_upper(cdv):
-		if type(cdv) not in [list,np.ndarray]:
-			return cdv.upper
-
-		upper = np.zeros(np.size(cdv))
-		for i in range(np.size(cdv)):
-			upper[i] = cdv[i].upper
-
-		upper = allequal(upper, np.inf)
-
-		return upper
-
-	@staticmethod	
-	def prop_mean(cdv):
-		mean=[]
-		return mean
-
-	@staticmethod	
-	def prop_stddev(cdv):
-		stddev=[]
-		return sttdev
-
-	@staticmethod	
-	def prop_initst(cdv):
-		initst=[]
-		return initst
-
-	@staticmethod	
-	def prop_stype(cdv):
-		if type(cdv) not in [list,np.ndarray]:
-			return str(cdv.scale_type)
-
-		stype = np.empty(np.size(cdv))
-		stype.fill(0.0)
-		for i in range(np.size(cdv)):
-			stype[i] = str(cdv[i].scale_type)
-			
-		stype = allequal(stype,'none')
-
-		return stype
-
-	@staticmethod		
-	def prop_scale(cdv):
-		if type(cdv) not in [list,np.ndarray]:
-			return cdv.scale
-
-		scale = np.zeros(np.size(cdv))
-		for i in range(np.size(cdv)):
-			scale[i] = cdv[i].scale
-			
-		scale = allequal(scale,1.)
-
-		return scale
-	
-
-	@staticmethod
-	def dakota_write(fidi,dvar):
-		#  collect only the variables of the appropriate class
-		cdv = [struc_class(i,'continuous_design','cdv') for i in dvar]
-
-		#  write variables
-		vlist_write(fidi,'continuous_design','cdv',cdv)
-
+    def __init__(self):
+        self.descriptor = ''
+        self.initpt = 0.
+        self.lower = -np.inf
+        self.upper = np.inf
+        self.scale_type = 'none'
+        self.scale = 1.
+
+    @staticmethod
+    def continuous_design(*args):
+        nargin = len(args)
+
+    #  create a default object
+        if nargin == 0:
+            return continuous_design()
+
+    #  copy the object
+        if nargin == 1:
+            if isinstance(args[0], continuous_design):
+                cdv = args[0]
+            else:
+                raise RuntimeError('Object is a ' + str(type(args[0])) + ' class object, not "continuous_design".')
+
+    #  create the object from the input
+        else:
+            shapec = array_size(*args[0:min(nargin, 6)])
+            cdv = [continuous_design() for i in range(shapec[0]) for j in range(shapec[1])]
+    # in case cdv doesn't use array - like args
+    #cdv = continuous_design()
+
+            for i in range(np.size(cdv)):
+                if (np.size(args[0]) > 1):
+                    cdv[i].descriptor = args[0][i]
+                else:
+                    cdv[i].descriptor = str(args[0]) + string_dim(cdv, i, 'vector')
+
+            if (nargin >= 2):
+                for i in range(np.size(cdv)):
+                    if (np.size(args[1]) > 1):
+                        cdv[i].initpt = args[1][i]
+                    else:
+                        cdv[i].initpt = args[1]
+
+            if (nargin >= 3):
+                for i in range(np.size(cdv)):
+                    if (np.size(args[2]) > 1):
+                        cdv[i].lower = args[2][i]
+                    else:
+                        cdv[i].lower = args[2]
+
+            if (nargin >= 4):
+                for i in range(np.size(cdv)):
+                    if (np.size(args[3]) > 1):
+                        cdv[i].upper = args[3][i]
+                    else:
+                        cdv[i].upper = args[3]
+
+            if (nargin >= 5):
+                for i in range(np.size(cdv)):
+                    if (np.size(args[4]) > 1):
+                        cdv[i].scale_type = args[4][i]
+                    else:
+                        cdv[i].scale_type = str(args[4])
+
+            if (nargin >= 6):
+                for i in range(np.size(cdv)):
+                    if (np.size(args[5]) > 1):
+                        cdv[i].scale = args[5][i]
+                    else:
+                        cdv[i].scale = args[5]
+
+            if (nargin > 6):
+                print('WARNING: continuous_design:extra_arg: Extra arguments for object of class ' + str(type(cdv)) + '.')
+
+        return cdv
+
+    def __repr__(self):
+        #  display the object
+        string = '\n'
+        string += 'class "continuous_design" object = \n'
+        string += '    descriptor: ' + str(self.descriptor) + '\n'
+        string += '        initpt: ' + str(self.initpt) + '\n'
+        string += '         lower: ' + str(self.lower) + '\n'
+        string += '         upper: ' + str(self.upper) + '\n'
+        string += '    scale_type: ' + str(self.scale_type) + '\n'
+        string += '         scale: ' + str(self.scale) + '\n'
+
+        return string
+
+    @staticmethod
+    def prop_desc(cdv, dstr):
+        if type(cdv) not in [list, np.ndarray]:
+            cdv = [cdv]
+    # in case cdv doesn't use array - like args
+    #if cdv.descriptor != '' or type(cdv.descriptor) != str:
+    #desc = str(cdv.descriptor)
+    #elif dstr != '':
+    #desc = str(dstr)
+    #else:
+    #desc = 'cdv'
+    #return desc
+
+        desc = ['' for i in range(np.size(cdv))]
+        for i in range(np.size(cdv)):
+            if cdv[i].descriptor != '' or type(cdv[i].descriptor) != str:
+                desc[i] = str(cdv[i].descriptor)
+            elif dstr != '':
+                desc[i] = str(dstr) + str(string_dim(cdv, i, 'vector'))
+            else:
+                desc[i] = 'cdv' + str(string_dim(cdv, i, 'vector'))
+
+        desc = allempty(desc)
+
+        return desc
+
+    @staticmethod
+    def prop_initpt(cdv):
+        if type(cdv) not in [list, np.ndarray]:
+            return cdv.initpt
+
+        initpt = np.zeros(np.size(cdv))
+        for i in range(np.size(cdv)):
+            initpt[i] = cdv[i].initpt
+
+        initpt = allequal(initpt, 0.)
+
+        return initpt
+
+    @staticmethod
+    def prop_lower(cdv):
+        if type(cdv) not in [list, np.ndarray]:
+            return cdv.lower
+
+        lower = np.zeros(np.size(cdv))
+        for i in range(np.size(cdv)):
+            lower[i] = cdv[i].lower
+
+        lower = allequal(lower, -np.inf)
+
+        return lower
+
+    @staticmethod
+    def prop_upper(cdv):
+        if type(cdv) not in [list, np.ndarray]:
+            return cdv.upper
+
+        upper = np.zeros(np.size(cdv))
+        for i in range(np.size(cdv)):
+            upper[i] = cdv[i].upper
+
+        upper = allequal(upper, np.inf)
+
+        return upper
+
+    @staticmethod
+    def prop_mean(cdv):
+        mean = []
+        return mean
+
+    @staticmethod
+    def prop_stddev(cdv):
+        stddev = []
+        return stddev
+
+    @staticmethod
+    def prop_initst(cdv):
+        initst = []
+        return initst
+
+    @staticmethod
+    def prop_stype(cdv):
+        if type(cdv) not in [list, np.ndarray]:
+            return str(cdv.scale_type)
+
+        stype = np.empty(np.size(cdv))
+        stype.fill(0.0)
+        for i in range(np.size(cdv)):
+            stype[i] = str(cdv[i].scale_type)
+
+        stype = allequal(stype, 'none')
+
+        return stype
+
+    @staticmethod
+    def prop_scale(cdv):
+        if type(cdv) not in [list, np.ndarray]:
+            return cdv.scale
+
+        scale = np.zeros(np.size(cdv))
+        for i in range(np.size(cdv)):
+            scale[i] = cdv[i].scale
+
+        scale = allequal(scale, 1.)
+
+        return scale
+
+    @staticmethod
+    def dakota_write(fidi, dvar):
+        #  collect only the variables of the appropriate class
+        cdv = [struc_class(i, 'continuous_design', 'cdv') for i in dvar]
+
+    #  write variables
+        vlist_write(fidi, 'continuous_design', 'cdv', cdv)
Index: /issm/trunk/src/m/classes/qmu/continuous_state.py
===================================================================
--- /issm/trunk/src/m/classes/qmu/continuous_state.py	(revision 24312)
+++ /issm/trunk/src/m/classes/qmu/continuous_state.py	(revision 24313)
@@ -3,10 +3,11 @@
 from MatlabArray import *
 
+
 class continuous_state(object):
-	'''
+    '''
   definition for the continuous_state class.
 
   [csv] = continuous_state.continuous_state(args)
-   csv  = continuous_state()
+   csv = continuous_state()
 
   where the required args are:
@@ -15,5 +16,5 @@
   and the optional args and defaults are:
     lower         (double, lower bound, -Inf)
-    upper         (double, upper bound,  Inf)
+    upper         (double, upper bound, Inf)
 
   note that zero arguments constructs a default instance, one
@@ -22,161 +23,160 @@
 '''
 
-	def __init__(self):
-		self.descriptor = ''
-		self.initst     =  0.
-		self.lower      = -np.inf
-		self.upper      =  np.inf
-	
-	@staticmethod
-	def continuous_state(*args):
-		nargin = len(args)
+    def __init__(self):
+        self.descriptor = ''
+        self.initst = 0.
+        self.lower = -np.inf
+        self.upper = np.inf
 
-		#  create a default object
-		if nargin == 0:
-			return continuous_state()
+    @staticmethod
+    def continuous_state(*args):
+        nargin = len(args)
 
-		#  copy the object
-		if nargin == 1:
-			if isinstance(args[0],continuous_state):
-				csv = args[0]
-			else:
-				raise RuntimeError('Object is a '+str(type(args[0]))+' class object, not "continuous_state".')
-					
-		#  create the object from the input
-		else:
-			shapec = np.shape(*args[0:min(nargin,4)])
-			csv = [continuous_state() for i in range(shapec[0]) for j in range(shapec[1])]
-					
-			for i in range(np.size(csv)):
-				if (np.size(args[0]) > 1):
-					csv[i].descriptor        = args[0][i]
-				else:
-					csv[i].descriptor        = str(args[0])+string_dim(csv,i,'vector')
+        #  create a default object
+        if nargin == 0:
+            return continuous_state()
 
-			if (nargin >= 2):
-				for i in range(np.size(csv)):
-					if (np.size(args[1]) > 1):
-						csv[i].initst    = args[1][i]
-					else:
-						csv[i].initst    = args[1]
+        #  copy the object
+        if nargin == 1:
+            if isinstance(args[0], continuous_state):
+                csv = args[0]
+            else:
+                raise RuntimeError('Object is a ' + str(type(args[0])) + ' class object, not "continuous_state".')
 
-			if (nargin >= 3):
-				for i in range(np.size(csv)):
-					if (np.size(args[2]) > 1):
-						csv[i].lower     = args[2][i]
-					else:
-						csv[i].lower     = args[2]
-	
-			if (nargin >= 4):
-				for i in range(np.size(csv)):
-					if (np.size(args[3]) > 1):
-						csv[i].upper     = args[3][i]
-					else:
-						csv[i].upper     = args[3]
+        #  create the object from the input
+        else:
+            shapec = np.shape(*args[0:min(nargin, 4)])
+            csv = [continuous_state() for i in range(shapec[0]) for j in range(shapec[1])]
 
-			if (nargin > 4):
-				print 'continuous_state:extra_arg','Extra arguments for object of class '+str(type(csv))+'.'
+            for i in range(np.size(csv)):
+                if (np.size(args[0]) > 1):
+                    csv[i].descriptor = args[0][i]
+                else:
+                    csv[i].descriptor = str(args[0]) + string_dim(csv, i, 'vector')
 
-		return csv
-										
-	def __repr__(self):
-		#  display the object
-		string = '\n'
-		string += 'class "continuous_state" object = \n'
-		string += '    descriptor: ' +str(self.descriptor) + '\n'
-		string += '        initst: ' +str(self.initst) + '\n'
-		string += '         lower: ' +str(self.lower) + '\n'
-		string += '         upper: ' +str(self.upper) + '\n'
+            if (nargin >= 2):
+                for i in range(np.size(csv)):
+                    if (np.size(args[1]) > 1):
+                        csv[i].initst = args[1][i]
+                    else:
+                        csv[i].initst = args[1]
 
-		return string
+            if (nargin >= 3):
+                for i in range(np.size(csv)):
+                    if (np.size(args[2]) > 1):
+                        csv[i].lower = args[2][i]
+                    else:
+                        csv[i].lower = args[2]
 
-	@staticmethod
-	def prop_desc(csv,dstr):
-		if type(csv) not in [list,np.ndarray]:
-			csv = [csv]
+            if (nargin >= 4):
+                for i in range(np.size(csv)):
+                    if (np.size(args[3]) > 1):
+                        csv[i].upper = args[3][i]
+                    else:
+                        csv[i].upper = args[3]
 
-		desc = ['' for i in range(np.size(csv))]
-		for i in range(np.size(csv)):
-			if csv[i].descriptor != '' or type(cdv[i].descriptor) != str:
-				desc[i] = str(csv[i].descriptor)
-			elif dstr != '':
-				desc[i] = str(dstr)+str(string_dim(csv,i,'vector'))
-			else:
-				desc[i] = 'csv'+str(string_dim(csv,i,'vector'))
-			
-		desc = allempty(desc)
+            if (nargin > 4):
+                print('continuous_state:extra_arg', 'Extra arguments for object of class ' + str(type(csv)) + '.')
 
-		return desc
+        return csv
 
-	@staticmethod	
-	def prop_initpt(csv):
-		initpt=[]
-		return initpt
+    def __repr__(self):
+        #  display the object
+        string = '\n'
+        string += 'class "continuous_state" object = \n'
+        string += '    descriptor: ' + str(self.descriptor) + '\n'
+        string += '        initst: ' + str(self.initst) + '\n'
+        string += '         lower: ' + str(self.lower) + '\n'
+        string += '         upper: ' + str(self.upper) + '\n'
 
-	@staticmethod
-	def prop_lower(csv):
-		if type(csv) not in [list,np.ndarray]:
-			return csv.lower
+        return string
 
-		lower = np.zeros(np.size(csv))
-		for i in range(np.size(csv)):
-			lower[i] = csv[i].lower
-			
-		lower = allequal(lower,-np.inf)
+    @staticmethod
+    def prop_desc(csv, dstr):
+        if type(csv) not in [list, np.ndarray]:
+            csv = [csv]
 
-		return lower
+        desc = ['' for i in range(np.size(csv))]
+        for i in range(np.size(csv)):
+            if csv[i].descriptor != '' or type(cdv[i].descriptor) != str:
+                desc[i] = str(csv[i].descriptor)
+            elif dstr != '':
+                desc[i] = str(dstr) + str(string_dim(csv, i, 'vector'))
+            else:
+                desc[i] = 'csv' + str(string_dim(csv, i, 'vector'))
 
-	@staticmethod	
-	def prop_upper(csv):
-		if type(csv) not in [list,np.ndarray]:
-			return csv.upper
+        desc = allempty(desc)
 
-		upper = np.zeros(np.size(csv))
-		for i in range(np.size(csv)):
-			upper[i] = csv[i].upper
+        return desc
 
-		upper = allequal(upper, np.inf)
+    @staticmethod
+    def prop_initpt(csv):
+        initpt = []
+        return initpt
 
-		return upper
+    @staticmethod
+    def prop_lower(csv):
+        if type(csv) not in [list, np.ndarray]:
+            return csv.lower
 
-	@staticmethod	
-	def prop_mean(csv):
-		mean=[]
-		return mean
+        lower = np.zeros(np.size(csv))
+        for i in range(np.size(csv)):
+            lower[i] = csv[i].lower
 
-	@staticmethod	
-	def prop_stddev(csv):
-		stddev=[]
-		return sttdev
+        lower = allequal(lower, -np.inf)
 
-	@staticmethod	
-	def prop_initst(csv):
-		if type(csv) not in [list,np.ndarray]:
-			return csv.initst
+        return lower
 
-		initst = np.zeros(np.size(csv))
-		for i in range(np.size(csv)):
-			initst[i] = csv[i].initst
+    @staticmethod
+    def prop_upper(csv):
+        if type(csv) not in [list, np.ndarray]:
+            return csv.upper
 
-		initst = allequal(initst,0.)
+        upper = np.zeros(np.size(csv))
+        for i in range(np.size(csv)):
+            upper[i] = csv[i].upper
 
-		return initst
+        upper = allequal(upper, np.inf)
 
-	@staticmethod	
-	def prop_stype(csv):
-		stype=''
-		return stype
+        return upper
 
-	@staticmethod		
-	def prop_scale(csv):
-		scale=[]
-		return scale
+    @staticmethod
+    def prop_mean(csv):
+        mean = []
+        return mean
 
-	@staticmethod
-	def dakota_write(fidi,dvar):
-		#  collect only the variables of the appropriate class
-		csv = [struc_class(i,'continuous_state','csv') for i in dvar]
+    @staticmethod
+    def prop_stddev(csv):
+        stddev = []
+        return stddev
 
-		#  write variables
-		vlist_write(fidi,'continuous_state','csv',csv)
+    @staticmethod
+    def prop_initst(csv):
+        if type(csv) not in [list, np.ndarray]:
+            return csv.initst
 
+        initst = np.zeros(np.size(csv))
+        for i in range(np.size(csv)):
+            initst[i] = csv[i].initst
+
+        initst = allequal(initst, 0.)
+
+        return initst
+
+    @staticmethod
+    def prop_stype(csv):
+        stype = ''
+        return stype
+
+    @staticmethod
+    def prop_scale(csv):
+        scale = []
+        return scale
+
+    @staticmethod
+    def dakota_write(fidi, dvar):
+        #  collect only the variables of the appropriate class
+        csv = [struc_class(i, 'continuous_state', 'csv') for i in dvar]
+
+        #  write variables
+        vlist_write(fidi, 'continuous_state', 'csv', csv)
Index: /issm/trunk/src/m/classes/qmu/least_squares_term.py
===================================================================
--- /issm/trunk/src/m/classes/qmu/least_squares_term.py	(revision 24312)
+++ /issm/trunk/src/m/classes/qmu/least_squares_term.py	(revision 24313)
@@ -3,10 +3,11 @@
 from MatlabArray import *
 
+
 class least_squares_term(object):
-	'''
+    '''
   definition for the least_squares_term class.
 
   [lst] = least_squares_term.least_squares_term(args)
-   lst  = least_squares_term()
+   lst = least_squares_term()
 
   where the required args are:
@@ -21,151 +22,146 @@
   arguments constructs a new instance from the arguments.
 '''
-	def __init__(self):
-		self.descriptor = ''
-		self.scale_type = 'none'
-		self.scale      =  1.
-		self.weight     =  1.
-    
-	@staticmethod
-	def least_squares_term(*args):
-		nargin = len(args)
+    def __init__(self):
+        self.descriptor = ''
+        self.scale_type = 'none'
+        self.scale = 1.
+        self.weight = 1.
 
-		#create a default object
-               	if nargin == 0:
-			return least_squares_term()
+    @staticmethod
+    def least_squares_term(*args):
+        nargin = len(args)
 
-		#copy the object or create the object from the input
-                else:
-			if  (nargin == 1) and isinstance(args[0],least_squares_term):
-				lst = args[0]
-			else:
-				asizec = np.shape(*args[0:min(nargin,4)])
-				lst = [least_squares_term() for i in range(asizec[0]) for j in range(asizec[1])]
-                        
-				for i in range(np.size(lst)):
-					if (np.size(args[0]) > 1):
-						lst[i].descriptor         = args[0][i]
-					else:
-						lst[i].descriptor         = str(args[0])+string_dim(lst,i,'vector')
+        #create a default object
+        if nargin == 0:
+            return least_squares_term()
 
-				if (nargin >= 2):                            
-					for i in range(np.size(lst)):
-						if (np.size(args[1]) > 1):
-							lst[i].scale_type = args[1][i]
-						else:
-							lst[i].scale_type = str(args[1])
+        #copy the object or create the object from the input
+        else:
+            if (nargin == 1) and isinstance(args[0], least_squares_term):
+                lst = args[0]
+            else:
+                asizec = np.shape(*args[0:min(nargin, 4)])
+                lst = [least_squares_term() for i in range(asizec[0]) for j in range(asizec[1])]
 
-				if (nargin >= 3):
-					for i in range(np.size(lst)):
-						if (np.size(args[2]) > 1):
-							lst[i].scale      = args[2][i]
-						else:
-							lst[i].scale      = args[2]
+                for i in range(np.size(lst)):
+                    if (np.size(args[0]) > 1):
+                        lst[i].descriptor = args[0][i]
+                    else:
+                        lst[i].descriptor = str(args[0]) + string_dim(lst, i, 'vector')
 
-				if (nargin >= 4):
-					for i in range(np.size(lst)):
-						if (np.size(args[3]) > 1):
-							lst[i].weight     = args[3][i]
-						else:
-							lst[i].weight     = args[3]
-           
-				if (nargin > 4):
-					print 'WARNING: least_squares_term:extra_arg Extra arguments for object of class '+str(type(lst))+'.'
+                if (nargin >= 2):
+                    for i in range(np.size(lst)):
+                        if (np.size(args[1]) > 1):
+                            lst[i].scale_type = args[1][i]
+                        else:
+                            lst[i].scale_type = str(args[1])
 
-		return lst
+                if (nargin >= 3):
+                    for i in range(np.size(lst)):
+                        if (np.size(args[2]) > 1):
+                            lst[i].scale = args[2][i]
+                        else:
+                            lst[i].scale = args[2]
 
-	def __repr__(self):
-		# display the object
-		string = '\n'
-		string += 'class "least_squares_term" object = \n'
-		string += '    descriptor: '+str(self.descriptor) + '\n'
-		string += '    scale_type: '+str(self.scale_type) + '\n'
-		string += '         scale: '+str(self.scale) + '\n'
-		string += '        weight: '+str(self.weight) + '\n'
+                if (nargin >= 4):
+                    for i in range(np.size(lst)):
+                        if (np.size(args[3]) > 1):
+                            lst[i].weight = args[3][i]
+                        else:
+                            lst[i].weight = args[3]
 
-		return string
+                if (nargin > 4):
+                    print('WARNING: least_squares_term:extra_arg Extra arguments for object of class ' + str(type(lst)) + '.')
 
-	@staticmethod
-        def prop_desc(lst,dstr):
-		if type(lst) not in [list,np.ndarray]:
-			lst = [lst]
+        return lst
 
-		desc = ['' for i in range(np.size(lst))]
-		for i in range(np.size(lst)):
-			if lst[i].descriptor != '' or type(cdv[i].descriptor) != str:
-				desc[i] = str(lst[i].descriptor)
-			elif dstr != '':
-				desc[i] = str(dstr)+str(string_dim(lst,i,'vector'))
-			else:
-				desc[i] = 'lst'+str(string_dim(lst,i,'vector'))
+    def __repr__(self):
+        # display the object
+        string = '\n'
+        string += 'class "least_squares_term" object = \n'
+        string += '    descriptor: ' + str(self.descriptor) + '\n'
+        string += '    scale_type: ' + str(self.scale_type) + '\n'
+        string += '         scale: ' + str(self.scale) + '\n'
+        string += '        weight: ' + str(self.weight) + '\n'
+        return string
 
-		desc = allempty(desc)
+    @staticmethod
+    def prop_desc(lst, dstr):
+        if type(lst) not in [list, np.ndarray]:
+            lst = [lst]
 
-		return desc
+        desc = ['' for i in range(np.size(lst))]
+        for i in range(np.size(lst)):
+            if lst[i].descriptor != '' or type(cdv[i].descriptor) != str:
+                desc[i] = str(lst[i].descriptor)
+            elif dstr != '':
+                desc[i] = str(dstr) + str(string_dim(lst, i, 'vector'))
+            else:
+                desc[i] = 'lst' + str(string_dim(lst, i, 'vector'))
 
-	@staticmethod
-        def prop_stype(lst):
-		if type(lst) not in [list,np.ndarray]:
-			return str(lst.scale_type)
+        desc = allempty(desc)
+        return desc
 
-		stype = ['' for i in range(np.size(lst))]
-		for i in range(np.size(lst)):
-			stype[i] = str(lst[i].scale_type)
-            
-		stype = allequal(stype,'none')
+    @staticmethod
+    def prop_stype(lst):
+        if type(lst) not in [list, np.ndarray]:
+            return str(lst.scale_type)
 
-		return stype
+        stype = ['' for i in range(np.size(lst))]
+        for i in range(np.size(lst)):
+            stype[i] = str(lst[i].scale_type)
 
-	@staticmethod
-        def prop_scale(lst):
-		if type(lst) not in [list,np.ndarray]:
-			return lst.scale
+        stype = allequal(stype, 'none')
+        return stype
 
-		scale = np.zeros(np.size(lst))
-		for i in range(np.size(lst)):
-			scale[i] = lst[i].scale
-            
-		scale = allequal(scale,1.)
+    @staticmethod
+    def prop_scale(lst):
+        if type(lst) not in [list, np.ndarray]:
+            return lst.scale
 
-		return scale
+        scale = np.zeros(np.size(lst))
+        for i in range(np.size(lst)):
+            scale[i] = lst[i].scale
 
-	@staticmethod
-	def prop_weight(lst):
-		if type(lst) not in [list,np.ndarray]:
-			return lst.weight
+        scale = allequal(scale, 1.)
+        return scale
 
-		weight = np.zeros(np.size(lst))
-		for i in range(np.size(lst)):
-			weight[i] = lst[i].weight
-            
-		weight = allequal(weight,1.)
+    @staticmethod
+    def prop_weight(lst):
+        if type(lst) not in [list, np.ndarray]:
+            return lst.weight
 
-		return weight
+        weight = np.zeros(np.size(lst))
+        for i in range(np.size(lst)):
+            weight[i] = lst[i].weight
 
-	@staticmethod
-        def prop_lower(lst):
-		lower=[]
-		return lower
+        weight = allequal(weight, 1.)
+        return weight
 
-	@staticmethod
-        def prop_upper(lst):
-		upper=[]
-		return upper
+    @staticmethod
+    def prop_lower(lst):
+        lower = []
+        return lower
 
-	@staticmethod
-        def prop_target(lst):
-		target=[]
-		return target
+    @staticmethod
+    def prop_upper(lst):
+        upper = []
+        return upper
 
-	@staticmethod
-	def dakota_write(fidi,dresp,rdesc):
-		#collect only the responses of the appropriate class
-		lst = [struc_class(i,'least_squares_term','lst') for i in dresp]
+    @staticmethod
+    def prop_target(lst):
+        target = []
+        return target
 
-		#write responses
-		rdesc = rlist_write(fidi,'least_squares_terms','least_squares_term',lst,rdesc)
-		return rdesc
-        
-	@staticmethod
-        def dakota_rlev_write(fidi,dresp,params):
-        	return
+    @staticmethod
+    def dakota_write(fidi, dresp, rdesc):
+        #collect only the responses of the appropriate class
+        lst = [struc_class(i, 'least_squares_term', 'lst') for i in dresp]
+
+        #write responses
+        rdesc = rlist_write(fidi, 'least_squares_terms', 'least_squares_term', lst, rdesc)
+        return rdesc
+
+    @staticmethod
+    def dakota_rlev_write(fidi, dresp, params):
+        return
Index: /issm/trunk/src/m/classes/qmu/linear_equality_constraint.py
===================================================================
--- /issm/trunk/src/m/classes/qmu/linear_equality_constraint.py	(revision 24312)
+++ /issm/trunk/src/m/classes/qmu/linear_equality_constraint.py	(revision 24313)
@@ -3,10 +3,11 @@
 from MatlabArray import *
 
+
 class linear_equality_constraint:
-	'''
+    '''
   constructor for the linear_equality_constraint class.
 
   [lec] = linear_equality_constraint.linear_equality_constraint(args)
-   lec  = linear_equality_constraint()
+   lec = linear_equality_constraint()
 
   where the required args are:
@@ -21,145 +22,144 @@
   arguments constructs a new instance from the arguments.
 '''
-	def __init__(self):
-		self.matrix     =  np.array([[float('NaN')]])
-		self.target     =  0.
-		self.scale_type = 'none'
-		self.scale      =  1.
+    def __init__(self):
+        self.matrix = np.array([[float('NaN')]])
+        self.target = 0.
+        self.scale_type = 'none'
+        self.scale = 1.
 
-	@staticmethod
-	def linear_equality_constraint(*args):
-		nargin = len(args)
+    @staticmethod
+    def linear_equality_constraint(*args):
+        nargin = len(args)
 
-		#  create a default object
-		if nargin == 0:
-			return linear_equality_constraint()
+        #  create a default object
+        if nargin == 0:
+            return linear_equality_constraint()
 
-		#  copy the object
-		elif nargin == 1:
-			if isinstance(args[0],linear_equality_constraint):
-				lec = args[0]
-			else:
-				raise RuntimeError('Object is a '+str(type(args[0]))+' class object, not "linear_equality_constraint"')
+        #  copy the object
+        elif nargin == 1:
+            if isinstance(args[0], linear_equality_constraint):
+                lec = args[0]
+            else:
+                raise RuntimeError('Object is a ' + str(type(args[0])) + ' class object, not "linear_equality_constraint"')
 
-		#  create the object from the input
-		else:
-			if (np.shape(args[0],1) == array_np.size(args[1:min(nargin,4)]) or np.shape(args[0],1) == 1):
-				asizec = np.shape(args[1:min(nargin,4)])
-			elif (array_np.size(args[1:min(nargin,4)]) == 1):
-				asizec = [np.shape(args[0],1),1]
-			else:
-				raise RuntimeError('Matrix for object of class '+str(type(lec))+' has inconsistent number of rows.')
+        #  create the object from the input
+        else:
+            if (np.shape(args[0], 1) == array_np.size(args[1:min(nargin, 4)]) or np.shape(args[0], 1) == 1):
+                asizec = np.shape(args[1:min(nargin, 4)])
+            elif (array_np.size(args[1:min(nargin, 4)]) == 1):
+                asizec = [np.shape(args[0], 1), 1]
+            else:
+                raise RuntimeError('Matrix for object of class ' + str(type(lec)) + ' has inconsistent number of rows.')
 
-			lec = [linear_equality_constraint() for i in range(asizec[0]) for j in range(asizec[1])]
+            lec = [linear_equality_constraint() for i in range(asizec[0]) for j in range(asizec[1])]
 
-			for i in range(np.size(lec)):
-				if (np.shape(args[0])[0] > 1):
-					lec[i].matrix             = args[0][i,:]
-				else:
-					lec[i].matrix             = args[0]
+            for i in range(np.size(lec)):
+                if (np.shape(args[0])[0] > 1):
+                    lec[i].matrix = args[0][i, :]
+                else:
+                    lec[i].matrix = args[0]
 
-			if (nargin >= 2):
-				for i in range(np.size(lec)):
-					if (np.size(args[1]) > 1):
-						lec[i].target     = args[1][i]
-					else:
-						lec[i].target     = args[1]
+            if (nargin >= 2):
+                for i in range(np.size(lec)):
+                    if (np.size(args[1]) > 1):
+                        lec[i].target = args[1][i]
+                    else:
+                        lec[i].target = args[1]
 
-			if (nargin >= 3):					
-				for i in range(np.size(lec)):
-					if (np.size(args[2]) > 1):
-						lec[i].scale_type = args[2][i]
-					else:
-						lec[i].scale_type = str(args[2])
-					    
-			if (nargin >= 4):
-				for i in range(np.size(lec)):
-					if (np.size(args[3]) > 1):
-						lec[i].scale      = args[3][i]
-					else:
-						lec[i].scale      = args[3]
+            if (nargin >= 3):
+                for i in range(np.size(lec)):
+                    if (np.size(args[2]) > 1):
+                        lec[i].scale_type = args[2][i]
+                    else:
+                        lec[i].scale_type = str(args[2])
 
-			if (nargin > 4):
-				print 'WARNING: linear_equality_constraint:extra_arg: Extra arguments for object of class '+str(type(lec))+'.'
+            if (nargin >= 4):
+                for i in range(np.size(lec)):
+                    if (np.size(args[3]) > 1):
+                        lec[i].scale = args[3][i]
+                    else:
+                        lec[i].scale = args[3]
 
-		return lec
-					    
+            if (nargin > 4):
+                print('WARNING: linear_equality_constraint:extra_arg: Extra arguments for object of class ' + str(type(lec)) + '.')
 
-	def __repr__(self):
-		# display the object
-		string = '\n'
-		string += 'class "linear_equality_constraint" object = \n'
-		string += '        matrix: '  +str(self.matrix) + '\n'
-		string += '        target: '  +str(self.target) + '\n'
-		string += '    scale_type: '  +str(self.scale_type) + '\n'
-		string += '         scale: '  +str(self.scale) + '\n'
+        return lec
 
-		return string
+    def __repr__(self):
+        # display the object
+        string = '\n'
+        string += 'class "linear_equality_constraint" object = \n'
+        string += '        matrix: ' + str(self.matrix) + '\n'
+        string += '        target: ' + str(self.target) + '\n'
+        string += '    scale_type: ' + str(self.scale_type) + '\n'
+        string += '         scale: ' + str(self.scale) + '\n'
 
-	@staticmethod
-	def prop_matrix(lec):
-		if type(lec) not in [list,np.ndarray]:
-			return lec.matrix
+        return string
 
-		matrix = np.zeros(np.size(lec))
-		for i in range(np.size(lec)):
-			matrix[i,0:np.shape(lec[i].matrix)[1]] = lec[i].matrix[0,:]
+    @staticmethod
+    def prop_matrix(lec):
+        if type(lec) not in [list, np.ndarray]:
+            return lec.matrix
 
-		return matrix
+        matrix = np.zeros(np.size(lec))
+        for i in range(np.size(lec)):
+            matrix[i, 0:np.shape(lec[i].matrix)[1]] = lec[i].matrix[0, :]
 
-	@staticmethod
-	def prop_lower(lec):
-		lower=[]
-		return lower
+        return matrix
 
-	@staticmethod
-	def prop_upper(lec):
-		upper=[]
-		return upper
+    @staticmethod
+    def prop_lower(lec):
+        lower = []
+        return lower
 
-	@staticmethod
-	def prop_target(lec):
-		if type(lec) not in [list,np.ndarray]:
-			return lec.target
+    @staticmethod
+    def prop_upper(lec):
+        upper = []
+        return upper
 
-		target = np.zeros(np.shape(lec))
-		for i in range(np.size(lec)):
-			target[i] = lec[i].target
-		
-		target = allequal(target,0.)
+    @staticmethod
+    def prop_target(lec):
+        if type(lec) not in [list, np.ndarray]:
+            return lec.target
 
-		return target
+        target = np.zeros(np.shape(lec))
+        for i in range(np.size(lec)):
+            target[i] = lec[i].target
 
-	@staticmethod
-	def prop_stype(lec):
-		if type(lec) not in [list,np.ndarray]:
-			return lec.scale_type
+        target = allequal(target, 0.)
 
-		stype = ['' for i in range(np.size(lec))]
-		for i in range(np.size(lec)):
-			stype[i] = str(lec[i].scale_type)
-		
-		stype = allequal(stype,'none')
+        return target
 
-		return stype
+    @staticmethod
+    def prop_stype(lec):
+        if type(lec) not in [list, np.ndarray]:
+            return lec.scale_type
 
-	@staticmethod
-	def prop_scale(lec):
-		if type(lec) not in [list,np.ndarray]:
-			return lec.scale
+        stype = ['' for i in range(np.size(lec))]
+        for i in range(np.size(lec)):
+            stype[i] = str(lec[i].scale_type)
 
-		scale = np.zeros(np.shape(lec))
-		for i in range(np.size(lec)):
-			scale[i] = lec[i].scale
-		
-		scale = allequal(scale,1.)
+        stype = allequal(stype, 'none')
 
-		return scale
-    
-	@staticmethod
-	def dakota_write(fidi,dvar):
-		# collect only the variables of the appropriate class
-		lec = [struc_type(i,'linear_equality_constraint','lec') for i in dvar]
+        return stype
 
-		# write constraints
-		lclist_write(fidi,'linear_equality_constraints','linear_equality',lec)
+    @staticmethod
+    def prop_scale(lec):
+        if type(lec) not in [list, np.ndarray]:
+            return lec.scale
+
+        scale = np.zeros(np.shape(lec))
+        for i in range(np.size(lec)):
+            scale[i] = lec[i].scale
+
+        scale = allequal(scale, 1.)
+
+        return scale
+
+    @staticmethod
+    def dakota_write(fidi, dvar):
+        # collect only the variables of the appropriate class
+        lec = [struc_type(i, 'linear_equality_constraint', 'lec') for i in dvar]
+
+        # write constraints
+        lclist_write(fidi, 'linear_equality_constraints', 'linear_equality', lec)
Index: /issm/trunk/src/m/classes/qmu/linear_inequality_constraint.py
===================================================================
--- /issm/trunk/src/m/classes/qmu/linear_inequality_constraint.py	(revision 24312)
+++ /issm/trunk/src/m/classes/qmu/linear_inequality_constraint.py	(revision 24313)
@@ -3,10 +3,11 @@
 from MatlabArray import *
 
+
 class linear_inequality_constraint:
-	'''
+    '''
   constructor for the linear_inequality_constraint class.
 
   [lic] = linear_inequality_constraint.linear_inequality_constraint(args)
-   lic  = linear_inequality_constraint()
+   lic = linear_inequality_constraint()
 
   where the required args are:
@@ -22,166 +23,165 @@
   arguments constructs a new instance from the arguments.
 '''
-	def __init__(self):
-		self.matrix     =  np.array([[float('NaN')]])
-		self.lower      = -np.Inf
-		self.upper      =  0.
-		self.scale_type = 'none'
-		self.scale      =  1.
+    def __init__(self):
+        self.matrix = np.array([[float('NaN')]])
+        self.lower = -np.Inf
+        self.upper = 0.
+        self.scale_type = 'none'
+        self.scale = 1.
 
-	@staticmethod    
-	def linear_inequality_constraint(*args):
-		nargin = len(args)
+    @staticmethod
+    def linear_inequality_constraint(*args):
+        nargin = len(args)
 
-		# create a default object
-		if nargin == 0:
-			return linear_inequality_constraint()
+        # create a default object
+        if nargin == 0:
+            return linear_inequality_constraint()
 
-		# copy the object
-		if nargin == 1:
-			if isinstance(args[0],linear_inequality_constraint):
-				lic = args[0]
-			else:
-				raise RuntimeError('Object is a '+str(type(args[0]))+' class object, not "linear_inequality_constraint".')
+        # copy the object
+        if nargin == 1:
+            if isinstance(args[0], linear_inequality_constraint):
+                lic = args[0]
+            else:
+                raise RuntimeError('Object is a ' + str(type(args[0])) + ' class object, not "linear_inequality_constraint".')
 
-		# not enough arguments
-		if nargin == 2:
-			raise RuntimeError('Construction of linear_inequality_constraint class object requires at least 3 inputs.')
+        # not enough arguments
+        if nargin == 2:
+            raise RuntimeError('Construction of linear_inequality_constraint class object requires at least 3 inputs.')
 
-		# create the object from the input
-		else:
-			if (np.shape(args[0],1) == array_numel(args[1:min(nargin,5)]) or np.shape(args[0],1) == 1):
-				asizec = array_size(args[1:min(nargin,5)])
-			elif (array_numel(args[1:min(nargin,5)]) == 1):
-				asizec = [array_size(args[0],1),1]
-			else:
-				raise RuntimeError('Matrix for object of class '+str(type(lic))+' has inconsistent number of rows.')
-                    
-			lic = [linear_inequality_constraint() for i in range(asizec[0]) for j in range(asizec[1])]
+        # create the object from the input
+        else:
+            if (np.shape(args[0], 1) == array_numel(args[1:min(nargin, 5)]) or np.shape(args[0], 1) == 1):
+                asizec = array_size(args[1:min(nargin, 5)])
+            elif (array_numel(args[1:min(nargin, 5)]) == 1):
+                asizec = [array_size(args[0], 1), 1]
+            else:
+                raise RuntimeError('Matrix for object of class ' + str(type(lic)) + ' has inconsistent number of rows.')
 
-			for i in range(np.size(lic)):
-				if (np.shape(args[0],1) > 1):
-					lic[i].matrix             = args[0][i,:]
-				else:
-					lic[i].matrix             = args[0]
+            lic = [linear_inequality_constraint() for i in range(asizec[0]) for j in range(asizec[1])]
 
-			if (nargin >= 2):
-				for i in range(np.size(lic)):
-					if (np.size(args[1]) > 1):
-						lic[i].lower      = args[1][i]
-					else:
-						lic[i].lower      = args[1]
+            for i in range(np.size(lic)):
+                if (np.shape(args[0], 1) > 1):
+                    lic[i].matrix = args[0][i, :]
+                else:
+                    lic[i].matrix = args[0]
 
-			if (nargin >= 3):
-				for i in range(np.size(lic)):
-					if (np.size(args[2]) > 1):
-						lic[i].upper      = args[2][i]
-					else:
-						lic[i].upper      = args[2]
-                                
-			if (nargin >= 4):
-				for i in range(np.size(lic)):
-					if (np.size(args[3]) > 1):
-						lic[i].scale_type = args[3][i]
-					else:
-						lic[i].scale_type = str(args[3])
-                                    
-			if (nargin >= 5):
-				for i in range(np.size(lic)):
-					if (np.size(args[4]) > 1):
-						lic[i].scale     = args[4][i]
-					else:
-						lic[i].scale     = args[4]
+            if (nargin >= 2):
+                for i in range(np.size(lic)):
+                    if (np.size(args[1]) > 1):
+                        lic[i].lower = args[1][i]
+                    else:
+                        lic[i].lower = args[1]
 
-			if (nargin > 5):
-				print 'WARNING: linear_inequality_constraint:extra_arg: Extra arguments for object of class '+str(type(lic))+'.'
+            if (nargin >= 3):
+                for i in range(np.size(lic)):
+                    if (np.size(args[2]) > 1):
+                        lic[i].upper = args[2][i]
+                    else:
+                        lic[i].upper = args[2]
 
-		return lic
+            if (nargin >= 4):
+                for i in range(np.size(lic)):
+                    if (np.size(args[3]) > 1):
+                        lic[i].scale_type = args[3][i]
+                    else:
+                        lic[i].scale_type = str(args[3])
 
+            if (nargin >= 5):
+                for i in range(np.size(lic)):
+                    if (np.size(args[4]) > 1):
+                        lic[i].scale = args[4][i]
+                    else:
+                        lic[i].scale = args[4]
 
-	def __repr__(self):
-		# display the object
-		string = '\n'
-		string += 'class "linear_inequality_constraint" object = \n'
-		string += '        matrix: '  +str(string_vec(self.matrix)) + '\n'
-		string += '         lower: '  +str(self.lower) + '\n'
-		string += '         upper: '  +str(self.upper) + '\n'
-		string += '    scale_type: '  +str(self.scale_type) + '\n'
-		string += '         scale: '  +str(self.scale) + '\n'
+            if (nargin > 5):
+                print('WARNING: linear_inequality_constraint:extra_arg: Extra arguments for object of class ' + str(type(lic)) + '.')
 
-		return string
+        return lic
 
-	@staticmethod 
-	def prop_matrix(lic):
-		if type(lic) not in [list,np.ndarray]:
-			return lic.matrix
+    def __repr__(self):
+        # display the object
+        string = '\n'
+        string += 'class "linear_inequality_constraint" object = \n'
+        string += '        matrix: ' + str(string_vec(self.matrix)) + '\n'
+        string += '         lower: ' + str(self.lower) + '\n'
+        string += '         upper: ' + str(self.upper) + '\n'
+        string += '    scale_type: ' + str(self.scale_type) + '\n'
+        string += '         scale: ' + str(self.scale) + '\n'
 
-		matrix = np.zeros(np.size(lic))
-		for i in range(np.size(lic)):
-			matrix[i,0:np.shape(lic[i].matrix)[1]] = lic[i].matrix[0,:]
+        return string
 
-		return matrix
+    @staticmethod
+    def prop_matrix(lic):
+        if type(lic) not in [list, np.ndarray]:
+            return lic.matrix
 
-	@staticmethod
-	def prop_lower(lic):
-		if type(lic) not in [list,np.ndarray]:
-			return lic.lower
+        matrix = np.zeros(np.size(lic))
+        for i in range(np.size(lic)):
+            matrix[i, 0:np.shape(lic[i].matrix)[1]] = lic[i].matrix[0, :]
 
-		lower = np.zeros(np.shape(lic))
-		for i in range(np.size(lic)):
-			lower[i] = lic[i].lower
-            
-		lower = allequal(lower,-np.Inf)
+        return matrix
 
-		return lower
+    @staticmethod
+    def prop_lower(lic):
+        if type(lic) not in [list, np.ndarray]:
+            return lic.lower
 
-	@staticmethod
-	def prop_upper(lic):
-		if type(lic) not in [list,np.ndarray]:
-			return lic.upper
+        lower = np.zeros(np.shape(lic))
+        for i in range(np.size(lic)):
+            lower[i] = lic[i].lower
 
-		upper = np.zeros(np.shape(lic))
-		for i in range(np.size(lic)):
-			upper[i] = lic[i].upper
-            
-		upper = allequal(upper,0.)
+        lower = allequal(lower, -np.Inf)
 
-		return upper
+        return lower
 
-	@staticmethod
-	def prop_target(lic):
-		target=[]
-		return target
+    @staticmethod
+    def prop_upper(lic):
+        if type(lic) not in [list, np.ndarray]:
+            return lic.upper
 
-	@staticmethod
-	def prop_stype(lic):
-		if type(lic) not in [list,np.ndarray]:
-			return lic.scale_type
+        upper = np.zeros(np.shape(lic))
+        for i in range(np.size(lic)):
+            upper[i] = lic[i].upper
 
-		stype = ['' for i in range(np.size(lic))]
-		for i in range(np.size(lic)):
-			stype[i] = str(lic[i].scale_type)
-            
-		stype = allequal(stype,'none')
+        upper = allequal(upper, 0.)
 
-		return stype
+        return upper
 
-	@staticmethod
-	def prop_scale(lic):
-		if type(lic) not in [list,np.ndarray]:
-			return lic.scale
+    @staticmethod
+    def prop_target(lic):
+        target = []
+        return target
 
-		scale = np.zeros(np.shape(lic))
-		for i in range(np.size(lic)):
-			scale[i] = lic[i].scale
-            
-		scale = allequal(scale,1.)
+    @staticmethod
+    def prop_stype(lic):
+        if type(lic) not in [list, np.ndarray]:
+            return lic.scale_type
 
-		return scale
-        
-	@staticmethod
-	def dakota_write(fidi,dvar):
-		# collect only the variables of the appropriate class
-		lic = [struc_class(i,'linear_inequality_constraint','lic') for i in dvar]
+        stype = ['' for i in range(np.size(lic))]
+        for i in range(np.size(lic)):
+            stype[i] = str(lic[i].scale_type)
 
-		# write constraints
-		lclist_write(fidi,'linear_inequality_constraints','linear_inequality',lic)
+        stype = allequal(stype, 'none')
+
+        return stype
+
+    @staticmethod
+    def prop_scale(lic):
+        if type(lic) not in [list, np.ndarray]:
+            return lic.scale
+
+        scale = np.zeros(np.shape(lic))
+        for i in range(np.size(lic)):
+            scale[i] = lic[i].scale
+
+        scale = allequal(scale, 1.)
+
+        return scale
+
+    @staticmethod
+    def dakota_write(fidi, dvar):
+        # collect only the variables of the appropriate class
+        lic = [struc_class(i, 'linear_inequality_constraint', 'lic') for i in dvar]
+
+        # write constraints
+        lclist_write(fidi, 'linear_inequality_constraints', 'linear_inequality', lic)
Index: /issm/trunk/src/m/classes/qmu/nonlinear_equality_constraint.py
===================================================================
--- /issm/trunk/src/m/classes/qmu/nonlinear_equality_constraint.py	(revision 24312)
+++ /issm/trunk/src/m/classes/qmu/nonlinear_equality_constraint.py	(revision 24313)
@@ -3,10 +3,11 @@
 from MatlabArray import *
 
+
 class nonlinear_equality_constraint:
-	'''
+    '''
   constructor for the nonlinear_equality_constraint class.
 
   [nec] = nonlinear_equality_constraint.nonlinear_equality_constraint(args)
-   nec  = nonlinear_equality_constraint()
+   nec = nonlinear_equality_constraint()
 
   where the required args are:
@@ -21,159 +22,158 @@
   arguments constructs a new instance from the arguments.
 '''
-	def __init__(self):
-		self.descriptor = ''
-		self.target     =  0.
-		self.scale_type = 'none'
-		self.scale      =  1.
+    def __init__(self):
+        self.descriptor = ''
+        self.target = 0.
+        self.scale_type = 'none'
+        self.scale = 1.
 
-	@staticmethod
-	def nonlinear_equality_constraint(*args):
-		nargin = len(args)
+    @staticmethod
+    def nonlinear_equality_constraint(*args):
+        nargin = len(args)
 
-		# create a default object
-		if nargin == 0:
-			return nonlinear_equality_constraint()
+    # create a default object
+        if nargin == 0:
+            return nonlinear_equality_constraint()
 
-		# copy the object
-		elif nargin == 1:
-			if isinstance(args[0],nonlinear_equality_constraint):
-				nec = args[0]
-			else:
-				raise RuntimeError('Object is a '+str(type(args[0]))+' class object, not "nonlinear_equality_constraint"')
+    # copy the object
+        elif nargin == 1:
+            if isinstance(args[0], nonlinear_equality_constraint):
+                nec = args[0]
+            else:
+                raise RuntimeError('Object is a ' + str(type(args[0])) + ' class object, not "nonlinear_equality_constraint"')
 
-		# create the object from the input
-		else:
-			asizec = array_size(*args[0:min(nargin,4)])
-			nec = [nonlinear_equality_constraint() for i in range(asizec[0]) for j in range(asizec[1])]
+    # create the object from the input
+        else:
+            asizec = array_size(*args[0:min(nargin, 4)])
+            nec = [nonlinear_equality_constraint() for i in range(asizec[0]) for j in range(asizec[1])]
 
-			for i in range(np.size(nec)):
-				if (np.shape(args[0])[0] > 1):
-					nec[i].descriptor         = args[0][i]
-				else:
-					nec[i].descriptor         = str(args[0])
-				if (np.size(args[1]) > 1):
-					nec[i].target             = args[1][i]
-				else:
-					nec[i].target             = args[1]
+            for i in range(np.size(nec)):
+                if (np.shape(args[0])[0] > 1):
+                    nec[i].descriptor = args[0][i]
+                else:
+                    nec[i].descriptor = str(args[0])
+                if (np.size(args[1]) > 1):
+                    nec[i].target = args[1][i]
+                else:
+                    nec[i].target = args[1]
 
-			if (nargin >= 3):
-				for i in range(np.size(nec)):
-					if (np.size(args[2]) > 1):
-						nec[i].scale_type = args[2][i]
-					else:
-						nec[i].scale_type = str(args[2])
-					    
-			if (nargin >= 4):
-				for i in range(np.size(nec)):
-					if (np.size(args[3]) > 1):
-						nec[i].scale      =args[3][i]
-					else:
-						nec[i].scale      =args[3]
+            if (nargin >= 3):
+                for i in range(np.size(nec)):
+                    if (np.size(args[2]) > 1):
+                        nec[i].scale_type = args[2][i]
+                    else:
+                        nec[i].scale_type = str(args[2])
 
-			if (nargin > 4):
-				print 'WARNING: nonlinear_equality_constraint:extra_arg: Extra arguments for object of class '+str(type(nec))+'.'
+            if (nargin >= 4):
+                for i in range(np.size(nec)):
+                    if (np.size(args[3]) > 1):
+                        nec[i].scale = args[3][i]
+                    else:
+                        nec[i].scale = args[3]
 
-		return nec
-					    
+            if (nargin > 4):
+                print('WARNING: nonlinear_equality_constraint:extra_arg: Extra arguments for object of class ' + str(type(nec)) + '.')
 
-	def __repr__(self):
-		# display the object
-		string = '\n'
-		string += 'class "nonlinear_equality_constraint" object = \n'
-		string += '    descriptor: '  +str(self.descriptor) + '\n'
-		string += '        target: '  +str(self.target) + '\n'
-		string += '    scale_type: '  +str(self.scale_type) + '\n'
-		string += '         scale: '  +str(self.scale) + '\n'
+        return nec
 
-		return string
+    def __repr__(self):
+        # display the object
+        string = '\n'
+        string += 'class "nonlinear_equality_constraint" object = \n'
+        string += '    descriptor: ' + str(self.descriptor) + '\n'
+        string += '        target: ' + str(self.target) + '\n'
+        string += '    scale_type: ' + str(self.scale_type) + '\n'
+        string += '         scale: ' + str(self.scale) + '\n'
 
-	@staticmethod
-	def prop_desc(nec,dstr):
-		if type(nec) not in [list,np.ndarray]:
-			if nec.descriptor != '' or type(nec.descriptor) != str:
-				desc = str(nec.descriptor)
-			elif dstr != '':
-				desc = str(dstr)
-			else:
-				desc = 'nec'
-			return desc
+        return string
 
-		desc=['' for i in range(np.size(nec))]
-		for i in range(np.size(nec)):
-			if nec[i].descriptor != '' or type(nec[i].descriptor) != str:
-				desc[i] = str(nec[i].descriptor)
-			elif dstr != '':
-				desc[i] = str(dstr)+str(string_dim(nec,i,'vector'))
-			else:
-				desc[i] = 'nec'+str(string_dim(nec,i,'vector'))
-                
-		desc=allempty(desc)
+    @staticmethod
+    def prop_desc(nec, dstr):
+        if type(nec) not in [list, np.ndarray]:
+            if nec.descriptor != '' or type(nec.descriptor) != str:
+                desc = str(nec.descriptor)
+            elif dstr != '':
+                desc = str(dstr)
+            else:
+                desc = 'nec'
+            return desc
 
-		return desc
+        desc = ['' for i in range(np.size(nec))]
+        for i in range(np.size(nec)):
+            if nec[i].descriptor != '' or type(nec[i].descriptor) != str:
+                desc[i] = str(nec[i].descriptor)
+            elif dstr != '':
+                desc[i] = str(dstr) + str(string_dim(nec, i, 'vector'))
+            else:
+                desc[i] = 'nec' + str(string_dim(nec, i, 'vector'))
 
-	@staticmethod
-	def prop_lower(nec):
-		lower=[]
-		return lower
+        desc = allempty(desc)
 
-	@staticmethod
-	def prop_upper(nec):
-		upper=[]
-		return upper
+        return desc
 
-	@staticmethod
-	def prop_weight(nec):
-		weight=[]
-		return weight
+    @staticmethod
+    def prop_lower(nec):
+        lower = []
+        return lower
 
-	@staticmethod
-	def prop_target(nec):
-		if type(nec) not in [list,np.ndarray]:
-			return nec.target
+    @staticmethod
+    def prop_upper(nec):
+        upper = []
+        return upper
 
-		target = np.zeros(np.shape(nec))
-		for i in range(np.size(nec)):
-			target[i] = nec[i].target
-		
-		target = allequal(target,0.)
+    @staticmethod
+    def prop_weight(nec):
+        weight = []
+        return weight
 
-		return target
+    @staticmethod
+    def prop_target(nec):
+        if type(nec) not in [list, np.ndarray]:
+            return nec.target
 
-	@staticmethod
-	def prop_stype(nec):
-		if type(nec) not in [list,np.ndarray]:
-			return nec.scale_type
+        target = np.zeros(np.shape(nec))
+        for i in range(np.size(nec)):
+            target[i] = nec[i].target
 
-		stype = ['' for i in range(np.size(nec))]
-		for i in range(np.size(nec)):
-			stype[i] = str(nec[i].scale_type)
-		
-		stype = allequal(stype,'none')
+        target = allequal(target, 0.)
 
-		return stype
+        return target
 
-	@staticmethod
-	def prop_scale(nec):
-		if type(nec) not in [list,np.ndarray]:
-			return nec.scale
+    @staticmethod
+    def prop_stype(nec):
+        if type(nec) not in [list, np.ndarray]:
+            return nec.scale_type
 
-		scale = np.zeros(np.shape(nec))
-		for i in range(np.size(nec)):
-			scale[i] = nec[i].scale
-		
-		scale = allequal(scale,1.)
+        stype = ['' for i in range(np.size(nec))]
+        for i in range(np.size(nec)):
+            stype[i] = str(nec[i].scale_type)
 
-		return scale
-    
-	@staticmethod
-	def dakota_write(fidi,dresp,rdesc):
-		#  colnect only the variables of the appropriate class
-		nec = [struc_type(i,'nonlinear_equality_constraint','nec') for i in dresp]
+        stype = allequal(stype, 'none')
 
-		#  write constraints
-		rdesc = rlist_write(fidi,'nonlinear_equality_constraints','nonlinear_equality',nec,rdesc)
-		return rdesc
+        return stype
 
-	@staticmethod
-	def dakota_rlev_write(fidi,dresp,params):
-		return
+    @staticmethod
+    def prop_scale(nec):
+        if type(nec) not in [list, np.ndarray]:
+            return nec.scale
+
+        scale = np.zeros(np.shape(nec))
+        for i in range(np.size(nec)):
+            scale[i] = nec[i].scale
+
+        scale = allequal(scale, 1.)
+
+        return scale
+
+    @staticmethod
+    def dakota_write(fidi, dresp, rdesc):
+        #  colnect only the variables of the appropriate class
+        nec = [struc_type(i, 'nonlinear_equality_constraint', 'nec') for i in dresp]
+
+        #  write constraints
+        rdesc = rlist_write(fidi, 'nonlinear_equality_constraints', 'nonlinear_equality', nec, rdesc)
+        return rdesc
+
+    @staticmethod
+    def dakota_rlev_write(fidi, dresp, params):
+        return
Index: /issm/trunk/src/m/classes/qmu/nonlinear_inequality_constraint.py
===================================================================
--- /issm/trunk/src/m/classes/qmu/nonlinear_inequality_constraint.py	(revision 24312)
+++ /issm/trunk/src/m/classes/qmu/nonlinear_inequality_constraint.py	(revision 24313)
@@ -3,10 +3,11 @@
 from MatlabArray import *
 
+
 class nonlinear_inequality_constraint:
-	'''
+    '''
   constructor for the nonlinear_inequality_constraint class.
 
   [nic] = nonlinear_inequality_constraint.nonlinear_inequality_constraint(args)
-   nic  = nonlinear_inequality_constraint()
+   nic = nonlinear_inequality_constraint()
 
   where the required args are:
@@ -22,177 +23,177 @@
   arguments constructs a new instance from the arguments.
 '''
-	def __init__(self):
-		self.descriptor = ''
-		self.lower      = -np.inf
-		self.upper      =  0.
-		self.scale_type = 'none'
-		self.scale      =  1.
+    def __init__(self):
+        self.descriptor = ''
+        self.lower = -np.inf
+        self.upper = 0.
+        self.scale_type = 'none'
+        self.scale = 1.
 
-	@staticmethod    
-	def nonlinear_inequality_constraint(*args):
-		nargin = len(args)
+    @staticmethod
+    def nonlinear_inequality_constraint(*args):
+        nargin = len(args)
 
-		# create a default object
-		if nargin == 0:
-			return nonlinear_inequality_constraint()
+        # create a default object
+        if nargin == 0:
+            return nonlinear_inequality_constraint()
 
-		# copy the object
-		if nargin == 1:
-			if isinstance(args[0],nonlinear_inequality_constraint):
-				nic = args[0]
-			else:
-				raise RuntimeError('Object is a '+str(type(args[0]))+' class object, not "nonlinear_inequality_constraint".')
+        # copy the object
+        if nargin == 1:
+            if isinstance(args[0], nonlinear_inequality_constraint):
+                nic = args[0]
+            else:
+                raise RuntimeError('Object is a ' + str(type(args[0])) + ' class object, not "nonlinear_inequality_constraint".')
 
-		# not enough arguments
-		if nargin == 2:
-			raise RuntimeError('Construction of nonlinear_inequality_constraint class object requires at least 3 inputs.')
+        # not enough arguments
+        if nargin == 2:
+            raise RuntimeError('Construction of nonlinear_inequality_constraint class object requires at least 3 inputs.')
 
-		# create the object from the input
-		else:
-			asizec = array_size(*args[0:min(nargin,3)])
-			nic = [nonlinear_inequality_constraint() for i in range(asizec[0]) for j in range(asizec[1])]
+        # create the object from the input
+        else:
+            asizec = array_size(*args[0:min(nargin, 3)])
+            nic = [nonlinear_inequality_constraint() for i in range(asizec[0]) for j in range(asizec[1])]
 
-			for i in range(np.size(nic)):
-				if (np.size(args[0]) > 1):
-					nic[i].descriptor      = args[0][i];
-				else:
-					nic[i].descriptor      = str(args[0])+string_dim(nic,i,'vector')
-				if (np.size(args[1]) > 1):
-					nic[i].lower           = args[1][i]
-				else:
-					nic[i].lower           = args[1]
+            for i in range(np.size(nic)):
+                if (np.size(args[0]) > 1):
+                    nic[i].descriptor = args[0][i]
+                else:
+                    nic[i].descriptor = str(args[0]) + string_dim(nic, i, 'vector')
+                if (np.size(args[1]) > 1):
+                    nic[i].lower = args[1][i]
+                else:
+                    nic[i].lower = args[1]
 
-				if (np.size(args[2]) > 1):
-					nic[i].upper           = args[2][i]
-				else:
-					nic[i].upper           = args[2]
+                if (np.size(args[2]) > 1):
+                    nic[i].upper = args[2][i]
+                else:
+                    nic[i].upper = args[2]
 
-			if (nargin >= 4):
-				for i in range(np.size(nic)):
-					if (np.size(args[3]) > 1):
-						nic[i].scale_type = args[3][i]
-					else:
-						nic[i].scale_type = str(args[3])
+            if (nargin >= 4):
+                for i in range(np.size(nic)):
+                    if (np.size(args[3]) > 1):
+                        nic[i].scale_type = args[3][i]
+                    else:
+                        nic[i].scale_type = str(args[3])
 
-			if (nargin >= 5):
-				for i in range(np.size(nic)):
-					if (np.size(args[4]) > 1):
-						nic[i].upper      = args[4][i]
-					else:
-						nic[i].upper      = args[4]
-                                
-			if (nargin > 5):
-				print 'WARNING: nonlinear_inequality_constraint:extra_arg: Extra arguments for object of class '+str(type(nic))+'.'
+            if (nargin >= 5):
+                for i in range(np.size(nic)):
+                    if (np.size(args[4]) > 1):
+                        nic[i].upper = args[4][i]
+                    else:
+                        nic[i].upper = args[4]
 
-		return nic
+            if (nargin > 5):
+                print('WARNING: nonlinear_inequality_constraint:extra_arg: Extra arguments for object of class ' + str(type(nic)) + '.')
 
-	def __repr__(self):
-		# display the object
-		string = '\n'
-		string += 'class "nonlinear_inequality_constraint" object = \n'
-		string += '    descriptor: '  +str(self.descriptor) + '\n'
-		string += '         lower: '  +str(self.lower) + '\n'
-		string += '         upper: '  +str(self.upper) + '\n'
-		string += '    scale_type: '  +str(self.scale_type) + '\n'
-		string += '         scale: '  +str(self.scale) + '\n'
+        return nic
 
-		return string
+    def __repr__(self):
+        # display the object
+        string = '\n'
+        string += 'class "nonlinear_inequality_constraint" object = \n'
+        string += '    descriptor: ' + str(self.descriptor) + '\n'
+        string += '         lower: ' + str(self.lower) + '\n'
+        string += '         upper: ' + str(self.upper) + '\n'
+        string += '    scale_type: ' + str(self.scale_type) + '\n'
+        string += '         scale: ' + str(self.scale) + '\n'
 
-	@staticmethod
-	def prop_desc(nic,dstr):
-		if type(nic) not in [list,np.ndarray]:
-			if nic.descriptor != '' or type(nic.descriptor) != str:
-				desc = str(nic.descriptor)
-			elif dstr != '':
-				desc = str(dstr)
-			else:
-				desc = 'nic'
-			return desc
+        return string
 
-		desc = ['' for i in range(np.size(nic))]
-		for i in range(np.size(nic)):
-			if nic[i].descriptor != '' or type(nic[i].descriptor) != str:
-				desc[i] = str(nic[i].descriptor)
-			elif dstr != '':
-				desc[i] = str(dstr)+str(string_dim(nic,i,'vector'))
-			else:
-				desc[i] = 'nic'+str(string_dim(nic,i,'vector'))
-                
-		desc = allempty(desc)
+    @staticmethod
+    def prop_desc(nic, dstr):
+        if type(nic) not in [list, np.ndarray]:
+            if nic.descriptor != '' or type(nic.descriptor) != str:
+                desc = str(nic.descriptor)
+            elif dstr != '':
+                desc = str(dstr)
+            else:
+                desc = 'nic'
+            return desc
 
-		return desc
+        desc = ['' for i in range(np.size(nic))]
+        for i in range(np.size(nic)):
+            if nic[i].descriptor != '' or type(nic[i].descriptor) != str:
+                desc[i] = str(nic[i].descriptor)
+            elif dstr != '':
+                desc[i] = str(dstr) + str(string_dim(nic, i, 'vector'))
+            else:
+                desc[i] = 'nic' + str(string_dim(nic, i, 'vector'))
 
-	@staticmethod
-	def prop_stype(nic):
-		if type(nic) not in [list,np.ndarray]:
-			return nic.scale_type
+        desc = allempty(desc)
 
-		stype = ['' for i in range(np.size(nic))]
-		for i in range(np.size(nic)):
-			stype[i] = str(nic[i].scale_type)
-            
-		stype = allequal(stype,'none')
+        return desc
 
-		return stype
+    @staticmethod
+    def prop_stype(nic):
+        if type(nic) not in [list, np.ndarray]:
+            return nic.scale_type
 
-	@staticmethod
-	def prop_scale(nic):
-		if type(nic) not in [list,np.ndarray]:
-			return nic.scale
+        stype = ['' for i in range(np.size(nic))]
+        for i in range(np.size(nic)):
+            stype[i] = str(nic[i].scale_type)
 
-		scale = np.zeros(np.shape(nic))
-		for i in range(np.size(nic)):
-			scale[i] = nic[i].scale
-            
-		scale = allequal(scale,1.)
+        stype = allequal(stype, 'none')
 
-		return scale
+        return stype
 
-	@staticmethod
-	def prop_weight(nic):
-		weight=[]
-		return weight
+    @staticmethod
+    def prop_scale(nic):
+        if type(nic) not in [list, np.ndarray]:
+            return nic.scale
 
-	@staticmethod
-	def prop_lower(nic):
-		if type(nic) not in [list,np.ndarray]:
-			return nic.lower
+        scale = np.zeros(np.shape(nic))
+        for i in range(np.size(nic)):
+            scale[i] = nic[i].scale
 
-		lower = np.zeros(np.shape(nic))
-		for i in range(np.size(nic)):
-			lower[i] = nic[i].lower
-            
-		lower = allequal(lower,-np.inf)
+        scale = allequal(scale, 1.)
 
-		return lower
+        return scale
 
-	@staticmethod
-	def prop_upper(nic):
-		if type(nic) not in [list,np.ndarray]:
-			return nic.upper
+    @staticmethod
+    def prop_weight(nic):
+        weight = []
+        return weight
 
-		upper = np.zeros(np.shape(nic))
-		for i in range(np.size(nic)):
-			upper[i] = nic[i].upper
-            
-		upper = allequal(upper,0.)
+    @staticmethod
+    def prop_lower(nic):
+        if type(nic) not in [list, np.ndarray]:
+            return nic.lower
 
-		return upper
+        lower = np.zeros(np.shape(nic))
+        for i in range(np.size(nic)):
+            lower[i] = nic[i].lower
 
-	@staticmethod
-	def prop_target(nic):
-		target=[]
-		return target
-        
-	@staticmethod
-	def dakota_write(fidi,dresp,rdesc):
-		# collect only the variables of the appropriate class
-		nic = [struc_class(i,'nonlinear_inequality_constraint','nic') for i in dresp]
+        lower = allequal(lower, -np.inf)
 
-		# write constraints
-		rdesc = rlist_write(fidi,'nonlinear_inequality_constrants','nonlinear_inequality',nic,rdesc)
-		return rdesc
+        return lower
 
-	@staticmethod
-	def dakota_rlev_write(fidi,dresp,params):
-		return
+    @staticmethod
+    def prop_upper(nic):
+        if type(nic) not in [list, np.ndarray]:
+            return nic.upper
+
+        upper = np.zeros(np.shape(nic))
+        for i in range(np.size(nic)):
+            upper[i] = nic[i].upper
+
+        upper = allequal(upper, 0.)
+
+        return upper
+
+    @staticmethod
+    def prop_target(nic):
+        target = []
+        return target
+
+    @staticmethod
+    def dakota_write(fidi, dresp, rdesc):
+        # collect only the variables of the appropriate class
+        nic = [struc_class(i, 'nonlinear_inequality_constraint', 'nic') for i in dresp]
+
+        # write constraints
+        rdesc = rlist_write(fidi, 'nonlinear_inequality_constrants', 'nonlinear_inequality', nic, rdesc)
+        return rdesc
+
+    @staticmethod
+    def dakota_rlev_write(fidi, dresp, params):
+        return
Index: /issm/trunk/src/m/classes/qmu/normal_uncertain.py
===================================================================
--- /issm/trunk/src/m/classes/qmu/normal_uncertain.py	(revision 24312)
+++ /issm/trunk/src/m/classes/qmu/normal_uncertain.py	(revision 24313)
@@ -1,12 +1,12 @@
 import numpy as np
-from vlist_write import *
 from MatlabArray import *
 
+
 class normal_uncertain(object):
-	'''
+    '''
   definition for the normal_uncertain class.
 
   [nuv] = normal_uncertain.normal_uncertain(args)
-   nuv  = normal_uncertain()
+   nuv = normal_uncertain()
 
   where the required args are:
@@ -16,5 +16,5 @@
   and the optional args and defaults are:
     lower         (float, lower bound, -np.Inf)
-    upper         (float, upper bound,  np.Inf)
+    upper         (float, upper bound, np.Inf)
 
   note that zero arguments constructs a default instance, one
@@ -22,160 +22,158 @@
   arguments constructs a new instance from the arguments.
 '''
-	def __init__(self):
-		self.descriptor = ''
-		self.mean       = float('NaN')
-		self.stddev     = float('NaN')
-		self.lower      =-np.Inf
-		self.upper      = np.Inf
+    def __init__(self):
+        self.descriptor = ''
+        self.mean = float('NaN')
+        self.stddev = float('NaN')
+        self.lower = -np.Inf
+        self.upper = np.Inf
 
-	@staticmethod    
-	def normal_uncertain(*args):
-		nargin = len(args)
+    @staticmethod
+    def normal_uncertain(*args):
+        nargin = len(args)
 
-		# create a default object
-		if nargin == 0:
-			return normal_uncertain()
+        # create a default object
+        if nargin == 0:
+            return normal_uncertain()
 
-		# copy the object
-                elif nargin == 1:
-			if isinstance(args[0],normal_uncertain):
-				nuv = args[0]
-			else:
-				raise RuntimeError('Object '+str(args[0])+' is a '+str(type(args[0]))+' class object, not "normal_uncertain".')
+        # copy the object
+        elif nargin == 1:
+            if isinstance(args[0], normal_uncertain):
+                nuv = args[0]
+            else:
+                raise RuntimeError('Object ' + str(args[0]) + ' is a ' + str(type(args[0])) + ' class object, not "normal_uncertain".')
 
-		# not enough arguments
-                elif nargin == 2:
-                    raise RuntimeError('Construction of "normal_uncertain" class object requires at least 3 inputs.')
+        # not enough arguments
+        elif nargin == 2:
+            raise RuntimeError('Construction of "normal_uncertain" class object requires at least 3 inputs.')
 
-		# create the object from the input
-                else:
-			# lines differ here in other classes/tests; see asizec problem in notes
-			nuv=normal_uncertain()
+    # create the object from the input
+        else:
+            # lines differ here in other classes / tests; see asizec problem in notes
+            nuv = normal_uncertain()
+            nuv.descriptor = str(args[0])
+            nuv.mean = args[1]
+            nuv.stddev = args[2]
+            if nargin >= 4:
+                nuv.lower = args[3]
+            if nargin >= 5:
+                nuv.upper = args[4]
+            if nargin > 5:
+                print('WARNING: normal_uncertain:extra_arg: Extra arguments for object of class ' + str(type(nuv)) + '.')
 
-			nuv.descriptor = str(args[0])
-			nuv.mean   = args[1]     
-			nuv.stddev = args[2]
-			if nargin >= 4:
-				nuv.lower = args[3]
-			if nargin >= 5:
-				nuv.upper = args[4]
-			if nargin > 5:
-				print 'WARNING: normal_uncertain:extra_arg: Extra arguments for object of class '+str(type(nuv))+'.'
+        return [nuv]
 
-		return [nuv]
+    def __repr__(self):
+        # display an individual object
+        string = '\n'
+        string += 'class "normal_uncertain" object = \n'
+        string += '    descriptor: ' + str(self.descriptor) + '\n'
+        string += '          mean: ' + str(self.mean) + '\n'
+        string += '        stddev: ' + str(self.stddev) + '\n'
+        string += '         lower: ' + str(self.lower) + '\n'
+        string += '         upper: ' + str(self.upper) + '\n'
 
-	def __repr__(self):
-		# display an individual object
-		string = '\n'
-		string += 'class "normal_uncertain" object = \n'
-		string += '    descriptor: '+str(self.descriptor) + '\n'
-		string += '          mean: '+str(self.mean) + '\n'
-		string += '        stddev: '+str(self.stddev) + '\n'
-		string += '         lower: '+str(self.lower) + '\n'
-		string += '         upper: '+str(self.upper) + '\n'
+        return string
 
-		return string
+    # from here on, nuv is either a single, or a 1d vector of, normal_uncertain
 
-	# from here on, nuv is either a single, or a 1d vector of, normal_uncertain
+    @staticmethod
+    def prop_desc(nuv, dstr):
+        if type(nuv) not in [list, np.ndarray]:
+            if nuv.descriptor != '' or type(nuv.descriptor) != str:
+                desc = str(nuv.descriptor)
+            elif dstr != '':
+                desc = str(dstr)
+            else:
+                desc = 'nuv'
+            return desc
 
-	@staticmethod
-	def prop_desc(nuv,dstr):
-		if type(nuv) not in [list,np.ndarray]:
-			if nuv.descriptor != '' or type(nuv.descriptor) != str:
-				desc = str(nuv.descriptor)
-			elif dstr != '':
-				desc = str(dstr)
-			else:
-				desc = 'nuv'
-			return desc
+        desc = ['' for i in range(np.size(nuv))]
+        for i in range(np.size(nuv)):
+            if nuv[i].descriptor != '' or type(nuv[i].descriptor) != str:
+                desc[i] = str(nuv[i].descriptor)
+            elif dstr != '':
+                desc[i] = str(dstr) + str(string_dim(nuv, i, 'vector'))
+            else:
+                desc[i] = 'nuv' + str(string_dim(nuv, i, 'vector'))
 
-		desc = ['' for i in range(np.size(nuv))]
-		for i in range(np.size(nuv)):
-			if nuv[i].descriptor != '' or type(nuv[i].descriptor) != str:
-				desc[i] = str(nuv[i].descriptor)
-			elif dstr != '':
-				desc[i] = str(dstr)+str(string_dim(nuv,i,'vector'))
-			else:
-				desc[i] = 'nuv'+str(string_dim(nuv,i,'vector'))
-                
-		desc = allempty(desc)
+        desc = allempty(desc)
 
-		return desc
+        return desc
 
-	@staticmethod        
-	def prop_initpt(nuv):
-		initpt=[]
-		return initpt
+    @staticmethod
+    def prop_initpt(nuv):
+        initpt = []
+        return initpt
 
-	@staticmethod        
-	def prop_lower(nuv):
-		if type(nuv) not in [list,np.ndarray]:
-			return nuv.lower
+    @staticmethod
+    def prop_lower(nuv):
+        if type(nuv) not in [list, np.ndarray]:
+            return nuv.lower
 
-		lower = np.zeros(np.size(nuv))
-		for i in range(np.size(nuv)):
-			lower[i] = nuv[i].lower
+        lower = np.zeros(np.size(nuv))
+        for i in range(np.size(nuv)):
+            lower[i] = nuv[i].lower
 
-		lower = allequal(lower,-np.inf)
+        lower = allequal(lower, -np.inf)
 
-		return lower
+        return lower
 
-	@staticmethod        
-	def prop_upper(nuv):
-		if type(nuv) not in [list,np.ndarray]:
-			return nuv.upper
+    @staticmethod
+    def prop_upper(nuv):
+        if type(nuv) not in [list, np.ndarray]:
+            return nuv.upper
 
-		upper = np.zeros(np.size(nuv))
-		for i in range(np.size(nuv)):
-			upper[i] = nuv[i].upper
+        upper = np.zeros(np.size(nuv))
+        for i in range(np.size(nuv)):
+            upper[i] = nuv[i].upper
 
-		upper = allequal(upper,-np.inf)
+        upper = allequal(upper, -np.inf)
+        return upper
 
-		return upper
+    @staticmethod
+    def prop_mean(nuv):
+        if type(nuv) not in [list, np.ndarray]:
+            return nuv.mean
 
-	@staticmethod        
-	def prop_mean(nuv):
-		if type(nuv) not in [list,np.ndarray]:
-			return nuv.mean
+        mean = np.zeros(np.size(nuv))
+        for i in range(np.size(nuv)):
+            mean[i] = nuv[i].mean
 
-		mean = np.zeros(np.size(nuv))
-		for i in range(np.size(nuv)):
-			mean[i] = nuv[i].mean
+        return mean
 
-		return mean
+    @staticmethod
+    def prop_stddev(nuv):
+        if type(nuv) not in [list, np.ndarray]:
+            return nuv.stddev
 
-	@staticmethod        
-	def prop_stddev(nuv):
-		if type(nuv) not in [list,np.ndarray]:
-			return nuv.stddev
+        stddev = np.zeros(np.size(nuv))
+        for i in range(np.size(nuv)):
+            stddev[i] = nuv[i].stddev
 
-		stddev = np.zeros(np.size(nuv))
-		for i in range(np.size(nuv)):
-			stddev[i] = nuv[i].stddev
+        return stddev
 
-		return stddev        
+    @staticmethod
+    def prop_initst(nuv):
+        initst = []
+        return initst
 
-	@staticmethod
-	def prop_initst(nuv):
-		initst=[]
-		return initst
+    @staticmethod
+    def prop_stype(nuv):
+        stype = []
+        return stype
 
-	@staticmethod        
-	def prop_stype(nuv):
-		stype=[]
-		return stype
+    @staticmethod
+    def prop_scale(nuv):
+        scale = []
+        return scale
 
-	@staticmethod        
-	def prop_scale(nuv):
-		scale=[]
-        	return scale
+    @staticmethod
+    def dakota_write(fidi, dvar):
+        # collect only the variables of the appropriate class
+        nuv = [struc_class(i, 'normal_uncertain', 'nuv') for i in dvar]
 
-	@staticmethod
-	def dakota_write(fidi,dvar):
-		# collect only the variables of the appropriate class
-		nuv = [struc_class(i,'normal_uncertain','nuv') for i in dvar]
-
-		# possible namespace pollution, the above import seems not to work		
-		from vlist_write import *
-		# write variables
-		vlist_write(fidi,'normal_uncertain','nuv',nuv)
+    # possible namespace pollution, the above import seems not to work
+        from vlist_write import vlist_write
+    # write variables
+        vlist_write(fidi, 'normal_uncertain', 'nuv', nuv)
Index: /issm/trunk/src/m/classes/qmu/objective_function.py
===================================================================
--- /issm/trunk/src/m/classes/qmu/objective_function.py	(revision 24312)
+++ /issm/trunk/src/m/classes/qmu/objective_function.py	(revision 24313)
@@ -3,10 +3,11 @@
 from MatlabArray import *
 
+
 class objective_function(object):
-	'''
+    '''
   definition for the objective_function class.
 
   [of] = objective_function.objective_function(args)
-   of  = objective_function()
+   of = objective_function()
 
   where the required args are:
@@ -21,158 +22,152 @@
   arguments constructs a new instance from the arguments.
 '''
-	def __init__(self):
-		self.descriptor = ''
-		self.scale_type = 'none'
-		self.scale      =  1.
-		self.weight     =  1.
+    def __init__(self):
+        self.descriptor = ''
+        self.scale_type = 'none'
+        self.scale = 1.
+        self.weight = 1.
 
-	@staticmethod
-	def objective_function(*args):
-		nargin = len(args)
+    @staticmethod
+    def objective_function(*args):
+        nargin = len(args)
 
-		#  create a default object
-		if nargin == 0:
-			return objective_function()
+    #  create a default object
+        if nargin == 0:
+            return objective_function()
 
-		#  copy the object or create the object from the input
-                else:
-			if  (nargin == 1) and isinstance(args[0],objective_function):
-				of = args[0]
-			else:
-				shapec = array_size(*args[0:min(nargin,4)])
-				of = [objective_function() for i in range(shapec[0]) for j in range(shapec[1])]
+    #  copy the object or create the object from the input
+        else:
+            if (nargin == 1) and isinstance(args[0], objective_function):
+                of = args[0]
+            else:
+                shapec = array_size(*args[0:min(nargin, 4)])
+                of = [objective_function() for i in range(shapec[0]) for j in range(shapec[1])]
 
-		          	for i in range(np.size(of)):
-					if (np.size(args[0]) > 1):
-						of[i].descriptor         = args[0][i]
-					else:
-						of[i].descriptor         = str(args[0])+string_dim(of,i,'vector')
+                for i in range(np.size(of)):
+                    if (np.size(args[0]) > 1):
+                        of[i].descriptor = args[0][i]
+                    else:
+                        of[i].descriptor = str(args[0]) + string_dim(of, i, 'vector')
 
-				if (nargin >= 2):                            
-					for i in range(np.size(of)):
-						if (np.size(args[1]) > 1):
-							of[i].scale_type = args[1][i]
-						else:
-							of[i].scale_type = str(args[1])
+                if (nargin >= 2):
+                    for i in range(np.size(of)):
+                        if (np.size(args[1]) > 1):
+                            of[i].scale_type = args[1][i]
+                        else:
+                            of[i].scale_type = str(args[1])
 
-				if (nargin >= 3):
-					for i in range(np.size(of)):
-						if (np.size(args[2]) > 1):
-							of[i].scale      = args[2][i]
-						else:
-							of[i].scale      = args[2]
+                if (nargin >= 3):
+                    for i in range(np.size(of)):
+                        if (np.size(args[2]) > 1):
+                            of[i].scale = args[2][i]
+                        else:
+                            of[i].scale = args[2]
 
-				if (nargin >= 4):
-					for i in range(np.size(of)):
-						if (np.size(args[3]) > 1):
-							of[i].weight     = args[3][i]
-						else:
-							of[i].weight     = args[3]
+                if (nargin >= 4):
+                    for i in range(np.size(of)):
+                        if (np.size(args[3]) > 1):
+                            of[i].weight = args[3][i]
+                        else:
+                            of[i].weight = args[3]
 
-				if (nargin > 4):
-					print 'WARNING: objective_function:extra_arg Extra arguments for object of class '+str(type(of))+'.'
+                if (nargin > 4):
+                    print('WARNING: objective_function:extra_arg Extra arguments for object of class ' + str(type(of)) + '.')
 
-		return of
+        return of
 
+    def __repr__(self):
+        #  display the object
+        string = '\n'
+        string += 'class "objective_function" object = \n'
+        string += '    descriptor: ' + str(self.descriptor) + '\n'
+        string += '    scale_type: ' + str(self.scale_type) + '\n'
+        string += '         scale: ' + str(self.scale) + '\n'
+        string += '        weight: ' + str(self.weight) + '\n'
+        return string
 
-	def __repr__(self):
-		#  display the object
-		string  = '\n'
-		string += 'class "objective_function" object = \n'
-		string += '    descriptor: '  +str(self.descriptor) + '\n'
-		string += '    scale_type: '  +str(self.scale_type) + '\n'
-		string += '         scale: '  +str(self.scale) + '\n'
-		string += '        weight: '  +str(self.weight) + '\n'
-	
-		return string
+    @staticmethod
+    def prop_desc(of, dstr):
+        if type(of) not in [list, np.ndarray]:
+            if of.descriptor != '' or type(of.descriptor) != str:
+                desc = str(of.descriptor)
+            elif dstr != '':
+                desc = str(dstr)
+            else:
+                desc = 'of'
+            return desc
 
-	@staticmethod
-	def prop_desc(of,dstr):
-		if type(of) not in [list,np.ndarray]:
-			if of.descriptor != '' or type(of.descriptor) != str:
-				desc = str(of.descriptor)
-			elif dstr != '':
-				desc = str(dstr)
-			else:
-				desc = 'of'
-			return desc
+        desc = ['' for i in range(np.size(of))]
+        for i in range(np.size(of)):
+            if of[i].descriptor != '' or type(of[i].descriptor) != str:
+                desc[i] = str(of[i].descriptor)
+            elif dstr != '':
+                desc[i] = str(dstr) + str(string_dim(of, i, 'vector'))
+            else:
+                desc[i] = 'of' + str(string_dim(of, i, 'vector'))
 
-		desc = ['' for i in range(np.size(of))]
-		for i in range(np.size(of)):
-			if of[i].descriptor != '' or type(of[i].descriptor) != str:
-				desc[i] = str(of[i].descriptor)
-			elif dstr != '':
-				desc[i] = str(dstr)+str(string_dim(of,i,'vector'))
-			else:
-				desc[i] = 'of'+str(string_dim(of,i,'vector'))
-                
-		desc = allempty(desc)
+        desc = allempty(desc)
+        return desc
 
-		return desc
+    @staticmethod
+    def prop_lower(of):
+        lower = []
+        return lower
 
-	@staticmethod
-	def prop_lower(of):
-		lower=[]
-		return lower
+    @staticmethod
+    def prop_upper(of):
+        upper = []
+        return upper
 
-	@staticmethod
-	def prop_upper(of):
-		upper=[]
-		return upper
+    @staticmethod
+    def prop_target(of):
+        target = []
+        return target
 
-	@staticmethod
-	def prop_target(of):
-		target=[]
-		return target
+    @staticmethod
+    def prop_weight(of):
+        if type(of) not in [list, np.ndarray]:
+            return of.weight
 
-	@staticmethod
-	def prop_weight(of):
-		if type(of) not in [list,np.ndarray]:
-			return of.weight
+        weight = np.zeros(np.shape(of))
+        for i in range(np.size(of)):
+            weight[i] = of[i].weight
 
-		weight = np.zeros(np.shape(of))
-		for i in range(np.size(of)):
-			weight[i] = of[i].weight
-		
-		weight = allequal(weight,1.)
+        weight = allequal(weight, 1.)
+        return weight
 
-		return weight
+    @staticmethod
+    def prop_stype(of):
+        if type(of) not in [list, np.ndarray]:
+            return of.scale_type
 
-	@staticmethod
-	def prop_stype(of):
-		if type(of) not in [list,np.ndarray]:
-			return of.scale_type
+        stype = ['' for i in range(np.size(of))]
+        for i in range(np.size(of)):
+            stype[i] = str(of[i].scale_type)
 
-		stype = ['' for i in range(np.size(of))]
-		for i in range(np.size(of)):
-			stype[i] = str(of[i].scale_type)
-		
-		stype = allequal(stype,'none')
+        stype = allequal(stype, 'none')
+        return stype
 
-		return stype
+    @staticmethod
+    def prop_scale(of):
+        if type(of) not in [list, np.ndarray]:
+            return of.scale
 
-	@staticmethod
-	def prop_scale(of):
-		if type(of) not in [list,np.ndarray]:
-			return of.scale
+        scale = np.zeros(np.shape(of))
+        for i in range(np.size(of)):
+            scale[i] = of[i].scale
 
-		scale = np.zeros(np.shape(of))
-		for i in range(np.size(of)):
-			scale[i] = of[i].scale
-		
-		scale = allequal(scale,1.)
+        scale = allequal(scale, 1.)
+        return scale
 
-		return scale
-    
-	@staticmethod
-	def dakota_write(fidi,dresp,rdesc):
-		# coloft only the variables of the appropriate class
-		of = [struc_class(i,'objective_functions','of') for i in dresp]
+    @staticmethod
+    def dakota_write(fidi, dresp, rdesc):
+        # coloft only the variables of the appropriate class
+        of = [struc_class(i, 'objective_functions', 'of') for i in dresp]
 
-		# write constraints
-		rdesc = rlist_write(fidi,'objective_functions','objective_function',of,rdesc)
-		return rdesc
+        # write constraints
+        rdesc = rlist_write(fidi, 'objective_functions', 'objective_function', of, rdesc)
+        return rdesc
 
-	@staticmethod
-	def dakota_rlev_write(fidi,dresp,params):
-		return
+    @staticmethod
+    def dakota_rlev_write(fidi, dresp, params):
+        return
Index: /issm/trunk/src/m/classes/qmu/response_function.py
===================================================================
--- /issm/trunk/src/m/classes/qmu/response_function.py	(revision 24312)
+++ /issm/trunk/src/m/classes/qmu/response_function.py	(revision 24313)
@@ -1,16 +1,16 @@
 import numpy as np
-from rlist_write import *
+#from rlist_write import *
 from rlev_write import *
 from MatlabArray import *
-
 #move this later
 from helpers import *
 
+
 class response_function(object):
-	'''
+    '''
   definition for the response_function class.
 
   [rf] = response_function.response_function(args)
-   rf  = response_function()
+   rf = response_function()
 
   where the required args are:
@@ -27,165 +27,159 @@
 '''
 
-	def __init__(self):
-		self.descriptor = ''
-		self.respl      = []
-		self.probl      = []
-		self.rell       = []
-		self.grell      = []
+    def __init__(self):
+        self.descriptor = ''
+        self.respl = []
+        self.probl = []
+        self.rell = []
+        self.grell = []
 
-	@staticmethod
-        def response_function(*args):
+    @staticmethod
+    def response_function(*args):
 
-		nargin = len(args)
-		# create a default object
-		if nargin == 0:
-			return response_function()
+        nargin = len(args)
+        # create a default object
+        if nargin == 0:
+            return response_function()
 
-		# copy the object or create the object from the input
-		else:
-			if  nargin == 1 and isinstance(args[0],response_function):
-				rf = args[0]
-			else:
-				asizec = array_size(*args[0:min(nargin,1)])
-				rf = [response_function() for i in range(asizec[0]) for j in range(asizec[1])]
-                        
-				for i in range(np.size(rf)):
-					if (np.size(args[0]) > 1):
-						rf[i].descriptor = args[0][i]
-					else:
-						rf[i].descriptor = str(args[0])+string_dim(rf,i,'vector')
+        # copy the object or create the object from the input
+        else:
+            if nargin == 1 and isinstance(args[0], response_function):
+                rf = args[0]
+            else:
+                asizec = array_size(*args[0:min(nargin, 1)])
+                rf = [response_function() for i in range(asizec[0]) for j in range(asizec[1])]
 
-				if nargin >= 2:
-					for i in range(np.size(rf)):
-						rf[i].respl = args[1]
+                for i in range(np.size(rf)):
+                    if (np.size(args[0]) > 1):
+                        rf[i].descriptor = args[0][i]
+                    else:
+                        rf[i].descriptor = str(args[0]) + string_dim(rf, i, 'vector')
 
-				if nargin >= 3:
-					for i in range(np.size(rf)):
-						rf[i].probl = args[2]
+                if nargin >= 2:
+                    for i in range(np.size(rf)):
+                        rf[i].respl = args[1]
 
-				if nargin >= 4:
-					for i in range(np.size(rf)):
-						rf[i].rell = args[3]
+                if nargin >= 3:
+                    for i in range(np.size(rf)):
+                        rf[i].probl = args[2]
 
-				if nargin >= 5:
-					for i in range(np.size(rf)):
-						rf[i].grell = args[4]
+                if nargin >= 4:
+                    for i in range(np.size(rf)):
+                        rf[i].rell = args[3]
 
-				if nargin > 5:
-					print 'WARNING: response_function:extra_arg: Extra arguments for object of class '+str(type(rf))+'.'
+                if nargin >= 5:
+                    for i in range(np.size(rf)):
+                        rf[i].grell = args[4]
 
-		return rf
+                if nargin > 5:
+                    print('WARNING: response_function:extra_arg: Extra arguments for object of class ' + str(type(rf)) + '.')
 
-           
-	def __repr__(self):
-		#  display the object
-		string = '\n'
-		string += 'class "response_function" object = \n'
-		string += '    descriptor: '  +str(self.descriptor) + '\n'
-		string += '         respl: '  +str(self.respl) + '\n'
-		string += '         probl: '  +str(self.probl) + '\n'
-		string += '          rell: '  +str(self.rell) + '\n'
-		string += '         grell: '  +str(self.grell) + '\n'
+        return rf
 
-		return string
+    def __repr__(self):
+        #  display the object
+        string = '\n'
+        string += 'class "response_function" object = \n'
+        string += '    descriptor: ' + str(self.descriptor) + '\n'
+        string += '         respl: ' + str(self.respl) + '\n'
+        string += '         probl: ' + str(self.probl) + '\n'
+        string += '          rell: ' + str(self.rell) + '\n'
+        string += '         grell: ' + str(self.grell) + '\n'
 
-	def __len__(self):
-		return max(len(self.respl),len(self.probl),len(self.rell),len(self.grell))
+        return string
 
-	# from here on, rf is either a single, or a 1d vector of, response_function
+    def __len__(self):
+        return max(len(self.respl), len(self.probl), len(self.rell), len(self.grell))
 
-	@staticmethod
-	def prop_desc(rf,dstr):
-		# response_function is always a vector, or should be, even with just 1
-		if type(rf) not in [list,np.ndarray]:
-			rf = [rf]
+    # from here on, rf is either a single, or a 1d vector of, response_function
 
-		desc = ['' for i in range(np.size(rf))]
-		for i in range(np.size(rf)):
-			if rf[i].descriptor != '' or type(rf[i].descriptor) != str:
-				desc[i] = str(rf[i].descriptor)
-			elif dstr != '':
-				desc[i] = str(dstr)+str(string_dim(rf,i,'vector'))
-			else:
-				desc[i] = 'rf'+str(string_dim(rf,i,'vector'))
-                
-		desc = allempty(desc)
+    @staticmethod
+    def prop_desc(rf, dstr):
+        # response_function is always a vector, or should be, even with just 1
+        if type(rf) not in [list, np.ndarray]:
+            rf = [rf]
 
-		return desc
+        desc = ['' for i in range(np.size(rf))]
+        for i in range(np.size(rf)):
+            if rf[i].descriptor != '' or type(rf[i].descriptor) != str:
+                desc[i] = str(rf[i].descriptor)
+            elif dstr != '':
+                desc[i] = str(dstr) + str(string_dim(rf, i, 'vector'))
+            else:
+                desc[i] = 'rf' + str(string_dim(rf, i, 'vector'))
 
-	@staticmethod
-	def prop_stype(rf):
-		stype=[]
-		return stype
-        
-	@staticmethod
-	def prop_scale(rf):
-		scale=[]
-		return scale
-        
-	@staticmethod
-	def prop_weight(rf):
-		weight=[]
-		return weight
-        
-	@staticmethod
-	def prop_lower(rf):
-		lower=[]
-		return lower
-        
-	@staticmethod
-	def prop_upper(rf):
-		upper=[]
-		return upper
-        
-	@staticmethod
-	def prop_target(rf):
-		target=[]
-		return target
-        
-	@staticmethod
-	def prop_levels(rf):
-		# response_function is always a vector, or should be, even with just 1
-		if type(rf) not in [list,np.ndarray]:
-			rf = [rf]
+        desc = allempty(desc)
+        return desc
 
-		respl = empty_nd_list(np.size(rf))
+    @staticmethod
+    def prop_stype(rf):
+        stype = []
+        return stype
 
-		probl = empty_nd_list(np.size(rf))
+    @staticmethod
+    def prop_scale(rf):
+        scale = []
+        return scale
 
-		rell = empty_nd_list(np.size(rf))
+    @staticmethod
+    def prop_weight(rf):
+        weight = []
+        return weight
 
-		grell = empty_nd_list(np.size(rf))
+    @staticmethod
+    def prop_lower(rf):
+        lower = []
+        return lower
 
-		for i in range(np.size(rf)):
-			respl[i] = rf[i].respl
-                	probl[i] = rf[i].probl
-			rell [i] = rf[i].rell
-                	grell[i] = rf[i].grell
-            
-		respl = allempty(respl)
-		probl = allempty(probl)
-		rell  = allempty(rell)
-		grell = allempty(grell)
-        
-    		return [respl,probl,rell,grell]
+    @staticmethod
+    def prop_upper(rf):
+        upper = []
+        return upper
 
-	@staticmethod
-	def dakota_write(fidi,dresp,rdesc):
-		# collect only the responses of the appropriate class
-		rf = [struc_class(vars(dresp)[i][j],'response_function','rf') for i in fieldnames(dresp) for j in range(len(vars(dresp)[i]))]
+    @staticmethod
+    def prop_target(rf):
+        target = []
+        return target
 
-		#possible namespace pollution here
-		from rlist_write import rlist_write
-		# write responses
-		rdesc = rlist_write(fidi,'response_function','rf',rf,rdesc)
+    @staticmethod
+    def prop_levels(rf):
+        # response_function is always a vector, or should be, even with just 1
+        if type(rf) not in [list, np.ndarray]:
+            rf = [rf]
 
-		return rdesc
+        respl = empty_nd_list(np.size(rf))
+        probl = empty_nd_list(np.size(rf))
+        rell = empty_nd_list(np.size(rf))
+        grell = empty_nd_list(np.size(rf))
 
-	@staticmethod
-	def dakota_rlev_write(fidi,dresp,params):
-		# collect only the responses of the appropriate class
-		rf = [struc_class(vars(dresp)[i][j],'response_function','rf') for i in fieldnames(dresp) for j in range(len(vars(dresp)[i]))]
+        for i in range(np.size(rf)):
+            respl[i] = rf[i].respl
+            probl[i] = rf[i].probl
+            rell[i] = rf[i].rell
+            grell[i] = rf[i].grell
 
-		# write response levels
-		rlev_write(fidi,rf,'response_function',params)
+        respl = allempty(respl)
+        probl = allempty(probl)
+        rell = allempty(rell)
+        grell = allempty(grell)
+        return [respl, probl, rell, grell]
+
+    @staticmethod
+    def dakota_write(fidi, dresp, rdesc):
+        # collect only the responses of the appropriate class
+        rf = [struc_class(vars(dresp)[i][j], 'response_function', 'rf') for i in fieldnames(dresp) for j in range(len(vars(dresp)[i]))]
+
+        #possible namespace pollution here
+        from rlist_write import rlist_write
+        # write responses
+        rdesc = rlist_write(fidi, 'response_function', 'rf', rf, rdesc)
+
+        return rdesc
+
+    @staticmethod
+    def dakota_rlev_write(fidi, dresp, params):
+        # collect only the responses of the appropriate class
+        rf = [struc_class(vars(dresp)[i][j], 'response_function', 'rf') for i in fieldnames(dresp) for j in range(len(vars(dresp)[i]))]
+
+        # write response levels
+        rlev_write(fidi, rf, 'response_function', params)
Index: /issm/trunk/src/m/classes/qmu/uniform_uncertain.py
===================================================================
--- /issm/trunk/src/m/classes/qmu/uniform_uncertain.py	(revision 24312)
+++ /issm/trunk/src/m/classes/qmu/uniform_uncertain.py	(revision 24313)
@@ -1,17 +1,18 @@
 import numpy as np
-from vlist_write import *
+#from vlist_write import *
 from MatlabArray import *
 
+
 class uniform_uncertain(object):
-	'''
+    '''
   definition for the uniform_uncertain class.
 
   [uuv] = uniform_uncertain.uniform_uncertain(args)
-   uuv  = uniform_uncertain()
+   uuv = uniform_uncertain()
 
   where the required args are:
     descriptor    (str, description, '')
     lower         (float, lower bound, -np.Inf)
-    upper         (float, upper bound,  np.Inf)
+    upper         (float, upper bound, np.Inf)
 
   note that zero arguments constructs a default instance, one
@@ -20,145 +21,140 @@
 '''
 
-	def __init__(self):
-		self.descriptor = ''
-		self.lower      = -np.Inf
-		self.upper      =  np.Inf
+    def __init__(self):
+        self.descriptor = ''
+        self.lower = -np.Inf
+        self.upper = np.Inf
 
-	@staticmethod
-	def uniform_uncertain(*args):
-		nargin = len(args)
+    @staticmethod
+    def uniform_uncertain(*args):
+        nargin = len(args)
 
-		# create a default object
-		if nargin == 0:
-			return uniform_uncertain()
+        # create a default object
+        if nargin == 0:
+            return uniform_uncertain()
 
-		# copy the object
-		elif nargin == 1:
-			if isinstance(args[0],uniform_uncertain):
-				uuv = args[0]
-			else:
-				raise RuntimeError('Object '+str(args[0])+' is a '+str(type(args[0]))+' class object, not "uniform_uncertain".')
+        # copy the object
+        elif nargin == 1:
+            if isinstance(args[0], uniform_uncertain):
+                uuv = args[0]
+            else:
+                raise RuntimeError('Object ' + str(args[0]) + ' is a ' + str(type(args[0])) + ' class object, not "uniform_uncertain".')
 
-		# not enough arguments
+        # not enough arguments
+        elif nargin == 2:
+            raise RuntimeError('Construction of "uniform_uncertain" class object requires at least 3 inputs.')
 
-		elif nargin == 2:
-			raise RuntimeError('Construction of "uniform_uncertain" class object requires at least 3 inputs.')
+        # create the object from the input
+        else:
+            # leaving this here in case it becomes important in the future
+            #asizec = array_size(*args[0:min(nargin, 3)])
+            #uuv = [uniform_uncertain() for i in range(asizec[0]) for j in range(asizec[1])]
+            uuv = uniform_uncertain()
+            uuv.descriptor = str(args[0])
+            uuv.lower = args[1]
+            uuv.upper = args[2]
+        if (nargin > 3):
+            print('WARNING: uniform_uncertain:extra_arg: Extra arguments for object of class ' + type(uuv) + '.')
 
-		# create the object from the input
-		else:
-			# leaving this here in case it becomes important in the future
-			#asizec=array_size(*args[0:min(nargin,3)])
-			#uuv = [uniform_uncertain() for i in range(asizec[0]) for j in range(asizec[1])]
+        return [uuv]
 
-                    	uuv = uniform_uncertain()
+    def __repr__(self):
+        # display an individual object
+        string = '\n'
+        string += 'class "uniform_uncertain" object = \n'
+        string += '    descriptor: ' + str(self.descriptor) + '\n'
+        string += '         lower: ' + str(self.lower) + '\n'
+        string += '         upper: ' + str(self.upper) + '\n'
 
-			uuv.descriptor = str(args[0])
-			uuv.lower      = args[1]
-			uuv.upper      = args[2]
-		if (nargin > 3):
-			print 'WARNING: uniform_uncertain:extra_arg: Extra arguments for object of class '+type(uuv)+'.'
+        return string
 
-		return [uuv]
+    # from here on, uuv is either a single, or a 1d vector of, uniform_uncertain
 
+    @staticmethod
+    def prop_desc(uuv, dstr):
+        if type(uuv) not in [list, np.ndarray]:
+            if uuv.descriptor != '' or type(uuv.descriptor) != str:
+                desc = str(uuv.descriptor)
+            elif dstr != '':
+                desc = str(dstr)
+            else:
+                desc = 'uuv'
+            return desc
 
-        def __repr__(self):
-		# display an individual object
-		string = '\n'
-		string += 'class "uniform_uncertain" object = \n'
-		string += '    descriptor: ' + str(self.descriptor) + '\n'
-		string += '         lower: ' + str(self.lower) + '\n'
-		string += '         upper: ' + str(self.upper) + '\n'
+        desc = ['' for i in range(np.size(uuv))]
+        for i in range(np.size(uuv)):
+            if uuv[i].descriptor != '' or type(uuv[i].descriptor) != str:
+                desc[i] = str(uuv[i].descriptor)
+            elif dstr != '':
+                desc[i] = str(dstr) + str(string_dim(uuv, i, 'vector'))
+            else:
+                desc[i] = 'uuv' + str(string_dim(uuv, i, 'vector'))
 
-		return string
+            desc = allempty(desc)
 
-	# from here on, uuv is either a single, or a 1d vector of, uniform_uncertain
+        return desc
 
-	@staticmethod
-	def prop_desc(uuv,dstr):
-		if type(uuv) not in [list,np.ndarray]:
-			if uuv.descriptor != '' or type(uuv.descriptor) != str:
-				desc = str(uuv.descriptor)
-			elif dstr != '':
-				desc = str(dstr)
-			else:
-				desc = 'uuv'
-			return desc
+    @staticmethod
+    def prop_initpt(uuv):
+        initpt = []
+        return initpt
 
-		desc = ['' for i in range(np.size(uuv))]
-		for i in range(np.size(uuv)):
-			if uuv[i].descriptor != '' or type(uuv[i].descriptor) != str:
-				desc[i] = str(uuv[i].descriptor)
-			elif dstr != '':
-				desc[i] = str(dstr)+str(string_dim(uuv,i,'vector'))
-			else:
-				desc[i] = 'uuv'+str(string_dim(uuv,i,'vector'))
-                
-			desc = allempty(desc)
+    @staticmethod
+    def prop_lower(uuv):
+        if type(uuv) not in [list, np.ndarray]:
+            return uuv.lower
 
-		return desc
-        
-	@staticmethod
-	def prop_initpt(uuv):
-		initpt=[]
-		return initpt
-        
-	@staticmethod
-	def prop_lower(uuv):
-		if type(uuv) not in [list,np.ndarray]:
-			return uuv.lower
+        lower = np.zeros(np.size(uuv))
+        for i in range(np.size(uuv)):
+            lower[i] = uuv[i].lower
 
-		lower = np.zeros(np.size(uuv))
-		for i in range(np.size(uuv)):
-			lower[i] = uuv[i].lower
-            
-		lower = allequal(lower,-np.Inf)
+        lower = allequal(lower, -np.Inf)
 
-		return lower
-        
-	@staticmethod
-	def prop_upper(uuv):
-		if type(uuv) not in [list,np.ndarray]:
-			return uuv.upper
+        return lower
 
-		upper = np.zeros(np.size(uuv))
-		for i in range(np.size(uuv)):
-			upper[i] = uuv[i].upper
-            
-		upper = allequal(upper, np.Inf)
+    @staticmethod
+    def prop_upper(uuv):
+        if type(uuv) not in [list, np.ndarray]:
+            return uuv.upper
 
-		return upper
-        
-	@staticmethod
-	def prop_mean(uuv):
-		mean=[]
-		return mean
-        
-	@staticmethod
-	def prop_stddev(uuv):
-		stddev=[]
-		return stddev
-        
-	@staticmethod
-	def prop_initst(uuv):
-		initst=[]
-		return initst
-        
-	@staticmethod
-	def prop_stype(uuv):
-		stype=[]
-		return stype
-       	
-	@staticmethod
-	def prop_scale(uuv):
-		scale=[]
-		return scale
-        
-	@staticmethod
-	def dakota_write(fidi,dvar):
-		# collect only the variables of the appropriate class
-		uuv = [struc_class(i,'uniform_uncertain','uuv') for i in dvar]
-		
-		# possible namespace pollution, the above import seems not to work		
-		from vlist_write import *
-		# write variables
-		vlist_write(fidi,'uniform_uncertain','uuv',uuv)
+        upper = np.zeros(np.size(uuv))
+        for i in range(np.size(uuv)):
+            upper[i] = uuv[i].upper
+
+        upper = allequal(upper, np.Inf)
+
+        return upper
+
+    @staticmethod
+    def prop_mean(uuv):
+        mean = []
+        return mean
+
+    @staticmethod
+    def prop_stddev(uuv):
+        stddev = []
+        return stddev
+
+    @staticmethod
+    def prop_initst(uuv):
+        initst = []
+        return initst
+
+    @staticmethod
+    def prop_stype(uuv):
+        stype = []
+        return stype
+
+    @staticmethod
+    def prop_scale(uuv):
+        scale = []
+        return scale
+
+    @staticmethod
+    def dakota_write(fidi, dvar):
+        # collect only the variables of the appropriate class
+        uuv = [struc_class(i, 'uniform_uncertain', 'uuv') for i in dvar]
+        # possible namespace pollution, the above import seems not to work
+        from vlist_write import vlist_write
+        # write variables
+        vlist_write(fidi, 'uniform_uncertain', 'uuv', uuv)
Index: /issm/trunk/src/m/classes/radar.m
===================================================================
--- /issm/trunk/src/m/classes/radar.m	(revision 24313)
+++ /issm/trunk/src/m/classes/radar.m	(revision 24313)
@@ -0,0 +1,56 @@
+%RADAR class definition
+%
+%   Usage:
+%      radar=radar();
+%      radar=radar('name','Radar1',...
+%						 'definitionname','Outputdefinition1',...
+%						 'ice_period', ones(md.mesh.numberofvertices,1));
+
+classdef radar
+	properties (SetAccess=private)  
+		%radarattenuation
+		name						 = '';
+		definitionstring		 = '';
+	end
+
+	methods
+		function self = extrude(self,md) % {{{
+			return;
+		end % }}}
+		function self = radar(varargin) % {{{
+			if nargin==0,
+				self=setdefaultparameters(self);
+			else
+				%use provided options to change fields
+				options=pairoptions(varargin{:});
+
+				%get name
+				self.name=getfieldvalue(options,'name','');
+				self.definitionstring=getfieldvalue(options,'definitionstring');
+			end
+		end % }}}
+		function self = setdefaultparameters(self) % {{{
+		end % }}}
+		function md = checkconsistency(self,md,solution,analyses) % {{{
+			
+			if ~ischar(self.name),
+				error('radar error message: ''name'' field should be a string!');
+			end	
+			OutputdefinitionStringArray={};
+			for i=1:100
+				OutputdefinitionStringArray{i}=strcat('Outputdefinition',num2str(i));
+			end
+			md = checkfield(md,'field',self.definitionstring,'values',OutputdefinitionStringArray);
+		end % }}}
+		function disp(self) % {{{
+			disp(sprintf('   Radar:\n'));
+
+			fielddisplay(self,'name','identifier for this radar response');
+			fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from ''Outputdefinition[1-100]''');
+		end % }}}
+		function marshall(self,prefix,md,fid) % {{{
+		WriteData(fid,prefix,'data',self.name,'name','md.radar.name','format','String');
+		WriteData(fid,prefix,'data',self.definitionstring, 'name','md.radar.definitionstring','format','String');
+	end % }}}
+	end
+end
Index: /issm/trunk/src/m/classes/radaroverlay.py
===================================================================
--- /issm/trunk/src/m/classes/radaroverlay.py	(revision 24312)
+++ /issm/trunk/src/m/classes/radaroverlay.py	(revision 24313)
@@ -1,29 +1,32 @@
 from fielddisplay import fielddisplay
 
+
 class radaroverlay(object):
-	"""
-	RADAROVERLAY class definition
+    """
+    RADAROVERLAY class definition
 
-	   Usage:
-	      radaroverlay=radaroverlay();
-	"""
+       Usage:
+          radaroverlay = radaroverlay()
+    """
 
-	def __init__(self): # {{{
-		self.pwr = float('NaN')
-		self.x   = float('NaN')
-		self.y   = float('NaN')
+    def __init__(self):  # {{{
+        self.pwr = float('NaN')
+        self.x = float('NaN')
+        self.y = float('NaN')
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		string='   radaroverlay parameters:'
-		string="%s\n%s"%(string,fielddisplay(self,'pwr','radar power image (matrix)'))
-		string="%s\n%s"%(string,fielddisplay(self,'x','corresponding x coordinates [m]'))
-		string="%s\n%s"%(string,fielddisplay(self,'y','corresponding y coordinates [m]'))
-		return string
-		#}}}
-	def setdefaultparameters(self): # {{{
-		return self
-	#}}}
+    #}}}
+
+    def __repr__(self):  # {{{
+        string = '   radaroverlay parameters:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'pwr', 'radar power image (matrix)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'x', 'corresponding x coordinates [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'y', 'corresponding y coordinates [m]'))
+        return string
+    #}}}
+
+    def setdefaultparameters(self):  # {{{
+        return self
+    #}}}
Index: /issm/trunk/src/m/classes/regionaloutput.py
===================================================================
--- /issm/trunk/src/m/classes/regionaloutput.py	(revision 24312)
+++ /issm/trunk/src/m/classes/regionaloutput.py	(revision 24313)
@@ -4,106 +4,109 @@
 from checkfield import checkfield
 from WriteData import WriteData
-from MeshProfileIntersection import MeshProfileIntersection
 from ContourToMesh import ContourToMesh
 import numpy as np
 import os
 
+
 class regionaloutput(object):
-	"""
-	REGIONALOUTPUT class definition
-	
-	   Usage:
-	      regionaloutput=regionaloutput();
-	      regionaloutput=regionaloutput('name','Volume1','definitionstring','Outputdefinition1','outputnamestring','IceVolume','mask',mask);
-	      regionaloutput=regionaloutput('name','Volume1','definitionstring','Outputdefinition1','outputnamestring','IceVolume','maskexpstring','Exp/Mask.exp','model',md)
-	
-	   where mask is a vectorial field of size md.mesh.numberofvertices,1 : where vertices with values > 1 are to be included in the calculated region.
-	   Alternatively, the user can pass in an Argus file and model object instead of a mask, and mask will be calculated for the user
-	"""
+    """
+    REGIONALOUTPUT class definition
 
-	def __init__(self,*args): # {{{
+       Usage:
+          regionaloutput = regionaloutput()
+          regionaloutput = regionaloutput('name', 'Volume1', 'definitionstring', 'Outputdefinition1', 'outputnamestring', 'IceVolume', 'mask', mask)
+          regionaloutput = regionaloutput('name', 'Volume1', 'definitionstring', 'Outputdefinition1', 'outputnamestring', 'IceVolume', 'maskexpstring', 'Exp/Mask.exp', 'model', md)
 
-		self.name              = ''
-		self.definitionstring  = ''
-		self.outputnamestring  = ''
-		self.mask              = float('NaN')
-		self.maskexpstring     = ''
+       where mask is a vectorial field of size md.mesh.numberofvertices, 1 : where vertices with values > 1 are to be included in the calculated region.
+       Alternatively, the user can pass in an Argus file and model object instead of a mask, and mask will be calculated for the user
+    """
 
-		#set defaults
-		self.setdefaultparameters()
+    def __init__(self, *args):  # {{{
 
-		#use provided options to change fields
-		options=pairoptions(*args)
+        self.name = ''
+        self.definitionstring = ''
+        self.outputnamestring = ''
+        self.mask = float('NaN')
+        self.maskexpstring = ''
 
-		#OK get other fields
-		self=options.AssignObjectFields(self)
+    #set defaults
+        self.setdefaultparameters()
 
-		#get name
-		if options.getfieldvalue('model',0):
-			if options.getfieldvalue('maskexpstring',0):
-				modelname=options.getfieldvalue('model')
-				self.maskexpstring=options.getfieldvalue('maskexpstring')
-				self.setmaskfromexp(modelname)
-			
-		if (len(self.mask)<=1 & np.any(np.isnan(self.mask))):
-			error('regionaloutput error message: ''mask'' field or ''maskexpstring'' and ''model'' fields should be defined!');
+    #use provided options to change fields
+        options = pairoptions(*args)
 
-		#}}}
-	def __repr__(self): # {{{
+    #OK get other fields
+        self = options.AssignObjectFields(self)
 
-		string="   Regionaloutput:"
-		string="%s\n%s"%(string,fielddisplay(self,'name','identifier for this regional response'))
-		string="%s\n%s"%(string,fielddisplay(self,'definitionstring','string that identifies this output definition uniquely, from Outputdefinition[1-100]'))
-		string="%s\n%s"%(string,fielddisplay(self,'outputnamestring','string that identifies the type of output you want, eg. IceVolume, TotalSmb, GroudedArea'))
-		string="%s\n%s"%(string,fielddisplay(self,'mask','mask vectorial field which identifies the region of interest (value > 0 will be included)'))
-		string="%s\n%s"%(string,fielddisplay(self,'maskexpstring','name of Argus file that can be passed in to define the regional mask'))
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		self.mask=project3d(md,'vector',self.mask,'type','node')
-		return self
-	   #}}}
-	def setdefaultparameters(self): # {{{
-		return self
-	#}}}
-	def setmaskfromexp(self,md):    # {{{
-		if len(self.maskexpstring) > 0:
-			self.mask=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,self.maskexpstring,'node',1)
-			
-		return self
-	 # }}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		
-		if  not isinstance(self.name, basestring):
-			raise RuntimeError("regionaloutput error message: 'name' field should be a string!")
-			
-		if  not isinstance(self.outputnamestring, basestring):
-			raise RuntimeError("regionaloutput error message: 'outputnamestring' field should be a string!") 
-		
-		if len(self.maskexpstring) > 0:
-			if not os.path.isfile(self.maskexpstring):
-				raise RuntimeError("regionaloutput error message: file name for mask exp does not point to a legitimate file on disk!")
-			else:
-				self.setmaskfromexp(md)
+    #get name
+        if options.getfieldvalue('model', 0):
+            if options.getfieldvalue('maskexpstring', 0):
+                modelname = options.getfieldvalue('model')
+                self.maskexpstring = options.getfieldvalue('maskexpstring')
+                self.setmaskfromexp(modelname)
 
-		OutputdefinitionStringArray=[]
-		for i in range(1,100):
-			x='Outputdefinition'+str(i)
-			OutputdefinitionStringArray.append(x)
+        if (len(self.mask) <= 1 & np.any(np.isnan(self.mask))):
+            error('regionaloutput error message: ''mask'' field or ''maskexpstring'' and ''model'' fields should be defined!')
 
-		md = checkfield(md,'field',self.definitionstring,'values',OutputdefinitionStringArray)
-		md = checkfield(md,'field',self.mask,'size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+    #}}}
 
-		#before marshalling, make sure mask is set: 
-		self.setmaskfromexp(md)
+    def __repr__(self):  # {{{
+        string = "   Regionaloutput:"
+        string = "%s\n%s" % (string, fielddisplay(self, 'name', 'identifier for this regional response'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'definitionstring', 'string that identifies this output definition uniquely, from Outputdefinition[1 - 100]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'outputnamestring', 'string that identifies the type of output you want, eg. IceVolume, TotalSmb, GroudedArea'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'mask', 'mask vectorial field which identifies the region of interest (value > 0 will be included)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'maskexpstring', 'name of Argus file that can be passed in to define the regional mask'))
+        return string
+    #}}}
 
-		#ok, marshall strings and mask: 
-		WriteData(fid,prefix,'data',self.name,'name','md.regionaloutput.name','format','String')
-		WriteData(fid,prefix,'data',self.definitionstring,'name','md.regionaloutput.definitionstring','format','String')
-		WriteData(fid,prefix,'data',self.outputnamestring,'name','md.regionaloutput.outputnamestring','format','String');
-		WriteData(fid,prefix,'data',self.mask,'name','md.regionaloutput.mask','format','DoubleMat','mattype',1);
+    def extrude(self, md):  # {{{
+        self.mask = project3d(md, 'vector', self.mask, 'type', 'node')
+        return self
+    #}}}
 
-	# }}}
+    def setdefaultparameters(self):  # {{{
+        return self
+    #}}}
+
+    def setmaskfromexp(self, md):  # {{{
+        if len(self.maskexpstring) > 0:
+            self.mask = ContourToMesh(md.mesh.elements, md.mesh.x, md.mesh.y, self.maskexpstring, 'node', 1)
+
+        return self
+    # }}}
+    def checkconsistency(self, md, solution, analyses):  # {{{
+
+        if not isinstance(self.name, str):
+            raise RuntimeError("regionaloutput error message: 'name' field should be a string!")
+
+        if not isinstance(self.outputnamestring, str):
+            raise RuntimeError("regionaloutput error message: 'outputnamestring' field should be a string!")
+
+        if len(self.maskexpstring) > 0:
+            if not os.path.isfile(self.maskexpstring):
+                raise RuntimeError("regionaloutput error message: file name for mask exp does not point to a legitimate file on disk!")
+            else:
+                self.setmaskfromexp(md)
+
+        OutputdefinitionStringArray = []
+        for i in range(1, 100):
+            x = 'Outputdefinition' + str(i)
+            OutputdefinitionStringArray.append(x)
+
+        md = checkfield(md, 'field', self.definitionstring, 'values', OutputdefinitionStringArray)
+        md = checkfield(md, 'field', self.mask, 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+        return md
+    # }}}
+    def marshall(self, prefix, md, fid):  # {{{
+
+        #before marshalling, make sure mask is set:
+        self.setmaskfromexp(md)
+
+    #ok, marshall strings and mask:
+        WriteData(fid, prefix, 'data', self.name, 'name', 'md.regionaloutput.name', 'format', 'String')
+        WriteData(fid, prefix, 'data', self.definitionstring, 'name', 'md.regionaloutput.definitionstring', 'format', 'String')
+        WriteData(fid, prefix, 'data', self.outputnamestring, 'name', 'md.regionaloutput.outputnamestring', 'format', 'String')
+        WriteData(fid, prefix, 'data', self.mask, 'name', 'md.regionaloutput.mask', 'format', 'DoubleMat', 'mattype', 1)
+
+    # }}}
Index: /issm/trunk/src/m/classes/results.py
===================================================================
--- /issm/trunk/src/m/classes/results.py	(revision 24312)
+++ /issm/trunk/src/m/classes/results.py	(revision 24313)
@@ -1,52 +1,54 @@
-import numpy as np
-from pairoptions import pairoptions
 from fielddisplay import fielddisplay
-import MatlabFuncs as m
+
 
 class results(object):
-	"""
-	RESULTS class definition
+    """
+    RESULTS class definition
 
-	   Usage:
-	      results=results();
-	"""
+       Usage:
+          results = results()
+    """
 
-	def __init__(self,*args):    # {{{
-		pass
-	# }}}
-	def __repr__(self):    # {{{
-		s ="   Model results:\n"
+    def __init__(self, *args):  # {{{
+        pass
+    # }}}
 
-		if 'step' in self.__dict__:
-			s+="%s\n" % fielddisplay(self,'step',"step number")
-		if 'time' in self.__dict__:
-			s+="%s\n" % fielddisplay(self,'time',"time value")
-		if 'SolutionType' in self.__dict__:
-			s+="%s\n" % fielddisplay(self,'SolutionType',"solution type")
+    def __repr__(self):  # {{{
+        s = "   Model results:\n"
 
-		for name in self.__dict__.iterkeys():
-			if name not in ['step','time','SolutionType','errlog','outlog']:
-				if   isinstance(getattr(self,name),list):
-					s+="%s\n" % fielddisplay(self,name,"model results list")
-				elif isinstance(getattr(self,name),results):
-					s+="%s\n" % fielddisplay(self,name,"model results case")
-				else:
-					s+="%s\n" % fielddisplay(self,name,"")
+        if 'step' in self.__dict__:
+            s += "%s\n" % fielddisplay(self, 'step', "step number")
+        if 'time' in self.__dict__:
+            s += "%s\n" % fielddisplay(self, 'time', "time value")
+        if 'SolutionType' in self.__dict__:
+            s += "%s\n" % fielddisplay(self, 'SolutionType', "solution type")
 
-		if 'errlog' in self.__dict__:
-			s+="%s\n" % fielddisplay(self,'errlog',"error log file")
-		if 'outlog' in self.__dict__:
-			s+="%s\n" % fielddisplay(self,'outlog',"output log file")
+        for name in list(self.__dict__.keys()):
+            if name not in ['step', 'time', 'SolutionType', 'errlog', 'outlog']:
+                if isinstance(getattr(self, name), list):
+                    s += "%s\n" % fielddisplay(self, name, "model results list")
+                elif isinstance(getattr(self, name), results):
+                    s += "%s\n" % fielddisplay(self, name, "model results case")
+                else:
+                    s += "%s\n" % fielddisplay(self, name, "")
 
-		return s
-	# }}}
-	def setdefaultparameters(self):    # {{{
-		#do nothing
-		return self
-	# }}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		pass
-	# }}}
+        if 'errlog' in self.__dict__:
+            s += "%s\n" % fielddisplay(self, 'errlog', "error log file")
+        if 'outlog' in self.__dict__:
+            s += "%s\n" % fielddisplay(self, 'outlog', "output log file")
+
+        return s
+    # }}}
+
+    def setdefaultparameters(self):  # {{{
+        #do nothing
+        return self
+    # }}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        pass
+    # }}}
Index: /issm/trunk/src/m/classes/rifts.py
===================================================================
--- /issm/trunk/src/m/classes/rifts.py	(revision 24312)
+++ /issm/trunk/src/m/classes/rifts.py	(revision 24313)
@@ -6,87 +6,91 @@
 import MatlabFuncs as m
 
+
 class rifts(object):
-	"""
-	RIFTS class definition
+    """
+    RIFTS class definition
 
-	   Usage:
-	      rifts=rifts();
-	"""
+       Usage:
+          rifts = rifts()
+    """
 
-	def __init__(self): # {{{
-		self.riftstruct     = []
-		self.riftproperties = []
+    def __init__(self):  # {{{
+        self.riftstruct = []
+        self.riftproperties = []
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		string='   rifts parameters:'
+    #}}}
 
-		string="%s\n%s"%(string,fielddisplay(self,'riftstruct','structure containing all rift information (vertices coordinates, segments, type of melange, ...)'))
-		string="%s\n%s"%(string,fielddisplay(self,'riftproperties',''))
-		return string
-		#}}}
-	def setdefaultparameters(self): # {{{
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		if (not self.riftstruct) or np.any(isnans(self.riftstruct)):
-			numrifts=0
-		else:
-			numrifts=len(self.riftstruct)
+    def __repr__(self):  # {{{
+        string = '   rifts parameters:'
 
-		if numrifts:
-			if not m.strcmp(md.mesh.domaintype(),'2Dhorizontal'):
-				md.checkmessage("models with rifts are only supported in 2d for now!")
-			if not isinstance(self.riftstruct,list):
-				md.checkmessage("rifts.riftstruct should be a structure!")
-			if np.any(md.mesh.segmentmarkers>=2):
-				#We have segments with rift markers, but no rift structure!
-				md.checkmessage("model should be processed for rifts (run meshprocessrifts)!")
-			for i,rift in enumerate(self.riftstruct):
-				md = checkfield(md,'fieldname',"rifts.riftstruct[%d]['fill']" % i,'values',['Water','Air','Ice','Melange',0,1,2,3])
-		else:
-			if self.riftstruct and np.any(np.logical_not(isnans(self.riftstruct))):
-				md.checkmessage("riftstruct should be NaN since numrifts is 0!")
+        string = "%s\n%s" % (string, fielddisplay(self, 'riftstruct', 'structure containing all rift information (vertices coordinates, segments, type of melange, ...)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'riftproperties', ''))
+        return string
+    #}}}
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+    def setdefaultparameters(self):  # {{{
+        return self
+    #}}}
 
-		#Process rift info
-		if (not self.riftstruct) or np.any(isnans(self.riftstruct)):
-			numrifts=0
-		else:
-			numrifts=len(self.riftstruct)
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        if (not self.riftstruct) or np.any(isnans(self.riftstruct)):
+            numrifts = 0
+        else:
+            numrifts = len(self.riftstruct)
 
-		numpairs=0
-		for rift in self.riftstruct:
-			numpairs+=np.size(rift['penaltypairs'],axis=0)
+        if numrifts:
+            if not m.strcmp(md.mesh.domaintype(), '2Dhorizontal'):
+                md.checkmessage("models with rifts are only supported in 2d for now!")
+            if not isinstance(self.riftstruct, list):
+                md.checkmessage("rifts.riftstruct should be a structure!")
+            if np.any(md.mesh.segmentmarkers >= 2):
+                #We have segments with rift markers, but no rift structure!
+                md.checkmessage("model should be processed for rifts (run meshprocessrifts)!")
+            for i, rift in enumerate(self.riftstruct):
+                md = checkfield(md, 'fieldname', "rifts.riftstruct[{}]['fill']".format(i), 'values', ['Water', 'Air', 'Ice', 'Melange', 0, 1, 2, 3])
+        else:
+            if self.riftstruct and np.any(np.logical_not(isnans(self.riftstruct))):
+                md.checkmessage("riftstruct should be NaN since numrifts is 0!")
 
-		# Convert strings in riftstruct to hard coded numbers
-		FillDict={'Air':0,
-							'Ice':1,
-							'Melange':2,
-							'Water':3}
-		for rift in self.riftstruct:
-			if rift['fill'] in ['Air','Ice','Melange','Water']:
-				rift['fill'] = FillDict[rift['fill']]
+        return md
+    # }}}
 
-		# 2 for nodes + 2 for elements+ 2 for  normals + 1 for length + 1 for fill + 1 for friction + 1 for fraction + 1 for fractionincrement + 1 for state.
-		data=np.zeros((numpairs,12))
-		count=0
-		for rift in self.riftstruct:
-			numpairsforthisrift=np.size(rift['penaltypairs'],0)
-			data[count:count+numpairsforthisrift,0:7]=rift['penaltypairs']
-			data[count:count+numpairsforthisrift,7]=rift['fill']
-			data[count:count+numpairsforthisrift,8]=rift['friction']
-			data[count:count+numpairsforthisrift,9]=rift['fraction']
-			data[count:count+numpairsforthisrift,10]=rift['fractionincrement']
-			data[count:count+numpairsforthisrift,11]=rift['state'].reshape(-1)
-			count+=numpairsforthisrift
+    def marshall(self, prefix, md, fid):  # {{{
+        #Process rift info
+        if (not self.riftstruct) or np.any(isnans(self.riftstruct)):
+            numrifts = 0
+        else:
+            numrifts = len(self.riftstruct)
 
-		WriteData(fid,prefix,'data',numrifts,'name','md.rifts.numrifts','format','Integer')
-		WriteData(fid,prefix,'data',data,'name','md.rifts.riftstruct','format','DoubleMat','mattype',3)
-	# }}}
+        numpairs = 0
+        for rift in self.riftstruct:
+            numpairs += np.size(rift['penaltypairs'], axis=0)
+
+    # Convert strings in riftstruct to hard coded numbers
+        FillDict = {'Air': 0,
+                    'Ice': 1,
+                    'Melange': 2,
+                    'Water': 3}
+        for rift in self.riftstruct:
+            if rift['fill'] in ['Air', 'Ice', 'Melange', 'Water']:
+                rift['fill'] = FillDict[rift['fill']]
+
+    # 2 for nodes + 2 for elements + 2 for  normals + 1 for length + 1 for fill + 1 for friction + 1 for fraction + 1 for fractionincrement + 1 for state.
+        data = np.zeros((numpairs, 12))
+        count = 0
+        for rift in self.riftstruct:
+            numpairsforthisrift = np.size(rift['penaltypairs'], 0)
+            data[count:count + numpairsforthisrift, 0:7] = rift['penaltypairs']
+            data[count:count + numpairsforthisrift, 7] = rift['fill']
+            data[count:count + numpairsforthisrift, 8] = rift['friction']
+            data[count:count + numpairsforthisrift, 9] = rift['fraction']
+            data[count:count + numpairsforthisrift, 10] = rift['fractionincrement']
+            data[count:count + numpairsforthisrift, 11] = rift['state'].reshape(-1)
+            count += numpairsforthisrift
+
+        WriteData(fid, prefix, 'data', numrifts, 'name', 'md.rifts.numrifts', 'format', 'Integer')
+        WriteData(fid, prefix, 'data', data, 'name', 'md.rifts.riftstruct', 'format', 'DoubleMat', 'mattype', 3)
+    # }}}
Index: /issm/trunk/src/m/classes/sealevelmodel.m
===================================================================
--- /issm/trunk/src/m/classes/sealevelmodel.m	(revision 24312)
+++ /issm/trunk/src/m/classes/sealevelmodel.m	(revision 24313)
@@ -9,9 +9,10 @@
 %      slm = sealevel('icecap',md_greenland,'icecap',md_antarctica,'earth',md_earth);
 
-classdef sealevelmodel
+classdef sealevelmodel < handle
 	properties (SetAccess=public) %Model fields
 		% {{{
 		icecaps          = {}; % list of ice cap models
 		earth            = 0;  % model for the whole earth
+		basins           = {}; % list  of basins, matching icecaps, where shapefile info is held.
 		cluster          = 0;
 		miscellaneous    = 0;
@@ -19,5 +20,7 @@
 		private          = 0;
 		range            = 0;
-		mergedcaps     = 0;
+		mergedcaps       = 0;
+		transitions      = {};
+		eltransitions      = {};
 		%}}}
 	end
@@ -83,8 +86,10 @@
 			slm.earth             = {};
 			slm.miscellaneous     = miscellaneous();
-			slm.settings          = settings();
+			slm.settings          = issmsettings();
 			slm.private           = private();
 			slm.cluster           = generic();
 			slm.range             = {};
+			slm.transitions       = {};
+			slm.eltransitions       = {};
 		end
 		%}}}
@@ -128,5 +133,5 @@
 							continue;
 						end
-											end
+					end
 				end
 				self.mergedcaps{2*(i-1)+1}=md;
@@ -137,4 +142,188 @@
 				disp(sprintf('%i: %s',i,self.icecaps{i}.miscellaneous.name));
 			end
+		end % }}}
+		function addbasin(self,bas) % {{{
+		if ~strcmpi(class(bas),'basin')
+			error('addbasin method only takes a ''basin'' class object as input');
+		end;
+		self.basins{end+1}=bas;
+		end % }}}
+		function intersections(self,varargin) % {{{
+
+		options=pairoptions(varargin{:}); 
+		force=getfieldvalue(options,'force',0);
+
+		%for elements:
+		xe=self.earth.mesh.x(self.earth.mesh.elements)*[1;1;1]/3;
+		ye=self.earth.mesh.y(self.earth.mesh.elements)*[1;1;1]/3;
+		ze=self.earth.mesh.z(self.earth.mesh.elements)*[1;1;1]/3;
+
+		for i=1:length(self.icecaps),
+			mdi=self.icecaps{i};
+			mdi=TwoDToThreeD(mdi);
+	
+			%for elements: 
+			xei=mdi.mesh.x(mdi.mesh.elements)*[1;1;1]/3;
+			yei=mdi.mesh.y(mdi.mesh.elements)*[1;1;1]/3;
+			zei=mdi.mesh.z(mdi.mesh.elements)*[1;1;1]/3;
+	
+			disp(sprintf('Computing vertex intersections for basin %s',self.basins{i}.name));
+		
+			self.transitions{end+1}=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{end+1}=meshintersect3d(xe,ye,ze,xei,yei,zei,'force',force);
+		end
+
+		end % }}}
+		function checkintersections(self) % {{{
+		flags=zeros(self.earth.mesh.numberofvertices,1);
+		for i=1:length(self.basins),
+			flags(self.transitions{i})=i;
+		end
+		plotmodel(self.earth,'data',flags,'coastline','on');
+
+		end % }}}
+		function baslist=basinindx(self,varargin) % {{{
+			options=pairoptions(varargin{:}); 
+			continent=getfieldvalue(options,'continent','all');
+			bas=getfieldvalue(options,'basin','all');
+
+			%expand continent list: {{{
+			if iscell(continent),
+				if length(continent)==1,
+					 if strcmpi(continent{1},'all'),
+						 %need to transform this into a list of continents: 
+						 continent={}; 
+						 for i=1:length(self.basins),
+							 continent{end+1}=self.basins{i}.continent;
+						 end
+						 continent=unique(continent);
+					 end
+				else
+					%nothing to do, we have a list of continents
+				end
+			else
+				if strcmpi(continent,'all'),
+					%need to transform this into a list of continents: 
+					continent={}; 
+					for i=1:length(self.basins),
+						 continent{end+1}=self.basins{i}.continent;
+					end
+					continent=unique(continent);
+				else
+					continent={continent};
+				end
+			end
+			%}}}
+			%expand basins list using the continent list above and the extra bas discriminator: %{{{
+			if iscell(bas),
+				if length(bas)==1,
+					 if strcmpi(bas{1},'all'),
+						 %need to transform this into a list of basins: 
+						 baslist=[];
+						 for i=1:length(self.basins),
+							 if self.basins{i}.iscontinentany(continent{:}),
+								 baslist(end+1)=i;
+							 end
+						 end
+						 baslist=unique(baslist);
+					 else
+						 bas=bas{1};
+						 baslist=[];
+						 for i=1:length(self.basins),
+							 if self.basins{i}.iscontinentany(continent{:}),
+								 if self.basins{i}.isnameany(bas),
+									 baslist(end+1)=i;
+								 end
+							 end
+						 end
+
+					 end
+				else
+					%we have a list of basin names: 
+					baslist=[];
+					for i=1:length(bas),
+						basname=bas{i};
+						for j=1:length(self.basins),
+							if self.basins{j}.iscontinentany(continent{:}),
+								if self.basins{j}.isnameany(basname),
+									baslist(end+1)=j;
+								end
+							end
+						end
+						baslist=unique(baslist);
+					end
+				end
+			else
+				if strcmpi(bas,'all'),
+					baslist=[];
+					for i=1:length(self.basins),
+						if self.basins{i}.iscontinentany(continent{:}),
+							baslist(end+1)=i;
+						end
+					end
+					baslist=unique(baslist);
+				else
+					baslist=[];
+					for i=1:length(self.basins),
+						if self.basins{i}.iscontinentany(continent{:}),
+							if self.basins{i}.isnameany(bas),
+								baslist(end+1)=i;
+							end
+						end
+					end
+					baslist=unique(baslist);
+				end
+			end
+			%}}}
+
+		end % }}}
+		function addicecap(self,md) % {{{
+		if ~strcmpi(class(md),'model')
+			error('addicecap method only takes a ''model'' class object as input');
+		end
+		self.icecaps{end+1}=md;
+		end % }}}
+		function basinsplot3d(self,varargin) % {{{
+		for i=1:length(self.basins),
+			self.basins{i}.plot3d(varargin{:});
+		end
+		end % }}}
+		function caticecaps(self,varargin) % {{{
+			
+			%recover options: 
+			options=pairoptions(varargin{:}); 
+			tolerance=getfieldvalue(options,'tolerance',.65);
+			loneedgesdetect=getfieldvalue(options,'loneedgesdetect',0);
+	
+			%make 3D model:
+			models=self.icecaps;
+			for i=1:length(models),
+				models{i}=TwoDToThreeD(models{i});
+			end
+			
+			%Plug all models together:
+			md=models{1}; 
+			for i=2:length(models),
+				md=modelmerge3d(md,models{i},'tolerance',tolerance);
+				md.private.bamg.landmask=[md.private.bamg.landmask;models{i}.private.bamg.landmask];
+			end
+
+			%Look for lone edges if asked for it: {{{
+			if loneedgesdetect,
+				edges=loneedges(md);
+				plotmodel(md,'data',md.mask.land_levelset);
+				hold on;
+				for i=1:length(edges),
+					ind1=edges(i,1);
+					ind2=edges(i,2);
+					%plot([md.mesh.x(ind1),md.mesh.x(ind2)],[md.mesh.y(ind1),md.mesh.y(ind2)],'r*-');
+					plot3([md.mesh.x(ind1),md.mesh.x(ind2)],[md.mesh.y(ind1),md.mesh.y(ind2)],[md.mesh.z(ind1),md.mesh.z(ind2)],'g*-');
+				end
+			end %}}}
+	
+			%Plug into earth: 
+			self.earth=md;
+
 		end % }}}
 		function viscousiterations(self) % {{{
@@ -159,4 +348,21 @@
 			disp(sprintf('Earth: %i/%g',mvi,timei));
 		end % }}}
+		function transfer(self,string) % {{{
+			%Recover field size in one icecap: 
+			eval(['n=length(self.icecaps{1}.' string ');']);
+			if n==self.icecaps{1}.mesh.numberofvertices,
+				eval(['self.earth.' string '=zeros(self.earth.mesh.numberofvertices,1);']);
+				for i=1:length(self.icecaps),
+					eval(['self.earth.' string '(self.transitions{' num2str(i) '})=self.icecaps{' num2str(i) '}.' string ';']);
+				end
+			elseif n==self.icecaps{1} .mesh.numberofelements,
+				eval(['self.earth.' string '=zeros(self.earth.mesh.numberofelements,1);']);
+				for i=1:length(self.icecaps),
+					eval(['self.earth.' string '(self.eltransitions{' num2str(i) '})=self.icecaps{' num2str(i) '}.' string ';']);
+				end
+			else
+				error('not supported yet');
+			end
+		end % }}}
 		function self=homogeneize(self,noearth) % {{{
 			if nargin==1,
Index: /issm/trunk/src/m/classes/slr.m
===================================================================
--- /issm/trunk/src/m/classes/slr.m	(revision 24312)
+++ /issm/trunk/src/m/classes/slr.m	(revision 24313)
@@ -26,4 +26,5 @@
 		ocean_area_scaling     = 0;
 		steric_rate            = 0; %rate of ocean expansion from steric effects.
+		hydro_rate             = 0; %rate of steric expansion from hydrological effects.
 		geodetic_run_frequency = 1; %how many time steps we skip before we run the geodetic part of the solver during transient
 		geodetic               = 0; %compute geodetic SLR? (in addition to steric?)
@@ -81,4 +82,5 @@
 		%steric: 
 		self.steric_rate=0;
+		self.hydro_rate=0;
 	
 		%how many time steps we skip before we run SLR solver during transient
@@ -115,4 +117,5 @@
 			md = checkfield(md,'fieldname','slr.geodetic_run_frequency','size',[1 1],'>=',1);
 			md = checkfield(md,'fieldname','slr.steric_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
+			md = checkfield(md,'fieldname','slr.hydro_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);
 			md = checkfield(md,'fieldname','slr.degacc','size',[1 1],'>=',1e-10);
 			md = checkfield(md,'fieldname','slr.requested_outputs','stringrow',1);
@@ -174,4 +177,5 @@
 			fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]'); 
 			fielddisplay(self,'steric_rate','rate of steric ocean expansion (in mm/yr)'); 
+			fielddisplay(self,'hydro_rate','rate of hydrological expansion (in mm/yr)'); 
 			fielddisplay(self,'Ngia','rate of viscous (GIA) geoid expansion (in mm/yr)'); 
 			fielddisplay(self,'Ugia','rate of viscous (GIA) bedrock uplift (in mm/yr)'); 
@@ -210,5 +214,6 @@
 			WriteData(fid,prefix,'object',self,'fieldname','ocean_area_scaling','format','Boolean');
 			WriteData(fid,prefix,'object',self,'fieldname','geodetic_run_frequency','format','Integer');
-			WriteData(fid,prefix,'object',self,'fieldname','steric_rate','format','DoubleMat','mattype',1,'scale',1e-3/md.constants.yts);
+			WriteData(fid,prefix,'object',self,'fieldname','steric_rate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3/md.constants.yts);
+			WriteData(fid,prefix,'object',self,'fieldname','hydro_rate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3/md.constants.yts);
 			WriteData(fid,prefix,'object',self,'fieldname','Ngia','format','DoubleMat','mattype',1,'scale',1e-3/md.constants.yts);
 			WriteData(fid,prefix,'object',self,'fieldname','Ugia','format','DoubleMat','mattype',1,'scale',1e-3/md.constants.yts);
@@ -252,4 +257,5 @@
 			writejsdouble(fid,[modelname '.slr.geodetic_run_frequency'],self.geodetic_run_frequency);
 			writejs1Darray(fid,[modelname '.slr.steric_rate'],self.steric_rate);
+			writejs1Darray(fid,[modelname '.slr.hydro_rate'],self.hydro_rate);
 			writejsdouble(fid,[modelname '.slr.degacc'],self.degacc);
 			writejscellstring(fid,[modelname '.slr.requested_outputs'],self.requested_outputs);
Index: /issm/trunk/src/m/classes/slr.py
===================================================================
--- /issm/trunk/src/m/classes/slr.py	(revision 24312)
+++ /issm/trunk/src/m/classes/slr.py	(revision 24313)
@@ -6,216 +6,212 @@
 from WriteData import WriteData
 
+
 class slr(object):
-	"""
-	SLR class definition
-	
-		Usage:
-		  slr=slr()
-	"""
-	
-	def __init__(self): # {{{
-		self.deltathickness         = float('NaN')
-		self.sealevel               = float('NaN')
-		self.spcthickness	    = float('NaN')
-		self.maxiter                = 0
-		self.reltol                 = 0
-		self.abstol                 = 0
-		self.love_h                 = 0 #provided by PREM model()
-		self.love_k                 = 0 #ideam
-		self.love_l                 = 0 #ideam
-		self.tide_love_k            = 0 #ideam
-		self.tide_love_h            = 0 #ideam
-		self.fluid_love             = 0 
-		self.equatorial_moi         = 0 
-		self.polar_moi	            = 0 
-		self.angular_velocity       = 0
-		self.rigid                  = 0
-		self.elastic                = 0
-		self.rotation               = 0
-		self.ocean_area_scaling     = 0
-		self.steric_rate            = 0 #rate of ocean expansion from steric effects.
-		self.geodetic_run_frequency = 1 #how many time steps we skip before we run the geodetic part of the solver during transient
-		self.geodetic               = 0 #compute geodetic SLR? (in addition to steric?)
-		self.degacc                 = 0
-		self.loop_increment         = 0
-		self.horiz                  = 0
-		self.Ngia                   = float('NaN')
-		self.Ugia                   = float('NaN')
-		self.requested_outputs      = []
-		self.transitions            = []
-		
-		#set defaults
-		self.setdefaultparameters()
-		#}}}
-	def __repr__(self): # {{{
-			string='   slr parameters:'
-                        string="%s\n%s"%(string,fielddisplay(self,'deltathickness','thickness change: ice height equivalent [m]'))
-			string="%s\n%s"%(string,fielddisplay(self,'sealevel','current sea level (prior to computation) [m]'))
-			string="%s\n%s"%(string,fielddisplay(self,'spcthickness','thickness constraints (NaN means no constraint) [m]'))
-			string="%s\n%s"%(string,fielddisplay(self,'reltol','sea level rise relative convergence criterion, (NaN: not applied)'))
-			string="%s\n%s"%(string,fielddisplay(self,'abstol','sea level rise absolute convergence criterion, (default, NaN: not applied)'))
-			string="%s\n%s"%(string,fielddisplay(self,'maxiter','maximum number of nonlinear iterations'))
-			string="%s\n%s"%(string,fielddisplay(self,'love_h','load Love number for radial displacement'))
-			string="%s\n%s"%(string,fielddisplay(self,'love_k','load Love number for gravitational potential perturbation'))
-			string="%s\n%s"%(string,fielddisplay(self,'love_l','load Love number for horizontal displaements'))
-			string="%s\n%s"%(string,fielddisplay(self,'tide_love_k','tidal load Love number (degree 2)'))
-			string="%s\n%s"%(string,fielddisplay(self,'tide_love_h','tidal load Love number (degree 2)'))
-			string="%s\n%s"%(string,fielddisplay(self,'fluid_love','secular fluid Love number'))
-			string="%s\n%s"%(string,fielddisplay(self,'equatorial_moi','mean equatorial moment of inertia [kg m^2]'))
-			string="%s\n%s"%(string,fielddisplay(self,'polar_moi','polar moment of inertia [kg m^2]'))
-			string="%s\n%s"%(string,fielddisplay(self,'angular_velocity','mean rotational velocity of earth [per second]')) 
-			string="%s\n%s"%(string,fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]'))
-			string="%s\n%s"%(string,fielddisplay(self,'steric_rate','rate of steric ocean expansion [mm/yr]'))
-			string="%s\n%s"%(string,fielddisplay(self,'Ngia','rate of viscous (GIA) geoid expansion (in mm/yr)')) 
-			string="%s\n%s"%(string,fielddisplay(self,'Ugia','rate of viscous (GIA) bedrock uplift (in mm/yr)'))
-			string="%s\n%s"%(string,fielddisplay(self,'loop_increment','vector assembly (in the convolution) framentation'))
-			string="%s\n%s"%(string,fielddisplay(self,'geodetic','compute geodetic SLR? ( in addition to steric?) default 0'))
-			string="%s\n%s"%(string,fielddisplay(self,'geodetic_run_frequency','how many time steps we skip before we run SLR solver during transient (default: 1)'))
-			string="%s\n%s"%(string,fielddisplay(self,'rigid','rigid earth graviational potential perturbation'))
-			string="%s\n%s"%(string,fielddisplay(self,'elastic','elastic earth graviational potential perturbation'))
-			string="%s\n%s"%(string,fielddisplay(self,'rotation','earth rotational potential perturbation'))
-			string="%s\n%s"%(string,fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions'))
-			string="%s\n%s"%(string,fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps'))
-			string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested'))
-
-			return string
-		# }}}
-	def setdefaultparameters(self): # {{{
-		
-		#Convergence criterion: absolute, relative and residual
-		self.reltol=0.01 #default
-		self.abstol=float('NaN') #1 mm of sea level rise
-
-		#maximum of non-linear iterations.
-		self.maxiter=5
-		self.loop_increment=200
-
-		#computational flags: 
-		self.geodetic=0
-		self.rigid=1
-		self.elastic=1
-		self.ocean_area_scaling=0
-		self.rotation=1
-
-		#tidal love numbers: 
-		self.tide_love_h=0.6149 #degree 2
-		self.tide_love_k=0.3055 #degree 2
-		
-      #secular fluid love number: 
-		self.fluid_love=0.942 
-		
-		#moment of inertia: 
-		self.equatorial_moi=8.0077*10**37 # [kg m^2] 
-		self.polar_moi	    =8.0345*10**37 # [kg m^2] 
-		
-		#mean rotational velocity of earth 
-		self.angular_velocity=7.2921*10**-5 # [s^-1] 
-
-		#numerical discretization accuracy
-		self.degacc=.01
-
-		#steric:
-		self.steric_rate=0
-
-		#how many time steps we skip before we run SLR solver during transient
-		self.geodetic_run_frequency=1
-		
-		#output default:
-		self.requested_outputs=['default']
-
-		#transitions should be a cell array of vectors: 
-		self.transitions=[]
-
-		#horizontal displacement?  (not by default)
-		self.horiz=0
-
-		return self
-		#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-
-		#Early return
-		if (solution!='SealevelriseAnalysis'):
-			return md
-
-		md = checkfield(md,'fieldname','slr.deltathickness','NaN',1,'Inf',1,'size',[md.mesh.numberofelements])
-		md = checkfield(md,'fieldname','slr.sealevel','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','slr.spcthickness','Inf',1,'timeseries',1)
-		md = checkfield(md,'fieldname','slr.love_h','NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','slr.love_k','NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','slr.love_l','NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','slr.tide_love_h','NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','slr.tide_love_k','NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','slr.fluid_love','NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','slr.equatorial_moi','NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','slr.polar_moi','NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','slr.angular_velocity','NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','slr.reltol','size',[1,1])
-		md = checkfield(md,'fieldname','slr.abstol','size',[1,1])
-		md = checkfield(md,'fieldname','slr.maxiter','size',[1,1],'>=',1)
-		md = checkfield(md,'fieldname','slr.geodetic_run_frequency','size',[1,1],'>=',1)
-		md = checkfield(md,'fieldname','slr.steric_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','slr.degacc','size',[1,1],'>=',1e-10)
-		md = checkfield(md,'fieldname','slr.requested_outputs','stringrow',1)
-		md = checkfield(md,'fieldname','slr.loop_increment','NaN',1,'Inf',1,'>=',1)
-		md = checkfield(md,'fieldname','slr.horiz','NaN',1,'Inf',1,'values',[0,1])
-		md = checkfield(md,'fieldname','slr.Ngia','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-		md = checkfield(md,'fieldname','slr.Ugia','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices])
-
-		#check that love numbers are provided at the same level of accuracy: 
-		if (size(self.love_h,0) != size(self.love_k,0) | size(self.love_h,0) != size(self.love_l,0)):
-			error('slr error message: love numbers should be provided at the same level of accuracy')
-
-		#cross check that whereever we have an ice load, the mask is <0 on each vertex: 
-		pos=np.where(self.deltathickness)
-		maskpos=md.mask.ice_levelset[md.mesh.elements[pos,:]] 
-		els=np.where(maskpos>0)
-		if len(els[0])>0:
-			warnings.warn('slr checkconsistency fail: there are elements with ice loads where some vertices are not on the ice!')
-		
-		#check that  if geodetic is requested, we are a mesh3dsurface model (planet), or if we are not, 
-		#a coupler to a planet model is provided. 
-		if self.geodetic and not md.transient.iscoupler and domaintype(md.mesh)!='mesh3dsurface':
-			error('model is requesting geodetic computations without being a mesh3dsurface, or being coupled to one!')
-		return md
-	# }}}
-	def defaultoutputs(self,md): # {{{
-		return ['Sealevel']
-	# }}}
-	def marshall(self,prefix,md,fid): # {{{
-		WriteData(fid,prefix,'object',self,'fieldname','deltathickness','format','DoubleMat','mattype',2)
-		WriteData(fid,prefix,'object',self,'fieldname','sealevel','mattype',1,'format','DoubleMat','timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'fieldname','reltol','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','abstol','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','love_h','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','love_k','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','love_l','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'fieldname','tide_love_h','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','tide_love_k','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','fluid_love','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','equatorial_moi','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','polar_moi','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','angular_velocity','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','rigid','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','elastic','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','rotation','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','ocean_area_scaling','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','geodetic_run_frequency','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','steric_rate','format','DoubleMat','mattype',1,'scale',1e-3/md.constants.yts)
-		WriteData(fid,prefix,'object',self,'fieldname','Ngia','format','DoubleMat','mattype',1,'scale',1e-3/md.constants.yts)
-		WriteData(fid,prefix,'object',self,'fieldname','Ugia','format','DoubleMat','mattype',1,'scale',1e-3/md.constants.yts)
-		WriteData(fid,prefix,'object',self,'fieldname','degacc','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','transitions','format','MatArray')
-		WriteData(fid,prefix,'object',self,'fieldname','loop_increment','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','horiz','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','geodetic','format','Integer')
-	
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.slr.requested_outputs','format','StringArray')
-	# }}}
+    """
+    SLR class definition
+
+        Usage:
+          slr = slr()
+    """
+    def __init__(self):  # {{{
+        self.deltathickness = float('NaN')
+        self.sealevel = float('NaN')
+        self.spcthickness = float('NaN')
+        self.maxiter = 0
+        self.reltol = 0
+        self.abstol = 0
+        self.love_h = 0  #provided by PREM model()
+        self.love_k = 0  #ideam
+        self.love_l = 0  #ideam
+        self.tide_love_k = 0  #ideam
+        self.tide_love_h = 0  #ideam
+        self.fluid_love = 0
+        self.equatorial_moi = 0
+        self.polar_moi = 0
+        self.angular_velocity = 0
+        self.rigid = 0
+        self.elastic = 0
+        self.rotation = 0
+        self.ocean_area_scaling = 0
+        self.steric_rate = 0  #rate of ocean expansion from steric effects.
+        self.hydro_rate = 0  #rate of steric expansion from hydrological effects.
+        self.geodetic_run_frequency = 1  #how many time steps we skip before we run the geodetic part of the solver during transient
+        self.geodetic = 0  #compute geodetic SLR? (in addition to steric?)
+        self.degacc = 0
+        self.loop_increment = 0
+        self.horiz = 0
+        self.Ngia = float('NaN')
+        self.Ugia = float('NaN')
+        self.requested_outputs = []
+        self.transitions = []
+
+        #set defaults
+        self.setdefaultparameters()
+    #}}}
+
+    def __repr__(self):  # {{{
+        string = '   slr parameters:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'deltathickness', 'thickness change: ice height equivalent [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'sealevel', 'current sea level (prior to computation) [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'spcthickness', 'thickness constraints (NaN means no constraint) [m]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'reltol', 'sea level rise relative convergence criterion, (NaN: not applied)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'abstol', 'sea level rise absolute convergence criterion, (default, NaN: not applied)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'maxiter', 'maximum number of nonlinear iterations'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'love_h', 'load Love number for radial displacement'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'love_k', 'load Love number for gravitational potential perturbation'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'love_l', 'load Love number for horizontal displaements'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'tide_love_k', 'tidal load Love number (degree 2)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'tide_love_h', 'tidal load Love number (degree 2)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'fluid_love', 'secular fluid Love number'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'equatorial_moi', 'mean equatorial moment of inertia [kg m^2]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'polar_moi', 'polar moment of inertia [kg m^2]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'angular_velocity', 'mean rotational velocity of earth [per second]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'ocean_area_scaling', 'correction for model representation of ocean area [default: No correction]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'steric_rate', 'rate of steric ocean expansion [mm / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'hydro_rate', 'rate of hydrological expansion [mm / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'Ngia', 'rate of viscous (GIA) geoid expansion (in mm / yr)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'Ugia', 'rate of viscous (GIA) bedrock uplift (in mm / yr)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'loop_increment', 'vector assembly (in the convolution) framentation'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'geodetic', 'compute geodetic SLR? (in addition to steric?) default 0'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'geodetic_run_frequency', 'how many time steps we skip before we run SLR solver during transient (default: 1)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'rigid', 'rigid earth graviational potential perturbation'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'elastic', 'elastic earth graviational potential perturbation'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'rotation', 'earth rotational potential perturbation'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'degacc', 'accuracy (default .01 deg) for numerical discretization of the Green''s functions'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'transitions', 'indices into parts of the mesh that will be icecaps'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+
+        return string
+    # }}}
+
+    def setdefaultparameters(self):  # {{{
+        #Convergence criterion: absolute, relative and residual
+        self.reltol = 0.01  #default
+        self.abstol = float('NaN')  #1 mm of sea level rise
+        #maximum of non - linear iterations.
+        self.maxiter = 5
+        self.loop_increment = 200
+        #computational flags:
+        self.geodetic = 0
+        self.rigid = 1
+        self.elastic = 1
+        self.ocean_area_scaling = 0
+        self.rotation = 1
+        #tidal love numbers:
+        self.tide_love_h = 0.6149  #degree 2
+        self.tide_love_k = 0.3055  #degree 2
+        #secular fluid love number:
+        self.fluid_love = 0.942
+        #moment of inertia:
+        self.equatorial_moi = 8.0077 * 1.0e37  # [kg m^2]
+        self.polar_moi = 8.0345 * 1.0e37  # [kg m^2]
+        #mean rotational velocity of earth
+        self.angular_velocity = 7.2921 * 1.0e-5  # [s^ - 1]
+        #numerical discretization accuracy
+        self.degacc = 0.01
+        #steric:
+        self.steric_rate = 0
+        self.hydro_rate = 0
+        #how many time steps we skip before we run SLR solver during transient
+        self.geodetic_run_frequency = 1
+        #output default:
+        self.requested_outputs = ['default']
+        #transitions should be a cell array of vectors:
+        self.transitions = []
+        #horizontal displacement?  (not by default)
+        self.horiz = 0
+
+        return self
+    #}}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if (solution != 'SealevelriseAnalysis'):
+            return md
+
+        md = checkfield(md, 'fieldname', 'slr.deltathickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofelements])
+        md = checkfield(md, 'fieldname', 'slr.sealevel', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'slr.spcthickness', 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'slr.love_h', 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'slr.love_k', 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'slr.love_l', 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'slr.tide_love_h', 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'slr.tide_love_k', 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'slr.fluid_love', 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'slr.equatorial_moi', 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'slr.polar_moi', 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'slr.angular_velocity', 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'slr.reltol', 'size', [1, 1])
+        md = checkfield(md, 'fieldname', 'slr.abstol', 'size', [1, 1])
+        md = checkfield(md, 'fieldname', 'slr.maxiter', 'size', [1, 1], '>=', 1)
+        md = checkfield(md, 'fieldname', 'slr.geodetic_run_frequency', 'size', [1, 1], '>=', 1)
+        md = checkfield(md, 'fieldname', 'slr.steric_rate', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'slr.hydro_rate', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'slr.degacc', 'size', [1, 1], '>=', 1e-10)
+        md = checkfield(md, 'fieldname', 'slr.requested_outputs', 'stringrow', 1)
+        md = checkfield(md, 'fieldname', 'slr.loop_increment', 'NaN', 1, 'Inf', 1, '>=', 1)
+        md = checkfield(md, 'fieldname', 'slr.horiz', 'NaN', 1, 'Inf', 1, 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'slr.Ngia', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+        md = checkfield(md, 'fieldname', 'slr.Ugia', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])
+
+        #check that love numbers are provided at the same level of accuracy:
+        if (size(self.love_h, 0) != size(self.love_k, 0) | size(self.love_h, 0) != size(self.love_l, 0)):
+            error('slr error message: love numbers should be provided at the same level of accuracy')
+
+        #cross check that whereever we have an ice load, the mask is < 0 on each vertex:
+        pos = np.where(self.deltathickness)
+        maskpos = md.mask.ice_levelset[md.mesh.elements[pos, :]]
+        els = np.where(maskpos > 0)
+        if len(els[0]) > 0:
+            warnings.warn('slr checkconsistency fail: there are elements with ice loads where some vertices are not on the ice!')
+
+        #check that  if geodetic is requested, we are a mesh3dsurface model (planet), or if we are not,
+        #a coupler to a planet model is provided.
+        if self.geodetic and not md.transient.iscoupler and domaintype(md.mesh) != 'mesh3dsurface':
+            error('model is requesting geodetic computations without being a mesh3dsurface, or being coupled to one!')
+        return md
+    # }}}
+
+    def defaultoutputs(self, md):  # {{{
+        return ['Sealevel']
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'deltathickness', 'format', 'DoubleMat', 'mattype', 2)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'sealevel', 'mattype', 1, 'format', 'DoubleMat', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'spcthickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'reltol', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'abstol', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'love_h', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'love_k', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'love_l', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'tide_love_h', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'tide_love_k', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'fluid_love', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'equatorial_moi', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'polar_moi', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'angular_velocity', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'rigid', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'elastic', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'rotation', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'ocean_area_scaling', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'geodetic_run_frequency', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'steric_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1e-3 / md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'hydro_rate', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1e-3 / md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'Ngia', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1e-3 / md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'Ugia', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1e-3 / md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'degacc', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'transitions', 'format', 'MatArray')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'loop_increment', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'horiz', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'geodetic', 'format', 'Integer')
+
+    #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.slr.requested_outputs', 'format', 'StringArray')
+    # }}}
Index: /issm/trunk/src/m/classes/steadystate.py
===================================================================
--- /issm/trunk/src/m/classes/steadystate.py	(revision 24312)
+++ /issm/trunk/src/m/classes/steadystate.py	(revision 24313)
@@ -4,71 +4,70 @@
 from WriteData import WriteData
 
+
 class steadystate(object):
-	"""
-	STEADYSTATE class definition
+    """
+    STEADYSTATE class definition
 
-	   Usage:
-	      steadystate=steadystate();
-	"""
+       Usage:
+          steadystate = steadystate()
+    """
 
-	def __init__(self): # {{{
-		self.reltol            = 0
-		self.maxiter           = 0
-		self.requested_outputs = []
+    def __init__(self):  # {{{
+        self.reltol = 0
+        self.maxiter = 0
+        self.requested_outputs = []
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		string='   steadystate solution parameters:'
-		string="%s\n%s"%(string,fielddisplay(self,'reltol','relative tolerance criterion'))
-		string="%s\n%s"%(string,fielddisplay(self,'maxiter','maximum number of iterations'))
-		string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional requested outputs'))
-		return string
-		#}}}
-	def defaultoutputs(self,md): # {{{
+    #}}}
+    def __repr__(self):  # {{{
+        string = '   steadystate solution parameters:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'reltol', 'relative tolerance criterion'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'maxiter', 'maximum number of iterations'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional requested outputs'))
+        return string
+    #}}}
 
-		return md.stressbalance.defaultoutputs(md)+md.thermal.defaultoutputs(md)
+    def defaultoutputs(self, md):  # {{{
+        return md.stressbalance.defaultoutputs(md) + md.thermal.defaultoutputs(md)
 
-	#}}}
-	def setdefaultparameters(self): # {{{
-		
-		#maximum of steady state iterations
-		self.maxiter=100
+    #}}}
+    def setdefaultparameters(self):  # {{{
+        #maximum of steady state iterations
+        self.maxiter = 100
+        #Relative tolerance for the steadystate convertgence
+        self.reltol = 0.01
+        #default output
+        self.requested_outputs = ['default']
+        return self
+    #}}}
 
-		#Relative tolerance for the steadystate convertgence
-		self.reltol=0.01
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if not solution == 'SteadystateSolution':
+            return md
 
-		#default output
-		self.requested_outputs=['default']
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+        if not md.timestepping.time_step == 0:
+            md.checkmessage("for a steadystate computation, timestepping.time_step must be zero.")
 
-		#Early return
-		if not solution=='SteadystateSolution':
-			return md
+        if np.isnan(md.stressbalance.reltol):
+            md.checkmessage("for a steadystate computation, stressbalance.reltol (relative convergence criterion) must be defined!")
 
-		if not md.timestepping.time_step==0:
-			md.checkmessage("for a steadystate computation, timestepping.time_step must be zero.")
+        md = checkfield(md, 'fieldname', 'steadystate.requested_outputs', 'stringrow', 1)
 
-		if np.isnan(md.stressbalance.reltol):
-			md.checkmessage("for a steadystate computation, stressbalance.reltol (relative convergence criterion) must be defined!")
+        return md
+    # }}}
 
-		md = checkfield(md,'fieldname','steadystate.requested_outputs','stringrow',1)
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'reltol', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter', 'format', 'Integer')
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'object',self,'fieldname','reltol','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer')
-
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.steadystate.requested_outputs','format','StringArray')
-	# }}}
+    #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.steadystate.requested_outputs', 'format', 'StringArray')
+    # }}}
Index: /issm/trunk/src/m/classes/stressbalance.m
===================================================================
--- /issm/trunk/src/m/classes/stressbalance.m	(revision 24312)
+++ /issm/trunk/src/m/classes/stressbalance.m	(revision 24313)
@@ -5,5 +5,5 @@
 
 classdef stressbalance
-	properties (SetAccess=public) 
+	properties (SetAccess=public)
 		spcvx                  = NaN;
 		spcvy                  = NaN;
@@ -57,5 +57,5 @@
 
 			 %Convergence criterion: absolute, relative and residual
-			 self.restol=10^-4; 
+			 self.restol=10^-4;
 			 self.reltol=0.01;
 			 self.abstol=10;
@@ -97,5 +97,7 @@
 			md = checkfield(md,'fieldname','stressbalance.loadingforce','size',[md.mesh.numberofvertices 3]);
 			md = checkfield(md,'fieldname','stressbalance.requested_outputs','stringrow',1);
-
+			if ~any(isnan(md.stressbalance.vertex_pairing)),
+				md = checkfield(md,'fieldname','stressbalance.vertex_pairing','>',0);
+			end
 			%singular solution
 			if ((~(any(~isnan(md.stressbalance.spcvx)) | any(~isnan(md.stressbalance.spcvy)))) & ~any(md.mask.groundedice_levelset>0)),
@@ -202,5 +204,5 @@
 		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
-		
+
 			writejs1Darray(fid,[modelname '.stressbalance.spcvx'],self.spcvx);
 			writejs1Darray(fid,[modelname '.stressbalance.spcvy'],self.spcvy);
Index: /issm/trunk/src/m/classes/stressbalance.py
===================================================================
--- /issm/trunk/src/m/classes/stressbalance.py	(revision 24312)
+++ /issm/trunk/src/m/classes/stressbalance.py	(revision 24313)
@@ -1,5 +1,4 @@
 import numpy as np
 import sys
-import copy
 from project3d import project3d
 from fielddisplay import fielddisplay
@@ -8,193 +7,192 @@
 import MatlabFuncs as m
 
+
 class stressbalance(object):
-	"""
-	STRESSBALANCE class definition
+    """
+    STRESSBALANCE class definition
 
-	   Usage:
-	      stressbalance=stressbalance();
-	"""
+       Usage:
+          stressbalance = stressbalance()
+    """
 
-	def __init__(self): # {{{
-		self.spcvx                  = float('NaN')
-		self.spcvy                  = float('NaN')
-		self.spcvz                  = float('NaN')
-		self.restol                 = 0
-		self.reltol                 = 0
-		self.abstol                 = 0
-		self.isnewton               = 0
-		self.FSreconditioning       = 0
-		self.icefront               = float('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.rift_penalty_threshold = 0
-		self.referential            = float('NaN')
-		self.loadingforce           = float('NaN')
-		self.requested_outputs      = []
+    def __init__(self):  # {{{
+        self.spcvx = float('NaN')
+        self.spcvy = float('NaN')
+        self.spcvz = float('NaN')
+        self.restol = 0
+        self.reltol = 0
+        self.abstol = 0
+        self.isnewton = 0
+        self.FSreconditioning = 0
+        self.icefront = float('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.rift_penalty_threshold = 0
+        self.referential = float('NaN')
+        self.loadingforce = float('NaN')
+        self.requested_outputs = []
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		
-		string='   StressBalance solution parameters:'
-		string="%s\n%s"%(string,'      Convergence criteria:')
-		string="%s\n%s"%(string,fielddisplay(self,'restol','mechanical equilibrium residual convergence criterion'))
-		string="%s\n%s"%(string,fielddisplay(self,'reltol','velocity relative convergence criterion, NaN: not applied'))
-		string="%s\n%s"%(string,fielddisplay(self,'abstol','velocity absolute convergence criterion, NaN: not applied'))
-		string="%s\n%s"%(string,fielddisplay(self,'isnewton',"0: Picard's fixed point, 1: Newton's method, 2: hybrid"))
-		string="%s\n%s"%(string,fielddisplay(self,'maxiter','maximum number of nonlinear iterations'))
+    #}}}
+    def __repr__(self):  # {{{
 
-		string="%s\n%s"%(string,'\n      boundary conditions:')
-		string="%s\n%s"%(string,fielddisplay(self,'spcvx','x-axis velocity constraint (NaN means no constraint) [m/yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'spcvy','y-axis velocity constraint (NaN means no constraint) [m/yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'spcvz','z-axis velocity constraint (NaN means no constraint) [m/yr]'))
-		string="%s\n%s"%(string,fielddisplay(self,'icefront','segments on ice front list (last column 0: Air, 1: Water, 2: Ice'))
+        string = '   StressBalance solution parameters:'
+        string = "%s\n%s" % (string, '      Convergence criteria:')
+        string = "%s\n%s" % (string, fielddisplay(self, 'restol', 'mechanical equilibrium residual convergence criterion'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'reltol', 'velocity relative convergence criterion, NaN: not applied'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'abstol', 'velocity absolute convergence criterion, NaN: not applied'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isnewton', "0: Picard's fixed point, 1: Newton's method, 2: hybrid"))
+        string = "%s\n%s" % (string, fielddisplay(self, 'maxiter', 'maximum number of nonlinear iterations'))
 
-		string="%s\n%s"%(string,'\n      Rift options:')
-		string="%s\n%s"%(string,fielddisplay(self,'rift_penalty_threshold','threshold for instability of mechanical constraints'))
-		string="%s\n%s"%(string,fielddisplay(self,'rift_penalty_lock','number of iterations before rift penalties are locked'))
+        string = "%s\n%s" % (string, '\n      boundary conditions:')
+        string = "%s\n%s" % (string, fielddisplay(self, 'spcvx', 'x - axis velocity constraint (NaN means no constraint) [m / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'spcvy', 'y - axis velocity constraint (NaN means no constraint) [m / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'spcvz', 'z - axis velocity constraint (NaN means no constraint) [m / yr]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'icefront', 'segments on ice front list (last column 0: Air, 1: Water, 2: Ice'))
 
-		string="%s\n%s"%(string,'\n      Penalty options:')
-		string="%s\n%s"%(string,fielddisplay(self,'penalty_factor','offset used by penalties: penalty = Kmax*10^offset'))
-		string="%s\n%s"%(string,fielddisplay(self,'vertex_pairing','pairs of vertices that are penalized'))
+        string = "%s\n%s" % (string, '\n      Rift options:')
+        string = "%s\n%s" % (string, fielddisplay(self, 'rift_penalty_threshold', 'threshold for instability of mechanical constraints'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'rift_penalty_lock', 'number of iterations before rift penalties are locked'))
 
-		string="%s\n%s"%(string,'\n      Other:')
-		string="%s\n%s"%(string,fielddisplay(self,'shelf_dampening','use dampening for floating ice ? Only for FS model'))
-		string="%s\n%s"%(string,fielddisplay(self,'FSreconditioning','multiplier for incompressibility equation. Only for FS model'))
-		string="%s\n%s"%(string,fielddisplay(self,'referential','local referential'))
-		string="%s\n%s"%(string,fielddisplay(self,'loadingforce','loading force applied on each point [N/m^3]'))
-		string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested'))
+        string = "%s\n%s" % (string, '\n      Penalty options:')
+        string = "%s\n%s" % (string, fielddisplay(self, 'penalty_factor', 'offset used by penalties: penalty = Kmax * 1.0**offset'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'vertex_pairing', 'pairs of vertices that are penalized'))
 
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		self.spcvx=project3d(md,'vector',self.spcvx,'type','node')
-		self.spcvy=project3d(md,'vector',self.spcvy,'type','node')
-		self.spcvz=project3d(md,'vector',self.spcvz,'type','node')
-		self.referential=project3d(md,'vector',self.referential,'type','node')
-		self.loadingforce=project3d(md,'vector',self.loadingforce,'type','node')
+        string = "%s\n%s" % (string, '\n      Other:')
+        string = "%s\n%s" % (string, fielddisplay(self, 'shelf_dampening', 'use dampening for floating ice ? Only for FS model'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'FSreconditioning', 'multiplier for incompressibility equation. Only for FS model'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'referential', 'local referential'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'loadingforce', 'loading force applied on each point [N / m^3]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
 
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
-		#maximum of non-linear iterations.
-		self.maxiter=100
+        return string
+    #}}}
 
-		#Convergence criterion: absolute, relative and residual
-		self.restol=10**-4
-		self.reltol=0.01
-		self.abstol=10
+    def extrude(self, md):  # {{{
+        self.spcvx = project3d(md, 'vector', self.spcvx, 'type', 'node')
+        self.spcvy = project3d(md, 'vector', self.spcvy, 'type', 'node')
+        self.spcvz = project3d(md, 'vector', self.spcvz, 'type', 'node')
+        self.referential = project3d(md, 'vector', self.referential, 'type', 'node')
+        self.loadingforce = project3d(md, 'vector', self.loadingforce, 'type', 'node')
 
-		self.FSreconditioning=10**13
-		self.shelf_dampening=0
+        return self
+    #}}}
 
-		#Penalty factor applied kappa=max(stiffness matrix)*10^penalty_factor
-		self.penalty_factor=3
+    def 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) * 1.0**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']
 
-		#Stop the iterations of rift if below a threshold
-		self.rift_penalty_threshold=0
+        return self
+    #}}}
 
-		#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
+    def defaultoutputs(self, md):  # {{{
+        if md.mesh.dimension() == 3:
+            list = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+        else:
+            list = ['Vx', 'Vy', 'Vel', 'Pressure']
+        return list
 
-		#output default:
-		self.requested_outputs=['default']
+    #}}}
 
-		return self
-	#}}}
-	def defaultoutputs(self,md): # {{{
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if 'StressbalanceAnalysis' not in analyses:
+            return md
 
-		if md.mesh.dimension()==3:
-			list = ['Vx','Vy','Vz','Vel','Pressure']
-		else:
-			list = ['Vx','Vy','Vel','Pressure']
-		return list
+        md = checkfield(md, 'fieldname', 'stressbalance.spcvx', 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'stressbalance.spcvy', 'Inf', 1, 'timeseries', 1)
+        if m.strcmp(md.mesh.domaintype(), '3D'):
+            md = checkfield(md, 'fieldname', 'stressbalance.spcvz', 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'stressbalance.restol', 'size', [1], '>', 0)
+        md = checkfield(md, 'fieldname', 'stressbalance.reltol', 'size', [1])
+        md = checkfield(md, 'fieldname', 'stressbalance.abstol', 'size', [1])
+        md = checkfield(md, 'fieldname', 'stressbalance.isnewton', 'numel', [1], 'values', [0, 1, 2])
+        md = checkfield(md, 'fieldname', 'stressbalance.FSreconditioning', 'size', [1], 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'stressbalance.maxiter', 'size', [1], '>=', 1)
+        md = checkfield(md, 'fieldname', 'stressbalance.referential', 'size', [md.mesh.numberofvertices, 6])
+        md = checkfield(md, 'fieldname', 'stressbalance.loadingforce', 'size', [md.mesh.numberofvertices, 3])
+        md = checkfield(md, 'fieldname', 'stressbalance.requested_outputs', 'stringrow', 1)
+        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
+        #        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
+        #        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
+        #        if any(sum(isnan(md.stressbalance.referential), 2) == 0),
+        if np.any(np.sum(np.isnan(md.stressbalance.referential), axis=1) == 0):
+            pos = [i for i, item in enumerate(np.sum(np.isnan(md.stressbalance.referential), axis=1)) if item == 0]
+        #            np.inner (and np.dot) calculate all the dot product permutations, resulting in a full matrix multiply
+        #            if np.any(np.abs(np.inner(md.stressbalance.referential[pos, 0:2], md.stressbalance.referential[pos, 3:5]).diagonal()) > sys.float_info.epsilon):
+        #                md.checkmessage("Vectors in stressbalance.referential (columns 1 to 3 and 4 to 6) must be orthogonal")
+            for item in md.stressbalance.referential[pos, :]:
+                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
+        if m.strcmp(md.mesh.domaintype(), '3D') and md.flowequation.isFS:
+            pos = np.nonzero(np.logical_and(md.mask.groundedice_levelset, md.mesh.vertexonbase))
+            if np.any(np.logical_not(np.isnan(md.stressbalance.referential[pos, :]))):
+                md.checkmessage("no referential should be specified for basal vertices of grounded ice")
 
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+        return md
+    # }}}
 
-		#Early return
-		if 'StressbalanceAnalysis' not in analyses:
-			return md
+    def marshall(self, prefix, md, fid):  # {{{
 
-		md = checkfield(md,'fieldname','stressbalance.spcvx','Inf',1,'timeseries',1)
-		md = checkfield(md,'fieldname','stressbalance.spcvy','Inf',1,'timeseries',1)
-		if m.strcmp(md.mesh.domaintype(),'3D'):
-			md = checkfield(md,'fieldname','stressbalance.spcvz','Inf',1,'timeseries',1)
-		md = checkfield(md,'fieldname','stressbalance.restol','size',[1],'>',0)
-		md = checkfield(md,'fieldname','stressbalance.reltol','size',[1])
-		md = checkfield(md,'fieldname','stressbalance.abstol','size',[1])
-		md = checkfield(md,'fieldname','stressbalance.isnewton','numel',[1],'values',[0,1,2])
-		md = checkfield(md,'fieldname','stressbalance.FSreconditioning','size',[1],'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','stressbalance.maxiter','size',[1],'>=',1)
-		md = checkfield(md,'fieldname','stressbalance.referential','size',[md.mesh.numberofvertices,6])
-		md = checkfield(md,'fieldname','stressbalance.loadingforce','size',[md.mesh.numberofvertices,3])
-		md = checkfield(md,'fieldname','stressbalance.requested_outputs','stringrow',1);
+        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'vertex_pairing', 'format', 'DoubleMat', 'mattype', 3)
 
-		#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
-#		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
-#		if any(sum(isnan(md.stressbalance.referential),2)==0),
-		if np.any(np.sum(np.isnan(md.stressbalance.referential),axis=1)==0):
-			pos=[i for i,item in enumerate(np.sum(np.isnan(md.stressbalance.referential),axis=1)) if item==0]
-#			np.inner (and np.dot) calculate all the dot product permutations, resulting in a full matrix multiply
-#			if np.any(np.abs(np.inner(md.stressbalance.referential[pos,0:2],md.stressbalance.referential[pos,3:5]).diagonal())>sys.float_info.epsilon):
-#				md.checkmessage("Vectors in stressbalance.referential (columns 1 to 3 and 4 to 6) must be orthogonal")
-			for item in md.stressbalance.referential[pos,:]:
-				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
-		if m.strcmp(md.mesh.domaintype(),'3D') and md.flowequation.isFS:
-			pos=np.nonzero(np.logical_and(md.mask.groundedice_levelset,md.mesh.vertexonbase))
-			if np.any(np.logical_not(np.isnan(md.stressbalance.referential[pos,:]))):
-				md.checkmessage("no referential should be specified for basal vertices of grounded ice")
+        yts = md.constants.yts
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvx', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvy', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'spcvz', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'restol', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'reltol', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'abstol', 'format', 'Double', 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'isnewton', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'FSreconditioning', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'maxiter', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'shelf_dampening', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'penalty_factor', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'rift_penalty_lock', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'rift_penalty_threshold', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'stressbalance', 'fieldname', 'referential', 'format', 'DoubleMat', 'mattype', 1)
 
-		WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','vertex_pairing','format','DoubleMat','mattype',3)
+        if isinstance(self.loadingforce, (list, tuple, np.ndarray)) and np.size(self.loadingforce, 1) == 3:
+            WriteData(fid, prefix, 'data', self.loadingforce[:, 0], 'format', 'DoubleMat', 'mattype', 1, 'name', 'md.stressbalance.loadingforcex')
+            WriteData(fid, prefix, 'data', self.loadingforce[:, 1], 'format', 'DoubleMat', 'mattype', 1, 'name', 'md.stressbalance.loadingforcey')
+            WriteData(fid, prefix, 'data', self.loadingforce[:, 2], 'format', 'DoubleMat', 'mattype', 1, 'name', 'md.stressbalance.loadingforcez')
 
-		yts=md.constants.yts
-
-		WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvx','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvy','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvz','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','restol','format','Double')
-		WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','reltol','format','Double')
-		WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','abstol','format','Double','scale',1./yts)
-		WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','isnewton','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','FSreconditioning','format','Double')
-		WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','maxiter','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','shelf_dampening','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','penalty_factor','format','Double')
-		WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','rift_penalty_lock','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','rift_penalty_threshold','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','referential','format','DoubleMat','mattype',1)
-
-		if isinstance(self.loadingforce, (list, tuple, np.ndarray)) and np.size(self.loadingforce,1) == 3:
-			WriteData(fid,prefix,'data',self.loadingforce[:,0],'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcex')
-			WriteData(fid,prefix,'data',self.loadingforce[:,1],'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcey')
-			WriteData(fid,prefix,'data',self.loadingforce[:,2],'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcez')
-
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.stressbalance.requested_outputs','format','StringArray')
-	# }}}
+    #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.stressbalance.requested_outputs', 'format', 'StringArray')
+    # }}}
Index: /issm/trunk/src/m/classes/taoinversion.py
===================================================================
--- /issm/trunk/src/m/classes/taoinversion.py	(revision 24312)
+++ /issm/trunk/src/m/classes/taoinversion.py	(revision 24313)
@@ -3,5 +3,4 @@
 from WriteData import WriteData
 from checkfield import checkfield
-from fielddisplay import fielddisplay
 from IssmConfig import IssmConfig
 from marshallcostfunctions import marshallcostfunctions
@@ -9,191 +8,183 @@
 from supportedcostfunctions import *
 
+
 class taoinversion(object):
-	def __init__(self):
-		self.iscontrol                   = 0
-		self.incomplete_adjoint          = 0
-		self.control_parameters          = float('NaN')
-		self.maxsteps                    = 0
-		self.maxiter                     = 0
-		self.fatol                       = 0
-		self.frtol                       = 0
-		self.gatol                       = 0
-		self.grtol                       = 0
-		self.gttol                       = 0
-		self.algorithm                   = ''
-		self.cost_functions              = float('NaN')
-		self.cost_functions_coefficients = float('NaN')
-		self.min_parameters              = float('NaN')
-		self.max_parameters              = float('NaN')
-		self.vx_obs                      = float('NaN')
-		self.vy_obs                      = float('NaN')
-		self.vz_obs                      = float('NaN')
-		self.vel_obs                     = float('NaN')
-		self.thickness_obs               = float('NaN')
-		self.surface_obs                 = float('NaN')
-		self.setdefaultparameters()
+    def __init__(self):
+        self.iscontrol = 0
+        self.incomplete_adjoint = 0
+        self.control_parameters = float('NaN')
+        self.maxsteps = 0
+        self.maxiter = 0
+        self.fatol = 0
+        self.frtol = 0
+        self.gatol = 0
+        self.grtol = 0
+        self.gttol = 0
+        self.algorithm = ''
+        self.cost_functions = float('NaN')
+        self.cost_functions_coefficients = float('NaN')
+        self.min_parameters = float('NaN')
+        self.max_parameters = float('NaN')
+        self.vx_obs = float('NaN')
+        self.vy_obs = float('NaN')
+        self.vz_obs = float('NaN')
+        self.vel_obs = float('NaN')
+        self.thickness_obs = float('NaN')
+        self.surface_obs = float('NaN')
+        self.setdefaultparameters()
 
-	def __repr__(self):
-		string = '   taoinversion parameters:'
-		string = "%s\n\%s"%(string, fieldstring(self,'iscontrol','is inversion activated?'))
-		string="%s\n%s"%(string,fieldstring(self,'mantle_viscosity','mantle viscosity constraints (NaN means no constraint) (Pa s)'))
-		string="%s\n%s"%(string,fieldstring(self,'lithosphere_thickness','lithosphere thickness constraints (NaN means no constraint) (m)'))
-		string="%s\n%s"%(string,fieldstring(self,'cross_section_shape',"1: square-edged, 2: elliptical-edged surface"))
-		string="%s\n%s"%(string,fieldstring(self,'incomplete_adjoint','1: linear viscosity, 0: non-linear viscosity'))
-		string="%s\n%s"%(string,fieldstring(self,'control_parameters','ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}'))
-		string="%s\n%s"%(string,fieldstring(self,'maxsteps','maximum number of iterations (gradient computation)'))
-		string="%s\n%s"%(string,fieldstring(self,'maxiter','maximum number of Function evaluation (forward run)'))
-		string="%s\n%s"%(string,fieldstring(self,'fatol','convergence criterion: f(X)-f(X*) (X: current iteration, X*: "true" solution, f: cost function)'))
-		string="%s\n%s"%(string,fieldstring(self,'frtol','convergence criterion: |f(X)-f(X*)|/|f(X*)|'))
-		string="%s\n%s"%(string,fieldstring(self,'gatol','convergence criterion: ||g(X)|| (g: gradient of the cost function)'))
-		string="%s\n%s"%(string,fieldstring(self,'grtol','convergence criterion: ||g(X)||/|f(X)|'))
-		string="%s\n%s"%(string,fieldstring(self,'gttol','convergence criterion: ||g(X)||/||g(X0)|| (g(X0): gradient at initial guess X0)'))
-		string="%s\n%s"%(string,fieldstring(self,'algorithm','minimization algorithm: ''tao_blmvm'', ''tao_cg'', ''tao_lmvm'''))
-		string="%s\n%s"%(string,fieldstring(self,'cost_functions','indicate the type of response for each optimization step'))
-		string="%s\n%s"%(string,fieldstring(self,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter'))
-		string="%s\n%s"%(string,fieldstring(self,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex'))
-		string="%s\n%s"%(string,fieldstring(self,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex'))
-		string="%s\n%s"%(string,fieldstring(self,'vx_obs','observed velocity x component [m/yr]'))
-		string="%s\n%s"%(string,fieldstring(self,'vy_obs','observed velocity y component [m/yr]'))
-		string="%s\n%s"%(string,fieldstring(self,'vel_obs','observed velocity magnitude [m/yr]'))
-		string="%s\n%s"%(string,fieldstring(self,'thickness_obs','observed thickness [m]'))
-		string="%s\n%s"%(string,fieldstring(self,'surface_obs','observed surface elevation [m]'))
-		string="%s\n%s"%(string,'Available cost functions:')
-		string="%s\n%s"%(string, '   101: SurfaceAbsVelMisfit')
-		string="%s\n%s"%(string, '   102: SurfaceRelVelMisfit')
-		string="%s\n%s"%(string, '   103: SurfaceLogVelMisfit')
-		string="%s\n%s"%(string, '   104: SurfaceLogVxVyMisfit')
-		string="%s\n%s"%(string, '   105: SurfaceAverageVelMisfit')
-		string="%s\n%s"%(string, '   201: ThicknessAbsMisfit')
-		string="%s\n%s"%(string, '   501: DragCoefficientAbsGradient')
-		string="%s\n%s"%(string, '   502: RheologyBbarAbsGradient')
-		string="%s\n%s"%(string, '   503: ThicknessAbsGradient')
-		return string
-	def setdefaultparameters(self):
+    def __repr__(self):
+        string = '   taoinversion parameters:'
+        string = "%s\n%s" % (string, fieldstring(self, 'iscontrol', 'is inversion activated?'))
+        string = "%s\n%s" % (string, fieldstring(self, 'mantle_viscosity', 'mantle viscosity constraints (NaN means no constraint) (Pa s)'))
+        string = "%s\n%s" % (string, fieldstring(self, 'lithosphere_thickness', 'lithosphere thickness constraints (NaN means no constraint) (m)'))
+        string = "%s\n%s" % (string, fieldstring(self, 'cross_section_shape', "1: square-edged, 2: elliptical - edged surface"))
+        string = "%s\n%s" % (string, fieldstring(self, 'incomplete_adjoint', '1: linear viscosity, 0: non - linear viscosity'))
+        string = "%s\n%s" % (string, fieldstring(self, 'control_parameters', 'ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}'))
+        string = "%s\n%s" % (string, fieldstring(self, 'maxsteps', 'maximum number of iterations (gradient computation)'))
+        string = "%s\n%s" % (string, fieldstring(self, 'maxiter', 'maximum number of Function evaluation (forward run)'))
+        string = "%s\n%s" % (string, fieldstring(self, 'fatol', 'convergence criterion: f(X) - f(X * ) (X: current iteration, X * : "true" solution, f: cost function)'))
+        string = "%s\n%s" % (string, fieldstring(self, 'frtol', 'convergence criterion: |f(X) - f(X * )| / |f(X * )|'))
+        string = "%s\n%s" % (string, fieldstring(self, 'gatol', 'convergence criterion: ||g(X)|| (g: gradient of the cost function)'))
+        string = "%s\n%s" % (string, fieldstring(self, 'grtol', 'convergence criterion: ||g(X)|| / |f(X)|'))
+        string = "%s\n%s" % (string, fieldstring(self, 'gttol', 'convergence criterion: ||g(X)|| / ||g(X0)|| (g(X0): gradient at initial guess X0)'))
+        string = "%s\n%s" % (string, fieldstring(self, 'algorithm', 'minimization algorithm: ''tao_blmvm'', ''tao_cg'', ''tao_lmvm'''))
+        string = "%s\n%s" % (string, fieldstring(self, 'cost_functions', 'indicate the type of response for each optimization step'))
+        string = "%s\n%s" % (string, fieldstring(self, 'cost_functions_coefficients', 'cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter'))
+        string = "%s\n%s" % (string, fieldstring(self, 'min_parameters', 'absolute minimum acceptable value of the inversed parameter on each vertex'))
+        string = "%s\n%s" % (string, fieldstring(self, 'max_parameters', 'absolute maximum acceptable value of the inversed parameter on each vertex'))
+        string = "%s\n%s" % (string, fieldstring(self, 'vx_obs', 'observed velocity x component [m / yr]'))
+        string = "%s\n%s" % (string, fieldstring(self, 'vy_obs', 'observed velocity y component [m / yr]'))
+        string = "%s\n%s" % (string, fieldstring(self, 'vel_obs', 'observed velocity magnitude [m / yr]'))
+        string = "%s\n%s" % (string, fieldstring(self, 'thickness_obs', 'observed thickness [m]'))
+        string = "%s\n%s" % (string, fieldstring(self, 'surface_obs', 'observed surface elevation [m]'))
+        string = "%s\n%s" % (string, 'Available cost functions:')
+        string = "%s\n%s" % (string, '   101: SurfaceAbsVelMisfit')
+        string = "%s\n%s" % (string, '   102: SurfaceRelVelMisfit')
+        string = "%s\n%s" % (string, '   103: SurfaceLogVelMisfit')
+        string = "%s\n%s" % (string, '   104: SurfaceLogVxVyMisfit')
+        string = "%s\n%s" % (string, '   105: SurfaceAverageVelMisfit')
+        string = "%s\n%s" % (string, '   201: ThicknessAbsMisfit')
+        string = "%s\n%s" % (string, '   501: DragCoefficientAbsGradient')
+        string = "%s\n%s" % (string, '   502: RheologyBbarAbsGradient')
+        string = "%s\n%s" % (string, '   503: ThicknessAbsGradient')
+        return string
 
-		#default is incomplete adjoint for now
-		self.incomplete_adjoint=1
+    def setdefaultparameters(self):
+        #default is incomplete adjoint for now
+        self.incomplete_adjoint = 1
+        #parameter to be inferred by control methods (only
+        #drag and B are supported yet)
+        self.control_parameters = ['FrictionCoefficient']
+        #number of iterations and steps
+        self.maxsteps = 20
+        self.maxiter = 30
+        #default tolerances
+        self.fatol = 0
+        self.frtol = 0
+        self.gatol = 0
+        self.grtol = 0
+        self.gttol = 1e-4
+        #minimization algorithm
+        PETSCMAJOR = IssmConfig('_PETSC_MAJOR_')[0]
+        PETSCMINOR = IssmConfig('_PETSC_MINOR_')[0]
+        if(PETSCMAJOR > 3 or (PETSCMAJOR == 3 and PETSCMINOR >= 5)):
+            self.algorithm = 'blmvm'
+        else:
+            self.algorithm = 'tao_blmvm'
+        #several responses can be used:
+        self.cost_functions = 101
+        return self
 
-		#parameter to be inferred by control methods (only
-		#drag and B are supported yet)
-		self.control_parameters=['FrictionCoefficient']
+    def extrude(self, md):
+        self.vx_obs = project3d(md, 'vector', self.vx_obs, 'type', 'node')
+        self.vy_obs = project3d(md, 'vector', self.vy_obs, 'type', 'node')
+        self.vel_obs = project3d(md, 'vector', self.vel_obs, 'type', 'node')
+        self.thickness_obs = project3d(md, 'vector', self.thickness_obs, 'type', 'node')
 
-		#number of iterations and steps
-		self.maxsteps=20;
-		self.maxiter =30;
+        if numel(self.cost_functions_coefficients) > 1:
+            self.cost_functions_coefficients = project3d(md, 'vector', self.cost_functions_coefficients, 'type', 'node')
 
-		#default tolerances
-		self.fatol = 0;
-		self.frtol = 0;
-		self.gatol = 0;
-		self.grtol = 0;
-		self.gttol = 1e-4;
+        if numel(self.min_parameters) > 1:
+            self.min_parameters = project3d(md, 'vector', self.min_parameters, 'type', 'node')
 
-		#minimization algorithm
-		PETSCMAJOR = IssmConfig('_PETSC_MAJOR_')[0]
-		PETSCMINOR = IssmConfig('_PETSC_MINOR_')[0]
-		if(PETSCMAJOR>3 or (PETSCMAJOR==3 and PETSCMINOR>=5)):
-			self.algorithm = 'blmvm';
-		else:
-			self.algorithm = 'tao_blmvm';
+        if numel(self.max_parameters) > 1:
+            self.max_parameters = project3d(md, 'vector', self.max_parameters, 'type', 'node')
 
-		#several responses can be used:
-		self.cost_functions=101;
-		return self
+        return self
 
-	def extrude(self,md):
-		self.vx_obs=project3d(md,'vector',self.vx_obs,'type','node')
-		self.vy_obs=project3d(md,'vector',self.vy_obs,'type','node')
-		self.vel_obs=project3d(md,'vector',self.vel_obs,'type','node')
-		self.thickness_obs=project3d(md,'vector',self.thickness_obs,'type','node')
+    def checkconsistency(self, md, solution, analyses):
+        if not self.iscontrol:
+            return md
+        if not IssmConfig('_HAVE_TAO_')[0]:
+            md = md.checkmessage('TAO has not been installed, ISSM needs to be reconfigured and recompiled with TAO')
 
-		if numel(self.cost_functions_coefficients) > 1:
-			self.cost_functions_coefficients=project3d(md,'vector',self.cost_functions_coefficients,'type','node')
+        num_controls = np.size(md.inversion.control_parameters)
+        num_costfunc = np.size(md.inversion.cost_functions)
 
-		if numel(self.min_parameters) > 1:
-			self.min_parameters=project3d(md,'vector',self.min_parameters,'type','node')
+        md = checkfield(md, 'fieldname', 'inversion.iscontrol', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'inversion.incomplete_adjoint', 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'inversion.control_parameters', 'cell', 1, 'values', supportedcontrols())
+        md = checkfield(md, 'fieldname', 'inversion.maxsteps', 'numel', 1, '>=', 0)
+        md = checkfield(md, 'fieldname', 'inversion.maxiter', 'numel', 1, '>=', 0)
+        md = checkfield(md, 'fieldname', 'inversion.fatol', 'numel', 1, '>=', 0)
+        md = checkfield(md, 'fieldname', 'inversion.frtol', 'numel', 1, '>=', 0)
+        md = checkfield(md, 'fieldname', 'inversion.gatol', 'numel', 1, '>=', 0)
+        md = checkfield(md, 'fieldname', 'inversion.grtol', 'numel', 1, '>=', 0)
+        md = checkfield(md, 'fieldname', 'inversion.gttol', 'numel', 1, '>=', 0)
 
-		if numel(self.max_parameters)>1:
-			self.max_parameters=project3d(md,'vector',self.max_parameters,'type','node')
+        PETSCMAJOR = IssmConfig('_PETSC_MAJOR_')[0]
+        PETSCMINOR = IssmConfig('_PETSC_MINOR_')[0]
+        if(PETSCMAJOR > 3 or (PETSCMAJOR == 3 and PETSCMINOR >= 5)):
+            md = checkfield(md, 'fieldname', 'inversion.algorithm', 'values', ['blmvm', 'cg', 'lmvm'])
+        else:
+            md = checkfield(md, 'fieldname', 'inversion.algorithm', 'values', ['tao_blmvm', 'tao_cg', 'tao_lmvm'])
 
-		return self
+        md = checkfield(md, 'fieldname', 'inversion.cost_functions', 'size', [num_costfunc], 'values', supportedcostfunctions())
+        md = checkfield(md, 'fieldname', 'inversion.cost_functions_coefficients', 'size', [md.mesh.numberofvertices, num_costfunc], '>=', 0)
+        md = checkfield(md, 'fieldname', 'inversion.min_parameters', 'size', [md.mesh.numberofvertices, num_controls])
+        md = checkfield(md, 'fieldname', 'inversion.max_parameters', 'size', [md.mesh.numberofvertices, num_controls])
 
-	def checkconsistency(self,md,solution,analyses):
-		if not self.iscontrol:
-			return md
-		if not IssmConfig('_HAVE_TAO_')[0]:
-			md = md.checkmessage('TAO has not been installed, ISSM needs to be reconfigured and recompiled with TAO')
+        if solution == 'BalancethicknessSolution':
+            md = checkfield(md, 'fieldname', 'inversion.thickness_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+        elif solution == 'BalancethicknessSoftSolution':
+            md = checkfield(md, 'fieldname', 'inversion.thickness_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+        else:
+            md = checkfield(md, 'fieldname', 'inversion.vx_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
+            md = checkfield(md, 'fieldname', 'inversion.vy_obs', 'size', [md.mesh.numberofvertices], 'NaN', 1, 'Inf', 1)
 
+    def marshall(self, prefix, md, fid):
 
-		num_controls= np.size(md.inversion.control_parameters)
-		num_costfunc= np.size(md.inversion.cost_functions)
+        yts = md.constants.yts
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'iscontrol', 'format', 'Boolean')
+        WriteData(fid, prefix, 'name', 'md.inversion.type', 'data', 1, 'format', 'Integer')
+        if not self.iscontrol:
+            return
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'incomplete_adjoint', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'maxsteps', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'maxiter', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'fatol', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'frtol', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'gatol', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'grtol', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'gttol', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'algorithm', 'format', 'String')
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'cost_functions_coefficients', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'min_parameters', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'max_parameters', 'format', 'DoubleMat', 'mattype', 3)
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'vx_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'vy_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'vz_obs', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'thickness_obs', 'format', 'DoubleMat', 'mattype', 1)
+        WriteData(fid, prefix, 'object', self, 'class', 'inversion', 'fieldname', 'surface_obs', 'format', 'DoubleMat', 'mattype', 1)
 
-		md = checkfield(md,'fieldname','inversion.iscontrol','values',[0, 1])
-		md = checkfield(md,'fieldname','inversion.incomplete_adjoint','values',[0,1])
-		md = checkfield(md,'fieldname','inversion.control_parameters','cell',1,'values',supportedcontrols())
-		md = checkfield(md,'fieldname','inversion.maxsteps','numel',1,'>=',0)
-		md = checkfield(md,'fieldname','inversion.maxiter','numel',1,'>=',0)
-		md = checkfield(md,'fieldname','inversion.fatol','numel',1,'>=',0)
-		md = checkfield(md,'fieldname','inversion.frtol','numel',1,'>=',0)
-		md = checkfield(md,'fieldname','inversion.gatol','numel',1,'>=',0)
-		md = checkfield(md,'fieldname','inversion.grtol','numel',1,'>=',0)
-		md = checkfield(md,'fieldname','inversion.gttol','numel',1,'>=',0)
+    #process control parameters
+        num_control_parameters = np.size(self.control_parameters)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'control_parameters', 'format', 'StringArray')
+        WriteData(fid, prefix, 'data', num_control_parameters, 'name', 'md.inversion.num_control_parameters', 'format', 'Integer')
 
-
-		PETSCMAJOR = IssmConfig('_PETSC_MAJOR_')[0]
-		PETSCMINOR = IssmConfig('_PETSC_MINOR_')[0]
-		if(PETSCMAJOR>3 or (PETSCMAJOR==3 and PETSCMINOR>=5)):
-			md = checkfield(md,'fieldname','inversion.algorithm','values',['blmvm','cg','lmvm'])
-		else:
-			md = checkfield(md,'fieldname','inversion.algorithm','values',['tao_blmvm','tao_cg','tao_lmvm'])
-
-
-		md = checkfield(md,'fieldname','inversion.cost_functions','size', [num_costfunc],'values',supportedcostfunctions())
-		md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices, num_costfunc],'>=',0)
-		md = checkfield(md,'fieldname','inversion.min_parameters','size',[md.mesh.numberofvertices, num_controls])
-		md = checkfield(md,'fieldname','inversion.max_parameters','size',[md.mesh.numberofvertices, num_controls])
-
-
-		if solution=='BalancethicknessSolution':
-			md = checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
-		elif solution=='BalancethicknessSoftSolution':
-			md = checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
-		else:
-			md = checkfield(md,'fieldname','inversion.vx_obs','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
-			md = checkfield(md,'fieldname','inversion.vy_obs','size',[md.mesh.numberofvertices],'NaN',1,'Inf',1)
-
-	def marshall(self,prefix,md,fid):
-
-		yts=md.constants.yts;
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','iscontrol','format','Boolean')
-		WriteData(fid,prefix,'name','md.inversion.type','data',1,'format','Integer')
-		if not self.iscontrol:
-			return
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','incomplete_adjoint','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxsteps','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxiter','format','Integer')
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','fatol','format','Double')
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','frtol','format','Double')
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','gatol','format','Double')
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','grtol','format','Double')
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','gttol','format','Double')
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','algorithm','format','String')
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3)
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts)
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts)
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts)
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',1)
-		WriteData(fid,prefix,'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',1)
-
-		#process control parameters
-		num_control_parameters = np.size(self.control_parameters)
-		WriteData(fid,prefix,'object',self,'fieldname','control_parameters','format','StringArray')
-		WriteData(fid,prefix,'data',num_control_parameters,'name','md.inversion.num_control_parameters','format','Integer')
-
-		#process cost functions
-		num_cost_functions = np.size(self.cost_functions)
-		data= marshallcostfunctions(self.cost_functions)
-		WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','StringArray')
-		WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer')
+    #process cost functions
+        num_cost_functions = np.size(self.cost_functions)
+        data = marshallcostfunctions(self.cost_functions)
+        WriteData(fid, prefix, 'data', data, 'name', 'md.inversion.cost_functions', 'format', 'StringArray')
+        WriteData(fid, prefix, 'data', num_cost_functions, 'name', 'md.inversion.num_cost_functions', 'format', 'Integer')
Index: /issm/trunk/src/m/classes/thermal.js
===================================================================
--- /issm/trunk/src/m/classes/thermal.js	(revision 24312)
+++ /issm/trunk/src/m/classes/thermal.js	(revision 24313)
@@ -28,4 +28,10 @@
 		//will basal boundary conditions be set dynamically
 		this.isdynamicbasalspc=0;
+
+		//wether waterfraction drainage is enabled
+		this.isdrainicecolumn=1;
+
+		//set an upper limit for local stored watercolumn
+		this.watercolumn_upperlimit=1000;
 		
 		//Linear elements by default
@@ -49,4 +55,6 @@
 		fielddisplay(this,'isenthalpy','use an enthalpy formulation to include temperate ice (default is 0)');
 		fielddisplay(this,'isdynamicbasalspc','enable dynamic setting of basal forcing. required for enthalpy formulation (default is 0)');
+		fielddisplay(this,'isdrainicecolumn','wether waterfraction drainage is enabled for enthalpy formulation (default is 1)'); 
+		fielddisplay(this,'watercolumn_upperlimit','upper limit of basal watercolumn for enthalpy formulation (default is 1000m)');
 		fielddisplay(this,'fe','Finite Element type: "P1" (default), "P1xP2"');
 		fielddisplay(this,'requested_outputs','additional outputs requested');
@@ -56,9 +64,9 @@
 		return "thermal";
 	}// }}}
-    this.extrude = function(md) {//{{{
-        this.spctemperature=project3d(md,'vector',this.spctemperature,'type','node','layer',md.mesh.numberoflayers,'padding',NaN);
-        if (md.initialization.temperature.length===md.mesh.numberofvertices) {
-            this.spctemperature = NewArrayFill(md.mesh.numberofvertices, NaN);
-            var pos=ArrayFindNot(md.mesh.vertexonsurface, 0);
+	this.extrude = function(md) {//{{{
+		this.spctemperature=project3d(md,'vector',this.spctemperature,'type','node','layer',md.mesh.numberoflayers,'padding',NaN);
+		if (md.initialization.temperature.length===md.mesh.numberofvertices) {
+			this.spctemperature = NewArrayFill(md.mesh.numberofvertices, NaN);
+			var pos=ArrayFindNot(md.mesh.vertexonsurface, 0);
 			// impose observed temperature on surface
 			for (var i=0,posIndex=0,count=0;i<md.initialization.temperature.length;i++){
@@ -81,8 +89,8 @@
 //				}
 //			}
-        }
+		}
 
-        return this;
-    }//}}}
+		return this;
+	}//}}}
 	this.checkconsistency = function(md,solution,analyses){ // {{{
 
@@ -94,5 +102,7 @@
 		checkfield(md,'fieldname','thermal.fe','values',['P1','P1xP2','P1xP3']);
 		if(ArrayAnyEqual(ArrayIsMember('EnthalpyAnalysis',analyses),1) & md.thermal.isenthalpy & md.mesh.dimension() == 3){
-			
+			checkfield(md,'fieldname','thermal.isdrainicecolumn','numel',[1],'values',[0, 1]);
+			checkfield(md,'fieldname','thermal.watercolumn_upperlimit','>=',0);
+
 			for(var i=0;i<md.mesh.numberofvertices;i++){
 				for(var j=0;j<md.thermal.spctemperature[0].length;j++){
@@ -127,4 +137,6 @@
 			WriteData(fid,prefix,'object',this,'fieldname','penalty_factor','format','Double');
 			WriteData(fid,prefix,'object',this,'fieldname','isenthalpy','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','isdrainicecolumn','format','Boolean');
+			WriteData(fid,prefix,'object',this,'fieldname','watercolumn_upperlimit','format','Double');
 			WriteData(fid,prefix,'object',this,'fieldname','fe','format','String');
 			WriteData(fid,prefix,'object',this,'fieldname','isdynamicbasalspc','format','Boolean');
@@ -155,5 +167,5 @@
 	this.penalty_threshold = 0;
 	this.stabilization     = 0;
-	this.reltol			   = 0;
+	this.reltol	   = 0;
 	this.maxiter           = 0;
 	this.penalty_lock      = 0;
@@ -161,4 +173,6 @@
 	this.isenthalpy        = 0;
 	this.isdynamicbasalspc = 0;
+	this.isdrainicecolumn  = 0;
+	this.watercolumn_upperlimit=0;
 	this.fe                = 'P1';
 	this.requested_outputs = [];
Index: /issm/trunk/src/m/classes/thermal.m
===================================================================
--- /issm/trunk/src/m/classes/thermal.m	(revision 24312)
+++ /issm/trunk/src/m/classes/thermal.m	(revision 24313)
@@ -15,4 +15,6 @@
 		isenthalpy        = 0;
 		isdynamicbasalspc = 0;
+		isdrainicecolumn   = 0;
+		watercolumn_upperlimit= 0;
 		fe                = 'P1';
 		requested_outputs = {};
@@ -66,4 +68,10 @@
 			%will basal boundary conditions be set dynamically
 			self.isdynamicbasalspc=0;
+		
+			%wether waterfraction drainage is enabled
+			self.isdrainicecolumn=1;
+
+			%set an upper limit for local stored watercolumn
+			self.watercolumn_upperlimit=1000;
 
 			%Linear elements by default
@@ -78,8 +86,10 @@
 			if (~ismember('ThermalAnalysis',analyses) & ~ismember('EnthalpyAnalysis',analyses)) | (strcmp(solution,'TransientSolution') & md.transient.isthermal==0), return; end
 
-			md = checkfield(md,'fieldname','thermal.stabilization','numel',[1],'values',[0 1 2]);
+			md = checkfield(md,'fieldname','thermal.stabilization','numel',[1],'values',[0 1 2 3]);
 			md = checkfield(md,'fieldname','thermal.spctemperature','Inf',1,'timeseries',1,'>=',0);
 			md = checkfield(md,'fieldname','thermal.fe','values',{'P1','P1xP2','P1xP3'});
 			if (ismember('EnthalpyAnalysis',analyses) & md.thermal.isenthalpy & dimension(md.mesh)==3),
+				md = checkfield(md,'fieldname','thermal.isdrainicecolumn','numel',[1],'values',[0 1]);
+				md = checkfield(md,'fieldname','thermal.watercolumn_upperlimit','>=',0);
 
 				%Make sure the spc are less than melting point
@@ -99,5 +109,5 @@
 					md = checkfield(md,'fieldname','thermal.reltol','>',0.,'message','reltol must be larger than zero');
 				end
-	    end
+			end
 
 		 md = checkfield(md,'fieldname','thermal.requested_outputs','stringrow',1);
@@ -107,5 +117,5 @@
 
 			fielddisplay(self,'spctemperature','temperature constraints (NaN means no constraint) [K]');
-			fielddisplay(self,'stabilization','0: no, 1: artificial_diffusivity, 2: SUPG');
+			fielddisplay(self,'stabilization','0: no, 1: artificial_diffusivity, 2: SUPG, 3: anisotropic SUPG');
 			fielddisplay(self,'reltol','relative tolerance convergence criterion for enthalpy');
 			fielddisplay(self,'maxiter','maximum number of non linear iterations');
@@ -114,5 +124,7 @@
 			fielddisplay(self,'penalty_factor','scaling exponent (default is 3)');
 			fielddisplay(self,'isenthalpy','use an enthalpy formulation to include temperate ice (default is 0)');
-			fielddisplay(self,'isdynamicbasalspc',['enable dynamic setting of basal forcing. required for enthalpy formulation (default is 0)']);
+			fielddisplay(self,'isdynamicbasalspc','enable dynamic setting of basal forcing. required for enthalpy formulation (default is 0)');
+			fielddisplay(self,'isdrainicecolumn','wether waterfraction drainage is enabled for enthalpy formulation (default is 1)'); 
+			fielddisplay(self,'watercolumn_upperlimit','upper limit of basal watercolumn for enthalpy formulation (default is 1000m)');
 			fielddisplay(self,'fe','Finite Element type: ''P1'' (default), ''P1xP2''');
 			fielddisplay(self,'requested_outputs','additional outputs requested');
@@ -128,4 +140,6 @@
 			WriteData(fid,prefix,'object',self,'fieldname','penalty_factor','format','Double');
 			WriteData(fid,prefix,'object',self,'fieldname','isenthalpy','format','Boolean');
+			WriteData(fid,prefix,'object',self,'fieldname','isdrainicecolumn','format','Boolean');
+			WriteData(fid,prefix,'object',self,'fieldname','watercolumn_upperlimit','format','Double');
 			WriteData(fid,prefix,'object',self,'fieldname','fe','format','String');
 			WriteData(fid,prefix,'object',self,'fieldname','isdynamicbasalspc','format','Boolean');
@@ -150,4 +164,6 @@
 			writejsdouble(fid,[modelname '.thermal.penalty_factor'],self.penalty_factor);
 			writejsdouble(fid,[modelname '.thermal.isenthalpy'],self.isenthalpy);
+			writejsdouble(fid,[modelname '.thermal.isdrainicecolumn'],self.isdrainicecolumn);
+			writejsdouble(fid,[modelname '.thermal.watercolumn_upperlimit'],self.watercolumn_upperlimit);
 			writejsdouble(fid,[modelname '.thermal.isdynamicbasalspc'],self.isdynamicbasalspc);
 			writejscellstring(fid,[modelname '.thermal.requested_outputs'],self.requested_outputs);
Index: /issm/trunk/src/m/classes/thermal.py
===================================================================
--- /issm/trunk/src/m/classes/thermal.py	(revision 24312)
+++ /issm/trunk/src/m/classes/thermal.py	(revision 24313)
@@ -1,3 +1,3 @@
-import numpy as  np
+import numpy as np
 from project3d import project3d
 from fielddisplay import fielddisplay
@@ -5,140 +5,146 @@
 from WriteData import WriteData
 
+
 class thermal(object):
-	"""
-	THERMAL class definition
+    """
+    THERMAL class definition
 
-	   Usage:
-	      thermal=thermal();
-	"""
+       Usage:
+          thermal = thermal()
+    """
 
-	def __init__(self): # {{{
-		self.spctemperature    = float('NaN')
-		self.penalty_threshold = 0
-		self.stabilization     = 0
-		self.reltol            = 0
-		self.maxiter           = 0
-		self.penalty_lock      = 0
-		self.penalty_factor    = 0
-		self.isenthalpy        = 0
-		self.isdynamicbasalspc = 0
-		self.fe                = 'P1'
-		self.requested_outputs = []
+    def __init__(self):  # {{{
+        self.spctemperature = float('NaN')
+        self.penalty_threshold = 0
+        self.stabilization = 0
+        self.reltol = 0
+        self.maxiter = 0
+        self.penalty_lock = 0
+        self.penalty_factor = 0
+        self.isenthalpy = 0
+        self.isdynamicbasalspc = 0
+        self.isdrainicecolumn = 0
+        self.watercolumn_upperlimit = 0
+        self.fe = 'P1'
+        self.requested_outputs = []
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		string='   Thermal solution parameters:'
-		string="%s\n%s"%(string,fielddisplay(self,'spctemperature','temperature constraints (NaN means no constraint) [K]'))
-		string="%s\n%s"%(string,fielddisplay(self,'stabilization','0: no, 1: artificial_diffusivity, 2: SUPG'))
-		string="%s\n%s"%(string,fielddisplay(self,'maxiter','maximum number of non linear iterations'))
-		string="%s\n%s"%(string,fielddisplay(self,'reltol','relative tolerance criterion'))
-		string="%s\n%s"%(string,fielddisplay(self,'penalty_lock','stabilize unstable thermal constraints that keep zigzagging after n iteration (default is 0, no stabilization)'))
-		string="%s\n%s"%(string,fielddisplay(self,'penalty_threshold','threshold to declare convergence of thermal solution (default is 0)'))
-		string="%s\n%s"%(string,fielddisplay(self,'isenthalpy','use an enthalpy formulation to include temperate ice (default is 0)'))
-		string="%s\n%s"%(string,fielddisplay(self,'isdynamicbasalspc','enable dynamic setting of basal forcing. required for enthalpy formulation (default is 0)'))
-		string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','additional outputs requested'))
-		return string
-		#}}}
-	def extrude(self,md): # {{{
-		self.spctemperature=project3d(md,'vector',self.spctemperature,'type','node','layer',md.mesh.numberoflayers,'padding',np.nan)
-		if isinstance(md.initialization.temperature,np.ndarray) and np.size(md.initialization.temperature,axis=0)==md.mesh.numberofvertices:
-			self.spctemperature=float('NaN')*np.ones((md.mesh.numberofvertices))
-			pos=np.where(md.mesh.vertexonsurface)[0]
-			self.spctemperature[pos]=md.initialization.temperature[pos]    #impose observed temperature on surface
-		return self
-	#}}}
-	def defaultoutputs(self,md): # {{{
+    #}}}
 
-		if self.isenthalpy:
-			return ['Enthalpy','Temperature','Waterfraction','Watercolumn','BasalforcingsGroundediceMeltingRate']
-		else:
-			return ['Temperature','BasalforcingsGroundediceMeltingRate']
+    def __repr__(self):  # {{{
+        string = '   Thermal solution parameters:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'spctemperature', 'temperature constraints (NaN means no constraint) [K]'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'stabilization', '0: no, 1: artificial_diffusivity, 2: SUPG'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'maxiter', 'maximum number of non linear iterations'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'reltol', 'relative tolerance criterion'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'penalty_lock', 'stabilize unstable thermal constraints that keep zigzagging after n iteration (default is 0, no stabilization)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'penalty_threshold', 'threshold to declare convergence of thermal solution (default is 0)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isenthalpy', 'use an enthalpy formulation to include temperate ice (default is 0)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isdynamicbasalspc', 'enable dynamic setting of basal forcing. required for enthalpy formulation (default is 0)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isdrainicecolumn', 'wether waterfraction drainage is enabled for enthalpy formulation (default is 1)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'watercolumn_upperlimit', 'upper limit of basal watercolumn for enthalpy formulation (default is 1000m)'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested'))
+        return string
+    #}}}
 
-	#}}}
-	def setdefaultparameters(self): # {{{
-		
-		#Number of unstable constraints acceptable
-		self.penalty_threshold=0
+    def extrude(self, md):  # {{{
+        self.spctemperature = project3d(md, 'vector', self.spctemperature, 'type', 'node', 'layer', md.mesh.numberoflayers, 'padding', np.nan)
+        if isinstance(md.initialization.temperature, np.ndarray) and np.size(md.initialization.temperature, axis=0) == md.mesh.numberofvertices:
+            self.spctemperature = float('NaN') * np.ones((md.mesh.numberofvertices))
+            pos = np.where(md.mesh.vertexonsurface)[0]
+            self.spctemperature[pos] = md.initialization.temperature[pos]  #impose observed temperature on surface
+        return self
+    #}}}
 
-		#Type of stabilization used
-		self.stabilization=1
+    def defaultoutputs(self, md):  # {{{
+        if self.isenthalpy:
+            return ['Enthalpy', 'Temperature', 'Waterfraction', 'Watercolumn', 'BasalforcingsGroundediceMeltingRate']
+        else:
+            return ['Temperature', 'BasalforcingsGroundediceMeltingRate']
 
-		#Relative tolerance for the enthalpy convergence
-		self.reltol=0.01
+    #}}}
 
-		#Maximum number of iterations
-		self.maxiter=100
+    def setdefaultparameters(self):  # {{{
+        #Number of unstable constraints acceptable
+        self.penalty_threshold = 0
+        #Type of stabilization used
+        self.stabilization = 1
+        #Relative tolerance for the enthalpy convergence
+        self.reltol = 0.01
+        #Maximum number of iterations
+        self.maxiter = 100
+        #factor used to compute the values of the penalties: kappa = max(stiffness matrix) * 1.0**penalty_factor
+        self.penalty_factor = 3
+        #Should we use cold ice (default) or enthalpy formulation
+        self.isenthalpy = 0
+        #will basal boundary conditions be set dynamically
+        self.isdynamicbasalspc = 0
+        #wether waterfraction drainage is enabled
+        self.isdrainicecolumn = 1
+        #set an upper limit for local stored watercolumn
+        self.watercolumn_upperlimit = 1000
+        #Finite element interpolation
+        self.fe = 'P1'
+        #default output
+        self.requested_outputs = ['default']
+        return self
 
-		#factor used to compute the values of the penalties: kappa=max(stiffness matrix)*10^penalty_factor
-		self.penalty_factor=3
+    #}}}
 
-		#Should we use cold ice (default) or enthalpy formulation
-		self.isenthalpy=0
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if ('ThermalAnalysis' not in analyses and 'EnthalpyAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isthermal):
+            return md
 
-		#will basal boundary conditions be set dynamically
-		self.isdynamicbasalspc=0
+        md = checkfield(md, 'fieldname', 'thermal.stabilization', 'numel', [1], 'values', [0, 1, 2])
+        md = checkfield(md, 'fieldname', 'thermal.spctemperature', 'Inf', 1, 'timeseries', 1)
+        md = checkfield(md, 'fieldname', 'thermal.requested_outputs', 'stringrow', 1)
 
-		#Finite element interpolation
-		self.fe='P1'
+        if 'EnthalpyAnalysis' in analyses and md.thermal.isenthalpy and md.mesh.dimension() == 3:
+            md = checkfield(md, 'fieldname', 'thermal.isdrainicecolumn', 'numel', [1], 'values', [0, 1])
+            md = checkfield(md, 'fieldname', 'thermal.watercolumn_upperlimit', '>=', 0)
 
-		#default output
-		self.requested_outputs=['default']
-		return self
+            TEMP = md.thermal.spctemperature[:-1].flatten(-1)
+            pos = np.where(~np.isnan(TEMP))
+            try:
+                spccol = np.size(md.thermal.spctemperature, 1)
+            except IndexError:
+                spccol = 1
 
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+            replicate = np.tile(md.geometry.surface - md.mesh.z, (spccol)).flatten(-1)
+            control = md.materials.meltingpoint - md.materials.beta * md.materials.rho_ice * md.constants.g * replicate + 1.0e-5
+            md = checkfield(md, 'fieldname', 'thermal.spctemperature', 'field', md.thermal.spctemperature.flatten(-1)[pos], '<=', control[pos], 'message', "spctemperature should be below the adjusted melting point")
+            md = checkfield(md, 'fieldname', 'thermal.isenthalpy', 'numel', [1], 'values', [0, 1])
+            md = checkfield(md, 'fieldname', 'thermal.isdynamicbasalspc', 'numel', [1], 'values', [0, 1])
+            if(md.thermal.isenthalpy):
+                if np.isnan(md.stressbalance.reltol):
+                    md.checkmessage("for a steadystate computation, thermal.reltol (relative convergence criterion) must be defined!")
+                md = checkfield(md, 'fieldname', 'thermal.reltol', '>', 0., 'message', "reltol must be larger than zero")
 
-		#Early return
-		if ('ThermalAnalysis' not in analyses and 'EnthalpyAnalysis' not in analyses) or (solution=='TransientSolution' and not md.transient.isthermal):
-			return md
+        return md
+    # }}}
 
-		md = checkfield(md,'fieldname','thermal.stabilization','numel',[1],'values',[0,1,2])
-		md = checkfield(md,'fieldname','thermal.spctemperature','Inf',1,'timeseries',1)
-		md = checkfield(md,'fieldname','thermal.requested_outputs','stringrow',1)
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'spctemperature', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'penalty_threshold', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'stabilization', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'reltol', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'maxiter', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'penalty_lock', 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'penalty_factor', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isenthalpy', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isdrainicecolumn', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'watercolumn_upperlimit', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'fe', 'format', 'String')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isdynamicbasalspc', 'format', 'Boolean')
 
-		if 'EnthalpyAnalysis' in analyses and md.thermal.isenthalpy and md.mesh.dimension()==3:
-			TEMP = md.thermal.spctemperature[:-1].flatten(-1)
-			pos=np.where(~np.isnan(TEMP))
-			try:
-				spccol=np.size(md.thermal.spctemperature,1)
-			except IndexError:
-				spccol=1
-
-			replicate=np.tile(md.geometry.surface-md.mesh.z,(spccol)).flatten(-1)
-
-			control=md.materials.meltingpoint-md.materials.beta*md.materials.rho_ice*md.constants.g*replicate+10**-5
-
-			md = checkfield(md,'fieldname','thermal.spctemperature','field',md.thermal.spctemperature.flatten(-1)[pos],'<=',control[pos],'message',"spctemperature should be below the adjusted melting point")
-			md = checkfield(md,'fieldname','thermal.isenthalpy','numel',[1],'values',[0,1])
-			md = checkfield(md,'fieldname','thermal.isdynamicbasalspc','numel',[1],'values',[0,1]);
-			if(md.thermal.isenthalpy):
-				if np.isnan(md.stressbalance.reltol):
-					md.checkmessage("for a steadystate computation, thermal.reltol (relative convergence criterion) must be defined!")
-				md = checkfield(md,'fieldname','thermal.reltol','>',0.,'message',"reltol must be larger than zero");
-
-
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'object',self,'fieldname','spctemperature','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts)
-		WriteData(fid,prefix,'object',self,'fieldname','penalty_threshold','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','reltol','format','Double');
-		WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','penalty_lock','format','Integer')
-		WriteData(fid,prefix,'object',self,'fieldname','penalty_factor','format','Double')
-		WriteData(fid,prefix,'object',self,'fieldname','isenthalpy','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','fe','format','String');
-		WriteData(fid,prefix,'object',self,'fieldname','isdynamicbasalspc','format','Boolean');
-
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.thermal.requested_outputs','format','StringArray')
-	# }}}
+    #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.thermal.requested_outputs', 'format', 'StringArray')
+    # }}}
Index: /issm/trunk/src/m/classes/timestepping.py
===================================================================
--- /issm/trunk/src/m/classes/timestepping.py	(revision 24312)
+++ /issm/trunk/src/m/classes/timestepping.py	(revision 24313)
@@ -3,65 +3,67 @@
 from WriteData import WriteData
 
+
 class timestepping(object):
-	"""
-	TIMESTEPPING Class definition
+    """
+    TIMESTEPPING Class definition
 
-	   Usage:
-	      timestepping=timestepping();
-	"""
+       Usage:
+          timestepping = timestepping()
+    """
 
-	def __init__(self): # {{{
-		self.start_time      = 0.
-		self.final_time      = 0.
-		self.time_step       = 0.
-		self.interp_forcings = 1
-		self.coupling_time   = 0.
-		
-		#set defaults
-		self.setdefaultparameters()
+    def __init__(self):  # {{{
+        self.start_time = 0.
+        self.final_time = 0.
+        self.time_step = 0.
+        self.interp_forcings = 1
+        self.coupling_time = 0.
 
-		#}}}
-	def __repr__(self): # {{{
-		string="   timestepping parameters:"
-		string="%s\n%s"%(string,fielddisplay(self,"start_time","simulation starting time [yr]"))
-		string="%s\n%s"%(string,fielddisplay(self,"final_time","final time to stop the simulation [yr]"))
-		string="%s\n%s"%(string,fielddisplay(self,"time_step","length of time steps [yr]"))
-		string="%s\n%s"%(string,fielddisplay(self,"interp_forcings","interpolate in time between requested forcing values ? (0 or 1)"))
-		string="%s\n%s"%(string,fielddisplay(self,"coupling_time","length of coupling time steps with ocean model [yr]"))
-		return string
-		#}}}
-	def setdefaultparameters(self): # {{{
-		
-		#time between 2 time steps
-		self.time_step=1./2.
+    #set defaults
+        self.setdefaultparameters()
 
-		#final time
-		self.final_time=10.*self.time_step
+    #}}}
 
-		#should we interpolate forcings between timesteps?
-		self.interp_forcings=1
+    def __repr__(self):  # {{{
+        string = "   timestepping parameters:"
+        string = "%s\n%s" % (string, fielddisplay(self, "start_time", "simulation starting time [yr]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "final_time", "final time to stop the simulation [yr]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "time_step", "length of time steps [yr]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "interp_forcings", "interpolate in time between requested forcing values ? (0 or 1)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "coupling_time", "length of coupling time steps with ocean model [yr]"))
+        return string
+    #}}}
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+    def setdefaultparameters(self):  # {{{
+        #time between 2 time steps
+        self.time_step = 1. / 2.
+        #final time
+        self.final_time = 10. * self.time_step
+        #should we interpolate forcings between timesteps?
+        self.interp_forcings = 1
 
-		md = checkfield(md,'fieldname','timestepping.start_time','numel',[1],'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','timestepping.final_time','numel',[1],'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>=',0,'NaN',1,'Inf',1)
-		if self.final_time-self.start_time<0:
-			md.checkmessage("timestepping.final_time should be larger than timestepping.start_time")
-			md = checkfield(md,'fieldname','timestepping.coupling_time','numel',[1],'>=',0,'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0,1])
+        return self
+    #}}}
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+    def checkconsistency(self, md, solution, analyses):  # {{{
 
-		yts=md.constants.yts
-		WriteData(fid,prefix,'name','md.timestepping.type','data',1,'format','Integer');
-		WriteData(fid,prefix,'object',self,'fieldname','start_time','format','Double','scale',yts)
-		WriteData(fid,prefix,'object',self,'fieldname','final_time','format','Double','scale',yts)
-		WriteData(fid,prefix,'object',self,'fieldname','time_step','format','Double','scale',yts)
-		WriteData(fid,prefix,'object',self,'fieldname','interp_forcings','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','coupling_time','format','Double','scale',yts)
-	# }}}
+        md = checkfield(md, 'fieldname', 'timestepping.start_time', 'numel', [1], 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'timestepping.final_time', 'numel', [1], 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'timestepping.time_step', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+        if self.final_time - self.start_time < 0:
+            md.checkmessage("timestepping.final_time should be larger than timestepping.start_time")
+            md = checkfield(md, 'fieldname', 'timestepping.coupling_time', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'timestepping.interp_forcings', 'numel', [1], 'values', [0, 1])
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+
+        yts = md.constants.yts
+        WriteData(fid, prefix, 'name', 'md.timestepping.type', 'data', 1, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'start_time', 'format', 'Double', 'scale', yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'final_time', 'format', 'Double', 'scale', yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'time_step', 'format', 'Double', 'scale', yts)
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'interp_forcings', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'coupling_time', 'format', 'Double', 'scale', yts)
+    # }}}
Index: /issm/trunk/src/m/classes/timesteppingadaptive.py
===================================================================
--- /issm/trunk/src/m/classes/timesteppingadaptive.py	(revision 24312)
+++ /issm/trunk/src/m/classes/timesteppingadaptive.py	(revision 24313)
@@ -3,89 +3,87 @@
 from WriteData import WriteData
 
+
 class timesteppingadaptive(object):
-	"""
-	TIMESTEPPINGADAPTIVE Class definition
+    """
+    TIMESTEPPINGADAPTIVE Class definition
 
-	   Usage:
-	      timesteppingadaptive=timesteppingadaptive();
-	"""
+       Usage:
+          timesteppingadaptive = timesteppingadaptive()
+    """
 
-	def __init__(self,*args): # {{{
-		if not len(args):
-			self.start_time      = 0.
-			self.final_time      = 0.
-			self.time_step_min   = 0.
-			self.time_step_max   = 0.
-			self.cfl_coefficient = 0.
-			self.interp_forcings = 1
-			self.coupling_time   = 0.
-			
-			#set defaults
-			self.setdefaultparameters()
+    def __init__(self, *args):  # {{{
+        if not len(args):
+            self.start_time = 0.
+            self.final_time = 0.
+            self.time_step_min = 0.
+            self.time_step_max = 0.
+            self.cfl_coefficient = 0.
+            self.interp_forcings = 1
+            self.coupling_time = 0.
 
-		elif len(args)==1 and args[0].__module__=='timestepping':
-			old=args[0]
-			#first call setdefaultparameters: 
-			self.setdefaultparameters()
-			self.start_time      = old.start_time      
-			self.final_time      = old.final_time      
-			self.interp_forcings = old.interp_forcings 
-                        self.coupling_time   = old.coupling_time
+            #set defaults
+            self.setdefaultparameters()
 
-		else:
-			raise Exception('constructor not supported')
-		#}}}
-	def __repr__(self): # {{{
-		string="   timesteppingadaptive parameters:"
-		string="%s\n%s"%(string,fielddisplay(self,"start_time","simulation starting time [yr]"))
-		string="%s\n%s"%(string,fielddisplay(self,"final_time","final time to stop the simulation [yr]"))
-		string="%s\n%s"%(string,fielddisplay(self,"time_step_min","minimum length of time steps [yr]"))
-		string="%s\n%s"%(string,fielddisplay(self,"time_step_max","maximum length of time steps [yr]"))
-		string="%s\n%s"%(string,fielddisplay(self,"cfl_coefficient","coefficient applied to cfl condition"))
-		string="%s\n%s"%(string,fielddisplay(self,"interp_forcings","interpolate in time between requested forcing values ? (0 or 1)"))
-		string="%s\n%s"%(string,fielddisplay(self,"coupling_time","coupling time steps with ocean model [yr]"))
-		return string
-		#}}}
-	def setdefaultparameters(self): # {{{
-		
-		#time between 2 time steps
-		self.time_step_min=0.01
-		self.time_step_max=10.
+        elif len(args) == 1 and args[0].__module__ == 'timestepping':
+            old = args[0]
+            #first call setdefaultparameters:
+            self.setdefaultparameters()
+            self.start_time = old.start_time
+            self.final_time = old.final_time
+            self.interp_forcings = old.interp_forcings
+            self.coupling_time = old.coupling_time
 
-		#final time
-		self.final_time=10.*self.time_step_max
+        else:
+            raise Exception('constructor not supported')
+    #}}}
 
-		#time adaptation? 
-		self.cfl_coefficient=0.5
-		
-		#should we interpolate forcings between timesteps?
-		self.interp_forcings=1
+    def __repr__(self):  # {{{
+        string = "   timesteppingadaptive parameters:"
+        string = "%s\n%s" % (string, fielddisplay(self, "start_time", "simulation starting time [yr]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "final_time", "final time to stop the simulation [yr]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "time_step_min", "minimum length of time steps [yr]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "time_step_max", "maximum length of time steps [yr]"))
+        string = "%s\n%s" % (string, fielddisplay(self, "cfl_coefficient", "coefficient applied to cfl condition"))
+        string = "%s\n%s" % (string, fielddisplay(self, "interp_forcings", "interpolate in time between requested forcing values ? (0 or 1)"))
+        string = "%s\n%s" % (string, fielddisplay(self, "coupling_time", "coupling time steps with ocean model [yr]"))
+        return string
+    # }}}
 
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+    def setdefaultparameters(self):  # {{{
+        #time between 2 time steps
+        self.time_step_min = 0.01
+        self.time_step_max = 10.
+        #final time
+        self.final_time = 10. * self.time_step_max
+        #time adaptation?
+        self.cfl_coefficient = 0.5
+        #should we interpolate forcings between timesteps?
+        self.interp_forcings = 1
+        return self
+    #}}}
 
-		md = checkfield(md,'fieldname','timestepping.start_time','numel',[1],'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','timestepping.final_time','numel',[1],'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','timestepping.time_step_min','numel',[1],'>=',0,'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','timestepping.time_step_max','numel',[1],'>=',md.timestepping.time_step_min,'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','timestepping.cfl_coefficient','numel',[1],'>',0,'<=',1)
-		if self.final_time-self.start_time<0:
-			md.checkmessage("timestepping.final_time should be larger than timestepping.start_time")
-		md = checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','timestepping.coupling_time','numel',[1],'>=',0,'NaN',1,'Inf',1)
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        md = checkfield(md, 'fieldname', 'timestepping.start_time', 'numel', [1], 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'timestepping.final_time', 'numel', [1], 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'timestepping.time_step_min', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'timestepping.time_step_max', 'numel', [1], '>=', md.timestepping.time_step_min, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'timestepping.cfl_coefficient', 'numel', [1], '>', 0, '<=', 1)
+        if self.final_time - self.start_time < 0:
+            md.checkmessage("timestepping.final_time should be larger than timestepping.start_time")
+        md = checkfield(md, 'fieldname', 'timestepping.interp_forcings', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'timestepping.coupling_time', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
+        return md
+    # }}}
 
-		yts=md.constants.yts
-		WriteData(fid,prefix,'name','md.timestepping.type','data',2,'format','Integer');
-		WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','start_time','format','Double','scale',yts)
-		WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','final_time','format','Double','scale',yts)
-		WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','time_step_min','format','Double','scale',yts)
-		WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','time_step_max','format','Double','scale',yts)
-		WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','cfl_coefficient','format','Double')
-		WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','interp_forcings','format','Boolean')
-		WriteData(fid,prefix,'object',self,'class','timestepping','fieldname','coupling_time','format','Double','scale',yts)
-	# }}}
+    def marshall(self, prefix, md, fid):  # {{{
+        yts = md.constants.yts
+        WriteData(fid, prefix, 'name', 'md.timestepping.type', 'data', 2, 'format', 'Integer')
+        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'start_time', 'format', 'Double', 'scale', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'final_time', 'format', 'Double', 'scale', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'time_step_min', 'format', 'Double', 'scale', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'time_step_max', 'format', 'Double', 'scale', yts)
+        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'cfl_coefficient', 'format', 'Double')
+        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'interp_forcings', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'class', 'timestepping', 'fieldname', 'coupling_time', 'format', 'Double', 'scale', yts)
+    # }}}
Index: /issm/trunk/src/m/classes/toolkits.js
===================================================================
--- /issm/trunk/src/m/classes/toolkits.js	(revision 24312)
+++ /issm/trunk/src/m/classes/toolkits.js	(revision 24313)
@@ -29,4 +29,6 @@
 			}
 		}
+
+		this.RecoveryAnalysis = this.DefaultAnalysis;
 	}// }}}
 	this.disp = function(){// {{{
@@ -94,5 +96,6 @@
 	//properties 
 	// {{{
-	this.DefaultAnalysis           = [];
+	this.DefaultAnalysis  = [];
+	this.RecoveryAnalysis = [];
 	//The other properties are dynamic
 	this.setdefaultparameters();
Index: /issm/trunk/src/m/classes/toolkits.m
===================================================================
--- /issm/trunk/src/m/classes/toolkits.m	(revision 24312)
+++ /issm/trunk/src/m/classes/toolkits.m	(revision 24313)
@@ -6,6 +6,18 @@
 classdef toolkits < dynamicprops
     properties (SetAccess=public) 
-		 DefaultAnalysis           = struct();
+		 DefaultAnalysis  = struct();
+		 RecoveryAnalysis = struct();
 		 %The other properties are dynamic
+	 end
+	 methods (Static)
+		 function self = loadobj(self) % {{{
+			 % This function is directly called by matlab when a model object is
+			 % loaded. Update old properties here
+
+			 if isempty(fieldnames(self.RecoveryAnalysis));
+				 disp('WARNING: updating toolkits (RecoveryAnalysis not set)');
+				 self.RecoveryAnalysis  = self.DefaultAnalysis;
+			 end
+		 end% }}}
 	 end
 	 methods
@@ -54,4 +66,8 @@
 			 end
 
+			 %Use same solver for Recovery mode
+			 self.RecoveryAnalysis = self.DefaultAnalysis;
+
+
 		 end % }}}
 		 function disp(self) % {{{
@@ -73,10 +89,10 @@
 		 end % }}}
 		 function ToolkitsFile(toolkits,filename) % {{{
-		 %TOOLKITSFILE - build toolkits file
-		 %
-		 %   Build a Petsc compatible options file, from the toolkits model field  + return options string. 
-		 %   This file will also be used when the toolkit used is 'issm' instead of 'petsc'
-		 %
-		 %   Usage:     ToolkitsFile(toolkits,filename);
+			 %TOOLKITSFILE - build toolkits file
+			 %
+			 %   Build a Petsc compatible options file, from the toolkits model field  + return options string. 
+			 %   This file will also be used when the toolkit used is 'issm' instead of 'petsc'
+			 %
+			 %   Usage:     ToolkitsFile(toolkits,filename);
 
 			 %open file for writing
@@ -122,7 +138,7 @@
 			 fclose(fid);
 		 end %}}}
-		function savemodeljs(self,fid,modelname) % {{{
-	
-			analyses=properties(self);
+		 function savemodeljs(self,fid,modelname) % {{{
+
+			 analyses=properties(self);
 			 for i=1:numel(analyses),
 				 if isempty(fieldnames(self.(analyses{i})))
@@ -132,6 +148,6 @@
 				 end
 			 end
-	
-		end % }}}
+
+		 end % }}}
 	 end
  end
Index: /issm/trunk/src/m/classes/toolkits.py
===================================================================
--- /issm/trunk/src/m/classes/toolkits.py	(revision 24312)
+++ /issm/trunk/src/m/classes/toolkits.py	(revision 24313)
@@ -3,104 +3,111 @@
 from iluasmoptions import iluasmoptions
 from fielddisplay import fielddisplay
-from checkfield import checkfield
 from issmgslsolver import issmgslsolver
 from issmmumpssolver import issmmumpssolver
 
+
 class toolkits(object):
-	"""
-	TOOLKITS class definition
+    """
+    TOOLKITS class definition
 
-	   Usage:
-	      self=toolkits();
-	"""
+       Usage:
+          self = toolkits()
+    """
 
-	def __init__(self):    # {{{
-		#default toolkits
-		if IssmConfig('_HAVE_PETSC_')[0]:
-			#MUMPS is the default toolkits
-			if IssmConfig('_HAVE_MUMPS_')[0]:
-				self.DefaultAnalysis           = mumpsoptions()
-			else:
-				self.DefaultAnalysis           = iluasmoptions()
-		else:
-			if IssmConfig('_HAVE_MUMPS_')[0]:
-				self.DefaultAnalysis           = issmmumpssolver()
-			elif IssmConfig('_HAVE_GSL_')[0]:
-				self.DefaultAnalysis           = issmgslsolver()
-			else:
-				raise IOError("ToolkitsFile error: need at least Mumps or Gsl to define issm solver type")
+    def __init__(self):  # {{{
+        #default toolkits
+        if IssmConfig('_HAVE_PETSC_')[0]:
+            #MUMPS is the default toolkits
+            if IssmConfig('_HAVE_MUMPS_')[0]:
+                self.DefaultAnalysis = mumpsoptions()
+            else:
+                self.DefaultAnalysis = iluasmoptions()
+        else:
+            if IssmConfig('_HAVE_MUMPS_')[0]:
+                self.DefaultAnalysis = issmmumpssolver()
+            elif IssmConfig('_HAVE_GSL_')[0]:
+                self.DefaultAnalysis = issmgslsolver()
+            else:
+                raise IOError("ToolkitsFile error: need at least Mumps or Gsl to define issm solver type")
 
-		#The other properties are dynamic
-	# }}}
-	def __repr__(self):    # {{{
-		s ="List of toolkits options per analysis:\n\n"
-		for analysis in vars(self).iterkeys():
-			s+="%s\n" % fielddisplay(self,analysis,'')
+        #Use same solver for Recovery mode
+        self.RecoveryAnalysis = self.DefaultAnalysis
 
-		return s
-	# }}}
-	def addoptions(self,analysis,*args):    # {{{
-		# Usage example:
-		#    md.toolkits=addoptions(md.toolkits,'StressbalanceAnalysis',FSoptions());
-		#    md.toolkits=addoptions(md.toolkits,'StressbalanceAnalysis');
+    #The other properties are dynamic
+    # }}}
 
-		#Create dynamic property if property does not exist yet
-		if not hasattr(self,analysis):
-			setattr(self,analysis,None)
+    def __repr__(self):  # {{{
+        s = "List of toolkits options per analysis:\n\n"
+        for analysis in list(vars(self).keys()):
+            s += "%s\n" % fielddisplay(self, analysis, '')
 
-		#Add toolkits options to analysis
-		if len(args)==1:
-			setattr(self,analysis,args[0])
+            return s
+    # }}}
 
-		return self
-	# }}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		for analysis in vars(self).iterkeys():
-			if not getattr(self,analysis):
-				md.checkmessage("md.toolkits.%s is empty" % analysis)
+    def addoptions(self, analysis, *args):  # {{{
+        # Usage example:
+        #    md.toolkits = addoptions(md.toolkits, 'StressbalanceAnalysis', FSoptions())
+        #    md.toolkits = addoptions(md.toolkits, 'StressbalanceAnalysis')
 
-		return md
-	# }}}
-	def ToolkitsFile(self,filename):    # {{{
-		"""
-		TOOLKITSFILE- build toolkits file
+        #Create dynamic property if property does not exist yet
+        if not hasattr(self, analysis):
+            setattr(self, analysis, None)
 
-		   Build a Petsc compatible options file, from the toolkits model field  + return options string
-		   This file will also be used when the toolkit used is 'issm' instead of 'petsc'
+        #Add toolkits options to analysis
+        if len(args) == 1:
+            setattr(self, analysis, args[0])
+
+        return self
+    # }}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        for analysis in list(vars(self).keys()):
+            if not getattr(self, analysis):
+                md.checkmessage("md.toolkits.%s is empty" % analysis)
+
+        return md
+    # }}}
+
+    def ToolkitsFile(self, filename):  # {{{
+        """
+        TOOLKITSFILE - build toolkits file
+
+           Build a Petsc compatible options file, from the toolkits model field + return options string
+           This file will also be used when the toolkit used is 'issm' instead of 'petsc'
 
 
-		   Usage:     ToolkitsFile(toolkits,filename);
-		"""
+           Usage:     ToolkitsFile(toolkits, filename)
+        """
 
-		#open file for writing
-		try:
-			fid=open(filename,'w')
-		except IOError as e:
-			raise IOError("ToolkitsFile error: could not open '%s' for writing." % filename)
+    #open file for writing
+        try:
+            fid = open(filename, 'w')
+        except IOError as e:
+            raise IOError("ToolkitsFile error: could not open {}' for writing due to".format(filename), e)
 
-		#write header
-		fid.write("%s%s%s\n" % ('%Toolkits options file: ',filename,' written from Python toolkits array'))
+    #write header
+        fid.write("%s%s%s\n" % ('%Toolkits options file: ', filename, ' written from Python toolkits array'))
 
-		#start writing options
-		for analysis in vars(self).iterkeys():
-			options=getattr(self,analysis)
+    #start writing options
+        for analysis in list(vars(self).keys()):
+            options = getattr(self, analysis)
 
-			#first write analysis:
-			fid.write("\n+%s\n" % analysis)    #append a + to recognize it's an analysis enum
-			#now, write options
-			for optionname,optionvalue in options.iteritems():
+    #first write analysis:
+            fid.write("\n+{}\n".format(analysis))  #append a + to recognize it's an analysis enum
+    #now, write options
+            for optionname, optionvalue in list(options.items()):
 
-				if not optionvalue:
-					#this option has only one argument
-					fid.write("-%s\n" % optionname)
-				else:
-					#option with value. value can be string or scalar
-					if   isinstance(optionvalue,(bool,int,long,float)):
-						fid.write("-%s %g\n" % (optionname,optionvalue))
-					elif isinstance(optionvalue,(str,unicode)):
-						fid.write("-%s %s\n" % (optionname,optionvalue))
-					else:
-						raise TypeError("ToolkitsFile error: option '%s' is not well formatted." % optionname)
+                if not optionvalue:
+                    #this option has only one argument
+                    fid.write("-{}\n".format(optionname))
+                else:
+                    #option with value. value can be string or scalar
+                    if isinstance(optionvalue, (bool, int, float)):
+                        fid.write("-{} {}\n".format(optionname, optionvalue))
+                    elif isinstance(optionvalue, str):
+                        fid.write("-{} {}\n".format(optionname, optionvalue))
+                    else:
+                        raise TypeError("ToolkitsFile error: option '{}' is not well formatted.".format(optionname))
 
-		fid.close()
-	# }}}
+        fid.close()
+    # }}}
Index: /issm/trunk/src/m/classes/transient.m
===================================================================
--- /issm/trunk/src/m/classes/transient.m	(revision 24312)
+++ /issm/trunk/src/m/classes/transient.m	(revision 24313)
@@ -104,4 +104,7 @@
 				md = checkmessage(md,['Coupling with ocean model can only be performed for transient simulations!']);
 			end
+			if (md.transient.isdamageevolution & ~isa(md.materials,'matdamageice')), 
+				md = checkmessage(md,['requesting damage evolution but md.materials is not of class matdamageice']);
+			end
 		end % }}}
 		function disp(self) % {{{
Index: /issm/trunk/src/m/classes/transient.py
===================================================================
--- /issm/trunk/src/m/classes/transient.py	(revision 24312)
+++ /issm/trunk/src/m/classes/transient.py	(revision 24313)
@@ -3,173 +3,179 @@
 from WriteData import WriteData
 
+
 class transient(object):
-	"""
-	TRANSIENT class definition
+    """
+    TRANSIENT class definition
 
-	   Usage:
-	      transient=transient();
-	"""
+       Usage:
+          transient = transient()
+    """
 
-	def __init__(self): # {{{
-		self.issmb   	       = False
-		self.ismasstransport   = False
-		self.isstressbalance   = False
-		self.isthermal         = False
-		self.isgroundingline   = False
-		self.isgia             = False
-		self.isesa             = False
-		self.isdamageevolution = False
-		self.ismovingfront     = False
-		self.ishydrology       = False
-		self.isslr             = False
-		self.iscoupler         = False
-		self.amr_frequency     = 0
-		self.isoceancoupling   = False
-		self.requested_outputs = []
+    def __init__(self):  # {{{
+        self.issmb = False
+        self.ismasstransport = False
+        self.isstressbalance = False
+        self.isthermal = False
+        self.isgroundingline = False
+        self.isgia = False
+        self.isesa = False
+        self.isdamageevolution = False
+        self.ismovingfront = False
+        self.ishydrology = False
+        self.isslr = False
+        self.iscoupler = False
+        self.amr_frequency = 0
+        self.isoceancoupling = False
+        self.requested_outputs = []
 
-		#set defaults
-		self.setdefaultparameters()
+    #set defaults
+        self.setdefaultparameters()
 
-		#}}}
-	def __repr__(self): # {{{
-		string='   transient solution parameters:'
-		string="%s\n%s"%(string,fielddisplay(self,'issmb','indicates if a surface mass balance solution is used in the transient'))
-		string="%s\n%s"%(string,fielddisplay(self,'ismasstransport','indicates if a masstransport solution is used in the transient'))
-		string="%s\n%s"%(string,fielddisplay(self,'isstressbalance','indicates if a stressbalance solution is used in the transient'))
-		string="%s\n%s"%(string,fielddisplay(self,'isthermal','indicates if a thermal solution is used in the transient'))
-		string="%s\n%s"%(string,fielddisplay(self,'isgroundingline','indicates if a groundingline migration is used in the transient'))
-		string="%s\n%s"%(string,fielddisplay(self,'isgia','indicates if a postglacial rebound is used in the transient'))
-		string="%s\n%s"%(string,fielddisplay(self,'isesa','indicates whether an elastic adjustment model is used in the transient'))
-		string="%s\n%s"%(string,fielddisplay(self,'isdamageevolution','indicates whether damage evolution is used in the transient'))
-		string="%s\n%s"%(string,fielddisplay(self,'ismovingfront','indicates whether a moving front capability is used in the transient'))
-		string="%s\n%s"%(string,fielddisplay(self,'ishydrology','indicates whether an hydrology model is used'))
-		string="%s\n%s"%(string,fielddisplay(self,'isslr','indicates if a sea level rise solution is used in the transient'))
-		string="%s\n%s"%(string,fielddisplay(self,'isoceancoupling','indicates whether coupling with an ocean model is used in the transient'))
-		string="%s\n%s"%(string,fielddisplay(self,'iscoupler','indicates whether different models are being run with need for coupling'))
-		string="%s\n%s"%(string,fielddisplay(self,'amr_frequency','frequency at which mesh is refined in simulations with multiple time_steps'))
-		string="%s\n%s"%(string,fielddisplay(self,'requested_outputs','list of additional outputs requested'))
-		return string
-		#}}}
-	def defaultoutputs(self,md): # {{{
+    #}}}
+    def __repr__(self):  # {{{
+        string = '   transient solution parameters:'
+        string = "%s\n%s" % (string, fielddisplay(self, 'issmb', 'indicates if a surface mass balance solution is used in the transient'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'ismasstransport', 'indicates if a masstransport solution is used in the transient'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isstressbalance', 'indicates if a stressbalance solution is used in the transient'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isthermal', 'indicates if a thermal solution is used in the transient'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isgroundingline', 'indicates if a groundingline migration is used in the transient'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isgia', 'indicates if a postglacial rebound is used in the transient'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isesa', 'indicates whether an elastic adjustment model is used in the transient'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isdamageevolution', 'indicates whether damage evolution is used in the transient'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'ismovingfront', 'indicates whether a moving front capability is used in the transient'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'ishydrology', 'indicates whether an hydrology model is used'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isslr', 'indicates if a sea level rise solution is used in the transient'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'isoceancoupling', 'indicates whether coupling with an ocean model is used in the transient'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'iscoupler', 'indicates whether different models are being run with need for coupling'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'amr_frequency', 'frequency at which mesh is refined in simulations with multiple time_steps'))
+        string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'list of additional outputs requested'))
+        return string
+    #}}}
 
-		if self.issmb:
-			return ['SmbMassBalance']
-		else:
-			return []
+    def defaultoutputs(self, md):  # {{{
 
-	#}}}
-	def setallnullparameters(self): # {{{
-		
-		#Nothing done
-		self.issmb   = False
-		self.ismasstransport   = False
-		self.isstressbalance   = False
-		self.isthermal         = False
-		self.isgroundingline   = False
-		self.isgia             = False
-		self.isesa             = False
-		self.isdamageevolution = False
-		self.ismovingfront     = False
-		self.ishydrology       = False
-		self.isoceancoupling   = False
-		self.isslr             = False
-		self.iscoupler         = False
-		self.amr_frequency	  = 0
+        if self.issmb:
+            return ['SmbMassBalance']
+        else:
+            return []
 
-		#default output
-		self.requested_outputs=[]
-		return self
-	#}}}
-	def deactivateall(self):#{{{
-		self.issmb             = False
-		self.ismasstransport   = False
-		self.isstressbalance   = False
-		self.isthermal         = False
-		self.isgroundingline   = False
-		self.isgia             = False
-		self.isesa             = False
-		self.isdamageevolution = False
-		self.ismovingfront     = False
-		self.ishydrology       = False
-		self.isslr             = False
-		self.isoceancoupling   = False
-		self.iscoupler         = False
-		self.amr_frequency     = 0
+    #}}}
 
-		#default output
-		self.requested_outputs=[]
-		return self
-	#}}}
-	def setdefaultparameters(self): # {{{
-		
-		#full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
-		self.issmb             = True
-		self.ismasstransport   = True
-		self.isstressbalance   = True
-		self.isthermal         = True
-		self.isgroundingline   = False
-		self.isgia             = False
-		self.isesa             = False
-		self.isdamageevolution = False
-		self.ismovingfront     = False
-		self.ishydrology       = False
-		self.isslr             = False
-		self.isoceancoupling   = False
-		self.iscoupler         = False
-		self.amr_frequency     = 0
+    def setallnullparameters(self):  # {{{
+        #Nothing done
+        self.issmb = False
+        self.ismasstransport = False
+        self.isstressbalance = False
+        self.isthermal = False
+        self.isgroundingline = False
+        self.isgia = False
+        self.isesa = False
+        self.isdamageevolution = False
+        self.ismovingfront = False
+        self.ishydrology = False
+        self.isoceancoupling = False
+        self.isslr = False
+        self.iscoupler = False
+        self.amr_frequency = 0
 
-		#default output
-		self.requested_outputs=['default']
-		return self
-	#}}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
+    #default output
+        self.requested_outputs = []
+        return self
+    #}}}
 
-		#Early return
-		if not solution=='TransientSolution':
-			return md
+    def deactivateall(self):  #{{{
+        self.issmb = False
+        self.ismasstransport = False
+        self.isstressbalance = False
+        self.isthermal = False
+        self.isgroundingline = False
+        self.isgia = False
+        self.isesa = False
+        self.isdamageevolution = False
+        self.ismovingfront = False
+        self.ishydrology = False
+        self.isslr = False
+        self.isoceancoupling = False
+        self.iscoupler = False
+        self.amr_frequency = 0
 
-		md = checkfield(md,'fieldname','transient.issmb','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','transient.ismasstransport','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','transient.isstressbalance','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','transient.isthermal','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','transient.isgroundingline','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','transient.isgia','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','transient.isesa','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','transient.isdamageevolution','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','transient.ishydrology','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','transient.ismovingfront','numel',[1],'values',[0,1]);
-		md = checkfield(md,'fieldname','transient.isslr','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','transient.isoceancoupling','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','transient.iscoupler','numel',[1],'values',[0,1])
-		md = checkfield(md,'fieldname','transient.amr_frequency','numel',[1],'>=',0,'NaN',1,'Inf',1)
-		md = checkfield(md,'fieldname','transient.requested_outputs','stringrow',1)
+    #default output
+        self.requested_outputs = []
+        return self
+    #}}}
 
-		if (solution!='TransientSolution') and (md.transient.iscoupling):
-				md.checkmessage("Coupling with ocean can only be done in transient simulations!")
+    def setdefaultparameters(self):  # {{{
+        #full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now
+        self.issmb = True
+        self.ismasstransport = True
+        self.isstressbalance = True
+        self.isthermal = True
+        self.isgroundingline = False
+        self.isgia = False
+        self.isesa = False
+        self.isdamageevolution = False
+        self.ismovingfront = False
+        self.ishydrology = False
+        self.isslr = False
+        self.isoceancoupling = False
+        self.iscoupler = False
+        self.amr_frequency = 0
 
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'object',self,'fieldname','issmb','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','ismasstransport','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','isstressbalance','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','isthermal','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','isgroundingline','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','isgia','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','isesa','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','isdamageevolution','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','ishydrology','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','ismovingfront','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','isslr','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','isoceancoupling','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','iscoupler','format','Boolean')
-		WriteData(fid,prefix,'object',self,'fieldname','amr_frequency','format','Integer')
+    #default output
+        self.requested_outputs = ['default']
+        return self
+    #}}}
 
-		#process requested outputs
-		outputs = self.requested_outputs
-		indices = [i for i, x in enumerate(outputs) if x == 'default']
-		if len(indices) > 0:
-			outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:]
-			outputs    =outputscopy
-		WriteData(fid,prefix,'data',outputs,'name','md.transient.requested_outputs','format','StringArray')
-	# }}}
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        #Early return
+        if not solution == 'TransientSolution':
+            return md
+
+        md = checkfield(md, 'fieldname', 'transient.issmb', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'transient.ismasstransport', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'transient.isstressbalance', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'transient.isthermal', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'transient.isgroundingline', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'transient.isgia', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'transient.isesa', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'transient.isdamageevolution', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'transient.ishydrology', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'transient.ismovingfront', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'transient.isslr', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'transient.isoceancoupling', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'transient.iscoupler', 'numel', [1], 'values', [0, 1])
+        md = checkfield(md, 'fieldname', 'transient.amr_frequency', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1)
+        md = checkfield(md, 'fieldname', 'transient.requested_outputs', 'stringrow', 1)
+
+        if (solution != 'TransientSolution') and (md.transient.iscoupling):
+            md.checkmessage("Coupling with ocean can only be done in transient simulations!")
+        if (md.transient.isdamageevolution and not hasattr(md.materials, 'matdamageice')):
+            md.checkmessage("requesting damage evolution but md.materials is not of class matdamageice")
+
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'issmb', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'ismasstransport', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isstressbalance', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isthermal', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isgroundingline', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isgia', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isesa', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isdamageevolution', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'ishydrology', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'ismovingfront', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isslr', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'isoceancoupling', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'iscoupler', 'format', 'Boolean')
+        WriteData(fid, prefix, 'object', self, 'fieldname', 'amr_frequency', 'format', 'Integer')
+
+    #process requested outputs
+        outputs = self.requested_outputs
+        indices = [i for i, x in enumerate(outputs) if x == 'default']
+        if len(indices) > 0:
+            outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:]
+            outputs = outputscopy
+        WriteData(fid, prefix, 'data', outputs, 'name', 'md.transient.requested_outputs', 'format', 'StringArray')
+    # }}}
Index: /issm/trunk/src/m/classes/verbose.py
===================================================================
--- /issm/trunk/src/m/classes/verbose.py	(revision 24312)
+++ /issm/trunk/src/m/classes/verbose.py	(revision 24313)
@@ -1,137 +1,140 @@
 from pairoptions import pairoptions
-import MatlabFuncs as m
 from WriteData import WriteData
 
+
 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
-	"""
+    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
+    """
 
-	def __init__(self,*args):    # {{{
-		#BEGINFIELDS
-		self.mprocessor  = False
-		self.module      = False
-		self.solution    = False
-		self.solver      = False
-		self.convergence = False
-		self.control     = False
-		self.qmu         = False
-		self.autodiff    = False
-		self.smb         = False
-		#ENDFIELDS
+    def __init__(self, *args):  # {{{
+        #BEGINFIELDS
+        self.mprocessor = False
+        self.module = False
+        self.solution = False
+        self.solver = False
+        self.convergence = False
+        self.control = False
+        self.qmu = False
+        self.autodiff = False
+        self.smb = False
+        #ENDFIELDS
 
-		if not len(args):
-			#Don't do anything
-			self.solution=True;
-			self.qmu=True;
-			self.control=True;
-			pass
+        if not len(args):
+            #Don't do anything
+            self.solution = True
+            self.qmu = True
+            self.control = True
+            pass
 
-		elif len(args) == 1:
-			binary=args[0]
-			if   isinstance(binary,(str,unicode)):
-				if binary.lower()=='all':
-					binary=2**11-1    #all ones
-					self.BinaryToVerbose(binary)
-					self.solver=False    #Do not use by default
-				else:
-					binary=int(binary,2)
-					self.BinaryToVerbose(binary)
-			elif isinstance(binary,(int,long,float)):
-				self.BinaryToVerbose(int(binary))
+        elif len(args) == 1:
+            binary = args[0]
+            if isinstance(binary, str):
+                if binary.lower() == 'all':
+                    binary = 2**11 - 1  #all ones
+                    self.BinaryToVerbose(binary)
+                    self.solver = False  #Do not use by default
+                else:
+                    binary = int(binary, 2)
+                    self.BinaryToVerbose(binary)
+            elif isinstance(binary, (int, float)):
+                self.BinaryToVerbose(int(binary))
 
-		else:
-			#Use options to initialize object
-			self=pairoptions(*args).AssignObjectFields(self)
+        else:
+            #Use options to initialize object
+            self = pairoptions(*args).AssignObjectFields(self)
 
-			#Cast to logicals
-			listproperties=vars(self)
-			for fieldname,fieldvalue in listproperties.iteritems():
-				if isinstance(fieldvalue,bool) or isinstance(fieldvalue,(int,long,float)):
-					setattr(self,fieldname,bool(fieldvalue))
-				else:
-					raise TypeError("verbose supported field values are logicals only (True or False)")
-	# }}}
-	def __repr__(self):    # {{{
-			
-		#BEGINDISP
-		s ="class '%s'  = \n" % type(self)
-		s+="   %15s : %s\n" % ('mprocessor',self.mprocessor)
-		s+="   %15s : %s\n" % ('module',self.module)
-		s+="   %15s : %s\n" % ('solution',self.solution)
-		s+="   %15s : %s\n" % ('solver',self.solver)
-		s+="   %15s : %s\n" % ('convergence',self.convergence)
-		s+="   %15s : %s\n" % ('control',self.control)
-		s+="   %15s : %s\n" % ('qmu',self.qmu)
-		s+="   %15s : %s\n" % ('autodiff',self.autodiff)
-		s+="   %15s : %s\n" % ('smb',self.smb)
-		#ENDDISP
+            #Cast to logicals
+            listproperties = vars(self)
+            for fieldname, fieldvalue in list(listproperties.items()):
+                if isinstance(fieldvalue, bool) or isinstance(fieldvalue, (int, float)):
+                    setattr(self, fieldname, bool(fieldvalue))
+                else:
+                    raise TypeError("verbose supported field values are logicals only (True or False)")
+    # }}}
 
-		return s
-	# }}}
-	def VerboseToBinary(self):    # {{{
+    def __repr__(self):  # {{{
 
-		#BEGINVERB2BIN
-		binary=0
-		if self.mprocessor:
-			binary=binary |  1
-		if self.module:
-			binary=binary |  2
-		if self.solution:
-			binary=binary |  4
-		if self.solver:
-			binary=binary |  8
-		if self.convergence:
-			binary=binary | 16
-		if self.control:
-			binary=binary | 32
-		if self.qmu:
-			binary=binary | 64
-		if self.autodiff:
-			binary=binary | 128
-		if self.smb:
-			binary=binary | 256
-		#ENDVERB2BIN
+        #BEGINDISP
+        s = "class '%s' = \n" % type(self)
+        s += "   %15s : %s\n" % ('mprocessor', self.mprocessor)
+        s += "   %15s : %s\n" % ('module', self.module)
+        s += "   %15s : %s\n" % ('solution', self.solution)
+        s += "   %15s : %s\n" % ('solver', self.solver)
+        s += "   %15s : %s\n" % ('convergence', self.convergence)
+        s += "   %15s : %s\n" % ('control', self.control)
+        s += "   %15s : %s\n" % ('qmu', self.qmu)
+        s += "   %15s : %s\n" % ('autodiff', self.autodiff)
+        s += "   %15s : %s\n" % ('smb', self.smb)
+        #ENDDISP
+        return s
+    # }}}
 
-		return binary
-	# }}}
-	def BinaryToVerbose(self,binary):    # {{{
+    def VerboseToBinary(self):  # {{{
+        #BEGINVERB2BIN
+        binary = 0
+        if self.mprocessor:
+            binary = binary | 1
+        if self.module:
+            binary = binary | 2
+        if self.solution:
+            binary = binary | 4
+        if self.solver:
+            binary = binary | 8
+        if self.convergence:
+            binary = binary | 16
+        if self.control:
+            binary = binary | 32
+        if self.qmu:
+            binary = binary | 64
+        if self.autodiff:
+            binary = binary | 128
+        if self.smb:
+            binary = binary | 256
+        #ENDVERB2BIN
 
-		#BEGINBIN2VERB
-		self.mprocessor =bool(binary &   1)
-		self.module     =bool(binary &   2)
-		self.solution   =bool(binary &   4)
-		self.solver     =bool(binary &   8)
-		self.convergence=bool(binary &  16)
-		self.control    =bool(binary &  32)
-		self.qmu        =bool(binary &  64)
-		self.autodiff   =bool(binary & 128)
-		self.smb        =bool(binary & 256)
-		#ENDBIN2VERB
-	# }}}
-	def checkconsistency(self,md,solution,analyses):    # {{{
-		return md
-	# }}}
-	def marshall(self,prefix,md,fid):    # {{{
-		WriteData(fid,prefix,'data',self.VerboseToBinary(),'name','md.verbose','format','Integer')
-	# }}}
+        return binary
+    # }}}
+
+    def BinaryToVerbose(self, binary):  # {{{
+
+        #BEGINBIN2VERB
+        self.mprocessor = bool(binary & 1)
+        self.module = bool(binary & 2)
+        self.solution = bool(binary & 4)
+        self.solver = bool(binary & 8)
+        self.convergence = bool(binary & 16)
+        self.control = bool(binary & 32)
+        self.qmu = bool(binary & 64)
+        self.autodiff = bool(binary & 128)
+        self.smb = bool(binary & 256)
+    #ENDBIN2VERB
+    # }}}
+
+    def checkconsistency(self, md, solution, analyses):  # {{{
+        return md
+    # }}}
+
+    def marshall(self, prefix, md, fid):  # {{{
+        WriteData(fid, prefix, 'data', self.VerboseToBinary(), 'name', 'md.verbose', 'format', 'Integer')
+    # }}}
Index: /issm/trunk/src/m/consistency/QueueRequirements.py
===================================================================
--- /issm/trunk/src/m/consistency/QueueRequirements.py	(revision 24312)
+++ /issm/trunk/src/m/consistency/QueueRequirements.py	(revision 24313)
@@ -1,20 +1,20 @@
-def QueueRequirements(queudict,queue,np,time):
-	#QUEUEREQUIREMENTS - queue requirements in time, number of cpus, by name of queue.
-	#
-	#   Usage: 
-	#      QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,np,time)
+def QueueRequirements(queudict, queue, np, time):
+    #QUEUEREQUIREMENTS - queue requirements in time, number of cpus, by name of queue.
+    #
+    #   Usage:
+    #      QueueRequirements(available_queues, queue_requirements_time, queue_requirements_np, np, time)
 
-	#Ok, go through requirements for current queue:
-	try:
-		rtime=queudict[queue][0]
-	except KeyError:
-		raise Exception('QueueRequirements error message: availables queues are '+ queuedict.keys)
-		
-	if time<=0:
-		raise Exception('QueueRequirements: time should be a positive number')
-	if time>rtime:
-		raise Exception('QueueRequirements: time should be < '+ str(rtime)+ ' for queue: '+ queue)
+    #Ok, go through requirements for current queue:
+    try:
+        rtime = queudict[queue][0]
+    except KeyError:
+        raise Exception('QueueRequirements error message: availables queues are ' + queudict.keys)
 
-	#check on np requirements
-	if np<=0:
-		raise Exception('QueueRequirements: np should be a positive number')
+    if time <= 0:
+        raise Exception('QueueRequirements: time should be a positive number')
+    if time > rtime:
+        raise Exception('QueueRequirements: time should be < ' + str(rtime) + ' for queue: ' + queue)
+
+    #check on np requirements
+    if np <= 0:
+        raise Exception('QueueRequirements: np should be a positive number')
Index: /issm/trunk/src/m/consistency/checkfield.m
===================================================================
--- /issm/trunk/src/m/consistency/checkfield.m	(revision 24312)
+++ /issm/trunk/src/m/consistency/checkfield.m	(revision 24313)
@@ -9,5 +9,5 @@
 %      - NaN: 1 if check that there is no NaN
 %      - Inf: 1 if check that there is no Inf
-%      - size: [lines cols], NaN for non checked dimensions
+%      - size: [lines cols], NaN for non checked dimensions, or 'universal' for any input type (nodal, element, time series, etc)
 %      - >:  greater than provided value
 %      - >=: greater or equal to provided value
@@ -48,18 +48,56 @@
 if exist(options,'size')
 	fieldsize=getfieldvalue(options,'size');
-	if isnan(fieldsize(1)),
-		if (size(field,2)~=fieldsize(2)),
-			md = checkmessage(md,getfieldvalue(options,'message',...
-				['field ''' fieldname ''' should have ' num2str(fieldsize(2)) ' columns']));
-		end
-	elseif isnan(fieldsize(2)),
-		if (size(field,1)~=fieldsize(1)),
-			md = checkmessage(md,getfieldvalue(options,'message',...
-				['field ''' fieldname ''' should have ' num2str(fieldsize(1)) ' lines']));
-		end
-	else
-		if ((size(field,1)~=fieldsize(1)) |  (size(field,2)~=fieldsize(2)))
-			md = checkmessage(md,getfieldvalue(options,'message',...
-				['field ''' fieldname ''' size should be ' num2str(fieldsize(1)) ' x ' num2str(fieldsize(2))]));
+	if ischar(fieldsize),
+		if strcmp(fieldsize,'universal'),
+
+			%Check that vector size will not be confusing for ModelProcessorx
+			if (md.mesh.numberofvertices==md.mesh.numberofelements),
+				error('number of vertices is the same as number of elements');
+			elseif (md.mesh.numberofvertices+1==md.mesh.numberofelements),
+				error('number of vertices +1 is the same as number of elements');
+			elseif (md.mesh.numberofvertices==md.mesh.numberofelements+1),
+				error('number of vertices is the same as number of elements +1');
+			end
+
+			%Uniform field
+			if (size(field,1)==1),
+				if (size(field,2)~=1),
+					md = checkmessage(md,getfieldvalue(options,'message',['field ''' fieldname ''' is not supported']));
+				end
+
+			%vertex oriented input, only one column allowed
+			elseif (size(field,1)==md.mesh.numberofvertices),
+				if (size(field,2)~=1),
+					md = checkmessage(md,getfieldvalue(options,'message',['field ''' fieldname ''' is not supported']));
+				end
+
+			%element oriented input, one or more column (patch) is ok 
+			elseif (size(field,1)==md.mesh.numberofelements),
+				%nothing to do here (either constant per element, or defined on nodes)
+
+			%vertex time series
+			elseif (size(field,1)==md.mesh.numberofvertices+1),
+				if (size(field,2)<=1),
+					md = checkmessage(md,getfieldvalue(options,'message',['field ''' fieldname ''' is not supported']));
+				end
+
+			%element time series
+			elseif (size(field,1)==md.mesh.numberofelements+1),
+				if (size(field,2)<=1),
+					md = checkmessage(md,getfieldvalue(options,'message',['field ''' fieldname ''' is not supported']));
+				end
+
+			%else not supported
+			else
+				md = checkmessage(md,getfieldvalue(options,'message',['field ''' fieldname ''' is not supported']));
+			end
+		else
+			error(['fieldsize ''' fieldsize ''' not supported yet']);
+		end
+	else
+		for i=1:numel(fieldsize)
+			if ~isnan(fieldsize(i)) & (size(field,i)~=fieldsize(i))
+				md = checkmessage(md,getfieldvalue(options,'message',['field ''' fieldname ''' dimension # ' num2str(i) ' should be of size ' num2str(fieldsize(i))]));
+			end
 		end
 	end
Index: /issm/trunk/src/m/consistency/checkfield.py
===================================================================
--- /issm/trunk/src/m/consistency/checkfield.py	(revision 24312)
+++ /issm/trunk/src/m/consistency/checkfield.py	(revision 24313)
@@ -1,250 +1,278 @@
 import numpy as np
 import os
+from re import findall, split
 from pairoptions import pairoptions
+from operator import attrgetter
 import MatlabFuncs as m
 
-def checkfield(md,*args):
-	"""
-	CHECKFIELD - check field consistency
-
-	   Used to check model consistency.,
-	   Requires:
-	   'field' or 'fieldname' option. If 'fieldname' is provided, it will retrieve it from the model md. (md.(fieldname))
+
+def checkfield(md, *args):
+    """
+    CHECKFIELD - check field consistency
+
+       Used to check model consistency.,
+       Requires:
+       'field' or 'fieldname' option. If 'fieldname' is provided, it will retrieve it from the model md. (md.(fieldname))
              If 'field' is provided, it will assume the argument following 'field' is a numeric array.
 
-	   Available options:
-	      - NaN: 1 if check that there is no NaN
-	      - size: [lines cols], NaN for non checked dimensions
-	      - >:  greater than provided value
-	      - >=: greater or equal to provided value
-	      - <:  smallerthan provided value
-	      - <=: smaller or equal to provided value
-	      - < vec:  smallerthan provided values on each vertex
-	      - timeseries: 1 if check time series consistency (size and time)
-	      - values: cell of strings or vector of acceptable values
-	      - numel: list of acceptable number of elements
-	      - cell: 1 if check that is cell
-	      - empty: 1 if check that non empty
-	      - message: overloaded error message
-
-	   Usage:
-	      md = checkfield(md,fieldname,options);
-	"""
-
-	#get options
-	options=pairoptions(*args)
-
-	#get field from model
-	if options.exist('field'):
-		field=options.getfieldvalue('field')
-		fieldname=options.getfieldvalue('fieldname','no fieldname')
-	else:
-		fieldname=options.getfieldvalue('fieldname')
-		exec("field=md.{}".format(fieldname))
-
-	if isinstance(field,(bool,int,long,float)):
-		field=np.array([field])
-
-	#check empty
-	if options.exist('empty'):
-		if not field:
-			md = md.checkmessage(options.getfieldvalue('message',\
-				"field '%s' is empty" % fieldname))
-
-	#Check size
-	if options.exist('size'):
-		fieldsize=options.getfieldvalue('size')
-		if len(fieldsize) == 1:
-			if np.isnan(fieldsize[0]):
-				pass
-			elif np.ndim(field)==1:
-				if not np.size(field)==fieldsize[0]:
-					md = md.checkmessage(options.getfieldvalue('message',"field {} size should be {}".format(fieldname,fieldsize[0])))
-			else:
-				try:
-					 exec("md.{}=field[:,0]".format(fieldname))
-					 print('{} had a bad dimension, we fixed it but you should check it'.format(fieldname))
-				except IndexError:
-					md = md.checkmessage(options.getfieldvalue('message',"field {} should have {} dimension".format(fieldname,len(fieldsize))))
-		elif len(fieldsize) == 2:
-			if   np.isnan(fieldsize[0]):
-				if not np.size(field,1)==fieldsize[1]:
-					md = md.checkmessage(options.getfieldvalue('message',"field '%s' should have %d columns" % (fieldname,fieldsize[1])))
-			elif np.isnan(fieldsize[1]):
-				if not np.size(field,0)==fieldsize[0]:
-					md = md.checkmessage(options.getfieldvalue('message',"field '%s' should have %d lines" % (fieldname,fieldsize[0])))
-			elif fieldsize[1]==1:
-				if (not np.size(field,0)==fieldsize[0]):
-					md = md.checkmessage(options.getfieldvalue('message',"field '%s' size should be %d x %d" % (fieldname,fieldsize[0],fieldsize[1])))
-			else:
-				if (not np.size(field,0)==fieldsize[0]) or (not np.size(field,1)==fieldsize[1]):
-					md = md.checkmessage(options.getfieldvalue('message',"field '%s' size should be %d x %d" % (fieldname,fieldsize[0],fieldsize[1])))
-
-	#Check numel
-	if options.exist('numel'):
-		fieldnumel=options.getfieldvalue('numel')
-		if (type(fieldnumel) == int and np.size(field) != fieldnumel) or (type(fieldnumel) == list and np.size(field) not in fieldnumel):
-			if   len(fieldnumel)==1:
-				md = md.checkmessage(options.getfieldvalue('message',\
-					"field '%s' size should be %d" % (fieldname,fieldnumel)))
-			elif len(fieldnumel)==2:
-				md = md.checkmessage(options.getfieldvalue('message',\
-					"field '%s' size should be %d or %d" % (fieldname,fieldnumel[0],fieldnumel[1])))
-			else:
-				md = md.checkmessage(options.getfieldvalue('message',\
-					"field '%s' size should be %s" % (fieldname,fieldnumel)))
-
-	#check NaN
-	if options.getfieldvalue('NaN',0):
-		if np.any(np.isnan(field)):
-			md = md.checkmessage(options.getfieldvalue('message',\
-				"NaN values found in field '%s'" % fieldname))
-
-
-	#check Inf
-	if options.getfieldvalue('Inf',0):
-		if np.any(np.isinf(field)):
-			md = md.checkmessage(options.getfieldvalue('message',\
-				"Inf values found in field '%s'" % fieldname))
-
-
-	#check cell
-	if options.getfieldvalue('cell',0):
-		if not isinstance(field,(tuple,list,dict)):
-			md = md.checkmessage(options.getfieldvalue('message',\
-				"field '%s' should be a cell" % fieldname))
-
-	#check values
-	if options.exist('values'):
-		fieldvalues=options.getfieldvalue('values')
-		if False in m.ismember(field,fieldvalues):
-			if   len(fieldvalues)==1:
-				md = md.checkmessage(options.getfieldvalue('message',\
-					"field '%s' value should be '%s'"  % (fieldname,fieldvalues[0])))
-			elif len(fieldvalues)==2:
-				md = md.checkmessage(options.getfieldvalue('message',\
-					"field '%s' values should be '%s' or '%s'"  % (fieldname,fieldvalues[0],fieldvalues[1])))
-			else:
-				md = md.checkmessage(options.getfieldvalue('message',\
-					"field '%s' should have values in %s" % (fieldname,fieldvalues)))
-
-	#check greater
-	if options.exist('>='):
-		lowerbound = options.getfieldvalue('>=')
-		if np.size(lowerbound)>1: #checking elementwise
-			if any(field<upperbound):
-				md = md.checkmessage(options.getfieldvalue('message',"field '%s' should have values below %d" % (fieldname,upperbound)))
-		else:
-			minval=np.nanmin(field)
-			if options.getfieldvalue('timeseries',0):
-				minval=np.nanmin(field[:-1])
-			elif options.getfieldvalue('singletimeseries',0):
-				if np.size(field)==1: #some singletimeseries are just one value
-					minval=field
-				else:
-					minval=np.nanmin(field[0])
-
-			if minval<lowerbound:
-				md = md.checkmessage(options.getfieldvalue('message',"field '%s' should have values above %d" % (fieldname,lowerbound)))
-
-	if options.exist('>'):
-		lowerbound=options.getfieldvalue('>')
-		if np.size(lowerbound)>1: #checking elementwise
-			if any(field<=upperbound):
-				md = md.checkmessage(options.getfieldvalue('message',"field '%s' should have values below %d" % (fieldname,upperbound)))
-		else:
-			minval=np.nanmin(field)
-			if options.getfieldvalue('timeseries',0) :
-				minval=np.nanmin(field[:-1])
-			elif options.getfieldvalue('singletimeseries',0):
-				if np.size(field)==1: #some singletimeseries are just one value
-					minval=field
-				else:
-					minval=np.nanmin(field[0])
-
-			if minval<=lowerbound:
-				md = md.checkmessage(options.getfieldvalue('message',"field '%s' should have values above %d" % (fieldname,lowerbound)))
-
-	#check smaller
-	if options.exist('<='):
-		upperbound=options.getfieldvalue('<=')
-		if np.size(upperbound)>1: #checking elementwise
-			if any(field>upperbound):
-				md = md.checkmessage(options.getfieldvalue('message',"field '%s' should have values below %d" % (fieldname,upperbound)))
-		else:
-			maxval=np.nanmax(field)
-			if options.getfieldvalue('timeseries',0):
-				maxval=np.nanmax(field[:-1])
-			elif  options.getfieldvalue('singletimeseries',0):
-				if np.size(field)==1: #some singletimeseries are just one value
-					maxval=field
-				else:
-					maxval=np.nanmax(field[0])
-			if maxval>upperbound:
-				md = md.checkmessage(options.getfieldvalue('message',"field '%s' should have values below %d" % (fieldname,upperbound)))
-
-	if options.exist('<'):
-		upperbound=options.getfieldvalue('<')
-		if np.size(upperbound)>1: #checking elementwise
-			if any(field>=upperbound):
-				md = md.checkmessage(options.getfieldvalue('message',"field '%s' should have values below %d" % (fieldname,upperbound)))
-
-		else:
-			maxval=np.nanmax(field)
-			if options.getfieldvalue('timeseries',0):
-				maxval=np.nanmax(field[:-1])
-			elif options.getfieldvalue('singletimeseries',0):
-				if np.size(field)==1: #some singletimeseries are just one value
-					maxval=field.copy()
-				else:
-					maxval=np.nanmax(field[0])
-
-				if maxval>=upperbound:
-					md = md.checkmessage(options.getfieldvalue('message',"field '%s' should have values below %d" % (fieldname,upperbound)))
-
-	#check file
-	if options.getfieldvalue('file',0):
-		if not os.path.exists(field):
-			md = md.checkmessage("file provided in '%s': '%s' does not exist" % (fieldname,field))
-
-	#Check row of strings
-	if options.exist('stringrow'):
-		if not isinstance(field,list):
-			md = md.checkmessage(options.getfieldvalue('message',\
-					"field '%s' should be a list" %fieldname))
-
-	#Check forcings (size and times)
-	if options.getfieldvalue('timeseries',0):
-		if np.size(field,0)==md.mesh.numberofvertices or np.size(field,0)==md.mesh.numberofelements:
-			if np.ndim(field)>1 and not np.size(field,1)==1:
-				md = md.checkmessage(options.getfieldvalue('message',\
-					"field '%s' should have only one column as there are md.mesh.numberofvertices lines" % fieldname))
-		elif np.size(field,0)==md.mesh.numberofvertices+1 or np.size(field,0)==md.mesh.numberofelements+1:
-			if np.ndim(field) > 1 and not all(field[-1,:]==np.sort(field[-1,:])):
-				md = md.checkmessage(options.getfieldvalue('message',\
-					"field '%s' columns should be sorted chronologically" % fieldname))
-			if np.ndim(field) > 1 and any(field[-1,0:-1]==field[-1,1:]):
-				md = md.checkmessage(options.getfieldvalue('message',\
-					"field '%s' columns must not contain duplicate timesteps" % fieldname))
-		else:
-			md = md.checkmessage(options.getfieldvalue('message',\
-				"field '%s' should have md.mesh.numberofvertices or md.mesh.numberofvertices+1 lines" % fieldname))
-
-	#Check single value forcings (size and times)
-	if options.getfieldvalue('singletimeseries',0):
-		if np.size(field,0)==2:
-			if not all(field[-1,:]==np.sort(field[-1,:])):
-				md = md.checkmessage(options.getfieldvalue('message',\
-						"field '%s' columns should be sorted chronologically" % fieldname))
-			if any(field[-1,0:-1]==field[-1,1:]):
-				md = md.checkmessage(options.getfieldvalue('message',\
-						"field '%s' columns must not contain duplicate timesteps" % fieldname))
-		elif np.size(field,0) == 1:
-			if np.ndim(field) > 1 and not np.size(field,1) == 1:
-				md = md.checkmessage(options.getfieldvalue('message',\
-				"field '%s' should be either a scalar or have 2 lines" % fieldname))
-		else:
-				md = md.checkmessage(options.getfieldvalue('message',\
-				"field '%s' should have 2 lines or be a scalar" % fieldname))
-
-	return md
+       Available options:
+ - NaN: 1 if check that there is no NaN
+ - size: [lines cols], NaN for non checked dimensions, or 'universal' for any input type (nodal, element, time series, etc)
+ -> :  greater than provided value
+ ->= : greater or equal to provided value
+ - < :  smallerthan provided value
+ - <=: smaller or equal to provided value
+ - < vec:  smallerthan provided values on each vertex
+ - timeseries: 1 if check time series consistency (size and time)
+ - values: cell of strings or vector of acceptable values
+ - numel: list of acceptable number of elements
+ - cell: 1 if check that is cell
+ - empty: 1 if check that non empty
+ - message: overloaded error message
+
+       Usage:
+          md = checkfield(md, fieldname, options)
+    """
+
+    #get options
+    options = pairoptions(*args)
+
+    #get field from model
+    if options.exist('field'):
+        field = options.getfieldvalue('field')
+        fieldname = options.getfieldvalue('fieldname', 'no fieldname')
+    else:
+        fieldname = options.getfieldvalue('fieldname')
+        fieldprefix = split(r'\[(.*?)\]', fieldname)[0]
+        fieldindexes = findall(r'\[(.*?)\]', fieldname)
+        field = attrgetter(fieldprefix)(md)
+        for index in fieldindexes:
+            try:
+                field = field[index.strip("\'")]
+            except TypeError:
+                field = field[int(index)]  #looking for an index and not a key
+
+    # that works for py2
+    #        exec("field = md.{}".format(fieldname))
+    #        exec("field = md.{}".format(fieldname), namespace)
+
+    if isinstance(field, (bool, int, float)):
+        field = np.array([field])
+
+    #check empty
+    if options.exist('empty'):
+        if not field:
+            md = md.checkmessage(options.getfieldvalue('message', "field '{}' is empty".format(fieldname)))
+
+    #Check size
+    if options.exist('size'):
+        fieldsize = options.getfieldvalue('size')
+        if type(fieldsize) == str:
+            if m.strcmp(fieldsize, 'universal'):
+
+                #Check that vector size will not be confusing for ModelProcessorx
+                if (md.mesh.numberofvertices == md.mesh.numberofelements):
+                    raise RuntimeError('number of vertices is the same as number of elements')
+                elif (md.mesh.numberofvertices + 1 == md.mesh.numberofelements):
+                    raise RuntimeError('number of vertices + 1 is the same as number of elements')
+                elif (md.mesh.numberofvertices == md.mesh.numberofelements + 1):
+                    raise RuntimeError('number of vertices is the same as number of elements + 1')
+
+                #Uniform field
+                if (np.size(field, 0) == 1):
+                    if (np.shape(field)[1] != 1):
+                        md = md.checkmessage(options.getfieldvalue('message', "field '{}' is not supported".format(fieldname)))
+
+                #vertex oriented input, only one column allowed
+                elif (np.shape(field)[0] == md.mesh.numberofvertices):
+                    if (np.shape(field)[1] != 1):
+                        md = md.checkmessage(options.getfieldvalue('message', "field '{}' is not supported".format(fieldname)))
+
+                #element oriented input, one or more column (patch) is ok
+                elif (np.shape(field)[0] == md.mesh.numberofelements):
+                    #nothing to do here (either constant per element, or defined on nodes)
+                    pass
+
+                #vertex time series
+                elif (np.shape(field)[0] == md.mesh.numberofvertices + 1):
+                    if (np.shape(field)[1] <= 1):
+                        md = md.checkmessage(options.getfieldvalue('message', "field '{}' is not supported".format(fieldname)))
+
+                #element time series
+                elif (np.shape(field)[0] == md.mesh.numberofelements + 1):
+                    if (np.shape(field)[1] <= 1):
+                        md = md.checkmessage(options.getfieldvalue('message', "field '{}' is not supported".format(fieldname)))
+
+                #else not supported
+                else:
+                    md = md.checkmessage(options.getfieldvalue('message', "field '{}' is not supported".format(fieldname)))
+
+            else:
+                raise RuntimeError("fieldsize '{}' not supported yet".format(fieldsize))
+
+        else:
+            if len(np.shape(field)) < len(fieldsize):
+                md = md.checkmessage(options.getfieldvalue('message', "field {} has size {} but should be size {}".format(fieldname, np.shape(field), fieldsize)))
+            else:
+                for i in range(np.size(fieldsize)):
+                    if (not np.isnan(fieldsize[i])) and (np.shape(field)[i] != fieldsize[i]):
+                        md = md.checkmessage(options.getfieldvalue('message', "field {} dimension  # {} should be of size {}".format(fieldname, i, fieldsize[i])))
+
+    #Check numel
+    if options.exist('numel'):
+        fieldnumel = options.getfieldvalue('numel')
+        if (type(fieldnumel) == int and np.size(field) != fieldnumel) or (type(fieldnumel) == list and np.size(field) not in fieldnumel):
+            if len(fieldnumel) == 1:
+                md = md.checkmessage(options.getfieldvalue('message', "field '{}' size should be {}".format(fieldname, fieldnumel)))
+            elif len(fieldnumel) == 2:
+                md = md.checkmessage(options.getfieldvalue('message', "field '{}' size should be {} or {}".format(fieldname, fieldnumel[0], fieldnumel[1])))
+            else:
+                md = md.checkmessage(options.getfieldvalue('message', "field '{}' size should be {}".format(fieldname, fieldnumel)))
+
+    #check NaN
+    if options.getfieldvalue('NaN', 0):
+        if np.any(np.isnan(field)):
+            md = md.checkmessage(options.getfieldvalue('message', "NaN values found in field '{}'".format(fieldname)))
+
+    #check Inf
+    if options.getfieldvalue('Inf', 0):
+        if np.any(np.isinf(field)):
+            md = md.checkmessage(options.getfieldvalue('message', "Inf values found in field '{}'".format(fieldname)))
+
+    #check cell
+    if options.getfieldvalue('cell', 0):
+        if not isinstance(field, (tuple, list, dict)):
+            md = md.checkmessage(options.getfieldvalue('message', "field '{}' should be a cell".format(fieldname)))
+
+    #check values
+    if options.exist('values'):
+        fieldvalues = options.getfieldvalue('values')
+        if False in m.ismember(field, fieldvalues):
+            if len(fieldvalues) == 1:
+                md = md.checkmessage(options.getfieldvalue('message', "field '{}' value should be '{}'".format(fieldname, fieldvalues[0])))
+            elif len(fieldvalues) == 2:
+                md = md.checkmessage(options.getfieldvalue('message', "field '{}' values should be '{}' or '%s'".format(fieldname, fieldvalues[0], fieldvalues[1])))
+            else:
+                md = md.checkmessage(options.getfieldvalue('message', "field '{}' should have values in {}".format(fieldname, fieldvalues)))
+
+    #check greater
+    if options.exist('>='):
+        lowerbound = options.getfieldvalue('>=')
+        if type(lowerbound) is str:
+            lowerbound = attrgetter(lowerbound)(md)
+        if np.size(lowerbound) > 1:  #checking elementwise
+            if any(field < lowerbound):
+                md = md.checkmessage(options.getfieldvalue('message', "field '%s' should have values above %d" % (fieldname, lowerbound)))
+        else:
+            minval = np.nanmin(field)
+            if options.getfieldvalue('timeseries', 0):
+                minval = np.nanmin(field[:-1])
+            elif options.getfieldvalue('singletimeseries', 0):
+                if np.size(field) == 1:  #some singletimeseries are just one value
+                    minval = field
+                else:
+                    minval = np.nanmin(field[0])
+
+            if minval < lowerbound:
+                md = md.checkmessage(options.getfieldvalue('message', "field '%s' should have values above %d" % (fieldname, lowerbound)))
+
+    if options.exist('>'):
+        lowerbound = options.getfieldvalue('>')
+        if type(lowerbound) is str:
+            lowerbound = attrgetter(lowerbound)(md)
+        if np.size(lowerbound) > 1:  #checking elementwise
+            if any(field <= lowerbound):
+                md = md.checkmessage(options.getfieldvalue('message', "field '%s' should have values above %d" % (fieldname, lowerbound)))
+        else:
+            minval = np.nanmin(field)
+            if options.getfieldvalue('timeseries', 0):
+                minval = np.nanmin(field[:-1])
+            elif options.getfieldvalue('singletimeseries', 0):
+                if np.size(field) == 1:  #some singletimeseries are just one value
+                    minval = field
+                else:
+                    minval = np.nanmin(field[0])
+
+            if minval <= lowerbound:
+                md = md.checkmessage(options.getfieldvalue('message', "field '%s' should have values above %d" % (fieldname, lowerbound)))
+
+    #check smaller
+    if options.exist('<='):
+        upperbound = options.getfieldvalue('<=')
+        if type(upperbound) is str:
+            upperbound = attrgetter(upperbound)(md)
+        if np.size(upperbound) > 1:  #checking elementwise
+            if any(field > upperbound):
+                md = md.checkmessage(options.getfieldvalue('message', "field '%s' should have values below %d" % (fieldname, upperbound)))
+        else:
+            maxval = np.nanmax(field)
+            if options.getfieldvalue('timeseries', 0):
+                maxval = np.nanmax(field[:-1])
+            elif options.getfieldvalue('singletimeseries', 0):
+                if np.size(field) == 1:  #some singletimeseries are just one value
+                    maxval = field
+                else:
+                    maxval = np.nanmax(field[0])
+            elif hasattr(field, 'fov_forward_indices'):
+                maxval = field.fov_forward_indices[0]
+            if maxval > upperbound:
+                md = md.checkmessage(options.getfieldvalue('message', "field '%s' should have values below %d" % (fieldname, upperbound)))
+
+    if options.exist('<'):
+        upperbound = options.getfieldvalue('<')
+        if type(upperbound) is str:
+            upperbound = attrgetter(upperbound)(md)
+        if np.size(upperbound) > 1:  #checking elementwise
+            if any(field >= upperbound):
+                md = md.checkmessage(options.getfieldvalue('message', "field '%s' should have values below %d" % (fieldname, upperbound)))
+
+        else:
+            maxval = np.nanmax(field)
+            if options.getfieldvalue('timeseries', 0):
+                maxval = np.nanmax(field[:-1])
+            elif options.getfieldvalue('singletimeseries', 0):
+                if np.size(field) == 1:  #some singletimeseries are just one value
+                    maxval = field.copy()
+                else:
+                    maxval = np.nanmax(field[0])
+
+                if maxval >= upperbound:
+                    md = md.checkmessage(options.getfieldvalue('message', "field '%s' should have values below %d" % (fieldname, upperbound)))
+
+    #check file
+    if options.getfieldvalue('file', 0):
+        if not os.path.exists(field):
+            md = md.checkmessage("file provided in '%s': '%s' does not exist" % (fieldname, field))
+
+    #Check row of strings
+    if options.exist('stringrow'):
+        if not isinstance(field, list):
+            md = md.checkmessage(options.getfieldvalue('message', "field '%s' should be a list" % fieldname))
+
+    #Check forcings (size and times)
+    if options.getfieldvalue('timeseries', 0):
+        if np.size(field, 0) == md.mesh.numberofvertices or np.size(field, 0) == md.mesh.numberofelements:
+            if np.ndim(field) > 1 and not np.size(field, 1) == 1:
+                md = md.checkmessage(options.getfieldvalue('message', "field '%s' should have only one column as there are md.mesh.numberofvertices lines" % fieldname))
+        elif np.size(field, 0) == md.mesh.numberofvertices + 1 or np.size(field, 0) == md.mesh.numberofelements + 1:
+            if np.ndim(field) > 1 and not all(field[-1, :] == np.sort(field[-1, :])):
+                md = md.checkmessage(options.getfieldvalue('message', "field '%s' columns should be sorted chronologically" % fieldname))
+            if np.ndim(field) > 1 and any(field[-1, 0:-1] == field[-1, 1:]):
+                md = md.checkmessage(options.getfieldvalue('message', "field '%s' columns must not contain duplicate timesteps" % fieldname))
+        else:
+            md = md.checkmessage(options.getfieldvalue('message', "field '%s' should have md.mesh.numberofvertices or md.mesh.numberofvertices + 1 lines" % fieldname))
+
+    #Check single value forcings (size and times)
+    if options.getfieldvalue('singletimeseries', 0):
+        if np.size(field, 0) == 2:
+            if not all(field[-1, :] == np.sort(field[-1, :])):
+                md = md.checkmessage(options.getfieldvalue('message', "field '%s' columns should be sorted chronologically" % fieldname))
+            if any(field[-1, 0:-1] == field[-1, 1:]):
+                md = md.checkmessage(options.getfieldvalue('message', "field '%s' columns must not contain duplicate timesteps" % fieldname))
+        elif np.size(field, 0) == 1:
+            if np.ndim(field) > 1 and not np.size(field, 1) == 1:
+                md = md.checkmessage(options.getfieldvalue('message', "field '%s' should be either a scalar or have 2 lines" % fieldname))
+        else:
+            md = md.checkmessage(options.getfieldvalue('message', "field '%s' should have 2 lines or be a scalar" % fieldname))
+
+    return md
Index: /issm/trunk/src/m/consistency/ismodelselfconsistent.js
===================================================================
--- /issm/trunk/src/m/consistency/ismodelselfconsistent.js	(revision 24312)
+++ /issm/trunk/src/m/consistency/ismodelselfconsistent.js	(revision 24313)
@@ -79,5 +79,5 @@
 		
 	}else if(solutiontype ==='TransientSolution'){
-		analyses=['StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis','MasstransportAnalysis','HydrologyShaktiAnalysis'];
+		analyses=['StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis','MasstransportAnalysis','HydrologyShaktiAnalysis','HydrologyGladsAnalysis'];
 		
 	}else if(solutiontype ==='SealevelriseSolution'){
Index: /issm/trunk/src/m/consistency/ismodelselfconsistent.m
===================================================================
--- /issm/trunk/src/m/consistency/ismodelselfconsistent.m	(revision 24312)
+++ /issm/trunk/src/m/consistency/ismodelselfconsistent.m	(revision 24313)
@@ -39,5 +39,5 @@
 
 function [analyses]=AnalysisConfiguration(solutiontype), % {{{
-%ANALYSISCONFIGURATION - return type of analyses, number of analyses 
+%ANALYSISCONFIGURATION - return type of analyses, number of analyses
 %
 %   Usage:
@@ -71,5 +71,5 @@
 		analyses={'EsaAnalysis'};
 	elseif strcmp(solutiontype,'TransientSolution')
-		analyses={'StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis','MasstransportAnalysis','HydrologyShaktiAnalysis'};
+		analyses={'StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis','MasstransportAnalysis','HydrologyShaktiAnalysis','HydrologyGladsAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis'};
 	elseif strcmp(solutiontype,'SealevelriseSolution')
 		analyses={'SealevelriseAnalysis'};
Index: /issm/trunk/src/m/consistency/ismodelselfconsistent.py
===================================================================
--- /issm/trunk/src/m/consistency/ismodelselfconsistent.py	(revision 24312)
+++ /issm/trunk/src/m/consistency/ismodelselfconsistent.py	(revision 24313)
@@ -1,88 +1,73 @@
-def AnalysisConfiguration(solutiontype): #{{{
-	"""
-	ANALYSISCONFIGURATION - return type of analyses, number of analyses 
+def AnalysisConfiguration(solutiontype):  #{{{
+    """
+    ANALYSISCONFIGURATION - return type of analyses, number of analyses
 
-		Usage:
-			[analyses]=AnalysisConfiguration(solutiontype);
-	"""
+            Usage:
+                    [analyses] = AnalysisConfiguration(solutiontype)
+    """
 
-	if   solutiontype == 'StressbalanceSolution':
-		analyses=['StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis']
+    if solutiontype == 'StressbalanceSolution':
+        analyses = ['StressbalanceAnalysis', 'StressbalanceVerticalAnalysis', 'StressbalanceSIAAnalysis', 'L2ProjectionBaseAnalysis']
+    elif solutiontype == 'SteadystateSolution':
+        analyses = ['StressbalanceAnalysis', 'StressbalanceVerticalAnalysis', 'StressbalanceSIAAnalysis', 'L2ProjectionBaseAnalysis', 'ThermalAnalysis', 'MeltingAnalysis', 'EnthalpyAnalysis']
+    elif solutiontype == 'ThermalSolution':
+        analyses = ['EnthalpyAnalysis', 'ThermalAnalysis', 'MeltingAnalysis']
+    elif solutiontype == 'MasstransportSolution':
+        analyses = ['MasstransportAnalysis']
+    elif solutiontype == 'BalancethicknessSolution':
+        analyses = ['BalancethicknessAnalysis']
+    elif solutiontype == 'SurfaceSlopeSolution':
+        analyses = ['L2ProjectionBaseAnalysis']
+    elif solutiontype == 'BalancevelocitySolution':
+        analyses = ['BalancevelocityAnalysis']
+    elif solutiontype == 'BedSlopeSolution':
+        analyses = ['L2ProjectionBaseAnalysis']
+    elif solutiontype == 'GiaSolution':
+        analyses = ['GiaIvinsAnalysis']
+    elif solutiontype == 'LoveSolution':
+        analyses = ['LoveAnalysis']
+    elif solutiontype == 'TransientSolution':
+        analyses = ['StressbalanceAnalysis', 'StressbalanceVerticalAnalysis', 'StressbalanceSIAAnalysis', 'L2ProjectionBaseAnalysis', 'ThermalAnalysis', 'MeltingAnalysis', 'EnthalpyAnalysis', 'MasstransportAnalysis', 'HydrologyShaktiAnalysis', 'HydrologyGladsAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis']
+    elif solutiontype == 'HydrologySolution':
+        analyses = ['L2ProjectionBaseAnalysis', 'HydrologyShreveAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis']
+    elif 'DamageEvolutionSolution':
+        analyses = ['DamageEvolutionAnalysis']
 
-	elif solutiontype == 'SteadystateSolution':
-		analyses=['StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis']
+    else:
+        raise TypeError("solution type: '%s' not supported yet!" % solutiontype)
+    return analyses
+    #}}}
 
-	elif solutiontype == 'ThermalSolution':
-		analyses=['EnthalpyAnalysis','ThermalAnalysis','MeltingAnalysis']
-
-	elif solutiontype == 'MasstransportSolution':
-		analyses=['MasstransportAnalysis']
-
-	elif solutiontype == 'BalancethicknessSolution':
-		analyses=['BalancethicknessAnalysis']
-
-	elif solutiontype == 'SurfaceSlopeSolution':
-		analyses=['L2ProjectionBaseAnalysis']
-
-	elif solutiontype == 'BalancevelocitySolution':
-		analyses=['BalancevelocityAnalysis']
-
-	elif solutiontype == 'BedSlopeSolution':
-		analyses=['L2ProjectionBaseAnalysis']
-
-	elif solutiontype == 'GiaSolution':
-		analyses=['GiaIvinsAnalysis']
-
-        elif solutiontype == 'LoveSolution':
-                analyses=['LoveAnalysis']
-
-	elif solutiontype == 'TransientSolution':
-		analyses=['StressbalanceAnalysis','StressbalanceVerticalAnalysis','StressbalanceSIAAnalysis','L2ProjectionBaseAnalysis','ThermalAnalysis','MeltingAnalysis','EnthalpyAnalysis','MasstransportAnalysis']
-
-	elif solutiontype == 'HydrologySolution':
-		analyses=['L2ProjectionBaseAnalysis','HydrologyShreveAnalysis','HydrologyDCInefficientAnalysis','HydrologyDCEfficientAnalysis']
-
-	elif 'DamageEvolutionSolution':
-		analyses=['DamageEvolutionAnalysis']
-
-	else:
-		raise TypeError("solution type: '%s' not supported yet!" % solutiontype)
-
-	return analyses
-#}}}
 
 def ismodelselfconsistent(md):
-	"""
-	ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
+    """
+    ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
 
-	   Usage:
-	      ismodelselfconsistent(md),
-	"""
+       Usage:
+          ismodelselfconsistent(md),
+    """
 
-	#initialize consistency as true
-	md.private.isconsistent=True
+    #initialize consistency as true
+    md.private.isconsistent = True
 
-	#Get solution and associated analyses
-	solution=md.private.solution
-	analyses=AnalysisConfiguration(solution)
+    #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
+    #fields = vars(md)
+    #for field in fields.iterkeys():
+    for field in md.properties():
+        #Some properties do not need to be checked
+        if field in ['results', 'debug', 'radaroverlay']:
+            continue
 
-	#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():
+        #Check that current field is an object
+        if not hasattr(getattr(md, field), 'checkconsistency'):
+            md.checkmessage("field '%s' is not an object." % field)
 
-		#Some properties do not need to be checked
-		if field in ['results','debug','radaroverlay']:
-			continue
+        #Check consistency of the object
+        exec("md.{}.checkconsistency(md, '{}', {})".format(field, solution, analyses))
 
-		#Check that current field is an object
-		if not hasattr(getattr(md,field),'checkconsistency'):
-			md.checkmessage("field '%s' is not an object." % field)
-
-		#Check consistency of the object
-		exec("md.{}.checkconsistency(md,solution,analyses)".format(field))
-
-	#error message if mode is not consistent
-	if not md.private.isconsistent:
-		raise RuntimeError('Model not consistent, see messages above.')
-
+    #error message if mode is not consistent
+    if not md.private.isconsistent:
+        raise RuntimeError('Model not consistent, see messages above.')
Index: sm/trunk/src/m/contrib/defleurian/netCDF/ClassTry.py
===================================================================
--- /issm/trunk/src/m/contrib/defleurian/netCDF/ClassTry.py	(revision 24312)
+++ 	(revision )
@@ -1,120 +1,0 @@
-#module imports {{{
-from netCDF4 import Dataset
-import time
-import collections
-from os import path, remove
-#}}}
-
-				
-class truc(object):
-	#properties
-	def __init__(self,*filename):#{{{
-
-		def netCDFread(filename):
-			def walktree(data):
-				keys = data.groups.keys()
-				yield keys
-				for key in keys:
-					for children in walktree(data.groups[str(key)]):
-						yield children
-
-			if path.exists(filename):
-				print ('Opening {} for reading '.format(filename))
-				NCData=Dataset(filename, 'r')
-				class_dict={}
-				
-				for children in walktree(NCData):
-					for child in children:
-						class_dict[str(child)]=str(getattr(NCData.groups[str(child)],'classtype'))
-
-				return class_dict
-
-		if filename:		
-			classtype=netCDFread(filename[0])
-		else:
-			classtype=self.default_prop()
-			
-		module=map(__import__,dict.values(classtype))
-
-		for i,mod in enumerate(dict.keys(classtype)):
-			self.__dict__[mod] = getattr(module[i],str(classtype[str(mod)]))()
-			
-		#}}}
-	def default_prop(self):    # {{{
-		# ordered list of properties since vars(self) is random
-		return {'mesh':'mesh2d',\
-		        'mask':'mask',\
-		        'geometry':'geometry',\
-		        'constants':'constants',\
-		        'smb':'SMB',\
-		        'basalforcings':'basalforcings',\
-		        'materials':'matice',\
-		        'damage':'damage',\
-		        'friction':'friction',\
-		        'flowequation':'flowequation',\
-		        'timestepping':'timestepping',\
-		        'initialization':'initialization',\
-		        'rifts':'rifts',\
-		        'debug':'debug',\
-		        'verbose':'verbose',\
-		        'settings':'settings',\
-		        'toolkits':'toolkits',\
-		        'cluster':'generic',\
-		        'balancethickness':'balancethickness',\
-		        'stressbalance':'stressbalance',\
-		        'groundingline':'groundingline',\
-		        'hydrology':'hydrologyshreve',\
-		        'masstransport':'masstransport',\
-		        'thermal':'thermal',\
-		        'steadystate':'steadystate',\
-		        'transient':'transient',\
-		        'calving':'calving',\
-				  'giaivins':'giaivins',\
-		        'autodiff':'autodiff',\
-		        'inversion':'inversion',\
-		        'qmu':'qmu',\
-		        'outputdefinition':'outputdefinition',\
-		        'results':'results',\
-		        'radaroverlay':'radaroverlay',\
-		        'miscellaneous':'miscellaneous',\
-		        'private':'private'}
-	# }}}
-		
-	def __repr__(obj): #{{{
-		#print "Here %s the number: %d" % ("is", 37)
-		string="%19s: %-22s -- %s" % ("mesh","[%s,%s]" % ("1x1",obj.mesh.__class__.__name__),"mesh properties")
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("mask","[%s,%s]" % ("1x1",obj.mask.__class__.__name__),"defines grounded and floating elements"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("geometry","[%s,%s]" % ("1x1",obj.geometry.__class__.__name__),"surface elevation, bedrock topography, ice thickness,..."))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("constants","[%s,%s]" % ("1x1",obj.constants.__class__.__name__),"physical constants"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("smb","[%s,%s]" % ("1x1",obj.smb.__class__.__name__),"surface forcings"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("basalforcings","[%s,%s]" % ("1x1",obj.basalforcings.__class__.__name__),"bed forcings"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("materials","[%s,%s]" % ("1x1",obj.materials.__class__.__name__),"material properties"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("damage","[%s,%s]" % ("1x1",obj.damage.__class__.__name__),"damage propagation laws"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("friction","[%s,%s]" % ("1x1",obj.friction.__class__.__name__),"basal friction/drag properties"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("flowequation","[%s,%s]" % ("1x1",obj.flowequation.__class__.__name__),"flow equations"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("timestepping","[%s,%s]" % ("1x1",obj.timestepping.__class__.__name__),"time stepping for transient models"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("initialization","[%s,%s]" % ("1x1",obj.initialization.__class__.__name__),"initial guess/state"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("rifts","[%s,%s]" % ("1x1",obj.rifts.__class__.__name__),"rifts properties"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("debug","[%s,%s]" % ("1x1",obj.debug.__class__.__name__),"debugging tools (valgrind, gprof)"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("verbose","[%s,%s]" % ("1x1",obj.verbose.__class__.__name__),"verbosity level in solve"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("settings","[%s,%s]" % ("1x1",obj.settings.__class__.__name__),"settings properties"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("toolkits","[%s,%s]" % ("1x1",obj.toolkits.__class__.__name__),"PETSc options for each solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("cluster","[%s,%s]" % ("1x1",obj.cluster.__class__.__name__),"cluster parameters (number of cpus...)"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("balancethickness","[%s,%s]" % ("1x1",obj.balancethickness.__class__.__name__),"parameters for balancethickness solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("stressbalance","[%s,%s]" % ("1x1",obj.stressbalance.__class__.__name__),"parameters for stressbalance solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("groundingline","[%s,%s]" % ("1x1",obj.groundingline.__class__.__name__),"parameters for groundingline solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("hydrology","[%s,%s]" % ("1x1",obj.hydrology.__class__.__name__),"parameters for hydrology solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("masstransport","[%s,%s]" % ("1x1",obj.masstransport.__class__.__name__),"parameters for masstransport solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("thermal","[%s,%s]" % ("1x1",obj.thermal.__class__.__name__),"parameters for thermal solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("steadystate","[%s,%s]" % ("1x1",obj.steadystate.__class__.__name__),"parameters for steadystate solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("transient","[%s,%s]" % ("1x1",obj.transient.__class__.__name__),"parameters for transient solution"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("calving","[%s,%s]" % ("1x1",obj.calving.__class__.__name__),"parameters for calving"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("autodiff","[%s,%s]" % ("1x1",obj.autodiff.__class__.__name__),"automatic differentiation parameters"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("inversion","[%s,%s]" % ("1x1",obj.inversion.__class__.__name__),"parameters for inverse methods"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("qmu","[%s,%s]" % ("1x1",obj.qmu.__class__.__name__),"dakota properties"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("outputdefinition","[%s,%s]" % ("1x1",obj.outputdefinition.__class__.__name__),"output definition"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("results","[%s,%s]" % ("1x1",obj.results.__class__.__name__),"model results"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("radaroverlay","[%s,%s]" % ("1x1",obj.radaroverlay.__class__.__name__),"radar image for plot overlay"))
-		string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("miscellaneous","[%s,%s]" % ("1x1",obj.miscellaneous.__class__.__name__),"miscellaneous fields"))
-		return string
-	# }}}
Index: /issm/trunk/src/m/contrib/defleurian/netCDF/export_netCDF.py
===================================================================
--- /issm/trunk/src/m/contrib/defleurian/netCDF/export_netCDF.py	(revision 24312)
+++ /issm/trunk/src/m/contrib/defleurian/netCDF/export_netCDF.py	(revision 24313)
@@ -1,207 +1,203 @@
-from netCDF4 import Dataset, stringtochar
+from netCDF4 import Dataset
 import numpy as np
 import time
 import collections
-from mesh2d import *
-from mesh3dprisms import *
-from results import *
 from os import path, remove
 
-def export_netCDF(md,filename):
-	#Now going on Real treatment
-	if path.exists(filename):
-		print ('File {} allready exist'.format(filename))
-		newname=raw_input('Give a new name or "delete" to replace: ')
-		if newname=='delete':
-			remove(filename)
-		else:
-			print ('New file name is {}'.format(newname))
-			filename=newname
-
-	NCData=Dataset(filename, 'w', format='NETCDF4')
-	NCData.description = 'Results for run' + md.miscellaneous.name
-	NCData.history = 'Created ' + time.ctime(time.time())
-
-	#define netCDF dimensions
-	try:
-		StepNum=np.shape(dict.values(md.results.__dict__))[1]
-	except IndexError:
-		StepNum=1
-	Dimension1=NCData.createDimension('DimNum1',StepNum)#time is first
-	DimDict={len(Dimension1):'DimNum1'}
-	dimindex=1
-
-	dimlist=[2,md.mesh.numberofelements,md.mesh.numberofvertices,np.shape(md.mesh.elements)[1]]
-	for i in range(0,4):
-		if dimlist[i] not in DimDict.keys():
-			dimindex+=1
-			NewDim=NCData.createDimension('DimNum'+str(dimindex),dimlist[i])
-			DimDict[len(NewDim)]='DimNum'+str(dimindex)
-
-	typelist=[bool,str,unicode,int,float,complex,
-						collections.OrderedDict,
-						np.int64,np.ndarray,np.float64]
-	groups=dict.keys(md.__dict__)
-	#get all model classes and create respective groups
-	for group in groups:
-		NCgroup=NCData.createGroup(str(group))
-		#In each group gather the fields of the class
-		fields=dict.keys(md.__dict__[group].__dict__)
-
-		#looping on fields
-		for field in fields:
-			#Special treatment for list fields
-			if type(md.__dict__[group].__dict__[field])==list:
-				StdList=False
-				if len(md.__dict__[group].__dict__[field])==0:
-					StdList=True
-				else:
-					StdList=type(md.__dict__[group].__dict__[field][0]) in typelist
-				NCgroup.__setattr__('classtype', md.__dict__[group].__class__.__name__)
-				if StdList: #this is a standard or empty list just proceed
-					Var=md.__dict__[group].__dict__[field]
-					DimDict=CreateVar(NCData,Var,field,NCgroup,DimDict)
-				else: #this is a list of fields, specific treatment needed
-					Listsize=len(md.__dict__[group].__dict__[field])
-					Subgroup=NCgroup.createGroup(str(field))
-					Subgroup.__setattr__('classtype',md.__dict__[group].__dict__[field].__class__.__name__)
-					for listindex in range(0,Listsize):
-						try:
-							Listgroup=Subgroup.createGroup(str(md.__dict__[group].__dict__[field].__getitem__(listindex).__dict__['name']))
-						except KeyError:
-							for naming in ['step']:
-								Listgroup=Subgroup.createGroup(str(md.__dict__[group].__dict__[field].__getitem__(listindex).__dict__[naming]))
-						except AttributeError:
-							Listgroup=Subgroup.createGroup(str(md.__dict__[group].__dict__[field].__class__.__name__)+str(listindex))
-						Listgroup.__setattr__('classtype',md.__dict__[group].__dict__[field].__getitem__(listindex).__class__.__name__)
-						try:
-							subfields=dict.keys(md.__dict__[group].__dict__[field].__getitem__(listindex).__dict__)
-						except AttributeError:
-							subfields=dict.keys(md.__dict__[group].__dict__[field].__getitem__(listindex))
-						for subfield in subfields:
-							if subfield!='outlog':
-								try:
-									Var=md.__dict__[group].__dict__[field].__getitem__(listindex).__dict__[subfield]
-								except AttributeError:
-									Var=md.__dict__[group].__dict__[field].__getitem__(listindex)[subfield]
-								DimDict=CreateVar(NCData,Var,subfield,Listgroup,DimDict,md.__dict__[group],field,listindex)
-
-			#No subgroup, we directly treat the variable
-			elif type(md.__dict__[group].__dict__[field]) in typelist or field=='bamg':
-				NCgroup.__setattr__('classtype', md.__dict__[group].__class__.__name__)
-				Var=md.__dict__[group].__dict__[field]
-				DimDict=CreateVar(NCData,Var,field,NCgroup,DimDict)
-			elif md.__dict__[group].__dict__[field] is None:
-				print( 'field md.{}.{} is None'.format(group,field))
-				#do nothing
-			else:
-				NCgroup.__setattr__('classtype', str(group))
-				Subgroup=NCgroup.createGroup(str(field))
-				Subgroup.__setattr__('classtype',md.__dict__[group].__class__.__name__)
-				subfields=dict.keys(md.__dict__[group].__dict__[field].__dict__)
-
-				for subfield in subfields:
-					if str(subfield)!='outlog':
-						Var=md.__dict__[group].__dict__[field].__dict__[subfield]
-						DimDict=CreateVar(NCData,Var,subfield,Subgroup,DimDict)
-
-	NCData.close()
-
-#============================================================================
-#Define the variables
-def CreateVar(NCData,var,field,Group,DimDict,*step_args):
-	#grab type
-	try:
-		val_type=str(var.dtype)
-	except AttributeError:
-		val_type=type(var)
-		#grab dimension
-	try:
-		val_shape=dict.keys(var)
-	except TypeError:
-		val_shape=np.shape(var)
-
-	TypeDict = {float:'f8',
-							'float64':'f8',
-							np.float64:'f8',
-							int:'i8',
-							'int64':'i8',
-							np.int64:'i8',
-							str:str,
-							dict:str}
-
-	val_dim=np.shape(val_shape)[0]
-
-	#Now define and fill up variable
-	#treating scalar string or bool as atribute
-	if val_type in [str,unicode,bool]:
-		Group.__setattr__(str(field).swapcase(), str(var))
-	#treating list as string table
-	elif val_type==list:
-		dimensions,DimDict=GetDim(NCData,var,val_shape,DimDict,val_dim)
-		#try to get the type from the first element
-		try:
-			nctype=TypeDict[type(var[0])]
-		except IndexError:
-			nctype=str #most probably an empty list take str for that
-		ncvar = Group.createVariable(str(field),nctype,dimensions,zlib=True)
-		if val_shape==0:
-			ncvar= []
-		else:
-			for elt in range(0,val_shape[0]):
-				ncvar[elt] = var[elt]
-	#treating bool tables as string tables
-	elif val_type=='bool':
-		dimensions,DimDict=GetDim(NCData,var,val_shape,DimDict,val_dim)
-		ncvar = Group.createVariable(str(field),str,dimensions,zlib=True)
-		for elt in range(0,val_shape[0]):
-			ncvar[elt] = str(var[elt])
-	#treating dictionaries as tables of strings
-	elif val_type==collections.OrderedDict or val_type==dict:
-		dimensions,DimDict=GetDim(NCData,var,val_shape,DimDict,val_dim)
-		ncvar = Group.createVariable(str(field),str,dimensions,zlib=True)
-		for elt in range(0,val_dim):
-			ncvar[elt,0]=dict.keys(var)[elt]
-			ncvar[elt,1]=str(dict.values(var)[elt]) #converting to str to avoid potential problems
-	#Now dealing with numeric variables
-	elif val_type in [float,'float64',np.float64,int,'int64']:
-		dimensions,DimDict=GetDim(NCData,var,val_shape,DimDict,val_dim)
-		ncvar = Group.createVariable(str(field),TypeDict[val_type],dimensions,zlib=True)
-		try:
-			nan_val=np.isnan(var)
-			if nan_val.all():
-				ncvar [:] = 'NaN'
-			else:
-				ncvar[:] = var
-		except TypeError: #type does not accept nan, get vallue of the variable
-			ncvar[:] = var
-	else:
-		print('WARNING type "{}" is unknown for "{}.{}"'.format(val_type,Group.name,field))
-	return DimDict
-
-#============================================================================
-#retriev the dimension tuple from a dictionnary
-def GetDim(NCData,var,shape,DimDict,i):
-	output=[]
-	#grab dimension
-	for dim in range(0,i): #loop on the dimensions
-		if type(shape[0])==int:
-			try:
-				output=output+[str(DimDict[shape[dim]])] #test if the dimension allready exist
-			except KeyError: #if not create it
-				if (shape[dim])>0:
-					index=len(DimDict)+1
-					NewDim=NCData.createDimension('DimNum'+str(index),(shape[dim]))
-					DimDict[len(NewDim)]='DimNum'+str(index)
-					output=output+[str(DimDict[shape[dim]])]
-		elif type(shape[0])==str or type(shape[0])==unicode:#dealling with a dictionnary
-			try:
-				#dimension5 is 2 to treat with dict
-				output=[str(DimDict[np.shape(shape)[0]])]+[DimDict[2]]
-			except KeyError:
-				index=len(DimDict)+1
-				NewDim=NCData.createDimension('DimNum'+str(index),np.shape(shape)[0])
-				DimDict[len(NewDim)]='DimNum'+str(index)
-				output=[str(DimDict[np.shape(dict.keys(var))[0]])]+[DimDict[2]]
-			break
-	return tuple(output), DimDict
+
+def export_netCDF(md, filename):
+    if path.exists(filename):
+        print('File {} allready exist'.format(filename))
+        newname = input('Give a new name or "delete" to replace: ')
+        if newname == 'delete':
+            remove(filename)
+        else:
+            print(('New file name is {}'.format(newname)))
+            filename = newname
+    NCData = Dataset(filename, 'w', format='NETCDF4')
+    NCData.description = 'Results for run' + md.miscellaneous.name
+    NCData.history = 'Created ' + time.ctime(time.time())
+    # define netCDF dimensions
+    try:
+        StepNum = np.shape(dict.values(md.results.__dict__))[1]
+    except IndexError:
+        StepNum = 1
+    Dimension1 = NCData.createDimension('DimNum1', StepNum)  # time is first
+    DimDict = {len(Dimension1): 'DimNum1'}
+    dimindex = 1
+    dimlist = [2, md.mesh.numberofelements, md.mesh.numberofvertices, np.shape(md.mesh.elements)[1]]
+    print('===Creating dimensions ===')
+    for i in range(0, 4):
+        if dimlist[i] not in list(DimDict.keys()):
+            dimindex += 1
+            NewDim = NCData.createDimension('DimNum' + str(dimindex), dimlist[i])
+            DimDict[len(NewDim)] = 'DimNum' + str(dimindex)
+    typelist = [bool, str, str, int, float, complex,
+                collections.OrderedDict,
+                np.int64, np.ndarray, np.float64]
+    groups = dict.keys(md.__dict__)
+    # get all model classes and create respective groups
+    print('===Creating and populating groups===')
+    for group in groups:
+        NCgroup = NCData.createGroup(str(group))
+    # In each group gather the fields of the class
+        fields = dict.keys(md.__dict__[group].__dict__)
+    # looping on fields
+        for field in fields:
+            # Special treatment for list fields
+            if type(md.__dict__[group].__dict__[field]) == list:
+                StdList = False
+                if len(md.__dict__[group].__dict__[field]) == 0:
+                    StdList = True
+                else:
+                    StdList = type(md.__dict__[group].__dict__[field][0]) in typelist
+                NCgroup.__setattr__('classtype', md.__dict__[group].__class__.__name__)
+                if StdList:  # this is a standard or empty list just proceed
+                    Var = md.__dict__[group].__dict__[field]
+                    DimDict = CreateVar(NCData, Var, field, NCgroup, DimDict)
+                else:  # this is a list of fields, specific treatment needed
+                    Listsize = len(md.__dict__[group].__dict__[field])
+                    Subgroup = NCgroup.createGroup(str(field))
+                    Subgroup.__setattr__('classtype', md.__dict__[group].__dict__[field].__class__.__name__)
+                    for listindex in range(0, Listsize):
+                        try:
+                            Listgroup = Subgroup.createGroup(str(md.__dict__[group].__dict__[field].__getitem__(listindex).__dict__['name']))
+                        except KeyError:
+                            for naming in ['step']:
+                                Listgroup = Subgroup.createGroup(str(md.__dict__[group].__dict__[field].__getitem__(listindex).__dict__[naming]))
+                        except AttributeError:
+                            Listgroup = Subgroup.createGroup(str(md.__dict__[group].__dict__[field].__class__.__name__) + str(listindex))
+                        Listgroup.__setattr__('classtype', md.__dict__[group].__dict__[field].__getitem__(listindex).__class__.__name__)
+                        try:
+                            subfields = dict.keys(md.__dict__[group].__dict__[field].__getitem__(listindex).__dict__)
+                        except AttributeError:
+                            subfields = dict.keys(md.__dict__[group].__dict__[field].__getitem__(listindex))
+                        for subfield in subfields:
+                            if subfield != 'outlog':
+                                try:
+                                    Var = md.__dict__[group].__dict__[field].__getitem__(listindex).__dict__[subfield]
+                                except AttributeError:
+                                    Var = md.__dict__[group].__dict__[field].__getitem__(listindex)[subfield]
+                                DimDict = CreateVar(NCData, Var, subfield, Listgroup, DimDict, md.__dict__[group], field, listindex)
+    # No subgroup, we directly treat the variable
+            elif type(md.__dict__[group].__dict__[field]) in typelist or field == 'bamg':
+                NCgroup.__setattr__('classtype', md.__dict__[group].__class__.__name__)
+                Var = md.__dict__[group].__dict__[field]
+                DimDict = CreateVar(NCData, Var, field, NCgroup, DimDict)
+            elif md.__dict__[group].__dict__[field] is None:
+                print('field md.{}.{} is None'.format(group, field))
+    # do nothing
+    # if it is a masked array
+            elif type(md.__dict__[group].__dict__[field]) is np.ma.core.MaskedArray:
+                NCgroup.__setattr__('classtype', md.__dict__[group].__class__.__name__)
+                Var = md.__dict__[group].__dict__[field].data
+                DimDict = CreateVar(NCData, Var, field, NCgroup, DimDict)
+            else:
+                NCgroup.__setattr__('classtype', str(group))
+                Subgroup = NCgroup.createGroup(str(field))
+                Subgroup.__setattr__('classtype', md.__dict__[group].__class__.__name__)
+                subfields = dict.keys(md.__dict__[group].__dict__[field].__dict__)
+                for subfield in subfields:
+                    if str(subfield) != 'outlog':
+                        Var = md.__dict__[group].__dict__[field].__dict__[subfield]
+                        DimDict = CreateVar(NCData, Var, subfield, Subgroup, DimDict)
+    NCData.close()
+
+    #============================================================================
+    # Define the variables
+
+
+def CreateVar(NCData, var, field, Group, DimDict, * step_args):
+    # grab type
+    try:
+        val_type = str(var.dtype)
+    except AttributeError:
+        val_type = type(var)
+    # grab dimension
+    if val_type in [collections.OrderedDict, dict]:
+        val_shape = len(var)
+        val_dim = 2
+    else:
+        val_shape = np.shape(var)
+        val_dim = np.shape(val_shape)[0]
+    TypeDict = {float: 'f8',
+                'float64': 'f8',
+                np.float64: 'f8',
+                int: 'i8',
+                'int64': 'i8',
+                np.int64: 'i8',
+                str: str,
+                dict: str}
+    # Now define and fill up variable
+    # treating scalar string or bool as atribute
+    if val_type in [str, bool]:
+        Group.__setattr__(str(field).swapcase(), str(var))
+    # treating list as string table
+    elif val_type == list:
+        dimensions, DimDict = GetDim(NCData, val_shape, val_type, DimDict, val_dim)
+    # try to get the type from the first element
+        try:
+            nctype = TypeDict[type(var[0])]
+        except IndexError:
+            nctype = str  # most probably an empty list take str for that
+            ncvar = Group.createVariable(str(field), nctype, dimensions, zlib=True)
+            if val_shape == 0:
+                ncvar = []
+            else:
+                for elt in range(0, val_shape[0]):
+                    ncvar[elt] = var[elt]
+    # treating bool tables as string tables
+    elif val_type == 'bool':
+        dimensions, DimDict = GetDim(NCData, val_shape, val_type, DimDict, val_dim)
+        ncvar = Group.createVariable(str(field), str, dimensions, zlib=True)
+        for elt in range(0, val_shape[0]):
+            ncvar[elt] = str(var[elt])
+    # treating dictionaries as tables of strings
+    elif val_type in [collections.OrderedDict, dict]:
+        dimensions, DimDict = GetDim(NCData, val_shape, val_type, DimDict, val_dim)
+        ncvar = Group.createVariable(str(field), str, dimensions, zlib=True)
+        for elt, key in enumerate(dict.keys(var)):
+            ncvar[elt, 0] = key
+            ncvar[elt, 1] = str(var[key])  # converting to str to avoid potential problems
+    # Now dealing with numeric variables
+    elif val_type in [float, 'float64', np.float64, int, 'int64']:
+        dimensions, DimDict = GetDim(NCData, val_shape, val_type, DimDict, val_dim)
+        ncvar = Group.createVariable(str(field), TypeDict[val_type], dimensions, zlib=True)
+        try:
+            nan_val = np.isnan(var)
+            if nan_val.all():
+                ncvar[:] = 'NaN'
+            else:
+                ncvar[:] = var
+        except TypeError:  # type does not accept nan, get vallue of the variable
+            ncvar[:] = var
+    else:
+        print(('WARNING type "{}" is unknown for "{}.{}"'.format(val_type, Group.name, field)))
+    return DimDict
+# ============================================================================
+    # retriev the dimension tuple from a dictionnary
+
+
+def GetDim(NCData, val_shape, val_type, DimDict, val_dim):
+    output = []
+    if val_type in [collections.OrderedDict, dict]:  # dealling with a dictionnary
+        try:
+            output = [str(DimDict[val_shape])]  # first try to get the coresponding dimension if ti exists
+            output = output + [DimDict[2]]  # dimension5 is 2 to treat with dict
+        except KeyError:
+            index = len(DimDict) + 1  # if the dimension does not exist, increment naming
+            NewDim = NCData.createDimension('DimNum' + str(index), val_shape)  # create dimension
+            DimDict[len(NewDim)] = 'DimNum' + str(index)  # and update the dimension dictionary
+            output = [str(DimDict[val_shape])] + [DimDict[2]]  # now proceed with the shape of the value
+    else:
+        # loop on dimensions
+        for dim in range(0, val_dim):  # loop on the dimensions
+            try:
+                output = output + [str(DimDict[val_shape[dim]])]  # test if the dimension allready exist
+            except KeyError:  # if not create it
+                if (val_shape[dim]) > 0:
+                    index = len(DimDict) + 1
+                    NewDim = NCData.createDimension('DimNum' + str(index), (val_shape[dim]))
+                    DimDict[len(NewDim)] = 'DimNum' + str(index)
+                    output = output + [str(DimDict[val_shape[dim]])]
+    return tuple(output), DimDict
Index: /issm/trunk/src/m/contrib/defleurian/netCDF/read_netCDF.py
===================================================================
--- /issm/trunk/src/m/contrib/defleurian/netCDF/read_netCDF.py	(revision 24312)
+++ /issm/trunk/src/m/contrib/defleurian/netCDF/read_netCDF.py	(revision 24313)
@@ -1,25 +1,22 @@
 from netCDF4 import Dataset
-import time
-import collections
-from os import path, remove
+from os import path
+
 
 def netCDFRead(filename):
-	
-	def walktree(data):
-		keys = data.groups.keys()
-		yield keys
-		for key in keys:
-			for children in walktree(data.groups[str(key)]):
-				yield children
-				
-	if path.exists(filename):
-		print ('Opening {} for reading '.format(filename))
-		NCData=Dataset(filename, 'r')
-		class_dict={}
-		
-		for children in walktree(NCData):
-			for child in children:
-				class_dict[str(child)]=str(getattr(NCData.groups[str(child)],'classtype')+'()')
+    def walktree(data):
+        keys = list(data.groups.keys())
+        yield keys
+        for key in keys:
+            for children in walktree(data.groups[str(key)]):
+                yield children
 
-		print class_dict
-				
+    if path.exists(filename):
+        print(('Opening {} for reading '.format(filename)))
+        NCData = Dataset(filename, 'r')
+        class_dict = {}
+
+        for children in walktree(NCData):
+            for child in children:
+                class_dict[str(child)] = str(getattr(NCData.groups[str(child)], 'classtype') + '()')
+
+        print(class_dict)
Index: /issm/trunk/src/m/contrib/defleurian/paraview/enveloppeVTK.py
===================================================================
--- /issm/trunk/src/m/contrib/defleurian/paraview/enveloppeVTK.py	(revision 24312)
+++ /issm/trunk/src/m/contrib/defleurian/paraview/enveloppeVTK.py	(revision 24313)
@@ -1,170 +1,171 @@
 import numpy as np
 import os
-import model
 import glob
-def enveloppeVTK(filename,model,*args):
-	'''
-	vtk export
-	function exportVTK(filename,model)
-	creates a directory with the vtk files for displays in paraview
-	(only work for triangle and wedges based on their number of nodes)
 
-	Give only the results for nw but could be extended to geometry, mask...
 
-	input: filename   destination
-	(string)
-	------------------------------------------------------------------
-model      this is md
-	------------------------------------------------------------------
-	By default only the results are exported, you can add whichever
-	field you need as a string:
-	add 'geometry' to export md.geometry
+def enveloppeVTK(filename, model, *args):
+    '''
+    vtk export
+    function exportVTK(filename, model)
+    creates a directory with the vtk files for displays in paraview
+    (only work for triangle and wedges based on their number of nodes)
 
-	Basile de Fleurian:
-	'''
-	Dir=os.path.basename(filename)
-	Path=filename[:-len(Dir)]
+    Give only the results for nw but could be extended to geometry, mask...
 
-	if os.path.exists(filename):
-		print ('File {} allready exist'.format(filename))
-		newname=raw_input('Give a new name or "delete" to replace: ')
-		if newname=='delete':
-			filelist = glob.glob(filename+'/*')
-			for oldfile in filelist:
-				os.remove(oldfile)
-		else:
-			print ('New file name is {}'.format(newname))
-			filename=newname
-			os.mkdir(filename)
-	else:
-		os.mkdir(filename)
+    input: filename   destination
+    (string)
+     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    model      this is md
+     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    By default only the results are exported, you can add whichever
+    field you need as a string:
+    add 'geometry' to export md.geometry
 
-	# {{{get the element related variables
-	if 'z' in dict.keys(model.mesh.__dict__):
-		is_enveloppe=np.logical_or(model.mesh.vertexonbase,model.mesh.vertexonsurface)
-		enveloppe_index=np.where(is_enveloppe)[0]
-		convert_index=np.nan*np.ones(np.shape(model.mesh.x))
-		convert_index=np.asarray([[i,np.where(enveloppe_index==i)[0][0]] for i,val in enumerate(convert_index) if any(enveloppe_index==i)])
-		points=np.column_stack((model.mesh.x[enveloppe_index],
-														model.mesh.y[enveloppe_index],
-														model.mesh.z[enveloppe_index]))
-		low_elt_num=np.size(np.where(np.isnan(model.mesh.lowerelements)))
-		top_elt_num=np.size(np.where(np.isnan(model.mesh.upperelements)))
-		num_of_elt=low_elt_num+top_elt_num
-		connect=model.mesh.elements[np.where(is_enveloppe[model.mesh.elements-1])].reshape(int(num_of_elt),3)-1
-		for elt in range(0, num_of_elt):
-			connect[elt,0]=convert_index[np.where(convert_index==connect[elt,0])[0],1][0]
-			connect[elt,1]=convert_index[np.where(convert_index==connect[elt,1])[0],1][0]
-			connect[elt,2]=convert_index[np.where(convert_index==connect[elt,2])[0],1][0]
+    Basile de Fleurian:
+    '''
+    Dir = os.path.basename(filename)
+    Path = filename[: - len(Dir)]
 
-	else:
-		points=np.column_stack((model.mesh.x,
-														model.mesh.y,
-														np.zeros(np.shape(model.mesh.x))))
-		num_of_elt=np.shape(model.mesh.elements)[0]
-		connect=model.mesh.elements-1
-		enveloppe_index=np.arange(0,np.size(model.mesh.x))
+    if os.path.exists(filename):
+        print(('File {} allready exist'.format(filename)))
+        newname = input('Give a new name or "delete" to replace: ')
+        if newname == 'delete':
+            filelist = glob.glob(filename + '/* ')
+            for oldfile in filelist:
+                os.remove(oldfile)
+        else:
+            print(('New file name is {}'.format(newname)))
+            filename = newname
+            os.mkdir(filename)
+    else:
+        os.mkdir(filename)
 
-	every_nodes=np.size(model.mesh.x)
-	num_of_points=np.size(enveloppe_index)
-	dim=3
-	point_per_elt=3
-	celltype=5 #triangles
+    # {{{get the element related variables
+    if 'z' in dict.keys(model.mesh.__dict__):
+        is_enveloppe = np.logical_or(model.mesh.vertexonbase, model.mesh.vertexonsurface)
+        enveloppe_index = np.where(is_enveloppe)[0]
+        convert_index = np.nan * np.ones(np.shape(model.mesh.x))
+        convert_index = np.asarray([[i, np.where(enveloppe_index == i)[0][0]] for i, val in enumerate(convert_index) if any(enveloppe_index == i)])
+        points = np.column_stack((model.mesh.x[enveloppe_index],
+                                  model.mesh.y[enveloppe_index],
+                                  model.mesh.z[enveloppe_index]))
+        low_elt_num = np.size(np.where(np.isnan(model.mesh.lowerelements)))
+        top_elt_num = np.size(np.where(np.isnan(model.mesh.upperelements)))
+        num_of_elt = low_elt_num + top_elt_num
+        connect = model.mesh.elements[np.where(is_enveloppe[model.mesh.elements - 1])].reshape(int(num_of_elt), 3) - 1
+        for elt in range(0, num_of_elt):
+            connect[elt, 0] = convert_index[np.where(convert_index == connect[elt, 0])[0], 1][0]
+            connect[elt, 1] = convert_index[np.where(convert_index == connect[elt, 1])[0], 1][0]
+            connect[elt, 2] = convert_index[np.where(convert_index == connect[elt, 2])[0], 1][0]
 
-	# }}}
-	# {{{this is the result structure
-	res_struct=model.results
-	if (len(res_struct.__dict__)>0):
-		#Getting all the solutions of the model
-		solnames=(dict.keys(res_struct.__dict__))
-		num_of_sols=len(solnames)
-		num_of_timesteps=1
-		#%building solutionstructure
-		for solution in solnames:
-			#looking for multiple time steps
-			if (np.size(res_struct.__dict__[solution])>num_of_timesteps):
-				num_of_timesteps=np.size(res_struct.__dict__[solution])
-				num_of_timesteps=int(num_of_timesteps)
-	else:
-		num_of_timesteps=1
-	# }}}
-	# {{{write header and mesh
-	for step in range(0,num_of_timesteps):
-		timestep=step
-		fid=open((filename +'/Timestep.vtk'+str(timestep)+'.vtk'),'w+')
-		fid.write('# vtk DataFile Version 2.0 \n')
-		fid.write('Data for run %s \n' % model.miscellaneous.name)
-		fid.write('ASCII \n')
-		fid.write('DATASET UNSTRUCTURED_GRID \n')
-		fid.write('POINTS %d float\n' % num_of_points)
-		for point in points:
-			fid.write('%f %f %f \n'%(point[0], point[1], point[2]))
+    else:
+        points = np.column_stack((model.mesh.x,
+                                  model.mesh.y,
+                                  np.zeros(np.shape(model.mesh.x))))
+        num_of_elt = np.shape(model.mesh.elements)[0]
+        connect = model.mesh.elements - 1
+        enveloppe_index = np.arange(0, np.size(model.mesh.x))
 
-		fid.write('CELLS %d %d\n' %(num_of_elt, num_of_elt*(point_per_elt+1)))
+    every_nodes = np.size(model.mesh.x)
+    num_of_points = np.size(enveloppe_index)
+    dim = 3
+    point_per_elt = 3
+    celltype = 5  #triangles
 
-		for elt in range(0, num_of_elt):
-			fid.write('3 %d %d %d\n' %(connect[elt,0],
-																 connect[elt,1],
-																 connect[elt,2]))
+    # }}}
+    # {{{this is the result structure
+    res_struct = model.results
+    if (len(res_struct.__dict__) > 0):
+        #Getting all the solutions of the model
+        solnames = (dict.keys(res_struct.__dict__))
+        num_of_sols = len(solnames)
+        num_of_timesteps = 1
+        #%building solutionstructure
+        for solution in solnames:
+            #looking for multiple time steps
+            if (np.size(res_struct.__dict__[solution]) > num_of_timesteps):
+                num_of_timesteps = np.size(res_struct.__dict__[solution])
+                num_of_timesteps = int(num_of_timesteps)
+    else:
+        num_of_timesteps = 1
+    # }}}
+    # {{{write header and mesh
+    for step in range(0, num_of_timesteps):
+        timestep = step
+        fid = open((filename + '/Timestep.vtk' + str(timestep) + '.vtk'), 'w + ')
+        fid.write('  # vtk DataFile Version 2.0 \n')
+        fid.write('Data for run %s \n' % model.miscellaneous.name)
+        fid.write('ASCII \n')
+        fid.write('DATASET UNSTRUCTURED_GRID \n')
+        fid.write('POINTS %d float\n' % num_of_points)
+        for point in points:
+            fid.write('%f %f %f \n' % (point[0], point[1], point[2]))
 
-		fid.write('CELL_TYPES %d\n' %num_of_elt)
-		for elt in range(0, num_of_elt):
-			fid.write('%d\n' %celltype)
+        fid.write('CELLS %d %d\n' % (num_of_elt, num_of_elt * (point_per_elt + 1)))
 
-		fid.write('POINT_DATA %s \n' %str(num_of_points))
-		# }}}
-		# {{{loop over the different solution structures
-		if 'solnames' in locals():
-			for sol in solnames:
-				#dealing with results on different timesteps
-				if(np.size(res_struct.__dict__[sol])>timestep):
-					timestep = step
-				else:
-					timestep = np.size(res_struct.__dict__[sol])
+        for elt in range(0, num_of_elt):
+            fid.write('3 %d %d %d\n' % (connect[elt, 0],
+                                        connect[elt, 1],
+                                        connect[elt, 2]))
 
-				#getting the  fields in the solution
-				if(np.size(res_struct.__dict__[sol])>1):
-					fieldnames=dict.keys(res_struct.__dict__[sol].__getitem__(timestep).__dict__)
-				else:
-					fieldnames=dict.keys(res_struct.__dict__[sol].__dict__)
-				#check which field is a real result and print
-				for field in fieldnames:
-					if(np.size(res_struct.__dict__[sol])>1):
-						fieldstruct=res_struct.__dict__[sol].__getitem__(timestep).__dict__[field]
-					else:
-						fieldstruct=res_struct.__dict__[sol].__dict__[field]
+        fid.write('CELL_TYPES %d\n' % num_of_elt)
+        for elt in range(0, num_of_elt):
+            fid.write('%d\n' % celltype)
 
-					if ((np.size(fieldstruct))==every_nodes):
-						fid.write('SCALARS %s float 1 \n' % field)
-						fid.write('LOOKUP_TABLE default\n')
-						for node in range(0,num_of_points):
-							#paraview does not like NaN, replacing
-							if np.isnan(fieldstruct[enveloppe_index[node]]):
-								fid.write('%e\n' % -9999.9999)
-							#also checking for verry small value that mess up
-							elif (abs(fieldstruct[enveloppe_index[node]])<1.0e-20):
-								fid.write('%e\n' % 0.0)
-							else:
-								fid.write('%e\n' % fieldstruct[enveloppe_index[node]])
-		# }}}
-		# {{{loop on arguments, if something other than result is asked, do it now
+        fid.write('POINT_DATA %s \n' % str(num_of_points))
+    # }}}
+    # {{{loop over the different solution structures
+        if 'solnames' in locals():
+            for sol in solnames:
+                #dealing with results on different timesteps
+                if(np.size(res_struct.__dict__[sol]) > timestep):
+                    timestep = step
+                else:
+                    timestep = np.size(res_struct.__dict__[sol])
 
-		for other in args:
-			other_struct=model.__dict__[other]
-			othernames=(dict.keys(other_struct.__dict__))
-			for field in othernames:
-				if ((np.size(other_struct.__dict__[field]))==every_nodes):
-					fid.write('SCALARS %s float 1 \n' % field)
-					fid.write('LOOKUP_TABLE default\n')
-					for node in range(0,num_of_points):
-						#paraview does not like NaN, replacing
-						if np.isnan(other_struct.__dict__[field][enveloppe_index[node]]):
-							fid.write('%e\n' % -9999.9999)
-						#also checking for verry small value that mess up
-						elif (abs(other_struct.__dict__[field][enveloppe_index[node]])<1.0e-20):
-							fid.write('%e\n' % 0.0)
-						else:
-							fid.write('%e\n' % other_struct.__dict__[field][enveloppe_index[node]])
+    #getting the  fields in the solution
+                if(type(res_struct.__dict__[sol]) == list):
+                    fieldnames = dict.keys(res_struct.__dict__[sol].__getitem__(timestep).__dict__)
+                else:
+                    fieldnames = dict.keys(res_struct.__dict__[sol].__dict__)
+    #check which field is a real result and print
+                for field in fieldnames:
+                    if(type(res_struct.__dict__[sol]) == list):
+                        fieldstruct = res_struct.__dict__[sol].__getitem__(timestep).__dict__[field]
+                    else:
+                        fieldstruct = res_struct.__dict__[sol].__dict__[field]
 
-			# }}}
-	fid.close();
+                    if ((np.size(fieldstruct)) == every_nodes):
+                        fid.write('SCALARS %s float 1 \n' % field)
+                        fid.write('LOOKUP_TABLE default\n')
+                        for node in range(0, num_of_points):
+                            #paraview does not like NaN, replacing
+                            if np.isnan(fieldstruct[enveloppe_index[node]]):
+                                fid.write('%e\n' % - 9999.9999)
+                                #also checking for verry small value that mess up
+                            elif (abs(fieldstruct[enveloppe_index[node]]) < 1.0e-20):
+                                fid.write('%e\n' % 0.0)
+                            else:
+                                fid.write('%e\n' % fieldstruct[enveloppe_index[node]])
+    # }}}
+    # {{{loop on arguments, if something other than result is asked, do it now
+
+        for other in args:
+            other_struct = model.__dict__[other]
+            othernames = (dict.keys(other_struct.__dict__))
+            for field in othernames:
+                if ((np.size(other_struct.__dict__[field])) == every_nodes):
+                    fid.write('SCALARS %s float 1 \n' % field)
+                    fid.write('LOOKUP_TABLE default\n')
+                    for node in range(0, num_of_points):
+                        #paraview does not like NaN, replacing
+                        if np.isnan(other_struct.__dict__[field][enveloppe_index[node]]):
+                            fid.write('%e\n' % - 9999.9999)
+                            #also checking for verry small value that mess up
+                        elif (abs(other_struct.__dict__[field][enveloppe_index[node]]) < 1.0e-20):
+                            fid.write('%e\n' % 0.0)
+                        else:
+                            fid.write('%e\n' % other_struct.__dict__[field][enveloppe_index[node]])
+
+    # }}}
+    fid.close()
Index: /issm/trunk/src/m/contrib/defleurian/paraview/exportVTK.py
===================================================================
--- /issm/trunk/src/m/contrib/defleurian/paraview/exportVTK.py	(revision 24312)
+++ /issm/trunk/src/m/contrib/defleurian/paraview/exportVTK.py	(revision 24313)
@@ -1,204 +1,425 @@
 import numpy as np
-import os
-import model
-import glob
-def exportVTK(filename,model,*args):
-	'''
-	vtk export
-	function exportVTK(filename,model)
-	creates a directory with the vtk files for displays in paraview
-	(only work for triangle and wedges based on their number of nodes)
-
-	Give only the results for nw but could be extended to geometry, mask...
-
-	input: filename   destination
-	(string)
-	------------------------------------------------------------------
-model      this is md
-	------------------------------------------------------------------
-	By default only the results are exported, you can add whichever
-	field you need as a string:
-	add 'geometry' to export md.geometry
-
-	Basile de Fleurian:
-	'''
-	Dir=os.path.basename(filename)
-	Path=filename[:-len(Dir)]
-
-	if os.path.exists(filename):
-		print ('File {} allready exist'.format(filename))
-		newname=raw_input('Give a new name or "delete" to replace: ')
-		if newname=='delete':
-			filelist = glob.glob(filename+'/*')
-			for oldfile in filelist:
-				os.remove(oldfile)
-		else:
-			print ('New file name is {}'.format(newname))
-			filename=newname
-			os.mkdir(filename)
-	else:
-		os.mkdir(filename)
-
-	# {{{ get the element related variables
-	if 'z' in dict.keys(model.mesh.__dict__):
-		points=np.column_stack((model.mesh.x,model.mesh.y,model.mesh.z))
-		dim=3
-	else:
-		points=np.column_stack((model.mesh.x,model.mesh.y,np.zeros(np.shape(model.mesh.x))))
-		dim=2
-
-	num_of_points=np.size(model.mesh.x)
-	num_of_elt=np.shape(model.mesh.elements)[0]
-	point_per_elt=np.shape(model.mesh.elements)[1]
-	# }}}
-	# {{{ Select the type of element function of the number of nodes per elements
-	if point_per_elt==3:
-		celltype=5 #triangles
-	elif point_per_elt==6:
-		celltype=13 #wedges
-	else:
-		error('Your Element definition is not taken into account \n')
-	# }}}
-	# {{{ this is the result structure
-	res_struct=model.results
-	if (len(res_struct.__dict__)>0):
-		#Getting all the solutions of the model
-		solnames=(dict.keys(res_struct.__dict__))
-		num_of_sols=len(solnames)
-		num_of_timesteps=1
-		#%building solutionstructure
-		for solution in solnames:
-			#looking for multiple time steps
-			if (np.size(res_struct.__dict__[solution])>num_of_timesteps):
-				num_of_timesteps=np.size(res_struct.__dict__[solution])
-				num_of_timesteps=int(num_of_timesteps)
-	else:
-		num_of_timesteps=1
-	# }}}
-	# {{{ write header and mesh
-	for step in range(0,num_of_timesteps):
-		timestep=step
-		fid=open((filename +'/Timestep.vtk'+str(timestep)+'.vtk'),'w+')
-		fid.write('# vtk DataFile Version 2.0 \n')
-		fid.write('Data for run %s \n' % model.miscellaneous.name)
-		fid.write('ASCII \n')
-		fid.write('DATASET UNSTRUCTURED_GRID \n')
-		fid.write('POINTS %d float\n' % num_of_points)
-		if(dim==3):
-			for point in points:
-				fid.write('%f %f %f \n'%(point[0], point[1], point[2]))
-		elif(dim==2):
-			for point in points:
-				fid.write('%f %f %f \n'%(point[0], point[1], point[2]))
-
-		fid.write('CELLS %d %d\n' %(num_of_elt, num_of_elt*(point_per_elt+1)))
-
-		if point_per_elt==3:
-			for elt in range(0, num_of_elt):
-				fid.write('3 %d %d %d\n' %(model.mesh.elements[elt,0]-1,model.mesh.elements[elt,1]-1,model.mesh.elements[elt,2]-1))
-		elif point_per_elt==6:
-			for elt in range(0, num_of_elt):
-				fid.write('6 %d %d %d %d %d %d\n' %(model.mesh.elements[elt,0]-1,model.mesh.elements[elt,1]-1,model.mesh.elements[elt,2]-1,model.mesh.elements[elt,3]-1,model.mesh.elements[elt,4]-1,model.mesh.elements[elt,5]-1))
-		else:
-			print 'Number of nodes per element not supported'
-
-		fid.write('CELL_TYPES %d\n' %num_of_elt)
-		for elt in range(0, num_of_elt):
-			fid.write('%d\n' %celltype)
-
-		fid.write('POINT_DATA %s \n' %str(num_of_points))
-		# }}}
-		# {{{ loop over the different solution structures
-		if 'solnames' in locals():
-			for sol in solnames:
-				#dealing with results on different timesteps
-				if(np.size(res_struct.__dict__[sol])>timestep):
-					timestep = step
-				else:
-					timestep = np.size(res_struct.__dict__[sol])
-
-				#getting the  fields in the solution
-				if(np.size(res_struct.__dict__[sol])>1):
-					fieldnames=dict.keys(res_struct.__dict__[sol].__getitem__(timestep).__dict__)
-				else:
-					fieldnames=dict.keys(res_struct.__dict__[sol].__dict__)
-				#check which field is a real result and print
-				for field in fieldnames:
-					if(np.size(res_struct.__dict__[sol])>1):
-						fieldstruct=res_struct.__dict__[sol].__getitem__(timestep).__dict__[field]
-					else:
-						fieldstruct=res_struct.__dict__[sol].__dict__[field]
-
-					if ((np.size(fieldstruct))==num_of_points):
-						fid.write('SCALARS %s float 1 \n' % field)
-						fid.write('LOOKUP_TABLE default\n')
-						for node in range(0,num_of_points):
-							#paraview does not like NaN, replacing
-							if np.isnan(fieldstruct[node]):
-								fid.write('%e\n' % -9999.9999)
-							#also checking for verry small value that mess up
-							elif (abs(fieldstruct[node])<1.0e-20):
-								fid.write('%e\n' % 0.0)
-							else:
-								fid.write('%e\n' % fieldstruct[node])
-		# }}}
-		# {{{ loop on arguments, if something other than result is asked, do it now
-		for other in args:
-			other_struct=model.__dict__[other]
-			othernames=(dict.keys(other_struct.__dict__))
-			for field in othernames:
-				if np.ndim(other_struct.__dict__[field])==1:
-					if np.size(other_struct.__dict__[field])==num_of_points:
-						fid.write('SCALARS %s float 1 \n' % field)
-						fid.write('LOOKUP_TABLE default\n')
-						for node in range(0,num_of_points):
-							#paraview does not like NaN, replacing
-							if np.isnan(other_struct.__dict__[field][node]):
-								fid.write('%e\n' % -9999.9999)
-							#also checking for verry small value that mess up
-							elif (abs(other_struct.__dict__[field][node])<1.0e-20):
-								fid.write('%e\n' % 0.0)
-							else:
-								fid.write('%e\n' % other_struct.__dict__[field][node])
-				elif np.ndim(other_struct.__dict__[field])==2:
-					#deal with forcings
-					if np.shape(other_struct.__dict__[field])[0]==num_of_points+1:
-						current_time=res_struct.__dict__[sol].__getitem__(timestep).__dict__['time']/model.__dict__['constants'].__dict__['yts']
-						times=other_struct.__dict__[field][-1,:]
-						if np.any(times==current_time):
-							time_loc=np.where(times==current_time)
-							current_force=other_struct.__dict__[field][:-1,time_loc]
-						else:
-							precede_time_loc=np.where(times<current_time)[0][-1]
-							follow_time_loc=np.where(times>current_time)[0][0]
-							time_scaling=(current_time-times[precede_time_loc])/(times[follow_time_loc]-times[precede_time_loc])
-							current_force=other_struct.__dict__[field][:-1,precede_time_loc]+(other_struct.__dict__[field][:-1,follow_time_loc]-other_struct.__dict__[field][:-1,precede_time_loc])*time_scaling
-						fid.write('SCALARS %s float 1 \n' % field)
-						fid.write('LOOKUP_TABLE default\n')
-						for node in range(0,num_of_points):
-							#paraview does not like NaN, replacing
-							if np.isnan(current_force[node]):
-								fid.write('%e\n' % -9999.9999)
-							#also checking for verry small value that mess up
-							elif (abs(current_force[node])<1.0e-20):
-								fid.write('%e\n' % 0.0)
-							else:
-								fid.write('%e\n' % current_force[node])
-					# reloaded variable are generally of dim 2
-					elif np.shape(other_struct.__dict__[field])[0]==num_of_points:
-						# we want only vector
-						if np.shape(other_struct.__dict__[field])[1]==1:
-							fid.write('SCALARS %s float 1 \n' % field)
-							fid.write('LOOKUP_TABLE default\n')
-							for node in range(0,num_of_points):
-								#paraview does not like NaN, replacing
-								print other_struct.__dict__[field][node]
-								if np.isnan(other_struct.__dict__[field][node]):
-									fid.write('%e\n' % -9999.9999)
-									#also checking for verry small value that mess up
-								elif (abs(other_struct.__dict__[field][node])<1.0e-20):
-									fid.write('%e\n' % 0.0)
-								else:
-									fid.write('%e\n' % other_struct.__dict__[field][node])
-		# }}}
-	fid.close();
+from os import path, remove, mkdir
+from glob import glob
+
+
+def exportVTK(filename, md, *args, enveloppe=False, **kwargs):
+    '''
+    vtk export
+    function exportVTK(filename, md)
+    creates a directory with the vtk files for displays in paraview
+    (only work for triangle and wedges based on their number of nodes)
+
+    Usage:
+    exportVTK('DirName', md)
+    exportVTK('DirName', md, 'geometry', 'mesh')
+    exportVTK('DirName', md, 'geometry', 'mesh', enveloppe = True)
+
+    DirName is the name of the output directory, each timestep then has it
+    own file ('Timestep.vtkX.vtk') with X the number of the output step
+    enveloppe is an option keeping only the enveloppe of the md (it is False by default)
+
+    Options:
+        - clipping : allows to reduce your domain (cliping=[Xmin, Xmax, Ymin, Ymax])
+        - coarsetime : output one timestep every X (coarsetime=X, with X an integer)
+        - singletime : output only timestep X (singletime=X, with X an integer or -1 for last)
+
+    TODO: - make time easily accessible
+
+    Basile de Fleurian:
+    '''
+
+    for key in kwargs.keys():
+        if key not in ['clipping', 'coarsetime', 'singletime']:
+            raise BadOption('Provided option "{}" is not supported possibilities are : {}'.format(key, ['cliping', 'coarsetime']))
+
+    if 'coarsetime' in kwargs.keys() and 'singletime' in kwargs.keys():
+        raise BadOption("You can't specify both 'coarsetime' and 'singletime'")
+
+    # File checking and creation {{{
+    Dir = path.basename(filename)
+    Path = filename[:-len(Dir)]
+    if path.exists(filename):
+        print(('File {} allready exist'.format(filename)))
+        newname = input('Give a new name or "delete" to replace: ')
+        if newname == 'delete':
+            filelist = glob(filename + '/* ')
+            for oldfile in filelist:
+                remove(oldfile)
+        else:
+            print(('New file name is {}'.format(newname)))
+            filename = newname
+            mkdir(filename)
+    else:
+        mkdir(filename)
+    # }}}
+
+    # this is the result structure {{{
+    print('Getting accessorie variables')
+    res_struct = md.results
+    moving_mesh = False
+    if(type(res_struct) != list):
+        #Getting all the solutions of the md
+        solnames = dict.keys(res_struct.__dict__)
+        num_of_sols = len(solnames)
+        num_of_timesteps = 1
+        #%building solutionstructure
+        for solution in solnames:
+            #looking for multiple time steps
+            if (np.size(res_struct.__dict__[solution]) > num_of_timesteps):
+                num_of_timesteps = np.size(res_struct.__dict__[solution])
+                num_of_timesteps = int(num_of_timesteps)
+                if 'Surface' in dict.keys(res_struct.__dict__[solution][0].__dict__):
+                    moving_mesh = True
+    else:
+        num_of_timesteps = 1
+    # }}}
+
+    # get the element related variables {{{
+    print('Now treating  the mesh')
+    #first get the general things
+    dim = int(md.mesh.domaintype()[0])
+    every_nodes = md.mesh.numberofvertices
+    every_cells = md.mesh.numberofelements
+
+    if np.shape(md.mesh.elements)[1] == 3 or enveloppe:
+        point_per_elt = 3
+        celltype = 5  #triangles
+    elif np.shape(md.mesh.elements)[1] == 6:
+        point_per_elt = 6
+        celltype = 13  #wedges
+    else:
+        raise BadDimension('exportVTK does not support your element type')
+
+    if enveloppe:
+        if dim == 3:
+            is_enveloppe = np.logical_or(md.mesh.vertexonbase, md.mesh.vertexonsurface)
+            enveloppe_index = np.where(is_enveloppe)[0]
+            convert_index = np.nan * np.ones(np.shape(md.mesh.x))
+            convert_index = np.asarray([[i, np.where(enveloppe_index == i)[0][0]] for i, val in enumerate(convert_index) if any(enveloppe_index == i)])
+            points = np.column_stack((md.mesh.x[enveloppe_index],
+                                      md.mesh.y[enveloppe_index],
+                                      md.mesh.z[enveloppe_index]))
+
+            num_of_elt = np.size(np.where(np.isnan(md.mesh.lowerelements))) + np.size(np.where(np.isnan(md.mesh.upperelements)))
+            connect = md.mesh.elements[np.where(is_enveloppe[md.mesh.elements - 1])].reshape(int(num_of_elt), 3) - 1
+            for elt in range(0, num_of_elt):
+                connect[elt, 0] = convert_index[np.where(convert_index == connect[elt, 0])[0], 1][0]
+                connect[elt, 1] = convert_index[np.where(convert_index == connect[elt, 1])[0], 1][0]
+                connect[elt, 2] = convert_index[np.where(convert_index == connect[elt, 2])[0], 1][0]
+
+            num_of_points = np.size(enveloppe_index)
+        else:
+            raise BadDimension("exportVTK can't get an enveloppe for  dimension {}".format(dim))
+
+    else:
+        #we get all the mesh, mainly defining dummies
+        num_of_elt = every_cells
+        connect = md.mesh.elements - 1
+        enveloppe_index = np.arange(0, np.size(md.mesh.x))
+        num_of_points = every_nodes
+        if dim == 2:
+            mesh_alti = input('''This is a 2D model, what should be the 3rd dimension of the mesh :
+                                        1 : md.geometry.surface
+                                        2 : md.geometry.base
+                                        3 : md.geometry.bed
+                                        4 : 0\n''')
+            if mesh_alti == '1':
+                points = np.column_stack((md.mesh.x, md.mesh.y, md.geometry.surface))
+            elif mesh_alti == '2':
+                points = np.column_stack((md.mesh.x, md.mesh.y, md.geometry.base))
+            elif mesh_alti == '3':
+                points = np.column_stack((md.mesh.x, md.mesh.y, md.geometry.bed))
+            elif mesh_alti == '4':
+                points = np.column_stack((md.mesh.x, md.mesh.y, 0. * md.mesh.x))
+            else:
+                points = np.column_stack((md.mesh.x, md.mesh.y, md.geometry.surface))
+        elif dim == 3:
+            mesh_alti = '1'
+            points = np.column_stack((md.mesh.x, md.mesh.y, md.mesh.z))
+        else:
+            raise BadDimension('exportVTK does not support dimension {}'.format(dim))
+
+    if 'clipping' in kwargs.keys():
+        # first get the boundaries and check them
+        [Xmin, Xmax, Ymin, Ymax] = kwargs['clipping']
+        if Xmin > Xmax:
+            raise ClipError('Xmax ({}) should be larger than Xmin ({})'.format(Xmax, Xmin))
+        if Ymin > Ymax:
+            raise ClipError('Ymax ({}) should be larger than Ymin ({})'.format(Ymax, Ymin))
+        if Xmin > np.nanmax(points[:, 0]) or Xmax < np.nanmin(points[:, 0]):
+            raise ClipError('Your X boundaries [{}, {}] are outside of the model domain [{},{}]'.format(Xmin, Xmax, np.nanmin(points[:, 0]), np.nanmax(points[:, 0])))
+        if Ymin > np.nanmax(points[:, 1]) or Ymax < np.nanmin(points[:, 1]):
+            raise ClipError('Your Y boundaries [{}, {}] are outside of the model domain [{},{}]'.format(Ymin, Ymax, np.nanmin(points[:, 1]), np.nanmax(points[:, 1])))
+
+        #boundaries should be fine lets do stuff
+        InX = np.where(np.logical_and(points[:, 0] >= Xmin, points[:, 0] <= Xmax))
+        InY = np.where(np.logical_and(points[:, 1] >= Ymin, points[:, 1] <= Ymax))
+
+        Isinside = np.zeros(np.shape(points)[0], dtype=bool)
+        clip_convert_index = np.nan * np.ones(np.shape(points)[0])
+
+        Inclipping = np.intersect1d(InX, InY)
+        Isinside[Inclipping] = True
+        points = points[Inclipping, :]
+        num_of_points = np.shape(points)[0]
+
+        clipconnect = np.asarray([], dtype=int)
+        for elt in connect:
+            if set(elt).issubset(Inclipping):
+                clipconnect = np.append(clipconnect, elt, axis=0)
+
+        num_of_elt = int(np.size(clipconnect) / 3)
+        connect = clipconnect.reshape(num_of_elt, 3)
+
+        clip_convert_index = np.asarray([[i, np.where(Inclipping == i)[0][0]] for i, val in enumerate(clip_convert_index) if any(Inclipping == i)])
+        enveloppe_index = enveloppe_index[clip_convert_index[:, 0]]
+        for elt in range(0, num_of_elt):
+            try:
+                connect[elt, 0] = clip_convert_index[np.where(clip_convert_index == connect[elt, 0])[0], 1][0]
+            except IndexError:
+                connect[elt, 0] = -1
+            try:
+                connect[elt, 1] = clip_convert_index[np.where(clip_convert_index == connect[elt, 1])[0], 1][0]
+            except IndexError:
+                connect[elt, 1] = -1
+            try:
+                connect[elt, 2] = clip_convert_index[np.where(clip_convert_index == connect[elt, 2])[0], 1][0]
+            except IndexError:
+                connect[elt, 2] = -1
+
+        connect = connect[np.where(connect != -1)[0], :]
+        num_of_elt = np.shape(connect)[0]
+
+    # }}}
+    # write header and mesh {{{
+    print('Now starting to write stuff')
+
+    if 'coarsetime' in kwargs.keys():
+        steplist = range(0, num_of_timesteps, kwargs['coarsetime'])
+    elif 'singletime' in kwargs.keys():
+        steplist = [kwargs['singletime']]
+    else:
+        steplist = range(0, num_of_timesteps)
+
+    for step in steplist:
+        print('Writing for step {}'.format(step))
+        saved_cells = {}
+        timestep = step
+        fid = open((filename + '/Timestep.vtk' + str(timestep) + '.vtk'), 'w+')
+        fid.write('# vtk DataFile Version 3.0 \n')
+        fid.write('Data for run {} \n'.format(md.miscellaneous.name))
+        fid.write('ASCII \n')
+        fid.write('DATASET UNSTRUCTURED_GRID \n')
+        fid.write('POINTS {:d} float\n'.format(num_of_points))
+    #updating z for mesh evolution
+        if moving_mesh and mesh_alti in ['1', '2']:
+            base = np.squeeze(res_struct.__dict__['TransientSolution'][step].__dict__['Base'][enveloppe_index])
+            thick_change_ratio = (np.squeeze(res_struct.__dict__['TransientSolution'][step].__dict__['Thickness'][enveloppe_index]) / md.geometry.thickness[enveloppe_index])
+            above_bed = points[:, 2] - md.geometry.base[enveloppe_index]
+            altitude = base + thick_change_ratio * above_bed
+        else:
+            altitude = points[:, 2]
+        for index, point in enumerate(points):
+            fid.write('{:f} {:f} {:f} \n'.format(point[0], point[1], altitude[index]))
+
+        fid.write('CELLS {:d} {:d}\n'.format(num_of_elt, num_of_elt * (point_per_elt + 1)))
+
+        for elt in range(0, num_of_elt):
+            if celltype == 5:
+                fid.write('3 {:d} {:d} {:d}\n'.format(connect[elt, 0],
+                                                      connect[elt, 1],
+                                                      connect[elt, 2]))
+            elif celltype == 13:
+                fid.write('6 {:d} {:d} {:d} {:d} {:d} {:d}\n'.format(connect[elt, 0],
+                                                                     connect[elt, 1],
+                                                                     connect[elt, 2],
+                                                                     connect[elt, 3],
+                                                                     connect[elt, 4],
+                                                                     connect[elt, 5]))
+
+        fid.write('CELL_TYPES {:d}\n'.format(num_of_elt))
+        for elt in range(0, num_of_elt):
+            fid.write('{:d}\n'.format(celltype))
+
+        fid.write('POINT_DATA {:s} \n'.format(str(num_of_points)))
+    # }}}
+    # {{{loop over the different solution structures
+    # first check if there are solutions to grab
+        if 'solnames' in locals():
+            for sol in solnames:
+                treated_res = []
+    #dealing with results on different timesteps
+                if(np.size(res_struct.__dict__[sol]) > timestep):
+                    timestep = step
+                else:
+                    timestep = np.size(res_struct.__dict__[sol])
+
+    #getting the  fields in the solution
+                if(type(res_struct.__dict__[sol]) == list):
+                    spe_res_struct = res_struct.__dict__[sol].__getitem__(timestep)
+                    fieldnames = dict.keys(spe_res_struct.__dict__)
+                else:
+                    spe_res_struct = res_struct.__dict__[sol]
+                    fieldnames = dict.keys(spe_res_struct.__dict__)
+
+    #Sorting scalars, vectors and tensors
+                tensors = [field for field in fieldnames if field[-2:] in ['xx', 'yy', 'xy', 'zz', 'xz', 'yz']]
+                non_tensor = [field for field in fieldnames if field not in tensors]
+                vectors = [field for field in non_tensor if field[-1] in ['x', 'y', 'z']]
+
+    #check which field is a real result and print
+                for field in fieldnames:
+                    if field in treated_res:
+                        continue
+                    elif field in vectors:
+                        try:
+                            Vxstruct = np.squeeze(spe_res_struct.__dict__[field[:-1] + 'x'])
+                            Vystruct = np.squeeze(spe_res_struct.__dict__[field[:-1] + 'y'])
+                            treated_res += [field[:-1] + 'x', field[:-1] + 'y']
+                            if dim == 3:
+                                Vzstruct = np.squeeze(spe_res_struct.__dict__[field[:-1] + 'z'])
+                                treated_res += field[:-1] + 'z'
+
+                        except KeyError:
+                            fieldnames += field
+                            vectors.remove(field)
+
+                        fid.write('VECTORS {} float \n'.format(field[:-1]))
+                        for node in range(0, num_of_points):
+                            Vx = cleanOutliers(Vxstruct[enveloppe_index[node]])
+                            Vy = cleanOutliers(Vystruct[enveloppe_index[node]])
+                            if dim == 3:
+                                Vz = cleanOutliers(Vzstruct[enveloppe_index[node]])
+                                fid.write('{:f} {:f} {:f}\n'.format(Vx, Vy, Vz))
+                            elif dim == 2:
+                                fid.write('{:f} {:f} {:f}\n'.format(Vx, Vy, 0))
+
+                    elif field in tensors:
+                        try:
+                            Txxstruct = np.squeeze(spe_res_struct.__dict__[field[:-2] + 'xx'])
+                            Txystruct = np.squeeze(spe_res_struct.__dict__[field[:-2] + 'xy'])
+                            Tyystruct = np.squeeze(spe_res_struct.__dict__[field[:-2] + 'yy'])
+                            treated_res += [field[:-2] + 'xx', field[:-2] + 'xy', field[:-2] + 'yy']
+                            if dim == 3:
+                                Tzzstruct = np.squeeze(spe_res_struct.__dict__[field[:-2] + 'zz'])
+                                Txzstruct = np.squeeze(spe_res_struct.__dict__[field[:-2] + 'xz'])
+                                Tyzstruct = np.squeeze(spe_res_struct.__dict__[field[:-2] + 'yz'])
+                                treated_res += [field[:-2] + 'zz', field[:-2] + 'xz', field[:-2] + 'yz']
+
+                        except KeyError:
+                            fieldnames += field
+                            tensors.remove(field)
+
+                        fid.write('TENSORS {} float \n'.format(field[:-2]))
+                        for node in range(0, num_of_points):
+                            Txx = cleanOutliers(Txxstruct[enveloppe_index[node]])
+                            Tyy = cleanOutliers(Tyystruct[enveloppe_index[node]])
+                            Txy = cleanOutliers(Txystruct[enveloppe_index[node]])
+                            if dim == 3:
+                                Tzz = cleanOutliers(Tzzstruct[enveloppe_index[node]])
+                                Txz = cleanOutliers(Txzstruct[enveloppe_index[node]])
+                                Tyz = cleanOutliers(Tyzstruct[enveloppe_index[node]])
+                                fid.write('{:f} {:f} {:f}\n'.format(Txx, Txy, Txz))
+                                fid.write('{:f} {:f} {:f}\n'.format(Txy, Tyy, Tyz))
+                                fid.write('{:f} {:f} {:f}\n'.format(Txz, Tyz, Tzz))
+                            elif dim == 2:
+                                fid.write('{:f} {:f} {:f}\n'.format(Txx, Txy, 0))
+                                fid.write('{:f} {:f} {:f}\n'.format(Txy, Tyy, 0))
+                                fid.write('{:f} {:f} {:f}\n'.format(0, 0, 0))
+                    else:
+                        if np.size(spe_res_struct.__dict__[field]) == 1:
+                            if field == 'time':
+                                current_time = spe_res_struct.__dict__[field]
+                            #skipping integers
+                            continue
+                        elif np.size(spe_res_struct.__dict__[field]) == every_nodes:
+                            fid.write('SCALARS {} float 1 \n'.format(field))
+                            fid.write('LOOKUP_TABLE default\n')
+                            for node in range(0, num_of_points):
+                                outval = cleanOutliers(np.squeeze(spe_res_struct.__dict__[field][enveloppe_index[node]]))
+                                fid.write('{:f}\n'.format(outval))
+                        elif np.shape(spe_res_struct.__dict__[field])[0] == np.size(spe_res_struct.__dict__[field]) == every_cells:
+                            saved_cells[field] = np.squeeze(spe_res_struct.__dict__[field])
+                        else:
+                            print("format for field {}.{} is not suported, field is skipped".format(sol, field))
+                            continue
+    # }}}
+    # loop on arguments, if something other than result is asked, do it now {{{
+        for other in args:
+            other_struct = md.__dict__[other]
+            othernames = (dict.keys(other_struct.__dict__))
+            for field in othernames:
+                if np.size(other_struct.__dict__[field]) == 1:
+                    #skipping integers
+                    continue
+                elif np.size(other_struct.__dict__[field]) == every_nodes:
+                    fid.write('SCALARS {} float 1 \n'.format(field))
+                    fid.write('LOOKUP_TABLE default\n')
+                    for node in range(0, num_of_points):
+                        outval = cleanOutliers(other_struct.__dict__[field][enveloppe_index[node]])
+                        fid.write('{:f}\n'.format(outval))
+                elif np.shape(other_struct.__dict__[field])[0] == every_nodes + 1:
+                    #we are dealing with a forcing of some kind.
+                    forcing_time = other_struct.__dict__[field][-1, :]
+                    if any(forcing_time == current_time):
+                        forcing_index = np.where(forcing_time == current_time)
+                        forcing_val = other_struct.__dict__[field][:, forcing_index]
+                    elif forcing_time[0] > current_time:
+                        forcing_val = other_struct.__dict__[field][:, 0]
+                    elif forcing_time[-1] < current_time:
+                        forcing_val = other_struct.__dict__[field][:, -1]
+                    else:
+                        forcing_index = np.where(forcing_time < current_time)[-1][-1]
+                        delta_time = forcing_time[forcing_index + 1] - forcing_time[forcing_index]  #compute forcing Dt
+                        delta_current = current_time - forcing_time[forcing_index]  # time since last forcing
+                        ratio = delta_current / delta_time  #compute weighting factor for preceding forcing vallue
+                        forcing_evol = (other_struct.__dict__[field][:, forcing_index + 1] - other_struct.__dict__[field][:, forcing_index]) * ratio
+                        forcing_val = other_struct.__dict__[field][:, forcing_index] + forcing_evol
+                    # and now write it down
+                    fid.write('SCALARS {}_{} float 1 \n'.format(other, field))
+                    fid.write('LOOKUP_TABLE default\n')
+                    for node in range(0, num_of_points):
+                        outval = cleanOutliers(forcing_val[enveloppe_index[node]])
+                        fid.write('{:f}\n'.format(outval))
+                elif np.shape(other_struct.__dict__[field])[0] == np.size(other_struct.__dict__[field]) == every_cells:
+                    saved_cells[field] = other_struct.__dict__[field]
+                else:
+                    print("format for field {}.{} is not suported, field is skipped".format(other, field))
+                    continue
+    # }}}
+    # Now writting cell variables {{{
+        if np.size(list(saved_cells.keys())) > 0:
+            fid.write('CELL_DATA {:d} \n'.format(num_of_elt))
+            for key in list(saved_cells.keys()):
+                fid.write('SCALARS {} float 1 \n'.format(key))
+                fid.write('LOOKUP_TABLE default\n')
+                for cell in range(0, num_of_elt):
+                    outval = cleanOutliers(saved_cells[key][cell])
+                    fid.write('{:f}\n'.format(outval))
+    # }}}
+    fid.close()
+
+
+def cleanOutliers(Val):
+    #paraview does not like NaN, replacing
+    if np.isnan(Val):
+        CleanVal = -9999.999
+    #also checking for very small value that mess up
+    elif (abs(Val) < 1.0e-20):
+        CleanVal = 0.0
+    else:
+        CleanVal = Val
+    return CleanVal
+
+
+class BadDimension(Exception):
+    """The required dimension is not supported yet."""
+
+
+class BadOption(Exception):
+    """The given option does not exist."""
+
+
+class ClipError(Exception):
+    """Error while trying to clip the domain."""
Index: /issm/trunk/src/m/contrib/morlighem/bamg/YamsCall.py
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/bamg/YamsCall.py	(revision 24312)
+++ /issm/trunk/src/m/contrib/morlighem/bamg/YamsCall.py	(revision 24313)
@@ -1,3 +1,4 @@
 import numpy as np
+import MatlabFuncs as m
 import time
 import subprocess
@@ -6,118 +7,118 @@
 from ComputeMetric import ComputeMetric
 
-def YamsCall(md,field,hmin,hmax,gradation,epsilon):
-	"""
-	YAMSCALL - call yams
 
-	   build a metric using the Hessian of the given field
-	   call Yams and the output mesh is plugged onto the model
-	   -hmin = minimum edge length (m)
-	   -hmax = maximum edge length (m)
-	   -gradation = maximum edge length gradation between 2 elements
-	   -epsilon = average error on each element (m/yr)
+def YamsCall(md, field, hmin, hmax, gradation, epsilon):
+    """
+    YAMSCALL - call yams
 
-	   Usage:
-	      md=YamsCall(md,field,hmin,hmax,gradation,epsilon);
+       build a metric using the Hessian of the given field
+       call Yams and the output mesh is plugged onto the model
+     - hmin = minimum edge length (m)
+     - hmax = maximum edge length (m)
+     - gradation = maximum edge length gradation between 2 elements
+     - epsilon = average error on each element (m / yr)
 
-	   Example:
-	      md=YamsCall(md,md.inversion.vel_obs,1500,10^8,1.3,0.9);
-	"""
+       Usage:
+          md = YamsCall(md, field, hmin, hmax, gradation, epsilon)
 
-	#2d geometric parameter (do not change)
-	scale=2./9.
+       Example:
+          md = YamsCall(md, md.inversion.vel_obs, 1500, 1.0e8, 1.3, 0.9)
+    """
 
-	#Compute Hessian
-	t1=time.time()
-	print "%s" % '      computing Hessian...'
-	hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,field,'node')
-	t2=time.time()
-	print "%s%d%s\n" % (' done (',t2-t1,' seconds)')
+    #2d geometric parameter (do not change)
+    scale = 2. / 9.
 
-	#Compute metric
-	t1=time.time()
-	print "%s" % '      computing metric...'
-	metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,np.empty(0,int))
-	t2=time.time()
-	print "%s%d%s\n" % (' done (',t2-t1,' seconds)')
+    #Compute Hessian
+    t1 = time.time()
+    print(("%s" % '      computing Hessian...'))
+    hessian = ComputeHessian(md.mesh.elements, md.mesh.x, md.mesh.y, field, 'node')
+    t2 = time.time()
+    print(("%s%d%s\n" % (' done (', t2 - t1, ' seconds)')))
 
-	#write files
-	t1=time.time()
-	print "%s" % '      writing initial mesh files...'
-	np.savetxt('carre0.met',metric)
+    #Compute metric
+    t1 = time.time()
+    print(("%s" % '      computing metric...'))
+    metric = ComputeMetric(hessian, scale, epsilon, hmin, hmax, np.empty(0, int))
+    t2 = time.time()
+    print(("%s%d%s\n" % (' done (', t2 - t1, ' seconds)')))
 
-	f=open('carre0.mesh','w')
+    #write files
+    t1 = time.time()
+    print(("%s" % '      writing initial mesh files...'))
+    np.savetxt('carre0.met', metric)
 
-	#initialiation
-	f.write("\n%s\n%i\n" % ('MeshVersionFormatted',1))
+    f = open('carre0.mesh', 'w')
 
-	#dimension
-	f.write("\n%s\n%i\n" % ('Dimension',2))
+    #initialiation
+    f.write("\n%s\n%i\n" % ('MeshVersionFormatted', 1))
 
-	#Vertices
-	f.write("\n%s\n%i\n\n" % ('Vertices',md.mesh.numberofvertices))
-	for i in xrange(0,md.mesh.numberofvertices):
-		f.write("%8g %8g %i\n" % (md.mesh.x[i],md.mesh.y[i],0))
+    #dimension
+    f.write("\n%s\n%i\n" % ('Dimension', 2))
 
-	#Triangles
-	f.write("\n\n%s\n%i\n\n" % ('Triangles',md.mesh.numberofelements))
-	for i in xrange(0,md.mesh.numberofelements):
-		f.write("%i %i %i %i\n" % (md.mesh.elements[i,0],md.mesh.elements[i,1],md.mesh.elements[i,2],0))
-	numberofelements1=md.mesh.numberofelements
+    #Vertices
+    f.write("\n%s\n%i\n\n" % ('Vertices', md.mesh.numberofvertices))
+    for i in range(0, md.mesh.numberofvertices):
+        f.write("%8g %8g %i\n" % (md.mesh.x[i], md.mesh.y[i], 0))
 
-	#Deal with rifts
-	if np.any(not np.isnan(md.rifts.riftstruct)):
+    #Triangles
+    f.write("\n\n%s\n%i\n\n" % ('Triangles', md.mesh.numberofelements))
+    for i in range(0, md.mesh.numberofelements):
+        f.write("%i %i %i %i\n" % (md.mesh.elements[i, 0], md.mesh.elements[i, 1], md.mesh.elements[i, 2], 0))
+    numberofelements1 = md.mesh.numberofelements
 
-		#we have the list of triangles that make up the rift. keep those triangles around during refinement.
-		triangles=np.empty(0,int)
-		for riftstruct in md.rifts.riftstruct:
-			triangles=np.concatenate((triangles,riftstruct.segments[:,2]))
+    #Deal with rifts
+    if np.any(not np.isnan(md.rifts.riftstruct)):
 
-		f.write("\n\n%s\n%i\n\n" % ('RequiredTriangles',np.size(triangles)))
-		for triangle in triangles:
-			f.write("%i\n" % triangle)
+        #we have the list of triangles that make up the rift. keep those triangles around during refinement.
+        triangles = np.empty(0, int)
+        for riftstruct in md.rifts.riftstruct:
+            triangles = np.concatenate((triangles, riftstruct.segments[:, 2]))
 
-	#close
-	f.close()
-	t2=time.time()
-	print "%s%d%s\n" % (' done (',t2-t1,' seconds)')
+        f.write("\n\n%s\n%i\n\n" % ('RequiredTriangles', np.size(triangles)))
+        for triangle in triangles:
+            f.write("%i\n" % triangle)
 
-	#call yams
-	print "%s\n" % '      call Yams...'
-	if   m.ispc():
-		#windows
-		subprocess.call('yams2-win -O 1 -v -0 -ecp -hgrad %g carre0 carre1' % gradation,shell=True)
-	elif ismac():
-		#Macosx
-		subprocess.call('yams2-osx -O 1 -v -0 -ecp -hgrad %g carre0 carre1' % gradation,shell=True)
-	else:
-		#Linux
-		subprocess.call('yams2-linux -O 1 -v -0 -ecp -hgrad %g carre0 carre1' % gradation,shell=True)
+    #close
+    f.close()
+    t2 = time.time()
+    print(("%s%d%s\n" % (' done (', t2 - t1, ' seconds)')))
 
-	#plug new mesh
-	t1=time.time()
-	print "\n%s" % '      reading final mesh files...'
-	Tria=np.loadtxt('carre1.tria',int)
-	Coor=np.loadtxt('carre1.coor',float)
-	md.mesh.x=Coor[:,0]
-	md.mesh.y=Coor[:,1]
-	md.mesh.z=np.zeros((np.size(Coor,axis=0),1))
-	md.mesh.elements=Tria
-	md.mesh.numberofvertices=np.size(Coor,axis=0)
-	md.mesh.numberofelements=np.size(Tria,axis=0)
-	numberofelements2=md.mesh.numberofelements
-	t2=time.time()
-	print "%s%d%s\n\n" % (' done (',t2-t1,' seconds)')
+    #call yams
+    print(("%s\n" % '      call Yams...'))
+    if m.ispc():
+        #windows
+        subprocess.call('yams2 - win - O 1 - v - 0 - ecp - hgrad %g carre0 carre1' % gradation, shell=True)
+    elif m.ismac():
+        #Macosx
+        subprocess.call('yams2 - osx - O 1 - v - 0 - ecp - hgrad %g carre0 carre1' % gradation, shell=True)
+    else:
+        #Linux
+        subprocess.call('yams2 - linux - O 1 - v - 0 - ecp - hgrad %g carre0 carre1' % gradation, shell=True)
 
-	#display number of elements
-	print "\n%s %i" % ('      inital number of elements:',numberofelements1)
-	print "\n%s %i\n\n" % ('      new    number of elements:',numberofelements2)
+    #plug new mesh
+    t1 = time.time()
+    print(("\n%s" % '      reading final mesh files...'))
+    Tria = np.loadtxt('carre1.tria', int)
+    Coor = np.loadtxt('carre1.coor', float)
+    md.mesh.x = Coor[:, 0]
+    md.mesh.y = Coor[:, 1]
+    md.mesh.z = np.zeros((np.size(Coor, axis=0), 1))
+    md.mesh.elements = Tria
+    md.mesh.numberofvertices = np.size(Coor, axis=0)
+    md.mesh.numberofelements = np.size(Tria, axis=0)
+    numberofelements2 = md.mesh.numberofelements
+    t2 = time.time()
+    print(("%s%d%s\n\n" % (' done (', t2 - t1, ' seconds)')))
 
-	#clean up:
-	os.remove('carre0.mesh')
-	os.remove('carre0.met')
-	os.remove('carre1.tria')
-	os.remove('carre1.coor')
-	os.remove('carre1.meshb')
+    #display number of elements
+    print(("\n%s %i" % ('      inital number of elements:', numberofelements1)))
+    print(("\n%s %i\n\n" % ('      new    number of elements:', numberofelements2)))
 
-	return md
+    #clean up:
+    os.remove('carre0.mesh')
+    os.remove('carre0.met')
+    os.remove('carre1.tria')
+    os.remove('carre1.coor')
+    os.remove('carre1.meshb')
 
+    return md
Index: /issm/trunk/src/m/contrib/morlighem/ismip6/date2decyear.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/ismip6/date2decyear.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/ismip6/date2decyear.m	(revision 24313)
@@ -0,0 +1,30 @@
+function decyear = date2decyear(datein)
+%DATE2DECYEAR - convert date to decimal year (for ISSM)
+%
+%   input argument must be a serial date (see datenum)
+%
+%   Usage:
+%      year = date2decyear(datein)
+%
+%   Example:
+%      year = date2decyear(datenum('19-May-2000'))
+
+
+%Make table from date coming in
+timevec = datevec(datein);
+
+%Set everything in the date vector to 0 except for the year
+%to compute the date for the beginninf of the year
+timevec(:,2:end) = 0;
+dateYearBegin = datenum(timevec);
+
+%Compute date of end of year
+timevec2 = timevec;
+timevec2(:,1) = timevec2(:,1) + 1;
+dateYearEnd = datenum(timevec2);
+
+%Calculate the day of the year
+doy = datein - dateYearBegin;
+
+%Finally, we can create the decimal year time
+decyear =  timevec(:,1) + (doy - 1) ./ (dateYearEnd - dateYearBegin);
Index: /issm/trunk/src/m/contrib/morlighem/ismip6/decyear2date.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/ismip6/decyear2date.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/ismip6/decyear2date.m	(revision 24313)
@@ -0,0 +1,23 @@
+function dateout = decyear2date(decyear)
+%DECYEAR2DATE - converts decimal year to serial date
+%
+%   Usage:
+%      dateout = decyear2date(decyear)
+%
+%   Example:
+%      dateout = decyear2date(2011.001)
+
+
+%Get year
+year = floor(decyear);
+fraction = mod(decyear,1);
+
+%Get date of beginning and end of year
+date0 = datenum(num2str(year),'yyyy');
+date1 = datenum(num2str(year+1),'yyyy');
+
+%Compute number of days in year
+numdays = date1 - date0;
+
+%Compute date
+dateout= date0 + fraction * numdays;
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/InterpFromGrid.cpp
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/InterpFromGrid.cpp	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/InterpFromGrid.cpp	(revision 24313)
@@ -0,0 +1,567 @@
+/*Written by Mathieu Morlighem April 19th 2019*/
+
+/*includes*/
+#include <mex.h>
+#include <pthread.h>
+#include <math.h>   //for isnan
+#include <cstring>  // for strcmp
+#define f(m,n)\
+  data[n*dataM+m] //Warning: matrix is transposed!
+
+/*Inputs{{{*/
+#define DATAX   (mxArray*)prhs[0]
+#define DATAY   (mxArray*)prhs[1]
+#define DATA    (mxArray*)prhs[2]
+#define INTERPX (mxArray*)prhs[3]
+#define INTERPY (mxArray*)prhs[4]
+#define METHOD  (mxArray*)prhs[5]
+/*}}}*/
+/*Outputs{{{*/
+#define INTERP (mxArray**)&plhs[0]
+/*}}}*/
+/*threading structs{{{*/
+typedef struct{
+	void* usr;
+	int   my_thread;
+	int   num_threads;
+} pthread_handle;
+
+typedef struct{
+	int     dataM;
+	int     dataN;
+	double* datax;
+	double* datay;
+	double* data;
+	int     interpN;
+	double* interpx;
+	double* interpy;
+	double* interp;
+	int     method;
+} AppStruct; /*}}}*/
+/*Prototypes{{{*/
+void  FetchMatrixPointer(double** pmatrix,int *pM,int *pN,const mxArray* dataref);
+void  FetchVectorPointer(double** pvector,int *pN,const mxArray* dataref);
+void  FetchString(char** pstring,const mxArray* dataref);
+void  WriteMatrix(mxArray** pdataref,double* matrix,int M,int N);
+void  WriteVector(mxArray** pdataref,double* vector,int N);
+void* InterpFromGridt(void* vpthread_handle);
+void  LaunchThread(void* function(void*), void* usr,int num_threads);
+bool  binary_search_increasing(int* pindex,double target,double* list,int n);
+bool  binary_search_decreasing(int* pindex,double target,double* list,int n);
+void  dataderivatives(double* A,double* x,double* y,double* data,int M,int N, int m0, int m1,int m2,int m3, int n0, int n1,int n2,int n3);
+/*}}}*/
+
+void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){/*{{{*/
+
+	double *datax   = NULL;
+	double *datay   = NULL;
+	double *data    = NULL;
+	int     dataM,dataN;
+	double *interpx = NULL;
+	double *interpy = NULL;
+	double *interp  = NULL;
+	int     interpM,interpN;
+
+	int     num_threads = 20;
+	int     test1,test2,test3,test4;
+	int     method = 1; // 0 = nearest, 1 = bilinear, 2 = bicubic
+
+	/*Check arguments to avoid crash*/
+	if(nlhs>1 || (nrhs<5 || nrhs>6)) mexErrMsgTxt("Wrong usage");
+
+	/*Get variables from matlab to C*/
+	FetchVectorPointer(&datax,&dataN,DATAX);
+	FetchVectorPointer(&datay,&dataM,DATAY);
+	FetchMatrixPointer(&data ,&test1,&test2,DATA); 
+	FetchMatrixPointer(&interpx,&interpM,&interpN,INTERPX);
+	FetchMatrixPointer(&interpy,&test3,&test4,INTERPY);
+	if(!dataM*dataN)     mexErrMsgTxt("data is empty");
+	if(!interpM*interpN) mexErrMsgTxt("no interpolation requested");
+	if(test1!=dataM)     mexErrMsgTxt("x should have as many elements as there are columns in the data");
+	if(test2!=dataN)     mexErrMsgTxt("y should have as many elements as there are lines in the data");
+	if(test3!=interpM)   mexErrMsgTxt("interpolation locations (x,y) do not have the same size");
+	if(test4!=interpN)   mexErrMsgTxt("interpolation locations (x,y) do not have the same size");
+	if(nrhs==6){
+		char* method_string = NULL;
+		FetchString(&method_string,METHOD);
+		if(strcmp(method_string,"nearest")==0)      method = 0;
+		else if(strcmp(method_string,"linear")==0)  method = 1;
+		else if(strcmp(method_string,"cubic")==0)   method = 2;
+		else{
+			mexErrMsgTxt("Method not supported yet");
+		}
+
+		mxFree(method_string);
+	}
+
+	/*Check inputs*/
+	if(true){
+		for(int i=0;i<interpM*interpN;i++){
+			if(isnan(interpx[i])) mexErrMsgTxt("NaN found in interpx");
+			if(isnan(interpy[i])) mexErrMsgTxt("NaN found in interpy");
+		}
+	}
+	if(method==3){
+		if(datax[1]-datax[0]<0) mexErrMsgTxt("x needs to be increasing for cubic interpolation");
+		if(datay[1]-datay[0]<0) mexErrMsgTxt("y needs to be increasing for cubic interpolation");
+	}
+
+	/*Allocate output*/
+	interp=(double*)mxMalloc(interpM*interpN*sizeof(double));
+
+	/*Multithreaded core*/
+	AppStruct usr;
+	usr.dataM   = dataM;
+	usr.dataN   = dataN;
+	usr.datax   = datax;
+	usr.datay   = datay;
+	usr.data    = data;
+	usr.interpN = interpM*interpN;
+	usr.interpx = interpx;
+	usr.interpy = interpy;
+	usr.interp  = interp;
+	usr.method  = method;
+	LaunchThread(InterpFromGridt,(void*)&usr,num_threads);
+
+	/*Write output vector*/
+	WriteMatrix(INTERP,interp,interpM,interpN);
+
+	/*Clean-up and return*/
+	/*Do not erase pointers!*/
+	return;
+}/*}}}*/
+
+/*InterpFromGridt{{{*/
+void* InterpFromGridt(void* vpthread_handle){
+
+	/*recover this thread info*/
+	pthread_handle *handle = (pthread_handle*)vpthread_handle;
+	int my_thread   = handle->my_thread;
+	int num_threads = handle->num_threads;
+
+	/*Recover struct*/
+	AppStruct *usr = (AppStruct*)handle->usr;
+	int     dataM   = usr->dataM;
+	int     dataN   = usr->dataN;
+	double *datax   = usr->datax;
+	double *datay   = usr->datay;
+	double *data    = usr->data;
+	int     interpN = usr->interpN;
+	double *interpx = usr->interpx;
+	double *interpy = usr->interpy;
+	double *interp  = usr->interp;
+	int     method = usr->method;
+
+	/*Intermediary*/
+	double xprime,yprime;
+	double x,y,x0,x1,x2,x3,y0,y1,y2,y3;
+	double Q11,Q12;
+	double Q21,Q22;
+	double A[16];
+	int    m,n,m0,m1,m2,m3,n0,n1,n2,n3;
+	int    oldm=-1,oldn=-1;
+
+	/*Is our matrix inverted?*/
+	bool invertx = (datax[1]-datax[0])<0 ? true:false;
+	bool inverty = (datay[1]-datay[0])<0 ? true:false;
+
+	for(int idx=my_thread;idx<interpN;idx+=num_threads){
+
+		x=interpx[idx];
+		y=interpy[idx];
+
+		/*Find indices m and n into y and x, for which  y(m)<=y_grids<=y(m+1) and x(n)<=x_grid<=x(n+1)*/
+		if(invertx) binary_search_decreasing(&n,x,datax,dataN);
+		else        binary_search_increasing(&n,x,datax,dataN);
+		if(inverty) binary_search_decreasing(&m,y,datay,dataM);
+		else        binary_search_increasing(&m,y,datay,dataM);
+
+		if(n>=0 && n<dataN && m>=0 && m<dataM){
+
+			/*    Q12             Q22
+			 * y2 x---------+-----x
+			 *    |         |     |
+			 *    |         |P    |
+			 *    |---------+-----|
+			 *    |         |     |
+			 *    |         |     |
+			 * y1 x---------+-----x Q21
+			 *    x1                 x2       
+			 *
+			 */
+			if(invertx){
+				n1=n+1; n2=n;
+			}
+			else{
+				n1=n; n2=n+1;
+			}
+			if(inverty){
+				m1=m+1; m2=m;
+			}
+			else{
+				m1=m; m2=m+1;
+			}
+
+			x1 = datax[n1]; x2 = datax[n2];
+			y1 = datay[m1]; y2 = datay[m2];
+
+			if(method==0){
+				/*Nearest neighbor interpolation*/
+				if(x > (x1+x2)/2.){
+					if(y > (y1+y2)/2.)
+						interp[idx] = f(m2,n2);
+					else
+						interp[idx] = f(m1,n2);
+					}
+				else{
+					if(y > (y1+y2)/2.)
+						interp[idx] = f(m2,n1);
+					else
+						interp[idx] = f(m1,n1);
+				}
+				continue;
+			}
+			else if(method==1){
+				/*Bilinear interpolation*/
+				if(Q11==-9999 || Q12==-9999 || Q21==-9999 || Q22==-9999){
+					interp[idx] = -9999;
+					continue;
+				}
+
+				interp[idx] =
+				  +f(m1,n1)*(x2-x)*(y2-y)/((x2-x1)*(y2-y1))
+				  +f(m1,n2)*(x-x1)*(y2-y)/((x2-x1)*(y2-y1))
+				  +f(m2,n1)*(x2-x)*(y-y1)/((x2-x1)*(y2-y1))
+				  +f(m2,n2)*(x-x1)*(y-y1)/((x2-x1)*(y2-y1));
+			}
+			else{
+				/*Bicubic interpolation*/
+				if(invertx){n0=n+2; n3=n-1;}
+				else{ n0=n-1; n3=n+2; }
+				if(inverty){ m0=m+2; m3=m-1; }
+				else{ m0=m-1; m3=m+2; }
+
+				if(n0<0 || n3>=dataN || m0<0 || m3>=dataM){
+					interp[idx] = -9999;
+					continue;
+				}
+
+				/*Local coordinates (between 0 and 1)*/
+				xprime = (x - datax[n1])/(datax[n2]-datax[n1]);
+				yprime = (y - datay[m1])/(datay[m2]-datay[m1]);
+
+				/*Get derivatives at current pixel*/
+				if(oldm!=m || oldn!=n){
+					dataderivatives(&A[0],datax,datay,data,dataM,dataN,m0,m1,m2,m3,n0,n1,n2,n3);
+					oldm = m;
+					oldn = n;
+				}
+
+				double a00 = A[0];
+				double a10 = A[4];
+				double a20 = -3*A[0]+3*A[1]-2*A[4]-A[5];
+				double a30 = 2*A[0]-2*A[1]+A[4]+A[5];
+				double a01 = A[8];
+				double a11 = A[12];
+				double a21 = -3*A[8]+3*A[9]-2*A[12]-A[13];
+				double a31 = 2*A[8]-2*A[9]+A[12]+A[13];
+				double a02 = -3*A[0]+3*A[2]-2*A[8]-A[10];
+				double a12 = -3*A[4]+3*A[6]-2*A[12]-A[14];
+				double a22 = 9*A[0]-9*A[1]-9*A[2]+9*A[3]+6*A[4]+3*A[5]-6*A[6]-3*A[7]+6*A[8]-6*A[9]+3*A[10]-3*A[11]+4*A[12]+2*A[13]+2*A[14]+A[15];
+				double a32 =-6*A[0]+6*A[1]+6*A[2]-6*A[3]-3*A[4]-3*A[5]+3*A[6]+3*A[7]-4*A[8]+4*A[9]-2*A[10]+2*A[11]-2*A[12]-2*A[13]-A[14]-A[15];
+				double a03 = 2*A[0]-2*A[2]+A[8]+A[10];
+				double a13 = 2*A[4]-2*A[6]+A[12]+A[14];
+				double a23 =-6*A[0]+6*A[1]+6*A[2]-6*A[3]-4*A[4]-2*A[5]+4*A[6]+2*A[7]-3*A[8]+3*A[9]-3*A[10]+3*A[11]-2*A[12]-A[13]-2*A[14]-A[15] ;
+				double a33 = 4*A[0]-4*A[1]-4*A[2]+4*A[3]+2*A[4]+2*A[5]-2*A[6]-2*A[7]+2*A[8]-2*A[9]+2*A[10]-2*A[11]+A[12]+A[13]+A[14]+A[15];
+
+				x1= xprime;
+				x2= x1*x1;
+				x3= x2*x1;
+				y1= yprime;
+				y2= y1*y1;
+				y3= y2*y1;
+				interp[idx] = (a00+a01*y1+a02*y2+a03*y3)+(a10+a11*y1+a12*y2+a13*y3)*x1+(a20+a21*y1+a22*y2+a23*y3)*x2+(a30+a31*y1+a32*y2+a33*y3)*x3;
+			}
+		}
+		else{
+			interp[idx] = -9999.;
+		}
+	}
+	//if(my_thread==0) printf("\r   interpolation progress = %5.1f%%\n",100.);
+
+	return NULL;
+}/*}}}*/
+/*binary_search_increasing {{{*/
+bool binary_search_increasing(int* pindex,double target,double* list,int n){
+
+	/*output*/
+	int  index;       //index, if found
+	bool found=false; //found=0 if target is not found, 1 otherwise.
+
+	/*intermediary*/
+	int n0 = 0;
+	int n1 = int(n/2);
+	//int n1 = int((target-list[0])/(list[1]-list[0]));
+	int n2 = n-1;
+
+	if(target<list[n0]){
+		found  = true;
+		index  = -1;
+	}
+	else if(target>list[n2]){
+		found  = true;
+		index  = n;
+	}
+	else{
+		while(!found){
+			/*did we find the target?*/
+			if(list[n1]<=target && list[n1+1]>=target){
+				found = true;
+				index = n1;
+				break;
+			}
+			if(target < list[n1]){
+				n2 = n1;
+				n1 = n0 + int((n2-n0)/2);
+			}
+			else{
+				n0 = n1;
+				n1 = n0 + int((n2-n0)/2);
+			}
+		}
+	}
+
+	/*Assign output pointers:*/
+	*pindex=index;
+	
+	/*Return result: */
+	return found;
+}/*}}}*/
+/*binary_search_decreasing{{{*/
+bool binary_search_decreasing(int* pindex,double target,double* list,int n){
+
+	/*output*/
+	int  index;       //index, if found
+	bool found=false; //found=0 if target is not found, 1 otherwise.
+
+	/*intermediary*/
+	int n0 = 0;
+	int n1 = int(n/2);
+	//int n1 = int((target-list[0])/(list[0]-list[1]));
+	int n2 = n-1;
+
+	if (target>list[n0]){
+		found  = true;
+		index  = -1;
+	}
+	else if(target<list[n2]){
+		found  = true;
+		index  = n;
+	}
+	else{
+		while(!found){
+			/*did we find the target?*/
+			if(list[n1]>=target && list[n1+1]<=target){
+				found = true;
+				index = n1;
+				break;
+			}
+			if(target > list[n1]){
+				n2 = n1;
+				n1 = n0 + int((n2-n0)/2);
+			}
+			else{
+				n0 = n1;
+				n1 = n0 + int((n2-n0)/2);
+			}
+		}
+	}
+
+	/*Assign output pointers:*/
+	*pindex=index;
+
+	/*Return result: */
+	return found;
+}/*}}}*/
+/*dataderivatives{{{*/
+void  dataderivatives(double* A,double* x,double* y,double* data,int dataM,int dataN,
+			int m0, int m1,int m2,int m3, int n0, int n1,int n2,int n3){
+
+   /* i+1 +  +-------+ f(1,1)
+    *     |  |       |
+    *     |  |f(0,0) |
+    *   i +  +-------+ f(1,0)
+    *     +--+-------+-----> x
+    *        j       j+1
+	 */
+
+
+   /*Function at corners*/
+   A[0] = f(m1,n1); // f(0,0)
+   A[1] = f(m1,n2); // f(1,0)
+   A[2] = f(m2,n1); // f(0,1)
+   A[3] = f(m2,n2); // f(1,1)
+
+   /*x component of the gradient*/
+   A[4] = .5*(f(m1,n2) - f(m1,n0));///(x[n2]-x[n0]); // dfdx(0,0)
+   A[5] = .5*(f(m1,n3) - f(m1,n1));///(x[n3]-x[n1]); // dfdx(1,0)
+   A[6] = .5*(f(m2,n2) - f(m2,n0));///(x[n2]-x[n0]); // dfdx(0,1)
+   A[7] = .5*(f(m2,n3) - f(m2,n1));///(x[n3]-x[n1]); // dfdx(1,1)
+
+   /*y component of the gradient*/
+   A[ 8] = .5*(f(m2,n1) - f(m0,n1));///(y[m2]-y[m0]); // dfdy(0,0)
+   A[ 9] = .5*(f(m2,n2) - f(m0,n2));///(y[m2]-y[m0]); // dfdy(1,0)
+   A[10] = .5*(f(m3,n1) - f(m1,n1));///(y[m3]-y[m1]); // dfdy(0,1)
+   A[11] = .5*(f(m3,n2) - f(m1,n2));///(y[m3]-y[m1]); // dfdy(1,1)
+
+   /*cross-component of the gradient*/
+   A[12] = .25*( (f(m2,n2) - f(m2,n0)) - (f(m0,n2) - f(m0,n0)) );///( (x[n2]-x[n0])*(y[m2]-y[m0]) ); // d2f/dxdy (0,0)
+   A[13] = .25*( (f(m2,n3) - f(m2,n1)) - (f(m0,n3) - f(m0,n1)) );///( (x[n3]-x[n1])*(y[m2]-y[m0]) ); // d2f/dxdy (1,0)
+   A[14] = .25*( (f(m3,n2) - f(m3,n0)) - (f(m1,n2) - f(m1,n0)) );///( (x[n2]-x[n0])*(y[m3]-y[m1]) ); // d2f/dxdy (0,1)
+   A[15] = .25*( (f(m3,n3) - f(m3,n1)) - (f(m1,n3) - f(m1,n1)) );///( (x[n3]-x[n1])*(y[m3]-y[m1]) ); // d2f/dxdy (1,1)
+}/*}}}*/
+/*LaunchThread{{{*/
+void LaunchThread(void* function(void*), void* usr,int num_threads){
+
+	int i;
+	int            *status  = NULL;
+	pthread_t      *threads = NULL;
+	pthread_handle *handles = NULL;
+
+	/*dynamically allocate: */
+	threads=(pthread_t*)mxMalloc(num_threads*sizeof(pthread_t));
+	handles=(pthread_handle*)mxMalloc(num_threads*sizeof(pthread_handle));
+
+	for(i=0;i<num_threads;i++){
+		handles[i].usr=usr;
+		handles[i].my_thread  =i;
+		handles[i].num_threads=num_threads;
+	}
+
+	if(num_threads==1){
+		function(handles);
+	}
+	else{
+		for(i=0;i<num_threads;i++){
+			if(pthread_create(threads+i,NULL,function,(void*)(handles+i))){
+				mexErrMsgTxt("pthread_create error");
+			}
+		}
+		for(i=0;i<num_threads;i++){
+			if(pthread_join(threads[i],(void**)&status)){
+				mexErrMsgTxt("pthread_join error");
+			}
+		}
+	}
+
+	/*Free ressources:*/
+	mxFree(threads);
+	mxFree(handles);
+}/*}}}*/
+/*FetchMatrixPointer {{{*/
+void FetchMatrixPointer(double** pmatrix,int *pM,int *pN,const mxArray* dataref){
+
+	double *matrix=NULL;
+	double *values=NULL;
+	int     N,M;
+
+	if(mxIsEmpty(dataref) ){
+		M=N=0;
+		matrix=NULL;
+	}
+	else if (mxIsDouble(dataref) ){
+		M=mxGetM(dataref);
+		N=mxGetN(dataref);
+		matrix=(double*)mxGetPr(dataref);
+	}
+	else{
+		mexErrMsgTxt("matrix type not supported");
+	}
+
+	*pmatrix=matrix;
+	if (pN)*pN=N;
+	if (pM)*pM=M;
+}/*}}}*/
+/*FetchVectorPointer {{{*/
+void FetchVectorPointer(double** pvector,int *pN,const mxArray* dataref){
+
+	double *vector=NULL;
+	double *values=NULL;
+	int     N;
+
+	if(mxIsEmpty(dataref) ){
+		N=0;
+		vector=NULL;
+	}
+	else if (mxIsDouble(dataref) ){
+		if(mxGetM(dataref)!=1 && mxGetN(dataref)!=1){
+			mexErrMsgTxt("input is a matrix and not a vector");
+		}
+		N=mxGetN(dataref)*mxGetM(dataref);
+		vector=(double*)mxGetPr(dataref);
+	}
+	else{
+		mexErrMsgTxt("vector type not supported");
+	}
+
+	*pvector=vector;
+	if (pN)*pN=N;
+}/*}}}*/
+/*FetchString{{{*/
+void FetchString(char** pstring,const mxArray* dataref){
+
+	char* outstring=NULL;
+
+	/*Ok, the string should be coming directly from the matlab workspace: */
+	if (!mxIsClass(dataref,"char")){
+		mexErrMsgTxt("input data_type is not a string!");
+	}
+	else{
+		/*Recover the string:*/
+		int stringlen;
+
+		stringlen = mxGetM(dataref)*mxGetN(dataref)+1;
+		outstring = (char*)mxMalloc(stringlen*sizeof(char));
+		mxGetString(dataref,outstring,stringlen);
+	}
+
+	/*Assign output pointers:*/
+	*pstring=outstring;
+	return;
+}/*}}}*/
+/*WriteMatrix {{{*/
+void WriteMatrix(mxArray** pdataref,double* matrix,int M,int N){
+
+	mxArray* dataref=NULL;
+
+	if(matrix){
+		/*data is a double* pointer. set pointer and invert sizes*/
+		dataref = mxCreateDoubleMatrix(0,0,mxREAL);
+		mxSetM(dataref,(mwSize)M); 
+		mxSetN(dataref,(mwSize)N);
+		mxSetPr(dataref,(double*)matrix);
+	}
+	else{
+		dataref = mxCreateDoubleScalar(0.0);
+	}
+	*pdataref=dataref;
+}
+/*}}}*/
+/*WriteVector {{{*/
+void WriteVector(mxArray** pdataref,double* vector,int N){
+
+	mxArray* dataref=NULL;
+
+	if(vector){
+		/*data is a double* pointer. Copy into a vector: */
+		dataref = mxCreateDoubleMatrix(0,0,mxREAL);
+		mxSetM(dataref,(mwSize)N);
+		mxSetN(dataref,(mwSize)1);
+		mxSetPr(dataref,(double*)vector);
+	}
+	else{
+		dataref = mxCreateDoubleScalar(0.0);
+	}
+	*pdataref=dataref;
+}
+/*}}}*/
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/Makefile
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/Makefile	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/Makefile	(revision 24313)
@@ -0,0 +1,2 @@
+all:
+	/Applications/MATLAB_R2019a.app/bin/mex InterpFromGrid.cpp
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpBamber2001.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpBamber2001.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpBamber2001.m	(revision 24313)
@@ -0,0 +1,33 @@
+function [bedout thicknessout] = interpBamber2001(X,Y),
+
+switch oshostname(),
+	case {'murdo','thwaites','astrid'}
+		bamber2001bedpath ='/u/astrid-r1b/ModelData/BamberDEMGreenland5km/bedrock.mat';
+		bamber2001thxpath ='/u/astrid-r1b/ModelData/BamberDEMGreenland5km/thickness.mat';
+	case {'ronne'}
+		bamber2001bedpath ='/home/ModelData/Greenland/Bamber2001/bedrock.mat';
+		bamber2001thxpath ='/home/ModelData/Greenland/Bamber2001/thickness.mat';
+	otherwise
+		error('machine not supported yet');
+end
+
+verbose = 0;
+
+%Convert to Bamber's projections
+if verbose, disp('   -- Bamber2001: converting coordinates'); end
+[LAT,  LON  ] = xy2ll(double(X(:)),double(Y(:)),+1,45,70);
+[x3971,y3971] = ll2xy(LAT,LON  ,+1,39,71);
+
+if verbose, disp('   -- Bamber2001: loading bed'); end
+load(bamber2001bedpath);
+if verbose, disp('   -- Bamber2001: interpolating bed'); end
+bedout = InterpFromGrid((x_m(1:end-1)+x_m(2:end))/2,(y_m(1:end-1)+y_m(2:end))/2,bedrock,x3971,y3971);
+bedout = reshape(bedout,size(X,1),size(X,2));
+
+if nargout>1
+	if verbose, disp('   -- Bamber2001: loading thickness'); end
+	load(bamber2001thxpath);
+	if verbose, disp('   -- Bamber2001: interpolating thickness'); end
+	thicknessout = InterpFromGrid((x_m(1:end-1)+x_m(2:end))/2,(y_m(1:end-1)+y_m(2:end))/2,thickness,x3971,y3971);
+	thicknessout = reshape(thicknessout,size(X,1),size(X,2));
+end
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpBamber2013.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpBamber2013.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpBamber2013.m	(revision 24313)
@@ -0,0 +1,50 @@
+function output = interpBamber2013(X,Y,string),
+%INTERPBAMBER2013 - interpolate Bamber 2013 data
+%
+%   Available data:
+%      BedrockElevation
+%      SurfaceElevation
+%      IceThickness
+%      SurfaceRMSE
+%      BedrockError
+%      LandMask (Land mask, 0=ocean, 1=land, 2=ice sheet, 3=non-Greenlandic land, 4=ice shelf)
+%      NumberAirbornePoints
+%      Geoid
+%      BedrockChangeMask
+%      IceShelfSourceMask
+%      BedrockElevation_unprocessed
+%      IceThickness_unprocessed
+%      BathymetryDataMask
+
+switch oshostname(),
+	case {'murdo','thwaites','astrid'}
+		bamber2013nc='/u/astrid-r1b/morlighe/issmjpl/proj-morlighem/DatasetGreenland/Data/Bamber2013/Greenland_bedrock_topography_V3.nc';
+	case {'ronne'}
+		bamber2013nc='/home/ModelData/Greenland/Bamber2013/Greenland_bedrock_topography_V3.nc';
+	otherwise
+		error('machine not supported yet');
+end
+verbose = 0;
+
+if nargin==2,
+	string = 'BedrockElevation';
+end
+
+%Convert to Bamber's projections
+if verbose, disp('   -- Bamber2013: converting coordinates'); end
+[LAT,  LON  ] = xy2ll(double(X(:)),double(Y(:)),+1,45,70);
+[x3971,y3971] = ll2xy(LAT,LON  ,+1,39,71);
+
+if verbose, disp('   -- Bamber2013: loading coordinates'); end
+xdata = double(ncread(bamber2013nc,'projection_x_coordinate'));%*1000;
+ydata = double(ncread(bamber2013nc,'projection_y_coordinate'));%*1000;
+
+if verbose, disp(['   -- Bamber2013: loading ' string]); end
+data  = double(ncread(bamber2013nc,string))';
+if verbose, disp(['   -- Bamber2013: interpolating ' string]); end
+if strcmpi(string,'LandMask');
+	output = InterpFromGrid(xdata,ydata,data,x3971,y3971,'nearest');
+else
+	output = InterpFromGrid(xdata,ydata,data,x3971,y3971);
+end
+output = reshape(output,size(X,1),size(X,2));
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmachineAntarctica.m	(revision 24313)
@@ -0,0 +1,156 @@
+function output = interpBedmachineAntarctica(X,Y,string,method,ncdate),
+
+if nargin<3, string = 'bed'; end
+if nargin<4
+	if strcmp(string,'mask') | strcmp(string,'source')
+      method='nearest'; % default method
+   else
+      method='cubic'; % default method
+   end
+end
+if nargin<5
+	%ncdate='2014-03-12';
+	%ncdate='2014-04-28';
+	%ncdate='2014-07-31';
+	%ncdate='2014-09-23';
+	%ncdate='2015-11-06';
+	%ncdate='2015-12-09';
+	ncdate='2016-06-10';
+	ncdate='2016-08-26';
+	ncdate='2016-11-17';
+	ncdate='2017-01-05';
+	ncdate='2017-03-10';
+	ncdate='2018-02-02';
+	ncdate='2018-03-20';
+	ncdate='2018-05-18';
+	ncdate='2018-06-08';
+	ncdate='2018-09-26';
+	ncdate='2018-11-14';
+	ncdate='2019-01-30';
+	ncdate='2019-03-12';
+	ncdate='2019-04-02';
+	ncdate='2019-04-15'; % no need of firn correction
+end
+
+basename = 'BedMachineAntarctica';
+
+%read data
+switch (oshostname()),
+	case {'ronne'}
+		nc=['/home/ModelData/Antarctica/BedMachine/' basename '-' ncdate '.nc'];
+	case {'thwaites','murdo','astrid'}
+		nc=['/u/astrid-r1b/ModelData/BedMachine/' basename '-' ncdate '.nc'];
+	otherwise
+		error('hostname not supported yet');
+end
+
+if nargout==2,
+	string = 'bed';
+end
+
+disp(['   -- BedMachine Antarctica version: ' ncdate]);
+xdata = double(ncread(nc,'x'));
+ydata = double(ncread(nc,'y'));
+
+offset=2;
+
+xmin=min(X(:)); xmax=max(X(:));
+posx=find(xdata<=xmax);
+id1x=max(1,find(xdata>=xmin,1)-offset);
+id2x=min(numel(xdata),posx(end)+offset);
+
+ymin=min(Y(:)); ymax=max(Y(:));
+posy=find(ydata>=ymin);
+id1y=max(1,find(ydata<=ymax,1)-offset);
+id2y=min(numel(ydata),posy(end)+offset);
+
+if strcmp(string,'icemask'),
+	disp(['   -- BedMachine Antarctica: loading ' string]);
+	%data  = double(ncread(nc,'mask'))';
+	data  = double(ncread(nc,'mask',[id1x id1y],[id2x-id1x+1 id2y-id1y+1],[1 1]))';
+	xdata=xdata(id1x:id2x);
+	ydata=ydata(id1y:id2y);
+	%ice ocean interface is between 0 and 3, so we might get some 1 by interpolating
+	data(find(data==3))=0;
+else
+	disp(['   -- BedMachine Antarctica: loading ' string]);
+	%data  = double(ncread(nc,string))';
+	data  = double(ncread(nc,string,[id1x id1y],[id2x-id1x+1 id2y-id1y+1],[1 1]))';
+	xdata=xdata(id1x:id2x);
+	ydata=ydata(id1y:id2y);
+end
+
+disp(['   -- BedMachine Antarctica: interpolating ' string]);
+disp(['       -- Interpolation method: ' method]);
+if strcmp(string,'mask') | strcmp(string,'source'),
+	%Need nearest neighbor to avoid interpolation between 0 and 2
+	tic
+	output = InterpFromGrid(xdata,ydata,data,double(X),double(Y),'nearest');
+	toc
+	%tic
+	%output = FastInterp(xdata,ydata,data,X,Y,'nearest');
+	%toc
+else
+	%disp('InterpFromGrid');
+	%tic
+	%output = InterpFromGrid(xdata,ydata,data,double(X),double(Y),'cubic'); 
+	output = InterpFromGrid(xdata,ydata,data,double(X),double(Y),method); % now the interpolation method can be defined by the user
+	%toc
+	%disp('FastInterp');
+	%tic
+	%output = FastInterp(xdata,ydata,data,X,Y,'bilinear');
+	%toc
+end
+
+end
+function zi = FastInterp(x,y,data,xi,yi,method)
+
+	%get data size
+	[M N] = size(data);
+
+	% Get X and Y library array spacing
+	ndx = 1/(x(2)-x(1));    ndy = 1/(y(2)-y(1));
+	% Begin mapping xi and yi vectors onto index space by subtracting library
+	% array minima and scaling to index spacing
+
+	xi = (xi - x(1))*ndx;       yi = (yi - y(1))*ndy;
+
+	% Fill Zi with NaNs
+	zi = NaN(size(xi));
+
+	if strcmpi(method,'nearest'),
+		% Find the nearest point in index space
+		rxi = round(xi)+1;  ryi = round(yi)+1;
+		% Find points that are in X,Y range
+		flag = rxi>0 & rxi<=N & ~isnan(rxi) & ryi>0 & ryi<=M & ~isnan(ryi);
+		% Map subscripts to indices
+		ind = ryi + M*(rxi-1);
+		zi(flag) = data(ind(flag));
+
+	else %Bilinear
+
+		% Transform to unit square
+		fxi = floor(xi)+1;  fyi = floor(yi)+1; % x_i and y_i
+		dfxi = xi-fxi+1;    dfyi = yi-fyi+1;   % Location in unit square
+
+		% flagIn determines whether the requested location is inside of the data arrays
+		flagIn = fxi>0 & fxi<N & ~isnan(fxi) & fyi>0 & fyi<M & ~isnan(fyi);
+
+		%Toss all out-of-bounds variables now to save time
+		fxi  = fxi(flagIn);  fyi  = fyi(flagIn);
+		dfxi = dfxi(flagIn); dfyi = dfyi(flagIn);
+
+		%Find bounding vertices
+		ind1 = fyi + M*(fxi-1);     % indices of (  x_i  ,  y_i  )
+		ind2 = fyi + M*fxi;         % indices of ( x_i+1 ,  y_i  )
+		ind3 = fyi + 1 + M*fxi;     % indices of ( x_i+1 , y_i+1 )
+		ind4 = fyi + 1 + M*(fxi-1); % indices of (  x_i  , y_i+1 )
+
+		% Bilinear interpolation
+		zi(flagIn) = ...
+			data(ind1).*(1-dfxi).*(1-dfyi) + ...
+			data(ind2).*dfxi.*(1-dfyi) + ...
+			data(ind4).*(1-dfxi).*dfyi + ...
+			data(ind3).*dfxi.*dfyi;
+	end
+end
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmachineGreenland.m	(revision 24313)
@@ -0,0 +1,90 @@
+function output = interpBedmachineGreenland(X,Y,string,ncdate),
+
+if nargin<3, string = 'bed'; end
+if nargin<4,
+	%ncdate='2013-05-21';
+	%ncdate='2013-06-27';
+	%ncdate='2013-07-18';
+	%ncdate='2013-11-15';
+	%ncdate='2013-12-03';
+	%ncdate='2014-02-26';
+	%ncdate='2014-03-24';
+	%ncdate='2014-07-31';
+	%ncdate='2014-11-14';
+	%ncdate='2015-03-03';
+	%ncdate='2015-03-10';
+	%ncdate='2015-03-26';
+	%ncdate='2015-03-30';
+	%ncdate='2015-04-27'; %BedMachine v2
+	%ncdate='2015-07-30';
+	%ncdate='2015-10-02';
+	%ncdate='2016-03-21';
+	%ncdate='2016-05-12';
+	ncdate='2016-07-06';
+	ncdate='2016-08-04';
+	ncdate='2016-10-26';
+	ncdate='2016-11-23';
+	ncdate='2016-12-21';
+	ncdate='2017-01-19';
+	ncdate='2017-03-28';
+	ncdate='2017-05-10';
+	ncdate='2017-07-21';
+	ncdate='2017-09-25'; %BedMachine v3
+	ncdate='2018-06-01';
+	ncdate='2019-04-18';
+end
+
+if exist('datetime','file') 
+	date1 = sscanf(ncdate,'%d-%d-%d');
+	date2 = datetime(date1(1),date1(2),date1(3));
+	if date2<datetime(2016,10,24),
+		basename = 'MCdataset'; 
+	else
+		basename = 'BedMachineGreenland';
+	end
+else
+  basename = 'BedMachineGreenland';
+end
+
+switch oshostname(),
+	case {'murdo','thwaites','astrid'}
+		morlighem2013nc=['/u/astrid-r1b/ModelData/ModelData/MCdataset-' ncdate '.nc']';
+	case {'ronne'}
+		morlighem2013nc=['/home/ModelData/Greenland/BedMachine/' basename '-' ncdate '.nc'];
+	otherwise
+		error('machine not supported yet');
+end
+
+disp(['   -- BedMachine Greenland version: ' ncdate]);
+xdata = double(ncread(morlighem2013nc,'x'));
+ydata = double(ncread(morlighem2013nc,'y'));
+
+offset=2;
+
+xmin=min(X(:)); xmax=max(X(:));
+posx=find(xdata<=xmax);
+if isempty(posx), posx=numel(xdata); end
+id1x=max(1,find(xdata>=xmin,1)-offset);
+id2x=min(numel(xdata),posx(end)+offset);
+
+ymin=min(Y(:)); ymax=max(Y(:));
+posy=find(ydata>=ymin);
+if isempty(posy), posy=numel(ydata); end
+id1y=max(1,find(ydata<=ymax,1)-offset);
+id2y=min(numel(ydata),posy(end)+offset);
+
+disp(['   -- BedMachine Greenland: loading ' string]);
+data  = double(ncread(morlighem2013nc,string,[id1x id1y],[id2x-id1x+1 id2y-id1y+1],[1 1]))';
+xdata=xdata(id1x:id2x);
+ydata=ydata(id1y:id2y);
+data(find(data==-9999))=NaN;
+
+disp(['   -- BedMachine Greenland: interpolating ' string]);
+if strcmp(string,'mask') | strcmp(string,'source'),
+	%Need nearest neighbor to avoid interpolation between 0 and 2
+	output = InterpFromGrid(xdata,ydata,data,double(X),double(Y),'nearest');
+else
+	output = InterpFromGrid(xdata,ydata,data,double(X),double(Y));
+end
+
+%TEST https://www.mathworks.com/matlabcentral/fileexchange/10772-fast-2-dimensional-interpolation
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmap.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmap.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmap.m	(revision 24313)
@@ -0,0 +1,27 @@
+function [dataout] = interpBedmap(X,Y,string),
+%INTERPBEDMAP - interpolate bedmap data
+%
+%   Available data:
+%      1. bed                          is bed height
+%      2. thickness                    is ice thickness
+%
+%   Usage:
+%      [dataout] = interpBedmap(X,Y,string)
+
+path=[jplsvn() '/proj-morlighem/DatasetAntarctica/Data/BedMap/gridded/'];
+
+if strcmp(string,'bed'),
+	path = [path '/bed.mat'];
+	load(path);
+	x_m =(x_m(2:end)+x_m(1:end-1))/2.;
+	y_m =(y_m(2:end)+y_m(1:end-1))/2.;
+	dataout = InterpFromGrid(x_m,y_m,bed,double(X),double(Y));
+elseif strcmp(string,'thickness')
+	path = [path '/thickness.mat'];
+	load(path);
+	x_m =(x_m(2:end)+x_m(1:end-1))/2.;
+	y_m =(y_m(2:end)+y_m(1:end-1))/2.;
+	dataout = InterpFromGrid(x_m,y_m,thickness,double(X),double(Y));
+else
+	error('not supported');
+end
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmap2.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmap2.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpBedmap2.m	(revision 24313)
@@ -0,0 +1,99 @@
+function [output] = interpBedmap2(X,Y,string),
+%INTERPBEDMAP2 - interpolate bedmap2 data
+%
+%   Available data:
+%      1. bed                          is bed height
+%      2. surface                      is surface height
+%      3. thickness                    is ice thickness
+%      4. icemask_grounded_and_shelves is a mask file showing the grounding line and the extent of the floating ice shelves
+%      5. rockmask                     is a mask file showing rock outcrops
+%      6. lakemask_vostok              is a mask file showing the extent of the lake cavity of Lake Vostok
+%      7. grounded_bed_uncertainty     is the bed uncertainty grid shown in figure 12 of the manuscript
+%      8. thickness_uncertainty_5km    is the thickness uncertainty grid shown in figure 11 of the manuscript
+%      9. coverage                     is a binary grid showing the distribution of ice thickness data used in the grid of ice thickness
+%     10. gl04c_geoid_to_wgs84         is the height conversion values (as floating point) used to convert from WGS84 datum heights to
+%                                      g104c geoidal heights (to convert back to WGS84, add this grid)
+%
+%   Usage:
+%      [dataout] = interpBedmap2(X,Y,string)
+
+nc = '/home/ModelData/Antarctica/BedMap2/bedmap2_bin/Bedmap2.nc';
+
+if strcmp(string,'thickness_uncertainty_5km')
+	xdata = double(ncread(nc,'x_5km'));
+	ydata = double(ncread(nc,'y_5km'));
+else
+	xdata = double(ncread(nc,'x'));
+	ydata = double(ncread(nc,'y'));
+end
+
+offset=2;
+
+xmin=min(X(:)); xmax=max(X(:));
+posx=find(xdata<=xmax);
+id1x=max(1,find(xdata>=xmin,1)-offset);
+id2x=min(numel(xdata),posx(end)+offset);
+
+ymin=min(Y(:)); ymax=max(Y(:));
+posy=find(ydata>=ymin);
+id1y=max(1,find(ydata<=ymax,1)-offset);
+id2y=min(numel(ydata),posy(end)+offset);
+
+data  = double(ncread(nc,string,[id1x id1y],[id2x-id1x+1 id2y-id1y+1],[1 1]))';
+xdata=xdata(id1x:id2x);
+ydata=ydata(id1y:id2y);
+
+if ~strcmp(string,'coverage'),
+	data(find(data==-9999))=NaN;
+end
+
+if strcmpi(string,'icemask_grounded_and_shelves') | strcmpi(string,'rockmask'),
+	output = InterpFromGrid(xdata,ydata,data,double(X),double(Y),'nearest');
+else
+	output = InterpFromGrid(xdata,ydata,data,double(X),double(Y)); % linear interpolation is default
+end
+
+return;
+% ================================  OLD ===============================================
+%read data
+path=['/home/ModelData/Antarctica/BedMap2/bedmap2_bin/'];
+if strcmp(string,'gl04c_geoid_to_wgs84'),
+	filepath = [path '/gl04c_geiod_to_wgs84.flt'];
+else
+	filepath = [path '/bedmap2_' string '.flt'];
+end
+fid=fopen(filepath,'r','l');
+data=fread(fid,[6667,6667],'float32');
+fclose(fid);
+
+% define grid
+if strcmp(string,'thickness_uncertainty_5km'),
+	ncols    =1361;
+	nrows    =1361;
+	xll      =-3401000;
+	yll      =-3402000;
+	gridsize =5000;
+else
+	ncols    =6667;
+	nrows    =6667;
+	xll      =-3333000;
+	yll      =-3333000;
+	gridsize =1000;
+end
+x_m=xll+(0:1:ncols-1)'*gridsize;
+y_m=yll+(0:1:nrows-1)'*gridsize;
+
+%Change default to NaN
+if ~strcmp(string,'coverage'),
+	data(find(data==-9999))=NaN;
+end
+
+%rotate 90 degrees clockwise
+data = rot90(data);
+
+%Interpolate
+if strcmpi(string,'icemask_grounded_and_shelves') | strcmpi(string,'rockmask'),
+	dataout = InterpFromGrid(x_m,y_m,data,double(X),double(Y),'nearest');
+else
+	dataout = InterpFromGrid(x_m,y_m,data,double(X),double(Y));
+end
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpChuter2015.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpChuter2015.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpChuter2015.m	(revision 24313)
@@ -0,0 +1,13 @@
+function output = interpChuter2015(X,Y),
+
+ncfile='/home/ModelData/Antarctica/ChuterBamberIceShelfH/ChuterBamber_2015_CS2_ice_equivalent_ice_shelf_thickness_Rignot_gl.nc';
+verbose = 0;
+
+if verbose, disp('   -- Chuter2015: loading coordinates'); end
+xdata = double(ncread(ncfile,'x_dimensions'))';
+ydata = double(ncread(ncfile,'y_dimensions'))';
+
+if verbose, disp(['   -- Chuter2015: loading thickenss']); end
+data  = double(ncread(ncfile,'ice_shelf_thickness'))';
+if verbose, disp(['   -- Chuter2015: interpolating ' string]); end
+output = InterpFromGrid(xdata(1,:),ydata(:,1),data,X,Y);
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpDTU19MDT.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpDTU19MDT.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpDTU19MDT.m	(revision 24313)
@@ -0,0 +1,33 @@
+function mdt = interpDTU19MDT(X,Y,varargin);
+
+switch oshostname(),
+	case {'ronne'}
+		rootname='/ronne_2/home/ModelData/Global/DTU19MDT/dtu19mdt.mat';
+	otherwise
+		error('machine not supported yet');
+end
+verbose = 1;
+
+if nargin==3,
+	hemisphere = varargin{1};
+else
+	hemisphere = +1;
+end
+
+if hemisphere==+1,
+	if verbose, disp('   -- DTU19MDT: convert to lat/lon using Greenland projection'); end
+	[LAT,  LON  ] = xy2ll(double(X(:)),double(Y(:)),+1,45,70);
+else
+	if verbose, disp('   -- DTU19MDT: convert to lat/lon using Antarctica projection'); end
+	[LAT,  LON  ] = xy2ll(double(X(:)),double(Y(:)),-1,0,71);
+end
+pos=find(LON<0);
+LON(pos) =360+LON(pos);
+LAT=reshape(LAT,size(X));
+LON=reshape(LON,size(X));
+
+if verbose, disp('   -- DTU19MDT: loading DTU19MDT'); end
+A=load(rootname);
+
+if verbose, disp('   -- DTU19MDT: interpolating'); end
+mdt = InterpFromGrid(A.lon_ext,A.lat_ext,A.mdt_ext,LON,LAT);
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpDhdt.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpDhdt.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpDhdt.m	(revision 24313)
@@ -0,0 +1,53 @@
+function out = interpDhdt(X,Y),
+
+switch oshostname(),
+	case {'ronne'}
+		dhdtpath='/home/ModelData/Greenland/DHDT/dhdt0306.tif';
+	otherwise
+		error('machine not supported yet');
+end
+
+%convert coordinates:
+[lat lon] = xy2ll(X,Y,+1);
+[X Y] = ll2utm(lat,lon,24);
+
+%Get image info
+Tinfo = imfinfo(dhdtpath);
+N     = Tinfo.Width;
+M     = Tinfo.Height;
+dx    = Tinfo.ModelPixelScaleTag(1);
+dy    = Tinfo.ModelPixelScaleTag(2);
+minx  = Tinfo.ModelTiepointTag(4);
+maxy  = Tinfo.ModelTiepointTag(5);
+
+%Generate vectors
+xdata = minx + dx/2 + ((0:N-1).*dx);
+ydata = maxy - dy/2 - ((M  -1:-1:0).*dy);
+ydata = fliplr(ydata);
+
+%Get pixels we are interested in
+offset=2;
+xmin=min(X(:)); xmax=max(X(:));
+posx=find(xdata<=xmax);
+id1x=max(1,find(xdata>=xmin,1)-offset);
+id2x=min(numel(xdata),posx(end)+offset);
+
+if 0,
+	ymin=min(Y(:)); ymax=max(Y(:));
+	posy=find(ydata<=ymax);
+	id1y=max(1,find(ydata>=ymin,1)-offset);
+	id2y=min(numel(ydata),posy(end)+offset);
+else
+	ymin=min(Y(:)); ymax=max(Y(:));
+	posy=find(ydata>=ymin);
+	id1y=max(1,find(ydata<=ymax,1)-offset);
+	id2y=min(numel(ydata),posy(end)+offset);
+end
+
+data  = double(imread(dhdtpath,'PixelRegion',{[id1y,id2y],[id1x,id2x]}));
+xdata=xdata(id1x:id2x);
+ydata=ydata(id1y:id2y);
+data(find(data>+10^3)) = 0;
+data(find(data<-10^3)) = 0;
+
+out = InterpFromGrid(xdata,ydata,data,X,Y);
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpFromGeotiff.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpFromGeotiff.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpFromGeotiff.m	(revision 24313)
@@ -0,0 +1,40 @@
+function dataout = interpFromGeotiff(geotiffname,X,Y),
+
+usemap = 0;
+if license('test','map_toolbox')==0,
+	disp('WARNING: map toolbox not installed, trying house code');
+	usemap = 0;
+elseif license('checkout','map_toolbox')==0
+	disp('WARNING: map toolbox not available (checkout failed), trying house code');
+	usemap = 0;
+end
+
+if usemap,
+	[data,R] = geotiffread(geotiffname);
+	data=double(flipud(data));
+	xdata=R.XLimWorld(1):R.DeltaX:R.XLimWorld(2); xdata=xdata(:);
+	xdata =(xdata(1:end-1)+xdata(2:end))/2;
+	ydata=R.YLimWorld(2):R.DeltaY:R.YLimWorld(1); ydata=flipud(ydata(:));
+	ydata =(ydata(1:end-1)+ydata(2:end))/2;
+else
+
+	%Get image info
+	Tinfo = imfinfo(geotiffname);
+	N     = Tinfo.Width;
+	M     = Tinfo.Height;
+	dx    = Tinfo.ModelPixelScaleTag(1);
+	dy    = Tinfo.ModelPixelScaleTag(2);
+	minx  = Tinfo.ModelTiepointTag(4);
+	maxy  = Tinfo.ModelTiepointTag(5);
+
+	%Generate vectors
+	xdata = minx + dx/2 + ((0:N-1).*dx);
+	ydata = maxy - dy/2 - ((M  -1:-1:0).*dy);
+
+	%Read image
+	data=double(flipud(imread(geotiffname)));
+	data(find(abs(data)>10^30))=NaN;
+end
+
+dataout = InterpFromGrid(xdata,ydata,data,X,Y);
+dataout(dataout==-9999)=NaN;
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpGeoid.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpGeoid.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpGeoid.m	(revision 24313)
@@ -0,0 +1,34 @@
+function [geoid] = interpGeoid(X,Y,varargin),
+
+switch oshostname(),
+	case {'murdo','thwaites','astrid'}
+		rootname=[jplsvn() '/proj-morlighem/DatasetGreenland/Data/Geoid/eigen-6c4-1970.mat'];
+	case {'ronne'}
+		rootname='/home/ModelData/Global/Geoid/eigen-6c4-1970.mat';
+	otherwise
+		error('machine not supported yet');
+end
+verbose = 1;
+
+if nargin==3,
+	hemisphere = varargin{1};
+else
+	hemisphere = +1;
+end
+
+if hemisphere==+1,
+	if verbose, disp('   -- Geoid: convert to lat/lon using Greenland projection'); end
+	[LAT,  LON  ] = xy2ll(double(X(:)),double(Y(:)),+1,45,70);
+else
+	if verbose, disp('   -- Geoid: convert to lat/lon using Antarctica projection'); end
+	[LAT,  LON  ] = xy2ll(double(X(:)),double(Y(:)),-1,0,71);
+end
+pos=find(LON<0);
+LON(pos) =360+LON(pos);
+
+if verbose, disp('   -- Geoid: loading eigen-6c4 '); end
+A=load(rootname);
+
+if verbose, disp('   -- Geoid: interpolating'); end
+geoid = InterpFromGrid(A.lon,A.lat,A.geoid,LON,LAT);
+geoid = reshape(geoid,size(X));
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpGimpdem.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpGimpdem.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpGimpdem.m	(revision 24313)
@@ -0,0 +1,68 @@
+function sout = interpGimpdem(X,Y),
+
+switch oshostname(),
+	case {'murdo','thwaites','astrid'}
+		howatpath='/u/astrid-r1b/morlighe/issmjpl/proj-morlighem/DatasetGreenland/Data/gimpdem/gimpdem_90m.tif';
+	case {'ronne'}
+		howatpath='/home/ModelData/Greenland/gimpdem/gimpdem_90m.tif';
+	otherwise
+		error('machine not supported yet');
+end
+
+usemap = 0;
+if license('test','map_toolbox')==0,
+	disp('WARNING: map toolbox not installed, trying house code');
+	usemap = 0;
+elseif license('checkout','map_toolbox')==0
+	disp('WARNING: map toolbox not available (checkout failed), trying house code');
+	usemap = 0;
+end
+
+if usemap,
+	[data,R] = geotiffread(howatpath);
+	data=double(flipud(data));
+	xdata=R.XLimWorld(1):R.DeltaX:R.XLimWorld(2); xdata=xdata(:);
+	xdata =(xdata(1:end-1)+xdata(2:end))/2;
+	ydata=R.YLimWorld(2):R.DeltaY:R.YLimWorld(1); ydata=flipud(ydata(:));
+	ydata =(ydata(1:end-1)+ydata(2:end))/2;
+else
+
+	%Get image info
+	Tinfo = imfinfo(howatpath);
+	N     = Tinfo.Width;
+	M     = Tinfo.Height;
+	dx    = Tinfo.ModelPixelScaleTag(1);
+	dy    = Tinfo.ModelPixelScaleTag(2);
+	minx  = Tinfo.ModelTiepointTag(4);
+	maxy  = Tinfo.ModelTiepointTag(5);
+
+	%Generate vectors
+	xdata = minx + dx/2 + ((0:N-1).*dx);
+	ydata = maxy - dy/2 - ((M  -1:-1:0).*dy);
+	ydata = fliplr(ydata);
+
+	%Get pixels we are interested in
+	offset=2;
+	xmin=min(X(:)); xmax=max(X(:));
+	posx=find(xdata<=xmax);
+	id1x=max(1,find(xdata>=xmin,1)-offset);
+	id2x=min(numel(xdata),posx(end)+offset);
+
+	if 0,
+		ymin=min(Y(:)); ymax=max(Y(:));
+		posy=find(ydata<=ymax);
+		id1y=max(1,find(ydata>=ymin,1)-offset);
+		id2y=min(numel(ydata),posy(end)+offset);
+	else
+		ymin=min(Y(:)); ymax=max(Y(:));
+		posy=find(ydata>=ymin);
+		id1y=max(1,find(ydata<=ymax,1)-offset);
+		id2y=min(numel(ydata),posy(end)+offset);
+	end
+
+	data  = double(imread(howatpath,'PixelRegion',{[id1y,id2y],[id1x,id2x]}));
+	xdata=xdata(id1x:id2x);
+	ydata=ydata(id1y:id2y);
+end
+
+sout = InterpFromGrid(xdata,ydata,data,X,Y);
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpGimpicemask.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpGimpicemask.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpGimpicemask.m	(revision 24313)
@@ -0,0 +1,69 @@
+function sout = interpGimpicemask(X,Y),
+
+switch oshostname(),
+	case {'ronne'}
+		howatpath='/home/ModelData/Greenland/gimpmask/GimpIceMask_90m.tif';
+	otherwise
+		error('machine not supported yet');
+end
+
+usemap = 0;
+if license('test','map_toolbox')==0,
+	disp('WARNING: map toolbox not installed, trying house code');
+	usemap = 0;
+elseif license('checkout','map_toolbox')==0
+	disp('WARNING: map toolbox not available (checkout failed), trying house code');
+	usemap = 0;
+end
+
+if usemap,
+	[data,R] = geotiffread(howatpath);
+	data=double(flipud(data));
+	xdata=R.XLimWorld(1):R.DeltaX:R.XLimWorld(2); xdata=xdata(:);
+	xdata =(xdata(1:end-1)+xdata(2:end))/2;
+	ydata=R.YLimWorld(2):R.DeltaY:R.YLimWorld(1); ydata=flipud(ydata(:));
+	ydata =(ydata(1:end-1)+ydata(2:end))/2;
+else
+
+	%Get image info
+	Tinfo = imfinfo(howatpath);
+	N     = Tinfo.Width;
+	M     = Tinfo.Height;
+	dx    = Tinfo.ModelPixelScaleTag(1);
+	dy    = Tinfo.ModelPixelScaleTag(2);
+	minx  = Tinfo.ModelTiepointTag(4);
+	maxy  = Tinfo.ModelTiepointTag(5);
+
+	%Generate vectors
+	xdata = minx + dx/2 + ((0:N-1).*dx);
+	ydata = maxy - dy/2 - ((M  -1:-1:0).*dy);
+	ydata = fliplr(ydata);
+
+	%Get pixels we are interested in
+	offset=2;
+	xmin=min(X(:)); xmax=max(X(:));
+	posx=find(xdata<=xmax);
+	id1x=max(1,find(xdata>=xmin,1)-offset);
+	id2x=min(numel(xdata),posx(end)+offset);
+
+	if 0,
+		ymin=min(Y(:)); ymax=max(Y(:));
+		posy=find(ydata<=ymax);
+		id1y=max(1,find(ydata>=ymin,1)-offset);
+		id2y=min(numel(ydata),posy(end)+offset);
+	else
+		ymin=min(Y(:)); ymax=max(Y(:));
+		posy=find(ydata>=ymin);
+		id1y=max(1,find(ydata<=ymax,1)-offset);
+		id2y=min(numel(ydata),posy(end)+offset);
+	end
+
+	data  = double(imread(howatpath,'PixelRegion',{[id1y,id2y],[id1x,id2x]}));
+	xdata=xdata(id1x:id2x);
+	ydata=ydata(id1y:id2y);
+end
+
+sout = InterpFromGrid(xdata,ydata,data,X,Y,'nearest');
+
+%Post process output (undefined = not ice)
+sout(find(sout==-9999))=0;
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpGimpoceanmask.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpGimpoceanmask.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpGimpoceanmask.m	(revision 24313)
@@ -0,0 +1,69 @@
+function sout = interpGimpoceanmask(X,Y),
+
+switch oshostname(),
+	case {'ronne'}
+		howatpath='/home/ModelData/Greenland/gimpmask/GimpOceanMask_90m.tif';
+	otherwise
+		error('machine not supported yet');
+end
+
+usemap = 0;
+if license('test','map_toolbox')==0,
+	disp('WARNING: map toolbox not installed, trying house code');
+	usemap = 0;
+elseif license('checkout','map_toolbox')==0
+	disp('WARNING: map toolbox not available (checkout failed), trying house code');
+	usemap = 0;
+end
+
+if usemap,
+	[data,R] = geotiffread(howatpath);
+	data=double(flipud(data));
+	xdata=R.XLimWorld(1):R.DeltaX:R.XLimWorld(2); xdata=xdata(:);
+	xdata =(xdata(1:end-1)+xdata(2:end))/2;
+	ydata=R.YLimWorld(2):R.DeltaY:R.YLimWorld(1); ydata=flipud(ydata(:));
+	ydata =(ydata(1:end-1)+ydata(2:end))/2;
+else
+
+	%Get image info
+	Tinfo = imfinfo(howatpath);
+	N     = Tinfo.Width;
+	M     = Tinfo.Height;
+	dx    = Tinfo.ModelPixelScaleTag(1);
+	dy    = Tinfo.ModelPixelScaleTag(2);
+	minx  = Tinfo.ModelTiepointTag(4);
+	maxy  = Tinfo.ModelTiepointTag(5);
+
+	%Generate vectors
+	xdata = minx + dx/2 + ((0:N-1).*dx);
+	ydata = maxy - dy/2 - ((M  -1:-1:0).*dy);
+	ydata = fliplr(ydata);
+
+	%Get pixels we are interested in
+	offset=2;
+	xmin=min(X(:)); xmax=max(X(:));
+	posx=find(xdata<=xmax);
+	id1x=max(1,find(xdata>=xmin,1)-offset);
+	id2x=min(numel(xdata),posx(end)+offset);
+
+	if 0,
+		ymin=min(Y(:)); ymax=max(Y(:));
+		posy=find(ydata<=ymax);
+		id1y=max(1,find(ydata>=ymin,1)-offset);
+		id2y=min(numel(ydata),posy(end)+offset);
+	else
+		ymin=min(Y(:)); ymax=max(Y(:));
+		posy=find(ydata>=ymin);
+		id1y=max(1,find(ydata<=ymax,1)-offset);
+		id2y=min(numel(ydata),posy(end)+offset);
+	end
+
+	data  = double(imread(howatpath,'PixelRegion',{[id1y,id2y],[id1x,id2x]}));
+	xdata=xdata(id1x:id2x);
+	ydata=ydata(id1y:id2y);
+end
+
+sout = InterpFromGrid(xdata,ydata,data,X,Y,'nearest');
+
+%Post process output (undefined = ocean)
+sout(find(sout==-9999))=1;
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpGridsCReSIS.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpGridsCReSIS.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpGridsCReSIS.m	(revision 24313)
@@ -0,0 +1,30 @@
+function output = interpGridsCReSIS(X,Y,filename),
+
+%Convert to lat/lon
+disp('   -- Griggs2013: converting coordinates');
+[LAT,  LON  ] = xy2ll(double(X(:)),double(Y(:)),+1,45,70);
+
+disp(['   -- GridsCReSIS: loading data']);
+if ~exist(filename)
+	error([filename ' does not exist']);
+end
+fid   = fopen(filename);
+for i=1:6,
+	thisline = fgetl(fid);
+	dummy    = regexp(thisline,'(\S+)','match');
+	if strcmp(dummy{1},'ncols'),       ncols=str2num(dummy{2}); end
+	if strcmp(dummy{1},'nrows'),       nrows=str2num(dummy{2}); end
+	if strcmp(dummy{1},'xllcorner'),    xllcorner=str2num(dummy{2}); end
+	if strcmp(dummy{1},'yllcorner'),    yllcorner=str2num(dummy{2}); end
+	if strcmp(dummy{1},'cellsize'),     cellsize=str2num(dummy{2}); end
+	if strcmp(dummy{1},'NODATA_value'), nodata=str2num(dummy{2}); end
+end
+data  = fscanf(fid,'%g %g %g %g %g',[ncols nrows])';
+fclose(fid);
+
+xdata=linspace(xllcorner+cellsize/2,xllcorner+cellsize/2+(ncols-1)*cellsize,ncols);
+ydata=linspace(yllcorner+cellsize/2,yllcorner+cellsize/2+(nrows-1)*cellsize,nrows);
+
+disp(['   -- GridsCReSIS: interpolating ']);
+output = InterpFromGrid(xdata,ydata,data,LAT,LON);
+output = reshape(output,size(X,1),size(X,2));
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpGriggs2013.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpGriggs2013.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpGriggs2013.m	(revision 24313)
@@ -0,0 +1,29 @@
+function output = interpGriggs2013(X,Y,string),
+
+disp('============================================');
+disp(' ');
+disp('WARNING: interpBamber2013 should now be used');
+disp(' ');
+disp('============================================');
+error('interpBamber2013 should now be used');
+griggs2013nc='/u/astrid-r1b/morlighe/issmjpl/proj-morlighem/DatasetGreenland/Data/Griggs2012/Greenland_bedrock_topography_and_geometry_062012_JGriggs.nc';
+verbose = 0;
+
+if nargout==2,
+	string = 'BedrockElevation';
+end
+
+%Convert to Bamber's projections
+if verbose, disp('   -- Griggs2013: converting coordinates'); end
+[LAT,  LON  ] = xy2ll(double(X(:)),double(Y(:)),+1,45,70);
+[x3971,y3971] = ll2xy(LAT,LON  ,+1,39,71);
+
+if verbose, disp('   -- Griggs2013: loading coordinates'); end
+xdata = double(ncread(griggs2013nc,'projection_x_coordinate'))*1000;
+ydata = double(ncread(griggs2013nc,'projection_y_coordinate'))*1000;
+
+if verbose, disp(['   -- Griggs2013: loading ' string]); end
+data  = double(ncread(griggs2013nc,string))';
+if verbose, disp(['   -- Griggs2013: interpolating ' string]); end
+output = InterpFromGrid(xdata,ydata,data,x3971,y3971);
+output = reshape(output,size(X,1),size(X,2));
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpIBCSO.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpIBCSO.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpIBCSO.m	(revision 24313)
@@ -0,0 +1,38 @@
+function [bedout sid] = interpIBCSO(X,Y),
+
+%read data
+switch (oshostname()),
+	case {'ronne'}
+		ncpath='/home/ModelData/Antarctica/IBCSO/ibcso_v1_bed.grd';
+		sidpath='/home/ModelData/Antarctica/IBCSO/ibcso_v1_sid.grd';
+	otherwise
+		error('hostname not supported yet');
+end
+
+disp('   -- IBCSO: loading bathymetry');
+x_range = double(ncread(ncpath,'x_range'));
+y_range = double(ncread(ncpath,'y_range'));
+spacing = double(ncread(ncpath,'spacing'));
+xdata = (x_range(1)-spacing(1)/2) : spacing(1) : (x_range(2)-spacing(1)/2); 
+ydata = (y_range(1)-spacing(2)/2) : spacing(2) : (y_range(2)-spacing(2)/2); 
+data  = double(ncread(ncpath,'z'));
+data(find(data==-9999 | isinf(data))) = NaN;
+data  = reshape(data,[numel(xdata) numel(ydata)])';
+disp('   -- IBCSO: interpolating bed');
+bedout = InterpFromGrid(xdata,fliplr(ydata),data,double(X),double(Y));
+
+if nargout==2,
+	disp('   -- IBCSO: bathymetry sid');
+	xdata = ncread(sidpath,'x');
+	ydata = ncread(sidpath,'y');
+	data  = ncread(sidpath,'z')';
+	disp('   -- IBCSO: transforming coordinates');
+	[LAT,LON] = xy2ll(double(X(:)),double(Y(:)),-1,0,71);
+	[x065,y065] = ll2xy(LAT,LON,-1,0,65);
+	x065 = reshape(x065,size(X));
+	y065 = reshape(y065,size(Y));
+	disp('   -- IBCSO: interpolating sids');
+	sid = InterpFromGrid(xdata,ydata,data,x065,y065,'nearest');
+	sid(find(sid<200000)) = 0;
+	sid(find(sid>399999)) = 0;
+end
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpJakobsson2012.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpJakobsson2012.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpJakobsson2012.m	(revision 24313)
@@ -0,0 +1,35 @@
+function [bedout sourceout] = interpJakobsson2012(X,Y,string),
+
+switch oshostname(),
+	case {'murdo','thwaites','astrid'}
+		ncpath ='/u/astrid-r1b/morlighe/issmjpl/proj-morlighem/DatasetGreenland/Data/IBCAO/IBCAO_V3_500m_RR.grd';
+	case {'ronne'}
+		ncpath ='/home/ModelData/Greenland/IBCAO/IBCAO_V3_500m_RR.grd';
+	otherwise
+		error('machine not supported yet');
+end
+
+%Convert to IBCAO projections
+disp('   -- Jakobsson2012: converting coordinates');
+[LAT,  LON  ] = xy2ll(double(X(:)),double(Y(:)),+1,45,70);
+[x0075,y0075] = ll2xy(LAT,LON,+1,0,75);
+
+disp('   -- Jakobsson2012: loading bathymetry');
+xdata = double(ncread(ncpath,'x'));
+ydata = double(ncread(ncpath,'y'));
+data  = double(ncread(ncpath,'z'))';
+
+disp('   -- Jakobsson2012: interpolating bed');
+bedout = InterpFromGrid(xdata,ydata,data,x0075,y0075);
+bedout = reshape(bedout,size(X,1),size(X,2));
+
+if nargout==2,
+	ncpath ='/home/ModelData/Greenland/IBCAO/IBCAO_V3_SID_500m.grd';
+	disp('   -- Jakobsson2012: loading source');
+	xdata = double(ncread(ncpath,'x'));
+	ydata = double(ncread(ncpath,'y'));
+	data  = double(ncread(ncpath,'z'))';
+	disp('   -- Jakobsson2012: interpolating source');
+	sourceout = InterpFromGrid(xdata,ydata,data,x0075,y0075,'nearest');
+	sourceout = reshape(sourceout,size(X,1),size(X,2));
+end
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpJoughin.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpJoughin.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpJoughin.m	(revision 24313)
@@ -0,0 +1,97 @@
+function [vxout vyout] = interpJoughin(X,Y,Date),
+	%Available dates:
+	% 2000 2005 2006 2007 2008
+
+switch oshostname(),
+	case {'murdo','thwaites','astrid'}
+		if nargin==3,
+			rootname = ['/u/astrid-r1b/morlighe/issmjpl/proj-morlighem/DatasetGreenland/Data/Vel/Joughin/' num2str(Date) '/'];
+		else
+			error('not supported');
+		end
+	case {'ronne'}
+		error('not supported');
+	otherwise
+		error('machine not supported yet');
+end
+verbose = 1;
+
+if ~exist(rootname,'dir'),
+	error(['file ' rootname ' not found']);
+end
+
+rootname = [rootname 'greenland_vel_mosaic500_' num2str(Date) '_' num2str(Date+1)];
+
+if verbose, disp('   -- Joughin: loading vx'); end
+[data,R] = geotiffread([rootname '_vx.tif']);
+pos=find(data<-10^9); data(pos)=NaN;
+data=double(flipud(data));
+xdata=R.XLimWorld(1):R.DeltaX:R.XLimWorld(2); xdata=xdata(:);
+xdata =(xdata(1:end-1)+xdata(2:end))/2;
+ydata=R.YLimWorld(2):R.DeltaY:R.YLimWorld(1); ydata=flipud(ydata(:));
+ydata =(ydata(1:end-1)+ydata(2:end))/2;
+if verbose, disp('   -- Joughin: interpolating vx'); end
+vxout = InterpFromGrid(xdata,ydata,data,X,Y);
+vxout = reshape(vxout,size(X,1),size(X,2));
+
+if verbose, disp('   -- Joughin: loading vy'); end
+[data,R] = geotiffread([rootname '_vy.tif']);
+pos=find(data<-10^9); data(pos)=NaN;
+data=double(flipud(data));
+xdata=R.XLimWorld(1):R.DeltaX:R.XLimWorld(2); xdata=xdata(:);
+xdata =(xdata(1:end-1)+xdata(2:end))/2;
+ydata=R.YLimWorld(2):R.DeltaY:R.YLimWorld(1); ydata=flipud(ydata(:));
+ydata =(ydata(1:end-1)+ydata(2:end))/2;
+if verbose, disp('   -- Joughin: interpolating vy'); end
+vyout = InterpFromGrid(xdata,ydata,data,X,Y);
+vyout = reshape(vyout,size(X,1),size(X,2));
+return
+
+% Get geodat info
+if verbose, disp('   -- Joughin: loading geodat info'); end
+xd=readgeodat(strcat(rootname,'.vx.geodat'));
+xmin=xd(3,1)*1000.+xd(2,1)/2;
+xmax=xd(3,1)*1000.+(xd(2,1)-1)*xd(1,1)+xd(2,1)/2;
+ymin=xd(3,2)*1000.+xd(2,2)/2;
+ymax=xd(3,2)*1000.+(xd(2,2)-1)*xd(1,2)+xd(2,2)/2;
+%xmin=xd(3,1)*1000.;
+%xmax=xd(3,1)*1000.+(xd(2,1)-1)*xd(1,1);
+%ymin=xd(3,2)*1000.;
+%ymax=xd(3,2)*1000.+(xd(2,2)-1)*xd(1,2);
+xdata=linspace(xmin,xmax,xd(1,1));
+ydata=linspace(ymin,ymax,xd(1,2));
+
+% Vx component
+if verbose, disp('   -- Joughin: loading vx'); end
+fid = fopen(strcat(rootname,'.vx'),'r','ieee-be');
+[data,count]=fread(fid,[xd(1,1) xd(1,2)],'float32');
+fclose(fid);
+
+if verbose, disp('   -- Joughin: interpolating vx'); end
+vxout = InterpFromGrid(xdata,ydata,data',X,Y);
+vxout = reshape(vxout,size(X,1),size(X,2));
+
+% Vy component
+fid = fopen(strcat(rootname,'.vy'),'r','ieee-be');
+[data,count]=fread(fid,[xd(1,1) xd(1,2)],'float32');
+fclose(fid);
+vyout = InterpFromGrid(xdata,ydata,data',X,Y);
+vyout = reshape(vyout,size(X,1),size(X,2));
+
+end
+
+function xgeo=readgeodat(filein)
+% Read a geodat file
+fid = fopen(filein,'r');
+xgeo=zeros(3,2);
+i=1;
+while ~feof(fid),
+	line=fgets(fid);
+	[A,count]=sscanf(line,'%f %f',[1 2]);
+	if(count == 2) 
+		xgeo(i,:)=A;
+		i=i+1;
+	end
+end
+fclose(fid);
+end
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpJoughinCompositeGreenland.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpJoughinCompositeGreenland.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpJoughinCompositeGreenland.m	(revision 24313)
@@ -0,0 +1,32 @@
+function [vxout vyout] = interpJoughinCompositeGreenland(X,Y),
+
+%data=load(['/u/astrid-r1b/morlighe/issmjpl/proj-morlighem/DatasetGreenland/Data/VelJoughin/IanGreenVel.mat']);
+filename = '/home/ModelData/Greenland/VelJoughin/IanGreenVel.mat';
+
+%Figure out what subset of the matrix should be read
+load(filename,'x_m','y_m');
+velfile = matfile(filename);
+
+offset=2;
+
+xmin=min(X(:)); xmax=max(X(:));
+posx=find(x_m<=xmax);
+id1x=max(1,find(x_m>=xmin,1)-offset);
+id2x=min(numel(x_m),posx(end)+offset);
+
+ymin=min(Y(:)); ymax=max(Y(:));
+posy=find(y_m>=ymin);
+id1y=max(1,find(y_m<=ymax,1)-offset);
+id2y=min(numel(y_m),posy(end)+offset);
+
+vx = velfile.vx(id1y:id2y,id1x:id2x);
+vy = velfile.vy(id1y:id2y,id1x:id2x);
+x = x_m(id1x:id2x);
+y = y_m(id1y:id2y);
+
+vxout = InterpFromGrid(x,y,double(vx),X,Y);
+vyout = InterpFromGrid(x,y,double(vy),X,Y);
+
+if nargout==1,
+	vxout = sqrt(vxout.^2+vyout.^2);
+end
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpJoughinMosaic.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpJoughinMosaic.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpJoughinMosaic.m	(revision 24313)
@@ -0,0 +1,34 @@
+function [vxout vyout] = interpJoughinMosaic(X,Y),
+
+switch oshostname(),
+	case {'ronne'}
+		filename = '/home/ModelData/Greenland/VelJoughin/IanGreenVel.mat';
+	otherwise
+		error('machine not supported yet');
+end
+verbose = 1;
+
+%Figure out what subset of the matrix should be read
+load(filename,'x_m','y_m');
+velfile = matfile(filename);
+
+offset=2;
+
+xmin=min(X(:)); xmax=max(X(:));
+posx=find(x_m<=xmax);
+id1x=max(1,find(x_m>=xmin,1)-offset);
+id2x=min(numel(x_m),posx(end)+offset);
+
+ymin=min(Y(:)); ymax=max(Y(:));
+posy=find(y_m>=ymin);
+id1y=max(1,find(y_m<=ymax,1)-offset);
+id2y=min(numel(y_m),posy(end)+offset);
+
+vx = velfile.vx(id1y:id2y,id1x:id2x);
+vy = velfile.vy(id1y:id2y,id1x:id2x);
+x_m = x_m(id1x:id2x);
+y_m = y_m(id1y:id2y);
+
+%load(filename);
+vxout = InterpFromGrid(x_m,y_m,vx,X,Y);
+vyout = InterpFromGrid(x_m,y_m,vy,X,Y);
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAnt2016.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAnt2016.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAnt2016.m	(revision 24313)
@@ -0,0 +1,46 @@
+function [vxout vyout]= interpMouginotAnt2016(X,Y),
+
+%read data
+switch (oshostname()),
+	case {'ronne'}
+		filename = '/home/ModelData/Antarctica/MouginotVel/vel_ant_5Apr2016.mat';
+	case {'thwaites','murdo','astrid'}
+		filename = '/u/astrid-r1b/ModelData/RignotAntarcticaVelMosaic450m/vel_ant_5Apr2016.mat';
+	otherwise
+		error('hostname not supported yet');
+end
+
+%Figure out what subset of the matrix should be read
+load(filename,'x','y');
+velfile = matfile(filename);
+
+offset=2;
+
+xmin=min(X(:)); xmax=max(X(:));
+posx=find(x<=xmax);
+id1x=max(1,find(x>=xmin,1)-offset);
+id2x=min(numel(x),posx(end)+offset);
+
+if y(2)-y(1)<0
+	ymin=min(Y(:)); ymax=max(Y(:));
+	posy=find(y>=ymin);
+	id1y=max(1,find(y<=ymax,1)-offset);
+	id2y=min(numel(y),posy(end)+offset);
+else
+	ymin=min(X(:)); ymax=max(X(:));
+	posy=find(y<=ymax);
+	id1y=max(1,find(y>=ymin,1)-offset);
+	id2y=min(numel(y),posy(end)+offset);
+end
+
+vx = velfile.vx(id1y:id2y,id1x:id2x);
+vy = velfile.vy(id1y:id2y,id1x:id2x);
+x = x(id1x:id2x);
+y = y(id1y:id2y);
+
+vxout = InterpFromGrid(x,y,double(vx),X,Y);
+vyout = InterpFromGrid(x,y,double(vy),X,Y);
+
+if nargout==1,
+	vxout = sqrt(vxout.^2+vyout.^2);
+end
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAnt2017.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAnt2017.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAnt2017.m	(revision 24313)
@@ -0,0 +1,39 @@
+function [vxout vyout]= interpMouginotAnt2017(X,Y),
+
+%read data
+switch (oshostname()),
+	case {'ronne'}
+		nc = '/home/ModelData/Antarctica/MouginotVel/vel_nsidc.CF16_2.nc';
+	otherwise
+		error('hostname not supported yet');
+end
+
+xdata = double(ncread(nc,'x'));
+ydata = double(ncread(nc,'y'));
+
+offset=2;
+
+xmin=min(X(:)); xmax=max(X(:));
+posx=find(xdata<=xmax);
+id1x=max(1,find(xdata>=xmin,1)-offset);
+id2x=min(numel(xdata),posx(end)+offset);
+
+ymin=min(Y(:)); ymax=max(Y(:));
+posy=find(ydata>=ymin);
+id1y=max(1,find(ydata<=ymax,1)-offset);
+id2y=min(numel(ydata),posy(end)+offset);
+
+disp(['   -- Mouginot 2017: loading velocities']);
+vxdata = double(ncread(nc,'VX',[id1x id1y],[id2x-id1x+1 id2y-id1y+1],[1 1]))';
+vydata = double(ncread(nc,'VY',[id1x id1y],[id2x-id1x+1 id2y-id1y+1],[1 1]))';
+xdata=xdata(id1x:id2x);
+ydata=ydata(id1y:id2y);
+
+disp(['   -- Mouginot 2017: interpolating ']);
+vxout = InterpFromGrid(xdata,ydata,vxdata,double(X),double(Y));
+vyout = InterpFromGrid(xdata,ydata,vydata,double(X),double(Y));
+
+%return vel if only one output is requested
+if nargout==1,
+	vxout = sqrt(vxout.^2+vyout.^2);
+end
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAnt2019.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAnt2019.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAnt2019.m	(revision 24313)
@@ -0,0 +1,39 @@
+function [vxout vyout]= interpMouginotAnt2019(X,Y),
+
+%read data
+switch (oshostname()),
+	case {'ronne'}
+		nc = '/home/ModelData/Antarctica/MouginotVel/v_mix.v13Mar2019.nc';
+	otherwise
+		error('hostname not supported yet');
+end
+
+xdata = double(ncread(nc,'x'));
+ydata = double(ncread(nc,'y'));
+
+offset=2;
+
+xmin=min(X(:)); xmax=max(X(:));
+posx=find(xdata<=xmax);
+id1x=max(1,find(xdata>=xmin,1)-offset);
+id2x=min(numel(xdata),posx(end)+offset);
+
+ymin=min(Y(:)); ymax=max(Y(:));
+posy=find(ydata>=ymin);
+id1y=max(1,find(ydata<=ymax,1)-offset);
+id2y=min(numel(ydata),posy(end)+offset);
+
+disp(['   -- Mouginot 2017: loading velocities']);
+vxdata = double(ncread(nc,'VX',[id1x id1y],[id2x-id1x+1 id2y-id1y+1],[1 1]))';
+vydata = double(ncread(nc,'VY',[id1x id1y],[id2x-id1x+1 id2y-id1y+1],[1 1]))';
+xdata=xdata(id1x:id2x);
+ydata=ydata(id1y:id2y);
+
+disp(['   -- Mouginot 2017: interpolating ']);
+vxout = InterpFromGrid(xdata,ydata,vxdata,double(X),double(Y));
+vyout = InterpFromGrid(xdata,ydata,vydata,double(X),double(Y));
+
+%return vel if only one output is requested
+if nargout==1,
+	vxout = sqrt(vxout.^2+vyout.^2);
+end
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAntTimeSeries1973to2018.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAntTimeSeries1973to2018.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpMouginotAntTimeSeries1973to2018.m	(revision 24313)
@@ -0,0 +1,160 @@
+function [vxout vyout]= interpMouginotAntTimeSeries1973to2018(X,Y,T)
+%INTERPMOUGINOTANTTIMESERIES1973TO2018 - interpolate observed (time series) velocities 
+%
+%   Inputs
+%      X,Y: spatial (scatter) coordinates
+%      T: time (indexed by YEAR1 (YEAR2 is optional); see below) 
+%
+%   Outputs
+%      vxout,vyout: interpolated velocities at X,Y, for each time requested in T
+%
+%   Available time series:
+%
+%          YEAR1  YEAR2
+%    1     1973   1975
+%    2     1973   1984
+%    3     1973   1988
+%    4     1984   1988
+%    5     1986   1988
+%    6     1988   1990
+%    7     1991   1992
+%    8     1995   1996
+%    9     2000   2001
+%   10     2002   2003
+%   11     2003   2004
+%   12     2005   2006
+%   13     2006   2007
+%   14     2007   2008
+%   15     2008   2009
+%   16     2009   2010
+%   17     2010   2011
+%   18     2011   2012
+%   19     2012   2013
+%   20     2013   2014
+%   21     2014   2015
+%   22     2015   2016
+%   23     2016   2017
+%   24     2017   2018
+%
+%   Usage:
+%      T refers to YEAR1, but the user can also use YEAR2 (e.g., the "1973" case in YEAR1).
+%  
+%      Then, these codes generate the same results:
+%
+%      [vxout vyout]= interpMouginotAntTimeSeries1973to2018(md.mesh.x,md.mesh.y,[1986; 1991; 1995; 2000]);
+%      [vxout vyout]= interpMouginotAntTimeSeries1973to2018(md.mesh.x,md.mesh.y,[1986 1988; 1991 1992; 1995 1996; 2000 2001]);
+%
+%      Another example:
+%      [vxout vyout]= interpMouginotAntTimeSeries1973to2018(md.mesh.x,md.mesh.y,[1973 1975; 1973 1988; 1991 1992; 2011 2012]);
+
+%read data
+switch (oshostname()),
+	case {'ronne'}
+		nc = '/home/ModelData/Antarctica/MouginotVel/ASE_TimeSeries_1973-2018.nc';
+	otherwise
+		error('hostname not supported yet');
+end
+
+xdata = double(ncread(nc,'x'));
+ydata = double(ncread(nc,'y'));
+year1 = ncread(nc,'YEAR1');
+year2 = ncread(nc,'YEAR2');
+
+% get the positions related to T
+if nargin==3
+	% initial checks %{{{
+	if size(T,2)>2 | size(T,1)<1 | size(T,2)<1,
+		error('Size of input T not supported!');
+	end
+	if size(T,2)==1 & any(T(:,1)==1973),
+		disp(' ');
+		disp('   Found year=1973 in T (array). Please, specify the data series using a second index.');
+		disp('   Data available for 1973:');
+		disp('      1973   1975');
+		disp('      1973   1984');
+		disp('      1973   1988');
+		disp(' ');
+		disp('   Usage:');
+		disp('      [vxout vyout]= interpMouginotAntTimeSeries1973to2018(md.mesh.x,md.mesh.y,[1973 1975; 1973 1988; 1991 1992; 2011 2012])');
+		disp(' ');
+		error('   Change input T before continuing.');
+	end %}}}
+	pos = [];
+	for i=1:size(T,1),
+		flag = (T(i,1)==year1);
+		if size(T,2)==2, % ok, check both indexes (year1 and year2)
+			flag = (T(i,1)==year1).*(T(i,2)==year2);
+		end
+		pos = [pos; find(flag)];
+	end
+	% check again {{{
+	if length(pos)~=size(T,1) | length(unique(pos))~=length(pos),
+		disp(' ');
+		disp('   Time resquested does not exist in data set or is repeated!');
+		disp('   Data resquested:');
+		for i=1:length(T(:,1)),
+			str = ['      ' int2str(T(i,1)) '   '];
+			if size(T,2)==2, % ok, check both indexes (year1 and year2)
+				str = [str int2str(T(i,2))];
+			end
+			disp(str);
+		end
+		disp(' ');
+		disp('   Data available (24 series):');
+		for i=1:length(year1),
+			str = ['      ' int2str(year1(i)) '   ' int2str(year2(i))];
+			disp(str);
+		end
+		disp(' ');
+		disp('   Usage:');
+		disp('      [vxout vyout]= interpMouginotAntTimeSeries1973to2018(md.mesh.x,md.mesh.y,[1986; 1991; 1995; 2000])');
+		disp('      [vxout vyout]= interpMouginotAntTimeSeries1973to2018(md.mesh.x,md.mesh.y,[1986 1988; 1991 1992; 1995 1996; 2000 2001])');
+		disp('      [vxout vyout]= interpMouginotAntTimeSeries1973to2018(md.mesh.x,md.mesh.y,[1973 1975; 1973 1988; 1991 1992; 2011 2012])');
+		disp(' ');
+		error('   Change input T before continuing.');
+	end%}}}
+elseif nargin<3,
+	pos = 1:24; % all available data		
+else
+	error('nargin not supported yet!');
+end
+
+% get the spatial positions
+offset=2;
+
+xmin=min(X(:)); xmax=max(X(:));
+posx=find(xdata<=xmax);
+id1x=max(1,find(xdata>=xmin,1)-offset);
+id2x=min(numel(xdata),posx(end)+offset);
+
+ymin=min(Y(:)); ymax=max(Y(:));
+posy=find(ydata>=ymin);
+id1y=max(1,find(ydata<=ymax,1)-offset);
+id2y=min(numel(ydata),posy(end)+offset);
+
+disp(['   -- Mouginot Time Series 1973 to 2018: loading velocities']);
+vxdata = [];
+vydata = [];
+for i=1:length(pos), 
+	disp(['      step = ' int2str(i) '/' int2str(length(pos)) ', position = ' int2str(pos(i)) ', year = '  int2str(year1(pos(i))) ' - ' int2str(year2(pos(i)))]);
+	vx = double(ncread(nc,'VX',[id1x id1y pos(i)],[id2x-id1x+1 id2y-id1y+1 1],[1 1 1]));
+	vy = double(ncread(nc,'VY',[id1x id1y pos(i)],[id2x-id1x+1 id2y-id1y+1 1],[1 1 1]));
+	vxdata(:,:,i) = permute(vx,[2 1 3]);
+	vydata(:,:,i) = permute(vy,[2 1 3]);
+end
+xdata=xdata(id1x:id2x);
+ydata=ydata(id1y:id2y);
+
+disp(['   -- Mouginot Time Series 1973 to 2018: interpolating']);
+vxout = [];
+vyout = [];
+for i=1:length(pos),
+	disp(['      step = ' int2str(i) '/' int2str(length(pos)) ', position = ' int2str(pos(i)) ', year = '  int2str(year1(pos(i))) ' - ' int2str(year2(pos(i)))]);
+	vxout = [vxout InterpFromGrid(xdata,ydata,vxdata(:,:,i),double(X),double(Y))];
+	vyout = [vyout InterpFromGrid(xdata,ydata,vydata(:,:,i),double(X),double(Y))];
+end
+
+%return vel if only one output is requested
+if nargout==1,
+	vxout = sqrt(vxout.^2+vyout.^2);
+end
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpPaolo2015.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpPaolo2015.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpPaolo2015.m	(revision 24313)
@@ -0,0 +1,187 @@
+function [dh_raw_out dh_fil_out T_out] = interpPaolo2015(X,Y,T,method)
+%INTERPPAOLO2015 - interpolate observed (time series) height change [m]
+%
+%   Inputs
+%      X,Y: spatial (scatter) coordinates
+%      T: time (see below the available years) 
+%      ATTENTION: it is assumed that X and Y come in Polar Stereographic Projection (Std Latitude: 71S Meridian: 0E)
+%
+%   Outputs
+%      dh_raw_out: interpolated raw height change at X,Y, for each time requested in T
+%      dh_fil_out: interpolated filtered height change at X,Y, for each time requested in T
+%      T_out: time related to dh_raw_out and dh_fil_out (see below)
+%
+%   Available time series:
+%
+% 		 1		 1994.038
+% 		 2		 1994.285
+% 		 3		 1994.534
+% 		 4		 1994.786
+% 		 5		 1995.038
+% 		 6		 1995.285
+% 		 7		 1995.534
+% 		 8		 1995.786
+% 		 9		 1996.038
+% 		10		 1996.287
+% 		11		 1996.536
+% 		12		 1996.787
+% 		13		 1997.038
+% 		14		 1997.285
+% 		15		 1997.534
+% 		16		 1997.786
+% 		17		 1998.038
+% 		18		 1998.285
+% 		19		 1998.534
+% 		20		 1998.786
+% 		21		 1999.038
+% 		22		 1999.285
+% 		23		 1999.534
+% 		24		 1999.786
+% 		25		 2000.038
+% 		26		 2000.287
+% 		27		 2000.536
+% 		28		 2000.787
+% 		29		 2001.038
+% 		30		 2001.285
+% 		31		 2001.534
+% 		32		 2001.786
+% 		33		 2002.038
+% 		34		 2002.285
+% 		35		 2002.534
+% 		36		 2002.786
+% 		37		 2003.038
+% 		38		 2003.285
+% 		39		 2003.534
+% 		40		 2003.786
+% 		41		 2004.038
+% 		42		 2004.287
+% 		43		 2004.536
+% 		44		 2004.787
+% 		45		 2005.038
+% 		46		 2005.285
+% 		47		 2005.534
+% 		48		 2005.786
+% 		49		 2006.038
+% 		50		 2006.285
+% 		51		 2006.534
+% 		52		 2006.786
+% 		53		 2007.038
+% 		54		 2007.285
+% 		55		 2007.534
+% 		56		 2007.786
+% 		57		 2008.038
+% 		58		 2008.287
+% 		59		 2008.536
+% 		60		 2008.787
+% 		61		 2009.038
+% 		62		 2009.285
+% 		63		 2009.534
+% 		64		 2009.786
+% 		65		 2010.038
+% 		66		 2010.285
+% 		67		 2010.534
+% 		68		 2010.786
+% 		69		 2011.038
+% 		70		 2011.285
+% 		71		 2011.534
+% 		72		 2011.786
+%
+%
+%   Usage:
+%      % Get data at specific time:
+%      % In this example, T_out = [2006.038; 2007.038; 2008.038].
+%      [dh_raw_out dh_fil_out T_out] = interpPaolo2015(md.mesh.x, md.mesh.y, [2006.038; 2007.038; 2008.038]);
+%
+% 		 % Get all data in the provided years:
+%      % In this example, T_out = [2006.038; 2006.285; 2006.534; 2006.786; 2007.038; 2007.285; 2007.534; 2007.786]. 
+%      [dh_raw dh_fil T_out] = interpPaolo2015(md.mesh.x, md.mesh.y, [2006; 2007]);
+%
+% 		 % Get all data set:
+%      % In this example, T_out = [1994.038; ... ; 2011.786]. (all available time)
+%      [dh_raw dh_fil T_out] = interpPaolo2015(md.mesh.x, md.mesh.y);
+%
+%
+%   Info from ice_shelf_dh_v1.h5:	
+%      The dataset is a rectangular grid (480 points in x, 80 points in y) with x- and y-axes being longitude and latitude, respectively.
+%      Longitude/latitude coordinates refer to the center of the grid cells.
+%      The grid has a resolution of lon x lat: 0.75 x 0.25 deg (~27 km at latitude -71).
+%
+%
+%   Data are (grids in HDF5, ice_shelf_dh_v1.h5):
+%      time         : time coordinate [year; 72 values at 3-month time step]
+%      lon          : x-coordinate [degrees east; range 0/360]
+%      lat          : y-coordinate [degrees north; range -82/-62]
+%      height_raw   : Raw time series of height change [m]     
+%      height_filt  : Filtered time series of height change [m]
+%      height_err   : 2-standard-error time series [m]
+%
+
+if nargin>4 | nargin<2,
+	error('nargin not supported yet!');
+end
+
+% read data
+switch (oshostname()),
+	case {'ronne'}
+		h5 = '/home/ModelData/Antarctica/Paolo2015/ice_shelf_dh_v1.h5';
+	otherwise
+		error('hostname not supported yet');
+end
+
+disp(['   -- Paolo''s Time Series 1994 to 2012: loading data set']);
+t_data = h5read(h5,'/time');
+lat_data = h5read(h5,'/lat');
+lon_data = h5read(h5,'/lon');
+dh_raw_data = h5read(h5,'/height_raw');
+dh_fil_data = h5read(h5,'/height_filt');
+
+% set interpolation method
+if nargin<4,
+	method = 'linear'; % default method
+end
+
+% get the positions related to T
+if nargin<3,
+	pos = 1:length(t_data); % all available data		
+else
+	% initial check %{{{
+	if size(T,2)>1 | size(T,1)<1 | size(T,2)<1,
+		error('Size of input T not supported!');
+	end %}}}
+	% Loop over T
+	pos = [];
+	epsilon = 5e-4;
+	for i=1:length(T),
+		% find specific time
+		flag = (T(i)-epsilon<t_data & T(i)+epsilon>t_data);
+		if ~any(flag), 
+			% ok, find the time related to the requested year
+			flag = (T(i)==floor(t_data));
+		end
+		if ~any(flag)
+			error(['requested time (' num2str(T(i)) ') not found in data set'])
+		end
+		pos = [pos; find(flag)];
+	end
+	% Check if there is repeated positions
+	posunique = unique(pos);
+	if length(posunique)~=length(pos),
+		disp('   WARNING: found repeated positions in requested time');
+	end
+end
+
+% convert x/y to lat/lon:
+[LAT, LON] = xy2ll(X,Y,-1); % attention: it is assumed that X and Y comes in Polar Stereographic Projection (Std Latitude: 71S Meridian: 0E)
+posLON = find(LON<0);
+LON(posLON) =360+LON(posLON);
+
+disp(['   -- Paolo''s Time Series 1994 to 2012: interpolating in Lat/Long grid']);
+dh_raw_out = [];
+dh_fil_out = [];
+for i=1:length(pos),
+	disp(['      step = ' int2str(i) '/' int2str(length(pos)) ', position = ' int2str(pos(i)) ', year = '  num2str(t_data(pos(i)))]);
+	dh_raw_out = [dh_raw_out InterpFromGrid(lat_data(1,:),lon_data(:,1),dh_raw_data(:,:,pos(i)),LAT,LON,method)];
+	dh_fil_out = [dh_fil_out InterpFromGrid(lat_data(1,:),lon_data(:,1),dh_fil_data(:,:,pos(i)),LAT,LON,method)];
+end
+
+T_out = t_data(pos);
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpRACMO1km.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpRACMO1km.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpRACMO1km.m	(revision 24313)
@@ -0,0 +1,35 @@
+function [output] = interpRACMO1km(X,Y),
+
+switch oshostname(),
+	case {'ronne'}
+		rootname='/home/ModelData/Greenland/RACMO2_1km/SMB_MEAN1960-1989_150m.nc';
+	otherwise
+		error('machine not supported yet');
+end
+verbose = 1;
+
+xdata = double(ncread(rootname,'xaxis'));
+ydata = double(ncread(rootname,'yaxis'));
+
+offset=2;
+
+xmin=min(X(:)); xmax=max(X(:));
+posx=find(xdata<=xmax);
+id1x=max(1,find(xdata>=xmin,1)-offset);
+id2x=min(numel(xdata),posx(end)+offset);
+
+ymin=min(Y(:)); ymax=max(Y(:));
+posy=find(ydata<=ymax);
+id1y=max(1,find(ydata>=ymin,1)-offset);
+id2y=min(numel(ydata),posy(end)+offset);
+
+if verbose, disp('   -- RACMO 1-km: reading smb'); end
+data  = double(ncread(rootname,'SMB',[id1x id1y],[id2x-id1x+1 id2y-id1y+1],[1 1]))';
+xdata=xdata(id1x:id2x);
+ydata=ydata(id1y:id2y);
+data(find(data==-9999))=NaN;
+
+if verbose, disp('   -- RACMO 1-km: interpolating (assuming rho_ice = 917 kg/m^3)'); end
+%converting from mm / yr water eq to m/yr ice eq
+data = data/1000 * 1000/917;
+output = InterpFromGrid(xdata,ydata,data,double(X),double(Y));
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpRACMOant.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpRACMOant.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpRACMOant.m	(revision 24313)
@@ -0,0 +1,11 @@
+function smb = interpRACMOant(x,y);
+
+	smbfile = '/home/ModelData/Antarctica/RACMO2SMB/SMB_RACMO2.3_1979_2011.nc';
+	LAT=ncread(smbfile,'lat2d')';
+	LON=ncread(smbfile,'lon2d')';
+	SMB=ncread(smbfile,'SMB')';
+	[X Y]=ll2xy(LAT,LON,-1,0,71);
+
+	disp('   -- RACMO2.3 1979 - 2011: interpolating (assuming rho_ice = 917 kg/m^3)');
+	rho_ice = 917;
+	smb = griddata(X,Y,SMB,x,y) / 917;
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpREMA.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpREMA.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpREMA.m	(revision 24313)
@@ -0,0 +1,62 @@
+function sout = interpREMA(X,Y),
+
+switch oshostname(),
+	case {'ronne'}
+		remapath='/home/ModelData/Antarctica/REMA/REMA_200m_dem_filled.tif';
+	otherwise
+		error('machine not supported yet');
+end
+
+usemap = 0;
+if license('test','map_toolbox')==0,
+	disp('WARNING: map toolbox not installed, trying house code');
+	usemap = 0;
+elseif license('checkout','map_toolbox')==0
+	disp('WARNING: map toolbox not available (checkout failed), trying house code');
+	usemap = 0;
+end
+
+if usemap,
+	[data,R] = geotiffread(remapath);
+	data=double(flipud(data));
+	xdata=R.XLimWorld(1):R.DeltaX:R.XLimWorld(2); xdata=xdata(:);
+	xdata =(xdata(1:end-1)+xdata(2:end))/2;
+	ydata=R.YLimWorld(2):R.DeltaY:R.YLimWorld(1); ydata=flipud(ydata(:));
+	ydata =(ydata(1:end-1)+ydata(2:end))/2;
+else
+
+	%Get image info
+	Tinfo = imfinfo(remapath);
+	N     = Tinfo.Width;
+	M     = Tinfo.Height;
+	dx    = Tinfo.ModelPixelScaleTag(1);
+	dy    = Tinfo.ModelPixelScaleTag(2);
+	minx  = Tinfo.ModelTiepointTag(4);
+	maxy  = Tinfo.ModelTiepointTag(5);
+
+	%Generate vectors
+	xdata = minx + dx/2 + ((0:N-1).*dx);
+	ydata = maxy - dy/2 - ((M  -1:-1:0).*dy);
+	ydata = fliplr(ydata);
+
+	%Get pixels we are interested in
+	offset=2;
+	xmin=min(X(:)); xmax=max(X(:));
+	posx=find(xdata<=xmax);
+	id1x=max(1,find(xdata>=xmin,1)-offset);
+	id2x=min(numel(xdata),posx(end)+offset);
+
+	ymin=min(Y(:)); ymax=max(Y(:));
+	posy=find(ydata>=ymin);
+	id1y=max(1,find(ydata<=ymax,1)-offset);
+	id2y=min(numel(ydata),posy(end)+offset);
+
+	data  = double(imread(remapath,'PixelRegion',{[id1y,id2y],[id1x,id2x]}));
+	xdata=xdata(id1x:id2x);
+	ydata=ydata(id1y:id2y);
+end
+
+%convert no coverage data
+data(find(data==-9999))=NaN;
+
+sout = InterpFromGrid(xdata,ydata,data,X,Y);
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpRTopo2.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpRTopo2.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpRTopo2.m	(revision 24313)
@@ -0,0 +1,59 @@
+function [output] = interpRTopo2(X,Y,varargin),
+%INTERPRTOPO2 - interp from RTOPO-2 onto X and Y
+%
+%   Usage:
+%      bed = interpRTopo2(X,Y,varargin),
+%
+%   varargin = 1 (Greenland), default
+%             -1 (Antarctica)
+
+switch oshostname(),
+	case {'ronne'}
+		rootname='/home/ModelData/Global/RTopo-2/RTopo-2.0.1_30sec_bedrock_topography.nc';
+	otherwise
+		error('machine not supported yet');
+end
+verbose = 1;
+
+if nargin==3,
+	hemisphere = varargin{1};
+else
+	hemisphere = +1;
+end
+if abs(hemisphere)~=1,
+	error('hemisphere should be +/-1');
+end
+
+if hemisphere==+1,
+	if verbose, disp('   -- RTopo-2: convert to lat/lon using Greenland projection'); end
+	[LAT,  LON  ] = xy2ll(double(X(:)),double(Y(:)),+1,45,70);
+else
+	if verbose, disp('   -- RTopo-2: convert to lat/lon using Antarctica projection'); end
+	[LAT,  LON  ] = xy2ll(double(X(:)),double(Y(:)),-1,0,71);
+end
+
+Y=reshape(LAT,size(X)); X=reshape(LON,size(X));
+
+xdata = double(ncread(rootname,'lon'));
+ydata = double(ncread(rootname,'lat'));
+
+offset=2;
+
+xmin=min(X(:)); xmax=max(X(:));
+posx=find(xdata<=xmax);
+id1x=max(1,find(xdata>=xmin,1)-offset);
+id2x=min(numel(xdata),posx(end)+offset);
+
+ymin=min(Y(:)); ymax=max(Y(:));
+posy=find(ydata<=ymax);
+id1y=max(1,find(ydata>=ymin,1)-offset);
+id2y=min(numel(ydata),posy(end)+offset);
+
+if verbose, disp('   -- RTopo-2: reading bed topography'); end
+data  = double(ncread(rootname,'bedrock_topography',[id1x id1y],[id2x-id1x+1 id2y-id1y+1],[1 1]))';
+xdata=xdata(id1x:id2x);
+ydata=ydata(id1y:id2y);
+data(find(data==-9999))=NaN;
+
+if verbose, disp('   -- RTopo-2: interpolating'); end
+output = InterpFromGrid(xdata,ydata,data,double(X),double(Y));
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpRignot2012.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpRignot2012.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpRignot2012.m	(revision 24313)
@@ -0,0 +1,36 @@
+function [vxout vyout]= interpRignot2012(X,Y),
+
+filename = '/home/ModelData/Greenland/VelMouginot/RignotGreenland2012Vel.mat';
+
+
+%Figure out what subset of the matrix should be read
+load(filename,'x','y');
+velfile = matfile(filename);
+
+offset=2;
+
+xmin=min(X(:)); xmax=max(X(:));
+posx=find(x<=xmax);
+id1x=max(1,find(x>=xmin,1)-offset);
+id2x=min(numel(x),posx(end)+offset);
+
+ymin=min(Y(:)); ymax=max(Y(:));
+%posy=find(y>=ymin);
+%id1y=max(1,find(y<=ymax,1)-offset);
+%id2y=min(numel(y),posy(end)+offset);
+posy=find(y<=ymax);
+id1y=max(1,find(y>=ymin,1)-offset);
+id2y=min(numel(y),posy(end)+offset);
+
+vx = velfile.vx(id1y:id2y,id1x:id2x);
+vy = velfile.vy(id1y:id2y,id1x:id2x);
+x = x(id1x:id2x);
+y = y(id1y:id2y);
+
+%load(filename);
+vxout = InterpFromGrid(x,y,double(vx),X,Y);
+vyout = InterpFromGrid(x,y,double(vy),X,Y);
+
+if nargout==1,
+	vxout = sqrt(vxout.^2+vyout.^2);
+end
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpRignotIceShelfMelt.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpRignotIceShelfMelt.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpRignotIceShelfMelt.m	(revision 24313)
@@ -0,0 +1,25 @@
+function output = interpRignotIceShelfMelt(X,Y,string),
+
+switch (oshostname()),
+	case {'ronne'}
+		rignotmelt='/home/ModelData/Antarctica/RignotMeltingrate/Ant_MeltingRate.nc';
+	case {'thwaites','murdo','astrid'}
+		rignotmelt=['/home/seroussi/Data/Ant_MeltingRate.nc'];
+	otherwise
+		error('hostname not supported yet');
+end
+
+if nargin==2,
+	string = 'melt_actual';
+end
+
+disp(['   -- Rignot Ice Shelf Melt: loading ' string]);
+xdata = double(ncread(rignotmelt,'xaxis'));
+ydata = double(ncread(rignotmelt,'yaxis'));
+
+disp(['   -- Rignot Ice Shelf Melt: loading' string]);
+data  = double(ncread(rignotmelt,string))';
+
+disp(['   -- Rignot Ice Shelf Melt: interpolating ' string]);
+output = InterpFromGrid(xdata,ydata,data,X(:),Y(:));
+output = reshape(output,size(X,1),size(X,2));
Index: /issm/trunk/src/m/contrib/morlighem/modeldata/interpSeaRISE.m
===================================================================
--- /issm/trunk/src/m/contrib/morlighem/modeldata/interpSeaRISE.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/morlighem/modeldata/interpSeaRISE.m	(revision 24313)
@@ -0,0 +1,80 @@
+function [dataout] = interpSeaRISE(X,Y,string,varargin),
+%INTERPSEARISE - interpolate SeaRISE data
+%
+%   Available data:
+%      1.  sealeveltimes
+%      2.  dhdt
+%      3.  surfvelmag
+%      4.  balvelmag
+%      5.  oisotopestimes
+%      6.  bheatflx
+%      7.  presprcp
+%      8.  sealevel_time_series
+%      9.  usrf
+%      10. mapping
+%      11. surfvely
+%      12. surfvelx
+%      13. topg
+%      14. landcover
+%      15. temp_time_series
+%      16. thk
+%      17. time
+%      18. oisotopes_time_series
+%      19. runoff
+%      20. smb
+%      21. airtemp2m
+%      22. surftemp
+%
+%   Usage:
+%      [dataout] = interpBedmap2(X,Y,string)
+
+verbose=0;
+
+if nargin==3,
+	hemisphere = +1;
+else
+	hemisphere = varargin{1};
+end
+
+
+%read data
+switch (oshostname()),
+	case {'ronne'}
+		if hemisphere==1,
+			searisenc='/home/ModelData/SeaRISE/Greenland_5km_dev1.2.nc';
+		elseif hemisphere==-1,
+			searisenc='/home/ModelData/SeaRISE/Antarctica_5km_dev1.0.nc';
+		end
+	case {'thwaites','murdo','astrid'}
+		if hemisphere==1,
+			searisenc='/u/astrid-r1b/ModelData/SeaRISE/Greenland5km_v1.2/Greenland_5km_dev1.2.nc';
+		elseif hemisphere==-1,
+			searisenc='/u/astrid-r1b/ModelData/SeaRISE/Antarctica5km_shelves_v1.0/Antarctica_5km_dev1.0.nc';
+		end
+	otherwise
+		error('hostname not supported yet');
+end
+
+%convert coordinates to SeaRISE projection
+if verbose, disp('   -- SeaRISE: converting coordinates'); end
+if hemisphere==1,
+	[LAT,  LON  ] = xy2ll(double(X(:)),double(Y(:)),+1,45,70);
+	[xproj,yproj] = ll2xy(LAT,LON  ,+1,39,71);
+elseif hemisphere==-1,
+	xproj=X; yproj=Y;
+end
+
+if verbose, disp('   -- SeaRISE: loading coordinates'); end
+xdata = double(ncread(searisenc,'x1'));%*1000;
+ydata = double(ncread(searisenc,'y1'));%*1000;
+
+if verbose, disp(['   -- SeaRISE: loading ' string]); end
+data  = double(ncread(searisenc,string))';
+
+if verbose, disp(['   -- SeaRISE: interpolating ' string]); end
+if strcmpi(string,'LandMask');
+	dataout = InterpFromGrid(xdata,ydata,data,xproj,yproj,'nearest');
+else
+	dataout = InterpFromGrid(xdata,ydata,data,xproj,yproj);
+end
+dataout = reshape(dataout,size(X,1),size(X,2));
Index: /issm/trunk/src/m/contrib/tsantos/mismip/if_position.m
===================================================================
--- /issm/trunk/src/m/contrib/tsantos/mismip/if_position.m	(revision 24313)
+++ /issm/trunk/src/m/contrib/tsantos/mismip/if_position.m	(revision 24313)
@@ -0,0 +1,199 @@
+function [ifx ify] = if_position(md,step,level),
+
+		if(~isfield(md.results.TransientSolution,'MaskIceLevelset'))
+			ifx=[];
+			ify=[];
+			return
+		end
+
+		%initialization of some variables
+		data						= md.results.TransientSolution(step).MaskIceLevelset;
+		if(isfield(md.results.TransientSolution,'MeshElements'))
+			index					= md.results.TransientSolution(step).MeshElements;
+			x						= md.results.TransientSolution(step).MeshX;
+			y						= md.results.TransientSolution(step).MeshY;
+		else
+			index					= md.mesh.elements;
+			x						= md.mesh.x;
+			y						= md.mesh.y;
+		end
+		numberofelements		= size(index,1);
+		elementslist			= 1:numberofelements;
+		c							= [];
+		h							= [];
+
+		%get unique edges in mesh
+		%1: list of edges
+		edges=[index(:,[1,2]); index(:,[2,3]); index(:,[3,1])];
+		%2: find unique edges
+		[edges,I,J]=unique(sort(edges,2),'rows');
+		%3: unique edge numbers
+		vec=J;
+		%4: unique edges numbers in each triangle (2 triangles sharing the same edge will have
+		%   the same edge number)
+		edges_tria=[vec(elementslist), vec(elementslist+numberofelements), vec(elementslist+2*numberofelements)];
+
+		%segments [nodes1 nodes2]
+		Seg1=index(:,[1 2]);
+		Seg2=index(:,[2 3]);
+		Seg3=index(:,[3 1]);
+
+		%segment numbers [1;4;6;...]
+		Seg1_num=edges_tria(:,1);
+		Seg2_num=edges_tria(:,2);
+		Seg3_num=edges_tria(:,3);
+
+		%value of data on each tips of the segments
+		Data1=data(Seg1);
+		Data2=data(Seg2);
+		Data3=data(Seg3);
+
+		%get the ranges for each segment
+		Range1=sort(Data1,2);
+		Range2=sort(Data2,2);
+		Range3=sort(Data3,2);
+
+		%find the segments that contain this value
+		pos1=(Range1(:,1)<level & Range1(:,2)>level);
+		pos2=(Range2(:,1)<level & Range2(:,2)>level);
+		pos3=(Range3(:,1)<level & Range3(:,2)>level);
+
+		%get elements
+		poselem12=(pos1 & pos2);
+		poselem13=(pos1 & pos3);
+		poselem23=(pos2 & pos3);
+		poselem=find(poselem12 | poselem13 | poselem23);
+		numelems=length(poselem);
+
+		%if no element has been flagged, skip to the next level
+		if numelems==0,
+			return,
+		end
+
+		%go through the elements and build the coordinates for each segment (1 by element)
+		x1=zeros(numelems,1);
+		x2=zeros(numelems,1);
+		y1=zeros(numelems,1);
+		y2=zeros(numelems,1);
+		edge_l=zeros(numelems,2);
+
+		for j=1:numelems,
+
+			weight1=(level-Data1(poselem(j),1))/(Data1(poselem(j),2)-Data1(poselem(j),1));
+			weight2=(level-Data2(poselem(j),1))/(Data2(poselem(j),2)-Data2(poselem(j),1));
+			weight3=(level-Data3(poselem(j),1))/(Data3(poselem(j),2)-Data3(poselem(j),1));
+
+			if poselem12(poselem(j));
+
+				x1(j)=x(Seg1(poselem(j),1))+weight1*(x(Seg1(poselem(j),2))-x(Seg1(poselem(j),1)));
+				x2(j)=x(Seg2(poselem(j),1))+weight2*(x(Seg2(poselem(j),2))-x(Seg2(poselem(j),1)));
+				y1(j)=y(Seg1(poselem(j),1))+weight1*(y(Seg1(poselem(j),2))-y(Seg1(poselem(j),1)));
+				y2(j)=y(Seg2(poselem(j),1))+weight2*(y(Seg2(poselem(j),2))-y(Seg2(poselem(j),1)));
+				edge_l(j,1)=Seg1_num(poselem(j));
+				edge_l(j,2)=Seg2_num(poselem(j));
+
+			elseif poselem13(poselem(j)),
+
+				x1(j)=x(Seg1(poselem(j),1))+weight1*(x(Seg1(poselem(j),2))-x(Seg1(poselem(j),1)));
+				x2(j)=x(Seg3(poselem(j),1))+weight3*(x(Seg3(poselem(j),2))-x(Seg3(poselem(j),1)));
+				y1(j)=y(Seg1(poselem(j),1))+weight1*(y(Seg1(poselem(j),2))-y(Seg1(poselem(j),1)));
+				y2(j)=y(Seg3(poselem(j),1))+weight3*(y(Seg3(poselem(j),2))-y(Seg3(poselem(j),1)));
+				edge_l(j,1)=Seg1_num(poselem(j));
+				edge_l(j,2)=Seg3_num(poselem(j));
+
+			elseif poselem23(poselem(j)),
+
+				x1(j)=x(Seg2(poselem(j),1))+weight2*(x(Seg2(poselem(j),2))-x(Seg2(poselem(j),1)));
+				x2(j)=x(Seg3(poselem(j),1))+weight3*(x(Seg3(poselem(j),2))-x(Seg3(poselem(j),1)));
+				y1(j)=y(Seg2(poselem(j),1))+weight2*(y(Seg2(poselem(j),2))-y(Seg2(poselem(j),1)));
+				y2(j)=y(Seg3(poselem(j),1))+weight3*(y(Seg3(poselem(j),2))-y(Seg3(poselem(j),1)));
+				edge_l(j,1)=Seg2_num(poselem(j));
+				edge_l(j,2)=Seg3_num(poselem(j));
+			else
+				%it shoud not go here
+			end
+		end
+
+		%now that we have the segments, we must try to connect them...
+
+		%loop over the subcontours
+		indice=0;
+		while ~isempty(edge_l),
+			indice=indice+1;
+
+			%take the right edge of the second segment and connect it to the next segments if any
+			e1=edge_l(1,1);   e2=edge_l(1,2);
+			xc=[x1(1);x2(1)]; yc=[y1(1);y2(1)];
+
+			%erase the lines corresponding to this edge
+			edge_l(1,:)=[];
+			x1(1)=[]; x2(1)=[];
+			y1(1)=[]; y2(1)=[];
+
+			[ro1,co1]=find(edge_l==e1);
+
+			while ~isempty(ro1)
+
+				if co1==1,
+					xc=[x2(ro1);xc]; yc=[y2(ro1);yc];
+
+					%next edge:
+					e1=edge_l(ro1,2);
+
+				else
+					xc=[x1(ro1);xc]; yc=[y1(ro1);yc];
+
+					%next edge:
+					e1=edge_l(ro1,1);
+				end
+
+				%erase the lines of this
+				edge_l(ro1,:)=[];
+				x1(ro1)=[]; x2(ro1)=[];
+				y1(ro1)=[]; y2(ro1)=[];
+
+				%next connection
+				[ro1,co1]=find(edge_l==e1);
+			end
+
+			%same thing the other way (to the right)
+			[ro2,co2]=find(edge_l==e2);
+
+			while ~isempty(ro2)
+
+				if co2==1,
+					xc=[xc;x2(ro2)]; yc=[yc;y2(ro2)];
+
+					%next edge:
+					e2=edge_l(ro2,2);
+				else
+					xc=[xc;x1(ro2)]; yc=[yc;y1(ro2)];
+
+					%next edge:
+					e2=edge_l(ro2,1);
+				end
+
+				%erase the lines of this
+				edge_l(ro2,:)=[];
+				x1(ro2)=[]; x2(ro2)=[];
+				y1(ro2)=[]; y2(ro2)=[];
+
+				%next connection
+				[ro2,co2]=find(edge_l==e2);
+			end
+
+			% Update the CS data structure as per "contours.m"
+			% so that clabel works
+			c = horzcat(c,[level, xc'; length(xc), yc']);
+	%		y0=find(c(2,:)==0);
+	%		y50=find(c(2,:)==50000);
+	%		gl0(glstep)=c(1,y0);
+	%		gl50(glstep)=c(1,y50);
+	ifx=c(1,1:end)';
+	ify=c(2,1:end)';
+	pos=find(ifx~=0);
+	ifx=ifx(pos);
+	ify=ify(pos);
+
+end
+	%min(c(1,2:end))
Index: /issm/trunk/src/m/coordsystems/gmtmask.py
===================================================================
--- /issm/trunk/src/m/coordsystems/gmtmask.py	(revision 24312)
+++ /issm/trunk/src/m/coordsystems/gmtmask.py	(revision 24313)
@@ -5,76 +5,77 @@
 import subprocess
 
-def gmtmask(lat,long,*varargin):
-#GMTMASK - figure out which lat,long points are on the ocean
-#
-#   Usage:
-#      mask.ocean = gmtmask(md.mesh.lat,md.mesh.long);
-#
-	lenlat=len(lat)
-	mask=np.empty(lenlat)
-	
-	#are we doing a recursive call? 
-	if len(varargin)==3:
-		recursive=1
-	else:
-		recursive=0
 
-	if recursive:
-		print '             recursing: num vertices #'+str(lenlat)
-	else:
-		print 'gmtmask: num vertices #'+str(lenlat)
-	
-	#Check lat and long size is not more than 50,000 If so, recursively call gmtmask: 
+def gmtmask(lat, long, * varargin):
+    '''GMTMASK - figure out which lat, long points are on the ocean
 
-	if lenlat>50000:
-		for i in range(int(ceil(lenlat/50000))):
-			j=(i+1)*50000-1
-			if j>lenlat:
-				j=lenlat
-			mask[i:j]=gmtmask(lat[i:j],long[i:j],1)
-		return mask
-	
-	
-	#First, write our lat,long file for gmt:
-	nv=lenlat
-	np.savetxt('./all_vertices.txt',np.transpose([long, lat, np.arange(1,nv+1)]),delimiter='\t',fmt='%.10f')
+    Usage:
+      mask.ocean = gmtmask(md.mesh.lat, md.mesh.long)
+    '''
+    lenlat = len(lat)
+    mask = np.empty(lenlat)
 
-	#Avoid bypassing of the ld library path by Matlab (:()
-	try:
-		issmdir
-	except:
-		issmdir=getenv('ISSM_DIR')
-	try:
-		ismac
-	except:
-		ismac=False	
+    #are we doing a recursive call?
+    if len(varargin) == 3:
+        recursive = 1
+    else:
+        recursive = 0
 
-	if ismac:
-		dyld_library_path_old=getenv('DYLD_LIBRARY_PATH')
-		putenv('DYLD_LIBRARY_PATH',issmdir+'/externalpackages/curl/install/lib:'+issmdir+'/externalpackages/hdf5/install/lib:'+issmdir+'/externalpackages/netcdf/install/lib')
-		
-	#figure out which vertices are on the ocean, which one on the continent:
-	subprocess.call(issmdir+'/externalpackages/gmt/install/bin/gmt gmtselect ./all_vertices.txt -h0 -Df -R0/360/-90/90  -A0 -JQ180/200 -Nk/s/s/k/s > ./oce_vertices.txt',shell=True)
+    if recursive:
+        print(('             recursing: num vertices  #' + str(lenlat)))
+    else:
+        print(('gmtmask: num vertices  #' + str(lenlat)))
 
-	#reset DYLD_LIBRARY_PATH to what it was: 
-	if ismac:
-		putenv('DYLD_LIBRARY_PATH',dyld_library_path_old)
-	
-	#read the con_vertices.txt file and flag our mesh vertices on the continent
-	fid=open('./oce_vertices.txt','r')
-	line=fid.readline()
-	line=fid.readline()
-	oce_vertices=[]
-	while line:
-		ind=int(float(line.split()[2]))-1;
-		oce_vertices.append(ind)
-		line=fid.readline()
-	fid.close()
+    #Check lat and long size is not more than 50, 000 If so, recursively call gmtmask:
 
-	mask=np.zeros(nv)
-	mask[oce_vertices]=1
-	
-	subprocess.call('rm -rf ./all_vertices.txt ./oce_vertices.txt ./gmt.history',shell=True)
-	if not recursive:
-		print 'gmtmask: done'
-	return mask
+    if lenlat > 50000:
+        for i in range(int(ceil(lenlat / 50000))):
+            j = (i + 1) * 50000 - 1
+            if j > lenlat:
+                j = lenlat
+            mask[i:j] = gmtmask(lat[i:j], int[i:j], 1)
+        return mask
+
+    #First, write our lat, long file for gmt:
+    nv = lenlat
+    #print(np.transpose([int, lat, np.arange(1, nv + 1)]))
+    np.savetxt('./all_vertices.txt', np.transpose([long, lat, np.arange(1, nv + 1)]), delimiter='\t', fmt='%.10f')
+
+    #Avoid bypassing of the ld library path by Matlab (:()
+    try:
+        issmdir
+    except NameError:
+        issmdir = getenv('ISSM_DIR')
+    try:
+        ismac
+    except NameError:
+        ismac = False
+
+    if ismac:
+        dyld_library_path_old = getenv('DYLD_LIBRARY_PATH')
+        putenv('DYLD_LIBRARY_PATH', issmdir + '/externalpackages/curl/install/lib:' + issmdir + '/externalpackages/hdf5/install/lib:' + issmdir + '/externalpackages/netcdf/install/lib')
+
+    #figure out which vertices are on the ocean, which one on the continent:
+    subprocess.call(issmdir + '/externalpackages/gmt/install/bin/gmt gmtselect ./ all_vertices.txt -h0 -Df -R0/360/-90/90 -A0 -JQ180/200 -Nk/s/s/k/s > ./oce_vertices.txt', shell=True)
+
+    #reset DYLD_LIBRARY_PATH to what it was:
+    if ismac:
+        putenv('DYLD_LIBRARY_PATH', dyld_library_path_old)
+
+    #read the con_vertices.txt file and flag our mesh vertices on the continent
+    fid = open('./oce_vertices.txt', 'r')
+    line = fid.readline()
+    line = fid.readline()
+    oce_vertices = []
+    while line:
+        ind = int(float(line.split()[2])) - 1
+        oce_vertices.append(ind)
+        line = fid.readline()
+    fid.close()
+
+    mask = np.zeros(nv)
+    mask[oce_vertices] = 1
+
+    subprocess.call('rm -rf ./all_vertices.txt ./oce_vertices.txt ./gmt.history', shell=True)
+    if not recursive:
+        print('gmtmask: done')
+    return mask
Index: /issm/trunk/src/m/coordsystems/ll2xy.m
===================================================================
--- /issm/trunk/src/m/coordsystems/ll2xy.m	(revision 24312)
+++ /issm/trunk/src/m/coordsystems/ll2xy.m	(revision 24313)
@@ -1,6 +1,6 @@
-function [x,y,scale_factor] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel)  
+function [x,y,scale_factor] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel)
 %LL2XY - converts lat long to polar stereographic
 %
-%   Converts from geodetic latitude and longitude to Polar 
+%   Converts from geodetic latitude and longitude to Polar
 %   Stereographic (X,Y) coordinates for the polar regions.
 %   Optional scale factor provides the scaling factor needed to correct projection error
@@ -13,6 +13,6 @@
 %      [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)
 
 %Get central_meridian and standard_parallel depending on hemisphere
@@ -55,5 +55,5 @@
 T = tan(pi/4-latitude/2) ./ ((1-ex*sin(latitude))./(1+ex*sin(latitude))).^(ex/2);
 
-if (90 - slat) <  1.e-5 
+if (90 - slat) <  1.e-5
 	rho = 2.*re*T/sqrt((1.+ex)^(1.+ex)*(1.-ex)^(1.-ex));
 else
Index: /issm/trunk/src/m/coordsystems/ll2xy.py
===================================================================
--- /issm/trunk/src/m/coordsystems/ll2xy.py	(revision 24312)
+++ /issm/trunk/src/m/coordsystems/ll2xy.py	(revision 24313)
@@ -1,62 +1,63 @@
-import numpy as  np 
+import numpy as np
 
-def ll2xy(lat,lon,sgn=-1,central_meridian=0,standard_parallel=71):
-	'''
-	LL2XY - converts lat lon to polar stereographic
 
-   Converts from geodetic latitude and longitude to Polar 
-   Stereographic (X,Y) coordinates for the polar regions.
+def ll2xy(lat, lon, sgn=-1, central_meridian=0, standard_parallel=71):
+    '''
+    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)
 
    Usage:
-      x,y = ll2xy(lat,lon,sgn)
-      x,y = ll2xy(lat,lon,sgn,central_meridian,standard_parallel)
+      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'
+    assert sgn == 1 or sgn == -1, 'error: sgn should be either 1 or -1'
 
-	#Get central_meridian and standard_parallel depending on hemisphere
-	if sgn == 1:
-		delta = 45
-		slat = 70
-		print '		ll2xy: creating coordinates in north polar stereographic (Std Latitude: 70N Meridian: 45)'
-	else: 
-		delta = central_meridian
-		slat = standard_parallel
-		print '		ll2xy: creating coordinates in south polar stereographic (Std Latitude: 71S Meridian: 0)'
-	
-	# Conversion constant from degrees to radians
-	cde = 57.29577951
-	# Radius of the earth in meters
-	re = 6378.273*10**3
-	# Eccentricity of the Hughes ellipsoid squared
-	ex2 = .006693883
-	# Eccentricity of the Hughes ellipsoid
-	ex = np.sqrt(ex2)
-	
-	latitude = np.abs(lat) * np.pi/180.
-	longitude = (lon + delta) * np.pi/180.
-	
-	# compute X and Y in grid coordinates.
-	T = np.tan(np.pi/4-latitude/2) / ((1-ex*np.sin(latitude))/(1+ex*np.sin(latitude)))**(ex/2)
-	
-	if (90 - slat) <  1.e-5:
-		rho = 2.*re*T/np.sqrt((1.+ex)**(1.+ex)*(1.-ex)**(1.-ex))
-	else:
-		sl  = slat*np.pi/180.
-		tc  = np.tan(np.pi/4.-sl/2.)/((1.-ex*np.sin(sl))/(1.+ex*np.sin(sl)))**(ex/2.)
-		mc  = np.cos(sl)/np.sqrt(1.0-ex2*(np.sin(sl)**2))
-		rho = re*mc*T/tc
-	
-	y = -rho * sgn * np.cos(sgn*longitude)
-	x =  rho * sgn * np.sin(sgn*longitude)
+    #Get central_meridian and standard_parallel depending on hemisphere
+    if sgn == 1:
+        delta = 45
+        slat = 70
+        print('        ll2xy: creating coordinates in north polar stereographic (Std Latitude: 70N Meridian: 45)')
+    else:
+        delta = central_meridian
+        slat = standard_parallel
+        print('        ll2xy: creating coordinates in south polar stereographic (Std Latitude: 71S Meridian: 0)')
 
-	cnt1=np.nonzero(latitude>= np.pi/2.)[0]
-	
-	if cnt1:
-		x[cnt1,0] = 0.0
-		y[cnt1,0] = 0.0
-	return x,y
+    # Conversion constant from degrees to radians
+    #cde = 57.29577951
+    # Radius of the earth in meters
+    re = 6378.273 * 10**3
+    # Eccentricity of the Hughes ellipsoid squared
+    ex2 = .006693883
+    # Eccentricity of the Hughes ellipsoid
+    ex = np.sqrt(ex2)
+
+    latitude = np.abs(lat) * np.pi / 180.
+    longitude = (lon + delta) * np.pi / 180.
+
+    # compute X and Y in grid coordinates.
+    T = np.tan(np.pi / 4 - latitude / 2) / ((1 - ex * np.sin(latitude)) / (1 + ex * np.sin(latitude)))**(ex / 2)
+
+    if (90 - slat) < 1.e-5:
+        rho = 2. * re * T / np.sqrt((1. + ex)**(1. + ex) * (1. - ex)**(1. - ex))
+    else:
+        sl = slat * np.pi / 180.
+        tc = np.tan(np.pi / 4. - sl / 2.) / ((1. - ex * np.sin(sl)) / (1. + ex * np.sin(sl)))**(ex / 2.)
+        mc = np.cos(sl) / np.sqrt(1.0 - ex2 * (np.sin(sl)**2))
+        rho = re * mc * T / tc
+
+    y = -rho * sgn * np.cos(sgn * longitude)
+    x = rho * sgn * np.sin(sgn * longitude)
+
+    cnt1 = np.nonzero(latitude >= np.pi / 2.)[0]
+
+    if cnt1:
+        x[cnt1, 0] = 0.0
+        y[cnt1, 0] = 0.0
+    return x, y
Index: /issm/trunk/src/m/coordsystems/xy2ll.m
===================================================================
--- /issm/trunk/src/m/coordsystems/xy2ll.m	(revision 24312)
+++ /issm/trunk/src/m/coordsystems/xy2ll.m	(revision 24313)
@@ -14,6 +14,6 @@
 %      [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
@@ -29,5 +29,5 @@
 		disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 71ºS Meridian: 0º)');
 	else
-		error('Sign should be either +1 or -1');
+		error('Sign should be either 1 or -1');
 	end
 else
@@ -78,5 +78,5 @@
 lon = lon * 180. / pi;
 lat = lat * 180. / pi;
-lon = lon - delta; 
+lon = lon - delta;
 if nargout==3,
 	m=((1+sin(abs(slat)*pi/180))*ones(length(lat),1)./(1+sin(abs(lat)*pi/180)));
Index: /issm/trunk/src/m/coordsystems/xy2ll.py
===================================================================
--- /issm/trunk/src/m/coordsystems/xy2ll.py	(revision 24312)
+++ /issm/trunk/src/m/coordsystems/xy2ll.py	(revision 24313)
@@ -1,82 +1,81 @@
-import numpy as  np
+import numpy as np
 from math import pi
 
+
 def xy2ll(x, y, sgn, *args):
-	'''
-	XY2LL - converts xy to lat long
-	
-	Converts Polar  Stereographic (X, Y) coordinates for the polar regions to
-	latitude and longitude Stereographic (X, Y) coordinates for the polar
-	regions.
-	Author: Michael P. Schodlok, December 2003 (map2xy.m)
-	
-	Usage:
-	   [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)
-	'''
+    '''
+    XY2LL - converts xy to lat long
 
-	#Get central_meridian and standard_parallel depending on hemisphere
-	if len(args) == 2:
-		delta = args[0]
-		slat  = args[1]
-	elif len(args) == 0:
-		if sgn == 1:
-			delta = 45. 
-			slat = 70.
-			print '		xy2ll: creating coordinates in north polar stereographic (Std Latitude: 70degN Meridian: 45deg)'
-		elif sgn == -1:
-			delta = 0.  
-			slat = 71.
-			print '		xy2ll: creating coordinates in south polar stereographic (Std Latitude: 71degS Meridian: 0deg)'
-		else:
-			raise ValueError('sgn should be either +1 or -1')
-	else:
-		raise StandardError('bad usage: type "help(xy2ll)" for details')
+    Converts Polar  Stereographic (X, Y) coordinates for the polar regions to
+    latitude and longitude Stereographic (X, Y) coordinates for the polar
+    regions.
+    Author: Michael P. Schodlok, December 2003 (map2xy.m)
 
-	# if x,y passed as lists, convert to np.arrays
-	if type(x) != "np.ndarray":
-		x=np.array(x)
-	if type(y) != "np.ndarray":
-		y=np.array(y)
+    Usage:
+       [lat, lon] = xy2ll(x, y, sgn)
+       [lat, lon] = xy2ll(x, y, sgn, central_meridian, standard_parallel)
 
-	## Conversion constant from degrees to radians
-	cde = 57.29577951
-	## Radius of the earth in meters
-	re = 6378.273*10**3
-	## Eccentricity of the Hughes ellipsoid squared
-	ex2 = .006693883
-	## Eccentricity of the Hughes ellipsoid
-	ex = np.sqrt(ex2)
-	
-	sl = slat*pi/180.
-	rho = np.sqrt(x**2 + y**2)
-	cm = np.cos(sl) / np.sqrt(1.0 - ex2 * (np.sin(sl)**2))
-	T = np.tan((pi/4.0) - (sl/2.0)) / ((1.0 - ex*np.sin(sl)) / (1.0 + ex*np.sin(sl)))**(ex / 2.0)
-	
-	if abs(slat-90.) < 1.e-5:
-		T = rho*np.sqrt((1. + ex)**(1. + ex) * (1. - ex)**(1. - ex)) / 2. / re
-	else:
-		T = rho * T / (re * cm)
-	
-	chi = (pi / 2.0) - 2.0 * np.arctan(T)
-	lat = chi + ((ex2 / 2.0) + (5.0 * ex2**2.0 / 24.0) + (ex2**3.0 / 12.0)) * \
-		np.sin(2 * chi) + ((7.0 * ex2**2.0 / 48.0) + (29.0 * ex2**3 / 240.0)) * \
-		np.sin(4.0 * chi) + (7.0 * ex2**3.0 / 120.0) * np.sin(6.0 * chi) 
-	
-	lat = sgn * lat
-	lon = np.arctan2(sgn * x,-sgn * y)
-	lon = sgn * lon
-	
-	res1 = np.nonzero(rho <= 0.1)[0]
-	if len(res1) > 0:
-		lat[res1] = pi/2. * sgn
-		lon[res1] = 0.0
-	
-	lon = lon * 180. / pi
-	lat = lat * 180. / pi
-	lon = lon - delta 
+     - sgn = Sign of latitude	1 : north latitude (default is mer = 45 lat = 70)
+     						   -1 : south latitude (default is mer = 0  lat = 71)
+    '''
 
-	return lat, lon
+    #Get central_meridian and standard_parallel depending on hemisphere
+    if len(args) == 2:
+        delta = args[0]
+        slat = args[1]
+    elif len(args) == 0:
+        if sgn == 1:
+            delta = 45.
+            slat = 70.
+            print('        xy2ll: creating coordinates in north polar stereographic (Std Latitude: 70degN Meridian: 45deg)')
+        elif sgn == -1:
+            delta = 0.
+            slat = 71.
+            print('        xy2ll: creating coordinates in south polar stereographic (Std Latitude: 71degS Meridian: 0deg)')
+        else:
+            raise ValueError('sgn should be either 1 or -1')
+    else:
+        raise Exception('bad usage: type "help(xy2ll)" for details')
+
+    # if x, y passed as lists, convert to np.arrays
+    if type(x) != "np.ndarray":
+        x = np.array(x)
+    if type(y) != "np.ndarray":
+        y = np.array(y)
+
+    # Conversion constant from degrees to radians
+    #cde = 57.29577951
+    # Radius of the earth in meters
+    re = 6378.273 * 10**3
+    # Eccentricity of the Hughes ellipsoid squared
+    ex2 = .006693883
+    # Eccentricity of the Hughes ellipsoid
+    ex = np.sqrt(ex2)
+
+    sl = slat * pi / 180.
+    rho = np.sqrt(x**2 + y**2)
+    cm = np.cos(sl) / np.sqrt(1.0 - ex2 * (np.sin(sl)**2))
+    T = np.tan((pi / 4.0) - (sl / 2.0)) / ((1.0 - ex * np.sin(sl)) / (1.0 + ex * np.sin(sl)))**(ex / 2.0)
+
+    if abs(slat - 90.) < 1.e-5:
+        T = rho * np.sqrt((1. + ex)**(1. + ex) * (1. - ex)**(1. - ex)) / 2. / re
+    else:
+        T = rho * T / (re * cm)
+
+    chi = (pi / 2.0) - 2.0 * np.arctan(T)
+    lat = chi + ((ex2 / 2.0) + (5.0 * ex2**2.0 / 24.0) + (ex2**3.0 / 12.0)) * np.sin(2 * chi) + ((7.0 * ex2**2.0 / 48.0) + (29.0 * ex2**3 / 240.0)) * np.sin(4.0 * chi) + (7.0 * ex2**3.0 / 120.0) * np.sin(6.0 * chi)
+
+    lat = sgn * lat
+    lon = np.arctan2(sgn * x, -sgn * y)
+    lon = sgn * lon
+
+    res1 = np.nonzero(rho <= 0.1)[0]
+    if len(res1) > 0:
+        lat[res1] = pi / 2. * sgn
+        lon[res1] = 0.0
+
+    lon = lon * 180. / pi
+    lat = lat * 180. / pi
+    lon = lon - delta
+
+    return lat, lon
Index: /issm/trunk/src/m/dev/ISSM.py
===================================================================
--- /issm/trunk/src/m/dev/ISSM.py	(revision 24312)
+++ /issm/trunk/src/m/dev/ISSM.py	(revision 24313)
@@ -1,4 +1,3 @@
-print 'WARNING: EXPERIMENTAL FEATURE ISSM.py: universal Python ISSM import'
-
+print('WARNING: EXPERIMENTAL FEATURE ISSM.py: universal Python ISSM import')
 #Most common imports
 import numpy as np
@@ -39,33 +38,37 @@
 from dmeth_params_write import *
 
+
 #Helper functions
 def python_help():
-	'''Prints out key code fragments that may be useful to users'''
-	print 'Differences between Python and Matlab code:'
-	#...
+    '''Prints out key code fragments that may be useful to users'''
+    print('Differences between Python and Matlab code:')
+    #...
+
 
 def find(to_find):
-	'''analagous to matlab's find function but requires separate and/or functions'''
-	return np.array(np.where(to_find))
+    '''analagous to matlab's find function but requires separate and / or functions'''
+    return np.array(np.where(to_find))
+
 
 def find_and(*args):
-	'''analagous to matlab's a & b functionality when used in conjunction with find(),
-		returns overlap across a and b
-		takes an arbitrary number of arguments of similar shape'''
-	result = args[0]
-	for arg in args[1:]:
-		if type(arg) != np.ndarray:
-			arg = np.array(arg)
-		result = np.intersect1d(result,arg)
-	return result
+    '''analagous to matlab's a & b functionality when used in conjunction with find(),
+        returns overlap across a and b
+        takes an arbitrary number of arguments of similar shape'''
+    result = args[0]
+    for arg in args[1:]:
+        if type(arg) != np.ndarray:
+            arg = np.array(arg)
+        result = np.intersect1d(result, arg)
+    return result
+
 
 def find_or(*args):
-	'''analagous to matlab's a | b functionality when used in conjunction with find(),
-		returns all unique values across a and b
-		takes an arbitrary number of arguments of similar shape'''
-	result = args[0]
-	for arg in args[1:]:
-		if type(arg) != np.ndarray:
-			arg = np.array(arg)
-		result = np.unique(np.concatenate((result,arg)))
-	return result
+    '''analagous to matlab's a | b functionality when used in conjunction with find(),
+        returns all unique values across a and b
+        takes an arbitrary number of arguments of similar shape'''
+    result = args[0]
+    for arg in args[1:]:
+        if type(arg) != np.ndarray:
+            arg = np.array(arg)
+        result = np.unique(np.concatenate((result, arg)))
+    return result
Index: /issm/trunk/src/m/dev/devpath.py
===================================================================
--- /issm/trunk/src/m/dev/devpath.py	(revision 24312)
+++ /issm/trunk/src/m/dev/devpath.py	(revision 24313)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
-import os,sys
+import os
+import sys
 import warnings
 
@@ -6,32 +7,35 @@
 ISSM_DIR = os.getenv('ISSM_DIR')
 USERNAME = os.getenv('USER')
-JPL_SVN  = os.getenv('JPL_SVN')
-if(ISSM_DIR==None):
-	raise NameError('"ISSM_DIR" environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!')
+JPL_SVN = os.getenv('JPL_SVN')
+if ISSM_DIR is None:
+    raise NameError('"ISSM_DIR" environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!')
 
-#Go through src/m and append any directory that contains a *.py file to PATH 
-for root,dirs,files in os.walk(ISSM_DIR+ '/src/m'):
-	if '.svn' in dirs:
-		dirs.remove('.svn')
-	for file in files:
-		if file.find(".py") != -1:
-			if file.find(".pyc") == -1:
-				if root not in sys.path:
-					sys.path.append(root)
+    #Go through src/m and append any directory that contains a *.py file to PATH
+for root, dirs, files in os.walk(ISSM_DIR + '/src/m'):
+    if '.svn' in dirs:
+        dirs.remove('.svn')
+    for file in files:
+        if file.find(".py") != -1:
+            if file.find(".pyc") == -1:
+                if root not in sys.path:
+                    sys.path.append(root)
 
-#Also add the Nightly run directory
-sys.path.append(ISSM_DIR + '/test/NightlyRun')
-				
-sys.path.append(ISSM_DIR + '/lib')
-sys.path.append(ISSM_DIR + '/src/wrappers/python/.libs')
-# If using clusters, we need to have the path to the cluster settings directory
-if(JPL_SVN!=None):
-	if os.path.exists(JPL_SVN + '/usr/' + USERNAME):
-		sys.path.append(JPL_SVN + '/usr/' + USERNAME)
-	else:
-		warnings.warn('cluster settings should be in, '+ JPL_SVN +'/usr/' + USERNAME)
+    #Also add the Nightly run directory
+if ISSM_DIR + '/test/NightlyRun' not in sys.path:
+    sys.path.append(ISSM_DIR + '/test/NightlyRun')
+if ISSM_DIR + '/lib' not in sys.path:
+    sys.path.append(ISSM_DIR + '/lib')
+if ISSM_DIR + '/src/wrappers/python/.libs' not in sys.path:
+    sys.path.append(ISSM_DIR + '/src/wrappers/python/.libs')
+    # If using clusters, we need to have the path to the cluster settings directory
+if JPL_SVN is not None:
+    jpl_path = JPL_SVN + '/usr/' + USERNAME
+    if os.path.exists(jpl_path):
+        if jpl_path not in sys.path:
+            sys.path.append(jpl_path)
+    else:
+        warnings.warn('cluster settings should be in, {}/usr/{}'.format(JPL_SVN, USERNAME))
 
-#Manual imports for commonly used functions
-from runme import runme		#first because plotmodel may fail
+from runme import runme  #first because plotmodel may fail
 from plotmodel import plotmodel
 
@@ -42,3 +46,4 @@
 #c.InteractiveShellApp.exec_lines.append('print "Warning: disable autoreload in startup.py to improve performance." ')
 
-print("\n  ISSM development path correctly loaded\n\n")
+print("\n  ISSM development path correctly loaded")
+print("Current path is {}\n\n".format(ISSM_DIR))
Index: /issm/trunk/src/m/dev/issmversion.m
===================================================================
--- /issm/trunk/src/m/dev/issmversion.m	(revision 24312)
+++ /issm/trunk/src/m/dev/issmversion.m	(revision 24313)
@@ -17,5 +17,5 @@
 disp(['Compiled on ' IssmConfig('HOST_VENDOR') ' ' IssmConfig('HOST_OS') ' ' IssmConfig('HOST_ARCH') ' by ' IssmConfig('USER_NAME')]);
 disp([' ']);
-disp(['Copyright (c) 2009-2018 California Institute of Technology']);
+disp(['Copyright (c) 2009-2019 California Institute of Technology']);
 disp([' ']);
 disp(['    to get started type: issmdoc']);
Index: /issm/trunk/src/m/dev/issmversion.py
===================================================================
--- /issm/trunk/src/m/dev/issmversion.py	(revision 24312)
+++ /issm/trunk/src/m/dev/issmversion.py	(revision 24313)
@@ -1,20 +1,21 @@
 from IssmConfig import IssmConfig
 
+
 def issmversion():
-	"""
-	ISSMVERSION - display ISSM version
+    """
+    ISSMVERSION - display ISSM version
 
-		Usage:
-			issmversion()
-	"""
+        Usage:
+            issmversion()
+    """
 
 
-print ' '
-print IssmConfig('PACKAGE_NAME')[0]+' Version '+IssmConfig('PACKAGE_VERSION')[0]
-print '(website: '+IssmConfig('PACKAGE_URL')[0]+' contact: '+IssmConfig('PACKAGE_BUGREPORT')[0]+')'
-print ' '
-print 'Build date: '+IssmConfig('PACKAGE_BUILD_DATE')[0]
-print 'Copyright (c) 2009-2018 California Institute of Technology'
-print ' '
-print '    to get started type: issmdoc'
-print ' '
+print(' ')
+print((IssmConfig('PACKAGE_NAME')[0] + ' Version ' + IssmConfig('PACKAGE_VERSION')[0]))
+print(('(website: ' + IssmConfig('PACKAGE_URL')[0] + ' contact: ' + IssmConfig('PACKAGE_BUGREPORT')[0] + ')'))
+print(' ')
+print(('Build date: ' + IssmConfig('PACKAGE_BUILD_DATE')[0]))
+print('Copyright (c) 2009 - 2018 California Institute of Technology')
+print(' ')
+print('    to get started type: issmdoc')
+print(' ')
Index: /issm/trunk/src/m/exp/clicktoflowline.m
===================================================================
--- /issm/trunk/src/m/exp/clicktoflowline.m	(revision 24312)
+++ /issm/trunk/src/m/exp/clicktoflowline.m	(revision 24313)
@@ -12,5 +12,5 @@
 
 %Get click position
-[x0,y0]=ginput(1);
+[x0,y0]=exp_ginput(1,options);
 
 %Get flowline
Index: /issm/trunk/src/m/exp/contourlevelzero.m
===================================================================
--- /issm/trunk/src/m/exp/contourlevelzero.m	(revision 24312)
+++ /issm/trunk/src/m/exp/contourlevelzero.m	(revision 24313)
@@ -11,9 +11,14 @@
 %process data 
 if dimension(md.mesh)==3,
-	error('contourlevelzero error message: routine not supported for 3d meshes, project on a layer');
-end
-
-x=md.mesh.x;
-y=md.mesh.y;
+% 	error('contourlevelzero error message: routine not supported for 3d meshes, project on a layer');
+	x = md.mesh.x2d;
+	y = md.mesh.y2d;
+	index=md.mesh.elements2d;
+else
+	x=md.mesh.x;
+	y=md.mesh.y;
+	index=md.mesh.elements;
+end
+
 if isfield(md.mesh,'z'),
 	z=md.mesh.z;
@@ -21,8 +26,11 @@
 	z=zeros(md.mesh.numberofvertices,1);
 end
-index=md.mesh.elements;
 
 if isempty(mask), error('mask provided is empty'); end
-if length(mask)~=md.mesh.numberofvertices, error('mask provided should be specified at the vertices of the mesh'); end
+if dimension(md.mesh)==3,
+	if length(mask)~=md.mesh.numberofvertices2d, error('mask provided should be specified at the vertices of the mesh'); end
+else
+	if length(mask)~=md.mesh.numberofvertices, error('mask provided should be specified at the vertices of the mesh'); end
+end
 
 %initialization of some variables
Index: /issm/trunk/src/m/exp/exp2shp.m
===================================================================
--- /issm/trunk/src/m/exp/exp2shp.m	(revision 24312)
+++ /issm/trunk/src/m/exp/exp2shp.m	(revision 24313)
@@ -26,15 +26,26 @@
 
 %initialize number of profile
-count=0;
+count=1;
 
 contours=struct([]);
 for i=1:length(shp),
 	if nargin < 3
-		if length(shp(1).x) == 1
+
+		%TEMP
+		%if contains(shp(i).name,'_pointcloud');
+		%	continue;
+		%end
+
+		if length(shp(i).x) == 0
+			continue;
+		elseif contains(shp(i).name,'_pointcloud');
+			geometry = 'MultiPoint';
+			shp(i).name = erase(shp(i).name,'_pointcloud');
+		elseif length(shp(i).x) == 1
 			geometry = 'Point';
-		elseif length(shp(1).x) < 3
+		elseif length(shp(i).x) < 3
 			geometry = 'Line';
 		else 
-			if (shp(1).x(end)==shp(1).x(1) && shp(1).y(end)==shp(1).y(1)),
+			if (shp(i).x(end)==shp(i).x(1) && shp(i).y(end)==shp(i).y(1)),
 				geometry = 'Polygon';
 			else
@@ -43,9 +54,12 @@
 		end
 	end
-	contours(i).Geometry=geometry;
-	contours(i).id=i;
-	contours(i).X=shp(i).x;
-	contours(i).Y=shp(i).y;
+	contours(count).Geometry=geometry;
+	contours(count).id=i;
+	contours(count).Name=shp(i).name;
+	contours(count).X=shp(i).x;
+	contours(count).Y=shp(i).y;
+	count = count+1;
 end
-	
+
+%Make sure it is one single geometry otherwise it will yell at you
 shapewrite(contours,shpfilename);
Index: /issm/trunk/src/m/exp/expcoarsen.py
===================================================================
--- /issm/trunk/src/m/exp/expcoarsen.py	(revision 24312)
+++ /issm/trunk/src/m/exp/expcoarsen.py	(revision 24313)
@@ -1,77 +1,77 @@
 import os.path
-import numpy as  np
+import numpy as np
 from collections import OrderedDict
 from expread import expread
 from expwrite import expwrite
 
-def expcoarsen(newfile,oldfile,resolution):
-	""" 
-	EXPCOARSEN - coarsen an exp contour
 
-	This routine read an Argus file and remove points with respect to
-	the resolution (in meters) given in input. 
+def expcoarsen(newfile, oldfile, resolution):
+    """
+    EXPCOARSEN - coarsen an exp contour
 
-	Usage:
-	  expcoarsen(newfile,oldfile,resolution)
+    This routine read an Argus file and remove points with respect to
+    the resolution (in meters) given in input.
 
-	Example:
-	   expcoarsen('DomainOutline.exp','Antarctica.exp',4000)
-	""" 
+    Usage:
+      expcoarsen(newfile, oldfile, resolution)
 
-	#Some checks
-	if not os.path.exists(oldfile):
-		raise OSError("expcoarsen error message: file '%s' not found!" % oldfile)
-	if os.path.exists(newfile):
-		choice=raw_input('A file ' + newfile + ' already exists, do you want to modify it? (y/n)')
-		if choice not in 'y': 
-			print('no modification done ... exiting')
-			return 0
+    Example:
+       expcoarsen('DomainOutline.exp', 'Antarctica.exp', 4000)
+    """
 
-	#Get exp oldfile
-	contours=expread(oldfile)
-	newcontours=[]
+    #Some checks
+    if not os.path.exists(oldfile):
+        raise OSError("expcoarsen error message: file '%s' not found!" % oldfile)
+    if os.path.exists(newfile):
+        choice = eval(input('A file ' + newfile + ' already exists, do you want to modify it? (y / n)'))
+        if choice not in 'y':
+            print('no modification done ... exiting')
+            return 0
 
-	for contour in  contours:
-		
-		numpoints=np.size(contour['x'])
+    #Get exp oldfile
+    contours = expread(oldfile)
+    newcontours = []
 
-		j=0
-		x=contour['x']
-		y=contour['y']
+    for contour in contours:
+        numpoints = np.size(contour['x'])
 
-		#stop if we have reached end of profile (always keep the last point)
-		while j<numpoints-1:
+        j = 0
+        x = contour['x']
+        y = contour['y']
 
-			#see whether we keep this point or not
-			distance=np.sqrt((x[j]-x[j+1])**2+(y[j]-y[j+1])**2)
-			if distance<resolution and j<numpoints-2:   #do not remove last point
-				x=np.delete(x,j+1,0)
-				y=np.delete(y,j+1,0)
-				numpoints=numpoints-1
-			else:
-				division=int(np.floor(distance/resolution)+1)
-				if division>=2:
-					xi=np.linspace(x[j],x[j+1],division)
-					yi=np.linspace(y[j],y[j+1],division)
-					
-					x=np.hstack((x[0:j+1],xi[1:-1],x[j+1:]))
-					y=np.hstack((y[0:j+1],yi[1:-1],y[j+1:]))
+        #stop if we have reached end of profile (always keep the last point)
+        while j < numpoints - 1:
 
-					#update current point
-					j=j+1+division-2
-					numpoints=numpoints+division-2
-				else:
-					#update current point
-					j=j+1
-		
-		if np.size(x)>1:
-			#keep the (x,y) contour arond
-			newcontour=OrderedDict()
-			newcontour['nods']=np.size(x)
-			newcontour['density']=contour['density']
-			newcontour['x']=x
-			newcontour['y']=y
-			newcontours.append(newcontour)
+            #see whether we keep this point or not
+            distance = np.sqrt((x[j] - x[j + 1])**2 + (y[j] - y[j + 1])**2)
+            if distance < resolution and j < numpoints - 2:  #do not remove last point
+                x = np.delete(x, j + 1, 0)
+                y = np.delete(y, j + 1, 0)
+                numpoints = numpoints - 1
+            else:
+                division = int(np.floor(distance / resolution) + 1)
+                if division >= 2:
+                    xi = np.linspace(x[j], x[j + 1], division)
+                    yi = np.linspace(y[j], y[j + 1], division)
 
-	#write output
-	expwrite(newcontours,newfile)
+                    x = np.hstack((x[0:j + 1], xi[1:-1], x[j + 1:]))
+                    y = np.hstack((y[0:j + 1], yi[1:-1], y[j + 1:]))
+
+                    #update current point
+                    j = j + 1 + division - 2
+                    numpoints = numpoints + division - 2
+                else:
+                    #update current point
+                    j = j + 1
+
+        if np.size(x) > 1:
+            #keep the (x, y) contour arond
+            newcontour = OrderedDict()
+            newcontour['nods'] = np.size(x)
+            newcontour['density'] = contour['density']
+            newcontour['x'] = x
+            newcontour['y'] = y
+            newcontours.append(newcontour)
+
+    #write output
+    expwrite(newcontours, newfile)
Index: /issm/trunk/src/m/exp/expdisp.py
===================================================================
--- /issm/trunk/src/m/exp/expdisp.py	(revision 24312)
+++ /issm/trunk/src/m/exp/expdisp.py	(revision 24313)
@@ -1,59 +1,60 @@
 from expread import expread
-import numpy as  np
+import numpy as np
 from matplotlib.path import Path
 import matplotlib.patches as patches
 
-def expdisp(ax,options):
+
+def expdisp(ax, options):
     '''
     plot the contents of a domain outline file
 
-    This routine reads in an exp file and plots all of the x,y points/lines/patches
+    This routine reads in an exp file and plots all of the x, y points / lines / patches
 
     'ax' is a handle to the current plot axes, onto which we want to plot
 
     Usage:
-        expdisp(ax,options)
+    expdisp(ax, options)
 
     List of options passable to plotmodel:
-        'expdisp'      : path (or list of paths) to the exp file to be plotted
-        'explinewidth' : linewidth
-        'explinestyle' : matplotlib linestyle string
-        'explinecolor' : matplotlib color string
-        'expfill'      : (True/False) fill a closed contour
-        'expfillcolor' : Color for a filled contour, only used if expfill is True
-        'expfillalpha' : alpha transparency for filled contour
+    'expdisp'      : path (or list of paths) to the exp file to be plotted
+    'explinewidth' : linewidth
+    'explinestyle' : matplotlib linestyle string
+    'explinecolor' : matplotlib color string
+    'expfill'      : (True / False) fill a closed contour
+    'expfillcolor' : Color for a filled contour, only used if expfill is True
+    'expfillalpha' : alpha transparency for filled contour
 
     All options should be passed as lists of length len(number of exp files passed)
     '''
 
-    filenames=options.getfieldvalue('expdisp')
-    linewidth=options.getfieldvalue('explinewidth',[1]*len(filenames))
-    linestyle=options.getfieldvalue('explinestyle',['-']*len(filenames))
-    linecolor=options.getfieldvalue('explinecolor',['k']*len(filenames))
-    fill=options.getfieldvalue('expfill',[0]*len(filenames))
-    alpha=options.getfieldvalue('expfillalpha',[1]*len(filenames))
-    facecolor=options.getfieldvalue('expfillcolor',['r']*len(filenames))
-    unitmultiplier=options.getfieldvalue('unit',1)
-    for i in xrange(len(filenames)):
-	linestylei=linestyle[i]
-        linecolori=linecolor[i]
-        linewidthi=linewidth[i]
-        alphai=alpha[i]
-        facecolori=facecolor[i]
-	filenamei=filenames[i]
-        filli=fill[i]
-        domain=expread(filenamei)
-        for j in xrange(len(domain)):
-            if domain[j]['nods']==1:
-                ax.plot(domain[j]['x']*unitmultiplier,domain[j]['y']*unitmultiplier,'o',mec='k',mfc='r',ms=10)
+    filenames = options.getfieldvalue('expdisp')
+    linewidth = options.getfieldvalue('explinewidth', [1] * len(filenames))
+    linestyle = options.getfieldvalue('explinestyle', ['-'] * len(filenames))
+    linecolor = options.getfieldvalue('explinecolor', ['k'] * len(filenames))
+    fill = options.getfieldvalue('expfill', [0] * len(filenames))
+    alpha = options.getfieldvalue('expfillalpha', [1] * len(filenames))
+    facecolor = options.getfieldvalue('expfillcolor', ['r'] * len(filenames))
+    unitmultiplier = options.getfieldvalue('unit', 1)
+    for i in range(len(filenames)):
+        linestylei = linestyle[i]
+        linecolori = linecolor[i]
+        linewidthi = linewidth[i]
+        alphai = alpha[i]
+        facecolori = facecolor[i]
+        filenamei = filenames[i]
+        filli = fill[i]
+        domain = expread(filenamei)
+        for j in range(len(domain)):
+            if domain[j]['nods'] == 1:
+                ax.plot(domain[j]['x'] * unitmultiplier, domain[j]['y'] * unitmultiplier, 'o', mec='k', mfc='r', ms=10)
             elif filli:
-                verts=np.column_stack((domain[j]['x'],domain[j]['y']))
-                codes=[Path.MOVETO] + [Path.LINETO]*(len(domain[j]['x'])-2) + [Path.CLOSEPOLY]
-                path=Path(verts, codes)
-                patch=patches.PathPatch(path,facecolor=facecolori,edgecolor=linecolori,alpha=alphai,
-                        lw=linewidthi)
+                verts = np.column_stack((domain[j]['x'], domain[j]['y']))
+                codes = [Path.MOVETO] + [Path.LINETO] * (len(domain[j]['x']) - 2) + [Path.CLOSEPOLY]
+                path = Path(verts, codes)
+                patch = patches.PathPatch(path, facecolor=facecolori, edgecolor=linecolori, alpha=alphai,
+                                          lw=linewidthi)
                 ax.add_patch(patch)
             else:
-                x=domain[j]['x'].tolist() # since expread returns a string representation of the arrays
-                y=domain[j]['y'].tolist()
-                ax.plot(x*unitmultiplier,y*unitmultiplier,ls=linestylei,lw=linewidthi,c=linecolori)
+                x = domain[j]['x'].tolist()  # since expread returns a string representation of the arrays
+                y = domain[j]['y'].tolist()
+                ax.plot(x * unitmultiplier, y * unitmultiplier, ls=linestylei, lw=linewidthi, c=linecolori)
Index: /issm/trunk/src/m/exp/expread.py
===================================================================
--- /issm/trunk/src/m/exp/expread.py	(revision 24312)
+++ /issm/trunk/src/m/exp/expread.py	(revision 24313)
@@ -4,91 +4,88 @@
 import MatlabFuncs as m
 
+
 def expread(filename):
+    """
 
-	"""
+    EXPREAD - read a file exp and build a Structure
 
-	EXPREAD - read a file exp and build a Structure
+       This routine reads a file .exp and builds a list of dicts containing the
+       fields x and y corresponding to the coordinates, one for the filename of
+       the exp file, for the density, for the nodes, and a field closed to
+       indicate if the domain is closed.
+       The first argument is the .exp file to be read and the second one (optional)
+       indicate if the last point shall be read (1 to read it, 0 not to).
 
-	   This routine reads a file .exp and builds a list of dicts containing the 
-	   fields x and y corresponding to the coordinates, one for the filename of
-	   the exp file, for the density, for the nodes, and a field closed to 
-	   indicate if the domain is closed. 
-	   The first argument is the .exp file to be read and the second one (optional) 
-	   indicate if the last point shall be read (1 to read it, 0 not to).
+       Usage:
+          contours = expread(filename)
 
-	   Usage:
-	      contours=expread(filename)
+       Example:
+          contours = expread('domainoutline.exp')
+          contours = expread('domainoutline.exp')
 
-	   Example:
-	      contours=expread('domainoutline.exp')
-	      contours=expread('domainoutline.exp')
+       See also EXPDOC, EXPWRITEASVERTICES
 
-	   See also EXPDOC, EXPWRITEASVERTICES
+    """
+    #some checks
+    if not os.path.exists(filename):
+        raise OSError("expread error message: file '%s' not found!" % filename)
 
-	"""
-	#some checks
-	if not os.path.exists(filename):
-		raise OSError("expread error message: file '%s' not found!" % filename)
+    #initialize number of profile
+    contours = []
+    #open file
+    fid = open(filename, 'r')
+    #loop over the number of profiles
+    while True:
+        #update number of profiles
+        contour = OrderedDict()
+        #Get file name
+        A = fid.readline()
+        while A == '\n':
+            A = fid.readline()
+        if not A:
+            break
+        A = A.split(None, 1)
+        if not (len(A) == 2 and m.strcmp(A[0], '##') and m.strncmp(A[1], 'Name:', 5)):
+            break
 
-	#initialize number of profile
-	contours=[]
-	#open file
-	fid=open(filename,'r')
-	#loop over the number of profiles
-	while True:
-		#update number of profiles
-		contour=OrderedDict()
-		#Get file name
-		A=fid.readline()
-		while A=='\n':
-			A=fid.readline()
-		if not A:
-			break
-		A=A.split(None,1)
-		if not (len(A) == 2 and m.strcmp(A[0],'##') and m.strncmp(A[1],'Name:',5)):
-			break
+        if len(A[1]) > 5:
+            contour['name'] = A[1][5:-1]
+        else:
+            contour['name'] = ''
 
-		if len(A[1])>5: 
-			contour['name']=A[1][5:-1]
-		else:
-			contour['name']=''
+        #Get Icon
+        A = fid.readline().split(None, 1)
+        if not (len(A) == 2 and m.strcmp(A[0], '##') and m.strncmp(A[1], 'Icon:', 5)):
+            break
+        #Get Info
+        A = fid.readline().split()
+        if not (len(A) == 4 and m.strcmp(A[0], '#') and m.strcmp(A[1], 'Points')):
+            break
 
-		#Get Icon
-		A=fid.readline().split(None,1)
-		if not (len(A) == 2 and m.strcmp(A[0],'##') and m.strncmp(A[1],'Icon:',5)):
-			break
-		#Get Info
-		A=fid.readline().split()
-		if not (len(A) == 4 and m.strcmp(A[0],'#') and m.strcmp(A[1],'Points')):
-			break
+        #Get number of nodes and density
+        A = fid.readline().split()
+        contour['nods'] = int(A[0])
+        contour['density'] = float(A[1])
 
-		#Get number of nodes and density
-		A=fid.readline().split()
-		contour['nods']=int(A[0])
-		contour['density']=float(A[1])
+        #Get Info
+        A = fid.readline().split()
+        if not (len(A) == 5 and m.strcmp(A[0], '#') and m.strcmp(A[1], 'X') and m.strcmp(A[2], 'pos') and m.strcmp(A[3], 'Y') and m.strcmp(A[4], 'pos')):
+            break
+    #Get Coordinates
+        contour['x'] = np.empty(contour['nods'])
+        contour['y'] = np.empty(contour['nods'])
+        for i in range(int(contour['nods'])):
+            A = fid.readline().split()
+            contour['x'][i] = float(A[0])
+            contour['y'][i] = float(A[1])
 
-		#Get Info
-		A=fid.readline().split()
-		if not (len(A) == 5 and m.strcmp(A[0],'#') and m.strcmp(A[1],'X') and m.strcmp(A[2],'pos') 
-						and m.strcmp(A[3],'Y') and m.strcmp(A[4],'pos')):
-			break
-		#Get Coordinates
-		contour['x']=np.empty(contour['nods'])
-		contour['y']=np.empty(contour['nods'])
-		for i in xrange(int(contour['nods'])):
-			A=fid.readline().split()
-			contour['x'][i]=float(A[0])
-			contour['y'][i]=float(A[1])
+    #Check if closed
+        if (contour['nods'] > 1) and (contour['x'][-1] == contour['x'][0]) and (contour['y'][-1] == contour['y'][0]):
+            contour['closed'] = True
+        else:
+            contour['closed'] = False
 
-		#Check if closed
-		if (contour['nods'] > 1) and \
-		   (contour['x'][-1] == contour['x'][0]) and \
-		   (contour['y'][-1] == contour['y'][0]):
-			contour['closed']=True
-		else:
-			contour['closed']=False
-
-		contours.append(contour)
-	#close file
-	fid.close()
-	return contours
+        contours.append(contour)
+    #close file
+    fid.close()
+    return contours
Index: sm/trunk/src/m/exp/expswapxy.m
===================================================================
--- /issm/trunk/src/m/exp/expswapxy.m	(revision 24312)
+++ 	(revision )
@@ -1,22 +1,0 @@
-function expswapxy(filename)
-%EXPSWAP - swap x and y fields
-% 
-%   Usage:
-%      expswap(file)
-%
-%   See also EXPMASTER, EXPDOC
-
-contours=expread(filename,1);
-
-newcontours=contours(1);
-
-for i=1:length(contours), 
-	contour=contours(i);
-	newcontour=contour;
-	newcontour.x=contour.y;
-	newcontour.y=contour.x;
-	newcontours(end+1)=newcontour;
-end
-newcontours=newcontours(2:end);
-
-expwrite(newcontours,filename);
Index: /issm/trunk/src/m/exp/exptool.m
===================================================================
--- /issm/trunk/src/m/exp/exptool.m	(revision 24312)
+++ /issm/trunk/src/m/exp/exptool.m	(revision 24313)
@@ -99,5 +99,5 @@
 
 %get current figure
-nofigurecopy=getfieldvalue(options,'nofigurecopy',0);
+nofigurecopy=getfieldvalue(options,'nofigurecopy',1);
 if ~nofigurecopy,
 	if ~isempty(get(0,'children')),%if there is already a figure (return the number of opened figures)
Index: /issm/trunk/src/m/exp/expwrite.py
===================================================================
--- /issm/trunk/src/m/exp/expwrite.py	(revision 24312)
+++ /issm/trunk/src/m/exp/expwrite.py	(revision 24313)
@@ -1,47 +1,47 @@
 import numpy as np
 
-def expwrite(contours,filename):
-	"""
-	EXPWRITE - write an Argus file from a dictionary given in input
 
-	   This routine writes an Argus file from a dict containing the fields:
-	   x and y of the coordinates of the points.
-	   The first argument is the list containing the points coordinates 
-	   and the second one the file to be written.
+def expwrite(contours, filename):
+    """
+    EXPWRITE - write an Argus file from a dictionary given in input
 
-	   Usage:
-	      expwrite(contours,filename)
+       This routine writes an Argus file from a dict containing the fields:
+       x and y of the coordinates of the points.
+       The first argument is the list containing the points coordinates
+       and the second one the file to be written.
 
-	   Example:
-	      expwrite(coordstruct,'domainoutline.exp')
+       Usage:
+          expwrite(contours, filename)
 
-	   See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
-	"""
+       Example:
+          expwrite(coordstruct, 'domainoutline.exp')
 
-	fid=open(filename,'w')
-	for x,y in zip(contours['x'],contours['y']):
-		#if np.size(contour['x'])!=np.size(contour['y']):
-		if len(x)!=len(y):
-			raise RuntimeError("contours x and y coordinates must be of identical size")
-		if 'name' in contours:
-			fid.write("%s%s\n" % ('## Name:',contours['name']))
-		else:
-			fid.write("%s%s\n" % ('## Name:',filename))
-   
-		#Add density if it's not there FIXME what is this ever used for?
-		#if 'density' not in contours:
-		#	contours['density']=1
-		density=1
+       See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
+    """
 
-		fid.write("%s\n" % '## Icon:0')
-		fid.write("%s\n" % '# Points Count Value')
-		#fid.write("%i %f\n" % (np.size(contour['x']),contour['density']))
-		fid.write("%i %f\n" % (np.size(x),density))
-		fid.write("%s\n" % '# X pos Y pos')
-		#for x,y in zip(contour['x'],contour['y']):
-		for xi,yi in zip(x,y):
-			fid.write("%10.10f %10.10f\n" % (xi,yi))
-		fid.write("\n")
+    fid = open(filename, 'w')
+    for x, y in zip(contours['x'], contours['y']):
+        #if np.size(contour['x']) != np.size(contour['y']):
+        if len(x) != len(y):
+            raise RuntimeError("contours x and y coordinates must be of identical size")
+        if 'name' in contours:
+            fid.write("%s%s\n" % ('  # Name:', contours['name']))
+        else:
+            fid.write("%s%s\n" % ('  # Name:', filename))
 
-	fid.close()
+        #Add density if it's not there FIXME what is this ever used for?
+        #if 'density' not in contours:
+        #    contours['density'] = 1
+        density = 1
 
+        fid.write("%s\n" % '  # Icon:0')
+        fid.write("%s\n" % '  # Points Count Value')
+    #fid.write("%i %f\n" % (np.size(contour['x']), contour['density']))
+        fid.write("%i %f\n" % (np.size(x), density))
+        fid.write("%s\n" % '  # X pos Y pos')
+    #for x, y in zip(contour['x'], contour['y']):
+        for xi, yi in zip(x, y):
+            fid.write("%10.10f %10.10f\n" % (xi, yi))
+        fid.write("\n")
+
+    fid.close()
Index: /issm/trunk/src/m/exp/flowlines.py
===================================================================
--- /issm/trunk/src/m/exp/flowlines.py	(revision 24313)
+++ /issm/trunk/src/m/exp/flowlines.py	(revision 24313)
@@ -0,0 +1,148 @@
+import numpy as np
+from pairoptions import pairoptions
+try:
+    import matplotlib.tri as tri
+except ImportError:
+    print("could not import matplotlib which is needed for triangulation")
+
+
+def flowlines(index, x, y, u, v, x0, y0, *args):
+    #FLOWLINES - compute flowlines from a given set of seed points
+    #
+    #   Usage:
+    #      flowpath = flowlines(index, x, y, u, v, x0, y0, varargin)
+    #
+    #   the velocity field is given by the couple (u, v) and the coordinates
+    #   of the seed points are (x0, y0). One can use one or several seed
+    #   points
+    #
+    #   Example:
+    #      flowpath = flowlines(md.mesh.elements, md.mesh.x, md.mesh.y, md.initialization.vx, md.initialization.vy, x0, y0)
+    #
+    #   Options:
+    # - 'maxiter':   how many steps upstream and downstream of the seed points (default: 200)
+    # - 'precision': division of each segment (higer precision increases number of segments, default: 1)
+    # - 'downstream':flow line upstream of the seed points (default: 1)
+    # - 'upstream':  flow line upstream of the seed points (default: 1)
+
+    #check input
+    if (not len(x) == len(y) == len(u) == len(v)):
+        raise IOError('flowlines error message: x, y, u and v must have the same length')
+
+    if len(x) < 3:
+        raise IOError('flowlines error message: at least one element is required')
+
+    if len(x0) != len(y0):
+        raise IOError('flowlines error message: x0 and y0 do not have the same length')
+
+    #check if we have matlab indexing and translate
+    if np.nanmin(index) > 0:
+        index -= 1
+
+    #process options
+    options = pairoptions(*args)
+    maxiter = options.getfieldvalue('maxiter', 200)
+    precision = options.getfieldvalue('precision', 1)
+
+    #Squeeze the result to fix shape issues
+    u = np.squeeze(u)
+    v = np.squeeze(v)
+
+    #Create triangulation once for all and check seed points
+    trep = tri.Triangulation(x, y, index)
+    trifinder = trep.get_trifinder()
+    tria = trifinder(x0, y0)
+    pos = np.where(tria < 0)[0]
+    if len(pos) > 0:
+        x0 = np.delete(x0, pos)
+        y0 = np.delete(y0, pos)
+
+    #initialize other variables
+    N = len(x0)
+    flowpath = {}
+    flowpath['x'] = list.copy(x0)
+    flowpath['y'] = list.copy(y0)
+    flowpath['name'] = 'flowline{}'.format(0)
+    for i in np.arange(1, len(flowpath['x'])):
+        flowpath['name'] = np.append(flowpath['name'], 'flowline{}'.format(i))
+
+    #get avegared length of each element
+    dist0_1 = np.sqrt((x[index[:, 0]] - x[index[:, 1]])**2 + (y[index[:, 0]] - y[index[:, 1]])**2)
+    dist0_2 = np.sqrt((x[index[:, 0]] - x[index[:, 2]])**2 + (y[index[:, 0]] - y[index[:, 2]])**2)
+    dist1_2 = np.sqrt((x[index[:, 1]] - x[index[:, 2]])**2 + (y[index[:, 1]] - y[index[:, 2]])**2)
+    length_tria = 1 / 3 * (dist0_1 + dist0_2 + dist1_2)
+
+    #take velocity for each element
+    u = np.nanmean(u[index], axis=1)
+    v = np.nanmean(v[index], axis=1)
+
+    for flowdirection in ['downstream', 'upstream']:
+        print('Dealing with the {} flowlines'.format(flowdirection))
+    #initialization:
+        counter = 1
+        treatdirection = options.getfieldvalue(flowdirection, 1)
+        done = np.zeros(N)
+        queue = []
+        X = np.array(x0)
+        Y = np.array(y0)
+
+        if treatdirection:
+            if flowdirection == 'upstream':
+                flowindex = 0
+            elif flowdirection == 'downstream':
+                flowindex = -1
+
+            while not all(done):
+                #find current triangle
+                queue = np.where(done == 0)[0]
+                tria = trifinder(X[queue], Y[queue])
+                #check that the point are actually inside a triangle of the mesh
+                outsiders = np.where(tria < 0)[0]
+                print('outsider is {} with queue {}'.format(outsiders, queue))
+                if np.size(outsiders) > 0:
+                    for outsider in outsiders:
+                        flowpath['x'][queue[outsider]] = np.delete(flowpath['x'][queue[outsider]][:], flowindex)
+                        flowpath['y'][queue[outsider]] = np.delete(flowpath['y'][queue[outsider]][:], flowindex)
+
+                    done[queue[outsiders]] = 1
+
+                    tria = np.delete(tria, outsiders)
+                    queue = np.delete(queue, outsiders)
+
+                #velocity of the current triangle and norm it
+                if flowdirection == 'upstream':
+                    ut = -u[tria]
+                    vt = -v[tria]
+                if flowdirection == 'downstream':
+                    ut = u[tria]
+                    vt = v[tria]
+                normv = np.sqrt(ut**2 + vt**2)
+                normv[np.where(normv < 1.0e-10)] = 1.0e-10
+                ut = ut / normv
+                vt = vt / normv
+
+                if counter > maxiter:
+                    print('Maximum number of iterations ({}) reached while going {}'.format(maxiter, flowdirection))
+                    break
+
+                counter += 1
+
+                #remove stagnant point
+                stagnants = np.where(np.logical_and(ut == 0, vt == 0))
+                done[queue[stagnants]] = 1
+                #build next point
+                for i in np.arange(0, len(queue)):
+                    if np.size(flowpath['x'][queue[i]]) == 1:
+                        X[queue[i]] = flowpath['x'][queue[i]] + ut[i] * length_tria[tria[i]] / precision
+                        Y[queue[i]] = flowpath['y'][queue[i]] + vt[i] * length_tria[tria[i]] / precision
+                    else:
+                        X[queue[i]] = flowpath['x'][queue[i]][flowindex] + ut[i] * length_tria[tria[i]] / precision
+                        Y[queue[i]] = flowpath['y'][queue[i]][flowindex] + vt[i] * length_tria[tria[i]] / precision
+                    if flowdirection == 'upstream':
+                        flowpath['x'][queue[i]] = np.append(X[queue[i]], flowpath['x'][queue[i]])
+                        flowpath['y'][queue[i]] = np.append(Y[queue[i]], flowpath['y'][queue[i]])
+                    elif flowdirection == 'downstream':
+                        flowpath['x'][queue[i]] = np.append(flowpath['x'][queue[i]], X[queue[i]])
+                        flowpath['y'][queue[i]] = np.append(flowpath['y'][queue[i]], Y[queue[i]])
+
+    return flowpath
Index: /issm/trunk/src/m/exp/functionSignatures.json
===================================================================
--- /issm/trunk/src/m/exp/functionSignatures.json	(revision 24312)
+++ /issm/trunk/src/m/exp/functionSignatures.json	(revision 24313)
@@ -4,5 +4,5 @@
 		"inputs":
 		  [
-			 {"name":"filename1", "kind":"required",   "type":"filepath"},
+			 {"name":"filename1", "kind":"required",   "type":"filepath=*.exp"},
 			 {"name":"varargin", "kind":"optional", "multiplicity":"append"}
 		]
@@ -12,5 +12,5 @@
 		"inputs":
 		  [
-			 {"name":"filename1", "kind":"required",   "type":"filepath"},
+			 {"name":"filename1", "kind":"required",   "type":"filepath=*.exp"},
 			 {"name":"varargin", "kind":"optional", "multiplicity":"append"}
 		]
Index: /issm/trunk/src/m/exp/operation/addcontour.m
===================================================================
--- /issm/trunk/src/m/exp/operation/addcontour.m	(revision 24312)
+++ /issm/trunk/src/m/exp/operation/addcontour.m	(revision 24313)
@@ -17,5 +17,5 @@
 	while loop
 
-		[xi,yi] = ginput(1);
+		[xi,yi] = exp_ginput(1,options);
 
 		if ~isempty(xi)
Index: /issm/trunk/src/m/exp/operation/addendprofile.m
===================================================================
--- /issm/trunk/src/m/exp/operation/addendprofile.m	(revision 24312)
+++ /issm/trunk/src/m/exp/operation/addendprofile.m	(revision 24313)
@@ -23,5 +23,5 @@
 		title('click on a profile, RETURN to exit','FontSize',14)
 		while isclosed
-			[xi,yi] = ginput(1);
+			[xi,yi] = exp_ginput(1,options);
 			if ~isempty(xi)
 				%get the closest point 
@@ -57,5 +57,5 @@
 		%first step, select a profile
 		title('click to add point to the selected profile, RETURN to exit','FontSize',14)
-		[xi,yi] = ginput(1);
+		[xi,yi] = exp_ginput(1,options);
 
 		if ~isempty(xi)
Index: /issm/trunk/src/m/exp/operation/addinsideprofile.m
===================================================================
--- /issm/trunk/src/m/exp/operation/addinsideprofile.m	(revision 24312)
+++ /issm/trunk/src/m/exp/operation/addinsideprofile.m	(revision 24313)
@@ -30,5 +30,5 @@
 		%first step, select a segment
 		title('click on a segment, RETURN to exit','FontSize',14)
-		[xi,yi] = ginput(1);
+		[xi,yi] = exp_ginput(1,options);
 
 		%first click
@@ -51,5 +51,5 @@
 			%next click
 			title('click on the new point''s location, RETURN to exit','FontSize',14)
-			[xi,yi,but] = ginput(1);
+			[xi,yi,but] = exp_ginput(1,options);
 
 			%second click
Index: /issm/trunk/src/m/exp/operation/addprofile.m
===================================================================
--- /issm/trunk/src/m/exp/operation/addprofile.m	(revision 24312)
+++ /issm/trunk/src/m/exp/operation/addprofile.m	(revision 24313)
@@ -17,5 +17,5 @@
 	while loop
 
-		[xi,yi] = ginput(1);
+		[xi,yi] = exp_ginput(1,options);
 
 		if ~isempty(xi)
Index: /issm/trunk/src/m/exp/operation/closeprofile.m
===================================================================
--- /issm/trunk/src/m/exp/operation/closeprofile.m	(revision 24312)
+++ /issm/trunk/src/m/exp/operation/closeprofile.m	(revision 24313)
@@ -32,5 +32,5 @@
 		end
 
-		[xi,yi] = ginput(1);
+		[xi,yi] = exp_ginput(1,options);
 
 		if ~isempty(xi)
Index: /issm/trunk/src/m/exp/operation/cutarea.m
===================================================================
--- /issm/trunk/src/m/exp/operation/cutarea.m	(revision 24312)
+++ /issm/trunk/src/m/exp/operation/cutarea.m	(revision 24313)
@@ -44,5 +44,5 @@
 		end
 
-		[xi,yi] = ginput(1);
+		[xi,yi] = exp_ginput(1,options);
 
 		if ~isempty(xi)
Index: /issm/trunk/src/m/exp/operation/cutprofile.m
===================================================================
--- /issm/trunk/src/m/exp/operation/cutprofile.m	(revision 24312)
+++ /issm/trunk/src/m/exp/operation/cutprofile.m	(revision 24313)
@@ -30,5 +30,5 @@
 		%select a segment
 		title('click the segment to cut, RETURN to exit','FontSize',14)
-		[xi,yi] = ginput(1);
+		[xi,yi] = exp_ginput(1,options);
 
 		if ~isempty(xi)
Index: /issm/trunk/src/m/exp/operation/exp_ginput.m
===================================================================
--- /issm/trunk/src/m/exp/operation/exp_ginput.m	(revision 24313)
+++ /issm/trunk/src/m/exp/operation/exp_ginput.m	(revision 24313)
@@ -0,0 +1,20 @@
+function [xi yi but] = exp_ginput(numclicks,options);
+%EXP_GINPUT - equivalent to MATLAB's ginput function but with more options
+%
+%   Usage:
+%      [xi yi] = exp_ginput(numclicks,options);
+
+
+ginputtype = getfieldvalue(options,'ginputtype','default');
+ginputtype = getfieldvalue(options,'ginputtype','myginput');
+
+switch ginputtype
+	case 'default'
+		[xi yi but] = ginput(numclicks);
+	case 'myginput'
+		[xi yi but] = myginput(numclicks,'arrow');
+	otherwise
+		error('not supported yet');
+end
+
+
Index: /issm/trunk/src/m/exp/operation/mergeprofiles.m
===================================================================
--- /issm/trunk/src/m/exp/operation/mergeprofiles.m	(revision 24312)
+++ /issm/trunk/src/m/exp/operation/mergeprofiles.m	(revision 24313)
@@ -54,5 +54,5 @@
 	end
 
-	[xi,yi] = ginput(1);
+	[xi,yi] = exp_ginput(1,options);
 
 	if ~isempty(xi)
Index: /issm/trunk/src/m/exp/operation/modifyposition.m
===================================================================
--- /issm/trunk/src/m/exp/operation/modifyposition.m	(revision 24312)
+++ /issm/trunk/src/m/exp/operation/modifyposition.m	(revision 24313)
@@ -27,5 +27,5 @@
 		%select a point to be modified 
 		title('click on the point to be modified, RETURN to exit','FontSize',14)
-		[xi,yi] = ginput(1);
+		[xi,yi] = exp_ginput(1,options);
 
 		if ~isempty(xi)
@@ -41,5 +41,5 @@
 			%select new location
 			title('click on the new location, RETURN to exit','FontSize',14)
-			[xi,yi] = ginput(1);
+			[xi,yi] = exp_ginput(1,options);
 
 			if ~isempty(xi)
Index: /issm/trunk/src/m/exp/operation/myginput.m
===================================================================
--- /issm/trunk/src/m/exp/operation/myginput.m	(revision 24313)
+++ /issm/trunk/src/m/exp/operation/myginput.m	(revision 24313)
@@ -0,0 +1,223 @@
+function [out1,out2,out3] = myginput(arg1,strpointertype)
+%MYGINPUT Graphical input from mouse with custum cursor pointer.
+%   [X,Y] = MYGINPUT(N) gets N points from the current axes and returns 
+%   the X- and Y-coordinates in length N vectors X and Y.
+%
+%   [X,Y] = MYGINPUT(N, POINTER) also specifies the cursor pointer, e.g.
+%   'crosshair', 'arrow', 'circle' etc. See "Specifying the Figure Pointer"
+%   in Matlab's documentation  to see the list of available pointers.
+%   
+%   MYGINPUT is strictly equivalent to Matlab's original GINPUT, except
+%   that a second argument specifies the cursor pointer instead of the
+%   default 'fullcrosshair' pointer.
+%
+%   Example:
+%     plot(1:2,1:2,'s');
+%     hold on
+%     [x,y] = myginput(1,'crosshair');
+%     plot(x,y,'o');
+%     hold off
+%
+%   MYGINPUT is copied from Matlab's GINPUT rev. 5.32.4.4.
+%
+%   See also GINPUT.
+
+%   F. Moisy, moisy_at_fast.u-psud.fr
+%   Revision: 1.02,  Date: 2006/10/24
+
+% History:
+% 2005/10/31: v1.00, first version, from GINPUT rev. 5.32.4.4.
+% 2005/11/25: v1.01, line 'uisuspend' modified (for compatibility with
+%                    ML7.00)
+% 2006/10/24: v1.02, help text improved
+
+out1 = []; out2 = []; out3 = []; y = [];
+
+if nargin<1     % modified MYGINPUT
+    strpointertype='fullcrosshair'; % default GINPUT pointer
+end
+
+c = computer;
+if ~strcmp(c(1:2),'PC') 
+   tp = get(0,'TerminalProtocol');
+else
+   tp = 'micro';
+end
+
+if ~strcmp(tp,'none') & ~strcmp(tp,'x') & ~strcmp(tp,'micro'),
+   if nargout == 1,
+      if nargin == 1,
+         out1 = trmginput(arg1);
+      else
+         out1 = trmginput;
+      end
+   elseif nargout == 2 | nargout == 0,
+      if nargin == 1,
+         [out1,out2] = trmginput(arg1);
+      else
+         [out1,out2] = trmginput;
+      end
+      if  nargout == 0
+         out1 = [ out1 out2 ];
+      end
+   elseif nargout == 3,
+      if nargin == 1,
+         [out1,out2,out3] = trmginput(arg1);
+      else
+         [out1,out2,out3] = trmginput;
+      end
+   end
+else
+   
+   fig = gcf;
+   figure(gcf);
+   
+   if nargin == 0
+      how_many = -1;
+      b = [];
+   else
+      how_many = arg1;
+      b = [];
+      if  isstr(how_many) ...
+            | size(how_many,1) ~= 1 | size(how_many,2) ~= 1 ...
+            | ~(fix(how_many) == how_many) ...
+            | how_many < 0
+         error('Requires a positive integer.')
+      end
+      if how_many == 0
+         ptr_fig = 0;
+         while(ptr_fig ~= fig)
+            ptr_fig = get(0,'PointerWindow');
+         end
+         scrn_pt = get(0,'PointerLocation');
+         loc = get(fig,'Position');
+         pt = [scrn_pt(1) - loc(1), scrn_pt(2) - loc(2)];
+         out1 = pt(1); y = pt(2);
+      elseif how_many < 0
+         error('Argument must be a positive integer.')
+      end
+   end
+   
+   % Suspend axes functions
+       %haxes = findobj(fig,'type','axes');
+        state = uisuspend(fig);
+   %haxes = findobj(fig,'type','axes');
+   %state = uisuspend(haxes);
+   pointer = get(gcf,'pointer');
+   set(gcf,'pointer',strpointertype);  % modified MYGINPUT
+   fig_units = get(fig,'units');
+   char = 0;
+
+   % We need to pump the event queue on unix
+   % before calling WAITFORBUTTONPRESS 
+   drawnow
+   
+   while how_many ~= 0
+      % Use no-side effect WAITFORBUTTONPRESS
+      waserr = 0;
+      try
+	keydown = wfbp;
+      catch
+	waserr = 1;
+      end
+      if(waserr == 1)
+         if(ishandle(fig))
+            set(fig,'units',fig_units);
+	    uirestore(state);
+            error('Interrupted');
+         else
+            error('Interrupted by figure deletion');
+         end
+      end
+      
+      ptr_fig = get(0,'CurrentFigure');
+      if(ptr_fig == fig)
+         if keydown
+            char = get(fig, 'CurrentCharacter');
+            button = abs(get(fig, 'CurrentCharacter'));
+            scrn_pt = get(0, 'PointerLocation');
+            set(fig,'units','pixels')
+            loc = get(fig, 'Position');
+            pt = [scrn_pt(1) - loc(1), scrn_pt(2) - loc(2)];
+            set(fig,'CurrentPoint',pt);         
+         else
+            button = get(fig, 'SelectionType');
+            if strcmp(button,'open') 
+               button = 1;
+            elseif strcmp(button,'normal') 
+               button = 1;
+            elseif strcmp(button,'extend')
+               button = 2;
+            elseif strcmp(button,'alt') 
+               button = 3;
+            else
+               error('Invalid mouse selection.')
+            end
+         end
+         pt = get(gca, 'CurrentPoint');
+         
+         how_many = how_many - 1;
+         
+         if(char == 13) % & how_many ~= 0)
+            % if the return key was pressed, char will == 13,
+            % and that's our signal to break out of here whether
+            % or not we have collected all the requested data
+            % points.  
+            % If this was an early breakout, don't include
+            % the <Return> key info in the return arrays.
+            % We will no longer count it if it's the last input.
+            break;
+         end
+         
+         out1 = [out1;pt(1,1)];
+         y = [y;pt(1,2)];
+         b = [b;button];
+      end
+   end
+   
+   uirestore(state);
+   set(fig,'units',fig_units);
+   
+   if nargout > 1
+      out2 = y;
+      if nargout > 2
+         out3 = b;
+      end
+   else
+      out1 = [out1 y];
+   end
+   
+end
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function key = wfbp
+%WFBP   Replacement for WAITFORBUTTONPRESS that has no side effects.
+
+fig = gcf;
+current_char = [];
+
+% Now wait for that buttonpress, and check for error conditions
+waserr = 0;
+try
+  h=findall(fig,'type','uimenu','accel','C');   % Disabling ^C for edit menu so the only ^C is for
+  set(h,'accel','');                            % interrupting the function.
+  keydown = waitforbuttonpress;
+  current_char = double(get(fig,'CurrentCharacter')); % Capturing the character.
+  if~isempty(current_char) & (keydown == 1)           % If the character was generated by the 
+	  if(current_char == 3)                       % current keypress AND is ^C, set 'waserr'to 1
+		  waserr = 1;                             % so that it errors out. 
+	  end
+  end
+  
+  set(h,'accel','C');                                 % Set back the accelerator for edit menu.
+catch
+  waserr = 1;
+end
+drawnow;
+if(waserr == 1)
+   set(h,'accel','C');                                % Set back the accelerator if it errored out.
+   error('Interrupted');
+end
+
+if nargout>0, key = keydown; end
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Index: /issm/trunk/src/m/exp/operation/orientprofile.m
===================================================================
--- /issm/trunk/src/m/exp/operation/orientprofile.m	(revision 24312)
+++ /issm/trunk/src/m/exp/operation/orientprofile.m	(revision 24313)
@@ -22,5 +22,5 @@
 		end
 
-		[xi,yi] = ginput(1);
+		[xi,yi] = exp_ginput(1,options);
 
 		if ~isempty(xi)
Index: /issm/trunk/src/m/exp/operation/removepoints.m
===================================================================
--- /issm/trunk/src/m/exp/operation/removepoints.m	(revision 24312)
+++ /issm/trunk/src/m/exp/operation/removepoints.m	(revision 24313)
@@ -34,5 +34,5 @@
 		%select a point to be deleted
 		title('click on the point to be removed, RETURN to exit','FontSize',14)
-		[xi,yi] = ginput(1);
+		[xi,yi] = exp_ginput(1,options);
 
 		if ~isempty(xi)
Index: /issm/trunk/src/m/exp/operation/removeprofile.m
===================================================================
--- /issm/trunk/src/m/exp/operation/removeprofile.m	(revision 24312)
+++ /issm/trunk/src/m/exp/operation/removeprofile.m	(revision 24313)
@@ -22,5 +22,5 @@
 		end
 
-		[xi,yi] = ginput(1);
+		[xi,yi] = exp_ginput(1,options);
 
 		if ~isempty(xi)
Index: /issm/trunk/src/m/exp/operation/removeseveralpoints.m
===================================================================
--- /issm/trunk/src/m/exp/operation/removeseveralpoints.m	(revision 24312)
+++ /issm/trunk/src/m/exp/operation/removeseveralpoints.m	(revision 24313)
@@ -46,5 +46,5 @@
 		end
 
-		[xi,yi] = ginput(1);
+		[xi,yi] = exp_ginput(1,options);
 
 		if ~isempty(xi)
Index: /issm/trunk/src/m/extrusion/DepthAverage.m
===================================================================
--- /issm/trunk/src/m/extrusion/DepthAverage.m	(revision 24312)
+++ /issm/trunk/src/m/extrusion/DepthAverage.m	(revision 24313)
@@ -25,7 +25,13 @@
 	vector_average=zeros(md.mesh.numberofelements2d,1);
 	for i=1:md.mesh.numberoflayers-1,
-		vector_average=vector_average+project2d(md,vector,i).*(project2d(md,md.mesh.z,i+1)-project2d(md,md.mesh.z,i));
+		vertices_dz = (project2d(md,md.mesh.z,i+1)-project2d(md,md.mesh.z,i));
+		elements_dz = mean(vertices_dz(md.mesh.elements2d),2);
+		vector_average = vector_average+project2d(md,vector,i).*elements_dz;
+		%vector_average=vector_average+project2d(md,vector,i).*(project2d(md,md.mesh.z,i+1)-project2d(md,md.mesh.z,i));
 	end
-	vector_average=vector_average./project2d(md,md.geometry.thickness,1);
+	vertices_thickness = project2d(md,md.geometry.thickness,1);
+	elements_thickness = mean(vertices_thickness(md.mesh.elements2d),2);
+	vector_average = vector_average./elements_thickness;
+	%vector_average=vector_average./project2d(md,md.geometry.thickness,1);
 
 else
Index: /issm/trunk/src/m/extrusion/DepthAverage.py
===================================================================
--- /issm/trunk/src/m/extrusion/DepthAverage.py	(revision 24312)
+++ /issm/trunk/src/m/extrusion/DepthAverage.py	(revision 24313)
@@ -1,50 +1,57 @@
-import numpy as  np
+import numpy as np
 from project2d import project2d
 
-def DepthAverage(md,vector):
-	'''
-	computes depth average of 3d vector using the trapezoidal rule, and returns
-	the value on the 2d mesh. 
-	
-	Usage:
-		vector_average=DepthAverage(md,vector)
-	
-	Example:
-		vel_bar=DepthAverage(md,md.initialization.vel)
-	'''
 
-	#check that the model given in input is 3d
-	if md.mesh.elementtype() != 'Penta':
-		raise TypeError('DepthAverage error message: the model given in input must be 3d')
+def DepthAverage(md, vector):
+    '''
+    computes depth average of 3d vector using the trapezoidal rule, and returns
+    the value on the 2d mesh.
 
-	# coerce to array in case float is passed
-	if type(vector)!=np.ndarray:
-		print 'coercing array'
-		vector=np.array(value)
+    Usage:
+            vector_average = DepthAverage(md, vector)
 
-	vec2d=False
-	if vector.ndim==2:
-		vec2d=True
-		vector=vector.reshape(-1,)
+    Example:
+            vel_bar = DepthAverage(md, md.initialization.vel)
+    '''
 
-	#nods data
-	if vector.shape[0]==md.mesh.numberofvertices:
-		vector_average=np.zeros(md.mesh.numberofvertices2d)
-		for i in xrange(1,md.mesh.numberoflayers):
-			vector_average=vector_average+(project2d(md,vector,i)+project2d(md,vector,i+1))/2.*(project2d(md,md.mesh.z,i+1)-project2d(md,md.mesh.z,i))
-		vector_average=vector_average/project2d(md,md.geometry.thickness,1)
-	
-	#element data
-	elif vector.shape[0]==md.mesh.numberofelements:
-		vector_average=np.zeros(md.mesh.numberofelements2d)
-		for i in xrange(1,md.mesh.numberoflayers):
-			vector_average=vector_average+project2d(md,vector,i)*(project2d(md,md.mesh.z,i+1)-project2d(md,md.mesh.z,i))
-		vector_average=vector_average/project2d(md,md.geometry.thickness,1)
-	
-	else:
-		raise ValueError('vector size not supported yet');
+    #check that the model given in input is 3d
+    if md.mesh.elementtype() != 'Penta':
+        raise TypeError('DepthAverage error message: the model given in input must be 3d')
 
-	if vec2d:
-		vector_average=vector_average.reshape(-1,)
+    # coerce to array in case float is passed
+    if type(vector) not in [np.ndarray, np.ma.core.MaskedArray]:
+        print('coercing array')
+        vector = np.array(vector)
 
-	return vector_average
+    vec2d = False
+    if vector.ndim == 2:
+        vec2d = True
+        vector = vector.reshape(-1, )
+
+    #nods data
+    if vector.shape[0] == md.mesh.numberofvertices:
+        vector_average = np.zeros(md.mesh.numberofvertices2d)
+        for i in range(1, md.mesh.numberoflayers):
+            vector_average = vector_average + (project2d(md, vector, i) + project2d(md, vector, i + 1)) / 2. * (project2d(md, md.mesh.z, i + 1) - project2d(md, md.mesh.z, i))
+        vector_average = vector_average / project2d(md, md.geometry.thickness, 1)
+
+    #element data
+    elif vector.shape[0] == md.mesh.numberofelements:
+        vector_average = np.zeros(md.mesh.numberofelements2d)
+        for i in range(1, md.mesh.numberoflayers):
+            vertices_dz = (project2d(md, md.mesh.z, i + 1) - project2d(md, md.mesh.z, i))
+            elements_dz = vertices_dz.mean(1)
+            vector_average = vector_average + project2d(md, vector, i) * elements_dz
+    #vector_average = vector_average + project2d(md, vector, i) * (project2d(md, md.mesh.z, i + 1) - project2d(md, md.mesh.z, i))
+        vertices_thickness = project2d(md, md.geometry.thickness, 1)
+        elements_thickness = vertices_thickness.mean(1)
+        vector_average = vector_average / elements_thickness
+    #vector_average = vector_average / project2d(md, md.geometry.thickness, 1)
+
+    else:
+        raise ValueError('vector size not supported yet')
+
+    if vec2d:
+        vector_average = vector_average.reshape(-1, )
+
+    return vector_average
Index: /issm/trunk/src/m/extrusion/project2d.py
===================================================================
--- /issm/trunk/src/m/extrusion/project2d.py	(revision 24312)
+++ /issm/trunk/src/m/extrusion/project2d.py	(revision 24313)
@@ -1,49 +1,49 @@
-import numpy as  np
+import numpy as np
 
-def project2d(md3d,value,layer):
-	'''
-	returns the value of a field for a given layer of the mesh
-	
 
-   returns the value of a vector for a given layer from extruded mesh onto the 2d mesh 
-   used to do the extrusion. This function is used to compare values between different
-   layers of a 3d mesh.
+def project2d(md3d, value, layer):
+    '''
+        returns the value of a field for a given layer of the mesh
 
-   Usage:
-      projection_value=project2d(md3d,value,layer)
+    returns the value of a vector for a given layer from extruded mesh onto the 2d mesh
+    used to do the extrusion. This function is used to compare values between different
+    layers of a 3d mesh.
 
-   Example:
-      vel2=project2d(md3d,md3d.initialization.vel,2);
+    Usage:
+      projection_value = project2d(md3d, value, layer)
+
+    Example:
+      vel2 = project2d(md3d, md3d.initialization.vel, 2)
       returns the velocity of the second layer (1 is the base)
-	'''
+        '''
 
-	if md3d.mesh.domaintype().lower() != '3d':
-		raise StandardError("model passed to project2d function should be 3D")
+    if md3d.mesh.domaintype().lower() != '3d':
+        raise Exception("model passed to project2d function should be 3D")
 
-	if layer<1 or layer>md3d.mesh.numberoflayers:
-		raise ValueError("layer must be between 0 and %i" % md3d.mesh.numberoflayers)
-	
-	# coerce to array in case float is passed
-	if type(value)!=np.ndarray:
-		print 'coercing array'
-		value=np.array(value)
+    if layer < 1 or layer > md3d.mesh.numberoflayers:
+        raise ValueError("layer must be between 0 and {}".format(md3d.mesh.numberoflayers))
 
-	vec2d=False
-	if value.ndim==2 and value.shape[1]==1: 
-		value=value.reshape(-1,)
-		vec2d=True
+    # coerce to array in case float is passed
+    if type(value) not in [np.ndarray, np.ma.core.MaskedArray]:
+        print('coercing array')
+        value = np.array(value)
 
-	if value.size==1:
-		projection_value=value[(layer-1)*md3d.mesh.numberofelements2d:layer*md3d.mesh.numberofelements2d]
-	elif value.shape[0]==md3d.mesh.numberofvertices:
-		#print 'indices: ', (layer-1)*md3d.mesh.numberofvertices2d, layer*md3d.mesh.numberofvertices2d
-		projection_value=value[(layer-1)*md3d.mesh.numberofvertices2d:layer*md3d.mesh.numberofvertices2d]
-	elif value.shape[0]==md3d.mesh.numberofvertices+1:
-		projection_value=[value[(layer-1)*md3d.mesh.numberofvertices2d:layer*md3d.mesh.numberofvertices2d], value[-1]]
-	else:
-		projection_value=value[(layer-1)*md3d.mesh.numberofelements2d:layer*md3d.mesh.numberofelements2d]
+    vec2d = False
+    if value.ndim == 2 and value.shape[1] == 1:
+        value = value.reshape(-1, )
+        vec2d = True
 
-	if vec2d:
-		projection_value=projection_value.reshape(-1,)
+    if value.size == 1:
+        projection_value = value[(layer - 1) * md3d.mesh.numberofelements2d:layer * md3d.mesh.numberofelements2d]
+    elif value.shape[0] == md3d.mesh.numberofvertices:
+        #print 'indices: ', (layer - 1) * md3d.mesh.numberofvertices2d, layer * md3d.mesh.numberofvertices2d
+        projection_value = value[(layer - 1) * md3d.mesh.numberofvertices2d:layer * md3d.mesh.numberofvertices2d]
+    elif value.shape[0] == md3d.mesh.numberofvertices + 1:
+        projection_value = [value[(layer - 1) * md3d.mesh.numberofvertices2d:layer * md3d.mesh.numberofvertices2d], value[-1]]
+    else:
+        projection_value = value[(layer - 1) * md3d.mesh.numberofelements2d:layer * md3d.mesh.numberofelements2d]
 
-	return projection_value
+    if vec2d:
+        projection_value = projection_value.reshape(-1, )
+
+    return projection_value
Index: /issm/trunk/src/m/extrusion/project3d.py
===================================================================
--- /issm/trunk/src/m/extrusion/project3d.py	(revision 24312)
+++ /issm/trunk/src/m/extrusion/project3d.py	(revision 24313)
@@ -2,120 +2,118 @@
 from pairoptions import pairoptions
 
-def project3d(md,*args):
-	"""
-	PROJECT3D - vertically project a vector from 2d mesh
 
-	   vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh.
-	   This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an 
-	   element vector of size (md.mesh.numberofelements2d,N/A). 
-	   arguments: 
-	      'vector': 2d vector
-	      'type': 'element' or 'node'. 
-	   options: 
-	      'layer' a layer number where vector should keep its values. If not specified, all layers adopt the 
-	             value of the 2d vector.
-	      'padding': default to 0 (value adopted by other 3d layers not being projected
+def project3d(md, *args):
+    """
+    PROJECT3D - vertically project a vector from 2d mesh
 
-	   Examples:
-	      extruded_vector=project3d(md,'vector',vector2d,'type','node','layer',1,'padding',NaN)
-	      extruded_vector=project3d(md,'vector',vector2d,'type','element','padding',0)
-	      extruded_vector=project3d(md,'vector',vector2d,'type','node')
-	"""
+       vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh.
+       This vector can be a node vector of size (md.mesh.numberofvertices2d, N / A) or an
+       element vector of size (md.mesh.numberofelements2d, N / A).
+       arguments:
+          'vector': 2d vector
+          'type': 'element' or 'node'.
+       options:
+          'layer' a layer number where vector should keep its values. If not specified, all layers adopt the
+                 value of the 2d vector.
+          'padding': default to 0 (value adopted by other 3d layers not being projected
 
-	#some regular checks
-	if not md:
-		raise TypeError("bad usage")
-	if md.mesh.domaintype().lower() != '3d':
-		raise TypeError("input model is not 3d")
+       Examples:
+          extruded_vector = project3d(md, 'vector', vector2d, 'type', 'node', 'layer', 1, 'padding', NaN)
+          extruded_vector = project3d(md, 'vector', vector2d, 'type', 'element', 'padding', 0)
+          extruded_vector = project3d(md, 'vector', vector2d, 'type', 'node')
+    """
 
-	#retrieve parameters from options.
-	options      = pairoptions(*args)
-	vector2d     = options.getfieldvalue('vector')       #mandatory
-	vectype      = options.getfieldvalue('type')         #mandatory
-	layer        = options.getfieldvalue('layer',0)      #optional (do all layers otherwise)
-	paddingvalue = options.getfieldvalue('padding',0)    #0 by default
+    #some regular checks
+    if not md:
+        raise TypeError("bad usage")
+    if md.mesh.domaintype().lower() != '3d':
+        raise TypeError("input model is not 3d")
 
-	vector1d=False
-	if isinstance(vector2d,np.ndarray) and np.ndim(vector2d)==1:
-		vector1d=True
-		vector2d=vector2d.reshape(-1,)
+    #retrieve parameters from options.
+    options = pairoptions(*args)
+    vector2d = options.getfieldvalue('vector')  #mandatory
+    vectype = options.getfieldvalue('type')  #mandatory
+    layer = options.getfieldvalue('layer', 0)  #optional (do all layers otherwise)
+    paddingvalue = options.getfieldvalue('padding', 0)  #0 by default
 
-	if isinstance(vector2d,(bool,int,long,float)) or np.size(vector2d)==1:
-		projected_vector=vector2d
+    vector1d = False
+    if isinstance(vector2d, np.ndarray) and np.ndim(vector2d) == 1:
+        vector1d = True
+        vector2d = vector2d.reshape(-1, )
 
-	elif vectype.lower()=='node':
+    if isinstance(vector2d, (bool, int, float)) or np.size(vector2d) == 1:
+        projected_vector = vector2d
 
-		#Initialize 3d vector
-		if np.ndim(vector2d)==1:
-			if vector2d.shape[0]==md.mesh.numberofvertices2d:
-				projected_vector=(paddingvalue*np.ones((md.mesh.numberofvertices))).astype(vector2d.dtype)
-			elif vector2d.shape[0]==md.mesh.numberofvertices2d+1:
-				projected_vector=(paddingvalue*np.ones((md.mesh.numberofvertices+1))).astype(vector2d.dtype)
-				projected_vector[-1]=vector2d[-1]
-				vector2d=vector2d[:-1]
-			else:
-				raise TypeError("vector length not supported")
-			#Fill in
-			if layer==0:
-				for i in xrange(md.mesh.numberoflayers):
-					projected_vector[(i*md.mesh.numberofvertices2d):((i+1)*md.mesh.numberofvertices2d)]=vector2d
-			else:
-				projected_vector[((layer-1)*md.mesh.numberofvertices2d):(layer*md.mesh.numberofvertices2d)]=vector2d
-		else:
-			if vector2d.shape[0]==md.mesh.numberofvertices2d:
-				projected_vector=(paddingvalue*np.ones((md.mesh.numberofvertices,np.size(vector2d,axis=1)))).astype(vector2d.dtype)
-			elif vector2d.shape[0]==md.mesh.numberofvertices2d+1:
-				projected_vector=(paddingvalue*np.ones((md.mesh.numberofvertices+1,np.size(vector2d,axis=1)))).astype(vector2d.dtype)
-				projected_vector[-1,:]=vector2d[-1,:]
-				vector2d=vector2d[:-1,:]
-			else:
-				raise TypeError("vector length not supported")
-			#Fill in
-			if layer==0:
-				for i in xrange(md.mesh.numberoflayers):
-					projected_vector[(i*md.mesh.numberofvertices2d):((i+1)*md.mesh.numberofvertices2d),:]=vector2d
-			else:
-				projected_vector[((layer-1)*md.mesh.numberofvertices2d):(layer*md.mesh.numberofvertices2d),:]=vector2d
+    elif vectype.lower() == 'node':
+        #Initialize 3d vector
+        if np.ndim(vector2d) == 1:
+            if vector2d.shape[0] == md.mesh.numberofvertices2d:
+                projected_vector = (paddingvalue * np.ones((md.mesh.numberofvertices))).astype(vector2d.dtype)
+            elif vector2d.shape[0] == md.mesh.numberofvertices2d + 1:
+                projected_vector = (paddingvalue * np.ones((md.mesh.numberofvertices + 1))).astype(vector2d.dtype)
+                projected_vector[-1] = vector2d[-1]
+                vector2d = vector2d[:-1]
+            else:
+                raise TypeError("vector length not supported")
+    #Fill in
+            if layer == 0:
+                for i in range(md.mesh.numberoflayers):
+                    projected_vector[(i * md.mesh.numberofvertices2d):((i + 1) * md.mesh.numberofvertices2d)] = vector2d
+            else:
+                projected_vector[((layer - 1) * md.mesh.numberofvertices2d):(layer * md.mesh.numberofvertices2d)] = vector2d
+        else:
+            if vector2d.shape[0] == md.mesh.numberofvertices2d:
+                projected_vector = (paddingvalue * np.ones((md.mesh.numberofvertices, np.size(vector2d, axis=1)))).astype(vector2d.dtype)
+            elif vector2d.shape[0] == md.mesh.numberofvertices2d + 1:
+                projected_vector = (paddingvalue * np.ones((md.mesh.numberofvertices + 1, np.size(vector2d, axis=1)))).astype(vector2d.dtype)
+                projected_vector[-1, :] = vector2d[-1, :]
+                vector2d = vector2d[:-1, :]
+            else:
+                raise TypeError("vector length not supported")
+    #Fill in
+            if layer == 0:
+                for i in range(md.mesh.numberoflayers):
+                    projected_vector[(i * md.mesh.numberofvertices2d):((i + 1) * md.mesh.numberofvertices2d), :] = vector2d
+            else:
+                projected_vector[((layer - 1) * md.mesh.numberofvertices2d):(layer * md.mesh.numberofvertices2d), :] = vector2d
 
+    elif vectype.lower() == 'element':
+        #Initialize 3d vector
+        if np.ndim(vector2d) == 1:
+            if vector2d.shape[0] == md.mesh.numberofelements2d:
+                projected_vector = (paddingvalue * np.ones((md.mesh.numberofelements))).astype(vector2d.dtype)
+            elif vector2d.shape[0] == md.mesh.numberofelements2d + 1:
+                projected_vector = (paddingvalue * np.ones((md.mesh.numberofelements + 1))).astype(vector2d.dtype)
+                projected_vector[-1] = vector2d[-1]
+                vector2d = vector2d[:-1]
+            else:
+                raise TypeError("vector length not supported")
+    #Fill in
+            if layer == 0:
+                for i in range(md.mesh.numberoflayers - 1):
+                    projected_vector[(i * md.mesh.numberofelements2d):((i + 1) * md.mesh.numberofelements2d)] = vector2d
+            else:
+                projected_vector[((layer - 1) * md.mesh.numberofelements2d):(layer * md.mesh.numberofelements2d)] = vector2d
+        else:
+            if vector2d.shape[0] == md.mesh.numberofelements2d:
+                projected_vector = (paddingvalue * np.ones((md.mesh.numberofelements, np.size(vector2d, axis=1)))).astype(vector2d.dtype)
+            elif vector2d.shape[0] == md.mesh.numberofelements2d + 1:
+                projected_vector = (paddingvalue * np.ones((md.mesh.numberofelements + 1, np.size(vector2d, axis=1)))).astype(vector2d.dtype)
+                projected_vector[-1, :] = vector2d[-1, :]
+                vector2d = vector2d[:-1, :]
+            else:
+                raise TypeError("vector length not supported")
+    #Fill in
+            if layer == 0:
+                for i in range(md.mesh.numberoflayers - 1):
+                    projected_vector[(i * md.mesh.numberofelements2d):((i + 1) * md.mesh.numberofelements2d), :] = vector2d
+            else:
+                projected_vector[((layer - 1) * md.mesh.numberofelements2d):(layer * md.mesh.numberofelements2d), :] = vector2d
 
-	elif vectype.lower()=='element':
+    else:
+        raise TypeError("project3d error message: unknown projection type")
 
-		#Initialize 3d vector
-		if np.ndim(vector2d)==1:
-			if vector2d.shape[0]==md.mesh.numberofelements2d:
-				projected_vector=(paddingvalue*np.ones((md.mesh.numberofelements))).astype(vector2d.dtype)
-			elif vector2d.shape[0]==md.mesh.numberofelements2d+1:
-				projected_vector=(paddingvalue*np.ones((md.mesh.numberofelements+1))).astype(vector2d.dtype)
-				projected_vector[-1]=vector2d[-1]
-				vector2d=vector2d[:-1]
-			else:
-				raise TypeError("vector length not supported")
-			#Fill in
-			if layer==0:
-				for i in xrange(md.mesh.numberoflayers-1):
-					projected_vector[(i*md.mesh.numberofelements2d):((i+1)*md.mesh.numberofelements2d)]=vector2d
-			else:
-				projected_vector[((layer-1)*md.mesh.numberofelements2d):(layer*md.mesh.numberofelements2d)]=vector2d
-		else:
-			if vector2d.shape[0]==md.mesh.numberofelements2d:
-				projected_vector=(paddingvalue*np.ones((md.mesh.numberofelements,  np.size(vector2d,axis=1)))).astype(vector2d.dtype)
-			elif vector2d.shape[0]==md.mesh.numberofelements2d+1:
-				projected_vector=(paddingvalue*np.ones((md.mesh.numberofelements+1,np.size(vector2d,axis=1)))).astype(vector2d.dtype)
-				projected_vector[-1,:]=vector2d[-1,:]
-				vector2d=vector2d[:-1,:]
-			else:
-				raise TypeError("vector length not supported")
-			#Fill in
-			if layer==0:
-				for i in xrange(md.mesh.numberoflayers-1):
-					projected_vector[(i*md.mesh.numberofelements2d):((i+1)*md.mesh.numberofelements2d),:]=vector2d
-			else:
-				projected_vector[((layer-1)*md.mesh.numberofelements2d):(layer*md.mesh.numberofelements2d),:]=vector2d
+    if vector1d:
+        projected_vector = projected_vector.reshape(-1, )
 
-	else:
-		raise TypeError("project3d error message: unknown projection type")
-
-	if vector1d:
-		projected_vector=projected_vector.reshape(-1,)
-
-	return projected_vector
+    return projected_vector
Index: /issm/trunk/src/m/geometry/AboveGround.m
===================================================================
--- /issm/trunk/src/m/geometry/AboveGround.m	(revision 24313)
+++ /issm/trunk/src/m/geometry/AboveGround.m	(revision 24313)
@@ -0,0 +1,6 @@
+function [x,y,z]=AboveGround(lat,lon,r,height); 
+
+	r=r+height;  
+	x = r .* cosd(lat) .* cosd(lon);
+	y = r .* cosd(lat) .* sind(lon);
+	z = r .*sind(lat);
Index: /issm/trunk/src/m/geometry/FlagElements.py
===================================================================
--- /issm/trunk/src/m/geometry/FlagElements.py	(revision 24312)
+++ /issm/trunk/src/m/geometry/FlagElements.py	(revision 24313)
@@ -1,67 +1,66 @@
 import numpy as np
 import os
-#from basinzoom import basinzoon
 from ContourToMesh import ContourToMesh
 import MatlabFuncs as m
 import PythonFuncs as p
 
-def FlagElements(md,region):
-	"""
-	FLAGELEMENTS - flag the elements in an region
 
-	   The region can be given with an exp file, a list of elements or vertices
+def FlagElements(md, region):
+    """
+    FLAGELEMENTS - flag the elements in an region
 
-	   Usage: 
-	      flag=FlagElements(md,region);
+       The region can be given with an exp file, a list of elements or vertices
 
-	   Example:
-	      flag=FlagElements(md,'all');
-	      flag=FlagElements(md,'');
-	      flag=FlagElements(md,'Domain.exp');
-	      flag=FlagElements(md,'~Domain.exp');
-	"""
+       Usage:
+          flag = FlagElements(md, region)
 
-	if   isinstance(region,(str,unicode)):
-		if   not region:
-			flag=np.zeros(md.mesh.numberofelements,bool)
-			invert=0
-		elif m.strcmpi(region,'all'):
-			flag=np.ones(md.mesh.numberofelements,bool)
-			invert=0
-		else:
-			#make sure that we actually don't want the elements outside the domain outline!
-			if m.strcmpi(region[0],'~'):
-				region=region[1:]
-				invert=1
-			else:
-				invert=0
+       Example:
+          flag = FlagElements(md, 'all')
+          flag = FlagElements(md, '')
+          flag = FlagElements(md, 'Domain.exp')
+          flag = FlagElements(md, '~Domain.exp')
+    """
 
-			#does the region domain outline exist or do we have to look for xlim,ylim in basinzoom?
-			if not os.path.exists(region):
-				if len(region)>3 and not m.strcmp(region[-4:],'.exp'):
-					raise IOError("Error: File 'region' not found!" % region)
-				raise RuntimeError("FlagElements.py calling basinzoom.py is not complete.")
-				xlim,ylim=basinzoom('basin',region)
-				flag_nodes=p.logical_and_n(md.mesh.x<xlim[1],md.mesh.x>xlim[0],md.mesh.y<ylim[1],md.mesh.y>ylim[0])
-				flag=np.prod(flag_nodes[md.mesh.elements],axis=1).astype(bool)
-			else:
-				#ok, flag elements
-				flag=ContourToMesh(md.mesh.elements[:,0:3].copy(),md.mesh.x,md.mesh.y,region,'element',1)
-				flag=flag.astype(bool)
+    if isinstance(region, str):
+        if not region:
+            flag = np.zeros(md.mesh.numberofelements, bool)
+            invert = 0
+        elif m.strcmpi(region, 'all'):
+            flag = np.ones(md.mesh.numberofelements, bool)
+            invert = 0
+        else:
+            #make sure that we actually don't want the elements outside the domain outline!
+            if m.strcmpi(region[0], '~'):
+                region = region[1:]
+                invert = 1
+            else:
+                invert = 0
 
-		if invert:
-			flag=np.logical_not(flag)
+                #does the region domain outline exist or do we have to look for xlim, ylim in basinzoom?
+            if not os.path.exists(region):
+                if len(region) > 3 and not m.strcmp(region[-4:], '.exp'):
+                    raise IOError("Error: File 'region' not found!" % region)
+                raise RuntimeError("FlagElements.py calling basinzoom.py is not complete.")
+                xlim, ylim = basinzoom('basin', region)
+                flag_nodes = p.logical_and_n(md.mesh.x < xlim[1], md.mesh.x > xlim[0], md.mesh.y < ylim[1], md.mesh.y > ylim[0])
+                flag = np.prod(flag_nodes[md.mesh.elements], axis=1).astype(bool)
+            else:
+                #ok, flag elements
+                flag = ContourToMesh(md.mesh.elements[:, 0:3].copy(), md.mesh.x, md.mesh.y, region, 'element', 1)
+                flag = flag.astype(bool)
 
-	elif isinstance(region,np.ndarray) or isinstance(region,bool):
-		if np.size(region,0)==md.mesh.numberofelements:
-			flag=region
-		elif np.size(region,0)==md.mesh.numberofvertices:
-			flag=(np.sum(region[md.mesh.elements-1]>0,axis=1)==np.size(md.mesh.elements,1))
-		else:
-			raise TypeError("Flaglist for region must be of same size as number of elements in model.")
+        if invert:
+            flag = np.logical_not(flag)
 
-	else:
-		raise TypeError("Invalid region option")
+    elif isinstance(region, np.ndarray) or isinstance(region, bool):
+        if np.size(region, 0) == md.mesh.numberofelements:
+            flag = region
+        elif np.size(region, 0) == md.mesh.numberofvertices:
+            flag = (np.sum(region[md.mesh.elements - 1] > 0, axis=1) == np.size(md.mesh.elements, 1))
+        else:
+            raise TypeError("Flaglist for region must be of same size as number of elements in model.")
 
-	return flag
+    else:
+        raise TypeError("Invalid region option")
 
+    return flag
Index: /issm/trunk/src/m/geometry/GetAreas.py
===================================================================
--- /issm/trunk/src/m/geometry/GetAreas.py	(revision 24312)
+++ /issm/trunk/src/m/geometry/GetAreas.py	(revision 24313)
@@ -1,52 +1,52 @@
 import numpy as np
 
-def GetAreas(index,x,y,z=np.array([])):
-	"""
-	GETAREAS - compute areas or volumes of elements
 
-	   compute areas of triangular elements or volumes 
-	   of pentahedrons
+def GetAreas(index, x, y, z=np.array([])):
+    """
+    GETAREAS - compute areas or volumes of elements
 
-	   Usage:
-	      areas  =GetAreas(index,x,y);
-	      volumes=GetAreas(index,x,y,z);
+       compute areas of triangular elements or volumes
+       of pentahedrons
 
-	   Examples:
-	      areas  =GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y);
-	      volumes=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y,md.z);
-	"""
+       Usage:
+          areas  =GetAreas(index, x, y)
+          volumes = GetAreas(index, x, y, z)
 
-	#get number of elements and number of nodes
-	nels=np.size(index,axis=0)
-	nods=np.size(x)
+       Examples:
+          areas  =GetAreas(md.mesh.elements, md.mesh.x, md.mesh.y)
+          volumes = GetAreas(md.mesh.elements, md.mesh.x, md.mesh.y, md.z)
+    """
 
-	#some checks
-	if np.size(y)!=nods or (z and np.size(z)!=nods):
-		raise TypeError("GetAreas error message: x,y and z do not have the same length.")
-	if np.max(index)>nods:
-		raise TypeError("GetAreas error message: index should not have values above %d." % nods)
-	if (not z and np.size(index,axis=1)!=3):
-		raise TypeError("GetAreas error message: index should have 3 columns for 2d meshes.")
-	if (z and np.size(index,axis=1)!=6):
-		raise TypeError("GetAreas error message: index should have 6 columns for 3d meshes.")
+    #get number of elements and number of nodes
+    nels = np.size(index, axis=0)
+    nods = np.size(x)
 
-	#initialization
-	areas=np.zeros(nels)
-	x1=x[index[:,0]-1]
-	x2=x[index[:,1]-1]
-	x3=x[index[:,2]-1]
-	y1=y[index[:,0]-1]
-	y2=y[index[:,1]-1]
-	y3=y[index[:,2]-1]
+    #some checks
+    if np.size(y) != nods or (z and np.size(z) != nods):
+        raise TypeError("GetAreas error message: x, y and z do not have the same length.")
+    if np.max(index) > nods:
+        raise TypeError("GetAreas error message: index should not have values above %d." % nods)
+    if (not z and np.size(index, axis=1) != 3):
+        raise TypeError("GetAreas error message: index should have 3 columns for 2d meshes.")
+    if (z and np.size(index, axis=1) != 6):
+        raise TypeError("GetAreas error message: index should have 6 columns for 3d meshes.")
 
-	#compute the volume of each element
-	if not z:
-		#compute the surface of the triangle
-		areas=(0.5*((x2-x1)*(y3-y1)-(y2-y1)*(x3-x1)))
-	else:
-		#V=area(triangle)*1/3(z1+z2+z3)
-		thickness=np.mean(z[index[:,3:6]-1])-np.mean(z[index[:,0:3]-1])
-		areas=(0.5*((x2-x1)*(y3-y1)-(y2-y1)*(x3-x1)))*thickness
+    #initialization
+    areas = np.zeros(nels)
+    x1 = x[index[:, 0] - 1]
+    x2 = x[index[:, 1] - 1]
+    x3 = x[index[:, 2] - 1]
+    y1 = y[index[:, 0] - 1]
+    y2 = y[index[:, 1] - 1]
+    y3 = y[index[:, 2] - 1]
 
-	return areas
+    #compute the volume of each element
+    if not z:
+        #compute the surface of the triangle
+        areas = (0.5 * ((x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1)))
+    else:
+        #V = area(triangle) * 1 / 3(z1 + z2 + z3)
+        thickness = np.mean(z[index[:, 3:6] - 1]) - np.mean(z[index[:, 0:3] - 1])
+        areas = (0.5 * ((x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1))) * thickness
 
+    return areas
Index: /issm/trunk/src/m/geometry/NowickiProfile.py
===================================================================
--- /issm/trunk/src/m/geometry/NowickiProfile.py	(revision 24312)
+++ /issm/trunk/src/m/geometry/NowickiProfile.py	(revision 24313)
@@ -1,44 +1,44 @@
 import numpy as np
 
+
 def NowickiProfile(x):
-	"""
-	NOWICKIPROFILE - Create profile at the transition zone based on Sophie Nowicki's thesis
+    """
+    NOWICKIPROFILE - Create profile at the transition zone based on Sophie Nowicki's thesis
 
-	Usage:
-		[b h] = NowickiProfile(x)
+    Usage:
+        [b h] = NowickiProfile(x)
 
-		- h = ice thickness
-		- b = ice base
-		- x = along flow coordinate
-	"""
-	#Constant for theoretical profile
-	delta = 0.1		#ratio of water density and ice density -1
-	hg    = 1.		#ice thickness at grounding line
-	sea   = hg / (1+delta)	#sea level
-	lamda = 0.1		#ration of deviatoric stress and water pressure
-	beta  = 5.		#friction coefficient
-	ms    = 0.005		#surface accumulation rat
-	mu    = 5.		#viscosity
-	q     = 0.801		#ice mass flux
+         - h = ice thickness
+         - b = ice base
+         - x = along flow coordinate
+    """
+    #Constant for theoretical profile
+    delta = 0.1  #ratio of water density and ice density - 1
+    hg = 1.  #ice thickness at grounding line
+    sea = hg / (1 + delta)  #sea level
+    lamda = 0.1  #ration of deviatoric stress and water pressure
+    beta = 5.  #friction coefficient
+    ms = 0.005  #surface accumulation rat
+    mu = 5.  #viscosity
+    q = 0.801  #ice mass flux
 
-	#mesh parameters
-	b = np.zeros((np.size(x),))
-	h = np.zeros((np.size(x),))
-	s = np.zeros((np.size(x),))
+    #mesh parameters
+    b = np.zeros((np.size(x), ))
+    h = np.zeros((np.size(x), ))
+    s = np.zeros((np.size(x), ))
 
-	#upstream of the GL
-	for i in range(np.size(x) / 2):
-		ss = np.roots([1, 4 * lamda * beta, 0, 0, 6 * lamda * ms * x[i]**2 +
-				12 * lamda * q * x[i] - hg**4 - 4 * lamda * beta * hg**3])
-		for j in range(4):
-			if (np.isreal(ss[j]) > 0) and (np.imag(ss[j]) == 0):
-				s[i] = ss[j]
-		h[i] = s[i]
-		b[i] = 0.
+    #upstream of the GL
+    for i in range(int(np.size(x) / 2)):
+        ss = np.roots([1, 4 * lamda * beta, 0, 0, 6 * lamda * ms * x[i]**2 + 12 * lamda * q * x[i] - hg**4 - 4 * lamda * beta * hg**3])
+        for j in range(4):
+            if (np.isreal(ss[j]) > 0) and (np.imag(ss[j]) == 0):
+                s[i] = ss[j]
+        h[i] = s[i]
+        b[i] = 0.
 
-	#downstream of the GL
-	for i in range(np.size(x) / 2, np.size(x)):
-		h[i] = (x[i] / (4. * (delta+1) * q) + hg**(-2))**(-0.5) # ice thickness for ice shelf from (3.1)
-		b[i] = sea - h[i] * (1. / (1+delta))
+    #downstream of the GL
+    for i in range(int(np.size(x) / 2), int(np.size(x))):
+        h[i] = (x[i] / (4. * (delta + 1) * q) + hg**(-2))**(-0.5)  # ice thickness for ice shelf from (3.1)
+        b[i] = sea - h[i] * (1. / (1 + delta))
 
-	return [b, h, sea]
+    return [b, h, sea]
Index: /issm/trunk/src/m/geometry/SegIntersect.py
===================================================================
--- /issm/trunk/src/m/geometry/SegIntersect.py	(revision 24312)
+++ /issm/trunk/src/m/geometry/SegIntersect.py	(revision 24313)
@@ -1,82 +1,82 @@
 import numpy as np
 
-def SegIntersect(seg1,seg2):
-	"""
-	SEGINTERSECT - test of segments intersection
 
-	   return 1 if the two segments intersect
-	   seg1=[x1 y1; x2 y2]
-	   seg2=[x1 y1; x2 y2]
+def SegIntersect(seg1, seg2):
+    """
+    SEGINTERSECT - test of segments intersection
 
-	   Usage:
-	      bval=SegIntersect(seg1,seg2)
-	"""
+       return 1 if the two segments intersect
+       seg1 = [x1 y1; x2 y2]
+       seg2 = [x1 y1; x2 y2]
 
-	bval=1
+       Usage:
+          bval = SegIntersect(seg1, seg2)
+    """
 
-	xA=seg1[0,0]
-	yA=seg1[0,1]
-	xB=seg1[1,0]
-	yB=seg1[1,1]
-	xC=seg2[0,0]
-	yC=seg2[0,1]
-	xD=seg2[1,0]
-	yD=seg2[1,1]
+    bval = 1
 
-	O2A=np.array([xA,yA])-np.array([xD/2.+xC/2.,yD/2.+yC/2.])
-	O2B=np.array([xB,yB])-np.array([xD/2.+xC/2.,yD/2.+yC/2.])
-	O1C=np.array([xC,yC])-np.array([xA/2.+xB/2.,yB/2.+yA/2.])
-	O1D=np.array([xD,yD])-np.array([xA/2.+xB/2.,yB/2.+yA/2.])
+    xA = seg1[0, 0]
+    yA = seg1[0, 1]
+    xB = seg1[1, 0]
+    yB = seg1[1, 1]
+    xC = seg2[0, 0]
+    yC = seg2[0, 1]
+    xD = seg2[1, 0]
+    yD = seg2[1, 1]
 
-	n1=np.array([yA-yB,xB-xA])    #normal vector to segA
-	n2=np.array([yC-yD,xD-xC])    #normal vector to segB
+    O2A = np.array([xA, yA]) - np.array([xD / 2. + xC / 2., yD / 2. + yC / 2.])
+    O2B = np.array([xB, yB]) - np.array([xD / 2. + xC / 2., yD / 2. + yC / 2.])
+    O1C = np.array([xC, yC]) - np.array([xA / 2. + xB / 2., yB / 2. + yA / 2.])
+    O1D = np.array([xD, yD]) - np.array([xA / 2. + xB / 2., yB / 2. + yA / 2.])
 
-	test1=np.dot(n2,O2A)
-	test2=np.dot(n2,O2B)
+    n1 = np.array([yA - yB, xB - xA])  #normal vector to segA
+    n2 = np.array([yC - yD, xD - xC])  #normal vector to segB
 
-	if test1*test2>0:
-		bval=0
-		return bval
+    test1 = np.dot(n2, O2A)
+    test2 = np.dot(n2, O2B)
 
-	test3=np.dot(n1,O1C)
-	test4=np.dot(n1,O1D)
+    if test1 * test2 > 0:
+        bval = 0
+        return bval
 
-	if test3*test4>0:
-		bval=0
-		return bval
+    test3 = np.dot(n1, O1C)
+    test4 = np.dot(n1, O1D)
 
-	#if colinear
-	if test1*test2==0 and test3*test4==0 and np.linalg.det(np.hstack((n1.reshape((-1,)),n2.reshape(-1,))))==0:
+    if test3 * test4 > 0:
+        bval = 0
+        return bval
 
-		#projection on the axis O1O2
-		O2O1=np.array([xA/2.+xB/2.,yB/2.+yA/2.])-np.array([xD/2.+xC/2.,yD/2.+yC/2.])
-		O1A=np.dot(O2O1,(O2A-O2O1))
-		O1B=np.dot(O2O1,(O2B-O2O1))
-		O1C=np.dot(O2O1,O1C)
-		O1D=np.dot(O2O1,O1D)
+    #if colinear
+    if test1 * test2 == 0 and test3 * test4 == 0 and np.linalg.det(np.hstack((n1.reshape((-1, )), n2.reshape(-1, )))) == 0:
 
-		#test if one point is included in the other segment (->bval=1)
-		if (O1C-O1A)*(O1D-O1A)<0:
-			bval=1
-			return bval
-		if (O1C-O1B)*(O1D-O1B)<0:
-			bval=1
-			return bval
-		if (O1A-O1C)*(O1B-O1C)<0:
-			bval=1
-			return bval
-		if (O1A-O1D)*(O1B-O1D)<0:
-			bval=1
-			return bval
+        #projection on the axis O1O2
+        O2O1 = np.array([xA / 2. + xB / 2., yB / 2. + yA / 2.]) - np.array([xD / 2. + xC / 2., yD / 2. + yC / 2.])
+        O1A = np.dot(O2O1, (O2A - O2O1))
+        O1B = np.dot(O2O1, (O2B - O2O1))
+        O1C = np.dot(O2O1, O1C)
+        O1D = np.dot(O2O1, O1D)
 
-		#test if the 2 segments have the same middle (->bval=1)
-		if O2O1==0:
-			bval=1
-			return bval
+    #test if one point is included in the other segment (-> bval = 1)
+        if (O1C - O1A) * (O1D - O1A) < 0:
+            bval = 1
+            return bval
+        if (O1C - O1B) * (O1D - O1B) < 0:
+            bval = 1
+            return bval
+        if (O1A - O1C) * (O1B - O1C) < 0:
+            bval = 1
+            return bval
+        if (O1A - O1D) * (O1B - O1D) < 0:
+            bval = 1
+            return bval
 
-		#else
-		bval=0
-		return bval
+    #test if the 2 segments have the same middle (-> bval = 1)
+        if O2O1 == 0:
+            bval = 1
+            return bval
 
-	return bval
+    #else
+        bval = 0
+        return bval
 
+    return bval
Index: /issm/trunk/src/m/geometry/slope.py
===================================================================
--- /issm/trunk/src/m/geometry/slope.py	(revision 24312)
+++ /issm/trunk/src/m/geometry/slope.py	(revision 24313)
@@ -1,46 +1,46 @@
-import numpy as  np
-from GetNodalFunctionsCoeff import  GetNodalFunctionsCoeff
+import numpy as np
+from GetNodalFunctionsCoeff import GetNodalFunctionsCoeff
+from project3d import project3d
 
-def slope(md,*args):
-	"""
-	SLOPE - compute the surface slope
 
-	Usage:
-		sx,sy,s=slope(md)
-		sx,sy,s=slope(md,md.results.TransientSolution(1).Surface)
-	"""
+def slope(md, *args):
+    """
+    SLOPE - compute the surface slope
 
-	#load some variables (it is much faster if the variables are loaded from md once for all) 
-	if md.mesh.dimension()==2:
-		numberofelements=md.mesh.numberofelements
-		numberofnodes=md.mesh.numberofvertices
-		index=md.mesh.elements
-		x=md.mesh.x ; y=md.mesh.y
-	else:
-		numberofelements=md.mesh.numberofelements2d
-		numberofnodes=md.mesh.numberofvertices2d
-		index=md.mesh.elements2d
-		x=md.mesh.x2d; y=md.mesh.y2d
+    Usage:
+            sx, sy, s = slope(md)
+            sx, sy, s = slope(md, md.results.TransientSolution(1).Surface)
+    """
 
-	if len(args)==0:
-		surf=md.geometry.surface
-	elif len(args)==1:
-		surf=args[0]
-	else:
-		raise RuntimeError("slope.py usage error")
+    #load some variables (it is much faster if the variables are loaded from md once for all)
+    if md.mesh.dimension() == 2:
+        index = md.mesh.elements
+        x = md.mesh.x
+        y = md.mesh.y
+    else:
+        index = md.mesh.elements2d
+        x = md.mesh.x2d
+        y = md.mesh.y2d
 
-	#%compute nodal functions coefficients N(x,y)=alpha x + beta y + gamma
-	alpha,beta=GetNodalFunctionsCoeff(index,x,y)[0:2]
+    if len(args) == 0:
+        surf = md.geometry.surface
+    elif len(args) == 1:
+        surf = args[0]
+    else:
+        raise RuntimeError("slope.py usage error")
 
-	summation=np.array([[1],[1],[1]])
-	sx=np.dot(surf[index-1,0]*alpha,summation).reshape(-1,)
-	sy=np.dot(surf[index-1,0]*beta,summation).reshape(-1,)
+    #%compute nodal functions coefficients N(x, y)=alpha x + beta y + gamma
+    alpha, beta = GetNodalFunctionsCoeff(index, x, y)[0:2]
 
-	s=np.sqrt(sx**2+sy**2)
+    summation = np.array([[1], [1], [1]])
+    sx = np.dot(surf[index - 1, 0] * alpha, summation).reshape(-1, )
+    sy = np.dot(surf[index - 1, 0] * beta, summation).reshape(-1, )
 
-	if md.mesh.dimension()==3:
-		sx=project3d(md,'vector',sx,'type','element')
-		sy=project3d(md,'vector',sy,'type','element')
-		s=np.sqrt(sx**2+sy**2)
+    s = np.sqrt(sx**2 + sy**2)
 
-	return (sx,sy,s)
+    if md.mesh.dimension() == 3:
+        sx = project3d(md, 'vector', sx, 'type', 'element')
+        sy = project3d(md, 'vector', sy, 'type', 'element')
+        s = np.sqrt(sx**2 + sy**2)
+
+    return (sx, sy, s)
Index: /issm/trunk/src/m/interp/InterpFromModel3dToMesh2d.m
===================================================================
--- /issm/trunk/src/m/interp/InterpFromModel3dToMesh2d.m	(revision 24313)
+++ /issm/trunk/src/m/interp/InterpFromModel3dToMesh2d.m	(revision 24313)
@@ -0,0 +1,74 @@
+function data_prime = InterpFromModel3dToMesh2d(md,data,x_prime,y_prime,sigma,default_value);
+%INTERPFROMMODEL3DTOMESH2D - Interpolation from a 3d hexahedron mesh onto a list of 2d points
+%
+%   Usage:
+%      md:  3d model holding the data to be interpolated onto the 2d mesh
+%      data:	matrix holding the data to be interpolated onto the 2d mesh
+%      x_prime,y_prime:	coordinates of the points onto which we interpolate
+%      sigma:  scaled vertical coordinates from which the data will be interpolated (from base=0; from surface=1, NaN=vertical average of data)
+%      default_value:	default value if no data is found (holes)
+%      data_prime:	vector of mesh interpolated data
+%
+%   Example:
+%      load('temperature.mat');
+%
+%      % interpolating the temperature from the base of a 3d model:
+%      md.initialization.temperature=InterpFromModel3dToMesh2d(md3d,temperature,md.mesh.x,md.mesh.y,0,253);
+%
+%      % interpolating the temperature from the surface of a 3d model:
+%      md.initialization.temperature=InterpFromModel3dToMesh2d(md3d,temperature,md.mesh.x,md.mesh.y,1,253);
+%
+%      % averaging the temperature over the vertical layers and then interpolating onto the 2d mesh:
+%      md.initialization.temperature=InterpFromModel3dToMesh2d(md3d,temperature,md.mesh.x,md.mesh.y,NaN,253);
+
+% Check usage
+if nargin~=6
+	help InterpFromModel3dToMesh2d
+	error('Wrong usage (see above)');
+end
+
+if dimension(md.mesh)~=3
+	error('Model should be 3d');
+end
+
+if (length(data)~=md.mesh.numberofelements & length(data)~=md.mesh.numberofvertices),
+   error('Data not supported yet');
+end
+
+if sigma<0 | sigma>1
+	help InterpFromModel3dToMesh2d
+	error('Wrong value for sigma. It should be between 0 and 1, or NaN (see above)');
+end
+
+if length(x_prime)~=length(y_prime)
+	error('x and y should have the same size')
+end
+
+% First, check if a vertical average should be performed. If yes, perform a interpolation from a 2d mesh  
+if isnan(sigma),
+	% average data and then interpolate onto the 2d mesh
+	averaged_data = DepthAverage(md,data);
+	data_prime = InterpFromMeshToMesh2d(md.mesh.elements2d,md.mesh.x2d,md.mesh.y2d,averaged_data,x_prime,y_prime,'default',default_value);
+else
+	% Ok, perform an interpolation from a 3d mesh into a 2d mesh 
+	% Scaling the z coordinate (3d mesh)
+	alpha = (md.mesh.z-md.geometry.base)./md.geometry.thickness;
+
+	if  alpha<0 | alpha>1
+		error('Wrong value for alpha. Check the geometry of your model');
+	end
+
+	% Building the z coordinate for the 2d mesh
+	z_prime = sigma*ones(size(x_prime));
+
+	% Adjusting such that the 2d mesh is inside the 3d mesh
+	if sigma==0,
+		z_prime = z_prime+eps;
+	elseif sigma==1,
+		z_prime = z_prime-eps;
+	end
+
+	% Now, call the 3d interpolation
+	data_prime = InterpFromMeshToMesh3d(md.mesh.elements,md.mesh.x,md.mesh.y,alpha,data,x_prime,y_prime,z_prime,default_value);
+
+end
Index: /issm/trunk/src/m/interp/InterpFromModelToModel3d.m
===================================================================
--- /issm/trunk/src/m/interp/InterpFromModelToModel3d.m	(revision 24313)
+++ /issm/trunk/src/m/interp/InterpFromModelToModel3d.m	(revision 24313)
@@ -0,0 +1,42 @@
+function data_prime = InterpFromModelToModel3d(md1,data,md2,default_value);
+%INTERPFROMMODELTOMODEL3D - Interpolation from a 3d hexahedron mesh onto another 3d hexahedron mesh
+%
+%   Usage:
+%      md1:  3d model holding the data to be interpolated onto another 3d model
+%      data:  matrix holding the data to be interpolated onto another 3d mesh
+%      md2:  3d model for which the data will be interpolated
+%      default_value:  default value if no data is found (holes)
+%      data_prime:  vector of 3d mesh interpolated data
+%
+%   Example:
+%
+%      % interpolating the temperature from 3d mesh model:
+%      md2.initialization.temperature = InterpFromModelToModel3d(md1,md1.results.ThermalSolution.Temperature,md2,253);
+%
+
+% Check usage
+if nargin~=4
+   help InterpFromModelToModel3d
+   error('Wrong usage (see above)');
+end
+
+if (length(data)~=md1.mesh.numberofelements & length(data)~=md1.mesh.numberofvertices),
+   error('Data not supported yet');
+end
+
+if (dimension(md1.mesh)~=3 | dimension(md2.mesh)~=3)
+      error('Both models should be 3d');
+end
+
+% Scaling the vertical coordinates:
+sigma1 = (md1.mesh.z-md1.geometry.base)./md1.geometry.thickness;
+sigma2 = (md2.mesh.z-md2.geometry.base)./md2.geometry.thickness;
+
+% Adjusting sigma2 such that mesh 2 is inside mesh 1
+pos = find(sigma2==0);
+sigma2(pos) = sigma2(pos)+eps; 
+pos = find(sigma2==1);
+sigma2(pos) = sigma2(pos)-eps;
+
+% Now, perform the interpolation
+data_prime = InterpFromMeshToMesh3d(md1.mesh.elements,md1.mesh.x,md1.mesh.y,sigma1,data,md2.mesh.x,md2.mesh.y,sigma2,default_value); 
Index: /issm/trunk/src/m/interp/SectionValues.py
===================================================================
--- /issm/trunk/src/m/interp/SectionValues.py	(revision 24312)
+++ /issm/trunk/src/m/interp/SectionValues.py	(revision 24313)
@@ -1,5 +1,5 @@
 import os
 from expread import expread
-import numpy as  np
+import numpy as np
 from project2d import project2d
 #from InterpFromMesh2d import InterpFromMesh2d
@@ -7,133 +7,132 @@
 from InterpFromMeshToMesh3d import InterpFromMeshToMesh3d
 
-def SectionValues(md,data,infile,resolution):
-	'''
-	compute the value of a field on a section
-	
-	This routine gets the value of a given field of the model on points
-	given in the file infile (Argus type file). Resolution must be a list
-	[horizontal_resolution, vertical_resolution]
-	
-	Usage:
-	[elements,x,y,z,s,data]=SectionValues(md,data,filename,resolution)
-	[elements,x,y,z,s,data]=SectionValues(md,data,profile_structure,resolution)
-	'''
 
-	if os.path.isfile(infile):
-		profile=expread(infile)[0]
-		nods=profile['nods']
-		x=profile['x']
-		y=profile['y']
-	else:
-		raise IOError('file %s not found' % infile)
+def SectionValues(md, data, infile, resolution):
+    '''
+    compute the value of a field on a section
 
-	#get the specified resolution
-	if len(resolution)!=2:
-		raise ValueError('SectionValues error message: Resolution must be a list [horizontal_resolution, vertical_resolution]')
-	else:
-		res_h=resolution[0]
+    This routine gets the value of a given field of the model on points
+    given in the file infile (Argus type file). Resolution must be a list
+    [horizontal_resolution, vertical_resolution]
 
-	if md.mesh.domaintype().lower() == '3d':
-		if isinstance(resolution[1],int) or isinstance(resolution[1],float):
-			res_v=resolution[1]
-		else:
-			raise ValueError('SectionValues error: resolution must be a length-2 list of integers or floats')
+    Usage:
+    [elements, x, y, z, s, data] = SectionValues(md, data, filename, resolution)
+    [elements, x, y, z, s, data] = SectionValues(md, data, profile_structure, resolution)
+    '''
 
-	#initialization
-	X=np.array([]) #X-coordinate
-	Y=np.array([]) #Y-coordinate
-	S=np.array([0.])  #curvilinear coordinate
-	
-	for i in xrange(nods-1):
-	
-		x_start=x[i]
-		x_end=x[i+1]
-		y_start=y[i]
-		y_end=y[i+1]
-		s_start=S[-1]
-	
-		length_segment=np.sqrt((x_end-x_start)**2+(y_end-y_start)**2)
-		portion=np.ceil(length_segment/res_h)
-	
-		x_segment=np.zeros(portion)
-		y_segment=np.zeros(portion)
-		s_segment=np.zeros(portion)
+    if os.path.isfile(infile):
+        profile = expread(infile)[0]
+        nods = profile['nods']
+        x = profile['x']
+        y = profile['y']
+    else:
+        raise IOError('file %s not found' % infile)
 
-		for j in xrange(int(portion)):
-			x_segment[j]=x_start+(j)*(x_end-x_start)/portion
-			y_segment[j]=y_start+(j)*(y_end-y_start)/portion
-			s_segment[j]=s_start+j*length_segment/portion
-	
-		#plug into X and Y
-		X=np.append(X,x_segment)
-		Y=np.append(Y,y_segment)
-		S=np.append(S,s_segment)
+    #get the specified resolution
+    if len(resolution) != 2:
+        raise ValueError('SectionValues error message: Resolution must be a list [horizontal_resolution, vertical_resolution]')
+    else:
+        res_h = resolution[0]
 
-	X=np.append(X,x[nods-1])
-	Y=np.append(Y,y[nods-1])
-	
-	#Number of nodes:
-	numberofnodes=X.shape[0]
-	
-	#Compute Z
-	Z=np.zeros(numberofnodes)
-	
-	#New mesh and Data interpolation
-	if '2d' in md.mesh.domaintype().lower():
-	
-		#Interpolation of data on specified points
-		#data_interp=InterpFromMesh2d(md.mesh.elements,md.mesh.x,md.mesh.y,data,X,Y)[0]
-		data_interp=InterpFromMeshToMesh2d(md.mesh.elements,md.mesh.x,md.mesh.y,data,X,Y)[0]
-		#data_interp=griddata(md.mesh.x,md.mesh.y,data,X,Y)
-	
-		#Compute index
-		index=np.array([range(1,numberofnodes),range(2,numberofnodes+1)]).T
-	
-	else:
-	
-		#vertically extrude mesh
-	
-		#Get base and surface for each 2d point, offset to make sure that it is inside the glacier system
-		offset=1.e-3
-		base=InterpFromMeshToMesh2d(md.mesh.elements2d,md.mesh.x2d,md.mesh.y2d,project2d(md,md.geometry.base,1),X,Y)[0]+offset
-		base=base.reshape(-1,)
-		surface=InterpFromMeshToMesh2d(md.mesh.elements2d,md.mesh.x2d,md.mesh.y2d,project2d(md,md.geometry.surface,1),X,Y)[0]-offset
-		surface=surface.reshape(-1,)
-	
-		#Some useful parameters
-		layers=int(np.ceil(np.mean(md.geometry.thickness)/res_v))
-		nodesperlayer=int(numberofnodes)
-		nodestot=int(nodesperlayer*layers)
-		elementsperlayer=int(nodesperlayer-1)
-		elementstot=int((nodesperlayer-1)*(layers-1))
-	
-		#initialization
-		X3=np.zeros(nodesperlayer*layers) 
-		Y3=np.zeros(nodesperlayer*layers) 
-		Z3=np.zeros(nodesperlayer*layers) 
-		S3=np.zeros(nodesperlayer*layers) 
-		index3=np.zeros((elementstot,4))
-	
-		#Get new coordinates in 3d
-		for i in xrange(1,layers+1):
-			X3[i-1::layers]=X
-			Y3[i-1::layers]=Y
-			Z3[i-1::layers]=base+(i-1)*(surface-base)/(layers-1)
-			S3[i-1::layers]=S
-	
-			if i<layers-1:  #Build index3 with quads
-				ids=np.vstack((np.arange(i,nodestot-layers,layers),np.arange(i+1,nodestot-layers,layers),np.arange(i+layers+1,nodestot,layers),np.arange(i+layers,nodestot,layers))).T
-				index3[(i-1)*elementsperlayer:i*elementsperlayer,:]=ids
+    if md.mesh.domaintype().lower() == '3d':
+        if isinstance(resolution[1], int) or isinstance(resolution[1], float):
+            res_v = resolution[1]
+        else:
+            raise ValueError('SectionValues error: resolution must be a length - 2 list of integers or floats')
 
-		#Interpolation of data on specified points
-		data_interp=InterpFromMeshToMesh3d(md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.z,data,X3,Y3,Z3,np.nan)[0]
-	
-		#build outputs
-		X=X3 
-		Y=Y3 
-		Z=Z3  
-		S=S3 
+    #initialization
+    X = np.array([])  #X - coordinate
+    Y = np.array([])  #Y - coordinate
+    S = np.array([0.])  #curvilinear coordinate
 
-		index=index3
+    for i in range(nods - 1):
 
-	return index,X,Y,Z,S,data_interp
+        x_start = x[i]
+        x_end = x[i + 1]
+        y_start = y[i]
+        y_end = y[i + 1]
+        s_start = S[-1]
+
+        length_segment = np.sqrt((x_end - x_start)**2 + (y_end - y_start)**2)
+        portion = np.ceil(length_segment / res_h)
+
+        x_segment = np.zeros(portion)
+        y_segment = np.zeros(portion)
+        s_segment = np.zeros(portion)
+
+        for j in range(int(portion)):
+            x_segment[j] = x_start + (j) * (x_end - x_start) / portion
+            y_segment[j] = y_start + (j) * (y_end - y_start) / portion
+            s_segment[j] = s_start + j * length_segment / portion
+
+    #plug into X and Y
+        X = np.append(X, x_segment)
+        Y = np.append(Y, y_segment)
+        S = np.append(S, s_segment)
+
+    X = np.append(X, x[nods - 1])
+    Y = np.append(Y, y[nods - 1])
+
+    #Number of nodes:
+    numberofnodes = X.shape[0]
+
+    #Compute Z
+    Z = np.zeros(numberofnodes)
+
+    #New mesh and Data interpolation
+    if '2d' in md.mesh.domaintype().lower():
+
+        #Interpolation of data on specified points
+        #data_interp = InterpFromMesh2d(md.mesh.elements, md.mesh.x, md.mesh.y, data, X, Y)[0]
+        data_interp = InterpFromMeshToMesh2d(md.mesh.elements, md.mesh.x, md.mesh.y, data, X, Y)[0]
+    #data_interp = griddata(md.mesh.x, md.mesh.y, data, X, Y)
+
+    #Compute index
+        index = np.array([list(range(1, numberofnodes)), list(range(2, numberofnodes + 1))]).T
+
+    else:
+        #vertically extrude mesh
+        #Get base and surface for each 2d point, offset to make sure that it is inside the glacier system
+        offset = 1.e-3
+        base = InterpFromMeshToMesh2d(md.mesh.elements2d, md.mesh.x2d, md.mesh.y2d, project2d(md, md.geometry.base, 1), X, Y)[0] + offset
+        base = base.reshape(-1, )
+        surface = InterpFromMeshToMesh2d(md.mesh.elements2d, md.mesh.x2d, md.mesh.y2d, project2d(md, md.geometry.surface, 1), X, Y)[0] - offset
+        surface = surface.reshape(-1, )
+
+    #Some useful parameters
+        layers = int(np.ceil(np.mean(md.geometry.thickness) / res_v))
+        nodesperlayer = int(numberofnodes)
+        nodestot = int(nodesperlayer * layers)
+        elementsperlayer = int(nodesperlayer - 1)
+        elementstot = int((nodesperlayer - 1) * (layers - 1))
+
+    #initialization
+        X3 = np.zeros(nodesperlayer * layers)
+        Y3 = np.zeros(nodesperlayer * layers)
+        Z3 = np.zeros(nodesperlayer * layers)
+        S3 = np.zeros(nodesperlayer * layers)
+        index3 = np.zeros((elementstot, 4))
+
+    #Get new coordinates in 3d
+        for i in range(1, layers + 1):
+            X3[i - 1::layers] = X
+            Y3[i - 1::layers] = Y
+            Z3[i - 1::layers] = base + (i - 1) * (surface - base) / (layers - 1)
+            S3[i - 1::layers] = S
+
+            if i < layers - 1:  #Build index3 with quads
+                ids = np.vstack((np.arange(i, nodestot - layers, layers), np.arange(i + 1, nodestot - layers, layers), np.arange(i + layers + 1, nodestot, layers), np.arange(i + layers, nodestot, layers))).T
+                index3[(i - 1) * elementsperlayer:i * elementsperlayer, :] = ids
+
+    #Interpolation of data on specified points
+        data_interp = InterpFromMeshToMesh3d(md.mesh.elements, md.mesh.x, md.mesh.y, md.mesh.z, data, X3, Y3, Z3, np.nan)[0]
+
+    #build outputs
+        X = X3
+        Y = Y3
+        Z = Z3
+        S = S3
+
+        index = index3
+
+    return index, X, Y, Z, S, data_interp
Index: /issm/trunk/src/m/interp/averaging.py
===================================================================
--- /issm/trunk/src/m/interp/averaging.py	(revision 24312)
+++ /issm/trunk/src/m/interp/averaging.py	(revision 24313)
@@ -1,96 +1,95 @@
-import numpy as  np
+import numpy as np
 from GetAreas import GetAreas
-import MatlabFuncs as m
 try:
-	from scipy.sparse import csc_matrix
+    from scipy.sparse import csc_matrix
 except ImportError:
-	print "could not import scipy, no averaging capabilities enabled"
+    print("could not import scipy, no averaging capabilities enabled")
 
-def averaging(md,data,iterations,layer=0):
-	'''
-	AVERAGING - smooths the input over the mesh
-	
-	   This routine takes a list over the elements or the nodes in input
-	   and return a list over the nodes.
-	   For each iterations it computes the average over each element (average 
-	   of the vertices values) and then computes the average over each node
-	   by taking the average of the element around a node weighted by the
-	   elements volume
-	   For 3d mesh, a last argument can be added to specify the layer to be averaged on.
-	
-	   Usage:
-	      smoothdata=averaging(md,data,iterations)
-	      smoothdata=averaging(md,data,iterations,layer)
-	
-	   Examples:
-	      velsmoothed=averaging(md,md.initialization.vel,4)
-	      pressure=averaging(md,md.initialization.pressure,0)
-	      temperature=averaging(md,md.initialization.temperature,1,1)
-	'''
 
-	if len(data)!=md.mesh.numberofelements and len(data)!=md.mesh.numberofvertices:
-		raise StandardError('averaging error message: data not supported yet')
-	if md.mesh.dimension()==3 and layer!=0:
-		if layer<=0 or layer>md.mesh.numberoflayers:
-			raise ValueError('layer should be between 1 and md.mesh.numberoflayers')
-	else:
-		layer=0
-	
-	#initialization
-	if layer==0:
-		weights=np.zeros(md.mesh.numberofvertices,)
-		data=data.flatten(1)
-	else:
-		weights=np.zeros(md.mesh.numberofvertices2d,)
-		data=data[(layer-1)*md.mesh.numberofvertices2d+1:layer*md.mesh.numberofvertices2d,:]
-	
-	#load some variables (it is much faster if the variabes are loaded from md once for all)
-	if layer==0:
-		index=md.mesh.elements
-		numberofnodes=md.mesh.numberofvertices
-		numberofelements=md.mesh.numberofelements
-	else:
-		index=md.mesh.elements2d
-		numberofnodes=md.mesh.numberofvertices2d
-		numberofelements=md.mesh.numberofelements2d
+def averaging(md, data, iterations, layer=0):
+    '''
+    AVERAGING - smooths the input over the mesh
 
-	
-	#build some variables
-	if md.mesh.dimension()==3 and layer==0:
-		rep=6
-		areas=GetAreas(index,md.mesh.x,md.mesh.y,md.mesh.z)
-	elif md.mesh.dimension()==2:
-		rep=3
-		areas=GetAreas(index,md.mesh.x,md.mesh.y)
-	else:
-		rep=3
-		areas=GetAreas(index,md.mesh.x2d,md.mesh.y2d)
+       This routine takes a list over the elements or the nodes in input
+       and return a list over the nodes.
+       For each iterations it computes the average over each element (average
+       of the vertices values) and then computes the average over each node
+       by taking the average of the element around a node weighted by the
+       elements volume
+       For 3d mesh, a last argument can be added to specify the layer to be averaged on.
 
-	index=index-1 # since python indexes starting from zero
-	line=index.flatten(1)
-	areas=np.vstack(areas).reshape(-1,)
-	summation=1./rep*np.ones(rep,)
-	linesize=rep*numberofelements
-	
-	#update weights that holds the volume of all the element holding the node i
-	weights=csc_matrix( (np.tile(areas,(rep,1)).reshape(-1,),(line,np.zeros(linesize,))), shape=(numberofnodes,1))
-	
-	#initialization
-	if len(data)==numberofelements:
-		average_node=csc_matrix( (np.tile(areas*data,(rep,1)).reshape(-1,),(line,np.zeros(linesize,))), shape=(numberofnodes,1))
-		average_node=average_node/weights
-		average_node = csc_matrix(average_node)
-	else:
-		average_node=csc_matrix(data.reshape(-1,1))
+       Usage:
+          smoothdata = averaging(md, data, iterations)
+          smoothdata = averaging(md, data, iterations, layer)
 
-	#loop over iteration
-	for i in np.arange(1,iterations+1):
-		average_el=np.asarray(np.dot(average_node.todense()[index].reshape(numberofelements,rep),np.vstack(summation))).reshape(-1,)
-		average_node=csc_matrix( (np.tile(areas*average_el.reshape(-1),(rep,1)).reshape(-1,),(line,np.zeros(linesize,))), shape=(numberofnodes,1))
-		average_node=average_node/weights
-		average_node=csc_matrix(average_node)
-	
-	#return output as a full matrix (C code do not like sparse matrices)
-	average=np.asarray(average_node.todense()).reshape(-1,)
+       Examples:
+          velsmoothed = averaging(md, md.initialization.vel, 4)
+          pressure = averaging(md, md.initialization.pressure, 0)
+          temperature = averaging(md, md.initialization.temperature, 1, 1)
+    '''
 
-	return average
+    if len(data) != md.mesh.numberofelements and len(data) != md.mesh.numberofvertices:
+        raise Exception('averaging error message: data not supported yet')
+    if md.mesh.dimension() == 3 and layer != 0:
+        if layer <= 0 or layer > md.mesh.numberoflayers:
+            raise ValueError('layer should be between 1 and md.mesh.numberoflayers')
+    else:
+        layer = 0
+
+    #initialization
+    if layer == 0:
+        weights = np.zeros(md.mesh.numberofvertices, )
+        data = data.flatten(1)
+    else:
+        weights = np.zeros(md.mesh.numberofvertices2d, )
+        data = data[(layer - 1) * md.mesh.numberofvertices2d + 1:layer * md.mesh.numberofvertices2d, :]
+
+    #load some variables (it is much faster if the variabes are loaded from md once for all)
+    if layer == 0:
+        index = md.mesh.elements
+        numberofnodes = md.mesh.numberofvertices
+        numberofelements = md.mesh.numberofelements
+    else:
+        index = md.mesh.elements2d
+        numberofnodes = md.mesh.numberofvertices2d
+        numberofelements = md.mesh.numberofelements2d
+
+    #build some variables
+    if md.mesh.dimension() == 3 and layer == 0:
+        rep = 6
+        areas = GetAreas(index, md.mesh.x, md.mesh.y, md.mesh.z)
+    elif md.mesh.dimension() == 2:
+        rep = 3
+        areas = GetAreas(index, md.mesh.x, md.mesh.y)
+    else:
+        rep = 3
+        areas = GetAreas(index, md.mesh.x2d, md.mesh.y2d)
+
+    index = index - 1  # since python indexes starting from zero
+    line = index.flatten(1)
+    areas = np.vstack(areas).reshape(-1, )
+    summation = 1. / rep * np.ones(rep, )
+    linesize = rep * numberofelements
+
+    #update weights that holds the volume of all the element holding the node i
+    weights = csc_matrix((np.tile(areas, (rep, 1)).reshape(-1, ), (line, np.zeros(linesize, ))), shape=(numberofnodes, 1))
+
+    #initialization
+    if len(data) == numberofelements:
+        average_node = csc_matrix((np.tile(areas * data, (rep, 1)).reshape(-1, ), (line, np.zeros(linesize, ))), shape=(numberofnodes, 1))
+        average_node = average_node / weights
+        average_node = csc_matrix(average_node)
+    else:
+        average_node = csc_matrix(data.reshape(-1, 1))
+
+    #loop over iteration
+    for i in np.arange(1, iterations + 1):
+        average_el = np.asarray(np.dot(average_node.todense()[index].reshape(numberofelements, rep), np.vstack(summation))).reshape(-1, )
+        average_node = csc_matrix((np.tile(areas * average_el.reshape(-1), (rep, 1)).reshape(-1, ), (line, np.zeros(linesize, ))), shape=(numberofnodes, 1))
+        average_node = average_node / weights
+        average_node = csc_matrix(average_node)
+
+    #return output as a full matrix (C code do not like sparse matrices)
+    average = np.asarray(average_node.todense()).reshape(-1, )
+
+    return average
Index: /issm/trunk/src/m/interp/holefiller.py
===================================================================
--- /issm/trunk/src/m/interp/holefiller.py	(revision 24312)
+++ /issm/trunk/src/m/interp/holefiller.py	(revision 24313)
@@ -1,46 +1,47 @@
-import numpy as  np
+import numpy as np
 from scipy.spatial import cKDTree
 
-def nearestneighbors(x,y,data,goodids,badids,knn):
-	'''
-	fill holes using nearest neigbors.  Arguments include:
+
+def nearestneighbors(x, y, data, goodids, badids, knn):
+    '''
+    fill holes using nearest neigbors.  Arguments include:
 
 
-	x,y:		the coordinates of data to be filled 
-	data:		the data field to be filled (full field, including holes)
-	goodids:	id's into the vertices that have good data
-	badids:	id's into the vertices with missing/bad data
-	knn:		integer representing the k nearest neighbors to use for filling
-				holes.  The average data value over the k nearest neighbors is 
-				then used to fill the hole.
+    x, y:        the coordinates of data to be filled
+    data:        the data field to be filled (full field, including holes)
+    goodids:    id's into the vertices that have good data
+    badids:    id's into the vertices with missing / bad data
+    knn:        integer representing the k nearest neighbors to use for filling
+                holes.  The average data value over the k nearest neighbors is
+                then used to fill the hole.
 
-	Usage:
-		filleddata=nearestneighbors(x,y,data,goodids,badids,knn)
+    Usage:
+        filleddata = nearestneighbors(x, y, data, goodids, badids, knn)
 
-	Example:
-		filledthickness=nearestneighbors(x,y,data,goodids,badids,5)
-	'''
+    Example:
+        filledthickness = nearestneighbors(x, y, data, goodids, badids, 5)
+    '''
 
-	if type(knn) != int or knn<1:
-		raise TypeError('nearestneighbors error: knn should be an integer>1')
+    if type(knn) != int or knn < 1:
+        raise TypeError('nearestneighbors error: knn should be an integer > 1')
 
-	if len(x) != len(data) or len(y) != len(data):
-		raise StandardError('nearestneighbors error: x and y should have the same length as "data"')
+    if len(x) != len(data) or len(y) != len(data):
+        raise Exception('nearestneighbors error: x and y should have the same length as "data"')
 
-	filled=data
-	
-	XYGood=np.dstack([x[goodids],y[goodids]])[0]
-	XYBad=np.dstack([x[badids],y[badids]])[0]
-	tree=cKDTree(XYGood)
-	nearest=tree.query(XYBad,k=knn)[1]
-	
-	if knn==1:
-		filled[badids]=filled[goodids][nearest] # can add k=N to return the N nearest neighbors
-	else:
-		for i in range(len(badids)):
-			neardat=[]
-			for j in range(knn):
-				neardat.append(filled[goodids][nearest[i][j]])
-				filled[badids[i]]=np.mean(neardat)
-				
-	return filled
+    filled = data
+
+    XYGood = np.dstack([x[goodids], y[goodids]])[0]
+    XYBad = np.dstack([x[badids], y[badids]])[0]
+    tree = cKDTree(XYGood)
+    nearest = tree.query(XYBad, k=knn)[1]
+
+    if knn == 1:
+        filled[badids] = filled[goodids][nearest]  # can add k = N to return the N nearest neighbors
+    else:
+        for i in range(len(badids)):
+            neardat = []
+            for j in range(knn):
+                neardat.append(filled[goodids][nearest[i][j]])
+                filled[badids[i]] = np.mean(neardat)
+
+    return filled
Index: /issm/trunk/src/m/interp/interp.py
===================================================================
--- /issm/trunk/src/m/interp/interp.py	(revision 24312)
+++ /issm/trunk/src/m/interp/interp.py	(revision 24313)
@@ -1,240 +1,249 @@
-# module for inperpolating/smoothing data
-import numpy as  np
+# module for inperpolating / smoothing data
+import numpy as np
 from scipy.interpolate import CloughTocher2DInterpolator, Rbf
 from scipy.spatial import cKDTree
 try:
-	import matplotlib.pyplot as plt
+    import matplotlib.pyplot as plt
 except ImportError:
-	print 'could not import matplotlib, no plotting functions enabled.\
-			Set plotonly=False in function call'
-
-def MeshSplineToMesh2d(x,y,data,xi,yi,tol=1e-6,fill_nans=False,**kwargs):#{{{
-	'''
-	Piecewise cubic, C1 smooth, curvature-minimizing interpolant in 2D.
-	The interpolant is guaranteed to be continuously differentiable,
-	and the gradients are chosen such that the curvature of the interpolant
-	is approximately minimized.
-
-	Uses scipy.interpolate.CloughTocher2DInterpolator
-
-	x,y:			data point coordinates
-	data:			data to be interpolated (same length as x,y)
-	xi,yi:		coordintes to interpolate data onto
-	tol:			tolerance for gradient estimation (default 1e-6)
-	fill_nans:	fill nan's (holes) in data using the spline fit? 
-	**kwargs:	optional keywork arguments:
-					maxiter: maximum iterations in gradient estimation
-	
-	Returns interpolated data at given x,y coordinates.
-
-	Usage:
-		interpdata=CloughToucher2d(x,y,data)
-
-	Examples:
-		interpdata=CloughToucher2d(md.mesh.x,md.mesh.y,data)
-		interpdata=CloughToucher2d(md.mesh.x,md.mesh.y,data,tol=1e-3,maxiter=100)
-	'''
-
-	# unpack kwargs
-	maxiter=kwargs.pop('maxiter',None)
-	if 'maxiter' in kwargs: del kwargs['maxiter']
-	if maxiter:
-		assert type(maxiter)==int, 'error, maxiter should be an integer'
-	assert len(kwargs)==0, 'error, unexpected or misspelled kwargs'
-
-	# create sub-vectors that just cover the limits of xi and yi
-	# TODO x,y not necessarily a grid, so need a better definition of dx,dy (e.g. average element size)
-	dx=500
-	dy=500
-	#dx=x[1]-x[0]
-	#dy=y[1]-y[0]
-	xlim=[min(xi)-dx,max(xi)+dx]
-	ylim=[min(yi)-dy,max(yi)+dy]
-	xflag=np.logical_and(x>xlim[0],x<xlim[1])
-	yflag=np.logical_and(y>ylim[0],y<ylim[1])
-	bothind=np.nonzero(np.logical_and(xflag,yflag))
-	subdata=data[bothind]
-	subx=x[bothind]
-	suby=y[bothind]
-	points=np.array([subx,suby]).T
-
-	# mask out any nan's in the data and corresponding coordinate points
-	mask=np.isnan(subdata)
-	ind=np.nonzero(mask)[0]
-	if len(ind) and fill_nans:
-		print "		WARNING: filling nans using spline fit through good data points, which may or may not be appropriate. Check results carefully."
-	subdata=np.delete(subdata,ind)
-	points=np.delete(points,ind,axis=0)
-
-	if maxiter:
-		spline=CloughTocher2DInterpolator(points,subdata,tol,maxiter=maxiter)
-	else:
-		spline=CloughTocher2DInterpolator(points,subdata,tol)
-
-	interpdata=spline(xi,yi)
-	
-	if not fill_nans:
-		# identify nan's in xi,yi using nearest neighbors
-		xyinterp=np.dstack([xi,yi])[0]
-		xg,yg=np.meshgrid(subx,suby)
-		xydata=np.dstack([subx,suby])[0]
-		tree=cKDTree(xydata)
-		nearest=tree.query(xyinterp)[1]
-		pos=np.nonzero(np.isnan(subdata[nearest]))
-		interpdata[pos]=subdata[nearest][pos]
-
-	return interpdata
-#}}}
-def GridSplineToMesh2d(x,y,data,xi,yi,default_value=np.nan,plotonly=False,fill_nans=False):#{{{
-	'''
-	python analog to InterpFromGridToMesh.  This routine uses
-	scipy.interpolate.CloughTocher2dInterpolator to create a bivariate spline
-	interpolation of the input data and then return values of the spline
-	on the x,y coordinates of the model mesh.  The interpolant is piece-wise
-	cubic, C1 smooth (continuously differentiable) and has approximately 
-	minimized curvature.  See "help(scipy.interpolate.CloughTocher2dInterpolator)"
-	for more information on the routine.
-
-	NOTE: this routine will not be appropriate if there are large holes (nan's) in 
-	the input data.  A non-spline interpolation scheme should be used in that case.
-
-	x,y:				vectors defining the coordinates of the input data
-	data:				2D array of input data
-	xi,yi:			x and y coordinates to be interpolated onto
-	default_value:	default value if points lie outside the convex hull of input
-						points (defaults to nan if not specified)
-	plotonly:		plot the data to be interpolated using imshow (useful for
-	fill_nans:		fill nan's (holes) in data using the spline fit? 
-
-	Usage:
-		interpdata=GridToMesh(x,y,data,xi,yi,default_value=np.nan,plotonly=False,fill_nans=False)
-
-	Examples:
-		interpdata=GridToMesh(x_m,y_m,data,md.mesh.x,md.mesh.y,0)
-	'''
-
-	if np.ndim(x)==2:
-		x=x.reshape(-1,)
-	if np.ndim(y)==2:
-		y=y.reshape(-1,)
-	if len(x) != data.shape[1]+1 and len(x) != data.shape[1]:
-		raise ValueError('x should have same length as ncols(data) or ncols(data)+1')
-	if len(y) != data.shape[0]+1 and len(y) != data.shape[0]:
-		raise ValueError('y should have same length as nrows(data) or nrows(data)+1')
-	
-	# create sub-grid that just covers the limits of xi and yi
-	dx=x[1]-x[0]
-	dy=y[1]-y[0]
-	xlim=[min(xi)-dx,max(xi)+dx]
-	ylim=[min(yi)-dy,max(yi)+dy]
-
-	# TODO create grid differently depending on whether data is defined at x,y
-	# or at the center of a grid cell with corner coordinates defined by xi,yi
-	# create points array and flattened data array
-	if len(x)==data.shape[1] and len(y)==data.shape[0]:
-		print '		x,y taken to define the center of data grid cells'
-		xind=np.nonzero(np.logical_and(x>xlim[0],x<xlim[1]))[0]
-		yind=np.nonzero(np.logical_and(y>ylim[0],y<ylim[1]))[0]
-		xg,yg=np.meshgrid(x[xind],y[yind])
-		subdata=data[yind[0]:yind[-1]+1,xind[0]:xind[-1]+1]
-	elif len(x)==data.shape[1]+1 and len(y)==data.shape[0]+1:
-		print '		x,y taken to define the corners of data grid cells'
-		xcenter=np.fromiter(((x[i]+x[i+1])/2 for i in range(len(x)-1)),np.float)
-		ycenter=np.fromiter(((y[i]+y[i+1])/2 for i in range(len(y)-1)),np.float)
-		xind=np.nonzero(np.logical_and(xcenter>xlim[0],xcenter<xlim[1]))[0]
-		yind=np.nonzero(np.logical_and(ycenter>ylim[0],ycenter<ylim[1]))[0]
-		xg,yg=np.meshgrid(xcenter[xind],ycenter[yind])
-		subdata=data[yind[0]:yind[-1]+1,xind[0]:xind[-1]+1]
-	else:
-		raise ValueError('x and y have inconsistent sizes: both should have length ncols(data)/nrows(data) or ncols(data)+1/nrows(data)+1')
-
-	points=np.array([xg.ravel(),yg.ravel()]).T
-	flatsubdata=subdata.ravel()
-
-	if plotonly:
-		plt.imshow(np.flipud(subdata),origin='upper')
-		plt.show()
-		return
-
-	# mask out any nan's in the data and corresponding coordinate points
-	mask=np.isnan(flatsubdata)
-	ind=np.nonzero(mask)[0]
-	if len(ind) and fill_nans:
-		print "		WARNING: filling nans using spline fit through good data points, which may or may not be appropriate. Check results carefully."
-	goodsubdata=np.delete(flatsubdata,ind)
-	goodpoints=np.delete(points,ind,axis=0)
-
-	# create spline and index spline at mesh points
-	spline=CloughTocher2DInterpolator(goodpoints,goodsubdata)
-	interpdata=spline(xi,yi)
-
-	if not fill_nans:
-		# identify nan's in xi,yi using nearest neighbors
-		xyinterp=np.dstack([xi,yi])[0]
-		xydata=np.dstack([xg.ravel(),yg.ravel()])[0]
-		tree=cKDTree(xydata)
-		nearest=tree.query(xyinterp)[1]
-		pos=np.nonzero(np.isnan(flatsubdata[nearest]))
-		interpdata[pos]=flatsubdata[nearest][pos]
-
-	return interpdata
-#}}}
-def RadialInterp(x,y,data,xi,yi,**kwargs):#{{{
-	'''
-	Interpolation using a radial basis function in 2 or 3 dimensions.
-	Useful for smoothing input data after interpolation.
-
-	Uses scipy.interpolate.Rbf
-
-	x,y:			data point coordinates
-	data:			data to be interpolated (same length as x,y)
-	xi,yi:		coordinates to interpolate onto
-	function:	form of radial basis function for interpolation:
-					'multiquadric': sqrt((r/self.epsilon)**2 + 1) (default)
-					'inverse': 1.0/sqrt((r/self.epsilon)**2 + 1)
-					'gaussian': exp(-(r/self.epsilon)**2)
-					'linear': r
-					'cubic': r**3
-					'quintic': r**5
-					'thin_plate': r**2 * log(r)
-	epsilon:		adjustable constant for scaling radial distance.  Defaults to 
-					approximate average distance between nodes.
-	smooth:		float>0, adjusts the amount of smoothing applied.  Defaults to 0,
-					such that the function always passes through nodal points.
-	z:				coordinate array if interpolating in 3 dimensions
-	zi:			coordinate array if interpolating in 3 dimensions
-
-	Usage:
-		interpdata=RadialInterp(x,y,data,**kwargs)
-
-	Examples:
-		interpdata=RadialInterp(md.mesh.x,md.mesh.y,data)
-		interpdata=RadialInterp(md.mesh.x,md.mesh.y,data,function='gaussian',epsilon=100,smooth=1)
-	'''
-
-	# unpack kwargs
-	function=kwargs.pop('function','gaussian')
-	if 'function' in kwargs: del kwargs['function']
-	epsilon=kwargs.pop('epsilon',None)
-	if 'epsilon' in kwargs: del kwargs['epsilon']
-	smooth=kwargs.pop('smooth',0)
-	if 'smooth' in kwargs: del kwargs['smooth']
-	z=kwargs.pop('z',None)
-	if 'z' in kwargs: del kwargs['z']
-	assert len(kwargs)==0, 'error, unexpected or misspelled kwargs'
-
-	if z:
-		if epsilon:
-			rbfi=Rbf(x,y,z,data,function=function,smooth=smooth,epsilon=epsilon)
-		else:
-			rbfi=Rbf(x,y,z,data,function=function,smooth=smooth)
-		interpdata=rbfi(xi,yi,zi)
-	else:
-		if epsilon:
-			rbfi=Rbf(x,y,data,function=function,smooth=smooth,epsilon=epsilon)
-		else:
-			rbfi=Rbf(x,y,data,function=function,smooth=smooth)
-		interpdata=rbfi(xi,yi)
-	
-	return interpdata
-#}}}
+    print('could not import matplotlib, no plotting functions enabled. Set plotonly = False in function call')
+
+
+def MeshSplineToMesh2d(x, y, data, xi, yi, tol=1e-6, fill_nans=False, **kwargs):  #{{{
+    '''
+    Piecewise cubic, C1 smooth, curvature-minimizing interpolant in 2D.
+    The interpolant is guaranteed to be continuously differentiable,
+    and the gradients are chosen such that the curvature of the interpolant
+    is approximately minimized.
+
+    Uses scipy.interpolate.CloughTocher2DInterpolator
+
+    x, y:            data point coordinates
+    data:            data to be interpolated (same length as x, y)
+    xi, yi:        coordintes to interpolate data onto
+    tol:            tolerance for gradient estimation (default 1e-6)
+    fill_nans:    fill nan's (holes) in data using the spline fit?
+    **kwargs:    optional keywork arguments:
+                    maxiter: maximum iterations in gradient estimation
+
+    Returns interpolated data at given x, y coordinates.
+
+    Usage:
+        interpdata = CloughToucher2d(x, y, data)
+
+    Examples:
+        interpdata = CloughToucher2d(md.mesh.x, md.mesh.y, data)
+        interpdata = CloughToucher2d(md.mesh.x, md.mesh.y, data, tol = 1e-3, maxiter = 100)
+    '''
+
+    # unpack kwargs
+    maxiter = kwargs.pop('maxiter', None)
+    if 'maxiter' in kwargs:
+        del kwargs['maxiter']
+    if maxiter:
+        assert type(maxiter) == int, 'error, maxiter should be an integer'
+    assert len(kwargs) == 0, 'error, unexpected or misspelled kwargs'
+
+    # create sub - vectors that just cover the limits of xi and yi
+    # TODO x, y not necessarily a grid, so need a better definition of dx, dy (e.g. average element size)
+    dx = 500
+    dy = 500
+    #dx = x[1] - x[0]
+    #dy = y[1] - y[0]
+    xlim = [min(xi) - dx, max(xi) + dx]
+    ylim = [min(yi) - dy, max(yi) + dy]
+    xflag = np.logical_and(x > xlim[0], x < xlim[1])
+    yflag = np.logical_and(y > ylim[0], y < ylim[1])
+    bothind = np.nonzero(np.logical_and(xflag, yflag))
+    subdata = data[bothind]
+    subx = x[bothind]
+    suby = y[bothind]
+    points = np.array([subx, suby]).T
+
+    # mask out any nan's in the data and corresponding coordinate points
+    mask = np.isnan(subdata)
+    ind = np.nonzero(mask)[0]
+    if len(ind) and fill_nans:
+        print("        WARNING: filling nans using spline fit through good data points, which may or may not be appropriate. Check results carefully.")
+    subdata = np.delete(subdata, ind)
+    points = np.delete(points, ind, axis=0)
+
+    if maxiter:
+        spline = CloughTocher2DInterpolator(points, subdata, tol, maxiter=maxiter)
+    else:
+        spline = CloughTocher2DInterpolator(points, subdata, tol)
+
+    interpdata = spline(xi, yi)
+
+    if not fill_nans:
+        # identify nan's in xi, yi using nearest neighbors
+        xyinterp = np.dstack([xi, yi])[0]
+        xg, yg = np.meshgrid(subx, suby)
+        xydata = np.dstack([subx, suby])[0]
+        tree = cKDTree(xydata)
+        nearest = tree.query(xyinterp)[1]
+        pos = np.nonzero(np.isnan(subdata[nearest]))
+        interpdata[pos] = subdata[nearest][pos]
+
+    return interpdata
+    #}}}
+
+
+def GridSplineToMesh2d(x, y, data, xi, yi, default_value=np.nan, plotonly=False, fill_nans=False):  #{{{
+    '''
+    python analog to InterpFromGridToMesh.  This routine uses
+    scipy.interpolate.CloughTocher2dInterpolator to create a bivariate spline
+    interpolation of the input data and then return values of the spline
+    on the x, y coordinates of the model mesh.  The interpolant is piece-wise
+    cubic, C1 smooth (continuously differentiable) and has approximately
+    minimized curvature.  See "help(scipy.interpolate.CloughTocher2dInterpolator)"
+    for more information on the routine.
+
+    NOTE: this routine will not be appropriate if there are large holes (nan's) in
+    the input data.  A non - spline interpolation scheme should be used in that case.
+
+    x, y:                vectors defining the coordinates of the input data
+    data:                2D array of input data
+    xi, yi:            x and y coordinates to be interpolated onto
+    default_value:    default value if points lie outside the convex hull of input
+                        points (defaults to nan if not specified)
+    plotonly:        plot the data to be interpolated using imshow (useful for
+    fill_nans:        fill nan's (holes) in data using the spline fit?
+
+    Usage:
+        interpdata = GridToMesh(x, y, data, xi, yi, default_value = np.nan, plotonly = False, fill_nans = False)
+
+    Examples:
+        interpdata = GridToMesh(x_m, y_m, data, md.mesh.x, md.mesh.y, 0)
+    '''
+
+    if np.ndim(x) == 2:
+        x = x.reshape(-1, )
+    if np.ndim(y) == 2:
+        y = y.reshape(-1, )
+    if len(x) != data.shape[1] + 1 and len(x) != data.shape[1]:
+        raise ValueError('x should have same length as ncols(data) or ncols(data) + 1')
+    if len(y) != data.shape[0] + 1 and len(y) != data.shape[0]:
+        raise ValueError('y should have same length as nrows(data) or nrows(data) + 1')
+
+    # create sub - grid that just covers the limits of xi and yi
+    dx = x[1] - x[0]
+    dy = y[1] - y[0]
+    xlim = [min(xi) - dx, max(xi) + dx]
+    ylim = [min(yi) - dy, max(yi) + dy]
+
+    # TODO create grid differently depending on whether data is defined at x, y
+    # or at the center of a grid cell with corner coordinates defined by xi, yi
+    # create points array and flattened data array
+    if len(x) == data.shape[1] and len(y) == data.shape[0]:
+        print('        x, y taken to define the center of data grid cells')
+        xind = np.nonzero(np.logical_and(x > xlim[0], x < xlim[1]))[0]
+        yind = np.nonzero(np.logical_and(y > ylim[0], y < ylim[1]))[0]
+        xg, yg = np.meshgrid(x[xind], y[yind])
+        subdata = data[yind[0]:yind[-1] + 1, xind[0]:xind[-1] + 1]
+    elif len(x) == data.shape[1] + 1 and len(y) == data.shape[0] + 1:
+        print('        x, y taken to define the corners of data grid cells')
+        xcenter = np.fromiter(((x[i] + x[i + 1]) / 2 for i in range(len(x) - 1)), np.float)
+        ycenter = np.fromiter(((y[i] + y[i + 1]) / 2 for i in range(len(y) - 1)), np.float)
+        xind = np.nonzero(np.logical_and(xcenter > xlim[0], xcenter < xlim[1]))[0]
+        yind = np.nonzero(np.logical_and(ycenter > ylim[0], ycenter < ylim[1]))[0]
+        xg, yg = np.meshgrid(xcenter[xind], ycenter[yind])
+        subdata = data[yind[0]:yind[-1] + 1, xind[0]:xind[-1] + 1]
+    else:
+        raise ValueError('x and y have inconsistent sizes: both should have length ncols(data) / nrows(data) or ncols(data) + 1 / nrows(data) + 1')
+
+    points = np.array([xg.ravel(), yg.ravel()]).T
+    flatsubdata = subdata.ravel()
+
+    if plotonly:
+        plt.imshow(np.flipud(subdata), origin='upper')
+        plt.show()
+        return
+
+    # mask out any nan's in the data and corresponding coordinate points
+    mask = np.isnan(flatsubdata)
+    ind = np.nonzero(mask)[0]
+    if len(ind) and fill_nans:
+        print("        WARNING: filling nans using spline fit through good data points, which may or may not be appropriate. Check results carefully.")
+    goodsubdata = np.delete(flatsubdata, ind)
+    goodpoints = np.delete(points, ind, axis=0)
+
+    # create spline and index spline at mesh points
+    spline = CloughTocher2DInterpolator(goodpoints, goodsubdata)
+    interpdata = spline(xi, yi)
+
+    if not fill_nans:
+        # identify nan's in xi, yi using nearest neighbors
+        xyinterp = np.dstack([xi, yi])[0]
+        xydata = np.dstack([xg.ravel(), yg.ravel()])[0]
+        tree = cKDTree(xydata)
+        nearest = tree.query(xyinterp)[1]
+        pos = np.nonzero(np.isnan(flatsubdata[nearest]))
+        interpdata[pos] = flatsubdata[nearest][pos]
+
+    return interpdata
+    #}}}
+
+
+def RadialInterp(x, y, data, xi, yi, **kwargs):  #{{{
+    '''
+    Interpolation using a radial basis function in 2 or 3 dimensions.
+    Useful for smoothing input data after interpolation.
+
+    Uses scipy.interpolate.Rbf
+
+    x, y:            data point coordinates
+    data:            data to be interpolated (same length as x, y)
+    xi, yi:        coordinates to interpolate onto
+    function:    form of radial basis function for interpolation:
+                    'multiquadric': sqrt((r / self.epsilon)**2 + 1) (default)
+                    'inverse': 1.0 / sqrt((r / self.epsilon)**2 + 1)
+                    'gaussian': exp(-(r / self.epsilon)**2)
+                    'linear': r
+                    'cubic': r**3
+                    'quintic': r**5
+                    'thin_plate': r**2 * log(r)
+    epsilon:        adjustable constant for scaling radial distance.  Defaults to
+                    approximate average distance between nodes.
+    smooth:        float > 0, adjusts the amount of smoothing applied.  Defaults to 0,
+                    such that the function always passes through nodal points.
+    z:                coordinate array if interpolating in 3 dimensions
+    zi:            coordinate array if interpolating in 3 dimensions
+
+    Usage:
+        interpdata = RadialInterp(x, y, data,**kwargs)
+
+    Examples:
+        interpdata = RadialInterp(md.mesh.x, md.mesh.y, data)
+        interpdata = RadialInterp(md.mesh.x, md.mesh.y, data, function = 'gaussian', epsilon = 100, smooth = 1)
+    '''
+
+    # unpack kwargs
+    function = kwargs.pop('function', 'gaussian')
+    if 'function' in kwargs:
+        del kwargs['function']
+    epsilon = kwargs.pop('epsilon', None)
+    if 'epsilon' in kwargs:
+        del kwargs['epsilon']
+    smooth = kwargs.pop('smooth', 0)
+    if 'smooth' in kwargs:
+        del kwargs['smooth']
+    z = kwargs.pop('z', None)
+    if 'z' in kwargs:
+        del kwargs['z']
+    assert len(kwargs) == 0, 'error, unexpected or misspelled kwargs'
+
+    if z:
+        if epsilon:
+            rbfi = Rbf(x, y, z, data, function=function, smooth=smooth, epsilon=epsilon)
+        else:
+            rbfi = Rbf(x, y, z, data, function=function, smooth=smooth)
+        interpdata = rbfi(xi, yi, zi)
+    else:
+        if epsilon:
+            rbfi = Rbf(x, y, data, function=function, smooth=smooth, epsilon=epsilon)
+        else:
+            rbfi = Rbf(x, y, data, function=function, smooth=smooth)
+        interpdata = rbfi(xi, yi)
+
+    return interpdata
+    #}}}
Index: /issm/trunk/src/m/inversions/marshallcostfunctions.m
===================================================================
--- /issm/trunk/src/m/inversions/marshallcostfunctions.m	(revision 24312)
+++ /issm/trunk/src/m/inversions/marshallcostfunctions.m	(revision 24313)
@@ -13,4 +13,5 @@
 	pos=find(cost_functions==506); data(pos) = {'BalancethicknessMisfit'};
 	pos=find(cost_functions==507); data(pos) = {'RheologyBAbsGradient'};
+	pos=find(cost_functions==508); data(pos) = {'RheologyBInitialguessMisfit'};
 	pos=find(cost_functions==510); data(pos) = {'ThicknessPositive'};
 	pos=find(cost_functions==601); data(pos) = {'SurfaceAbsMisfit'};
Index: /issm/trunk/src/m/inversions/marshallcostfunctions.py
===================================================================
--- /issm/trunk/src/m/inversions/marshallcostfunctions.py	(revision 24312)
+++ /issm/trunk/src/m/inversions/marshallcostfunctions.py	(revision 24313)
@@ -1,45 +1,44 @@
-import copy
 
 def marshallcostfunctions(cost_functions):
 
-	cfDict={101:'SurfaceAbsVelMisfit',
-					102:'SurfaceRelVelMisfit',
-					103:'SurfaceLogVelMisfit',
-					104:'SurfaceLogVxVyMisfit',
-					105:'SurfaceAverageVelMisfit',
-					201:'ThicknessAbsMisfit',
-					501:'DragCoefficientAbsGradient',
-					502:'RheologyBbarAbsGradient',
-					503:'ThicknessAbsGradient',
-					504:'ThicknessAlongGradient',
-					505:'ThicknessAcrossGradient',}
+    cfDict = {101: 'SurfaceAbsVelMisfit',
+              102: 'SurfaceRelVelMisfit',
+              103: 'SurfaceLogVelMisfit',
+              104: 'SurfaceLogVxVyMisfit',
+              105: 'SurfaceAverageVelMisfit',
+              201: 'ThicknessAbsMisfit',
+              501: 'DragCoefficientAbsGradient',
+              502: 'RheologyBbarAbsGradient',
+              503: 'ThicknessAbsGradient',
+              504: 'ThicknessAlongGradient',
+              505: 'ThicknessAcrossGradient'}
 
-	data=[cfDict[cf] for cf in cost_functions]
-	# #copy list first
-	# data=copy.deepcopy(cost_functions)
+    data = [cfDict[cf] for cf in cost_functions]
+    #  #copy list first
+    # data = copy.deepcopy(cost_functions)
 
-	# #convert to strings 
-	# pos=[i for i,x in enumerate(cost_functions) if x==101];
-	# for i in pos: data[i]='SurfaceAbsVelMisfit'        
-	# pos=[i for i,x in enumerate(cost_functions) if x==102];
-	# for i in pos: data[i]='SurfaceRelVelMisfit'        
-	# pos=[i for i,x in enumerate(cost_functions) if x==103];
-	# for i in pos: data[i]='SurfaceLogVelMisfit'        
-	# pos=[i for i,x in enumerate(cost_functions) if x==104];
-	# for i in pos: data[i]='SurfaceLogVxVyMisfit'       
-	# pos=[i for i,x in enumerate(cost_functions) if x==105];
-	# for i in pos: data[i]='SurfaceAverageVelMisfit'    
-	# pos=[i for i,x in enumerate(cost_functions) if x==201];
-	# for i in pos: data[i]='ThicknessAbsMisfit'         
-	# pos=[i for i,x in enumerate(cost_functions) if x==501];
-	# for i in pos: data[i]='DragCoefficientAbsGradient' 
-	# pos=[i for i,x in enumerate(cost_functions) if x==502];
-	# for i in pos: data[i]='RheologyBbarAbsGradient'    
-	# pos=[i for i,x in enumerate(cost_functions) if x==503];
-	# for i in pos: data[i]='ThicknessAbsGradient'       
-	# pos=[i for i,x in enumerate(cost_functions) if x==504];
-	# for i in pos: data[i]='ThicknessAlongGradient'     
-	# pos=[i for i,x in enumerate(cost_functions) if x==505];
-	# for i in pos: data[i]='ThicknessAcrossGradient'    
+    #  #convert to strings
+    # pos = [i for i, x in enumerate(cost_functions) if x == 101]
+    # for i in pos: data[i] = 'SurfaceAbsVelMisfit'
+    # pos = [i for i, x in enumerate(cost_functions) if x == 102]
+    # for i in pos: data[i] = 'SurfaceRelVelMisfit'
+    # pos = [i for i, x in enumerate(cost_functions) if x == 103]
+    # for i in pos: data[i] = 'SurfaceLogVelMisfit'
+    # pos = [i for i, x in enumerate(cost_functions) if x == 104]
+    # for i in pos: data[i] = 'SurfaceLogVxVyMisfit'
+    # pos = [i for i, x in enumerate(cost_functions) if x == 105]
+    # for i in pos: data[i] = 'SurfaceAverageVelMisfit'
+    # pos = [i for i, x in enumerate(cost_functions) if x == 201]
+    # for i in pos: data[i] = 'ThicknessAbsMisfit'
+    # pos = [i for i, x in enumerate(cost_functions) if x == 501]
+    # for i in pos: data[i] = 'DragCoefficientAbsGradient'
+    # pos = [i for i, x in enumerate(cost_functions) if x == 502]
+    # for i in pos: data[i] = 'RheologyBbarAbsGradient'
+    # pos = [i for i, x in enumerate(cost_functions) if x == 503]
+    # for i in pos: data[i] = 'ThicknessAbsGradient'
+    # pos = [i for i, x in enumerate(cost_functions) if x == 504]
+    # for i in pos: data[i] = 'ThicknessAlongGradient'
+    # pos = [i for i, x in enumerate(cost_functions) if x == 505]
+    # for i in pos: data[i] = 'ThicknessAcrossGradient'
 
-	return data
+    return data
Index: /issm/trunk/src/m/inversions/parametercontroldrag.py
===================================================================
--- /issm/trunk/src/m/inversions/parametercontroldrag.py	(revision 24312)
+++ /issm/trunk/src/m/inversions/parametercontroldrag.py	(revision 24313)
@@ -1,118 +1,120 @@
-def parametercontroldrag(md,*args):
-	"""
-	PARAMETERCONTROLDRAG - parameterization for control method on drag
+import numpy as np
+from pairoptions import pairoptions
 
-	It is possible to specify the number of steps, values for the
-	minimum and maximum values of the drag, the 
-	kind of cm_responses to use or the the optscal.
 
-	Usage:
-	   md=parametercontroldrag(md,varargin)
+def parametercontroldrag(md, *args):
+    """
+    PARAMETERCONTROLDRAG - parameterization for control method on drag
 
-	Example:
-	  md=parametercontroldrag(md)
-	  md=parametercontroldrag(md,'nsteps',20,'cm_responses',0)
-	  md=parametercontroldrag(md,'cm_min',1,'cm_max',150,'cm_jump',0.99,'maxiter',20)
-	  md=parametercontroldrag(md,eps_cm',10^-4,'optscal',[10^7 10^8])
+    It is possible to specify the number of steps, values for the
+    minimum and maximum values of the drag, the
+    kind of cm_responses to use or the the optscal.
 
-	See also PARAMETERCONTROLB
-	"""
+    Usage:
+       md = parametercontroldrag(md, varargin)
 
-	#process options
-	options=pairoptions(*args)
+    Example:
+      md = parametercontroldrag(md)
+      md = parametercontroldrag(md, 'nsteps', 20, 'cm_responses', 0)
+      md = parametercontroldrag(md, 'cm_min', 1, 'cm_max', 150, 'cm_jump', 0.99, 'maxiter', 20)
+      md = parametercontroldrag(md, eps_cm', 1.0e-4, 'optscal', [1.0e7 1.0e8])
 
-	#control type
-	md.inversion.control_parameters='FrictionCoefficient'
+    See also PARAMETERCONTROLB
+    """
 
-	#weights
-	weights=options.getfieldvalue('weights',np.ones(md.mesh.numberofvertices))
-	if np.size(weights)!=md.mesh.numberofvertices:
-		md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices)
-	else:
-		md.inversion.cost_functions_coefficients=weights
+    #process options
+    options = pairoptions(*args)
 
-	#nsteps
-	nsteps=options.getfieldvalue('nsteps',100);
-	if (np.size(nsteps)!=1) | (nsteps<=0) | (floor(nsteps)!=nsteps):
-		md.inversion.nsteps=100
-	else:
-		md.inversion.nsteps=nsteps
+    #control type
+    md.inversion.control_parameters = 'FrictionCoefficient'
 
-	#cm_min
-	cm_min=options.getfieldvalue('cm_min',ones(md.mesh.numberofvertices))
-	if (np.size(cm_min)==1):
-		md.inversion.min_parameters=cm_min*ones(md.mesh.numberofvertices)
-	elif (np.size(cm_min)==md.mesh.numberofvertices):
-		md.inversion.min_parameters=cm_min
-	else:
-		md.inversion.min_parameters=cm_min;
+    #weights
+    weights = options.getfieldvalue('weights', np.ones(md.mesh.numberofvertices))
+    if np.size(weights) != md.mesh.numberofvertices:
+        md.inversion.cost_functions_coefficients = np.ones(md.mesh.numberofvertices)
+    else:
+        md.inversion.cost_functions_coefficients = weights
 
-	#cm_max
-	cm_max=options.getfieldvalue('cm_max',250*ones(md.mesh.numberofvertices))
-	if (np.size(cm_max)==1):
-		md.inversion.max_parameters=cm_max*ones(md.mesh.numberofvertices)
-	elif (np.size(cm_max)==md.mesh.numberofvertices):
-		md.inversion.max_parameters=cm_max
-	else:
-		md.inversion.max_parameters=cm_max
+    #nsteps
+    nsteps = options.getfieldvalue('nsteps', 100)
+    if (np.size(nsteps) != 1) | (nsteps <= 0) | (np.floor(nsteps) != nsteps):
+        md.inversion.nsteps = 100
+    else:
+        md.inversion.nsteps = nsteps
 
-	#eps_cm
-	eps_cm=optoins.getfieldvalue('eps_cm',float('nan'))
-	if (np.size(eps_cm)~=1 | eps_cm<0 ):
-		md.inversion.cost_function_threshold=float('nan')
-	else:
-		md.inversion.cost_function_threshold=eps_cm
+    #cm_min
+    cm_min = options.getfieldvalue('cm_min', np.ones(md.mesh.numberofvertices))
+    if (np.size(cm_min) == 1):
+        md.inversion.min_parameters = cm_min * np.ones(md.mesh.numberofvertices)
+    elif (np.size(cm_min) == md.mesh.numberofvertices):
+        md.inversion.min_parameters = cm_min
+    else:
+        md.inversion.min_parameters = cm_min
 
-	#maxiter
-	maxiter=options.getfieldvalue('maxiter',10*ones(md.inversion.nsteps))
-	if (np.any(maxiter<0) | np.any(floor(maxiter)~=maxiter)):
-		md.inversion.maxiter_per_step=10*ones(md.inversion.nsteps)
-	else:
-		raise RuntimeError("not implemented yet, see below matlab lines")
-		#md.inversion.maxiter_per_step=repmat(maxiter(:),md.inversion.nsteps,1);
-		#md.inversion.maxiter_per_step(md.inversion.nsteps+1:end)=[];
+    #cm_max
+    cm_max = options.getfieldvalue('cm_max', 250 * np.ones(md.mesh.numberofvertices))
+    if (np.size(cm_max) == 1):
+        md.inversion.max_parameters = cm_max * np.ones(md.mesh.numberofvertices)
+    elif (np.size(cm_max) == md.mesh.numberofvertices):
+        md.inversion.max_parameters = cm_max
+    else:
+        md.inversion.max_parameters = cm_max
 
-	#cm_jump
-	cm_jump=options.getfieldvalue('cm_jump',0.8*ones(md.inversion.nsteps))
-	if !np.isreal(cm_jump):
-		md.inversion.step_threshold=0.8*ones(md.inversion.nsteps)
-	else:
-		raise RuntimeError("not implemented yet, see below matlab lines")
-		#md.inversion.step_threshold=repmat(cm_jump(:),md.inversion.nsteps,1);
-		#md.inversion.step_threshold(md.inversion.nsteps+1:end)=[];
+    #eps_cm
+    eps_cm = options.getfieldvalue('eps_cm', float('nan'))
+    if (np.size(eps_cm) != 1 | eps_cm < 0):
+        md.inversion.cost_function_threshold = float('nan')
+    else:
+        md.inversion.cost_function_threshold = eps_cm
 
-	#cm_responses
-	found=0;
-	if options.exist('cm_responses'):
-		cm_responses=options.getfieldvalue('cm_responses')
-		if ~any(~ismember(cm_responses,[101 105])):
-			md.inversion.cost_functions=repmat(cm_responses(:),md.inversion.nsteps,1);
-			md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
-			found=1;
-	if ~found
-		third=ceil(md.inversion.nsteps/3);
-		md.inversion.cost_functions=[...
-			103*ones(third,1);...
-			101*ones(third,1);...
-			repmat([101;101;103;101],third,1)...
-			];
-		md.inversion.cost_functions(md.inversion.nsteps+1:end)=[];
-	end
+    #maxiter
+    maxiter = options.getfieldvalue('maxiter', 10 * np.ones(md.inversion.nsteps))
+    if (np.any(maxiter < 0) | np.any(np.floor(maxiter) != maxiter)):
+        md.inversion.maxiter_per_step = 10 * np.ones(md.inversion.nsteps)
+    else:
+        raise RuntimeError("not implemented yet, see below matlab lines")
+    #md.inversion.maxiter_per_step = repmat(maxiter(:), md.inversion.nsteps, 1)
+    #md.inversion.maxiter_per_step(md.inversion.nsteps + 1:end) = []
 
-	%optscal
-	found=0;
-	if exist(options,'optscal'),
-		optscal=getfieldvalue(options,'optscal');
-		if ~any(optscal<0),
-			md.inversion.gradient_scaling=repmat(optscal(:),md.inversion.nsteps,1);
-			md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
-			found=1;
-		end
-	end
-	if ~found
-		third=ceil(md.inversion.nsteps/3);
-		md.inversion.gradient_scaling=[50*ones(3,1);15*ones(third-3,1);10*ones(third,1);repmat([10;10;20;10],third,1)];
-		md.inversion.gradient_scaling(md.inversion.nsteps+1:end)=[];
-	end
+    #cm_jump
+    cm_jump = options.getfieldvalue('cm_jump', 0.8 * np.ones(md.inversion.nsteps))
+    if not np.isreal(cm_jump):
+        md.inversion.step_threshold = 0.8 * np.ones(md.inversion.nsteps)
+    else:
+        raise RuntimeError("not implemented yet, see below matlab lines")
+    #md.inversion.step_threshold = repmat(cm_jump(:), md.inversion.nsteps, 1)
+    #md.inversion.step_threshold(md.inversion.nsteps + 1:end) = []
 
-	return md
+    #cm_responses
+    found = 0
+    if options.exist('cm_responses'):
+        cm_responses = options.getfieldvalue('cm_responses')
+        if not any(cm_responses not in [101, 105]):
+            md.inversion.cost_functions = np.tile(cm_responses[:], (md.inversion.nsteps, 1))
+            md.inversion.cost_functions[md.inversion.nsteps:] = []
+            found = 1
+    if not found:
+        third = np.ceil(md.inversion.nsteps / 3)
+        md.inversion.cost_functions = [103 * np.ones(third, 1),
+                                       101 * np.ones(third, 1),
+                                       np.tile([101, 101, 103, 101], (third, 1))]
+        md.inversion.cost_functions[md.inversion.nsteps:] = []
+
+    #optscal
+    found = 0
+    if options.exist('optscal'):
+        optscal = options.getfieldvalue('optscal')
+        if not any(optscal < 0):
+            md.inversion.gradient_scaling = np.tile(optscal[:], (md.inversion.nsteps, 1))
+            md.inversion.gradient_scaling[md.inversion.nsteps:] = []
+            found = 1
+
+    if not found:
+        third = np.ceil(md.inversion.nsteps / 3)
+        md.inversion.gradient_scaling = [50 * np.ones(3, 1),
+                                         15 * np.ones(third - 3, 1),
+                                         10 * np.ones(third, 1),
+                                         np.tile([10, 10, 20, 10], (third, 1))]
+        md.inversion.gradient_scaling[md.inversion.nsteps:] = []
+
+    return md
Index: /issm/trunk/src/m/inversions/supportedcontrols.py
===================================================================
--- /issm/trunk/src/m/inversions/supportedcontrols.py	(revision 24312)
+++ /issm/trunk/src/m/inversions/supportedcontrols.py	(revision 24313)
@@ -1,2 +1,2 @@
 def supportedcontrols():
-	return ['BalancethicknessThickeningRate','FrictionCoefficient','FrictionAs','MaterialsRheologyBbar','DamageDbar','Vx','Vy']
+    return ['BalancethicknessThickeningRate', 'FrictionCoefficient', 'FrictionAs', 'MaterialsRheologyBbar', 'DamageDbar', 'Vx', 'Vy']
Index: /issm/trunk/src/m/inversions/supportedcostfunctions.m
===================================================================
--- /issm/trunk/src/m/inversions/supportedcostfunctions.m	(revision 24312)
+++ /issm/trunk/src/m/inversions/supportedcostfunctions.m	(revision 24313)
@@ -1,3 +1,3 @@
 function list = supportedcostfunctions(),
 
-	list = [101:105 201 501:507 510 601:604];
+	list = [101:105 201 501:508 510 601:604];
Index: /issm/trunk/src/m/inversions/supportedcostfunctions.py
===================================================================
--- /issm/trunk/src/m/inversions/supportedcostfunctions.py	(revision 24312)
+++ /issm/trunk/src/m/inversions/supportedcostfunctions.py	(revision 24313)
@@ -1,2 +1,2 @@
 def supportedcostfunctions():
-	return [101,102,103,104,105,201,501,502,503,504,505]
+    return [101, 102, 103, 104, 105, 201, 501, 502, 503, 504, 505]
Index: /issm/trunk/src/m/io/loadmodel.py
===================================================================
--- /issm/trunk/src/m/io/loadmodel.py	(revision 24312)
+++ /issm/trunk/src/m/io/loadmodel.py	(revision 24313)
@@ -1,34 +1,41 @@
 from loadvars import loadvars
-from whichdb import whichdb
+#hack to keep python 2 compatipility
+try:
+    #py3 import
+    from dbm import whichdb
+except ImportError:
+    #py2 import
+    from whichdb import whichdb
 from netCDF4 import Dataset
 
+
 def loadmodel(path):
-	"""
-	LOADMODEL - load a model using built-in load module
+    """
+    LOADMODEL - load a model using built - in load module
 
-	   check that model prototype has not changed. if so, adapt to new model prototype.
-	
-	   Usage:
-	      md=loadmodel(path)
-	"""
+       check that model prototype has not changed. if so, adapt to new model prototype.
 
-	#check existence of database (independent of file extension!)
-	if whichdb(path):
-		#do nothing
-		pass
-	else:
-		try:
-			NCFile=Dataset(path,mode='r')
-			NCFile.close()
-			pass
-		except RuntimeError:
-			raise IOError("loadmodel error message: file '%s' does not exist" % path)
-		#	try:
-	#recover model on file and name it md
-	struc=loadvars(path)
-	name=[key for key in struc.iterkeys()]
-	if len(name)>1:
-		raise IOError("loadmodel error message: file '%s' contains several variables. Only one model should be present." % path)
+       Usage:
+          md = loadmodel(path)
+    """
 
-	md=struc[name[0]]
-	return md
+    #check existence of database (independent of file extension!)
+    if whichdb(path):
+        #do nothing
+        pass
+    else:
+        try:
+            NCFile = Dataset(path, mode='r')
+            NCFile.close()
+            pass
+        except RuntimeError:
+            raise IOError("loadmodel error message: file '%s' does not exist" % path)
+    #       try:
+    #recover model on file and name it md
+    struc = loadvars(path)
+    name = [key for key in list(struc.keys())]
+    if len(name) > 1:
+        raise IOError("loadmodel error message: file '%s' contains several variables. Only one model should be present." % path)
+
+    md = struc[name[0]]
+    return md
Index: /issm/trunk/src/m/io/loadvars.py
===================================================================
--- /issm/trunk/src/m/io/loadvars.py	(revision 24312)
+++ /issm/trunk/src/m/io/loadvars.py	(revision 24313)
@@ -1,248 +1,258 @@
 import shelve
-import os.path
-import numpy as  np
+import numpy as np
 from netCDF4 import Dataset
-from netCDF4 import chartostring
 from re import findall
-from os import path
 from collections import OrderedDict
-from whichdb import whichdb
 from model import *
+#hack to keep python 2 compatibility
+try:
+    #py3 import
+    from dbm import whichdb
+except ImportError:
+    #py2 import
+    from whichdb import whichdb
+
 
 def loadvars(*args):
-	"""
-	LOADVARS - function to load variables to a file.
-
-	This function loads one or more variables from a file.  The names of the variables
-	must be supplied.  If more than one variable is specified, it may be done with
-	a list of names or a dictionary of name as keys.  The output type will correspond
-	to the input type.  All the variables in the file may be loaded by specifying only
-	the file name.
-
-	Usage:
-	   a=loadvars('shelve.dat','a')
-	   [a,b]=loadvars('shelve.dat',['a','b'])
-	   nvdict=loadvars('shelve.dat',{'a':None,'b':None})
-	   nvdict=loadvars('shelve.dat')
-
-	"""
-
-	filename=''
-	nvdict={}
-
-	if len(args) >= 1 and isinstance(args[0],(str,unicode)):
-		filename=args[0]
-		if not filename:
-			filename='/tmp/shelve.dat'
-
-	else:
-		raise TypeError("Missing file name.")
-
-	if   len(args) >= 2 and isinstance(args[1],(str,unicode)):    # (filename,name)
-		for name in args[1:]:
-			nvdict[name]=None
-
-	elif len(args) == 2 and isinstance(args[1],list):    # (filename,[names])
-		for name in args[1]:
-			nvdict[name]=None
-
-	elif len(args) == 2 and isinstance(args[1],dict):    # (filename,{names:values})
-		nvdict=args[1]
-
-	elif len(args) == 1:    #  (filename)
-		pass
-
-	else:
-		raise TypeError("Unrecognized input arguments.")
-
-	if whichdb(filename):
-		print "Loading variables from file '%s'." % filename
-
-		my_shelf = shelve.open(filename,'r') # 'r' for read-only
-		if nvdict:
-			for name in nvdict.iterkeys():
-				try:
-					nvdict[name] = my_shelf[name]
-					print "Variable '%s' loaded." % name
-				except KeyError:
-					value = None
-					print "Variable '%s' not found." % name
-
-		else:
-			for name in my_shelf.iterkeys():
-				nvdict[name] = my_shelf[name]
-				print "Variable '%s' loaded." % name
-
-		my_shelf.close()
-
-	else:
-		try:
-			NCFile=Dataset(filename,mode='r')
-			NCFile.close()
-		except RuntimeError:
-			raise IOError("File '%s' not found." % filename)
-
-		classtype,classtree=netCDFread(filename)
-		nvdict['md']=model()
-		NCFile=Dataset(filename,mode='r')
-		for mod in dict.keys(classtype):
-			if np.size(classtree[mod])>1:
-				curclass=NCFile.groups[classtree[mod][0]].groups[classtree[mod][1]]
-				if classtype[mod][0]=='list':
-					keylist=[key for key in curclass.groups]
-					try:
-						steplist=[int(key) for key in curclass.groups]
-					except ValueError:
-						steplist=[int(findall(r'\d+',key)[0]) for key in keylist]
-					indexlist=[index*(len(curclass.groups)-1)/max(1,max(steplist)) for index in steplist]
-					listtype=curclass.groups[keylist[0]].classtype
-					if listtype=='dict':
-						nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = [OrderedDict() for i in range(max(1,len(curclass.groups)))]
-					else:
-						nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = [getattr(__import__(listtype),listtype)() for i in range(max(1,len(curclass.groups)))]
-					Tree=nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]][:]
-				else:
-					nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = getattr(classtype[mod][1],classtype[mod][0])()
-					Tree=nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]]
-			else:
-				curclass=NCFile.groups[classtree[mod][0]]
-				nvdict['md'].__dict__[mod] = getattr(classtype[mod][1],classtype[mod][0])()
-				Tree=nvdict['md'].__dict__[classtree[mod][0]]
-			#treating groups that are lists
-			for i in range(0,max(1,len(curclass.groups))):
-				if len(curclass.groups)>0:
-					listclass=curclass.groups[keylist[i]]
-				else:
-					listclass=curclass
-				for var in listclass.variables:
-					if var not in ['errlog','outlog']:
-						varval=listclass.variables[str(var)]
-						vardim=varval.ndim
-						try:
-							val_type=str(varval.dtype)
-						except AttributeError:
-							val_type=type(varval)
-						if vardim==0:
-							if type(Tree)==list:
-								t=indexlist[i]
-								if listtype=='dict':
-									Tree[t][str(var)]=varval[0]
-								else:
-									Tree[t].__dict__[str(var)]=varval[0]
-							else:
-								if str(varval[0])=='':
-									Tree.__dict__[str(var)]=[]
-								elif varval[0]=='True':
-									Tree.__dict__[str(var)]=True
-								elif varval[0]=='False':
-									Tree.__dict__[str(var)]=False
-								else:
-									Tree.__dict__[str(var)]=varval[0]
-
-						elif vardim==1:
-							if varval.dtype==str:
-								if varval.shape[0]==1:
-									Tree.__dict__[str(var)]=[str(varval[0]),]
-								elif 'True' in varval[:] or 'False' in varval[:]:
-									Tree.__dict__[str(var)]=np.asarray([V=='True' for V in varval[:]],dtype=bool)
-								else:
-									Tree.__dict__[str(var)]=[str(vallue) for vallue in varval[:]]
-							else:
-								if type(Tree)==list:
-									t=indexlist[i]
-									if listtype=='dict':
-										Tree[t][str(var)]=varval[:]
-									else:
-										Tree[t].__dict__[str(var)]=varval[:]
-								else:
-									try:
-										#some thing specifically require a list
-										mdtype=type(Tree.__dict__[str(var)])
-									except KeyError:
-										mdtype=float
-									if mdtype==list:
-										Tree.__dict__[str(var)]=[mdval for mdval in varval[:]]
-									else:
-										Tree.__dict__[str(var)]=varval[:]
-						elif vardim==2:
-							#dealling with dict
-							if varval.dtype==str: #that is for toolkits wich needs to be ordered
-								if any(varval[:,0]=='toolkit'):								#toolkit definition have to be first
-									Tree.__dict__[str(var)]=OrderedDict([('toolkit', str(varval[np.where(varval[:,0]=='toolkit')[0][0],1]))])
-
-								strings1=[str(arg[0]) for arg in varval if arg[0]!='toolkits']
-								strings2=[str(arg[1]) for arg in varval if arg[0]!='toolkits']
-								Tree.__dict__[str(var)].update(zip(strings1, strings2))
-							else:
-								if type(Tree)==list:
-									#t=int(keylist[i][-1])-1
-									t=indexlist[i]
-									if listtype=='dict':
-										Tree[t][str(var)]=varval[:,:]
-									else:
-										Tree[t].__dict__[str(var)]=varval[:,:]
-								else:
-									Tree.__dict__[str(var)]=varval[:,:]
-						elif vardim==3:
-							if type(Tree)==list:
-								t=indexlist[i]
-								if listtype=='dict':
-									Tree[t][str(var)]=varval[:,:,:]
-								else:
-									Tree[t].__dict__[str(var)]=varval[:,:,:]
-							else:
-								Tree.__dict__[str(var)]=varval[:,:,:]
-						else:
-							print 'table dimension greater than 3 not implemented yet'
-				for attr in listclass.ncattrs():
-					if  attr!='classtype': #classtype is for treatment, don't get it back
-						if type(Tree)==list:
-							t=indexlist[i]
-							if listtype=='dict':
-								Tree[t][str(attr).swapcase()]=str(listclass.getncattr(attr))
-							else:
-								Tree[t].__dict__[str(attr).swapcase()]=str(listclass.getncattr(attr))
-						else:
-							Tree.__dict__[str(attr).swapcase()]=str(listclass.getncattr(attr))
-							if listclass.getncattr(attr)=='True':
-								Tree.__dict__[str(attr).swapcase()]=True
-							elif listclass.getncattr(attr)=='False':
-								Tree.__dict__[str(attr).swapcase()]=False
-		NCFile.close()
-	if   len(args) >= 2 and isinstance(args[1],(str,unicode)):    # (value)
-		value=[nvdict[name] for name in args[1:]]
-		return value
-
-	elif len(args) == 2 and isinstance(args[1],list):    # ([values])
-		value=[nvdict[name] for name in args[1]]
-		return value
-
-	elif (len(args) == 2 and isinstance(args[1],dict)) or (len(args) == 1):    # ({names:values})
-		return nvdict
+    """
+    LOADVARS - function to load variables to a file.
+
+    This function loads one or more variables from a file.  The names of the variables
+    must be supplied.  If more than one variable is specified, it may be done with
+    a list of names or a dictionary of name as keys.  The output type will correspond
+    to the input type.  All the variables in the file may be loaded by specifying only
+    the file name.
+
+    Usage:
+        a = loadvars('shelve.dat', 'a')
+        [a, b] = loadvars('shelve.dat', ['a', 'b'])
+        nvdict = loadvars('shelve.dat', {'a':None, 'b':None})
+        nvdict = loadvars('shelve.dat')
+
+    """
+
+    filename = ''
+    nvdict = {}
+
+    if len(args) >= 1 and isinstance(args[0], str):
+        filename = args[0]
+        if not filename:
+            filename = '/tmp/shelve.dat'
+
+    else:
+        raise TypeError("Missing file name.")
+
+    if len(args) >= 2 and isinstance(args[1], str):  # (filename, name)
+        for name in args[1:]:
+            nvdict[name] = None
+
+    elif len(args) == 2 and isinstance(args[1], list):  # (filename, [names])
+        for name in args[1]:
+            nvdict[name] = None
+
+    elif len(args) == 2 and isinstance(args[1], dict):  # (filename, {names:values})
+        nvdict = args[1]
+
+    elif len(args) == 1:  #  (filename)
+        pass
+
+    else:
+        raise TypeError("Unrecognized input arguments.")
+
+    if whichdb(filename):
+        print("Loading variables from file {}.".format(filename))
+        my_shelf = shelve.open(filename, 'r')  # 'r' for read - only
+        if nvdict:
+            for name in list(nvdict.keys()):
+                try:
+                    nvdict[name] = my_shelf[name]
+                    print(("Variable '%s' loaded." % name))
+                except KeyError:
+                    value = None
+                    print("Variable '{}' not found.".format(name))
+
+        else:
+            for name in list(my_shelf.keys()):
+                nvdict[name] = my_shelf[name]
+                print(("Variable '%s' loaded." % name))
+        my_shelf.close()
+
+    else:
+        try:
+            NCFile = Dataset(filename, mode='r')
+            NCFile.close()
+        except RuntimeError:
+            raise IOError("File '{}' not found.".format(filename))
+
+        classtype, classtree = netCDFread(filename)
+        nvdict['md'] = model()
+        NCFile = Dataset(filename, mode='r')
+        for mod in dict.keys(classtype):
+            #print(' - Now treating classtype {}'.format(mod))
+            if np.size(classtree[mod]) > 1:
+                curclass = NCFile.groups[classtree[mod][0]].groups[classtree[mod][1]]
+                if classtype[mod][0] == 'list':
+                    keylist = [key for key in curclass.groups]
+                    try:
+                        steplist = [int(key) for key in curclass.groups]
+                    except ValueError:
+                        steplist = [int(findall(r'\d + ', key)[0]) for key in keylist]
+                    indexlist = [index * (len(curclass.groups) - 1) / max(1, max(steplist)) for index in steplist]
+                    listtype = curclass.groups[keylist[0]].classtype
+                    if listtype == 'dict':
+                        nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = [OrderedDict() for i in range(max(1, len(curclass.groups)))]
+                    else:
+                        nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = [getattr(__import__(listtype), listtype)() for i in range(max(1, len(curclass.groups)))]
+                        Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]][:]
+                else:
+                    nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]] = getattr(classtype[mod][1], classtype[mod][0])()
+                    Tree = nvdict['md'].__dict__[classtree[mod][0]].__dict__[classtree[mod][1]]
+            else:
+                curclass = NCFile.groups[classtree[mod][0]]
+                nvdict['md'].__dict__[mod] = getattr(classtype[mod][1], classtype[mod][0])()
+                Tree = nvdict['md'].__dict__[classtree[mod][0]]
+                #treating groups that are lists
+            for i in range(0, max(1, len(curclass.groups))):
+                if len(curclass.groups) > 0:
+                    listclass = curclass.groups[keylist[i]]
+                else:
+                    listclass = curclass
+                for var in listclass.variables:
+                    #print("treating var {}".format(var))
+                    if var not in ['errlog', 'outlog']:
+                        varval = listclass.variables[str(var)]
+                        vardim = varval.ndim
+                        if vardim == 0:
+                            if type(Tree) == list:
+                                t = int(indexlist[i])
+                                if listtype == 'dict':
+                                    Tree[t][str(var)] = varval[0]
+
+                                else:
+                                    Tree[t].__dict__[str(var)] = varval[0]
+
+                            else:
+                                if str(varval[0]) == '':  #no value
+                                    Tree.__dict__[str(var)] = []
+
+                                elif varval[0] == 'True':  #treatin bool
+                                    Tree.__dict__[str(var)] = True
+
+                                elif varval[0] == 'False':  #treatin bool
+                                    Tree.__dict__[str(var)] = False
+
+                                else:
+                                    Tree.__dict__[str(var)] = varval[0].item()
+
+                        elif vardim == 1:
+                            if varval.dtype == str:
+                                if varval.shape[0] == 1:
+                                    Tree.__dict__[str(var)] = [str(varval[0]), ]
+
+                                elif 'True' in varval[:] or 'False' in varval[:]:
+                                    Tree.__dict__[str(var)] = np.asarray([V == 'True' for V in varval[:]], dtype=bool)
+
+                                else:
+                                    Tree.__dict__[str(var)] = [str(vallue) for vallue in varval[:]]
+
+                            else:
+                                if type(Tree) == list:
+                                    t = int(indexlist[i])
+                                    if listtype == 'dict':
+                                        Tree[t][str(var)] = varval[:]
+
+                                    else:
+                                        Tree[t].__dict__[str(var)] = varval[:]
+
+                                else:
+                                    try:
+                                        #some thing specifically require a list
+                                        mdtype = type(Tree.__dict__[str(var)])
+                                    except KeyError:
+                                        mdtype = float
+                                    if mdtype == list:
+                                        Tree.__dict__[str(var)] = [mdval for mdval in varval[:]]
+
+                                    else:
+                                        Tree.__dict__[str(var)] = varval[:].data
+
+                        elif vardim == 2:
+                            #dealling with dict
+                            if varval.dtype == str:  #that is for toolkits wich needs to be ordered
+                                if any(varval[:, 0] == 'toolkit'):  #toolkit definition have to be first
+                                    Tree.__dict__[str(var)] = OrderedDict([('toolkit', str(varval[np.where(varval[:, 0] == 'toolkit')[0][0], 1]))])
+                                    strings1 = [str(arg[0]) for arg in varval if arg[0] != 'toolkits']
+                                    strings2 = [str(arg[1]) for arg in varval if arg[0] != 'toolkits']
+                                    Tree.__dict__[str(var)].update(list(zip(strings1, strings2)))
+                            else:
+                                if type(Tree) == list:
+                                    t = int(indexlist[i])
+                                    if listtype == 'dict':
+                                        Tree[t][str(var)] = varval[:, :]
+                                    else:
+                                        Tree[t].__dict__[str(var)] = varval[:, :]
+                                else:
+                                    Tree.__dict__[str(var)] = varval[:, :].data
+                        elif vardim == 3:
+                            if type(Tree) == list:
+                                t = int(indexlist[i])
+                                if listtype == 'dict':
+                                    Tree[t][str(var)] = varval[:, :, :]
+                                else:
+                                    Tree[t].__dict__[str(var)] = varval[:, :, :]
+                            else:
+                                Tree.__dict__[str(var)] = varval[:, :, :].data
+                        else:
+                            print('table dimension greater than 3 not implemented yet')
+                for attr in listclass.ncattrs():
+                    if attr != 'classtype':  #classtype is for treatment, don't get it back
+                        if type(Tree) == list:
+                            t = int(indexlist[i])
+                            if listtype == 'dict':
+                                Tree[t][str(attr).swapcase()] = str(listclass.getncattr(attr))
+                            else:
+                                Tree[t].__dict__[str(attr).swapcase()] = str(listclass.getncattr(attr))
+                        else:
+                            Tree.__dict__[str(attr).swapcase()] = str(listclass.getncattr(attr))
+                            if listclass.getncattr(attr) == 'True':
+                                Tree.__dict__[str(attr).swapcase()] = True
+                            elif listclass.getncattr(attr) == 'False':
+                                Tree.__dict__[str(attr).swapcase()] = False
+        NCFile.close()
+    if len(args) >= 2 and isinstance(args[1], str):  # (value)
+        value = [nvdict[name] for name in args[1:]]
+        return value
+
+    elif len(args) == 2 and isinstance(args[1], list):  # ([values])
+        value = [nvdict[name] for name in args[1]]
+        return value
+
+    elif (len(args) == 2 and isinstance(args[1], dict)) or (len(args) == 1):  # ({names:values})
+        return nvdict
 
 
 def netCDFread(filename):
-	print ('Opening {} for reading '.format(filename))
-	NCData=Dataset(filename, 'r')
-	class_dict={}
-	class_tree={}
-
-	for group in NCData.groups:
-		if len(NCData.groups[group].groups)>0:
-			for subgroup in NCData.groups[group].groups:
-				classe=str(group)+'.'+str(subgroup)
-				class_dict[classe]=[str(getattr(NCData.groups[group].groups[subgroup],'classtype')),]
-				if class_dict[classe][0] not in ['dict','list','cell']:
-					class_dict[classe].append(__import__(class_dict[classe][0]))
-				class_tree[classe]=[group,subgroup]
-		else:
-			classe=str(group)
-			try:
-				class_dict[classe]=[str(getattr(NCData.groups[group],'classtype')),]
-				if class_dict[classe][0] not in ['dict','list','cell']:
-					class_dict[classe].append(__import__(class_dict[classe][0]))
-					class_tree[classe]=[group,]
-			except AttributeError:
-				print('group {} is empty'.format(group))
-	NCData.close()
-	return class_dict,class_tree
+    print(('Opening {} for reading '.format(filename)))
+    NCData = Dataset(filename, 'r')
+    class_dict = {}
+    class_tree = {}
+
+    for group in NCData.groups:
+        if len(NCData.groups[group].groups) > 0:
+            for subgroup in NCData.groups[group].groups:
+                classe = str(group) + '.' + str(subgroup)
+                class_dict[classe] = [str(getattr(NCData.groups[group].groups[subgroup], 'classtype')), ]
+                if class_dict[classe][0] not in ['dict', 'list', 'cell']:
+                    class_dict[classe].append(__import__(class_dict[classe][0]))
+                class_tree[classe] = [group, subgroup]
+        else:
+            classe = str(group)
+            try:
+                class_dict[classe] = [str(getattr(NCData.groups[group], 'classtype')), ]
+                if class_dict[classe][0] not in ['dict', 'list', 'cell']:
+                    class_dict[classe].append(__import__(class_dict[classe][0]))
+                    class_tree[classe] = [group, ]
+            except AttributeError:
+                print(('group {} is empty'.format(group)))
+    NCData.close()
+    return class_dict, class_tree
Index: /issm/trunk/src/m/io/savevars.py
===================================================================
--- /issm/trunk/src/m/io/savevars.py	(revision 24312)
+++ /issm/trunk/src/m/io/savevars.py	(revision 24313)
@@ -2,61 +2,61 @@
 import os.path
 
+
 def savevars(*args):
-	"""
-	SAVEVARS - function to save variables to a file.
+    """
+    SAVEVARS - function to save variables to a file.
 
-	This function saves one or more variables to a file.  The names of the variables
-	must be supplied.  If more than one variable is specified, it may be done with
-	lists of names and values or a dictionary of name:value pairs.  All the variables
-	in the workspace may be saved by specifying the globals() dictionary, but this
-	may include a lot of extraneous data.
+    This function saves one or more variables to a file.  The names of the variables
+    must be supplied.  If more than one variable is specified, it may be done with
+    lists of names and values or a dictionary of name:value pairs.  All the variables
+    in the workspace may be saved by specifying the globals() dictionary, but this
+    may include a lot of extraneous data.
 
-	Usage:
-	   savevars('shelve.dat','a',a)
-	   savevars('shelve.dat',['a','b'],[a,b])
-	   savevars('shelve.dat',{'a':a,'b':b})
-	   savevars('shelve.dat',globals())
+    Usage:
+       savevars('shelve.dat', 'a', a)
+       savevars('shelve.dat', ['a', 'b'], [a, b])
+       savevars('shelve.dat', {'a':a, 'b':b})
+       savevars('shelve.dat', globals())
 
-	"""
+    """
 
-	filename=''
-	nvdict={}
+    filename = ''
+    nvdict = {}
 
-	if len(args) >= 1 and isinstance(args[0],(str,unicode)):
-		filename=args[0]
-		if not filename:
-			filename='/tmp/shelve.dat'
+    if len(args) >= 1 and isinstance(args[0], str):
+        filename = args[0]
+        if not filename:
+            filename = '/tmp/shelve.dat'
 
-	else:
-		raise TypeError("Missing file name.")
+    else:
+        raise TypeError("Missing file name.")
 
-	if   len(args) >= 3 and isinstance(args[1],(str,unicode)):    # (filename,name,value)
-		for i in xrange(1,len(args),2):
-			nvdict[args[i]]=args[i+1]
+    if len(args) >= 3 and isinstance(args[1], str):  # (filename, name, value)
+        for i in range(1, len(args), 2):
+            nvdict[args[i]] = args[i + 1]
 
-	elif len(args) == 3 and isinstance(args[1],list) and isinstance(args[2],list):    # (filename,[names],[values])
-		for name,value in zip(args[1],args[2]):
-			nvdict[name]=value
+    elif len(args) == 3 and isinstance(args[1], list) and isinstance(args[2], list):  # (filename, [names], [values])
+        for name, value in zip(args[1], args[2]):
+            nvdict[name] = value
 
-	elif len(args) == 2 and isinstance(args[1],dict):    # (filename,{names:values})
-		nvdict=args[1]
+    elif len(args) == 2 and isinstance(args[1], dict):  # (filename, {names:values})
+        nvdict = args[1]
 
-	else:
-		raise TypeError("Unrecognized input arguments.")
+    else:
+        raise TypeError("Unrecognized input arguments.")
 
-	if os.path.exists(filename):
-		print "Shelving variables to existing file '%s'." % filename
-	else:
-		print "Shelving variables to new file '%s'." % filename
+    if os.path.exists(filename):
+        print(("Shelving variables to existing file '%s'." % filename))
+    else:
+        print(("Shelving variables to new file '%s'." % filename))
 
-	my_shelf = shelve.open(filename,'c') # 'c' for create if not exist, else 'n' for new
+    my_shelf = shelve.open(filename, 'c')  # 'c' for create if not exist, else 'n' for new
 
-	for name,value in nvdict.iteritems():
-		try:
-			my_shelf[name] = value
-			print "Variable '%s' shelved." % name
-		except TypeError:
-			print "Variable '%s' not shelved." % name
+    for name, value in list(nvdict.items()):
+        try:
+            my_shelf[name] = value
+            print(("Variable '%s' shelved." % name))
+        except TypeError:
+            print(("Variable '%s' not shelved." % name))
 
-	my_shelf.close()
-
+    my_shelf.close()
Index: /issm/trunk/src/m/materials/TMeltingPoint.py
===================================================================
--- /issm/trunk/src/m/materials/TMeltingPoint.py	(revision 24312)
+++ /issm/trunk/src/m/materials/TMeltingPoint.py	(revision 24313)
@@ -1,21 +1,20 @@
-import numpy as  np
 
-def TMeltingPoint(reftemp,pressure):
-	'''
-	Calculate the pressure melting point of ice at a given pressure
+def TMeltingPoint(reftemp, pressure):
+    '''
+    Calculate the pressure melting point of ice at a given pressure
 
-	reftemp is the melting temperature in K at atmospheric pressure (initialized in md.materials.meltingpoint)
+    reftemp is the melting temperature in K at atmospheric pressure (initialized in md.materials.meltingpoint)
 
-	pressure is in Pa
+    pressure is in Pa
 
-	Usage:
-		Tm=TMeltingPoint(md.materials.meltingpoint,pressure)
-	'''
+    Usage:
+        Tm = TMeltingPoint(md.materials.meltingpoint, pressure)
+    '''
 
-	#variables
-	beta=7.9e-8
+    #variables
+    beta = 7.9e-8
 
-	#ensure ref is same dimension as pressure
-	ref=reftemp*np.ones_like(pressure)
+    #ensure ref is same dimension as pressure
+    ref = reftemp - beta * pressure
 
-	return reftemp-beta*pressure
+    return ref
Index: /issm/trunk/src/m/materials/buddjacka.m
===================================================================
--- /issm/trunk/src/m/materials/buddjacka.m	(revision 24312)
+++ /issm/trunk/src/m/materials/buddjacka.m	(revision 24313)
@@ -29,5 +29,5 @@
 %Temp=BJtable(:,1);
 %Ao=BJtable(:,2)*1e-18; %conversion from MPa^-3 to Pa^-3
-%Ae=Ao*(2/3)^((1-3)/2);
+%Ae=Ao*(2/3)^((3-1)/2);
 %B=Ae.^(-1/3);
 %fittedmodel=fit(Temp,B,'cubicspline');
@@ -43,27 +43,28 @@
 %semilogy(Temp,Bcall,'--k',Temp,Bbjall,'k')
 
+
 rigidity=zeros(size(T));
 pos=find(T<=-40);
-rigidity(pos)=1e8*(-0.000237326134296*(T(pos)+50).^3+ 0.017054655749852*(T(pos)+50).^2-0.496435984007500*(T(pos)+50)+7.670967258739796);
+rigidity(pos)=1e9*(-0.000031098521204*(T(pos)+50).^3+ 0.002234792114381*(T(pos)+50).^2-0.065051516643164*(T(pos)+50)+1.005181071430026);
 pos=find(-40<T & T<=-35);
-rigidity(pos)=1e8*(-0.000237326134296*(T(pos)+40).^3+ 0.009934871720961*(T(pos)+40).^2-0.226540709299368*(T(pos)+40)+4.174746859353635);
+rigidity(pos)=1e9*(-0.000031098521204*(T(pos)+40).^3+ 0.001301836478264*(T(pos)+40).^2-0.029685230716715*(T(pos)+40)+0.547046595232583);
 pos=find(-35<T & T<=-30);
-rigidity(pos)=1e8*(-0.000293001369376*(T(pos)+35).^3+ 0.006374979706516*(T(pos)+35).^2-0.144991452161983*(T(pos)+35)+3.260749339093782);
+rigidity(pos)=1e9*(-0.000038394040864*(T(pos)+35).^3+ 0.000835358660205*(T(pos)+35).^2-0.018999255024368*(T(pos)+35)+0.427279038455119);
 pos=find(-30<T & T<=-25);
-rigidity(pos)=1e8*(-0.000053702836500*(T(pos)+30).^3+ 0.001979959165871*(T(pos)+30).^2-0.103216757800049*(T(pos)+30)+2.658541399774723);
+rigidity(pos)=1e9*(-0.000007037062330*(T(pos)+30).^3+ 0.000259448047242*(T(pos)+30).^2-0.013525221487131*(T(pos)+30)+0.348367474730384);
 pos=find(-25<T & T<=-20);
-rigidity(pos)=1e8*( 0.000006906867543*(T(pos)+25).^3+ 0.001174416618375*(T(pos)+25).^2-0.087444878878821*(T(pos)+25)+2.185243735358781);
+rigidity(pos)=1e9*( 0.000000905055684*(T(pos)+25).^3+ 0.000153892112291*(T(pos)+25).^2-0.011458520689465*(T(pos)+25)+0.286347935684521);
 pos=find(-20<T & T<=-15);
-rigidity(pos)=1e8*(-0.000015460250554*(T(pos)+20).^3+ 0.001278019631513*(T(pos)+20).^2-0.075182697629382*(T(pos)+20)+1.778243114866868);
+rigidity(pos)=1e9*(-0.000002025865930*(T(pos)+20).^3+ 0.000167467947546*(T(pos)+20).^2-0.009851720390281*(T(pos)+20)+0.233015767004928);
 pos=find(-15<T & T<=-10);
-rigidity(pos)=1e8*(-0.000110386100241*(T(pos)+15).^3+ 0.001046115873209*(T(pos)+15).^2-0.063562020105772*(T(pos)+15)+1.432347586188582);
+rigidity(pos)=1e9*(-0.000014464671112*(T(pos)+15).^3+ 0.000137079958603*(T(pos)+15).^2-0.008328980859537*(T(pos)+15)+0.187690630500981);
 pos=find(-10<T & T<=-5);
-rigidity(pos)=1e8*(-0.000108595885218*(T(pos)+10).^3+-0.000609675630408*(T(pos)+10).^2-0.061379818891767*(T(pos)+10)+1.126892119959808);
+rigidity(pos)=1e9*(-0.000014230086582*(T(pos)+10).^3+-0.000079890108083*(T(pos)+10).^2-0.008043031606935*(T(pos)+10)+0.147664641279324);
 pos=find(-5<T & T<=-2);
-rigidity(pos)=1e8*( 0.000173187986430*(T(pos)+5).^3+-0.002238613908676*(T(pos)+5).^2-0.075621266587187*(T(pos)+5)+0.791176649088537);
+rigidity(pos)=1e9*( 0.000022694046251*(T(pos)+5).^3+-0.000293341406806*(T(pos)+5).^2-0.009909189181377*(T(pos)+5)+0.103673469719891);
 pos=find(-2<T & T<=-1);
-rigidity(pos)=1e8*( 0.000429499435151*(T(pos)+2).^3+-0.000679922030808*(T(pos)+2).^2-0.084376874405640*(T(pos)+2)+0.548841399782495);
+rigidity(pos)=1e9*( 0.000056280347425*(T(pos)+2).^3+-0.000089094990549*(T(pos)+2).^2-0.011056498373441*(T(pos)+2)+0.071918568763277);
 pos=find(-1<T);
-rigidity(pos)=1e8*( 0.000429499435151*(T(pos)+1).^3+ 0.000608576274646*(T(pos)+1).^2-0.084448220161802*(T(pos)+1)+0.464214102781199);
+rigidity(pos)=1e9*( 0.000056280347425*(T(pos)+1).^3+ 0.000079746051725*(T(pos)+1).^2-0.011065847312265*(T(pos)+1)+0.060829255746712);
 
 %Now make sure that rigidity is positive
Index: /issm/trunk/src/m/materials/cuffey.py
===================================================================
--- /issm/trunk/src/m/materials/cuffey.py	(revision 24312)
+++ /issm/trunk/src/m/materials/cuffey.py	(revision 24313)
@@ -1,49 +1,66 @@
 import numpy as np
 
+
 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).
+       temperature is in Kelvin degrees
 
-	   Usage:
-	      rigidity=cuffey(temperature)
-	"""
-	
-	if np.any(temperature<0.):
-		raise RuntimeError("input temperature should be in Kelvin (positive)")
-	
-	T = temperature-273.15
+       Usage:
+          rigidity = cuffey(temperature)
+    """
 
-	rigidity=np.zeros_like(T)
-	pos=np.nonzero(T<=-45)
-	rigidity[pos]=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))
-	rigidity[pos]=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))
-	rigidity[pos]=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))
-	rigidity[pos]=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))
-	rigidity[pos]=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))
-	rigidity[pos]=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))
-	rigidity[pos]=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))
-	rigidity[pos]=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))
-	rigidity[pos]=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))
-	rigidity[pos]=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)
-	rigidity[pos]=10**8*(-0.000132282004110*(T[pos]+2)**3 +0.003209542058346*(T[pos]+2)**2    -0.051381363322371*(T[pos]+2)+ 0.837883605537096)
+    if np.any(temperature < 0.):
+        raise RuntimeError("input temperature should be in Kelvin (positive)")
 
-	#Now make sure that rigidity is positive
-	pos=np.nonzero(rigidity<0)
-	rigidity[pos]=1**6 
+    if np.ndim(temperature) == 2:
+        #T = temperature.reshape(-1, ) - 273.15
+        T = temperature.flatten() - 273.15
+    elif isinstance(temperature, float) or isinstance(temperature, int):
+        T = np.array([temperature]) - 273.15
+    else:
+        T = temperature - 273.15
 
-	return rigidity
+    rigidity = np.zeros_like(T)
+    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)
+    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)
+    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)
+    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)
+    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)
+    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)
+    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)
+    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)
+    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)
+    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)
+    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)
 
+    #Now make sure that rigidity is positive
+    pos = np.nonzero(rigidity < 0)
+    rigidity[pos] = 1**6
+
+    return rigidity
Index: /issm/trunk/src/m/materials/cuffeytemperate.py
===================================================================
--- /issm/trunk/src/m/materials/cuffeytemperate.py	(revision 24312)
+++ /issm/trunk/src/m/materials/cuffeytemperate.py	(revision 24313)
@@ -2,28 +2,27 @@
 import cuffey
 
-def cuffeytemperate(temperature, waterfraction, stressexp)
 
-	"""
-	CUFFEYTEMPERATE - calculates ice rigidity as a function of temperature and waterfraction
+def cuffeytemperate(temperature, waterfraction, stressexp):
+    '''
+    CUFFEYTEMPERATE - calculates ice rigidity as a function of temperature and waterfraction
 
-   rigidity (in s^(1/3)Pa) is the flow law parameter in the flow law sigma=B*e(1/3)
-   (Cuffey and Paterson, p75). 
+   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
 
    Usage:
-      rigidity=cuffeytemperate(temperature, waterfraction, stressexp)
-	"""
+      rigidity = cuffeytemperate(temperature, waterfraction, stressexp)
+    '''
 
-	if np.any(temperature<0.):
-		raise RuntimeError("input temperature should be in Kelvin (positive)")
+    if np.any(temperature < 0.):
+        raise RuntimeError("input temperature should be in Kelvin (positive)")
 
-	if (np.any(temperature.shape~=waterfraction.shape)),
-		error('input temperature and waterfraction should have same size!');
-	end
-	if np.any(waterfraction<0 | waterfraction>1)
-		error('input waterfraction should be between 0 and 1');
-	end
+    if (np.any(temperature.shape in waterfraction.shape)):
+        error('input temperature and waterfraction should have same size!')
 
-	rigidity=np.multiply(cuffey(temperature), (1*np.ones(waterfraction.shape)+181.25*np.maximum(np.zeros(waterfraction.shape), np.minimum(0.01*np.ones(waterfraction.shape), waterfraction)))**(-1/stressexp));
+    if np.any(waterfraction < 0 | waterfraction > 1):
+        error('input waterfraction should be between 0 and 1')
 
-	return rigidity
+    rigidity = np.multiply(cuffey(temperature), (1 * np.ones(waterfraction.shape) + 181.25 * np.maximum(np.zeros(waterfraction.shape), np.minimum(0.01 * np.ones(waterfraction.shape), waterfraction)))**(-1 / stressexp))
+
+    return rigidity
Index: /issm/trunk/src/m/materials/nye.m
===================================================================
--- /issm/trunk/src/m/materials/nye.m	(revision 24313)
+++ /issm/trunk/src/m/materials/nye.m	(revision 24313)
@@ -0,0 +1,43 @@
+function rigidity = nye(temperature,ice_type)
+%NYE - Nye viscosity coefficient
+%
+%   Compute rigidity of ice (either CO2 or H2O) for a given temperature
+%   rigidity (in s^(1/n)Pa) is the flow law parameter in the flow law
+%   sigma=B*e(1/n) (Nye, p2000).  temperature is in Kelvin degrees
+%
+%   Usage:
+%      rigidity=nye(temperature,ice_type) % ice_type = 1: CO2 ice // ice_type = 2: H2O ice
+
+	% Beyond-melting-point cases
+	warning OFF BACKTRACE
+	if (ice_type==1)
+		if (any(temperature>200&temperature<220))
+			warning('CO2 ICE - POSSIBLE MELTING. Some temperature values are between 200K and 220K.\nLook at indexes: %s', mat2str(find(temperature>200 & temperature<220))');
+		end
+		if (any(temperature>=220))
+			warning('CO2 ICE - GUARANTEED MELTING. Some temperature values are beyond 220K.\nLook at indexes: %s', mat2str(find(temperature>=220))');
+		end
+	elseif ((ice_type==2)&&(any(temperature>273.15)))
+		warning('H2O ICE - GUARANTEED MELTING. Some temperature values are beyond 273.15K.\nLook at indexes: %s', mat2str(find(temperature>273.15))');
+	end
+
+	% Coefficients
+	Rg=8.3144598;       % J mol^-1 K^-1
+
+	if(ice_type==1)     % CO2 ice
+		A_const     = 10^(10.8);    % s^-1 MPa
+		Q           = 63000;        % J mol^-1
+		n           = 7;            % Glen's exponent
+	elseif(ice_type==2) % H2O ice
+		A_const     = 9e4;          % s^-1 MPa
+		Q           = 60000;        % J mol^-1
+		n           = 3;            % Glen's exponent
+	else
+		error('Ice type not supported');
+	end
+
+	% Arrhenius Law
+	A=A_const*exp(-Q./(temperature*Rg));  % s^-1 MPa
+	rigidity=A.^(-1/n)*1e6;               % s^(1/n) Pa
+
+end
Index: /issm/trunk/src/m/materials/nye.py
===================================================================
--- /issm/trunk/src/m/materials/nye.py	(revision 24313)
+++ /issm/trunk/src/m/materials/nye.py	(revision 24313)
@@ -0,0 +1,52 @@
+import numpy as np
+
+
+def nye(temperature, ice_type):
+    """
+   NYE - figure out the rigidity of ice (either CO2 or H2O) for a given temperature
+    rigidity (in s^(1 / n)Pa) is the flow law parameter in the flow law sigma = B * e(1 / n) (Nye, p2000).
+    temperature is in Kelvin degrees
+
+   Usage:
+       rigidity = nye(temperature, ice_type) % ice_type = 1: CO2 ice / /  ice_type = 2: H2O ice
+    """
+
+    # Declaring temperature and rigidity arrays
+    if np.ndim(temperature) == 2:
+        T = temperature.flatten()
+    elif isinstance(temperature, float) or isinstance(temperature, int):
+        T = np.array([temperature])
+    else:
+        T = temperature
+    rigidity = np.zeros_like(T)
+
+    # Beyond - melting - point cases
+    if (ice_type == 1):
+        for i in range(len(T)):
+            if (200 < T[i] < 220):
+                warnings.warn('CO2 ICE - POSSIBLE MELTING. Some temperature values are between 200K and 220K.')
+            break
+        if ((T >= 220).any()):
+            warnings.warn('CO2 ICE - GUARANTEED MELTING. Some temperature values are beyond 220K.')
+    elif (ice_type == 2) and ((T > 273.15).any()):
+        warnings.warn('H2O ICE - GUARANTEED MELTING. Some temperature values are beyond 273.15K.')
+
+    Rg = 8.3144598  # J mol^-1 K^-1
+
+    if ice_type == 1:  # CO2 ice
+        A_const = 10**(10.8)  # s^-1 MPa
+        Q = 63000.  # J mol^-1
+        n = 7.  # Glen's exponent
+    elif ice_type == 2:  # H2O ice
+        A_const = 9 * 10**4  # s^-1 MPa
+        Q = 60000.  #  J mol^-1
+        n = 3.  # Glen's exponent
+    else:
+        raise RuntimeError('Ice type not supported')
+
+    # Arrhenius Law
+    A = A_const * np.exp(-1 * Q / (T * Rg))  # s^-1 MPa
+    rigidity = A**(-1 / n) * 10**6  # s^(1 / n) Pa
+
+    # Return output
+    return rigidity
Index: /issm/trunk/src/m/materials/paterson.py
===================================================================
--- /issm/trunk/src/m/materials/paterson.py	(revision 24312)
+++ /issm/trunk/src/m/materials/paterson.py	(revision 24313)
@@ -1,79 +1,79 @@
 import numpy as np
 
+
 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).
+       temperature is in Kelvin degrees
 
-	   Usage:
-	      rigidity=paterson(temperature)
-	"""
-	
-	if np.any(temperature<0.):
-		raise RuntimeError("input temperature should be in Kelvin (positive)")
+       Usage:
+          rigidity = paterson(temperature)
+    """
 
-	if np.ndim(temperature)==2:
-		#T = temperature.reshape(-1,)-273.15
-		T = temperature.flatten()-273.15
-	elif isinstance(temperature,float) or isinstance(temperature,int):
-		T = np.array([temperature])-273.15
-	else:
-		T = temperature-273.15
+    if np.any(temperature < 0.):
+        raise RuntimeError("input temperature should be in Kelvin (positive)")
 
-	#The routine below is equivalent to:
+    if np.ndim(temperature) == 2:
+        #T = temperature.reshape(-1, ) - 273.15
+        T = temperature.flatten() - 273.15
+    elif isinstance(temperature, float) or isinstance(temperature, int):
+        T = np.array([temperature]) - 273.15
+    else:
+        T = temperature - 273.15
 
-	# n=3; T=temperature-273;
-	# %From paterson,
-	# Temp=[0;-2;-5;-10;-15;-20;-25;-30;-35;-40;-45;-50];
-	# A=[6.8*10^-15;2.4*10^-15;1.6*10^-15;4.9*10^-16;2.9*10^-16;1.7*10^-16;9.4*
-	# 10^-17;5.1*10^-17;2.7*10^-17;1.4*10^-17;7.3*10^-18;3.6*10^-18];;%s-1(kPa-3)
-	# %Convert into rigidity B
-	# B=A.^(-1/n)*10^3; %s^(1/3)Pa
-	# %Now, do a cubic fit between Temp and B: 
-	# fittedmodel=fit(Temp,B,'cubicspline');
-	# rigidity=fittedmodel(temperature);
+    #The routine below is equivalent to:
 
-	rigidity=np.zeros_like(T)
-	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)
-	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)
-	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)
-	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)
-	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)
-	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)
-	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)
-	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)
-	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)
-	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)
-	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)
+    # n = 3; T = temperature-273
+    # %From paterson,
+    # Temp = [0; -2; -5; -10; -15; -20; -25; -30; -35; -40; -45; -50]
+    # A = [6.8 * 1.0e-15;2.4 * 1.0e-15;1.6 * 1.0e-15;4.9 * 1.0e-16;2.9 * 1.0e-16;1.7 * 1.0e-16;9.4 *
+    # 1.0e-17;5.1 * 1.0e-17;2.7 * 1.0e-17;1.4 * 1.0e-17;7.3 * 1.0e-18;3.6 * 1.0e-18];;%s - 1(kPa - 3)
+    # %Convert into rigidity B
+    # B = A.^(-1 / n) * 1.0e3; %s^(1 / 3)Pa
+    # %Now, do a cubic fit between Temp and B:
+    # fittedmodel = fit(Temp, B, 'cubicspline')
+    # rigidity = fittedmodel(temperature)
 
-	#Now make sure that rigidity is positive
-	pos=np.nonzero(rigidity<0)[0]
-	if len(pos):
-		rigidity[pos]=1.e6 
+    rigidity = np.zeros_like(T)
+    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)
+    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)
+    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)
+    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)
+    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)
+    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)
+    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)
+    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)
+    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)
+    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)
+    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)
 
-	return rigidity
+    #Now make sure that rigidity is positive
+    pos = np.nonzero(rigidity < 0)[0]
+    if len(pos):
+        rigidity[pos] = 1.e6
 
+    return rigidity
Index: /issm/trunk/src/m/mech/analyticaldamage.py
===================================================================
--- /issm/trunk/src/m/mech/analyticaldamage.py	(revision 24312)
+++ /issm/trunk/src/m/mech/analyticaldamage.py	(revision 24313)
@@ -1,106 +1,111 @@
-import numpy as  np
+import numpy as np
 from averaging import averaging
 #from plotmodel import plotmodel
 from thomasparams import thomasparams
 
-def analyticaldamage(md,**kwargs):
-	'''
-	ANALYTICALDAMAGE - compute damage for an ice shelf 
-	
-		 This routine computes damage as a function of water/ice
-		 material properties, ice thickness, strain rate, and ice 
-		 rigidity.  The model must contain computed strain rates,
-		 either from observed or modeled ice velocities.
-	
-	   Available options:
-			-eq			: analytical equation to use in the calculation.  Must be one of:
-									'Weertman1D' for a confined ice shelf free to flow in one direction
-									'Weertman2D' for an unconfined ice shelf free to spread in any direction
-									'Thomas' for a 2D ice shelf, taking into account full strain rate tensor (default)
-			-smoothing	: the amount of smoothing to be applied to the strain rate data.
-									Type 'help averaging' for more information on its usage.
-			-coordsys	: coordinate system for calculating the strain rate
-						components. Must be one of:
-			-sigmab		: a compressive backstress term to be subtracted from the driving stress 
-									in the damage calculation
-	
-	   Return values:
-			'damage' which is truncated in the range [0,1-1e-9]
-	
-		   'B' is the rigidity, which is equal to md.materials.rheology_B in areas outside
-			those defined by 'mask.'  Within areas defined by 'mask,' where negative damage 
-			is inferred, 'B' is updated to make damage equal to zero.  
-	
-			'backstress' is the inferred backstress necessary to balance the analytical solution
-			(keeping damage within its appropriate limits, e.g. D in [0,1]).
-	
-	   Usage:
-	      damage,B,backstress=analyticaldamage(md,kwargs)
-	
-	   Example:
-	      damage,B,backstress=analyticaldamage(md,eq='Weertman2D',smoothing=2,sigmab=10e3)
-	'''
 
-	#unpack kwargs
-	eq=kwargs.pop('eq','Thomas')
-	if 'eq' in kwargs: del kwargs['eq']
-	smoothing=kwargs.pop('smoothing',0)
-	if 'smoothing' in kwargs: del kwargs['smoothing']
-	coordsys=kwargs.pop('coordsys','longitudinal')
-	if 'coordsys' in kwargs: del kwargs['coordsys']
-	sigmab=kwargs.pop('sigmab',0)
-	if 'sigmab' in kwargs: del kwargs['sigmab']
-	assert len(kwargs)==0, 'error, unexpected or misspelled kwargs'
+def analyticaldamage(md, **kwargs):
+    '''
+    ANALYTICALDAMAGE - compute damage for an ice shelf
 
-	if isinstance(sigmab,(int,float)):
-		sigmab=sigmab*np.ones((md.mesh.numberofvertices,))
+         This routine computes damage as a function of water / ice
+         material properties, ice thickness, strain rate, and ice
+         rigidity.  The model must contain computed strain rates,
+         either from observed or modeled ice velocities.
 
-	# check inputs
-	if 'strainrate' not in md.results.__dict__:
-		raise StandardError('md.results.strainrate not present.  Calculate using md=mechanicalproperties(md,vx,vy)')
-	if not '2d' in md.mesh.__doc__:
-		raise StandardError('only 2d (planview) model supported currently')
-	if np.any(md.flowequation.element_equation!=2):
-		print 'Warning: the model has some non SSA elements. These will be treated like SSA elements'
+       Available options:
+             - eq            : analytical equation to use in the calculation.  Must be one of:
+                                    'Weertman1D' for a confined ice shelf free to flow in one direction
+                                    'Weertman2D' for an unconfined ice shelf free to spread in any direction
+                                    'Thomas' for a 2D ice shelf, taking into account full strain rate tensor (default)
+             - smoothing    : the amount of smoothing to be applied to the strain rate data.
+                                    Type 'help averaging' for more information on its usage.
+             - coordsys    : coordinate system for calculating the strain rate
+                        components. Must be one of:
+             - sigmab        : a compressive backstress term to be subtracted from the driving stress
+                                    in the damage calculation
 
-	a,b,theta,ex=thomasparams(md,eq=eq,smoothing=smoothing,coordsys=coordsys)
-	
-	# spreading stress
-	rhoi=md.materials.rho_ice
-	rhow=md.materials.rho_water
-	C=0.5*rhoi*md.constants.g*(1.-rhoi/rhow)
-	T=C*md.geometry.thickness
-	
-	# rheology
-	B=md.materials.rheology_B
-	n=averaging(md,md.materials.rheology_n,0)
-	
-	D=1.-(1.+a+a**2+b**2)**((n-1.)/(2.*n))/np.abs(ex)**(1./n)*(T-sigmab)/B/(2.+a)/np.sign(ex)
-	
-	# D>1 where (2+a).*sign(ex)<0, compressive regions where high backstress needed
-	pos=np.nonzero(D>1)
-	D[pos]=0
-	
-	backstress=np.zeros((md.mesh.numberofvertices,))
+       Return values:
+            'damage' which is truncated in the range [0, 1 - 1e-9]
 
-	# backstress to bring D down to one 
-	backstress[pos]=T[pos]-(1.-D[pos])*B[pos]*np.sign(ex[pos])*(2.+a[pos])*np.abs(ex[pos])**(1./n[pos])/(1.+a[pos]+a[pos]**2)**((n[pos]-1.)/2./n[pos])
-	
-	pos=np.nonzero(D<0)
-	#mask=ismember(1:md.mesh.numberofvertices,pos);
-	D[pos]=0
-	
-	# backstress to bring negative damage to zero
-	backstress[pos]=T[pos]-(1.-D[pos])*B[pos]*np.sign(ex[pos])*(2.+a[pos])*np.abs(ex[pos])**(1./n[pos])/(1.+a[pos]+a[pos]**2)**((n[pos]-1.)/2./n[pos])
-	
-	pos=np.nonzero(backstress<0)
-	backstress[pos]=0
-	
-	# rigidity from Thomas relation for D=0 and backstress=0
-	B=np.sign(ex)/(2.+a)*(1.+a+a**2)**((n-1.)/2./n)*T/(np.abs(ex)**(1./n))
-	pos=np.nonzero(B<0)
-	B[pos]=md.materials.rheology_B[pos]
-	
-	damage=D
-	
-	return damage, B, backstress
+           'B' is the rigidity, which is equal to md.materials.rheology_B in areas outside
+            those defined by 'mask.'  Within areas defined by 'mask, ' where negative damage
+            is inferred, 'B' is updated to make damage equal to zero.
+
+            'backstress' is the inferred backstress necessary to balance the analytical solution
+            (keeping damage within its appropriate limits, e.g. D in [0, 1]).
+
+       Usage:
+          damage, B, backstress = analyticaldamage(md, kwargs)
+
+       Example:
+          damage, B, backstress = analyticaldamage(md, eq = 'Weertman2D', smoothing = 2, sigmab = 1.0e3)
+    '''
+
+    #unpack kwargs
+    eq = kwargs.pop('eq', 'Thomas')
+    if 'eq' in kwargs:
+        del kwargs['eq']
+    smoothing = kwargs.pop('smoothing', 0)
+    if 'smoothing' in kwargs:
+        del kwargs['smoothing']
+    coordsys = kwargs.pop('coordsys', 'longitudinal')
+    if 'coordsys' in kwargs:
+        del kwargs['coordsys']
+    sigmab = kwargs.pop('sigmab', 0)
+    if 'sigmab' in kwargs:
+        del kwargs['sigmab']
+    assert len(kwargs) == 0, 'error, unexpected or misspelled kwargs'
+
+    if isinstance(sigmab, (int, float)):
+        sigmab = sigmab * np.ones((md.mesh.numberofvertices, ))
+
+    # check inputs
+    if 'strainrate' not in md.results.__dict__:
+        raise Exception('md.results.strainrate not present.  Calculate using md = mechanicalproperties(md, vx, vy)')
+    if '2d' not in md.mesh.__doc__:
+        raise Exception('only 2d (planview) model supported currently')
+    if np.any(md.flowequation.element_equation != 2):
+        print('Warning: the model has some non SSA elements. These will be treated like SSA elements')
+
+    a, b, theta, ex = thomasparams(md, eq=eq, smoothing=smoothing, coordsys=coordsys)
+
+    # spreading stress
+    rhoi = md.materials.rho_ice
+    rhow = md.materials.rho_water
+    C = 0.5 * rhoi * md.constants.g * (1. - rhoi / rhow)
+    T = C * md.geometry.thickness
+
+    # rheology
+    B = md.materials.rheology_B
+    n = averaging(md, md.materials.rheology_n, 0)
+
+    D = 1. - (1. + a + a**2 + b**2)**((n - 1.) / (2. * n)) / np.abs(ex)**(1. / n) * (T - sigmab) / B / (2. + a) / np.sign(ex)
+
+    # D > 1 where (2 + a). * sign(ex) < 0, compressive regions where high backstress needed
+    pos = np.nonzero(D > 1)
+    D[pos] = 0
+
+    backstress = np.zeros((md.mesh.numberofvertices, ))
+
+    # backstress to bring D down to one
+    backstress[pos] = T[pos] - (1. - D[pos]) * B[pos] * np.sign(ex[pos]) * (2. + a[pos]) * np.abs(ex[pos])**(1. / n[pos]) / (1. + a[pos] + a[pos]**2)**((n[pos] - 1.) / 2. / n[pos])
+
+    pos = np.nonzero(D < 0)
+    #mask = ismember(1:md.mesh.numberofvertices, pos)
+    D[pos] = 0
+
+    # backstress to bring negative damage to zero
+    backstress[pos] = T[pos] - (1. - D[pos]) * B[pos] * np.sign(ex[pos]) * (2. + a[pos]) * np.abs(ex[pos])**(1. / n[pos]) / (1. + a[pos] + a[pos]**2)**((n[pos] - 1.) / 2. / n[pos])
+
+    pos = np.nonzero(backstress < 0)
+    backstress[pos] = 0
+
+    # rigidity from Thomas relation for D = 0 and backstress = 0
+    B = np.sign(ex) / (2. + a) * (1. + a + a**2)**((n - 1.) / 2. / n) * T / (np.abs(ex)**(1. / n))
+    pos = np.nonzero(B < 0)
+    B[pos] = md.materials.rheology_B[pos]
+
+    damage = D
+
+    return damage, B, backstress
Index: /issm/trunk/src/m/mech/backstressfrominversion.py
===================================================================
--- /issm/trunk/src/m/mech/backstressfrominversion.py	(revision 24312)
+++ /issm/trunk/src/m/mech/backstressfrominversion.py	(revision 24313)
@@ -1,74 +1,77 @@
-import numpy as  np
+import numpy as np
 from averaging import averaging
 from thomasparams import thomasparams
 
-def backstressfrominversion(md,**kwargs):
-	'''
-	Compute ice shelf backstress from inversion results.
 
-	This routine computes backstress based on the analytical formalism of
-	Thomas (1973) and Borstad et al. (2013, The Cryosphere).  The model
-	must contain inversion results for ice rigidity.  Strain rates must
-	also be included, either from observed or modeled velocities.  Ice
-	rigidity B is assumed to be parameterized by the ice temperature in
-	md.materials.rheology_B.
+def backstressfrominversion(md, **kwargs):
+    '''
+    Compute ice shelf backstress from inversion results.
+
+    This routine computes backstress based on the analytical formalism of
+    Thomas (1973) and Borstad et al. (2013, The Cryosphere).  The model
+    must contain inversion results for ice rigidity.  Strain rates must
+    also be included, either from observed or modeled velocities.  Ice
+    rigidity B is assumed to be parameterized by the ice temperature in
+    md.materials.rheology_B.
 
    Available options:
-		- 'tempmask'	: mask the inverted rigidity to be no more than
-							appropriate for the temperature of the ice?  
-							Boolean, defaults to false.
-		- 'smoothing'	: the amount of smoothing to be applied to the strain rate data.
-								Type 'help averaging' for more information on its
-								usage. Defaults to 0.
-		- 'coordsys'	: coordinate system for calculating the strain rate
-							components. Must be one of: 
-				'longitudinal': x axis aligned along a flowline at every point (default)
-				'principal': x axis aligned along maximum principal strain rate
-					at every point
-				'xy': x and y axes same as in polar stereographic projection 
+         - 'tempmask'    : mask the inverted rigidity to be no more than
+                            appropriate for the temperature of the ice?
+                            Boolean, defaults to false.
+         - 'smoothing'    : the amount of smoothing to be applied to the strain rate data.
+                                Type 'help averaging' for more information on its
+                                usage. Defaults to 0.
+         - 'coordsys'    : coordinate system for calculating the strain rate
+                            components. Must be one of:
+                'longitudinal': x axis aligned along a flowline at every point (default)
+                'principal': x axis aligned along maximum principal strain rate
+                    at every point
+                'xy': x and y axes same as in polar stereographic projection
 
    Return values:
-		'backstress' is the inferred backstress based on the analytical
-		solution for ice shelf creep
+        'backstress' is the inferred backstress based on the analytical
+        solution for ice shelf creep
 
    Usage:
-      backstress=backstressfrominversion(md,options)
+      backstress = backstressfrominversion(md, options)
 
    Example:
-      backstress=backstressfrominversion(md,'smoothing',2,'coordsys','longitudinal','tempmask',true);
-	'''
+      backstress = backstressfrominversion(md, 'smoothing', 2, 'coordsys', 'longitudinal', 'tempmask', true)
+    '''
 
-	# unpack kwargs
-	tempmask=kwargs.pop('tempmask',False)
-	if 'tempmask' in kwargs: del kwargs['maxiter']
-	smoothing=kwargs.pop('smoothing',0)
-	if 'smoothing' in kwargs: del kwargs['smoothing']
-	coordsys=kwargs.pop('coordsys','longitudinal')
-	if 'coordsys' in kwargs: del kwargs['coordsys']
-	assert len(kwargs)==0, 'error, unexpected or misspelled kwargs'
+    # unpack kwargs
+    tempmask = kwargs.pop('tempmask', False)
+    if 'tempmask' in kwargs:
+        del kwargs['maxiter']
+    smoothing = kwargs.pop('smoothing', 0)
+    if 'smoothing' in kwargs:
+        del kwargs['smoothing']
+    coordsys = kwargs.pop('coordsys', 'longitudinal')
+    if 'coordsys' in kwargs:
+        del kwargs['coordsys']
+    assert len(kwargs) == 0, 'error, unexpected or misspelled kwargs'
 
-	# some checks
-	if not hasattr(md.results,'strainrate'):
-		raise StandardError('md.results.strainrate not present.  Calculate using md=mechanicalproperties(md,vx,vy)')
-	if not '2d' in md.mesh.__doc__:
-		raise StandardError('only 2d (planview) model supported currently')
-	if any(md.flowequation.element_equation!=2):
-		raise StandardError('Warning: the model has some non-SSA elements.  These will be treated like SSA elements')
+    # some checks
+    if not hasattr(md.results, 'strainrate'):
+        raise Exception('md.results.strainrate not present.  Calculate using md = mechanicalproperties(md, vx, vy)')
+    if '2d' not in md.mesh.__doc__:
+        raise Exception('only 2d (planview) model supported currently')
+    if any(md.flowequation.element_equation != 2):
+        raise Exception('Warning: the model has some non - SSA elements.  These will be treated like SSA elements')
 
-	T=0.5*md.materials.rho_ice*md.constants.g*(1-md.materials.rho_ice/md.materials.rho_water)*md.geometry.thickness
-	n=averaging(md,md.materials.rheology_n,0)
-	B=md.materials.rheology_B
-	Bi=md.results.StressbalanceSolution.MaterialsRheologyBbar.reshape(-1,)
-	
-	a0,b0,theta0,ex0=thomasparams(md,eq='Thomas',smoothing=smoothing,coordsys=coordsys)
-	
-	if tempmask:
-		Bi=md.results.StressbalanceSolution.MaterialsRheologyBbar
-		pos=np.nonzero(Bi>md.materials.rheology_B)
-		Bi[pos]=md.materials.rheology_B[pos]
-	
-	# analytical backstress solution
-	backstress=T-Bi*np.sign(ex0)*(2+a0)*np.abs(ex0)**(1./n)/((1+a0+a0**2+b0**2)**((n-1.)/2./n))
-	backstress[np.nonzero(backstress<0)]=0
+    T = 0.5 * md.materials.rho_ice * md.constants.g * (1 - md.materials.rho_ice / md.materials.rho_water) * md.geometry.thickness
+    n = averaging(md, md.materials.rheology_n, 0)
+    Bi = md.results.StressbalanceSolution.MaterialsRheologyBbar.reshape(-1, )
 
-	return backstress
+    a0, b0, theta0, ex0 = thomasparams(md, eq='Thomas', smoothing=smoothing, coordsys=coordsys)
+
+    if tempmask:
+        Bi = md.results.StressbalanceSolution.MaterialsRheologyBbar
+        pos = np.nonzero(Bi > md.materials.rheology_B)
+        Bi[pos] = md.materials.rheology_B[pos]
+
+    # analytical backstress solution
+    backstress = T - Bi * np.sign(ex0) * (2 + a0) * np.abs(ex0)**(1. / n) / ((1 + a0 + a0**2 + b0**2)**((n - 1.) / 2. / n))
+    backstress[np.nonzero(backstress < 0)] = 0
+
+    return backstress
Index: /issm/trunk/src/m/mech/calcbackstress.py
===================================================================
--- /issm/trunk/src/m/mech/calcbackstress.py	(revision 24312)
+++ /issm/trunk/src/m/mech/calcbackstress.py	(revision 24313)
@@ -1,66 +1,69 @@
-import numpy as  np
+import numpy as np
 from averaging import averaging
 from thomasparams import thomasparams
 
-def calcbackstress(md,**kwargs):
-	'''
-	Compute ice shelf backstress.
 
-	This routine computes backstress based on the analytical formalism of
-	Thomas (1973) and Borstad et al. (2013, The Cryosphere) based on the
-	ice rigidity, thickness, the densities of ice and seawater, and
-	(optionally) damage.  Strain rates must also be included, either from
-	observed or modeled velocities. 
-	
-	Available options:
-		- 'smoothing'	: the amount of smoothing to be applied to the strain rate data.
-								Type 'help averaging' for more information on its
-								usage. Defaults to 0.
-		- 'coordsys'	: coordinate system for calculating the strain rate
-							components. Must be one of: 
-				'longitudinal': x axis aligned along a flowline at every point (default)
-				'principal': x axis aligned along maximum principal strain rate
-					at every point
-				'xy': x and y axes same as in polar stereographic projection 
+def calcbackstress(md, **kwargs):
+    '''
+    Compute ice shelf backstress.
+
+    This routine computes backstress based on the analytical formalism of
+    Thomas (1973) and Borstad et al. (2013, The Cryosphere) based on the
+    ice rigidity, thickness, the densities of ice and seawater, and
+    (optionally) damage.  Strain rates must also be included, either from
+    observed or modeled velocities.
+
+    Available options:
+         - 'smoothing'    : the amount of smoothing to be applied to the strain rate data.
+                                Type 'help averaging' for more information on its
+                                usage. Defaults to 0.
+         - 'coordsys'    : coordinate system for calculating the strain rate
+                            components. Must be one of:
+                'longitudinal': x axis aligned along a flowline at every point (default)
+                'principal': x axis aligned along maximum principal strain rate
+                    at every point
+                'xy': x and y axes same as in polar stereographic projection
 
    Return values:
-		'backstress' is the inferred backstress based on the analytical
-		solution for ice shelf creep
+        'backstress' is the inferred backstress based on the analytical
+        solution for ice shelf creep
 
    Usage:
-      backstress=calcbackstress(md,options)
+      backstress = calcbackstress(md, options)
 
    Example:
-      backstress=calcbackstress(md,'smoothing',2,'coordsys','longitudinal')
-	'''
+      backstress = calcbackstress(md, 'smoothing', 2, 'coordsys', 'longitudinal')
+    '''
 
-	# unpack kwargs
-	smoothing=kwargs.pop('smoothing',0)
-	if 'smoothing' in kwargs: del kwargs['smoothing']
-	coordsys=kwargs.pop('coordsys','longitudinal')
-	if 'coordsys' in kwargs: del kwargs['coordsys']
-	assert len(kwargs)==0, 'error, unexpected or misspelled kwargs'
+    # unpack kwargs
+    smoothing = kwargs.pop('smoothing', 0)
+    if 'smoothing' in kwargs:
+        del kwargs['smoothing']
+    coordsys = kwargs.pop('coordsys', 'longitudinal')
+    if 'coordsys' in kwargs:
+        del kwargs['coordsys']
+    assert len(kwargs) == 0, 'error, unexpected or misspelled kwargs'
 
-	# some checks
-	if not hasattr(md.results,'strainrate'):
-		raise StandardError('md.results.strainrate not present.  Calculate using md=mechanicalproperties(md,vx,vy)')
-	if not '2d' in md.mesh.__doc__:
-		raise StandardError('only 2d (planview) model supported currently')
-	if any(md.flowequation.element_equation!=2):
-		raise StandardError('Warning: the model has some non-SSA elements.  These will be treated like SSA elements')
+    # some checks
+    if not hasattr(md.results, 'strainrate'):
+        raise Exception('md.results.strainrate not present.  Calculate using md = mechanicalproperties(md, vx, vy)')
+    if '2d' not in md.mesh.__doc__:
+        raise Exception('only 2d (planview) model supported currently')
+    if any(md.flowequation.element_equation != 2):
+        raise Exception('Warning: the model has some non - SSA elements.  These will be treated like SSA elements')
 
-	T=0.5*md.materials.rho_ice*md.constants.g*(1-md.materials.rho_ice/md.materials.rho_water)*md.geometry.thickness
-	n=averaging(md,md.materials.rheology_n,0)
-	B=md.materials.rheology_B
-	if md.damage.isdamage:
-		D=md.damage.D
-	else:
-		D=0.
-	
-	a0,b0,theta0,ex0=thomasparams(md,eq='Thomas',smoothing=smoothing,coordsys=coordsys)
-	
-	# analytical backstress solution
-	backstress=T-(1.-D)*B*np.sign(ex0)*(2+a0)*np.abs(ex0)**(1./n)/((1+a0+a0**2+b0**2)**((n-1.)/2./n))
-	backstress[np.nonzero(backstress<0)]=0
+    T = 0.5 * md.materials.rho_ice * md.constants.g * (1 - md.materials.rho_ice / md.materials.rho_water) * md.geometry.thickness
+    n = averaging(md, md.materials.rheology_n, 0)
+    B = md.materials.rheology_B
+    if md.damage.isdamage:
+        D = md.damage.D
+    else:
+        D = 0.
 
-	return backstress
+    a0, b0, theta0, ex0 = thomasparams(md, eq='Thomas', smoothing=smoothing, coordsys=coordsys)
+
+    # analytical backstress solution
+    backstress = T - (1. - D) * B * np.sign(ex0) * (2 + a0) * np.abs(ex0)**(1. / n) / ((1 + a0 + a0**2 + b0**2)**((n - 1.) / 2. / n))
+    backstress[np.nonzero(backstress < 0)] = 0
+
+    return backstress
Index: /issm/trunk/src/m/mech/damagefrominversion.py
===================================================================
--- /issm/trunk/src/m/mech/damagefrominversion.py	(revision 24312)
+++ /issm/trunk/src/m/mech/damagefrominversion.py	(revision 24313)
@@ -1,44 +1,45 @@
-import numpy as  np
+import numpy as np
+
 
 def damagefrominversion(md):
-	'''
-	compute ice shelf damage from inversion results
+    '''
+    compute ice shelf damage from inversion results
 
-	This routine computes damage based on the analytical formalism of Borstad et
-	al. (2013, The Cryosphere).  The model must contain inversion results for
-	ice rigidity.  Ice rigidity B is assumed to be parameterized by the ice
-	temperature in md.materials.rheology_B. 
-	
-	Usage:
-		damage=damagefrominversion(md)
-	
-	Example:
-		damage=damagefrominversion(md)
-	'''
+    This routine computes damage based on the analytical formalism of Borstad et
+    al. (2013, The Cryosphere).  The model must contain inversion results for
+    ice rigidity.  Ice rigidity B is assumed to be parameterized by the ice
+    temperature in md.materials.rheology_B.
 
-	# check inputs
-	if not hasattr(md.results,'strainrate'):
-		raise StandardError('md.results.strainrate is not present.  Calculate using md=mechanicalproperties(md,vx,vy)')
-	if not '2d' in md.mesh.__doc__:
-		raise StandardError('only 2d (planview) model supported currently')
-	if any(md.flowequation.element_equation!=2):
-		raise StandardError('Warning: the model has some non-SSA elements.  These will be treated like SSA elements')
-	if np.ndim(md.results.StressbalanceSolution.MaterialsRheologyBbar)==2:
-		Bi=md.results.StressbalanceSolution.MaterialsRheologyBbar.reshape(-1,)
-	else:
-		Bi=md.results.StressbalanceSolution.MaterialsRheologyBbar
-	if np.ndim(md.materials.rheology_B)==2:
-		BT=md.materials.rheology_B.reshape(-1,)
-	else:
-		BT=md.materials.rheology_B
+    Usage:
+        damage = damagefrominversion(md)
 
-	damage=np.zeros_like(Bi)
+    Example:
+        damage = damagefrominversion(md)
+    '''
 
-	# Damage where Bi softer than B(T)
-	pos=np.nonzero(Bi<BT)[0]
-	damage[pos]=1.-Bi[pos]/BT[pos]
-	
-	pos=np.nonzero(damage<0)
-	damage[pos]=0
+    # check inputs
+    if not hasattr(md.results, 'strainrate'):
+        raise Exception('md.results.strainrate is not present.  Calculate using md = mechanicalproperties(md, vx, vy)')
+    if '2d' not in md.mesh.__doc__:
+        raise Exception('only 2d (planview) model supported currently')
+    if any(md.flowequation.element_equation != 2):
+        raise Exception('Warning: the model has some non - SSA elements.  These will be treated like SSA elements')
+    if np.ndim(md.results.StressbalanceSolution.MaterialsRheologyBbar) == 2:
+        Bi = md.results.StressbalanceSolution.MaterialsRheologyBbar.reshape(-1, )
+    else:
+        Bi = md.results.StressbalanceSolution.MaterialsRheologyBbar
+    if np.ndim(md.materials.rheology_B) == 2:
+        BT = md.materials.rheology_B.reshape(-1, )
+    else:
+        BT = md.materials.rheology_B
 
-	return damage
+    damage = np.zeros_like(Bi)
+
+    # Damage where Bi softer than B(T)
+    pos = np.nonzero(Bi < BT)[0]
+    damage[pos] = 1. - Bi[pos] / BT[pos]
+
+    pos = np.nonzero(damage < 0)
+    damage[pos] = 0
+
+    return damage
Index: /issm/trunk/src/m/mech/mechanicalproperties.py
===================================================================
--- /issm/trunk/src/m/mech/mechanicalproperties.py	(revision 24312)
+++ /issm/trunk/src/m/mech/mechanicalproperties.py	(revision 24313)
@@ -1,150 +1,150 @@
-import numpy as  np
+import numpy as np
 from GetNodalFunctionsCoeff import GetNodalFunctionsCoeff
 from results import results
-from averaging import averaging
 
-def mechanicalproperties(md,vx,vy,**kwargs):
-	"""
-	MECHANICALPROPERTIES - compute stress and strain rate for a goven velocity
-	
+
+def mechanicalproperties(md, vx, vy, **kwargs):
+    """
+    MECHANICALPROPERTIES - compute stress and strain rate for a goven 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
-	
+
    Usage:
-      md=mechanicalproperties(md,vx,vy)
-	
+      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)
-	"""
+      md = mechanicalproperties(md, md.initialization.vx, md.initialization.vy)
+      md = mechanicalproperties(md, md.inversion.vx_obs, md.inversion.vy_obs)
+    """
 
-	#some checks
-	if len(vx)!=md.mesh.numberofvertices or len(vy)!=md.mesh.numberofvertices:
-		raise ValueError('the input velocity should be of size ' + md.mesh.numberofvertices)
-	
-	#if md.mesh.dimension!=2:
-	#	raise StandardError('only 2D model supported currently')
+    #some checks
+    if len(vx) != md.mesh.numberofvertices or len(vy) != md.mesh.numberofvertices:
+        raise ValueError('the input velocity should be of size ' + md.mesh.numberofvertices)
 
-	if np.any(md.flowequation.element_equation!=2):
-		print 'Warning: the model has some non SSA elements. These will be treated like SSA elements'
+    #if md.mesh.dimension != 2:
+    #    raise StandardError('only 2D model supported currently')
 
-        #unpack kwargs
-	if 'damage' in kwargs: 
-	    damage=kwargs.pop('damage')
-            if len(damage)!=md.mesh.numberofvertices:
-		raise ValueError('if damage is supplied it should be of size ' + md.mesh.numberofvertices)
-            if np.ndim(damage)==2:
-                damage=damage.reshape(-1,)
-        else: damage=None
+    if np.any(md.flowequation.element_equation != 2):
+        print('Warning: the model has some non SSA elements. These will be treated like SSA elements')
 
-	if np.ndim(vx)==2:
-		vx=vx.reshape(-1,)
-	if np.ndim(vy)==2:
-		vy=vy.reshape(-1,)
-	
-	#initialization
-	numberofelements=md.mesh.numberofelements
-	numberofvertices=md.mesh.numberofvertices
-	index=md.mesh.elements
-	summation=np.array([[1],[1],[1]])
-	directionsstress=np.zeros((numberofelements,4))
-	directionsstrain=np.zeros((numberofelements,4))
-	valuesstress=np.zeros((numberofelements,2))
-	valuesstrain=np.zeros((numberofelements,2))
-	
-	#compute nodal functions coefficients N(x,y)=alpha x + beta y +gamma
-	alpha,beta=GetNodalFunctionsCoeff(index,md.mesh.x,md.mesh.y)[0:2]
-	
-	#compute shear
-	vxlist=vx[index-1]/md.constants.yts
-	vylist=vy[index-1]/md.constants.yts
-	ux=np.dot((vxlist*alpha),summation).reshape(-1,)
-	uy=np.dot((vxlist*beta),summation).reshape(-1,)
-	vx=np.dot((vylist*alpha),summation).reshape(-1,)
-	vy=np.dot((vylist*beta),summation).reshape(-1,)
-	uyvx=(vx+uy)/2.
-	#clear vxlist vylist
-	
-	#compute viscosity
-	nu=np.zeros((numberofelements,))
-	B_bar=np.dot(md.materials.rheology_B[index-1],summation/3.).reshape(-1,)
-	power=((md.materials.rheology_n-1.)/(2.*md.materials.rheology_n)).reshape(-1,)
-	second_inv=(ux**2.+vy**2.+((uy+vx)**2.)/4.+ux*vy).reshape(-1,)
-	
-	#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
-	
-	if 'matice' in md.materials.__module__:
-		location=np.nonzero(second_inv)
-		nu[location]=B_bar[location]/(second_inv[location]**power[location])
-		location=np.nonzero(np.logical_and(second_inv==0,power==0))
-		nu[location]=B_bar[location]
-		location=np.nonzero(np.logical_and(second_inv==0,power!=0))
-		nu[location]=10^18
-	elif 'matdamageice' in md.materials.__module__ and damage is not None:
-		print 'computing damage-dependent properties!'
-		Zinv=np.dot(1-damage[index-1],summation/3.).reshape(-1,)
-		location=np.nonzero(second_inv)
-		nu[location]=Zinv[location]*B_bar[location]/np.power(second_inv[location],power[location])
-		location=np.nonzero(np.logical_and(second_inv==0,power==0))
-		nu[location]=Zinv[location]*B_bar[location]
-		#clear Zinv
-	else:
-		raise StandardError('class of md.materials (' + md.materials.__module__ + ') not recognized or not supported')
-	
-	#compute stress
-	tau_xx=nu*ux
-	tau_yy=nu*vy
-	tau_xy=nu*uyvx
-	
-	#compute principal properties of stress
-	for i in np.arange(numberofelements):
-	
-		#compute stress and strainrate matrices
-		stress=np.array([ [tau_xx[i], tau_xy[i]], [tau_xy[i], tau_yy[i]] ])
-		strain=np.array([ [ux[i], uyvx[i]], [uyvx[i], vy[i]] ])
-	
-		#eigenvalues and vectors for stress
-		value,directions=np.linalg.eig(stress);
-		idx=value.argsort()[::-1] # sort in descending algebraic (not absolute) order
-		value=value[idx]
-		directions=directions[:,idx]
-		valuesstress[i,:]=[value[0],value[1]]
-		directionsstress[i,:]=directions.transpose().flatten()
+    #unpack kwargs
+    if 'damage' in kwargs:
+        damage = kwargs.pop('damage')
+        if len(damage) != md.mesh.numberofvertices:
+            raise ValueError('if damage is supplied it should be of size ' + md.mesh.numberofvertices)
+            if np.ndim(damage) == 2:
+                damage = np.squeeze(damage)
+        else:
+            damage = None
 
-		#eigenvalues and vectors for strain
-		value,directions=np.linalg.eig(strain);
-		idx=value.argsort()[::-1] # sort in descending order
-		value=value[idx]
-		directions=directions[:,idx]
-		valuesstrain[i,:]=[value[0],value[1]]
-		directionsstrain[i,:]=directions.transpose().flatten()
+    if np.ndim(vx) == 2:
+        vx = np.squeeze(vx)
+    if np.ndim(vy) == 2:
+        vy = np.squeeze(vy)
 
-	##plug onto the model
-	##NB: Matlab sorts the eigen value in increasing order, we want the reverse
-	
-	strainrate=results()
-	strainrate.xx=ux*md.constants.yts #strain rate in 1/a instead of 1/s
-	strainrate.yy=vy*md.constants.yts 
-	strainrate.xy=uyvx*md.constants.yts 
-	strainrate.principalvalue1=valuesstrain[:,0]*md.constants.yts 
-	strainrate.principalaxis1=directionsstrain[:,0:2]
-	strainrate.principalvalue2=valuesstrain[:,1]*md.constants.yts 
-	strainrate.principalaxis2=directionsstrain[:,2:4]
-	strainrate.effectivevalue=1./np.sqrt(2.)*np.sqrt(strainrate.xx**2+strainrate.yy**2+2.*strainrate.xy**2)
-	md.results.strainrate=strainrate
-	
-	deviatoricstress=results()
-	deviatoricstress.xx=tau_xx
-	deviatoricstress.yy=tau_yy
-	deviatoricstress.xy=tau_xy
-	deviatoricstress.principalvalue1=valuesstress[:,0]
-	deviatoricstress.principalaxis1=directionsstress[:,1:2]
-	deviatoricstress.principalvalue2=valuesstress[:,1]
-	deviatoricstress.principalaxis2=directionsstress[:,2:4]
-	deviatoricstress.effectivevalue=1./np.sqrt(2.)*np.sqrt(stress.xx**2+stress.yy**2+2.*stress.xy**2)
-	md.results.deviatoricstress=deviatoricstress
+    #initialization
+    numberofelements = md.mesh.numberofelements
+    index = md.mesh.elements
+    summation = np.array([[1], [1], [1]])
+    directionsstress = np.zeros((numberofelements, 4))
+    directionsstrain = np.zeros((numberofelements, 4))
+    valuesstress = np.zeros((numberofelements, 2))
+    valuesstrain = np.zeros((numberofelements, 2))
 
-	return md
+    #compute nodal functions coefficients N(x, y)=alpha x + beta y + gamma
+    alpha, beta = GetNodalFunctionsCoeff(index, md.mesh.x, md.mesh.y)[0:2]
+
+    #compute shear
+    vxlist = vx[index - 1] / md.constants.yts
+    vylist = vy[index - 1] / md.constants.yts
+    ux = np.dot((vxlist * alpha), summation).reshape(-1, )
+    uy = np.dot((vxlist * beta), summation).reshape(-1, )
+    vx = np.dot((vylist * alpha), summation).reshape(-1, )
+    vy = np.dot((vylist * beta), summation).reshape(-1, )
+    uyvx = (vx + uy) / 2.
+    #clear vxlist vylist
+
+    #compute viscosity
+    nu = np.zeros((numberofelements, ))
+    B_bar = np.dot(md.materials.rheology_B[index - 1], summation / 3.).reshape(-1, )
+    power = ((md.materials.rheology_n - 1.) / (2. * md.materials.rheology_n)).reshape(-1, )
+    second_inv = (ux**2. + vy**2. + ((uy + vx)**2.) / 4. + ux * vy).reshape(-1, )
+
+    #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
+
+    if 'matice' in md.materials.__module__:
+        location = np.nonzero(second_inv)
+        nu[location] = B_bar[location] / (second_inv[location]**power[location])
+        location = np.nonzero(np.logical_and(second_inv == 0, power == 0))
+        nu[location] = B_bar[location]
+        location = np.nonzero(np.logical_and(second_inv == 0, power != 0))
+        nu[location] = 10**18
+    elif 'matdamageice' in md.materials.__module__ and damage is not None:
+        print('computing damage-dependent properties!')
+        Zinv = np.dot(1 - damage[index - 1], summation / 3.).reshape(-1, )
+        location = np.nonzero(second_inv)
+        nu[location] = Zinv[location] * B_bar[location] / np.power(second_inv[location], power[location])
+        location = np.nonzero(np.logical_and(second_inv == 0, power == 0))
+        nu[location] = Zinv[location] * B_bar[location]
+    #clear Zinv
+    else:
+        raise Exception('class of md.materials (' + md.materials.__module__ + ') not recognized or not supported')
+
+    #compute stress
+    tau_xx = nu * ux
+    tau_yy = nu * vy
+    tau_xy = nu * uyvx
+
+    #compute principal properties of stress
+    for i in np.arange(numberofelements):
+
+        #compute stress and strainrate matrices
+        stress = np.array([[tau_xx[i], tau_xy[i]], [tau_xy[i], tau_yy[i]]])
+        strain = np.array([[ux[i], uyvx[i]], [uyvx[i], vy[i]]])
+
+    #eigenvalues and vectors for stress
+        value, directions = np.linalg.eig(stress)
+        idx = value.argsort()[::-1]  # sort in descending algebraic (not absolute) order
+        value = value[idx]
+        directions = directions[:, idx]
+        valuesstress[i, :] = [value[0], value[1]]
+        directionsstress[i, :] = directions.transpose().flatten()
+
+    #eigenvalues and vectors for strain
+        value, directions = np.linalg.eig(strain)
+        idx = value.argsort()[::-1]  # sort in descending order
+        value = value[idx]
+        directions = directions[:, idx]
+        valuesstrain[i, :] = [value[0], value[1]]
+        directionsstrain[i, :] = directions.transpose().flatten()
+
+    #plug onto the model
+    #NB: Matlab sorts the eigen value in increasing order, we want the reverse
+
+    strainrate = results()
+    strainrate.xx = ux * md.constants.yts  #strain rate in 1 / a instead of 1 / s
+    strainrate.yy = vy * md.constants.yts
+    strainrate.xy = uyvx * md.constants.yts
+    strainrate.principalvalue1 = valuesstrain[:, 0] * md.constants.yts
+    strainrate.principalaxis1 = directionsstrain[:, 0:2]
+    strainrate.principalvalue2 = valuesstrain[:, 1] * md.constants.yts
+    strainrate.principalaxis2 = directionsstrain[:, 2:4]
+    strainrate.effectivevalue = 1. / np.sqrt(2.) * np.sqrt(strainrate.xx**2 + strainrate.yy**2 + 2. * strainrate.xy**2)
+    md.results.strainrate = strainrate
+
+    deviatoricstress = results()
+    deviatoricstress.xx = tau_xx
+    deviatoricstress.yy = tau_yy
+    deviatoricstress.xy = tau_xy
+    deviatoricstress.principalvalue1 = valuesstress[:, 0]
+    deviatoricstress.principalaxis1 = directionsstress[:, 1:2]
+    deviatoricstress.principalvalue2 = valuesstress[:, 1]
+    deviatoricstress.principalaxis2 = directionsstress[:, 2:4]
+    deviatoricstress.effectivevalue = 1. / np.sqrt(2.) * np.sqrt(stress.xx**2 + stress.yy**2 + 2. * stress.xy**2)
+    md.results.deviatoricstress = deviatoricstress
+
+    return md
Index: /issm/trunk/src/m/mech/newforcing.py
===================================================================
--- /issm/trunk/src/m/mech/newforcing.py	(revision 24312)
+++ /issm/trunk/src/m/mech/newforcing.py	(revision 24313)
@@ -1,34 +1,35 @@
 import numpy as np
 
-def newforcing(t0,t1,deltaT,f0,f1,nodes):
-	'''
-FUNCTION NEWFORCING Build forcing that extends temporally from t0 to t1, and in magnitude from f0 to f1. Equal time 
-                    and magnitude spacing. 
 
-       Usage: forcing=newforcing(t0,t1,deltaT,f0,f1,nodes);  
-       Where: 
-          t0:t1: time interval. 
+def newforcing(t0, t1, deltaT, f0, f1, nodes):
+    '''
+FUNCTION NEWFORCING Build forcing that extends temporally from t0 to t1, and in magnitude from f0 to f1. Equal time
+                    and magnitude spacing.
+
+       Usage: forcing = newforcing(t0, t1, deltaT, f0, f1, nodes);
+       Where:
+          t0:t1: time interval.
           deltaT: time step
           f0:f1: magnitude interval.
           nodes: number of vertices where we have a temporal forcing
 
-       Example: 
-           md.smb.mass_balance=newforcing(md.timestepping.start_time,md.timestepping.final_time,
-                                          md.timestepping.time_step,-1,+2,md.mesh.numberofvertices)
-	'''
-	#Number of time steps: 
-	nsteps = (t1 - t0) / deltaT + 1
+       Example:
+           md.smb.mass_balance = newforcing(md.timestepping.start_time, md.timestepping.final_time,
+                                          md.timestepping.time_step, -1, +2, md.mesh.numberofvertices)
+    '''
+    #Number of time steps:
+    nsteps = (t1 - t0) / deltaT + 1
 
-	#delta forcing:
-	deltaf = (f1 - f0) / (nsteps - 1)
+    #delta forcing:
+    deltaf = (f1 - f0) / (nsteps - 1)
 
-	#creates times:
-	times = np.arange(t0,t1+deltaT,deltaT)	#Add deltaT to fix python/matlab discrepency
+    #creates times:
+    times = np.arange(t0, t1 + deltaT, deltaT)  #Add deltaT to fix python / matlab discrepency
 
-	#create forcing:
-	forcing = np.arange(f0,f1+deltaf,deltaf)#Add deltaf to fix python/matlab discrepency
+    #create forcing:
+    forcing = np.arange(f0, f1 + deltaf, deltaf)  #Add deltaf to fix python / matlab discrepency
 
-	#replicate for all nodes
-	forcing = np.tile(forcing, (nodes+1,1))
-	forcing[-1,:] = times
-	return forcing
+    #replicate for all nodes
+    forcing = np.tile(forcing, (nodes + 1, 1))
+    forcing[-1, :] = times
+    return forcing
Index: /issm/trunk/src/m/mech/robintemperature.py
===================================================================
--- /issm/trunk/src/m/mech/robintemperature.py	(revision 24312)
+++ /issm/trunk/src/m/mech/robintemperature.py	(revision 24313)
@@ -1,42 +1,43 @@
-import numpy as  np
+import numpy as np
 from scipy.special import erf
 
-def robintemperature(heatflux,accumrate,thickness,surftemp,z):
-	'''
-	Compute vertical temperature profile of an ice sheet (Robin, 1955)
 
-	This routine computes the vertical temperature profile of an ice sheet
-	according to the solution of Robin (1955), neglecting friction and
-	horizontal advection.  The solution is thus most appropriate at an ice
-	divide.
+def robintemperature(heatflux, accumrate, thickness, surftemp, z):
+    '''
+    Compute vertical temperature profile of an ice sheet (Robin, 1955)
 
-	The coordinate system for the solution runs from z=0 at the base 
-	to z=H at the surface of the ice.
+    This routine computes the vertical temperature profile of an ice sheet
+    according to the solution of Robin (1955), neglecting friction and
+    horizontal advection.  The solution is thus most appropriate at an ice
+    divide.
 
-	Parameters (SI units):
-		-heatflux	Geothermal heat flux (W m^-2)
-		-accumrate	Surface accumulation rate (m s^-1 ice equivalent)
-		-thickness	Ice thickness (m)
-		-surftemp	Surface temperature (K)
-		-z				Vertical position at which to calculate temperature
-						(z can be a scalar or a vector)
+    The coordinate system for the solution runs from z = 0 at the base
+    to z = H at the surface of the ice.
 
-	Returns a vector the same length as z containing the temperature in K
+    Parameters (SI units):
+         - heatflux    Geothermal heat flux (W m^-2)
+         - accumrate    Surface accumulation rate (m s^-1 ice equivalent)
+         - thickness    Ice thickness (m)
+         - surftemp    Surface temperature (K)
+         - z                Vertical position at which to calculate temperature
+                        (z can be a scalar or a vector)
 
-	Usage:
-		tprofile=robintemperature(heatflux,accumrate,thickness,surftemp,z)
-	'''
+    Returns a vector the same length as z containing the temperature in K
 
-	# some constants (from Holland and Jenkins, 1999)
-	alphaT=1.14e-6 # thermal diffusivity (m^2 s^-1)
-	c=2009. # specific heat capacity (J kg^-1 K^-1)
-	rho=917.  # ice density (kg m^-3)
-	
-	#create vertical coordinate variable
-	zstar=np.sqrt(2.*alphaT*thickness/accumrate)
-	
-	tprofile=surftemp+np.sqrt(2.*thickness*np.pi/accumrate/alphaT)*(-heatflux)/2./rho/c*(erf(z/zstar)-erf(thickness/zstar))
+    Usage:
+        tprofile = robintemperature(heatflux, accumrate, thickness, surftemp, z)
+    '''
 
-	return tprofile	
-	# difference between surface and base temperature for check (Cuffey2010 p412):
-	# print tprofile-surftemp
+    # some constants (from Holland and Jenkins, 1999)
+    alphaT = 1.14e-6  # thermal diffusivity (m^2 s^-1)
+    c = 2009.  # specific heat capacity (J kg^-1 K^-1)
+    rho = 917.  # ice density (kg m^-3)
+
+    #create vertical coordinate variable
+    zstar = np.sqrt(2. * alphaT * thickness / accumrate)
+
+    tprofile = surftemp + np.sqrt(2. * thickness * np.pi / accumrate / alphaT) * (-heatflux) / 2. / rho / c * (erf(z / zstar) - erf(thickness / zstar))
+
+    return tprofile
+    # difference between surface and base temperature for check (Cuffey2010 p412):
+    # print tprofile-surftemp
Index: /issm/trunk/src/m/mech/steadystateiceshelftemp.py
===================================================================
--- /issm/trunk/src/m/mech/steadystateiceshelftemp.py	(revision 24312)
+++ /issm/trunk/src/m/mech/steadystateiceshelftemp.py	(revision 24313)
@@ -1,64 +1,65 @@
-import numpy as  np
+import numpy as np
 
-def steadystateiceshelftemp(md,surfacetemp,basaltemp):
-	"""
-	Compute the depth-averaged steady-state temperature of an ice shelf 
-	This routine computes the depth-averaged temperature accounting for vertical advection 
-	and diffusion of heat into the base of the ice shelf as a function of surface and basal 
-	temperature and the basal melting rate.  Horizontal advection is ignored.
-   The solution is a depth-averaged version of Equation 25 in Holland and Jenkins (1999).
 
-	In addition to supplying md, the surface and basal temperatures of the ice shelf must be supplied in degrees Kelvin.
+def steadystateiceshelftemp(md, surfacetemp, basaltemp):
+    """
+    Compute the depth - averaged steady - state temperature of an ice shelf
+    This routine computes the depth - averaged temperature accounting for vertical advection
+    and diffusion of heat into the base of the ice shelf as a function of surface and basal
+    temperature and the basal melting rate.  Horizontal advection is ignored.
+   The solution is a depth - averaged version of Equation 25 in Holland and Jenkins (1999).
 
-	The model md must also contain the fields: 
-	md.geometry.thickness
-	md.basalforcings.floatingice_melting_rate (positive for melting, negative for freezing)
+    In addition to supplying md, the surface and basal temperatures of the ice shelf must be supplied in degrees Kelvin.
+
+    The model md must also contain the fields:
+    md.geometry.thickness
+    md.basalforcings.floatingice_melting_rate (positive for melting, negative for freezing)
 
    Usage:
-      temperature=steadystateiceshelftemp(md,surfacetemp,basaltemp)
-	"""
-	if len(md.geometry.thickness)!=md.mesh.numberofvertices:
-		raise ValueError('steadystateiceshelftemp error message: thickness should have a length of ' + md.mesh.numberofvertices)
-	
-	#surface and basal temperatures in degrees C
-	if len(surfacetemp)!=md.mesh.numberofvertices:
-		raise ValueError('steadystateiceshelftemp error message: surfacetemp should have a length of ' + md.mesh.numberofvertices)
-	
-	if len(basaltemp)!=md.mesh.numberofvertices:
-		raise ValueError('steadystateiceshelftemp error message: basaltemp should have a length of ' +md.mesh.numberofvertices)
-	
-	# Convert temps to Celsius for Holland and Jenkins (1999) equation
-	Ts=-273.15+surfacetemp
-	Tb=-273.15+basaltemp
-	
-	Hi=md.geometry.thickness
-	ki=1.14e-6*md.constants.yts # ice shelf thermal diffusivity from Holland and Jenkins (1999) converted to m^2/yr 
-	
-	#vertical velocity of ice shelf, calculated from melting rate 
-	wi=md.materials.rho_water/md.materials.rho_ice*md.basalforcings.floatingice_melting_rate 
-	
-	#temperature profile is linear if melting rate is zero, depth-averaged temp is simple average in this case
-	temperature=(Ts+Tb)/2  # where wi~=0
-	
-	pos=np.nonzero(abs(wi)>=1e-4) # to avoid division by zero
+      temperature = steadystateiceshelftemp(md, surfacetemp, basaltemp)
+    """
+    if len(md.geometry.thickness) != md.mesh.numberofvertices:
+        raise ValueError('steadystateiceshelftemp error message: thickness should have a length of ' + md.mesh.numberofvertices)
 
-	np.seterr(over='raise',divide='raise') # raise errors if floating point exceptions are encountered in following calculation
-	#calculate depth-averaged temperature (in Celsius)
-	try:
-		temperature[pos]=-( (Tb[pos]-Ts[pos])*ki/wi[pos] + Hi[pos]*Tb[pos] - (Hi[pos]*Ts[pos] + (Tb[pos]-Ts[pos])*ki/wi[pos])*np.exp(Hi[pos]*wi[pos]/ki) )/( Hi[pos]*(np.exp(Hi[pos]*wi[pos]/ki)-1))
-	except FloatingPointError:
-		print 'steadystateiceshelf warning: overflow encountered in multipy/divide/exp, trying another formulation.' 
-		temperature[pos]=-( ((Tb[pos]-Ts[pos])*ki/wi[pos] + Hi[pos]*Tb[pos])/np.exp(Hi[pos]*wi[pos]/ki) - Hi[pos]*Ts[pos] + (Tb[pos]-Ts[pos])*ki/wi[pos])/( Hi[pos]*(1-np.exp(-Hi[pos]*wi[pos]/ki)))
-	
-	#temperature should not be less than surface temp
-	pos=np.nonzero(temperature<Ts)
-	temperature[pos]=Ts[pos]
-	
-	# NaN where melt rates are too high (infinity/infinity in exponential)
-	pos=np.nonzero(np.isnan(temperature))
-	temperature[pos]=Ts[pos]
-	
-	#convert to Kelvin
-	temperature=temperature+273.15
+    #surface and basal temperatures in degrees C
+    if len(surfacetemp) != md.mesh.numberofvertices:
+        raise ValueError('steadystateiceshelftemp error message: surfacetemp should have a length of ' + md.mesh.numberofvertices)
 
-	return temperature
+    if len(basaltemp) != md.mesh.numberofvertices:
+        raise ValueError('steadystateiceshelftemp error message: basaltemp should have a length of ' + md.mesh.numberofvertices)
+
+    # Convert temps to Celsius for Holland and Jenkins (1999) equation
+    Ts = -273.15 + surfacetemp
+    Tb = -273.15 + basaltemp
+
+    Hi = md.geometry.thickness
+    ki = 1.14e-6 * md.constants.yts  # ice shelf thermal diffusivity from Holland and Jenkins (1999) converted to m^2 / yr
+
+    #vertical velocity of ice shelf, calculated from melting rate
+    wi = md.materials.rho_water / md.materials.rho_ice * md.basalforcings.floatingice_melting_rate
+
+    #temperature profile is linear if melting rate is zero, depth - averaged temp is simple average in this case
+    temperature = (Ts + Tb) / 2  # where wi~=0
+
+    pos = np.nonzero(abs(wi) >= 1e-4)  # to avoid division by zero
+
+    np.seterr(over='raise', divide='raise')  # raise errors if floating point exceptions are encountered in following calculation
+    #calculate depth - averaged temperature (in Celsius)
+    try:
+        temperature[pos] = -((Tb[pos] - Ts[pos]) * ki / wi[pos] + Hi[pos] * Tb[pos] - (Hi[pos] * Ts[pos] + (Tb[pos] - Ts[pos]) * ki / wi[pos]) * np.exp(Hi[pos] * wi[pos] / ki)) / (Hi[pos] * (np.exp(Hi[pos] * wi[pos] / ki) - 1))
+    except FloatingPointError:
+        print('steadystateiceshelf warning: overflow encountered in multipy / divide / exp, trying another formulation.')
+        temperature[pos] = -(((Tb[pos] - Ts[pos]) * ki / wi[pos] + Hi[pos] * Tb[pos]) / np.exp(Hi[pos] * wi[pos] / ki) - Hi[pos] * Ts[pos] + (Tb[pos] - Ts[pos]) * ki / wi[pos]) / (Hi[pos] * (1 - np.exp(-Hi[pos] * wi[pos] / ki)))
+
+    #temperature should not be less than surface temp
+    pos = np.nonzero(temperature < Ts)
+    temperature[pos] = Ts[pos]
+
+    # NaN where melt rates are too high (infinity / infinity in exponential)
+    pos = np.nonzero(np.isnan(temperature))
+    temperature[pos] = Ts[pos]
+
+    #convert to Kelvin
+    temperature = temperature + 273.15
+
+    return temperature
Index: /issm/trunk/src/m/mech/thomasparams.py
===================================================================
--- /issm/trunk/src/m/mech/thomasparams.py	(revision 24312)
+++ /issm/trunk/src/m/mech/thomasparams.py	(revision 24313)
@@ -1,145 +1,149 @@
-import numpy as  np
+import numpy as np
 from averaging import averaging
 
-def thomasparams(md,**kwargs):
-	'''
-	compute Thomas' geometric parameters for an ice shelf 
 
-	This routine computes geometric parameters representing ratios between
-	components of the horizontal strain rate tensor for an ice shelf, as
-	originally developed in Thomas (1973).  The model must contain computed
-	strain rates, either from observed or modeled ice velocities.
+def thomasparams(md, **kwargs):
+    '''
+    compute Thomas' geometric parameters for an ice shelf
+
+    This routine computes geometric parameters representing ratios between
+    components of the horizontal strain rate tensor for an ice shelf, as
+    originally developed in Thomas (1973).  The model must contain computed
+    strain rates, either from observed or modeled ice velocities.
 
    Available options:
-	 -eq			: analytical equation to use in the calculation.  Must be one of:
-				'Thomas' for a 2D ice shelf, taking into account full strain rate
-					tensor (default)
-				'Weertman1D' for a confined ice shelf free to flow in one direction
-				'Weertman2D' for an unconfined ice shelf free to spread in any direction
+     - eq            : analytical equation to use in the calculation.  Must be one of:
+                'Thomas' for a 2D ice shelf, taking into account full strain rate
+                    tensor (default)
+                'Weertman1D' for a confined ice shelf free to flow in one direction
+                'Weertman2D' for an unconfined ice shelf free to spread in any direction
 
-	 -smoothing	: an integer smoothing parameter for the averaging function
-						(default 0) Type 'help averaging' for more information on its usage.
+     - smoothing    : an integer smoothing parameter for the averaging function
+                        (default 0) Type 'help averaging' for more information on its usage.
 
-	 -coordsys	: coordinate system for calculating the strain rate
-						components. Must be one of:
-				'longitudinal': x axis aligned along a flowline at every point (default)
-				'principal': x axis aligned along maximum principal strain rate
-					at every point
-				'xy': x and y axes same as in polar stereographic projection 
+     - coordsys    : coordinate system for calculating the strain rate
+                        components. Must be one of:
+                'longitudinal': x axis aligned along a flowline at every point (default)
+                'principal': x axis aligned along maximum principal strain rate
+                    at every point
+                'xy': x and y axes same as in polar stereographic projection
 
-   Return values: 
+   Return values:
 
-		'alpha' which is the ratio e_yy/e_xx between components of the strain
-		rate tensor
+        'alpha' which is the ratio e_yy / e_xx between components of the strain
+        rate tensor
 
-		'beta' which is the ratio e_xy/e_xx between components of the strain rate
-		tensor
+        'beta' which is the ratio e_xy / e_xx between components of the strain rate
+        tensor
 
-		'theta' which is a combination of alpha and beta arising from the form of
-		the equivalent stress
+        'theta' which is a combination of alpha and beta arising from the form of
+        the equivalent stress
 
-		'exx' is the strain rate along a coordinate system defined by 'coordsys' 
+        'exx' is the strain rate along a coordinate system defined by 'coordsys'
 
-		'sigxx' is the deviatoric stress along a coordinate system defined by 'coordsys' 
+        'sigxx' is the deviatoric stress along a coordinate system defined by 'coordsys'
 
-   Usage: 
-		alpha,beta,theta,exx,sigxx=thomasparams(md)
+   Usage:
+        alpha, beta, theta, exx, sigxx = thomasparams(md)
 
-   Example: 
-		alpha,beta,theta,exx,sigxx=thomasparams(md,eq='Thomas',smoothing=2,coordsys='longitudinal')
-	'''
+   Example:
+        alpha, beta, theta, exx, sigxx = thomasparams(md, eq = 'Thomas', smoothing = 2, coordsys = 'longitudinal')
+    '''
 
-	#unpack kwargs
-	eq=kwargs.pop('eq','Thomas')
-	if 'eq' in kwargs: del kwargs['eq']
-	smoothing=kwargs.pop('smoothing',0)
-	if 'smoothing' in kwargs: del kwargs['smoothing']
-	coordsys=kwargs.pop('coordsys','longitudinal')
-	if 'coordsys' in kwargs: del kwargs['coordsys']
-	assert len(kwargs)==0, 'error, unexpected or misspelled kwargs'
+    #unpack kwargs
+    eq = kwargs.pop('eq', 'Thomas')
+    if 'eq' in kwargs:
+        del kwargs['eq']
+    smoothing = kwargs.pop('smoothing', 0)
+    if 'smoothing' in kwargs:
+        del kwargs['smoothing']
+    coordsys = kwargs.pop('coordsys', 'longitudinal')
+    if 'coordsys' in kwargs:
+        del kwargs['coordsys']
+    assert len(kwargs) == 0, 'error, unexpected or misspelled kwargs'
 
-	# some checks
-	if not hasattr(md.results,'strainrate'):
-		raise StandardError('md.results.strainrate not present.  Calculate using md=mechanicalproperties(md,vx,vy)')
-	if not '2d' in md.mesh.__doc__:
-		raise StandardError('only 2d (planview) model supported currently')
-	if any(md.flowequation.element_equation!=2):
-		raise StandardError('Warning: the model has some non-SSA elements.  These will be treated like SSA elements')
+    # some checks
+    if not hasattr(md.results, 'strainrate'):
+        raise Exception('md.results.strainrate not present.  Calculate using md = mechanicalproperties(md, vx, vy)')
+    if '2d' not in md.mesh.__doc__:
+        raise Exception('only 2d (planview) model supported currently')
+    if any(md.flowequation.element_equation != 2):
+        raise Exception('Warning: the model has some non - SSA elements.  These will be treated like SSA elements')
 
-	# average element strain rates onto vertices
-	e1=averaging(md,md.results.strainrate.principalvalue1,smoothing)/md.constants.yts # convert to s^-1
-	e2=averaging(md,md.results.strainrate.principalvalue2,smoothing)/md.constants.yts
-	exx=averaging(md,md.results.strainrate.xx,smoothing)/md.constants.yts
-	eyy=averaging(md,md.results.strainrate.yy,smoothing)/md.constants.yts
-	exy=averaging(md,md.results.strainrate.xy,smoothing)/md.constants.yts
-	
-	# checks: any of e1 or e2 equal to zero?
-	pos=np.nonzero(e1==0)
-	if np.any(pos==1):
-		print 'WARNING: first principal strain rate equal to zero.  Value set to 1e-13 s^-1'
-		e1[pos]=1.e-13
-	pos=np.nonzero(e2==0)
-	if np.any(pos==1):
-		print 'WARNING: second principal strain rate equal to zero.  Value set to 1e-13 s^-1'
-		e2[pos]=1.e-13
-	
-	# rheology
-	n=averaging(md,md.materials.rheology_n,0)
-	B=md.materials.rheology_B
-	
-	if coordsys=='principal':
-		b=np.zeros((md.mesh.numberofvertices,))
-		ex=e1
-		a=e2/e1
-		pos=np.nonzero(np.logical_and(e1<0,e2>0)) # longitudinal compression and lateral tension
-		a[pos]=e1[pos]/e2[pos]
-		ex[pos]=e2[pos]
-		pos2=np.nonzero(e1<0 & e2<0 & np.abs(e1)<np.abs(e2)) # lateral and longitudinal compression
-		a[pos2]=e1[pos2]/e2[pos2]
-		ex[pos2]=e2[pos2]
-		pos3=np.nonzero(e1>0 & e2>0 & np.abs(e1)<np.abs(e2)) # lateral and longitudinal tension
-		a[pos3]=e1[pos3]/e2[pos3]
-		ex[pos3]=e2[pos3]
-		ind=np.nonzero(e1<0 & e2<0)
-		a[ind]=-a[ind] # where both strain rates are compressive, enforce negative alpha
-		sigxx=(np.abs(ex)/((1.+a+a**2)**((n-1.)/2.)))**(1./n)*B
-	elif coordsys=='xy':
-		ex=exx
-		a=eyy/exx
-		b=exy/exx
-	elif coordsys=='longitudinal':
-		# using longitudinal strain rates defined by observed velocity vector
-		velangle=np.arctan(md.initialization.vy/md.initialization.vx)
-		pos=np.nonzero(md.initialization.vx==0)
-		velangle[pos]=np.pi/2
-		ex=0.5*(exx+eyy)+0.5*(exx-eyy)*np.cos(2.*velangle)+exy*np.sin(2.*velangle)
-		ey=exx+eyy-ex # trace of strain rate tensor is invariant
-		exy=-0.5*(exx-eyy)*np.sin(2.*velangle)+exy*np.cos(2.*velangle)
-		a=ey/ex
-		b=exy/ex
-		sigxx=abs(ex)**(1./n-1.)*ex/((1.+a+a**2+b**2)**((n-1.)/(2.*n)))*B
-	else:
-		raise ValueError('argument passed to "coordsys" not valid')
-	
-	# a < -1 in areas of strong lateral compression or longitudinal compression and
-	# theta flips sign at a = -2
-	pos=np.nonzero(np.abs((np.abs(a)-2.))<1.e-3)
-	if len(pos)>0:
-		print 'Warning: ', len(pos), ' vertices have alpha within 1e-3 of -2'
-	a[pos]=-2+1e-3
+    # average element strain rates onto vertices
+    e1 = averaging(md, md.results.strainrate.principalvalue1, smoothing) / md.constants.yts  # convert to s^-1
+    e2 = averaging(md, md.results.strainrate.principalvalue2, smoothing) / md.constants.yts
+    exx = averaging(md, md.results.strainrate.xx, smoothing) / md.constants.yts
+    eyy = averaging(md, md.results.strainrate.yy, smoothing) / md.constants.yts
+    exy = averaging(md, md.results.strainrate.xy, smoothing) / md.constants.yts
 
-	if eq=='Weertman1D':
-		theta=1./8
-		a=np.zeros((md.mesh.numberofvertices,))
-	elif eq=='Weertman2D':
-		theta=1./9
-		a=np.ones((md.mesh.numberofvertices,))
-	elif eq=='Thomas':
-		theta=((1.+a+a**2+b**2)**((n-1.)/2.))/(np.abs(2.+a)**n)
-	else:
-		raise ValueError('argument passed to "eq" not valid')
+    # checks: any of e1 or e2 equal to zero?
+    pos = np.nonzero(e1 == 0)
+    if np.any(pos == 1):
+        print('WARNING: first principal strain rate equal to zero.  Value set to 1e-13 s^-1')
+        e1[pos] = 1.e-13
+    pos = np.nonzero(e2 == 0)
+    if np.any(pos == 1):
+        print('WARNING: second principal strain rate equal to zero.  Value set to 1e-13 s^-1')
+        e2[pos] = 1.e-13
 
-	alpha=a
-	beta=b
+    # rheology
+    n = averaging(md, md.materials.rheology_n, 0)
+    B = md.materials.rheology_B
 
-	return alpha,beta,theta,ex
+    if coordsys == 'principal':
+        b = np.zeros((md.mesh.numberofvertices, ))
+        ex = e1
+        a = e2 / e1
+        pos = np.nonzero(np.logical_and(e1 < 0, e2 > 0))  # longitudinal compression and lateral tension
+        a[pos] = e1[pos] / e2[pos]
+        ex[pos] = e2[pos]
+        pos2 = np.nonzero(e1 < 0 & e2 < 0 & np.abs(e1) < np.abs(e2))  # lateral and longitudinal compression
+        a[pos2] = e1[pos2] / e2[pos2]
+        ex[pos2] = e2[pos2]
+        pos3 = np.nonzero(e1 > 0 & e2 > 0 & np.abs(e1) < np.abs(e2))  # lateral and longitudinal tension
+        a[pos3] = e1[pos3] / e2[pos3]
+        ex[pos3] = e2[pos3]
+        ind = np.nonzero(e1 < 0 & e2 < 0)
+        a[ind] = -a[ind]  # where both strain rates are compressive, enforce negative alpha
+        sigxx = (np.abs(ex) / ((1. + a + a**2)**((n - 1.) / 2.)))**(1. / n) * B
+    elif coordsys == 'xy':
+        ex = exx
+        a = eyy / exx
+        b = exy / exx
+    elif coordsys == 'longitudinal':
+        # using longitudinal strain rates defined by observed velocity vector
+        velangle = np.arctan(md.initialization.vy / md.initialization.vx)
+        pos = np.nonzero(md.initialization.vx == 0)
+        velangle[pos] = np.pi / 2
+        ex = 0.5 * (exx + eyy) + 0.5 * (exx - eyy) * np.cos(2. * velangle) + exy * np.sin(2. * velangle)
+        ey = exx + eyy - ex  # trace of strain rate tensor is invariant
+        exy = -0.5 * (exx - eyy) * np.sin(2. * velangle) + exy * np.cos(2. * velangle)
+        a = ey / ex
+        b = exy / ex
+        sigxx = abs(ex)**(1. / n - 1.) * ex / ((1. + a + a**2 + b**2)**((n - 1.) / (2. * n))) * B
+    else:
+        raise ValueError('argument passed to "coordsys" not valid')
+
+    # a < -1 in areas of strong lateral compression or longitudinal compression and
+    # theta flips sign at a = -2
+    pos = np.nonzero(np.abs((np.abs(a) - 2.)) < 1.e-3)
+    if len(pos) > 0:
+        print(('Warning: ', len(pos), ' vertices have alpha within 1e-3 of -2'))
+    a[pos] = -2 + 1e-3
+
+    if eq == 'Weertman1D':
+        theta = 1. / 8
+        a = np.zeros((md.mesh.numberofvertices, ))
+    elif eq == 'Weertman2D':
+        theta = 1. / 9
+        a = np.ones((md.mesh.numberofvertices, ))
+    elif eq == 'Thomas':
+        theta = ((1. + a + a**2 + b**2)**((n - 1.) / 2.)) / (np.abs(2. + a)**n)
+    else:
+        raise ValueError('argument passed to "eq" not valid')
+
+    alpha = a
+    beta = b
+
+    return alpha, beta, theta, ex
Index: /issm/trunk/src/m/mesh/ComputeHessian.py
===================================================================
--- /issm/trunk/src/m/mesh/ComputeHessian.py	(revision 24312)
+++ /issm/trunk/src/m/mesh/ComputeHessian.py	(revision 24313)
@@ -4,62 +4,63 @@
 import MatlabFuncs as m
 
-def ComputeHessian(index,x,y,field,type):
-	"""
-	COMPUTEHESSIAN - compute hessian matrix from a field
 
-	   Compute the hessian matrix of a given field
-	   return the three components Hxx Hxy Hyy
-	   for each element or each node
+def ComputeHessian(index, x, y, field, type):
+    """
+    COMPUTEHESSIAN - compute hessian matrix from a field
 
-	   Usage:
-	      hessian=ComputeHessian(index,x,y,field,type)
+       Compute the hessian matrix of a given field
+       return the three components Hxx Hxy Hyy
+       for each element or each node
 
-	   Example:
-	      hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,md.inversion.vel_obs,'node')
-	"""
+       Usage:
+          hessian = ComputeHessian(index, x, y, field, type)
 
-	#some variables
-	numberofnodes=np.size(x)
-	numberofelements=np.size(index,axis=0)
+       Example:
+          hessian = ComputeHessian(md.mesh.elements, md.mesh.x, md.mesh.y, md.inversion.vel_obs, 'node')
+    """
 
-	#some checks
-	if np.size(field)!=numberofnodes and np.size(field)!=numberofelements:
-		raise TypeError("ComputeHessian error message: the given field size not supported yet")
-	if not m.strcmpi(type,'node') and not m.strcmpi(type,'element'):
-		raise TypeError("ComputeHessian error message: only 'node' or 'element' type supported yet")
+    #some variables
+    numberofnodes = np.size(x)
+    numberofelements = np.size(index, axis=0)
 
-	#initialization
-	line=index.reshape(-1,order='F')
-	linesize=3*numberofelements
+    #some checks
+    if np.size(field) != numberofnodes and np.size(field) != numberofelements:
+        raise TypeError("ComputeHessian error message: the given field size not supported yet")
+    if not m.strcmpi(type, 'node') and not m.strcmpi(type, 'element'):
+        raise TypeError("ComputeHessian error message: only 'node' or 'element' type supported yet")
 
-	#get areas and nodal functions coefficients N(x,y)=alpha x + beta y + gamma
-	[alpha,beta,dum]=GetNodalFunctionsCoeff(index,x,y)
-	areas=GetAreas(index,x,y)
+    #initialization
+    line = index.reshape(-1, order='F')
+    linesize = 3 * numberofelements
 
-	#compute weights that hold the volume of all the element holding the node i
-	weights=m.sparse(line,np.ones((linesize,1),dtype=int),np.tile(areas,(3,1)),numberofnodes,1)
+    #get areas and nodal functions coefficients N(x, y)=alpha x + beta y + gamma
+    [alpha, beta, dum] = GetNodalFunctionsCoeff(index, x, y)
+    areas = GetAreas(index, x, y)
 
-	#compute field on nodes if on elements
-	if np.size(field,axis=0)==numberofelements:
-		field=m.sparse(line,np.ones((linesize,1),dtype=int),np.tile(areas*field,(3,1)),numberofnodes,1)/weights
+    #compute weights that hold the volume of all the element holding the node i
+    weights = m.sparse(line, np.ones((linesize, 1), dtype=int), np.tile(areas, (3, 1)), numberofnodes, 1)
 
-	#Compute gradient for each element
-	grad_elx=np.sum(field[index-1]*alpha,axis=1)
-	grad_ely=np.sum(field[index-1]*beta,axis=1)
+    #compute field on nodes if on elements
+    if np.size(field, axis=0) == numberofelements:
+        field = m.sparse(line, np.ones((linesize, 1), dtype=int), np.tile(areas * field, (3, 1)), numberofnodes, 1) / weights
 
-	#Compute gradient for each node (average of the elements around)
-	gradx=m.sparse(line,np.ones((linesize,1),dtype=int),np.tile((areas*grad_elx),(3,1)),numberofnodes,1)
-	grady=m.sparse(line,np.ones((linesize,1),dtype=int),np.tile((areas*grad_ely),(3,1)),numberofnodes,1)
-	gradx=gradx/weights
-	grady=grady/weights
+    #Compute gradient for each element
+    grad_elx = np.sum(field[index - 1] * alpha, axis=1)
+    grad_ely = np.sum(field[index - 1] * beta, axis=1)
 
-	#Compute hessian for each element
-	hessian=np.vstack((np.sum(gradx[index-1,0]*alpha,axis=1),np.sum(grady[index-1,0]*alpha,axis=1),np.sum(grady[index-1,0]*beta,axis=1))).T
+    #Compute gradient for each node (average of the elements around)
+    gradx = m.sparse(line, np.ones((linesize, 1), dtype=int), np.tile((areas * grad_elx), (3, 1)), numberofnodes, 1)
+    grady = m.sparse(line, np.ones((linesize, 1), dtype=int), np.tile((areas * grad_ely), (3, 1)), numberofnodes, 1)
+    gradx = gradx / weights
+    grady = grady / weights
 
-	if m.strcmpi(type,'node'):
-		#Compute Hessian on the nodes (average of the elements around)
-		hessian=np.hstack((m.sparse(line,np.ones((linesize,1),dtype=int),np.tile((areas*hessian[:,0]),(3,1)),numberofnodes,1)/weights,
-											 m.sparse(line,np.ones((linesize,1),dtype=int),np.tile((areas*hessian[:,1]),(3,1)),numberofnodes,1)/weights,
-											 m.sparse(line,np.ones((linesize,1),dtype=int),np.tile((areas*hessian[:,2]),(3,1)),numberofnodes,1)/weights ))
+    #Compute hessian for each element
+    hessian = np.vstack((np.sum(gradx[index - 1, 0] * alpha, axis=1), np.sum(grady[index - 1, 0] * alpha, axis=1), np.sum(grady[index - 1, 0] * beta, axis=1))).T
 
-	return hessian
+    if m.strcmpi(type, 'node'):
+        #Compute Hessian on the nodes (average of the elements around)
+        hessian = np.hstack((m.sparse(line, np.ones((linesize, 1), dtype=int), np.tile((areas * hessian[:, 0]), (3, 1)), numberofnodes, 1) / weights,
+                             m.sparse(line, np.ones((linesize, 1), dtype=int), np.tile((areas * hessian[:, 1]), (3, 1)), numberofnodes, 1) / weights,
+                             m.sparse(line, np.ones((linesize, 1), dtype=int), np.tile((areas * hessian[:, 2]), (3, 1)), numberofnodes, 1) / weights))
+
+    return hessian
Index: /issm/trunk/src/m/mesh/ComputeMetric.py
===================================================================
--- /issm/trunk/src/m/mesh/ComputeMetric.py	(revision 24312)
+++ /issm/trunk/src/m/mesh/ComputeMetric.py	(revision 24313)
@@ -1,74 +1,75 @@
 import numpy as np
 
-def ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos):
-	"""
-	COMPUTEMETRIC - compute metric from an Hessian
 
-	   Usage:
-	      metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos)
-	      pos is contains the positions where the metric is wished to be maximized (water?)
+def ComputeMetric(hessian, scale, epsilon, hmin, hmax, pos):
+    """
+    COMPUTEMETRIC - compute metric from an Hessian
 
-	   Example:
-	      metric=ComputeMetric(hessian,2/9,10^-1,100,10^5,[])
-	"""
+       Usage:
+          metric = ComputeMetric(hessian, scale, epsilon, hmin, hmax, pos)
+          pos is contains the positions where the metric is wished to be maximized (water?)
 
-	#first, find the eigen values of each line of H=[hessian(i,1) hessian(i,2); hessian(i,2) hessian(i,3)]
-	a=hessian[:,0]
-	b=hessian[:,1]
-	d=hessian[:,2]
-	lambda1=0.5*((a+d)+np.sqrt(4.*b**2+(a-d)**2))
-	lambda2=0.5*((a+d)-np.sqrt(4.*b**2+(a-d)**2))
-	pos1=np.nonzero(lambda1==0.)[0]
-	pos2=np.nonzero(lambda2==0.)[0]
-	pos3=np.nonzero(np.logical_and(b==0.,lambda1==lambda2))[0]
+       Example:
+          metric = ComputeMetric(hessian, 2 / 9, 1.0e-1, 100, 1.0e5, [])
+    """
 
-	#Modify the eigen values to control the shape of the elements
-	lambda1=np.minimum(np.maximum(np.abs(lambda1)*scale/epsilon,1./hmax**2),1./hmin**2)
-	lambda2=np.minimum(np.maximum(np.abs(lambda2)*scale/epsilon,1./hmax**2),1./hmin**2)
+    #first, find the eigen values of each line of H = [hessian(i, 1) hessian(i, 2); hessian(i, 2) hessian(i, 3)]
+    a = hessian[:, 0]
+    b = hessian[:, 1]
+    d = hessian[:, 2]
+    lambda1 = 0.5 * ((a + d) + np.sqrt(4. * b**2 + (a - d)**2))
+    lambda2 = 0.5 * ((a + d) - np.sqrt(4. * b**2 + (a - d)**2))
+    pos1 = np.nonzero(lambda1 == 0.)[0]
+    pos2 = np.nonzero(lambda2 == 0.)[0]
+    pos3 = np.nonzero(np.logical_and(b == 0., lambda1 == lambda2))[0]
 
-	#compute eigen vectors
-	norm1=np.sqrt(8.*b**2+2.*(d-a)**2+2.*(d-a)*np.sqrt((a-d)**2+4.*b**2))
-	v1x=2.*b/norm1
-	v1y=((d-a)+np.sqrt((a-d)**2+4.*b**2))/norm1
-	norm2=np.sqrt(8.*b**2+2.*(d-a)**2-2.*(d-a)*np.sqrt((a-d)**2+4.*b**2))
-	v2x=2.*b/norm2
-	v2y=((d-a)-np.sqrt((a-d)**2+4.*b**2))/norm2
+    #Modify the eigen values to control the shape of the elements
+    lambda1 = np.minimum(np.maximum(np.abs(lambda1) * scale / epsilon, 1. / hmax**2), 1. / hmin**2)
+    lambda2 = np.minimum(np.maximum(np.abs(lambda2) * scale / epsilon, 1. / hmax**2), 1. / hmin**2)
 
-	v1x[pos3]=1.
-	v1y[pos3]=0.
-	v2x[pos3]=0.
-	v2y[pos3]=1.
+    #compute eigen vectors
+    norm1 = np.sqrt(8. * b**2 + 2. * (d - a)**2 + 2. * (d - a) * np.sqrt((a - d)**2 + 4. * b**2))
+    v1x = 2. * b / norm1
+    v1y = ((d - a) + np.sqrt((a - d)**2 + 4. * b**2)) / norm1
+    norm2 = np.sqrt(8. * b**2 + 2. * (d - a)**2 - 2. * (d - a) * np.sqrt((a - d)**2 + 4. * b**2))
+    v2x = 2. * b / norm2
+    v2y = ((d - a) - np.sqrt((a - d)**2 + 4. * b**2)) / norm2
 
-	#Compute new metric (for each node M=V*Lambda*V^-1)
-	metric=np.vstack((((v1x*v2y-v1y*v2x)**(-1)*( lambda1*v2y*v1x-lambda2*v1y*v2x)).reshape(-1,),
-										((v1x*v2y-v1y*v2x)**(-1)*( lambda1*v1y*v2y-lambda2*v1y*v2y)).reshape(-1,),
-										((v1x*v2y-v1y*v2x)**(-1)*(-lambda1*v2x*v1y+lambda2*v1x*v2y)).reshape(-1,))).T
+    v1x[pos3] = 1.
+    v1y[pos3] = 0.
+    v2x[pos3] = 0.
+    v2y[pos3] = 1.
 
-	#some corrections for 0 eigen values
-	metric[pos1,:]=np.tile(np.array([[1./hmax**2,0.,1./hmax**2]]),(np.size(pos1),1))
-	metric[pos2,:]=np.tile(np.array([[1./hmax**2,0.,1./hmax**2]]),(np.size(pos2),1))
+    #Compute new metric (for each node M = V * Lambda * V^-1)
 
-	#take care of water elements
-	metric[pos ,:]=np.tile(np.array([[1./hmax**2,0.,1./hmax**2]]),(np.size(pos ),1))
+    metric = np.vstack((((v1x * v2y - v1y * v2x)**(-1) * (lambda1 * v2y * v1x - lambda2 * v1y * v2x)).reshape(-1, ),
+                        ((v1x * v2y - v1y * v2x)**(-1) * (lambda1 * v1y * v2y - lambda2 * v1y * v2y)).reshape(-1, ),
+                        ((v1x * v2y - v1y * v2x)**(-1) * (-lambda1 * v2x * v1y + lambda2 * v1x * v2y)).reshape(-1, ))).T
 
-	#take care of NaNs if any (use Numpy eig in a loop)
-	pos=np.nonzero(np.isnan(metric))[0]
-	if np.size(pos):
-		print(" %i NaN found in the metric. Use Numpy routine..." % np.size(pos))
-		for posi in pos:
-			H=np.array([[hessian[posi,0],hessian[posi,1]],[hessian[posi,1],hessian[posi,2]]])
-			[v,u]=np.linalg.eig(H)
-			v=np.diag(v)
-			lambda1=v[0,0]
-			lambda2=v[1,1]
-			v[0,0]=np.minimum(np.maximum(np.abs(lambda1)*scale/epsilon,1./hmax**2),1./hmin**2)
-			v[1,1]=np.minimum(np.maximum(np.abs(lambda2)*scale/epsilon,1./hmax**2),1./hmin**2)
+    #some corrections for 0 eigen values
+    metric[pos1, :] = np.tile(np.array([[1. / hmax**2, 0., 1. / hmax**2]]), (np.size(pos1), 1))
+    metric[pos2, :] = np.tile(np.array([[1. / hmax**2, 0., 1. / hmax**2]]), (np.size(pos2), 1))
 
-			metricTria=np.dot(np.dot(u,v),np.linalg.inv(u))
-			metric[posi,:]=np.array([metricTria[0,0],metricTria[0,1],metricTria[1,1]])
+    #take care of water elements
+    metric[pos, :] = np.tile(np.array([[1. / hmax**2, 0., 1. / hmax**2]]), (np.size(pos), 1))
 
-	if np.any(np.isnan(metric)):
-		raise RunTimeError("ComputeMetric error message: NaN in the metric despite our efforts...")
+    #take care of NaNs if any (use Numpy eig in a loop)
+    pos = np.nonzero(np.isnan(metric))[0]
+    if np.size(pos):
+        print((" %i NaN found in the metric. Use Numpy routine..." % np.size(pos)))
+        for posi in pos:
+            H = np.array([[hessian[posi, 0], hessian[posi, 1]], [hessian[posi, 1], hessian[posi, 2]]])
+            [v, u] = np.linalg.eig(H)
+            v = np.diag(v)
+            lambda1 = v[0, 0]
+            lambda2 = v[1, 1]
+            v[0, 0] = np.minimum(np.maximum(np.abs(lambda1) * scale / epsilon, 1. / hmax**2), 1. / hmin**2)
+            v[1, 1] = np.minimum(np.maximum(np.abs(lambda2) * scale / epsilon, 1. / hmax**2), 1. / hmin**2)
 
-	return metric
+            metricTria = np.dot(np.dot(u, v), np.linalg.inv(u))
+            metric[posi, :] = np.array([metricTria[0, 0], metricTria[0, 1], metricTria[1, 1]])
 
+    if np.any(np.isnan(metric)):
+        raise RunTimeError("ComputeMetric error message: NaN in the metric despite our efforts...")
+
+    return metric
Index: /issm/trunk/src/m/mesh/ElementsFromEdge.py
===================================================================
--- /issm/trunk/src/m/mesh/ElementsFromEdge.py	(revision 24312)
+++ /issm/trunk/src/m/mesh/ElementsFromEdge.py	(revision 24313)
@@ -2,23 +2,22 @@
 import PythonFuncs as p
 
-def ElementsFromEdge(elements,A,B):
-	"""
-	ELEMENTSFROMEDGE: find elements connected to one edge defined by nodes A and B
 
-	   Usage: edgeelements=ElementsFromEdge(elements,A,B) 
+def ElementsFromEdge(elements, A, B):
+    """
+    ELEMENTSFROMEDGE: find elements connected to one edge defined by nodes A and B
 
-	   Eg:    edgeelements=ElementsFromEdge(md.mesh.elements,tip1,tip2)
+       Usage: edgeelements = ElementsFromEdge(elements, A, B)
 
-	"""
+       Eg:    edgeelements = ElementsFromEdge(md.mesh.elements, tip1, tip2)
 
-	edgeelements=np.nonzero(\
-		p.logical_or_n(np.logical_and(elements[:,0]==A,elements[:,1]==B), \
-					 np.logical_and(elements[:,0]==A,elements[:,2]==B), \
-					 np.logical_and(elements[:,1]==A,elements[:,2]==B), \
-					 np.logical_and(elements[:,1]==A,elements[:,0]==B), \
-					 np.logical_and(elements[:,2]==A,elements[:,0]==B), \
-					 np.logical_and(elements[:,2]==A,elements[:,1]==B), \
-		))[0]+1
+    """
 
-	return edgeelements
+    edgeelements = np.nonzero(
+        p.logical_or_n(np.logical_and(elements[:, 0] == A, elements[:, 1] == B),
+                       np.logical_and(elements[:, 0] == A, elements[:, 2] == B),
+                       np.logical_and(elements[:, 1] == A, elements[:, 2] == B),
+                       np.logical_and(elements[:, 1] == A, elements[:, 0] == B),
+                       np.logical_and(elements[:, 2] == A, elements[:, 0] == B),
+                       np.logical_and(elements[:, 2] == A, elements[:, 1] == B)))[0] + 1
 
+    return edgeelements
Index: /issm/trunk/src/m/mesh/GetNodalFunctionsCoeff.py
===================================================================
--- /issm/trunk/src/m/mesh/GetNodalFunctionsCoeff.py	(revision 24312)
+++ /issm/trunk/src/m/mesh/GetNodalFunctionsCoeff.py	(revision 24313)
@@ -1,58 +1,58 @@
 import numpy as np
 
-def GetNodalFunctionsCoeff(index,x,y):
-	"""
-	GETNODELFUNCTIONSCOEFF - compute nodal functions coefficients
 
-	   Compute the coefficients alpha beta and optionaly gamma of
-	   2d triangular elements. For each element, the nodal function
-	   is defined as:
-	   N(x,y)=sum(i=1:3) alpha_i * x + beta_i * y + gamma_i
+def GetNodalFunctionsCoeff(index, x, y):
+    """
+    GETNODELFUNCTIONSCOEFF - compute nodal functions coefficients
 
-	   Usage:
-	      [alpha beta]=GetNodalFunctionsCoeff(index,x,y);
-	      [alpha beta gamma]=GetNodalFunctionsCoeff(index,x,y);
+       Compute the coefficients alpha beta and optionaly gamma of
+       2d triangular elements. For each element, the nodal function
+       is defined as:
+       N(x, y)=sum(i = 1:3) alpha_i * x + beta_i * y + gamma_i
 
-	   Example:
-	      [alpha beta gamma]=GetNodalFunctionsCoeff(md.mesh.elements,md.mesh.x,md.mesh.y);
-	"""
+       Usage:
+          [alpha beta] = GetNodalFunctionsCoeff(index, x, y)
+          [alpha beta gamma] = GetNodalFunctionsCoeff(index, x, y)
 
-	#make columns out of x and y
-	x=x.reshape(-1)
-	y=y.reshape(-1)
+       Example:
+          [alpha beta gamma] = GetNodalFunctionsCoeff(md.mesh.elements, md.mesh.x, md.mesh.y)
+    """
 
-	#get nels and nods
-	nels=np.size(index,axis=0)
-	nods=np.size(x)
+    #make columns out of x and y
+    x = x.reshape(-1)
+    y = y.reshape(-1)
 
-	#some checks
-	if np.size(y)!=nods:
-		raise TypeError("GetNodalFunctionsCoeff error message: x and y do not have the same length.")
-	if np.max(index)>nods:
-		raise TypeError("GetNodalFunctionsCoeff error message: index should not have values above %d." % nods)
-	if np.size(index,axis=1)!=3:
-		raise TypeError("GetNodalFunctionsCoeff error message: only 2d meshes supported. index should have 3 columns.")
+    #get nels and nods
+    nels = np.size(index, axis=0)
+    nods = np.size(x)
 
-	#initialize output
-	alpha=np.zeros((nels,3))
-	beta=np.zeros((nels,3))
+    #some checks
+    if np.size(y) != nods:
+        raise TypeError("GetNodalFunctionsCoeff error message: x and y do not have the same length.")
+    if np.max(index) > nods:
+        raise TypeError("GetNodalFunctionsCoeff error message: index should not have values above {}.".format(nods))
+    if np.size(index, axis=1) != 3:
+        raise TypeError("GetNodalFunctionsCoeff error message: only 2d meshes supported. index should have 3 columns.")
 
-	#compute nodal functions coefficients N(x,y)=alpha x + beta y +gamma
-	x1=x[index[:,0]-1]
-	x2=x[index[:,1]-1]
-	x3=x[index[:,2]-1]
-	y1=y[index[:,0]-1]
-	y2=y[index[:,1]-1]
-	y3=y[index[:,2]-1]
-	invdet=1./(x1*(y2-y3)-x2*(y1-y3)+x3*(y1-y2))
+    #initialize output
+    alpha = np.zeros((nels, 3))
+    beta = np.zeros((nels, 3))
 
-	#get alpha and beta
-	alpha=np.vstack(((invdet*(y2-y3)).reshape(-1,),(invdet*(y3-y1)).reshape(-1,),(invdet*(y1-y2)).reshape(-1,))).T
-	beta =np.vstack(((invdet*(x3-x2)).reshape(-1,),(invdet*(x1-x3)).reshape(-1,),(invdet*(x2-x1)).reshape(-1,))).T
+    #compute nodal functions coefficients N(x, y) = alpha x + beta y + gamma
+    x1 = x[index[:, 0] - 1]
+    x2 = x[index[:, 1] - 1]
+    x3 = x[index[:, 2] - 1]
+    y1 = y[index[:, 0] - 1]
+    y2 = y[index[:, 1] - 1]
+    y3 = y[index[:, 2] - 1]
+    invdet = 1. / (x1 * (y2 - y3) - x2 * (y1 - y3) + x3 * (y1 - y2))
 
-	#get gamma if requested
-	gamma=np.zeros((nels,3))
-	gamma=np.vstack(((invdet*(x2*y3-x3*y2)).reshape(-1,),(invdet*(y1*x3-y3*x1)).reshape(-1,),(invdet*(x1*y2-x2*y1)).reshape(-1,))).T
+    #get alpha and beta
+    alpha = np.vstack(((invdet * (y2 - y3)).reshape(-1, ), (invdet * (y3 - y1)).reshape(-1, ), (invdet * (y1 - y2)).reshape(-1, ))).T
+    beta = np.vstack(((invdet * (x3 - x2)).reshape(-1, ), (invdet * (x1 - x3)).reshape(-1, ), (invdet * (x2 - x1)).reshape(-1, ))).T
 
-	return alpha,beta,gamma
+    #get gamma if requested
+    gamma = np.zeros((nels, 3))
+    gamma = np.vstack(((invdet * (x2 * y3 - x3 * y2)).reshape(-1, ), (invdet * (y1 * x3 - y3 * x1)).reshape(-1, ), (invdet * (x1 * y2 - x2 * y1)).reshape(-1, ))).T
 
+    return alpha, beta, gamma
Index: /issm/trunk/src/m/mesh/TwoDToThreeD.m
===================================================================
--- /issm/trunk/src/m/mesh/TwoDToThreeD.m	(revision 24313)
+++ /issm/trunk/src/m/mesh/TwoDToThreeD.m	(revision 24313)
@@ -0,0 +1,40 @@
+function md=TwoDToThreeD(md)
+
+	%reproject model into lat,long if necessary:
+	if md.mesh.epsg~=4326,
+		[md.mesh.x,md.mesh.y]=gdaltransform(md.mesh.x,md.mesh.y,sprintf('EPSG:%i',md.mesh.epsg),sprintf('EPSG:4326'));
+	end
+
+	%Make a 3dsurface mesh out of this: 
+	R=6.371012*10^6; 
+
+	%we assume x and y hold the long,lat values:
+	long=md.mesh.x;
+	lat=md.mesh.y;
+	mask=md.mask;
+
+	x = R .* cosd(lat) .* cosd(long);
+	y = R .* cosd(lat) .* sind(long);
+	z = R .* sind(lat);
+
+	elements=md.mesh.elements;
+	vc=md.mesh.vertexconnectivity;
+	vb=md.mesh.vertexonboundary;
+	md.mesh=mesh3dsurface(); md.mask=maskpsl();
+	md.mesh.lat=lat;
+	md.mesh.long=long;
+	md.mesh.x=x;
+	md.mesh.y=y;
+	md.mesh.z=z;
+	md.mesh.elements=elements;
+	md.mesh.numberofelements=length(elements);
+	md.mesh.numberofvertices=length(lat);
+	md.mesh.r=R*ones(md.mesh.numberofvertices,1);
+	md.mesh.vertexconnectivity=vc;
+	md.mesh.vertexonboundary=vb;
+	if strcmpi(class(mask),'maskpsl'),
+		md.mask=mask;
+	else
+		md.mask.ice_levelset=mask.ice_levelset;
+		md.mask.groundedice_levelset=mask.groundedice_levelset;
+	end
Index: /issm/trunk/src/m/mesh/bamg.py
===================================================================
--- /issm/trunk/src/m/mesh/bamg.py	(revision 24312)
+++ /issm/trunk/src/m/mesh/bamg.py	(revision 24313)
@@ -1,4 +1,4 @@
 import os.path
-import numpy as  np
+import numpy as np
 from mesh2d import *
 from mesh2dvertical import *
@@ -9,5 +9,4 @@
 from bamgmesh import bamgmesh
 from expread import expread
-from expwrite import expwrite
 from SegIntersect import SegIntersect
 import MatlabFuncs as m
@@ -15,610 +14,597 @@
 from ContourToNodes import ContourToNodes
 
-def bamg(md,*args):
-	"""
-	BAMG - mesh generation
-
-	   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 10^-100)
-	   - hmax :              maximum edge length (default is 10^100)
-	   - 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 10^30)
-	   - 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)
-	   - maxnbv :            maximum number of vertices used to allocate memory (default is 10^6)
-	   - 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
-
-	   Examples:
-	      md=bamg(md,'domain','DomainOutline.exp','hmax',3000);
-	      md=bamg(md,'field',[md.inversion.vel_obs md.geometry.thickness],'hmax',20000,'hmin',1000);
-	      md=bamg(md,'metric',A,'hmin',1000,'hmax',20000,'gradation',3,'anisomax',1);
-	"""
-
-	#process options
-	options=pairoptions(*args)
-#	options=deleteduplicates(options,1);
-
-	#initialize the structures required as input of Bamg
-	bamg_options=OrderedDict()
-	bamg_geometry=bamggeom()
-	bamg_mesh=bamgmesh()
-
-	subdomain_ref = 1
-	hole_ref = 1
-
-	# Bamg Geometry parameters {{{
-	if options.exist('domain'):
-		#Check that file exists
-		domainfile=options.getfieldvalue('domain')
-		if type(domainfile) == str:
-			if not os.path.exists(domainfile):
-				raise IOError("bamg error message: file '%s' not found" % domainfile)
-			domain=expread(domainfile)
-		else:
-			domain=domainfile
-
-		#Build geometry 
-		count=0
-		for i,domaini in enumerate(domain):
-			#Check that the domain is closed
-			if (domaini['x'][0]!=domaini['x'][-1] or domaini['y'][0]!=domaini['y'][-1]):
-				raise RuntimeError("bamg error message: all contours provided in ''domain'' should be closed")
-
-			#Checks that all holes are INSIDE the principle domain outline princial domain should be index 0
-			if i:
-				flags=ContourToNodes(domaini['x'],domaini['y'],domainfile,0)[0]
-				if np.any(np.logical_not(flags)):
-					raise RuntimeError("bamg error message: All holes should be strictly inside the principal domain")
-
-			#Check orientation
-			nods=domaini['nods']-1#the domain are closed 1=end;
-
-			test = np.sum((domaini['x'][1:nods+1] - domaini['x'][0:nods])*(domaini['y'][1:nods+1] + domaini['y'][0:nods]))
-			if (i==0 and test>0) or (i>0 and test<0):
-				print('At least one contour was not correctly oriented and has been re-oriented')
-				domaini['x'] = np.flipud(domaini['x'])
-				domaini['y'] = np.flipud(domaini['y'])
-
-
-			#Add all points to bamg_geometry
-			nods=domaini['nods']-1    #the domain are closed 0=end
-			bamg_geometry.Vertices=np.vstack((bamg_geometry.Vertices,np.vstack((domaini['x'][0:nods],domaini['y'][0:nods],np.ones((nods)))).T))
-			bamg_geometry.Edges   =np.vstack((bamg_geometry.Edges,np.vstack((np.arange(count+1,count+nods+1),np.hstack((np.arange(count+2,count+nods+1),count+1)),1.*np.ones((nods)))).T))
-			if i:
-				bamg_geometry.SubDomains=np.vstack((bamg_geometry.SubDomains,[2,count+1,1,-subdomain_ref]))
-				subdomain_ref = subdomain_ref+1;
-			else:
-				bamg_geometry.SubDomains=np.vstack((bamg_geometry.SubDomains,[2,count+1,1,0]))
-			
-			#update counter
-			count+=nods
-
-		#Deal with domain holes
-		if options.exist('holes'):
-			holesfile=options.getfieldvalue('holes')
-			if type(holesfile) == str:
-				if not os.path.exists(holesfile):
-					raise IOError("bamg error message: file '%s' not found" % holesfile)
-				holes=expread(holesfile)
-			else:
-				holes=holesfile
-
-			#Build geometry 
-			for i,holei in enumerate(holes):
-				#Check that the hole is closed
-				if (holei['x'][0]!=holei['x'][-1] or holei['y'][0]!=holei['y'][-1]):
-					raise RuntimeError("bamg error message: all contours provided in ''hole'' should be closed")
-
-				#Checks that all holes are INSIDE the principle domain outline princial domain should be index 0
-				flags=ContourToNodes(holei['x'],holei['y'],domainfile,0)[0]
-				if np.any(np.logical_not(flags)):
-					raise RuntimeError("bamg error message: All holes should be strictly inside the principal domain")
-
-				#Check orientation
-				nods=holei['nods']-1#the hole are closed 1=end;
-				test = np.sum((holei['x'][1:nods+1] - holei['x'][0:nods])*(holei['y'][1:nods+1] + holei['y'][0:nods]))
-				if test<0:
-					print('At least one hole was not correctly oriented and has been re-oriented')
-					holei['x'] = np.flipud(holei['x'])
-					holei['y'] = np.flipud(holei['y'])
-
-				#Add all points to bamg_geometry
-				nods=holei['nods']-1    #the hole are closed 0=end
-				bamg_geometry.Vertices=np.vstack((bamg_geometry.Vertices,np.vstack((holei['x'][0:nods],holei['y'][0:nods],np.ones((nods)))).T))
-				bamg_geometry.Edges   =np.vstack((bamg_geometry.Edges,np.vstack((np.arange(count+1,count+nods+1),np.hstack((np.arange(count+2,count+nods+1),count+1)),1.*np.ones((nods)))).T))
-				#update counter
-				count+=nods
-
-		#And subdomains
-		if options.exist('subdomains'):
-			subdomainfile=options.getfieldvalue('subdomains')
-			if type(subdomainfile) == str:
-				if not os.path.exists(subdomainfile):
-					raise IOError("bamg error message: file '%s' not found" % subdomainfile)
-				subdomains=expread(subdomainfile)
-			else:
-				subdomains=subdomainfile
-
-			#Build geometry 
-			for i,subdomaini in enumerate(subdomains):
-				#Check that the subdomain is closed
-				if (subdomaini['x'][0]!=subdomaini['x'][-1] or subdomaini['y'][0]!=subdomaini['y'][-1]):
-					raise RuntimeError("bamg error message: all contours provided in ''subdomain'' should be closed")
-
-				#Checks that all subdomains are INSIDE the principle subdomain outline princial domain should be index 0
-				if i:
-					flags=ContourToNodes(subdomaini['x'],subdomaini['y'],domainfile,0)[0]
-					if np.any(np.logical_not(flags)):
-						raise RuntimeError("bamg error message: All subdomains should be strictly inside the principal subdomain")
-
-				#Check orientation
-				nods=subdomaini['nods']-1#the subdomain are closed 1=end;
-
-				test = np.sum((subdomaini['x'][1:nods+1] - subdomaini['x'][0:nods])*(subdomaini['y'][1:nods+1] + subdomaini['y'][0:nods]))
-				if test>0:
-					print('At least one subcontour was not correctly oriented and has been re-oriented')
-					subdomaini['x'] = np.flipud(subdomaini['x'])
-					subdomaini['y'] = np.flipud(subdomaini['y'])
-
-				#Add all points to bamg_geometry
-				nods=subdomaini['nods']-1    #the subdomain are closed 0=end
-				bamg_geometry.Vertices=np.vstack((bamg_geometry.Vertices,np.vstack((subdomaini['x'][0:nods],subdomaini['y'][0:nods],np.ones((nods)))).T))
-				bamg_geometry.Edges   =np.vstack((bamg_geometry.Edges,np.vstack((np.arange(count+1,count+nods+1),np.hstack((np.arange(count+2,count+nods+1),count+1)),1.*np.ones((nods)))).T))
-				#update counter
-				count+=nods
-			
-		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)))
-			if np.size(options.getfieldvalue('Markers',[]))==np.size(bamg_geometry.Edges,0):
-				bamg_geometry.Edges[:,2]=options.getfieldvalue('Markers')
-
-		#take care of rifts
-		if options.exist('rifts'):
-
-			#Check that file exists
-			riftfile=options.getfieldvalue('rifts')
-			if not os.path.exists(riftfile):
-				raise IOError("bamg error message: file '%s' not found" % riftfile)
-			rift=expread(riftfile)
-
-			for i,rifti in enumerate(rift):
-
-				#detect whether all points of the rift are inside the domain
-				flags=ContourToNodes(rifti['x'],rifti['y'],domain[0],0)[0]
-				if np.all(np.logical_not(flags)):
-					raise RuntimeError("one rift has all its points outside of the domain outline")
-
-				elif np.any(np.logical_not(flags)):
-					#We LOTS of work to do
-					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 yet")
-
-					#Move tip outside to the first position
-					if   not flags[0]:
-						#OK, first point is outside (do nothing),
-						pass
-					elif not flags[-1]:
-						rifti['x']=np.flipud(rifti['x'])
-						rifti['y']=np.flipud(rifti['y'])
-					else:
-						raise RuntimeError("bamg error message: only a rift tip can be outside of the domain")
-
-					#Get cordinate of intersection point
-					x1=rifti['x'][0]
-					y1=rifti['y'][0]
-					x2=rifti['x'][1]
-					y2=rifti['y'][1]
-					for j in xrange(0,np.size(domain[0]['x'])-1):
-						if SegIntersect(np.array([[x1,y1],[x2,y2]]),np.array([[domain[0]['x'][j],domain[0]['y'][j]],[domain[0]['x'][j+1],domain[0]['y'][j+1]]])):
-
-							#Get position of the two nodes of the edge in domain
-							i1=j
-							i2=j+1
-
-							#rift is crossing edge [i1 i2] of the domain
-							#Get coordinate of intersection point (http://mathworld.wolfram.com/Line-LineIntersection.html)
-							x3=domain[0]['x'][i1]
-							y3=domain[0]['y'][i1]
-							x4=domain[0]['x'][i2]
-							y4=domain[0]['y'][i2]
-#							x=det([det([x1 y1; x2 y2])  x1-x2;det([x3 y3; x4 y4])  x3-x4])/det([x1-x2 y1-y2;x3-x4 y3-y4]);
-#							y=det([det([x1 y1; x2 y2])  y1-y2;det([x3 y3; x4 y4])  y3-y4])/det([x1-x2 y1-y2;x3-x4 y3-y4]);
-							x=np.linalg.det(np.array([[np.linalg.det(np.array([[x1,y1],[x2,y2]])),x1-x2],[np.linalg.det(np.array([[x3,y3],[x4,y4]])),x3-x4]]))/np.linalg.det(np.array([[x1-x2,y1-y2],[x3-x4,y3-y4]]))
-							y=np.linalg.det(np.array([[np.linalg.det(np.array([[x1,y1],[x2,y2]])),y1-y2],[np.linalg.det(np.array([[x3,y3],[x4,y4]])),y3-y4]]))/np.linalg.det(np.array([[x1-x2,y1-y2],[x3-x4,y3-y4]]))
-
-							segdis= sqrt((x4-x3)**2+(y4-y3)**2)
-							tipdis=np.array([sqrt((x-x3)**2+(y-y3)**2),sqrt((x-x4)**2+(y-y4)**2)])
-
-							if np.min(tipdis)/segdis < options.getfieldvalue('toltip',0):
-								print "moving tip-domain intersection point"
-
-								#Get position of the closer point
-								if tipdis[0]>tipdis[1]:
-									pos=i2
-								else:
-									pos=i1
-
-								#This point is only in Vertices (number pos).
-								#OK, now we can add our own rift
-								nods=rifti['nods']-1
-								bamg_geometry.Vertices=np.vstack((bamg_geometry.Vertices,np.hstack((rifti['x'][1:].reshape(-1,),rifti['y'][1:].reshape(-1,),np.ones((nods,1))))))
-								bamg_geometry.Edges=np.vstack((bamg_geometry.Edges,\
-									np.array([[pos,count+1,(1+i)]]),\
-									np.hstack((np.arange(count+1,count+nods).reshape(-1,),np.arange(count+2,count+nods+1).reshape(-1,),(1+i)*np.ones((nods-1,1))))))
-								count+=nods
-
-								break
-
-							else:
-								#Add intersection point to Vertices
-								bamg_geometry.Vertices=np.vstack((bamg_geometry.Vertices,np.array([[x,y,1]])))
-								count+=1
-
-								#Decompose the crossing edge into 2 subedges
-								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...")
-								bamg_geometry.Edges=np.vstack((bamg_geometry.Edges[0:pos-1,:],\
-									np.array([[bamg_geometry.Edges[pos,0],count                     ,bamg_geometry.Edges[pos,2]]]),\
-									np.array([[count                     ,bamg_geometry.Edges[pos,1],bamg_geometry.Edges[pos,2]]]),\
-									bamg_geometry.Edges[pos+1:,:]))
-
-								#OK, now we can add our own rift
-								nods=rifti['nods']-1
-								bamg_geometry.Vertices=np.vstack((bamg_geometry.Vertices,np.hstack((rifti['x'][1:].reshape(-1,),rifti['y'][1:].reshape(-1,),np.ones((nods,1))))))
-								bamg_geometry.Edges=np.vstack((bamg_geometry.Edges,\
-									np.array([[count,count+1,2]]),\
-									np.hstack((np.arange(count+1,count+nods).reshape(-1,),np.arange(count+2,count+nods+1).reshape(-1,),(1+i)*np.ones((nods-1,1))))))
-								count+=nods
-
-								break
-
-				else:
-					nods=rifti['nods']-1
-					bamg_geometry.Vertices=np.vstack(bamg_geometry.Vertices, np.hstack(rifti['x'][:],rifti['y'][:],np.ones((nods+1,1))))
-					bamg_geometry.Edges   =np.vstack(bamg_geometry.Edges, np.hstack(np.arange(count+1,count+nods).reshape(-1,),np.arange(count+2,count+nods+1).reshape(-1,),i*np.ones((nods,1))))
-					count=+nods+1
-
-		#Deal with tracks
-		if options.exist('tracks'):
-
-			#read tracks
-			track=options.getfieldvalue('tracks')
-			if all(isinstance(track,(str,unicode))):
-				A=expread(track)
-				track=np.hstack((A.x.reshape(-1,),A.y.reshape(-1,)))
-			else:
-				track=float(track)    #for some reason, it is of class "single"
-			if np.size(track,axis=1)==2:
-				track=np.hstack((track,3.*np.ones((size(track,axis=0),1))))
-
-			#only keep those inside
-			flags=ContourToNodes(track[:,0],track[:,1],domainfile,0)[0]
-			track=track[np.nonzero(flags),:]
-
-			#Add all points to bamg_geometry
-			nods=np.size(track,axis=0)
-			bamg_geometry.Vertices=np.vstack((bamg_geometry.Vertices,track))
-			bamg_geometry.Edges   =np.vstack((bamg_geometry.Edges,np.hstack((np.arange(count+1,count+nods).reshape(-1,),np.arange(count+2,count+nods+1).reshape(-1,),3.*np.ones((nods-1,1))))))
-
-			#update counter
-			count+=nods
-
-		#Deal with vertices that need to be kept by mesher
-		if options.exist('RequiredVertices'):
-
-			#recover RequiredVertices
-			requiredvertices=options.getfieldvalue('RequiredVertices')    #for some reason, it is of class "single"
-			if np.size(requiredvertices,axis=1)==2:
-				requiredvertices=np.hstack((requiredvertices,4.*np.ones((np.size(requiredvertices,axis=0),1))))
-
-			#only keep those inside
-			flags=ContourToNodes(requiredvertices[:,0],requiredvertices[:,1],domainfile,0)[0]
-			requiredvertices=requiredvertices[np.nonzero(flags)[0],:]
-			#Add all points to bamg_geometry
-			nods=np.size(requiredvertices,axis=0)
-			bamg_geometry.Vertices=np.vstack((bamg_geometry.Vertices,requiredvertices))
-
-			#update counter
-			count+=nods
-
-		#process geom
-		#bamg_geometry=processgeometry(bamg_geometry,options.getfieldvalue('tol',float(nan)),domain[0])
-
-	elif isinstance(md.private.bamg,dict) and 'geometry' in md.private.bamg:
-		bamg_geometry=bamggeom(md.private.bamg['geometry'].__dict__) 
-	else:
-		#do nothing...
-		pass
-	#}}}
-	# Bamg Mesh parameters {{{
-	if not options.exist('domain') and md.mesh.numberofvertices and m.strcmp(md.mesh.elementtype(),'Tria'):
-
-		if isinstance(md.private.bamg,dict) and 'mesh' in md.private.bamg:
-			bamg_mesh=bamgmesh(md.private.bamg['mesh'].__dict__)
-		else:
-			bamg_mesh.Vertices=np.vstack((md.mesh.x,md.mesh.y,np.ones((md.mesh.numberofvertices)))).T
-			#bamg_mesh.Vertices=np.hstack((md.mesh.x.reshape(-1,),md.mesh.y.reshape(-1,),np.ones((md.mesh.numberofvertices,1))))
-			bamg_mesh.Triangles=np.hstack((md.mesh.elements,np.ones((md.mesh.numberofelements,1))))
-
-		if isinstance(md.rifts.riftstruct,dict):
-			raise TypeError("bamg error message: rifts not supported yet. Do meshprocessrift AFTER bamg")
-	#}}}
-	# Bamg Options {{{
-	bamg_options['Crack']=options.getfieldvalue('Crack',0)
-	bamg_options['anisomax']=options.getfieldvalue('anisomax',10.**30)
-	bamg_options['coeff']=options.getfieldvalue('coeff',1.)
-	bamg_options['cutoff']=options.getfieldvalue('cutoff',10.**-5)
-	bamg_options['err']=options.getfieldvalue('err',np.array([[0.01]]))
-	bamg_options['errg']=options.getfieldvalue('errg',0.1)
-	bamg_options['field']=options.getfieldvalue('field',np.empty((0,1)))
-	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['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['metric']=options.getfieldvalue('metric',np.empty((0,1)))
-	bamg_options['Metrictype']=options.getfieldvalue('Metrictype',0)
-	bamg_options['nbjacobi']=options.getfieldvalue('nbjacobi',1)
-	bamg_options['nbsmooth']=options.getfieldvalue('nbsmooth',3)
-	bamg_options['omega']=options.getfieldvalue('omega',1.8)
-	bamg_options['power']=options.getfieldvalue('power',1.)
-	bamg_options['splitcorners']=options.getfieldvalue('splitcorners',1)
-	bamg_options['verbose']=options.getfieldvalue('verbose',1)
-	#}}}
-
-	#call Bamg
-	bamgmesh_out,bamggeom_out=BamgMesher(bamg_mesh.__dict__,bamg_geometry.__dict__,bamg_options)
-
-	# plug results onto model
-	if options.getfieldvalue('vertical',0):
-		md.mesh=mesh2dvertical()
-		md.mesh.x=bamgmesh_out['Vertices'][:,0].copy()
-		md.mesh.y=bamgmesh_out['Vertices'][:,1].copy()
-		md.mesh.elements=bamgmesh_out['Triangles'][:,0:3].astype(int)
-		md.mesh.edges=bamgmesh_out['IssmEdges'].astype(int)
-		md.mesh.segments=bamgmesh_out['IssmSegments'][:,0:3].astype(int)
-		md.mesh.segmentmarkers=bamgmesh_out['IssmSegments'][:,3].astype(int)
-
-		#Fill in rest of fields:
-		md.mesh.numberofelements=np.size(md.mesh.elements,axis=0)
-		md.mesh.numberofvertices=np.size(md.mesh.x)
-		md.mesh.numberofedges=np.size(md.mesh.edges,axis=0)
-		md.mesh.vertexonboundary=np.zeros(md.mesh.numberofvertices,bool)
-		md.mesh.vertexonboundary[md.mesh.segments[:,0:2]-1]=True
-
-		#Now, build the connectivity tables for this mesh. Doubled in matlab for some reason
-		md.mesh.vertexonboundary=np.zeros(md.mesh.numberofvertices,)
-		md.mesh.vertexonboundary[md.mesh.segments[:,0:2]-1]=1
-
-	elif options.getfieldvalue('3dsurface',0):
-		md.mesh=mesh3dsurface()
-		md.mesh.x=bamgmesh_out['Vertices'][:,0].copy()
-		md.mesh.y=bamgmesh_out['Vertices'][:,1].copy()
-		md.mesh.z=md.mesh.x
-		md.mesh.z[:]=0
-		md.mesh.elements=bamgmesh_out['Triangles'][:,0:3].astype(int)
-		md.mesh.edges=bamgmesh_out['IssmEdges'].astype(int)
-		md.mesh.segments=bamgmesh_out['IssmSegments'][:,0:3].astype(int)
-		md.mesh.segmentmarkers=bamgmesh_out['IssmSegments'][:,3].astype(int)
-
-		#Fill in rest of fields:
-		md.mesh.numberofelements=np.size(md.mesh.elements,axis=0)
-		md.mesh.numberofvertices=np.size(md.mesh.x)
-		md.mesh.numberofedges=np.size(md.mesh.edges,axis=0)
-		md.mesh.vertexonboundary=np.zeros(md.mesh.numberofvertices,bool)
-		md.mesh.vertexonboundary[md.mesh.segments[:,0:2]-1]=True
-
-	else:
-		md.mesh=mesh2d()
-		md.mesh.x=bamgmesh_out['Vertices'][:,0].copy()
-		md.mesh.y=bamgmesh_out['Vertices'][:,1].copy()
-		md.mesh.elements=bamgmesh_out['Triangles'][:,0:3].astype(int)
-		md.mesh.edges=bamgmesh_out['IssmEdges'].astype(int)
-		md.mesh.segments=bamgmesh_out['IssmSegments'][:,0:3].astype(int)
-		md.mesh.segmentmarkers=bamgmesh_out['IssmSegments'][:,3].astype(int)
-
-		#Fill in rest of fields:
-		md.mesh.numberofelements=np.size(md.mesh.elements,axis=0)
-		md.mesh.numberofvertices=np.size(md.mesh.x)
-		md.mesh.numberofedges=np.size(md.mesh.edges,axis=0)
-		md.mesh.vertexonboundary=np.zeros(md.mesh.numberofvertices,bool)
-		md.mesh.vertexonboundary[md.mesh.segments[:,0:2]-1]=True
-
-	#Bamg private fields
-	md.private.bamg=OrderedDict()
-	md.private.bamg['mesh']=bamgmesh(bamgmesh_out)
-	md.private.bamg['geometry']=bamggeom(bamggeom_out)
-	md.mesh.elementconnectivity=md.private.bamg['mesh'].ElementConnectivity
-	md.mesh.elementconnectivity[np.nonzero(np.isnan(md.mesh.elementconnectivity))]=0
-	md.mesh.elementconnectivity=md.mesh.elementconnectivity.astype(int)
-
-	#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")
-
-	return md
-
-def processgeometry(geom,tol,outline):    # {{{
-
-	raise RuntimeError("bamg.py/processgeometry is not complete.")
-	#Deal with edges
-	print "Checking Edge crossing..."
-	i=0
-	while (i<np.size(geom.Edges,axis=0)):
-
-		#edge counter
-		i+=1
-
-		#Get coordinates
-		x1=geom.Vertices[geom.Edges[i,0],0]
-		y1=geom.Vertices[geom.Edges[i,0],1]
-		x2=geom.Vertices[geom.Edges[i,1],0]
-		y2=geom.Vertices[geom.Edges[i,1],1]
-		color1=geom.Edges[i,2]
-
-		j=i    #test edges located AFTER i only
-		while (j<np.size(geom.Edges,axis=0)):
-
-			#edge counter
-			j+=1
-
-			#Skip if the two edges already have a vertex in common
-			if any(m.ismember(geom.Edges[i,0:2],geom.Edges[j,0:2])):
-				continue
-
-			#Get coordinates
-			x3=geom.Vertices[geom.Edges[j,0],0]
-			y3=geom.Vertices[geom.Edges[j,0],1]
-			x4=geom.Vertices[geom.Edges[j,1],0]
-			y4=geom.Vertices[geom.Edges[j,1],1]
-			color2=geom.Edges[j,2]
-
-			#Check if the two edges are crossing one another
-			if SegIntersect(np.array([[x1,y1],[x2,y2]]),np.array([[x3,y3],[x4,y4]])):
-
-				#Get coordinate of intersection point (http://mathworld.wolfram.com/Line-LineIntersection.html)
-				x=np.linalg.det(np.array([np.linalg.det(np.array([[x1,y1],[x2,y2]])),x1-x2],[np.linalg.det(np.array([[x3,y3],[x4,y4]])),x3-x4])/np.linalg.det(np.array([[x1-x2,y1-y2],[x3-x4,y3-y4]])))
-				y=np.linalg.det(np.array([np.linalg.det(np.array([[x1,y1],[x2,y2]])),y1-y2],[np.linalg.det(np.array([[x3,y3],[x4,y4]])),y3-y4])/np.linalg.det(np.array([[x1-x2,y1-y2],[x3-x4,y3-y4]])))
-
-				#Add vertex to the list of vertices
-				geom.Vertices=np.vstack((geom.Vertices,[x,y,min(color1,color2)]))
-				id=np.size(geom.Vertices,axis=0)
-
-				#Update edges i and j
-				edgei=geom.Edges[i,:].copy()
-				edgej=geom.Edges[j,:].copy()
-				geom.Edges[i,:]    =[edgei(0),id      ,edgei(2)]
-				geom.Edges=np.vstack((geom.Edges,[id      ,edgei(1),edgei(2)]))
-				geom.Edges[j,:]    =[edgej(0),id      ,edgej(2)]
-				geom.Edges=np.vstack((geom.Edges,[id      ,edgej(1),edgej(2)]))
-
-				#update current edge second tip
-				x2=x
-				y2=y
-
-	#Check point outside
-	print "Checking for points outside the domain..."
-	i=0
-	num=0
-	while (i<np.size(geom.Vertices,axis=0)):
-
-		#vertex counter
-		i+=1
-
-		#Get coordinates
-		x=geom.Vertices[i,0]
-		y=geom.Vertices[i,1]
-		color=geom.Vertices[i,2]
-
-		#Check that the point is inside the domain
-		if color!=1 and not ContourToNodes(x,y,outline[0],1):
-
-			#Remove points from list of Vertices
-			num+=1
-			geom.Vertices[i,:]=[]
-
-			#update edges
-			posedges=np.nonzero(geom.Edges==i)
-			geom.Edges[posedges[0],:]=[]
-			posedges=np.nonzero(geom.Edges>i)
-			geom.Edges[posedges]=geom.Edges[posedges]-1
-
-			#update counter
-			i-=1
-
-	if num:
-		print "WARNING: %d points outside the domain outline have been removed" % num
-
-	"""
-	%Check point spacing
-	if ~isnan(tol),
-		disp('Checking point spacing...');
-		i=0;
-		while (i<size(geom.Vertices,1)),
-
-			%vertex counter
-			i=i+1;
-
-			%Get coordinates
-			x1=geom.Vertices(i,1);
-			y1=geom.Vertices(i,2);
-
-			j=i; %test edges located AFTER i only
-			while (j<size(geom.Vertices,1)),
-
-				%vertex counter
-				j=j+1;
-
-				%Get coordinates
-				x2=geom.Vertices(j,1);
-				y2=geom.Vertices(j,2);
-
-				%Check whether the two vertices are too close
-				if ((x2-x1)**2+(y2-y1)**2<tol**2)
-
-					%Remove points from list of Vertices
-					geom.Vertices(j,:)=[];
-
-					%update edges
-					posedges=find(m.ismember(geom.Edges,j));
-					geom.Edges(posedges)=i;
-					posedges=find(geom.Edges>j);
-					geom.Edges(posedges)=geom.Edges(posedges)-1;
-
-					%update counter
-					j=j-1;
-
-				end
-			end
-		end
-	end
-	%remove empty edges
-	geom.Edges(find(geom.Edges(:,1)==geom.Edges(:,2)),:)=[];
-	"""
-	return geom
-# }}}
-
+
+def bamg(md, *args):
+    """
+    BAMG - mesh generation
+
+    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)
+    - 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
+
+       Examples:
+          md = bamg(md, 'domain', 'DomainOutline.exp', 'hmax', 3000)
+          md = bamg(md, 'field', [md.inversion.vel_obs md.geometry.thickness], 'hmax', 20000, 'hmin', 1000)
+          md = bamg(md, 'metric', A, 'hmin', 1000, 'hmax', 20000, 'gradation', 3, 'anisomax', 1)
+    """
+
+    #process options
+    options = pairoptions(*args)
+    #options = deleteduplicates(options, 1)
+
+    #initialize the structures required as input of Bamg
+    bamg_options = OrderedDict()
+    bamg_geometry = bamggeom()
+    bamg_mesh = bamgmesh()
+
+    subdomain_ref = 1
+
+    # Bamg Geometry parameters {{{
+    if options.exist('domain'):
+        #Check that file exists
+        domainfile = options.getfieldvalue('domain')
+        if type(domainfile) == str:
+            if not os.path.exists(domainfile):
+                raise IOError("bamg error message: file '%s' not found" % domainfile)
+            domain = expread(domainfile)
+        else:
+            domain = domainfile
+
+        #Build geometry
+        count = 0
+        for i, domaini in enumerate(domain):
+            #Check that the domain is closed
+            if (domaini['x'][0] != domaini['x'][-1] or domaini['y'][0] != domaini['y'][-1]):
+                raise RuntimeError("bamg error message: all contours provided in ''domain'' should be closed")
+
+            #Checks that all holes are INSIDE the principle domain outline princial domain should be index 0
+            if i:
+                flags = ContourToNodes(domaini['x'], domaini['y'], domainfile, 0)[0]
+                if np.any(np.logical_not(flags)):
+                    raise RuntimeError("bamg error message: All holes should be strictly inside the principal domain")
+
+            #Check orientation
+            nods = domaini['nods'] - 1  #the domain are closed 1 = end
+            test = np.sum((domaini['x'][1:nods + 1] - domaini['x'][0:nods]) * (domaini['y'][1:nods + 1] + domaini['y'][0:nods]))
+            if (i == 0 and test > 0) or (i > 0 and test < 0):
+                print('At least one contour was not correctly oriented and has been re-oriented')
+                domaini['x'] = np.flipud(domaini['x'])
+                domaini['y'] = np.flipud(domaini['y'])
+
+            #Add all points to bamg_geometry
+            nods = domaini['nods'] - 1  #the domain are closed 0 = end
+            bamg_geometry.Vertices = np.vstack((bamg_geometry.Vertices, np.vstack((domaini['x'][0:nods], domaini['y'][0:nods], np.ones((nods)))).T))
+            bamg_geometry.Edges = np.vstack((bamg_geometry.Edges, np.vstack((np.arange(count + 1, count + nods + 1), np.hstack((np.arange(count + 2, count + nods + 1), count + 1)), 1. * np.ones((nods)))).T))
+            if i:
+                bamg_geometry.SubDomains = np.vstack((bamg_geometry.SubDomains, [2, count + 1, 1, -subdomain_ref]))
+                subdomain_ref = subdomain_ref + 1
+            else:
+                bamg_geometry.SubDomains = np.vstack((bamg_geometry.SubDomains, [2, count + 1, 1, 0]))
+
+            #update counter
+            count += nods
+
+        #Deal with domain holes
+        if options.exist('holes'):
+            holesfile = options.getfieldvalue('holes')
+            if type(holesfile) == str:
+                if not os.path.exists(holesfile):
+                    raise IOError("bamg error message: file '%s' not found" % holesfile)
+                holes = expread(holesfile)
+            else:
+                holes = holesfile
+
+            #Build geometry
+            for i, holei in enumerate(holes):
+                #Check that the hole is closed
+                if (holei['x'][0] != holei['x'][-1] or holei['y'][0] != holei['y'][-1]):
+                    raise RuntimeError("bamg error message: all contours provided in ''hole'' should be closed")
+
+                #Checks that all holes are INSIDE the principle domain outline princial domain should be index 0
+                flags = ContourToNodes(holei['x'], holei['y'], domainfile, 0)[0]
+                if np.any(np.logical_not(flags)):
+                    raise RuntimeError("bamg error message: All holes should be strictly inside the principal domain")
+
+                #Check orientation
+                nods = holei['nods'] - 1  #the hole are closed 1 = end
+                test = np.sum((holei['x'][1:nods + 1] - holei['x'][0:nods]) * (holei['y'][1:nods + 1] + holei['y'][0:nods]))
+                if test < 0:
+                    print('At least one hole was not correctly oriented and has been re-oriented')
+                    holei['x'] = np.flipud(holei['x'])
+                    holei['y'] = np.flipud(holei['y'])
+
+                #Add all points to bamg_geometry
+                nods = holei['nods'] - 1  #the hole are closed 0 = end
+                bamg_geometry.Vertices = np.vstack((bamg_geometry.Vertices, np.vstack((holei['x'][0:nods], holei['y'][0:nods], np.ones((nods)))).T))
+                bamg_geometry.Edges = np.vstack((bamg_geometry.Edges, np.vstack((np.arange(count + 1, count + nods + 1), np.hstack((np.arange(count + 2, count + nods + 1), count + 1)), 1. * np.ones((nods)))).T))
+                #update counter
+                count += nods
+
+        #And subdomains
+        if options.exist('subdomains'):
+            subdomainfile = options.getfieldvalue('subdomains')
+            if type(subdomainfile) == str:
+                if not os.path.exists(subdomainfile):
+                    raise IOError("bamg error message: file '{}' not found".format(subdomainfile))
+                subdomains = expread(subdomainfile)
+            else:
+                subdomains = subdomainfile
+
+            #Build geometry
+            for i, subdomaini in enumerate(subdomains):
+                #Check that the subdomain is closed
+                if (subdomaini['x'][0] != subdomaini['x'][-1] or subdomaini['y'][0] != subdomaini['y'][-1]):
+                    raise RuntimeError("bamg error message: all contours provided in ''subdomain'' should be closed")
+
+                #Checks that all subdomains are INSIDE the principle subdomain outline princial domain should be index 0
+                if i:
+                    flags = ContourToNodes(subdomaini['x'], subdomaini['y'], domainfile, 0)[0]
+                    if np.any(np.logical_not(flags)):
+                        raise RuntimeError("bamg error message: All subdomains should be strictly inside the principal subdomain")
+
+                #Check orientation
+                nods = subdomaini['nods'] - 1  #the subdomain are closed 1 = end
+
+                test = np.sum((subdomaini['x'][1:nods + 1] - subdomaini['x'][0:nods]) * (subdomaini['y'][1:nods + 1] + subdomaini['y'][0:nods]))
+                if test > 0:
+                    print('At least one subcontour was not correctly oriented and has been re-oriented')
+                    subdomaini['x'] = np.flipud(subdomaini['x'])
+                    subdomaini['y'] = np.flipud(subdomaini['y'])
+
+                #Add all points to bamg_geometry
+                nods = subdomaini['nods'] - 1  #the subdomain are closed 0 = end
+                bamg_geometry.Vertices = np.vstack((bamg_geometry.Vertices, np.vstack((subdomaini['x'][0:nods], subdomaini['y'][0:nods], np.ones((nods)))).T))
+                bamg_geometry.Edges = np.vstack((bamg_geometry.Edges, np.vstack((np.arange(count + 1, count + nods + 1), np.hstack((np.arange(count + 2, count + nods + 1), count + 1)), 1. * np.ones((nods)))).T))
+                #update counter
+                count += nods
+
+        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)))
+            if np.size(options.getfieldvalue('Markers', [])) == np.size(bamg_geometry.Edges, 0):
+                bamg_geometry.Edges[:, 2] = options.getfieldvalue('Markers')
+
+        #take care of rifts
+        if options.exist('rifts'):
+
+            #Check that file exists
+            riftfile = options.getfieldvalue('rifts')
+            if not os.path.exists(riftfile):
+                raise IOError("bamg error message: file '%s' not found" % riftfile)
+            rift = expread(riftfile)
+
+            for i, rifti in enumerate(rift):
+                #detect whether all points of the rift are inside the domain
+                flags = ContourToNodes(rifti['x'], rifti['y'], domain[0], 0)[0]
+                if np.all(np.logical_not(flags)):
+                    raise RuntimeError("one rift has all its points outside of the domain outline")
+
+                elif np.any(np.logical_not(flags)):
+                    #We LOTS of work to do
+                    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 yet")
+
+                    #Move tip outside to the first position
+                    if not flags[0]:
+                        #OK, first point is outside (do nothing),
+                        pass
+                    elif not flags[-1]:
+                        rifti['x'] = np.flipud(rifti['x'])
+                        rifti['y'] = np.flipud(rifti['y'])
+                    else:
+                        raise RuntimeError("bamg error message: only a rift tip can be outside of the domain")
+
+                    #Get cordinate of intersection point
+                    x1 = rifti['x'][0]
+                    y1 = rifti['y'][0]
+                    x2 = rifti['x'][1]
+                    y2 = rifti['y'][1]
+                    for j in range(0, np.size(domain[0]['x']) - 1):
+                        if SegIntersect(np.array([[x1, y1], [x2, y2]]), np.array([[domain[0]['x'][j], domain[0]['y'][j]], [domain[0]['x'][j + 1], domain[0]['y'][j + 1]]])):
+
+                            #Get position of the two nodes of the edge in domain
+                            i1 = j
+                            i2 = j + 1
+
+                            #rift is crossing edge [i1 i2] of the domain
+                            #Get coordinate of intersection point (http://mathworld.wolfram.com/Line-LineIntersection.html)
+                            x3 = domain[0]['x'][i1]
+                            y3 = domain[0]['y'][i1]
+                            x4 = domain[0]['x'][i2]
+                            y4 = domain[0]['y'][i2]
+                            #x = det([det([x1 y1; x2 y2])  x1 - x2;det([x3 y3; x4 y4])  x3 - x4]) / det([x1 - x2 y1 - y2;x3 - x4 y3 - y4])
+                            #y = det([det([x1 y1; x2 y2])  y1 - y2;det([x3 y3; x4 y4])  y3 - y4]) / det([x1 - x2 y1 - y2;x3 - x4 y3 - y4])
+                            x = np.linalg.det(np.array([[np.linalg.det(np.array([[x1, y1], [x2, y2]])), x1 - x2], [np.linalg.det(np.array([[x3, y3], [x4, y4]])), x3 - x4]])) / np.linalg.det(np.array([[x1 - x2, y1 - y2], [x3 - x4, y3 - y4]]))
+                            y = np.linalg.det(np.array([[np.linalg.det(np.array([[x1, y1], [x2, y2]])), y1 - y2], [np.linalg.det(np.array([[x3, y3], [x4, y4]])), y3 - y4]])) / np.linalg.det(np.array([[x1 - x2, y1 - y2], [x3 - x4, y3 - y4]]))
+
+                            segdis = sqrt((x4 - x3)**2 + (y4 - y3)**2)
+                            tipdis = np.array([sqrt((x - x3)**2 + (y - y3)**2), sqrt((x - x4)**2 + (y - y4)**2)])
+
+                            if np.min(tipdis) / segdis < options.getfieldvalue('toltip', 0):
+                                print("moving tip - domain intersection point")
+
+                                #Get position of the closer point
+                                if tipdis[0] > tipdis[1]:
+                                    pos = i2
+                                else:
+                                    pos = i1
+
+                                #This point is only in Vertices (number pos).
+                                #OK, now we can add our own rift
+                                nods = rifti['nods'] - 1
+                                bamg_geometry.Vertices = np.vstack((bamg_geometry.Vertices, np.hstack((rifti['x'][1:].reshape(-1, ), rifti['y'][1:].reshape(-1, ), np.ones((nods, 1))))))
+                                bamg_geometry.Edges = np.vstack((bamg_geometry.Edges,
+                                                                 np.array([[pos, count + 1, (1 + i)]]),
+                                                                 np.hstack((np.arange(count + 1, count + nods).reshape(-1, ), np.arange(count + 2, count + nods + 1).reshape(-1, ), (1 + i) * np.ones((nods - 1, 1))))))
+                                count += nods
+                                break
+
+                            else:
+                                #Add intersection point to Vertices
+                                bamg_geometry.Vertices = np.vstack((bamg_geometry.Vertices, np.array([[x, y, 1]])))
+                                count += 1
+
+                                #Decompose the crossing edge into 2 subedges
+                                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...")
+                                bamg_geometry.Edges = np.vstack((bamg_geometry.Edges[0:pos - 1, :],
+                                                                 np.array([[bamg_geometry.Edges[pos, 0], count, bamg_geometry.Edges[pos, 2]]]),
+                                                                 np.array([[count, bamg_geometry.Edges[pos, 1], bamg_geometry.Edges[pos, 2]]]),
+                                                                 bamg_geometry.Edges[pos + 1:, :]))
+
+                                #OK, now we can add our own rift
+                                nods = rifti['nods'] - 1
+                                bamg_geometry.Vertices = np.vstack((bamg_geometry.Vertices, np.hstack((rifti['x'][1:].reshape(-1, ), rifti['y'][1:].reshape(-1, ), np.ones((nods, 1))))))
+                                bamg_geometry.Edges = np.vstack((bamg_geometry.Edges,
+                                                                 np.array([[count, count + 1, 2]]),
+                                                                 np.hstack((np.arange(count + 1, count + nods).reshape(-1, ), np.arange(count + 2, count + nods + 1).reshape(-1, ), (1 + i) * np.ones((nods - 1, 1))))))
+                                count += nods
+                                break
+
+                else:
+                    nods = rifti['nods'] - 1
+                    bamg_geometry.Vertices = np.vstack(bamg_geometry.Vertices, np.hstack(rifti['x'][:], rifti['y'][:], np.ones((nods + 1, 1))))
+                    bamg_geometry.Edges = np.vstack(bamg_geometry.Edges, np.hstack(np.arange(count + 1, count + nods).reshape(-1, ), np.arange(count + 2, count + nods + 1).reshape(-1, ), i * np.ones((nods, 1))))
+                    count += nods + 1
+
+        #Deal with tracks
+        if options.exist('tracks'):
+
+            #read tracks
+            track = options.getfieldvalue('tracks')
+            if all(isinstance(track, str)):
+                A = expread(track)
+                track = np.hstack((A.x.reshape(-1, ), A.y.reshape(-1, )))
+            else:
+                track = float(track)  #for some reason, it is of class "single"
+            if np.size(track, axis=1) == 2:
+                track = np.hstack((track, 3. * np.ones((size(track, axis=0), 1))))
+
+            #only keep those inside
+            flags = ContourToNodes(track[:, 0], track[:, 1], domainfile, 0)[0]
+            track = track[np.nonzero(flags), :]
+
+            #Add all points to bamg_geometry
+            nods = np.size(track, axis=0)
+            bamg_geometry.Vertices = np.vstack((bamg_geometry.Vertices, track))
+            bamg_geometry.Edges = np.vstack((bamg_geometry.Edges, np.hstack((np.arange(count + 1, count + nods).reshape(-1, ), np.arange(count + 2, count + nods + 1).reshape(-1, ), 3. * np.ones((nods - 1, 1))))))
+
+            #update counter
+            count += nods
+
+        #Deal with vertices that need to be kept by mesher
+        if options.exist('RequiredVertices'):
+
+            #recover RequiredVertices
+            requiredvertices = options.getfieldvalue('RequiredVertices')  #for some reason, it is of class "single"
+            if np.size(requiredvertices, axis=1) == 2:
+                requiredvertices = np.hstack((requiredvertices, 4. * np.ones((np.size(requiredvertices, axis=0), 1))))
+
+            #only keep those inside
+            flags = ContourToNodes(requiredvertices[:, 0], requiredvertices[:, 1], domainfile, 0)[0]
+            requiredvertices = requiredvertices[np.nonzero(flags)[0], :]
+            #Add all points to bamg_geometry
+            nods = np.size(requiredvertices, axis=0)
+            bamg_geometry.Vertices = np.vstack((bamg_geometry.Vertices, requiredvertices))
+
+            #update counter
+            count += nods
+
+    #process geom
+    #bamg_geometry = processgeometry(bamg_geometry, options.getfieldvalue('tol', float(nan)), domain[0])
+    elif isinstance(md.private.bamg, dict) and 'geometry' in md.private.bamg:
+        bamg_geometry = bamggeom(md.private.bamg['geometry'].__dict__)
+    else:
+        #do nothing...
+        pass
+    #}}}
+    # Bamg Mesh parameters {{{
+    if not options.exist('domain') and md.mesh.numberofvertices and m.strcmp(md.mesh.elementtype(), 'Tria'):
+        if isinstance(md.private.bamg, dict) and 'mesh' in md.private.bamg:
+            bamg_mesh = bamgmesh(md.private.bamg['mesh'].__dict__)
+        else:
+            bamg_mesh.Vertices = np.vstack((md.mesh.x, md.mesh.y, np.ones((md.mesh.numberofvertices)))).T
+            #bamg_mesh.Vertices = np.hstack((md.mesh.x.reshape(-1, ), md.mesh.y.reshape(-1, ), np.ones((md.mesh.numberofvertices, 1))))
+            bamg_mesh.Triangles = np.hstack((md.mesh.elements, np.ones((md.mesh.numberofelements, 1))))
+
+        if isinstance(md.rifts.riftstruct, dict):
+            raise TypeError("bamg error message: rifts not supported yet. Do meshprocessrift AFTER bamg")
+    #}}}
+    # 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['err'] = options.getfieldvalue('err', np.array([[0.01]]))
+    bamg_options['errg'] = options.getfieldvalue('errg', 0.1)
+    bamg_options['field'] = options.getfieldvalue('field', np.empty((0, 1)))
+    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['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['metric'] = options.getfieldvalue('metric', np.empty((0, 1)))
+    bamg_options['Metrictype'] = options.getfieldvalue('Metrictype', 0)
+    bamg_options['nbjacobi'] = options.getfieldvalue('nbjacobi', 1)
+    bamg_options['nbsmooth'] = options.getfieldvalue('nbsmooth', 3)
+    bamg_options['omega'] = options.getfieldvalue('omega', 1.8)
+    bamg_options['power'] = options.getfieldvalue('power', 1.)
+    bamg_options['splitcorners'] = options.getfieldvalue('splitcorners', 1)
+    bamg_options['verbose'] = options.getfieldvalue('verbose', 1)
+    #}}}
+
+    #call Bamg
+    bamgmesh_out, bamggeom_out = BamgMesher(bamg_mesh.__dict__, bamg_geometry.__dict__, bamg_options)
+
+    # plug results onto model
+    if options.getfieldvalue('vertical', 0):
+        md.mesh = mesh2dvertical()
+        md.mesh.x = bamgmesh_out['Vertices'][:, 0].copy()
+        md.mesh.y = bamgmesh_out['Vertices'][:, 1].copy()
+        md.mesh.elements = bamgmesh_out['Triangles'][:, 0:3].astype(int)
+        md.mesh.edges = bamgmesh_out['IssmEdges'].astype(int)
+        md.mesh.segments = bamgmesh_out['IssmSegments'][:, 0:3].astype(int)
+        md.mesh.segmentmarkers = bamgmesh_out['IssmSegments'][:, 3].astype(int)
+
+        #Fill in rest of fields:
+        md.mesh.numberofelements = np.size(md.mesh.elements, axis=0)
+        md.mesh.numberofvertices = np.size(md.mesh.x)
+        md.mesh.numberofedges = np.size(md.mesh.edges, axis=0)
+        md.mesh.vertexonboundary = np.zeros(md.mesh.numberofvertices, bool)
+        md.mesh.vertexonboundary[md.mesh.segments[:, 0:2] - 1] = True
+
+        #Now, build the connectivity tables for this mesh. Doubled in matlab for some reason
+        md.mesh.vertexonboundary = np.zeros(md.mesh.numberofvertices, )
+        md.mesh.vertexonboundary[md.mesh.segments[:, 0:2] - 1] = 1
+
+    elif options.getfieldvalue('3dsurface', 0):
+        md.mesh = mesh3dsurface()
+        md.mesh.x = bamgmesh_out['Vertices'][:, 0].copy()
+        md.mesh.y = bamgmesh_out['Vertices'][:, 1].copy()
+        md.mesh.z = md.mesh.x
+        md.mesh.z[:] = 0
+        md.mesh.elements = bamgmesh_out['Triangles'][:, 0:3].astype(int)
+        md.mesh.edges = bamgmesh_out['IssmEdges'].astype(int)
+        md.mesh.segments = bamgmesh_out['IssmSegments'][:, 0:3].astype(int)
+        md.mesh.segmentmarkers = bamgmesh_out['IssmSegments'][:, 3].astype(int)
+
+        #Fill in rest of fields:
+        md.mesh.numberofelements = np.size(md.mesh.elements, axis=0)
+        md.mesh.numberofvertices = np.size(md.mesh.x)
+        md.mesh.numberofedges = np.size(md.mesh.edges, axis=0)
+        md.mesh.vertexonboundary = np.zeros(md.mesh.numberofvertices, bool)
+        md.mesh.vertexonboundary[md.mesh.segments[:, 0:2] - 1] = True
+
+    else:
+        md.mesh = mesh2d()
+        md.mesh.x = bamgmesh_out['Vertices'][:, 0].copy()
+        md.mesh.y = bamgmesh_out['Vertices'][:, 1].copy()
+        md.mesh.elements = bamgmesh_out['Triangles'][:, 0:3].astype(int)
+        md.mesh.edges = bamgmesh_out['IssmEdges'].astype(int)
+        md.mesh.segments = bamgmesh_out['IssmSegments'][:, 0:3].astype(int)
+        md.mesh.segmentmarkers = bamgmesh_out['IssmSegments'][:, 3].astype(int)
+
+        #Fill in rest of fields:
+        md.mesh.numberofelements = np.size(md.mesh.elements, axis=0)
+        md.mesh.numberofvertices = np.size(md.mesh.x)
+        md.mesh.numberofedges = np.size(md.mesh.edges, axis=0)
+        md.mesh.vertexonboundary = np.zeros(md.mesh.numberofvertices, bool)
+        md.mesh.vertexonboundary[md.mesh.segments[:, 0:2] - 1] = True
+
+    #Bamg private fields
+    md.private.bamg = OrderedDict()
+    md.private.bamg['mesh'] = bamgmesh(bamgmesh_out)
+    md.private.bamg['geometry'] = bamggeom(bamggeom_out)
+    md.mesh.elementconnectivity = md.private.bamg['mesh'].ElementConnectivity
+    md.mesh.elementconnectivity[np.nonzero(np.isnan(md.mesh.elementconnectivity))] = 0
+    md.mesh.elementconnectivity = md.mesh.elementconnectivity.astype(int)
+
+    #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")
+
+    return md
+
+
+def processgeometry(geom, tol, outline):  # {{{
+    raise RuntimeError("bamg.py / processgeometry is not complete.")
+    #Deal with edges
+    print("Checking Edge crossing...")
+    i = 0
+    while (i < np.size(geom.Edges, axis=0)):
+        #edge counter
+        i += 1
+
+        #Get coordinates
+        x1 = geom.Vertices[geom.Edges[i, 0], 0]
+        y1 = geom.Vertices[geom.Edges[i, 0], 1]
+        x2 = geom.Vertices[geom.Edges[i, 1], 0]
+        y2 = geom.Vertices[geom.Edges[i, 1], 1]
+        color1 = geom.Edges[i, 2]
+
+        j = i  #test edges located AFTER i only
+        while (j < np.size(geom.Edges, axis=0)):
+            #edge counter
+            j += 1
+
+            #Skip if the two edges already have a vertex in common
+            if any(m.ismember(geom.Edges[i, 0:2], geom.Edges[j, 0:2])):
+                continue
+
+            #Get coordinates
+            x3 = geom.Vertices[geom.Edges[j, 0], 0]
+            y3 = geom.Vertices[geom.Edges[j, 0], 1]
+            x4 = geom.Vertices[geom.Edges[j, 1], 0]
+            y4 = geom.Vertices[geom.Edges[j, 1], 1]
+            color2 = geom.Edges[j, 2]
+
+            #Check if the two edges are crossing one another
+            if SegIntersect(np.array([[x1, y1], [x2, y2]]), np.array([[x3, y3], [x4, y4]])):
+
+                #Get coordinate of intersection point (http://mathworld.wolfram.com/Line-LineIntersection.html)
+                x = np.linalg.det(np.array([np.linalg.det(np.array([[x1, y1], [x2, y2]])), x1 - x2], [np.linalg.det(np.array([[x3, y3], [x4, y4]])), x3 - x4]) / np.linalg.det(np.array([[x1 - x2, y1 - y2], [x3 - x4, y3 - y4]])))
+                y = np.linalg.det(np.array([np.linalg.det(np.array([[x1, y1], [x2, y2]])), y1 - y2], [np.linalg.det(np.array([[x3, y3], [x4, y4]])), y3 - y4]) / np.linalg.det(np.array([[x1 - x2, y1 - y2], [x3 - x4, y3 - y4]])))
+
+                #Add vertex to the list of vertices
+                geom.Vertices = np.vstack((geom.Vertices, [x, y, min(color1, color2)]))
+                id = np.size(geom.Vertices, axis=0)
+
+                #Update edges i and j
+                edgei = geom.Edges[i, :].copy()
+                edgej = geom.Edges[j, :].copy()
+                geom.Edges[i, :] = [edgei(0), id, edgei(2)]
+                geom.Edges = np.vstack((geom.Edges, [id, edgei(1), edgei(2)]))
+                geom.Edges[j, :] = [edgej(0), id, edgej(2)]
+                geom.Edges = np.vstack((geom.Edges, [id, edgej(1), edgej(2)]))
+
+                #update current edge second tip
+                x2 = x
+                y2 = y
+
+    #Check point outside
+    print("Checking for points outside the domain...")
+    i = 0
+    num = 0
+    while (i < np.size(geom.Vertices, axis=0)):
+        #vertex counter
+        i += 1
+
+        #Get coordinates
+        x = geom.Vertices[i, 0]
+        y = geom.Vertices[i, 1]
+        color = geom.Vertices[i, 2]
+
+        #Check that the point is inside the domain
+        if color != 1 and not ContourToNodes(x, y, outline[0], 1):
+            #Remove points from list of Vertices
+            num += 1
+            geom.Vertices[i, :] = []
+
+            #update edges
+            posedges = np.nonzero(geom.Edges == i)
+            geom.Edges[posedges[0], :] = []
+            posedges = np.nonzero(geom.Edges > i)
+            geom.Edges[posedges] = geom.Edges[posedges] - 1
+
+            #update counter
+            i -= 1
+
+    if num:
+        print(("WARNING: %d points outside the domain outline have been removed" % num))
+
+    """
+    %Check point spacing
+    if ~isnan(tol),
+            disp('Checking point spacing...')
+            i = 0
+            while (i < size(geom.Vertices, 1)),
+
+                    %vertex counter
+                    i = i + 1
+
+                    %Get coordinates
+                    x1 = geom.Vertices(i, 1)
+                    y1 = geom.Vertices(i, 2)
+
+                    j = i; %test edges located AFTER i only
+                    while (j < size(geom.Vertices, 1)),
+
+                            %vertex counter
+                            j = j + 1
+
+                            %Get coordinates
+                            x2 = geom.Vertices(j, 1)
+                            y2 = geom.Vertices(j, 2)
+
+                            %Check whether the two vertices are too close
+                            if ((x2 - x1)**2 + (y2 - y1)**2 < tol**2)
+
+                                    %Remove points from list of Vertices
+                                    geom.Vertices(j, :) = []
+
+                                    %update edges
+                                    posedges = find(m.ismember(geom.Edges, j))
+                                    geom.Edges(posedges)=i
+                                    posedges = find(geom.Edges > j)
+                                    geom.Edges(posedges)=geom.Edges(posedges) - 1
+
+                                    %update counter
+                                    j = j - 1
+
+                            end
+                    end
+            end
+    end
+    %remove empty edges
+    geom.Edges(find(geom.Edges(:, 1) == geom.Edges(:, 2)), :) = []
+    """
+    return geom
+    # }}}
Index: /issm/trunk/src/m/mesh/bamgflowband.py
===================================================================
--- /issm/trunk/src/m/mesh/bamgflowband.py	(revision 24312)
+++ /issm/trunk/src/m/mesh/bamgflowband.py	(revision 24313)
@@ -1,3 +1,3 @@
-import numpy as  np
+import numpy as np
 from model import *
 from collections import OrderedDict
@@ -5,43 +5,44 @@
 from mesh2dvertical import *
 
-def bamgflowband(md,x,surf,base,*args):
-	"""
-	BAMGFLOWBAND - create flowband mesh with bamg
 
-	Usage:
-		md=bamgflowband(md,x,surf,base,OPTIONS)
+def bamgflowband(md, x, surf, base, *args):
+    """
+    BAMGFLOWBAND - create flowband mesh with bamg
 
-		surf and bed are the surface elevation and base for each x provided
-		x must be increasing
-		OPTIONS are bamg options
+    Usage:
+        md = bamgflowband(md, x, surf, base, OPTIONS)
 
-	Example:
-		x =np.arrange(1,3001,100)
-		h=linspace(1000,300,numel(x))
-		b=-917/1023*h
-		md=bamgflowband(model,b+h,b,'hmax',80,'vertical',1,'Markers',m)
-	"""
+        surf and bed are the surface elevation and base for each x provided
+        x must be increasing
+        OPTIONS are bamg options
 
-	#Write expfile with domain outline
-	A = OrderedDict()
-	A['x'] = np.concatenate((x,np.flipud(x),[x[0]]))
-	A['y'] = np.concatenate((base,np.flipud(surf),[base[0]]))
-	A['nods'] = np.size(A['x'])
+    Example:
+        x = np.arrange(1, 3001, 100)
+        h = linspace(1000, 300, numel(x))
+        b= -917 / 1023 * h
+        md = bamgflowband(model, b + h, b, 'hmax', 80, 'vertical', 1, 'Markers', m)
+    """
 
-	#markers:
-	m                          	= np.ones((np.size(A['x'])-1,))	# base        = 1
-	m[np.size(x) - 1]                	= 2			# right side  = 2
-	m[np.size(x):2 * np.size(x) - 1] 	= 3			# top surface = 3
-	m[2 * np.size(x) - 1]              	= 4			# left side   = 4
+    #Write expfile with domain outline
+    A = OrderedDict()
+    A['x'] = np.concatenate((x, np.flipud(x), [x[0]]))
+    A['y'] = np.concatenate((base, np.flipud(surf), [base[0]]))
+    A['nods'] = np.size(A['x'])
 
-	#mesh domain
-	md = bamg(model(),'domain',[A],'vertical',1,'Markers',m,*args)
-	#print md.mesh.numberofvertices
+    #markers:
+    m = np.ones((np.size(A['x']) - 1, ))  # base = 1
+    m[np.size(x) - 1] = 2  # right side = 2
+    m[np.size(x):2 * np.size(x) - 1] = 3  # top surface = 3
+    m[2 * np.size(x) - 1] = 4  # left side = 4
 
-	#Deal with vertices on bed
-	md.mesh.vertexonbase = np.zeros((md.mesh.numberofvertices,))
-	md.mesh.vertexonbase[np.where(md.mesh.vertexflags(1))] = 1
-	md.mesh.vertexonsurface = np.zeros((md.mesh.numberofvertices,))
-	md.mesh.vertexonsurface[np.where(md.mesh.vertexflags(3))] = 1
+    #mesh domain
+    md = bamg(model(), 'domain', [A], 'vertical', 1, 'Markers', m, *args)
+    #print md.mesh.numberofvertices
 
-	return md
+    #Deal with vertices on bed
+    md.mesh.vertexonbase = np.zeros((md.mesh.numberofvertices, ))
+    md.mesh.vertexonbase[np.where(md.mesh.vertexflags(1))] = 1
+    md.mesh.vertexonsurface = np.zeros((md.mesh.numberofvertices, ))
+    md.mesh.vertexonsurface[np.where(md.mesh.vertexflags(3))] = 1
+
+    return md
Index: /issm/trunk/src/m/mesh/meshconvert.py
===================================================================
--- /issm/trunk/src/m/mesh/meshconvert.py	(revision 24312)
+++ /issm/trunk/src/m/mesh/meshconvert.py	(revision 24313)
@@ -1,52 +1,52 @@
 import numpy as np
 from collections import OrderedDict
-from BamgConvertMesh import BamgConvertMesh 
-from mesh2d   import mesh2d
+from BamgConvertMesh import BamgConvertMesh
+from mesh2d import mesh2d
 from bamgmesh import bamgmesh
 from bamggeom import bamggeom
 
-def meshconvert(md,*args):
-	"""
-	CONVERTMESH - convert mesh to bamg mesh
 
-	   Usage:
-	      md=meshconvert(md);
-	      md=meshconvert(md,index,x,y);
-	"""
+def meshconvert(md, *args):
+    """
+    CONVERTMESH - convert mesh to bamg mesh
 
-	if not len(args)==0 and not len(args)==3:
-		raise TypeError("meshconvert error message: bad usage")
+       Usage:
+          md = meshconvert(md)
+          md = meshconvert(md, index, x, y)
+    """
 
-	if not len(args):
-		index = md.mesh.elements
-		x     = md.mesh.x
-		y     = md.mesh.y
-	else:
-		index = args[0]
-		x     = args[1]
-		y     = args[2]
+    if not len(args) == 0 and not len(args) == 3:
+        raise TypeError("meshconvert error message: bad usage")
 
-	#call Bamg
-	bamgmesh_out,bamggeom_out=BamgConvertMesh(index,x,y)
+    if not len(args):
+        index = md.mesh.elements
+        x = md.mesh.x
+        y = md.mesh.y
+    else:
+        index = args[0]
+        x = args[1]
+        y = args[2]
 
-	# plug results onto model
-	md.private.bamg             = OrderedDict()
-	md.private.bamg['mesh']     = bamgmesh(bamgmesh_out)
-	md.private.bamg['geometry'] = bamggeom(bamggeom_out)
-	md.mesh                     = mesh2d()
-	md.mesh.x                   = bamgmesh_out['Vertices'][:,0].copy()
-	md.mesh.y                   = bamgmesh_out['Vertices'][:,1].copy()
-	md.mesh.elements            = bamgmesh_out['Triangles'][:,0:3].astype(int)
-	md.mesh.edges               = bamgmesh_out['IssmEdges'].astype(int)
-	md.mesh.segments            = bamgmesh_out['IssmSegments'][:,0:3].astype(int)
-	md.mesh.segmentmarkers      = bamgmesh_out['IssmSegments'][:,3].astype(int)
+    #call Bamg
+    bamgmesh_out, bamggeom_out = BamgConvertMesh(index, x, y)
 
-	#Fill in rest of fields:
-	md.mesh.numberofelements   = np.size(md.mesh.elements,axis=0)
-	md.mesh.numberofvertices   = np.size(md.mesh.x)
-	md.mesh.numberofedges      = np.size(md.mesh.edges,axis=0)
-	md.mesh.vertexonboundary   = np.zeros(md.mesh.numberofvertices,bool)
-	md.mesh.vertexonboundary[md.mesh.segments[:,0:2]-1] = True
+    # plug results onto model
+    md.private.bamg = OrderedDict()
+    md.private.bamg['mesh'] = bamgmesh(bamgmesh_out)
+    md.private.bamg['geometry'] = bamggeom(bamggeom_out)
+    md.mesh = mesh2d()
+    md.mesh.x = bamgmesh_out['Vertices'][:, 0].copy()
+    md.mesh.y = bamgmesh_out['Vertices'][:, 1].copy()
+    md.mesh.elements = bamgmesh_out['Triangles'][:, 0:3].astype(int)
+    md.mesh.edges = bamgmesh_out['IssmEdges'].astype(int)
+    md.mesh.segments = bamgmesh_out['IssmSegments'][:, 0:3].astype(int)
+    md.mesh.segmentmarkers = bamgmesh_out['IssmSegments'][:, 3].astype(int)
 
-	return md
+    #Fill in rest of fields:
+    md.mesh.numberofelements = np.size(md.mesh.elements, axis=0)
+    md.mesh.numberofvertices = np.size(md.mesh.x)
+    md.mesh.numberofedges = np.size(md.mesh.edges, axis=0)
+    md.mesh.vertexonboundary = np.zeros(md.mesh.numberofvertices, bool)
+    md.mesh.vertexonboundary[md.mesh.segments[:, 0:2] - 1] = True
 
+    return md
Index: /issm/trunk/src/m/mesh/meshintersect3d.m
===================================================================
--- /issm/trunk/src/m/mesh/meshintersect3d.m	(revision 24312)
+++ /issm/trunk/src/m/mesh/meshintersect3d.m	(revision 24313)
@@ -9,5 +9,7 @@
 
 	%retrieve tolerance: 
-	tolerance=getfieldvalue(options,'tolerance',10);
+	maxtol=getfieldvalue(options,'maxtol',100000); %100 km.
+	tolincrement=getfieldvalue(options,'tolincrement',10);
+	force=getfieldvalue(options,'force',0);
 
 	%go through lats,longs and find within tolerance, the index of the corresponding value in lat,long: 
@@ -15,19 +17,69 @@
 	
 	for i=1:length(xs),
+		tolerance=0;
 		distance=sqrt((x-xs(i)).^2+(y-ys(i)).^2+(z-zs(i)).^2);
-		s=find(distance<tolerance);
-		if length(s)>1,
-			for j=1:length(s),
-				hold on;plot3(x(s(j)),y(s(j)),z(s(j)),'c.','MarkerSize',40)
+
+		s=find(distance==0); 
+		if ~isempty(s), 
+			if length(s)>1,
+
+				%we have two vertices that are coincident! Not good. 
+				for j=1:length(s),
+					hold on;plot3(x(s(j)),y(s(j)),z(s(j)),'c.','MarkerSize',40)
+				end
+				disp(['Vertex ' num2str(i) ' of input mesh coincides with vertices ' num2str(s) ' of output mesh']);
+				if force,
+					indices(i)=s(1);
+				else
+					error('');
+				end
+			else
+				indices(i)=s;
 			end
-			distance(s)
-			error(sprintf('one or more vertices on the global mesh were duplicated (offset %i)',i));
-		elseif isempty(s),
-			plot(distance);
-			min(distance);
-			i
-			error('cannot find concurrent vertics!');
-		else
-			indices(i)=s;
 		end
+
+		%we could not find a 0 distance, find the lowest tolerance that generates a find: 
+		count=1;
+		while isempty(s),
+			if count>1000,
+				disp(['could not find a vertex matching vertex ' num2str(i) ' of input mesh!']);
+				disp('Might think about changing tolerance increment');
+				error('');
+			end
+			tolerance=tolerance+tolincrement;
+			s=find(distance<tolerance);
+			count=count+1;
+		end
+		if tolerance>maxtol, 
+			disp(['found matching vertices ' num2str(s) ' in output mesh for input mesh vertex ' num2str(i) ]);
+			disp(' however, these vertices are farther that the max tolerance allowed!');
+			error('');
+		end
+
+		%recover minimum distance: 
+		sf=distance(s);
+		pos=find(sf==min(sf)); 
+		s=s(pos);
+		indices(i)=s;
 	end
+
+
+%		if length(s)>1,
+%			for j=1:length(s),
+%				hold on;plot3(x(s(j)),y(s(j)),z(s(j)),'c.','MarkerSize',40)
+%			end
+%			if force,
+%				indices(i)=s(1);
+%			else
+%				distance(s)
+%				error(sprintf('one or more vertices on the global mesh were duplicated (offset %i)',i));
+%			end
+%		elseif isempty(s),
+%			plot(distance);
+%			min(distance);
+%			i
+%			error('cannot find concurrent vertics!');
+%		else
+%			indices(i)=s;
+%		end
+
Index: /issm/trunk/src/m/mesh/modelmerge2d.m
===================================================================
--- /issm/trunk/src/m/mesh/modelmerge2d.m	(revision 24313)
+++ /issm/trunk/src/m/mesh/modelmerge2d.m	(revision 24313)
@@ -0,0 +1,178 @@
+function md=modelmerge2d(md1,md2,varargin)
+%MODELMERGE  - merge two models by merging their meshes
+%
+%   Usage:
+%      md=modelmerge(md1,md2);
+	
+	%process options: 
+	options=pairoptions(varargin{:});
+	
+	tolerance=getfieldvalue(options,'tolerance',10^-5);
+	
+	md=md1; %by default, we transfer all the settings from md1 to md.
+
+	%first ,copy md1 mesh into md.mesh to initialize: 
+	md.mesh=md1.mesh;
+
+	%some initializatoin: 
+	elements1=md1.mesh.elements;
+	x1=md1.mesh.x;
+	y1=md1.mesh.y;
+	nods1=md1.mesh.numberofvertices;
+	nel1=md1.mesh.numberofelements;
+
+	elements2=md2.mesh.elements;
+	x2=md2.mesh.x;
+	y2=md2.mesh.y;
+	nods2=md2.mesh.numberofvertices;
+	nel2=md2.mesh.numberofelements;
+	segs2=md2.mesh.segments;
+
+	%offset elements2 by nods1: 
+	elements2=elements2+nods1;
+
+	%go into the vertices on boundary of mesh 1, and figure out which ones are common to mesh2: 
+	verticesonboundary=find(md1.mesh.vertexonboundary); 
+	for i=1:length(verticesonboundary),
+		node1=verticesonboundary(i); xnode1=x1(node1); ynode1=y1(node1);
+		%is there another node with these coordinates in mesh2? 
+		ind=find(sqrt(((x2-xnode1).^2+(y2-ynode1).^2))<tolerance);
+		if ~isempty(ind),
+			x2(ind)=NaN;
+			y2(ind)=NaN;
+			pos=find(elements2==(ind+nods1)); elements2(pos)=node1;
+		end
+	end
+
+	%go through elements2 and drop counter on each vertex that is above the x2 and y2 vertices being dropped: 
+	while( ~isempty(find(isnan(x2)))),
+		for i=1:length(x2),
+			if isnan(x2(i)),
+				pos=find(elements2>(i+nods1));
+				elements2(pos)=elements2(pos)-1;
+				x2(i)=[];
+				y2(i)=[];
+				break;
+			end
+		end
+	end
+
+	%merge elements: 
+	elements=[elements1;elements2];
+
+	%merge vertices: 
+	x=[x1;x2]; 
+	y=[y1;y2];
+
+	%output: 
+	md.mesh.x=x;
+	md.mesh.y=y;
+	md.mesh.elements=elements;
+	md.mesh.numberofvertices=length(x);
+	md.mesh.numberofelements=size(elements,1);
+
+	%connectivities: 
+	md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+	md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+
+	%find segments: 
+	md.mesh.segments=findsegments(md);
+
+	%vertex on boundary: 
+	md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1);
+	md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
+
+	if getfieldvalue(options,'full',0),
+		%we are asked to merge the classes fields too. We need have vertex and element mappings first: 
+		%vertex intersections:
+		md.mesh.extractedvertices={meshintersect(x,y,md1.mesh.x,md1.mesh.y,'tolerance',1e-5), meshintersect(x,y,md2.mesh.x,md2.mesh.y,'tolerance',1e-5)};
+		%element intersections:
+		xe=x(md.mesh.elements)*[1;1;1]/3; ye=y(md.mesh.elements)*[1;1;1]/3;
+		x1e=md1.mesh.x(md1.mesh.elements)*[1;1;1]/3; y1e=md1.mesh.y(md1.mesh.elements)*[1;1;1]/3;
+		x2e=md2.mesh.x(md2.mesh.elements)*[1;1;1]/3; y2e=md2.mesh.y(md2.mesh.elements)*[1;1;1]/3;
+		md.mesh.extractedelements= {meshintersect(xe,ye,x1e,y1e,'tolerance',1e-5) , meshintersect(xe,ye,x2e,y2e,'tolerance',1e-5)};
+
+		%now we can go through classes and transfer.
+		md=transfer_fields(md,md1,md2,'geometry',{'thickness','surface','bed','base'});
+		md=transfer_fields(md,md1,md2,'mask',{'groundedice_levelset','ice_levelset','ocean_levelset','land_levelset','glacier_levelset'});
+		md=transfer_fields(md,md1,md2,'smb',{'mass_balance'});
+		if strcmpi(class(md1.basalforcings),'linearbasalforcings'),
+			md=transfer_fields(md,md1,md2,'basalforcings',{'groundedice_melting_rate','geothermalflux'});
+		else
+			md=transfer_fields(md,md1,md2,'basalforcings',{'groundedice_melting_rate','deepwater_melting_rate','deepwater_elevation','upperwater_elevation','geothermalflux'});
+		end
+		md=transfer_fields(md,md1,md2,'materials',{'rheology_B','rheology_n'});
+		md=transfer_fields(md,md1,md2,'friction',{'coefficient','p','q'});
+		md=transfer_fields(md,md1,md2,'flowequation',{'vertex_equation','element_equation','borderSSA','borderFS','borderHO'});
+		md=transfer_fields(md,md1,md2,'initialization',{'vx','vy','vz','vel','pressure','temperature'});
+		md=transfer_fields(md,md1,md2,'slr',{'deltathickness','sealevel','spcthickness','steric_rate'});
+		md=transfer_fields(md,md1,md2,'masstransport',{'spcthickness'});
+		md=transfer_fields(md,md1,md2,'thermal',{'spctemperature'});
+		md=transfer_fields(md,md1,md2,'inversion',{'min_parameters','max_parameters','vx_obs','vy_obs','vz_obs'});
+		md.inversion.cost_functions_coefficients=zeros(md.mesh.numberofvertices,3);
+		md.inversion.cost_functions_coefficients(md.mesh.extractedvertices{1},:)=md1.inversion.cost_functions_coefficients;
+		md.inversion.cost_functions_coefficients(md.mesh.extractedvertices{2},:)=md2.inversion.cost_functions_coefficients;
+
+		%boundary conditions: 
+		md=transfer_fields(md,md1,md2,'stressbalance',{'spcvx','spcvy','spcvz'});
+		md.stressbalance.loadingforce=zeros(md.mesh.numberofvertices,3);
+		md.stressbalance.referential=NaN*ones(md.mesh.numberofvertices,6);
+		bound1=zeros(md.mesh.numberofvertices,1); bound1(md.mesh.extractedvertices{1})=md1.mesh.vertexonboundary;
+		bound2=zeros(md.mesh.numberofvertices,1); bound2(md.mesh.extractedvertices{2})=md2.mesh.vertexonboundary;
+		boundary=bound1 & bound2;
+		
+		%identify corners between both basins
+		ends=[];
+		for i=1:length(pos),
+			v=pos(i); [indi,indj]=find(md.mesh.elements==v); 
+			conn=unique(md.mesh.elements(indi,:));
+			if (sum(boundary(conn))==2),
+				ends(end+1)=v;
+			end
+		end
+		boundary(ends)=0; %exclude these ends from the boundary that is going to become neumann.
+		pos=find(boundary); md.stressbalance.spcvx(pos)=NaN; md.stressbalance.spcvy(pos)=NaN; md.stressbalance.spcvz(pos)=NaN;
+
+	end
+
+	
+	%some checks: 
+	if max(md.mesh.elements)>md.mesh.numberofvertices, 
+		error('issue in modelmerge, one of the element ids is > number of vertices!');
+	end
+
+end %end of function
+
+function prop=transfer_vertices(md,md1,md2,field1,field2) % {{{
+	f1=getfield(md1,field1); f2=getfield(f1,field2); 
+	if length(f2)==md1.mesh.numberofvertices,
+		prop=zeros(md.mesh.numberofvertices,1); 
+		prop(md.mesh.extractedvertices{1})=f2;
+		f1=getfield(md2,field1); f2=getfield(f1,field2); prop(md.mesh.extractedvertices{2})=f2;
+	else
+		prop=zeros(md.mesh.numberofvertices+1,1);  prop(end)=f2(end);
+		prop(md.mesh.extractedvertices{1})=f2(1:end-1);
+		f1=getfield(md2,field1); f2=getfield(f1,field2); prop(md.mesh.extractedvertices{2})=f2(1:end-1);
+		prop=zeros(md.mesh.numberofvertices+1,1); 
+	end
+	
+	
+end %end of function %}}}
+function prop=transfer_elements(md,md1,md2,field1,field2) % {{{
+	prop=zeros(md.mesh.numberofelements,1); 
+	f1=getfield(md1,field1); f2=getfield(f1,field2); prop(md.mesh.extractedelements{1})=f2;
+	f1=getfield(md2,field1); f2=getfield(f1,field2); prop(md.mesh.extractedelements{2})=f2;
+
+end %end of function %}}}
+function md=transfer_fields(md,md1,md2,classname,classfields) % {{{
+
+	for i=1:length(classfields),
+		field1=eval(['md1.' classname '.' classfields{i}]); 
+		if length(field1)==md1.mesh.numberofvertices | length(field1)==md1.mesh.numberofvertices+1,
+			eval(['md.' classname '.' classfields{i} '=transfer_vertices(md,md1,md2,''' classname ''',''' classfields{i} ''');']);
+		else
+			eval(['md.' classname '.' classfields{i} '=transfer_elements(md,md1,md2,''' classname ''',''' classfields{i} ''');']);
+		end
+	end
+
+end %end of function %}}}
Index: /issm/trunk/src/m/mesh/modelmerge3d.m
===================================================================
--- /issm/trunk/src/m/mesh/modelmerge3d.m	(revision 24313)
+++ /issm/trunk/src/m/mesh/modelmerge3d.m	(revision 24313)
@@ -0,0 +1,97 @@
+function md=modelmerge3d(md1,md2,varargin)
+%MODELMERGE  - merge two models by merging their meshes
+%
+%   Usage:
+%      md=modelmerge(md1,md2);
+	
+	%process options: 
+	options=pairoptions(varargin{:});
+	
+	tolerance=getfieldvalue(options,'tolerance',10^-5);
+	
+	md=model();md.mask=maskpsl();
+
+	%first ,copy md1 mesh into md.mesh to initialize, and additional classes:
+	md.mesh=md1.mesh;
+	md.private=md1.private;
+
+	%some initializatoin: 
+	elements1=md1.mesh.elements;
+	x1=md1.mesh.x;
+	y1=md1.mesh.y;
+	z1=md1.mesh.z;
+	nods1=md1.mesh.numberofvertices;
+	nel1=md1.mesh.numberofelements;
+
+	elements2=md2.mesh.elements;
+	x2=md2.mesh.x;
+	y2=md2.mesh.y;
+	z2=md2.mesh.z;
+	nods2=md2.mesh.numberofvertices;
+	nel2=md2.mesh.numberofelements;
+
+	%offset elements2 by nods1: 
+	elements2=elements2+nods1;
+
+	%go into the vertices on boundary of mesh 1, and figure out which ones are common to mesh2: 
+	verticesonboundary=find(md1.mesh.vertexonboundary); 
+	for i=1:length(verticesonboundary),
+		node1=verticesonboundary(i); xnode1=x1(node1); ynode1=y1(node1); znode1=z1(node1);
+		%is there another node with these coordinates in mesh2? 
+		ind=find(sqrt(((x2-xnode1).^2+(y2-ynode1).^2)+(z2-znode1).^2)<tolerance);
+		if length(ind)>1,
+			disp('should reduce the tolerance, several vertices picked up!');
+		end
+		if ~isempty(ind),
+			x2(ind)=NaN;
+			y2(ind)=NaN;
+			z2(ind)=NaN;
+			pos=find(elements2==(ind+nods1)); elements2(pos)=node1;
+		end
+	end
+
+	%go through elements2 and drop counter on each vertex that is above the x2 and y2 vertices being dropped: 
+	while( ~isempty(find(isnan(x2)))),
+		for i=1:length(x2),
+			if isnan(x2(i)),
+				pos=find(elements2>(i+nods1));
+				elements2(pos)=elements2(pos)-1;
+				x2(i)=[];
+				y2(i)=[];
+				z2(i)=[];
+				break;
+			end
+		end
+	end
+
+	%merge elements: 
+	elements=[elements1;elements2];
+
+	%merge vertices: 
+	x=[x1;x2]; 
+	y=[y1;y2];
+	z=[z1;z2];
+
+	%output: 
+	md.mesh.x=x;
+	md.mesh.y=y;
+	md.mesh.z=z;
+	md.mesh.elements=elements;
+	md.mesh.numberofvertices=length(x);
+	md.mesh.numberofelements=size(elements,1);
+
+	%connectivities: 
+	md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices);
+	md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity);
+
+	%find segments: 
+	md.mesh.segments=findsegments(md);
+
+	%vertex on boundary: 
+	md.mesh.vertexonboundary=zeros(md.mesh.numberofvertices,1);
+	md.mesh.vertexonboundary(md.mesh.segments(:,1:2))=1;
+
+	%some checks: 
+	if max(md.mesh.elements)>md.mesh.numberofvertices, 
+		error('issue in modelmerge, one of the element ids is > number of vertices!');
+	end
Index: /issm/trunk/src/m/mesh/planet/gmsh/gmshplanet.py
===================================================================
--- /issm/trunk/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 24312)
+++ /issm/trunk/src/m/mesh/planet/gmsh/gmshplanet.py	(revision 24313)
@@ -6,166 +6,166 @@
 import subprocess
 
-def gmshplanet(*varargin):
-#GMSHPLANET - mesh generation for a sphere. Very specific code for gmsh. From demo/sphere.geo
-#
-#   Available options (for more details see ISSM website http://issm.jpl.nasa.gov/):
-#
-#   - radius:             radius of the planet in km
-#   - resolution:         resolution in km
-#   - refine:             provide mesh
-#   - refinemetric:       mesh quantity to specify resolution
-#
-#   Returns 'mesh3dsurface' type mesh
-#
-#   Examples:
-#      md.mesh=gmshplanet('radius',6000,'resolution',100);
-#      md.mesh=gmshplanet('radius',6000,'resolution',100);
 
-	#process options
-	options=pairoptions(*varargin)
-	#options=deleteduplicates(options,1)
+def gmshplanet(* varargin):
+    #GMSHPLANET - mesh generation for a sphere. Very specific code for gmsh. From demo/sphere.geo
+    #
+    #   Available options (for more details see ISSM website http://issm.jpl.nasa.gov/):
+    #
+    # - radius:             radius of the planet in km
+    # - resolution:         resolution in km
+    # - refine:             provide mesh
+    # - refinemetric:       mesh quantity to specify resolution
+    #
+    #   Returns 'mesh3dsurface' type mesh
+    #
+    #   Examples:
+    #      md.mesh = gmshplanet('radius', 6000, 'resolution', 100);
+    #      md.mesh = gmshplanet('radius', 6000, 'resolution', 100);
 
-	#recover parameters:
-	radius=options.getfieldvalue('radius')*1000
-	resolution=options.getfieldvalue('resolution')*1000
+    #process options
+    options = pairoptions(* varargin)
+    #options = deleteduplicates(options, 1)
 
-	#initialize mesh: 
-	mesh=mesh3dsurface()
+    #recover parameters:
+    radius = options.getfieldvalue('radius') * 1000
+    resolution = options.getfieldvalue('resolution') * 1000
 
-	#create .geo file:  {{{
-	fid=open('sphere.geo','w')
+    #initialize mesh:
+    mesh = mesh3dsurface()
 
-	fid.write('Mesh.Algorithm = 1;\n')
-	if options.exist('refine'):
-		fid.write('Mesh.Algorithm = 7;\n')
-		fid.write('Mesh.CharacteristicLengthFromPoints= 0;\n')
-		fid.write('Mesh.SmoothRatio= 3;\n')
-		fid.write('Mesh.RemeshAlgorithm= 1;\n')
-	fid.write('resolution=%g;\n'%resolution)
-	fid.write('radius=%g;\n'%radius)
-	fid.write('Point(1) = {0.0,0.0,0.0,resolution};\n')
-	fid.write('Point(2) = {radius,0.0,0.0,resolution};\n')
-	fid.write('Point(3) = {0,radius,0.0,resolution};\n')
-	fid.write('Circle(1) = {2,1,3};\n')
-	fid.write('Point(4) = {-radius,0,0.0,resolution};\n')
-	fid.write('Point(5) = {0,-radius,0.0,resolution};\n')
-	fid.write('Circle(2) = {3,1,4};\n')
-	fid.write('Circle(3) = {4,1,5};\n')
-	fid.write('Circle(4) = {5,1,2};\n')
-	fid.write('Point(6) = {0,0,-radius,resolution};\n')
-	fid.write('Point(7) = {0,0,radius,resolution};\n')
-	fid.write('Circle(5) = {3,1,6};\n')
-	fid.write('Circle(6) = {6,1,5};\n')
-	fid.write('Circle(7) = {5,1,7};\n')
-	fid.write('Circle(8) = {7,1,3};\n')
-	fid.write('Circle(9) = {2,1,7};\n')
-	fid.write('Circle(10) = {7,1,4};\n')
-	fid.write('Circle(11) = {4,1,6};\n')
-	fid.write('Circle(12) = {6,1,2};\n')
-	fid.write('Line Loop(13) = {2,8,-10};\n')
-	fid.write('Surface(14) = {13};\n')
-	fid.write('Line Loop(15) = {10,3,7};\n')
-	fid.write('Surface(16) = {15};\n')
-	fid.write('Line Loop(17) = {-8,-9,1};\n')
-	fid.write('Surface(18) = {17};\n')
-	fid.write('Line Loop(19) = {-11,-2,5};\n')
-	fid.write('Surface(20) = {19};\n')
-	fid.write('Line Loop(21) = {-5,-12,-1};\n')
-	fid.write('Surface(22) = {21};\n')
-	fid.write('Line Loop(23) = {-3,11,6};\n')
-	fid.write('Surface(24) = {23};\n')
-	fid.write('Line Loop(25) = {-7,4,9};\n')
-	fid.write('Surface(26) = {25};\n')
-	fid.write('Line Loop(27) = {-4,12,-6};\n')
-	fid.write('Surface(28) = {27};\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 Volume(2) = 30;\n')
-	fid.close()
-	#}}}
+    #create .geo file:  {{{
+    fid = open('sphere.geo', 'w')
 
-	if options.exist('refine'):
-		meshini=options.getfieldvalue('refine')
-		metric=options.getfieldvalue('refinemetric')
+    fid.write('Mesh.Algorithm = 1;\n')
+    if options.exist('refine'):
+        fid.write('Mesh.Algorithm = 7;\n')
+        fid.write('Mesh.CharacteristicLengthFromPoints = 0;\n')
+        fid.write('Mesh.SmoothRatio = 3;\n')
+        fid.write('Mesh.RemeshAlgorithm = 1;\n')
+    fid.write('resolution = %g;\n' % resolution)
+    fid.write('radius = %g;\n' % radius)
+    fid.write('Point(1) = {0.0, 0.0, 0.0, resolution};\n')
+    fid.write('Point(2) = {radius, 0.0, 0.0, resolution};\n')
+    fid.write('Point(3) = {0, radius, 0.0, resolution};\n')
+    fid.write('Circle(1) = {2, 1, 3};\n')
+    fid.write('Point(4) = { -radius, 0, 0.0, resolution};\n')
+    fid.write('Point(5) = {0, -radius, 0.0, resolution};\n')
+    fid.write('Circle(2) = {3, 1, 4};\n')
+    fid.write('Circle(3) = {4, 1, 5};\n')
+    fid.write('Circle(4) = {5, 1, 2};\n')
+    fid.write('Point(6) = {0, 0, -radius, resolution};\n')
+    fid.write('Point(7) = {0, 0, radius, resolution};\n')
+    fid.write('Circle(5) = {3, 1, 6};\n')
+    fid.write('Circle(6) = {6, 1, 5};\n')
+    fid.write('Circle(7) = {5, 1, 7};\n')
+    fid.write('Circle(8) = {7, 1, 3};\n')
+    fid.write('Circle(9) = {2, 1, 7};\n')
+    fid.write('Circle(10) = {7, 1, 4};\n')
+    fid.write('Circle(11) = {4, 1, 6};\n')
+    fid.write('Circle(12) = {6, 1, 2};\n')
+    fid.write('Line Loop(13) = {2, 8, -10};\n')
+    fid.write('Surface(14) = {13};\n')
+    fid.write('Line Loop(15) = {10, 3, 7};\n')
+    fid.write('Surface(16) = {15};\n')
+    fid.write('Line Loop(17) = { -8, -9, 1};\n')
+    fid.write('Surface(18) = {17};\n')
+    fid.write('Line Loop(19) = { -11, -2, 5};\n')
+    fid.write('Surface(20) = {19};\n')
+    fid.write('Line Loop(21) = { -5, -12, -1};\n')
+    fid.write('Surface(22) = {21};\n')
+    fid.write('Line Loop(23) = { -3, 11, 6};\n')
+    fid.write('Surface(24) = {23};\n')
+    fid.write('Line Loop(25) = { -7, 4, 9};\n')
+    fid.write('Surface(26) = {25};\n')
+    fid.write('Line Loop(27) = { -4, 12, -6};\n')
+    fid.write('Surface(28) = {27};\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 Volume(2) = 30;\n')
+    fid.close()
+    #}}}
 
-		#create .pos file with existing mesh and refining metric:  {{{
-		fid=open('sphere.pos','w')
+    if options.exist('refine'):
+        meshini = options.getfieldvalue('refine')
+        metric = options.getfieldvalue('refinemetric')
 
-		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.close()
-		# }}}
+    #create .pos file with existing mesh and refining metric:  {{{
+        fid = open('sphere.pos', 'w')
 
-	#call gmsh
-	if options.exist('refine'):
-		subprocess.call('gmsh -tol 1e-8 -2 sphere.geo -bgm sphere.pos',shell=True)
-	else:
-		#call gmsh
-		subprocess.call('gmsh -tol 1e-8 -2 sphere.geo',shell=True)
+        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.close()
+    # }}}
 
-	#import mesh:  {{{
-	fid=open('sphere.msh','r')
+    #call gmsh
+    if options.exist('refine'):
+        subprocess.call('gmsh -tol 1e-8 -2 sphere.geo -bgm sphere.pos', shell=True)
+    else:
+        #call gmsh
+        subprocess.call('gmsh -tol 1e-8 -2 sphere.geo', shell=True)
 
-	#Get Mesh format
-	A=fid.readline().strip()
-	if not strcmp(A,'$MeshFormat'):
-		raise RuntimeError(['Expecting $MeshFormat (', A, ')'])
+    #import mesh:  {{{
+    fid = open('sphere.msh', 'r')
 
-	A=fid.readline().split()
-	A=fid.readline().strip()
-	if not strcmp(A,'$EndMeshFormat'):
-		raise RuntimeError(['Expecting $EndMeshFormat (', A, ')'])
+    #Get Mesh format
+    A = fid.readline().strip()
+    if not strcmp(A, '$MeshFormat'):
+        raise RuntimeError(['Expecting $MeshFormat (', A, ')'])
 
-	#Nodes
-	A=fid.readline().strip()
-	if not strcmp(A,'$Nodes'):
-		raise RuntimeError(['Expecting $Nodes (', A, ')'])
+    A = fid.readline().split()
+    A = fid.readline().strip()
+    if not strcmp(A, '$EndMeshFormat'):
+        raise RuntimeError(['Expecting $EndMeshFormat (', A, ')'])
 
-	mesh.numberofvertices=int(fid.readline().strip())
-	mesh.x=np.empty(mesh.numberofvertices)
-	mesh.y=np.empty(mesh.numberofvertices)
-	mesh.z=np.empty(mesh.numberofvertices)
-	for i in range(mesh.numberofvertices):
-		A=fid.readline().split()
-		mesh.x[i]=float(A[1])
-		mesh.y[i]=float(A[2])
-		mesh.z[i]=float(A[3])
+    #Nodes
+    A = fid.readline().strip()
+    if not strcmp(A, '$Nodes'):
+        raise RuntimeError(['Expecting $Nodes (', A, ')'])
 
-	A=fid.readline().strip()
-	if not strcmp(A,'$EndNodes'):
-		raise RuntimeError(['Expecting $EndNodes (', A, ')'])
+    mesh.numberofvertices = int(fid.readline().strip())
+    mesh.x = np.empty(mesh.numberofvertices)
+    mesh.y = np.empty(mesh.numberofvertices)
+    mesh.z = np.empty(mesh.numberofvertices)
+    for i in range(mesh.numberofvertices):
+        A = fid.readline().split()
+        mesh.x[i] = float(A[1])
+        mesh.y[i] = float(A[2])
+        mesh.z[i] = float(A[3])
 
-	#Elements
-	A=fid.readline().strip()
-	if not strcmp(A,'$Elements'):
-		raise RuntimeError(['Expecting $Elements (', A, ')'])
-	mesh.numberofelements=int(fid.readline().strip())
-	mesh.elements=np.zeros([mesh.numberofelements,3])
-	for i in range(mesh.numberofelements):
-		A=fid.readline().split()
-		mesh.elements[i]=[int(A[5]),int(A[6]),int(A[7])]
-	mesh.elements=mesh.elements.astype(int)
-	A=fid.readline().strip()
-	if not strcmp(A,'$EndElements'):
-		raise RuntimeError(['Expecting $EndElements (', A, ')'])
-	fid.close() 
-	#}}}
+    A = fid.readline().strip()
+    if not strcmp(A, '$EndNodes'):
+        raise RuntimeError(['Expecting $EndNodes (', A, ')'])
 
-	#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
+    #Elements
+    A = fid.readline().strip()
+    if not strcmp(A, '$Elements'):
+        raise RuntimeError(['Expecting $Elements (', A, ')'])
+    mesh.numberofelements = int(fid.readline().strip())
+    mesh.elements = np.zeros([mesh.numberofelements, 3])
+    for i in range(mesh.numberofelements):
+        A = fid.readline().split()
+        mesh.elements[i] = [int(A[5]), int(A[6]), int(A[7])]
+    mesh.elements = mesh.elements.astype(int)
+    A = fid.readline().strip()
+    if not strcmp(A, '$EndElements'):
+        raise RuntimeError(['Expecting $EndElements (', A, ')'])
+    fid.close()
+    #}}}
 
-	#erase files: 
-	subprocess.call('rm -rf sphere.geo sphere.msh sphere.pos',shell=True)
+    #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
 
-	#return mesh: 
-	return mesh
+    #erase files:
+    subprocess.call('rm -rf sphere.geo sphere.msh sphere.pos', shell=True)
+
+    #return mesh:
+    return mesh
Index: /issm/trunk/src/m/mesh/rifts/meshaddrifts.m
===================================================================
--- /issm/trunk/src/m/mesh/rifts/meshaddrifts.m	(revision 24312)
+++ /issm/trunk/src/m/mesh/rifts/meshaddrifts.m	(revision 24313)
@@ -13,5 +13,5 @@
 
 %read rift: 
-domains=expread(riftname,1);
+domains=expread(riftname);
 contours=domains(1:2:end);
 rifts=domains(2:2:end);
Index: /issm/trunk/src/m/mesh/rifts/meshprocessoutsiderifts.py
===================================================================
--- /issm/trunk/src/m/mesh/rifts/meshprocessoutsiderifts.py	(revision 24312)
+++ /issm/trunk/src/m/mesh/rifts/meshprocessoutsiderifts.py	(revision 24313)
@@ -2,103 +2,104 @@
 from ElementsFromEdge import ElementsFromEdge
 import MatlabFuncs as m
+from ContourToMesh import ContourToMesh
 
-def meshprocessoutsiderifts(md,domainoutline):
-	"""
-	MESHPROCESSOUTSIDERIFTS - process rifts when they touch the domain outline
 
-	   Usage:
-	      md=meshprocessoutsiderifts(md,domain)
+def meshprocessoutsiderifts(md, domainoutline):
+    """
+    MESHPROCESSOUTSIDERIFTS - process rifts when they touch the domain outline
 
-	"""
+       Usage:
+          md = meshprocessoutsiderifts(md, domain)
 
-	#go through rifts, and figure out which ones touch the domain outline
-	for rift in md.rifts.riftstruct:
-	
-		#first, flag nodes that belong to the domain outline
-		flags=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,domainoutline,'node',0)
+    """
 
-		tips=rift.tips
-		outsidetips=tips[np.nonzero(flags[rift.tips-1])[0]]
+    #go through rifts, and figure out which ones touch the domain outline
+    for rift in md.rifts.riftstruct:
 
-		#we have found outsidetips, tips that touch the domain outline. go through them
-		for tip in outsidetips:
-		
-			#find tip in the segments, take first segment (there should be 2) that holds tip, 
-			#and node_connected_to_tip is the other node on this segment:
-			tipindex=np.nonzero(rift.segments[:,0]==tip)[0]
-			if tipindex:
-				tipindex=tipindex[0]
-				node_connected_to_tip=rift.segments[tipindex,1]
-			else:
-				tipindex=np.nonzero(rift.segments[:,1]==tip)[0]
-				tipindex=tipindex[0]
-				node_connected_to_tip=rift.segments[tipindex,1]
+        #first, flag nodes that belong to the domain outline
+        flags = ContourToMesh(md.mesh.elements, md.mesh.x, md.mesh.y, domainoutline, 'node', 0)
 
-			#ok, we have the tip node, and the first node connected to it, on the rift. Now, 
-			#identify all the elements that are connected to the tip, and that are on the same 
-			#side of the rift.
-			A=tip
-			B=node_connected_to_tip
+        tips = rift.tips
+        outsidetips = tips[np.nonzero(flags[rift.tips - 1])[0]]
 
-			elements=np.empty(0,int)
+        #we have found outsidetips, tips that touch the domain outline. go through them
+        for tip in outsidetips:
+            #find tip in the segments, take first segment (there should be 2) that holds tip,
+            #and node_connected_to_tip is the other node on this segment:
+            tipindex = np.nonzero(rift.segments[:, 0] == tip)[0]
+            if tipindex:
+                tipindex = tipindex[0]
+                node_connected_to_tip = rift.segments[tipindex, 1]
+            else:
+                tipindex = np.nonzero(rift.segments[:, 1] == tip)[0]
+                tipindex = tipindex[0]
+                node_connected_to_tip = rift.segments[tipindex, 1]
 
-			while flags(B):    #as long as B does not belong to the domain outline, keep looking.
-				#detect elements on edge A,B:
-				edgeelements=ElementsFromEdge(md.mesh.elements,A,B)
-				#rule out those we already detected
-				already_detected=m.ismember(edgeelements,elements)
-				nextelement=edgeelements(np.nonzero(np.logical_not(already_detected))[0])
-				#add new detected element to the list of elements we are looking for.
-				elements=np.concatenate((elements,nextelement))
-				#new B:
-				B=md.mesh.elements[nextelement-1,np.nonzero(np.logical_not(m.ismember(md.mesh.elements[nextelement-1,:],np.array([A,B]))))]
-		
-			#take the list of elements on one side of the rift that connect to the tip, 
-			#and duplicate the tip on them, so as to open the rift to the outside.
-			num=np.size(md.mesh.x)+1
-			md.mesh.x=np.concatenate((md.mesh.x,md.mesh.x[tip]))
-			md.mesh.y=np.concatenate((md.mesh.y,md.mesh.y[tip]))
-			md.mesh.numberofvertices=num
-		
-			#replace tip in elements
-			newelements=md.mesh.elements[elements-1,:]
-			pos=np.nonzero(newelements==tip)
-			newelements[pos]=num
-			md.mesh.elements[elements-1,:]=newelements
-			rift.tips=np.concatenate((rift.tips,num))
+            #ok, we have the tip node, and the first node connected to it, on the rift. Now,
+            #identify all the elements that are connected to the tip, and that are on the same
+            #side of the rift.
+            A = tip
+            B = node_connected_to_tip
 
-			#deal with segments
-			tipsegments=np.nonzero(np.logical_or(md.mesh.segments[:,0]==tip,md.mesh.segments[:,1]==tip))[0]
-			for segment_index in tipsegments:
-				pos=np.nonzero(md.mesh.segments[segment_index,0:2]!=tip)[0]
-				other_node=md.mesh.segments[segment_index,pos]
-				if not isconnected(md.mesh.elements,other_node,tip):
-					pos=np.nonzero(md.mesh.segments[segment_index,0:2]==tip)[0]
-					md.mesh.segments[segment_index,pos]=num
+            elements = np.empty(0, int)
 
-	#Fill in rest of fields:
-	md.mesh.numberofelements=np.size(md.mesh.elements,axis=0)
-	md.mesh.numberofvertices=np.size(md.mesh.x)
-	md.mesh.vertexonboundary=np.zeros(np.size(md.mesh.x),bool)
-	md.mesh.vertexonboundary[md.mesh.segments[:,0:2]-1]=True
-	md.rifts.numrifts=length(md.rifts.riftstruct)
+            while flags(B):  #as long as B does not belong to the domain outline, keep looking.
+                #detect elements on edge A, B:
+                edgeelements = ElementsFromEdge(md.mesh.elements, A, B)
+                #rule out those we already detected
+                already_detected = m.ismember(edgeelements, elements)
+                nextelement = edgeelements(np.nonzero(np.logical_not(already_detected))[0])
+                #add new detected element to the list of elements we are looking for.
+                elements = np.concatenate((elements, nextelement))
+                #new B:
+                B = md.mesh.elements[nextelement - 1, np.nonzero(np.logical_not(m.ismember(md.mesh.elements[nextelement - 1, :], np.array([A, B]))))]
 
-	return md
+            #take the list of elements on one side of the rift that connect to the tip,
+            #and duplicate the tip on them, so as to open the rift to the outside.
+            num = np.size(md.mesh.x) + 1
+            md.mesh.x = np.concatenate((md.mesh.x, md.mesh.x[tip]))
+            md.mesh.y = np.concatenate((md.mesh.y, md.mesh.y[tip]))
+            md.mesh.numberofvertices = num
 
-def isconnected(elements,A,B):    # {{{
-	"""
-	ISCONNECTED: are two nodes connected by a triangulation?
+            #replace tip in elements
+            newelements = md.mesh.elements[elements - 1, :]
+            pos = np.nonzero(newelements == tip)
+            newelements[pos] = num
+            md.mesh.elements[elements - 1, :] = newelements
+            rift.tips = np.concatenate((rift.tips, num))
 
-	   Usage: flag=isconnected(elements,A,B)
+            #deal with segments
+            tipsegments = np.nonzero(np.logical_or(md.mesh.segments[:, 0] == tip, md.mesh.segments[:, 1] == tip))[0]
+            for segment_index in tipsegments:
+                pos = np.nonzero(md.mesh.segments[segment_index, 0:2] != tip)[0]
+                other_node = md.mesh.segments[segment_index, pos]
+                if not isconnected(md.mesh.elements, other_node, tip):
+                    pos = np.nonzero(md.mesh.segments[segment_index, 0:2] == tip)[0]
+                    md.mesh.segments[segment_index, pos] = num
 
-	"""
+    #Fill in rest of fields:
+    md.mesh.numberofelements = np.size(md.mesh.elements, axis=0)
+    md.mesh.numberofvertices = np.size(md.mesh.x)
+    md.mesh.vertexonboundary = np.zeros(np.size(md.mesh.x), bool)
+    md.mesh.vertexonboundary[md.mesh.segments[:, 0:2] - 1] = True
+    md.rifts.numrifts = np.length(md.rifts.riftstruct)
 
-	elements=ElementsFromEdge(elements,A,B)
-	if not elements:
-		flag=0
-	else:
-		flag=1
+    return md
 
-	return flag
-	# }}}
 
+def isconnected(elements, A, B):  # {{{
+    """
+    ISCONNECTED: are two nodes connected by a triangulation?
+
+       Usage: flag = isconnected(elements, A, B)
+
+    """
+
+    elements = ElementsFromEdge(elements, A, B)
+    if not elements:
+        flag = 0
+    else:
+        flag = 1
+
+    return flag
+    # }}}
Index: /issm/trunk/src/m/mesh/rifts/meshprocessrifts.py
===================================================================
--- /issm/trunk/src/m/mesh/rifts/meshprocessrifts.py	(revision 24312)
+++ /issm/trunk/src/m/mesh/rifts/meshprocessrifts.py	(revision 24313)
@@ -5,60 +5,59 @@
 from GetAreas import GetAreas
 
-def meshprocessrifts(md,domainoutline):
-	"""
-	MESHPROCESSRIFTS - process mesh when rifts are present
 
-	   split rifts inside mesh (rifts are defined by presence of
-	   segments inside the domain outline)
-	   if domain outline is provided, check for rifts that could touch it, and open them up.
+def meshprocessrifts(md, domainoutline):
+    """
+    MESHPROCESSRIFTS - process mesh when rifts are present
 
-	   Usage:
-	      md=meshprocessrifts(md,domainoutline)
+       split rifts inside mesh (rifts are defined by presence of
+       segments inside the domain outline)
+       if domain outline is provided, check for rifts that could touch it, and open them up.
 
-	   Ex: 
-	      md=meshprocessrifts(md,'DomainOutline.exp');
-	
-	"""
+       Usage:
+          md = meshprocessrifts(md, domainoutline)
 
-	#Call MEX file
-	md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.segments,md.mesh.segmentmarkers,md.rifts.riftstruct=ProcessRifts(md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.segments,md.mesh.segmentmarkers)
-	md.mesh.elements=md.mesh.elements.astype(int)
-	md.mesh.x=md.mesh.x.reshape(-1)
-	md.mesh.y=md.mesh.y.reshape(-1)
-	md.mesh.segments=md.mesh.segments.astype(int)
-	md.mesh.segmentmarkers=md.mesh.segmentmarkers.astype(int)
-	if not isinstance(md.rifts.riftstruct,list) or not md.rifts.riftstruct:
-		raise RuntimeError("ProcessRifts did not find any rift")
+       Ex:
+          md = meshprocessrifts(md, 'DomainOutline.exp')
 
-	#Fill in rest of fields:
-	numrifts=len(md.rifts.riftstruct)
-	md.mesh.numberofelements=np.size(md.mesh.elements,axis=0)
-	md.mesh.numberofvertices=np.size(md.mesh.x)
-	md.mesh.vertexonboundary=np.zeros(np.size(md.mesh.x),bool)
-	md.mesh.vertexonboundary[md.mesh.segments[:,0:2]-1]=True
+    """
 
-	#get coordinates of rift tips
-	for rift in md.rifts.riftstruct:
-		rift['tip1coordinates']=np.hstack((md.mesh.x[rift['tips'][0,0].astype(int)-1].reshape(-1,),md.mesh.y[rift['tips'][0,0].astype(int)-1].reshape(-1,)))
-		rift['tip2coordinates']=np.hstack((md.mesh.x[rift['tips'][0,1].astype(int)-1].reshape(-1,),md.mesh.y[rift['tips'][0,1].astype(int)-1].reshape(-1,)))
+    #Call MEX file
+    md.mesh.elements, md.mesh.x, md.mesh.y, md.mesh.segments, md.mesh.segmentmarkers, md.rifts.riftstruct = ProcessRifts(md.mesh.elements, md.mesh.x, md.mesh.y, md.mesh.segments, md.mesh.segmentmarkers)
+    md.mesh.elements = md.mesh.elements.astype(int)
+    md.mesh.x = md.mesh.x.reshape(-1)
+    md.mesh.y = md.mesh.y.reshape(-1)
+    md.mesh.segments = md.mesh.segments.astype(int)
+    md.mesh.segmentmarkers = md.mesh.segmentmarkers.astype(int)
+    if not isinstance(md.rifts.riftstruct, list) or not md.rifts.riftstruct:
+        raise RuntimeError("ProcessRifts did not find any rift")
 
-	#In case we have rifts that open up the domain outline, we need to open them: 
-	flags=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,domainoutline,'node',0)
-	found=0
-	for rift in md.rifts.riftstruct:
-		if flags[rift['tips'][0,0].astype(int)-1]==0:
-			found=1
-			break
-		if flags[rift['tips'][0,1].astype(int)-1]==0:
-			found=1
-			break
-	if found:
-		md=meshprocessoutsiderifts(md,domainoutline)
+    #Fill in rest of fields:
+    md.mesh.numberofelements = np.size(md.mesh.elements, axis=0)
+    md.mesh.numberofvertices = np.size(md.mesh.x)
+    md.mesh.vertexonboundary = np.zeros(np.size(md.mesh.x), bool)
+    md.mesh.vertexonboundary[md.mesh.segments[:, 0:2] - 1] = True
 
-	#get elements that are not correctly oriented in the correct direction:
-	aires=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y)
-	pos=np.nonzero(aires<0)[0]
-	md.mesh.elements[pos,:]=np.vstack((md.mesh.elements[pos,1],md.mesh.elements[pos,0],md.mesh.elements[pos,2])).T
+    #get coordinates of rift tips
+    for rift in md.rifts.riftstruct:
+        rift['tip1coordinates'] = np.hstack((md.mesh.x[rift['tips'][0, 0].astype(int) - 1].reshape(-1, ), md.mesh.y[rift['tips'][0, 0].astype(int) - 1].reshape(-1, )))
+        rift['tip2coordinates'] = np.hstack((md.mesh.x[rift['tips'][0, 1].astype(int) - 1].reshape(-1, ), md.mesh.y[rift['tips'][0, 1].astype(int) - 1].reshape(-1, )))
 
-	return md
+    #In case we have rifts that open up the domain outline, we need to open them:
+    flags = ContourToMesh(md.mesh.elements, md.mesh.x, md.mesh.y, domainoutline, 'node', 0)
+    found = 0
+    for rift in md.rifts.riftstruct:
+        if flags[rift['tips'][0, 0].astype(int) - 1] == 0:
+            found = 1
+            break
+        if flags[rift['tips'][0, 1].astype(int) - 1] == 0:
+            found = 1
+            break
+    if found:
+        md = meshprocessoutsiderifts(md, domainoutline)
 
+    #get elements that are not correctly oriented in the correct direction:
+    aires = GetAreas(md.mesh.elements, md.mesh.x, md.mesh.y)
+    pos = np.nonzero(aires < 0)[0]
+    md.mesh.elements[pos, :] = np.vstack((md.mesh.elements[pos, 1], md.mesh.elements[pos, 0], md.mesh.elements[pos, 2])).T
+
+    return md
Index: /issm/trunk/src/m/mesh/rifts/rifttipsrefine.m
===================================================================
--- /issm/trunk/src/m/mesh/rifts/rifttipsrefine.m	(revision 24312)
+++ /issm/trunk/src/m/mesh/rifts/rifttipsrefine.m	(revision 24313)
@@ -8,5 +8,5 @@
 
 %take rifts, and create refinement circles around tips
-rifts=expread(filename,1);
+rifts=expread(filename);
 
 !echo -n "" > Circles.exp
Index: /issm/trunk/src/m/mesh/roundmesh.py
===================================================================
--- /issm/trunk/src/m/mesh/roundmesh.py	(revision 24312)
+++ /issm/trunk/src/m/mesh/roundmesh.py	(revision 24313)
@@ -5,55 +5,53 @@
 from triangle import triangle
 
-def roundmesh(md,radius,resolution):
-	"""
-	ROUNDMESH - create an unstructured round mesh 
 
-	   This script will generate a structured round mesh
-	   - radius     : specifies the radius of the circle in meters
-	   - resolution : specifies the resolution in meters
+def roundmesh(md, radius, resolution):
+    """
+    ROUNDMESH - create an unstructured round mesh
 
-	   Usage:
-	      md=roundmesh(md,radius,resolution)
-	"""
+       This script will generate a structured round mesh
+ - radius     : specifies the radius of the circle in meters
+ - resolution : specifies the resolution in meters
 
-	#First we have to create the domain outline 
+       Usage:
+          md = roundmesh(md, radius, resolution)
+    """
 
-	#Get number of points on the circle
-	pointsonedge=np.floor((2.*np.pi*radius) / resolution)+1 #+1 to close the outline
+    #First we have to create the domain outline
 
-	#Calculate the cartesians coordinates of the points
-	theta=np.linspace(0.,2.*np.pi,pointsonedge)
-	x_list=roundsigfig(radius*np.cos(theta),12)
-	y_list=roundsigfig(radius*np.sin(theta),12)
-	A=OrderedDict()
-	A['x']=[x_list]
-	A['y']=[y_list]
-	A['density']=1.
-	expwrite(A,'RoundDomainOutline.exp')
+    #Get number of points on the circle
+    pointsonedge = np.floor((2. * np.pi * radius) / resolution) + 1  # + 1 to close the outline
 
-	#Call Bamg
-	md=triangle(md,'RoundDomainOutline.exp',resolution)
-	#md=bamg(md,'domain','RoundDomainOutline.exp','hmin',resolution)
+    #Calculate the cartesians coordinates of the points
+    theta = np.linspace(0., 2. * np.pi, pointsonedge)
+    x_list = roundsigfig(radius * np.cos(theta), 12)
+    y_list = roundsigfig(radius * np.sin(theta), 12)
+    A = OrderedDict()
+    A['x'] = [x_list]
+    A['y'] = [y_list]
+    A['density'] = 1.
+    expwrite(A, 'RoundDomainOutline.exp')
 
-	#move the closest node to the center
-	pos=np.argmin(md.mesh.x**2+md.mesh.y**2)
-	md.mesh.x[pos]=0.
-	md.mesh.y[pos]=0.
+    #Call Bamg
+    md = triangle(md, 'RoundDomainOutline.exp', resolution)
+    #md = bamg(md, 'domain', 'RoundDomainOutline.exp', 'hmin', resolution)
 
-	#delete domain
-	os.remove('RoundDomainOutline.exp')
+    #move the closest node to the center
+    pos = np.argmin(md.mesh.x**2 + md.mesh.y**2)
+    md.mesh.x[pos] = 0.
+    md.mesh.y[pos] = 0.
 
-	return md
+    #delete domain
+    os.remove('RoundDomainOutline.exp')
 
-def roundsigfig(x,n):
+    return md
 
-	digits=np.ceil(np.log10(np.abs(x)))
-	x=x/10.**digits
-	x=np.round(x,decimals=n)
-	x=x*10.**digits
 
-	pos=np.nonzero(np.isnan(x))
-	x[pos]=0.
+def roundsigfig(x, n):
 
-	return x
-
+    nonzeros = np.where(x != 0)
+    digits = np.ceil(np.log10(np.abs(x[nonzeros])))
+    x[nonzeros] = x[nonzeros] / 10.**digits
+    x[nonzeros] = np.round(x[nonzeros], decimals=n)
+    x[nonzeros] = x[nonzeros] * 10.**digits
+    return x
Index: /issm/trunk/src/m/mesh/squaremesh.py
===================================================================
--- /issm/trunk/src/m/mesh/squaremesh.py	(revision 24312)
+++ /issm/trunk/src/m/mesh/squaremesh.py	(revision 24313)
@@ -1,76 +1,77 @@
 import numpy as np
 from NodeConnectivity import NodeConnectivity
-from ElementConnectivity import ElementConnectivity 
+from ElementConnectivity import ElementConnectivity
 from mesh2d import mesh2d
 
-def squaremesh(md,Lx,Ly,nx,ny):
-	"""
-	SQUAREMESH - create a structured square mesh 
 
-	   This script will generate a structured square mesh
-	   Lx and Ly are the dimension of the domain (in meters)
-	   nx anx ny are the number of nodes in the x and y direction
-	   The coordinates x and y returned are in meters.
+def squaremesh(md, Lx, Ly, nx, ny):
+    """
+    SQUAREMESH - create a structured square mesh
 
-	   Usage:
-	      [md]=squaremesh(md,Lx,Ly,nx,ny)
-	"""
+       This script will generate a structured square mesh
+       Lx and Ly are the dimension of the domain (in meters)
+       nx anx ny are the number of nodes in the x and y direction
+       The coordinates x and y returned are in meters.
 
-	#get number of elements and number of nodes
-	nel=(nx-1)*(ny-1)*2
-	nods=nx*ny
+       Usage:
+          [md] = squaremesh(md, Lx, Ly, nx, ny)
+    """
 
-	#initialization
-	index=np.zeros((nel,3),int)
-	x=np.zeros((nx*ny))
-	y=np.zeros((nx*ny))
+    #get number of elements and number of nodes
+    nel = (nx - 1) * (ny - 1) * 2
+    nods = nx * ny
 
-	#create coordinates
-	for n in xrange(0,nx):
-		for m in xrange(0,ny):
-			x[n*ny+m]=float(n)
-			y[n*ny+m]=float(m)
+    #initialization
+    index = np.zeros((nel, 3), int)
+    x = np.zeros((nx * ny))
+    y = np.zeros((nx * ny))
 
-	#create index
-	for n in xrange(0,nx-1):
-		for m in xrange(0,ny-1):
-			A=n*ny+(m+1)
-			B=A+1
-			C=(n+1)*ny+(m+1)
-			D=C+1
-			index[n*(ny-1)*2+2*m,:]=[A,C,B]
-			index[n*(ny-1)*2+2*(m+1)-1,:]=[B,C,D]
+    #create coordinates
+    for n in range(0, nx):
+        for m in range(0, ny):
+            x[n * ny + m] = float(n)
+            y[n * ny + m] = float(m)
 
-	#Scale  x and y
-	x=x/np.max(x)*Lx
-	y=y/np.max(y)*Ly
+    #create index
+    for n in range(0, nx - 1):
+        for m in range(0, ny - 1):
+            A = n * ny + (m + 1)
+            B = A + 1
+            C = (n + 1) * ny + (m + 1)
+            D = C + 1
+            index[n * (ny - 1) * 2 + 2 * m, :] = [A, C, B]
+            index[n * (ny - 1) * 2 + 2 * (m + 1) - 1, :] = [B, C, D]
 
-	#create segments
-	segments=np.zeros((2*(nx-1)+2*(ny-1),3),int)
-	#left edge:
-	segments[0:ny-1,:]=np.vstack((np.arange(2,ny+1),np.arange(1,ny),(2*np.arange(1,ny)-1))).T
-	#right edge:
-	segments[ny-1:2*(ny-1),:]=np.vstack((np.arange(ny*(nx-1)+1,nx*ny),np.arange(ny*(nx-1)+2,nx*ny+1),2*np.arange((ny-1)*(nx-2)+1,(nx-1)*(ny-1)+1))).T
-	#front edge:
-	segments[2*(ny-1):2*(ny-1)+(nx-1),:]=np.vstack((np.arange(2*ny,ny*nx+1,ny),np.arange(ny,ny*(nx-1)+1,ny),np.arange(2*(ny-1),2*(nx-1)*(ny-1)+1,2*(ny-1)))).T
-	#back edge
-	segments[2*(ny-1)+(nx-1):2*(nx-1)+2*(ny-1),:]=np.vstack((np.arange(1,(nx-2)*ny+2,ny),np.arange(ny+1,ny*(nx-1)+2,ny),np.arange(1,2*(nx-2)*(ny-1)+2,2*(ny-1)))).T
+    #Scale  x and y
+    x = x / np.max(x) * Lx
+    y = y / np.max(y) * Ly
 
-	#plug coordinates and nodes
-	md.mesh=mesh2d()
-	md.mesh.x=x
-	md.mesh.y=y
-	md.mesh.numberofvertices=nods
-	md.mesh.vertexonboundary=np.zeros((nods),bool)
-	md.mesh.vertexonboundary[segments[:,0:2]-1]=True
+    #create segments
+    segments = np.zeros((2 * (nx - 1) + 2 * (ny - 1), 3), int)
+    #left edge:
+    segments[0:ny - 1, :] = np.vstack((np.arange(2, ny + 1), np.arange(1, ny), (2 * np.arange(1, ny) - 1))).T
+    #right edge:
+    segments[ny - 1:2 * (ny - 1), :] = np.vstack((np.arange(ny * (nx - 1) + 1, nx * ny), np.arange(ny * (nx - 1) + 2, nx * ny + 1), 2 * np.arange((ny - 1) * (nx - 2) + 1, (nx - 1) * (ny - 1) + 1))).T
+    #front edge:
+    segments[2 * (ny - 1):2 * (ny - 1) + (nx - 1), :] = np.vstack((np.arange(2 * ny, ny * nx + 1, ny), np.arange(ny, ny * (nx - 1) + 1, ny), np.arange(2 * (ny - 1), 2 * (nx - 1) * (ny - 1) + 1, 2 * (ny - 1)))).T
+    #back edge
+    segments[2 * (ny - 1) + (nx - 1):2 * (nx - 1) + 2 * (ny - 1), :] = np.vstack((np.arange(1, (nx - 2) * ny + 2, ny), np.arange(ny + 1, ny * (nx - 1) + 2, ny), np.arange(1, 2 * (nx - 2) * (ny - 1) + 2, 2 * (ny - 1)))).T
 
-	#plug elements
-	md.mesh.elements=index
-	md.mesh.segments=segments
-	md.mesh.numberofelements=nel
+    #plug coordinates and nodes
+    md.mesh = mesh2d()
+    md.mesh.x = x
+    md.mesh.y = y
+    md.mesh.numberofvertices = nods
+    md.mesh.vertexonboundary = np.zeros((nods), bool)
+    md.mesh.vertexonboundary[segments[:, 0:2] - 1] = True
 
-	#Now, build the connectivity tables for this mesh.
-	md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices)[0]
-	md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity)[0]
+    #plug elements
+    md.mesh.elements = index
+    md.mesh.segments = segments
+    md.mesh.numberofelements = nel
 
-	return md
+    #Now, build the connectivity tables for this mesh.
+    md.mesh.vertexconnectivity = NodeConnectivity(md.mesh.elements, md.mesh.numberofvertices)[0]
+    md.mesh.elementconnectivity = ElementConnectivity(md.mesh.elements, md.mesh.vertexconnectivity)[0]
+
+    return md
Index: /issm/trunk/src/m/mesh/triangle.py
===================================================================
--- /issm/trunk/src/m/mesh/triangle.py	(revision 24312)
+++ /issm/trunk/src/m/mesh/triangle.py	(revision 24313)
@@ -5,63 +5,66 @@
 from ElementConnectivity import ElementConnectivity
 from Triangle_python import Triangle_python
-import MatlabFuncs as m
 
-def triangle(md,domainname,*args):
-	"""
-	TRIANGLE - create model mesh using the triangle package
 
-	   This routine creates a model mesh using Triangle and a domain outline, to within a certain resolution
-	   where md is a @model object, domainname is the name of an Argus domain outline file, 
-	   and resolution is a characteristic length for the mesh (same unit as the domain outline
-	   unit). Riftname is an optional argument (Argus domain outline) describing rifts.
+def triangle(md, domainname, *args):
+    """
+    TRIANGLE - create model mesh using the triangle package
 
-	   Usage:
-	      md=triangle(md,domainname,resolution)
-	   or md=triangle(md,domainname, resolution, riftname)
+       This routine creates a model mesh using Triangle and a domain outline, to within a certain resolution
+       where md is a @model object, domainname is the name of an Argus domain outline file,
+       and resolution is a characteristic length for the mesh (same unit as the domain outline
+       unit). Riftname is an optional argument (Argus domain outline) describing rifts.
 
-	   Examples:
-	      md=triangle(md,'DomainOutline.exp',1000);
-	      md=triangle(md,'DomainOutline.exp',1000,'Rifts.exp');
-	"""
+       Usage:
+          md = triangle(md, domainname, resolution)
+       or md = triangle(md, domainname, resolution, riftname)
 
-	#Figure out a characteristic area. Resolution is a node oriented concept (ex a 1000m  resolution node would 
-	#be made of 1000*1000 area squares). 
+       Examples:
+          md = triangle(md, 'DomainOutline.exp', 1000)
+          md = triangle(md, 'DomainOutline.exp', 1000, 'Rifts.exp')
+    """
 
-	if len(args)==1:
-		resolution=args[0]
-		riftname=''
-	if len(args)==2:
-		riftname=args[0]
-		resolution=args[1]
+    #Figure out a characteristic area. Resolution is a node oriented concept (ex a 1000m  resolution node would
+    #be made of 1000 * 1000 area squares).
 
-	#Check that mesh was not already run, and warn user: 
-	if md.mesh.numberofelements:
-		choice = raw_input('This model already has a mesh. Are you sure you want to go ahead? (y/n)')
-		if not m.strcmp(choice,'y'):
-			print 'no meshing done ... exiting'
-			return None
+    if len(args) == 1:
+        resolution = args[0]
+        riftname = ''
+    if len(args) == 2:
+        riftname = args[0]
+        resolution = args[1]
 
-	area = resolution**2
+    #Check that mesh was not already run, and warn user:
+    if md.mesh.numberofelements:
+        choice = input('This model already has a mesh. Are you sure you want to go ahead? (y / n)')
+        if choice not in ['y', 'n']:
+            print("bad answer try you should use 'y' or 'n' ... exiting")
+            return None
+        if choice == 'n':
+            print('no meshing done ... exiting')
+            return None
 
-	#Check that file exist (this is a very very common mistake)
-	if not os.path.exists(domainname):
-		raise IOError("file '%s' not found" % domainname)
+    area = resolution**2
 
-	#Mesh using Triangle
-	md.mesh=mesh2d()
-	md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.segments,md.mesh.segmentmarkers=Triangle_python(domainname,riftname,area)
-	md.mesh.elements=md.mesh.elements.astype(int)
-	md.mesh.segments=md.mesh.segments.astype(int)
-	md.mesh.segmentmarkers=md.mesh.segmentmarkers.astype(int)
+    #Check that file exist (this is a very very common mistake)
+    if not os.path.exists(domainname):
+        raise IOError("file '%s' not found" % domainname)
 
-	#Fill in rest of fields:
-	md.mesh.numberofelements = np.size(md.mesh.elements,axis=0)
-	md.mesh.numberofvertices = np.size(md.mesh.x)
-	md.mesh.vertexonboundary = np.zeros(md.mesh.numberofvertices,bool)
-	md.mesh.vertexonboundary[md.mesh.segments[:,0:2]-1] = True
+    #Mesh using Triangle
+    md.mesh = mesh2d()
+    md.mesh.elements, md.mesh.x, md.mesh.y, md.mesh.segments, md.mesh.segmentmarkers = Triangle_python(domainname, riftname, area)
+    md.mesh.elements = md.mesh.elements.astype(int)
+    md.mesh.segments = md.mesh.segments.astype(int)
+    md.mesh.segmentmarkers = md.mesh.segmentmarkers.astype(int)
 
-	#Now, build the connectivity tables for this mesh.
-	md.mesh.vertexconnectivity = NodeConnectivity(md.mesh.elements, md.mesh.numberofvertices)[0]
-	md.mesh.elementconnectivity = ElementConnectivity(md.mesh.elements, md.mesh.vertexconnectivity)[0]
+    #Fill in rest of fields:
+    md.mesh.numberofelements = np.size(md.mesh.elements, axis=0)
+    md.mesh.numberofvertices = np.size(md.mesh.x)
+    md.mesh.vertexonboundary = np.zeros(md.mesh.numberofvertices, bool)
+    md.mesh.vertexonboundary[md.mesh.segments[:, 0:2] - 1] = True
 
-	return md
+    #Now, build the connectivity tables for this mesh.
+    md.mesh.vertexconnectivity = NodeConnectivity(md.mesh.elements, md.mesh.numberofvertices)[0]
+    md.mesh.elementconnectivity = ElementConnectivity(md.mesh.elements, md.mesh.vertexconnectivity)[0]
+
+    return md
Index: /issm/trunk/src/m/miscellaneous/MatlabFuncs.py
===================================================================
--- /issm/trunk/src/m/miscellaneous/MatlabFuncs.py	(revision 24312)
+++ /issm/trunk/src/m/miscellaneous/MatlabFuncs.py	(revision 24313)
@@ -1,106 +1,115 @@
 def oshostname():
-	import socket
+    import socket
 
-	return socket.gethostname()
+    return socket.gethostname()
+
 
 def ispc():
-	import platform
+    import platform
 
-	if 'Windows' in platform.system():
-		return True
-	else:
-		return False
+    if 'Windows' in platform.system():
+        return True
+    else:
+        return False
+
 
 def ismac():
-	import platform
+    import platform
 
-	if 'Darwin' in platform.system():
-		return True
-	else:
-		return False
+    if 'Darwin' in platform.system():
+        return True
+    else:
+        return False
 
-def strcmp(s1,s2):
 
-	if s1 == s2:
-		return True
-	else:
-		return False
+def strcmp(s1, s2):
 
-def strncmp(s1,s2,n):
+    if s1 == s2:
+        return True
+    else:
+        return False
 
-	if s1[0:n] == s2[0:n]:
-		return True
-	else:
-		return False
 
-def strcmpi(s1,s2):
+def strncmp(s1, s2, n):
 
-	if s1.lower() == s2.lower():
-		return True
-	else:
-		return False
+    if s1[0:n] == s2[0:n]:
+        return True
+    else:
+        return False
 
-def strncmpi(s1,s2,n):
 
-	if s1.lower()[0:n] == s2.lower()[0:n]:
-		return True
-	else:
-		return False
+def strcmpi(s1, s2):
 
-def ismember(a,s):
-	import numpy as np
+    if s1.lower() == s2.lower():
+        return True
+    else:
+        return False
 
-	if not isinstance(s,(tuple,list,dict,np.ndarray)):
-		s=[s]
 
-	if not isinstance(a,(tuple,list,dict,np.ndarray)):
-		a=[a]
+def strncmpi(s1, s2, n):
 
-	if not isinstance(a,np.ndarray):
-		b=[item in s for item in a]
+    if s1.lower()[0:n] == s2.lower()[0:n]:
+        return True
+    else:
+        return False
 
-	else:
-		if not isinstance(s,np.ndarray):
-			b=np.empty_like(a)
-			for i,item in enumerate(a.flat):
-				b.flat[i]=item in s
-		else:
-			b=np.in1d(a.flat,s.flat).reshape(a.shape)
 
-	return b
+def ismember(a, s):
+    import numpy as np
+
+    if not isinstance(s, (tuple, list, dict, np.ndarray)):
+        s = [s]
+
+    if not isinstance(a, (tuple, list, dict, np.ndarray)):
+        a = [a]
+
+    if not isinstance(a, np.ndarray):
+        b = [item in s for item in a]
+
+    else:
+        if not isinstance(s, np.ndarray):
+            b = np.empty_like(a)
+            for i, item in enumerate(a.flat):
+                b.flat[i] = item in s
+        else:
+            b = np.in1d(a.flat, s.flat).reshape(a.shape)
+
+    return b
+
 
 def det(a):
-	import numpy as np
 
-	if   a.shape==(1,):
-		return a[0]
-	elif a.shape==(1,1):
-		return a[0,0]
-	elif a.shape==(2,2):
-		return a[0,0]*a[1,1]-a[0,1]*a[1,0]
-	else:
-		raise TypeError("MatlabFunc.det only implemented for shape (2, 2), not for shape %s." % str(a.shape))
+    if a.shape == (1, ):
+        return a[0]
+    elif a.shape == (1, 1):
+        return a[0, 0]
+    elif a.shape == (2, 2):
+        return a[0, 0] * a[1, 1] - a[0, 1] * a[1, 0]
+    else:
+        raise TypeError("MatlabFunc.det only implemented for shape (2, 2), not for shape %s." % str(a.shape))
 
-def sparse(ivec,jvec,svec,m=0,n=0,nzmax=0):
-	import numpy as np
 
-	if not m:
-		m=np.max(ivec)
-	if not n:
-		n=np.max(jvec)
+def sparse(ivec, jvec, svec, m=0, n=0, nzmax=0):
+    import numpy as np
 
-	a=np.zeros((m,n))
+    if not m:
+        m = np.max(ivec)
+    if not n:
+        n = np.max(jvec)
 
-	for i,j,s in zip(ivec.reshape(-1,order='F'),jvec.reshape(-1,order='F'),svec.reshape(-1,order='F')):
-		a[i-1,j-1]+=s
+    a = np.zeros((m, n))
 
-	return a
+    for i, j, s in zip(ivec.reshape(-1, order='F'), jvec.reshape(-1, order='F'), svec.reshape(-1, order='F')):
+        a[i - 1, j - 1] += s
+
+    return a
+
 
 def heaviside(x):
-	import numpy as np
+    import numpy as np
 
-	y=np.zeros_like(x)
-	y[np.nonzero(x> 0.)]=1.
-	y[np.nonzero(x==0.)]=0.5
+    y = np.zeros_like(x)
+    y[np.nonzero(x > 0.)] = 1.
+    y[np.nonzero(x == 0.)] = 0.5
 
-	return y
+    return y
Index: /issm/trunk/src/m/miscellaneous/PythonFuncs.py
===================================================================
--- /issm/trunk/src/m/miscellaneous/PythonFuncs.py	(revision 24312)
+++ /issm/trunk/src/m/miscellaneous/PythonFuncs.py	(revision 24313)
@@ -1,24 +1,25 @@
 import numpy as np
 
-def logical_and_n(*arg):
-	
-	if len(arg):
-		result=arg[0]
-		for item in arg[1:]:
-			result=logical_and(result,item)
-		return result
 
-	else:
-		return None
+def logical_and_n(* arg):
 
-def logical_or_n(*arg):
-	
-	if len(arg):
-		result=arg[0]
-		for item in arg[1:]:
-			result=logical_or(result,item)
-		return result
+    if len(arg):
+        result = arg[0]
+        for item in arg[1:]:
+            result = np.logical_and(result, item)
+        return result
 
-	else:
-		return None
+    else:
+        return None
 
+
+def logical_or_n(* arg):
+
+    if len(arg):
+        result = arg[0]
+        for item in arg[1:]:
+            result = np.logical_or(result, item)
+        return result
+
+    else:
+        return None
Index: /issm/trunk/src/m/miscellaneous/fielddisplay.py
===================================================================
--- /issm/trunk/src/m/miscellaneous/fielddisplay.py	(revision 24312)
+++ /issm/trunk/src/m/miscellaneous/fielddisplay.py	(revision 24313)
@@ -1,140 +1,142 @@
-#Module import 
 import numpy as np
-from math import isnan
 import MatlabFuncs as m
 
-def fielddisplay(md,name,comment):
-	"""
-	FIELDDISPLAY - display model field
 
-	   Usage:
-	      fielddisplay(md,name,comment)
-	"""
+def fielddisplay(md, name, comment):
+    """
+    FIELDDISPLAY - display model field
 
-	#get field
-	field=getattr(md,name)
+       Usage:
+          fielddisplay(md, name, comment)
+    """
 
-	#disp corresponding line as a function of field type (offset set as 9 spaces)
-	return parsedisplay("         ",name,field,comment);
+    #get field
+    field = getattr(md, name)
 
-def parsedisplay(offset,name,field,comment):    # {{{ 
+    #disp corresponding line as a function of field type (offset set as 9 spaces)
+    return parsedisplay("         ", name, field, comment)
 
-	#string
-	if isinstance(field,(str,unicode)):
 
-		if len(field)>30:
-			string=displayunit(offset,name,"not displayed",comment)
-		else:
-			string=displayunit(offset,name,"'%s'" % field,comment)
+def parsedisplay(offset, name, field, comment):  # {{{
 
-	#numeric
-	elif isinstance(field,(int,long,float)):
-		string=displayunit(offset,name,str(field),comment) 
+    #string
+    if isinstance(field, str):
 
-	#matrix
-	elif isinstance(field,np.ndarray):
-		string=displayunit(offset,name,str(field.shape),comment)
+        if len(field) > 30:
+            string = displayunit(offset, name, "not displayed", comment)
+        else:
+            string = displayunit(offset, name, "'%s'" % field, comment)
 
-	#logical
-	elif isinstance(field,bool):
-		if field:
-			string=displayunit(offset,name,"True",comment)
-		else:
-			string=displayunit(offset,name,"False",comment)
-	
-	#dictionary
-	elif isinstance(field,dict):
-		string=dict_display(offset,name,field,comment)
+    #numeric
+    elif isinstance(field, (int, float)):
+        string = displayunit(offset, name, str(field), comment)
 
-	#list or tuple
-	elif isinstance(field,(list,tuple)):
-		string=list_display(offset,name,field,comment)
+    #matrix
+    elif isinstance(field, np.ndarray):
+        string = displayunit(offset, name, str(field.shape), comment)
 
-	#None
-	elif field is None:
-		string=displayunit(offset,name,"None",comment)
+    #logical
+    elif isinstance(field, bool):
+        if field:
+            string = displayunit(offset, name, "True", comment)
+        else:
+            string = displayunit(offset, name, "False", comment)
 
-	else:
-		string=displayunit(offset,name,"not displayed",comment)
-		
-	return string
-	# }}}
+    #dictionary
+    elif isinstance(field, dict):
+        string = dict_display(offset, name, field, comment)
 
-def dict_display(offset,name,field,comment):    # {{{
+    #list or tuple
+    elif isinstance(field, (list, tuple)):
+        string = list_display(offset, name, field, comment)
 
-	if field:
-		string =displayunit(offset,name,'{dictionary}',comment)+'\n'
-		offset+='   '
+    #None
+    elif field is None:
+        string = displayunit(offset, name, "None", comment)
 
-		for structure_field,sfield in field.iteritems():
-			string+=parsedisplay(offset,str(structure_field),sfield,'')+'\n'
+    else:
+        string = displayunit(offset, name, "not displayed", comment)
 
-		if string and string[-1]=='\n':
-			string=string[:-1]
+    return string
+    # }}}
 
-	else:
-		string=displayunit(offset,name,'N/A',comment)
 
-	return string
-	# }}}
+def dict_display(offset, name, field, comment):  # {{{
 
-def list_display(offset,name,field,comment):    # {{{
+    if field:
+        string = displayunit(offset, name, '{dictionary}', comment) + '\n'
+        offset += '   '
 
-	#initialization
-	if   isinstance(field,list):
-		sbeg='['
-		send=']'
-	elif isinstance(field,tuple):
-		sbeg='('
-		send=')'
-	string=sbeg
+        for structure_field, sfield in list(field.items()):
+            string += parsedisplay(offset, str(structure_field), sfield, '') + '\n'
 
-	#go through the cell and fill string
-	if len(field)<5:
-		for fieldi in field:
-			if   isinstance(fieldi,(str,unicode)):
-				string+="'%s'," % fieldi
-			elif isinstance(fieldi,(bool,int,long,float)):
-				string+="%s," % str(fieldi)
-			else:
-				string=sbeg
-				break
+        if string and string[-1] == '\n':
+            string = string[:-1]
 
-	if m.strcmp(string,sbeg):
-		string="%s%dx1%s" % (sbeg,len(field),send)
-	else:
-		string=string[:-1]+send
+    else:
+        string = displayunit(offset, name, 'N/A', comment)
 
-	#call displayunit
-	return displayunit(offset,name,string,comment)
-	# }}}
+    return string
+    # }}}
 
-def displayunit(offset,name,characterization,comment):    # {{{
 
-	#take care of name
-	if len(name)>23:
-		name="%s..." % name[:20]
-	
-	#take care of characterization
-	if m.strcmp(characterization,"''") or m.strcmp(characterization,'""') or m.strcmpi(characterization,'nan'):
-		characterization="N/A"
-	
-	if len(characterization)>15:
-		characterization="%s..." % characterization[:12]
-	
-	#print
-	if not comment:
-		string="%s%-23s: %-15s" % (offset,name,characterization)
-	else:
-		if   isinstance(comment,(str,unicode)):
-			string="%s%-23s: %-15s -- %s" % (offset,name,characterization,comment)
-		elif isinstance(comment,list):
-			string="%s%-23s: %-15s -- %s" % (offset,name,characterization,comment[0])
-			for commenti in comment:
-				string+="\n%s%-23s  %-15s    %s" % (offset,'','',commenti)
-		else:
-			raise RuntimeError("fielddisplay error message: format for comment not supported yet")
+def list_display(offset, name, field, comment):  # {{{
 
-	return string
-	# }}}
+    #initialization
+    if isinstance(field, list):
+        sbeg = '['
+        send = ']'
+    elif isinstance(field, tuple):
+        sbeg = '('
+        send = ')'
+    string = sbeg
 
+    #go through the cell and fill string
+    if len(field) < 5:
+        for fieldi in field:
+            if isinstance(fieldi, str):
+                string += "'%s', " % fieldi
+            elif isinstance(fieldi, (bool, int, float)):
+                string += "%s, " % str(fieldi)
+            else:
+                string = sbeg
+                break
+
+    if m.strcmp(string, sbeg):
+        string = "%s%dx1%s" % (sbeg, len(field), send)
+    else:
+        string = string[:-1] + send
+
+    #call displayunit
+    return displayunit(offset, name, string, comment)
+    # }}}
+
+
+def displayunit(offset, name, characterization, comment):  # {{{
+
+    #take care of name
+    if len(name) > 23:
+        name = "%s..." % name[:20]
+
+    #take care of characterization
+    if m.strcmp(characterization, "''") or m.strcmp(characterization, '""') or m.strcmpi(characterization, 'nan'):
+        characterization = "N / A"
+
+    if len(characterization) > 15:
+        characterization = "%s..." % characterization[:12]
+
+    #print
+    if not comment:
+        string = "%s% - 23s: % - 15s" % (offset, name, characterization)
+    else:
+        if isinstance(comment, str):
+            string = "%s% - 23s: % - 15s - -  %s" % (offset, name, characterization, comment)
+        elif isinstance(comment, list):
+            string = "%s% - 23s: % - 15s - -  %s" % (offset, name, characterization, comment[0])
+            for commenti in comment:
+                string += "\n%s% - 23s  % - 15s    %s" % (offset, '', '', commenti)
+        else:
+            raise RuntimeError("fielddisplay error message: format for comment not supported yet")
+
+    return string
+    # }}}
Index: /issm/trunk/src/m/miscellaneous/isnans.py
===================================================================
--- /issm/trunk/src/m/miscellaneous/isnans.py	(revision 24312)
+++ /issm/trunk/src/m/miscellaneous/isnans.py	(revision 24313)
@@ -1,18 +1,18 @@
 import numpy as np
 
+
 def isnans(array):
-	"""
-	ISNANS: figure out if an array is nan. wrapper to isnan from matlab which stupidly does not allow this test  for structures!
+    """
+    ISNANS: figure out if an array is nan. wrapper to isnan from matlab which stupidly does not allow this test  for structures!
 
-	   Usage:    isnans(array)
+       Usage:    isnans(array)
 
-	      See also : ISNAN 
-	"""
+          See also : ISNAN
+    """
 
-	if   isinstance(array,(tuple,list,dict)): 
-		returnvalue=0
-	else:
-		returnvalue=np.isnan(array)
+    if isinstance(array, (tuple, list, dict)):
+        returnvalue = 0
+    else:
+        returnvalue = np.isnan(array)
 
-	return returnvalue
-
+    return returnvalue
Index: /issm/trunk/src/m/miscellaneous/normfit_issm.py
===================================================================
--- /issm/trunk/src/m/miscellaneous/normfit_issm.py	(revision 24312)
+++ /issm/trunk/src/m/miscellaneous/normfit_issm.py	(revision 24313)
@@ -1,61 +1,53 @@
 import numpy as np
-
-from scipy.stats import chi2,t
-
-#
+from scipy.stats import chi2, t
 #  wrapper for normfit to avoid using the matlab statistics toolbox.
-#
-def normfit_issm(x,alpha=None):
-
-	if alpha == None:
-		alpha=0.05
-	
-
-	#  check for any NaN in any columns
-	if not np.isnan(x).any():
-
-		#  explicitly calculate the moments
-		muhat   =np.mean(x,0)
-		# numpy defaults to 0 delta degrees of freedom; matlab uses 1
-		sigmahat=np.std(x,0,ddof=1)
-		
-		# no way to ask this in python, assume 4 outputs
-		#if (nargout>2):
-		
-		prob=1.-alpha/2.
-
-		if (np.size(x,0) == 1):
-			# operate like matlab normfit, mean, std, etc.
-			n=np.size(x)
-		else:
-			n=np.size(x,0)
-			
-		muci    =np.zeros((2,np.size(muhat   )))
-		sigmaci =np.zeros((2,np.size(sigmahat)))
-
-		try:
-			muci[0,:]   =muhat-t.ppf(prob,n-1)*sigmahat/np.sqrt(n)
-			muci[1,:]   =muhat+t.ppf(prob,n-1)*sigmahat/np.sqrt(n)
-			sigmaci[0,:]=sigmahat*np.sqrt((n-1)/chi2.ppf(prob   ,n-1))
-			sigmaci[1,:]=sigmahat*np.sqrt((n-1)/chi2.ppf(1.-prob,n-1))
-		except:
-			muci[0,:]   =muhat
-			muci[1,:]   =muhat
-			sigmaci[0,:]=sigmahat
-			sigmaci[1,:]=sigmahat
-	else:
-		#  must loop over columns, since number of elements could be different
-		muhat   =np.zeros((1,np.size(x,1)))
-		sigmahat=np.zeros((1,np.size(x,1)))
-		muci    =np.zeros((2,np.size(x,1)))
-		sigmaci =np.zeros((2,np.size(x,1)))
-
-		#  remove any NaN and recursively call column
-		for j in range(np.shape(x,1)):
-			[muhat[j],sigmahat[j],muci[:,j],sigmaci[:,j]]=normfit_issm(x[not np.isnan(x[:,j]),j],alpha)
-
-	return [muhat,sigmahat,muci,sigmaci]
-		
-	
 
 
+def normfit_issm(x, alpha=None):
+
+    if alpha is None:
+        alpha = 0.05
+
+    #  check for any NaN in any columns
+    if not np.isnan(x).any():
+
+        #  explicitly calculate the moments
+        muhat = np.mean(x, 0)
+    # numpy defaults to 0 delta degrees of freedom; matlab uses 1
+        sigmahat = np.std(x, 0, ddof=1)
+
+    # no way to ask this in python, assume 4 outputs
+    #if (nargout > 2):
+        prob = 1. - alpha / 2.
+
+        if (np.size(x, 0) == 1):
+            # operate like matlab normfit, mean, std, etc.
+            n = np.size(x)
+        else:
+            n = np.size(x, 0)
+
+        muci = np.zeros((2, np.size(muhat)))
+        sigmaci = np.zeros((2, np.size(sigmahat)))
+
+        try:
+            muci[0, :] = muhat - t.ppf(prob, n - 1) * sigmahat / np.sqrt(n)
+            muci[1, :] = muhat + t.ppf(prob, n - 1) * sigmahat / np.sqrt(n)
+            sigmaci[0, :] = sigmahat * np.sqrt((n - 1) / chi2.ppf(prob, n - 1))
+            sigmaci[1, :] = sigmahat * np.sqrt((n - 1) / chi2.ppf(1. - prob, n - 1))
+        except:
+            muci[0, :] = muhat
+            muci[1, :] = muhat
+            sigmaci[0, :] = sigmahat
+            sigmaci[1, :] = sigmahat
+    else:
+        #  must loop over columns, since number of elements could be different
+        muhat = np.zeros((1, np.size(x, 1)))
+        sigmahat = np.zeros((1, np.size(x, 1)))
+        muci = np.zeros((2, np.size(x, 1)))
+        sigmaci = np.zeros((2, np.size(x, 1)))
+
+    #  remove any NaN and recursively call column
+        for j in range(np.shape(x, 1)):
+            [muhat[j], sigmahat[j], muci[:, j], sigmaci[:, j]] = normfit_issm(x[not np.isnan(x[:, j]), j], alpha)
+
+    return [muhat, sigmahat, muci, sigmaci]
Index: /issm/trunk/src/m/miscellaneous/parallelrange.py
===================================================================
--- /issm/trunk/src/m/miscellaneous/parallelrange.py	(revision 24312)
+++ /issm/trunk/src/m/miscellaneous/parallelrange.py	(revision 24313)
@@ -1,25 +1,24 @@
-#! /usr/bin/env python
-def parallelrange(rank,numprocs,globalsize):
-	"""
-	PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
- 
-	   Usage: 
-	      i1,i2=parallelrange(rank,numprocs,globalsize)
-	"""
+#!/usr/bin/env python
+def parallelrange(rank, numprocs, globalsize):
+    """
+    PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
 
-	#We use floor. we under distribute rows. The rows left are then redistributed, therefore resulting in a more even distribution.
-	num_local_rows=[int(globalsize/numprocs) for i in xrange(numprocs)]
+       Usage:
+          i1, i2 = parallelrange(rank, numprocs, globalsize)
+    """
 
-	#There may be some rows left. Distribute evenly.
-	row_rest=globalsize - numprocs*int(globalsize/numprocs)
+    #We use floor. we under distribute rows. The rows left are then redistributed, therefore resulting in a more even distribution.
+    num_local_rows = [int(globalsize / numprocs) for i in range(numprocs)]
 
-	for i in xrange(row_rest):
-		num_local_rows[i]=num_local_rows[i]+1
+    #There may be some rows left. Distribute evenly.
+    row_rest = globalsize - numprocs * int(globalsize / numprocs)
 
-	i1=0
-	for i in xrange(rank-1):
-		i1+=num_local_rows[i]
-	i2=i1+num_local_rows[rank-1]-1
+    for i in range(row_rest):
+        num_local_rows[i] = num_local_rows[i] + 1
 
-	return i1,i2
+    i1 = 0
+    for i in range(rank - 1):
+        i1 += num_local_rows[i]
+    i2 = i1 + num_local_rows[rank - 1] - 1
 
+    return i1, i2
Index: /issm/trunk/src/m/miscellaneous/prctile_issm.py
===================================================================
--- /issm/trunk/src/m/miscellaneous/prctile_issm.py	(revision 24312)
+++ /issm/trunk/src/m/miscellaneous/prctile_issm.py	(revision 24313)
@@ -2,64 +2,62 @@
 from scipy.interpolate import interp1d
 
-#
+
 #  wrapper for prctile to avoid using the matlab statistics toolbox.
-#
-def prctile_issm(x,p,dim):
+def prctile_issm(x, p, dim):
 
-	try:
-		raise RuntimeError('hello world')
+    try:
+        raise RuntimeError('hello world')
 
-		#numpy has no interpolation method that matches matlab's percentile function
-		#y = np.percentile(x,p,dim,interpolation='higher')
-	except:
-		if len(np.shape(x)) > 2:
-			raise RuntimeError('Number of dimensions #d not implemented.'+str(len(np.shape(x))))
+    #numpy has no interpolation method that matches matlab's percentile function
+    #y = np.percentile(x, p, dim, interpolation = 'higher')
+    except:
+        if len(np.shape(x)) > 2:
+            raise RuntimeError('Number of dimensions  #d not implemented.' + str(len(np.shape(x))))
 
-		# presumably at least 1 input value has been given
-		#	np.shape(integer) -> (), must be at least (1,)
-		psize=np.shape(p) or (1,)
-		if len(psize) > 1 and np.size(p,1)>1:
-			p=p.T
-		
-		xsize=np.shape(x) or (1,)
-		if dim==2:
-			x=x.T
+        # presumably at least 1 input value has been given
+        #    np.shape(integer) -> (), must be at least (1, )
+        psize = np.shape(p) or (1, )
+        if len(psize) > 1 and np.size(p, 1) > 1:
+            p = p.T
 
-		#  check for any NaN in any columns
-		if not np.isnan(x).any():
-			x=np.sort(x,axis=0)
-			n=np.size(x,0)
+        xsize = np.shape(x) or (1, )
+        if dim == 2:
+            x = x.T
 
-			#  branch based on number of elements
-			if n>1:
-				#  set up percent values and interpolate
-				xi=[((i+0.5)*100/n) for i in range(n)]
-				# scipy's interp1d returns a function
-				y=interp1d(xi,x,axis=dim,bounds_error=False)
-				y=y(p)
+        #  check for any NaN in any columns
+        if not np.isnan(x).any():
+            x = np.sort(x, axis=0)
+            n = np.size(x, 0)
 
-				#  fill in high and low values outside of interp range
-				if p>xi[n-1]:
-					y=np.tile(x[n-1,:],1)
-				if p<xi[0]:
-					y=np.tile(x[0,:],1)
+            #  branch based on number of elements
+            if n > 1:
+                #  set up percent values and interpolate
+                xi = [((i + 0.5) * 100 / n) for i in range(n)]
+                # scipy's interp1d returns a function
+                y = interp1d(xi, x, axis=dim, bounds_error=False)
+                y = y(p)
 
-			#  if one value, just copy it
-			elif n==1:
-				y=np.tile(x[0,:],(len(p),1))
+                #  fill in high and low values outside of interp range
+                if p > xi[n - 1]:
+                    y = np.tile(x[n - 1, :], 1)
+                if p < xi[0]:
+                    y = np.tile(x[0, :], 1)
 
-			#  if no values, use NaN
-			else:
-				y=np.tile(float('NaN'),(size(p,0),size(x,0)))
-		else:
-			#  must loop over columns, since number of elements could be different
-			y=np.zeros((np.size(p,0),np.size(x,1)))
-			for j in range(np.size(x,1)):
-			#  remove any NaN and recursively call column
-				y[:,j]=prctile_issm(x[np.where(not np.isnan(x[:,j]),j)],p)
+            #  if one value, just copy it
+            elif n == 1:
+                y = np.tile(x[0, :], (len(p), 1))
 
-		if (np.min(xsize)==1 and len(xsize) > 1 and xsize[dim]>1 and len(p) > 1 and psize[1]>1) or (np.min(xsize)> 1 and dim==2):
-			y=y.T
+            #  if no values, use NaN
+            else:
+                y = np.tile(float('NaN'), (np.size(p, 0), np.size(x, 0)))
+        else:
+            #  must loop over columns, since number of elements could be different
+            y = np.zeros((np.size(p, 0), np.size(x, 1)))
+            for j in range(np.size(x, 1)):
+                #  remove any NaN and recursively call column
+                y[:, j] = prctile_issm(x[np.where(not np.isnan(x[:, j]), j)], p)
 
-	return y
+        if (np.min(xsize) == 1 and len(xsize) > 1 and xsize[dim] > 1 and len(p) > 1 and psize[1] > 1) or (np.min(xsize) > 1 and dim == 2):
+            y = y.T
 
+    return y
Index: /issm/trunk/src/m/miscellaneous/transientrestart.m
===================================================================
--- /issm/trunk/src/m/miscellaneous/transientrestart.m	(revision 24312)
+++ /issm/trunk/src/m/miscellaneous/transientrestart.m	(revision 24313)
@@ -35,6 +35,9 @@
 if isfield(results,'Vy'),          md.initialization.vy=results.Vy; end
 if isfield(results,'Vz'),          md.initialization.vz=results.Vz; end
+if isfield(results,'Vel'),         md.initialization.vel=results.Vel; end
 if isfield(results,'Temperature'), md.initialization.temperature=results.Temperature; end
 if isfield(results,'Pressure'),    md.initialization.pressure=results.Pressure; end
+if isfield(results,'Waterfraction'),md.initialization.waterfraction=results.Waterfraction; end
+if isfield(results,'Watercolumn'), md.initialization.watercolumn=results.Watercolumn; end
 
 %Deal with new geometry
Index: /issm/trunk/src/m/modules/BamgConvertMesh.py
===================================================================
--- /issm/trunk/src/m/modules/BamgConvertMesh.py	(revision 24312)
+++ /issm/trunk/src/m/modules/BamgConvertMesh.py	(revision 24313)
@@ -1,17 +1,18 @@
 from BamgConvertMesh_python import BamgConvertMesh_python
 
-def BamgConvertMesh(index,x,y):
-	"""
-	BAMGCONVERTMESH - Convert [index, x, y] to a bamg geom and mesh geom
 
-	Usage:
-		bamggeom, bamgmesh = BamgConvertMesh(index, x, y)
-		index: index of the mesh
-		x,y: coordinates of the nodes
-	"""
-	
-	#Call mex module
-	bamggeom, bamgmesh = BamgConvertMesh_python(index,x,y)
+def BamgConvertMesh(index, x, y):
+    """
+    BAMGCONVERTMESH - Convert [index, x, y] to a bamg geom and mesh geom
 
-	#return
-	return bamggeom, bamgmesh
+    Usage:
+        bamggeom, bamgmesh = BamgConvertMesh(index, x, y)
+        index: index of the mesh
+        x, y: coordinates of the nodes
+    """
+
+    #Call mex module
+    bamggeom, bamgmesh = BamgConvertMesh_python(index, x, y)
+
+    #return
+    return bamggeom, bamgmesh
Index: /issm/trunk/src/m/modules/BamgMesher.py
===================================================================
--- /issm/trunk/src/m/modules/BamgMesher.py	(revision 24312)
+++ /issm/trunk/src/m/modules/BamgMesher.py	(revision 24313)
@@ -1,19 +1,20 @@
 from BamgMesher_python import BamgMesher_python
 
-def BamgMesher(bamgmesh,bamggeom,bamgoptions):
-	"""
-	BAMGMESHER
 
-	Usage:
-		bamgmesh,bamggeom = BamgMesher(bamgmesh,bamggeom,bamgoptions);
+def BamgMesher(bamgmesh, bamggeom, bamgoptions):
+    """
+    BAMGMESHER
 
-	bamgmesh: input bamg mesh
-	bamggeom: input bamg geometry for the mesh
-	bamgoptions: options for the bamg mesh
-	"""
-	
-	#Call mex module
-	bamgmesh, bamggeom = BamgMesher_python(bamgmesh, bamggeom, bamgoptions)
+    Usage:
+            bamgmesh, bamggeom = BamgMesher(bamgmesh, bamggeom, bamgoptions)
 
-	#return
-	return bamgmesh, bamggeom
+    bamgmesh: input bamg mesh
+    bamggeom: input bamg geometry for the mesh
+    bamgoptions: options for the bamg mesh
+    """
+
+    #Call mex module
+    bamgmesh, bamggeom = BamgMesher_python(bamgmesh, bamggeom, bamgoptions)
+
+    #return
+    return bamgmesh, bamggeom
Index: /issm/trunk/src/m/modules/BamgTriangulate.py
===================================================================
--- /issm/trunk/src/m/modules/BamgTriangulate.py	(revision 24312)
+++ /issm/trunk/src/m/modules/BamgTriangulate.py	(revision 24313)
@@ -1,17 +1,18 @@
 from BamgTriangulate_python import BamgTriangulate_python
 
-def BamgTriangulate(x,y):
-	"""
-	BAMGTRIANGULATE
 
-	Usage:
-		index = BamgTriangulate(x,y)
+def BamgTriangulate(x, y):
+    """
+    BAMGTRIANGULATE
 
-	index: index of the triangulation
-	x,y: coordinates of the nodes
-	"""
+    Usage:
+        index = BamgTriangulate(x, y)
 
-	# Call mex module
-	index = BamgTriangulate_python(x,y)
-	# return
-	return index
+    index: index of the triangulation
+    x, y: coordinates of the nodes
+    """
+
+    # Call mex module
+    index = BamgTriangulate_python(x, y)
+    # return
+    return index
Index: /issm/trunk/src/m/modules/Chaco.py
===================================================================
--- /issm/trunk/src/m/modules/Chaco.py	(revision 24312)
+++ /issm/trunk/src/m/modules/Chaco.py	(revision 24313)
@@ -1,20 +1,20 @@
 from Chaco_python import Chaco_python
 
-def Chaco(A,vwgts,ewgts,x,y,z,options,nparts,goal):
-	'''CHACO
+
+def Chaco(A, vwgts, ewgts, x, y, z, options, nparts, goal):
+    '''CHACO
 
    Usage:
-      assgn = Chaco(A,vwgts,ewgts,x,y,z,options,nparts,goal);
+      assgn = Chaco(A, vwgts, ewgts, x, y, z, options, nparts, goal)
 
-   A:			Input adjacency matrix
-   vwgts:		weights for all vertices
-   ewgts:		weights for all edges
-   x,y,z:		coordinates for inertial method
-   options:		architecture and partitioning options
-   nparts:		number of parts options
-   goal:		desired set sizes
+   A:            Input adjacency matrix
+   vwgts:        weights for all vertices
+   ewgts:        weights for all edges
+   x, y, z:        coordinates for inertial method
+   options:        architecture and partitioning options
+   nparts:        number of parts options
+   goal:        desired set sizes
 '''
-	# Call mex module
-	assgn = Chaco_python(A,vwgts,ewgts,x,y,z,options,nparts,goal)
-	
-	return assgn
+    # Call mex module
+    assgn = Chaco_python(A, vwgts, ewgts, x, y, z, options, nparts, goal)
+    return assgn
Index: /issm/trunk/src/m/modules/ContourToMesh.py
===================================================================
--- /issm/trunk/src/m/modules/ContourToMesh.py	(revision 24312)
+++ /issm/trunk/src/m/modules/ContourToMesh.py	(revision 24313)
@@ -1,35 +1,36 @@
 from ContourToMesh_python import ContourToMesh_python
 
-def ContourToMesh(index,x,y,contourname,interptype,edgevalue):
-	"""
-	
-	CONTOURTOMESH - Flag the elements or nodes inside a contour
 
-		Usage:
-			[in_nod,in_elem]=ContourToMesh(index,x,y,contourname,interptype,edgevalue)
+def ContourToMesh(index, x, y, contourname, interptype, edgevalue):
+    """
 
-			index,x,y: mesh triangulation.
-			contourname: name of .exp file containing the contours.
-			interptype: string defining type of interpolation ('element', or 'node').
-			edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons.
-			in_nod: vector of flags (0 or 1), of size nel if interptype is set to 'node' or 'element and node',
-				or of size 0 otherwise.
-			in_elem: vector of flags (0 or 1), of size nel if interptype is set to 'element' or 'element and node',
-				or of size 0 otherwise.
+    CONTOURTOMESH - Flag the elements or nodes inside a contour
 
-		Example:
-			in_nod=ContourToMesh(md.elements,md.x,md.y,'Contour.exp','node',1)
-			in_elements=ContourToMesh(md.elements,md.x,md.y,'Contour.exp','element',0)
-			[in_nodes,in_elements]=ContourToMesh(md.elements,md.x,md.y,'Contour.exp','element and node',0)
-	"""
-	#Call mex module
-	in_nod,in_elem = ContourToMesh_python(index,x,y,contourname,interptype,edgevalue)
+        Usage:
+            [in_nod, in_elem] = ContourToMesh(index, x, y, contourname, interptype, edgevalue)
 
-	if interptype=='element':
-		return in_elem
-	elif interptype=='node':
-		return in_nod
-	elif interptype=='element and node':
-		return in_nod,in_elem
-	else:
-		raise TypeError('interpolation type "{}" not supported yet'.format(interptype))
+            index, x, y: mesh triangulation.
+            contourname: name of .exp file containing the contours.
+            interptype: string defining type of interpolation ('element', or 'node').
+            edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons.
+            in_nod: vector of flags (0 or 1), of size nel if interptype is set to 'node' or 'element and node',
+                or of size 0 otherwise.
+            in_elem: vector of flags (0 or 1), of size nel if interptype is set to 'element' or 'element and node',
+                or of size 0 otherwise.
+
+        Example:
+            in_nod = ContourToMesh(md.elements, md.x, md.y, 'Contour.exp', 'node', 1)
+            in_elements = ContourToMesh(md.elements, md.x, md.y, 'Contour.exp', 'element', 0)
+            [in_nodes, in_elements] = ContourToMesh(md.elements, md.x, md.y, 'Contour.exp', 'element and node', 0)
+    """
+    #Call mex module
+    in_nod, in_elem = ContourToMesh_python(index, x, y, contourname, interptype, edgevalue)
+
+    if interptype == 'element':
+        return in_elem
+    elif interptype == 'node':
+        return in_nod
+    elif interptype == 'element and node':
+        return in_nod, in_elem
+    else:
+        raise TypeError('interpolation type "{}" not supported yet'.format(interptype))
Index: /issm/trunk/src/m/modules/ContourToNodes.py
===================================================================
--- /issm/trunk/src/m/modules/ContourToNodes.py	(revision 24312)
+++ /issm/trunk/src/m/modules/ContourToNodes.py	(revision 24313)
@@ -1,20 +1,21 @@
 from ContourToNodes_python import ContourToNodes_python
 
-def ContourToNodes(x,y,contourname,edgevalue):
-	"""
-	CONTOURTONODES - flags vertices inside contour
 
-		Usage:
-			flags = ContourToNodes(x,y,contourname,edgevalue);
+def ContourToNodes(x, y, contourname, edgevalue):
+    """
+    CONTOURTONODES - flags vertices inside contour
 
-		x,y: list of nodes
-		contourname: name of .exp file containing the contours, or resulting structure from call to expread
-		edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons
-		flags: vector of flags (0 or 1), of size nodes
-	"""
+        Usage:
+            flags = ContourToNodes(x, y, contourname, edgevalue)
 
-	#Call mex module
-	flags = ContourToNodes_python(x,y,contourname,edgevalue)
+        x, y: list of nodes
+        contourname: name of .exp file containing the contours, or resulting structure from call to expread
+        edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons
+        flags: vector of flags (0 or 1), of size nodes
+    """
 
-	#return
-	return flags
+    #Call mex module
+    flags = ContourToNodes_python(x, y, contourname, edgevalue)
+
+    #return
+    return flags
Index: /issm/trunk/src/m/modules/ElementConnectivity.py
===================================================================
--- /issm/trunk/src/m/modules/ElementConnectivity.py	(revision 24312)
+++ /issm/trunk/src/m/modules/ElementConnectivity.py	(revision 24313)
@@ -1,14 +1,15 @@
 from ElementConnectivity_python import ElementConnectivity_python
 
-def ElementConnectivity(elements,nodeconnectivity):
-	"""
-	ELEMENTCONNECTIVITY - Build element connectivity using node connectivity and elements
 
-		Usage:
-			elementconnectivity = ElementConnectivity(elements,nodeconnectivity);
-	"""
-	#Call mex module
-	elementconnectivity = ElementConnectivity_python(elements,nodeconnectivity)
-	
-	#Return
-	return elementconnectivity
+def ElementConnectivity(elements, nodeconnectivity):
+    """
+    ELEMENTCONNECTIVITY - Build element connectivity using node connectivity and elements
+
+        Usage:
+            elementconnectivity = ElementConnectivity(elements, nodeconnectivity)
+    """
+    #Call mex module
+    elementconnectivity = ElementConnectivity_python(elements, nodeconnectivity)
+
+    #Return
+    return elementconnectivity
Index: /issm/trunk/src/m/modules/InterpFromGridToMesh.py
===================================================================
--- /issm/trunk/src/m/modules/InterpFromGridToMesh.py	(revision 24312)
+++ /issm/trunk/src/m/modules/InterpFromGridToMesh.py	(revision 24313)
@@ -1,22 +1,23 @@
 from InterpFromGridToMesh_python import InterpFromGridToMesh_python
 
-def InterpFromGridToMesh(x,y,data,x_mesh,y_mesh,default_value):
-	"""
-	INTERPFROMGRIDTOMESH - Interpolation from a grid onto a list of points
+
+def InterpFromGridToMesh(x, y, data, x_mesh, y_mesh, default_value):
+    """
+    INTERPFROMGRIDTOMESH - Interpolation from a grid onto a list of points
 
    Usage:
-      data_mesh=InterpFromGridToMesh(x,y,data,x_mesh,y_mesh,default_value);
+      data_mesh = InterpFromGridToMesh(x, y, data, x_mesh, y_mesh, default_value)
 
-   data:		matrix holding the data to be interpolated onto the mesh
-   x,y:		coordinates of matrix data (x and y must be in increasing order)
-   x_mesh,y_mesh:	coordinates of the points onto which we interpolate
-	default_value:	vector of mesh interpolated data
+   data:        matrix holding the data to be interpolated onto the mesh
+   x, y:        coordinates of matrix data (x and y must be in increasing order)
+   x_mesh, y_mesh:    coordinates of the points onto which we interpolate
+    default_value:    vector of mesh interpolated data
 
-	Example:
-		load('velocities.mat');
-		md.inversion.vx_obs=InterpFromGridToMesh(x_n,y_m,vx,md.mesh.x,md.mesh.y,0);
-	"""
-	# Call mex module
-	data_mesh=InterpFromGridToMesh_python(x,y,data,x_mesh,y_mesh,default_value)
-	# Return
-	return data_mesh
+    Example:
+        load('velocities.mat')
+        md.inversion.vx_obs = InterpFromGridToMesh(x_n, y_m, vx, md.mesh.x, md.mesh.y, 0)
+    """
+    # Call mex module
+    data_mesh = InterpFromGridToMesh_python(x, y, data, x_mesh, y_mesh, default_value)
+    # Return
+    return data_mesh
Index: /issm/trunk/src/m/modules/InterpFromMeshToGrid.py
===================================================================
--- /issm/trunk/src/m/modules/InterpFromMeshToGrid.py	(revision 24312)
+++ /issm/trunk/src/m/modules/InterpFromMeshToGrid.py	(revision 24313)
@@ -1,19 +1,20 @@
 from InterpFromMeshToGrid_python import InterpFromMeshToGrid_python
 
-def InterpFromMeshToGrid(index,x,y,data,xgrid,ygrid,default_value):
-	"""
-	INTERPFROMMESHTOGRID - Interpolation of a data defined on a mesh onto a grid
 
-		This function is a multi-threaded mex file that interpolates a field defined
-		on a triangular mesh onto a regular grid
+def InterpFromMeshToGrid(index, x, y, data, xgrid, ygrid, default_value):
+    """
+    INTERPFROMMESHTOGRID - Interpolation of a data defined on a mesh onto a grid
 
-		index,x,y:	delaunay triangulation defining the mesh
-		meshdata:	vertex values of data to be interpolated
+        This function is a multi - threaded mex file that interpolates a field defined
+        on a triangular mesh onto a regular grid
 
-		xgrid,ygrid,:	parameters that define the grid
-		default_value:	value of points located out of the mesh
-	"""
-	# Call mex module
-	grid=InterpFromMeshToGrid_python(index,x,y,data,xgrid,ygrid,default_value)
-	# Return
-	return grid
+        index, x, y:    delaunay triangulation defining the mesh
+        meshdata:    vertex values of data to be interpolated
+
+        xgrid, ygrid, :    parameters that define the grid
+        default_value:    value of points located out of the mesh
+    """
+    # Call mex module
+    grid = InterpFromMeshToGrid_python(index, x, y, data, xgrid, ygrid, default_value)
+    # Return
+    return grid
Index: /issm/trunk/src/m/modules/InterpFromMeshToMesh2d.py
===================================================================
--- /issm/trunk/src/m/modules/InterpFromMeshToMesh2d.py	(revision 24312)
+++ /issm/trunk/src/m/modules/InterpFromMeshToMesh2d.py	(revision 24313)
@@ -1,27 +1,28 @@
-from InterpFromMeshToMesh2d_python import InterpFromMeshToMesh2d_python 
+from InterpFromMeshToMesh2d_python import InterpFromMeshToMesh2d_python
+
 
 def InterpFromMeshToMesh2d(*args):
-	"""
-	INTERPFROMMESHTOMESH2D - Interpolation from a 2d triangular mesh onto a list of points
+    """
+    INTERPFROMMESHTOMESH2D - Interpolation from a 2d triangular mesh onto a list of points
 
-		Usage:
-			data_interp=InterpFromMeshToMesh2d(index,x,y,data,x_interp,y_interp);
-			or data_interp=InterpFromMeshToMesh2d(index,x,y,data,x_interp,y_interp,OPTIONS);
-		
-		index:	index of the mesh where data is defined (e.g. md.mesh.elements)
-		x,y:	coordinates of the nodes where data is defined
-		data:	matrix holding the data to be interpolated onto the mesh (one column per field)
-		x_interp,y_interp:	coordinates of the points onto which we interpolate
-		data_interp:	vector of mesh interpolated data
-		Available options:
-			default:	default value if point is outsite of triangulation (instead of linear interpolation)
+            Usage:
+                    data_interp = InterpFromMeshToMesh2d(index, x, y, data, x_interp, y_interp)
+                    or data_interp = InterpFromMeshToMesh2d(index, x, y, data, x_interp, y_interp, OPTIONS)
 
-	Example:
-		load('temperature.mat');
-		md.initialization.temperature=InterpFromMeshToMesh2d(index,x,y,temperature,md.mesh.x,md.mesh.y);
-		md.initialization.temperature=InterpFromMeshToMesh2d(index,x,y,temperature,md.mesh.x,md.mesh.y,'default',253);
-	"""
-	# Call mex module
-	data_interp = InterpFromMeshToMesh2d_python(*args)
-	# Return
-	return data_interp
+            index:  index of the mesh where data is defined (e.g. md.mesh.elements)
+            x, y:    coordinates of the nodes where data is defined
+            data:   matrix holding the data to be interpolated onto the mesh (one column per field)
+            x_interp, y_interp:      coordinates of the points onto which we interpolate
+            data_interp:    vector of mesh interpolated data
+            Available options:
+                    default:        default value if point is outsite of triangulation (instead of linear interpolation)
+
+    Example:
+            load('temperature.mat')
+            md.initialization.temperature = InterpFromMeshToMesh2d(index, x, y, temperature, md.mesh.x, md.mesh.y)
+            md.initialization.temperature = InterpFromMeshToMesh2d(index, x, y, temperature, md.mesh.x, md.mesh.y, 'default', 253)
+    """
+    # Call mex module
+    data_interp = InterpFromMeshToMesh2d_python(*args)
+    # Return
+    return data_interp
Index: /issm/trunk/src/m/modules/InterpFromMeshToMesh3d.py
===================================================================
--- /issm/trunk/src/m/modules/InterpFromMeshToMesh3d.py	(revision 24312)
+++ /issm/trunk/src/m/modules/InterpFromMeshToMesh3d.py	(revision 24313)
@@ -1,23 +1,24 @@
 from InterpFromMeshToMesh3d_python import InterpFromMeshToMesh3d_python
 
-def InterpFromMeshToMesh3d(index,x,y,z,data,x_prime,y_prime,z_prime,default_value):
-	"""
-	INTERPFROMMESHTOMESH3D - Interpolation from a 3d hexahedron mesh onto a list of points
+
+def InterpFromMeshToMesh3d(index, x, y, z, data, x_prime, y_prime, z_prime, default_value):
+    """
+    INTERPFROMMESHTOMESH3D - Interpolation from a 3d hexahedron mesh onto a list of points
 
    Usage:
-      index:	index of the mesh where data is defined
-      x,y,z:	coordinates of the nodes where data is defined
-      data:	matrix holding the data to be interpolated onto the mesh
-      x_prime,y_prime,z_prime:	coordinates of the points onto which we interpolate
-      default_value:	default value if no data is found (holes)
-      data_prime:	vector of mesh interpolated data
+      index:    index of the mesh where data is defined
+      x, y, z:    coordinates of the nodes where data is defined
+      data:    matrix holding the data to be interpolated onto the mesh
+      x_prime, y_prime, z_prime:    coordinates of the points onto which we interpolate
+      default_value:    default value if no data is found (holes)
+      data_prime:    vector of mesh interpolated data
 
    Example:
-      load('temperature.mat');
-      md.initialization.temperature=InterpFromMeshToMesh3d(index,x,y,z,temperature,md.mesh.x,md.mesh.y,md.mesh.z,253);
-	"""
-	# Call mex module
-	data_prime = InterpFromMeshToMesh3d_python(index,x,y,z,data,x_prime,y_prime,z_prime,default_value)
-	
-	# Return
-	return data_prime
+      load('temperature.mat')
+      md.initialization.temperature = InterpFromMeshToMesh3d(index, x, y, z, temperature, md.mesh.x, md.mesh.y, md.mesh.z, 253)
+    """
+    # Call mex module
+    data_prime = InterpFromMeshToMesh3d_python(index, x, y, z, data, x_prime, y_prime, z_prime, default_value)
+
+    # Return
+    return data_prime
Index: /issm/trunk/src/m/modules/IssmConfig.py
===================================================================
--- /issm/trunk/src/m/modules/IssmConfig.py	(revision 24312)
+++ /issm/trunk/src/m/modules/IssmConfig.py	(revision 24313)
@@ -1,15 +1,15 @@
 from IssmConfig_python import IssmConfig_python
 
+
 def IssmConfig(string):
-	"""
-	ISSMCONFIG
+    """
+    ISSMCONFIG
 
-		Usage:
-			value = IssmConfig('string');
-	"""
+        Usage:
+            value = IssmConfig('string')
+    """
 
-	# Call mex module
-	value = IssmConfig_python(string)
-	# Return
-	return value
-
+    # Call mex module
+    value = IssmConfig_python(string)
+    # Return
+    return value
Index: /issm/trunk/src/m/modules/MeshPartition.py
===================================================================
--- /issm/trunk/src/m/modules/MeshPartition.py	(revision 24312)
+++ /issm/trunk/src/m/modules/MeshPartition.py	(revision 24313)
@@ -1,42 +1,39 @@
 from MeshPartition_python import MeshPartition_python
-
 from mesh3dprisms import *
 from mesh2d import *
 from mesh2dvertical import *
 
-def MeshPartition(md,numpartitions):
-	'''MESHPARTITION - Partition mesh according to the number of areas, using Metis library.
 
-	   Usage:
-			[element_partitioning,node_partitioning]=MeshPartition(md.mesh,numpartitions)
+def MeshPartition(md, numpartitions):
+    '''MESHPARTITION - Partition mesh according to the number of areas, using Metis library.
 
-	   element_partitioning: Vector of partitioning area numbers, for every element.
-	   node_partitioning: Vector of partitioning area numbers, for every node.
+       Usage:
+            [element_partitioning, node_partitioning] = MeshPartition(md.mesh, numpartitions)
+
+       element_partitioning: Vector of partitioning area numbers, for every element.
+       node_partitioning: Vector of partitioning area numbers, for every node.
 '''
-	if md == None or numpartitions == None:
-		print MeshPartition.__doc__
-		raise RuntimeError('Wrong usage (see above)')
+    if md is None or numpartitions is None:
+        print((MeshPartition.__doc__))
+        raise RuntimeError('Wrong usage (see above)')
 
-	#Get mesh info from md.mesh
-	numberofvertices = md.mesh.numberofvertices
-	numberofelements = md.mesh.numberofelements
-	elements         = md.mesh.elements
-	numberofelements2d = 0
-	numberofvertices2d = 0
-	numberoflayers     = 1
-	elements2d         = []
-	if isinstance(md.mesh,mesh3dprisms):
-		elementtype = 'Penta'
-		numberofelements2d = md.mesh.numberofelements2d
-		numberofvertices2d = md.mesh.numberofvertices2d
-		numberoflayers     = md.mesh.numberoflayers
-		elements2d         = md.mesh.elements2d
-	elif isinstance(md.mesh,mesh2d):
-		elementtype = 'Tria'
-	elif isinstance(md.mesh,mesh2dvertical):
-		elementtype = 'Tria'
+    #Get mesh info from md.mesh
+    numberofvertices = md.mesh.numberofvertices
+    elements = md.mesh.elements
+    numberofvertices2d = 0
+    numberoflayers = 1
+    elements2d = []
+    if isinstance(md.mesh, mesh3dprisms):
+        elementtype = 'Penta'
+        numberofvertices2d = md.mesh.numberofvertices2d
+        numberoflayers = md.mesh.numberoflayers
+        elements2d = md.mesh.elements2d
+    elif isinstance(md.mesh, mesh2d):
+        elementtype = 'Tria'
+    elif isinstance(md.mesh, mesh2dvertical):
+        elementtype = 'Tria'
 
-	#Call module
-	[element_partitioning, node_partitioning] = MeshPartition_python(numberofvertices, elements, numberofvertices2d, elements2d, numberoflayers,elementtype, numpartitions)
+    #Call module
+    [element_partitioning, node_partitioning] = MeshPartition_python(numberofvertices, elements, numberofvertices2d, elements2d, numberoflayers, elementtype, numpartitions)
 
-	return [element_partitioning, node_partitioning]
+    return [element_partitioning, node_partitioning]
Index: /issm/trunk/src/m/modules/MeshProfileIntersection.py
===================================================================
--- /issm/trunk/src/m/modules/MeshProfileIntersection.py	(revision 24312)
+++ /issm/trunk/src/m/modules/MeshProfileIntersection.py	(revision 24313)
@@ -1,23 +1,24 @@
 from MeshProfileIntersection_python import MeshProfileIntersection_python
 
-def MeshProfileIntersection(index,x,y,filename):
-	"""
-	MESHPROFILEINTERSECTION - Takes a .exp file (made of several profiles), and figures out its intersection with a mesh
-		Usage:
-			[segments]=MeshProfileIntersection(index,x,y,filename);
-		
-		input:
-			  index,x,y is a triangulation
-			  filename: name of Argus style .exp file containing the segments (can be groups of disconnected segments)
 
-		output:
-			  segments: array made of x1,y1,x2,y2,element_id lines (x1,y1) and (x2,y2) are segment extremities for a segment 
-			  belonging to the elemnt_id element. there are as many lines in segments as there are segments intersecting the 
-			  mesh.
-	"""
-	
-	# Call mex module
-	segments = MeshProfileIntersection_python(index,x,y,filename)
+def MeshProfileIntersection(index, x, y, filename):
+    """
+    MESHPROFILEINTERSECTION - Takes a .exp file (made of several profiles), and figures out its intersection with a mesh
+        Usage:
+            [segments] = MeshProfileIntersection(index, x, y, filename)
 
-	# Return
-	return segments
+        input:
+              index, x, y is a triangulation
+              filename: name of Argus style .exp file containing the segments (can be groups of disconnected segments)
+
+        output:
+              segments: array made of x1, y1, x2, y2, element_id lines (x1, y1) and (x2, y2) are segment extremities for a segment
+              belonging to the elemnt_id element. there are as many lines in segments as there are segments intersecting the
+              mesh.
+    """
+
+    # Call mex module
+    segments = MeshProfileIntersection_python(index, x, y, filename)
+
+    # Return
+    return segments
Index: /issm/trunk/src/m/modules/NodeConnectivity.py
===================================================================
--- /issm/trunk/src/m/modules/NodeConnectivity.py	(revision 24312)
+++ /issm/trunk/src/m/modules/NodeConnectivity.py	(revision 24313)
@@ -1,15 +1,15 @@
 from NodeConnectivity_python import NodeConnectivity_python
 
-def NodeConnectivity(elements,numnodes):
-	"""
-	NODECONNECTIVITY - Build node connectivity from elements
 
-		Usage:
-			connectivity = NodeConnectivity(elements, numnodes);
-	"""
-	# Call mex module
-	connectivity = NodeConnectivity_python(elements,numnodes)
+def NodeConnectivity(elements, numnodes):
+    """
+    NODECONNECTIVITY - Build node connectivity from elements
 
-	# Return
-	return connectivity
+        Usage:
+            connectivity = NodeConnectivity(elements, numnodes)
+    """
+    # Call mex module
+    connectivity = NodeConnectivity_python(elements, numnodes)
 
+    # Return
+    return connectivity
Index: /issm/trunk/src/m/modules/ProcessRifts.py
===================================================================
--- /issm/trunk/src/m/modules/ProcessRifts.py	(revision 24312)
+++ /issm/trunk/src/m/modules/ProcessRifts.py	(revision 24313)
@@ -1,16 +1,17 @@
 from ProcessRifts_python import ProcessRifts_python
 
-def ProcessRifts(index1,x1,y1,segments1,segmentmarkers1):
-	"""
-	TRIMESHPROCESSRIFTS - Split a mesh where a rift (or fault) is present
 
-	   Usage: 
-		   [index2,x2,y2,segments2,segmentmarkers2,rifts2]=ProcessRifts(index1,x1,y1,segments1,segmentmarkers1);
+def ProcessRifts(index1, x1, y1, segments1, segmentmarkers1):
+    """
+    TRIMESHPROCESSRIFTS - Split a mesh where a rift (or fault) is present
 
-	   (index1,x1,y1,segments1,segmentmarkers1):	An initial triangulation.
-	   [index2,x2,y2,segments2,segmentmarkers2,rifts2]:	The resulting triangulation where rifts have been processed.
-	"""
-	# Call mex module
-	index2,x2,y2,segments2,segmentmarkers2,rifts2 = ProcessRifts_python(index1,x1,y1,segments1,segmentmarkers1)
-	# Return
-	return index2,x2,y2,segments2,segmentmarkers2,rifts2
+       Usage:
+           [index2, x2, y2, segments2, segmentmarkers2, rifts2] = ProcessRifts(index1, x1, y1, segments1, segmentmarkers1)
+
+       (index1, x1, y1, segments1, segmentmarkers1):    An initial triangulation.
+       [index2, x2, y2, segments2, segmentmarkers2, rifts2]:    The resulting triangulation where rifts have been processed.
+    """
+    # Call mex module
+    index2, x2, y2, segments2, segmentmarkers2, rifts2 = ProcessRifts_python(index1, x1, y1, segments1, segmentmarkers1)
+    # Return
+    return index2, x2, y2, segments2, segmentmarkers2, rifts2
Index: /issm/trunk/src/m/modules/Scotch.py
===================================================================
--- /issm/trunk/src/m/modules/Scotch.py	(revision 24312)
+++ /issm/trunk/src/m/modules/Scotch.py	(revision 24313)
@@ -1,12 +1,13 @@
 from Scotch_python import Scotch_python
 
-def Scotch(*varargin):
-	'''SCOTCH - Scotch partitioner
+
+def Scotch(* varargin):
+    '''SCOTCH - Scotch partitioner
 
    Usage:
-      maptab=Scotch(adjmat,vertlb,vertwt,edgewt,archtyp,archpar,Scotch-specific parameters)
+      maptab = Scotch(adjmat, vertlb, vertwt, edgewt, archtyp, archpar, Scotch - specific parameters)
 '''
-	# Call mex module
-	maptab=Scotch_python(*varargin)
+    # Call mex module
+    maptab = Scotch_python(* varargin)
 
-	return maptab
+    return maptab
Index: /issm/trunk/src/m/os/issmdir.py
===================================================================
--- /issm/trunk/src/m/os/issmdir.py	(revision 24312)
+++ /issm/trunk/src/m/os/issmdir.py	(revision 24313)
@@ -2,22 +2,22 @@
 import MatlabFuncs as m
 
+
 def issmdir():
-	"""
-	ISSMDIR - Get ISSM_DIR environment variable
- 
-	   Usage:
-	      ISSM_DIR=issmdir()
-	"""
+    """
+    ISSMDIR - Get ISSM_DIR environment variable
 
-	if not m.ispc():
-		ISSM_DIR =os.environ['ISSM_DIR']
-	else:
-		ISSM_DIR =os.environ['ISSM_DIR_WIN']
-		if m.strcmpi(ISSM_DIR[-1],'/') or m.strcmpi(ISSM_DIR[-1],'\\'):
-			ISSM_DIR = ISSM_DIR[:-1]    #shave off the last '/'
+       Usage:
+          ISSM_DIR = issmdir()
+    """
 
-	if not ISSM_DIR:
-		raise RuntimeError("issmdir error message: 'ISSM_DIR' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!")
+    if not m.ispc():
+        ISSM_DIR = os.environ['ISSM_DIR']
+    else:
+        ISSM_DIR = os.environ['ISSM_DIR_WIN']
+        if m.strcmpi(ISSM_DIR[-1], '/') or m.strcmpi(ISSM_DIR[-1], '\\'):
+            ISSM_DIR = ISSM_DIR[:-1]  #shave off the last '/'
 
-	return ISSM_DIR
+    if not ISSM_DIR:
+        raise RuntimeError("issmdir error message: 'ISSM_DIR' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!")
 
+    return ISSM_DIR
Index: /issm/trunk/src/m/os/issmscpin.py
===================================================================
--- /issm/trunk/src/m/os/issmscpin.py	(revision 24312)
+++ /issm/trunk/src/m/os/issmscpin.py	(revision 24313)
@@ -5,64 +5,53 @@
 import MatlabFuncs as m
 
-def issmscpin(host, login,port,path, packages):
-	"""
-	ISSMSCPIN get packages from host, using scp on unix, and pscp on windows
- 
-	   usage: issmscpin(host,packages,path)
-	"""
 
-	#first get hostname
-	hostname=gethostname()
+def issmscpin(host, login, port, path, packages):
+    """
+    ISSMSCPIN get packages from host, using scp on unix, and pscp on windows
+       usage: issmscpin(host, packages, path)
+    """
 
-	#first be sure packages are not in the current directory, this could conflict with pscp on windows. 
-	#remove warnings in case the files do not exist
-	for package in packages:
-		try:
-			os.remove(package)
-		except OSError as e:
-			pass
+    #first get hostname
+    hostname = gethostname()
+    #first be sure packages are not in the current directory, this could conflict with pscp on windows.
+    #remove warnings in case the files do not exist
+    for package in packages:
+        try:
+            os.remove(package)
+        except OSError as e:
+            pass
+    #if hostname and host are the same, do a simple copy
+    if hostname == host:
+        for package in packages:
+            try:
+                shutil.copy(os.path.join(path, package), os.getcwd())  #keep going, even if success = 0
+            except OSError as e:
+                pass
+    else:
+        if m.ispc():
+            #use the putty project pscp.exe: it should be in the path.
+            #get ISSM_DIR variable
+            if 'ISSM_DIR_WIN' in os.environ:
+                ISSM_DIR = os.environ['ISSM_DIR_WIN'][1:-2]
+            else:
+                raise OSError("issmscpin error message: could not find ISSM_DIR_WIN environment variable.")
+            username = eval(input('Username: (quoted string) '))
+            key = eval(input('Key: (quoted string) '))
+            for package in packages:
+                try:
+                    subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s:%s %s' % (ISSM_DIR, username, key, host, os.path.join(path, package), os.getcwd()), shell=True)
+                except CalledProcessError as e:
+                    raise CalledProcessError("issmscpin error message: could not call putty pscp due to ")
 
-	#if hostname and host are the same, do a simple copy
-	if m.strcmpi(hostname,host):
-
-		for package in packages:
-			try:
-				shutil.copy(os.path.join(path,package),os.getcwd())    #keep going, even if success=0
-			except OSError as e:
-				pass
-
-	else:
-
-		if m.ispc():
-			#use the putty project pscp.exe: it should be in the path.
-		
-			#get ISSM_DIR variable
-			if 'ISSM_DIR_WIN' in os.environ:
-				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
-			else:
-				raise OSError("issmscpin error message: could not find ISSM_DIR_WIN environment variable.")
-
-			username=raw_input('Username: (quoted string) ')
-			key=raw_input('Key: (quoted string) ')
-
-			for package in packages:
-				try:
-					subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s:%s %s' % (ISSM_DIR,username,key,host,os.path.join(path,package),os.getcwd()),shell=True)
-				except CalledProcessError as e:
-					raise CalledProcessError("issmscpin error message: could not call putty pscp.")
-
-		else:
-			#just use standard unix scp
-			#string to copy multiple files using scp: 
-			string='\{'+','.join([str(x) for x in packages])+'\}'
-			
-			if port:
-				subprocess.call('scp -P %d %s@localhost:%s %s/. ' % (port,login,os.path.join(path,string),os.getcwd()),shell=True)
-			else:
-				subprocess.call('scp %s@%s:%s %s/.' % (login,host,os.path.join(path,string),os.getcwd()),shell=True)
-		
-			#check scp worked
-			for package in packages:
-				if not os.path.exists(os.path.join('.',package)):
-					raise OSError("issmscpin error message: could not call scp on *nix system.")
-
+        else:
+            #just use standard unix scp
+            #string to copy multiple files using scp:
+            string = "'{" + ','.join([str(x) for x in packages]) + "}'"
+            if port:
+                subprocess.call('scp -P {} {}@localhost:{} {}/. '.format(port, login, os.path.join(path, string), os.getcwd()), shell=True)
+            else:
+                subprocess.call('scp -T {}@{}:{} {}/.'.format(login, host, os.path.join(path, string), os.getcwd()), shell=True)
+    #check scp worked
+            for package in packages:
+                if not os.path.exists(os.path.join('.', package)):
+                    raise OSError("issmscpin error message: could not call scp on *nix system for file '{}'".format(package))
Index: /issm/trunk/src/m/os/issmscpout.py
===================================================================
--- /issm/trunk/src/m/os/issmscpout.py	(revision 24312)
+++ /issm/trunk/src/m/os/issmscpout.py	(revision 24313)
@@ -1,59 +1,58 @@
-from socket  import gethostname
+from socket import gethostname
 import subprocess
 import os
 import MatlabFuncs as m
 
-def issmscpout(host,path,login,port,packages):
-	"""
-	ISSMSCPOUT send packages to a host, using scp on unix, and pscp on windows
- 
-	   usage: issmscpout(host,path,packages)
-	"""
 
-	#get hostname
-	hostname=gethostname();
+def issmscpout(host, path, login, port, packages):
+    """
+    ISSMSCPOUT send packages to a host, using scp on unix, and pscp on windows
 
-	#if hostname and host are the same, do a simple copy
+       usage: issmscpout(host, path, packages)
+    """
 
-	if m.strcmpi(host,hostname):
-		for package in packages:
-			here=os.getcwd()
-			os.chdir(path)
-			try:
-				os.remove(package)
-			except OSError as e:
-				pass
-			subprocess.call('ln -s %s %s' % (os.path.join(here,package),path),shell=True)
-			os.chdir(here)
-	else:
-		if m.ispc():
-			#use the putty project pscp.exe: it should be in the path.
-		
-			#get ISSM_DIR variable
-			if 'ISSM_DIR_WIN' in os.environ:
-				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
-			else:
-				raise OSError("issmscpout error message: could not find ISSM_DIR_WIN environment variable.")
+    #get hostname
+    hostname = gethostname()
 
-			username=raw_input('Username: (quoted string) ')
-			key=raw_input('Key: (quoted string) ')
+    #if hostname and host are the same, do a simple copy
 
-			for package in packages:
-				try:
-					subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s %s:%s' % (ISSM_DIR,username,key,package,host,path),shell=True)
-				except CalledProcessError as e:
-					raise CalledProcessError("issmscpout error message: could not call putty pscp.")
+    if m.strcmpi(host, hostname):
+        for package in packages:
+            here = os.getcwd()
+            os.chdir(path)
+            try:
+                os.remove(package)
+            except OSError:
+                pass
+            subprocess.call('ln -s %s %s' % (os.path.join(here, package), path), shell=True)
+            os.chdir(here)
+    else:
+        if m.ispc():
+            #use the putty project pscp.exe: it should be in the path.
+            #get ISSM_DIR variable
+            if 'ISSM_DIR_WIN' in os.environ:
+                ISSM_DIR = os.environ['ISSM_DIR_WIN'][1:-2]
+            else:
+                raise OSError("issmscpout error message: could not find ISSM_DIR_WIN environment variable.")
 
-		else:
-			#just use standard unix scp
-			#create string of packages being sent
-			string=''
-			for package in packages:
-				string+=' '+package
-			string+=' '
-		
-			if port:
-				subprocess.call('scp -P %d %s %s@localhost:%s' % (port,string,login,path),shell=True)
-			else:
-				subprocess.call('scp %s %s@%s:%s' % (string,login,host,path),shell=True)
+            username = eval(input('Username: (quoted string) '))
+            key = eval(input('Key: (quoted string) '))
 
+            for package in packages:
+                try:
+                    subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s %s:%s' % (ISSM_DIR, username, key, package, host, path), shell=True)
+                except CalledProcessError as e:
+                    raise CalledProcessError("issmscpout error message: could not call putty pscp.")
+
+        else:
+            #just use standard unix scp
+            #create string of packages being sent
+            string = ''
+            for package in packages:
+                string += ' ' + package
+            string += ' '
+
+            if port:
+                subprocess.call('scp -P %d %s %s@localhost:%s' % (port, string, login, path), shell=True)
+            else:
+                subprocess.call('scp %s %s@%s:%s' % (string, login, host, path), shell=True)
Index: /issm/trunk/src/m/os/issmssh.py
===================================================================
--- /issm/trunk/src/m/os/issmssh.py	(revision 24312)
+++ /issm/trunk/src/m/os/issmssh.py	(revision 24313)
@@ -5,57 +5,55 @@
 import MatlabFuncs as m
 
-def issmssh(host,login,port,command):
-	"""
-	ISSMSSH - wrapper for OS independent ssh command.
- 
-	   usage: 
-	      issmssh(host,command)
-	"""
 
-	#first get hostname 
-	hostname=gethostname()
+def issmssh(host, login, port, command):
+    """
+    ISSMSSH - wrapper for OS independent ssh command.
 
-	#if same as host, just run the command. 
-	if m.strcmpi(host,hostname):
-		subprocess.call(command,shell=True)
-	else:
-		if m.ispc():
-			#use the putty project plink.exe: it should be in the path.
-		
-			#get ISSM_DIR variable
-			if 'ISSM_DIR_WIN' in os.environ:
-				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
-			else:
-				raise OSError("issmssh error message: could not find ISSM_DIR_WIN environment variable.")
+       usage:
+          issmssh(host, command)
+    """
 
-			username=raw_input('Username: (quoted string) ')
-			key=raw_input('Key: (quoted string) ')
+    #first get hostname
+    hostname = gethostname()
 
-			subprocess.call('%s/externalpackages/ssh/plink.exe -ssh -l "%s" -pw "%s" %s "%s"' % (ISSM_DIR,username,key,host,command),shell=True);
+    #if same as host, just run the command.
+    if m.strcmpi(host, hostname):
+        subprocess.call(command, shell=True)
+    else:
+        if m.ispc():
+            #use the putty project plink.exe: it should be in the path.
+            #get ISSM_DIR variable
+            if 'ISSM_DIR_WIN' in os.environ:
+                ISSM_DIR = os.environ['ISSM_DIR_WIN'][1:-2]
+            else:
+                raise OSError("issmssh error message: could not find ISSM_DIR_WIN environment variable.")
 
-		else:
-			#just use standard unix ssh
-			if port:
-				subprocess.call('ssh -l %s -p %d localhost "%s"' % (login,port,command),shell=True)
-			else:
-				subprocess.call('ssh -l %s %s "%s"' % (login,host,command),shell=True)
+            username = eval(input('Username: (quoted string) '))
+            key = eval(input('Key: (quoted string) '))
 
-	# The following code was added to fix:
-	# "IOError: [Errno 35] Resource temporarily unavailable"
-	# on the Mac when trying to display md after the solution.
-	# (from http://code.google.com/p/robotframework/issues/detail?id=995)
+            subprocess.call('%s/externalpackages/ssh/plink.exe-ssh -l "%s" -pw "%s" %s "%s"' % (ISSM_DIR, username, key, host, command), shell=True)
 
-	if _platform == "darwin":
-		# Make FreeBSD use blocking I/O like other platforms
-		import sys
-		import fcntl
-		from os import O_NONBLOCK
-		
-		fd = sys.stdin.fileno()
-		flags = fcntl.fcntl(fd, fcntl.F_GETFL)
-		fcntl.fcntl(fd, fcntl.F_SETFL, flags & ~O_NONBLOCK)
-		
-		fd = sys.stdout.fileno()
-		flags = fcntl.fcntl(fd, fcntl.F_GETFL)
-		fcntl.fcntl(fd, fcntl.F_SETFL, flags & ~O_NONBLOCK)
+        else:
+            #just use standard unix ssh
+            if port:
+                subprocess.call('ssh -l %s -p %d localhost "%s"' % (login, port, command), shell=True)
+            else:
+                subprocess.call('ssh -l %s %s "%s"' % (login, host, command), shell=True)
 
+    # The following code was added to fix:
+    # "IOError: [Errno 35] Resource temporarily unavailable"
+    # on the Mac when trying to display md after the solution.
+    # (from http://code.google.com/p/robotframework/issues/detail?id=995)
+    if _platform == "darwin":
+        # Make FreeBSD use blocking I / O like other platforms
+        import sys
+        import fcntl
+        from os import O_NONBLOCK
+
+        fd = sys.stdin.fileno()
+        flags = fcntl.fcntl(fd, fcntl.F_GETFL)
+        fcntl.fcntl(fd, fcntl.F_SETFL, flags & ~O_NONBLOCK)
+
+        fd = sys.stdout.fileno()
+        flags = fcntl.fcntl(fd, fcntl.F_GETFL)
+        fcntl.fcntl(fd, fcntl.F_SETFL, flags & ~O_NONBLOCK)
Index: /issm/trunk/src/m/parameterization/contourenvelope.py
===================================================================
--- /issm/trunk/src/m/parameterization/contourenvelope.py	(revision 24312)
+++ /issm/trunk/src/m/parameterization/contourenvelope.py	(revision 24313)
@@ -4,132 +4,131 @@
 from NodeConnectivity import NodeConnectivity
 from ElementConnectivity import ElementConnectivity
-from mesh2d import mesh2d
-from mesh3dprisms import mesh3dprisms
+from ContourToMesh import ContourToMesh
 import MatlabFuncs as m
 
-def contourenvelope(md,*args):
-	"""
-	CONTOURENVELOPE - build a set of segments enveloping a contour .exp
 
-	   Usage:
-	      segments=contourenvelope(md,varargin)
+def contourenvelope(md, *args):
+    """
+    CONTOURENVELOPE - build a set of segments enveloping a contour .exp
 
-	   Example:
-	      segments=contourenvelope(md,'Stream.exp');
-	      segments=contourenvelope(md);
-	"""
+       Usage:
+          segments = contourenvelope(md, varargin)
 
-	#some checks
-	if len(args)>1:
-		raise RuntimeError("contourenvelope error message: bad usage")
+       Example:
+          segments = contourenvelope(md, 'Stream.exp')
+          segments = contourenvelope(md)
+    """
 
-	if len(args)==1:
-		flags=args[0]
+    #some checks
+    if len(args) > 1:
+        raise RuntimeError("contourenvelope error message: bad usage")
 
-		if   isinstance(flags,(str,unicode)):
-			file=flags
-			if not os.path.exists(file):
-				raise IOError("contourenvelope error message: file '%s' not found" % file)
-			isfile=1
-		elif isinstance(flags,(bool,int,long,float)):
-			#do nothing for now
-			isfile=0
-		else:
-			raise TypeError("contourenvelope error message:  second argument should be a file or an elements flag")
+    if len(args) == 1:
+        flags = args[0]
 
-	#Now, build the connectivity tables for this mesh.
-	#Computing connectivity
-	if np.size(md.mesh.vertexconnectivity,axis=0)!=md.mesh.numberofvertices and np.size(md.mesh.vertexconnectivity,axis=0)!=md.mesh.numberofvertices2d:
-		md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices)[0]
-	if np.size(md.mesh.elementconnectivity,axis=0)!=md.mesh.numberofelements and np.size(md.mesh.elementconnectivity,axis=0)!=md.mesh.numberofelements2d:
-		md.mesh.elementconnectivity=ElementConnectivity(md.mesh.elements,md.mesh.vertexconnectivity)[0]
+        if isinstance(flags, str):
+            file = flags
+            if not os.path.exists(file):
+                raise IOError("contourenvelope error message: file '%s' not found" % file)
+            isfile = 1
+        elif isinstance(flags, (bool, int, float)):
+            #do nothing for now
+            isfile = 0
+        else:
+            raise TypeError("contourenvelope error message:  second argument should be a file or an elements flag")
 
-	#get nodes inside profile
-	elementconnectivity=copy.deepcopy(md.mesh.elementconnectivity)
-	if md.mesh.dimension()==2:
-		elements=copy.deepcopy(md.mesh.elements)
-		x=copy.deepcopy(md.mesh.x)
-		y=copy.deepcopy(md.mesh.y)
-		numberofvertices=copy.deepcopy(md.mesh.numberofvertices)
-		numberofelements=copy.deepcopy(md.mesh.numberofelements)
-	else:
-		elements=copy.deepcopy(md.mesh.elements2d)
-		x=copy.deepcopy(md.mesh.x2d)
-		y=copy.deepcopy(md.mesh.y2d)
-		numberofvertices=copy.deepcopy(md.mesh.numberofvertices2d)
-		numberofelements=copy.deepcopy(md.mesh.numberofelements2d)
+    #Now, build the connectivity tables for this mesh.
+    #Computing connectivity
+    if np.size(md.mesh.vertexconnectivity, axis=0) != md.mesh.numberofvertices and np.size(md.mesh.vertexconnectivity, axis=0) != md.mesh.numberofvertices2d:
+        md.mesh.vertexconnectivity = NodeConnectivity(md.mesh.elements, md.mesh.numberofvertices)[0]
+    if np.size(md.mesh.elementconnectivity, axis=0) != md.mesh.numberofelements and np.size(md.mesh.elementconnectivity, axis=0) != md.mesh.numberofelements2d:
+        md.mesh.elementconnectivity = ElementConnectivity(md.mesh.elements, md.mesh.vertexconnectivity)[0]
 
-	if len(args)==1:
+    #get nodes inside profile
+    elementconnectivity = copy.deepcopy(md.mesh.elementconnectivity)
+    if md.mesh.dimension() == 2:
+        elements = copy.deepcopy(md.mesh.elements)
+        x = copy.deepcopy(md.mesh.x)
+        y = copy.deepcopy(md.mesh.y)
+        numberofvertices = copy.deepcopy(md.mesh.numberofvertices)
+        numberofelements = copy.deepcopy(md.mesh.numberofelements)
+    else:
+        elements = copy.deepcopy(md.mesh.elements2d)
+        x = copy.deepcopy(md.mesh.x2d)
+        y = copy.deepcopy(md.mesh.y2d)
+        numberofvertices = copy.deepcopy(md.mesh.numberofvertices2d)
+        numberofelements = copy.deepcopy(md.mesh.numberofelements2d)
 
-		if isfile:
-			#get flag list of elements and nodes inside the contour
-			nodein=ContourToMesh(elements,x,y,file,'node',1)
-			elemin=(np.sum(nodein(elements),axis=1)==np.size(elements,axis=1))
-			#modify element connectivity
-			elemout=np.nonzero(np.logical_not(elemin))[0]
-			elementconnectivity[elemout,:]=0
-			elementconnectivity[np.nonzero(m.ismember(elementconnectivity,elemout+1))]=0
-		else:
-			#get flag list of elements and nodes inside the contour
-			nodein=np.zeros(numberofvertices)
-			elemin=np.zeros(numberofelements)
+    if len(args) == 1:
 
-			pos=np.nonzero(flags)
-			elemin[pos]=1
-			nodein[elements[pos,:]-1]=1
+        if isfile:
+            #get flag list of elements and nodes inside the contour
+            nodein = ContourToMesh(elements, x, y, file, 'node', 1)
+            elemin = (np.sum(nodein(elements), axis=1) == np.size(elements, axis=1))
+    #modify element connectivity
+            elemout = np.nonzero(np.logical_not(elemin))[0]
+            elementconnectivity[elemout, :] = 0
+            elementconnectivity[np.nonzero(m.ismember(elementconnectivity, elemout + 1))] = 0
+        else:
+            #get flag list of elements and nodes inside the contour
+            nodein = np.zeros(numberofvertices)
+            elemin = np.zeros(numberofelements)
 
-			#modify element connectivity
-			elemout=np.nonzero(np.logical_not(elemin))[0]
-			elementconnectivity[elemout,:]=0
-			elementconnectivity[np.nonzero(m.ismember(elementconnectivity,elemout+1))]=0
+            pos = np.nonzero(flags)
+            elemin[pos] = 1
+            nodein[elements[pos, :] - 1] = 1
 
-	#Find element on boundary
-	#First: find elements on the boundary of the domain
-	flag=copy.deepcopy(elementconnectivity)
-	if len(args)==1:
-		flag[np.nonzero(flag)]=elemin[flag[np.nonzero(flag)]]
-	elementonboundary=np.logical_and(np.prod(flag,axis=1)==0,np.sum(flag,axis=1)>0)
+    #modify element connectivity
+            elemout = np.nonzero(np.logical_not(elemin))[0]
+            elementconnectivity[elemout, :] = 0
+            elementconnectivity[np.nonzero(m.ismember(elementconnectivity, elemout + 1))] = 0
 
-	#Find segments on boundary
-	pos=np.nonzero(elementonboundary)[0]
-	num_segments=np.size(pos)
-	segments=np.zeros((num_segments*3,3),int)
-	count=0
+    #Find element on boundary
+    #First: find elements on the boundary of the domain
+    flag = copy.deepcopy(elementconnectivity)
+    if len(args) == 1:
+        flag[np.nonzero(flag)] = elemin[flag[np.nonzero(flag)]]
+    elementonboundary = np.logical_and(np.prod(flag, axis=1) == 0, np.sum(flag, axis=1) > 0)
 
-	for el1 in pos:
-		els2=elementconnectivity[el1,np.nonzero(elementconnectivity[el1,:])[0]]-1
-		if np.size(els2)>1:
-			flag=np.intersect1d(np.intersect1d(elements[els2[0],:],elements[els2[1],:]),elements[el1,:])
-			nods1=elements[el1,:]
-			nods1=np.delete(nods1,np.nonzero(nods1==flag))
-			segments[count,:]=[nods1[0],nods1[1],el1+1]
+    #Find segments on boundary
+    pos = np.nonzero(elementonboundary)[0]
+    num_segments = np.size(pos)
+    segments = np.zeros((num_segments * 3, 3), int)
+    count = 0
 
-			ord1=np.nonzero(nods1[0]==elements[el1,:])[0][0]
-			ord2=np.nonzero(nods1[1]==elements[el1,:])[0][0]
+    for el1 in pos:
+        els2 = elementconnectivity[el1, np.nonzero(elementconnectivity[el1, :])[0]] - 1
+        if np.size(els2) > 1:
+            flag = np.intersect1d(np.intersect1d(elements[els2[0], :], elements[els2[1], :]), elements[el1, :])
+            nods1 = elements[el1, :]
+            nods1 = np.delete(nods1, np.nonzero(nods1 == flag))
+            segments[count, :] = [nods1[0], nods1[1], el1 + 1]
 
-			#swap segment nodes if necessary
-			if ( (ord1==0 and ord2==1) or (ord1==1 and ord2==2) or (ord1==2 and ord2==0) ):
-				temp=segments[count,0]
-				segments[count,0]=segments[count,1]
-				segments[count,1]=temp
-			segments[count,0:2]=np.flipud(segments[count,0:2])
-			count+=1
-		else:
-			nods1=elements[el1,:]
-			flag=np.setdiff1d(nods1,elements[els2,:])
-			for j in xrange(0,3):
-				nods=np.delete(nods1,j)
-				if np.any(m.ismember(flag,nods)):
-					segments[count,:]=[nods[0],nods[1],el1+1]
-					ord1=np.nonzero(nods[0]==elements[el1,:])[0][0]
-					ord2=np.nonzero(nods[1]==elements[el1,:])[0][0]
-					if ( (ord1==0 and ord2==1) or (ord1==1 and ord2==2) or (ord1==2 and ord2==0) ):
-						temp=segments[count,0]
-						segments[count,0]=segments[count,1]
-						segments[count,1]=temp
-					segments[count,0:2]=np.flipud(segments[count,0:2])
-					count+=1
-	segments=segments[0:count,:]
+            ord1 = np.nonzero(nods1[0] == elements[el1, :])[0][0]
+            ord2 = np.nonzero(nods1[1] == elements[el1, :])[0][0]
 
-	return segments
+    #swap segment nodes if necessary
+            if ((ord1 == 0 and ord2 == 1) or (ord1 == 1 and ord2 == 2) or (ord1 == 2 and ord2 == 0)):
+                temp = segments[count, 0]
+                segments[count, 0] = segments[count, 1]
+                segments[count, 1] = temp
+            segments[count, 0:2] = np.flipud(segments[count, 0:2])
+            count += 1
+        else:
+            nods1 = elements[el1, :]
+            flag = np.setdiff1d(nods1, elements[els2, :])
+            for j in range(0, 3):
+                nods = np.delete(nods1, j)
+                if np.any(m.ismember(flag, nods)):
+                    segments[count, :] = [nods[0], nods[1], el1 + 1]
+                    ord1 = np.nonzero(nods[0] == elements[el1, :])[0][0]
+                    ord2 = np.nonzero(nods[1] == elements[el1, :])[0][0]
+                    if ((ord1 == 0 and ord2 == 1) or (ord1 == 1 and ord2 == 2) or (ord1 == 2 and ord2 == 0)):
+                        temp = segments[count, 0]
+                        segments[count, 0] = segments[count, 1]
+                        segments[count, 1] = temp
+                    segments[count, 0:2] = np.flipud(segments[count, 0:2])
+                    count += 1
+    segments = segments[0:count, :]
 
+    return segments
Index: /issm/trunk/src/m/parameterization/killberg.m
===================================================================
--- /issm/trunk/src/m/parameterization/killberg.m	(revision 24313)
+++ /issm/trunk/src/m/parameterization/killberg.m	(revision 24313)
@@ -0,0 +1,60 @@
+%function ice_levelset = killberg(md)
+function ice_levelset = killberg(md)
+%KILLBERG - kill ice berg
+%
+%   check md.mask.ice_levelset and md.mask.groundedice_levelset and
+%   remove icebergs from md.mask.ice_levelset. This function is adapted
+%   from src/c/modules/KillIcebergsx/KillIcebergsx.cpp
+%
+%   Usage:
+%      ice_levelset = killberg(md)
+
+%Get number of vertices per element
+nbv_per_element = size(md.mesh.elements,2);
+
+%Initialize vectors (mask = is active and connected to grounded ice)
+mask         = zeros(md.mesh.numberofvertices,1);
+element_flag = zeros(md.mesh.numberofelements,1);
+
+disp('Looking for isolated patches of floating ice (icebergs)');
+
+%do not go through elements that don't have ice, mark flag as 1 (done)
+isice = min(md.mask.ice_levelset(md.mesh.elements),[],2)<0;
+element_flag(find(~isice)) = 1;
+
+%do not go through elements that are grounded, mark flag as 1 (done)
+%and initialize mask as 1 for all vertices of these elements
+isgrounded = max(md.mask.groundedice_levelset(md.mesh.elements),[],2)>0;
+pos = find(isgrounded);
+element_flag(pos) = 1;
+mask(md.mesh.elements(pos,:)) = 1;
+
+iter = 1;
+more = true;
+while(more)
+	disp(['   -- iteration ' num2str(iter)]);
+	more = false;
+
+	for i=find(~element_flag)'
+		indices = md.mesh.elements(i,:);
+		MAX=max(mask(indices));
+		if(MAX==0)
+			continue;
+		else
+			element_flag(i) = 1;
+			mask(indices) = 1;
+			more = true;
+		end
+	end
+	iter = iter+1;
+end
+
+%OK now change ice_levelset accroding to mask
+pos = find(mask==0 & md.mask.ice_levelset<0);
+if numel(pos)
+	disp(['REMOVING ' num2str(numel(pos)) ' vertices on icebergs']);
+	ice_levelset = md.mask.ice_levelset;
+	ice_levelset(pos) = +1;
+else
+	disp('No iceberg found!');
+end
Index: /issm/trunk/src/m/parameterization/parameterize.py
===================================================================
--- /issm/trunk/src/m/parameterization/parameterize.py	(revision 24312)
+++ /issm/trunk/src/m/parameterization/parameterize.py	(revision 24313)
@@ -2,32 +2,32 @@
 import datetime
 
-def parameterize(md,parametername):
-	"""
-	PARAMETERIZE - parameterize a model
 
-	   from a parameter python file, start filling in all the model fields that were not 
-	   filled in by the mesh.py and mask.py model methods.
-	   Warning: the parameter file must be able to be run in Python
+def parameterize(md, parametername):
+    """
+    PARAMETERIZE - parameterize a model
 
-	   Usage:
-	      md=parameterize(md,parametername)
+       from a parameter python file, start filling in all the model fields that were not
+       filled in by the mesh.py and mask.py model methods.
+       Warning: the parameter file must be able to be run in Python
 
-	   Example:
-	      md=parameterize(md,'Square.par');
-	"""
+       Usage:
+          md = parameterize(md, parametername)
 
-	#some checks
-	if not os.path.exists(parametername):
-		raise IOError("parameterize error message: file '%s' not found!" % parametername)
+       Example:
+          md = parameterize(md, 'Square.par')
+    """
 
-	#Try and run parameter file.
-	execfile(parametername)
+    #some checks
+    if not os.path.exists(parametername):
+        raise IOError("parameterize error message: file '%s' not found!" % parametername)
 
-	#Name and notes
-	if not md.miscellaneous.name:
-		md.miscellaneous.name=os.path.basename(parametername).split('.')[0]
+    #Try and run parameter file.
+    exec(compile(open(parametername).read(), parametername, 'exec'))
 
-	md.miscellaneous.notes="Model created by using parameter file: '%s' on: %s." % (parametername,datetime.datetime.strftime(datetime.datetime.now(),'%c'))
+    #Name and notes
+    if not md.miscellaneous.name:
+        md.miscellaneous.name = os.path.basename(parametername).split('.')[0]
 
-	return md
+    md.miscellaneous.notes = "Model created by using parameter file: '%s' on: %s." % (parametername, datetime.datetime.strftime(datetime.datetime.now(), '%c'))
 
+    return md
Index: /issm/trunk/src/m/parameterization/setflowequation.m
===================================================================
--- /issm/trunk/src/m/parameterization/setflowequation.m	(revision 24312)
+++ /issm/trunk/src/m/parameterization/setflowequation.m	(revision 24313)
@@ -116,5 +116,7 @@
 
 %Now take care of the coupling between SSA and HO
-md.stressbalance.vertex_pairing=[];
+if strcmpi(coupling_method,'penalties'),
+	md.stressbalance.vertex_pairing=[];
+end
 nodeonSSAHO=zeros(md.mesh.numberofvertices,1);
 nodeonHOFS=zeros(md.mesh.numberofvertices,1);
Index: /issm/trunk/src/m/parameterization/setflowequation.py
===================================================================
--- /issm/trunk/src/m/parameterization/setflowequation.py	(revision 24312)
+++ /issm/trunk/src/m/parameterization/setflowequation.py	(revision 24313)
@@ -4,284 +4,286 @@
 from FlagElements import FlagElements
 
-def setflowequation(md,*args):
-	"""
-	SETFLOWEQUATION - associate a solution type to each element
-
-	   This routine works like plotmodel: it works with an even number of inputs
-	   'SIA','SSA','HO','L1L2','FS' and 'fill' are the possible options
-	   that must be followed by the corresponding exp file or flags list
-	   It can either be a domain file (argus type, .exp extension), or an array of element flags. 
-	   If user wants every element outside the domain to be 
-	   setflowequationd, add '~' to the name of the domain file (ex: '~HO.exp');
-	   an empty string '' will be considered as an empty domain
-	   a string 'all' will be considered as the entire domain
-	   You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
-
-	   Usage:
-	      md=setflowequation(md,varargin)
-
-	   Example:
-	      md=setflowequation(md,'HO','HO.exp',fill','SIA','coupling','tiling');
-	"""
-
-	#some checks on list of arguments
-	if not isinstance(md,model) or not len(args):
-		raise TypeError("setflowequation error message")
-
-	#process options
-	options=pairoptions(*args)
-	#	options=deleteduplicates(options,1);
-
-	#Find_out what kind of coupling to use
-	coupling_method=options.getfieldvalue('coupling','tiling')
-	if not coupling_method in ['tiling','penalties']:
-		raise TypeError("coupling type can only be: tiling or penalties")
-
-	#recover elements distribution
-	SIAflag   = FlagElements(md,options.getfieldvalue('SIA',''))
-	SSAflag = FlagElements(md,options.getfieldvalue('SSA',''))
-	HOflag   = FlagElements(md,options.getfieldvalue('HO',''))
-	L1L2flag     = FlagElements(md,options.getfieldvalue('L1L2',''))
-	FSflag   = FlagElements(md,options.getfieldvalue('FS',''))
-	filltype     = options.getfieldvalue('fill','none')
-	#Flag the elements that have not been flagged as filltype
-	if 'SIA' in filltype:
-		SIAflag= ~SSAflag & ~HOflag
-	elif 'SSA' in filltype:
-		SSAflag=~SIAflag & ~HOflag & ~FSflag
-	elif 'HO' in filltype:
-		HOflag=~SIAflag & ~SSAflag & ~FSflag
-	#check that each element has at least one flag
-	if not any(SIAflag+SSAflag+L1L2flag+HOflag+FSflag):
-		raise TypeError("elements type not assigned, supported models are 'SIA','SSA','HO' and 'FS'")
-
-	#check that each element has only one flag
-	if any(SIAflag+SSAflag+L1L2flag+HOflag+FSflag>1):
-		print "setflowequation warning message: some elements have several types, higher order type is used for them"
-		SIAflag[np.where(np.logical_and(SIAflag,SSAflag))]=False
-		SIAflag[np.where(np.logical_and(SIAflag,HOflag))]=False
-		SSAflag[np.where(np.logical_and(SSAflag,HOflag))]=False
-
-		#check that L1L2 is not coupled to any other model for now
-		if any(L1L2flag) and any(SIAflag+SSAflag+HOflag+FSflag):
-			raise TypeError('L1L2 cannot be coupled to any other model')
-
-		#Check that no HO or FS for 2d mesh
-		if domaintype(md.mesh)=='2Dhorizontal':
-			if any(FSflag+HOflag):
-				raise TypeError('FS and HO elements not allowed in 2d mesh, extrude it first')
-
-	#FS can only be used alone for now:
-	if any(FSflag) and any(SIAflag):
-		raise TypeError("FS cannot be used with any other model for now, put FS everywhere")
-
-	#Initialize node fields
-	nodeonSIA=np.zeros(md.mesh.numberofvertices,bool)
-	nodeonSIA[md.mesh.elements[np.where(SIAflag),:]-1]=True
-	nodeonSSA=np.zeros(md.mesh.numberofvertices,bool)
-	nodeonSSA[md.mesh.elements[np.where(SSAflag),:]-1]=True
-	nodeonL1L2=np.zeros(md.mesh.numberofvertices,bool)
-	nodeonL1L2[md.mesh.elements[np.where(L1L2flag),:]-1]=True
-	nodeonHO=np.zeros(md.mesh.numberofvertices,bool)
-	nodeonHO[md.mesh.elements[np.where(HOflag),:]-1]=True
-	nodeonFS=np.zeros(md.mesh.numberofvertices,bool)
-	noneflag=np.zeros(md.mesh.numberofelements,bool)
-
-	#First modify FSflag to get rid of elements contrained everywhere (spc + border with HO or SSA)
-	if any(FSflag):
-		fullspcnodes=np.logical_or(~np.isnan(md.stressbalance.spcvx)+~np.isnan(md.stressbalance.spcvy)+~np.isnan(md.stressbalance.spcvz),np.logical_and(nodeonHO,nodeonFS))    #find all the nodes on the boundary of the domain without icefront
-		fullspcelems=np.sum(fullspcnodes[md.mesh.elements-1],axis=1)==6    #find all the nodes on the boundary of the domain without icefront
-		FSflag[np.where(fullspcelems.reshape(-1))]=False
-		nodeonFS[md.mesh.elements[np.where(FSflag),:]-1]=True
-
-	#Then complete with NoneApproximation or the other model used if there is no FS
-	if any(FSflag): 
-		if   any(HOflag):    #fill with HO
-			HOflag[~FSflag]=True
-			nodeonHO[md.mesh.elements[np.where(HOflag),:]-1]=True
-		elif any(SSAflag):    #fill with SSA
-			SSAflag[~FSflag]=True
-			nodeonSSA[md.mesh.elements[np.where(SSAflag),:]-1]=True
-		else:    #fill with none 
-			noneflag[np.where(~FSflag)]=True
-
-	#Now take care of the coupling between SSA and HO
-	md.stressbalance.vertex_pairing=np.array([])
-	nodeonSSAHO=np.zeros(md.mesh.numberofvertices,bool)
-	nodeonHOFS=np.zeros(md.mesh.numberofvertices,bool)
-	nodeonSSAFS=np.zeros(md.mesh.numberofvertices,bool)
-	SSAHOflag=np.zeros(md.mesh.numberofelements,bool)
-	SSAFSflag=np.zeros(md.mesh.numberofelements,bool)
-	HOFSflag=np.zeros(md.mesh.numberofelements,bool)
-	if coupling_method=='penalties':
-		#Create the border nodes between HO and SSA and extrude them
-		numnodes2d=md.mesh.numberofvertices2d
-		numlayers=md.mesh.numberoflayers
-		bordernodes2d=np.where(np.logical_and(nodeonHO[0:numnodes2d],nodeonSSA[0:numnodes2d]))[0]+1    #Nodes connected to two different types of elements
-
-		#initialize and fill in penalties structure
-		if np.all(np.logical_not(np.isnan(bordernodes2d))):
-			penalties=np.zeros((0,2))
-			for	i in xrange(1,numlayers):
-				penalties=np.vstack((penalties,np.vstack((bordernodes2d,bordernodes2d+md.mesh.numberofvertices2d*(i))).T))
-			md.stressbalance.vertex_pairing=penalties
-
-	elif coupling_method=='tiling':
-		if any(SSAflag) and any(HOflag):    #coupling SSA HO
-			#Find node at the border
-			nodeonSSAHO[np.where(np.logical_and(nodeonSSA,nodeonHO))]=True
-			#SSA elements in contact with this layer become SSAHO elements
-			matrixelements=nodeonSSAHO[md.mesh.elements-1]
-			commonelements=np.sum(matrixelements,axis=1)!=0
-			commonelements[np.where(HOflag)]=False    #only one layer: the elements previously in SSA
-			SSAflag[np.where(commonelements)]=False    #these elements are now SSAHOelements
-			SSAHOflag[np.where(commonelements)]=True
-			nodeonSSA[:]=False
-			nodeonSSA[md.mesh.elements[np.where(SSAflag),:]-1]=True
-
-			#rule out elements that don't touch the 2 boundaries
-			pos=np.where(SSAHOflag)[0]
-			elist=np.zeros(np.size(pos),dtype=int)
-			elist = elist + np.sum(nodeonSSA[md.mesh.elements[pos,:]-1],axis=1).astype(bool)
-			elist = elist - np.sum(nodeonHO[md.mesh.elements[pos,:]-1]  ,axis=1).astype(bool)
-			pos1=np.where(elist==1)[0]
-			SSAflag[pos[pos1]]=True
-			SSAHOflag[pos[pos1]]=False
-			pos2=np.where(elist==-1)[0]
-			HOflag[pos[pos2]]=True
-			SSAHOflag[pos[pos2]]=False
-
-			#Recompute nodes associated to these elements
-			nodeonSSA[:]=False
-			nodeonSSA[md.mesh.elements[np.where(SSAflag),:]-1]=True
-			nodeonHO[:]=False
-			nodeonHO[md.mesh.elements[np.where(HOflag),:]-1]=True
-			nodeonSSAHO[:]=False
-			nodeonSSAHO[md.mesh.elements[np.where(SSAHOflag),:]-1]=True
-
-		elif any(HOflag) and any(FSflag):    #coupling HO FS
-			#Find node at the border
-			nodeonHOFS[np.where(np.logical_and(nodeonHO,nodeonFS))]=True
-			#FS elements in contact with this layer become HOFS elements
-			matrixelements=nodeonHOFS[md.mesh.elements-1]
-			commonelements=np.sum(matrixelements,axis=1)!=0
-			commonelements[np.where(HOflag)]=False    #only one layer: the elements previously in SSA
-			FSflag[np.where(commonelements)]=False    #these elements are now SSAHOelements
-			HOFSflag[np.where(commonelements)]=True
-			nodeonFS=np.zeros(md.mesh.numberofvertices,bool)
-			nodeonFS[md.mesh.elements[np.where(FSflag),:]-1]=True
-
-			#rule out elements that don't touch the 2 boundaries
-			pos=np.where(HOFSflag)[0]
-			elist=np.zeros(np.size(pos),dtype=int)
-			elist = elist + np.sum(nodeonFS[md.mesh.elements[pos,:]-1],axis=1).astype(bool)
-			elist = elist - np.sum(nodeonHO[md.mesh.elements[pos,:]-1],axis=1).astype(bool)
-			pos1=np.where(elist==1)[0]
-			FSflag[pos[pos1]]=True
-			HOFSflag[pos[pos1]]=False
-			pos2=np.where(elist==-1)[0]
-			HOflag[pos[pos2]]=True
-			HOFSflag[pos[pos2]]=False
-
-			#Recompute nodes associated to these elements
-			nodeonFS[:]=False
-			nodeonFS[md.mesh.elements[np.where(FSflag),:]-1]=True
-			nodeonHO[:]=False
-			nodeonHO[md.mesh.elements[np.where(HOflag),:]-1]=True
-			nodeonHOFS[:]=False
-			nodeonHOFS[md.mesh.elements[np.where(HOFSflag),:]-1]=True
-		elif any(FSflag) and any(SSAflag):
-			#Find node at the border
-			nodeonSSAFS[np.where(np.logical_and(nodeonSSA,nodeonFS))]=True
-			#FS elements in contact with this layer become SSAFS elements
-			matrixelements=nodeonSSAFS[md.mesh.elements-1]
-			commonelements=np.sum(matrixelements,axis=1)!=0
-			commonelements[np.where(SSAflag)]=False    #only one layer: the elements previously in SSA
-			FSflag[np.where(commonelements)]=False    #these elements are now SSASSAelements
-			SSAFSflag[np.where(commonelements)]=True
-			nodeonFS=np.zeros(md.mesh.numberofvertices,bool)
-			nodeonFS[md.mesh.elements[np.where(FSflag),:]-1]=True
-
-			#rule out elements that don't touch the 2 boundaries
-			pos=np.where(SSAFSflag)[0]
-			elist=np.zeros(np.size(pos),dtype=int)
-			elist = elist + np.sum(nodeonSSA[md.mesh.elements[pos,:]-1],axis=1).astype(bool)
-			elist = elist - np.sum(nodeonFS[md.mesh.elements[pos,:]-1],axis=1).astype(bool)
-			pos1=np.where(elist==1)[0]
-			SSAflag[pos[pos1]]=True
-			SSAFSflag[pos[pos1]]=False
-			pos2=np.where(elist==-1)[0]
-			FSflag[pos[pos2]]=True
-			SSAFSflag[pos[pos2]]=False
-
-			#Recompute nodes associated to these elements
-			nodeonSSA[:]=False
-			nodeonSSA[md.mesh.elements[np.where(SSAflag),:]-1]=True
-			nodeonFS[:]=False
-			nodeonFS[md.mesh.elements[np.where(FSflag),:]-1]=True
-			nodeonSSAFS[:]=False
-			nodeonSSAFS[md.mesh.elements[np.where(SSAFSflag),:]-1]=True
-
-		elif any(FSflag) and any(SIAflag):
-			raise TypeError("type of coupling not supported yet")
-
-	#Create SSAHOApproximation where needed
-	md.flowequation.element_equation=np.zeros(md.mesh.numberofelements,int)
-	md.flowequation.element_equation[np.where(noneflag)]=0
-	md.flowequation.element_equation[np.where(SIAflag)]=1
-	md.flowequation.element_equation[np.where(SSAflag)]=2
-	md.flowequation.element_equation[np.where(L1L2flag)]=3
-	md.flowequation.element_equation[np.where(HOflag)]=4
-	md.flowequation.element_equation[np.where(FSflag)]=5
-	md.flowequation.element_equation[np.where(SSAHOflag)]=6
-	md.flowequation.element_equation[np.where(SSAFSflag)]=7
-	md.flowequation.element_equation[np.where(HOFSflag)]=8
-
-	#border
-	md.flowequation.borderHO=nodeonHO
-	md.flowequation.borderSSA=nodeonSSA
-	md.flowequation.borderFS=nodeonFS
-
-	#Create vertices_type
-	md.flowequation.vertex_equation=np.zeros(md.mesh.numberofvertices,int)
-	pos=np.where(nodeonSSA)
-	md.flowequation.vertex_equation[pos]=2
-	pos=np.where(nodeonL1L2)
-	md.flowequation.vertex_equation[pos]=3
-	pos=np.where(nodeonHO)
-	md.flowequation.vertex_equation[pos]=4
-	pos=np.where(nodeonFS)
-	md.flowequation.vertex_equation[pos]=5
-	#DO SIA LAST! Otherwise spcs might not be set up correctly (SIA should have priority)
-	pos=np.where(nodeonSIA)
-	md.flowequation.vertex_equation[pos]=1
-	if any(FSflag):
-		pos=np.where(np.logical_not(nodeonFS))
-		if not (any(HOflag) or any(SSAflag)):
-			md.flowequation.vertex_equation[pos]=0
-	pos=np.where(nodeonSSAHO)
-	md.flowequation.vertex_equation[pos]=6
-	pos=np.where(nodeonHOFS)
-	md.flowequation.vertex_equation[pos]=7
-	pos=np.where(nodeonSSAFS)
-	md.flowequation.vertex_equation[pos]=8
-
-	#figure out solution types
-	md.flowequation.isSIA=any(md.flowequation.element_equation==1)
-	md.flowequation.isSSA=any(md.flowequation.element_equation==2)
-	md.flowequation.isL1L2=any(md.flowequation.element_equation==3)
-	md.flowequation.isHO=any(md.flowequation.element_equation==4)
-	md.flowequation.isFS=any(md.flowequation.element_equation==5)
-
-	return md
-
-	#Check that tiling can work:
-	if any(md.flowequation.borderSSA) and any(md.flowequation.borderHO) and any(md.flowequation.borderHO + md.flowequation.borderSSA !=1):
-		raise TypeError("error coupling domain too irregular")
-	if any(md.flowequation.borderSSA) and any(md.flowequation.borderFS) and any(md.flowequation.borderFS + md.flowequation.borderSSA !=1):
-		raise TypeError("error coupling domain too irregular")
-	if any(md.flowequation.borderFS) and any(md.flowequation.borderHO) and any(md.flowequation.borderHO + md.flowequation.borderFS !=1):
-		raise TypeError("error coupling domain too irregular")
-
-	return md
-
+
+def setflowequation(md, *args):
+    """
+    SETFLOWEQUATION - associate a solution type to each element
+
+       This routine works like plotmodel: it works with an even number of inputs
+       'SIA', 'SSA', 'HO', 'L1L2', 'FS' and 'fill' are the possible options
+       that must be followed by the corresponding exp file or flags list
+       It can either be a domain file (argus type, .exp extension), or an array of element flags.
+       If user wants every element outside the domain to be
+       setflowequationd, add '~' to the name of the domain file (ex: '~HO.exp')
+       an empty string '' will be considered as an empty domain
+       a string 'all' will be considered as the entire domain
+       You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling'
+
+       Usage:
+          md = setflowequation(md, varargin)
+
+       Example:
+          md = setflowequation(md, 'HO', 'HO.exp', fill', 'SIA', 'coupling', 'tiling')
+    """
+
+    #some checks on list of arguments
+    if not isinstance(md, model) or not len(args):
+        raise TypeError("setflowequation error message")
+
+    #process options
+    options = pairoptions(*args)
+    #    options = deleteduplicates(options, 1)
+
+    #Find_out what kind of coupling to use
+    coupling_method = options.getfieldvalue('coupling', 'tiling')
+    if coupling_method not in ['tiling', 'penalties']:
+        raise TypeError("coupling type can only be: tiling or penalties")
+
+    #recover elements distribution
+    SIAflag = FlagElements(md, options.getfieldvalue('SIA', ''))
+    SSAflag = FlagElements(md, options.getfieldvalue('SSA', ''))
+    HOflag = FlagElements(md, options.getfieldvalue('HO', ''))
+    L1L2flag = FlagElements(md, options.getfieldvalue('L1L2', ''))
+    FSflag = FlagElements(md, options.getfieldvalue('FS', ''))
+    filltype = options.getfieldvalue('fill', 'none')
+
+    #Flag the elements that have not been flagged as filltype
+    if 'SIA' in filltype:
+        SIAflag = ~SSAflag & ~HOflag
+    elif 'SSA' in filltype:
+        SSAflag = ~SIAflag & ~HOflag & ~FSflag
+    elif 'HO' in filltype:
+        HOflag = ~SIAflag & ~SSAflag & ~FSflag
+    #check that each element has at least one flag
+    if not any(SIAflag + SSAflag + L1L2flag + HOflag + FSflag):
+        raise TypeError("elements type not assigned, supported models are 'SIA', 'SSA', 'HO' and 'FS'")
+
+    #check that each element has only one flag
+    if any(SIAflag + SSAflag + L1L2flag + HOflag + FSflag > 1):
+        print("setflowequation warning message: some elements have several types, higher order type is used for them")
+        SIAflag[np.where(np.logical_and(SIAflag, SSAflag))] = False
+        SIAflag[np.where(np.logical_and(SIAflag, HOflag))] = False
+        SSAflag[np.where(np.logical_and(SSAflag, HOflag))] = False
+
+        #check that L1L2 is not coupled to any other model for now
+        if any(L1L2flag) and any(SIAflag + SSAflag + HOflag + FSflag):
+            raise TypeError('L1L2 cannot be coupled to any other model')
+
+        #Check that no HO or FS for 2d mesh
+        if md.mesh.domaintype == '2Dhorizontal':
+            if any(FSflag + HOflag):
+                raise TypeError('FS and HO elements not allowed in 2d mesh, extrude it first')
+
+    #FS can only be used alone for now:
+    if any(FSflag) and any(SIAflag):
+        raise TypeError("FS cannot be used with any other model for now, put FS everywhere")
+
+    #Initialize node fields
+    nodeonSIA = np.zeros(md.mesh.numberofvertices, bool)
+    nodeonSIA[md.mesh.elements[np.where(SIAflag), :] - 1] = True
+    nodeonSSA = np.zeros(md.mesh.numberofvertices, bool)
+    nodeonSSA[md.mesh.elements[np.where(SSAflag), :] - 1] = True
+    nodeonL1L2 = np.zeros(md.mesh.numberofvertices, bool)
+    nodeonL1L2[md.mesh.elements[np.where(L1L2flag), :] - 1] = True
+    nodeonHO = np.zeros(md.mesh.numberofvertices, bool)
+    nodeonHO[md.mesh.elements[np.where(HOflag), :] - 1] = True
+    nodeonFS = np.zeros(md.mesh.numberofvertices, bool)
+    noneflag = np.zeros(md.mesh.numberofelements, bool)
+
+    #First modify FSflag to get rid of elements contrained everywhere (spc + border with HO or SSA)
+    if any(FSflag):
+        fullspcnodes = np.logical_or(~np.isnan(md.stressbalance.spcvx) & ~np.isnan(md.stressbalance.spcvy) & ~np.isnan(md.stressbalance.spcvz), np.logical_and(nodeonHO, nodeonFS))  #find all the nodes on the boundary of the domain without icefront
+        fullspcelems = np.sum(fullspcnodes[md.mesh.elements - 1], axis=1) == 6  #find all the nodes on the boundary of the domain without icefront
+        FSflag[np.where(fullspcelems.reshape(-1))] = False
+        nodeonFS[md.mesh.elements[np.where(FSflag), :] - 1] = True
+
+    #Then complete with NoneApproximation or the other model used if there is no FS
+    if any(FSflag):
+        if any(HOflag):  #fill with HO
+            HOflag[~FSflag] = True
+            nodeonHO[md.mesh.elements[np.where(HOflag), :] - 1] = True
+        elif any(SSAflag):  #fill with SSA
+            SSAflag[~FSflag] = True
+            nodeonSSA[md.mesh.elements[np.where(SSAflag), :] - 1] = True
+        else:  #fill with none
+            noneflag[np.where(~FSflag)] = True
+
+    #Now take care of the coupling between SSA and HO
+    if coupling_method not in ['penalties']:
+        md.stressbalance.vertex_pairing = np.array([])
+    nodeonSSAHO = np.zeros(md.mesh.numberofvertices, bool)
+    nodeonHOFS = np.zeros(md.mesh.numberofvertices, bool)
+    nodeonSSAFS = np.zeros(md.mesh.numberofvertices, bool)
+    SSAHOflag = np.zeros(md.mesh.numberofelements, bool)
+    SSAFSflag = np.zeros(md.mesh.numberofelements, bool)
+    HOFSflag = np.zeros(md.mesh.numberofelements, bool)
+    if coupling_method == 'penalties':
+        #Create the border nodes between HO and SSA and extrude them
+        numnodes2d = md.mesh.numberofvertices2d
+        numlayers = md.mesh.numberoflayers
+        bordernodes2d = np.where(np.logical_and(nodeonHO[0:numnodes2d], nodeonSSA[0:numnodes2d]))[0] + 1  #Nodes connected to two different types of elements
+
+    #initialize and fill in penalties structure
+        if np.all(np.logical_not(np.isnan(bordernodes2d))):
+            penalties = np.zeros((0, 2))
+            for i in range(1, numlayers):
+                penalties = np.vstack((penalties, np.vstack((bordernodes2d, bordernodes2d + md.mesh.numberofvertices2d * (i))).T))
+            md.stressbalance.vertex_pairing = penalties
+
+    elif coupling_method == 'tiling':
+        if any(SSAflag) and any(HOflag):  #coupling SSA HO
+            #Find node at the border
+            nodeonSSAHO[np.where(np.logical_and(nodeonSSA, nodeonHO))] = True
+            #SSA elements in contact with this layer become SSAHO elements
+            matrixelements = nodeonSSAHO[md.mesh.elements - 1]
+            commonelements = np.sum(matrixelements, axis=1) != 0
+            commonelements[np.where(HOflag)] = False  #only one layer: the elements previously in SSA
+            SSAflag[np.where(commonelements)] = False  #these elements are now SSAHOelements
+            SSAHOflag[np.where(commonelements)] = True
+            nodeonSSA[:] = False
+            nodeonSSA[md.mesh.elements[np.where(SSAflag), :] - 1] = True
+
+            #rule out elements that don't touch the 2 boundaries
+            pos = np.where(SSAHOflag)[0]
+            elist = np.zeros(np.size(pos), dtype=int)
+            elist = elist + np.sum(nodeonSSA[md.mesh.elements[pos, :] - 1], axis=1).astype(bool)
+            elist = elist - np.sum(nodeonHO[md.mesh.elements[pos, :] - 1], axis=1).astype(bool)
+            pos1 = np.where(elist == 1)[0]
+            SSAflag[pos[pos1]] = True
+            SSAHOflag[pos[pos1]] = False
+            pos2 = np.where(elist == -1)[0]
+            HOflag[pos[pos2]] = True
+            SSAHOflag[pos[pos2]] = False
+
+            #Recompute nodes associated to these elements
+            nodeonSSA[:] = False
+            nodeonSSA[md.mesh.elements[np.where(SSAflag), :] - 1] = True
+            nodeonHO[:] = False
+            nodeonHO[md.mesh.elements[np.where(HOflag), :] - 1] = True
+            nodeonSSAHO[:] = False
+            nodeonSSAHO[md.mesh.elements[np.where(SSAHOflag), :] - 1] = True
+
+        elif any(HOflag) and any(FSflag):  #coupling HO FS
+            #Find node at the border
+            nodeonHOFS[np.where(np.logical_and(nodeonHO, nodeonFS))] = True
+            #FS elements in contact with this layer become HOFS elements
+            matrixelements = nodeonHOFS[md.mesh.elements - 1]
+            commonelements = np.sum(matrixelements, axis=1) != 0
+            commonelements[np.where(HOflag)] = False  #only one layer: the elements previously in SSA
+            FSflag[np.where(commonelements)] = False  #these elements are now SSAHOelements
+            HOFSflag[np.where(commonelements)] = True
+            nodeonFS = np.zeros(md.mesh.numberofvertices, bool)
+            nodeonFS[md.mesh.elements[np.where(FSflag), :] - 1] = True
+
+            #rule out elements that don't touch the 2 boundaries
+            pos = np.where(HOFSflag)[0]
+            elist = np.zeros(np.size(pos), dtype=int)
+            elist = elist + np.sum(nodeonFS[md.mesh.elements[pos, :] - 1], axis=1).astype(bool)
+            elist = elist - np.sum(nodeonHO[md.mesh.elements[pos, :] - 1], axis=1).astype(bool)
+            pos1 = np.where(elist == 1)[0]
+            FSflag[pos[pos1]] = True
+            HOFSflag[pos[pos1]] = False
+            pos2 = np.where(elist == -1)[0]
+            HOflag[pos[pos2]] = True
+            HOFSflag[pos[pos2]] = False
+
+            #Recompute nodes associated to these elements
+            nodeonFS[:] = False
+            nodeonFS[md.mesh.elements[np.where(FSflag), :] - 1] = True
+            nodeonHO[:] = False
+            nodeonHO[md.mesh.elements[np.where(HOflag), :] - 1] = True
+            nodeonHOFS[:] = False
+            nodeonHOFS[md.mesh.elements[np.where(HOFSflag), :] - 1] = True
+        elif any(FSflag) and any(SSAflag):
+            #Find node at the border
+            nodeonSSAFS[np.where(np.logical_and(nodeonSSA, nodeonFS))] = True
+            #FS elements in contact with this layer become SSAFS elements
+            matrixelements = nodeonSSAFS[md.mesh.elements - 1]
+            commonelements = np.sum(matrixelements, axis=1) != 0
+            commonelements[np.where(SSAflag)] = False  #only one layer: the elements previously in SSA
+            FSflag[np.where(commonelements)] = False  #these elements are now SSASSAelements
+            SSAFSflag[np.where(commonelements)] = True
+            nodeonFS = np.zeros(md.mesh.numberofvertices, bool)
+            nodeonFS[md.mesh.elements[np.where(FSflag), :] - 1] = True
+
+            #rule out elements that don't touch the 2 boundaries
+            pos = np.where(SSAFSflag)[0]
+            elist = np.zeros(np.size(pos), dtype=int)
+            elist = elist + np.sum(nodeonSSA[md.mesh.elements[pos, :] - 1], axis=1).astype(bool)
+            elist = elist - np.sum(nodeonFS[md.mesh.elements[pos, :] - 1], axis=1).astype(bool)
+            pos1 = np.where(elist == 1)[0]
+            SSAflag[pos[pos1]] = True
+            SSAFSflag[pos[pos1]] = False
+            pos2 = np.where(elist == -1)[0]
+            FSflag[pos[pos2]] = True
+            SSAFSflag[pos[pos2]] = False
+
+            #Recompute nodes associated to these elements
+            nodeonSSA[:] = False
+            nodeonSSA[md.mesh.elements[np.where(SSAflag), :] - 1] = True
+            nodeonFS[:] = False
+            nodeonFS[md.mesh.elements[np.where(FSflag), :] - 1] = True
+            nodeonSSAFS[:] = False
+            nodeonSSAFS[md.mesh.elements[np.where(SSAFSflag), :] - 1] = True
+
+        elif any(FSflag) and any(SIAflag):
+            raise TypeError("type of coupling not supported yet")
+
+    #Create SSAHOApproximation where needed
+    md.flowequation.element_equation = np.zeros(md.mesh.numberofelements, int)
+    md.flowequation.element_equation[np.where(noneflag)] = 0
+    md.flowequation.element_equation[np.where(SIAflag)] = 1
+    md.flowequation.element_equation[np.where(SSAflag)] = 2
+    md.flowequation.element_equation[np.where(L1L2flag)] = 3
+    md.flowequation.element_equation[np.where(HOflag)] = 4
+    md.flowequation.element_equation[np.where(FSflag)] = 5
+    md.flowequation.element_equation[np.where(SSAHOflag)] = 6
+    md.flowequation.element_equation[np.where(SSAFSflag)] = 7
+    md.flowequation.element_equation[np.where(HOFSflag)] = 8
+
+    #border
+    md.flowequation.borderHO = nodeonHO
+    md.flowequation.borderSSA = nodeonSSA
+    md.flowequation.borderFS = nodeonFS
+
+    #Create vertices_type
+    md.flowequation.vertex_equation = np.zeros(md.mesh.numberofvertices, int)
+    pos = np.where(nodeonSSA)
+    md.flowequation.vertex_equation[pos] = 2
+    pos = np.where(nodeonL1L2)
+    md.flowequation.vertex_equation[pos] = 3
+    pos = np.where(nodeonHO)
+    md.flowequation.vertex_equation[pos] = 4
+    pos = np.where(nodeonFS)
+    md.flowequation.vertex_equation[pos] = 5
+    #DO SIA LAST! Otherwise spcs might not be set up correctly (SIA should have priority)
+    pos = np.where(nodeonSIA)
+    md.flowequation.vertex_equation[pos] = 1
+    if any(FSflag):
+        pos = np.where(np.logical_not(nodeonFS))
+        if not (any(HOflag) or any(SSAflag)):
+            md.flowequation.vertex_equation[pos] = 0
+    pos = np.where(nodeonSSAHO)
+    md.flowequation.vertex_equation[pos] = 6
+    pos = np.where(nodeonHOFS)
+    md.flowequation.vertex_equation[pos] = 7
+    pos = np.where(nodeonSSAFS)
+    md.flowequation.vertex_equation[pos] = 8
+
+    #figure out solution types
+    md.flowequation.isSIA = any(md.flowequation.element_equation == 1)
+    md.flowequation.isSSA = any(md.flowequation.element_equation == 2)
+    md.flowequation.isL1L2 = any(md.flowequation.element_equation == 3)
+    md.flowequation.isHO = any(md.flowequation.element_equation == 4)
+    md.flowequation.isFS = any(md.flowequation.element_equation == 5)
+
+    return md
+
+    #Check that tiling can work:
+    if any(md.flowequation.borderSSA) and any(md.flowequation.borderHO) and any(md.flowequation.borderHO + md.flowequation.borderSSA != 1):
+        raise TypeError("error coupling domain too irregular")
+    if any(md.flowequation.borderSSA) and any(md.flowequation.borderFS) and any(md.flowequation.borderFS + md.flowequation.borderSSA != 1):
+        raise TypeError("error coupling domain too irregular")
+    if any(md.flowequation.borderFS) and any(md.flowequation.borderHO) and any(md.flowequation.borderHO + md.flowequation.borderFS != 1):
+        raise TypeError("error coupling domain too irregular")
+
+    return md
Index: /issm/trunk/src/m/parameterization/sethydrostaticmask.py
===================================================================
--- /issm/trunk/src/m/parameterization/sethydrostaticmask.py	(revision 24312)
+++ /issm/trunk/src/m/parameterization/sethydrostaticmask.py	(revision 24313)
@@ -1,35 +1,31 @@
 import numpy as np
-import os
-from model import model
-from FlagElements import FlagElements
-import pairoptions
-from ContourToMesh import ContourToMesh
 
-def setmask(md)
-	"""
-	SETHYDROSTATICMASK - establish groundedice_levelset field
 
-   Determines grounded and floating ice position based on 
+def setmask(md):
+    """
+    SETHYDROSTATICMASK - establish groundedice_levelset field
+
+   Determines grounded and floating ice position based on
    md.geometry.bed and md.geometry.thickness
 
    Usage:
-      md=sethydrostaticmask(md)
+      md = sethydrostaticmask(md)
 
    Examples:
-      md=sethydrostaticmask(md);
+      md = sethydrostaticmask(md)
    """
 
-	if np.size(md.geometry.bed,axis=0)!=md.mesh.numberofvertices or np.size(md.geometry.base,axis=0)!=md.mesh.numberofvertices or np.size(md.geometry.thickness,axis=0)!=md.mesh.numberofvertices:
-		raise IOError("hydrostaticmask error message: fields in md.geometry do not have the right size.")
+    if np.size(md.geometry.bed, axis=0) != md.mesh.numberofvertices or np.size(md.geometry.base, axis=0) != md.mesh.numberofvertices or np.size(md.geometry.thickness, axis=0) != md.mesh.numberofvertices:
+        raise IOError("hydrostaticmask error message: fields in md.geometry do not have the right size.")
 
-   # grounded ice level set
-   md.mask.groundedice_levelset=md.geometry.thickness+md.geometry.bed*md.materials.rho_water/md.materials.rho_ice
+    # grounded ice level set
+    md.mask.groundedice_levelset = md.geometry.thickness + md.geometry.bed * md.materials.rho_water / md.materials.rho_ice
 
-   #Check consistency of geometry
-	if any(md.geometry.base[np.nonzero(md.mask.groundedice_levelset>0.)]!=md.geometry.bed[np.nonzero(md.mask.groundedice_levelset>0.)]):
-	   print "WARNING: md.geometry.bed and md.geometry.base not equal on grounded ice"
+    #Check consistency of geometry
+    if any(md.geometry.base[np.nonzero(md.mask.groundedice_levelset > 0.)] != md.geometry.bed[np.nonzero(md.mask.groundedice_levelset > 0.)]):
+        print("WARNING: md.geometry.bed and md.geometry.base not equal on grounded ice")
 
-	if any(md.geometry.base[np.nonzero(md.mask.groundedice_levelset<=0.)]<md.geometry.bed[np.nonzero(md.mask.groundedice_levelset<=0.)]):
-		print "WARNING: md.geometry.base < md.geometry.bed on floating ice"
+    if any(md.geometry.base[np.nonzero(md.mask.groundedice_levelset <= 0.)] < md.geometry.bed[np.nonzero(md.mask.groundedice_levelset <= 0.)]):
+        print("WARNING: md.geometry.base < md.geometry.bed on floating ice")
 
-	return md
+    return md
Index: /issm/trunk/src/m/parameterization/setmask.py
===================================================================
--- /issm/trunk/src/m/parameterization/setmask.py	(revision 24312)
+++ /issm/trunk/src/m/parameterization/setmask.py	(revision 24313)
@@ -6,66 +6,67 @@
 from ContourToMesh import ContourToMesh
 
+
 def setmask(md, floatingicename, groundedicename, *args):
-	"""
-	SETMASK - establish boundaries between grounded and floating ice.
+    """
+    SETMASK - establish boundaries between grounded and floating ice.
 
-	   By default, ice is considered grounded. The contour floatingicename defines nodes 
-	   for which ice is floating. The contour groundedicename defines nodes inside an floatingice, 
-	   that are grounded (ie: ice rises, islands, etc ...)
-	   All input files are in the Argus format (extension .exp).
+       By default, ice is considered grounded. The contour floatingicename defines nodes
+       for which ice is floating. The contour groundedicename defines nodes inside an floatingice,
+       that are grounded (ie: ice rises, islands, etc ...)
+       All input files are in the Argus format (extension .exp).
 
-	   Usage:
-	      md=setmask(md,floatingicename,groundedicename)
+       Usage:
+          md = setmask(md, floatingicename, groundedicename)
 
-	   Examples:
-	      md=setmask(md,'all','');
-	      md=setmask(md,'Iceshelves.exp','Islands.exp');
-	"""
-	#some checks on list of arguments
-	if not isinstance(md,model):
-		raise TypeError("setmask error message")
+       Examples:
+          md = setmask(md, 'all', '')
+          md = setmask(md, 'Iceshelves.exp', 'Islands.exp')
+    """
+    #some checks on list of arguments
+    if not isinstance(md, model):
+        raise TypeError("setmask error message")
 
-	if len(args)%2:
-		raise TypeError("odd number of arguments provided in setmask")
+    if len(args) % 2:
+        raise TypeError("odd number of arguments provided in setmask")
 
-	#process options
-	options=pairoptions.pairoptions(*args)
+    #process options
+    options = pairoptions.pairoptions(*args)
 
-	#Get assigned fields
-	x = md.mesh.x
-	y = md.mesh.y
-	elements = md.mesh.elements
+    #Get assigned fields
+    x = md.mesh.x
+    y = md.mesh.y
+    elements = md.mesh.elements
 
-	#Assign elementonfloatingice, elementongroundedice, vertexongroundedice and vertexonfloatingice. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{
-	elementonfloatingice = FlagElements(md, floatingicename)
-	elementongroundedice = FlagElements(md, groundedicename) 
+    #Assign elementonfloatingice, elementongroundedice, vertexongroundedice and vertexonfloatingice. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{
+    elementonfloatingice = FlagElements(md, floatingicename)
+    elementongroundedice = FlagElements(md, groundedicename)
 
-	#Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous 
-	#arrays come from domain outlines that can intersect one another: 
+    #Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous
+    #arrays come from domain outlines that can intersect one another:
 
-	elementonfloatingice = np.logical_and(elementonfloatingice,np.logical_not(elementongroundedice))
-	elementongroundedice = np.logical_not(elementonfloatingice)
+    elementonfloatingice = np.logical_and(elementonfloatingice, np.logical_not(elementongroundedice))
+    elementongroundedice = np.logical_not(elementonfloatingice)
 
-	#the order here is important. we choose vertexongroundedice as default on the grounding line.
-	vertexonfloatingice = np.zeros(md.mesh.numberofvertices,'bool')
-	vertexongroundedice = np.zeros(md.mesh.numberofvertices,'bool')
-	vertexongroundedice[md.mesh.elements[np.nonzero(elementongroundedice),:]-1]=True
-	vertexonfloatingice[np.nonzero(np.logical_not(vertexongroundedice))]=True
-	#}}}
+    #the order here is important. we choose vertexongroundedice as default on the grounding line.
+    vertexonfloatingice = np.zeros(md.mesh.numberofvertices, 'bool')
+    vertexongroundedice = np.zeros(md.mesh.numberofvertices, 'bool')
+    vertexongroundedice[md.mesh.elements[np.nonzero(elementongroundedice), :] - 1] = True
+    vertexonfloatingice[np.nonzero(np.logical_not(vertexongroundedice))] = True
+    #}}}
 
-	#level sets
-	md.mask.groundedice_levelset = -1.*np.ones(md.mesh.numberofvertices)
-	md.mask.groundedice_levelset[md.mesh.elements[np.nonzero(elementongroundedice),:]-1]=1.
+    #level sets
+    md.mask.groundedice_levelset = -1. * np.ones(md.mesh.numberofvertices)
+    md.mask.groundedice_levelset[md.mesh.elements[np.nonzero(elementongroundedice), :] - 1] = 1.
 
-	if(len(args)):
-		md.mask.ice_levelset = 1.*np.ones(md.mesh.numberofvertices)
-		icedomainfile = options.getfieldvalue('icedomain','none')
-		if not os.path.exists(icedomainfile):
-			raise IOError("setmask error message: ice domain file '%s' not found." % icedomainfile)
-		#use contourtomesh to set ice values inside ice domain
-		vertexinsideicedomain,elementinsideicedomain=ContourToMesh(elements,x,y,icedomainfile,'node',1)
-		md.mask.ice_levelset[np.nonzero(vertexinsideicedomain)[0]] = -1.
-	else:
-		md.mask.ice_levelset = -1.*np.ones(md.mesh.numberofvertices)
+    if(len(args)):
+        md.mask.ice_levelset = 1. * np.ones(md.mesh.numberofvertices)
+        icedomainfile = options.getfieldvalue('icedomain', 'none')
+        if not os.path.exists(icedomainfile):
+            raise IOError("setmask error message: ice domain file '%s' not found." % icedomainfile)
+    #use contourtomesh to set ice values inside ice domain
+        vertexinsideicedomain, elementinsideicedomain = ContourToMesh(elements, x, y, icedomainfile, 'node', 1)
+        md.mask.ice_levelset[np.nonzero(vertexinsideicedomain)[0]] = -1.
+    else:
+        md.mask.ice_levelset = -1. * np.ones(md.mesh.numberofvertices)
 
-	return md
+    return md
Index: /issm/trunk/src/m/partition/AreaAverageOntoPartition.m
===================================================================
--- /issm/trunk/src/m/partition/AreaAverageOntoPartition.m	(revision 24312)
+++ /issm/trunk/src/m/partition/AreaAverageOntoPartition.m	(revision 24313)
@@ -29,13 +29,13 @@
 	%finally, project vector: 
 	vector=project2d(md3d,vector,layer);
-	md.qmu.partition=project2d(md3d,md3d.qmu.partition,layer);
+	md.qmu.vpartition=project2d(md3d,md3d.qmu.vpartition,layer);
 end
 
 %ok, first check that part is Matlab indexed
-part=md.qmu.partition+1;
+part=md.qmu.vpartition+1;
 
 %some check: 
 if md.qmu.numberofpartitions~=max(part),
-	error('AreaAverageOntoPartition error message: ''npart'' should be equal to max(md.qmu.partition)');
+	error('AreaAverageOntoPartition error message: ''npart'' should be equal to max(md.qmu.vpartition)');
 end
 
Index: /issm/trunk/src/m/partition/AreaAverageOntoPartition.py
===================================================================
--- /issm/trunk/src/m/partition/AreaAverageOntoPartition.py	(revision 24312)
+++ /issm/trunk/src/m/partition/AreaAverageOntoPartition.py	(revision 24313)
@@ -1,59 +1,60 @@
 import numpy as np
+import copy
+from adjacency import adjacency
+from project2d import project2d
 
-def AreaAverageOntoPartition(md,vector,layer=None):
-	'''AREAAVERAGEONTOPARTITION 
+
+def AreaAverageOntoPartition(md, vector, layer=None):
+    '''AREAAVERAGEONTOPARTITION
    compute partition values for a certain vector expressed on the vertices of the mesh.
    Use area weighted average.
 
    Usage:
-      average=AreaAverageOntoPartition(md,vector)
-      average=AreaAverageOntoPartition(md,vector,layer) #if in 3D, chose which layer is partitioned
+      average = AreaAverageOntoPartition(md, vector)
+      average = AreaAverageOntoPartition(md, vector, layer)  #if in 3D, chose which layer is partitioned
 '''
-	#some checks
-	if len(np.shape(md.mesh)) == 3:
-		if layer == None:
-			raise RuntimeError('AreaAverageOntoPartition: layer should be provided onto which Area Averaging occurs')
-		
-		#save 3D model
-		md3d = md
+    #some checks
+    if(md.mesh.dimension() == 3):
+        if layer is None:
+            raise RuntimeError('AreaAverageOntoPartition: layer should be provided onto which Area Averaging occurs')
 
-		md.mesh.elements = md.mesh.elements2d
-		md.mesh.x = md.mesh.x2d
-		md.mesh.y = md.mesh.y2d
-		md.mesh.numberofvertices = md.mesh.numberofvertices2d
-		md.mesh.numberofelements = md.mesh.numberofelements2d
-		md.qmu.vertex_weight = []
-		md.mesh.vertexconnectivity = []
+    #save 3D model
+        md3d = copy.deepcopy(md)
 
-		#run connectivity routine
-		md = adjacency(md)
+        md.mesh.elements = md.mesh.elements2d
+        md.mesh.x = md.mesh.x2d
+        md.mesh.y = md.mesh.y2d
+        md.mesh.numberofvertices = md.mesh.numberofvertices2d
+        md.mesh.numberofelements = md.mesh.numberofelements2d
+        md.qmu.vertex_weight = []
+        md.mesh.vertexconnectivity = []
 
-		#finally, project vector: 
-		vector = project2d(md3d,vector,layer)
-		md.qmu.partition = project2d(md3d,md3d.qmu.partition,layer)
+    #run connectivity routine
+        md = adjacency(md)
 
+    #finally, project vector:
+        vector = project2d(md3d, vector, layer)
+        md.qmu.vpartition = project2d(md3d, md3d.qmu.vpartition, layer)
 
-	#ok, first check that part is Matlab indexed
-	#part = md.qmu.partition
+    #ok, first check that part is Matlab indexed
+    part = (md.qmu.vpartition).copy()
+    part = part.flatten() + 1
 
-	#some check: 
-	if md.qmu.numberofpartitions != max(md.qmu.partition):
-		raise RuntimeError('AreaAverageOntoPartition error message: ''npart'' should be equal to max(md.qmu.partition)')
+    #some check:
+    if md.qmu.numberofpartitions != max(part):
+        raise RuntimeError('AreaAverageOntoPartition error message: ''npart'' should be equal to max(md.qmu.vpartition)')
 
+    #initialize output
+    partvector = np.zeros((max(part)))
 
-	#initialize output
-	partvector = np.zeros((max(md.qmu.partition),))
+    #start weight average
+    weightedvector = vector.flatten() * md.qmu.vertex_weight
+    for i in range(max(part)):
+        pos = np.where((part - 1) == i)
+        partvector[i] = sum(weightedvector[pos]) / sum(md.qmu.vertex_weight[pos])
 
-	#start weight average
-	weightedvector = vector*md.qmu.vertex_weight
-	for i in range(max(md.qmu.partition)):
-		pos=np.where(md.qmu.partition==i)
-		partvector[i]=sum(weightedvector[pos])/sum(md.qmu.vertex_weight[pos])
+    #in 3D, restore 3D model:
+    if(md.mesh.dimension() == 3):
+        md = copy.deepcopy(md3d)
 
-
-	#in 3D, restore 3D model:
-	if len(np.shape(md.mesh)) == 3:
-		md = md3d
-
-	return partvector
-
+    return partvector
Index: /issm/trunk/src/m/partition/adjacency.py
===================================================================
--- /issm/trunk/src/m/partition/adjacency.py	(revision 24312)
+++ /issm/trunk/src/m/partition/adjacency.py	(revision 24313)
@@ -4,30 +4,31 @@
 from GetAreas import *
 
+
 def adjacency(md):
-	#ADJACENCY -  compute adjacency matrix, list of vertices and list of weights.
-	#
-	#  function to create the adjacency matrix from the connectivity table.
-	#
-	#  the required output is:
-	#    md.adj_mat     (double [sparse nv x nv], vertex adjacency matrix)
-	#    md.qmu.vertex_weight        (double [nv], vertex weights)
+    #ADJACENCY - compute adjacency matrix, list of vertices and list of weights.
+    #
+    #  function to create the adjacency matrix from the connectivity table.
+    #
+    #  the required output is:
+    #    md.adj_mat     (double [sparse nv x nv], vertex adjacency matrix)
+    #    md.qmu.vertex_weight        (double [nv], vertex weights)
 
-	indi=np.array([md.mesh.elements[:,0],md.mesh.elements[:,1],md.mesh.elements[:,2]])
-	indj=np.array([md.mesh.elements[:,1],md.mesh.elements[:,2],md.mesh.elements[:,0]])
-	values=np.ones(np.shape(indi))
+    indi = np.array([md.mesh.elements[:, 0], md.mesh.elements[:, 1], md.mesh.elements[:, 2]])
+    indj = np.array([md.mesh.elements[:, 1], md.mesh.elements[:, 2], md.mesh.elements[:, 0]])
+    values = np.ones(np.shape(indi))
 
-	md.qmu.adjacency=m.sparse(indi,indj,values,md.mesh.numberofvertices,md.mesh.numberofvertices)
-	md.qmu.adjacency=np.logical_or(md.qmu.adjacency, md.qmu.adjacency.T).astype(float) #change to reshape(-1,1) if needed
+    md.qmu.adjacency = m.sparse(indi, indj, values, md.mesh.numberofvertices, md.mesh.numberofvertices)
+    md.qmu.adjacency = np.logical_or(md.qmu.adjacency, md.qmu.adjacency.T).astype(float)  #change to reshape(-1, 1) if needed
 
-	#now, build vwgt:
-	areas=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y)
+    #now, build vwgt:
+    areas = GetAreas(md.mesh.elements, md.mesh.x, md.mesh.y)
 
-	#get node connectivity
-	md.mesh.vertexconnectivity=NodeConnectivity(md.mesh.elements,md.mesh.numberofvertices)
+    #get node connectivity
+    md.mesh.vertexconnectivity = NodeConnectivity(md.mesh.elements, md.mesh.numberofvertices)
 
-	connectivity=md.mesh.vertexconnectivity[0][:,0:-1]
-	pos=np.where(connectivity)
-	connectivity[pos]=areas[connectivity[pos]-1]/3.
-	md.qmu.vertex_weight=np.sum(connectivity,1)
+    connectivity = md.mesh.vertexconnectivity[0][:, 0:-1]
+    pos = np.where(connectivity)
+    connectivity[pos] = areas[connectivity[pos] - 1] / 3.
+    md.qmu.vertex_weight = np.sum(connectivity, 1)
 
-	return md
+    return md
Index: /issm/trunk/src/m/partition/partitioner.m
===================================================================
--- /issm/trunk/src/m/partition/partitioner.m	(revision 24312)
+++ /issm/trunk/src/m/partition/partitioner.m	(revision 24313)
@@ -9,4 +9,5 @@
 %   section:  1 by defaults(1=bisection, 2=quadrisection, 3=octasection)
 %   recomputeadjacency:  'on' by default (set to 'off' to compute existing one)
+%   type: 'node' or 'element' partition vector (default to 'node') 
 %   Output: md.qmu.partition recover the partition vector
 %   
@@ -24,4 +25,5 @@
 options=addfielddefault(options,'section',1);
 options=addfielddefault(options,'recomputeadjacency','on');
+options=addfielddefault(options,'type','node');
 
 %get package: 
@@ -29,4 +31,5 @@
 npart=getfieldvalue(options,'npart');
 recomputeadjacency=getfieldvalue(options,'recomputeadjacency');
+vectortype=getfieldvalue(options,'type');
 
 if(dimension(md.mesh)==3),
@@ -53,42 +56,52 @@
 if strcmpi(package,'chaco'),
 
-	%  default method (from chaco.m)
-	method=[1 1 0 0 1 1 50 0 .001 7654321]';
-	method(1)=3;    %  global method (3=inertial (geometric))
-	method(3)=0;    %  vertex weights (0=off, 1=on)
+	if strcmpi(vectortype,'element')
+		error(['partitioner error message: package ' package ' does not allow element partitions.']);
+	else
 
-	%specify bisection
-	method(6)=getfieldvalue(options,'section');%  ndims (1=bisection, 2=quadrisection, 3=octasection)
+		%  default method (from chaco.m)
+		method=[1 1 0 0 1 1 50 0 .001 7654321]';
+		method(1)=3;    %  global method (3=inertial (geometric))
+		method(3)=0;    %  vertex weights (0=off, 1=on)
 
-	%are we using weights? 
-	if strcmpi(getfieldvalue(options,'weighting'),'on'),
-		weights=floor(md.qmu.vertex_weight/min(md.qmu.vertex_weight));
-		method(3)=1;
-	else 
-		weights=[];
-	end
+		%specify bisection
+		method(6)=getfieldvalue(options,'section');%  ndims (1=bisection, 2=quadrisection, 3=octasection)
 
-	%  partition into nparts
-	if isa(md.mesh,'mesh2d'),
-		part=Chaco(md.qmu.adjacency,weights,[],md.mesh.x, md.mesh.y,zeros(md.mesh.numberofvertices,1),method,npart,[])'+1; %index partitions from 1 up. like metis.
-	else
-		part=Chaco(md.qmu.adjacency,weights,[],md.mesh.x, md.mesh.y,md.mesh.z,method,npart,[])'+1; %index partitions from 1 up. like metis.
+		%are we using weights? 
+		if strcmpi(getfieldvalue(options,'weighting'),'on'),
+			weights=floor(md.qmu.vertex_weight/min(md.qmu.vertex_weight));
+			method(3)=1;
+		else 
+			weights=[];
+		end
+
+		%  partition into nparts
+		if isa(md.mesh,'mesh2d'),
+			part=Chaco(md.qmu.adjacency,weights,[],md.mesh.x, md.mesh.y,zeros(md.mesh.numberofvertices,1),method,npart,[])'+1; %index partitions from 1 up. like metis.
+		else
+			part=Chaco(md.qmu.adjacency,weights,[],md.mesh.x, md.mesh.y,md.mesh.z,method,npart,[])'+1; %index partitions from 1 up. like metis.
+		end
+
 	end
 
 elseif strcmpi(package,'scotch'),
 
-	%are we using weights? 
-	if strcmpi(getfieldvalue(options,'weighting'),'on'),
-		weights=floor(md.qmu.vertex_weight/min(md.qmu.vertex_weight));
+	if strcmpi(vectortype,'element')
+		error(['partitioner error message: package ' package ' does not allow element partitions.']);
 	else
-		weights=[];
+		%are we using weights? 
+		if strcmpi(getfieldvalue(options,'weighting'),'on'),
+			weights=floor(md.qmu.vertex_weight/min(md.qmu.vertex_weight));
+		else
+			weights=[];
+		end
+		maptab=Scotch(md.qmu.adjacency,[],weights,[],'cmplt',[npart]);
+
+		part=maptab(:,2)+1;%index partitions from 1 up. like metis.
 	end
-	maptab=Scotch(md.qmu.adjacency,[],weights,[],'cmplt',[npart]);
-
-	part=maptab(:,2)+1;%index partitions from 1 up. like metis.
 
 elseif strcmpi(package,'linear'),
 
-	if npart==md.mesh.numberofelements | md.qmu.numberofpartitions==md.mesh.numberofelements
+	if strcmpi(vectortype,'element')
 		part=1:1:md.mesh.numberofelements;
 		disp('Linear partitioner requesting partitions on elements');
@@ -99,5 +112,9 @@
 elseif strcmpi(package,'metis'),
 
-	[element_partitioning,part]=MeshPartition(md,md.qmu.numberofpartitions);
+	if strcmpi(vectortype,'element')
+		error(['partitioner error message: package ' package ' does not allow element partitions.']);
+	else
+		[element_partitioning,part]=MeshPartition(md,md.qmu.numberofpartitions);
+	end
 
 else
@@ -112,6 +129,24 @@
 	md3d.qmu.adjacency=md.qmu.adjacency;
 	md=md3d;
-	part=project3d(md,'vector',part','type','node');
+	if strcmpi(vectortype,'element')
+		part=project3d(md,'vector',part','type','element');
+	else
+		part=project3d(md,'vector',part','type','node');
+	end
 end
 
-md.qmu.partition=part;
+if size(part,1)==1
+	part=part';
+end
+
+if strcmpi(vectortype,'element')
+	md.qmu.epartition=part;
+	if isempty(md.qmu.vpartition) | (prod(size(md.qmu.vpartition))==1 & isnan(md.qmu.vpartition))
+		md.qmu.vpartition=zeros(md.mesh.numberofvertices,1);
+	end
+else
+	md.qmu.vpartition=part;
+	if isempty(md.qmu.epartition) | (prod(size(md.qmu.epartition))==1 & isnan(md.qmu.epartition))
+		md.qmu.epartition=zeros(md.mesh.numberofelements,1);
+	end
+end
Index: /issm/trunk/src/m/partition/partitioner.py
===================================================================
--- /issm/trunk/src/m/partition/partitioner.py	(revision 24312)
+++ /issm/trunk/src/m/partition/partitioner.py	(revision 24313)
@@ -1,126 +1,132 @@
 import numpy as np
+import copy
 from pairoptions import *
-import MatlabFuncs as m
 from adjacency import *
 from Chaco import *
-#from Scotch import *
 from MeshPartition import *
 from project3d import *
 from mesh2d import *
 
-def partitioner(md,*varargin):
-	help ='''
-PARTITIONER - partition mesh 
 
-   List of options to partitioner: 
+def partitioner(md, * varargin):
+    help = '''
+PARTITIONER - partition mesh
+
+   List of options to partitioner:
 
    package: 'chaco', 'metis'
    npart: number of partitions.
    weighting: 'on' or 'off': default off
-   section:  1 by defaults(1=bisection, 2=quadrisection, 3=octasection)
+   section:  1 by defaults(1 = bisection, 2 = quadrisection, 3 = octasection)
    recomputeadjacency:  'on' by default (set to 'off' to compute existing one)
+   type: 'node' or 'element' partition vector (default to 'node')
    Output: md.qmu.partition recover the partition vector
-   
+
    Usage:
-      md=partitioner(md,'package','chaco','npart',100,'weighting','on')
-	'''
+      md = partitioner(md, 'package', 'chaco', 'npart', 100, 'weighting', 'on')
+    '''
 
-	#get options: 
-	options=pairoptions(*varargin)
+    #get options:
+    options = pairoptions(* varargin)
 
-	#set defaults
-	options.addfielddefault('package','chaco')
-	options.addfielddefault('npart',10)
-	options.addfielddefault('weighting','on')
-	options.addfielddefault('section',1)
-	options.addfielddefault('recomputeadjacency','on')
+    #get options:
+    section = options.getfieldvalue('section', 1)
+    weighting = options.getfieldvalue('weighting', 'on')
+    package = options.getfieldvalue('package', 'chaco')  #default to chaco
+    npart = options.getfieldvalue('npart', 10)  # default to 10
+    recomputeadjacency = options.getfieldvalue('recomputeadjacency', 'on')  # default to on
+    vectortype = options.getfieldvalue('type', 'node')  #default to node
 
-	#get package: 
-	package=options.getfieldvalue('package')
-	npart=options.getfieldvalue('npart')
-	recomputeadjacency=options.getfieldvalue('recomputeadjacency')
+    if vectortype == 'element' and not package == 'linear':
+        raise RuntimeError('partitioner error message: package ' + str(package) + ' does not allow element partitions.')
 
-	if(np.ndim(md.mesh)==3):
-		#partitioning essentially happens in 2D. So partition in 2D, then 
-		#extrude the partition vector vertically. 
-		md3d=md #save  for later
-		md.mesh.elements=md.mesh.elements2d
-		md.mesh.x=md.mesh.x2d
-		md.mesh.y=md.mesh.y2d
-		md.mesh.numberofvertices=md.mesh.numberofvertices2d
-		md.mesh.numberofelements=md.mesh.numberofelements2d
-		md.qmu.vertex_weight=[]
-		md.mesh.vertexconnectivity=[]
-		recomputeadjacency='on'
+    if(md.mesh.dimension() == 3):
+        #partitioning essentially happens in 2D. So partition in 2D, then
+        #extrude the partition vector vertically.
+        md3d = copy.deepcopy(md)
+        md.mesh.elements = md.mesh.elements2d
+        md.mesh.x = md.mesh.x2d
+        md.mesh.y = md.mesh.y2d
+        md.mesh.numberofvertices = md.mesh.numberofvertices2d
+        md.mesh.numberofelements = md.mesh.numberofelements2d
+        md.qmu.vertex_weight = []
+        md.mesh.vertexconnectivity = []
+        recomputeadjacency = 'on'
 
-	#adjacency matrix if needed:
-	if m.strcmpi(recomputeadjacency,'on'):
-		md=adjacency(md)
-	else:
-		print 'skipping adjacency matrix computation as requested in the options'
+    #adjacency matrix if needed:
+    if recomputeadjacency == 'on':
+        md = adjacency(md)
+    else:
+        print('skipping adjacency matrix computation as requested in the options')
 
-	if m.strcmpi(package,'chaco'):
-		#raise RuntimeError('Chaco is not currently supported for this function')
+    if package == 'chaco':
+        #raise RuntimeError('Chaco is not currently supported for this function')
+        #  default method (from chaco.m)
+        method = np.array([1, 1, 0, 0, 1, 1, 50, 0, 0.001, 7654321])
+        method[0] = 3  #  global method (3 = inertial (geometric))
+        method[2] = 0  #  vertex weights (0 = off, 1 = on)
+        #specify bisection
+        method[5] = section  #  ndims (1 = bisection, 2 = quadrisection, 3 = octasection)
 
-		#  default method (from chaco.m)
-		method=np.array([1,1,0,0,1,1,50,0,.001,7654321])
-		method[0]=3    #  global method (3=inertial (geometric))
-		method[2]=0    #  vertex weights (0=off, 1=on)
+        #are we using weights?
+        if weighting == 'on':
+            weights = np.floor(md.qmu.vertex_weight / min(md.qmu.vertex_weight))
+            method[2] = 1
+        else:
+            weights = []
 
-		#specify bisection
-		method[5]=options.getfieldvalue('section')#  ndims (1=bisection, 2=quadrisection, 3=octasection)
+        method = method.reshape(-1, 1)  # transpose to 1x10 instead of 10
+        #  partition into nparts
+        if isinstance(md.mesh, mesh2d):
+            part = np.array(Chaco(md.qmu.adjacency, weights, np.array([]), md.mesh.x, md.mesh.y, np.zeros((md.mesh.numberofvertices, )), method, npart, np.array([]))).T + 1  #index partitions from 1 up. like metis.
+        else:
+            part = np.array(Chaco(md.qmu.adjacency, weights, np.array([]), md.mesh.x, md.mesh.y, md.mesh.z, method, npart, np.array([]))).T + 1  #index partitions from 1 up. like metis.
 
-		#are we using weights? 
-		if m.strcmpi(options.getfieldvalue('weighting'),'on'):
-			weights=np.floor(md.qmu.vertex_weight/min(md.qmu.vertex_weight))
-			method[2]=1
-		else:
-			weights=[]
-	
-		method = method.reshape(-1,1)	# transpose to 1x10 instead of 10
+    elif package == 'scotch':
+        raise RuntimeError('Scotch is not currently supported for this function')
 
-		#  partition into nparts
-		if isinstance(md.mesh,mesh2d):
-			part=np.array(Chaco(md.qmu.adjacency,weights,np.array([]),md.mesh.x, md.mesh.y,np.zeros((md.mesh.numberofvertices,)),method,npart,np.array([]))).T+1 #index partitions from 1 up. like metis.
-		else:
-			part=np.array(Chaco(md.qmu.adjacency,weights,np.array([]),md.mesh.x, md.mesh.y,md.mesh.z,method,npart,np.array([]))).T+1 #index partitions from 1 up. like metis.
-	
-	elif m.strcmpi(package,'scotch'):
-		raise RuntimeError('Scotch is not currently supported for this function')
+    #are we using weights?
+    #if m.strcmpi(options.getfieldvalue('weighting'), 'on'):
+    #weights = np.floor(md.qmu.vertex_weight / min(md.qmu.vertex_weight))
+    #else:
+    #weights = []
+    #maptab = Scotch(md.qmu.adjacency, [], weights, [], 'cmplt', [npart])
+    #part = maptab[:, 1] + 1  #index partitions from 1 up. like metis.
 
-		#are we using weights? 
-		#if m.strcmpi(options.getfieldvalue('weighting'),'on'):
-			#weights=np.floor(md.qmu.vertex_weight/min(md.qmu.vertex_weight))
-		#else:
-			#weights=[]
-	
-		#maptab=Scotch(md.qmu.adjacency,[],weights,[],'cmplt',[npart])
+    elif package == 'linear':
 
-		#part=maptab[:,1]+1#index partitions from 1 up. like metis.
+        if (npart == md.mesh.numberofelements) or (md.qmu.numberofpartitions == md.mesh.numberofelements):
+            part = np.arange(1, 1 + md.mesh.numberofelements, 1)
+            print('Linear partitioner requesting partitions on elements')
+        else:
+            part = np.arange(1, 1 + md.mesh.numberofvertices, 1)
 
-	elif m.strcmpi(package,'linear'):
+    elif package == 'metis':
+        raise RuntimeError('Metis/MeshPartition is not currently supported for this function')
+    #[element_partitioning, part] = MeshPartition(md, md.qmu.numberofpartitions)
 
-		if (npart == md.mesh.numberofelements) or (md.qmu.numberofpartitions == md.mesh.numberofelements):
-			part=np.arange(1,1+md.mesh.numberofelements,1)
-			print 'Linear partitioner requesting partitions on elements'
-		else:
-			part=np.arange(1,1+md.mesh.numberofvertices,1)
+    else:
+        print(help)
+        raise RuntimeError('partitioner error message: could not find ' + str(package) + ' partitioner')
 
-	elif m.strcmpi(package,'metis'):
-		raise RuntimeError('Metis/MeshPartition is not currently supported for this function')
-		#[element_partitioning,part]=MeshPartition(md,md.qmu.numberofpartitions)
+    #extrude if we are in 3D:
+    if md.mesh.dimension() == 3:
+        md3d.qmu.vertex_weight = md.qmu.vertex_weight
+        md3d.qmu.adjacency = md.qmu.adjacency
+        md = md3d
+        if vectortype == 'element':
+            part = project3d(md, 'vector', np.squeeze(part), 'type', 'element')
+        else:
+            part = project3d(md, 'vector', np.squeeze(part), 'type', 'node')
 
-	else:
-		print help
-		raise RuntimeError('partitioner error message: could not find '+str(package)+' partitioner')
+        part = part.reshape(-1, 1)
 
-	#extrude if we are in 3D:
-	if np.ndim(md.mesh)==3:
-		md3d.qmu.vertex_weight=md.qmu.vertex_weight
-		md3d.qmu.adjacency=md.qmu.adjacency
-		md=md3d
-		part=project3d(md,'vector',part.T,'type','node')
-
-	md.qmu.partition=part
-
-	return md
+    if vectortype == 'element':
+        md.qmu.epartition = part
+        if np.size(md.qmu.vpartition) == 0 or (np.size(md.qmu.vpartition) == 1 and np.isnan(md.qmu.vpartition)):
+            md.qmu.vpartition = np.zeros((md.mesh.numberofvertices, 1))
+    else:
+        md.qmu.vpartition = part
+        if np.size(md.qmu.epartition) == 0 or (np.size(md.qmu.epartition) == 1 and np.isnan(md.qmu.epartition)):
+            md.qmu.epartition = np.zeros((md.mesh.numberofelements, 1))
+    return md
Index: /issm/trunk/src/m/plot/applyoptions.m
===================================================================
--- /issm/trunk/src/m/plot/applyoptions.m	(revision 24312)
+++ /issm/trunk/src/m/plot/applyoptions.m	(revision 24313)
@@ -51,5 +51,5 @@
 set(gca,'FontSize',getfieldvalue(options,'axisfontsize',fontsize));;
 if exist(options,'axis')
-	eval(['axis ' getfieldvalue(options,'axis')]);
+	axis(getfieldvalue(options,'axis'));
 else
 	if strcmp(domaintype(md.mesh),'3D'),
@@ -73,5 +73,5 @@
 %box
 if exist(options,'box')
-	eval(['box ' getfieldvalue(options,'box')]);
+	box(getfieldvalue(options,'box'));
 end
 
@@ -128,5 +128,5 @@
 %colormap
 c = getcolormap(options);
-h = colormap(c);
+h = colormap(gca,c);
 
 %wrapping
@@ -243,5 +243,4 @@
 else
 	%do nothing
-
 end
 
Index: /issm/trunk/src/m/plot/applyoptions.py
===================================================================
--- /issm/trunk/src/m/plot/applyoptions.py	(revision 24312)
+++ /issm/trunk/src/m/plot/applyoptions.py	(revision 24313)
@@ -1,4 +1,4 @@
-import numpy as  np
-from cmaptools import truncate_colormap
+import numpy as np
+from cmaptools import getcolormap
 from plot_contour import plot_contour
 from plot_streamlines import plot_streamlines
@@ -6,288 +6,287 @@
 
 try:
-	from matplotlib.ticker import MaxNLocator
-	from mpl_toolkits.axes_grid1 import make_axes_locatable
-	from mpl_toolkits.mplot3d import Axes3D
-	import matplotlib as mpl
-	import matplotlib.pyplot as plt
+    from matplotlib.ticker import MaxNLocator
+    import matplotlib as mpl
+    import matplotlib.pyplot as plt
 except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
-
-def applyoptions(md,data,options,fig,axgrid,gridindex):
-	'''
-	APPLYOPTIONS - apply options to current plot
-
-	'plotobj' is the object returned by the specific plot call used to
-	render the data.  This object is used for adding a colorbar.
-
-		Usage:
-			applyoptions(md,data,options)
-
-		See also: PLOTMODEL, PARSE_OPTIONS
-	'''
-
-	# get handle to current figure and axes instance
-	#fig = p.gcf()
-	ax=	axgrid[gridindex]
-
-	# {{{ font
-	fontsize=options.getfieldvalue('fontsize',8)
-	fontweight=options.getfieldvalue('fontweight','normal')
-	fontfamily=options.getfieldvalue('fontfamily','sans-serif')
-	font={'fontsize'		:fontsize,
-				'fontweight'	:fontweight,
-				'family'			:fontfamily}
-	# }}}
-	# {{{ title
-	if options.exist('title'):
-		title=options.getfieldvalue('title')
-		if options.exist('titlefontsize'):
-			titlefontsize=options.getfieldvalue('titlefontsize')
-		else:
-			titlefontsize=fontsize
-		if options.exist('titlefontweight'):
-			titlefontweight=options.getfieldvalue('titlefontweight')
-		else:
-			titlefontweight=fontweight
-		#title font
-		titlefont=font.copy()
-		titlefont['size']=titlefontsize
-		titlefont['weight']=titlefontweight
-		ax.set_title(title,**titlefont)
-	# }}}
-	# {{{ xlabel, ylabel, zlabel
-	if options.exist('labelfontsize'):
-		labelfontsize=options.getfieldvalue('labelfontsize')
-	else:
-		labelfontsize=fontsize
-	if options.exist('labelfontweight'):
-		labelfontweight=options.getfieldvalue('labelfontweight')
-	else:
-		labelfontweight=fontweight
-
-	#font dict for labels
-	labelfont=font.copy()
-	labelfont['fontsize']=labelfontsize
-	labelfont['fontweight']=labelfontweight
-
-	if options.exist('xlabel'):
-		ax.set_xlabel(options.getfieldvalue('xlabel'),**labelfont)
-	if options.exist('ylabel'):
-		ax.set_ylabel(options.getfieldvalue('ylabel'),**labelfont)
-	if options.exist('zlabel'):
-		ax.set_zlabel(options.getfieldvalue('zlabel'),**labelfont)
-	# }}}
-	# {{{ xticks, yticks, zticks (tick locations)
-	if options.exist('xticks'):
-		if options.exist('xticklabels'):
-			xticklabels=options.getfieldvalue('xticklabels')
-			ax.set_xticks(options.getfieldvalue('xticks'),xticklabels)
-		else:
-			ax.set_xticks(options.getfieldvalue('xticks'))
-	if options.exist('yticks'):
-		if options.exist('yticklabels'):
-			yticklabels=options.getfieldvalue('yticklabels')
-			ax.set_yticks(options.getfieldvalue('yticks'),yticklabels)
-		else:
-			ax.set_yticks(options.getfieldvalue('yticks'))
-	if options.exist('zticks'):
-		if options.exist('zticklabels'):
-			zticklabels=options.getfieldvalue('zticklabels')
-			ax.set_zticks(options.getfieldvalue('zticks'),zticklabels)
-		else:
-			ax.set_zticks(options.getfieldvalue('zticks'))
-	# }}}
-	# {{{ xticklabels,yticklabels,zticklabels
-	if options.getfieldvalue('ticklabels','off')=='off' or options.getfieldvalue('ticklabels',0)==0:
-		options.addfielddefault('xticklabels',[])
-		options.addfielddefault('yticklabels',[])
-		# TODO check if ax has a z-axis (e.g. is 3D)
-	if options.exist('xticklabels'):
-		xticklabels=options.getfieldvalue('xticklabels')
-		ax.set_xticklabels(xticklabels)
-	if options.exist('yticklabels'):
-		yticklabels=options.getfieldvalue('yticklabels')
-		ax.set_yticklabels(yticklabels)
-	if options.exist('zticklabels'):
-		zticklabels=options.getfieldvalue('zticklabels')
-		ax.set_zticklabels(zticklabels)
-	# }}}
-	# {{{ ticklabel notation
-	#ax.ticklabel_format(style='sci',scilimits=(0,0))
-	# }}}
-	# {{{ ticklabelfontsize
-	if options.exist('ticklabelfontsize'):
-		for label in ax.get_xticklabels() + ax.get_yticklabels():
-			label.set_fontsize(options.getfieldvalue('ticklabelfontsize'))
-		if int(md.mesh.dimension)==3: 
-			for label in ax.get_zticklabels():
-				label.set_fontsize(options.getfieldvalue('ticklabelfontsize'))
-	# }}}
-	# {{{ view TOFIX
-	#if int(md.mesh.dimension) == 3 and options.exist('layer'):
-	#	#options.getfieldvalue('view') ?
-	#	ax=fig.gca(projection='3d')
-	#plt.show()
-	# }}}
-	# {{{ axis
-	if options.exist('axis'):
-		if options.getfieldvalue('axis',True)=='off':
-			ax.ticklabel_format(style='plain')
-			p.setp(ax.get_xticklabels(), visible=False)
-			p.setp(ax.get_yticklabels(), visible=False)
-	# }}}
-	# {{{ box
-	if options.exist('box'):
-		eval(options.getfieldvalue('box'))
-	# }}}
-	# {{{ xlim, ylim, zlim
-	if options.exist('xlim'):
-		ax.set_xlim(options.getfieldvalue('xlim'))
-	if options.exist('ylim'):
-		ax.set_ylim(options.getfieldvalue('ylim'))
-	if options.exist('zlim'):
-		ax.set_zlim(options.getfieldvalue('zlim'))
-	# }}}
-	# {{{ latlon TODO
-	# }}}
-	# {{{ Basinzoom TODO
-	# }}}
-	# {{{ ShowBasins TODO
-	# }}}
-	# {{{ clim
-	if options.exist('clim'):
-		lims=options.getfieldvalue('clim')
-		assert len(lims)==2, 'error, clim should be passed as a list of length 2'
-	elif options.exist('caxis'):
-		lims=options.getfieldvalue('caxis')
-		assert len(lims)==2, 'error, caxis should be passed as a list of length 2'
-		options.addfielddefault('clim',lims)
-	else:
-		if len(data)>0: 
-			lims=[data.min(),data.max()]
-		else: 
-			lims=[0,1]
-	# }}}
-	# {{{ shading TODO
-	#if options.exist('shading'):
-	# }}}
-	# {{{ grid
-	if options.exist('grid'):
-		if 'on' in options.getfieldvalue('grid','on'):
-			ax.grid()
-	# }}}
-	# {{{ colormap
-	if options.exist('colornorm'):
-		norm=options.getfieldvalue('colornorm')
-	if options.exist('colormap'):
-		cmap=options.getfieldvalue('colormap')
-	cbar_extend=0
-	if options.exist('cmap_set_over'):
-		cbar_extend+=1
-	if options.exist('cmap_set_under'):
-		cbar_extend+=2
-	# }}}
-	# {{{ contours
-	if options.exist('contourlevels'):
-		plot_contour(md,data,options,ax)
-	# }}}
-	# {{{ wrapping TODO
-	# }}}
-	# {{{ colorbar
-	if options.getfieldvalue('colorbar',1)==1:
-		if cbar_extend==0:
-			extend='neither'
-		elif cbar_extend==1:
-			extend='max'
-		elif cbar_extend==2:
-			extend='min'
-		elif cbar_extend==3:
-			extend='both'
-		cb = mpl.colorbar.ColorbarBase(ax.cax,cmap=cmap, norm=norm, extend=extend)
-		if options.exist('alpha'):
-			cb.set_alpha(options.getfieldvalue('alpha'))
-		if options.exist('colorbarnumticks'):
-			cb.locator=MaxNLocator(nbins=options.getfieldvalue('colorbarnumticks',5))
-		else:
-			cb.locator=MaxNLocator(nbins=5) # default 5 ticks
-		if options.exist('colorbartickspacing'):
-			locs=np.arange(lims[0],lims[1]+1,options.getfieldvalue('colorbartickspacing'))
-			cb.set_ticks(locs)
-		if options.exist('colorbarlines'):
-			locs=np.arange(lims[0],lims[1]+1,options.getfieldvalue('colorbarlines'))
-			cb.add_lines(locs,['k' for i in range(len(locs))],np.ones_like(locs))
-		if options.exist('colorbarlineatvalue'):
-			locs=options.getfieldvalue('colorbarlineatvalue')
-			colors=options.getfieldvalue('colorbarlineatvaluecolor',['k' for i in range (len(locs))])
-			widths=options.getfieldvalue('colorbarlineatvaluewidth',np.ones_like(locs))
-			cb.add_lines(locs,colors,widths)
-		if options.exist('colorbartitle'):
-			if options.exist('colorbartitlepad'):
-				cb.set_label(options.getfieldvalue('colorbartitle'),
-										 labelpad=options.getfieldvalue('colorbartitlepad'),fontsize=fontsize)
-			else:
-				cb.set_label(options.getfieldvalue('colorbartitle'),fontsize=fontsize)
-		cb.ax.tick_params(labelsize=fontsize)
-		cb.solids.set_rasterized(True)
-		cb.update_ticks()
-		cb.set_alpha(1)
-		cb.draw_all()
-                if options.exist('colorbarfontsize'):
-                        colorbarfontsize=options.getfieldvalue('colorbarfontsize')
-                        cb.ax.tick_params(labelsize=colorbarfontsize)
-                        # cb.set_ticks([0,-10])
-                        # cb.set_ticklabels([-10,0,10])
-                if options.exist('colorbarticks'):
-                        colorbarticks=options.getfieldvalue('colorbarticks')
-                        cb.set_ticks(colorbarticks)
-		plt.sca(ax) # return to original axes control
-	# }}}
-	# {{{ expdisp 
-	if options.exist('expdisp'):
-	 	expdisp(ax,options)
-	# }}}
-	# {{{ area TODO
-	# }}}
-	# {{{ text
-	if options.exist('text'):
-		text=options.getfieldvalue('text')
-		textx=options.getfieldvalue('textx')
-		texty=options.getfieldvalue('texty')
-		textcolor=options.getfieldvalue('textcolor')
-		textweight=options.getfieldvalue('textweight')
-		textrotation=options.getfieldvalue('textrotation')
-		textfontsize=options.getfieldvalue('textfontsize')
-		for label,x,y,size,color,weight,rotation in zip(text,textx,texty,textfontsize,textcolor,textweight,textrotation):
-			ax.text(x,y,label,transform=ax.transAxes,fontsize=size,color=color,weight=weight,rotation=rotation)
-	# }}}
-	# {{{ north arrow TODO
-	# }}}
-	# {{{ scale ruler TODO
-	# }}}
-	# {{{ streamlines TOFIX
-	if options.exist('streamlines'):
-		plot_streamlines(md,options,ax)
-	# }}}
-	# {{{ axis positions TODO
-	# }}}
-	# {{{ figure position TODO
-	# }}}
-	# {{{ axes position TODO
-	# }}}
-	# {{{ showregion TODO
-	# }}}
-	# {{{ flat edges of a partition TODO
-	# }}}
-	# {{{ scatter TODO
-	# }}}
-	# {{{ backgroundcolor TODO
-	# }}}
-	# {{{ figurebackgroundcolor TODO
-	# }}}
-	# {{{ lighting TODO
-	# }}}
-	# {{{ point cloud TODO
-	# }}}
-	# {{{ inset TODO
-	# }}}
-	
+    print("could not import pylab, matplotlib has not been installed, no plotting capabilities enabled")
+
+
+def applyoptions(md, data, options, fig, axgrid, gridindex):
+    '''
+    APPLYOPTIONS - apply options to current plot
+
+    'plotobj' is the object returned by the specific plot call used to
+    render the data.  This object is used for adding a colorbar.
+
+        Usage:
+            applyoptions(md, data, options)
+
+        See also: PLOTMODEL, PARSE_OPTIONS
+    '''
+
+    # get handle to current figure and axes instance
+    #fig = p.gcf()
+    ax = axgrid[gridindex]
+
+    # {{{ font
+    fontsize = options.getfieldvalue('fontsize', 8)
+    fontweight = options.getfieldvalue('fontweight', 'normal')
+    fontfamily = options.getfieldvalue('fontfamily', 'sans - serif')
+    font = {'fontsize': fontsize,
+            'fontweight': fontweight,
+            'family': fontfamily}
+    # }}}
+    # {{{ title
+    if options.exist('title'):
+        title = options.getfieldvalue('title')
+        if options.exist('titlefontsize'):
+            titlefontsize = options.getfieldvalue('titlefontsize')
+        else:
+            titlefontsize = fontsize
+        if options.exist('titlefontweight'):
+            titlefontweight = options.getfieldvalue('titlefontweight')
+        else:
+            titlefontweight = fontweight
+    #title font
+        titlefont = font.copy()
+        titlefont['size'] = titlefontsize
+        titlefont['weight'] = titlefontweight
+        ax.set_title(title, **titlefont)
+    # }}}
+    # {{{ xlabel, ylabel, zlabel
+    if options.exist('labelfontsize'):
+        labelfontsize = options.getfieldvalue('labelfontsize')
+    else:
+        labelfontsize = fontsize
+    if options.exist('labelfontweight'):
+        labelfontweight = options.getfieldvalue('labelfontweight')
+    else:
+        labelfontweight = fontweight
+
+    #font dict for labels
+    labelfont = font.copy()
+    labelfont['fontsize'] = labelfontsize
+    labelfont['fontweight'] = labelfontweight
+
+    if options.exist('xlabel'):
+        ax.set_xlabel(options.getfieldvalue('xlabel'), **labelfont)
+    if options.exist('ylabel'):
+        ax.set_ylabel(options.getfieldvalue('ylabel'), **labelfont)
+    if options.exist('zlabel'):
+        ax.set_zlabel(options.getfieldvalue('zlabel'), **labelfont)
+    # }}}
+    # {{{ xticks, yticks, zticks (tick locations)
+    if options.exist('xticks'):
+        if options.exist('xticklabels'):
+            xticklabels = options.getfieldvalue('xticklabels')
+            ax.set_xticks(options.getfieldvalue('xticks'), xticklabels)
+        else:
+            ax.set_xticks(options.getfieldvalue('xticks'))
+    if options.exist('yticks'):
+        if options.exist('yticklabels'):
+            yticklabels = options.getfieldvalue('yticklabels')
+            ax.set_yticks(options.getfieldvalue('yticks'), yticklabels)
+        else:
+            ax.set_yticks(options.getfieldvalue('yticks'))
+    if options.exist('zticks'):
+        if options.exist('zticklabels'):
+            zticklabels = options.getfieldvalue('zticklabels')
+            ax.set_zticks(options.getfieldvalue('zticks'), zticklabels)
+        else:
+            ax.set_zticks(options.getfieldvalue('zticks'))
+    # }}}
+    # {{{ xticklabels, yticklabels, zticklabels
+    if options.getfieldvalue('ticklabels', 'off') == 'off' or options.getfieldvalue('ticklabels', 0) == 0:
+        options.addfielddefault('xticklabels', [])
+        options.addfielddefault('yticklabels', [])
+    # TODO check if ax has a z - axis (e.g. is 3D)
+    if options.exist('xticklabels'):
+        xticklabels = options.getfieldvalue('xticklabels')
+        ax.set_xticklabels(xticklabels)
+    if options.exist('yticklabels'):
+        yticklabels = options.getfieldvalue('yticklabels')
+        ax.set_yticklabels(yticklabels)
+    if options.exist('zticklabels'):
+        zticklabels = options.getfieldvalue('zticklabels')
+        ax.set_zticklabels(zticklabels)
+    # }}}
+    # {{{ ticklabel notation
+    #ax.ticklabel_format(style = 'sci', scilimits=(0, 0))
+    # }}}
+    # {{{ ticklabelfontsize
+    if options.exist('ticklabelfontsize'):
+        for label in ax.get_xticklabels() + ax.get_yticklabels():
+            label.set_fontsize(options.getfieldvalue('ticklabelfontsize'))
+        if int(md.mesh.dimension) == 3:
+            for label in ax.get_zticklabels():
+                label.set_fontsize(options.getfieldvalue('ticklabelfontsize'))
+    # }}}
+    # {{{ view TOFIX
+    #if int(md.mesh.dimension) == 3 and options.exist('layer'):
+    #  #options.getfieldvalue('view') ?
+    #    ax = fig.gca(projection = '3d')
+    #plt.show()
+    # }}}
+    # {{{ axis
+    if options.exist('axis'):
+        if options.getfieldvalue('axis', True) == 'off':
+            ax.ticklabel_format(style='plain')
+            p.setp(ax.get_xticklabels(), visible=False)
+            p.setp(ax.get_yticklabels(), visible=False)
+    # }}}
+    # {{{ box
+    if options.exist('box'):
+        eval(options.getfieldvalue('box'))
+    # }}}
+    # {{{ xlim, ylim, zlim
+    if options.exist('xlim'):
+        ax.set_xlim(options.getfieldvalue('xlim'))
+    if options.exist('ylim'):
+        ax.set_ylim(options.getfieldvalue('ylim'))
+    if options.exist('zlim'):
+        ax.set_zlim(options.getfieldvalue('zlim'))
+    # }}}
+    # {{{ latlon TODO
+    # }}}
+    # {{{ Basinzoom TODO
+    # }}}
+    # {{{ ShowBasins TODO
+    # }}}
+    # {{{ clim
+    if options.exist('clim'):
+        lims = options.getfieldvalue('clim')
+        assert len(lims) == 2, 'error, clim should be passed as a list of length 2'
+    elif options.exist('caxis'):
+        lims = options.getfieldvalue('caxis')
+        assert len(lims) == 2, 'error, caxis should be passed as a list of length 2'
+        options.addfielddefault('clim', lims)
+    else:
+        if len(data) > 0:
+            lims = [data.min(), data.max()]
+        else:
+            lims = [0, 1]
+    # }}}
+    # {{{ shading TODO
+    #if options.exist('shading'):
+    # }}}
+    # {{{ grid
+    if options.exist('grid'):
+        if 'on' in options.getfieldvalue('grid', 'on'):
+            ax.grid()
+    # }}}
+    # {{{ colormap
+    if options.exist('colornorm'):
+        norm = options.getfieldvalue('colornorm')
+    if options.exist('colormap'):
+        cmap = getcolormap(options)
+    cbar_extend = 0
+    if options.exist('cmap_set_over'):
+        cbar_extend += 1
+    if options.exist('cmap_set_under'):
+        cbar_extend += 2
+    # }}}
+    # {{{ contours
+    if options.exist('contourlevels'):
+        plot_contour(md, data, options, ax)
+    # }}}
+    # {{{ wrapping TODO
+    # }}}
+    # {{{ colorbar
+    if options.getfieldvalue('colorbar', 1) == 1:
+        if cbar_extend == 0:
+            extend = 'neither'
+        elif cbar_extend == 1:
+            extend = 'max'
+        elif cbar_extend == 2:
+            extend = 'min'
+        elif cbar_extend == 3:
+            extend = 'both'
+
+        cb = mpl.colorbar.ColorbarBase(ax.cax, cmap=cmap, norm=norm, extend=extend)
+        if options.exist('alpha'):
+            cb.set_alpha(options.getfieldvalue('alpha'))
+        if options.exist('colorbarnumticks'):
+            cb.locator = MaxNLocator(nbins=options.getfieldvalue('colorbarnumticks', 5))
+        else:
+            cb.locator = MaxNLocator(nbins=5)  # default 5 ticks
+        if options.exist('colorbartickspacing'):
+            locs = np.arange(lims[0], lims[1] + 1, options.getfieldvalue('colorbartickspacing'))
+            cb.set_ticks(locs)
+        if options.exist('colorbarlines'):
+            locs = np.arange(lims[0], lims[1] + 1, options.getfieldvalue('colorbarlines'))
+            cb.add_lines(locs, ['k' for i in range(len(locs))], np.ones_like(locs))
+        if options.exist('colorbarlineatvalue'):
+            locs = options.getfieldvalue('colorbarlineatvalue')
+            colors = options.getfieldvalue('colorbarlineatvaluecolor', ['k' for i in range(len(locs))])
+            widths = options.getfieldvalue('colorbarlineatvaluewidth', np.ones_like(locs))
+            cb.add_lines(locs, colors, widths)
+        if options.exist('colorbartitle'):
+            if options.exist('colorbartitlepad'):
+                cb.set_label(options.getfieldvalue('colorbartitle'),
+                             labelpad=options.getfieldvalue('colorbartitlepad'),
+                             fontsize=fontsize)
+            else:
+                cb.set_label(options.getfieldvalue('colorbartitle'), fontsize=fontsize)
+        cb.ax.tick_params(labelsize=fontsize)
+        cb.solids.set_rasterized(True)
+        cb.update_ticks()
+        cb.draw_all()
+        if options.exist('colorbarfontsize'):
+            colorbarfontsize = options.getfieldvalue('colorbarfontsize')
+            cb.ax.tick_params(labelsize=colorbarfontsize)
+    # cb.set_ticks([0, -10])
+    # cb.set_ticklabels([-10, 0, 10])
+        if options.exist('colorbarticks'):
+            colorbarticks = options.getfieldvalue('colorbarticks')
+            cb.set_ticks(colorbarticks)
+        plt.sca(ax)  # return to original axes control
+    # }}}
+    # {{{ expdisp
+    if options.exist('expdisp'):
+        expdisp(ax, options)
+    # }}}
+    # {{{ area TODO
+    # }}}
+    # {{{ text
+    if options.exist('text'):
+        text = options.getfieldvalue('text')
+        textx = options.getfieldvalue('textx')
+        texty = options.getfieldvalue('texty')
+        textcolor = options.getfieldvalue('textcolor')
+        textweight = options.getfieldvalue('textweight')
+        textrotation = options.getfieldvalue('textrotation')
+        textfontsize = options.getfieldvalue('textfontsize')
+        for label, x, y, size, color, weight, rotation in zip(text, textx, texty, textfontsize, textcolor, textweight, textrotation):
+            ax.text(x, y, label, transform=ax.transAxes, fontsize=size, color=color, weight=weight, rotation=rotation)
+    # }}}
+    # {{{ north arrow TODO
+    # }}}
+    # {{{ scale ruler TODO
+    # }}}
+    # {{{ streamlines TOFIX
+    if options.exist('streamlines'):
+        plot_streamlines(md, options, ax)
+    # }}}
+    # {{{ axis positions TODO
+    # }}}
+    # {{{ figure position TODO
+    # }}}
+    # {{{ axes position TODO
+    # }}}
+    # {{{ showregion TODO
+    # }}}
+    # {{{ flat edges of a partition TODO
+    # }}}
+    # {{{ scatter TODO
+    # }}}
+    # {{{ backgroundcolor TODO
+    # }}}
+    # {{{ figurebackgroundcolor TODO
+    # }}}
+    # {{{ lighting TODO
+    # }}}
+    # {{{ point cloud TODO
+    # }}}
+    # {{{ inset TODO
+    # }}}
Index: /issm/trunk/src/m/plot/checkplotoptions.py
===================================================================
--- /issm/trunk/src/m/plot/checkplotoptions.py	(revision 24312)
+++ /issm/trunk/src/m/plot/checkplotoptions.py	(revision 24313)
@@ -1,162 +1,170 @@
-import numpy as  np
+import numpy as np
 
-def checkplotoptions(md,options):
-	'''
-	CHECKPLOTOPTIONS - build a structure that holds all plot options
 
-		Usage:
-			options=checkplotoptions(md,options)
+def checkplotoptions(md, options):
+    '''
+    CHECKPLOTOPTIONS - build a structure that holds all plot options
 
-		See also: PLOTMODEL
+        Usage:
+            options = checkplotoptions(md, options)
 
-		NOTE: not fully implemented yet
-	'''
+        See also: PLOTMODEL
 
-	# {{{ units
-	if options.exist('unit'):
-		if 'km' in options.getfieldvalue('unit','km'):
-			options.changefieldvalue('unit',10**-3)
-		elif '100km' in options.getfieldvalue('unit','100km'):
-			options.changefieldvalue('unit',10**-5)
-	# }}}
-	# {{{ density
-	if options.exist('density'):
-		density=options.getfieldvalue('density')
-		options.changefieldvalue('density',abs(ceil(density)))
-	# }}}
-	# {{{ show section
-	if options.exist('showsection'):
-		if 'on' in options.getfieldvalue('showsection','on'):
-			options.changefieldvalue('showsection',4)
-	# }}}	
-	# {{{ smooth values
-	if options.exist('smooth'):
-		if 'on' in options.getfieldvalue('smooth','on'):
-			options.changefieldvalue('smooth',0)
-	# }}}
-	# {{{ contouronly values
-	if options.exist('contouronly'):
-		if 'on' in options.getfieldvalue('contouronly','on'):
-			options.changefieldvalue('contouronly',1)
-	# }}}
-	# {{{ colorbar
-	if options.exist('colorbar'):
-		if 'on' in options.getfieldvalue('colorbar','on'):
-			options.changefieldvalue('colorbar',1)
-		elif 'off' in options.getfieldvalue('colorbar','off'):
-			options.changefieldvalue('colorbar',0)
-	# }}}
-	# {{{ text
-	if options.exist('text'):
-		# text values (coerce to list for consistent functionality)
-		textlist=[]
-		text=options.getfieldvalue('text','default text')
-		textlist.extend([text] if isinstance(text,str) else text)
-		numtext=len(textlist)
-		# text position	
-		textpos=options.getfieldvalue('textposition',[0.5,0.5])
-		if not isinstance(textpos,list):
-			raise Exception('textposition should be passed as a list')
-		if any(isinstance(i,list) for i in textpos):
-		    textx=[item[0] for item in textpos]
-		    texty=[item[1] for item in textpos]
-                else:
-                    textx=[textpos[0]]
-                    texty=[textpos[1]]
-		if len(textx)!=numtext or len(texty)!=numtext:
-			raise Exception('textposition should contain one list of x,y vertices for every text instance')
+        NOTE: not fully implemented yet
+    '''
 
-		# font size
-		if options.exist('textfontsize'):
-			textfontsize=options.getfieldvalue('textfontsize',12)
-			sizelist=[]
-			sizelist.extend(textsize if isinstance(textfontsize,list) else [textfontsize])
-		else:
-			sizelist=[12]
-		if len(sizelist)==1:
-			sizelist=np.tile(sizelist,numtext)
+    # {{{ units
+    if options.exist('unit'):
+        if 'km' in options.getfieldvalue('unit', 'km'):
+            options.changefieldvalue('unit', 10**-3)
+        elif '100km' in options.getfieldvalue('unit', '100km'):
+            options.changefieldvalue('unit', 10**-5)
+    # }}}
+    # {{{ density
+    if options.exist('density'):
+        density = options.getfieldvalue('density')
+        options.changefieldvalue('density', abs(np.ceil(density)))
+    # }}}
+    # {{{ show section
+    if options.exist('showsection'):
+        if 'on' in options.getfieldvalue('showsection', 'on'):
+            options.changefieldvalue('showsection', 4)
+    # }}}
+    # {{{ smooth values
+    if options.exist('smooth'):
+        if 'on' in options.getfieldvalue('smooth', 'on'):
+            options.changefieldvalue('smooth', 0)
+    # }}}
+    # {{{ contouronly values
+    if options.exist('contouronly'):
+        if 'on' in options.getfieldvalue('contouronly', 'on'):
+            options.changefieldvalue('contouronly', 1)
+    # }}}
+    # {{{ colorbar
+    if options.exist('colorbar'):
+        if 'on' in options.getfieldvalue('colorbar', 'on'):
+            options.changefieldvalue('colorbar', 1)
+        elif 'off' in options.getfieldvalue('colorbar', 'off'):
+            options.changefieldvalue('colorbar', 0)
+    # }}}
+    # {{{ layer
+    if options.exist('layer'):
+        if options.getfieldvalue('layer') == 0:
+            raise Exception('Due to Matlab history first layer is numbered 1')
+        if options.getfieldvalue('layer') == md.mesh.numberoflayers - 1:
+            print('WARNING : you are plotting layer {}, surface is layer{}.'.format(md.mesh.numberoflayers - 1, md.mesh.numberoflayers))
+    # }}}
+    # {{{ text
+    if options.exist('text'):
+        # text values (coerce to list for consistent functionality)
+        textlist = []
+        text = options.getfieldvalue('text', 'default text')
+        textlist.extend([text] if isinstance(text, str) else text)
+        numtext = len(textlist)
+    # text position
+        textpos = options.getfieldvalue('textposition', [0.5, 0.5])
+        if not isinstance(textpos, list):
+            raise Exception('textposition should be passed as a list')
+        if any(isinstance(i, list) for i in textpos):
+            textx = [item[0] for item in textpos]
+            texty = [item[1] for item in textpos]
+        else:
+            textx = [textpos[0]]
+            texty = [textpos[1]]
+        if len(textx) != numtext or len(texty) != numtext:
+            raise Exception('textposition should contain one list of x, y vertices for every text instance')
 
-		# font color
-		if options.exist('textcolor'):
-			textcolor=options.getfieldvalue('textcolor','k')
-			colorlist=[]
-			colorlist.extend(textcolor if isinstance(textcolor,list) else [textcolor])
-		else:
-			colorlist=['k']
-		if len(colorlist)==1:
-			colorlist=np.tile(colorlist,numtext)
+    # font size
+        if options.exist('textfontsize'):
+            textfontsize = options.getfieldvalue('textfontsize', 12)
+            sizelist = []
+            sizelist.extend(textfontsize if isinstance(textfontsize, list) else [textfontsize])
+        else:
+            sizelist = [12]
+        if len(sizelist) == 1:
+            sizelist = np.tile(sizelist, numtext)
 
-		# textweight
-		if options.exist('textweight'):
-			textweight=options.getfieldvalue('textweight')
-			weightlist=[]
-			weightlist.extend(textweight if isinstance(textweight,list) else [textweight])
-		else:
-			weightlist=['normal']
-		if len(weightlist)==1:
-			weightlist=np.tile(weightlist,numtext)
+    # font color
+        if options.exist('textcolor'):
+            textcolor = options.getfieldvalue('textcolor', 'k')
+            colorlist = []
+            colorlist.extend(textcolor if isinstance(textcolor, list) else [textcolor])
+        else:
+            colorlist = ['k']
+        if len(colorlist) == 1:
+            colorlist = np.tile(colorlist, numtext)
 
-		# text rotation
-		if options.exist('textrotation'):
-			textrotation=options.getfieldvalue('textrotation',0)
-			rotationlist=[]
-			rotationlist.extend(textrotation if isinstance(textrotation,list) else [textrotation])
-		else:
-			rotationlist=[0]
-		if len(rotationlist)==1:
-				rotationlist=np.tile(rotationlist,numtext)
+    # textweight
+        if options.exist('textweight'):
+            textweight = options.getfieldvalue('textweight')
+            weightlist = []
+            weightlist.extend(textweight if isinstance(textweight, list) else [textweight])
+        else:
+            weightlist = ['normal']
+        if len(weightlist) == 1:
+            weightlist = np.tile(weightlist, numtext)
 
-		options.changefieldvalue('text',textlist)
-		options.addfield('textx',textx)
-		options.addfield('texty',texty)
-		options.changefieldvalue('textfontsize',sizelist)
-		options.changefieldvalue('textcolor',colorlist)
-		options.changefieldvalue('textweight',weightlist)
-		options.changefieldvalue('textrotation',rotationlist)
-	# }}}
-	# {{{ expdisp
-	expdispvaluesarray=[]
-	expstylevaluesarray=[]
-	expstylevalues=[]
-	if options.exist('expstyle'):
-		expstylevalues=options.getfieldvalue('expstyle')
-		if type(expstylevalues)==str:
-			expstylevalues=[expstylevalues]
-	if options.exist('expdisp'):
-		expdispvalues=options.getfieldvalue('expdisp')
-		if type(expdispvalues)==str:
-			expdispvalues=[expdispvalues]
-		for i in np.arange(len(expdispvalues)):
-			expdispvaluesarray.append(expdispvalues[i])
-			if len(expstylevalues)>i:
-				expstylevaluesarray.append(expstylevalues[i])
-			else:
-				expstylevaluesarray.append('-k')
-	options.changefieldvalue('expstyle',expstylevaluesarray)
-	options.changefieldvalue('expdisp',expdispvaluesarray)
-	# }}}
-	# {{{ latlonnumbering
-	if options.exist('latlonclick'):
-		if 'on' in options.getfieldvalue('latlonclick','on'):
-			options.changefieldvalue('latlonclick',1)
-	# }}}
-	# {{{ northarrow
-	if options.exist('northarrow'):
-		if 'on' in options.getfieldvalue('northarrow','on'):
-			#default values
-			Lx=max(md.mesh.x)-min(md.mesh.x)
-			Ly=max(md.mesh.y)-min(md.mesh.y)
-			options.changefieldvalue('northarrow',[min(md.mesh.x)+1./6.*Lx, min(md.mesh.y)+5./6.*Ly, 1./15.*Ly, 0.25, 1./250.*Ly])
-	# }}}
-	# {{{ scale ruler
-	if options.exist('scaleruler'):
-		if 'on' in options.getfieldvalue('scaleruler','off'):
-			Lx=max(md.mesh.x)-min(md.mesh.x)
-			Ly=max(md.mesh.y)-min(md.mesh.y)
-			options.changefieldvalue('scaleruler',[min(md.mesh.x)+6./8.*Lx, min(md.mesh.y)+1./10.*Ly, 10**(np.ceil(np.log10(Lx)))/5, np.floor(Lx/100), 5])
-	# }}}
-	# {{{ log scale
-	if options.exist('log'):
-		options.changefieldvalue('cutoff',np.log10(options.getfieldvalue('cutoff',1.5))/np.log10(options.getfieldvalue('log')))
-	# }}}
-	return options
+    # text rotation
+        if options.exist('textrotation'):
+            textrotation = options.getfieldvalue('textrotation', 0)
+            rotationlist = []
+            rotationlist.extend(textrotation if isinstance(textrotation, list) else [textrotation])
+        else:
+            rotationlist = [0]
+        if len(rotationlist) == 1:
+            rotationlist = np.tile(rotationlist, numtext)
+
+        options.changefieldvalue('text', textlist)
+        options.addfield('textx', textx)
+        options.addfield('texty', texty)
+        options.changefieldvalue('textfontsize', sizelist)
+        options.changefieldvalue('textcolor', colorlist)
+        options.changefieldvalue('textweight', weightlist)
+        options.changefieldvalue('textrotation', rotationlist)
+    # }}}
+    # {{{ expdisp
+    expdispvaluesarray = []
+    expstylevaluesarray = []
+    expstylevalues = []
+    if options.exist('expstyle'):
+        expstylevalues = options.getfieldvalue('expstyle')
+        if type(expstylevalues) == str:
+            expstylevalues = [expstylevalues]
+    if options.exist('expdisp'):
+        expdispvalues = options.getfieldvalue('expdisp')
+        if type(expdispvalues) == str:
+            expdispvalues = [expdispvalues]
+        for i in np.arange(len(expdispvalues)):
+            expdispvaluesarray.append(expdispvalues[i])
+            if len(expstylevalues) > i:
+                expstylevaluesarray.append(expstylevalues[i])
+            else:
+                expstylevaluesarray.append(' - k')
+    options.changefieldvalue('expstyle', expstylevaluesarray)
+    options.changefieldvalue('expdisp', expdispvaluesarray)
+    # }}}
+    # {{{ latlonnumbering
+    if options.exist('latlonclick'):
+        if 'on' in options.getfieldvalue('latlonclick', 'on'):
+            options.changefieldvalue('latlonclick', 1)
+    # }}}
+    # {{{ northarrow
+    if options.exist('northarrow'):
+        if 'on' in options.getfieldvalue('northarrow', 'on'):
+            #default values
+            Lx = max(md.mesh.x) - min(md.mesh.x)
+            Ly = max(md.mesh.y) - min(md.mesh.y)
+            options.changefieldvalue('northarrow', [min(md.mesh.x) + 1. / 6. * Lx, min(md.mesh.y) + 5. / 6. * Ly, 1. / 15. * Ly, 0.25, 1. / 250. * Ly])
+    # }}}
+    # {{{ scale ruler
+    if options.exist('scaleruler'):
+        if 'on' in options.getfieldvalue('scaleruler', 'off'):
+            Lx = max(md.mesh.x) - min(md.mesh.x)
+            Ly = max(md.mesh.y) - min(md.mesh.y)
+            options.changefieldvalue('scaleruler', [min(md.mesh.x) + 6. / 8. * Lx, min(md.mesh.y) + 1. / 10. * Ly, 10**(np.ceil(np.log10(Lx))) / 5, np.floor(Lx / 100), 5])
+    # }}}
+    # {{{ log scale
+    if options.exist('log'):
+        options.changefieldvalue('cutoff', np.log10(options.getfieldvalue('cutoff', 1.5)) / np.log10(options.getfieldvalue('log')))
+    # }}}
+    return options
Index: /issm/trunk/src/m/plot/colormaps/cmaptools.py
===================================================================
--- /issm/trunk/src/m/plot/colormaps/cmaptools.py	(revision 24312)
+++ /issm/trunk/src/m/plot/colormaps/cmaptools.py	(revision 24313)
@@ -1,25 +1,75 @@
-import numpy as  np
+import numpy as np
 
 try:
-	import matplotlib as mpl
+    import matplotlib as mpl
+    import matplotlib.pyplot as plt
+    from matplotlib.colors import ListedColormap, hsv_to_rgb
 except ImportError:
-	print 'cannot import matplotlib, no plotting capabilities enabled'
+    print('cannot import matplotlib, no plotting capabilities enabled')
+
+
+def getcolormap(options):
+    '''
+    get colormap from options and apply
+
+    default: viridis
+    supported:
+        matplotlib defaults (see: pyplot.colormaps())
+        Rignot
+        demmap(50, -300, 1200)
+        demmap(50, -300, 1200, 'ibcao')
+
+    Usage:
+        cmap = getcolormap(options)
+    '''
+
+    map_name = options.getfieldvalue('colormap')
+    cmap = 'viridis'
+
+    # already a valid colormap, the name of a valid colormap, or empty (use default)
+    if type(map_name) == mpl.colors.ListedColormap:
+        return map_name
+    elif map_name in plt.colormaps():
+        return map_name
+    elif map_name == '':
+        return cmap
+
+    # if we don't have a matching colormap, build one
+    if map_name == 'Rignot':
+        alpha = options.getfieldvalue('alpha', 1)
+        cmap = np.array((np.linspace(0, 1, 128, False), np.ones(128, ), np.ones(128, ))).T
+        cmap[:, 1] = np.maximum(np.minimum((0.1 + cmap[:, 0]**(1 / alpha)), 1), 0)
+        cmap = hsv_to_rgb(cmap)
+    # construct a colormap object from an array of shape (n, 3 / 4)
+        cmap = ListedColormap(cmap)
+
+    #elif map_name == 'Ala':
+
+    else:
+        # map is a library or executable function that constructs a colormap,
+        #   function must be imported above
+        try:
+            cmap = ListedColormap(eval(map_name))
+        except:
+            raise RuntimeError("getcolormap: Error: provided colormap must be supported map or map - constructing function with syntax: 'jet' or 'function(args)'")
+
+    return cmap
+
 
 def truncate_colormap(cmap, minval=0.0, maxval=1.0, n=100):
-	'''
-	truncate a colormap within normalized limits [0,1]
+    '''
+    truncate a colormap within normalized limits [0, 1]
 
-	cmap - a matplotlib colormap
-	minval - minimum value, normalized, of cmap to be returned.
-	maxval - maximum value, normalized, of cmap to be returned.
-	n - number of levels to use in constructing the new colormap
+    cmap - a matplotlib colormap
+    minval - minimum value, normalized, of cmap to be returned.
+    maxval - maximum value, normalized, of cmap to be returned.
+    n - number of levels to use in constructing the new colormap
 
-	Example:
-		newcmap=truncate_colormap(oldcmap,minval=0.2,maxval=0.8,n=128)
+    Example:
+        newcmap = truncate_colormap(oldcmap, minval = 0.2, maxval = 0.8, n = 128)
 
-	'''
+    '''
 
-	new_cmap = mpl.colors.LinearSegmentedColormap.from_list('trunc({n},{a:.2f},{b:.2f})'.format(n=cmap.name,
-		a=minval, b=maxval), cmap(np.linspace(minval, maxval, n)))
-	
-	return new_cmap
+    new_cmap = mpl.colors.LinearSegmentedColormap.from_list('trunc({n}, {a:.2f}, {b:.2f})'.format(n=cmap.name, a=minval, b=maxval), cmap(np.linspace(minval, maxval, n)))
+
+    return new_cmap
Index: /issm/trunk/src/m/plot/colormaps/demmap.py
===================================================================
--- /issm/trunk/src/m/plot/colormaps/demmap.py	(revision 24313)
+++ /issm/trunk/src/m/plot/colormaps/demmap.py	(revision 24313)
@@ -0,0 +1,74 @@
+import numpy as np
+from MatlabFuncs import strcmpi
+from landcolor import landcolor
+from seacolor import seacolor
+from ibcao import ibcao
+
+
+def demmap(ncolors, minZ, maxZ, colorscheme='dem'):
+    '''DEMMAP - concatenate sea and land color deping on zmin and zmax
+
+       Usage:
+          cmap = demmap(n, zmin, zmax, colorscheme)
+
+       Example:
+          cmap = demmap(50, -300, 1200)
+          cmap = demmap(50, -300, 1200, 'dem')
+          cmap = demmap(50, -300, 1200, 'ibcao')
+    '''
+
+    if type(colorscheme) != str:
+        raise RuntimeError('demmap: Error: optional argument "colorscheme" should be a string')
+
+    # determine appropriate number of sea and land colors
+    if minZ == maxZ:
+        maxZ = minZ + 1
+
+    cmn = minZ
+    cmx = maxZ
+
+    # determine appropriate number of sea and land colors
+    if minZ >= 0:
+        nsea = 0
+        nland = ncolors
+    elif maxZ <= 0:
+        nland = 0
+        nsea = ncolors
+    else:
+        # find optimal ratio of land to sea colors
+        maxminratio = maxZ / abs(minZ)
+        n1 = np.floor(ncolors / 2)
+        n2 = np.ceil(ncolors / 2)
+        if maxminratio > 1:
+            sea = np.arange(1, n1 + 1)
+            land = np.arange(ncolors - 1, n2 - 1, -1)
+        else:
+            land = np.arange(1, n1 + 1)
+            sea = np.arange(ncolors - 1, n2 - 1, -1)
+
+        ratio = land / sea
+        errors = abs(ratio - maxminratio) / maxminratio
+        indx = np.where(errors == min(errors))
+        nsea = sea[indx]
+        nland = land[indx]
+
+    # determine color limits
+        seaint = abs(minZ) / nsea
+        landint = maxZ / nland
+        if seaint >= landint:
+            interval = seaint
+        else:
+            interval = landint
+
+        cmn = -nsea * interval * (1 + 1e-9)  # zero values treated as land
+        cmx = nland * interval
+
+    clim = [cmn, cmx]
+
+    if strcmpi(colorscheme, 'dem'):
+        # concatenate and transpose to match matplotlib's colormap format
+        cmap = np.concatenate((seacolor(nsea), landcolor(nland)**1.3), axis=1).T
+    elif strcmpi(colorscheme, 'ibcao'):
+        cmap = ibcao(nsea, nland)
+
+    return cmap
Index: /issm/trunk/src/m/plot/colormaps/ibcao.py
===================================================================
--- /issm/trunk/src/m/plot/colormaps/ibcao.py	(revision 24313)
+++ /issm/trunk/src/m/plot/colormaps/ibcao.py	(revision 24313)
@@ -0,0 +1,79 @@
+import numpy as np
+
+
+def ibcao(nsea, nland):
+    '''IBCAO - IBCAO color map
+
+       Usage:
+          map = ibcap(nsea, nland)
+    '''
+
+    Jsea = [0.18039, 0.29020, 0.57255,
+            0.18039, 0.29020, 0.57255,
+            0.05882, 0.44314, 0.65490,
+            0.05882, 0.44314, 0.65490,
+            0.02745, 0.49804, 0.73725,
+            0.02745, 0.49804, 0.73725,
+            0.01176, 0.54510, 0.78824,
+            0.01176, 0.54510, 0.78824,
+            0.00784, 0.63529, 0.83922,
+            0.00784, 0.63529, 0.83922,
+            0.06667, 0.71765, 0.86667,
+            0.06667, 0.71765, 0.86667,
+            0.17647, 0.75294, 1.00000,
+            0.17647, 0.75294, 1.00000,
+            0.23529, 0.76471, 0.85882,
+            0.23529, 0.76471, 0.85882,
+            0.24314, 0.76471, 0.83922,
+            0.24314, 0.76471, 0.83922,
+            0.25882, 0.76078, 0.81176,
+            0.25882, 0.76078, 0.81176,
+            0.27451, 0.76078, 0.76078,
+            0.27451, 0.76078, 0.76078,
+            0.41961, 0.78431, 0.74902,
+            0.41961, 0.78431, 0.74902,
+            0.60000, 0.83137, 0.74902,
+            0.60000, 0.83137, 0.74902]
+
+    Jland = [0.85098, 0.84314, 0.30588,
+             0.85098, 0.84314, 0.30588,
+             0.93333, 0.89020, 0.41961,
+             0.93333, 0.89020, 0.41961,
+             0.93725, 0.80784, 0.35686,
+             0.93725, 0.80784, 0.35686,
+             0.89804, 0.74510, 0.31765,
+             0.89804, 0.74510, 0.31765,
+             0.85098, 0.63922, 0.21961,
+             0.85098, 0.63922, 0.21961,
+             0.75686, 0.55294, 0.22353,
+             0.75686, 0.55294, 0.22353,
+             0.71765, 0.50980, 0.22353,
+             0.71765, 0.50980, 0.22353,
+             0.68627, 0.48235, 0.21961,
+             0.68627, 0.48235, 0.21961,
+             0.65490, 0.45882, 0.21569,
+             0.65490, 0.45882, 0.21569,
+             0.58824, 0.39608, 0.20392,
+             0.58824, 0.39608, 0.20392,
+             1.00000, 1.00000, 1.00000]
+
+    # Jsea and Jland are each a series of r, g, b triples, reshape them as such
+
+    lsea = int(len(Jsea) / 3)
+    Jsea = np.array(Jsea).reshape(lsea, 3)
+    a = np.linspace(1, lsea, nsea)
+    b = np.arange(1, lsea + 1)
+    # interpolate color on each channel r, g, b
+    ysea = np.array([np.interp(a, b, Jsea[:, i]) for i in range(3)])
+
+    lland = int(len(Jland) / 3)
+    Jland = np.array(Jland).reshape(lland, 3)
+    a = np.linspace(1, lland, nland)
+    b = np.arange(1, lland + 1)
+    # interpolate color on each channel r, g, b
+    yland = np.array([np.interp(a, b, Jland[:, i]) for i in range(3)])
+
+    # concatenate and transpose to match matplotlib's colormap format
+    map = np.concatenate((ysea, yland), axis=1).T
+
+    return map
Index: /issm/trunk/src/m/plot/colormaps/landcolor.py
===================================================================
--- /issm/trunk/src/m/plot/colormaps/landcolor.py	(revision 24313)
+++ /issm/trunk/src/m/plot/colormaps/landcolor.py	(revision 24313)
@@ -0,0 +1,80 @@
+import numpy as np
+
+
+def landcolor(n=256):
+    '''LANDCOLOR Land colormap'''
+
+    J = [0.095678, 0.53427, 0.21682,
+         0.15785, 0.5979, 0.23274,
+         0.21286, 0.64673, 0.2514,
+         0.26411, 0.68789, 0.27268,
+         0.32959, 0.72416, 0.31308,
+         0.39794, 0.75695, 0.36038,
+         0.46153, 0.7871, 0.40624,
+         0.52108, 0.81516, 0.45135,
+         0.57702, 0.84152, 0.49547,
+         0.62973, 0.86645, 0.53891,
+         0.67946, 0.89016, 0.58187,
+         0.72647, 0.91282, 0.62427,
+         0.77095, 0.93455, 0.66619,
+         0.81306, 0.95546, 0.70772,
+         0.85292, 0.97563, 0.7489,
+         0.89066, 0.99514, 0.78976,
+         0.88379, 0.98595, 0.77038,
+         0.86389, 0.96758, 0.73236,
+         0.84615, 0.94972, 0.69623,
+         0.8303, 0.93233, 0.66186,
+         0.81612, 0.91536, 0.6291,
+         0.80341, 0.8988, 0.59784,
+         0.79201, 0.8826, 0.56795,
+         0.78191, 0.86676, 0.53946,
+         0.7729, 0.85123, 0.51224,
+         0.76479, 0.83602, 0.48615,
+         0.75747, 0.8211, 0.46111,
+         0.75084, 0.80645, 0.43704,
+         0.74506, 0.79206, 0.41414,
+         0.73981, 0.77792, 0.39211,
+         0.73501, 0.76401, 0.37089,
+         0.73068, 0.75033, 0.35052,
+         0.72683, 0.73685, 0.33106,
+         0.72042, 0.72074, 0.31228,
+         0.71032, 0.70085, 0.29417,
+         0.69761, 0.67821, 0.27694,
+         0.68489, 0.65558, 0.26026,
+         0.67235, 0.63313, 0.24418,
+         0.65997, 0.61082, 0.22889,
+         0.64775, 0.58874, 0.21406,
+         0.63568, 0.56689, 0.19983,
+         0.62376, 0.54527, 0.18622,
+         0.61197, 0.52391, 0.17299,
+         0.60033, 0.50283, 0.16046,
+         0.58881, 0.48203, 0.14832,
+         0.57742, 0.46151, 0.13667,
+         0.56616, 0.44133, 0.12555,
+         0.55502, 0.4214, 0.11472,
+         0.54398, 0.4019, 0.10456,
+         0.53306, 0.38266, 0.094633,
+         0.52226, 0.36382, 0.085242,
+         0.51155, 0.3453, 0.076179,
+         0.50095, 0.32714, 0.067515,
+         0.49045, 0.30938, 0.059259,
+         0.48005, 0.29193, 0.051294,
+         0.46973, 0.27495, 0.043796,
+         0.45951, 0.25823, 0.0365,
+         0.44938, 0.24206, 0.029715,
+         0.43934, 0.22609, 0.023063,
+         0.42938, 0.21074, 0.016949,
+         0.41951, 0.19556, 0.010917,
+         0.40971, 0.18105, 0.0054326,
+         0.4, 0.16667, 0]
+
+    # J is a series of r, g, b triples, reshape it as such
+    length = int(len(J) / 3)
+    J = np.array(J).reshape(length, 3)
+    a = np.linspace(1, length, n)
+    b = np.arange(1, length + 1)
+
+    # interpolate color on each channel r, g, b
+    y = np.array([np.interp(a, b, J[:, i]) for i in range(3)])
+
+    return y
Index: /issm/trunk/src/m/plot/colormaps/paraview.m
===================================================================
--- /issm/trunk/src/m/plot/colormaps/paraview.m	(revision 24313)
+++ /issm/trunk/src/m/plot/colormaps/paraview.m	(revision 24313)
@@ -0,0 +1,42 @@
+function cmap = paraview(m)
+
+J=[...
+0.0 59 76 192
+0.03125 68 90 204
+0.0625 77 104 215
+0.09375 87 117 225
+0.125 98 130 234
+0.15625 108 142 241
+0.1875 119 154 247
+0.21875 130 165 251
+0.25 141 176 254
+0.28125 152 185 255
+0.3125 163 194 255
+0.34375 174 201 253
+0.375 184 208 249
+0.40625 194 213 244
+0.4375 204 217 238
+0.46875 213 219 230
+0.5 221 221 221
+0.53125 229 216 209
+0.5625 236  211 197
+0.59375 241 204 185
+0.625 245   196 173
+0.65625 247 187 160
+0.6875 247  177 148
+0.71875 247 166 135
+0.75 244    154 123
+0.78125 241 141 111
+0.8125 236  127 99 
+0.84375 229 112 88 
+0.875 222   96  77 
+0.90625 213 80  66 
+0.9375 203  62  56 
+0.96875 192 40  47 
+1.0 180     4   38 ];
+
+l = length(J);
+if nargin < 1
+	n = 256;
+end
+cmap = interp1(1:l,J(:,2:4)/255,linspace(1,l,n),'*linear');
Index: /issm/trunk/src/m/plot/colormaps/seacolor.py
===================================================================
--- /issm/trunk/src/m/plot/colormaps/seacolor.py	(revision 24313)
+++ /issm/trunk/src/m/plot/colormaps/seacolor.py	(revision 24313)
@@ -0,0 +1,61 @@
+import numpy as np
+
+
+def seacolor(n=256):
+    '''SEACOLOR Sea colormap'''
+
+    J = [0.0392, 0, 0.4745,
+         0.1020, 0, 0.5373,
+         0.1020, 0, 0.5373,
+         0.1490, 0, 0.5961,
+         0.1490, 0, 0.5961,
+         0.1059, 0.0118, 0.6510,
+         0.1059, 0.0118, 0.6510,
+         0.0627, 0.0235, 0.7059,
+         0.0627, 0.0235, 0.7059,
+         0.0196, 0.0353, 0.7569,
+         0.0196, 0.0353, 0.7569,
+         0, 0.0549, 0.7961,
+         0, 0.0549, 0.7961,
+         0, 0.0863, 0.8235,
+         0, 0.0863, 0.8235,
+         0, 0.1176, 0.8471,
+         0, 0.1176, 0.8471,
+         0, 0.1529, 0.8745,
+         0, 0.1529, 0.8745,
+         0.0471, 0.2667, 0.9059,
+         0.0471, 0.2667, 0.9059,
+         0.1020, 0.4000, 0.9412,
+         0.1020, 0.4000, 0.9412,
+         0.0745, 0.4588, 0.9569,
+         0.0745, 0.4588, 0.9569,
+         0.0549, 0.5216, 0.9765,
+         0.0549, 0.5216, 0.9765,
+         0.0824, 0.6196, 0.9882,
+         0.0824, 0.6196, 0.9882,
+         0.1176, 0.6980, 1.0000,
+         0.1176, 0.6980, 1.0000,
+         0.1686, 0.7294, 1.0000,
+         0.1686, 0.7294, 1.0000,
+         0.2157, 0.7569, 1.0000,
+         0.2157, 0.7569, 1.0000,
+         0.2549, 0.7843, 1.0000,
+         0.2549, 0.7843, 1.0000,
+         0.3098, 0.8235, 1.0000,
+         0.3098, 0.8235, 1.0000,
+         0.3686, 0.8745, 1.0000,
+         0.3686, 0.8745, 1.0000,
+         0.5412, 0.8902, 1.0000,
+         0.5412, 0.8902, 1.0000,
+         0.7373, 0.9020, 1.0000]
+
+    # J is a series of r, g, b triples, reshape it as such
+    length = int(len(J) / 3)
+    J = np.array(J).reshape(length, 3)
+    a = np.linspace(1, length, n)
+    b = np.arange(1, length + 1)
+
+    # interpolate color on each channel r, g, b
+    y = np.array([np.interp(a, b, J[:, i]) for i in range(3)])
+
+    return y
Index: /issm/trunk/src/m/plot/export_gl.py
===================================================================
--- /issm/trunk/src/m/plot/export_gl.py	(revision 24312)
+++ /issm/trunk/src/m/plot/export_gl.py	(revision 24313)
@@ -2,123 +2,124 @@
 from checkplotoptions import checkplotoptions
 from model import model
-import numpy as  np
+import numpy as np
 import math
 from writejsfile import writejsfile
 
-def export_gl(md,*varargin):
-	class ResultObj(object):
-	    def __getattr__(self, attr):
-		return self.__dict__.get(attr)
 
-	print ('getting options')
-	templist=plotoptions(varargin); 
-	optionslist=templist.list;
-	options=optionslist[1];
-	options=checkplotoptions(md,options);
-	#print (templist,options)
-	#templist contains options 0-3. Use in the future to rework.
-	
-	#Setup unique directory in present dir: 
-	print ('setting directory')
-	directory=optionslist[0].getfieldvalue('directory');
-	databasename=optionslist[0].getfieldvalue('database');
-	
-	#scaling factor: 
-	print ('setting scaling factor')
-	scaling_factor=optionslist[0].getfieldvalue('scaling_factor');
+def export_gl(md, * varargin):
+    class ResultObj(object):
+        def __getattr__(self, attr):
+            return self.__dict__.get(attr)
 
-	#Deal with title: 
-	print ('setting title')
-	if optionslist[0].exist('title'):
-		title=optionslist[0].getfieldvalue('title');
-	else:
-		title='';
+    print('getting options')
+    templist = plotoptions(varargin)
+    optionslist = templist.list
+    options = optionslist[1]
+    options = checkplotoptions(md, options)
+    #print (templist, options)
+    #templist contains options 0 - 3. Use in the future to rework.
 
-	#initialize model: 
-	print ('initializing model')
-	model.title=title;
-	model.initialZoomFactor=options.getfieldvalue('zoom',-.25);
+    #Setup unique directory in present dir:
+    print('setting directory')
+    directory = optionslist[0].getfieldvalue('directory')
+    databasename = optionslist[0].getfieldvalue('database')
 
-	#Deal with contour {{{
-	print ('getting contour')
-	print (md.mesh.segments)
-	segmenets0 = map(lambda s: s - 1, md.mesh.segments[:,0]);
-	segmenets1 = map(lambda s: s - 1, md.mesh.segments[:,1]);
-	
-	contour_lat1=md.mesh.lat.take(segmenets0)
-	contour_lat2=md.mesh.lat.take(segmenets1);
-	contour_long1=md.mesh.long.take(segmenets0);
-	contour_long2=md.mesh.long.take(segmenets1);
-	contour_surface1=md.geometry.surface.take(segmenets0);
-	contour_surface2=md.geometry.surface.take(segmenets1);
+    #scaling factor:
+    print('setting scaling factor')
+    scaling_factor = optionslist[0].getfieldvalue('scaling_factor')
 
-	R1=6371000*np.ones(len(contour_surface1))+scaling_factor*contour_surface1;
-	R2=6371000*np.ones(len(contour_surface2))+scaling_factor*contour_surface2;
+    #Deal with title:
+    print('setting title')
+    if optionslist[0].exist('title'):
+        title = optionslist[0].getfieldvalue('title')
+    else:
+        title = ''
 
-	model.contourx1 = map(lambda r, lat, long: r * math.cos(math.radians(lat)) * math.cos(math.radians(long)), R1, contour_lat1, contour_long1);
-	model.contoury1 = map(lambda r, lat, long: r * math.cos(math.radians(lat)) * math.sin(math.radians(long)), R1, contour_lat1, contour_long1);
-	model.contourz1 = map(lambda r, lat: r * math.sin(math.radians(lat)), R1, contour_lat1);
-	
-	model.contourx2 = map(lambda r, lat, long: r * math.cos(math.radians(lat)) * math.cos(math.radians(long)), R2, contour_lat2, contour_long2);
-	model.contoury2 = map(lambda r, lat, long: r * math.cos(math.radians(lat)) * math.sin(math.radians(long)), R2, contour_lat2, contour_long2);
-	model.contourz2 = map(lambda r, lat: r * math.sin(math.radians(lat)), R2, contour_lat2);
+    #initialize model:
+    print('initializing model')
+    model.title = title
+    model.initialZoomFactor = options.getfieldvalue('zoom', -.25)
 
-	#}}}
-	#Deal with mesh and results {{{
-	print ('getting mesh')
-	surface=md.geometry.surface.flatten();
-	numberofelements=md.mesh.numberofelements;
-	numberofvertices=md.mesh.numberofvertices;
-	R=6371000*np.ones(len(md.mesh.lat))+scaling_factor*surface;
-	
-	x = map(lambda r, lat, long: r * math.cos(math.radians(lat)) * math.cos(math.radians(long)), R, md.mesh.lat,md.mesh.long);
-	y = map(lambda r, lat, long: r * math.cos(math.radians(lat)) * math.sin(math.radians(long)), R, md.mesh.lat,md.mesh.long);
-	z = map(lambda r, lat: r * math.sin(math.radians(lat)), R, md.mesh.lat);
-	
-	#Deal with triangulation: 
-	print('getting triangulation')
-	model.index=md.mesh.elements;
-	model.x=x;
-	model.y=y;
-	model.z=z;
-	model.surface=surface;
-	
-	results = []
-	print(optionslist)	
-	#Deal with data: 
-	print('getting data')
-	for i in xrange(0,len(optionslist)):
-		options=optionslist[i]; 
-		options=checkplotoptions(md,options);
-		data=options.getfieldvalue('data').flatten();
-		results.append(ResultObj())
-		results[i].data=data;
-		results[i].caxis=options.getfieldvalue('caxis',[min(data), max(data)]);
+    #Deal with contour {{{
+    print('getting contour')
+    print(md.mesh.segments)
+    segmenets0 = [s - 1 for s in md.mesh.segments[:, 0]]
+    segmenets1 = [s - 1 for s in md.mesh.segments[:, 1]]
 
-		label=options.getfieldvalue('label','');
-		if label=='':
-			#create generic label: 
-			label=['data', str(i)];
-		results[i].label=label;
+    contour_lat1 = md.mesh.lat.take(segmenets0)
+    contour_lat2 = md.mesh.lat.take(segmenets1)
+    contour_long1 = md.mesh.long.take(segmenets0)
+    contour_long2 = md.mesh.long.take(segmenets1)
+    contour_surface1 = md.geometry.surface.take(segmenets0)
+    contour_surface2 = md.geometry.surface.take(segmenets1)
 
-		shortlabel=options.getfieldvalue('shortlabel','');
-		if shortlabel=='':
-			#create generic short label: 
-			shortlabel=['data', str(i)];
-		results[i].shortlabel=shortlabel;
+    R1 = 6371000 * np.ones(len(contour_surface1)) + scaling_factor * contour_surface1
+    R2 = 6371000 * np.ones(len(contour_surface2)) + scaling_factor * contour_surface2
 
-		if type(data[2])!=np.float64:
-			time_range=options.getfieldvalue('time_range',[0, 100]);
-			results[i].time_range=time_range;
+    model.contourx1 = list(map(lambda r, lat, int: r * math.cos(math.radians(lat)) * math.cos(math.radians(int)), R1, contour_lat1, contour_long1))
+    model.contoury1 = list(map(lambda r, lat, int: r * math.cos(math.radians(lat)) * math.sin(math.radians(int)), R1, contour_lat1, contour_long1))
+    model.contourz1 = list(map(lambda r, lat: r * math.sin(math.radians(lat)), R1, contour_lat1))
 
-		unit=options.getfieldvalue('unit','');
-		if unit=='':
-			#create generic unit: 
-			unit='SI';
-		results[i].unit=unit;
-	model.results=results;
-	
-	#Write model to javascript database file: 
-	print('writing to file')
-	writejsfile(directory + databasename + '.js',model,databasename);
-#}}}
+    model.contourx2 = list(map(lambda r, lat, int: r * math.cos(math.radians(lat)) * math.cos(math.radians(int)), R2, contour_lat2, contour_long2))
+    model.contoury2 = list(map(lambda r, lat, int: r * math.cos(math.radians(lat)) * math.sin(math.radians(int)), R2, contour_lat2, contour_long2))
+    model.contourz2 = list(map(lambda r, lat: r * math.sin(math.radians(lat)), R2, contour_lat2))
+
+    #}}}
+    #Deal with mesh and results {{{
+    print('getting mesh')
+    surface = md.geometry.surface.flatten()
+    numberofelements = md.mesh.numberofelements
+    numberofvertices = md.mesh.numberofvertices
+    R = 6371000 * np.ones(len(md.mesh.lat)) + scaling_factor * surface
+
+    x = list(map(lambda r, lat, int: r * math.cos(math.radians(lat)) * math.cos(math.radians(int)), R, md.mesh.lat, md.mesh.long))
+    y = list(map(lambda r, lat, int: r * math.cos(math.radians(lat)) * math.sin(math.radians(int)), R, md.mesh.lat, md.mesh.long))
+    z = list(map(lambda r, lat: r * math.sin(math.radians(lat)), R, md.mesh.lat))
+
+    #Deal with triangulation:
+    print('getting triangulation')
+    model.index = md.mesh.elements
+    model.x = x
+    model.y = y
+    model.z = z
+    model.surface = surface
+
+    results = []
+    print(optionslist)
+    #Deal with data:
+    print('getting data')
+    for i in range(0, len(optionslist)):
+        options = optionslist[i]
+        options = checkplotoptions(md, options)
+        data = options.getfieldvalue('data').flatten()
+        results.append(ResultObj())
+        results[i].data = data
+        results[i].caxis = options.getfieldvalue('caxis', [min(data), max(data)])
+
+        label = options.getfieldvalue('label', '')
+        if label == '':
+            #create generic label:
+            label = ['data', str(i)]
+        results[i].label = label
+
+        shortlabel = options.getfieldvalue('shortlabel', '')
+        if shortlabel == '':
+            #create generic short label:
+            shortlabel = ['data', str(i)]
+        results[i].shortlabel = shortlabel
+
+        if type(data[2]) != np.float64:
+            time_range = options.getfieldvalue('time_range', [0, 100])
+            results[i].time_range = time_range
+
+        unit = options.getfieldvalue('unit', '')
+        if unit == '':
+            #create generic unit:
+            unit = 'SI'
+        results[i].unit = unit
+    model.results = results
+
+    #Write model to javascript database file:
+    print('writing to file')
+    writejsfile(directory + databasename + '.js', model, databasename)
+    #}}}
Index: /issm/trunk/src/m/plot/googlemaps.m
===================================================================
--- /issm/trunk/src/m/plot/googlemaps.m	(revision 24312)
+++ /issm/trunk/src/m/plot/googlemaps.m	(revision 24313)
@@ -105,4 +105,17 @@
 heightplus = height + bottom;
 
+%Read Google Maps key
+if exist('~/.googlemapskey');
+	key=deblank(fileread('~/.googlemapskey'));
+	iskey = true;
+else
+	%To create an API key, visit: https://developers.google.com/maps/documentation/maps-static/get-api-key
+	%Once approved, go to Google Cloud Platform and enable "Maps Static APIs"
+	%You will also need to "enable billing fot this project"
+	%Then get the key and enter it in ~/.googlemapskey
+	warning('It appears that you do not have a Google Maps API key, retrieving google maps photos may fail (this is a new requirement of Google...)');
+	iskey = false;
+end
+
 %Initialize final image
 final = zeros(floor(dy),floor(dx),3);%RGB image
@@ -122,4 +135,7 @@
 			'&sensor=false'...
 			'&scale=' num2str(scale)];
+		if iskey,
+			params = [params,'&key=' key];
+		end
 		url = ['http://maps.google.com/maps/api/staticmap?' params];
 		count = 0;
@@ -130,6 +146,6 @@
 				break;
 			catch me,
+				disp(['Failed, trying again... (' num2str(countmax-count) ' more attempts)']);
 				count = count+1;
-				disp(['Failed, trying again... (' num2str(countmax-count) ' more attempts)']);
 				pause(.3);
 				if count>countmax,
Index: /issm/trunk/src/m/plot/manualcb.m
===================================================================
--- /issm/trunk/src/m/plot/manualcb.m	(revision 24312)
+++ /issm/trunk/src/m/plot/manualcb.m	(revision 24313)
@@ -140,5 +140,6 @@
 %Back to original axes
 if getfieldvalue(options,'showregion',0)==0,
-	axes(mainaxes);
+	%Do it this way in order to preserve the figure visibility
+	set(gcf,'CurrentAxes',mainaxes);
 end
 
Index: /issm/trunk/src/m/plot/plot_BC.py
===================================================================
--- /issm/trunk/src/m/plot/plot_BC.py	(revision 24312)
+++ /issm/trunk/src/m/plot/plot_BC.py	(revision 24313)
@@ -1,63 +1,71 @@
-try:
-	import pylab as p
-except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
-
-import numpy as  np
+import numpy as np
 from processmesh import processmesh
 from applyoptions import applyoptions
 from plot_icefront import plot_icefront
+from hydrologydc import hydrologydc
 from mpl_toolkits.mplot3d import Axes3D
+from mpl_toolkits.axes_grid1.inset_locator import inset_axes
 
-def plot_BC(md,options,fig,axgrid,gridindex):
-	'''
-	PLOT_BC - plot model boundary conditions
 
-		Usage:
-			plot_BC(md,options,fig,axes)
+def plot_BC(md, options, fig, axgrid, gridindex):
+    '''
+    PLOT_BC - plot model boundary conditions
 
-		See also: PLOTMODEL
-	'''
-	x,y,z,elements,is2d,isplanet=processmesh(md,[],options)
-	
-	ax=axgrid[gridindex]
-	fig.delaxes(axgrid.cbar_axes[gridindex])
+        Usage:
+            plot_BC(md, options, fig, axes)
 
-	if not is2d:
-		ax=inset_locator.inset_axes(axgrid[gridindex],width='100%',height='100%',loc=3,borderpad=0,axes_class=Axes3D)
+        See also: PLOTMODEL
+    '''
+    x, y, z, elements, is2d, isplanet = processmesh(md, [], options)
 
-	#plot neuman
-	plot_icefront(md,options,fig,ax)
+    ax = axgrid[gridindex]
+    fig.delaxes(axgrid.cbar_axes[gridindex])
 
-	XLims=[np.min(x),np.max(x)]
-	YLims=[np.min(y),np.max(y)]
-	#plot dirichlets
-	dirichleton=options.getfieldvalue('dirichlet','on')
-	if dirichleton=='on':
-		ax.scatter(x[np.where(~np.isnan(md.stressbalance.spcvx))],
-							 y[np.where(~np.isnan(md.stressbalance.spcvx))],
-							 marker='o',c='r',s=240,label='vx Dirichlet',linewidth=0)
-		ax.scatter(x[np.where(~np.isnan(md.stressbalance.spcvy))],
-							 y[np.where(~np.isnan(md.stressbalance.spcvy))],
-							 marker='o',c='b',s=160,label='vy Dirichlet',linewidth=0)
-		ax.scatter(x[np.where(~np.isnan(md.stressbalance.spcvz))],
-							 y[np.where(~np.isnan(md.stressbalance.spcvz))],
-							 marker='o',c='y',s=80,label='vz Dirichlet',linewidth=0)
-		try:
-			ax.scatter(x[np.where(~np.isnan(md.hydrology.spcepl_head))],
-								 y[np.where(~np.isnan(md.hydrology.spcepl_head))],
-								 marker='v',c='r',s=240,label='EPL Head',linewidth=0)
-			ax.scatter(x[np.where(~np.isnan(md.hydrology.spcsediment_head))],
-								 y[np.where(~np.isnan(md.hydrology.spcsediment_head))],
-								 marker='^',c='b',s=240,label='IDS head',linewidth=0)
-		except AttributeError:
-			print ('Not treating Hydrologydc, skipping these boundaries')
-		ax.set_xlim(XLims)
-		ax.set_ylim(YLims)
-	ax.legend(bbox_to_anchor=(0., 1.02, 1., .102), loc=3,
-						ncol=3, mode="expand", borderaxespad=0.)
-	#apply options
-	options.addfielddefault('title','Boundary conditions')
-	options.addfielddefault('colorbar','off')
-	applyoptions(md,[],options,fig,axgrid,gridindex)
-	
+    if not is2d:
+        ax = inset_axes(axgrid[gridindex], width='100%', height='100%', loc=3, borderpad=0, axes_class=Axes3D)
+
+    #plot neuman
+    plot_icefront(md, options, fig, ax)
+
+    XLims = [np.min(x), np.max(x)]
+    YLims = [np.min(y), np.max(y)]
+    #plot dirichlets
+    dirichleton = options.getfieldvalue('dirichlet', 'on')
+
+    if dirichleton == 'on':
+        #define what to plot with plot style
+        spc_dict = {'spcvx': ['stressbalance', 'o', 'r', 240, 'vx Dirichlet'],
+                    'spcvy': ['stressbalance', 'o', 'b', 160, 'vy Dirichlet']}
+        if not is2d:
+            spc_dict['spcvz'] = ['stressbalance', 'o', 'y', 80, 'vy Dirichlet']
+
+        if isinstance(md.hydrology, hydrologydc):
+            spc_dict['spcepl_head'] = ['hydrology', 'v', 'r', 240, 'EPL Head']
+            if md.hydrology.isefficientlayer:
+                spc_dict['spcsediment_head'] = ['hydrology', '^', 'b', 240, 'IDS Head']
+
+        for key in spc_dict:
+            mark = spc_dict[str(key)][1]
+            color = spc_dict[str(key)][2]
+            size = spc_dict[str(key)][3]
+            name = spc_dict[str(key)][4]
+            #first reduce vectors if layer is used
+            if options.getfieldvalue('layer', 0) >= 1:
+                plotlayer = options.getfieldvalue('layer', 0)
+                slicesize = len(x)
+                fulldata = md.__dict__[str(spc_dict[str(key)][0])].__dict__[str(key)]
+                data = fulldata[(plotlayer - 1) * slicesize:plotlayer * slicesize]
+            else:
+                data = md.__dict__[str(spc_dict[str(key)][0])].__dict__[str(key)]
+            ax.scatter(x[np.where(~np.isnan(data))],
+                       y[np.where(~np.isnan(data))],
+                       marker=mark, c=color, s=size, label=name, linewidth=0)
+
+    ax.set_xlim(XLims)
+    ax.set_ylim(YLims)
+    ax.legend(bbox_to_anchor=(0., 1.02, 1., .102), loc=3,
+              ncol=3, mode="expand", borderaxespad=0.)
+    #apply options
+    options.addfielddefault('title', 'Boundary conditions')
+    options.addfielddefault('colorbar', 'off')
+    applyoptions(md, [], options, fig, axgrid, gridindex)
Index: /issm/trunk/src/m/plot/plot_contour.py
===================================================================
--- /issm/trunk/src/m/plot/plot_contour.py	(revision 24312)
+++ /issm/trunk/src/m/plot/plot_contour.py	(revision 24313)
@@ -1,41 +1,39 @@
+import numpy as np
 from averaging import averaging
 from processmesh import processmesh
 from processdata import processdata
-try:
-	import matplotlib.pyplot as plt
-except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
 
-def plot_contour(md,datain,options,ax):
-	'''
-	plot contours of a given field (called within plotmodel)
 
-	Usage:
-		plot_contour(md,data,options)
+def plot_contour(md, datain, options, ax):
+    '''
+    plot contours of a given field (called within plotmodel)
 
-	See also: plotmodel
-	'''
+    Usage:
+        plot_contour(md, data, options)
 
-	x,y,z,elements,is2d,isplanet=processmesh(md,datain,options)
-	data,datatype=processdata(md,datain,options)
+    See also: plotmodel
+    '''
 
-	# process data: must be on nodes
-	if datatype==1: # element data
-		data=averaging(md,data,0)
-	elif datatype==2:
-		pass
-	elif datatype==3: # quiver (vector) data
-		data=np.sqrt(datain**2)
-	else:
-		raise ValueError('datatype not supported in call to plot_contour')
+    x, y, z, elements, is2d, isplanet = processmesh(md, datain, options)
+    data, datatype = processdata(md, datain, options)
 
-	# contouronly TODO (cla will also clear an overlay image)
+    # process data: must be on nodes
+    if datatype == 1:  # element data
+        data = averaging(md, data, 0)
+    elif datatype == 2:
+        pass
+    elif datatype == 3:  # quiver (vector) data
+        data = np.sqrt(datain**2)
+    else:
+        raise ValueError('datatype not supported in call to plot_contour')
 
-	# retrieve necessary options
-	levels=options.getfieldvalue('contourlevels')
-	norm=options.getfieldvalue('colornorm')
-	colors=options.getfieldvalue('contourcolors','y')
-	linestyles=options.getfieldvalue('contourlinestyles','-')
-	linewidths=options.getfieldvalue('contourlinewidths',1)
+    # contouronly TODO (cla will also clear an overlay image)
 
-	ax.tricontour(x,y,elements,data,levels,colors=colors,norm=norm,linestyles=linestyles,linewidths=linewidths)
+    # retrieve necessary options
+    levels = options.getfieldvalue('contourlevels')
+    norm = options.getfieldvalue('colornorm')
+    colors = options.getfieldvalue('contourcolors', 'y')
+    linestyles = options.getfieldvalue('contourlinestyles', ' - ')
+    linewidths = options.getfieldvalue('contourlinewidths', 1)
+
+    ax.tricontour(x, y, elements, data, levels, colors=colors, norm=norm, linestyles=linestyles, linewidths=linewidths)
Index: /issm/trunk/src/m/plot/plot_elementnumbering.m
===================================================================
--- /issm/trunk/src/m/plot/plot_elementnumbering.m	(revision 24312)
+++ /issm/trunk/src/m/plot/plot_elementnumbering.m	(revision 24313)
@@ -25,7 +25,14 @@
 
 	%numbering
-	text(sum(x(elements(:,1:3)),2)/3,sum(y(elements(:,1:3)),2)/3,sum(z(elements(:,1:3)),2)/3,...
-		num2str(elementnumbers),...
-		'HorizontalAlignment','center','VerticalAlignment','middle');
+	X   = sum(x(elements(:,1:3)),2)/3;
+	Y   = sum(y(elements(:,1:3)),2)/3;
+	Z   = sum(z(elements(:,1:3)),2)/3;
+	NUM = elementnumbers;
+	if exist(options,'axis')
+		AXIS = getfieldvalue(options,'axis');
+		pos = find(X>AXIS(1) & X<AXIS(2) & Y>AXIS(3) & Y<AXIS(4));
+		X = X(pos); Y=Y(pos); Z=Z(pos); NUM=NUM(pos);
+	end
+	text(X,Y,Z,num2str(NUM),'HorizontalAlignment','center','VerticalAlignment','middle');
 else
 	%plot mesh 
@@ -47,7 +54,14 @@
 
 	%numbering
-	text(sum(x(elements(:,1:6)),2)/6,sum(y(elements(:,1:6)),2)/6,sum(z(elements(:,1:6)),2)/6,...
-		num2str(elementnumbers),...
-		'HorizontalAlignment','center','VerticalAlignment','middle');
+	X   = sum(x(elements(:,1:6)),2)/6;
+	Y   = sum(y(elements(:,1:6)),2)/6;
+	Z   = sum(z(elements(:,1:6)),2)/6;
+	NUM = elementnumbers;
+	if exist(options,'axis')
+		AXIS = getfieldvalue(options,'axis');
+		pos = find(X>AXIS(1) & X<AXIS(2) & Y>AXIS(3) & Y<AXIS(4));
+		X = X(pos); Y=Y(pos); Z=Z(pos); NUM=NUM(pos);
+	end
+	text(X,Y,Z,num2str(NUM),'HorizontalAlignment','center','VerticalAlignment','middle');
 end
 
Index: /issm/trunk/src/m/plot/plot_elementnumbering.py
===================================================================
--- /issm/trunk/src/m/plot/plot_elementnumbering.py	(revision 24312)
+++ /issm/trunk/src/m/plot/plot_elementnumbering.py	(revision 24313)
@@ -1,51 +1,43 @@
-try:
-	import pylab as p
-except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
-
-import numpy as  np
+import numpy as np
 from processmesh import processmesh
 from applyoptions import applyoptions
-from plot_icefront import plot_icefront
 
-def plot_elementnumbering(md,options,fig,axgrid,gridindex):
-	'''
-	plot_elementnumbering - plot element numberign (starting at 1 matlab and c convention)
 
-		Usage:
-			plot_elementnumbering(md,options,fig,axes)
+def plot_elementnumbering(md, options, fig, axgrid, gridindex):
+    '''
+    plot_elementnumbering - plot element numberign (starting at 1 matlab and c convention)
 
-		See also: PLOTMODEL
-	'''
-	x,y,z,elements,is2d,isplanet=processmesh(md,[],options)
+        Usage:
+            plot_elementnumbering(md, options, fig, axes)
 
-	ax=axgrid[gridindex]
-	fig.delaxes(axgrid.cbar_axes[gridindex])
-	
-	if is2d:
-		ax.triplot(x,y,elements)
-	else:
-		print 'Not Implemented Yet'
+        See also: PLOTMODEL
+    '''
+    x, y, z, elements, is2d, isplanet = processmesh(md, [], options)
 
-	XLims=[np.min(x),np.max(x)]
-	YLims=[np.min(y),np.max(y)]
-	#plot mesh
-	ax.triplot(x,y,elements)
-	highlightpos=options.getfieldvalue('highlight','none')
-	if highlightpos!='none':
-		#if just one element duplicate it to avoid coloring issues
-		if type(highlightpos)==int:
-			highlightpos=[highlightpos,highlightpos]
-		#convert from to matlab numbering
-		highlightpos=[pos-1 for pos in highlightpos]
-		colors=np.asarray([0.5 for element in elements[highlightpos]])
-		ax.tripcolor(x,y,elements[highlightpos],facecolors=colors,alpha=0.5)
-	# and numbers
-	for i,element in enumerate(elements):
-		ax.text(np.mean(x[element]),np.mean(y[element]),str(i+1),ha='center',va='center',clip_on=True)
-		
-	#apply options
-	options.addfielddefault('title','Element numbers (matlab indexation)')
-	options.addfielddefault('colorbar','off')
-	applyoptions(md,[],options,fig,axgrid,gridindex)
-	
+    ax = axgrid[gridindex]
+    fig.delaxes(axgrid.cbar_axes[gridindex])
+
+    if is2d:
+        ax.triplot(x, y, elements)
+    else:
+        print('Not Implemented Yet')
+
+    #plot mesh
+    ax.triplot(x, y, elements)
+    highlightpos = options.getfieldvalue('highlight', 'none')
+    if highlightpos != 'none':
+        #if just one element duplicate it to avoid coloring issues
+        if type(highlightpos) == int:
+            highlightpos = [highlightpos, highlightpos]
+    #convert from to matlab numbering
+        highlightpos = [pos - 1 for pos in highlightpos]
+        colors = np.asarray([0.5 for element in elements[highlightpos]])
+        ax.tripcolor(x, y, elements[highlightpos], facecolors=colors, alpha=0.5)
+    # and numbers
+    for i, element in enumerate(elements):
+        ax.text(np.mean(x[element]), np.mean(y[element]), str(i + 1), ha='center', va='center', clip_on=True)
+
+    #apply options
+    options.addfielddefault('title', 'Element numbers (matlab indexation)')
+    options.addfielddefault('colorbar', 'off')
+    applyoptions(md, [], options, fig, axgrid, gridindex)
Index: /issm/trunk/src/m/plot/plot_icefront.py
===================================================================
--- /issm/trunk/src/m/plot/plot_icefront.py	(revision 24312)
+++ /issm/trunk/src/m/plot/plot_icefront.py	(revision 24313)
@@ -1,34 +1,70 @@
-try:
-	import pylab as p
-except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
-import numpy as  np
+import numpy as np
 from processmesh import processmesh
-from applyoptions import applyoptions
+from mpl_toolkits.mplot3d.art3d import Line3DCollection
+from mpl_toolkits.axes_grid1.inset_locator import inset_axes
+from mpl_toolkits.mplot3d import Axes3D
 
-def plot_icefront(md,options,fig,ax):
-	#PLOT_ICEFRONT - plot segment on neumann BC
-	#
-	#   Usage:
-	#      plot_icefront(md,options,width,i)
-	#
-	#   See also: PLOTMODEL
-#process mesh and data
-	x,y,z,elements,is2d,isplanet=processmesh(md,[],options)
 
-	#icefront check
-	icefront=np.where(np.abs(np.sum(md.mask.ice_levelset[elements],1))!=3) 
-	onlyice=np.where(np.sum(md.mask.ice_levelset[elements],1)==-3)
-	noice=np.where(np.sum(md.mask.ice_levelset[elements],1)==3)
+def plot_icefront(md, options, fig, ax):
+    #PLOT_ICEFRONT - plot segment on neumann BC
+    #
+    #   Usage:
+    #      plot_icefront(md, options, width, i)
+    #
+    #   See also: PLOTMODEL
+    #process mesh and data
+    x, y, z, elements, is2d, isplanet = processmesh(md, [], options)
 
-	#plot mesh
-	ax.triplot(x,y,elements)
+    icenodes = md.mask.ice_levelset < 0
+    iceelement = np.sum(icenodes[elements], axis=1)
 
-	#highlight elements on neumann
-	if len(icefront[0])>0:
-		colors=np.asarray([0.5 for element in elements[icefront]])
-		ax.tripcolor(x,y,elements[icefront],facecolors=colors,alpha=0.5,label='elements on ice front')
+    if options.exist('layer'):
+        nodes_per_elt = np.shape(md.mesh.elements2d)[1]
+    else:
+        nodes_per_elt = np.shape(md.mesh.elements)[1]
+    #icefront check
+    icefront = np.where(np.logical_and(iceelement != nodes_per_elt, iceelement != 0))
 
-	#apply options
-	options.addfielddefault('title','Neumann boundary conditions')
-	options.addfielddefault('colorbar','off')
+    #plot mesh
+    if is2d:
+        ax.triplot(x, y, elements)
+
+        #highlight elements on neumann
+        if len(icefront[0]) > 0:
+            colors = np.asarray([0.5 for element in elements[icefront]])
+            ax.tripcolor(x, y, elements[icefront], facecolors=colors, alpha=0.5, label='elements on ice front')
+    else:
+        ax = inset_axes(ax, width='100%', height='100%', loc=3, borderpad=0, axes_class=Axes3D)
+
+        AB = elements[:, 0:2]
+        BC = elements[:, 1:3]
+        CA = np.vstack((elements[:, 2], elements[:, 0])).T
+        DE = elements[:, 3:5]
+        EF = elements[:, 4:]
+        FD = np.vstack((elements[:, 5], elements[:, 3])).T
+        AD = np.vstack((elements[:, 0], elements[:, 3])).T
+        BE = np.vstack((elements[:, 1], elements[:, 4])).T
+        CF = np.vstack((elements[:, 2], elements[:, 5])).T
+
+        tmpa = np.vstack((AB, BC, CA, DE, EF, FD, AD, BE, CF))
+    #deleting segments that appear multiple times
+        tmpb = np.ascontiguousarray(tmpa).view(np.dtype((np.void, tmpa.dtype.itemsize * tmpa.shape[1])))
+        _, idx = np.unique(tmpb, return_index=True)
+        triel = tmpa[idx]
+
+        for t, triangle in enumerate(triel):
+            tri = list(zip(x[triangle], y[triangle], z[triangle]))
+            facecolor = [0, 0, 0]
+            if t in icefront:
+                facecolor = [0.5, 0.5, 0.5]
+            pl3 = Line3DCollection([tri], edgecolor='r', facecolor=facecolor)
+            ax.add_collection3d(pl3)
+
+        ax.set_xlim([min(x), max(x)])
+        ax.set_ylim([min(y), max(y)])
+        ax.set_zlim([min(z), max(z)])
+        #highlight elements on neumann
+
+    #apply options
+    options.addfielddefault('title', 'Neumann boundary conditions')
+    options.addfielddefault('colorbar', 'off')
Index: /issm/trunk/src/m/plot/plot_manager.py
===================================================================
--- /issm/trunk/src/m/plot/plot_manager.py	(revision 24312)
+++ /issm/trunk/src/m/plot/plot_manager.py	(revision 24313)
@@ -1,7 +1,2 @@
-try:
-	import pylab as p
-	import matplotlib.pyplot as plt
-except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
 
 from checkplotoptions import checkplotoptions
@@ -16,99 +11,99 @@
 
 try:
-	from osgeo import gdal
-	overlaysupport=True
+    from osgeo import gdal
+    overlaysupport = True
 except ImportError:
-	print 'osgeo/gdal for python not installed, overlay plots are not enabled'
-	overlaysupport=False
+    print('osgeo/gdal for python not installed, overlay plots are not enabled')
+    overlaysupport = False
 
 if overlaysupport:
-	from plot_overlay import plot_overlay
+    from plot_overlay import plot_overlay
 
-def plot_manager(md,options,fig,axgrid,gridindex):
-	'''
-	PLOT_MANAGER - distribute the plots called by plotmodel
 
-	'fig' is a handle to the figure instance created by plotmodel.
+def plot_manager(md, options, fig, axgrid, gridindex):
+    '''
+    PLOT_MANAGER - distribute the plots called by plotmodel
 
-	'ax' is a handle to the axes instance created by plotmodel.  This is
-	currently generated using matplotlib's AxesGrid toolkit.
+    'fig' is a handle to the figure instance created by plotmodel.
 
-	Usage:
-		plot_manager(md,options,fig,ax);
+    'ax' is a handle to the axes instance created by plotmodel.  This is
+    currently generated using matplotlib's AxesGrid toolkit.
 
-	See also: PLOTMODEL, PLOT_UNIT
-	'''
+    Usage:
+        plot_manager(md, options, fig, ax)
 
-	#parse options and get a structure of options
-	options=checkplotoptions(md,options)
-	#get data to be plotted
-	data=options.getfieldvalue('data')
-	#add ticklabel has a default option
-	options.addfielddefault('ticklabels','on')
+    See also: PLOTMODEL, PLOT_UNIT
+    '''
+    #parse options and get a structure of options
+    options = checkplotoptions(md, options)
+    #get data to be plotted
+    data = options.getfieldvalue('data')
+    #add ticklabel has a default option
+    options.addfielddefault('ticklabels', 'on')
 
-	ax=axgrid[gridindex]
-	# {{{ basemap plot TOFIX
-	#if options.exist('basemap'):
-	#	plot_basemap(md,data,options,nrows,ncols,i)
-	# }}}
-	# {{{ overlay plot
-	if options.exist('overlay') and overlaysupport:
-		plot_overlay(md,data,options,ax)
-		options.addfielddefault('alpha',0.5)
-		options.addfielddefault('xlim',[min(md.mesh.x),max(md.mesh.x)])
-		options.addfielddefault('ylim',[min(md.mesh.y),max(md.mesh.y)])
-	# }}}
-	# {{{ dealing with special plot
-	if isinstance(data,(str,unicode)):
-		if data=='mesh': 
-			plot_mesh(md,options,fig,axgrid,gridindex)
+    ax = axgrid[gridindex]
+    # {{{ basemap plot TOFIX
+    #if options.exist('basemap'):
+    #    plot_basemap(md, data, options, nrows, ncols, i)
+    # }}}
+    # {{{ overlay plot
+    if options.exist('overlay') and overlaysupport:
+        plot_overlay(md, data, options, ax)
+        options.addfielddefault('alpha', 0.5)
+        options.addfielddefault('xlim', [min(md.mesh.x), max(md.mesh.x)])
+        options.addfielddefault('ylim', [min(md.mesh.y), max(md.mesh.y)])
+    # }}}
+    # {{{ dealing with special plot
+    if isinstance(data, str):
+        if data == 'mesh':
+            plot_mesh(md, options, fig, axgrid, gridindex)
 
-			#fig.delaxes(fig.axes[1]) # hack to remove colorbar after the fact
-			return
-		elif data=='BC': 
-			plot_BC(md,options,fig,axgrid,gridindex)
-			return
-		elif data=='elementnumbering': 
-			plot_elementnumbering(md,options,fig,axgrid,gridindex)
-			return
-		elif data=='vertexnumbering': 
-			plot_vertexnumbering(md,options,fig,axgrid,gridindex)
-			return
-		elif data=='none':
-			print 'no data provided to plot (TODO: write plot_none.py)'
-			applyoptions(md,[],options,fig,axgrid,gridindex)
-			return
-		else:
-			print "WARNING: '%s' is not implemented or is not a valid string for option 'data'" % data
-	# }}}
-	# {{{ Gridded plot TODO
-	# }}}
-	# {{{ Section plot TODO
-	# }}}
-	# {{{ Profile plot TODO
-	# }}}
+    #fig.delaxes(fig.axes[1])  # hack to remove colorbar after the fact
+            return
+        elif data == 'BC':
+            plot_BC(md, options, fig, axgrid, gridindex)
+            return
+        elif data == 'elementnumbering':
+            plot_elementnumbering(md, options, fig, axgrid, gridindex)
+            return
+        elif data == 'vertexnumbering':
+            plot_vertexnumbering(md, options, fig, axgrid, gridindex)
+            return
+        elif data == 'none':
+            print('no data provided to plot (TODO: write plot_none.py)')
+            applyoptions(md, [], options, fig, axgrid, gridindex)
+            return
+        else:
+            print(("WARNING: '%s' is not implemented or is not a valid string for option 'data'" % data))
+    # }}}
+    # {{{ Gridded plot TODO
+    # }}}
+    # {{{ Section plot TODO
+    # }}}
+    # {{{ Profile plot TODO
+    # }}}
 
-	#process data and model
-	x,y,z,elements,is2d,isplanet=processmesh(md,data,options)
-	data2,datatype=processdata(md,data,options)
-	#plot unit
-	plot_unit(x,y,z,elements,data2,is2d,isplanet,datatype,options,fig,axgrid,gridindex)
-	#apply all options
-	applyoptions(md,data2,options,fig,axgrid,gridindex)
-	
-	#ground overlay on kml plot_unit
+    #process data and model
+    x, y, z, elements, is2d, isplanet = processmesh(md, data, options)
+    data2, datatype = processdata(md, data, options)
+    #plot unit
+    plot_unit(x, y, z, elements, data2, is2d, isplanet, datatype, options, fig, axgrid, gridindex)
+    #apply all options
+    applyoptions(md, data2, options, fig, axgrid, gridindex)
 
-	# Bits and pieces
-	#initialize plot handle variable
-	#handle=None
+    #ground overlay on kml plot_unit
 
-	# initialize subplot
-	#p.subplot(nrows,ncols,i,aspect='equal')
+    # Bits and pieces
+    #initialize plot handle variable
+    #handle = None
 
-	#standard plot
-	#if not handle:
-	#	p.subplot(nrows,ncols,i,aspect='equal')
+    # initialize subplot
+    #p.subplot(nrows, ncols, i, aspect = 'equal')
 
-	#elif data in vars(md):
-	#else:
-		#print "'data' not a string, plotting model properties yet to be implemented..."
+    #standard plot
+    #if not handle:
+    #    p.subplot(nrows, ncols, i, aspect = 'equal')
+
+    #elif data in vars(md):
+    #else:
+    #print "'data' not a string, plotting model properties yet to be implemented..."
Index: /issm/trunk/src/m/plot/plot_mesh.py
===================================================================
--- /issm/trunk/src/m/plot/plot_mesh.py	(revision 24312)
+++ /issm/trunk/src/m/plot/plot_mesh.py	(revision 24313)
@@ -1,59 +1,56 @@
-try:
-	import pylab as p
-except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
-
 import numpy as np
 from processmesh import processmesh
 from applyoptions import applyoptions
 from mpl_toolkits.mplot3d.art3d import Line3DCollection
-from mpl_toolkits.axes_grid1 import inset_locator
+from mpl_toolkits.axes_grid1.inset_locator import inset_axes
 from mpl_toolkits.mplot3d import Axes3D
-def plot_mesh(md,options,fig,axgrid,gridindex):
-	'''
-	PLOT_MESH - plot model mesh
 
-		Usage:
-			plot_mesh(md,options,nlines,ncols,i)
 
-		See also: PLOTMODEL
-	'''
-	x,y,z,elements,is2d,isplanet=processmesh(md,'mesh',options)
+def plot_mesh(md, options, fig, axgrid, gridindex):
+    '''
+    PLOT_MESH - plot model mesh
 
-	ax=axgrid[gridindex]
-	fig.delaxes(axgrid.cbar_axes[gridindex])
-	
-	if is2d:
-		ax.triplot(x,y,elements)
-	else:
-		ax=inset_locator.inset_axes(axgrid[gridindex],width='100%',height='100%',loc=3,borderpad=0,axes_class=Axes3D)
-		
-		AB=elements[:,0:2]
-		BC=elements[:,1:3]
-		CA=np.vstack((elements[:,2],elements[:,0])).T
-		DE=elements[:,3:5]
-		EF=elements[:,4:]
-		FD=np.vstack((elements[:,5],elements[:,3])).T
-		AD=np.vstack((elements[:,0],elements[:,3])).T
-		BE=np.vstack((elements[:,1],elements[:,4])).T
-		CF=np.vstack((elements[:,2],elements[:,5])).T
-		
-		tmpa=np.vstack((AB,BC,CA,DE,EF,FD,AD,BE,CF))
-		#deleting segments that appear multiple times
-		tmpb = np.ascontiguousarray(tmpa).view(np.dtype((np.void, tmpa.dtype.itemsize * tmpa.shape[1])))
-		_, idx = np.unique(tmpb, return_index=True)
-		triel= tmpa[idx]
-		
-		for triangle in triel:
-			tri=zip(x[triangle],y[triangle],z[triangle])
-			pl3=Line3DCollection([tri],edgecolor='r')
-			ax.add_collection3d(pl3)
-			
-		ax.set_xlim([min(x),max(x)])
-		ax.set_ylim([min(y),max(y)])
-		ax.set_zlim([min(z),max(z)])
-	#apply options
-	options.addfielddefault('title','Mesh')
-	options.addfielddefault('colorbar','off')
-	options.addfielddefault('ticklabels','on')
-	applyoptions(md,[],options,fig,axgrid,gridindex)
+        Usage:
+            plot_mesh(md, options, nlines, ncols, i)
+
+        See also: PLOTMODEL
+    '''
+    x, y, z, elements, is2d, isplanet = processmesh(md, 'mesh', options)
+
+    ax = axgrid[gridindex]
+    fig.delaxes(axgrid.cbar_axes[gridindex])
+
+    if is2d:
+        ax.triplot(x, y, elements)
+    else:
+        ax = inset_axes(axgrid[gridindex], width='100%', height='100%', loc=3, borderpad=0, axes_class=Axes3D)
+
+        AB = elements[:, 0:2]
+        BC = elements[:, 1:3]
+        CA = np.vstack((elements[:, 2], elements[:, 0])).T
+        DE = elements[:, 3:5]
+        EF = elements[:, 4:]
+        FD = np.vstack((elements[:, 5], elements[:, 3])).T
+        AD = np.vstack((elements[:, 0], elements[:, 3])).T
+        BE = np.vstack((elements[:, 1], elements[:, 4])).T
+        CF = np.vstack((elements[:, 2], elements[:, 5])).T
+
+        tmpa = np.vstack((AB, BC, CA, DE, EF, FD, AD, BE, CF))
+    #deleting segments that appear multiple times
+        tmpb = np.ascontiguousarray(tmpa).view(np.dtype((np.void, tmpa.dtype.itemsize * tmpa.shape[1])))
+        _, idx = np.unique(tmpb, return_index=True)
+        triel = tmpa[idx]
+
+        for triangle in triel:
+            tri = list(zip(x[triangle], y[triangle], z[triangle]))
+            pl3 = Line3DCollection([tri], edgecolor='r')
+            ax.add_collection3d(pl3)
+
+        ax.set_xlim([min(x), max(x)])
+        ax.set_ylim([min(y), max(y)])
+        ax.set_zlim([min(z), max(z)])
+    #apply options
+    options.addfielddefault('title', 'Mesh')
+    options.addfielddefault('colorbar', 'off')
+    options.addfielddefault('ticklabels', 'on')
+    applyoptions(md, [], options, fig, axgrid, gridindex)
Index: /issm/trunk/src/m/plot/plot_overlay.py
===================================================================
--- /issm/trunk/src/m/plot/plot_overlay.py	(revision 24312)
+++ /issm/trunk/src/m/plot/plot_overlay.py	(revision 24313)
@@ -1,3 +1,3 @@
-import numpy as  np
+import numpy as np
 from processmesh import processmesh
 from processdata import processdata
@@ -5,128 +5,128 @@
 import matplotlib.pyplot as plt
 import matplotlib as mpl
+import os
 try:
     from mpl_toolkits.basemap import Basemap
 except ImportError:
-    print 'Basemap toolkit not installed'
-
-import os
-
+    print('Basemap toolkit not installed')
 try:
-        from osgeo import gdal
+    from osgeo import gdal
 except ImportError:
-	print 'osgeo/gdal for python not installed, plot_overlay is disabled'
+    print('osgeo/gdal for python not installed, plot_overlay is disabled')
 
 
-def plot_overlay(md,data,options,ax):
-	'''
-	Function for plotting a georeferenced image.  This function is called
-	from within the plotmodel code.
-	'''
+def plot_overlay(md, data, options, ax):
+    '''
+    Function for plotting a georeferenced image.  This function is called
+    from within the plotmodel code.
+    '''
 
-	x,y,z,elements,is2d,isplanet=processmesh(md,[],options)
+    x, y, z, elements, is2d, isplanet = processmesh(md, [], options)
+    try:
+        data, datatype = processdata(md, data, options)
+        imageonly = 0
+    except (TypeError, ValueError):  #that should catch None and 'none' but may also catch unwanted errors
+        imageonly = 1
+        data = np.float('nan') * np.ones((md.mesh.numberofvertices, ))
+        datatype = 1
 
-	if data=='none' or data==None:
-		imageonly=1
-		data=np.float('nan')*np.ones((md.mesh.numberofvertices,))
-		datatype=1
-	else:
-		imageonly=0
-		data,datatype=processdata(md,data,options)
+    if not is2d:
+        raise Exception('overlay plot not supported for 3D meshes, project on a 2D layer first')
 
-	if not is2d:
-		raise StandardError('overlay plot not supported for 3D meshes, project on a 2D layer first')
+    if not options.exist('overlay_image'):
+        raise Exception('overlay error: provide overlay_image with path to geotiff file')
+    image = options.getfieldvalue('overlay_image')
 
-	if not options.exist('overlay_image'):
-		raise StandardError('overlay error: provide overlay_image with path to geotiff file')
-	image=options.getfieldvalue('overlay_image')
+    xlim = options.getfieldvalue('xlim', [min(md.mesh.x), max(md.mesh.x)])
+    ylim = options.getfieldvalue('ylim', [min(md.mesh.y), max(md.mesh.y)])
 
-	xlim=options.getfieldvalue('xlim',[min(md.mesh.x),max(md.mesh.x)])
-	ylim=options.getfieldvalue('ylim',[min(md.mesh.y),max(md.mesh.y)])
+    gtif = gdal.Open(image)
+    trans = gtif.GetGeoTransform()
+    xmin = trans[0]
+    xmax = trans[0] + gtif.RasterXSize * trans[1]
+    ymin = trans[3] + gtif.RasterYSize * trans[5]
+    ymax = trans[3]
+    # allow supplied image to have limits smaller than basemap or model limits
+    x0 = max(min(xlim), xmin)
+    x1 = min(max(xlim), xmax)
+    y0 = max(min(ylim), ymin)
+    y1 = min(max(ylim), ymax)
+    inputname = 'temp.tif'
+    os.system('gdal_translate-quiet - projwin ' + str(x0) + ' ' + str(y1) + ' ' + str(x1) + ' ' + str(y0) + ' ' + image + ' ' + inputname)
 
-	gtif=gdal.Open(image)
-	trans=gtif.GetGeoTransform()
-	xmin=trans[0]
-	xmax=trans[0]+gtif.RasterXSize*trans[1]
-	ymin=trans[3]+gtif.RasterYSize*trans[5]
-	ymax=trans[3]
-	
-	# allow supplied image to have limits smaller than basemap or model limits
-	x0=max(min(xlim),xmin)
-	x1=min(max(xlim),xmax)
-	y0=max(min(ylim),ymin)
-	y1=min(max(ylim),ymax)
-	inputname='temp.tif'
-	os.system('gdal_translate -quiet -projwin ' + str(x0) + ' ' + str(y1) + ' ' + str(x1) + ' ' + str(y0) + ' ' + image+ ' ' + inputname)
-	
-	gtif=gdal.Open(inputname)
-	arr=gtif.ReadAsArray()
-	#os.system('rm -rf ./temp.tif')
-	
-	if gtif.RasterCount>=3:  # RGB array
-		r=gtif.GetRasterBand(1).ReadAsArray()
-		g=gtif.GetRasterBand(2).ReadAsArray()
-		b=gtif.GetRasterBand(3).ReadAsArray()
-		arr=0.299*r+0.587*g+0.114*b
+    gtif = gdal.Open(inputname)
+    arr = gtif.ReadAsArray()
+    #os.system('rm -rf . / temp.tif')
 
-	# normalize array
-	arr=arr/np.float(np.max(arr.ravel()))
-        arr=1.-arr # somehow the values got flipped
+    if gtif.RasterCount >= 3:  # RGB array
+        r = gtif.GetRasterBand(1).ReadAsArray()
+        g = gtif.GetRasterBand(2).ReadAsArray()
+        b = gtif.GetRasterBand(3).ReadAsArray()
+        arr = 0.299 * r + 0.587 * g + 0.114 * b
 
-	if options.getfieldvalue('overlayhist',0)==1:
-		ax=plt.gca()
-		num=2
-		while True:
-			if not plt.fignum_exists(num):
-				break
-			else:
-				num+=1
-		plt.figure(num)
-		plt.hist(arr.flatten(),bins=256,range=(0.,1.))
-		plt.title('histogram of overlay image, use for setting overlaylims')
-                plt.show()
-		plt.sca(ax) # return to original axes/figure
-		
-	# get parameters from cropped geotiff
-	trans=gtif.GetGeoTransform()
-	xmin=trans[0]
-	xmax=trans[0]+gtif.RasterXSize*trans[1]
-	ymin=trans[3]+gtif.RasterYSize*trans[5]
-	ymax=trans[3]
-	dx=trans[1]
-	dy=trans[5]	
-	
-	xarr=np.arange(xmin,xmax,dx)
-	yarr=np.arange(ymin,ymax,-dy) # -dy since origin='upper' (not sure how robust this is)
-	xg,yg=np.meshgrid(xarr,yarr)
-	overlaylims=options.getfieldvalue('overlaylims',[min(arr.ravel()),max(arr.ravel())])
-	norm=mpl.colors.Normalize(vmin=overlaylims[0],vmax=overlaylims[1])
+    # normalize array
+    arr = arr / np.float(np.max(arr.ravel()))
+    arr = 1. - arr  # somehow the values got flipped
 
-	if options.exist('basemap'):
-		# create coordinate grid in map projection units (for plotting)
-		lat,lon=xy2ll(xlim,ylim,-1,0,71)
-                #plt.sca(ax)
-                width=xmax-xmin
-                height=ymax-ymin
-                lat_0,lon_0=xy2ll(xmin+width/2.,ymin+height/2.,-1,0,71)
-	        m=Basemap(projection='spstere',
-                        llcrnrlon=lon[0],llcrnrlat=lat[0],urcrnrlon=lon[1],urcrnrlat=lat[1],
-                        epsg=3031,
-                        resolution='c')
-                        #width=width,height=height,lon_0=lon_0,lat_0=lat_0,
-                        #lat_0=-90,lon_0=0,lat_ts=-71,
-                        #llcrnrx=x0,llcrnry=y0,urcrnrx=x1,urcrnry=y1)
-                #test
-                #m.ax=ax
-	        meridians=np.arange(-180.,181.,1.)
-	        parallels=np.arange(-80.,80.,1.)
-	        m.drawparallels(parallels,labels=[0,0,1,1]) # labels=[left,right,top,bottom]
-	        m.drawmeridians(meridians,labels=[1,1,0,0])
-                m.drawcoastlines()
-	        pc=m.pcolormesh(xg, yg, np.flipud(arr), cmap=mpl.cm.Greys, norm=norm, ax=ax)
+    if options.getfieldvalue('overlayhist', 0) == 1:
+        ax = plt.gca()
+        num = 2
+        while True:
+            if not plt.fignum_exists(num):
+                break
+            else:
+                num += 1
+        plt.figure(num)
+        plt.hist(arr.flatten(), bins=256, range=(0., 1.))
+        plt.title('histogram of overlay image, use for setting overlaylims')
+        plt.show()
+        plt.sca(ax)  # return to original axes / figure
 
-	else:
-	        pc=ax.pcolormesh(xg, yg, np.flipud(arr), cmap=mpl.cm.Greys, norm=norm)
-        
-	#rasterization? 
-	if options.getfieldvalue('rasterized',0):
-		pc.set_rasterized(True)
+    # get parameters from cropped geotiff
+    trans = gtif.GetGeoTransform()
+    xmin = trans[0]
+    xmax = trans[0] + gtif.RasterXSize * trans[1]
+    ymin = trans[3] + gtif.RasterYSize * trans[5]
+    ymax = trans[3]
+    dx = trans[1]
+    dy = trans[5]
+
+    xarr = np.arange(xmin, xmax, dx)
+    yarr = np.arange(ymin, ymax, -dy)  # - dy since origin = 'upper' (not sure how robust this is)
+    xg, yg = np.meshgrid(xarr, yarr)
+    overlaylims = options.getfieldvalue('overlaylims', [min(arr.ravel()), max(arr.ravel())])
+    norm = mpl.colors.Normalize(vmin=overlaylims[0], vmax=overlaylims[1])
+
+    pc = ax.pcolormesh(xg, yg, np.flipud(arr), cmap=mpl.cm.Greys, norm=norm)
+
+    if options.exist('basemap'):
+        # create coordinate grid in map projection units (for plotting)
+        if md.mesh.epsg == 3413:
+            hemisphere = 1
+            st_lat = 70
+            lon_0 = 45
+        elif md.mesh.epsg == 3031:
+            hemisphere = -1
+            st_lat = 71
+            lon_0 = 0
+        else:
+            hemisphere = eval(input('epsg code {} is not supported chose your hemisphere (1 for North, -1 for south)'.format(md.mesh.epsg)))
+
+        lat, lon = xy2ll(xlim, ylim, hemisphere, lon_0, st_lat)
+        extent = [np.diff(xlim)[0], np.diff(ylim)[0]]
+        center = [lon[0] + np.diff(lon)[0] * 0.5, lat[0] + np.diff(lat)[0] * 0.5]
+        m = Basemap(llcrnrlon=lon[0], llcrnrlat=lat[0], urcrnrlon=lon[1], urcrnrlat=lat[1],
+                    lon_0=center[0], lat_0=center[1], width=extent[0], height=extent[1],
+                    epsg=md.mesh.epsg, anchor='NW',
+                    resolution='i', ax=ax)
+
+        meridians = np.arange(np.floor(lon[0]), np.ceil(lon[1]), 1.)
+        parallels = np.arange(np.floor(lat[0]), np.ceil(lat[1]), 1.)
+        m.drawparallels(parallels, labels=[1, 0, 0, 0], ax=ax)  # labels = [left, right, top, bottom]
+        m.drawmeridians(meridians, labels=[0, 0, 1, 0], ax=ax)
+        m.drawcoastlines(ax=ax)
+        m.drawmapboundary(ax=ax)
+
+    #rasterization?
+    if options.getfieldvalue('rasterized', 0):
+        pc.set_rasterized(True)
Index: /issm/trunk/src/m/plot/plot_quiver.py
===================================================================
--- /issm/trunk/src/m/plot/plot_quiver.py	(revision 24312)
+++ /issm/trunk/src/m/plot/plot_quiver.py	(revision 24313)
@@ -1,42 +1,43 @@
-import numpy as  np
+import numpy as np
 
-def plot_quiver(x,y,data,options,ax):
-	vx=data[:,0]
-	vy=data[:,1]
-	Xdist=max(x)-min(x)
-	Ydist=max(y)-min(y)
-	datanorm=np.sqrt(vx**2+vy**2)
-	scaler=max(datanorm)/(np.sqrt(Xdist*Ydist/len(x)))
 
-	#define colors, unicolor or value codded
-	color=options.getfieldvalue('quivercol','k')
-	if color=='values':
-		color=datanorm
-	#scaling of arrow length (giving info to change as it seems that there is no better way to work arround it)
-	scale=options.getfieldvalue('scaling',scaler)
-	print('the current value for "scaling" is {}, increase it to shorten the arrows'.format(scale))
-	#sizing of the arrows
-	width=options.getfieldvalue('width',5.0e-3)
-	headwidth=options.getfieldvalue('headwidth',6)
-	headlength=options.getfieldvalue('headlength',headwidth)
-	#set the unit to the smaller of the two axes
-	if Xdist>Ydist:
-		units='height'
-	else:
-		units='width'
-		
-	if type(color)==str:
-		Q=ax.quiver(x,y,vx,vy,color=color,
-								scale=scale,scale_units='xy',
-								units=units,headwidth=headwidth,headlength=headlength,width=width,
-								angles='xy')
-	else:
-		if options.exist('colornorm'):
-			norm=options.getfieldvalue('colornorm')
-		if options.exist('colormap'):
-			cmap=options.getfieldvalue('colormap')		
-		Q=ax.quiver(x,y,vx,vy,color,cmap=cmap,norm=norm,
-								scale=scale,scale_units='xy',
-								units=units,headwidth=headwidth,headlength=headlength,width=width,
-								angles='xy')
-	return Q
+def plot_quiver(x, y, data, options, ax):
+    vx = data[:, 0]
+    vy = data[:, 1]
+    Xdist = max(x) - min(x)
+    Ydist = max(y) - min(y)
+    datanorm = np.sqrt(vx**2 + vy**2)
+    scaler = max(datanorm) / (np.sqrt(Xdist * Ydist / len(x)))
+
+    #define colors, unicolor or value codded
+    color = options.getfieldvalue('quivercol', 'k')
+    if color == 'values':
+        color = datanorm
+    #scaling of arrow length (giving info to change as it seems that there is no better way to work arround it)
+    scale = options.getfieldvalue('scaling', scaler)
+    print(('the current value for "scaling" is {}, increase it to shorten the arrows'.format(scale)))
+    #sizing of the arrows
+    width = options.getfieldvalue('width', 5.0e-3)
+    headwidth = options.getfieldvalue('headwidth', 6)
+    headlength = options.getfieldvalue('headlength', headwidth)
+    #set the unit to the smaller of the two axes
+    if Xdist > Ydist:
+        units = 'height'
+    else:
+        units = 'width'
+
+    if type(color) == str:
+        Q = ax.quiver(x, y, vx, vy, color=color,
+                      scale=scale, scale_units='xy',
+                      units=units, headwidth=headwidth, headlength=headlength, width=width,
+                      angles='xy')
+    else:
+        if options.exist('colornorm'):
+            norm = options.getfieldvalue('colornorm')
+        if options.exist('colormap'):
+            cmap = options.getfieldvalue('colormap')
+        Q = ax.quiver(x, y, vx, vy, color, cmap=cmap, norm=norm,
+                      scale=scale, scale_units='xy',
+                      units=units, headwidth=headwidth, headlength=headlength, width=width,
+                      angles='xy')
+    return Q
Index: /issm/trunk/src/m/plot/plot_streamlines.py
===================================================================
--- /issm/trunk/src/m/plot/plot_streamlines.py	(revision 24312)
+++ /issm/trunk/src/m/plot/plot_streamlines.py	(revision 24313)
@@ -1,21 +1,20 @@
-import numpy as  np
+import numpy as np
 from processmesh import processmesh
 from processdata import processdata
-from ContourToMesh import ContourToMesh
 try:
-	import matplotlib.pyplot as plt
-	import matplotlib.tri as tri
-	from scipy.interpolate import griddata
+    import matplotlib.tri as tri
+    from scipy.interpolate import griddata
 except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
+    print("could not import pylab, matplotlib has not been installed, no plotting capabilities enabled")
 
-def plot_streamlines(md,options,ax):
+
+def plot_streamlines(md, options, ax):
     '''
-    plot streamlines on a figure, using by default vx and vy components in md.initialization. 
+    plot streamlines on a figure, using by default vx and vy components in md.initialization.
 
     Usage:
-        plot_streamlines(md,options,ax)
+        plot_streamlines(md, options, ax)
 
-    available options, to be passed to plotmodel as a string-value pair:
+    available options, to be passed to plotmodel as a string - value pair:
         streamlinesvx : vx component (default md.initialization.vx)
         streamlinesvy : vy component (default md.initialization.vy)
@@ -25,43 +24,43 @@
         streamlineswidthscale: scaling multiplier for linewidth scaled by velocity
         streamlinesarrowsize: size of arrows on lines (default 1)
-        
+
     '''
 
     # retrieve options
-    vx=options.getfieldvalue('streamlinesvx',md.initialization.vx)
-    vy=options.getfieldvalue('streamlinesvy',md.initialization.vy)
-    color=options.getfieldvalue('streamlinescolor','k')
-    linewidth=options.getfieldvalue('streamlineswidth',1)
-    density=options.getfieldvalue('streamlinesdensity',1)
-    arrowsize=options.getfieldvalue('streamlinesarrowsize',1)
+    vx = options.getfieldvalue('streamlinesvx', md.initialization.vx)
+    vy = options.getfieldvalue('streamlinesvy', md.initialization.vy)
+    color = options.getfieldvalue('streamlinescolor', 'k')
+    linewidth = options.getfieldvalue('streamlineswidth', 1)
+    density = options.getfieldvalue('streamlinesdensity', 1)
+    arrowsize = options.getfieldvalue('streamlinesarrowsize', 1)
 
-    #process mesh and data 
-    x,y,z,elements,is2d,isplanet=processmesh(md,vx,options)
-    u,datatype=processdata(md,vx,options)
-    v,datatype=processdata(md,vy,options)
+    #process mesh and data
+    x, y, z, elements, is2d, isplanet = processmesh(md, vx, options)
+    u, datatype = processdata(md, vx, options)
+    v, datatype = processdata(md, vy, options)
 
     if not is2d:
-        raise StandardError('plot_streamlines error: streamlines option not supported for 3D plots')
+        raise Exception('plot_streamlines error: streamlines option not supported for 3D plots')
 
     # format data for matplotlib streamplot function
-    yg,xg=np.mgrid[min(md.mesh.y):max(md.mesh.y):100j,min(md.mesh.x):max(md.mesh.x):100j]
-    ug=griddata((x,y),u,(xg,yg),method='linear')
-    vg=griddata((x,y),v,(xg,yg),method='linear')
+    yg, xg = np.mgrid[min(md.mesh.y):max(md.mesh.y):100j, min(md.mesh.x):max(md.mesh.x):100j]
+    ug = griddata((x, y), u, (xg, yg), method='linear')
+    vg = griddata((x, y), v, (xg, yg), method='linear')
 
     # create triangulation instance
-    triang=tri.Triangulation(md.mesh.x,md.mesh.y,md.mesh.elements-1)
+    triang = tri.Triangulation(md.mesh.x, md.mesh.y, md.mesh.elements - 1)
 
     # interpolate to regularly spaced quad grid
-    interp_lin_u=tri.LinearTriInterpolator(triang,u)
-    interp_lin_v=tri.LinearTriInterpolator(triang,v)
-    ug=interp_lin_u(xg,yg)
-    vg=interp_lin_v(xg,yg)
+    interp_lin_u = tri.LinearTriInterpolator(triang, u)
+    interp_lin_v = tri.LinearTriInterpolator(triang, v)
+    ug = interp_lin_u(xg, yg)
+    vg = interp_lin_v(xg, yg)
 
-    if linewidth=='vel':
-        scale=options.getfieldvalue('streamlineswidthscale',3)
-        vel=np.sqrt(ug**2+vg**2)
-        linewidth=scale*vel/np.amax(vel)
-        linewidth[linewidth<0.5]=0.5
+    if linewidth == 'vel':
+        scale = options.getfieldvalue('streamlineswidthscale', 3)
+        vel = np.sqrt(ug**2 + vg**2)
+        linewidth = scale * vel / np.amax(vel)
+        linewidth[linewidth < 0.5] = 0.5
 
     # plot streamlines
-    ax.streamplot(xg,yg,ug,vg,color=color,linewidth=linewidth,density=density,arrowsize=arrowsize)
+    ax.streamplot(xg, yg, ug, vg, color=color, linewidth=linewidth, density=density, arrowsize=arrowsize)
Index: /issm/trunk/src/m/plot/plot_transient_movie.m
===================================================================
--- /issm/trunk/src/m/plot/plot_transient_movie.m	(revision 24312)
+++ /issm/trunk/src/m/plot/plot_transient_movie.m	(revision 24313)
@@ -62,5 +62,5 @@
 
 			clf;
-			titlestring=[field ' at time ' num2str(results(i).time) ' year'];
+			titlestring=[field ' at time ' num2str(results(i).time,'%7.2f') ' year'];
 			plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
 			apply_options_movie(md,options,titlestring);
Index: /issm/trunk/src/m/plot/plot_unit.py
===================================================================
--- /issm/trunk/src/m/plot/plot_unit.py	(revision 24312)
+++ /issm/trunk/src/m/plot/plot_unit.py	(revision 24313)
@@ -1,225 +1,238 @@
-from cmaptools import truncate_colormap
+from cmaptools import getcolormap, truncate_colormap
 from plot_quiver import plot_quiver
-from scipy.interpolate import griddata
-import numpy as  np
+import numpy as np
 try:
-	import matplotlib as mpl
-	import matplotlib.pyplot as plt
-	from mpl_toolkits.axes_grid1 import inset_locator
-	from mpl_toolkits.mplot3d import Axes3D
-	from mpl_toolkits.mplot3d.art3d import Poly3DCollection
+    import matplotlib as mpl
+    import matplotlib.pyplot as plt
+    from mpl_toolkits.axes_grid1 import inset_locator
+    from mpl_toolkits.mplot3d import Axes3D
+    from mpl_toolkits.mplot3d.art3d import Poly3DCollection
 except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
-	
-def plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options,fig,axgrid,gridindex):
-	"""
-	PLOT_UNIT - unit plot, display data
-	
-	Usage:
-	plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
-
-	See also: PLOTMODEL, PLOT_MANAGER
-	"""
-	#if we are plotting 3d replace the current axis
-	if not is2d:
-		axgrid[gridindex].axis('off')
-		ax=inset_locator.inset_axes(axgrid[gridindex],width='100%',height='100%',loc=3,borderpad=0,axes_class=Axes3D)
-		ax.set_axis_bgcolor((0.7,0.7,0.7))
-	else:
-		ax=axgrid[gridindex]
-
-	#edgecolor
-	edgecolor=options.getfieldvalue('edgecolor','None')
-
-	# colormap
-	# {{{ give number of colorlevels and transparency
-	colorlevels=options.getfieldvalue('colorlevels',128)
-	alpha=options.getfieldvalue('alpha',1)
-	# }}}
-	# {{{ define wich colormap to use 
-	try:
-		defaultmap=plt.cm.get_cmap('viridis',colorlevels)
-	except AttributeError:
-		print("Viridis can't be found (probably too old Matplotlib) reverting to gnuplot colormap")
-		defaultmap=truncate_colormap('gnuplot2',0.1,0.9,colorlevels)
-	cmap=options.getfieldvalue('colormap',defaultmap)
-	if options.exist('cmap_set_over'):
-		over=options.getfieldvalue('cmap_set_over','0.5')
-		cmap.set_over(over)
-	if options.exist('cmap_set_under'):
-		under=options.getfieldvalue('cmap_set_under','0.5')
-		cmap.set_under(under)
-	options.addfield('colormap',cmap)
-	# }}}	
-	# {{{ if plotting only one of several layers reduce dataset, same for surface
-	if options.getfieldvalue('layer',0)>=1:
-		plotlayer=options.getfieldvalue('layer',0)
-		if datatype==1:
-			slicesize=np.shape(elements)[0]
-		elif datatype in [2,3]:
-			slicesize=len(x)
-		data=data[(plotlayer-1)*slicesize:plotlayer*slicesize]
-	# }}}
-	# {{{ Get the colormap limits
-	if options.exist('clim'):
-		lims=options.getfieldvalue('clim',[np.amin(data),np.amax(data)])
-	elif options.exist('caxis'):
-		lims=options.getfieldvalue('caxis',[np.amin(data),np.amax(data)])
-	else:
-		if np.amin(data)==np.amax(data):
-			lims=[np.amin(data)-0.5,np.amax(data)+0.5]
-		else:
-			lims=[np.amin(data),np.amax(data)]
-	# }}}
-	# {{{ Set the spread of the colormap (default is normal
-	if options.exist('log'):
-		norm = mpl.colors.LogNorm(vmin=lims[0], vmax=lims[1])
-	else:
-		norm = mpl.colors.Normalize(vmin=lims[0], vmax=lims[1])
-	if options.exist('log'):
-		norm = mpl.colors.LogNorm(vmin=lims[0], vmax=lims[1])
-	else:
-		norm = mpl.colors.Normalize(vmin=lims[0], vmax=lims[1])
-	options.addfield('colornorm',norm)
-	# }}}
-	
-	# Plot depending on the datatype
-	# {{{ data are on elements
-	if datatype==1:
-		if is2d:
-			if options.exist('mask'):
-				triangles=mpl.tri.Triangulation(x,y,elements,data.mask)
-			else:
-				triangles=mpl.tri.Triangulation(x,y,elements)
-			tri=ax.tripcolor(triangles,data,colorlevels,cmap=cmap,norm=norm,alpha=alpha,edgecolors=edgecolor)
-		else:
-			#first deal with colormap
-			loccmap = plt.cm.ScalarMappable(cmap=cmap)
-			loccmap.set_array([min(data),max(data)])
-			loccmap.set_clim(vmin=min(data),vmax=max(data))
-
-			#dealing with prism sides
-			recface=np.vstack((elements[:,0],elements[:,1],elements[:,4],elements[:,3])).T
-			eltind=np.arange(0,np.shape(elements)[0])
-			recface=np.vstack((recface,np.vstack((elements[:,1],elements[:,2],elements[:,5],elements[:,4])).T))
-			eltind=np.hstack((eltind,np.arange(0,np.shape(elements)[0])))
-			recface=np.vstack((recface,np.vstack((elements[:,2],elements[:,0],elements[:,3],elements[:,5])).T))
-			eltind=np.hstack((eltind,np.arange(0,np.shape(elements)[0])))
-			tmp = np.ascontiguousarray(np.sort(recface)).view(np.dtype((np.void, recface.dtype.itemsize * recface.shape[1])))
-			_, idx, recur = np.unique(tmp, return_index=True, return_counts=True)
-			recel= recface[idx[np.where(recur==1)]]
-			recindex=eltind[idx[np.where(recur==1)]]
-			for i,rectangle in enumerate(recel):
-				rec=zip(x[rectangle],y[rectangle],z[rectangle])
-				pl3=Poly3DCollection([rec])
-				color=loccmap.to_rgba(data[recindex[i]])
-				pl3.set_edgecolor(color)
-				pl3.set_color(color)
-				ax.add_collection3d(pl3)
-
-			#dealing with prism bases
-			triface=np.vstack((elements[:,0:3],elements[:,3:6]))
-			eltind=np.arange(0,np.shape(elements)[0])
-			eltind=np.hstack((eltind,np.arange(0,np.shape(elements)[0])))
-			tmp = np.ascontiguousarray(triface).view(np.dtype((np.void, triface.dtype.itemsize * triface.shape[1])))
-			_, idx,recur = np.unique(tmp, return_index=True,return_counts=True)
-			#we keep only top and bottom elements
-			triel= triface[idx[np.where(recur==1)]]
-			triindex=eltind[idx[np.where(recur==1)]]
-			for i,triangle in enumerate(triel):
-				tri=zip(x[triangle],y[triangle],z[triangle])
-				pl3=Poly3DCollection([tri])
-				color=loccmap.to_rgba(data[triindex[i]])
-				pl3.set_edgecolor(color)
-				pl3.set_color(color)
-				ax.add_collection3d(pl3)
-	
-			ax.set_xlim([min(x),max(x)])
-			ax.set_ylim([min(y),max(y)])
-			ax.set_zlim([min(z),max(z)])
-
-			#raise ValueError('plot_unit error: 3D element plot not supported yet')
-		return 
-	# }}}
-	# {{{ data are on nodes
-	elif datatype==2:
-		if is2d:
-			if np.ma.is_masked(data):
-				EltMask=np.asarray([np.any(np.in1d(index,np.where(data.mask))) for index in elements])
-				triangles=mpl.tri.Triangulation(x,y,elements,EltMask)
-			else:
-				triangles=mpl.tri.Triangulation(x,y,elements)
-				#tri=ax.tricontourf(triangles,data,colorlevels,cmap=cmap,norm=norm,alpha=alpha)
-			if options.exist('log'):
-				tri=ax.tricontourf(triangles,data,colorlevels,cmap=cmap,norm=norm,alpha=alpha)
-			else:
-				tri=ax.tricontourf(triangles,data,colorlevels,cmap=cmap,norm=norm,alpha=alpha,extend='both')
-			if edgecolor != 'None':
-				ax.triplot(x,y,elements,color=edgecolor)
-		else:
-			#first deal with the colormap
-			loccmap = plt.cm.ScalarMappable(cmap=cmap)
-			loccmap.set_array([min(data),max(data)])
-			loccmap.set_clim(vmin=min(data),vmax=max(data))
-			
-			#deal with prism sides
-			recface=np.vstack((elements[:,0],elements[:,1],elements[:,4],elements[:,3])).T
-			recface=np.vstack((recface,np.vstack((elements[:,1],elements[:,2],elements[:,5],elements[:,4])).T))
-			recface=np.vstack((recface,np.vstack((elements[:,2],elements[:,0],elements[:,3],elements[:,5])).T))
-			tmp = np.ascontiguousarray(np.sort(recface)).view(np.dtype((np.void, recface.dtype.itemsize * recface.shape[1])))
-			_, idx, recur = np.unique(tmp, return_index=True, return_counts=True)
-			recel= recface[idx[np.where(recur==1)]]
-			for rectangle in recel:
-				rec=zip(x[rectangle],y[rectangle],z[rectangle])
-				pl3=Poly3DCollection([rec])
-				color=loccmap.to_rgba(np.mean(data[rectangle]))
-				pl3.set_edgecolor(color)
-				pl3.set_color(color)
-				ax.add_collection3d(pl3)
-				
-			#deal with prism faces
-			triface=np.vstack((elements[:,0:3],elements[:,3:6]))
-			tmp = np.ascontiguousarray(triface).view(np.dtype((np.void, triface.dtype.itemsize * triface.shape[1])))
-			_, idx,recur = np.unique(tmp, return_index=True,return_counts=True)
-			#we keep only top and bottom elements
-			triel= triface[idx[np.where(recur==1)]]
-			for triangle in triel:
-				tri=zip(x[triangle],y[triangle],z[triangle])
-				pl3=Poly3DCollection([tri])
-				color=loccmap.to_rgba(np.mean(data[triangle]))
-				pl3.set_edgecolor(color)
-				pl3.set_color(color)
-				ax.add_collection3d(pl3)
-				
-			ax.set_xlim([min(x),max(x)])
-			ax.set_ylim([min(y),max(y)])
-			ax.set_zlim([min(z),max(z)])
-			#raise ValueError('plot_unit error: 3D element plot not supported yet')
-		return
-	# }}}
-	# {{{ plotting quiver
-	elif datatype==3:
-		if is2d:
-			Q=plot_quiver(x,y,data,options,ax)
-		else:
-			raise ValueError('plot_unit error: 3D node plot not supported yet')
-		return
-	
-	# }}}
-	# {{{ plotting P1 Patch (TODO)
-
-	elif datatype==4:
-		print 'plot_unit message: P1 patch plot not implemented yet'
-		return
-
-	# }}}
-	# {{{ plotting P0 Patch (TODO)
-
-	elif datatype==5:
-		print 'plot_unit message: P0 patch plot not implemented yet'
-		return
-
-	# }}}
-	else:
-		raise ValueError('datatype=%d not supported' % datatype)
-    
+    print("could not import pylab, matplotlib has not been installed, no plotting capabilities enabled")
+
+
+def plot_unit(x, y, z, elements, data, is2d, isplanet, datatype, options, fig, axgrid, gridindex):
+    """
+    PLOT_UNIT - unit plot, display data
+
+    Usage:
+    plot_unit(x, y, z, elements, data, is2d, isplanet, datatype, options)
+
+    See also: PLOTMODEL, PLOT_MANAGER
+    """
+    #if we are plotting 3d replace the current axis
+    if not is2d:
+        axgrid[gridindex].axis('off')
+        ax = inset_locator.inset_axes(axgrid[gridindex], width='100%', height='100%', loc=3, borderpad=0, axes_class=Axes3D)
+    else:
+        ax = axgrid[gridindex]
+
+    #edgecolor
+    edgecolor = options.getfieldvalue('edgecolor', 'None')
+
+    # colormap
+    # {{{ give number of colorlevels and transparency
+    colorlevels = options.getfieldvalue('colorlevels', 128)
+    alpha = options.getfieldvalue('alpha', 1)
+    if alpha < 1:
+        antialiased = True
+    else:
+        antialiased = False
+    # }}}
+    # {{{ define wich colormap to use
+    try:
+        defaultmap = plt.cm.get_cmap('viridis', colorlevels)
+    except AttributeError:
+        print("Viridis can't be found (probably too old Matplotlib) reverting to gnuplot colormap")
+        defaultmap = truncate_colormap('gnuplot2', 0.1, 0.9, colorlevels)
+    if not options.exist('colormap'):
+        cmap = defaultmap
+    else:
+        cmap = getcolormap(options)
+    if options.exist('cmap_set_over'):
+        over = options.getfieldvalue('cmap_set_over', '0.5')
+        cmap.set_over(over)
+    if options.exist('cmap_set_under'):
+        under = options.getfieldvalue('cmap_set_under', '0.5')
+        cmap.set_under(under)
+    options.addfield('colormap', cmap)
+    # }}}
+    # {{{ if plotting only one of several layers reduce dataset, same for surface
+    if options.getfieldvalue('layer', 0) >= 1:
+        plotlayer = options.getfieldvalue('layer', 0)
+        if datatype == 1:
+            slicesize = np.shape(elements)[0]
+        elif datatype in [2, 3]:
+            slicesize = len(x)
+        data = data[(plotlayer - 1) * slicesize:plotlayer * slicesize]
+    # }}}
+    # {{{ Get the colormap limits
+    if options.exist('clim'):
+        lims = options.getfieldvalue('clim', [np.amin(data), np.amax(data)])
+    elif options.exist('caxis'):
+        lims = options.getfieldvalue('caxis', [np.amin(data), np.amax(data)])
+    else:
+        if np.amin(data) == np.amax(data):
+            lims = [np.amin(data) * 0.9, np.amax(data) * 1.1]
+        else:
+            lims = [np.amin(data), np.amax(data)]
+    # }}}
+    # {{{ Set the spread of the colormap (default is normal
+    if options.exist('log'):
+        norm = mpl.colors.LogNorm(vmin=lims[0], vmax=lims[1])
+    else:
+        norm = mpl.colors.Normalize(vmin=lims[0], vmax=lims[1])
+    if options.exist('log'):
+        norm = mpl.colors.LogNorm(vmin=lims[0], vmax=lims[1])
+    else:
+        norm = mpl.colors.Normalize(vmin=lims[0], vmax=lims[1])
+    options.addfield('colornorm', norm)
+    # }}}
+
+    # Plot depending on the datatype
+    # {{{ data are on elements
+
+    if datatype == 1:
+        if is2d:
+            if options.exist('mask'):
+                triangles = mpl.tri.Triangulation(x, y, elements, data.mask)
+            else:
+                triangles = mpl.tri.Triangulation(x, y, elements)
+            tri = ax.tripcolor(triangles, data, colorlevels, cmap=cmap, norm=norm, alpha=alpha, edgecolors=edgecolor)
+        else:
+            #first deal with colormap
+            loccmap = plt.cm.ScalarMappable(cmap=cmap)
+            loccmap.set_array([np.nanmin(data), np.nanmax(data)])
+            loccmap.set_clim(vmin=np.nanmin(data), vmax=np.nanmax(data))
+
+    #dealing with prism sides
+            recface = np.vstack((elements[:, 0], elements[:, 1], elements[:, 4], elements[:, 3])).T
+            eltind = np.arange(0, np.shape(elements)[0])
+            recface = np.vstack((recface, np.vstack((elements[:, 1], elements[:, 2], elements[:, 5], elements[:, 4])).T))
+            eltind = np.hstack((eltind, np.arange(0, np.shape(elements)[0])))
+            recface = np.vstack((recface, np.vstack((elements[:, 2], elements[:, 0], elements[:, 3], elements[:, 5])).T))
+            eltind = np.hstack((eltind, np.arange(0, np.shape(elements)[0])))
+            tmp = np.ascontiguousarray(np.sort(recface)).view(np.dtype((np.void, recface.dtype.itemsize * recface.shape[1])))
+            _, idx, recur = np.unique(tmp, return_index=True, return_counts=True)
+            recel = recface[idx[np.where(recur == 1)]]
+            recindex = eltind[idx[np.where(recur == 1)]]
+            for i, rectangle in enumerate(recel):
+                rec = list(zip(x[rectangle], y[rectangle], z[rectangle]))
+                pl3 = Poly3DCollection([rec])
+                color = loccmap.to_rgba(data[recindex[i]])
+                pl3.set_edgecolor(color)
+                pl3.set_color(color)
+                ax.add_collection3d(pl3)
+
+    #dealing with prism bases
+            triface = np.vstack((elements[:, 0:3], elements[:, 3:6]))
+            eltind = np.arange(0, np.shape(elements)[0])
+            eltind = np.hstack((eltind, np.arange(0, np.shape(elements)[0])))
+            tmp = np.ascontiguousarray(triface).view(np.dtype((np.void, triface.dtype.itemsize * triface.shape[1])))
+            _, idx, recur = np.unique(tmp, return_index=True, return_counts=True)
+    #we keep only top and bottom elements
+            triel = triface[idx[np.where(recur == 1)]]
+            triindex = eltind[idx[np.where(recur == 1)]]
+            for i, triangle in enumerate(triel):
+                tri = list(zip(x[triangle], y[triangle], z[triangle]))
+                pl3 = Poly3DCollection([tri])
+                color = loccmap.to_rgba(data[triindex[i]])
+                pl3.set_edgecolor(color)
+                pl3.set_color(color)
+                ax.add_collection3d(pl3)
+
+            ax.set_xlim([min(x), max(x)])
+            ax.set_ylim([min(y), max(y)])
+            ax.set_zlim([min(z), max(z)])
+
+    #raise ValueError('plot_unit error: 3D element plot not supported yet')
+        return
+
+    # }}}
+    # {{{ data are on nodes
+
+    elif datatype == 2:
+        if is2d:
+            if np.ma.is_masked(data):
+                EltMask = np.asarray([np.any(np.in1d(index, np.where(data.mask))) for index in elements])
+                triangles = mpl.tri.Triangulation(x, y, elements, EltMask)
+            else:
+                triangles = mpl.tri.Triangulation(x, y, elements)
+    #tri = ax.tricontourf(triangles, data, colorlevels, cmap = cmap, norm=norm, alpha = alpha)
+            if options.exist('log'):
+                if alpha < 1:  #help with antialiasing
+                    tri = ax.tricontour(triangles, data, colorlevels, cmap=cmap, norm=norm, alpha=0.1, antialiased=antialiased)
+                tri = ax.tricontourf(triangles, data, colorlevels, cmap=cmap, norm=norm, alpha=alpha, antialiased=antialiased)
+            else:
+                if alpha < 1:  #help with antialiasing
+                    tri = ax.tricontour(triangles, data, colorlevels, cmap=cmap, norm=norm, alpha=0.1, antialiased=antialiased)
+                tri = ax.tricontourf(triangles, data, colorlevels, cmap=cmap, norm=norm, alpha=alpha, extend='both', antialiased=antialiased)
+            if edgecolor != 'None':
+                ax.triplot(x, y, elements, color=edgecolor)
+        else:
+            #first deal with the colormap
+            loccmap = plt.cm.ScalarMappable(cmap=cmap)
+            loccmap.set_array([np.nanmin(data), np.nanmax(data)])
+            loccmap.set_clim(vmin=np.nanmin(data), vmax=np.nanmax(data))
+
+    #deal with prism sides
+            recface = np.vstack((elements[:, 0], elements[:, 1], elements[:, 4], elements[:, 3])).T
+            recface = np.vstack((recface, np.vstack((elements[:, 1], elements[:, 2], elements[:, 5], elements[:, 4])).T))
+            recface = np.vstack((recface, np.vstack((elements[:, 2], elements[:, 0], elements[:, 3], elements[:, 5])).T))
+            tmp = np.ascontiguousarray(np.sort(recface)).view(np.dtype((np.void, recface.dtype.itemsize * recface.shape[1])))
+            _, idx, recur = np.unique(tmp, return_index=True, return_counts=True)
+            recel = recface[idx[np.where(recur == 1)]]
+            for rectangle in recel:
+                rec = list(zip(x[rectangle], y[rectangle], z[rectangle]))
+                pl3 = Poly3DCollection([rec])
+                color = loccmap.to_rgba(np.mean(data[rectangle]))
+                pl3.set_edgecolor(color)
+                pl3.set_color(color)
+                ax.add_collection3d(pl3)
+
+    #deal with prism faces
+            triface = np.vstack((elements[:, 0:3], elements[:, 3:6]))
+            tmp = np.ascontiguousarray(triface).view(np.dtype((np.void, triface.dtype.itemsize * triface.shape[1])))
+            _, idx, recur = np.unique(tmp, return_index=True, return_counts=True)
+    #we keep only top and bottom elements
+            triel = triface[idx[np.where(recur == 1)]]
+            for triangle in triel:
+                tri = list(zip(x[triangle], y[triangle], z[triangle]))
+                pl3 = Poly3DCollection([tri])
+                color = loccmap.to_rgba(np.mean(data[triangle]))
+                pl3.set_edgecolor(color)
+                pl3.set_color(color)
+                ax.add_collection3d(pl3)
+
+            ax.set_xlim([min(x), max(x)])
+            ax.set_ylim([min(y), max(y)])
+            ax.set_zlim([min(z), max(z)])
+    #raise ValueError('plot_unit error: 3D element plot not supported yet')
+        return
+
+    # }}}
+    # {{{ plotting quiver
+    elif datatype == 3:
+        if is2d:
+            Q = plot_quiver(x, y, data, options, ax)
+        else:
+            raise ValueError('plot_unit error: 3D node plot not supported yet')
+        return
+
+    # }}}
+    # {{{ plotting P1 Patch (TODO)
+
+    elif datatype == 4:
+        print('plot_unit message: P1 patch plot not implemented yet')
+        return
+
+    # }}}
+    # {{{ plotting P0 Patch (TODO)
+
+    elif datatype == 5:
+        print('plot_unit message: P0 patch plot not implemented yet')
+        return
+
+    # }}}
+    else:
+        raise ValueError('datatype = %d not supported' % datatype)
Index: /issm/trunk/src/m/plot/plot_vertexnumbering.py
===================================================================
--- /issm/trunk/src/m/plot/plot_vertexnumbering.py	(revision 24312)
+++ /issm/trunk/src/m/plot/plot_vertexnumbering.py	(revision 24313)
@@ -1,58 +1,53 @@
-try:
-	import pylab as p
-except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
-
-import numpy as  np
+import numpy as np
 from processmesh import processmesh
 from applyoptions import applyoptions
-from plot_icefront import plot_icefront
 
-def plot_vertexnumbering(md,options,fig,axgrid,gridindex):
-	'''
-	PLOT_VERTEXNUMBERING - plot vertex numbering
-	
-	Usage:
-	plot_vertexnumbering(md,options,fig,axes);
-	
- 	See also: PLOTMODEL
-	
-	'''
-	#process data and model
-	x,y,z,elements,is2d,isplanet=processmesh(md,[],options)
 
-	ax=axgrid[gridindex]
-	fig.delaxes(axgrid.cbar_axes[gridindex])
-	
-	if is2d:
-		ax.triplot(x,y,elements)
-	else:
-		print 'Not Implemented Yet'
+def plot_vertexnumbering(md, options, fig, axgrid, gridindex):
+    '''
+    PLOT_VERTEXNUMBERING - plot vertex numbering
 
-	XPad=0.1*(np.max(x)-np.min(x))
-	YPad=0.1*(np.max(y)-np.min(y))
-	#plot mesh
-	ax.triplot(x,y,elements)
-	ax.set_xlim((np.min(x)-XPad,np.max(x)+XPad))
-	ax.set_ylim((np.min(y)-XPad,np.max(y)+XPad))
+    Usage:
+    plot_vertexnumbering(md, options, fig, axes)
 
-	highlightpos=options.getfieldvalue('highlight',[])
-	if highlightpos!='none':
-		#if just one element duplicate it to avoid coloring issues
-		if type(highlightpos)==int:
-			highlightpos=[highlightpos,highlightpos]
-		#convert from to matlab numbering
-		highlightpos=[pos-1 for pos in highlightpos]
+     See also: PLOTMODEL
 
-	# and numbers
-	for i,Xcoord in enumerate(x):
-		if i in highlightpos:
-			props = dict(boxstyle='circle', pad=0.1,color='r')
-		else:
-			props = dict(boxstyle='circle', pad=0.1,color='w')
-		ax.text(x[i],y[i],str(i+1),ha='center',va='center',backgroundcolor='w',clip_on=True,bbox=props)	
-		
-	#apply options
-	options.addfielddefault('title','Vertex numbers (matlab indexation)')
-	options.addfielddefault('colorbar','off')
-	applyoptions(md,[],options,fig,axgrid,gridindex)
+    '''
+    #process data and model
+    x, y, z, elements, is2d, isplanet = processmesh(md, [], options)
+
+    ax = axgrid[gridindex]
+    fig.delaxes(axgrid.cbar_axes[gridindex])
+
+    if is2d:
+        ax.triplot(x, y, elements)
+    else:
+        print('Not Implemented Yet')
+
+    XPad = 0.1 * (np.nanmax(x) - np.nanmin(x))
+    YPad = 0.1 * (np.nanmax(y) - np.nanmin(y))
+    #plot mesh
+    ax.triplot(x, y, elements)
+    ax.set_xlim((np.min(x) - XPad, np.max(x) + XPad))
+    ax.set_ylim((np.min(y) - YPad, np.max(y) + YPad))
+
+    highlightpos = options.getfieldvalue('highlight', [])
+    if highlightpos != 'none':
+        #if just one element duplicate it to avoid coloring issues
+        if type(highlightpos) == int:
+            highlightpos = [highlightpos, highlightpos]
+    #convert from to matlab numbering
+        highlightpos = [pos - 1 for pos in highlightpos]
+
+    # and numbers
+    for i, Xcoord in enumerate(x):
+        if i in highlightpos:
+            props = dict(boxstyle='circle', pad=0.1, color='r')
+        else:
+            props = dict(boxstyle='circle', pad=0.1, color='w')
+        ax.text(x[i], y[i], str(i + 1), ha='center', va='center', backgroundcolor='w', clip_on=True, bbox=props)
+
+    #apply options
+    options.addfielddefault('title', 'Vertex numbers (matlab indexation)')
+    options.addfielddefault('colorbar', 'off')
+    applyoptions(md, [], options, fig, axgrid, gridindex)
Index: /issm/trunk/src/m/plot/plotchannels.m
===================================================================
--- /issm/trunk/src/m/plot/plotchannels.m	(revision 24313)
+++ /issm/trunk/src/m/plot/plotchannels.m	(revision 24313)
@@ -0,0 +1,104 @@
+function plotchannels(md,channelarea,varargin)
+%PLOTCHANNELS - plot GlaDS channel area
+%
+%   Usage:
+%      plotchannels(md,channelarea,options)
+%
+%   List of supported options
+%      - 'min' minimum channel area displayed (default is max(channelarea))
+%      - 'max' maximum channel area displayed (default is min(channelarea))
+%      - 'colormap' colormap used (default is 'gray')
+%      - 'linewidth' linewidth (default is 2)
+%
+%   Example:
+%      plotchannels(md,md.results.TransientSolution(end).ChannelArea,'min',15,'max',36);
+
+%Process options
+options = pairoptions(varargin{:});
+
+%define level
+level = channelarea;
+
+%Some processing
+Min = getfieldvalue(options,'min',min(level));
+Max = getfieldvalue(options,'max',max(level));
+
+%Create colormap
+options=addfielddefault(options,'colormap',flipud(gray()));
+palette = getcolormap(options);
+numcolors=size(palette,1);
+levels=round_ice(linspace(Min,Max,numcolors+1),2);
+
+colorind=zeros(length(level),1);
+for i=1:numcolors
+	pos=find((level>=levels(i)) & (level<=levels(i+1)) );
+	colorind(pos)=i;
+end
+colorind(find(level>levels(end)))=numcolors;
+
+%Reconstruct edges
+if 0,
+	edges = [md.mesh.edges(:,1:2) md.mesh.edges(:,1)]';
+else
+	tic
+	%Maximum number of edges
+	maxnbf = 3*md.mesh.numberofelements;
+	%Initialize intermediaries
+	edges = zeros(maxnbf,2);
+	%Chaining algorithm
+	head_minv = -1*ones(md.mesh.numberofvertices,1);
+	next_face = zeros(maxnbf,1);
+	%Initialize number of faces
+	nbf = 0;
+	for i=1:md.mesh.numberofelements
+		for j=1:3
+         %Get the two indices of the edge number j of the ith triangle
+         v1 = md.mesh.elements(i,j);
+			if(j==3)
+				v2 = md.mesh.elements(i,1);
+			else
+				v2 = md.mesh.elements(i,j+1);
+			end
+			%sort
+         if(v2<v1)
+            v3=v2; v2=v1; v1=v3;
+			end
+         %This edge a priori has not been processed yet
+         exists = false;
+			%Go through all processed faces connected to v1 and check whether we have seen this edge yet
+			e=head_minv(v1);
+			while(e~=-1)
+            if(edges(e,2)==v2)
+               exists = true;
+               break;
+				end
+				e=next_face(e);
+			end
+			%If this edge is new, add it to the lists
+         if(~exists)
+            %Update edges
+            edges(nbf+1,1) = v1;
+            edges(nbf+1,2) = v2;
+            %Update chain
+            next_face(nbf+1) = head_minv(v1);
+            head_minv(v1)    = nbf+1;
+            %Increase number of faces
+            nbf=nbf+1;
+			end
+		end
+	end
+	edges = edges(1:nbf,:);
+	toc
+end
+
+%Change edges formatting so that plot looks ok
+edges = [edges(:,1:2) edges(:,1)]';
+
+%Loop over all levels and plot
+for i=1:numcolors
+	pos=find(colorind==i);
+	hprime=plot(md.mesh.x(edges(:,pos)),md.mesh.y(edges(:,pos)),...
+		'-','Color',palette(i,:),'LineWidth',2);
+	if i==1; hold on; end
+end
+hold off
Index: /issm/trunk/src/m/plot/plotdoc.py
===================================================================
--- /issm/trunk/src/m/plot/plotdoc.py	(revision 24312)
+++ /issm/trunk/src/m/plot/plotdoc.py	(revision 24313)
@@ -1,178 +1,176 @@
 def plotdoc():
-	'''PLOTDOC - plot documentation
-	%As of now it is more a TODO list
-	%   Usage:
-	%      plotdoc()
-	'''
-	pydata={'quiver':' quiver plot give data and a vector array [Vx,Vy]',
-					'mesh':' draw mesh using trisurf',
-					'BC':' this will draw all the boundary conditions (Dirichlet and Neumann).',
-					'elementnumbering':' numbering of elements (matlab indices)',
-					'3D disclaimer':'3D is implemented with plot3d for now this is not optimal and may change to mayavi at some point. The impelementation is on the development side for now so expect some issue and question your plotting before you results.'}
-	TODOdata={'basal_drag':' plot the basal drag on the bed (in kPa) based on the velocity in md.initialization',
-						'basal_dragx or basal_dragy' :' plot a component of the basal drag on the bed (in kPa)',
-						'boundaries':' this will draw all the segment boundaries to the model, including rifts.',
-						'icefront':' this will show segments that are used to define the icefront of the model (Neumann boundary conditions).',
-						'deviatoricstress_tensor':' plot the components of the deviatoric stress tensor (tauxx,tauyy,tauzz,tauxy,tauxz,tauyz, if computed',
-						'deviatoricstress_principal':' plot the deviatoricstress tensor principal axis and principal values',
-						'deviatoricstress_principalaxis1':' arrow plot the first principal axis of the deviatoricstress tensor(replace 1 by 2 or 3 if needed)',
-						'driving_stress':' plot the driving stress (in kPa)',
-						'elements_type':' model used for each element',
-						'highlightvertices':' to highlight vertices (use highlight option to enter the vertex list',
-						'referential':' stressbalance referential',
-						'riftvel':' velocities along rifts',
-						'riftrelvel':' relative velocities along rifts',
-						'riftpenetration':' penetration levels for a fault',
-						'riftfraction':' fill fractions for every node of the rifts',
-						'rifts':' plot mesh with an offset so that rifts are visible',
-						'strainrate_tensor':' plot the components of the strainrate tensor (exx,eyy,ezz,exy,exz,eyz) if computed',
-						'strainrate_principal':' plot the strainrate tensor principal axis and principal values)',
-						'strainrate_principalaxis1':' arrow plot the first principal axis of the strainrate tensor(replace 1 by 2 or 3 if needed)',
-						'stress_tensor':' plot the components of stress tensor (sxx,syy,szz,sxy,sxz,syz) if computed',
-						'stress_principal':' plot the stress tensor principal axis and principal values',
-						'stress_principalaxis1':' arrow plot the first principal axis of the stress tensor(replace 1 by 2 or 3 if needed)',
-						'transient_results':' this will printlay all the time steps of a transient run (use steps to specify the steps requested)',
-						'transient_vel':' this will printlay the velocity for the time steps requested in ''steps'' of a transient run',
-						'transient_vel':' vel can be by any field of the transient results (vx, vy, vz, vel, temperature, melting, pressure, bed, thickness, surface)',
-						'transient_field':' dynamic plot of results. specify ''steps'' option, as fell as ''field'' (defaults are all steps, for ''Vel'' field)',
-						'transient_movie':' this will printlay the time steps of a given field of a transient run',
-						'transient_movie_field':' field to be printlayed when doing  transient_movie data printlay',
-						'transient_movie_output':' filename if output is desired for movie',
-						'transient_movie_time':' time for each image (default 2 seconds)',
-						'thermaltransient_results':' this will printlay all the time steps of a thermal transient run',
-						'qmuhistnorm':' histogram normal distribution. needs option qmudata',
-						'qmumean':' plot of mean distribution in sampling analysis with scaled response. needs option qmudata for descriptor',
-						'qmustddev':' plot of stddev distribution in sampling analysis with scaled response. needs option qmudata for descriptor',
-						'part_hist':' partitioning node and area histogram'}
-	
-	pyoptions={'axis':" show ('on') or hide ('off') axes",
-						 'caxis':" modify  colorbar range. (array of type [a b] where b>=a)",
-						 'colorlevels':" N, number of levels to use",
-						 'colorbar':" add colorbar (string 'on','off' or 'one')",
-						 'axes_pad':" spacing between axes (default is 0.25)",
-						 'colorbartitle':" colorbar title (string)",
-						 'colorbarticks':" set colorbar ticks manually (list)",
-						 'colorbarfontsize':" specify colorbar fontsize",
-						 'colormap':" change the default colormap ('viridis' is the default)",
-						 'contourlevels':" N or [value1,...] add the contours of the specified values or N contours",
-						 'streamlines':" TOFIX argument does nothing",
-						 'edgecolor':" color of mesh edges. RGB tuple or standard string",
-						 'fontsize':" fontsize for the title",
-						 'fontweight':" fontweight for the title 'normal', 'bold'",
-						 'fontcolor':" TODO",
-						 'highlight':" highlights certain nodes or elements when using 'vetrexnumbering' or 'elementnumbering' or 'highlightvertices ' or 'highlightelements' option",
-						 'title':" subplot title (string)",
-						 'xlim':" limits of X axis (all subplots) (ex: [0,500])",
-						 'ylim':" limits of Y axis (all subplots) (ex: [0,500])",
-						 'xlabel':" X axis title",
-						 'ylabel':" Y axis title",
-						 'scaling':" scaling factor used by quiver plots.",
-						 'quivercol':" color of quiver arrows, 'values' give value colored arrows",
-						 'text':" print string or list of strings",
-						 'textposition':" [x,y] position of text, list if several texts (position betwee 0 and 1)",
-						 'textsize':" text fontsize TOFIX ",
-						 'textweight':" text fontweight",
-						 'textcolor':" text color",
-						 'textrotation':" text rotation angle",
-						 'mask':" condition. Only 'true' values are plotted ",
-						 'log':" cutoff value for log",
-						 'backgroundcolor':" plot background color. RGB tuple or standard string",
-						 'expdisp':" path (or list of paths) to the exp file to be plotted ",
-						 'explinewidth':" linewidth ",
-						 'explinestyle':" matplotlib linestyle string ",
-						 'explinecolor':" matplotlib color string ",
-						 'expfill':" (True/False) fill a closed contour ",
-						 'expfillcolor':" Color for a filled contour, only used if expfill is True ",
-						 'expfillalpha':" alpha transparency for filled contour ",
-						 'overlay':" True/False. Overlay a georeferenced image (radar/visible) ",
-						 'overlay_image':" path to overlay image ",
-						 'overlayhist':" plot a histogram of overlay image, used for setting overlaylims ",
-						 'overlaylims':" normalized limits to clip and stretch contrast of overlay image (in [0,1], ex. [0.25,0.75]) ",
-						 'alpha':" set transparency of plotted data (in [0,1]) ",
-						 'vertexnumbering':' numbering of vertices',
-						 'elementnumbering':' numbering of elements (matlab indices)',
-						 'highlightelements':' to highlight elements to highlight the element list',
-						 'layer':"number of the layer to display for 3D runs"}
+    '''PLOTDOC - plot documentation
+    %As of now it is more a TODO list
+    %   Usage:
+    %      plotdoc()
+    '''
+    pydata = {'quiver': ' quiver plot give data and a vector array [Vx, Vy]',
+              'mesh': ' draw mesh using trisurf',
+              'BC': ' this will draw all the boundary conditions (Dirichlet and Neumann).',
+              'elementnumbering': ' numbering of elements (matlab indices)',
+              '3D disclaimer': '3D is implemented with plot3d for now this is not optimal and may change to mayavi at some point. The impelementation is on the development side for now so expect some issue and question your plotting before you results.'}
+    # TODOdata = {'basal_drag': ' plot the basal drag on the bed (in kPa) based on the velocity in md.initialization',
+    #             'basal_dragx or basal_dragy': ' plot a component of the basal drag on the bed (in kPa)',
+    #             'boundaries': ' this will draw all the segment boundaries to the model, including rifts.',
+    #             'icefront': ' this will show segments that are used to define the icefront of the model (Neumann boundary conditions).',
+    #             'deviatoricstress_tensor': ' plot the components of the deviatoric stress tensor (tauxx, tauyy, tauzz, tauxy, tauxz, tauyz, if computed',
+    #             'deviatoricstress_principal': ' plot the deviatoricstress tensor principal axis and principal values',
+    #             'deviatoricstress_principalaxis1': ' arrow plot the first principal axis of the deviatoricstress tensor(replace 1 by 2 or 3 if needed)',
+    #             'driving_stress': ' plot the driving stress (in kPa)',
+    #             'elements_type': ' model used for each element',
+    #             'highlightvertices': ' to highlight vertices (use highlight option to enter the vertex list',
+    #             'referential': ' stressbalance referential',
+    #             'riftvel': ' velocities along rifts',
+    #             'riftrelvel': ' relative velocities along rifts',
+    #             'riftpenetration': ' penetration levels for a fault',
+    #             'riftfraction': ' fill fractions for every node of the rifts',
+    #             'rifts': ' plot mesh with an offset so that rifts are visible',
+    #             'strainrate_tensor': ' plot the components of the strainrate tensor (exx, eyy, ezz, exy, exz, eyz) if computed',
+    #             'strainrate_principal': ' plot the strainrate tensor principal axis and principal values)',
+    #             'strainrate_principalaxis1': ' arrow plot the first principal axis of the strainrate tensor(replace 1 by 2 or 3 if needed)',
+    #             'stress_tensor': ' plot the components of stress tensor (sxx, syy, szz, sxy, sxz, syz) if computed',
+    #             'stress_principal': ' plot the stress tensor principal axis and principal values',
+    #             'stress_principalaxis1': ' arrow plot the first principal axis of the stress tensor(replace 1 by 2 or 3 if needed)',
+    #             'transient_results': ' this will printlay all the time steps of a transient run (use steps to specify the steps requested)',
+    #             'transient_vel': ' vel can be by any field of the transient results (vx, vy, vz, vel, temperature, melting, pressure, bed, thickness, surface)',
+    #             'transient_field': ' dynamic plot of results. specify ''steps'' option, as fell as ''field'' (defaults are all steps, for ''Vel'' field)',
+    #             'transient_movie': ' this will printlay the time steps of a given field of a transient run',
+    #             'transient_movie_field': ' field to be printlayed when doing  transient_movie data printlay',
+    #             'transient_movie_output': ' filename if output is desired for movie',
+    #             'transient_movie_time': ' time for each image (default 2 seconds)',
+    #             'thermaltransient_results': ' this will printlay all the time steps of a thermal transient run',
+    #             'qmuhistnorm': ' histogram normal distribution. needs option qmudata',
+    #             'qmumean': ' plot of mean distribution in sampling analysis with scaled response. needs option qmudata for descriptor',
+    #             'qmustddev': ' plot of stddev distribution in sampling analysis with scaled response. needs option qmudata for descriptor',
+    #             'part_hist': ' partitioning node and area histogram'}
 
-	TODOoptions={'basin':" zoom on a given basin ('pineislandglacier','ronneiceshelf', use isbasin to identify a basin",
-							 'figurebackgroundcolor':" figure background color. (default is 'none',",
-							 'coord':"  'xy' (default) or 'latlon'",
-							 'colorbarpos':" [x,y,dx,dy] where x,y,dx and dy are within [0 1]",
-							 'colorbarcornerposition':" 'West','North',etc ...",
-							 'colorbartitlerotation':" -90, etc ...",
-							 'colorbarwidth':" multiplier (default 1) to the default width colorbar",
-							 'colorbarheight':" multiplier (default 1) to the default height colorbar",
-							 'contourticks':" 'on' or 'off' to printlay the ticks of the contours",
-							 'contouronly':" 'on' or 'off' to printlay the contours on a white background",
-							 'contourcolor':" ticks and contour color",
-							 'density':" density of quivers (one arrow every N nodes, N integer)",
-							 'inset':" add an inset (zoom) of the current figure if 1 (use 'insetx', 'insety' and 'insetpos' to determine the inset position and content)",
-							 'insetx':" [min(x) max(x)] where min(x) and max(x) are values determining the inset content",
-							 'insety':" [min(y) max(y)] where min(y) and max(y) are values determining the inset content",
-							 'insetpos':" [x,y,dx,dy] where x,y,dx and dy are within [0 1]",
-							 'resolution':" resolution used by section value (array of type [horizontal_resolution vertical_resolution])",
-							 'showsection':" show section used by 'sectionvalue' (string 'on' or a number of labels)",
-							 'sectionvalue':" give the value of data on a profile given by an Argus file (string 'Argusfile_name.exp',",
-							 'profile':" give the value of data along a vertical profile ([xlocation ylocation])",
-							 'smooth':" smooth element data (string 'yes' or integer)",
-							 'view':" same as standard matlab option (ex: 2, 3 or [90 180]",
-							 'zlim':" same as standard matlab option",
-							 'xticklabel':" specifiy xticklabel",
-							 'yticklabel':" specifiy yticklabel",
-							 'contrast':" (default 1) coefficient to add contrast to the radar amplitude image used in overlays",
-							 'highres':" resolution of overlayed radar amplitude image (default is 0, high resolution is 1).",
-							 'alpha':" transparency coefficient (the higher, the more transparent). Default is 1.5",
-							 'scaling':" scaling factor used by quiver plots. Default is 0.4",
-							 'autoscale':" set to 'off' to have all the quivers with the same size. Default is 'on'",
-							 'linewidth':" line width for expprint plot (use a cell of strings if more than one)",
-							 'border':" size of printlay border (in pixels). active only for overlay plots",
-							 'nan':" value assigned to NaNs (convenient when plotting BC)",
-							 'partitionedges':" 'off' by default. overlay plot of partition edges",
-							 'latlon':" 'on' or {latstep lonstep [resolution [color]]} where latstep,longstep and resolution are in degrees, color is a [r g b] array",
-							 'latlonnumbering':" 'on' or {latgap longap colornumber latangle lonangle} where latgap and longap are pixel gaps for the numbers", 
-							 'latlonclick':" 'on' to click on latlon ticks positions colornumber is a [r g b] array and latangle and lonangle are angles to flip the numbers",
-							 'northarrow':" add an arrow pointing north, 'on' for default value or [x0 y0 length [ratio width fontsize]] where (x0,y0) are the coordinates of the base, ratio=headlength/length",
-							 'offset':" mesh offset used by 'rifts', default is 500",
-							 'scaleruler':" add a scale ruler, 'on' for default value or [x0 y0 length width numberofticks] where (x0,y0) are the coordinates of the lower left corner",
-							 'showregion':" show domain in Antarctica on an inset, use 'insetpos' properties",
-							 'visible':" 'off' to make figure unvisible, default is 'on'",
-							 'wrapping':" repeat 'n' times the colormap ('n' must be an integer)",
-							 'unit':" by default, in m, otherwise, 'km' is available",
-							 'legend_position':" by default, 'NorthEasth'",
-							 'qmudata':" ",
-							 'figposition':" position of figure: 'fullscreen', 'halfright', 'halfleft', 'portrait', 'landscape',... (hardcoded in applyoptions.m)",
-							 'offsetaxispos':" offset of current axis position to get more space (ex: [-0.02 0  0.04 0])",
-							 'axispos':" axis position to get more space",
-							 'hmin':" (numeric, minimum for histogram)",
-							 'hmax':" (numeric, maximum for histogram)",
-							 'hnint':" (numeric, number of intervals for histogram)",
-							 'ymin1':" (numeric, minimum of histogram y-axis)",
-							 'ymax1':" (numeric, maximum of histogram y-axis)",
-							 'ymin2':" (numeric, minimum of cdf y-axis)",
-							 'ymax2':" (numeric, maximum of cdf y-axis)",
-							 'cdfplt':" (char, 'off' to turn off cdf line plots)",
-							 'cdfleg':" (char, 'off' to turn off cdf legends)",
-							 'segmentnumbering':" ('off' by default)",
-							 'kmlgroundoverlay':" ('off' by default)",
-							 'kmlfilename':" ('tempfile.kml' by default)",
-							 'kmlroot':" ('./' by default)",
-							 'kmlimagename':" ('tempimage' by default)",
-							 'kmlimagetype':" ('png' by default)",
-							 'kmlresolution':" (1 by default)",
-							 'kmlfolder':" ('Ground Overlay' by default)",
-							 'kmlfolderdescription':" ('' by default)",
-							 'kmlgroundoverlayname':" ('' by default)",
-							 'kmlgroundoverlaydescription':"N/A by default')"}
+    pyoptions = {'axis': " show ('on') or hide ('off') axes",
+                 'caxis': " modify  colorbar range. (array of type [a b] where b >= a)",
+                 'colorlevels': " N, number of levels to use",
+                 'colorbar': " add colorbar (string 'on', 'off' or 'one')",
+                 'axes_pad': " spacing between axes (default is 0.25)",
+                 'colorbartitle': " colorbar title (string)",
+                 'colorbarticks': " set colorbar ticks manually (list)",
+                 'colorbarfontsize': " specify colorbar fontsize",
+                 'colormap': " change the default colormap ('viridis' is the default)",
+                 'contourlevels': " N or [value1, ...] add the contours of the specified values or N contours",
+                 'streamlines': " TOFIX argument does nothing",
+                 'edgecolor': " color of mesh edges. RGB tuple or standard string",
+                 'fontsize': " fontsize for the title",
+                 'fontweight': " fontweight for the title 'normal', 'bold'",
+                 'fontcolor': " TODO",
+                 'highlight': " highlights certain nodes or elements when using 'vetrexnumbering' or 'elementnumbering' or 'highlightvertices ' or 'highlightelements' option",
+                 'title': " subplot title (string)",
+                 'xlim': " limits of X axis (all subplots) (ex:  [0, 500])",
+                 'ylim': " limits of Y axis (all subplots) (ex:  [0, 500])",
+                 'xlabel': " X axis title",
+                 'ylabel': " Y axis title",
+                 'scaling': " scaling factor used by quiver plots.",
+                 'quivercol': " color of quiver arrows, 'values' give value colored arrows",
+                 'text': " print string or list of strings",
+                 'textposition': " [x, y] position of text, list if several texts (position betwee 0 and 1)",
+                 'textsize': " text fontsize TOFIX ",
+                 'textweight': " text fontweight",
+                 'textcolor': " text color",
+                 'textrotation': " text rotation angle",
+                 'mask': " condition. Only 'true' values are plotted ",
+                 'log': " cutoff value for log",
+                 'backgroundcolor': " plot background color. RGB tuple or standard string",
+                 'expdisp': " path (or list of paths) to the exp file to be plotted ",
+                 'explinewidth': " linewidth ",
+                 'explinestyle': " matplotlib linestyle string ",
+                 'explinecolor': " matplotlib color string ",
+                 'expfill': " (True / False) fill a closed contour ",
+                 'expfillcolor': " Color for a filled contour, only used if expfill is True ",
+                 'expfillalpha': " alpha transparency for filled contour ",
+                 'overlay': " True / False. Overlay a georeferenced image (radar / visible) ",
+                 'overlay_image': " path to overlay image ",
+                 'overlayhist': " plot a histogram of overlay image, used for setting overlaylims ",
+                 'overlaylims': " normalized limits to clip and stretch contrast of overlay image (in [0, 1], ex. [0.25, 0.75]) ",
+                 'alpha': " set transparency of plotted data (in [0, 1]) ",
+                 'vertexnumbering': ' numbering of vertices',
+                 'elementnumbering': ' numbering of elements (matlab indices)',
+                 'highlightelements': ' to highlight elements to highlight the element list',
+                 'layer': "number of the layer to display for 3D runs"}
 
+    # TODOoptions = {'basin': " zoom on a given basin ('pineislandglacier', 'ronneiceshelf', use isbasin to identify a basin",
+    #                'figurebackgroundcolor': " figure background color. (default is 'none', ",
+    #                'coord': "  'xy' (default) or 'latlon'",
+    #                'colorbarpos': " [x, y, dx, dy] where x, y, dx and dy are within [0 1]",
+    #                'colorbarcornerposition': " 'West', 'North', etc ...",
+    #                'colorbartitlerotation': " - 90, etc ...",
+    #                'colorbarwidth': " multiplier (default 1) to the default width colorbar",
+    #                'colorbarheight': " multiplier (default 1) to the default height colorbar",
+    #                'contourticks': " 'on' or 'off' to printlay the ticks of the contours",
+    #                'contouronly': " 'on' or 'off' to printlay the contours on a white background",
+    #                'contourcolor': " ticks and contour color",
+    #                'density': " density of quivers (one arrow every N nodes, N integer)",
+    #                'inset': " add an inset (zoom) of the current figure if 1 (use 'insetx', 'insety' and 'insetpos' to determine the inset position and content)",
+    #                'insetx': " [min(x) max(x)] where min(x) and max(x) are values determining the inset content",
+    #                'insety': " [min(y) max(y)] where min(y) and max(y) are values determining the inset content",
+    #                'insetpos': " [x, y, dx, dy] where x, y, dx and dy are within [0 1]",
+    #                'resolution': " resolution used by section value (array of type [horizontal_resolution vertical_resolution])",
+    #                'showsection': " show section used by 'sectionvalue' (string 'on' or a number of labels)",
+    #                'sectionvalue': " give the value of data on a profile given by an Argus file (string 'Argusfile_name.exp', ",
+    #                'profile': " give the value of data along a vertical profile ([xlocation ylocation])",
+    #                'smooth': " smooth element data (string 'yes' or integer)",
+    #                'view': " same as standard matlab option (ex:  2, 3 or [90 180]",
+    #                'zlim': " same as standard matlab option",
+    #                'xticklabel': " specifiy xticklabel",
+    #                'yticklabel': " specifiy yticklabel",
+    #                'contrast': " (default 1) coefficient to add contrast to the radar amplitude image used in overlays",
+    #                'highres': " resolution of overlayed radar amplitude image (default is 0, high resolution is 1).",
+    #                'alpha': " transparency coefficient (the higher, the more transparent). Default is 1.5",
+    #                'scaling': " scaling factor used by quiver plots. Default is 0.4",
+    #                'autoscale': " set to 'off' to have all the quivers with the same size. Default is 'on'",
+    #                'linewidth': " line width for expprint plot (use a cell of strings if more than one)",
+    #                'border': " size of printlay border (in pixels). active only for overlay plots",
+    #                'nan': " value assigned to NaNs (convenient when plotting BC)",
+    #                'partitionedges': " 'off' by default. overlay plot of partition edges",
+    #                'latlon': " 'on' or {latstep lonstep [resolution [color]]} where latstep, longstep and resolution are in degrees, color is a [r g b] array",
+    #                'latlonnumbering': " 'on' or {latgap longap colornumber latangle lonangle} where latgap and longap are pixel gaps for the numbers",
+    #                'latlonclick': " 'on' to click on latlon ticks positions colornumber is a [r g b] array and latangle and lonangle are angles to flip the numbers",
+    #                'northarrow': " add an arrow pointing north, 'on' for default value or [x0 y0 length [ratio width fontsize]] where (x0, y0) are the coordinates of the base, ratio = headlength / length",
+    #                'offset': " mesh offset used by 'rifts', default is 500",
+    #                'scaleruler': " add a scale ruler, 'on' for default value or [x0 y0 length width numberofticks] where (x0, y0) are the coordinates of the lower left corner",
+    #                'showregion': " show domain in Antarctica on an inset, use 'insetpos' properties",
+    #                'visible': " 'off' to make figure unvisible, default is 'on'",
+    #                'wrapping': " repeat 'n' times the colormap ('n' must be an integer)",
+    #                'unit': " by default, in m, otherwise, 'km' is available",
+    #                'legend_position': " by default, 'NorthEasth'",
+    #                'qmudata': " ",
+    #                'figposition': " position of figure:  'fullscreen', 'halfright', 'halfleft', 'portrait', 'landscape', ... (hardcoded in applyoptions.m)",
+    #                'offsetaxispos': " offset of current axis position to get more space (ex:  [ -0.02 0  0.04 0])",
+    #                'axispos': " axis position to get more space",
+    #                'hmin': " (numeric, minimum for histogram)",
+    #                'hmax': " (numeric, maximum for histogram)",
+    #                'hnint': " (numeric, number of intervals for histogram)",
+    #                'ymin1': " (numeric, minimum of histogram y - axis)",
+    #                'ymax1': " (numeric, maximum of histogram y - axis)",
+    #                'ymin2': " (numeric, minimum of cdf y - axis)",
+    #                'ymax2': " (numeric, maximum of cdf y - axis)",
+    #                'cdfplt': " (char, 'off' to turn off cdf line plots)",
+    #                'cdfleg': " (char, 'off' to turn off cdf legends)",
+    #                'segmentnumbering': " ('off' by default)",
+    #                'kmlgroundoverlay': " ('off' by default)",
+    #                'kmlfilename': " ('tempfile.kml' by default)",
+    #                'kmlroot': " ('./' by default)",
+    #                'kmlimagename': " ('tempimage' by default)",
+    #                'kmlimagetype': " ('png' by default)",
+    #                'kmlresolution': " (1 by default)",
+    #                'kmlfolder': " ('Ground Overlay' by default)",
+    #                'kmlfolderdescription': " ('' by default)",
+    #                'kmlgroundoverlayname': " ('' by default)",
+    #                'kmlgroundoverlaydescription': "N/A by default')"}
 
-	print("   Plot usage: plotmodel(model,varargin)")
-	print("   plotting is done with couples of keywords values, the type and style of data to display is given by one (or several) of the followings")
-	print("   Options: ")
-	print("     'data' : and a model field or one of the following options.")
-	for key in pydata.keys():
-		print("     - {} : {}".format(key,pydata[key]))
-	print("")
-	print("   The general look of the plot is then given by the following keywords")
-	for key in sorted(pyoptions):
-		print("     - {} : {}".format(key,pyoptions[key]))
-	print("       any options (except 'data') can be followed by '#i' where 'i' is the subplot number, or '#all' if applied to all plots")
+    print("   Plot usage:  plotmodel(model, varargin)")
+    print("   plotting is done with couples of keywords values, the type and style of data to display is given by one (or several) of the followings")
+    print("   Options:  ")
+    print("     'data' :  and a model field or one of the following options.")
+    for key in list(pydata.keys()):
+        print((" - {} :  {}".format(key, pydata[key])))
+    print("")
+    print("   The general look of the plot is then given by the following keywords")
+    for key in sorted(pyoptions):
+        print((" - {} :  {}".format(key, pyoptions[key])))
+    print("       any options (except 'data') can be followed by '  #i' where 'i' is the subplot number, or '  #all' if applied to all plots")
Index: /issm/trunk/src/m/plot/plotmodel.py
===================================================================
--- /issm/trunk/src/m/plot/plotmodel.py	(revision 24312)
+++ /issm/trunk/src/m/plot/plotmodel.py	(revision 24313)
@@ -1,106 +1,106 @@
-import numpy as  np
+import numpy as np
 from plotoptions import plotoptions
-from plotdoc import plotdoc
 from plot_manager import plot_manager
 from math import ceil, sqrt
 
 try:
-	import pylab as p
-	import matplotlib.pyplot as plt
-	from mpl_toolkits.axes_grid1 import ImageGrid, AxesGrid
-	from mpl_toolkits.mplot3d import Axes3D
+    import matplotlib.pyplot as plt
+    from mpl_toolkits.axes_grid1 import ImageGrid
 except ImportError:
-	print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
-
-def plotmodel(md,*args):
-	'''	at command prompt, type 'plotdoc()' for additional documentation
-	'''
-
-	#First process options
-	options=plotoptions(*args)
-
-	#get number of subplots
-	subplotwidth=ceil(sqrt(options.numberofplots))
-	#Get figure number and number of plots
-	figurenumber=options.figurenumber
-	numberofplots=options.numberofplots
-
-	#get hold
-	hold=options.list[0].getfieldvalue('hold',False)
-
-	#if nrows and ncols specified, then bypass
-	if options.list[0].exist('nrows'):
-		nrows=options.list[0].getfieldvalue('nrows')
-		nr=True
-	else:
-		nrows=np.ceil(numberofplots/subplotwidth)
-		nr=False
-
-	if options.list[0].exist('ncols'):
-		ncols=options.list[0].getfieldvalue('ncols')
-		nc=True
-	else:
-		ncols=int(subplotwidth)
-		nc=False
-	ncols=int(ncols)
-	nrows=int(nrows)
-
-	#check that nrows and ncols were given at the same time!
-	if not nr==nc:
-		raise StandardError('error: nrows and ncols need to be specified together, or not at all')
-
-	#Go through plots
-	if numberofplots:
-		#if plt.fignum_exists(figurenumber): 
-		#	plt.cla()
-
-		#if figsize specified
-		if options.list[0].exist('figsize'):
-			figsize=options.list[0].getfieldvalue('figsize')
-			fig=plt.figure(figurenumber,figsize=(figsize[0],figsize[1]))#,tight_layout=True)
-		else:
-			fig=plt.figure(figurenumber)#,tight_layout=True)
-		fig.clf()
-
-		backgroundcolor=options.list[0].getfieldvalue('backgroundcolor',(0.7,0.7,0.7))
-		fig.set_facecolor(backgroundcolor)
+    print("could not import pylab, matplotlib has not been installed, no plotting capabilities enabled")
 
 
-		translator={'on':'each',
-								'off':'None',
-								'one':'single'}
-		# options needed to define plot grid
-		plotnum=options.numberofplots
-		direction=options.list[0].getfieldvalue('direction','row') # row,column
-		axes_pad=options.list[0].getfieldvalue('axes_pad',0.25)
-		add_all=options.list[0].getfieldvalue('add_all',True) # True,False
-		share_all=options.list[0].getfieldvalue('share_all',True) # True,False
-		label_mode=options.list[0].getfieldvalue('label_mode','L') # 1,L,all
-		colorbar=options.list[0].getfieldvalue('colorbar','on') # on, off (single)
-		cbar_mode=translator[colorbar]
-		cbar_location=options.list[0].getfieldvalue('colorbarpos','right') # right,top
-		cbar_size=options.list[0].getfieldvalue('colorbarsize','5%')
-		cbar_pad=options.list[0].getfieldvalue('colorbarpad','2.5%') # None or %
+def plotmodel(md, *args):
+    ''' at command prompt, type 'plotdoc()' for additional documentation
+    '''
 
-		axgrid=ImageGrid(fig,111,
-				nrows_ncols=(nrows,ncols),
-				ngrids=plotnum,
-				direction=direction,
-				axes_pad=axes_pad,
-				add_all=add_all,
-				share_all=share_all,
-				label_mode=label_mode,
-				cbar_mode=cbar_mode,
-				cbar_location=cbar_location,
-				cbar_size=cbar_size,
-				cbar_pad=cbar_pad)
+    #First process options
+    options = plotoptions(*args)
+    #get number of subplots
+    subplotwidth = ceil(sqrt(options.numberofplots))
+    #Get figure number and number of plots
+    figurenumber = options.figurenumber
+    numberofplots = options.numberofplots
 
-		if cbar_mode=='None':
-			for ax in axgrid.cbar_axes: 
-				fig._axstack.remove(ax)
+    #get hold
+    hold = options.list[0].getfieldvalue('hold', False)
 
-		for i,ax in enumerate(axgrid.axes_all):
-			plot_manager(options.list[i].getfieldvalue('model',md),options.list[i],fig,axgrid,i)
-		fig.show()
-	else:
-		raise StandardError('plotmodel error message: no output data found.')
+    #if nrows and ncols specified, then bypass
+    if options.list[0].exist('nrows'):
+        nrows = options.list[0].getfieldvalue('nrows')
+        nr = True
+    else:
+        nrows = np.ceil(numberofplots / subplotwidth)
+        nr = False
+
+    if options.list[0].exist('ncols'):
+        ncols = options.list[0].getfieldvalue('ncols')
+        nc = True
+    else:
+        ncols = int(subplotwidth)
+        nc = False
+    ncols = int(ncols)
+    nrows = int(nrows)
+
+    #check that nrows and ncols were given at the same time!
+    if not nr == nc:
+        raise Exception('error: nrows and ncols need to be specified together, or not at all')
+
+    #Go through plots
+    if numberofplots:
+        #if plt.fignum_exists(figurenumber):
+        #       plt.cla()
+
+        #if figsize specified
+        if options.list[0].exist('figsize'):
+            figsize = options.list[0].getfieldvalue('figsize')
+            fig = plt.figure(figurenumber, figsize=(figsize[0], figsize[1]))
+        else:
+            fig = plt.figure(figurenumber)
+        fig.clf()
+
+        backgroundcolor = options.list[0].getfieldvalue('backgroundcolor', (0.7, 0.7, 0.7))
+        fig.set_facecolor(backgroundcolor)
+
+        translator = {'on': 'each',
+                      'off': 'None',
+                      'one': 'single'}
+    # options needed to define plot grid
+        plotnum = options.numberofplots
+        if plotnum == 1:
+            plotnum = None
+        direction = options.list[0].getfieldvalue('direction', 'row')  # row, column
+        axes_pad = options.list[0].getfieldvalue('axes_pad', 0.25)
+        add_all = options.list[0].getfieldvalue('add_all', True)  # True, False
+        share_all = options.list[0].getfieldvalue('share_all', True)  # True, False
+        label_mode = options.list[0].getfieldvalue('label_mode', 'L')  # 1, L, all
+        colorbar = options.list[0].getfieldvalue('colorbar', 'on')  # on, off (single)
+        cbar_mode = translator[colorbar]
+        cbar_location = options.list[0].getfieldvalue('colorbarpos', 'right')  # right, top
+        cbar_size = options.list[0].getfieldvalue('colorbarsize', '5%')
+        cbar_pad = options.list[0].getfieldvalue('colorbarpad', 0.025)  # None or %
+
+        axgrid = ImageGrid(fig, 111,
+                           nrows_ncols=(nrows, ncols),
+                           direction=direction,
+                           axes_pad=axes_pad,
+                           add_all=add_all,
+                           share_all=share_all,
+                           label_mode=label_mode,
+                           cbar_mode=cbar_mode,
+                           cbar_location=cbar_location,
+                           cbar_size=cbar_size,
+                           cbar_pad=cbar_pad)
+
+        if cbar_mode == 'None':
+            for ax in axgrid.cbar_axes:
+                fig._axstack.remove(ax)
+        for i, ax in enumerate(axgrid.axes_all):
+            try:
+                plot_manager(options.list[i].getfieldvalue('model', md), options.list[i], fig, axgrid, i)
+            except KeyError:
+                print("Too many axes present, we delete the overflow")
+                fig.delaxes(axgrid[i])
+        fig.show()
+    else:
+        raise Exception('plotmodel error message: no output data found.')
Index: /issm/trunk/src/m/plot/processdata.m
===================================================================
--- /issm/trunk/src/m/plot/processdata.m	(revision 24312)
+++ /issm/trunk/src/m/plot/processdata.m	(revision 24313)
@@ -27,4 +27,7 @@
 	[data datatype]=processdata(md,data(1).(F{choice}),options);
 end
+if issparse(data)
+	data = full(data);
+end
 
 %Process NaN if any (do not know before mask is applied)
Index: /issm/trunk/src/m/plot/processdata.py
===================================================================
--- /issm/trunk/src/m/plot/processdata.py	(revision 24312)
+++ /issm/trunk/src/m/plot/processdata.py	(revision 24313)
@@ -1,138 +1,139 @@
-import numpy as  np
+import numpy as np
 
-def processdata(md,data,options):
-	"""
-	PROCESSDATA - process data to be plotted
-	
-	datatype = 1 -> elements
-	datatype = 2 -> nodes
-	datatype = 3 -> node quivers
-	datatype = 4 -> patch
-	
-	Usage:
-	data,datatype=processdata(md,data,options);
-	
-	See also: PLOTMODEL, PROCESSMESH
-	"""
-	# {{{ Initialisation and grabbing auxiliaries
-	# check format
-	if (len(data)==0 or (len(data)==1 and not isinstance(data,dict) and np.isnan(data).all())):
-		raise ValueError("processdata error message: 'data' provided is empty")
-	# get the shape
-	if 'numberofvertices2d' in dir(md.mesh):
-		numberofvertices2d=md.mesh.numberofvertices2d
-		numberofelements2d=md.mesh.numberofelements2d
-	else:
-		numberofvertices2d=np.nan
-		numberofelements2d=np.nan
-	procdata=np.copy(data)
-	#initialize datatype
-	datatype=0
-	# get datasize
-	if np.ndim(procdata)==1:
-		datasize=(np.shape(procdata)[0],1)
-	elif np.ndim(procdata)==2:
-		datasize=np.shape(procdata)
-	elif np.ndim(procdata)==3:
-		if np.shape(procdata)[0]==2:
-			#treating a dim two list that needs to be stacked
-			procdata=np.hstack((procdata[0,:,:],procdata[1,:,:]))
-			datasize=np.shape(procdata)
-		else:
-			raise ValueError('data list contains more than two vectore, we can not cope with that')
-	else:
-		raise ValueError('data passed to plotmodel has bad dimensions; check that column vectors are rank-1')
-  # }}}      
-	# {{{ process NaN's if any
-	nanfill=options.getfieldvalue('nan',-9999)
-	if np.any(np.isnan(procdata)):
-		lb=np.nanmin(procdata)
-		ub=np.nanmax(procdata)
-		if lb==ub:
-			lb=lb-0.5
-			ub=ub+0.5
-			nanfill=lb-1
-			#procdata[np.isnan(procdata)]=nanfill
-		procdata=np.ma.array(procdata,mask=np.isnan(procdata))
-		options.addfielddefault('clim',[lb,ub])
-		options.addfielddefault('cmap_set_under','1')
-		print "WARNING: nan's treated as", nanfill, "by default.  Change using pairoption 'nan',nan_fill_value in plotmodel call"
-  # }}}  
-	# {{{ log
-	if options.exist('log'):
-		cutoff=options.getfieldvalue('log',1)
-		procdata[np.where(procdata<cutoff)]=cutoff
-	# }}}
-	# {{{ quiver plot
-	if datasize[1]>1 and datasize[0]!= md.mesh.numberofvertices+1:
-		if datasize[0]==md.mesh.numberofvertices and datasize[1]==2:
-			datatype=3
-		else:
-			raise ValueError('plotmodel error message: data should have two columns of length md.mesh.numberofvertices for a quiver plot')
-	# }}}  
-	# {{{ element data
 
-	if datasize[0]==md.mesh.numberofelements and datasize[1]==1:
-		#initialize datatype if non patch
-		if datatype!=4 and datatype!=5:
-			datatype=1
-		# {{{mask
-		if options.exist('mask'):
-			flags=options.getfieldvalue('mask')
-			hide=np.invert(flags)
-			if np.size(flags)==md.mesh.numberofvertices:
-				EltMask=np.asarray([np.any(np.in1d(index,np.where(hide))) for index in md.mesh.elements-1])
-				procdata=np.ma.array(procdata,mask=EltMask)
-				options.addfielddefault('cmap_set_bad','w')
-			elif np.size(flags)==md.mesh.numberofelements:
-				procdata=np.ma.array(procdata,mask=hide)
-				options.addfielddefault('cmap_set_bad','w')
-			else:
-				print('plotmodel warning: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements')
-		# }}}  
+def processdata(md, data, options):
+    """
+    PROCESSDATA - process data to be plotted
 
-	# }}}  
-	# {{{ node data
-	if datasize[0]==md.mesh.numberofvertices and datasize[1]==1:
-		datatype=2
-		# {{{ Mask
-		if options.exist('mask'):
-			flags=options.getfieldvalue('mask')
-			hide=np.invert(flags)
-			if np.size(flags)==md.mesh.numberofvertices:
-				procdata=np.ma.array(procdata,mask=hide)
-				options.addfielddefault('cmap_set_bad','w')
-			elif np.size(flags)==md.mesh.numberofelements:
-				NodeMask=np.zeros(np.shape(md.mesh.x),dtype=bool)
-				HideElt=md.mesh.elements[np.where(hide)[0]]-1
-				NodeMask[HideElt]=True
-				procdata=np.ma.array(procdata,mask=NodeMask)
-				options.addfielddefault('cmap_set_bad','w')
-			else:
-				print('plotmodel warning: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements')
-	  # }}}  
-	# }}}  
-	# {{{ spc time series
-	if datasize[0]==md.mesh.numberofvertices+1:
-		datatype=2
-		spccol=options.getfieldvalue('spccol',0)
-		print 'multiple-column spc field; specify column to plot using option "spccol"'
-		print 'column ', spccol, ' plotted for time: ', procdata[-1,spccol]
-		procdata=procdata[0:-1,spccol]
-    
-		#mask?
-    
+    datatype = 1 -> elements
+    datatype = 2 -> nodes
+    datatype = 3 -> node quivers
+    datatype = 4 -> patch
+
+    Usage:
+    data, datatype = processdata(md, data, options)
+
+    See also: PLOTMODEL, PROCESSMESH
+    """
+    # {{{ Initialisation and grabbing auxiliaries
+    # check format
+    if (len(data) == 0 or (len(data) == 1 and not isinstance(data, dict) and np.isnan(data).all())):
+        raise ValueError("processdata error message: 'data' provided is empty")
+    # get the shape
+    if 'numberofvertices2d' in dir(md.mesh):
+        numberofvertices2d = md.mesh.numberofvertices2d
+        numberofelements2d = md.mesh.numberofelements2d
+    else:
+        numberofvertices2d = np.nan
+        numberofelements2d = np.nan
+    procdata = np.copy(data)
+    #initialize datatype
+    datatype = 0
+    # get datasize
+    if np.ndim(procdata) == 1:
+        datasize = (np.shape(procdata)[0], 1)
+    elif np.ndim(procdata) == 2:
+        datasize = np.shape(procdata)
+    elif np.ndim(procdata) == 3:
+        if np.shape(procdata)[0] == 2:
+            #treating a dim two list that needs to be stacked
+            procdata = np.hstack((procdata[0, :, :], procdata[1, :, :]))
+            datasize = np.shape(procdata)
+        else:
+            raise ValueError('data list contains more than two vectore, we can not cope with that')
+    else:
+        raise ValueError('data passed to plotmodel has bad dimensions; check that column vectors are rank - 1')
+    # }}}
+    # {{{ process NaN's if any
+    nanfill = options.getfieldvalue('nan', -9999)
+    if np.any(np.isnan(procdata)):
+        lb = np.nanmin(procdata)
+        ub = np.nanmax(procdata)
+        if lb == ub:
+            lb = lb - 0.5
+            ub = ub + 0.5
+            nanfill = lb - 1
+    #procdata[np.isnan(procdata)] = nanfill
+        procdata = np.ma.array(procdata, mask=np.isnan(procdata))
+        options.addfielddefault('clim', [lb, ub])
+        options.addfielddefault('cmap_set_under', '1')
+        print(("WARNING: nan's treated as", nanfill, "by default.  Change using pairoption 'nan', nan_fill_value in plotmodel call"))
+    # }}}
+    # {{{ log
+    if options.exist('log'):
+        cutoff = options.getfieldvalue('log', 1)
+        procdata[np.where(procdata < cutoff)] = cutoff
+    # }}}
+    # {{{ quiver plot
+    if datasize[1] > 1 and datasize[0] != md.mesh.numberofvertices + 1:
+        if datasize[0] == md.mesh.numberofvertices and datasize[1] == 2:
+            datatype = 3
+        else:
+            raise ValueError('plotmodel error message: data should have two columns of length md.mesh.numberofvertices for a quiver plot')
+    # }}}
+    # {{{ element data
+
+    if datasize[0] == md.mesh.numberofelements and datasize[1] == 1:
+        #initialize datatype if non patch
+        if datatype != 4 and datatype != 5:
+            datatype = 1
+    # {{{mask
+        if options.exist('mask'):
+            flags = options.getfieldvalue('mask')
+            hide = np.invert(flags)
+            if np.size(flags) == md.mesh.numberofvertices:
+                EltMask = np.asarray([np.any(np.in1d(index, np.where(hide))) for index in md.mesh.elements - 1])
+                procdata = np.ma.array(procdata, mask=EltMask)
+                options.addfielddefault('cmap_set_bad', 'w')
+            elif np.size(flags) == md.mesh.numberofelements:
+                procdata = np.ma.array(procdata, mask=hide)
+                options.addfielddefault('cmap_set_bad', 'w')
+            else:
+                print('plotmodel warning: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements')
+    # }}}
+
+    # }}}
+    # {{{ node data
+    if datasize[0] == md.mesh.numberofvertices and datasize[1] == 1:
+        datatype = 2
+    # {{{ Mask
+        if options.exist('mask'):
+            flags = options.getfieldvalue('mask')
+            hide = np.invert(flags)
+            if np.size(flags) == md.mesh.numberofvertices:
+                procdata = np.ma.array(procdata, mask=hide)
+                options.addfielddefault('cmap_set_bad', 'w')
+            elif np.size(flags) == md.mesh.numberofelements:
+                NodeMask = np.zeros(np.shape(md.mesh.x), dtype=bool)
+                HideElt = md.mesh.elements[np.where(hide)[0]] - 1
+                NodeMask[HideElt] = True
+                procdata = np.ma.array(procdata, mask=NodeMask)
+                options.addfielddefault('cmap_set_bad', 'w')
+            else:
+                print('plotmodel warning: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements')
+    # }}}
+    # }}}
+    # {{{ spc time series
+    if datasize[0] == md.mesh.numberofvertices + 1:
+        datatype = 2
+        spccol = options.getfieldvalue('spccol', 0)
+        print('multiple-column spc field; specify column to plot using option "spccol"')
+        print(('column ', spccol, ' plotted for time: ', procdata[-1, spccol]))
+        procdata = procdata[0:-1, spccol]
+
+    #mask?
+
     #layer projection?
-    
+
     #control arrow density if quiver plot
-	# }}}  
-	# {{{ convert rank-2 array to rank-1
-	if np.ndim(procdata)==2 and np.shape(procdata)[1]==1:
-		procdata=procdata.reshape(-1,)
-	# }}}  
-	# {{{ if datatype is still zero, error out
-	if datatype==0:
-		raise ValueError("processdata error: data provided not recognized or not supported")
-	else:
-		return procdata, datatype
-  # }}}  
+    # }}}
+    # {{{ convert rank - 2 array to rank - 1
+    if np.ndim(procdata) == 2 and np.shape(procdata)[1] == 1:
+        procdata = procdata.reshape(-1, )
+    # }}}
+    # {{{ if datatype is still zero, error out
+    if datatype == 0:
+        raise ValueError("processdata error: data provided not recognized or not supported")
+    else:
+        return procdata, datatype
+    # }}}
Index: /issm/trunk/src/m/plot/processmesh.py
===================================================================
--- /issm/trunk/src/m/plot/processmesh.py	(revision 24312)
+++ /issm/trunk/src/m/plot/processmesh.py	(revision 24313)
@@ -1,59 +1,59 @@
-from math import isnan
-import numpy as  np
+import numpy as np
 
-def processmesh(md,data,options):
-	"""
-	PROCESSMESH - process the mesh for plotting
-	
-	Usage:
-	x,y,z,elements,is2d=processmech(md,data,options)
-	
-	See also: PLOTMODEL, PROCESSDATA
-	"""
-	
-	# {{{ check mesh size parameters
-	if md.mesh.numberofvertices==0:
-		raise ValueError('processmesh error: mesh is empty')
-	if md.mesh.numberofvertices==md.mesh.numberofelements:
-		raise ValueError('processmesh error: the number of elements is the same as the number of nodes')
-	# }}}
-  # {{{ treating coordinates
 
-	try:
-		z=md.mesh.z
-	except AttributeError:
-		z=np.zeros(np.shape(md.mesh.x))
-	elements=md.mesh.elements-1
-	
-	if options.getfieldvalue('layer',0)>=1:
-		x=md.mesh.x2d
-		y=md.mesh.y2d
-		z=np.zeros(np.shape(x))
-		elements=md.mesh.elements2d-1
-	elif 'latlon' in options.getfieldvalue('coord','xy'):
-		x=md.mesh.long
-		y=md.mesh.lat
-	else:
-		x=md.mesh.x
-		y=md.mesh.y
+def processmesh(md, data, options):
+    """
+    PROCESSMESH - process the mesh for plotting
 
-	#is it a 2D plot?
-	if md.mesh.dimension()==2 or options.getfieldvalue('layer',0)>=1:
-		is2d=1
-	else:
-		is2d=0
-		
-	#units
-	if options.exist('unit'):
-		unit=options.getfieldvalue('unit')
-		x=x*unit
-		y=y*unit
-		z=z*unit
+    Usage:
+    x, y, z, elements, is2d = processmech(md, data, options)
 
-	#is model a member of planet class? (workaround until planet class defined)
-	if md.__class__.__name__!='model':
-		isplanet=1
-	else:
-		isplanet=0
+    See also: PLOTMODEL, PROCESSDATA
+    """
 
-	return x,y,z,elements,is2d,isplanet
+    # {{{ check mesh size parameters
+    if md.mesh.numberofvertices == 0:
+        raise ValueError('processmesh error: mesh is empty')
+    if md.mesh.numberofvertices == md.mesh.numberofelements:
+        raise ValueError('processmesh error: the number of elements is the same as the number of nodes')
+    # }}}
+    # {{{ treating coordinates
+
+    try:
+        z = md.mesh.z
+    except AttributeError:
+        z = np.zeros(np.shape(md.mesh.x))
+    elements = md.mesh.elements - 1
+
+    if options.getfieldvalue('layer', 0) >= 1:
+        x = md.mesh.x2d
+        y = md.mesh.y2d
+        z = np.zeros(np.shape(x))
+        elements = md.mesh.elements2d - 1
+    elif 'latlon' in options.getfieldvalue('coord', 'xy'):
+        x = md.mesh.long
+        y = md.mesh.lat
+    else:
+        x = md.mesh.x
+        y = md.mesh.y
+
+    #is it a 2D plot?
+    if md.mesh.dimension() == 2 or options.getfieldvalue('layer', 0) >= 1:
+        is2d = 1
+    else:
+        is2d = 0
+
+    #units
+    if options.exist('unit'):
+        unit = options.getfieldvalue('unit')
+        x = x * unit
+        y = y * unit
+        z = z * unit
+
+    #is model a member of planet class? (workaround until planet class defined)
+    if md.__class__.__name__ != 'model':
+        isplanet = 1
+    else:
+        isplanet = 0
+
+    return x, y, z, elements, is2d, isplanet
Index: /issm/trunk/src/m/plot/scaleruler.m
===================================================================
--- /issm/trunk/src/m/plot/scaleruler.m	(revision 24312)
+++ /issm/trunk/src/m/plot/scaleruler.m	(revision 24313)
@@ -28,6 +28,6 @@
 if numberofticks==1,
 	t=text(x0+lengthscale/2,y0+2*widthscale,2,[num2str(lengthscale*unitscale/1000) ' km'],...
-		'FontSize',fontsize,'FontWeight',fontweight,'Color',fontcolor,'HorizontalAlignment','center','VerticalAlignment','baseline');
-	if ~verLessThan('matlab', '8.3')
+		'FontSize',fontsize,'FontWeight',fontweight,'Color',fontcolor,'HorizontalAlignment','center','VerticalAlignment','bottom');
+	if ~verLessThan('matlab', '8.4')
 		set(t,'Layer','front');
 	end
@@ -45,5 +45,5 @@
 	xt=Bu(1);
 	yt=Bu(2)+widthscale;
-	text(xt,yt,2,num2str(Tick),'FontSize',fontsize,'FontWeight',fontweight,'Color',fontcolor,'HorizontalAlignment','center','VerticalAlignment','baseline');
+	text(xt,yt,2,num2str(Tick),'FontSize',fontsize,'FontWeight',fontweight,'Color',fontcolor,'HorizontalAlignment','center','VerticalAlignment','bottom');
 
 	%loope over the patches
@@ -69,8 +69,8 @@
 		yt=Bu(2)+widthscale;
 		if i~=numberofticks-1,
-			text(xt,yt,2,num2str(round_ice(Tick/1000,3)),'FontSize',fontsize,'FontWeight',fontweight,'Color',fontcolor,'HorizontalAlignment','center','VerticalAlignment','baseline');
+			text(xt,yt,2,num2str(round_ice(Tick/1000,3)),'FontSize',fontsize,'FontWeight',fontweight,'Color',fontcolor,'HorizontalAlignment','center','VerticalAlignment','bottom');
 		end
 	end
-	text(xt,yt,2,num2str(round_ice(Tick/1000,3)),'FontSize',fontsize,'FontWeight',fontweight,'Color',fontcolor,'HorizontalAlignment','center','VerticalAlignment','baseline');
+	text(xt,yt,2,num2str(round_ice(Tick/1000,3)),'FontSize',fontsize,'FontWeight',fontweight,'Color',fontcolor,'HorizontalAlignment','center','VerticalAlignment','bottom');
 	% add leading spaces depending on length of label string
 	str=' km';
@@ -78,4 +78,4 @@
 		str=[' ' str];
 	end
-	text(xt,yt,2,str,'FontSize',fontsize,'FontWeight',fontweight,'Color',fontcolor,'HorizontalAlignment','left','VerticalAlignment','baseline');
+	text(xt,yt,2,str,'FontSize',fontsize,'FontWeight',fontweight,'Color',fontcolor,'HorizontalAlignment','left','VerticalAlignment','bottom');
 end
Index: /issm/trunk/src/m/plot/writejsfield.py
===================================================================
--- /issm/trunk/src/m/plot/writejsfield.py	(revision 24312)
+++ /issm/trunk/src/m/plot/writejsfield.py	(revision 24313)
@@ -1,26 +1,28 @@
 import numpy as np
-def writejsfield(fid,name,variable,nods):
-#WRITEJSFIELD - write variable to javascript file 
-#
-#   Usage:
-#      writejsfield(fid,name,variable)
-#
-	#write array:
-	#if not isinstance(variable, list):
-	if type(variable[0])==np.float64:
-		fid.write('<!-- {0}{{{{{{-->\n'.format(name))
-		fid.write('{0}=['.format(name))
-		for i in xrange(0, nods-1):
-			fid.write('{0},'.format(variable[i]))
-		fid.write('{0}];\n'.format(variable[-1]))
-		fid.write('<!--}}}}}}-->\n')
-	else:
-		#multi-sized array: 
-		fid.write('<!-- {0}{{{{{{-->\n'.format(name))
-		fid.write('{0}=[]\n'.format(name))
-		for i in xrange(0, len(variable[2])):
-			fid.write('{0}["{1}"]=['.format(name,i))
-			for j in xrange(1, nods-1):
-				fid.write('{0},'.format(variable[j][i]))
-			fid.write('{0}];\n'.format(variable[-1][i]))
-		fid.write('<!--}}}}}}-->\n')
+
+
+def writejsfield(fid, name, variable, nods):
+    #WRITEJSFIELD - write variable to javascript file
+    #
+    #   Usage:
+    #      writejsfield(fid, name, variable)
+    #
+    #write array:
+    #if not isinstance(variable, list):
+    if type(variable[0]) == np.float64:
+        fid.write('<!-- {0}{{{{{{-->\n'.format(name))
+        fid.write('{0}=['.format(name))
+        for i in range(0, nods - 1):
+            fid.write('{0}, '.format(variable[i]))
+        fid.write('{0}];\n'.format(variable[-1]))
+        fid.write('<!--}}}}}}-->\n')
+    else:
+        #multi - sized array:
+        fid.write('<!-- {0}{{{{{{-->\n'.format(name))
+        fid.write('{0} = []\n'.format(name))
+        for i in range(0, len(variable[2])):
+            fid.write('{0}["{1}"] = ['.format(name, i))
+            for j in range(1, nods - 1):
+                fid.write('{0}, '.format(variable[j][i]))
+            fid.write('{0}];\n'.format(variable[-1][i]))
+        fid.write('<!--}}}}}}-->\n')
Index: /issm/trunk/src/m/plot/writejsfile.py
===================================================================
--- /issm/trunk/src/m/plot/writejsfile.py	(revision 24312)
+++ /issm/trunk/src/m/plot/writejsfile.py	(revision 24313)
@@ -1,57 +1,59 @@
 import numpy as np
 from writejsfield import writejsfield
-def writejsfile(filename,model,keyname):
-#WRITEJSFILE - write model file to javascript database
-#
-#   Usage:
-#      writejsfile(filename,model,keyname)
-#
 
-	nods=len(model.x)
-	nel=len(model.index)
-	nx=len(model.contourx1)
-	print(filename)	
-	fid=open(filename,'w', 0)
 
-	fid.write('model = {};\n')
-	fid.write('model["title"]="{0}";\n'.format(model.title))
-	fid.write('model["initialZoomFactor"]={0};\n'.format(model.initialZoomFactor))
-	#write index:
-	fid.write('<!-- model["index"]{{{-->\n')
-	fid.write('model["index"]=[')
-	for i in xrange(0, nel-1):
-		fid.write('[{0}, {1}, {2}],'.format(model.index[i][0],model.index[i][1],model.index[i][2]))
-	fid.write('[{0}, {1}, {2}]];\n'.format(model.index[-1][0],model.index[-1][1],model.index[-1][2]))
-	fid.write('<!--}}}-->\n')
-	print('writing model coordinates')
-	writejsfield(fid,'model["x"]',model.x,nods)
-	writejsfield(fid,'model["y"]',model.y,nods)
-	writejsfield(fid,'model["z"]',model.z,nods)
-	writejsfield(fid,'model["surface"]',model.surface,nods)
-	writejsfield(fid,'model["contourx1"]',model.contourx1,nx)
-	writejsfield(fid,'model["contoury1"]',model.contoury1,nx)
-	writejsfield(fid,'model["contourz1"]',model.contourz1,nx)
-	writejsfield(fid,'model["contourx2"]',model.contourx2,nx)
-	writejsfield(fid,'model["contoury2"]',model.contoury2,nx)
-	writejsfield(fid,'model["contourz2"]',model.contourz2,nx)
+def writejsfile(filename, model, keyname):
+    #WRITEJSFILE - write model file to javascript database
+    #
+    #   Usage:
+    #      writejsfile(filename, model, keyname)
+    #
 
-	print('writing results')
-	results=model.results
-	fid.write('results={};\n')
+    nods = len(model.x)
+    nel = len(model.index)
+    nx = len(model.contourx1)
+    print(filename)
+    fid = open(filename, 'w', 0)
 
-	for i in xrange(0,len(results)):
-		fid.write('result={};\n')
-		writejsfield(fid,'result["data"]',results[i].data,nods)
-		fid.write('<!--{{{-->\n')
-		fid.write('result["caxis"]=[{0},{1}];\n'.format(results[i].caxis[0],results[i].caxis[1]))
-		fid.write('result["label"]="{0}";\n'.format(results[i].label))
-		fid.write('result["shortlabel"]="{0}";\n'.format(results[i].shortlabel))
-		fid.write('result["unit"]="{0}";\n'.format(results[i].unit))
-		if type(results[i].data)==np.float64:
-			fid.write('result["time_range"]=[{0},{1}];\n'.format(results[i].time_range[0],results[i].time_range[1]))
-		fid.write('results["{0}"]=result;\n'.format(i))
-		fid.write('<!--}}}-->\n')
-	fid.write('model.results=results;\n')
-	fid.write('models["{0}"]=model;\n'.format(keyname))
+    fid.write('model = {};\n')
+    fid.write('model["title"] = "{0}";\n'.format(model.title))
+    fid.write('model["initialZoomFactor"]={0};\n'.format(model.initialZoomFactor))
+    #write index:
+    fid.write('<!-- model["index"]{{{-->\n')
+    fid.write('model["index"]=[')
+    for i in range(0, nel - 1):
+        fid.write('[{0},{1},{2}], '.format(model.index[i][0], model.index[i][1], model.index[i][2]))
+    fid.write('[{0},{1},{2}]];\n'.format(model.index[-1][0], model.index[-1][1], model.index[-1][2]))
+    fid.write('<!--}}}-->\n')
+    print('writing model coordinates')
+    writejsfield(fid, 'model["x"]', model.x, nods)
+    writejsfield(fid, 'model["y"]', model.y, nods)
+    writejsfield(fid, 'model["z"]', model.z, nods)
+    writejsfield(fid, 'model["surface"]', model.surface, nods)
+    writejsfield(fid, 'model["contourx1"]', model.contourx1, nx)
+    writejsfield(fid, 'model["contoury1"]', model.contoury1, nx)
+    writejsfield(fid, 'model["contourz1"]', model.contourz1, nx)
+    writejsfield(fid, 'model["contourx2"]', model.contourx2, nx)
+    writejsfield(fid, 'model["contoury2"]', model.contoury2, nx)
+    writejsfield(fid, 'model["contourz2"]', model.contourz2, nx)
 
-	fid.close()
+    print('writing results')
+    results = model.results
+    fid.write('results={};\n')
+
+    for i in range(0, len(results)):
+        fid.write('result={};\n')
+        writejsfield(fid, 'result["data"]', results[i].data, nods)
+        fid.write('<!--{{{-->\n')
+        fid.write('result["caxis"]=[{0},{1}];\n'.format(results[i].caxis[0], results[i].caxis[1]))
+        fid.write('result["label"]="{0}";\n'.format(results[i].label))
+        fid.write('result["shortlabel"]="{0}";\n'.format(results[i].shortlabel))
+        fid.write('result["unit"]="{0}";\n'.format(results[i].unit))
+        if type(results[i].data) == np.float64:
+            fid.write('result["time_range"]=[{0},{1}];\n'.format(results[i].time_range[0], results[i].time_range[1]))
+        fid.write('results["{0}"]=result;\n'.format(i))
+        fid.write('<!--}}}-->\n')
+    fid.write('model.results=results;\n')
+    fid.write('models["{0}"]=model;\n'.format(keyname))
+
+    fid.close()
Index: sm/trunk/src/m/print/printmodel.m
===================================================================
--- /issm/trunk/src/m/print/printmodel.m	(revision 24312)
+++ 	(revision )
@@ -1,98 +1,0 @@
-function printmodel(filename,format,varargin)
-%PRINTMODEL - save an image of current figure
-%
-%   filename: output name of image file (no extension)
-%   format: image format (ex: 'tiff','jpg','pdf') 
-%
-%   List of options to printfmodel: 
-%
-%   figure: number of figure to print (default: current figure)
-%   resolution: use higher resolution to anti-alias (default 2)
-%   margin: add margin around final image  
-%   marginsize: size of margin around final image (default 5)
-%   frame: add frame around final image
-%   framesize: size of frame around final image (default 5)
-%   framecolor: color of frame around final image (default 'black')
-%   trim: trim empty space around image (default 'off')
-%   hardcopy: 'off' to impose MATLAB to use the same colors (default 'off')
-%   
-%   Usage:
-%      printmodel(filename,format,varargin);
-%
-%   Examples:
-%      printmodel('image','tiff')
-%      printmodel('image','eps','margin','on','frame','on','hardcopy','on')
-
-%get options: 
-options=pairoptions(varargin{:});
-
-%set defaults
-options=addfielddefault(options,'figure','gcf');
-options=addfielddefault(options,'format','tiff');
-options=addfielddefault(options,'resolution',1);
-options=addfielddefault(options,'margin','on');
-options=addfielddefault(options,'marginsize',25);
-options=addfielddefault(options,'frame','on');
-options=addfielddefault(options,'framesize',3);
-options=addfielddefault(options,'framecolor','black');
-options=addfielddefault(options,'trim','on');
-options=addfielddefault(options,'hardcopy','off');
-
-%get fig: 
-fig=getfieldvalue(options,'figure');
-if ischar(fig),
-	fig=gcf;
-else
-	figure(fig);
-	fig=gcf;
-end
-
-%In auto mode, MATLAB prints the figure the same size as it appears on the computer screen, centered on the page
-set(fig, 'PaperPositionMode', 'auto');
-
-%InvertHardcopy off imposes MATLAB to use the same colors
-set(fig, 'InvertHardcopy', getfieldvalue(options,'hardcopy'));
-
-%we could have several formats, as a cell array of strings.
-formats=format;
-if ~iscell(formats),
-	formats={formats};
-end
-
-%loop on formats:
-for i=1:length(formats),
-	format=formats{i};
-
-	%Use higher resolution to anti-alias and use zbuffer to have smooth colors
-	print(fig, '-zbuffer','-dtiff',['-r' num2str(get(0,'ScreenPixelsPerInch')*getfieldvalue(options,'resolution'))],filename);
-
-	%some trimming involved? 
-	if ~strcmpi(format,'pdf'),
-		if strcmpi(getfieldvalue(options,'trim'),'on'),
-			system(['convert -trim ' filename '.tif ' filename '.tif']);
-		end
-	end
-
-	%margin?
-	if ~strcmpi(format,'pdf'),
-		if strcmpi(getfieldvalue(options,'margin'),'on'),
-			marginsize=getfieldvalue(options,'marginsize');
-			system(['convert -border ' num2str(marginsize) 'x' num2str(marginsize) ' -bordercolor "white" ' filename '.tif ' filename '.tif']);
-		end
-	end
-
-	%frame?
-	if ~strcmpi(format,'pdf'),
-		if strcmpi(getfieldvalue(options,'frame'),'on'),
-			framesize=getfieldvalue(options,'framesize');
-			framecolor=getfieldvalue(options,'framecolor');
-			system(['convert -border ' num2str(framesize) 'x' num2str(framesize) ' -bordercolor "' framecolor '" ' filename '.tif ' filename '.tif']);
-		end
-	end
-
-	%convert image to correct format
-	if ~strcmpi(format,'tiff') & ~strcmpi(format,'tif'),
-		system(['convert ' filename '.tif ' filename '.' format]);
-		delete([ filename '.tif']);
-	end
-end
Index: sm/trunk/src/m/print/printmodel.py
===================================================================
--- /issm/trunk/src/m/print/printmodel.py	(revision 24312)
+++ 	(revision )
@@ -1,109 +1,0 @@
-
-import numpy as np
-#from model import *
-#from socket import gethostname
-#from bamg import *
-#from setmask import *
-#from parameterize import *
-#from setflowequation import *
-#from solve import *
-from pairoptions import *
-
-def printmodel(filename,format,*args):
-'''	PRINTMODEL - save an image of current figure
-
-	filename: output name of image file (no extension)
-	format: image format (ex: 'tiff','jpg','pdf') 
-
-	List of options to printfmodel: 
-
-	figure: number of figure to print (default: current figure)
-	resolution: use higher resolution to anti-alias (default 2)
-	margin: add margin around final image  
-	marginsize: size of margin around final image (default 5)
-	frame: add frame around final image
-	framesize: size of frame around final image (default 5)
-	framecolor: color of frame around final image (default 'black')
-	trim: trim empty space around image (default 'off')
-	hardcopy: 'off' to impose MATLAB to use the same colors (default 'off')
-   
-	Usage:
-		printmodel(filename,format,varargin);
-
-	Examples:
-		printmodel('image','tiff')
-		printmodel('image','eps','margin','on','frame','on','hardcopy','on')
-'''
-
-#get options: 
-options = pairoptions(*args)
-
-#set defaults
-options = addfielddefault(options,'figure','gcf')
-options = addfielddefault(options,'format','tiff')
-options = addfielddefault(options,'resolution',1)
-options = addfielddefault(options,'margin','on')
-options = addfielddefault(options,'marginsize',25)
-options = addfielddefault(options,'frame','on')
-options = addfielddefault(options,'framesize',3)
-options = addfielddefault(options,'framecolor','black')
-options = addfielddefault(options,'trim','on')
-options = addfielddefault(options,'hardcopy','off')
-
-#get fig: 
-fig = getfieldvalue(options,'figure')
-if len(fig) == 1:
-	fig=gcf
-else:
-	figure(fig)
-	fig=gcf
-
-#In auto mode, MATLAB prints the figure the same size as it appears on the computer screen, centered on the page
-set(fig, 'PaperPositionMode', 'auto');
-
-#InvertHardcopy off imposes MATLAB to use the same colors
-set(fig, 'InvertHardcopy', getfieldvalue(options,'hardcopy'));
-
-#we could have several formats, as a cell array of strings.
-formats=format;
-if ~iscell(formats),
-	formats={formats};
-end
-
-#loop on formats:
-for i=1:length(formats),
-	format=formats{i};
-
-	#Use higher resolution to anti-alias and use zbuffer to have smooth colors
-	print(fig, '-zbuffer','-dtiff',['-r' num2str(get(0,'ScreenPixelsPerInch')*getfieldvalue(options,'resolution'))],filename);
-
-	#some trimming involved? 
-	if ~strcmpi(format,'pdf'),
-		if strcmpi(getfieldvalue(options,'trim'),'on'),
-			system(['convert -trim ' filename '.tif ' filename '.tif']);
-		end
-	end
-
-	#margin?
-	if ~strcmpi(format,'pdf'),
-		if strcmpi(getfieldvalue(options,'margin'),'on'),
-			marginsize=getfieldvalue(options,'marginsize');
-			system(['convert -border ' num2str(marginsize) 'x' num2str(marginsize) ' -bordercolor "white" ' filename '.tif ' filename '.tif']);
-		end
-	end
-
-	#frame?
-	if ~strcmpi(format,'pdf'),
-		if strcmpi(getfieldvalue(options,'frame'),'on'),
-			framesize=getfieldvalue(options,'framesize');
-			framecolor=getfieldvalue(options,'framecolor');
-			system(['convert -border ' num2str(framesize) 'x' num2str(framesize) ' -bordercolor "' framecolor '" ' filename '.tif ' filename '.tif']);
-		end
-	end
-
-	#convert image to correct format
-	if ~strcmpi(format,'tiff') & ~strcmpi(format,'tif'),
-		system(['convert ' filename '.tif ' filename '.' format]);
-		delete([ filename '.tif']);
-	end
-end
Index: /issm/trunk/src/m/qmu/dakota_in_data.py
===================================================================
--- /issm/trunk/src/m/qmu/dakota_in_data.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/dakota_in_data.py	(revision 24313)
@@ -6,9 +6,10 @@
 from MatlabFuncs import *
 
-def dakota_in_data(dmeth,variables,responses,dparams,filei,*args):
-	'''
+
+def dakota_in_data(dmeth, variables, responses, dparams, filei, *args):
+    '''
   define the data to write the dakota .in and .m files.
 
-  []=dakota_in_data(dmeth,variables,responses,dparams,filei,*args)
+  [] = dakota_in_data(dmeth, variables, responses, dparams, filei, *args)
 
   where the required input is:
@@ -16,5 +17,5 @@
     variables     (structure array, variable class objects)
     responses     (structure array, response class objects)
-    dparams       (structure array, method-independent parameters)
+    dparams       (structure array, method - independent parameters)
     filei         (character, name of .in and .m files)
 
@@ -29,5 +30,5 @@
   it collects the parameters and applies some defaults that
   are unique to the environment.  second, some analysis package
-  variables and/or responses may be treated differently by
+  variables and / or responses may be treated differently by
   dakota.  for example, an analysis package variable may be
   defined as an array, so the QmuSetupDesign brancher will
@@ -42,49 +43,46 @@
 '''
 
-	##  parameters
-	#  get default set of parameters
-	params=dakota_in_params(struct())
+    #  parameters
+    #  get default set of parameters
+    params = dakota_in_params(struct())
+    #  merge specified parameters into default set, whether or not
+    #  they already exist
+    fnames = fieldnames(dparams)
 
-	#  merge specified parameters into default set, whether or not
-	#  they already exist
-	fnames=fieldnames(dparams)
+    for fieldname in fnames:
+        if not isfield(params, fieldname):
+            print('WARNING: dakota_in_data:unknown_param: No parameter {} in default parameter set.'.format(str(fieldname)))
+        exec('params.{} = vars(dparams)[fieldname]'.format(fieldname))
 
-	for i in range(np.size(fnames)):
-		if not isfield(params,fnames[i]):
-			print 'WARNING: dakota_in_data:unknown_param: No parameter '+str(fnames[i])+' in default parameter set.'	
-			
-	    	exec('params.%s = vars(dparams)[fnames[i]]')%(fnames[i])
+    # use matlab even though we are running python
+    if params.direct and params.analysis_driver == '':
+        params.analysis_driver = 'matlab'
 
-	# use matlab even though we are running python
-	if params.direct and params.analysis_driver == '':
-		params.analysis_driver='matlab'
+    if strcmpi(params.analysis_driver, 'matlab') and params.analysis_components == '':
+        [pathstr, name, ext] = fileparts(filei)
+        params.analysis_components = fullfile(pathstr, name + '.py')
 
-	if strcmpi(params.analysis_driver,'matlab') and params.analysis_components == '':
-		[pathstr,name,ext] = fileparts(filei)
-		params.analysis_components=fullfile(pathstr,name+'.py')
+    #  merge method parameters, though they shouldn't be in dparams
+    # dmeth = dmeth_params_merge(dmeth, dparams)
 
-	#  merge method parameters, though they shouldn't be in dparams
-	# dmeth=dmeth_params_merge(dmeth,dparams)
+    #  variables
+    fnames = fieldnames(variables)
 
-	##  variables
-	fnames=fieldnames(variables)
+    # works like matlab arbitrary structs / classes, remembers order of input attributes
+    dvar = OrderedStruct()
+    dresp = OrderedStruct()
 
-	# works like matlab arbitrary structs/classes, remembers order of input attributes
-	dvar = OrderedStruct()
-	dresp = OrderedStruct()
+    for i in range(len(fnames)):
+        # currently all variable types can just be copied
+        exec(('dvar.%s = vars(variables)[fnames[i]]') % (fnames[i]))
 
-	for i in range(len(fnames)):
-		# currently all variable types can just be copied
-		exec('dvar.%s = vars(variables)[fnames[i]]')%(fnames[i])
+    #  responses
+    fnames = fieldnames(responses)
 
-	##  responses
-	fnames=fieldnames(responses)
+    for i in range(len(fnames)):
+        #  currently all response types can just be copied
+        exec(('dresp.%s = vars(responses)[fnames[i]]') % (fnames[i]))
 
-	for i in range(len(fnames)):
-		#  currently all response types can just be copied
-		exec('dresp.%s = vars(responses)[fnames[i]]')%(fnames[i])
-
-
-	##  write files
-	#Write in file
-	dakota_in_write(dmeth,dvar,dresp,params,filei,*args)
+    #  write files
+    #Write in file
+    dakota_in_write(dmeth, dvar, dresp, params, filei, *args)
Index: /issm/trunk/src/m/qmu/dakota_in_params.py
===================================================================
--- /issm/trunk/src/m/qmu/dakota_in_params.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/dakota_in_params.py	(revision 24313)
@@ -1,19 +1,19 @@
 from dakota_in_data import *
-
 #move this later:
 from helpers import *
 
+
 def dakota_in_params(params):
-	'''
+    '''
   populate a Dakota parameter structure.
 
-  params=dakota_in_params(params)
+  params = dakota_in_params(params)
 
   where the optional input is:
-    params        (structure array, method-independent parameters)
+    params        (structure array, method - independent parameters)
 
   and the output is the same.
 
-  this function takes a structure of method-independent dakota
+  this function takes a structure of method - independent dakota
   parameters, which may be empty, and adds default parameters
   for those parameters which do not exist.
@@ -25,160 +25,159 @@
   or absence.
 
-  note that the method-dependent parameters are contained in
+  note that the method - dependent parameters are contained in
   the dakota_method class object.
 '''
-	if params == None:
-		help(dakota_in_params)
-		return
+    if params is None:
+        help(dakota_in_params)
+        return
 
-	##  process the input parameters
-	if len(fieldnames(params)) == 0:
-		params=struct()
+    #  process the input parameters
+    if len(fieldnames(params)) == 0:
+        params = struct()
 
-	##  strategy section
-	if not isfield(params,'graphics'):
-		params.graphics=False
+    #  strategy section
+    if not isfield(params, 'graphics'):
+        params.graphics = False
 
-	if not isfield(params,'tabular_graphics_data'):
-		params.tabular_graphics_data=False
+    if not isfield(params, 'tabular_graphics_data'):
+        params.tabular_graphics_data = False
 
-	# could use unique file name rather than 'dakota_tabular.dat'
-	if not isfield(params,'tabular_graphics_file'):
-		params.tabular_graphics_file=False
+    # could use unique file name rather than 'dakota_tabular.dat'
+    if not isfield(params, 'tabular_graphics_file'):
+        params.tabular_graphics_file = False
 
-	##  method section
-	#  nearly all method parameters are in the dakota_method class
-	#  or result from the response level lists
-	if not isfield(params,'compute'):
-		params.compute='probabilities'
+    #  method section
+    #  nearly all method parameters are in the dakota_method class
+    #  or result from the response level lists
+    if not isfield(params, 'compute'):
+        params.compute = 'probabilities'
 
-	if not isfield(params,'distribution'):
-		params.distribution='cumulative'
+    if not isfield(params, 'distribution'):
+        params.distribution = 'cumulative'
 
-	##  model section
+    #  model section
 
-	##  interface section
-	if not isfield(params,'system'):
-		params.system=False
+    #  interface section
+    if not isfield(params, 'system'):
+        params.system = False
 
-	if not isfield(params,'fork'):
-		params.fork=False
+    if not isfield(params, 'fork'):
+        params.fork = False
 
-	if not isfield(params,'direct'):
-		params.direct=False
+    if not isfield(params, 'direct'):
+        params.direct = False
 
-	#  interface parallelism controls
-	if not isfield(params,'asynchronous'):
-		params.asynchronous=True
+    #  interface parallelism controls
+    if not isfield(params, 'asynchronous'):
+        params.asynchronous = True
 
-	if not isfield(params,'evaluation_concurrency'):
-		params.evaluation_concurrency=False
+    if not isfield(params, 'evaluation_concurrency'):
+        params.evaluation_concurrency = False
 
-	if not isfield(params,'analysis_concurrency'):
-		params.analysis_concurrency=False
+    if not isfield(params, 'analysis_concurrency'):
+        params.analysis_concurrency = False
 
-	if not isfield(params,'evaluation_servers'):
-		params.evaluation_servers=False
+    if not isfield(params, 'evaluation_servers'):
+        params.evaluation_servers = False
 
-	if not isfield(params,'evaluation_self_scheduling'):
-		params.evaluation_self_scheduling=False
+    if not isfield(params, 'evaluation_self_scheduling'):
+        params.evaluation_self_scheduling = False
 
-	if not isfield(params,'evaluation_static_scheduling'):
-		params.evaluation_static_scheduling=True
+    if not isfield(params, 'evaluation_static_scheduling'):
+        params.evaluation_static_scheduling = True
 
-	if not isfield(params,'evaluation_scheduling'):
-		params.evaluation_scheduling=False
+    if not isfield(params, 'evaluation_scheduling'):
+        params.evaluation_scheduling = False
 
-	if not isfield(params,'processors_per_evaluation'):
-		params.processors_per_evaluation=False
+    if not isfield(params, 'processors_per_evaluation'):
+        params.processors_per_evaluation = False
 
-	if not isfield(params,'analysis_servers'):
-		params.analysis_servers=False
+    if not isfield(params, 'analysis_servers'):
+        params.analysis_servers = False
 
-	if not isfield(params,'analysis_self_scheduling'):
-		params.analysis_self_scheduling=False
+    if not isfield(params, 'analysis_self_scheduling'):
+        params.analysis_self_scheduling = False
 
-	if not isfield(params,'analysis_static_scheduling'):
-		params.analysis_static_scheduling=False
+    if not isfield(params, 'analysis_static_scheduling'):
+        params.analysis_static_scheduling = False
 
-	#  algebraic mappings
-	if not isfield(params,'algebraic_mappings'):
-		params.algebraic_mappings=False
+    #  algebraic mappings
+    if not isfield(params, 'algebraic_mappings'):
+        params.algebraic_mappings = False
 
-	#  simulation interface controls
-	if not isfield(params,'analysis_driver'):
-		params.analysis_driver=''
+    #  simulation interface controls
+    if not isfield(params, 'analysis_driver'):
+        params.analysis_driver = ''
 
-	if not isfield(params,'analysis_components'):
-		params.analysis_components=''
+    if not isfield(params, 'analysis_components'):
+        params.analysis_components = ''
 
-	if not isfield(params,'input_filter'):
-		params.input_filter=''
+    if not isfield(params, 'input_filter'):
+        params.input_filter = ''
 
-	if not isfield(params,'output_filter'):
-		params.output_filter=''
+    if not isfield(params, 'output_filter'):
+        params.output_filter = ''
 
-	if not isfield(params,'failure_capture'):
-		params.failure_capture='abort'
+    if not isfield(params, 'failure_capture'):
+        params.failure_capture = 'abort'
 
-	if not isfield(params,'deactivate'):
-		params.deactivate='evaluation_cache restart_file'
+    if not isfield(params, 'deactivate'):
+        params.deactivate = 'evaluation_cache restart_file'
 
-	#  system call or fork interface
-	if not isfield(params,'parameters_file'):
-		params.parameters_file='params.in'
+    #  system call or fork interface
+    if not isfield(params, 'parameters_file'):
+        params.parameters_file = 'params.in'
 
-	if not isfield(params,'results_file'):
-		params.results_file='results.out'
+    if not isfield(params, 'results_file'):
+        params.results_file = 'results.out'
 
-	if not isfield(params,'verbatim'):
-		params.verbatim=False
+    if not isfield(params, 'verbatim'):
+        params.verbatim = False
 
-	if not isfield(params,'aprepro'):
-		params.aprepro=False
+    if not isfield(params, 'aprepro'):
+        params.aprepro = False
 
-	if not isfield(params,'file_tag'):
-		params.file_tag=True
+    if not isfield(params, 'file_tag'):
+        params.file_tag = True
 
-	if not isfield(params,'file_save'):
-		params.file_save=True
+    if not isfield(params, 'file_save'):
+        params.file_save = True
 
-	#  direct function interface
-	if not isfield(params,'processors_per_analysis'):
-		params.processors_per_analysis=False
+    #  direct function interface
+    if not isfield(params, 'processors_per_analysis'):
+        params.processors_per_analysis = False
 
-	##  responses section
-	if not isfield(params,'numerical_gradients'):
-		params.numerical_gradients=False
+    #  responses section
+    if not isfield(params, 'numerical_gradients'):
+        params.numerical_gradients = False
 
-	if not isfield(params,'method_source'):
-		params.method_source='dakota'
+    if not isfield(params, 'method_source'):
+        params.method_source = 'dakota'
 
-	if not isfield(params,'interval_type'):
-		params.interval_type='forward'
+    if not isfield(params, 'interval_type'):
+        params.interval_type = 'forward'
 
-	if not isfield(params,'fd_gradient_step_size'):
-		params.fd_gradient_step_size=0.001
+    if not isfield(params, 'fd_gradient_step_size'):
+        params.fd_gradient_step_size = 0.001
 
-	if not isfield(params,'analytic_gradients'):
-		params.analytic_gradients=False
+    if not isfield(params, 'analytic_gradients'):
+        params.analytic_gradients = False
 
-	#  mixed_gradients not fully implemented
-	if not isfield(params,'mixed_gradients'):
-		params.mixed_gradients=False
+    #  mixed_gradients not fully implemented
+    if not isfield(params, 'mixed_gradients'):
+        params.mixed_gradients = False
 
-	if not isfield(params,'id_analytic_gradients'):
-		params.id_analytic_gradients=False
+    if not isfield(params, 'id_analytic_gradients'):
+        params.id_analytic_gradients = False
 
-	if not isfield(params,'id_numerical_gradients'):
-		params.id_numerical_gradients=False
+    if not isfield(params, 'id_numerical_gradients'):
+        params.id_numerical_gradients = False
 
-	#  hessians not fully implemented
-	if not isfield(params,'numerical_hessians'):
-		params.numerical_hessians=True
+    #  hessians not fully implemented
+    if not isfield(params, 'numerical_hessians'):
+        params.numerical_hessians = True
 
-	if not isfield(params,'hessian_gradient_step_size'):
-		params.hessian_gradient_step_size=0.001
+    if not isfield(params, 'hessian_gradient_step_size'):
+        params.hessian_gradient_step_size = 0.001
 
-	return params
-
+    return params
Index: /issm/trunk/src/m/qmu/dakota_in_write.py
===================================================================
--- /issm/trunk/src/m/qmu/dakota_in_write.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/dakota_in_write.py	(revision 24313)
@@ -11,10 +11,11 @@
 import itertools
 
-def dakota_in_write(method,dvar,dresp,params,filei,*args):
-	'''
+
+def dakota_in_write(method, dvar, dresp, params, filei, *args):
+    '''
   write a Dakota .in input file.
 
-  []=dakota_in_write(method,dvar,dresp,params,filei,args)
-  []=dakota_in_write(dmeth ,dvar,dresp,params,filei,args)
+  [] = dakota_in_write(method, dvar, dresp, params, filei, args)
+  [] = dakota_in_write(dmeth , dvar, dresp, params, filei, args)
 
   where the required input is:
@@ -23,5 +24,5 @@
     dvar          (structure array, variable class objects)
     dresp         (structure array, response class objects)
-    params        (structure array, method-indepent parameters)
+    params        (structure array, method - indepent parameters)
     filei         (character, name of .in file)
 
@@ -41,293 +42,277 @@
 '''
 
-	#  process the input parameters
-	if len(fieldnames(method)) == 0:
-		method=str(input('Method?  '))
-
-	if type(method) == str:
-		dmeth=dakota_method(method)
-	elif isinstance(method,dakota_method):
-		dmeth=method
-	else:
-		raise RuntimeError('Method '+str(method)+' is unrecognized class '+str(type(method))+'. (should be either "str" or "dakota_method")')
-
-	if len(filei) == 0:
-		filei=str(input('Dakota input file to write?  '))
-
-	[pathstr,name,ext] = fileparts(filei)
-	if len(ext) == 0:
-	# fileparts only considers '.in' to be the extension, not '.qmu.in'
-		ext='.qmu.in'
-
-	filei2=fullfile(pathstr,name+ext)
-
-	print 'Opening Dakota input file \''+filei2 + '\'.'
-	try:
-		with open(filei2,'w+') as fidi:
-
-			if len(fieldnames(params)) == 0:
-				params=struct()
-
-			params=dakota_in_params(params)
-
-			#  write the strategy section
-			if float(IssmConfig('_DAKOTA_VERSION_')[0]) < 6:
-				strategy_write(fidi,params)
-			else:
-				environment_write(fidi,params)
-
-			#  write the method section
-			method_write(fidi,dmeth,dresp,params)
-
-			#  write the model section
-			model_write(fidi)
-
-			#  write the variables section
-			variables_write(fidi,dmeth,dvar)
-
-			#  write the interface section
-			interface_write(fidi,params)
-
-			#  write the responses section
-			responses_write(fidi,dmeth,dresp,params)
-
-	except IOError:
-		print filei2 + ' could not be opened.'
-
-	print 'End of file successfully written.'
-
-
-##  function to write the strategy section of the file
-
-def strategy_write(fidi,params):
-
-	print 'Writing strategy section of Dakota input file.'
-
-	fidi.write('strategy,\n')
-	fidi.write('\tsingle_method\n\n')
-	param_write(fidi,'\t  ','graphics','','\n',params)
-	param_write(fidi,'\t  ','tabular_graphics_data','','\n',params)
-	param_write(fidi,'\t  ','tabular_graphics_file',' ','\n',params)
-	fidi.write('\n')
-
-
-##  function to write the environment section of the file
-
-def environment_write(fidi,params):
-
-	print 'Writing environment section of Dakota input file.'
-
-	fidi.write('environment,\n')
-	param_write(fidi,'\t  ','graphics','','\n',params)
-	param_write(fidi,'\t  ','tabular_graphics_data','','\n',params)
-	param_write(fidi,'\t  ','tabular_graphics_file',' ','\n',params)
-	fidi.write('\n')
-
-
-##  function to write the method section of the file
-
-def method_write(fidi,dmeth,dresp,params):
-
-	print 'Writing method section of Dakota input file.'
-
-	fidi.write('method,\n')
-	fidi.write('\t'+str(dmeth.method)+'\n')
-
-	dmeth_params_write(dmeth,fidi)
-
-	#  write response levels
-
-	if strcmp(dmeth.type,'nond'):
-		for i in range(len(dmeth.responses)):
-			str_name = dmeth.responses[i]
-			resp = eval("{}.{}()".format(str_name,str_name))
-			resp.dakota_rlev_write(fidi,dresp,params)
-
-	fidi.write('\n')
-
-
-##  function to write the model section of the file
-
+    #  process the input parameters
+    if len(fieldnames(method)) == 0:
+        method = str(eval(input('Method?  ')))
+
+    if type(method) == str:
+        dmeth = dakota_method(method)
+    elif isinstance(method, dakota_method):
+        dmeth = method
+    else:
+        raise RuntimeError('Method ' + str(method) + ' is unrecognized class ' + str(type(method)) + '. (should be either "str" or "dakota_method")')
+
+    if len(filei) == 0:
+        filei = str(eval(input('Dakota input file to write?  ')))
+
+    [pathstr, name, ext] = fileparts(filei)
+    if len(ext) == 0:
+        # fileparts only considers '.in' to be the extension, not '.qmu.in'
+        ext = '.qmu.in'
+
+    filei2 = fullfile(pathstr, name + ext)
+
+    print('Opening Dakota input file \'' + filei2 + '\'.')
+    try:
+        with open(filei2, 'w+') as fidi:
+
+            if len(fieldnames(params)) == 0:
+                params = struct()
+
+            params = dakota_in_params(params)
+
+            #  write the strategy section
+            if float(IssmConfig('_DAKOTA_VERSION_')[0]) < 6:
+                strategy_write(fidi, params)
+            else:
+                environment_write(fidi, params)
+
+            #  write the method section
+            method_write(fidi, dmeth, dresp, params)
+            #  write the model section
+            model_write(fidi)
+            #  write the variables section
+            variables_write(fidi, dmeth, dvar)
+            #  write the interface section
+            interface_write(fidi, params)
+            #  write the responses section
+            responses_write(fidi, dmeth, dresp, params)
+
+    except IOError:
+        print(filei2 + ' could not be opened.')
+
+    print('End of file successfully written.')
+
+
+#  function to write the strategy section of the file
+def strategy_write(fidi, params):
+
+    print('Writing strategy section of Dakota input file.')
+
+    fidi.write('strategy, \n')
+    fidi.write('\tsingle_method\n\n')
+    param_write(fidi, '\t  ', 'graphics', '', '\n', params)
+    param_write(fidi, '\t  ', 'tabular_graphics_data', '', '\n', params)
+    param_write(fidi, '\t  ', 'tabular_graphics_file', ' ', '\n', params)
+    fidi.write('\n')
+
+
+#  function to write the environment section of the file
+def environment_write(fidi, params):
+
+    print('Writing environment section of Dakota input file.')
+
+    fidi.write('environment, \n')
+    param_write(fidi, '\t  ', 'graphics', '', '\n', params)
+    param_write(fidi, '\t  ', 'tabular_graphics_data', '', '\n', params)
+    param_write(fidi, '\t  ', 'tabular_graphics_file', ' ', '\n', params)
+    fidi.write('\n')
+
+
+#  function to write the method section of the file
+def method_write(fidi, dmeth, dresp, params):
+
+    print('Writing method section of Dakota input file.')
+
+    fidi.write('method, \n')
+    fidi.write('\t' + str(dmeth.method) + '\n')
+
+    dmeth_params_write(dmeth, fidi)
+
+    #  write response levels
+
+    if strcmp(dmeth.type, 'nond'):
+        for i in range(len(dmeth.responses)):
+            str_name = dmeth.responses[i]
+            resp = eval("{}.{}()".format(str_name, str_name))
+            resp.dakota_rlev_write(fidi, dresp, params)
+
+    fidi.write('\n')
+
+
+#  function to write the model section of the file
 def model_write(fidi):
 
-	print 'Writing model section of Dakota input file.'
-
-	fidi.write('model,\n')
-	fidi.write('\tsingle\n\n')
-
-
-##  function to write the variables section of the file
-
-def variables_write(fidi,dmeth,dvar):
-
-	print 'Writing variables section of Dakota input file.'
-
-	fidi.write('variables,\n')
-
-	#  variables vary by method
-	fd = fieldnames(dvar)
-	types = []
-	var = []
-	for i in range(len(fd)):
-		i_type = eval('dvar.{}[0].__class__.__name__'.format(fd[i]))
-		j = dmeth.variables.index(i_type)
-		str_name = dmeth.variables[j]
-
-		# organize so that multiple instances of the same qmu class 
-		# (2 different variable instances of "normal_uncertain" for example)  
-		# are in the same dakota_write call regardless of individual size;
-		# but that each class has its own dakota_write call
-		if str_name not in types:
-			types.append(str_name)
-			var.append(eval('dvar.{}'.format(fd[i])))
-		else:
-			t = types.index(str_name)
-			var[t].extend(eval('dvar.{}'.format(fd[i])))
-
-	for t in range(len(types)):
-		v = eval('{}.{}()'.format(types[t],types[t]))
-		v.dakota_write(fidi,var[t])
-
-	#  linear constraints vary by method
-	fc = dmeth.lcspec
-
-	for i in range(len(dmeth.lcspec)):
-		str_name = dmeth.lcspec[i]
-		var = eval('{}.{}()'.format(str_name,str_name))
-		# check that str_name is correct against matlab version which has no argument there
-		var.dakota_write(fidi,eval('dvar.{}[i]'.format(j)),str_name)
-
-	fidi.write('\n')
-
-
-##  function to write the interface section of the file
-
-def interface_write(fidi,params):
-
-	print 'Writing interface section of Dakota input file.'
-
-	fidi.write('interface,\n')
-
-	if (not params.system) and (not params.fork) and (not params.direct):
-		params.fork=True
-	elif params.system+params.fork+params.direct > 1:
-		raise RuntimeError('Too many interfaces selected.')
-
-	if params.system or params.fork:
-		param_write(fidi,'\t','asynchronous','','\n',params)
-		param_write(fidi,'\t  ','evaluation_concurrency',' = ','\n',params)
-		param_write(fidi,'\t  ','analysis_concurrency','   = ','\n',params)
-		param_write(fidi,'\t  ','evaluation_servers','     = ','\n',params)
-		param_write(fidi,'\t  ','evaluation_self_scheduling','','\n',params)
-		param_write(fidi,'\t  ','evaluation_static_scheduling','','\n',params)
-		param_write(fidi,'\t  ','analysis_servers','       = ','\n',params)
-		param_write(fidi,'\t  ','analysis_self_scheduling','','\n',params)
-		param_write(fidi,'\t  ','analysis_static_scheduling','','\n',params)
-		param_write(fidi,'\t','algebraic_mappings',' = ','\n',params)
-		param_write(fidi,'\t','system','','\n',params)
-		param_write(fidi,'\t','fork','','\n',params)
-		param_write(fidi,'\t  ','analysis_driver',' = \'','\'\n',params)
-		if len(params.input_filter) != 0:
-			param_write(fidi,'\t  ','input_filter','    = ','\n',params)
-		
-		if len(params.output_filter) != 0:
-			param_write(fidi,'\t  ','output_filter','   = ','\n',params)
-		
-		param_write(fidi,'\t  ','failure_capture','   ','\n',params)
-		param_write(fidi,'\t  ','deactivate','        ','\n',params)
-		param_write(fidi,'\t  ','parameters_file',' = ','\n',params)
-		param_write(fidi,'\t  ','results_file','    = ','\n',params)
-		param_write(fidi,'\t  ','verbatim', '','\n',params)
-		param_write(fidi,'\t  ','aprepro', '','\n',params)
-		param_write(fidi,'\t  ','file_tag', '','\n',params)
-		param_write(fidi,'\t  ','file_save','','\n',params)
-	elif params.direct:
-	#  Error: asynchronous capability not yet supported in direct interfaces.
-	#  Update: it is now possible to run in parallel in direct interfaces.
-		param_write(fidi,'\t','algebraic_mappings',' = ','\n',params)
-		param_write(fidi,'\t','direct','','\n',params)
-		param_write(fidi,'\t  ','analysis_driver','     = \'','\'\n',params)
-		if IssmConfig('_DAKOTA_VERSION_') < 6:
-			param_write(fidi,'\t  ','evaluation_static_scheduling','','\n',params)
-		else:
-			param_write(fidi,'\t  ','evaluation_scheduling',' ','\n',params)
-			param_write(fidi,'\t  ','processors_per_evaluation',' = ','\n',params)
-		if len(params.analysis_components) != 0:
-			[pathstr,name,ext] = fileparts(params.analysis_components)
-			if ext != '':
-				ext='.py'
-		
-			params.analysis_components=fullfile(pathstr,name+ext)
-			param_write(fidi,'\t  ','analysis_components',' = \'','\'\n',params)
-		
-		if len(params.input_filter) != 0:
-			param_write(fidi,'\t  ','input_filter','    = ','\n',params)
-		
-		if len(params.output_filter) != 0:
-			param_write(fidi,'\t  ','output_filter','   = ','\n',params)
-		
-		param_write(fidi,'\t  ','failure_capture','   ','\n',params)
-		param_write(fidi,'\t  ','deactivate','        ','\n',params)
-		param_write(fidi,'\t  ','processors_per_analysis',' = ','\n',params)
-
-	fidi.write('\n')
-
-
-##  function to write the responses section of the file
-
-def responses_write(fidi,dmeth,dresp,params):
-
-	print 'Writing responses section of Dakota input file.'
-
-	fidi.write('responses,\n')
-	#fidi.write('calibration_terms = 1 \n')
-
-	#  functions, gradients, and hessians vary by method
-
-	rdesc=[]
-
-	for i in range(len(dmeth.responses)):
-		resp = eval(dmeth.responses[i])
-		rdesc = resp.dakota_write(fidi,dresp,rdesc)
-
-	#  write accumulated response descriptors for all response classes
-
-	if len(rdesc) != 0:
-		fidi.write('\tresponse_descriptors =\n')
-		vector_write(fidi,'\t  ',rdesc,6,76)
-
-	ghspec_write(fidi,params,dmeth.ghspec)
-
-	fidi.write('\n')
-
-
-##  function to write gradient and hessian specifications
-
-def ghspec_write(fidi,params,ghspec):
-
-	#  gradients
-	if 'grad' in ghspec:
-		if (not params.numerical_gradients) and (not params.analytic_gradients):
-			params.numerical_gradients=True
-		elif (params.numerical_gradients+params.analytic_gradients > 1):
-			raise RuntimeError('Too many gradients selected.')
-		
-		if params.numerical_gradients:
-			param_write(fidi,'\t','numerical_gradients','','\n',params)
-			param_write(fidi,'\t  ','method_source',' ','\n',params)
-			param_write(fidi,'\t  ','interval_type',' ','\n',params)
-			param_write(fidi,'\t  ','fd_gradient_step_size',' = ','\n',params)
-		elif params.analytic_gradients:
-			param_write(fidi,'\t','analytic_gradients','','\n',params)
-	#	elif params.mixed_gradients
-	else:
-		fidi.write('\tno_gradients\n')
-
-	#  hessians (no implemented methods use them yet)
-	if 'hess' in ghspec:
-		raise RuntimeError('Hessians needed by method but not provided.')
-	else:
-		fidi.write('\tno_hessians\n')
-
-
-
+    print('Writing model section of Dakota input file.')
+
+    fidi.write('model, \n')
+    fidi.write('\tsingle\n\n')
+
+
+#  function to write the variables section of the file
+def variables_write(fidi, dmeth, dvar):
+
+    print('Writing variables section of Dakota input file.')
+
+    fidi.write('variables, \n')
+
+    #  variables vary by method
+    fd = fieldnames(dvar)
+    types = []
+    var = []
+    for i in range(len(fd)):
+        i_type = eval('dvar.{}[0].__class__.__name__'.format(fd[i]))
+        j = dmeth.variables.index(i_type)
+        str_name = dmeth.variables[j]
+
+    # organize so that multiple instances of the same qmu class
+    # (2 different variable instances of "normal_uncertain" for example)
+    # are in the same dakota_write call regardless of individual size
+    # but that each class has its own dakota_write call
+        if str_name not in types:
+            types.append(str_name)
+            var.append(eval('dvar.{}'.format(fd[i])))
+        else:
+            t = types.index(str_name)
+            var[t].extend(eval('dvar.{}'.format(fd[i])))
+
+    for t in range(len(types)):
+        v = eval('{}.{}()'.format(types[t], types[t]))
+        v.dakota_write(fidi, var[t])
+
+    #  linear constraints vary by method
+    fc = dmeth.lcspec
+
+    for i in range(len(dmeth.lcspec)):
+        str_name = dmeth.lcspec[i]
+        var = eval('{}.{}()'.format(str_name, str_name))
+    # check that str_name is correct against matlab version which has no argument there
+        var.dakota_write(fidi, eval('dvar.{}[i]'.format(j)), str_name)
+
+    fidi.write('\n')
+
+
+#  function to write the interface section of the file
+def interface_write(fidi, params):
+
+    print('Writing interface section of Dakota input file.')
+
+    fidi.write('interface, \n')
+
+    if (not params.system) and (not params.fork) and (not params.direct):
+        params.fork = True
+    elif params.system + params.fork + params.direct > 1:
+        raise RuntimeError('Too many interfaces selected.')
+    if params.system or params.fork:
+        param_write(fidi, '\t', 'asynchronous', '', '\n', params)
+        param_write(fidi, '\t  ', 'evaluation_concurrency', '=', '\n', params)
+        param_write(fidi, '\t  ', 'analysis_concurrency', '=', '\n', params)
+        param_write(fidi, '\t  ', 'evaluation_servers', '=', '\n', params)
+        param_write(fidi, '\t  ', 'evaluation_self_scheduling', '', '\n', params)
+        param_write(fidi, '\t  ', 'evaluation_static_scheduling', '', '\n', params)
+        param_write(fidi, '\t  ', 'analysis_servers', '=', '\n', params)
+        param_write(fidi, '\t  ', 'analysis_self_scheduling', '', '\n', params)
+        param_write(fidi, '\t  ', 'analysis_static_scheduling', '', '\n', params)
+        param_write(fidi, '\t', 'algebraic_mappings', '=', '\n', params)
+        param_write(fidi, '\t', 'system', '', '\n', params)
+        param_write(fidi, '\t', 'fork', '', '\n', params)
+        param_write(fidi, '\t  ', 'analysis_driver', ' = \'', '\'\n', params)
+        if len(params.input_filter) != 0:
+            param_write(fidi, '\t  ', 'input_filter', '=', '\n', params)
+
+        if len(params.output_filter) != 0:
+            param_write(fidi, '\t  ', 'output_filter', '=', '\n', params)
+
+        param_write(fidi, '\t  ', 'failure_capture', '   ', '\n', params)
+        param_write(fidi, '\t  ', 'deactivate', '        ', '\n', params)
+        param_write(fidi, '\t  ', 'parameters_file', ' = \'', '\'\n', params)
+        param_write(fidi, '\t  ', 'results_file', ' = \'', '\'\n', params)
+        param_write(fidi, '\t  ', 'verbatim', '', '\n', params)
+        param_write(fidi, '\t  ', 'aprepro', '', '\n', params)
+        param_write(fidi, '\t  ', 'file_tag', '', '\n', params)
+        param_write(fidi, '\t  ', 'file_save', '', '\n', params)
+    elif params.direct:
+        #  Error: asynchronous capability not yet supported in direct interfaces.
+        #  Update: it is now possible to run in parallel in direct interfaces.
+        param_write(fidi, '\t', 'algebraic_mappings', '=', '\n', params)
+        param_write(fidi, '\t', 'direct', '', '\n', params)
+        param_write(fidi, '\t  ', 'analysis_driver', ' = \'', '\'\n', params)
+        if float(IssmConfig('_DAKOTA_VERSION_')[0]) < 6:
+            param_write(fidi, '\t  ', 'evaluation_static_scheduling', '', '\n', params)
+        else:
+            param_write(fidi, '\t  ', 'evaluation_scheduling', ' ', '\n', params)
+            param_write(fidi, '\t  ', 'processors_per_evaluation', '=', '\n', params)
+        if len(params.analysis_components) != 0:
+            [pathstr, name, ext] = fileparts(params.analysis_components)
+            if ext != '':
+                ext = '.py'
+
+            params.analysis_components = fullfile(pathstr, name + ext)
+            param_write(fidi, '\t  ', 'analysis_components', ' = \'', '\'\n', params)
+
+        if len(params.input_filter) != 0:
+            param_write(fidi, '\t  ', 'input_filter', '=', '\n', params)
+
+        if len(params.output_filter) != 0:
+            param_write(fidi, '\t  ', 'output_filter', '=', '\n', params)
+
+        param_write(fidi, '\t  ', 'failure_capture', '   ', '\n', params)
+        param_write(fidi, '\t  ', 'deactivate', '        ', '\n', params)
+        param_write(fidi, '\t  ', 'processors_per_analysis', '=', '\n', params)
+
+    fidi.write('\n')
+
+
+#  function to write the responses section of the file
+def responses_write(fidi, dmeth, dresp, params):
+
+    print('Writing responses section of Dakota input file.')
+
+    fidi.write('responses, \n')
+    #fidi.write('calibration_terms = 1 \n')
+
+    #  functions, gradients, and hessians vary by method
+
+    rdesc = []
+
+    for i in range(len(dmeth.responses)):
+        resp = eval(dmeth.responses[i])
+        rdesc = resp.dakota_write(fidi, dresp, rdesc)
+
+    #  write accumulated response descriptors for all response classes
+
+    if len(rdesc) != 0:
+        fidi.write('\tresponse_descriptors =\n')
+        vector_write(fidi, '\t  ', rdesc, 6, 76)
+
+    ghspec_write(fidi, params, dmeth.ghspec)
+
+    fidi.write('\n')
+
+
+#  function to write gradient and hessian specifications
+def ghspec_write(fidi, params, ghspec):
+
+    #  gradients
+    if 'grad' in ghspec:
+        if (not params.numerical_gradients) and (not params.analytic_gradients):
+            params.numerical_gradients = True
+        elif (params.numerical_gradients + params.analytic_gradients > 1):
+            raise RuntimeError('Too many gradients selected.')
+
+        if params.numerical_gradients:
+            param_write(fidi, '\t', 'numerical_gradients', '', '\n', params)
+            param_write(fidi, '\t  ', 'method_source', ' ', '\n', params)
+            param_write(fidi, '\t  ', 'interval_type', ' ', '\n', params)
+            param_write(fidi, '\t  ', 'fd_gradient_step_size', '=', '\n', params)
+        elif params.analytic_gradients:
+            param_write(fidi, '\t', 'analytic_gradients', '', '\n', params)
+    #    elif params.mixed_gradients
+    else:
+        fidi.write('\tno_gradients\n')
+
+    #  hessians (no implemented methods use them yet)
+    if 'hess' in ghspec:
+        raise RuntimeError('Hessians needed by method but not provided.')
+    else:
+        fidi.write('\tno_hessians\n')
Index: /issm/trunk/src/m/qmu/dakota_out_parse.py
===================================================================
--- /issm/trunk/src/m/qmu/dakota_out_parse.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/dakota_out_parse.py	(revision 24313)
@@ -1,7 +1,5 @@
 import numpy as np
-
-from os.path import isfile,getsize
+from os.path import isfile, getsize
 import re
-
 from MatlabFuncs import *
 from prctile_issm import *
@@ -10,13 +8,14 @@
 from helpers import *
 
-#Note: this may be re-written later to take advantage of Python's file i/o mechanics
-#	as it is written now it is often difficult to work with, but is analagous to
-#	the Matlab version of dakota_out_parse
-
-def dakota_out_parse(filei): # [[[
-	'''
+#Note: this may be re-written later to take advantage of Python's file i / o mechanics
+#    as it is written now it is often difficult to work with, but is analagous to
+#    the Matlab version of dakota_out_parse
+
+
+def dakota_out_parse(filei):  # {{{
+    '''
   read a Dakota .out or .dat output file and parse it.
 
-  [method,dresp,scm,pcm,srcm,prcm]=dakota_out_parse(filei)
+  [method, dresp, scm, pcm, srcm, prcm] = dakota_out_parse(filei)
 
   where the required input is:
@@ -39,5 +38,5 @@
 
   this function reads a dakota .out output file and parses it
-  into the matlab workspace.  it operates in a content-driven
+  into the matlab workspace.  it operates in a content - driven
   fashion, where it skips the intermediate data and then parses
   whatever output data it encounters in the order in which it
@@ -47,924 +46,902 @@
 
   this data would typically be used for plotting and other
-  post-processing within matlab or excel.
+  post - processing within matlab or excel.
 '''
-	if filei == None:
-		help(dakota_out_parse)
-		return
-
-	if not isfile(filei) or getsize(filei) == 0:
-		filei=str(input('Input file?  '))
-	
-	#fidi=fopen(sprintf('%s',filei),'r')
-	#try:
-	with open(filei, 'r') as fidi:
-		##  check the first line for the Dakota tabular output file
-		method=[]
-		fline=fidi.readline()
-		if getsize(filei) == 0 or fline == '':
-			raise RuntimeError('File '+filei+' is empty.')
-
-		dresp=[]	# of struct()
-		scm =struct()
-		pcm =struct()
-		srcm=struct()
-		prcm=struct()
-
-		if strncmpi(fline,'%eval_id',8):
-			method='unknown'
-			dresp=dak_tab_out(fidi,fline)
-			return [method,dresp,scm,pcm,srcm,prcm]
-		else:
-			fidi.seek(0,0)
-
-		##  loop through the file to find the Dakota method name
-		fline=findline(fidi,'method',True)
-		if fline == None:
-			#do nothing
-			pass
-		else:
-			if fline[6] == ',':
-				fline = fidi.readline()
-				[ntokens,tokens]=fltokens(fline)
-				method=tokens[0].strip()
-				print 'Dakota method =\''+method+'\'.'
-			elif fline[6] in ['N','n']:
-				fline=findline(fidi,'methodName = ');
-				[ntokens,tokens]=fltokens(fline)
-				method=tokens[2].strip()
-				print 'Dakota methodName="'+method+'".'
-
-		##  loop through the file to find the function evaluation summary
-		counter = 0
-		fline=''
-		nfeval=nfeval_read(fidi,fline)
-
-		##  process each results section based on content of the file
-		while counter < 10:
-			# because python makes file i/o difficult
-			# if we see 10+ blank lines in a row then we have reached EOF
-			# (tests show actual maximum number of blank lines is around 5)
-			if counter >= 10:
-				break
-			if fline == '' or fline.isspace():
-				counter += 1
-			else:
-				counter = 0
-
-			#print fline
-			#     ipos=ftell(fidi)
-			fline = fidi.readline()
-			if fline == '' or fline.isspace():
-				pass
-			elif strncmp(fline,'<<<<< Function evaluation summary',33):
-				nfeval=nfeval_read(fidi,fline)
-			elif strncmp(fline,'Statistics based on ',20):
-				nsamp=nsamp_read(fidi,fline)
-			elif strncmp(fline,'Moments for each response function',34):
-				dresp=moments_read(fidi,dresp,fline)
-			elif strncmp(fline,'Moment-based statistics for each response function',50):
-				dresp=mbstats_read(fidi,dresp,fline)
-			elif strncmp(fline,'95% confidence intervals for each response function',51):
-				dresp=cis_read(fidi,dresp,fline)
-			elif strncmp(fline,'Probabilities for each response function',40) or strncmp(fline,'Level mappings for each response function',41):
-				dresp=cdfs_read(fidi,dresp,fline)
-			elif strncmp(fline,'Probability Density Function (PDF) histograms for each response function',72):
-				dresp=pdfs_read(fidi,dresp,fline)
-			elif strncmp(fline,'Simple Correlation Matrix',25):
-				scm=corrmat_read(fidi,'Simple Correlation Matrix',fline)
-			elif strncmp(fline,'Partial Correlation Matrix',26):
-				pcm=corrmat_read(fidi,'Partial Correlation Matrix',fline)
-			elif strncmp(fline,'Simple Rank Correlation Matrix',30):
-				srcm=corrmat_read(fidi,'Simple Rank Correlatio:n Matrix',fline)
-			elif strncmp(fline,'Partial Rank Correlation Matrix',31):
-				prcm=corrmat_read(fidi,'Partial Rank Correlation Matrix',fline)
-			elif strncmp(fline,'MV Statistics for ',18):
-				dresp=mvstats_read(fidi,dresp,fline)
-			elif strncmp(fline,'<<<<< Best ',11):
-				dresp=best_read(fidi,dresp,fline)
-			elif strncmp(fline,'The following lists volumetric uniformity measures',50):
-				dresp=vum_read(fidi,dresp,fline)
-			elif strncmp(fline,'<<<<< Iterator ',15) and (len(fline) > 26) and (' completed.' in fline[15:]):
-				method=itcomp_read(fidi,fline)
-			elif strncmp(fline,'-----',5):
-				pass
-			else:
-				'Unexpected line: '+str(fline)
-	
-			#     fidi.seek(ipos,0)
-
-		##  loop through the file to verify the end
-
-		# fline=findline(fidi,'<<<<< Single Method Strategy completed')
-		# if not ischar(fline)
-		#     return
-		# 
-		print 'End of file successfully reached.'
-		#close(fidi)
-	#except Exception as err:
-		#print "ERROR in dakota_out_parse: " + err
-		#raise err
-		#raise RuntimeError(filei+' could not be opened.')
-
-	return [method,dresp,scm,pcm,srcm,prcm]
- # ]]]
-
-def dak_tab_out(fidi,fline): # [[[
-##  function to parse the dakota tabular output file
-
-	print 'Reading Dakota tabular output file.'
-
-	#  process column headings of matrix (skipping eval_id)
-	[ntokens,tokens]=fltokens(fline)
-
-	# New file DAKOTA versions>6
-	if strncmpi(fline,'%eval_id interface',18):
-		offset=2
-	else: #DAKOTA versions<6
-		offset=1
-
-	desc=[['' for i in range(ntokens-offset)]]
-	data=np.zeros((1,ntokens-offset))
-
-	for i in range(ntokens-offset):
-		desc[0][i]=str(tokens[i+offset])
-
-	print "Number of columns (Dakota V+R)="+str(ntokens-2)+'.'
-
-	#  process rows of matrix
-	nrow=0
-	while True:
-
-		fline=fidi.readline()
-
-		if fline == '' or fline.isspace():
-			break
-
-		if nrow > 0:
-			data = np.concatenate((data,[np.zeros(ntokens-offset)]))
-		
-		[ntokens,tokens]=fltokens(fline)
-
-		#  add row values to matrix (skipping eval_id)
-
-		for i in range(ntokens-offset):
-			data[nrow,i] = tokens[i+offset]
-
-		nrow=nrow+1
-		
-	print 'Number of rows (Dakota func evals)='+str(nrow)+'.'
-
-	#  calculate statistics
-
-	#  since normfit doesn't have a dim argument, and matlab isvector is True
-	#  for a 1xn matrix, handle the case of one row explicitly
-
-	#  Update: normfit_issm.py does handle this case
-	if (np.size(data,0) > 1):
-		#dmean  =mean   (data)
-		#dstddev=std    (data,0)
-		[dmean,dstddev,dmeanci,dstddevci]=normfit_issm(data,0.05)
-	else:
-		dmean    =np.zeros((1,np.size(data,1)))
-		dstddev  =np.zeros((1,np.size(data,1)))
-		dmeanci  =np.zeros((2,np.size(data,1)))
-		dstddevci=np.zeros((2,np.size(data,1)))
-		for i in range(np.size(data,1)):
-			[dmean[0,i],dstddev[0,i],dmeanci[:,i],dstddevci[:,i]]=normfit_issm(data[:,i],0.05)
-
-	dmin   =data.min(0)
-	dquart1=prctile_issm(data,25,0)
-	dmedian=np.median(data,0)
-	dquart3=prctile_issm(data,75,0)
-	dmax   =data.max(0)
-	dmin95 =prctile_issm(data,5,0)
-	dmax95 =prctile_issm(data,95,0)
-
-	# Note: the following line may cause the following warning
-	#	(should not crash or invalidate results) when one of
-	#	the inputs does not change with respect to the
-	#	other/s causing an internal divide-by-zero error
-
-	#/usr/local/lib/python2.7/dist-packages/numpy/lib/function_base.py:3163:
-	#	RuntimeWarning: invalid value encountered in true_divide
-	#	c /= stddev[:,None]
-
-	#	(and/or the same but with "c /= stddev[None, :]")
-
-	dcorrel=np.corrcoef(data.T)
-
-	#  divide the data into structures for consistency
-	dresp = []
-
-	for i in range(len(desc)):
-		dresp.append(struct())
-		dresp[i].descriptor=str(desc[i])
-		dresp[i].sample    =data[:,i]
-		dresp[i].mean      =dmean[i]
-		dresp[i].stddev    =dstddev[i]
-		dresp[i].meanci    =dmeanci[:,i]
-		dresp[i].stddevci  =dstddevci[:,i]
-		dresp[i].min       =dmin[i]
-		dresp[i].quart1    =dquart1[i]
-		dresp[i].median    =dmedian[i]
-		dresp[i].quart3    =dquart3[i]
-		dresp[i].max       =dmax[i]
-		dresp[i].dmin95    =dmin95[i]
-		dresp[i].dmax95    =dmax95[i]
-	
-	#  draw box plot
-
-	# figure
-	# subplot(2,1,1)
-	# plot_boxplot(dresp)
-
-	#  draw normal probability plot
-
-	# subplot(2,1,2)
-	# plot_normplot(dresp)
-
-	return dresp
- # ]]]
-
-def nfeval_read(fidi,fline): # [[[
-##  function to find and read the number of function evaluations
-
-	if fline == None or fline == '' or fline.isspace():
-		fline=findline(fidi,'<<<<< Function evaluation summary')
-		nfeval = 0
-		return
-
-	[ntokens,tokens]=fltokens(fline)
-	nfeval=tokens[4]
-	print '  Dakota function evaluations='+str(int(nfeval))+'.'
-
-	return nfeval
- # ]]]
-
-def nsamp_read(fidi,fline): # [[[
-##  function to find and read the number of samples
-
-	if fline == None or fline == '' or fline.isspace():
-		fline=findline(fidi,'Statistics based on ')
-		return
-
-	[ntokens,tokens]=fltokens(fline)
-	nsamp=tokens[3]
-	print '  Dakota samples='+str(int(nsamp))+'.'
-
-	return nsamp
- # ]]]
-
-def moments_read(fidi,dresp,fline): # [[[
-##  function to find and read the moments
-
-	if fline == None or fline == '' or fline.isspace():
-		fline=findline(fidi,'Moments for each response function')
-		return
-
-	print 'Reading moments for response functions:'
-	
-	while True:
-		fline=fidi.readline()
-		if fline == '' or fline.isspace():
-			break
-		
-		[ntokens,tokens]=fltokens(fline)
-
-		#  add new response function and moments
-
-		dresp.append(struct())
-		dresp[-1].descriptor=tokens[ 0]
-		print '  '+str(dresp[-1].descriptor)
-		dresp[-1].mean      =tokens[ 3]
-		dresp[-1].stddev    =tokens[ 6]
-		dresp[-1].coefvar   =tokens[12]
-
-	print '  Number of Dakota response functions='+str(len(dresp))+'.'
-
-	return dresp
- # ]]]
-
-def mbstats_read(fidi,dresp,fline): # [[[
-##  function to find and read the moment-based statistics
-
-	if fline == None or fline == '' or fline.isspace():
-		fline=findline(fidi,'Moment-based statistics for each response function')
-		return
-
-	print 'Reading moment-based statistics for response functions:'
-
-	#  skip column headings of moment-based statistics
-
-	fline=fidi.readline()
-
-	while True:
-		fline=fidi.readline()
-		if fline == '' or fline.isspace():
-			break
-
-		[ntokens,tokens]=fltokens(fline)
-
-		#  add new response function and moment-based statistics
-
-		dresp.append(struct())
-		dresp[-1].descriptor=tokens[ 0]
-		print '  '+str(dresp[-1].descriptor)
-		dresp[-1].mean      =tokens[ 1]
-		dresp[-1].stddev    =tokens[ 2]
-		dresp[-1].skewness  =tokens[ 3]
-		dresp[-1].kurtosis  =tokens[ 4]
-	
-	print '  Number of Dakota response functions='+str(len(dresp))+'.'
-
-	return dresp
- # ]]]
-
-def cis_read(fidi,dresp,fline): # [[[
-##  function to find and read the confidence intervals
-
-	if fline == None or fline == '' or fline.isspace():
-		fline=findline(fidi,'95% confidence intervals for each response function')
-		return
-
-	print 'Reading 95% confidence intervals for response functions:'
-
-	while True:
-		fline=fidi.readline()
-		if fline == '' or fline.isspace():
-			break
-		
-		[ntokens,tokens]=fltokens(fline)
-
-		#  check for column headings in Dakota 5.2
-
-		if (ntokens == 4):
-			fline=fidi.readline()
-			if fline == '' or fline.isspace():
-				break
-			
-			[ntokens,tokens]=fltokens(fline)
-		
-		#  find response function associated with confidence intervals
-
-		idresp=-1
-		for i in range(len(dresp)):
-			if strcmpi(tokens[0],dresp[i].descriptor):
-				idresp=i
-				break
-			
-		if idresp < 0:
-			idresp=len(dresp)
-			dresp.append(struct())
-			dresp[idresp].descriptor=tokens[0]
-			print '  '+str(dresp[idresp].descriptor)
-		
-		#  add confidence intervals to response functions
-		dresp[i].meanci = np.array([[np.nan],[np.nan]])
-		dresp[i].stddevci = np.array([[np.nan],[np.nan]])
-
-		if (ntokens == 14):
-			dresp[i].meanci  [0,0]=tokens[ 4]
-			dresp[i].meanci  [1,0]=tokens[ 5]
-			dresp[i].stddevci[0,0]=tokens[11]
-			dresp[i].stddevci[1,0]=tokens[12]
-		else:
-			dresp[i].meanci  [0,0]=tokens[ 1]
-			dresp[i].meanci  [1,0]=tokens[ 2]
-			dresp[i].stddevci[0,0]=tokens[ 3]
-			dresp[i].stddevci[1,0]=tokens[ 4]
-
-	print '  Number of Dakota response functions='+str(len(dresp))+'.'
-
-	return dresp
- # ]]]
-
-def cdfs_read(fidi,dresp,fline): # [[[
-##  function to find and read the cdf's
-
-	if fline == None or fline == '' or fline.isspace():
-		fline=findline(fidi,'Probabilities for each response function')
-		if fline == None:
-			fline=findline(fidi,'Level mappings for each response function')
-			if fline == None:
-				return
-
-	print 'Reading CDF''s for response functions:'
-
-	while fline == '' or fline.isspace():
-		fline=fidi.readline()
-		if fline == '' or fline.isspace():
-			break
-		
-		#  process header line of cdf
-
-		while (fline != '' and not fline.isspace()):
-			[ntokens,tokens]=fltokens(fline)
-
-			#  find response function associated with cdf
-			# idresp is an index, so it can be 0, default to -1
-			idresp=-1
-			for i in range(len(dresp)):
-				if strcmpi(tokens[ 5],dresp[i].descriptor):
-					idresp=i
-					break
-				
-			
-			if idresp < 0:
-				idresp=len(dresp)
-				dresp.append(struct())
-				dresp[idresp].descriptor=tokens[ 5]
-				print '  '+str(dresp(idresp).descriptor)
-			
-
-			#  skip column headings of cdf
-
-			fline=fidi.readline()
-			fline=fidi.readline()
-
-			#  read and add cdf table to response function
-
-			fline=fidi.readline()
-			icdf=0
-			while (fline != '' and not fline.isspace()) and not strncmpi(fline,'Cumulative Distribution Function',32):
-				[ntokens,tokens]=fltokens(fline)
-				icdf=icdf+1
-				dresp[idresp].cdf = np.zeros((icdf,4))
-				dresp[idresp].cdf[icdf-1,0:4]=np.nan
-				#  in later versions of Dakota, uncalculated columns are now blank
-				itoken=0
-				for i in range(len(fline)/19):
-					if not isempty(fline[(i-1)*19:i*19]):
-						itoken=itoken+1
-						dresp[idresp].cdf[icdf-1,i]=tokens[itoken]
-
-				fline=fidi.readline()
-
-	print '  Number of Dakota response functions='+str(len(dresp))+'.'
-
-	return dresp
- # ]]]
-
-def pdfs_read(fidi,dresp,fline): # [[[
-##  function to find and read the pdf's
-
-	if fline == None or fline == '' or fline.isspace():
-		fline=findline(fidi,'Probability Density Function (PDF) histograms for each response function')
-		return
-
-	print 'Reading PDF''s for response functions:'
-
-	while (fline != '' and not fline.isspace()):
-		fline=fidi.readline()
-		if fline == '' or fline.isspace():
-			break
-		
-
-		#  process header line of pdf
-
-		while (fline != '' and not fline.isspace()):
-			[ntokens,tokens]=fltokens(fline)
-
-			#  find response function associated with pdf
-			# idresp is an index, so it can be 0, default to -1
-			idresp=-1
-			for i in range(len(dresp)):
-				if strcmpi(tokens[ 2],dresp[i].descriptor):
-					idresp=i
-					break
-				
-			
-			if idresp < 0:
-				idresp=len(dresp)
-				dresp.append(struct)
-				dresp[idresp].descriptor=tokens[ 2]
-				print '  '+str(dresp[idresp].descriptor)
-			
-
-			#  skip column headings of pdf
-
-			fline=fidi.readline()
-			fline=fidi.readline()
-
-			#  read and add pdf table to response function
-
-			fline=fidi.readline()
-			ipdf=0
-			while (fline != '' and not fline.isspace()) and not strncmpi(fline,'PDF for', 7):
-				[ntokens,tokens]=fltokens(fline)
-				ipdf=ipdf+1
-				dresp[idresp].pdf = np.zeros((ipdf,4))
-				dresp[idresp].pdf[ipdf-1,0:3]=np.nan
-				for i in range(3):
-					dresp[idresp].pdf[ipdf-1,i]=tokens[i]
-				
-				fline=fidi.readline()
-
-	print '  Number of Dakota response functions='+str(len(dresp))+'.'
-
-	return dresp
- # ]]]
-
-def corrmat_read(fidi,cmstr,fline): # [[[
-##  function to find and read a correlation matrix
-
-	if fline == None or fline == '' or fline.isspace():
-		fline=findline(fidi,cmstr)
-		if fline == '' or fline.isspace():
-			cmat=struct()
-			return
-
-	print 'Reading ' +fline+ '.'
-
-	cmat.title=fline
-
-	while (fline != '' and not fline.isspace()):
-		fline=fidi.readline()
-		if fline == '' or fline.isspace():
-			break
-		
-		#  process column headings of matrix
-
-		[ntokens,tokens]=fltokens(fline)
-		cmat.column= np.empty((1,ntokens))
-		cmat.column.fill(0.0)
-		cmat.row   = np.empty((1,1))
-		cmat.row.fill(0.0)
-		cmat.matrix=np.zeros((1,ntokens))
-
-		for i in range(ntokens):
-			cmat.column[1,i]=str(tokens[i])
-		
-		#  process rows of matrix, reading until blank line
-
-		nrow=0
-		while True:
-			fline=fidi.readline()
-			if fline == '' or fline.isspace():
-				break
-			
-			[ntokens,tokens]=fltokens(fline)
-
-			#  add row heading to matrix
-
-			nrow=nrow+1
-			cmat.row[nrow-1,0]=str(tokens[0])
-
-			#  add row values to matrix
-
-			for i in range(1,ntokens):
-				cmat.matrix[nrow-1,i-1]=tokens[i]
-	
-	return cmat
- # ]]]
-
-def mvstats_read(fidi,dresp,fline): # [[[
-##  function to find and read the MV statistics
-
-	if fline == None or fline == '' or fline.isspace():
-		fline=findline(fidi,'MV Statistics for ')
-		if fline == None:
-			return
-
-	print 'Reading MV statistics for response functions:'
-
-	ndresp=0
-
-	while (fline != '' and not fline.isspace()) and strncmpi(fline,'MV Statistics for ',18):
-
-		#  add new response function and moments
-
-		[ntokens,tokens]=fltokens(fline)
-		dresp.append(struct())
-		dresp[-1].descriptor=tokens[3]
-		print '  '+str(dresp[-1].descriptor)
-		fline=fidi.readline()
-		[ntokens,tokens]=fltokens(fline)
-		dresp[-1].mean      =tokens[4]
-		fline=fidi.readline()
-		[ntokens,tokens]=fltokens(fline)
-		dresp[-1].stddev    =tokens[6]
-
-		#  read and add importance factors to response function
-
-		idvar=0
-		fline=fidi.readline()
-		if fline == '' or fline.isspace():
-			break
-
-		# shape: [[0],[0],[0]...]
-		dresp[-1].var =    []
-		dresp[-1].impfac = []
-		dresp[-1].sens =   []
-
-		while (fline != '' and not fline.isspace()) and strncmpi(fline,'  Importance Factor for variable ',33):
-			[ntokens,tokens]=fltokens(fline)
-			idvar=idvar+1
-			dresp[-1].var.append(str(tokens[4]))
-			dresp[-1].impfac.append(tokens[6])
-			if (ntokens >= 10):
-				dresp[-1].sens.append(tokens[9])
-			else:
-				dresp[-1].sens.append(np.nan)
-			
-
-			fline=fidi.readline()
-		
-		#  if importance factors missing, skip to cdf
-
-		if not idvar:
-			print '    Importance Factors not available.'
-			dresp[-1].var   =[]
-			dresp[-1].impfac=[]
-			dresp[-1].sens  =[]
-			while type(fline) == str and (fline != '' and not fline.isspace()) and not strncmpi(fline,'Cumulative Distribution Function',32) and not strncmpi(fline,'MV Statistics for ',18) and not strncmp(fline,'-',1):
-				fline=fidi.readline()
-
-		#  process header line of cdf
-
-		icdf=0
-
-		# If there is a warning it MAY involve a lot of spaces; skip over them
-		if fline == '' or fline.isspace():
-			fline=fidi.readline()
-			# Usually: "Warning: negligible standard deviation renders CDF results suspect."
-			if strncmpi(fline,'Warn',4):
-				fline = fidi.readline()
-				if fline == '' or fline.isspace():
-					fline = fidi.readline()
-
-		while (fline != '' and not fline.isspace()) and strncmpi(fline,'Cumulative Distribution Function',32):
-			[ntokens,tokens]=fltokens(fline)
-
-			#  find response function associated with cdf
-			# idresp is an index, so it can be 0, default to -1
-			idresp=-1
-			for i in range(len(dresp)):
-				if strcmpi(tokens[ 5],dresp[i].descriptor):
-					idresp=i
-					break
-
-			if idresp < 0:
-				idresp=len(dresp)
-				dresp.append(struct())
-				dresp[idresp].descriptor=tokens[ 5]
-				print '  '+str(dresp[idresp].descriptor)
-			
-			#  skip column headings of cdf
-			fline=fidi.readline()
-			fline=fidi.readline()
-
-			#  read and add cdf table to response function
-
-			fline=fidi.readline()
-			while (fline != '' and not fline.isspace()) and not strncmpi(fline,'MV Statistics for ',18) and not strncmp (fline,'-',1):
-				[ntokens,tokens]=fltokens(fline)
-				icdf=icdf+1
-				dresp[idresp].cdf = np.zeros((icdf,4))
-				dresp[idresp].cdf[icdf-1,0]=tokens[0]
-				dresp[idresp].cdf[icdf-1,1]=tokens[1]
-				if (ntokens == 4):
-					dresp[idresp].cdf[icdf-1,2]=tokens[2]
-					dresp[idresp].cdf[icdf-1,3]=tokens[3]
-				else:
-					dresp[idresp].cdf[icdf-1,2]=np.nan
-					dresp[idresp].cdf[icdf-1,3]=np.nan
-				
-				fline=fidi.readline()
-
-		#  if cdf missing, skip to end of response function
-
-		if not icdf:
-			print '    Cumulative Distribution Function not available.'
-			dresp[ndresp].cdf=[]
-			while (fline != '' and not fline.isspace()) and not strncmpi(fline,'MV Statistics for ',18) and not strncmp (fline,'-',1):
-				fline=fidi.readline()
-
-	print '  Number of Dakota response functions='+str(len(dresp))+'.'
-
-	return dresp
- # ]]]
-
-def best_read(fidi,dresp,fline): # [[[
-##  function to find and read the best evaluation
-
-	if fline == None or fline == '' or fline.isspace():
-		fline=findline(fidi,'<<<<< Best ')
-		if fline == None:
-			return
-
-	if isempty(dresp):
-		dresp.append(struct())
-		dresp[-1].best=struct()
-	
-	print 'Reading values for best function evaluation:'
-
-	while (fline != '' and not fline.isspace()) and strncmpi(fline,'<<<<< Best ',11):
-		[ntokens,tokens]=fltokens(fline)
-
-		#  read and add best parameter(s)
-
-		if strncmpi(str(tokens[2]),'parameter', 9):
-			print '  '+fline
-
-			fline=fidi.readline()
-			dresp.best.param     =[]
-			dresp.best.descriptor=''
-
-			while (fline != '' and not fline.isspace()) and not strncmpi(fline,'<<<<< Best ',11):
-				[ntokens,tokens]=fltokens(fline)
-				dresp.best.param.append([0])
-				dresp.best.param[-1]=      tokens[0]
-				dresp.best.descriptor= str(tokens[1])
-				fline=fidi.readline()
-			
-			#  read and add best objective function(s)
-
-		elif strncmpi(str(tokens[2]),'objective', 9) and strncmpi(str(tokens[3]),'function' , 8):
-			print '  '+fline
-
-			fline=fidi.readline()
-			dresp.best.of=[]
-
-			while (fline != '' and not fline.isspace()) and not strncmpi(fline,'<<<<< Best ',11):
-				[ntokens,tokens]=fltokens(fline)
-				dresp.best.of.append(0)
-				dresp.best.of[-1]=tokens[0]
-				fline=fidi.readline()
-			
-			#  read and add best residual norms
-
-		elif strncmpi(str(tokens[2]),'residual', 8) and strncmpi(str(tokens[3]),'norm'    , 4):
-			print '  '+fline
-			dresp.best.norm   =        tokens[ 5]
-			dresp.best.hnormsq=        tokens[10]
-
-			fline=fidi.readline()
-
-			while (fline != '' and not fline.isspace()) and not strncmpi(fline,'<<<<< Best ',11):
-				fline=fidi.readline()
-			
-			#  read and add best residual term(s)
-
-		elif strncmpi(str(tokens[2]),'residual', 8) and strncmpi(str(tokens[3]),'term'    , 4):
-			print '  '+fline
-
-			fline=fidi.readline()
-			dresp.best.res=[]
-
-			while (fline != '' and not fline.isspace()) and not strncmpi(fline,'<<<<< Best ',11):
-				[ntokens,tokens]=fltokens(fline)
-				dresp.best.res.append(0)
-				dresp.best.res[-1]=        tokens[0]
-				fline=fidi.readline()
-			
-			#  read and add best constraint value(s)
-
-		elif strncmpi(str(tokens[2]),'constraint',10) and strncmpi(str(tokens[3]),'value'     , 5):
-			print '  '+fline
-
-			fline=fidi.readline()
-			dresp.best.nc=[]
-
-			while (fline != '' and not fline.isspace()) and not strncmpi(fline,'<<<<< Best ',11):
-				[ntokens,tokens]=fltokens(fline)
-				dresp.best.nc.append(0)
-				dresp.best.nc[-1]=        tokens[0]
-				fline=fidi.readline()
-			
-			#  read and add best data captured
-
-		elif strncmpi(str(tokens[2]),'data'    , 4) and strncmpi(str(tokens[3]),'captured', 8):
-			print '  '+fline
-			dresp.best.eval=        tokens[7]
-
-			fline=fidi.readline()
-
-			while (fline != '' and not fline.isspace()) and not strncmpi(fline,'<<<<< Best ',11):
-				fline=fidi.readline()
-
-			#  read until next best or blank or end
-		else:
-			print '  '+fline+'  (ignored)'
-
-			fline=fidi.readline()
-
-			while (fline != '' and not fline.isspace()) and not strncmpi(fline,'<<<<< Best ',11):
-				fline=fidi.readline()
-
-	return dresp
- # ]]]
-
-def vum_read(fidi,dresp,fline): # [[[
-##  function to find and read the volumetric uniformity measures
-
-	if fline == None or fline == '' or fline.isspace():
-		fline=findline(fidi,'The following lists volumetric uniformity measures')
-		if fline == None:
-			return
-
-	if isempty(dresp):
-		dresp.append(struct())
-		dresp[-1].vum=[]
-	
-	print 'Reading measures for volumetric uniformity.'
-
-	fline=fidi.readline()
-	fline=fidi.readline()
-
-	while (fline != '' and not fline.isspace()):
-		[ntokens,tokens]=fltokens(fline)
-		check = tokens[0].lower()
-		if check == 'chi':
-				dresp.vum.chi=tokens[3]
-		elif check == 'd':
-				dresp.vum.d  =tokens[3]
-		elif check == 'h':
-				dresp.vum.h  =tokens[3]
-		elif check == 'tau':
-				dresp.vum.tau=tokens[3]
-		
-		fline=fidi.readline()
-	
-	return dresp
- # ]]]
-
-def itcomp_read(fidi,fline): # [[[
-##  function to find and read the iterator completion
-
-	if fline == None or fline == '' or fline.isspace():
-		while True:
-			fline=findline(fidi,'<<<<< Iterator ')
-			if fline == None:
-				return
-			
-			if (len(fline) > 26) and not (' completed.' in fline[15:]):
-				break
-
-	[ntokens,tokens]=fltokens(fline)
-	method=tokens[2]
-	print 'Dakota iterator \''+str(method)+'\' completed.'
-
-	return method
- # ]]]
-
-def findline(fidi,string,goto_line=False): # [[[
-##  function to find a file line starting with a specified string
-##  by default, return to previous position, before search
-##  if final argument is True, return such that fidi.readline() will read the line
-##	immediately after the searched line (or the first line if the search failed)
-
-	ipos=fidi.tell()
-	npos = 0
-	for fline in fidi:
-		npos += len(fline)
-		if (strncmpi(fline,string,len(string))):
-			if goto_line:
-				fidi.seek(npos,0)
-			else:
-				fidi.seek(ipos,0)
-			return fline
-
-	#  issue warning and reset file position
-	print 'Warning: findline:str_not_found: String '+str(string)+' not found in file.'
-	fidi.seek(ipos,0)
-	return None
- # ]]]
-
-def fltokens(fline): # [[[
-	##  function to parse a file line into tokens
-	if fline == None:
-		ntokens=-1
-		tokens=[]
-		return [None,None]
-	
-	if fline == '' or fline.isspace():
-		ntokens=0
-		tokens=[]
-		return [None,None]
-	
-	# split wherever ' ' (space) or ':' occur
-	strings = re.split(':| ',fline)
-	# remove blank strings
-	strings = filter(lambda a: (a != '' and not a.isspace()),strings)
-
-	ntokens=0
-	tokens = ['' for i in range(len(strings))]
-
-	# try to format substrings to float where possible and count tokens and ignore invalid values
-	for i in range(len(strings)):
-		if isempty(strings[i]):
-			continue
-
-		# if the string is a number, make it a float, otherwise leave it alone
-		try:
-			tokens[ntokens] = float(strings[i])
-		except ValueError:
-			tokens[ntokens] = strings[i]
-		
-		ntokens=ntokens+1
-
-	return [ntokens,tokens]
- # ]]]
-
-	
+    if filei is None:
+        help(dakota_out_parse)
+        return
+
+    if not isfile(filei) or getsize(filei) == 0:
+        filei = str(eval(input('Input file?  ')))
+
+    #fidi = fopen(sprintf('%s', filei), 'r')
+    #try:
+    with open(filei, 'r') as fidi:
+        #  check the first line for the Dakota tabular output file
+        method = []
+        fline = fidi.readline()
+        if getsize(filei) == 0 or fline == '':
+            raise RuntimeError('File ' + filei + ' is empty.')
+
+        dresp = []  # of struct()
+        scm = struct()
+        pcm = struct()
+        srcm = struct()
+        prcm = struct()
+
+        if '%eval_id' in fline:
+            method = 'unknown'
+            dresp = dak_tab_out(fidi, fline)
+            return [method, dresp, scm, pcm, srcm, prcm]
+        else:
+            fidi.seek(0, 0)
+
+    #  loop through the file to find the Dakota method name
+        fline = findline(fidi, 'method', True)
+        if fline is None:
+            #do nothing
+            pass
+        else:
+            if fline[6] == ',':
+                fline = fidi.readline()
+                [ntokens, tokens] = fltokens(fline)
+                method = tokens[0].strip()
+                print('Dakota method =\'' + method + '\'.')
+            elif fline[6] in ['N', 'n']:
+                fline = findline(fidi, 'methodName = ')
+                [ntokens, tokens] = fltokens(fline)
+                method = tokens[2].strip()
+                print('Dakota methodName = "' + method + '".')
+
+    #  loop through the file to find the function evaluation summary
+        counter = 0
+        fline = ''
+        nfeval = nfeval_read(fidi, fline)
+
+        #  process each results section based on content of the file
+        while counter < 10:
+            # because python makes file i / o difficult
+            # if we see 10 + blank lines in a row then we have reached EOF
+            # (tests show actual maximum number of blank lines is around 5)
+            if fline == '' or fline.isspace():
+                counter += 1
+            else:
+                counter = 0
+    #     ipos = ftell(fidi)
+            fline = fidi.readline()
+            if fline == '' or fline.isspace():
+                pass
+            elif '<<<<< Function evaluation summary' in fline:
+                nfeval = nfeval_read(fidi, fline)
+            elif 'Statistics based on ' in fline:
+                nsamp = nsamp_read(fidi, fline)
+            elif 'Moments for each response function' in fline:
+                dresp = moments_read(fidi, dresp, fline)
+            elif 'Moment-based statistics for each response function' in fline:
+                dresp = mbstats_read(fidi, dresp, fline)
+            elif '95% confidence intervals for each response function' in fline:
+                dresp = cis_read(fidi, dresp, fline)
+            elif 'Probabilities for each response function' in fline or 'Level mappings for each response function' in fline:
+                dresp = cdfs_read(fidi, dresp, fline)
+            elif 'Probability Density Function (PDF) histograms for each response function' in fline:
+                dresp = pdfs_read(fidi, dresp, fline)
+            elif 'Simple Correlation Matrix' in fline:
+                scm = corrmat_read(fidi, 'Simple Correlation Matrix', fline)
+            elif 'Partial Correlation Matrix' in fline:
+                pcm = corrmat_read(fidi, 'Partial Correlation Matrix', fline)
+            elif 'Simple Rank Correlation Matrix' in fline:
+                srcm = corrmat_read(fidi, 'Simple Rank Correlatio:n Matrix', fline)
+            elif 'Partial Rank Correlation Matrix' in fline:
+                prcm = corrmat_read(fidi, 'Partial Rank Correlation Matrix', fline)
+            elif 'MV Statistics for ' in fline:
+                dresp = mvstats_read(fidi, dresp, fline)
+            elif '<<<<< Best ' in fline:
+                dresp = best_read(fidi, dresp, fline)
+            elif 'The following lists volumetric uniformity measures' in fline:
+                dresp = vum_read(fidi, dresp, fline)
+            elif '<<<<< Iterator ' in fline and (len(fline) > 26) and (' completed.' in fline[15:]):
+                method = itcomp_read(fidi, fline)
+            elif '-----' in fline:
+                pass
+            else:
+                'Unexpected line: ' + str(fline)
+
+    #     fidi.seek(ipos, 0)
+
+    #  loop through the file to verify the end
+
+    # fline = findline(fidi, '<<<<< Single Method Strategy completed')
+    # if not ischar(fline)
+    #     return
+    #
+        print('End of file successfully reached.')
+    #close(fidi)
+    #except Exception as err:
+    #print "ERROR in dakota_out_parse: " + err
+    #raise err
+    #raise RuntimeError(filei + ' could not be opened.')
+
+    return [method, dresp, scm, pcm, srcm, prcm]
+    # }}}
+
+
+def dak_tab_out(fidi, fline):  # {{{
+    #  function to parse the dakota tabular output file
+
+    print('Reading Dakota tabular output file.')
+
+    #  process column headings of matrix (skipping eval_id)
+    [ntokens, tokens] = fltokens(fline)
+
+    # New file DAKOTA versions > 6
+    if strncmpi(fline, '%eval_id interface', 18):
+        offset = 2
+    else:  #DAKOTA versions < 6
+        offset = 1
+
+    desc = [['' for i in range(ntokens - offset)]]
+    data = np.zeros((1, ntokens - offset))
+
+    for i in range(ntokens - offset):
+        desc[0][i] = str(tokens[i + offset])
+
+    print("Number of columns (Dakota V + R)=" + str(ntokens - 2) + '.')
+
+    #  process rows of matrix
+    nrow = 0
+    while True:
+
+        fline = fidi.readline()
+
+        if fline == '' or fline.isspace():
+            break
+
+        if nrow > 0:
+            data = np.concatenate((data, [np.zeros(ntokens - offset)]))
+
+        [ntokens, tokens] = fltokens(fline)
+
+    #  add row values to matrix (skipping eval_id)
+
+        for i in range(ntokens - offset):
+            data[nrow, i] = tokens[i + offset]
+
+        nrow = nrow + 1
+
+    print('Number of rows (Dakota func evals) = ' + str(nrow) + '.')
+
+    #  calculate statistics
+
+    #  since normfit doesn't have a dim argument, and matlab isvector is True
+    #  for a 1xn matrix, handle the case of one row explicitly
+
+    #  Update: normfit_issm.py does handle this case
+    if (np.size(data, 0) > 1):
+        #dmean  =mean   (data)
+        #dstddev = std    (data, 0)
+        [dmean, dstddev, dmeanci, dstddevci] = normfit_issm(data, 0.05)
+    else:
+        dmean = np.zeros((1, np.size(data, 1)))
+        dstddev = np.zeros((1, np.size(data, 1)))
+        dmeanci = np.zeros((2, np.size(data, 1)))
+        dstddevci = np.zeros((2, np.size(data, 1)))
+        for i in range(np.size(data, 1)):
+            [dmean[0, i], dstddev[0, i], dmeanci[:, i], dstddevci[:, i]] = normfit_issm(data[:, i], 0.05)
+
+    dmin = data.min(0)
+    dquart1 = prctile_issm(data, 25, 0)
+    dmedian = np.median(data, 0)
+    dquart3 = prctile_issm(data, 75, 0)
+    dmax = data.max(0)
+    dmin95 = prctile_issm(data, 5, 0)
+    dmax95 = prctile_issm(data, 95, 0)
+
+    # Note: the following line may cause the following warning
+    #    (should not crash or invalidate results) when one of
+    #    the inputs does not change with respect to the
+    #    other / s causing an internal divide-by - zero error
+
+    # / usr / local / lib / python2.7 / dist - packages / numpy / lib / function_base.py:3163:
+    #    RuntimeWarning: invalid value encountered in true_divide
+    #    c / = stddev[:, None]
+
+    #    (and / or the same but with "c / = stddev[None, :]")
+
+    dcorrel = np.corrcoef(data.T)
+
+    #  divide the data into structures for consistency
+    dresp = []
+
+    for i in range(len(desc)):
+        dresp.append(struct())
+        dresp[i].descriptor = str(desc[i])
+        dresp[i].sample = data[:, i]
+        dresp[i].mean = dmean[i]
+        dresp[i].stddev = dstddev[i]
+        dresp[i].meanci = dmeanci[:, i]
+        dresp[i].stddevci = dstddevci[:, i]
+        dresp[i].min = dmin[i]
+        dresp[i].quart1 = dquart1[i]
+        dresp[i].median = dmedian[i]
+        dresp[i].quart3 = dquart3[i]
+        dresp[i].max = dmax[i]
+        dresp[i].dmin95 = dmin95[i]
+        dresp[i].dmax95 = dmax95[i]
+
+    #  draw box plot
+
+    # figure
+    # subplot(2, 1, 1)
+    # plot_boxplot(dresp)
+
+    #  draw normal probability plot
+
+    # subplot(2, 1, 2)
+    # plot_normplot(dresp)
+
+    return dresp
+    # }}}
+
+
+def nfeval_read(fidi, fline):  # {{{
+    #  function to find and read the number of function evaluations
+
+    if fline is None or fline == '' or fline.isspace():
+        fline = findline(fidi, '<<<<< Function evaluation summary')
+        nfeval = 0
+        return
+
+    [ntokens, tokens] = fltokens(fline)
+    nfeval = tokens[4]
+    print('  Dakota function evaluations = ' + str(int(nfeval)) + '.')
+
+    return nfeval
+    # }}}
+
+
+def nsamp_read(fidi, fline):  # {{{
+    #  function to find and read the number of samples
+
+    if fline is None or fline == '' or fline.isspace():
+        fline = findline(fidi, 'Statistics based on ')
+        return
+
+    [ntokens, tokens] = fltokens(fline)
+    nsamp = tokens[3]
+    print('  Dakota samples = ' + str(int(nsamp)) + '.')
+
+    return nsamp
+    # }}}
+
+
+def moments_read(fidi, dresp, fline):  # {{{
+    #  function to find and read the moments
+
+    if fline is None or fline == '' or fline.isspace():
+        fline = findline(fidi, 'Moments for each response function')
+        return
+
+    print('Reading moments for response functions:')
+
+    while True:
+        fline = fidi.readline()
+        if fline == '' or fline.isspace():
+            break
+
+        [ntokens, tokens] = fltokens(fline)
+
+    #  add new response function and moments
+
+        dresp.append(struct())
+        dresp[-1].descriptor = tokens[0]
+        print('  ' + str(dresp[-1].descriptor))
+        dresp[-1].mean = tokens[3]
+        dresp[-1].stddev = tokens[6]
+        dresp[-1].coefvar = tokens[12]
+
+    print('  Number of Dakota response functions = ' + str(len(dresp)) + '.')
+
+    return dresp
+    # }}}
+
+
+def mbstats_read(fidi, dresp, fline):  # {{{
+    #  function to find and read the moment - based statistics
+
+    if fline is None or fline == '' or fline.isspace():
+        fline = findline(fidi, 'Moment - based statistics for each response function')
+        return
+
+    print('Reading moment - based statistics for response functions:')
+
+    #  skip column headings of moment - based statistics
+
+    fline = fidi.readline()
+
+    while True:
+        fline = fidi.readline()
+        if fline == '' or fline.isspace():
+            break
+
+        [ntokens, tokens] = fltokens(fline)
+
+    #  add new response function and moment - based statistics
+
+        dresp.append(struct())
+        dresp[-1].descriptor = tokens[0]
+        print('  ' + str(dresp[-1].descriptor))
+        dresp[-1].mean = tokens[1]
+        dresp[-1].stddev = tokens[2]
+        dresp[-1].skewness = tokens[3]
+        dresp[-1].kurtosis = tokens[4]
+
+    print('  Number of Dakota response functions = ' + str(len(dresp)) + '.')
+
+    return dresp
+    # }}}
+
+
+def cis_read(fidi, dresp, fline):  # {{{
+    #  function to find and read the confidence intervals
+
+    if fline is None or fline == '' or fline.isspace():
+        fline = findline(fidi, '95% confidence intervals for each response function')
+        return
+
+    print('Reading 95% confidence intervals for response functions:')
+
+    while True:
+        fline = fidi.readline()
+        if fline == '' or fline.isspace():
+            break
+
+        [ntokens, tokens] = fltokens(fline)
+        #  check for column headings in Dakota 5.2
+        if (ntokens == 4):
+            fline = fidi.readline()
+            if fline == '' or fline.isspace():
+                break
+
+            [ntokens, tokens] = fltokens(fline)
+
+        #  find response function associated with confidence intervals
+        idresp = -1
+        for i in range(len(dresp)):
+            if strcmpi(tokens[0], dresp[i].descriptor):
+                idresp = i
+                break
+
+        if idresp < 0:
+            idresp = len(dresp)
+            dresp.append(struct())
+            dresp[idresp].descriptor = tokens[0]
+            print('  ' + str(dresp[idresp].descriptor))
+
+        #  add confidence intervals to response functions
+        dresp[i].meanci = np.array([[np.nan], [np.nan]])
+        dresp[i].stddevci = np.array([[np.nan], [np.nan]])
+
+        if (ntokens == 14):
+            dresp[i].meanci[0, 0] = tokens[4]
+            dresp[i].meanci[1, 0] = tokens[5]
+            dresp[i].stddevci[0, 0] = tokens[11]
+            dresp[i].stddevci[1, 0] = tokens[12]
+        else:
+            dresp[i].meanci[0, 0] = tokens[1]
+            dresp[i].meanci[1, 0] = tokens[2]
+            dresp[i].stddevci[0, 0] = tokens[3]
+            dresp[i].stddevci[1, 0] = tokens[4]
+
+    print('  Number of Dakota response functions = ' + str(len(dresp)) + '.')
+
+    return dresp
+    # }}}
+
+
+def cdfs_read(fidi, dresp, fline):  # {{{
+    #  function to find and read the cdf's
+
+    if fline is None or fline == '' or fline.isspace():
+        fline = findline(fidi, 'Probabilities for each response function')
+        if fline is None:
+            fline = findline(fidi, 'Level mappings for each response function')
+            if fline is None:
+                return
+
+    print('Reading CDF''s for response functions:')
+
+    while fline == '' or fline.isspace():
+        fline = fidi.readline()
+        if fline == '' or fline.isspace():
+            break
+
+    #  process header line of cdf
+
+        while (fline != '' and not fline.isspace()):
+            [ntokens, tokens] = fltokens(fline)
+
+    #  find response function associated with cdf
+    # idresp is an index, so it can be 0, default to - 1
+            idresp = -1
+            for i in range(len(dresp)):
+                if strcmpi(tokens[5], dresp[i].descriptor):
+                    idresp = i
+                    break
+            if idresp < 0:
+                idresp = len(dresp)
+                dresp.append(struct())
+                dresp[idresp].descriptor = tokens[5]
+                print('  ' + str(dresp(idresp).descriptor))
+
+            #  skip column headings of cdf
+            fline = fidi.readline()
+            fline = fidi.readline()
+
+            #  read and add cdf table to response function
+            fline = fidi.readline()
+            icdf = 0
+            while (fline != '' and not fline.isspace()) and not strncmpi(fline, 'Cumulative Distribution Function', 32):
+                [ntokens, tokens] = fltokens(fline)
+                icdf = icdf + 1
+                dresp[idresp].cdf = np.zeros((icdf, 4))
+                dresp[idresp].cdf[icdf - 1, 0:4] = np.nan
+                #  in later versions of Dakota, uncalculated columns are now blank
+                itoken = 0
+                for i in range(len(fline) / 19):
+                    if not isempty(fline[(i - 1) * 19:i * 19]):
+                        itoken = itoken + 1
+                        dresp[idresp].cdf[icdf - 1, i] = tokens[itoken]
+
+                fline = fidi.readline()
+
+    print('  Number of Dakota response functions = ' + str(len(dresp)) + '.')
+
+    return dresp
+    # }}}
+
+
+def pdfs_read(fidi, dresp, fline):  # {{{
+    #  function to find and read the pdf's
+
+    if fline is None or fline == '' or fline.isspace():
+        fline = findline(fidi, 'Probability Density Function (PDF) histograms for each response function')
+        return
+
+    print('Reading PDF''s for response functions:')
+
+    while (fline != '' and not fline.isspace()):
+        fline = fidi.readline()
+        if fline == '' or fline.isspace():
+            break
+
+        #  process header line of pdf
+        while (fline != '' and not fline.isspace()):
+            [ntokens, tokens] = fltokens(fline)
+
+            #  find response function associated with pdf
+            # idresp is an index, so it can be 0, default to - 1
+            idresp = -1
+            for i in range(len(dresp)):
+                if strcmpi(tokens[2], dresp[i].descriptor):
+                    idresp = i
+                    break
+
+            if idresp < 0:
+                idresp = len(dresp)
+                dresp.append(struct)
+                dresp[idresp].descriptor = tokens[2]
+                print('  ' + str(dresp[idresp].descriptor))
+
+            #  skip column headings of pdf
+            fline = fidi.readline()
+            fline = fidi.readline()
+
+            #  read and add pdf table to response function
+            fline = fidi.readline()
+            ipdf = 0
+            while (fline != '' and not fline.isspace()) and not strncmpi(fline, 'PDF for', 7):
+                [ntokens, tokens] = fltokens(fline)
+                ipdf = ipdf + 1
+                dresp[idresp].pdf = np.zeros((ipdf, 4))
+                dresp[idresp].pdf[ipdf - 1, 0:3] = np.nan
+                for i in range(3):
+                    dresp[idresp].pdf[ipdf - 1, i] = tokens[i]
+
+                fline = fidi.readline()
+
+    print('  Number of Dakota response functions = ' + str(len(dresp)) + '.')
+
+    return dresp
+    # }}}
+
+
+def corrmat_read(fidi, cmstr, fline):  # {{{
+    #  function to find and read a correlation matrix
+
+    if fline is None or fline == '' or fline.isspace():
+        fline = findline(fidi, cmstr)
+        if fline == '' or fline.isspace():
+            cmat = struct()
+            return
+
+    print('Reading ' + fline + '.')
+
+    cmat.title = fline
+
+    while (fline != '' and not fline.isspace()):
+        fline = fidi.readline()
+        if fline == '' or fline.isspace():
+            break
+
+        #  process column headings of matrix
+        [ntokens, tokens] = fltokens(fline)
+        cmat.column = np.empty((1, ntokens))
+        cmat.column.fill(0.0)
+        cmat.row = np.empty((1, 1))
+        cmat.row.fill(0.0)
+        cmat.matrix = np.zeros((1, ntokens))
+
+        for i in range(ntokens):
+            cmat.column[1, i] = str(tokens[i])
+
+        #  process rows of matrix, reading until blank line
+        nrow = 0
+        while True:
+            fline = fidi.readline()
+            if fline == '' or fline.isspace():
+                break
+
+            [ntokens, tokens] = fltokens(fline)
+
+            #  add row heading to matrix
+            nrow = nrow + 1
+            cmat.row[nrow - 1, 0] = str(tokens[0])
+
+            #  add row values to matrix
+            for i in range(1, ntokens):
+                cmat.matrix[nrow - 1, i - 1] = tokens[i]
+
+    return cmat
+    # }}}
+
+
+def mvstats_read(fidi, dresp, fline):  # {{{
+    #  function to find and read the MV statistics
+
+    if fline is None or fline == '' or fline.isspace():
+        fline = findline(fidi, 'MV Statistics for ')
+        if fline is None:
+            return
+
+    print('Reading MV statistics for response functions:')
+
+    ndresp = 0
+
+    while (fline != '' and not fline.isspace()) and strncmpi(fline, 'MV Statistics for ', 18):
+
+        #  add new response function and moments
+        [ntokens, tokens] = fltokens(fline)
+        dresp.append(struct())
+        dresp[-1].descriptor = tokens[3]
+        print('  ' + str(dresp[-1].descriptor))
+        fline = fidi.readline()
+        [ntokens, tokens] = fltokens(fline)
+        dresp[-1].mean = tokens[4]
+        fline = fidi.readline()
+        [ntokens, tokens] = fltokens(fline)
+        dresp[-1].stddev = tokens[6]
+
+        #  read and add importance factors to response function
+        idvar = 0
+        fline = fidi.readline()
+        if fline == '' or fline.isspace():
+            break
+
+        # shape: [[0], [0], [0]...]
+        dresp[-1].var = []
+        dresp[-1].impfac = []
+        dresp[-1].sens = []
+
+        while (fline != '' and not fline.isspace()) and strncmpi(fline, '  Importance Factor for variable ', 33):
+            [ntokens, tokens] = fltokens(fline)
+            idvar = idvar + 1
+            dresp[-1].var.append(str(tokens[4]))
+            dresp[-1].impfac.append(tokens[6])
+            if (ntokens >= 10):
+                dresp[-1].sens.append(tokens[9])
+            else:
+                dresp[-1].sens.append(np.nan)
+
+            fline = fidi.readline()
+
+        #  if importance factors missing, skip to cdf
+        if not idvar:
+            print('    Importance Factors not available.')
+            dresp[-1].var = []
+            dresp[-1].impfac = []
+            dresp[-1].sens = []
+            while type(fline) == str and (fline != '' and not fline.isspace()) and not strncmpi(fline, 'Cumulative Distribution Function', 32) and not strncmpi(fline, 'MV Statistics for ', 18) and not strncmp(fline, ' - ', 1):
+                fline = fidi.readline()
+
+        #  process header line of cdf
+        icdf = 0
+
+        # If there is a warning it MAY involve a lot of spaces; skip over them
+        if fline == '' or fline.isspace():
+            fline = fidi.readline()
+            # Usually: "Warning: negligible standard deviation renders CDF results suspect."
+            if strncmpi(fline, 'Warn', 4):
+                fline = fidi.readline()
+                if fline == '' or fline.isspace():
+                    fline = fidi.readline()
+
+        while (fline != '' and not fline.isspace()) and strncmpi(fline, 'Cumulative Distribution Function', 32):
+            [ntokens, tokens] = fltokens(fline)
+
+            #  find response function associated with cdf
+            # idresp is an index, so it can be 0, default to - 1
+            idresp = -1
+            for i in range(len(dresp)):
+                if strcmpi(tokens[5], dresp[i].descriptor):
+                    idresp = i
+                    break
+
+            if idresp < 0:
+                idresp = len(dresp)
+                dresp.append(struct())
+                dresp[idresp].descriptor = tokens[5]
+                print('  ' + str(dresp[idresp].descriptor))
+
+            #  skip column headings of cdf
+            fline = fidi.readline()
+            fline = fidi.readline()
+
+            #  read and add cdf table to response function
+            fline = fidi.readline()
+            while (fline != '' and not fline.isspace()) and not strncmpi(fline, 'MV Statistics for ', 18) and not strncmp(fline, ' - ', 1):
+                [ntokens, tokens] = fltokens(fline)
+                icdf = icdf + 1
+                dresp[idresp].cdf = np.zeros((icdf, 4))
+                dresp[idresp].cdf[icdf - 1, 0] = tokens[0]
+                dresp[idresp].cdf[icdf - 1, 1] = tokens[1]
+                if (ntokens == 4):
+                    dresp[idresp].cdf[icdf - 1, 2] = tokens[2]
+                    dresp[idresp].cdf[icdf - 1, 3] = tokens[3]
+                else:
+                    dresp[idresp].cdf[icdf - 1, 2] = np.nan
+                    dresp[idresp].cdf[icdf - 1, 3] = np.nan
+
+                fline = fidi.readline()
+
+        #  if cdf missing, skip to end of response function
+        if not icdf:
+            print('    Cumulative Distribution Function not available.')
+            dresp[ndresp].cdf = []
+            while (fline != '' and not fline.isspace()) and not strncmpi(fline, 'MV Statistics for ', 18) and not strncmp(fline, ' - ', 1):
+                fline = fidi.readline()
+
+    print('  Number of Dakota response functions = ' + str(len(dresp)) + '.')
+
+    return dresp
+    # }}}
+
+
+def best_read(fidi, dresp, fline):  # {{{
+    #  function to find and read the best evaluation
+
+    if fline is None or fline == '' or fline.isspace():
+        fline = findline(fidi, ' < < < < < Best ')
+        if fline is None:
+            return
+
+    if isempty(dresp):
+        dresp.append(struct())
+        dresp[-1].best = struct()
+
+    print('Reading values for best function evaluation:')
+
+    while (fline != '' and not fline.isspace()) and strncmpi(fline, ' < < < < < Best ', 11):
+        [ntokens, tokens] = fltokens(fline)
+
+    #  read and add best parameter(s)
+
+        if strncmpi(str(tokens[2]), 'parameter', 9):
+            print('  ' + fline)
+
+            fline = fidi.readline()
+            dresp.best.param = []
+            dresp.best.descriptor = ''
+
+            while (fline != '' and not fline.isspace()) and not strncmpi(fline, ' < < < < < Best ', 11):
+                [ntokens, tokens] = fltokens(fline)
+                dresp.best.param.append([0])
+                dresp.best.param[-1] = tokens[0]
+                dresp.best.descriptor = str(tokens[1])
+                fline = fidi.readline()
+
+        #  read and add best objective function(s)
+        elif strncmpi(str(tokens[2]), 'objective', 9) and strncmpi(str(tokens[3]), 'function', 8):
+            print('  ' + fline)
+
+            fline = fidi.readline()
+            dresp.best.of = []
+
+            while (fline != '' and not fline.isspace()) and not strncmpi(fline, ' < < < < < Best ', 11):
+                [ntokens, tokens] = fltokens(fline)
+                dresp.best.of.append(0)
+                dresp.best.of[-1] = tokens[0]
+                fline = fidi.readline()
+
+        #  read and add best residual norms
+        elif strncmpi(str(tokens[2]), 'residual', 8) and strncmpi(str(tokens[3]), 'norm', 4):
+            print('  ' + fline)
+            dresp.best.norm = tokens[5]
+            dresp.best.hnormsq = tokens[10]
+
+            fline = fidi.readline()
+
+            while (fline != '' and not fline.isspace()) and not strncmpi(fline, ' < < < < < Best ', 11):
+                fline = fidi.readline()
+
+        #  read and add best residual term(s)
+        elif strncmpi(str(tokens[2]), 'residual', 8) and strncmpi(str(tokens[3]), 'term', 4):
+            print('  ' + fline)
+
+            fline = fidi.readline()
+            dresp.best.res = []
+
+            while (fline != '' and not fline.isspace()) and not strncmpi(fline, '<<<<<Best ', 11):
+                [ntokens, tokens] = fltokens(fline)
+                dresp.best.res.append(0)
+                dresp.best.res[-1] = tokens[0]
+                fline = fidi.readline()
+
+        #  read and add best constraint value(s)
+        elif strncmpi(str(tokens[2]), 'constraint', 10) and strncmpi(str(tokens[3]), 'value', 5):
+            print('  ' + fline)
+
+            fline = fidi.readline()
+            dresp.best.nc = []
+
+            while (fline != '' and not fline.isspace()) and not strncmpi(fline, '<<<<<Best ', 11):
+                [ntokens, tokens] = fltokens(fline)
+                dresp.best.nc.append(0)
+                dresp.best.nc[-1] = tokens[0]
+                fline = fidi.readline()
+
+        #  read and add best data captured
+        elif strncmpi(str(tokens[2]), 'data', 4) and strncmpi(str(tokens[3]), 'captured', 8):
+            print('  ' + fline)
+            dresp.best.eval = tokens[7]
+
+            fline = fidi.readline()
+
+            while (fline != '' and not fline.isspace()) and not strncmpi(fline, ' < < < < < Best ', 11):
+                fline = fidi.readline()
+
+        #  read until next best or blank or end
+        else:
+            print('  ' + fline + '  (ignored)')
+
+            fline = fidi.readline()
+
+            while (fline != '' and not fline.isspace()) and not strncmpi(fline, ' < < < < < Best ', 11):
+                fline = fidi.readline()
+
+    return dresp
+    # }}}
+
+
+def vum_read(fidi, dresp, fline):  # {{{
+    #  function to find and read the volumetric uniformity measures
+
+    if fline is None or fline == '' or fline.isspace():
+        fline = findline(fidi, 'The following lists volumetric uniformity measures')
+        if fline is None:
+            return
+
+    if isempty(dresp):
+        dresp.append(struct())
+        dresp[-1].vum = []
+
+    print('Reading measures for volumetric uniformity.')
+    fline = fidi.readline()
+    fline = fidi.readline()
+
+    while (fline != '' and not fline.isspace()):
+        [ntokens, tokens] = fltokens(fline)
+        check = tokens[0].lower()
+        if check == 'chi':
+            dresp.vum.chi = tokens[3]
+        elif check == 'd':
+            dresp.vum.d = tokens[3]
+        elif check == 'h':
+            dresp.vum.h = tokens[3]
+        elif check == 'tau':
+            dresp.vum.tau = tokens[3]
+
+        fline = fidi.readline()
+
+    return dresp
+    # }}}
+
+
+def itcomp_read(fidi, fline):  # {{{
+    #  function to find and read the iterator completion
+
+    if fline is None or fline == '' or fline.isspace():
+        while True:
+            fline = findline(fidi, '<<<<< Iterator ')
+            if fline is None:
+                return
+
+            if (len(fline) > 26) and not (' completed.' in fline[15:]):
+                break
+
+    [ntokens, tokens] = fltokens(fline)
+    method = tokens[2]
+    print('Dakota iterator \'' + str(method) + '\' completed.')
+
+    return method
+    # }}}
+
+
+def findline(fidi, string, goto_line=False):  # {{{
+    #  function to find a file line starting with a specified string
+    #  by default, return to previous position, before search
+    #  if final argument is True, return such that fidi.readline() will read the line
+    #    immediately after the searched line (or the first line if the search failed)
+
+    ipos = fidi.tell()
+    npos = 0
+    for fline in fidi:
+        npos += len(fline)
+        if (strncmpi(fline, string, len(string))):
+            if goto_line:
+                fidi.seek(npos, 0)
+            else:
+                fidi.seek(ipos, 0)
+            return fline
+
+    #  issue warning and reset file position
+    print('Warning: findline:str_not_found: String ' + str(string) + ' not found in file.')
+    fidi.seek(ipos, 0)
+    return None
+    # }}}
+
+
+def fltokens(fline):  # {{{
+    #  function to parse a file line into tokens
+    if fline is None:
+        ntokens = -1
+        tokens = []
+        return [None, None]
+
+    if fline == '' or fline.isspace():
+        ntokens = 0
+        tokens = []
+        return [None, None]
+
+    # split wherever ' ' (space) or ':' occur
+    strings = re.split(':| ', fline)
+    # remove blank strings
+    strings = [a for a in strings if (a != '' and not a.isspace())]
+
+    ntokens = 0
+    tokens = ['' for i in range(len(strings))]
+
+    # try to format substrings to float where possible and count tokens and ignore invalid values
+    for i in range(len(strings)):
+        if isempty(strings[i]):
+            continue
+
+        # if the string is a number, make it a float, otherwise leave it alone
+        try:
+            tokens[ntokens] = float(strings[i])
+        except ValueError:
+            tokens[ntokens] = strings[i]
+
+        ntokens = ntokens + 1
+
+    return [ntokens, tokens]
+    # }}}
Index: /issm/trunk/src/m/qmu/expandresponses.py
===================================================================
--- /issm/trunk/src/m/qmu/expandresponses.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/expandresponses.py	(revision 24313)
@@ -2,18 +2,19 @@
 from helpers import *
 
-def expandresponses(md,responses):
-	#EXPANDRESPONSES - expand responses
 
-	fnames=fieldnames(responses)
+def expandresponses(md, responses):
+    #EXPANDRESPONSES - expand responses
 
-	# maintain order attributes were added
-	dresp = OrderedStruct()
-	
-	for k in fnames:
-		v = eval('responses.{}'.format(k))
-		exec 'dresp.{} = type(v)()'.format(k)
-		for j in range(len(v)):
-			#call setupdesign
-			exec 'dresp.{}=QmuSetupResponses(md,dresp.{},v[j])'.format(k,k)
+    fnames = fieldnames(responses)
 
-	return dresp
+    # maintain order attributes were added
+    dresp = OrderedStruct()
+
+    for k in fnames:
+        v = eval('responses.{}'.format(k))
+        exec('dresp.{} = type(v)()'.format(k))
+        for j in range(len(v)):
+            #call setupdesign
+            exec('dresp.{}=QmuSetupResponses(md, dresp.{}, v[j])'.format(k, k))
+
+    return dresp
Index: /issm/trunk/src/m/qmu/expandvariables.py
===================================================================
--- /issm/trunk/src/m/qmu/expandvariables.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/expandvariables.py	(revision 24313)
@@ -4,25 +4,24 @@
 from qmu_classes import *
 
-def expandvariables(md,variables):
 
-	fnames=fieldnames(variables)
+def expandvariables(md, variables):
 
-	# maintain order attributes were added
-	dvar = OrderedStruct()
+    fnames = fieldnames(variables)
 
-	for k in fnames:
-		v = eval('variables.{}'.format(k))
+    # maintain order attributes were added
+    dvar = OrderedStruct()
 
-		#  for linear constraints, just copy
-		if isinstance(v,linear_inequality_constraint) or isinstance(v,linear_equality_constraint):
-			exec 'dvar.{} = v'.format(k)
+    for k in fnames:
+        v = eval('variables.{}'.format(k))
 
-		#  for variables, call the setup function
-		else:
-			exec 'dvar.{} = type(v)()'.format(k)
-			for j in range(len(v)):
-				#call setupdesign
-				exec 'dvar.{}=QmuSetupVariables(md,dvar.{},v[j])'.format(k,k)
+    #  for linear constraints, just copy
+        if isinstance(v, linear_inequality_constraint) or isinstance(v, linear_equality_constraint):
+            exec('dvar.{} = v'.format(k))
 
-
-	return dvar
+    #  for variables, call the setup function
+        else:
+            exec('dvar.{} = type(v)()'.format(k))
+            for j in range(len(v)):
+                #call setupdesign
+                exec('dvar.{}=QmuSetupVariables(md, dvar.{}, v[j])'.format(k, k))
+    return dvar
Index: /issm/trunk/src/m/qmu/helpers.py
===================================================================
--- /issm/trunk/src/m/qmu/helpers.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/helpers.py	(revision 24313)
@@ -3,337 +3,349 @@
 from copy import deepcopy
 
+
 class struct(object):
-	'''An empty struct that can be assigned arbitrary attributes'''
-	pass
+    '''An empty struct that can be assigned arbitrary attributes'''
+    pass
+
 
 class Lstruct(list):
-	'''
-An empty struct that can be assigned arbitrary attributes;
-	but can also be accesed as a list. Eg. x.y = 'hello', x[:] = ['w','o','r','l','d']
+    '''
+An empty struct that can be assigned arbitrary attributes
+    but can also be accesed as a list. Eg. x.y = 'hello', x[:] = ['w', 'o', 'r', 'l', 'd']
 
 Note that 'x' returns the array and x.__dict__ will only return
-	attributes other than the array
-
-List-based and struct-based behaviors work normally, however they are referenced
-	as if the other does not exist; len(x) corresponds only to
-	the list component of x, len(x.a) corresponds to x.a, x.__dict__
-	corresponds only to the non-x-list attributes
+    attributes other than the array
+
+List - based and struct - based behaviors work normally, however they are referenced
+    as if the other does not exist; len(x) corresponds only to
+    the list component of x, len(x.a) corresponds to x.a, x.__dict__
+    corresponds only to the non - x - list attributes
 
 Example uses:
 
-x = Lstruct(1,2,3,4) -> [1,2,3,4]
-	x.a = 'hello'
-	len(x) -> 4
-	x.append(5)
-	len(x) -> 5
-	x[2] -> 3
-	x.a -> 'hello'
-	print x -> [1,2,3,4,5]
-	x.__dict__ -> {'a': 'hello'}
-	x.b = [6,7,8,9]
-	x.b[-1] -> 9
-	len(x.b) -> 4
-
-Other valid constructors: 
-	      x = Lstruct(1,2,3,a='hello') -> x.a -> 'hello', x -> [1,2,3]
-	      x = Lstruct(1,2,3)(a='hello')
-	      x = Lstruct([1,2,3],x='hello')
-	      x = Lstruct((1,2,3),a='hello')
+x = Lstruct(1, 2, 3, 4) -> [1, 2, 3, 4]
+    x.a = 'hello'
+    len(x) -> 4
+    x.append(5)
+    len(x) -> 5
+    x[2] -> 3
+    x.a -> 'hello'
+    print x -> [1, 2, 3, 4, 5]
+    x.__dict__ -> {'a':'hello'}
+    x.b = [6, 7, 8, 9]
+    x.b[-1] -> 9
+    len(x.b) -> 4
+
+Other valid constructors:
+          x = Lstruct(1, 2, 3, a = 'hello') -> x.a -> 'hello', x -> [1, 2, 3]
+          x = Lstruct(1, 2, 3)(a = 'hello')
+          x = Lstruct([1, 2, 3], x = 'hello')
+          x = Lstruct((1, 2, 3), a = 'hello')
 
 Credit: https://github.com/Vectorized/Python-Attribute-List
 '''
 
-	def __new__(self, *args, **kwargs):
-		return super(Lstruct, self).__new__(self, args, kwargs)
-
-	def __init__(self, *args, **kwargs):
-		if len(args) == 1 and hasattr(args[0], '__iter__'):
-			list.__init__(self, args[0])
-		else:
-			list.__init__(self, args)
-		self.__dict__.update(kwargs)
-
-	def __call__(self, **kwargs):
-		self.__dict__.update(kwargs)
-		return self
+    def __new__(self, *args, **kwargs):
+        return super(Lstruct, self).__new__(self, args, kwargs)
+
+    def __init__(self, *args, **kwargs):
+        if len(args) == 1 and hasattr(args[0], '__iter__'):
+            list.__init__(self, args[0])
+        else:
+            list.__init__(self, args)
+        self.__dict__.update(kwargs)
+
+    def __call__(self, **kwargs):
+        self.__dict__.update(kwargs)
+        return self
+
 
 class OrderedStruct(object):
-	'''
+    '''
 A form of dictionary-like structure that maintains the
-	ordering in which its fields/attributes and their
-	corresponding values were added.
+    ordering in which its fields / attributes and their
+    corresponding values were added.
 
 OrderedDict is a similar device, however this class
-	can be used as an "ordered struct/class" giving
-	it much more flexibility in practice. It is
-	also easier to work with fixed valued keys in-code.
+    can be used as an "ordered struct / class" giving
+    it much more flexibility in practice. It is
+    also easier to work with fixed valued keys in-code.
 
 Eg:
-OrderedDict:    	# a bit clumsy to use and look at
-	x['y'] = 5
-
-OrderedStruct:  	# nicer to look at, and works the same way 
-	x.y    = 5
-	OR
-	x['y'] = 5	# supports OrderedDict-style usage
-    
+OrderedDict:  # a bit clumsy to use and look at
+    x['y'] = 5
+
+OrderedStruct:  # nicer to look at, and works the same way
+    x.y = 5
+    OR
+    x['y'] = 5  # supports OrderedDict-style usage
+
 Supports: len(x), str(x), for-loop iteration.
 Has methods: x.keys(), x.values(), x.items(), x.iterkeys()
 
 Usage:
-	x = OrderedStruct()
-	x.y = 5
-	x.z = 6
-	OR
-	x = OrderedStruct('y',5,'z',6)
-
-	# note below that the output fields as iterables are always
-	#	in the same order as the inputs
-
-	x.keys()   -> ['y','z']
-	x.values() -> [5,6]
-	x.items()  -> [('y',6),('z',6)]
-	x.__dict__ -> [('y',6),('z',6)]
-	vars(x)    -> [('y',6),('z',6)]
-
-	x.y    -> 5
-	x['y'] -> 5
-	x.z    -> 6
-	x['z'] -> 6
-
-	for i in x:	# same as x.items()
-		print i
-	->
-	('x',5)
-	('y',6)
-
-	Note: to access internal fields use dir(x)
-		(input fields will be included, but
-		are not technically internals)
-	'''
-    
-	def __init__(self,*args):
-		'''Provided either nothing or a series of strings, construct a structure that will,
+    x = OrderedStruct()
+    x.y = 5
+    x.z = 6
+    OR
+    x = OrderedStruct('y', 5, 'z', 6)
+
+    # note below that the output fields as iterables are always
+    #    in the same order as the inputs
+
+    x.keys() -> ['y', 'z']
+    x.values() -> [5, 6]
+    x.items() -> [('y', 6), ('z', 6)]
+    x.__dict__ -> [('y', 6), ('z', 6)]
+    vars(x) -> [('y', 6), ('z', 6)]
+
+    x.y -> 5
+    x['y'] -> 5
+    x.z -> 6
+    x['z'] -> 6
+
+    for i in x:  # same as x.items()
+        print i
+     ->
+    ('x', 5)
+    ('y', 6)
+
+    Note: to access internal fields use dir(x)
+        (input fields will be included, but
+        are not technically internals)
+    '''
+
+    def __init__(self, *args):
+        '''Provided either nothing or a series of strings, construct a structure that will,
 when accessed as a list, return its fields in the same order in which they were provided'''
 
-		# keys and values
-		self._k = []
-		self._v = []
-	    
-		if len(args) == 0:
-			return
-
-		if len(args) % 2 != 0:
-			raise RuntimeError('OrderedStruct input error: OrderedStruct(*args) call must have an even number of inputs, in key/value pairs')
-
-		for a,b in zip(args[0::2],args[1::2]):
-			exec('self.%s = b')%(a)
-		return
-
-	def __repr__(self):
-		s = 'OrderedStruct:\n\t'
-		for a,b in zip(self._k,self._v):
-			s += str(a) + ' : ' + str(b) + '\n\t'
-		return s
-
-	def __len__(self):
-		return len(self._k)
-
-	def __getattr__(self, attr):
-		# called when __getattribute__ fails
-		try:
-			# check if in keys, then access
-			_k = object.__getattribute__(self, '_k')
-			_v = object.__getattribute__(self, '_v')
-			pos = _k.index(attr)
-			return _v[pos]
-		except ValueError:
-			# not in keys, not a valid attribute, raise error
-			raise AttributeError('Attribute "'+str(attr)+'" does not exist.')
-
-	def __getattribute__(self, attr):
-		# re-route calls to vars(x) and x.__dict__
-		if attr == '__dict__':
-			return OrderedDict(self.items())
-		else:
-			return object.__getattribute__(self, attr)
-
-	def __getitem__(self, key):
-		return self._v[self._k.index(key)]
-
-	def __setattr__(self, name, value):
-		#super(OrderedStruct, self).__setattr__(name,value)
-		if name in ['_k','_v']:
-			object.__setattr__(self, name, value)
-		elif name not in self._k:
-			self._k.append(name)
-			self._v.append(value)
-		else:
-			self._v[self._k.index(name)] = value
-
-	def __delattr__(self, key):
-		if name not in self._k:
-			raise AttributeError('Attribute "'+str(attr)+'" does not exist or is an internal field and therefore cannot be deleted safely.')
-		self.pop(key)
-
-	def __iter__(self):
-		for a,b in zip(self._k,self._v):
-			yield(a,b)
-
-	def __copy__(self):
-		# shallow copy, hard copies of trivial attributes,
-		# references to structures like lists/OrderedDicts
-		# unless redefined as an entirely different structure
-		newInstance = type(self)()
-		for k,v in self.items():
-			exec('newInstance.%s = v')%(k)
-		return newInstance
-
-	def __deepcopy__(self,memo=None):
-		# hard copy of all attributes
-		# same thing but call deepcopy recursively
-		# technically not how it should be done,
-		# (see https://docs.python.org/2/library/copy.html#copy.deepcopy )
-		# but will generally work in this case
-		newInstance = type(self)()
-		for k,v in self.items():
-			exec('newInstance.%s = deepcopy(v)')%(k)
-		return newInstance
-
-	def iterkeys(self):
-		for k in self._k:
-			yield k
-
-	def pop(self,key):
-		i = self._k.index(key)
-		k = self._k.pop(i)
-		v = self._v.pop(i)
-		#exec('del self.%s')%(key)
-		return (k,v)
-
-	def keys(self):
-		return self._k
-	def values(self):
-		return self._v
-	def items(self):
-		return zip(self._k,self._v)
+    # keys and values
+        self._k = []
+        self._v = []
+
+        if len(args) == 0:
+            return
+
+        if len(args) % 2 != 0:
+            raise RuntimeError('OrderedStruct input error: OrderedStruct(*args) call must have an even number of inputs, in key / value pairs')
+
+        for a, b in zip(args[0::2], args[1::2]):
+            exec(('self.%s = b') % (a))
+        return
+
+    def __repr__(self):
+        s = 'OrderedStruct:\n\t'
+        for a, b in zip(self._k, self._v):
+            s += str(a) + ' : ' + str(b) + '\n\t'
+        return s
+
+    def __len__(self):
+        return len(self._k)
+
+    def __getattr__(self, attr):
+        # called when __getattribute__ fails
+        try:
+            # check if in keys, then access
+            _k = object.__getattribute__(self, '_k')
+            _v = object.__getattribute__(self, '_v')
+            pos = _k.index(attr)
+            return _v[pos]
+        except ValueError:
+            # not in keys, not a valid attribute, raise error
+            raise AttributeError('Attribute "' + str(attr) + '" does not exist.')
+
+    def __getattribute__(self, attr):
+        # re-route calls to vars(x) and x.__dict__
+        if attr == '__dict__':
+            return OrderedDict(list(self.items()))
+        else:
+            return object.__getattribute__(self, attr)
+
+    def __getitem__(self, key):
+        return self._v[self._k.index(key)]
+
+    def __setattr__(self, name, value):
+        #super(OrderedStruct, self).__setattr__(name, value)
+        if name in ['_k', '_v']:
+            object.__setattr__(self, name, value)
+        elif name not in self._k:
+            self._k.append(name)
+            self._v.append(value)
+        else:
+            self._v[self._k.index(name)] = value
+
+    def __delattr__(self, key):
+        if name not in self._k:
+            raise AttributeError('Attribute "' + str(attr) + '" does not exist or is an internal field and therefore cannot be deleted safely.')
+        self.pop(key)
+
+    def __iter__(self):
+        for a, b in zip(self._k, self._v):
+            yield(a, b)
+
+    def __copy__(self):
+        # shallow copy, hard copies of trivial attributes,
+        # references to structures like lists / OrderedDicts
+        # unless redefined as an entirely different structure
+        newInstance = type(self)()
+        for k, v in list(self.items()):
+            exec(('newInstance.%s = v') % (k))
+        return newInstance
+
+    def __deepcopy__(self, memo=None):
+        # hard copy of all attributes
+        # same thing but call deepcopy recursively
+        # technically not how it should be done,
+        # (see https://docs.python.org/2/library/copy.html  #copy.deepcopy )
+        # but will generally work in this case
+        newInstance = type(self)()
+        for k, v in list(self.items()):
+            exec(('newInstance.%s = deepcopy(v)') % (k))
+        return newInstance
+
+    def iterkeys(self):
+        for k in self._k:
+            yield k
+
+    def pop(self, key):
+        i = self._k.index(key)
+        k = self._k.pop(i)
+        v = self._v.pop(i)
+    #exec('del self.%s')%(key)
+        return (k, v)
+
+    def keys(self):
+        return self._k
+
+    def values(self):
+        return self._v
+
+    def items(self):
+        return list(zip(self._k, self._v))
+
 
 def isempty(x):
-	'''returns true if object is +\-infinity, NaN, None, '', has length 0, or is an
-	array/matrix composed only of such components (includes mixtures of "empty" types)'''
-
-	if type(x) in [list,np.ndarray,tuple]:
-		if np.size(x) == 0:
-			return True
-
-		# if anything in that array/matrix is not empty, the whole thing is not empty
-		try:
-			x = np.concatenate(x)
-		except (ValueError):
-			pass
-		for i in x:
-			if not isempty(i):
-				return False
-		# the array isn't empty but is full of "empty" type objects, so return True
-		return True
-
-	if x == None:
-		return True
-	if type(x) == str and x.lower() in ['','nan','none','inf','infinity','-inf','-infinity']:
-		return True
-
-	# type may not be understood by numpy, in which case it definitely is NOT NaN or infinity
-	try:
-		if np.isnan(x) or np.isinf(x):
-			return True
-	except (TypeError):
-		pass
-
-	# if all of that fails, then it is not empty
-	return False
-
-def fieldnames(x,ignore_internals = True):
-	'''returns a list of fields of x
-	ignore_internals ignores all fieldnames starting with '_' and is True by default'''
-	result = vars(x).keys()
-
-	if ignore_internals:
-		result = filter(lambda i: i[0] != '_',result)
-
-	return result
-
-def isfield(x,y,ignore_internals=True):
-	'''is y is a field of x?
-	ignore_internals ignores all fieldnames starting with '_' and is True by default'''
-	return str(y) in fieldnames(x,ignore_internals)
+    '''
+    returns true if object is +  -infinity, NaN, None, '', has length 0, or is an
+    array/matrix composed only of such components (includes mixtures of "empty" types)'''
+
+    if type(x) in [list, np.ndarray, tuple]:
+        if np.size(x) == 0:
+            return True
+
+    # if anything in that array / matrix is not empty, the whole thing is not empty
+        try:
+            x = np.concatenate(x)
+        except (ValueError):
+            pass
+        for i in x:
+            if not isempty(i):
+                return False
+    # the array isn't empty but is full of "empty" type objects, so return True
+        return True
+
+    if x is None:
+        return True
+    if type(x) == str and x.lower() in ['', 'nan', 'none', 'inf', 'infinity', '-inf', '-infinity']:
+        return True
+
+    # type may not be understood by numpy, in which case it definitely is NOT NaN or infinity
+    try:
+        if np.isnan(x) or np.isinf(x):
+            return True
+    except (TypeError):
+        pass
+
+    # if all of that fails, then it is not empty
+    return False
+
+
+def fieldnames(x, ignore_internals=True):
+    '''returns a list of fields of x
+    ignore_internals ignores all fieldnames starting with '_' and is True by default'''
+    result = list(vars(x).keys())
+
+    if ignore_internals:
+        result = [i for i in result if i[0] != '_']
+
+    return result
+
+
+def isfield(x, y, ignore_internals=True):
+    '''is y is a field of x?
+    ignore_internals ignores all fieldnames starting with '_' and is True by default'''
+    return str(y) in fieldnames(x, ignore_internals)
+
 
 def fileparts(x):
-	'''
-	given:   "path/path/.../file_name.ext"
-	returns: [path,file_name,ext] (list of strings)'''
-	try:
-		a = x[:x.rindex('/')]		#path
-		b = x[x.rindex('/')+1:]		#full filename
-	except ValueError:			#no path provided
-		a = ''
-		b = x
-	try:
-		c,d = b.split('.')		#file name, extension
-	except ValueError:			#no extension provided
-		return [a,b,'']
-	return [a,c,'.'+d]
+    '''
+    given:   "path/path/.../file_name.ext"
+    returns: [path, file_name, ext] (list of strings)'''
+    try:
+        a = x[:x.rindex('/')]  #path
+        b = x[x.rindex('/') + 1:]  #full filename
+    except ValueError:  #no path provided
+        a = ''
+        b = x
+    try:
+        c, d = b.split('.')  #file name, extension
+    except ValueError:  #no extension provided
+        return [a, b, '']
+    return [a, c, '.' + d]
+
 
 def fullfile(*args):
-	'''
-	use:
-
-	fullfile(path, path, ... , file_name+ext)
-	returns: "path/path/.../file_name.ext"
-
-	with all arguments as strings with no "/"s
-
-	regarding extensions and the '.':
-	as final arguments ('file.doc') or ('file'+'.doc') will work;
-	('final','.doc'), and the like, will not (you'd get 'final/.doc')
+    '''
+    use:
+
+    fullfile(path, path, ... , file_name + ext)
+    returns: "path/path/.../file_name.ext"
+
+    with all arguments as strings with no "/"s
+
+    regarding extensions and the '.':
+    as final arguments ('file.doc') or ('file' + '.doc') will work
+    ('final', '.doc'), and the like, will not (you'd get 'final/.doc')
 '''
-	result = str(args[0])
-	for i in range(len(args[1:])):
-		# if last argument wasn't empty, add a '/' between it and the next argument
-		if len(args[i]) != 0:
-			result += '/'+str(args[i+1])
-		else:
-			result += str(args[i+1])
-	return result
-
-def findline(fidi,s):
-	'''
-	returns full first line containing s (as a string), or None
-	Note: will include any newlines or tabs that occur in that line, 
-	use str(findline(f,s)).strip() to remove these, str() in case result is None'''
-	for line in fidi:
-		if s in line:
-			return line
-	return None
-
-def empty_nd_list(shape,filler=0.,as_numpy_ndarray=False):
-	'''
+    result = str(args[0])
+    for i in range(len(args[1:])):
+        # if last argument wasn't empty, add a '/' between it and the next argument
+        if len(args[i]) != 0:
+            result += '/' + str(args[i + 1])
+        else:
+            result += str(args[i + 1])
+    return result
+
+
+def findline(fidi, s):
+    '''
+    returns full first line containing s (as a string), or None
+    Note: will include any newlines or tabs that occur in that line,
+    use str(findline(f, s)).strip() to remove these, str() in case result is None'''
+    for line in fidi:
+        if s in line:
+            return line
+    return None
+
+
+def empty_nd_list(shape, filler=0., as_numpy_ndarray=False):
+    '''
 returns a python list of the size/shape given (shape must be int or tuple)
-	the list will be filled with the optional second argument
-
-	filler is 0.0 by default
-
-	as_numpy_ndarray will return the result as a numpy.ndarray and is False by default
-
-	Note: the filler must be either None/np.nan/float('NaN'), float/double, or int
-		other numpy and float values such as +/- np.inf will also work
+    the list will be filled with the optional second argument
+
+    filler is 0.0 by default
+
+    as_numpy_ndarray will return the result as a numpy.ndarray and is False by default
+
+    Note: the filler must be either None/np.nan/float('NaN'), float/double, or int
+        other numpy and float values such as +/- np.inf will also work
 
 use:
-	empty_nd_list((5,5), 0.0)	# returns a 5x5 matrix of 0.0's
-	empty_nd_list(5, None)		# returns a 5 long array of NaN
+    empty_nd_list((5, 5), 0.0)  # returns a 5x5 matrix of 0.0's
+    empty_nd_list(5, None)  # returns a 5 long array of NaN
 '''
-	result = np.empty(shape)
-	result.fill(filler)
-	if not as_numpy_ndarray:
-		return result.tolist()
-	return result
-
+    result = np.empty(shape)
+    result.fill(filler)
+    if not as_numpy_ndarray:
+        return result.tolist()
+    return result
Index: /issm/trunk/src/m/qmu/importancefactors.m
===================================================================
--- /issm/trunk/src/m/qmu/importancefactors.m	(revision 24312)
+++ /issm/trunk/src/m/qmu/importancefactors.m	(revision 24313)
@@ -44,7 +44,10 @@
 	factors=importancefactors;
 	return;
+elseif count==max(md.qmu.epartition+1)
+	%distribute importance factor
+	factors=importancefactors(md.qmu.epartition'+1); %md.qmu.partition was created to index "c" style
 else
 	%distribute importance factor
-	factors=importancefactors(md.qmu.partition'+1); %md.qmu.partition was created to index "c" style
+	factors=importancefactors(md.qmu.vpartition'+1); %md.qmu.partition was created to index "c" style
 end
 
Index: /issm/trunk/src/m/qmu/importancefactors.py
===================================================================
--- /issm/trunk/src/m/qmu/importancefactors.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/importancefactors.py	(revision 24313)
@@ -2,62 +2,67 @@
 from MatlabFuncs import *
 
-def importancefactors(md,variablename,responsename):
-	'''IMPORTANCEFACTORS - compute importance factors for a certain variable and response.
-	
+
+def importancefactors(md, variablename, responsename):
+    '''IMPORTANCEFACTORS - compute importance factors for a certain variable and response.
+
 Usage:
-	factors=importancefactors(md,variablename,responsename)
-	
-	Example: factors=importancefactors(md,'drag','max_vel')
+    factors = importancefactors(md, variablename, responsename)
+
+    Example: factors = importancefactors(md, 'drag', 'max_vel')
 '''
 
-	variablenamelength=len(variablename)
+    variablenamelength = len(variablename)
 
-	#go through all response functions and find the one corresponding to the correct responsename
-	responsefunctions=md.qmu.results.dresp_out
-	found=-1
-	for i in range(len(responsefunctions)):
-		if strcmpi(responsefunctions[i].descriptor,responsename):
-			found=i
-			break
-	if found < 0:
-		raise RuntimeError('importancefactors error message: could not find correct response function')
+    #go through all response functions and find the one corresponding to the correct responsename
+    responsefunctions = md.qmu.results.dresp_out
+    found = -1
+    for i in range(len(responsefunctions)):
+        if responsefunctions[i].descriptor == responsename:
+            found = i
+            break
+    if found < 0:
+        raise RuntimeError('importancefactors error message: could not find correct response function')
 
-	responsefunctions=responsefunctions[found]
-	nfun=np.size(responsefunctions.var)
+    responsefunctions = responsefunctions[found]
+    nfun = np.size(responsefunctions.var)
 
-	#Now recover response to the correct design variable
-	importancefactors=[]
-	count=0
-	for i in range(nfun):
-		desvar=responsefunctions.var[i]
-		if strncmpi(desvar,variablename,variablenamelength):
-			importancefactors.append(responsefunctions.impfac[i])
-			count=count+1
-	
-	if count==0:
-		raise RuntimeError('importancefactors error message: either response does not exist, or importancefactors are empty')
+    #Now recover response to the correct design variable
+    importancefactors = []
+    count = 0
+    for i in range(nfun):
+        desvar = responsefunctions.var[i]
+        if strncmpi(desvar, variablename, variablenamelength):
+            importancefactors.append(responsefunctions.impfac[i])
+            count = count + 1
 
-	importancefactors = np.array(importancefactors)
+    if count == 0:
+        raise RuntimeError('importancefactors error message: either response does not exist, or importancefactors are empty')
 
-	if count==1: #we have scalar
-		factors=importancefactors
-		return factors
-	else:
-		#distribute importance factor
-		factors=importancefactors[(md.qmu.partition.conj().T).flatten().astype(int)]
-		#md.qmu.partition was created to index "c" style
+    importancefactors = np.array(importancefactors)
 
-	#weight importancefactors by area
-	#if numel(factors)==md.mesh.numberofvertices,
-	#	#get areas for each vertex.
-	#	aire=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y)
-	#	num_elements_by_node=md.nodeconnectivity(:,)
-	#	grid_aire=zeros(md.mesh.numberofvertices,1)
-	#	for i=1:md.mesh.numberofvertices,
-	#		for j=1:num_elements_by_node(i),
-	#			grid_aire(i)=grid_aire(i)+aire(md.nodeconnectivity(i,j))
-	#		
-	#	
-	#	factors=factors./grid_aire
-	#
-	return factors
+    if count == 1:  #we have scalar
+        factors = importancefactors
+        return factors
+    elif count == np.max(md.qmu.epartition + 1):
+        #distribute importance factor
+        factors = importancefactors[(md.qmu.epartition.conj().T).flatten().astype(int)]
+    #md.qmu.partition was created to index "c" style
+    else:
+        #distribute importance factor
+        factors = importancefactors[(md.qmu.vpartition.conj().T).flatten().astype(int)]
+    #md.qmu.partition was created to index "c" style
+
+    #weight importancefactors by area
+    #if numel(factors) == md.mesh.numberofvertices,
+    #  #get areas for each vertex.
+    #    aire = GetAreas(md.mesh.elements, md.mesh.x, md.mesh.y)
+    #    num_elements_by_node = md.nodeconnectivity(:, )
+    #    grid_aire = zeros(md.mesh.numberofvertices, 1)
+    #    for i = 1:md.mesh.numberofvertices,
+    #        for j = 1:num_elements_by_node(i),
+    #            grid_aire(i)=grid_aire(i) + aire(md.nodeconnectivity(i, j))
+    #
+    #
+    #    factors = factors. / grid_aire
+    #
+    return factors
Index: /issm/trunk/src/m/qmu/lclist_write.py
===================================================================
--- /issm/trunk/src/m/qmu/lclist_write.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/lclist_write.py	(revision 24313)
@@ -8,60 +8,56 @@
 from linear_inequality_constraint import *
 
-def lclist_write(fidi,cstring,cstring2,dvar):
-	'''
+
+def lclist_write(fidi, cstring, cstring2, dvar):
+    '''
 function to write linear constraint list
 '''
-	if dvar == None:
-		return
+    if dvar is None:
+        return
 
-	#  put linear constraints into lists for writing
+    #  put linear constraints into lists for writing
 
-	nvar=0
-	pmatrix=[]
-	plower =[]
-	pupper =[]
-	ptarget=[]
-	pstype =[]
-	pscale =[]
+    nvar = 0
+    pmatrix = []
+    plower = []
+    pupper = []
+    ptarget = []
+    pstype = []
+    pscale = []
 
-	fnames=fieldnames(dvar)
-	for i in range(np.size(fnames)):
-		nvar=nvar+np.size(vars(dvar)[fnames[i]])
-		pmatrix=[pmatrix,prop_matrix(vars(dvar)[fnames[i]])]
-		plower =[plower ,prop_lower(vars(dvar)[fnames[i]]) ]
-		pupper =[pupper ,prop_upper(vars(dvar)[fnames[i]]) ]
-		ptarget=[ptarget,prop_target(vars(dvar)[fnames[i]])]
-		pstype =[pstype ,prop_stype(vars(dvar)[fnames[i]]) ]
-		pscale =[pscale ,prop_scale(vars(dvar)[fnames[i]]) ]
+    fnames = fieldnames(dvar)
+    for i in range(np.size(fnames)):
+        nvar = nvar + np.size(vars(dvar)[fnames[i]])
+        pmatrix = [pmatrix, prop_matrix(vars(dvar)[fnames[i]])]
+        plower = [plower, prop_lower(vars(dvar)[fnames[i]])]
+        pupper = [pupper, prop_upper(vars(dvar)[fnames[i]])]
+        ptarget = [ptarget, prop_target(vars(dvar)[fnames[i]])]
+        pstype = [pstype, prop_stype(vars(dvar)[fnames[i]])]
+        pscale = [pscale, prop_scale(vars(dvar)[fnames[i]])]
 
+    #  write linear constraints
+    print('  Writing ' + str(nvar) + ' ' + cstring + ' linear constraints.')
 
-	#  write linear constraints
+    if len(pmatrix) != 0:
+        fidi.write('\t  ' + cstring2 + '_matrix =\n')
+        vector_write(fidi, '\t    ', pmatrix, 6, 76)
 
-	print '  Writing '+str(nvar)+' '+cstring+' linear constraints.'
+    if len(plower) != 0:
+        fidi.write('\t  ' + cstring2 + '_lower_bounds =\n')
+        vector_write(fidi, '\t    ', plower, 6, 76)
 
-	if len(pmatrix) != 0:
-		fidi.write('\t  '+cstring2+'_matrix =\n')
-		vector_write(fidi,'\t    ',pmatrix,6,76)
+    if len(pupper) != 0:
+        fidi.write('\t  ' + cstring2 + '_upper_bounds =\n')
+        vector_write(fidi, '\t    ', pupper, 6, 76)
 
-	if len(plower) != 0:
-		fidi.write('\t  '+cstring2+'_lower_bounds =\n')
-		vector_write(fidi,'\t    ',plower ,6,76)
+    if len(ptarget) != 0:
+        fidi.write('\t  ' + cstring2 + '_targets =\n')
+        vector_write(fidi, '\t    ', ptarget, 6, 76)
 
-	if len(pupper) != 0:
-		fidi.write('\t  '+cstring2+'_upper_bounds =\n')
-		vector_write(fidi,'\t    ',pupper ,6,76)
+    if len(pstype) != 0:
+        fidi.write('\t  ' + cstring2 + '_scale_types =\n')
+        vector_write(fidi, '\t    ', pstype, 6, 76)
 
-	if len(ptarget) != 0:
-		fidi.write('\t  '+cstring2+'_targets =\n')
-		vector_write(fidi,'\t    ',ptarget,6,76)
-
-	if len(pstype) != 0:
-		fidi.write('\t  '+cstring2+'_scale_types =\n')
-		vector_write(fidi,'\t    ',pstype ,6,76)
-
-	if len(pscale) != 0:
-		fidi.write('\t  '+cstring2+'_scales =\n')
-		vector_write(fidi,'\t    ',pscale ,6,76)
-
-
-
+    if len(pscale) != 0:
+        fidi.write('\t  ' + cstring2 + '_scales =\n')
+        vector_write(fidi, '\t    ', pscale, 6, 76)
Index: /issm/trunk/src/m/qmu/param_write.py
===================================================================
--- /issm/trunk/src/m/qmu/param_write.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/param_write.py	(revision 24313)
@@ -2,26 +2,24 @@
 from helpers import *
 
-def param_write(fidi,sbeg,pname,smid,s,params):
-	'''
+
+def param_write(fidi, sbeg, pname, smid, s, params):
+    '''
 function to write a parameter
 '''
-	if not isfield(params,pname):
-		print 'WARNING: param_write:param_not_found: Parameter '+str(pname)+' not found in structure.'
-		return
+    if not isfield(params, pname):
+        print('WARNING: param_write:param_not_found: Parameter {} not found in structure.'.format(pname))
+        return
 
-	params_pname = vars(params)[pname]
+    params_pname = vars(params)[pname]
 
-	if type(params_pname) == bool and (not params_pname):
-		return
+    if type(params_pname) == bool and (not params_pname):
+        return
 
-	if  type(params_pname) == bool:
-		fidi.write(sbeg+str(pname)+s)
+    if type(params_pname) == bool:
+        fidi.write(sbeg + str(pname) + s)
 
-	elif type(params_pname) in [str]:
-		fidi.write(sbeg+str(pname)+smid+params_pname+s)
+    elif type(params_pname) in [str]:
+        fidi.write(sbeg + pname + smid + params_pname + s)
 
-	elif type(params_pname) in [int, float]:
-		fidi.write(sbeg+str(pname)+smid+str(params_pname)+s)
-
-
-
+    elif type(params_pname) in [int, float]:
+        fidi.write(sbeg + str(pname) + smid + str(params_pname) + s)
Index: /issm/trunk/src/m/qmu/plot/plot_hist_norm.m
===================================================================
--- /issm/trunk/src/m/qmu/plot/plot_hist_norm.m	(revision 24312)
+++ /issm/trunk/src/m/qmu/plot/plot_hist_norm.m	(revision 24313)
@@ -275,4 +275,5 @@
 %set face and edge color
 if ~strncmpi(nrmplt,'s',1)
+	EdgeColor='k'; FaceColor='r';
 	for i=1:length(hl1)
 		set(hl1(i),'EdgeColor',EdgeColor,'FaceColor',FaceColor,'LineWidth',LineWidth);
Index: /issm/trunk/src/m/qmu/postqmu.m
===================================================================
--- /issm/trunk/src/m/qmu/postqmu.m	(revision 24312)
+++ /issm/trunk/src/m/qmu/postqmu.m	(revision 24313)
@@ -14,9 +14,7 @@
            fline=fgetl(fide);
        end
-       status=fclose(fide);
-       cd ../
-       error(['Dakota returned error in ''' qmuerrfile ' file.  ''' qmudir ''' directory retained.'])
-    end
-    status=fclose(fide);
+       warning(['Dakota returned error in ''' qmuerrfile ' file.  qmu directory retained.'])
+   end
+   status=fclose(fide);
 end
 
Index: /issm/trunk/src/m/qmu/postqmu.py
===================================================================
--- /issm/trunk/src/m/qmu/postqmu.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/postqmu.py	(revision 24313)
@@ -1,60 +1,60 @@
-from os import system,getpid,stat
+from os import getpid, stat
 from os.path import isfile
 from subprocess import Popen
-
 from dakota_out_parse import *
 from helpers import *
 
-def postqmu(md,qmufile,qmudir='qmu'+str(getpid())):
-	'''
-Deal with dakota output results in files.
 
-INPUT function
-	md=postqmu(md,qmufile,qmudir)
+def postqmu(md, qmufile, qmudir='qmu' + str(getpid())):
+    '''
+    Deal with dakota output results in files.
 
-By default: qmudir = 'qmu'+pid (eg. 'qmu2189')
-'''
+    INPUT function
+    md = postqmu(md, qmufile, qmudir)
 
-	# check to see if dakota returned errors in the err file
-	qmuerrfile=str(md.miscellaneous.name)+'.qmu.err'
+    By default: qmudir = 'qmu' + pid (eg. 'qmu2189')
+    '''
 
-	if isfile(qmuerrfile) and stat(qmuerrfile).st_size > 0:
-		with open(qmuerrfile,'r') as fide:
-			fline=fide.read()
-			print fline
+    # check to see if dakota returned errors in the err file
+    qmuerrfile = str(md.miscellaneous.name) + '.qmu.err'
 
-		raise RuntimeError('Dakota returned error in '+str(qmuerrfile)+' file.  '+str(qmudir)+' directory retained.')
+    if isfile(qmuerrfile) and stat(qmuerrfile).st_size > 0:
+        with open(qmuerrfile, 'r') as fide:
+            fline = fide.read()
+            print(fline)
 
-	# parse inputs and results from dakota
-	qmuinfile=str(md.miscellaneous.name)+'.qmu.in'
-	qmuoutfile=str(md.miscellaneous.name)+'.qmu.out'
+        raise RuntimeError('Dakota returned error in ' + str(qmuerrfile) + ' file.  ' + str(qmudir) + ' directory retained.')
 
-	# unused and unimplemented
-	#[method,dvar,dresp_in]=dakota_in_parse(qmuinfile)
-	#dakotaresults.method   =method
-	#dakotaresults.dvar     =dvar
-	#dakotaresults.dresp_in =dresp_in
+    # parse inputs and results from dakota
+    qmuinfile = str(md.miscellaneous.name) + '.qmu.in'
+    qmuoutfile = str(md.miscellaneous.name) + '.qmu.out'
 
-	[method,dresp_out,scm,pcm,srcm,prcm]=dakota_out_parse(qmuoutfile)
-	dakotaresults = struct()
-	dakotaresults.dresp_out=dresp_out
-	dakotaresults.scm      =scm
-	dakotaresults.pcm      =pcm
-	dakotaresults.srcm     =srcm
-	dakotaresults.prcm     =prcm
+    # unused and unimplemented
+    #[method, dvar, dresp_in] = dakota_in_parse(qmuinfile)
+    #dakotaresults.method   =method
+    #dakotaresults.dvar     =dvar
+    #dakotaresults.dresp_in =dresp_in
 
-	if isfile('dakota_tabular.dat'):
-		# only need a subset of the outputs; dakota_out_parse handles .dat seperately
-		[method,dresp_dat,_,_,_,_]=dakota_out_parse('dakota_tabular.dat')
-		dakotaresults.dresp_dat=dresp_dat
+    [method, dresp_out, scm, pcm, srcm, prcm] = dakota_out_parse(qmuoutfile)
+    dakotaresults = struct()
+    dakotaresults.dresp_out = dresp_out
+    dakotaresults.scm = scm
+    dakotaresults.pcm = pcm
+    dakotaresults.srcm = srcm
+    dakotaresults.prcm = prcm
 
-	# put dakotaresults in their right location.
-	md.results.dakota=dakotaresults
+    if isfile('dakota_tabular.dat'):
+        # only need a subset of the outputs; dakota_out_parse handles .dat seperately
+        [method, dresp_dat, _, _, _, _] = dakota_out_parse('dakota_tabular.dat')
+        dakotaresults.dresp_dat = dresp_dat
 
-	# move all the individual function evalutations into zip files
-	if not md.qmu.isdakota:
-		Popen('zip -mq params.in.zip params.in.[1-9]*',shell=True)
-		Popen('zip -mq results.out.zip results.out.[1-9]*',shell=True)
-		Popen('zip -mq matlab.out.zip matlab*.out.[1-9]*',shell=True)
+    # put dakotaresults in their right location.
+    md.results.dakota = dakotaresults
 
-	return md
+    # move all the individual function evalutations into zip files
+    if not md.qmu.isdakota:
+        Popen('zip - mq params.in.zip params.in.[1 - 9] * ', shell=True)
+        Popen('zip - mq results.out.zip results.out.[1 - 9] * ', shell=True)
+        Popen('zip - mq matlab.out.zip matlab * .out.[1 - 9] * ', shell=True)
+
+    return md
Index: /issm/trunk/src/m/qmu/preqmu.py
===================================================================
--- /issm/trunk/src/m/qmu/preqmu.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/preqmu.py	(revision 24313)
@@ -7,137 +7,135 @@
 from process_qmu_response_data import *
 
-def preqmu(md,options):
-	'''QMU - apply Quantification of Margins and Uncertainties techniques 
-	to a solution sequence (like stressbalance.py, progonstic.py, etc ...), 
-	using the Dakota software from Sandia.
+
+def preqmu(md, options):
+    '''QMU - apply Quantification of Margins and Uncertainties techniques
+    to a solution sequence (like stressbalance.py, progonstic.py, etc ...),
+    using the Dakota software from Sandia.
 
    options come from the solve.py routine. They can include Dakota options:
 
-	qmudir:  any directory where to run the qmu analysis
-	qmufile: input file for Dakota
+    qmudir:  any directory where to run the qmu analysis
+    qmufile: input file for Dakota
 
-	(ivap, iresp, imethod, and iparams are currently unimplemented)
-	ivar: selection number for variables input (if several are specified in variables)
-	iresp: same thing for response functions
-	imethod: same thing for methods
-	iparams: same thing for params
+    (ivap, iresp, imethod, and iparams are currently unimplemented)
+    ivar: selection number for variables input (if several are specified in variables)
+    iresp: same thing for response functions
+    imethod: same thing for methods
+    iparams: same thing for params
 
-	overwrite: overwrite qmudir before analysis
+    overwrite: overwrite qmudir before analysis
 '''
 
-	print 'preprocessing dakota inputs'
-	qmudir    = options.getfieldvalue('qmudir','qmu'+str(os.getpid()))
-	# qmudir = ['qmu_' datestr(now,'yyyymmdd_HHMMSS')]
-	qmufile   = options.getfieldvalue('qmufile','qmu')
-	# qmufile cannot be changed unless ????script.sh is also changed
-	overwrite = options.getfieldvalue('overwrite','n')
-	ivar      = options.getfieldvalue('ivar',0)
-	iresp     = options.getfieldvalue('iresp',0)
-	imethod   = options.getfieldvalue('imethod',0)
-	iparams   = options.getfieldvalue('iparams',0)
+    print('preprocessing dakota inputs')
+    qmudir = options.getfieldvalue('qmudir', 'qmu' + str(os.getpid()))
+    # qmudir = ['qmu_' datestr(now, 'yyyymmdd_HHMMSS')]
+    qmufile = options.getfieldvalue('qmufile', 'qmu')
+    # qmufile cannot be changed unless ????script.sh is also changed
+    overwrite = options.getfieldvalue('overwrite', 'n')
+    options.addfielddefault('ivar', 0)
+    options.addfielddefault('iresp', 0)
+    options.addfielddefault('imethod', 0)
+    options.addfielddefault('iparams', 0)
 
-	# first create temporary directory in which we will work
-	if strncmpi(overwrite,'y',1):
-		os.system('rm -rf '+qmudir+'/*') 
-	else:
-		# does the directory exist? if so, then error out
-		if os.path.isdir(qmudir):
-			raise RuntimeError('Existing '+str(options.qmudir)+' directory, cannot overwrite. Specify "overwrite","y" option in solve arguments.')
-	
-	# os.makedirs() raises error when dir exists, matlab's mkdir() does not
-	if not os.path.isdir(qmudir):
-		os.makedirs(qmudir)
-	os.chdir(qmudir)
+    # first create temporary directory in which we will work
+    if strncmpi(overwrite, 'y', 1):
+        os.system('rm -rf ' + qmudir + '/* ')
+    else:
+        # does the directory exist? if so, then error out
+        if os.path.isdir(qmudir):
+            raise RuntimeError('Existing ' + str(options.qmudir) + ' directory, cannot overwrite. Specify "overwrite", "y" option in solve arguments.')
 
-	# when running in library mode, the in file needs to be called md.miscellaneous.name.qmu.in
-	qmufile=md.miscellaneous.name
+    # os.makedirs() raises error when dir exists, matlab's mkdir() does not
+    if not os.path.isdir(qmudir):
+        os.makedirs(qmudir)
+    os.chdir(qmudir)
 
-	# retrieve variables and resposnes for this particular analysis.
-	#print type(md.qmu.variables)
-	#print md.qmu.variables.__dict__
-	#print ivar
-	variables=md.qmu.variables#[ivar]
-	responses=md.qmu.responses#[iresp]
+    # when running in library mode, the in file needs to be called md.miscellaneous.name.qmu.in
+    qmufile = md.miscellaneous.name
 
-	# expand variables and responses
-	#print variables.__dict__
-	#print responses.__dict__
-	variables=expandvariables(md,variables)
-	responses=expandresponses(md,responses)
+    # retrieve variables and resposnes for this particular analysis.
+    #print type(md.qmu.variables)
+    #print md.qmu.variables.__dict__
+    #print ivar
+    variables = md.qmu.variables  #[ivar]
+    responses = md.qmu.responses  #[iresp]
 
-	# go through variables and responses, and check they don't have more than
-	#   md.qmu.numberofpartitions values. Also determine numvariables and numresponses
-	#[[[
-	numvariables=0
-	variable_fieldnames=fieldnames(variables)
-	for i in range(len(variable_fieldnames)):
-		field_name=variable_fieldnames[i]
-		fieldvariables=vars(variables)[field_name]
-		for j in range(np.size(fieldvariables)):
-			if strncmpi(fieldvariables[j].descriptor,'\'scaled_',8) and str2int(fieldvariables[j].descriptor,'last')>md.qmu.numberofpartitions:
-				raise RuntimeError('preqmu error message: one of the expanded variables has more values than the number of partitions (setup in md.qmu.numberofpartitions)')
+    # expand variables and responses
+    #print variables.__dict__
+    #print responses.__dict__
+    variables = expandvariables(md, variables)
+    responses = expandresponses(md, responses)
 
-		numvariables=numvariables+np.size(vars(variables)[field_name])
+    # go through variables and responses, and check they don't have more than
+    #   md.qmu.numberofpartitions values. Also determine numvariables and numresponses
+    #[[[
+    numvariables = 0
+    variable_fieldnames = fieldnames(variables)
+    for i in range(len(variable_fieldnames)):
+        field_name = variable_fieldnames[i]
+        fieldvariables = vars(variables)[field_name]
+        for j in range(np.size(fieldvariables)):
+            if strncmpi(fieldvariables[j].descriptor, '\'scaled_', 8) and str2int(fieldvariables[j].descriptor, 'last') > md.qmu.numberofpartitions:
+                raise RuntimeError('preqmu error message: one of the expanded variables has more values than the number of partitions (setup in md.qmu.numberofpartitions)')
 
-	numresponses=0
-	response_fieldnames=fieldnames(responses)
-	for i in range(len(response_fieldnames)):
-		field_name=response_fieldnames[i]
-		fieldresponses=vars(responses)[field_name]
-		for j in range(np.size(fieldresponses)):
-			if strncmpi(fieldresponses[j].descriptor,'\'scaled_',8) and str2int(fieldresponses[j].descriptor,'last')>md.qmu.numberofpartitions:
-				raise RuntimeError('preqmu error message: one of the expanded responses has more values than the number of partitions (setup in md.qmu.numberofpartitions)')
+        numvariables = numvariables + np.size(vars(variables)[field_name])
 
-		numresponses=numresponses+np.size(vars(responses)[field_name])
+    numresponses = 0
+    response_fieldnames = fieldnames(responses)
+    for i in range(len(response_fieldnames)):
+        field_name = response_fieldnames[i]
+        fieldresponses = vars(responses)[field_name]
+        for j in range(np.size(fieldresponses)):
+            if strncmpi(fieldresponses[j].descriptor, '\'scaled_', 8) and str2int(fieldresponses[j].descriptor, 'last') > md.qmu.numberofpartitions:
+                raise RuntimeError('preqmu error message: one of the expanded responses has more values than the number of partitions (setup in md.qmu.numberofpartitions)')
 
-	#]]]
+        numresponses = numresponses + np.size(vars(responses)[field_name])
 
-	# create in file for dakota
-	#dakota_in_data(md.qmu.method[imethod],variables,responses,md.qmu.params[iparams],qmufile)
-	dakota_in_data(md.qmu.method,variables,responses,md.qmu.params,qmufile)
+    #]]]
 
-#====================================================================================#
-	#REMOVED FOR DEBUGGING ONLY:
-	#os.system('rm -rf '+str(md.miscellaneous.name)+'.py')
-#====================================================================================#
+    # create in file for dakota
+    #dakota_in_data(md.qmu.method[imethod], variables, responses, md.qmu.params[iparams], qmufile)
+    dakota_in_data(md.qmu.method, variables, responses, md.qmu.params, qmufile)
 
-	# build a list of variables and responses descriptors. the list is not expanded.
-	#[[[
-	variabledescriptors=[]
-	# variable_fieldnames=fieldnames(md.qmu.variables[ivar])
-	variable_fieldnames=fieldnames(md.qmu.variables)
-	for i in range(len(variable_fieldnames)):
-		field_name=variable_fieldnames[i]
-		#fieldvariables=vars(md.qmu.variables[ivar])[field_name]
-		fieldvariables=vars(md.qmu.variables)[field_name]
-		if type(fieldvariables) in [list,np.ndarray]:
-			for j in range(np.size(fieldvariables)):
-				variabledescriptors.append(fieldvariables[j].descriptor)
-		else:
-			variabledescriptors.append(fieldvariables.descriptor)
+    #====================================================================================  #
+    #REMOVED FOR DEBUGGING ONLY:
+    #os.system('rm -rf ' + str(md.miscellaneous.name) + '.py')
+    #====================================================================================  #
 
+    # build a list of variables and responses descriptors. the list is not expanded.
+    #{{{
+    variabledescriptors = []
+    # variable_fieldnames = fieldnames(md.qmu.variables[ivar])
+    variable_fieldnames = fieldnames(md.qmu.variables)
+    for i in range(len(variable_fieldnames)):
+        field_name = variable_fieldnames[i]
+    #fieldvariables = vars(md.qmu.variables[ivar])[field_name]
+        fieldvariables = vars(md.qmu.variables)[field_name]
+        if type(fieldvariables) in [list, np.ndarray]:
+            for j in range(np.size(fieldvariables)):
+                variabledescriptors.append(fieldvariables[j].descriptor)
+        else:
+            variabledescriptors.append(fieldvariables.descriptor)
 
-	responsedescriptors=[]
-	# response_fieldnames=fieldnames(md.qmu.responses[iresp])
-	response_fieldnames=fieldnames(md.qmu.responses)
-	for i in range(len(response_fieldnames)):
-		field_name=response_fieldnames[i]
-		#fieldresponses=vars(md.qmu.responses[iresp])[field_name]
-		fieldresponses=vars(md.qmu.responses)[field_name]
-		for j in range(np.size(fieldresponses)):
-			responsedescriptors.append(fieldresponses[j].descriptor)
-	
+    responsedescriptors = []
+    # response_fieldnames = fieldnames(md.qmu.responses[iresp])
+    response_fieldnames = fieldnames(md.qmu.responses)
+    for i in range(len(response_fieldnames)):
+        field_name = response_fieldnames[i]
+    #fieldresponses = vars(md.qmu.responses[iresp])[field_name]
+        fieldresponses = vars(md.qmu.responses)[field_name]
+        for j in range(np.size(fieldresponses)):
+            responsedescriptors.append(fieldresponses[j].descriptor)
+    #}}}
 
-	#]]]
+    # register the fields that will be needed by the Qmu model.
+    md.qmu.numberofresponses = numresponses
+    md.qmu.variabledescriptors = variabledescriptors
+    md.qmu.responsedescriptors = responsedescriptors
 
-	# register the fields that will be needed by the Qmu model.
-	md.qmu.numberofresponses=numresponses
-	md.qmu.variabledescriptors=variabledescriptors
-	md.qmu.responsedescriptors=responsedescriptors
+    # now, we have to provide all the info necessary for the solutions to compute the
+    # responses. For ex, if mass_flux is a response, we need a profile of points.
+    # For a misfit, we need the observed velocity, etc ...
+    md = process_qmu_response_data(md)
 
-	# now, we have to provide all the info necessary for the solutions to compute the
-	# responses. For ex, if mass_flux is a response, we need a profile of points.
-	# For a misfit, we need the observed velocity, etc ...
-	md=process_qmu_response_data(md)
-
-	return md
+    return md
Index: /issm/trunk/src/m/qmu/process_qmu_response_data.py
===================================================================
--- /issm/trunk/src/m/qmu/process_qmu_response_data.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/process_qmu_response_data.py	(revision 24313)
@@ -2,50 +2,49 @@
 import numpy as np
 from MeshProfileIntersection import *
-
 from helpers import empty_nd_list
 
+
 def process_qmu_response_data(md):
-	'''
-PROCESS_QMU_RESPONSE_DATA - process any data necessary for the solutions to process the data. 
+    '''
+PROCESS_QMU_RESPONSE_DATA - process any data necessary for the solutions to process the data.
 
-	Usage: md=process_qmu_response_data(md)
-	
-	See also PREQMU, PRESOLVE
+    Usage: md = process_qmu_response_data(md)
+
+    See also PREQMU, PRESOLVE
 '''
 
-	# preliminary data
-	process_mass_flux_profiles=0
-	num_mass_flux=0
+    # preliminary data
+    process_mass_flux_profiles = 0
+    num_mass_flux = 0
 
-	# loop through response descriptors, and act accordingly
-	for i in range(np.size(md.qmu.responsedescriptors)):
+    # loop through response descriptors, and act accordingly
+    for i in range(np.size(md.qmu.responsedescriptors)):
 
-		# Do we have to process  mass flux profiles?
-		if strncmpi(md.qmu.responsedescriptors[i],'indexed_MassFlux',16):
-			num_mass_flux+=1
-			process_mass_flux_profiles=1
+        # Do we have to process  mass flux profiles?
+        if strncmpi(md.qmu.responsedescriptors[i], 'indexed_MassFlux', 16):
+            num_mass_flux += 1
+            process_mass_flux_profiles = 1
 
-	# deal with mass flux profiles
-	if process_mass_flux_profiles:
-		# we need a profile of points on which to compute the mass_flux, is it here? 
-		if type(md.qmu.mass_flux_profiles) == float and np.isnan(md.qmu.mass_flux_profiles):
-			raise RuntimeError('process_qmu_response_data error message: could not find a mass_flux exp profile!')
-	
-		if type(md.qmu.mass_flux_profiles) != list:
-			raise RuntimeError('process_qmu_response_data error message: qmu_mass_flux_profiles field should be a list of domain outline names')
-	
-		if np.size(md.qmu.mass_flux_profiles) == 0:
-			raise RuntimeError('process_qmu_response_data error message: qmu_mass_flux_profiles cannot be empty!')
-	
-		if num_mass_flux!=np.size(md.qmu.mass_flux_profiles):
-			raise RuntimeError('process_qmu_response_data error message: qmu_mass_flux_profiles should be of the same size as the number of MassFlux responses asked for in the Qmu analysis')
-	
-		# ok, process the domains named in qmu_mass_flux_profiles,
-		#     to build a list of segments (MatArray)		
-		md.qmu.mass_flux_segments = empty_nd_list((num_mass_flux,1))
+    # deal with mass flux profiles
+    if process_mass_flux_profiles:
+        # we need a profile of points on which to compute the mass_flux, is it here?
+        if type(md.qmu.mass_flux_profiles) == float and np.isnan(md.qmu.mass_flux_profiles):
+            raise RuntimeError('process_qmu_response_data error message: could not find a mass_flux exp profile!')
 
-		for i in range(num_mass_flux):
-			md.qmu.mass_flux_segments[i]=np.array(MeshProfileIntersection(md.mesh.elements,md.mesh.x,md.mesh.y,md.qmu.mass_flux_profile_directory+'/'+md.qmu.mass_flux_profiles[i])[0])
+        if type(md.qmu.mass_flux_profiles) != list:
+            raise RuntimeError('process_qmu_response_data error message: qmu_mass_flux_profiles field should be a list of domain outline names')
 
-	return md
+        if np.size(md.qmu.mass_flux_profiles) == 0:
+            raise RuntimeError('process_qmu_response_data error message: qmu_mass_flux_profiles cannot be empty!')
 
+        if num_mass_flux != np.size(md.qmu.mass_flux_profiles):
+            raise RuntimeError('process_qmu_response_data error message: qmu_mass_flux_profiles should be of the same size as the number of MassFlux responses asked for in the Qmu analysis')
+
+    # ok, process the domains named in qmu_mass_flux_profiles,
+    #     to build a list of segments (MatArray)
+        md.qmu.mass_flux_segments = empty_nd_list((num_mass_flux, 1))
+
+        for i in range(num_mass_flux):
+            md.qmu.mass_flux_segments[i] = np.array(MeshProfileIntersection(md.mesh.elements, md.mesh.x, md.mesh.y, md.qmu.mass_flux_profile_directory + '/' + md.qmu.mass_flux_profiles[i])[0])
+
+    return md
Index: /issm/trunk/src/m/qmu/rlev_write.py
===================================================================
--- /issm/trunk/src/m/qmu/rlev_write.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/rlev_write.py	(revision 24313)
@@ -1,107 +1,103 @@
 import numpy as np
-
 #move this later
 from helpers import *
-
 from vector_write import *
 from param_write import *
 #import relevent qmu classes
-
 from MatlabArray import *
 
-def rlevi_write(fidi,ltype,levels):
-	'''
+
+def rlevi_write(fidi, ltype, levels):
+    '''
   function to each type of response level
 '''
 
-	fidi.write('\t  num_'+str(ltype)+' =')
-	levels = np.array(levels)
+    fidi.write('\t  num_' + str(ltype) + ' = ')
+    levels = np.array(levels)
 
-	if len(levels) > 0 and type(levels[0]) in [list,np.ndarray]:
-		for i in range(len(levels)):
-			fidi.write(' ' + str(len(levels[i])))
-	else:
-		fidi.write(' ' + str(len(levels)))
-	
-	fidi.write('\n')
+    if len(levels) > 0 and type(levels[0]) in [list, np.ndarray]:
+        for i in range(len(levels)):
+            fidi.write(' ' + str(len(levels[i])))
+    else:
+        fidi.write(' ' + str(len(levels)))
 
-	fidi.write('\t  '+str(ltype)+' =\n')
+    fidi.write('\n')
+    fidi.write('\t  ' + str(ltype) + ' =\n')
 
-	# check if we have a vector of vectors, or just 1 vector
-	if np.size(levels) > 0 and type(levels[0]) in [list,np.ndarray]:
-		for i in range(len(levels)):
-			if len(levels[i]) != 0:
-				vector_write(fidi,'\t    ',levels[i],8,76)
-	else:
-		vector_write(fidi,'\t    ',levels,8,76)
-	
-	return
+    # check if we have a vector of vectors, or just 1 vector
+    if np.size(levels) > 0 and type(levels[0]) in [list, np.ndarray]:
+        for i in range(len(levels)):
+            if len(levels[i]) != 0:
+                vector_write(fidi, '\t    ', levels[i], 8, 76)
+    else:
+        vector_write(fidi, '\t    ', levels, 8, 76)
 
-def rlev_write(fidi,dresp,cstring,params):
-	'''
+    return
+
+
+def rlev_write(fidi, dresp, cstring, params):
+    '''
   function to write response levels
 '''
-	from response_function import *
+    from response_function import response_function
 
-	if len(dresp) == 0 or len(fieldnames(dresp[0])) == 0:
-		return
+    if len(dresp) == 0 or len(fieldnames(dresp[0])) == 0:
+        return
 
-	if type(dresp) in [list,np.ndarray]:
-		if len(dresp) > 0 and type(dresp[0]) == struct:
-			func = eval(cstring)
-		else:
-			func = type(dresp[0])
-	elif type(dresp) == struct:
-		# type is defined within struct's contents
-		func = None
-		dresp = [dresp]
-	else:
-		func = type(dresp)
-		dresp = [dresp]
+    if type(dresp) in [list, np.ndarray]:
+        if len(dresp) > 0 and type(dresp[0]) == struct:
+            func = eval(cstring)
+        else:
+            func = type(dresp[0])
+    elif type(dresp) == struct:
+        # type is defined within struct's contents
+        func = None
+        dresp = [dresp]
+    else:
+        func = type(dresp)
+        dresp = [dresp]
 
-	# put responses into lists for writing
+    # put responses into lists for writing
 
-	nresp = 0
-	respl = []
-	probl = []
-	rell  = []
-	grell = []
+    nresp = 0
+    respl = []
+    probl = []
+    rell = []
+    grell = []
 
-	# assume all fields in dvar[0:n] are consistent (ex. all are normal_uncertain)
-	#   which will always be true since this is called per field
-	fnames=fieldnames(dresp[0])
-	for j in range(len(dresp)):
-		for i in range(np.size(fnames)):
-			if func == None:
-				func = type(vars(dresp[j])[fnames[i]])
+    # assume all fields in dvar[0:n] are consistent (ex. all are normal_uncertain)
+    #   which will always be true since this is called per field
+    fnames = fieldnames(dresp[0])
+    for j in range(len(dresp)):
+        for i in range(np.size(fnames)):
+            if func is None:
+                func = type(vars(dresp[j])[fnames[i]])
 
-			nresp+=1
-			[respli,probli,relli,grelli]=func.prop_levels([vars(dresp[j])[fnames[i]]])
-			respl.extend(respli)
-			probl.extend(probli)
-			rell.extend(relli)
-			grell.extend(grelli)
+            nresp += 1
+            [respli, probli, relli, grelli] = func.prop_levels([vars(dresp[j])[fnames[i]]])
+            respl.extend(respli)
+            probl.extend(probli)
+            rell.extend(relli)
+            grell.extend(grelli)
 
+    # write response levels
+    respl = allempty(respl)
+    probl = allempty(probl)
+    rell = allempty(rell)
+    grell = allempty(grell)
 
-	# write response levels
+    param_write(fidi, '\t  ', 'distribution', ' ', '\n', params)
+    if len(respl) != 0:
+        rlevi_write(fidi, 'response_levels', respl)
+        param_write(fidi, '\t  ', 'compute', ' ', '\n', params)
 
-	respl=allempty(respl)
-	probl=allempty(probl)
-	rell =allempty(rell)
-	grell=allempty(grell)
+    if len(probl) != 0:
+        rlevi_write(fidi, 'probability_levels', probl)
 
-	param_write(fidi,'\t  ','distribution',' ','\n',params)
-	if len(respl) != 0:
-	    rlevi_write(fidi,'response_levels',respl)
-	    param_write(fidi,'\t  ','compute',' ','\n',params)
-	 
-	if len(probl) != 0:
-	    rlevi_write(fidi,'probability_levels',probl)
-	
-	if len(rell) != 0:
-	    rlevi_write(fidi,'reliability_levels',rell)
-	
-	if len(grell) != 0:
-	    rlevi_write(fidi,'gen_reliability_levels',grell)
+    if len(rell) != 0:
+        rlevi_write(fidi, 'reliability_levels', rell)
 
-	return
+    if len(grell) != 0:
+        rlevi_write(fidi, 'gen_reliability_levels', grell)
+
+    return
Index: /issm/trunk/src/m/qmu/rlist_write.py
===================================================================
--- /issm/trunk/src/m/qmu/rlist_write.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/rlist_write.py	(revision 24313)
@@ -1,4 +1,3 @@
 import numpy as np
-
 #move this later
 from helpers import *
@@ -7,88 +6,87 @@
 from response_function import *
 
-def rlist_write(fidi,cstring,cstring2,dresp,rdesc):
-	'''
+
+def rlist_write(fidi, cstring, cstring2, dresp, rdesc):
+    '''
   function to write response list
 '''
 
-	if dresp == None:
-		return
+    if dresp is None:
+        return
 
-	func = eval(cstring)
+    func = eval(cstring)
 
-	if type(dresp) not in [list,np.ndarray]:
-		dresp = [dresp]
+    if type(dresp) not in [list, np.ndarray]:
+        dresp = [dresp]
 
-	# put responses into lists for writing
-	# (and accumulate descriptors into list for subsequent writing)
+    # put responses into lists for writing
+    # (and accumulate descriptors into list for subsequent writing)
 
-	nresp=0
-	pstype =[]
-	pscale =[]
-	pweight=[]
-	plower =[]
-	pupper =[]
-	ptarget=[]
+    nresp = 0
+    pstype = []
+    pscale = []
+    pweight = []
+    plower = []
+    pupper = []
+    ptarget = []
 
-	# assume all fields in dvar[0:n] are consistent (ex. all are normal_uncertain)
-	#   which will always be true since this is called per field
-	fnames=fieldnames(dresp[0])
-	for j in range(len(dresp)):
-		for i in range(np.size(fnames)):
-			nresp=nresp+np.size(vars(dresp[j])[fnames[i]])
-			pstype.extend( func.prop_stype( vars(dresp[j])[fnames[i]]))
-			pscale.extend( func.prop_scale( vars(dresp[j])[fnames[i]]))
-			pweight.extend(func.prop_weight(vars(dresp[j])[fnames[i]]))
-			plower.extend( func.prop_lower( vars(dresp[j])[fnames[i]]))
-			pupper.extend( func.prop_upper( vars(dresp[j])[fnames[i]]))
-			ptarget.extend(func.prop_target(vars(dresp[j])[fnames[i]]))
-			rdesc.extend(  func.prop_desc(  vars(dresp[j])[fnames[i]],fnames[i]))
+    # assume all fields in dvar[0:n] are consistent (ex. all are normal_uncertain)
+    #   which will always be true since this is called per field
+    fnames = fieldnames(dresp[0])
+    for j in range(len(dresp)):
+        for i in range(np.size(fnames)):
+            nresp = nresp + np.size(vars(dresp[j])[fnames[i]])
+            pstype.extend(func.prop_stype(vars(dresp[j])[fnames[i]]))
+            pscale.extend(func.prop_scale(vars(dresp[j])[fnames[i]]))
+            pweight.extend(func.prop_weight(vars(dresp[j])[fnames[i]]))
+            plower.extend(func.prop_lower(vars(dresp[j])[fnames[i]]))
+            pupper.extend(func.prop_upper(vars(dresp[j])[fnames[i]]))
+            ptarget.extend(func.prop_target(vars(dresp[j])[fnames[i]]))
+            rdesc.extend(func.prop_desc(vars(dresp[j])[fnames[i]], fnames[i]))
 
+    # write responses
+    print('  Writing ' + str(nresp) + ' ' + cstring + ' responses.')
 
-	# write responses
+    if strcmp(cstring, 'calibration_terms') == 1:
+        fidi.write('\t' + cstring + ' = ' + str(nresp) + '\n')
 
-	print '  Writing '+str(nresp)+' '+cstring+' responses.'
+    else:
+        fidi.write('\tnum_' + cstring + 's = ' + str(nresp) + '\n')
 
-	if strcmp(cstring,'calibration_terms')==1:
-		fidi.write('\t'+cstring+' = '+str(nresp)+'\n')
-	
-	else:
-		fidi.write('\tnum_'+cstring+'s = '+str(nresp)+'\n')
+    if not isempty(pstype):
+        fidi.write('\t  ' + cstring2 + '_scale_types =\n')
+        vector_write(fidi, '\t    ', pstype, 6, 76)
 
-	if not isempty(pstype):
-		fidi.write('\t  '+cstring2+'_scale_types =\n')
-		vector_write(fidi,'\t    ',pstype ,6,76)
+    if not isempty(pscale):
+        fidi.write('\t  ' + cstring2 + '_scales =\n')
+        vector_write(fidi, '\t    ', pscale, 6, 76)
 
-	if not isempty(pscale):
-		fidi.write('\t  '+cstring2+'_scales =\n')
-		vector_write(fidi,'\t    ',pscale ,6,76)
+    if not isempty(pweight):
+        if cstring2 == 'objective_function':
+            fidi.write('\t  multi_objective_weights =\n')
+            vector_write(fidi, '\t    ', pweight, 6, 76)
+        elif cstring2 == 'least_squares_term':
+            fidi.write('\t  least_squares_weights =\n')
+            vector_write(fidi, '\t    ', pweight, 6, 76)
 
-	if not isempty(pweight):
-		if cstring2 == 'objective_function':
-			fidi.write('\t  multi_objective_weights =\n')
-			vector_write(fidi,'\t    ',pweight,6,76)
-		elif cstring2 == 'least_squares_term':
-			fidi.write('\t  least_squares_weights =\n')
-			vector_write(fidi,'\t    ',pweight,6,76)
+    if not isempty(plower):
+        fidi.write('\t  ' + cstring2 + '_lower_bounds =\n')
+        vector_write(fidi, '\t    ', plower, 6, 76)
 
-	if not isempty(plower):
-		fidi.write('\t  '+cstring2+'_lower_bounds =\n')
-		vector_write(fidi,'\t    ',plower ,6,76)
+    if not isempty(pupper):
+        fidi.write('\t  ' + cstring2 + '_upper_bounds =\n')
+        vector_write(fidi, '\t    ', pupper, 6, 76)
 
-	if not isempty(pupper):
-		fidi.write('\t  '+cstring2+'_upper_bounds =\n')
-		vector_write(fidi,'\t    ',pupper ,6,76)
+    if not isempty(ptarget):
+        fidi.write('\t  ' + cstring2 + '_targets =\n')
+        vector_write(fidi, '\t    ', ptarget, 6, 76)
 
-	if not isempty(ptarget):
-		fidi.write('\t  '+cstring2+'_targets =\n')
-		vector_write(fidi,'\t    ',ptarget,6,76)
+    # because qmu in files need '' for strings
+    for i in range(len(rdesc)):
+        if type(rdesc[i]) in [list, np.ndarray]:
+            for j in range(len(rdesc[i])):
+                rdesc[i][j] = "'" + rdesc[i][j] + "'"
+        else:
+            rdesc[i] = "'" + rdesc[i] + "'"
 
-	# because qmu in files need '' for strings
-	for i in range(len(rdesc)):
-		if type(rdesc[i]) in [list,np.ndarray]:
-			for j in range(len(rdesc[i])):
-				rdesc[i][j] = "'" + rdesc[i][j] + "'"
-		else:
-			rdesc[i] = "'" + rdesc[i] + "'"
-
-	return rdesc
+    return rdesc
Index: /issm/trunk/src/m/qmu/setupdesign/QmuSetupResponses.py
===================================================================
--- /issm/trunk/src/m/qmu/setupdesign/QmuSetupResponses.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/setupdesign/QmuSetupResponses.py	(revision 24313)
@@ -2,22 +2,23 @@
 from copy import deepcopy
 
-def QmuSetupResponses(md,dresp,responses):
 
-	#get descriptor
-	descriptor=responses.descriptor
+def QmuSetupResponses(md, dresp, responses):
 
-	#decide whether this is a distributed response, which will drive whether we expand it into npart values,
-	#or if we just carry it forward as is. 
+    #get descriptor
+    descriptor = responses.descriptor
 
-	#ok, key off according to type of descriptor:
-	if strncmp(descriptor,'scaled_',7):
-		#we have a scaled response, expand it over the partition.
-		#ok, dealing with semi-discrete distributed response. Distribute according to how many 
-		#partitions we want
-		for j in range(md.qmu.numberofpartitions):
-			dresp.append(deepcopy(responses))
-			dresp[-1].descriptor=str(responses.descriptor)+'_'+str(j+1)
-	else:
-		dresp.append(responses)
+    #decide whether this is a distributed response, which will drive whether we expand it into npart values,
+    #or if we just carry it forward as is.
 
-	return dresp
+    #ok, key off according to type of descriptor:
+    if strncmp(descriptor, 'scaled_', 7):
+        #we have a scaled response, expand it over the partition.
+        #ok, dealing with semi - discrete distributed response. Distribute according to how many
+        #partitions we want
+        for j in range(md.qmu.numberofpartitions):
+            dresp.append(deepcopy(responses))
+            dresp[-1].descriptor = str(responses.descriptor) + '_' + str(j + 1)
+    else:
+        dresp.append(responses)
+
+    return dresp
Index: /issm/trunk/src/m/qmu/setupdesign/QmuSetupVariables.py
===================================================================
--- /issm/trunk/src/m/qmu/setupdesign/QmuSetupVariables.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/setupdesign/QmuSetupVariables.py	(revision 24313)
@@ -1,79 +1,76 @@
 from MatlabFuncs import *
-from uniform_uncertain import*
+from uniform_uncertain import *
 from normal_uncertain import *
 from copy import deepcopy
 
-def QmuSetupVariables(md,dvar,variables):
 
-	#get descriptor
-	descriptor=variables.descriptor
+def QmuSetupVariables(md, dvar, variables):
 
-	#decide whether this is a distributed variable, which will drive whether we expand it into npart values,
-	#or if we just carry it forward as is. 
+    #get descriptor
+    descriptor = variables.descriptor
 
-	#ok, key off according to type of descriptor:
-	if strncmp(descriptor,'scaled_',7):
-		#we have a scaled variable, expand it over the partition.
+    #decide whether this is a distributed variable, which will drive whether we expand it into npart values,
+    #or if we just carry it forward as is.
 
-		if isinstance(variables,uniform_uncertain):
-			if ((type(variables.lower) in [list,np.ndarray] and len(variables.lower) > md.qmu.numberofpartitions) or (type(variables.upper) in [list,np.ndarray] and len(variables.upper) > md.qmu.numberofpartitions)):
-				raise RuntimeError('QmuSetupDesign error message: upper and lower should be either a scalar or a "npart" length vector')
-			
-		elif isinstance(variables,normal_uncertain):
-			if type(variables.stddev) in [list,np.ndarray] and len(variables.stddev) > md.qmu.numberofpartitions:
-				raise RuntimeError('QmuSetupDesign error message: stddev should be either a scalar or a "npart" length vector')
+    #ok, key off according to type of descriptor:
+    if strncmp(descriptor, 'scaled_', 7):
+        #we have a scaled variable, expand it over the partition.
+        if isinstance(variables, uniform_uncertain):
+            if ((type(variables.lower) in [list, np.ndarray] and len(variables.lower) > md.qmu.numberofpartitions) or (type(variables.upper) in [list, np.ndarray] and len(variables.upper) > md.qmu.numberofpartitions)):
+                raise RuntimeError('QmuSetupDesign error message: upper and lower should be either a scalar or a "npart" length vector')
 
-		#ok, dealing with semi-discrete distributed variable. Distribute according to how many 
-		#partitions we want
+        elif isinstance(variables, normal_uncertain):
+            if type(variables.stddev) in [list, np.ndarray] and len(variables.stddev) > md.qmu.numberofpartitions:
+                raise RuntimeError('QmuSetupDesign error message: stddev should be either a scalar or a "npart" length vector')
 
-		for j in range(md.qmu.numberofpartitions):
-			dvar.append(deepcopy(variables))
-			# "'" is because qmu.in files need for strings to be in actual ''
-			# must also account for whether we are given 1 instance or an array of instances
+        #ok, dealing with semi - discrete distributed variable. Distribute according to how many
+        #partitions we want
+        for j in range(md.qmu.numberofpartitions):
+            dvar.append(deepcopy(variables))
+            # "'" is because qmu.in files need for strings to be in actual ''
+            # must also account for whether we are given 1 instance or an array of instances
+            # handle descriptors for everything
+            if type(dvar[-1].descriptor) in [list, np.ndarray] and len(variables.descriptor) > 1 and len(variables.upper) != md.qmu.numberofpartitions:
+                if type(variables.descriptor) == np.ndarray:
+                    dvar[-1].descriptor = np.append(dvar[-1].descriptor, "'" + str(variables.descriptor) + '_' + str(j + 1) + "'")
+                else:
+                    dvar[-1].descriptor.append("'" + str(variables.descriptor) + '_' + str(j + 1) + "'")
+            else:
+                dvar[-1].descriptor = "'" + str(variables.descriptor) + '_' + str(j + 1) + "'"
 
-			# handle descriptors for everything
-			if type(dvar[-1].descriptor) in [list,np.ndarray] and len(variables.descriptor) > 1 and len(variables.upper) != md.qmu.numberofpartitions:
-				if type(variables.descriptor) == np.ndarray:
-					dvar[-1].descriptor = np.append(dvar[-1].descriptor,"'"+str(variables.descriptor)+'_'+str(j+1)+"'")
-				else:
-					dvar[-1].descriptor.append("'"+str(variables.descriptor)+'_'+str(j+1)+"'")
-			else:
-				dvar[-1].descriptor = "'"+str(variables.descriptor)+'_'+str(j+1)+"'"
+    # handle uniform_uncertain
+            if isinstance(variables, uniform_uncertain):
+                if type(variables.lower) in [list, np.ndarray] and len(variables.lower) > 1 and len(variables.upper) != md.qmu.numberofpartitions:
+                    if type(variables.lower) == np.ndarray:
+                        dvar[-1].lower = np.append(dvar[-1].lower, variables.lower[j])
+                    else:
+                        dvar[-1].lower.append(variables.lower[j])
+                else:
+                    dvar[-1].lower = variables.lower
 
-			# handle uniform_uncertain
-			if isinstance(variables,uniform_uncertain):
-				if type(variables.lower) in [list,np.ndarray] and len(variables.lower) > 1 and len(variables.upper) != md.qmu.numberofpartitions:
-					if type(variables.lower) == np.ndarray:
-						dvar[-1].lower = np.append(dvar[-1].lower, variables.lower[j])
-					else:
-						dvar[-1].lower.append(variables.lower[j])
-				else:
-					dvar[-1].lower = variables.lower
+                if type(variables.upper) in [list, np.ndarray] and len(variables.upper) > 1 and len(variables.upper) != md.qmu.numberofpartitions:
+                    if type(variables.upper) == np.ndarray:
+                        dvar[-1].upper = np.append(dvar[-1].upper, variables.upper[j])
+                    else:
+                        dvar[-1].upper.append(variables.upper[j])
+                else:
+                    dvar[-1].upper = variables.upper
 
-				if type(variables.upper) in [list,np.ndarray] and len(variables.upper) > 1 and len(variables.upper) != md.qmu.numberofpartitions:
-					if type(variables.upper) == np.ndarray:
-						dvar[-1].upper = np.append(dvar[-1].upper, variables.upper[j])
-					else:
-						dvar[-1].upper.append(variables.upper[j])
-				else:
-					dvar[-1].upper = variables.upper
+    # handle normal_uncertain
+            elif isinstance(variables, normal_uncertain):
+                if type(variables.stddev) in [list, np.ndarray] and len(variables.stddev) > 1 and len(variables.upper) != md.qmu.numberofpartitions:
+                    if type(variables.stddev) == np.ndarray:
+                        dvar[-1].stddev = np.append(dvar[-1].stddev, variables.stddev[j])
+                    else:
+                        dvar[-1].stddev.append(variables.stddev[j])
+                else:
+                    dvar[-1].stddev = variables.stddev
 
-			# handle normal_uncertain
-			elif isinstance(variables,normal_uncertain):
-				if type(variables.stddev) in [list,np.ndarray] and len(variables.stddev) > 1 and len(variables.upper) != md.qmu.numberofpartitions:
-					if type(variables.stddev) == np.ndarray:
-						dvar[-1].stddev = np.append(dvar[-1].stddev, variables.stddev[j])
-					else:
-						dvar[-1].stddev.append(variables.stddev[j])
-				else:
-					dvar[-1].stddev = variables.stddev
+    # running with a single instance, and therefore length 1 arrays of qmu classes
+    else:
+        dvar.append(variables)
+    # text parsing in dakota requires literal "'identifier'" not just "identifier"
+        for v in dvar:
+            v.descriptor = "'" + str(v.descriptor) + "'"
 
-	# running with a single instance, and therefore length 1 arrays of qmu classes
-	else:
-		dvar.append(variables)
-		# text parsing in dakota requires literal "'identifier'" not just "identifier"
-		for v in dvar:
-			v.descriptor = "'"+str(v.descriptor)+"'"
-
-	return dvar
-	
+    return dvar
Index: /issm/trunk/src/m/qmu/vector_write.py
===================================================================
--- /issm/trunk/src/m/qmu/vector_write.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/vector_write.py	(revision 24313)
@@ -1,47 +1,48 @@
 import numpy as np
 
-def vector_write(fidi,sbeg,vec,nmax,cmax):
-	'''
+
+def vector_write(fidi, sbeg, vec, nmax, cmax):
+    '''
 function to write a vector on multiple lines
 '''
-	if nmax == None:
-		nmax=np.inf
+    if nmax is None:
+        nmax = np.inf
 
-	if cmax == None:
-		cmax=np.inf
+    if cmax is None:
+        cmax = np.inf
 
-	# set up first iteration
-	svec =[]
-	nitem=nmax
-	lsvec=cmax
+    # set up first iteration
+    svec = []
+    nitem = nmax
+    lsvec = cmax
 
-	# transpose vector from column-wise to row-wise
-	vec=np.array(vec).conj().T
+    # transpose vector from column - wise to row - wise
+    vec = np.array(vec).conj().T
 
-	# assemble each line, flushing when necessary
-	for i in range(np.size(vec,0)):
+    # assemble each line, flushing when necessary
+    for i in range(np.size(vec, 0)):
 
-		# [[1],[1],[1]...] should be [1,1,1,...]
-		if type(vec[i]) in [list,np.ndarray] and len(vec[i]) == 1:
-			sitem = str(vec[i][0])
-		else:
-			sitem = str(vec[i])
+        # [[1], [1], [1]...] should be [1, 1, 1, ...]
+        if type(vec[i]) in [list, np.ndarray] and len(vec[i]) == 1:
+            sitem = str(vec[i][0])
+        else:
+            sitem = str(vec[i])
 
-		nitem=nitem+1
-		lsvec=lsvec+1+len(sitem)
+        nitem = nitem + 1
+        lsvec = lsvec + 1 + len(sitem)
 
-		if (nitem <= nmax) and (lsvec <= cmax):
-			svec=str(svec)+' '+str(sitem)
-		else:
-			if len(svec) > 0:
-				fidi.write(str(svec)+'\n')
-		
-			svec=str(sbeg)+str(sitem)
-			nitem=1
-			lsvec=len(svec)
-	    
-	# flush buffer at , if necessary
-	if len(svec) > 0:
-		fidi.write(str(svec)+'\n')
+        if (nitem <= nmax) and (lsvec <= cmax):
+            svec = str(svec) + ' ' + str(sitem)
+        else:
+            if len(svec) > 0:
+                fidi.write(str(svec) + '\n')
 
-	return
+            svec = str(sbeg) + str(sitem)
+            nitem = 1
+            lsvec = len(svec)
+
+    # flush buffer at , if necessary
+    if len(svec) > 0:
+        fidi.write(str(svec) + '\n')
+
+    return
Index: /issm/trunk/src/m/qmu/vlist_write.py
===================================================================
--- /issm/trunk/src/m/qmu/vlist_write.py	(revision 24312)
+++ /issm/trunk/src/m/qmu/vlist_write.py	(revision 24313)
@@ -2,129 +2,129 @@
 #move this later
 from helpers import *
-
 from vector_write import *
-
 from uniform_uncertain import *
 from normal_uncertain import *
 
-def check(a,l,p):
-	'''in the event that a and b are equal, return a;
-in the event that a and b are not equal, return their concatenation
 
-	This is used for when both the input dvar and the 'cstring' variables have non-1 length
-'''
+def check(a, l, p):
+    '''in the event that a and b are equal, return a
+    in the event that a and b are not equal, return their concatenation
 
-	if np.size(a) == l:
-		if p == 0:
-			if type(a) in [list,np.ndarray]:
-				return a
-			else:
-				return [a]
-		else:
-			return []
-	elif np.size(a) == 1:
-		if type(a) in [list,np.ndarray]:
-			return a
-		else:
-			return [a]
-	elif np.size(a) == 0:
-		return []
-	else:
-		raise RuntimeError('ERROR vlist_write: input field had size '+str(np.size(a))+'; must have size of 0, 1, or match size of provided dvar ('+str(l)+').')
+    This is used for when both the input dvar and the 'cstring' variables have non - 1 length
+    '''
 
-	return
+    if np.size(a) == l:
+        if p == 0:
+            if type(a) in [list, np.ndarray]:
+                return a
+            else:
+                return [a]
+        else:
+            return []
+    elif np.size(a) == 1:
+        if type(a) in [list, np.ndarray]:
+            return a
+        else:
+            return [a]
+    elif np.size(a) == 0:
+        return []
+    else:
+        raise RuntimeError('ERROR vlist_write: input field had size ' + str(np.size(a)) + '; must have size of 0, 1, or match size of provided dvar (' + str(l) + ').')
 
-def vlist_write(fidi,cstring,cstring2,dvar):
-	'''
-function to write variable list
-'''
-	if dvar == None:
-		return
-	from uniform_uncertain import *
-	func = eval(cstring)
+    return
 
-	# put variables into lists for writing
-	
-	if type(dvar) not in [list,np.ndarray]:
-		dvar = [dvar]
 
-	# assume all fields in dvar[0:n] are consistent (ex. all are normal_uncertain)
-	#   which will always be true since this vlist_write is called per field
-	fnames=fieldnames(dvar[0])
+def vlist_write(fidi, cstring, cstring2, dvar):
+    '''
+    function to write variable list
+    '''
+    if dvar is None:
+        return
+    #from uniform_uncertain import *
+    func = eval(cstring)
 
-	nvar=0
-	pinitpt=[[] for i in range(len(fnames))]
-	plower =[[] for i in range(len(fnames))]
-	pupper =[[] for i in range(len(fnames))]
-	pmean  =[[] for i in range(len(fnames))]
-	pstddev=[[] for i in range(len(fnames))]
-	pinitst=[[] for i in range(len(fnames))]
-	pstype =[[] for i in range(len(fnames))]
-	pscale =[[] for i in range(len(fnames))]
-	pdesc  =[[] for i in range(len(fnames))]
+    # put variables into lists for writing
 
-	for i in range(len(fnames)):
-		nvar += len(dvar)
-		for j in dvar:
-			j = vars(j)[fnames[i]]
-			pinitpt[i].extend(check(func.prop_initpt(j),len(dvar),len(pinitpt[i])))
-			plower[i].extend(check(func.prop_lower(j),len(dvar),len(plower[i])))
-			pupper[i].extend(check(func.prop_upper(j),len(dvar),len(pupper[i])))
-			pmean[i].extend(check(func.prop_mean(j),len(dvar),len(pmean[i])))
-			pstddev[i].extend(check(func.prop_stddev(j),len(dvar),len(pstddev[i])))
-			pinitst[i].extend(check(func.prop_initst(j),len(dvar),len(pinitst[i])))
-			pstype[i].extend(check(func.prop_stype(j),len(dvar),len(pstype[i])))
-			pscale[i].extend(check(func.prop_scale(j),len(dvar),len(pscale[i])))
-			pdesc[i].extend(check(func.prop_desc(j,fnames[i]),len(dvar),len(pdesc[i])))
+    if type(dvar) not in [list, np.ndarray]:
+        dvar = [dvar]
 
-	pinitpt=allempty(pinitpt)
-	plower =allempty(plower)
-	pupper =allempty(pupper)
-	pmean  =allempty(pmean)
-	pstddev=allempty(pstddev)
-	pinitst=allempty(pinitst)
-	pstype =allempty(pstype)
-	pscale =allempty(pscale)
-	pdesc  =allempty(pdesc)
+    # assume all fields in dvar[0:n] are consistent (ex. all are normal_uncertain)
+    #   which will always be true since this vlist_write is called per field
+    fnames = fieldnames(dvar[0])
 
-	# write variables
-	print '  Writing '+str(nvar)+' '+cstring+' variables.'
+    nvar = 0
+    pinitpt = [[] for i in range(len(fnames))]
+    plower = [[] for i in range(len(fnames))]
+    pupper = [[] for i in range(len(fnames))]
+    pmean = [[] for i in range(len(fnames))]
+    pstddev = [[] for i in range(len(fnames))]
+    pinitst = [[] for i in range(len(fnames))]
+    pstype = [[] for i in range(len(fnames))]
+    pscale = [[] for i in range(len(fnames))]
+    pdesc = [[] for i in range(len(fnames))]
 
-	fidi.write('\t'+cstring+' = '+str(nvar)+'\n')
-	if not isempty(pinitpt):
-		fidi.write('\t  '+cstring2+'_initial_point =\n')
-		vector_write(fidi,'\t    ',pinitpt,6,76)
+    for i in range(len(fnames)):
+        nvar += len(dvar)
+        for j in dvar:
+            j = vars(j)[fnames[i]]
+            pinitpt[i].extend(check(func.prop_initpt(j), len(dvar), len(pinitpt[i])))
+            plower[i].extend(check(func.prop_lower(j), len(dvar), len(plower[i])))
+            pupper[i].extend(check(func.prop_upper(j), len(dvar), len(pupper[i])))
+            pmean[i].extend(check(func.prop_mean(j), len(dvar), len(pmean[i])))
+            pstddev[i].extend(check(func.prop_stddev(j), len(dvar), len(pstddev[i])))
+            pinitst[i].extend(check(func.prop_initst(j), len(dvar), len(pinitst[i])))
+            pstype[i].extend(check(func.prop_stype(j), len(dvar), len(pstype[i])))
+            pscale[i].extend(check(func.prop_scale(j), len(dvar), len(pscale[i])))
+            pdesc[i].extend(check(func.prop_desc(j, fnames[i]), len(dvar), len(pdesc[i])))
 
-	if not isempty(plower):
-		fidi.write('\t  '+cstring2+'_lower_bounds =\n')
-		vector_write(fidi,'\t    ',plower ,6,76)
+    pinitpt = allempty(pinitpt)
+    plower = allempty(plower)
+    pupper = allempty(pupper)
+    pmean = allempty(pmean)
+    pstddev = allempty(pstddev)
+    pinitst = allempty(pinitst)
+    pstype = allempty(pstype)
+    pscale = allempty(pscale)
+    pdesc = allempty(pdesc)
 
-	if not isempty(pupper):
-		fidi.write('\t  '+cstring2+'_upper_bounds =\n')
-		vector_write(fidi,'\t    ',pupper ,6,76)
+    # write variables
+    print('  Writing ' + str(nvar) + ' ' + cstring + ' variables.')
 
-	if not isempty(pmean):
-		fidi.write('\t  '+cstring2+'_means =\n')
-		vector_write(fidi,'\t    ',pmean  ,6,76)
+    fidi.write('\t' + cstring + ' = ' + str(nvar) + '\n')
+    if not isempty(pinitpt):
+        fidi.write('\t  ' + cstring2 + '_initial_point =\n')
+        vector_write(fidi, '\t    ', pinitpt, 6, 76)
 
-	if not isempty(pstddev):
-		fidi.write('\t  '+cstring2+'_std_deviations =\n')
-		vector_write(fidi,'\t    ',pstddev,6,76)
+    if not isempty(plower):
+        fidi.write('\t  ' + cstring2 + '_lower_bounds =\n')
+        vector_write(fidi, '\t    ', plower, 6, 76)
 
-	if not isempty(pinitst):
-		fidi.write('\t  '+cstring2+'_initial_state =\n')
-		vector_write(fidi,'\t    ',pinitst,6,76)
+    if not isempty(pupper):
+        fidi.write('\t  ' + cstring2 + '_upper_bounds =\n')
+        vector_write(fidi, '\t    ', pupper, 6, 76)
 
-	if not isempty(pstype):
-		fidi.write('\t  '+cstring2+'_scale_types =\n')
-		vector_write(fidi,'\t    ',pstype ,6,76)
+    if not isempty(pmean):
+        fidi.write('\t  ' + cstring2 + '_means =\n')
+        vector_write(fidi, '\t    ', pmean, 6, 76)
 
-	if not isempty(pscale):
-		fidi.write('\t  '+cstring2+'_scales =\n')
-		vector_write(fidi,'\t    ',pscale ,6,76)
+    if not isempty(pstddev):
+        fidi.write('\t  ' + cstring2 + '_std_deviations =\n')
+        vector_write(fidi, '\t    ', pstddev, 6, 76)
 
-	if not isempty(pdesc):
-		fidi.write('\t  '+cstring2+'_descriptors =\n')
-		vector_write(fidi,'\t    ',pdesc  ,6,76)
+    if not isempty(pinitst):
+        fidi.write('\t  ' + cstring2 + '_initial_state =\n')
+        vector_write(fidi, '\t    ', pinitst, 6, 76)
 
-	return
+    if not isempty(pstype):
+        fidi.write('\t  ' + cstring2 + '_scale_types =\n')
+        vector_write(fidi, '\t    ', pstype, 6, 76)
+
+    if not isempty(pscale):
+        fidi.write('\t  ' + cstring2 + '_scales =\n')
+        vector_write(fidi, '\t    ', pscale, 6, 76)
+
+    if not isempty(pdesc):
+        fidi.write('\t  ' + cstring2 + '_descriptors =\n')
+        vector_write(fidi, '\t    ', pdesc, 6, 76)
+
+    return
Index: /issm/trunk/src/m/shp/projectedges.m
===================================================================
--- /issm/trunk/src/m/shp/projectedges.m	(revision 24313)
+++ /issm/trunk/src/m/shp/projectedges.m	(revision 24313)
@@ -0,0 +1,21 @@
+function edges=projectedges(edges,shppath,epsg)
+%Gothrough edges (shapefiles), and project them in the epsg reference frame. 
+
+for i=1:length(edges)/3, 
+	shpname=[shppath '/' edges{3*(i-1)+1}];
+	shpepsg=edges{3*(i-1)+2};
+	if shpepsg==epsg,
+		%do nothing; 
+	else
+		%use gdaltransform to reproject the shp file: and give it another name.
+		contour=shpread([shpname '.shp']);
+		[contour.x,contour.y]=gdaltransform(contour.x,contour.y,sprintf('EPSG:%i',shpepsg),sprintf('EPSG:%i',epsg));
+		%write: 
+		shpwrite(contour,[shpname  '-' num2str(epsg) '.shp']);
+		%modify the name: 
+		edges{3*(i-1)+1}=[edges{3*(i-1)+1} '-' num2str(epsg)];
+	end
+end
+
+%extract new edges:  
+ind=1:length(edges); edges=edges(find(mod(ind,3)~=2));
Index: /issm/trunk/src/m/shp/shp2exp.m
===================================================================
--- /issm/trunk/src/m/shp/shp2exp.m	(revision 24312)
+++ /issm/trunk/src/m/shp/shp2exp.m	(revision 24313)
@@ -40,5 +40,5 @@
 			expstruct(end).name=num2str(shp(i).id);
 		elseif isfield(shp(i),'NAME'),
-			expstruct(end).name=num2str(shp(i).SUBREGION1);
+			expstruct(end).name=num2str(shp(i).NAME);
 		elseif isfield(shp(i),'SUBREGION1'),
 			expstruct(end).name=num2str(shp(i).SUBREGION1);
Index: /issm/trunk/src/m/shp/shp2exp.py
===================================================================
--- /issm/trunk/src/m/shp/shp2exp.py	(revision 24312)
+++ /issm/trunk/src/m/shp/shp2exp.py	(revision 24313)
@@ -3,51 +3,52 @@
 from expwrite import expwrite
 
-def shp2exp(shapefilename,*expfilename):
-	'''
-	Convert a shapefile to an .exp file.  Optionally, expfilename can be
-	specified to give a name for the .exp file to be created, otherwise the
-	.exp file will have the same prefix as the .shp file.
 
-	Usage:
-		shp2exp(shapefilename)
-		shp2exp(shapefilename,expfilename)
+def shp2exp(shapefilename, * expfilename):
+    '''
+    Convert a shapefile to an .exp file.  Optionally, expfilename can be
+    specified to give a name for the .exp file to be created, otherwise the
+    .exp file will have the same prefix as the .shp file.
 
-	Examples:
-		shp2exp('Domain.shp') % creates Domain.exp
-		shp2exp('Domain.shp','DomainForISSM.exp')
-	'''
-	
-	if not os.path.exists(shapefilename):
-		raise IOError("shp2exp error message: file '%s' not found!" % parametername)
-	if not len(expfilename):
-		expfile=os.path.splitext(shapefilename)[0]+'.exp'
-	else:
-		expfile=expfilename[0]
+    Usage:
+        shp2exp(shapefilename)
+        shp2exp(shapefilename, expfilename)
 
-	shp=shapefile.Reader(shapefilename)
-	expdict=dict(density=1)
+    Examples:
+        shp2exp('Domain.shp') % creates Domain.exp
+        shp2exp('Domain.shp', 'DomainForISSM.exp')
+    '''
 
-	x=[]
-	y=[]
-	for i in range(len(shp.shapes())):
-		geom=shp.shapes()[i].shapeType
-		if geom==5: # polygon
-			expdict['closed']=1
-			tmpx=[p[0] for p in shp.shapes()[i].points]
-			tmpy=[q[1] for q in shp.shapes()[i].points]
-			x.append(tmpx)
-			y.append(tmpy)
-		elif geom==3: # line
-			expdict['closed']=0
-			tmpx=[p[0] for p in shp.shapes()[i].points]
-			tmpy=[q[1] for q in shp.shapes()[i].points]
-			x.append(tmpx)
-			y.append(tmpy)
-		elif geom==1: # point
-			expdict['closed']=0
-			x.append(shp.shapes()[i].points[0][0])
-			y.append(shp.shapes()[i].points[0][1])
+    if not os.path.exists(shapefilename):
+        raise IOError("shp2exp error message: file '%s' not found!" % shapefilename)
+    if not len(expfilename):
+        expfile = os.path.splitext(shapefilename)[0] + '.exp'
+    else:
+        expfile = expfilename[0]
 
-	expdict['x']=x
-	expdict['y']=y
-	expwrite(expdict,expfile)
+    shp = shapefile.Reader(shapefilename)
+    expdict = dict(density=1)
+
+    x = []
+    y = []
+    for i in range(len(shp.shapes())):
+        geom = shp.shapes()[i].shapeType
+        if geom == 5:  # polygon
+            expdict['closed'] = 1
+            tmpx = [p[0] for p in shp.shapes()[i].points]
+            tmpy = [q[1] for q in shp.shapes()[i].points]
+            x.append(tmpx)
+            y.append(tmpy)
+        elif geom == 3:  # line
+            expdict['closed'] = 0
+            tmpx = [p[0] for p in shp.shapes()[i].points]
+            tmpy = [q[1] for q in shp.shapes()[i].points]
+            x.append(tmpx)
+            y.append(tmpy)
+        elif geom == 1:  # point
+            expdict['closed'] = 0
+            x.append(shp.shapes()[i].points[0][0])
+            y.append(shp.shapes()[i].points[0][1])
+
+    expdict['x'] = x
+    expdict['y'] = y
+    expwrite(expdict, expfile)
Index: /issm/trunk/src/m/solve/WriteData.m
===================================================================
--- /issm/trunk/src/m/solve/WriteData.m	(revision 24312)
+++ /issm/trunk/src/m/solve/WriteData.m	(revision 24313)
@@ -9,5 +9,5 @@
 
 %Get data properties
-if exist(options,'object');
+if exist(options,'object')
 	obj       = getfieldvalue(options,'object');
 	fieldname = getfieldvalue(options,'fieldname');
@@ -28,25 +28,42 @@
 
 %Process sparse matrices
-if issparse(data),
+if issparse(data)
 	data=full(data);
 end
 
 %Scale data if necesarry
-if exist(options,'scale'),
-	scale = getfieldvalue(options,'scale');
-	if size(data,1)==timeserieslength,
-		data(1:end-1,:) = scale.*data(1:end-1,:);
-	else
-		data  = scale.*data;
+if strcmpi(format,'MatArray')
+	for i=1:numel(data)
+		if exist(options,'scale'),
+			scale = getfieldvalue(options,'scale');
+			if size(data{i},1)==timeserieslength,
+				data{i}(1:end-1,:) = scale.*data{i}(1:end-1,:);
+			else
+				data{i} = scale.*data{i};
+			end
+		end
+		if size(data{i},1)==timeserieslength,
+			yts = getfieldvalue(options,'yts');
+			data{i}(end,:) = data{i}(end,:)*yts;
+		end
+	end
+else
+	if exist(options,'scale')
+		scale = getfieldvalue(options,'scale');
+		if size(data,1)==timeserieslength,
+			data(1:end-1,:) = scale.*data(1:end-1,:);
+		else
+			data  = scale.*data;
+		end
+	end
+	if(size(data,1)==timeserieslength)
+		yts = getfieldvalue(options,'yts');
+		data(end,:) = data(end,:)*yts;
 	end
 end
-if(size(data,1)==timeserieslength),
-	yts = getfieldvalue(options,'yts');
-	data(end,:) = data(end,:)*yts;
-end
 
 %Step 1: write the name to identify this record uniquely
-fwrite(fid,numel(name),'int'); 
-fwrite(fid,name,'char'); 
+fwrite(fid,numel(name),'int');
+fwrite(fid,name,'char');
 
 %Step 2: write the data itself.
@@ -55,8 +72,8 @@
 
 	%first write length of record
-	fwrite(fid,4+4,'int');  %1 bool (disguised as an int)+code
-
-	%write data code: 
-	fwrite(fid,FormatToCode(format),'int'); 
+	fwrite(fid,4+4,'int64');  %1 bool (disguised as an int)+code
+
+	%write data code:
+	fwrite(fid,FormatToCode(format),'int');
 
 	%now write integer
@@ -67,11 +84,11 @@
 
 	%first write length of record
-	fwrite(fid,4+4,'int');  %1 integer + code
-
-	%write data code: 
-	fwrite(fid,FormatToCode(format),'int'); 
+	fwrite(fid,4+4,'int64');  %1 integer + code
+
+	%write data code:
+	fwrite(fid,FormatToCode(format),'int');
 
 	%now write integer
-	fwrite(fid,data,'int'); 
+	fwrite(fid,data,'int');
 	% }}}
 elseif strcmpi(format,'Double'), % {{{
@@ -79,22 +96,22 @@
 
 	%first write length of record
-	fwrite(fid,8+4,'int');  %1 double+code
-
-	%write data code: 
-	fwrite(fid,FormatToCode(format),'int'); 
+	fwrite(fid,8+4,'int64');  %1 double+code
+
+	%write data code:
+	fwrite(fid,FormatToCode(format),'int');
 
 	%now write double
-	fwrite(fid,data,'double'); 
+	fwrite(fid,data,'double');
 	% }}}
 elseif strcmpi(format,'String'), % {{{
 	%first write length of record
-	fwrite(fid,length(data)+4+4,'int');  %string + string size + code
-
-	%write data code: 
-	fwrite(fid,FormatToCode(format),'int'); 
+	fwrite(fid,length(data)+4+4,'int64');  %string + string size + code
+
+	%write data code:
+	fwrite(fid,FormatToCode(format),'int');
 
 	%now write string
-	fwrite(fid,length(data),'int'); 
-	fwrite(fid,data,'char'); 
+	fwrite(fid,length(data),'int');
+	fwrite(fid,data,'char');
 	% }}}
 elseif strcmpi(format,'BooleanMat'), % {{{
@@ -108,13 +125,13 @@
 
 	%first write length of record
-	fwrite(fid,4+4+8*s(1)*s(2)+4+4,'int');  %2 integers (32 bits) + the double matrix + code + matrix type
-
-	%write data code and matrix type: 
-	fwrite(fid,FormatToCode(format),'int'); 
+	fwrite(fid,4+4+8*s(1)*s(2)+4+4,'int64');  %2 integers (32 bits) + the double matrix + code + matrix type
+
+	%write data code and matrix type:
+	fwrite(fid,FormatToCode(format),'int');
 	fwrite(fid,mattype,'int');
 
 	%now write matrix
-	fwrite(fid,s(1),'int'); 
-	fwrite(fid,s(2),'int'); 
+	fwrite(fid,s(1),'int');
+	fwrite(fid,s(2),'int');
 	if s(1)*s(2),
 		fwrite(fid,data','double'); %get to the "c" convention, hence the transpose
@@ -131,13 +148,13 @@
 
 	%first write length of record
-	fwrite(fid,4+4+8*s(1)*s(2)+4+4,'int');  %2 integers (32 bits) + the double matrix + code + matrix type
-
-	%write data code and matrix type: 
-	fwrite(fid,FormatToCode(format),'int'); 
+	fwrite(fid,4+4+8*s(1)*s(2)+4+4,'int64');  %2 integers (32 bits) + the double matrix + code + matrix type
+
+	%write data code and matrix type:
+	fwrite(fid,FormatToCode(format),'int');
 	fwrite(fid,mattype,'int');
 
 	%now write matrix
-	fwrite(fid,s(1),'int'); 
-	fwrite(fid,s(2),'int'); 
+	fwrite(fid,s(1),'int');
+	fwrite(fid,s(2),'int');
 	if s(1)*s(2),
 		fwrite(fid,data','double'); %get to the "c" convention, hence the transpose
@@ -148,4 +165,9 @@
 	%Get size
 	s=size(data);
+
+	if numel(s)~=2
+		error('matrices that that have more than 2 dimensions are not supported');
+	end
+
 	%if matrix = NaN, then do not write anything
 	if (s(1)==1 & s(2)==1 & isnan(data)),
@@ -155,14 +177,14 @@
 	%first write length of record
 	recordlength=4+4+8*s(1)*s(2)+4+4; %2 integers (32 bits) + the double matrix + code + matrix type
-	if recordlength>2^31; error(['field ' name ' cannot be marshalled because it is larger than 2^31 bytes!']); end
-	fwrite(fid,recordlength,'int');
-
-	%write data code and matrix type: 
-	fwrite(fid,FormatToCode(format),'int'); 
+	if recordlength>2^63; error(['field ' name ' cannot be marshalled because it is larger than 2^63 bytes!']); end
+	fwrite(fid,recordlength,'int64');
+
+	%write data code and matrix type:
+	fwrite(fid,FormatToCode(format),'int');
 	fwrite(fid,mattype,'int');
 
 	%now write matrix
-	fwrite(fid,s(1),'int'); 
-	fwrite(fid,s(2),'int'); 
+	fwrite(fid,s(1),'int');
+	fwrite(fid,s(2),'int');
 	if s(1)*s(2),
 		fwrite(fid,data','double'); %get to the "c" convention, hence the transpose
@@ -180,14 +202,14 @@
 	%first write length of record
 	recordlength=4+4+8+8+1*(s(1)-1)*s(2)+8*s(2)+4+4; %2 integers (32 bits) + the matrix + code + matrix type
-	if recordlength>2^31; error(['field ' name ' cannot be marshalled because it is larger than 2^31 bytes!']); end
-	fwrite(fid,recordlength,'int');
-
-	%write data code and matrix type: 
-	fwrite(fid,FormatToCode(format),'int'); 
+	if recordlength>2^63; error(['field ' name ' cannot be marshalled because it is larger than 2^63 bytes!']); end
+	fwrite(fid,recordlength,'int64');
+
+	%write data code and matrix type:
+	fwrite(fid,FormatToCode(format),'int');
 	fwrite(fid,mattype,'int');
 
 	%write matrix size
-	fwrite(fid,s(1),'int'); 
-	fwrite(fid,s(2),'int'); 
+	fwrite(fid,s(1),'int');
+	fwrite(fid,s(2),'int');
 
 	if s(1)*s(2),
@@ -205,5 +227,5 @@
 
 		%Write last row as double (time)
-		fwrite(fid,data(end,:),'double'); 
+		fwrite(fid,data(end,:),'double');
 	else
 
@@ -227,18 +249,18 @@
 
 	%write length of record
-	fwrite(fid,recordlength,'int'); 
-
-	%write data code: 
-	fwrite(fid,FormatToCode(format),'int'); 
+	fwrite(fid,recordlength,'int64');
+
+	%write data code:
+	fwrite(fid,FormatToCode(format),'int');
 
 	%write data, first number of records
-	fwrite(fid,numrecords,'int'); 
-
-	%write each matrix: 
+	fwrite(fid,numrecords,'int');
+
+	%write each matrix:
 	for i=1:numrecords,
 		matrix=data{i};
 		s=size(matrix);
-		fwrite(fid,s(1),'int'); 
-		fwrite(fid,s(2),'int'); 
+		fwrite(fid,s(1),'int');
+		fwrite(fid,s(2),'int');
 		fwrite(fid,matrix','double');
 	end
@@ -246,5 +268,5 @@
 elseif strcmpi(format,'StringArray'), % {{{
 
-	%first get length of string array: 
+	%first get length of string array:
 	num=numel(data);
 	if isnumeric(data) & num==1 & isnan(data),
@@ -252,5 +274,5 @@
 	end
 
-	%now get length of record: 
+	%now get length of record:
 	recordlength=4+4; %for length of array + code
 	for i=1:num,
@@ -260,17 +282,17 @@
 
 	%write length of record
-	fwrite(fid,recordlength,'int'); 
-
-	%write data code: 
-	fwrite(fid,FormatToCode(format),'int'); 
+	fwrite(fid,recordlength,'int64');
+
+	%write data code:
+	fwrite(fid,FormatToCode(format),'int');
 
 	%now write length of string array
-	fwrite(fid,num,'int'); 
+	fwrite(fid,num,'int');
 
 	%now write the strings
 	for i=1:num,
 		string=data{i};
-		fwrite(fid,length(string),'int'); 
-		fwrite(fid,string,'char'); 
+		fwrite(fid,length(string),'int');
+		fwrite(fid,string,'char');
 	end
 	% }}}
@@ -281,14 +303,14 @@
 
 function code=FormatToCode(format) % {{{
-%This routine takes the format string, and hardcodes it into an integer, which 
-%is passed along the record, in order to identify the nature of the dataset being 
+%This routine takes the format string, and hardcodes it into an integer, which
+%is passed along the record, in order to identify the nature of the dataset being
 %sent.
 	if     strcmpi(format,'Boolean'),
 		code=1;
-	elseif strcmpi(format,'Integer'), 
+	elseif strcmpi(format,'Integer'),
 		code=2;
-	elseif strcmpi(format,'Double'), 
+	elseif strcmpi(format,'Double'),
 		code=3;
-	elseif strcmpi(format,'String'), 
+	elseif strcmpi(format,'String'),
 		code=4;
 	elseif strcmpi(format,'BooleanMat'),
@@ -298,5 +320,5 @@
 	elseif strcmpi(format,'DoubleMat'),
 		code=7;
-	elseif strcmpi(format,'MatArray'), 
+	elseif strcmpi(format,'MatArray'),
 		code=8;
 	elseif strcmpi(format,'StringArray'),
@@ -304,5 +326,5 @@
 	elseif strcmpi(format,'CompressedMat'),
 		code=10;
-	else 
+	else
 		error('FormatToCode error message: data type not supported yet!');
 	end
Index: /issm/trunk/src/m/solve/WriteData.py
===================================================================
--- /issm/trunk/src/m/solve/WriteData.py	(revision 24312)
+++ /issm/trunk/src/m/solve/WriteData.py	(revision 24313)
@@ -1,414 +1,360 @@
+from struct import pack, error
 import numpy as np
-import struct
 import pairoptions
-import MatlabFuncs as m
-
-def WriteData(fid,prefix,*args):
-	"""
-	WRITEDATA - write model field in binary file
-
-	   Usage:
-	      WriteData(fid,varargin)
-	"""
-
-	#process options
-	options=pairoptions.pairoptions(*args)
-
-	#Get data properties
-	if options.exist('object'):
-		#This is an object field, construct enum and data
-		obj       = options.getfieldvalue('object')
-		fieldname = options.getfieldvalue('fieldname')
-		classname = options.getfieldvalue('class',str(type(obj)).rsplit('.')[-1].split("'")[0])
-		name      = options.getfieldvalue('name',prefix+'.'+fieldname);
-		if options.exist('data'):
-			data = options.getfieldvalue('data')
-		else:
-			data      = getattr(obj,fieldname)
-	else:
-		#No processing required
-		data = options.getfieldvalue('data')
-		name = options.getfieldvalue('name')
-
-	format  = options.getfieldvalue('format')
-	mattype = options.getfieldvalue('mattype',0)    #only required for matrices
-	timeserieslength = options.getfieldvalue('timeserieslength',-1)
-
-	#Process sparse matrices
-#	if issparse(data),
-#		data=full(data);
-#	end
-
-	#Scale data if necesarry
-	if options.exist('scale'):
-		data=np.array(data)
-		scale = options.getfieldvalue('scale')
-		if np.size(data) > 1 and np.ndim(data) > 1 and np.size(data,0)==timeserieslength:
-			data[0:-1,:] = scale*data[0:-1,:]
-		else:
-			data  = scale*data
-	if np.size(data) > 1 and np.size(data,0)==timeserieslength:
-		yts = options.getfieldvalue('yts')
-		if np.ndim(data) > 1:
-			data[-1,:] = yts*data[-1,:]
-		else:
-			data[-1] = yts*data[-1]
-
-	#Step 1: write the enum to identify this record uniquely
-	fid.write(struct.pack('i',len(name)))
-	fid.write(struct.pack('%ds' % len(name),name))
-
-	#Step 2: write the data itself.
-	if   m.strcmpi(format,'Boolean'):    # {{{
-#		if len(data) !=1:
-#			raise ValueError('field %s cannot be marshalled as it has more than one element!' % name[0])
-
-		#first write length of record
-		fid.write(struct.pack('i',4+4))  #1 bool (disguised as an int)+code
-
-		#write data code:
-		fid.write(struct.pack('i',FormatToCode(format)))
-
-		#now write integer
-		fid.write(struct.pack('i',int(data)))  #send an int, not easy to send a bool
-		# }}}
-
-	elif m.strcmpi(format,'Integer'):    # {{{
-#		if len(data) !=1:
-#			raise ValueError('field %s cannot be marshalled as it has more than one element!' % name[0])
-
-		#first write length of record
-		fid.write(struct.pack('i',4+4))  #1 integer + code
-
-		#write data code:
-		fid.write(struct.pack('i',FormatToCode(format)))
-
-		#now write integer
-		fid.write(struct.pack('i',data))
-		# }}}
-
-	elif m.strcmpi(format,'Double'):    # {{{
-#		if len(data) !=1:
-#			raise ValueError('field %s cannot be marshalled as it has more than one element!' % name[0])
-
-		#first write length of record
-		fid.write(struct.pack('i',8+4))  #1 double+code
-
-		#write data code:
-		fid.write(struct.pack('i',FormatToCode(format)))
-
-		#now write double
-		fid.write(struct.pack('d',data))
-		# }}}
-
-	elif m.strcmpi(format,'String'):    # {{{
-		#first write length of record
-		fid.write(struct.pack('i',len(data)+4+4))  #string + string size + code
-
-		#write data code:
-		fid.write(struct.pack('i',FormatToCode(format)))
-
-		#now write string
-		fid.write(struct.pack('i',len(data)))
-		fid.write(struct.pack('%ds' % len(data),data))
-		# }}}
-
-	elif m.strcmpi(format,'BooleanMat'):    # {{{
-
-		if   isinstance(data,bool):
-			data=np.array([data])
-		elif isinstance(data,(list,tuple)):
-			data=np.array(data).reshape(-1,)
-		if np.ndim(data) == 1:
-			if np.size(data):
-				data=data.reshape(np.size(data),)
-			else:
-				data=data.reshape(0,0)
-
-		#Get size
-		s=data.shape
-		#if matrix = NaN, then do not write anything
-		if np.ndim(data)==2 and np.product(s)==1 and np.all(np.isnan(data)):
-			s=(0,0)
-
-		#first write length of record
-		fid.write(struct.pack('i',4+4+8*np.product(s)+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
-
-		#write data code and matrix type:
-		fid.write(struct.pack('i',FormatToCode(format)))
-		fid.write(struct.pack('i',mattype))
-
-		#now write matrix
-		if np.ndim(data)==1:
-			fid.write(struct.pack('i',s[0]))
-			fid.write(struct.pack('i',1))
-			for i in xrange(s[0]):
-				fid.write(struct.pack('d',float(data[i])))    #get to the "c" convention, hence the transpose
-		else:
-			fid.write(struct.pack('i',s[0]))
-			fid.write(struct.pack('i',s[1]))
-			for i in xrange(s[0]):
-				for j in xrange(s[1]):
-					fid.write(struct.pack('d',float(data[i][j])))    #get to the "c" convention, hence the transpose
-		# }}}
-
-	elif m.strcmpi(format,'IntMat'):    # {{{
-
-		if   isinstance(data,(int,long)):
-			data=np.array([data])
-		elif isinstance(data,(list,tuple)):
-			data=np.array(data).reshape(-1,)
-		if np.ndim(data) == 1:
-			if np.size(data):
-				data=data.reshape(np.size(data),)
-			else:
-				data=data.reshape(0,0)
-
-		#Get size
-		s=data.shape
-		#if matrix = NaN, then do not write anything
-		if np.ndim(data)==2 and np.product(s)==1 and np.all(np.isnan(data)):
-			s=(0,0)
-
-		#first write length of record
-		fid.write(struct.pack('i',4+4+8*np.product(s)+4+4))    #2 integers (32 bits) + the double matrix + code + matrix type
-
-		#write data code and matrix type:
-		fid.write(struct.pack('i',FormatToCode(format)))
-		fid.write(struct.pack('i',mattype))
-
-		#now write matrix
-		if np.ndim(data) == 1:
-			fid.write(struct.pack('i',s[0]))
-			fid.write(struct.pack('i',1))
-			for i in xrange(s[0]):
-				fid.write(struct.pack('d',float(data[i])))    #get to the "c" convention, hence the transpose
-		else:
-			fid.write(struct.pack('i',s[0]))
-			fid.write(struct.pack('i',s[1]))
-			for i in xrange(s[0]):
-				for j in xrange(s[1]):
-					fid.write(struct.pack('d',float(data[i][j])))    #get to the "c" convention, hence the transpose
-		# }}}
-
-	elif m.strcmpi(format,'DoubleMat'):    # {{{
-
-		if   isinstance(data,(bool,int,long,float)):
-			data=np.array([data])
-		elif isinstance(data,(list,tuple)):
-			data=np.array(data).reshape(-1,)
-		if np.ndim(data) == 1:
-			if np.size(data):
-				data=data.reshape(np.size(data),)
-			else:
-				data=data.reshape(0,0)
-
-		#Get size
-		s=data.shape
-		#if matrix = NaN, then do not write anything
-		if np.ndim(data)==1 and np.product(s)==1 and np.all(np.isnan(data)):
-			s=(0,0)
-
-		#first write length of record
-		recordlength=4+4+8*np.product(s)+4+4; #2 integers (32 bits) + the double matrix + code + matrix type
-		if recordlength > 4**31 :
-			raise ValueError('field %s cannot be marshalled because it is larger than 4^31 bytes!' % enum)
-
-		fid.write(struct.pack('i',recordlength))  #2 integers (32 bits) + the double matrix + code + matrix type
-
-		#write data code and matrix type:
-		fid.write(struct.pack('i',FormatToCode(format)))
-		fid.write(struct.pack('i',mattype))
-
-		#now write matrix
-		if np.ndim(data) == 1:
-			fid.write(struct.pack('i',s[0]))
-			fid.write(struct.pack('i',1))
-			for i in xrange(s[0]):
-				fid.write(struct.pack('d',float(data[i])))    #get to the "c" convention, hence the transpose
-		else:
-			fid.write(struct.pack('i',s[0]))
-			fid.write(struct.pack('i',s[1]))
-			for i in xrange(s[0]):
-				for j in xrange(s[1]):
-					fid.write(struct.pack('d',float(data[i][j])))    #get to the "c" convention, hence the transpose
-		# }}}
-
-	elif m.strcmpi(format,'CompressedMat'):    # {{{
-
-		if   isinstance(data,(bool,int,long,float)):
-			data=np.array([data])
-		elif isinstance(data,(list,tuple)):
-			data=np.array(data).reshape(-1,)
-		if np.ndim(data) == 1:
-			if np.size(data):
-				data=data.reshape(np.size(data),)
-			else:
-				data=data.reshape(0,0)
-
-		#Get size
-		s=data.shape
-		if np.ndim(data) == 1:
-		   n2=1
-		else:
-			n2=s[1]
-
-		#if matrix = NaN, then do not write anything
-		if np.ndim(data)==1 and np.product(s)==1 and np.all(np.isnan(data)):
-			s=(0,0)
-			n2=0
-
-		#first write length of record
-		recordlength=4+4+8+8+1*(s[0]-1)*n2+8*n2+4+4 #2 integers (32 bits) + the matrix + code + matrix type
-		if recordlength > 4**31 :
-			raise ValueError('field %s cannot be marshalled because it is larger than 4^31 bytes!' % enum)
-
-		fid.write(struct.pack('i',recordlength))  #2 integers (32 bits) + the matrix + code + matrix type
-
-		#write data code and matrix type:
-		fid.write(struct.pack('i',FormatToCode(format)))
-		fid.write(struct.pack('i',mattype))
-
-		#Write offset and range
-		A = data[0:s[0]-1]
-		offsetA = A.min()
-		rangeA = A.max() - offsetA
-
-		if rangeA == 0:
-			A = A*0
-		else:
-			A = (A-offsetA)/rangeA*255.
-
-		#now write matrix
-		if np.ndim(data) == 1:
-			fid.write(struct.pack('i',s[0]))
-			fid.write(struct.pack('i',1))
-			fid.write(struct.pack('d',float(offsetA)))
-			fid.write(struct.pack('d',float(rangeA)))
-			for i in xrange(s[0]-1):
-				fid.write(struct.pack('B',int(A[i])))
-
-			fid.write(struct.pack('d',float(data[s[0]-1])))    #get to the "c" convention, hence the transpose
-
-		elif np.product(s) > 0:
-			fid.write(struct.pack('i',s[0]))
-			fid.write(struct.pack('i',s[1]))
-			fid.write(struct.pack('d',float(offsetA)))
-			fid.write(struct.pack('d',float(rangeA)))
-			for i in xrange(s[0]-1):
-				for j in xrange(s[1]):
-					fid.write(struct.pack('B',int(A[i][j])))    #get to the "c" convention, hence the transpose
-
-			for j in xrange(s[1]):
-				fid.write(struct.pack('d',float(data[s[0]-1][j])))
-
-		# }}}
-
-	elif m.strcmpi(format,'MatArray'):    # {{{
-
-		#first get length of record
-		recordlength=4+4    #number of records + code
-		for matrix in data:
-			if   isinstance(matrix,(bool,int,long,float)):
-				matrix=np.array([matrix])
-			elif isinstance(matrix,(list,tuple)):
-				matrix=np.array(matrix).reshape(-1,)
-			if np.ndim(matrix) == 1:
-				if np.size(matrix):
-					matrix=matrix.reshape(np.size(matrix),)
-				else:
-					matrix=matrix.reshape(0,0)
-
-			s=matrix.shape
-			recordlength+=4*2+np.product(s)*8    #row and col of matrix + matrix of doubles
-
-		#write length of record
-		fid.write(struct.pack('i',recordlength))
-
-		#write data code:
-		fid.write(struct.pack('i',FormatToCode(format)))
-
-		#write data, first number of records
-		fid.write(struct.pack('i',len(data)))
-
-		for matrix in data:
-			if   isinstance(matrix,(bool,int,long,float)):
-				matrix=np.array([matrix])
-			elif isinstance(matrix,(list,tuple)):
-				matrix=np.array(matrix).reshape(-1,)
-			if np.ndim(matrix) == 1:
-				matrix=matrix.reshape(np.size(matrix),)
-
-			s=matrix.shape
-
-			if np.ndim(matrix) == 1:
-				fid.write(struct.pack('i',s[0]))
-				fid.write(struct.pack('i',1))
-				for i in xrange(s[0]):
-					fid.write(struct.pack('d',float(matrix[i])))    #get to the "c" convention, hence the transpose
-			else:
-				fid.write(struct.pack('i',s[0]))
-				fid.write(struct.pack('i',s[1]))
-				for i in xrange(s[0]):
-					for j in xrange(s[1]):
-						fid.write(struct.pack('d',float(matrix[i][j])))
-		# }}}
-
-	elif m.strcmpi(format,'StringArray'):    # {{{
-
-		#first get length of record
-		recordlength=4+4    #for length of array + code
-		for string in data:
-			recordlength+=4+len(string)    #for each string
-
-		#write length of record
-		fid.write(struct.pack('i',recordlength))
-
-		#write data code:
-		fid.write(struct.pack('i',FormatToCode(format)))
-
-		#now write length of string array
-		fid.write(struct.pack('i',len(data)))
-
-		#now write the strings
-		for string in data:
-			fid.write(struct.pack('i',len(string)))
-			fid.write(struct.pack('%ds' % len(string),string))
-		# }}}
-
-	else:    # {{{
-		raise TypeError('WriteData error message: data type: %d not supported yet! (%s)' % (format,enum))
-	# }}}
-
-def FormatToCode(format): # {{{
-	"""
-	This routine takes the format string, and hardcodes it into an integer, which
-	is passed along the record, in order to identify the nature of the dataset being
-	sent.
-	"""
-
-	if   m.strcmpi(format,'Boolean'):
-		code=1
-	elif m.strcmpi(format,'Integer'):
-		code=2
-	elif m.strcmpi(format,'Double'):
-		code=3
-	elif m.strcmpi(format,'String'):
-		code=4
-	elif m.strcmpi(format,'BooleanMat'):
-		code=5
-	elif m.strcmpi(format,'IntMat'):
-		code=6
-	elif m.strcmpi(format,'DoubleMat'):
-		code=7
-	elif m.strcmpi(format,'MatArray'):
-		code=8
-	elif m.strcmpi(format,'StringArray'):
-		code=9
-	elif m.strcmpi(format,'CompressedMat'):
-		code=10
-	else:
-		raise InputError('FormatToCode error message: data type not supported yet!')
-
-	return code
-# }}}
+
+
+def WriteData(fid, prefix, *args):
+    """
+    WRITEDATA - write model field in binary file
+
+       Usage:
+          WriteData(fid, varargin)
+    """
+
+    #process options
+    options = pairoptions.pairoptions(*args)
+
+    #Get data properties
+    if options.exist('object'):
+        #This is an object field, construct enum and data
+        obj = options.getfieldvalue('object')
+        fieldname = options.getfieldvalue('fieldname')
+        name = options.getfieldvalue('name', prefix + '.' + fieldname)
+        if options.exist('data'):
+            data = options.getfieldvalue('data')
+        else:
+            data = getattr(obj, fieldname)
+    else:
+        #No processing required
+        data = options.getfieldvalue('data')
+        name = options.getfieldvalue('name')
+
+    datatype = options.getfieldvalue('format')
+    mattype = options.getfieldvalue('mattype', 0)  #only required for matrices
+    timeserieslength = options.getfieldvalue('timeserieslength', -1)
+
+    #Process sparse matrices
+    #       if issparse(data),
+    #               data = full(data)
+    #       end
+
+    #Scale data if necesarry
+    if options.exist('scale'):
+        data = np.array(data)
+        scale = options.getfieldvalue('scale')
+        if np.size(data) > 1 and np.ndim(data) > 1 and np.size(data, 0) == timeserieslength:
+            data[0:-1, :] = scale * data[0:-1, :]
+        else:
+            data = scale * data
+    if np.size(data) > 1 and np.size(data, 0) == timeserieslength:
+        yts = options.getfieldvalue('yts')
+        if np.ndim(data) > 1:
+            data[-1, :] = yts * data[-1, :]
+        else:
+            data[-1] = yts * data[-1]
+
+    #Step 1: write the enum to identify this record uniquely
+    fid.write(pack('i', len(name)))
+    fid.write(pack('{}s'.format(len(name)), name.encode()))
+
+    #Step 2: write the data itself.
+    if datatype == 'Boolean':  # {{{
+        #first write length of record
+        fid.write(pack('q', 4 + 4))  #1 bool (disguised as an int) + code
+        #write data code:
+        fid.write(pack('i', FormatToCode(datatype)))
+
+        #now write bool as an integer
+        try:
+            fid.write(pack('i', int(data)))  #send an int, not easy to send a bool
+        except error as Err:
+            raise ValueError('field {} cannot be marshaled, {}'.format(name, Err))
+    # }}}
+
+    elif datatype == 'Integer':  # {{{
+        #first write length of record
+        fid.write(pack('q', 4 + 4))  #1 integer + code
+        #write data code:
+        fid.write(pack('i', FormatToCode(datatype)))
+        #now write integer
+        try:
+            fid.write(pack('i', int(data)))  #force an int,
+        except error as Err:
+            raise ValueError('field {} cannot be marshaled, {}'.format(name, Err))
+    # }}}
+
+    elif datatype == 'Double':  # {{{
+        #first write length of record
+        fid.write(pack('q', 8 + 4))  #1 double + code
+
+    #write data code:
+        fid.write(pack('i', FormatToCode(datatype)))
+
+    #now write double
+        try:
+            fid.write(pack('d', data))
+        except error as Err:
+            raise ValueError('field {} cannot be marshaled, {}'.format(name, Err))
+    # }}}
+
+    elif datatype == 'String':  # {{{
+        #first write length of record
+        fid.write(pack('q', len(data) + 4 + 4))  #string + string size + code
+        #write data code:
+        fid.write(pack('i', FormatToCode(datatype)))
+        #now write string
+        fid.write(pack('i', len(data)))
+        fid.write(pack('{}s'.format(len(data)), data.encode()))
+    # }}}
+
+    elif datatype in ['IntMat', 'BooleanMat']:  # {{{
+        if isinstance(data, (int, bool)):
+            data = np.array([data])
+        elif isinstance(data, (list, tuple)):
+            data = np.array(data).reshape(-1, )
+        if np.ndim(data) == 1:
+            if np.size(data):
+                data = data.reshape(np.size(data), )
+            else:
+                data = data.reshape(0, 0)
+
+    #Get size
+        s = data.shape
+    #if matrix = NaN, then do not write anything
+        if np.ndim(data) == 2 and np.product(s) == 1 and np.all(np.isnan(data)):
+            s = (0, 0)
+
+    #first write length of record
+        recordlength = 4 + 4 + 8 * np.product(s) + 4 + 4  #2 integers (32 bits) + the double matrix + code + matrix type
+        fid.write(pack('q', recordlength))
+
+    #write data code and matrix type:
+        fid.write(pack('i', FormatToCode(datatype)))
+        fid.write(pack('i', mattype))
+
+    #now write matrix
+        fid.write(pack('i', s[0]))
+        try:
+            fid.write(pack('i', s[1]))
+        except IndexError:
+            fid.write(pack('i', 1))
+        for i in range(s[0]):
+            if np.ndim(data) == 1:
+                fid.write(pack('d', float(data[i])))  #get to the "c" convention, hence the transpose
+            else:
+                for j in range(s[1]):
+                    fid.write(pack('d', float(data[i][j])))  #get to the "c" convention, hence the transpose
+    # }}}
+
+    elif datatype == 'DoubleMat':  # {{{
+
+        if isinstance(data, (bool, int, float)):
+            data = np.array([data])
+        elif isinstance(data, (list, tuple)):
+            data = np.array(data).reshape(-1, )
+        if np.ndim(data) == 1:
+            if np.size(data):
+                data = data.reshape(np.size(data), )
+            else:
+                data = data.reshape(0, 0)
+
+    #Get size
+        s = data.shape
+    #if matrix = NaN, then do not write anything
+        if np.ndim(data) == 1 and np.product(s) == 1 and np.all(np.isnan(data)):
+            s = (0, 0)
+
+    #first write length of record
+        recordlength = 4 + 4 + 8 * np.product(s) + 4 + 4  #2 integers (32 bits) + the double matrix + code + matrix type
+
+        try:
+            fid.write(pack('q', recordlength))
+        except error as Err:
+            raise ValueError('Field {} can not be marshaled, {}, with "number" the lenght of the record.'.format(name, Err))
+
+    #write data code and matrix type:
+        fid.write(pack('i', FormatToCode(datatype)))
+        fid.write(pack('i', mattype))
+    #now write matrix
+        fid.write(pack('i', s[0]))
+        try:
+            fid.write(pack('i', s[1]))
+        except IndexError:
+            fid.write(pack('i', 1))
+        for i in range(s[0]):
+            if np.ndim(data) == 1:
+                fid.write(pack('d', float(data[i])))  #get to the "c" convention, hence the transpose
+            else:
+                for j in range(s[1]):
+                    fid.write(pack('d', float(data[i][j])))  #get to the "c" convention, hence the transpose
+    # }}}
+
+    elif datatype == 'CompressedMat':  # {{{
+        if isinstance(data, (bool, int, float)):
+            data = np.array([data])
+        elif isinstance(data, (list, tuple)):
+            data = np.array(data).reshape(-1, )
+        if np.ndim(data) == 1:
+            if np.size(data):
+                data = data.reshape(np.size(data), )
+            else:
+                data = data.reshape(0, 0)
+
+    #Get size
+        s = data.shape
+        if np.ndim(data) == 1:
+            n2 = 1
+        else:
+            n2 = s[1]
+
+    #if matrix = NaN, then do not write anything
+        if np.ndim(data) == 1 and np.product(s) == 1 and np.all(np.isnan(data)):
+            s = (0, 0)
+            n2 = 0
+
+    #first write length of record
+        recordlength = 4 + 4 + 8 + 8 + 1 * (s[0] - 1) * n2 + 8 * n2 + 4 + 4  #2 integers (32 bits) + the matrix + code + matrix type
+        try:
+            fid.write(pack('q', recordlength))
+        except error as Err:
+            raise ValueError('Field {} can not be marshaled, {}, with "number" the lenght of the record.'.format(name, Err))
+
+    #write data code and matrix type:
+        fid.write(pack('i', FormatToCode(datatype)))
+        fid.write(pack('i', mattype))
+
+    #Write offset and range
+        A = data[0:s[0] - 1]
+        offsetA = A.min()
+        rangeA = A.max() - offsetA
+
+        if rangeA == 0:
+            A = A * 0
+        else:
+            A = (A - offsetA) / rangeA * 255.
+
+    #now write matrix
+        fid.write(pack('i', s[0]))
+        try:
+            fid.write(pack('i', s[1]))
+        except IndexError:
+            fid.write(pack('i', 1))
+        fid.write(pack('d', float(offsetA)))
+        fid.write(pack('d', float(rangeA)))
+        if np.ndim(data) == 1:
+            for i in range(s[0] - 1):
+                fid.write(pack('B', int(A[i])))
+            fid.write(pack('d', float(data[s[0] - 1])))  #get to the "c" convention, hence the transpose
+
+        elif np.product(s) > 0:
+            for i in range(s[0] - 1):
+                for j in range(s[1]):
+                    fid.write(pack('B', int(A[i][j])))  #get to the "c" convention, hence the transpose
+
+            for j in range(s[1]):
+                fid.write(pack('d', float(data[s[0] - 1][j])))
+
+    # }}}
+
+    elif datatype == 'MatArray':  # {{{
+        #first get length of record
+        recordlength = 4 + 4  #number of records + code
+        for matrix in data:
+            if isinstance(matrix, (bool, int, float)):
+                matrix = np.array([matrix])
+            elif isinstance(matrix, (list, tuple)):
+                matrix = np.array(matrix).reshape(-1, )
+            if np.ndim(matrix) == 1:
+                if np.size(matrix):
+                    matrix = matrix.reshape(np.size(matrix), )
+                else:
+                    matrix = matrix.reshape(0, 0)
+
+            s = matrix.shape
+            recordlength += 4 * 2 + np.product(s) * 8  #row and col of matrix + matrix of doubles
+
+    #write length of record
+        fid.write(pack('q', recordlength))
+
+    #write data code:
+        fid.write(pack('i', FormatToCode(datatype)))
+
+    #write data, first number of records
+        fid.write(pack('i', len(data)))
+
+        for matrix in data:
+            if isinstance(matrix, (bool, int, float)):
+                matrix = np.array([matrix])
+            elif isinstance(matrix, (list, tuple)):
+                matrix = np.array(matrix).reshape(-1, )
+            if np.ndim(matrix) == 1:
+                matrix = matrix.reshape(np.size(matrix), )
+
+            s = matrix.shape
+
+            fid.write(pack('i', s[0]))
+            try:
+                fid.write(pack('i', s[1]))
+            except IndexError:
+                fid.write(pack('i', 1))
+            for i in range(s[0]):
+                if np.ndim(matrix) == 1:
+                    fid.write(pack('d', float(matrix[i])))  #get to the "c" convention, hence the transpose
+                else:
+                    for j in range(s[1]):
+                        fid.write(pack('d', float(matrix[i][j])))
+    # }}}
+
+    elif datatype == 'StringArray':  # {{{
+        #first get length of record
+        recordlength = 4 + 4  #for length of array + code
+        for string in data:
+            recordlength += 4 + len(string)  #for each string
+
+        #write length of record
+        fid.write(pack('q', recordlength))
+        #write data code:
+        fid.write(pack('i', FormatToCode(datatype)))
+        #now write length of string array
+        fid.write(pack('i', len(data)))
+        #now write the strings
+        for string in data:
+            fid.write(pack('i', len(string)))
+            fid.write(pack('{}s'.format(len(string)), string.encode()))
+    # }}}
+
+    else:  # {{{
+        raise TypeError('WriteData error message: data type: {} not supported yet! ({})'.format(datatype, name))
+    # }}}
+
+
+def FormatToCode(datatype):  # {{{
+    """
+    This routine takes the datatype string, and hardcodes it into an integer, which
+    is passed along the record, in order to identify the nature of the dataset being
+    sent.
+    """
+    if datatype == 'Boolean':
+        code = 1
+    elif datatype == 'Integer':
+        code = 2
+    elif datatype == 'Double':
+        code = 3
+    elif datatype == 'String':
+        code = 4
+    elif datatype == 'BooleanMat':
+        code = 5
+    elif datatype == 'IntMat':
+        code = 6
+    elif datatype == 'DoubleMat':
+        code = 7
+    elif datatype == 'MatArray':
+        code = 8
+    elif datatype == 'StringArray':
+        code = 9
+    elif datatype == 'CompressedMat':
+        code = 10
+    else:
+        raise IOError('FormatToCode error message: data type not supported yet!')
+    return code
+    # }}}
Index: /issm/trunk/src/m/solve/loadresultsfromcluster.py
===================================================================
--- /issm/trunk/src/m/solve/loadresultsfromcluster.py	(revision 24312)
+++ /issm/trunk/src/m/solve/loadresultsfromcluster.py	(revision 24313)
@@ -3,88 +3,89 @@
 import platform
 from loadresultsfromdisk import loadresultsfromdisk
-
 from helpers import *
 
-def loadresultsfromcluster(md,runtimename=False):
-	"""
-	LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
- 
-	   Usage:
-	      md=loadresultsfromcluster(md,runtimename);
-	"""
 
-	#retrieve cluster, to be able to call its methods
-	cluster=md.cluster
+def loadresultsfromcluster(md, runtimename=False):
+    """
+    LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
 
-	if runtimename:
-		md.private.runtimename=runtimename
+       Usage:
+          md = loadresultsfromcluster(md, runtimename)
+    """
 
-	#Download outputs from the cluster
-	filelist=[md.miscellaneous.name+'.outlog',md.miscellaneous.name+'.errlog']
-	if md.qmu.isdakota:
-		filelist.append(md.miscellaneous.name+'.qmu.err')
-		filelist.append(md.miscellaneous.name+'.qmu.out')
-		if 'tabular_graphics_data' in fieldnames(md.qmu.params):
-			if md.qmu.params.tabular_graphics_data:
-				filelist.append('dakota_tabular.dat')
-	else:
-		filelist.append(md.miscellaneous.name+'.outbin')
-	cluster.Download(md.private.runtimename,filelist)
+    #retrieve cluster, to be able to call its methods
+    cluster = md.cluster
 
-	#If we are here, no errors in the solution sequence, call loadresultsfromdisk.
-	if os.path.exists(md.miscellaneous.name+'.outbin'):
-		if os.path.getsize(md.miscellaneous.name+'.outbin')>0:
-			md=loadresultsfromdisk(md,md.miscellaneous.name+'.outbin')
-		else:
-			print 'WARNING, outbin file is empty for run '+md.miscellaneous.name
-	elif not md.qmu.isdakota:
-		print 'WARNING, outbin file does not exist '+md.miscellaneous.name
-		
-	#erase the log and output files
-	if md.qmu.isdakota:
-		#filename=os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name)
-		filename = md.miscellaneous.name
+    if runtimename:
+        md.private.runtimename = runtimename
 
-		# this will not work like normal as dakota doesn't generate outbin files,
-		#   instead calls postqmu to store results directly in the model
-		#   at md.results.dakota via dakota_out_parse
-		md=loadresultsfromdisk(md,md.miscellaneous.name+'.outbin')
-	else:
-		filename=md.miscellaneous.name
-		TryRem('.outbin',filename)
-		if not platform.system()=='Windows':
-			TryRem('.tar.gz',md.private.runtimename)
+    #Download outputs from the cluster
+    filelist = [md.miscellaneous.name + '.outlog', md.miscellaneous.name + '.errlog']
+    if md.qmu.isdakota:
+        filelist.append(md.miscellaneous.name + '.qmu.err')
+        filelist.append(md.miscellaneous.name + '.qmu.out')
+        if 'tabular_graphics_data' in fieldnames(md.qmu.params):
+            if md.qmu.params.tabular_graphics_data:
+                filelist.append('dakota_tabular.dat')
+    else:
+        filelist.append(md.miscellaneous.name + '.outbin')
+    cluster.Download(md.private.runtimename, filelist)
 
-	TryRem('.errlog',filename)
-	TryRem('.outlog',filename)
-	
-	#erase input file if run was carried out on same platform.
-	hostname=socket.gethostname()
-	if hostname==cluster.name:
-		if md.qmu.isdakota:
-			#filename=os.path.join('qmu'+str(os.getpid()),md.miscellaneous.name)
-			filename = md.miscellaneous.name
-			TryRem('.queue',filename)
-		else:
-			filename=md.miscellaneous.name
-			TryRem('.toolkits',filename)
-			if not platform.system()=='Windows':
-				TryRem('.queue',filename)
-			else:
-				TryRem('.bat',filename)
+    #If we are here, no errors in the solution sequence, call loadresultsfromdisk.
+    if os.path.exists(md.miscellaneous.name + '.outbin'):
+        if os.path.getsize(md.miscellaneous.name + '.outbin') > 0:
+            md = loadresultsfromdisk(md, md.miscellaneous.name + '.outbin')
+        else:
+            print(('WARNING, outbin file is empty for run ' + md.miscellaneous.name))
+    elif not md.qmu.isdakota:
+        print(('WARNING, outbin file does not exist ' + md.miscellaneous.name))
 
-		# remove this for bin file debugging
-		TryRem('.bin',filename)
+    #erase the log and output files
+    if md.qmu.isdakota:
+        #filename = os.path.join('qmu' + str(os.getpid()), md.miscellaneous.name)
+        filename = md.miscellaneous.name
 
-	#cwd = os.getcwd().split('/')[-1]
-	if md.qmu.isdakota:
-		os.chdir('..')
-		#TryRem('',cwd)
+        # this will not work like normal as dakota doesn't generate outbin files,
+        #   instead calls postqmu to store results directly in the model
+        #   at md.results.dakota via dakota_out_parse
+        md = loadresultsfromdisk(md, md.miscellaneous.name + '.outbin')
+    else:
+        filename = md.miscellaneous.name
+        TryRem('.outbin', filename)
+        if not platform.system() == 'Windows':
+            TryRem('.tar.gz', md.private.runtimename)
 
-	return md
+    TryRem('.errlog', filename)
+    TryRem('.outlog', filename)
 
-def TryRem(extension,filename):
-	try:
-		os.remove(filename+extension)
-	except OSError:
-		print 'WARNING, no '+extension+'  is present for run '+filename
+    #erase input file if run was carried out on same platform.
+    hostname = socket.gethostname()
+    if hostname == cluster.name:
+        if md.qmu.isdakota:
+            #filename = os.path.join('qmu' + str(os.getpid()), md.miscellaneous.name)
+            filename = md.miscellaneous.name
+            TryRem('.queue', filename)
+        else:
+            filename = md.miscellaneous.name
+            TryRem('.toolkits', filename)
+            if not platform.system() == 'Windows':
+                TryRem('.queue', filename)
+            else:
+                TryRem('.bat', filename)
+
+    # remove this for bin file debugging
+        TryRem('.bin', filename)
+
+    #cwd = os.getcwd().split('/')[-1]
+    if md.qmu.isdakota:
+        os.chdir('..')
+    #TryRem('', cwd)
+
+    return md
+
+
+def TryRem(extension, filename):
+    try:
+        os.remove(filename + extension)
+    except OSError:
+        print(('WARNING, no ' + extension + '  is present for run ' + filename))
Index: /issm/trunk/src/m/solve/loadresultsfromdisk.py
===================================================================
--- /issm/trunk/src/m/solve/loadresultsfromdisk.py	(revision 24312)
+++ /issm/trunk/src/m/solve/loadresultsfromdisk.py	(revision 24313)
@@ -2,61 +2,61 @@
 from results import results
 from parseresultsfromdisk import parseresultsfromdisk
-import MatlabFuncs as m
 from postqmu import postqmu
 
-def loadresultsfromdisk(md,filename):
-	"""
-	LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"            
- 
-	   Usage:
-	      md=loadresultsfromdisk(md=False,filename=False);
-	"""
 
-	#check number of inputs/outputs
-	if not md or not filename:
-		raise ValueError("loadresultsfromdisk: error message.")
+def loadresultsfromdisk(md, filename):
+    """
+    LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"
 
-	if not md.qmu.isdakota:
+       Usage:
+          md = loadresultsfromdisk(md=False,filename=False);
+    """
+    #check number of inputs/outputs
+    if not md or not filename:
+        raise ValueError("loadresultsfromdisk: error message.")
 
-		#Check that file exists
-		if not os.path.exists(filename):
-			raise OSError("binary file '%s' not found." % filename)
+    if not md.qmu.isdakota:
 
-		#initialize md.results if not a structure yet
-		if not isinstance(md.results,results):
-			md.results=results()
+        #Check that file exists
+        if not os.path.exists(filename):
+            raise OSError("binary file '{}' not found.".format(filename))
 
-		#load results onto model
-		structure=parseresultsfromdisk(md,filename,not md.settings.io_gather)
-		if not len(structure):
-			raise RuntimeError("No result found in binary file '%s'. Check for solution crash." % filename)
-		setattr(md.results,structure[0].SolutionType,structure)
+        #initialize md.results if not a structure yet
+        if not isinstance(md.results, results):
+            md.results = results()
 
-		#recover solution_type from results
-		md.private.solution=structure[0].SolutionType
+        #load results onto model
+        structure = parseresultsfromdisk(md, filename, not md.settings.io_gather)
+        if not len(structure):
+            raise RuntimeError("No result found in binary file '{}'. Check for solution crash.".format(filename))
 
-		#read log files onto fields
-		if os.path.exists(md.miscellaneous.name+'.errlog'):
-			with open(md.miscellaneous.name+'.errlog','r') as f:
-				setattr(getattr(md.results,structure[0].SolutionType)[0],'errlog',[line[:-1] for line in f])
-		else:
-			setattr(getattr(md.results,structure[0].SolutionType)[0],'errlog',[])
+        setattr(md.results, structure[0].SolutionType, structure)
 
-		if os.path.exists(md.miscellaneous.name+'.outlog'):
-			with open(md.miscellaneous.name+'.outlog','r') as f:
-				setattr(getattr(md.results,structure[0].SolutionType)[0],'outlog',[line[:-1] for line in f])
-		else:
-			setattr(getattr(md.results,structure[0].SolutionType)[0],'outlog',[])
+        #recover solution_type from results
+        md.private.solution = structure[0].SolutionType
 
-		if len(getattr(md.results,structure[0].SolutionType)[0].errlog):
-			print ("loadresultsfromcluster info message: error during solution. Check your errlog and outlog model fields.")
+        #read log files onto fields
+        if os.path.exists(md.miscellaneous.name + '.errlog'):
+            with open(md.miscellaneous.name + '.errlog', 'r') as f:
+                setattr(getattr(md.results, structure[0].SolutionType)[0], 'errlog', [line[:-1] for line in f])
+        else:
+            setattr(getattr(md.results, structure[0].SolutionType)[0], 'errlog', [])
 
-		#if only one solution, extract it from list for user friendliness
-		if len(structure) == 1 and not m.strcmp(structure[0].SolutionType,'TransientSolution'):
-			setattr(md.results,structure[0].SolutionType,structure[0])
+        if os.path.exists(md.miscellaneous.name + '.outlog'):
+            with open(md.miscellaneous.name + '.outlog', 'r') as f:
+                setattr(getattr(md.results, structure[0].SolutionType)[0], 'outlog', [line[:-1] for line in f])
+        else:
+            setattr(getattr(md.results, structure[0].SolutionType)[0], 'outlog', [])
 
-	#post processes qmu results if necessary
-	else:
-		md=postqmu(md,filename)
+        if len(getattr(md.results, structure[0].SolutionType)[0].errlog):
+            print("loadresultsfromcluster info message: error during solution. Check your errlog and outlog model fields.")
 
-	return md
+        #if only one solution, extract it from list for user friendliness
+        if len(structure) == 1 and not structure[0].SolutionType == 'TransientSolution':
+            setattr(md.results, structure[0].SolutionType, structure[0])
+
+    #post processes qmu results if necessary
+    else:
+        md = postqmu(md, filename)
+
+    return md
Index: /issm/trunk/src/m/solve/marshall.py
===================================================================
--- /issm/trunk/src/m/solve/marshall.py	(revision 24312)
+++ /issm/trunk/src/m/solve/marshall.py	(revision 24313)
@@ -1,44 +1,43 @@
 from WriteData import WriteData
 
+
 def marshall(md):
-	"""
-	MARSHALL - outputs a compatible binary file from @model md, for certain solution type.
+    """
+    MARSHALL - outputs a compatible binary file from @model md, for certain solution type.
 
-	   The routine creates a compatible binary file from @model md
-	   This binary file will be used for parallel runs in JPL-package
+       The routine creates a compatible binary file from @model md
+       This binary file will be used for parallel runs in JPL - package
 
-	   Usage:
-	      marshall(md)
-	"""
-	if md.verbose.solution:
-		print "marshalling file '%s.bin'." % md.miscellaneous.name
+       Usage:
+          marshall(md)
+    """
+    if md.verbose.solution:
+        print(("marshalling file '%s.bin'." % md.miscellaneous.name))
 
-	#open file for binary writing
-	try:
-		fid=open(md.miscellaneous.name+'.bin','wb')
-	except IOError as e:
-		raise IOError("marshall error message: could not open '%s.bin' file for binary writing." % md.miscellaneous.name)
+    #open file for binary writing
+    try:
+        fid = open(md.miscellaneous.name + '.bin', 'wb')
+    except IOError as e:
+        raise IOError("marshall error message: could not open '%s.bin' file for binary writing. Due to: ".format(md.miscellaneous.name), e)
 
-	for field in md.properties():
+    for field in md.properties():
+        #Some properties do not need to be marshalled
+        if field in ['results', 'radaroverlay', 'toolkits', 'cluster', 'private']:
+            continue
 
-		#Some properties do not need to be marshalled
-		if field in ['results','radaroverlay','toolkits','cluster','private']:
-			continue
+    #Check that current field is an object
+        if not hasattr(getattr(md, field), 'marshall'):
+            raise TypeError("field '{}' is not an object.".format(field))
 
-		#Check that current field is an object
-		if not hasattr(getattr(md,field),'marshall'):
-			raise TypeError("field '%s' is not an object." % field)
+    #Marshall current object
+    #print "marshalling %s ..." % field
+        exec("md.{}.marshall('md.{}', md, fid)".format(field, field))
 
-		#Marshall current object
-		#print "marshalling %s ..." % field
-		exec("md.{}.marshall('md.{}',md,fid)".format(field,field))
+    #Last, write "md.EOF" to make sure that the binary file is not corrupt
+    WriteData(fid, 'XXX', 'name', 'md.EOF', 'data', True, 'format', 'Boolean')
 
-	#Last, write "md.EOF" to make sure that the binary file is not corrupt
-	WriteData(fid,'XXX','name','md.EOF','data',True,'format','Boolean');
-
-	#close file
-	try:
-		fid.close()
-	except IOError as e:
-		raise IOError("marshall error message: could not close file '%s.bin'." % md.miscellaneous.name)
-
+    #close file
+    try:
+        fid.close()
+    except IOError as e:
+        print("marshall error message: could not close file '{}.bin' due to:".format(md.miscellaneous.name), e)
Index: /issm/trunk/src/m/solve/parseresultsfrombuffer.js
===================================================================
--- /issm/trunk/src/m/solve/parseresultsfrombuffer.js	(revision 24312)
+++ /issm/trunk/src/m/solve/parseresultsfrombuffer.js	(revision 24313)
@@ -100,4 +100,7 @@
 		else if (fieldname == 'TotalSmb') for (var i=0;i<field.length;i++)field[i]= field[i]/Math.pow(10,12)*yts; //(GigaTon/year)
 		else if (fieldname == 'TotalSmbScaled') for (var i=0;i<field.length;i++)field[i]= field[i]/Math.pow(10,12)*yts; //(GigaTon/year)
+		else if (fieldname == 'GroundinglineMassFlux') for (var i=0;i<field.length;i++)field[i]= field[i]/Math.pow(10,12)*yts; //(GigaTon/year)
+		else if (fieldname == 'IcefrontMassFlux') for (var i=0;i<field.length;i++)field[i]= field[i]/Math.pow(10,12)*yts; //(GigaTon/year)
+		else if (fieldname == 'IcefrontMassFluxLevelset') for (var i=0;i<field.length;i++)field[i]= field[i]/Math.pow(10,12)*yts; //(GigaTon/year)
 		else if (fieldname == 'SmbMassBalance') for (var i=0;i<field.length;i++)field[i]= field[i]*yts;
 		else if (fieldname == 'SmbPrecipitation') for (var i=0;i<field.length;i++)field[i]= field[i]*yts;
Index: /issm/trunk/src/m/solve/parseresultsfromdisk.m
===================================================================
--- /issm/trunk/src/m/solve/parseresultsfromdisk.m	(revision 24312)
+++ /issm/trunk/src/m/solve/parseresultsfromdisk.m	(revision 24313)
@@ -23,8 +23,8 @@
 counter = 1;
 step    = result.step;
-while ~isempty(result), 
+while ~isempty(result),
 
 	if check_nomoresteps,
-		%check that the new result does not add a step, which would be an error: 
+		%check that the new result does not add a step, which would be an error:
 		if result.step>=1,
 			error('parsing results for a steady-state core, which incorporates transient results!');
@@ -40,5 +40,5 @@
 	%Add result
 	if(result.step==0),
-		%if we have a step = 0, this is a steady state solutoin, don't expect more steps. 
+		%if we have a step = 0, this is a steady state solutoin, don't expect more steps.
 		index = 1;
 		check_nomoresteps=1;
@@ -77,5 +77,5 @@
 results=struct();
 
-%if we have done split I/O, ie, we have results that are fragmented across patches, 
+%if we have done split I/O, ie, we have results that are fragmented across patches,
 %do a first pass, and figure out the structure of results
 result=ReadDataDimensions(fid);
@@ -85,5 +85,5 @@
 	results(result.step).step=result.step;
 	if result.time~=-9999,
-		results(result.step).time=result.time; 
+		results(result.step).time=result.time;
 	end
 
@@ -111,5 +111,5 @@
 	results(result.step).step=result.step;
 	if result.time~=-9999,
-		results(result.step).time=result.time; 
+		results(result.step).time=result.time;
 	end
 
@@ -193,4 +193,10 @@
 	elseif strcmp(fieldname,'TotalSmbScaled'),
 		field = field/10.^12*yts; %(GigaTon/year)
+	elseif strcmp(fieldname,'GroundinglineMassFlux'),
+		field = field/10.^12*yts; %(GigaTon/year)
+	elseif strcmp(fieldname,'IcefrontMassFlux'),
+		field = field/10.^12*yts; %(GigaTon/year)
+	elseif strcmp(fieldname,'IcefrontMassFluxLevelset'),
+		field = field/10.^12*yts; %(GigaTon/year)
 	elseif strcmp(fieldname,'SmbMassBalance'),
 		field = field*yts;
@@ -199,4 +205,6 @@
 	elseif strcmp(fieldname,'SmbRunoff'),
 		field = field*yts;
+	elseif strcmp(fieldname,'SmbRunoffSubstep'),
+		field = field*yts;
 	elseif strcmp(fieldname,'SmbEvaporation'),
 		field = field*yts;
@@ -214,19 +222,19 @@
 		field = field*yts;
 	elseif (strcmp(fieldname,'LoveKernelsReal') | strcmp(fieldname,'LoveKernelsImag')),
-		nlayer = md.materials.numlayers; 
-		degmax = md.love.sh_nmax; 
-		nfreq  = md.love.nfreq; 
-		temp_field = cell(degmax+1,nfreq,nlayer+1,6); 
+		nlayer = md.materials.numlayers;
+		degmax = md.love.sh_nmax;
+		nfreq  = md.love.nfreq;
+		temp_field = cell(degmax+1,nfreq,nlayer+1,6);
 		for ii=1:degmax+1
 			for jj=1:nfreq
 				for kk=1:nlayer+1
-					ll = (ii-1)*(nlayer+1)*6 + ((kk-1)*6+1); 
+					ll = (ii-1)*(nlayer+1)*6 + ((kk-1)*6+1);
 					for mm=1:6
-						temp_field{ii,jj,kk,mm} = field(ll+(mm-1),jj);  
+						temp_field{ii,jj,kk,mm} = field(ll+(mm-1),jj);
 					end
 				end
 			end
 		end
-		field=temp_field; 
+		field=temp_field;
 	end
 
Index: /issm/trunk/src/m/solve/parseresultsfromdisk.py
===================================================================
--- /issm/trunk/src/m/solve/parseresultsfromdisk.py	(revision 24312)
+++ /issm/trunk/src/m/solve/parseresultsfromdisk.py	(revision 24313)
@@ -4,292 +4,309 @@
 import results as resultsclass
 
-def parseresultsfromdisk(md,filename,iosplit):
-	if iosplit:
-		saveres=parseresultsfromdiskiosplit(md,filename)
-	else:
-		saveres=parseresultsfromdiskioserial(md,filename)
-
-	return saveres
-
-def parseresultsfromdiskioserial(md,filename):    # {{{
-	#Open file
-	try:
-		fid=open(filename,'rb')
-	except IOError as e:
-		raise IOError("loadresultsfromdisk error message: could not open '%s' for binary reading." % filename)
-
-	#initialize results: 
-	saveres=[]
-
-	#Read fields until the end of the file.
-	loadres=ReadData(fid,md)
-
-	counter=0
-	check_nomoresteps=0
-	step=loadres['step']
-
-	while loadres:
-		#check that the new result does not add a step, which would be an error: 
-		if check_nomoresteps:
-			if loadres['step']>=1:
-				raise TypeError("parsing results for a steady-state core, which incorporates transient results!")
-
-		#Check step, increase counter if this is a new step
-		if(step!=loadres['step'] and loadres['step']>1):
-			counter = counter + 1
-			step    = loadres['step']
-
-		#Add result
-		if loadres['step']==0:
-			#if we have a step = 0, this is a steady state solution, don't expect more steps. 
-			index = 0;
-			check_nomoresteps=1
-		elif loadres['step']==1:
-			index = 0
-		else:
-			index = counter;
-		
-		if index > len(saveres)-1:
-			for i in xrange(len(saveres)-1,index-1):
-				saveres.append(None)
-			saveres.append(resultsclass.results())
-		elif saveres[index] is None:
-			saveres[index]=resultsclass.results()
-			
-		#Get time and step
-		if loadres['step'] != -9999.:
-			saveres[index].__dict__['step']=loadres['step']
-		if loadres['time'] != -9999.:
-			saveres[index].__dict__['time']=loadres['time']
-
-		#Add result
-		saveres[index].__dict__[loadres['fieldname']]=loadres['field']
-
-		#read next result
-		loadres=ReadData(fid,md)
-
-	fid.close()
-
-	return saveres
-	# }}}
-def parseresultsfromdiskiosplit(md,filename):    # {{{
-
-	#Open file
-	try:
-		fid=open(filename,'rb')
-	except IOError as e:
-		raise IOError("loadresultsfromdisk error message: could not open '%s' for binary reading." % filename)
-
-	saveres=[]
-
-	#if we have done split I/O, ie, we have results that are fragmented across patches, 
-	#do a first pass, and figure out the structure of results
-	loadres=ReadDataDimensions(fid)
-	while loadres:
-
-		#Get time and step
-		if loadres['step'] > len(saveres):
-			for i in xrange(len(saveres),loadres['step']-1):
-				saveres.append(None)
-			saveres.append(resultsclass.results())
-		setattr(saveres[loadres['step']-1],'step',loadres['step'])
-		setattr(saveres[loadres['step']-1],'time',loadres['time']) 
-
-		#Add result
-		setattr(saveres[loadres['step']-1],loadres['fieldname'],float('NaN'))
-
-		#read next result
-		loadres=ReadDataDimensions(fid)
-
-	#do a second pass, and figure out the size of the patches
-	fid.seek(0)    #rewind
-	loadres=ReadDataDimensions(fid)
-	while loadres:
-
-		#read next result
-		loadres=ReadDataDimensions(fid)
-
-	#third pass, this time to read the real information
-	fid.seek(0)    #rewind
-	loadres=ReadData(fid,md)
-	while loadres:
-
-		#Get time and step
-		if loadres['step']> len(saveres):
-			for i in xrange(len(saveres),loadres['step']-1):
-				saveres.append(None)
-			saveres.append(saveresclass.saveres())
-		setattr(saveres[loadres['step']-1],'step',loadres['step'])
-		setattr(saveres[loadres['step']-1],'time',loadres['time']) 
-
-		#Add result
-		setattr(saveres[loadres['step']-1],loadres['fieldname'],loadres['field'])
-
-		#read next result
-		loadres=ReadData(fid,md)
-
-	#close file
-	fid.close()
-
-	return saveres
-	# }}}
-def ReadData(fid,md):    # {{{
-	"""
-	READDATA - ...
-	 
-	    Usage:
-	       field=ReadData(fid,md)
-	"""
-
-	#read field
-	try:
-		length=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
-
-		fieldname=struct.unpack('%ds' % length,fid.read(length))[0][:-1]
-		time=struct.unpack('d',fid.read(struct.calcsize('d')))[0]
-		step=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
-
-		type=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
-		M=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
-		if   type==1:
-			field=np.array(struct.unpack('%dd' % M,fid.read(M*struct.calcsize('d'))),dtype=float)
-		elif type==2:
-			field=struct.unpack('%ds' % M,fid.read(M))[0][:-1]
-		elif type==3:
-			N=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
-#			field=transpose(fread(fid,[N M],'double'));
-			field=np.zeros(shape=(M,N),dtype=float)
-			for i in xrange(M):
-				field[i,:]=struct.unpack('%dd' % N,fid.read(N*struct.calcsize('d')))
-		elif type==4:
-			N=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
-#			field=transpose(fread(fid,[N M],'int'));
-			field=np.zeros(shape=(M,N),dtype=int)
-			for i in xrange(M):
-				field[i,:]=struct.unpack('%ii' % N,fid.read(N*struct.calcsize('i')))
-		else:
-			raise TypeError("cannot read data of type %d" % type)
-
-		#Process units here FIXME: this should not be done here!
-		yts=md.constants.yts
-		if fieldname=='BalancethicknessThickeningRate':
-			field = field*yts
-		elif fieldname=='HydrologyWaterVx':
-			field = field*yts
-		elif fieldname=='HydrologyWaterVy':
-			field = field*yts
-		elif fieldname=='Vx':
-			field = field*yts
-		elif fieldname=='Vy':
-			field = field*yts
-		elif fieldname=='Vz':
-			field = field*yts
-		elif fieldname=='Vel':
-			field = field*yts
-		elif fieldname=='BasalforcingsGroundediceMeltingRate':
-			field = field*yts
-		elif fieldname=='BasalforcingsFloatingiceMeltingRate':
-			field = field*yts
-		elif fieldname=='TotalFloatingBmb':
-			field = field/10.**12*yts #(GigaTon/year)
-		elif fieldname=='TotalFloatingBmbScaled':
-			field = field/10.**12*yts #(GigaTon/year)
-		elif fieldname=='TotalGroundedBmb':
-			field = field/10.**12*yts #(GigaTon/year)
-		elif fieldname=='TotalGroundedBmbScaled':
-			field = field/10.**12*yts #(GigaTon/year)
-		elif fieldname=='TotalSmb':
-			field = field/10.**12*yts #(GigaTon/year)
-		elif fieldname=='TotalSmbScaled':
-			field = field/10.**12*yts #(GigaTon/year)
-		elif fieldname=='SmbMassBalance':
-			field = field*yts
-		elif fieldname=='SmbPrecipitation':
-			field = field*yts
-		elif fieldname=='SmbRunoff':
-			field = field*yts
-                elif fieldname=='SmbEvaporation':
-                        field = field*yts;
-                elif fieldname=='SmbRefreeze':
-                        field = field*yts;
-		elif fieldname=='SmbEC':
-			field = field*yts
-		elif fieldname=='SmbAccumulation':
-			field = field*yts
-		elif fieldname=='SmbMelt':
-			field = field*yts
-    		elif fieldname=='SmbMAdd':
-        		field = field*yts
-		elif fieldname=='CalvingCalvingrate':
-			field = field*yts
-		elif fieldname=='LoveKernelsReal' or fieldname=='LoveKernelsImag':
-			nlayer = md.materials.numlayers
-			degmax = md.love.sh_nmax
-			nfreq  = md.love.nfreq
-			#for numpy 1.8+ only
-			#temp_field = np.full((degmax+1,nfreq,nlayer+1,6),0.0)
-			temp_field = np.empty((degmax+1,nfreq,nlayer+1,6))
-			temp_field.fill(0.0)
-			for ii in range(degmax+1):
-				for jj in range(nfreq):
-					for kk in range(nlayer+1):
-						ll = ii*(nlayer+1)*6 + (kk*6+1)
-						for mm in range(6):
-							temp_field[ii,jj,kk,mm] = field[ll+mm-1,jj]
-			field=temp_field
-
-		if time !=-9999:
-			time = time/yts
-
-		saveres=OrderedDict()
-		saveres['fieldname']=fieldname
-		saveres['time']=time
-		saveres['step']=step
-		saveres['field']=field
-
-	except struct.error as e:
-		saveres=None
-
-	return saveres
-	# }}}
-def ReadDataDimensions(fid):    # {{{
-	"""
-	READDATADIMENSIONS - read data dimensions, step and time, but not the data itself.
-	 
-	    Usage:
-	       field=ReadDataDimensions(fid)
-	"""
-
-	#read field
-	try:
-		length=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
-
-		fieldname=struct.unpack('%ds' % length,fid.read(length))[0][:-1]
-		time=struct.unpack('d',fid.read(struct.calcsize('d')))[0]
-		step=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
-
-		type=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
-		M=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
-		N=1    #default
-		if   type==1:
-			fid.seek(M*8,1)
-		elif type==2:
-			fid.seek(M,1)
-		elif type==3:
-			N=struct.unpack('i',fid.read(struct.calcsize('i')))[0]
-			fid.seek(N*M*8,1)
-		else:
-			raise TypeError("cannot read data of type %d" % type)
-
-		saveres=OrderedDict()
-		saveres['fieldname']=fieldname
-		saveres['time']=time
-		saveres['step']=step
-		saveres['M']=M
-		saveres['N']=N
-
-	except struct.error as e:
-		saveres=None
-
-	return saveres
-	# }}}
+
+def parseresultsfromdisk(md, filename, iosplit):
+    if iosplit:
+        saveres = parseresultsfromdiskiosplit(md, filename)
+    else:
+        saveres = parseresultsfromdiskioserial(md, filename)
+    return saveres
+
+
+def parseresultsfromdiskioserial(md, filename):  # {{{
+    #Open file
+    try:
+        fid = open(filename, 'rb')
+    except IOError as e:
+        raise IOError("loadresultsfromdisk error message: could not open '{}' for binary reading.".format(filename))
+
+    #initialize results:
+    saveres = []
+
+    #Read fields until the end of the file.
+    loadres = ReadData(fid, md)
+
+    counter = 0
+    check_nomoresteps = 0
+    step = loadres['step']
+
+    while loadres:
+        #check that the new result does not add a step, which would be an error:
+        if check_nomoresteps:
+            if loadres['step'] >= 1:
+                raise TypeError("parsing results for a steady - state core, which incorporates transient results!")
+
+        #Check step, increase counter if this is a new step
+        if(step != loadres['step'] and loadres['step'] > 1):
+            counter = counter + 1
+            step = loadres['step']
+
+        #Add result
+        if loadres['step'] == 0:
+            #if we have a step = 0, this is a steady state solution, don't expect more steps.
+            index = 0
+            check_nomoresteps = 1
+        elif loadres['step'] == 1:
+            index = 0
+        else:
+            index = counter
+
+        if index > len(saveres) - 1:
+            for i in range(len(saveres) - 1, index - 1):
+                saveres.append(None)
+            saveres.append(resultsclass.results())
+        elif saveres[index] is None:
+            saveres[index] = resultsclass.results()
+
+    #Get time and step
+        if loadres['step'] != -9999.:
+            saveres[index].__dict__['step'] = loadres['step']
+        if loadres['time'] != -9999.:
+            saveres[index].__dict__['time'] = loadres['time']
+
+    #Add result
+        saveres[index].__dict__[loadres['fieldname']] = loadres['field']
+
+    #read next result
+        loadres = ReadData(fid, md)
+
+    fid.close()
+
+    return saveres
+    # }}}
+
+
+def parseresultsfromdiskiosplit(md, filename):  # {{{
+    #Open file
+    try:
+        fid = open(filename, 'rb')
+    except IOError as e:
+        raise IOError("loadresultsfromdisk error message: could not open '{}' for binary reading.".format(filename))
+
+    saveres = []
+
+    #if we have done split I / O, ie, we have results that are fragmented across patches,
+    #do a first pass, and figure out the structure of results
+    loadres = ReadDataDimensions(fid)
+    while loadres:
+
+        #Get time and step
+        if loadres['step'] > len(saveres):
+            for i in range(len(saveres), loadres['step'] - 1):
+                saveres.append(None)
+            saveres.append(resultsclass.results())
+        setattr(saveres[loadres['step'] - 1], 'step', loadres['step'])
+        setattr(saveres[loadres['step'] - 1], 'time', loadres['time'])
+
+    #Add result
+        setattr(saveres[loadres['step'] - 1], loadres['fieldname'], float('NaN'))
+
+    #read next result
+        loadres = ReadDataDimensions(fid)
+
+    #do a second pass, and figure out the size of the patches
+    fid.seek(0)  #rewind
+    loadres = ReadDataDimensions(fid)
+    while loadres:
+
+        #read next result
+        loadres = ReadDataDimensions(fid)
+
+    #third pass, this time to read the real information
+    fid.seek(0)  #rewind
+    loadres = ReadData(fid, md)
+    while loadres:
+
+        #Get time and step
+        if loadres['step'] > len(saveres):
+            for i in range(len(saveres), loadres['step'] - 1):
+                saveres.append(None)
+            saveres.append(saveresclass.saveres())
+        setattr(saveres[loadres['step'] - 1], 'step', loadres['step'])
+        setattr(saveres[loadres['step'] - 1], 'time', loadres['time'])
+
+    #Add result
+        setattr(saveres[loadres['step'] - 1], loadres['fieldname'], loadres['field'])
+
+    #read next result
+        loadres = ReadData(fid, md)
+
+    #close file
+    fid.close()
+
+    return saveres
+    # }}}
+
+
+def ReadData(fid, md):  # {{{
+    """
+    READDATA -
+
+        Usage:
+           field = ReadData(fid, md)
+    """
+
+    #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
+        time = struct.unpack('d', fid.read(struct.calcsize('d')))[0]
+        step = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
+        datatype = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
+        M = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
+        if datatype == 1:
+            field = np.array(struct.unpack('{}d'.format(M), fid.read(M * struct.calcsize('d'))), dtype=float)
+
+        elif datatype == 2:
+            field = struct.unpack('{}s'.format(M), fid.read(M))[0][:-1]
+            field = field.decode()
+
+        elif datatype == 3:
+            N = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
+    #field = transpose(fread(fid, [N M], 'double'))
+            field = np.zeros(shape=(M, N), dtype=float)
+            for i in range(M):
+                field[i, :] = struct.unpack('{}d'.format(N), fid.read(N * struct.calcsize('d')))
+
+        elif datatype == 4:
+            N = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
+    # field = transpose(fread(fid, [N M], 'int'))
+            field = np.zeros(shape=(M, N), dtype=int)
+            for i in range(M):
+                field[i, :] = struct.unpack('{}i'.format(N), fid.read(N * struct.calcsize('i')))
+
+        else:
+            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':
+            field = field * yts
+        elif fieldname == 'HydrologyWaterVx':
+            field = field * yts
+        elif fieldname == 'HydrologyWaterVy':
+            field = field * yts
+        elif fieldname == 'Vx':
+            field = field * yts
+        elif fieldname == 'Vy':
+            field = field * yts
+        elif fieldname == 'Vz':
+            field = field * yts
+        elif fieldname == 'Vel':
+            field = field * yts
+        elif fieldname == 'BasalforcingsGroundediceMeltingRate':
+            field = field * yts
+        elif fieldname == 'BasalforcingsFloatingiceMeltingRate':
+            field = field * yts
+        elif fieldname == 'TotalFloatingBmb':
+            field = field / 10.**12 * yts  #(GigaTon/year)
+        elif fieldname == 'TotalFloatingBmbScaled':
+            field = field / 10.**12 * yts  #(GigaTon/year)
+        elif fieldname == 'TotalGroundedBmb':
+            field = field / 10.**12 * yts  #(GigaTon/year)
+        elif fieldname == 'TotalGroundedBmbScaled':
+            field = field / 10.**12 * yts  #(GigaTon/year)
+        elif fieldname == 'TotalSmb':
+            field = field / 10.**12 * yts  #(GigaTon/year)
+        elif fieldname == 'TotalSmbScaled':
+            field = field / 10.**12 * yts  #(GigaTon/year)
+        elif fieldname == 'GroundinglineMassFlux':
+            field = field / 10.**12 * yts  #(GigaTon/year)
+        elif fieldname == 'IcefrontMassFlux':
+            field = field / 10.**12 * yts  #(GigaTon/year)
+        elif fieldname == 'IcefrontMassFluxLevelset':
+            field = field / 10.**12 * yts  #(GigaTon/year)
+        elif fieldname == 'SmbMassBalance':
+            field = field * yts
+        elif fieldname == 'SmbPrecipitation':
+            field = field * yts
+        elif fieldname == 'SmbRunoff':
+            field = field * yts
+        elif fieldname == 'SmbRunoffSubstep':
+            field = field * yts
+        elif fieldname == 'SmbEvaporation':
+            field = field * yts
+        elif fieldname == 'SmbRefreeze':
+            field = field * yts
+        elif fieldname == 'SmbEC':
+            field = field * yts
+        elif fieldname == 'SmbAccumulation':
+            field = field * yts
+        elif fieldname == 'SmbMelt':
+            field = field * yts
+        elif fieldname == 'SmbMAdd':
+            field = field * yts
+        elif fieldname == 'CalvingCalvingrate':
+            field = field * yts
+        elif fieldname == 'LoveKernelsReal' or fieldname == 'LoveKernelsImag':
+            nlayer = md.materials.numlayers
+            degmax = md.love.sh_nmax
+            nfreq = md.love.nfreq
+    #for numpy 1.8 + only
+    #temp_field = np.full((degmax + 1, nfreq, nlayer + 1, 6), 0.0)
+            temp_field = np.empty((degmax + 1, nfreq, nlayer + 1, 6))
+            temp_field.fill(0.0)
+            for ii in range(degmax + 1):
+                for jj in range(nfreq):
+                    for kk in range(nlayer + 1):
+                        ll = ii * (nlayer + 1) * 6 + (kk * 6 + 1)
+                        for mm in range(6):
+                            temp_field[ii, jj, kk, mm] = field[ll + mm - 1, jj]
+            field = temp_field
+
+        if time != -9999:
+            time = time / yts
+
+        saveres = OrderedDict()
+        saveres['fieldname'] = fieldname
+        saveres['time'] = time
+        saveres['step'] = step
+        saveres['field'] = field
+
+    except struct.error as e:
+        saveres = None
+
+    return saveres
+    # }}}
+
+
+def ReadDataDimensions(fid):  # {{{
+    """
+    READDATADIMENSIONS - read data dimensions, step and time, but not the data itself.
+
+        Usage:
+           field = ReadDataDimensions(fid)
+    """
+
+    #read field
+    try:
+        length = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
+        fieldname = struct.unpack('{}s'.format(length), fid.read(length))[0][:-1]
+        time = struct.unpack('d', fid.read(struct.calcsize('d')))[0]
+        step = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
+        datatype = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
+        M = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
+        N = 1  #default
+        if datatype == 1:
+            fid.seek(M * 8, 1)
+        elif datatype == 2:
+            fid.seek(M, 1)
+        elif datatype == 3:
+            N = struct.unpack('i', fid.read(struct.calcsize('i')))[0]
+            fid.seek(N * M * 8, 1)
+        else:
+            raise TypeError("cannot read data of datatype {}".format(datatype))
+
+        saveres = OrderedDict()
+        saveres['fieldname'] = fieldname
+        saveres['time'] = time
+        saveres['step'] = step
+        saveres['M'] = M
+        saveres['N'] = N
+
+    except struct.error as Err:
+        print(Err)
+        saveres = None
+
+    return saveres
+    # }}}
Index: /issm/trunk/src/m/solve/solve.py
===================================================================
--- /issm/trunk/src/m/solve/solve.py	(revision 24312)
+++ /issm/trunk/src/m/solve/solve.py	(revision 24313)
@@ -10,151 +10,151 @@
 #from MatlabFuncs import *
 
-def solve(md,solutionstring,*args):
-	"""
-	SOLVE - apply solution sequence for this model
- 
-	   Usage:
-	      md=solve(md,solutionstring,varargin)
-	      where varargin is a list of paired arguments of string OR enums
- 
-		solution types available comprise:
-		 - 'Stressbalance'    or 'sb'
-		 - 'Masstransport'    or 'mt'
-		 - 'Thermal'          or 'th'
-		 - 'Steadystate'      or 'ss'
-		 - 'Transient'        or 'tr'
-		 - 'Balancethickness' or 'mc'
-		 - 'Balancevelocity'  or 'bv'
-		 - 'BedSlope'         or 'bsl'
-		 - 'SurfaceSlope'     or 'ssl'
-		 - 'Hydrology'        or 'hy'
-		 - 'DamageEvolution'  or 'da'
-		 - 'Gia'              or 'gia'
-		 - 'Esa'	      or 'esa'
-		 - 'Sealevelrise'     or 'slr'
-		 - 'Love'             or 'lv'
 
-	   extra options:
-        - loadonly : does not solve. only load results
-		  - checkconsistency : 'yes' or 'no' (default is 'yes'), ensures checks on consistency of model
-		  - restart: 'directory name (relative to the execution directory) where the restart file is located.
- 
-	   Examples:
-	      md=solve(md,'Stressbalance');
-         md=solve(md,'sb');
-	"""
+def solve(md, solutionstring, *args):
+    """
+    SOLVE - apply solution sequence for this model
 
-	#recover and process solve options
-	if solutionstring.lower() == 'sb' or solutionstring.lower() == 'stressbalance':
-		solutionstring = 'StressbalanceSolution';
-	elif solutionstring.lower() == 'mt' or solutionstring.lower() == 'masstransport':
-		solutionstring = 'MasstransportSolution';	
-	elif solutionstring.lower() == 'th' or solutionstring.lower() == 'thermal':
-		solutionstring = 'ThermalSolution';
-	elif solutionstring.lower() == 'st' or solutionstring.lower() == 'steadystate':
-		solutionstring = 'SteadystateSolution';
-	elif solutionstring.lower() == 'tr' or solutionstring.lower() == 'transient':
-		solutionstring = 'TransientSolution';
-	elif solutionstring.lower() == 'mc' or solutionstring.lower() == 'balancethickness':
-		solutionstring = 'BalancethicknessSolution';
-	elif solutionstring.lower() == 'bv' or solutionstring.lower() == 'balancevelocity':
-		solutionstring = 'BalancevelocitySolution';
-	elif solutionstring.lower() == 'bsl' or solutionstring.lower() == 'bedslope':
-		solutionstring = 'BedSlopeSolution';
-	elif solutionstring.lower() == 'ssl' or solutionstring.lower() == 'surfaceslope':
-		solutionstring = 'SurfaceSlopeSolution';
-	elif solutionstring.lower() == 'hy' or solutionstring.lower() == 'hydrology':
-		solutionstring = 'HydrologySolution';
-	elif solutionstring.lower() == 'da' or solutionstring.lower() == 'damageevolution':
-		solutionstring = 'DamageEvolutionSolution';
-	elif solutionstring.lower() == 'gia' or solutionstring.lower() == 'gia':
-		solutionstring = 'GiaSolution';
-        elif solutionstring.lower() == 'lv' or solutionstring.lower() == 'love':
-                solutionstring = 'LoveSolution';
-	elif solutionstring.lower() == 'esa':
-		solutionstring = 'EsaSolution';
-	elif solutionstring.lower() == 'slr' or solutionstring.lower() == 'sealevelrise':
-		solutionstring = 'SealevelriseSolution';
-	else: 	
-		raise ValueError("solutionstring '%s' not supported!" % solutionstring)
-	options=pairoptions('solutionstring',solutionstring,*args)
+       Usage:
+          md = solve(md, solutionstring, varargin)
+          where varargin is a list of paired arguments of string OR enums
 
-	#recover some fields
-	md.private.solution=solutionstring
-	cluster=md.cluster 
-	if options.getfieldvalue('batch','no')=='yes':
-		batch=1
-	else:
-		batch=0;
+        solution types available comprise:
+         - 'Stressbalance'    or 'sb'
+         - 'Masstransport'    or 'mt'
+         - 'Thermal'          or 'th'
+         - 'Steadystate'      or 'ss'
+         - 'Transient'        or 'tr'
+         - 'Balancethickness' or 'mc'
+         - 'Balancevelocity'  or 'bv'
+         - 'BedSlope'         or 'bsl'
+         - 'SurfaceSlope'     or 'ssl'
+         - 'Hydrology'        or 'hy'
+         - 'DamageEvolution'  or 'da'
+         - 'Gia'              or 'gia'
+         - 'Esa'          or 'esa'
+         - 'Sealevelrise'     or 'slr'
+         - 'Love'             or 'lv'
 
-	#check model consistency
-	if options.getfieldvalue('checkconsistency','yes')=='yes':
-		if md.verbose.solution:
-			print "checking model consistency"
-		ismodelselfconsistent(md)
+       extra options:
+ - loadonly : does not solve. only load results
+         - checkconsistency : 'yes' or 'no' (default is 'yes'), ensures checks on consistency of model
+         - restart: 'directory name (relative to the execution directory) where the restart file is located.
 
-	#First, build a runtime name that is unique
-	restart=options.getfieldvalue('restart','')
-	if restart == 1:
-		pass #do nothing
-	else:
-		if restart:
-			md.private.runtimename=restart
-		else:
-			if options.getfieldvalue('runtimename',True):
-				c=datetime.datetime.now()
-				md.private.runtimename="%s-%02i-%02i-%04i-%02i-%02i-%02i-%i" % (md.miscellaneous.name,c.month,c.day,c.year,c.hour,c.minute,c.second,os.getpid())
-			else:
-				md.private.runtimename=md.miscellaneous.name 
+       Examples:
+          md = solve(md, 'Stressbalance')
+         md = solve(md, 'sb')
+    """
 
-	#if running qmu analysis, some preprocessing of dakota files using models
-	#fields needs to be carried out. 
-	if md.qmu.isdakota:
-		md=preqmu(md,options)
+    #recover and process solve options
+    if solutionstring.lower() == 'sb' or solutionstring.lower() == 'stressbalance':
+        solutionstring = 'StressbalanceSolution'
+    elif solutionstring.lower() == 'mt' or solutionstring.lower() == 'masstransport':
+        solutionstring = 'MasstransportSolution'
+    elif solutionstring.lower() == 'th' or solutionstring.lower() == 'thermal':
+        solutionstring = 'ThermalSolution'
+    elif solutionstring.lower() == 'st' or solutionstring.lower() == 'steadystate':
+        solutionstring = 'SteadystateSolution'
+    elif solutionstring.lower() == 'tr' or solutionstring.lower() == 'transient':
+        solutionstring = 'TransientSolution'
+    elif solutionstring.lower() == 'mc' or solutionstring.lower() == 'balancethickness':
+        solutionstring = 'BalancethicknessSolution'
+    elif solutionstring.lower() == 'bv' or solutionstring.lower() == 'balancevelocity':
+        solutionstring = 'BalancevelocitySolution'
+    elif solutionstring.lower() == 'bsl' or solutionstring.lower() == 'bedslope':
+        solutionstring = 'BedSlopeSolution'
+    elif solutionstring.lower() == 'ssl' or solutionstring.lower() == 'surfaceslope':
+        solutionstring = 'SurfaceSlopeSolution'
+    elif solutionstring.lower() == 'hy' or solutionstring.lower() == 'hydrology':
+        solutionstring = 'HydrologySolution'
+    elif solutionstring.lower() == 'da' or solutionstring.lower() == 'damageevolution':
+        solutionstring = 'DamageEvolutionSolution'
+    elif solutionstring.lower() == 'gia' or solutionstring.lower() == 'gia':
+        solutionstring = 'GiaSolution'
+    elif solutionstring.lower() == 'lv' or solutionstring.lower() == 'love':
+        solutionstring = 'LoveSolution'
+    elif solutionstring.lower() == 'esa':
+        solutionstring = 'EsaSolution'
+    elif solutionstring.lower() == 'slr' or solutionstring.lower() == 'sealevelrise':
+        solutionstring = 'SealevelriseSolution'
+    else:
+        raise ValueError("solutionstring '%s' not supported!" % solutionstring)
+    options = pairoptions('solutionstring', solutionstring, *args)
 
-	#Do we load results only?
-	if options.getfieldvalue('loadonly',False):
-		md=loadresultsfromcluster(md)
-		return md
+    #recover some fields
+    md.private.solution = solutionstring
+    cluster = md.cluster
+    if options.getfieldvalue('batch', 'no') == 'yes':
+        batch = 1
+    else:
+        batch = 0
 
+    #check model consistency
+    if options.getfieldvalue('checkconsistency', 'yes') == 'yes':
+        if md.verbose.solution:
+            print("checking model consistency")
+        ismodelselfconsistent(md)
 
-	#Write all input files
-	marshall(md)                                           # bin file
-	md.toolkits.ToolkitsFile(md.miscellaneous.name+'.toolkits')    # toolkits file
-	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
+    #First, build a runtime name that is unique
+    restart = options.getfieldvalue('restart', '')
+    if restart == 1:
+        pass  #do nothing
+    else:
+        if restart:
+            md.private.runtimename = restart
+        else:
+            if options.getfieldvalue('runtimename', True):
+                c = datetime.datetime.now()
+                md.private.runtimename = "%s-%02i-%02i-%04i-%02i-%02i-%02i-%i" % (md.miscellaneous.name, c.month, c.day, c.year, c.hour, c.minute, c.second, os.getpid())
+            else:
+                md.private.runtimename = md.miscellaneous.name
 
-	#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
+    #if running qmu analysis, some preprocessing of dakota files using models
+    #fields needs to be carried out.
+    if md.qmu.isdakota:
+        md = preqmu(md, options)
 
-	#Upload all required files: 
-	modelname = md.miscellaneous.name
-	filelist  = [modelname+'.bin ',modelname+'.toolkits ',modelname+'.queue ']
-	if md.qmu.isdakota:
-		filelist.append(modelname+'.qmu.in')
+    #Do we load results only?
+    if options.getfieldvalue('loadonly', False):
+        md = loadresultsfromcluster(md)
+        return md
 
-	if not restart:
-		cluster.UploadQueueJob(md.miscellaneous.name,md.private.runtimename,filelist)
-	
-	#Launch job
-	cluster.LaunchQueueJob(md.miscellaneous.name,md.private.runtimename,filelist,restart,batch)
+    #Write all input files
+    marshall(md)  # bin file
+    md.toolkits.ToolkitsFile(md.miscellaneous.name + '.toolkits')  # toolkits file
+    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
 
-	#wait on lock
-	if md.settings.waitonlock>0:
-		#we wait for the done file
-		islock=waitonlock(md)
-		if islock==0:    #no results to be loaded
-			print 'The results must be loaded manually with md=loadresultsfromcluster(md).'
-		else:            #load results
-			if md.verbose.solution:
-				print 'loading results from cluster'
-			md=loadresultsfromcluster(md)
+    #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
 
-	#post processes qmu results if necessary
-	if md.qmu.isdakota:
-		if not strncmpi(options.getfieldvalue('keep','y'),'y',1):
-			shutil.rmtree('qmu'+str(os.getpid()))
+    #Upload all required files:
+    modelname = md.miscellaneous.name
+    filelist = [modelname + '.bin ', modelname + '.toolkits ', modelname + '.queue ']
+    if md.qmu.isdakota:
+        filelist.append(modelname + '.qmu.in')
 
-	return md
+    if not restart:
+        cluster.UploadQueueJob(md.miscellaneous.name, md.private.runtimename, filelist)
+
+    #Launch job
+    cluster.LaunchQueueJob(md.miscellaneous.name, md.private.runtimename, filelist, restart, batch)
+
+    #wait on lock
+    if md.settings.waitonlock > 0:
+        #we wait for the done file
+        islock = waitonlock(md)
+        if islock == 0:  #no results to be loaded
+            print('The results must be loaded manually with md = loadresultsfromcluster(md).')
+        else:  #load results
+            if md.verbose.solution:
+                print('loading results from cluster')
+            md = loadresultsfromcluster(md)
+
+    #post processes qmu results if necessary
+    if md.qmu.isdakota:
+        if not strncmpi(options.getfieldvalue('keep', 'y'), 'y', 1):
+            shutil.rmtree('qmu' + str(os.getpid()))
+
+    return md
Index: /issm/trunk/src/m/solve/waitonlock.py
===================================================================
--- /issm/trunk/src/m/solve/waitonlock.py	(revision 24312)
+++ /issm/trunk/src/m/solve/waitonlock.py	(revision 24313)
@@ -4,61 +4,59 @@
 import MatlabFuncs as m
 
+
 def waitonlock(md):
-	"""
-	WAITONLOCK - wait for a file
- 
-	   This routine will return when a file named 'filename' is written to disk.
-	   If the time limit given in input is exceeded, return 0
- 
-	   Usage:
-	      flag=waitonlock(md)
-	"""
+    """
+    WAITONLOCK - wait for a file
 
-	#Get filename (lock file) and options
-	executionpath=md.cluster.executionpath
-	cluster=md.cluster.name
-	login=md.cluster.login
-	port=md.cluster.port
-	timelimit=md.settings.waitonlock
-	filename=os.path.join(executionpath,md.private.runtimename,md.miscellaneous.name+'.lock')
+       This routine will return when a file named 'filename' is written to disk.
+       If the time limit given in input is exceeded, return 0
 
-	#waitonlock will work if the lock is on the same machine only: 
-	if not m.strcmpi(gethostname(),cluster):
+       Usage:
+          flag = waitonlock(md)
+    """
 
-		print 'solution launched on remote cluster. log in to detect job completion.'
-		choice=raw_input('Is the job successfully completed? (y/n) ')
-		if not m.strcmp(choice,'y'): 
-			print 'Results not loaded... exiting' 
-			flag=0
-		else:
-			flag=1
+    #Get filename (lock file) and options
+    executionpath = md.cluster.executionpath
+    cluster = md.cluster.name
+    timelimit = md.settings.waitonlock
+    filename = os.path.join(executionpath, md.private.runtimename, md.miscellaneous.name + '.lock')
 
-	#job is running on the same machine
-	else:
+    #waitonlock will work if the lock is on the same machine only:
+    if not m.strcmpi(gethostname(), cluster):
 
-		if 'interactive' in vars(md.cluster) and md.cluster.interactive:
-			#We are in interactive mode, no need to check for job completion
-			flag=1
-			return flag
-		#initialize time and file presence test flag
-		etime=0
-		ispresent=0
-		print "waiting for '%s' hold on... (Ctrl+C to exit)" % filename
+        print('solution launched on remote cluster. log in to detect job completion.')
+        choice = eval(input('Is the job successfully completed? (y / n) '))
+        if not m.strcmp(choice, 'y'):
+            print('Results not loaded... exiting')
+            flag = 0
+        else:
+            flag = 1
 
-		#loop till file .lock exist or time is up
-		while ispresent==0 and etime<timelimit:
-			ispresent=os.path.exists(filename)
-			time.sleep(1)
-			etime+=1/60
+    #job is running on the same machine
+    else:
 
-		#build output
-		if etime>timelimit:
-			print 'Time limit exceeded. Increase md.settings.waitonlock'
-			print 'The results must be loaded manually with md=loadresultsfromcluster(md).'
-			raise RuntimeError('waitonlock error message: time limit exceeded.')
-			flag=0
-		else:
-			flag=1
+        if 'interactive' in vars(md.cluster) and md.cluster.interactive:
+            #We are in interactive mode, no need to check for job completion
+            flag = 1
+            return flag
+        #initialize time and file presence test flag
+        etime = 0
+        ispresent = 0
+        print(("waiting for '%s' hold on... (Ctrl + C to exit)" % filename))
 
-	return flag
+        #loop till file .lock exist or time is up
+        while ispresent == 0 and etime < timelimit:
+            ispresent = os.path.exists(filename)
+            time.sleep(1)
+            etime += 1 / 60
 
+        #build output
+        if etime > timelimit:
+            print('Time limit exceeded. Increase md.settings.waitonlock')
+            print('The results must be loaded manually with md = loadresultsfromcluster(md).')
+            raise RuntimeError('waitonlock error message: time limit exceeded.')
+            flag = 0
+        else:
+            flag = 1
+
+    return flag
Index: /issm/trunk/src/m/solvers/asmoptions.py
===================================================================
--- /issm/trunk/src/m/solvers/asmoptions.py	(revision 24312)
+++ /issm/trunk/src/m/solvers/asmoptions.py	(revision 24313)
@@ -1,29 +1,37 @@
 import pairoptions
 
+
 def asmoptions(*args):
-	#ASMOPTIONS - return ASM petsc options
-	#
-	#   Usage:
-	#      options=asmoptions;
-	
-	#retrieve options provided in varargin
-	arguments=pairoptions.pairoptions(*args) 
-	
-	options=[['toolkit','petsc'],['mat_type','mpiaij'],['ksp_type','gmres'],['pc_type','asm'],['sub_pc_type','lu'],['pc_asm_overlap',3],['ksp_max_it',100],['ksp_rtol',1e-30]];
+    #ASMOPTIONS - return ASM petsc options
+    #
+    #   Usage:
+    #      options = asmoptions
 
-	#now, go through our arguments, and write over default options.
-	for i in range(len(arguments.list)):
-		arg1=arguments.list[i][0]
-		arg2=arguments.list[i][1]
-		found=0;
-		for j in range(len(options)):
-			joption=options[j][0]
-			if joption==arg1:
-				joption[1]=arg2;
-				options[j]=joption;
-				found=1;
-				break
-		if not found:
-			#this option did not exist, add it: 
-			options.append([arg1,arg2])
-	return options
+    #retrieve options provided in varargin
+    arguments = pairoptions.pairoptions(*args)
+
+    options = [['toolkit', 'petsc'],
+               ['mat_type', 'mpiaij'],
+               ['ksp_type', 'gmres'],
+               ['pc_type', 'asm'],
+               ['sub_pc_type', 'lu'],
+               ['pc_asm_overlap', 3],
+               ['ksp_max_it', 100],
+               ['ksp_rtol', 1e-30]]
+
+    #now, go through our arguments, and write over default options.
+    for i in range(len(arguments.list)):
+        arg1 = arguments.list[i][0]
+        arg2 = arguments.list[i][1]
+        found = 0
+        for j in range(len(options)):
+            joption = options[j][0]
+            if joption == arg1:
+                joption[1] = arg2
+                options[j] = joption
+                found = 1
+                break
+        if not found:
+            #this option did not exist, add it:
+            options.append([arg1, arg2])
+    return options
Index: /issm/trunk/src/m/solvers/iluasmoptions.py
===================================================================
--- /issm/trunk/src/m/solvers/iluasmoptions.py	(revision 24312)
+++ /issm/trunk/src/m/solvers/iluasmoptions.py	(revision 24313)
@@ -2,26 +2,26 @@
 import pairoptions
 
+
 def iluasmoptions(*args):
-	"""
-	ILUASMOPTIONS - 
+    """
+    ILUASMOPTIONS -
 
-	   Usage:
-	      options=iluasmoptions;
-	"""
-			 
-	#retrieve options provided in varargin
-	options=pairoptions.pairoptions(*args)
-	iluasm=OrderedDict()
+       Usage:
+          options = iluasmoptions
+    """
 
-	#default iluasm options
-	iluasm['toolkit']='petsc'
-	iluasm['mat_type']=options.getfieldvalue('mat_type','aij')
-	iluasm['ksp_type']=options.getfieldvalue('ksp_type','gmres')
-	iluasm['pc_type']=options.getfieldvalue('pc_type','asm')
-	iluasm['sub_pc_type']=options.getfieldvalue('sub_pc_type','ilu')
-	iluasm['pc_asm_overlap']=options.getfieldvalue('pc_asm_overlap',5)
-	iluasm['ksp_max_it']=options.getfieldvalue('ksp_max_it',100)
-	iluasm['ksp_rtol']=options.getfieldvalue('ksp_rtol',1e-15)
+    #retrieve options provided in varargin
+    options = pairoptions.pairoptions(*args)
+    iluasm = OrderedDict()
 
-	return iluasm
+    #default iluasm options
+    iluasm['toolkit'] = 'petsc'
+    iluasm['mat_type'] = options.getfieldvalue('mat_type', 'aij')
+    iluasm['ksp_type'] = options.getfieldvalue('ksp_type', 'gmres')
+    iluasm['pc_type'] = options.getfieldvalue('pc_type', 'asm')
+    iluasm['sub_pc_type'] = options.getfieldvalue('sub_pc_type', 'ilu')
+    iluasm['pc_asm_overlap'] = options.getfieldvalue('pc_asm_overlap', 5)
+    iluasm['ksp_max_it'] = options.getfieldvalue('ksp_max_it', 100)
+    iluasm['ksp_rtol'] = options.getfieldvalue('ksp_rtol', 1e-15)
 
+    return iluasm
Index: /issm/trunk/src/m/solvers/issmgslsolver.py
===================================================================
--- /issm/trunk/src/m/solvers/issmgslsolver.py	(revision 24312)
+++ /issm/trunk/src/m/solvers/issmgslsolver.py	(revision 24313)
@@ -2,33 +2,34 @@
 import pairoptions
 
+
 def issmgslsolver(*args):
-	#ISSMSOLVE - return issm solver options
-	#
-	#   Usage:
-	#      options=issmsolver;
-	
-	#retrieve options provided in varargin
-	arguments=pairoptions.pairoptions(*args) 
-	
-	options=OrderedDict()
-	options['toolkit'] = 'issm'
-	options['mat_type'] = 'dense'
-	options['vec_type'] = 'seq'
-	options['solver_type'] = 'gsl'
+    #ISSMSOLVE - return issm solver options
+    #
+    #   Usage:
+    #      options = issmsolver
 
-	#now, go through our arguments, and write over default options.
-	for i in range(len(arguments.list)):
-		arg1=arguments.list[i][0]
-		arg2=arguments.list[i][1]
-		found=0;
-		for j in range(len(options)):
-			joption=options[j][0]
-			if joption==arg1:
-				joption[1]=arg2;
-				options[j]=joption;
-				found=1;
-				break
-		if not found:
-			#this option did not exist, add it: 
-			options.append([arg1,arg2])
-	return options
+    #retrieve options provided in varargin
+    arguments = pairoptions.pairoptions(*args)
+
+    options = OrderedDict()
+    options['toolkit'] = 'issm'
+    options['mat_type'] = 'dense'
+    options['vec_type'] = 'seq'
+    options['solver_type'] = 'gsl'
+
+    #now, go through our arguments, and write over default options.
+    for i in range(len(arguments.list)):
+        arg1 = arguments.list[i][0]
+        arg2 = arguments.list[i][1]
+        found = 0
+        for j in range(len(options)):
+            joption = options[j][0]
+            if joption == arg1:
+                joption[1] = arg2
+                options[j] = joption
+                found = 1
+                break
+        if not found:
+            #this option did not exist, add it:
+            options.append([arg1, arg2])
+    return options
Index: /issm/trunk/src/m/solvers/issmmumpssolver.py
===================================================================
--- /issm/trunk/src/m/solvers/issmmumpssolver.py	(revision 24312)
+++ /issm/trunk/src/m/solvers/issmmumpssolver.py	(revision 24313)
@@ -2,33 +2,34 @@
 import pairoptions
 
+
 def issmmumpssolver(*args):
-	#ISSMSOLVE - return issm solver options
-	#
-	#   Usage:
-	#      options=issmsolver;
-	
-	#retrieve options provided in varargin
-	arguments=pairoptions.pairoptions(*args) 
-	
-	options=OrderedDict()
-	options['toolkit'] = 'issm'
-	options['mat_type'] = 'mpidense'
-	options['vec_type'] = 'mpi'
-	options['solver_type'] = 'mumps'
+    #ISSMSOLVE - return issm solver options
+    #
+    #   Usage:
+    #      options = issmsolver
 
-	#now, go through our arguments, and write over default options.
-	for i in range(len(arguments.list)):
-		arg1=arguments.list[i][0]
-		arg2=arguments.list[i][1]
-		found=0;
-		for j in range(len(options)):
-			joption=options[j][0]
-			if joption==arg1:
-				joption[1]=arg2;
-				options[j]=joption;
-				found=1;
-				break
-		if not found:
-			#this option did not exist, add it: 
-			options.append([arg1,arg2])
-	return options
+    #retrieve options provided in varargin
+    arguments = pairoptions.pairoptions(*args)
+
+    options = OrderedDict()
+    options['toolkit'] = 'issm'
+    options['mat_type'] = 'mpisparse'
+    options['vec_type'] = 'mpi'
+    options['solver_type'] = 'mumps'
+
+    #now, go through our arguments, and write over default options.
+    for i in range(len(arguments.list)):
+        arg1 = arguments.list[i][0]
+        arg2 = arguments.list[i][1]
+        found = 0
+        for j in range(len(options)):
+            joption = options[j][0]
+            if joption == arg1:
+                joption[1] = arg2
+                options[j] = joption
+                found = 1
+                break
+        if not found:
+            #this option did not exist, add it:
+            options.append([arg1, arg2])
+    return options
Index: /issm/trunk/src/m/solvers/jacobiasmoptions.py
===================================================================
--- /issm/trunk/src/m/solvers/jacobiasmoptions.py	(revision 24312)
+++ /issm/trunk/src/m/solvers/jacobiasmoptions.py	(revision 24313)
@@ -1,29 +1,37 @@
 import pairoptions
 
+
 def jacobiasmoptions(*args):
-	#ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
-	#
-	#   Usage:
-	#      options=jacobiasmoptions;
-	
-	#retrieve options provided in varargin
-	arguments=pairoptions.pairoptions(*args) 
-	
-	options=[['toolkit','petsc'],['mat_type','mpiaij'],['ksp_type','gmres'],['pc_type','asm'],['sub_pc_type','jacobi'],['pc_asm_overlap',3],['ksp_max_it',100],['ksp_rtol',1e-15]];
+    #ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
+    #
+    #   Usage:
+    #      options = jacobiasmoptions
 
-	#now, go through our arguments, and write over default options.
-	for i in range(len(arguments.list)):
-		arg1=arguments.list[i][0]
-		arg2=arguments.list[i][1]
-		found=0;
-		for j in range(len(options)):
-			joption=options[j][0]
-			if joption==arg1:
-				joption[1]=arg2;
-				options[j]=joption;
-				found=1;
-				break
-		if not found:
-			#this option did not exist, add it: 
-			options.append([arg1,arg2])
-	return options
+    #retrieve options provided in varargin
+    arguments = pairoptions.pairoptions(*args)
+
+    options = [['toolkit', 'petsc'],
+               ['mat_type', 'mpiaij'],
+               ['ksp_type', 'gmres'],
+               ['pc_type', 'asm'],
+               ['sub_pc_type', 'jacobi'],
+               ['pc_asm_overlap', 3],
+               ['ksp_max_it', 100],
+               ['ksp_rtol', 1e-15]]
+
+    #now, go through our arguments, and write over default options.
+    for i in range(len(arguments.list)):
+        arg1 = arguments.list[i][0]
+        arg2 = arguments.list[i][1]
+        found = 0
+        for j in range(len(options)):
+            joption = options[j][0]
+            if joption == arg1:
+                joption[1] = arg2
+                options[j] = joption
+                found = 1
+                break
+        if not found:
+            #this option did not exist, add it:
+            options.append([arg1, arg2])
+    return options
Index: /issm/trunk/src/m/solvers/jacobicgoptions.py
===================================================================
--- /issm/trunk/src/m/solvers/jacobicgoptions.py	(revision 24312)
+++ /issm/trunk/src/m/solvers/jacobicgoptions.py	(revision 24313)
@@ -1,29 +1,34 @@
-import pairoptions 
+import pairoptions
+
 
 def jacobicgoptions(*args):
-	#ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
-	#
-	#   Usage:
-	#      options=jacobicgoptions;
-	
-	#retrieve options provided in varargin
-	arguments=pairoptions.pairoptions(*args) 
-	
-	options=[['toolkit','petsc'],['mat_type','mpiaij'],['ksp_type','cg'],['ksp_max_it',100],['ksp_rtol',1e-15]];
+    #ASMOPTIONS - return Additive Shwartz Method with Jacobi preconditioner petsc options
+    #
+    #   Usage:
+    #      options = jacobicgoptions
 
-	#now, go through our arguments, and write over default options.
-	for i in range(len(arguments.list)):
-		arg1=arguments.list[i][0]
-		arg2=arguments.list[i][1]
-		found=0;
-		for j in range(len(options)):
-			joption=options[j][0]
-			if joption==arg1:
-				joption[1]=arg2;
-				options[j]=joption;
-				found=1;
-				break
-		if not found:
-			#this option did not exist, add it: 
-			options.append([arg1,arg2])
-	return options
+    #retrieve options provided in varargin
+    arguments = pairoptions.pairoptions(*args)
+
+    options = [['toolkit', 'petsc'],
+               ['mat_type', 'mpiaij'],
+               ['ksp_type', 'cg'],
+               ['ksp_max_it', 100],
+               ['ksp_rtol', 1e-15]]
+
+    #now, go through our arguments, and write over default options.
+    for i in range(len(arguments.list)):
+        arg1 = arguments.list[i][0]
+        arg2 = arguments.list[i][1]
+        found = 0
+        for j in range(len(options)):
+            joption = options[j][0]
+            if joption == arg1:
+                joption[1] = arg2
+                options[j] = joption
+                found = 1
+                break
+        if not found:
+            #this option did not exist, add it:
+            options.append([arg1, arg2])
+    return options
Index: /issm/trunk/src/m/solvers/matlaboptions.py
===================================================================
--- /issm/trunk/src/m/solvers/matlaboptions.py	(revision 24312)
+++ /issm/trunk/src/m/solvers/matlaboptions.py	(revision 24313)
@@ -1,29 +1,31 @@
 import pairoptions
 
+
 def matlaboptions(*args):
-	#MATLABOPTIONS - return Matlab petsc options
-	#
-	#   Usage:
-	#      options=matlaboptions;
-	
-	#retrieve options provided in varargin
-	arguments=pairoptions.pairoptions(*args) 
-	
-	options=[['toolkit','petsc'],['ksp_type','matlab']];
+    #MATLABOPTIONS - return Matlab petsc options
+    #
+    #   Usage:
+    #      options = matlaboptions
 
-	#now, go through our arguments, and write over default options.
-	for i in range(len(arguments.list)):
-		arg1=arguments.list[i][0]
-		arg2=arguments.list[i][1]
-		found=0;
-		for j in range(len(options)):
-			joption=options[j][0]
-			if joption==arg1:
-				joption[1]=arg2;
-				options[j]=joption;
-				found=1;
-				break
-		if not found:
-			#this option did not exist, add it: 
-			options.append([arg1,arg2])
-	return options
+    #retrieve options provided in varargin
+    arguments = pairoptions.pairoptions(*args)
+
+    options = [['toolkit', 'petsc'],
+               ['ksp_type', 'matlab']]
+
+    #now, go through our arguments, and write over default options.
+    for i in range(len(arguments.list)):
+        arg1 = arguments.list[i][0]
+        arg2 = arguments.list[i][1]
+        found = 0
+        for j in range(len(options)):
+            joption = options[j][0]
+            if joption == arg1:
+                joption[1] = arg2
+                options[j] = joption
+                found = 1
+                break
+        if not found:
+            #this option did not exist, add it:
+            options.append([arg1, arg2])
+    return options
Index: /issm/trunk/src/m/solvers/mumpsnoneoptions.m
===================================================================
--- /issm/trunk/src/m/solvers/mumpsnoneoptions.m	(revision 24312)
+++ /issm/trunk/src/m/solvers/mumpsnoneoptions.m	(revision 24313)
@@ -10,6 +10,7 @@
 
 %default mumps options
-PETSC_VERSION=IssmConfig('_PETSC_MAJOR_');
-if PETSC_VERSION==2.,
+PETSC_MAJOR=IssmConfig('_PETSC_MAJOR_');
+PETSC_MINOR=IssmConfig('_PETSC_MINOR_');
+if PETSC_MAJOR==2.,
 	mumps.toolkit='petsc';
 	mumps.mat_type=getfieldvalue(options,'mat_type','aijmumps');
@@ -17,15 +18,17 @@
 	mumps.pc_type=getfieldvalue(options,'pc_type','lu');
 	mumps.mat_mumps_icntl_14=getfieldvalue(options,'mat_mumps_icntl_14',120);
-	mumps.pc_factor_shift_positive_definite=getfieldvalue(options,'pc_factor_shift_positive_definite','true');
 end
 
-if PETSC_VERSION==3.,
+if PETSC_MAJOR==3.,
 	mumps.toolkit='petsc';
 	mumps.mat_type=getfieldvalue(options,'mat_type','mpiaij');
 	mumps.ksp_type=getfieldvalue(options,'ksp_type','preonly');
 	mumps.pc_type=getfieldvalue(options,'pc_type','lu');
-	mumps.pc_factor_mat_solver_package=getfieldvalue(options,'pc_factor_mat_solver_package','mumps');
+	if PETSC_MINOR>8
+		mumps.pc_factor_mat_solver_type=getfieldvalue(options,'pc_factor_mat_solver_type','mumps');
+	else
+		mumps.pc_factor_mat_solver_package=getfieldvalue(options,'pc_factor_mat_solver_package','mumps');
+	end
 	mumps.mat_mumps_icntl_14=getfieldvalue(options,'mat_mumps_icntl_14',120);
-	mumps.pc_factor_shift_positive_definite=getfieldvalue(options,'pc_factor_shift_positive_definite','true');
 	mumps.mat_mumps_icntl_28=2; %1=serial, 2=parallel
 	mumps.mat_mumps_icntl_29=2; %parallel ordering 1 = ptscotch, 2 = parmetis
Index: /issm/trunk/src/m/solvers/mumpsoptions.m
===================================================================
--- /issm/trunk/src/m/solvers/mumpsoptions.m	(revision 24312)
+++ /issm/trunk/src/m/solvers/mumpsoptions.m	(revision 24313)
@@ -10,6 +10,7 @@
 
 %default mumps options
-PETSC_VERSION=IssmConfig('_PETSC_MAJOR_');
-if PETSC_VERSION==2.,
+PETSC_MAJOR=IssmConfig('_PETSC_MAJOR_');
+PETSC_MINOR=IssmConfig('_PETSC_MINOR_');
+if PETSC_MAJOR==2.,
 	mumps.toolkit='petsc';
 	mumps.mat_type=getfieldvalue(options,'mat_type','aijmumps');
@@ -17,17 +18,17 @@
 	mumps.pc_type=getfieldvalue(options,'pc_type','lu');
 	mumps.mat_mumps_icntl_14=getfieldvalue(options,'mat_mumps_icntl_14',120);
-	mumps.pc_factor_shift_positive_definite=getfieldvalue(options,'pc_factor_shift_positive_definite','true');
 end
 
-if PETSC_VERSION==3.,
+if PETSC_MAJOR==3.,
 	mumps.toolkit='petsc';
 	mumps.mat_type=getfieldvalue(options,'mat_type','mpiaij');
 	mumps.ksp_type=getfieldvalue(options,'ksp_type','preonly');
 	mumps.pc_type=getfieldvalue(options,'pc_type','lu');
-	mumps.pc_factor_mat_solver_package=getfieldvalue(options,'pc_factor_mat_solver_package','mumps');
+	if PETSC_MINOR>8
+		mumps.pc_factor_mat_solver_type=getfieldvalue(options,'pc_factor_mat_solver_type','mumps');
+	else
+		mumps.pc_factor_mat_solver_package=getfieldvalue(options,'pc_factor_mat_solver_package','mumps');
+	end
 	mumps.mat_mumps_icntl_14=getfieldvalue(options,'mat_mumps_icntl_14',120);
-
-	%Seems like this one is not needed anymore
-	mumps.pc_factor_shift_positive_definite=getfieldvalue(options,'pc_factor_shift_positive_definite','true');
 
 	%These 2 lines make raijin break (ptwgts error during solver with PETSc 3.3)
Index: /issm/trunk/src/m/solvers/mumpsoptions.py
===================================================================
--- /issm/trunk/src/m/solvers/mumpsoptions.py	(revision 24312)
+++ /issm/trunk/src/m/solvers/mumpsoptions.py	(revision 24313)
@@ -3,34 +3,36 @@
 from IssmConfig import IssmConfig
 
+
 def mumpsoptions(*args):
-	"""
-	MUMPSOPTIONS - return MUMPS direct solver  petsc options
+    """
+    MUMPSOPTIONS - return MUMPS direct solver  petsc options
 
-	   Usage:
-	      options=mumpsoptions;
-	"""
+       Usage:
+          options = mumpsoptions
+    """
 
-	#retrieve options provided in varargin
-	options=pairoptions.pairoptions(*args)
-	mumps=OrderedDict()
+    #retrieve options provided in varargin
+    options = pairoptions.pairoptions(*args)
+    mumps = OrderedDict()
 
-	#default mumps options
-	PETSC_VERSION=IssmConfig('_PETSC_MAJOR_')[0]
-	if PETSC_VERSION==2.:
-		mumps['toolkit']='petsc'
-		mumps['mat_type']=options.getfieldvalue('mat_type','aijmumps')
-		mumps['ksp_type']=options.getfieldvalue('ksp_type','preonly')
-		mumps['pc_type']=options.getfieldvalue('pc_type','lu')
-		mumps['mat_mumps_icntl_14']=options.getfieldvalue('mat_mumps_icntl_14',120)
-		mumps['pc_factor_shift_positive_definite']=options.getfieldvalue('pc_factor_shift_positive_definite','true')
-	if PETSC_VERSION==3.:
-		mumps['toolkit']='petsc'
-		mumps['mat_type']=options.getfieldvalue('mat_type','mpiaij')
-		mumps['ksp_type']=options.getfieldvalue('ksp_type','preonly')
-		mumps['pc_type']=options.getfieldvalue('pc_type','lu')
-		mumps['pc_factor_mat_solver_package']=options.getfieldvalue('pc_factor_mat_solver_package','mumps')
-		mumps['mat_mumps_icntl_14']=options.getfieldvalue('mat_mumps_icntl_14',120)
-		mumps['pc_factor_shift_positive_definite']=options.getfieldvalue('pc_factor_shift_positive_definite','true')
+    #default mumps options
+    PETSC_MAJOR = IssmConfig('_PETSC_MAJOR_')[0]
+    PETSC_MINOR = IssmConfig('_PETSC_MINOR_')[0]
+    if PETSC_MAJOR == 2.:
+        mumps['toolkit'] = 'petsc'
+        mumps['mat_type'] = options.getfieldvalue('mat_type', 'aijmumps')
+        mumps['ksp_type'] = options.getfieldvalue('ksp_type', 'preonly')
+        mumps['pc_type'] = options.getfieldvalue('pc_type', 'lu')
+        mumps['mat_mumps_icntl_14'] = options.getfieldvalue('mat_mumps_icntl_14', 120)
+    if PETSC_MAJOR == 3.:
+        mumps['toolkit'] = 'petsc'
+        mumps['mat_type'] = options.getfieldvalue('mat_type', 'mpiaij')
+        mumps['ksp_type'] = options.getfieldvalue('ksp_type', 'preonly')
+        mumps['pc_type'] = options.getfieldvalue('pc_type', 'lu')
+        if PETSC_MINOR > 8.:
+            mumps['pc_factor_mat_solver_type'] = options.getfieldvalue('pc_factor_mat_solver_type', 'mumps')
+        else:
+            mumps['pc_factor_mat_solver_package'] = options.getfieldvalue('pc_factor_mat_solver_package', 'mumps')
+        mumps['mat_mumps_icntl_14'] = options.getfieldvalue('mat_mumps_icntl_14', 120)
 
-	return mumps
-
+    return mumps
Index: /issm/trunk/src/m/solvers/soroptions.py
===================================================================
--- /issm/trunk/src/m/solvers/soroptions.py	(revision 24312)
+++ /issm/trunk/src/m/solvers/soroptions.py	(revision 24313)
@@ -1,29 +1,35 @@
 import pairoptions
 
+
 def soroptions(*args):
-	#SOROPTIONS - return Relaxation Solver petsc options
-	#
-	#   Usage:
-	#      options=soroptions;
-	
-	#retrieve options provided in varargin
-	arguments=pairoptions.pairoptions(*args) 
-	
-	options=[['toolkit','petsc'],['mat_type','mpiaij'],['ksp_type','cg'],['pc_type','sor'],['pc_sor_omega',1.1],['pc_sor_its',2]];
+    #SOROPTIONS - return Relaxation Solver petsc options
+    #
+    #   Usage:
+    #      options = soroptions
 
-	#now, go through our arguments, and write over default options.
-	for i in range(len(arguments.list)):
-		arg1=arguments.list[i][0]
-		arg2=arguments.list[i][1]
-		found=0;
-		for j in range(len(options)):
-			joption=options[j][0]
-			if joption==arg1:
-				joption[1]=arg2;
-				options[j]=joption;
-				found=1;
-				break
-		if not found:
-			#this option did not exist, add it: 
-			options.append([arg1,arg2])
-	return options
+    #retrieve options provided in varargin
+    arguments = pairoptions.pairoptions(*args)
+
+    options = [['toolkit', 'petsc'],
+               ['mat_type', 'mpiaij'],
+               ['ksp_type', 'cg'],
+               ['pc_type', 'sor'],
+               ['pc_sor_omega', 1.1],
+               ['pc_sor_its', 2]]
+
+    #now, go through our arguments, and write over default options.
+    for i in range(len(arguments.list)):
+        arg1 = arguments.list[i][0]
+        arg2 = arguments.list[i][1]
+        found = 0
+        for j in range(len(options)):
+            joption = options[j][0]
+            if joption == arg1:
+                joption[1] = arg2
+                options[j] = joption
+                found = 1
+                break
+        if not found:
+            #this option did not exist, add it:
+            options.append([arg1, arg2])
+    return options
Index: /issm/trunk/src/m/solvers/stokesoptions.m
===================================================================
--- /issm/trunk/src/m/solvers/stokesoptions.m	(revision 24312)
+++ /issm/trunk/src/m/solvers/stokesoptions.m	(revision 24313)
@@ -11,12 +11,9 @@
 stokes.toolkit='petsc';
 stokes.mat_type=getfieldvalue(options,'mat_type','mpiaij');
-stokes.ksp_max_it=getfieldvalue(options,'ksp_max_it',1000);
-stokes.ksp_type=getfieldvalue(options,'ksp_type','gmres');
-stokes.pc_type=getfieldvalue(options,'pc_type','fieldsplit');
-stokes.pc_field_split_type=getfieldvalue(options,'pc_field_split_type','schur');
-stokes.fieldsplit_0_pc_type=getfieldvalue(options,'fieldsplit_0_pc_type','hypre');
-stokes.fieldsplit_0_ksp_type=getfieldvalue(options,'fieldsplit_0_ksp_type','gmres');
-stokes.fieldsplit_0_pc_hypre_type=getfieldvalue(options,'fieldsplit_0_pc_hypre_type','boomerang');
-stokes.fieldsplit_1_pc_type=getfieldvalue(options,'fieldsplit_1_pc_type','jacobi');
-stokes.fieldsplit_1_ksp_type=getfieldvalue(options,'fieldsplit_1_ksp_type','preonly');
 stokes.issm_option_solver=getfieldvalue(options,'issm_option_solver','stokes');
+stokes.ksp_type = 'cr';
+stokes.pc_type = 'bjacobi';
+stokes.tol = 0.6;
+stokes.elltol = 5e-5;
+stokes.schur_pc = 1;
+stokes.max_iter = 10000;
Index: /issm/trunk/src/m/solvers/stokesoptions.py
===================================================================
--- /issm/trunk/src/m/solvers/stokesoptions.py	(revision 24312)
+++ /issm/trunk/src/m/solvers/stokesoptions.py	(revision 24313)
@@ -2,38 +2,44 @@
 from IssmConfig import IssmConfig
 
+
 def stokesoptions(*args):
-	#STOKESOPTIONS - return STOKES multi-physics solver petsc options
-	#
-	#   Usage:
-	#      options=stokesoptions;
-	
-	#retrieve options provided in varargin
-	arguments=pairoptions.pairoptions(*args) 
+    #STOKESOPTIONS - return STOKES multi - physics solver petsc options
+    #
+    #   Usage:
+    #      options = stokesoptions
 
+    #retrieve options provided in varargin
+    arguments = pairoptions.pairoptions(*args)
 
-	#default stokes options
-	PETSC_VERSION=IssmConfig('_PETSC_MAJOR_')[0]
+    #default stokes options
+    PETSC_VERSION = IssmConfig('_PETSC_MAJOR_')[0]
 
-	if PETSC_VERSION==2.:
-		raise RuntimeError('stokesoptions error message: multi-physics options not supported in Petsc 2')
-	if PETSC_VERSION==3.:
-		options=[['toolkit','petsc'],['mat_type','mpiaij'],['ksp_max_it',1000],['ksp_type','gmres'],['pc_type','fieldsplit'],['pc_field_split_type','schur'],\
-	['fieldsplit_0_pc_type','hypre'],['fieldsplit_0_ksp_type','gmres'],['fieldsplit_0_pc_hypre_type','boomerang'],\
-	['fieldsplit_1_pc_type','jacobi'],['fieldsplit_1_ksp_type','preonly'],['issm_option_solver','stokes']]
+    if PETSC_VERSION == 2.:
+        raise RuntimeError('stokesoptions error message: multi-physics options not supported in Petsc 2')
+    if PETSC_VERSION == 3.:
+        options = [['toolkit', 'petsc'],
+                   ['mat_type', 'mpiaij'],
+                   ['ksp_type', 'cr'],
+                   ['pc_type', 'bjacobi'],
+                   ['tol', 0.6],
+                   ['elltol', 5e-5],
+                   ['schur_pc', 1],
+                   ['max_iter', 10000],
+                   ['issm_option_solver', 'stokes']]
 
-	#now, go through our arguments, and write over default options.
-	for i in range(len(arguments.list)):
-		arg1=arguments.list[i][0]
-		arg2=arguments.list[i][1]
-		found=0;
-		for j in range(len(options)):
-			joption=options[j][0]
-			if joption==arg1:
-				joption[1]=arg2;
-				options[j]=joption;
-				found=1;
-				break
-		if not found:
-			#this option did not exist, add it: 
-			options.append([arg1,arg2])
-	return options
+    #now, go through our arguments, and write over default options.
+    for i in range(len(arguments.list)):
+        arg1 = arguments.list[i][0]
+        arg2 = arguments.list[i][1]
+        found = 0
+        for j in range(len(options)):
+            joption = options[j][0]
+            if joption == arg1:
+                joption[1] = arg2
+                options[j] = joption
+                found = 1
+                break
+        if not found:
+            #this option did not exist, add it:
+            options.append([arg1, arg2])
+    return options
Index: /issm/trunk/src/wrappers/BamgMesher/BamgMesher.h
===================================================================
--- /issm/trunk/src/wrappers/BamgMesher/BamgMesher.h	(revision 24312)
+++ /issm/trunk/src/wrappers/BamgMesher/BamgMesher.h	(revision 24313)
@@ -17,10 +17,10 @@
 #endif
 
-#include "../bindings.h"
 #include "../../c/main/globals.h"
 #include "../../c/modules/modules.h"
 #include "../../c/shared/shared.h"
+#include "../bindings.h"
 
-#undef __FUNCT__ 
+#undef __FUNCT__
 #define __FUNCT__  "BamgMesher"
 
@@ -49,9 +49,9 @@
 #define BAMGMESHIN VerticesSize_mesh_in, Vertices_mesh_in, EdgesSize_mesh_in, Edges_mesh_in, TrianglesSize_mesh_in, Triangles_mesh_in, CrackedEdgesSize_mesh_in, CrackedEdges_mesh_in, VerticesOnGeomEdgeSize_mesh_in, VerticesOnGeomEdge_mesh_in, VerticesOnGeomVertexSize_mesh_in, VerticesOnGeomVertex_mesh_in, EdgesOnGeomEdgeSize_mesh_in, EdgesOnGeomEdge_mesh_in, IssmSegmentsSize_mesh_in, IssmSegments_mesh_in
 #define BAMGGEOMIN VerticesSize_geom_in, Vertices_geom_in, EdgesSize_geom_in, Edges_geom_in, CornersSize_geom_in, Corners_geom_in, RequiredVerticesSize_geom_in, RequiredVertices_geom_in, RequiredEdgesSize_geom_in, RequiredEdges_geom_in, CrackedEdgesSize_geom_in, CrackedEdges_geom_in, SubDomainsSize_geom_in, SubDomains_geom_in
-#define BAMGOPTIONS anisomax, cutoff, coeff, errg, gradation, Hessiantype, maxnbv, maxsubdiv, Metrictype, nbjacobi, nbsmooth, omega, power, verbose, Crack, KeepVertices, splitcorners, hmin, hmax, hminVerticesSize, hminVertices, hmaxVerticesSize, hmaxVertices, hVerticesSize, hVertices, metricSize, metric, fieldSize, field, errSize, err
+#define BAMGOPTIONS anisomax, cutoff, coeff, errg, gradation, Hessiantype, maxnbv, maxsubdiv, Metrictype, nbjacobi, nbsmooth, omega, power, verbose, Crack, KeepVertices, splitcorners, hmin, hmax, hminVerticesSize, hminVertices, hmaxVerticesSize, hmaxVertices, hVerticesLength, hVertices, metricSize, metric, fieldSize, field, errSize, err
 /* serial output macros: */
 #define BAMGMESHOUT VerticesSize_mesh_out, Vertices_mesh_out, EdgesSize_mesh_out, Edges_mesh_out, TrianglesSize_mesh_out, Triangles_mesh_out, IssmEdgesSize_mesh_out, IssmEdges_mesh_out, IssmSegmentsSize_mesh_out, IssmSegments_mesh_out, VerticesOnGeomVertexSize_mesh_out, VerticesOnGeomVertex_mesh_out, VerticesOnGeomEdgeSize_mesh_out, VerticesOnGeomEdge_mesh_out, EdgesOnGeomEdgeSize_mesh_out, EdgesOnGeomEdge_mesh_out, SubDomainsSize_mesh_out, SubDomains_mesh_out, SubDomainsFromGeomSize_mesh_out, SubDomainsFromGeom_mesh_out, ElementConnectivitySize_mesh_out, ElementConnectivity_mesh_out, NodalConnectivitySize_mesh_out, NodalConnectivity_mesh_out, NodalElementConnectivitySize_mesh_out, NodalElementConnectivity_mesh_out, CrackedVerticesSize_mesh_out, CrackedVertices_mesh_out, CrackedEdgesSize_mesh_out, CrackedEdges_mesh_out, PreviousNumberingSize_mesh_out, PreviousNumbering_mesh_out
 #define BAMGGEOMOUT VerticesSize_geom_out, Vertices_geom_out, EdgesSize_geom_out, Edges_geom_out, CornersSize_geom_out, Corners_geom_out, RequiredVerticesSize_geom_out, RequiredVertices_geom_out, RequiredEdgesSize_geom_out, RequiredEdges_geom_out, CrackedEdgesSize_geom_out, CrackedEdges_geom_out, SubDomainsSize_geom_out, SubDomains_geom_out
-#define WRAPPER(modulename) extern "C" { int  BamgMesherModule(int** VerticesSize_mesh_out, double** Vertices_mesh_out, int** EdgesSize_mesh_out, double** Edges_mesh_out, int** TrianglesSize_mesh_out, double** Triangles_mesh_out, int** IssmEdgesSize_mesh_out, double** IssmEdges_mesh_out, int** IssmSegmentsSize_mesh_out, double** IssmSegments_mesh_out, int** VerticesOnGeomVertexSize_mesh_out, double** VerticesOnGeomVertex_mesh_out, int** VerticesOnGeomEdgeSize_mesh_out, double** VerticesOnGeomEdge_mesh_out, int** EdgesOnGeomEdgeSize_mesh_out, double** EdgesOnGeomEdge_mesh_out, int** SubDomainsSize_mesh_out, double** SubDomains_mesh_out, int** SubDomainsFromGeomSize_mesh_out, double** SubDomainsFromGeom_mesh_out, int** ElementConnectivitySize_mesh_out, double** ElementConnectivity_mesh_out, int** NodalConnectivitySize_mesh_out, double** NodalConnectivity_mesh_out, int** NodalElementConnectivitySize_mesh_out, double** NodalElementConnectivity_mesh_out, int** CrackedVerticesSize_mesh_out, double** CrackedVertices_mesh_out, int** CrackedEdgesSize_mesh_out, double** CrackedEdges_mesh_out, int** PreviousNumberingSize_mesh_out, double** PreviousNumbering_mesh_out, int** VerticesSize_geom_out, double** Vertices_geom_out, int** EdgesSize_geom_out, double** Edges_geom_out, int** CornersSize_geom_out, double** Corners_geom_out, int** RequiredVerticesSize_geom_out, double** RequiredVertices_geom_out, int** RequiredEdgesSize_geom_out, double** RequiredEdges_geom_out, int** CrackedEdgesSize_geom_out, double** CrackedEdges_geom_out, int** SubDomainsSize_geom_out, double** SubDomains_geom_out, int* VerticesSize_mesh_in, double* Vertices_mesh_in, int* EdgesSize_mesh_in, double* Edges_mesh_in, int* TrianglesSize_mesh_in, double* Triangles_mesh_in, int* CrackedEdgesSize_mesh_in, double* CrackedEdges_mesh_in, int* VerticesOnGeomEdgeSize_mesh_in, double* VerticesOnGeomEdge_mesh_in, int* VerticesOnGeomVertexSize_mesh_in, double* VerticesOnGeomVertex_mesh_in, int* EdgesOnGeomEdgeSize_mesh_in, double* EdgesOnGeomEdge_mesh_in, int* IssmSegmentsSize_mesh_in, double* IssmSegments_mesh_in, int* VerticesSize_geom_in, double* Vertices_geom_in, int* EdgesSize_geom_in, double* Edges_geom_in, int* CornersSize_geom_in, double* Corners_geom_in, int* RequiredVerticesSize_geom_in, double* RequiredVertices_geom_in, int* RequiredEdgesSize_geom_in, double* RequiredEdges_geom_in, int* CrackedEdgesSize_geom_in, double* CrackedEdges_geom_in, int* SubDomainsSize_geom_in, double* SubDomains_geom_in, double anisomax, double cutoff, double coeff, double errg, double gradation, int Hessiantype, int maxnbv, double maxsubdiv, int Metrictype, int nbjacobi, int nbsmooth, double omega, double power, int verbose, int Crack, int KeepVertices, int splitcorners, double hmin, double hmax, int* hminVerticesSize, double* hminVertices, int* hmaxVerticesSize, double* hmaxVertices, int* hVerticesSize, double* hVertices, int* metricSize, double* metric, int* fieldSize, double* field, int* errSize, double* err)
+#define WRAPPER(modulename) extern "C" { int  BamgMesherModule(int** VerticesSize_mesh_out, double** Vertices_mesh_out, int** EdgesSize_mesh_out, double** Edges_mesh_out, int** TrianglesSize_mesh_out, double** Triangles_mesh_out, int** IssmEdgesSize_mesh_out, double** IssmEdges_mesh_out, int** IssmSegmentsSize_mesh_out, double** IssmSegments_mesh_out, int** VerticesOnGeomVertexSize_mesh_out, double** VerticesOnGeomVertex_mesh_out, int** VerticesOnGeomEdgeSize_mesh_out, double** VerticesOnGeomEdge_mesh_out, int** EdgesOnGeomEdgeSize_mesh_out, double** EdgesOnGeomEdge_mesh_out, int** SubDomainsSize_mesh_out, double** SubDomains_mesh_out, int** SubDomainsFromGeomSize_mesh_out, double** SubDomainsFromGeom_mesh_out, int** ElementConnectivitySize_mesh_out, double** ElementConnectivity_mesh_out, int** NodalConnectivitySize_mesh_out, double** NodalConnectivity_mesh_out, int** NodalElementConnectivitySize_mesh_out, double** NodalElementConnectivity_mesh_out, int** CrackedVerticesSize_mesh_out, double** CrackedVertices_mesh_out, int** CrackedEdgesSize_mesh_out, double** CrackedEdges_mesh_out, int** PreviousNumberingSize_mesh_out, double** PreviousNumbering_mesh_out, int** VerticesSize_geom_out, double** Vertices_geom_out, int** EdgesSize_geom_out, double** Edges_geom_out, int** CornersSize_geom_out, double** Corners_geom_out, int** RequiredVerticesSize_geom_out, double** RequiredVertices_geom_out, int** RequiredEdgesSize_geom_out, double** RequiredEdges_geom_out, int** CrackedEdgesSize_geom_out, double** CrackedEdges_geom_out, int** SubDomainsSize_geom_out, double** SubDomains_geom_out, int* VerticesSize_mesh_in, double* Vertices_mesh_in, int* EdgesSize_mesh_in, double* Edges_mesh_in, int* TrianglesSize_mesh_in, double* Triangles_mesh_in, int* CrackedEdgesSize_mesh_in, double* CrackedEdges_mesh_in, int* VerticesOnGeomEdgeSize_mesh_in, double* VerticesOnGeomEdge_mesh_in, int* VerticesOnGeomVertexSize_mesh_in, double* VerticesOnGeomVertex_mesh_in, int* EdgesOnGeomEdgeSize_mesh_in, double* EdgesOnGeomEdge_mesh_in, int* IssmSegmentsSize_mesh_in, double* IssmSegments_mesh_in, int* VerticesSize_geom_in, double* Vertices_geom_in, int* EdgesSize_geom_in, double* Edges_geom_in, int* CornersSize_geom_in, double* Corners_geom_in, int* RequiredVerticesSize_geom_in, double* RequiredVertices_geom_in, int* RequiredEdgesSize_geom_in, double* RequiredEdges_geom_in, int* CrackedEdgesSize_geom_in, double* CrackedEdges_geom_in, int* SubDomainsSize_geom_in, double* SubDomains_geom_in, double anisomax, double cutoff, double coeff, double errg, double gradation, int Hessiantype, int maxnbv, double maxsubdiv, int Metrictype, int nbjacobi, int nbsmooth, double omega, double power, int verbose, int Crack, int KeepVertices, int splitcorners, double hmin, double hmax, int* hminVerticesSize, double* hminVertices, int* hmaxVerticesSize, double* hmaxVertices, int hVerticesLength, double* hVertices, int* metricSize, double* metric, int* fieldSize, double* field, int* errSize, double* err)
 
 #endif
Index: /issm/trunk/src/wrappers/BamgMesher/BamgMesher.js
===================================================================
--- /issm/trunk/src/wrappers/BamgMesher/BamgMesher.js	(revision 24312)
+++ /issm/trunk/src/wrappers/BamgMesher/BamgMesher.js	(revision 24313)
@@ -1,26 +1,26 @@
 function doublesToHeap(array) {
-	var doubleArray = new Float64Array(array);
+    var doubleArray = new Float64Array(array);
     var numBytes = doubleArray.length * doubleArray.BYTES_PER_ELEMENT;
-	var doubleArrayPtr = Module._malloc(numBytes);
+    var doubleArrayPtr = Module._malloc(numBytes);
     var doubleArrayHeap = new Uint8Array(Module.HEAPU8.buffer, doubleArrayPtr, numBytes);
-	doubleArrayHeap.set(new Uint8Array(doubleArray.buffer));
+    doubleArrayHeap.set(new Uint8Array(doubleArray.buffer));
     return doubleArrayHeap.byteOffset;
 }
 function intsToHeap(array) {
-	var intArray = new Int32Array(array);
+    var intArray = new Int32Array(array);
     var numBytes = intArray.length * intArray.BYTES_PER_ELEMENT;
-	var intArrayPtr = Module._malloc(numBytes);
+    var intArrayPtr = Module._malloc(numBytes);
     var intArrayHeap = new Uint8Array(Module.HEAPU8.buffer, intArrayPtr, numBytes);
-	intArrayHeap.set(new Uint8Array(intArray.buffer));
+    intArrayHeap.set(new Uint8Array(intArray.buffer));
     return intArrayHeap.byteOffset;
 }
 function heapToDoubles(pptr, size) {
-	var ptr = Module.getValue(pptr,'i32');
-	var array = Module.HEAPF64.slice(ptr / 8, ptr / 8 + size[0] * size[1]);
-	return ListToMatrix(array, size[1]);
+    var ptr = Module.getValue(pptr,'i32');
+    var array = Module.HEAPF64.slice(ptr / 8, ptr / 8 + size[0] * size[1]);
+    return ListToMatrix(array, size[1]);
 }
 function heapToInts(pptr, nods) {
-	var ptr = Module.getValue(pptr,'i32');
-	return Module.HEAPU32.slice(ptr / 4, ptr / 4 + nods);
+    var ptr = Module.getValue(pptr,'i32');
+    return Module.HEAPU32.slice(ptr / 4, ptr / 4 + nods);
 }
 function size2d(array) {
@@ -40,19 +40,19 @@
 function BamgMesher(bamgmesh_in, bamggeom_in, bamgopts) {
 /*
-	   usage: var array = Triangle(domain,rifts,area);
-	      where: array is made of [index,x,y,segments,segmentmarkers]
-		  and index,x,y defines a triangulation, segments is an array made 
-	      of exterior segments to the mesh domain outline, segmentmarkers is an array 
-		  flagging each segment, domain a js array defining the domain outline  (sames for 
-		  rifts) and area is the maximum area desired for any element of the resulting mesh.
-
-		  Ok, for now, we are not dealing with rifts. Also, the domain is made of only one 
-		  profile, this to avoid passing a double** pointer to js. 
+       usage: var array = Triangle(domain,rifts,area);
+          where: array is made of [index,x,y,segments,segmentmarkers]
+          and index,x,y defines a triangulation, segments is an array made
+          of exterior segments to the mesh domain outline, segmentmarkers is an array
+          flagging each segment, domain a js array defining the domain outline  (sames for
+          rifts) and area is the maximum area desired for any element of the resulting mesh.
+
+          Ok, for now, we are not dealing with rifts. Also, the domain is made of only one
+          profile, this to avoid passing a double** pointer to js.
 */
 
-	//Dynamic allocations: {{{
-	//Retrieve domain arrays, and allocate on Module heap: 
+    //Dynamic allocations: {{{
+    //Retrieve domain arrays, and allocate on Module heap:
     //For each property, calculate the size and fill with 0 if the 2nd dimension is undefined, then use the int size array to init the double array.
-	//input
+    //input
     var pVerticesSize_mesh_in               = intsToHeap(size2d(bamgmesh_in.Vertices));
     var pVertices_mesh_in                   = doublesToHeap(Array.prototype.concat.apply([], bamgmesh_in.Vertices));
@@ -110,5 +110,5 @@
     var phmaxVerticesSize                   = intsToHeap(size2d(bamgopts.hmaxVertices));
     var phmaxVertices                       = doublesToHeap(Array.prototype.concat.apply([], bamgopts.hmaxVertices));
-    var phVerticesSize                      = intsToHeap(size2d(bamgopts.hVertices));
+    var hVerticesLength                     = bamgopts.hVerticesLength;
     var phVertices                          = doublesToHeap(Array.prototype.concat.apply([], bamgopts.hVertices));
     var pmetricSize                         = intsToHeap(size2d(bamgopts.metric));
@@ -118,106 +118,106 @@
     var perrSize                            = intsToHeap(size2d([[bamgopts.err]]));
     var perr                                = doublesToHeap(Array.prototype.concat.apply([], [[bamgopts.err]]));
-	
-	//output
-    var pVerticesSize_mesh_out                  = Module._malloc(4); 
-    var pVertices_mesh_out                      = Module._malloc(4); 
-    var pEdgesSize_mesh_out                     = Module._malloc(4); 
-    var pEdges_mesh_out                         = Module._malloc(4); 
-    var pTrianglesSize_mesh_out                 = Module._malloc(4); 
-    var pTriangles_mesh_out                     = Module._malloc(4); 
-    var pIssmEdgesSize_mesh_out                 = Module._malloc(4); 
-    var pIssmEdges_mesh_out                     = Module._malloc(4); 
-    var pIssmSegmentsSize_mesh_out              = Module._malloc(4); 
-    var pIssmSegments_mesh_out                  = Module._malloc(4); 
-    var pVerticesOnGeomVertexSize_mesh_out      = Module._malloc(4); 
-    var pVerticesOnGeomVertex_mesh_out          = Module._malloc(4); 
-    var pVerticesOnGeomEdgeSize_mesh_out        = Module._malloc(4); 
-    var pVerticesOnGeomEdge_mesh_out            = Module._malloc(4); 
-    var pEdgesOnGeomEdgeSize_mesh_out           = Module._malloc(4); 
-    var pEdgesOnGeomEdge_mesh_out               = Module._malloc(4); 
-    var pSubDomainsSize_mesh_out                = Module._malloc(4); 
-    var pSubDomains_mesh_out                    = Module._malloc(4); 
-    var pSubDomainsFromGeomSize_mesh_out        = Module._malloc(4); 
-    var pSubDomainsFromGeom_mesh_out            = Module._malloc(4); 
-    var pElementConnectivitySize_mesh_out       = Module._malloc(4); 
-    var pElementConnectivity_mesh_out           = Module._malloc(4); 
-    var pNodalConnectivitySize_mesh_out         = Module._malloc(4); 
-    var pNodalConnectivity_mesh_out             = Module._malloc(4); 
-    var pNodalElementConnectivitySize_mesh_out  = Module._malloc(4); 
-    var pNodalElementConnectivity_mesh_out      = Module._malloc(4); 
-    var pCrackedVerticesSize_mesh_out           = Module._malloc(4); 
-    var pCrackedVertices_mesh_out               = Module._malloc(4); 
-    var pCrackedEdgesSize_mesh_out              = Module._malloc(4); 
-    var pCrackedEdges_mesh_out                  = Module._malloc(4); 
-    var pPreviousNumberingSize_mesh_out         = Module._malloc(4); 
-    var pPreviousNumbering_mesh_out             = Module._malloc(4); 
-
-    var pVerticesSize_geom_out                  = Module._malloc(4); 
+
+    //output
+    var pVerticesSize_mesh_out                  = Module._malloc(4);
+    var pVertices_mesh_out                      = Module._malloc(4);
+    var pEdgesSize_mesh_out                     = Module._malloc(4);
+    var pEdges_mesh_out                         = Module._malloc(4);
+    var pTrianglesSize_mesh_out                 = Module._malloc(4);
+    var pTriangles_mesh_out                     = Module._malloc(4);
+    var pIssmEdgesSize_mesh_out                 = Module._malloc(4);
+    var pIssmEdges_mesh_out                     = Module._malloc(4);
+    var pIssmSegmentsSize_mesh_out              = Module._malloc(4);
+    var pIssmSegments_mesh_out                  = Module._malloc(4);
+    var pVerticesOnGeomVertexSize_mesh_out      = Module._malloc(4);
+    var pVerticesOnGeomVertex_mesh_out          = Module._malloc(4);
+    var pVerticesOnGeomEdgeSize_mesh_out        = Module._malloc(4);
+    var pVerticesOnGeomEdge_mesh_out            = Module._malloc(4);
+    var pEdgesOnGeomEdgeSize_mesh_out           = Module._malloc(4);
+    var pEdgesOnGeomEdge_mesh_out               = Module._malloc(4);
+    var pSubDomainsSize_mesh_out                = Module._malloc(4);
+    var pSubDomains_mesh_out                    = Module._malloc(4);
+    var pSubDomainsFromGeomSize_mesh_out        = Module._malloc(4);
+    var pSubDomainsFromGeom_mesh_out            = Module._malloc(4);
+    var pElementConnectivitySize_mesh_out       = Module._malloc(4);
+    var pElementConnectivity_mesh_out           = Module._malloc(4);
+    var pNodalConnectivitySize_mesh_out         = Module._malloc(4);
+    var pNodalConnectivity_mesh_out             = Module._malloc(4);
+    var pNodalElementConnectivitySize_mesh_out  = Module._malloc(4);
+    var pNodalElementConnectivity_mesh_out      = Module._malloc(4);
+    var pCrackedVerticesSize_mesh_out           = Module._malloc(4);
+    var pCrackedVertices_mesh_out               = Module._malloc(4);
+    var pCrackedEdgesSize_mesh_out              = Module._malloc(4);
+    var pCrackedEdges_mesh_out                  = Module._malloc(4);
+    var pPreviousNumberingSize_mesh_out         = Module._malloc(4);
+    var pPreviousNumbering_mesh_out             = Module._malloc(4);
+
+    var pVerticesSize_geom_out                  = Module._malloc(4);
     var pVertices_geom_out                      = Module._malloc(4);
-    var pEdgesSize_geom_out                     = Module._malloc(4); 
-    var pEdges_geom_out                         = Module._malloc(4); 
-    var pCornersSize_geom_out                   = Module._malloc(4); 
-    var pCorners_geom_out                       = Module._malloc(4); 
-    var pRequiredVerticesSize_geom_out          = Module._malloc(4); 
-    var pRequiredVertices_geom_out              = Module._malloc(4); 
-    var pRequiredEdgesSize_geom_out             = Module._malloc(4); 
-    var pRequiredEdges_geom_out                 = Module._malloc(4); 
-    var pCrackedEdgesSize_geom_out              = Module._malloc(4); 
-    var pCrackedEdges_geom_out                  = Module._malloc(4); 
-    var pSubDomainsSize_geom_out                = Module._malloc(4); 
-    var pSubDomains_geom_out                    = Module._malloc(4); 
-	//}}}
-
-	//Declare BamgMesher module: 
-	BamgMesherModule = Module.cwrap('BamgMesherModule', 'number',[
+    var pEdgesSize_geom_out                     = Module._malloc(4);
+    var pEdges_geom_out                         = Module._malloc(4);
+    var pCornersSize_geom_out                   = Module._malloc(4);
+    var pCorners_geom_out                       = Module._malloc(4);
+    var pRequiredVerticesSize_geom_out          = Module._malloc(4);
+    var pRequiredVertices_geom_out              = Module._malloc(4);
+    var pRequiredEdgesSize_geom_out             = Module._malloc(4);
+    var pRequiredEdges_geom_out                 = Module._malloc(4);
+    var pCrackedEdgesSize_geom_out              = Module._malloc(4);
+    var pCrackedEdges_geom_out                  = Module._malloc(4);
+    var pSubDomainsSize_geom_out                = Module._malloc(4);
+    var pSubDomains_geom_out                    = Module._malloc(4);
+    //}}}
+
+    //Declare BamgMesher module:
+    BamgMesherModule = Module.cwrap('BamgMesherModule', 'number',[
         'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number',
-        'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 
-        'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 
-        'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 
+        'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number',
+        'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number',
+        'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number',
         'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number']);
-	
-	//Call BamgMesher module: 
-
-	BamgMesherModule(
+
+    //Call BamgMesher module:
+
+    BamgMesherModule(
         pVerticesSize_mesh_out, pVertices_mesh_out, pEdgesSize_mesh_out, pEdges_mesh_out, pTrianglesSize_mesh_out, pTriangles_mesh_out, pIssmEdgesSize_mesh_out, pIssmEdges_mesh_out, pIssmSegmentsSize_mesh_out, pIssmSegments_mesh_out, pVerticesOnGeomVertexSize_mesh_out, pVerticesOnGeomVertex_mesh_out, pVerticesOnGeomEdgeSize_mesh_out, pVerticesOnGeomEdge_mesh_out, pEdgesOnGeomEdgeSize_mesh_out, pEdgesOnGeomEdge_mesh_out, pSubDomainsSize_mesh_out, pSubDomains_mesh_out, pSubDomainsFromGeomSize_mesh_out, pSubDomainsFromGeom_mesh_out, pElementConnectivitySize_mesh_out, pElementConnectivity_mesh_out, pNodalConnectivitySize_mesh_out, pNodalConnectivity_mesh_out, pNodalElementConnectivitySize_mesh_out, pNodalElementConnectivity_mesh_out, pCrackedVerticesSize_mesh_out, pCrackedVertices_mesh_out, pCrackedEdgesSize_mesh_out, pCrackedEdges_mesh_out, pPreviousNumberingSize_mesh_out, pPreviousNumbering_mesh_out,
-        pVerticesSize_geom_out, pVertices_geom_out, pEdgesSize_geom_out, pEdges_geom_out, pCornersSize_geom_out, pCorners_geom_out, pRequiredVerticesSize_geom_out, pRequiredVertices_geom_out, pRequiredEdgesSize_geom_out, pRequiredEdges_geom_out, pCrackedEdgesSize_geom_out, pCrackedEdges_geom_out, pSubDomainsSize_geom_out, pSubDomains_geom_out, 
-        pVerticesSize_mesh_in, pVertices_mesh_in, pEdgesSize_mesh_in, pEdges_mesh_in, pTrianglesSize_mesh_in, pTriangles_mesh_in, pCrackedEdgesSize_mesh_in, pCrackedEdges_mesh_in, pVerticesOnGeomEdgeSize_mesh_in, pVerticesOnGeomEdge_mesh_in, pVerticesOnGeomVertexSize_mesh_in, pVerticesOnGeomVertex_mesh_in, pEdgesOnGeomEdgeSize_mesh_in, pEdgesOnGeomEdge_mesh_in, pIssmSegmentsSize_mesh_in, pIssmSegments_mesh_in, 
-        pVerticesSize_geom_in, pVertices_geom_in, pEdgesSize_geom_in, pEdges_geom_in, pCornersSize_geom_in, pCorners_geom_in, pRequiredVerticesSize_geom_in, pRequiredVertices_geom_in, pRequiredEdgesSize_geom_in, pRequiredEdges_geom_in, pCrackedEdgesSize_geom_in, pCrackedEdges_geom_in, pSubDomainsSize_geom_in, pSubDomains_geom_in, 
-        anisomax, cutoff, coeff, errg, gradation, Hessiantype, maxnbv, maxsubdiv, Metrictype, nbjacobi, nbsmooth, omega, power, verbose, Crack, KeepVertices, splitcorners, hmin, hmax, phminVerticesSize, phminVertices, phmaxVerticesSize, phmaxVertices, phVerticesSize, phVertices, pmetricSize, pmetric, pfieldSize, pfield, perrSize, perr);
-	
-	/*Dynamic copying from heap: {{{*/
-	//recover mesh: 
+        pVerticesSize_geom_out, pVertices_geom_out, pEdgesSize_geom_out, pEdges_geom_out, pCornersSize_geom_out, pCorners_geom_out, pRequiredVerticesSize_geom_out, pRequiredVertices_geom_out, pRequiredEdgesSize_geom_out, pRequiredEdges_geom_out, pCrackedEdgesSize_geom_out, pCrackedEdges_geom_out, pSubDomainsSize_geom_out, pSubDomains_geom_out,
+        pVerticesSize_mesh_in, pVertices_mesh_in, pEdgesSize_mesh_in, pEdges_mesh_in, pTrianglesSize_mesh_in, pTriangles_mesh_in, pCrackedEdgesSize_mesh_in, pCrackedEdges_mesh_in, pVerticesOnGeomEdgeSize_mesh_in, pVerticesOnGeomEdge_mesh_in, pVerticesOnGeomVertexSize_mesh_in, pVerticesOnGeomVertex_mesh_in, pEdgesOnGeomEdgeSize_mesh_in, pEdgesOnGeomEdge_mesh_in, pIssmSegmentsSize_mesh_in, pIssmSegments_mesh_in,
+        pVerticesSize_geom_in, pVertices_geom_in, pEdgesSize_geom_in, pEdges_geom_in, pCornersSize_geom_in, pCorners_geom_in, pRequiredVerticesSize_geom_in, pRequiredVertices_geom_in, pRequiredEdgesSize_geom_in, pRequiredEdges_geom_in, pCrackedEdgesSize_geom_in, pCrackedEdges_geom_in, pSubDomainsSize_geom_in, pSubDomains_geom_in,
+        anisomax, cutoff, coeff, errg, gradation, Hessiantype, maxnbv, maxsubdiv, Metrictype, nbjacobi, nbsmooth, omega, power, verbose, Crack, KeepVertices, splitcorners, hmin, hmax, phminVerticesSize, phminVertices, phmaxVerticesSize, phmaxVertices, hVerticesLength, phVertices, pmetricSize, pmetric, pfieldSize, pfield, perrSize, perr);
+
+    /*Dynamic copying from heap: {{{*/
+    //recover mesh:
     var bamgmeshout = new bamgmesh();
     var bamggeomout = new bamggeom();
 
-	bamgmeshout.VerticesSize                   = heapToInts(pVerticesSize_mesh_out, 2);
+    bamgmeshout.VerticesSize                   = heapToInts(pVerticesSize_mesh_out, 2);
     bamgmeshout.Vertices                       = heapToDoubles(pVertices_mesh_out, bamgmeshout.VerticesSize);
-	bamgmeshout.EdgesSize                      = heapToInts(pEdgesSize_mesh_out, 2);
+    bamgmeshout.EdgesSize                      = heapToInts(pEdgesSize_mesh_out, 2);
     bamgmeshout.Edges                          = heapToDoubles(pEdges_mesh_out, bamgmeshout.EdgesSize);
-	bamgmeshout.TrianglesSize                  = heapToInts(pTrianglesSize_mesh_out, 2);
+    bamgmeshout.TrianglesSize                  = heapToInts(pTrianglesSize_mesh_out, 2);
     bamgmeshout.Triangles                      = heapToDoubles(pTriangles_mesh_out, bamgmeshout.TrianglesSize);
-	bamgmeshout.IssmEdgesSize                  = heapToInts(pIssmEdgesSize_mesh_out, 2);
+    bamgmeshout.IssmEdgesSize                  = heapToInts(pIssmEdgesSize_mesh_out, 2);
     bamgmeshout.IssmEdges                      = heapToDoubles(pIssmEdges_mesh_out, bamgmeshout.IssmEdgesSize);
-	bamgmeshout.IssmSegmentsSize               = heapToInts(pIssmSegmentsSize_mesh_out, 2);
+    bamgmeshout.IssmSegmentsSize               = heapToInts(pIssmSegmentsSize_mesh_out, 2);
     bamgmeshout.IssmSegments                   = heapToDoubles(pIssmSegments_mesh_out, bamgmeshout.IssmSegmentsSize);
-	bamgmeshout.VerticesOnGeomVertexSize       = heapToInts(pVerticesOnGeomVertexSize_mesh_out, 2);
+    bamgmeshout.VerticesOnGeomVertexSize       = heapToInts(pVerticesOnGeomVertexSize_mesh_out, 2);
     bamgmeshout.VerticesOnGeomVertex           = heapToDoubles(pVerticesOnGeomVertex_mesh_out, bamgmeshout.VerticesOnGeomVertexSize);
-	bamgmeshout.VerticesOnGeomEdgeSize         = heapToInts(pVerticesOnGeomEdgeSize_mesh_out, 2);
+    bamgmeshout.VerticesOnGeomEdgeSize         = heapToInts(pVerticesOnGeomEdgeSize_mesh_out, 2);
     bamgmeshout.VerticesOnGeomEdge             = heapToDoubles(pVerticesOnGeomEdge_mesh_out, bamgmeshout.VerticesOnGeomEdgeSize);
-	bamgmeshout.EdgesOnGeomEdgeSize            = heapToInts(pEdgesOnGeomEdgeSize_mesh_out, 2);
+    bamgmeshout.EdgesOnGeomEdgeSize            = heapToInts(pEdgesOnGeomEdgeSize_mesh_out, 2);
     bamgmeshout.EdgesOnGeomEdge                = heapToDoubles(pEdgesOnGeomEdge_mesh_out, bamgmeshout.EdgesOnGeomEdgeSize);
-	bamgmeshout.SubDomainsSize                 = heapToInts(pSubDomainsSize_mesh_out, 2);
+    bamgmeshout.SubDomainsSize                 = heapToInts(pSubDomainsSize_mesh_out, 2);
     bamgmeshout.SubDomains                     = heapToDoubles(pSubDomains_mesh_out, bamgmeshout.SubDomainsSize);
-	bamgmeshout.SubDomainsFromGeomSize         = heapToInts(pSubDomainsFromGeomSize_mesh_out, 2);
+    bamgmeshout.SubDomainsFromGeomSize         = heapToInts(pSubDomainsFromGeomSize_mesh_out, 2);
     bamgmeshout.SubDomainsFromGeom             = heapToDoubles(pSubDomainsFromGeom_mesh_out, bamgmeshout.SubDomainsFromGeomSize);
-	bamgmeshout.ElementConnectivitySize        = heapToInts(pElementConnectivitySize_mesh_out, 2);
+    bamgmeshout.ElementConnectivitySize        = heapToInts(pElementConnectivitySize_mesh_out, 2);
     bamgmeshout.ElementConnectivity            = heapToDoubles(pElementConnectivity_mesh_out, bamgmeshout.ElementConnectivitySize);
-	bamgmeshout.NodalConnectivitySize          = heapToInts(pNodalConnectivitySize_mesh_out, 2);
+    bamgmeshout.NodalConnectivitySize          = heapToInts(pNodalConnectivitySize_mesh_out, 2);
     bamgmeshout.NodalConnectivity              = heapToDoubles(pNodalConnectivity_mesh_out, bamgmeshout.NodalConnectivitySize);
-	bamgmeshout.NodalElementConnectivitySize   = heapToInts(pNodalElementConnectivitySize_mesh_out, 2);
+    bamgmeshout.NodalElementConnectivitySize   = heapToInts(pNodalElementConnectivitySize_mesh_out, 2);
     bamgmeshout.NodalElementConnectivity       = heapToDoubles(pNodalElementConnectivity_mesh_out, bamgmeshout.NodalElementConnectivitySize);
-	bamgmeshout.CrackedVerticesSize            = heapToInts(pCrackedVerticesSize_mesh_out, 2);
+    bamgmeshout.CrackedVerticesSize            = heapToInts(pCrackedVerticesSize_mesh_out, 2);
     bamgmeshout.CrackedVertices                = heapToDoubles(pCrackedVertices_mesh_out, bamgmeshout.CrackedVerticesSize);
-	bamgmeshout.CrackedEdgesSize               = heapToInts(pCrackedEdgesSize_mesh_out, 2);
+    bamgmeshout.CrackedEdgesSize               = heapToInts(pCrackedEdgesSize_mesh_out, 2);
     bamgmeshout.CrackedEdges                   = heapToDoubles(pCrackedEdges_mesh_out, bamgmeshout.CrackedEdgesSize);
     bamgmeshout.PreviousNumberingSize          = heapToInts(pPreviousNumberingSize_mesh_out, 2);
@@ -238,41 +238,41 @@
     bamggeomout.SubDomainsSize                 = heapToInts(pSubDomainsSize_geom_out, 2);
     bamggeomout.SubDomains                     = heapToDoubles(pSubDomains_geom_out, bamggeomout.SubDomainsSize);
-	/*}}}*/
-
-	var return_array=[bamgmeshout, bamggeomout];
-
-	/*Free ressources: */
-    Module._free(pVerticesSize_mesh_out); 
-    Module._free(pVertices_mesh_out); 
-    Module._free(pEdgesSize_mesh_out); 
-    Module._free(pEdges_mesh_out); 
-    Module._free(pTrianglesSize_mesh_out); 
-    Module._free(pTriangles_mesh_out); 
-    Module._free(pIssmEdgesSize_mesh_out); 
-    Module._free(pIssmEdges_mesh_out); 
-    Module._free(pIssmSegmentsSize_mesh_out); 
-    Module._free(pIssmSegments_mesh_out); 
-    Module._free(pVerticesOnGeomVertexSize_mesh_out); 
-    Module._free(pVerticesOnGeomVertex_mesh_out); 
-    Module._free(pVerticesOnGeomEdgeSize_mesh_out); 
-    Module._free(pVerticesOnGeomEdge_mesh_out); 
-    Module._free(pEdgesOnGeomEdgeSize_mesh_out); 
-    Module._free(pEdgesOnGeomEdge_mesh_out); 
-    Module._free(pSubDomainsSize_mesh_out); 
-    Module._free(pSubDomains_mesh_out); 
-    Module._free(pSubDomainsFromGeomSize_mesh_out); 
-    Module._free(pSubDomainsFromGeom_mesh_out); 
-    Module._free(pElementConnectivitySize_mesh_out); 
-    Module._free(pElementConnectivity_mesh_out); 
-    Module._free(pNodalConnectivitySize_mesh_out); 
-    Module._free(pNodalConnectivity_mesh_out); 
-    Module._free(pNodalElementConnectivitySize_mesh_out); 
-    Module._free(pNodalElementConnectivity_mesh_out); 
-    Module._free(pCrackedVerticesSize_mesh_out); 
-    Module._free(pCrackedVertices_mesh_out); 
-    Module._free(pCrackedEdgesSize_mesh_out); 
-    Module._free(pCrackedEdges_mesh_out); 
-    Module._free(pPreviousNumberingSize_mesh_out); 
-    Module._free(pPreviousNumbering_mesh_out); 
+    /*}}}*/
+
+    var return_array=[bamgmeshout, bamggeomout];
+
+    /*Free ressources: */
+    Module._free(pVerticesSize_mesh_out);
+    Module._free(pVertices_mesh_out);
+    Module._free(pEdgesSize_mesh_out);
+    Module._free(pEdges_mesh_out);
+    Module._free(pTrianglesSize_mesh_out);
+    Module._free(pTriangles_mesh_out);
+    Module._free(pIssmEdgesSize_mesh_out);
+    Module._free(pIssmEdges_mesh_out);
+    Module._free(pIssmSegmentsSize_mesh_out);
+    Module._free(pIssmSegments_mesh_out);
+    Module._free(pVerticesOnGeomVertexSize_mesh_out);
+    Module._free(pVerticesOnGeomVertex_mesh_out);
+    Module._free(pVerticesOnGeomEdgeSize_mesh_out);
+    Module._free(pVerticesOnGeomEdge_mesh_out);
+    Module._free(pEdgesOnGeomEdgeSize_mesh_out);
+    Module._free(pEdgesOnGeomEdge_mesh_out);
+    Module._free(pSubDomainsSize_mesh_out);
+    Module._free(pSubDomains_mesh_out);
+    Module._free(pSubDomainsFromGeomSize_mesh_out);
+    Module._free(pSubDomainsFromGeom_mesh_out);
+    Module._free(pElementConnectivitySize_mesh_out);
+    Module._free(pElementConnectivity_mesh_out);
+    Module._free(pNodalConnectivitySize_mesh_out);
+    Module._free(pNodalConnectivity_mesh_out);
+    Module._free(pNodalElementConnectivitySize_mesh_out);
+    Module._free(pNodalElementConnectivity_mesh_out);
+    Module._free(pCrackedVerticesSize_mesh_out);
+    Module._free(pCrackedVertices_mesh_out);
+    Module._free(pCrackedEdgesSize_mesh_out);
+    Module._free(pCrackedEdges_mesh_out);
+    Module._free(pPreviousNumberingSize_mesh_out);
+    Module._free(pPreviousNumbering_mesh_out);
 
     Module._free(pVerticesSize_geom_out);
@@ -327,5 +327,4 @@
     Module._free(phmaxVerticesSize);
     Module._free(phmaxVertices);
-    Module._free(phVerticesSize);
     Module._free(phVertices);
     Module._free(pmetricSize);
@@ -336,4 +335,4 @@
     Module._free(perr);
 
-	return return_array;
-}
+    return return_array;
+}
Index: /issm/trunk/src/wrappers/ExpToLevelSet/ExpToLevelSet.cpp
===================================================================
--- /issm/trunk/src/wrappers/ExpToLevelSet/ExpToLevelSet.cpp	(revision 24312)
+++ /issm/trunk/src/wrappers/ExpToLevelSet/ExpToLevelSet.cpp	(revision 24313)
@@ -40,5 +40,5 @@
 
 	/*check on input arguments: */
-	if(nrhs!=NRHS | nlhs!=NLHS){
+	if(nrhs!=NRHS){
 		ExpToLevelSetUsage();
 		_error_("usage. See above");
Index: /issm/trunk/src/wrappers/javascript/io/FetchJavascriptData.cpp
===================================================================
--- /issm/trunk/src/wrappers/javascript/io/FetchJavascriptData.cpp	(revision 24312)
+++ /issm/trunk/src/wrappers/javascript/io/FetchJavascriptData.cpp	(revision 24313)
@@ -10,35 +10,32 @@
 
 #include "./javascriptio.h"
-#include <cstring> 
+#include <cstring>
 
 /*Primitive data types*/
 /*FUNCTION FetchData(char** pstring, char* string){{{*/
 void FetchData(char** pstring, char* stringin){
-
-	char* string=xNew<char>(strlen(stringin)+1);
-	xMemCpy<char>(string,stringin,strlen(stringin)+1);
+	char* string=NULL;
+
+	string=xNew<char>(strlen(stringin)+1); xMemCpy<char>(string,stringin,strlen(stringin)+1);
 
 	*pstring=string;
 }
 /*}}}*/
-/*FUNCTION FetchData(int* pinteger,int integer){{{*/
-void FetchData(int* pinteger,int integer){
-	
-	*pinteger = integer;
-}
-/*}}}*/
-/*FUNCTION FetchData(double* pscalar,double scalar){{{*/
-void FetchData(double* pscalar,double scalar){
-	
-	*pscalar = scalar;
+/*FUNCTION FetchData(int* pinteger, int integer){{{*/
+void FetchData(int* pinteger, int integer){
+	*pinteger=integer;
+}
+/*}}}*/
+/*FUNCTION FetchData(double* pscalar, double scalar){{{*/
+void FetchData(double* pscalar, double scalar){
+	*pscalar=scalar;
 }
 /*}}}*/
 /*FUNCTION FetchData(double **pvector, double* vectorin, int nods){{{*/
 void FetchData(double** pvector, double* vectorin, int nods){
-
 	double* vector=NULL;
-	
+
 	vector=xNew<IssmPDouble>(nods); xMemCpy<IssmPDouble>(vector,vectorin,nods);
-	
+
 	*pvector=vector;
 }
@@ -46,9 +43,8 @@
 /*FUNCTION FetchData(double **pvector, int* pnods, double* vectorin, int nods){{{*/
 void FetchData(double** pvector, int* pnods, double* vectorin, int nods){
-
 	double* vector=NULL;
-	
+
 	vector=xNew<IssmPDouble>(nods); xMemCpy<IssmPDouble>(vector,vectorin,nods);
-	
+
 	*pvector=vector;
 	*pnods=nods;
@@ -57,8 +53,7 @@
 /*FUNCTION FetchData(double **pmatrix, int* pM, int* pN, int* matrix, int M, int N){{{*/
 void FetchData(double **pmatrix, int* pM, int* pN, int* matrixin, int M, int N){
-
 	double*  outmatrix=NULL;
-	int      outmatrix_rows,outmatrix_cols;
-	
+	int      outmatrix_rows, outmatrix_cols;
+
 	if(M == 0 || N == 0){
 		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
@@ -67,22 +62,21 @@
 		outmatrix=NULL;
 	}
-    else if (pmatrix && matrixin){ 
+    else if (pmatrix && matrixin){
 		outmatrix_rows=M;
 		outmatrix_cols=N;
-		outmatrix=xNew<IssmPDouble>(M*N); 
-		for(int i=0;i<M*N;i++)outmatrix[i]=(IssmPDouble)matrixin[i];
+		outmatrix=xNew<IssmPDouble>(M*N);
+		for(int i=0;i<M*N;i++){outmatrix[i]=(IssmPDouble)matrixin[i];}
 	}
 
 	/*Assign output pointers:*/
 	*pmatrix=outmatrix;
-	if (pM)*pM=outmatrix_rows;
-	if (pN)*pN=outmatrix_cols;
+	if (pM){*pM=outmatrix_rows;}
+	if (pN){*pN=outmatrix_cols;}
 }
 /*}}}*/
 /*FUNCTION FetchData(double **pmatrix, int* pM, int* pN, double* matrix, int M, int N){{{*/
 void FetchData(double **pmatrix, int* pM, int* pN, double* matrixin, int M, int N){
-
 	double*  outmatrix=NULL;
-	int      outmatrix_rows,outmatrix_cols;
+	int      outmatrix_rows, outmatrix_cols;
 
 	if(M == 0 || N == 0){
@@ -92,21 +86,20 @@
 		outmatrix=NULL;
 	}
-    else if (pmatrix && matrixin){ 
+    else if (pmatrix && matrixin){
 		outmatrix_rows=M;
 		outmatrix_cols=N;
-		outmatrix=xNew<IssmPDouble>(M*N); xMemCpy<IssmPDouble>(outmatrix,matrixin,M*N); 
+		outmatrix=xNew<IssmPDouble>(M*N); xMemCpy<IssmPDouble>(outmatrix,matrixin,M*N);
 	}
 
 	/*Assign output pointers:*/
 	*pmatrix=outmatrix;
-	if (pM)*pM=outmatrix_rows;
-	if (pN)*pN=outmatrix_cols;
+	if (pM){*pM=outmatrix_rows;}
+	if (pN){*pN=outmatrix_cols;}
 }
 /*}}}*/
 /*FUNCTION FetchData(int **pmatrix, int* pM, int* pN, int* matrix, int M, int N){{{*/
 void FetchData(int **pmatrix, int* pM, int* pN, int* matrixin, int M, int N){
-
 	int*     outmatrix=NULL;
-	int      outmatrix_rows,outmatrix_cols;
+	int      outmatrix_rows, outmatrix_cols;
 
 	if(M == 0 || N == 0){
@@ -116,21 +109,20 @@
 		outmatrix=NULL;
 	}
-    else if (pmatrix && matrixin){ 
+    else if (pmatrix && matrixin){
 		outmatrix_rows=M;
 		outmatrix_cols=N;
-		outmatrix=xNew<int>(M*N); xMemCpy<int>(outmatrix,matrixin,M*N); 
+		outmatrix=xNew<int>(M*N); xMemCpy<int>(outmatrix,matrixin,M*N);
 	}
 
 	/*Assign output pointers:*/
 	*pmatrix=outmatrix;
-	if (pM)*pM=outmatrix_rows;
-	if (pN)*pN=outmatrix_cols;
+	if (pM){*pM=outmatrix_rows;}
+	if (pN){*pN=outmatrix_cols;}
 }
 /*}}}*/
 /*ISSM objects*/
-/*FUNCTION FetchData(Contours** pcontours,double* x, double* y, int nods){{{*/
-void FetchData(Contours** pcontours,double* x, double* y, int nods){
-
-	int             numcontours,index,test1,test2;
+/*FUNCTION FetchData(Contours** pcontours, double* x, double* y, int nods){{{*/
+void FetchData(Contours** pcontours, double* x, double* y, int nods){
+	int             numcontours, index, test1, test2;
 	char            *contourname = NULL;
 	Contours        *contours    = NULL;
@@ -141,13 +133,11 @@
 
 	if (nods){
-			
 		contouri=new Contour<double>();
 		contouri->nods=nods;
 		contouri->x=xNew<IssmPDouble>(nods); xMemCpy<IssmPDouble>(contouri->x,x,nods);
 		contouri->y=xNew<IssmPDouble>(nods); xMemCpy<IssmPDouble>(contouri->y,y,nods);
-
 		contours->AddObject(contouri);
 	}
-	
+
 	*pcontours=contours;
 }
@@ -157,5 +147,5 @@
 
 	/*Initialize output*/
-	BamgGeom* bamggeom = new BamgGeom();
+	BamgGeom* bamggeom=new BamgGeom();
 
 	/*Fetch all fields*/
@@ -169,5 +159,5 @@
 
 	/*Assign output pointers:*/
-	*pbamggeom = bamggeom;
+	*pbamggeom=bamggeom;
 }
 /*}}}*/
@@ -176,5 +166,5 @@
 
 	/*Initialize output*/
-	BamgMesh* bamgmesh = new BamgMesh();
+	BamgMesh* bamgmesh=new BamgMesh();
 
 	/*Fetch all fields*/
@@ -189,9 +179,9 @@
 
 	/*Assign output pointers:*/
-	*pbamgmesh = bamgmesh;
-}
-/*}}}*/
-/*FUNCTION FetchData(BamgOpts** pbamgopts, double anisomax, double cutoff, double coeff, double errg, double gradation, int Hessiantype, int maxnbv, double maxsubdiv, int Metrictype, int nbjacobi, int nbsmooth, double omega, double power, int verbose, int Crack, int KeepVertices, int splitcorners, double hmin, double hmax, int* hminVerticesSize, double* hminVertices, int* hmaxVerticesSize, double* hmaxVertices, int* hVerticesSize, double* hVertices, int* metricSize, double* metric, int* fieldSize, double* field, int* errSize, double* err){{{*/
-void FetchData(BamgOpts** pbamgopts, double anisomax, double coeff, double cutoff, double errg, double gradation, int Hessiantype, int maxnbv, double maxsubdiv, int Metrictype, int nbjacobi, int nbsmooth, double omega, double power, int verbose, int Crack, int KeepVertices, int splitcorners, double hmin, double hmax, int* hminVerticesSize, double* hminVertices, int* hmaxVerticesSize, double* hmaxVertices, int* hVerticesSize, double* hVertices, int* metricSize, double* metric, int* fieldSize, double* field, int* errSize, double* err){
+	*pbamgmesh=bamgmesh;
+}
+/*}}}*/
+/*FUNCTION FetchData(BamgOpts** pbamgopts, double anisomax, double cutoff, double coeff, double errg, double gradation, int Hessiantype, int maxnbv, double maxsubdiv, int Metrictype, int nbjacobi, int nbsmooth, double omega, double power, int verbose, int Crack, int KeepVertices, int splitcorners, double hmin, double hmax, int* hminVerticesSize, double* hminVertices, int* hmaxVerticesSize, double* hmaxVertices, int hVerticesLength, double* hVertices, int* metricSize, double* metric, int* fieldSize, double* field, int* errSize, double* err){{{*/
+void FetchData(BamgOpts** pbamgopts, double anisomax, double coeff, double cutoff, double errg, double gradation, int Hessiantype, int maxnbv, double maxsubdiv, int Metrictype, int nbjacobi, int nbsmooth, double omega, double power, int verbose, int Crack, int KeepVertices, int splitcorners, double hmin, double hmax, int* hminVerticesSize, double* hminVertices, int* hmaxVerticesSize, double* hmaxVertices, int hVerticesLength, double* hVertices, int* metricSize, double* metric, int* fieldSize, double* field, int* errSize, double* err){
 
 	BamgOpts *bamgopts      = new BamgOpts();
@@ -217,5 +207,5 @@
     bamgopts->KeepVertices	= KeepVertices;
     bamgopts->splitcorners	= splitcorners;
-        
+
     /*Metric related*/
     bamgopts->hmin	        = hmin;
@@ -223,33 +213,30 @@
 	FetchData(&bamgopts->hminVertices, &bamgopts->hminVerticesSize[0], &bamgopts->hminVerticesSize[1], hminVertices, hminVerticesSize[0], hminVerticesSize[1]);
 	FetchData(&bamgopts->hmaxVertices, &bamgopts->hmaxVerticesSize[0], &bamgopts->hmaxVerticesSize[1], hmaxVertices, hmaxVerticesSize[0], hmaxVerticesSize[1]);
-	FetchData(&bamgopts->hVertices, &bamgopts->hVerticesSize[0], &bamgopts->hVerticesSize[1], hVertices, hVerticesSize[0], hVerticesSize[1]);
+	FetchData(&bamgopts->hVertices, &bamgopts->hVerticesLength, hVertices, hVerticesLength);
 	FetchData(&bamgopts->field, &bamgopts->fieldSize[0], &bamgopts->fieldSize[1], field, fieldSize[0], fieldSize[1]);
 	FetchData(&bamgopts->metric, &bamgopts->metricSize[0], &bamgopts->metricSize[1], metric, metricSize[0], metricSize[1]);
 	FetchData(&bamgopts->err, &bamgopts->errSize[0], &bamgopts->errSize[1], err, errSize[0], errSize[1]);
-    
+
 	/*Additional checks*/
 	bamgopts->Check();
 
 	/*Assign output pointers:*/
-	*pbamgopts              = bamgopts;
-}
-/*}}}*/
-/*FUNCTION FetchData(Options** poptions,int NRHS, int nrhs, const char* optionname, double optionvalue){{{*/
-void FetchData(Options** poptions,int NRHS, int nrhs, const char* optionname, double optionvalue){
+	*pbamgopts=bamgopts;
+}
+/*}}}*/
+/*FUNCTION FetchData(Options** poptions, int NRHS, int nrhs, const char* optionname, double optionvalue){{{*/
+void FetchData(Options** poptions, int NRHS, int nrhs, const char* optionname, double optionvalue){
 
 	/*Initialize output*/
 	Options* options=new Options();
-	
-	GenericOption<double> *odouble = NULL;
 
 	/*check and parse the name  */
+	GenericOption<double> *odouble=new GenericOption<double>();
 	odouble=new GenericOption<double>();
-	odouble->name =xNew<char>(strlen(optionname)+1);
+	odouble->name=xNew<char>(strlen(optionname)+1);
 	memcpy(odouble->name,optionname,(strlen(optionname)+1)*sizeof(char));
 	odouble->value=optionvalue;
-	odouble->numel=1;
-	odouble->ndims=1;
-	odouble->size=NULL;
-	 
+	odouble->size[0]=1;
+	odouble->size[1]=1;
 	options->AddOption((Option*)odouble);
 
Index: /issm/trunk/src/wrappers/javascript/io/javascriptio.h
===================================================================
--- /issm/trunk/src/wrappers/javascript/io/javascriptio.h	(revision 24312)
+++ /issm/trunk/src/wrappers/javascript/io/javascriptio.h	(revision 24313)
@@ -42,5 +42,5 @@
 void FetchData(BamgGeom** pbamggeom, int* VerticesSize, double* Vertices, int* EdgesSize, double* Edges, int* CornersSize, double* Corners, int* RequiredVerticesSize, double* RequiredVertices, int* RequiredEdgesSize, double* RequiredEdges, int* CrackedEdgesSize, double* CrackedEdges, int* SubDomainsSize, double* SubDomains);
 void FetchData(BamgMesh** pbamgmesh, int* VerticesSize, double* Vertices, int* EdgesSize, double* Edges, int* TrianglesSize, double* Triangles, int* CrackedEdgesSize, double* CrackedEdges, int* VerticesOnGeomEdgeSize, double* VerticesOnGeomEdge, int* VerticesOnGeomVertexSize, double* VerticesOnGeomVertex, int* EdgesOnGeomEdgeSize, double* EdgesOnGeomEdge, int* IssmSegmentsSize, double* IssmSegments);
-void FetchData(BamgOpts** pbamgopts, double anisomax, double cutoff, double coeff, double errg, double gradation, int Hessiantype, int maxnbv, double maxsubdiv, int Metrictype, int nbjacobi, int nbsmooth, double omega, double power, int verbose, int Crack, int KeepVertices, int splitcorners, double hmin, double hmax, int* hminVerticesSize, double* hminVertices, int* hmaxVerticesSize, double* hmaxVertices, int* hVerticesSize, double* hVertices, int* metricSize, double* metric, int* fieldSize, double* field, int* errSize, double* err);
+void FetchData(BamgOpts** pbamgopts, double anisomax, double cutoff, double coeff, double errg, double gradation, int Hessiantype, int maxnbv, double maxsubdiv, int Metrictype, int nbjacobi, int nbsmooth, double omega, double power, int verbose, int Crack, int KeepVertices, int splitcorners, double hmin, double hmax, int* hminVerticesSize, double* hminVertices, int* hmaxVerticesSize, double* hmaxVertices, int hVerticesLength, double* hVertices, int* metricSize, double* metric, int* fieldSize, double* field, int* errSize, double* err);
 void FetchData(Options** poptions,int NRHS, int nrhs, const char* optionname, double optionvalue);
 void FetchData(int* pinteger,int integer);
Index: /issm/trunk/src/wrappers/matlab/Makefile.am
===================================================================
--- /issm/trunk/src/wrappers/matlab/Makefile.am	(revision 24312)
+++ /issm/trunk/src/wrappers/matlab/Makefile.am	(revision 24313)
@@ -120,5 +120,5 @@
 if STANDALONE_LIBRARIES
 libISSMMatlab_la_LDFLAGS = -static 
-deps += $(PETSCLIB) $(TAOLIB) $(NEOPZLIB) $(M1QN3LIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB)   $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
+deps += $(PETSCLIB) $(TAOLIB) $(NEOPZLIB) $(M1QN3LIB) $(SEMICLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SUPERLULIB) $(SPOOLESLIB) $(TRIANGLELIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(SPAILIB) $(PROMETHEUSLIB) $(PASTIXLIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB)   $(ADOLCLIB) $(AMPILIB) $(METEOIOLIB) $(SNOWPACKLIB)
 endif
 
Index: /issm/trunk/src/wrappers/matlab/include/wrapper_macros.h
===================================================================
--- /issm/trunk/src/wrappers/matlab/include/wrapper_macros.h	(revision 24312)
+++ /issm/trunk/src/wrappers/matlab/include/wrapper_macros.h	(revision 24313)
@@ -19,5 +19,6 @@
  * will be trapped*/
 #define MODULEBOOT(); try{ \
-	IssmComm::SetComm();
+	IssmComm::SetComm(); \
+	ToolkitOptions::Init();
 
 #define MODULEEND(); }\
Index: /issm/trunk/src/wrappers/matlab/io/FetchMatlabData.cpp
===================================================================
--- /issm/trunk/src/wrappers/matlab/io/FetchMatlabData.cpp	(revision 24312)
+++ /issm/trunk/src/wrappers/matlab/io/FetchMatlabData.cpp	(revision 24313)
@@ -10,9 +10,8 @@
 
 #include "./matlabio.h"
-#include <cstring> 
+#include <cstring>
 
 /*Primitive data types*/
-/*FUNCTION FetchData(double** pmatrix,int* pM,int *pN,const mxArray* dataref){{{*/
-void FetchData(double** pmatrix,int* pM,int *pN,const mxArray* dataref){
+void FetchData(double** pmatrix,int* pM,int *pN,const mxArray* dataref){/*{{{*/
 
 	double*  outmatrix=NULL;
@@ -25,8 +24,8 @@
 		outmatrix=NULL;
 	}
-	else if( mxIsClass(dataref,"double") || 
-				mxIsClass(dataref,"single") || 
-				mxIsClass(dataref,"int16") || 
-				mxIsClass(dataref,"int8") || 
+	else if( mxIsClass(dataref,"double") ||
+				mxIsClass(dataref,"single") ||
+				mxIsClass(dataref,"int16") ||
+				mxIsClass(dataref,"int8") ||
 				mxIsClass(dataref,"uint8")){
 		/*Check dataref is not pointing to NaN: */
@@ -56,56 +55,5 @@
 }
 /*}}}*/
-/*FUNCTION FetchData(double** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref){{{*/
-void FetchData(double** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref){
-
-	int     outmatrix_numel,outmatrix_ndims;
-	double *outmatrix       = NULL;
-	int    *outmatrix_size  = NULL;
-
-	if(mxIsEmpty(dataref) ){
-		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
-		outmatrix_numel = 0;
-		outmatrix_ndims = 0;
-		outmatrix_size  = NULL;
-		outmatrix       = NULL;
-	}
-	else if( mxIsClass(dataref,"double") || 
-				mxIsClass(dataref,"single") || 
-				mxIsClass(dataref,"int16") || 
-				mxIsClass(dataref,"int8") || 
-				mxIsClass(dataref,"uint8")){
-
-		/*Check dataref is not pointing to NaN: */
-		if (mxIsNaN(*(mxGetPr(dataref))) && (mxGetNumberOfElements(dataref)==1)){
-			outmatrix_numel = 0;
-			outmatrix_ndims = 0;
-			outmatrix_size  = NULL;
-			outmatrix       = NULL;
-		}
-		else{
-			if(!mxIsClass(dataref,"double") && !mxIsClass(dataref,"single")){
-				_printf_("Warning: converting matlab data from '" << mxGetClassName(dataref) << "' to 'double'\n");
-			}
-			/*Convert matlab n-dim array to double* matrix: */
-			_error_("not supported");
-			//MatlabNArrayToNArray(&outmatrix,&outmatrix_numel,&outmatrix_ndims,&outmatrix_size,dataref);
-		}
-	}
-	else{
-		/*This is an error: we don't have the correct input!: */
-		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
-	}
-
-	/*Assign output pointers:*/
-	*pmatrix=outmatrix;
-	if (pnumel)*pnumel=outmatrix_numel;
-	if (pndims)*pndims=outmatrix_ndims;
-	if (psize )*psize =outmatrix_size;
-	else xDelete<int>(outmatrix_size);
-
-}
-/*}}}*/
-/*FUNCTION FetchData(int** pmatrix,int* pM,int *pN,const mxArray* dataref){{{*/
-void FetchData(int** pmatrix,int* pM,int *pN,const mxArray* dataref){
+void FetchData(int** pmatrix,int* pM,int *pN,const mxArray* dataref){/*{{{*/
 
 	int     i,outmatrix_rows,outmatrix_cols;
@@ -119,8 +67,8 @@
 		outmatrix=NULL;
 	}
-	else if( mxIsClass(dataref,"double") || 
-				mxIsClass(dataref,"single") || 
-				mxIsClass(dataref,"int16") || 
-				mxIsClass(dataref,"int8") || 
+	else if( mxIsClass(dataref,"double") ||
+				mxIsClass(dataref,"single") ||
+				mxIsClass(dataref,"int16") ||
+				mxIsClass(dataref,"int8") ||
 				mxIsClass(dataref,"uint8")){
 
@@ -154,6 +102,5 @@
 }
 /*}}}*/
-/*FUNCTION FetchData(bool** pmatrix,int* pM,int *pN,const mxArray* dataref){{{*/
-void FetchData(bool** pmatrix,int* pM,int *pN,const mxArray* dataref){
+void FetchData(bool** pmatrix,int* pM,int *pN,const mxArray* dataref){/*{{{*/
 
 	int     i,outmatrix_rows,outmatrix_cols;
@@ -196,73 +143,5 @@
 }
 /*}}}*/
-/*FUNCTION FetchData(bool** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref){{{*/
-void FetchData(bool** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref){
-
-	int      i;
-	int      outmatrix_numel,outmatrix_ndims;
-	int*     outmatrix_size=NULL;
-	double*  doublematrix=NULL;
-	bool*    outmatrix=NULL;
-
-	if(mxIsEmpty(dataref) ){
-		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
-		outmatrix_numel=0;
-		outmatrix_ndims=0;
-		outmatrix_size =NULL;
-		outmatrix=NULL;
-	}
-	else if (mxIsClass(dataref,"logical") ){
-
-		/*Check dataref is not pointing to NaN: */
-		if ( mxIsNaN(*((bool*)mxGetData(dataref))) && (mxGetNumberOfElements(dataref)==1) ){
-			outmatrix_numel=0;
-			outmatrix_ndims=0;
-			outmatrix_size =NULL;
-			outmatrix=NULL;
-		}
-		else{
-
-			/*Convert matlab n-dim array to bool* matrix: */
-			_error_("not supported");
-			//MatlabNArrayToNArray(&outmatrix,&outmatrix_numel,&outmatrix_ndims,&outmatrix_size,dataref);
-		}
-	}
-	else if (mxIsClass(dataref,"double") ){
-
-		/*Check dataref is not pointing to NaN: */
-		if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetNumberOfElements(dataref)==1) ){
-			outmatrix_numel=0;
-			outmatrix_ndims=0;
-			outmatrix_size =NULL;
-			outmatrix=NULL;
-		}
-		else{
-
-			/*Convert matlab n-dim array to double* matrix: */
-			_error_("not supported");
-			//MatlabNArrayToNArray(&doublematrix,&outmatrix_numel,&outmatrix_ndims,&outmatrix_size,dataref);
-
-			/*Convert double matrix into bool matrix: */
-			outmatrix=xNew<bool>(outmatrix_numel);
-			for(i=0;i<outmatrix_numel;i++)outmatrix[i]=(bool)doublematrix[i];
-			xDelete<double>(doublematrix);
-		}
-	}
-	else{
-		/*This is an error: we don't have the correct input!: */
-		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
-	}
-
-	/*Assign output pointers:*/
-	*pmatrix=outmatrix;
-	if (pnumel)*pnumel=outmatrix_numel;
-	if (pndims)*pndims=outmatrix_ndims;
-	if (psize )*psize =outmatrix_size;
-	else xDelete<int>(outmatrix_size);
-
-}
-/*}}}*/
-/*FUNCTION FetchData(double** pvector,int* pM,const mxArray* dataref){{{*/
-void FetchData(double** pvector,int* pM,const mxArray* dataref){
+void FetchData(double** pvector,int* pM,const mxArray* dataref){/*{{{*/
 
 	double* outvector=NULL;
@@ -285,6 +164,5 @@
 }
 /*}}}*/
-/*FUNCTION FetchData(int** pvector,int* pM,const mxArray* dataref){{{*/
-void FetchData(int** pvector,int* pM,const mxArray* dataref){
+void FetchData(int** pvector,int* pM,const mxArray* dataref){/*{{{*/
 
 	int    i;
@@ -317,6 +195,5 @@
 }
 /*}}}*/
-/*FUNCTION FetchData(bool** pvector,int* pM,const mxArray* dataref){{{*/
-void FetchData(bool** pvector,int* pM,const mxArray* dataref){
+void FetchData(bool** pvector,int* pM,const mxArray* dataref){/*{{{*/
 
 	int    i;
@@ -349,6 +226,5 @@
 }
 /*}}}*/
-/*FUNCTION FetchData(float** pvector,int* pM,const mxArray* dataref){{{*/
-void FetchData(float** pvector,int* pM,const mxArray* dataref){
+void FetchData(float** pvector,int* pM,const mxArray* dataref){/*{{{*/
 
 	int    i;
@@ -381,6 +257,5 @@
 }
 /*}}}*/
-/*FUNCTION FetchData(char** pstring,const mxArray* dataref){{{*/
-void FetchData(char** pstring,const mxArray* dataref){
+void FetchData(char** pstring,const mxArray* dataref){/*{{{*/
 
 	char* outstring=NULL;
@@ -402,40 +277,5 @@
 	*pstring=outstring;
 }/*}}}*/
-/*FUNCTION FetchData(char** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref){{{*/
-void FetchData(char** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref){
-
-	int      outmatrix_numel,outmatrix_ndims;
-	int*     outmatrix_size=NULL;
-	char*    outmatrix=NULL;
-
-	if(mxIsEmpty(dataref) ){
-		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
-		outmatrix_numel=0;
-		outmatrix_ndims=0;
-		outmatrix_size =NULL;
-		outmatrix=NULL;
-	}
-	else if (mxIsClass(dataref,"char") ){
-
-		/*Convert matlab n-dim array to char* matrix: */
-		_error_("not supported");
-		//MatlabNArrayToNArray(&outmatrix,&outmatrix_numel,&outmatrix_ndims,&outmatrix_size,dataref);
-	}
-	else{
-		/*This is an error: we don't have the correct input!: */
-		_error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
-	}
-
-	/*Assign output pointers:*/
-	*pmatrix=outmatrix;
-	if (pnumel)*pnumel=outmatrix_numel;
-	if (pndims)*pndims=outmatrix_ndims;
-	if (psize )*psize =outmatrix_size;
-	else xDelete<int>(outmatrix_size);
-
-}
-/*}}}*/
-/*FUNCTION FetchData(double* pscalar,const mxArray* dataref){{{*/
-void FetchData(double* pscalar,const mxArray* dataref){
+void FetchData(double* pscalar,const mxArray* dataref){/*{{{*/
 
 	double scalar;
@@ -453,6 +293,5 @@
 }
 /*}}}*/
-/*FUNCTION FetchData(int* pinteger,const mxArray* dataref){{{*/
-void FetchData(int* pinteger,const mxArray* dataref){
+void FetchData(int* pinteger,const mxArray* dataref){/*{{{*/
 
 	int integer;
@@ -470,6 +309,5 @@
 }
 /*}}}*/
-/*FUNCTION FetchData(bool* pboolean,const mxArray* dataref){{{*/
-void FetchData(bool* pboolean,const mxArray* dataref){
+void FetchData(bool* pboolean,const mxArray* dataref){/*{{{*/
 
 	bool* mxbool_ptr=NULL;
@@ -489,6 +327,5 @@
 
 /*ISSM objects*/
-/*FUNCTION FetchData(BamgGeom** pbamggeom,const mxArray* dataref){{{*/
-void FetchData(BamgGeom** pbamggeom,const mxArray* dataref){
+void FetchData(BamgGeom** pbamggeom,const mxArray* dataref){/*{{{*/
 
 	/*Initialize output*/
@@ -508,6 +345,5 @@
 }
 /*}}}*/
-/*FUNCTION FetchData(BamgMesh** pbamgmesh,const mxArray* dataref){{{*/
-void FetchData(BamgMesh** pbamgmesh,const mxArray* dataref){
+void FetchData(BamgMesh** pbamgmesh,const mxArray* dataref){/*{{{*/
 
 	/*Initialize output*/
@@ -528,6 +364,5 @@
 }
 /*}}}*/
-/*FUNCTION FetchData(BamgOpts** pbamgopts,const mxArray* dataref){{{*/
-void FetchData(BamgOpts** pbamgopts,const mxArray* dataref){
+void FetchData(BamgOpts** pbamgopts,const mxArray* dataref){/*{{{*/
 
 	/*Initialize output*/
@@ -558,5 +393,5 @@
 	FetchData(&bamgopts->hminVertices,&bamgopts->hminVerticesSize[0],&bamgopts->hminVerticesSize[1],mxGetField(dataref,0,"hminVertices"));
 	FetchData(&bamgopts->hmaxVertices,&bamgopts->hmaxVerticesSize[0],&bamgopts->hmaxVerticesSize[1],mxGetField(dataref,0,"hmaxVertices"));
-	FetchData(&bamgopts->hVertices,&bamgopts->hVerticesSize[0],&bamgopts->hVerticesSize[1],mxGetField(dataref,0,"hVertices"));
+	FetchData(&bamgopts->hVertices,&bamgopts->hVerticesLength,mxGetField(dataref,0,"hVertices"));
 	FetchData(&bamgopts->metric,&bamgopts->metricSize[0],&bamgopts->metricSize[1],mxGetField(dataref,0,"metric"));
 	FetchData(&bamgopts->field,&bamgopts->fieldSize[0],&bamgopts->fieldSize[1],mxGetField(dataref,0,"field"));
@@ -570,6 +405,5 @@
 }
 /*}}}*/
-/*FUNCTION FetchData(Options** poptions,const mxArray** pdataref){{{*/
-void FetchData(Options** poptions,int istart, int nrhs,const mxArray** pdataref){
+void FetchData(Options** poptions,int istart, int nrhs,const mxArray** pdataref){/*{{{*/
 
 	char   *name   = NULL;
@@ -595,6 +429,5 @@
 }
 /*}}}*/
-/*FUNCTION FetchData(Contours** pcontours,const mxArray* dataref){{{*/
-void FetchData(Contours** pcontours,const mxArray* dataref){
+void FetchData(Contours** pcontours,const mxArray* dataref){/*{{{*/
 
 	int             numcontours,index,test1,test2;
@@ -603,5 +436,5 @@
 	Contour<double> *contouri    = NULL;
 
-	if (mxIsClass(dataref,"char")){
+	if(mxIsClass(dataref,"char")){
 		FetchData(&contourname,dataref);
 		contours=ExpRead<double>(contourname);
@@ -674,112 +507,58 @@
 
 /*Toolkit*/
-/*FUNCTION MatlabMatrixToDoubleMatrix {{{*/
-int MatlabMatrixToDoubleMatrix(double** pmatrix,int* pmatrix_rows,int* pmatrix_cols,const mxArray* mxmatrix){
-
-	int        i,j,count,rows,cols;
-
-	/*output: */
-	double* matrix=NULL;
-
-	/*matlab indices: */
-	mwIndex*    ir=NULL;
-	mwIndex*    jc=NULL;
-
-	/*Ok, first check if we are dealing with a sparse or full matrix: */
-	if (mxIsSparse(mxmatrix)){
+int MatlabMatrixToDoubleMatrix(double** pmatrix,int* pmatrix_rows,int* pmatrix_cols,const mxArray* mxmatrix){/*{{{*/
+
+	/*Get Matrix size*/
+	int rows=mxGetM(mxmatrix);
+	int cols=mxGetN(mxmatrix);
+
+	/*Return of Matrix is empty*/
+	if(rows*cols == 0){
+		*pmatrix      = NULL;
+		*pmatrix_rows = rows;
+		*pmatrix_cols = cols;
+		return 1;
+	}
+
+   /*Initialize output*/
+   double* matrix=xNewZeroInit<double>(rows*cols);
+
+	/*First check if we are dealing with a sparse matrix: */
+	if(mxIsSparse(mxmatrix)){
 
 		/*Dealing with sparse matrix: recover size first: */
 		double* pmxmatrix=(double*)mxGetPr(mxmatrix);
-		rows=mxGetM(mxmatrix);
-		cols=mxGetN(mxmatrix);
-
-		if(rows*cols){
-			matrix=xNewZeroInit<double>(rows*cols);
-
-			/*Now, get ir,jc and pr: */
-			ir=mxGetIr(mxmatrix);
-			jc=mxGetJc(mxmatrix);
-
-			/*Now, start inserting data into double* matrix: */
-			count=0;
-			for(i=0;i<cols;i++){
-				for(j=0;j<(jc[i+1]-jc[i]);j++){
-					matrix[rows*ir[count]+i]=pmxmatrix[count];
-					count++;
-				}
-			}
-		}
-
-	}
+
+      /*Now, get ir,jc and pr: */
+      mwIndex* ir=mxGetIr(mxmatrix);
+      mwIndex* jc=mxGetJc(mxmatrix);
+
+      /*Now, start inserting data into double* matrix: */
+      int count=0;
+      for(int i=0;i<cols;i++){
+         for(int j=0;j<(jc[i+1]-jc[i]);j++){
+            matrix[rows*ir[count]+i]=pmxmatrix[count];
+            count++;
+         }
+      }
+   }
 	else if(mxIsClass(mxmatrix,"double")){
-		/*Dealing with dense matrix: recover pointer and size: */
 		double* pmxmatrix=(double*)mxGetPr(mxmatrix);
-		rows=mxGetM(mxmatrix);
-		cols=mxGetN(mxmatrix);
-
-		/*Create serial matrix: */
-		if(rows*cols){
-			matrix=xNewZeroInit<double>(rows*cols);
-
-			for(i=0;i<rows;i++){
-				for(j=0;j<cols;j++){
-					matrix[cols*i+j]=(double)pmxmatrix[rows*j+i];
-				}
-			}
-		}
+      for(int i=0;i<rows;i++) for(int j=0;j<cols;j++) matrix[cols*i+j]=(double)pmxmatrix[rows*j+i];
 	}
 	else if(mxIsClass(mxmatrix,"single")){
-		/*Dealing with dense matrix: recover pointer and size: */
 		float *pmxmatrix=(float*)mxGetPr(mxmatrix);
-		rows=mxGetM(mxmatrix);
-		cols=mxGetN(mxmatrix);
-
-		/*Create serial matrix: */
-		if(rows*cols){
-			matrix=xNewZeroInit<double>(rows*cols);
-
-			for(i=0;i<rows;i++){
-				for(j=0;j<cols;j++){
-					matrix[cols*i+j]=(double)pmxmatrix[rows*j+i];
-				}
-			}
-		}
+      for(int i=0;i<rows;i++) for(int j=0;j<cols;j++) matrix[cols*i+j]=(double)pmxmatrix[rows*j+i];
 	}
 	else if(mxIsClass(mxmatrix,"int16")){
-		/*Dealing with dense matrix: recover pointer and size: */
 		short int *pmxmatrix=(short*)mxGetPr(mxmatrix);
-		rows=mxGetM(mxmatrix);
-		cols=mxGetN(mxmatrix);
-
-		/*Create serial matrix: */
-		if(rows*cols){
-			matrix=xNewZeroInit<double>(rows*cols);
-
-			for(i=0;i<rows;i++){
-				for(j=0;j<cols;j++){
-					matrix[cols*i+j]=(double)pmxmatrix[rows*j+i];
-				}
-			}
-		}
+      for(int i=0;i<rows;i++) for(int j=0;j<cols;j++) matrix[cols*i+j]=(double)pmxmatrix[rows*j+i];
 	}
 	else if(mxIsClass(mxmatrix,"uint8")){
-		/*Dealing with dense matrix: recover pointer and size: */
-		char *pmxmatrix=(char*)mxGetPr(mxmatrix);
-		rows=mxGetM(mxmatrix);
-		cols=mxGetN(mxmatrix);
-
-		/*Create serial matrix: */
-		if(rows*cols){
-			matrix=xNewZeroInit<double>(rows*cols);
-
-			for(i=0;i<rows;i++){
-				for(j=0;j<cols;j++){
-					matrix[cols*i+j]=(double)pmxmatrix[rows*j+i];
-				}
-			}
-		}
-	}
-	else{
-		_error_("Matlab matrix type Not implemented yet");
+      char *pmxmatrix=(char*)mxGetPr(mxmatrix);
+      for(int i=0;i<rows;i++) for(int j=0;j<cols;j++) matrix[cols*i+j]=(double)pmxmatrix[rows*j+i];
+	}
+	else{
+		_error_("Matlab matrix type "<<mxGetClassName(mxmatrix)<<" Not implemented yet");
 	}
 
@@ -791,6 +570,5 @@
 	return 1;
 }/*}}}*/
-/*FUNCTION mxGetAssignedField{{{*/
-mxArray* mxGetAssignedField(const mxArray* pmxa_array,int number,const char* field){
+mxArray* mxGetAssignedField(const mxArray* pmxa_array,int number,const char* field){/*{{{*/
 
 	/*Output*/
@@ -825,91 +603,79 @@
 }/*}}}*/
 
-GenericOption<double>* OptionDoubleParse( char* name, const mxArray* prhs[]){ /*{{{*/
-
-	GenericOption<double> *odouble = NULL;
-
-	/*check and parse the name  */
-	odouble=new GenericOption<double>();
-	odouble->name =xNew<char>(strlen(name)+1);
-	memcpy(odouble->name,name,(strlen(name)+1)*sizeof(char));
-	FetchData(&odouble->value,prhs[0]);
-	odouble->numel=1;
-	odouble->ndims=1;
-	odouble->size=NULL;
-
-	return(odouble);
+/*Options*/
+Option* OptionParse(char* name, const mxArray* prhs[]){ /*{{{*/
+
+	/*Initialize output*/
+	Option  *option = NULL;
+
+	/*parse the value according to the matlab data type  */
+	if (mxIsClass(prhs[0],"double")  && (mxGetNumberOfElements(prhs[0])==1)){
+		option=(Option*)OptionDoubleParse(name,prhs);
+	}
+	else if(mxIsClass(prhs[0],"double")  && (mxGetNumberOfElements(prhs[0])>1)){
+		option=(Option*)OptionDoubleArrayParse(name,prhs);
+	}
+	else if(mxIsClass(prhs[0],"char")){
+		option=(Option*)OptionCharParse(name,prhs);
+	}
+	else {
+		_error_("Second argument value of option \""<< name <<"\" is of unrecognized class \""<< mxGetClassName(prhs[0]) <<"\".");
+	}
+
+	return option;
 }/*}}}*/
-GenericOption<double*>* OptionDoubleArrayParse( char* name, const mxArray* prhs[]){ /*{{{*/
-
-	GenericOption<double*> *odouble = NULL;
-
-	/*check and parse the name  */
-	odouble=new GenericOption<double*>();
-	odouble->name =xNew<char>(strlen(name)+1);
-	memcpy(odouble->name,name,(strlen(name)+1)*sizeof(char));
+GenericOption<double>*  OptionDoubleParse(char* name, const mxArray* prhs[]){ /*{{{*/
+
+	/*Initialize option*/
+	GenericOption<double>* option=new GenericOption<double>();
+
+	/*Copy name*/
+	option->name =xNew<char>(strlen(name)+1);
+	memcpy(option->name,name,(strlen(name)+1)*sizeof(char));
+
+	/*Fetch data and initialize size*/
+	FetchData(&option->value,prhs[0]);
+   option->size[0] = 1;
+	option->size[1] = 1;
+
+	return option;
+}/*}}}*/
+GenericOption<double*>* OptionDoubleArrayParse(char* name, const mxArray* prhs[]){ /*{{{*/
+
+	/*Initialize option*/
+	GenericOption<double*> * option=new GenericOption<double*>();
+
+	/*Copy name*/
+	option->name =xNew<char>(strlen(name)+1);
+	memcpy(option->name,name,(strlen(name)+1)*sizeof(char));
 
 	/*check and parse the value  */
 	if (!mxIsClass(prhs[0],"double")){
-		_error_("Value of option \"" << odouble->name  << "\" must be class \"double\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
-	}
-	FetchData(&odouble->value,&odouble->numel,&odouble->ndims,&odouble->size,prhs[0]);
-
-	return(odouble);
+		_error_("Value of option \"" << option->name  << "\" must be class \"double\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+	}
+
+	/*Fetch data and initialize size*/
+   FetchData(&option->value,&option->size[0],&option->size[1],prhs[0]);
+
+	return option;
 }/*}}}*/
-GenericOption<bool*>* OptionLogicalParse( char* name, const mxArray* prhs[]){ /*{{{*/
-
-	GenericOption<bool*> *ological = NULL;
-
-	/*check and parse the name  */
-	ological=new GenericOption<bool*>();
-	ological->name =xNew<char>(strlen(name)+1);
-	memcpy(ological->name,name,(strlen(name)+1)*sizeof(char));
+GenericOption<char*>*   OptionCharParse(char* name, const mxArray* prhs[]){ /*{{{*/
+
+	/*Initialize option*/
+	GenericOption<char*>* option=new GenericOption<char*>();
+
+	/*Copy name*/
+	option->name =xNew<char>(strlen(name)+1);
+	memcpy(option->name,name,(strlen(name)+1)*sizeof(char));
 
 	/*check and parse the value  */
-	if (!mxIsClass(prhs[0],"logical")){
-		_error_("Value of option \"" << ological->name  << "\" must be class \"logical\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
-	}
-	FetchData(&ological->value,&ological->numel,&ological->ndims,&ological->size,prhs[0]);
-
-	return(ological);
-}/*}}}*/
-GenericOption<char*>* OptionCharParse( char* name, const mxArray* prhs[]){ /*{{{*/
-
-	/*check and parse the name  */
-	GenericOption<char*>* ochar=new GenericOption<char*>();
-	ochar->name =xNew<char>(strlen(name)+1);
-	memcpy(ochar->name,name,(strlen(name)+1)*sizeof(char));
-
-	/*check and parse the value  */
-	if (!mxIsClass(prhs[0],"char")){
-		_error_("Value of option \"" << ochar->name  << "\" must be class \"char\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
-	}
-	//FetchData(&ochar->value,&ochar->numel,&ochar->ndims,&ochar->size,prhs[0]);
-	FetchData(&ochar->value,prhs[0]);
-	ochar->numel = strlen(name);
-	ochar->ndims = 2;
-	ochar->size = xNew<int>(2);
-	ochar->size[0] = ochar->numel;
-	ochar->size[1] = 1;
-
-	return(ochar);
-}/*}}}*/
-Option* OptionParse(char* name, const mxArray* prhs[]){ /*{{{*/
-
-	Option  *option = NULL;
-	mxArray *lhs[1];
-
-	/*parse the value according to the matlab data type  */
-	if     (mxIsClass(prhs[0],"double")  && (mxGetNumberOfElements(prhs[0])==1))
-	 option=(Option*)OptionDoubleParse(name,prhs);
-	else if(mxIsClass(prhs[0],"double")  && (mxGetNumberOfElements(prhs[0])!=1))
-	 option=(Option*)OptionDoubleArrayParse(name,prhs);
-	else if(mxIsClass(prhs[0],"logical"))
-	 option=(Option*)OptionLogicalParse(name,prhs);
-	else if(mxIsClass(prhs[0],"char"))
-	 option=(Option*)OptionCharParse(name,prhs);
-	else {
-		_error_("Second argument value of option \""<< name <<"\" is of unrecognized class \""<< mxGetClassName(prhs[0]) <<"\".");
-	}
+	if(!mxIsClass(prhs[0],"char")){
+		_error_("Value of option \"" << option->name  << "\" must be class \"char\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
+	}
+
+	/*Fetch data and initialize size*/
+	FetchData(&option->value,prhs[0]);
+	option->size[0] = strlen(name);
+	option->size[1] = 1;
 
 	return(option);
Index: /issm/trunk/src/wrappers/matlab/io/matlabio.h
===================================================================
--- /issm/trunk/src/wrappers/matlab/io/matlabio.h	(revision 24312)
+++ /issm/trunk/src/wrappers/matlab/io/matlabio.h	(revision 24313)
@@ -36,8 +36,6 @@
 
 void FetchData(double** pmatrix,int* pM,int *pN,const mxArray* dataref);
-void FetchData(double** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref);
 void FetchData(int** pmatrix,int* pM,int *pN,const mxArray* dataref);
 void FetchData(bool** pmatrix,int* pM,int *pN,const mxArray* dataref);
-void FetchData(bool** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref);
 void FetchData(int** pvector,int* pM,const mxArray* dataref);
 void FetchData(float** pvector,int* pM,const mxArray* dataref);
@@ -45,5 +43,4 @@
 void FetchData(bool** pvector,int* pM,const mxArray* dataref);
 void FetchData(char** pstring,const mxArray* dataref);
-void FetchData(char** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref);
 void FetchData(double* pscalar,const mxArray* dataref);
 void FetchData(int* pinteger,const mxArray* dataref);
@@ -57,8 +54,7 @@
 
 Option* OptionParse(char* name, const mxArray* prhs[]);
-GenericOption<double>*    OptionDoubleParse( char* name, const mxArray* prhs[]);
-GenericOption<double*>*   OptionDoubleArrayParse( char* name, const mxArray* prhs[]);
-GenericOption<bool*>*     OptionLogicalParse( char* name, const mxArray* prhs[]);
-GenericOption<char*>*     OptionCharParse( char* name, const mxArray* prhs[]);
+GenericOption<double>*  OptionDoubleParse(char* name, const mxArray* prhs[]);
+GenericOption<double*>* OptionDoubleArrayParse(char* name, const mxArray* prhs[]);
+GenericOption<char*>*   OptionCharParse(char* name, const mxArray* prhs[]);
 
 mxArray* mxGetAssignedField(const mxArray* pmxa_array,int number, const char* field);
Index: /issm/trunk/src/wrappers/python/Makefile.am
===================================================================
--- /issm/trunk/src/wrappers/python/Makefile.am	(revision 24312)
+++ /issm/trunk/src/wrappers/python/Makefile.am	(revision 24313)
@@ -34,4 +34,5 @@
 						ContourToNodes_python.la\
 						ElementConnectivity_python.la\
+						ExpToLevelSet_python.la\
 						InterpFromMeshToMesh2d_python.la\
 						InterpFromMeshToMesh3d_python.la\
@@ -124,4 +125,9 @@
 ElementConnectivity_python_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(GSLLIB) $(PROJ4LIB)
 
+ExpToLevelSet_python_la_SOURCES = ../ExpToLevelSet/ExpToLevelSet.cpp
+ExpToLevelSet_python_la_CXXFLAGS = ${AM_CXXFLAGS}
+ExpToLevelSet_python_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(GSLLIB) $(PROJ4LIB)
+
+
 InterpFromMeshToMesh2d_python_la_SOURCES = ../InterpFromMeshToMesh2d/InterpFromMeshToMesh2d.cpp
 InterpFromMeshToMesh2d_python_la_CXXFLAGS = ${AM_CXXFLAGS}
Index: /issm/trunk/src/wrappers/python/io/FetchPythonData.cpp
===================================================================
--- /issm/trunk/src/wrappers/python/io/FetchPythonData.cpp	(revision 24312)
+++ /issm/trunk/src/wrappers/python/io/FetchPythonData.cpp	(revision 24313)
@@ -4,5 +4,5 @@
 
 #ifdef HAVE_CONFIG_H
-	#include <config.h>
+#include <config.h>
 #else
 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
@@ -19,16 +19,26 @@
 void FetchData(double* pscalar,PyObject* py_float){
 
-	double dscalar;
+   double dscalar;
 
 	/*return internal value: */
-	if      (PyFloat_Check(py_float))
+   #if _PYTHON_MAJOR_ == 3
+   if (PyFloat_Check(py_float))
+      dscalar=PyFloat_AsDouble(py_float);
+   else if (PyLong_Check(py_float))
+		dscalar=(double)PyLong_AsLong(py_float);
+	else if (PyBool_Check(py_float))
+		dscalar=(double)PyLong_AsLong(py_float);
+	else if (PyTuple_Check(py_float) && (int)PyTuple_Size(py_float)==1)
+		FetchData(&dscalar,PyTuple_GetItem(py_float,(Py_ssize_t)0));
+	else if (PyList_Check(py_float) && (int)PyList_Size(py_float)==1)
+		FetchData(&dscalar,PyList_GetItem(py_float,(Py_ssize_t)0));
+	else
+		_error_("unrecognized float type py3 in input!");
+
+	#else
+	if (PyFloat_Check(py_float))
 		dscalar=PyFloat_AsDouble(py_float);
-	else if (PyLong_Check(py_float)){
-		#if _PYTHON_MAJOR_ == 3
-		dscalar=(double)PyLong_AsLong(py_float);
-		#else
+	else if (PyLong_Check(py_float))
 		dscalar=PyLong_AsDouble(py_float);
-		#endif
-	}
 	else if (PyInt_Check(py_float))
 		dscalar=(double)PyInt_AsLong(py_float);
@@ -40,6 +50,6 @@
 		FetchData(&dscalar,PyList_GetItem(py_float,(Py_ssize_t)0));
 	else
-		_error_("unrecognized float type in input!");
-
+		_error_("unrecognized float type in py2 input!");
+	#endif
 	/*output: */
 	*pscalar=dscalar;
@@ -52,24 +62,33 @@
 
 	/*return internal value: */
+	#if _PYTHON_MAJOR_ == 3
 	if  (PyFloat_Check(py_float))
-	 fscalar=PyFloat_AsDouble(py_float);
-	else if (PyLong_Check(py_float)){
-		#if _PYTHON_MAJOR_ == 3
+      fscalar=PyFloat_AsDouble(py_float);
+	else if (PyLong_Check(py_float))
 		fscalar=(float)PyLong_AsLong(py_float);
-		#else
+	else if (PyBool_Check(py_float))
+		fscalar=(float)PyLong_AsLong(py_float);
+	else if (PyTuple_Check(py_float) && (int)PyTuple_Size(py_float)==1)
+		FetchData(&fscalar,PyTuple_GetItem(py_float,(Py_ssize_t)0));
+	else if (PyList_Check(py_float) && (int)PyList_Size(py_float)==1)
+		FetchData(&fscalar,PyList_GetItem(py_float,(Py_ssize_t)0));
+	else
+		_error_("unrecognized float type in input!");
+	#else
+	if  (PyFloat_Check(py_float))
+		fscalar=PyFloat_AsDouble(py_float);
+	else if (PyLong_Check(py_float))
 		fscalar=(float)PyLong_AsDouble(py_float);
-		#endif
-	}
 	else if (PyInt_Check(py_float))
-	 fscalar=(float)PyInt_AsLong(py_float);
+		fscalar=(float)PyInt_AsLong(py_float);
 	else if (PyBool_Check(py_float))
-	 fscalar=(float)PyLong_AsLong(py_float);
+		fscalar=(float)PyLong_AsLong(py_float);
 	else if (PyTuple_Check(py_float) && (int)PyTuple_Size(py_float)==1)
-	 FetchData(&fscalar,PyTuple_GetItem(py_float,(Py_ssize_t)0));
+		FetchData(&fscalar,PyTuple_GetItem(py_float,(Py_ssize_t)0));
 	else if (PyList_Check(py_float) && (int)PyList_Size(py_float)==1)
-	 FetchData(&fscalar,PyList_GetItem(py_float,(Py_ssize_t)0));
+		FetchData(&fscalar,PyList_GetItem(py_float,(Py_ssize_t)0));
 	else
-	 _error_("unrecognized float type in input!");
-
+		_error_("unrecognized float type in input!");
+	#endif
 	/*output: */
 	*pscalar=fscalar;
@@ -82,5 +101,20 @@
 
 	/*return internal value: */
-	if      (PyLong_Check(py_long))
+	#if _PYTHON_MAJOR_ == 3
+	if (PyLong_Check(py_long))
+		iscalar=(int)PyLong_AsLong(py_long);
+	else if (PyFloat_Check(py_long))
+		iscalar=(int)PyFloat_AsDouble(py_long);
+	else if (PyBool_Check(py_long))
+		iscalar=(int)PyLong_AsLong(py_long);
+	else if (PyTuple_Check(py_long) && (int)PyTuple_Size(py_long)==1)
+		FetchData(&iscalar,PyTuple_GetItem(py_long,(Py_ssize_t)0));
+	else if (PyList_Check(py_long) && (int)PyList_Size(py_long)==1)
+		FetchData(&iscalar,PyList_GetItem(py_long,(Py_ssize_t)0));
+	else
+		_error_("unrecognized long type in input!");
+
+	#else
+	if (PyLong_Check(py_long))
 		iscalar=(int)PyLong_AsLong(py_long);
 	else if (PyInt_Check(py_long))
@@ -96,5 +130,5 @@
 	else
 		_error_("unrecognized long type in input!");
-
+	#endif
 	/*output: */
 	*pscalar=iscalar;
@@ -107,4 +141,19 @@
 
 	/*return internal value: */
+	#if _PYTHON_MAJOR_ == 3
+	if (PyBool_Check(py_boolean))
+		bscalar=(bool)PyLong_AsLong(py_boolean);
+	else if (PyLong_Check(py_boolean))
+		bscalar=(bool)PyLong_AsLong(py_boolean);
+	else if (PyLong_Check(py_boolean))
+		bscalar=(bool)PyLong_AsLong(py_boolean);
+	else if (PyTuple_Check(py_boolean) && (int)PyTuple_Size(py_boolean)==1)
+		FetchData(&bscalar,PyTuple_GetItem(py_boolean,(Py_ssize_t)0));
+	else if (PyList_Check(py_boolean) && (int)PyList_Size(py_boolean)==1)
+		FetchData(&bscalar,PyList_GetItem(py_boolean,(Py_ssize_t)0));
+	else
+		_error_("unrecognized boolean type in input!");
+
+	#else
 	if      (PyBool_Check(py_boolean))
 		bscalar=(bool)PyLong_AsLong(py_boolean);
@@ -121,5 +170,5 @@
 	else
 		_error_("unrecognized boolean type in input!");
-
+	#endif
 	/*output: */
 	*pscalar=bscalar;
@@ -143,8 +192,8 @@
 	PyObject* py_matrix2=NULL;
 
-	if     (PyArray_Check((PyArrayObject*)py_matrix)) {
+	if (PyArray_Check((PyArrayObject*)py_matrix)) {
 		/*retrieve dimensions: */
 		ndim=PyArray_NDIM((const PyArrayObject*)py_matrix);
-		if      (ndim==2) {
+		if (ndim==2) {
 			dims=PyArray_DIMS((PyArrayObject*)py_matrix);
 			M=dims[0]; N=dims[1];
@@ -163,5 +212,5 @@
 			}
 
-			if      (PyArray_TYPE((PyArrayObject*)py_matrix) == NPY_DOUBLE) {
+			if (PyArray_TYPE((PyArrayObject*)py_matrix) == NPY_DOUBLE) {
 				/*retrieve internal value: */
 				dmatrix=(double*)PyArray_DATA((PyArrayObject*)py_matrix);
@@ -169,25 +218,5 @@
 				/*copy matrix: */
 				matrix=xNew<double>(M*N);
-//				if (PyArray_ISCONTIGUOUS((PyArrayObject*)py_matrix)) {
-					memcpy(matrix,dmatrix,(M*N)*sizeof(double));
-//				}
-
-//				else {
-//					int j,k,ipt=0;
-//					int mstride,nstride;
-//					mstride=(int)PyArray_STRIDE((PyArrayObject*)py_matrix,0)/PyArray_ITEMSIZE((PyArrayObject*)py_matrix);
-//					if (ndim > 1)
-//						nstride=(int)PyArray_STRIDE((PyArrayObject*)py_matrix,1)/PyArray_ITEMSIZE((PyArrayObject*)py_matrix);
-//					else
-//						nstride=1;
-//					for (i=0; i<M; i++) {
-//						k=i*mstride;
-//						for (j=0; j<N; j++) {
-//							matrix[ipt++]=dmatrix[k];
-//							k+=nstride;
-//						}
-//					}
-//				}
-			
+				memcpy(matrix,dmatrix,(M*N)*sizeof(double));
 			}
 
@@ -215,4 +244,40 @@
 			//if (py_matrix2) delete(py_matrix2); Not doing this for now, seems to  be creating a segfault!
 		}
+		else
+			matrix=NULL;
+	}
+	else if (PyList_Check(py_matrix)) {
+		/*retrieve dimensions: */
+		M=(int)PyList_Size(py_matrix);
+		N=1;
+		if (M) {
+			matrix=xNew<double>(M);
+			for (int index = 0; index < M; index++) {
+				PyObject *item;
+				item = PyList_GetItem(py_matrix, index);
+				if ((int)PyList_Size(item)>1)
+					_error_("2D lists are not suported");
+				FetchData(&(matrix[index]),item);
+			}
+		}
+		//if (py_matrix2) delete(py_matrix2); Not doing this for now, seems to  be creating a segfault!
+		else
+			matrix=NULL;
+	}
+	else if (PyTuple_Check(py_matrix)) {
+		/*retrieve dimensions: */
+		M=(int)PyTuple_Size(py_matrix);
+		N=1;
+		if (M) {
+			matrix=xNew<double>(M);
+			for (int index = 0; index < M; index++) {
+				PyObject *item;
+				item = PyTuple_GetItem(py_matrix, index);
+				if ((int)PyTuple_Size(item)>1)
+					_error_("2D tuple are not suported");
+				FetchData(&(matrix[index]),item);
+			}
+		}
+		//if (py_matrix2) delete(py_matrix2); Not doing this for now, seems to  be creating a segfault!
 		else
 			matrix=NULL;
@@ -307,4 +372,39 @@
 			matrix=NULL;
 	}
+	else if (PyList_Check(py_matrix)) {
+		/*retrieve dimensions: */
+		M=(int)PyList_Size(py_matrix);
+		N=1;
+		if (M) {
+			matrix=xNew<int>(M);
+			for (int index = 0; index < M; index++) {
+				PyObject *item;
+				item = PyList_GetItem(py_matrix, index);
+				if ((int)PyList_Size(item)>1)
+					_error_("2D lists are not suported");
+				FetchData(&(matrix[index]),item);
+			}
+		}
+		else
+			matrix=NULL;
+	}
+	else if (PyTuple_Check(py_matrix)) {
+		/*retrieve dimensions: */
+		M=(int)PyTuple_Size(py_matrix);
+		N=1;
+		if (M) {
+			matrix=xNew<int>(M);
+			for (int index = 0; index < M; index++) {
+				PyObject *item;
+				item = PyTuple_GetItem(py_matrix, index);
+				if ((int)PyTuple_Size(item)>1)
+					_error_("2D tuple are not suported");
+				FetchData(&(matrix[index]),item);
+			}
+		}
+		//if (py_matrix2) delete(py_matrix2); Not doing this for now, seems to  be creating a segfault!
+		else
+			matrix=NULL;
+	}
 
 	else {
@@ -394,4 +494,41 @@
 			matrix=NULL;
 	}
+		//if (py_matrix2) delete(py_matrix2); Not doing this for now, seems to  be creating a segfault!
+
+	else if (PyList_Check(py_matrix)) {
+		/*retrieve dimensions: */
+		M=(int)PyList_Size(py_matrix);
+		N=1;
+		if (M) {
+			matrix=xNew<bool>(M);
+			for (int index = 0; index < M; index++) {
+				PyObject *item;
+				item = PyList_GetItem(py_matrix, index);
+				if ((int)PyList_Size(item)>1)
+					_error_("2D lists are not suported");
+				FetchData(&(matrix[index]),item);
+			}
+		}
+		else
+			matrix=NULL;
+	}
+	else if (PyTuple_Check(py_matrix)) {
+		/*retrieve dimensions: */
+		M=(int)PyTuple_Size(py_matrix);
+		N=1;
+		if (M) {
+			matrix=xNew<bool>(M);
+			for (int index = 0; index < M; index++) {
+				PyObject *item;
+				item = PyTuple_GetItem(py_matrix, index);
+				if ((int)PyTuple_Size(item)>1)
+					_error_("2D tuples are not suported");
+				FetchData(&(matrix[index]),item);
+			}
+		}
+		//if (py_matrix2) delete(py_matrix2); Not doing this for now, seems to  be creating a segfault!
+		else
+			matrix=NULL;
+	}
 
 	else {
@@ -429,10 +566,10 @@
 		if      (ndim==1) {
 			dims=PyArray_DIMS((PyArrayObject*)py_vector);
-			M=dims[0]; 
+			M=dims[0];
 		}
 		else if (ndim==2) {
 			dims=PyArray_DIMS((PyArrayObject*)py_vector);
 			if (dims[1]==1)
-				M=dims[0]; 
+				M=dims[0];
 			else
 				_error_("expecting an Mx1 matrix or M vector in input!");
@@ -482,4 +619,35 @@
 			*/
 		}
+		else
+			vector=NULL;
+	}
+	else if (PyList_Check(py_vector)) {
+		/*retrieve dimensions: */
+		M=(int)PyList_Size(py_vector);
+
+		if (M) {
+			vector=xNew<double>(M);
+			for (int index = 0; index < M; index++) {
+				PyObject *item;
+				item = PyList_GetItem(py_vector, index);
+				FetchData(&(vector[index]),item);
+			}
+		}
+		else
+			vector=NULL;
+	}
+	else if (PyTuple_Check(py_vector)) {
+		/*retrieve dimensions: */
+		M=(int)PyTuple_Size(py_vector);
+
+		if (M) {
+			vector=xNew<double>(M);
+			for (int index = 0; index < M; index++) {
+				PyObject *item;
+				item = PyTuple_GetItem(py_vector, index);
+				FetchData(&(vector[index]),item);
+			}
+		}
+		//if (py_matrix2) delete(py_matrix2); Not doing this for now, seems to  be creating a segfault!
 		else
 			vector=NULL;
@@ -518,10 +686,10 @@
 		if      (ndim==1) {
 			dims=PyArray_DIMS((PyArrayObject*)py_vector);
-			M=dims[0]; 
+			M=dims[0];
 		}
 		else if (ndim==2) {
 			dims=PyArray_DIMS((PyArrayObject*)py_vector);
 			if (dims[1]==1)
-			 M=dims[0]; 
+			 M=dims[0];
 			else
 			 _error_("expecting an Mx1 matrix or M vector in input!");
@@ -571,4 +739,37 @@
 			vector=NULL;
 	}
+	else if (PyList_Check(py_vector)) {
+		/*retrieve dimensions: */
+		M=(int)PyList_Size(py_vector);
+
+		if (M) {
+			vector=xNew<float>(M);
+			for (int index = 0; index < M; index++) {
+				PyObject *item;
+				item = PyList_GetItem(py_vector, index);
+				FetchData(&(vector[index]),item);
+			}
+		}
+		else
+			vector=NULL;
+	}
+
+	else if (PyTuple_Check(py_vector)) {
+		/*retrieve dimensions: */
+		M=(int)PyTuple_Size(py_vector);
+
+		if (M) {
+			vector=xNew<float>(M);
+			for (int index = 0; index < M; index++) {
+				PyObject *item;
+				item = PyTuple_GetItem(py_vector, index);
+				FetchData(&(vector[index]),item);
+			}
+		}
+		//if (py_matrix2) delete(py_matrix2); Not doing this for now, seems to  be creating a segfault!
+		else
+			vector=NULL;
+	}
+
 	else{
 		M=1;
@@ -603,10 +804,10 @@
 		if      (ndim==1) {
 			dims=PyArray_DIMS((PyArrayObject*)py_vector);
-			M=dims[0]; 
+			M=dims[0];
 		}
 		else if (ndim==2) {
 			dims=PyArray_DIMS((PyArrayObject*)py_vector);
 			if (dims[1]==1)
-				M=dims[0]; 
+				M=dims[0];
 			else
 				_error_("expecting an Mx1 matrix or M vector in input!");
@@ -654,4 +855,37 @@
 				delete(py_vector2);
 		}
+		else
+			vector=NULL;
+	}
+
+	else if (PyList_Check(py_vector)) {
+		/*retrieve dimensions: */
+		M=(int)PyList_Size(py_vector);
+
+		if (M) {
+			vector=xNew<int>(M);
+			for (int index = 0; index < M; index++) {
+				PyObject *item;
+				item = PyList_GetItem(py_vector, index);
+				FetchData(&(vector[index]),item);
+			}
+		}
+		else
+			vector=NULL;
+	}
+
+	else if (PyTuple_Check(py_vector)) {
+		/*retrieve dimensions: */
+		M=(int)PyTuple_Size(py_vector);
+
+		if (M) {
+			vector=xNew<int>(M);
+			for (int index = 0; index < M; index++) {
+				PyObject *item;
+				item = PyTuple_GetItem(py_vector, index);
+				FetchData(&(vector[index]),item);
+			}
+		}
+		//if (py_matrix2) delete(py_matrix2); Not doing this for now, seems to  be creating a segfault!
 		else
 			vector=NULL;
@@ -690,10 +924,10 @@
 		if      (ndim==1) {
 			dims=PyArray_DIMS((PyArrayObject*)py_vector);
-			M=dims[0]; 
+			M=dims[0];
 		}
 		else if (ndim==2) {
 			dims=PyArray_DIMS((PyArrayObject*)py_vector);
 			if (dims[1]==1)
-				M=dims[0]; 
+				M=dims[0];
 			else
 				_error_("expecting an Mx1 matrix or M vector in input!");
@@ -741,4 +975,35 @@
 				delete(py_vector2);
 		}
+		else
+			vector=NULL;
+	}
+	else if (PyList_Check(py_vector)) {
+		/*retrieve dimensions: */
+		M=(int)PyList_Size(py_vector);
+		if (M) {
+			vector=xNew<bool>(M);
+			for (int index = 0; index < M; index++) {
+				PyObject *item;
+				item = PyList_GetItem(py_vector, index);
+				FetchData(&(vector[index]),item);
+			}
+		}
+		else
+			vector=NULL;
+	}
+
+	else if (PyTuple_Check(py_vector)) {
+		/*retrieve dimensions: */
+		M=(int)PyTuple_Size(py_vector);
+
+		if (M) {
+			vector=xNew<bool>(M);
+			for (int index = 0; index < M; index++) {
+				PyObject *item;
+				item = PyTuple_GetItem(py_vector, index);
+				FetchData(&(vector[index]),item);
+			}
+		}
+		//if (py_matrix2) delete(py_matrix2); Not doing this for now, seems to  be creating a segfault!
 		else
 			vector=NULL;
@@ -827,5 +1092,5 @@
 	FetchData(&bamgopts->hminVertices,&bamgopts->hminVerticesSize[0],&bamgopts->hminVerticesSize[1],PyDict_GetItemString(py_dict,"hminVertices"));
 	FetchData(&bamgopts->hmaxVertices,&bamgopts->hmaxVerticesSize[0],&bamgopts->hmaxVerticesSize[1],PyDict_GetItemString(py_dict,"hmaxVertices"));
-	FetchData(&bamgopts->hVertices,&bamgopts->hVerticesSize[0],&bamgopts->hVerticesSize[1],PyDict_GetItemString(py_dict,"hVertices"));
+	FetchData(&bamgopts->hVertices,&bamgopts->hVerticesLength,PyDict_GetItemString(py_dict,"hVertices"));
 	FetchData(&bamgopts->metric,&bamgopts->metricSize[0],&bamgopts->metricSize[1],PyDict_GetItemString(py_dict,"metric"));
 	FetchData(&bamgopts->field,&bamgopts->fieldSize[0],&bamgopts->fieldSize[1],PyDict_GetItemString(py_dict,"field"));
@@ -882,13 +1147,10 @@
 	#if _PYTHON_MAJOR_ >= 3
 	if (PyUnicode_Check(py_list)){
+	#else
+	if (PyString_Check(py_list)){
+	#endif
 		FetchData(&contourname,py_list);
 		contours=ExpRead<double>(contourname);
 	}
-	#else
-	if (PyString_Check(py_list)){
-		FetchData(&contourname,py_list);
-		contours=ExpRead<double>(contourname);
-	}
-	#endif
 	else if(PyList_Check(py_list)){
 
@@ -941,5 +1203,5 @@
 	int* mwadjacency = xNewZeroInit<int>(nzmax);
 	pyGetIr(a,nvtxs,nzmax,mwadjacency);
-	
+
 	int* start = xNew<int>(nvtxs+1);
 	for(int i=0;i<nvtxs+1;i++) start[i]=(int)mwstart[i];
@@ -1012,17 +1274,34 @@
 
 /*Python version dependent: */
-#if _PYTHON_MAJOR_ >= 3 
-/*FUNCTION FetchData(char** pstring,PyObject* py_unicode){{{*/
-void FetchData(char** pstring,PyObject* py_unicode){
-
-	PyObject* py_bytes;
+/* #if _PYTHON_MAJOR_ >= 3 */
+/* /\*FUNCTION FetchData(char** pstring,PyObject* py_unicode){{{*\/ */
+/* void FetchData(char** pstring,PyObject* py_unicode){ */
+
+/* 	PyObject* py_bytes; */
+/* 	char* string=NULL; */
+
+/* 	/\*convert to bytes format: *\/ */
+/* 	PyUnicode_FSConverter(py_unicode,&py_bytes); */
+
+/* 	/\*convert from bytes to string: *\/ */
+/* 	string=PyBytes_AsUTF8(py_bytes); */
+
+/* 	/\*copy string (note strlen does not include trailing NULL): *\/ */
+/* 	*pstring=xNew<char>(strlen(string)+1); */
+/* 	memcpy(*pstring,string,(strlen(string)+1)*sizeof(char)); */
+/* } */
+/* /\*}}}*\/ */
+/* #else */
+/*FUNCTION FetchData(char** pstring,PyObject* py_string){{{*/
+void FetchData(char** pstring,PyObject* py_string){
+
 	char* string=NULL;
 
-	/*convert to bytes format: */
-	PyUnicode_FSConverter(py_unicode,&py_bytes);
-
-	/*convert from bytes to string: */
-	string=PyBytes_AS_STRING(py_bytes);
-
+	/*extract internal string: */
+	#if _PYTHON_MAJOR_ == 3
+	string=PyUnicode_AsUTF8(py_string);
+	#else
+	string=PyString_AsString(py_string);
+	#endif
 	/*copy string (note strlen does not include trailing NULL): */
 	*pstring=xNew<char>(strlen(string)+1);
@@ -1030,17 +1309,3 @@
 }
 /*}}}*/
-#else
-/*FUNCTION FetchData(char** pstring,PyObject* py_string){{{*/
-void FetchData(char** pstring,PyObject* py_string){
-
-	char* string=NULL;
-
-	/*extract internal string: */
-	string=PyString_AsString(py_string);
-
-	/*copy string (note strlen does not include trailing NULL): */
-	*pstring=xNew<char>(strlen(string)+1);
-	memcpy(*pstring,string,(strlen(string)+1)*sizeof(char));
-}
-/*}}}*/
-#endif
+//#endif
Index: /issm/trunk/src/wrappers/python/io/WritePythonData.cpp
===================================================================
--- /issm/trunk/src/wrappers/python/io/WritePythonData.cpp	(revision 24312)
+++ /issm/trunk/src/wrappers/python/io/WritePythonData.cpp	(revision 24313)
@@ -233,6 +233,10 @@
 		#if _PYTHON_MAJOR_ >= 3
 		PyDict_SetItemString(dict,"numsegs"          ,PyLong_FromSsize_t((Py_ssize_t)riftstruct->riftsnumsegments[i]));
+		PyDict_SetItemString(dict,"fill"             ,PyUnicode_FromString("Ice"));
+		PyDict_SetItemString(dict,"friction"         ,PyLong_FromSsize_t((Py_ssize_t)0));
 		#else
 		PyDict_SetItemString(dict,"numsegs"          ,PyInt_FromSsize_t((Py_ssize_t)riftstruct->riftsnumsegments[i]));
+		PyDict_SetItemString(dict,"fill"             ,PyString_FromString("Ice"));
+		PyDict_SetItemString(dict,"friction"         ,PyInt_FromSsize_t((Py_ssize_t)0));
 		#endif
 
@@ -241,11 +245,4 @@
 		PyDict_SetItemString(dict,"tips"             ,PyArrayFromCopiedData(1                                  ,2,&riftstruct->riftstips[2*i]));
 		PyDict_SetItemString(dict,"penaltypairs"     ,PyArrayFromCopiedData(riftstruct->riftsnumpenaltypairs[i],7,riftstruct->riftspenaltypairs[i]));
-		#if _PYTHON_MAJOR_ >= 3
-		PyDict_SetItemString(dict,"fill"             ,PyString_FromString("Ice"));
-		PyDict_SetItemString(dict,"friction"         ,PyLong_FromSsize_t((Py_ssize_t)0));
-		#else
-		PyDict_SetItemString(dict,"fill"             ,PyString_FromString("Ice"));
-		PyDict_SetItemString(dict,"friction"         ,PyInt_FromSsize_t((Py_ssize_t)0));
-		#endif
 		PyDict_SetItemString(dict,"fraction"         ,PyFloat_FromDouble(0.));
 		PyDict_SetItemString(dict,"fractionincrement",PyFloat_FromDouble(0.1));
Index: /issm/trunk/test/MITgcm/build_4003.sh
===================================================================
--- /issm/trunk/test/MITgcm/build_4003.sh	(revision 24313)
+++ /issm/trunk/test/MITgcm/build_4003.sh	(revision 24313)
@@ -0,0 +1,38 @@
+#!/bin/bash
+#This script compiles and links MITgcm
+
+#recover hostname and model path:
+hostname="$1"
+modelpath="$2"
+
+if [ -e ~/.bashrc ]; then
+    source ~/.bashrc
+fi
+
+# Get MITgcm code, if needed
+if [ ! -d "$modelpath/../MITgcm/install_dngoldberg" ]; then
+    cd $modelpath/../MITgcm
+    source install_dngoldberg.sh
+    cd $modelpath
+fi
+
+# Create build directory, if needed
+cd $modelpath
+if [ ! -d "build" ]; then mkdir build; fi
+cd build
+
+#create MITgcm makefile for this run, if needed
+if [ ! -f Makefile ]; then
+    if [ $hostname == "pleiades" ]; then 
+	$modelpath/../MITgcm/install_dngoldberg/tools/genmake2 -of $SLR_DIR/models/ice-ocean/configs/linux_amd64_gfortran+mpi_ice_nas -mo ../code_4003 -rd $modelpath/../MITgcm/install_dngoldberg
+    else
+	$modelpath/../MITgcm/install_dngoldberg/tools/genmake2 -mpi -mo ../code_4003 -rd $modelpath/../MITgcm/install_dngoldberg
+    fi
+fi
+
+#create MITgcm code links for this run, if needed
+if [ ! -f BUILD_INFO.h ]; then
+    make depend
+fi
+
+make -j 4
Index: /issm/trunk/test/MITgcm/code_4003/CPP_EEOPTIONS.h
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/CPP_EEOPTIONS.h	(revision 24313)
+++ /issm/trunk/test/MITgcm/code_4003/CPP_EEOPTIONS.h	(revision 24313)
@@ -0,0 +1,164 @@
+CBOP
+C     !ROUTINE: CPP_EEOPTIONS.h
+C     !INTERFACE:
+C     include "CPP_EEOPTIONS.h"
+C
+C     !DESCRIPTION:
+C     *==========================================================*
+C     | CPP\_EEOPTIONS.h                                         |
+C     *==========================================================*
+C     | C preprocessor "execution environment" supporting        |
+C     | flags. Use this file to set flags controlling the        |
+C     | execution environment in which a model runs - as opposed |
+C     | to the dynamical problem the model solves.               |
+C     | Note: Many options are implemented with both compile time|
+C     |       and run-time switches. This allows options to be   |
+C     |       removed altogether, made optional at run-time or   |
+C     |       to be permanently enabled. This convention helps   |
+C     |       with the data-dependence analysis performed by the |
+C     |       adjoint model compiler. This data dependency       |
+C     |       analysis can be upset by runtime switches that it  |
+C     |       is unable to recoginise as being fixed for the     |
+C     |       duration of an integration.                        |
+C     |       A reasonable way to use these flags is to          |
+C     |       set all options as selectable at runtime but then  |
+C     |       once an experimental configuration has been        |
+C     |       identified, rebuild the code with the appropriate  |
+C     |       options set at compile time.                       |
+C     *==========================================================*
+CEOP
+
+#ifndef _CPP_EEOPTIONS_H_
+#define _CPP_EEOPTIONS_H_
+
+C     In general the following convention applies:
+C     ALLOW  - indicates an feature will be included but it may
+C     CAN      have a run-time flag to allow it to be switched
+C              on and off.
+C              If ALLOW or CAN directives are "undef'd" this generally
+C              means that the feature will not be available i.e. it
+C              will not be included in the compiled code and so no
+C              run-time option to use the feature will be available.
+C
+C     ALWAYS - indicates the choice will be fixed at compile time
+C              so no run-time option will be present
+
+C=== Macro related options ===
+C--   Control storage of floating point operands
+C     On many systems it improves performance only to use
+C     8-byte precision for time stepped variables.
+C     Constant in time terms ( geometric factors etc.. )
+C     can use 4-byte precision, reducing memory utilisation and
+C     boosting performance because of a smaller working set size.
+C     However, on vector CRAY systems this degrades performance.
+C     Enable to switch REAL4_IS_SLOW from genmake2 (with LET_RS_BE_REAL4):
+#ifdef LET_RS_BE_REAL4
+#undef REAL4_IS_SLOW
+#else /* LET_RS_BE_REAL4 */
+#define REAL4_IS_SLOW
+#endif /* LET_RS_BE_REAL4 */
+
+C--   Control use of "double" precision constants.
+C     Use D0 where it means REAL*8 but not where it means REAL*16
+#define D0 d0
+
+C--   Enable some old macro conventions for backward compatibility
+#undef USE_OLD_MACROS_R4R8toRSRL
+
+C=== IO related options ===
+C--   Flag used to indicate whether Fortran formatted write
+C     and read are threadsafe. On SGI the routines can be thread
+C     safe, on Sun it is not possible - if you are unsure then
+C     undef this option.
+#undef FMTFTN_IO_THREAD_SAFE
+
+C--   Flag used to indicate whether Binary write to Local file (i.e.,
+C     a different file for each tile) and read are thread-safe.
+#undef LOCBIN_IO_THREAD_SAFE
+
+C--   Flag to turn off the writing of error message to ioUnit zero
+#undef DISABLE_WRITE_TO_UNIT_ZERO
+
+C--   Alternative formulation of BYTESWAP, faster than
+C     compiler flag -byteswapio on the Altix.
+#undef FAST_BYTESWAP
+
+C--   Flag to turn on old default of opening scratch files with the
+C     STATUS='SCRATCH' option. This method, while perfectly FORTRAN-standard,
+C     caused filename conflicts on some multi-node/multi-processor platforms
+C     in the past and has been replace by something (hopefully) more robust.
+#undef USE_FORTRAN_SCRATCH_FILES
+
+C--   Flag defined for eeboot_minimal.F, eeset_parms.F and open_copy_data_file.F
+C     to write STDOUT, STDERR and scratch files from process 0 only.
+C WARNING: to use only when absolutely confident that the setup is working
+C     since any message (error/warning/print) from any proc <> 0 will be lost.
+#undef SINGLE_DISK_IO
+
+C=== MPI, EXCH and GLOBAL_SUM related options ===
+C--   Flag turns off MPI_SEND ready_to_receive polling in the
+C     gather_* subroutines to speed up integrations.
+#undef DISABLE_MPI_READY_TO_RECEIVE
+
+C--   Control MPI based parallel processing
+CXXX We no longer select the use of MPI via this file (CPP_EEOPTIONS.h)
+CXXX To use MPI, use an appropriate genmake2 options file or use
+CXXX genmake2 -mpi .
+CXXX #undef  ALLOW_USE_MPI
+
+C--   Control use of communication that might overlap computation.
+C     Under MPI selects/deselects "non-blocking" sends and receives.
+#define ALLOW_ASYNC_COMMUNICATION
+#undef  ALLOW_ASYNC_COMMUNICATION
+#undef  ALWAYS_USE_ASYNC_COMMUNICATION
+C--   Control use of communication that is atomic to computation.
+C     Under MPI selects/deselects "blocking" sends and receives.
+#define ALLOW_SYNC_COMMUNICATION
+#undef  ALWAYS_USE_SYNC_COMMUNICATION
+
+C--   Control XY periodicity in processor to grid mappings
+C     Note: Model code does not need to know whether a domain is
+C           periodic because it has overlap regions for every box.
+C           Model assume that these values have been
+C           filled in some way.
+#undef  ALWAYS_PREVENT_X_PERIODICITY
+#undef  ALWAYS_PREVENT_Y_PERIODICITY
+#define CAN_PREVENT_X_PERIODICITY
+#define CAN_PREVENT_Y_PERIODICITY
+
+C--   disconnect tiles (no exchange between tiles, just fill-in edges
+C     assuming locally periodic subdomain)
+#undef DISCONNECTED_TILES
+
+C--   Always cumulate tile local-sum in the same order by applying MPI allreduce
+C     to array of tiles ; can get slower with large number of tiles (big set-up)
+#define GLOBAL_SUM_ORDER_TILES
+
+C--   Alternative way of doing global sum without MPI allreduce call
+C     but instead, explicit MPI send & recv calls. Expected to be slower.
+#undef GLOBAL_SUM_SEND_RECV
+
+C--   Alternative way of doing global sum on a single CPU
+C     to eliminate tiling-dependent roundoff errors. Note: This is slow.
+#undef  CG2D_SINGLECPU_SUM
+
+C=== Other options (to add/remove pieces of code) ===
+C--   Flag to turn on checking for errors from all threads and procs
+C     (calling S/R STOP_IF_ERROR) before stopping.
+#define USE_ERROR_STOP
+
+C--   Control use of communication with other component:
+C     allow to import and export from/to Coupler interface.
+#undef COMPONENT_MODULE
+
+C--   Options used to couple MITgcm and ISSM
+C     Eventually this option can probably be merged with COMPONENT_MODULE
+#define ALLOW_CPL_ISSM
+
+C--   Activate some pieces of code for coupling to GEOS AGCM
+#undef HACK_FOR_GMAO_CPL
+
+#endif /* _CPP_EEOPTIONS_H_ */
+
+#include "CPP_EEMACROS.h"
+
Index: /issm/trunk/test/MITgcm/code_4003/CPP_OPTIONS.h
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/CPP_OPTIONS.h	(revision 24313)
+++ /issm/trunk/test/MITgcm/code_4003/CPP_OPTIONS.h	(revision 24313)
@@ -0,0 +1,139 @@
+#ifndef CPP_OPTIONS_H
+#define CPP_OPTIONS_H
+
+CBOP
+C !ROUTINE: CPP_OPTIONS.h
+C !INTERFACE:
+C #include "CPP_OPTIONS.h"
+
+C !DESCRIPTION:
+C *==================================================================*
+C | main CPP options file for the model:
+C | Control which optional features to compile in model/src code.
+C *==================================================================*
+CEOP
+
+C CPP flags controlling particular source code features
+
+C-- Forcing code options:
+
+C o Shortwave heating as extra term in external_forcing.F
+C Note: this should be a run-time option
+#define SHORTWAVE_HEATING
+
+C o Include/exclude Geothermal Heat Flux at the bottom of the ocean
+#undef ALLOW_GEOTHERMAL_FLUX
+
+C o Allow to account for heating due to friction (and momentum dissipation)
+#undef ALLOW_FRICTION_HEATING
+
+C o Allow mass source or sink of Fluid in the interior
+C   (3-D generalisation of oceanic real-fresh water flux)
+#undef ALLOW_ADDFLUID
+
+C o Include pressure loading code
+#define ATMOSPHERIC_LOADING
+
+C o Include/exclude balancing surface forcing fluxes code
+#undef ALLOW_BALANCE_FLUXES
+
+C o Include/exclude balancing surface forcing relaxation code
+#undef ALLOW_BALANCE_RELAX
+
+C o Include/exclude checking for negative salinity
+#undef CHECK_SALINITY_FOR_NEGATIVE_VALUES
+
+C-- Options to discard parts of the main code:
+
+C o Exclude/allow external forcing-fields load
+C   this allows to read & do simple linear time interpolation of oceanic
+C   forcing fields, if no specific pkg (e.g., EXF) is used to compute them.
+#undef EXCLUDE_FFIELDS_LOAD
+
+C o Include/exclude phi_hyd calculation code
+#define INCLUDE_PHIHYD_CALCULATION_CODE
+
+C-- Vertical mixing code options:
+
+C o Include/exclude call to S/R CONVECT
+#define INCLUDE_CONVECT_CALL
+
+C o Include/exclude call to S/R CALC_DIFFUSIVITY
+#define INCLUDE_CALC_DIFFUSIVITY_CALL
+
+C o Allow full 3D specification of vertical diffusivity
+#undef ALLOW_3D_DIFFKR
+
+C o Allow latitudinally varying BryanLewis79 vertical diffusivity
+#undef ALLOW_BL79_LAT_VARY
+
+C o Exclude/allow partial-cell effect (physical or enhanced) in vertical mixing
+C   this allows to account for partial-cell in vertical viscosity and diffusion,
+C   either from grid-spacing reduction effect or as artificially enhanced mixing
+C   near surface & bottom for too thin grid-cell
+#undef EXCLUDE_PCELL_MIX_CODE
+
+C-- Time-stepping code options:
+
+C o Include/exclude combined Surf.Pressure and Drag Implicit solver code
+#undef ALLOW_SOLVE4_PS_AND_DRAG
+
+C o Include/exclude Implicit vertical advection code
+#define INCLUDE_IMPLVERTADV_CODE
+
+C o Include/exclude AdamsBashforth-3rd-Order code
+#undef ALLOW_ADAMSBASHFORTH_3
+
+C-- Model formulation options:
+
+C o Allow/exclude "Exact Convervation" of fluid in Free-Surface formulation
+C   that ensures that d/dt(eta) is exactly equal to - Div.Transport
+#define EXACT_CONSERV
+
+C o Allow the use of Non-Linear Free-Surface formulation
+C   this implies that grid-cell thickness (hFactors) varies with time
+#define NONLIN_FRSURF
+
+C o Include/exclude nonHydrostatic code
+#undef ALLOW_NONHYDROSTATIC
+
+C o Include/exclude GM-like eddy stress in momentum code
+#undef ALLOW_EDDYPSI
+
+C-- Algorithm options:
+
+C o Use Non Self-Adjoint (NSA) conjugate-gradient solver
+#undef ALLOW_CG2D_NSA
+
+C o Include/exclude code for single reduction Conjugate-Gradient solver
+#undef ALLOW_SRCG
+
+C o Choices for implicit solver routines solve_*diagonal.F
+C   The following has low memory footprint, but not suitable for AD
+#undef SOLVE_DIAGONAL_LOWMEMORY
+C   The following one suitable for AD but does not vectorize
+#undef SOLVE_DIAGONAL_KINNER
+
+C-- Retired code options:
+
+C o Use LONG.bin, LATG.bin, etc., initialization for ini_curviliear_grid.F
+C   Default is to use "new" grid files (OLD_GRID_IO undef) but OLD_GRID_IO
+C   is still useful with, e.g., single-domain curvilinear configurations.
+#undef OLD_GRID_IO
+
+C-- Other option files:
+
+C o Execution environment support options
+#include "CPP_EEOPTIONS.h"
+
+C o Include/exclude single header file containing multiple packages options
+C   (AUTODIFF, COST, CTRL, ECCO, EXF ...) instead of the standard way where
+C   each of the above pkg get its own options from its specific option file.
+C   Although this method, inherited from ECCO setup, has been traditionally
+C   used for all adjoint built, work is in progress to allow to use the
+C   standard method also for adjoint built.
+c#ifdef PACKAGES_CONFIG_H
+c# include "ECCO_CPPOPTIONS.h"
+c#endif
+
+#endif /* CPP_OPTIONS_H */
Index: /issm/trunk/test/MITgcm/code_4003/DIAGNOSTICS_SIZE.h
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/DIAGNOSTICS_SIZE.h	(revision 24313)
+++ /issm/trunk/test/MITgcm/code_4003/DIAGNOSTICS_SIZE.h	(revision 24313)
@@ -0,0 +1,29 @@
+
+C     Diagnostics Array Dimension
+C     ---------------------------
+C     ndiagMax   :: maximum total number of available diagnostics
+C     numlists   :: maximum number of diagnostics list (in data.diagnostics)
+C     numperlist :: maximum number of active diagnostics per list (data.diagnostics)
+C     numLevels  :: maximum number of levels to write    (data.diagnostics)
+C     numDiags   :: maximum size of the storage array for active 2D/3D diagnostics
+C     nRegions   :: maximum number of regions (statistics-diagnostics)
+C     sizRegMsk  :: maximum size of the regional-mask (statistics-diagnostics)
+C     nStats     :: maximum number of statistics (e.g.: aver,min,max ...)
+C     diagSt_size:: maximum size of the storage array for statistics-diagnostics
+C Note : may need to increase "numDiags" when using several 2D/3D diagnostics,
+C  and "diagSt_size" (statistics-diags) since values here are deliberately small.
+      INTEGER    ndiagMax
+      INTEGER    numlists, numperlist, numLevels
+      INTEGER    numDiags
+      INTEGER    nRegions, sizRegMsk, nStats
+      INTEGER    diagSt_size
+      PARAMETER( ndiagMax = 500 )
+      PARAMETER( numlists = 10, numperlist = 50, numLevels=2*Nr )
+      PARAMETER( numDiags = 10*Nr+4 )
+      PARAMETER( nRegions = 0 , sizRegMsk = 1 , nStats = 4 )
+      PARAMETER( diagSt_size = 10*Nr )
+
+
+CEH3 ;;; Local Variables: ***
+CEH3 ;;; mode:fortran ***
+CEH3 ;;; End: ***
Index: /issm/trunk/test/MITgcm/code_4003/DIAG_OPTIONS.h
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/DIAG_OPTIONS.h	(revision 24313)
+++ /issm/trunk/test/MITgcm/code_4003/DIAG_OPTIONS.h	(revision 24313)
@@ -0,0 +1,31 @@
+#ifndef DIAG_OPTIONS_H
+#define DIAG_OPTIONS_H
+#include "PACKAGES_CONFIG.h"
+#ifdef ALLOW_DIAGNOSTICS
+
+#include "CPP_OPTIONS.h"
+
+CEH3 package-specific options go here
+
+C allow to define specific regions and the corresponding mask ;
+C  used to perform regional statistics over a limited area
+#undef DIAGSTATS_REGION_MASK
+
+C allow to stop & restart at any time (i.e. not at a multiple of
+C  the diagnostics frequency) reading diagnostics storage arrays
+C  from pickup file.
+C Note: Use with cautious since it does not work for all restart
+C  cases (e.g., changing data.diagnostics).
+#undef  DIAGNOSTICS_HAS_PICKUP
+
+C for NetCDF (mnc) output: define a missing value (default is UNSET_RL)
+C and fill land points of (so far only) scalar fields with it
+#undef DIAGNOSTICS_MISSING_VALUE
+
+#endif /* ALLOW_DIAGNOSTICS */
+#endif /* DIAG_OPTIONS_H */
+
+
+CEH3 ;;; Local Variables: ***
+CEH3 ;;; mode:fortran ***
+CEH3 ;;; End: ***
Index: /issm/trunk/test/MITgcm/code_4003/OBCS_OPTIONS.h
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/OBCS_OPTIONS.h	(revision 24313)
+++ /issm/trunk/test/MITgcm/code_4003/OBCS_OPTIONS.h	(revision 24313)
@@ -0,0 +1,55 @@
+C CPP options file for OBCS package
+C
+C Use this file for selecting options within the OBCS package
+C
+C OBCS is enabled with ALLOW_OBCS in CPP_OPTIONS.h
+
+#ifndef OBCS_OPTIONS_H
+#define OBCS_OPTIONS_H
+#include "PACKAGES_CONFIG.h"
+#include "CPP_OPTIONS.h"
+
+#ifdef ALLOW_OBCS
+
+C Enable individual open boundaries
+#define ALLOW_OBCS_NORTH
+#undef ALLOW_OBCS_SOUTH
+#undef ALLOW_OBCS_EAST
+#undef ALLOW_OBCS_WEST
+
+C This include hooks to the Orlanski Open Boundary Radiation code
+#undef ALLOW_ORLANSKI
+
+C Enable OB values to be prescribed via external fields that are read
+C from a file
+#define ALLOW_OBCS_PRESCRIBE
+
+C This includes hooks to sponge layer treatment of uvel, vvel
+#define ALLOW_OBCS_SPONGE
+
+C balance barotropic velocity
+C KS16 turn this on
+#define ALLOW_OBCS_BALANCE
+
+C     The following five CPP options are experimental and aim to deal
+C     with artifacts due to the low-frequency specification of sea-ice
+C     boundary conditions compared to the model forcing frequency.
+C     Ice convergence at edges can cause model to blow up.  The
+C     following CPP option fixes this problem at the expense of less
+C     accurate boundary conditions.
+#undef OBCS_SEAICE_AVOID_CONVERGENCE
+
+C     Smooth the component of sea-ice velocity perpendicular to the edge.
+#undef OBCS_SEAICE_SMOOTH_UVICE_PERP
+
+C     Smooth the component of sea ice velocity parallel to the edge.
+#undef OBCS_SEAICE_SMOOTH_UVICE_PAR
+
+C     Smooth the tracer sea-ice variables near the edges.
+#undef OBCS_SEAICE_SMOOTH_EDGE
+
+C     Compute rather than specify seaice velocities at the edges.
+#undef OBCS_SEAICE_COMPUTE_UVICE
+
+#endif /* ALLOW_OBCS */
+#endif /* OBCS_OPTIONS_H */
Index: /issm/trunk/test/MITgcm/code_4003/SHELFICE_OPTIONS.h
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/SHELFICE_OPTIONS.h	(revision 24313)
+++ /issm/trunk/test/MITgcm/code_4003/SHELFICE_OPTIONS.h	(revision 24313)
@@ -0,0 +1,32 @@
+C     *==========================================================*
+C     | SHELFICE_OPTIONS.h
+C     | o CPP options file for SHELFICE package.
+C     *==========================================================*
+C     | Use this file for selecting options within the SHELFICE
+C     | package.
+C     *==========================================================*
+
+#ifndef SHELFICE_OPTIONS_H
+#define SHELFICE_OPTIONS_H
+#include "PACKAGES_CONFIG.h"
+#include "CPP_OPTIONS.h"
+
+#ifdef ALLOW_SHELFICE
+C     Package-specific Options & Macros go here
+
+C     allow code for simple ISOMIP thermodynamics
+!#define ALLOW_ISOMIP_TD
+
+C     allow friction velocity-dependent transfer coefficient
+C     following Holland and Jenkins, JPO, 1999
+#define SHI_ALLOW_GAMMAFRICT
+C     in uStar expression, use wet-point method to average velocity
+C     at grid-cell center
+!#define SHI_USTAR_WETPOINT
+
+#define ALLOW_SHELFICE_REMESHING
+#define SHI_USTAR_TOPDR
+#undef ALLOW_SHELFICE_GROUNDED_ICE
+
+#endif /* ALLOW_SHELFICE */
+#endif /* SHELFICE_OPTIONS_H */
Index: /issm/trunk/test/MITgcm/code_4003/SIZE.h
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/SIZE.h	(revision 24313)
+++ /issm/trunk/test/MITgcm/code_4003/SIZE.h	(revision 24313)
@@ -0,0 +1,59 @@
+C
+C     /==========================================================\
+C     | SIZE.h Declare size of underlying computational grid.    |
+C     |==========================================================|
+C     | The design here support a three-dimensional model grid   |
+C     | with indices I,J and K. The three-dimensional domain     |
+C     | is comprised of nPx*nSx blocks of size sNx along one axis|
+C     | nPy*nSy blocks of size sNy along another axis and one    |
+C     | block of size Nz along the final axis.                   |
+C     | Blocks have overlap regions of size OLx and OLy along the|
+C     | dimensions that are subdivided.                          |
+C     \==========================================================/
+C     Voodoo numbers controlling data layout.
+C     sNx - No. X points in sub-grid.
+C     sNy - No. Y points in sub-grid.
+C     OLx - Overlap extent in X.
+C     OLy - Overlat extent in Y.
+C     nSx - No. sub-grids in X.
+C     nSy - No. sub-grids in Y.
+C     nPx - No. of processes to use in X.
+C     nPy - No. of processes to use in Y.
+C     Nx  - No. points in X for the total domain.
+C     Ny  - No. points in Y for the total domain.
+C     Nr  - No. points in Z for full process domain.
+      INTEGER sNx
+      INTEGER sNy
+      INTEGER OLx
+      INTEGER OLy
+      INTEGER nSx
+      INTEGER nSy
+      INTEGER nPx
+      INTEGER nPy
+      INTEGER Nx
+      INTEGER Ny
+      INTEGER Nr
+      PARAMETER (
+     &           sNx =  3,
+     &           sNy =  200,
+     &           OLx =   3,
+     &           OLy =   3,
+     &           nSx =   1,
+     &           nSy =   1,
+     &           nPx =   1,
+     &           nPy =   1,
+     &           Nx  = sNx*nSx*nPx,
+     &           Ny  = sNy*nSy*nPy,
+     &           Nr  =  90)
+
+C     MAX_OLX  - Set to the maximum overlap region size of any array
+C     MAX_OLY    that will be exchanged. Controls the sizing of exch
+C                routine buufers.
+      INTEGER MAX_OLX
+      INTEGER MAX_OLY
+      PARAMETER ( MAX_OLX = OLx,
+     &            MAX_OLY = OLy )
+
+      INTEGER nobcs
+      PARAMETER ( nobcs = 4 )
+
Index: /issm/trunk/test/MITgcm/code_4003/STREAMICE_OPTIONS.h
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/STREAMICE_OPTIONS.h	(revision 24313)
+++ /issm/trunk/test/MITgcm/code_4003/STREAMICE_OPTIONS.h	(revision 24313)
@@ -0,0 +1,32 @@
+C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
+
+C CPP options file for MYPACKAGE
+C
+C Use this file for selecting options within package "streamice"
+
+#ifndef STREAMICE_OPTIONS_H
+#define STREAMICE_OPTIONS_H
+#include "PACKAGES_CONFIG.h"
+#ifdef ALLOW_STREAMICE
+
+#include "CPP_OPTIONS.h"
+
+C Place CPP define/undef flag here
+
+#define STREAMICE_CONSTRUCT_MATRIX
+#define STREAMICE_HYBRID_STRESS
+#define USE_ALT_RLOW
+#define STREAMICE_GEOM_FILE_SETUP
+!#define STREAMICE_SMOOTH_FLOATATION
+!#define ALLOW_PETSC
+#undef ALLOW_STREAMICE_2DTRACER
+#undef STREAMICE_TRACER_AB
+#undef STREAMICE_SERIAL_TRISOLVE
+#define STREAMICE_FLOWLINE_BUTTRESS
+
+#endif /* ALLOW_MYPACKAGE */
+#endif /* MYPACKAGE_OPTIONS_H */
+
+CEH3 ;;; Local Variables: ***
+CEH3 ;;; mode:fortran ***
+CEH3 ;;; End: ***
Index: /issm/trunk/test/MITgcm/code_4003/cpl_issm.F
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/cpl_issm.F	(revision 24313)
+++ /issm/trunk/test/MITgcm/code_4003/cpl_issm.F	(revision 24313)
@@ -0,0 +1,220 @@
+#include "PACKAGES_CONFIG.h"
+#include "CPP_OPTIONS.h"
+
+CBOP
+C     !ROUTINE: CPL_ISSM
+C     !INTERFACE:
+      SUBROUTINE CPL_ISSM( myTime, myIter, myThid )
+
+C     !DESCRIPTION: \bv
+C     *==================================================================
+C     | SUBROUTINE cpl_issm
+C     | o Couple MITgcm ocean model with ISSM ice sheet model
+C     *==================================================================
+C     \ev
+
+C     !USES:
+      IMPLICIT NONE
+C     == Global variables ==
+#include "SIZE.h"
+#include "EEPARAMS.h"
+#include "PARAMS.h"
+#include "DYNVARS.h"
+#include "GRID.h"
+#include "FFIELDS.h"
+#include "SHELFICE_OPTIONS.h"
+#include "SHELFICE.h"
+#ifdef ALLOW_EXF
+# include "EXF_OPTIONS.h"
+# include "EXF_FIELDS.h"
+#endif
+
+      LOGICAL  DIFFERENT_MULTIPLE
+      EXTERNAL DIFFERENT_MULTIPLE
+
+C     !LOCAL VARIABLES:
+C     mytime - time counter for this thread (seconds)
+C     myiter - iteration counter for this thread
+C     mythid - thread number for this instance of the routine.
+      _RL     mytime
+      INTEGER myiter, mythid 
+CEOP
+
+#ifdef ALLOW_CPL_ISSM
+#include "EESUPPORT.h"
+      COMMON /CPL_MPI_ID/ mpiMyWid, toissmcomm
+      INTEGER mpiMyWid, toissmcomm, mpiRC
+      INTEGER mpistatus(MPI_STATUS_SIZE)
+      INTEGER i, j, bi, bj, buffsize
+      COMMON /CPL_ISSM_TIME/ CouplingTime
+      _R8 CouplingTime, IceModelTime
+      _R8 xfer_array(Nx,Ny)
+      _R8 local(1:sNx,1:sNy,nSx,nSy)
+      CHARACTER*(MAX_LEN_MBUF) suff
+
+C Initialization steps I1, I2, and I3:
+      IF( myTime .EQ. startTime ) THEN
+
+C   I1. ISSM sends CouplingTime, the interval at which we couple
+         IF( myProcId .EQ. 0 ) THEN
+            _BEGIN_MASTER( myThid )
+            call MPI_Recv(CouplingTime,1,MPI_DOUBLE,0,10001000,
+     &           toissmcomm,mpistatus,mpiRC)
+            _END_MASTER( myThid )
+         ENDIF
+         _BEGIN_MASTER( myThid )
+         CALL MPI_BCAST(CouplingTime,1,MPI_DOUBLE,0,
+     &        MPI_COMM_MODEL,mpiRC)
+         _END_MASTER( myThid )
+C        print*, 'Ocean received CouplingTime: ', CouplingTime
+
+C   I2. MITgcm sends grid size (NX and NY)
+         IF( myProcId .EQ. 0 ) THEN
+            _BEGIN_MASTER( myThid )
+            call MPI_Send(Nx,1,MPI_INT,0,10001003,
+     &           toissmcomm,mpistatus)
+            call MPI_Send(Ny,1,MPI_INT,0,10001004,
+     &           toissmcomm,mpistatus)
+            _END_MASTER( myThid )
+         ENDIF
+
+C   I3. MITgcm sends grid coordinates of center of cells
+C       (longitude -180 <= XC < 180 and latitude YC)
+C     Send longitude East of center of cell
+         DO bj=1,nSy
+            DO bi=1,nSx
+               DO j=1,sNy
+                  DO i=1,sNx
+                     local(i,j,bi,bj) = xC(i,j,bi,bj)
+                  ENDDO
+               ENDDO
+            ENDDO
+         ENDDO
+         CALL BAR2( myThid ) 
+         CALL GATHER_2D_R8( xfer_array, local, Nx, Ny,
+     &        .FALSE., .FALSE., myThid )
+         IF( myProcId .EQ. 0 ) THEN
+            _BEGIN_MASTER( myThid )
+            buffsize = Nx*Ny
+            CALL MPI_SEND(xfer_array,buffsize,MPI_DOUBLE_PRECISION,
+     &           0,10001005,toissmcomm,mpistatus)
+            _END_MASTER( myThid )
+         ENDIF
+         CALL BAR2( myThid )
+C     Send latitude North of center of cell
+         DO bj=1,nSy
+            DO bi=1,nSx
+               DO j=1,sNy
+                  DO i=1,sNx
+                     local(i,j,bi,bj) = yC(i,j,bi,bj)
+                  ENDDO
+               ENDDO
+            ENDDO
+         ENDDO
+         CALL BAR2( myThid ) 
+         CALL GATHER_2D_R8( xfer_array, local, Nx, Ny,
+     &        .FALSE., .FALSE., myThid )
+         IF( myProcId .EQ. 0 ) THEN
+            _BEGIN_MASTER( myThid )
+            buffsize = Nx*Ny
+            CALL MPI_SEND(xfer_array,buffsize,MPI_DOUBLE_PRECISION,
+     &           0,10001006,toissmcomm,mpistatus)
+            _END_MASTER( myThid )
+         ENDIF
+         CALL BAR2( myThid )
+
+      ENDIF
+C End initialization steps I1, I2, and I3.
+
+C Recurring steps C1 and C2:
+      IF( MOD(myTime,CouplingTime) .LT. deltaT/2. ) THEN
+
+C   C1. ISSM sends ice model time IceTimeTag
+         IF( myProcId .EQ. 0 ) THEN
+            _BEGIN_MASTER( myThid )
+            call MPI_Recv(IceModelTime,1,MPI_DOUBLE,0,10001001,
+     &           toissmcomm,mpistatus,mpiRC)
+C           print*, 'Ocean received IceModelTime: ', IceModelTime
+            _END_MASTER( myThid )
+         ENDIF
+
+C   C2. MITgcm sends ocean model time OceanTimeTag
+         IF( myProcId .EQ. 0 ) THEN
+            _BEGIN_MASTER( myThid )
+            call MPI_Send(myTime,1,MPI_DOUBLE,0,10001002,
+     &           toissmcomm,mpistatus)
+            _END_MASTER( myThid )
+         ENDIF
+
+      ENDIF
+C End recurring steps C1 and C2.
+
+C Recurring step C3 except during Initialization:
+C  C3. MITgcm sends
+C      (N-1)*CouplingTime <= OceanModelTime < N*CouplingTime
+C      time-mean melt rate to ISSM
+      IF( myTime .NE. startTime .AND.
+     &     MOD(myTime,CouplingTime) .LT. deltaT/2. ) THEN
+         DO bj=1,nSy
+            DO bi=1,nSx
+               DO j=1,sNy
+                  DO i=1,sNx
+                     local(i,j,bi,bj)=shelficeFreshWaterFlux(i,j,bi,bj)
+                  ENDDO
+               ENDDO
+            ENDDO
+         ENDDO
+         CALL BAR2( myThid ) 
+         CALL GATHER_2D_R8( xfer_array, local, Nx, Ny,
+     &        .FALSE., .FALSE., myThid )
+         IF( myProcId .EQ. 0 ) THEN
+            _BEGIN_MASTER( myThid )
+            buffsize = Nx*Ny
+            CALL MPI_SEND(xfer_array,buffsize,MPI_DOUBLE_PRECISION,
+     &           0,10001007,toissmcomm,mpistatus)
+            _END_MASTER( myThid )
+         ENDIF
+         CALL BAR2( myThid )
+C        print*,'Done Sending shelficeFreshWaterFlux array.'
+         
+      ENDIF
+C End recurring step C3.
+
+C Recurring step C4 except during Termination:
+C  C4. ISSM sends IceModelTime=(N-1)*CouplingTime base to MITgcm
+      IF( myTime .NE. endtime .AND.
+     &     MOD(myTime,CouplingTime) .LT. deltaT/2. ) THEN
+         WRITE(suff,'(I10.10)') myIter
+         CALL WRITE_FLD_XY_RS( 'R_shelfIce1_',suff,R_shelfIce,-1,myThid)
+         IF( myProcId .EQ. 0 ) THEN
+            _BEGIN_MASTER( myThid )         
+            call MPI_Recv(xfer_array,buffsize,MPI_DOUBLE_PRECISION,
+     &           0,10001008,toissmcomm,mpistatus,mpiRC)
+            _END_MASTER( myThid )
+         ENDIF
+         CALL BAR2( myThid ) 
+         CALL SCATTER_2D_R8( xfer_array, local, Nx, Ny,
+     &        .FALSE., .FALSE., myThid )
+         DO bj = myByLo(myThid), myByHi(myThid)
+            DO bi = myBxLo(myThid), myBxHi(myThid)
+               DO j=1,sNy
+                  DO i=1,sNx
+                     IF( local(i,j,bi,bj).LT.9998 ) THEN
+                        R_shelfIce(i,j,bi,bj) = local(i,j,bi,bj)
+                     ELSE
+                        R_shelfIce(i,j,bi,bj) = 0. _d 0
+                     ENDIF
+                  ENDDO
+               ENDDO
+            ENDDO
+         ENDDO
+C- fill in the overlap (+ BARRIER):
+         _EXCH_XY_RS( R_shelfIce, myThid )
+         CALL WRITE_FLD_XY_RS( 'R_shelfIce2_',suff,R_shelfIce,-1,myThid)
+      ENDIF
+C End recurring step C4.
+
+#endif /* ALLOW_CPL_ISSM */
+
+      RETURN
+      END
Index: /issm/trunk/test/MITgcm/code_4003/do_oceanic_phys.F
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/do_oceanic_phys.F	(revision 24313)
+++ /issm/trunk/test/MITgcm/code_4003/do_oceanic_phys.F	(revision 24313)
@@ -0,0 +1,1192 @@
+#include "PACKAGES_CONFIG.h"
+#include "CPP_OPTIONS.h"
+#ifdef ALLOW_AUTODIFF
+# include "AUTODIFF_OPTIONS.h"
+#endif
+#ifdef ALLOW_CTRL
+# include "CTRL_OPTIONS.h"
+#endif
+#ifdef ALLOW_SALT_PLUME
+# include "SALT_PLUME_OPTIONS.h"
+#endif
+#ifdef ALLOW_ECCO
+# include "ECCO_OPTIONS.h"
+#endif
+
+#ifdef ALLOW_AUTODIFF
+# ifdef ALLOW_GGL90
+#  include "GGL90_OPTIONS.h"
+# endif
+# ifdef ALLOW_GMREDI
+#  include "GMREDI_OPTIONS.h"
+# endif
+# ifdef ALLOW_KPP
+#  include "KPP_OPTIONS.h"
+# endif
+# ifdef ALLOW_SEAICE
+#  include "SEAICE_OPTIONS.h"
+# endif
+# ifdef ALLOW_EXF
+#  include "EXF_OPTIONS.h"
+# endif
+#endif /* ALLOW_AUTODIFF */
+
+CBOP
+C     !ROUTINE: DO_OCEANIC_PHYS
+C     !INTERFACE:
+      SUBROUTINE DO_OCEANIC_PHYS(myTime, myIter, myThid)
+C     !DESCRIPTION: \bv
+C     *==========================================================*
+C     | SUBROUTINE DO_OCEANIC_PHYS
+C     | o Controlling routine for oceanic physics and
+C     |   parameterization
+C     *==========================================================*
+C     | o originally, part of S/R thermodynamics
+C     *==========================================================*
+C     \ev
+
+C     !CALLING SEQUENCE:
+C     DO_OCEANIC_PHYS
+C       |
+C       |-- OBCS_CALC
+C       |
+C       |-- OCN_APPLY_IMPORT
+C       |
+C       |-- FRAZIL_CALC_RHS
+C       |
+C       |-- THSICE_MAIN
+C       |
+C       |-- SEAICE_FAKE
+C       |-- SEAICE_MODEL
+C       |-- SEAICE_COST_SENSI
+C       |
+C       |-- OCN_EXPORT_DATA
+C       |
+C       |-- SHELFICE_THERMODYNAMICS
+C       |
+C       |-- ICEFRONT_THERMODYNAMICS
+C       |
+C       |-- SALT_PLUME_DO_EXCH
+C       |
+C       |-- FREEZE_SURFACE
+C       |
+C       |-- EXTERNAL_FORCING_SURF
+C       |
+C       |- k loop (Nr:1):
+C       | - DWNSLP_CALC_RHO
+C       | - BBL_CALC_RHO
+C       | - FIND_RHO_2D @ p(k)
+C       | - FIND_RHO_2D @ p(k-1)
+C       | - GRAD_SIGMA
+C       | - CALC_IVDC
+C       | - DIAGS_RHO_L
+C       |- end k loop.
+C       |
+C       |-- CALC_OCE_MXLAYER
+C       |
+C       |-- SALT_PLUME_CALC_DEPTH
+C       |-- SALT_PLUME_VOLFRAC
+C       |-- SALT_PLUME_APPLY
+C       |-- SALT_PLUME_APPLY
+C       |-- SALT_PLUME_FORCING_SURF
+C       |
+C       |-- KPP_CALC
+C       |-- KPP_CALC_DUMMY
+C       |
+C       |-- PP81_CALC
+C       |
+C       |-- KL10_CALC
+C       |
+C       |-- MY82_CALC
+C       |
+C       |-- GGL90_CALC
+C       |
+C       |-- TIMEAVE_SURF_FLUX
+C       |
+C       |-- GMREDI_CALC_TENSOR
+C       |-- GMREDI_CALC_TENSOR_DUMMY
+C       |
+C       |-- DWNSLP_CALC_FLOW
+C       |-- DWNSLP_CALC_FLOW
+C       |
+C       |-- OFFLINE_GET_DIFFUS
+C       |
+C       |-- BBL_CALC_RHS
+C       |
+C       |-- MYPACKAGE_CALC_RHS
+C       |
+C       |-- GMREDI_DO_EXCH
+C       |
+C       |-- KPP_DO_EXCH
+C       |
+C       |-- DIAGS_RHO_G
+C       |-- DIAGS_OCEANIC_SURF_FLUX
+C       |-- SALT_PLUME_DIAGNOSTICS_FILL
+C       |
+C       |-- ECCO_PHYS
+
+C     !USES:
+      IMPLICIT NONE
+C     == Global variables ===
+#include "SIZE.h"
+#include "EEPARAMS.h"
+#include "PARAMS.h"
+#include "GRID.h"
+#include "DYNVARS.h"
+#ifdef ALLOW_TIMEAVE
+# include "TIMEAVE_STATV.h"
+#endif
+#ifdef ALLOW_OFFLINE
+# include "OFFLINE_SWITCH.h"
+#endif
+
+#ifdef ALLOW_AUTODIFF
+# include "AUTODIFF_MYFIELDS.h"
+# include "tamc.h"
+# include "tamc_keys.h"
+# include "FFIELDS.h"
+# include "SURFACE.h"
+# include "EOS.h"
+# ifdef ALLOW_GMREDI
+#  include "GMREDI.h"
+# endif
+# ifdef ALLOW_KPP
+#  include "KPP.h"
+# endif
+# ifdef ALLOW_GGL90
+#  include "GGL90.h"
+# endif
+# ifdef ALLOW_EBM
+#  include "EBM.h"
+# endif
+# ifdef ALLOW_EXF
+#  include "ctrl.h"
+#  include "EXF_FIELDS.h"
+#  ifdef ALLOW_BULKFORMULAE
+#   include "EXF_CONSTANTS.h"
+#  endif
+# endif
+# ifdef ALLOW_SEAICE
+#  include "SEAICE_SIZE.h"
+#  include "SEAICE.h"
+#  include "SEAICE_PARAMS.h"
+# endif
+# ifdef ALLOW_THSICE
+#  include "THSICE_VARS.h"
+# endif
+# ifdef ALLOW_SALT_PLUME
+#  include "SALT_PLUME.h"
+# endif
+# ifdef ALLOW_ECCO
+#  ifdef ALLOW_SIGMAR_COST_CONTRIBUTION
+#   include "ecco_cost.h"
+#  endif
+# endif
+#endif /* ALLOW_AUTODIFF */
+
+C     !INPUT/OUTPUT PARAMETERS:
+C     == Routine arguments ==
+C     myTime :: Current time in simulation
+C     myIter :: Current iteration number in simulation
+C     myThid :: Thread number for this instance of the routine.
+      _RL myTime
+      INTEGER myIter
+      INTEGER myThid
+
+C     !LOCAL VARIABLES:
+C     == Local variables
+C     rhoK, rhoKm1  :: Density at current level, and level above
+C     iMin, iMax    :: Ranges and sub-block indices on which calculations
+C     jMin, jMax       are applied.
+C     bi, bj        :: tile indices
+C     msgBuf        :: Temp. for building output string
+C     i,j,k         :: loop indices
+      _RL rhoKp1  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
+      _RL rhoKm1  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
+      _RL sigmaX  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
+      _RL sigmaY  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
+      _RL sigmaR  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
+      INTEGER iMin, iMax
+      INTEGER jMin, jMax
+      INTEGER bi, bj
+      INTEGER i, j, k
+      CHARACTER*(MAX_LEN_MBUF) msgBuf
+      INTEGER doDiagsRho
+      LOGICAL calcGMRedi, calcKPP, calcConvect
+#ifdef ALLOW_DIAGNOSTICS
+      LOGICAL  DIAGNOSTICS_IS_ON
+      EXTERNAL DIAGNOSTICS_IS_ON
+#endif /* ALLOW_DIAGNOSTICS */
+#ifdef ALLOW_AUTODIFF
+      _RL thetaRef
+#endif /* ALLOW_AUTODIFF */
+CEOP
+
+#ifdef ALLOW_AUTODIFF_TAMC
+C--   dummy statement to end declaration part
+      itdkey = 1
+#endif /* ALLOW_AUTODIFF_TAMC */
+
+#ifdef ALLOW_DEBUG
+      IF (debugMode) CALL DEBUG_ENTER('DO_OCEANIC_PHYS',myThid)
+#endif
+
+      doDiagsRho = 0
+#ifdef ALLOW_DIAGNOSTICS
+      IF ( useDiagnostics .AND. fluidIsWater ) THEN
+        IF ( DIAGNOSTICS_IS_ON('MXLDEPTH',myThid) )
+     &       doDiagsRho = doDiagsRho + 1
+        IF ( DIAGNOSTICS_IS_ON('DRHODR  ',myThid) )
+     &       doDiagsRho = doDiagsRho + 2
+        IF ( DIAGNOSTICS_IS_ON('WdRHO_P ',myThid) )
+     &       doDiagsRho = doDiagsRho + 4
+        IF ( DIAGNOSTICS_IS_ON('WdRHOdP ',myThid) )
+     &       doDiagsRho = doDiagsRho + 8
+      ENDIF
+#endif /* ALLOW_DIAGNOSTICS */
+
+      calcGMRedi  = useGMRedi
+      calcKPP     = useKPP
+      calcConvect = ivdc_kappa.NE.0.
+#ifdef ALLOW_OFFLINE
+      IF ( useOffLine ) THEN
+        calcGMRedi = useGMRedi .AND. .NOT.offlineLoadGMRedi
+        calcKPP    = useKPP    .AND. .NOT.offlineLoadKPP
+        calcConvect=calcConvect.AND. .NOT.offlineLoadConvec
+      ENDIF
+#endif /* ALLOW_OFFLINE */
+
+#ifdef  ALLOW_OBCS
+      IF (useOBCS) THEN
+C--   Calculate future values on open boundaries
+C--   moved before SEAICE_MODEL call since SEAICE_MODEL needs seaice-obcs fields
+# ifdef ALLOW_AUTODIFF_TAMC
+CADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE salt  = comlev1, key=ikey_dynamics, kind=isbyte
+# endif
+# ifdef ALLOW_DEBUG
+       IF (debugMode) CALL DEBUG_CALL('OBCS_CALC',myThid)
+# endif
+       CALL OBCS_CALC( myTime+deltaTClock, myIter+1,
+     I                 uVel, vVel, wVel, theta, salt, myThid )
+      ENDIF
+#endif  /* ALLOW_OBCS */
+
+#ifdef ALLOW_OCN_COMPON_INTERF
+C--    Apply imported data (from coupled interface) to forcing fields
+C jmc: moved here before any freezing/seaice pkg adjustment of surf-fluxes
+      IF ( useCoupler ) THEN
+         CALL OCN_APPLY_IMPORT( .TRUE., myTime, myIter, myThid )
+      ENDIF
+#endif /* ALLOW_OCN_COMPON_INTERF */
+
+#ifdef ALLOW_AUTODIFF
+# ifdef ALLOW_SALT_PLUME
+      DO bj=myByLo(myThid),myByHi(myThid)
+       DO bi=myBxLo(myThid),myBxHi(myThid)
+        DO j=1-OLy,sNy+OLy
+         DO i=1-OLx,sNx+OLx
+          saltPlumeDepth(i,j,bi,bj) = 0. _d 0
+          saltPlumeFlux(i,j,bi,bj)  = 0. _d 0
+         ENDDO
+        ENDDO
+       ENDDO
+      ENDDO
+# endif
+# ifdef ALLOW_ECCO
+#  ifdef ALLOW_SIGMAR_COST_CONTRIBUTION
+      DO bj=myByLo(myThid),myByHi(myThid)
+       DO bi=myBxLo(myThid),myBxHi(myThid)
+        DO k=1,Nr
+         DO j=1-OLy,sNy+OLy
+          DO i=1-OLx,sNx+OLx
+           sigmaRfield(i,j,k,bi,bj) = 0. _d 0
+          ENDDO
+         ENDDO
+        ENDDO
+       ENDDO
+      ENDDO
+#  endif
+# endif
+#endif /* ALLOW_AUTODIFF */
+
+#ifdef ALLOW_FRAZIL
+      IF ( useFRAZIL ) THEN
+C--   Freeze water in the ocean interior and let it rise to the surface
+CADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE salt  = comlev1, key=ikey_dynamics, kind=isbyte
+       CALL FRAZIL_CALC_RHS( myTime, myIter, myThid )
+      ENDIF
+#endif /* ALLOW_FRAZIL */
+
+#ifndef OLD_THSICE_CALL_SEQUENCE
+#if (defined ALLOW_THSICE) && !(defined ALLOW_ATM2D)
+      IF ( useThSIce .AND. fluidIsWater ) THEN
+# ifdef ALLOW_AUTODIFF_TAMC
+CADJ STORE uice,vice         = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE iceMask,iceHeight = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE snowHeight, Tsrf  = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE Qice1, Qice2      = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE sHeating, snowAge = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE hocemxl = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE icflxsw = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE salt,theta        = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE uvel,vvel         = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE qnet,qsw, empmr   = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE atemp,aqh,precip  = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE swdown,lwdown     = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+#  ifdef NONLIN_FRSURF
+CADJ STORE hFac_surfC       = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+#  endif
+# endif /* ALLOW_AUTODIFF_TAMC */
+# ifdef ALLOW_DEBUG
+        IF (debugMode) CALL DEBUG_CALL('THSICE_MAIN',myThid)
+# endif
+C--     Step forward Therm.Sea-Ice variables
+C       and modify forcing terms including effects from ice
+        CALL TIMER_START('THSICE_MAIN     [DO_OCEANIC_PHYS]', myThid)
+        CALL THSICE_MAIN( myTime, myIter, myThid )
+        CALL TIMER_STOP( 'THSICE_MAIN     [DO_OCEANIC_PHYS]', myThid)
+      ENDIF
+#endif /* ALLOW_THSICE */
+#endif /* ndef OLD_THSICE_CALL_SEQUENCE */
+
+#ifdef ALLOW_SEAICE
+# ifdef ALLOW_AUTODIFF
+CADJ STORE area   = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE fu,fv  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE qnet   = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE qsw    = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE theta  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE salt   = comlev1, key=ikey_dynamics, kind=isbyte
+#if (defined ALLOW_EXF) && (defined ALLOW_ATM_TEMP)
+CADJ STORE evap   = comlev1, key=ikey_dynamics, kind=isbyte
+#endif
+      IF ( .NOT.useSEAICE .AND. SEAICEadjMODE .EQ. -1 ) THEN
+        CALL SEAICE_FAKE( myTime, myIter, myThid )
+      ENDIF
+CADJ STORE area   = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE fu,fv  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE qnet   = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE qsw    = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE theta  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE salt   = comlev1, key=ikey_dynamics, kind=isbyte
+#if (defined ALLOW_EXF) && (defined ALLOW_ATM_TEMP)
+CADJ STORE evap   = comlev1, key=ikey_dynamics, kind=isbyte
+#endif
+# endif /* ALLOW_AUTODIFF */
+#endif /* ALLOW_SEAICE */
+
+#ifdef ALLOW_SEAICE
+      IF ( useSEAICE ) THEN
+# ifdef ALLOW_AUTODIFF_TAMC
+cph-adj-test(
+CADJ STORE area   = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE hsnow  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE heff   = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE tices  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE empmr, qnet  = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE qsw,saltflux = comlev1, key=ikey_dynamics, kind=isbyte
+CADJ STORE fu, fv = comlev1, key=ikey_dynamics, kind=isbyte
+cCADJ STORE theta  = comlev1, key=ikey_dynamics, kind=isbyte
+cCADJ STORE salt   = comlev1, key=ikey_dynamics, kind=isbyte
+cph-adj-test)
+c#ifdef ALLOW_EXF
+CADJ STORE atemp,aqh,precip    = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE swdown,lwdown       = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE evap                = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE uwind,vwind         = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+c#endif
+CADJ STORE uvel,vvel           = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+#  ifdef SEAICE_CGRID
+CADJ STORE stressdivergencex   = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE stressdivergencey   = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+#  endif
+#  ifdef SEAICE_ALLOW_DYNAMICS
+CADJ STORE uice                = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE vice                = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE dwatn               = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+#   ifdef SEAICE_ALLOW_EVP
+CADJ STORE seaice_sigma1       = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE seaice_sigma2       = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE seaice_sigma12      = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+#   endif
+#  endif
+#  ifdef SEAICE_VARIABLE_SALINITY
+CADJ STORE hsalt               = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+#  endif
+#  ifdef ATMOSPHERIC_LOADING
+CADJ STORE pload               = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE siceload            = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+#  endif
+#  ifdef NONLIN_FRSURF
+CADJ STORE recip_hfacc         = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+#  endif
+#  ifdef ANNUAL_BALANCE
+CADJ STORE balance_itcount     = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+#  endif /* ANNUAL_BALANCE */
+#  ifdef ALLOW_THSICE
+C-- store thSIce vars before advection (called from SEAICE_MODEL) update them:
+CADJ STORE iceMask,iceHeight = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE snowHeight, hOceMxL = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE Qice1, Qice2  = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+#  endif /* ALLOW_THSICE */
+# endif /* ALLOW_AUTODIFF_TAMC */
+# ifdef ALLOW_DEBUG
+        IF (debugMode) CALL DEBUG_CALL('SEAICE_MODEL',myThid)
+# endif
+        CALL TIMER_START('SEAICE_MODEL    [DO_OCEANIC_PHYS]', myThid)
+        CALL SEAICE_MODEL( myTime, myIter, myThid )
+        CALL TIMER_STOP ('SEAICE_MODEL    [DO_OCEANIC_PHYS]', myThid)
+# ifdef ALLOW_COST
+        CALL SEAICE_COST_SENSI ( myTime, myIter, myThid )
+# endif
+      ENDIF
+#endif /* ALLOW_SEAICE */
+
+#if (defined ALLOW_OCN_COMPON_INTERF) && (defined ALLOW_THSICE)
+C--   After seaice-dyn and advection of pkg/thsice fields,
+C     Export ocean coupling fields to coupled interface (only with pkg/thsice)
+      IF ( useCoupler ) THEN
+# ifdef ALLOW_DEBUG
+        IF (debugMode) CALL DEBUG_CALL('OCN_EXPORT_DATA',myThid)
+# endif
+         CALL TIMER_START('OCN_EXPORT_DATA [DO_OCEANIC_PHYS]', myThid)
+         CALL OCN_EXPORT_DATA( myTime, myIter, myThid )
+         CALL TIMER_STOP ('OCN_EXPORT_DATA [DO_OCEANIC_PHYS]', myThid)
+      ENDIF
+#endif /* ALLOW_OCN_COMPON_INTERF & ALLOW_THSICE */
+
+#ifdef ALLOW_AUTODIFF_TAMC
+CADJ STORE sst, sss           = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE qsw                = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+# ifdef ALLOW_SEAICE
+CADJ STORE area               = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+# endif
+#endif
+
+#ifdef OLD_THSICE_CALL_SEQUENCE
+#if (defined ALLOW_THSICE) && !(defined ALLOW_ATM2D)
+      IF ( useThSIce .AND. fluidIsWater ) THEN
+# ifdef ALLOW_AUTODIFF_TAMC
+cph(
+#  ifdef NONLIN_FRSURF
+CADJ STORE uice,vice        = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE salt,theta       = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE qnet,qsw, empmr  = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE hFac_surfC       = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+#  endif
+# endif
+# ifdef ALLOW_DEBUG
+        IF (debugMode) CALL DEBUG_CALL('THSICE_MAIN',myThid)
+# endif
+C--     Step forward Therm.Sea-Ice variables
+C       and modify forcing terms including effects from ice
+        CALL TIMER_START('THSICE_MAIN     [DO_OCEANIC_PHYS]', myThid)
+        CALL THSICE_MAIN( myTime, myIter, myThid )
+        CALL TIMER_STOP( 'THSICE_MAIN     [DO_OCEANIC_PHYS]', myThid)
+      ENDIF
+#endif /* ALLOW_THSICE */
+#endif /* OLD_THSICE_CALL_SEQUENCE */
+
+#ifdef ALLOW_CPL_ISSM
+      IF ( useCoupler) CALL CPL_ISSM( myTime, myIter, myThid )
+#endif
+
+#ifdef ALLOW_SHELFICE
+      IF ( useShelfIce .AND. fluidIsWater ) THEN
+#ifdef ALLOW_DEBUG
+       IF (debugMode) CALL DEBUG_CALL('SHELFICE_THERMODYNAMICS',myThid)
+#endif
+#ifdef ALLOW_AUTODIFF_TAMC
+CADJ STORE salt, theta = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+CADJ STORE uvel, vvel = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+#endif
+C     compute temperature and (virtual) salt flux at the
+C     shelf-ice ocean interface
+       CALL TIMER_START('SHELFICE_THERMODYNAMICS [DO_OCEANIC_PHYS]',
+     &       myThid)
+       CALL SHELFICE_THERMODYNAMICS( myTime, myIter, myThid )
+       CALL TIMER_STOP( 'SHELFICE_THERMODYNAMICS [DO_OCEANIC_PHYS]',
+     &      myThid)
+      ENDIF
+#endif /* ALLOW_SHELFICE */
+
+#ifdef ALLOW_ICEFRONT
+      IF ( useICEFRONT .AND. fluidIsWater ) THEN
+#ifdef ALLOW_DEBUG
+       IF (debugMode) CALL DEBUG_CALL('ICEFRONT_THERMODYNAMICS',myThid)
+#endif
+C     compute temperature and (virtual) salt flux at the
+C     ice-front ocean interface
+       CALL TIMER_START('ICEFRONT_THERMODYNAMICS [DO_OCEANIC_PHYS]',
+     &       myThid)
+       CALL ICEFRONT_THERMODYNAMICS( myTime, myIter, myThid )
+       CALL TIMER_STOP( 'ICEFRONT_THERMODYNAMICS [DO_OCEANIC_PHYS]',
+     &      myThid)
+      ENDIF
+#endif /* ALLOW_ICEFRONT */
+
+#ifdef ALLOW_SALT_PLUME
+      IF ( useSALT_PLUME ) THEN
+Catn: exchanging saltPlumeFlux:
+          CALL SALT_PLUME_DO_EXCH( myTime, myIter, myThid )
+      ENDIF
+#endif /* ALLOW_SALT_PLUME */
+
+C--   Freeze water at the surface
+      IF ( allowFreezing ) THEN
+#ifdef ALLOW_AUTODIFF_TAMC
+CADJ STORE theta = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+#endif
+        CALL FREEZE_SURFACE( myTime, myIter, myThid )
+      ENDIF
+
+      iMin = 1-OLx
+      iMax = sNx+OLx
+      jMin = 1-OLy
+      jMax = sNy+OLy
+
+C---  Determines forcing terms based on external fields
+C     relaxation terms, etc.
+#ifdef ALLOW_AUTODIFF
+CADJ STORE salt, theta = comlev1, key = ikey_dynamics,
+CADJ &     kind = isbyte
+#else  /* ALLOW_AUTODIFF */
+C--   if fluid is not water, by-pass surfaceForcing, find_rho, gmredi
+C     and all vertical mixing schemes, but keep OBCS_CALC
+      IF ( fluidIsWater ) THEN
+#endif /* ALLOW_AUTODIFF */
+#ifdef ALLOW_DEBUG
+      IF (debugMode) CALL DEBUG_CALL('EXTERNAL_FORCING_SURF',myThid)
+#endif
+        CALL EXTERNAL_FORCING_SURF(
+     I             iMin, iMax, jMin, jMax,
+     I             myTime, myIter, myThid )
+
+#ifdef ALLOW_AUTODIFF_TAMC
+C--   HPF directive to help TAMC
+CHPF$ INDEPENDENT
+#endif /* ALLOW_AUTODIFF_TAMC */
+      DO bj=myByLo(myThid),myByHi(myThid)
+#ifdef ALLOW_AUTODIFF_TAMC
+C--   HPF directive to help TAMC
+CHPF$ INDEPENDENT
+#endif /* ALLOW_AUTODIFF_TAMC */
+       DO bi=myBxLo(myThid),myBxHi(myThid)
+
+#ifdef ALLOW_AUTODIFF_TAMC
+          act1 = bi - myBxLo(myThid)
+          max1 = myBxHi(myThid) - myBxLo(myThid) + 1
+          act2 = bj - myByLo(myThid)
+          max2 = myByHi(myThid) - myByLo(myThid) + 1
+          act3 = myThid - 1
+          max3 = nTx*nTy
+          act4 = ikey_dynamics - 1
+          itdkey = (act1 + 1) + act2*max1
+     &                      + act3*max1*max2
+     &                      + act4*max1*max2*max3
+#endif /* ALLOW_AUTODIFF_TAMC */
+
+C--   Set up work arrays with valid (i.e. not NaN) values
+C     These inital values do not alter the numerical results. They
+C     just ensure that all memory references are to valid floating
+C     point numbers. This prevents spurious hardware signals due to
+C     uninitialised but inert locations.
+        DO k=1,Nr
+         DO j=1-OLy,sNy+OLy
+          DO i=1-OLx,sNx+OLx
+C This is currently used by GMRedi, IVDC, MXL-depth  and Diagnostics
+           sigmaX(i,j,k) = 0. _d 0
+           sigmaY(i,j,k) = 0. _d 0
+           sigmaR(i,j,k) = 0. _d 0
+          ENDDO
+         ENDDO
+        ENDDO
+
+#ifdef ALLOW_AUTODIFF
+        DO j=1-OLy,sNy+OLy
+         DO i=1-OLx,sNx+OLx
+          rhoKm1 (i,j)   = 0. _d 0
+          rhoKp1 (i,j)   = 0. _d 0
+         ENDDO
+        ENDDO
+cph all the following init. are necessary for TAF
+cph although some of these are re-initialised later.
+        DO k=1,Nr
+         DO j=1-OLy,sNy+OLy
+          DO i=1-OLx,sNx+OLx
+           rhoInSitu(i,j,k,bi,bj) = 0.
+# ifdef ALLOW_GGL90
+           GGL90viscArU(i,j,k,bi,bj)  = 0. _d 0
+           GGL90viscArV(i,j,k,bi,bj)  = 0. _d 0
+           GGL90diffKr(i,j,k,bi,bj)  = 0. _d 0
+# endif /* ALLOW_GGL90 */
+# ifdef ALLOW_SALT_PLUME
+#  ifdef SALT_PLUME_VOLUME
+           SPforcingS(i,j,k,bi,bj) = 0. _d 0
+           SPforcingT(i,j,k,bi,bj) = 0. _d 0
+#  endif
+# endif /* ALLOW_SALT_PLUME */
+          ENDDO
+         ENDDO
+        ENDDO
+#ifdef ALLOW_OFFLINE
+       IF ( calcConvect ) THEN
+#endif
+        DO k=1,Nr
+         DO j=1-OLy,sNy+OLy
+          DO i=1-OLx,sNx+OLx
+           IVDConvCount(i,j,k,bi,bj) = 0.
+          ENDDO
+         ENDDO
+        ENDDO
+#ifdef ALLOW_OFFLINE
+       ENDIF
+       IF ( calcGMRedi ) THEN
+#endif
+# ifdef ALLOW_GMREDI
+        DO k=1,Nr
+         DO j=1-OLy,sNy+OLy
+          DO i=1-OLx,sNx+OLx
+           Kwx(i,j,k,bi,bj)  = 0. _d 0
+           Kwy(i,j,k,bi,bj)  = 0. _d 0
+           Kwz(i,j,k,bi,bj)  = 0. _d 0
+#  ifdef GM_NON_UNITY_DIAGONAL
+           Kux(i,j,k,bi,bj)  = 0. _d 0
+           Kvy(i,j,k,bi,bj)  = 0. _d 0
+#  endif
+#  ifdef GM_EXTRA_DIAGONAL
+           Kuz(i,j,k,bi,bj)  = 0. _d 0
+           Kvz(i,j,k,bi,bj)  = 0. _d 0
+#  endif
+#  ifdef GM_BOLUS_ADVEC
+           GM_PsiX(i,j,k,bi,bj)  = 0. _d 0
+           GM_PsiY(i,j,k,bi,bj)  = 0. _d 0
+#  endif
+#  ifdef GM_VISBECK_VARIABLE_K
+           VisbeckK(i,j,bi,bj)   = 0. _d 0
+#  endif
+          ENDDO
+         ENDDO
+        ENDDO
+# endif /* ALLOW_GMREDI */
+#ifdef ALLOW_OFFLINE
+       ENDIF
+       IF ( calcKPP ) THEN
+#endif
+# ifdef ALLOW_KPP
+        DO k=1,Nr
+         DO j=1-OLy,sNy+OLy
+          DO i=1-OLx,sNx+OLx
+           KPPdiffKzS(i,j,k,bi,bj)  = 0. _d 0
+           KPPdiffKzT(i,j,k,bi,bj)  = 0. _d 0
+          ENDDO
+         ENDDO
+        ENDDO
+# endif /* ALLOW_KPP */
+#ifdef ALLOW_OFFLINE
+       ENDIF
+#endif
+#endif /* ALLOW_AUTODIFF */
+
+#ifdef ALLOW_AUTODIFF_TAMC
+CADJ STORE theta(:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
+CADJ &     kind = isbyte
+CADJ STORE salt (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
+CADJ &     kind = isbyte
+CADJ STORE totphihyd(:,:,:,bi,bj)
+CADJ &     = comlev1_bibj, key=itdkey,
+CADJ &     kind = isbyte
+# ifdef ALLOW_KPP
+CADJ STORE uvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
+CADJ &     kind = isbyte
+CADJ STORE vvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
+CADJ &     kind = isbyte
+# endif
+# ifdef ALLOW_SALT_PLUME
+CADJ STORE saltplumedepth(:,:,bi,bj) = comlev1_bibj, key=itdkey,
+CADJ &     kind = isbyte
+CADJ STORE saltplumeflux(:,:,bi,bj) = comlev1_bibj, key=itdkey,
+CADJ &     kind = isbyte
+# endif
+#endif /* ALLOW_AUTODIFF_TAMC */
+
+C--   Always compute density (stored in common block) here; even when it is not
+C     needed here, will be used anyway in calc_phi_hyd (data flow easier this way)
+#ifdef ALLOW_DEBUG
+        IF (debugMode) CALL DEBUG_CALL('FIND_RHO_2D (xNr)',myThid)
+#endif
+#ifdef ALLOW_AUTODIFF
+        IF ( fluidIsWater ) THEN
+#endif /* ALLOW_AUTODIFF */
+#ifdef ALLOW_DOWN_SLOPE
+         IF ( useDOWN_SLOPE ) THEN
+           DO k=1,Nr
+            CALL DWNSLP_CALC_RHO(
+     I                  theta, salt,
+     O                  rhoInSitu(1-OLx,1-OLy,k,bi,bj),
+     I                  k, bi, bj, myTime, myIter, myThid )
+           ENDDO
+         ENDIF
+#endif /* ALLOW_DOWN_SLOPE */
+#ifdef ALLOW_BBL
+         IF ( useBBL ) THEN
+C     pkg/bbl requires in-situ bbl density for depths equal to and deeper than the bbl.
+C     To reduce computation and storage requirement, these densities are stored in the
+C     dry grid boxes of rhoInSitu.  See BBL_CALC_RHO for details.
+           DO k=Nr,1,-1
+            CALL BBL_CALC_RHO(
+     I                  theta, salt,
+     O                  rhoInSitu,
+     I                  k, bi, bj, myTime, myIter, myThid )
+
+           ENDDO
+         ENDIF
+#endif /* ALLOW_BBL */
+         IF ( .NOT. ( useDOWN_SLOPE .OR. useBBL ) ) THEN
+           DO k=1,Nr
+            CALL FIND_RHO_2D(
+     I                iMin, iMax, jMin, jMax, k,
+     I                theta(1-OLx,1-OLy,k,bi,bj),
+     I                salt (1-OLx,1-OLy,k,bi,bj),
+     O                rhoInSitu(1-OLx,1-OLy,k,bi,bj),
+     I                k, bi, bj, myThid )
+           ENDDO
+         ENDIF
+#ifdef ALLOW_AUTODIFF
+        ELSE
+C-        fluid is not water:
+          DO k=1,Nr
+           IF ( select_rStar.GE.1 .OR. selectSigmaCoord.GE.1 ) THEN
+C-    isothermal (theta=const) reference state
+             thetaRef = thetaConst
+           ELSE
+C-    horizontally uniform (tRef) reference state
+             thetaRef = tRef(k)
+           ENDIF
+           DO j=1-OLy,sNy+OLy
+            DO i=1-OLx,sNx+OLx
+             rhoInSitu(i,j,k,bi,bj) =
+     &         ( theta(i,j,k,bi,bj)
+     &              *( salt(i,j,k,bi,bj)*atm_Rq + oneRL )
+     &         - thetaRef )*maskC(i,j,k,bi,bj)
+            ENDDO
+           ENDDO
+          ENDDO
+        ENDIF
+#endif /* ALLOW_AUTODIFF */
+
+#ifdef ALLOW_DEBUG
+        IF (debugMode) THEN
+          WRITE(msgBuf,'(A,2(I4,A))')
+     &         'ENTERING UPWARD K LOOP (bi=', bi, ', bj=', bj,')'
+          CALL DEBUG_MSG(msgBuf(1:43),myThid)
+        ENDIF
+#endif
+
+C--     Start of diagnostic loop
+        DO k=Nr,1,-1
+
+#ifdef ALLOW_AUTODIFF_TAMC
+C? Patrick, is this formula correct now that we change the loop range?
+C? Do we still need this?
+cph kkey formula corrected.
+cph Needed for rhoK, rhoKm1, in the case useGMREDI.
+          kkey = (itdkey-1)*Nr + k
+#endif /* ALLOW_AUTODIFF_TAMC */
+
+c#ifdef ALLOW_AUTODIFF_TAMC
+cCADJ STORE theta(:,:,k,bi,bj) = comlev1_bibj_k, key=kkey,
+cCADJ &     kind = isbyte
+cCADJ STORE salt(:,:,k,bi,bj)  = comlev1_bibj_k, key=kkey,
+cCADJ &     kind = isbyte
+c#endif /* ALLOW_AUTODIFF_TAMC */
+
+C--       Calculate gradients of potential density for isoneutral
+C         slope terms (e.g. GM/Redi tensor or IVDC diffusivity)
+          IF ( calcGMRedi .OR. (k.GT.1 .AND. calcConvect)
+     &         .OR. usePP81 .OR. useKL10
+     &         .OR. useMY82 .OR. useGGL90
+     &         .OR. useSALT_PLUME .OR. doDiagsRho.GE.1 ) THEN
+            IF (k.GT.1) THEN
+#ifdef ALLOW_AUTODIFF_TAMC
+CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,
+CADJ &     kind = isbyte
+CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,
+CADJ &     kind = isbyte
+CADJ STORE rhokm1 (bi,bj)       = comlev1_bibj_k, key=kkey,
+CADJ &     kind = isbyte
+#endif /* ALLOW_AUTODIFF_TAMC */
+             CALL FIND_RHO_2D(
+     I                 iMin, iMax, jMin, jMax, k,
+     I                 theta(1-OLx,1-OLy,k-1,bi,bj),
+     I                 salt (1-OLx,1-OLy,k-1,bi,bj),
+     O                 rhoKm1,
+     I                 k-1, bi, bj, myThid )
+            ENDIF
+#ifdef ALLOW_DEBUG
+            IF (debugMode) CALL DEBUG_CALL('GRAD_SIGMA',myThid)
+#endif
+cph Avoid variable aliasing for adjoint !!!
+            DO j=jMin,jMax
+             DO i=iMin,iMax
+              rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj)
+             ENDDO
+            ENDDO
+            CALL GRAD_SIGMA(
+     I             bi, bj, iMin, iMax, jMin, jMax, k,
+     I             rhoInSitu(1-OLx,1-OLy,k,bi,bj), rhoKm1, rhoKp1,
+     O             sigmaX, sigmaY, sigmaR,
+     I             myThid )
+#ifdef ALLOW_ECCO
+# ifdef ALLOW_SIGMAR_COST_CONTRIBUTION
+            DO j=jMin,jMax
+             DO i=iMin,iMax
+              sigmaRfield(i,j,k,bi,bj)=sigmaR(i,j,k)
+             ENDDO
+            ENDDO
+# endif
+#endif /* ALLOW_ECCO */
+#ifdef ALLOW_AUTODIFF
+#ifdef GMREDI_WITH_STABLE_ADJOINT
+cgf zero out adjoint fields to stabilize pkg/gmredi adjoint
+cgf -> cuts adjoint dependency from slope to state
+            CALL ZERO_ADJ_LOC( Nr, sigmaX, myThid)
+            CALL ZERO_ADJ_LOC( Nr, sigmaY, myThid)
+            CALL ZERO_ADJ_LOC( Nr, sigmaR, myThid)
+#endif
+#endif /* ALLOW_AUTODIFF */
+          ENDIF
+
+C--       Implicit Vertical Diffusion for Convection
+          IF (k.GT.1 .AND. calcConvect) THEN
+#ifdef ALLOW_DEBUG
+            IF (debugMode) CALL DEBUG_CALL('CALC_IVDC',myThid)
+#endif
+            CALL CALC_IVDC(
+     I        bi, bj, iMin, iMax, jMin, jMax, k,
+     I        sigmaR,
+     I        myTime, myIter, myThid)
+          ENDIF
+
+#ifdef ALLOW_DIAGNOSTICS
+          IF ( doDiagsRho.GE.4 ) THEN
+            CALL DIAGS_RHO_L( doDiagsRho, k, bi, bj,
+     I                        rhoInSitu(1-OLx,1-OLy,1,bi,bj),
+     I                        rhoKm1, wVel,
+     I                        myTime, myIter, myThid )
+          ENDIF
+#endif
+
+C--     end of diagnostic k loop (Nr:1)
+        ENDDO
+
+#ifdef ALLOW_AUTODIFF_TAMC
+CADJ STORE IVDConvCount(:,:,:,bi,bj)
+CADJ &     = comlev1_bibj, key=itdkey,
+CADJ &     kind = isbyte
+#endif
+
+C--     Diagnose Mixed Layer Depth:
+        IF ( calcGMRedi .OR. MOD(doDiagsRho,2).EQ.1 ) THEN
+          CALL CALC_OCE_MXLAYER(
+     I              rhoInSitu(1-OLx,1-OLy,1,bi,bj), sigmaR,
+     I              bi, bj, myTime, myIter, myThid )
+        ENDIF
+
+#ifdef ALLOW_SALT_PLUME
+        IF ( useSALT_PLUME ) THEN
+          CALL SALT_PLUME_CALC_DEPTH(
+     I              rhoInSitu(1-OLx,1-OLy,1,bi,bj), sigmaR,
+     I              bi, bj, myTime, myIter, myThid )
+#ifdef SALT_PLUME_VOLUME
+          CALL SALT_PLUME_VOLFRAC(
+     I              bi, bj, myTime, myIter, myThid )
+C-- get forcings for kpp
+          CALL SALT_PLUME_APPLY(
+     I              1, bi, bj, recip_hFacC(1-OLx,1-OLy,1,bi,bj),
+     I              theta, 0,
+     I              myTime, myIter, myThid )
+          CALL SALT_PLUME_APPLY(
+     I              2, bi, bj, recip_hFacC(1-OLx,1-OLy,1,bi,bj),
+     I              salt, 0,
+     I              myTime, myIter, myThid )
+C-- need to call this S/R from here to apply just before kpp
+          CALL SALT_PLUME_FORCING_SURF(
+     I              bi, bj, iMin, iMax, jMin, jMax,
+     I              myTime, myIter, myThid )
+#endif /* SALT_PLUME_VOLUME */
+        ENDIF
+#endif /* ALLOW_SALT_PLUME */
+
+#ifdef ALLOW_DIAGNOSTICS
+        IF ( MOD(doDiagsRho,4).GE.2 ) THEN
+          CALL DIAGNOSTICS_FILL (sigmaR, 'DRHODR  ', 0, Nr,
+     &         2, bi, bj, myThid)
+        ENDIF
+#endif /* ALLOW_DIAGNOSTICS */
+
+C--    This is where EXTERNAL_FORCING_SURF(bi,bj) used to be called;
+C      now called earlier, before bi,bj loop.
+
+#ifdef ALLOW_AUTODIFF_TAMC
+cph needed for KPP
+CADJ STORE surfaceForcingU(:,:,bi,bj)
+CADJ &     = comlev1_bibj, key=itdkey,
+CADJ &     kind = isbyte
+CADJ STORE surfaceForcingV(:,:,bi,bj)
+CADJ &     = comlev1_bibj, key=itdkey,
+CADJ &     kind = isbyte
+CADJ STORE surfaceForcingS(:,:,bi,bj)
+CADJ &     = comlev1_bibj, key=itdkey,
+CADJ &     kind = isbyte
+CADJ STORE surfaceForcingT(:,:,bi,bj)
+CADJ &     = comlev1_bibj, key=itdkey,
+CADJ &     kind = isbyte
+CADJ STORE surfaceForcingTice(:,:,bi,bj)
+CADJ &     = comlev1_bibj, key=itdkey,
+CADJ &     kind = isbyte
+#endif /* ALLOW_AUTODIFF_TAMC */
+
+#ifdef  ALLOW_KPP
+C--     Compute KPP mixing coefficients
+        IF ( calcKPP ) THEN
+#ifdef ALLOW_DEBUG
+          IF (debugMode) CALL DEBUG_CALL('KPP_CALC',myThid)
+#endif
+          CALL TIMER_START('KPP_CALC [DO_OCEANIC_PHYS]', myThid)
+          CALL KPP_CALC(
+     I                  bi, bj, myTime, myIter, myThid )
+          CALL TIMER_STOP ('KPP_CALC [DO_OCEANIC_PHYS]', myThid)
+#if (defined ALLOW_AUTODIFF) && !(defined ALLOW_OFFLINE)
+        ELSE
+          CALL KPP_CALC_DUMMY(
+     I                  bi, bj, myTime, myIter, myThid )
+#endif /* ALLOW_AUTODIFF and not ALLOW_OFFLINE */
+        ENDIF
+#endif  /* ALLOW_KPP */
+
+#ifdef  ALLOW_PP81
+C--     Compute PP81 mixing coefficients
+        IF (usePP81) THEN
+#ifdef ALLOW_DEBUG
+          IF (debugMode) CALL DEBUG_CALL('PP81_CALC',myThid)
+#endif
+          CALL PP81_CALC(
+     I                     bi, bj, sigmaR, myTime, myIter, myThid )
+        ENDIF
+#endif /* ALLOW_PP81 */
+
+#ifdef  ALLOW_KL10
+C--     Compute KL10 mixing coefficients
+        IF (useKL10) THEN
+#ifdef ALLOW_DEBUG
+          IF (debugMode) CALL DEBUG_CALL('KL10_CALC',myThid)
+#endif
+          CALL KL10_CALC(
+     I                     bi, bj, sigmaR, myTime, myIter, myThid )
+        ENDIF
+#endif /* ALLOW_KL10 */
+
+#ifdef  ALLOW_MY82
+C--     Compute MY82 mixing coefficients
+        IF (useMY82) THEN
+#ifdef ALLOW_DEBUG
+          IF (debugMode) CALL DEBUG_CALL('MY82_CALC',myThid)
+#endif
+          CALL MY82_CALC(
+     I                     bi, bj, sigmaR, myTime, myIter, myThid )
+        ENDIF
+#endif /* ALLOW_MY82 */
+
+#ifdef  ALLOW_GGL90
+#ifdef ALLOW_AUTODIFF_TAMC
+CADJ STORE GGL90TKE (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
+CADJ &     kind = isbyte
+#endif /* ALLOW_AUTODIFF_TAMC */
+C--     Compute GGL90 mixing coefficients
+        IF (useGGL90) THEN
+#ifdef ALLOW_DEBUG
+          IF (debugMode) CALL DEBUG_CALL('GGL90_CALC',myThid)
+#endif
+          CALL TIMER_START('GGL90_CALC [DO_OCEANIC_PHYS]', myThid)
+          CALL GGL90_CALC(
+     I                     bi, bj, sigmaR, myTime, myIter, myThid )
+          CALL TIMER_STOP ('GGL90_CALC [DO_OCEANIC_PHYS]', myThid)
+        ENDIF
+#endif /* ALLOW_GGL90 */
+
+#ifdef ALLOW_TIMEAVE
+        IF ( taveFreq.GT. 0. _d 0 ) THEN
+          CALL TIMEAVE_SURF_FLUX( bi, bj, myTime, myIter, myThid)
+        ENDIF
+        IF ( taveFreq.GT.0. .AND. calcConvect ) THEN
+          CALL TIMEAVE_CUMULATE(ConvectCountTave, IVDConvCount,
+     I                           Nr, deltaTClock, bi, bj, myThid)
+        ENDIF
+#endif /* ALLOW_TIMEAVE */
+
+#ifdef ALLOW_GMREDI
+#ifdef ALLOW_AUTODIFF_TAMC
+# ifndef GM_EXCLUDE_CLIPPING
+cph storing here is needed only for one GMREDI_OPTIONS:
+cph define GM_BOLUS_ADVEC
+cph keep it although TAF says you dont need to.
+cph but I have avoided the #ifdef for now, in case more things change
+CADJ STORE sigmaX(:,:,:)        = comlev1_bibj, key=itdkey,
+CADJ &     kind = isbyte
+CADJ STORE sigmaY(:,:,:)        = comlev1_bibj, key=itdkey,
+CADJ &     kind = isbyte
+CADJ STORE sigmaR(:,:,:)        = comlev1_bibj, key=itdkey,
+CADJ &     kind = isbyte
+# endif
+#endif /* ALLOW_AUTODIFF_TAMC */
+
+C--     Calculate iso-neutral slopes for the GM/Redi parameterisation
+        IF ( calcGMRedi ) THEN
+#ifdef ALLOW_DEBUG
+          IF (debugMode) CALL DEBUG_CALL('GMREDI_CALC_TENSOR',myThid)
+#endif
+          CALL GMREDI_CALC_TENSOR(
+     I             iMin, iMax, jMin, jMax,
+     I             sigmaX, sigmaY, sigmaR,
+     I             bi, bj, myTime, myIter, myThid )
+#if (defined ALLOW_AUTODIFF) && !(defined ALLOW_OFFLINE)
+        ELSE
+          CALL GMREDI_CALC_TENSOR_DUMMY(
+     I             iMin, iMax, jMin, jMax,
+     I             sigmaX, sigmaY, sigmaR,
+     I             bi, bj, myTime, myIter, myThid )
+#endif /* ALLOW_AUTODIFF and not ALLOW_OFFLINE */
+        ENDIF
+#endif /* ALLOW_GMREDI */
+
+#ifdef ALLOW_DOWN_SLOPE
+        IF ( useDOWN_SLOPE ) THEN
+C--     Calculate Downsloping Flow for Down_Slope parameterization
+         IF ( usingPCoords ) THEN
+          CALL DWNSLP_CALC_FLOW(
+     I                bi, bj, kSurfC, rhoInSitu,
+     I                myTime, myIter, myThid )
+         ELSE
+          CALL DWNSLP_CALC_FLOW(
+     I                bi, bj, kLowC, rhoInSitu,
+     I                myTime, myIter, myThid )
+         ENDIF
+        ENDIF
+#endif /* ALLOW_DOWN_SLOPE */
+
+C--   end bi,bj loops.
+       ENDDO
+      ENDDO
+
+#ifndef ALLOW_AUTODIFF
+C---  if fluid Is Water: end
+      ENDIF
+#endif
+
+#ifdef ALLOW_OFFLINE
+      IF ( useOffLine ) THEN
+#ifdef ALLOW_DEBUG
+        IF (debugMode) CALL DEBUG_CALL('OFFLINE_GET_DIFFUS',myThid)
+#endif /* ALLOW_DEBUG */
+        CALL OFFLINE_GET_DIFFUS( myTime, myIter, myThid )
+      ENDIF
+#endif /* ALLOW_OFFLINE */
+
+#ifdef ALLOW_BBL
+      IF ( useBBL ) THEN
+       CALL BBL_CALC_RHS(
+     I                          myTime, myIter, myThid )
+      ENDIF
+#endif /* ALLOW_BBL */
+
+#ifdef ALLOW_MYPACKAGE
+      IF ( useMYPACKAGE ) THEN
+       CALL MYPACKAGE_CALC_RHS(
+     I                          myTime, myIter, myThid )
+      ENDIF
+#endif /* ALLOW_MYPACKAGE */
+
+#ifdef ALLOW_GMREDI
+      IF ( calcGMRedi ) THEN
+        CALL GMREDI_DO_EXCH( myTime, myIter, myThid )
+      ENDIF
+#endif /* ALLOW_GMREDI */
+
+#ifdef ALLOW_KPP
+      IF ( calcKPP ) THEN
+        CALL KPP_DO_EXCH( myThid )
+      ENDIF
+#endif /* ALLOW_KPP */
+
+#ifdef ALLOW_DIAGNOSTICS
+      IF ( fluidIsWater .AND. useDiagnostics ) THEN
+        CALL DIAGS_RHO_G(
+     I                    rhoInSitu, uVel, vVel, wVel,
+     I                    myTime, myIter, myThid )
+      ENDIF
+      IF ( useDiagnostics ) THEN
+        CALL DIAGS_OCEANIC_SURF_FLUX( myTime, myIter, myThid )
+      ENDIF
+      IF ( calcConvect .AND. useDiagnostics ) THEN
+        CALL DIAGNOSTICS_FILL( IVDConvCount, 'CONVADJ ',
+     &                               0, Nr, 0, 1, 1, myThid )
+      ENDIF
+#ifdef ALLOW_SALT_PLUME
+      IF ( useDiagnostics )
+     &      CALL SALT_PLUME_DIAGNOSTICS_FILL(bi,bj,myThid)
+#endif
+#endif
+
+#ifdef ALLOW_DEBUG
+      IF (debugMode) CALL DEBUG_LEAVE('DO_OCEANIC_PHYS',myThid)
+#endif
+
+      RETURN
+      END
Index: /issm/trunk/test/MITgcm/code_4003/eeboot_minimal.F
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/eeboot_minimal.F	(revision 24313)
+++ /issm/trunk/test/MITgcm/code_4003/eeboot_minimal.F	(revision 24313)
@@ -0,0 +1,306 @@
+#include "PACKAGES_CONFIG.h"
+#include "CPP_EEOPTIONS.h"
+
+CBOP
+C     !ROUTINE: EEBOOT_MINIMAL
+
+C     !INTERFACE:
+      SUBROUTINE EEBOOT_MINIMAL( myComm )
+
+C     !DESCRIPTION:
+C     *==========================================================*
+C     | SUBROUTINE EEBOOT\_MINIMAL
+C     | o Set an initial environment that is predictable i.e.
+C     | behaves in a similar way on all machines and stable.
+C     *==========================================================*
+C     | Under MPI this routine calls MPI\_INIT to setup the
+C     | mpi environment ( on some systems the code is running as
+C     | a single process prior to MPI\_INIT, on others the mpirun
+C     | script has already created multiple processes). Until
+C     | MPI\_Init is called it is unclear what state the
+C     | application is in. Once this routine has been run it is
+C     | "safe" to do things like I/O to report erros and to get
+C     | run parameters.
+C     | Note: This routine can also be compiled with CPP
+C     | directives set so that no multi-processing is initialise.
+C     | This is OK and will work fine.
+C     *==========================================================*
+
+C     !USES:
+      IMPLICIT NONE
+C     == Global data ==
+#include "SIZE.h"
+#include "EEPARAMS.h"
+#include "EESUPPORT.h"
+
+C     !ROUTINE ARGUMENTS
+C     == Routine arguments ==
+C     myComm     :: Communicator that is passed down from
+C                   upper level driver (if there is one).
+      INTEGER myComm
+
+C     !LOCAL VARIABLES:
+C     == Local variables ==
+C     myThid     :: Temp. dummy thread number.
+C     fNam       :: Used to build file name for standard and error output.
+C     msgBuf     :: Used to build messages for printing.
+      INTEGER myThid
+#ifdef USE_PDAF
+      CHARACTER*18 fNam
+#else
+      CHARACTER*13 fNam
+#endif /* USE_PDAF */
+      CHARACTER*(MAX_LEN_MBUF) msgBuf
+#ifdef ALLOW_USE_MPI
+C     mpiRC      :: Error code reporting variable used with MPI.
+      INTEGER mpiRC
+      INTEGER mpiIsInitialized
+      LOGICAL doReport
+#if defined(ALLOW_OASIS) || defined(COMPONENT_MODULE)
+      INTEGER mpiMyWid
+#endif
+#ifdef ALLOW_CPL_ISSM
+      COMMON /CPL_MPI_ID/ mpiMyWid, toissmcomm
+      INTEGER             mpiMyWid, toissmcomm
+      INTEGER my_local_rank,my_local_size, numprocsworld
+      INTEGER status(MPI_STATUS_SIZE)
+#endif /* ALLOW_CPL_ISSM */
+#if defined(ALLOW_NEST_PARENT) || defined(ALLOW_NEST_CHILD)
+      INTEGER mpiMyWid, color
+#endif
+#ifdef USE_PDAF
+      INTEGER mpi_task_id
+#endif /* USE_PDAF */
+#endif /* ALLOW_USE_MPI */
+CEOP
+
+C--   Default values set to single processor case
+      numberOfProcs = 1
+      myProcId      = 0
+      pidIO         = myProcId
+      myProcessStr  = '------'
+C     Set a dummy value for myThid because we are not multi-threading yet.
+      myThid        = 1
+
+C     Annoyingly there is no universal way to have the usingMPI
+C     parameter work as one might expect. This is because, on some
+C     systems I/O does not work until MPI_Init has been called.
+C     The solution for now is that the parameter below may need to
+C     be changed manually!
+#ifdef ALLOW_USE_MPI
+      usingMPI = .TRUE.
+#else
+      usingMPI = .FALSE.
+#endif
+
+      IF ( .NOT.usingMPI ) THEN
+
+        WRITE(myProcessStr,'(I4.4)') myProcId
+        WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:4)
+        OPEN(errorMessageUnit,FILE=fNam,STATUS='unknown')
+c       WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:4)
+c       OPEN(standardMessageUnit,FILE=fNam,STATUS='unknown')
+
+#ifdef ALLOW_USE_MPI
+      ELSE
+C--   MPI style multiple-process initialisation
+C--   =========================================
+
+       CALL MPI_Initialized( mpiIsInitialized, mpiRC )
+
+       IF ( mpiIsInitialized .EQ. 0 ) THEN
+C--     Initialise MPI multi-process parallel environment.
+C       On some systems program forks at this point. Others have already
+C       forked within mpirun - now thats an open standard!
+        CALL MPI_INIT( mpiRC )
+        IF ( mpiRC .NE. MPI_SUCCESS ) THEN
+         eeBootError = .TRUE.
+         WRITE(msgBuf,'(A,I5)')
+     &        'EEBOOT_MINIMAL: MPI_INIT return code', mpiRC
+         CALL PRINT_ERROR( msgBuf, myThid )
+         GOTO 999
+        ENDIF
+
+C--     MPI has now been initialized ; now we need to either
+C       ask for a communicator or pretend that we have:
+C       Pretend that we have asked for a communicator
+        MPI_COMM_MODEL = MPI_COMM_WORLD
+
+       ELSE
+C--     MPI was already initialized and communicator has been passed
+C       down from upper level driver
+        MPI_COMM_MODEL = myComm
+
+       ENDIF
+
+       doReport = .FALSE.
+#ifdef USE_PDAF
+C     initialize PDAF
+C     for more output increase second parameter from 1 to 2
+       CALL INIT_PARALLEL_PDAF(0, 1, MPI_COMM_MODEL, MPI_COMM_MODEL,
+     &      mpi_task_id)
+#endif /* USE_PDAF */
+
+#ifdef ALLOW_OASIS
+C      add a 1rst preliminary call EESET_PARAMS to set useOASIS
+C      (needed to decide either to call OASIS_INIT or not)
+       CALL MPI_COMM_RANK( MPI_COMM_WORLD, mpiMyWId, mpiRC )
+       CALL EESET_PARMS ( mpiMyWId, doReport )
+       IF ( useOASIS ) CALL OASIS_INIT(MPI_COMM_MODEL)
+#endif /* ALLOW_OASIS */
+
+#ifdef COMPONENT_MODULE
+C--    Set the running directory
+       CALL MPI_COMM_RANK( MPI_COMM_WORLD, mpiMyWId, mpiRC )
+       CALL SETDIR( mpiMyWId )
+
+C- jmc: test:
+C      add a 1rst preliminary call EESET_PARAMS to set useCoupler
+C      (needed to decide either to call CPL_INIT or not)
+       CALL EESET_PARMS ( mpiMyWId, doReport )
+C- jmc: test end ; otherwise, uncomment next line:
+c      useCoupler = .TRUE.
+
+C--    Ask coupler interface for a communicator
+       IF ( useCoupler) CALL CPL_INIT
+#endif /* COMPONENT_MODULE */
+
+C--    Case with Nest(ing)
+#if defined(ALLOW_NEST_PARENT) || defined(ALLOW_NEST_CHILD)
+C--    Set the running directory
+       CALL MPI_COMM_RANK( MPI_COMM_WORLD, mpiMyWId, mpiRC )
+       CALL SETDIR( mpiMyWId )
+
+C--    Setup Nesting Execution Environment
+       CALL NEST_EEINIT( mpiMyWId, color )
+#endif /* ALLOW_NEST_PARENT | ALLOW_NEST_CHILD */
+
+#ifdef ALLOW_CPL_ISSM
+C     add a 1rst preliminary call EESET_PARAMS to set useCoupler
+       CALL MPI_COMM_RANK(MPI_COMM_WORLD, mpiMyWid, mpiRC)
+       CALL EESET_PARMS ( mpiMyWId, doReport )
+
+       IF ( useCoupler ) THEN
+          CALL MPI_COMM_SIZE(MPI_COMM_WORLD, numprocsworld, mpiRC)
+
+c     Split world into sub-communicators for each and every model:*/
+          CALL MPI_COMM_SPLIT(MPI_COMM_WORLD,1,MPIMYWID,
+     &         MPI_COMM_MODEL,mpiRC)
+
+          print*,'Oc My global rank',mpiMyWid
+          print*,'Oc My world size:',numprocsworld
+
+          CALL MPI_INTERCOMM_CREATE(MPI_COMM_MODEL,0,MPI_COMM_WORLD,
+     &         0,0,toissmcomm,mpiRC)
+
+          CALL MPI_COMM_RANK(MPI_COMM_MODEL, my_local_rank, mpiRC)
+          CALL MPI_COMM_SIZE(MPI_COMM_MODEL, my_local_size, mpiRC)
+
+          print*,'Oc My global rank',mpiMyWid,'MyLocal rank: ',
+     &         my_local_rank
+          print*,'Oc My world size:',numprocsworld,'My local size: ',
+     &         my_local_size
+       ENDIF
+#endif /* ALLOW_CPL_ISSM */
+
+C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
+
+C--    Get my process number
+       CALL MPI_COMM_RANK( MPI_COMM_MODEL, mpiMyId, mpiRC )
+       IF ( mpiRC .NE. MPI_SUCCESS ) THEN
+        eeBootError = .TRUE.
+        WRITE(msgBuf,'(A,I5)')
+     &        'EEBOOT_MINIMAL: MPI_COMM_RANK return code', mpiRC
+        CALL PRINT_ERROR( msgBuf, myThid )
+        GOTO 999
+       ENDIF
+       myProcId = mpiMyId
+#ifdef USE_PDAF
+       WRITE(myProcessStr,'(I4.4,A1,I4.4)') mpi_task_id,'.',myProcId
+#else
+       WRITE(myProcessStr,'(I4.4)') myProcId
+#endif /* USE_PDAF */
+       mpiPidIo = myProcId
+       pidIO    = mpiPidIo
+       IF ( mpiPidIo .EQ. myProcId ) THEN
+#ifdef SINGLE_DISK_IO
+        IF( myProcId .EQ. 0 ) THEN
+#endif
+         WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:4)
+#ifdef USE_PDAF
+         WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:9)
+#endif
+         OPEN(errorMessageUnit,FILE=fNam,STATUS='unknown')
+         WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:4)
+#ifdef USE_PDAF
+         WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:9)
+#endif
+         OPEN(standardMessageUnit,FILE=fNam,STATUS='unknown')
+#ifdef SINGLE_DISK_IO
+        ELSE
+         OPEN(errorMessageUnit,FILE='/dev/null',STATUS='unknown')
+         standardMessageUnit=errorMessageUnit
+        ENDIF
+        IF( myProcId .EQ. 0 ) THEN
+          WRITE(msgBuf,'(2A)') '** WARNING ** EEBOOT_MINIMAL: ',
+     &     'defined SINGLE_DISK_IO will result in losing'
+          CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
+     &                        SQUEEZE_RIGHT, myThid )
+          WRITE(msgBuf,'(2A)') '** WARNING ** EEBOOT_MINIMAL: ',
+     &     'any message (error/warning) from any proc <> 0'
+          CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
+     &                        SQUEEZE_RIGHT, myThid )
+        ENDIF
+#endif
+       ENDIF
+
+#if defined(ALLOW_NEST_PARENT) || defined(ALLOW_NEST_CHILD)
+       WRITE(standardMessageUnit,'(2(A,I6))')
+     &           ' mpiMyWId =', mpiMyWId, ' , color =',color
+#endif /* ALLOW_NEST_PARENT | ALLOW_NEST_CHILD */
+
+C--    Synchronise all processes
+C      Strictly this is superfluous, but by using it we can guarantee to
+C      find out about processes that did not start up.
+       CALL MPI_BARRIER( MPI_COMM_MODEL, mpiRC )
+       IF ( mpiRC .NE. MPI_SUCCESS ) THEN
+        eeBootError = .TRUE.
+        WRITE(msgBuf,'(A,I6)')
+     &        'EEBOOT_MINIMAL: MPI_BARRIER return code', mpiRC
+        CALL PRINT_ERROR( msgBuf, myThid )
+        GOTO 999
+       ENDIF
+
+C--    Get number of MPI processes
+       CALL MPI_COMM_SIZE ( MPI_COMM_MODEL, mpiNProcs, mpiRC )
+       IF ( mpiRC .NE. MPI_SUCCESS ) THEN
+        eeBootError = .TRUE.
+        WRITE(msgBuf,'(A,I6)')
+     &        'EEBOOT_MINIMAL: MPI_COMM_SIZE return code', mpiRC
+        CALL PRINT_ERROR( msgBuf, myThid )
+        GOTO 999
+       ENDIF
+       numberOfProcs = mpiNProcs
+
+#endif /* ALLOW_USE_MPI */
+      ENDIF
+
+C--    Under MPI only allow same number of processes as proc grid size.
+C      Strictly we are allowed more procs but knowing there
+C      is an exact match makes things easier.
+       IF ( numberOfProcs .NE. nPx*nPy ) THEN
+        eeBootError = .TRUE.
+        WRITE(msgBuf,'(2(A,I6))')
+     &  'EEBOOT_MINIMAL: No. of procs=', numberOfProcs,
+     &  ' not equal to nPx*nPy=', nPx*nPy
+        CALL PRINT_ERROR( msgBuf, myThid )
+        GOTO 999
+       ENDIF
+
+#ifdef USE_LIBHPM
+       CALL F_HPMINIT(myProcId, "mitgcmuv")
+#endif
+
+ 999  CONTINUE
+      RETURN
+      END
Index: /issm/trunk/test/MITgcm/code_4003/eedie.F
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/eedie.F	(revision 24313)
+++ /issm/trunk/test/MITgcm/code_4003/eedie.F	(revision 24313)
@@ -0,0 +1,107 @@
+#include "CPP_EEOPTIONS.h"
+#ifdef USE_LIBHPM
+# include "f_hpm.h"
+#endif
+
+CBOP
+      SUBROUTINE EEDIE
+C     *==========================================================*
+C     | SUBROUTINE EEDIE                                         |
+C     | o Close execution "environment", particularly perform    |
+C     |   steps to terminate parallel processing.                |
+C     *==========================================================*
+C     | Note: This routine can also be compiled with CPP         |
+C     | directives set so that no multi-processing is initialised|
+C     | This is OK and should work fine.                         |
+C     *==========================================================*
+      IMPLICIT NONE
+
+C     == Global variables ==
+#include "SIZE.h"
+#include "EEPARAMS.h"
+#include "EESUPPORT.h"
+CEOP
+
+C     == Local variables ==
+C     msgBuf       :: I/O Buffer
+C     nThreadsDone :: Used to count number of completed threads.
+C     I            :: Loop counter.
+      CHARACTER*(MAX_LEN_MBUF) msgBuf
+      INTEGER nThreadsDone
+      INTEGER I
+#ifdef ALLOW_USE_MPI
+C     mpiRC        :: Error code reporting variable used with MPI.
+      INTEGER mpiRC
+#endif /* ALLOW_USE_MPI */
+
+      IF ( eeBootError ) THEN
+C--   Skip ended threads counting if earlier error was found
+        WRITE(msgBuf,'(2A)')
+     &   'EEDIE: earlier error in multi-proc/thread setting'
+        CALL PRINT_ERROR( msgBuf, 1 )
+        fatalError = .TRUE.
+
+      ELSE
+C--   Check that all the threads have ended
+C     No thread should reach this loop before all threads have set
+C     threadIsComplete to TRUE. If they do then either there is a bug
+C     in the code or the behaviour of the parallel compiler directives
+C     are not right for this code. In the latter case different
+C     directives may be available or the compiler itself may have a
+C     bug or you may need a different parallel compiler for main.F
+        nThreadsDone = 0
+        DO I = 1, nThreads
+         IF ( threadIsComplete(I) ) nThreadsDone = nThreadsDone+1
+        ENDDO
+        IF ( nThreadsDone .LT. nThreads ) THEN
+         WRITE(msgBuf,'(A,I5,A)')
+     &    'S/R EEDIE: Only',nThreadsDone,' threads have completed,'
+         CALL PRINT_ERROR( msgBuf, 1 )
+         WRITE(msgBuf,'(A,I5,A)')
+     &    'S/R EEDIE:',nThreads,' are expected for this config !'
+         CALL PRINT_ERROR( msgBuf, 1 )
+         eeEndError = .TRUE.
+         fatalError = .TRUE.
+        ENDIF
+
+C--   end if/else eebootError
+      ENDIF
+
+#ifdef USE_LIBHPM
+      CALL F_HPMTERMINATE(myProcId)
+#endif
+
+C--   Flush IO-unit before MPI termination
+      CALL MDS_FLUSH( errorMessageUnit, 1 )
+c#ifdef ALLOW_USE_MPI
+      CALL MDS_FLUSH( standardMessageUnit, 1 )
+c#endif /* ALLOW_USE_MPI */
+
+#ifdef ALLOW_USE_MPI
+C- Note: since MPI_INIT is always called, better to also always terminate MPI
+C        (even if usingMPI=F) --> comment out test on usingMPI
+c     IF ( usingMPI ) THEN
+
+C--   MPI style multiple-process termination
+C--   ======================================
+#if (defined COMPONENT_MODULE) || (defined ALLOW_CPL_ISSM)
+       IF ( useCoupler) CALL MPI_BARRIER( MPI_COMM_WORLD, mpiRC )
+#endif
+#ifdef ALLOW_OASIS
+       IF ( useOASIS ) CALL OASIS_FINALIZE
+#endif
+       CALL MPI_FINALIZE  ( mpiRC )
+       IF ( mpiRC .NE. MPI_SUCCESS ) THEN
+        eeEndError = .TRUE.
+        fatalError = .TRUE.
+        WRITE(msgBuf,'(A,I5)')
+     &       'S/R FIN_PROCS: MPI_FINALIZE return code',
+     &       mpiRC
+        CALL PRINT_ERROR( msgBuf, 1 )
+       ENDIF
+
+c     ENDIF
+#endif /* ALLOW_USE_MPI */
+
+      RETURN
+      END
Index: /issm/trunk/test/MITgcm/code_4003/packages.conf
===================================================================
--- /issm/trunk/test/MITgcm/code_4003/packages.conf	(revision 24313)
+++ /issm/trunk/test/MITgcm/code_4003/packages.conf	(revision 24313)
@@ -0,0 +1,5 @@
+gfd
+shelfice
+streamice
+obcs
+diagnostics
Index: /issm/trunk/test/MITgcm/get_mitgcm_dngoldberg.sh
===================================================================
--- /issm/trunk/test/MITgcm/get_mitgcm_dngoldberg.sh	(revision 24313)
+++ /issm/trunk/test/MITgcm/get_mitgcm_dngoldberg.sh	(revision 24313)
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+if [ -e ~/.bashrc ]; then 
+	source ~/.bashrc
+fi
+
+# Download fresh copy of MITgcm
+cd ../MITgcm/
+if [ ! -d install_dngoldberg ]; then
+    source install_dngoldberg.sh
+else
+    cd install_dngoldberg
+    git pull
+    cd ..
+fi
Index: /issm/trunk/test/MITgcm/input_4003/data
===================================================================
--- /issm/trunk/test/MITgcm/input_4003/data	(revision 24313)
+++ /issm/trunk/test/MITgcm/input_4003/data	(revision 24313)
@@ -0,0 +1,133 @@
+#:::====================
+# | Model parameters |
+# ====================
+#
+# Continuous equation parameters
+ &PARM01
+# momstepping=.FALSE.,
+# tempstepping=.FALSE.,
+# saltstepping=.FALSE.,
+ Tref = 90*-1.9,
+ Sref = 90*34.4,
+ viscAr=1.E-3,
+#viscAh=600.0,
+ viscAhGrid=0.2,
+ viscA4Grid=0.02,
+ no_slip_sides=.FALSE.,
+ no_slip_bottom=.FALSE.,
+ diffKhT= 100.0,
+#diffKhT= 600.0,
+ diffKrT=5.E-5,
+ diffKhS= 100.0,
+#diffKhS= 600.0,
+ diffKrS=5.E-5,
+ bottomDragQuadratic=2.5E-3,
+ staggerTimestep = .true.,
+ tempAdvScheme=30,
+ saltAdvScheme=30,
+ vectorInvariantMomentum = .true.,
+### momImplVertAdv=.true.,
+ tempImplVertAdv=.true.,
+ saltImplVertAdv=.true.,
+ eosType='JMD95Z',
+#tAlpha = 2.E-4,
+#sBeta  = 7.4E-4,
+ HeatCapacity_cp = 3974.0,
+ rhoConst=1000.,
+ rhoNil=1000.,
+ gravity=9.81,
+ gBaro=9.81,
+ implicitDiffusion = .true.,
+ implicitViscosity = .true.,
+ rigidLid=.FALSE.,
+ implicitFreeSurface=.TRUE.,
+ useRealFreshWaterFlux = .true.,
+ exactConserv=.TRUE.,
+# start nlfs with rstar
+#select_rStar=2,
+ nonlinFreeSurf=4,
+ hFacInf=0.2,
+ hFacSup=2.0,
+# end nlfs with rstar
+ hFacMin=0.2,
+#integr_GeoPot = 1,
+#ivdc_kappa = 0.005.,
+#implicitDiffusion=.true.,
+#implicitViscosity=.true.,
+#useCDscheme=.true.,
+#nonHydrostatic=.true.,
+#allowFreezing = .true.,
+ readBinaryPrec=64,
+#writeBinaryPrec=64,
+ debuglevel = 5,
+ selectCoriMap = 0,
+ f0 = 0.0,
+ useSingleCpuIO=.TRUE.,
+ globalFiles=.TRUE.,
+ useCoriolis=.TRUE.,
+ &
+
+# Elliptic solver parameters
+ &PARM02
+ cg2dMaxIters=300,
+ cg2dTargetResidual=1.E-11,
+# cg2dMinColumnEps = 1.
+# pReleaseVisc = 1.
+#cg3dMaxIters=40,
+#cg3dTargetResidual=1.E-13,
+ &
+
+#Time stepping parameters
+ &PARM03
+ niter0=11395,
+ nTimeSteps=1440,
+# nTimeSteps=20,
+# startTime=0.,
+# startTime = 0.,
+#startTime=62208000.,
+#startTime=15552000.,
+#endTime=31104000.,
+#endTime=86400.,
+# deltaT=300.0,
+ deltaT=60.0,
+### deltaT=1200.0,
+ forcing_In_AB  = .false.,
+#rCD = 0.9896,
+ abEps=0.1,
+ cAdjFreq = -1.,
+ pChkptFreq=3000,
+ chkptFreq=3000.0,
+# pChkptFreq=600.0,
+# chkptFreq=600.0,
+ dumpFreq=3000,
+# monitorFreq=15552000.,
+# monitorSelect=0,
+ monitorFreq=60.,
+ &
+
+# Gridding parameters
+ &PARM04
+ useMin4hFacEdges=.TRUE.,
+ usingCartesianGrid=.FALSE.,
+ usingSphericalPolarGrid=.TRUE.,
+#delR = 10., 10., 10., 10., 10., 10., 10., 10.01, 10.03, 10.11,
+#10.32, 10.8, 11.76, 13.42, 16.04, 19.82, 24.85, 31.1, 38.42, 46.5,
+#55., 63.5, 71.58, 78.9, 85.15, 90.18, 93.96, 96.58, 98.25, 99.25,
+#100.01, 101.33, 104.56, 111.33, 122.83, 139.09, 158.94, 180.83, 203.55, 226.5,
+#249.5, 272.5, 295.5, 318.5, 341.5, 364.5, 387.5, 410.5, 433.5, 456.5,
+ delR=90*10.,
+ delX=3*.125,
+ delY=200*.0078125,
+# delYFile='dlat.bin',
+# delY=30*10e3,
+ xgOrigin = -105.5,
+ ygOrigin =  -75.4457,
+ &
+
+# Input datasets
+ &PARM05
+ bathyFile='bathy.box',
+ hydrogThetaFile='theta.init',	
+ hydrogSaltFile='salt.init',
+ pSurfInitFile='etainit.round.bin',
+ &
Index: /issm/trunk/test/MITgcm/input_4003/data_uncoupled
===================================================================
--- /issm/trunk/test/MITgcm/input_4003/data_uncoupled	(revision 24313)
+++ /issm/trunk/test/MITgcm/input_4003/data_uncoupled	(revision 24313)
@@ -0,0 +1,131 @@
+#:::====================
+# | Model parameters |
+# ====================
+#
+# Continuous equation parameters
+ &PARM01
+# momstepping=.FALSE.,
+# tempstepping=.FALSE.,
+# saltstepping=.FALSE.,
+ Tref = 90*-1.9,
+ Sref = 90*34.4,
+ viscAr=1.E-3,
+#viscAh=600.0,
+ viscAhGrid=0.2,
+ viscA4Grid=0.02,
+ no_slip_sides=.FALSE.,
+ no_slip_bottom=.FALSE.,
+ diffKhT= 100.0,
+#diffKhT= 600.0,
+ diffKrT=5.E-5,
+ diffKhS= 100.0,
+#diffKhS= 600.0,
+ diffKrS=5.E-5,
+ bottomDragQuadratic=2.5E-3,
+ staggerTimestep = .true.,
+ tempAdvScheme=30,
+ saltAdvScheme=30,
+ vectorInvariantMomentum = .true.,
+### momImplVertAdv=.true.,
+ tempImplVertAdv=.true.,
+ saltImplVertAdv=.true.,
+ eosType='JMD95Z',
+#tAlpha = 2.E-4,
+#sBeta  = 7.4E-4,
+ HeatCapacity_cp = 3974.0,
+ rhoConst=1000.,
+ rhoNil=1000.,
+ gravity=9.81,
+ gBaro=9.81,
+ implicitDiffusion = .true.,
+ implicitViscosity = .true.,
+ rigidLid=.FALSE.,
+ implicitFreeSurface=.TRUE.,
+ useRealFreshWaterFlux = .true.,
+ exactConserv=.TRUE.,
+# start nlfs with rstar
+#select_rStar=2,
+ nonlinFreeSurf=4,
+ hFacInf=0.2,
+ hFacSup=2.0,
+# end nlfs with rstar
+ hFacMin=0.2,
+#integr_GeoPot = 1,
+#ivdc_kappa = 0.005.,
+#implicitDiffusion=.true.,
+#implicitViscosity=.true.,
+#useCDscheme=.true.,
+#nonHydrostatic=.true.,
+#allowFreezing = .true.,
+ readBinaryPrec=64,
+#writeBinaryPrec=64,
+ debuglevel = 5,
+ selectCoriMap = 0,
+ f0 = 0.0,
+ useSingleCpuIO=.TRUE.,
+ globalFiles=.TRUE.,
+ useCoriolis=.TRUE.,
+ &
+
+# Elliptic solver parameters
+ &PARM02
+ cg2dMaxIters=300,
+ cg2dTargetResidual=1.E-11,
+# cg2dMinColumnEps = 1.
+# pReleaseVisc = 1.
+#cg3dMaxIters=40,
+#cg3dTargetResidual=1.E-13,
+ &
+
+#Time stepping parameters
+ &PARM03
+  niter0=11395,
+# nTimeSteps=25920000,
+ nTimeSteps=20,
+# startTime=0.,
+# startTime = 0.,
+#startTime=62208000.,
+#startTime=15552000.,
+#endTime=31104000.,
+ deltaT=300.0,
+### deltaT=1200.0,
+ forcing_In_AB  = .false.,
+#rCD = 0.9896,
+ abEps=0.1,
+ cAdjFreq = -1.,
+ pChkptFreq=3000,
+ chkptFreq=3000.0,
+# pChkptFreq=600.0,
+# chkptFreq=600.0,
+ dumpFreq=3000,
+# monitorFreq=15552000.,
+# monitorSelect=0,
+# monitorFreq=31104000.,
+ &
+
+# Gridding parameters
+ &PARM04
+ useMin4hFacEdges=.TRUE.,
+ usingCartesianGrid=.FALSE.,
+ usingSphericalPolarGrid=.TRUE.,
+#delR = 10., 10., 10., 10., 10., 10., 10., 10.01, 10.03, 10.11,
+#10.32, 10.8, 11.76, 13.42, 16.04, 19.82, 24.85, 31.1, 38.42, 46.5,
+#55., 63.5, 71.58, 78.9, 85.15, 90.18, 93.96, 96.58, 98.25, 99.25,
+#100.01, 101.33, 104.56, 111.33, 122.83, 139.09, 158.94, 180.83, 203.55, 226.5,
+#249.5, 272.5, 295.5, 318.5, 341.5, 364.5, 387.5, 410.5, 433.5, 456.5,
+ delR=90*10.,
+ delX=3*.125,
+ delY=200*.0078125,
+# delYFile='dlat.bin',
+# delY=30*10e3,
+ xgOrigin = -105.5,
+ ygOrigin =  -75.4457,
+ &
+
+# Input datasets
+ &PARM05
+ bathyFile='bathy.box',
+ hydrogThetaFile='theta.init',	
+ hydrogSaltFile='salt.init',
+ pSurfInitFile='etainit.round.bin',
+ &
Index: /issm/trunk/test/MITgcm/input_4003/eedata
===================================================================
--- /issm/trunk/test/MITgcm/input_4003/eedata	(revision 24313)
+++ /issm/trunk/test/MITgcm/input_4003/eedata	(revision 24313)
@@ -0,0 +1,11 @@
+# Example "eedata" file
+# Lines beginning "#" are comments
+# nTx - No. threads per process in X
+# nTy - No. threads per process in Y
+ &EEPARMS
+ useCoupler=.TRUE.,
+ debugMode=.TRUE.,
+ &
+# Note: Some systems use & as the
+# namelist terminator. Other systems
+# use a / character (as shown here).
Index: /issm/trunk/test/MITgcm/input_4003/eedata_uncoupled
===================================================================
--- /issm/trunk/test/MITgcm/input_4003/eedata_uncoupled	(revision 24313)
+++ /issm/trunk/test/MITgcm/input_4003/eedata_uncoupled	(revision 24313)
@@ -0,0 +1,11 @@
+# Example "eedata" file
+# Lines beginning "#" are comments
+# nTx - No. threads per process in X
+# nTy - No. threads per process in Y
+ &EEPARMS
+ useCoupler=.FALSE.,
+# debugMode=.TRUE.,
+ &
+# Note: Some systems use & as the
+# namelist terminator. Other systems
+# use a / character (as shown here).
Index: /issm/trunk/test/MITgcm/install_dngoldberg.sh
===================================================================
--- /issm/trunk/test/MITgcm/install_dngoldberg.sh	(revision 24313)
+++ /issm/trunk/test/MITgcm/install_dngoldberg.sh	(revision 24313)
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install_dngoldberg
+
+#Download code from server
+git clone https://github.com/dngoldberg/MITgcm
+cd MITgcm
+git checkout branch_remeshing
+cd ..
+
+#Move
+mv MITgcm install_dngoldberg
Index: /issm/trunk/test/NightlyRun/GetIds.py
===================================================================
--- /issm/trunk/test/NightlyRun/GetIds.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/GetIds.py	(revision 24313)
@@ -1,66 +1,66 @@
-#! /usr/bin/env python
+#!/usr/bin/env python
 from IdToName import *
 from IdFromString import *
 import numpy as np
 
+
 def GetIds(ids_names):
-	"""
-	GetIds - output ids from a given array of IDs and test names
+    """
+     GetIds - output ids from a given array of IDs and test names
 
-		 the test names can be any string or sub-string present
-		 in the test's name (first line of corresponding file)
+              the test names can be any string or sub - string present
+              in the test's name (first line of corresponding file)
 
-		 test names are case sensitive
- 
-	    Usage:
-		ids=GetIds(101)
-		ids=GetIds('Dakota')
-		ids=GetIds([101,102...])
-		ids=GetIds([\'Dakota\',\'Slr\'...])
-		ids=GetIds([[101,102...],[\'Dakota\',\'Slr\'...]])
-	"""
+              test names are case sensitive
 
-	ids = []
+         Usage:
+             ids = GetIds(101)
+             ids = GetIds('Dakota')
+             ids = GetIds([101, 102...])
+             ids = GetIds([\'Dakota\', \'Slr\'...])
+             ids = GetIds([[101, 102...], [\'Dakota\', \'Slr\'...]])
+    """
 
-	# 1 input, either an id or a test name
-	if type(ids_names) == str:
-		ids = IdFromString(ids_names)
-		if len(ids) == 0:
-			# fail silently
-			return []
-			#raise RuntimeError('runme.py: GetIds.py: No tests with names matching "'+ids_names+'" were found. Note that name checking is case sensitive. Test names are in the first line of a given test eg: "Square" would include test101.py: "SquareShelfConstrainedStressSSA2d"')
+    ids = []
 
-	if type(ids_names) == int:
-		ids = [ids_names]
-		if len(ids) == 0:
-			# fail silently
-			return []
-			#raise RuntimeError('runme.py: GetIds.py: No tests with ids matching "'+ids_names+'" were found. Check that there is a test file named "test'+str(ids_names)+'.py"')
+    # 1 input, either an id or a test name
+    if type(ids_names) == str:
+        ids = IdFromString(ids_names)
+        if len(ids) == 0:
+            # fail silently
+            return []
+        #raise RuntimeError('runme.py: GetIds.py: No tests with names matching "' + ids_names + '" were found. Note that name checking is case sensitive. Test names are in the first line of a given test eg: "Square" would include test101.py: "SquareShelfConstrainedStressSSA2d"')
 
-	# many inputs of either ids or test names
-	if type(ids_names) == list and len(ids_names) > 0:
-		# is everything a string or int?
-		if np.array([type(i) == int for i in ids_names]).all():
-			ids = ids_names
-		elif np.array([type(i) == str for i in ids_names]).all():
-			ids = np.concatenate([IdFromString(i) for i in ids_names])
-			if len(ids) == 0:
-				raise RuntimeError('runme.py: GetIds.py: No tests with names matching "'+ids_names+'" were found. Note that name checking is case sensitive.')
+    if type(ids_names) == int:
+        ids = [ids_names]
+        if len(ids) == 0:
+            # fail silently
+            return []
+        #raise RuntimeError('runme.py: GetIds.py: No tests with ids matching "' + ids_names + '" were found. Check that there is a test file named "test' + str(ids_names) + '.py"')
 
-	# many inputs of both ids and test names
-	# ids_names[0] -> ids_names by id
-	# ids_names[1] -> ids_names by test name
-	if type(ids_names) == list and len(ids_names) == 2:
-		if type(ids_names[0]) == list and len(ids_names[0]) > 0 and type(ids_names[0][0]) == int:
-			ids = np.concatenate([ids,ids_names[0]])
-		if type(ids_names[1]) == list and len(ids_names[1]) > 0 and type(ids_names[1][0]) == str:
-			ids = np.concatenate([ids,np.concatenate([IdFromString(i) for i in ids_names[1]])])
-			if len(ids) == 0:
-				raise RuntimeError('runme.py: GetIds.py: No tests with names matching "'+ids_names+'" were found. Note that name checking is case sensitive.')
+        # many inputs of either ids or test names
+    if type(ids_names) == list and len(ids_names) > 0:
+        # is everything a string or int?
+        if np.array([type(i) == int for i in ids_names]).all():
+            ids = ids_names
+        elif np.array([type(i) == str for i in ids_names]).all():
+            ids = np.concatenate([IdFromString(i) for i in ids_names])
+            if len(ids) == 0:
+                raise RuntimeError('runme.py: GetIds.py: No tests with names matching "' + ids_names + '" were found. Note that name checking is case sensitive.')
 
-	# no recognizable ids or id formats
-	if np.size(ids) == 0 and not np.all(np.equal(ids_names,None)):
-		raise RuntimeError('runme.py: GetIds.py: include and exclude options (-i/--id; -in/--include_name; -e/--exclude; -en/--exclude_name) options must follow GetIds usage format:\n'+GetIds.__doc__)
+            # many inputs of both ids and test names
+            # ids_names[0] -> ids_names by id
+            # ids_names[1] -> ids_names by test name
+    if type(ids_names) == list and len(ids_names) == 2:
+        if type(ids_names[0]) == list and len(ids_names[0]) > 0 and type(ids_names[0][0]) == int:
+            ids = np.concatenate([ids, ids_names[0]])
+        if type(ids_names[1]) == list and len(ids_names[1]) > 0 and type(ids_names[1][0]) == str:
+            ids = np.concatenate([ids, np.concatenate([IdFromString(i) for i in ids_names[1]])])
+            if len(ids) == 0:
+                raise RuntimeError('runme.py: GetIds.py: No tests with names matching "' + ids_names + '" were found. Note that name checking is case sensitive.')
 
-	return np.array(ids).astype(int)
+            # no recognizable ids or id formats
+    if np.size(ids) == 0 and not np.all(np.equal(ids_names, None)):
+        raise RuntimeError('runme.py: GetIds.py: include and exclude options (-i/--id; -in/--include_name; -e/--exclude; -en/--exclude_name) options must follow GetIds usage format:\n' + GetIds.__doc__)
 
+    return np.array(ids).astype(int)
Index: /issm/trunk/test/NightlyRun/IdFromString.py
===================================================================
--- /issm/trunk/test/NightlyRun/IdFromString.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/IdFromString.py	(revision 24313)
@@ -1,57 +1,53 @@
-#! /usr/bin/env python
+#!/usr/bin/env python
 from IdToName import IdToName
 import os
 
-# use verbose=False to print output when this is called by command line
-def IdFromString(string,verbose=False):
-	"""
-	IDFROMSTRING - output ids from a given string
- 
-	    Usage:
-		ids=IdFromString(string)
- 
-	    Examples:
-		ids=IdFromString('Parallel')
-		ids=IdFromString('79North')
-		ids=IdFromString('*')
-	"""
+# use verbose = False to print output when this is called by command line
 
-	#Check input
-	if not isinstance(string,str):
-		raise TypeError('IdFromString error message: input argument is not a string.')
-	string = string.replace("'",'')
-	string = string.replace('"','')
 
-	#Get the test ids and names and scan for matches
+def IdFromString(string, verbose=False):
+    """
+    IDFROMSTRING - output ids from a given string
+        Usage:
+            ids = IdFromString(string)
+        Examples:
+            ids = IdFromString('Parallel')
+            ids = IdFromString('79North')
+            ids = IdFromString(' * ')
+    """
 
-	ids = []
-	idnames = []
-	for f in os.listdir('.'):
-		if f.endswith('.py') and f.startswith('test'):
-			# all tests look like: "testwxyz.py" so 5th to 3rd to last is always the full id
-			s = int(f[4:-3])
-			name = IdToName(s)
-			if (string == '*') or (name != None and string in name):
-				ids.append(s)
-				idnames.append(name)
+#Check input
+    if not isinstance(string, str):
+        raise TypeError('IdFromString error message: input argument is not a string.')
+    string = string.replace("'", '')
+    string = string.replace('"', '')
 
-	#Return if no test found
-	if not ids:
-		print "No test matches '%s'." % string
-		return ids
+#Get the test ids and names and scan for matches
 
-	#Display names
-	if verbose:
-		idnames = [i for _,i in sorted(zip(ids,idnames), key=lambda pair: pair[0])]
+    ids = []
+    idnames = []
+    for f in os.listdir('.'):
+        if f.endswith('.py') and f.startswith('test'):
+            # all tests look like: "testwxyz.py" so 5th to 3rd to last is always the full id
+            s = int(f[4:-3])
+            name = IdToName(s)
+            if (string == ' * ') or (name is not None and string in name):
+                ids.append(s)
+                idnames.append(name)
 
-	ids.sort()
+#Return if no test found
+    if not ids:
+        print("No test matches '%s'." % string)
+        return ids
 
-	if verbose:
-		print "%s tests match '%s':" % (len(ids),string)
-		for i in range(len(ids)):
-			print "   %s : %s" % (ids[i],idnames[i])
-	#else:
-		#print ids
+#Display names
+    if verbose:
+        idnames = [i for _, i in sorted(zip(ids, idnames), key=lambda pair: pair[0])]
 
-	return ids
+    ids.sort()
 
+    if verbose:
+        print("{} tests match '{}':".format(len(ids), string))
+        for i in range(len(ids)):
+            print("   {} : {}".format(ids[i], idnames[i]))
+    return ids
Index: /issm/trunk/test/NightlyRun/IdToName.py
===================================================================
--- /issm/trunk/test/NightlyRun/IdToName.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/IdToName.py	(revision 24313)
@@ -1,15 +1,16 @@
-#! /usr/bin/env python
+#!/usr/bin/env python
+
 
 def IdToName(test_id):
-	"""
-	IDTONAME- return name of test
- 
-	    Usage:
-	       name=IdToName(test_id)
-	"""
-	infile = open('test' + str(test_id) + '.py','r')
-	file_text = infile.readline()
+    """
+        IDTONAME - return name of test
 
-	string = '#Test Name:'
-	name = file_text[len(string)+1:-1]
-	return name
+            Usage:
+               name = IdToName(test_id)
+        """
+    infile = open('test' + str(test_id) + '.py', 'r')
+    file_text = infile.readline()
+
+    string = '#Test Name:'
+    name = file_text[len(string) + 1:-1]
+    return name
Index: /issm/trunk/test/NightlyRun/runme.py
===================================================================
--- /issm/trunk/test/NightlyRun/runme.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/runme.py	(revision 24313)
@@ -1,259 +1,263 @@
 #!/usr/bin/env python
 import os
+import argparse
 import numpy as np
 from traceback import format_exc
 from sys import float_info
 from glob import glob
-from socket import gethostname
 from GetIds import *
-
-def runme(id=None,exclude=None,benchmark='nightly',procedure='check',output='none',rank=1,numprocs=1):
-	"""
-	RUNME - test deck for ISSM nightly runs
-
-	    In a test deck directory (tests/Vertification/NightlyRun for example)
-	    The following command will launch all the existing tests:
-	    >> runme()
-	    To run the tests 101 and 102:
-	    >> runme(id=[101,102])
-	    etc...
-
-	    Available options:
-	       'id'            followed by the list of ids or (parts of) test names requested
-				Note: runs all tests by default
-
-	       'exclude'       ids or (parts of) test names to be excluded (same format as id)
-				Note: exclude does nothing if 'id' is specified with different values
-
-	       'benchmark'     'all' (all of the tests)
-                          'nightly' (nightly run/ daily run)
-                          'ismip'  : validation of ismip-hom tests
-                          'eismint': validation of eismint tests
-                          'thermal': validation of thermal tests
-                          'mesh'   : validation of mesh tests
-                          'adolc'  : validation of adolc tests
-                          'slr'    : validation of slr tests
-
-	       'procedure'     'check' : run the test (default)
-	                       'update': update the archive
-
-	    Usage:
-	       runme(varargin)
-
-	    Examples:
-	       runme()
-	       runme(101)
-	       runme('SquareShelf')
-	       runme(exclude=2001)
-	       runme(exclude='Dakota',benchmark='all')
-	       runme(id=[[101,102],['Dakota','Slr']])
-	"""
-	from parallelrange import parallelrange
-	from IdToName import IdToName
-	from arch import archread
-	from arch import archwrite
-	from arch import archdisp
-
-	#Get ISSM_DIR variable
-	ISSM_DIR=os.environ['ISSM_DIR']
-
-	#Process options
-	#GET benchmark {{{
-	if not benchmark in ['all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing','adolc','slr','referential']:
-		print("runme warning: benchmark '{}' not supported, defaulting to test 'nightly'.".format(benchmark))
-		benchmark='nightly'
-	# }}}
-	#GET procedure {{{
-	if not procedure in ['check','update']:
-		print("runme warning: procedure '{}' not supported, defaulting to test 'check'.".format(procedure))
-		procedure='check'
-	# }}}
-	#GET output {{{
-	if not output in ['nightly','none']:
-		print("runme warning: output '{}' not supported, defaulting to test 'none'.".format(output))
-		output='none'
-	# }}}
-	#GET RANK and NUMPROCS for multithreaded runs {{{
-	if (numprocs<rank):
-		numprocs=1
-	# }}}
-	#GET ids  {{{
-	flist=glob('test*.py')    #File name must start with 'test' and must end by '.py' and must be different than 'test.py'
-	list_ids=[int(file[4:-3]) for file in flist if not file == 'test.py']    #Keep test id only (skip 'test' and '.py')
-
-	i1,i2=parallelrange(rank,numprocs,len(list_ids))    #Get tests for this cpu only
-	list_ids=list_ids[i1:i2+1]
-
-	if np.size(id) > 0 and not id==None:
-		test_ids = set(GetIds(id)).intersection(set(list_ids))
-	else:
-		# if no tests are specifically provided, do them all
-		test_ids = set(list_ids)
-
-	# }}}
-	#GET exclude {{{
-	exclude_ids = GetIds(exclude)
-
-	test_ids=test_ids.difference(exclude_ids)
-	# }}}
-	#Process Ids according to benchmarks {{{
-	if benchmark=='nightly':
-		test_ids=test_ids.intersection(set(range(1,1000)))
-	elif benchmark=='validation':
-		test_ids=test_ids.intersection(set(range(1001,2000)))
-	elif benchmark=='ismip':
-		test_ids=test_ids.intersection(set(range(1101,1200)))
-	elif benchmark=='eismint':
-		test_ids=test_ids.intersection(set(range(1201,1300)))
-	elif benchmark=='thermal':
-		test_ids=test_ids.intersection(set(range(1301,1400)))
-	elif benchmark=='mesh':
-		test_ids=test_ids.intersection(set(range(1401,1500)))
-	elif benchmark=='tranforcing':
-		test_ids=test_ids.intersection(set(range(1501,1503)))
-	elif benchmark=='referential':
-		test_ids=test_ids.intersection(set(range(1601,1603)))
-	elif benchmark=='slr':
-		test_ids=test_ids.intersection(set(range(2001,2500)))
-	elif benchmark=='adolc':
-		test_ids=test_ids.intersection(set(range(3001,3200)))
-	test_ids=list(test_ids)
-	test_ids.sort()
-	# }}}
-
-	#Loop over tests and launch sequence
-	root=os.getcwd()
-	for id in test_ids:
-		print "----------------starting:%i-----------------------" % id
-		try:
-
-			#Execute test
-			os.chdir(root)
-			id_string=IdToName(id)
-			execfile('test'+str(id)+'.py',globals())
-
-			#UPDATE ARCHIVE?
-			archive_name='Archive'+str(id)
-			if procedure=='update':
-				archive_file=os.path.join('..','Archives',archive_name+'.arch')
-				if os.path.isfile(archive_file):
-					os.remove(archive_file)
-				for k,fieldname in enumerate(field_names):
-					field=np.array(field_values[k],dtype=float)
-					if len(field.shape) == 1:
-						if np.size(field):
-							field=field.reshape(np.size(field),1)
-						else:
-							field=field.reshape(0,0)
-					elif len(field.shape) == 0:
-						field=field.reshape(1,1)
-					# Matlab uses base 1, so use base 1 in labels
-					archwrite(archive_file,archive_name+'_field'+str(k+1),field)
-				print "File '%s' saved.\n" % os.path.join('..','Archives',archive_name+'.arch')
-
-			#ELSE: CHECK TEST
-			else:
-
-				#load archive
-				if os.path.exists(os.path.join('..','Archives',archive_name+'.arch')):
-					archive_file=os.path.join('..','Archives',archive_name+'.arch')
-				else:
-					raise IOError("Archive file '"+os.path.join('..','Archives',archive_name+'.arch')+"' does not exist.")
-
-				for k,fieldname in enumerate(field_names):
-					try:
-						#Get field and tolerance
-						field=np.array(field_values[k])
-						if len(field.shape) == 1:
-							if np.size(field):
-								field=field.reshape(np.size(field),1)
-							else:
-								field=field.reshape(0,0)
-						tolerance=field_tolerances[k]
-
-						#compare to archive
-						# Matlab uses base 1, so use base 1 in labels
-						archive=np.array(archread(archive_file,archive_name+'_field'+str(k+1)))
-						#Because np.array is weird (str(np.array(None)) becomes 'None' but np.array(None) is never equal to None, it basically becomes a type of string in an array):
-						if str(archive) == 'None':
-							raise NameError("Field name '"+archive_name+'_field'+str(k+1)+"' does not exist in archive file.")
-						if np.shape(field) != np.shape(archive) and not np.shape(field) in [(1,1),(0,0),(1,0),(0,1)]:
-							field = field.T
-							if np.shape(field) != np.shape(archive):
-								raise RuntimeError("Field '"+archive_name+"' from test is malformed; shape is "+str(np.shape(field.T))+", should be "+str(np.shape(archive))+" (or "+str(np.shape(archive.T))+").")
-
-						error_diff=np.amax(np.abs(archive-field),axis=0)/(np.amax(np.abs(archive),axis=0)+float_info.epsilon)
-
-                                                if not np.isscalar(error_diff): error_diff=error_diff[0]
-
-						#disp test result
-						if (np.any(error_diff>tolerance) or np.isnan(error_diff)):
-							print('ERROR   difference: {} > {} test id: {} test name: {} field: {}'.format(error_diff,tolerance,id,id_string,fieldname))
-						else:
-							print('SUCCESS difference: {} < {} test id: {} test name: {} field: {}'.format(error_diff,tolerance,id,id_string,fieldname))
-
-					except Exception as message:
-
-						#something went wrong, print failure message:
-						print format_exc()
-						directory=os.getcwd().split('/')    #  not used?
-						if output=='nightly':
-							fid=open(os.path.join(ISSM_DIR,'nightlylog','pythonerror.log'), 'a')
-							fid.write('%s' % message)
-							fid.write('\n------------------------------------------------------------------\n')
-							fid.close()
-							print('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,fieldname))
-						else:
-							print('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,fieldname))
-							raise RuntimeError(message)
-
-
-		except Exception as message:
-
-			#something went wrong, print failure message:
-			print format_exc()
-			directory=os.getcwd().split('/')    #  not used?
-			if output=='nightly':
-				fid=open(os.path.join(ISSM_DIR,'nightlylog','pythonerror.log'), 'a')
-				fid.write('%s' % message)
-				fid.write('\n------------------------------------------------------------------\n')
-				fid.close()
-				print('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,'N/A'))
-			else:
-				print('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,'N/A'))
-				raise RuntimeError(message)
-
-		print "----------------finished:%i-----------------------" % id
-	return
-
-import argparse
+try:
+    from parallelrange import parallelrange
+except ImportError:  #we don't have issm code in path, just get it
+    import devpath
+    from parallelrange import parallelrange
+from IdToName import IdToName
+from arch import archread
+from arch import archwrite
+
+
+def runme(id=None, exclude=None, benchmark='nightly', procedure='check', output='none', rank=1, numprocs=1):
+    """
+    RUNME - test deck for ISSM nightly runs
+
+        In a test deck directory (tests / Vertification / NightlyRun for example)
+        The following command will launch all the existing tests:
+    >>     runme()
+        To run the tests 101 and 102:
+    >>     runme(id = [101, 102])
+        etc...
+
+        Available options:
+            'id'            followed by the list of ids or (parts of) test names requested
+                            Note: runs all tests by default
+
+            'exclude'       ids or (parts of) test names to be excluded (same format as id)
+                            Note: exclude does nothing if 'id' is specified with different values
+
+            'benchmark'     'all' (all of the tests)
+                            'nightly' (nightly run / daily run)
+                            'ismip'  : validation of ismip - hom tests
+                            'eismint': validation of eismint tests
+                            'thermal': validation of thermal tests
+                            'mesh'   : validation of mesh tests
+                            'adolc'  : validation of adolc tests
+                            'slr'    : validation of slr tests
+
+            'procedure'     'check' : run the test (default)
+                            'update': update the archive
+
+        Usage:
+            runme(varargin)
+
+        Examples:
+            runme()
+            runme(101)
+            runme('SquareShelf')
+            runme(exclude = 2001)
+            runme(exclude = 'Dakota', benchmark = 'all')
+            runme(id = [[101, 102], ['Dakota', 'Slr']])
+        """
+    #Get ISSM_DIR variable
+    ISSM_DIR = os.environ['ISSM_DIR']
+
+    #Process options
+    #GET benchmark {{{
+    if benchmark not in ['all', 'nightly', 'ismip', 'eismint',
+                         'thermal', 'mesh', 'validation', 'tranforcing',
+                         'adolc', 'slr', 'referential']:
+        print(("runme warning: benchmark '{}' not supported, defaulting to test 'nightly'.".format(benchmark)))
+        benchmark = 'nightly'
+        # }}}
+        #GET procedure {{{
+    if procedure not in ['check', 'update']:
+        print(("runme warning: procedure '{}' not supported, defaulting to test 'check'.".format(procedure)))
+        procedure = 'check'
+        # }}}
+        #GET output {{{
+    if output not in ['nightly', 'none']:
+        print(("runme warning: output '{}' not supported, defaulting to test 'none'.".format(output)))
+        output = 'none'
+        # }}}
+        #GET RANK and NUMPROCS for multithreaded runs {{{
+    if (numprocs < rank):
+        numprocs = 1
+        # }}}
+        #GET ids  {{{
+    flist = glob('test*.py')  #File name must start with 'test' and must end by '.py' and must be different than 'test.py'
+    list_ids = [int(file[4:-3]) for file in flist if not file == 'test.py']  #Keep test id only (skip 'test' and '.py')
+
+    i1, i2 = parallelrange(rank, numprocs, len(list_ids))  #Get tests for this cpu only
+    list_ids = list_ids[i1:i2 + 1]
+    if np.size(id) > 0 and id is not None:
+        test_ids = set(GetIds(id)).intersection(set(list_ids))
+        benchmark = None
+    else:
+        # if no tests are specifically provided, do them all
+        test_ids = set(list_ids)
+
+    # }}}
+    #GET exclude {{{
+    exclude_ids = GetIds(exclude)
+    test_ids = test_ids.difference(exclude_ids)
+    # }}}
+    #Process Ids according to benchmarks {{{
+    if benchmark == 'nightly':
+        test_ids = test_ids.intersection(set(range(1, 1000)))
+    elif benchmark == 'validation':
+        test_ids = test_ids.intersection(set(range(1001, 2000)))
+    elif benchmark == 'ismip':
+        test_ids = test_ids.intersection(set(range(1101, 1200)))
+    elif benchmark == 'eismint':
+        test_ids = test_ids.intersection(set(range(1201, 1300)))
+    elif benchmark == 'thermal':
+        test_ids = test_ids.intersection(set(range(1301, 1400)))
+    elif benchmark == 'mesh':
+        test_ids = test_ids.intersection(set(range(1401, 1500)))
+    elif benchmark == 'tranforcing':
+        test_ids = test_ids.intersection(set(range(1501, 1503)))
+    elif benchmark == 'referential':
+        test_ids = test_ids.intersection(set(range(1601, 1603)))
+    elif benchmark == 'slr':
+        test_ids = test_ids.intersection(set(range(2001, 2500)))
+    elif benchmark == 'adolc':
+        test_ids = test_ids.intersection(set(range(3001, 3200)))
+    test_ids = list(test_ids)
+    test_ids.sort()
+    # }}}
+
+    #Loop over tests and launch sequence
+    root = os.getcwd()
+    errorcount = 0
+    erroredtest_list = []
+    for id in test_ids:
+        print(("----------------starting:{}----------------------- ".format(id)))
+        try:
+            #Execute test
+            os.chdir(root)
+            id_string = IdToName(id)
+            exec(compile(open('test{}.py'.format(id)).read(), 'test{}.py'.format(id), 'exec'), globals())
+
+            #UPDATE ARCHIVE?
+            archive_name = 'Archive' + str(id)
+            if procedure == 'update':
+                archive_file = os.path.join('..', 'Archives', archive_name + '.arch')
+                if os.path.isfile(archive_file):
+                    os.remove(archive_file)
+                    for k, fieldname in enumerate(field_names):
+                        field = np.array(field_values[k], dtype=float)
+                        if len(field.shape) == 1:
+                            if np.size(field):
+                                field = field.reshape(np.size(field), 1)
+                            else:
+                                field = field.reshape(0, 0)
+                        elif len(field.shape) == 0:
+                            field = field.reshape(1, 1)
+                            # Matlab uses base 1, so use base 1 in labels
+                        archwrite(archive_file, archive_name + '_field' + str(k + 1), field)
+                    print(("File {} saved. \n".format(os.path.join('..', 'Archives', archive_name + '.arch'))))
+
+                    #ELSE: CHECK TEST
+            else:
+                #load archive
+                if os.path.exists(os.path.join('..', 'Archives', archive_name + '.arch')):
+                    archive_file = os.path.join('..', 'Archives', archive_name + '.arch')
+                else:
+                    raise IOError("Archive file '../Archives/{}.arch' does not exist.".format(archive_name))
+
+                for k, fieldname in enumerate(field_names):
+                    try:
+                        #Get field and tolerance
+                        field = np.array(field_values[k])
+                        if len(field.shape) == 1:
+                            if np.size(field):
+                                field = field.reshape(np.size(field), 1)
+                            else:
+                                field = field.reshape(0, 0)
+                        tolerance = field_tolerances[k]
+
+                        #compare to archive
+                        # Matlab uses base 1, so use base 1 in labels
+                        archive = np.array(archread(archive_file, archive_name + '_field' + str(k + 1)))
+                        #Because np.array is weird (str(np.array(None)) becomes 'None' but np.array(None) is never equal to None, it basically becomes a type of string in an array):
+                        if str(archive) == 'None':
+                            raise NameError("Field name '" + archive_name + '_field' + str(k + 1) + "' does not exist in archive file.")
+                        if np.shape(field) != np.shape(archive) and not np.shape(field) in [(1, 1), (0, 0), (1, 0), (0, 1)]:
+                            field = field.T
+                            if np.shape(field) != np.shape(archive):
+                                raise RuntimeError("Field '{}'' from test is malformed; shape is {}, should be {} or {}".format(archive_name, np.shape(field.T), np.shape(archive), np.shape(archive.T)))
+
+                        error_diff = np.amax(np.abs(archive - field), axis=0) / (np.amax(np.abs(archive), axis=0) + float_info.epsilon)
+                        if not np.isscalar(error_diff):
+                            error_diff = error_diff[0]
+
+                            #disp test result
+                        if (np.any(error_diff > tolerance) or np.isnan(error_diff)):
+                            print(('ERROR   difference: {} > {} test id: {} test name: {} field: {}'.format(error_diff, tolerance, id, id_string, fieldname)))
+                            errorcount += 1
+                            erroredtest_list.append(id)
+                        else:
+                            print(('SUCCESS difference: {} < {} test id: {} test name: {} field: {}'.format(error_diff, tolerance, id, id_string, fieldname)))
+
+                    except Exception as message:
+                        #something went wrong, print failure message:
+                        print((format_exc()))
+                        if output == 'nightly':
+                            fid = open(os.path.join(ISSM_DIR, 'nightlylog', 'pythonerror.log'), 'a')
+                            fid.write('%s' % message)
+                            fid.write('\n------------------------------------------------------------------    \n')
+                            fid.close()
+                            print(('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id, id_string, fieldname)))
+                        else:
+                            print(('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id, id_string, fieldname)))
+                            raise RuntimeError(message)
+
+        except Exception as message:
+            #something went wrong, print failure message:
+            print((format_exc()))
+            if output == 'nightly':
+                fid = open(os.path.join(ISSM_DIR, 'nightlylog', 'pythonerror.log'), 'a')
+                fid.write('%s' % message)
+                fid.write('\n------------------------------------------------------------------ \n')
+                fid.close()
+                print(('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id, id_string, 'N/A')))
+            else:
+                print(('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id, id_string, 'N/A')))
+                raise RuntimeError(message)
+
+        print(("----------------    finished:{}----------------------- ".format(id)))
+
+    if errorcount > 0:
+        print("{} errors were detected in test {}".format(errorcount, np.unique(erroredtest_list)))
+    return
+
+
 if __name__ == '__main__':
-	if 'PYTHONSTARTUP' in os.environ:
-		PYTHONSTARTUP=os.environ['PYTHONSTARTUP']
-		#print 'PYTHONSTARTUP =',PYTHONSTARTUP
-		if os.path.exists(PYTHONSTARTUP):
-			try:
-				execfile(PYTHONSTARTUP)
-			except Exception as e:
-				print "PYTHONSTARTUP error: ",e
-		else:
-			print("PYTHONSTARTUP file '{}' does not exist.".format(PYTHONSTARTUP))
-
-	parser = argparse.ArgumentParser(description='RUNME - test deck for ISSM nightly runs')
-	parser.add_argument('-i','--id', nargs='*', type=int, help='followed by the list of ids requested', default=[])
-	parser.add_argument('-in','--include_name', nargs='*', type=str, help='followed by the list of test names requested', default=[])
-	parser.add_argument('-e','--exclude', nargs='+', type=int, help='ids to be excluded from the test', default=[])
-	parser.add_argument('-en','--exclude_name', nargs='+', type=str, help='test names to be excluded from the test', default=[])
-	parser.add_argument('-b','--benchmark', help='nightly/ismip/eismint/thermal/mesh/...', default='nightly')
-	parser.add_argument('-p','--procedure', help='check/update', default='check')
-	parser.add_argument('-o','--output', help='nightly/daily/none', default='none')
-	parser.add_argument('-r','--rank', type=int, help='rank', default=1)
-	parser.add_argument('-n','--numprocs', type=int, help='numprocs', default=1)
-	args = parser.parse_args()
-
-	md = runme([args.id,args.include_name], [args.exclude,args.exclude_name], args.benchmark, args.procedure, args.output, args.rank, args.numprocs)
-
-	if args.output=='nightly':
-		print "PYTHONEXITEDCORRECTLY"
-
-	exit(md)
+    if 'PYTHONSTARTUP' in os.environ:
+        PYTHONSTARTUP = os.environ['PYTHONSTARTUP']
+#print 'PYTHONSTARTUP = ', PYTHONSTARTUP
+        if os.path.exists(PYTHONSTARTUP):
+            try:
+                exec(compile(open(PYTHONSTARTUP).read(), PYTHONSTARTUP, 'exec'))
+            except Exception as e:
+                print("PYTHONSTARTUP error: ", e)
+        else:
+            print(("PYTHONSTARTUP file '{}' does not exist.".format(PYTHONSTARTUP)))
+
+        parser = argparse.ArgumentParser(description='RUNME - test deck for ISSM nightly runs')
+        parser.add_argument('-i', '--id', nargs='*', type=int, help='followed by the list of ids requested', default=[])
+        parser.add_argument('-in', '--include_name', nargs='*', type=str, help='followed by the list of test names requested', default=[])
+        parser.add_argument('-e', '--exclude', nargs='+', type=int, help='ids to be excluded from the test', default=[])
+        parser.add_argument('-en', '--exclude_name', nargs='+', type=str, help='test names to be excluded from the test', default=[])
+        parser.add_argument('-b', '--benchmark', help='nightly/ismip/eismint/thermal/mesh/...', default='nightly')
+        parser.add_argument('-p', '--procedure', help='check/update', default='check')
+        parser.add_argument('-o', '--output', help='nightly/daily/none', default='none')
+        parser.add_argument('-r', '--rank', type=int, help='rank', default=1)
+        parser.add_argument('-n', '--numprocs', type=int, help='numprocs', default=1)
+        args = parser.parse_args()
+
+        md = runme([args.id, args.include_name], [args.exclude, args.exclude_name], args.benchmark, args.procedure, args.output, args.rank, args.numprocs)
+
+        exit(md)
+    else:
+        print("PYTHONSTARTUP not defined in environment")
+        raise RuntimeError()
Index: /issm/trunk/test/NightlyRun/test101.m
===================================================================
--- /issm/trunk/test/NightlyRun/test101.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test101.m	(revision 24313)
@@ -23,5 +23,5 @@
 	'DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy','MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6'};
 field_tolerances={3e-13,1e-13,1e-13,1e-13,...
-	2e-13,1e-13,1e-13,...
+	2e-13,1e-13,2e-13,...
 	1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13 };
 field_values={...
Index: /issm/trunk/test/NightlyRun/test101.py
===================================================================
--- /issm/trunk/test/NightlyRun/test101.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test101.py	(revision 24313)
@@ -10,40 +10,39 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',50000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 50000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 2)
+#outputs
+md.stressbalance.requested_outputs = ['default', 'DeviatoricStressxx', 'DeviatoricStressyy', 'DeviatoricStressxy', 'MassFlux1', 'MassFlux2', 'MassFlux3', 'MassFlux4', 'MassFlux5', 'MassFlux6']
+md.outputdefinition.definitions = [massfluxatgate('name', 'MassFlux1', 'profilename', '../Exp/MassFlux1.exp', 'definitionstring', 'Outputdefinition1'),
+                                   massfluxatgate('name', 'MassFlux2', 'profilename', '../Exp/MassFlux2.exp', 'definitionstring', 'Outputdefinition2'),
+                                   massfluxatgate('name', 'MassFlux3', 'profilename', '../Exp/MassFlux3.exp', 'definitionstring', 'Outputdefinition3'),
+                                   massfluxatgate('name', 'MassFlux4', 'profilename', '../Exp/MassFlux4.exp', 'definitionstring', 'Outputdefinition4'),
+                                   massfluxatgate('name', 'MassFlux5', 'profilename', '../Exp/MassFlux5.exp', 'definitionstring', 'Outputdefinition5'),
+                                   massfluxatgate('name', 'MassFlux6', 'profilename', '../Exp/MassFlux6.exp', 'definitionstring', 'Outputdefinition6')]
 
-#outputs
-md.stressbalance.requested_outputs=['default','DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy','MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6']
-md.outputdefinition.definitions=[massfluxatgate('name','MassFlux1','profilename','../Exp/MassFlux1.exp','definitionstring','Outputdefinition1'),
-																 massfluxatgate('name','MassFlux2','profilename','../Exp/MassFlux2.exp','definitionstring','Outputdefinition2'),
-																 massfluxatgate('name','MassFlux3','profilename','../Exp/MassFlux3.exp','definitionstring','Outputdefinition3'),
-																 massfluxatgate('name','MassFlux4','profilename','../Exp/MassFlux4.exp','definitionstring','Outputdefinition4'),
-																 massfluxatgate('name','MassFlux5','profilename','../Exp/MassFlux5.exp','definitionstring','Outputdefinition5'),
-																 massfluxatgate('name','MassFlux6','profilename','../Exp/MassFlux6.exp','definitionstring','Outputdefinition6')]
-
-md=solve(md,'Stressbalance')
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vel','Pressure',
-									'DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy',
-									'MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6']
-field_tolerances=[3e-13, 1e-13, 1e-13, 1e-13,
-									2e-13, 1e-13, 1e-13,
-									1e-13, 1e-13, 1e-13, 
-									1e-13, 1e-13, 1e-13 ]
-field_values=[md.results.StressbalanceSolution.Vx,
-							md.results.StressbalanceSolution.Vy,
-							md.results.StressbalanceSolution.Vel,
-							md.results.StressbalanceSolution.Pressure,
-							md.results.StressbalanceSolution.DeviatoricStressxx,
-							md.results.StressbalanceSolution.DeviatoricStressyy,
-							md.results.StressbalanceSolution.DeviatoricStressxy,
-							md.results.StressbalanceSolution.MassFlux1,
-							md.results.StressbalanceSolution.MassFlux2,
-							md.results.StressbalanceSolution.MassFlux3,
-							md.results.StressbalanceSolution.MassFlux4,
-							md.results.StressbalanceSolution.MassFlux5,
-							md.results.StressbalanceSolution.MassFlux6 ]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure',
+               'DeviatoricStressxx', 'DeviatoricStressyy', 'DeviatoricStressxy',
+               'MassFlux1', 'MassFlux2', 'MassFlux3', 'MassFlux4', 'MassFlux5', 'MassFlux6']
+field_tolerances = [3e-13, 1e-13, 1e-13, 1e-13,
+                    2e-13, 1e-13, 2e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.DeviatoricStressxx,
+                md.results.StressbalanceSolution.DeviatoricStressyy,
+                md.results.StressbalanceSolution.DeviatoricStressxy,
+                md.results.StressbalanceSolution.MassFlux1,
+                md.results.StressbalanceSolution.MassFlux2,
+                md.results.StressbalanceSolution.MassFlux3,
+                md.results.StressbalanceSolution.MassFlux4,
+                md.results.StressbalanceSolution.MassFlux5,
+                md.results.StressbalanceSolution.MassFlux6]
Index: /issm/trunk/test/NightlyRun/test102.py
===================================================================
--- /issm/trunk/test/NightlyRun/test102.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test102.py	(revision 24313)
@@ -9,19 +9,18 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,2.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[md.results.StressbalanceSolution.Vx,
-							md.results.StressbalanceSolution.Vy,
-							md.results.StressbalanceSolution.Vz,
-							md.results.StressbalanceSolution.Vel,
-							md.results.StressbalanceSolution.Pressure]
-
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test103.py
===================================================================
--- /issm/trunk/test/NightlyRun/test103.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test103.py	(revision 24313)
@@ -9,31 +9,31 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,2.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.stressbalance.requested_outputs=['default','StressTensorxx','StressTensoryy','StressTensorzz','StressTensorxy','StressTensorxz','StressTensoryz']
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.stressbalance.requested_outputs = ['default', 'StressTensorxx', 'StressTensoryy', 'StressTensorzz', 'StressTensorxy', 'StressTensorxz', 'StressTensoryz']
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz',
-									'Vel','Pressure',
-									'StressTensorxx','StressTensoryy','StressTensorzz',
-									'StressTensorxy','StressTensorxz','StressTensoryz']
-field_tolerances=[1e-09,1e-09,1e-09,
-									1e-09,1e-09,
-									1e-09,1e-09,1e-09,
-									1e-09,1e-09,1e-08]
-field_values=[md.results.StressbalanceSolution.Vx,
-							md.results.StressbalanceSolution.Vy,
-							md.results.StressbalanceSolution.Vz,
-							md.results.StressbalanceSolution.Vel,
-							md.results.StressbalanceSolution.Pressure,
-							md.results.StressbalanceSolution.StressTensorxx,
-							md.results.StressbalanceSolution.StressTensoryy,
-							md.results.StressbalanceSolution.StressTensorzz,
-							md.results.StressbalanceSolution.StressTensorxy,
-							md.results.StressbalanceSolution.StressTensorxz,
-							md.results.StressbalanceSolution.StressTensoryz,]
+field_names = ['Vx', 'Vy', 'Vz',
+               'Vel', 'Pressure',
+               'StressTensorxx', 'StressTensoryy', 'StressTensorzz',
+               'StressTensorxy', 'StressTensorxz', 'StressTensoryz']
+field_tolerances = [1e-09, 1e-09, 1e-09,
+                    1e-09, 1e-09,
+                    1e-09, 1e-09, 1e-09,
+                    1e-09, 1e-09, 1e-08]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.StressTensorxx,
+                md.results.StressbalanceSolution.StressTensoryy,
+                md.results.StressbalanceSolution.StressTensorzz,
+                md.results.StressbalanceSolution.StressTensorxy,
+                md.results.StressbalanceSolution.StressTensorxz,
+                md.results.StressbalanceSolution.StressTensoryz]
Index: /issm/trunk/test/NightlyRun/test104.js
===================================================================
--- /issm/trunk/test/NightlyRun/test104.js	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test104.js	(revision 24313)
@@ -11,5 +11,5 @@
 //Fields and tolerances to track changes
 field_names     =['Vx','Vy','Vz','Vel','Pressure'];
-field_tolerances=[1e-08,1e-08,3e-06,1e-08,1e-08];
+field_tolerances=[1e-08,1e-08,4e-06,1e-08,1e-08];
 field_values=[
 	(md.results.StressbalanceSolution[0].Vx),
Index: /issm/trunk/test/NightlyRun/test104.m
===================================================================
--- /issm/trunk/test/NightlyRun/test104.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test104.m	(revision 24313)
@@ -10,5 +10,5 @@
 %Fields and tolerances to track changes
 field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
-field_tolerances={1e-08,1e-08,3e-06,1e-08,1e-08};
+field_tolerances={1e-08,1e-08,4e-06,1e-08,1e-08};
 field_values={...
 	(md.results.StressbalanceSolution.Vx),...
Index: /issm/trunk/test/NightlyRun/test104.py
===================================================================
--- /issm/trunk/test/NightlyRun/test104.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test104.py	(revision 24313)
@@ -9,18 +9,18 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,2.)
-md=setflowequation(md,'FS','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'FS', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-08,1e-08,3e-06,1e-08,1e-08]
-field_values=[md.results.StressbalanceSolution.Vx,
-							md.results.StressbalanceSolution.Vy,
-							md.results.StressbalanceSolution.Vz,
-							md.results.StressbalanceSolution.Vel,
-							md.results.StressbalanceSolution.Pressure]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-08, 1e-08, 4e-06, 1e-08, 1e-08]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test105.py
===================================================================
--- /issm/trunk/test/NightlyRun/test105.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test105.py	(revision 24313)
@@ -9,15 +9,13 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Masstransport')
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Masstransport')
 
 #Fields and tolerances to track changes
-field_names     =['Thickness']
-field_tolerances=[1e-13]
-field_values=[\
-	md.results.MasstransportSolution.Thickness,\
-	]
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test106.py
===================================================================
--- /issm/trunk/test/NightlyRun/test106.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test106.py	(revision 24313)
@@ -10,18 +10,16 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000)
-md=meshconvert(md)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.masstransport.stabilization=3
-md.masstransport.spcthickness=md.geometry.thickness
-md=solve(md,'Masstransport')
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = meshconvert(md)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.masstransport.stabilization = 3
+md.masstransport.spcthickness = md.geometry.thickness
+md = solve(md, 'Masstransport')
 
 #Fields and tolerances to track changes
-field_names     =['Thickness']
-field_tolerances=[1e-13]
-field_values=[\
-	md.results.MasstransportSolution.Thickness,\
-	]
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test107.py
===================================================================
--- /issm/trunk/test/NightlyRun/test107.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test107.py	(revision 24313)
@@ -9,16 +9,14 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.extrude(5,3.)
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Masstransport')
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.extrude(5, 3.)
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Masstransport')
 
 #Fields and tolerances to track changes
-field_names     =['Thickness']
-field_tolerances=[1e-13]
-field_values=[\
-	md.results.MasstransportSolution.Thickness,\
-	]
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test108.py
===================================================================
--- /issm/trunk/test/NightlyRun/test108.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test108.py	(revision 24313)
@@ -9,18 +9,16 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.timestepping.time_step=0
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Thermal')
+md = triangle(model(), '../Exp/Square.exp', 180000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.timestepping.time_step = 0
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Thermal')
 
 #Fields and tolerances to track changes
-field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-13,1e-5]
-field_values=[\
-	md.results.ThermalSolution.Temperature,\
-	md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-13, 1e-5]
+field_values = [md.results.ThermalSolution.Temperature,
+                md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test109.py
===================================================================
--- /issm/trunk/test/NightlyRun/test109.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test109.py	(revision 24313)
@@ -9,20 +9,20 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.transient.isstressbalance=False
-md.transient.ismasstransport=False
-md.transient.issmb=True
-md.transient.isthermal=True
-md.transient.isgroundingline=False
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 180000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.isstressbalance = False
+md.transient.ismasstransport = False
+md.transient.issmb = True
+md.transient.isthermal = True
+md.transient.isgroundingline = False
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-13,1e-13]
-field_values=[md.results.TransientSolution[0].Temperature,
-							md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate]
+field_names = ['Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test110.py
===================================================================
--- /issm/trunk/test/NightlyRun/test110.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test110.py	(revision 24313)
@@ -9,42 +9,40 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.transient.requested_outputs=['IceVolume']
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.requested_outputs = ['IceVolume']
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Volume1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Volume2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Volume3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].IceVolume,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].IceVolume,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].IceVolume,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Volume1', 'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Volume2', 'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Volume3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].IceVolume,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].IceVolume,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].IceVolume]
Index: /issm/trunk/test/NightlyRun/test1101.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1101.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1101.py	(revision 24313)
@@ -1,5 +1,4 @@
 #Test Name: ISMIPAHO
 import numpy as np
-import shutil
 from model import *
 from socket import gethostname
@@ -11,125 +10,124 @@
 
 """
-This test is a test from the ISMP-HOM Intercomparison project.
+This test is a test from the ISMP - HOM Intercomparison project.
 Pattyn and Payne 2006
 """
 
-printingflag=False
+printingflag = False
 
-#L_list=[80000.]
-L_list=[80000.]
-results=[]
-minvx=[]
-maxvx=[]
+L_list = [80000.]
+results = []
+minvx = []
+maxvx = []
 
 for L in L_list:
-	nx=20    #numberof nodes in x direction
-	ny=20
-	md=model()
-	md=squaremesh(md,L,L,nx,ny)
-	md=setmask(md,'','')    #ice sheet test
-	md=parameterize(md,'../Par/ISMIPA.py')
-	md.extrude(9,1.)
+    nx = 20  #numberof nodes in x direction
+    ny = 20
+    md = model()
+    md = squaremesh(md, L, L, nx, ny)
+    md = setmask(md, '', '')  #ice sheet test
+    md = parameterize(md, '../Par/ISMIPA.py')
+    md.extrude(9, 1.)
 
-	md=setflowequation(md,'HO','all')
+    md = setflowequation(md, 'HO', 'all')
 
-	#Create dirichlet on the bed only
-	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))
+#Create dirichlet on the bed only
+    md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
+    md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
+    md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices))
 
-	pos=np.where(md.mesh.vertexonbase)
-	md.stressbalance.spcvx[pos]=0.
-	md.stressbalance.spcvy[pos]=0.
+    pos = np.where(md.mesh.vertexonbase)
+    md.stressbalance.spcvx[pos] = 0.
+    md.stressbalance.spcvy[pos] = 0.
 
-	#Create MPCs to have periodic boundary conditions
-	posx=np.where(md.mesh.x==0.)[0]
-	posx2=np.where(md.mesh.x==np.max(md.mesh.x))[0]
+#Create MPCs to have periodic boundary conditions
+    posx = np.where(md.mesh.x == 0.)[0]
+    posx2 = np.where(md.mesh.x == np.max(md.mesh.x))[0]
 
-	posy=np.where(np.logical_and.reduce((md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x))))[0] #Don't take the same nodes two times
-	posy2=np.where(np.logical_and.reduce((md.mesh.y==np.max(md.mesh.y),md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x))))[0]
+    posy = np.where(np.logical_and.reduce((md.mesh.y == 0., md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]  #Don't take the same nodes two times
+    posy2 = np.where(np.logical_and.reduce((md.mesh.y == np.max(md.mesh.y), md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]
 
-	md.stressbalance.vertex_pairing=np.vstack((np.vstack((posx+1,posx2+1)).T,np.vstack((posy+1,posy2+1)).T))
+    md.stressbalance.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T))
 
-	#Compute the stressbalance
-	md.cluster=generic('name',gethostname(),'np',8)
-	md=solve(md,'Stressbalance')
+#Compute the stressbalance
+    md.cluster = generic('name', gethostname(), 'np', 8)
+    md = solve(md, 'Stressbalance')
 
-	#Plot the results and save them
-	vx=md.results.StressbalanceSolution.Vx
-	vy=md.results.StressbalanceSolution.Vy
-	vz=md.results.StressbalanceSolution.Vz
-	results.append(md.results.StressbalanceSolution)
-	minvx.append(np.min(vx[-md.mesh.numberofvertices2d:]))
-	maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:]))
+#Plot the results and save them
+    vx = md.results.StressbalanceSolution.Vx
+    vy = md.results.StressbalanceSolution.Vy
+    vz = md.results.StressbalanceSolution.Vz
+    results.append(md.results.StressbalanceSolution)
+    minvx.append(np.min(vx[-md.mesh.numberofvertices2d:]))
+    maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:]))
 
-	#Now plot vx, vy, vz and vx on a cross section
-#	plotmodel(md,'data',vx,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km')
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipaHOvx' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipaHOvx%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
-#	plotmodel(md,'data',vy,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km')
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipaHOvy' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipaHOvy%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
-#	plotmodel(md,'data',vz,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km')
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipaHOvz' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipaHOvz%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
+#Now plot vx, vy, vz and vx on a cross section
+#   plotmodel(md, 'data', vx, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 1.0e3], 'ylim', [0 L / 1.0e3], 'unit', 'km')
+    if printingflag:
+        pass
+#           set(gcf, 'Color', 'w')
+#           printmodel(['ismipaHOvx' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#           shutil.move("ismipaHOvx%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
+#   plotmodel(md, 'data', vy, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 1.0e3], 'ylim', [0 L / 1.0e3], 'unit', 'km')
+    if printingflag:
+        pass
+#           set(gcf, 'Color', 'w')
+#           printmodel(['ismipaHOvy' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#           shutil.move("ismipaHOvy%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
+#   plotmodel(md, 'data', vz, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 1.0e3], 'ylim', [0 L / 1.0e3], 'unit', 'km')
+    if printingflag:
+        pass
+#           set(gcf, 'Color', 'w')
+#           printmodel(['ismipaHOvz' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#           shutil.move("ismipaHOvz%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
 
-	if   (L==5000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP5000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[10 18],'xlim',[0 5000],'title','','xlabel','')
-	elif (L==10000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP10000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[10 30],'xlim',[0 10000],'title','','xlabel','')
-	elif (L==20000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP20000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 50],'xlim',[0 20000],'title','','xlabel','')
-	elif (L==40000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP40000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 80],'xlim',[0 40000],'title','','xlabel','')
-	elif (L==80000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP80000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 100],'xlim',[0 80000],'title','','xlabel','')
-	elif (L==160000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP160000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 120],'xlim',[0 160000],'title','','xlabel','')
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipaHOvxsec' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipaHOvxsec%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
+    if (L == 5000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP5000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [10 18], 'xlim', [0 5000], 'title', '', 'xlabel', '')
+    elif (L == 10000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP10000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [10 30], 'xlim', [0 10000], 'title', '', 'xlabel', '')
+    elif (L == 20000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP20000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [0 50], 'xlim', [0 20000], 'title', '', 'xlabel', '')
+    elif (L == 40000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP40000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [0 80], 'xlim', [0 40000], 'title', '', 'xlabel', '')
+    elif (L == 80000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP80000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [0 100], 'xlim', [0 80000], 'title', '', 'xlabel', '')
+    elif (L == 160000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP160000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [0 120], 'xlim', [0 160000], 'title', '', 'xlabel', '')
+    if printingflag:
+        pass
+#           set(gcf, 'Color', 'w')
+#           printmodel(['ismipaHOvxsec' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#           shutil.move("ismipaHOvxsec%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
 
 #Now plot the min and max values of vx for each size of the square
-#plot([5 10 20 40 80 160],minvx)ylim([0 18])xlim([0 160])
+#plot([5 10 20 40 80 160], minvx)ylim([0 18])xlim([0 160])
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('ismipaHOminvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#	shutil.move('ismipaHOminvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
-#plot([5 10 20 40 80 160],maxvx)ylim([0 120])xlim([0 160])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('ismipaHOminvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#       shutil.move('ismipaHOminvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
+#plot([5 10 20 40 80 160], maxvx)ylim([0 120])xlim([0 160])
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('ismipaHOmaxvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#	shutil.move('ismipaHOmaxvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('ismipaHOmaxvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#       shutil.move('ismipaHOmaxvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
 
 #Fields and tolerances to track changes
-field_names     =['Vx80km','Vy80km','Vz80km']
-field_tolerances=[1e-08,1e-08,1e-08]
-field_values=[]
+field_names = ['Vx80km', 'Vy80km', 'Vz80km']
+field_tolerances = [1e-08, 1e-08, 1e-08]
+field_values = []
 for result in results:
-	field_values=field_values+[result.Vx,result.Vy,result.Vz]
+    field_values = field_values + [result.Vx, result.Vy, result.Vz]
Index: /issm/trunk/test/NightlyRun/test1102.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1102.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1102.py	(revision 24313)
@@ -1,5 +1,4 @@
 #Test Name: ISMIPAFS
 import numpy as np
-import shutil
 from model import *
 from socket import gethostname
@@ -11,127 +10,123 @@
 
 """
-This test is a test from the ISMP-HOM Intercomparison project.
+This test is a test from the ISMP - HOM Intercomparison project.
 Pattyn and Payne 2006
 """
 
-printingflag=False
+printingflag = False
 
-L_list=[80000.]
-results=[]
-minvx=[]
-maxvx=[]
+L_list = [80000.]
+results = []
+minvx = []
+maxvx = []
 
 for L in L_list:
-	nx=20    #numberof nodes in x direction
-	ny=20
-	md=model()
-	md=squaremesh(md,L,L,nx,ny)
-	md=setmask(md,'','')    #ice sheet test
+    nx = 20  #numberof nodes in x direction
+    ny = 20
+    md = model()
+    md = squaremesh(md, L, L, nx, ny)
+    md = setmask(md, '', '')  #ice sheet test
 
-#	#Find elements at the corner and extract model
-#	posnodes=np.nonzero(np.logical_and.reduce(np.logical_or.reduce(md.mesh.x==0.,md.mesh.x==np.max(md.mesh.x)),np.logical_or.reduce(md.mesh.y==0.,md.mesh.y==np.max(md.mesh.y))))
-#	a=np.nonzero(ismember(md.mesh.elements,posnodes))[0]
-#	elements=np.ones((md.mesh.numberofelements),int)
-#	elements[a]=0
-#	md.modelextract(elements)
+    #  #Find elements at the corner and extract model
+    #   posnodes = np.nonzero(np.logical_and.reduce(np.logical_or.reduce(md.mesh.x = 0., md.mesh.x = np.max(md.mesh.x)), np.logical_or.reduce(md.mesh.y = 0., md.mesh.y = np.max(md.mesh.y))))
+    #   a = np.nonzero(ismember(md.mesh.elements, posnodes))[0]
+    #   elements = np.ones((md.mesh.numberofelements), int)
+    #   elements[a] = 0
+    #   md.modelextract(elements)
 
-	md=parameterize(md,'../Par/ISMIPA.py')
-	md.extrude(10,1.)
-	md=setflowequation(md,'FS','all')
+    md = parameterize(md, '../Par/ISMIPA.py')
+    md.extrude(10, 1.)
+    md = setflowequation(md, 'FS', 'all')
 
-	#Create dirichlet on the bed only
-	pos=np.nonzero(md.mesh.vertexonbase)
-	md.stressbalance.spcvx[pos]=0.
-	md.stressbalance.spcvy[pos]=0.
-	md.stressbalance.spcvz[pos]=0.
+    #Create dirichlet on the bed only
+    pos = np.nonzero(md.mesh.vertexonbase)
+    md.stressbalance.spcvx[pos] = 0.
+    md.stressbalance.spcvy[pos] = 0.
+    md.stressbalance.spcvz[pos] = 0.
 
-	#Compute the stressbalance
-	md.stressbalance.abstol=np.nan
-	md.stressbalance.reltol=np.nan
-	md.stressbalance.restol=1.
-	md.cluster=generic('name',gethostname(),'np',8)
-	md=solve(md,'Stressbalance')
+    #Compute the stressbalance
+    md.stressbalance.abstol = np.nan
+    md.stressbalance.reltol = np.nan
+    md.stressbalance.restol = 1.
+    md.cluster = generic('name', gethostname(), 'np', 8)
+    md = solve(md, 'Stressbalance')
 
-	#Plot the results and save them
-	vx=md.results.StressbalanceSolution.Vx
-	vy=md.results.StressbalanceSolution.Vy
-	vz=md.results.StressbalanceSolution.Vz
-	pressure=md.results.StressbalanceSolution.Pressure
-	results.append(md.results.StressbalanceSolution)
-	minvx.append(np.min(vx[-md.mesh.numberofvertices2d:]))
-	maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:]))
+#Plot the results and save them
+    vx = md.results.StressbalanceSolution.Vx
+    vy = md.results.StressbalanceSolution.Vy
+    vz = md.results.StressbalanceSolution.Vz
+    pressure = md.results.StressbalanceSolution.Pressure
+    results.append(md.results.StressbalanceSolution)
+    minvx.append(np.min(vx[-md.mesh.numberofvertices2d:]))
+    maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:]))
 
-	#Now plot vx, vy, vz and vx on a cross section
-#	plotmodel(md,'data',vx,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km','figure',2)
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipaFSvx' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipaFSvx%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
-#	plotmodel(md,'data',vy,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km','figure',3)
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipaFSvy' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipaFSvy%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
-#	plotmodel(md,'data',vz,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km','figure',4)
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipaFSvz' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipaFSvz%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
+    #Now plot vx, vy, vz and vx on a cross section
+    #   plotmodel(md, 'data', vx, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 1.0e3], 'ylim', [0 L / 1.0e3], 'unit', 'km', 'figure', 2)
+    if printingflag:
+        pass
+    #           set(gcf, 'Color', 'w')
+    #           printmodel(['ismipaFSvx' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+    #           shutil.move("ismipaFSvx%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
+    #   plotmodel(md, 'data', vy, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 1.0e3], 'ylim', [0 L / 1.0e3], 'unit', 'km', 'figure', 3)
+    if printingflag:
+        pass
+    #           set(gcf, 'Color', 'w')
+    #           printmodel(['ismipaFSvy' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+    #           shutil.move("ismipaFSvy%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
+    #   plotmodel(md, 'data', vz, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 1.0e3], 'ylim', [0 L / 1.0e3], 'unit', 'km', 'figure', 4)
+    if printingflag:
+        pass
+    #           set(gcf, 'Color', 'w')
+    #           printmodel(['ismipaFSvz' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+    #           shutil.move("ismipaFSvz%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
 
-	if   (L==5000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP5000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[10 18],'xlim',[0 5000],'title','','xlabel','')
-	elif (L==10000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP10000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[10 30],'xlim',[0 10000],'title','','xlabel','')
-	elif (L==20000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP20000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 50],'xlim',[0 20000],'title','','xlabel','')
-	elif (L==40000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP40000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 80],'xlim',[0 40000],'title','','xlabel','')
-	elif (L==80000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP80000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 100],'xlim',[0 80000],'title','','xlabel','')
-	elif (L==160000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP160000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 120],'xlim',[0 160000],'title','','xlabel','')
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipaFSvxsec' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipaFSvxsec.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
+    if (L == 5000.):
+        pass
+    #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP5000.exp', 'layer', md.mesh.numberoflayers, ...
+    #                   'resolution', [10 10], 'ylim', [10 18], 'xlim', [0 5000], 'title', '', 'xlabel', '')
+    elif (L == 10000.):
+        pass
+    #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP10000.exp', 'layer', md.mesh.numberoflayers, ...
+    #                   'resolution', [10 10], 'ylim', [10 30], 'xlim', [0 10000], 'title', '', 'xlabel', '')
+    elif (L == 20000.):
+        pass
+    #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP20000.exp', 'layer', md.mesh.numberoflayers, ...
+    #                   'resolution', [10 10], 'ylim', [0 50], 'xlim', [0 20000], 'title', '', 'xlabel', '')
+    elif (L == 40000.):
+        pass
+    #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP40000.exp', 'layer', md.mesh.numberoflayers, ...
+    #                   'resolution', [10 10], 'ylim', [0 80], 'xlim', [0 40000], 'title', '', 'xlabel', '')
+    elif (L == 80000.):
+        pass
+    #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP80000.exp', 'layer', md.mesh.numberoflayers, ...
+    #                   'resolution', [10 10], 'ylim', [0 100], 'xlim', [0 80000], 'title', '', 'xlabel', '')
+    elif (L == 160000.):
+        pass
+    #           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP160000.exp', 'layer', md.mesh.numberoflayers, ...
+    #                   'resolution', [10 10], 'ylim', [0 120], 'xlim', [0 160000], 'title', '', 'xlabel', '')
+    if printingflag:
+        pass
+    # set(gcf, 'Color', 'w')
+    # printmodel(['ismipaFSvxsec' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+    # shutil.move("ismipaFSvxsec.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
 
-#Now plot the min and max values of vx for each size of the square
-#plot([5 10 20 40 80 160],minvx)ylim([0 18])
+    #Now plot the min and max values of vx for each size of the square
+    #plot([5 10 20 40 80 160], minvx)ylim([0 18])
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('ismipaFSminvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#	shutil.move('ismipaFSminvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
-#plot([5 10 20 40 80 160],maxvx)ylim([0 120])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('ismipaFSminvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#       shutil.move('ismipaFSminvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
+#plot([5 10 20 40 80 160], maxvx)ylim([0 120])
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('ismipaFSmaxvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#	shutil.move('ismipaFSmaxvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestA')
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('ismipaFSmaxvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#       shutil.move('ismipaFSmaxvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestA')
 
 #Fields and tolerances to track changes
-field_names     =['Vx80km','Vy80km','Vz80km']
-field_tolerances=[1e-12,1e-11,1e-12,]
-field_values=[]
+field_names = ['Vx80km', 'Vy80km', 'Vz80km']
+field_tolerances = [1e-12, 1e-11, 1e-12]
+field_values = []
 for result in results:
-	field_values=field_values+[\
-		result.Vx,\
-		result.Vy,\
-		result.Vz,\
-		]
+    field_values = field_values + [result.Vx, result.Vy, result.Vz]
Index: /issm/trunk/test/NightlyRun/test1103.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1103.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1103.py	(revision 24313)
@@ -1,5 +1,4 @@
 #Test Name: ISMIPBHO
 import numpy as np
-import shutil
 from model import *
 from socket import gethostname
@@ -11,117 +10,117 @@
 
 """
-This test is a test from the ISMP-HOM Intercomparison project.
+This test is a test from the ISMP - HOM Intercomparison project.
 Pattyn and Payne 2006
 """
 
-printingflag=False
+printingflag = False
 
-L_list=[80000.]
-results=[]
-minvx=[]
-maxvx=[]
+L_list = [80000.]
+results = []
+minvx = []
+maxvx = []
 
 for L in L_list:
-	nx=20    #numberof nodes in x direction
-	ny=20
-	md=model()
-	md=squaremesh(md,L,L,nx,ny)
-	md=setmask(md,'','')    #ice sheet test
-	md=parameterize(md,'../Par/ISMIPB.py')
-	md.extrude(10,1.)
+    nx = 20  #numberof nodes in x direction
+    ny = 20
+    md = model()
+    md = squaremesh(md, L, L, nx, ny)
+    md = setmask(md, '', '')  #ice sheet test
+    md = parameterize(md, '../Par/ISMIPB.py')
+    md.extrude(10, 1.)
 
-	md=setflowequation(md,'HO','all')
+    md = setflowequation(md, 'HO', 'all')
 
-	#Create dirichlet on the bed only
-	md.stressbalance.spcvx=np.nan*np.ones((md.mesh.numberofvertices))
-	md.stressbalance.spcvy=np.nan*np.ones((md.mesh.numberofvertices))
-	md.stressbalance.spcvz=np.nan*np.ones((md.mesh.numberofvertices))
-	pos=np.nonzero(md.mesh.vertexonbase)
-	md.stressbalance.spcvx[pos]=0.
-	md.stressbalance.spcvy[pos]=0.
+#Create dirichlet on the bed only
+    md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
+    md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
+    md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices))
+    pos = np.nonzero(md.mesh.vertexonbase)
+    md.stressbalance.spcvx[pos] = 0.
+    md.stressbalance.spcvy[pos] = 0.
 
-	#Create MPCs to have periodic boundary conditions
-	posx=np.where(md.mesh.x==0.)[0]
-	posx2=np.where(md.mesh.x==np.max(md.mesh.x))[0]
+#Create MPCs to have periodic boundary conditions
+    posx = np.where(md.mesh.x == 0.)[0]
+    posx2 = np.where(md.mesh.x == np.max(md.mesh.x))[0]
 
-	posy=np.where(np.logical_and.reduce((md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x))))[0]    #Don't take the same nodes two times
-	posy2=np.where(np.logical_and.reduce((md.mesh.y==np.max(md.mesh.y),md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x))))[0]
+    posy = np.where(np.logical_and.reduce((md.mesh.y == 0., md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]  #Don't take the same nodes two times
+    posy2 = np.where(np.logical_and.reduce((md.mesh.y == np.max(md.mesh.y), md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]
 
-	md.stressbalance.vertex_pairing=np.vstack((np.vstack((posx+1,posx2+1)).T,np.vstack((posy+1,posy2+1)).T))
+    md.stressbalance.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T))
 
-	#Compute the stressbalance
-	md.cluster=generic('name',gethostname(),'np',8)
-	md=solve(md,'Stressbalance')
+#Compute the stressbalance
+    md.cluster = generic('name', gethostname(), 'np', 8)
+    md = solve(md, 'Stressbalance')
 
-	#Plot the results and save them
-	vx=md.results.StressbalanceSolution.Vx
-	vy=md.results.StressbalanceSolution.Vy
-	vz=md.results.StressbalanceSolution.Vz
-	results.append(md.results.StressbalanceSolution)
-	minvx.append(np.min(vx[md.mesh.numberofvertices2d:]))
-	maxvx.append(np.max(vx[md.mesh.numberofvertices2d:]))
+#Plot the results and save them
+    vx = md.results.StressbalanceSolution.Vx
+    vy = md.results.StressbalanceSolution.Vy
+    vz = md.results.StressbalanceSolution.Vz
+    results.append(md.results.StressbalanceSolution)
+    minvx.append(np.min(vx[md.mesh.numberofvertices2d:]))
+    maxvx.append(np.max(vx[md.mesh.numberofvertices2d:]))
 
-	#Now plot vx, vy, vz and vx on a cross section
-#	plotmodel(md,'data',vx,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km')
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipbHOvx' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipbHOvx%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestB')
-#	plotmodel(md,'data',vz,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km')
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipbHOvz' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipbHOvz%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestB')
+#Now plot vx, vy, vz and vx on a cross section
+#   plotmodel(md, 'data', vx, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 1.0e3], 'ylim', [0 L / 1.0e3], 'unit', 'km')
+    if printingflag:
+        pass
+#           set(gcf, 'Color', 'w')
+#           printmodel(['ismipbHOvx' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#           shutil.move("ismipbHOvx%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestB')
+#   plotmodel(md, 'data', vz, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 1.0e3], 'ylim', [0 L / 1.0e3], 'unit', 'km')
+    if printingflag:
+        pass
+#           set(gcf, 'Color', 'w')
+#           printmodel(['ismipbHOvz' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#           shutil.move("ismipbHOvz%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestB')
 
-	if   (L==5000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP5000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[6 16],'xlim',[0 5000],'title','','xlabel','')
-	elif (L==10000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP10000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 40],'xlim',[0 10000],'title','','xlabel','')
-	elif (L==20000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP20000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 60],'xlim',[0 20000],'title','','xlabel','')
-	elif (L==40000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP40000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 100],'xlim',[0 40000],'title','','xlabel','')
-	elif (L==80000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP80000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 120],'xlim',[0 80000],'title','','xlabel','')
-	elif (L==160000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP160000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 120],'xlim',[0 160000],'title','','xlabel','')
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipbHOvxsec' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipbHOvxsec%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestB')
+    if (L == 5000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP5000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [6 16], 'xlim', [0 5000], 'title', '', 'xlabel', '')
+    elif (L == 10000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP10000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [0 40], 'xlim', [0 10000], 'title', '', 'xlabel', '')
+    elif (L == 20000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP20000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [0 60], 'xlim', [0 20000], 'title', '', 'xlabel', '')
+    elif (L == 40000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP40000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [0 100], 'xlim', [0 40000], 'title', '', 'xlabel', '')
+    elif (L == 80000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP80000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [0 120], 'xlim', [0 80000], 'title', '', 'xlabel', '')
+    elif (L == 160000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP160000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [0 120], 'xlim', [0 160000], 'title', '', 'xlabel', '')
+    if printingflag:
+        pass
+#           set(gcf, 'Color', 'w')
+#           printmodel(['ismipbHOvxsec' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#           shutil.move("ismipbHOvxsec%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestB')
 
 #Now plot the min and max values of vx for each size of the square
-#plot([5 10 20 40 80 160],minvx)ylim([0 14])xlim([0 160])
+#plot([5 10 20 40 80 160], minvx)ylim([0 14])xlim([0 160])
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('ismipbHOminvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#	shutil.move('ismipbHOminvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestB')
-#plot([5 10 20 40 80 160],maxvx)ylim([0 120])xlim([0 160])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('ismipbHOminvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#       shutil.move('ismipbHOminvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestB')
+#plot([5 10 20 40 80 160], maxvx)ylim([0 120])xlim([0 160])
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('ismipbHOmaxvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#	shutil.move('ismipbHOmaxvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestB')
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('ismipbHOmaxvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#       shutil.move('ismipbHOmaxvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestB')
 
 #Fields and tolerances to track changes
-field_names     =['Vx80km','Vy80km','Vz80km']
-field_tolerances=[1e-08,1e-07,1e-07]
-field_values=[]
+field_names = ['Vx80km', 'Vy80km', 'Vz80km']
+field_tolerances = [1e-08, 1e-07, 1e-07]
+field_values = []
 for result in results:
-	field_values=field_values+[result.Vx,result.Vy,result.Vz]
+    field_values = field_values + [result.Vx, result.Vy, result.Vz]
Index: /issm/trunk/test/NightlyRun/test1104.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1104.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1104.py	(revision 24313)
@@ -10,62 +10,62 @@
 
 """
-This test is a test from the ISMP-HOM Intercomparison project.
+This test is a test from the ISMP - HOM Intercomparison project.
 Pattyn and Payne 2006
 """
 
-L_list=[80000.]
-results=[]
+L_list = [80000.]
+results = []
 
 for L in L_list:
-	nx=20    #numberof nodes in x direction
-	ny=20
-	md=model()
-	md=squaremesh(md,L,L,nx,ny)
-	md=setmask(md,'','')    #ice sheet test
-	md=parameterize(md,'../Par/ISMIPB.py')
-	md.extrude(10,1.)
-	md=setflowequation(md,'HO','all')
+    nx = 20  #numberof nodes in x direction
+    ny = 20
+    md = model()
+    md = squaremesh(md, L, L, nx, ny)
+    md = setmask(md, '', '')  #ice sheet test
+    md = parameterize(md, '../Par/ISMIPB.py')
+    md.extrude(10, 1.)
+    md = setflowequation(md, 'HO', 'all')
 
-	#Create dirichlet on the bed only
-	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))
+#Create dirichlet on the bed only
+    md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
+    md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
+    md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices))
 
-	pos=np.where(md.mesh.vertexonbase)
-	md.stressbalance.spcvx[pos]=0.
-	md.stressbalance.spcvy[pos]=0.
+    pos = np.where(md.mesh.vertexonbase)
+    md.stressbalance.spcvx[pos] = 0.
+    md.stressbalance.spcvy[pos] = 0.
 
-	#Create MPCs to have periodic boundary conditions
-	posx=np.where(md.mesh.x==0.)[0]
-	posx2=np.where(md.mesh.x==np.max(md.mesh.x))[0]
+#Create MPCs to have periodic boundary conditions
+    posx = np.where(md.mesh.x == 0.)[0]
+    posx2 = np.where(md.mesh.x == np.max(md.mesh.x))[0]
 
-	posy=np.where(np.logical_and.reduce((md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x))))[0]    #Don't take the same nodes two times
-	posy2=np.where(np.logical_and.reduce((md.mesh.y==np.max(md.mesh.y),md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x))))[0]
+    posy = np.where(np.logical_and.reduce((md.mesh.y == 0., md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]  #Don't take the same nodes two times
+    posy2 = np.where(np.logical_and.reduce((md.mesh.y == np.max(md.mesh.y), md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]
 
-	md.stressbalance.vertex_pairing=np.vstack((np.vstack((posx+1,posx2+1)).T,np.vstack((posy+1,posy2+1)).T))
-	print np.shape(md.stressbalance.vertex_pairing)
-	#Compute the stressbalance
-	md.stressbalance.abstol=np.nan
-	md.cluster=generic('name',gethostname(),'np',8)
-	md=solve(md,'Stressbalance')
-	pos=np.where(np.logical_or.reduce((md.mesh.x==0.,md.mesh.y==0.,md.mesh.x==np.max(md.mesh.x),md.mesh.y==np.max(md.mesh.y))))
-	md.stressbalance.spcvx[pos]=md.results.StressbalanceSolution.Vx[pos][:,0]
-	md.stressbalance.spcvy[pos]=md.results.StressbalanceSolution.Vy[pos][:,0]
-	md.stressbalance.vertex_pairing=np.empty((0,2),int)
-	md=setflowequation(md,'FS','all')
-	md=solve(md,'Stressbalance')
+    md.stressbalance.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T))
+    print(np.shape(md.stressbalance.vertex_pairing))
+#Compute the stressbalance
+    md.stressbalance.abstol = np.nan
+    md.cluster = generic('name', gethostname(), 'np', 8)
+    md = solve(md, 'Stressbalance')
+    pos = np.where(np.logical_or.reduce((md.mesh.x == 0., md.mesh.y == 0., md.mesh.x == np.max(md.mesh.x), md.mesh.y == np.max(md.mesh.y))))
+    md.stressbalance.spcvx[pos] = md.results.StressbalanceSolution.Vx[pos][:, 0]
+    md.stressbalance.spcvy[pos] = md.results.StressbalanceSolution.Vy[pos][:, 0]
+    md.stressbalance.vertex_pairing = np.empty((0, 2), int)
+    md = setflowequation(md, 'FS', 'all')
+    md = solve(md, 'Stressbalance')
 
-	#Plot the results and save them
-	vx=md.results.StressbalanceSolution.Vx
-	vy=md.results.StressbalanceSolution.Vy
-	vz=md.results.StressbalanceSolution.Vz
-	results.append(md.results.StressbalanceSolution)
+#Plot the results and save them
+    vx = md.results.StressbalanceSolution.Vx
+    vy = md.results.StressbalanceSolution.Vy
+    vz = md.results.StressbalanceSolution.Vz
+    results.append(md.results.StressbalanceSolution)
 
-#	plotmodel(md,'data',vx,'data',vy,'data',vz,'layer#all',md.mesh.numberoflayers)
+#       plotmodel(md, 'data', vx, 'data', vy, 'data', vz, 'layer  #all', md.mesh.numberoflayers)
 
 #Fields and tolerances to track changes
-field_names     =['Vx80km','Vy80km','Vz80km']
-field_tolerances=[1e-08,1e-07,1e-08]
-field_values=[]
+field_names = ['Vx80km', 'Vy80km', 'Vz80km']
+field_tolerances = [1e-08, 1e-07, 1e-08]
+field_values = []
 for result in results:
-	field_values=field_values+[result.Vx,result.Vy,result.Vz]
+    field_values = field_values + [result.Vx, result.Vy, result.Vz]
Index: /issm/trunk/test/NightlyRun/test1105.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1105.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1105.py	(revision 24313)
@@ -1,5 +1,4 @@
 #Test Name: ISMIPCHO
 import numpy as np
-import shutil
 from model import *
 from socket import gethostname
@@ -11,146 +10,146 @@
 
 """
-This test is a test from the ISMP-HOM Intercomparison project.
+This test is a test from the ISMP - HOM Intercomparison project.
 Pattyn and Payne 2006
 """
 
-printingflag=False
+printingflag = False
 
-L_list=[80000.]
-results=[]
-minvx=[]
-maxvx=[]
+L_list = [80000.]
+results = []
+minvx = []
+maxvx = []
 
-for L in L_list:    #in m (3 times the desired length for BC problems)  
-	nx=30    #number of nodes in x direction
-	ny=30
-	md=model()
-	md=squaremesh(md,L,L,nx,ny)
-	md=setmask(md,'','')    #ice sheet test
-	md=parameterize(md,'../Par/ISMIPC.py')
-	md.extrude(10,1.)
+for L in L_list:  #in m (3 times the desired length for BC problems)
+    nx = 30  #number of nodes in x direction
+    ny = 30
+    md = model()
+    md = squaremesh(md, L, L, nx, ny)
+    md = setmask(md, '', '')  #ice sheet test
+    md = parameterize(md, '../Par/ISMIPC.py')
+    md.extrude(10, 1.)
 
-	md=setflowequation(md,'HO','all')
+    md = setflowequation(md, 'HO', 'all')
 
-	#Create MPCs to have periodic boundary conditions
-	md.stressbalance.spcvx=np.nan*np.ones((md.mesh.numberofvertices))
-	md.stressbalance.spcvy=np.nan*np.ones((md.mesh.numberofvertices))
-	md.stressbalance.spcvz=np.nan*np.ones((md.mesh.numberofvertices))
+#Create MPCs to have periodic boundary conditions
+    md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
+    md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
+    md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices))
 
-	posx=np.where(np.logical_and.reduce((md.mesh.x==0.,md.mesh.y!=0.,md.mesh.y!=L)))[0]
-	posx2=np.where(np.logical_and.reduce((md.mesh.x==L,md.mesh.y!=0.,md.mesh.y!=L)))[0]
+    posx = np.where(np.logical_and.reduce((md.mesh.x == 0., md.mesh.y != 0., md.mesh.y != L)))[0]
+    posx2 = np.where(np.logical_and.reduce((md.mesh.x == L, md.mesh.y != 0., md.mesh.y != L)))[0]
 
-	posy=np.where(np.logical_and.reduce((md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=L)))[0]    #Don't take the same nodes two times
-	posy2=np.where(np.logical_and.reduce((md.mesh.y==L,md.mesh.x!=0.,md.mesh.x!=L)))[0]
+    posy = np.where(np.logical_and.reduce((md.mesh.y == 0., md.mesh.x != 0., md.mesh.x != L)))[0]  #Don't take the same nodes two times
+    posy2 = np.where(np.logical_and.reduce((md.mesh.y == L, md.mesh.x != 0., md.mesh.x != L)))[0]
 
-	md.stressbalance.vertex_pairing=np.vstack((np.vstack((posx+1,posx2+1)).T,np.vstack((posy+1,posy2+1)).T))
+    md.stressbalance.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T))
 
-	#Add spc on the corners
-	pos=np.where(np.logical_and.reduce((np.logical_or(md.mesh.x==0.,md.mesh.x==L),np.logical_or(md.mesh.y==0.,md.mesh.y==L),md.mesh.vertexonbase)))
-	md.stressbalance.spcvx[pos]=0.
-	md.stressbalance.spcvy[pos]=0.
-	if   (L==5000.):
-		md.stressbalance.spcvx[pos]=15.66
-		md.stressbalance.spcvy[pos]=-0.1967
-	elif (L==10000.):
-		md.stressbalance.spcvx[pos]=16.04
-		md.stressbalance.spcvy[pos]=-0.1977
-	elif (L==20000.):
-		md.stressbalance.spcvx[pos]=16.53
-		md.stressbalance.spcvy[pos]=-1.27
-	elif (L==40000.):
-		md.stressbalance.spcvx[pos]=17.23
-		md.stressbalance.spcvy[pos]=-3.17
-	elif (L==80000.):
-		md.stressbalance.spcvx[pos]=16.68
-		md.stressbalance.spcvy[pos]=-2.69
-	elif (L==160000.):
-		md.stressbalance.spcvx[pos]=16.03
-		md.stressbalance.spcvy[pos]=-1.27
-	
-	#Spc the bed at zero for vz
-	pos=np.where(md.mesh.vertexonbase)
-	md.stressbalance.spcvz[pos]=0.
+#Add spc on the corners
+    pos = np.where(np.logical_and.reduce((np.logical_or(md.mesh.x == 0., md.mesh.x == L), np.logical_or(md.mesh.y == 0., md.mesh.y == L), md.mesh.vertexonbase)))
+    md.stressbalance.spcvx[pos] = 0.
+    md.stressbalance.spcvy[pos] = 0.
+    if (L == 5000.):
+        md.stressbalance.spcvx[pos] = 15.66
+        md.stressbalance.spcvy[pos] = -0.1967
+    elif (L == 10000.):
+        md.stressbalance.spcvx[pos] = 16.04
+        md.stressbalance.spcvy[pos] = -0.1977
+    elif (L == 20000.):
+        md.stressbalance.spcvx[pos] = 16.53
+        md.stressbalance.spcvy[pos] = -1.27
+    elif (L == 40000.):
+        md.stressbalance.spcvx[pos] = 17.23
+        md.stressbalance.spcvy[pos] = -3.17
+    elif (L == 80000.):
+        md.stressbalance.spcvx[pos] = 16.68
+        md.stressbalance.spcvy[pos] = -2.69
+    elif (L == 160000.):
+        md.stressbalance.spcvx[pos] = 16.03
+        md.stressbalance.spcvy[pos] = -1.27
 
-	#Compute the stressbalance
-	md.cluster=generic('name',gethostname(),'np',8)
-	md=solve(md,'Stressbalance')
+#Spc the bed at zero for vz
+    pos = np.where(md.mesh.vertexonbase)
+    md.stressbalance.spcvz[pos] = 0.
 
-	#Plot the results and save them
-	vx=md.results.StressbalanceSolution.Vx
-	vy=md.results.StressbalanceSolution.Vy
-	vz=md.results.StressbalanceSolution.Vz
-	results.append(md.results.StressbalanceSolution)
-	minvx.append(np.min(vx[-md.mesh.numberofvertices2d:]))
-	maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:]))
+#Compute the stressbalance
+    md.cluster = generic('name', gethostname(), 'np', 8)
+    md = solve(md, 'Stressbalance')
 
-	#Now plot vx, vy, vz and vx on a cross section
-#	plotmodel(md,'data',vx,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km','figure',2)
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipcHOvx' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipcHOvx%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
-#	plotmodel(md,'data',vy,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km','figure',3)
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipcHOvy' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipcHOvy%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
-#	plotmodel(md,'data',vz,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km','figure',4)
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipcHOvz' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipcHOvz%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
+#Plot the results and save them
+    vx = md.results.StressbalanceSolution.Vx
+    vy = md.results.StressbalanceSolution.Vy
+    vz = md.results.StressbalanceSolution.Vz
+    results.append(md.results.StressbalanceSolution)
+    minvx.append(np.min(vx[-md.mesh.numberofvertices2d:]))
+    maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:]))
 
-	if   (L==5000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP5000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 20],'xlim',[0 5000],'title','','xlabel','','figure',5)
-	elif (L==10000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP10000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[13 18],'xlim',[0 10000],'title','','xlabel','')
-	elif (L==20000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP20000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[14 22],'xlim',[0 20000],'title','','xlabel','')
-	elif (L==40000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP40000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[10 40],'xlim',[0 40000],'title','','xlabel','')
-	elif (L==80000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP80000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 80],'xlim',[0 80000],'title','','xlabel','')
-	elif (L==160000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP160000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 200],'xlim',[0 160000],'title','','xlabel','')
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipcHOvxsec' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipcHOvxsec%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
+#Now plot vx, vy, vz and vx on a cross section
+#   plotmodel(md, 'data', vx, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 1.0e3], 'ylim', [0 L / 1.0e3], 'unit', 'km', 'figure', 2)
+    if printingflag:
+        pass
+#           set(gcf, 'Color', 'w')
+#           printmodel(['ismipcHOvx' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#           shutil.move("ismipcHOvx%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestC')
+#   plotmodel(md, 'data', vy, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 1.0e3], 'ylim', [0 L / 1.0e3], 'unit', 'km', 'figure', 3)
+    if printingflag:
+        pass
+#           set(gcf, 'Color', 'w')
+#           printmodel(['ismipcHOvy' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#           shutil.move("ismipcHOvy%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestC')
+#   plotmodel(md, 'data', vz, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 1.0e3], 'ylim', [0 L / 1.0e3], 'unit', 'km', 'figure', 4)
+    if printingflag:
+        pass
+#           set(gcf, 'Color', 'w')
+#           printmodel(['ismipcHOvz' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#           shutil.move("ismipcHOvz%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestC')
+
+    if (L == 5000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP5000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [0 20], 'xlim', [0 5000], 'title', '', 'xlabel', '', 'figure', 5)
+    elif (L == 10000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP10000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [13 18], 'xlim', [0 10000], 'title', '', 'xlabel', '')
+    elif (L == 20000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP20000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [14 22], 'xlim', [0 20000], 'title', '', 'xlabel', '')
+    elif (L == 40000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP40000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [10 40], 'xlim', [0 40000], 'title', '', 'xlabel', '')
+    elif (L == 80000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP80000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [0 80], 'xlim', [0 80000], 'title', '', 'xlabel', '')
+    elif (L == 160000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP160000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [0 200], 'xlim', [0 160000], 'title', '', 'xlabel', '')
+    if printingflag:
+        pass
+#           set(gcf, 'Color', 'w')
+#           printmodel(['ismipcHOvxsec' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#           shutil.move("ismipcHOvxsec%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestC')
 
 #Now plot the min and max values of vx for each size of the square
-#plot([5 10 20 40 80 160],minvx)ylim([4 18])xlim([0 160])
+#plot([5 10 20 40 80 160], minvx)ylim([4 18])xlim([0 160])
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('ismipcHOminvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#	shutil.move('ismipcHOminvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
-#plot([5 10 20 40 80 160],maxvx)ylim([0 200]) xlim([0 160])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('ismipcHOminvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#       shutil.move('ismipcHOminvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestC')
+#plot([5 10 20 40 80 160], maxvx)ylim([0 200]) xlim([0 160])
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('ismipcHOmaxvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#	shutil.move('ismipcHOmaxvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestC')
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('ismipcHOmaxvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#       shutil.move('ismipcHOmaxvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestC')
 
 #Fields and tolerances to track changes
-field_names     =['Vx80km','Vy80km','Vz80km']
-field_tolerances=[1e-09,1e-08,1e-08]
-field_values=[]
+field_names = ['Vx80km', 'Vy80km', 'Vz80km']
+field_tolerances = [1e-09, 1e-08, 1e-08]
+field_values = []
 for result in results:
-	field_values=field_values+[result.Vx,result.Vy,result.Vz]
+    field_values = field_values + [result.Vx, result.Vy, result.Vz]
Index: /issm/trunk/test/NightlyRun/test1106.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1106.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1106.py	(revision 24313)
@@ -10,59 +10,59 @@
 
 """
-This test is a test from the ISMP-HOM Intercomparison project.
+This test is a test from the ISMP - HOM Intercomparison project.
 Pattyn and Payne 2006
 """
 
-L_list=[80000.]
-results=[]
+L_list = [80000]
+results = []
 
 for L in L_list:
-	md=triangle(model(),"../Exp/Square_%d.exp" % L,L/10.)    #size 3*L 
-	md=setmask(md,'','')    #ice sheet test
-	md=parameterize(md,'../Par/ISMIPC.py')
-	md.friction.coefficient=np.sqrt(md.constants.yts*(1000.+1000.*np.sin(md.mesh.x*2.*np.pi/L)*np.sin(md.mesh.y*2.*np.pi/L)))
-	md.extrude(10,1.)
+    md = triangle(model(), "../Exp/Square_{}.exp".format(L), L / 10.)  #size 3 * L
+    md = setmask(md, '', '')  #ice sheet test
+    md = parameterize(md, '../Par/ISMIPC.py')
+    md.friction.coefficient = np.sqrt(md.constants.yts * (1000. + 1000. * np.sin(md.mesh.x * 2. * np.pi / L) * np.sin(md.mesh.y * 2. * np.pi / L)))
+    md.extrude(10, 1.)
 
-	#Add spc on the borders
-	pos=np.where(np.logical_or.reduce((md.mesh.x==0.,md.mesh.x==np.max(md.mesh.x),md.mesh.y==0.,md.mesh.y==np.max(md.mesh.y))))
-	md.stressbalance.spcvx[pos]=0.
-	md.stressbalance.spcvy[pos]=0.
-	if   (L==5000.):
-		md.stressbalance.spcvx[pos]=15.66
-		md.stressbalance.spcvy[pos]=-0.1967
-	elif (L==10000.):
-		md.stressbalance.spcvx[pos]=16.04
-		md.stressbalance.spcvy[pos]=-0.1977
-	elif (L==20000.):
-		md.stressbalance.spcvx[pos]=16.53
-		md.stressbalance.spcvy[pos]=-1.27
-	elif (L==40000.):
-		md.stressbalance.spcvx[pos]=17.23
-		md.stressbalance.spcvy[pos]=-3.17
-	elif (L==80000.):
-		md.stressbalance.spcvx[pos]=16.68
-		md.stressbalance.spcvy[pos]=-2.69
-	elif (L==160000.):
-		md.stressbalance.spcvx[pos]=16.03
-		md.stressbalance.spcvy[pos]=-1.27
+#Add spc on the borders
+    pos = np.where(np.logical_or.reduce((md.mesh.x == 0., md.mesh.x == np.max(md.mesh.x), md.mesh.y == 0., md.mesh.y == np.max(md.mesh.y))))
+    md.stressbalance.spcvx[pos] = 0.
+    md.stressbalance.spcvy[pos] = 0.
+    if (L == 5000.):
+        md.stressbalance.spcvx[pos] = 15.66
+        md.stressbalance.spcvy[pos] = -0.1967
+    elif (L == 10000.):
+        md.stressbalance.spcvx[pos] = 16.04
+        md.stressbalance.spcvy[pos] = -0.1977
+    elif (L == 20000.):
+        md.stressbalance.spcvx[pos] = 16.53
+        md.stressbalance.spcvy[pos] = -1.27
+    elif (L == 40000.):
+        md.stressbalance.spcvx[pos] = 17.23
+        md.stressbalance.spcvy[pos] = -3.17
+    elif (L == 80000.):
+        md.stressbalance.spcvx[pos] = 16.68
+        md.stressbalance.spcvy[pos] = -2.69
+    elif (L == 160000.):
+        md.stressbalance.spcvx[pos] = 16.03
+        md.stressbalance.spcvy[pos] = -1.27
 
-	md=setflowequation(md,'FS','all')
+    md = setflowequation(md, 'FS', 'all')
 
-	#Compute the stressbalance
-	md.cluster=generic('name',gethostname(),'np',8)
-	md=solve(md,'Stressbalance')
+#Compute the stressbalance
+    md.cluster = generic('name', gethostname(), 'np', 8)
+    md = solve(md, 'Stressbalance')
 
-	#Plot the results and save them
-	vx=md.results.StressbalanceSolution.Vx
-	vy=md.results.StressbalanceSolution.Vy
-	vz=md.results.StressbalanceSolution.Vz
-	results.append(md.results.StressbalanceSolution)
+#Plot the results and save them
+    vx = md.results.StressbalanceSolution.Vx
+    vy = md.results.StressbalanceSolution.Vy
+    vz = md.results.StressbalanceSolution.Vz
+    results.append(md.results.StressbalanceSolution)
 
-#	plotmodel(md,'data',vx,'data',vy,'data',vz,'layer#all',md.mesh.numberoflayers)
+#   plotmodel(md, 'data', vx, 'data', vy, 'data', vz, 'layer  #all', md.mesh.numberoflayers)
 
 #Fields and tolerances to track changes
-field_names     =['Vx80km','Vy80km','Vz80km']
-field_tolerances=[1e-12,1e-12,1e-12]
-field_values=[]
+field_names = ['Vx80km', 'Vy80km', 'Vz80km']
+field_tolerances = [1e-12, 1e-12, 1e-12]
+field_values = []
 for result in results:
-	field_values=field_values+[result.Vx,result.Vy,result.Vz]
+    field_values = field_values + [result.Vx, result.Vy, result.Vz]
Index: /issm/trunk/test/NightlyRun/test1107.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1107.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1107.py	(revision 24313)
@@ -1,5 +1,4 @@
 #Test Name: ISMIPDHO
 import numpy as np
-import shutil
 from model import *
 from socket import gethostname
@@ -11,137 +10,137 @@
 
 """
-This test is a test from the ISMP-HOM Intercomparison project.
+This test is a test from the ISMP - HOM Intercomparison project.
 Pattyn and Payne 2006
 """
 
-printingflag=False
+printingflag = False
 
-L_list=[80000.]
-results=[]
-minvx=[]
-maxvx=[]
+L_list = [80000.]
+results = []
+minvx = []
+maxvx = []
 
 for L in L_list:
-	nx=30    #numberof nodes in x direction
-	ny=30
-	md=model()
-	md=squaremesh(md,L,L,nx,ny)
-	md=setmask(md,'','')    #ice sheet test
-	md=parameterize(md,'../Par/ISMIPD.py')
-	md.extrude(10,1.)
+    nx = 30  #numberof nodes in x direction
+    ny = 30
+    md = model()
+    md = squaremesh(md, L, L, nx, ny)
+    md = setmask(md, '', '')  #ice sheet test
+    md = parameterize(md, '../Par/ISMIPD.py')
+    md.extrude(10, 1.)
 
-	md=setflowequation(md,'HO','all')
+    md = setflowequation(md, 'HO', 'all')
 
-	#We need one grd on dirichlet: the 4 corners are set to zero
-	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))
+#We need one grd on dirichlet: the 4 corners are set to zero
+    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))
 
-	#Create MPCs to have periodic boundary conditions
-#	posx=find(md.mesh.x==0. & ~(md.mesh.y==0. & md.mesh.vertexonbase) & ~(md.mesh.y==L & md.mesh.vertexonbase))
-	posx=np.where(np.logical_and.reduce((md.mesh.x==0.,np.logical_not(np.logical_and(md.mesh.y==0.,md.mesh.vertexonbase)),np.logical_not(np.logical_and(md.mesh.y==L,md.mesh.vertexonbase)))))[0]
-#	posx2=find(md.mesh.x==max(md.mesh.x) & ~(md.mesh.y==0. & md.mesh.vertexonbase) & ~(md.mesh.y==L & md.mesh.vertexonbase))
-	posx2=np.where(np.logical_and.reduce((md.mesh.x==np.max(md.mesh.x),np.logical_not(np.logical_and(md.mesh.y==0.,md.mesh.vertexonbase)),np.logical_not(np.logical_and(md.mesh.y==L,md.mesh.vertexonbase)))))[0]
+#Create MPCs to have periodic boundary conditions
+#   posx = find(md.mesh.x = 0. & ~(md.mesh.y = 0. & md.mesh.vertexonbase) & ~(md.mesh.y = L & md.mesh.vertexonbase))
+    posx = np.where(np.logical_and.reduce((md.mesh.x == 0., np.logical_not(np.logical_and(md.mesh.y == 0., md.mesh.vertexonbase)), np.logical_not(np.logical_and(md.mesh.y == L, md.mesh.vertexonbase)))))[0]
+#   posx2 = find(md.mesh.x = max(md.mesh.x) & ~(md.mesh.y = 0. & md.mesh.vertexonbase) & ~(md.mesh.y = L & md.mesh.vertexonbase))
+    posx2 = np.where(np.logical_and.reduce((md.mesh.x == np.max(md.mesh.x), np.logical_not(np.logical_and(md.mesh.y == 0., md.mesh.vertexonbase)), np.logical_not(np.logical_and(md.mesh.y == L, md.mesh.vertexonbase)))))[0]
 
-	posy=np.where(np.logical_and.reduce((md.mesh.y==0.,md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x))))[0]    #Don't take the same nodes two times
-	posy2=np.where(np.logical_and.reduce((md.mesh.y==np.max(md.mesh.y),md.mesh.x!=0.,md.mesh.x!=np.max(md.mesh.x))))[0]
+    posy = np.where(np.logical_and.reduce((md.mesh.y == 0., md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]  #Don't take the same nodes two times
+    posy2 = np.where(np.logical_and.reduce((md.mesh.y == np.max(md.mesh.y), md.mesh.x != 0., md.mesh.x != np.max(md.mesh.x))))[0]
 
-	md.stressbalance.vertex_pairing=np.vstack((np.vstack((posx+1,posx2+1)).T,np.vstack((posy+1,posy2+1)).T))
+    md.stressbalance.vertex_pairing = np.vstack((np.vstack((posx + 1, posx2 + 1)).T, np.vstack((posy + 1, posy2 + 1)).T))
 
-	#Add spc on the corners
-	pos=np.where(np.logical_and.reduce((np.logical_or(md.mesh.x==0.,md.mesh.x==L),np.logical_or(md.mesh.y==0.,md.mesh.y==L),md.mesh.vertexonbase)))
-	md.stressbalance.spcvy[:]=0.
-	md.stressbalance.spcvx[pos]=0.
-	if   (L==5000.):
-		md.stressbalance.spcvx[pos]=16.0912
-	elif (L==10000.):
-		md.stressbalance.spcvx[pos]=16.52
-	elif (L==20000.):
-		md.stressbalance.spcvx[pos]=17.77
-	elif (L==40000.):
-		md.stressbalance.spcvx[pos]=19.88
-	elif (L==80000.):
-		md.stressbalance.spcvx[pos]=18.65
-	elif (L==160000.):
-		md.stressbalance.spcvx[pos]=16.91
-	
-	#Spc the bed at zero for vz
-	pos=np.where(md.mesh.vertexonbase)
-	md.stressbalance.spcvz[pos]=0.
+#Add spc on the corners
+    pos = np.where(np.logical_and.reduce((np.logical_or(md.mesh.x == 0., md.mesh.x == L), np.logical_or(md.mesh.y == 0., md.mesh.y == L), md.mesh.vertexonbase)))
+    md.stressbalance.spcvy[:] = 0.
+    md.stressbalance.spcvx[pos] = 0.
+    if (L == 5000.):
+        md.stressbalance.spcvx[pos] = 16.0912
+    elif (L == 10000.):
+        md.stressbalance.spcvx[pos] = 16.52
+    elif (L == 20000.):
+        md.stressbalance.spcvx[pos] = 17.77
+    elif (L == 40000.):
+        md.stressbalance.spcvx[pos] = 19.88
+    elif (L == 80000.):
+        md.stressbalance.spcvx[pos] = 18.65
+    elif (L == 160000.):
+        md.stressbalance.spcvx[pos] = 16.91
 
-	#Compute the stressbalance
-	md.cluster=generic('name',gethostname(),'np',8)
-	md=solve(md,'Stressbalance')
+#Spc the bed at zero for vz
+    pos = np.where(md.mesh.vertexonbase)
+    md.stressbalance.spcvz[pos] = 0.
 
-	#Plot the results and save them
-	vx=md.results.StressbalanceSolution.Vx
-	vy=md.results.StressbalanceSolution.Vy
-	vz=md.results.StressbalanceSolution.Vz
-	results.append(md.results.StressbalanceSolution)
-	minvx.append(np.min(vx[-md.mesh.numberofvertices2d:]))
-	maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:]))
+#Compute the stressbalance
+    md.cluster = generic('name', gethostname(), 'np', 8)
+    md = solve(md, 'Stressbalance')
 
-	#Now plot vx, vy, vz and vx on a cross section
-#	plotmodel(md,'data',vx,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km','figure',2)
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipdHOvx' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipdHOvx%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestD')
-#	plotmodel(md,'data',vz,'layer#all',md.mesh.numberoflayers,'xlim',[0 L/10^3],'ylim',[0 L/10^3],'unit','km','figure',3)
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipdHOvz' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipdHOvz%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestD')
+#Plot the results and save them
+    vx = md.results.StressbalanceSolution.Vx
+    vy = md.results.StressbalanceSolution.Vy
+    vz = md.results.StressbalanceSolution.Vz
+    results.append(md.results.StressbalanceSolution)
+    minvx.append(np.min(vx[-md.mesh.numberofvertices2d:]))
+    maxvx.append(np.max(vx[-md.mesh.numberofvertices2d:]))
 
-	if   (L==5000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP5000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 20],'xlim',[0 5000],'title','','xlabel','','figure',4)
-	elif (L==10000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP10000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 20],'xlim',[0 10000],'title','','xlabel','','figure',4)
-	elif (L==20000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP20000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 30],'xlim',[0 20000],'title','','xlabel','','figure',4)
-	elif (L==40000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP40000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[10 60],'xlim',[0 40000],'title','','xlabel','','figure',4)
-	elif (L==80000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP80000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 200],'xlim',[0 80000],'title','','xlabel','','figure',4)
-	elif (L==160000.):
-		pass
-#		plotmodel(md,'data',vx,'sectionvalue','../Exp/ISMIP160000.exp','layer',md.mesh.numberoflayers,...
-#			'resolution',[10 10],'ylim',[0 400],'xlim',[0 160000],'title','','xlabel','','figure',4)
-	if printingflag:
-		pass
-#		set(gcf,'Color','w')
-#		printmodel(['ismipdHOvxsec' num2str(L)],'png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#		shutil.move("ismipdHOvxsec%d.png" % L,ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestD')
+#Now plot vx, vy, vz and vx on a cross section
+#   plotmodel(md, 'data', vx, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 1.0e3], 'ylim', [0 L / 1.0e3], 'unit', 'km', 'figure', 2)
+    if printingflag:
+        pass
+#           set(gcf, 'Color', 'w')
+#           printmodel(['ismipdHOvx' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#           shutil.move("ismipdHOvx%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestD')
+#   plotmodel(md, 'data', vz, 'layer  #all', md.mesh.numberoflayers, 'xlim', [0 L / 1.0e3], 'ylim', [0 L / 1.0e3], 'unit', 'km', 'figure', 3)
+    if printingflag:
+        pass
+#           set(gcf, 'Color', 'w')
+#           printmodel(['ismipdHOvz' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#           shutil.move("ismipdHOvz%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestD')
+
+    if (L == 5000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP5000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [0 20], 'xlim', [0 5000], 'title', '', 'xlabel', '', 'figure', 4)
+    elif (L == 10000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP10000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [0 20], 'xlim', [0 10000], 'title', '', 'xlabel', '', 'figure', 4)
+    elif (L == 20000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP20000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [0 30], 'xlim', [0 20000], 'title', '', 'xlabel', '', 'figure', 4)
+    elif (L == 40000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP40000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [10 60], 'xlim', [0 40000], 'title', '', 'xlabel', '', 'figure', 4)
+    elif (L == 80000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP80000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [0 200], 'xlim', [0 80000], 'title', '', 'xlabel', '', 'figure', 4)
+    elif (L == 160000.):
+        pass
+#           plotmodel(md, 'data', vx, 'sectionvalue', '../Exp/ISMIP160000.exp', 'layer', md.mesh.numberoflayers, ...
+#                   'resolution', [10 10], 'ylim', [0 400], 'xlim', [0 160000], 'title', '', 'xlabel', '', 'figure', 4)
+    if printingflag:
+        pass
+#           set(gcf, 'Color', 'w')
+#           printmodel(['ismipdHOvxsec' num2str(L)], 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#           shutil.move("ismipdHOvxsec%d.png" % L, ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestD')
 
 #Now plot the min and max values of vx for each size of the square
-#plot([5 10 20 40 80 160],minvx)ylim([2 18])xlim([0 160])
+#plot([5 10 20 40 80 160], minvx)ylim([2 18])xlim([0 160])
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('ismipdHOminvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#	shutil.move('ismipdHOminvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestD')
-#plot([5 10 20 40 80 160],maxvx)ylim([0 300])xlim([0 160])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('ismipdHOminvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#       shutil.move('ismipdHOminvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestD')
+#plot([5 10 20 40 80 160], maxvx)ylim([0 300])xlim([0 160])
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('ismipdHOmaxvx','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-#	shutil.move('ismipdHOmaxvx.png',ISSM_DIR+'/website/doc_pdf/validation/Images/ISMIP/TestD')
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('ismipdHOmaxvx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+#       shutil.move('ismipdHOmaxvx.png', ISSM_DIR + '/website/doc_pdf/validation/Images/ISMIP/TestD')
 
 #Fields and tolerances to track changes
-field_names     =['Vx80km','Vy80km','Vz80km']
-field_tolerances=[1e-08,1e-08,1e-07]
-field_values=[]
+field_names = ['Vx80km', 'Vy80km', 'Vz80km']
+field_tolerances = [1e-08, 1e-08, 1e-07]
+field_values = []
 for result in results:
-	field_values=field_values+[result.Vx,result.Vy,result.Vz]
+    field_values = field_values + [result.Vx, result.Vy, result.Vz]
Index: /issm/trunk/test/NightlyRun/test1108.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1108.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1108.py	(revision 24313)
@@ -13,81 +13,77 @@
 
 """
-This test is a test from the ISMP-HOM Intercomparison project.
+This test is a test from the ISMP - HOM Intercomparison project.
 Pattyn and Payne 2006
 """
 
-#L_list=[5000.,10000.,20000.,40000.,80000.,160000.]
-L_list=[80000.]
-results=[]
+#L_list = [5000., 10000., 20000., 40000., 80000., 160000.]
+L_list = [80000.]
+results = []
 
 for L in L_list:
-	nx=30    #numberof nodes in x direction
-	ny=30
-	md=model()
-	md=squaremesh(md,L,L,nx,ny)
-	md=setmask(md,'','')    #ice sheet test
-	md=parameterize(md,'../Par/ISMIPD.py')
-	md.extrude(10,1.)
+    nx = 30  #numberof nodes in x direction
+    ny = 30
+    md = model()
+    md = squaremesh(md, L, L, nx, ny)
+    md = setmask(md, '', '')  #ice sheet test
+    md = parameterize(md, '../Par/ISMIPD.py')
+    md.extrude(10, 1.)
 
-	md=setflowequation(md,'HO','all')
+    md = setflowequation(md, 'HO', 'all')
 
-	#We need one grd on dirichlet: the 4 corners are set to zero
-	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))
-	
-	maxx = max(md.mesh.x)
-	maxy = max(md.mesh.y)
-	posA = np.where(md.mesh.vertexonbase)
-	posB = np.unique(np.concatenate((np.where(md.mesh.x==0.), np.where(md.mesh.x==maxx))))
-	posC = np.unique(np.concatenate((np.where(md.mesh.y==0.), np.where(md.mesh.y==maxy))))
-	pos = np.intersect1d(np.intersect1d(posA,posB),posC)
+#We need one grd on dirichlet: the 4 corners are set to zero
+    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.
+    maxx = max(md.mesh.x)
+    maxy = max(md.mesh.y)
+    posA = np.where(md.mesh.vertexonbase)
+    posB = np.unique(np.concatenate((np.where(md.mesh.x == 0.), np.where(md.mesh.x == maxx))))
+    posC = np.unique(np.concatenate((np.where(md.mesh.y == 0.), np.where(md.mesh.y == maxy))))
+    pos = np.intersect1d(np.intersect1d(posA, posB), posC)
 
-	#Create MPCs to have periodic boundary conditions
-	posx=np.nonzero(md.mesh.x==0.)[0]
-	posx2=np.nonzero(md.mesh.x==np.max(md.mesh.x))[0]
+    md.stressbalance.spcvx[pos] = 0.
+    md.stressbalance.spcvy[pos] = 0.
+    md.stressbalance.spcvz[pos] = 0.
 
-	posy=np.intersect1d(np.intersect1d(np.where(md.mesh.y==0.),np.where(md.mesh.x!=0.)),np.where(md.mesh.x!=np.max(md.mesh.x)))[0]    #Don't take the same nodes two times
-	posy2=np.intersect1d(np.intersect1d(np.where(md.mesh.y==np.max(md.mesh.y)),np.where(md.mesh.x!=0.)),np.where(md.mesh.x!=np.max(md.mesh.x)))[0]
+#Create MPCs to have periodic boundary conditions
+    posx = np.nonzero(md.mesh.x == 0.)[0]
+    posx2 = np.nonzero(md.mesh.x == np.max(md.mesh.x))[0]
 
-	md.stressbalance.vertex_pairing=np.vstack((np.hstack((posx.reshape(-1,1)+1,posx2.reshape(-1,1)+1)),np.hstack((posy.reshape(-1,1)+1,posy2.reshape(-1,1)+1))))
+    posy = np.intersect1d(np.intersect1d(np.where(md.mesh.y == 0.), np.where(md.mesh.x != 0.)), np.where(md.mesh.x != np.max(md.mesh.x)))[0]  #Don't take the same nodes two times
+    posy2 = np.intersect1d(np.intersect1d(np.where(md.mesh.y == np.max(md.mesh.y)), np.where(md.mesh.x != 0.)), np.where(md.mesh.x != np.max(md.mesh.x)))[0]
 
-	#Compute the stressbalance
-	md.cluster=generic('name',gethostname(),'np',8)
-	md.verbose=verbose('convergence',True)
-	md=solve(md,'Stressbalance')
-	md.stressbalance.reltol=np.nan
-	md.stressbalance.abstol=np.nan
-	md.stressbalance.vertex_pairing=np.empty((0,2))
-	#We need one grid on dirichlet: the 4 corners are set to zero
-	md.stressbalance.spcvx=np.nan*np.ones((md.mesh.numberofvertices))
-	md.stressbalance.spcvy=np.nan*np.ones((md.mesh.numberofvertices))
-	md.stressbalance.spcvz=np.nan*np.ones((md.mesh.numberofvertices))
-	pos=np.nonzero(logical_or.reduce_n(md.mesh.y==0.,md.mesh.x==0.,md.mesh.x==np.max(md.mesh.x),md.mesh.y==np.max(md.mesh.y)))    #Don't take the same nodes two times
-	md.stressbalance.spcvx[pos]=md.results.StressbalanceSolution.Vx[pos]
-	md.stressbalance.spcvy[pos]=md.results.StressbalanceSolution.Vy[pos]
-	md=setflowequation(md,'FS','all')
-	md=solve(md,'Stressbalance')
+    md.stressbalance.vertex_pairing = np.vstack((np.hstack((posx.reshape(-1, 1) + 1, posx2.reshape(-1, 1) + 1)), np.hstack((posy.reshape(-1, 1) + 1, posy2.reshape(-1, 1) + 1))))
 
-	#Plot the results and save them
-	vx=md.results.StressbalanceSolution.Vx
-	vy=md.results.StressbalanceSolution.Vy
-	vz=md.results.StressbalanceSolution.Vz
-	results.append(md.results.StressbalanceSolution)
+#Compute the stressbalance
+    md.cluster = generic('name', gethostname(), 'np', 8)
+    md.verbose = verbose('convergence', True)
+    md = solve(md, 'Stressbalance')
+    md.stressbalance.reltol = np.nan
+    md.stressbalance.abstol = np.nan
+    md.stressbalance.vertex_pairing = np.empty((0, 2))
+#We need one grid on dirichlet: the 4 corners are set to zero
+    md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
+    md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
+    md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices))
+    pos = np.nonzero(np.logical_or.reduce((md.mesh.y == 0., md.mesh.x == 0., md.mesh.x == np.max(md.mesh.x), md.mesh.y == np.max(md.mesh.y))))  #Don't take the same nodes two times
+    md.stressbalance.spcvx[pos] = np.squeeze(md.results.StressbalanceSolution.Vx[pos])
+    md.stressbalance.spcvy[pos] = np.squeeze(md.results.StressbalanceSolution.Vy[pos])
+    md = setflowequation(md, 'FS', 'all')
+    md = solve(md, 'Stressbalance')
 
-#	plotmodel(md,'data',vx,'data',vy,'data',vz,'layer#all',md.mesh.numberoflayers)
+#Plot the results and save them
+    vx = md.results.StressbalanceSolution.Vx
+    vy = md.results.StressbalanceSolution.Vy
+    vz = md.results.StressbalanceSolution.Vz
+    results.append(md.results.StressbalanceSolution)
+
+#       plotmodel(md, 'data', vx, 'data', vy, 'data', vz, 'layer  #all', md.mesh.numberoflayers)
 
 #Fields and tolerances to track changes
-field_names     =['Vx80km','Vy80km','Vz80km']
-field_tolerances=[1e-08,1e-07,1e-07]
-field_values=[]
+field_names = ['Vx80km', 'Vy80km', 'Vz80km']
+field_tolerances = [1e-08, 1e-07, 1e-07]
+field_values = []
 for result in results:
-	field_values=field_values+[\
-		result.Vx,\
-		result.Vy,\
-		result.Vz,\
-		]
+    field_values = field_values + [result.Vx, result.Vy, result.Vz]
Index: /issm/trunk/test/NightlyRun/test1109.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1109.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1109.py	(revision 24313)
@@ -1,5 +1,4 @@
 #Test Name: ISMIPE
 import numpy as np
-import sys
 from model import *
 from socket import gethostname
@@ -11,76 +10,72 @@
 from squaremesh import *
 
-#This test is a test from the ISMP-HOM Intercomparison project.
-#TestE 
+#This test is a test from the ISMP - HOM Intercomparison project.
+#TestE
 #Four tests to run: - Pattyn frozen
-#                   - Stokes frozen
-#                   - Pattyn with some sliding
-#                   - Stokes with some sliding
+# - Stokes frozen
+# - Pattyn with some sliding
+# - Stokes with some sliding
 printingflag = False
 results = []
 
 for i in range(4):
-	Lx=10. #in m
-	Ly=5000. #in m
-	nx=3 #number of nodes in x direction
-	ny=51
-	md = model()
-	md = squaremesh(md,Lx,Ly,nx,ny)
-	md = setmask(md,'','') #ice sheet test
-	md = parameterize(md,'../Par/ISMIPE.py')
-	md = md.extrude(10,1.)
+    Lx = 10.  #in m
+    Ly = 5000.  #in m
+    nx = 3  #number of nodes in x direction
+    ny = 51
+    md = model()
+    md = squaremesh(md, Lx, Ly, nx, ny)
+    md = setmask(md, '', '')  #ice sheet test
+    md = parameterize(md, '../Par/ISMIPE.py')
+    md = md.extrude(10, 1.)
 
-	if i==0 or i==2:
-		md = setflowequation(md,'HO','all')
-	elif i==1 or i==3:
-		md = setflowequation(md,'FS','all')
+    if i == 0 or i == 2:
+        md = setflowequation(md, 'HO', 'all')
+    elif i == 1 or i == 3:
+        md = setflowequation(md, 'FS', 'all')
 
-	#Create MPCs to have periodic boundary conditions
-	posx = np.where(md.mesh.x == 0.)[0]
-	posx2 = np.where(md.mesh.x == max(md.mesh.x))[0]
-	md.stressbalance.vertex_pairing = np.column_stack((posx,posx2))
+#Create MPCs to have periodic boundary conditions
+    posx = np.where(md.mesh.x == 0.)[0]
+    posx2 = np.where(md.mesh.x == max(md.mesh.x))[0]
+    md.stressbalance.vertex_pairing = np.column_stack((posx, posx2))
 
-	#Create spcs on the bed 
-	pos = np.where(md.mesh.vertexonbase)[0]
-	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[pos] = 0.
-	md.stressbalance.spcvy[pos] = 0.
-	md.stressbalance.spcvz[pos] = 0.
+#Create spcs on the bed
+    pos = np.where(md.mesh.vertexonbase)[0]
+    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[pos] = 0.
+    md.stressbalance.spcvy[pos] = 0.
+    md.stressbalance.spcvz[pos] = 0.
 
-	#Remove the spc where there is some sliding (case 3 and 4):
-	if i==2 or i==3:
-		pos = np.intersect1d(np.where((md.mesh.y / max(md.mesh.y)) >= 0.44), np.where((md.mesh.y / max(md.mesh.y)) <= 0.5))[0]
-		md.stressbalance.spcvx[pos] = float('NaN')
-		md.stressbalance.spcvy[pos] = float('NaN')
-		md.stressbalance.spcvz[pos] = float('NaN')
+#Remove the spc where there is some sliding (case 3 and 4):
+    if i == 2 or i == 3:
+        pos = np.intersect1d(np.where((md.mesh.y / max(md.mesh.y)) >= 0.44), np.where((md.mesh.y / max(md.mesh.y)) <= 0.5))[0]
+        md.stressbalance.spcvx[pos] = float('NaN')
+        md.stressbalance.spcvy[pos] = float('NaN')
+        md.stressbalance.spcvz[pos] = float('NaN')
 
-	#Compute the stressbalance
-	md.cluster = generic('name',gethostname(),'np',8)
-	md = solve(md,'Stressbalance')
+#Compute the stressbalance
+    md.cluster = generic('name', gethostname(), 'np', 8)
+    md = solve(md, 'Stressbalance')
 
-	vx = md.results.StressbalanceSolution.Vx
-	vy = md.results.StressbalanceSolution.Vy
-	vz = md.results.StressbalanceSolution.Vz
-	results[i] = md.results.StressbalanceSolution
+    vx = md.results.StressbalanceSolution.Vx
+    vy = md.results.StressbalanceSolution.Vy
+    vz = md.results.StressbalanceSolution.Vz
+    results[i] = md.results.StressbalanceSolution
 
 
 #Fields and tolerances to track changes
-field_names = [
-	'VyPattynSliding','VzPattynSliding',
-	'VxStokesSliding','VyStokesSliding','VzStokesSliding',
-	'VyPattynFrozen','VzPattynFrozen',
-	'VxStokesFrozen','VyStokesFrozen','VzStokesFrozen'
-	]
-field_tolerances = [
-	1e-05,1e-05,
-	1e-05,1e-06,1e-06,
-	1e-05,1e-04,
-	1e-05,1e-05,1e-06
-	]
+field_names = ['VyPattynSliding', 'VzPattynSliding',
+               'VxStokesSliding', 'VyStokesSliding', 'VzStokesSliding',
+               'VyPattynFrozen', 'VzPattynFrozen',
+               'VxStokesFrozen', 'VyStokesFrozen', 'VzStokesFrozen']
+field_tolerances = [1e-05, 1e-05,
+                    1e-05, 1e-06, 1e-06,
+                    1e-05, 1e-04,
+                    1e-05, 1e-05, 1e-06]
 
 field_values = []
 for i in range(4):
-	result = results[i]
-	field_values += [result.Vx,result.Vy,result.Vz]
+    result = results[i]
+    field_values += [result.Vx, result.Vy, result.Vz]
Index: /issm/trunk/test/NightlyRun/test111.py
===================================================================
--- /issm/trunk/test/NightlyRun/test111.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test111.py	(revision 24313)
@@ -9,55 +9,51 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',200000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.transient.requested_outputs=['IceVolume']
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 200000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.requested_outputs = ['IceVolume']
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names=[\
-	'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface2','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1','Volume1', \
-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2','Volume2', \
-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3','Volume3']
-field_tolerances=[\
-	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,1e-13,\
-	1e-09,1e-08,1e-08,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,2e-11,\
-	1e-09,1e-08,1e-08,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,1e-11]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vz,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[0].IceVolume,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vz,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[1].IceVolume,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vz,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].Temperature,\
-	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[2].IceVolume,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface2', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1', 'Volume1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2', 'Volume2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Temperature3', 'BasalforcingsGroundediceMeltingRate3', 'Volume3']
+field_tolerances = [1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-05, 1e-13,
+                    1e-09, 1e-08, 1e-08, 1e-08, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-05, 2e-11,
+                    1e-09, 1e-08, 1e-08, 1e-08, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-05, 1e-11]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[0].IceVolume,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].IceVolume,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[2].IceVolume]
Index: /issm/trunk/test/NightlyRun/test1110.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1110.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1110.py	(revision 24313)
@@ -10,132 +10,145 @@
 from squaremesh import *
 
-#This test is a test from the ISMP-HOM Intercomparison project.
-#TestF 
+#This test is a test from the ISMP - HOM Intercomparison project.
+#TestF
 printingflag = False
 results = []
 
 for i in range(4):
-	L = 100000. #in m
-	nx = 30 #numberof nodes in x direction
-	ny = 30
-	md = model()
-	md = squaremesh(md,L,L,nx,ny)
-#	md = triangle(md,'../Exp/SquareISMIP.exp',5500.)
-	md = setmask(md,'','') #ice sheet test
-	md = parameterize(md,'../Par/ISMIPF.py')
-	md = md.extrude(4,1.)
+    L = 100000.  #in m
+    nx = 30  #numberof nodes in x direction
+    ny = 30
+    md = model()
+    md = squaremesh(md, L, L, nx, ny)
+    #   md = triangle(md, '../Exp/SquareISMIP.exp', 5500.)
+    md = setmask(md, '', '')  #ice sheet test
+    md = parameterize(md, '../Par/ISMIPF.py')
+    md = md.extrude(4, 1.)
 
-	if (i == 0 or i == 1):
-		md = setflowequation(md,'HO','all')
-	else:
-		md = setflowequation(md,'FS','all')
+    if (i == 0 or i == 1):
+        md = setflowequation(md, 'HO', 'all')
+    else:
+        md = setflowequation(md, 'FS', 'all')
 
-	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,))
-	if (i == 0 or i == 2):
-		#Create dirichlet on the bed if no slip
-		pos = np.where(md.mesh.vertexonbase)
-		md.stressbalance.spcvx[pos] = 0.
-		md.stressbalance.spcvy[pos] = 0.
-		md.stressbalance.spcvz[pos] = 0.
-	else:
-		posA = np.where(md.mesh.vertexonbase)
-		posB = np.unique(np.concatenate(np.where(md.mesh.x == 0.),np.where(md.mesh.x == max(md.mesh.x))))
-		posC = np.unique(np.concatenate(np.where(md.mesh.y == 0.),np.where(md.mesh.y == max(md.mesh.y))))
-		pos = np.intersect1d(np.intersect1d(posA,posB),posC)
-		md.stressbalance.spcvx[pos] = 100. #because we need a dirichlet somewhere
-		md.stressbalance.spcvy[pos] = 0.
-		md.stressbalance.spcvz[pos] = 0.
-	
-	pos = np.where(np.logical_not(md.mesh.vertexonbase))
-	md.thermal.spctemperature[pos] = 255.
+    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, ))
+    if (i == 0 or i == 2):
+        #Create dirichlet on the bed if no slip
+        pos = np.where(md.mesh.vertexonbase)
+        md.stressbalance.spcvx[pos] = 0.
+        md.stressbalance.spcvy[pos] = 0.
+        md.stressbalance.spcvz[pos] = 0.
+    else:
+        posA = np.where(md.mesh.vertexonbase)
+        posB = np.unique(np.concatenate(np.where(md.mesh.x == 0.), np.where(md.mesh.x == max(md.mesh.x))))
+        posC = np.unique(np.concatenate(np.where(md.mesh.y == 0.), np.where(md.mesh.y == max(md.mesh.y))))
+        pos = np.intersect1d(np.intersect1d(posA, posB), posC)
+        md.stressbalance.spcvx[pos] = 100.  #because we need a dirichlet somewhere
+        md.stressbalance.spcvy[pos] = 0.
+        md.stressbalance.spcvz[pos] = 0.
 
-	#Create MPCs to have periodic boundary conditions
-	posx = np.where(md.mesh.x == 0.)
-	posx2 = np.where(md.mesh.x == max(md.mesh.x))
+    pos = np.where(np.logical_not(md.mesh.vertexonbase))
+    md.thermal.spctemperature[pos] = 255.
 
-	posy = np.where(md.mesh.y == 0.)
-	posy2 = np.where(md.mesh.y == max(md.mesh.y))
+    #Create MPCs to have periodic boundary conditions
+    posx = np.where(md.mesh.x == 0.)
+    posx2 = np.where(md.mesh.x == max(md.mesh.x))
 
-	md.stressbalance.vertex_pairing = np.column_stack((posx,posx2,posy,posy2))
-	md.masstransport.vertex_pairing = np.column_stack((posx,posx2,posy,posy2))
+    posy = np.where(md.mesh.y == 0.)
+    posy2 = np.where(md.mesh.y == max(md.mesh.y))
 
-	md.timestepping.time_step = 3.
-	md.timestepping.final_time = 300.
-	md.settings.output_frequency = 50
-	md.masstransport.stabilization = 1
-	md.stressbalance.maxiter = 1
-	
-	#Compute the stressbalance
-	md.cluster = generic('name',gethostname(),'np',8)
-	md.verbose = verbose('convergence',True,'solution',True)
-	md = solve(md,'Transient')
+    md.stressbalance.vertex_pairing = np.column_stack((posx, posx2, posy, posy2))
+    md.masstransport.vertex_pairing = np.column_stack((posx, posx2, posy, posy2))
 
-	#save the results
-	results[i] = md.results.TransientSolution()
-	
-	#Now plot vx and delta surface 
-	if (i == 0 or i == 2):
-		plotmodel(md,'data',(md.results.TransientSolution().Vx),'layer',md.mesh.numberoflayers,'sectionvalue','../Exp/ISMIP100000.exp','title','','xlabel','','ylabel','Velocity (m/yr)','linewidth',3,'grid','on','unit','km','ylim',[91,100])
-	elif (i == 1 or i == 3):
-		plotmodel(md,'data',(md.results.TransientSolution().Vx),'layer',md.mesh.numberoflayers,'sectionvalue','../Exp/ISMIP100000.exp','title','','xlabel','','ylabel','Velocity (m/yr)','linewidth',3,'grid','on','unit','km','ylim',[185,200])
-	
-	if printingflag:
-		#set(gcf,'Color','w')
-		if i == 0:
-			printmodel('ismipfHOvxfrozen','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-			#system(['mv ismipfHOvxfrozen.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
-		elif i == 1:
-			printmodel('ismipfHOvxsliding','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-			#system(['mv ismipfHOvxsliding.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
-		elif i == 2:
-			printmodel('ismipfFSvxfrozen','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-			#system(['mv ismipfFSvxfrozen.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
-		elif i == 3:
-			printmodel('ismipfFSvxsliding','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-			#system(['mv ismipfFSvxsliding.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
-		
-	
+    md.timestepping.time_step = 3.
+    md.timestepping.final_time = 300.
+    md.settings.output_frequency = 50
+    md.masstransport.stabilization = 1
+    md.stressbalance.maxiter = 1
 
-	plotmodel(md,'data',(md.results.TransientSolution().Surface)-md.geometry.surface,'layer',md.mesh.numberoflayers,'sectionvalue','../Exp/ISMIP100000.exp','title','','xlabel','','ylabel','Surface (m)','linewidth',3,'grid','on','unit','km','ylim',[-30,50])
-	if printingflag:
-		#set(gcf,'Color','w')
-		if i == 0:
-			printmodel('ismipfHOdeltasurfacefrozen','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-			#system(['mv ismipfHOdeltasurfacefrozen.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
-		elif i == 1:
-			printmodel('ismipfHOdeltasurfacesliding','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-			#system(['mv ismipfHOdeltasurfacesliding.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
-		elif i == 2:
-			printmodel('ismipfFSdeltasurfacefrozen','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-			#system(['mv ismipfFSdeltasurfacefrozen.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
-		elif i == 3:
-			printmodel('ismipfFSdeltasurfacesliding','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off')
-			#system(['mv ismipfFSdeltasurfacesliding.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
-		
-	
+    #Compute the stressbalance
+    md.cluster = generic('name', gethostname(), 'np', 8)
+    md.verbose = verbose('convergence', True, 'solution', True)
+    md = solve(md, 'Transient')
 
+    #save the results
+    results[i] = md.results.TransientSolution()
+
+    #Now plot vx and delta surface
+    if (i == 0 or i == 2):
+        plotmodel(md, 'data', (md.results.TransientSolution().Vx),
+                  'layer', md.mesh.numberoflayers,
+                  'sectionvalue', '../Exp/ISMIP100000.exp',
+                  'title', '',
+                  'xlabel', '',
+                  'ylabel', 'Velocity (m / yr)',
+                  'linewidth', 3,
+                  'grid', 'on',
+                  'unit', 'km',
+                  'ylim', [91, 100])
+    elif (i == 1 or i == 3):
+        plotmodel(md, 'data', (md.results.TransientSolution().Vx),
+                  'layer', md.mesh.numberoflayers,
+                  'sectionvalue', '../Exp/ISMIP100000.exp',
+                  'title', '',
+                  'xlabel', '',
+                  'ylabel', 'Velocity (m / yr)',
+                  'linewidth', 3,
+                  'grid', 'on',
+                  'unit', 'km',
+                  'ylim', [185, 200])
+
+    if printingflag:
+        #set(gcf, 'Color', 'w')
+        if i == 0:
+            printmodel('ismipfHOvxfrozen', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+            #system(['mv ismipfHOvxfrozen.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
+        elif i == 1:
+            printmodel('ismipfHOvxsliding', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+            #system(['mv ismipfHOvxsliding.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
+        elif i == 2:
+            printmodel('ismipfFSvxfrozen', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+            #system(['mv ismipfFSvxfrozen.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
+        elif i == 3:
+            printmodel('ismipfFSvxsliding', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+            #system(['mv ismipfFSvxsliding.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
+
+    plotmodel(md, 'data', (md.results.TransientSolution().Surface) - md.geometry.surface,
+              'layer', md.mesh.numberoflayers,
+              'sectionvalue', '../Exp/ISMIP100000.exp',
+              'title', '',
+              'xlabel', '',
+              'ylabel', 'Surface (m)',
+              'linewidth', 3,
+              'grid', 'on',
+              'unit', 'km',
+              'ylim', [- 30, 50])
+    if printingflag:
+        #set(gcf, 'Color', 'w')
+        if i == 0:
+            printmodel('ismipfHOdeltasurfacefrozen', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+            #system(['mv ismipfHOdeltasurfacefrozen.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
+        elif i == 1:
+            printmodel('ismipfHOdeltasurfacesliding', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+            #system(['mv ismipfHOdeltasurfacesliding.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
+        elif i == 2:
+            printmodel('ismipfFSdeltasurfacefrozen', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+            #system(['mv ismipfFSdeltasurfacefrozen.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
+        elif i == 3:
+            printmodel('ismipfFSdeltasurfacesliding', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 1.5, 'hardcopy', 'off')
+            #system(['mv ismipfFSdeltasurfacesliding.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestF'])
 
 #Fields and tolerances to track changes
-field_names = [
-	'VxPattynFrozen','VyPattynFrozen','VzPattynFrozen','SurfacePattynFrozen',
-	'VxPattynSliding','VyPattynSliding','VzPattynSliding','SurfacePattynSliding',
-	'VxStokesFrozen','VyStokesFrozen','VzStokesFrozen','SurfaceStokesFrozen',
-	'VxStokesSliding','VyStokesSliding','VzStokesSliding','SurfaceStokesSliding'
-]
-field_tolerances = [
-	1e-10,1e-09,1e-09,1e-10,
-	1e-10,1e-09,1e-09,1e-10,
-	1e-08,1e-09,1e-08,1e-09,
-	1e-08,2e-09,1e-08,1e-09
-]
+field_names = ['VxPattynFrozen', 'VyPattynFrozen', 'VzPattynFrozen', 'SurfacePattynFrozen',
+               'VxPattynSliding', 'VyPattynSliding', 'VzPattynSliding', 'SurfacePattynSliding',
+               'VxStokesFrozen', 'VyStokesFrozen', 'VzStokesFrozen', 'SurfaceStokesFrozen',
+               'VxStokesSliding', 'VyStokesSliding', 'VzStokesSliding', 'SurfaceStokesSliding']
+field_tolerances = [1e-10, 1e-09, 1e-09, 1e-10,
+                    1e-10, 1e-09, 1e-09, 1e-10,
+                    1e-08, 1e-09, 1e-08, 1e-09,
+                    1e-08, 2e-09, 1e-08, 1e-09]
 field_values = []
 for i in range(4):
-	result = results[i]
-	field_values += ([
-		result.Vx,
-		result.Vy,
-		result.Vz,
-		result.Surface] - md.geometry.surface)
-
+    result = results[i]
+    field_values += ([result.Vx, result.Vy, result.Vz, result.Surface] - md.geometry.surface)
Index: /issm/trunk/test/NightlyRun/test112.py
===================================================================
--- /issm/trunk/test/NightlyRun/test112.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test112.py	(revision 24313)
@@ -9,16 +9,14 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'SurfaceSlope')
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'SurfaceSlope')
 
 #Fields and tolerances to track changes
-field_names     =['SurfaceSlopeX','SurfaceSlopeY']
-field_tolerances=[1e-13,1e-13]
-field_values=[\
-	md.results.SurfaceSlopeSolution.SurfaceSlopeX,\
-	md.results.SurfaceSlopeSolution.SurfaceSlopeY,\
-	]
+field_names = ['SurfaceSlopeX', 'SurfaceSlopeY']
+field_tolerances = [1e-13, 1e-13]
+field_values = [md.results.SurfaceSlopeSolution.SurfaceSlopeX,
+                md.results.SurfaceSlopeSolution.SurfaceSlopeY]
Index: /issm/trunk/test/NightlyRun/test113.py
===================================================================
--- /issm/trunk/test/NightlyRun/test113.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test113.py	(revision 24313)
@@ -9,17 +9,15 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(5,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'SurfaceSlope')
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(5, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'SurfaceSlope')
 
 #Fields and tolerances to track changes
-field_names     =['SurfaceSlopeX','SurfaceSlopeY']
-field_tolerances=[1e-13,1e-13]
-field_values=[\
-	md.results.SurfaceSlopeSolution.SurfaceSlopeX,\
-	md.results.SurfaceSlopeSolution.SurfaceSlopeY,\
-	]
+field_names = ['SurfaceSlopeX', 'SurfaceSlopeY']
+field_tolerances = [1e-13, 1e-13]
+field_values = [md.results.SurfaceSlopeSolution.SurfaceSlopeX,
+                md.results.SurfaceSlopeSolution.SurfaceSlopeY]
Index: /issm/trunk/test/NightlyRun/test114.py
===================================================================
--- /issm/trunk/test/NightlyRun/test114.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test114.py	(revision 24313)
@@ -9,16 +9,14 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'BedSlope')
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'BedSlope')
 
 #Fields and tolerances to track changes
-field_names     =['BedSlopeX','BedSlopeY']
-field_tolerances=[1e-13,1e-13]
-field_values=[\
-	md.results.BedSlopeSolution.BedSlopeX,\
-	md.results.BedSlopeSolution.BedSlopeY,\
-	]
+field_names = ['BedSlopeX', 'BedSlopeY']
+field_tolerances = [1e-13, 1e-13]
+field_values = [md.results.BedSlopeSolution.BedSlopeX,
+                md.results.BedSlopeSolution.BedSlopeY]
Index: /issm/trunk/test/NightlyRun/test115.py
===================================================================
--- /issm/trunk/test/NightlyRun/test115.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test115.py	(revision 24313)
@@ -9,17 +9,15 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(5,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'BedSlope')
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(5, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'BedSlope')
 
 #Fields and tolerances to track changes
-field_names     =['BedSlopeX','BedSlopeY']
-field_tolerances=[1e-13,1e-13]
-field_values=[\
-	md.results.BedSlopeSolution.BedSlopeX,\
-	md.results.BedSlopeSolution.BedSlopeY,\
-	]
+field_names = ['BedSlopeX', 'BedSlopeY']
+field_tolerances = [1e-13, 1e-13]
+field_values = [md.results.BedSlopeSolution.BedSlopeX,
+                md.results.BedSlopeSolution.BedSlopeY]
Index: /issm/trunk/test/NightlyRun/test116.py
===================================================================
--- /issm/trunk/test/NightlyRun/test116.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test116.py	(revision 24313)
@@ -10,18 +10,16 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
 #Add boundary conditions on thickness on the border
-pos=np.nonzero(md.mesh.vertexonboundary)
-md.balancethickness.spcthickness[pos]=md.geometry.thickness[pos]
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Balancethickness')
+pos = np.nonzero(md.mesh.vertexonboundary)
+md.balancethickness.spcthickness[pos] = md.geometry.thickness[pos]
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Balancethickness')
 
 #Fields and tolerances to track changes
-field_names     =['Thickness']
-field_tolerances=[1e-13]
-field_values=[\
-	md.results.BalancethicknessSolution.Thickness,\
-	]
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.BalancethicknessSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test119.m
===================================================================
--- /issm/trunk/test/NightlyRun/test119.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test119.m	(revision 24313)
@@ -24,5 +24,5 @@
 %Fields and tolerances to track changes
 field_names     ={'x1','y1','x2','y2','nbelements','elapsed time'};
-field_tolerances={2e-9,2e-9,1e-13,1e-13,1e-13,4.};
+field_tolerances={2e-9,2e-9,1e-13,1e-13,1e-13,6.0};
 field_values={...
 	x1, y1,...
Index: /issm/trunk/test/NightlyRun/test119.py
===================================================================
--- /issm/trunk/test/NightlyRun/test119.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test119.py	(revision 24313)
@@ -3,34 +3,30 @@
 import time
 from model import *
-from socket import gethostname
 from bamg import *
 
 
 #Simple mesh
-md=bamg(model(),'domain','../Exp/Square.exp','hmax',100000.)
-x1=md.mesh.x
-y1=md.mesh.y
+md = bamg(model(), 'domain', '../Exp/Square.exp', 'hmax', 100000.)
+x1 = md.mesh.x
+y1 = md.mesh.y
 
 #hVertices
-md=bamg(model(),'domain','../Exp/Square.exp','hmax',300000.,'hVertices',np.array([10000.,100000.,400000.,100000.]).reshape(-1,1))
-x2=md.mesh.x
-y2=md.mesh.y
+md = bamg(model(), 'domain', '../Exp/Square.exp', 'hmax', 300000., 'hVertices', np.array([10000., 100000., 400000., 100000.]).reshape(-1, 1))
+x2 = md.mesh.x
+y2 = md.mesh.y
 
 #big mesh
-t0=time.time()
-md=bamg(model(),'domain','../Exp/Square.exp','hmax',3000.)
-nbelements=md.mesh.numberofelements
-elapsedtime=time.time()-t0
-if nbelements>267895-50 and nbelements<267895+50:
-	nbewithinrange = 1.
+t0 = time.time()
+md = bamg(model(), 'domain', '../Exp/Square.exp', 'hmax', 3000.)
+nbelements = md.mesh.numberofelements
+elapsedtime = time.time() - t0
+if nbelements > 267895 - 50 and nbelements < 267895 + 50:
+    nbewithinrange = 1.
 else:
-	nbewithinrange = 0.
+    nbewithinrange = 0.
 
 #Fields and tolerances to track changes
-field_names     =['x1','y1','x2','y2','nbelements','elapsed time']
-field_tolerances=[2e-9,2e-9,1e-13,1e-13,1e-13,4.0]
-field_values=[\
-	x1, y1,\
-	x2, y2,\
-	nbewithinrange,elapsedtime,\
-	]
+field_names = ['x1', 'y1', 'x2', 'y2', 'nbelements', 'elapsed time']
+# NOTE: Elapsed time tolerance has been increased to 7.0 for this test, but not the MATLBAB one
+field_tolerances = [2e-9, 2e-9, 1e-13, 1e-13, 1e-13, 7.0]
+field_values = [x1, y1, x2, y2, nbewithinrange, elapsedtime]
Index: /issm/trunk/test/NightlyRun/test120.py
===================================================================
--- /issm/trunk/test/NightlyRun/test120.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test120.py	(revision 24313)
@@ -10,22 +10,22 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.timestepping.time_step=0
-md.initialization.waterfraction=np.zeros(md.mesh.numberofvertices)
-md.initialization.watercolumn=np.zeros(md.mesh.numberofvertices)
+md = triangle(model(), '../Exp/Square.exp', 180000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.timestepping.time_step = 0
+md.initialization.waterfraction = np.zeros(md.mesh.numberofvertices)
+md.initialization.watercolumn = np.zeros(md.mesh.numberofvertices)
 md.thermal.isenthalpy = 1
 md.thermal.isdynamicbasalspc = 1
 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Thermal')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Thermal')
 
 #Fields and tolerances to track changes
-field_names     =['Enthalpy','Waterfraction','Temperature']
-field_tolerances=[1e-13,2e-10,1e-13]
-field_values=[md.results.ThermalSolution.Enthalpy,
-							md.results.ThermalSolution.Waterfraction,
-							md.results.ThermalSolution.Temperature]
+field_names = ['Enthalpy', 'Waterfraction', 'Temperature']
+field_tolerances = [1e-13, 2e-10, 1e-13]
+field_values = [md.results.ThermalSolution.Enthalpy,
+                md.results.ThermalSolution.Waterfraction,
+                md.results.ThermalSolution.Temperature]
Index: /issm/trunk/test/NightlyRun/test1201.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1201.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1201.py	(revision 24313)
@@ -14,57 +14,57 @@
 """
 
-printingflag=False
-results=[]
+printingflag = False
+results = []
 
-for stabilization in xrange(1,4):
-	#The goal is to test the masstransport model
-	md=bamg(model(),'domain','../Exp/SquareEISMINT.exp','hmax',3000.)
-	md=setmask(md,'all','')
-	md=parameterize(md,'../Par/SquareEISMINT.py')
-	md.smb.mass_balance[:]=0.
-	md=setflowequation(md,'SSA','all')
-	md.cluster=generic('name',gethostname(),'np',8)
+for stabilization in range(1, 4):
+    #The goal is to test the masstransport model
+    md = bamg(model(), 'domain', '../Exp/SquareEISMINT.exp', 'hmax', 3000.)
+    md = setmask(md, 'all', '')
+    md = parameterize(md, '../Par/SquareEISMINT.py')
+    md.smb.mass_balance[:] = 0.
+    md = setflowequation(md, 'SSA', 'all')
+    md.cluster = generic('name', gethostname(), 'np', 8)
 
-	print "      initial velocity"
-	md.initialization.vx=np.zeros((md.mesh.numberofvertices))
-	md.initialization.vy=-400.*np.ones((md.mesh.numberofvertices))
+    print("      initial velocity")
+    md.initialization.vx = np.zeros((md.mesh.numberofvertices))
+    md.initialization.vy = -400. * np.ones((md.mesh.numberofvertices))
 
-	#Stabilization
-	if stabilization==2:
-		md.masstransport.stabilization=0
-	else:
-		md.masstransport.stabilization=stabilization
+#Stabilization
+    if stabilization == 2:
+        md.masstransport.stabilization = 0
+    else:
+        md.masstransport.stabilization = stabilization
 
-	#spc thickness
-	pos=np.where(md.mesh.y>199999.9)[0]
-	times=np.arange(0,501)
-	md.masstransport.spcthickness=np.nan*np.ones((md.mesh.numberofvertices+1,np.size(times)))
-	md.masstransport.spcthickness[-1,:]=times
-	md.masstransport.spcthickness[pos,:]=500.+100.*np.sin(2.*np.pi*times/200.)
-	if stabilization==3:
-		pos=np.nonzero(np.isnan(md.masstransport.spcthickness))
-		md.masstransport.spcthickness[pos]=500.    #No NaN for DG
+#spc thickness
+    pos = np.where(md.mesh.y > 199999.9)[0]
+    times = np.arange(0, 501)
+    md.masstransport.spcthickness = np.nan * np.ones((md.mesh.numberofvertices + 1, np.size(times)))
+    md.masstransport.spcthickness[-1, :] = times
+    md.masstransport.spcthickness[pos, :] = 500. + 100. * np.sin(2. * np.pi * times / 200.)
+    if stabilization == 3:
+        pos = np.nonzero(np.isnan(md.masstransport.spcthickness))
+        md.masstransport.spcthickness[pos] = 500.  #No NaN for DG
 
-	#solve
-	md.transient.isstressbalance=False
-	md.settings.output_frequency=500    #keep only last step
-	md.verbose=verbose()
-	md=solve(md,'Transient')
-	results.append(md.results.TransientSolution[-1].Thickness)
+#solve
+    md.transient.isstressbalance = False
+    md.settings.output_frequency = 500  #keep only last step
+    md.verbose = verbose()
+    md = solve(md, 'Transient')
+    results.append(md.results.TransientSolution[-1].Thickness)
 
 #plot results
-#[elements,x,y,z,s,h1]=SectionValues(md,results[0],'../Exp/CrossLineEISMINT.exp',100.)
-#[elements,x,y,z,s,h2]=SectionValues(md,results[1],'../Exp/CrossLineEISMINT.exp',100.)
-#[elements,x,y,z,s,h3]=SectionValues(md,results[2],'../Exp/CrossLineEISMINT.exp',100.)
-#[elements,x,y,z,s,hth]=SectionValues(md, 500+100*sin(2*pi/200*(500-md.mesh.y/400)),'../Exp/CrossLineEISMINT.exp',100.)
-#plot(s,h1,'r',s,h2,'b',s,h3,'g',s,hth,'k')
-#legend('Art. diff.','No Art. diff.','D.G.','Theoretical')
+#[elements, x, y, z, s, h1] = SectionValues(md, results[0], '../Exp/CrossLineEISMINT.exp', 100.)
+#[elements, x, y, z, s, h2] = SectionValues(md, results[1], '../Exp/CrossLineEISMINT.exp', 100.)
+#[elements, x, y, z, s, h3] = SectionValues(md, results[2], '../Exp/CrossLineEISMINT.exp', 100.)
+#[elements, x, y, z, s, hth] = SectionValues(md, 500 + 100 * sin(2 * pi / 200 * (500 - md.mesh.y / 400)), '../Exp/CrossLineEISMINT.exp', 100.)
+#plot(s, h1, 'r', s, h2, 'b', s, h3, 'g', s, hth, 'k')
+#legend('Art. diff.', 'No Art. diff.', 'D.G.', 'Theoretical')
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	export_fig([issmdir() '/website/doc_pdf/validation/Images/EISMINT/IceShelf/eismintmasscthickness.pdf'])
+    pass
+#       set(gcf, 'Color', 'w')
+#       export_fig([issmdir() '/website/doc_pdf/validation/Images/EISMINT/IceShelf/eismintmasscthickness.pdf'])
 
 #Fields and tolerances to track changes
-field_names     =['ThicknessArtDiff','ThicknessNoArtDiff','ThicknessDG']
-field_tolerances=[1e-13, 1e-13, 1e-13]
-field_values=[results[0],results[1],results[2]]
+field_names = ['ThicknessArtDiff', 'ThicknessNoArtDiff', 'ThicknessDG']
+field_tolerances = [1e-13, 1e-13, 1e-13]
+field_values = [results[0], results[1], results[2]]
Index: /issm/trunk/test/NightlyRun/test1202.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1202.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1202.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: EISMINTStress1
-import numpy as np
 from model import *
 from socket import gethostname
@@ -14,39 +13,39 @@
 """
 
-printingflag=False
+printingflag = False
 
 #tests 3 and 4: using Glen's flow law
-md=model()
-md=triangle(md,'../Exp/SquareEISMINT.exp',3550.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareEISMINT.py')
-md=setflowequation(md,'SSA','all')    #SSA's model and 2d
+md = model()
+md = triangle(md, '../Exp/SquareEISMINT.exp', 3550.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareEISMINT.py')
+md = setflowequation(md, 'SSA', 'all')  #SSA's model and 2d
 
-#Compute solution for SSA's model 
-md.cluster=generic('name',gethostname(),'np',8)
-md=solve(md,'Stressbalance')
+#Compute solution for SSA's model
+md.cluster = generic('name', gethostname(), 'np', 8)
+md = solve(md, 'Stressbalance')
 
 #plot results
-vx=md.results.StressbalanceSolution.Vx
-vy=md.results.StressbalanceSolution.Vy
+vx = md.results.StressbalanceSolution.Vx
+vy = md.results.StressbalanceSolution.Vy
 
-#plotmodel(md,'data',vx,'contourlevels',{0,20,40,60,60,100,120,140,160,180,-20,-40,-60,-80,-100,-120,-140,-160,-180}, ...
-#	'contourcolor','k')
+#plotmodel(md, 'data', vx, 'contourlevels', {0, 20, 40, 60, 60, 100, 120, 140, 160, 180, -20, -40, -60, -80, -100, -120, -140, -160, -180}, ...
+#       'contourcolor', 'k')
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('eismintdiag1vx','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off')
-#	system(['mv eismintdiag1vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('eismintdiag1vx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 2, 'hardcopy', 'off')
+#       system(['mv eismintdiag1vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
 
-#plotmodel(md,'data',vy,'contourlevels',{-100,-200,-300,-400,-500,-600,-700,-800,-900,-1000},...
-#	'contourcolor','k')
+#plotmodel(md, 'data', vy, 'contourlevels', { -100, -200, -300, -400, -500, -600, -700, -800, -900, -1000}, ...
+#       'contourcolor', 'k')
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('eismintdiag1vy','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off')
-#	system(['mv eismintdiag1vy.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('eismintdiag1vy', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 2, 'hardcopy', 'off')
+#       system(['mv eismintdiag1vy.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy']
-field_tolerances=[1e-13,1e-13]
-field_values=[vx,vy]
+field_names = ['Vx', 'Vy']
+field_tolerances = [1e-13, 1e-13]
+field_values = [vx, vy]
Index: /issm/trunk/test/NightlyRun/test1203.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1203.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1203.py	(revision 24313)
@@ -15,44 +15,44 @@
 """
 
-printingflag=False
+printingflag = False
 
-#test 5 and 6: 
-md=model()
-md=triangle(md,'../Exp/SquareEISMINT.exp',5100.)    #test3
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareEISMINT.py')
-md=setflowequation(md,'SSA','all')    #SSA's model and 2d
+#test 5 and 6:
+md = model()
+md = triangle(md, '../Exp/SquareEISMINT.exp', 5100.)  #test3
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareEISMINT.py')
+md = setflowequation(md, 'SSA', 'all')  #SSA's model and 2d
 
-#Impose a non zero velocity on the upper boundary condition (y=max(y))
-pos=np.where(md.mesh.y==np.max(md.mesh.y))
-heavyside=np.where(np.logical_and(md.mesh.y==np.max(md.mesh.y),((1.+sys.float_info.epsilon)*np.ones((np.size(md.mesh.y)))-((md.mesh.x-100000.)/25000.)**2)>0))
-md.stressbalance.spcvy[pos]=np.zeros((np.size(pos)))
-md.stressbalance.spcvy[heavyside]=400.*(((md.mesh.x[heavyside]-100000.)/25000.)**2-np.ones((np.size(heavyside))))
+#Impose a non zero velocity on the upper boundary condition (y = max(y))
+pos = np.where(md.mesh.y == np.max(md.mesh.y))
+heavyside = np.where(np.logical_and(md.mesh.y == np.max(md.mesh.y), ((1. + sys.float_info.epsilon) * np.ones((np.size(md.mesh.y))) - ((md.mesh.x - 100000.) / 25000.)**2) > 0))
+md.stressbalance.spcvy[pos] = np.zeros((np.size(pos)))
+md.stressbalance.spcvy[heavyside] = 400. * (((md.mesh.x[heavyside] - 100000.) / 25000.)**2 - np.ones((np.size(heavyside))))
 
-#Compute solution for SSA's model 
-md.cluster=generic('name',gethostname(),'np',8)
-md=solve(md,'Stressbalance')
+#Compute solution for SSA's model
+md.cluster = generic('name', gethostname(), 'np', 8)
+md = solve(md, 'Stressbalance')
 
-vx=md.results.StressbalanceSolution.Vx
-vy=md.results.StressbalanceSolution.Vy
+vx = md.results.StressbalanceSolution.Vx
+vy = md.results.StressbalanceSolution.Vy
 
 #plot results
-#plotmodel(md,'data',vx,'contourlevels',{0,20,40,60,80,100,-20,-40,-60,-80,-100},...
-#	'contourcolor','k')
+#plotmodel(md, 'data', vx, 'contourlevels', {0, 20, 40, 60, 80, 100, -20, -40, -60, -80, -100}, ...
+#       'contourcolor', 'k')
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('eismintdiag2vx','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off')
-#	system(['mv eismintdiag2vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
-#plotmodel(md,'data',vy,'contourlevels',{-100,-200,-300,-400,-500,-600,-700,-800,-900,-1000},...
-#	'contourcolor','k')
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('eismintdiag2vx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 2, 'hardcopy', 'off')
+#       system(['mv eismintdiag2vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
+#plotmodel(md, 'data', vy, 'contourlevels', { -100, -200, -300, -400, -500, -600, -700, -800, -900, -1000}, ...
+#       'contourcolor', 'k')
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('eismintdiag2vy','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off')
-#	system(['mv eismintdiag2vy.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('eismintdiag2vy', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 2, 'hardcopy', 'off')
+#       system(['mv eismintdiag2vy.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy']
-field_tolerances=[1e-13,1e-13]
-field_values=[vx,vy]
+field_names = ['Vx', 'Vy']
+field_tolerances = [1e-13, 1e-13]
+field_values = [vx, vy]
Index: /issm/trunk/test/NightlyRun/test1204.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1204.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1204.py	(revision 24313)
@@ -15,57 +15,57 @@
 """
 
-printingflag=False
+printingflag = False
 
 #tests 3 and 4: using Glen's flow law
-md=model()
-md=triangle(md,'../Exp/SquareEISMINT.exp',3550.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareEISMINT.py')
-md=setflowequation(md,'SSA','all')    #SSA's model and 2d
+md = model()
+md = triangle(md, '../Exp/SquareEISMINT.exp', 3550.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareEISMINT.py')
+md = setflowequation(md, 'SSA', 'all')  #SSA's model and 2d
 
-#Impose a non zero velocity on the upper boundary condition (y=max(y))
-pos=np.where(md.mesh.y==np.max(md.mesh.y))
-heavyside=np.where(np.logical_and(md.mesh.y==np.max(md.mesh.y),((1.+sys.float_info.epsilon)*np.ones((np.size(md.mesh.y)))-((md.mesh.x-100000.)/25000.)**2)>0))
-md.stressbalance.spcvy[pos]=np.zeros((np.size(pos)))
-md.stressbalance.spcvy[heavyside]=400.*(((md.mesh.x[heavyside]-100000.)/25000.)**2-np.ones((np.size(heavyside))))
+#Impose a non zero velocity on the upper boundary condition (y = max(y))
+pos = np.where(md.mesh.y == np.max(md.mesh.y))
+heavyside = np.where(np.logical_and(md.mesh.y == np.max(md.mesh.y), ((1. + sys.float_info.epsilon) * np.ones((np.size(md.mesh.y))) - ((md.mesh.x - 100000.) / 25000.)**2) > 0))
+md.stressbalance.spcvy[pos] = np.zeros((np.size(pos)))
+md.stressbalance.spcvy[heavyside] = 400. * (((md.mesh.x[heavyside] - 100000.) / 25000.)**2 - np.ones((np.size(heavyside))))
 
-#Compute solution for SSA's model 
-md.cluster=generic('name',gethostname(),'np',8)
-md=solve(md,'Stressbalance')
+#Compute solution for SSA's model
+md.cluster = generic('name', gethostname(), 'np', 8)
+md = solve(md, 'Stressbalance')
 
 #plot results
-md.initialization.vx=md.results.StressbalanceSolution.Vx
-md.initialization.vy=md.results.StressbalanceSolution.Vy
+md.initialization.vx = md.results.StressbalanceSolution.Vx
+md.initialization.vy = md.results.StressbalanceSolution.Vy
 
-md.timestepping.time_step=1.
-md.timestepping.final_time=5000.
-md.masstransport.stabilization=1
-md=solve(md,'Transient')
+md.timestepping.time_step = 1.
+md.timestepping.final_time = 5000.
+md.masstransport.stabilization = 1
+md = solve(md, 'Transient')
 
-#plotmodel(md,'data',(md.results.TransientSolution(end).Vx))
+#plotmodel(md, 'data', (md.results.TransientSolution(end).Vx))
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('eisminttrans2vx','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off')
-#	system(['mv eisminttrans2vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('eisminttrans2vx', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 2, 'hardcopy', 'off')
+#       system(['mv eisminttrans2vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
 
-#plotmodel(md,'data',(md.results.TransientSolution(end).Vy))
+#plotmodel(md, 'data', (md.results.TransientSolution(end).Vy))
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('eisminttrans2vy','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off')
-#	system(['mv eisminttrans2vy.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('eisminttrans2vy', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 2, 'hardcopy', 'off')
+#       system(['mv eisminttrans2vy.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
 
-#plotmodel(md,'data',(md.results.TransientSolution(end).Thickness))
+#plotmodel(md, 'data', (md.results.TransientSolution(end).Thickness))
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('eisminttrans2thickness','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off')
-#	system(['mv eisminttrans2thickness.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('eisminttrans2thickness', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 2, 'hardcopy', 'off')
+#       system(['mv eisminttrans2thickness.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf '])
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Thickness']
-field_tolerances=[1e-13,1e-13,1e-13]
-field_values=[md.results.TransientSolution[-1].Vx,
-							md.results.TransientSolution[-1].Vy,
-							md.results.TransientSolution[-1].Thickness]
+field_names = ['Vx', 'Vy', 'Thickness']
+field_tolerances = [1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[-1].Vx,
+                md.results.TransientSolution[-1].Vy,
+                md.results.TransientSolution[-1].Thickness]
Index: /issm/trunk/test/NightlyRun/test1205.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1205.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1205.py	(revision 24313)
@@ -14,89 +14,89 @@
 """
 
-printingflag=False
+printingflag = False
 
-numlayers=10
-resolution=30000.
+numlayers = 10
+resolution = 30000.
 
 #To begin with the numerical model
-md=model()
-md=roundmesh(md,750000.,resolution)
-md=setmask(md,'','')    #We can not test iceshelves nor ice rises with this analytical solution
-md=parameterize(md,'../Par/RoundSheetStaticEISMINT.py')
+md = model()
+md = roundmesh(md, 750000., resolution)
+md = setmask(md, '', '')  #We can not test iceshelves nor ice rises with this analytical solution
+md = parameterize(md, '../Par/RoundSheetStaticEISMINT.py')
 
 #Calculation of the analytical 2d velocity field
-constant=0.3
-vx_obs=constant/2.*md.mesh.x*(md.geometry.thickness)**-1
-vy_obs=constant/2.*md.mesh.y*(md.geometry.thickness)**-1
-vel_obs=np.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2)
+constant = 0.3
+vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**- 1
+vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**- 1
+vel_obs = np.sqrt((md.inversion.vx_obs)**2 + (md.inversion.vy_obs)**2)
 
 #We extrude the model to have a 3d model
-md.extrude(numlayers,1.)
-md=setflowequation(md,'SIA','all')
+md.extrude(numlayers, 1.)
+md = setflowequation(md, 'SIA', 'all')
 
 #Spc the nodes on the bed
-pos=np.where(md.mesh.vertexonbase)
-md.stressbalance.spcvx[pos]=0.
-md.stressbalance.spcvy[pos]=0.
-md.stressbalance.spcvz[pos]=0.
+pos = np.where(md.mesh.vertexonbase)
+md.stressbalance.spcvx[pos] = 0.
+md.stressbalance.spcvy[pos] = 0.
+md.stressbalance.spcvz[pos] = 0.
 
-#Now we can solve the problem 
-md.cluster=generic('name',gethostname(),'np',8)
-md=solve(md,'Stressbalance')
+#Now we can solve the problem
+md.cluster = generic('name', gethostname(), 'np', 8)
+md = solve(md, 'Stressbalance')
 
 #Calculate the depth averaged velocity field (2d):
-vx=md.results.StressbalanceSolution.Vx
-vy=md.results.StressbalanceSolution.Vy
-vel=np.zeros((md.mesh.numberofvertices2d))
+vx = md.results.StressbalanceSolution.Vx
+vy = md.results.StressbalanceSolution.Vy
+vel = np.zeros((md.mesh.numberofvertices2d))
 
-for i in xrange(0,md.mesh.numberofvertices2d):
-	node_vel=0.
-	for j in xrange(0,md.mesh.numberoflayers-1):
-		node_vel=node_vel+1./(2.*(md.mesh.numberoflayers-1))*(np.sqrt(vx[i+(j+1)*md.mesh.numberofvertices2d,0]**2+vy[i+(j+1)*md.mesh.numberofvertices2d,0]**2)+np.sqrt(vx[i+j*md.mesh.numberofvertices2d,0]**2+vy[i+j*md.mesh.numberofvertices2d,0]**2))
-	vel[i]=node_vel
+for i in range(0, md.mesh.numberofvertices2d):
+    node_vel = 0.
+    for j in range(0, md.mesh.numberoflayers - 1):
+        node_vel = node_vel + 1. / (2. * (md.mesh.numberoflayers - 1)) * (np.sqrt(vx[i + (j + 1) * md.mesh.numberofvertices2d, 0]**2 + vy[i + (j + 1) * md.mesh.numberofvertices2d, 0]**2) + np.sqrt(vx[i + j * md.mesh.numberofvertices2d, 0]**2 + vy[i + j * md.mesh.numberofvertices2d, 0]**2))
+    vel[i] = node_vel
 
 #Plot of the velocity from the exact and calculated solutions
 #figure(1)
-#set(gcf,'Position',[1 1 1580 1150])
-#subplot(2,2,1)
-#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
-#vel,'FaceColor','interp','EdgeColor','none')
-#title('Modelled velocity','FontSize',14,'FontWeight','bold')
-#colorbar 
-#caxis([0 200])
-   
-#subplot(2,2,2)
-#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
-#vel_obs,'FaceColor','interp','EdgeColor','none')
-#title('Analytical velocity','FontSize',14,'FontWeight','bold')
-#colorbar 
+#set(gcf, 'Position', [1 1 1580 1150])
+#subplot(2, 2, 1)
+#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
+#vel, 'FaceColor', 'interp', 'EdgeColor', 'none')
+#title('Modelled velocity', 'FontSize', 14, 'FontWeight', 'bold')
+#colorbar
 #caxis([0 200])
 
-#subplot(2,2,3)
+#subplot(2, 2, 2)
+#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
+#vel_obs, 'FaceColor', 'interp', 'EdgeColor', 'none')
+#title('Analytical velocity', 'FontSize', 14, 'FontWeight', 'bold')
+#colorbar
+#caxis([0 200])
+
+#subplot(2, 2, 3)
 #hold on
-#plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2+(md.mesh.y(1:md.mesh.numberofvertices2d)).^2),vel,'r.')
-#plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2),vel_obs,'b.')
-#title('Analytical vs calculated velocity','FontSize',14,'FontWeight','bold')
-#xlabel('distance to the center of the icesheet [m]','FontSize',14,'FontWeight','bold')
-#ylabel('velocity [m/yr]','FontSize',14,'FontWeight','bold')
-#legend('calculated velocity','exact velocity')
+#plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2 + (md.mesh.y(1:md.mesh.numberofvertices2d)).^2), vel, 'r.')
+#plot(sqrt((md.mesh.x2d).^2 + (md.mesh.y2d).^2), vel_obs, 'b.')
+#title('Analytical vs calculated velocity', 'FontSize', 14, 'FontWeight', 'bold')
+#xlabel('distance to the center of the icesheet [m]', 'FontSize', 14, 'FontWeight', 'bold')
+#ylabel('velocity [m / yr]', 'FontSize', 14, 'FontWeight', 'bold')
+#legend('calculated velocity', 'exact velocity')
 #axis([0 750000 0 200])
 #hold off
 
-#subplot(2,2,4)
-#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
-#abs(vel-vel_obs)./vel_obs*100,'FaceColor','interp','EdgeColor','none')
-#title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
+#subplot(2, 2, 4)
+#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
+#abs(vel - vel_obs). / vel_obs * 100, 'FaceColor', 'interp', 'EdgeColor', 'none')
+#title('Relative misfit [%]', 'FontSize', 14, 'FontWeight', 'bold')
 #colorbar
 #caxis([0 100])
 
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('SIAstatic','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
-#	system(['mv SIAstatic.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceSheet'])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('SIAstatic', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 0.7, 'hardcopy', 'off')
+#       system(['mv SIAstatic.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceSheet'])
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vel']
-field_tolerances=[1e-13,1e-13,1e-13]
-field_values=[vx,vy,vel]
+field_names = ['Vx', 'Vy', 'Vel']
+field_tolerances = [1e-13, 1e-13, 1e-13]
+field_values = [vx, vy, vel]
Index: /issm/trunk/test/NightlyRun/test1206.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1206.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1206.py	(revision 24313)
@@ -14,90 +14,88 @@
 """
 
-printingflag=False
+printingflag = False
 
-numlayers=10
-resolution=30000.
+numlayers = 10
+resolution = 30000.
 
 #To begin with the numerical model
-md=model()
-md=roundmesh(md,750000.,resolution)
-md=setmask(md,'','')    #We can not test iceshelves nor ice rises with this analytical solution
-md=parameterize(md,'../Par/RoundSheetStaticEISMINT.py')
+md = model()
+md = roundmesh(md, 750000., resolution)
+md = setmask(md, '', '')  #We can not test iceshelves nor ice rises with this analytical solution
+md = parameterize(md, '../Par/RoundSheetStaticEISMINT.py')
 
 #Calculation of the analytical 2d velocity field
-constant=0.3
-vx_obs=constant/2.*md.mesh.x*(md.geometry.thickness)**-1
-vy_obs=constant/2.*md.mesh.y*(md.geometry.thickness)**-1
-vel_obs=np.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2)
+constant = 0.3
+vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**- 1
+vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**- 1
+vel_obs = np.sqrt((md.inversion.vx_obs)**2 + (md.inversion.vy_obs)**2)
 
 #We extrude the model to have a 3d model
-md.extrude(numlayers,1.)
-md=setflowequation(md,'HO','all')
+md.extrude(numlayers, 1.)
+md = setflowequation(md, 'HO', 'all')
 
 #Spc the nodes on the bed
-pos=np.where(md.mesh.vertexonbase)
-md.stressbalance.spcvx[pos]=0.
-md.stressbalance.spcvy[pos]=0.
-md.stressbalance.spcvz[pos]=0.
+pos = np.where(md.mesh.vertexonbase)
+md.stressbalance.spcvx[pos] = 0.
+md.stressbalance.spcvy[pos] = 0.
+md.stressbalance.spcvz[pos] = 0.
 
-#Now we can solve the problem 
-md.cluster=generic('name',gethostname(),'np',8)
-md=solve(md,'Stressbalance')
+#Now we can solve the problem
+md.cluster = generic('name', gethostname(), 'np', 8)
+md = solve(md, 'Stressbalance')
 
 #Calculate the depth averaged velocity field (2d):
-vx=md.results.StressbalanceSolution.Vx
-vy=md.results.StressbalanceSolution.Vy
-vel=np.zeros((md.mesh.numberofvertices2d))
+vx = md.results.StressbalanceSolution.Vx
+vy = md.results.StressbalanceSolution.Vy
+vel = np.zeros((md.mesh.numberofvertices2d))
 
-for i in xrange(0,md.mesh.numberofvertices2d):
-	node_vel=0.
-	for j in xrange(0,md.mesh.numberoflayers-1):
-		node_vel=node_vel+1./(2.*(md.mesh.numberoflayers-1))*\
-			(np.sqrt(vx[i+(j+1)*md.mesh.numberofvertices2d,0]**2+vy[i+(j+1)*md.mesh.numberofvertices2d,0]**2)+\
-			np.sqrt(vx[i+j*md.mesh.numberofvertices2d,0]**2+vy[i+j*md.mesh.numberofvertices2d,0]**2))
-	vel[i]=node_vel
+for i in range(0, md.mesh.numberofvertices2d):
+    node_vel = 0.
+    for j in range(0, md.mesh.numberoflayers - 1):
+        node_vel = node_vel + 1. / (2. * (md.mesh.numberoflayers - 1)) * (np.sqrt(vx[i + (j + 1) * md.mesh.numberofvertices2d, 0]**2 + vy[i + (j + 1) * md.mesh.numberofvertices2d, 0]**2) + np.sqrt(vx[i + j * md.mesh.numberofvertices2d, 0]**2 + vy[i + j * md.mesh.numberofvertices2d, 0]**2))
+    vel[i] = node_vel
 
 #Plot of the velocity from the exact and calculated solutions
 #figure(1)
-#subplot(2,2,1)
-#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
-#vel,'FaceColor','interp','EdgeColor','none')
-#title('Modelled velocity','FontSize',14,'FontWeight','bold')
-#colorbar 
-#caxis([0 200])
-   
-#subplot(2,2,2)
-#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
-#vel_obs,'FaceColor','interp','EdgeColor','none')
-#title('Analytical velocity','FontSize',14,'FontWeight','bold')
-#colorbar 
+#subplot(2, 2, 1)
+#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
+#vel, 'FaceColor', 'interp', 'EdgeColor', 'none')
+#title('Modelled velocity', 'FontSize', 14, 'FontWeight', 'bold')
+#colorbar
 #caxis([0 200])
 
-#subplot(2,2,3)
+#subplot(2, 2, 2)
+#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
+#vel_obs, 'FaceColor', 'interp', 'EdgeColor', 'none')
+#title('Analytical velocity', 'FontSize', 14, 'FontWeight', 'bold')
+#colorbar
+#caxis([0 200])
+
+#subplot(2, 2, 3)
 #hold on
-#plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2+(md.mesh.y(1:md.mesh.numberofvertices2d)).^2),vel,'r.')
-#plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2),vel_obs,'b.')
-#title('Analytical vs calculated velocity','FontSize',14,'FontWeight','bold')
-#xlabel('distance to the center of the icesheet [m]','FontSize',14,'FontWeight','bold')
-#ylabel('velocity [m/yr]','FontSize',14,'FontWeight','bold')
-#legend('calculated velocity','exact velocity')
+#plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2 + (md.mesh.y(1:md.mesh.numberofvertices2d)).^2), vel, 'r.')
+#plot(sqrt((md.mesh.x2d).^2 + (md.mesh.y2d).^2), vel_obs, 'b.')
+#title('Analytical vs calculated velocity', 'FontSize', 14, 'FontWeight', 'bold')
+#xlabel('distance to the center of the icesheet [m]', 'FontSize', 14, 'FontWeight', 'bold')
+#ylabel('velocity [m / yr]', 'FontSize', 14, 'FontWeight', 'bold')
+#legend('calculated velocity', 'exact velocity')
 #axis([0 750000 0 200])
 #hold off
 
-#subplot(2,2,4)
-#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
-#abs(vel-vel_obs)./vel_obs*100,'FaceColor','interp','EdgeColor','none')
-#title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
+#subplot(2, 2, 4)
+#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
+#abs(vel - vel_obs). / vel_obs * 100, 'FaceColor', 'interp', 'EdgeColor', 'none')
+#title('Relative misfit [%]', 'FontSize', 14, 'FontWeight', 'bold')
 #colorbar
 #caxis([0 100])
 
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('HOstatic','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
-#	system(['mv HOstatic.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceSheet'])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('HOstatic', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 0.7, 'hardcopy', 'off')
+#       system(['mv HOstatic.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceSheet'])
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vel']
-field_tolerances=[1e-12,1e-12,1e-12]
-field_values=[vx,vy,vel]
+field_names = ['Vx', 'Vy', 'Vel']
+field_tolerances = [1e-12, 1e-12, 1e-12]
+field_values = [vx, vy, vel]
Index: /issm/trunk/test/NightlyRun/test1207.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1207.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1207.py	(revision 24313)
@@ -14,90 +14,88 @@
 """
 
-printingflag=False
+printingflag = False
 
-numlayers=10
-resolution=30000.
+numlayers = 10
+resolution = 30000.
 
 #To begin with the numerical model
-md=model()
-md=roundmesh(md,750000.,resolution)
-md=setmask(md,'','')    #We can not test iceshelves nor ice rises with this analytical solution
-md=parameterize(md,'../Par/RoundSheetStaticEISMINT.py')
+md = model()
+md = roundmesh(md, 750000., resolution)
+md = setmask(md, '', '')  #We can not test iceshelves nor ice rises with this analytical solution
+md = parameterize(md, '../Par/RoundSheetStaticEISMINT.py')
 
 #Calculation of the analytical 2d velocity field
-constant=0.3
-vx_obs=constant/2.*md.mesh.x*(md.geometry.thickness)**-1
-vy_obs=constant/2.*md.mesh.y*(md.geometry.thickness)**-1
-vel_obs=np.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2)
+constant = 0.3
+vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**- 1
+vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**- 1
+vel_obs = np.sqrt((md.inversion.vx_obs)**2 + (md.inversion.vy_obs)**2)
 
 #We extrude the model to have a 3d model
-md.extrude(numlayers,1.)
-md=setflowequation(md,'FS','all')
+md.extrude(numlayers, 1.)
+md = setflowequation(md, 'FS', 'all')
 
 #Spc the nodes on the bed
-pos=np.where(md.mesh.vertexonbase)
-md.stressbalance.spcvx[pos]=0.
-md.stressbalance.spcvy[pos]=0.
-md.stressbalance.spcvz[pos]=0.
+pos = np.where(md.mesh.vertexonbase)
+md.stressbalance.spcvx[pos] = 0.
+md.stressbalance.spcvy[pos] = 0.
+md.stressbalance.spcvz[pos] = 0.
 
-#Now we can solve the problem 
-md.cluster=generic('name',gethostname(),'np',8)
-md=solve(md,'Stressbalance')
+#Now we can solve the problem
+md.cluster = generic('name', gethostname(), 'np', 8)
+md = solve(md, 'Stressbalance')
 
 #Calculate the depth averaged velocity field (2d):
-vx=md.results.StressbalanceSolution.Vx
-vy=md.results.StressbalanceSolution.Vy
-vel=np.zeros((md.mesh.numberofvertices2d))
+vx = md.results.StressbalanceSolution.Vx
+vy = md.results.StressbalanceSolution.Vy
+vel = np.zeros((md.mesh.numberofvertices2d))
 
-for i in xrange(0,md.mesh.numberofvertices2d):
-	node_vel=0.
-	for j in xrange(0,md.mesh.numberoflayers-1):
-		node_vel=node_vel+1./(2.*(md.mesh.numberoflayers-1))*\
-			(np.sqrt(vx[i+(j+1)*md.mesh.numberofvertices2d,0]**2+vy[i+(j+1)*md.mesh.numberofvertices2d,0]**2)+\
-			np.sqrt(vx[i+j*md.mesh.numberofvertices2d,0]**2+vy[i+j*md.mesh.numberofvertices2d,0]**2))
-	vel[i]=node_vel
+for i in range(0, md.mesh.numberofvertices2d):
+    node_vel = 0.
+    for j in range(0, md.mesh.numberoflayers - 1):
+        node_vel = node_vel + (1. / (2. * (md.mesh.numberoflayers - 1)) * (np.sqrt(vx[i + (j + 1) * md.mesh.numberofvertices2d, 0]**2 + vy[i + (j + 1) * md.mesh.numberofvertices2d, 0]**2) + np.sqrt(vx[i + j * md.mesh.numberofvertices2d, 0]**2 + vy[i + j * md.mesh.numberofvertices2d, 0]**2)))
+    vel[i] = node_vel
 
 #Plot of the velocity from the exact and calculated solutions
 #figure(1)
-#subplot(2,2,1)
-#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
-#vel,'FaceColor','interp','EdgeColor','none')
-#title('Modelled velocity','FontSize',14,'FontWeight','bold')
-#colorbar 
-#caxis([0 200])
-   
-#subplot(2,2,2)
-#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
-#vel_obs,'FaceColor','interp','EdgeColor','none')
-#title('Analytical velocity','FontSize',14,'FontWeight','bold')
-#colorbar 
+#subplot(2, 2, 1)
+#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
+#vel, 'FaceColor', 'interp', 'EdgeColor', 'none')
+#title('Modelled velocity', 'FontSize', 14, 'FontWeight', 'bold')
+#colorbar
 #caxis([0 200])
 
-#subplot(2,2,3)
+#subplot(2, 2, 2)
+#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
+#vel_obs, 'FaceColor', 'interp', 'EdgeColor', 'none')
+#title('Analytical velocity', 'FontSize', 14, 'FontWeight', 'bold')
+#colorbar
+#caxis([0 200])
+
+#subplot(2, 2, 3)
 #hold on
-#plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2+(md.mesh.y(1:md.mesh.numberofvertices2d)).^2),vel,'r.')
-#plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2),vel_obs,'b.')
-#title('Analytical vs calculated velocity','FontSize',14,'FontWeight','bold')
-#xlabel('distance to the center of the icesheet [m]','FontSize',14,'FontWeight','bold')
-#ylabel('velocity [m/yr]','FontSize',14,'FontWeight','bold')
-#legend('calculated velocity','exact velocity')
+#plot(sqrt((md.mesh.x(1:md.mesh.numberofvertices2d)).^2 + (md.mesh.y(1:md.mesh.numberofvertices2d)).^2), vel, 'r.')
+#plot(sqrt((md.mesh.x2d).^2 + (md.mesh.y2d).^2), vel_obs, 'b.')
+#title('Analytical vs calculated velocity', 'FontSize', 14, 'FontWeight', 'bold')
+#xlabel('distance to the center of the icesheet [m]', 'FontSize', 14, 'FontWeight', 'bold')
+#ylabel('velocity [m / yr]', 'FontSize', 14, 'FontWeight', 'bold')
+#legend('calculated velocity', 'exact velocity')
 #axis([0 750000 0 200])
 #hold off
 
-#subplot(2,2,4)
-#p=patch('Faces',md.mesh.elements2d,'Vertices',[md.mesh.x2d md.mesh.y2d],'FaceVertexCData',...
-#abs(vel-vel_obs)./vel_obs*100,'FaceColor','interp','EdgeColor','none')
-#title('Relative misfit [%]','FontSize',14,'FontWeight','bold')
+#subplot(2, 2, 4)
+#p = patch('Faces', md.mesh.elements2d, 'Vertices', [md.mesh.x2d md.mesh.y2d], 'FaceVertexCData', ...
+#abs(vel - vel_obs). / vel_obs * 100, 'FaceColor', 'interp', 'EdgeColor', 'none')
+#title('Relative misfit [%]', 'FontSize', 14, 'FontWeight', 'bold')
 #colorbar
 #caxis([0 100])
 
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('FSstatic','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
-#	system(['mv FSstatic.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceSheet'])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('FSstatic', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 0.7, 'hardcopy', 'off')
+#       system(['mv FSstatic.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceSheet'])
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vel']
-field_tolerances=[1e-12,1e-12,1e-12]
-field_values=[vx,vy,vel]
+field_names = ['Vx', 'Vy', 'Vel']
+field_tolerances = [1e-12, 1e-12, 1e-12]
+field_values = [vx, vy, vel]
Index: /issm/trunk/test/NightlyRun/test1208.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1208.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1208.py	(revision 24313)
@@ -14,44 +14,44 @@
 """
 
-numlayers=8
-resolution=50000.
+numlayers = 8
+resolution = 50000.
 
 #To begin with the numerical model
-md=triangle(model(),'../Exp/SquareEISMINT750000.exp',resolution)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/RoundSheetEISMINT.py')
+md = triangle(model(), '../Exp/SquareEISMINT750000.exp', resolution)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/RoundSheetEISMINT.py')
 
 #We extrude the model to have a 3d model
-md.extrude(numlayers,1.)
-md=setflowequation(md,'SIA','all')
+md.extrude(numlayers, 1.)
+md = setflowequation(md, 'SIA', 'all')
 
 #Spc the nodes on the bed
-pos=np.where(md.mesh.vertexonbase)
-md.stressbalance.spcvx[pos]=0.
-md.stressbalance.spcvy[pos]=0.
-md.stressbalance.spcvz[pos]=0.
+pos = np.where(md.mesh.vertexonbase)
+md.stressbalance.spcvx[pos] = 0.
+md.stressbalance.spcvy[pos] = 0.
+md.stressbalance.spcvz[pos] = 0.
 
 #Adapt the time steps to the resolution
-md.timestepping.time_step=15.
-md.settings.output_frequency=500
-md.timestepping.final_time=30000.
-md.masstransport.stabilization=1
-md.thermal.stabilization=1
+md.timestepping.time_step = 15.
+md.settings.output_frequency = 500
+md.timestepping.final_time = 30000.
+md.masstransport.stabilization = 1
+md.thermal.stabilization = 1
 
-#Now we can solve the problem 
-md.cluster=generic('name',gethostname(),'np',8)
-md=solve(md,'Transient')
+#Now we can solve the problem
+md.cluster = generic('name', gethostname(), 'np', 8)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure','Thickness','Base','Surface','Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-08,1e-08,1e-07,1e-08,1e-08,1e-08,1e-08,1e-08,1e-07,1e-07]
-field_values=[md.results.TransientSolution[-1].Vx,
-							md.results.TransientSolution[-1].Vy,
-							md.results.TransientSolution[-1].Vz,
-							md.results.TransientSolution[-1].Vel,
-							md.results.TransientSolution[-1].Pressure,
-							md.results.TransientSolution[-1].Thickness,
-							md.results.TransientSolution[-1].Base,
-							md.results.TransientSolution[-1].Surface,
-							md.results.TransientSolution[-1].Temperature,
-							md.results.TransientSolution[-1].BasalforcingsGroundediceMeltingRate]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure', 'Thickness', 'Base', 'Surface', 'Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-08, 1e-08, 1e-07, 1e-08, 1e-08, 1e-08, 1e-08, 1e-08, 1e-07, 1e-07]
+field_values = [md.results.TransientSolution[-1].Vx,
+                md.results.TransientSolution[-1].Vy,
+                md.results.TransientSolution[-1].Vz,
+                md.results.TransientSolution[-1].Vel,
+                md.results.TransientSolution[-1].Pressure,
+                md.results.TransientSolution[-1].Thickness,
+                md.results.TransientSolution[-1].Base,
+                md.results.TransientSolution[-1].Surface,
+                md.results.TransientSolution[-1].Temperature,
+                md.results.TransientSolution[-1].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test121.py
===================================================================
--- /issm/trunk/test/NightlyRun/test121.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test121.py	(revision 24313)
@@ -9,35 +9,33 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.initialization.waterfraction=np.zeros((md.mesh.numberofvertices))
-md.initialization.watercolumn=np.zeros((md.mesh.numberofvertices))
-md.transient.isstressbalance=False
-md.transient.ismasstransport=False
-md.transient.issmb=True
-md.transient.isthermal=True
-md.transient.isgroundingline=False
-md.thermal.isenthalpy=1
-md.thermal.isdynamicbasalspc=1
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 180000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices))
+md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices))
+md.transient.isstressbalance = False
+md.transient.ismasstransport = False
+md.transient.issmb = True
+md.transient.isthermal = True
+md.transient.isgroundingline = False
+md.thermal.isenthalpy = 1
+md.thermal.isdynamicbasalspc = 1
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Enthalpy1','Waterfraction1','Temperature1',\
-	'Enthalpy2','Waterfraction2','Temperature2',\
-	'Enthalpy3','Waterfraction3','Temperature3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-9,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Enthalpy,\
-	md.results.TransientSolution[0].Waterfraction,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[1].Enthalpy,\
-	md.results.TransientSolution[1].Waterfraction,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[2].Enthalpy,\
-	md.results.TransientSolution[2].Waterfraction,\
-	md.results.TransientSolution[2].Temperature,\
-	]
+field_names = ['Enthalpy1', 'Waterfraction1', 'Temperature1',
+               'Enthalpy2', 'Waterfraction2', 'Temperature2',
+               'Enthalpy3', 'Waterfraction3', 'Temperature3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-9, 1e-13]
+field_values = [md.results.TransientSolution[0].Enthalpy,
+                md.results.TransientSolution[0].Waterfraction,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[1].Enthalpy,
+                md.results.TransientSolution[1].Waterfraction,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[2].Enthalpy,
+                md.results.TransientSolution[2].Waterfraction,
+                md.results.TransientSolution[2].Temperature]
Index: /issm/trunk/test/NightlyRun/test122.py
===================================================================
--- /issm/trunk/test/NightlyRun/test122.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test122.py	(revision 24313)
@@ -9,58 +9,55 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',200000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
-md.initialization.waterfraction=np.zeros((md.mesh.numberofvertices))
-md.initialization.watercolumn=np.zeros((md.mesh.numberofvertices))
-md.thermal.isenthalpy=1
-md.thermal.isdynamicbasalspc=1
-md.thermal.stabilization=2
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 200000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices))
+md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices))
+md.thermal.isenthalpy = 1
+md.thermal.isdynamicbasalspc = 1
+md.thermal.stabilization = 2
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','Enthalpy1','Waterfraction1',\
-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','Enthalpy2','Waterfraction2',\
-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','Enthalpy3','Waterfraction3']
-field_tolerances=[\
-	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,\
-	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,\
-	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vz,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].Enthalpy,\
-	md.results.TransientSolution[0].Waterfraction,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vz,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[1].Enthalpy,\
-	md.results.TransientSolution[1].Waterfraction,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vz,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].Temperature,\
-	md.results.TransientSolution[2].Enthalpy,\
-	md.results.TransientSolution[2].Waterfraction,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'Enthalpy1', 'Waterfraction1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'Enthalpy2', 'Waterfraction2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Temperature3', 'Enthalpy3', 'Waterfraction3']
+field_tolerances = [1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09,
+                    1e-09, 1e-09, 1e-08, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09,
+                    1e-09, 1e-09, 1e-08, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].Enthalpy,
+                md.results.TransientSolution[0].Waterfraction,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].Enthalpy,
+                md.results.TransientSolution[1].Waterfraction,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].Enthalpy,
+                md.results.TransientSolution[2].Waterfraction]
Index: /issm/trunk/test/NightlyRun/test123.py
===================================================================
--- /issm/trunk/test/NightlyRun/test123.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test123.py	(revision 24313)
@@ -10,34 +10,30 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 180000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-fake_surface = np.vstack((np.append(np.array(md.geometry.surface)+100,1.1),
-		np.append(np.array(md.geometry.surface)+200,2.1),
-		np.append(np.array(md.geometry.surface)+300,2.5))).T
+fake_surface = np.vstack((np.append(np.array(md.geometry.surface) + 100, 1.1),
+                          np.append(np.array(md.geometry.surface) + 200, 2.1),
+                          np.append(np.array(md.geometry.surface) + 300, 2.5))).T
 
-md.transient.requested_outputs = ['default','SurfaceMisfit']
-md.outputdefinition.definitions = [misfit(
-		name='SurfaceMisfit',
-		definitionstring='Outputdefinition1',
-		model_string='Surface',
-		observation=fake_surface,
-		observation_string='SurfaceObservation',
-		timeinterpolation='nearestneighbor',
-		weights=np.ones((md.mesh.numberofvertices,1)),
-		weights_string='WeightsSurfaceObservation'
-		)]
+md.transient.requested_outputs = ['default', 'SurfaceMisfit']
+md.outputdefinition.definitions = [misfit(name='SurfaceMisfit',
+                                          definitionstring='Outputdefinition1',
+                                          model_string='Surface',
+                                          observation=fake_surface,
+                                          observation_string='SurfaceObservation',
+                                          timeinterpolation='nearestneighbor',
+                                          weights=np.ones((md.mesh.numberofvertices, 1)),
+                                          weights_string='WeightsSurfaceObservation')]
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names = ['SurfaceMisfitFirstStep','SurfaceMisfitSecondStep','SurfaceMisfitThirdStep']
-field_tolerances = [1e-13,1e-13,1e-13]
-field_values = [
-	md.results.TransientSolution[0].SurfaceMisfit,
-	md.results.TransientSolution[1].SurfaceMisfit,
-	md.results.TransientSolution[2].SurfaceMisfit
-	]
+field_names = ['SurfaceMisfitFirstStep', 'SurfaceMisfitSecondStep', 'SurfaceMisfitThirdStep']
+field_tolerances = [1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].SurfaceMisfit,
+                md.results.TransientSolution[1].SurfaceMisfit,
+                md.results.TransientSolution[2].SurfaceMisfit]
Index: /issm/trunk/test/NightlyRun/test124.py
===================================================================
--- /issm/trunk/test/NightlyRun/test124.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test124.py	(revision 24313)
@@ -8,9 +8,9 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',150000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,1)
-md=setflowequation(md,'FS','all')
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 1)
+md = setflowequation(md, 'FS', 'all')
 
 #Free surface
@@ -20,37 +20,33 @@
 
 #Go solve
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names      = [
-	'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1',
-	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2',
-	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3']
-field_tolerances = [
-	2e-09,3e-9,3e-9,3e-9,1e-13,1e-12,1e-12,
-	2e-09,3e-9,3e-9,3e-9,1e-10,1e-10,1e-10,
-	2e-09,3e-9,3e-9,3e-9,1e-10,1e-10,1e-10]
-field_values = [
-	md.results.TransientSolution[0].Vx,
-	md.results.TransientSolution[0].Vy,
-	md.results.TransientSolution[0].Vel,
-	md.results.TransientSolution[0].Pressure,
-	md.results.TransientSolution[0].Base,
-	md.results.TransientSolution[0].Surface,
-	md.results.TransientSolution[0].Thickness,
-	md.results.TransientSolution[1].Vx,
-	md.results.TransientSolution[1].Vy,
-	md.results.TransientSolution[1].Vel,
-	md.results.TransientSolution[1].Pressure,
-	md.results.TransientSolution[1].Base,
-	md.results.TransientSolution[1].Surface,
-	md.results.TransientSolution[1].Thickness,
-	md.results.TransientSolution[2].Vx,
-	md.results.TransientSolution[2].Vy,
-	md.results.TransientSolution[2].Vel,
-	md.results.TransientSolution[2].Pressure,
-	md.results.TransientSolution[2].Base,
-	md.results.TransientSolution[2].Surface,
-	md.results.TransientSolution[2].Thickness,
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3']
+field_tolerances = [2e-09, 3e-9, 3e-9, 3e-9, 1e-13, 1e-12, 1e-12,
+                    2e-09, 3e-9, 3e-9, 3e-9, 1e-10, 1e-10, 1e-10,
+                    2e-09, 3e-9, 3e-9, 3e-9, 1e-10, 1e-10, 1e-10]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness]
Index: /issm/trunk/test/NightlyRun/test125.m
===================================================================
--- /issm/trunk/test/NightlyRun/test125.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test125.m	(revision 24313)
@@ -8,8 +8,9 @@
 
 md.verbose=verbose('solution',true);
-md.settings.recording_frequency=5;
+md.settings.recording_frequency=4;
 
 % time steps and resolution
-md.timestepping.final_time=8;
+md.timestepping.final_time=19;
+md.settings.output_frequency=2;
 
 md=solve(md,'Transient');
@@ -22,12 +23,4 @@
 						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
 field_values={...
-	(md.results.TransientSolution(6).Vx)-(md2.results.TransientSolution(6).Vx),...
-	(md.results.TransientSolution(6).Vy)-(md2.results.TransientSolution(6).Vy),...
-	(md.results.TransientSolution(6).Vel)-(md2.results.TransientSolution(6).Vel),...
-	(md.results.TransientSolution(6).TotalSmb)-(md2.results.TransientSolution(6).TotalSmb),...
-	(md.results.TransientSolution(6).Base)-(md2.results.TransientSolution(6).Base),...
-	(md.results.TransientSolution(6).Surface)-(md2.results.TransientSolution(6).Surface),...
-	(md.results.TransientSolution(6).Thickness)-(md2.results.TransientSolution(6).Thickness),...
-	(md.results.TransientSolution(6).IceVolume)-(md2.results.TransientSolution(6).IceVolume),...
 	(md.results.TransientSolution(7).Vx)-(md2.results.TransientSolution(7).Vx),...
 	(md.results.TransientSolution(7).Vy)-(md2.results.TransientSolution(7).Vy),...
@@ -46,3 +39,11 @@
 	(md.results.TransientSolution(8).Thickness)-(md2.results.TransientSolution(8).Thickness),...
 	(md.results.TransientSolution(8).IceVolume)-(md2.results.TransientSolution(8).IceVolume),...
+	(md.results.TransientSolution(9).Vx)-(md2.results.TransientSolution(9).Vx),...
+	(md.results.TransientSolution(9).Vy)-(md2.results.TransientSolution(9).Vy),...
+	(md.results.TransientSolution(9).Vel)-(md2.results.TransientSolution(9).Vel),...
+	(md.results.TransientSolution(9).TotalSmb)-(md2.results.TransientSolution(9).TotalSmb),...
+	(md.results.TransientSolution(9).Base)-(md2.results.TransientSolution(9).Base),...
+	(md.results.TransientSolution(9).Surface)-(md2.results.TransientSolution(9).Surface),...
+	(md.results.TransientSolution(9).Thickness)-(md2.results.TransientSolution(9).Thickness),...
+	(md.results.TransientSolution(9).IceVolume)-(md2.results.TransientSolution(9).IceVolume),...
 	};
Index: /issm/trunk/test/NightlyRun/test125.py
===================================================================
--- /issm/trunk/test/NightlyRun/test125.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test125.py	(revision 24313)
@@ -7,57 +7,53 @@
 from setflowequation import *
 from solve import *
-
-from massfluxatgate import massfluxatgate
 from generic import generic
 import copy
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md.transient.requested_outputs=['IceVolume','TotalSmb']
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.transient.requested_outputs = ['IceVolume', 'TotalSmb']
 
-md.verbose=verbose('solution',1)
-md.settings.recording_frequency=5
+md.verbose = verbose('solution', 1)
+md.settings.recording_frequency = 4
 
 # time steps and resolution
-md.timestepping.final_time=8
+md.timestepping.final_time = 19
+md.settings.output_frequency = 2
 
-md=solve(md,'Transient')
-md2=copy.deepcopy(md)
-md=solve(md,'Transient','restart',1)
+md = solve(md, 'Transient')
+md2 = copy.deepcopy(md)
+md = solve(md, 'Transient', 'restart', 1)
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','TotalSmb1','Bed1','Surface1','Thickness1','Volume1','Vx2','Vy2','Vel2','TotalSmb2','Bed2','Surface2','Thickness2','Volume2','Vx3','Vy3','Vel3','TotalSmb3','Bed3','Surface3','Thickness3','Volume3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-		1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-		1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-		1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-		md2.results.TransientSolution[5].Vx-md.results.TransientSolution[5].Vx,\
-		md2.results.TransientSolution[5].Vy-md.results.TransientSolution[5].Vy,\
-		md2.results.TransientSolution[5].Vel-md.results.TransientSolution[5].Vel,\
-		md2.results.TransientSolution[5].TotalSmb-md.results.TransientSolution[5].TotalSmb,\
-		md2.results.TransientSolution[5].Base-md.results.TransientSolution[5].Base,\
-		md2.results.TransientSolution[5].Surface-md.results.TransientSolution[5].Surface,\
-		md2.results.TransientSolution[5].Thickness-md.results.TransientSolution[5].Thickness,\
-		md2.results.TransientSolution[5].IceVolume-md.results.TransientSolution[5].IceVolume,\
-		md2.results.TransientSolution[6].Vx-md.results.TransientSolution[6].Vx,\
-		md2.results.TransientSolution[6].Vy-md.results.TransientSolution[6].Vy,\
-		md2.results.TransientSolution[6].Vel-md.results.TransientSolution[6].Vel,\
-		md2.results.TransientSolution[6].TotalSmb-md.results.TransientSolution[6].TotalSmb,\
-		md2.results.TransientSolution[6].Base-md.results.TransientSolution[6].Base,\
-		md2.results.TransientSolution[6].Surface-md.results.TransientSolution[6].Surface,\
-		md2.results.TransientSolution[6].Thickness-md.results.TransientSolution[6].Thickness,\
-		md2.results.TransientSolution[6].IceVolume-md.results.TransientSolution[6].IceVolume,\
-		md2.results.TransientSolution[7].Vx-md.results.TransientSolution[7].Vx,\
-		md2.results.TransientSolution[7].Vy-md.results.TransientSolution[7].Vy,\
-		md2.results.TransientSolution[7].Vel-md.results.TransientSolution[7].Vel,\
-		md2.results.TransientSolution[7].TotalSmb-md.results.TransientSolution[7].TotalSmb,\
-		md2.results.TransientSolution[7].Base-md.results.TransientSolution[7].Base,\
-		md2.results.TransientSolution[7].Surface-md.results.TransientSolution[7].Surface,\
-		md2.results.TransientSolution[7].Thickness-md.results.TransientSolution[7].Thickness,\
-		md2.results.TransientSolution[7].IceVolume-md.results.TransientSolution[7].IceVolume\
-		]
-
+field_names = ['Vx1', 'Vy1', 'Vel1', 'TotalSmb1', 'Bed1', 'Surface1', 'Thickness1', 'Volume1', 'Vx2', 'Vy2', 'Vel2', 'TotalSmb2', 'Bed2', 'Surface2', 'Thickness2', 'Volume2', 'Vx3', 'Vy3', 'Vel3', 'TotalSmb3', 'Bed3', 'Surface3', 'Thickness3', 'Volume3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md2.results.TransientSolution[6].Vx - md.results.TransientSolution[6].Vx,
+                md2.results.TransientSolution[6].Vy - md.results.TransientSolution[6].Vy,
+                md2.results.TransientSolution[6].Vel - md.results.TransientSolution[6].Vel,
+                md2.results.TransientSolution[6].TotalSmb - md.results.TransientSolution[6].TotalSmb,
+                md2.results.TransientSolution[6].Base - md.results.TransientSolution[6].Base,
+                md2.results.TransientSolution[6].Surface - md.results.TransientSolution[6].Surface,
+                md2.results.TransientSolution[6].Thickness - md.results.TransientSolution[6].Thickness,
+                md2.results.TransientSolution[6].IceVolume - md.results.TransientSolution[6].IceVolume,
+                md2.results.TransientSolution[7].Vx - md.results.TransientSolution[7].Vx,
+                md2.results.TransientSolution[7].Vy - md.results.TransientSolution[7].Vy,
+                md2.results.TransientSolution[7].Vel - md.results.TransientSolution[7].Vel,
+                md2.results.TransientSolution[7].TotalSmb - md.results.TransientSolution[7].TotalSmb,
+                md2.results.TransientSolution[7].Base - md.results.TransientSolution[7].Base,
+                md2.results.TransientSolution[7].Surface - md.results.TransientSolution[7].Surface,
+                md2.results.TransientSolution[7].Thickness - md.results.TransientSolution[7].Thickness,
+                md2.results.TransientSolution[7].IceVolume - md.results.TransientSolution[7].IceVolume,
+                md2.results.TransientSolution[8].Vx - md.results.TransientSolution[8].Vx,
+                md2.results.TransientSolution[8].Vy - md.results.TransientSolution[8].Vy,
+                md2.results.TransientSolution[8].Vel - md.results.TransientSolution[8].Vel,
+                md2.results.TransientSolution[8].TotalSmb - md.results.TransientSolution[8].TotalSmb,
+                md2.results.TransientSolution[8].Base - md.results.TransientSolution[8].Base,
+                md2.results.TransientSolution[8].Surface - md.results.TransientSolution[8].Surface,
+                md2.results.TransientSolution[8].Thickness - md.results.TransientSolution[8].Thickness,
+                md2.results.TransientSolution[8].IceVolume - md.results.TransientSolution[8].IceVolume]
Index: /issm/trunk/test/NightlyRun/test126.py
===================================================================
--- /issm/trunk/test/NightlyRun/test126.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test126.py	(revision 24313)
@@ -7,65 +7,60 @@
 from setflowequation import *
 from solve import *
-
-from massfluxatgate import massfluxatgate
 from generic import generic
 import copy
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.cluster=generic('name',gethostname(),'np',1)
-md.transient.requested_outputs=['IceVolume','TotalSmb']
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.transient.requested_outputs = ['IceVolume', 'TotalSmb']
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
 
-md.verbose=verbose('solution',1)
-md.settings.recording_frequency=5
+md.verbose = verbose('solution', 1)
+md.settings.recording_frequency = 5
 
 # time steps and resolution
-md.timestepping.final_time=8
+md.timestepping.final_time = 8
 
-md=solve(md,'Transient')
-md2=copy.deepcopy(md)
-md=solve(md,'Transient','restart',1)
+md = solve(md, 'Transient')
+md2 = copy.deepcopy(md)
+md = solve(md, 'Transient', 'restart', 1)
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','TotalSmb1','Bed1','Surface1','Thickness1','Volume1','Temperature1','Pressure1','Vx2','Vy2','Vel2','TotalSmb2','Bed2','Surface2','Thickness2','Volume2','Temperature2','Pressure2','Vx3','Vy3','Vel3','TotalSmb3','Bed3','Surface3','Thickness3','Volume3','Temperature3','Pressure3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-		1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-		1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-		1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-		1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-		md2.results.TransientSolution[5].Vx-md.results.TransientSolution[5].Vx,\
-		md2.results.TransientSolution[5].Vy-md.results.TransientSolution[5].Vy,\
-		md2.results.TransientSolution[5].Vel-md.results.TransientSolution[5].Vel,\
-		md2.results.TransientSolution[5].TotalSmb-md.results.TransientSolution[5].TotalSmb,\
-		md2.results.TransientSolution[5].Base-md.results.TransientSolution[5].Base,\
-		md2.results.TransientSolution[5].Surface-md.results.TransientSolution[5].Surface,\
-		md2.results.TransientSolution[5].Thickness-md.results.TransientSolution[5].Thickness,\
-		md2.results.TransientSolution[5].IceVolume-md.results.TransientSolution[5].IceVolume,\
-		md2.results.TransientSolution[5].Temperature-md.results.TransientSolution[5].Temperature,\
-		md2.results.TransientSolution[5].Pressure-md.results.TransientSolution[5].Pressure,\
-		md2.results.TransientSolution[6].Vx-md.results.TransientSolution[6].Vx,\
-		md2.results.TransientSolution[6].Vy-md.results.TransientSolution[6].Vy,\
-		md2.results.TransientSolution[6].Vel-md.results.TransientSolution[6].Vel,\
-		md2.results.TransientSolution[6].TotalSmb-md.results.TransientSolution[6].TotalSmb,\
-		md2.results.TransientSolution[6].Base-md.results.TransientSolution[6].Base,\
-		md2.results.TransientSolution[6].Surface-md.results.TransientSolution[6].Surface,\
-		md2.results.TransientSolution[6].Thickness-md.results.TransientSolution[6].Thickness,\
-		md2.results.TransientSolution[6].IceVolume-md.results.TransientSolution[6].IceVolume,\
-		md2.results.TransientSolution[6].Temperature-md.results.TransientSolution[6].Temperature,\
-		md2.results.TransientSolution[6].Pressure-md.results.TransientSolution[6].Pressure,\
-		md2.results.TransientSolution[7].Vx-md.results.TransientSolution[7].Vx,\
-		md2.results.TransientSolution[7].Vy-md.results.TransientSolution[7].Vy,\
-		md2.results.TransientSolution[7].Vel-md.results.TransientSolution[7].Vel,\
-		md2.results.TransientSolution[7].TotalSmb-md.results.TransientSolution[7].TotalSmb,\
-		md2.results.TransientSolution[7].Base-md.results.TransientSolution[7].Base,\
-		md2.results.TransientSolution[7].Surface-md.results.TransientSolution[7].Surface,\
-		md2.results.TransientSolution[7].Thickness-md.results.TransientSolution[7].Thickness,\
-		md2.results.TransientSolution[7].IceVolume-md.results.TransientSolution[7].IceVolume,\
-		md2.results.TransientSolution[7].Temperature-md.results.TransientSolution[7].Temperature,\
-		md2.results.TransientSolution[7].Pressure-md.results.TransientSolution[7].Pressure\
-		]
-
+field_names = ['Vx1', 'Vy1', 'Vel1', 'TotalSmb1', 'Bed1', 'Surface1', 'Thickness1', 'Volume1', 'Temperature1', 'Pressure1', 'Vx2', 'Vy2', 'Vel2', 'TotalSmb2', 'Bed2', 'Surface2', 'Thickness2', 'Volume2', 'Temperature2', 'Pressure2', 'Vx3', 'Vy3', 'Vel3', 'TotalSmb3', 'Bed3', 'Surface3', 'Thickness3', 'Volume3', 'Temperature3', 'Pressure3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md2.results.TransientSolution[5].Vx - md.results.TransientSolution[5].Vx,
+                md2.results.TransientSolution[5].Vy - md.results.TransientSolution[5].Vy,
+                md2.results.TransientSolution[5].Vel - md.results.TransientSolution[5].Vel,
+                md2.results.TransientSolution[5].TotalSmb - md.results.TransientSolution[5].TotalSmb,
+                md2.results.TransientSolution[5].Base - md.results.TransientSolution[5].Base,
+                md2.results.TransientSolution[5].Surface - md.results.TransientSolution[5].Surface,
+                md2.results.TransientSolution[5].Thickness - md.results.TransientSolution[5].Thickness,
+                md2.results.TransientSolution[5].IceVolume - md.results.TransientSolution[5].IceVolume,
+                md2.results.TransientSolution[5].Temperature - md.results.TransientSolution[5].Temperature,
+                md2.results.TransientSolution[5].Pressure - md.results.TransientSolution[5].Pressure,
+                md2.results.TransientSolution[6].Vx - md.results.TransientSolution[6].Vx,
+                md2.results.TransientSolution[6].Vy - md.results.TransientSolution[6].Vy,
+                md2.results.TransientSolution[6].Vel - md.results.TransientSolution[6].Vel,
+                md2.results.TransientSolution[6].TotalSmb - md.results.TransientSolution[6].TotalSmb,
+                md2.results.TransientSolution[6].Base - md.results.TransientSolution[6].Base,
+                md2.results.TransientSolution[6].Surface - md.results.TransientSolution[6].Surface,
+                md2.results.TransientSolution[6].Thickness - md.results.TransientSolution[6].Thickness,
+                md2.results.TransientSolution[6].IceVolume - md.results.TransientSolution[6].IceVolume,
+                md2.results.TransientSolution[6].Temperature - md.results.TransientSolution[6].Temperature,
+                md2.results.TransientSolution[6].Pressure - md.results.TransientSolution[6].Pressure,
+                md2.results.TransientSolution[7].Vx - md.results.TransientSolution[7].Vx,
+                md2.results.TransientSolution[7].Vy - md.results.TransientSolution[7].Vy,
+                md2.results.TransientSolution[7].Vel - md.results.TransientSolution[7].Vel,
+                md2.results.TransientSolution[7].TotalSmb - md.results.TransientSolution[7].TotalSmb,
+                md2.results.TransientSolution[7].Base - md.results.TransientSolution[7].Base,
+                md2.results.TransientSolution[7].Surface - md.results.TransientSolution[7].Surface,
+                md2.results.TransientSolution[7].Thickness - md.results.TransientSolution[7].Thickness,
+                md2.results.TransientSolution[7].IceVolume - md.results.TransientSolution[7].IceVolume,
+                md2.results.TransientSolution[7].Temperature - md.results.TransientSolution[7].Temperature,
+                md2.results.TransientSolution[7].Pressure - md.results.TransientSolution[7].Pressure]
Index: /issm/trunk/test/NightlyRun/test1301.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1301.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1301.py	(revision 24313)
@@ -18,44 +18,44 @@
 """
 
-printingflag=False
+printingflag = False
 
-md=model()
-md=triangle(md,'../Exp/Square.exp',100000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareThermal.py')
-md.extrude(3,2.)
-md=setflowequation(md,'HO','all')
+md = model()
+md = triangle(md, '../Exp/Square.exp', 100000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareThermal.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'HO', 'all')
 
 #Some conditions specific to melting test
-md.initialization.pressure=np.zeros((md.mesh.numberofvertices,1),int)
-md.initialization.temperature=273.15*np.ones((md.mesh.numberofvertices))
-pos=np.nonzero(md.mesh.vertexonsurface)[0]
-md.thermal.spctemperature[pos]=md.initialization.temperature[pos]
-md.materials.rheology_B=paterson(md.initialization.temperature)
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices, 1), int)
+md.initialization.temperature = 273.15 * np.ones((md.mesh.numberofvertices))
+pos = np.nonzero(md.mesh.vertexonsurface)[0]
+md.thermal.spctemperature[pos] = md.initialization.temperature[pos]
+md.materials.rheology_B = paterson(md.initialization.temperature)
 
 #analytical results
 #melting heat = geothermal flux
-#Mb*L*rho=G   => Mb=G/L*rho
-melting=md.basalforcings.geothermalflux/(md.materials.rho_ice*md.materials.latentheat)*md.constants.yts
+#Mb * L * rho = G = > Mb = G / L * rho
+melting = md.basalforcings.geothermalflux / (md.materials.rho_ice * md.materials.latentheat) * md.constants.yts
 
 #modeled results
-md.cluster=generic('name',gethostname(),'np',2)
-md=solve(md,'Thermal')
+md.cluster = generic('name', gethostname(), 'np', 2)
+md = solve(md, 'Thermal')
 
 #plot results
-comp_melting=md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate
-relative=np.abs((comp_melting-melting)/melting)*100.
-relative[np.nonzero(comp_melting==melting)[0]]=0.
-#plotmodel(md,'data',comp_melting,'title','Modeled melting','data',melting,'title','Analytical melting',...
-#	'data',comp_melting-melting,'title','Absolute error','data',relative,'title','Relative error [%]',...
-#	'layer#all',1,'caxis#2',[1.02964 1.02966]*10^-4,'FontSize#all',20,'figposition','mathieu')
+comp_melting = md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate
+relative = np.abs((comp_melting - melting) / melting) * 100.
+relative[np.nonzero(comp_melting == melting)[0]] = 0.
+#plotmodel(md, 'data', comp_melting, 'title', 'Modeled melting', 'data', melting, 'title', 'Analytical melting', ...
+#       'data', comp_melting - melting, 'title', 'Absolute error', 'data', relative, 'title', 'Relative error [%]', ...
+#       'layer  #all', 1, 'caxis  #2', [1.02964 1.02966] * 1.0e - 4, 'FontSize  #all', 20, 'figposition', 'mathieu')
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('thermalmelting','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
-#	system(['mv thermalmelting.png ' ISSM_DIR '/website/doc_pdf/validation/Images/Thermal '])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('thermalmelting', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 0.7, 'hardcopy', 'off')
+#       system(['mv thermalmelting.png ' ISSM_DIR '/website/doc_pdf/validation/Images/Thermal '])
 
 #Fields and tolerances to track changes
-field_names     =['BasalMelting']
-field_tolerances=[1e-08]
-field_values    =[comp_melting]
+field_names = ['BasalMelting']
+field_tolerances = [1e-08]
+field_values = [comp_melting]
Index: /issm/trunk/test/NightlyRun/test1302.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1302.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1302.py	(revision 24313)
@@ -1,5 +1,4 @@
 #Test Name: ThermalAdvection
 import numpy as np
-import sys
 from model import *
 from socket import gethostname
@@ -12,55 +11,55 @@
 
 """
-This file can be run to check that the advection-diffusion  is correctly modeled.
-There is u=v=0 and w=cst everywhere the only thermal boundary conditions are an imposed temperature
+This file can be run to check that the advection - diffusion  is correctly modeled.
+There is u = v = 0 and w = cst everywhere the only thermal boundary conditions are an imposed temperature
 at upper surface and an impose flux at its base.
 """
 
-printingflag=False
+printingflag = False
 
-md=model()
-md=triangle(md,'../Exp/Square.exp',100000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareThermal.py')
-md.extrude(30,1.)    #NB: the more one extrudes, the better (10-> relative~0.35%, 20->0.1%, 30->0.05%)
-md=setflowequation(md,'HO','all')
+md = model()
+md = triangle(md, '../Exp/Square.exp', 100000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareThermal.py')
+md.extrude(30, 1.)  #NB: the more one extrudes, the better (10 -> relative~0.35%, 20 -> 0.1%, 30 -> 0.05%)
+md = setflowequation(md, 'HO', 'all')
 
 #Thermal boundary conditions
-pos1=np.where(np.isnan(md.mesh.lowerelements))[0]
-md.thermal.spctemperature[md.mesh.elements[pos1,0:3]-1]=10.
-pos2=np.where(np.isnan(md.mesh.upperelements))[0]
-md.thermal.spctemperature[md.mesh.elements[pos2,3:6]-1]=0.
-md.initialization.vz=0.1*np.ones((md.mesh.numberofvertices))
-md.initialization.vel=np.sqrt(md.initialization.vx**2+ md.initialization.vy**2+ md.initialization.vz**2)
-md.initialization.pressure=np.zeros((md.mesh.numberofvertices),int)
+pos1 = np.where(np.isnan(md.mesh.lowerelements))[0]
+md.thermal.spctemperature[md.mesh.elements[pos1, 0:3] - 1] = 10.
+pos2 = np.where(np.isnan(md.mesh.upperelements))[0]
+md.thermal.spctemperature[md.mesh.elements[pos2, 3:6] - 1] = 0.
+md.initialization.vz = 0.1 * np.ones((md.mesh.numberofvertices))
+md.initialization.vel = np.sqrt(md.initialization.vx**2 + md.initialization.vy**2 + md.initialization.vz**2)
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices), int)
 
-md.thermal.stabilization=2
+md.thermal.stabilization = 2
 #analytical results
-#d2T/dz2-w*rho_ice*c/k*dT/dz=0   T(surface)=0  T(bed)=10   => T=A exp(alpha z)+B
-alpha=0.1/md.constants.yts*md.materials.rho_ice*md.materials.heatcapacity/md.materials.thermalconductivity    #alpha=w rho_ice c /k  and w=0.1m/an
-A=10./(np.exp(alpha*(-1000.))-1.)    #A=T(bed)/(exp(alpha*bed)-1)  with bed=-1000 T(bed)=10
-B=-A
-md.initialization.temperature=A*np.exp(alpha*md.mesh.z)+B
+#d2T / dz2 - w * rho_ice * c / k * dT / dz = 0   T(surface)=0  T(bed)=10 = > T = A exp(alpha z) + B
+alpha = 0.1 / md.constants.yts * md.materials.rho_ice * md.materials.heatcapacity / md.materials.thermalconductivity  #alpha = w rho_ice c / k  and w = 0.1m / an
+A = 10. / (np.exp(alpha * (-1000.)) - 1.)  #A = T(bed) / (exp(alpha * bed) - 1)  with bed= -1000 T(bed)=10
+B = -A
+md.initialization.temperature = A * np.exp(alpha * md.mesh.z) + B
 
 #modeled results
-md.cluster=generic('name',gethostname(),'np',2)
-md=solve(md,'Thermal')
+md.cluster = generic('name', gethostname(), 'np', 2)
+md = solve(md, 'Thermal')
 
 #plot results
-comp_temp=md.results.ThermalSolution.Temperature
-relative=np.abs((comp_temp-md.initialization.temperature)/md.initialization.temperature)*100.
-relative[np.nonzero(comp_temp==md.initialization.temperature)[0]]=0.
-#plotmodel(md,'data',comp_temp,'title','Modeled temperature [K]','data',md.initialization.temperature,'view',3,...
-#	'title','Analytical temperature [K]','view',3,'data',comp_temp-md.initialization.temperature,...
-#	'title','Absolute error [K]','view',3,'data',relative,'title','Relative error [%]','view',3,...
-#	'figposition','mathieu','FontSize#all',20)
+comp_temp = md.results.ThermalSolution.Temperature
+relative = np.abs((comp_temp - md.initialization.temperature) / md.initialization.temperature) * 100.
+relative[np.nonzero(comp_temp == md.initialization.temperature)[0]] = 0.
+#plotmodel(md, 'data', comp_temp, 'title', 'Modeled temperature [K]', 'data', md.initialization.temperature, 'view', 3, ...
+#       'title', 'Analytical temperature [K]', 'view', 3, 'data', comp_temp - md.initialization.temperature, ...
+#       'title', 'Absolute error [K]', 'view', 3, 'data', relative, 'title', 'Relative error [%]', 'view', 3, ...
+#       'figposition', 'mathieu', 'FontSize  #all', 20)
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('thermaladvection','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
-#	system(['mv thermaladvection.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT '])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('thermaladvection', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 0.7, 'hardcopy', 'off')
+#       system(['mv thermaladvection.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT '])
 
 #Fields and tolerances to track changes
-field_names     =['AdvectionTemperature']
-field_tolerances=[1e-13]
-field_values    =[comp_temp]
+field_names = ['AdvectionTemperature']
+field_tolerances = [1e-13]
+field_values = [comp_temp]
Index: /issm/trunk/test/NightlyRun/test1303.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1303.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1303.py	(revision 24313)
@@ -1,5 +1,4 @@
 #Test Name: ThermalConduction
 import numpy as np
-import sys
 from model import *
 from socket import gethostname
@@ -18,45 +17,45 @@
 """
 
-printingflag=False
+printingflag = False
 
-md=model()
-md=triangle(md,'../Exp/Square.exp',100000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareThermal.py')
-md.extrude(11,2.)
-md=setflowequation(md,'HO','all')
+md = model()
+md = triangle(md, '../Exp/Square.exp', 100000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareThermal.py')
+md.extrude(11, 2.)
+md = setflowequation(md, 'HO', 'all')
 
 
-pos1=np.where(np.isnan(md.mesh.lowerelements))[0]
-md.thermal.spctemperature[md.mesh.elements[pos1,0:3]-1]=10.
-pos2=np.where(np.isnan(md.mesh.upperelements))[0]
-md.thermal.spctemperature[md.mesh.elements[pos2,3:6]-1]=0.
-md.initialization.pressure=np.zeros((md.mesh.numberofvertices),int)
+pos1 = np.where(np.isnan(md.mesh.lowerelements))[0]
+md.thermal.spctemperature[md.mesh.elements[pos1, 0:3] - 1] = 10.
+pos2 = np.where(np.isnan(md.mesh.upperelements))[0]
+md.thermal.spctemperature[md.mesh.elements[pos2, 3:6] - 1] = 0.
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices), int)
 
 #analytical results
-#d2T/dz2=0 T(bed)=10 T(surface)=0  => T=0*(z-bed)/thickness+10*(surface-z)/thickness
+#d2T / dz2 = 0 T(bed)=10 T(surface)=0 = > T = 0 * (z - bed) / thickness + 10 * (surface-z) / thickness
 #each layer of the 3d mesh must have a constant value
-md.initialization.temperature=10.*(md.geometry.surface-md.mesh.z)/md.geometry.thickness
+md.initialization.temperature = 10. * (md.geometry.surface - md.mesh.z) / md.geometry.thickness
 
 #modeled results
-md.cluster=generic('name',gethostname(),'np',2)
-md=solve(md,'Thermal')
+md.cluster = generic('name', gethostname(), 'np', 2)
+md = solve(md, 'Thermal')
 
 #plot results
-comp_temp=md.results.ThermalSolution.Temperature
-relative=np.abs((comp_temp-md.initialization.temperature)/md.initialization.temperature)*100.
-relative[np.nonzero(comp_temp==md.initialization.temperature)[0]]=0.
-#plotmodel(md,'data',comp_temp,'title','Modeled temperature [K]','data',md.initialization.temperature,'view',3,...
-#	'title','Analytical temperature [K]','view',3,'data',comp_temp-md.initialization.temperature,...
-#	'title','Absolute error [K]','view',3,'data',relative,'title','Relative error [%]','view',3,...
-#	'figposition','mathieu','FontSize#all',20)
+comp_temp = md.results.ThermalSolution.Temperature
+relative = np.abs((comp_temp - md.initialization.temperature) / md.initialization.temperature) * 100.
+relative[np.nonzero(comp_temp == md.initialization.temperature)[0]] = 0.
+#plotmodel(md, 'data', comp_temp, 'title', 'Modeled temperature [K]', 'data', md.initialization.temperature, 'view', 3, ...
+#       'title', 'Analytical temperature [K]', 'view', 3, 'data', comp_temp - md.initialization.temperature, ...
+#       'title', 'Absolute error [K]', 'view', 3, 'data', relative, 'title', 'Relative error [%]', 'view', 3, ...
+#       'figposition', 'mathieu', 'FontSize  #all', 20)
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('thermalconduction','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
-#	system(['mv thermalconduction.png ' ISSM_DIR '/website/doc_pdf/validation/Images/Thermal '])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('thermalconduction', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 0.7, 'hardcopy', 'off')
+#       system(['mv thermalconduction.png ' ISSM_DIR '/website/doc_pdf/validation/Images/Thermal '])
 
 #Fields and tolerances to track changes
-field_names     =['ConductionTemperature']
-field_tolerances=[1e-13]
-field_values    =[comp_temp]
+field_names = ['ConductionTemperature']
+field_tolerances = [1e-13]
+field_values = [comp_temp]
Index: /issm/trunk/test/NightlyRun/test1304.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1304.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1304.py	(revision 24313)
@@ -1,5 +1,4 @@
 #Test Name: ThermalGeothermalFlux
 import numpy as np
-import sys
 from model import *
 from socket import gethostname
@@ -18,43 +17,43 @@
 """
 
-printingflag=False
+printingflag = False
 
-md=model()
-md=triangle(md,'../Exp/Square.exp',100000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareThermal.py')
-md.extrude(11,1.)
-md=setflowequation(md,'HO','all')
+md = model()
+md = triangle(md, '../Exp/Square.exp', 100000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareThermal.py')
+md.extrude(11, 1.)
+md = setflowequation(md, 'HO', 'all')
 
-pos2=np.where(np.isnan(md.mesh.upperelements))[0]
-md.thermal.spctemperature[md.mesh.elements[pos2,3:6]-1]=0.
-md.initialization.pressure=np.zeros((md.mesh.numberofvertices),int)
-md.basalforcings.geothermalflux[:]=0.1    #100mW/m^2
+pos2 = np.where(np.isnan(md.mesh.upperelements))[0]
+md.thermal.spctemperature[md.mesh.elements[pos2, 3:6] - 1] = 0.
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices), int)
+md.basalforcings.geothermalflux[:] = 0.1  #100mW / m^2
 
 #analytical results
 #the result is linear with depth and is equal to 0 on the upper surface (See BC)
-#d2T/dz2=0  -k*dT/dz(bed)=G  T(surface)=0  => T=-G/k*(z-surface)
-md.initialization.temperature=-0.1/md.materials.thermalconductivity*(md.mesh.z-md.geometry.surface)    #G=0.1 W/m2
+#d2T / dz2 = 0 - k * dT / dz(bed)=G  T(surface)=0 = > T= -G / k * (z - surface)
+md.initialization.temperature = -0.1 / md.materials.thermalconductivity * (md.mesh.z - md.geometry.surface)  #G = 0.1 W / m2
 
 #modeled results
-md.cluster=generic('name',gethostname(),'np',2)
-md=solve(md,'Thermal')
+md.cluster = generic('name', gethostname(), 'np', 2)
+md = solve(md, 'Thermal')
 
 #plot results
-comp_temp=md.results.ThermalSolution.Temperature
-relative=np.abs((comp_temp-md.initialization.temperature)/md.initialization.temperature)*100.
-relative[np.where(comp_temp==md.initialization.temperature)[0]]=0.
-#plotmodel(md,'data',comp_temp,'title','Modeled temperature [K]','data',md.initialization.temperature,'view',3,...
-#	'title','Analytical temperature','view',3,'data',comp_temp-md.initialization.temperature,...
-#	'title','Absolute error [K]','view',3,'data',relative,'title','Relative error [%]','view',3,...
-#	'figposition','mathieu','FontSize#all',20)
+comp_temp = md.results.ThermalSolution.Temperature
+relative = np.abs((comp_temp - md.initialization.temperature) / md.initialization.temperature) * 100.
+relative[np.where(comp_temp == md.initialization.temperature)[0]] = 0.
+#plotmodel(md, 'data', comp_temp, 'title', 'Modeled temperature [K]', 'data', md.initialization.temperature, 'view', 3, ...
+#       'title', 'Analytical temperature', 'view', 3, 'data', comp_temp - md.initialization.temperature, ...
+#       'title', 'Absolute error [K]', 'view', 3, 'data', relative, 'title', 'Relative error [%]', 'view', 3, ...
+#       'figposition', 'mathieu', 'FontSize  #all', 20)
 if printingflag:
-	pass
-#	set(gcf,'Color','w')
-#	printmodel('thermalgeothermalflux','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off')
-#	system(['mv thermalgeothermalflux.png ' ISSM_DIR '/website/doc_pdf/validation/Images/Thermal '])
+    pass
+#       set(gcf, 'Color', 'w')
+#       printmodel('thermalgeothermalflux', 'png', 'margin', 'on', 'marginsize', 25, 'frame', 'off', 'resolution', 0.7, 'hardcopy', 'off')
+#       system(['mv thermalgeothermalflux.png ' ISSM_DIR '/website/doc_pdf/validation/Images/Thermal '])
 
 #Fields and tolerances to track changes
-field_names     =['GeothermalFluxTemperature']
-field_tolerances=[1e-13]
-field_values    =[comp_temp]
+field_names = ['GeothermalFluxTemperature']
+field_tolerances = [1e-13]
+field_values = [comp_temp]
Index: /issm/trunk/test/NightlyRun/test1501.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1501.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1501.py	(revision 24313)
@@ -1,5 +1,4 @@
 #Test Name: SquareShelfTranSawTooth2d
 import numpy as np
-import sys
 from model import *
 from socket import gethostname
@@ -13,211 +12,206 @@
 printingflag = False
 
-md=triangle(model(),'../Exp/Square.exp',350000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.transient.isthermal=False
-
-md.timestepping.time_step=1.
-md.settings.output_frequency=1
-md.timestepping.final_time=2000.
-
-#Solve for thinning rate -> -1 * surface mass balance
-smb= 2.*np.ones((md.mesh.numberofvertices))
-md.smb.mass_balance= smb
-md.basalforcings.groundedice_melting_rate= smb
-
-md=solve(md,'Masstransport')
-
-for i in xrange(1,11):
-	 md=solve(md,'Masstransport')
-	 md.smb.mass_balance= md.smb.mass_balance - ((md.results.MasstransportSolution.Thickness)-md.geometry.thickness)
+md = triangle(model(), '../Exp/Square.exp', 350000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.isthermal = False
+
+md.timestepping.time_step = 1.
+md.settings.output_frequency = 1
+md.timestepping.final_time = 2000.
+
+#Solve for thinning rate-> -1 * surface mass balance
+smb = 2. * np.ones((md.mesh.numberofvertices))
+md.smb.mass_balance = smb
+md.basalforcings.groundedice_melting_rate = smb
+
+md = solve(md, 'Masstransport')
+
+for i in range(1, 11):
+    md = solve(md, 'Masstransport')
+    md.smb.mass_balance = md.smb.mass_balance - (np.squeeze(md.results.MasstransportSolution.Thickness) - md.geometry.thickness)
 
 #Set up transient
 smb = md.smb.mass_balance
 
-#tooth= [ [ones(400,1)*(smb') - 10.]' [ones(400,1)*(smb')]' ]
-tooth=np.hstack((np.tile(smb-10.,(1,400)),np.tile(smb,(1,400))))
-#smb=[ [ones(399,1)*(smb')]' smb  tooth tooth]
-smb=np.hstack((np.tile(smb,(1,399)),smb,tooth,tooth))
+#tooth= [ [ones(400, 1) * (smb') - 10.]' [ones(400, 1) * (smb')]' ]
+tooth = np.vstack((np.tile(smb - 10., (400, 1)), np.tile(smb, (400, 1))))
+#smb = [ [ones(399, 1) * (smb')]' smb  tooth tooth]
+smb = np.vstack((np.tile(smb, (399, 1)), smb, tooth, tooth)).T
 
 #md.smb.mass_balance= smb
-#md.smb.mass_balance(end+1,:)=[1.:2000.]
-md.smb.mass_balance=np.vstack((smb,np.arange(1,2001)))
-
-md=solve(md,'Transient')
+#md.smb.mass_balance(end + 1, :) = [1.:2000.]
+md.smb.mass_balance = np.vstack((smb, np.arange(1, 2001)))
+
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1', \
-	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2', \
-	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3', \
-	'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4', \
-	'Vx5','Vy5','Vel5','Pressure5','Bed5','Surface5','Thickness5','SmbMassBalance5']
-field_tolerances=[1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
-	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
-	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
-	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
-	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10]
-field_values=[\
-	md.results.TransientSolution[400-1].Vx,\
-	md.results.TransientSolution[400-1].Vy,\
-	md.results.TransientSolution[400-1].Vel,\
-	md.results.TransientSolution[400-1].Pressure,\
-	md.results.TransientSolution[400-1].Base,\
-	md.results.TransientSolution[400-1].Surface,\
-	md.results.TransientSolution[400-1].Thickness,\
-	md.results.TransientSolution[400-1].SmbMassBalance,\
-	md.results.TransientSolution[800-1].Vx,\
-	md.results.TransientSolution[800-1].Vy,\
-	md.results.TransientSolution[800-1].Vel,\
-	md.results.TransientSolution[800-1].Pressure,\
-	md.results.TransientSolution[800-1].Base,\
-	md.results.TransientSolution[800-1].Surface,\
-	md.results.TransientSolution[800-1].Thickness,\
-	md.results.TransientSolution[800-1].SmbMassBalance,\
-	md.results.TransientSolution[1200-1].Vx,\
-	md.results.TransientSolution[1200-1].Vy,\
-	md.results.TransientSolution[1200-1].Vel,\
-	md.results.TransientSolution[1200-1].Pressure,\
-	md.results.TransientSolution[1200-1].Base,\
-	md.results.TransientSolution[1200-1].Surface,\
-	md.results.TransientSolution[1200-1].Thickness,\
-	md.results.TransientSolution[1200-1].SmbMassBalance,\
-	md.results.TransientSolution[1600-1].Vx,\
-	md.results.TransientSolution[1600-1].Vy,\
-	md.results.TransientSolution[1600-1].Vel,\
-	md.results.TransientSolution[1600-1].Pressure,\
-	md.results.TransientSolution[1600-1].Base,\
-	md.results.TransientSolution[1600-1].Surface,\
-	md.results.TransientSolution[1600-1].Thickness,\
-	md.results.TransientSolution[1600-1].SmbMassBalance,\
-	md.results.TransientSolution[2000-1].Vx,\
-	md.results.TransientSolution[2000-1].Vy,\
-	md.results.TransientSolution[2000-1].Vel,\
-	md.results.TransientSolution[2000-1].Pressure,\
-	md.results.TransientSolution[2000-1].Base,\
-	md.results.TransientSolution[2000-1].Surface,\
-	md.results.TransientSolution[2000-1].Thickness,\
-	md.results.TransientSolution[2000-1].SmbMassBalance,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3',
+               'Vx4', 'Vy4', 'Vel4', 'Pressure4', 'Bed4', 'Surface4', 'Thickness4', 'SmbMassBalance4',
+               'Vx5', 'Vy5', 'Vel5', 'Pressure5', 'Bed5', 'Surface5', 'Thickness5', 'SmbMassBalance5']
+field_tolerances = [1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
+field_values = [md.results.TransientSolution[400 - 1].Vx,
+                md.results.TransientSolution[400 - 1].Vy,
+                md.results.TransientSolution[400 - 1].Vel,
+                md.results.TransientSolution[400 - 1].Pressure,
+                md.results.TransientSolution[400 - 1].Base,
+                md.results.TransientSolution[400 - 1].Surface,
+                md.results.TransientSolution[400 - 1].Thickness,
+                md.results.TransientSolution[400 - 1].SmbMassBalance,
+                md.results.TransientSolution[800 - 1].Vx,
+                md.results.TransientSolution[800 - 1].Vy,
+                md.results.TransientSolution[800 - 1].Vel,
+                md.results.TransientSolution[800 - 1].Pressure,
+                md.results.TransientSolution[800 - 1].Base,
+                md.results.TransientSolution[800 - 1].Surface,
+                md.results.TransientSolution[800 - 1].Thickness,
+                md.results.TransientSolution[800 - 1].SmbMassBalance,
+                md.results.TransientSolution[1200 - 1].Vx,
+                md.results.TransientSolution[1200 - 1].Vy,
+                md.results.TransientSolution[1200 - 1].Vel,
+                md.results.TransientSolution[1200 - 1].Pressure,
+                md.results.TransientSolution[1200 - 1].Base,
+                md.results.TransientSolution[1200 - 1].Surface,
+                md.results.TransientSolution[1200 - 1].Thickness,
+                md.results.TransientSolution[1200 - 1].SmbMassBalance,
+                md.results.TransientSolution[1600 - 1].Vx,
+                md.results.TransientSolution[1600 - 1].Vy,
+                md.results.TransientSolution[1600 - 1].Vel,
+                md.results.TransientSolution[1600 - 1].Pressure,
+                md.results.TransientSolution[1600 - 1].Base,
+                md.results.TransientSolution[1600 - 1].Surface,
+                md.results.TransientSolution[1600 - 1].Thickness,
+                md.results.TransientSolution[1600 - 1].SmbMassBalance,
+                md.results.TransientSolution[2000 - 1].Vx,
+                md.results.TransientSolution[2000 - 1].Vy,
+                md.results.TransientSolution[2000 - 1].Vel,
+                md.results.TransientSolution[2000 - 1].Pressure,
+                md.results.TransientSolution[2000 - 1].Base,
+                md.results.TransientSolution[2000 - 1].Surface,
+                md.results.TransientSolution[2000 - 1].Thickness,
+                md.results.TransientSolution[2000 - 1].SmbMassBalance]
 
 if printingflag:
-	pass
-
-	"""
-	starttime = 360
-	endtime = 2000
-	res = 40
-	ts = [starttime:res:endtime]
-
-	index = md.mesh.elements
-	x1=md.mesh.x(index(:)) x2=md.mesh.x(index(:,2)) x3=md.mesh.x(index(:,3))
-	y1=md.mesh.y(index(:)) y2=md.mesh.y(index(:,2)) y3=md.mesh.y(index(:,3))
-	areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)))
-
-	thickness = []
-	volume = []
-	massbal = []
-	velocity = []
-	for t=starttime:endtime
-		thickness = [thickness (md.results.TransientSolution(t).Thickness)]
-		volume = [volume mean(md.results.TransientSolution(t).Thickness.value,2).*areas]
-		massbal = [massbal (md.results.TransientSolution(t).SmbMassBalance)]
-		velocity = [velocity (md.results.TransientSolution(t).Vel)]
-	end
-
-	figure('Position', [0 0 860 932])
-
-	options = plotoptions('data','transient_movie','unit','km')
-	options = options.list{1}
-	options = checkplotoptions(md,options)
-
-	%loop over the time steps
-	results=md.results.TransientSolution
-	count = 1
-	for i=ts
-
-		subplot(5,9,[28:31 37:40])
-		set(gca,'pos',get(gca,'pos')+[-0.08 -0.08 0.07 0.08])
-		field = 'Thickness'
-
-		%process data
-		[x y z elements is2d isplanet]=processmesh(md,results(i).(field),options)
-		[data datatype]=processdata(md,results(i).(field),options)
-
-		titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year']
-		plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
-		options=changefieldvalue(options,'title',titlestring)
-		options=addfielddefault(options,'colorbar',1)
-		options=changefieldvalue(options,'caxis',[0 max(max(thickness))])
-		applyoptions(md,[],options)
-
-		subplot(5,9,[33:36 42:45])
-		set(gca,'pos',get(gca,'pos')+[-0.00 -0.08 0.07 0.08])
-		field = 'Vel'
-
-		%process data
-		[x y z elements is2d isplanet]=processmesh(md,results(i).(field),options)
-		[data datatype]=processdata(md,results(i).(field),options)
-
-		titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year']
-		plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
-		options=changefieldvalue(options,'title',titlestring)
-		options=addfielddefault(options,'colorbar',1)
-		options=changefieldvalue(options,'caxis',[0 max(max(velocity))])
-		applyoptions(md,[],options)
-
-		subplot(5,4,1:4)
-		cla
-		set(gca,'pos',get(gca,'pos')+[-0.07 0.03 0.12 0.015])
-		plot(starttime:endtime,mean(massbal),'k','LineWidth', 4)
-		hold on
-		ya = ylim
-		plot([i i], ya, 'r', 'LineWidth',6)
-		ylim(ya) xlim([starttime endtime])
-		title('Surface Mass Balance','FontSize',14)
-		ylabel('m/year','FontSize',14)
-
-		subplot(5,4,5:8)
-		cla
-		set(gca,'pos',get(gca,'pos')+[-0.07 0.015 0.12 0.015])
-		plot(starttime:endtime,sum(volume)/1000/1000/1000,'LineWidth',4)
-		hold on
-		ya = ylim
-		plot([i i], ya, 'r', 'LineWidth',6)
-		ylim(ya) xlim([starttime endtime])
-		title('Ice Volume','FontSize',14)
-		ylabel('km^3','FontSize',14)
-
-		subplot(5,4,9:12)
-		cla
-		set(gca,'pos',get(gca,'pos')+[-0.07 0 0.12 0.015])
-		plot(starttime:endtime,mean(velocity)/1000, 'LineWidth', 4)
-		hold on
-		ya = ylim
-		plot([i i], ya, 'r', 'LineWidth',6)
-		ylim(ya) xlim([starttime endtime])
-		title('Mean Velocity','FontSize', 14)
-		ylabel('km/year','FontSize', 14)
-		xlabel('year','FontSize', 14)
-
-		set(gcf,'Renderer','zbuffer','color','white') %fixes a bug on Mac OS X (not needed in future Matlab version)
-		if i==starttime,
-			%initialize images and frame
-			frame=getframe(gcf)
-			[images,map]=rgb2ind(frame.cdata,256,'nodither')
-			images(1,1,1,length(ts))=0
-		else
-			frame=getframe(gcf)
-			images(:,:,1,count) = rgb2ind(frame.cdata,map,'nodither')
-		end
-
-		count = count+1
-
-	end
-
-	filename='transawtooth2d.gif'
-	imwrite(images,map,filename,'DelayTime',1.0,'LoopCount',inf)
-	"""
-
+    pass
+    """
+    starttime = 360
+    endtime = 2000
+    res = 40
+    ts = [starttime:res:endtime]
+
+    index = md.mesh.elements
+    x1 = md.mesh.x(index(:)) x2 = md.mesh.x(index(:, 2)) x3 = md.mesh.x(index(:, 3))
+    y1 = md.mesh.y(index(:)) y2 = md.mesh.y(index(:, 2)) y3 = md.mesh.y(index(:, 3))
+    areas=(0.5 * ((x2 - x1). * (y3 - y1) - (y2 - y1). * (x3 - x1)))
+
+    thickness = []
+    volume = []
+    massbal = []
+    velocity = []
+    for t = starttime:endtime
+            thickness = [thickness (md.results.TransientSolution(t).Thickness)]
+            volume = [volume mean(md.results.TransientSolution(t).Thickness.value, 2). * areas]
+            massbal = [massbal (md.results.TransientSolution(t).SmbMassBalance)]
+            velocity = [velocity (md.results.TransientSolution(t).Vel)]
+
+    figure('Position', [0 0 860 932])
+
+    options = plotoptions('data', 'transient_movie', 'unit', 'km')
+    options = options.list{1}
+    options = checkplotoptions(md, options)
+
+    %loop over the time steps
+    results = md.results.TransientSolution
+    count = 1
+    for i = ts
+
+        subplot(5, 9, [28:31 37:40])
+        set(gca, 'pos', get(gca, 'pos') + [ -0.08 - 0.08 0.07 0.08])
+        field = 'Thickness'
+
+        %process data
+        [x y z elements is2d isplanet] = processmesh(md, results(i).(field), options)
+        [data datatype] = processdata(md, results(i).(field), options)
+
+        titlestring = [field ' at time ' num2str(results(i).time / md.constants.yts) ' year']
+        plot_unit(x, y, z, elements, data, is2d, isplanet, datatype, options)
+        options = changefieldvalue(options, 'title', titlestring)
+        options = addfielddefault(options, 'colorbar', 1)
+        options = changefieldvalue(options, 'caxis', [0 max(max(thickness))])
+        applyoptions(md, [], options)
+
+        subplot(5, 9, [33:36 42:45])
+        set(gca, 'pos', get(gca, 'pos') + [ -0.00 - 0.08 0.07 0.08])
+        field = 'Vel'
+
+        %process data
+        [x y z elements is2d isplanet] = processmesh(md, results(i).(field), options)
+        [data datatype] = processdata(md, results(i).(field), options)
+
+        titlestring = [field ' at time ' num2str(results(i).time / md.constants.yts) ' year']
+        plot_unit(x, y, z, elements, data, is2d, isplanet, datatype, options)
+        options = changefieldvalue(options, 'title', titlestring)
+        options = addfielddefault(options, 'colorbar', 1)
+        options = changefieldvalue(options, 'caxis', [0 max(max(velocity))])
+        applyoptions(md, [], options)
+
+        subplot(5, 4, 1:4)
+        cla
+        set(gca, 'pos', get(gca, 'pos') + [ -0.07 0.03 0.12 0.015])
+        plot(starttime:endtime, mean(massbal), 'k', 'LineWidth', 4)
+        hold on
+        ya = ylim
+        plot([i i], ya, 'r', 'LineWidth', 6)
+        ylim(ya) xlim([starttime endtime])
+        title('Surface Mass Balance', 'FontSize', 14)
+        ylabel('m/year', 'FontSize', 14)
+
+        subplot(5, 4, 5:8)
+        cla
+        set(gca, 'pos', get(gca, 'pos') + [ -0.07 0.015 0.12 0.015])
+        plot(starttime:endtime, sum(volume) / 1000 / 1000 / 1000, 'LineWidth', 4)
+        hold on
+        ya = ylim
+        plot([i i], ya, 'r', 'LineWidth', 6)
+        ylim(ya) xlim([starttime endtime])
+        title('Ice Volume', 'FontSize', 14)
+        ylabel('km^3', 'FontSize', 14)
+
+        subplot(5, 4, 9:12)
+        cla
+        set(gca, 'pos', get(gca, 'pos') + [ -0.07 0 0.12 0.015])
+        plot(starttime:endtime, mean(velocity) / 1000, 'LineWidth', 4)
+        hold on
+        ya = ylim
+        plot([i i], ya, 'r', 'LineWidth', 6)
+        ylim(ya) xlim([starttime endtime])
+        title('Mean Velocity', 'FontSize', 14)
+        ylabel('km/year', 'FontSize', 14)
+        xlabel('year', 'FontSize', 14)
+
+        set(gcf, 'Renderer', 'zbuffer', 'color', 'white') %fixes a bug on Mac OS X (not needed in future Matlab version)
+        if i = starttime,
+                %initialize images and frame
+                frame = getframe(gcf)
+                [images, map] = rgb2ind(frame.cdata, 256, 'nodither')
+                images(1, 1, 1, length(ts))=0
+        else
+                frame = getframe(gcf)
+                images(:, :, 1, count) = rgb2ind(frame.cdata, map, 'nodither')
+        end
+
+        count = count + 1
+
+        end
+
+        filename = 'transawtooth2d.gif'
+        imwrite(images, map, filename, 'DelayTime', 1.0, 'LoopCount', inf)
+        """
Index: /issm/trunk/test/NightlyRun/test1502.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1502.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1502.py	(revision 24313)
@@ -1,5 +1,4 @@
 #Test Name: SquareShelfTranSawTooth3d
 import numpy as np
-import sys
 from model import *
 from socket import gethostname
@@ -13,217 +12,214 @@
 printingflag = False
 
-md=triangle(model(),'../Exp/Square.exp',450000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
-md.extrude(3,1.)
-md.cluster=generic('name',gethostname(),'np',2)
-md.transient.isthermal=False
-
-md.timestepping.time_step=1.
-md.settings.output_frequency=1
-md.timestepping.final_time=2000.
-
-#Solve for thinning rate -> -1 * surface mass balance
-smb= 2.*np.ones((md.mesh.numberofvertices))
-md.smb.mass_balance= smb
-md.basalforcings.groundedice_melting_rate= smb
-
-md=solve(md,'Masstransport')
-
-for i in xrange(1,11):
-	 md=solve(md,'Masstransport')
-	 md.smb.mass_balance= md.smb.mass_balance - ((md.results.MasstransportSolution.Thickness)-md.geometry.thickness)
+md = triangle(model(), '../Exp/Square.exp', 350000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.extrude(3, 1.)
+md.cluster = generic('name', gethostname(), 'np', 2)
+md.transient.isthermal = False
+
+md.timestepping.time_step = 1.
+md.settings.output_frequency = 1
+md.timestepping.final_time = 2000.
+
+#Solve for thinning rate-> -1 * surface mass balance
+smb = 2. * np.ones((md.mesh.numberofvertices))
+md.smb.mass_balance = smb
+md.basalforcings.groundedice_melting_rate = smb
+
+md = solve(md, 'Masstransport')
+
+for i in range(1, 11):
+    md = solve(md, 'Masstransport')
+    md.smb.mass_balance = md.smb.mass_balance - (np.squeeze(md.results.MasstransportSolution.Thickness) - md.geometry.thickness)
 
 #Set up transient
 smb = md.smb.mass_balance
 
-#tooth= [ [ones(400,1)*(smb') - 10.]' [ones(400,1)*(smb')]' ]
-tooth=np.hstack((np.tile(smb-10.,(1,400)),np.tile(smb,(1,400))))
-#smb=[ [ones(399,1)*(smb')]' smb  tooth tooth]
-smb=np.hstack((np.tile(smb,(1,399)),smb,tooth,tooth))
+#tooth= [ [ones(400, 1) * (smb') - 10.]' [ones(400, 1) * (smb')]' ]
+tooth = np.vstack((np.tile(smb - 10., (400, 1)), np.tile(smb, (400, 1))))
+#smb = [ [ones(399, 1) * (smb')]' smb  tooth tooth]
+smb = np.vstack((np.tile(smb, (399, 1)), smb, tooth, tooth)).T
 
 #md.smb.mass_balance= smb
-#md.smb.mass_balance(end+1,:)=[1.:2000.]
-md.smb.mass_balance=np.vstack((smb,np.arange(1,2001)))
-
-md=solve(md,'Transient')
+#md.smb.mass_balance(end + 1, :) = [1.:2000.]
+md.smb.mass_balance = np.vstack((smb, np.arange(1, 2001)))
+
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names=['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1', \
-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2', \
-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3', \
-	'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4', \
-	'Vx5','Vy5','Vz5','Vel5','Pressure5','Bed5','Surface5','Thickness5','SmbMassBalance5']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[400-1].Vx,\
-	md.results.TransientSolution[400-1].Vy,\
-	md.results.TransientSolution[400-1].Vz,\
-	md.results.TransientSolution[400-1].Vel,\
-	md.results.TransientSolution[400-1].Pressure,\
-	md.results.TransientSolution[400-1].Base,\
-	md.results.TransientSolution[400-1].Surface,\
-	md.results.TransientSolution[400-1].Thickness,\
-	md.results.TransientSolution[400-1].SmbMassBalance,\
-	md.results.TransientSolution[800-1].Vx,\
-	md.results.TransientSolution[800-1].Vy,\
-	md.results.TransientSolution[800-1].Vz,\
-	md.results.TransientSolution[800-1].Vel,\
-	md.results.TransientSolution[800-1].Pressure,\
-	md.results.TransientSolution[800-1].Base,\
-	md.results.TransientSolution[800-1].Surface,\
-	md.results.TransientSolution[800-1].Thickness,\
-	md.results.TransientSolution[800-1].SmbMassBalance,\
-	md.results.TransientSolution[1200-1].Vx,\
-	md.results.TransientSolution[1200-1].Vy,\
-	md.results.TransientSolution[1200-1].Vz,\
-	md.results.TransientSolution[1200-1].Vel,\
-	md.results.TransientSolution[1200-1].Pressure,\
-	md.results.TransientSolution[1200-1].Base,\
-	md.results.TransientSolution[1200-1].Surface,\
-	md.results.TransientSolution[1200-1].Thickness,\
-	md.results.TransientSolution[1200-1].SmbMassBalance,\
-	md.results.TransientSolution[1600-1].Vx,\
-	md.results.TransientSolution[1600-1].Vy,\
-	md.results.TransientSolution[1600-1].Vz,\
-	md.results.TransientSolution[1600-1].Vel,\
-	md.results.TransientSolution[1600-1].Pressure,\
-	md.results.TransientSolution[1600-1].Base,\
-	md.results.TransientSolution[1600-1].Surface,\
-	md.results.TransientSolution[1600-1].Thickness,\
-	md.results.TransientSolution[1600-1].SmbMassBalance,\
-	md.results.TransientSolution[2000-1].Vx,\
-	md.results.TransientSolution[2000-1].Vy,\
-	md.results.TransientSolution[2000-1].Vz,\
-	md.results.TransientSolution[2000-1].Vel,\
-	md.results.TransientSolution[2000-1].Pressure,\
-	md.results.TransientSolution[2000-1].Base,\
-	md.results.TransientSolution[2000-1].Surface,\
-	md.results.TransientSolution[2000-1].Thickness,\
-	md.results.TransientSolution[2000-1].SmbMassBalance,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3',
+               'Vx4', 'Vy4', 'Vz4', 'Vel4', 'Pressure4', 'Bed4', 'Surface4', 'Thickness4', 'SmbMassBalance4',
+               'Vx5', 'Vy5', 'Vz5', 'Vel5', 'Pressure5', 'Bed5', 'Surface5', 'Thickness5', 'SmbMassBalance5']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[400 - 1].Vx,
+                md.results.TransientSolution[400 - 1].Vy,
+                md.results.TransientSolution[400 - 1].Vz,
+                md.results.TransientSolution[400 - 1].Vel,
+                md.results.TransientSolution[400 - 1].Pressure,
+                md.results.TransientSolution[400 - 1].Base,
+                md.results.TransientSolution[400 - 1].Surface,
+                md.results.TransientSolution[400 - 1].Thickness,
+                md.results.TransientSolution[400 - 1].SmbMassBalance,
+                md.results.TransientSolution[800 - 1].Vx,
+                md.results.TransientSolution[800 - 1].Vy,
+                md.results.TransientSolution[800 - 1].Vz,
+                md.results.TransientSolution[800 - 1].Vel,
+                md.results.TransientSolution[800 - 1].Pressure,
+                md.results.TransientSolution[800 - 1].Base,
+                md.results.TransientSolution[800 - 1].Surface,
+                md.results.TransientSolution[800 - 1].Thickness,
+                md.results.TransientSolution[800 - 1].SmbMassBalance,
+                md.results.TransientSolution[1200 - 1].Vx,
+                md.results.TransientSolution[1200 - 1].Vy,
+                md.results.TransientSolution[1200 - 1].Vz,
+                md.results.TransientSolution[1200 - 1].Vel,
+                md.results.TransientSolution[1200 - 1].Pressure,
+                md.results.TransientSolution[1200 - 1].Base,
+                md.results.TransientSolution[1200 - 1].Surface,
+                md.results.TransientSolution[1200 - 1].Thickness,
+                md.results.TransientSolution[1200 - 1].SmbMassBalance,
+                md.results.TransientSolution[1600 - 1].Vx,
+                md.results.TransientSolution[1600 - 1].Vy,
+                md.results.TransientSolution[1600 - 1].Vz,
+                md.results.TransientSolution[1600 - 1].Vel,
+                md.results.TransientSolution[1600 - 1].Pressure,
+                md.results.TransientSolution[1600 - 1].Base,
+                md.results.TransientSolution[1600 - 1].Surface,
+                md.results.TransientSolution[1600 - 1].Thickness,
+                md.results.TransientSolution[1600 - 1].SmbMassBalance,
+                md.results.TransientSolution[2000 - 1].Vx,
+                md.results.TransientSolution[2000 - 1].Vy,
+                md.results.TransientSolution[2000 - 1].Vz,
+                md.results.TransientSolution[2000 - 1].Vel,
+                md.results.TransientSolution[2000 - 1].Pressure,
+                md.results.TransientSolution[2000 - 1].Base,
+                md.results.TransientSolution[2000 - 1].Surface,
+                md.results.TransientSolution[2000 - 1].Thickness,
+                md.results.TransientSolution[2000 - 1].SmbMassBalance]
 
 if printingflag:
-	pass
-	"""
-
-	starttime = 360
-	endtime = 2000
-	res = 40
-	ts = [starttime:res:endtime]
-
-	index = md.mesh.elements
-	x1=md.mesh.x(index(:)) x2=md.mesh.x(index(:,2)) x3=md.mesh.x(index(:,3))
-	y1=md.mesh.y(index(:)) y2=md.mesh.y(index(:,2)) y3=md.mesh.y(index(:,3))
-	areas=(0.5*((x2-x1).*(y3-y1)-(y2-y1).*(x3-x1)))
-
-	thickness = []
-	volume = []
-	massbal = []
-	velocity = []
-	for t=starttime:endtime
-		thickness = [thickness (md.results.TransientSolution(t).Thickness)]
-		volume = [volume mean(md.results.TransientSolution(t).Thickness.value,2).*areas]
-		massbal = [massbal (md.results.TransientSolution(t).SmbMassBalance)]
-		velocity = [velocity (md.results.TransientSolution(t).Vel)]
-	end
-
-	figure('Position', [0 0 1060 1060])
-
-	options = plotoptions('data','transient_movie','unit','km')
-	options = options.list{1}
-	options = checkplotoptions(md,options)
-
-	%loop over the time steps
-	results=md.results.TransientSolution
-	count = 1
-	for i=ts
-
-		subplot(5,9,[28:31 37:40])
-		set(gca,'pos',get(gca,'pos')+[-0.08 -0.08 0.07 0.08])
-		field = 'Thickness'
-
-		%process data
-		[x y z elements is2d isplanet]=processmesh(md,results(i).(field),options)
-		[data datatype]=processdata(md,results(i).(field),options)
-
-		titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year']
-		plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
-		options=changefieldvalue(options,'title',titlestring)
-		options=addfielddefault(options,'colorbar',1)
-		options=changefieldvalue(options,'caxis',[0 max(max(thickness))])
-		applyoptions(md,[],options)
-
-		subplot(5,9,[33:36 42:45])
-		set(gca,'pos',get(gca,'pos')+[-0.01 -0.08 0.07 0.08])
-		field = 'Vel'
-
-		%process data
-		[x y z elements is2d isplanet]=processmesh(md,results(i).(field),options)
-		[data datatype]=processdata(md,results(i).(field),options)
-
-		titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year']
-		plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
-		options=changefieldvalue(options,'title',titlestring)
-		options=addfielddefault(options,'colorbar',1)
-		options=changefieldvalue(options,'caxis',[0 max(max(velocity))])
-		applyoptions(md,[],options)
-
-		subplot(5,4,1:4)
-		cla
-		set(gca,'pos',get(gca,'pos')+[-0.07 0.03 0.12 0.015])
-		plot(starttime:endtime,mean(massbal),'k','LineWidth', 4)
-		hold on
-		ya = ylim
-		plot([i i], ya, 'r', 'LineWidth',6)
-		ylim(ya) xlim([starttime endtime])
-		title('Surface Mass Balance','FontSize',14)
-		ylabel('m/year','FontSize',14)
-
-		subplot(5,4,5:8)
-		cla
-		set(gca,'pos',get(gca,'pos')+[-0.07 0.015 0.12 0.015])
-		plot(starttime:endtime,sum(volume)/1000/1000/1000,'LineWidth',4)
-		hold on
-		ya = ylim
-		plot([i i], ya, 'r', 'LineWidth',6)
-		ylim(ya) xlim([starttime endtime])
-		title('Ice Volume','FontSize',14)
-		ylabel('km^3','FontSize',14)
-
-		subplot(5,4,9:12)
-		cla
-		set(gca,'pos',get(gca,'pos')+[-0.07 0 0.12 0.015])
-		plot(starttime:endtime,mean(velocity)/1000, 'LineWidth', 4)
-		hold on
-		ya = ylim
-		plot([i i], ya, 'r', 'LineWidth',6)
-		ylim(ya) xlim([starttime endtime])
-		title('Mean Velocity','FontSize', 14)
-		ylabel('km/year','FontSize', 14)
-		xlabel('year','FontSize', 14)
-
-		set(gcf,'Renderer','zbuffer','color','white') %fixes a bug on Mac OS X (not needed in future Matlab version)
-		if i==starttime,
-			%initialize images and frame
-			frame=getframe(gcf)
-			[images,map]=rgb2ind(frame.cdata,256,'nodither')
-			images(1,1,1,length(ts))=0
-		else
-			frame=getframe(gcf)
-			images(:,:,1,count) = rgb2ind(frame.cdata,map,'nodither')
-		end
-
-		count = count+1
-
-	end
-
-	filename='transawtooth3d.gif'
-	imwrite(images,map,filename,'DelayTime',1.0,'LoopCount',inf)
-	"""
-
+    pass
+    """
+
+    starttime = 360
+    endtime = 2000
+    res = 40
+    ts = [starttime:res:endtime]
+
+    index = md.mesh.elements
+    x1 = md.mesh.x(index(:)) x2 = md.mesh.x(index(:, 2)) x3 = md.mesh.x(index(:, 3))
+    y1 = md.mesh.y(index(:)) y2 = md.mesh.y(index(:, 2)) y3 = md.mesh.y(index(:, 3))
+    areas=(0.5 * ((x2 - x1). * (y3 - y1) - (y2 - y1). * (x3 - x1)))
+
+    thickness = []
+    volume = []
+    massbal = []
+    velocity = []
+    for t = starttime:endtime
+            thickness = [thickness (md.results.TransientSolution(t).Thickness)]
+            volume = [volume mean(md.results.TransientSolution(t).Thickness.value, 2). * areas]
+            massbal = [massbal (md.results.TransientSolution(t).SmbMassBalance)]
+            velocity = [velocity (md.results.TransientSolution(t).Vel)]
+    end
+
+    figure('Position', [0 0 1060 1060])
+
+    options = plotoptions('data', 'transient_movie', 'unit', 'km')
+    options = options.list{1}
+    options = checkplotoptions(md, options)
+
+    %loop over the time steps
+    results = md.results.TransientSolution
+    count = 1
+    for i = ts
+
+        subplot(5, 9, [28:31 37:40])
+        set(gca, 'pos', get(gca, 'pos') + [ -0.08 - 0.08 0.07 0.08])
+        field = 'Thickness'
+
+        %process data
+        [x y z elements is2d isplanet] = processmesh(md, results(i).(field), options)
+        [data datatype] = processdata(md, results(i).(field), options)
+
+        titlestring = [field ' at time ' num2str(results(i).time / md.constants.yts) ' year']
+        plot_unit(x, y, z, elements, data, is2d, isplanet, datatype, options)
+        options = changefieldvalue(options, 'title', titlestring)
+        options = addfielddefault(options, 'colorbar', 1)
+        options = changefieldvalue(options, 'caxis', [0 max(max(thickness))])
+        applyoptions(md, [], options)
+
+        subplot(5, 9, [33:36 42:45])
+        set(gca, 'pos', get(gca, 'pos') + [ -0.01 - 0.08 0.07 0.08])
+        field = 'Vel'
+
+        %process data
+        [x y z elements is2d isplanet] = processmesh(md, results(i).(field), options)
+        [data datatype] = processdata(md, results(i).(field), options)
+
+        titlestring = [field ' at time ' num2str(results(i).time / md.constants.yts) ' year']
+        plot_unit(x, y, z, elements, data, is2d, isplanet, datatype, options)
+        options = changefieldvalue(options, 'title', titlestring)
+        options = addfielddefault(options, 'colorbar', 1)
+        options = changefieldvalue(options, 'caxis', [0 max(max(velocity))])
+        applyoptions(md, [], options)
+
+        subplot(5, 4, 1:4)
+        cla
+        set(gca, 'pos', get(gca, 'pos') + [ -0.07 0.03 0.12 0.015])
+        plot(starttime:endtime, mean(massbal), 'k', 'LineWidth', 4)
+        hold on
+        ya = ylim
+        plot([i i], ya, 'r', 'LineWidth', 6)
+        ylim(ya) xlim([starttime endtime])
+        title('Surface Mass Balance', 'FontSize', 14)
+        ylabel('m/year', 'FontSize', 14)
+
+        subplot(5, 4, 5:8)
+        cla
+        set(gca, 'pos', get(gca, 'pos') + [ -0.07 0.015 0.12 0.015])
+        plot(starttime:endtime, sum(volume) / 1000 / 1000 / 1000, 'LineWidth', 4)
+        hold on
+        ya = ylim
+        plot([i i], ya, 'r', 'LineWidth', 6)
+        ylim(ya) xlim([starttime endtime])
+        title('Ice Volume', 'FontSize', 14)
+        ylabel('km^3', 'FontSize', 14)
+
+        subplot(5, 4, 9:12)
+        cla
+        set(gca, 'pos', get(gca, 'pos') + [ -0.07 0 0.12 0.015])
+        plot(starttime:endtime, mean(velocity) / 1000, 'LineWidth', 4)
+        hold on
+        ya = ylim
+        plot([i i], ya, 'r', 'LineWidth', 6)
+        ylim(ya) xlim([starttime endtime])
+        title('Mean Velocity', 'FontSize', 14)
+        ylabel('km/year', 'FontSize', 14)
+        xlabel('year', 'FontSize', 14)
+
+        set(gcf, 'Renderer', 'zbuffer', 'color', 'white') %fixes a bug on Mac OS X (not needed in future Matlab version)
+        if i = starttime,
+            %initialize images and frame
+            frame = getframe(gcf)
+            [images, map] = rgb2ind(frame.cdata, 256, 'nodither')
+            images(1, 1, 1, length(ts))=0
+        else
+            frame = getframe(gcf)
+            images(:, :, 1, count) = rgb2ind(frame.cdata, map, 'nodither')
+        end
+
+        count = count + 1
+
+    end
+
+    filename = 'transawtooth3d.gif'
+    imwrite(images, map, filename, 'DelayTime', 1.0, 'LoopCount', inf)
+    """
Index: /issm/trunk/test/NightlyRun/test1601.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1601.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1601.py	(revision 24313)
@@ -11,43 +11,43 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
-md.stressbalance.spcvx[np.where(md.mesh.y>0.)]=np.nan
-md.initialization.vx[:]=0.
-md.initialization.vy[:]=0.
-md.initialization.vel=np.zeros((md.mesh.numberofvertices))
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.stressbalance.spcvx[np.where(md.mesh.y > 0.)] = np.nan
+md.initialization.vx[:] = 0.
+md.initialization.vy[:] = 0.
+md.initialization.vel = np.zeros((md.mesh.numberofvertices))
 
-md.cluster=generic('name',gethostname(),'np',2)
-md=solve(md,'Stressbalance')
-vel0=md.results.StressbalanceSolution.Vel
-theta=30.*np.pi/180.
-x=md.mesh.x
-y=md.mesh.y
-md.mesh.x=np.cos(theta)*x-np.sin(theta)*y
-md.mesh.y=np.sin(theta)*x+np.cos(theta)*y
+md.cluster = generic('name', gethostname(), 'np', 2)
+md = solve(md, 'Stressbalance')
+vel0 = md.results.StressbalanceSolution.Vel
+theta = 30. * np.pi / 180.
+x = md.mesh.x
+y = md.mesh.y
+md.mesh.x = np.cos(theta) * x - np.sin(theta) * y
+md.mesh.y = np.sin(theta) * x + np.cos(theta) * y
 
-rotation_array=np.array([np.cos(theta),np.sin(theta),0])
-md.stressbalance.referential[:,0:3]=(np.tile(rotation_array,(md.mesh.numberofvertices,1)))
-md.stressbalance.referential[:,3: ]=np.tile([0,0,1],(md.mesh.numberofvertices,1))
-md=solve(md,'Stressbalance')
-vel1=md.results.StressbalanceSolution.Vel
-#plotmodel(md,'data',vel0,'data',vel1,'data',vel1-vel0,'title','Cartesian CS','title','Rotated CS','title','difference')
-print "Error between Cartesian and rotated CS: %g" % (np.max(np.abs(vel0-vel1))/(np.max(np.abs(vel0))+sys.float_info.epsilon))
+rotation_array = np.array([np.cos(theta), np.sin(theta), 0])
+md.stressbalance.referential[:, 0:3] = (np.tile(rotation_array, (md.mesh.numberofvertices, 1)))
+md.stressbalance.referential[:, 3:] = np.tile([0, 0, 1], (md.mesh.numberofvertices, 1))
+md = solve(md, 'Stressbalance')
+vel1 = md.results.StressbalanceSolution.Vel
+#plotmodel(md, 'data', vel0, 'data', vel1, 'data', vel1 - vel0, 'title', 'Cartesian CS', 'title', 'Rotated CS', 'title', 'difference')
+print("Error between Cartesian and rotated CS: {}".format(np.max(np.abs(vel0 - vel1)) / (np.max(np.abs(vel0)) + sys.float_info.epsilon)))
 
 #Now, put CS back to normal except on the side where the spc are applied
-pos=np.where(np.logical_or(x==0.,x==1000000.))[0]
-md.stressbalance.referential[:]=np.nan
-md.stressbalance.referential[pos,0:3]=np.tile([np.cos(theta),np.sin(theta),0],(len(pos),1))
-md.stressbalance.referential[pos,3: ]=np.tile([0,0,1],(len(pos),1))
-md=solve(md,'Stressbalance')
-vel2=md.results.StressbalanceSolution.Vel
+pos = np.where(np.logical_or(x == 0., x == 1000000.))[0]
+md.stressbalance.referential[:] = np.nan
+md.stressbalance.referential[pos, 0:3] = np.tile([np.cos(theta), np.sin(theta), 0], (len(pos), 1))
+md.stressbalance.referential[pos, 3:] = np.tile([0, 0, 1], (len(pos), 1))
+md = solve(md, 'Stressbalance')
+vel2 = md.results.StressbalanceSolution.Vel
 
-#plotmodel(md,'data',vel0,'data',vel2,'data',vel2-vel0,'title','Cartesian CS','title','Rotated CS','title','difference')
-print "Error between Cartesian and rotated CS: %g" % (np.max(np.abs(vel0-vel2))/(np.max(np.abs(vel0))+sys.float_info.epsilon))
+#plotmodel(md, 'data', vel0, 'data', vel2, 'data', vel2 - vel0, 'title', 'Cartesian CS', 'title', 'Rotated CS', 'title', 'difference')
+print("Error between Cartesian and rotated CS: {}".format(np.max(np.abs(vel0 - vel2)) / (np.max(np.abs(vel0)) + sys.float_info.epsilon)))
 
 #Fields and tolerances to track changes
-field_names     =['vel1','vel2']
-field_tolerances=[1e-11,1e-11]
-field_values=[vel1,vel2]
+field_names = ['vel1', 'vel2']
+field_tolerances = [1e-11, 1e-11]
+field_values = [vel1, vel2]
Index: /issm/trunk/test/NightlyRun/test1602.py
===================================================================
--- /issm/trunk/test/NightlyRun/test1602.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test1602.py	(revision 24313)
@@ -11,34 +11,34 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(5,1.)
-md=setflowequation(md,'HO','all')
-md.stressbalance.spcvx[np.nonzero(md.mesh.y>0.)]=np.nan
-md.initialization.vx[:]=0.
-md.initialization.vy[:]=0.
-md.initialization.vel=np.zeros_like(md.initialization.vx)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(5, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.stressbalance.spcvx[np.nonzero(md.mesh.y > 0.)] = np.nan
+md.initialization.vx[:] = 0.
+md.initialization.vy[:] = 0.
+md.initialization.vel = np.zeros_like(md.initialization.vx)
 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
-vel0=md.results.StressbalanceSolution.Vel
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
+vel0 = md.results.StressbalanceSolution.Vel
 
-theta=30.*np.pi/180.
-x=md.mesh.x
-y=md.mesh.y
-md.mesh.x=np.cos(theta)*x-np.sin(theta)*y
-md.mesh.y=np.sin(theta)*x+np.cos(theta)*y
+theta = 30. * np.pi / 180.
+x = md.mesh.x
+y = md.mesh.y
+md.mesh.x = np.cos(theta) * x - np.sin(theta) * y
+md.mesh.y = np.sin(theta) * x + np.cos(theta) * y
 
-md.stressbalance.referential[:,0:3]=np.tile([np.cos(theta),np.sin(theta),0],(md.mesh.numberofvertices,1))
-md.stressbalance.referential[:,3: ]=np.tile([0,0,1],(md.mesh.numberofvertices,1))
-md=solve(md,'Stressbalance')
-vel1=md.results.StressbalanceSolution.Vel
+md.stressbalance.referential[:, 0:3] = np.tile([np.cos(theta), np.sin(theta), 0], (md.mesh.numberofvertices, 1))
+md.stressbalance.referential[:, 3:] = np.tile([0, 0, 1], (md.mesh.numberofvertices, 1))
+md = solve(md, 'Stressbalance')
+vel1 = md.results.StressbalanceSolution.Vel
 
-#plotmodel(md,'data',vel0,'data',vel1,'data',vel1-vel0,'title','Cartesian CS','title','Rotated CS','title','difference','view#all',2)
-print "Error between Cartesian and rotated CS: %g" % (np.max(np.abs(vel0-vel1))/(np.max(np.abs(vel0))+sys.float_info.epsilon))
+#plotmodel(md, 'data', vel0, 'data', vel1, 'data', vel1 - vel0, 'title', 'Cartesian CS', 'title', 'Rotated CS', 'title', 'difference', 'view  #all', 2)
+print("Error between Cartesian and rotated CS: {}".format(np.max(np.abs(vel0 - vel1)) / (np.max(np.abs(vel0)) + sys.float_info.epsilon)))
 
 #Fields and tolerances to track changes
-field_names     =['vel1']
-field_tolerances=[1e-9]
-field_values=[vel1]
+field_names = ['vel1']
+field_tolerances = [1e-9]
+field_values = [vel1]
Index: /issm/trunk/test/NightlyRun/test2001.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2001.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2001.py	(revision 24313)
@@ -1,5 +1,4 @@
 #Test Name: SquareSheetConstrainedGia2d
 import numpy as np
-import copy
 from model import *
 from socket import gethostname
@@ -11,30 +10,29 @@
 
 
-#Define a model 
-md=model()
-md=triangle(md,'../Exp/Square.exp',100000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
+#Define a model
+md = model()
+md = triangle(md, '../Exp/Square.exp', 100000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
 
-#Indicate what you want to compute 
-md.gia.cross_section_shape=1    # for square-edged x-section 
+#Indicate what you want to compute
+md.gia.cross_section_shape = 1  # for square-edged x - section
 
 #Define loading history (see test2001.m for the description)
-md.timestepping.start_time=2400000 # 2,400 kyr
-md.timestepping.final_time=2500000 # 2,500 kyr
-md.geometry.thickness=np.vstack((np.hstack((md.geometry.thickness*0.0, 0.0)),
-																 np.hstack((md.geometry.thickness/2.0, 0.1)),
-																 np.hstack((md.geometry.thickness, 0.2)),
-																 np.hstack((md.geometry.thickness, 1.0)),
-																 np.hstack((md.geometry.thickness, md.timestepping.start_time)))).T
+md.timestepping.start_time = 2400000  # 2, 400 kyr
+md.timestepping.final_time = 2500000  # 2, 500 kyr
+md.geometry.thickness = np.vstack((np.hstack((md.geometry.thickness * 0.0, 0.0)),
+                                   np.hstack((md.geometry.thickness / 2.0, 0.1)),
+                                   np.hstack((md.geometry.thickness, 0.2)),
+                                   np.hstack((md.geometry.thickness, 1.0)),
+                                   np.hstack((md.geometry.thickness, md.timestepping.start_time)))).T
 
-#Solve for GIA deflection 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Gia')
+#Solve for GIA deflection
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Gia')
 
 #Fields and tolerances to track changes
-field_names     =['GiaW','GiadWdt']
-field_tolerances=[1e-13,1e-13]
-field_values    =[md.results.GiaSolution.GiaW,
-									md.results.GiaSolution.GiadWdt]
-
+field_names = ['GiaW', 'GiadWdt']
+field_tolerances = [1e-13, 1e-13]
+field_values = [md.results.GiaSolution.GiaW,
+                md.results.GiaSolution.GiadWdt]
Index: /issm/trunk/test/NightlyRun/test2002.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2002.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2002.m	(revision 24313)
@@ -1,6 +1,6 @@
 %Test Name: EarthSlr
 
-%mesh earth: 
-md=model; 
+%mesh earth:
+md=model;
 md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',700.); %500 km resolution mesh
 
@@ -15,9 +15,9 @@
 pos=find(late <-80);
 md.slr.deltathickness(pos)=-100;
-%greenland 
+%greenland
 pos=find(late > 70 &  late < 80 & longe>-60 & longe<-30);
 md.slr.deltathickness(pos)=-100;
 
-%elastic loading from love numbers: 
+%elastic loading from love numbers:
 nlov=101;
 md.slr.love_h = love_numbers('h','CM'); md.slr.love_h(nlov+1:end)=[];
@@ -27,6 +27,6 @@
 %}}}
 %mask:  {{{
-md.mask=maskpsl(); % use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset 
-mask=gmtmask(md.mesh.lat,md.mesh.long); 
+md.mask=maskpsl(); % use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset
+mask=gmtmask(md.mesh.lat,md.mesh.long);
 
 icemask=ones(md.mesh.numberofvertices,1);
@@ -39,5 +39,5 @@
 %make sure that the ice level set is all inclusive:
 md.mask.land_levelset=zeros(md.mesh.numberofvertices,1);
-md.mask.groundedice_levelset=-ones(md.mesh.numberofvertices,1); 
+md.mask.groundedice_levelset=-ones(md.mesh.numberofvertices,1);
 
 %make sure that the elements that have loads are fully grounded:
@@ -45,10 +45,10 @@
 md.mask.groundedice_levelset(md.mesh.elements(pos,:))=1;
 
-%make sure wherever there is an ice load, that the mask is set to ice: 
-pos=find(md.slr.deltathickness); 
+%make sure wherever there is an ice load, that the mask is set to ice:
+pos=find(md.slr.deltathickness);
 md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
 % }}}
 
-md.slr.ocean_area_scaling=0; 
+md.slr.ocean_area_scaling=0;
 
 %geometry
@@ -68,4 +68,5 @@
 md.slr.Ngia = zeros(md.mesh.numberofvertices,1);
 md.slr.Ugia = zeros(md.mesh.numberofvertices,1);
+md.slr.hydro_rate = zeros(md.mesh.numberofvertices,1);
 
 %Miscellaneous
@@ -78,22 +79,22 @@
 
 % max number of iteration reverted back to 10 (i.e., the original default value)
-md.slr.maxiter=10; 
+md.slr.maxiter=10;
 
-%eustatic run: 
+%eustatic run:
 md.slr.rigid=0; md.slr.elastic=0;md.slr.rotation=0;
 md=solve(md,'Sealevelrise');
 Seustatic=md.results.SealevelriseSolution.Sealevel;
 
-%eustatic + rigid run: 
+%eustatic + rigid run:
 md.slr.rigid=1; md.slr.elastic=0;md.slr.rotation=0;
 md=solve(md,'Sealevelrise');
 Srigid=md.results.SealevelriseSolution.Sealevel;
 
-%eustatic + rigid + elastic run: 
+%eustatic + rigid + elastic run:
 md.slr.rigid=1; md.slr.elastic=1;md.slr.rotation=0;
 md=solve(md,'Sealevelrise');
 Selastic=md.results.SealevelriseSolution.Sealevel;
 
-%eustatic + rigid + elastic + rotation run: 
+%eustatic + rigid + elastic + rotation run:
 md.slr.rigid=1; md.slr.elastic=1; md.slr.rotation=1;
 md=solve(md,'Sealevelrise');
Index: /issm/trunk/test/NightlyRun/test2002.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2002.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2002.py	(revision 24313)
@@ -1,5 +1,4 @@
 #Test Name: EarthSlr
 from model import *
-from socket import gethostname
 import numpy as np
 from parameterize import *
@@ -12,24 +11,24 @@
 
 #mesh earth:
-md=model()
-md.mesh=gmshplanet('radius',6.371012*10**3,'resolution',700.) #500 km resolution mesh
+md = model()
+md.mesh = gmshplanet('radius', 6.371012 * 10**3, 'resolution', 700.)  #500 km resolution mesh
 
 #parameterize slr solution:
 #slr loading:
-md.slr.deltathickness=np.zeros((md.mesh.numberofelements))
-md.slr.sealevel=np.zeros((md.mesh.numberofvertices))
-md.slr.steric_rate=np.zeros((md.mesh.numberofvertices))
+md.slr.deltathickness = np.zeros((md.mesh.numberofelements))
+md.slr.sealevel = np.zeros((md.mesh.numberofvertices))
+md.slr.steric_rate = np.zeros((md.mesh.numberofvertices))
 
 #antarctica
-late=np.sum(md.mesh.lat[md.mesh.elements-1],axis=1)/3
-longe=np.sum(md.mesh.long[md.mesh.elements-1],axis=1)/3
-pos=np.where(late <-80)
-md.slr.deltathickness[pos]=-100
-#greenland 
-pos=np.where(np.logical_and.reduce((late > 70,late < 80,longe>-60,longe<-30)))
-md.slr.deltathickness[pos]=-100
+late = np.sum(md.mesh.lat[md.mesh.elements - 1], axis=1) / 3
+longe = np.sum(md.mesh.long[md.mesh.elements - 1], axis=1) / 3
+pos = np.where(late < -80)
+md.slr.deltathickness[pos] = -100
+#greenland
+pos = np.where(np.logical_and.reduce((late > 70, late < 80, longe > -60, longe < -30)))
+md.slr.deltathickness[pos] = -100
 
 #elastic loading from love numbers:
-nlov=101
+nlov = 101
 md.slr.love_h = love_numbers('h')[:nlov]
 md.slr.love_k = love_numbers('k')[:nlov]
@@ -37,89 +36,90 @@
 
 #mask:
-md.mask=maskpsl() # use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset
-mask=gmtmask(md.mesh.lat,md.mesh.long)
+md.mask = maskpsl()  # use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset
+mask = gmtmask(md.mesh.lat, md.mesh.long)
 
-icemask=np.ones((md.mesh.numberofvertices))
-pos=np.where(mask==0)[0]  
-icemask[pos]=-1
-pos=np.where(np.sum(mask[md.mesh.elements.astype(int)-1],axis=1)<3)[0]
-icemask[md.mesh.elements[pos,:].astype(int)-1]=-1
-md.mask.ice_levelset=icemask
-md.mask.ocean_levelset=np.zeros((md.mesh.numberofvertices))
-pos=np.where(md.mask.ice_levelset==1)
-md.mask.ocean_levelset[pos]=1
+icemask = np.ones((md.mesh.numberofvertices))
+pos = np.where(mask == 0)[0]
+icemask[pos] = -1
+pos = np.where(np.sum(mask[md.mesh.elements.astype(int) - 1], axis=1) < 3)[0]
+icemask[md.mesh.elements[pos, :].astype(int) - 1] = -1
+md.mask.ice_levelset = icemask
+md.mask.ocean_levelset = np.zeros((md.mesh.numberofvertices))
+pos = np.where(md.mask.ice_levelset == 1)
+md.mask.ocean_levelset[pos] = 1
 
 #make sure that the ice level set is all inclusive:
-md.mask.land_levelset=np.zeros((md.mesh.numberofvertices))
-md.mask.groundedice_levelset=-np.ones((md.mesh.numberofvertices))
+md.mask.land_levelset = np.zeros((md.mesh.numberofvertices))
+md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices))
 
 #make sure that the elements that have loads are fully grounded:
-pos=np.nonzero(md.slr.deltathickness)[0]
-md.mask.groundedice_levelset[md.mesh.elements[pos,:]-1]=1;
+pos = np.nonzero(md.slr.deltathickness)[0]
+md.mask.groundedice_levelset[md.mesh.elements[pos, :] - 1] = 1
 
 #make sure wherever there is an ice load, that the mask is set to ice:
-icemask[md.mesh.elements[pos,:]-1]=-1
-md.mask.ice_levelset=icemask
+icemask[md.mesh.elements[pos, :] - 1] = -1
+md.mask.ice_levelset = icemask
 
-md.slr.ocean_area_scaling=0
+md.slr.ocean_area_scaling = 0
 
 #geometry
-di=md.materials.rho_ice/md.materials.rho_water
-md.geometry.thickness=np.ones((md.mesh.numberofvertices))
-md.geometry.surface=(1-di)*np.zeros((md.mesh.numberofvertices))
-md.geometry.base=md.geometry.surface-md.geometry.thickness
-md.geometry.bed=md.geometry.base
+di = md.materials.rho_ice / md.materials.rho_water
+md.geometry.thickness = np.ones((md.mesh.numberofvertices))
+md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices))
+md.geometry.base = md.geometry.surface - md.geometry.thickness
+md.geometry.bed = md.geometry.base
 
 #materials
-md.initialization.temperature=273.25*np.ones((md.mesh.numberofvertices))
-md.materials.rheology_B=paterson(md.initialization.temperature)
-md.materials.rheology_n=3*np.ones((md.mesh.numberofelements))
+md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_B = paterson(md.initialization.temperature)
+md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements))
 
 #New stuff
-md.slr.spcthickness = np.nan*np.ones((md.mesh.numberofvertices,));
-md.slr.Ngia = np.zeros((md.mesh.numberofvertices,))
-md.slr.Ugia = np.zeros((md.mesh.numberofvertices,))
+md.slr.spcthickness = np.nan * np.ones((md.mesh.numberofvertices, ))
+md.slr.Ngia = np.zeros((md.mesh.numberofvertices, ))
+md.slr.Ugia = np.zeros((md.mesh.numberofvertices, ))
+md.slr.hydro_rate = np.zeros((md.mesh.numberofvertices, ))
 
 #Miscellaneous
-md.miscellaneous.name='test2002'
+md.miscellaneous.name = 'test2002'
 
 #Solution parameters
-md.slr.reltol=np.nan
-md.slr.abstol=1e-3
-md.slr.geodetic=1
+md.slr.reltol = np.nan
+md.slr.abstol = 1e-3
+md.slr.geodetic = 1
 
 #max number of iteration reverted back to 10 (i.e., the original default value)
-md.slr.maxiter=10 
+md.slr.maxiter = 10
 
-#eustatic run: 
-md.slr.rigid=0
-md.slr.elastic=0
-md.slr.rotation=0
-md=solve(md,'Sealevelrise')
-Seustatic=md.results.SealevelriseSolution.Sealevel
+#eustatic run:
+md.slr.rigid = 0
+md.slr.elastic = 0
+md.slr.rotation = 0
+md = solve(md, 'Sealevelrise')
+Seustatic = md.results.SealevelriseSolution.Sealevel
 
-#eustatic + rigid run: 
-md.slr.rigid=1
-md.slr.elastic=0
-md.slr.rotation=0
-md=solve(md,'Sealevelrise')
-Srigid=md.results.SealevelriseSolution.Sealevel
+#eustatic + rigid run:
+md.slr.rigid = 1
+md.slr.elastic = 0
+md.slr.rotation = 0
+md = solve(md, 'Sealevelrise')
+Srigid = md.results.SealevelriseSolution.Sealevel
 
-#eustatic + rigid + elastic run: 
-md.slr.rigid=1
-md.slr.elastic=1
-md.slr.rotation=0
-md=solve(md,'Sealevelrise')
-Selastic=md.results.SealevelriseSolution.Sealevel
+#eustatic + rigid + elastic run:
+md.slr.rigid = 1
+md.slr.elastic = 1
+md.slr.rotation = 0
+md = solve(md, 'Sealevelrise')
+Selastic = md.results.SealevelriseSolution.Sealevel
 
-#eustatic + rigid + elastic + rotation run: 
-md.slr.rigid=1
-md.slr.elastic=1
-md.slr.rotation=1
-md=solve(md,'Sealevelrise')
-Srotation=md.results.SealevelriseSolution.Sealevel
+#eustatic + rigid + elastic + rotation run:
+md.slr.rigid = 1
+md.slr.elastic = 1
+md.slr.rotation = 1
+md = solve(md, 'Sealevelrise')
+Srotation = md.results.SealevelriseSolution.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_names = ['Eustatic', 'Rigid', 'Elastic', 'Rotation']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [Seustatic, Srigid, Selastic, Srotation]
Index: /issm/trunk/test/NightlyRun/test2003.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2003.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2003.m	(revision 24313)
@@ -1,6 +1,6 @@
 %Test Name: EarthSlr_rotationalFeedback
 
-%mesh earth: 
-md=model; 
+%mesh earth:
+md=model;
 md.mesh=gmshplanet('radius',6.371012*10^3,'resolution',1000.); %500 km resolution mesh
 
@@ -16,5 +16,5 @@
 md.slr.deltathickness(pos)=-1;
 
-%elastic loading from love numbers: 
+%elastic loading from love numbers:
 nlov=1001;
 md.slr.love_h = love_numbers('h'); md.slr.love_h(nlov+1:end)=[];
@@ -24,6 +24,6 @@
 %}}}
 %mask:  {{{
-md.mask=maskpsl(); % use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset 
-mask=gmtmask(md.mesh.lat,md.mesh.long); 
+md.mask=maskpsl(); % use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset
+mask=gmtmask(md.mesh.lat,md.mesh.long);
 
 icemask=ones(md.mesh.numberofvertices,1);
@@ -36,5 +36,5 @@
 %make sure that the ice level set is all inclusive:
 md.mask.land_levelset=zeros(md.mesh.numberofvertices,1);
-md.mask.groundedice_levelset=-ones(md.mesh.numberofvertices,1); 
+md.mask.groundedice_levelset=-ones(md.mesh.numberofvertices,1);
 
 %make sure that the elements that have loads are fully grounded:
@@ -42,10 +42,10 @@
 md.mask.groundedice_levelset(md.mesh.elements(pos,:))=1;
 
-%make sure wherever there is an ice load, that the mask is set to ice: 
+%make sure wherever there is an ice load, that the mask is set to ice:
 pos=find(md.slr.deltathickness); md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
 % }}}
 
-% use model representation of ocea area (not the ture area) 
-md.slr.ocean_area_scaling = 0; 
+% use model representation of ocea area (not the ture area)
+md.slr.ocean_area_scaling = 0;
 
 %geometry
@@ -68,4 +68,5 @@
 md.slr.Ngia = zeros(md.mesh.numberofvertices,1);
 md.slr.Ugia = zeros(md.mesh.numberofvertices,1);
+md.slr.hydro_rate = zeros(md.mesh.numberofvertices,1);
 
 %Solution parameters
@@ -74,6 +75,6 @@
 md.slr.geodetic=1;
 
-%eustatic + rigid + elastic run: 
-md.slr.rigid=1; md.slr.elastic=1; md.slr.rotation=0; 
+%eustatic + rigid + elastic run:
+md.slr.rigid=1; md.slr.elastic=1; md.slr.rotation=0;
 md.cluster=generic('name',oshostname(),'np',3);
 %md.verbose=verbose('111111111');
@@ -81,5 +82,5 @@
 SnoRotation=md.results.SealevelriseSolution.Sealevel;
 
-%eustatic + rigid + elastic + rotation run: 
+%eustatic + rigid + elastic + rotation run:
 md.slr.rigid=1; md.slr.elastic=1; md.slr.rotation=1;
 md.cluster=generic('name',oshostname(),'np',3);
Index: /issm/trunk/test/NightlyRun/test2003.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2003.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2003.py	(revision 24313)
@@ -12,21 +12,21 @@
 #mesh earth:
 md = model()
-md.mesh = gmshplanet('radius',6.371012*1e3,'resolution',1000.) #500 km resolution mesh
+md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 1000.)  #500 km resolution mesh
 
 #parameterize slr solution:
 #slr loading:  {{{
-md.slr.deltathickness = np.zeros((md.mesh.numberofelements,))
-md.slr.sealevel = np.zeros((md.mesh.numberofvertices,))
-md.slr.steric_rate = np.zeros((md.mesh.numberofvertices,))
+md.slr.deltathickness = np.zeros((md.mesh.numberofelements, ))
+md.slr.sealevel = np.zeros((md.mesh.numberofvertices, ))
+md.slr.steric_rate = np.zeros((md.mesh.numberofvertices, ))
 
 #antarctica
 #Access every element in lat using the indices in elements
-#-1 to convert to base 0 indexing, 1 (not 2, in matlab) to sum over rows
-late = sum(md.mesh.lat[md.mesh.elements - 1],1) / 3
-longe = sum(md.mesh.long[md.mesh.elements - 1],1) / 3
+# - 1 to convert to base 0 indexing, 1 (not 2, in matlab) to sum over rows
+late = sum(md.mesh.lat[md.mesh.elements - 1], 1) / 3
+longe = sum(md.mesh.long[md.mesh.elements - 1], 1) / 3
 pos = np.intersect1d(np.array(np.where(late < -75)), np.array(np.where(longe < 0)))
 md.slr.deltathickness[pos] = -1
 
-#elastic loading from love numbers: 
+#elastic loading from love numbers:
 nlov = 1000
 md.slr.love_h = np.array(love_numbers('h'))
@@ -39,45 +39,45 @@
 
 #mask:  {{{
-md.mask = maskpsl() # use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset 
-mask = gmtmask(md.mesh.lat,md.mesh.long) 
+md.mask = maskpsl()  # use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset
+mask = gmtmask(md.mesh.lat, md.mesh.long)
 
-icemask = np.ones((md.mesh.numberofvertices,))
+icemask = np.ones((md.mesh.numberofvertices, ))
 pos = np.where(mask == 0)
-#pos[0] because np.where(mask==0) returns a 2d array, the latter parts of which are all array/s of 0s
+#pos[0] because np.where(mask = 0) returns a 2d array, the latter parts of which are all array / s of 0s
 icemask[pos[0]] = -1
-pos = np.where(sum(mask[md.mesh.elements - 1],1) < 3)
-icemask[md.mesh.elements[pos,:] - 1] = -1
+pos = np.where(sum(mask[md.mesh.elements - 1], 1) < 3)
+icemask[md.mesh.elements[pos, :] - 1] = -1
 md.mask.ice_levelset = icemask
-md.mask.ocean_levelset = np.zeros((md.mesh.numberofvertices,))
+md.mask.ocean_levelset = np.zeros((md.mesh.numberofvertices, ))
 pos = np.where(md.mask.ice_levelset == 1)
 md.mask.ocean_levelset[pos] = 1
 
 #make sure that the ice level set is all inclusive:
-md.mask.land_levelset = np.zeros((md.mesh.numberofvertices,))
-md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices,))
+md.mask.land_levelset = np.zeros((md.mesh.numberofvertices, ))
+md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices, ))
 
 #make sure that the elements that have loads are fully grounded:
-pos=np.nonzero(md.slr.deltathickness)[0]
-md.mask.groundedice_levelset[md.mesh.elements[pos,:]-1]=1;
+pos = np.nonzero(md.slr.deltathickness)[0]
+md.mask.groundedice_levelset[md.mesh.elements[pos, :] - 1] = 1
 
 #make sure wherever there is an ice load, that the mask is set to ice:
-icemask[md.mesh.elements[pos,:]-1]=-1
-md.mask.ice_levelset=icemask
+icemask[md.mesh.elements[pos, :] - 1] = -1
+md.mask.ice_levelset = icemask
 # }}}
 
-# use model representation of ocea area (not the ture area) 
+# use model representation of ocea area (not the ture area)
 md.slr.ocean_area_scaling = 0
 
 #geometry
 di = md.materials.rho_ice / md.materials.rho_water
-md.geometry.thickness = np.ones((md.mesh.numberofvertices,))
-md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices,))
+md.geometry.thickness = np.ones((md.mesh.numberofvertices, ))
+md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, ))
 md.geometry.base = md.geometry.surface - md.geometry.thickness
 md.geometry.bed = md.geometry.base
 
 #materials
-md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices,))
+md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))
 md.materials.rheology_B = paterson(md.initialization.temperature)
-md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements,))
+md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
 
 #Miscellaneous
@@ -85,18 +85,19 @@
 
 #New stuff
-md.slr.spcthickness = np.nan*np.ones((md.mesh.numberofvertices,));
-md.slr.Ngia = np.zeros((md.mesh.numberofvertices,))
-md.slr.Ugia = np.zeros((md.mesh.numberofvertices,))
+md.slr.spcthickness = np.nan * np.ones((md.mesh.numberofvertices, ))
+md.slr.Ngia = np.zeros((md.mesh.numberofvertices, ))
+md.slr.Ugia = np.zeros((md.mesh.numberofvertices, ))
+md.slr.hydro_rate = np.zeros((md.mesh.numberofvertices, ))
 
 #Solution parameters
 md.slr.reltol = float('NaN')
 md.slr.abstol = 1e-3
-md.slr.geodetic=1
+md.slr.geodetic = 1
 
-#eustatic + rigid + elastic run: 
+#eustatic + rigid + elastic run:
 md.slr.rigid = 1
 md.slr.elastic = 1
 md.slr.rotation = 0
-md.cluster = generic('name',gethostname(),'np',3)
+md.cluster = generic('name', gethostname(), 'np', 3)
 #md.verbose = verbose('111111111')
 #print md.calving
@@ -105,14 +106,14 @@
 #print md.esa
 #print md.autodiff
-md = solve(md,'Sealevelrise')
+md = solve(md, 'Sealevelrise')
 SnoRotation = md.results.SealevelriseSolution.Sealevel
 
-#eustatic + rigid + elastic + rotation run: 
+#eustatic + rigid + elastic + rotation run:
 md.slr.rigid = 1
 md.slr.elastic = 1
 md.slr.rotation = 1
-md.cluster = generic('name',gethostname(),'np',3)
+md.cluster = generic('name', gethostname(), 'np', 3)
 #md.verbose = verbose('111111111')
-md = solve(md,'Sealevelrise')
+md = solve(md, 'Sealevelrise')
 SRotation = md.results.SealevelriseSolution.Sealevel
 
@@ -121,3 +122,2 @@
 field_tolerances = [1e-13, 1e-13]
 field_values = [SnoRotation, SRotation]
-
Index: /issm/trunk/test/NightlyRun/test201.py
===================================================================
--- /issm/trunk/test/NightlyRun/test201.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test201.py	(revision 24313)
@@ -10,16 +10,16 @@
 from ContourToMesh import *
 
-md=triangle(model(),'../Exp/Square.exp',150000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vel','Pressure']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13]
-field_values=[md.results.StressbalanceSolution.Vx,
-							md.results.StressbalanceSolution.Vy,
-							md.results.StressbalanceSolution.Vel,
-							md.results.StressbalanceSolution.Pressure]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test2010.m
===================================================================
--- /issm/trunk/test/NightlyRun/test2010.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2010.m	(revision 24313)
@@ -1,8 +1,8 @@
 %Test Name: MomentOfIntertia
 
-%mesh earth: 
-md=model; 
+%mesh earth:
+md=model;
 rad_e = 6.371012*10^3; % mean radius of Earth, km
-md.mesh=gmshplanet('radius',rad_e,'resolution',1000.0);  % km resolution 
+md.mesh=gmshplanet('radius',rad_e,'resolution',1000.0);  % km resolution
 
 %parameterize slr solution:
@@ -17,7 +17,7 @@
 md.slr.sealevel=zeros(md.mesh.numberofvertices,1);
 md.slr.steric_rate=zeros(md.mesh.numberofvertices,1);
-md.slr.ocean_area_scaling = 1; 
+md.slr.ocean_area_scaling = 1;
 
-%elastic loading from love numbers: 
+%elastic loading from love numbers:
 nlov=1001;
 md.slr.love_h = love_numbers('h'); md.slr.love_h(nlov+1:end)=[];
@@ -27,6 +27,6 @@
 %}}}
 %mask:  {{{
-md.mask=maskpsl(); % use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset 
-mask=gmtmask(md.mesh.lat,md.mesh.long); 
+md.mask=maskpsl(); % use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset
+mask=gmtmask(md.mesh.lat,md.mesh.long);
 
 icemask=ones(md.mesh.numberofvertices,1);
@@ -39,5 +39,5 @@
 %make sure that the ice level set is all inclusive:
 md.mask.land_levelset=zeros(md.mesh.numberofvertices,1);
-md.mask.groundedice_levelset=-ones(md.mesh.numberofvertices,1); 
+md.mask.groundedice_levelset=-ones(md.mesh.numberofvertices,1);
 
 %make sure that the elements that have loads are fully grounded:
@@ -45,7 +45,7 @@
 md.mask.groundedice_levelset(md.mesh.elements(pos,:))=1;
 
-%make sure wherever there is an ice load, that the mask is set to ice: 
+%make sure wherever there is an ice load, that the mask is set to ice:
 md.mask.ice_levelset=ones(md.mesh.numberofvertices,1);
-pos=find(md.slr.deltathickness); 
+pos=find(md.slr.deltathickness);
 md.mask.ice_levelset(md.mesh.elements(pos,:))=-1;
 % }}}
@@ -75,22 +75,23 @@
 md.slr.Ngia = zeros(md.mesh.numberofvertices,1);
 md.slr.Ugia = zeros(md.mesh.numberofvertices,1);
+md.slr.hydro_rate = zeros(md.mesh.numberofvertices,1);
 
-%eustatic + rigid + elastic run: 
-md.slr.rigid=1; md.slr.elastic=1; md.slr.rotation=1; 
+%eustatic + rigid + elastic run:
+md.slr.rigid=1; md.slr.elastic=1; md.slr.rotation=1;
 md.cluster=generic('name',oshostname(),'np',3);
 
-% uncomment following 2 lines for 
+% uncomment following 2 lines for
 md=solve(md,'Sealevelrise');
 eus=md.results.SealevelriseSolution.SealevelRSLEustatic;
 slr=md.results.SealevelriseSolution.Sealevel;
-moixz=md.results.SealevelriseSolution.SealevelInertiaTensorXZ; 
-moiyz=md.results.SealevelriseSolution.SealevelInertiaTensorYZ; 
-moizz=md.results.SealevelriseSolution.SealevelInertiaTensorZZ; 
+moixz=md.results.SealevelriseSolution.SealevelInertiaTensorXZ;
+moiyz=md.results.SealevelriseSolution.SealevelInertiaTensorYZ;
+moizz=md.results.SealevelriseSolution.SealevelInertiaTensorZZ;
 
 % analytical moi => just checking FOR ICE only!!! {{{
-% ...have to mute ** slr induced MOI in Tria.cpp ** prior to the comparison 
-%rad_e = rad_e*1e3; % now in meters 
+% ...have to mute ** slr induced MOI in Tria.cpp ** prior to the comparison
+%rad_e = rad_e*1e3; % now in meters
 %areas=GetAreasSphericalTria(md.mesh.elements,md.mesh.lat,md.mesh.long,rad_e);
-%lat=late*pi/180; lon=longe*pi/180; 
+%lat=late*pi/180; lon=longe*pi/180;
 %moi_xz = sum(-md.materials.rho_freshwater.*md.slr.deltathickness.*areas.*rad_e^2.*sin(lat).*cos(lat).*cos(lon));
 %moi_yz = sum(-md.materials.rho_freshwater.*md.slr.deltathickness.*areas.*rad_e^2.*sin(lat).*cos(lat).*sin(lon));
Index: /issm/trunk/test/NightlyRun/test2010.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2010.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2010.py	(revision 24313)
@@ -10,24 +10,24 @@
 from gmtmask import *
 
-#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 
+rad_e = 6.371012 * 1e3  # mean radius of Earth, km
+md.mesh = gmshplanet('radius', rad_e, 'resolution', 1000.0)  # km resolution
 
 #parameterize slr solution:
 #slr loading:  {{{
-late = sum(md.mesh.lat[md.mesh.elements - 1],1) / 3
-longe = sum(md.mesh.long[md.mesh.elements - 1],1) / 3
+late = sum(md.mesh.lat[md.mesh.elements - 1], 1) / 3
+longe = sum(md.mesh.long[md.mesh.elements - 1], 1) / 3
 
-md.slr.deltathickness = np.zeros((md.mesh.numberofelements,))
+md.slr.deltathickness = np.zeros((md.mesh.numberofelements, ))
 pos = np.intersect1d(np.array(np.where(late < -75)), np.array(np.where(longe > 0)))
 #python does not include last element in array slices, (6:7) -> [5:7]
 md.slr.deltathickness[pos[5:7]] = -1
 
-md.slr.sealevel = np.zeros((md.mesh.numberofvertices,))
-md.slr.steric_rate = np.zeros((md.mesh.numberofvertices,))
+md.slr.sealevel = np.zeros((md.mesh.numberofvertices, ))
+md.slr.steric_rate = np.zeros((md.mesh.numberofvertices, ))
 md.slr.ocean_area_scaling = 1
 
-#elastic loading from love numbers: 
+#elastic loading from love numbers:
 nlov = 1000
 md.slr.love_h = np.array(love_numbers('h'))
@@ -40,40 +40,40 @@
 #}}}
 #mask:  {{{
-md.mask = maskpsl() # use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset 
-mask = gmtmask(md.mesh.lat,md.mesh.long)
+md.mask = maskpsl()  # use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset
+mask = gmtmask(md.mesh.lat, md.mesh.long)
 
-icemask = np.ones((md.mesh.numberofvertices,))
+icemask = np.ones((md.mesh.numberofvertices, ))
 pos = np.where(mask == 0)
 icemask[pos[0]] = -1
-pos = np.where(sum(mask[md.mesh.elements - 1],1) < 3)
-icemask[md.mesh.elements[pos,:] - 1] = -1
+pos = np.where(sum(mask[md.mesh.elements - 1], 1) < 3)
+icemask[md.mesh.elements[pos, :] - 1] = -1
 md.mask.ice_levelset = icemask
-md.mask.ocean_levelset = np.zeros((md.mesh.numberofvertices,))
+md.mask.ocean_levelset = np.zeros((md.mesh.numberofvertices, ))
 pos = np.where(md.mask.ice_levelset == 1)
 md.mask.ocean_levelset[pos] = 1
 
 #make sure that the ice level set is all inclusive:
-md.mask.land_levelset = np.zeros((md.mesh.numberofvertices,))
-md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices,))
+md.mask.land_levelset = np.zeros((md.mesh.numberofvertices, ))
+md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices, ))
 
 #make sure that the elements that have loads are fully grounded:
-pos=np.nonzero(md.slr.deltathickness)[0]
-md.mask.groundedice_levelset[md.mesh.elements[pos,:]-1]=1;
+pos = np.nonzero(md.slr.deltathickness)[0]
+md.mask.groundedice_levelset[md.mesh.elements[pos, :] - 1] = 1
 
 #make sure wherever there is an ice load, that the mask is set to ice:
-icemask[md.mesh.elements[pos,:]-1]=-1
-md.mask.ice_levelset=icemask
+icemask[md.mesh.elements[pos, :] - 1] = -1
+md.mask.ice_levelset = icemask
 # }}}
 #geometry {{{
 di = md.materials.rho_ice / md.materials.rho_water
-md.geometry.thickness = np.ones((md.mesh.numberofvertices,))
-md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices,))
+md.geometry.thickness = np.ones((md.mesh.numberofvertices, ))
+md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, ))
 md.geometry.base = md.geometry.surface - md.geometry.thickness
 md.geometry.bed = md.geometry.base
 # }}}
 #materials {{{
-md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices,))
+md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))
 md.materials.rheology_B = paterson(md.initialization.temperature)
-md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements,))
+md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
 # }}}
 #Miscellaneous {{{
@@ -87,33 +87,34 @@
 
 #New stuff
-md.slr.spcthickness = np.nan*np.ones((md.mesh.numberofvertices,));
-md.slr.Ngia = np.zeros((md.mesh.numberofvertices,))
-md.slr.Ugia = np.zeros((md.mesh.numberofvertices,))
+md.slr.spcthickness = np.nan * np.ones((md.mesh.numberofvertices, ))
+md.slr.Ngia = np.zeros((md.mesh.numberofvertices, ))
+md.slr.Ugia = np.zeros((md.mesh.numberofvertices, ))
+md.slr.hydro_rate = np.zeros((md.mesh.numberofvertices, ))
 
-#eustatic + rigid + elastic run: 
+#eustatic + rigid + elastic run:
 md.slr.rigid = 1
 md.slr.elastic = 1
 md.slr.rotation = 1
-md.cluster = generic('name',gethostname(),'np',3)
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-# uncomment following 2 lines for 
-md = solve(md,'Sealevelrise')
+# uncomment following 2 lines for
+md = solve(md, 'Sealevelrise')
 eus = md.results.SealevelriseSolution.SealevelRSLEustatic
 slr = md.results.SealevelriseSolution.Sealevel
 moixz = md.results.SealevelriseSolution.SealevelInertiaTensorXZ
 moiyz = md.results.SealevelriseSolution.SealevelInertiaTensorYZ
-moizz = md.results.SealevelriseSolution.SealevelInertiaTensorZZ 
+moizz = md.results.SealevelriseSolution.SealevelInertiaTensorZZ
 
-# analytical moi => just checking FOR ICE only!!! {{{
-# ...have to mute ** slr induced MOI in Tria.cpp ** prior to the comparison 
-#rad_e = rad_e*1e3 # now in meters 
-#areas=GetAreasSphericalTria(md.mesh.elements,md.mesh.lat,md.mesh.long,rad_e)
-#lat=late*pi/180 lon=longe*pi/180
-#moi_xz = sum(-md.materials.rho_freshwater.*md.slr.deltathickness.*areas.*rad_e^2.*sin(lat).*cos(lat).*cos(lon))
-#moi_yz = sum(-md.materials.rho_freshwater.*md.slr.deltathickness.*areas.*rad_e^2.*sin(lat).*cos(lat).*sin(lon))
+# analytical moi = > just checking FOR ICE only!!! {{{
+# ...have to mute**slr induced MOI in Tria.cpp**prior to the comparison
+#rad_e = rad_e * 1e3  # now in meters
+#areas = GetAreasSphericalTria(md.mesh.elements, md.mesh.lat, md.mesh.long, rad_e)
+#lat = late * pi / 180 lon = longe * pi / 180
+#moi_xz = sum(-md.materials.rho_freshwater. * md.slr.deltathickness. * areas. * rad_e^2. * sin(lat). * cos(lat). * cos(lon))
+#moi_yz = sum(-md.materials.rho_freshwater. * md.slr.deltathickness. * areas. * rad_e^2. * sin(lat). * cos(lat). * sin(lon))
 # }}}
 
 #Fields and tolerances to track changes
-field_names     = ['eus','slr','moixz','moiyz','moizz']
-field_tolerances= [1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values = [eus,slr,moixz,moiyz,moizz]
+field_names = ['eus', 'slr', 'moixz', 'moiyz', 'moizz']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [eus, slr, moixz, moiyz, moizz]
Index: /issm/trunk/test/NightlyRun/test202.py
===================================================================
--- /issm/trunk/test/NightlyRun/test202.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test202.py	(revision 24313)
@@ -3,5 +3,4 @@
 from model import *
 from socket import gethostname
-import numpy as np
 from triangle import *
 from setmask import *
@@ -11,22 +10,20 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',180000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,2.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 
 # Fields and tolerances to track changes
 
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test203.js
===================================================================
--- /issm/trunk/test/NightlyRun/test203.js	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test203.js	(revision 24313)
@@ -11,5 +11,5 @@
 //Fields and tolerances to track changes
 field_names     =['Vx','Vy','Vz','Vel','Pressure'];
-field_tolerances=[2e-09,1e-09,1e-09,1e-09,1e-09];
+field_tolerances=[2e-09,2e-09,1e-09,2e-09,1e-09];
 field_values=[
 	(md.results.StressbalanceSolution[0].Vx),
Index: /issm/trunk/test/NightlyRun/test203.m
===================================================================
--- /issm/trunk/test/NightlyRun/test203.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test203.m	(revision 24313)
@@ -10,5 +10,5 @@
 %Fields and tolerances to track changes
 field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
-field_tolerances={2e-09,1e-09,1e-09,1e-09,1e-09};
+field_tolerances={2e-09,2e-09,1e-09,2e-09,1e-09};
 field_values={...
 	(md.results.StressbalanceSolution.Vx),...
Index: /issm/trunk/test/NightlyRun/test203.py
===================================================================
--- /issm/trunk/test/NightlyRun/test203.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test203.py	(revision 24313)
@@ -3,5 +3,4 @@
 from model import *
 from socket import gethostname
-import numpy as np
 from triangle import *
 from setmask import *
@@ -11,22 +10,20 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',180000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,2.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 
 # Fields and tolerances to track changes
 
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[2e-09,1e-09,1e-09,1e-09,1e-09]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [2e-09, 2e-09, 1e-09, 2e-09, 1e-09]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test204.py
===================================================================
--- /issm/trunk/test/NightlyRun/test204.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test204.py	(revision 24313)
@@ -3,5 +3,4 @@
 from model import *
 from socket import gethostname
-import numpy as np
 from triangle import *
 from setmask import *
@@ -11,26 +10,24 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',180000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,2.)
-md=setflowequation(md,'FS','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.stressbalance.shelf_dampening=1
-md.timestepping.time_step=0
-md1=solve(md,'Stressbalance')
-md.stressbalance.shelf_dampening=0
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'FS', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.stressbalance.shelf_dampening = 1
+md.timestepping.time_step = 0
+md1 = solve(md, 'Stressbalance')
+md.stressbalance.shelf_dampening = 0
+md = solve(md, 'Stressbalance')
 
 
 # Fields and tolerances to track changes
 
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-08,1e-08,4e-06,1e-08,1e-08]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-08, 1e-08, 4e-06, 1e-08, 1e-08]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test205.js
===================================================================
--- /issm/trunk/test/NightlyRun/test205.js	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test205.js	(revision 24313)
@@ -6,4 +6,5 @@
 md.extrude(md,3,2.);
 setflowequation(md,'HO','../Exp/SquareHalfRight.exp','fill','SSA','coupling','penalties');
+md.settings.solver_residue_threshold = 1.e-4;
 //md.cluster=generic('name',oshostname(),'np',3);
 md=solve(md,'Stressbalance');
Index: /issm/trunk/test/NightlyRun/test205.m
===================================================================
--- /issm/trunk/test/NightlyRun/test205.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test205.m	(revision 24313)
@@ -5,4 +5,5 @@
 md=extrude(md,3,2.);
 md=setflowequation(md,'HO','../Exp/SquareHalfRight.exp','fill','SSA','coupling','penalties');
+md.settings.solver_residue_threshold = 1.e-4;
 md.cluster=generic('name',oshostname(),'np',3);
 md=solve(md,'Stressbalance');
Index: /issm/trunk/test/NightlyRun/test205.py
===================================================================
--- /issm/trunk/test/NightlyRun/test205.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test205.py	(revision 24313)
@@ -3,5 +3,4 @@
 from model import *
 from socket import gethostname
-import numpy as np
 from triangle import *
 from setmask import *
@@ -11,22 +10,21 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',150000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,2.)
-md=setflowequation(md,'HO','../Exp/SquareHalfRight.exp','fill','SSA','coupling','penalties')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'HO', '../Exp/SquareHalfRight.exp', 'fill', 'SSA', 'coupling', 'penalties')
+md.settings.solver_residue_threshold = 1.e-4
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 
 # Fields and tolerances to track changes
 
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[2e-05,2e-05,1e-05,1e-05,1e-05]
-field_values=[\
-md.results.StressbalanceSolution.Vx,\
-md.results.StressbalanceSolution.Vy,\
-md.results.StressbalanceSolution.Vz,\
-md.results.StressbalanceSolution.Vel,\
-md.results.StressbalanceSolution.Pressure,\
-]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [2e-05, 2e-05, 1e-05, 1e-05, 1e-05]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test2051.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2051.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2051.py	(revision 24313)
@@ -8,30 +8,28 @@
 from parameterize import *
 
-# Benchmark experiments (Figure A2a Ivins and James, 1999, Geophys. J. Int.) 
-md = triangle(model(),'../Exp/RoundFrontEISMINT.exp',200000.)
-md = setmask(md,'','')
-md = parameterize(md,'../Par/GiaIvinsBenchmarksAB.py')
+# Benchmark experiments (Figure A2a Ivins and James, 1999, Geophys. J. Int.)
+md = triangle(model(), '../Exp/RoundFrontEISMINT.exp', 200000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/GiaIvinsBenchmarksAB.py')
 
-# indicate what you want to compute 
-md.gia.cross_section_shape = 1 # for square-edged x-section 
+# indicate what you want to compute
+md.gia.cross_section_shape = 1  # for square-edged x - section
 
-# define loading history 
-md.timestepping.start_time = 2002100 # after 2 kyr of deglaciation 
-md.timestepping.final_time = 2500000 # 2,500 kyr
-md.geometry.thickness = np.array([
-	np.append(md.geometry.thickness * 0.0 ,0.0),
-	np.append(md.geometry.thickness, 1000),
-	np.append(md.geometry.thickness, 2000000),
-	np.append(md.geometry.thickness * 0.0, 2000100),
-	np.append(md.geometry.thickness * 0.0, md.timestepping.start_time)
-	]).T
+# define loading history
+md.timestepping.start_time = 2002100  # after 2 kyr of deglaciation
+md.timestepping.final_time = 2500000  # 2, 500 kyr
+md.geometry.thickness = np.array([np.append(md.geometry.thickness * 0.0, 0.0),
+                                  np.append(md.geometry.thickness, 1000),
+                                  np.append(md.geometry.thickness, 2000000),
+                                  np.append(md.geometry.thickness * 0.0, 2000100),
+                                  np.append(md.geometry.thickness * 0.0, md.timestepping.start_time)]).T
 
-# solve for GIA deflection 
-md.cluster=generic('name',gethostname(),'np',3)
+# solve for GIA deflection
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.verbose = verbose('1111111')
-md = solve(md,'Gia')
+md = solve(md, 'Gia')
 
 #Fields and tolerances to track changes
-field_names      = ['GiaW','GiadWdt']
-field_tolerances = [1e-13,1e-13]
+field_names = ['GiaW', 'GiadWdt']
+field_tolerances = [1e-13, 1e-13]
 field_values = [md.results.GiaSolution.GiaW, md.results.GiaSolution.GiadWdt]
Index: /issm/trunk/test/NightlyRun/test2052.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2052.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2052.py	(revision 24313)
@@ -8,30 +8,28 @@
 from parameterize import *
 
-#Benchmark experiments (Figure A2a Ivins and James, 1999, Geophys. J. Int.) 
-md = triangle(model(),'../Exp/RoundFrontEISMINT.exp',200000)
-md = setmask(md,'','')
-md = parameterize(md,'../Par/GiaIvinsBenchmarksAB.py')
+#Benchmark experiments (Figure A2a Ivins and James, 1999, Geophys. J. Int.)
+md = triangle(model(), '../Exp/RoundFrontEISMINT.exp', 200000)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/GiaIvinsBenchmarksAB.py')
 
-#indicate what you want to compute 
-md.gia.cross_section_shape = 1    # for square-edged x-section 
+#indicate what you want to compute
+md.gia.cross_section_shape = 1  # for square-edged x - section
 
-#define loading history 
-md.timestepping.start_time = 2005100 # after 5 kyr of deglaciation 
-md.timestepping.final_time = 2500000 # 2,500 kyr
-md.geometry.thickness = np.array([
-	np.append(md.geometry.thickness * 0.0 ,0.0),
-	np.append(md.geometry.thickness, 1000),
-	np.append(md.geometry.thickness, 2000000),
-	np.append(md.geometry.thickness * 0.0, 2000100),
-	np.append(md.geometry.thickness * 0.0, md.timestepping.start_time)
-	]).T
+#define loading history
+md.timestepping.start_time = 2005100  # after 5 kyr of deglaciation
+md.timestepping.final_time = 2500000  # 2, 500 kyr
+md.geometry.thickness = np.array([np.append(md.geometry.thickness * 0.0, 0.0),
+                                  np.append(md.geometry.thickness, 1000),
+                                  np.append(md.geometry.thickness, 2000000),
+                                  np.append(md.geometry.thickness * 0.0, 2000100),
+                                  np.append(md.geometry.thickness * 0.0, md.timestepping.start_time)]).T
 
-#solve for GIA deflection 
-md.cluster = generic('name',gethostname(),'np',3)
+#solve for GIA deflection
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.verbose = verbose('1111111')
-md = solve(md,'Gia')
+md = solve(md, 'Gia')
 
 #Fields and tolerances to track changes
-field_names      = ['GiaW','GiadWdt']
-field_tolerances = [1e-13,1e-13]
-field_values = [md.results.GiaSolution.GiaW,md.results.GiaSolution.GiadWdt]
+field_names = ['GiaW', 'GiadWdt']
+field_tolerances = [1e-13, 1e-13]
+field_values = [md.results.GiaSolution.GiaW, md.results.GiaSolution.GiadWdt]
Index: /issm/trunk/test/NightlyRun/test2053.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2053.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2053.py	(revision 24313)
@@ -8,30 +8,28 @@
 from parameterize import *
 
-#Benchmark experiments (Figure A2a Ivins and James, 1999, Geophys. J. Int.) 
-md = triangle(model(),'../Exp/RoundFrontEISMINT.exp',200000)
-md = setmask(md,'','')
-md = parameterize(md,'../Par/GiaIvinsBenchmarksAB.py')
+#Benchmark experiments (Figure A2a Ivins and James, 1999, Geophys. J. Int.)
+md = triangle(model(), '../Exp/RoundFrontEISMINT.exp', 200000)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/GiaIvinsBenchmarksAB.py')
 
-#indicate what you want to compute 
-md.gia.cross_section_shape = 1    # for square-edged x-section 
+#indicate what you want to compute
+md.gia.cross_section_shape = 1  # for square-edged x - section
 
-#define loading history 
-md.timestepping.start_time = 2010100 # after 10 kyr of deglaciation 
-md.timestepping.final_time = 2500000 # 2,500 kyr
-md.geometry.thickness = np.array([
-	np.append(md.geometry.thickness * 0.0 ,0.0),
-	np.append(md.geometry.thickness, 1000),
-	np.append(md.geometry.thickness, 2000000),
-	np.append(md.geometry.thickness * 0.0, 2000100),
-	np.append(md.geometry.thickness * 0.0, md.timestepping.start_time)
-	]).T
+#define loading history
+md.timestepping.start_time = 2010100  # after 10 kyr of deglaciation
+md.timestepping.final_time = 2500000  # 2, 500 kyr
+md.geometry.thickness = np.array([np.append(md.geometry.thickness * 0.0, 0.0),
+                                  np.append(md.geometry.thickness, 1000),
+                                  np.append(md.geometry.thickness, 2000000),
+                                  np.append(md.geometry.thickness * 0.0, 2000100),
+                                  np.append(md.geometry.thickness * 0.0, md.timestepping.start_time)]).T
 
-#solve for GIA deflection 
-md.cluster = generic('name',gethostname(),'np',3)
+#solve for GIA deflection
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.verbose = verbose('1111111')
-md = solve(md,'Gia')
+md = solve(md, 'Gia')
 
 #Fields and tolerances to track changes
-field_names      = ['GiaW','GiadWdt']
-field_tolerances = [1e-13,1e-13]
-field_values = [md.results.GiaSolution.GiaW,md.results.GiaSolution.GiadWdt]
+field_names = ['GiaW', 'GiadWdt']
+field_tolerances = [1e-13, 1e-13]
+field_values = [md.results.GiaSolution.GiaW, md.results.GiaSolution.GiadWdt]
Index: /issm/trunk/test/NightlyRun/test206.py
===================================================================
--- /issm/trunk/test/NightlyRun/test206.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test206.py	(revision 24313)
@@ -3,5 +3,4 @@
 from model import *
 from socket import gethostname
-import numpy as np
 from triangle import *
 from setmask import *
@@ -11,18 +10,17 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',180000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.timestepping.time_step=0
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Thermal')
+md = triangle(model(), '../Exp/Square.exp', 180000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.timestepping.time_step = 0
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Thermal')
 
 
 # Fields and tolerances to track changes
 
-field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-13,5e-6]
-field_values=[md.results.ThermalSolution.Temperature,
-							md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate]
+field_names = ['Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-13, 5e-6]
+field_values = [md.results.ThermalSolution.Temperature, md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test207.py
===================================================================
--- /issm/trunk/test/NightlyRun/test207.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test207.py	(revision 24313)
@@ -3,5 +3,4 @@
 from model import *
 from socket import gethostname
-import numpy as np
 from triangle import *
 from setmask import *
@@ -11,26 +10,24 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',180000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.transient.isstressbalance=False
-md.transient.ismasstransport=False
-md.transient.issmb=True
-md.transient.isthermal=True
-md.transient.isgroundingline=False
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 180000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.isstressbalance = False
+md.transient.ismasstransport = False
+md.transient.issmb = True
+md.transient.isthermal = True
+md.transient.isgroundingline = False
+md = solve(md, 'Transient')
 
 # Fields and tolerances to track changes
-field_names     =['Temperature1','BasalforcingsGroundediceMeltingRate1','Temperature2','BasalforcingsGroundediceMeltingRate2','Temperature3','BasalforcingsGroundediceMeltingRate3']
-field_tolerances=[1e-13,1e-6,1e-13,1e-6,1e-13,1e-6]
-field_values=[\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[2].Temperature,\
-	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Temperature1', 'BasalforcingsGroundediceMeltingRate1', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2', 'Temperature3', 'BasalforcingsGroundediceMeltingRate3']
+field_tolerances = [1e-13, 1e-6, 1e-13, 1e-6, 1e-13, 1e-6]
+field_values = [md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test2071.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2071.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2071.py	(revision 24313)
@@ -8,29 +8,27 @@
 from parameterize import *
 
-#Benchmark experiments (Figure A2c Ivins and James, 1999, Geophys. J. Int.) 
-md = triangle(model(),'../Exp/RoundFrontEISMINT.exp',200000)
-md = setmask(md,'','')
-md = parameterize(md,'../Par/GiaIvinsBenchmarksCD.py')
+#Benchmark experiments (Figure A2c Ivins and James, 1999, Geophys. J. Int.)
+md = triangle(model(), '../Exp/RoundFrontEISMINT.exp', 200000)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/GiaIvinsBenchmarksCD.py')
 
-#indicate what you want to compute 
-md.gia.cross_section_shape = 1 # for square-edged x-section 
+#indicate what you want to compute
+md.gia.cross_section_shape = 1  # for square-edged x - section
 
-#define loading history 
-md.timestepping.start_time = 0.3 # for t \approx 0 kyr : to get eleastic response!   
-md.timestepping.final_time = 2500000 # 2,500 kyr
-md.geometry.thickness = np.array([
-	np.append(md.geometry.thickness * 0.0, 0.0),
-	np.append(md.geometry.thickness / 2.0, 0.1),
-	np.append(md.geometry.thickness, 0.2),
-	np.append(md.geometry.thickness, md.timestepping.start_time)
-	]).T
+#define loading history
+md.timestepping.start_time = 0.3  # for t \approx 0 kyr : to get eleastic response!
+md.timestepping.final_time = 2500000  # 2, 500 kyr
+md.geometry.thickness = np.array([np.append(md.geometry.thickness * 0.0, 0.0),
+                                  np.append(md.geometry.thickness / 2.0, 0.1),
+                                  np.append(md.geometry.thickness, 0.2),
+                                  np.append(md.geometry.thickness, md.timestepping.start_time)]).T
 
-#solve for GIA deflection 
-md.cluster = generic('name',gethostname(),'np',3)
+#solve for GIA deflection
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.verbose = verbose('1111111')
-md = solve(md,'Gia')
+md = solve(md, 'Gia')
 
 #Fields and tolerances to track changes
-field_names      = ['GiaW','GiadWdt']
-field_tolerances = [1e-13,1e-13]
+field_names = ['GiaW', 'GiadWdt']
+field_tolerances = [1e-13, 1e-13]
 field_values = [md.results.GiaSolution.GiaW, md.results.GiaSolution.GiadWdt]
Index: /issm/trunk/test/NightlyRun/test2072.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2072.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2072.py	(revision 24313)
@@ -8,29 +8,27 @@
 from parameterize import *
 
-#Benchmark experiments (Figure A2c Ivins and James, 1999, Geophys. J. Int.) 
-md = triangle(model(),'../Exp/RoundFrontEISMINT.exp',200000)
-md = setmask(md,'','')
-md = parameterize(md,'../Par/GiaIvinsBenchmarksCD.py')
+#Benchmark experiments (Figure A2c Ivins and James, 1999, Geophys. J. Int.)
+md = triangle(model(), '../Exp/RoundFrontEISMINT.exp', 200000)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/GiaIvinsBenchmarksCD.py')
 
-#indicate what you want to compute 
-md.gia.cross_section_shape = 1 # for square-edged x-section 
+#indicate what you want to compute
+md.gia.cross_section_shape = 1  # for square-edged x - section
 
-#define loading history 
-md.timestepping.start_time = 1000.3 # for t \approx 1 kyr   
-md.timestepping.final_time = 2500000 # 2,500 kyr
-md.geometry.thickness = np.array([
-	np.append(md.geometry.thickness * 0.0, 0.0),
-	np.append(md.geometry.thickness / 2.0, 0.1),
-	np.append(md.geometry.thickness, 0.2),
-	np.append(md.geometry.thickness, md.timestepping.start_time)
-	]).T
+#define loading history
+md.timestepping.start_time = 1000.3  # for t \approx 1 kyr
+md.timestepping.final_time = 2500000  # 2, 500 kyr
+md.geometry.thickness = np.array([np.append(md.geometry.thickness * 0.0, 0.0),
+                                  np.append(md.geometry.thickness / 2.0, 0.1),
+                                  np.append(md.geometry.thickness, 0.2),
+                                  np.append(md.geometry.thickness, md.timestepping.start_time)]).T
 
-#solve for GIA deflection 
-md.cluster = generic('name',gethostname(),'np',3)
+#solve for GIA deflection
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.verbose = verbose('1111111')
-md = solve(md,'Gia')
+md = solve(md, 'Gia')
 
 #Fields and tolerances to track changes
-field_names      = ['GiaW','GiadWdt']
-field_tolerances = [1e-13,1e-13]
+field_names = ['GiaW', 'GiadWdt']
+field_tolerances = [1e-13, 1e-13]
 field_values = [md.results.GiaSolution.GiaW, md.results.GiaSolution.GiadWdt]
Index: /issm/trunk/test/NightlyRun/test2073.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2073.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2073.py	(revision 24313)
@@ -8,29 +8,27 @@
 from parameterize import *
 
-#Benchmark experiments (Figure A2c Ivins and James, 1999, Geophys. J. Int.) 
-md = triangle(model(),'../Exp/RoundFrontEISMINT.exp',200000)
-md = setmask(md,'','')
-md = parameterize(md,'../Par/GiaIvinsBenchmarksCD.py')
+#Benchmark experiments (Figure A2c Ivins and James, 1999, Geophys. J. Int.)
+md = triangle(model(), '../Exp/RoundFrontEISMINT.exp', 200000)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/GiaIvinsBenchmarksCD.py')
 
-#indicate what you want to compute 
-md.gia.cross_section_shape = 1 # for square-edged x-section 
+#indicate what you want to compute
+md.gia.cross_section_shape = 1  # for square-edged x - section
 
-#define loading history 
-md.timestepping.start_time = 2400000 # for t \approx \infty  
-md.timestepping.final_time = 2500000 # 2,500 kyr
-md.geometry.thickness = np.array([
-	np.append(md.geometry.thickness * 0.0, 0.0),
-	np.append(md.geometry.thickness / 2.0, 0.1),
-	np.append(md.geometry.thickness, 0.2),
-	np.append(md.geometry.thickness, md.timestepping.start_time)
-	]).T
+#define loading history
+md.timestepping.start_time = 2400000  # for t \approx \infty
+md.timestepping.final_time = 2500000  # 2, 500 kyr
+md.geometry.thickness = np.array([np.append(md.geometry.thickness * 0.0, 0.0),
+                                  np.append(md.geometry.thickness / 2.0, 0.1),
+                                  np.append(md.geometry.thickness, 0.2),
+                                  np.append(md.geometry.thickness, md.timestepping.start_time)]).T
 
-#solve for GIA deflection 
-md.cluster = generic('name',gethostname(),'np',3)
+#solve for GIA deflection
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.verbose = verbose('1111111')
-md = solve(md,'Gia')
+md = solve(md, 'Gia')
 
 #Fields and tolerances to track changes
-field_names      = ['GiaW','GiadWdt']
-field_tolerances = [1e-13,1e-13]
+field_names = ['GiaW', 'GiadWdt']
+field_tolerances = [1e-13, 1e-13]
 field_values = [md.results.GiaSolution.GiaW, md.results.GiaSolution.GiadWdt]
Index: /issm/trunk/test/NightlyRun/test208.py
===================================================================
--- /issm/trunk/test/NightlyRun/test208.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test208.py	(revision 24313)
@@ -3,5 +3,4 @@
 from model import *
 from socket import gethostname
-import numpy as np
 from triangle import *
 from setmask import *
@@ -11,45 +10,53 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',150000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.basalforcings.floatingice_melting_rate[:]=1.
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.transient.requested_outputs=['default','FloatingArea','GroundedArea','TotalFloatingBmb','TotalGroundedBmb']
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.basalforcings.floatingice_melting_rate[:] = 1.
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.requested_outputs = ['default', 'FloatingArea', 'GroundedArea', 'TotalFloatingBmb', 'TotalGroundedBmb']
+md = solve(md, 'Transient')
 
 
 # Fields and tolerances to track changes
 
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','TotalGroundedBmb1','TotalFloatingBmb1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','TotalGroundedBmb2','TotalFloatingBmb2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','TotalGroundedBmb3','TotalFloatingBmb3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].TotalGroundedBmb,\
-	md.results.TransientSolution[0].TotalFloatingBmb,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].TotalGroundedBmb,\
-	md.results.TransientSolution[1].TotalFloatingBmb,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].TotalGroundedBmb,\
-	md.results.TransientSolution[2].TotalFloatingBmb,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1',
+               'Bed1', 'Surface1', 'Thickness1', 'TotalGroundedBmb1', 'TotalFloatingBmb1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2',
+               'Bed2', 'Surface2', 'Thickness2', 'TotalGroundedBmb2', 'TotalFloatingBmb2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3',
+               'Bed3', 'Surface3', 'Thickness3', 'TotalGroundedBmb3', 'TotalFloatingBmb3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].TotalGroundedBmb,
+                md.results.TransientSolution[0].TotalFloatingBmb,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].TotalGroundedBmb,
+                md.results.TransientSolution[1].TotalFloatingBmb,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].TotalGroundedBmb,
+                md.results.TransientSolution[2].TotalFloatingBmb]
Index: /issm/trunk/test/NightlyRun/test2081.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2081.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2081.py	(revision 24313)
@@ -8,29 +8,27 @@
 from parameterize import *
 
-#Benchmark experiments (Figure A2c Ivins and James, 1999, Geophys. J. Int.) 
-md = triangle(model(),'../Exp/RoundFrontEISMINT.exp',200000)
-md = setmask(md,'','')
-md = parameterize(md,'../Par/GiaIvinsBenchmarksCD.py')
+#Benchmark experiments (Figure A2c Ivins and James, 1999, Geophys. J. Int.)
+md = triangle(model(), '../Exp/RoundFrontEISMINT.exp', 200000)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/GiaIvinsBenchmarksCD.py')
 
-#indicate what you want to compute 
-md.gia.cross_section_shape = 2 # for square-edged x-section 
+#indicate what you want to compute
+md.gia.cross_section_shape = 2  # for square-edged x - section
 
-#define loading history 
-md.timestepping.start_time = 0.3 # for t \approx 0 kyr : to get eleastic response!  
-md.timestepping.final_time = 2500000 # 2,500 kyr
-md.geometry.thickness = np.array([
-	np.append(md.geometry.thickness * 0.0, 0.0),
-	np.append(md.geometry.thickness / 2.0, 0.1),
-	np.append(md.geometry.thickness, 0.2),
-	np.append(md.geometry.thickness, md.timestepping.start_time)
-	]).T
+#define loading history
+md.timestepping.start_time = 0.3  # for t \approx 0 kyr : to get eleastic response!
+md.timestepping.final_time = 2500000  # 2, 500 kyr
+md.geometry.thickness = np.array([np.append(md.geometry.thickness * 0.0, 0.0),
+                                  np.append(md.geometry.thickness / 2.0, 0.1),
+                                  np.append(md.geometry.thickness, 0.2),
+                                  np.append(md.geometry.thickness, md.timestepping.start_time)]).T
 
-#solve for GIA deflection 
-md.cluster = generic('name',gethostname(),'np',3)
+#solve for GIA deflection
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.verbose = verbose('1111111')
-md = solve(md,'Gia')
+md = solve(md, 'Gia')
 
 #Fields and tolerances to track changes
-field_names      = ['GiaW','GiadWdt']
-field_tolerances = [1e-13,1e-13]
+field_names = ['GiaW', 'GiadWdt']
+field_tolerances = [1e-13, 1e-13]
 field_values = [md.results.GiaSolution.GiaW, md.results.GiaSolution.GiadWdt]
Index: /issm/trunk/test/NightlyRun/test2082.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2082.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2082.py	(revision 24313)
@@ -8,29 +8,27 @@
 from parameterize import *
 
-#Benchmark experiments (Figure A2c Ivins and James, 1999, Geophys. J. Int.) 
-md = triangle(model(),'../Exp/RoundFrontEISMINT.exp',200000)
-md = setmask(md,'','')
-md = parameterize(md,'../Par/GiaIvinsBenchmarksCD.py')
+#Benchmark experiments (Figure A2c Ivins and James, 1999, Geophys. J. Int.)
+md = triangle(model(), '../Exp/RoundFrontEISMINT.exp', 200000)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/GiaIvinsBenchmarksCD.py')
 
-#indicate what you want to compute 
-md.gia.cross_section_shape = 2 # for square-edged x-section 
+#indicate what you want to compute
+md.gia.cross_section_shape = 2  # for square-edged x - section
 
-#define loading history 
-md.timestepping.start_time = 1000.3 # for t \approx 1 kyr  
-md.timestepping.final_time = 2500000 # 2,500 kyr
-md.geometry.thickness = np.array([
-	np.append(md.geometry.thickness * 0.0, 0.0),
-	np.append(md.geometry.thickness / 2.0, 0.1),
-	np.append(md.geometry.thickness, 0.2),
-	np.append(md.geometry.thickness, md.timestepping.start_time)
-	]).T
+#define loading history
+md.timestepping.start_time = 1000.3  # for t \approx 1 kyr
+md.timestepping.final_time = 2500000  # 2, 500 kyr
+md.geometry.thickness = np.array([np.append(md.geometry.thickness * 0.0, 0.0),
+                                  np.append(md.geometry.thickness / 2.0, 0.1),
+                                  np.append(md.geometry.thickness, 0.2),
+                                  np.append(md.geometry.thickness, md.timestepping.start_time)]).T
 
-#solve for GIA deflection 
-md.cluster = generic('name',gethostname(),'np',3)
+#solve for GIA deflection
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.verbose = verbose('1111111')
-md = solve(md,'Gia')
+md = solve(md, 'Gia')
 
 #Fields and tolerances to track changes
-field_names      = ['GiaW','GiadWdt']
-field_tolerances = [1e-13,1e-13]
+field_names = ['GiaW', 'GiadWdt']
+field_tolerances = [1e-13, 1e-13]
 field_values = [md.results.GiaSolution.GiaW, md.results.GiaSolution.GiadWdt]
Index: /issm/trunk/test/NightlyRun/test2083.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2083.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2083.py	(revision 24313)
@@ -8,29 +8,27 @@
 from parameterize import *
 
-#Benchmark experiments (Figure A2c Ivins and James, 1999, Geophys. J. Int.) 
-md = triangle(model(),'../Exp/RoundFrontEISMINT.exp',200000)
-md = setmask(md,'','')
-md = parameterize(md,'../Par/GiaIvinsBenchmarksCD.py')
+#Benchmark experiments (Figure A2c Ivins and James, 1999, Geophys. J. Int.)
+md = triangle(model(), '../Exp/RoundFrontEISMINT.exp', 200000)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/GiaIvinsBenchmarksCD.py')
 
-#indicate what you want to compute 
-md.gia.cross_section_shape = 2 # for square-edged x-section 
+#indicate what you want to compute
+md.gia.cross_section_shape = 2  # for square-edged x - section
 
-#define loading history 
-md.timestepping.start_time = 2400000 # for t \approx \infty  
-md.timestepping.final_time = 2500000 # 2,500 kyr
-md.geometry.thickness = np.array([
-	np.append(md.geometry.thickness * 0.0, 0.0),
-	np.append(md.geometry.thickness / 2.0, 0.1),
-	np.append(md.geometry.thickness, 0.2),
-	np.append(md.geometry.thickness, md.timestepping.start_time)
-	]).T
+#define loading history
+md.timestepping.start_time = 2400000  # for t \approx \infty
+md.timestepping.final_time = 2500000  # 2, 500 kyr
+md.geometry.thickness = np.array([np.append(md.geometry.thickness * 0.0, 0.0),
+                                  np.append(md.geometry.thickness / 2.0, 0.1),
+                                  np.append(md.geometry.thickness, 0.2),
+                                  np.append(md.geometry.thickness, md.timestepping.start_time)]).T
 
-#solve for GIA deflection 
-md.cluster = generic('name',gethostname(),'np',3)
+#solve for GIA deflection
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.verbose = verbose('1111111')
-md = solve(md,'Gia')
+md = solve(md, 'Gia')
 
 #Fields and tolerances to track changes
-field_names      = ['GiaW','GiadWdt']
-field_tolerances = [1e-13,1e-13]
+field_names = ['GiaW', 'GiadWdt']
+field_tolerances = [1e-13, 1e-13]
 field_values = [md.results.GiaSolution.GiaW, md.results.GiaSolution.GiadWdt]
Index: /issm/trunk/test/NightlyRun/test2084.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2084.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2084.py	(revision 24313)
@@ -1,9 +1,9 @@
 #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.,
+#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
+#185: 106 - 132. doi:10.1111 / j.1365 - 246X.2011.04952.x
 
 from model import *
@@ -14,188 +14,178 @@
 from materials import *
 
-md=model()
-md.cluster=generic('name',gethostname(),'np',1)
+md = model()
+md.cluster = generic('name', gethostname(), 'np', 1)
 
-md.materials=materials('litho')
-md.miscellaneous.name='FourierLoveTest'
-md.groundingline.migration='None'
+md.materials = materials('litho')
+md.miscellaneous.name = 'FourierLoveTest'
+md.groundingline.migration = 'None'
 
-md.verbose=verbose('all')
-cst=365.25*24*3600*1000
+md.verbose = verbose('all')
+cst = 365.25 * 24 * 3600 * 1000
 
-md.materials.numlayers=6
-md.materials.radius=np.array([10,1222.5,3.4800e+03,5.7010e+03,5.9510e+03,
-				6.3010e+03,6.3710e+03]).reshape(-1,1)*1e3
-md.materials.density=np.array([1.0750e4,1.0750e+04,4.9780e+03,3.8710e+03,
-				3.4380e+03,3.0370e+03]).reshape(-1,1)
-md.materials.lame_mu=np.array([1e-5,0,2.2834e+00,1.0549e+00,7.0363e-01,
-				5.0605e-01]).reshape(-1,1)*1e11
-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.issolid=np.array([1,0,1,1,1,1]).reshape(-1,1)
-md.materials.isburgers=np.zeros((md.materials.numlayers,1))
+md.materials.numlayers = 6
+md.materials.radius = np.array([10, 1222.5, 3.4800e+03, 5.7010e+03, 5.9510e+03,
+                                6.3010e+03, 6.3710e+03]).reshape(-1, 1) * 1e3
+md.materials.density = np.array([1.0750e4, 1.0750e+04, 4.9780e+03, 3.8710e+03,
+                                3.4380e+03, 3.0370e+03]).reshape(-1, 1)
+md.materials.lame_mu = np.array([1e-5, 0, 2.2834e+00, 1.0549e+00, 7.0363e-01,
+                                5.0605e-01]).reshape(-1, 1) * 1e11
+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.issolid = np.array([1, 0, 1, 1, 1, 1]).reshape(-1, 1)
+md.materials.isburgers = np.zeros((md.materials.numlayers, 1))
 
-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.sh_nmax=256
+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.sh_nmax = 256
 
-md.materials.burgers_mu=md.materials.lame_mu
-md.materials.burgers_viscosity=md.materials.viscosity
+md.materials.burgers_mu = md.materials.lame_mu
+md.materials.burgers_viscosity = md.materials.viscosity
 
-md=solve(md,'lv')
+md = solve(md, 'lv')
 
 #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]
-]
+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
-md.love.nfreq=len(md.love.frequencies)
-md.love.sh_nmax=256
-md.materials.burgers_mu=md.materials.lame_mu
-md.materials.burgers_viscosity=md.materials.viscosity
+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
+md.love.nfreq = len(md.love.frequencies)
+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 = solve(md, 'lv')
 
 #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_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)]
 
-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.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 = solve(md, 'lv')
 
 #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:]
-]
+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
-#data=load('../Data/PREM_500layers')
-#md.love.sh_nmin=1
-#md.materials.radius=data(2:end-2,1)
-#md.materials.density=data(3:end-2,2)
-#md.materials.lame_lambda=data(3:end-2,3)
-#md.materials.lame_mu=data(3:end-2,4)
-#md.materials.issolid=data(3:end-2,4)>0
-#ind=find(md.materials.issolid==0)
-#md.materials.density(ind(1))=sum((md.materials.radius(ind+1).^3-md.materials.radius(ind).^3).*md.materials.density(ind))/(md.materials.radius(ind(end)+1).^3-md.materials.radius(ind(1)+1).^3)
-#md.materials.lame_lambda(ind(1))=sum((md.materials.radius(ind+1).^3-md.materials.radius(ind).^3).*md.materials.lame_lambda(ind))/(md.materials.radius(ind(end)+1).^3-md.materials.radius(ind(1)+1).^3)
-#md.materials.lame_mu(ind(1))=sum((md.materials.radius(ind+1).^3-md.materials.radius(ind).^3).*md.materials.lame_mu(ind))/(md.materials.radius(ind(end)+1).^3-md.materials.radius(ind(1)).^3)
-#md.materials.radius(ind(2:end)+1)=[]
-#md.materials.density(ind(2:end))=[]
-#md.materials.lame_lambda(ind(2:end))=[]
-#md.materials.lame_mu(ind(2:end))=[]
-#md.materials.issolid(ind(2:end))=[]
-#md.materials.viscosity=10.^interp1([0 3479e3 3480e3 3680e3 5720e3 5800e3 6270e3 6371e3], log10([1e8 1e8 5e21 1e23 1e22 1e20 1e21 1e40]), md.materials.radius(2:end),'PCHIP')
-#md.materials.viscosity=md.materials.viscosity.*md.materials.issolid
-#md.materials.burgers_mu=md.materials.lame_mu
-#md.materials.burgers_viscosity=md.materials.viscosity
-#md.materials.isburgers=md.materials.issolid*0
-#md.love.forcing_type=11
-#md.materials.numlayers=len(md.materials.viscosity)
-#md=solve(md,'lv')
+#Many layers PREM - based model
+#data = load('../Data/PREM_500layers')
+#md.love.sh_nmin = 1
+#md.materials.radius = data(2:end - 2, 1)
+#md.materials.density = data(3:end - 2, 2)
+#md.materials.lame_lambda = data(3:end - 2, 3)
+#md.materials.lame_mu = data(3:end - 2, 4)
+#md.materials.issolid = data(3:end - 2, 4) > 0
+#ind = find(md.materials.issolid = 0)
+#md.materials.density(ind(1))=sum((md.materials.radius(ind + 1).^3 - md.materials.radius(ind).^3). * md.materials.density(ind)) / (md.materials.radius(ind(end) + 1).^3 - md.materials.radius(ind(1) + 1).^3)
+#md.materials.lame_lambda(ind(1))=sum((md.materials.radius(ind + 1).^3 - md.materials.radius(ind).^3). * md.materials.lame_lambda(ind)) / (md.materials.radius(ind(end) + 1).^3 - md.materials.radius(ind(1) + 1).^3)
+#md.materials.lame_mu(ind(1))=sum((md.materials.radius(ind + 1).^3 - md.materials.radius(ind).^3). * md.materials.lame_mu(ind)) / (md.materials.radius(ind(end) + 1).^3 - md.materials.radius(ind(1)).^3)
+#md.materials.radius(ind(2:end) + 1) = []
+#md.materials.density(ind(2:end)) = []
+#md.materials.lame_lambda(ind(2:end)) = []
+#md.materials.lame_mu(ind(2:end)) = []
+#md.materials.issolid(ind(2:end)) = []
+#md.materials.viscosity = 10.^interp1([0 3479e3 3480e3 3680e3 5720e3 5800e3 6270e3 6371e3], log10([1e8 1e8 5e21 1e23 1e22 1e20 1e21 1e40]), md.materials.radius(2:end), 'PCHIP')
+#md.materials.viscosity = md.materials.viscosity. * md.materials.issolid
+#md.materials.burgers_mu = md.materials.lame_mu
+#md.materials.burgers_viscosity = md.materials.viscosity
+#md.materials.isburgers = md.materials.issolid * 0
+#md.love.forcing_type = 11
+#md.materials.numlayers = len(md.materials.viscosity)
+#md = solve(md, 'lv')
 #
-#field_names=[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=[field_tolerances,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9,4.3e-9]
-#field_values=[field_values,\
-#	(md.results.LoveSolution.LoveHr[:][0]),\
-#	(md.results.LoveSolution.LoveKr[:][0]),\
-#	(md.results.LoveSolution.LoveLr[:][0]),\
-#	(md.results.LoveSolution.LoveHr[:][1:]),\
-#	(md.results.LoveSolution.LoveKr[:][1:]),\
-#	(md.results.LoveSolution.LoveLr[:][1:]),\
-#	(md.results.LoveSolution.LoveHi[:][1:]),\
-#	(md.results.LoveSolution.LoveKi[:][1:]),\
-#	(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.
+#field_names = [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 = [field_tolerances, 4.3e-9, 4.3e-9, 4.3e-9, 4.3e-9, 4.3e-9, 4.3e-9, 4.3e-9, 4.3e-9, 4.3e-9]
+#field_values = [field_values,
+#       (md.results.LoveSolution.LoveHr[:][0]),
+#       (md.results.LoveSolution.LoveKr[:][0]),
+#       (md.results.LoveSolution.LoveLr[:][0]),
+#       (md.results.LoveSolution.LoveHr[:][1:]),
+#       (md.results.LoveSolution.LoveKr[:][1:]),
+#       (md.results.LoveSolution.LoveLr[:][1:]),
+#       (md.results.LoveSolution.LoveHi[:][1:]),
+#       (md.results.LoveSolution.LoveKi[:][1:]),
+#       (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.
 
-md.materials.radius=np.array([10,1222.5,3480.,3600.,3630.5,3700.,3900.,4000.,
-				4200.,4300.,4500.,4600.,4800.,4900.,5100.,5200.,
-				5400.,5500.,5600.5,5650.,5701.,5736.,5771.5,
-				5821.,5951.,5970.5,6016.,6061.,6150.5,6151.5,
-				6251.,6371.]).reshape(-1,1)*1e3
-md.materials.lame_mu=np.array([1e-5,0.,2.933,2.8990002,2.8550003,2.7340002,2.675,
-				2.559,2.502,2.388,2.331,2.215,2.157,2.039,1.979,
-				1.8560001,1.794,1.73,1.639,1.2390001,1.224,1.21,
-				1.128,0.97700006,0.906,0.79,0.773,0.741,0.656,0.665,
-				0.602]).reshape(-1,1)*1e11
-md.materials.density=np.array([10925.,10925.,5506.42,5491.45,5456.57,5357.06,
-				5307.24,5207.13,5156.69,5054.69,5002.99,4897.83,
-				4844.22,4734.6,4678.44,4563.07,4503.72,4443.16,
-				4412.41,3992.14,3983.99,3975.84,3912.82,3786.78,
-				3723.78,3516.39,3489.51,3435.78,3359.5,3367.1,
-				3184.3]).reshape(-1,1)
-md.materials.viscosity=np.array([0.,0.,7.999999999999999E+21,8.5E+21,
-				8.999999999999999E+21,3.E+22,4.E+22,
-				5.0000000000000004E+22,6.E+22,
-				5.0000000000000004E+22,4.5E+22,3.E+22,
-				2.5000000000000002E+22,1.7999999999999998E+22,
-				1.3E+22,7.999999999999999E+21,6.999999999999999E+21,
-				6.5E+21,6.E+21,5.5E+21,5.E+21,4.4999999999999995E+21,
-				3.9999999999999995E+21,2.5E+21,
-				1.9999999999999997E+21,1.5E+21,9.999999999999999E+20,
-				6.E+20,5.5000000000000007E+20,2.E+20,
-				1.E40]).reshape(-1,1)
-md.materials.lame_lambda=np.array(md.materials.lame_mu)*0+5e14
-md.materials.issolid=np.ones(len(md.materials.lame_mu)).reshape(-1,1)
-md.materials.issolid[1]=0
-md.materials.numlayers=len(md.materials.lame_mu)
-md.materials.burgers_mu=md.materials.lame_mu
-md.materials.burgers_viscosity=md.materials.viscosity
-md.materials.isburgers=md.materials.issolid*0
-md.love.forcing_type=11
-md.love.sh_nmin=1
-md.love.sh_nmax=100
+md.materials.radius = np.array([10, 1222.5, 3480., 3600., 3630.5, 3700., 3900., 4000.,
+                                4200., 4300., 4500., 4600., 4800., 4900., 5100., 5200.,
+                                5400., 5500., 5600.5, 5650., 5701., 5736., 5771.5,
+                                5821., 5951., 5970.5, 6016., 6061., 6150.5, 6151.5,
+                                6251., 6371.]).reshape(-1, 1) * 1e3
+md.materials.lame_mu = np.array([1e-5, 0., 2.933, 2.8990002, 2.8550003, 2.7340002, 2.675,
+                                2.559, 2.502, 2.388, 2.331, 2.215, 2.157, 2.039, 1.979,
+                                1.8560001, 1.794, 1.73, 1.639, 1.2390001, 1.224, 1.21,
+                                1.128, 0.97700006, 0.906, 0.79, 0.773, 0.741, 0.656, 0.665,
+                                0.602]).reshape(-1, 1) * 1e11
+md.materials.density = np.array([10925., 10925., 5506.42, 5491.45, 5456.57, 5357.06,
+                                5307.24, 5207.13, 5156.69, 5054.69, 5002.99, 4897.83,
+                                4844.22, 4734.6, 4678.44, 4563.07, 4503.72, 4443.16,
+                                4412.41, 3992.14, 3983.99, 3975.84, 3912.82, 3786.78,
+                                3723.78, 3516.39, 3489.51, 3435.78, 3359.5, 3367.1,
+                                3184.3]).reshape(-1, 1)
+md.materials.viscosity = np.array([0., 0., 7.999999999999999e+21, 8.5e+21,
+                                   8.999999999999999e+21, 3.e+22, 4.e+22,
+                                   5.0000000000000004e+22, 6.e+22,
+                                   5.0000000000000004e+22, 4.5e+22, 3.e+22,
+                                   2.5000000000000002e+22, 1.7999999999999998e+22,
+                                   1.3e+22, 7.999999999999999e+21, 6.999999999999999e+21,
+                                   6.5e+21, 6.e+21, 5.5e+21, 5.e+21, 4.4999999999999995e+21,
+                                   3.9999999999999995e+21, 2.5e+21,
+                                   1.9999999999999997e+21, 1.5e+21, 9.999999999999999e+20,
+                                   6.e+20, 5.5000000000000007e+20, 2.e+20,
+                                   1.E40]).reshape(-1, 1)
+md.materials.lame_lambda = np.array(md.materials.lame_mu) * 0 + 5e14
+md.materials.issolid = np.ones(len(md.materials.lame_mu)).reshape(-1, 1)
+md.materials.issolid[1] = 0
+md.materials.numlayers = len(md.materials.lame_mu)
+md.materials.burgers_mu = md.materials.lame_mu
+md.materials.burgers_viscosity = md.materials.viscosity
+md.materials.isburgers = md.materials.issolid * 0
+md.love.forcing_type = 11
+md.love.sh_nmin = 1
+md.love.sh_nmax = 100
 
-md=solve(md,'lv')
+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)
+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']
-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_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:]]
Index: /issm/trunk/test/NightlyRun/test2085.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2085.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2085.py	(revision 24313)
@@ -1,4 +1,4 @@
 #Test Name: LovenumberstAtDepth.
-#Same as test #1 of test2084.m 
+#Same as test  #1 of test2084.m
 
 from model import *
@@ -10,25 +10,25 @@
 
 md = model()
-md.cluster = generic('name',gethostname(),'np',1)
+md.cluster = generic('name', gethostname(), 'np', 1)
 
 md.materials = materials('litho')
 md.miscellaneous.name = 'FourierLoveTest'
-md.groundingline.migration='None'
+md.groundingline.migration = 'None'
 
 md.verbose = verbose('111111101')
-cst = 365.25*24*3600*1000
+cst = 365.25 * 24 * 3600 * 1000
 
 md.materials.numlayers = 6
-md.materials.radius = np.array([10,1222.5,3.4800e+03,5.7010e+03,5.9510e+03,6.3010e+03,6.3710e+03]).reshape(-1,1)*1e3
-md.materials.density = np.array([1.0750e4,1.0750e+04,4.9780e+03,3.8710e+03,3.4380e+03,3.0370e+03]).reshape(-1,1)
-md.materials.lame_mu = np.array([1e-5,0,2.2834e+00,1.0549e+00,7.0363e-01,5.0605e-01]).reshape(-1,1)*1e11
-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.issolid = np.array([1,0,1,1,1,1]).reshape(-1,1)
-md.materials.isburgers = np.zeros((md.materials.numlayers,))
+md.materials.radius = np.array([10, 1222.5, 3.4800e+03, 5.7010e+03, 5.9510e+03, 6.3010e+03, 6.3710e+03]).reshape(-1, 1) * 1e3
+md.materials.density = np.array([1.0750e4, 1.0750e+04, 4.9780e+03, 3.8710e+03, 3.4380e+03, 3.0370e+03]).reshape(-1, 1)
+md.materials.lame_mu = np.array([1e-5, 0, 2.2834e+00, 1.0549e+00, 7.0363e-01, 5.0605e-01]).reshape(-1, 1) * 1e11
+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.issolid = np.array([1, 0, 1, 1, 1, 1]).reshape(-1, 1)
+md.materials.isburgers = np.zeros((md.materials.numlayers)).reshape(-1, 1)
 
-md.love.love_kernels = 1 
+md.love.love_kernels = 1
 md.love.allow_layer_deletion = 1
-md.love.frequencies = (np.array([0])*2*pi).reshape(-1,1) / cst
+md.love.frequencies = (np.array([0]) * 2 * pi).reshape(-1, 1) / cst
 md.love.nfreq = len(md.love.frequencies)
 md.love.sh_nmax = 2
@@ -37,14 +37,13 @@
 md.materials.burgers_viscosity = md.materials.viscosity
 
-md = solve(md,'lv')
+md = solve(md, 'lv')
 
 #Fields and tolerances to track changes
 #loading love numbers
-field_names =  ['LoveH_loading_elastic','LoveK_loading_elastic','LoveL_loading_elastic','LoveKernels_degree1','LoveKernels_degree2']
-field_tolerances = [1e-10,1e-10,1e-10,1e-10,1e-10] 
-field_values = [
-	md.results.LoveSolution.LoveHr[:,0],
-	md.results.LoveSolution.LoveKr[:,0],
-	md.results.LoveSolution.LoveLr[:,0],
-	md.results.LoveSolution.LoveKernelsReal[1,0,:,:],
-	md.results.LoveSolution.LoveKernelsReal[2,0,:,:]]
+field_names = ['LoveH_loading_elastic', 'LoveK_loading_elastic', 'LoveL_loading_elastic', 'LoveKernels_degree1', 'LoveKernels_degree2']
+field_tolerances = [1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
+field_values = [md.results.LoveSolution.LoveHr[:, 0],
+                md.results.LoveSolution.LoveKr[:, 0],
+                md.results.LoveSolution.LoveLr[:, 0],
+                md.results.LoveSolution.LoveKernelsReal[1, 0, :, :],
+                md.results.LoveSolution.LoveKernelsReal[2, 0, :, :]]
Index: /issm/trunk/test/NightlyRun/test209.m
===================================================================
--- /issm/trunk/test/NightlyRun/test209.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test209.m	(revision 24313)
@@ -14,5 +14,5 @@
 field_tolerances={...
 	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,...
-	1e-13,1e-13,3e-9,1e-13,3.8e-11,3.85e-11,3.85e-11,3.85e-11,1e-13,2e-8,...
+	1e-13,1e-13,3e-9,1e-13,3.8e-11,3.85e-11,3.85e-11,3.85e-11,1e-13,3e-8,...
 	5e-11,6e-12,1e-08,6e-12,3.9e-11,1e-10,1e-10,1e-10,9e-12,5e-8};
 field_values={...
Index: /issm/trunk/test/NightlyRun/test209.py
===================================================================
--- /issm/trunk/test/NightlyRun/test209.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test209.py	(revision 24313)
@@ -3,5 +3,4 @@
 from model import *
 from socket import gethostname
-import numpy as np
 from triangle import *
 from setmask import *
@@ -11,53 +10,50 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',180000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 180000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 
 # Fields and tolerances to track changes
 
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', \
-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
-field_tolerances=[\
-	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,\
-	1e-13,1e-13,3e-9,1e-13,3.8e-11,3.85e-11,3.85e-11,3.85e-11,1e-13,2e-8,\
-	5e-11,6e-12,1e-08,6e-12,3.9e-11,1e-10,1e-10,1e-10,9e-12,5e-8]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Temperature3', 'BasalforcingsGroundediceMeltingRate3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-8,
+                    1e-13, 1e-13, 3e-9, 1e-13, 3.8e-11, 3.85e-11, 3.85e-11, 3.85e-11, 1e-13, 3e-8,
+                    5e-11, 6e-12, 1e-08, 6e-12, 3.9e-11, 1e-10, 1e-10, 1e-10, 9e-12, 5e-8]
 
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vz,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vz,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vz,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].Temperature,\
-	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
-	]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test210.py
===================================================================
--- /issm/trunk/test/NightlyRun/test210.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test210.py	(revision 24313)
@@ -3,5 +3,4 @@
 from model import *
 from socket import gethostname
-import numpy as np
 from triangle import *
 from setmask import *
@@ -11,52 +10,49 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',200000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 200000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 
 # Fields and tolerances to track changes
 
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
-        'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', \
-        'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
-field_tolerances=[\
-	1e-08,1e-08,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,\
-	1e-08,1e-08,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06,\
-	1e-08,1e-08,1e-08,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vz,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vz,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vz,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].Temperature,\
-	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Temperature3', 'BasalforcingsGroundediceMeltingRate3']
+field_tolerances = [1e-08, 1e-08, 1e-08, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09,
+                    1e-08, 1e-08, 1e-08, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-06,
+                    1e-08, 1e-08, 1e-08, 1e-08, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-05]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test2101.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2101.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2101.py	(revision 24313)
@@ -12,39 +12,39 @@
 from gmtmask import *
 
-#mesh earth: 
+#mesh earth:
 md = model()
-md.mesh = gmshplanet('radius',6.371012*1e3,'resolution',1000)
+md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 1000)
 
-#define load 
-md.esa.deltathickness = np.zeros((md.mesh.numberofelements,))
+#define load
+md.esa.deltathickness = np.zeros((md.mesh.numberofelements, ))
 pos = 449
-md.esa.deltathickness[pos] = -100   # this is the only "icy" element
+md.esa.deltathickness[pos] = -100  # this is the only "icy" element
 
 #love numbers:
 nlov = 10000
-md.esa.love_h = np.array(love_numbers('h'))	#Originally had CM arg
+md.esa.love_h = np.array(love_numbers('h'))  #Originally had CM arg
 md.esa.love_h = np.resize(md.esa.love_h, nlov + 1)
-md.esa.love_l = np.array(love_numbers('l'))	#Originally had CM arg
+md.esa.love_l = np.array(love_numbers('l'))  #Originally had CM arg
 md.esa.love_l = np.resize(md.esa.love_l, nlov + 1)
 
 #mask:  {{{
-md.mask = maskpsl() # use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset 
-md.mask.ocean_levelset = gmtmask(md.mesh.lat,md.mesh.long) 
+md.mask = maskpsl()  # use maskpsl class (instead of mask) to store the ocean function as a ocean_levelset
+md.mask.ocean_levelset = gmtmask(md.mesh.lat, md.mesh.long)
 
-#make sure wherever there is an ice load, that the mask is set to ice: 
-md.mask.ice_levelset = np.ones((md.mesh.numberofvertices,))
+#make sure wherever there is an ice load, that the mask is set to ice:
+md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, ))
 pos = np.where(md.esa.deltathickness)
-md.mask.ice_levelset[md.mesh.elements[pos,:]] = -1
+md.mask.ice_levelset[md.mesh.elements[pos, :]] = -1
 
-#is ice grounded? 
-md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices,))
+#is ice grounded?
+md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices, ))
 pos = np.where(md.mask.ice_levelset <= 0)
 md.mask.groundedice_levelset[pos] = 1
 
-#make sure ice domain is on the continent: 
+#make sure ice domain is on the continent:
 #pos = np.where(md.mask.ice_levelset <= 0)
 #md.mask.ocean_levelset[pos] = 0
 
-#land mask 
+#land mask
 md.mask.land_levelset = 1 - md.mask.ocean_levelset
 
@@ -52,13 +52,13 @@
 #geometry:  {{{
 di = md.materials.rho_ice / md.materials.rho_water
-md.geometry.thickness = np.ones((md.mesh.numberofvertices,))
-md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices,))
+md.geometry.thickness = np.ones((md.mesh.numberofvertices, ))
+md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, ))
 md.geometry.base = md.geometry.surface - md.geometry.thickness
 md.geometry.bed = md.geometry.base
 # }}}
 #materials:  {{{
-md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices,))
+md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))
 md.materials.rheology_B = paterson(md.initialization.temperature)
-md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements,))
+md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
 # }}}
 #Miscellaneous: {{{
@@ -66,17 +66,14 @@
 # }}}
 
-#solve esa 
-md.esa.requested_outputs = ['EsaUmotion','EsaNmotion','EsaEmotion']
-md.cluster = generic('name',gethostname(),'np',3)
+#solve esa
+md.esa.requested_outputs = ['EsaUmotion', 'EsaNmotion', 'EsaEmotion']
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.verbose = verbose('111111111')
-md = solve(md,'Esa')
+md = solve(md, 'Esa')
 
 #Fields and tolerances to track changes
-field_names     = ['EsaUmotion','EsaNmotion','EsaEmotion']
-field_tolerances= [1e-13,1e-13,1e-13]
-field_values = [
-	md.results.EsaSolution.EsaUmotion,
-	md.results.EsaSolution.EsaNmotion,
-	md.results.EsaSolution.EsaEmotion,
-	]
-
+field_names = ['EsaUmotion', 'EsaNmotion', 'EsaEmotion']
+field_tolerances = [1e-13, 1e-13, 1e-13]
+field_values = [md.results.EsaSolution.EsaUmotion,
+                md.results.EsaSolution.EsaNmotion,
+                md.results.EsaSolution.EsaEmotion]
Index: /issm/trunk/test/NightlyRun/test211.js
===================================================================
--- /issm/trunk/test/NightlyRun/test211.js	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test211.js	(revision 24313)
@@ -18,5 +18,5 @@
 	2e-08,2e-08,5e-05,2e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,
 	5e-06,5e-06,8e-05,5e-06,5e-07,5e-07,5e-07,5e-07,3e-06,5e-05,
-	8e-06,8e-06,8e-05,8e-06,5e-07,8e-07,8e-07,8e-07,5e-06,8e-05];
+	8e-06,8e-06,8e-05,8e-06,8e-07,8e-07,8e-07,8e-07,5e-06,8e-05];
 field_values=[
 	(md.results.TransientSolution[0](1).Vx),
Index: /issm/trunk/test/NightlyRun/test211.m
===================================================================
--- /issm/trunk/test/NightlyRun/test211.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test211.m	(revision 24313)
@@ -17,5 +17,5 @@
 	2e-08,2e-08,5e-05,2e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,...
 	5e-06,5e-06,8e-05,5e-06,5e-07,5e-07,5e-07,5e-07,3e-06,5e-05,...
-	8e-06,8e-06,8e-05,8e-06,5e-07,8e-07,8e-07,8e-07,5e-06,8e-05};
+	8e-06,8e-06,8e-05,8e-06,8e-07,8e-07,8e-07,8e-07,5e-06,8e-05};
 field_values={...
 	(md.results.TransientSolution(1).Vx),...
Index: /issm/trunk/test/NightlyRun/test211.py
===================================================================
--- /issm/trunk/test/NightlyRun/test211.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test211.py	(revision 24313)
@@ -10,50 +10,50 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',200000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'FS','all')
-md.stressbalance.reltol=np.NaN
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 200000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'FS', 'all')
+md.stressbalance.reltol = np.NaN
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 
 # Fields and tolerances to track changes
 
-field_names=['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1',
-						 'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2',
-						 'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
-field_tolerances=[2e-08,2e-08,5e-05,2e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,
-        5e-06,5e-06,8e-05,5e-06,5e-07,5e-07,5e-07,5e-07,3e-06,5e-05,
-        8e-06,8e-06,8e-05,8e-06,5e-07,8e-07,8e-07,8e-07,5e-06,8e-05]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vz,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].Temperature,
-							md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vz,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].Temperature,
-							md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vz,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].Temperature,
-							md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Temperature3', 'BasalforcingsGroundediceMeltingRate3']
+field_tolerances = [2e-08, 2e-08, 5e-05, 2e-08, 1e-08, 1e-08, 1e-08, 1e-08, 1e-08, 1e-08,
+                    5e-06, 5e-06, 8e-05, 5e-06, 5e-07, 5e-07, 5e-07, 5e-07, 3e-06, 5e-05,
+                    8e-06, 8e-06, 8e-05, 8e-06, 8e-07, 8e-07, 8e-07, 8e-07, 5e-06, 8e-05]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test2110.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2110.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2110.py	(revision 24313)
@@ -10,19 +10,19 @@
 from paterson import *
 
-#mesh earth: 
+#mesh earth:
 md = model()
-md = roundmesh(md,50000,2000)     # radius and element size (meters)
+md = roundmesh(md, 50000, 2000)  # radius and element size (meters)
 
-#define load 
-md.esa.deltathickness = np.zeros((md.mesh.numberofelements,))
-disc_radius = 20 # km
+#define load
+md.esa.deltathickness = np.zeros((md.mesh.numberofelements, ))
+disc_radius = 20  # km
 index = md.mesh.elements
 x_element = np.mean(md.mesh.x[index - 1], 1)
 y_element = np.mean(md.mesh.y[index - 1], 1)
 rad_dist = np.sqrt(x_element**2 + y_element**2) / 1000  # radial distance in km
-md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = -1   # 1 m water withdrawl
+md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = -1  # 1 m water withdrawl
 
 #love numbers:
-nlov = 10000	# horizontal displacements do not work for low degree truncation, e.g., 101
+nlov = 10000  # horizontal displacements do not work for low degree truncation, e.g., 101
 md.esa.love_h = np.array(love_numbers('h'))
 md.esa.love_h = np.resize(md.esa.love_h, nlov + 1)
@@ -31,11 +31,11 @@
 
 #mask:  {{{
-#make sure wherever there is an ice load, that the mask is set to ice: 
-md.mask.ice_levelset = np.ones((md.mesh.numberofvertices,))
+#make sure wherever there is an ice load, that the mask is set to ice:
+md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, ))
 pos = np.where(md.esa.deltathickness)
-md.mask.ice_levelset[md.mesh.elements[pos,:]-1] = -1
+md.mask.ice_levelset[md.mesh.elements[pos, :] - 1] = -1
 
-#is ice grounded? 
-md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices,))
+#is ice grounded?
+md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices, ))
 pos = np.where(md.mask.ice_levelset <= 0)
 md.mask.groundedice_levelset[pos] = 1
@@ -44,13 +44,13 @@
 #geometry:  {{{
 di = md.materials.rho_ice / md.materials.rho_water
-md.geometry.thickness = np.ones((md.mesh.numberofvertices,))
-md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices,))
+md.geometry.thickness = np.ones((md.mesh.numberofvertices, ))
+md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, ))
 md.geometry.base = md.geometry.surface - md.geometry.thickness
 md.geometry.bed = md.geometry.base
 # }}}
 #materials:  {{{
-md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices,))
+md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))
 md.materials.rheology_B = paterson(md.initialization.temperature)
-md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements,))
+md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
 # }}}
 #Miscellaneous: {{{
@@ -60,23 +60,20 @@
 md.esa.degacc = 0.01
 
-#solve esa 
-md.esa.requested_outputs = ['EsaUmotion','EsaXmotion','EsaYmotion',
-	'EsaStrainratexx','EsaStrainratexy','EsaStrainrateyy','EsaRotationrate']
-md.cluster = generic('name',gethostname(),'np',3)
+#solve esa
+md.esa.requested_outputs = ['EsaUmotion', 'EsaXmotion', 'EsaYmotion',
+                            'EsaStrainratexx', 'EsaStrainratexy', 'EsaStrainrateyy', 'EsaRotationrate']
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.verbose = verbose('111111111')
-md = solve(md,'Esa')
+md = solve(md, 'Esa')
 
 #Fields and tolerances to track changes
-field_names     = ['EsaUmotion','EsaXmotion','EsaYmotion',
-	'EsaStrainratexx','EsaStrainratexy','EsaStrainrateyy','EsaRotationrate']
-field_tolerances = [1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values = [
-	md.results.EsaSolution.EsaUmotion,
-	md.results.EsaSolution.EsaXmotion,
-	md.results.EsaSolution.EsaYmotion,
-	md.results.EsaSolution.EsaStrainratexx,
-	md.results.EsaSolution.EsaStrainratexy,
-	md.results.EsaSolution.EsaStrainrateyy,
-	md.results.EsaSolution.EsaRotationrate,
-	]
-
+field_names = ['EsaUmotion', 'EsaXmotion', 'EsaYmotion',
+               'EsaStrainratexx', 'EsaStrainratexy', 'EsaStrainrateyy', 'EsaRotationrate']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.EsaSolution.EsaUmotion,
+                md.results.EsaSolution.EsaXmotion,
+                md.results.EsaSolution.EsaYmotion,
+                md.results.EsaSolution.EsaStrainratexx,
+                md.results.EsaSolution.EsaStrainratexy,
+                md.results.EsaSolution.EsaStrainrateyy,
+                md.results.EsaSolution.EsaRotationrate]
Index: /issm/trunk/test/NightlyRun/test2111.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2111.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2111.py	(revision 24313)
@@ -1,4 +1,4 @@
 #Test Name: Esa2Dsurface
-#AIS -- southern hemisphere example for north-south, east-west components of horiz motion 
+#AIS - -     southern hemisphere example for north - south, east - west components of horiz motion
 
 import numpy as np
@@ -12,30 +12,30 @@
 #mesh ais: {{{
 md = model()
-md = triangle(md,'../Exp/Ais.exp',200000); # max element size
+md = triangle(md, '../Exp/Ais.exp', 200000)  # max element size
 # }}}
 #define load: {{{
-md.esa.deltathickness = np.zeros((md.mesh.numberofelements,))
-disc_radius = 500 # km
+md.esa.deltathickness = np.zeros((md.mesh.numberofelements, ))
+disc_radius = 500  # km
 index = md.mesh.elements
 x_element = np.mean(md.mesh.x[index - 1], 1) - 1.0e6
 y_element = np.mean(md.mesh.y[index - 1], 1) - 1.0e6
 rad_dist = np.sqrt(x_element**2 + y_element**2) / 1000  # radial distance in km
-md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = -1   # 1 m water withdrawl
+md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = -1  # 1 m water withdrawl
 # }}}
 #love numbers: {{{
-nlov = 10000	# horizontal displacements do not work for low degree truncation, e.g., 101
-md.esa.love_h = np.array(love_numbers('h','CF'))
+nlov = 10000  # horizontal displacements do not work for low degree truncation, e.g., 101
+md.esa.love_h = np.array(love_numbers('h', 'CF'))
 md.esa.love_h = np.resize(md.esa.love_h, nlov + 1)
-md.esa.love_l = np.array(love_numbers('l','CF'))
+md.esa.love_l = np.array(love_numbers('l', 'CF'))
 md.esa.love_l = np.resize(md.esa.love_l, nlov + 1)
 # }}}
 #mask:  {{{
-#make sure wherever there is an ice load, that the mask is set to ice: 
-md.mask.ice_levelset = np.ones((md.mesh.numberofvertices,))
+#make sure wherever there is an ice load, that the mask is set to ice:
+md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, ))
 pos = np.where(md.esa.deltathickness)
-md.mask.ice_levelset[md.mesh.elements[pos,:]] = -1
+md.mask.ice_levelset[md.mesh.elements[pos, :]] = -1
 
-#is ice grounded? 
-md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices,))
+#is ice grounded?
+md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices, ))
 pos = np.where(md.mask.ice_levelset <= 0)
 md.mask.groundedice_levelset[pos] = 1
@@ -43,36 +43,33 @@
 #geometry:  {{{
 di = md.materials.rho_ice / md.materials.rho_water
-md.geometry.thickness = np.ones((md.mesh.numberofvertices,))
-md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices,))
+md.geometry.thickness = np.ones((md.mesh.numberofvertices, ))
+md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, ))
 md.geometry.base = md.geometry.surface - md.geometry.thickness
 md.geometry.bed = md.geometry.base
 # }}}
 #materials:  {{{
-md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices,))
+md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))
 md.materials.rheology_B = paterson(md.initialization.temperature)
-md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements,))
+md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
 # }}}
 #additional parameters, miscellaneous: {{{
-md.miscellaneous.name='test2111';
-md.esa.degacc=0.01;
-md.esa.hemisphere = -1; 
+md.miscellaneous.name = 'test2111'
+md.esa.degacc = 0.01
+md.esa.hemisphere = -1
 # }}}
 
 #solve esa: {{{
-md.esa.requested_outputs = ['EsaUmotion','EsaNmotion','EsaEmotion','EsaXmotion','EsaYmotion'] 
-md.cluster = generic('name',gethostname(),'np',3)
+md.esa.requested_outputs = ['EsaUmotion', 'EsaNmotion', 'EsaEmotion', 'EsaXmotion', 'EsaYmotion']
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.verbose = verbose('111111111')
-md = solve(md,'Esa')
+md = solve(md, 'Esa')
 # }}}
 #Fields and tolerances to track changes: {{{
-field_names     = ['EsaUmotion','EsaNmotion','EsaEmotion','EsaXmotion','EsaYmotion']
-field_tolerances = [1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values = [
-	md.results.EsaSolution.EsaUmotion,
-	md.results.EsaSolution.EsaNmotion,
-	md.results.EsaSolution.EsaEmotion,
-	md.results.EsaSolution.EsaXmotion,
-	md.results.EsaSolution.EsaYmotion,
-	]
+field_names = ['EsaUmotion', 'EsaNmotion', 'EsaEmotion', 'EsaXmotion', 'EsaYmotion']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.EsaSolution.EsaUmotion,
+                md.results.EsaSolution.EsaNmotion,
+                md.results.EsaSolution.EsaEmotion,
+                md.results.EsaSolution.EsaXmotion,
+                md.results.EsaSolution.EsaYmotion]
 # }}}
-
Index: /issm/trunk/test/NightlyRun/test2112.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2112.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2112.py	(revision 24313)
@@ -1,5 +1,4 @@
 #Test Name: Esa2Dsurface
-#AIS 2 -- load centered at the south pole! 
-
+#AIS 2 - -     load centered at the south pole!
 import numpy as np
 from model import *
@@ -12,30 +11,30 @@
 #mesh ais: {{{
 md = model()
-md = triangle(md,'../Exp/Ais.exp',100000); # max element size
+md = triangle(md, '../Exp/Ais.exp', 100000)  # max element size
 # }}}
 #define load: {{{
-md.esa.deltathickness = np.zeros((md.mesh.numberofelements,))
-disc_radius = 500 # km
+md.esa.deltathickness = np.zeros((md.mesh.numberofelements, ))
+disc_radius = 500  # km
 index = md.mesh.elements
 x_element = np.mean(md.mesh.x[index - 1], 1)
 y_element = np.mean(md.mesh.y[index - 1], 1)
 rad_dist = np.sqrt(x_element**2 + y_element**2) / 1000  # radial distance in km
-md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = -1   # 1 m water withdrawl
+md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = -1  # 1 m water withdrawl
 # }}}
 #love numbers: {{{
-nlov = 10000	# horizontal displacements do not work for low degree truncation, e.g., 101
-md.esa.love_h = np.array(love_numbers('h','CF'))
+nlov = 10000  # horizontal displacements do not work for low degree truncation, e.g., 101
+md.esa.love_h = np.array(love_numbers('h', 'CF'))
 md.esa.love_h = np.resize(md.esa.love_h, nlov + 1)
-md.esa.love_l = np.array(love_numbers('l','CF'))
+md.esa.love_l = np.array(love_numbers('l', 'CF'))
 md.esa.love_l = np.resize(md.esa.love_l, nlov + 1)
 # }}}
 #mask:  {{{
-#make sure wherever there is an ice load, that the mask is set to ice: 
-md.mask.ice_levelset = np.ones((md.mesh.numberofvertices,))
+#make sure wherever there is an ice load, that the mask is set to ice:
+md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, ))
 pos = np.where(md.esa.deltathickness)
-md.mask.ice_levelset[md.mesh.elements[pos,:]] = -1
+md.mask.ice_levelset[md.mesh.elements[pos, :]] = -1
 
-#is ice grounded? 
-md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices,))
+#is ice grounded?
+md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices, ))
 pos = np.where(md.mask.ice_levelset <= 0)
 md.mask.groundedice_levelset[pos] = 1
@@ -43,36 +42,33 @@
 #geometry:  {{{
 di = md.materials.rho_ice / md.materials.rho_water
-md.geometry.thickness = np.ones((md.mesh.numberofvertices,))
-md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices,))
+md.geometry.thickness = np.ones((md.mesh.numberofvertices, ))
+md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, ))
 md.geometry.base = md.geometry.surface - md.geometry.thickness
 md.geometry.bed = md.geometry.base
 # }}}
 #materials:  {{{
-md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices,))
+md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))
 md.materials.rheology_B = paterson(md.initialization.temperature)
-md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements,))
+md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
 # }}}
 #additional parameters, miscellaneous: {{{
-md.miscellaneous.name='test2112';
-md.esa.degacc=0.01;
-md.esa.hemisphere = -1; 
+md.miscellaneous.name = 'test2112'
+md.esa.degacc = 0.01
+md.esa.hemisphere = -1
 # }}}
 
 #solve esa: {{{
-md.esa.requested_outputs = ['EsaUmotion','EsaNmotion','EsaEmotion','EsaXmotion','EsaYmotion'] 
-md.cluster = generic('name',gethostname(),'np',3)
+md.esa.requested_outputs = ['EsaUmotion', 'EsaNmotion', 'EsaEmotion', 'EsaXmotion', 'EsaYmotion']
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.verbose = verbose('111111111')
-md = solve(md,'Esa')
+md = solve(md, 'Esa')
 # }}}
 #Fields and tolerances to track changes: {{{
-field_names     = ['EsaUmotion','EsaNmotion','EsaEmotion','EsaXmotion','EsaYmotion']
-field_tolerances = [1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values = [
-	md.results.EsaSolution.EsaUmotion,
-	md.results.EsaSolution.EsaNmotion,
-	md.results.EsaSolution.EsaEmotion,
-	md.results.EsaSolution.EsaXmotion,
-	md.results.EsaSolution.EsaYmotion,
-	]
+field_names = ['EsaUmotion', 'EsaNmotion', 'EsaEmotion', 'EsaXmotion', 'EsaYmotion']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.EsaSolution.EsaUmotion,
+                md.results.EsaSolution.EsaNmotion,
+                md.results.EsaSolution.EsaEmotion,
+                md.results.EsaSolution.EsaXmotion,
+                md.results.EsaSolution.EsaYmotion]
 # }}}
-
Index: /issm/trunk/test/NightlyRun/test2113.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2113.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2113.py	(revision 24313)
@@ -1,5 +1,5 @@
 #Test Name: Esa2Dsurface
-#Northern hemisphere example for north-south, east-west components of horiz motion 
-#Same as test2111.m except that AIS is assumed to have located in Northern Hemisphere 
+#Northern hemisphere example for north - south, east - west components of horiz motion
+#Same as test2111.m except that AIS is assumed to have located in Northern Hemisphere
 
 import numpy as np
@@ -13,30 +13,30 @@
 #mesh ais: {{{
 md = model()
-md = triangle(md,'../Exp/Ais.exp',200000); # max element size
+md = triangle(md, '../Exp/Ais.exp', 200000)  # max element size
 # }}}
 #define load: {{{
-md.esa.deltathickness = np.zeros((md.mesh.numberofelements,))
-disc_radius = 500 # km
+md.esa.deltathickness = np.zeros((md.mesh.numberofelements, ))
+disc_radius = 500  # km
 index = md.mesh.elements
 x_element = np.mean(md.mesh.x[index - 1], 1) - 1.0e6
 y_element = np.mean(md.mesh.y[index - 1], 1) + 1.0e6
 rad_dist = np.sqrt(x_element**2 + y_element**2) / 1000  # radial distance in km
-md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = -1   # 1 m water withdrawl
+md.esa.deltathickness[np.where(rad_dist <= disc_radius)] = -1  # 1 m water withdrawl
 # }}}
 #love numbers: {{{
-nlov = 10000	# horizontal displacements do not work for low degree truncation, e.g., 101
-md.esa.love_h = np.array(love_numbers('h','CF'))
+nlov = 10000  # horizontal displacements do not work for low degree truncation, e.g., 101
+md.esa.love_h = np.array(love_numbers('h', 'CF'))
 md.esa.love_h = np.resize(md.esa.love_h, nlov + 1)
-md.esa.love_l = np.array(love_numbers('l','CF'))
+md.esa.love_l = np.array(love_numbers('l', 'CF'))
 md.esa.love_l = np.resize(md.esa.love_l, nlov + 1)
 # }}}
 #mask:  {{{
-#make sure wherever there is an ice load, that the mask is set to ice: 
-md.mask.ice_levelset = np.ones((md.mesh.numberofvertices,))
+#make sure wherever there is an ice load, that the mask is set to ice:
+md.mask.ice_levelset = np.ones((md.mesh.numberofvertices, ))
 pos = np.where(md.esa.deltathickness)
-md.mask.ice_levelset[md.mesh.elements[pos,:]] = -1
+md.mask.ice_levelset[md.mesh.elements[pos, :]] = -1
 
-#is ice grounded? 
-md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices,))
+#is ice grounded?
+md.mask.groundedice_levelset = -np.ones((md.mesh.numberofvertices, ))
 pos = np.where(md.mask.ice_levelset <= 0)
 md.mask.groundedice_levelset[pos] = 1
@@ -44,34 +44,31 @@
 #geometry:  {{{
 di = md.materials.rho_ice / md.materials.rho_water
-md.geometry.thickness = np.ones((md.mesh.numberofvertices,))
-md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices,))
+md.geometry.thickness = np.ones((md.mesh.numberofvertices, ))
+md.geometry.surface = (1 - di) * np.zeros((md.mesh.numberofvertices, ))
 md.geometry.base = md.geometry.surface - md.geometry.thickness
 md.geometry.bed = md.geometry.base
 # }}}
 #materials:  {{{
-md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices,))
+md.initialization.temperature = 273.25 * np.ones((md.mesh.numberofvertices, ))
 md.materials.rheology_B = paterson(md.initialization.temperature)
-md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements,))
+md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
 # }}}
 #additional parameters, miscellaneous: {{{
-md.miscellaneous.name='test2113';
-md.esa.degacc=0.01;
-md.esa.hemisphere = 1; # AIS is placed in Northern Hemisphere 
+md.miscellaneous.name = 'test2113'
+md.esa.degacc = 0.01
+md.esa.hemisphere = 1  # AIS is placed in Northern Hemisphere
 # }}}
 
 #solve esa: {{{
-md.esa.requested_outputs = ['EsaUmotion','EsaNmotion','EsaEmotion']
-md.cluster = generic('name',gethostname(),'np',3)
+md.esa.requested_outputs = ['EsaUmotion', 'EsaNmotion', 'EsaEmotion']
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.verbose = verbose('111111111')
-md = solve(md,'Esa')
+md = solve(md, 'Esa')
 # }}}
 #Fields and tolerances to track changes: {{{
-field_names     = ['EsaUmotion','EsaNmotion','EsaEmotion']
-field_tolerances = [1e-13,1e-13,1e-13]
-field_values = [
-	md.results.EsaSolution.EsaUmotion,
-	md.results.EsaSolution.EsaNmotion,
-	md.results.EsaSolution.EsaEmotion,
-	]
+field_names = ['EsaUmotion', 'EsaNmotion', 'EsaEmotion']
+field_tolerances = [1e-13, 1e-13, 1e-13]
+field_values = [md.results.EsaSolution.EsaUmotion,
+                md.results.EsaSolution.EsaNmotion,
+                md.results.EsaSolution.EsaEmotion]
 # }}}
-
Index: /issm/trunk/test/NightlyRun/test212.py
===================================================================
--- /issm/trunk/test/NightlyRun/test212.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test212.py	(revision 24313)
@@ -10,38 +10,38 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',200000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/Square.exp', 200000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
 
 # control parameters
 
-md.inversion.iscontrol=1
-md.inversion.control_parameters=['MaterialsRheologyBbar']
-md.inversion.min_parameters=1.0e6*np.ones((md.mesh.numberofvertices))
-md.inversion.max_parameters=2.0e9*np.ones((md.mesh.numberofvertices))
-md.inversion.nsteps=2
-md.inversion.cost_functions=[101]
-md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices))
-md.inversion.gradient_scaling=1.0e7*np.ones((md.inversion.nsteps))
-md.inversion.maxiter_per_step=2.*np.ones((md.inversion.nsteps))
-md.inversion.step_threshold=0.3*np.ones((md.inversion.nsteps))
-md.inversion.vx_obs=md.initialization.vx
-md.inversion.vy_obs=md.initialization.vy
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['MaterialsRheologyBbar']
+md.inversion.min_parameters = 1.0e6 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 2.0e9 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.nsteps = 2
+md.inversion.cost_functions = [101]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, len(md.inversion.cost_functions)))
+md.inversion.gradient_scaling = 1.0e7 * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
+md.inversion.maxiter_per_step = 2. * np.ones((md.inversion.nsteps))
+md.inversion.step_threshold = 0.3 * np.ones((md.inversion.nsteps))
+md.inversion.vx_obs = md.initialization.vx
+md.inversion.vy_obs = md.initialization.vy
 
 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 
 # Fields and tolerances to track changes
 
-field_names     =['Gradient','Misfits','MaterialsRheologyBbar','Pressure','Vel','Vx','Vy']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[md.results.StressbalanceSolution.Gradient1,
-							md.results.StressbalanceSolution.J,
-							md.results.StressbalanceSolution.MaterialsRheologyBbar,
-							md.results.StressbalanceSolution.Pressure,
-							md.results.StressbalanceSolution.Vel,
-							md.results.StressbalanceSolution.Vx,
-							md.results.StressbalanceSolution.Vy]
+field_names = ['Gradient', 'Misfits', 'MaterialsRheologyBbar', 'Pressure', 'Vel', 'Vx', 'Vy']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Gradient1,
+                md.results.StressbalanceSolution.J,
+                md.results.StressbalanceSolution.MaterialsRheologyBbar,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy]
Index: /issm/trunk/test/NightlyRun/test213.py
===================================================================
--- /issm/trunk/test/NightlyRun/test213.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test213.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareShelfCMBSSA3d
-
 from model import *
 from socket import gethostname
@@ -11,41 +10,37 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',200000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/Square.exp', 200000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
 
 
 # control parameters
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['MaterialsRheologyBbar']
+md.inversion.min_parameters = 10**6 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 2. * 10**9 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.nsteps = 2
+md.inversion.cost_functions = [101]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, len(md.inversion.cost_functions)))
+md.inversion.gradient_scaling = 10**7 * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
+md.inversion.maxiter_per_step = 2. * np.ones((md.inversion.nsteps))
+md.inversion.step_threshold = 0.3 * np.ones((md.inversion.nsteps))
+md.inversion.vx_obs = md.initialization.vx
+md.inversion.vy_obs = md.initialization.vy
 
-md.inversion.iscontrol=1
-md.inversion.control_parameters=['MaterialsRheologyBbar']
-md.inversion.min_parameters=10**6*np.ones((md.mesh.numberofvertices))
-md.inversion.max_parameters=2.*10**9*np.ones((md.mesh.numberofvertices))
-md.inversion.nsteps=2
-md.inversion.cost_functions=[101]
-md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices))
-md.inversion.gradient_scaling=10**7*np.ones((md.inversion.nsteps))
-md.inversion.maxiter_per_step=2.*np.ones((md.inversion.nsteps))
-md.inversion.step_threshold=0.3*np.ones((md.inversion.nsteps))
-md.inversion.vx_obs=md.initialization.vx
-md.inversion.vy_obs=md.initialization.vy
-
-
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
-
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 # Fields and tolerances to track changes
 
-field_names     =['Gradient','Misfits','MaterialsRheologyBbar','Pressure','Vel','Vx','Vy']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-#field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[md.results.StressbalanceSolution.Gradient1,
-							md.results.StressbalanceSolution.J,
-							md.results.StressbalanceSolution.MaterialsRheologyBbar,
-							md.results.StressbalanceSolution.Pressure,
-							md.results.StressbalanceSolution.Vel,
-							md.results.StressbalanceSolution.Vx,
-							md.results.StressbalanceSolution.Vy]
+field_names = ['Gradient', 'Misfits', 'MaterialsRheologyBbar', 'Pressure', 'Vel', 'Vx', 'Vy']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Gradient1,
+                md.results.StressbalanceSolution.J,
+                md.results.StressbalanceSolution.MaterialsRheologyBbar,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy]
Index: /issm/trunk/test/NightlyRun/test214.py
===================================================================
--- /issm/trunk/test/NightlyRun/test214.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test214.py	(revision 24313)
@@ -11,40 +11,38 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',200000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
+md = triangle(model(), '../Exp/Square.exp', 200000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
 
 
 # control parameters
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['MaterialsRheologyBbar']
+md.inversion.min_parameters = 1e6 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 2. * 1e9 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.nsteps = 2
+md.inversion.cost_functions = [101]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, len(md.inversion.cost_functions)))
+md.inversion.gradient_scaling = 1e7 * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
+md.inversion.maxiter_per_step = 2. * np.ones((md.inversion.nsteps))
+md.inversion.step_threshold = 0.3 * np.ones((md.inversion.nsteps))
+md.inversion.vx_obs = md.initialization.vx
+md.inversion.vy_obs = md.initialization.vy
 
-md.inversion.iscontrol=1
-md.inversion.control_parameters=['MaterialsRheologyBbar']
-md.inversion.min_parameters=1e6*np.ones((md.mesh.numberofvertices))
-md.inversion.max_parameters=2.*1e9*np.ones((md.mesh.numberofvertices))
-md.inversion.nsteps=2
-md.inversion.cost_functions=[101]
-md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices))
-md.inversion.gradient_scaling=1e7*np.ones((md.inversion.nsteps))
-md.inversion.maxiter_per_step=2.*np.ones((md.inversion.nsteps))
-md.inversion.step_threshold=0.3*np.ones((md.inversion.nsteps))
-md.inversion.vx_obs=md.initialization.vx
-md.inversion.vy_obs=md.initialization.vy
-
-
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 
 # Fields and tolerances to track changes
 
-field_names     =['Gradient','Misfits','MaterialsRheologyBbar','Pressure','Vel','Vx','Vy']
-field_tolerances=[1e-07,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08]
-field_values=[md.results.StressbalanceSolution.Gradient1,
-							md.results.StressbalanceSolution.J,
-							md.results.StressbalanceSolution.MaterialsRheologyBbar,
-							md.results.StressbalanceSolution.Pressure,
-							md.results.StressbalanceSolution.Vel,
-							md.results.StressbalanceSolution.Vx,
-							md.results.StressbalanceSolution.Vy]
+field_names = ['Gradient', 'Misfits', 'MaterialsRheologyBbar', 'Pressure', 'Vel', 'Vx', 'Vy']
+field_tolerances = [1e-07, 1e-08, 1e-08, 1e-08, 1e-08, 1e-08, 1e-08, 1e-08, 1e-08, 1e-08]
+field_values = [md.results.StressbalanceSolution.Gradient1,
+                md.results.StressbalanceSolution.J,
+                md.results.StressbalanceSolution.MaterialsRheologyBbar,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy]
Index: /issm/trunk/test/NightlyRun/test215.js
===================================================================
--- /issm/trunk/test/NightlyRun/test215.js	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test215.js	(revision 24313)
@@ -6,4 +6,5 @@
 md.extrude(md,3,1.);
 setflowequation(md,'FS','all');
+md.settings.solver_residue_threshold = 1.e-4;
 
 //control parameters
Index: /issm/trunk/test/NightlyRun/test215.m
===================================================================
--- /issm/trunk/test/NightlyRun/test215.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test215.m	(revision 24313)
@@ -5,4 +5,5 @@
 md=extrude(md,3,1.);
 md=setflowequation(md,'FS','all');
+md.settings.solver_residue_threshold = 1.e-4;
 
 %control parameters
Index: /issm/trunk/test/NightlyRun/test215.py
===================================================================
--- /issm/trunk/test/NightlyRun/test215.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test215.py	(revision 24313)
@@ -10,37 +10,36 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',200000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'FS','all')
-
+md = triangle(model(), '../Exp/Square.exp', 200000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'FS', 'all')
+md.settings.solver_residue_threshold = 1.e-4
 
 # control parameters
-md.inversion.iscontrol=1
-md.inversion.control_parameters=['MaterialsRheologyBbar']
-md.inversion.min_parameters=1e6*np.ones((md.mesh.numberofvertices))
-md.inversion.max_parameters=2e9*np.ones((md.mesh.numberofvertices))
-md.inversion.nsteps=2
-md.inversion.cost_functions=[101]
-md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices))
-md.inversion.gradient_scaling=1e7*np.ones((md.inversion.nsteps))
-md.inversion.maxiter_per_step=2.*np.ones((md.inversion.nsteps))
-md.inversion.step_threshold=0.3*np.ones((md.inversion.nsteps))
-md.inversion.vx_obs=md.initialization.vx
-md.inversion.vy_obs=md.initialization.vy
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['MaterialsRheologyBbar']
+md.inversion.min_parameters = 1e6 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 2e9 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.nsteps = 2
+md.inversion.cost_functions = [101]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, len(md.inversion.cost_functions)))
+md.inversion.gradient_scaling = 1e7 * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
+md.inversion.maxiter_per_step = 2. * np.ones((md.inversion.nsteps))
+md.inversion.step_threshold = 0.3 * np.ones((md.inversion.nsteps))
+md.inversion.vx_obs = md.initialization.vx
+md.inversion.vy_obs = md.initialization.vy
 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
-
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 # Fields and tolerances to track changes
-field_names     =['Gradient','Misfits','MaterialsRheologyBbar','Pressure','Vel','Vx','Vy']
-field_tolerances=[4.6e-08,1e-08,2e-08,2e-09,3e-09,2e-08,2e-08]
-field_values=[md.results.StressbalanceSolution.Gradient1,
-        md.results.StressbalanceSolution.J,
-        md.results.StressbalanceSolution.MaterialsRheologyBbar,
-        md.results.StressbalanceSolution.Pressure,
-        md.results.StressbalanceSolution.Vel,
-        md.results.StressbalanceSolution.Vx,
-        md.results.StressbalanceSolution.Vy]
+field_names = ['Gradient', 'Misfits', 'MaterialsRheologyBbar', 'Pressure', 'Vel', 'Vx', 'Vy']
+field_tolerances = [4.6e-08, 1e-08, 2e-08, 2e-09, 3e-09, 2e-08, 2e-08]
+field_values = [md.results.StressbalanceSolution.Gradient1,
+                md.results.StressbalanceSolution.J,
+                md.results.StressbalanceSolution.MaterialsRheologyBbar,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy]
Index: /issm/trunk/test/NightlyRun/test216.py
===================================================================
--- /issm/trunk/test/NightlyRun/test216.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test216.py	(revision 24313)
@@ -3,5 +3,4 @@
 from model import *
 from socket import gethostname
-import numpy as np
 from triangle import *
 from meshprocessrifts import *
@@ -12,28 +11,26 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/SquareHole.exp','../Exp/Rifts.exp',50000.)
-md=meshprocessrifts(md,'../Exp/Square.exp')
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf2.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/SquareHole.exp', '../Exp/Rifts.exp', 50000.)
+md = meshprocessrifts(md, '../Exp/Square.exp')
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf2.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 # rift settings
 
-md.rifts.riftstruct[0]['fill']='Melange'
-md.rifts.riftstruct[0]['fraction']=0
-md.stressbalance.rift_penalty_lock=2
-md.stressbalance.rift_penalty_threshold=0
-md.rifts.riftstruct[0]['fractionincrement']=0.1
-md=solve(md,'Stressbalance')
+md.rifts.riftstruct[0]['fill'] = 'Melange'
+md.rifts.riftstruct[0]['fraction'] = 0
+md.stressbalance.rift_penalty_lock = 2
+md.stressbalance.rift_penalty_threshold = 0
+md.rifts.riftstruct[0]['fractionincrement'] = 0.1
+md = solve(md, 'Stressbalance')
 
 # Fields and tolerances to track changes
 
-field_names     =['Vx','Vy','Vel','Pressure']
-field_tolerances=[9e-7,7e-8,9e-8,2e-11]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure']
+field_tolerances = [9e-7, 7e-8, 9e-8, 2e-11]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test217.py
===================================================================
--- /issm/trunk/test/NightlyRun/test217.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test217.py	(revision 24313)
@@ -11,70 +11,70 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',150000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-# redo the parameter file for this special shelf. 
-# constant thickness, constrained (vy=0) flow into an icefront, 
-# from 0 m/yr at the grounding line.
+# redo the parameter file for this special shelf.
+# constant thickness, constrained (vy = 0) flow into an icefront,
+# from 0 m / yr at the grounding line.
 
 # tighten
-md.stressbalance.restol=1e-4
+md.stressbalance.restol = 1e-4
 
 # needed later
-ymin=min(md.mesh.y)
-ymax=max(md.mesh.y)
-xmin=min(md.mesh.x)
-xmax=max(md.mesh.x)
+ymin = min(md.mesh.y)
+ymax = max(md.mesh.y)
+xmin = min(md.mesh.x)
+xmax = max(md.mesh.x)
 
-di=md.materials.rho_ice/md.materials.rho_water
+di = md.materials.rho_ice / md.materials.rho_water
 
-h=1000.
-md.geometry.thickness=h*np.ones((md.mesh.numberofvertices))
-md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
-md.geometry.surface=md.geometry.base+md.geometry.thickness
+h = 1000.
+md.geometry.thickness = h * np.ones((md.mesh.numberofvertices))
+md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
+md.geometry.surface = md.geometry.base + md.geometry.thickness
 
 # Initial velocity and pressure
-md.initialization.vx=np.zeros((md.mesh.numberofvertices))
-md.initialization.vy=np.zeros((md.mesh.numberofvertices))
-md.initialization.vz=np.zeros((md.mesh.numberofvertices))
-md.initialization.pressure=np.zeros((md.mesh.numberofvertices))
+md.initialization.vx = np.zeros((md.mesh.numberofvertices))
+md.initialization.vy = np.zeros((md.mesh.numberofvertices))
+md.initialization.vz = np.zeros((md.mesh.numberofvertices))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
 
 # Materials
-md.initialization.temperature=(273.-20.)*np.ones((md.mesh.numberofvertices))
-md.materials.rheology_B=paterson(md.initialization.temperature)
-md.materials.rheology_n=3.*np.ones((md.mesh.numberofelements))
+md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_B = paterson(md.initialization.temperature)
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
 
 # Boundary conditions:
-md.stressbalance.spcvx=np.nan*np.ones((md.mesh.numberofvertices))
-md.stressbalance.spcvy=np.nan*np.ones((md.mesh.numberofvertices))
-md.stressbalance.spcvz=np.nan*np.ones((md.mesh.numberofvertices))
+md.stressbalance.spcvx = np.nan * np.ones((md.mesh.numberofvertices))
+md.stressbalance.spcvy = np.nan * np.ones((md.mesh.numberofvertices))
+md.stressbalance.spcvz = np.nan * np.ones((md.mesh.numberofvertices))
 
 # constrain flanks to 0 normal velocity
-pos=np.where(np.logical_or(md.mesh.x==xmin,md.mesh.x==xmax))
-md.stressbalance.spcvx[pos]=0
-md.stressbalance.spcvz[pos]=np.nan
+pos = np.where(np.logical_or(md.mesh.x == xmin, md.mesh.x == xmax))
+md.stressbalance.spcvx[pos] = 0
+md.stressbalance.spcvz[pos] = np.nan
 
 # constrain grounding line to 0 velocity
-pos=np.where(md.mesh.y==ymin)
-md.stressbalance.spcvx[pos]=0
-md.stressbalance.spcvy[pos]=0
+pos = np.where(md.mesh.y == ymin)
+md.stressbalance.spcvx[pos] = 0
+md.stressbalance.spcvy[pos] = 0
 
 # icefront
-nodeonicefront=np.zeros(md.mesh.numberofvertices)
-pos=np.where(md.mesh.y==ymax)
-nodeonicefront[pos]=1
-md.mask.ice_levelset=-1+nodeonicefront
+nodeonicefront = np.zeros(md.mesh.numberofvertices)
+pos = np.where(md.mesh.y == ymax)
+nodeonicefront[pos] = 1
+md.mask.ice_levelset = -1 + nodeonicefront
 
-md=solve(md,'Stressbalance')
+md = solve(md, 'Stressbalance')
 
-# create analytical solution: strain rate is constant = ((rho_ice*g*h)/4B)^3 (Paterson, 4th Edition, page 292.
-# ey_c=(md.materials.rho_ice*md.constants.g*(1-di)*md.geometry.thickness./(4*md.materials.rheology_B)).^3
-# vy_c=ey_c.*md.mesh.y*md.constants.yts
+# create analytical solution: strain rate is constant = ((rho_ice * g * h) / 4B)^3 (Paterson, 4th Edition, page 292.
+# ey_c=(md.materials.rho_ice * md.constants.g * (1 - di) * md.geometry.thickness. / (4 * md.materials.rheology_B)).^3
+# vy_c = ey_c. * md.mesh.y * md.constants.yts
 
 # Fields and tolerances to track changes
-field_names     =['Vy']
-field_tolerances=[1e-13]
-field_values=[md.results.StressbalanceSolution.Vy]
+field_names = ['Vy']
+field_tolerances = [1e-13]
+field_values = [md.results.StressbalanceSolution.Vy]
Index: /issm/trunk/test/NightlyRun/test218.m
===================================================================
--- /issm/trunk/test/NightlyRun/test218.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test218.m	(revision 24313)
@@ -52,5 +52,5 @@
 md.qmu.numberofpartitions=md.mesh.numberofvertices;
 md=partitioner(md,'package','linear','npart',md.qmu.numberofpartitions);
-md.qmu.partition=md.qmu.partition-1;
+md.qmu.vpartition=md.qmu.vpartition-1;
 
 %Dakota options
Index: /issm/trunk/test/NightlyRun/test218.py
===================================================================
--- /issm/trunk/test/NightlyRun/test218.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test218.py	(revision 24313)
@@ -22,13 +22,13 @@
 from verbose import *
 
-md = squaremesh(model(),1000000,1000000,5,5)
-md = setmask(md,'all','')
-md = parameterize(md,'../Par/SquareShelf2.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
+md = squaremesh(model(), 1000000, 1000000, 5, 5)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf2.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-#redo the parameter file for this special shelf. 
-#constant thickness, constrained (vy=0) flow into an icefront, 
-#from 0 m/yr at the grounding line.
+#redo the parameter file for this special shelf.
+#constant thickness, constrained (vy = 0) flow into an icefront,
+#from 0 m / yr at the grounding line.
 
 #needed later
@@ -41,23 +41,23 @@
 
 h = 1000.
-md.geometry.thickness = h * np.ones((md.mesh.numberofvertices,))
+md.geometry.thickness = h * np.ones((md.mesh.numberofvertices, ))
 md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
 md.geometry.surface = md.geometry.base + md.geometry.thickness
 
 #Initial velocity and pressure
-md.initialization.vx = np.zeros((md.mesh.numberofvertices,))
-md.initialization.vy = np.zeros((md.mesh.numberofvertices,))
-md.initialization.vz = np.zeros((md.mesh.numberofvertices,))
-md.initialization.pressure = np.zeros((md.mesh.numberofvertices,))
+md.initialization.vx = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.vy = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.vz = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices, ))
 
 #Materials
-md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices,))
+md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, ))
 md.materials.rheology_B = paterson(md.initialization.temperature)
-md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements,))
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements, ))
 
 #Boundary conditions:
-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 = 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, ))
 
 #constrain flanks to 0 normal velocity
@@ -67,5 +67,5 @@
 
 #constrain grounding line to 0 velocity
-pos = np.where(md.mesh.y ==ymin)
+pos = np.where(md.mesh.y == ymin)
 md.stressbalance.spcvx[pos] = 0.
 md.stressbalance.spcvy[pos] = 0.
@@ -73,6 +73,6 @@
 #partitioning
 md.qmu.numberofpartitions = md.mesh.numberofvertices
-md = partitioner(md,'package','linear','npart',md.qmu.numberofpartitions)
-md.qmu.partition = (md.qmu.partition - 1.).reshape(-1,1).T
+md = partitioner(md, 'package', 'linear', 'npart', md.qmu.numberofpartitions)
+md.qmu.vpartition = md.qmu.vpartition - 1
 
 #Dakota options
@@ -80,12 +80,12 @@
 #dakota version
 version = IssmConfig('_DAKOTA_VERSION_')
-# returns tuple "(u'6.2',)" -> unicode string '6.2', convert to float
-version=float(version[0])
+# returns tuple "(u'6.2', )" -> unicode string '6.2', convert to float
+version = float(version[0])
 
 #variables
-md.qmu.variables.rheology_B = normal_uncertain.normal_uncertain('scaled_MaterialsRheologyB',1,.05)
+md.qmu.variables.rheology_B = normal_uncertain.normal_uncertain('scaled_MaterialsRheologyB', 1, .05)
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
 
 #method
@@ -97,24 +97,25 @@
 
 if version >= 6:
-	md.qmu.params.analysis_driver = 'matlab'
-	md.qmu.params.evaluation_scheduling = 'master'
-	md.qmu.params.processors_per_evaluation = 2
+    md.qmu.params.analysis_driver = 'matlab'
+    md.qmu.params.evaluation_scheduling = 'master'
+    md.qmu.params.processors_per_evaluation = 2
 else:
-	md.qmu.params.analysis_driver = 'stressbalance'
-	md.qmu.params.evaluation_concurrency = 1
+    md.qmu.params.analysis_driver = 'stressbalance'
+    md.qmu.params.evaluation_concurrency = 1
 
 
-#imperative! 
-md.stressbalance.reltol = 10**-10 #tighten for qmu analysis
+#imperative!
+md.stressbalance.reltol = 10**-10  #tighten for qmu analysis
 md.qmu.isdakota = 1
 
+#md.debug.valgrind = True
 #solve
-md.verbose = verbose('000000000')	# this line is recommended
-md = solve(md,'Stressbalance','overwrite','y')
+md.verbose = verbose('000000000')  # this line is recommended
+md = solve(md, 'Stressbalance', 'overwrite', 'y')
 
 #Fields and tolerances to track changes
 md.qmu.results = md.results.dakota
-md.results.dakota.importancefactors = importancefactors(md,'scaled_MaterialsRheologyB','MaxVel').reshape(-1,1)
+md.results.dakota.importancefactors = importancefactors(md, 'scaled_MaterialsRheologyB', 'MaxVel').reshape(-1, 1)
 field_names = ['importancefactors']
 field_tolerances = [1e-10]
-field_values=[md.results.dakota.importancefactors]
+field_values = [md.results.dakota.importancefactors]
Index: /issm/trunk/test/NightlyRun/test219.py
===================================================================
--- /issm/trunk/test/NightlyRun/test219.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test219.py	(revision 24313)
@@ -3,5 +3,4 @@
 from model import *
 from socket import gethostname
-import numpy as np
 from triangle import *
 from setmask import *
@@ -11,21 +10,19 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,2.)
-md=setflowequation(md,'HO','../Exp/SquareHalfRight.exp','fill','SSA')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'HO', '../Exp/SquareHalfRight.exp', 'fill', 'SSA')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 # Fields and tolerances to track changes
 
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[5e-09,5e-09,5e-09,5e-09,1e-13]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [5e-09, 5e-09, 5e-09, 5e-09, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test220.py
===================================================================
--- /issm/trunk/test/NightlyRun/test220.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test220.py	(revision 24313)
@@ -3,5 +3,4 @@
 from model import *
 from socket import gethostname
-import numpy as np
 from triangle import *
 from setmask import *
@@ -11,21 +10,19 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',120000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf2.py')
-md.extrude(2,1.)
-md=setflowequation(md,'FS','../Exp/SquareHalfRight.exp','fill','HO')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 120000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf2.py')
+md.extrude(2, 1.)
+md = setflowequation(md, 'FS', '../Exp/SquareHalfRight.exp', 'fill', 'HO')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 # Fields and tolerances to track changes
 
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-09,1e-09,5e-06,1e-09,1e-09]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-09, 1e-09, 5e-06, 1e-09, 1e-09]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test221.py
===================================================================
--- /issm/trunk/test/NightlyRun/test221.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test221.py	(revision 24313)
@@ -9,20 +9,18 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',120000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf2.py')
-md.extrude(2,1.)
-md=setflowequation(md,'FS','../Exp/SquareHalfRight.exp','fill','SSA')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 120000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf2.py')
+md.extrude(2, 1.)
+md = setflowequation(md, 'FS', '../Exp/SquareHalfRight.exp', 'fill', 'SSA')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-09,1e-09,5e-06,1e-09,1e-09]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-09, 1e-09, 5e-06, 1e-09, 1e-09]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test222.py
===================================================================
--- /issm/trunk/test/NightlyRun/test222.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test222.py	(revision 24313)
@@ -9,36 +9,44 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.masstransport.hydrostatic_adjustment='Incremental'
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.masstransport.hydrostatic_adjustment = 'Incremental'
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1',
+               'Bed1', 'Surface1', 'Thickness1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2',
+               'Bed2', 'Surface2', 'Thickness2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3',
+               'Bed3', 'Surface3', 'Thickness3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness]
Index: /issm/trunk/test/NightlyRun/test223.py
===================================================================
--- /issm/trunk/test/NightlyRun/test223.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test223.py	(revision 24313)
@@ -9,38 +9,46 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
-md.geometry.base=md.geometry.base+50.
-md.geometry.surface=md.geometry.surface+50.
-md.cluster=generic('name',gethostname(),'np',1)
-md.masstransport.hydrostatic_adjustment='Incremental'
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.geometry.base = md.geometry.base + 50.
+md.geometry.surface = md.geometry.surface + 50.
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.masstransport.hydrostatic_adjustment = 'Incremental'
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1',
+               'Bed1', 'Surface1', 'Thickness1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2',
+               'Bed2', 'Surface2', 'Thickness2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3',
+               'Bed3', 'Surface3', 'Thickness3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness]
Index: /issm/trunk/test/NightlyRun/test224.py
===================================================================
--- /issm/trunk/test/NightlyRun/test224.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test224.py	(revision 24313)
@@ -9,51 +9,48 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',200000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.masstransport.hydrostatic_adjustment='Incremental'
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 200000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.masstransport.hydrostatic_adjustment = 'Incremental'
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', \
-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
-field_tolerances=[\
-	2e-09,2e-09,2e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,\
-	2e-09,5e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06,\
-	2e-09,5e-09,1e-08,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vz,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vz,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vz,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].Temperature,\
-	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Temperature3', 'BasalforcingsGroundediceMeltingRate3']
+field_tolerances = [2e-09, 2e-09, 2e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09,
+                    2e-09, 5e-09, 1e-08, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-06,
+                    2e-09, 5e-09, 1e-08, 1e-08, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-05]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test225.py
===================================================================
--- /issm/trunk/test/NightlyRun/test225.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test225.py	(revision 24313)
@@ -9,53 +9,50 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',200000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.geometry.base=md.geometry.base+50.
-md.geometry.surface=md.geometry.surface+50.
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.masstransport.hydrostatic_adjustment='Incremental'
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 200000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.geometry.base = md.geometry.base + 50.
+md.geometry.surface = md.geometry.surface + 50.
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.masstransport.hydrostatic_adjustment = 'Incremental'
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', \
-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
-field_tolerances=[\
-	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,\
-	2e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,\
-	1e-08,1e-08,1e-08,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vz,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vz,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vz,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].Temperature,\
-	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Temperature3', 'BasalforcingsGroundediceMeltingRate3']
+field_tolerances = [1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-05,
+                    2e-09, 1e-09, 1e-08, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-05,
+                    1e-08, 1e-08, 1e-08, 1e-08, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-05]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test226.py
===================================================================
--- /issm/trunk/test/NightlyRun/test226.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test226.py	(revision 24313)
@@ -9,37 +9,45 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.timestepping = timesteppingadaptive(md.timestepping);
-md.timestepping.final_time=15.
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.timestepping = timesteppingadaptive(md.timestepping)
+md.timestepping.final_time = 15.
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1',
+               'Bed1', 'Surface1', 'Thickness1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2',
+               'Bed2', 'Surface2', 'Thickness2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3',
+               'Bed3', 'Surface3', 'Thickness3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness]
Index: /issm/trunk/test/NightlyRun/test227.js
===================================================================
--- /issm/trunk/test/NightlyRun/test227.js	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test227.js	(revision 24313)
@@ -12,10 +12,10 @@
 
 //Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', 
-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', 
+field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1',
+	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2',
 	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3'];
 field_tolerances=[
 	1e-08,5e-09,1e-09,5e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,
-	1e-09,5e-09,1e-08,5e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06,
+	2e-09,5e-09,1e-08,5e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06,
 	1e-08,1e-08,1e-08,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05];
 field_values=[
Index: /issm/trunk/test/NightlyRun/test227.m
===================================================================
--- /issm/trunk/test/NightlyRun/test227.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test227.m	(revision 24313)
@@ -16,5 +16,5 @@
 field_tolerances={...
 	1e-08,5e-09,1e-09,5e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,...
-	1e-09,5e-09,1e-08,5e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06,...
+	2e-09,5e-09,1e-08,5e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06,...
 	1e-08,1e-08,1e-08,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05};
 field_values={...
Index: /issm/trunk/test/NightlyRun/test227.py
===================================================================
--- /issm/trunk/test/NightlyRun/test227.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test227.py	(revision 24313)
@@ -9,52 +9,49 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',200000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 200000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.timestepping = timesteppingadaptive(md.timestepping)
-md.timestepping.final_time=20.
-md=solve(md,'Transient')
+md.timestepping.final_time = 20.
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', \
-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
-field_tolerances=[\
-	1e-08,5e-09,1e-09,5e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,\
-	1e-09,5e-09,1e-08,5e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06,\
-	1e-08,1e-08,1e-08,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vz,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vz,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vz,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].Temperature,\
-	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Temperature3', 'BasalforcingsGroundediceMeltingRate3']
+field_tolerances = [1e-08, 5e-09, 1e-09, 5e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09,
+                    2e-09, 5e-09, 1e-08, 5e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-06,
+                    1e-08, 1e-08, 1e-08, 1e-08, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-05]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test228.py
===================================================================
--- /issm/trunk/test/NightlyRun/test228.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test228.py	(revision 24313)
@@ -10,62 +10,62 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.timestepping.time_step=1.
-md.settings.output_frequency=1
-md.timestepping.final_time=4.
+md.timestepping.time_step = 1.
+md.settings.output_frequency = 1
+md.timestepping.final_time = 4.
 
 #Set up transient
-smb=np.ones((md.mesh.numberofvertices))*3.6
-smb=np.vstack((smb,smb*-1.)).T
+smb = np.ones((md.mesh.numberofvertices)) * 3.6
+smb = np.vstack((smb, smb * - 1.)).T
 
-md.smb.mass_balance=np.vstack((smb,[1.5,3.]))
-md.transient.isthermal=False
+md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
+md.transient.isthermal = False
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
-						 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
-						 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
-						 'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
-field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].SmbMassBalance,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].SmbMassBalance,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].SmbMassBalance,
-							md.results.TransientSolution[3].Vx,
-							md.results.TransientSolution[3].Vy,
-							md.results.TransientSolution[3].Vel,
-							md.results.TransientSolution[3].Pressure,
-							md.results.TransientSolution[3].Base,
-							md.results.TransientSolution[3].Surface,
-							md.results.TransientSolution[3].Thickness,
-							md.results.TransientSolution[3].SmbMassBalance]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3',
+               'Vx4', 'Vy4', 'Vel4', 'Pressure4', 'Bed4', 'Surface4', 'Thickness4', 'SmbMassBalance4']
+field_tolerances = [1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].SmbMassBalance,
+                md.results.TransientSolution[3].Vx,
+                md.results.TransientSolution[3].Vy,
+                md.results.TransientSolution[3].Vel,
+                md.results.TransientSolution[3].Pressure,
+                md.results.TransientSolution[3].Base,
+                md.results.TransientSolution[3].Surface,
+                md.results.TransientSolution[3].Thickness,
+                md.results.TransientSolution[3].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test229.py
===================================================================
--- /issm/trunk/test/NightlyRun/test229.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test229.py	(revision 24313)
@@ -10,62 +10,62 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.timestepping.time_step=1.
-md.settings.output_frequency=1
-md.timestepping.final_time=4.
+md.timestepping.time_step = 1.
+md.settings.output_frequency = 1
+md.timestepping.final_time = 4.
 
 #Set up transient
-smb=np.ones((md.mesh.numberofvertices))*3.6
-smb=np.vstack((smb,smb*2.)).T
+smb = np.ones((md.mesh.numberofvertices)) * 3.6
+smb = np.vstack((smb, smb * 2.)).T
 
-md.smb.mass_balance=np.vstack((smb,[1.5,3.]))
-md.transient.isthermal=False
+md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
+md.transient.isthermal = False
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
-						 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
-						 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
-						 'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
-field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].SmbMassBalance,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].SmbMassBalance,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].SmbMassBalance,
-							md.results.TransientSolution[3].Vx,
-							md.results.TransientSolution[3].Vy,
-							md.results.TransientSolution[3].Vel,
-							md.results.TransientSolution[3].Pressure,
-							md.results.TransientSolution[3].Base,
-							md.results.TransientSolution[3].Surface,
-							md.results.TransientSolution[3].Thickness,
-							md.results.TransientSolution[3].SmbMassBalance]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3',
+               'Vx4', 'Vy4', 'Vel4', 'Pressure4', 'Bed4', 'Surface4', 'Thickness4', 'SmbMassBalance4']
+field_tolerances = [1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].SmbMassBalance,
+                md.results.TransientSolution[3].Vx,
+                md.results.TransientSolution[3].Vy,
+                md.results.TransientSolution[3].Vel,
+                md.results.TransientSolution[3].Pressure,
+                md.results.TransientSolution[3].Base,
+                md.results.TransientSolution[3].Surface,
+                md.results.TransientSolution[3].Thickness,
+                md.results.TransientSolution[3].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test230.py
===================================================================
--- /issm/trunk/test/NightlyRun/test230.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test230.py	(revision 24313)
@@ -10,67 +10,67 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',350000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 350000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.timestepping.time_step=1.
-md.settings.output_frequency=1
-md.timestepping.final_time=4.
+md.timestepping.time_step = 1.
+md.settings.output_frequency = 1
+md.timestepping.final_time = 4.
 
 #Set up transient
-smb=np.ones((md.mesh.numberofvertices))*3.6
-smb=np.vstack((smb,smb*-1.)).T
+smb = np.ones((md.mesh.numberofvertices)) * 3.6
+smb = np.vstack((smb, smb * - 1.)).T
 
-md.smb.mass_balance=np.vstack((smb,[1.5,3.]))
-md.transient.isthermal=False
+md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
+md.transient.isthermal = False
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
-									'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
-									'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
-									'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassbalance4']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vz,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].SmbMassBalance,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vz,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].SmbMassBalance,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vz,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].SmbMassBalance,
-							md.results.TransientSolution[3].Vx,
-							md.results.TransientSolution[3].Vy,
-							md.results.TransientSolution[3].Vz,
-							md.results.TransientSolution[3].Vel,
-							md.results.TransientSolution[3].Pressure,
-							md.results.TransientSolution[3].Base,
-							md.results.TransientSolution[3].Surface,
-							md.results.TransientSolution[3].Thickness,
-							md.results.TransientSolution[3].SmbMassBalance]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3',
+               'Vx4', 'Vy4', 'Vz4', 'Vel4', 'Pressure4', 'Bed4', 'Surface4', 'Thickness4', 'SmbMassbalance4']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].SmbMassBalance,
+                md.results.TransientSolution[3].Vx,
+                md.results.TransientSolution[3].Vy,
+                md.results.TransientSolution[3].Vz,
+                md.results.TransientSolution[3].Vel,
+                md.results.TransientSolution[3].Pressure,
+                md.results.TransientSolution[3].Base,
+                md.results.TransientSolution[3].Surface,
+                md.results.TransientSolution[3].Thickness,
+                md.results.TransientSolution[3].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test231.py
===================================================================
--- /issm/trunk/test/NightlyRun/test231.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test231.py	(revision 24313)
@@ -10,67 +10,67 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',350000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 350000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.timestepping.time_step=1.
-md.settings.output_frequency=1
-md.timestepping.final_time=4.
+md.timestepping.time_step = 1.
+md.settings.output_frequency = 1
+md.timestepping.final_time = 4.
 
 #Set up transient
-smb=np.ones((md.mesh.numberofvertices))*3.6
-smb=np.vstack((smb,smb*2.)).T
+smb = np.ones((md.mesh.numberofvertices)) * 3.6
+smb = np.vstack((smb, smb * 2.)).T
 
-md.smb.mass_balance=np.vstack((smb,[1.5,3.]))
-md.transient.isthermal=False
+md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
+md.transient.isthermal = False
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
-									'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
-									'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
-									'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassbalance4']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vz,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].SmbMassBalance,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vz,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].SmbMassBalance,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vz,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].SmbMassBalance,
-							md.results.TransientSolution[3].Vx,
-							md.results.TransientSolution[3].Vy,
-							md.results.TransientSolution[3].Vz,
-							md.results.TransientSolution[3].Vel,
-							md.results.TransientSolution[3].Pressure,
-							md.results.TransientSolution[3].Base,
-							md.results.TransientSolution[3].Surface,
-							md.results.TransientSolution[3].Thickness,
-							md.results.TransientSolution[3].SmbMassBalance]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3',
+               'Vx4', 'Vy4', 'Vz4', 'Vel4', 'Pressure4', 'Bed4', 'Surface4', 'Thickness4', 'SmbMassbalance4']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].SmbMassBalance,
+                md.results.TransientSolution[3].Vx,
+                md.results.TransientSolution[3].Vy,
+                md.results.TransientSolution[3].Vz,
+                md.results.TransientSolution[3].Vel,
+                md.results.TransientSolution[3].Pressure,
+                md.results.TransientSolution[3].Base,
+                md.results.TransientSolution[3].Surface,
+                md.results.TransientSolution[3].Thickness,
+                md.results.TransientSolution[3].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test232.py
===================================================================
--- /issm/trunk/test/NightlyRun/test232.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test232.py	(revision 24313)
@@ -10,32 +10,35 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.thermal.spctemperature=np.vstack((np.vstack((md.thermal.spctemperature, md.thermal.spctemperature+5., md.thermal.spctemperature+10., md.thermal.spctemperature+15.)).T, [1.5,2.5,3.5,4.]))
-md.timestepping.time_step=1.
-md.timestepping.final_time=4.
-md.transient.isstressbalance=False
-md.transient.ismasstransport=False
-md.transient.issmb=True
-md.transient.isthermal=True
-md.transient.isgroundingline=False
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.thermal.spctemperature = np.vstack((np.vstack((md.thermal.spctemperature,
+                                                  md.thermal.spctemperature + 5.,
+                                                  md.thermal.spctemperature + 10.,
+                                                  md.thermal.spctemperature + 15.)).T, [1.5, 2.5, 3.5, 4.]))
+md.timestepping.time_step = 1.
+md.timestepping.final_time = 4.
+md.transient.isstressbalance = False
+md.transient.ismasstransport = False
+md.transient.issmb = True
+md.transient.isthermal = True
+md.transient.isgroundingline = False
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Temperature1','BasalforcingsGroundediceMeltingRate1',
-									'Temperature2','BasalforcingsGroundediceMeltingRate2',
-									'Temperature3','BasalforcingsGroundediceMeltingRate3',
-									'Temperature4','BasalforcingsGroundediceMeltingRate4']
-field_tolerances=[1e-13,1e-6,1e-13,1e-6,1e-13,1e-6,1e-13,1e-6]
-field_values=[md.results.TransientSolution[0].Temperature,
-							md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
-							md.results.TransientSolution[1].Temperature,
-							md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
-							md.results.TransientSolution[2].Temperature,
-							md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,
-							md.results.TransientSolution[3].Temperature,
-							md.results.TransientSolution[3].BasalforcingsGroundediceMeltingRate]
+field_names = ['Temperature1', 'BasalforcingsGroundediceMeltingRate1',
+               'Temperature2', 'BasalforcingsGroundediceMeltingRate2',
+               'Temperature3', 'BasalforcingsGroundediceMeltingRate3',
+               'Temperature4', 'BasalforcingsGroundediceMeltingRate4']
+field_tolerances = [1e-13, 1e-6, 1e-13, 1e-6, 1e-13, 1e-6, 1e-13, 1e-6]
+field_values = [md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[3].Temperature,
+                md.results.TransientSolution[3].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test233.py
===================================================================
--- /issm/trunk/test/NightlyRun/test233.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test233.py	(revision 24313)
@@ -10,62 +10,62 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',200000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.thermal.spctemperature=np.vstack((np.vstack((md.thermal.spctemperature, md.thermal.spctemperature+5.)).T, [1.,2.]))
-md.timestepping.time_step=0.5
-md.timestepping.final_time=2.
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 200000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.thermal.spctemperature = np.vstack((np.vstack((md.thermal.spctemperature, md.thermal.spctemperature + 5.)).T, [1., 2.]))
+md.timestepping.time_step = 0.5
+md.timestepping.final_time = 2.
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1',
-        'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2',
-        'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3',
-        'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','Temperature4','BasalforcingsGroundediceMeltingRate4']
-field_tolerances=[1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,
-        1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06,
-        1e-08,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06,
-        1e-08,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06]
-field_values=[md.results.TransientSolution[0].Vx,
-        md.results.TransientSolution[0].Vy,
-        md.results.TransientSolution[0].Vz,
-        md.results.TransientSolution[0].Vel,
-        md.results.TransientSolution[0].Pressure,
-        md.results.TransientSolution[0].Base,
-        md.results.TransientSolution[0].Surface,
-        md.results.TransientSolution[0].Thickness,
-        md.results.TransientSolution[0].Temperature,
-        md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
-        md.results.TransientSolution[1].Vx,
-        md.results.TransientSolution[1].Vy,
-        md.results.TransientSolution[1].Vz,
-        md.results.TransientSolution[1].Vel,
-        md.results.TransientSolution[1].Pressure,
-        md.results.TransientSolution[1].Base,
-        md.results.TransientSolution[1].Surface,
-        md.results.TransientSolution[1].Thickness,
-        md.results.TransientSolution[1].Temperature,
-        md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
-        md.results.TransientSolution[2].Vx,
-        md.results.TransientSolution[2].Vy,
-        md.results.TransientSolution[2].Vz,
-        md.results.TransientSolution[2].Vel,
-        md.results.TransientSolution[2].Pressure,
-        md.results.TransientSolution[2].Base,
-        md.results.TransientSolution[2].Surface,
-        md.results.TransientSolution[2].Thickness,
-        md.results.TransientSolution[2].Temperature,
-        md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,
-        md.results.TransientSolution[3].Vx,
-        md.results.TransientSolution[3].Vy,
-        md.results.TransientSolution[3].Vz,
-        md.results.TransientSolution[3].Vel,
-        md.results.TransientSolution[3].Pressure,
-        md.results.TransientSolution[3].Base,
-        md.results.TransientSolution[3].Surface,
-        md.results.TransientSolution[3].Thickness,
-        md.results.TransientSolution[3].Temperature,
-        md.results.TransientSolution[3].BasalforcingsGroundediceMeltingRate]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Temperature3', 'BasalforcingsGroundediceMeltingRate3',
+               'Vx4', 'Vy4', 'Vz4', 'Vel4', 'Pressure4', 'Bed4', 'Surface4', 'Thickness4', 'Temperature4', 'BasalforcingsGroundediceMeltingRate4']
+field_tolerances = [1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09,
+                    1e-09, 1e-09, 1e-08, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-06,
+                    1e-08, 1e-09, 1e-08, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-06,
+                    1e-08, 1e-09, 1e-08, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-06]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[3].Vx,
+                md.results.TransientSolution[3].Vy,
+                md.results.TransientSolution[3].Vz,
+                md.results.TransientSolution[3].Vel,
+                md.results.TransientSolution[3].Pressure,
+                md.results.TransientSolution[3].Base,
+                md.results.TransientSolution[3].Surface,
+                md.results.TransientSolution[3].Thickness,
+                md.results.TransientSolution[3].Temperature,
+                md.results.TransientSolution[3].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test234.m
===================================================================
--- /issm/trunk/test/NightlyRun/test234.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test234.m	(revision 24313)
@@ -24,5 +24,5 @@
 md.qmu.numberofpartitions=20;
 md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
-md.qmu.partition=md.qmu.partition-1;
+md.qmu.vpartition=md.qmu.vpartition-1;
 
 %variables
Index: /issm/trunk/test/NightlyRun/test234.py
===================================================================
--- /issm/trunk/test/NightlyRun/test234.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test234.py	(revision 24313)
@@ -1,6 +1,6 @@
 #Test Name: SquareShelfTranForceNeg2dDakotaSamp
 import numpy as np
-import scipy.io as spio
 from os import getcwd
+from IssmConfig import IssmConfig
 from model import *
 from socket import gethostname
@@ -14,9 +14,9 @@
 from dmeth_params_set import *
 
-md = triangle(model(),'../Exp/Square.exp',180000.)
-md = setmask(md,'all','')
-md = parameterize(md,'../Par/SquareShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 md.timestepping.time_step = 1
@@ -24,9 +24,9 @@
 md.timestepping.final_time = 4
 
-smb = np.ones((md.mesh.numberofvertices,))*3.6
-smb = np.array([smb,smb*-1]).T
+smb = np.ones((md.mesh.numberofvertices, )) * 3.6
+smb = np.array([smb, smb * - 1]).T
 
 md.smb.mass_balance = smb
-md.smb.mass_balance = np.concatenate((md.smb.mass_balance,[[1.5,3]]))
+md.smb.mass_balance = np.concatenate((md.smb.mass_balance, [[1.5, 3]]))
 md.transient.isthermal = 0
 
@@ -39,30 +39,30 @@
 #partitioning
 md.qmu.numberofpartitions = 20
-md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on')
-md.qmu.partition = md.qmu.partition - 1
+md = partitioner(md, 'package', 'chaco', 'npart', md.qmu.numberofpartitions, 'weighting', 'on')
+md.qmu.vpartition = md.qmu.vpartition - 1
 
 #variables
-md.qmu.variables.surface_mass_balance = normal_uncertain.normal_uncertain('scaled_SmbMassBalance',1,0.1)
+md.qmu.variables.surface_mass_balance = normal_uncertain.normal_uncertain('scaled_SmbMassBalance', 1, 0.1)
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.IceVolume = response_function.response_function('IceVolume',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.massFlux6 = response_function.response_function('indexed_MassFlux_6',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.IceVolume = response_function.response_function('IceVolume', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.massFlux6 = response_function.response_function('indexed_MassFlux_6', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
 
 #mass flux profiles
-md.qmu.mass_flux_profiles = ['../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp']
+md.qmu.mass_flux_profiles = ['../Exp/MassFlux1.exp', '../Exp/MassFlux2.exp', '../Exp/MassFlux3.exp', '../Exp/MassFlux4.exp', '../Exp/MassFlux5.exp', '../Exp/MassFlux6.exp']
 md.qmu.mass_flux_profile_directory = getcwd()
 
-##  nond_sampling study
+#  nond_sampling study
 md.qmu.method = dakota_method.dakota_method('nond_samp')
-md.qmu.method = dmeth_params_set(md.qmu.method,'seed',1234,'samples',20,'sample_type','lhs')
+md.qmu.method = dmeth_params_set(md.qmu.method, 'seed', 1234, 'samples', 20, 'sample_type', 'lhs')
 dver = str(version)
-if ((int(dver[0]) == 4 and int(dver[2])>2) or int(dver[0])>4):
-	md.qmu.method = dmeth_params_set(md.qmu.method,'rng','rnum2')
+if ((int(dver[0]) == 4 and int(dver[2]) > 2) or int(dver[0]) > 4):
+    md.qmu.method = dmeth_params_set(md.qmu.method, 'rng', 'rnum2')
 
 #parameters
@@ -74,17 +74,17 @@
 
 if version >= 6:
-	md.qmu.params.analysis_driver = 'matlab'
-	md.qmu.params.evaluation_scheduling = 'master'
-	md.qmu.params.processors_per_evaluation = 2
+    md.qmu.params.analysis_driver = 'matlab'
+    md.qmu.params.evaluation_scheduling = 'master'
+    md.qmu.params.processors_per_evaluation = 2
 else:
-	md.qmu.params.analysis_driver = 'stressbalance'
-	md.qmu.params.evaluation_concurrency = 1
+    md.qmu.params.analysis_driver = 'stressbalance'
+    md.qmu.params.evaluation_concurrency = 1
 
-md.stressbalance.reltol = 10**-5 #tighten for qmu analyses
+md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
 md.transient.requested_outputs = ['IceVolume']
 
 #solve
-md.verbose = verbose('000000000')	# this line is recommended
-md = solve(md,'Transient','overwrite','y')
+md.verbose = verbose('000000000')  # this line is recommended
+md = solve(md, 'Transient', 'overwrite', 'y')
 md.qmu.results = md.results.dakota
 
@@ -92,10 +92,10 @@
 md.results.dakota.moments = []
 for i in range(8):
-	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].mean)
+    md.results.dakota.moments.append(md.results.dakota.dresp_out[i].mean)
 
 for i in range(8):
-	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].stddev)
+    md.results.dakota.moments.append(md.results.dakota.dresp_out[i].stddev)
 
-field_names      = ['moments']
+field_names = ['moments']
 field_tolerances = [1e-11]
 field_values = [md.results.dakota.moments]
Index: /issm/trunk/test/NightlyRun/test235.m
===================================================================
--- /issm/trunk/test/NightlyRun/test235.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test235.m	(revision 24313)
@@ -24,5 +24,5 @@
 md.qmu.numberofpartitions=20;
 md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
-md.qmu.partition=md.qmu.partition-1;
+md.qmu.vpartition=md.qmu.vpartition-1;
 
 %variables
Index: /issm/trunk/test/NightlyRun/test235.py
===================================================================
--- /issm/trunk/test/NightlyRun/test235.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test235.py	(revision 24313)
@@ -1,7 +1,7 @@
 #Test Name: SquareShelfTranForceNeg2dDakotaLocal
 import numpy as np
-import scipy.io as spio
 from os import getcwd
 from model import *
+from IssmConfig import IssmConfig
 from socket import gethostname
 from triangle import *
@@ -14,9 +14,9 @@
 from dmeth_params_set import *
 
-md = triangle(model(),'../Exp/Square.exp',180000.)
-md = setmask(md,'all','')
-md = parameterize(md,'../Par/SquareShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 md.timestepping.time_step = 1
@@ -24,9 +24,9 @@
 md.timestepping.final_time = 4
 
-smb = np.ones((md.mesh.numberofvertices,))*3.6
-smb = np.array([smb,smb*-1]).T
+smb = np.ones((md.mesh.numberofvertices, )) * 3.6
+smb = np.array([smb, smb * - 1]).T
 
 md.smb.mass_balance = smb
-md.smb.mass_balance = np.concatenate((md.smb.mass_balance,[[1.5,3]]))
+md.smb.mass_balance = np.concatenate((md.smb.mass_balance, [[1.5, 3]]))
 md.transient.isthermal = 0
 
@@ -39,22 +39,22 @@
 #partitioning
 md.qmu.numberofpartitions = 20
-md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on')
-md.qmu.partition = md.qmu.partition - 1
+md = partitioner(md, 'package', 'chaco', 'npart', md.qmu.numberofpartitions, 'weighting', 'on')
+md.qmu.vpartition = md.qmu.vpartition - 1
 
 #variables
-md.qmu.variables.surface_mass_balance = normal_uncertain.normal_uncertain('scaled_SmbMassBalance',1,100)
+md.qmu.variables.surface_mass_balance = normal_uncertain.normal_uncertain('scaled_SmbMassBalance', 1, 100)
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.IceVolume = response_function.response_function('IceVolume',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.massFlux6 = response_function.response_function('indexed_MassFlux_6',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.IceVolume = response_function.response_function('IceVolume', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.massFlux6 = response_function.response_function('indexed_MassFlux_6', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
 
 #mass flux profiles
-md.qmu.mass_flux_profiles = ['../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp']
+md.qmu.mass_flux_profiles = ['../Exp/MassFlux1.exp', '../Exp/MassFlux2.exp', '../Exp/MassFlux3.exp', '../Exp/MassFlux4.exp', '../Exp/MassFlux5.exp', '../Exp/MassFlux6.exp']
 md.qmu.mass_flux_profile_directory = getcwd()
 
@@ -70,17 +70,17 @@
 
 if version >= 6:
-	md.qmu.params.analysis_driver = 'matlab'
-	md.qmu.params.evaluation_scheduling = 'master'
-	md.qmu.params.processors_per_evaluation = 2
+    md.qmu.params.analysis_driver = 'matlab'
+    md.qmu.params.evaluation_scheduling = 'master'
+    md.qmu.params.processors_per_evaluation = 2
 else:
-	md.qmu.params.analysis_driver = 'stressbalance'
-	md.qmu.params.evaluation_concurrency = 1
+    md.qmu.params.analysis_driver = 'stressbalance'
+    md.qmu.params.evaluation_concurrency = 1
 
-md.stressbalance.reltol = 10**-5 #tighten for qmu analyses
+md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
 md.transient.requested_outputs = ['IceVolume']
 
 #solve
-md.verbose = verbose('000000000')	# this line is recommended
-md = solve(md,'Transient','overwrite','y')
+md.verbose = verbose('000000000')  # this line is recommended
+md = solve(md, 'Transient', 'overwrite', 'y')
 md.qmu.results = md.results.dakota
 
@@ -88,10 +88,10 @@
 md.results.dakota.moments = []
 for i in range(8):
-	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].mean)
+    md.results.dakota.moments.append(md.results.dakota.dresp_out[i].mean)
 
 for i in range(8):
-	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].stddev)
+    md.results.dakota.moments.append(md.results.dakota.dresp_out[i].stddev)
 
-field_names      = ['moments']
+field_names = ['moments']
 field_tolerances = [1e-11]
 field_values = [md.results.dakota.moments]
Index: /issm/trunk/test/NightlyRun/test236.m
===================================================================
--- /issm/trunk/test/NightlyRun/test236.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test236.m	(revision 24313)
@@ -64,6 +64,4 @@
 md.timestepping.final_time=60;
 
-% 
-md.transient.requested_outputs={'default','SmbMonthlytemperatures'};
 md=setflowequation(md,'SSA','all');
 md.cluster=generic('name',oshostname(),'np',1); % 3 for the cluster
@@ -71,10 +69,10 @@
 
 %Fields and tolerances to track changes
-field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMonthlytemperatures1','SmbMassBalance1',...
-	   'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMonthlytemperatures2','SmbMassBalance2',...
-	   'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMonthlytemperatures3','SmbMassBalance3'};
-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
-	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
-	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',...
+	   'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',...
+	   'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
 field_values={...
 	(md.results.TransientSolution(1).Vx),...
@@ -85,5 +83,4 @@
 	(md.results.TransientSolution(1).Surface),...
 	(md.results.TransientSolution(1).Thickness),...
-	(md.results.TransientSolution(1).SmbMonthlytemperatures),...
 	(md.results.TransientSolution(1).SmbMassBalance),...
 	(md.results.TransientSolution(2).Vx),...
@@ -94,5 +91,4 @@
 	(md.results.TransientSolution(2).Surface),...
 	(md.results.TransientSolution(2).Thickness),...
-	(md.results.TransientSolution(2).SmbMonthlytemperatures),...
 	(md.results.TransientSolution(2).SmbMassBalance),...
 	(md.results.TransientSolution(3).Vx),...
@@ -103,5 +99,4 @@
 	(md.results.TransientSolution(3).Surface),...
 	(md.results.TransientSolution(3).Thickness),...
-	(md.results.TransientSolution(3).SmbMonthlytemperatures),...
 	(md.results.TransientSolution(3).SmbMassBalance),...
 	};
Index: /issm/trunk/test/NightlyRun/test236.py
===================================================================
--- /issm/trunk/test/NightlyRun/test236.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test236.py	(revision 24313)
@@ -10,101 +10,96 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
 
 # Use of ispdd and isdelta18o methods
 md.smb = SMBpdd()
-md.smb.isdelta18o=1
-md.smb.ismungsm=0
+md.smb.isdelta18o = 1
+md.smb.ismungsm = 0
 
 # Add temperature, precipitation and delta18o needed to measure the surface mass balance
 # creating delta18o
-delta18o=np.loadtxt('../Data/delta18o.data')
-md.smb.delta18o=delta18o
+delta18o = np.loadtxt('../Data/delta18o.data')
+md.smb.delta18o = delta18o
 # creating delta18oSurface
-md.smb.delta18o_surface = np.zeros((2,np.size(delta18o,axis=1)))
-md.smb.delta18o_surface[1,:] = delta18o[1,:]
+md.smb.delta18o_surface = np.zeros((2, np.size(delta18o, axis=1)))
+md.smb.delta18o_surface[1, :] = delta18o[1, :]
 
 # creating Present day and lgm temperatures
 # Same temperature over the all region:
-tmonth=np.ones(12)*(238.15+20.)
-md.smb.temperatures_presentday=np.zeros((md.mesh.numberofvertices+1,12))
-md.smb.temperatures_lgm=np.zeros((md.mesh.numberofvertices+1,12))
-for imonth in xrange(0,12):
-    md.smb.temperatures_presentday[0:md.mesh.numberofvertices,imonth]=tmonth[imonth]
-    md.smb.temperatures_lgm[0:md.mesh.numberofvertices,imonth]=tmonth[imonth]-20.
-    # Time for the last line:
-    md.smb.temperatures_presentday[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.)
-    md.smb.temperatures_lgm[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.)
+tmonth = np.ones(12) * (238.15 + 20.)
+md.smb.temperatures_presentday = np.zeros((md.mesh.numberofvertices + 1, 12))
+md.smb.temperatures_lgm = np.zeros((md.mesh.numberofvertices + 1, 12))
+for imonth in range(0, 12):
+    md.smb.temperatures_presentday[0:md.mesh.numberofvertices, imonth] = tmonth[imonth]
+    md.smb.temperatures_lgm[0:md.mesh.numberofvertices, imonth] = tmonth[imonth] - 20.
+# Time for the last line:
+    md.smb.temperatures_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
+    md.smb.temperatures_lgm[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
 
 # creating initialization and spc temperatures initialization and spc
-md.thermal.spctemperature=np.mean(md.smb.temperatures_lgm[0:md.mesh.numberofvertices,:],axis=1)    #-10*ones(md.mesh.numberofvertices,1)
-md.thermal.spctemperature=np.tile(md.thermal.spctemperature,(int(md.timestepping.final_time/md.timestepping.time_step),1)).T
-itemp=np.arange(0,md.timestepping.final_time,md.timestepping.time_step)
-md.thermal.spctemperature=np.vstack((md.thermal.spctemperature,itemp))
+md.thermal.spctemperature = np.mean(md.smb.temperatures_lgm[0:md.mesh.numberofvertices, :], axis=1)  # - 10 * ones(md.mesh.numberofvertices, 1)
+md.thermal.spctemperature = np.tile(md.thermal.spctemperature, (int(md.timestepping.final_time / md.timestepping.time_step), 1)).T
+itemp = np.arange(0, md.timestepping.final_time, md.timestepping.time_step)
+md.thermal.spctemperature = np.vstack((md.thermal.spctemperature, itemp))
 
-md.initialization.temperature=md.smb.temperatures_lgm[0:md.mesh.numberofvertices,0]    #*ones(md.mesh.numberofvertices,1)
+md.initialization.temperature = md.smb.temperatures_lgm[0:md.mesh.numberofvertices, 0]  # * ones(md.mesh.numberofvertices, 1)
 md.smb.initialize(md)
 
 # creating precipitation
-md.smb.precipitations_presentday=np.zeros((md.mesh.numberofvertices+1,12))
-md.smb.precipitations_lgm=np.zeros((md.mesh.numberofvertices+1,12))
-for imonth in xrange(0,12):
-	md.smb.precipitations_presentday[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5
-	md.smb.precipitations_presentday[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.)
-	md.smb.precipitations_lgm[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5
-	md.smb.precipitations_lgm[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.)
+md.smb.precipitations_presentday = np.zeros((md.mesh.numberofvertices + 1, 12))
+md.smb.precipitations_lgm = np.zeros((md.mesh.numberofvertices + 1, 12))
+for imonth in range(0, 12):
+    md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = -0.4 * 10**(-6) * md.mesh.y + 0.5
+    md.smb.precipitations_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
+    md.smb.precipitations_lgm[0:md.mesh.numberofvertices, imonth] = -0.4 * 10**(-6) * md.mesh.y + 0.5
+    md.smb.precipitations_lgm[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
 
 # Interpolation factors
-md.smb.Tdiff=0.5*np.ones((2,int(md.timestepping.final_time)))
-md.smb.sealev=0.5*np.ones((2,int(md.timestepping.final_time)))
+md.smb.Tdiff = 0.5 * np.ones((2, int(md.timestepping.final_time)))
+md.smb.sealev = 0.5 * np.ones((2, int(md.timestepping.final_time)))
 # Year of each data point
-md.smb.Tdiff[1,1:int(md.timestepping.final_time)]=np.arange(1.,int(md.timestepping.final_time))
-md.smb.sealev[1,1:int(md.timestepping.final_time)]=np.arange(1.,int(md.timestepping.final_time))
+md.smb.Tdiff[1, 1:int(md.timestepping.final_time)] = np.arange(1., int(md.timestepping.final_time))
+md.smb.sealev[1, 1:int(md.timestepping.final_time)] = np.arange(1., int(md.timestepping.final_time))
 
 # time steps and resolution
-md.timestepping.time_step=20.
-md.timestepping.final_time=60.
+md.timestepping.time_step = 20.
+md.timestepping.final_time = 60.
 
 
-#
-md.transient.requested_outputs=['default','SmbMonthlytemperatures']
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMonthlytemperatures1','SmbMassBalance1',
-									'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMonthlytemperatures2','SmbMassBalance2',
-									'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMonthlytemperatures3','SmbMassBalance3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].SmbMonthlytemperatures,
-							md.results.TransientSolution[0].SmbMassBalance,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].SmbMonthlytemperatures,
-							md.results.TransientSolution[1].SmbMassBalance,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].SmbMonthlytemperatures,
-							md.results.TransientSolution[2].SmbMassBalance]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test237.m
===================================================================
--- /issm/trunk/test/NightlyRun/test237.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test237.m	(revision 24313)
@@ -55,6 +55,4 @@
 end
 
-%
-md.transient.requested_outputs={'default','SmbMonthlytemperatures'};
 md=extrude(md,3,1);
 
@@ -64,11 +62,11 @@
 
 %Fields and tolerances to track changes
-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1','SmbMonthlytemperatures1','SmbMassBalance1',...
-						'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2','SmbMonthlytemperatures2','SmbMassBalance2',...
-						'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3','SmbMonthlytemperatures3','SmbMassBalance3'};
+field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1','SmbMassBalance1',...
+						'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2','SmbMassBalance2',...
+						'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3','SmbMassBalance3'};
 field_tolerances={...
-	1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,1e-8,1e-8,1e-13,1e-8,1e-13,1e-13,...
-	1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,1e-8,1e-8,1e-13,1e-7,1e-13,1e-13,...
-	1e-13,1e-13,1e-08,1e-13,1e-13,1e-8,1e-8,1e-8,1e-13,5e-7,1e-13,1e-13};
+	1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,1e-8,1e-8,1e-13,1e-8,1e-13,...
+	1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,1e-8,1e-8,1e-13,1e-7,1e-13,...
+	1e-13,1e-13,1e-08,1e-13,1e-13,1e-8,1e-8,1e-8,1e-13,5e-7,1e-13};
 field_values={...
 	(md.results.TransientSolution(1).Vx),...
@@ -82,5 +80,4 @@
 	(md.results.TransientSolution(1).Temperature),...
 	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
-	(md.results.TransientSolution(1).SmbMonthlytemperatures),...
 	(md.results.TransientSolution(1).SmbMassBalance),...
 	(md.results.TransientSolution(2).Vx),...
@@ -94,5 +91,4 @@
 	(md.results.TransientSolution(2).Temperature),...
 	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
-	(md.results.TransientSolution(2).SmbMonthlytemperatures),...
 	(md.results.TransientSolution(2).SmbMassBalance),...
 	(md.results.TransientSolution(3).Vx),...
@@ -106,5 +102,4 @@
 	(md.results.TransientSolution(3).Temperature),...
 	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
-	(md.results.TransientSolution(3).SmbMonthlytemperatures),...
 	(md.results.TransientSolution(3).SmbMassBalance),...
 	};
Index: /issm/trunk/test/NightlyRun/test237.py
===================================================================
--- /issm/trunk/test/NightlyRun/test237.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test237.py	(revision 24313)
@@ -11,112 +11,105 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',600000)    #180000
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
+md = triangle(model(), '../Exp/Square.exp', 600000)  #180000
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
 
 # Use of ispdd and isdelta18o methods
 md.smb = SMBpdd()
-md.smb.isdelta18o=0
-md.smb.ismungsm=1
+md.smb.isdelta18o = 0
+md.smb.ismungsm = 1
 
 # time steps and resolution
-md.timestepping.time_step=20.
-md.settings.output_frequency=1
-md.timestepping.final_time=60.
+md.timestepping.time_step = 20.
+md.settings.output_frequency = 1
+md.timestepping.final_time = 60.
 
 # creating Present day and lgm temperatures
 # Same temperature over the all region:
-tmonth=np.ones(12)*(238.15+20.)
-md.smb.temperatures_presentday=np.zeros((md.mesh.numberofvertices+1,12))
-md.smb.temperatures_lgm=np.zeros((md.mesh.numberofvertices+1,12))
-for imonth in xrange(0,12):
-    md.smb.temperatures_presentday[0:md.mesh.numberofvertices,imonth]=tmonth[imonth]
-    md.smb.temperatures_lgm[0:md.mesh.numberofvertices,imonth]=tmonth[imonth]-20.
-    # Time for the last line:
-    md.smb.temperatures_presentday[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.)
-    md.smb.temperatures_lgm[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.)
+tmonth = np.ones(12) * (238.15 + 20.)
+md.smb.temperatures_presentday = np.zeros((md.mesh.numberofvertices + 1, 12))
+md.smb.temperatures_lgm = np.zeros((md.mesh.numberofvertices + 1, 12))
+for imonth in range(0, 12):
+    md.smb.temperatures_presentday[0:md.mesh.numberofvertices, imonth] = tmonth[imonth]
+    md.smb.temperatures_lgm[0:md.mesh.numberofvertices, imonth] = tmonth[imonth] - 20.
+# Time for the last line:
+    md.smb.temperatures_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
+    md.smb.temperatures_lgm[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
 
 # creating initialization and spc temperatures initialization and spc
-md.thermal.spctemperature=np.mean(md.smb.temperatures_lgm[0:md.mesh.numberofvertices,:],axis=1)    #-10*ones(md.mesh.numberofvertices,1)
-md.thermal.spctemperature=np.tile(md.thermal.spctemperature,(int(md.timestepping.final_time/md.timestepping.time_step),1)).T
-itemp=np.arange(0,md.timestepping.final_time,md.timestepping.time_step)
-md.thermal.spctemperature=np.vstack((md.thermal.spctemperature,itemp))
+md.thermal.spctemperature = np.mean(md.smb.temperatures_lgm[0:md.mesh.numberofvertices, :], axis=1)  # - 10 * ones(md.mesh.numberofvertices, 1)
+md.thermal.spctemperature = np.tile(md.thermal.spctemperature, (int(md.timestepping.final_time / md.timestepping.time_step), 1)).T
+itemp = np.arange(0, md.timestepping.final_time, md.timestepping.time_step)
+md.thermal.spctemperature = np.vstack((md.thermal.spctemperature, itemp))
 
-md.initialization.temperature=md.smb.temperatures_lgm[0:md.mesh.numberofvertices,0]   #*ones(md.mesh.numberofvertices,1)
+md.initialization.temperature = md.smb.temperatures_lgm[0:md.mesh.numberofvertices, 0]  # * ones(md.mesh.numberofvertices, 1)
 md.smb.initialize(md)
 
 # creating precipitation
-md.smb.precipitations_presentday=np.zeros((md.mesh.numberofvertices+1,12))
-md.smb.precipitations_lgm=np.zeros((md.mesh.numberofvertices+1,12))
-for imonth in xrange(0,12):
-    md.smb.precipitations_presentday[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5
-    md.smb.precipitations_presentday[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.)
-    md.smb.precipitations_lgm[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5
-    md.smb.precipitations_lgm[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.)
+md.smb.precipitations_presentday = np.zeros((md.mesh.numberofvertices + 1, 12))
+md.smb.precipitations_lgm = np.zeros((md.mesh.numberofvertices + 1, 12))
+for imonth in range(0, 12):
+    md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = -0.4 * 10**(-6) * md.mesh.y + 0.5
+    md.smb.precipitations_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
+    md.smb.precipitations_lgm[0:md.mesh.numberofvertices, imonth] = -0.4 * 10**(-6) * md.mesh.y + 0.5
+    md.smb.precipitations_lgm[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
 
-fsize=int(md.timestepping.final_time/md.timestepping.time_step)+2
-md.smb.Pfac=np.zeros((2,fsize))
-md.smb.Tdiff=np.zeros((2,fsize))
-md.smb.sealev=np.zeros((2,fsize))
-for iint in xrange(0,fsize):
+fsize = int(md.timestepping.final_time / md.timestepping.time_step) + 2
+md.smb.Pfac = np.zeros((2, fsize))
+md.smb.Tdiff = np.zeros((2, fsize))
+md.smb.sealev = np.zeros((2, fsize))
+for iint in range(0, fsize):
     # Interpolation factors
-	 md.smb.Pfac[0,iint]=0.15*(iint+1)
-	 md.smb.Tdiff[0,iint]=0.15*(iint+1)
-	 md.smb.sealev[0,iint]=0.15*(iint+1)
-	 # Year of each data point
-	 md.smb.Pfac[1,iint]=(float(iint))*20
-	 md.smb.Tdiff[1,iint]=(float(iint))*20
-	 md.smb.sealev[1,iint]=(float(iint))*20
+    md.smb.Pfac[0, iint] = 0.15 * (iint + 1)
+    md.smb.Tdiff[0, iint] = 0.15 * (iint + 1)
+    md.smb.sealev[0, iint] = 0.15 * (iint + 1)
+    # Year of each data point
+    md.smb.Pfac[1, iint] = (float(iint)) * 20
+    md.smb.Tdiff[1, iint] = (float(iint)) * 20
+    md.smb.sealev[1, iint] = (float(iint)) * 20
 
-#
-md.transient.requested_outputs=['default','SmbMonthlytemperatures']
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md=solve(md,'Transient')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1','SmbMonthlytemperatures1','SmbMassBalance1',\
-		'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2','SmbMonthlytemperatures2','SmbMassBalance2',\
-		'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3','SmbMonthlytemperatures3','SmbMassBalance3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,1e-8,1e-8,1e-13,1e-8,1e-13,1e-13,\
-		1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,1e-8,1e-8,7e-13,1e-7,1e-13,1e-13,\
-		1e-13,1e-13,1e-08,1e-13,1e-13,1e-8,1e-8,1e-8,7e-13,5e-7,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vz,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[0].SmbMonthlytemperatures,\
-	md.results.TransientSolution[0].SmbMassBalance,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vz,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[1].SmbMonthlytemperatures,\
-	md.results.TransientSolution[1].SmbMassBalance,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vz,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].Temperature,\
-	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[2].SmbMonthlytemperatures,\
-	md.results.TransientSolution[2].SmbMassBalance,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Temperature3', 'BasalforcingsGroundediceMeltingRate3', 'SmbMassBalance3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-8, 1e-8, 1e-8, 1e-13, 1e-8, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-8, 1e-8, 1e-8, 7e-13, 2e-7, 1e-13,
+                    1e-13, 1e-13, 1e-08, 1e-13, 1e-13, 1e-8, 1e-8, 1e-8, 7e-13, 5e-7, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[2].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test238.m
===================================================================
--- /issm/trunk/test/NightlyRun/test238.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test238.m	(revision 24313)
@@ -44,6 +44,4 @@
 md.timestepping.final_time=60;
 
-% 
-md.transient.requested_outputs={'default','SmbMonthlytemperatures'};
 md=setflowequation(md,'SSA','all');
 md.cluster=generic('name',oshostname(),'np',1); % 3 for the cluster
@@ -51,10 +49,10 @@
 
 %Fields and tolerances to track changes
-field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMonthlytemperatures1','SmbMassBalance1',...
-	      'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMonthlytemperatures2','SmbMassBalance2',...
-	      'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMonthlytemperatures3','SmbMassBalance3'};
-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
-	   1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
-	   1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',...
+	      'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',...
+	      'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	   1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	   1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
 field_values={...
 	(md.results.TransientSolution(1).Vx),...
@@ -65,5 +63,4 @@
 	(md.results.TransientSolution(1).Surface),...
 	(md.results.TransientSolution(1).Thickness),...
-	(md.results.TransientSolution(1).SmbMonthlytemperatures),...
 	(md.results.TransientSolution(1).SmbMassBalance),...
 	(md.results.TransientSolution(2).Vx),...
@@ -74,5 +71,4 @@
 	(md.results.TransientSolution(2).Surface),...
 	(md.results.TransientSolution(2).Thickness),...
-	(md.results.TransientSolution(2).SmbMonthlytemperatures),...
 	(md.results.TransientSolution(2).SmbMassBalance),...
 	(md.results.TransientSolution(3).Vx),...
@@ -83,5 +79,4 @@
 	(md.results.TransientSolution(3).Surface),...
 	(md.results.TransientSolution(3).Thickness),...
-	(md.results.TransientSolution(3).SmbMonthlytemperatures),...
 	(md.results.TransientSolution(3).SmbMassBalance),...
 	};
Index: /issm/trunk/test/NightlyRun/test238.py
===================================================================
--- /issm/trunk/test/NightlyRun/test238.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test238.py	(revision 24313)
@@ -1,3 +1,3 @@
-#Test Name: SquareShelfTranIspddIsdeltaO18pdSSA2d 
+#Test Name: SquareShelfTranIspddIsdeltaO18pdSSA2d
 import numpy as np
 from model import *
@@ -10,83 +10,76 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
 
 # Use of ispdd and isdelta18o methods
 md.smb = SMBd18opdd()
-md.smb.isd18opd=1
+md.smb.isd18opd = 1
 
 # Add temperature, precipitation and delta18o needed to measure the surface mass balance
 # creating delta18o
-delta18o=np.loadtxt('../Data/delta18o.data')
-md.smb.delta18o=delta18o
+delta18o = np.loadtxt('../Data/delta18o.data')
+md.smb.delta18o = delta18o
 
 # creating Present day temperatures
 # Same temperature over the all region:
-tmonth=np.ones(12)*(238.15+20.)
-md.smb.temperatures_presentday=np.zeros((md.mesh.numberofvertices+1,12))
-for imonth in xrange(0,12):
-    md.smb.temperatures_presentday[0:md.mesh.numberofvertices,imonth]=tmonth[imonth]
-    # Time for the last line:
-    md.smb.temperatures_presentday[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.)
+tmonth = np.ones(12) * (238.15 + 20.)
+md.smb.temperatures_presentday = np.zeros((md.mesh.numberofvertices + 1, 12))
+for imonth in range(0, 12):
+    md.smb.temperatures_presentday[0:md.mesh.numberofvertices, imonth] = tmonth[imonth]
+# Time for the last line:
+    md.smb.temperatures_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
 
 # creating initialization and spc temperatures initialization and spc
-md.thermal.spctemperature=np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices,:],axis=1).reshape(-1,1)
-md.thermal.spctemperature=md.thermal.spctemperature-10
-md.initialization.temperature=md.thermal.spctemperature
+md.thermal.spctemperature = np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices, :], axis=1).reshape(-1, 1)
+md.thermal.spctemperature = md.thermal.spctemperature - 10
+md.initialization.temperature = md.thermal.spctemperature
 md.smb.initialize(md)
 
 # creating precipitation
-md.smb.precipitations_presentday=np.zeros((md.mesh.numberofvertices+1,12))
-for imonth in xrange(0,12):
-    md.smb.precipitations_presentday[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5
-    md.smb.precipitations_presentday[md.mesh.numberofvertices,imonth]=(float(imonth)/12.)
+md.smb.precipitations_presentday = np.zeros((md.mesh.numberofvertices + 1, 12))
+for imonth in range(0, 12):
+    md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = -0.4 * 10**(-6) * md.mesh.y + 0.5
+    md.smb.precipitations_presentday[md.mesh.numberofvertices, imonth] = (float(imonth) / 12.)
 
 # time steps and resolution
-md.timestepping.time_step=20
-md.settings.output_frequency=1
-md.timestepping.final_time=60
+md.timestepping.time_step = 20
+md.settings.output_frequency = 1
+md.timestepping.final_time = 60
 
-# 
-md.transient.requested_outputs=['default','SmbMonthlytemperatures']
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMonthlytemperatures1','SmbMassBalance1',\
-		            'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMonthlytemperatures2','SmbMassBalance2',\
-				      'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMonthlytemperatures3','SmbMassBalance3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-		            1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-			         1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].SmbMonthlytemperatures,\
-	md.results.TransientSolution[0].SmbMassBalance,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].SmbMonthlytemperatures,\
-	md.results.TransientSolution[1].SmbMassBalance,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].SmbMonthlytemperatures,\
-	md.results.TransientSolution[2].SmbMassBalance,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test239.m
===================================================================
--- /issm/trunk/test/NightlyRun/test239.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test239.m	(revision 24313)
@@ -45,6 +45,4 @@
 md.timestepping.final_time=2;
 
-% 
-md.transient.requested_outputs={'default','SmbMonthlytemperatures'};
 md=setflowequation(md,'SSA','all');
 md.cluster=generic('name',oshostname(),'np',1); % 3 for the cluster
@@ -52,10 +50,10 @@
 
 %Fields and tolerances to track changes
-field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMonthlytemperatures1','SmbMassBalance1',...
-	      'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMonthlytemperatures2','SmbMassBalance2',...
-	      'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMonthlytemperatures3','SmbMassBalance3'};
-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
-	   1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
-	   1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',...
+	      'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',...
+	      'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
 field_values={...
 	(md.results.TransientSolution(1).Vx),...
@@ -66,5 +64,4 @@
 	(md.results.TransientSolution(1).Surface),...
 	(md.results.TransientSolution(1).Thickness),...
-	(md.results.TransientSolution(1).SmbMonthlytemperatures),...
 	(md.results.TransientSolution(1).SmbMassBalance),...
 	(md.results.TransientSolution(2).Vx),...
@@ -75,5 +72,4 @@
 	(md.results.TransientSolution(2).Surface),...
 	(md.results.TransientSolution(2).Thickness),...
-	(md.results.TransientSolution(2).SmbMonthlytemperatures),...
 	(md.results.TransientSolution(2).SmbMassBalance),...
 	(md.results.TransientSolution(3).Vx),...
@@ -84,5 +80,4 @@
 	(md.results.TransientSolution(3).Surface),...
 	(md.results.TransientSolution(3).Thickness),...
-	(md.results.TransientSolution(3).SmbMonthlytemperatures),...
 	(md.results.TransientSolution(3).SmbMassBalance),...
 	};
Index: /issm/trunk/test/NightlyRun/test239.py
===================================================================
--- /issm/trunk/test/NightlyRun/test239.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test239.py	(revision 24313)
@@ -1,3 +1,3 @@
-#Test Name: SquareShelfTranIspddIsdeltaO18pdInterpSSA2d 
+#Test Name: SquareShelfTranIspddIsdeltaO18pdInterpSSA2d
 import numpy as np
 from model import *
@@ -10,83 +10,76 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
 
 # Use of ispdd and isdelta18o methods
 md.smb = SMBd18opdd()
-md.smb.isd18opd=1
+md.smb.isd18opd = 1
 
 # Add temperature, precipitation and delta18o needed to measure the surface mass balance
 # creating delta18o
-delta18o=np.loadtxt('../Data/delta18o.data')
-md.smb.delta18o=delta18o
+delta18o = np.loadtxt('../Data/delta18o.data')
+md.smb.delta18o = delta18o
 
 # creating Present day temperatures
 # Same temperature over the all region:
-tmonth=np.ones(12)*(238.15+20.)
-md.smb.temperatures_presentday=np.zeros((md.mesh.numberofvertices+1,12))
-for imonth in xrange(0,12):
-    md.smb.temperatures_presentday[0:md.mesh.numberofvertices,imonth]=tmonth[imonth]
-    # Time for the last line:
-    md.smb.temperatures_presentday[md.mesh.numberofvertices,imonth]=(float(imonth)/12.)
+tmonth = np.ones(12) * (238.15 + 20.)
+md.smb.temperatures_presentday = np.zeros((md.mesh.numberofvertices + 1, 12))
+for imonth in range(0, 12):
+    md.smb.temperatures_presentday[0:md.mesh.numberofvertices, imonth] = tmonth[imonth]
+# Time for the last line:
+    md.smb.temperatures_presentday[md.mesh.numberofvertices, imonth] = (float(imonth) / 12.)
 
 # creating initialization and spc temperatures initialization and spc
-md.thermal.spctemperature=np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices,:],axis=1).reshape(-1,1)
-md.thermal.spctemperature=md.thermal.spctemperature-10
-md.initialization.temperature=md.thermal.spctemperature
+md.thermal.spctemperature = np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices, :], axis=1).reshape(-1, 1)
+md.thermal.spctemperature = md.thermal.spctemperature - 10
+md.initialization.temperature = md.thermal.spctemperature
 md.smb.initialize(md)
 
 # creating precipitation
-md.smb.precipitations_presentday=np.zeros((md.mesh.numberofvertices+1,12))
-for imonth in xrange(0,12):
-    md.smb.precipitations_presentday[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5
-    md.smb.precipitations_presentday[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.)
+md.smb.precipitations_presentday = np.zeros((md.mesh.numberofvertices + 1, 12))
+for imonth in range(0, 12):
+    md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = -0.4 * 10**(-6) * md.mesh.y + 0.5
+    md.smb.precipitations_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
 
 # time steps and resolution
-md.timestepping.time_step=0.5
-md.settings.output_frequency=1
-md.timestepping.final_time=2
+md.timestepping.time_step = 0.5
+md.settings.output_frequency = 1
+md.timestepping.final_time = 2
 
-# 
-md.transient.requested_outputs=['default','SmbMonthlytemperatures']
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMonthlytemperatures1','SmbMassBalance1',\
-		            'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMonthlytemperatures2','SmbMassBalance2',\
-				      'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMonthlytemperatures3','SmbMassBalance3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-		            1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-			         1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].SmbMonthlytemperatures,\
-	md.results.TransientSolution[0].SmbMassBalance,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].SmbMonthlytemperatures,\
-	md.results.TransientSolution[1].SmbMassBalance,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].SmbMonthlytemperatures,\
-	md.results.TransientSolution[2].SmbMassBalance,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test240.m
===================================================================
--- /issm/trunk/test/NightlyRun/test240.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test240.m	(revision 24313)
@@ -45,6 +45,4 @@
 md.timestepping.interp_forcings=0;
 
-% 
-md.transient.requested_outputs={'default','SmbMonthlytemperatures'};
 md=setflowequation(md,'SSA','all');
 md.cluster=generic('name',oshostname(),'np',1); % 3 for the cluster
@@ -52,10 +50,10 @@
 
 %Fields and tolerances to track changes
-field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMonthlytemperatures1','SmbMassBalance1',...
-	      'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMonthlytemperatures2','SmbMassBalance2',...
-	      'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMonthlytemperatures3','SmbMassBalance3'};
-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
-	   1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
-	   1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',...
+	      'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',...
+	      'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	   1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+	   1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
 field_values={...
 	(md.results.TransientSolution(1).Vx),...
@@ -66,5 +64,4 @@
 	(md.results.TransientSolution(1).Surface),...
 	(md.results.TransientSolution(1).Thickness),...
-	(md.results.TransientSolution(1).SmbMonthlytemperatures),...
 	(md.results.TransientSolution(1).SmbMassBalance),...
 	(md.results.TransientSolution(2).Vx),...
@@ -75,5 +72,4 @@
 	(md.results.TransientSolution(2).Surface),...
 	(md.results.TransientSolution(2).Thickness),...
-	(md.results.TransientSolution(2).SmbMonthlytemperatures),...
 	(md.results.TransientSolution(2).SmbMassBalance),...
 	(md.results.TransientSolution(3).Vx),...
@@ -84,5 +80,4 @@
 	(md.results.TransientSolution(3).Surface),...
 	(md.results.TransientSolution(3).Thickness),...
-	(md.results.TransientSolution(3).SmbMonthlytemperatures),...
 	(md.results.TransientSolution(3).SmbMassBalance),...
 	};
Index: /issm/trunk/test/NightlyRun/test240.py
===================================================================
--- /issm/trunk/test/NightlyRun/test240.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test240.py	(revision 24313)
@@ -1,3 +1,3 @@
-#Test Name: SquareShelfTranIspddIsdeltaO18pdNoInterpSSA2d 
+#Test Name: SquareShelfTranIspddIsdeltaO18pdNoInterpSSA2d
 import numpy as np
 from model import *
@@ -10,84 +10,77 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
 
 # Use of ispdd and isdelta18o methods
 md.smb = SMBd18opdd()
-md.smb.isd18opd=1
+md.smb.isd18opd = 1
 
 # Add temperature, precipitation and delta18o needed to measure the surface mass balance
 # creating delta18o
-delta18o=np.loadtxt('../Data/delta18o.data')
-md.smb.delta18o=delta18o
+delta18o = np.loadtxt('../Data/delta18o.data')
+md.smb.delta18o = delta18o
 
 # creating Present day temperatures
 # Same temperature over the all region:
-tmonth=np.ones(12)*(238.15+20.)
-md.smb.temperatures_presentday=np.zeros((md.mesh.numberofvertices+1,12))
-for imonth in xrange(0,12):
-    md.smb.temperatures_presentday[0:md.mesh.numberofvertices,imonth]=tmonth[imonth]
-    # Time for the last line:
-    md.smb.temperatures_presentday[md.mesh.numberofvertices,imonth]=(float(imonth)/12.)
+tmonth = np.ones(12) * (238.15 + 20.)
+md.smb.temperatures_presentday = np.zeros((md.mesh.numberofvertices + 1, 12))
+for imonth in range(0, 12):
+    md.smb.temperatures_presentday[0:md.mesh.numberofvertices, imonth] = tmonth[imonth]
+# Time for the last line:
+    md.smb.temperatures_presentday[md.mesh.numberofvertices, imonth] = (float(imonth) / 12.)
 
 # creating initialization and spc temperatures initialization and spc
-md.thermal.spctemperature=np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices,:],axis=1).reshape(-1,1)
-md.thermal.spctemperature=md.thermal.spctemperature-10
-md.initialization.temperature=md.thermal.spctemperature
+md.thermal.spctemperature = np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices, :], axis=1).reshape(-1, 1)
+md.thermal.spctemperature = md.thermal.spctemperature - 10
+md.initialization.temperature = md.thermal.spctemperature
 md.smb.initialize(md)
 
 # creating precipitation
-md.smb.precipitations_presentday=np.zeros((md.mesh.numberofvertices+1,12))
-for imonth in xrange(0,12):
-    md.smb.precipitations_presentday[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5
-    md.smb.precipitations_presentday[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.)
+md.smb.precipitations_presentday = np.zeros((md.mesh.numberofvertices + 1, 12))
+for imonth in range(0, 12):
+    md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = -0.4 * 10**(-6) * md.mesh.y + 0.5
+    md.smb.precipitations_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.)
 
 # time steps and resolution
-md.timestepping.time_step=0.5
-md.settings.output_frequency=1
-md.timestepping.final_time=2
-md.timestepping.interp_forcings=0
+md.timestepping.time_step = 0.5
+md.settings.output_frequency = 1
+md.timestepping.final_time = 2
+md.timestepping.interp_forcings = 0
 
-# 
-md.transient.requested_outputs=['default','SmbMonthlytemperatures']
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMonthlytemperatures1','SmbMassBalance1',\
-		            'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMonthlytemperatures2','SmbMassBalance2',\
-				      'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMonthlytemperatures3','SmbMassBalance3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-		            1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-			         1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].SmbMonthlytemperatures,\
-	md.results.TransientSolution[0].SmbMassBalance,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].SmbMonthlytemperatures,\
-	md.results.TransientSolution[1].SmbMassBalance,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].SmbMonthlytemperatures,\
-	md.results.TransientSolution[2].SmbMassBalance,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test241.py
===================================================================
--- /issm/trunk/test/NightlyRun/test241.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test241.py	(revision 24313)
@@ -10,63 +10,63 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.timestepping.time_step=1.
-md.settings.output_frequency=1
-md.timestepping.final_time=4.
-md.timestepping.interp_forcings=False
+md.timestepping.time_step = 1.
+md.settings.output_frequency = 1
+md.timestepping.final_time = 4.
+md.timestepping.interp_forcings = False
 
 #Set up transient
-smb=np.ones((md.mesh.numberofvertices))*3.6
-smb=np.vstack((smb,smb*-1.)).T
+smb = np.ones((md.mesh.numberofvertices)) * 3.6
+smb = np.vstack((smb, smb * - 1.)).T
 
-md.smb.mass_balance=np.vstack((smb,[1.5,3.]))
-md.transient.isthermal=False
+md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
+md.transient.isthermal = False
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
-						 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
-						 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
-						 'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
-field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].SmbMassBalance,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].SmbMassBalance,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].SmbMassBalance,
-							md.results.TransientSolution[3].Vx,
-							md.results.TransientSolution[3].Vy,
-							md.results.TransientSolution[3].Vel,
-							md.results.TransientSolution[3].Pressure,
-							md.results.TransientSolution[3].Base,
-							md.results.TransientSolution[3].Surface,
-							md.results.TransientSolution[3].Thickness,
-							md.results.TransientSolution[3].SmbMassBalance]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3',
+               'Vx4', 'Vy4', 'Vel4', 'Pressure4', 'Bed4', 'Surface4', 'Thickness4', 'SmbMassBalance4']
+field_tolerances = [1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].SmbMassBalance,
+                md.results.TransientSolution[3].Vx,
+                md.results.TransientSolution[3].Vy,
+                md.results.TransientSolution[3].Vel,
+                md.results.TransientSolution[3].Pressure,
+                md.results.TransientSolution[3].Base,
+                md.results.TransientSolution[3].Surface,
+                md.results.TransientSolution[3].Thickness,
+                md.results.TransientSolution[3].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test242.py
===================================================================
--- /issm/trunk/test/NightlyRun/test242.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test242.py	(revision 24313)
@@ -10,68 +10,68 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',350000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 350000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.timestepping.time_step=1.
-md.settings.output_frequency=1
-md.timestepping.final_time=4.
-md.timestepping.interp_forcings=False
+md.timestepping.time_step = 1.
+md.settings.output_frequency = 1
+md.timestepping.final_time = 4.
+md.timestepping.interp_forcings = False
 
 #Set up transient
-smb=np.ones((md.mesh.numberofvertices))*3.6
-smb=np.vstack((smb,smb*-1.)).T
+smb = np.ones((md.mesh.numberofvertices)) * 3.6
+smb = np.vstack((smb, smb * - 1.)).T
 
-md.smb.mass_balance=np.vstack((smb,[1.5,3.]))
-md.transient.isthermal=False
+md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
+md.transient.isthermal = False
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
-									'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
-									'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
-									'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassbalance4']
-field_tolerances=[1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-13,
-									1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-13,
-									1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-13,
-									1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-13]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vz,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].SmbMassBalance,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vz,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].SmbMassBalance,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vz,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].SmbMassBalance,
-							md.results.TransientSolution[3].Vx,
-							md.results.TransientSolution[3].Vy,
-							md.results.TransientSolution[3].Vz,
-							md.results.TransientSolution[3].Vel,
-							md.results.TransientSolution[3].Pressure,
-							md.results.TransientSolution[3].Base,
-							md.results.TransientSolution[3].Surface,
-							md.results.TransientSolution[3].Thickness,
-							md.results.TransientSolution[3].SmbMassBalance]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3',
+               'Vx4', 'Vy4', 'Vz4', 'Vel4', 'Pressure4', 'Bed4', 'Surface4', 'Thickness4', 'SmbMassbalance4']
+field_tolerances = [1e-09, 1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-13,
+                    1e-09, 1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-13,
+                    1e-09, 1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-13,
+                    1e-09, 1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].SmbMassBalance,
+                md.results.TransientSolution[3].Vx,
+                md.results.TransientSolution[3].Vy,
+                md.results.TransientSolution[3].Vz,
+                md.results.TransientSolution[3].Vel,
+                md.results.TransientSolution[3].Pressure,
+                md.results.TransientSolution[3].Base,
+                md.results.TransientSolution[3].Surface,
+                md.results.TransientSolution[3].Thickness,
+                md.results.TransientSolution[3].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test2424.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2424.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2424.py	(revision 24313)
@@ -10,14 +10,14 @@
 from newforcing import *
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
-md = setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
 md.initialization.vx[:] = 0.
 md.initialization.vy[:] = 0.
 md.smb.mass_balance[:] = 0.
 
-md.geometry.base = -700. - np.abs(md.mesh.y-500000.) / 1000.
-md.geometry.bed = -700. - np.abs(md.mesh.y-500000.) / 1000.
+md.geometry.base = -700. - np.abs(md.mesh.y - 500000.) / 1000.
+md.geometry.bed = -700. - np.abs(md.mesh.y - 500000.) / 1000.
 md.geometry.thickness[:] = 1000.
 md.geometry.surface = md.geometry.base + md.geometry.thickness
@@ -27,15 +27,15 @@
 md.transient.isthermal = 0
 md.groundingline.migration = 'AggressiveMigration'
-md.transient.requested_outputs = ['IceVolume','IceVolumeAboveFloatation','Sealevel']
+md.transient.requested_outputs = ['IceVolume', 'IceVolumeAboveFloatation', 'Sealevel']
 
 md.timestepping.time_step = .1
 md.slr.sealevel = newforcing(md.timestepping.start_time, md.timestepping.final_time,
-			     md.timestepping.time_step, -200., 200., md.mesh.numberofvertices)
+                             md.timestepping.time_step, -200., 200., md.mesh.numberofvertices)
 
-md.cluster = generic('name',gethostname(),'np',3)
-md = solve(md,'Transient')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
-#we are checking that the grounding line position is near the theorical one, which is the 0 contour level 
-#of surface - sealevel - (1-di)* thickness 
+#we are checking that the grounding line position is near the theorical one, which is the 0 contour level
+#of surface-sealevel - (1 - di) * thickness
 
 nsteps = len(md.results.TransientSolution)
@@ -45,7 +45,5 @@
 #time is off by the year constant
 for i in range(nsteps):
-	field_names.append('Time-' + str(md.results.TransientSolution[i].time) + 
-		'-yr-ice_levelset-S-sl-(1-di)*H')
-	field_tolerances.append(1e-12)
-	field_values.append(md.results.TransientSolution[i].MaskGroundediceLevelset.reshape(-1,) - (md.geometry.surface - md.results.TransientSolution[i].Sealevel.reshape(-1,) - (1 - md.materials.rho_ice / md.materials.rho_water) * md.geometry.thickness))
-
+    field_names.append('Time-' + str(md.results.TransientSolution[i].time) + ' - yr - ice_levelset - S - sl - (1 - di) * H')
+    field_tolerances.append(1e-12)
+    field_values.append(md.results.TransientSolution[i].MaskGroundediceLevelset.reshape(-1, ) - (md.geometry.surface - md.results.TransientSolution[i].Sealevel.reshape(-1, ) - (1 - md.materials.rho_ice / md.materials.rho_water) * md.geometry.thickness))
Index: /issm/trunk/test/NightlyRun/test2425.py
===================================================================
--- /issm/trunk/test/NightlyRun/test2425.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test2425.py	(revision 24313)
@@ -9,8 +9,8 @@
 from solve import *
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
-md = setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
 md.initialization.vx[:] = 0.
 md.initialization.vy[:] = 0.
@@ -26,11 +26,11 @@
 md.timestepping.final_time = 1
 
-md.cluster = generic('name',gethostname(),'np',3)
-md = solve(md,'Transient')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 vel1 = md.results.TransientSolution[-1].Vel
 
-#get same results with offset in bed and sea level: 
+#get same results with offset in bed and sea level:
 md.geometry.base = -700. - (md.mesh.y - 500000.) / 1000.
-md.geometry.bed  = -700. - (md.mesh.y - 500000.) / 1000.
+md.geometry.bed = -700. - (md.mesh.y - 500000.) / 1000.
 md.geometry.thickness[:] = 1300.
 md.geometry.surface = md.geometry.base + md.geometry.thickness
@@ -39,12 +39,11 @@
 md.geometry.bed = md.geometry.bed + 1000
 md.geometry.surface = md.geometry.surface + 1000
-md.slr.sealevel = 1000 * np.ones((md.mesh.numberofvertices,))
+md.slr.sealevel = 1000 * np.ones((md.mesh.numberofvertices, ))
 
-md = solve(md,'Transient','checkconsistency','no')
+md = solve(md, 'Transient', 'checkconsistency', 'no')
 vel2 = md.results.TransientSolution[-1].Vel
 
 #Fields and tolerances to track changes
-field_names = ['Vel','Veloffset']
-field_tolerances = [1e-13,1e-13]
-field_values = [vel1,vel2]
-
+field_names = ['Vel', 'Veloffset']
+field_tolerances = [1e-13, 1e-13]
+field_values = [vel1, vel2]
Index: /issm/trunk/test/NightlyRun/test243.m
===================================================================
--- /issm/trunk/test/NightlyRun/test243.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test243.m	(revision 24313)
@@ -1,4 +1,4 @@
 %Test Name: SquareShelfSMBGemb
-md=triangle(model(),'../Exp/Square.exp',200000.);
+md=triangle(model(),'../Exp/Square.exp',350000.);
 md=setmask(md,'all','');
 md=parameterize(md,'../Par/SquareShelf.par');
@@ -9,4 +9,5 @@
 % Use of Gemb method for SMB computation
 md.smb = SMBgemb(md.mesh,md.geometry);
+md.smb.dsnowIdx = 0;
 
 %load hourly surface forcing date from 1979 to 2009:
@@ -27,5 +28,7 @@
 
 %smb settings
-md.smb.requested_outputs={'SmbDz','SmbT','SmbD','SmbRe','SmbGdn','SmbGsp','SmbEC','SmbA','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC'};
+md.smb.requested_outputs={'SmbDz','SmbT','SmbD','SmbRe','SmbGdn','SmbGsp','SmbEC',...
+	'SmbA','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC','SmbMeanSHF','SmbMeanLHF',...
+	'SmbMeanULW','SmbNetLW','SmbNetSW'};
 
 %only run smb core: 
@@ -44,6 +47,6 @@
 
 %Fields and tolerances to track changes
-field_names      ={'SmbDz','SmbT' ,'SmbD' ,'SmbRe','SmbGdn','SmbGsp','SmbA' ,'SmbEC','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC'};
-field_tolerances ={1e-11,1e-12,1e-11,2e-11,1e-11,1e-11,1e-12,2e-12,1e-12,1e-12,1e-12,1e-11};
+field_names      ={'SmbDz','SmbT' ,'SmbD' ,'SmbRe','SmbGdn','SmbGsp','SmbA' ,'SmbEC','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC','SmbMeanSHF','SmbMeanLHF','SmbMeanULW','SmbNetLW','SmbNetSW'};
+field_tolerances ={8e-10,5e-12,3e-10,8e-10,1e-11,2e-7,4e-11,4e-12,1e-12,1e-12,1e-12,2e-10,2e-11, 2e-11, 1e-11, 9e-10, 2e-11};
 
 field_values={...
@@ -59,4 +62,9 @@
 	(md.results.TransientSolution(end).SmbMAdd(1)),...
 	(md.results.TransientSolution(end).SmbDzAdd(1)),...
-	(md.results.TransientSolution(end).SmbFAC(1))
-	};
+	(md.results.TransientSolution(end).SmbFAC(1)),...
+	(md.results.TransientSolution(end).SmbMeanSHF(1)),...
+	(md.results.TransientSolution(end).SmbMeanLHF(1)),...
+	(md.results.TransientSolution(end).SmbMeanULW(1)),...
+	(md.results.TransientSolution(end).SmbNetLW(1)),...
+	(md.results.TransientSolution(end).SmbNetSW(1))
+};
Index: /issm/trunk/test/NightlyRun/test243.py
===================================================================
--- /issm/trunk/test/NightlyRun/test243.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test243.py	(revision 24313)
@@ -1,4 +1,5 @@
 #Test Name: SquareShelfSMBGemb
 import numpy as np
+import sys
 from model import *
 from socket import gethostname
@@ -10,34 +11,38 @@
 from SMBgemb import *
 
-md = triangle(model(),'../Exp/Square.exp',200000.)
-md = setmask(md,'all','')
-md = parameterize(md,'../Par/SquareShelf.py')
-md = setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/Square.exp', 350000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
 md.materials.rho_ice = 910
-md.cluster = generic('name',gethostname(),'np',3)
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 #Use of Gemb method for SMB computation
 md.smb = SMBgemb()
-md.smb.setdefaultparameters(md.mesh,md.geometry)
+md.smb.setdefaultparameters(md.mesh, md.geometry)
+md.smb.dsnowIdx = 0
 
 #load hourly surface forcing date from 1979 to 2009:
-inputs = np.load('../Data/gemb_input.npy').item()
+if sys.version_info.major == 2:
+    inputs = np.load('../Data/gemb_input.npy', allow_pickle=True).item()
+else:
+    inputs = np.load('../Data/gemb_input.npy', allow_pickle=True, encoding='bytes').item()
 
 #setup the inputs:
-md.smb.Ta = np.append(np.tile(np.conjugate(inputs['Ta0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)
-md.smb.V = np.append(np.tile(np.conjugate(inputs['V0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)
-md.smb.dswrf = np.append(np.tile(np.conjugate(inputs['dsw0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)
-md.smb.dlwrf = np.append(np.tile(np.conjugate(inputs['dlw0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)
-md.smb.P = np.append(np.tile(np.conjugate(inputs['P0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)
-md.smb.eAir = np.append(np.tile(np.conjugate(inputs['eAir0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)
-md.smb.pAir = np.append(np.tile(np.conjugate(inputs['pAir0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)
-md.smb.pAir = np.append(np.tile(np.conjugate(inputs['pAir0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)
-md.smb.Vz = np.tile(np.conjugate(inputs['LP']['Vz']),(md.mesh.numberofelements,1)).flatten()
-md.smb.Tz = np.tile(np.conjugate(inputs['LP']['Tz']),(md.mesh.numberofelements,1)).flatten()
-md.smb.Tmean = np.tile(np.conjugate(inputs['LP']['Tmean']),(md.mesh.numberofelements,1)).flatten()
-md.smb.C = np.tile(np.conjugate(inputs['LP']['C']),(md.mesh.numberofelements,1)).flatten()
+md.smb.Ta = np.append(np.tile(np.conjugate(inputs[b'Ta0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0)
+md.smb.V = np.append(np.tile(np.conjugate(inputs[b'V0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0)
+md.smb.dswrf = np.append(np.tile(np.conjugate(inputs[b'dsw0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0)
+md.smb.dlwrf = np.append(np.tile(np.conjugate(inputs[b'dlw0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0)
+md.smb.P = np.append(np.tile(np.conjugate(inputs[b'P0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0)
+md.smb.eAir = np.append(np.tile(np.conjugate(inputs[b'eAir0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0)
+md.smb.pAir = np.append(np.tile(np.conjugate(inputs[b'pAir0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0)
+md.smb.pAir = np.append(np.tile(np.conjugate(inputs[b'pAir0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0)
+md.smb.Vz = np.tile(np.conjugate(inputs[b'LP']['Vz']), (md.mesh.numberofelements, 1)).flatten()
+md.smb.Tz = np.tile(np.conjugate(inputs[b'LP']['Tz']), (md.mesh.numberofelements, 1)).flatten()
+md.smb.Tmean = np.tile(np.conjugate(inputs[b'LP']['Tmean']), (md.mesh.numberofelements, 1)).flatten()
+md.smb.C = np.tile(np.conjugate(inputs[b'LP']['C']), (md.mesh.numberofelements, 1)).flatten()
 
 #smb settings
-md.smb.requested_outputs = ['SmbDz','SmbT','SmbD','SmbRe','SmbGdn','SmbGsp','SmbEC','SmbA','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC']
+md.smb.requested_outputs = ['SmbDz', 'SmbT', 'SmbD', 'SmbRe', 'SmbGdn', 'SmbGsp', 'SmbEC', 'SmbA', 'SmbMassBalance', 'SmbMAdd', 'SmbDzAdd', 'SmbFAC', 'SmbMeanSHF', 'SmbMeanLHF', 'SmbMeanULW', 'SmbNetLW', 'SmbNetSW']
 
 #only run smb core:
@@ -53,22 +58,25 @@
 
 #Run transient
-md = solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names      = ['SmbDz','SmbT' ,'SmbD' ,'SmbRe','SmbGdn','SmbGsp','SmbA' ,'SmbEC','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC']
-field_tolerances = [1e-11,1e-12,1e-11,2e-11,1e-11,1e-11,1e-12,2e-12,1e-12,1e-12,1e-12,1e-11]
+field_names = ['SmbDz', 'SmbT', 'SmbD', 'SmbRe', 'SmbGdn', 'SmbGsp', 'SmbA', 'SmbEC', 'SmbMassBalance', 'SmbMAdd', 'SmbDzAdd', 'SmbFAC', 'SmbMeanSHF', 'SmbMeanLHF', 'SmbMeanULW', 'SmbNetLW', 'SmbNetSW']
+field_tolerances = [8e-10, 5e-12, 3e-10, 8e-10, 1e-11, 2e-7, 4e-11, 4e-12, 1e-12, 1e-12, 1e-12, 2e-10, 2e-11, 2e-11, 1e-11, 9e-10, 2e-11]
 #shape is different in python solution (fixed using reshape) which can cause test failure:
-field_values = [
-	md.results.TransientSolution[-1].SmbDz[0,0:240].reshape(1,-1),
-	md.results.TransientSolution[-1].SmbT[0,0:240].reshape(1,-1),
-	md.results.TransientSolution[-1].SmbD[0,0:240].reshape(1,-1),
-	md.results.TransientSolution[-1].SmbRe[0,0:240].reshape(1,-1),
-	md.results.TransientSolution[-1].SmbGdn[0,0:240].reshape(1,-1),
-	md.results.TransientSolution[-1].SmbGsp[0,0:240].reshape(1,-1),
-	md.results.TransientSolution[-1].SmbA[0,0:240].reshape(1,-1),
-	md.results.TransientSolution[-1].SmbEC[0],
-	md.results.TransientSolution[-1].SmbMassBalance[0],
-	md.results.TransientSolution[-1].SmbMAdd[0],
-	md.results.TransientSolution[-1].SmbDzAdd[0],
-	md.results.TransientSolution[-1].SmbFAC[0],
-	]
+field_values = [md.results.TransientSolution[-1].SmbDz[0, 0:240].reshape(1, -1),
+                md.results.TransientSolution[-1].SmbT[0, 0:240].reshape(1, -1),
+                md.results.TransientSolution[-1].SmbD[0, 0:240].reshape(1, -1),
+                md.results.TransientSolution[-1].SmbRe[0, 0:240].reshape(1, -1),
+                md.results.TransientSolution[-1].SmbGdn[0, 0:240].reshape(1, -1),
+                md.results.TransientSolution[-1].SmbGsp[0, 0:240].reshape(1, -1),
+                md.results.TransientSolution[-1].SmbA[0, 0:240].reshape(1, -1),
+                md.results.TransientSolution[-1].SmbEC[0],
+                md.results.TransientSolution[-1].SmbMassBalance[0],
+                md.results.TransientSolution[-1].SmbMAdd[0],
+                md.results.TransientSolution[-1].SmbDzAdd[0],
+                md.results.TransientSolution[-1].SmbFAC[0],
+                md.results.TransientSolution[-1].SmbMeanSHF[0],
+                md.results.TransientSolution[-1].SmbMeanLHF[0],
+                md.results.TransientSolution[-1].SmbMeanULW[0],
+                md.results.TransientSolution[-1].SmbNetLW[0],
+                md.results.TransientSolution[-1].SmbNetSW[0]]
Index: /issm/trunk/test/NightlyRun/test244.m
===================================================================
--- /issm/trunk/test/NightlyRun/test244.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test244.m	(revision 24313)
@@ -1,4 +1,4 @@
 %Test Name: SquareShelfSMBGembDakota
-md=triangle(model(),'../Exp/Square.exp',200000.);
+md=triangle(model(),'../Exp/Square.exp',300000.);
 md=setmask(md,'all','');
 md=parameterize(md,'../Par/SquareShelf.par');
@@ -10,4 +10,5 @@
 % Use of Gemb method for SMB computation
 md.smb = SMBgemb(md.mesh,md.geometry);
+md.smb.dsnowIdx = 0;
 
 %load hourly surface forcing date from 1979 to 2009:
@@ -46,6 +47,6 @@
 %partitioning
 md.qmu.numberofpartitions=md.mesh.numberofelements;
-md=partitioner(md,'package','linear');
-md.qmu.partition=md.qmu.partition-1;
+md=partitioner(md,'package','linear','type','element');
+md.qmu.epartition=md.qmu.epartition-1;
 
 %variables
@@ -55,5 +56,5 @@
 mint_on_partition=telms;
 for pa=1:length(mint_on_partition)
-	vi=find(md.qmu.partition+1 == pa);
+	vi=find(md.qmu.epartition+1 == pa);
 	mint=telms(vi).*1.05;
 	pos=find(mint < Tmin);
Index: /issm/trunk/test/NightlyRun/test244.py
===================================================================
--- /issm/trunk/test/NightlyRun/test244.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test244.py	(revision 24313)
@@ -19,45 +19,46 @@
 from dmeth_params_set import *
 
-md = triangle(model(),'../Exp/Square.exp',200000.)
-md = setmask(md,'all','')
-md = parameterize(md,'../Par/SquareShelf.py')
-md = setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/Square.exp', 300000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
 md.materials.rho_ice = 910
-md.cluster = generic('name',gethostname(),'np',3)
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.geometry.bed = md.geometry.base
 
 # Use of Gemb method for SMB computation
 md.smb = SMBgemb()
-md.smb.setdefaultparameters(md.mesh,md.geometry)
+md.smb.setdefaultparameters(md.mesh, md.geometry)
+md.smb.dsnowIdx = 0
 
 #load hourly surface forcing date from 1979 to 2009:
-inputs = spio.loadmat('../Data/gemb_input.mat',squeeze_me = True)
+inputs = spio.loadmat('../Data/gemb_input.mat', squeeze_me=True)
 
-#setup the inputs: 
-md.smb.Ta = np.append(np.tile(np.conjugate(inputs['Ta0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)
-md.smb.V = np.append(np.tile(np.conjugate(inputs['V0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)
-md.smb.dswrf = np.append(np.tile(np.conjugate(inputs['dsw0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)
-md.smb.dlwrf = np.append(np.tile(np.conjugate(inputs['dlw0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)
-md.smb.P = np.append(np.tile(np.conjugate(inputs['P0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)
-md.smb.eAir = np.append(np.tile(np.conjugate(inputs['eAir0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)
-md.smb.pAir = np.append(np.tile(np.conjugate(inputs['pAir0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)
-md.smb.pAir = np.append(np.tile(np.conjugate(inputs['pAir0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)
-md.smb.Vz = np.tile(np.conjugate(inputs['LP']['Vz']),(md.mesh.numberofelements,1)).flatten()
-md.smb.Tz = np.tile(np.conjugate(inputs['LP']['Tz']),(md.mesh.numberofelements,1)).flatten()
-md.smb.Tmean = np.tile(np.conjugate(inputs['LP']['Tmean']),(md.mesh.numberofelements,1)).flatten()
-md.smb.C = np.tile(np.conjugate(inputs['LP']['C']),(md.mesh.numberofelements,1)).flatten()
+#setup the inputs:
+md.smb.Ta = np.append(np.tile(np.conjugate(inputs['Ta0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs['dateN']]), axis=0)
+md.smb.V = np.append(np.tile(np.conjugate(inputs['V0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs['dateN']]), axis=0)
+md.smb.dswrf = np.append(np.tile(np.conjugate(inputs['dsw0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs['dateN']]), axis=0)
+md.smb.dlwrf = np.append(np.tile(np.conjugate(inputs['dlw0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs['dateN']]), axis=0)
+md.smb.P = np.append(np.tile(np.conjugate(inputs['P0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs['dateN']]), axis=0)
+md.smb.eAir = np.append(np.tile(np.conjugate(inputs['eAir0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs['dateN']]), axis=0)
+md.smb.pAir = np.append(np.tile(np.conjugate(inputs['pAir0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs['dateN']]), axis=0)
+md.smb.pAir = np.append(np.tile(np.conjugate(inputs['pAir0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs['dateN']]), axis=0)
+md.smb.Vz = np.tile(np.conjugate(inputs['LP']['Vz']), (md.mesh.numberofelements, 1)).flatten()
+md.smb.Tz = np.tile(np.conjugate(inputs['LP']['Tz']), (md.mesh.numberofelements, 1)).flatten()
+md.smb.Tmean = np.tile(np.conjugate(inputs['LP']['Tmean']), (md.mesh.numberofelements, 1)).flatten()
+md.smb.C = np.tile(np.conjugate(inputs['LP']['C']), (md.mesh.numberofelements, 1)).flatten()
 
 #smb settings
-md.smb.requested_outputs = ['SmbDz','SmbT','SmbD','SmbRe','SmbGdn','SmbGsp','SmbEC','SmbA','SmbMassBalance']
+md.smb.requested_outputs = ['SmbDz', 'SmbT', 'SmbD', 'SmbRe', 'SmbGdn', 'SmbGsp', 'SmbEC', 'SmbA', 'SmbMassBalance']
 
-#only run smb core: 
+#only run smb core:
 md.transient.isstressbalance = 0
 md.transient.ismasstransport = 1
 md.transient.isthermal = 0
 
-#time stepping: 
+#time stepping:
 md.timestepping.start_time = 1965.
 md.timestepping.final_time = 1965.75
-md.timestepping.time_step = 1./365.0
+md.timestepping.time_step = 1. / 365.0
 md.timestepping.interp_forcings = 0.
 
@@ -68,35 +69,35 @@
 #partitioning
 md.qmu.numberofpartitions = md.mesh.numberofelements
-md = partitioner(md,'package','linear')
-md.qmu.partition = (md.qmu.partition - 1).reshape(-1,1).T
+md = partitioner(md, 'package', 'linear', 'type', 'element')
+md.qmu.epartition = (md.qmu.epartition - 1)
 
 #variables
-md.qmu.variables.surface_mass_balanceC = normal_uncertain.normal_uncertain('scaled_SmbC',1,0.5)
+md.qmu.variables.surface_mass_balanceC = normal_uncertain.normal_uncertain('scaled_SmbC', 1, 0.5)
 Tmin = 273.
-telms = np.atleast_2d(np.min(md.smb.Ta[0:-1,:],1))
+telms = np.atleast_2d(np.min(md.smb.Ta[0:-1, :], 1))
 mint_on_partition = telms.flatten()
 for pa in range(np.size(mint_on_partition)):
-	vi = np.where(md.qmu.partition == pa)
-	mint = telms[vi]*1.05
-	pos = np.where(mint < Tmin)
-	mint[pos] = Tmin
-	mint_on_partition[pa] = max(mint/telms[vi])
+    vi = np.where(md.qmu.epartition == pa)
+    mint = telms[0, vi] * 1.05
+    pos = np.where(mint < Tmin)
+    mint[pos] = Tmin
+    mint_on_partition[pa] = max(mint / telms[0, vi])
 
 mint_on_partition[np.where(np.isnan(mint_on_partition))] = 10**-10
-md.qmu.variables.surface_mass_balanceTa = uniform_uncertain.uniform_uncertain('scaled_SmbTa',1,0.05)
+md.qmu.variables.surface_mass_balanceTa = uniform_uncertain.uniform_uncertain('scaled_SmbTa', 1, 0.05)
 md.qmu.variables.surface_mass_balanceTa[0].lower = 0.95
-md.qmu.variables.surface_mass_balanceTa[0].upper = np.maximum(np.minimum(np.maximum(1.05,mint_on_partition),0.9999),0.0001)
+md.qmu.variables.surface_mass_balanceTa[0].upper = np.maximum(np.minimum(np.maximum(1.05, mint_on_partition), 0.9999), 0.0001)
 
 #responses
-md.qmu.responses.IceVolume = response_function.response_function('IceVolume',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.IceMass = response_function.response_function('IceMass',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.TotalSmb = response_function.response_function('TotalSmb',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
+md.qmu.responses.IceVolume = response_function.response_function('IceVolume', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.IceMass = response_function.response_function('IceMass', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.TotalSmb = response_function.response_function('TotalSmb', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
 
 #  nond_sampling study
 md.qmu.method = dakota_method.dakota_method('nond_samp')
-md.qmu.method = dmeth_params_set(md.qmu.method,'seed',1234,'samples',3,'sample_type','lhs')
+md.qmu.method = dmeth_params_set(md.qmu.method, 'seed', 1234, 'samples', 3, 'sample_type', 'lhs')
 dver = str(version)
-if ((int(dver[0]) == 4 and int(dver[2])>2) or int(dver[0])>4):
-	md.qmu.method = dmeth_params_set(md.qmu.method,'rng','rnum2')
+if ((int(dver[0]) == 4 and int(dver[2]) > 2) or int(dver[0]) > 4):
+    md.qmu.method = dmeth_params_set(md.qmu.method, 'rng', 'rnum2')
 
 #parameters
@@ -108,18 +109,18 @@
 
 if version >= 6:
-	md.qmu.params.analysis_driver = 'matlab'
-	md.qmu.params.evaluation_scheduling = 'master'
-	md.qmu.params.processors_per_evaluation = 2
+    md.qmu.params.analysis_driver = 'matlab'
+    md.qmu.params.evaluation_scheduling = 'master'
+    md.qmu.params.processors_per_evaluation = 2
 else:
-	md.qmu.params.analysis_driver = 'stressbalance'
-	md.qmu.params.evaluation_concurrency = 1
+    md.qmu.params.analysis_driver = 'stressbalance'
+    md.qmu.params.evaluation_concurrency = 1
 
 
-md.stressbalance.reltol = 10**-5 #tighten for qmu analyses
-md.transient.requested_outputs = ['IceVolume','TotalSmb','IceMass']
+md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
+md.transient.requested_outputs = ['IceVolume', 'TotalSmb', 'IceMass']
 
 #solve
-md.verbose = verbose('000000000')	# this line is recommended
-md = solve(md,'Transient','overwrite','y')
+md.verbose = verbose('000000000')  # this line is recommended
+md = solve(md, 'Transient', 'overwrite', 'y')
 md.qmu.results = md.results.dakota
 
@@ -127,11 +128,10 @@
 md.results.dakota.moments = []
 for i in range(3):
-	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].mean)
+    md.results.dakota.moments.append(md.results.dakota.dresp_out[i].mean)
 
 for i in range(3):
-	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].stddev)
+    md.results.dakota.moments.append(md.results.dakota.dresp_out[i].stddev)
 
 field_names = ['moments']
 field_tolerances = [1e-11]
 field_values = [md.results.dakota.moments]
-
Index: /issm/trunk/test/NightlyRun/test245.py
===================================================================
--- /issm/trunk/test/NightlyRun/test245.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test245.py	(revision 24313)
@@ -11,26 +11,26 @@
 from SMBpddSicopolis import *
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'all','')
-md = parameterize(md,'../Par/SquareShelf.py')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
 
 # Use of SMBpddSicopolis
-md.smb  =  SMBpddSicopolis()
+md.smb = SMBpddSicopolis()
 # initalize pdd fields
 md.smb.initialize(md)
-md.smb.s0p = md.geometry.surface
-md.smb.s0t = md.geometry.surface
+md.smb.s0p = md.geometry.surface.reshape(-1, 1)
+md.smb.s0t = md.geometry.surface.reshape(-1, 1)
 
-# 
-md.smb.monthlytemperatures = np.empty((md.mesh.numberofvertices+1,12))
-md.smb.precipitation = np.empty((md.mesh.numberofvertices+1,12))
-temp_ma_present = -10. * np.ones((md.mesh.numberofvertices,)) - md.smb.rlaps * md.geometry.surface / 1000.
-temp_mj_present = 10. * np.ones((md.mesh.numberofvertices,)) - md.smb.rlaps * md.geometry.surface / 1000.
-precipitation = 5. * np.ones((md.mesh.numberofvertices,))
-for imonth in range(12): 
-	md.smb.monthlytemperatures[0:md.mesh.numberofvertices,imonth] = md.materials.meltingpoint + temp_ma_present + (temp_mj_present - temp_ma_present) * np.sin((imonth + 1. - 4.) * np.pi / 6.0)
-	md.smb.monthlytemperatures[md.mesh.numberofvertices,imonth] = ((imonth+1)/12.)
-	md.smb.precipitation[0:md.mesh.numberofvertices,imonth] = precipitation
-	md.smb.precipitation[md.mesh.numberofvertices,imonth] = ((imonth+1)/12.)
+
+md.smb.monthlytemperatures = np.empty((md.mesh.numberofvertices + 1, 12))
+md.smb.precipitation = np.empty((md.mesh.numberofvertices + 1, 12))
+temp_ma_present = -10. * np.ones((md.mesh.numberofvertices, )) - md.smb.rlaps * md.geometry.surface / 1000.
+temp_mj_present = 10. * np.ones((md.mesh.numberofvertices, )) - md.smb.rlaps * md.geometry.surface / 1000.
+precipitation = 5. * np.ones((md.mesh.numberofvertices, ))
+for imonth in range(12):
+    md.smb.monthlytemperatures[0:md.mesh.numberofvertices, imonth] = md.materials.meltingpoint + temp_ma_present + (temp_mj_present - temp_ma_present) * np.sin((imonth + 1. - 4.) * np.pi / 6.0)
+    md.smb.monthlytemperatures[md.mesh.numberofvertices, imonth] = ((imonth + 1) / 12.)
+    md.smb.precipitation[0:md.mesh.numberofvertices, imonth] = precipitation
+    md.smb.precipitation[md.mesh.numberofvertices, imonth] = ((imonth + 1) / 12.)
 
 # time steps and resolution
@@ -44,16 +44,13 @@
 md.transient.isthermal = 0
 
-md.transient.requested_outputs = ['default','TemperaturePDD']
-md.cluster = generic('name',gethostname(),'np',1) # 3 for the cluster
-md = solve(md,'Transient')
+md.transient.requested_outputs = ['default', 'TemperaturePDD']
+md.cluster = generic('name', gethostname(), 'np', 1)  # 3 for the cluster
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names      = ['TemperaturePDD1','SmbMassBalance1','TemperaturePDD2','SmbMassBalance2']
-field_tolerances = [1e-13,1e-13,1e-13,1e-13]
-field_values = [
-	md.results.TransientSolution[0].TemperaturePDD,
-	md.results.TransientSolution[0].SmbMassBalance,
-	md.results.TransientSolution[1].TemperaturePDD,
-	md.results.TransientSolution[1].SmbMassBalance,
-	]
-
+field_names = ['TemperaturePDD1', 'SmbMassBalance1', 'TemperaturePDD2', 'SmbMassBalance2']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].TemperaturePDD,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[1].TemperaturePDD,
+                md.results.TransientSolution[1].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test246.m
===================================================================
--- /issm/trunk/test/NightlyRun/test246.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test246.m	(revision 24313)
@@ -0,0 +1,56 @@
+%Test Name: SquareShelfTranSemic
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+
+% Use of SMBpddSicopolis
+md.smb = SMBsemic();
+% initalize pdd fields
+md.smb=initialize(md.smb,md);
+md.smb.s0gcm=md.geometry.surface;
+
+ONES=ones(md.mesh.numberofvertices,1);
+for iday=0:365
+	md.smb.dailytemperature(1:md.mesh.numberofvertices,iday+1)=252.8739*ONES;
+	md.smb.dailytemperature(md.mesh.numberofvertices+1,iday+1)=((iday+1)/12);
+	md.smb.dailysnowfall(1:md.mesh.numberofvertices,iday+1)=8.5503e-09*ONES;
+	md.smb.dailysnowfall(md.mesh.numberofvertices+1,iday+1)=((iday+1)/12);
+	md.smb.dailyrainfall(1:md.mesh.numberofvertices,iday+1)=1.7296e-09*ONES;
+	md.smb.dailyrainfall(md.mesh.numberofvertices+1,iday+1)=((iday+1)/12);
+	md.smb.dailydsradiation(1:md.mesh.numberofvertices,iday+1)=128.1702*ONES;
+	md.smb.dailydsradiation(md.mesh.numberofvertices+1,iday+1)=((iday+1)/12);
+	md.smb.dailydlradiation(1:md.mesh.numberofvertices,iday+1)=176.5667*ONES;
+	md.smb.dailydlradiation(md.mesh.numberofvertices+1,iday+1)=((iday+1)/12);
+	md.smb.dailywindspeed(1:md.mesh.numberofvertices,iday+1)=6.0741*ONES;
+	md.smb.dailywindspeed(md.mesh.numberofvertices+1,iday+1)=((iday+1)/12);
+	md.smb.dailyairdensity(1:md.mesh.numberofvertices,iday+1)=1.0729*ONES;
+	md.smb.dailyairdensity(md.mesh.numberofvertices+1,iday+1)=((iday+1)/12);
+	md.smb.dailyairhumidity(1:md.mesh.numberofvertices,iday+1)=9.6667e-04*ONES;
+	md.smb.dailyairhumidity(md.mesh.numberofvertices+1,iday+1)=((iday+1)/12); 
+	md.smb.dailypressure(1:md.mesh.numberofvertices,iday+1)=7.7841e+04*ONES;
+	md.smb.dailypressure(md.mesh.numberofvertices+1,iday+1)=((iday+1)/12); 
+end
+
+% time steps and resolution
+md.timestepping.time_step=0.5;
+md.settings.output_frequency=1;
+md.timestepping.final_time=1;
+
+md.transient.issmb=1;
+md.transient.ismasstransport=0;
+md.transient.isstressbalance=0;
+md.transient.isthermal=0;
+
+md.transient.requested_outputs={'default','TemperatureSEMIC'};
+md.cluster=generic('name',oshostname(),'np',4); % 3 for the cluster
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names     ={'TemperatureSEMIC1','SmbMassBalance1','TemperatureSEMIC2','SmbMassBalance2'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.TransientSolution(1).TemperatureSEMIC),...
+	(md.results.TransientSolution(1).SmbMassBalance),...
+	(md.results.TransientSolution(2).TemperatureSEMIC),...
+	(md.results.TransientSolution(2).SmbMassBalance),...
+	};
Index: /issm/trunk/test/NightlyRun/test250.m
===================================================================
--- /issm/trunk/test/NightlyRun/test250.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test250.m	(revision 24313)
@@ -24,5 +24,5 @@
 md.qmu.numberofpartitions=md.mesh.numberofvertices;
 md=partitioner(md,'package','linear');
-md.qmu.partition=md.qmu.partition-1;
+md.qmu.vpartition=md.qmu.vpartition-1;
 
 %variables
Index: /issm/trunk/test/NightlyRun/test250.py
===================================================================
--- /issm/trunk/test/NightlyRun/test250.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test250.py	(revision 24313)
@@ -1,5 +1,4 @@
 #Test Name: SquareShelfTranForceNeg2dDakotaSampLinearPart
 import numpy as np
-import scipy.io as spio
 from os import getcwd
 from model import *
@@ -14,9 +13,9 @@
 from dmeth_params_set import *
 
-md = triangle(model(),'../Exp/Square.exp',180000.)
-md = setmask(md,'all','')
-md = parameterize(md,'../Par/SquareShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 md.timestepping.time_step = 1
@@ -24,9 +23,9 @@
 md.timestepping.final_time = 4
 
-smb = np.ones((md.mesh.numberofvertices,))*3.6
-smb = np.array([smb,smb*-1]).T
+smb = np.ones((md.mesh.numberofvertices, )) * 3.6
+smb = np.array([smb, smb * - 1]).T
 
-md.smb.mass_balance =  smb
-md.smb.mass_balance = np.concatenate((md.smb.mass_balance,[[1.5,3]]))
+md.smb.mass_balance = smb
+md.smb.mass_balance = np.concatenate((md.smb.mass_balance, [[1.5, 3]]))
 md.transient.isthermal = 0
 #Dakota options
@@ -38,30 +37,30 @@
 #partitioning
 md.qmu.numberofpartitions = md.mesh.numberofvertices
-md = partitioner(md,'package','linear')
-md.qmu.partition = md.qmu.partition-1
+md = partitioner(md, 'package', 'linear')
+md.qmu.vpartition = md.qmu.vpartition - 1
 
 #variables
-md.qmu.variables.surface_mass_balance = normal_uncertain.normal_uncertain('scaled_SmbMassBalance',1,0.1)
+md.qmu.variables.surface_mass_balance = normal_uncertain.normal_uncertain('scaled_SmbMassBalance', 1, 0.1)
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.IceVolume = response_function.response_function('IceVolume',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.massFlux6 = response_function.response_function('indexed_MassFlux_6',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.IceVolume = response_function.response_function('IceVolume', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.massFlux6 = response_function.response_function('indexed_MassFlux_6', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
 
 #mass flux profiles
-md.qmu.mass_flux_profiles = ['../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp']
+md.qmu.mass_flux_profiles = ['../Exp/MassFlux1.exp', '../Exp/MassFlux2.exp', '../Exp/MassFlux3.exp', '../Exp/MassFlux4.exp', '../Exp/MassFlux5.exp', '../Exp/MassFlux6.exp']
 md.qmu.mass_flux_profile_directory = getcwd()
 
-##  nond_sampling study
+#  nond_sampling study
 md.qmu.method = dakota_method.dakota_method('nond_samp')
-md.qmu.method = dmeth_params_set(md.qmu.method,'seed',1234,'samples',20,'sample_type','lhs')
+md.qmu.method = dmeth_params_set(md.qmu.method, 'seed', 1234, 'samples', 20, 'sample_type', 'lhs')
 dver = str(version)
-if ((int(dver[0]) == 4 and int(dver[2])>2) or int(dver[0])>4):
-	md.qmu.method = dmeth_params_set(md.qmu.method,'rng','rnum2')
+if ((int(dver[0]) == 4 and int(dver[2]) > 2) or int(dver[0]) > 4):
+    md.qmu.method = dmeth_params_set(md.qmu.method, 'rng', 'rnum2')
 
 #parameters
@@ -73,17 +72,17 @@
 
 if version >= 6:
-	md.qmu.params.analysis_driver = 'matlab'
-	md.qmu.params.evaluation_scheduling = 'master'
-	md.qmu.params.processors_per_evaluation = 2
+    md.qmu.params.analysis_driver = 'matlab'
+    md.qmu.params.evaluation_scheduling = 'master'
+    md.qmu.params.processors_per_evaluation = 2
 else:
-	md.qmu.params.analysis_driver = 'stressbalance'
-	md.qmu.params.evaluation_concurrency = 1
+    md.qmu.params.analysis_driver = 'stressbalance'
+    md.qmu.params.evaluation_concurrency = 1
 
-md.stressbalance.reltol = 10**-5 #tighten for qmu analyses
+md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
 md.transient.requested_outputs = ['IceVolume']
 
 #solve
-md.verbose = verbose('000000000')	# this line is recommended
-md = solve(md,'Transient','overwrite','y')
+md.verbose = verbose('000000000')  # this line is recommended
+md = solve(md, 'Transient', 'overwrite', 'y')
 md.qmu.results = md.results.dakota
 
@@ -91,8 +90,8 @@
 md.results.dakota.moments = []
 for i in range(8):
-	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].mean)
+    md.results.dakota.moments.append(md.results.dakota.dresp_out[i].mean)
 
 for i in range(8):
-	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].stddev)
+    md.results.dakota.moments.append(md.results.dakota.dresp_out[i].stddev)
 
 field_names = ['moments']
Index: /issm/trunk/test/NightlyRun/test251.m
===================================================================
--- /issm/trunk/test/NightlyRun/test251.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test251.m	(revision 24313)
@@ -24,5 +24,5 @@
 md.qmu.numberofpartitions=md.mesh.numberofvertices;
 md=partitioner(md,'package','linear');
-md.qmu.partition=md.qmu.partition-1;
+md.qmu.vpartition=md.qmu.vpartition-1;
 
 %variables
Index: /issm/trunk/test/NightlyRun/test251.py
===================================================================
--- /issm/trunk/test/NightlyRun/test251.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test251.py	(revision 24313)
@@ -1,5 +1,4 @@
 #Test Name: SquareShelfTranForceNeg2dDakotaLocalLinearPart
 import numpy as np
-import scipy.io as spio
 from os import getcwd
 from model import *
@@ -14,9 +13,9 @@
 from dmeth_params_set import *
 
-md = triangle(model(),'../Exp/Square.exp',180000.)
-md = setmask(md,'all','')
-md = parameterize(md,'../Par/SquareShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 md.timestepping.time_step = 1
@@ -24,9 +23,9 @@
 md.timestepping.final_time = 4
 
-smb = np.ones((md.mesh.numberofvertices,))*3.6
-smb = np.array([smb,smb*-1]).T
+smb = np.ones((md.mesh.numberofvertices, )) * 3.6
+smb = np.array([smb, smb * - 1]).T
 
-md.smb.mass_balance =  smb
-md.smb.mass_balance = np.concatenate((md.smb.mass_balance,[[1.5,3]]))
+md.smb.mass_balance = smb
+md.smb.mass_balance = np.concatenate((md.smb.mass_balance, [[1.5, 3]]))
 md.transient.isthermal = 0
 
@@ -39,22 +38,22 @@
 #partitioning
 md.qmu.numberofpartitions = md.mesh.numberofvertices
-md = partitioner(md,'package','linear')
-md.qmu.partition = md.qmu.partition-1
+md = partitioner(md, 'package', 'linear')
+md.qmu.vpartition = md.qmu.vpartition - 1
 
 #variables
-md.qmu.variables.surface_mass_balance = normal_uncertain.normal_uncertain('scaled_SmbMassBalance',1,100)
+md.qmu.variables.surface_mass_balance = normal_uncertain.normal_uncertain('scaled_SmbMassBalance', 1, 100)
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.IceVolume = response_function.response_function('IceVolume',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.massFlux6 = response_function.response_function('indexed_MassFlux_6',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.IceVolume = response_function.response_function('IceVolume', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.massFlux6 = response_function.response_function('indexed_MassFlux_6', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
 
 #mass flux profiles
-md.qmu.mass_flux_profiles = ['../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp']
+md.qmu.mass_flux_profiles = ['../Exp/MassFlux1.exp', '../Exp/MassFlux2.exp', '../Exp/MassFlux3.exp', '../Exp/MassFlux4.exp', '../Exp/MassFlux5.exp', '../Exp/MassFlux6.exp']
 md.qmu.mass_flux_profile_directory = getcwd()
 
@@ -70,17 +69,17 @@
 
 if version >= 6:
-	md.qmu.params.analysis_driver = 'matlab'
-	md.qmu.params.evaluation_scheduling = 'master'
-	md.qmu.params.processors_per_evaluation = 2
+    md.qmu.params.analysis_driver = 'matlab'
+    md.qmu.params.evaluation_scheduling = 'master'
+    md.qmu.params.processors_per_evaluation = 2
 else:
-	md.qmu.params.analysis_driver = 'stressbalance'
-	md.qmu.params.evaluation_concurrency = 1
+    md.qmu.params.analysis_driver = 'stressbalance'
+    md.qmu.params.evaluation_concurrency = 1
 
-md.stressbalance.reltol = 10**-5 #tighten for qmu analyses
+md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
 md.transient.requested_outputs = ['IceVolume']
 
 #solve
-md.verbose = verbose('000000000')	# this line is recommended
-md = solve(md,'Transient','overwrite','y')
+md.verbose = verbose('000000000')  # this line is recommended
+md = solve(md, 'Transient', 'overwrite', 'y')
 md.qmu.results = md.results.dakota
 
@@ -88,8 +87,8 @@
 md.results.dakota.moments = []
 for i in range(8):
-	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].mean)
+    md.results.dakota.moments.append(md.results.dakota.dresp_out[i].mean)
 
 for i in range(8):
-	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].stddev)
+    md.results.dakota.moments.append(md.results.dakota.dresp_out[i].stddev)
 
 field_names = ['moments']
Index: /issm/trunk/test/NightlyRun/test252.m
===================================================================
--- /issm/trunk/test/NightlyRun/test252.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test252.m	(revision 24313)
@@ -0,0 +1,115 @@
+%Test Name: SquareShelfSMBGembClim
+md=triangle(model(),'../Exp/Square.exp',350000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=setflowequation(md,'SSA','all');
+md.materials.rho_ice=910;
+md.cluster=generic('name',oshostname(),'np',3);
+
+% Use of Gemb method for SMB computation
+md.smb = SMBgemb(md.mesh,md.geometry);
+md.smb.dsnowIdx = 0;
+
+%load hourly surface forcing date from 1979 to 2009:
+inputs=load('../Data/gemb_input.mat');
+
+%setup the inputs:
+md.smb.Ta=[repmat(inputs.Ta0',md.mesh.numberofelements,1);inputs.dateN'];
+md.smb.V=[repmat(inputs.V0',md.mesh.numberofelements,1);inputs.dateN'];
+md.smb.dswrf=[repmat(inputs.dsw0',md.mesh.numberofelements,1);inputs.dateN'];
+md.smb.dlwrf=[repmat(inputs.dlw0',md.mesh.numberofelements,1);inputs.dateN'];
+md.smb.P=[repmat(inputs.P0',md.mesh.numberofelements,1);inputs.dateN'];
+md.smb.eAir=[repmat(inputs.eAir0',md.mesh.numberofelements,1);inputs.dateN'];
+md.smb.pAir=[repmat(inputs.pAir0',md.mesh.numberofelements,1);inputs.dateN'];
+md.smb.Vz=repmat(inputs.LP.Vz,md.mesh.numberofelements,1);
+md.smb.Tz=repmat(inputs.LP.Tz,md.mesh.numberofelements,1);
+md.smb.Tmean=repmat(inputs.LP.Tmean,md.mesh.numberofelements,1);
+md.smb.C=repmat(inputs.LP.C,md.mesh.numberofelements,1);
+
+md.smb.Ta=md.smb.Ta(:,1:365*8);
+md.smb.V=md.smb.V(:,1:365*8);
+md.smb.dswrf=md.smb.dswrf(:,1:365*8);
+md.smb.dlwrf=md.smb.dlwrf(:,1:365*8);
+md.smb.P=md.smb.P(:,1:365*8);
+md.smb.eAir=md.smb.eAir(:,1:365*8);
+md.smb.pAir=md.smb.pAir(:,1:365*8);
+
+md.smb.isclimatology=1;
+
+%smb settings
+md.smb.requested_outputs={'SmbDz','SmbT','SmbD','SmbRe','SmbGdn','SmbGsp','SmbEC','SmbA','SmbMassBalance','SmbMAdd','SmbDzAdd','SmbFAC'};
+
+%only run smb core:
+md.transient.isstressbalance=0;
+md.transient.ismasstransport=0;
+md.transient.isthermal=0;
+
+%time stepping:
+md.timestepping.start_time=1965.6;
+md.timestepping.final_time=1966.6;
+md.timestepping.time_step=1/365.0;
+md.timestepping.interp_forcings=0;
+
+%Run transient
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names      ={'SmbDz1','SmbT1' ,'SmbD1' ,'SmbRe1','SmbGdn1','SmbGsp1','SmbA1' ,'SmbEC1','SmbMassBalance1','SmbMAdd1','SmbDzAdd1','SmbFAC1',...
+	'SmbDz2','SmbT2' ,'SmbD2' ,'SmbRe2','SmbGdn2','SmbGsp2','SmbA2' ,'SmbEC2','SmbMassBalance2','SmbMAdd2','SmbDzAdd2','SmbFAC2',...
+	'SmbDz3','SmbT3' ,'SmbD3' ,'SmbRe3','SmbGdn3','SmbGsp3','SmbA3' ,'SmbEC3','SmbMassBalance3','SmbMAdd3','SmbDzAdd3','SmbFAC3',...
+	'SmbDz4','SmbT4' ,'SmbD4' ,'SmbRe4','SmbGdn4','SmbGsp4','SmbA4' ,'SmbEC4','SmbMassBalance4','SmbMAdd4','SmbDzAdd4','SmbFAC4'};
+field_tolerances ={1e-11,1e-12,1e-11,2e-11,1e-11,1e-11,1e-12,1e-12,1e-12,1e-12,1e-12,1e-11,...
+                   1e-11,1e-12,1e-11,8e-10,1e-11,4e-11,1e-12,4e-12,1e-12,1e-12,1e-12,2e-11,...
+                   1e-11,1e-12,1e-11,8e-10,1e-11,4e-11,1e-12,6e-12,6e-12,1e-12,1e-12,2e-11,...
+                   2e-9,1e-11,3e-9,1e-9,1e-11,2e-7,7e-11,2e-12,3e-9,1e-12,1e-12,9e-11};
+
+field_values={...
+	(md.results.TransientSolution(1).SmbDz(1,1:230)),...
+	(md.results.TransientSolution(1).SmbT(1,1:230)),...
+	(md.results.TransientSolution(1).SmbD(1,1:230)),...
+	(md.results.TransientSolution(1).SmbRe(1,1:230)),...
+	(md.results.TransientSolution(1).SmbGdn(1,1:230)),...
+	(md.results.TransientSolution(1).SmbGsp(1,1:230)),...
+	(md.results.TransientSolution(1).SmbA(1,1:230)),...
+	(md.results.TransientSolution(1).SmbEC(1)),...
+	(md.results.TransientSolution(1).SmbMassBalance(1)),...
+	(md.results.TransientSolution(1).SmbMAdd(1)),...
+	(md.results.TransientSolution(1).SmbDzAdd(1)),...
+	(md.results.TransientSolution(1).SmbFAC(1)),...
+   (md.results.TransientSolution(146).SmbDz(1,1:230)),...
+	(md.results.TransientSolution(146).SmbT(1,1:230)),...
+	(md.results.TransientSolution(146).SmbD(1,1:230)),...
+	(md.results.TransientSolution(146).SmbRe(1,1:230)),...
+	(md.results.TransientSolution(146).SmbGdn(1,1:230)),...
+	(md.results.TransientSolution(146).SmbGsp(1,1:230)),...
+	(md.results.TransientSolution(146).SmbA(1,1:230)),...
+	(md.results.TransientSolution(146).SmbEC(1)),...
+	(md.results.TransientSolution(146).SmbMassBalance(1)),...
+	(md.results.TransientSolution(146).SmbMAdd(1)),...
+	(md.results.TransientSolution(146).SmbDzAdd(1)),...
+	(md.results.TransientSolution(146).SmbFAC(1)),...
+	(md.results.TransientSolution(147).SmbDz(1,1:230)),...
+	(md.results.TransientSolution(147).SmbT(1,1:230)),...
+	(md.results.TransientSolution(147).SmbD(1,1:230)),...
+	(md.results.TransientSolution(147).SmbRe(1,1:230)),...
+	(md.results.TransientSolution(147).SmbGdn(1,1:230)),...
+	(md.results.TransientSolution(147).SmbGsp(1,1:230)),...
+	(md.results.TransientSolution(147).SmbA(1,1:230)),...
+	(md.results.TransientSolution(147).SmbEC(1)),...
+	(md.results.TransientSolution(147).SmbMassBalance(1)),...
+	(md.results.TransientSolution(147).SmbMAdd(1)),...
+	(md.results.TransientSolution(147).SmbDzAdd(1)),...
+	(md.results.TransientSolution(147).SmbFAC(1)),...
+	(md.results.TransientSolution(end).SmbDz(1,1:230)),...
+	(md.results.TransientSolution(end).SmbT(1,1:230)),...
+	(md.results.TransientSolution(end).SmbD(1,1:230)),...
+	(md.results.TransientSolution(end).SmbRe(1,1:230)),...
+	(md.results.TransientSolution(end).SmbGdn(1,1:230)),...
+	(md.results.TransientSolution(end).SmbGsp(1,1:230)),...
+	(md.results.TransientSolution(end).SmbA(1,1:230)),...
+	(md.results.TransientSolution(end).SmbEC(1)),...
+	(md.results.TransientSolution(end).SmbMassBalance(1)),...
+	(md.results.TransientSolution(end).SmbMAdd(1)),...
+	(md.results.TransientSolution(end).SmbDzAdd(1)),...
+	(md.results.TransientSolution(end).SmbFAC(1)),...
+	};
Index: /issm/trunk/test/NightlyRun/test252.py
===================================================================
--- /issm/trunk/test/NightlyRun/test252.py	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test252.py	(revision 24313)
@@ -0,0 +1,130 @@
+#Test Name: SquareShelfSMBGembClim
+import numpy as np
+import sys
+from model import *
+from socket import gethostname
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+from SMBgemb import *
+
+md = triangle(model(), '../Exp/Square.exp', 350000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.materials.rho_ice = 910
+md.cluster = generic('name', gethostname(), 'np', 3)
+
+#Use of Gemb method for SMB computation
+md.smb = SMBgemb()
+md.smb.setdefaultparameters(md.mesh, md.geometry)
+md.smb.dsnowIdx = 0
+
+#load hourly surface forcing date from 1979 to 2009:
+if sys.version_info.major == 2:
+    inputs = np.load('../Data/gemb_input.npy', allow_pickle=True).item()
+else:
+    inputs = np.load('../Data/gemb_input.npy', allow_pickle=True, encoding='bytes').item()
+
+#setup the inputs:
+md.smb.Ta = np.append(np.tile(np.conjugate(inputs[b'Ta0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0)
+md.smb.V = np.append(np.tile(np.conjugate(inputs[b'V0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0)
+md.smb.dswrf = np.append(np.tile(np.conjugate(inputs[b'dsw0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0)
+md.smb.dlwrf = np.append(np.tile(np.conjugate(inputs[b'dlw0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0)
+md.smb.P = np.append(np.tile(np.conjugate(inputs[b'P0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0)
+md.smb.eAir = np.append(np.tile(np.conjugate(inputs[b'eAir0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0)
+md.smb.pAir = np.append(np.tile(np.conjugate(inputs[b'pAir0']), (md.mesh.numberofelements, 1)), np.conjugate([inputs[b'dateN']]), axis=0)
+md.smb.Vz = np.tile(np.conjugate(inputs[b'LP']['Vz']), (md.mesh.numberofelements, 1)).flatten()
+md.smb.Tz = np.tile(np.conjugate(inputs[b'LP']['Tz']), (md.mesh.numberofelements, 1)).flatten()
+md.smb.Tmean = np.tile(np.conjugate(inputs[b'LP']['Tmean']), (md.mesh.numberofelements, 1)).flatten()
+md.smb.C = np.tile(np.conjugate(inputs[b'LP']['C']), (md.mesh.numberofelements, 1)).flatten()
+
+md.smb.Ta = md.smb.Ta[:, 0:365 * 8]
+md.smb.V = md.smb.V[:, 0:365 * 8]
+md.smb.dswrf = md.smb.dswrf[:, 0:365 * 8]
+md.smb.dlwrf = md.smb.dlwrf[:, 0:365 * 8]
+md.smb.P = md.smb.P[:, 0:365 * 8]
+md.smb.eAir = md.smb.eAir[:, 0:365 * 8]
+md.smb.pAir = md.smb.pAir[:, 0:365 * 8]
+
+md.smb.isclimatology = 1
+
+#smb settings
+md.smb.requested_outputs = ['SmbDz', 'SmbT', 'SmbD', 'SmbRe', 'SmbGdn', 'SmbGsp', 'SmbEC', 'SmbA', 'SmbMassBalance', 'SmbMAdd', 'SmbDzAdd', 'SmbFAC']
+
+#only run smb core:
+md.transient.isstressbalance = 0
+md.transient.ismasstransport = 0
+md.transient.isthermal = 0
+
+#time stepping:
+md.timestepping.start_time = 1965.6
+md.timestepping.final_time = 1966.6
+md.timestepping.time_step = 1. / 365.0
+md.timestepping.interp_forcings = 0.
+
+#Run transient
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+
+field_names = ['SmbDz1', 'SmbT1', 'SmbD1', 'SmbRe1', 'SmbGdn1', 'SmbGsp1', 'SmbA1', 'SmbEC1', 'SmbMassBalance1', 'SmbMAdd1', 'SmbDzAdd1', 'SmbFAC1',
+               'SmbDz2', 'SmbT2', 'SmbD2', 'SmbRe2', 'SmbGdn2', 'SmbGsp2', 'SmbA2', 'SmbEC2', 'SmbMassBalance2', 'SmbMAdd2', 'SmbDzAdd2', 'SmbFAC2',
+               'SmbDz3', 'SmbT3', 'SmbD3', 'SmbRe3', 'SmbGdn3', 'SmbGsp3', 'SmbA3', 'SmbEC3', 'SmbMassBalance3', 'SmbMAdd3', 'SmbDzAdd3', 'SmbFAC3',
+               'SmbDz4', 'SmbT4', 'SmbD4', 'SmbRe4', 'SmbGdn4', 'SmbGsp4', 'SmbA4', 'SmbEC4', 'SmbMassBalance4', 'SmbMAdd4', 'SmbDzAdd4', 'SmbFAC4']
+field_tolerances = [1e-11, 1e-12, 1e-11, 2e-11, 1e-11, 1e-11, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-11,
+                    1e-11, 1e-12, 1e-11, 8e-10, 1e-11, 4e-11, 1e-12, 4e-12, 1e-12, 1e-12, 1e-12, 2e-11,
+                    1e-11, 1e-12, 1e-11, 8e-10, 1e-11, 4e-11, 1e-12, 6e-12, 6e-12, 1e-12, 1e-12, 2e-11,
+                    2e-9, 1e-11, 3e-9, 1e-9, 1e-11, 2e-7, 7e-11, 2e-12, 3e-9, 1e-12, 1e-12, 9e-11]
+
+#shape is different in python solution (fixed using reshape) which can cause test failure:
+field_values = [md.results.TransientSolution[0].SmbDz[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[0].SmbT[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[0].SmbD[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[0].SmbRe[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[0].SmbGdn[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[0].SmbGsp[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[0].SmbA[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[0].SmbEC[0],
+                md.results.TransientSolution[0].SmbMassBalance[0],
+                md.results.TransientSolution[0].SmbMAdd[0],
+                md.results.TransientSolution[0].SmbDzAdd[0],
+                md.results.TransientSolution[0].SmbFAC[0],
+                md.results.TransientSolution[145].SmbDz[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[145].SmbT[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[145].SmbD[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[145].SmbRe[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[145].SmbGdn[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[145].SmbGsp[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[145].SmbA[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[145].SmbEC[0],
+                md.results.TransientSolution[145].SmbMassBalance[0],
+                md.results.TransientSolution[145].SmbMAdd[0],
+                md.results.TransientSolution[145].SmbDzAdd[0],
+                md.results.TransientSolution[145].SmbFAC[0],
+                md.results.TransientSolution[146].SmbDz[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[146].SmbT[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[146].SmbD[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[146].SmbRe[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[146].SmbGdn[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[146].SmbGsp[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[146].SmbA[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[146].SmbEC[0],
+                md.results.TransientSolution[146].SmbMassBalance[0],
+                md.results.TransientSolution[146].SmbMAdd[0],
+                md.results.TransientSolution[146].SmbDzAdd[0],
+                md.results.TransientSolution[146].SmbFAC[0],
+                md.results.TransientSolution[-1].SmbDz[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[-1].SmbT[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[-1].SmbD[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[-1].SmbRe[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[-1].SmbGdn[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[-1].SmbGsp[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[-1].SmbA[0, 0:230].reshape(1, -1),
+                md.results.TransientSolution[-1].SmbEC[0],
+                md.results.TransientSolution[-1].SmbMassBalance[0],
+                md.results.TransientSolution[-1].SmbMAdd[0],
+                md.results.TransientSolution[-1].SmbDzAdd[0],
+                md.results.TransientSolution[-1].SmbFAC[0]]
Index: /issm/trunk/test/NightlyRun/test260.py
===================================================================
--- /issm/trunk/test/NightlyRun/test260.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test260.py	(revision 24313)
@@ -10,22 +10,20 @@
 from matenhancedice import *
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'all','')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
 md.materials = matenhancedice()
-md.materials.rheology_B = 3.15e8 * np.ones(md.mesh.numberofvertices,)
-md.materials.rheology_n = 3 * np.ones(md.mesh.numberofelements,)
-md.materials.rheology_E = np.ones(md.mesh.numberofvertices,)
-md = parameterize(md,'../Par/SquareShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
-md = solve(md,'Stressbalance')
+md.materials.rheology_B = 3.15e8 * np.ones(md.mesh.numberofvertices, )
+md.materials.rheology_n = 3 * np.ones(md.mesh.numberofelements, )
+md.materials.rheology_E = np.ones(md.mesh.numberofvertices, )
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names      = ['Vx','Vy','Vel','Pressure']
-field_tolerances = [1e-13,1e-13,1e-13,1e-13]
-field_values = [
-	md.results.StressbalanceSolution.Vx,
-	md.results.StressbalanceSolution.Vy,
-	md.results.StressbalanceSolution.Vel,
-	md.results.StressbalanceSolution.Pressure,
-	]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test261.py
===================================================================
--- /issm/trunk/test/NightlyRun/test261.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test261.py	(revision 24313)
@@ -10,14 +10,14 @@
 from matenhancedice import *
 
-md = triangle(model(),'../Exp/Square.exp',180000.)
-md = setmask(md,'all','')
-md = parameterize(md,'../Par/SquareShelfConstrained.py')
-md = md.extrude(3,1.)
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.materials = matenhancedice()
-md.materials.rheology_B = 3.15e8 * np.ones(md.mesh.numberofvertices,)
-md.materials.rheology_n = 3 * np.ones(md.mesh.numberofelements,)
-md.materials.rheology_E = np.ones(md.mesh.numberofvertices,)
+md.materials.rheology_B = 3.15e8 * np.ones(md.mesh.numberofvertices, )
+md.materials.rheology_n = 3 * np.ones(md.mesh.numberofelements, )
+md.materials.rheology_E = np.ones(md.mesh.numberofvertices, )
 md.transient.isstressbalance = 1
 md.transient.ismasstransport = 0
@@ -25,14 +25,12 @@
 md.transient.isthermal = 1
 md.transient.isgroundingline = 0
-md = solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names      = ['Vx','Vy','Vel','Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances = [1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values = [
-	md.results.TransientSolution[0].Vx,
-	md.results.TransientSolution[0].Vy,
-	md.results.TransientSolution[0].Vel,
-	md.results.TransientSolution[0].Temperature,
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
-	]
+field_names = ['Vx', 'Vy', 'Vel', 'Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test270.py
===================================================================
--- /issm/trunk/test/NightlyRun/test270.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test270.py	(revision 24313)
@@ -10,22 +10,21 @@
 from matdamageice import matdamageice
 from generic import generic
-from socket import gethostname
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md.materials=matdamageice()
-md=parameterize(md,'../Par/SquareShelf.py')
-md.damage.isdamage=1
-md.damage.D=0.5*np.ones(md.mesh.numberofvertices)
-md.damage.spcdamage=np.nan*np.ones(md.mesh.numberofvertices)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md.materials = matdamageice()
+md = parameterize(md, '../Par/SquareShelf.py')
+md.damage.isdamage = 1
+md.damage.D = 0.5 * np.ones(md.mesh.numberofvertices)
+md.damage.spcdamage = np.nan * np.ones(md.mesh.numberofvertices)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vel','Pressure']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13]
-field_values=[md.results.StressbalanceSolution.Vx,
-							md.results.StressbalanceSolution.Vy,
-							md.results.StressbalanceSolution.Vel,
-							md.results.StressbalanceSolution.Pressure]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test272.py
===================================================================
--- /issm/trunk/test/NightlyRun/test272.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test272.py	(revision 24313)
@@ -8,42 +8,43 @@
 from setflowequation import setflowequation
 from solve import solve
-from socket import gethostname
 from matdamageice import matdamageice
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md.materials=matdamageice()
-md=parameterize(md,'../Par/SquareShelf.py')
-md.damage.isdamage=1
-md.damage.D=0.5*np.ones(md.mesh.numberofvertices)
-md.damage.spcdamage=np.nan*np.ones(md.mesh.numberofvertices)
-md=setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md.materials = matdamageice()
+md = parameterize(md, '../Par/SquareShelf.py')
+md.damage.isdamage = 1
+md.damage.D = 0.5 * np.ones(md.mesh.numberofvertices)
+md.damage.spcdamage = np.nan * np.ones(md.mesh.numberofvertices)
+md = setflowequation(md, 'SSA', 'all')
 
 #control parameters
-md.inversion.iscontrol=1
-md.inversion.control_parameters=['DamageDbar']
-md.inversion.min_parameters=10**-13*np.ones((md.mesh.numberofvertices))
-md.inversion.max_parameters=np.ones((md.mesh.numberofvertices))
-md.inversion.nsteps=2
-md.inversion.cost_functions=[101]
-md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices))
-md.inversion.gradient_scaling=0.9*np.ones((md.inversion.nsteps))
-md.inversion.maxiter_per_step=2.*np.ones((md.inversion.nsteps))
-md.inversion.step_threshold=0.99*np.ones((md.inversion.nsteps))
-md.inversion.vx_obs=md.initialization.vx 
-md.inversion.vy_obs=md.initialization.vy
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['DamageDbar']
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['DamageDbar']
+md.inversion.min_parameters = 10**-13 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.nsteps = 2
+md.inversion.cost_functions = [101]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, len(md.inversion.cost_functions)))
+md.inversion.gradient_scaling = 0.9 * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
+md.inversion.maxiter_per_step = 2. * np.ones((md.inversion.nsteps))
+md.inversion.step_threshold = 0.99 * np.ones((md.inversion.nsteps))
+md.inversion.vx_obs = md.initialization.vx
+md.inversion.vy_obs = md.initialization.vy
 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Gradient','Misfits','DamageDbar','Pressure','Vel','Vx','Vy']
-field_tolerances=[1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12]
-field_values=[md.results.StressbalanceSolution.Gradient1,
-							md.results.StressbalanceSolution.J,
-							md.results.StressbalanceSolution.DamageDbar,
-							md.results.StressbalanceSolution.Pressure,
-							md.results.StressbalanceSolution.Vel,
-							md.results.StressbalanceSolution.Vx,
-							md.results.StressbalanceSolution.Vy]
+field_names = ['Gradient', 'Misfits', 'DamageDbar', 'Pressure', 'Vel', 'Vx', 'Vy']
+field_tolerances = [1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12]
+field_values = [md.results.StressbalanceSolution.Gradient1,
+                md.results.StressbalanceSolution.J,
+                md.results.StressbalanceSolution.DamageDbar,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy]
Index: /issm/trunk/test/NightlyRun/test273.py
===================================================================
--- /issm/trunk/test/NightlyRun/test273.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test273.py	(revision 24313)
@@ -10,28 +10,27 @@
 from matdamageice import matdamageice
 from generic import generic
-from socket import gethostname
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md.materials=matdamageice()
-md=parameterize(md,'../Par/SquareShelf.py')
-md.damage.isdamage=1
-md.damage.D=0.*np.ones(md.mesh.numberofvertices)
-md.damage.spcdamage=np.nan*np.ones(md.mesh.numberofvertices)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md.materials = matdamageice()
+md = parameterize(md, '../Par/SquareShelf.py')
+md.damage.isdamage = 1
+md.damage.D = 0. * np.ones(md.mesh.numberofvertices)
+md.damage.spcdamage = np.nan * np.ones(md.mesh.numberofvertices)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.stressbalance.requested_outputs=['default','NewDamage']
-md.damage.stress_threshold=1.3e5
-md.damage.kappa=2.8
+md.stressbalance.requested_outputs = ['default', 'NewDamage']
+md.damage.stress_threshold = 1.3e5
+md.damage.kappa = 2.8
 
-md=solve(md,'Stressbalance')
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vel','Pressure','NewDamage']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[md.results.StressbalanceSolution.Vx,
-							md.results.StressbalanceSolution.Vy,
-							md.results.StressbalanceSolution.Vel,
-							md.results.StressbalanceSolution.Pressure,
-							md.results.StressbalanceSolution.NewDamage]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure', 'NewDamage']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.NewDamage]
Index: /issm/trunk/test/NightlyRun/test274.py
===================================================================
--- /issm/trunk/test/NightlyRun/test274.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test274.py	(revision 24313)
@@ -8,28 +8,27 @@
 from setflowequation import setflowequation
 from solve import solve
-from socket import gethostname
 from matdamageice import matdamageice
 from meshprocessrifts import meshprocessrifts
 from generic import generic
 
-md=triangle(model(),'../Exp/SquareHole.exp','../Exp/Rifts.exp',50000.)
-md=meshprocessrifts(md,'../Exp/Square.exp')
-md=setmask(md,'all','')
-md.materials=matdamageice()
-md=parameterize(md,'../Par/SquareShelf2.py')
-md.damage.isdamage=1
-md.damage.D=0.5*np.ones(md.mesh.numberofvertices)
-md.damage.spcdamage=np.nan*np.ones(md.mesh.numberofvertices)
-md=setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/SquareHole.exp', '../Exp/Rifts.exp', 50000.)
+md = meshprocessrifts(md, '../Exp/Square.exp')
+md = setmask(md, 'all', '')
+md.materials = matdamageice()
+md = parameterize(md, '../Par/SquareShelf2.py')
+md.damage.isdamage = 1
+md.damage.D = 0.5 * np.ones(md.mesh.numberofvertices)
+md.damage.spcdamage = np.nan * np.ones(md.mesh.numberofvertices)
+md = setflowequation(md, 'SSA', 'all')
 
-md.cluster=generic('name',gethostname(),'np',3)
-print md.rifts.riftstruct[0]['fill']
-md=solve(md,'Stressbalance')
+md.cluster = generic('name', gethostname(), 'np', 3)
+print(md.rifts.riftstruct[0]['fill'])
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vel','Pressure']
-field_tolerances=[7e-8,3e-8,3e-8,1e-11]
-field_values=[md.results.StressbalanceSolution.Vx,
-							md.results.StressbalanceSolution.Vy,
-							md.results.StressbalanceSolution.Vel,
-							md.results.StressbalanceSolution.Pressure]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure']
+field_tolerances = [7e-8, 3e-8, 3e-8, 1e-11]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test275.py
===================================================================
--- /issm/trunk/test/NightlyRun/test275.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test275.py	(revision 24313)
@@ -1,3 +1,3 @@
-#Test Name: SquareShelfDamageEvolutionSSA2dPralong 
+#Test Name: SquareShelfDamageEvolutionSSA2dPralong
 import numpy as np
 from triangle import triangle
@@ -6,35 +6,33 @@
 from setmask import setmask
 from parameterize import parameterize
-from verbose import verbose
 from setflowequation import setflowequation
 from generic import generic
-from socket import gethostname
 from solve import solve
 from matdamageice import matdamageice
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md.materials=matdamageice()
-md=parameterize(md,'../Par/SquareShelf.py')
-md.damage.isdamage=1
-md.damage.D=0.1*np.ones(md.mesh.numberofvertices)
-md.damage.spcdamage=np.nan*np.ones(md.mesh.numberofvertices)
-md.damage.law=1
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md.materials = matdamageice()
+md = parameterize(md, '../Par/SquareShelf.py')
+md.damage.isdamage = 1
+md.damage.D = 0.1 * np.ones(md.mesh.numberofvertices)
+md.damage.spcdamage = np.nan * np.ones(md.mesh.numberofvertices)
+md.damage.law = 1
 
-md.damage.c1=1.e-11
-md.damage.c2=0.4
-md.damage.c3=1.e-3
-md.damage.healing=0.4
-md.damage.stress_threshold=1.e5
-md.damage.stabilization=1
+md.damage.c1 = 1.e-11
+md.damage.c2 = 0.4
+md.damage.c3 = 1.e-3
+md.damage.healing = 0.4
+md.damage.stress_threshold = 1.e5
+md.damage.stabilization = 1
 
-md.damage.requested_outputs=['default','DamageF']
+md.damage.requested_outputs = ['default', 'DamageF']
 
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'DamageEvolution')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'DamageEvolution')
 
-field_names=['D','F']
-field_tolerances=[1.e-13,1.e-13]
-field_values=[md.results.DamageEvolutionSolution.DamageDbar,
-							md.results.DamageEvolutionSolution.DamageF]
+field_names = ['D', 'F']
+field_tolerances = [1.e-13, 1.e-13]
+field_values = [md.results.DamageEvolutionSolution.DamageDbar,
+                md.results.DamageEvolutionSolution.DamageF]
Index: /issm/trunk/test/NightlyRun/test280.py
===================================================================
--- /issm/trunk/test/NightlyRun/test280.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test280.py	(revision 24313)
@@ -10,22 +10,20 @@
 from ContourToMesh import *
 
-md=triangle(model(),'../Exp/Square.exp',150000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-field_names=[]
-field_tolerances=[]
-field_values=[]
-for i in ['P1bubble','P1bubblecondensed','P2']:
-	md.flowequation.fe_SSA=i
-	md=solve(md,'Stressbalance')
-	field_names     =field_names+['Vx'+i,'Vy'+i,'Vel'+i,'Pressure'+i]
-	field_tolerances=field_tolerances+[1e-12,1e-13,1e-13,1e-13]
-	field_values=field_values+[\
-		md.results.StressbalanceSolution.Vx,\
-		md.results.StressbalanceSolution.Vy,\
-		md.results.StressbalanceSolution.Vel,\
-		md.results.StressbalanceSolution.Pressure,\
-		]
+field_names = []
+field_tolerances = []
+field_values = []
+for i in ['P1bubble', 'P1bubblecondensed', 'P2']:
+    md.flowequation.fe_SSA = i
+    md = solve(md, 'Stressbalance')
+    field_names = field_names + ['Vx' + i, 'Vy' + i, 'Vel' + i, 'Pressure' + i]
+    field_tolerances = field_tolerances + [1e-12, 1e-13, 1e-13, 1e-13]
+    field_values = field_values + [md.results.StressbalanceSolution.Vx,
+                                   md.results.StressbalanceSolution.Vy,
+                                   md.results.StressbalanceSolution.Vel,
+                                   md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test285.py
===================================================================
--- /issm/trunk/test/NightlyRun/test285.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test285.py	(revision 24313)
@@ -10,24 +10,22 @@
 from ContourToMesh import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,2.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-field_names=[]
-field_tolerances=[]
-field_values=[]
-for i in ['P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P1xP3','P2xP4']:
-	md.flowequation.fe_HO=i
-	md=solve(md,'Stressbalance')
-	field_names     =field_names+['Vx'+i,'Vy'+i,'Vz'+i,'Vel'+i,'Pressure'+i]
-	field_tolerances=field_tolerances+[6.7e-08,5e-08,2e-08,5e-08,1e-13]
-	field_values=field_values+[\
-		md.results.StressbalanceSolution.Vx,\
-		md.results.StressbalanceSolution.Vy,\
-		md.results.StressbalanceSolution.Vz,\
-		md.results.StressbalanceSolution.Vel,\
-		md.results.StressbalanceSolution.Pressure,\
-		]
+field_names = []
+field_tolerances = []
+field_values = []
+for i in ['P1bubble', 'P1bubblecondensed', 'P1xP2', 'P2xP1', 'P2', 'P1xP3', 'P2xP4']:
+    md.flowequation.fe_HO = i
+    md = solve(md, 'Stressbalance')
+    field_names = field_names + ['Vx' + i, 'Vy' + i, 'Vz' + i, 'Vel' + i, 'Pressure' + i]
+    field_tolerances = field_tolerances + [6.7e-08, 5e-08, 2e-08, 5e-08, 1e-13]
+    field_values = field_values + [md.results.StressbalanceSolution.Vx,
+                                   md.results.StressbalanceSolution.Vy,
+                                   md.results.StressbalanceSolution.Vz,
+                                   md.results.StressbalanceSolution.Vel,
+                                   md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test290.py
===================================================================
--- /issm/trunk/test/NightlyRun/test290.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test290.py	(revision 24313)
@@ -10,21 +10,19 @@
 from ContourToMesh import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,2.)
-md=setflowequation(md,'FS','all')
-md.flowequation.fe_FS='TaylorHood'
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'FS', 'all')
+md.flowequation.fe_FS = 'TaylorHood'
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx', 'Vy', 'Vz', 'Vel','Pressure']
-field_tolerances=[5e-5,5e-5,8e-4,5e-4,2e-7]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [5e-5, 5e-5, 8e-4, 5e-4, 2e-7]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test291.py
===================================================================
--- /issm/trunk/test/NightlyRun/test291.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test291.py	(revision 24313)
@@ -10,21 +10,19 @@
 from ContourToMesh import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(2,1.)
-md=setflowequation(md,'FS','all')
-md.flowequation.fe_FS='OneLayerP4z'
-md.cluster=generic('name',gethostname(),'np',1)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(2, 1.)
+md = setflowequation(md, 'FS', 'all')
+md.flowequation.fe_FS = 'OneLayerP4z'
+md.cluster = generic('name', gethostname(), 'np', 1)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx', 'Vy', 'Vz', 'Vel','Pressure']
-field_tolerances=[5e-5,5e-5,8e-5,5e-5,1e-7]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [5e-5, 5e-5, 8e-5, 5e-5, 1e-7]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test292.py
===================================================================
--- /issm/trunk/test/NightlyRun/test292.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test292.py	(revision 24313)
@@ -12,41 +12,41 @@
 from linearbasalforcings import linearbasalforcings
 
-md=triangle(model(),'../Exp/Square.exp',150000)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.basalforcings=linearbasalforcings(md.basalforcings)
-md.basalforcings.deepwater_melting_rate = np.array([[50.,100.],[0.,5.]])
-md.timestepping.interp_forcings=0
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 150000)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.basalforcings = linearbasalforcings(md.basalforcings)
+md.basalforcings.deepwater_melting_rate = np.array([[50., 100.], [0., 5.]])
+md.timestepping.interp_forcings = 0
+md = solve(md, 'Transient')
 
 # Fields and tolerances to track changes
 
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Base1','Surface1','Thickness1',
-									'Vx2','Vy2','Vel2','Pressure2','Base2','Surface2','Thickness2',
-									'Vx3','Vy3','Vel3','Pressure3','Base3','Surface3','Thickness3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Base1', 'Surface1', 'Thickness1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Base2', 'Surface2', 'Thickness2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Base3', 'Surface3', 'Thickness3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness]
Index: /issm/trunk/test/NightlyRun/test293.py
===================================================================
--- /issm/trunk/test/NightlyRun/test293.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test293.py	(revision 24313)
@@ -10,50 +10,49 @@
 from mismipbasalforcings import *
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'all','')
-md = parameterize(md,'../Par/SquareShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.constants.yts = 365.2422 * 24. * 3600.
 md.basalforcings = mismipbasalforcings()
 md.basalforcings = md.basalforcings.initialize(md)
 md.transient.isgroundingline = 1
-md.geometry.bed = min(md.geometry.base) * np.ones(md.mesh.numberofvertices,)
-md.transient.requested_outputs = ['default','BasalforcingsFloatingiceMeltingRate']
+md.geometry.bed = min(md.geometry.base) * np.ones(md.mesh.numberofvertices, )
+md.transient.requested_outputs = ['default', 'BasalforcingsFloatingiceMeltingRate']
 
-md = solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','BasalforcingsFloatingiceMeltingRate1',
-	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','BasalforcingsFloatingiceMeltingRate2',
-	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','BasalforcingsFloatingiceMeltingRate3']
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'BasalforcingsFloatingiceMeltingRate1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'BasalforcingsFloatingiceMeltingRate2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'BasalforcingsFloatingiceMeltingRate3']
 field_tolerances = [
-	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,2e-13,
-	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,2e-13,
-	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,2e-13]
+    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 2e-13,
+    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 2e-13,
+    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 2e-13]
 field_values = [
-	md.results.TransientSolution[0].Vx,
-	md.results.TransientSolution[0].Vy,
-	md.results.TransientSolution[0].Vel,
-	md.results.TransientSolution[0].Pressure,
-	md.results.TransientSolution[0].Base,
-	md.results.TransientSolution[0].Surface,
-	md.results.TransientSolution[0].Thickness,
-	md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate,
-	md.results.TransientSolution[1].Vx,
-	md.results.TransientSolution[1].Vy,
-	md.results.TransientSolution[1].Vel,
-	md.results.TransientSolution[1].Pressure,
-	md.results.TransientSolution[1].Base,
-	md.results.TransientSolution[1].Surface,
-	md.results.TransientSolution[1].Thickness,
-	md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate,
-	md.results.TransientSolution[2].Vx,
-	md.results.TransientSolution[2].Vy,
-	md.results.TransientSolution[2].Vel,
-	md.results.TransientSolution[2].Pressure,
-	md.results.TransientSolution[2].Base,
-	md.results.TransientSolution[2].Surface,
-	md.results.TransientSolution[2].Thickness,
-	md.results.TransientSolution[2].BasalforcingsFloatingiceMeltingRate,
-	]
+    md.results.TransientSolution[0].Vx,
+    md.results.TransientSolution[0].Vy,
+    md.results.TransientSolution[0].Vel,
+    md.results.TransientSolution[0].Pressure,
+    md.results.TransientSolution[0].Base,
+    md.results.TransientSolution[0].Surface,
+    md.results.TransientSolution[0].Thickness,
+    md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate,
+    md.results.TransientSolution[1].Vx,
+    md.results.TransientSolution[1].Vy,
+    md.results.TransientSolution[1].Vel,
+    md.results.TransientSolution[1].Pressure,
+    md.results.TransientSolution[1].Base,
+    md.results.TransientSolution[1].Surface,
+    md.results.TransientSolution[1].Thickness,
+    md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate,
+    md.results.TransientSolution[2].Vx,
+    md.results.TransientSolution[2].Vy,
+    md.results.TransientSolution[2].Vel,
+    md.results.TransientSolution[2].Pressure,
+    md.results.TransientSolution[2].Base,
+    md.results.TransientSolution[2].Surface,
+    md.results.TransientSolution[2].Thickness,
+    md.results.TransientSolution[2].BasalforcingsFloatingiceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test3001.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3001.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3001.py	(revision 24313)
@@ -7,27 +7,27 @@
 from setflowequation import *
 from solve import *
+from issmgslsolver import issmgslsolver
 
 
-md=triangle(model(),'../Exp/Square.exp',50000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md.stressbalance.requested_outputs=['default','DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy']
-md.autodiff.isautodiff=True
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 50000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.stressbalance.requested_outputs = ['default', 'DeviatoricStressxx', 'DeviatoricStressyy', 'DeviatoricStressxy']
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmgslsolver()
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vel','Pressure',\
-	'DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,\
-	1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	md.results.StressbalanceSolution.DeviatoricStressxx,\
-	md.results.StressbalanceSolution.DeviatoricStressyy,\
-	md.results.StressbalanceSolution.DeviatoricStressxy,\
-	]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure',
+               'DeviatoricStressxx', 'DeviatoricStressyy', 'DeviatoricStressxy']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.DeviatoricStressxx,
+                md.results.StressbalanceSolution.DeviatoricStressyy,
+                md.results.StressbalanceSolution.DeviatoricStressxy]
Index: /issm/trunk/test/NightlyRun/test3002.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3002.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3002.py	(revision 24313)
@@ -7,23 +7,23 @@
 from setflowequation import *
 from solve import *
+from issmgslsolver import issmgslsolver
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,2.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md.autodiff.isautodiff=True
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmgslsolver()
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test3003.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3003.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3003.py	(revision 24313)
@@ -7,32 +7,32 @@
 from setflowequation import *
 from solve import *
+from issmgslsolver import issmgslsolver
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,2.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md.stressbalance.requested_outputs=['default','StressTensorxx','StressTensoryy','StressTensorzz','StressTensorxy','StressTensorxz','StressTensoryz']
-md.autodiff.isautodiff=True
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.stressbalance.requested_outputs = ['default', 'StressTensorxx', 'StressTensoryy', 'StressTensorzz', 'StressTensorxy', 'StressTensorxz', 'StressTensoryz']
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmgslsolver()
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure',\
-	'StressTensorxx','StressTensoryy','StressTensorzz','StressTensorxy','StressTensorxz','StressTensoryz']
-field_tolerances=[1e-09,1e-09,1e-09,1e-09,1e-09,\
-	1e-09,1e-09,1e-09,1e-09,1e-09,2e-09]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	md.results.StressbalanceSolution.StressTensorxx,\
-	md.results.StressbalanceSolution.StressTensoryy,\
-	md.results.StressbalanceSolution.StressTensorzz,\
-	md.results.StressbalanceSolution.StressTensorxy,\
-	md.results.StressbalanceSolution.StressTensorxz,\
-	md.results.StressbalanceSolution.StressTensoryz,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure',
+               'StressTensorxx', 'StressTensoryy', 'StressTensorzz', 'StressTensorxy', 'StressTensorxz', 'StressTensoryz']
+field_tolerances = [1e-09, 1e-09, 1e-09, 1e-09, 1e-09,
+                    1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 2e-09]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.StressTensorxx,
+                md.results.StressbalanceSolution.StressTensoryy,
+                md.results.StressbalanceSolution.StressTensorzz,
+                md.results.StressbalanceSolution.StressTensorxy,
+                md.results.StressbalanceSolution.StressTensorxz,
+                md.results.StressbalanceSolution.StressTensoryz]
Index: /issm/trunk/test/NightlyRun/test3004.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3004.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3004.py	(revision 24313)
@@ -7,23 +7,23 @@
 from setflowequation import *
 from solve import *
+from issmgslsolver import issmgslsolver
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,2.)
-md=setflowequation(md,'FS','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md.autodiff.isautodiff=True
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'FS', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmgslsolver()
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-08,1e-08,3e-07,1e-08,1e-08]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-08, 1e-08, 3e-07, 1e-08, 1e-08]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test3005.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3005.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3005.py	(revision 24313)
@@ -7,18 +7,18 @@
 from setflowequation import *
 from solve import *
+from issmgslsolver import issmgslsolver
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md.autodiff.isautodiff=True
-md=solve(md,'Masstransport')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmgslsolver()
+md = solve(md, 'Masstransport')
 
 #Fields and tolerances to track changes
-field_names     =['Thickness']
-field_tolerances=[1e-13]
-field_values=[\
-	md.results.MasstransportSolution.Thickness,\
-	]
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test3006.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3006.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3006.py	(revision 24313)
@@ -8,21 +8,21 @@
 from setflowequation import *
 from solve import *
+from issmgslsolver import issmgslsolver
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=meshconvert(md)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md.masstransport.stabilization=3
-md.masstransport.spcthickness=md.geometry.thickness
-md.autodiff.isautodiff=True
-md=solve(md,'Masstransport')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = meshconvert(md)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.masstransport.stabilization = 3
+md.masstransport.spcthickness = md.geometry.thickness
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmgslsolver()
+md = solve(md, 'Masstransport')
 
 #Fields and tolerances to track changes
-field_names     =['Thickness']
-field_tolerances=[1e-13]
-field_values=[\
-	md.results.MasstransportSolution.Thickness,\
-	]
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test3007.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3007.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3007.py	(revision 24313)
@@ -7,19 +7,19 @@
 from setflowequation import *
 from solve import *
+from issmgslsolver import issmgslsolver
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.extrude(5,3.)
-md.cluster=generic('name',gethostname(),'np',1)
-md.autodiff.isautodiff=True
-md=solve(md,'Masstransport')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.extrude(5, 3.)
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmgslsolver()
+md = solve(md, 'Masstransport')
 
 #Fields and tolerances to track changes
-field_names     =['Thickness']
-field_tolerances=[1e-13]
-field_values=[\
-	md.results.MasstransportSolution.Thickness,\
-	]
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test3008.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3008.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3008.py	(revision 24313)
@@ -7,21 +7,21 @@
 from setflowequation import *
 from solve import *
+from issmgslsolver import issmgslsolver
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.timestepping.time_step=0
-md.cluster=generic('name',gethostname(),'np',1)
-md.autodiff.isautodiff=True
-md=solve(md,'Thermal')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.timestepping.time_step = 0
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmgslsolver()
+md = solve(md, 'Thermal')
 
 #Fields and tolerances to track changes
-field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-13,1e-5]
-field_values=[\
-	md.results.ThermalSolution.Temperature,\
-	md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-13, 1e-5]
+field_values = [md.results.ThermalSolution.Temperature,
+                md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test3009.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3009.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3009.py	(revision 24313)
@@ -7,25 +7,25 @@
 from setflowequation import *
 from solve import *
+from issmgslsolver import issmgslsolver
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md.transient.isstressbalance=False
-md.transient.ismasstransport=False
-md.transient.issmb=True
-md.transient.isthermal=True
-md.transient.isgroundingline=False
-md.autodiff.isautodiff=True
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.transient.isstressbalance = False
+md.transient.ismasstransport = False
+md.transient.issmb = True
+md.transient.isthermal = True
+md.transient.isgroundingline = False
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmgslsolver()
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test301.py
===================================================================
--- /issm/trunk/test/NightlyRun/test301.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test301.py	(revision 24313)
@@ -9,16 +9,16 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vel','Pressure']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13]
-field_values=[md.results.StressbalanceSolution.Vx,
-							md.results.StressbalanceSolution.Vy,
-							md.results.StressbalanceSolution.Vel,
-							md.results.StressbalanceSolution.Pressure]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test3010.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3010.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3010.py	(revision 24313)
@@ -7,45 +7,45 @@
 from setflowequation import *
 from solve import *
+from issmgslsolver import issmgslsolver
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md.transient.requested_outputs=['IceVolume']
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.transient.requested_outputs = ['IceVolume']
 
-md.autodiff.isautodiff=True
-md=solve(md,'Transient')
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmgslsolver()
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Volume1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Volume2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Volume3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].IceVolume,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].IceVolume,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].IceVolume,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Volume1', 'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Volume2', 'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Volume3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].IceVolume,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].IceVolume,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].IceVolume]
Index: /issm/trunk/test/NightlyRun/test3015.m
===================================================================
--- /issm/trunk/test/NightlyRun/test3015.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3015.m	(revision 24313)
@@ -1,4 +1,4 @@
 %Test Name: SquareShelfConstrainedMasstransp2dAdolcForwardDifference
-%This test runs test3005 with autodiff on, and checks that 
+%This test runs test3015 with autodiff on, and checks that
 %the value of the scalar forward difference match a step-wise differential
 
@@ -45,5 +45,5 @@
 md2=md;
 
-%evaluate derivative by forward and backward stepping 
+%evaluate derivative by forward and backward stepping
 %forward
 md=md2;
@@ -71,5 +71,5 @@
 dVdh_an=(V2-V0)/deltaH;
 
-%evaluate derivative using ADOLC 
+%evaluate derivative using ADOLC
 md=md2;
 md.autodiff.isautodiff=true;
Index: /issm/trunk/test/NightlyRun/test3015.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3015.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3015.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareShelfConstrainedMasstransp2dAdolcForwardDifference
-import numpy as np
 import copy
 from model import *
@@ -12,84 +11,81 @@
 from SetIceShelfBC import *
 from solve import *
+from issmgslsolver import issmgslsolver
 
 
-#This test runs test3005 with autodiff on, and checks that 
+#This test runs test3015 with autodiff on, and checks that
 #the value of the scalar forward difference match a step-wise differential
 
 #First configure
-md=triangle(model(),'../Exp/Square.exp',50000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md.masstransport.requested_outputs=['IceVolume']
-md.verbose=verbose('autodiff',True)
+md = triangle(model(), '../Exp/Square.exp', 50000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.masstransport.requested_outputs = ['IceVolume']
+md.verbose = verbose('autodiff', True)
+md.toolkits.DefaultAnalysis = issmgslsolver()
 
 #setup autodiff parameters
-index=1 #this is the scalar component we are checking against
-md.autodiff.independents=[\
-	independent('name','md.geometry.thickness','type','vertex','nods',md.mesh.numberofvertices,'fos_forward_index',index)
-	]
-
-md.autodiff.dependents=[\
-	dependent('name','IceVolume','type','scalar')\
-	]
-md.autodiff.driver='fos_forward'
+index = 1  #this is the scalar component we are checking against
+md.autodiff.independents = [independent('name', 'md.geometry.thickness', 'type', 'vertex', 'nods', md.mesh.numberofvertices, 'fos_forward_index', index)]
+md.autodiff.dependents = [dependent('name', 'IceVolume', 'type', 'scalar')]
+md.autodiff.driver = 'fos_forward'
 
 #PYTHON: indices start at 0, make sure to offset index
-index=index-1
+index = index - 1
 
 #parameters for the step-wise derivative
-delta=0.001
-h1=md.geometry.thickness[index]
-h0=h1*(1.-delta)
-h2=h1*(1.+delta)
-deltaH=(h2-h0)
+delta = 0.001
+h1 = md.geometry.thickness[index]
+h0 = h1 * (1. - delta)
+h2 = h1 * (1. + delta)
+deltaH = (h2 - h0)
 
 #save model
-md2=copy.deepcopy(md)
+md2 = copy.deepcopy(md)
 
-#evaluate derivative by forward and backward stepping 
+#evaluate derivative by forward and backward stepping
 #forward
-md=copy.deepcopy(md2)
-md.autodiff.isautodiff=False
-md.geometry.thickness[index]=h0
-md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
-md.geometry.surface=md.geometry.base+md.geometry.thickness
-md=SetIceShelfBC(md)
+md = copy.deepcopy(md2)
+md.autodiff.isautodiff = False
+md.geometry.thickness[index] = h0
+md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
+md.geometry.surface = md.geometry.base + md.geometry.thickness
+md = SetIceShelfBC(md)
 
-md=solve(md,'Masstransport')
-V0=md.results.MasstransportSolution.IceVolume
+md = solve(md, 'Masstransport')
+V0 = md.results.MasstransportSolution.IceVolume
 
 #backward
-md=copy.deepcopy(md2)
-md.autodiff.isautodiff=False
-md.geometry.thickness[index]=h2
-md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
-md.geometry.surface=md.geometry.base+md.geometry.thickness
-md=SetIceShelfBC(md)
+md = copy.deepcopy(md2)
+md.autodiff.isautodiff = False
+md.geometry.thickness[index] = h2
+md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
+md.geometry.surface = md.geometry.base + md.geometry.thickness
+md = SetIceShelfBC(md)
 
-md=solve(md,'Masstransport')
-V2=md.results.MasstransportSolution.IceVolume
+md = solve(md, 'Masstransport')
+V2 = md.results.MasstransportSolution.IceVolume
 
 #compute resulting derivative
-dVdh_an=(V2-V0)/deltaH
+dVdh_an = (V2 - V0) / deltaH
 
-#evaluate derivative using ADOLC 
-md=md2
-md.autodiff.isautodiff=True
-md.geometry.thickness[index]=h1
-md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
-md.geometry.surface=md.geometry.base+md.geometry.thickness
-md=SetIceShelfBC(md)
+#evaluate derivative using ADOLC
+md = md2
+md.autodiff.isautodiff = True
+md.geometry.thickness[index] = h1
+md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
+md.geometry.surface = md.geometry.base + md.geometry.thickness
+md = SetIceShelfBC(md)
 
-md=solve(md,'Masstransport')
+md = solve(md, 'Masstransport')
 #retrieve directly
-dVdh_ad=md.results.MasstransportSolution.AutodiffJacobian
+dVdh_ad = md.results.MasstransportSolution.AutodiffJacobian
 
-print "dV/dh: analytical:  %16.16g\n       using adolc:  %16.16g\n" % (dVdh_an,dVdh_ad)
+print("dV / dh: analytical:  %16.16g\n       using adolc:  %16.16g\n" % (dVdh_an, dVdh_ad))
 
 #Fields and tolerances to track changes
-field_names     =['dV/dh']
-field_tolerances=[1e-8]
-field_values=[dVdh_ad]
+field_names = ['dV/dh']
+field_tolerances = [1e-8]
+field_values = [dVdh_ad]
Index: /issm/trunk/test/NightlyRun/test3019.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3019.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3019.py	(revision 24313)
@@ -10,39 +10,40 @@
 from dependent import *
 from solve import *
+from issmgslsolver import issmgslsolver
 
 
 #test reverse scalar vs forward vectorial drivers in ADOLC, using the test3009 setup, equivalent to test109 setup.
-md=triangle(model(),'../Exp/Square.exp',100000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',1)
-#md.toolkits.DefaultAnalysis=issmgslsolver()
+md = triangle(model(), '../Exp/Square.exp', 100000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.toolkits.DefaultAnalysis = issmgslsolver()
 
-md.autodiff.isautodiff=True
-md.verbose.autodiff=True
+md.autodiff.isautodiff = True
+md.verbose.autodiff = True
 
-#first run scalar reverse mode: 
-md.autodiff.independents=[independent('name','md.geometry.thickness','type','vertex','nods',md.mesh.numberofvertices)]
-md.autodiff.dependents=[dependent('name','MaxVel','type','scalar','fos_reverse_index',1)]
-md.autodiff.driver='fos_reverse'
+#first run scalar reverse mode:
+md.autodiff.independents = [independent('name', 'md.geometry.thickness', 'type', 'vertex', 'nods', md.mesh.numberofvertices)]
+md.autodiff.dependents = [dependent('name', 'MaxVel', 'type', 'scalar', 'fos_reverse_index', 1)]
+md.autodiff.driver = 'fos_reverse'
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
-#recover jacobian: 
-jac_reverse=md.results.TransientSolution[0].AutodiffJacobian
+#recover jacobian:
+jac_reverse = md.results.TransientSolution[0].AutodiffJacobian
 
 #now run vectorial forward mode
-md.autodiff.independents=[independent('name','md.geometry.thickness','type','vertex','nods',md.mesh.numberofvertices,'fov_forward_indices',np.arange(1,md.mesh.numberofvertices+1))]
-md.autodiff.dependents=[dependent('name','MaxVel','type','scalar')]
-md.autodiff.driver='fov_forward'
+md.autodiff.independents = [independent('name', 'md.geometry.thickness', 'type', 'vertex', 'nods', md.mesh.numberofvertices, 'fov_forward_indices', np.arange(1, md.mesh.numberofvertices + 1))]
+md.autodiff.dependents = [dependent('name', 'MaxVel', 'type', 'scalar')]
+md.autodiff.driver = 'fov_forward'
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
-#recover jacobian: 
-jac_forward=md.results.TransientSolution[0].AutodiffJacobian
+#recover jacobian:
+jac_forward = md.results.TransientSolution[0].AutodiffJacobian
 
 #Fields and tolerances to track changes
-field_names     =['Jac Forward','Jac Reverse','Jac Forward - Reverse']
-field_tolerances=[1e-8,1e-8,5e-6]
-field_values=[jac_forward,jac_reverse,jac_forward-jac_reverse]
+field_names = ['Jac Forward', 'Jac Reverse', 'Jac Forward - Reverse']
+field_tolerances = [1e-8, 1e-8, 5e-6]
+field_values = [jac_forward, jac_reverse, jac_forward - jac_reverse]
Index: /issm/trunk/test/NightlyRun/test302.py
===================================================================
--- /issm/trunk/test/NightlyRun/test302.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test302.py	(revision 24313)
@@ -9,18 +9,16 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md=setflowequation(md,'SIA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md = setflowequation(md, 'SIA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vel','Pressure']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test3020.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3020.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3020.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareShelfConstrainedTranAdolcReverseVsForward
-import numpy as np
 import copy
 from model import *
@@ -14,89 +13,84 @@
 
 
-#This test runs test3020 with autodiff on, and checks that 
-#the value of the scalar forward difference match a step-wise differential
+#This test runs test3020 with autodiff on, and checks that
+#the value of the scalar forward difference match a step - wise differential
 
 #First configure
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md.transient.requested_outputs=['IceVolume','MaxVel']
-md.verbose=verbose('autodiff',True)
-md.stressbalance.restol=0.000001
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.transient.requested_outputs = ['IceVolume', 'MaxVel']
+md.verbose = verbose('autodiff', True)
+md.stressbalance.restol = 0.000001
 
 #setup autodiff parameters
-index=1 #this is the scalar component we are checking against
-md.autodiff.independents=[\
-	independent('name','md.geometry.thickness','type','vertex','nods',md.mesh.numberofvertices,'fos_forward_index',index)
-	]
-
-md.autodiff.dependents=[\
-	dependent('name','IceVolume','type','scalar'),\
-	dependent('name','MaxVel','type','scalar')\
-	]
-md.autodiff.driver='fos_forward'
+index = 1  #this is the scalar component we are checking against
+md.autodiff.independents = [independent('name', 'md.geometry.thickness', 'type', 'vertex', 'nods', md.mesh.numberofvertices, 'fos_forward_index', index)]
+md.autodiff.dependents = [dependent('name', 'IceVolume', 'type', 'scalar'),
+                          dependent('name', 'MaxVel', 'type', 'scalar')]
+md.autodiff.driver = 'fos_forward'
 
 #PYTHON: indices start at 0, make sure to offset index
-index=index-1
+index = index - 1
 
-#parameters for the step-wise derivative
-delta=0.00001
-h1=md.geometry.thickness[index]
-h0=h1*(1.-delta)
-h2=h1*(1.+delta)
-deltaH=(h2-h0)
+#parameters for the step - wise derivative
+delta = 0.00001
+h1 = md.geometry.thickness[index]
+h0 = h1 * (1. - delta)
+h2 = h1 * (1. + delta)
+deltaH = (h2 - h0)
 
 #save model:
-md2=copy.deepcopy(md)
+md2 = copy.deepcopy(md)
 
-#evaluate derivative by forward and backward stepping 
+#evaluate derivative by forward and backward stepping
 #forward
-md=copy.deepcopy(md2)
-md.autodiff.isautodiff=False
-md.geometry.thickness[index]=h0
-md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
-md.geometry.surface=md.geometry.base+md.geometry.thickness
-md=SetIceShelfBC(md)
+md = copy.deepcopy(md2)
+md.autodiff.isautodiff = False
+md.geometry.thickness[index] = h0
+md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
+md.geometry.surface = md.geometry.base + md.geometry.thickness
+md = SetIceShelfBC(md)
 
-md=solve(md,'Transient')
-V0=md.results.TransientSolution[-1].IceVolume
-MaxV0=md.results.TransientSolution[-1].MaxVel
+md = solve(md, 'Transient')
+V0 = md.results.TransientSolution[-1].IceVolume
+MaxV0 = md.results.TransientSolution[-1].MaxVel
 
 #backward
-md=copy.deepcopy(md2)
-md.autodiff.isautodiff=False
-md.geometry.thickness[index]=h2
-md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
-md.geometry.surface=md.geometry.base+md.geometry.thickness
-md=SetIceShelfBC(md)
+md = copy.deepcopy(md2)
+md.autodiff.isautodiff = False
+md.geometry.thickness[index] = h2
+md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
+md.geometry.surface = md.geometry.base + md.geometry.thickness
+md = SetIceShelfBC(md)
 
-md=solve(md,'Transient')
-V2=md.results.TransientSolution[-1].IceVolume
-MaxV2=md.results.TransientSolution[-1].MaxVel
+md = solve(md, 'Transient')
+V2 = md.results.TransientSolution[-1].IceVolume
+MaxV2 = md.results.TransientSolution[-1].MaxVel
 
 #compute resulting derivative
-dVdh_an=(V2-V0)/deltaH
-dMaxVdh_an=(MaxV2-MaxV0)/deltaH
+dVdh_an = (V2 - V0) / deltaH
+dMaxVdh_an = (MaxV2 - MaxV0) / deltaH
 
-#evaluate derivative using ADOLC 
-md=copy.deepcopy(md2)
-md.autodiff.isautodiff=True
-md.geometry.thickness[index]=h1
-md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
-md.geometry.surface=md.geometry.base+md.geometry.thickness
-md=SetIceShelfBC(md)
+#evaluate derivative using ADOLC
+md = copy.deepcopy(md2)
+md.autodiff.isautodiff = True
+md.geometry.thickness[index] = h1
+md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
+md.geometry.surface = md.geometry.base + md.geometry.thickness
+md = SetIceShelfBC(md)
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 #retrieve directly
-dVdh_ad=md.results.TransientSolution[0].AutodiffJacobian[0]
-dMaxVdh_ad=md.results.TransientSolution[0].AutodiffJacobian[1]
+dVdh_ad = md.results.TransientSolution[0].AutodiffJacobian[0]
+dMaxVdh_ad = md.results.TransientSolution[0].AutodiffJacobian[1]
 
-print "dV/dh: analytical:  %16.16g\n       using adolc:  %16.16g\n" % (dVdh_an,dVdh_ad)
-print "dMaxV/dh: analytical:  %16.16g\n       using adolc:  %16.16g\n" % (dMaxVdh_an,dMaxVdh_ad)
+print("dV / dh: analytical:  %16.16g\n       using adolc:  %16.16g\n" % (dVdh_an, dVdh_ad))
+print("dMaxV / dh: analytical:  %16.16g\n       using adolc:  %16.16g\n" % (dMaxVdh_an, dMaxVdh_ad))
 
 #Fields and tolerances to track changes
-field_names     =['dV/dh-dV/dh0','dMaxV/dh-dMaxV/dh0']
-field_tolerances=[1e-13,1e-13]
-field_values=[dVdh_ad-dVdh_an,dMaxVdh_an-dMaxVdh_ad]
+field_names = ['dV/dh - dV / dh0', 'dMaxV/dh - dMaxV / dh0']
+field_tolerances = [1e-13, 1e-13]
+field_values = [dVdh_ad - dVdh_an, dMaxVdh_an - dMaxVdh_ad]
Index: /issm/trunk/test/NightlyRun/test303.py
===================================================================
--- /issm/trunk/test/NightlyRun/test303.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test303.py	(revision 24313)
@@ -9,18 +9,16 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md=setflowequation(md,'SIA','../Exp/SquareHalfRight.exp','fill','SSA')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md = setflowequation(md, 'SIA', '../Exp/SquareHalfRight.exp', 'fill', 'SSA')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vel','Pressure']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test304.py
===================================================================
--- /issm/trunk/test/NightlyRun/test304.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test304.py	(revision 24313)
@@ -9,20 +9,18 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(3,2.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test305.py
===================================================================
--- /issm/trunk/test/NightlyRun/test305.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test305.py	(revision 24313)
@@ -9,20 +9,18 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(5,2.)
-md=setflowequation(md,'SIA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(5, 2.)
+md = setflowequation(md, 'SIA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test306.py
===================================================================
--- /issm/trunk/test/NightlyRun/test306.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test306.py	(revision 24313)
@@ -9,20 +9,18 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(4,2.)
-md=setflowequation(md,'SIA','../Exp/SquareHalfRight.exp','fill','SSA')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(4, 2.)
+md = setflowequation(md, 'SIA', '../Exp/SquareHalfRight.exp', 'fill', 'SSA')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test307.py
===================================================================
--- /issm/trunk/test/NightlyRun/test307.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test307.py	(revision 24313)
@@ -9,20 +9,18 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-09,1e-09,2e-10,2e-10,1e-10]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-09, 1e-09, 2e-10, 2e-10, 1e-10]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test308.py
===================================================================
--- /issm/trunk/test/NightlyRun/test308.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test308.py	(revision 24313)
@@ -9,20 +9,18 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'FS','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'FS', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-09,1e-09,1e-09,1e-09,1e-09]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-09, 1e-09, 1e-09, 1e-09, 1e-09]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test309.py
===================================================================
--- /issm/trunk/test/NightlyRun/test309.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test309.py	(revision 24313)
@@ -9,15 +9,13 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Masstransport')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Masstransport')
 
 #Fields and tolerances to track changes
-field_names     =['Thickness']
-field_tolerances=[1e-13]
-field_values=[\
-	md.results.MasstransportSolution.Thickness,\
-	]
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test310.py
===================================================================
--- /issm/trunk/test/NightlyRun/test310.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test310.py	(revision 24313)
@@ -10,18 +10,16 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=meshconvert(md)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.masstransport.stabilization=3
-md.masstransport.spcthickness=md.geometry.thickness
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Masstransport')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = meshconvert(md)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.masstransport.stabilization = 3
+md.masstransport.spcthickness = md.geometry.thickness
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Masstransport')
 
 #Fields and tolerances to track changes
-field_names     =['Thickness']
-field_tolerances=[1e-13]
-field_values=[\
-	md.results.MasstransportSolution.Thickness,\
-	]
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test3101.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3101.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3101.py	(revision 24313)
@@ -7,28 +7,28 @@
 from setflowequation import *
 from solve import *
+from issmmumpssolver import issmmumpssolver
 
 
-md=triangle(model(),'../Exp/Square.exp',50000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.stressbalance.requested_outputs=['default','DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy']
+md = triangle(model(), '../Exp/Square.exp', 50000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.stressbalance.requested_outputs = ['default', 'DeviatoricStressxx', 'DeviatoricStressyy', 'DeviatoricStressxy']
 
-md.autodiff.isautodiff=True
-md=solve(md,'Stressbalance')
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmmumpssolver()
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vel','Pressure',\
-	'DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy']
-field_tolerances=[1e-12,1e-12,1e-12,1e-12,\
-	1e-12,1e-12,1e-12]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	md.results.StressbalanceSolution.DeviatoricStressxx,\
-	md.results.StressbalanceSolution.DeviatoricStressyy,\
-	md.results.StressbalanceSolution.DeviatoricStressxy,\
-	]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure',
+               'DeviatoricStressxx', 'DeviatoricStressyy', 'DeviatoricStressxy']
+field_tolerances = [1e-12, 1e-12, 1e-12, 1e-12,
+                    1e-12, 1e-12, 1e-12]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.DeviatoricStressxx,
+                md.results.StressbalanceSolution.DeviatoricStressyy,
+                md.results.StressbalanceSolution.DeviatoricStressxy]
Index: /issm/trunk/test/NightlyRun/test3102.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3102.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3102.py	(revision 24313)
@@ -7,24 +7,23 @@
 from setflowequation import *
 from solve import *
+from issmmumpssolver import issmmumpssolver
 
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmmumpssolver()
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,2.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.autodiff.isautodiff=True
-
-md=solve(md,'Stressbalance')
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test3103.m
===================================================================
--- /issm/trunk/test/NightlyRun/test3103.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3103.m	(revision 24313)
@@ -16,5 +16,5 @@
 	'StressTensorxx','StressTensoryy','StressTensorzz','StressTensorxy','StressTensorxz','StressTensoryz'};
 field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09,...
-	1e-09,1e-09,1e-09,1e-09,1e-09,1e-8};
+	1e-09,1e-09,1e-09,1e-09,1e-09,2e-09};
 field_values={...
 	(md.results.StressbalanceSolution.Vx),...
Index: /issm/trunk/test/NightlyRun/test3103.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3103.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3103.py	(revision 24313)
@@ -7,33 +7,33 @@
 from setflowequation import *
 from solve import *
+from issmmumpssolver import issmmumpssolver
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,2.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.stressbalance.requested_outputs=['default','StressTensorxx','StressTensoryy','StressTensorzz','StressTensorxy','StressTensorxz','StressTensoryz']
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.stressbalance.requested_outputs = ['default', 'StressTensorxx', 'StressTensoryy', 'StressTensorzz', 'StressTensorxy', 'StressTensorxz', 'StressTensoryz']
 
-md.autodiff.isautodiff=True
-md=solve(md,'Stressbalance')
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmmumpssolver()
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure',\
-	'StressTensorxx','StressTensoryy','StressTensorzz','StressTensorxy','StressTensorxz','StressTensoryz']
-field_tolerances=[1e-09,1e-09,1e-09,1e-09,1e-09,\
-	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	md.results.StressbalanceSolution.StressTensorxx,\
-	md.results.StressbalanceSolution.StressTensoryy,\
-	md.results.StressbalanceSolution.StressTensorzz,\
-	md.results.StressbalanceSolution.StressTensorxy,\
-	md.results.StressbalanceSolution.StressTensorxz,\
-	md.results.StressbalanceSolution.StressTensoryz,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure',
+               'StressTensorxx', 'StressTensoryy', 'StressTensorzz', 'StressTensorxy', 'StressTensorxz', 'StressTensoryz']
+field_tolerances = [1e-09, 1e-09, 1e-09, 1e-09, 1e-09,
+                    1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 2e-09]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.StressTensorxx,
+                md.results.StressbalanceSolution.StressTensoryy,
+                md.results.StressbalanceSolution.StressTensorzz,
+                md.results.StressbalanceSolution.StressTensorxy,
+                md.results.StressbalanceSolution.StressTensorxz,
+                md.results.StressbalanceSolution.StressTensoryz]
Index: /issm/trunk/test/NightlyRun/test3104.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3104.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3104.py	(revision 24313)
@@ -7,24 +7,24 @@
 from setflowequation import *
 from solve import *
+from issmmumpssolver import issmmumpssolver
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,2.)
-md=setflowequation(md,'FS','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'FS', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.autodiff.isautodiff=True
-md=solve(md,'Stressbalance')
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmmumpssolver()
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-08,1e-08,2e-07,1e-08,1e-08]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-08, 1e-08, 2e-07, 1e-08, 1e-08]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test3105.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3105.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3105.py	(revision 24313)
@@ -7,19 +7,19 @@
 from setflowequation import *
 from solve import *
+from issmmumpssolver import issmmumpssolver
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.autodiff.isautodiff=True
-md=solve(md,'Masstransport')
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmmumpssolver()
+md = solve(md, 'Masstransport')
 
 #Fields and tolerances to track changes
-field_names     =['Thickness']
-field_tolerances=[1e-13]
-field_values=[\
-	md.results.MasstransportSolution.Thickness,\
-	]
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test3106.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3106.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3106.py	(revision 24313)
@@ -8,22 +8,22 @@
 from setflowequation import *
 from solve import *
+from issmmumpssolver import issmmumpssolver
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=meshconvert(md)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.masstransport.stabilization=3
-md.masstransport.spcthickness=md.geometry.thickness
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = meshconvert(md)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.masstransport.stabilization = 3
+md.masstransport.spcthickness = md.geometry.thickness
 
-md.autodiff.isautodiff=True
-md=solve(md,'Masstransport')
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmmumpssolver()
+md = solve(md, 'Masstransport')
 
 #Fields and tolerances to track changes
-field_names     =['Thickness']
-field_tolerances=[1e-13]
-field_values=[\
-	md.results.MasstransportSolution.Thickness,\
-	]
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test3107.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3107.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3107.py	(revision 24313)
@@ -7,20 +7,20 @@
 from setflowequation import *
 from solve import *
+from issmmumpssolver import issmmumpssolver
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.extrude(5,3.)
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.extrude(5, 3.)
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.autodiff.isautodiff=True
-md=solve(md,'Masstransport')
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmmumpssolver()
+md = solve(md, 'Masstransport')
 
 #Fields and tolerances to track changes
-field_names     =['Thickness']
-field_tolerances=[1e-13]
-field_values=[\
-	md.results.MasstransportSolution.Thickness,\
-	]
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test3108.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3108.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3108.py	(revision 24313)
@@ -7,22 +7,22 @@
 from setflowequation import *
 from solve import *
+from issmmumpssolver import issmmumpssolver
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.timestepping.time_step=0
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.timestepping.time_step = 0
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.autodiff.isautodiff=True
-md=solve(md,'Thermal')
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmmumpssolver()
+md = solve(md, 'Thermal')
 
 #Fields and tolerances to track changes
-field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-13,1e-5]
-field_values=[\
-	md.results.ThermalSolution.Temperature,\
-	md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-13, 1e-5]
+field_values = [md.results.ThermalSolution.Temperature,
+                md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test3109.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3109.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3109.py	(revision 24313)
@@ -7,26 +7,26 @@
 from setflowequation import *
 from solve import *
+from issmmumpssolver import issmmumpssolver
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.transient.isstressbalance=False
-md.transient.ismasstransport=False
-md.transient.issmb=True
-md.transient.isthermal=True
-md.transient.isgroundingline=False
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.isstressbalance = False
+md.transient.ismasstransport = False
+md.transient.issmb = True
+md.transient.isthermal = True
+md.transient.isgroundingline = False
 
-md.autodiff.isautodiff=True
-md=solve(md,'Transient')
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmmumpssolver()
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test311.py
===================================================================
--- /issm/trunk/test/NightlyRun/test311.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test311.py	(revision 24313)
@@ -9,16 +9,14 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.extrude(5,0.5)
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Masstransport')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.extrude(5, 0.5)
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Masstransport')
 
 #Fields and tolerances to track changes
-field_names     =['Thickness']
-field_tolerances=[1e-13]
-field_values=[\
-	md.results.MasstransportSolution.Thickness,\
-	]
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test3110.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3110.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3110.py	(revision 24313)
@@ -9,44 +9,42 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.transient.requested_outputs=['IceVolume']
+md.transient.requested_outputs = ['IceVolume']
 
-md.autodiff.isautodiff=True
-md=solve(md,'Transient')
+md.autodiff.isautodiff = True
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Volume1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Volume2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Volume3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].IceVolume,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].IceVolume,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].IceVolume,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Volume1', 'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Volume2', 'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Volume3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].IceVolume,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].IceVolume,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].IceVolume]
Index: /issm/trunk/test/NightlyRun/test3119.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3119.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3119.py	(revision 24313)
@@ -1,3 +1,2 @@
-import numpy as np
 from model import *
 from socket import gethostname
@@ -9,28 +8,29 @@
 from dependent import *
 from solve import *
+from issmgslsolver import issmgslsolver
 
 
 #test reverse scalar vs forward vectorial drivers in ADOLC, using the test3009 setup, equivalent to test109 setup.
-md=triangle(model(),'../Exp/Square.exp',100000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelfConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 100000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelfConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
 
-md.autodiff.isautodiff=True
-md.verbose.autodiff=True
+md.autodiff.isautodiff = True
+md.toolkits.DefaultAnalysis = issmgslsolver()
 
-#first run scalar reverse mode: 
-md.autodiff.independents=[independent('name','md.geometry.thickness','type','vertex','nods',md.mesh.numberofvertices)]
-md.autodiff.dependents=[dependent('name','MaxVel','type','scalar','fos_reverse_index',1)]
-md.autodiff.driver='fos_reverse'
+#first run scalar reverse mode:
+md.autodiff.independents = [independent('name', 'md.geometry.thickness', 'type', 'vertex', 'nods', md.mesh.numberofvertices)]
+md.autodiff.dependents = [dependent('name', 'MaxVel', 'type', 'scalar', 'fos_reverse_index', 1)]
+md.autodiff.driver = 'fos_reverse'
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
-#recover jacobian: 
-jac_reverse=md.results.TransientSolution[0].AutodiffJacobian
+#recover jacobian:
+jac_reverse = md.results.TransientSolution[0].AutodiffJacobian
 
 #Fields and tolerances to track changes
-field_names     =['Jac Reverse']
-field_tolerances=[1e-13]
-field_values=[jac_reverse]
+field_names = ['Jac Reverse']
+field_tolerances = [1e-13]
+field_values = [jac_reverse]
Index: /issm/trunk/test/NightlyRun/test312.py
===================================================================
--- /issm/trunk/test/NightlyRun/test312.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test312.py	(revision 24313)
@@ -9,18 +9,16 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.timestepping.time_step=0.
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Thermal')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.timestepping.time_step = 0.
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Thermal')
 
 #Fields and tolerances to track changes
-field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-13,1e-8]
-field_values=[\
-	md.results.ThermalSolution.Temperature,\
-	md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-13, 1e-8]
+field_values = [md.results.ThermalSolution.Temperature,
+                md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test313.py
===================================================================
--- /issm/trunk/test/NightlyRun/test313.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test313.py	(revision 24313)
@@ -9,23 +9,21 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.verbose=verbose('convergence',True,'solution',True)
-md.transient.isstressbalance=False
-md.transient.ismasstransport=False
-md.transient.issmb=True
-md.transient.isthermal=True
-md.transient.isgroundingline=False
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.verbose = verbose('convergence', True, 'solution', True)
+md.transient.isstressbalance = False
+md.transient.ismasstransport = False
+md.transient.issmb = True
+md.transient.isthermal = True
+md.transient.isgroundingline = False
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test314.py
===================================================================
--- /issm/trunk/test/NightlyRun/test314.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test314.py	(revision 24313)
@@ -9,48 +9,44 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md=setflowequation(md,'SIA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.transient.requested_outputs=['default','GroundedArea','FloatingArea','IceVolume']
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md = setflowequation(md, 'SIA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'IceVolume']
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =[
-'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1','FloatingArea1',
-'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2','FloatingArea2',
-'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3','FloatingArea3']
-field_tolerances=[
-		1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-		1e-10,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-		1e-10,1.5e-13,1.5e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].GroundedArea,\
-	md.results.TransientSolution[0].FloatingArea,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].GroundedArea,\
-	md.results.TransientSolution[1].FloatingArea,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].GroundedArea,\
-	md.results.TransientSolution[2].FloatingArea,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'GroundedArea1', 'FloatingArea1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'GroundedArea2', 'FloatingArea2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'GroundedArea3', 'FloatingArea3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-10, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-10, 1.5e-13, 1.5e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].GroundedArea,
+                md.results.TransientSolution[0].FloatingArea,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].GroundedArea,
+                md.results.TransientSolution[1].FloatingArea,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].GroundedArea,
+                md.results.TransientSolution[2].FloatingArea]
Index: /issm/trunk/test/NightlyRun/test315.py
===================================================================
--- /issm/trunk/test/NightlyRun/test315.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test315.py	(revision 24313)
@@ -9,49 +9,47 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(5,1.2)
-md=setflowequation(md,'SIA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(5, 1.2)
+md = setflowequation(md, 'SIA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1',\
-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2',\
-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-	1e-10,1e-13,5e-13,5e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-	1e-10,2e-13,5e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vz,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vz,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vz,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].Temperature,\
-	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Temperature3', 'BasalforcingsGroundediceMeltingRate3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-10, 1e-13, 5e-13, 5e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-10, 2e-13, 5e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test316.py
===================================================================
--- /issm/trunk/test/NightlyRun/test316.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test316.py	(revision 24313)
@@ -9,37 +9,35 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-						1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-						2e-13,1e-13,1e-13,2e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    2e-13, 1e-13, 1e-13, 2e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness]
Index: /issm/trunk/test/NightlyRun/test317.py
===================================================================
--- /issm/trunk/test/NightlyRun/test317.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test317.py	(revision 24313)
@@ -9,63 +9,61 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',200000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.basalforcings.groundedice_melting_rate[:]=5.
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.transient.requested_outputs=['default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb']
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 200000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.basalforcings.groundedice_melting_rate[:] = 5.
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'TotalFloatingBmb', 'TotalGroundedBmb']
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1'\
-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2','GroundedArea2','FloatingArea2','TotalFloatingBmb2','TotalGroundedBmb2',\
-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3','GroundedArea3','FloatingArea3','TotalFloatingBmb2','TotalGroundedBmb2']
-field_tolerances=[1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-12,1e-12,1e-12,1e-12,\
-		1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-12,1e-12,1e-12,1e-12,\
-		1e-09,5e-10,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-12,1e-12,1e-12,1e-12]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vz,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[0].GroundedArea,\
-	md.results.TransientSolution[0].FloatingArea,\
-	md.results.TransientSolution[0].TotalFloatingBmb,\
-	md.results.TransientSolution[0].TotalGroundedBmb,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vz,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[1].GroundedArea,\
-	md.results.TransientSolution[1].FloatingArea,\
-	md.results.TransientSolution[1].TotalFloatingBmb,\
-	md.results.TransientSolution[1].TotalGroundedBmb,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vz,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].Temperature,\
-	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[2].GroundedArea,\
-	md.results.TransientSolution[2].FloatingArea,\
-	md.results.TransientSolution[2].TotalFloatingBmb,\
-	md.results.TransientSolution[2].TotalGroundedBmb,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1'
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2', 'GroundedArea2', 'FloatingArea2', 'TotalFloatingBmb2', 'TotalGroundedBmb2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Temperature3', 'BasalforcingsGroundediceMeltingRate3', 'GroundedArea3', 'FloatingArea3', 'TotalFloatingBmb2', 'TotalGroundedBmb2']
+field_tolerances = [1e-09, 1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-12, 1e-12, 1e-12, 1e-12,
+                    1e-09, 1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-12, 1e-12, 1e-12, 1e-12,
+                    1e-09, 5e-10, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-12, 1e-12, 1e-12, 1e-12]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[0].GroundedArea,
+                md.results.TransientSolution[0].FloatingArea,
+                md.results.TransientSolution[0].TotalFloatingBmb,
+                md.results.TransientSolution[0].TotalGroundedBmb,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].GroundedArea,
+                md.results.TransientSolution[1].FloatingArea,
+                md.results.TransientSolution[1].TotalFloatingBmb,
+                md.results.TransientSolution[1].TotalGroundedBmb,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[2].GroundedArea,
+                md.results.TransientSolution[2].FloatingArea,
+                md.results.TransientSolution[2].TotalFloatingBmb,
+                md.results.TransientSolution[2].TotalGroundedBmb]
Index: /issm/trunk/test/NightlyRun/test318.py
===================================================================
--- /issm/trunk/test/NightlyRun/test318.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test318.py	(revision 24313)
@@ -9,23 +9,21 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(4,1.)
-md=setflowequation(md,'SIA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.timestepping.time_step=0
-md=solve(md,'Steadystate')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(4, 1.)
+md = setflowequation(md, 'SIA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.timestepping.time_step = 0
+md = solve(md, 'Steadystate')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-13,1e-13,2.3e-10,1e-10,1e-13,1e-11,1e-6]
-field_values=[\
-	md.results.SteadystateSolution.Vx,\
-	md.results.SteadystateSolution.Vy,\
-	md.results.SteadystateSolution.Vz,\
-	md.results.SteadystateSolution.Vel,\
-	md.results.SteadystateSolution.Pressure,\
-	md.results.SteadystateSolution.Temperature,\
-	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure', 'Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-13, 1e-13, 2.6e-10, 1e-10, 1e-13, 1e-11, 1e-6]
+field_values = [md.results.SteadystateSolution.Vx,
+                md.results.SteadystateSolution.Vy,
+                md.results.SteadystateSolution.Vz,
+                md.results.SteadystateSolution.Vel,
+                md.results.SteadystateSolution.Pressure,
+                md.results.SteadystateSolution.Temperature,
+                md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test319.py
===================================================================
--- /issm/trunk/test/NightlyRun/test319.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test319.py	(revision 24313)
@@ -10,37 +10,36 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',200000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md=setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/Square.exp', 200000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
 
 #control parameters
-md.inversion.iscontrol=1
-md.inversion.control_parameters=['FrictionCoefficient']
-md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
-md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
-md.inversion.nsteps=2
-md.inversion.cost_functions=[103,501]
-md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
-md.inversion.cost_functions_coefficients[:,1]=2.*10**-7
-md.inversion.gradient_scaling=3.*np.ones((md.inversion.nsteps))
-md.inversion.maxiter_per_step=2*np.ones(md.inversion.nsteps)
-md.inversion.step_threshold=0.3*np.ones(md.inversion.nsteps)
-md.inversion.vx_obs=md.initialization.vx
-md.inversion.vy_obs=md.initialization.vy
 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['FrictionCoefficient']
+md.inversion.min_parameters = 1. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 200. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.nsteps = 2
+md.inversion.cost_functions = [103, 501]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
+md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
+md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
+md.inversion.maxiter_per_step = 2 * np.ones(md.inversion.nsteps)
+md.inversion.step_threshold = 0.3 * np.ones(md.inversion.nsteps)
+md.inversion.vx_obs = md.initialization.vx
+md.inversion.vy_obs = md.initialization.vy
+
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy']
-field_tolerances=[1e-12,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.StressbalanceSolution.Gradient1,\
-	md.results.StressbalanceSolution.J,\
-	md.results.StressbalanceSolution.FrictionCoefficient,\
-	md.results.StressbalanceSolution.Pressure,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-]
+field_names = ['Gradient', 'Misfits', 'FrictionCoefficient', 'Pressure', 'Vel', 'Vx', 'Vy']
+field_tolerances = [1e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Gradient1,
+                md.results.StressbalanceSolution.J,
+                md.results.StressbalanceSolution.FrictionCoefficient,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy]
Index: /issm/trunk/test/NightlyRun/test320.py
===================================================================
--- /issm/trunk/test/NightlyRun/test320.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test320.py	(revision 24313)
@@ -10,38 +10,36 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',200000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/Square.exp', 200000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
 
 #control parameters
-md.inversion.iscontrol=1
-md.inversion.control_parameters=['FrictionCoefficient']
-md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
-md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
-md.inversion.nsteps=2
-md.inversion.cost_functions=[103,501]
-md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
-md.inversion.cost_functions_coefficients[:,1]=2.*10**-7
-md.inversion.gradient_scaling=3.*np.ones((md.inversion.nsteps))
-md.inversion.maxiter_per_step=2*np.ones(md.inversion.nsteps)
-md.inversion.step_threshold=0.3*np.ones(md.inversion.nsteps)
-md.inversion.vx_obs=md.initialization.vx
-md.inversion.vy_obs=md.initialization.vy
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['FrictionCoefficient']
+md.inversion.min_parameters = 1. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 200. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.nsteps = 2
+md.inversion.cost_functions = [103, 501]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
+md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
+md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
+md.inversion.maxiter_per_step = 2 * np.ones(md.inversion.nsteps)
+md.inversion.step_threshold = 0.3 * np.ones(md.inversion.nsteps)
+md.inversion.vx_obs = md.initialization.vx
+md.inversion.vy_obs = md.initialization.vy
 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy']
-field_tolerances=[1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12]
-field_values=[\
-	md.results.StressbalanceSolution.Gradient1,\
-	md.results.StressbalanceSolution.J,\
-	md.results.StressbalanceSolution.FrictionCoefficient,\
-	md.results.StressbalanceSolution.Pressure,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-]
+field_names = ['Gradient', 'Misfits', 'FrictionCoefficient', 'Pressure', 'Vel', 'Vx', 'Vy']
+field_tolerances = [1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12]
+field_values = [md.results.StressbalanceSolution.Gradient1,
+                md.results.StressbalanceSolution.J,
+                md.results.StressbalanceSolution.FrictionCoefficient,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy]
Index: /issm/trunk/test/NightlyRun/test321.py
===================================================================
--- /issm/trunk/test/NightlyRun/test321.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test321.py	(revision 24313)
@@ -10,38 +10,36 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',200000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
+md = triangle(model(), '../Exp/Square.exp', 200000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
 
 #control parameters
-md.inversion.iscontrol=1
-md.inversion.control_parameters=['FrictionCoefficient']
-md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
-md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
-md.inversion.nsteps=2
-md.inversion.cost_functions=[102,501]
-md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
-md.inversion.cost_functions_coefficients[:,1]=2*10**-7
-md.inversion.gradient_scaling=3.*np.ones((md.inversion.nsteps))
-md.inversion.maxiter_per_step=2*np.ones(md.inversion.nsteps)
-md.inversion.step_threshold=0.3*np.ones(md.inversion.nsteps)
-md.inversion.vx_obs=md.initialization.vx
-md.inversion.vy_obs=md.initialization.vy
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['FrictionCoefficient']
+md.inversion.min_parameters = 1. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 200. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.nsteps = 2
+md.inversion.cost_functions = [102, 501]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
+md.inversion.cost_functions_coefficients[:, 1] = 2 * 10**-7
+md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
+md.inversion.maxiter_per_step = 2 * np.ones(md.inversion.nsteps)
+md.inversion.step_threshold = 0.3 * np.ones(md.inversion.nsteps)
+md.inversion.vx_obs = md.initialization.vx
+md.inversion.vy_obs = md.initialization.vy
 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy']
-field_tolerances=[1e-08,1e-07,1e-10,1e-10,1e-09,1e-09,1e-09]
-field_values=[\
-	md.results.StressbalanceSolution.Gradient1,\
-	md.results.StressbalanceSolution.J,\
-	md.results.StressbalanceSolution.FrictionCoefficient,\
-	md.results.StressbalanceSolution.Pressure,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-]
+field_names = ['Gradient', 'Misfits', 'FrictionCoefficient', 'Pressure', 'Vel', 'Vx', 'Vy']
+field_tolerances = [1e-08, 1e-07, 1e-10, 1e-10, 1e-09, 1e-09, 1e-09]
+field_values = [md.results.StressbalanceSolution.Gradient1,
+                md.results.StressbalanceSolution.J,
+                md.results.StressbalanceSolution.FrictionCoefficient,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy]
Index: /issm/trunk/test/NightlyRun/test322.m
===================================================================
--- /issm/trunk/test/NightlyRun/test322.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test322.m	(revision 24313)
@@ -24,5 +24,5 @@
 %Fields and tolerances to track changes
 field_names     ={'Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy'};
-field_tolerances={5e-05,1e-08,2e-07,6e-09,7e-08,7e-08,7e-08};
+field_tolerances={5e-05,1e-07,2e-06,8e-08,8e-07,9e-07,8e-07};
 field_values={...
 	(md.results.StressbalanceSolution.Gradient1),...
Index: /issm/trunk/test/NightlyRun/test322.py
===================================================================
--- /issm/trunk/test/NightlyRun/test322.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test322.py	(revision 24313)
@@ -10,38 +10,36 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',200000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'FS','all')
+md = triangle(model(), '../Exp/Square.exp', 200000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'FS', 'all')
 
 #control parameters
-md.inversion.iscontrol=1
-md.inversion.control_parameters=['FrictionCoefficient']
-md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
-md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
-md.inversion.nsteps=2
-md.inversion.cost_functions=[104,501]
-md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
-md.inversion.cost_functions_coefficients[:,1]=2.*10**-7
-md.inversion.gradient_scaling=3.*np.ones((md.inversion.nsteps))
-md.inversion.maxiter_per_step=2*np.ones(md.inversion.nsteps)
-md.inversion.step_threshold=0.3*np.ones(md.inversion.nsteps)
-md.inversion.vx_obs=md.initialization.vx
-md.inversion.vy_obs=md.initialization.vy
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['FrictionCoefficient']
+md.inversion.min_parameters = 1. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 200. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.nsteps = 2
+md.inversion.cost_functions = [104, 501]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
+md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
+md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
+md.inversion.maxiter_per_step = 2 * np.ones(md.inversion.nsteps)
+md.inversion.step_threshold = 0.3 * np.ones(md.inversion.nsteps)
+md.inversion.vx_obs = md.initialization.vx
+md.inversion.vy_obs = md.initialization.vy
 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy']
-field_tolerances=[5e-05,1e-08,2e-07,6e-09,7e-08,7e-08,7e-08]
-field_values=[\
-	md.results.StressbalanceSolution.Gradient1,\
-	md.results.StressbalanceSolution.J,\
-	md.results.StressbalanceSolution.FrictionCoefficient,\
-	md.results.StressbalanceSolution.Pressure,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-]
+field_names = ['Gradient', 'Misfits', 'FrictionCoefficient', 'Pressure', 'Vel', 'Vx', 'Vy']
+field_tolerances = [5e-05, 1e-07, 2e-06, 8e-08, 8e-07, 9e-07, 8e-07]
+field_values = [md.results.StressbalanceSolution.Gradient1,
+                md.results.StressbalanceSolution.J,
+                md.results.StressbalanceSolution.FrictionCoefficient,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy]
Index: /issm/trunk/test/NightlyRun/test323.py
===================================================================
--- /issm/trunk/test/NightlyRun/test323.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test323.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetConstrainedTranCflSSA2d
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,38 +9,36 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.timestepping = timesteppingadaptive(md.timestepping);
-md.timestepping.time_step_max = 10000.;
-md.timestepping.final_time=1120.
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.timestepping = timesteppingadaptive(md.timestepping)
+md.timestepping.time_step_max = 10000.
+md.timestepping.final_time = 1120.
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-12,1e-12]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-12, 1e-12]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness]
Index: /issm/trunk/test/NightlyRun/test324.py
===================================================================
--- /issm/trunk/test/NightlyRun/test324.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test324.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetConstrainedTranCflSIA3d
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,52 +9,50 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(5,1.2)
-md=setflowequation(md,'SIA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.timestepping = timesteppingadaptive(md.timestepping);
-md.timestepping.time_step_max = 10000.;
-md.timestepping.final_time=16000.
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(5, 1.2)
+md = setflowequation(md, 'SIA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.timestepping = timesteppingadaptive(md.timestepping)
+md.timestepping.time_step_max = 10000.
+md.timestepping.final_time = 16000.
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1',\
-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2',\
-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
-field_tolerances=[1e-13,  1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-	5e-11,1e-13,5e-13,5e-11,1e-13,1e-13,5e-13,1e-13,1e-13,1e-13,\
-	1e-10,  1e-12,1e-12,1e-12,1e-13,1e-13,1e-12,1e-12,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vz,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vz,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vz,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].Temperature,\
-	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Temperature3', 'BasalforcingsGroundediceMeltingRate3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    5e-11, 1e-13, 5e-13, 5e-11, 1e-13, 1e-13, 5e-13, 1e-13, 1e-13, 1e-13,
+                    1e-10, 1e-12, 1e-12, 1e-12, 1e-13, 1e-13, 1e-12, 1e-12, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test325.py
===================================================================
--- /issm/trunk/test/NightlyRun/test325.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test325.py	(revision 24313)
@@ -10,24 +10,22 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.timestepping.time_step=0.
-md.initialization.waterfraction=np.zeros((md.mesh.numberofvertices))
-md.initialization.watercolumn=np.zeros((md.mesh.numberofvertices))
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.timestepping.time_step = 0.
+md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices))
+md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices))
 md.thermal.isenthalpy = 1
 md.thermal.isdynamicbasalspc = 1
 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Thermal')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Thermal')
 
 #Fields and tolerances to track changes
-field_names     =['Enthalpy','Waterfraction','Temperature']
-field_tolerances=[1e-13,5e-13,1e-13]
-field_values=[\
-	md.results.ThermalSolution.Enthalpy,\
-	md.results.ThermalSolution.Waterfraction,\
-	md.results.ThermalSolution.Temperature,\
-	]
+field_names = ['Enthalpy', 'Waterfraction', 'Temperature']
+field_tolerances = [1e-13, 5e-13, 1e-13]
+field_values = [md.results.ThermalSolution.Enthalpy,
+                md.results.ThermalSolution.Waterfraction,
+                md.results.ThermalSolution.Temperature]
Index: /issm/trunk/test/NightlyRun/test326.py
===================================================================
--- /issm/trunk/test/NightlyRun/test326.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test326.py	(revision 24313)
@@ -10,35 +10,33 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.initialization.waterfraction=np.zeros((md.mesh.numberofvertices))
-md.initialization.watercolumn=np.zeros((md.mesh.numberofvertices))
-md.transient.isstressbalance=False
-md.transient.ismasstransport=False
-md.transient.issmb=True
-md.transient.isthermal=True
-md.transient.isgroundingline=False
-md.thermal.isenthalpy=1
-md.thermal.isdynamicbasalspc=1
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices))
+md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices))
+md.transient.isstressbalance = False
+md.transient.ismasstransport = False
+md.transient.issmb = True
+md.transient.isthermal = True
+md.transient.isgroundingline = False
+md.thermal.isenthalpy = 1
+md.thermal.isdynamicbasalspc = 1
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Enthalpy1','Waterfraction1','Temperature1',\
-	'Enthalpy2','Waterfraction2','Temperature2',\
-	'Enthalpy3','Waterfraction3','Temperature3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Enthalpy,\
-	md.results.TransientSolution[0].Waterfraction,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[1].Enthalpy,\
-	md.results.TransientSolution[1].Waterfraction,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[2].Enthalpy,\
-	md.results.TransientSolution[2].Waterfraction,\
-	md.results.TransientSolution[2].Temperature,\
-	]
+field_names = ['Enthalpy1', 'Waterfraction1', 'Temperature1',
+               'Enthalpy2', 'Waterfraction2', 'Temperature2',
+               'Enthalpy3', 'Waterfraction3', 'Temperature3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Enthalpy,
+                md.results.TransientSolution[0].Waterfraction,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[1].Enthalpy,
+                md.results.TransientSolution[1].Waterfraction,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[2].Enthalpy,
+                md.results.TransientSolution[2].Waterfraction,
+                md.results.TransientSolution[2].Temperature]
Index: /issm/trunk/test/NightlyRun/test327.py
===================================================================
--- /issm/trunk/test/NightlyRun/test327.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test327.py	(revision 24313)
@@ -10,59 +10,57 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',200000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.initialization.waterfraction=np.zeros((md.mesh.numberofvertices))
-md.initialization.watercolumn=np.zeros((md.mesh.numberofvertices))
-md.initialization.temperature[:]=272.
-md.thermal.spctemperature[np.nonzero(md.mesh.vertexonsurface)[0]]=272.
-md.thermal.isenthalpy=1
-md.thermal.isdynamicbasalspc=1
-md.basalforcings.geothermalflux[:]=5.
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 200000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices))
+md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices))
+md.initialization.temperature[:] = 272.
+md.thermal.spctemperature[np.nonzero(md.mesh.vertexonsurface)[0]] = 272.
+md.thermal.isenthalpy = 1
+md.thermal.isdynamicbasalspc = 1
+md.basalforcings.geothermalflux[:] = 5.
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','Enthalpy1','Waterfraction1',\
-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','Enthalpy2','Waterfraction2',\
-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','Enthalpy3','Waterfraction3']
-field_tolerances=[1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
-	1e-09,1e-09,1e-10,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
-	1e-09,5e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-4,1e-10]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vz,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].Enthalpy,\
-	md.results.TransientSolution[0].Waterfraction,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vz,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[1].Enthalpy,\
-	md.results.TransientSolution[1].Waterfraction,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vz,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].Temperature,\
-	md.results.TransientSolution[2].Enthalpy,\
-	md.results.TransientSolution[2].Waterfraction,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'Enthalpy1', 'Waterfraction1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'Enthalpy2', 'Waterfraction2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Temperature3', 'Enthalpy3', 'Waterfraction3']
+field_tolerances = [1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 5e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-4, 1e-10]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].Enthalpy,
+                md.results.TransientSolution[0].Waterfraction,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].Enthalpy,
+                md.results.TransientSolution[1].Waterfraction,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].Enthalpy,
+                md.results.TransientSolution[2].Waterfraction]
Index: /issm/trunk/test/NightlyRun/test328.py
===================================================================
--- /issm/trunk/test/NightlyRun/test328.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test328.py	(revision 24313)
@@ -9,56 +9,56 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md=setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
 md.smb = SMBgradients()
-md.smb.b_pos=-100. + 0.00005*md.mesh.x - 0.0001*md.mesh.y
-md.smb.b_neg=250. + 0.000051*md.mesh.x - 0.00011*md.mesh.y
-md.transient.requested_outputs=['default','TotalSmb']
-md.smb.href=copy.deepcopy(md.geometry.surface)
-md.smb.smbref= 1000. - 0.001*md.mesh.x - 0.005*md.mesh.y
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md.smb.b_pos = -100. + 0.00005 * md.mesh.x - 0.0001 * md.mesh.y
+md.smb.b_neg = 250. + 0.000051 * md.mesh.x - 0.00011 * md.mesh.y
+md.transient.requested_outputs = ['default', 'TotalSmb']
+md.smb.href = copy.deepcopy(md.geometry.surface)
+md.smb.smbref = 1000. - 0.001 * md.mesh.x - 0.005 * md.mesh.y
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1',
-									'Bed1','Surface1','Thickness1',
-									'SMB1','TotalSmb1',
-									'Vx2','Vy2','Vel2','Bed2',
-									'Surface2','Thickness2',
-									'SMB2','TotalSmb2','Vx3','Vy3',
-									'Vel3','Bed3','Surface3',
-									'Thickness3','SMB3','TotalSmb3']
-field_tolerances=[1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].SmbMassBalance,
-							md.results.TransientSolution[0].TotalSmb,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].TotalSmb,
-							md.results.TransientSolution[1].SmbMassBalance,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].SmbMassBalance,
-							md.results.TransientSolution[2].TotalSmb]
+field_names = ['Vx1', 'Vy1', 'Vel1',
+               'Bed1', 'Surface1', 'Thickness1',
+               'SMB1', 'TotalSmb1',
+               'Vx2', 'Vy2', 'Vel2', 'Bed2',
+               'Surface2', 'Thickness2',
+               'SMB2', 'TotalSmb2', 'Vx3', 'Vy3',
+               'Vel3', 'Bed3', 'Surface3',
+               'Thickness3', 'SMB3', 'TotalSmb3']
+field_tolerances = [1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[0].TotalSmb,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].TotalSmb,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].SmbMassBalance,
+                md.results.TransientSolution[2].TotalSmb]
Index: /issm/trunk/test/NightlyRun/test329.py
===================================================================
--- /issm/trunk/test/NightlyRun/test329.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test329.py	(revision 24313)
@@ -9,65 +9,65 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(3,1)
-md=setflowequation(md,'HO','all')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(3, 1)
+md = setflowequation(md, 'HO', 'all')
 md.smb = SMBgradients()
-md.smb.b_pos=-100. + 0.00005*md.mesh.x - 0.0001*md.mesh.y
-md.smb.b_neg=250. + 0.000051*md.mesh.x - 0.00011*md.mesh.y
-md.smb.href=copy.deepcopy(md.geometry.surface)
-md.smb.smbref= 1000. - 0.001*md.mesh.x - 0.005*md.mesh.y
-md.transient.requested_outputs=['default','TotalSmb']
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md.smb.b_pos = -100. + 0.00005 * md.mesh.x - 0.0001 * md.mesh.y
+md.smb.b_neg = 250. + 0.000051 * md.mesh.x - 0.00011 * md.mesh.y
+md.smb.href = copy.deepcopy(md.geometry.surface)
+md.smb.smbref = 1000. - 0.001 * md.mesh.x - 0.005 * md.mesh.y
+md.transient.requested_outputs = ['default', 'TotalSmb']
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1',
-									'Bed1','Surface1','Thickness1',
-									'Temperature1','SMB1','TotalSmb1',
-									'Vx2','Vy2','Vz2','Vel2',
-									'Bed2','Surface2','Thickness2',
-									'Temperature2','SMB2','TotalSmb2',
-									'Vx3','Vy3','Vz3','Vel3',
-									'Bed3','Surface3','Thickness3',
-									'Temperature3','SMB3','TotalSmb3']
-field_tolerances=[1e-09,1e-09,1e-09,1e-09,
-									1e-10,1e-10,1e-10,
-									1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-10,1e-09,
-									1e-10,1e-10,1e-10,
-									1e-10,1e-10,1e-10,
-									1e-09,5e-09,1e-09,1e-09,
-									1e-10,1e-10,1e-10,
-									1e-10,1e-10,1e-10]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vz,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].Temperature,
-							md.results.TransientSolution[0].SmbMassBalance,
-							md.results.TransientSolution[0].TotalSmb,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vz,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].Temperature,
-							md.results.TransientSolution[1].SmbMassBalance,
-							md.results.TransientSolution[1].TotalSmb,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vz,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].Temperature,
-							md.results.TransientSolution[2].SmbMassBalance,
-							md.results.TransientSolution[2].TotalSmb]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1',
+               'Bed1', 'Surface1', 'Thickness1',
+               'Temperature1', 'SMB1', 'TotalSmb1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2',
+               'Bed2', 'Surface2', 'Thickness2',
+               'Temperature2', 'SMB2', 'TotalSmb2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3',
+               'Bed3', 'Surface3', 'Thickness3',
+               'Temperature3', 'SMB3', 'TotalSmb3']
+field_tolerances = [1e-09, 1e-09, 1e-09, 1e-09,
+                    1e-10, 1e-10, 1e-10,
+                    1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-09,
+                    1e-10, 1e-10, 1e-10,
+                    1e-10, 1e-10, 1e-10,
+                    1e-09, 5e-09, 1e-09, 1e-09,
+                    1e-10, 1e-10, 1e-10,
+                    1e-10, 1e-10, 1e-10]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[0].TotalSmb,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[1].TotalSmb,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].SmbMassBalance,
+                md.results.TransientSolution[2].TotalSmb]
Index: /issm/trunk/test/NightlyRun/test330.m
===================================================================
--- /issm/trunk/test/NightlyRun/test330.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test330.m	(revision 24313)
@@ -42,7 +42,7 @@
 %Wang 2009 Fig 6b (jouranl of Hydrology)
 field_names={'SedimentWaterHead1',...
-						 'SedimentWaterHead2'};
+	     'SedimentWaterHead2'};
 field_tolerances={1e-13,...
-									1e-13};
-field_values={md.results.TransientSolution(11).SedimentHeadHydrostep,...
-							md.results.TransientSolution(31).SedimentHeadHydrostep};
+		  1e-13};
+field_values={md.results.TransientSolution(11).SedimentHead,...
+	      md.results.TransientSolution(31).SedimentHead};
Index: /issm/trunk/test/NightlyRun/test330.py
===================================================================
--- /issm/trunk/test/NightlyRun/test330.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test330.py	(revision 24313)
@@ -1,5 +1,4 @@
 #Test Name:UnConfinedHydroDC
 import numpy as np
-import inspect
 from model import *
 from setmask import *
@@ -12,48 +11,45 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Strip.exp',10000.)
-md=setmask(md,'','')
+md = triangle(model(), '../Exp/Strip.exp', 10000.)
+md = setmask(md, '', '')
 #reduced slab (20m long)
-md.mesh.x=md.mesh.x/5.0e3
-md.mesh.y=md.mesh.y/5.0e3
-md=parameterize(md,'../Par/IceCube.py')
-md.transient=transient.setallnullparameters(md.transient)
-md.transient.ishydrology=True
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md.hydrology=hydrologydc()
-md.hydrology=md.hydrology.initialize(md)
+md.mesh.x = md.mesh.x / 5.0e3
+md.mesh.y = md.mesh.y / 5.0e3
+md = parameterize(md, '../Par/IceCube.py')
+md.transient = transient.setallnullparameters(md.transient)
+md.transient.ishydrology = True
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.hydrology = hydrologydc()
+md.hydrology = md.hydrology.initialize(md)
 
 #Hydro Model Parameters
-md.hydrology.isefficientlayer=0
-md.hydrology.sedimentlimit_flag=0
-md.hydrology.mask_thawed_node=np.ones((md.mesh.numberofvertices))
-md.hydrology.rel_tol=1.0e-6
-md.hydrology.penalty_lock=0
-md.hydrology.max_iter=200
-md.hydrology.transfer_flag=0
-md.hydrology.unconfined_flag=1
-md.hydrology.sediment_porosity=0.1
+md.hydrology.isefficientlayer = 0
+md.hydrology.sedimentlimit_flag = 0
+md.hydrology.mask_thawed_node = np.ones((md.mesh.numberofvertices))
+md.hydrology.rel_tol = 1.0e-6
+md.hydrology.penalty_lock = 0
+md.hydrology.max_iter = 200
+md.hydrology.transfer_flag = 0
+md.hydrology.unconfined_flag = 1
+md.hydrology.sediment_porosity = 0.1
 #Sediment
-md.hydrology.sediment_thickness=10.0
-md.hydrology.sediment_transmitivity=(1.0e-3*md.hydrology.sediment_thickness)*np.ones((md.mesh.numberofvertices))
+md.hydrology.sediment_thickness = 10.0
+md.hydrology.sediment_transmitivity = (1.0e-3 * md.hydrology.sediment_thickness) * np.ones((md.mesh.numberofvertices))
 #init
-md.initialization.sediment_head=-5.0*np.ones((md.mesh.numberofvertices))
+md.initialization.sediment_head = -5.0 * np.ones((md.mesh.numberofvertices))
 #BC
-md.hydrology.spcsediment_head=np.nan*np.ones((md.mesh.numberofvertices))
-md.hydrology.spcsediment_head[np.where(md.mesh.x==0)]=0.5
+md.hydrology.spcsediment_head = np.nan * np.ones((md.mesh.numberofvertices))
+md.hydrology.spcsediment_head[np.where(md.mesh.x == 0)] = 0.5
 
-md.timestepping.time_step=5/md.constants.yts #5s steppin
-md.settings.output_frequency=2
-md.timestepping.final_time=300/md.constants.yts #500s run
+md.timestepping.time_step = 5 / md.constants.yts  #5s steppin
+md.settings.output_frequency = 2
+md.timestepping.final_time = 300 / md.constants.yts  #500s run
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #fields to track, results can also be found in
 #Wang 2009 Fig 6b (jouranl of Hydrology)
-field_names=['SedimentWaterHead1',
-						 'SedimentWaterHead2']
-field_tolerances=[1e-13,
-									1e-13]
-field_values=[md.results.TransientSolution[10].SedimentHeadHydrostep,
-							md.results.TransientSolution[30].SedimentHeadHydrostep]
+field_names = ['SedimentWaterHead1', 'SedimentWaterHead2']
+field_tolerances = [1e-13, 1e-13]
+field_values = [md.results.TransientSolution[10].SedimentHead, md.results.TransientSolution[30].SedimentHead]
Index: /issm/trunk/test/NightlyRun/test3300.py
===================================================================
--- /issm/trunk/test/NightlyRun/test3300.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test3300.py	(revision 24313)
@@ -12,66 +12,66 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',100000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.transient=transient.setallnullparameters(md.transient)
-md.transient.ishydrology=True
-md.transient.issmb=True
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md.hydrology=hydrologydc()
-md.hydrology=md.hydrology.initialize(md)
+md = triangle(model(), '../Exp/Square.exp', 100000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.transient = transient.setallnullparameters(md.transient)
+md.transient.ishydrology = True
+md.transient.issmb = True
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.hydrology = hydrologydc()
+md.hydrology = md.hydrology.initialize(md)
 
-md.hydrology.isefficientlayer=1
-md.hydrology.sedimentlimit_flag=1
-md.hydrology.sedimentlimit=400.0
-md.hydrology.mask_thawed_node=np.ones((md.mesh.numberofvertices))
-md.hydrology.sediment_thickness=20.0
-md.initialization.sediment_head=np.zeros((md.mesh.numberofvertices))
-md.hydrology.spcsediment_head=np.nan*np.ones((md.mesh.numberofvertices))
-md.basalforcings.groundedice_melting_rate = 2.0*np.ones((md.mesh.numberofvertices))
-md.hydrology.sediment_transmitivity=1.5e-4*np.ones((md.mesh.numberofvertices))
+md.hydrology.isefficientlayer = 1
+md.hydrology.sedimentlimit_flag = 1
+md.hydrology.sedimentlimit = 400.0
+md.hydrology.mask_thawed_node = np.ones((md.mesh.numberofvertices))
+md.hydrology.sediment_thickness = 20.0
+md.initialization.sediment_head = np.zeros((md.mesh.numberofvertices))
+md.hydrology.spcsediment_head = np.nan * np.ones((md.mesh.numberofvertices))
+md.basalforcings.groundedice_melting_rate = 2.0 * np.ones((md.mesh.numberofvertices))
+md.hydrology.sediment_transmitivity = 1.5e-4 * np.ones((md.mesh.numberofvertices))
 
-md.initialization.epl_head=np.zeros((md.mesh.numberofvertices))
-md.initialization.epl_thickness=np.ones((md.mesh.numberofvertices))
-md.hydrology.spcepl_head=np.nan*np.ones((md.mesh.numberofvertices))
-md.hydrology.mask_eplactive_node=np.zeros((md.mesh.numberofvertices))
+md.initialization.epl_head = np.zeros((md.mesh.numberofvertices))
+md.initialization.epl_thickness = np.ones((md.mesh.numberofvertices))
+md.hydrology.spcepl_head = np.nan * np.ones((md.mesh.numberofvertices))
+md.hydrology.mask_eplactive_node = np.zeros((md.mesh.numberofvertices))
 
-md.hydrology.epl_conductivity=1.5e-2
-md.hydrology.epl_initial_thickness=1.0
-md.hydrology.epl_colapse_thickness=1.0e-6
-md.hydrology.epl_thick_comp=1
-md.hydrology.epl_max_thickness=5.0
+md.hydrology.epl_conductivity = 1.5e-2
+md.hydrology.epl_initial_thickness = 1.0
+md.hydrology.epl_colapse_thickness = 1.0e-6
+md.hydrology.epl_thick_comp = 1
+md.hydrology.epl_max_thickness = 5.0
 
-md.hydrology.transfer_flag=1.0
-md.hydrology.leakage_factor=3.9e-13
+md.hydrology.transfer_flag = 1.0
+md.hydrology.leakage_factor = 3.9e-13
 
-times=np.arange(0,8.001,0.002)
-md.basalforcings.groundedice_melting_rate=np.zeros((md.mesh.numberofvertices+1,len(times)))
+times = np.arange(0, 8.001, 0.002)
+md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices + 1, len(times)))
 
-md.basalforcings.groundedice_melting_rate[:,np.where(times<=6.0)]=-0.2
-md.basalforcings.groundedice_melting_rate[:,np.where(times<=1.0)]=1.0
-md.basalforcings.groundedice_melting_rate[-1,:]=times
+md.basalforcings.groundedice_melting_rate[:, np.where(times <= 6.0)] = -0.2
+md.basalforcings.groundedice_melting_rate[:, np.where(times <= 1.0)] = 1.0
+md.basalforcings.groundedice_melting_rate[-1, :] = times
 
-md.timestepping.time_step=0.002
-md.timestepping.final_time=8.0
+md.timestepping.time_step = 0.002
+md.timestepping.final_time = 8.0
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
-# sedvol=np.zeros(4000)
-# eplvol=np.zeros(4000)
-# totvol=np.zeros(4001)
-# time=np.arange(0.002,8.001,0.002)
-# store=md.constants.g*md.hydrology.sediment_porosity*md.materials.rho_freshwater*((md.hydrology.sediment_compressibility/md.hydrology.sediment_porosity)+md.hydrology.water_compressibility)
-# sedstore=20.0*store
-# for i in range(0,4000):
-# 	sedvol[i]=np.mean(md.results.TransientSolution[i].SedimentHead)*sedstore
-# 	eplvol[i]=np.mean(md.results.TransientSolution[i].EplHead)*store*np.mean(md.results.TransientSolution[i].HydrologydcEplThicknessHydrostep)
-# 	totvol[i+1]=totvol[i]+md.basalforcings.groundedice_melting_rate[0,i]*0.002
+# sedvol = np.zeros(4000)
+# eplvol = np.zeros(4000)
+# totvol = np.zeros(4001)
+# time = np.arange(0.002, 8.001, 0.002)
+# store = md.constants.g * md.hydrology.sediment_porosity * md.materials.rho_freshwater * ((md.hydrology.sediment_compressibility / md.hydrology.sediment_porosity) + md.hydrology.water_compressibility)
+# sedstore = 20.0 * store
+# for i in range(0, 4000):
+#       sedvol[i]=np.mean(md.results.TransientSolution[i].SedimentHead)*sedstore
+#       eplvol[i]=np.mean(md.results.TransientSolution[i].EplHead)*store*np.mean(md.results.TransientSolution[i].HydrologydcEplThicknessSubstep)
+#       totvol[i+1]=totvol[i]+md.basalforcings.groundedice_melting_rate[0, i]*0.002
 
-field_names     =['SedimentWaterHead5','EplWaterHead5','SedimentWaterHead40','EplWaterHead40']
-field_tolerances=[1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
-field_values=[md.results.TransientSolution[5].SedimentHeadHydrostep,
-							md.results.TransientSolution[5].EplHeadHydrostep,
-							md.results.TransientSolution[40].SedimentHeadHydrostep,
-							md.results.TransientSolution[40].EplHeadHydrostep]
+field_names = ['SedimentWaterHead5', 'EplWaterHead5', 'SedimentWaterHead40', 'EplWaterHead40']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[5].SedimentHeadSubstep,
+                md.results.TransientSolution[5].EplHeadSubstep,
+                md.results.TransientSolution[40].SedimentHeadSubstep,
+                md.results.TransientSolution[40].EplHeadSubstep]
Index: /issm/trunk/test/NightlyRun/test331.m
===================================================================
--- /issm/trunk/test/NightlyRun/test331.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test331.m	(revision 24313)
@@ -0,0 +1,29 @@
+%Test Name: SquareSheetConstrainedAnisotropicSUPG
+md=triangle(model(),'../Exp/Square.exp',180000.);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/SquareSheetConstrained.par');
+md=extrude(md,3,1.);
+md=setflowequation(md,'SSA','all');
+md.timestepping.time_step=0.;
+md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+md.initialization.watercolumn=zeros(md.mesh.numberofvertices,1);
+md.thermal.isenthalpy=0;
+md.thermal.isdynamicbasalspc=0;
+md.thermal.stabilization=3;
+
+md.cluster=generic('name',oshostname(),'np',3);
+
+field_names={};
+field_tolerances={};
+field_values={};
+
+for i=[0 1]
+md.thermal.isenthalpy=i;
+	disp(' ');
+	disp(['====== Testing Thermal model with anisotropic SUPG and isenthalpy=',num2str(i),' =====']);
+        md=solve(md,'Thermal');
+        %Fields and tolerances to track changes
+        field_names     ={field_names{:},['Temperature' i]};
+        field_tolerances={field_tolerances{:},1e-13};
+        field_values={field_values{:},(md.results.ThermalSolution.Temperature)};
+end
Index: /issm/trunk/test/NightlyRun/test332.m
===================================================================
--- /issm/trunk/test/NightlyRun/test332.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test332.m	(revision 24313)
@@ -30,3 +30,3 @@
 field_names     ={'SedimentWaterHead','SedimentHeadResidual'};
 field_tolerances={1e-13, 3e-10};
-field_values={md.results.HydrologySolution.SedimentHeadHydrostep,md.results.HydrologySolution.SedimentHeadResidual};
+field_values={md.results.HydrologySolution.SedimentHead,md.results.HydrologySolution.SedimentHeadResidual};
Index: /issm/trunk/test/NightlyRun/test332.py
===================================================================
--- /issm/trunk/test/NightlyRun/test332.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test332.py	(revision 24313)
@@ -13,36 +13,36 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',100000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/IceCube.py')
+md = triangle(model(), '../Exp/Square.exp', 100000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/IceCube.py')
 
-md.transient=transient.setallnullparameters(md.transient)
-md.transient.ishydrology=True
+md.transient = transient.setallnullparameters(md.transient)
+md.transient.ishydrology = True
 
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md.hydrology=hydrologydc()
-md.hydrology=md.hydrology.initialize(md)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.hydrology = hydrologydc()
+md.hydrology = md.hydrology.initialize(md)
 
-md.hydrology.isefficientlayer=0
-md.hydrology.mask_thawed_node=np.ones((md.mesh.numberofvertices))
-md.hydrology.sedimentlimit_flag=1
-md.hydrology.sedimentlimit=8000.0
-md.initialization.sediment_head=np.zeros((md.mesh.numberofvertices))
-md.hydrology.spcsediment_head=np.nan*np.ones((md.mesh.numberofvertices))
-pos=np.nonzero(md.mesh.y==0.)[0]
-md.hydrology.spcsediment_head[pos]=0.0
-md.basalforcings.groundedice_melting_rate = 2.0*np.ones((md.mesh.numberofvertices))
-md.basalforcings.floatingice_melting_rate = 0.0*np.ones((md.mesh.numberofvertices))
-md.hydrology.sediment_transmitivity= 3.0*np.ones((md.mesh.numberofvertices))
-md.timestepping.time_step=0
-md.timestepping.final_time=1.0
-md=solve(md,'Hydrology')
+md.hydrology.isefficientlayer = 0
+md.hydrology.mask_thawed_node = np.ones((md.mesh.numberofvertices))
+md.hydrology.sedimentlimit_flag = 1
+md.hydrology.sedimentlimit = 8000.0
+md.initialization.sediment_head = np.zeros((md.mesh.numberofvertices))
+md.hydrology.spcsediment_head = np.nan * np.ones((md.mesh.numberofvertices))
+pos = np.nonzero(md.mesh.y == 0.)[0]
+md.hydrology.spcsediment_head[pos] = 0.0
+md.basalforcings.groundedice_melting_rate = 2.0 * np.ones((md.mesh.numberofvertices))
+md.basalforcings.floatingice_melting_rate = 0.0 * np.ones((md.mesh.numberofvertices))
+md.hydrology.sediment_transmitivity = 3.0 * np.ones((md.mesh.numberofvertices))
+md.timestepping.time_step = 0
+md.timestepping.final_time = 1.0
+md = solve(md, 'Hydrology')
 
 #Fields and tolerances to track changes
 #you can also compare with an analitic solution, but it is exact
 #only if no limits are applied
-#analitic=(md.mesh.y**2-2*md.mesh.y*1.0e6)*(-2.0/(2*md.constants.yts*md.hydrology.sediment_transmitivity))
-field_names     =['SedimentWaterHead','SedimentHeadResidual']
-field_tolerances=[1e-13, 3e-10]
-field_values=[md.results.HydrologySolution.SedimentHeadHydrostep,md.results.HydrologySolution.SedimentHeadResidual]
+#analitic=(md.mesh.y**2 - 2 * md.mesh.y * 1.0e6) * (-2.0 / (2 * md.constants.yts * md.hydrology.sediment_transmitivity))
+field_names = ['SedimentWaterHead', 'SedimentHeadResidual']
+field_tolerances = [1e-13, 3e-10]
+field_values = [md.results.HydrologySolution.SedimentHead, md.results.HydrologySolution.SedimentHeadResidual]
Index: /issm/trunk/test/NightlyRun/test333.m
===================================================================
--- /issm/trunk/test/NightlyRun/test333.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test333.m	(revision 24313)
@@ -13,4 +13,5 @@
 md.hydrology.sedimentlimit_flag=1;
 md.hydrology.sedimentlimit=800.0;
+md.hydrology.transfer_flag = 0;
 md.initialization.sediment_head=0.0*ones(md.mesh.numberofvertices,1);
 md.hydrology.spcsediment_head=NaN*ones(md.mesh.numberofvertices,1);
@@ -54,22 +55,28 @@
                   'SedimentWaterHead5','EplWaterHead5','SedimentHeadResidual5',...
                   'SedimentWaterHead9','EplWaterHead9','SedimentHeadResidual9',...
-                  'EplWaterHead10'};
+                  'EplWaterHead10', 'EplWaterHeadSubstep10', 'SedimentWaterHead10',...
+		  'SedimentWaterHeadSubstep10'};
 field_tolerances={...
-	1e-13, 1e-13, 1e-13,...
-	1e-13, 1e-13, 1e-13,...
-	1e-13, 5e-12, 1e-11,...
-	1e-13, 5e-12, 1e-11,...
-  1e-13};
-field_values={mdfine.results.TransientSolution(1).SedimentHeadHydrostep, ...
-							mdfine.results.TransientSolution(1).EplHeadHydrostep,...
-							mdfine.results.TransientSolution(1).SedimentHeadResidual,...
-							mdfine.results.TransientSolution(4).SedimentHeadHydrostep,...
-							mdfine.results.TransientSolution(4).EplHeadHydrostep,...
-							mdfine.results.TransientSolution(4).SedimentHeadResidual, ...
-							mdfine.results.TransientSolution(5).SedimentHeadHydrostep,...
-							mdfine.results.TransientSolution(5).EplHeadHydrostep,...
-							mdfine.results.TransientSolution(5).SedimentHeadResidual, ...
-							mdfine.results.TransientSolution(9).SedimentHeadHydrostep,...
-							mdfine.results.TransientSolution(9).EplHeadHydrostep,...
-							mdfine.results.TransientSolution(9).SedimentHeadResidual,...
-              md.results.TransientSolution(1).EplHead};
+    1e-13, 1e-13, 1e-13,...
+    1e-13, 1e-13, 1e-13,...
+    1e-13, 5e-12, 1e-11,...
+    1e-13, 5e-12, 1e-11,...
+    1e-13, 1e-13, 1e-13,...
+    1e-13};
+field_values={mdfine.results.TransientSolution(1).SedimentHead, ...
+	      mdfine.results.TransientSolution(1).EplHead,...
+	      mdfine.results.TransientSolution(1).SedimentHeadResidual,...
+	      mdfine.results.TransientSolution(4).SedimentHead,...
+	      mdfine.results.TransientSolution(4).EplHead,...
+	      mdfine.results.TransientSolution(4).SedimentHeadResidual, ...
+	      mdfine.results.TransientSolution(5).SedimentHead,...
+	      mdfine.results.TransientSolution(5).EplHead,...
+	      mdfine.results.TransientSolution(5).SedimentHeadResidual, ...
+	      mdfine.results.TransientSolution(9).SedimentHead,...
+	      mdfine.results.TransientSolution(9).EplHead,...
+	      mdfine.results.TransientSolution(9).SedimentHeadResidual,...
+              md.results.TransientSolution(1).EplHead,...
+              md.results.TransientSolution(1).EplHeadSubstep,...
+              md.results.TransientSolution(1).SedimentHead,...
+              md.results.TransientSolution(1).SedimentHeadSubstep
+              };
Index: /issm/trunk/test/NightlyRun/test333.py
===================================================================
--- /issm/trunk/test/NightlyRun/test333.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test333.py	(revision 24313)
@@ -11,77 +11,78 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',100000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/IceCube.py')
 
-md.transient=transient.setallnullparameters(md.transient)
-md.transient.ishydrology=True
-md.transient.issmb=True
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md.hydrology=hydrologydc()
-md.hydrology=md.hydrology.initialize(md)
+md = triangle(model(), '../Exp/Square.exp', 100000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/IceCube.py')
 
-md.hydrology.isefficientlayer=1
-md.hydrology.sedimentlimit_flag=1
-md.hydrology.sedimentlimit=800.0
-md.hydrology.mask_thawed_node=np.ones((md.mesh.numberofvertices))
-md.initialization.sediment_head=np.zeros((md.mesh.numberofvertices))
-md.hydrology.spcsediment_head=np.nan*np.ones((md.mesh.numberofvertices))
+md.transient = transient.setallnullparameters(md.transient)
+md.transient.ishydrology = True
+#md.transient.issmb = True
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.hydrology = hydrologydc()
+md.hydrology = md.hydrology.initialize(md)
 
-md.basalforcings.groundedice_melting_rate = 2.0*np.ones((md.mesh.numberofvertices))
-md.basalforcings.floatingice_melting_rate = 0.0*np.ones((md.mesh.numberofvertices))
-md.hydrology.sediment_transmitivity= 3.0*np.ones((md.mesh.numberofvertices))
+md.hydrology.isefficientlayer = 1
+md.hydrology.sedimentlimit_flag = 1
+md.hydrology.sedimentlimit = 800.0
+md.hydrology.transfer_flag = 0
+md.hydrology.mask_thawed_node = np.ones((md.mesh.numberofvertices))
+md.initialization.sediment_head = np.zeros((md.mesh.numberofvertices))
+md.hydrology.spcsediment_head = np.nan * np.ones((md.mesh.numberofvertices))
 
-md.initialization.epl_head=np.zeros((md.mesh.numberofvertices))
-md.initialization.epl_thickness=np.ones((md.mesh.numberofvertices))
-md.hydrology.spcepl_head=np.nan*np.ones((md.mesh.numberofvertices))
-md.hydrology.mask_eplactive_node=np.zeros((md.mesh.numberofvertices))
-md.hydrology.epl_conductivity=30
-md.hydrology.epl_initial_thickness=1
-md.hydrology.epl_colapse_thickness=1.0e-3
-md.hydrology.epl_thick_comp=1
-md.hydrology.epl_max_thickness=1
-md.hydrology.steps_per_step=10
-md.timestepping.time_step=2.0
-md.timestepping.final_time=2.0
+md.basalforcings.groundedice_melting_rate = 2.0 * np.ones((md.mesh.numberofvertices))
+md.basalforcings.floatingice_melting_rate = 0.0 * np.ones((md.mesh.numberofvertices))
+md.hydrology.sediment_transmitivity = 3.0 * np.ones((md.mesh.numberofvertices))
 
-md=solve(md,'Transient')
+md.initialization.epl_head = np.zeros((md.mesh.numberofvertices))
+md.initialization.epl_thickness = np.ones((md.mesh.numberofvertices))
+md.hydrology.spcepl_head = np.nan * np.ones((md.mesh.numberofvertices))
+md.hydrology.mask_eplactive_node = np.zeros((md.mesh.numberofvertices))
+md.hydrology.epl_conductivity = 30
+md.hydrology.epl_initial_thickness = 1
+md.hydrology.epl_colapse_thickness = 1.0e-3
+md.hydrology.epl_thick_comp = 1
+md.hydrology.epl_max_thickness = 1
+md.hydrology.steps_per_step = 10
+md.timestepping.time_step = 2.0
+md.timestepping.final_time = 2.0
+
+#md.debug.valgrind = True
+md = solve(md, 'Transient')
 
 #re-run with no substeps
-mdfine=copy.deepcopy(md)
-mdfine.result=[]
-mdfine.hydrology.steps_per_step=1
-mdfine.timestepping.time_step=0.2
-mdfine=solve(mdfine,'Transient')
+mdfine = copy.deepcopy(md)
+mdfine.results = []
+mdfine.hydrology.steps_per_step = 1
+mdfine.timestepping.time_step = 0.2
+mdfine = solve(mdfine, 'Transient')
 
-
-sedmean=mdfine.results.TransientSolution[0].SedimentHeadHydrostep
-eplmean=mdfine.results.TransientSolution[0].EplHeadHydrostep
-for i in range(1,10):
-	sedmean=sedmean+(mdfine.results.TransientSolution[i].SedimentHeadHydrostep)
-	eplmean=eplmean+(mdfine.results.TransientSolution[i].EplHeadHydrostep)
-
-field_names=['SedimentWaterHead1','EplWaterHead1','SedimentHeadResidual1',
-						 'SedimentWaterHead4','EplWaterHead4','SedimentHeadResidual4',
-						 'SedimentWaterHead5','EplWaterHead5','SedimentHeadResidual5',
-						 'SedimentWaterHead9','EplWaterHead9','SedimentHeadResidual9',
-						 'EplWaterHead10']
-field_tolerances=[1e-13, 1e-13, 1e-13,
-									1e-13, 1e-13, 1e-13,
-									1e-13, 5e-12, 1e-11,
-									1e-13, 5e-12, 1e-11,
-									1e-13]
-field_values=[mdfine.results.TransientSolution[0].SedimentHeadHydrostep,
-							mdfine.results.TransientSolution[0].EplHeadHydrostep,
-							mdfine.results.TransientSolution[0].SedimentHeadResidual,
-							mdfine.results.TransientSolution[3].SedimentHeadHydrostep,
-							mdfine.results.TransientSolution[3].EplHeadHydrostep,
-							mdfine.results.TransientSolution[3].SedimentHeadResidual,
-							mdfine.results.TransientSolution[4].SedimentHeadHydrostep,
-							mdfine.results.TransientSolution[4].EplHeadHydrostep,
-							mdfine.results.TransientSolution[4].SedimentHeadResidual,
-							mdfine.results.TransientSolution[8].SedimentHeadHydrostep,
-							mdfine.results.TransientSolution[8].EplHeadHydrostep,
-							mdfine.results.TransientSolution[8].SedimentHeadResidual,
-							md.results.TransientSolution[-1].EplHead]
+field_names = ['SedimentWaterHead1', 'EplWaterHead1', 'SedimentHeadResidual1',
+               'SedimentWaterHead4', 'EplWaterHead4', 'SedimentHeadResidual4',
+               'SedimentWaterHead5', 'EplWaterHead5', 'SedimentHeadResidual5',
+               'SedimentWaterHead9', 'EplWaterHead9', 'SedimentHeadResidual9',
+               'EplWaterHead10', 'EplWaterHeadSubstep10', 'SedimentWaterHead10',
+               'SedimentWaterHeadSubstep10']
+field_tolerances = [1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 5e-12, 1e-11,
+                    1e-13, 5e-12, 1e-11,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13]
+field_values = [mdfine.results.TransientSolution[0].SedimentHead,
+                mdfine.results.TransientSolution[0].EplHead,
+                mdfine.results.TransientSolution[0].SedimentHeadResidual,
+                mdfine.results.TransientSolution[3].SedimentHead,
+                mdfine.results.TransientSolution[3].EplHead,
+                mdfine.results.TransientSolution[3].SedimentHeadResidual,
+                mdfine.results.TransientSolution[4].SedimentHead,
+                mdfine.results.TransientSolution[4].EplHead,
+                mdfine.results.TransientSolution[4].SedimentHeadResidual,
+                mdfine.results.TransientSolution[8].SedimentHead,
+                mdfine.results.TransientSolution[8].EplHead,
+                mdfine.results.TransientSolution[8].SedimentHeadResidual,
+                md.results.TransientSolution[-1].EplHead,
+                md.results.TransientSolution[-1].EplHeadSubstep,
+                md.results.TransientSolution[-1].SedimentHead,
+                md.results.TransientSolution[-1].SedimentHeadSubstep]
Index: /issm/trunk/test/NightlyRun/test334.m
===================================================================
--- /issm/trunk/test/NightlyRun/test334.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test334.m	(revision 24313)
@@ -32,3 +32,3 @@
 field_names     ={'SedimentWaterHead','SedimentHeadResidual'};
 field_tolerances={1e-13, 3e-10};
-field_values={md.results.HydrologySolution.SedimentHeadHydrostep,md.results.HydrologySolution.SedimentHeadResidual};
+field_values={md.results.HydrologySolution.SedimentHead,md.results.HydrologySolution.SedimentHeadResidual};
Index: /issm/trunk/test/NightlyRun/test334.py
===================================================================
--- /issm/trunk/test/NightlyRun/test334.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test334.py	(revision 24313)
@@ -13,37 +13,36 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',100000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/IceCube.py')
-md.transient=transient.setallnullparameters(md.transient)
-md.transient.ishydrology=True
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md.hydrology=hydrologydc()
-md.hydrology=md.hydrology.initialize(md)
+md = triangle(model(), '../Exp/Square.exp', 100000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/IceCube.py')
+md.transient = transient.setallnullparameters(md.transient)
+md.transient.ishydrology = True
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.hydrology = hydrologydc()
+md.hydrology = md.hydrology.initialize(md)
 
-md.hydrology.isefficientlayer=0
-md.hydrology.sedimentlimit_flag=1
-md.hydrology.sedimentlimit=8000.0
-md.hydrology.mask_thawed_node=np.ones((md.mesh.numberofvertices))
-md.initialization.sediment_head=np.zeros((md.mesh.numberofvertices))
-md.hydrology.spcsediment_head=np.nan*np.ones((md.mesh.numberofvertices))
-md.hydrology.spcsediment_head[np.where(md.mesh.y==0)]=0.0
+md.hydrology.isefficientlayer = 0
+md.hydrology.sedimentlimit_flag = 1
+md.hydrology.sedimentlimit = 8000.0
+md.hydrology.mask_thawed_node = np.ones((md.mesh.numberofvertices))
+md.initialization.sediment_head = np.zeros((md.mesh.numberofvertices))
+md.hydrology.spcsediment_head = np.nan * np.ones((md.mesh.numberofvertices))
+md.hydrology.spcsediment_head[np.where(md.mesh.y == 0)] = 0.0
 
-md.basalforcings.groundedice_melting_rate = 2.0*np.ones((md.mesh.numberofvertices))
-md.basalforcings.floatingice_melting_rate = 0.0*np.ones((md.mesh.numberofvertices))
-md.hydrology.sediment_transmitivity= 3.0*np.ones((md.mesh.numberofvertices))
+md.basalforcings.groundedice_melting_rate = 2.0 * np.ones((md.mesh.numberofvertices))
+md.basalforcings.floatingice_melting_rate = 0.0 * np.ones((md.mesh.numberofvertices))
+md.hydrology.sediment_transmitivity = 3.0 * np.ones((md.mesh.numberofvertices))
 
-md.timestepping.time_step=0
-md.timestepping.final_time=1.0
-md.extrude(3,1.)
-md=solve(md,'Hydrology')
+md.timestepping.time_step = 0
+md.timestepping.final_time = 1.0
+md.extrude(3, 1.)
+md = solve(md, 'Hydrology')
 
 #Fields and tolerances to track changes
 #you can also compare with an analitic solution, but it is exact
 #only if no limits are applied
-#analitic=(md.mesh.y.^2-2*md.mesh.y*1.0e6)*(-2.0/(2*md.constants.yts*md.hydrology.sediment_transmitivity))
-field_names     =['SedimentWaterHead','SedimentHeadResidual']
-field_tolerances=[1e-13, 3e-10]
-field_values=[md.results.HydrologySolution.SedimentHeadHydrostep,
-							md.results.HydrologySolution.SedimentHeadResidual]
+#analitic=(md.mesh.y.^2 - 2 * md.mesh.y * 1.0e6) * (-2.0 / (2 * md.constants.yts * md.hydrology.sediment_transmitivity))
+field_names = ['SedimentWaterHead', 'SedimentHeadResidual']
+field_tolerances = [1e-13, 3e-10]
+field_values = [md.results.HydrologySolution.SedimentHead, md.results.HydrologySolution.SedimentHeadResidual]
Index: /issm/trunk/test/NightlyRun/test335.m
===================================================================
--- /issm/trunk/test/NightlyRun/test335.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test335.m	(revision 24313)
@@ -12,4 +12,5 @@
 md.hydrology.isefficientlayer=1;
 md.hydrology.sedimentlimit_flag=1;
+md.hydrology.transfer_flag = 0;
 md.hydrology.sedimentlimit=800.0;
 md.initialization.sediment_head=0.0*ones(md.mesh.numberofvertices,1);
@@ -52,21 +53,21 @@
 %Fields and tolerances to track changes
 field_names     ={'SedimentWaterHead1','EplWaterHead1','SedimentHeadResidual1',...
-						'SedimentWaterHead4','EplWaterHead4','SedimentHeadResidual4',...
-						'SedimentWaterHead5','EplWaterHead5','SedimentHeadResidual5',...
-						'SedimentWaterHead9','EplWaterHead9','SedimentHeadResidual9'};
+		  'SedimentWaterHead4','EplWaterHead4','SedimentHeadResidual4',...
+		  'SedimentWaterHead5','EplWaterHead5','SedimentHeadResidual5',...
+		  'SedimentWaterHead9','EplWaterHead9','SedimentHeadResidual9'};
 field_tolerances={1e-13, 1e-13, 1e-13,...
-						1e-13, 1e-13, 1e-13,...
-						1e-13, 5e-12, 2e-11,...
-						1e-13, 5e-12, 2e-11};
-field_values={md.results.TransientSolution(1).SedimentHeadHydrostep, ...
-							md.results.TransientSolution(1).EplHeadHydrostep,...
-							md.results.TransientSolution(1).SedimentHeadResidual,...
-							md.results.TransientSolution(4).SedimentHeadHydrostep,...
-							md.results.TransientSolution(4).EplHeadHydrostep,...
-							md.results.TransientSolution(4).SedimentHeadResidual, ...
-							md.results.TransientSolution(5).SedimentHeadHydrostep,...
-							md.results.TransientSolution(5).EplHeadHydrostep,...
-							md.results.TransientSolution(5).SedimentHeadResidual, ...
-							md.results.TransientSolution(9).SedimentHeadHydrostep,...
-							md.results.TransientSolution(9).EplHeadHydrostep,...
-							md.results.TransientSolution(9).SedimentHeadResidual};
+		  1e-13, 1e-13, 1e-13,...
+		  1e-13, 5e-12, 2e-11,...
+		  1e-13, 5e-12, 2e-11};
+field_values={md.results.TransientSolution(1).SedimentHead, ...
+	      md.results.TransientSolution(1).EplHead,...
+	      md.results.TransientSolution(1).SedimentHeadResidual,...
+	      md.results.TransientSolution(4).SedimentHead,...
+	      md.results.TransientSolution(4).EplHead,...
+	      md.results.TransientSolution(4).SedimentHeadResidual, ...
+	      md.results.TransientSolution(5).SedimentHead,...
+	      md.results.TransientSolution(5).EplHead,...
+	      md.results.TransientSolution(5).SedimentHeadResidual, ...
+	      md.results.TransientSolution(9).SedimentHead,...
+	      md.results.TransientSolution(9).EplHead,...
+	      md.results.TransientSolution(9).SedimentHeadResidual};
Index: /issm/trunk/test/NightlyRun/test335.py
===================================================================
--- /issm/trunk/test/NightlyRun/test335.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test335.py	(revision 24313)
@@ -13,59 +13,60 @@
 from generic import generic
 
-md=triangle(model(),'../Exp/Square.exp',100000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/IceCube.py')
-md.transient=transient.setallnullparameters(md.transient)
-md.transient.ishydrology=True
-md.transient.issmb=True
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',1)
-md.hydrology=hydrologydc()
-md.hydrology=md.hydrology.initialize(md)
+md = triangle(model(), '../Exp/Square.exp', 100000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/IceCube.py')
+md.transient = transient.setallnullparameters(md.transient)
+md.transient.ishydrology = True
+md.transient.issmb = True
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md.hydrology = hydrologydc()
+md.hydrology = md.hydrology.initialize(md)
 
-md.hydrology.isefficientlayer=1
-md.hydrology.sedimentlimit_flag=1
-md.hydrology.sedimentlimit=800.0
-md.hydrology.mask_thawed_node=np.ones((md.mesh.numberofvertices))
-md.initialization.sediment_head=np.zeros((md.mesh.numberofvertices))
-md.hydrology.spcsediment_head=np.nan*np.ones((md.mesh.numberofvertices))
-md.basalforcings.groundedice_melting_rate = 2.0*np.ones((md.mesh.numberofvertices))
+md.hydrology.isefficientlayer = 1
+md.hydrology.sedimentlimit_flag = 1
+md.hydrology.transfer_flag = 0
+md.hydrology.sedimentlimit = 800.0
+md.hydrology.mask_thawed_node = np.ones((md.mesh.numberofvertices))
+md.initialization.sediment_head = np.zeros((md.mesh.numberofvertices))
+md.hydrology.spcsediment_head = np.nan * np.ones((md.mesh.numberofvertices))
+md.basalforcings.groundedice_melting_rate = 2.0 * np.ones((md.mesh.numberofvertices))
 md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices))
-md.hydrology.sediment_transmitivity=3*np.ones((md.mesh.numberofvertices))
+md.hydrology.sediment_transmitivity = 3 * np.ones((md.mesh.numberofvertices))
 
-md.initialization.epl_head=np.zeros((md.mesh.numberofvertices))
-md.initialization.epl_thickness=np.ones((md.mesh.numberofvertices))
-md.hydrology.spcepl_head=np.nan*np.ones((md.mesh.numberofvertices))
-md.hydrology.mask_eplactive_node=np.zeros((md.mesh.numberofvertices))
-md.hydrology.epl_conductivity=30
-md.hydrology.epl_initial_thickness=1
-md.hydrology.epl_colapse_thickness=1.0e-3
-md.hydrology.epl_thick_comp=1
-md.hydrology.epl_max_thickness=1
-md.timestepping.time_step=0.2
-md.timestepping.final_time=2.0
+md.initialization.epl_head = np.zeros((md.mesh.numberofvertices))
+md.initialization.epl_thickness = np.ones((md.mesh.numberofvertices))
+md.hydrology.spcepl_head = np.nan * np.ones((md.mesh.numberofvertices))
+md.hydrology.mask_eplactive_node = np.zeros((md.mesh.numberofvertices))
+md.hydrology.epl_conductivity = 30
+md.hydrology.epl_initial_thickness = 1
+md.hydrology.epl_colapse_thickness = 1.0e-3
+md.hydrology.epl_thick_comp = 1
+md.hydrology.epl_max_thickness = 1
+md.timestepping.time_step = 0.2
+md.timestepping.final_time = 2.0
 
-md.extrude(3,1.)
-md=solve(md,'Transient')
+md.extrude(3, 1.)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names=['SedimentWaterHead1','EplWaterHead1','SedimentHeadResidual1',
-						 'SedimentWaterHead4','EplWaterHead4','SedimentHeadResidual4',
-						 'SedimentWaterHead5','EplWaterHead5','SedimentHeadResidual5',
-						 'SedimentWaterHead9','EplWaterHead9','SedimentHeadResidual9']
-field_tolerances=[1e-13, 1e-13, 1e-13,
-									1e-13, 1e-13, 1e-13,
-									1e-13, 5e-12, 2e-11,
-									1e-13, 5e-12, 2e-11]
-field_values=[md.results.TransientSolution[0].SedimentHeadHydrostep,
-							md.results.TransientSolution[0].EplHeadHydrostep,
-							md.results.TransientSolution[0].SedimentHeadResidual,
-							md.results.TransientSolution[3].SedimentHeadHydrostep,
-							md.results.TransientSolution[3].EplHeadHydrostep,
-							md.results.TransientSolution[3].SedimentHeadResidual,
-							md.results.TransientSolution[4].SedimentHeadHydrostep,
-							md.results.TransientSolution[4].EplHeadHydrostep,
-							md.results.TransientSolution[4].SedimentHeadResidual,
-							md.results.TransientSolution[8].SedimentHeadHydrostep,
-							md.results.TransientSolution[8].EplHeadHydrostep,
-							md.results.TransientSolution[8].SedimentHeadResidual]
+field_names = ['SedimentWaterHead1', 'EplWaterHead1', 'SedimentHeadResidual1',
+               'SedimentWaterHead4', 'EplWaterHead4', 'SedimentHeadResidual4',
+               'SedimentWaterHead5', 'EplWaterHead5', 'SedimentHeadResidual5',
+               'SedimentWaterHead9', 'EplWaterHead9', 'SedimentHeadResidual9']
+field_tolerances = [1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 5e-12, 2e-11,
+                    1e-13, 5e-12, 2e-11]
+field_values = [md.results.TransientSolution[0].SedimentHead,
+                md.results.TransientSolution[0].EplHead,
+                md.results.TransientSolution[0].SedimentHeadResidual,
+                md.results.TransientSolution[3].SedimentHead,
+                md.results.TransientSolution[3].EplHead,
+                md.results.TransientSolution[3].SedimentHeadResidual,
+                md.results.TransientSolution[4].SedimentHead,
+                md.results.TransientSolution[4].EplHead,
+                md.results.TransientSolution[4].SedimentHeadResidual,
+                md.results.TransientSolution[8].SedimentHead,
+                md.results.TransientSolution[8].EplHead,
+                md.results.TransientSolution[8].SedimentHeadResidual]
Index: /issm/trunk/test/NightlyRun/test336.py
===================================================================
--- /issm/trunk/test/NightlyRun/test336.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test336.py	(revision 24313)
@@ -10,65 +10,65 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.timestepping.time_step=1.
-md.settings.output_frequency=1
-md.timestepping.final_time=4.
+md.timestepping.time_step = 1.
+md.settings.output_frequency = 1
+md.timestepping.final_time = 4.
 
 #Set up transient
-smb=np.ones((md.mesh.numberofvertices))*3.6
-smb=np.vstack((smb,smb*-1.)).T
+smb = np.ones((md.mesh.numberofvertices)) * 3.6
+smb = np.vstack((smb, smb * - 1.)).T
 
-md.smb=SMBcomponents()
-md.smb.accumulation=np.vstack((smb*2, [1.5,3.]))
-md.smb.runoff=np.vstack((smb/2, [1.5,3.]))
-md.smb.evaporation=np.vstack((smb/2, [1.5,3.]))
-md.transient.isthermal=False
+md.smb = SMBcomponents()
+md.smb.accumulation = np.vstack((smb * 2, [1.5, 3.]))
+md.smb.runoff = np.vstack((smb / 2, [1.5, 3.]))
+md.smb.evaporation = np.vstack((smb / 2, [1.5, 3.]))
+md.transient.isthermal = False
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
-						 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
-						 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
-						 'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
-field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].SmbMassBalance,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].SmbMassBalance,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].SmbMassBalance,
-							md.results.TransientSolution[3].Vx,
-							md.results.TransientSolution[3].Vy,
-							md.results.TransientSolution[3].Vel,
-							md.results.TransientSolution[3].Pressure,
-							md.results.TransientSolution[3].Base,
-							md.results.TransientSolution[3].Surface,
-							md.results.TransientSolution[3].Thickness,
-							md.results.TransientSolution[3].SmbMassBalance]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3',
+               'Vx4', 'Vy4', 'Vel4', 'Pressure4', 'Bed4', 'Surface4', 'Thickness4', 'SmbMassBalance4']
+field_tolerances = [1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].SmbMassBalance,
+                md.results.TransientSolution[3].Vx,
+                md.results.TransientSolution[3].Vy,
+                md.results.TransientSolution[3].Vel,
+                md.results.TransientSolution[3].Pressure,
+                md.results.TransientSolution[3].Base,
+                md.results.TransientSolution[3].Surface,
+                md.results.TransientSolution[3].Thickness,
+                md.results.TransientSolution[3].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test337.py
===================================================================
--- /issm/trunk/test/NightlyRun/test337.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test337.py	(revision 24313)
@@ -10,66 +10,66 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.timestepping.time_step=1.
-md.settings.output_frequency=1
-md.timestepping.final_time=4.
+md.timestepping.time_step = 1.
+md.settings.output_frequency = 1
+md.timestepping.final_time = 4.
 
 #Set up transient
-smb=np.ones((md.mesh.numberofvertices))*3.6
-smb=np.vstack((smb,smb*-1.)).T
+smb = np.ones((md.mesh.numberofvertices)) * 3.6
+smb = np.vstack((smb, smb * - 1.)).T
 
-md.smb=SMBcomponents()
-md.smb.accumulation=np.vstack((smb*2, [1.5,3.]))
-md.smb.runoff=np.vstack((smb/2, [1.5,3.]))
-md.smb.evaporation=np.vstack((smb/2, [1.5,3.]))
-md.transient.isthermal=False
+md.smb = SMBcomponents()
+md.smb.accumulation = np.vstack((smb * 2, [1.5, 3.]))
+md.smb.runoff = np.vstack((smb / 2, [1.5, 3.]))
+md.smb.evaporation = np.vstack((smb / 2, [1.5, 3.]))
+md.transient.isthermal = False
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
-						 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
-						 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
-						 'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
-field_tolerances=[5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,
-									5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,
-									5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,
-									5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].SmbMassBalance,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].SmbMassBalance,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].SmbMassBalance,
-							md.results.TransientSolution[3].Vx,
-							md.results.TransientSolution[3].Vy,
-							md.results.TransientSolution[3].Vel,
-							md.results.TransientSolution[3].Pressure,
-							md.results.TransientSolution[3].Base,
-							md.results.TransientSolution[3].Surface,
-							md.results.TransientSolution[3].Thickness,
-							md.results.TransientSolution[3].SmbMassBalance]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3',
+               'Vx4', 'Vy4', 'Vel4', 'Pressure4', 'Bed4', 'Surface4', 'Thickness4', 'SmbMassBalance4']
+field_tolerances = [5e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    5e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    5e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    5e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].SmbMassBalance,
+                md.results.TransientSolution[3].Vx,
+                md.results.TransientSolution[3].Vy,
+                md.results.TransientSolution[3].Vel,
+                md.results.TransientSolution[3].Pressure,
+                md.results.TransientSolution[3].Base,
+                md.results.TransientSolution[3].Surface,
+                md.results.TransientSolution[3].Thickness,
+                md.results.TransientSolution[3].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test338.py
===================================================================
--- /issm/trunk/test/NightlyRun/test338.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test338.py	(revision 24313)
@@ -10,66 +10,66 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.timestepping.time_step=1.
-md.settings.output_frequency=1
-md.timestepping.final_time=400.
+md.timestepping.time_step = 1.
+md.settings.output_frequency = 1
+md.timestepping.final_time = 400.
 
 #Set up transient
-smb=np.ones((md.mesh.numberofvertices))*3.6
-smb=np.vstack((smb,smb*-1.)).T
+smb = np.ones((md.mesh.numberofvertices)) * 3.6
+smb = np.vstack((smb, smb * - 1.)).T
 
-md.smb=SMBmeltcomponents()
-md.smb.accumulation=np.vstack((smb, [1.5,3.]))
-md.smb.evaporation=np.vstack((smb/2, [1.5,3.]))
-md.smb.melt=np.vstack((smb/2, [1.5,3.]))
-md.smb.refreeze=np.vstack((smb, [1.5,3.]))
-md.transient.isthermal=False
+md.smb = SMBmeltcomponents()
+md.smb.accumulation = np.vstack((smb, [1.5, 3.]))
+md.smb.evaporation = np.vstack((smb / 2, [1.5, 3.]))
+md.smb.melt = np.vstack((smb / 2, [1.5, 3.]))
+md.smb.refreeze = np.vstack((smb, [1.5, 3.]))
+md.transient.isthermal = False
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
-						 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
-						 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
-						 'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
-field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].SmbMassBalance,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].SmbMassBalance,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].SmbMassBalance,
-							md.results.TransientSolution[3].Vx,
-							md.results.TransientSolution[3].Vy,
-							md.results.TransientSolution[3].Vel,
-							md.results.TransientSolution[3].Pressure,
-							md.results.TransientSolution[3].Base,
-							md.results.TransientSolution[3].Surface,
-							md.results.TransientSolution[3].Thickness,
-							md.results.TransientSolution[3].SmbMassBalance]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3',
+               'Vx4', 'Vy4', 'Vel4', 'Pressure4', 'Bed4', 'Surface4', 'Thickness4', 'SmbMassBalance4']
+field_tolerances = [1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].SmbMassBalance,
+                md.results.TransientSolution[3].Vx,
+                md.results.TransientSolution[3].Vy,
+                md.results.TransientSolution[3].Vel,
+                md.results.TransientSolution[3].Pressure,
+                md.results.TransientSolution[3].Base,
+                md.results.TransientSolution[3].Surface,
+                md.results.TransientSolution[3].Thickness,
+                md.results.TransientSolution[3].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test339.py
===================================================================
--- /issm/trunk/test/NightlyRun/test339.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test339.py	(revision 24313)
@@ -10,67 +10,67 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.timestepping.time_step=1.
-md.settings.output_frequency=1
-md.timestepping.final_time=4.
+md.timestepping.time_step = 1.
+md.settings.output_frequency = 1
+md.timestepping.final_time = 4.
 
 #Set up transient
-smb=np.ones((md.mesh.numberofvertices))*3.6
-smb=np.vstack((smb,smb*-1.)).T
+smb = np.ones((md.mesh.numberofvertices)) * 3.6
+smb = np.vstack((smb, smb * - 1.)).T
 
-md.smb=SMBmeltcomponents()
-md.smb.accumulation=np.vstack((smb, [1.5,3.]))
-md.smb.evaporation=np.vstack((smb/2, [1.5,3.]))
-md.smb.melt=np.vstack((smb/2, [1.5,3.]))
-md.smb.refreeze=np.vstack((smb, [1.5,3.]))
-md.transient.isthermal=False
+md.smb = SMBmeltcomponents()
+md.smb.accumulation = np.vstack((smb, [1.5, 3.]))
+md.smb.evaporation = np.vstack((smb / 2, [1.5, 3.]))
+md.smb.melt = np.vstack((smb / 2, [1.5, 3.]))
+md.smb.refreeze = np.vstack((smb, [1.5, 3.]))
+md.transient.isthermal = False
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1',
-						 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2',
-						 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3',
-						 'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4']
-field_tolerances=[2e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,
-									2e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,
-									1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].SmbMassBalance,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].SmbMassBalance,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].SmbMassBalance,
-							md.results.TransientSolution[3].Vx,
-							md.results.TransientSolution[3].Vy,
-							md.results.TransientSolution[3].Vel,
-							md.results.TransientSolution[3].Pressure,
-							md.results.TransientSolution[3].Base,
-							md.results.TransientSolution[3].Surface,
-							md.results.TransientSolution[3].Thickness,
-							md.results.TransientSolution[3].SmbMassBalance]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3',
+               'Vx4', 'Vy4', 'Vel4', 'Pressure4', 'Bed4', 'Surface4', 'Thickness4', 'SmbMassBalance4']
+field_tolerances = [2e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    2e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].SmbMassBalance,
+                md.results.TransientSolution[3].Vx,
+                md.results.TransientSolution[3].Vy,
+                md.results.TransientSolution[3].Vel,
+                md.results.TransientSolution[3].Pressure,
+                md.results.TransientSolution[3].Base,
+                md.results.TransientSolution[3].Surface,
+                md.results.TransientSolution[3].Thickness,
+                md.results.TransientSolution[3].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test340.py
===================================================================
--- /issm/trunk/test/NightlyRun/test340.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test340.py	(revision 24313)
@@ -10,9 +10,9 @@
 from taoinversion import *
 
-md = triangle(model(),'../Exp/Square.exp',200000.)
-md = setmask(md,'','')
-md = parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(3,1.)
-md = setflowequation(md,'HO','all')
+md = triangle(model(), '../Exp/Square.exp', 200000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
 
 #control parameters
@@ -20,27 +20,25 @@
 md.inversion.iscontrol = 1
 md.inversion.control_parameters = ['FrictionCoefficient']
-md.inversion.min_parameters = 1. * np.ones((md.mesh.numberofvertices,))
-md.inversion.max_parameters = 200. * np.ones((md.mesh.numberofvertices,))
+md.inversion.min_parameters = 1. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 200. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
 md.inversion.maxsteps = 2
 md.inversion.maxiter = 6
-md.inversion.cost_functions = [102,501]
-md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices,2))
-md.inversion.cost_functions_coefficients[:,1] = 2. * 1e-7
+md.inversion.cost_functions = [102, 501]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
+md.inversion.cost_functions_coefficients[:, 1] = 2. * 1e-7
 md.inversion.vx_obs = md.initialization.vx
 md.inversion.vy_obs = md.initialization.vy
 
-md.cluster = generic('name',gethostname(),'np',3)
-md = solve(md,'Stressbalance')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names      = ['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy']
-field_tolerances = [3e-08,1e-07,5e-10,1e-10,1e-09,1e-09,1e-09]
-field_values = [
-	md.results.StressbalanceSolution.Gradient1,
-	md.results.StressbalanceSolution.J,
-	md.results.StressbalanceSolution.FrictionCoefficient,
-	md.results.StressbalanceSolution.Pressure,
-	md.results.StressbalanceSolution.Vel,
-	md.results.StressbalanceSolution.Vx,
-	md.results.StressbalanceSolution.Vy
-]
+field_names = ['Gradient', 'Misfits', 'FrictionCoefficient', 'Pressure', 'Vel', 'Vx', 'Vy']
+field_tolerances = [3e-08, 1e-07, 5e-10, 1e-10, 1e-09, 1e-09, 1e-09]
+field_values = [md.results.StressbalanceSolution.Gradient1,
+                md.results.StressbalanceSolution.J,
+                md.results.StressbalanceSolution.FrictionCoefficient,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy]
Index: /issm/trunk/test/NightlyRun/test341.py
===================================================================
--- /issm/trunk/test/NightlyRun/test341.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test341.py	(revision 24313)
@@ -11,36 +11,34 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',200000.)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/SquareSheetConstrained.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
+md = triangle(model(), '../Exp/Square.exp', 200000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
 
 #control parameters
-md.inversion=m1qn3inversion(md.inversion)
-md.inversion.iscontrol=1
-md.inversion.control_parameters=['FrictionCoefficient']
-md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
-md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
-md.inversion.maxsteps=2
-md.inversion.maxiter=6
-md.inversion.cost_functions=[102,501]
-md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
-md.inversion.cost_functions_coefficients[:,1]=2.*10**-7
-md.inversion.vx_obs=md.initialization.vx
-md.inversion.vy_obs=md.initialization.vy
+md.inversion = m1qn3inversion(md.inversion)
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['FrictionCoefficient']
+md.inversion.min_parameters = 1. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 200. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.maxsteps = 2
+md.inversion.maxiter = 6
+md.inversion.cost_functions = [102, 501]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
+md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
+md.inversion.vx_obs = md.initialization.vx
+md.inversion.vy_obs = md.initialization.vy
 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Gradient','FrictionCoefficient','Pressure','Vel','Vx','Vy']
-field_tolerances=[1e-08,1e-9,1e-10,1e-09,1e-09,1e-09]
-field_values=[\
-	md.results.StressbalanceSolution.Gradient1,\
-	md.results.StressbalanceSolution.FrictionCoefficient,\
-	md.results.StressbalanceSolution.Pressure,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-]
+field_names = ['Gradient', 'FrictionCoefficient', 'Pressure', 'Vel', 'Vx', 'Vy']
+field_tolerances = [1e-08, 1e-9, 1e-10, 1e-09, 1e-09, 1e-09]
+field_values = [md.results.StressbalanceSolution.Gradient1,
+                md.results.StressbalanceSolution.FrictionCoefficient,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy]
Index: /issm/trunk/test/NightlyRun/test342.py
===================================================================
--- /issm/trunk/test/NightlyRun/test342.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test342.py	(revision 24313)
@@ -10,26 +10,24 @@
 from plumebasalforcings import *
 
-md = triangle(model(),'../Exp/Square.exp',180000.)
-md = setmask(md,'','')
-md = parameterize(md,'../Par/SquareSheetConstrained.py')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
 md.basalforcings = plumebasalforcings()
 md.basalforcings = md.basalforcings.setdefaultparameters()
-md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices,))
-md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices,))
+md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
+md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
 md.basalforcings.plumex = 500000
 md.basalforcings.plumey = 500000
-md.extrude(3,1.)
-md = setflowequation(md,'SSA','all')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
 md.timestepping.time_step = 0.
-md.thermal.requested_outputs = ['default','BasalforcingsGeothermalflux']
-md.cluster = generic('name',gethostname(),'np',3)
-md = solve(md,'Thermal')
+md.thermal.requested_outputs = ['default', 'BasalforcingsGeothermalflux']
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Thermal')
 
 #Fields and tolerances to track changes
-field_names      = ['Temperature','BasalforcingsGroundediceMeltingRate','BasalforcingsGeothermalflux']
-field_tolerances = [1e-13,1e-8,1e-13]
-field_values = [
-	md.results.ThermalSolution.Temperature,
-	md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate,
-	md.results.ThermalSolution.BasalforcingsGeothermalflux,
-	]
+field_names = ['Temperature', 'BasalforcingsGroundediceMeltingRate', 'BasalforcingsGeothermalflux']
+field_tolerances = [1e-13, 1e-8, 1e-13]
+field_values = [md.results.ThermalSolution.Temperature,
+                md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate,
+                md.results.ThermalSolution.BasalforcingsGeothermalflux]
Index: /issm/trunk/test/NightlyRun/test343.py
===================================================================
--- /issm/trunk/test/NightlyRun/test343.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test343.py	(revision 24313)
@@ -10,14 +10,14 @@
 from SMBgradientsela import *
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'','')
-md = parameterize(md,'../Par/SquareSheetConstrained.py')
-md = setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+md = setflowequation(md, 'SSA', 'all')
 md.smb = SMBgradientsela()
-md.smb.ela = 1500. * np.ones((md.mesh.numberofvertices+1,))
-md.smb.b_pos = 0.002 * np.ones((md.mesh.numberofvertices+1,))
-md.smb.b_neg = 0.005 * np.ones((md.mesh.numberofvertices+1,))
-md.smb.b_max = 4. * (md.materials.rho_freshwater / md.materials.rho_ice) * np.ones((md.mesh.numberofvertices+1,))
-md.smb.b_min = -4. * (md.materials.rho_freshwater / md.materials.rho_ice) * np.ones((md.mesh.numberofvertices+1,))
+md.smb.ela = 1500. * np.ones((md.mesh.numberofvertices + 1, ))
+md.smb.b_pos = 0.002 * np.ones((md.mesh.numberofvertices + 1, ))
+md.smb.b_neg = 0.005 * np.ones((md.mesh.numberofvertices + 1, ))
+md.smb.b_max = 4. * (md.materials.rho_freshwater / md.materials.rho_ice) * np.ones((md.mesh.numberofvertices + 1, ))
+md.smb.b_min = -4. * (md.materials.rho_freshwater / md.materials.rho_ice) * np.ones((md.mesh.numberofvertices + 1, ))
 
 #Change geometry
@@ -26,41 +26,37 @@
 
 #Transient options
-md.transient.requested_outputs = ['default','TotalSmb']
-md.cluster = generic('name',gethostname(),'np',3)
-md = solve(md,'Transient')
+md.transient.requested_outputs = ['default', 'TotalSmb']
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     = [
-	'Vx1','Vy1','Vel1','Bed1','Surface1','Thickness1','SMB1','TotalSmb1',
-	'Vx2','Vy2','Vel2','Bed2','Surface2','Thickness2','SMB2','TotalSmb2',
-	'Vx3','Vy3','Vel3','Bed3','Surface3','Thickness3','SMB3','TotalSmb3']
-field_tolerances = [
-	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-	1e-12,1e-12,1e-12,1e-13,1e-13,1e-13,1.5e-13,1e-13]
-field_values = [
-	md.results.TransientSolution[0].Vx,
-	md.results.TransientSolution[0].Vy,
-	md.results.TransientSolution[0].Vel,
-	md.results.TransientSolution[0].Base,
-	md.results.TransientSolution[0].Surface,
-	md.results.TransientSolution[0].Thickness,
-	md.results.TransientSolution[0].SmbMassBalance,
-	md.results.TransientSolution[0].TotalSmb,
-	md.results.TransientSolution[1].Vx,
-	md.results.TransientSolution[1].Vy,
-	md.results.TransientSolution[1].Vel,
-	md.results.TransientSolution[1].Base,
-	md.results.TransientSolution[1].Surface,
-	md.results.TransientSolution[1].Thickness,
-	md.results.TransientSolution[1].TotalSmb,
-	md.results.TransientSolution[1].SmbMassBalance,
-	md.results.TransientSolution[2].Vx,
-	md.results.TransientSolution[2].Vy,
-	md.results.TransientSolution[2].Vel,
-	md.results.TransientSolution[2].Base,
-	md.results.TransientSolution[2].Surface,
-	md.results.TransientSolution[2].Thickness,
-	md.results.TransientSolution[2].SmbMassBalance,
-	md.results.TransientSolution[2].TotalSmb
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Bed1', 'Surface1', 'Thickness1', 'SMB1', 'TotalSmb1',
+               'Vx2', 'Vy2', 'Vel2', 'Bed2', 'Surface2', 'Thickness2', 'SMB2', 'TotalSmb2',
+               'Vx3', 'Vy3', 'Vel3', 'Bed3', 'Surface3', 'Thickness3', 'SMB3', 'TotalSmb3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-12, 1e-12, 1e-12, 1e-13, 1e-13, 1e-13, 1.5e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[0].TotalSmb,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].TotalSmb,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].SmbMassBalance,
+                md.results.TransientSolution[2].TotalSmb]
Index: /issm/trunk/test/NightlyRun/test344.py
===================================================================
--- /issm/trunk/test/NightlyRun/test344.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test344.py	(revision 24313)
@@ -10,7 +10,7 @@
 from SMBgradientsela import *
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'','')
-md = parameterize(md,'../Par/SquareSheetConstrained.py')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
 
 #Change geometry
@@ -18,56 +18,54 @@
 md.geometry.surface = md.geometry.base + md.geometry.thickness
 
-md = md.extrude(3,1.)
-md = setflowequation(md,'HO','all')
+md = md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
 md.smb = SMBgradientsela()
-md.smb.ela = 1500. * np.ones((md.mesh.numberofvertices+1,))
-md.smb.b_pos = 0.002 * np.ones((md.mesh.numberofvertices+1,))
-md.smb.b_neg = 0.005 * np.ones((md.mesh.numberofvertices+1,))
-md.smb.b_max = 4. * (md.materials.rho_freshwater / md.materials.rho_ice) * np.ones((md.mesh.numberofvertices+1,))
-md.smb.b_min = -4. * (md.materials.rho_freshwater / md.materials.rho_ice) * np.ones((md.mesh.numberofvertices+1,))
+md.smb.ela = 1500. * np.ones((md.mesh.numberofvertices + 1, ))
+md.smb.b_pos = 0.002 * np.ones((md.mesh.numberofvertices + 1, ))
+md.smb.b_neg = 0.005 * np.ones((md.mesh.numberofvertices + 1, ))
+md.smb.b_max = 4. * (md.materials.rho_freshwater / md.materials.rho_ice) * np.ones((md.mesh.numberofvertices + 1, ))
+md.smb.b_min = -4. * (md.materials.rho_freshwater / md.materials.rho_ice) * np.ones((md.mesh.numberofvertices + 1, ))
 
 
 #Transient options
-md.transient.requested_outputs = ['default','TotalSmb']
-md.cluster = generic('name',gethostname(),'np',3)
-md = solve(md,'Transient')
+md.transient.requested_outputs = ['default', 'TotalSmb']
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     = ['Vx1','Vy1','Vz1','Vel1','Bed1','Surface1','Thickness1','Temperature1','SMB1','TotalSmb1',
- 'Vx2','Vy2','Vz2','Vel2','Bed2','Surface2','Thickness2','Temperature2','SMB2','TotalSmb2',
- 'Vx3','Vy3','Vz3','Vel3','Bed3','Surface3','Thickness3','Temperature3','SMB3','TotalSmb3']
-field_tolerances = [1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
-	1e-09,1e-09,1e-10,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,
-	1e-09,5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
-field_values = [
-	md.results.TransientSolution[0].Vx,
-	md.results.TransientSolution[0].Vy,
-	md.results.TransientSolution[0].Vz,
-	md.results.TransientSolution[0].Vel,
-	md.results.TransientSolution[0].Base,
-	md.results.TransientSolution[0].Surface,
-	md.results.TransientSolution[0].Thickness,
-	md.results.TransientSolution[0].Temperature,
-	md.results.TransientSolution[0].SmbMassBalance,
-	md.results.TransientSolution[0].TotalSmb,
-	md.results.TransientSolution[1].Vx,
-	md.results.TransientSolution[1].Vy,
-	md.results.TransientSolution[1].Vz,
-	md.results.TransientSolution[1].Vel,
-	md.results.TransientSolution[1].Base,
-	md.results.TransientSolution[1].Surface,
-	md.results.TransientSolution[1].Thickness,
-	md.results.TransientSolution[1].Temperature,
-	md.results.TransientSolution[1].SmbMassBalance,
-	md.results.TransientSolution[1].TotalSmb,
-	md.results.TransientSolution[2].Vx,
-	md.results.TransientSolution[2].Vy,
-	md.results.TransientSolution[2].Vz,
-	md.results.TransientSolution[2].Vel,
-	md.results.TransientSolution[2].Base,
-	md.results.TransientSolution[2].Surface,
-	md.results.TransientSolution[2].Thickness,
-	md.results.TransientSolution[2].Temperature,
-	md.results.TransientSolution[2].SmbMassBalance,
-	md.results.TransientSolution[2].TotalSmb,
-	]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'SMB1', 'TotalSmb1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'SMB2', 'TotalSmb2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Bed3', 'Surface3', 'Thickness3', 'Temperature3', 'SMB3', 'TotalSmb3']
+field_tolerances = [1e-09, 1e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 5e-09, 1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[0].TotalSmb,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].SmbMassBalance,
+                md.results.TransientSolution[1].TotalSmb,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].SmbMassBalance,
+                md.results.TransientSolution[2].TotalSmb]
Index: /issm/trunk/test/NightlyRun/test345.m
===================================================================
--- /issm/trunk/test/NightlyRun/test345.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test345.m	(revision 24313)
@@ -0,0 +1,30 @@
+%Test Name: SquareSheetConstrainedEnthalpyEffectiveConductivity
+md=triangle(model(),'../Exp/Square.exp',180000.);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/SquareSheetConstrained.par');
+md=extrude(md,3,1.);
+md=setflowequation(md,'SSA','all');
+md.timestepping.time_step=0.;
+md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+md.initialization.watercolumn=zeros(md.mesh.numberofvertices,1);
+md.thermal.isenthalpy = 1;
+md.thermal.isdynamicbasalspc = 0;
+
+md.cluster=generic('name',oshostname(),'np',3);
+field_names={};
+field_tolerances={};
+field_values={};
+for i=[0 1 2]
+	md.materials.effectiveconductivity_averaging=i;
+	disp(' ');
+	disp(['====== Testing effectiveconductivity_averaging=',num2str(i),' =====']);
+	md=solve(md,'Thermal');
+	%Fields and tolerances to track changes
+	field_names     ={field_names{:},['Enthalpy' i],['Waterfraction' i],['Temperature' i]};
+	field_tolerances={field_tolerances{:},1e-13,5e-13,1e-13};
+	field_values={field_values{:},...
+		(md.results.ThermalSolution.Enthalpy),...
+		(md.results.ThermalSolution.Waterfraction),...
+		(md.results.ThermalSolution.Temperature),...
+		};
+end
Index: /issm/trunk/test/NightlyRun/test346.m
===================================================================
--- /issm/trunk/test/NightlyRun/test346.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test346.m	(revision 24313)
@@ -0,0 +1,26 @@
+%Test Name: SquareSheetConstrainedTherTranNyeH2O 
+md=triangle(model(),'../Exp/Square.exp',180000.);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/SquareSheetConstrainedCO2.par');
+md=extrude(md,3,1.);
+md=setflowequation(md,'SSA','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.verbose=verbose('convergence',true,'solution',true);
+md.materials.rheology_law = 'NyeCO2';
+md.transient.isstressbalance=0;
+md.transient.ismasstransport=0;
+md.transient.issmb=1;
+md.transient.isthermal=1;
+md.transient.isgroundingline=0;
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names     ={'Temperature1','BasalforcingsGroundediceMeltingRate1',...
+	'Temperature3','BasalforcingsGroundediceMeltingRate3'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13}; 
+field_values={...
+	(md.results.TransientSolution(1).Temperature),...
+	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+	(md.results.TransientSolution(3).Temperature),...
+	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
+	};
Index: /issm/trunk/test/NightlyRun/test346.py
===================================================================
--- /issm/trunk/test/NightlyRun/test346.py	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test346.py	(revision 24313)
@@ -0,0 +1,34 @@
+#Test Name: SquareSheetConstrainedTherTranNyeCO2
+from model import *
+from socket import gethostname
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrainedCO2.py')
+
+md = md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+
+#Transient options
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.materials.rheology_law = 'NyeCO2'
+md.transient.isstressbalance = 0
+md.transient.ismasstransport = 0
+md.transient.issmb = 1
+md.transient.isthermal = 1
+md.transient.isgroundingline = 0
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = ['Temperature1', 'BasalforcingsGroundediceMeltingRate1',
+               'Temperature3', 'BasalforcingsGroundediceMeltingRate3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test347.m
===================================================================
--- /issm/trunk/test/NightlyRun/test347.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test347.m	(revision 24313)
@@ -0,0 +1,28 @@
+%Test Name: SquareSheetConstrainedTherTranNyeH2O
+md=triangle(model(),'../Exp/Square.exp',180000.);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/SquareSheetConstrained.par');
+md=extrude(md,3,1.);
+md=setflowequation(md,'SSA','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.verbose=verbose('convergence',true,'solution',true);
+md.materials.rheology_law = 'NyeH2O';
+md.materials.rheology_B=nye(md.initialization.temperature,2)
+
+md.transient.isstressbalance=0;
+md.transient.ismasstransport=0;
+md.transient.issmb=1;
+md.transient.isthermal=1;
+md.transient.isgroundingline=0;
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names     ={'Temperature1','BasalforcingsGroundediceMeltingRate1',...
+	'Temperature3','BasalforcingsGroundediceMeltingRate3'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13}; 
+field_values={...
+	(md.results.TransientSolution(1).Temperature),...
+	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+	(md.results.TransientSolution(3).Temperature),...
+	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
+	};
Index: /issm/trunk/test/NightlyRun/test347.py
===================================================================
--- /issm/trunk/test/NightlyRun/test347.py	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test347.py	(revision 24313)
@@ -0,0 +1,37 @@
+#Test Name: SquareSheetConstrainedTherTranNyeH2O
+from model import *
+from socket import gethostname
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+from nye import *
+
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
+
+md = md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+
+#Transient options
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.materials.rheology_law = 'NyeH2O'
+md.materials.rheology_B = nye(md.initialization.temperature, 2)
+
+md.transient.isstressbalance = 0
+md.transient.ismasstransport = 0
+md.transient.issmb = 1
+md.transient.isthermal = 1
+md.transient.isgroundingline = 0
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = ['Temperature1', 'BasalforcingsGroundediceMeltingRate1',
+               'Temperature3', 'BasalforcingsGroundediceMeltingRate3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test350.py
===================================================================
--- /issm/trunk/test/NightlyRun/test350.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test350.py	(revision 24313)
@@ -13,13 +13,13 @@
 from transient import *
 
-md = triangle(model(),'../Exp/Square.exp',50000.)
+md = triangle(model(), '../Exp/Square.exp', 50000.)
 md.mesh.x = md.mesh.x / 1000
 md.mesh.y = md.mesh.y / 1000
-md = setmask(md,'','')
-md = parameterize(md,'../Par/SquareSheetConstrained.py')
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareSheetConstrained.py')
 md.transient = transient().deactivateall()
 md.transient.ishydrology = 1
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',2)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 2)
 
 #Use hydroogy coupled friciton law
@@ -31,5 +31,5 @@
 #Change geometry
 md.geometry.base = -.02 * md.mesh.x + 20.
-md.geometry.thickness = 300. * np.ones((md.mesh.numberofvertices,))
+md.geometry.thickness = 300. * np.ones((md.mesh.numberofvertices, ))
 md.geometry.bed = md.geometry.base
 md.geometry.surface = md.geometry.bed + md.geometry.thickness
@@ -37,58 +37,53 @@
 #define the initial water head as being such that the water pressure is 50% of the ice overburden pressure
 md.hydrology.head = 0.5 * md.materials.rho_ice / md.materials.rho_freshwater * md.geometry.thickness + md.geometry.base
-md.hydrology.gap_height = 0.01 * np.ones((md.mesh.numberofelements,))
-md.hydrology.bump_spacing = 2 * np.ones((md.mesh.numberofelements,))
-md.hydrology.bump_height = 0.05 * np.ones((md.mesh.numberofelements,))
-md.hydrology.englacial_input = 0.5 * np.ones((md.mesh.numberofvertices,))
-md.hydrology.reynolds= 1000. * np.ones((md.mesh.numberofelements,))
-md.hydrology.spchead = float('NaN') * np.ones((md.mesh.numberofvertices,))
+md.hydrology.gap_height = 0.01 * np.ones((md.mesh.numberofelements, ))
+md.hydrology.bump_spacing = 2 * np.ones((md.mesh.numberofelements, ))
+md.hydrology.bump_height = 0.05 * np.ones((md.mesh.numberofelements, ))
+md.hydrology.englacial_input = 0.5 * np.ones((md.mesh.numberofvertices, ))
+md.hydrology.reynolds = 1000. * np.ones((md.mesh.numberofelements, ))
+md.hydrology.spchead = float('NaN') * np.ones((md.mesh.numberofvertices, ))
 pos = np.intersect1d(np.array(np.where(md.mesh.vertexonboundary)), np.array(np.where(md.mesh.x == 1000)))
 md.hydrology.spchead[pos] = md.geometry.base[pos]
 
 #Define velocity
-md.initialization.vx = 1e-6 * md.constants.yts * np.ones((md.mesh.numberofvertices,))
-md.initialization.vy = np.zeros((md.mesh.numberofvertices,))
+md.initialization.vx = 1e-6 * md.constants.yts * np.ones((md.mesh.numberofvertices, ))
+md.initialization.vy = np.zeros((md.mesh.numberofvertices, ))
 
 md.timestepping.time_step = 3. * 3600. / md.constants.yts
 md.timestepping.final_time = .5 / 365.
-md.materials.rheology_B = (5e-25)**(-1. / 3.) * np.ones((md.mesh.numberofvertices,))
+md.materials.rheology_B = (5e-25)**(-1. / 3.) * np.ones((md.mesh.numberofvertices, ))
 
 #Add one moulin and Neumann BC, varying in time
 a = np.sqrt((md.mesh.x - 500.)**2 + (md.mesh.y - 500.)**2)
 pos = min(enumerate(a), key=itemgetter(1))[0]
-time = np.arange(0,md.timestepping.final_time+1,md.timestepping.time_step)
-md.hydrology.moulin_input = np.zeros((md.mesh.numberofvertices+1,np.size(time)))
-md.hydrology.moulin_input[-1,:] = time
-md.hydrology.moulin_input[pos,:] = 5. * (1. - np.sin(2. * np.pi / (1. / 365.) * time))
-md.hydrology.neumannflux = np.zeros((md.mesh.numberofelements+1,np.size(time)))
-md.hydrology.neumannflux[-1,:] = time
-segx = md.mesh.x[md.mesh.segments[:,0]-1]
-segy = md.mesh.y[md.mesh.segments[:,0]-1]
-posA = np.intersect1d(np.intersect1d(np.array(np.where(segx < 1.)),np.array(np.where(segy > 400.))), np.array(np.where(segy < 600.)))
-pos = (md.mesh.segments[posA]-1)[:,2]
-md.hydrology.neumannflux[pos,:] = np.tile(0.05*(1.-np.sin(2.*np.pi/(1./365.)*time)),(len(pos),1))
+time = np.arange(0, md.timestepping.final_time + 1, md.timestepping.time_step)
+md.hydrology.moulin_input = np.zeros((md.mesh.numberofvertices + 1, np.size(time)))
+md.hydrology.moulin_input[-1, :] = time
+md.hydrology.moulin_input[pos, :] = 5. * (1. - np.sin(2. * np.pi / (1. / 365.) * time))
+md.hydrology.neumannflux = np.zeros((md.mesh.numberofelements + 1, np.size(time)))
+md.hydrology.neumannflux[-1, :] = time
+segx = md.mesh.x[md.mesh.segments[:, 0] - 1]
+segy = md.mesh.y[md.mesh.segments[:, 0] - 1]
+posA = np.intersect1d(np.intersect1d(np.array(np.where(segx < 1.)), np.array(np.where(segy > 400.))), np.array(np.where(segy < 600.)))
+pos = (md.mesh.segments[posA] - 1)[:, 2]
+md.hydrology.neumannflux[pos, :] = np.tile(0.05 * (1. - np.sin(2. * np.pi / (1. / 365.) * time)), (len(pos), 1))
 
-md = solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names = [
-	'HydrologyHead1','HydrologyGapHeight1',
-	'HydrologyHead2','HydrologyGapHeight2',
-	'HydrologyHead3','HydrologyGapHeight3',
-	'HydrologyHead4','HydrologyGapHeight4']
-field_tolerances = [
-	1e-13, 1e-13,
-	1e-13, 1e-13,
-	1e-13, 1e-13,
-	1e-13, 1e-12]
-field_values = [
-	md.results.TransientSolution[0].HydrologyHead,
-	md.results.TransientSolution[0].HydrologyGapHeight,
-	md.results.TransientSolution[1].HydrologyHead,
-	md.results.TransientSolution[1].HydrologyGapHeight,
-	md.results.TransientSolution[2].HydrologyHead,
-	md.results.TransientSolution[2].HydrologyGapHeight,
-	md.results.TransientSolution[3].HydrologyHead,
-	md.results.TransientSolution[3].HydrologyGapHeight
-	]
-
+field_names = ['HydrologyHead1', 'HydrologyGapHeight1',
+               'HydrologyHead2', 'HydrologyGapHeight2',
+               'HydrologyHead3', 'HydrologyGapHeight3',
+               'HydrologyHead4', 'HydrologyGapHeight4']
+field_tolerances = [1e-13, 1e-13,
+                    1e-13, 1e-13,
+                    1e-13, 1e-13,
+                    1e-13, 1e-12]
+field_values = [md.results.TransientSolution[0].HydrologyHead,
+                md.results.TransientSolution[0].HydrologyGapHeight,
+                md.results.TransientSolution[1].HydrologyHead,
+                md.results.TransientSolution[1].HydrologyGapHeight,
+                md.results.TransientSolution[2].HydrologyHead,
+                md.results.TransientSolution[2].HydrologyGapHeight,
+                md.results.TransientSolution[3].HydrologyHead,
+                md.results.TransientSolution[3].HydrologyGapHeight]
Index: /issm/trunk/test/NightlyRun/test351.m
===================================================================
--- /issm/trunk/test/NightlyRun/test351.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test351.m	(revision 24313)
@@ -0,0 +1,33 @@
+%Test Name: SquareSheetFrictionTemp
+md=triangle(model(),'../Exp/Square.exp',50000.);
+md.mesh.x = md.mesh.x/1000;
+md.mesh.y = md.mesh.y/1000;
+md=setmask(md,'','');
+md=parameterize(md,'../Par/SquareSheetConstrained.par');
+md=extrude(md,10,3);
+md=setflowequation(md,'HO','all');
+md.cluster=generic('name',oshostname(),'np',4);
+
+%Use hydroogy coupled friciton law
+md.friction=frictiontemp(md.friction);
+md.friction.gamma=5;
+
+% Thermal settings
+md.thermal.isenthalpy=1;
+md.thermal.isdynamicbasalspc=0;
+md.thermal.maxiter=5;
+md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+md.initialization.watercolumn=zeros(md.mesh.numberofvertices,1);
+
+md.basalforcings.geothermalflux=4.2*10^-2*ones(md.mesh.numberofvertices,1);
+
+md.timestepping.time_step=0;
+md=solve(md,'Steadystate');
+
+%Fields and tolerances to track changes
+field_names     ={'Vx','Vy','Vz'};
+field_tolerances={1e-12,1e-12,2e-12};
+field_values={...
+	(md.results.SteadystateSolution.Vx),...
+	(md.results.SteadystateSolution.Vy),...
+	(md.results.SteadystateSolution.Vz)};
Index: /issm/trunk/test/NightlyRun/test352.m
===================================================================
--- /issm/trunk/test/NightlyRun/test352.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test352.m	(revision 24313)
@@ -0,0 +1,64 @@
+%Test Name: SquareSheetConstrainedSmbforcingClim2d
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=setflowequation(md,'SSA','all');
+md.cluster=generic('name',oshostname(),'np',3);
+
+md.timestepping.time_step=0.5;
+md.settings.output_frequency=1;
+md.timestepping.final_time=6.;
+
+%Set up transient
+smb=ones(md.mesh.numberofvertices,1)*3.6;
+smb=[ smb smb*-1. ];
+md.smb.mass_balance=[smb; [1.5 3.]];
+md.transient.isthermal=0;
+
+md.smb.isclimatology=1;
+
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1', ...
+	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2', ...
+	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3', ...
+	'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4'};
+field_tolerances={1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Base),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).SmbMassBalance),...
+	(md.results.TransientSolution(4).Vx),...
+	(md.results.TransientSolution(4).Vy),...
+	(md.results.TransientSolution(4).Vel),...
+	(md.results.TransientSolution(4).Pressure),...
+	(md.results.TransientSolution(4).Base),...
+	(md.results.TransientSolution(4).Surface),...
+	(md.results.TransientSolution(4).Thickness),...
+	(md.results.TransientSolution(4).SmbMassBalance),...
+	(md.results.TransientSolution(8).Vx),...
+	(md.results.TransientSolution(8).Vy),...
+	(md.results.TransientSolution(8).Vel),...
+	(md.results.TransientSolution(8).Pressure),...
+	(md.results.TransientSolution(8).Base),...
+	(md.results.TransientSolution(8).Surface),...
+	(md.results.TransientSolution(8).Thickness),...
+	(md.results.TransientSolution(8).SmbMassBalance),...
+	(md.results.TransientSolution(12).Vx),...
+	(md.results.TransientSolution(12).Vy),...
+	(md.results.TransientSolution(12).Vel),...
+	(md.results.TransientSolution(12).Pressure),...
+	(md.results.TransientSolution(12).Base),...
+	(md.results.TransientSolution(12).Surface),...
+	(md.results.TransientSolution(12).Thickness),...
+	(md.results.TransientSolution(12).SmbMassBalance),...
+	};
Index: /issm/trunk/test/NightlyRun/test352.py
===================================================================
--- /issm/trunk/test/NightlyRun/test352.py	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test352.py	(revision 24313)
@@ -0,0 +1,72 @@
+#Test Name: SquareSheetConstrainedSmbforcingClim2d
+import numpy as np
+from model import *
+from socket import gethostname
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+
+md.timestepping.time_step = 0.5
+md.settings.output_frequency = 1
+md.timestepping.final_time = 6.
+
+#Set up transient
+smb = np.ones((md.mesh.numberofvertices)) * 3.6
+smb = np.vstack((smb, smb * - 1.)).T
+md.smb.mass_balance = np.vstack((smb, [1.5, 3.]))
+md.transient.isthermal = False
+
+md.smb.isclimatology = 1
+
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3',
+               'Vx4', 'Vy4', 'Vel4', 'Pressure4', 'Bed4', 'Surface4', 'Thickness4', 'SmbMassBalance4']
+field_tolerances = [1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[3].Vx,
+                md.results.TransientSolution[3].Vy,
+                md.results.TransientSolution[3].Vel,
+                md.results.TransientSolution[3].Pressure,
+                md.results.TransientSolution[3].Base,
+                md.results.TransientSolution[3].Surface,
+                md.results.TransientSolution[3].Thickness,
+                md.results.TransientSolution[3].SmbMassBalance,
+                md.results.TransientSolution[7].Vx,
+                md.results.TransientSolution[7].Vy,
+                md.results.TransientSolution[7].Vel,
+                md.results.TransientSolution[7].Pressure,
+                md.results.TransientSolution[7].Base,
+                md.results.TransientSolution[7].Surface,
+                md.results.TransientSolution[7].Thickness,
+                md.results.TransientSolution[7].SmbMassBalance,
+                md.results.TransientSolution[11].Vx,
+                md.results.TransientSolution[11].Vy,
+                md.results.TransientSolution[11].Vel,
+                md.results.TransientSolution[11].Pressure,
+                md.results.TransientSolution[11].Base,
+                md.results.TransientSolution[11].Surface,
+                md.results.TransientSolution[11].Thickness,
+                md.results.TransientSolution[11].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test353.m
===================================================================
--- /issm/trunk/test/NightlyRun/test353.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test353.m	(revision 24313)
@@ -0,0 +1,68 @@
+%Test Name: SquareSheetConstrainedSmbComponentsClim2d
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=setflowequation(md,'SSA','all');
+md.cluster=generic('name',oshostname(),'np',3);
+
+md.timestepping.time_step=0.5;
+md.settings.output_frequency=1;
+md.timestepping.final_time=6.;
+
+%Set up transient
+smb=ones(md.mesh.numberofvertices,1)*3.6;
+smb=[ smb smb*-1. ];
+
+md.smb=SMBcomponents();
+md.smb.accumulation=[smb*2; [1.5 3.]];
+md.smb.runoff=[smb/2; [1.5 3.]];
+md.smb.evaporation=[smb/2; [1.5 3.]];
+md.transient.isthermal=0;
+
+md.smb.isclimatology=1;
+
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1', ...
+	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2', ...
+	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3', ...
+	'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4'};
+field_tolerances={1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Base),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).SmbMassBalance),...
+	(md.results.TransientSolution(4).Vx),...
+	(md.results.TransientSolution(4).Vy),...
+	(md.results.TransientSolution(4).Vel),...
+	(md.results.TransientSolution(4).Pressure),...
+	(md.results.TransientSolution(4).Base),...
+	(md.results.TransientSolution(4).Surface),...
+	(md.results.TransientSolution(4).Thickness),...
+	(md.results.TransientSolution(4).SmbMassBalance),...
+	(md.results.TransientSolution(8).Vx),...
+	(md.results.TransientSolution(8).Vy),...
+	(md.results.TransientSolution(8).Vel),...
+	(md.results.TransientSolution(8).Pressure),...
+	(md.results.TransientSolution(8).Base),...
+	(md.results.TransientSolution(8).Surface),...
+	(md.results.TransientSolution(8).Thickness),...
+	(md.results.TransientSolution(8).SmbMassBalance),...
+	(md.results.TransientSolution(12).Vx),...
+	(md.results.TransientSolution(12).Vy),...
+	(md.results.TransientSolution(12).Vel),...
+	(md.results.TransientSolution(12).Pressure),...
+	(md.results.TransientSolution(12).Base),...
+	(md.results.TransientSolution(12).Surface),...
+	(md.results.TransientSolution(12).Thickness),...
+	(md.results.TransientSolution(12).SmbMassBalance),...
+	};
Index: /issm/trunk/test/NightlyRun/test353.py
===================================================================
--- /issm/trunk/test/NightlyRun/test353.py	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test353.py	(revision 24313)
@@ -0,0 +1,76 @@
+#Test Name: SquareSheetConstrainedSmbComponentsClim2d
+import numpy as np
+from model import *
+from socket import gethostname
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+
+md.timestepping.time_step = 0.5
+md.settings.output_frequency = 1
+md.timestepping.final_time = 6.
+
+#Set up transient
+smb = np.ones((md.mesh.numberofvertices)) * 3.6
+smb = np.vstack((smb, smb * - 1.)).T
+
+md.smb = SMBcomponents()
+md.smb.accumulation = np.vstack((smb * 2, [1.5, 3.]))
+md.smb.runoff = np.vstack((smb / 2, [1.5, 3.]))
+md.smb.evaporation = np.vstack((smb / 2, [1.5, 3.]))
+md.transient.isthermal = False
+
+md.smb.isclimatology = 1
+
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3',
+               'Vx4', 'Vy4', 'Vel4', 'Pressure4', 'Bed4', 'Surface4', 'Thickness4', 'SmbMassBalance4']
+field_tolerances = [1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[3].Vx,
+                md.results.TransientSolution[3].Vy,
+                md.results.TransientSolution[3].Vel,
+                md.results.TransientSolution[3].Pressure,
+                md.results.TransientSolution[3].Base,
+                md.results.TransientSolution[3].Surface,
+                md.results.TransientSolution[3].Thickness,
+                md.results.TransientSolution[3].SmbMassBalance,
+                md.results.TransientSolution[7].Vx,
+                md.results.TransientSolution[7].Vy,
+                md.results.TransientSolution[7].Vel,
+                md.results.TransientSolution[7].Pressure,
+                md.results.TransientSolution[7].Base,
+                md.results.TransientSolution[7].Surface,
+                md.results.TransientSolution[7].Thickness,
+                md.results.TransientSolution[7].SmbMassBalance,
+                md.results.TransientSolution[11].Vx,
+                md.results.TransientSolution[11].Vy,
+                md.results.TransientSolution[11].Vel,
+                md.results.TransientSolution[11].Pressure,
+                md.results.TransientSolution[11].Base,
+                md.results.TransientSolution[11].Surface,
+                md.results.TransientSolution[11].Thickness,
+                md.results.TransientSolution[11].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test354.m
===================================================================
--- /issm/trunk/test/NightlyRun/test354.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test354.m	(revision 24313)
@@ -0,0 +1,69 @@
+%Test Name: SquareSheetConstrainedSmbMeltComponentsClim2d
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=setflowequation(md,'SSA','all');
+md.cluster=generic('name',oshostname(),'np',3);
+
+md.timestepping.time_step=0.5;
+md.settings.output_frequency=1;
+md.timestepping.final_time=6.;
+
+%Set up transient
+smb=ones(md.mesh.numberofvertices,1)*3.6;
+smb=[ smb smb*-1. ];
+
+md.smb=SMBmeltcomponents();
+md.smb.accumulation=[smb; [1.5 3.]];
+md.smb.melt=[smb/2; [1.5 3.]];
+md.smb.refreeze=[smb; [1.5 3.]];
+md.smb.evaporation=[smb/2; [1.5 3.]];
+md.transient.isthermal=0;
+
+md.smb.isclimatology=1;
+
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMassBalance1', ...
+	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMassBalance2', ...
+	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMassBalance3', ...
+	'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SmbMassBalance4'};
+field_tolerances={1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Base),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).SmbMassBalance),...
+	(md.results.TransientSolution(4).Vx),...
+	(md.results.TransientSolution(4).Vy),...
+	(md.results.TransientSolution(4).Vel),...
+	(md.results.TransientSolution(4).Pressure),...
+	(md.results.TransientSolution(4).Base),...
+	(md.results.TransientSolution(4).Surface),...
+	(md.results.TransientSolution(4).Thickness),...
+	(md.results.TransientSolution(4).SmbMassBalance),...
+	(md.results.TransientSolution(8).Vx),...
+	(md.results.TransientSolution(8).Vy),...
+	(md.results.TransientSolution(8).Vel),...
+	(md.results.TransientSolution(8).Pressure),...
+	(md.results.TransientSolution(8).Base),...
+	(md.results.TransientSolution(8).Surface),...
+	(md.results.TransientSolution(8).Thickness),...
+	(md.results.TransientSolution(8).SmbMassBalance),...
+	(md.results.TransientSolution(12).Vx),...
+	(md.results.TransientSolution(12).Vy),...
+	(md.results.TransientSolution(12).Vel),...
+	(md.results.TransientSolution(12).Pressure),...
+	(md.results.TransientSolution(12).Base),...
+	(md.results.TransientSolution(12).Surface),...
+	(md.results.TransientSolution(12).Thickness),...
+	(md.results.TransientSolution(12).SmbMassBalance),...
+	};
Index: /issm/trunk/test/NightlyRun/test354.py
===================================================================
--- /issm/trunk/test/NightlyRun/test354.py	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test354.py	(revision 24313)
@@ -0,0 +1,77 @@
+#Test Name: SquareSheetConstrainedSmbMeltComponentsClim2d
+import numpy as np
+from model import *
+from socket import gethostname
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+
+
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+
+md.timestepping.time_step = 0.5
+md.settings.output_frequency = 1
+md.timestepping.final_time = 6.
+
+#Set up transient
+smb = np.ones((md.mesh.numberofvertices)) * 3.6
+smb = np.vstack((smb, smb * - 1.)).T
+
+md.smb = SMBmeltcomponents()
+md.smb.accumulation = np.vstack((smb, [1.5, 3.]))
+md.smb.evaporation = np.vstack((smb / 2, [1.5, 3.]))
+md.smb.melt = np.vstack((smb / 2, [1.5, 3.]))
+md.smb.refreeze = np.vstack((smb, [1.5, 3.]))
+md.transient.isthermal = False
+
+md.smb.isclimatology = 1
+
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMassBalance1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMassBalance2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMassBalance3',
+               'Vx4', 'Vy4', 'Vel4', 'Pressure4', 'Bed4', 'Surface4', 'Thickness4', 'SmbMassBalance4']
+field_tolerances = [1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10,
+                    1e-09, 1e-09, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].SmbMassBalance,
+                md.results.TransientSolution[3].Vx,
+                md.results.TransientSolution[3].Vy,
+                md.results.TransientSolution[3].Vel,
+                md.results.TransientSolution[3].Pressure,
+                md.results.TransientSolution[3].Base,
+                md.results.TransientSolution[3].Surface,
+                md.results.TransientSolution[3].Thickness,
+                md.results.TransientSolution[3].SmbMassBalance,
+                md.results.TransientSolution[7].Vx,
+                md.results.TransientSolution[7].Vy,
+                md.results.TransientSolution[7].Vel,
+                md.results.TransientSolution[7].Pressure,
+                md.results.TransientSolution[7].Base,
+                md.results.TransientSolution[7].Surface,
+                md.results.TransientSolution[7].Thickness,
+                md.results.TransientSolution[7].SmbMassBalance,
+                md.results.TransientSolution[11].Vx,
+                md.results.TransientSolution[11].Vy,
+                md.results.TransientSolution[11].Vel,
+                md.results.TransientSolution[11].Pressure,
+                md.results.TransientSolution[11].Base,
+                md.results.TransientSolution[11].Surface,
+                md.results.TransientSolution[11].Thickness,
+                md.results.TransientSolution[11].SmbMassBalance]
Index: /issm/trunk/test/NightlyRun/test355.m
===================================================================
--- /issm/trunk/test/NightlyRun/test355.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test355.m	(revision 24313)
@@ -0,0 +1,92 @@
+%Test Name: SquareSheetHydrologyGlaDS
+
+%create model:
+md=triangle(model(),'../Exp/Square.exp',50000.);
+md.mesh.x = md.mesh.x/100;
+md.mesh.y = md.mesh.y/100;
+md.miscellaneous.name='testChannels';
+
+%miscellaneous
+md=setmask(md,'',''); %everywhere grounded
+md=setflowequation(md,'SSA','all');
+md.stressbalance.maxiter=2; %Make sure it runs quickly...
+
+%Some constants
+md.constants.g=9.8;
+md.materials.rho_ice=910;
+
+%Geometry
+md.geometry.surface= -.02*md.mesh.x + 320;
+md.geometry.bed = zeros(md.mesh.numberofvertices,1);
+md.geometry.base=md.geometry.bed;
+md.geometry.thickness = md.geometry.surface-md.geometry.bed;
+
+%Define initial conditions
+md.initialization.vx = 10^-6*md.constants.yts*ones(md.mesh.numberofvertices,1);
+md.initialization.vy = zeros(md.mesh.numberofvertices,1);
+md.initialization.temperature=(273.-20.)*ones(md.mesh.numberofvertices,1);
+md.initialization.watercolumn=0.03*ones(md.mesh.numberofvertices,1);
+md.initialization.hydraulic_potential = md.materials.rho_ice*md.constants.g*md.geometry.thickness;
+
+%Materials
+md.materials.rheology_B = (5e-25)^(-1/3) * ones(md.mesh.numberofvertices,1);
+md.materials.rheology_n = 3.*ones(md.mesh.numberofelements,1);
+
+%Friction
+md.friction.coefficient=zeros(md.mesh.numberofvertices,1);
+md.friction.p=ones(md.mesh.numberofelements,1);
+md.friction.q=ones(md.mesh.numberofelements,1);
+%md.friction.coupling=0;
+
+%Boundary conditions:
+md=SetIceSheetBC(md);
+
+md.inversion.iscontrol=0;
+md.transient=deactivateall(md.transient);
+md.transient.ishydrology=1;
+
+% Set numerical conditions
+md.timestepping.time_step=.1/365;
+md.timestepping.final_time=.4/365;
+
+%Change hydrology class to Glads model
+md.hydrology=hydrologyglads();
+md.hydrology.ischannels=1;
+md.hydrology.englacial_void_ratio=1e-5;
+md.hydrology.moulin_input=zeros(md.mesh.numberofvertices,1);
+md.hydrology.neumannflux=zeros(md.mesh.numberofelements,1);
+md.hydrology.bump_height = 1e-1 * ones(md.mesh.numberofvertices,1);
+md.hydrology.sheet_conductivity= 1e-3 * ones(md.mesh.numberofvertices,1);
+
+% BCs for hydrology
+pos=find(md.mesh.x==100 & md.mesh.vertexonboundary);
+md.hydrology.spcphi=NaN(md.mesh.numberofvertices,1);
+md.hydrology.spcphi(pos) = md.materials.rho_ice * md.constants.g * md.geometry.thickness(pos);
+
+md.cluster=generic('np',2);
+md=solve(md,'Transient'); %or 'tr'
+
+%Fields and tolerances to track changes
+field_names ={...
+	'HydrologySheetThickness1','HydraulicPotential1','ChannelArea1',...
+	'HydrologySheetThickness2','HydraulicPotential2','ChannelArea2',...
+	'HydrologySheetThickness3','HydraulicPotential3','ChannelArea3',...
+	'HydrologySheetThickness4','HydraulicPotential4','ChannelArea4',};
+field_tolerances={...
+	1e-13,1e-13,1e-13,...
+	1e-13,1e-13,2e-13,...
+	1e-13,1e-13,7e-13,...
+	1e-13,1e-13,2e-12};
+field_values={...
+	md.results.TransientSolution(1).HydrologySheetThickness, ...
+	md.results.TransientSolution(1).HydraulicPotential,...
+	md.results.TransientSolution(1).ChannelArea,...
+	md.results.TransientSolution(2).HydrologySheetThickness, ...
+	md.results.TransientSolution(2).HydraulicPotential,...
+	md.results.TransientSolution(2).ChannelArea,...
+	md.results.TransientSolution(3).HydrologySheetThickness, ...
+	md.results.TransientSolution(3).HydraulicPotential,...
+	md.results.TransientSolution(3).ChannelArea,...
+	md.results.TransientSolution(4).HydrologySheetThickness, ...
+	md.results.TransientSolution(4).HydraulicPotential,...
+	md.results.TransientSolution(4).ChannelArea};
Index: /issm/trunk/test/NightlyRun/test4001.m
===================================================================
--- /issm/trunk/test/NightlyRun/test4001.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test4001.m	(revision 24313)
@@ -5,4 +5,8 @@
 steps=1:11;
 final_time=1;
+
+!rm -rf $ISSM_DIR/test/MITgcm/install
+!rm -rf $ISSM_DIR/test/MITgcm/build/*
+!rm $ISSM_DIR/test/MITgcm/code/SIZE.h
 
 %Organizer
Index: /issm/trunk/test/NightlyRun/test4002.m
===================================================================
--- /issm/trunk/test/NightlyRun/test4002.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test4002.m	(revision 24313)
@@ -7,7 +7,7 @@
 
 %To download and recompile MITgcm from scratch:
-% rm -rf $ISSM_DIR/test/MITgcm/install
-% rm -rf $ISSM_DIR/test/MITgcm/build
-% rm $ISSM_DIR/test/MITgcm/code/SIZE.h
+!rm -rf $ISSM_DIR/test/MITgcm/install
+!rm -rf $ISSM_DIR/test/MITgcm/build/*
+!rm $ISSM_DIR/test/MITgcm/code/SIZE.h
 
 %Organizer
Index: /issm/trunk/test/NightlyRun/test4003.m
===================================================================
--- /issm/trunk/test/NightlyRun/test4003.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test4003.m	(revision 24313)
@@ -0,0 +1,710 @@
+%Test Name: IceOceanCoupling Dan Goldberg'd setup
+%ISSM/MITgcm coupled set-up
+%
+%Script control parameters
+steps=[1 2 3 4 5 6 7 8 9 10 11];
+final_time=1/365;
+
+%To download and recompile MITgcm from scratch:
+!rm -rf $ISSM_DIR/test/MITgcm/install_dngoldberg
+!rm -rf $ISSM_DIR/test/MITgcm/build/*
+
+%Organizer
+mkdir Models
+org=organizer('repository','Models/','prefix','IceOcean.','steps',steps);
+
+presentdirectory=pwd;
+
+% {{{ Parameters:
+if perform(org,'Parameters'),
+	Nx=3; %number of longitude cells
+	Ny=200; %number of latitude cells
+	Nz=90; %number of MITgcm vertical cells
+	nPx=1; %number of MITgcm processes to use in x direction
+	nPy=1; %number of MITgcm processes to use in y direction
+	xgOrigin=1; %origin of longitude
+	ygOrigin=1; %origin of latitude
+	dLong=1; %longitude grid spacing
+	dLat=1; %latitude grid spacing
+	delZ=10; %thickness of vertical levels
+	icefront_position_ratio=.75;
+	ice_thickness=1000;
+	rho_ice=917;
+	rho_water=1028.14;
+	di=rho_ice/rho_water;
+
+	% MITgcm initial and lateral boundary conditions
+	iniSalt  = 34.4; % initial salinity (PSU)
+	iniTheta = -1.9; % initial potential temperature (deg C)
+	obcSalt  = 34.4; % open boundary salinity (PSU)
+	obcTheta =  1.0; % open boundary potential temperature (deg C)
+	mlDepth  = 120.; % mixed layer depth (m)
+	mlSalt   = 33.4; % open boundary salinity (PSU)
+	mlTheta  = -1.9; % open boundary potential temperature (deg C)
+	obcUvel  = -0.1; % open boundary velocity (m/s)
+
+	MITgcmDeltaT=600; % MITgcm time step in seconds
+	y2s=31536000; % year to seconds conversion, i.e., seconds per year
+
+	% start_time and time_step
+	start_time=0; % in decimal years
+	time_step=1/(365*24); % coupling interval in decimal years
+	async_step_MITgcm_multiplier=1; % used to reduce run time for MItgcm
+
+	% bedrock/bathymetry
+	hmax=1000;
+	trough_depth=200;
+	deltah=300;
+	sea_level=1095;
+
+	% issm settings:
+	numlayers=10;
+
+	savedata(org, Nx, Ny, nPx, nPy, Nz, dLong, dLat, delZ, xgOrigin, ...
+		ygOrigin, icefront_position_ratio, ice_thickness, rho_ice, ...
+		rho_water, di, hmax, trough_depth, deltah, sea_level, ...
+		iniSalt, iniTheta, obcSalt, obcTheta, mlDepth, mlSalt, ...
+		mlTheta, obcUvel, start_time, time_step, MITgcmDeltaT, y2s,...
+		numlayers,async_step_MITgcm_multiplier);
+end
+% }}}
+% {{{ Bathymetry:
+if perform(org,'Bathymetry'),
+
+    loaddata(org,'Parameters');
+    %create lat,long
+    lat=(ygOrigin+dLat/2):dLat:(ygOrigin+Ny*dLat);
+    long=(xgOrigin+dLong/2):dLong:(xgOrigin+Nx*dLong);
+    [lat long]=meshgrid(lat,long);
+
+    longmin=min(long(:));
+    longmax=max(long(:));
+    latmin=min(lat(:));
+    latmax=max(lat(:));
+
+    %create bedrock/bathymetry:
+    bedrock=zeros(Nx,Ny);
+    bedrock=hmax-deltah*tanh(pi*(2*(lat-latmin)./(latmax-latmin)-1))+ ...
+            trough_depth*cos(2*pi*long./(longmax-longmin));
+
+    %save bathymetry file for MITgcm
+    bathymetry=bedrock-sea_level;
+    savedata(org,lat,long,bathymetry);
+
+end
+% }}}
+% {{{ IceSheetGeometry:
+if perform(org,'IceSheetGeometry'),
+
+	loaddata(org,'Parameters');
+	loaddata(org,'Bathymetry');
+	latmin=min(lat(:));
+	latmax=max(lat(:));
+
+	%put ice_thickness constant layer of ice over the bathymetry, unless it floats:
+	s=size(bathymetry);
+	thickness=ice_thickness*ones(s);
+
+	%figure out ice shelf:
+	pos=find(-di*thickness>bathymetry);
+	iceshelf_mask=zeros(s);
+	iceshelf_mask(pos)=1;
+
+	ice_mask=ones(s);
+	pos=find((lat-latmin)/(latmax-latmin)>(icefront_position_ratio));
+	ice_mask(pos)=0;
+	iceshelf_mask(pos)=0;
+
+	%compute draft of ice shelf:
+	draft=bathymetry;
+	pos=find(iceshelf_mask);
+	draft(pos)=-di*thickness(pos);
+	pos=find(~ice_mask);
+	draft(pos)=0;
+
+	savedata(org,ice_mask,iceshelf_mask,draft,thickness);
+end
+% }}}
+
+%Configure MITgcm
+% {{{ GetMITgcm:
+if perform(org,'GetMITgcm'),
+  system([pwd '/../MITgcm/get_mitgcm_dngoldberg.sh']);
+end
+% }}}
+% {{{ BuildMITgcm:
+if perform(org,'BuildMITgcm'),
+    system(['../MITgcm/build_4003.sh generic ' pwd '/../MITgcm']);
+end
+% }}}
+addpath(recursivepath([pwd '/../MITgcm']));
+% {{{ RunUncoupledMITgcm:
+if perform(org,'RunUncoupledMITgcm'),
+    % rename previous run directory and create new one
+    if exist ('run.old')
+        !\rm -rf run.old
+    end
+    if exist ('run')
+        !\mv run run.old
+    end
+    !\mkdir run
+    !\cp ../MITgcm/build/mitgcmuv run
+    !\cp ../MITgcm/install_dngoldberg/verification/shelfice_remeshing/input/* run
+    !\cp ../MITgcm/input_4003/* run
+    !\cp ../MITgcm/input_4003/data_uncoupled run/data
+    !\cp ../MITgcm/input_4003/eedata_uncoupled run/eedata
+    cd run
+    eval(['!mpirun -np ' int2str(nPx*nPy) ' ./mitgcmuv']);
+	 cd ..
+end
+% }}}
+
+%Configure ISSM
+% {{{ CreateMesh:
+if perform(org,'CreateMesh'),
+
+	%create model:
+	md=model();
+
+	%Grab lat,long from MITgcm:
+	long=readbin('run/XG.data',[3 200]);
+	long=[long long(:,end)]; long=[long; -105.1250*ones(1,size(long,2))];
+	lat=readbin('run/YG.data',[3 200]);
+	lat=[lat -73.8832*ones(size(lat,1),1)]; lat=[lat; lat(end,:)];
+
+	%project lat,long:
+	[x,y]=ll2xy(lat(:),long(:),-1);
+
+	Nx=size(lat,1); Ny=size(lat,2)
+	index=[];
+	%  C  D
+	%  A  B
+	for j=1:Ny-1,
+		for i=1:Nx-1,
+			A=(j-1)*Nx+i;
+			B=(j-1)*Nx+i+1;
+			C=j*Nx+i;
+			D=j*Nx+i+1;
+			index(end+1,:)=[A B C];
+			index(end+1,:)=[C B D];
+		end
+	end
+
+	%fill mesh and model:
+	md=meshconvert(md,index,x,y);
+	md.mesh.lat=lat(:);
+	md.mesh.long=long(:);
+
+	savemodel(org,md);
+
+end
+% }}}
+% {{{ MeshGeometry:
+if perform(org,'MeshGeometry'),
+
+	loaddata(org,'CreateMesh');
+
+	%transfer to vertices:
+	bathymetry=readbin('run/bathy.box',[3 200],1,'real*8');
+	bathymetry=[bathymetry bathymetry(:,end)]; bathymetry=[bathymetry(1,:); bathymetry];
+	iceshelf_mask=-1*ones(size(bathymetry));
+	ice_mask=readbin('run/hmask3.box',[3 200],1,'real*8');
+	ice_mask=[ice_mask ice_mask(:,end)]; ice_mask=[ice_mask(1,:); ice_mask];
+	thickness=readbin('run/h0.bin',[3 200],1,'real*8');
+	thickness=[thickness thickness(:,end)]; thickness=[thickness; thickness(end,:)];
+
+	%start filling some of the fields
+	md.geometry.bed=bathymetry(:);
+	md.geometry.thickness=thickness(:);
+	md.geometry.base=-917/1028*md.geometry.thickness;
+	md.geometry.surface=md.geometry.base+md.geometry.thickness;
+
+	%nothing passes icefront:
+	pos=find((~ice_mask(:) & ice_mask(:)~=0) | thickness(:)==0);
+	md.geometry.thickness(pos)=1;
+	md.geometry.surface(pos)=(1-di)*md.geometry.thickness(pos);
+	md.geometry.base(pos)=-di*md.geometry.thickness(pos);
+
+	%level sets:
+	md.mask.groundedice_levelset=iceshelf_mask(:);
+	md.mask.ice_levelset=-ones(md.mesh.numberofvertices,1);
+
+	pos=find(~ice_mask(:) & thickness(:)==0); md.mask.ice_levelset(pos)=1;
+
+	savemodel(org,md);
+end
+% }}}
+% {{{ ParameterizeIce:
+if perform(org,'ParameterizeIce'),
+
+	loaddata(org,'MeshGeometry');
+
+	%miscellaneous
+	md.miscellaneous.name='test4003';
+
+	%initial velocity:
+	md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+	md.initialization.vy=zeros(md.mesh.numberofvertices,1);
+	md.initialization.vz=zeros(md.mesh.numberofvertices,1);
+
+	%friction:
+	md.friction.coefficient=0*ones(md.mesh.numberofvertices,1);
+	pos=find(md.mask.groundedice_levelset>0);
+	md.friction.coefficient(pos)=5;
+	md.friction.p=ones(md.mesh.numberofelements,1);
+	md.friction.q=ones(md.mesh.numberofelements,1);
+
+	%temperatures and surface mass balance:
+	md.initialization.temperature=(273.15-22)*ones(md.mesh.numberofvertices,1);
+	md.initialization.pressure=md.materials.rho_ice*md.constants.g*(md.geometry.surface-md.geometry.base);
+	md.smb.mass_balance = 0*ones(md.mesh.numberofvertices,1);
+
+	%Flow law
+	md.materials.rheology_B=paterson(md.initialization.temperature);
+	md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
+	md.damage.D=zeros(md.mesh.numberofvertices,1);
+	md.damage.spcdamage=NaN*ones(md.mesh.numberofvertices,1);
+
+	%the spcs going
+	md.stressbalance.spcvx=NaN*ones(md.mesh.numberofvertices,1);
+	md.stressbalance.spcvy=NaN*ones(md.mesh.numberofvertices,1);
+	md.stressbalance.spcvz=NaN*ones(md.mesh.numberofvertices,1);
+	md.stressbalance.referential=NaN*ones(md.mesh.numberofvertices,6);
+	md.stressbalance.loadingforce=0*ones(md.mesh.numberofvertices,3);
+	md.masstransport.spcthickness=NaN*ones(md.mesh.numberofvertices,1);
+
+	%get some flux at the ice divide:
+	pos=find(md.mesh.lat==min(md.mesh.lat));
+	md.masstransport.spcthickness(pos)=md.geometry.thickness(pos);
+	md.stressbalance.spcvx(pos)=-800;
+	md.stressbalance.spcvy(pos)=0;
+
+	%deal with boundaries, excluding icefront:
+	pos=find(md.mesh.long==min(md.mesh.long) | md.mesh.long==max(md.mesh.long));
+	md.stressbalance.spcvy(pos)=0;
+
+	point1=find(md.mesh.y==min(md.mesh.y)); point2=find(md.mesh.x==max(md.mesh.x));
+	costheta=(md.mesh.x(point2)-md.mesh.x(point1))/sqrt((md.mesh.x(point2)-md.mesh.x(point1)).^2+(md.mesh.y(point2)-md.mesh.y(point1)).^2);
+	sintheta=(md.mesh.y(point2)-md.mesh.y(point1))/sqrt((md.mesh.x(point2)-md.mesh.x(point1)).^2+(md.mesh.y(point2)-md.mesh.y(point1)).^2);
+	md.stressbalance.referential(:,1:3)=repmat([costheta,sintheta,0],md.mesh.numberofvertices,1);
+	md.stressbalance.referential(:,4:6)=repmat([-sintheta,costheta,0],md.mesh.numberofvertices,1);
+
+	md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+	md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+	md.thermal.spctemperature=[md.initialization.temperature; 1]; %impose observed temperature on surface
+	md.basalforcings.geothermalflux=.064*ones(md.mesh.numberofvertices,1);
+
+	%flow equations:
+	md=setflowequation(md,'SSA','all');
+
+	savemodel(org,md);
+end
+% }}}
+% {{{ RunUncoupledISSM:
+if perform(org,'RunUncoupledISSM'),
+
+	loaddata(org,'Parameters');
+	loaddata(org,'ParameterizeIce');
+
+	%timestepping:
+	md.timestepping.final_time=100;
+	md.timestepping.time_step=0.5;
+	md.transient.isgroundingline=0;
+	md.transient.isthermal=0;
+	md.groundingline.migration='SubelementMigration';
+	md.groundingline.melt_interpolation='NoMeltOnPartiallyFloating';
+	md.groundingline.friction_interpolation='SubelementFriction2';
+	md.masstransport.stabilization=0;
+
+	md.cluster=generic('name',oshostname(),'np',2);
+	md=solve(md,'Transient');
+
+	savemodel(org,md);
+
+	plotmodel(md,'data',md.results.TransientSolution(end).Vel,'data',md.results.TransientSolution(end).Thickness)
+end
+% }}}
+
+%Run MITgcm/ISSM
+% {{{ RunCoupledMITgcmISSM:
+if perform(org,'RunCoupledMITgcmISSM'),
+
+	loaddata(org,'Parameters');
+	loaddata(org,'ParameterizeIce');
+
+	md=loadmodel(org,'RunUncoupledISSM');
+
+		endtime = round(MITgcmDeltaT * floor(final_time*y2s/MITgcmDeltaT));
+		outputtime = round(MITgcmDeltaT * floor(time_step*y2s/MITgcmDeltaT));
+
+        % {{{ prepare ISSM: start from the steady-state
+
+		  md.geometry.base=md.results.TransientSolution(end).Base;
+		  md.geometry.surface=md.results.TransientSolution(end).Surface;
+		  md.geometry.thickness=md.results.TransientSolution(end).Thickness;
+		  md.initialization.vx=md.results.TransientSolution(end).Vx;
+		  md.initialization.vy=md.results.TransientSolution(end).Vy;
+		  md.initialization.vel=md.results.TransientSolution(end).Vel;
+		  md.initialization.pressure=md.results.TransientSolution(end).Pressure;
+		  md.transient.isoceancoupling=1;
+		  md.transient.isgroundingline=0;
+		  md.masstransport.requested_outputs={'default','BasalforcingsFloatingiceMeltingRate'};
+
+        % }}}
+        % {{{ prepare MITgcm
+        % rename previous run directory and create new one
+        if exist ('run.old')
+            !\rm -rf run.old
+        end
+        if exist ('run')
+            !\mv run run.old
+        end
+        !\mkdir run
+        !\cp ../MITgcm/build/mitgcmuv run
+        !\cp ../MITgcm/install_dngoldberg/verification/shelfice_remeshing/input/* run
+        !\cp ../MITgcm/input_4003/* run
+        % }}}
+		  md.timestepping.coupling_time=time_step;
+		  md.timestepping.time_step=time_step;
+		  md.timestepping.final_time=final_time-time_step;
+		  md.cluster.npocean=nPx*nPy;
+		  md.cluster.np=2;
+		  md.cluster.executionpath=[pwd '/run'];
+		  md.transient.requested_outputs={'default','MaskGroundediceLevelset'};
+
+		  md=solveiceocean(md,'Transient','runtimename',false);
+
+%	%eval(['!mpiexec -np ' int2str(md.cluster.np) ' ' md.cluster.codepath '/issm_ocean.exe TransientSolution ' pwd ' ' md.miscellaneous.name ' ']);
+%	eval(['!mpiexec -np ' int2str(md.cluster.np) ' ' md.cluster.codepath '/issm_ocean.exe TransientSolution ' pwd ' ' md.miscellaneous.name ' : -np ' int2str(nPx*nPy) ' ./mitgcmuv']);
+end
+% }}}
+% {{{ RunCoupledMITgcmISSMMatlabCoupling:
+if perform(org,'RunCoupledMITgcmISSMMatlabCoupling'),
+
+	%load data:
+	loaddata(org,'Parameters');
+	loaddata(org,'ParameterizeIce');
+	loaddata(org,'Bathymetry');
+	loaddata(org,'IceSheetGeometry');
+        endtime = round(MITgcmDeltaT * ...
+         floor(time_step*y2s*async_step_MITgcm_multiplier/MITgcmDeltaT));
+
+        % {{{ prepare MITgcm
+        % rename previous run directory and create new one
+        if exist ('run.old')
+            !\rm -rf run.old
+        end
+        if exist ('run')
+            !\mv run run.old
+        end
+        !\mkdir run
+        !\cp ../MITgcm/build/mitgcmuv run
+        !\cp ../MITgcm/input/* run
+        !\cp ../MITgcm/input/eedata_uncoupled run/eedata
+
+        % initial salinity
+        S=iniSalt*ones(Nx,Ny,Nz);
+        writebin('run/Salt.bin',S);
+
+        % initial temperature
+        T=iniTheta*ones(Nx,Ny,Nz);
+        writebin('run/Theta.bin',T);
+
+        % initial velocity
+        Z=zeros(Nx,Ny,Nz);
+        writebin('run/Uvel.bin',Z);
+        writebin('run/Vvel.bin',Z);
+
+        % initial sea surface height
+        Z=zeros(Nx,Ny);
+        writebin('run/Etan.bin',Z);
+
+        % salinity boundary conditions
+        S=obcSalt*ones(Ny,Nz);
+        thk=delZ*ones(Nz,1);
+        bot=cumsum(thk);
+        ik=find(bot<=mlDepth);
+        S(:,ik)=mlSalt;
+        writebin('run/OBs.bin',S);
+
+        % temperature boundary conditions
+        T=obcTheta*ones(Ny,Nz);
+        T(:,ik)=mlTheta;
+        writebin('run/OBt.bin',T);
+
+        % zonal velocity boundary conditions
+        U=obcUvel*ones(Ny,Nz);
+        writebin('run/OBu.bin',U);
+
+        % zero boundary conditions
+        Z=zeros(Ny,Nz);
+        writebin('run/zeros.bin',Z);
+
+        % build parameter file data.obcs
+        fidi=fopen('../MITgcm/input/data.obcs','r');
+        fido=fopen('run/data.obcs','w');
+        tline = fgetl(fidi);
+        fprintf(fido,'%s\n',tline);
+        while 1
+            tline = fgetl(fidi);
+            if ~ischar(tline), break, end
+            %do the change here:
+            if strcmpi(tline,' OB_Iwest = 40*1,'),
+                fprintf(fido,'%s%i%s\n',' OB_Iwest = ',Ny,'*1,');
+                continue;
+            end
+            if strcmpi(tline,' OB_Ieast = 40*-1,'),
+                fprintf(fido,'%s%i%s\n',' OB_Ieast = ',Ny,'*-1,');
+                continue;
+            end
+            fprintf(fido,'%s\n',tline);
+        end
+        %close  files
+        fclose(fidi);
+        fclose(fido);
+
+        %save bathymetry in MITgcm run directory
+        writebin('run/bathymetry.bin',bathymetry);
+        % }}}
+
+	% {{{ ISSM settings:
+
+	setenv('DYLD_LIBRARY_PATH', '/usr/local/gfortran/lib')
+	%timestepping:
+	md.timestepping.start_time=start_time;
+	md.timestepping.final_time=final_time;
+	md.timestepping.time_step=time_step;
+	md.cluster=generic('name',oshostname(),'np',2);
+	md.results.TransientSolution.Base=md.geometry.base;
+	md.transient.isgroundingline=1;
+	md.transient.isthermal=0;
+	md.groundingline.migration='SubelementMigration';
+	md.groundingline.melt_interpolation='NoMeltOnPartiallyFloating';
+	md.groundingline.friction_interpolation='SubelementFriction2';
+
+	% }}}
+
+	%start looping:
+	results=md.results;
+
+	for t=start_time:time_step:final_time
+            disp(['Year: ' num2str(t)])
+
+	    %send draft from ISSM to MITgcm:
+	    draft=md.results.TransientSolution(end).Base;
+	    pos=find(md.mask.ice_levelset>0); draft(pos)=0;
+            if t>start_time
+                old_draft=readbin('run/icetopo.bin',[Nx,Ny]);
+            end
+            writebin('run/icetopo.bin',draft);
+
+	    % {{{ generate MITgcm parameter file data
+	    fidi=fopen('../MITgcm/input/data','r');
+	    fido=fopen('run/data','w');
+	    tline = fgetl(fidi);
+	    fprintf(fido,'%s\n',tline);
+            while 1
+                tline = fgetl(fidi);
+                if ~ischar(tline), break, end
+		%do the change here:
+		if strcmpi(tline,' xgOrigin = 0.0,'),
+		    fprintf(fido,'%s%i%s\n',' xgOrigin = ',xgOrigin,',');
+		    continue;
+		end
+		if strcmpi(tline,' ygOrigin = -80.0,'),
+		    fprintf(fido,'%s%i%s\n',' ygOrigin = ',ygOrigin,',');
+		    continue;
+		end
+		if strcmpi(tline,' delX = 20*0.25,'),
+		    fprintf(fido,'%s%i*%g%s\n',' delX = ',Nx,dLong,',');
+		    continue;
+		end
+		if strcmpi(tline,' delY = 20*0.25,'),
+		    fprintf(fido,'%s%i*%g%s\n',' delY = ',Ny,dLat,',');
+		    continue;
+		end
+                if strcmpi(tline,' delZ = 30*30.0,'),
+                    fprintf(fido,'%s%i*%g%s\n',' delZ = ',Nz,delZ,',');
+                    continue;
+                end
+		if strcmpi(tline,' endTime=2592000.,'),
+		    fprintf(fido,'%s%i%s\n',' endTime= ',endtime,',');
+		    continue;
+		end
+		if strcmpi(tline,' deltaT=1200.0,'),
+		    fprintf(fido,'%s%i%s\n',' deltaT= ',MITgcmDeltaT,',');
+		    continue;
+		end
+		if strcmpi(tline,' pChkptFreq=2592000.,'),
+		    fprintf(fido,'%s%i%s\n',' pChkptFreq= ',endtime,',');
+		    continue;
+		end
+		if strcmpi(tline,' taveFreq=2592000.,'),
+		    fprintf(fido,'%s%i%s\n',' taveFreq= ',endtime,',');
+		    continue;
+		end
+                if strcmpi(tline,' rhoConst=1030.,'),
+                    fprintf(fido,'%s%i%s\n',' rhoConst= ',rho_water,',');
+                    continue;
+                end
+                if strcmpi(tline,' rhoNil=1030.,'),
+                    fprintf(fido,'%s%i%s\n',' rhoNil= ',rho_water,',');
+                    continue;
+                end
+		fprintf(fido,'%s\n',tline);
+	    end
+	    %close  files
+	    fclose(fidi);
+	    fclose(fido);
+	    % }}}
+
+	    % {{{ generate initial MITgcm conditions
+            ds=round(endtime/MITgcmDeltaT);
+            if t>start_time
+                % Read pickup file
+                fnm=['run/pickup.' myint2str(ds,10) '.data'];
+                U=readbin(fnm,[Nx Ny Nz],1,'real*8',0);
+                V=readbin(fnm,[Nx Ny Nz],1,'real*8',1);
+                T=readbin(fnm,[Nx Ny Nz],1,'real*8',2);
+                S=readbin(fnm,[Nx Ny Nz],1,'real*8',3);
+                E=readbin(fnm,[Nx Ny],1,'real*8',8*Nz);
+
+                % find indices of locations where ice shelf retreated
+                h=readbin('run/hFacC.data',[Nx Ny Nz]);
+                msk=sum(h,3);
+                msk(find(msk))=1;
+                [iw jw]=find(msk); % horizontal indices where there is water
+                tmp=reshape(draft,[Nx,Ny])-old_draft;
+                tmp(find(tmp<0))=0;
+                [im jm]=find(tmp); % horizontal indices where there is melt
+
+                % Extrapolate T/S to locations where ice shelf retreated
+                for i=1:length(im)
+
+                    % first try vertical extrapolation
+                    in=find(h(im(i),jm(i),:));
+                    if length(in)>0;
+                        S(im(i),jm(i),1:min(in)  ) = S(im(i),jm(i),min(in));
+                        T(im(i),jm(i),1:min(in)  ) = T(im(i),jm(i),min(in));
+                        continue
+                    end
+
+                    % if not succesful, use closest neighbor horizontal extrapolation
+                    [y c]=min((iw-im(i)).^2+(jw-jm(i)).^2);
+                    salt=squeeze(S(iw(c),jw(c),:)); % salinity profile of closest neighbor
+                    temp=squeeze(T(iw(c),jw(c),:)); % salinity profile of closest neighbor
+                    in=find(h(iw(c),jw(c),:));
+                    salt(1:min(in))=salt(min(in));
+                    temp(1:min(in))=temp(min(in));
+                    salt(max(in):end)=salt(max(in));
+                    temp(max(in):end)=temp(max(in));
+                    S(im(i),jm(i),:)=salt;
+                    T(im(i),jm(i),:)=temp;
+                end
+
+                % Write initial conditions
+                writebin('run/Salt.bin' ,S);
+                writebin('run/Theta.bin',T);
+                writebin('run/Uvel.bin' ,U);
+                writebin('run/Vvel.bin' ,V);
+                writebin('run/Etan.bin' ,E);
+            end
+            % }}}
+
+            % {{{ system call to run MITgcm
+            cd run
+            eval(['!mpiexec -np ' int2str(nPx*nPy) ' ./mitgcmuv']);
+            ts=round((t+time_step)*y2s/MITgcmDeltaT);
+            eval(['!\mv STDERR.0000 STDERR_' myint2str(ts,10) '.data'])
+            eval(['!\mv STDOUT.0000 STDOUT_' myint2str(ts,10) '.data'])
+            eval(['!\cp hFacC.data hFacC_' myint2str(ts,10) '.data'])
+            eval(['!\cp icetopo.bin icetopo_' myint2str(ts,10) '.data'])
+            for fld={'S','T','U','V','Eta', ...
+                     'SHICE_heatFluxtave','SHICE_fwFluxtave'}
+                eval(['!\mv ' fld{1} '.' myint2str(ds,10) '.data ' ...
+                      fld{1} '_' myint2str(ts,10) '.data'])
+            end
+            cd ..
+            % }}}
+
+	    %get melting rates from MITgcm
+	    %upward fresh water flux (kg/m^2/s):
+	    fnm=['run/SHICE_fwFluxtave_' myint2str(ts,10) '.data'];
+	    melting_rate=readbin(fnm,[Nx Ny]);
+
+	    %send averaged melting rate to ISSM
+	    %downward fresh water flux (m/y):
+	    melting_rate=-melting_rate(:)*y2s/rho_ice;
+		 md.basalforcings.floatingice_melting_rate=melting_rate;
+
+	    % {{{ run ISSM and recover results
+
+	    md.timestepping.start_time=t;
+	    md.timestepping.final_time=t+time_step;;
+		md=solve(md,'Transient');
+
+		base=md.results.TransientSolution(end).Base;
+		thickness=md.results.TransientSolution(end).Thickness;
+		md.geometry.base=base;
+		md.geometry.thickness=thickness;
+		md.geometry.surface=md.geometry.base+md.geometry.thickness;
+		md.initialization.vx=md.results.TransientSolution(end).Vx;
+		md.initialization.vy=md.results.TransientSolution(end).Vy;
+		md.initialization.vel=md.results.TransientSolution(end).Vel;
+		md.initialization.pressure=md.results.TransientSolution(end).Pressure;
+		md.mask.groundedice_levelset=md.results.TransientSolution(end).MaskGroundediceLevelset;
+		md.results.TransientSolution(end).FloatingiceMeltingRate=md.basalforcings.floatingice_melting_rate;
+
+		%save these results in the model, otherwise, they'll be wiped out
+		results(end+1)=md.results;
+
+		% }}}
+
+
+	end
+
+	md.results=results;
+	savemodel(org,md);
+end
+% }}}
+
+%Fields and tolerances to track changes
+fnm=['run/SHICE_fwFlux.0000011400.data'];
+melting_rate_1=readbin(fnm,[Nx Ny]);
+fnm=['run/SHICE_fwFlux.0000011450.data'];
+melting_rate_2=readbin(fnm,[Nx Ny]);
+fnm=['run/SHICE_fwFlux.0000011500.data'];
+melting_rate_3=readbin(fnm,[Nx Ny]);
+fnm=['run/SHICE_fwFlux.0000011550.data'];
+melting_rate_4=readbin(fnm,[Nx Ny]);
+field_names     ={'Base1','Melting1','Vx2','Vy2','Thickness2','Base2','MaskGroundediceLevelset2','FloatingiceMeltingRate2',...
+	'Melting2','Vx3','Vy3','Thickness3','Base3','MaskGroundediceLevelset3','FloatingiceMeltingRate3',...
+	'Melting3','Vx4','Vy4','Thickness4','Base4','MaskGroundediceLevelset4','FloatingiceMeltingRate4','Melting4'};
+field_tolerances={2e-13,1e-13,7e-13,7e-13,1e-13,1e-13,1e-13,1e-12,...
+	1e-13, 1e-12, 1e-12, 1e-13, 1e-13, 1e-13, 1e-12,...
+	1e-13, 1e-12, 1e-12, 1e-13, 1e-13, 1e-13, 1e-12, 1e-13 };
+field_values={...
+	(md.results.TransientSolution(1).Base),...
+	(melting_rate_1(:)),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).Base),...
+	(md.results.TransientSolution(2).MaskGroundediceLevelset),...
+	(md.results.TransientSolution(2).BasalforcingsFloatingiceMeltingRate),...
+	(melting_rate_2(:)),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Thickness),...
+	(md.results.TransientSolution(3).Base),...
+	(md.results.TransientSolution(3).MaskGroundediceLevelset),...
+	(md.results.TransientSolution(3).BasalforcingsFloatingiceMeltingRate),...
+	(melting_rate_3(:)),...
+	(md.results.TransientSolution(4).Vx),...
+	(md.results.TransientSolution(4).Vy),...
+	(md.results.TransientSolution(4).Thickness),...
+	(md.results.TransientSolution(4).Base),...
+	(md.results.TransientSolution(4).MaskGroundediceLevelset),...
+	(md.results.TransientSolution(4).BasalforcingsFloatingiceMeltingRate),...
+	(melting_rate_4(:)),...
+	};
Index: /issm/trunk/test/NightlyRun/test401.py
===================================================================
--- /issm/trunk/test/NightlyRun/test401.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test401.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfStressSSA2d
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,18 +9,16 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vel','Pressure']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test402.py
===================================================================
--- /issm/trunk/test/NightlyRun/test402.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test402.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfStressSSA3d
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,20 +9,18 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(4,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(4, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test403.py
===================================================================
--- /issm/trunk/test/NightlyRun/test403.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test403.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfStressHO
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,20 +9,18 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(5,1.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(5, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[3e-09,3e-09,3e-09,3e-09,3e-09]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [3e-09, 3e-09, 3e-09, 3e-09, 3e-09]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test404.m
===================================================================
--- /issm/trunk/test/NightlyRun/test404.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test404.m	(revision 24313)
@@ -10,5 +10,5 @@
 %Fields and tolerances to track changes
 field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
-field_tolerances={2e-06,2e-06,2e-06,1e-06,6e-07};
+field_tolerances={2e-06,4e-06,2e-06,1e-06,8e-07};
 field_values={...
 	(md.results.StressbalanceSolution.Vx),...
Index: /issm/trunk/test/NightlyRun/test404.py
===================================================================
--- /issm/trunk/test/NightlyRun/test404.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test404.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfStressFS
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,20 +9,18 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'FS','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'FS', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[2e-06,2e-06,2e-06,1e-06,6e-07]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [2e-06, 4e-06, 2e-06, 1e-06, 8e-07]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test405.m
===================================================================
--- /issm/trunk/test/NightlyRun/test405.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test405.m	(revision 24313)
@@ -5,4 +5,5 @@
 md=extrude(md,5,1.);
 md=setflowequation(md,'SSA','../Exp/SquareHalfRight.exp','fill','HO','coupling','penalties');
+md.settings.solver_residue_threshold = 1.e-4;
 md.cluster=generic('name',oshostname(),'np',3);
 md=solve(md,'Stressbalance');
Index: /issm/trunk/test/NightlyRun/test405.py
===================================================================
--- /issm/trunk/test/NightlyRun/test405.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test405.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfStressMHOPenalties
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,20 +9,19 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(5,1.)
-md=setflowequation(md,'SSA','../Exp/SquareHalfRight.exp','fill','HO','coupling','penalties')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(5, 1.)
+md = setflowequation(md, 'SSA', '../Exp/SquareHalfRight.exp', 'fill', 'HO', 'coupling', 'penalties')
+md.settings.solver_residue_threshold = 1.e-4
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[5e-05,5e-05,5e-05,5e-05,1e-05]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [5e-05, 5e-05, 5e-05, 5e-05, 1e-05]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test406.py
===================================================================
--- /issm/trunk/test/NightlyRun/test406.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test406.py	(revision 24313)
@@ -1,7 +1,5 @@
 #Test Name: SquareSheetShelfTherStea
-import numpy as np
 from model import *
 from socket import gethostname
-
 from triangle import *
 from setmask import *
@@ -10,18 +8,16 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(4,1.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.timestepping.time_step=0.
-md=solve(md,'Thermal')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(4, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.timestepping.time_step = 0.
+md = solve(md, 'Thermal')
 
 #Fields and tolerances to track changes
-field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-13,1e-5]
-field_values=[\
-	md.results.ThermalSolution.Temperature,\
-	md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-13, 1e-5]
+field_values = [md.results.ThermalSolution.Temperature,
+                md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test407.py
===================================================================
--- /issm/trunk/test/NightlyRun/test407.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test407.py	(revision 24313)
@@ -1,7 +1,5 @@
 #Test Name: SquareSheetShelfTherTran
-import numpy as np
 from model import *
 from socket import gethostname
-
 from triangle import *
 from setmask import *
@@ -10,22 +8,20 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(4,1.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.transient.isstressbalance=False
-md.transient.ismasstransport=False
-md.transient.issmb=True
-md.transient.isthermal=True
-md.transient.isgroundingline=False
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(4, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.isstressbalance = False
+md.transient.ismasstransport = False
+md.transient.issmb = True
+md.transient.isthermal = True
+md.transient.isgroundingline = False
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test408.py
===================================================================
--- /issm/trunk/test/NightlyRun/test408.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test408.py	(revision 24313)
@@ -11,62 +11,60 @@
 from frictioncoulomb import frictioncoulomb
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.geometry.bed=copy.deepcopy(md.geometry.base)
-pos=np.nonzero(md.mask.groundedice_levelset<0.)
-md.geometry.bed[pos]=md.geometry.bed[pos]-10
-md.friction=frictioncoulomb()
-md.friction.coefficient=20*np.ones(md.mesh.numberofvertices)
-md.friction.p=1*np.ones(md.mesh.numberofelements)
-md.friction.q=1*np.ones(md.mesh.numberofelements)
-md.friction.coefficientcoulomb=0.02*np.ones(md.mesh.numberofvertices)
-md.transient.isthermal=False
-md.transient.isgroundingline=True
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.transient.requested_outputs=['default','GroundedArea','FloatingArea','TotalFloatingBmb','TotalGroundedBmb','TotalSmb']
-md.extrude(3,1.)
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.geometry.bed = copy.deepcopy(md.geometry.base)
+pos = np.nonzero(md.mask.groundedice_levelset < 0.)
+md.geometry.bed[pos] = md.geometry.bed[pos] - 10
+md.friction = frictioncoulomb()
+md.friction.coefficient = 20 * np.ones(md.mesh.numberofvertices)
+md.friction.p = 1 * np.ones(md.mesh.numberofelements)
+md.friction.q = 1 * np.ones(md.mesh.numberofelements)
+md.friction.coefficientcoulomb = 0.02 * np.ones(md.mesh.numberofvertices)
+md.transient.isthermal = False
+md.transient.isgroundingline = True
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'TotalFloatingBmb', 'TotalGroundedBmb', 'TotalSmb']
+md.extrude(3, 1.)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','GroundedArea2','FloatingArea2','TotalFloatingBmb2','TotalGroundedBmb2','TotalSmb2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','GroundedArea3','FloatingArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].GroundedArea,\
-	md.results.TransientSolution[0].FloatingArea,\
-	md.results.TransientSolution[0].TotalFloatingBmb,\
-	md.results.TransientSolution[0].TotalGroundedBmb,\
-	md.results.TransientSolution[0].TotalSmb,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].GroundedArea,\
-	md.results.TransientSolution[1].FloatingArea,\
-	md.results.TransientSolution[1].TotalFloatingBmb,\
-	md.results.TransientSolution[1].TotalGroundedBmb,\
-	md.results.TransientSolution[1].TotalSmb,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].GroundedArea,\
-	md.results.TransientSolution[2].FloatingArea,\
-	md.results.TransientSolution[2].TotalFloatingBmb,\
-	md.results.TransientSolution[2].TotalGroundedBmb,\
-	md.results.TransientSolution[2].TotalSmb,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1', 'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'GroundedArea2', 'FloatingArea2', 'TotalFloatingBmb2', 'TotalGroundedBmb2', 'TotalSmb2', 'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'GroundedArea3', 'FloatingArea3', 'TotalFloatingBmb3', 'TotalGroundedBmb3', 'TotalSmb3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].GroundedArea,
+                md.results.TransientSolution[0].FloatingArea,
+                md.results.TransientSolution[0].TotalFloatingBmb,
+                md.results.TransientSolution[0].TotalGroundedBmb,
+                md.results.TransientSolution[0].TotalSmb,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].GroundedArea,
+                md.results.TransientSolution[1].FloatingArea,
+                md.results.TransientSolution[1].TotalFloatingBmb,
+                md.results.TransientSolution[1].TotalGroundedBmb,
+                md.results.TransientSolution[1].TotalSmb,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].GroundedArea,
+                md.results.TransientSolution[2].FloatingArea,
+                md.results.TransientSolution[2].TotalFloatingBmb,
+                md.results.TransientSolution[2].TotalGroundedBmb,
+                md.results.TransientSolution[2].TotalSmb]
Index: /issm/trunk/test/NightlyRun/test409.py
===================================================================
--- /issm/trunk/test/NightlyRun/test409.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test409.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfTranMHOPenalties
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,55 +9,52 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','../Exp/SquareHalfRight.exp','fill','HO','coupling','penalties')
-md.cluster=generic('name',gethostname(),'np',3)
-md.transient.requested_outputs=['default','GroundedArea']
-md.groundingline.melt_interpolation='SubelementMelt1'
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', '../Exp/SquareHalfRight.exp', 'fill', 'HO', 'coupling', 'penalties')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.requested_outputs = ['default', 'GroundedArea']
+md.groundingline.melt_interpolation = 'SubelementMelt1'
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1','GroundedArea1', \
-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2','GroundedArea2', \
-					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3','GroundedArea3']
-field_tolerances=[\
-	1e-05,1e-05,1e-05,1e-05,1e-05,1e-05,1e-05,1e-05,1e-05,1e-05,1e-6,\
-	1e-03,1e-03,1e-02,1e-03,1e-02,1e-04,1e-01,1e-03,1e-01,1e-01,1e-6,\
-	1e-02,1e-02,1e-01,1e-02,1e-01,1e-04,1e-04,1e-04,1e-04,1e-01,1e-6]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vz,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[0].GroundedArea,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vz,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[1].GroundedArea,\
-	md.results.TransientSolution[2].Vx,\
-	md.results.TransientSolution[2].Vy,\
-	md.results.TransientSolution[2].Vz,\
-	md.results.TransientSolution[2].Vel,\
-	md.results.TransientSolution[2].Pressure,\
-	md.results.TransientSolution[2].Base,\
-	md.results.TransientSolution[2].Surface,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].Temperature,\
-	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[2].GroundedArea,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1', 'GroundedArea1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2', 'GroundedArea2',
+               'Vx3', 'Vy3', 'Vz3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'Temperature3', 'BasalforcingsGroundediceMeltingRate3', 'GroundedArea3']
+field_tolerances = [1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-05, 1e-6,
+                    1e-03, 1e-03, 1e-02, 1e-03, 1e-02, 1e-04, 1e-01, 1e-03, 1e-01, 1e-01, 1e-6,
+                    1e-02, 1e-02, 1e-01, 1e-02, 1e-01, 1e-04, 1e-04, 1e-04, 1e-04, 1e-01, 1e-6]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[0].GroundedArea,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].GroundedArea,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Temperature,
+                md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[2].GroundedArea]
Index: /issm/trunk/test/NightlyRun/test410.py
===================================================================
--- /issm/trunk/test/NightlyRun/test410.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test410.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfSteaSSA3d
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,23 +9,21 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(3,2.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.timestepping.time_step=0
-md=solve(md,'Steadystate')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.timestepping.time_step = 0
+md = solve(md, 'Steadystate')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-09,1e-09,1e-08,1e-09,1e-13,5e-10,1e-06]
-field_values=[\
-	md.results.SteadystateSolution.Vx,\
-	md.results.SteadystateSolution.Vy,\
-	md.results.SteadystateSolution.Vz,\
-	md.results.SteadystateSolution.Vel,\
-	md.results.SteadystateSolution.Pressure,\
-	md.results.SteadystateSolution.Temperature,\
-	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure', 'Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-09, 1e-09, 1e-08, 1e-09, 1e-13, 5e-10, 1e-06]
+field_values = [md.results.SteadystateSolution.Vx,
+                md.results.SteadystateSolution.Vy,
+                md.results.SteadystateSolution.Vz,
+                md.results.SteadystateSolution.Vel,
+                md.results.SteadystateSolution.Pressure,
+                md.results.SteadystateSolution.Temperature,
+                md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test411.py
===================================================================
--- /issm/trunk/test/NightlyRun/test411.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test411.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfSteaHO
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,24 +9,21 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(3,2.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.timestepping.time_step=0.
-md=solve(md,'Steadystate')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.timestepping.time_step = 0.
+md = solve(md, 'Steadystate')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[2e-09,1e-09,1e-08,1e-09,1e-09,1e-08,1e-05
-]
-field_values=[\
-	md.results.SteadystateSolution.Vx,\
-	md.results.SteadystateSolution.Vy,\
-	md.results.SteadystateSolution.Vz,\
-	md.results.SteadystateSolution.Vel,\
-	md.results.SteadystateSolution.Pressure,\
-	md.results.SteadystateSolution.Temperature,\
-	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure', 'Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [2e-09, 1e-09, 1e-08, 1e-09, 1e-09, 1e-08, 1e-05]
+field_values = [md.results.SteadystateSolution.Vx,
+                md.results.SteadystateSolution.Vy,
+                md.results.SteadystateSolution.Vz,
+                md.results.SteadystateSolution.Vel,
+                md.results.SteadystateSolution.Pressure,
+                md.results.SteadystateSolution.Temperature,
+                md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test412.m
===================================================================
--- /issm/trunk/test/NightlyRun/test412.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test412.m	(revision 24313)
@@ -9,5 +9,5 @@
 md.qmu.numberofpartitions=md.mesh.numberofvertices;
 md=partitioner(md,'package','linear','npart',md.qmu.numberofpartitions);
-md.qmu.partition=md.qmu.partition-1;
+md.qmu.vpartition=md.qmu.vpartition-1;
 md.qmu.isdakota=1;
 
Index: /issm/trunk/test/NightlyRun/test412.py
===================================================================
--- /issm/trunk/test/NightlyRun/test412.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test412.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfDiadSSA3dDakota
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,18 +9,17 @@
 from partitioner import *
 from importancefactors import *
-
 from normal_uncertain import *
 from response_function import *
 
-md = triangle(model(),'../Exp/Square.exp',300000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 300000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 #partitioning
 md.qmu.numberofpartitions = md.mesh.numberofvertices
-md = partitioner(md,'package','linear','npart',md.qmu.numberofpartitions)
-md.qmu.partition = md.qmu.partition-1
+md = partitioner(md, 'package', 'linear', 'npart', md.qmu.numberofpartitions)
+md.qmu.vpartition = md.qmu.vpartition - 1
 md.qmu.isdakota = 1
 
@@ -33,9 +31,9 @@
 
 #variables
-md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain('MaterialsRhoIce',md.materials.rho_ice,0.01)
-md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_FrictionCoefficient',1,0.01)
+md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain('MaterialsRhoIce', md.materials.rho_ice, 0.01)
+md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_FrictionCoefficient', 1, 0.01)
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
 
 #method
@@ -47,21 +45,21 @@
 
 if version >= 6:
-	md.qmu.params.analysis_driver = 'matlab'
-	md.qmu.params.evaluation_scheduling = 'master'
-	md.qmu.params.processors_per_evaluation = 2
+    md.qmu.params.analysis_driver = 'matlab'
+    md.qmu.params.evaluation_scheduling = 'master'
+    md.qmu.params.processors_per_evaluation = 2
 else:
-	md.qmu.params.analysis_driver = 'stressbalance'
-	md.qmu.params.evaluation_concurrency = 1
+    md.qmu.params.analysis_driver = 'stressbalance'
+    md.qmu.params.evaluation_concurrency = 1
 
-#imperative! 
-md.stressbalance.reltol = 10**-5 #tighten for qmu analyses
+#imperative!
+md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
 
 #solve
-md.verbose = verbose('000000000')	# this line is recommended
-md = solve(md,'Stressbalance','overwrite','y')
+md.verbose = verbose('000000000')  # this line is recommended
+md = solve(md, 'Stressbalance', 'overwrite', 'y')
 
 #Fields and tolerances to track changes
 md.qmu.results = md.results.dakota
-md.results.dakota.importancefactors = importancefactors(md,'scaled_FrictionCoefficient','MaxVel').T
+md.results.dakota.importancefactors = importancefactors(md, 'scaled_FrictionCoefficient', 'MaxVel').T
 field_names = ['importancefactors']
 field_tolerances = [1e-10]
Index: /issm/trunk/test/NightlyRun/test413.m
===================================================================
--- /issm/trunk/test/NightlyRun/test413.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test413.m	(revision 24313)
@@ -14,5 +14,5 @@
 md.qmu.numberofpartitions=20;
 md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
-md.qmu.partition=md.qmu.partition-1;
+md.qmu.vpartition=md.qmu.vpartition-1;
 
 %variables
Index: /issm/trunk/test/NightlyRun/test413.py
===================================================================
--- /issm/trunk/test/NightlyRun/test413.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test413.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfDiadSSA3dDakotaPart
-import numpy as np
 from model import *
 from socket import gethostname
@@ -11,9 +10,9 @@
 from importancefactors import *
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 #Dakota options
@@ -25,13 +24,13 @@
 #partitioning
 md.qmu.numberofpartitions = 20
-md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on')
-md.qmu.partition = md.qmu.partition-1
+md = partitioner(md, 'package', 'chaco', 'npart', md.qmu.numberofpartitions, 'weighting', 'on')
+md.qmu.vpartition = md.qmu.vpartition - 1
 
 #variables
-md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain('MaterialsRhoIce',md.materials.rho_ice,0.01)
-md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_FrictionCoefficient',1,0.01)
+md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain('MaterialsRhoIce', md.materials.rho_ice, 0.01)
+md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_FrictionCoefficient', 1, 0.01)
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
 
 #method
@@ -43,23 +42,23 @@
 
 if version >= 6:
-	md.qmu.params.analysis_driver = 'matlab'
-	md.qmu.params.evaluation_scheduling = 'master'
-	md.qmu.params.processors_per_evaluation = 2
+    md.qmu.params.analysis_driver = 'matlab'
+    md.qmu.params.evaluation_scheduling = 'master'
+    md.qmu.params.processors_per_evaluation = 2
 else:
-	md.qmu.params.analysis_driver = 'stressbalance'
-	md.qmu.params.evaluation_concurrency = 1
+    md.qmu.params.analysis_driver = 'stressbalance'
+    md.qmu.params.evaluation_concurrency = 1
 
 
 #imperative!
-md.stressbalance.reltol = 10**-5 #tighten for qmu analyses
+md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
 md.qmu.isdakota = 1
 
 #solve
-md.verbose = verbose('000000000')	# this line is recommended
-md = solve(md,'Stressbalance','overwrite','y')
+md.verbose = verbose('000000000')  # this line is recommended
+md = solve(md, 'Stressbalance', 'overwrite', 'y')
 
 #Fields and tolerances to track changes
 md.qmu.results = md.results.dakota
-md.results.dakota.importancefactors = importancefactors(md,'scaled_FrictionCoefficient','MaxVel').T
+md.results.dakota.importancefactors = importancefactors(md, 'scaled_FrictionCoefficient', 'MaxVel').T
 field_names = ['importancefactors']
 field_tolerances = [1e-10]
Index: /issm/trunk/test/NightlyRun/test414.m
===================================================================
--- /issm/trunk/test/NightlyRun/test414.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test414.m	(revision 24313)
@@ -22,5 +22,5 @@
 md.qmu.numberofpartitions=20;
 md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
-md.qmu.partition=md.qmu.partition-1;
+md.qmu.vpartition=md.qmu.vpartition-1;
 
 %variables
Index: /issm/trunk/test/NightlyRun/test414.py
===================================================================
--- /issm/trunk/test/NightlyRun/test414.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test414.py	(revision 24313)
@@ -11,17 +11,17 @@
 from partitioner import *
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
-md.materials.rho_ice = 10**7 #involved in the mass flux, make it easy
-md.geometry.thickness[:] = 1 #make it easy
-md.geometry.surface = md.geometry.base+md.geometry.thickness
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.materials.rho_ice = 10**7  #involved in the mass flux, make it easy
+md.geometry.thickness[:] = 1  #make it easy
+md.geometry.surface = md.geometry.base + md.geometry.thickness
 
-#constrain all velocities to 1 m/yr, in the y-direction
-md.stressbalance.spcvx = np.zeros((md.mesh.numberofvertices,))
-md.stressbalance.spcvy = np.ones((md.mesh.numberofvertices,))
-md.stressbalance.spcvz = np.zeros((md.mesh.numberofvertices,))
+#constrain all velocities to 1 m / yr, in the y - direction
+md.stressbalance.spcvx = np.zeros((md.mesh.numberofvertices, ))
+md.stressbalance.spcvy = np.ones((md.mesh.numberofvertices, ))
+md.stressbalance.spcvz = np.zeros((md.mesh.numberofvertices, ))
 
 #Dakota options
@@ -33,22 +33,22 @@
 #partitioning
 md.qmu.numberofpartitions = 20
-md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on')
-md.qmu.partition = md.qmu.partition-1
+md = partitioner(md, 'package', 'chaco', 'npart', md.qmu.numberofpartitions, 'weighting', 'on')
+md.qmu.vpartition = md.qmu.vpartition - 1
 
 #variables
-md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_FrictionCoefficient',1,0.01)
+md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_FrictionCoefficient', 1, 0.01)
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux6 = response_function.response_function('indexed_MassFlux_6',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux7 = response_function.response_function('indexed_MassFlux_7',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux6 = response_function.response_function('indexed_MassFlux_6', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux7 = response_function.response_function('indexed_MassFlux_7', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
 
 #mass flux profiles
-md.qmu.mass_flux_profiles = ['../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp','../Exp/Square.exp']
+md.qmu.mass_flux_profiles = ['../Exp/MassFlux1.exp', '../Exp/MassFlux2.exp', '../Exp/MassFlux3.exp', '../Exp/MassFlux4.exp', '../Exp/MassFlux5.exp', '../Exp/MassFlux6.exp', '../Exp/Square.exp']
 md.qmu.mass_flux_profile_directory = getcwd()
 
@@ -60,33 +60,33 @@
 md.qmu.params.interval_type = 'forward'
 md.qmu.isdakota = 1
-md.stressbalance.reltol = 10**-5 #tighten for qmu analyses
+md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
 
 if version >= 6:
-	md.qmu.params.analysis_driver = 'matlab'
-	md.qmu.params.evaluation_scheduling = 'master'
-	md.qmu.params.processors_per_evaluation = 2
+    md.qmu.params.analysis_driver = 'matlab'
+    md.qmu.params.evaluation_scheduling = 'master'
+    md.qmu.params.processors_per_evaluation = 2
 else:
-	md.qmu.params.analysis_driver = 'stressbalance'
-	md.qmu.params.evaluation_concurrency = 1
+    md.qmu.params.analysis_driver = 'stressbalance'
+    md.qmu.params.evaluation_concurrency = 1
 
 #solve
-md.verbose = verbose('000000000')	# this line is recommended
-md = solve(md,'Stressbalance','overwrite','y')
+md.verbose = verbose('000000000')  # this line is recommended
+md = solve(md, 'Stressbalance', 'overwrite', 'y')
 md.qmu.results = md.results.dakota
 
 #Fields and tolerances to track changes
-#ok, mass flux of 3 profiles should be -3 Gt/yr -3 Gt/yr and the sum, which is -6 Gt/yr
+#ok, mass flux of 3 profiles should be-3 Gt / yr - 3 Gt / yr and the sum, which is - 6 Gt / yr
 #we recover those mass fluxes through the mean of the response.
-#also, we recover the max velo, which should be 1m/yr. 
+#also, we recover the max velo, which should be 1m / yr.
 #we put all that data in the moments, which we will use to test for success.
 #also, check that the stddev are 0.
 md.results.dakota.moments = []
 for i in range(8):
-	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].mean)
+    md.results.dakota.moments.append(md.results.dakota.dresp_out[i].mean)
 
 for i in range(8):
-	md.results.dakota.moments.append(md.results.dakota.dresp_out[i].stddev)
+    md.results.dakota.moments.append(md.results.dakota.dresp_out[i].stddev)
 
-field_names      = ['moments']
+field_names = ['moments']
 field_tolerances = [1e-11]
 field_values = [md.results.dakota.moments]
Index: /issm/trunk/test/NightlyRun/test415.py
===================================================================
--- /issm/trunk/test/NightlyRun/test415.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test415.py	(revision 24313)
@@ -10,42 +10,40 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',170000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/Square.exp', 170000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
 
 #control parameters
-md.inversion.iscontrol=1
-md.inversion.control_parameters=['FrictionCoefficient']
-md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
-md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
-md.inversion.nsteps=2
-md.inversion.cost_functions=[103,501]
-md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
-md.inversion.cost_functions_coefficients[:,1]=2.*10**-7
-md.inversion.gradient_scaling=3.*np.ones((md.inversion.nsteps))
-md.inversion.maxiter_per_step=2*np.ones((md.inversion.nsteps))
-md.inversion.step_threshold=0.3*np.ones((md.inversion.nsteps))
-md.timestepping.time_step=0.
-md.inversion.vx_obs=md.initialization.vx
-md.inversion.vy_obs=md.initialization.vy
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['FrictionCoefficient']
+md.inversion.min_parameters = 1. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 200. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.nsteps = 2
+md.inversion.cost_functions = [103, 501]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
+md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
+md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
+md.inversion.maxiter_per_step = 2 * np.ones((md.inversion.nsteps))
+md.inversion.step_threshold = 0.3 * np.ones((md.inversion.nsteps))
+md.timestepping.time_step = 0.
+md.inversion.vx_obs = md.initialization.vx
+md.inversion.vy_obs = md.initialization.vy
 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Steadystate')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Steadystate')
 
 #Fields and tolerances to track changes
-field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-9,1e-9,2e-10,1e-13,1e-09,1e-09,1e-09,1e-8,1e-09,1e-6]
-field_values=[\
-	md.results.SteadystateSolution.Gradient1,\
-	md.results.SteadystateSolution.J,\
-	md.results.SteadystateSolution.FrictionCoefficient,\
-	md.results.SteadystateSolution.Pressure,\
-	md.results.SteadystateSolution.Vel,\
-	md.results.SteadystateSolution.Vx,\
-	md.results.SteadystateSolution.Vy,\
-	md.results.SteadystateSolution.Vz,\
-	md.results.SteadystateSolution.Temperature,\
-	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate
-]
+field_names = ['Gradient', 'Misfits', 'FrictionCoefficient', 'Pressure', 'Vel', 'Vx', 'Vy', 'Vz', 'Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-9, 1e-9, 2e-10, 1e-13, 1e-09, 1e-09, 1e-09, 1e-8, 1e-09, 1e-6]
+field_values = [md.results.SteadystateSolution.Gradient1,
+                md.results.SteadystateSolution.J,
+                md.results.SteadystateSolution.FrictionCoefficient,
+                md.results.SteadystateSolution.Pressure,
+                md.results.SteadystateSolution.Vel,
+                md.results.SteadystateSolution.Vx,
+                md.results.SteadystateSolution.Vy,
+                md.results.SteadystateSolution.Vz,
+                md.results.SteadystateSolution.Temperature,
+                md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test416.py
===================================================================
--- /issm/trunk/test/NightlyRun/test416.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test416.py	(revision 24313)
@@ -10,42 +10,41 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',170000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
+md = triangle(model(), '../Exp/Square.exp', 170000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
 
 #control parameters
-md.inversion.iscontrol=1
-md.inversion.control_parameters=['FrictionCoefficient']
-md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
-md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
-md.inversion.nsteps=2
-md.inversion.cost_functions=[102,501]
-md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
-md.inversion.cost_functions_coefficients[:,1]=2.*10**-7
-md.inversion.gradient_scaling=3.*np.ones((md.inversion.nsteps))
-md.inversion.maxiter_per_step=2*np.ones((md.inversion.nsteps))
-md.inversion.step_threshold=0.3*np.ones((md.inversion.nsteps))
-md.timestepping.time_step=0.
-md.inversion.vx_obs=md.initialization.vx
-md.inversion.vy_obs=md.initialization.vy
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['FrictionCoefficient']
+md.inversion.min_parameters = 1. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 200. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.nsteps = 2
+md.inversion.cost_functions = [102, 501]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
+md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
+md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
+md.inversion.maxiter_per_step = 2 * np.ones((md.inversion.nsteps))
+md.inversion.step_threshold = 0.3 * np.ones((md.inversion.nsteps))
+md.timestepping.time_step = 0.
+md.inversion.vx_obs = md.initialization.vx
+md.inversion.vy_obs = md.initialization.vy
 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Steadystate')
+
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Steadystate')
 
 #Fields and tolerances to track changes
-field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-08,1e-07,1e-08,1e-08,1e-08,1e-08,1e-08,1e-07,1e-08,1e-05]
-field_values=[\
-	md.results.SteadystateSolution.Gradient1,\
-	md.results.SteadystateSolution.J,\
-	md.results.SteadystateSolution.FrictionCoefficient,\
-	md.results.SteadystateSolution.Pressure,\
-	md.results.SteadystateSolution.Vel,\
-	md.results.SteadystateSolution.Vx,\
-	md.results.SteadystateSolution.Vy,\
-	md.results.SteadystateSolution.Vz,\
-	md.results.SteadystateSolution.Temperature,\
-	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate
-]
+field_names = ['Gradient', 'Misfits', 'FrictionCoefficient', 'Pressure', 'Vel', 'Vx', 'Vy', 'Vz', 'Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-08, 1e-07, 1e-08, 1e-08, 1e-08, 1e-08, 1e-08, 1e-07, 1e-08, 1e-05]
+field_values = [md.results.SteadystateSolution.Gradient1,
+                md.results.SteadystateSolution.J,
+                md.results.SteadystateSolution.FrictionCoefficient,
+                md.results.SteadystateSolution.Pressure,
+                md.results.SteadystateSolution.Vel,
+                md.results.SteadystateSolution.Vx,
+                md.results.SteadystateSolution.Vy,
+                md.results.SteadystateSolution.Vz,
+                md.results.SteadystateSolution.Temperature,
+                md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test417.m
===================================================================
--- /issm/trunk/test/NightlyRun/test417.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test417.m	(revision 24313)
@@ -44,6 +44,6 @@
 
 %%  a variety of parameters
+md.qmu.params.interval_type='forward';
 md.qmu.params.direct=true;
-md.qmu.params.analysis_components='';
 md.qmu.params.tabular_graphics_data=true;
 
@@ -61,5 +61,5 @@
 md.qmu.numberofpartitions=20;
 md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
-md.qmu.partition=md.qmu.partition-1;
+md.qmu.vpartition=md.qmu.vpartition-1;
 md.qmu.isdakota=1;
 
Index: /issm/trunk/test/NightlyRun/test417.py
===================================================================
--- /issm/trunk/test/NightlyRun/test417.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test417.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfDiadSSA3dDakotaSamp
-import numpy as np
 from os import getcwd
 from model import *
@@ -12,14 +11,14 @@
 from dmeth_params_set import *
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
-md.materials.rho_ice = 10**7 #involved in the mass flux, make it easy
-md.geometry.thickness[:] = 1 #make it easy
-md.geometry.surface = md.geometry.base+md.geometry.thickness
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.materials.rho_ice = 10**7  #involved in the mass flux, make it easy
+md.geometry.thickness[:] = 1  #make it easy
+md.geometry.surface = md.geometry.base + md.geometry.thickness
 
-#constrain all velocities to 1 m/yr, in the y-direction
+#constrain all velocities to 1 m / yr, in the y - direction
 md.stressbalance.spcvx[:] = 0
 md.stressbalance.spcvy[:] = 1
@@ -34,73 +33,73 @@
 #partitioning
 md.qmu.numberofpartitions = 20
-md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on')
-md.qmu.partition = md.qmu.partition-1
+md = partitioner(md, 'package', 'chaco', 'npart', md.qmu.numberofpartitions, 'weighting', 'on')
+md.qmu.vpartition = md.qmu.vpartition - 1
 
 #variables
-md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_FrictionCoefficient',1,0.01)
+md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_FrictionCoefficient', 1, 0.01)
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('MaxVel',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux6 = response_function.response_function('indexed_MassFlux_6',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.MassFlux7 = response_function.response_function('indexed_MassFlux_7',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux6 = response_function.response_function('indexed_MassFlux_6', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux7 = response_function.response_function('indexed_MassFlux_7', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
 
 #mass flux profiles
-md.qmu.mass_flux_profiles = ['../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp','../Exp/Square.exp']
+md.qmu.mass_flux_profiles = ['../Exp/MassFlux1.exp', '../Exp/MassFlux2.exp', '../Exp/MassFlux3.exp', '../Exp/MassFlux4.exp', '../Exp/MassFlux5.exp', '../Exp/MassFlux6.exp', '../Exp/Square.exp']
 md.qmu.mass_flux_profile_directory = getcwd()
 
 #method
 md.qmu.method = dakota_method.dakota_method('nond_samp')
-md.qmu.method = dmeth_params_set(md.qmu.method,'seed',1234,'samples',20,'sample_type','lhs')
+md.qmu.method = dmeth_params_set(md.qmu.method, 'seed', 1234, 'samples', 20, 'sample_type', 'lhs')
 
 #parameters
+md.qmu.params.interval_type = 'forward'
 md.qmu.params.direct = True
-md.qmu.params.analysis_components = ''
-md.qmu.params.tabular_graphics_data = True;
+md.qmu.params.tabular_graphics_data = True
 
 if version >= 6:
-	md.qmu.params.analysis_driver = 'matlab'
-	md.qmu.params.evaluation_scheduling = 'master'
-	md.qmu.params.processors_per_evaluation = 2
+    md.qmu.params.analysis_driver = 'matlab'
+    md.qmu.params.evaluation_scheduling = 'master'
+    md.qmu.params.processors_per_evaluation = 2
 else:
-	md.qmu.params.analysis_driver = 'stressbalance'
-	md.qmu.params.evaluation_concurrency = 1
+    md.qmu.params.analysis_driver = 'stressbalance'
+    md.qmu.params.evaluation_concurrency = 1
 
 #partitioning
 md.qmu.numberofpartitions = 20
-md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on')
-md.qmu.partition = md.qmu.partition-1
+md = partitioner(md, 'package', 'chaco', 'npart', md.qmu.numberofpartitions, 'weighting', 'on')
+md.qmu.vpartition = md.qmu.vpartition - 1
 md.qmu.isdakota = 1
 
-md.stressbalance.reltol = 10**-5	#tighten for qmu analyses
+md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
 
 #solve
-md.verbose = verbose('000000000')	# this line is recommended
+md.verbose = verbose('000000000')  # this line is recommended
 
 # There may be a pair of numpy warnings in the function true_divide,
-#	this is normal and will not affect the results
-#	See src/m/qmu/dakota_out_parse.py, function "dak_tab_out" for details
-md = solve(md,'Stressbalance','overwrite','y')
+#       this is normal and will not affect the results
+#       See src / m / qmu / dakota_out_parse.py, function "dak_tab_out" for details
+md = solve(md, 'Stressbalance', 'overwrite', 'y')
 
 #Fields and tolerances to track changes
 md.qmu.results = md.results.dakota
 
-#ok, mass flux of 3 profiles should be -3 Gt/yr -3 Gt/yr and the sum, which is -6 Gt/yr
+#ok, mass flux of 3 profiles should be-3 Gt / yr - 3 Gt / yr and the sum, which is - 6 Gt / yr
 #we recover those mass fluxes through the mean of the response.
-#also, we recover the max velo, which should be 1m/yr. 
+#also, we recover the max velo, which should be 1m / yr.
 #we put all that data in the montecarlo field, which we will use to test for success.
 #also, check that the stddev are 0.
 md.results.dakota.montecarlo = []
 for i in range(8):
-	md.results.dakota.montecarlo.append(md.results.dakota.dresp_out[i].mean)
+    md.results.dakota.montecarlo.append(md.results.dakota.dresp_out[i].mean)
 
 for i in range(8):
-	md.results.dakota.montecarlo.append(md.results.dakota.dresp_out[i].stddev)
+    md.results.dakota.montecarlo.append(md.results.dakota.dresp_out[i].stddev)
 
-field_names      = ['moments']
+field_names = ['moments']
 field_tolerances = [1e-11]
-field_values     = [md.results.dakota.montecarlo]
+field_values = [md.results.dakota.montecarlo]
Index: /issm/trunk/test/NightlyRun/test418.m
===================================================================
--- /issm/trunk/test/NightlyRun/test418.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test418.m	(revision 24313)
@@ -10,9 +10,9 @@
 md.qmu.numberofpartitions=100;
 md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions);
-md.qmu.partition=md.qmu.partition-1;
+md.qmu.vpartition=md.qmu.vpartition-1;
 
 vector=(1:1:md.mesh.numberofvertices)';
 vector_on_partition=AreaAverageOntoPartition(md,vector);
-vector_on_nodes=vector_on_partition(md.qmu.partition+1);
+vector_on_nodes=vector_on_partition(md.qmu.vpartition+1);
 
 field_names     ={'vector_on_nodes'};
Index: /issm/trunk/test/NightlyRun/test418.py
===================================================================
--- /issm/trunk/test/NightlyRun/test418.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test418.py	(revision 24313)
@@ -1,6 +1,4 @@
 #Test Name: SquareSheetShelfDiadSSA3dDakotaAreaAverage
-
 # this test may crash
-
 import numpy as np
 from model import *
@@ -16,28 +14,25 @@
 #test partitioning, and partition averaging
 # python cannot handle resolutions greater than 30010
-md = triangle(model(),'../Exp/Square.exp',30000.)
+md = triangle(model(), '../Exp/Square.exp', 30000.)
 #print md.mesh.numberofvertices
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 #partitioning
 md.qmu.numberofpartitions = 100
-
+#partitioner seamd to generate the following message:
 #corrupted size vs. prev_size
 #Aborted (core dumped)
-md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions)
+md = partitioner(md, 'package', 'chaco', 'npart', md.qmu.numberofpartitions)
+md.qmu.vpartition = md.qmu.vpartition - 1
 
+vector = np.arange(1, 1 + md.mesh.numberofvertices, 1).reshape(-1, 1)
+# double check this before committing:
+vector_on_partition = AreaAverageOntoPartition(md, vector)
+vector_on_nodes = vector_on_partition[md.qmu.vpartition]
 
-md.qmu.partition=md.qmu.partition-1
-
-vector = np.arange(1,1+md.mesh.numberofvertices,1).reshape(-1,1)
-# double check this before committing:
-#print 'before AreaAverageOntoPartition'
-vector_on_partition = AreaAverageOntoPartition(md,vector)
-vector_on_nodes = vector_on_partition[md.qmu.partition+1]
-
-field_names      = ['vector_on_nodes']
+field_names = ['vector_on_nodes']
 field_tolerances = [1e-11]
-field_values     = [vector_on_nodes]
+field_values = [vector_on_nodes]
Index: /issm/trunk/test/NightlyRun/test419.py
===================================================================
--- /issm/trunk/test/NightlyRun/test419.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test419.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfStressSSAHOTiling
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,20 +9,18 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(5,1.)
-md=setflowequation(md,'SSA','../Exp/SquareHalfRight.exp','fill','HO')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(5, 1.)
+md = setflowequation(md, 'SSA', '../Exp/SquareHalfRight.exp', 'fill', 'HO')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[2e-09,1e-09,1e-09,1e-09,1e-09]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [2e-09, 1e-09, 1e-09, 1e-09, 1e-09]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test420.m
===================================================================
--- /issm/trunk/test/NightlyRun/test420.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test420.m	(revision 24313)
@@ -9,5 +9,5 @@
 md.qmu.numberofpartitions=10;
 md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions);
-md.qmu.partition=md.qmu.partition-1;
+md.qmu.vpartition=md.qmu.vpartition-1;
 md.qmu.isdakota=1;
 
@@ -55,5 +55,5 @@
 
 %project onto grid
-thickness=h(md.qmu.partition+1);
+thickness=h(md.qmu.vpartition+1);
 
 %Fields and tolerances to track changes
Index: /issm/trunk/test/NightlyRun/test420.py
===================================================================
--- /issm/trunk/test/NightlyRun/test420.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test420.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfDakotaScaledResponse
-
 import numpy as np
 from model import *
@@ -11,14 +10,14 @@
 from partitioner import *
 
-md = triangle(model(),'../Exp/Square.exp',200000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 200000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 #partitioning
 md.qmu.numberofpartitions = 10
-md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions)
-md.qmu.partition = md.qmu.partition-1
+md = partitioner(md, 'package', 'chaco', 'npart', md.qmu.numberofpartitions)
+md.qmu.vpartition = md.qmu.vpartition - 1
 md.qmu.isdakota = 1
 
@@ -30,8 +29,8 @@
 
 #variables
-md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain('MaterialsRhoIce',md.materials.rho_ice,0.01)
+md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain('MaterialsRhoIce', md.materials.rho_ice, 0.01)
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('scaled_Thickness',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('scaled_Thickness', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
 
 #method
@@ -43,29 +42,29 @@
 
 if version >= 6:
-	md.qmu.params.analysis_driver = 'matlab'
-	md.qmu.params.evaluation_scheduling = 'master'
-	md.qmu.params.processors_per_evaluation = 2
+    md.qmu.params.analysis_driver = 'matlab'
+    md.qmu.params.evaluation_scheduling = 'master'
+    md.qmu.params.processors_per_evaluation = 2
 else:
-	md.qmu.params.analysis_driver = 'stressbalance'
-	md.qmu.params.evaluation_concurrency = 1
+    md.qmu.params.analysis_driver = 'stressbalance'
+    md.qmu.params.evaluation_concurrency = 1
 
-#imperative! 
-md.stressbalance.reltol = 10**-5 #tighten for qmu analysese
+#imperative!
+md.stressbalance.reltol = 10**-5  #tighten for qmu analysese
 
 #solve
-md.verbose = verbose('000000000')	# this line is recommended
-md = solve(md,'Stressbalance','overwrite','y')
+md.verbose = verbose('000000000')  # this line is recommended
+md = solve(md, 'Stressbalance', 'overwrite', 'y')
 md.qmu.results = md.results.dakota
 
 #test on thickness
-h = np.zeros((md.qmu.numberofpartitions,))
+h = np.zeros((md.qmu.numberofpartitions, ))
 for i in range(md.qmu.numberofpartitions):
-	h[i] = md.qmu.results.dresp_out[i].mean
+    h[i] = md.qmu.results.dresp_out[i].mean
 
 #project onto grid
-thickness = h[(md.qmu.partition).flatten()]
+thickness = h[(md.qmu.vpartition).flatten()]
 
 #Fields and tolerances to track changes
-field_names      = ['Thickness']
+field_names = ['Thickness']
 field_tolerances = [1e-10]
-field_values     = [thickness]
+field_values = [thickness]
Index: /issm/trunk/test/NightlyRun/test421.m
===================================================================
--- /issm/trunk/test/NightlyRun/test421.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test421.m	(revision 24313)
@@ -10,5 +10,5 @@
 %Fields and tolerances to track changes
 field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
-field_tolerances={2e-06,9e-07,2e-05,2e-06,2e-06};
+field_tolerances={2e-06,2e-06,2e-05,2e-06,2e-06};
 field_values={...
 	(md.results.StressbalanceSolution.Vx),...
Index: /issm/trunk/test/NightlyRun/test421.py
===================================================================
--- /issm/trunk/test/NightlyRun/test421.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test421.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfStressHOFS3dTiling
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,20 +9,18 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(5,1.)
-md=setflowequation(md,'FS','../Exp/SquareHalfRight.exp','fill','HO')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(5, 1.)
+md = setflowequation(md, 'FS', '../Exp/SquareHalfRight.exp', 'fill', 'HO')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[2e-06,9e-07,2e-05,2e-06,2e-06]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [2e-06, 2e-06, 2e-05, 2e-06, 2e-06]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test422.py
===================================================================
--- /issm/trunk/test/NightlyRun/test422.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test422.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfStressSSAFS3dTiling
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,21 +9,19 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(5,1.)
-md=setflowequation(md,'FS','../Exp/SquareHalfRight.exp','fill','SSA')
-md.cluster=generic('name',gethostname(),'np',3)
-md.stressbalance.reltol=0.4
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(5, 1.)
+md = setflowequation(md, 'FS', '../Exp/SquareHalfRight.exp', 'fill', 'SSA')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.stressbalance.reltol = 0.4
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[4e-07,4e-07,2e-06,4e-07,5e-07]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [4e-07, 4e-07, 2e-06, 4e-07, 5e-07]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test423.py
===================================================================
--- /issm/trunk/test/NightlyRun/test423.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test423.py	(revision 24313)
@@ -10,55 +10,55 @@
 
 
-radius=1.e6
-shelfextent=2.e5
+radius = 1.e6
+shelfextent = 2.e5
 
-md=roundmesh(model(),radius,50000.)
-#fix center node to 0,0
-rad=np.sqrt(md.mesh.x**2+md.mesh.y**2)
-pos=np.argmin(rad)
-md.mesh.x[pos]=0.
-md.mesh.y[pos]=0.    #the closest node to the center is changed to be exactly at the center
-xelem=np.mean(md.mesh.x[md.mesh.elements.astype(int)-1],axis=1)
-yelem=np.mean(md.mesh.y[md.mesh.elements.astype(int)-1],axis=1)
-rad=np.sqrt(xelem**2+yelem**2)
-flags=np.zeros(md.mesh.numberofelements)
-pos=np.nonzero(rad>=(radius-shelfextent))
-flags[pos]=1
-md=setmask(md,flags,'') 
-md=parameterize(md,'../Par/RoundSheetShelf.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = roundmesh(model(), radius, 50000.)
+#fix center node to 0, 0
+rad = np.sqrt(md.mesh.x**2 + md.mesh.y**2)
+pos = np.argmin(rad)
+md.mesh.x[pos] = 0.
+md.mesh.y[pos] = 0.  #the closest node to the center is changed to be exactly at the center
+xelem = np.mean(md.mesh.x[md.mesh.elements.astype(int) - 1], axis=1)
+yelem = np.mean(md.mesh.y[md.mesh.elements.astype(int) - 1], axis=1)
+rad = np.sqrt(xelem**2 + yelem**2)
+flags = np.zeros(md.mesh.numberofelements)
+pos = np.nonzero(rad >= (radius - shelfextent))
+flags[pos] = 1
+md = setmask(md, flags, '')
+md = parameterize(md, '../Par/RoundSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.transient.isthermal=False
-md.transient.ismasstransport=False
-md.transient.issmb=True
-md.transient.isstressbalance=True
-md.transient.isgroundingline=True
+md.transient.isthermal = False
+md.transient.ismasstransport = False
+md.transient.issmb = True
+md.transient.isstressbalance = True
+md.transient.isgroundingline = True
 
 #test different grounding line dynamics.
-md.groundingline.migration='AggressiveMigration'
-md=solve(md,'Transient')
-element_on_iceshelf_agressive=md.results.TransientSolution[0].MaskGroundediceLevelset
-vel_agressive=md.results.TransientSolution[0].Vel
+md.groundingline.migration = 'AggressiveMigration'
+md = solve(md, 'Transient')
+element_on_iceshelf_agressive = md.results.TransientSolution[0].MaskGroundediceLevelset
+vel_agressive = md.results.TransientSolution[0].Vel
 
-md.groundingline.migration='SoftMigration'
-md=solve(md,'Transient')
-element_on_iceshelf_soft=md.results.TransientSolution[0].MaskGroundediceLevelset
-vel_soft=md.results.TransientSolution[0].Vel
+md.groundingline.migration = 'SoftMigration'
+md = solve(md, 'Transient')
+element_on_iceshelf_soft = md.results.TransientSolution[0].MaskGroundediceLevelset
+vel_soft = md.results.TransientSolution[0].Vel
 
-md.mask.groundedice_levelset=md.geometry.thickness + md.materials.rho_water/md.materials.rho_ice*md.geometry.bed
-md.groundingline.migration='SubelementMigration'
-md.groundingline.friction_interpolation='SubelementFriction1'
-md=solve(md,'Transient')
-element_on_iceshelf_subelement=md.results.TransientSolution[0].MaskGroundediceLevelset
-vel_subelement=md.results.TransientSolution[0].Vel
+md.mask.groundedice_levelset = md.geometry.thickness + md.materials.rho_water / md.materials.rho_ice * md.geometry.bed
+md.groundingline.migration = 'SubelementMigration'
+md.groundingline.friction_interpolation = 'SubelementFriction1'
+md = solve(md, 'Transient')
+element_on_iceshelf_subelement = md.results.TransientSolution[0].MaskGroundediceLevelset
+vel_subelement = md.results.TransientSolution[0].Vel
 
-md.groundingline.friction_interpolation='SubelementFriction2'
-md=solve(md,'Transient')
-element_on_iceshelf_subelement2=md.results.TransientSolution[0].MaskGroundediceLevelset
-vel_subelement2=md.results.TransientSolution[0].Vel
+md.groundingline.friction_interpolation = 'SubelementFriction2'
+md = solve(md, 'Transient')
+element_on_iceshelf_subelement2 = md.results.TransientSolution[0].MaskGroundediceLevelset
+vel_subelement2 = md.results.TransientSolution[0].Vel
 
 #Fields and tolerances to track changes
-field_names     =['ElementOnIceShelfAggressive','VelAggressive','ElementOnIceShelfSoft','VelSoft','ElementOnIceShelfSubelement','VelSubelement','ElementOnIceShelfSubelement2','VelSubelement2']
-field_tolerances=[1e-13,2e-13,1e-13,2e-13,1e-13,2e-13,1e-13,2e-13]
-field_values=[element_on_iceshelf_agressive,vel_agressive,element_on_iceshelf_soft,vel_soft,element_on_iceshelf_subelement,vel_subelement,element_on_iceshelf_subelement2,vel_subelement2]
+field_names = ['ElementOnIceShelfAggressive', 'VelAggressive', 'ElementOnIceShelfSoft', 'VelSoft', 'ElementOnIceShelfSubelement', 'VelSubelement', 'ElementOnIceShelfSubelement2', 'VelSubelement2']
+field_tolerances = [1e-13, 2e-13, 1e-13, 2e-13, 1e-13, 2e-13, 1e-13, 2e-13]
+field_values = [element_on_iceshelf_agressive, vel_agressive, element_on_iceshelf_soft, vel_soft, element_on_iceshelf_subelement, vel_subelement, element_on_iceshelf_subelement2, vel_subelement2]
Index: /issm/trunk/test/NightlyRun/test424.py
===================================================================
--- /issm/trunk/test/NightlyRun/test424.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test424.py	(revision 24313)
@@ -8,62 +8,62 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md=setflowequation(md,'SSA','all')
-md.initialization.vx[:]=0.
-md.initialization.vy[:]=0.
-md.geometry.base=-700.-abs(md.mesh.y-500000.)/1000.
-md.geometry.bed =-700.-abs(md.mesh.y-500000.)/1000.
-md.geometry.thickness[:]=1000.
-md.geometry.surface=md.geometry.base+md.geometry.thickness
-md.smb.mass_balance[:]=100.
-md.transient.isstressbalance=False
-md.transient.isgroundingline=True
-md.groundingline.migration='AggressiveMigration'
-md.transient.requested_outputs=['IceVolume','IceVolumeAboveFloatation','IceVolumeAboveFloatationScaled','GroundedArea','FloatingArea','GroundedAreaScaled','FloatingAreaScaled']
-md.mesh.scale_factor=1.1*np.ones((md.mesh.numberofvertices))
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.initialization.vx[:] = 0.
+md.initialization.vy[:] = 0.
+md.geometry.base = -700. - abs(md.mesh.y - 500000.) / 1000.
+md.geometry.bed = -700. - abs(md.mesh.y - 500000.) / 1000.
+md.geometry.thickness[:] = 1000.
+md.geometry.surface = md.geometry.base + md.geometry.thickness
+md.smb.mass_balance[:] = 100.
+md.transient.isstressbalance = False
+md.transient.isgroundingline = True
+md.groundingline.migration = 'AggressiveMigration'
+md.transient.requested_outputs = ['IceVolume', 'IceVolumeAboveFloatation', 'IceVolumeAboveFloatationScaled', 'GroundedArea', 'FloatingArea', 'GroundedAreaScaled', 'FloatingAreaScaled']
+md.mesh.scale_factor = 1.1 * np.ones((md.mesh.numberofvertices))
 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Bed1','Surface1','Thickness1','Floatingice1','IceVolume1','IceVolumeAboveFloatation1','IceVolumeAboveFloatationScaled1','GroundedArea1','GroundedAreaScaled1','FloatingArea1','FloatingAreaScaled1',
-									'Bed2','Surface2','Thickness2','Floatingice2','IceVolume2','IceVolumeAboveFloatation2','IceVolumeAboveFloatationScaled2','GroundedAred2','GroundedAreaScaled2','FloatingArea2','FloatingAreaScaled2',
-									'Bed3','Surface3','Thickness3','Floatingice3','IceVolume3','IceVolumeAboveFloatation3','IceVolumeAboveFloatationScaled3','GroundedArea3','GroundedAreaScaled3','FloatingArea3','FloatingAreaScaled3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].MaskGroundediceLevelset,
-							md.results.TransientSolution[0].IceVolume,
-							md.results.TransientSolution[0].IceVolumeAboveFloatation,
-							md.results.TransientSolution[0].IceVolumeAboveFloatationScaled,
-							md.results.TransientSolution[0].GroundedArea,
-							md.results.TransientSolution[0].GroundedAreaScaled,
-							md.results.TransientSolution[0].FloatingArea,
-							md.results.TransientSolution[0].FloatingAreaScaled,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].MaskGroundediceLevelset,
-							md.results.TransientSolution[1].IceVolume,
-							md.results.TransientSolution[1].IceVolumeAboveFloatation,
-							md.results.TransientSolution[1].IceVolumeAboveFloatationScaled,
-							md.results.TransientSolution[1].GroundedArea,
-							md.results.TransientSolution[1].GroundedAreaScaled,
-							md.results.TransientSolution[1].FloatingArea,
-							md.results.TransientSolution[1].FloatingAreaScaled,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].MaskGroundediceLevelset,
-							md.results.TransientSolution[2].IceVolume,
-							md.results.TransientSolution[2].IceVolumeAboveFloatation,
-							md.results.TransientSolution[2].IceVolumeAboveFloatationScaled,
-							md.results.TransientSolution[2].GroundedArea,
-							md.results.TransientSolution[2].GroundedAreaScaled,
-							md.results.TransientSolution[2].FloatingArea,
-							md.results.TransientSolution[2].FloatingAreaScaled]
+field_names = ['Bed1', 'Surface1', 'Thickness1', 'Floatingice1', 'IceVolume1', 'IceVolumeAboveFloatation1', 'IceVolumeAboveFloatationScaled1', 'GroundedArea1', 'GroundedAreaScaled1', 'FloatingArea1', 'FloatingAreaScaled1',
+               'Bed2', 'Surface2', 'Thickness2', 'Floatingice2', 'IceVolume2', 'IceVolumeAboveFloatation2', 'IceVolumeAboveFloatationScaled2', 'GroundedAred2', 'GroundedAreaScaled2', 'FloatingArea2', 'FloatingAreaScaled2',
+               'Bed3', 'Surface3', 'Thickness3', 'Floatingice3', 'IceVolume3', 'IceVolumeAboveFloatation3', 'IceVolumeAboveFloatationScaled3', 'GroundedArea3', 'GroundedAreaScaled3', 'FloatingArea3', 'FloatingAreaScaled3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].MaskGroundediceLevelset,
+                md.results.TransientSolution[0].IceVolume,
+                md.results.TransientSolution[0].IceVolumeAboveFloatation,
+                md.results.TransientSolution[0].IceVolumeAboveFloatationScaled,
+                md.results.TransientSolution[0].GroundedArea,
+                md.results.TransientSolution[0].GroundedAreaScaled,
+                md.results.TransientSolution[0].FloatingArea,
+                md.results.TransientSolution[0].FloatingAreaScaled,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].MaskGroundediceLevelset,
+                md.results.TransientSolution[1].IceVolume,
+                md.results.TransientSolution[1].IceVolumeAboveFloatation,
+                md.results.TransientSolution[1].IceVolumeAboveFloatationScaled,
+                md.results.TransientSolution[1].GroundedArea,
+                md.results.TransientSolution[1].GroundedAreaScaled,
+                md.results.TransientSolution[1].FloatingArea,
+                md.results.TransientSolution[1].FloatingAreaScaled,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].MaskGroundediceLevelset,
+                md.results.TransientSolution[2].IceVolume,
+                md.results.TransientSolution[2].IceVolumeAboveFloatation,
+                md.results.TransientSolution[2].IceVolumeAboveFloatationScaled,
+                md.results.TransientSolution[2].GroundedArea,
+                md.results.TransientSolution[2].GroundedAreaScaled,
+                md.results.TransientSolution[2].FloatingArea,
+                md.results.TransientSolution[2].FloatingAreaScaled]
Index: /issm/trunk/test/NightlyRun/test425.py
===================================================================
--- /issm/trunk/test/NightlyRun/test425.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test425.py	(revision 24313)
@@ -8,39 +8,39 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md=setflowequation(md,'SSA','all')
-md.initialization.vx[:]=0.
-md.initialization.vy[:]=0.
-md.geometry.base=-700.-abs(md.mesh.y-500000.)/1000.
-md.geometry.bed =-700.-abs(md.mesh.y-500000.)/1000.
-md.geometry.thickness[:]=1300.
-md.geometry.surface=md.geometry.base+md.geometry.thickness
-md.smb.mass_balance[:]=-150.
-md.transient.isstressbalance=False
-md.transient.isgroundingline=True
-md.groundingline.migration='SoftMigration'
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.initialization.vx[:] = 0.
+md.initialization.vy[:] = 0.
+md.geometry.base = -700. - abs(md.mesh.y - 500000.) / 1000.
+md.geometry.bed = -700. - abs(md.mesh.y - 500000.) / 1000.
+md.geometry.thickness[:] = 1300.
+md.geometry.surface = md.geometry.base + md.geometry.thickness
+md.smb.mass_balance[:] = -150.
+md.transient.isstressbalance = False
+md.transient.isgroundingline = True
+md.groundingline.migration = 'SoftMigration'
 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Bed1','Surface1','Thickness1','Floatingice1',
-									'Bed2','Surface2','Thickness2','Floatingice2',
-									'Bed3','Surface3','Thickness3','Floatingice3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,1e-13,
-									1e-13,1e-13,1e-13,1e-13]
-field_values=[md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].MaskGroundediceLevelset,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].MaskGroundediceLevelset,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].MaskGroundediceLevelset]
+field_names = ['Bed1', 'Surface1', 'Thickness1', 'Floatingice1',
+               'Bed2', 'Surface2', 'Thickness2', 'Floatingice2',
+               'Bed3', 'Surface3', 'Thickness3', 'Floatingice3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].MaskGroundediceLevelset,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].MaskGroundediceLevelset,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].MaskGroundediceLevelset]
Index: /issm/trunk/test/NightlyRun/test426.py
===================================================================
--- /issm/trunk/test/NightlyRun/test426.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test426.py	(revision 24313)
@@ -8,69 +8,69 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',350000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.initialization.vx[:]=0.
-md.initialization.vy[:]=0.
-md.geometry.base=-700.-abs(md.mesh.y-500000.)/1000.
-md.geometry.bed =-700.-abs(md.mesh.y-500000.)/1000.
-md.geometry.thickness[:]=1000.
-md.geometry.surface=md.geometry.base+md.geometry.thickness
-md.smb.mass_balance[:]=100.
-md=setflowequation(md,'SSA','all')
-md.transient.isstressbalance=False
-md.transient.isgroundingline=True
-md.groundingline.migration='AggressiveMigration'
-md.groundingline.melt_interpolation='SubelementMelt1'
-md.transient.requested_outputs=['IceVolume','IceVolumeAboveFloatation','IceMass','IceVolumeAboveFloatationScaled','GroundedArea','FloatingArea','GroundedAreaScaled','FloatingAreaScaled']
-md.mesh.scale_factor=1.1*np.ones((md.mesh.numberofvertices))
-md.extrude(3,1.)
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 350000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.initialization.vx[:] = 0.
+md.initialization.vy[:] = 0.
+md.geometry.base = -700. - abs(md.mesh.y - 500000.) / 1000.
+md.geometry.bed = -700. - abs(md.mesh.y - 500000.) / 1000.
+md.geometry.thickness[:] = 1000.
+md.geometry.surface = md.geometry.base + md.geometry.thickness
+md.smb.mass_balance[:] = 100.
+md = setflowequation(md, 'SSA', 'all')
+md.transient.isstressbalance = False
+md.transient.isgroundingline = True
+md.groundingline.migration = 'AggressiveMigration'
+md.groundingline.melt_interpolation = 'SubelementMelt1'
+md.transient.requested_outputs = ['IceVolume', 'IceVolumeAboveFloatation', 'IceMass', 'IceVolumeAboveFloatationScaled', 'GroundedArea', 'FloatingArea', 'GroundedAreaScaled', 'FloatingAreaScaled']
+md.mesh.scale_factor = 1.1 * np.ones((md.mesh.numberofvertices))
+md.extrude(3, 1.)
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Bed1','Surface1','Thickness1','Floatingice1','IceVolume1','IceVolumeAboveFloatation1','IceMass1','IceVolumeAboveFloatationScaled1','GroundedArea1','GroundedAreaScaled1','FloatingArea1','FloatingAreaScaled1',
-        'Bed2','Surface2','Thickness2','Floatingice2','IceVolume2','IceVolumeAboveFloatation2','IceMass2','IceVolumeAboveFloatationScaled2','GroundedArea2','GroundedAreaScaled2','FloatingArea2','FloatingAreaScaled2',
-        'Bed3','Surface3','Thickness3','Floatingice3','IceVolume3','IceVolumeAboveFloatation3','IceMass3','IceVolumeAboveFloatationScaled3','GroundedArea3','GroundedAreaScaled3','FloatingArea3','FloatingAreaScaled3']
+field_names = ['Bed1', 'Surface1', 'Thickness1', 'Floatingice1', 'IceVolume1', 'IceVolumeAboveFloatation1', 'IceMass1', 'IceVolumeAboveFloatationScaled1', 'GroundedArea1', 'GroundedAreaScaled1', 'FloatingArea1', 'FloatingAreaScaled1',
+               'Bed2', 'Surface2', 'Thickness2', 'Floatingice2', 'IceVolume2', 'IceVolumeAboveFloatation2', 'IceMass2', 'IceVolumeAboveFloatationScaled2', 'GroundedArea2', 'GroundedAreaScaled2', 'FloatingArea2', 'FloatingAreaScaled2',
+               'Bed3', 'Surface3', 'Thickness3', 'Floatingice3', 'IceVolume3', 'IceVolumeAboveFloatation3', 'IceMass3', 'IceVolumeAboveFloatationScaled3', 'GroundedArea3', 'GroundedAreaScaled3', 'FloatingArea3', 'FloatingAreaScaled3']
 
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-        1e-11,1e-10,2e-11,3e-11,2e-12,6e-12,2e-12,6e-12,2e-12,2e-12,6e-12,6e-12,
-        1e-10,1e-10,1e-10,5e-11,2e-12,5e-12,2e-12,5e-12,5e-11,7e-12,7e-11,7e-11]
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-11, 1e-10, 2e-11, 3e-11, 2e-12, 6e-12, 2e-12, 6e-12, 2.5e-12, 2.5e-12, 8e-12, 8e-12,
+                    1e-10, 1e-10, 1e-10, 5e-11, 2e-12, 5e-12, 2e-12, 5e-12, 5e-11, 7e-12, 7e-11, 7e-11]
 
-field_values=[md.results.TransientSolution[0].Base,
-        md.results.TransientSolution[0].Surface,
-        md.results.TransientSolution[0].Thickness,
-        md.results.TransientSolution[0].MaskGroundediceLevelset,
-        md.results.TransientSolution[0].IceVolume,
-        md.results.TransientSolution[0].IceVolumeAboveFloatation,
-	md.results.TransientSolution[0].IceMass,
-	md.results.TransientSolution[0].IceVolumeAboveFloatationScaled,
-	md.results.TransientSolution[0].GroundedArea,
-	md.results.TransientSolution[0].GroundedAreaScaled,
-	md.results.TransientSolution[0].FloatingArea,
-	md.results.TransientSolution[0].FloatingAreaScaled,
-        md.results.TransientSolution[1].Base,
-        md.results.TransientSolution[1].Surface,
-        md.results.TransientSolution[1].Thickness,
-        md.results.TransientSolution[1].MaskGroundediceLevelset,
-        md.results.TransientSolution[1].IceVolume,
-        md.results.TransientSolution[1].IceVolumeAboveFloatation,
-	md.results.TransientSolution[1].IceMass,
-	md.results.TransientSolution[1].IceVolumeAboveFloatationScaled,
-	md.results.TransientSolution[1].GroundedArea,
-	md.results.TransientSolution[1].GroundedAreaScaled,
-	md.results.TransientSolution[1].FloatingArea,
-	md.results.TransientSolution[1].FloatingAreaScaled,
-        md.results.TransientSolution[2].Base,
-        md.results.TransientSolution[2].Surface,
-        md.results.TransientSolution[2].Thickness,
-        md.results.TransientSolution[2].MaskGroundediceLevelset,
-        md.results.TransientSolution[2].IceVolume,
-        md.results.TransientSolution[2].IceVolumeAboveFloatation,
-	md.results.TransientSolution[2].IceMass,
-	md.results.TransientSolution[2].IceVolumeAboveFloatationScaled,
-	md.results.TransientSolution[2].GroundedArea,
-	md.results.TransientSolution[2].GroundedAreaScaled,
-	md.results.TransientSolution[2].FloatingArea,
-	md.results.TransientSolution[2].FloatingAreaScaled]
+field_values = [md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].MaskGroundediceLevelset,
+                md.results.TransientSolution[0].IceVolume,
+                md.results.TransientSolution[0].IceVolumeAboveFloatation,
+                md.results.TransientSolution[0].IceMass,
+                md.results.TransientSolution[0].IceVolumeAboveFloatationScaled,
+                md.results.TransientSolution[0].GroundedArea,
+                md.results.TransientSolution[0].GroundedAreaScaled,
+                md.results.TransientSolution[0].FloatingArea,
+                md.results.TransientSolution[0].FloatingAreaScaled,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].MaskGroundediceLevelset,
+                md.results.TransientSolution[1].IceVolume,
+                md.results.TransientSolution[1].IceVolumeAboveFloatation,
+                md.results.TransientSolution[1].IceMass,
+                md.results.TransientSolution[1].IceVolumeAboveFloatationScaled,
+                md.results.TransientSolution[1].GroundedArea,
+                md.results.TransientSolution[1].GroundedAreaScaled,
+                md.results.TransientSolution[1].FloatingArea,
+                md.results.TransientSolution[1].FloatingAreaScaled,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].MaskGroundediceLevelset,
+                md.results.TransientSolution[2].IceVolume,
+                md.results.TransientSolution[2].IceVolumeAboveFloatation,
+                md.results.TransientSolution[2].IceMass,
+                md.results.TransientSolution[2].IceVolumeAboveFloatationScaled,
+                md.results.TransientSolution[2].GroundedArea,
+                md.results.TransientSolution[2].GroundedAreaScaled,
+                md.results.TransientSolution[2].FloatingArea,
+                md.results.TransientSolution[2].FloatingAreaScaled]
Index: /issm/trunk/test/NightlyRun/test427.py
===================================================================
--- /issm/trunk/test/NightlyRun/test427.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test427.py	(revision 24313)
@@ -8,41 +8,41 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.initialization.vx[:]=0.
-md.initialization.vy[:]=0.
-md.geometry.base=-700.-abs(md.mesh.y-500000.)/1000.
-md.geometry.bed =-700.-abs(md.mesh.y-500000.)/1000.
-md.geometry.thickness[:]=1300
-md.geometry.surface=md.geometry.base+md.geometry.thickness
-md=setflowequation(md,'SSA','all')
-md.extrude(3,1.)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.initialization.vx[:] = 0.
+md.initialization.vy[:] = 0.
+md.geometry.base = -700. - abs(md.mesh.y - 500000.) / 1000.
+md.geometry.bed = -700. - abs(md.mesh.y - 500000.) / 1000.
+md.geometry.thickness[:] = 1300
+md.geometry.surface = md.geometry.base + md.geometry.thickness
+md = setflowequation(md, 'SSA', 'all')
+md.extrude(3, 1.)
 
-md.smb.mass_balance[:]=-150
-md.transient.isstressbalance=False
-md.transient.isgroundingline=True
-md.groundingline.migration='SoftMigration'
-md.groundingline.melt_interpolation='SubelementMelt1'
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md.smb.mass_balance[:] = -150
+md.transient.isstressbalance = False
+md.transient.isgroundingline = True
+md.groundingline.migration = 'SoftMigration'
+md.groundingline.melt_interpolation = 'SubelementMelt1'
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Bed1','Surface1','Thickness1','Floatingice1',
-									'Bed2','Surface2','Thickness2','Floatingice2',
-									'Bed3','Surface3','Thickness3','Floatingice3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,
-									5e-12,4e-12,7e-12,2e-11,
-									1e-10,5e-11,1e-10,7e-10]
-field_values=[md.results.TransientSolution[0].Base,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].MaskGroundediceLevelset,
-							md.results.TransientSolution[1].Base,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].MaskGroundediceLevelset,
-							md.results.TransientSolution[2].Base,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].MaskGroundediceLevelset]
+field_names = ['Bed1', 'Surface1', 'Thickness1', 'Floatingice1',
+               'Bed2', 'Surface2', 'Thickness2', 'Floatingice2',
+               'Bed3', 'Surface3', 'Thickness3', 'Floatingice3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13,
+                    5e-12, 4e-12, 7e-12, 2e-11,
+                    1e-10, 5e-11, 1e-10, 7e-10]
+field_values = [md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].MaskGroundediceLevelset,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].MaskGroundediceLevelset,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].MaskGroundediceLevelset]
Index: /issm/trunk/test/NightlyRun/test428.py
===================================================================
--- /issm/trunk/test/NightlyRun/test428.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test428.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfStressSSA2dNewton
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,20 +9,18 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md=setflowequation(md,'SSA','all')
-md.stressbalance.isnewton=1
-md.stressbalance.restol=0.0001
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.stressbalance.isnewton = 1
+md.stressbalance.restol = 0.0001
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vel','Pressure']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test429.py
===================================================================
--- /issm/trunk/test/NightlyRun/test429.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test429.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfStressHONewton
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,22 +9,20 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(5,1.)
-md=setflowequation(md,'HO','all')
-md.stressbalance.isnewton=1
-md.stressbalance.restol=0.0001
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(5, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.stressbalance.isnewton = 1
+md.stressbalance.restol = 0.0001
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[2e-06,2e-06,1e-06,2e-06,1e-06]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [2e-06, 2e-06, 1e-06, 2e-06, 1e-06]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test430.py
===================================================================
--- /issm/trunk/test/NightlyRun/test430.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test430.py	(revision 24313)
@@ -9,7 +9,7 @@
 from solve import *
 
-md = triangle(model(),'../Exp/Square.exp',100000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
+md = triangle(model(), '../Exp/Square.exp', 100000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
 md.initialization.vx[:] = 1.
 md.initialization.vy[:] = 1.
@@ -21,15 +21,15 @@
 md.geometry.base[pos] = md.geometry.bed[pos]
 md.geometry.surface = md.geometry.base + md.geometry.thickness
-md = setflowequation(md,'SSA','all')
+md = setflowequation(md, 'SSA', 'all')
 
 #Boundary conditions:
-md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices,))
+md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices, ))
 md.mask.ice_levelset[np.where(md.mesh.x == max(md.mesh.x))] = 0.
 md.stressbalance.spcvx[:] = float('NaN')
 md.stressbalance.spcvy[:] = float('NaN')
 md.stressbalance.spcvz[:] = float('NaN')
-posA = np.intersect1d(np.array(np.where(md.mesh.y < 1000000.1)),np.array(np.where(md.mesh.y > 999999.9)))
-posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)),np.array(np.where(md.mesh.y > -0.1)))
-pos = np.unique(np.concatenate((posA,posB)))
+posA = np.intersect1d(np.array(np.where(md.mesh.y < 1000000.1)), np.array(np.where(md.mesh.y > 999999.9)))
+posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > -0.1)))
+pos = np.unique(np.concatenate((posA, posB)))
 md.stressbalance.spcvy[pos] = 0.
 pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > -0.1)))
@@ -37,8 +37,8 @@
 md.stressbalance.spcvy[pos2] = 0.
 
-md.materials.rheology_B = 1. / ((10**-25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices,))
+md.materials.rheology_B = 1. / ((10**-25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices, ))
 md.materials.rheology_law = 'None'
-md.friction.coefficient[:] = np.sqrt(10**7) * np.ones((md.mesh.numberofvertices,))
-md.friction.p = 3. * np.ones((md.mesh.numberofelements,))
+md.friction.coefficient[:] = np.sqrt(10**7) * np.ones((md.mesh.numberofvertices, ))
+md.friction.p = 3. * np.ones((md.mesh.numberofelements, ))
 md.smb.mass_balance[:] = 1.
 md.basalforcings.groundedice_melting_rate[:] = 0.
@@ -49,12 +49,12 @@
 md.transient.ismasstransport = 1
 md.transient.issmb = 1
-md.transient.requested_outputs = ['default','BasalforcingsFloatingiceMeltingRate']
+md.transient.requested_outputs = ['default', 'BasalforcingsFloatingiceMeltingRate']
 md.groundingline.migration = 'SubelementMigration'
-md.groundingline.melt_interpolation= 'SubelementMelt1'
+md.groundingline.melt_interpolation = 'SubelementMelt1'
 md.timestepping.final_time = 30
 md.timestepping.time_step = 10
 
-md.cluster = generic('name',gethostname(),'np',3)
-md = solve(md,'Transient')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 #print md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate
 #print md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate
@@ -62,35 +62,32 @@
 
 #Fields and tolerances to track changes
-field_names     = [
-	'Bed1','Surface1','Thickness1','Floatingice1','Vx1','Vy1','Pressure1','FloatingiceMeltingrate1',
-	'Bed2','Surface2','Thickness2','Floatingice2','Vx2','Vy2','Pressure2','FloatingiceMeltingrate2',
-	'Bed3','Surface3','Thickness3','Floatingice3','Vx3','Vy3','Pressure3','FloatingiceMeltingrate3']
-field_tolerances = [2e-11,5e-12,2e-11,1e-11,5e-10,1e-08,1e-13,1e-13,
-	3e-11,3e-11,9e-10,7e-11,1e-09,5e-08,1e-10,1e-13,
-	1e-10,3e-11,1e-10,7e-11,1e-09,5e-08,1e-10,1e-13]
-field_values = [
-	md.results.TransientSolution[0].Base,
-	md.results.TransientSolution[0].Surface,
-	md.results.TransientSolution[0].Thickness,
-	md.results.TransientSolution[0].MaskGroundediceLevelset,
-	md.results.TransientSolution[0].Vx,
-	md.results.TransientSolution[0].Vy,
-	md.results.TransientSolution[0].Pressure,
-	md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate,
-	md.results.TransientSolution[1].Base,
-	md.results.TransientSolution[1].Surface,
-	md.results.TransientSolution[1].Thickness,
-	md.results.TransientSolution[1].MaskGroundediceLevelset,
-	md.results.TransientSolution[1].Vx,
-	md.results.TransientSolution[1].Vy,
-	md.results.TransientSolution[1].Pressure,
-	md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate,
-	md.results.TransientSolution[2].Base,
-	md.results.TransientSolution[2].Surface,
-	md.results.TransientSolution[2].Thickness,
-	md.results.TransientSolution[2].MaskGroundediceLevelset,
-	md.results.TransientSolution[2].Vx,
-	md.results.TransientSolution[2].Vy,
-	md.results.TransientSolution[2].Pressure,
-	md.results.TransientSolution[2].BasalforcingsFloatingiceMeltingRate,
-	]
+field_names = ['Bed1', 'Surface1', 'Thickness1', 'Floatingice1', 'Vx1', 'Vy1', 'Pressure1', 'FloatingiceMeltingrate1',
+               'Bed2', 'Surface2', 'Thickness2', 'Floatingice2', 'Vx2', 'Vy2', 'Pressure2', 'FloatingiceMeltingrate2',
+               'Bed3', 'Surface3', 'Thickness3', 'Floatingice3', 'Vx3', 'Vy3', 'Pressure3', 'FloatingiceMeltingrate3']
+field_tolerances = [2e-11, 5e-12, 2e-11, 1e-11, 5e-10, 1e-08, 1e-13, 1e-13,
+                    3e-11, 3e-11, 9e-10, 7e-11, 1e-09, 5e-08, 1e-10, 1e-13,
+                    1e-10, 3e-11, 1e-10, 7e-11, 1e-09, 5e-08, 1e-10, 1e-13]
+field_values = [md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].MaskGroundediceLevelset,
+                md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].MaskGroundediceLevelset,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].MaskGroundediceLevelset,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].BasalforcingsFloatingiceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test431.py
===================================================================
--- /issm/trunk/test/NightlyRun/test431.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test431.py	(revision 24313)
@@ -10,28 +10,26 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(3,2.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.timestepping.time_step=0.
-md.thermal.isenthalpy=1
-md.thermal.isdynamicbasalspc=1
-md.initialization.waterfraction=np.zeros((md.mesh.numberofvertices))
-md.initialization.watercolumn=np.zeros((md.mesh.numberofvertices))
-md=solve(md,'Steadystate')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.timestepping.time_step = 0.
+md.thermal.isenthalpy = 1
+md.thermal.isdynamicbasalspc = 1
+md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices))
+md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices))
+md = solve(md, 'Steadystate')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','Waterfraction','Enthalpy']
-field_tolerances=[8e-4,5e-4,5e-4,5e-4,1e-13,1e-4,5e-4,5e-4]
-field_values=[\
-	md.results.SteadystateSolution.Vx,\
-	md.results.SteadystateSolution.Vy,\
-	md.results.SteadystateSolution.Vz,\
-	md.results.SteadystateSolution.Vel,\
-	md.results.SteadystateSolution.Pressure,\
-	md.results.SteadystateSolution.Temperature,\
-	md.results.SteadystateSolution.Waterfraction,\
-	md.results.SteadystateSolution.Enthalpy,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure', 'Temperature', 'Waterfraction', 'Enthalpy']
+field_tolerances = [8e-4, 5e-4, 5e-4, 5e-4, 1e-13, 1e-4, 5e-4, 5e-4]
+field_values = [md.results.SteadystateSolution.Vx,
+                md.results.SteadystateSolution.Vy,
+                md.results.SteadystateSolution.Vz,
+                md.results.SteadystateSolution.Vel,
+                md.results.SteadystateSolution.Pressure,
+                md.results.SteadystateSolution.Temperature,
+                md.results.SteadystateSolution.Waterfraction,
+                md.results.SteadystateSolution.Enthalpy]
Index: /issm/trunk/test/NightlyRun/test432.py
===================================================================
--- /issm/trunk/test/NightlyRun/test432.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test432.py	(revision 24313)
@@ -10,27 +10,25 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(3,2.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.timestepping.time_step=0.
-md.thermal.isenthalpy=1
-md.initialization.waterfraction=np.zeros((md.mesh.numberofvertices))
-md.initialization.watercolumn=np.zeros((md.mesh.numberofvertices))
-md=solve(md,'Steadystate')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.timestepping.time_step = 0.
+md.thermal.isenthalpy = 1
+md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices))
+md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices))
+md = solve(md, 'Steadystate')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','Waterfraction','Enthalpy']
-field_tolerances=[3e-09,1e-09,1e-09,1e-09,1e-13,1e-10,4e-10,3e-9]
-field_values=[\
-	md.results.SteadystateSolution.Vx,\
-	md.results.SteadystateSolution.Vy,\
-	md.results.SteadystateSolution.Vz,\
-	md.results.SteadystateSolution.Vel,\
-	md.results.SteadystateSolution.Pressure,\
-	md.results.SteadystateSolution.Temperature,\
-	md.results.SteadystateSolution.Waterfraction,\
-	md.results.SteadystateSolution.Enthalpy,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure', 'Temperature', 'Waterfraction', 'Enthalpy']
+field_tolerances = [3e-09, 1e-09, 1e-09, 1e-09, 1e-13, 1e-10, 4e-10, 3e-9]
+field_values = [md.results.SteadystateSolution.Vx,
+                md.results.SteadystateSolution.Vy,
+                md.results.SteadystateSolution.Vz,
+                md.results.SteadystateSolution.Vel,
+                md.results.SteadystateSolution.Pressure,
+                md.results.SteadystateSolution.Temperature,
+                md.results.SteadystateSolution.Waterfraction,
+                md.results.SteadystateSolution.Enthalpy]
Index: /issm/trunk/test/NightlyRun/test433.py
===================================================================
--- /issm/trunk/test/NightlyRun/test433.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test433.py	(revision 24313)
@@ -10,51 +10,51 @@
 
 
-radius=1.e6
-shelfextent=2.e5
+radius = 1.e6
+shelfextent = 2.e5
 
-md=roundmesh(model(),radius,50000.)
-#fix center node to 0,0
-rad=np.sqrt(md.mesh.x**2+md.mesh.y**2)
-pos=np.argmin(rad)
-md.mesh.x[pos]=0.
-md.mesh.y[pos]=0.    #the closest node to the center is changed to be exactly at the center
-xelem=np.mean(md.mesh.x[md.mesh.elements.astype(int)-1],axis=1)
-yelem=np.mean(md.mesh.y[md.mesh.elements.astype(int)-1],axis=1)
-rad=np.sqrt(xelem**2+yelem**2)
-flags=np.zeros(md.mesh.numberofelements)
-pos=np.nonzero(rad>=(radius-shelfextent))
-flags[pos]=1
-md=setmask(md,flags,'') 
-md=parameterize(md,'../Par/RoundSheetShelf.py')
-md=setflowequation(md,'SSA','all')
-md.extrude(3,1.)
-md.cluster=generic('name',gethostname(),'np',3)
+md = roundmesh(model(), radius, 50000.)
+#fix center node to 0, 0
+rad = np.sqrt(md.mesh.x**2 + md.mesh.y**2)
+pos = np.argmin(rad)
+md.mesh.x[pos] = 0.
+md.mesh.y[pos] = 0.  #the closest node to the center is changed to be exactly at the center
+xelem = np.mean(md.mesh.x[md.mesh.elements.astype(int) - 1], axis=1)
+yelem = np.mean(md.mesh.y[md.mesh.elements.astype(int) - 1], axis=1)
+rad = np.sqrt(xelem**2 + yelem**2)
+flags = np.zeros(md.mesh.numberofelements)
+pos = np.nonzero(rad >= (radius - shelfextent))
+flags[pos] = 1
+md = setmask(md, flags, '')
+md = parameterize(md, '../Par/RoundSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.extrude(3, 1.)
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-md.transient.isthermal=False
-md.transient.ismasstransport=False
-md.transient.issmb=True
-md.transient.isstressbalance=False
-md.transient.isgroundingline=True
+md.transient.isthermal = False
+md.transient.ismasstransport = False
+md.transient.issmb = True
+md.transient.isstressbalance = False
+md.transient.isgroundingline = True
 
 #test different grounding line dynamics.
-md.groundingline.migration='AggressiveMigration'
-md=solve(md,'Transient')
-element_on_iceshelf_agressive=md.results.TransientSolution[0].MaskGroundediceLevelset
+md.groundingline.migration = 'AggressiveMigration'
+md = solve(md, 'Transient')
+element_on_iceshelf_agressive = md.results.TransientSolution[0].MaskGroundediceLevelset
 
-md.groundingline.migration='SoftMigration'
-md=solve(md,'Transient')
-element_on_iceshelf_soft=md.results.TransientSolution[0].MaskGroundediceLevelset
+md.groundingline.migration = 'SoftMigration'
+md = solve(md, 'Transient')
+element_on_iceshelf_soft = md.results.TransientSolution[0].MaskGroundediceLevelset
 
-md.groundingline.migration='SubelementMigration'
-md=solve(md,'Transient')
-element_on_iceshelf_subelement=md.results.TransientSolution[0].MaskGroundediceLevelset
+md.groundingline.migration = 'SubelementMigration'
+md = solve(md, 'Transient')
+element_on_iceshelf_subelement = md.results.TransientSolution[0].MaskGroundediceLevelset
 
-md.groundingline.migration='SubelementMigration'
-md.groundingline.friction_interpolation='SubelementFriction2'
-md=solve(md,'Transient')
-element_on_iceshelf_subelement2=md.results.TransientSolution[0].MaskGroundediceLevelset
+md.groundingline.migration = 'SubelementMigration'
+md.groundingline.friction_interpolation = 'SubelementFriction2'
+md = solve(md, 'Transient')
+element_on_iceshelf_subelement2 = md.results.TransientSolution[0].MaskGroundediceLevelset
 
 #Fields and tolerances to track changes
-field_names     =['ElementOnIceShelfAggressive','ElementOnIceShelfSoft','ElementOnIceShelfSubelement']
-field_tolerances=[1e-13,1e-13,1e-13]
-field_values=[element_on_iceshelf_agressive,element_on_iceshelf_soft,element_on_iceshelf_subelement]
+field_names = ['ElementOnIceShelfAggressive', 'ElementOnIceShelfSoft', 'ElementOnIceShelfSubelement']
+field_tolerances = [1e-13, 1e-13, 1e-13]
+field_values = [element_on_iceshelf_agressive, element_on_iceshelf_soft, element_on_iceshelf_subelement]
Index: /issm/trunk/test/NightlyRun/test434.py
===================================================================
--- /issm/trunk/test/NightlyRun/test434.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test434.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfL1L2
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,20 +9,18 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(4,1.)
-md=setflowequation(md,'L1L2','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(4, 1.)
+md = setflowequation(md, 'L1L2', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-06,1e-06,1e-06,1e-06,1e-07]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-06, 1e-06, 1e-06, 1e-06, 1e-07]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test435.py
===================================================================
--- /issm/trunk/test/NightlyRun/test435.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test435.py	(revision 24313)
@@ -9,7 +9,7 @@
 from solve import *
 
-md = triangle(model(),'../Exp/Square.exp',100000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
+md = triangle(model(), '../Exp/Square.exp', 100000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
 md.initialization.vx[:] = 1.
 md.initialization.vy[:] = 1.
@@ -21,16 +21,16 @@
 md.geometry.base[pos] = md.geometry.bed[pos]
 md.geometry.surface = md.geometry.base + md.geometry.thickness
-md = md.extrude(4,1.)
-md = setflowequation(md,'HO','all')
+md = md.extrude(4, 1.)
+md = setflowequation(md, 'HO', 'all')
 
 #Boundary conditions:
-md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices,))
+md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices, ))
 md.mask.ice_levelset[np.where(md.mesh.x == max(md.mesh.x))] = 0.
 md.stressbalance.spcvx[:] = float('Nan')
 md.stressbalance.spcvy[:] = float('Nan')
 md.stressbalance.spcvz[:] = float('Nan')
-posA = np.intersect1d(np.array(np.where(md.mesh.y < 1000000.1)),np.array(np.where(md.mesh.y > 999999.9)))
-posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)),np.array(np.where(md.mesh.y > -0.1)))
-pos = np.unique(np.concatenate((posA,posB)))
+posA = np.intersect1d(np.array(np.where(md.mesh.y < 1000000.1)), np.array(np.where(md.mesh.y > 999999.9)))
+posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > -0.1)))
+pos = np.unique(np.concatenate((posA, posB)))
 md.stressbalance.spcvy[pos] = 0.
 pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > -0.1)))
@@ -38,8 +38,8 @@
 md.stressbalance.spcvy[pos2] = 0.
 
-md.materials.rheology_B = 1. / ((10**-25)**(1./3.)) * np.ones((md.mesh.numberofvertices,))
+md.materials.rheology_B = 1. / ((10**-25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices, ))
 md.materials.rheology_law = 'None'
-md.friction.coefficient[:] = np.sqrt(1e7) * np.ones((md.mesh.numberofvertices,))
-md.friction.p = 3. * np.ones((md.mesh.numberofelements,))
+md.friction.coefficient[:] = np.sqrt(1e7) * np.ones((md.mesh.numberofvertices, ))
+md.friction.p = 3. * np.ones((md.mesh.numberofelements, ))
 md.smb.mass_balance[:] = 1.
 md.basalforcings.groundedice_melting_rate[:] = 0.
@@ -50,49 +50,45 @@
 md.transient.ismasstransport = 1
 md.transient.issmb = 1
-md.transient.requested_outputs = ['default','BasalforcingsFloatingiceMeltingRate']
+md.transient.requested_outputs = ['default', 'BasalforcingsFloatingiceMeltingRate']
 md.groundingline.migration = 'SubelementMigration'
-md.groundingline.melt_interpolation= 'SubelementMelt1'
+md.groundingline.melt_interpolation = 'SubelementMelt1'
 md.timestepping.final_time = 30
 md.timestepping.time_step = 10
 
-md.cluster = generic('name',gethostname(),'np',3)
-md = solve(md,'Transient')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     = [
-	'Bed1','Surface1','Thickness1','Floatingice1','Vx1','Vy1','Vz1','Pressure1','FloatingiceMeltingrate1',
-	'Bed2','Surface2','Thickness2','Floatingice2','Vx2','Vy2','Vz2','Pressure2','FloatingiceMeltingrate2',
-	'Bed3','Surface3','Thickness3','Floatingice3','Vx3','Vy3','Vz3','Pressure3','FloatingiceMeltingrate3']
-field_tolerances = [
-	2e-11,5e-12,2e-11,1e-11,7e-10,3e-08,6e-10,1e-13,1e-13,
-	3e-11,3e-11,9e-10,7e-11,9e-09,2e-07,1e-09,1e-10,1e-13,
-	1e-9,2e-08,7e-09,2e-7 ,1e-03,8e-04,2e-09,1e-10,1e-13]
-field_values = [
-	md.results.TransientSolution[0].Base,
-	md.results.TransientSolution[0].Surface,
-	md.results.TransientSolution[0].Thickness,
-	md.results.TransientSolution[0].MaskGroundediceLevelset,
-	md.results.TransientSolution[0].Vx,
-	md.results.TransientSolution[0].Vy,
-	md.results.TransientSolution[0].Vz,
-	md.results.TransientSolution[0].Pressure,
-	md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate,
-	md.results.TransientSolution[1].Base,
-	md.results.TransientSolution[1].Surface,
-	md.results.TransientSolution[1].Thickness,
-	md.results.TransientSolution[1].MaskGroundediceLevelset,
-	md.results.TransientSolution[1].Vx,
-	md.results.TransientSolution[1].Vy,
-	md.results.TransientSolution[1].Vz,
-	md.results.TransientSolution[1].Pressure,
-	md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate,
-	md.results.TransientSolution[2].Base,
-	md.results.TransientSolution[2].Surface,
-	md.results.TransientSolution[2].Thickness,
-	md.results.TransientSolution[2].MaskGroundediceLevelset,
-	md.results.TransientSolution[2].Vx,
-	md.results.TransientSolution[2].Vy,
-	md.results.TransientSolution[2].Vz,
-	md.results.TransientSolution[2].Pressure,
-	md.results.TransientSolution[2].BasalforcingsFloatingiceMeltingRate,
-	]
+field_names = ['Bed1', 'Surface1', 'Thickness1', 'Floatingice1', 'Vx1', 'Vy1', 'Vz1', 'Pressure1', 'FloatingiceMeltingrate1',
+               'Bed2', 'Surface2', 'Thickness2', 'Floatingice2', 'Vx2', 'Vy2', 'Vz2', 'Pressure2', 'FloatingiceMeltingrate2',
+               'Bed3', 'Surface3', 'Thickness3', 'Floatingice3', 'Vx3', 'Vy3', 'Vz3', 'Pressure3', 'FloatingiceMeltingrate3']
+field_tolerances = [2e-11, 5e-12, 2e-11, 1e-11, 7e-10, 3e-08, 6e-10, 1e-13, 1e-13,
+                    3e-11, 3e-11, 9e-10, 7e-11, 9e-09, 2e-07, 1e-09, 1e-10, 1e-13,
+                    1e-9, 2e-08, 7e-09, 2e-7, 1e-03, 8e-04, 2e-09, 1e-10, 1e-13]
+field_values = [md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].MaskGroundediceLevelset,
+                md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].MaskGroundediceLevelset,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].MaskGroundediceLevelset,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].BasalforcingsFloatingiceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test436.py
===================================================================
--- /issm/trunk/test/NightlyRun/test436.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test436.py	(revision 24313)
@@ -9,14 +9,14 @@
 from solve import *
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
-md = md.extrude(3,2.)
-md = setflowequation(md,'HO','all')
-md.cluster = generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = md.extrude(3, 2.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.timestepping.time_step = 0.
 md.thermal.isenthalpy = 1
-md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices,))
-md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices,))
+md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices, ))
 
 #Go solve
@@ -25,21 +25,18 @@
 field_values = []
 for i in ['LliboutryDuval', 'CuffeyTemperate']:
-	print ' '
-	print '====== Testing rheology law: ' + i + ' ====='
+    print(' ')
+    print(' == == == Testing rheology law: ' + i + ' = ')
 
-	md.materials.rheology_law = i
-	md = solve(md,'Steadystate')
-	field_names += ['Vx'+i,'Vy'+i,'Vz'+i,'Vel'+i,'Pressure'+i,
-		'Temperature'+i,'Waterfraction'+i,'Enthalpy'+i]
-	field_tolerances += [2e-09,1e-09,1e-09,1e-09,1e-13,2e-10,6e-10,1e-9]
-	field_values += [
-		md.results.SteadystateSolution.Vx,
-		md.results.SteadystateSolution.Vy,
-		md.results.SteadystateSolution.Vz,
-		md.results.SteadystateSolution.Vel,
-		md.results.SteadystateSolution.Pressure,
-		md.results.SteadystateSolution.Temperature,
-		md.results.SteadystateSolution.Waterfraction,
-		md.results.SteadystateSolution.Enthalpy,
-		]
-
+    md.materials.rheology_law = i
+    md = solve(md, 'Steadystate')
+    field_names += ['Vx' + i, 'Vy' + i, 'Vz' + i, 'Vel' + i, 'Pressure' + i,
+                    'Temperature' + i, 'Waterfraction' + i, 'Enthalpy' + i]
+    field_tolerances += [2e-09, 1e-09, 1e-09, 1e-09, 1e-13, 2e-10, 6e-10, 1e-9]
+    field_values += [md.results.SteadystateSolution.Vx,
+                     md.results.SteadystateSolution.Vy,
+                     md.results.SteadystateSolution.Vz,
+                     md.results.SteadystateSolution.Vel,
+                     md.results.SteadystateSolution.Pressure,
+                     md.results.SteadystateSolution.Temperature,
+                     md.results.SteadystateSolution.Waterfraction,
+                     md.results.SteadystateSolution.Enthalpy]
Index: /issm/trunk/test/NightlyRun/test437.py
===================================================================
--- /issm/trunk/test/NightlyRun/test437.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test437.py	(revision 24313)
@@ -9,23 +9,23 @@
 from solve import *
 
-md = triangle(model(),'../Exp/Square.exp',300000.)
-md = setmask(md,'','')
-md = parameterize(md,'../Par/SquareThermal.py')
+md = triangle(model(), '../Exp/Square.exp', 300000.)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/SquareThermal.py')
 
 h = 100.
-md.geometry.thickness = h * np.ones((md.mesh.numberofvertices,))
-md.geometry.base = -h * np.ones((md.mesh.numberofvertices,))
+md.geometry.thickness = h * np.ones((md.mesh.numberofvertices, ))
+md.geometry.base = -h * np.ones((md.mesh.numberofvertices, ))
 md.geometry.surface = md.geometry.base + md.geometry.thickness
 
-md.extrude(41,2.)
-md = setflowequation(md,'HO','all')
+md.extrude(41, 2.)
+md = setflowequation(md, 'HO', 'all')
 md.thermal.isenthalpy = True
 md.thermal.isdynamicbasalspc = True
 
 #Basal forcing
-Ts = 273.15-3.
-Tb = 273.15-1.
+Ts = 273.15 - 3.
+Tb = 273.15 - 1.
 Tsw = Tb
-qgeo = md.materials.thermalconductivity / max(md.geometry.thickness) * (Tb - Ts) #qgeo=kappa*(Tb-Ts)/H
+qgeo = md.materials.thermalconductivity / max(md.geometry.thickness) * (Tb - Ts)  #qgeo = kappa * (Tb - Ts) / H
 md.basalforcings.geothermalflux[np.where(md.mesh.vertexonbase)] = qgeo
 md.initialization.temperature = qgeo / md.materials.thermalconductivity * (md.geometry.surface - md.mesh.z) + Ts
@@ -33,6 +33,6 @@
 #Surface forcing
 pos = np.where(md.mesh.vertexonsurface)
-SPC_cold = float('NaN') * np.ones((md.mesh.numberofvertices,))
-SPC_warm = float('NaN') * np.ones((md.mesh.numberofvertices,))
+SPC_cold = float('NaN') * np.ones((md.mesh.numberofvertices, ))
+SPC_warm = float('NaN') * np.ones((md.mesh.numberofvertices, ))
 SPC_cold[pos] = Ts
 SPC_warm[pos] = Tsw
@@ -43,6 +43,6 @@
 t2 = 100.
 md.timestepping.final_time = 400.
-md.thermal.spctemperature = np.array([SPC_cold,SPC_cold,SPC_warm,SPC_warm,SPC_cold]).T
-md.thermal.spctemperature = np.vstack((md.thermal.spctemperature,[t0, t1-1, t1, t2-1, t2]))
+md.thermal.spctemperature = np.array([SPC_cold, SPC_cold, SPC_warm, SPC_warm, SPC_cold]).T
+md.thermal.spctemperature = np.vstack((md.thermal.spctemperature, [t0, t1 - 1, t1, t2 - 1, t2]))
 #print np.shape(md.thermal.spctemperature)
 #print md.thermal.spctemperature
@@ -57,40 +57,38 @@
 #Go solve
 md.verbose = verbose(0)
-md.cluster = generic('name',gethostname(),'np',3)
-md = solve(md,'Transient')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names = ['Enthalpy1','Temperature1','Waterfraction1','BasalMeltingRate1','Watercolumn1',
-		   'Enthalpy2','Temperature2','Waterfraction2','BasalMeltingRate2','Watercolumn2',
-		   'Enthalpy3','Temperature3','Waterfraction3','BasalMeltingRate3','Watercolumn3',
-		   'Enthalpy4','Temperature4','Waterfraction4','BasalMeltingRate4','Watercolumn4']
-field_tolerances = [1.e-10,1.e-10,1.e-10,1.e-9,1.e-10,
-		    1.e-10,1.e-10,1.e-10,2.e-9,2.e-10,
-		    1.e-10,1.e-10,1.e-10,2.e-9,1.e-10,
-		    1.e-10,1.e-10,1.e-10,2.e-9,1.e-10]
+field_names = ['Enthalpy1', 'Temperature1', 'Waterfraction1', 'BasalMeltingRate1', 'Watercolumn1',
+               'Enthalpy2', 'Temperature2', 'Waterfraction2', 'BasalMeltingRate2', 'Watercolumn2',
+               'Enthalpy3', 'Temperature3', 'Waterfraction3', 'BasalMeltingRate3', 'Watercolumn3',
+               'Enthalpy4', 'Temperature4', 'Waterfraction4', 'BasalMeltingRate4', 'Watercolumn4']
+field_tolerances = [1.e-10, 1.e-10, 1.e-10, 1.e-9, 1.e-10,
+                    1.e-10, 1.e-10, 1.e-10, 2.e-9, 2.e-10,
+                    1.e-10, 1.e-10, 1.e-10, 2.e-9, 1.e-10,
+                    1.e-10, 1.e-10, 1.e-10, 2.e-9, 1.e-10]
 i1 = 0
-i2 = int(np.ceil(t2 / md.timestepping.time_step) + 2)-1
-i3 = int(np.ceil(md.timestepping.final_time / (2. * md.timestepping.time_step)))-1
-i4 = np.shape(md.results.TransientSolution)[0]-1
-field_values = [
-	md.results.TransientSolution[i1].Enthalpy,
-	md.results.TransientSolution[i1].Temperature,
-	md.results.TransientSolution[i1].Waterfraction,
-	md.results.TransientSolution[i1].BasalforcingsGroundediceMeltingRate,
-	md.results.TransientSolution[i1].Watercolumn,
-	md.results.TransientSolution[i2].Enthalpy,
-	md.results.TransientSolution[i2].Temperature,
-	md.results.TransientSolution[i2].Waterfraction,
-	md.results.TransientSolution[i2].BasalforcingsGroundediceMeltingRate,
-	md.results.TransientSolution[i2].Watercolumn,
-	md.results.TransientSolution[i3].Enthalpy,
-	md.results.TransientSolution[i3].Temperature,
-	md.results.TransientSolution[i3].Waterfraction,
-	md.results.TransientSolution[i3].BasalforcingsGroundediceMeltingRate,
-	md.results.TransientSolution[i3].Watercolumn,
-	md.results.TransientSolution[i4].Enthalpy,
-	md.results.TransientSolution[i4].Temperature,
-	md.results.TransientSolution[i4].Waterfraction,
-	md.results.TransientSolution[i4].BasalforcingsGroundediceMeltingRate,
-	md.results.TransientSolution[i4].Watercolumn,
-	]
+i2 = int(np.ceil(t2 / md.timestepping.time_step) + 2) - 1
+i3 = int(np.ceil(md.timestepping.final_time / (2. * md.timestepping.time_step))) - 1
+i4 = np.shape(md.results.TransientSolution)[0] - 1
+field_values = [md.results.TransientSolution[i1].Enthalpy,
+                md.results.TransientSolution[i1].Temperature,
+                md.results.TransientSolution[i1].Waterfraction,
+                md.results.TransientSolution[i1].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[i1].Watercolumn,
+                md.results.TransientSolution[i2].Enthalpy,
+                md.results.TransientSolution[i2].Temperature,
+                md.results.TransientSolution[i2].Waterfraction,
+                md.results.TransientSolution[i2].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[i2].Watercolumn,
+                md.results.TransientSolution[i3].Enthalpy,
+                md.results.TransientSolution[i3].Temperature,
+                md.results.TransientSolution[i3].Waterfraction,
+                md.results.TransientSolution[i3].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[i3].Watercolumn,
+                md.results.TransientSolution[i4].Enthalpy,
+                md.results.TransientSolution[i4].Temperature,
+                md.results.TransientSolution[i4].Waterfraction,
+                md.results.TransientSolution[i4].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[i4].Watercolumn]
Index: /issm/trunk/test/NightlyRun/test438.py
===================================================================
--- /issm/trunk/test/NightlyRun/test438.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test438.py	(revision 24313)
@@ -10,44 +10,42 @@
 from frictionwaterlayer import *
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
-md = setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
 md.friction = frictionwaterlayer(md)
-md.friction.water_layer = np.zeros((md.mesh.numberofvertices+1,2))
-md.friction.water_layer[:,1] = 1.
-md.friction.water_layer[md.mesh.numberofvertices,:] = [1.,2.]
+md.friction.water_layer = np.zeros((md.mesh.numberofvertices + 1, 2))
+md.friction.water_layer[:, 1] = 1.
+md.friction.water_layer[md.mesh.numberofvertices, :] = [1., 2.]
 md.friction.f = 0.8
-md.cluster = generic('name',gethostname(),'np',3)
-md = solve(md,'Transient')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1',
-	      'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2',
-	      'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-		  1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-		  1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values = [
-	md.results.TransientSolution[0].Vx,
-	md.results.TransientSolution[0].Vy,
-	md.results.TransientSolution[0].Vel,
-	md.results.TransientSolution[0].Pressure,
-	md.results.TransientSolution[0].Base,
-	md.results.TransientSolution[0].Surface,
-	md.results.TransientSolution[0].Thickness,
-	md.results.TransientSolution[1].Vx,
-	md.results.TransientSolution[1].Vy,
-	md.results.TransientSolution[1].Vel,
-	md.results.TransientSolution[1].Pressure,
-	md.results.TransientSolution[1].Base,
-	md.results.TransientSolution[1].Surface,
-	md.results.TransientSolution[1].Thickness,
-	md.results.TransientSolution[2].Vx,
-	md.results.TransientSolution[2].Vy,
-	md.results.TransientSolution[2].Vel,
-	md.results.TransientSolution[2].Pressure,
-	md.results.TransientSolution[2].Base,
-	md.results.TransientSolution[2].Surface,
-	md.results.TransientSolution[2].Thickness
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness]
Index: /issm/trunk/test/NightlyRun/test439.m
===================================================================
--- /issm/trunk/test/NightlyRun/test439.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test439.m	(revision 24313)
@@ -16,5 +16,5 @@
 %Fields and tolerances to track changes
 field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3'};
-field_tolerances={2e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09};
+field_tolerances={2e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,2e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09};
 field_values={...
 	(md.results.TransientSolution(1).Vx),...
Index: /issm/trunk/test/NightlyRun/test439.py
===================================================================
--- /issm/trunk/test/NightlyRun/test439.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test439.py	(revision 24313)
@@ -10,46 +10,44 @@
 from frictionwaterlayer import *
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
-md = md.extrude(4,1.)
-md = setflowequation(md,'HO','all')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = md.extrude(4, 1.)
+md = setflowequation(md, 'HO', 'all')
 md.friction = frictionwaterlayer(md)
-md.friction.water_layer = np.zeros((md.mesh.numberofvertices+1,2))
-md.friction.water_layer[:,1] = 1.
-md.friction.water_layer[md.mesh.numberofvertices,:] = [1.,2.]
+md.friction.water_layer = np.zeros((md.mesh.numberofvertices + 1, 2))
+md.friction.water_layer[:, 1] = 1.
+md.friction.water_layer[md.mesh.numberofvertices, :] = [1., 2.]
 md.friction.f = 0.8
-md.groundingline.melt_interpolation='SubelementMelt2'
-md.cluster = generic('name',gethostname(),'np',3)
-md = solve(md,'Transient')
+md.groundingline.melt_interpolation = 'SubelementMelt2'
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1',
-	      'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2',
-	      'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3']
-field_tolerances = [2e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,
-		    1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,
-		    1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09]
-field_values = [
-	md.results.TransientSolution[0].Vx,
-	md.results.TransientSolution[0].Vy,
-	md.results.TransientSolution[0].Vel,
-	md.results.TransientSolution[0].Pressure,
-	md.results.TransientSolution[0].Base,
-	md.results.TransientSolution[0].Surface,
-	md.results.TransientSolution[0].Thickness,
-	md.results.TransientSolution[1].Vx,
-	md.results.TransientSolution[1].Vy,
-	md.results.TransientSolution[1].Vel,
-	md.results.TransientSolution[1].Pressure,
-	md.results.TransientSolution[1].Base,
-	md.results.TransientSolution[1].Surface,
-	md.results.TransientSolution[1].Thickness,
-	md.results.TransientSolution[2].Vx,
-	md.results.TransientSolution[2].Vy,
-	md.results.TransientSolution[2].Vel,
-	md.results.TransientSolution[2].Pressure,
-	md.results.TransientSolution[2].Base,
-	md.results.TransientSolution[2].Surface,
-	md.results.TransientSolution[2].Thickness
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3']
+field_tolerances = [2e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09,
+                    1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09,
+                    2e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09, 1e-09]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness]
Index: /issm/trunk/test/NightlyRun/test440.m
===================================================================
--- /issm/trunk/test/NightlyRun/test440.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test440.m	(revision 24313)
@@ -9,5 +9,5 @@
 md.qmu.numberofpartitions=md.mesh.numberofvertices;
 md=partitioner(md,'package','linear');
-md.qmu.partition=md.qmu.partition-1;
+md.qmu.vpartition=md.qmu.vpartition-1;
 md.qmu.isdakota=1;
 
@@ -55,5 +55,5 @@
 
 %project onto grid
-thickness=h(md.qmu.partition+1);
+thickness=h(md.qmu.vpartition+1);
 
 %Fields and tolerances to track changes
Index: /issm/trunk/test/NightlyRun/test440.py
===================================================================
--- /issm/trunk/test/NightlyRun/test440.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test440.py	(revision 24313)
@@ -2,6 +2,4 @@
 import numpy as np
 from model import *
-from socket import gethostname
-
 from triangle import *
 from setmask import *
@@ -9,19 +7,18 @@
 from setflowequation import *
 from solve import *
-
 from partitioner import *
 from normal_uncertain import *
 from response_function import *
 
-md = triangle(model(),'../Exp/Square.exp',200000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',oshostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 200000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', oshostname(), 'np', 3)
 
 #partitioning
 md.qmu.numberofpartitions = md.mesh.numberofvertices
-md = partitioner(md,'package','linear')
-md.qmu.partition = md.qmu.partition-1
+md = partitioner(md, 'package', 'linear')
+md.qmu.vpartition = md.qmu.vpartition - 1
 md.qmu.isdakota = 1
 
@@ -33,8 +30,8 @@
 
 #variables
-md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain('MaterialsRhoIce',md.materials.rho_ice,0.01)
+md.qmu.variables.rho_ice = normal_uncertain.normal_uncertain('MaterialsRhoIce', md.materials.rho_ice, 0.01)
 
 #responses
-md.qmu.responses.MaxVel = response_function.response_function('scaled_Thickness',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
+md.qmu.responses.MaxVel = response_function.response_function('scaled_Thickness', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
 
 #method
@@ -45,18 +42,18 @@
 md.qmu.params.interval_type = 'forward'
 
-if version>=6:
-	md.qmu.params.analysis_driver = 'matlab'
-	md.qmu.params.evaluation_scheduling = 'master'
-	md.qmu.params.processors_per_evaluation = 2
+if version >= 6:
+    md.qmu.params.analysis_driver = 'matlab'
+    md.qmu.params.evaluation_scheduling = 'master'
+    md.qmu.params.processors_per_evaluation = 2
 else:
-	md.qmu.params.analysis_driver='stressbalance'
-	md.qmu.params.evaluation_concurrency = 1
+    md.qmu.params.analysis_driver = 'stressbalance'
+    md.qmu.params.evaluation_concurrency = 1
 
-#imperative! 
-md.stressbalance.reltol = 10**-5 #tighten for qmu analysese
+#imperative!
+md.stressbalance.reltol = 10**-5  #tighten for qmu analysese
 
 #solve
-md.verbose = verbose('000000000')	# this line is recommended
-md = solve(md,'Stressbalance','overwrite','y')
+md.verbose = verbose('000000000')  # this line is recommended
+md = solve(md, 'Stressbalance', 'overwrite', 'y')
 md.qmu.results = md.results.dakota
 
@@ -64,11 +61,11 @@
 h = np.zeros(md.qmu.numberofpartitions)
 for i in range(md.qmu.numberofpartitions):
-	h[i] = md.qmu.results.dresp_out[i].mean
+    h[i] = md.qmu.results.dresp_out[i].mean
 
 #project onto grid
-thickness  = h[md.qmu.partition]
+thickness = h[md.qmu.vpartition]
 
 #Fields and tolerances to track changes
-field_names     = ['Thickness']
-field_tolerances= [1e-10]
+field_names = ['Thickness']
+field_tolerances = [1e-10]
 field_values = [thickness]
Index: /issm/trunk/test/NightlyRun/test441.py
===================================================================
--- /issm/trunk/test/NightlyRun/test441.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test441.py	(revision 24313)
@@ -9,7 +9,7 @@
 from solve import *
 
-md = triangle(model(),'../Exp/Square.exp',100000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
+md = triangle(model(), '../Exp/Square.exp', 100000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
 md.initialization.vx[:] = 1.
 md.initialization.vy[:] = 1.
@@ -21,15 +21,15 @@
 md.geometry.base[pos] = md.geometry.bed[pos]
 md.geometry.surface = md.geometry.base + md.geometry.thickness
-md = setflowequation(md,'SSA','all')
+md = setflowequation(md, 'SSA', 'all')
 
 #Boundary conditions:
-md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices,))
+md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices, ))
 md.mask.ice_levelset[np.where(md.mesh.x == max(md.mesh.x))] = 0.
 md.stressbalance.spcvx[:] = float('Nan')
 md.stressbalance.spcvy[:] = float('Nan')
 md.stressbalance.spcvz[:] = float('Nan')
-posA = np.intersect1d(np.array(np.where(md.mesh.y < 1000000.1)),np.array(np.where(md.mesh.y > 999999.9)))
-posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)),np.array(np.where(md.mesh.y > -0.1)))
-pos = np.unique(np.concatenate((posA,posB)))
+posA = np.intersect1d(np.array(np.where(md.mesh.y < 1000000.1)), np.array(np.where(md.mesh.y > 999999.9)))
+posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > -0.1)))
+pos = np.unique(np.concatenate((posA, posB)))
 md.stressbalance.spcvy[pos] = 0.
 pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > -0.1)))
@@ -37,8 +37,8 @@
 md.stressbalance.spcvy[pos2] = 0.
 
-md.materials.rheology_B = 1. / ((10**-25)**(1./3.)) * np.ones((md.mesh.numberofvertices,))
+md.materials.rheology_B = 1. / ((10**-25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices, ))
 md.materials.rheology_law = 'None'
-md.friction.coefficient[:] = np.sqrt(1e7) * np.ones((md.mesh.numberofvertices,))
-md.friction.p = 3. * np.ones((md.mesh.numberofelements,))
+md.friction.coefficient[:] = np.sqrt(1e7) * np.ones((md.mesh.numberofvertices, ))
+md.friction.p = 3. * np.ones((md.mesh.numberofelements, ))
 md.smb.mass_balance[:] = 1.
 md.basalforcings.groundedice_melting_rate[:] = 0.
@@ -49,47 +49,43 @@
 md.transient.ismasstransport = 1
 md.transient.issmb = 1
-md.transient.requested_outputs = ['default','BasalforcingsFloatingiceMeltingRate']
+md.transient.requested_outputs = ['default', 'BasalforcingsFloatingiceMeltingRate']
 md.groundingline.migration = 'SubelementMigration'
-md.groundingline.melt_interpolation= 'SubelementMelt2'
-md.groundingline.friction_interpolation= 'SubelementFriction2'
+md.groundingline.melt_interpolation = 'SubelementMelt2'
+md.groundingline.friction_interpolation = 'SubelementFriction2'
 md.timestepping.final_time = 30.
 md.timestepping.time_step = 10.
 
-md.cluster = generic('name',gethostname(),'np',3)
-md = solve(md,'Transient')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     = [
-	'Bed1','Surface1','Thickness1','Floatingice1','Vx1','Vy1','Pressure1','FloatingiceMeltingrate1',
-	'Bed2','Surface2','Thickness2','Floatingice2','Vx2','Vy2','Pressure2','FloatingiceMeltingrate2',
-	'Bed3','Surface3','Thickness3','Floatingice3','Vx3','Vy3','Pressure3','FloatingiceMeltingrate3']
-field_tolerances = [
-	2e-11,5e-12,2e-11,1e-11,5e-10,1e-08,1e-13,1e-13,
-	3e-11,3e-11,9e-10,7e-11,1e-09,5e-08,1e-10,1e-13,
-	1e-10,3e-11,1e-10,7e-11,1e-09,5e-08,1e-10,1e-13]
-field_values = [
-	md.results.TransientSolution[0].Base,
-	md.results.TransientSolution[0].Surface,
-	md.results.TransientSolution[0].Thickness,
-	md.results.TransientSolution[0].MaskGroundediceLevelset,
-	md.results.TransientSolution[0].Vx,
-	md.results.TransientSolution[0].Vy,
-	md.results.TransientSolution[0].Pressure,
-	md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate,
-	md.results.TransientSolution[1].Base,
-	md.results.TransientSolution[1].Surface,
-	md.results.TransientSolution[1].Thickness,
-	md.results.TransientSolution[1].MaskGroundediceLevelset,
-	md.results.TransientSolution[1].Vx,
-	md.results.TransientSolution[1].Vy,
-	md.results.TransientSolution[1].Pressure,
-	md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate,
-	md.results.TransientSolution[2].Base,
-	md.results.TransientSolution[2].Surface,
-	md.results.TransientSolution[2].Thickness,
-	md.results.TransientSolution[2].MaskGroundediceLevelset,
-	md.results.TransientSolution[2].Vx,
-	md.results.TransientSolution[2].Vy,
-	md.results.TransientSolution[2].Pressure,
-	md.results.TransientSolution[2].BasalforcingsFloatingiceMeltingRate,
-	]
+field_names = ['Bed1', 'Surface1', 'Thickness1', 'Floatingice1', 'Vx1', 'Vy1', 'Pressure1', 'FloatingiceMeltingrate1',
+               'Bed2', 'Surface2', 'Thickness2', 'Floatingice2', 'Vx2', 'Vy2', 'Pressure2', 'FloatingiceMeltingrate2',
+               'Bed3', 'Surface3', 'Thickness3', 'Floatingice3', 'Vx3', 'Vy3', 'Pressure3', 'FloatingiceMeltingrate3']
+field_tolerances = [2e-11, 5e-12, 2e-11, 1e-11, 5e-10, 1e-08, 1e-13, 1e-13,
+                    3e-11, 3e-11, 9e-10, 7e-11, 1e-09, 5e-08, 1e-10, 1e-13,
+                    1e-10, 3e-11, 1e-10, 7e-11, 1e-09, 5e-08, 1e-10, 1e-13]
+field_values = [md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].MaskGroundediceLevelset,
+                md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].MaskGroundediceLevelset,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].MaskGroundediceLevelset,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].BasalforcingsFloatingiceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test442.py
===================================================================
--- /issm/trunk/test/NightlyRun/test442.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test442.py	(revision 24313)
@@ -9,7 +9,7 @@
 from solve import *
 
-md = triangle(model(),'../Exp/Square.exp',100000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
+md = triangle(model(), '../Exp/Square.exp', 100000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
 md.initialization.vx[:] = 1.
 md.initialization.vy[:] = 1.
@@ -21,16 +21,16 @@
 md.geometry.base[pos] = md.geometry.bed[pos]
 md.geometry.surface = md.geometry.base + md.geometry.thickness
-md = md.extrude(4,1.)
-md = setflowequation(md,'HO','all')
+md = md.extrude(4, 1.)
+md = setflowequation(md, 'HO', 'all')
 
 #Boundary conditions:
-md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices,))
+md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices, ))
 md.mask.ice_levelset[np.where(md.mesh.x == max(md.mesh.x))] = 0.
 md.stressbalance.spcvx[:] = float('Nan')
 md.stressbalance.spcvy[:] = float('Nan')
 md.stressbalance.spcvz[:] = float('Nan')
-posA = np.intersect1d(np.array(np.where(md.mesh.y < 1000000.1)),np.array(np.where(md.mesh.y > 999999.9)))
-posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)),np.array(np.where(md.mesh.y > -0.1)))
-pos = np.unique(np.concatenate((posA,posB)))
+posA = np.intersect1d(np.array(np.where(md.mesh.y < 1000000.1)), np.array(np.where(md.mesh.y > 999999.9)))
+posB = np.intersect1d(np.array(np.where(md.mesh.y < 0.1)), np.array(np.where(md.mesh.y > -0.1)))
+pos = np.unique(np.concatenate((posA, posB)))
 md.stressbalance.spcvy[pos] = 0.
 pos2 = np.intersect1d(np.array(np.where(md.mesh.x < 0.1)), np.array(np.where(md.mesh.x > -0.1)))
@@ -38,8 +38,8 @@
 md.stressbalance.spcvy[pos2] = 0.
 
-md.materials.rheology_B = 1. / ((10**-25)**(1./3.)) * np.ones((md.mesh.numberofvertices,))
+md.materials.rheology_B = 1. / ((10**-25)**(1. / 3.)) * np.ones((md.mesh.numberofvertices, ))
 md.materials.rheology_law = 'None'
-md.friction.coefficient[:] = np.sqrt(1e7) * np.ones((md.mesh.numberofvertices,))
-md.friction.p = 3. * np.ones((md.mesh.numberofelements,))
+md.friction.coefficient[:] = np.sqrt(1e7) * np.ones((md.mesh.numberofvertices, ))
+md.friction.p = 3. * np.ones((md.mesh.numberofelements, ))
 md.smb.mass_balance[:] = 1.
 md.basalforcings.groundedice_melting_rate[:] = 0.
@@ -50,50 +50,46 @@
 md.transient.ismasstransport = 1
 md.transient.issmb = 1
-md.transient.requested_outputs = ['default','BasalforcingsFloatingiceMeltingRate']
+md.transient.requested_outputs = ['default', 'BasalforcingsFloatingiceMeltingRate']
 md.groundingline.migration = 'SubelementMigration'
-md.groundingline.friction_interpolation= 'SubelementFriction2'
-md.groundingline.melt_interpolation= 'SubelementMelt2'
+md.groundingline.friction_interpolation = 'SubelementFriction2'
+md.groundingline.melt_interpolation = 'SubelementMelt2'
 md.timestepping.final_time = 30
 md.timestepping.time_step = 10
 
-md.cluster = generic('name',gethostname(),'np',3)
-md = solve(md,'Transient')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     = [
-	'Bed1','Surface1','Thickness1','Floatingice1','Vx1','Vy1','Vz1','Pressure1','FloatingiceMeltingrate1',
-	'Bed2','Surface2','Thickness2','Floatingice2','Vx2','Vy2','Vz2','Pressure2','FloatingiceMeltingrate2',
-	'Bed3','Surface3','Thickness3','Floatingice3','Vx3','Vy3','Vz3','Pressure3','FloatingiceMeltingrate3']
-field_tolerances = [
-	2e-11,5e-12,2e-11,1e-11,5e-10,3e-08,6e-10,1e-13,1e-13,
-	3e-11,3e-11,9e-10,7e-11,7e-09,1e-07,1e-09,1e-10,1e-13,
-	1e-8,2e-08,7e-09,2e-7 ,1e-03,8e-04,2e-09,1e-10,1e-13]
-field_values = [
-	md.results.TransientSolution[0].Base,
-	md.results.TransientSolution[0].Surface,
-	md.results.TransientSolution[0].Thickness,
-	md.results.TransientSolution[0].MaskGroundediceLevelset,
-	md.results.TransientSolution[0].Vx,
-	md.results.TransientSolution[0].Vy,
-	md.results.TransientSolution[0].Vz,
-	md.results.TransientSolution[0].Pressure,
-	md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate,
-	md.results.TransientSolution[1].Base,
-	md.results.TransientSolution[1].Surface,
-	md.results.TransientSolution[1].Thickness,
-	md.results.TransientSolution[1].MaskGroundediceLevelset,
-	md.results.TransientSolution[1].Vx,
-	md.results.TransientSolution[1].Vy,
-	md.results.TransientSolution[1].Vz,
-	md.results.TransientSolution[1].Pressure,
-	md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate,
-	md.results.TransientSolution[2].Base,
-	md.results.TransientSolution[2].Surface,
-	md.results.TransientSolution[2].Thickness,
-	md.results.TransientSolution[2].MaskGroundediceLevelset,
-	md.results.TransientSolution[2].Vx,
-	md.results.TransientSolution[2].Vy,
-	md.results.TransientSolution[2].Vz,
-	md.results.TransientSolution[2].Pressure,
-	md.results.TransientSolution[2].BasalforcingsFloatingiceMeltingRate,
-	]
+field_names = ['Bed1', 'Surface1', 'Thickness1', 'Floatingice1', 'Vx1', 'Vy1', 'Vz1', 'Pressure1', 'FloatingiceMeltingrate1',
+               'Bed2', 'Surface2', 'Thickness2', 'Floatingice2', 'Vx2', 'Vy2', 'Vz2', 'Pressure2', 'FloatingiceMeltingrate2',
+               'Bed3', 'Surface3', 'Thickness3', 'Floatingice3', 'Vx3', 'Vy3', 'Vz3', 'Pressure3', 'FloatingiceMeltingrate3']
+field_tolerances = [2e-11, 5e-12, 2e-11, 1e-11, 5e-10, 3e-08, 6e-10, 1e-13, 1e-13,
+                    3e-11, 3e-11, 9e-10, 7e-11, 7e-09, 1e-07, 1e-09, 1e-10, 1e-13,
+                    1e-8, 2e-08, 7e-09, 2e-7, 1e-03, 8e-04, 2e-09, 1e-10, 1e-13]
+field_values = [md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].MaskGroundediceLevelset,
+                md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].BasalforcingsFloatingiceMeltingRate,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].MaskGroundediceLevelset,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].BasalforcingsFloatingiceMeltingRate,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].MaskGroundediceLevelset,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vz,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].BasalforcingsFloatingiceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test443.py
===================================================================
--- /issm/trunk/test/NightlyRun/test443.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test443.py	(revision 24313)
@@ -13,81 +13,79 @@
 from regionaloutput import regionaloutput
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.geometry.bed=copy.deepcopy(md.geometry.base)
-pos=np.nonzero(md.mask.groundedice_levelset<0.)
-md.geometry.bed[pos]=md.geometry.bed[pos]-10
-md.friction=frictioncoulomb()
-md.friction.coefficient=20*np.ones(md.mesh.numberofvertices)
-md.friction.p=1*np.ones(md.mesh.numberofelements)
-md.friction.q=1*np.ones(md.mesh.numberofelements)
-md.friction.coefficientcoulomb=0.02*np.ones(md.mesh.numberofvertices)
-md.transient.isthermal=False
-md.transient.isgroundingline=True
-md.groundingline.migration='AggressiveMigration';
-md.mesh.scale_factor=1.1*np.ones((md.mesh.numberofvertices))
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.geometry.bed = copy.deepcopy(md.geometry.base)
+pos = np.nonzero(md.mask.groundedice_levelset < 0.)
+md.geometry.bed[pos] = md.geometry.bed[pos] - 10
+md.friction = frictioncoulomb()
+md.friction.coefficient = 20 * np.ones(md.mesh.numberofvertices)
+md.friction.p = 1 * np.ones(md.mesh.numberofelements)
+md.friction.q = 1 * np.ones(md.mesh.numberofelements)
+md.friction.coefficientcoulomb = 0.02 * np.ones(md.mesh.numberofvertices)
+md.transient.isthermal = False
+md.transient.isgroundingline = True
+md.groundingline.migration = 'AggressiveMigration'
+md.mesh.scale_factor = 1.1 * np.ones((md.mesh.numberofvertices))
 
-md.settings.output_frequency=2
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md.settings.output_frequency = 2
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-regionalmask=np.zeros((md.mesh.numberofvertices))
-inflag=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,'../Exp/SquareHalfRight.exp','node',1)
+regionalmask = np.zeros((md.mesh.numberofvertices))
+inflag = ContourToMesh(md.mesh.elements, md.mesh.x, md.mesh.y, '../Exp/SquareHalfRight.exp', 'node', 1)
 regionalmask[np.nonzero(inflag)[0]] = 1.
-md.transient.requested_outputs=['default','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1','IceMass1','IceVolume1','IceVolumeAboveFloatation1','IceVolumeAboveFloatation2','IceVolumeAboveFloatation','IceMassScaled1','IceVolumeScaled1','IceVolumeAboveFloatationScaled1','IceVolumeAboveFloatationScaled2']
+md.transient.requested_outputs = ['default', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1', 'IceMass1', 'IceVolume1', 'IceVolumeAboveFloatation1', 'IceVolumeAboveFloatation2', 'IceVolumeAboveFloatation', 'IceMassScaled1', 'IceVolumeScaled1', 'IceVolumeAboveFloatationScaled1', 'IceVolumeAboveFloatationScaled2']
 
-md.outputdefinition.definitions=[regionaloutput('name','GroundedArea1','outputnamestring','GroundedArea','mask',regionalmask,'definitionstring','Outputdefinition1'),
-		regionaloutput('name','FloatingArea1','outputnamestring','FloatingArea','mask',regionalmask,'definitionstring','Outputdefinition2'),
-		regionaloutput('name','TotalFloatingBmb1','outputnamestring','TotalFloatingBmb','mask',regionalmask,'definitionstring','Outputdefinition3'),
-		regionaloutput('name','TotalGroundedBmb1','outputnamestring','TotalGroundedBmb','mask',regionalmask,'definitionstring','Outputdefinition4'),
-		regionaloutput('name','IceMass1','outputnamestring','IceMass','mask',regionalmask,'definitionstring','Outputdefinition5'),
-		regionaloutput('name','IceVolume1','outputnamestring','IceVolume','mask',regionalmask,'definitionstring','Outputdefinition6'),
-		regionaloutput('name','IceVolumeAboveFloatation1','outputnamestring','IceVolumeAboveFloatation','mask',regionalmask,'definitionstring','Outputdefinition7'),
-		regionaloutput('name','TotalSmb1','outputnamestring','TotalSmb','mask',regionalmask,'definitionstring','Outputdefinition8'),
-		regionaloutput('name','IceVolumeAboveFloatation2','outputnamestring','IceVolumeAboveFloatation','maskexpstring','../Exp/SquareHalfRight.exp','definitionstring','Outputdefinition9','model',md),
-		regionaloutput('name','IceMassScaled1','outputnamestring','IceMassScaled','mask',regionalmask,'definitionstring','Outputdefinition10'),
-		regionaloutput('name','IceVolumeScaled1','outputnamestring','IceVolumeScaled','mask',regionalmask,'definitionstring','Outputdefinition11'),
-		regionaloutput('name','IceVolumeAboveFloatationScaled1','outputnamestring','IceVolumeAboveFloatationScaled','mask',regionalmask,'definitionstring','Outputdefinition12'),
-		regionaloutput('name','IceVolumeAboveFloatationScaled2','outputnamestring','IceVolumeAboveFloatationScaled','maskexpstring','../Exp/SquareHalfRight.exp','definitionstring','Outputdefinition13','model',md)]
+md.outputdefinition.definitions = [regionaloutput('name', 'GroundedArea1', 'outputnamestring', 'GroundedArea', 'mask', regionalmask, 'definitionstring', 'Outputdefinition1'),
+                                   regionaloutput('name', 'FloatingArea1', 'outputnamestring', 'FloatingArea', 'mask', regionalmask, 'definitionstring', 'Outputdefinition2'),
+                                   regionaloutput('name', 'TotalFloatingBmb1', 'outputnamestring', 'TotalFloatingBmb', 'mask', regionalmask, 'definitionstring', 'Outputdefinition3'),
+                                   regionaloutput('name', 'TotalGroundedBmb1', 'outputnamestring', 'TotalGroundedBmb', 'mask', regionalmask, 'definitionstring', 'Outputdefinition4'),
+                                   regionaloutput('name', 'IceMass1', 'outputnamestring', 'IceMass', 'mask', regionalmask, 'definitionstring', 'Outputdefinition5'),
+                                   regionaloutput('name', 'IceVolume1', 'outputnamestring', 'IceVolume', 'mask', regionalmask, 'definitionstring', 'Outputdefinition6'),
+                                   regionaloutput('name', 'IceVolumeAboveFloatation1', 'outputnamestring', 'IceVolumeAboveFloatation', 'mask', regionalmask, 'definitionstring', 'Outputdefinition7'),
+                                   regionaloutput('name', 'TotalSmb1', 'outputnamestring', 'TotalSmb', 'mask', regionalmask, 'definitionstring', 'Outputdefinition8'),
+                                   regionaloutput('name', 'IceVolumeAboveFloatation2', 'outputnamestring', 'IceVolumeAboveFloatation', 'maskexpstring', '../Exp/SquareHalfRight.exp', 'definitionstring', 'Outputdefinition9', 'model', md),
+                                   regionaloutput('name', 'IceMassScaled1', 'outputnamestring', 'IceMassScaled', 'mask', regionalmask, 'definitionstring', 'Outputdefinition10'),
+                                   regionaloutput('name', 'IceVolumeScaled1', 'outputnamestring', 'IceVolumeScaled', 'mask', regionalmask, 'definitionstring', 'Outputdefinition11'),
+                                   regionaloutput('name', 'IceVolumeAboveFloatationScaled1', 'outputnamestring', 'IceVolumeAboveFloatationScaled', 'mask', regionalmask, 'definitionstring', 'Outputdefinition12'),
+                                   regionaloutput('name', 'IceVolumeAboveFloatationScaled2', 'outputnamestring', 'IceVolumeAboveFloatationScaled', 'maskexpstring', '../Exp/SquareHalfRight.exp', 'definitionstring', 'Outputdefinition13', 'model', md)]
 
-md.extrude(3,1.)
-md2=copy.deepcopy(md)
+md.extrude(3, 1.)
+md2 = copy.deepcopy(md)
 md2.collapse()
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['IceMass1','IceVolume1','IceVolumeAboveFloatation1','IceVolumeAboveFloatation21','Thickness1','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1','IceMassScaled1','IceVolumeScaled1','IceVolumeAboveFloatationScaled1','IceVolumeAboveFloatationScaled21','IceMass3','IceVolume3','IceVolumeAboveFloatation3','IceVolumeAboveFloatation23','Thickness3','GroundedArea3','FloatingArea3','TotalFloatingBmb3','TotalGroundedBmb3','TotalSmb3','IceMassScaled3','IceVolumeScaled3','IceVolumeAboveFloatationScaled3','IceVolumeAboveFloatationScaled23','ExtrudedMask','CollapsedMask']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].IceMass1,\
-	md.results.TransientSolution[0].IceVolume1,\
-	md.results.TransientSolution[0].IceVolumeAboveFloatation1,\
-	md.results.TransientSolution[0].IceVolumeAboveFloatation2,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].GroundedArea1,\
-	md.results.TransientSolution[0].FloatingArea1,\
-	md.results.TransientSolution[0].TotalFloatingBmb1,\
-	md.results.TransientSolution[0].TotalGroundedBmb1,\
-	md.results.TransientSolution[0].TotalSmb1,\
-	md.results.TransientSolution[0].IceMassScaled1,\
-	md.results.TransientSolution[0].IceVolumeScaled1,\
-	md.results.TransientSolution[0].IceVolumeAboveFloatationScaled1,\
-	md.results.TransientSolution[0].IceVolumeAboveFloatationScaled2,\
-	md.results.TransientSolution[2].IceMass1,\
-	md.results.TransientSolution[2].IceVolume1,\
-	md.results.TransientSolution[2].IceVolumeAboveFloatation1,\
-	md.results.TransientSolution[2].IceVolumeAboveFloatation2,\
-	md.results.TransientSolution[2].Thickness,\
-	md.results.TransientSolution[2].GroundedArea1,\
-	md.results.TransientSolution[2].FloatingArea1,\
-	md.results.TransientSolution[2].TotalFloatingBmb1,\
-	md.results.TransientSolution[2].TotalGroundedBmb1,\
-	md.results.TransientSolution[2].TotalSmb1,\
-	md.results.TransientSolution[2].IceMassScaled1,\
-	md.results.TransientSolution[2].IceVolumeScaled1,\
-	md.results.TransientSolution[2].IceVolumeAboveFloatationScaled1,\
-	md.results.TransientSolution[2].IceVolumeAboveFloatationScaled2,\
-	len(md.outputdefinition.definitions[0].mask),\
-	len(md2.outputdefinition.definitions[0].mask),\
-	]
+field_names = ['IceMass1', 'IceVolume1', 'IceVolumeAboveFloatation1', 'IceVolumeAboveFloatation21', 'Thickness1', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1', 'IceMassScaled1', 'IceVolumeScaled1', 'IceVolumeAboveFloatationScaled1', 'IceVolumeAboveFloatationScaled21', 'IceMass3', 'IceVolume3', 'IceVolumeAboveFloatation3', 'IceVolumeAboveFloatation23', 'Thickness3', 'GroundedArea3', 'FloatingArea3', 'TotalFloatingBmb3', 'TotalGroundedBmb3', 'TotalSmb3', 'IceMassScaled3', 'IceVolumeScaled3', 'IceVolumeAboveFloatationScaled3', 'IceVolumeAboveFloatationScaled23', 'ExtrudedMask', 'CollapsedMask']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].IceMass1,
+                md.results.TransientSolution[0].IceVolume1,
+                md.results.TransientSolution[0].IceVolumeAboveFloatation1,
+                md.results.TransientSolution[0].IceVolumeAboveFloatation2,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].GroundedArea1,
+                md.results.TransientSolution[0].FloatingArea1,
+                md.results.TransientSolution[0].TotalFloatingBmb1,
+                md.results.TransientSolution[0].TotalGroundedBmb1,
+                md.results.TransientSolution[0].TotalSmb1,
+                md.results.TransientSolution[0].IceMassScaled1,
+                md.results.TransientSolution[0].IceVolumeScaled1,
+                md.results.TransientSolution[0].IceVolumeAboveFloatationScaled1,
+                md.results.TransientSolution[0].IceVolumeAboveFloatationScaled2,
+                md.results.TransientSolution[2].IceMass1,
+                md.results.TransientSolution[2].IceVolume1,
+                md.results.TransientSolution[2].IceVolumeAboveFloatation1,
+                md.results.TransientSolution[2].IceVolumeAboveFloatation2,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].GroundedArea1,
+                md.results.TransientSolution[2].FloatingArea1,
+                md.results.TransientSolution[2].TotalFloatingBmb1,
+                md.results.TransientSolution[2].TotalGroundedBmb1,
+                md.results.TransientSolution[2].TotalSmb1,
+                md.results.TransientSolution[2].IceMassScaled1,
+                md.results.TransientSolution[2].IceVolumeScaled1,
+                md.results.TransientSolution[2].IceVolumeAboveFloatationScaled1,
+                md.results.TransientSolution[2].IceVolumeAboveFloatationScaled2,
+                len(md.outputdefinition.definitions[0].mask),
+                len(md2.outputdefinition.definitions[0].mask)]
Index: /issm/trunk/test/NightlyRun/test444.m
===================================================================
--- /issm/trunk/test/NightlyRun/test444.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test444.m	(revision 24313)
@@ -86,5 +86,5 @@
 md.qmu.numberofpartitions=10;
 md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
-md.qmu.partition=md.qmu.partition-1;
+md.qmu.vpartition=md.qmu.vpartition-1;
 md.qmu.isdakota=1;
 
Index: /issm/trunk/test/NightlyRun/test444.py
===================================================================
--- /issm/trunk/test/NightlyRun/test444.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test444.py	(revision 24313)
@@ -1,7 +1,5 @@
 #Test Name: SquareShelfTranForceNeg2dDakotaLocal
 import numpy as np
-from os import getcwd
 from model import *
-from socket import gethostname
 from triangle import *
 from setmask import *
@@ -15,15 +13,15 @@
 from regionaloutput import *
 
-#model not consistent:  equality thickness=surface-base violated
+#model not consistent:  equality thickness = surface-base violated
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
 md.geometry.bed = md.geometry.base.copy()
 pos = np.where(md.mask.groundedice_levelset < 0)
-md.geometry.bed[pos] = md.geometry.base[pos]-10
-md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices,))
-md.friction.p = np.ones((md.mesh.numberofelements,))
-md.friction.q = np.ones((md.mesh.numberofelements,))
+md.geometry.bed[pos] = md.geometry.base[pos] - 10
+md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices, ))
+md.friction.p = np.ones((md.mesh.numberofelements, ))
+md.friction.q = np.ones((md.mesh.numberofelements, ))
 md.transient.isthermal = 0
 md.transient.isgroundingline = 1
@@ -31,32 +29,32 @@
 
 md.settings.output_frequency = 3
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',oshostname(),'np',3)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', oshostname(), 'np', 3)
 
-regionalmask = np.zeros((md.mesh.numberofvertices,))
-c_in = ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,'../Exp/SquareHalfRight.exp','node',1)
+regionalmask = np.zeros((md.mesh.numberofvertices, ))
+c_in = ContourToMesh(md.mesh.elements, md.mesh.x, md.mesh.y, '../Exp/SquareHalfRight.exp', 'node', 1)
 regionalmask[np.where(c_in)] = 1
-md.transient.requested_outputs = ['default','GroundedArea','FloatingArea','IceVolumeAboveFloatation','GroundedArea1','FloatingArea1','TotalFloatingBmb1','TotalGroundedBmb1','TotalSmb1',
-	'IceMass1','IceVolume1','IceVolumeAboveFloatation1','IceVolumeAboveFloatation']
-md.outputdefinition.definitions.append(regionaloutput('name','GroundedArea1','outputnamestring','GroundedArea','mask',regionalmask,
-	'definitionstring','Outputdefinition1'))
-md.outputdefinition.definitions.append(regionaloutput('name','FloatingArea1','outputnamestring','FloatingArea','mask',regionalmask,
-	'definitionstring','Outputdefinition2'))
-md.outputdefinition.definitions.append(regionaloutput('name','TotalFloatingBmb1','outputnamestring','TotalFloatingBmb','mask',regionalmask,
-	'definitionstring','Outputdefinition3'))
-md.outputdefinition.definitions.append(regionaloutput('name','TotalGroundedBmb1','outputnamestring','TotalGroundedBmb','mask',regionalmask,
-	'definitionstring','Outputdefinition4'))
-md.outputdefinition.definitions.append(regionaloutput('name','IceMass1','outputnamestring','IceMass','mask',regionalmask,
-	'definitionstring','Outputdefinition5'))
-md.outputdefinition.definitions.append(regionaloutput('name','IceVolume1','outputnamestring','IceVolume','mask',regionalmask,
-	'definitionstring','Outputdefinition6'))
-md.outputdefinition.definitions.append(regionaloutput('name','IceVolumeAboveFloatation1','outputnamestring','IceVolumeAboveFloatation','mask',regionalmask,
-	'definitionstring','Outputdefinition7'))
-md.outputdefinition.definitions.append(regionaloutput('name','TotalSmb1','outputnamestring','TotalSmb','mask',regionalmask,
-	'definitionstring','Outputdefinition8'))
-md.outputdefinition.definitions.append(regionaloutput('name','TotalSmb2','outputnamestring','TotalSmb','mask',regionalmask,
-	 'definitionstring','Outputdefinition9'))
+md.transient.requested_outputs = ['default', 'GroundedArea', 'FloatingArea', 'IceVolumeAboveFloatation', 'GroundedArea1', 'FloatingArea1', 'TotalFloatingBmb1', 'TotalGroundedBmb1', 'TotalSmb1',
+                                  'IceMass1', 'IceVolume1', 'IceVolumeAboveFloatation1', 'IceVolumeAboveFloatation']
+md.outputdefinition.definitions.append(regionaloutput('name', 'GroundedArea1', 'outputnamestring', 'GroundedArea', 'mask', regionalmask,
+                                                      'definitionstring', 'Outputdefinition1'))
+md.outputdefinition.definitions.append(regionaloutput('name', 'FloatingArea1', 'outputnamestring', 'FloatingArea', 'mask', regionalmask,
+                                                      'definitionstring', 'Outputdefinition2'))
+md.outputdefinition.definitions.append(regionaloutput('name', 'TotalFloatingBmb1', 'outputnamestring', 'TotalFloatingBmb', 'mask', regionalmask,
+                                                      'definitionstring', 'Outputdefinition3'))
+md.outputdefinition.definitions.append(regionaloutput('name', 'TotalGroundedBmb1', 'outputnamestring', 'TotalGroundedBmb', 'mask', regionalmask,
+                                                      'definitionstring', 'Outputdefinition4'))
+md.outputdefinition.definitions.append(regionaloutput('name', 'IceMass1', 'outputnamestring', 'IceMass', 'mask', regionalmask,
+                                                      'definitionstring', 'Outputdefinition5'))
+md.outputdefinition.definitions.append(regionaloutput('name', 'IceVolume1', 'outputnamestring', 'IceVolume', 'mask', regionalmask,
+                                                      'definitionstring', 'Outputdefinition6'))
+md.outputdefinition.definitions.append(regionaloutput('name', 'IceVolumeAboveFloatation1', 'outputnamestring', 'IceVolumeAboveFloatation', 'mask', regionalmask,
+                                                      'definitionstring', 'Outputdefinition7'))
+md.outputdefinition.definitions.append(regionaloutput('name', 'TotalSmb1', 'outputnamestring', 'TotalSmb', 'mask', regionalmask,
+                                                      'definitionstring', 'Outputdefinition8'))
+md.outputdefinition.definitions.append(regionaloutput('name', 'TotalSmb2', 'outputnamestring', 'TotalSmb', 'mask', regionalmask,
+                                                      'definitionstring', 'Outputdefinition9'))
 
-md.extrude(3,1.)
+md.extrude(3, 1.)
 md.collapse()
 
@@ -68,22 +66,22 @@
 
 #variables
-md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_BasalforcingsFloatingiceMeltingRate',1,0.1)
+md.qmu.variables.drag_coefficient = normal_uncertain.normal_uncertain('scaled_BasalforcingsFloatingiceMeltingRate', 1, 0.1)
 
 #responses
-md.qmu.responses.IceMass1 = response_function.response_function('Outputdefinition5',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.IceVolume1 = response_function.response_function('Outputdefinition6',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.IceVolumeAboveFloatation1 = response_function.response_function('Outputdefinition7',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.IceVolumeAboveFloatation = response_function.response_function('IceVolumeAboveFloatation',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.GroundedArea1 = response_function.response_function('Outputdefinition1',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.FloatingArea1 = response_function.response_function('Outputdefinition2',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.TotalFloatingBmb1 = response_function.response_function('Outputdefinition3',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.TotalGroundedBmb1 = response_function.response_function('Outputdefinition4',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.TotalSmb1 = response_function.response_function('Outputdefinition8',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.TotalSmb2 = response_function.response_function('Outputdefinition9',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
-md.qmu.responses.FloatingArea = response_function.response_function('FloatingArea',[],[0.0001,0.001,0.01,0.25,0.5,0.75,0.99,0.999,0.9999])
+md.qmu.responses.IceMass1 = response_function.response_function('Outputdefinition5', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.IceVolume1 = response_function.response_function('Outputdefinition6', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.IceVolumeAboveFloatation1 = response_function.response_function('Outputdefinition7', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.IceVolumeAboveFloatation = response_function.response_function('IceVolumeAboveFloatation', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.GroundedArea1 = response_function.response_function('Outputdefinition1', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.FloatingArea1 = response_function.response_function('Outputdefinition2', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.TotalFloatingBmb1 = response_function.response_function('Outputdefinition3', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.TotalGroundedBmb1 = response_function.response_function('Outputdefinition4', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.TotalSmb1 = response_function.response_function('Outputdefinition8', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.TotalSmb2 = response_function.response_function('Outputdefinition9', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.FloatingArea = response_function.response_function('FloatingArea', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
 
 #method
 md.qmu.method = dakota_method.dakota_method('nond_samp')
-md.qmu.method = dmeth_params_set(md.qmu.method,'seed',1234,'samples',20,'sample_type','random')
+md.qmu.method = dmeth_params_set(md.qmu.method, 'seed', 1234, 'samples', 20, 'sample_type', 'random')
 
 #parameters
@@ -93,22 +91,22 @@
 
 if version >= 6:
-	md.qmu.params.analysis_driver = 'matlab'
-	md.qmu.params.evaluation_scheduling = 'master'
-	md.qmu.params.processors_per_evaluation = 2
+    md.qmu.params.analysis_driver = 'matlab'
+    md.qmu.params.evaluation_scheduling = 'master'
+    md.qmu.params.processors_per_evaluation = 2
 else:
-	md.qmu.params.analysis_driver = 'stressbalance'
-	md.qmu.params.evaluation_concurrency = 1
+    md.qmu.params.analysis_driver = 'stressbalance'
+    md.qmu.params.evaluation_concurrency = 1
 
 #partitioning
 md.qmu.numberofpartitions = 10
-md = partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on')
-md.qmu.partition = md.qmu.partition-1
+md = partitioner(md, 'package', 'chaco', 'npart', md.qmu.numberofpartitions, 'weighting', 'on')
+md.qmu.vpartition = md.qmu.vpartition - 1
 md.qmu.isdakota = 1
 
-md.stressbalance.reltol = 10**-5 #tighten for qmu analyses
+md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
 
 #solve
-md.verbose = verbose('000000000')	# this line is recommended
-md = solve(md,'Transient','overwrite','y')
+md.verbose = verbose('000000000')  # this line is recommended
+md = solve(md, 'Transient', 'overwrite', 'y')
 
 #Fields and tolerances to track changes
@@ -118,10 +116,10 @@
 md.results.dakota.montecarlo = []
 for i in range(11):
-	md.results.dakota.montecarlo.append(md.results.dakota.dresp_out[i].mean)
+    md.results.dakota.montecarlo.append(md.results.dakota.dresp_out[i].mean)
 
 for i in range(11):
-	md.results.dakota.montecarlo.append(md.results.dakota.dresp_out[i].stddev)
+    md.results.dakota.montecarlo.append(md.results.dakota.dresp_out[i].stddev)
 
-field_names      = ['montecarlo']
+field_names = ['montecarlo']
 field_tolerances = [1e-11]
 field_values = [md.results.dakota.montecarlo]
Index: /issm/trunk/test/NightlyRun/test445.m
===================================================================
--- /issm/trunk/test/NightlyRun/test445.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test445.m	(revision 24313)
@@ -0,0 +1,84 @@
+%Test Name: SquareSheetShelfSteaEnthalpyHO3dDakotaSampNeff
+md=triangle(model(),'../Exp/Square.exp',150000.);
+md=setmask(md,'../Exp/SquareShelf.exp','');
+md=parameterize(md,'../Par/SquareSheetShelf.par');
+md=extrude(md,3,2.);
+md=setflowequation(md,'HO','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.timestepping.time_step=0.;
+md.thermal.isenthalpy=1;
+md.thermal.isdynamicbasalspc=1;
+md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+md.initialization.watercolumn=zeros(md.mesh.numberofvertices,1);
+
+md.friction.coupling=3;
+md.friction.effective_pressure=md.materials.rho_ice*md.constants.g*md.geometry.thickness+md.materials.rho_water*md.constants.g*md.geometry.base;
+
+%dakota version
+version=IssmConfig('_DAKOTA_VERSION_'); version=version(1:3); version=str2num(version);
+
+%variables
+md.qmu.variables.neff=normal_uncertain('scaled_FrictionEffectivePressure',1,.05);
+md.qmu.variables.geoflux=normal_uncertain('scaled_BasalforcingsGeothermalflux',1,.05);
+
+%responses
+md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+md.qmu.responses.MassFlux1=response_function('indexed_MassFlux_1',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+md.qmu.responses.MassFlux2=response_function('indexed_MassFlux_2',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+md.qmu.responses.MassFlux3=response_function('indexed_MassFlux_3',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+md.qmu.responses.MassFlux4=response_function('indexed_MassFlux_4',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+md.qmu.responses.MassFlux5=response_function('indexed_MassFlux_5',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+md.qmu.responses.MassFlux6=response_function('indexed_MassFlux_6',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+md.qmu.responses.MassFlux7=response_function('indexed_MassFlux_7',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+
+%mass flux profiles
+md.qmu.mass_flux_profiles={'../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp','../Exp/Square.exp'};
+md.qmu.mass_flux_profile_directory=pwd;
+
+md.qmu.method     =dakota_method('nond_samp');
+md.qmu.method(end)=dmeth_params_set(md.qmu.method(end),...
+	'seed',1234,...
+	'samples',20,...
+	'sample_type','random');
+
+%%  a variety of parameters
+md.qmu.params.direct=true;
+md.qmu.params.analysis_components='';
+md.qmu.params.tabular_graphics_data=true;
+
+if version>=6,
+	md.qmu.params.analysis_driver='matlab';
+	md.qmu.params.evaluation_scheduling='master';
+	md.qmu.params.processors_per_evaluation=2;
+else
+	md.qmu.params.analysis_driver='stressbalance';
+	md.qmu.params.evaluation_concurrency=1;
+end
+
+%partitioning
+md.qmu.numberofpartitions=10;
+md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
+md.qmu.vpartition=md.qmu.vpartition-1;
+md.qmu.isdakota=1;
+
+md.stressbalance.reltol=10^-5; %tighten for qmu analyses
+
+md=solve(md,'Steadystate','overwrite','y');
+
+%Fields and tolerances to track changes
+md.qmu.results=md.results.dakota;
+
+%we put all the mean and stdev data in the montecarlo field, which we will use to test for success.
+md.results.dakota.montecarlo=[];
+for i=1:8,
+	md.results.dakota.montecarlo=[md.results.dakota.montecarlo md.results.dakota.dresp_out(i).mean];
+end
+for i=1:8,
+	md.results.dakota.montecarlo=[md.results.dakota.montecarlo md.results.dakota.dresp_out(i).stddev];
+end
+field_names     ={'montecarlo'};
+field_tolerances={2e-10};
+field_values={...
+	md.results.dakota.montecarlo,...
+	};
+
Index: /issm/trunk/test/NightlyRun/test445.py
===================================================================
--- /issm/trunk/test/NightlyRun/test445.py	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test445.py	(revision 24313)
@@ -0,0 +1,97 @@
+#Test Name: SquareSheetShelfSteaEnthalpyHO3dDakotaSampNeff
+import numpy as np
+from os import getcwd
+from model import *
+from socket import gethostname
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+from partitioner import *
+from dmeth_params_set import *
+from ContourToMesh import *
+
+#model not consistent:  equality thickness = surface-base violated
+
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.timestepping.time_step = 0.
+md.thermal.isenthalpy = 1
+md.thermal.isdynamicbasalspc = 1
+md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices))
+md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices))
+
+md.friction.coupling = 3
+md.friction.effective_pressure = md.materials.rho_ice * md.constants.g * md.geometry.thickness + md.materials.rho_water * md.constants.g * md.geometry.base
+
+#dakota version
+version = IssmConfig('_DAKOTA_VERSION_')
+version = float(version[0])
+
+#variables
+md.qmu.variables.neff = normal_uncertain.normal_uncertain('scaled_FrictionEffectivePressure', 1, .05)
+md.qmu.variables.geoflux = normal_uncertain.normal_uncertain('scaled_BasalforcingsGeothermalflux', 1, .05)
+
+#responses
+md.qmu.responses.MaxVel = response_function.response_function('MaxVel', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux1 = response_function.response_function('indexed_MassFlux_1', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux2 = response_function.response_function('indexed_MassFlux_2', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux3 = response_function.response_function('indexed_MassFlux_3', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux4 = response_function.response_function('indexed_MassFlux_4', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux5 = response_function.response_function('indexed_MassFlux_5', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux6 = response_function.response_function('indexed_MassFlux_6', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+md.qmu.responses.MassFlux7 = response_function.response_function('indexed_MassFlux_7', [], [0.0001, 0.001, 0.01, 0.25, 0.5, 0.75, 0.99, 0.999, 0.9999])
+
+#mass flux profiles
+md.qmu.mass_flux_profiles = ['../Exp/MassFlux1.exp', '../Exp/MassFlux2.exp', '../Exp/MassFlux3.exp', '../Exp/MassFlux4.exp', '../Exp/MassFlux5.exp', '../Exp/MassFlux6.exp', '../Exp/Square.exp']
+md.qmu.mass_flux_profile_directory = getcwd()
+
+#method
+md.qmu.method = dakota_method.dakota_method('nond_samp')
+md.qmu.method = dmeth_params_set(md.qmu.method, 'seed', 1234, 'samples', 20, 'sample_type', 'random')
+
+#parameters
+md.qmu.params.direct = True
+md.qmu.params.analysis_components = ''
+md.qmu.params.tabular_graphics_data = True
+
+if version >= 6:
+    md.qmu.params.analysis_driver = 'matlab'
+    md.qmu.params.evaluation_scheduling = 'master'
+    md.qmu.params.processors_per_evaluation = 2
+else:
+    md.qmu.params.analysis_driver = 'stressbalance'
+    md.qmu.params.evaluation_concurrency = 1
+
+#partitioning
+md.qmu.numberofpartitions = 10
+md = partitioner(md, 'package', 'chaco', 'npart', md.qmu.numberofpartitions, 'weighting', 'on')
+md.qmu.vpartition = md.qmu.vpartition - 1
+md.qmu.isdakota = 1
+
+md.stressbalance.reltol = 10**-5  #tighten for qmu analyses
+
+
+#solve
+md.verbose = verbose('000000000')  # this line is recommended
+md = solve(md, 'Steadystate', 'overwrite', 'y')
+
+#Fields and tolerances to track changes
+md.qmu.results = md.results.dakota
+
+#we put all the mean and stdev data in the montecarlo field, which we will use to test for success.
+md.results.dakota.montecarlo = []
+for i in range(8):
+    md.results.dakota.montecarlo.append(md.results.dakota.dresp_out[i].mean)
+
+for i in range(8):
+    md.results.dakota.montecarlo.append(md.results.dakota.dresp_out[i].stddev)
+
+field_names = ['montecarlo']
+field_tolerances = [2e-10]
+field_values = [md.results.dakota.montecarlo]
Index: /issm/trunk/test/NightlyRun/test450.py
===================================================================
--- /issm/trunk/test/NightlyRun/test450.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test450.py	(revision 24313)
@@ -1,7 +1,5 @@
 #Test Name: SquareSheetShelfStressSSAHigherOrder
-import numpy as np
 from model import *
 from socket import gethostname
-
 from triangle import *
 from setmask import *
@@ -10,22 +8,20 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',150000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-field_names=[]
-field_tolerances=[]
-field_values=[]
-for i in ['P1bubble','P1bubblecondensed','P2']:
-	md.flowequation.fe_SSA=i
-	md=solve(md,'Stressbalance')
-	field_names     =field_names+['Vx'+i,'Vy'+i,'Vel'+i,'Pressure'+i]
-	field_tolerances=field_tolerances+[1e-12,1e-13,1e-13,1e-13]
-	field_values=field_values+[\
-		md.results.StressbalanceSolution.Vx,\
-		md.results.StressbalanceSolution.Vy,\
-		md.results.StressbalanceSolution.Vel,\
-		md.results.StressbalanceSolution.Pressure,\
-		]
+field_names = []
+field_tolerances = []
+field_values = []
+for i in ['P1bubble', 'P1bubblecondensed', 'P2']:
+    md.flowequation.fe_SSA = i
+    md = solve(md, 'Stressbalance')
+    field_names = field_names + ['Vx' + i, 'Vy' + i, 'Vel' + i, 'Pressure' + i]
+    field_tolerances = field_tolerances + [1e-12, 1e-13, 1e-13, 1e-13]
+    field_values = field_values + [md.results.StressbalanceSolution.Vx,
+                                   md.results.StressbalanceSolution.Vy,
+                                   md.results.StressbalanceSolution.Vel,
+                                   md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test455.py
===================================================================
--- /issm/trunk/test/NightlyRun/test455.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test455.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfStressHOHigherOrder
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,24 +9,22 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md.extrude(5,1.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md.extrude(5, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
-field_names=[]
-field_tolerances=[]
-field_values=[]
-for i in ['P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P1xP3','P2xP4']:
-	md.flowequation.fe_HO=i
-	md=solve(md,'Stressbalance')
-	field_names     =field_names+['Vx'+i,'Vy'+i,'Vz'+i,'Vel'+i,'Pressure'+i]
-	field_tolerances=field_tolerances+[7e-08,6e-08,6e-08,6e-08,3e-13]
-	field_values=field_values+[\
-			md.results.StressbalanceSolution.Vx,\
-			md.results.StressbalanceSolution.Vy,\
-			md.results.StressbalanceSolution.Vz,\
-			md.results.StressbalanceSolution.Vel,\
-			md.results.StressbalanceSolution.Pressure,\
-			]
+field_names = []
+field_tolerances = []
+field_values = []
+for i in ['P1bubble', 'P1bubblecondensed', 'P1xP2', 'P2xP1', 'P2', 'P1xP3', 'P2xP4']:
+    md.flowequation.fe_HO = i
+    md = solve(md, 'Stressbalance')
+    field_names = field_names + ['Vx' + i, 'Vy' + i, 'Vz' + i, 'Vel' + i, 'Pressure' + i]
+    field_tolerances = field_tolerances + [7e-08, 6e-08, 6e-08, 6e-08, 3e-13]
+    field_values = field_values + [md.results.StressbalanceSolution.Vx,
+                                   md.results.StressbalanceSolution.Vy,
+                                   md.results.StressbalanceSolution.Vz,
+                                   md.results.StressbalanceSolution.Vel,
+                                   md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test460.m
===================================================================
--- /issm/trunk/test/NightlyRun/test460.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test460.m	(revision 24313)
@@ -21,5 +21,5 @@
 	md=solve(md,'Stressbalance');
 	field_names     ={field_names{:},['Vx' i{1}],['Vy' i{1}],['Vz' i{1}],['Vel' i{1}],['Pressure' i{1}]};
-	field_tolerances={field_tolerances{:},2e-06,3e-06,2e-06,2e-06,5e-07};
+	field_tolerances={field_tolerances{:},7e-06,2e-05,2e-06,5e-06,8e-07};
 	field_values={field_values{:},...
 		(md.results.StressbalanceSolution.Vx),...
Index: /issm/trunk/test/NightlyRun/test460.py
===================================================================
--- /issm/trunk/test/NightlyRun/test460.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test460.py	(revision 24313)
@@ -10,29 +10,27 @@
 from matestar import *
 
-md=triangle(model(),'../Exp/Square.exp',180000.)
-md=setmask(md,'../Exp/SquareShelf.exp','')
-md=parameterize(md,'../Par/SquareSheetShelf.py')
-md = md.extrude(3,1.)
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = md.extrude(3, 1.)
 md.materials = matestar()
-md.materials.rheology_B = 3.15e8 * np.ones((md.mesh.numberofvertices,))
-md.materials.rheology_Ec = np.ones((md.mesh.numberofvertices,))
-md.materials.rheology_Es = 3 * np.ones((md.mesh.numberofvertices,))
-md.cluster = generic('name',gethostname(),'np',3)
+md.materials.rheology_B = 3.15e8 * np.ones((md.mesh.numberofvertices, ))
+md.materials.rheology_Ec = np.ones((md.mesh.numberofvertices, ))
+md.materials.rheology_Es = 3 * np.ones((md.mesh.numberofvertices, ))
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 #Go solve
-field_names=[]
-field_tolerances=[]
-field_values=[]
-#md.initialization.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.y);
-for i in ['SSA','HO','FS']:
-	md = setflowequation(md,i,'all')
-	md = solve(md,'Stressbalance')
-	field_names     = field_names + ['Vx'+i,'Vy'+i,'Vz'+i,'Vel'+i,'Pressure'+i]
-	field_tolerances = field_tolerances + [2e-06,3e-06,2e-06,2e-06,5e-07]
-	field_values = field_values + [
-			md.results.StressbalanceSolution.Vx,
-			md.results.StressbalanceSolution.Vy,
-			md.results.StressbalanceSolution.Vz,
-			md.results.StressbalanceSolution.Vel,
-			md.results.StressbalanceSolution.Pressure,
-			]
+field_names = []
+field_tolerances = []
+field_values = []
+#md.initialization.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface - md.mesh.y)
+for i in ['SSA', 'HO', 'FS']:
+    md = setflowequation(md, i, 'all')
+    md = solve(md, 'Stressbalance')
+    field_names = field_names + ['Vx' + i, 'Vy' + i, 'Vz' + i, 'Vel' + i, 'Pressure' + i]
+    field_tolerances = field_tolerances + [7e-06, 2e-05, 2e-06, 5e-06, 8e-07]
+    field_values = field_values + [md.results.StressbalanceSolution.Vx,
+                                   md.results.StressbalanceSolution.Vy,
+                                   md.results.StressbalanceSolution.Vz,
+                                   md.results.StressbalanceSolution.Vel,
+                                   md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test461.py
===================================================================
--- /issm/trunk/test/NightlyRun/test461.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test461.py	(revision 24313)
@@ -10,16 +10,16 @@
 from matestar import *
 
-md = triangle(model(),'../Exp/Square.exp',180000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
-md = md.extrude(3,1.)
+md = triangle(model(), '../Exp/Square.exp', 180000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = md.extrude(3, 1.)
 md.materials = matestar()
-md.materials.rheology_B = 3.15e8 * np.ones((md.mesh.numberofvertices,))
-md.materials.rheology_Ec = np.ones((md.mesh.numberofvertices,))
-md.materials.rheology_Es = 3. * np.ones((md.mesh.numberofvertices,))
+md.materials.rheology_B = 3.15e8 * np.ones((md.mesh.numberofvertices, ))
+md.materials.rheology_Ec = np.ones((md.mesh.numberofvertices, ))
+md.materials.rheology_Es = 3. * np.ones((md.mesh.numberofvertices, ))
 
-md = setflowequation(md,'FS','all')
-md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices,))
-md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices,))
+md = setflowequation(md, 'FS', 'all')
+md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices, ))
 md.transient.isstressbalance = 0
 md.transient.ismasstransport = 0
@@ -29,25 +29,21 @@
 md.thermal.isenthalpy = 1
 md.thermal.isdynamicbasalspc = 1
-md.cluster = generic('name',gethostname(),'np',3)
-md = solve(md,'Transient')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names = [
-	'Enthalpy1','Waterfraction1','Temperature1',
-	'Enthalpy2','Waterfraction2','Temperature2',
-	'Enthalpy3','Waterfraction3','Temperature3']
-field_tolerances = [
-	1e-12,1e-11,1e-12,
-	1e-12,1e-10,1e-12,
-	1e-12,1e-9,1e-12]
-field_values = [
-	   md.results.TransientSolution[0].Enthalpy,
-	   md.results.TransientSolution[0].Waterfraction,
-	   md.results.TransientSolution[0].Temperature,
-	   md.results.TransientSolution[1].Enthalpy,
-	   md.results.TransientSolution[1].Waterfraction,
-	   md.results.TransientSolution[1].Temperature,
-	   md.results.TransientSolution[2].Enthalpy,
-	   md.results.TransientSolution[2].Waterfraction,
-	   md.results.TransientSolution[2].Temperature,
-	   ]
+field_names = ['Enthalpy1', 'Waterfraction1', 'Temperature1',
+               'Enthalpy2', 'Waterfraction2', 'Temperature2',
+               'Enthalpy3', 'Waterfraction3', 'Temperature3']
+field_tolerances = [1e-12, 1e-11, 1e-12,
+                    1e-12, 1e-10, 1e-12,
+                    1e-12, 1e-9, 1e-12]
+field_values = [md.results.TransientSolution[0].Enthalpy,
+                md.results.TransientSolution[0].Waterfraction,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[1].Enthalpy,
+                md.results.TransientSolution[1].Waterfraction,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[2].Enthalpy,
+                md.results.TransientSolution[2].Waterfraction,
+                md.results.TransientSolution[2].Temperature]
Index: /issm/trunk/test/NightlyRun/test462.py
===================================================================
--- /issm/trunk/test/NightlyRun/test462.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test462.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfAmrBamgField
-import numpy as np
 from model import *
 from socket import gethostname
@@ -9,9 +8,9 @@
 from solve import *
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.transient.isstressbalance = 1
 md.transient.ismasstransport = 1
@@ -37,13 +36,11 @@
 md.timestepping.final_time = 3
 md.timestepping.time_step = 1
-md = solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     = ['Vx','Vy','Vel','Pressure']
-field_tolerances = [1e-13,1e-13,1e-13,1e-13]
-field_values = [
-	md.results.TransientSolution[2].Vx,
-	md.results.TransientSolution[2].Vy,
-	md.results.TransientSolution[2].Vel,
-	md.results.TransientSolution[2].Pressure,
-	]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure]
Index: /issm/trunk/test/NightlyRun/test463.py
===================================================================
--- /issm/trunk/test/NightlyRun/test463.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test463.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfAmrBamgGroundingline
-import numpy as np
 from model import *
 from socket import gethostname
@@ -9,9 +8,9 @@
 from solve import *
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.transient.isstressbalance = 1
 md.transient.ismasstransport = 1
@@ -37,13 +36,11 @@
 md.timestepping.final_time = 3
 md.timestepping.time_step = 1
-md = solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     = ['Vx','Vy','Vel','Pressure']
-field_tolerances = [1e-8,1e-8,1e-8,1e-8]
-field_values = [
-	md.results.TransientSolution[2].Vx,
-	md.results.TransientSolution[2].Vy,
-	md.results.TransientSolution[2].Vel,
-	md.results.TransientSolution[2].Pressure,
-	]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure']
+field_tolerances = [1e-8, 1e-8, 1e-8, 1e-8]
+field_values = [md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure]
Index: /issm/trunk/test/NightlyRun/test464.py
===================================================================
--- /issm/trunk/test/NightlyRun/test464.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test464.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfAmrBamgIceFront
-import numpy as np
 from model import *
 from socket import gethostname
@@ -9,9 +8,9 @@
 from solve import *
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.transient.isstressbalance = 1
 md.transient.ismasstransport = 1
@@ -37,13 +36,11 @@
 md.timestepping.final_time = 3
 md.timestepping.time_step = 1
-md = solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     = ['Vx','Vy','Vel','Pressure']
-field_tolerances = [1e-13,1e-13,1e-13,1e-13]
-field_values = [
-	md.results.TransientSolution[2].Vx,
-	md.results.TransientSolution[2].Vy,
-	md.results.TransientSolution[2].Vel,
-	md.results.TransientSolution[2].Pressure,
-	]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure]
Index: /issm/trunk/test/NightlyRun/test465.py
===================================================================
--- /issm/trunk/test/NightlyRun/test465.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test465.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: SquareSheetShelfAmrBamgAll
-import numpy as np
 from model import *
 from socket import gethostname
@@ -9,9 +8,9 @@
 from solve import *
 
-md = triangle(model(),'../Exp/Square.exp',150000.)
-md = setmask(md,'../Exp/SquareShelf.exp','')
-md = parameterize(md,'../Par/SquareSheetShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 150000.)
+md = setmask(md, '../Exp/SquareShelf.exp', '')
+md = parameterize(md, '../Par/SquareSheetShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 md.transient.isstressbalance = 1
 md.transient.ismasstransport = 1
@@ -37,13 +36,11 @@
 md.timestepping.final_time = 3
 md.timestepping.time_step = 1
-md = solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     = ['Vx','Vy','Vel','Pressure']
-field_tolerances = [1e-8,1e-8,1e-8,1e-8]
-field_values = [
-	md.results.TransientSolution[2].Vx,
-	md.results.TransientSolution[2].Vy,
-	md.results.TransientSolution[2].Vel,
-	md.results.TransientSolution[2].Pressure,
-	]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure']
+field_tolerances = [1e-8, 1e-8, 1e-8, 1e-8]
+field_values = [md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure]
Index: /issm/trunk/test/NightlyRun/test471.m
===================================================================
--- /issm/trunk/test/NightlyRun/test471.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test471.m	(revision 24313)
@@ -0,0 +1,79 @@
+%Test Name: PicopMeltRate
+md=triangle(model(),'../Exp/Square.exp',90000.);
+md=setmask(md,'../Exp/SquareShelf.exp','');
+md=parameterize(md,'../Par/SquareSheetShelf.par');
+md.initialization.vx(:)=1.;
+md.initialization.vy(:)=1.;
+md.geometry.thickness(:)=500-md.mesh.x/10000;
+md.geometry.bed =-100-md.mesh.x/1000;
+md.geometry.base=-md.geometry.thickness*md.materials.rho_ice/md.materials.rho_water;
+md.mask.groundedice_levelset=md.geometry.thickness+md.materials.rho_water/md.materials.rho_ice*md.geometry.bed;
+pos=find(md.mask.groundedice_levelset>=0);
+md.geometry.base(pos)=md.geometry.bed(pos);
+md.geometry.surface=md.geometry.base+md.geometry.thickness;
+md=setflowequation(md,'SSA','all');
+
+%Set Pico Parameters
+md.basalforcings = basalforcingspico(md.basalforcings);
+md.basalforcings.basin_id = zeros(md.mesh.numberofelements,1);
+yE = mean(md.mesh.y(md.mesh.elements),2);
+pos1 = find(yE>=5e5);	 md.basalforcings.basin_id(pos1)=1;
+pos2 = find(yE<5e5);     md.basalforcings.basin_id(pos2)=2;
+md.basalforcings.num_basins = 2;
+md.basalforcings.farocean_temperature = [271.15 272.15 273.15; 274.15 275.15 276.15; 0.5 1 1.5]; %K
+md.basalforcings.farocean_salinity    = [31 32 33; 34 35 36; 0.5 1 1.5]; %PSU                
+md.basalforcings.maxboxcount=5;
+md.basalforcings.isplume = 1;
+
+%Boundary conditions:
+md.mask.ice_levelset=-ones(md.mesh.numberofvertices,1);
+md.mask.ice_levelset(find(md.mesh.x==max(md.mesh.x)))=0;
+
+%Model conditions
+md.transient.isthermal=0;
+md.transient.isstressbalance=1;
+md.transient.isgroundingline=1;
+md.transient.ismasstransport=1;
+md.transient.issmb=1;
+md.transient.requested_outputs={'default','BasalforcingsFloatingiceMeltingRate'};
+md.groundingline.migration='SubelementMigration';
+md.groundingline.friction_interpolation='SubelementFriction1';
+md.groundingline.melt_interpolation='SubelementMelt1';
+md.timestepping.final_time=1.5;
+md.timestepping.time_step=0.5;
+
+md.cluster=generic('name',oshostname(),'np',3);
+md=solve(md,'Transient');
+
+field_names     ={'Bed1','Surface1','Thickness1','Floatingice1','Vx1','Vy1','Pressure1','FloatingiceMeltingrate1',...
+	   'Bed2','Surface2','Thickness2','Floatingice2','Vx2','Vy2','Pressure2','FloatingiceMeltingrate2',...
+	   'Bed3','Surface3','Thickness3','Floatingice3','Vx3','Vy3','Pressure3','FloatingiceMeltingrate3'};
+field_tolerances={7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-10,...
+	   7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-10,...
+	   7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-10};
+field_values={...
+	   (md.results.TransientSolution(1).Base),...
+	   (md.results.TransientSolution(1).Surface),...
+	   (md.results.TransientSolution(1).Thickness),...
+	   (md.results.TransientSolution(1).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(1).Vx),...
+	   (md.results.TransientSolution(1).Vy),...
+	   (md.results.TransientSolution(1).Pressure),...
+	   (md.results.TransientSolution(1).BasalforcingsFloatingiceMeltingRate),...
+	   (md.results.TransientSolution(2).Base),...
+	   (md.results.TransientSolution(2).Surface),...
+	   (md.results.TransientSolution(2).Thickness),...
+	   (md.results.TransientSolution(2).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(2).Vx),...
+	   (md.results.TransientSolution(2).Vy),...
+	   (md.results.TransientSolution(2).Pressure),...
+	   (md.results.TransientSolution(2).BasalforcingsFloatingiceMeltingRate),...
+	   (md.results.TransientSolution(3).Base),...
+	   (md.results.TransientSolution(3).Surface),...
+	   (md.results.TransientSolution(3).Thickness),...
+	   (md.results.TransientSolution(3).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(3).Vx),...
+	   (md.results.TransientSolution(3).Vy),...
+	   (md.results.TransientSolution(3).Pressure),...
+	   (md.results.TransientSolution(3).BasalforcingsFloatingiceMeltingRate),...
+	   };
Index: /issm/trunk/test/NightlyRun/test472.m
===================================================================
--- /issm/trunk/test/NightlyRun/test472.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test472.m	(revision 24313)
@@ -0,0 +1,94 @@
+%Test Name: ISMIP6MeltRateTest
+md=triangle(model(),'../Exp/Square.exp',90000.);
+md=setmask(md,'../Exp/SquareShelf.exp','');
+md=parameterize(md,'../Par/SquareSheetShelf.par');
+md.initialization.vx(:)=1.;
+md.initialization.vy(:)=1.;
+md.geometry.thickness(:)=500-md.mesh.x/10000;
+md.geometry.bed =-100-md.mesh.x/1000;
+md.geometry.base=-md.geometry.thickness*md.materials.rho_ice/md.materials.rho_water;
+md.mask.groundedice_levelset=md.geometry.thickness+md.materials.rho_water/md.materials.rho_ice*md.geometry.bed;
+pos=find(md.mask.groundedice_levelset>=0);
+md.geometry.base(pos)=md.geometry.bed(pos);
+md.geometry.surface=md.geometry.base+md.geometry.thickness;
+md=setflowequation(md,'SSA','all');
+
+%Set ISMIP6 melt rate parameters
+md.basalforcings = basalforcingsismip6(md.basalforcings);
+md.basalforcings.basin_id = zeros(md.mesh.numberofelements,1);
+yE = mean(md.mesh.y(md.mesh.elements),2);
+pos1 = find(yE>=5e5);   md.basalforcings.basin_id(pos1)=1;
+pos2 = find(yE<5e5);     md.basalforcings.basin_id(pos2)=2;
+md.basalforcings.num_basins = 2;
+md.basalforcings.delta_t   = [0.1 0.2];
+md.basalforcings.tf_depths = [0 -1000 -2000];
+md.basalforcings.gamma_0 = 14477;
+md.basalforcings.islocal = 0;
+
+%Build an artificial tf field (for times 0 and 1, 3 depth layers)
+temp1a  = 1.*ones(md.mesh.numberofvertices,1); temp1b = 1.5.*ones(md.mesh.numberofvertices,1); A = [temp1a temp1b ; [0. 1.]];
+temp2a  = 2.*ones(md.mesh.numberofvertices,1); temp2b = 2.5.*ones(md.mesh.numberofvertices,1); B = [temp2a temp2b ; [0. 1.]];
+temp3a  = 3.*ones(md.mesh.numberofvertices,1); temp3b = 3.5.*ones(md.mesh.numberofvertices,1); C = [temp3a temp3b ; [0. 1.]];
+D = cell(1,1,3); D(:,:,1)={A}; D(:,:,2)={B}; D(:,:,3)={C};
+md.basalforcings.tf = D;
+
+%Add a melt anomaly
+md.basalforcings.melt_anomaly= ones(md.mesh.numberofvertices+1,2);
+md.basalforcings.melt_anomaly(:,2)= 2;
+md.basalforcings.melt_anomaly(end,:)=[1;2];
+
+%Boundary conditions:
+md.mask.ice_levelset=-ones(md.mesh.numberofvertices,1);
+md.mask.ice_levelset(find(md.mesh.x==max(md.mesh.x)))=0;
+
+%Model conditions
+md.transient.isthermal=0;
+md.transient.isstressbalance=1;
+md.transient.isgroundingline=1;
+md.transient.ismasstransport=1;
+md.transient.issmb=1;
+md.transient.requested_outputs={'default','BasalforcingsFloatingiceMeltingRate','BasalforcingsIsmip6TfShelf'};
+md.groundingline.migration='SubelementMigration';
+md.groundingline.friction_interpolation='SubelementFriction1';
+md.groundingline.melt_interpolation='SubelementMelt1';
+md.timestepping.final_time=1.5;
+md.timestepping.time_step=0.5;
+
+md.cluster=generic('name',oshostname(),'np',1);
+md=solve(md,'Transient');
+
+field_names     ={'Bed1','Surface1','Thickness1','Floatingice1','Vx1','Vy1','Pressure1','FloatingiceMeltingrate1','ThermalForcing1',...
+	   'Bed2','Surface2','Thickness2','Floatingice2','Vx2','Vy2','Pressure2','FloatingiceMeltingrate2','ThermalForcing2',...
+	   'Bed3','Surface3','Thickness3','Floatingice3','Vx3','Vy3','Pressure3','FloatingiceMeltingrate3','ThermalForcing3'};
+field_tolerances={7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-10,7e-08,...
+	   7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-10,7e-08,...
+	   7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-10,7e-08};
+field_values={...
+	   (md.results.TransientSolution(1).Base),...
+	   (md.results.TransientSolution(1).Surface),...
+	   (md.results.TransientSolution(1).Thickness),...
+	   (md.results.TransientSolution(1).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(1).Vx),...
+	   (md.results.TransientSolution(1).Vy),...
+	   (md.results.TransientSolution(1).Pressure),...
+	   (md.results.TransientSolution(1).BasalforcingsFloatingiceMeltingRate),...
+	   (md.results.TransientSolution(1).BasalforcingsIsmip6TfShelf),...
+	   (md.results.TransientSolution(2).Base),...
+	   (md.results.TransientSolution(2).Surface),...
+	   (md.results.TransientSolution(2).Thickness),...
+	   (md.results.TransientSolution(2).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(2).Vx),...
+	   (md.results.TransientSolution(2).Vy),...
+	   (md.results.TransientSolution(2).Pressure),...
+	   (md.results.TransientSolution(2).BasalforcingsFloatingiceMeltingRate),...
+	   (md.results.TransientSolution(2).BasalforcingsIsmip6TfShelf),...
+	   (md.results.TransientSolution(3).Base),...
+	   (md.results.TransientSolution(3).Surface),...
+	   (md.results.TransientSolution(3).Thickness),...
+	   (md.results.TransientSolution(3).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(3).Vx),...
+	   (md.results.TransientSolution(3).Vy),...
+	   (md.results.TransientSolution(3).Pressure),...
+	   (md.results.TransientSolution(3).BasalforcingsFloatingiceMeltingRate),...
+	   (md.results.TransientSolution(3).BasalforcingsIsmip6TfShelf),...
+	   };
Index: /issm/trunk/test/NightlyRun/test473.m
===================================================================
--- /issm/trunk/test/NightlyRun/test473.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test473.m	(revision 24313)
@@ -0,0 +1,90 @@
+%Test Name: ISMIP6MeltRateTest_HO
+md=triangle(model(),'../Exp/Square.exp',90000.);
+md=setmask(md,'../Exp/SquareShelf.exp','');
+md=parameterize(md,'../Par/SquareSheetShelf.par');
+md.initialization.vx(:)=1.;
+md.initialization.vy(:)=1.;
+md.geometry.thickness(:)=500-md.mesh.x/10000;
+md.geometry.bed =-100-md.mesh.x/1000;
+md.geometry.base=-md.geometry.thickness*md.materials.rho_ice/md.materials.rho_water;
+md.mask.groundedice_levelset=md.geometry.thickness+md.materials.rho_water/md.materials.rho_ice*md.geometry.bed;
+pos=find(md.mask.groundedice_levelset>=0);
+md.geometry.base(pos)=md.geometry.bed(pos);
+md.geometry.surface=md.geometry.base+md.geometry.thickness;
+md=extrude(md,3,1.1);
+md=setflowequation(md,'HO','all');
+
+%Set ISMIP6 melt rate parameters
+md.basalforcings = basalforcingsismip6(md.basalforcings);
+md.basalforcings.basin_id = zeros(md.mesh.numberofelements,1);
+yE = mean(md.mesh.y(md.mesh.elements),2);
+pos1 = find(yE>=5e5);   md.basalforcings.basin_id(pos1)=1;
+pos2 = find(yE<5e5);     md.basalforcings.basin_id(pos2)=2;
+md.basalforcings.num_basins = 2;
+md.basalforcings.delta_t   = [0.1 0.2];
+md.basalforcings.tf_depths = [0 -1000 -2000];
+md.basalforcings.gamma_0 = 14477;
+md.basalforcings.islocal = 0;
+
+%Build an artificial tf field (for times 0 and 1, 3 depth layers)
+temp1a  = 1.*ones(md.mesh.numberofvertices,1); temp1b = 1.5.*ones(md.mesh.numberofvertices,1); A = [temp1a temp1b ; [0. 1.]];
+temp2a  = 2.*ones(md.mesh.numberofvertices,1); temp2b = 2.5.*ones(md.mesh.numberofvertices,1); B = [temp2a temp2b ; [0. 1.]];
+temp3a  = 3.*ones(md.mesh.numberofvertices,1); temp3b = 3.5.*ones(md.mesh.numberofvertices,1); C = [temp3a temp3b ; [0. 1.]];
+D = cell(1,1,3); D(:,:,1)={A}; D(:,:,2)={B}; D(:,:,3)={C};
+md.basalforcings.tf = D;
+
+%Boundary conditions:
+md.mask.ice_levelset=-ones(md.mesh.numberofvertices,1);
+md.mask.ice_levelset(find(md.mesh.x==max(md.mesh.x)))=0;
+
+%Model conditions
+md.transient.isthermal=0;
+md.transient.isstressbalance=1;
+md.transient.isgroundingline=1;
+md.transient.ismasstransport=1;
+md.transient.issmb=1;
+md.transient.requested_outputs={'default','BasalforcingsFloatingiceMeltingRate','BasalforcingsIsmip6TfShelf'};
+md.groundingline.migration='SubelementMigration';
+md.groundingline.friction_interpolation='SubelementFriction1';
+md.groundingline.melt_interpolation='SubelementMelt1';
+md.timestepping.final_time=1.5;
+md.timestepping.time_step=0.5;
+
+md.cluster=generic('name',oshostname(),'np',1);
+md=solve(md,'Transient');
+
+field_names     ={'Bed1','Surface1','Thickness1','Floatingice1','Vx1','Vy1','Pressure1','FloatingiceMeltingrate1','ThermalForcing1',...
+	   'Bed2','Surface2','Thickness2','Floatingice2','Vx2','Vy2','Pressure2','FloatingiceMeltingrate2','ThermalForcing2',...
+	   'Bed3','Surface3','Thickness3','Floatingice3','Vx3','Vy3','Pressure3','FloatingiceMeltingrate3','ThermalForcing3'};
+field_tolerances={7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-10,7e-08,...
+	   7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-10,7e-08,...
+	   7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-10,7e-08};
+field_values={...
+	   (md.results.TransientSolution(1).Base),...
+	   (md.results.TransientSolution(1).Surface),...
+	   (md.results.TransientSolution(1).Thickness),...
+	   (md.results.TransientSolution(1).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(1).Vx),...
+	   (md.results.TransientSolution(1).Vy),...
+	   (md.results.TransientSolution(1).Pressure),...
+	   (md.results.TransientSolution(1).BasalforcingsFloatingiceMeltingRate),...
+	   (md.results.TransientSolution(1).BasalforcingsIsmip6TfShelf),...
+	   (md.results.TransientSolution(2).Base),...
+	   (md.results.TransientSolution(2).Surface),...
+	   (md.results.TransientSolution(2).Thickness),...
+	   (md.results.TransientSolution(2).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(2).Vx),...
+	   (md.results.TransientSolution(2).Vy),...
+	   (md.results.TransientSolution(2).Pressure),...
+	   (md.results.TransientSolution(2).BasalforcingsFloatingiceMeltingRate),...
+	   (md.results.TransientSolution(2).BasalforcingsIsmip6TfShelf),...
+	   (md.results.TransientSolution(3).Base),...
+	   (md.results.TransientSolution(3).Surface),...
+	   (md.results.TransientSolution(3).Thickness),...
+	   (md.results.TransientSolution(3).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(3).Vx),...
+	   (md.results.TransientSolution(3).Vy),...
+	   (md.results.TransientSolution(3).Pressure),...
+	   (md.results.TransientSolution(3).BasalforcingsFloatingiceMeltingRate),...
+	   (md.results.TransientSolution(3).BasalforcingsIsmip6TfShelf),...
+	   };
Index: /issm/trunk/test/NightlyRun/test474.m
===================================================================
--- /issm/trunk/test/NightlyRun/test474.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test474.m	(revision 24313)
@@ -0,0 +1,80 @@
+%Test Name: PicoMeltRate_HO
+md=triangle(model(),'../Exp/Square.exp',90000.);
+md=setmask(md,'../Exp/SquareShelf.exp','');
+md=parameterize(md,'../Par/SquareSheetShelf.par');
+md.initialization.vx(:)=1.;
+md.initialization.vy(:)=1.;
+md.geometry.thickness(:)=500-md.mesh.x/10000;
+md.geometry.bed =-100-md.mesh.x/1000;
+md.geometry.base=-md.geometry.thickness*md.materials.rho_ice/md.materials.rho_water;
+md.mask.groundedice_levelset=md.geometry.thickness+md.materials.rho_water/md.materials.rho_ice*md.geometry.bed;
+pos=find(md.mask.groundedice_levelset>=0);
+md.geometry.base(pos)=md.geometry.bed(pos);
+md.geometry.surface=md.geometry.base+md.geometry.thickness;
+md=extrude(md,3,1.1);
+md=setflowequation(md,'HO','all');
+
+%Set Pico Parameters
+md.basalforcings = basalforcingspico(md.basalforcings);
+md.basalforcings.basin_id = zeros(md.mesh.numberofelements,1);
+yE = mean(md.mesh.y(md.mesh.elements),2);
+pos1 = find(yE>=5e5);	 md.basalforcings.basin_id(pos1)=1;
+pos2 = find(yE<5e5);     md.basalforcings.basin_id(pos2)=2;
+md.basalforcings.num_basins = 2;
+md.basalforcings.farocean_temperature = [271.15 272.15 273.15; 274.15 275.15 276.15; 0.5 1 1.5]; %K
+md.basalforcings.farocean_salinity    = [31 32 33; 34 35 36; 0.5 1 1.5]; %PSU                
+md.basalforcings.maxboxcount=5;
+md.basalforcings.isplume = 0;
+
+%Boundary conditions:
+md.mask.ice_levelset=-ones(md.mesh.numberofvertices,1);
+md.mask.ice_levelset(find(md.mesh.x==max(md.mesh.x)))=0;
+
+%Model conditions
+md.transient.isthermal=0;
+md.transient.isstressbalance=1;
+md.transient.isgroundingline=1;
+md.transient.ismasstransport=1;
+md.transient.issmb=1;
+md.transient.requested_outputs={'default','BasalforcingsFloatingiceMeltingRate'};
+md.groundingline.migration='SubelementMigration';
+md.groundingline.friction_interpolation='SubelementFriction1';
+md.groundingline.melt_interpolation='SubelementMelt1';
+md.timestepping.final_time=1.5;
+md.timestepping.time_step=0.5;
+
+md.cluster=generic('name',oshostname(),'np',3);
+md=solve(md,'Transient');
+
+field_names     ={'Bed1','Surface1','Thickness1','Floatingice1','Vx1','Vy1','Pressure1','FloatingiceMeltingrate1',...
+	   'Bed2','Surface2','Thickness2','Floatingice2','Vx2','Vy2','Pressure2','FloatingiceMeltingrate2',...
+	   'Bed3','Surface3','Thickness3','Floatingice3','Vx3','Vy3','Pressure3','FloatingiceMeltingrate3'};
+field_tolerances={7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-10,...
+	   7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-10,...
+	   7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-10};
+field_values={...
+	   (md.results.TransientSolution(1).Base),...
+	   (md.results.TransientSolution(1).Surface),...
+	   (md.results.TransientSolution(1).Thickness),...
+	   (md.results.TransientSolution(1).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(1).Vx),...
+	   (md.results.TransientSolution(1).Vy),...
+	   (md.results.TransientSolution(1).Pressure),...
+	   (md.results.TransientSolution(1).BasalforcingsFloatingiceMeltingRate),...
+	   (md.results.TransientSolution(2).Base),...
+	   (md.results.TransientSolution(2).Surface),...
+	   (md.results.TransientSolution(2).Thickness),...
+	   (md.results.TransientSolution(2).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(2).Vx),...
+	   (md.results.TransientSolution(2).Vy),...
+	   (md.results.TransientSolution(2).Pressure),...
+	   (md.results.TransientSolution(2).BasalforcingsFloatingiceMeltingRate),...
+	   (md.results.TransientSolution(3).Base),...
+	   (md.results.TransientSolution(3).Surface),...
+	   (md.results.TransientSolution(3).Thickness),...
+	   (md.results.TransientSolution(3).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(3).Vx),...
+	   (md.results.TransientSolution(3).Vy),...
+	   (md.results.TransientSolution(3).Pressure),...
+	   (md.results.TransientSolution(3).BasalforcingsFloatingiceMeltingRate),...
+	   };
Index: /issm/trunk/test/NightlyRun/test475.m
===================================================================
--- /issm/trunk/test/NightlyRun/test475.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test475.m	(revision 24313)
@@ -0,0 +1,80 @@
+%Test Name: PicopMeltRate_HO
+md=triangle(model(),'../Exp/Square.exp',90000.);
+md=setmask(md,'../Exp/SquareShelf.exp','');
+md=parameterize(md,'../Par/SquareSheetShelf.par');
+md.initialization.vx(:)=1.;
+md.initialization.vy(:)=1.;
+md.geometry.thickness(:)=500-md.mesh.x/10000;
+md.geometry.bed =-100-md.mesh.x/1000;
+md.geometry.base=-md.geometry.thickness*md.materials.rho_ice/md.materials.rho_water;
+md.mask.groundedice_levelset=md.geometry.thickness+md.materials.rho_water/md.materials.rho_ice*md.geometry.bed;
+pos=find(md.mask.groundedice_levelset>=0);
+md.geometry.base(pos)=md.geometry.bed(pos);
+md.geometry.surface=md.geometry.base+md.geometry.thickness;
+md=extrude(md,3,1.1);
+md=setflowequation(md,'HO','all');
+
+%Set Pico Parameters
+md.basalforcings = basalforcingspico(md.basalforcings);
+md.basalforcings.basin_id = zeros(md.mesh.numberofelements,1);
+yE = mean(md.mesh.y(md.mesh.elements),2);
+pos1 = find(yE>=5e5);	 md.basalforcings.basin_id(pos1)=1;
+pos2 = find(yE<5e5);     md.basalforcings.basin_id(pos2)=2;
+md.basalforcings.num_basins = 2;
+md.basalforcings.farocean_temperature = [271.15 272.15 273.15; 274.15 275.15 276.15; 0.5 1 1.5]; %K
+md.basalforcings.farocean_salinity    = [31 32 33; 34 35 36; 0.5 1 1.5]; %PSU                
+md.basalforcings.maxboxcount=5;
+md.basalforcings.isplume = 1;
+
+%Boundary conditions:
+md.mask.ice_levelset=-ones(md.mesh.numberofvertices,1);
+md.mask.ice_levelset(find(md.mesh.x==max(md.mesh.x)))=0;
+
+%Model conditions
+md.transient.isthermal=0;
+md.transient.isstressbalance=1;
+md.transient.isgroundingline=1;
+md.transient.ismasstransport=1;
+md.transient.issmb=1;
+md.transient.requested_outputs={'default','BasalforcingsFloatingiceMeltingRate','GroundinglineHeight'};
+md.groundingline.migration='SubelementMigration';
+md.groundingline.friction_interpolation='SubelementFriction1';
+md.groundingline.melt_interpolation='SubelementMelt1';
+md.timestepping.final_time=1.5;
+md.timestepping.time_step=0.5;
+
+md.cluster=generic('name',oshostname(),'np',3);
+md=solve(md,'Transient');
+
+field_names     ={'Bed1','Surface1','Thickness1','Floatingice1','Vx1','Vy1','Pressure1','FloatingiceMeltingrate1',...
+	   'Bed2','Surface2','Thickness2','Floatingice2','Vx2','Vy2','Pressure2','FloatingiceMeltingrate2',...
+	   'Bed3','Surface3','Thickness3','Floatingice3','Vx3','Vy3','Pressure3','FloatingiceMeltingrate3'};
+field_tolerances={7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-7,...
+	   7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-7,...
+	   7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-7};
+field_values={...
+	   (md.results.TransientSolution(1).Base),...
+	   (md.results.TransientSolution(1).Surface),...
+	   (md.results.TransientSolution(1).Thickness),...
+	   (md.results.TransientSolution(1).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(1).Vx),...
+	   (md.results.TransientSolution(1).Vy),...
+	   (md.results.TransientSolution(1).Pressure),...
+	   (md.results.TransientSolution(1).BasalforcingsFloatingiceMeltingRate),...
+	   (md.results.TransientSolution(2).Base),...
+	   (md.results.TransientSolution(2).Surface),...
+	   (md.results.TransientSolution(2).Thickness),...
+	   (md.results.TransientSolution(2).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(2).Vx),...
+	   (md.results.TransientSolution(2).Vy),...
+	   (md.results.TransientSolution(2).Pressure),...
+	   (md.results.TransientSolution(2).BasalforcingsFloatingiceMeltingRate),...
+	   (md.results.TransientSolution(3).Base),...
+	   (md.results.TransientSolution(3).Surface),...
+	   (md.results.TransientSolution(3).Thickness),...
+	   (md.results.TransientSolution(3).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(3).Vx),...
+	   (md.results.TransientSolution(3).Vy),...
+	   (md.results.TransientSolution(3).Pressure),...
+	   (md.results.TransientSolution(3).BasalforcingsFloatingiceMeltingRate),...
+	   };
Index: /issm/trunk/test/NightlyRun/test476.m
===================================================================
--- /issm/trunk/test/NightlyRun/test476.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test476.m	(revision 24313)
@@ -0,0 +1,74 @@
+%Test Name: BeckmannGoosseMeltRate_HO
+md=triangle(model(),'../Exp/Square.exp',90000.);
+md=setmask(md,'../Exp/SquareShelf.exp','');
+md=parameterize(md,'../Par/SquareSheetShelf.par');
+md.initialization.vx(:)=1.;
+md.initialization.vy(:)=1.;
+md.geometry.thickness(:)=500-md.mesh.x/10000;
+md.geometry.bed =-100-md.mesh.x/1000;
+md.geometry.base=-md.geometry.thickness*md.materials.rho_ice/md.materials.rho_water;
+md.mask.groundedice_levelset=md.geometry.thickness+md.materials.rho_water/md.materials.rho_ice*md.geometry.bed;
+pos=find(md.mask.groundedice_levelset>=0);
+md.geometry.base(pos)=md.geometry.bed(pos);
+md.geometry.surface=md.geometry.base+md.geometry.thickness;
+md=extrude(md,3,1.1);
+md=setflowequation(md,'HO','all');
+
+%Set Pico Parameters
+md.basalforcings=basalforcingsbeckmanngoosse(md.basalforcings);
+md.basalforcings.ocean_temp=-1.7*ones(md.mesh.numberofvertices,1);         
+md.basalforcings.ocean_salinity=35.0*ones(md.mesh.numberofvertices,1);  
+md.basalforcings.meltrate_factor=1;
+
+%Boundary conditions:
+md.mask.ice_levelset=-ones(md.mesh.numberofvertices,1);
+md.mask.ice_levelset(find(md.mesh.x==max(md.mesh.x)))=0;
+
+%Model conditions
+md.transient.isthermal=0;
+md.transient.isstressbalance=1;
+md.transient.isgroundingline=1;
+md.transient.ismasstransport=1;
+md.transient.issmb=1;
+md.transient.requested_outputs={'default','BasalforcingsFloatingiceMeltingRate'};
+md.groundingline.migration='SubelementMigration';
+md.groundingline.friction_interpolation='SubelementFriction1';
+md.groundingline.melt_interpolation='SubelementMelt1';
+md.timestepping.final_time=1.5;
+md.timestepping.time_step=0.5;
+
+md.cluster=generic('name',oshostname(),'np',3);
+md=solve(md,'Transient');
+
+field_names     ={'Bed1','Surface1','Thickness1','Floatingice1','Vx1','Vy1','Pressure1','FloatingiceMeltingrate1',...
+	   'Bed2','Surface2','Thickness2','Floatingice2','Vx2','Vy2','Pressure2','FloatingiceMeltingrate2',...
+	   'Bed3','Surface3','Thickness3','Floatingice3','Vx3','Vy3','Pressure3','FloatingiceMeltingrate3'};
+field_tolerances={7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-7,...
+	   7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-7,...
+	   7e-09,8e-09,8e-09,7e-09,6e-08,7e-08,6e-09,8e-7};
+field_values={...
+	   (md.results.TransientSolution(1).Base),...
+	   (md.results.TransientSolution(1).Surface),...
+	   (md.results.TransientSolution(1).Thickness),...
+	   (md.results.TransientSolution(1).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(1).Vx),...
+	   (md.results.TransientSolution(1).Vy),...
+	   (md.results.TransientSolution(1).Pressure),...
+	   (md.results.TransientSolution(1).BasalforcingsFloatingiceMeltingRate),...
+	   (md.results.TransientSolution(2).Base),...
+	   (md.results.TransientSolution(2).Surface),...
+	   (md.results.TransientSolution(2).Thickness),...
+	   (md.results.TransientSolution(2).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(2).Vx),...
+	   (md.results.TransientSolution(2).Vy),...
+	   (md.results.TransientSolution(2).Pressure),...
+	   (md.results.TransientSolution(2).BasalforcingsFloatingiceMeltingRate),...
+	   (md.results.TransientSolution(3).Base),...
+	   (md.results.TransientSolution(3).Surface),...
+	   (md.results.TransientSolution(3).Thickness),...
+	   (md.results.TransientSolution(3).MaskGroundediceLevelset),...
+	   (md.results.TransientSolution(3).Vx),...
+	   (md.results.TransientSolution(3).Vy),...
+	   (md.results.TransientSolution(3).Pressure),...
+	   (md.results.TransientSolution(3).BasalforcingsFloatingiceMeltingRate),...
+	   };
Index: /issm/trunk/test/NightlyRun/test501.py
===================================================================
--- /issm/trunk/test/NightlyRun/test501.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test501.py	(revision 24313)
@@ -9,16 +9,16 @@
 
 
-md=triangle(model(),'../Exp/Pig.exp',20000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Pig.exp', 20000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 # Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vel','Pressure']
-field_tolerances=[1e-12,2e-12,2e-12,1e-13]
-field_values=[md.results.StressbalanceSolution.Vx,
-							md.results.StressbalanceSolution.Vy,
-							md.results.StressbalanceSolution.Vel,
-							md.results.StressbalanceSolution.Pressure]
+field_names = ['Vx', 'Vy', 'Vel', 'Pressure']
+field_tolerances = [1e-12, 2e-12, 2e-12, 1e-13]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test502.py
===================================================================
--- /issm/trunk/test/NightlyRun/test502.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test502.py	(revision 24313)
@@ -9,20 +9,18 @@
 
 
-md=triangle(model(),'../Exp/Pig.exp',20000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
-md.extrude(3,0.9)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Pig.exp', 20000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md.extrude(3, 0.9)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 # Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-08,1e-08,1e-08,1e-08,1e-08]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-08, 1e-08, 1e-08, 1e-08, 1e-08]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test503.py
===================================================================
--- /issm/trunk/test/NightlyRun/test503.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test503.py	(revision 24313)
@@ -9,20 +9,18 @@
 
 
-md=triangle(model(),'../Exp/Pig.exp',20000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
-md.extrude(3,0.9)
-md=setflowequation(md,'FS','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md = triangle(model(), '../Exp/Pig.exp', 20000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md.extrude(3, 0.9)
+md = setflowequation(md, 'FS', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 # Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure']
-field_tolerances=[1e-09,1e-09,1e-09,1e-09,1e-09]
-field_values=[\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy,\
-	md.results.StressbalanceSolution.Vz,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Pressure,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure']
+field_tolerances = [1e-09, 1e-09, 1e-09, 1e-09, 1e-09]
+field_values = [md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy,
+                md.results.StressbalanceSolution.Vz,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test504.py
===================================================================
--- /issm/trunk/test/NightlyRun/test504.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test504.py	(revision 24313)
@@ -9,50 +9,74 @@
 
 
-md=triangle(model(),'../Exp/Pig.exp',20000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
-md=setflowequation(md,'SSA','all')
-md.mesh.scale_factor=0.9*np.ones((md.mesh.numberofvertices))
-md.transient.requested_outputs=['default','IceVolume','IceVolumeScaled','GroundedArea','GroundedAreaScaled','FloatingArea','FloatingAreaScaled','TotalSmb','TotalSmbScaled','TotalFloatingBmb','TotalFloatingBmbScaled']
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Pig.exp', 20000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md = setflowequation(md, 'SSA', 'all')
+md.mesh.scale_factor = 0.9 * np.ones((md.mesh.numberofvertices))
+md.transient.requested_outputs = ['default', 'IceVolume', 'IceVolumeScaled', 'GroundedArea', 'GroundedAreaScaled', 'FloatingArea', 'FloatingAreaScaled', 'TotalSmb', 'TotalSmbScaled', 'TotalFloatingBmb', 'TotalFloatingBmbScaled']
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 # Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','IceVolume1','IceVolumeScaled1','GroundedArea1','GroundedAreaScaled1','FloatingArea1','FloatingAreaScaled1','TotalSmb1','TotalSmbScaled1','TotalFloatingBmb1','TotalFloatingBmbScaled1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','IceVolume2','IceVolumeScaled2','GroundedArea2','GroundedAreaScaled2','FloatingArea2','FloatingAreaScaled2','TotalSmb2','TotalSmbScaled2','TotalFloatingBmb2','TotalFloatingBmbScaled2']
-field_tolerances=[1e-12,2e-12,2e-12,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-12,1e-12,1e-12,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].IceVolume,\
-	md.results.TransientSolution[0].IceVolumeScaled,\
-	md.results.TransientSolution[0].GroundedArea,\
-	md.results.TransientSolution[0].GroundedAreaScaled,\
-	md.results.TransientSolution[0].FloatingArea,\
-	md.results.TransientSolution[0].FloatingAreaScaled,\
-	md.results.TransientSolution[0].TotalSmb,\
-	md.results.TransientSolution[0].TotalSmbScaled,\
-	md.results.TransientSolution[0].TotalFloatingBmb,\
-	md.results.TransientSolution[0].TotalFloatingBmbScaled,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].IceVolume,\
-	md.results.TransientSolution[1].IceVolumeScaled,\
-	md.results.TransientSolution[1].GroundedArea,\
-	md.results.TransientSolution[1].GroundedAreaScaled,\
-	md.results.TransientSolution[1].FloatingArea,\
-	md.results.TransientSolution[1].FloatingAreaScaled,\
-	md.results.TransientSolution[1].TotalSmb,\
-	md.results.TransientSolution[1].TotalSmbScaled,\
-	md.results.TransientSolution[1].TotalFloatingBmb,\
-	md.results.TransientSolution[1].TotalFloatingBmbScaled,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1',
+               'Bed1', 'Surface1', 'Thickness1',
+               'IceVolume1', 'IceVolumeScaled1',
+               'GroundedArea1', 'GroundedAreaScaled1',
+               'FloatingArea1', 'FloatingAreaScaled1',
+               'TotalSmb1', 'TotalSmbScaled1',
+               'TotalFloatingBmb1', 'TotalFloatingBmbScaled1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2',
+               'Bed2', 'Surface2', 'Thickness2',
+               'IceVolume2', 'IceVolumeScaled2',
+               'GroundedArea2', 'GroundedAreaScaled2',
+               'FloatingArea2', 'FloatingAreaScaled2',
+               'TotalSmb2', 'TotalSmbScaled2',
+               'TotalFloatingBmb2', 'TotalFloatingBmbScaled2']
+field_tolerances = [1e-12, 2e-12, 2e-12, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13,
+                    1e-13, 1e-13,
+                    1e-12, 1e-12,
+                    1e-12, 1e-13,
+                    1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13, 1e-13,
+                    1e-13, 1e-13,
+                    1e-13, 1e-13,
+                    1e-13, 1e-13,
+                    1e-13, 1e-13,
+                    1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].IceVolume,
+                md.results.TransientSolution[0].IceVolumeScaled,
+                md.results.TransientSolution[0].GroundedArea,
+                md.results.TransientSolution[0].GroundedAreaScaled,
+                md.results.TransientSolution[0].FloatingArea,
+                md.results.TransientSolution[0].FloatingAreaScaled,
+                md.results.TransientSolution[0].TotalSmb,
+                md.results.TransientSolution[0].TotalSmbScaled,
+                md.results.TransientSolution[0].TotalFloatingBmb,
+                md.results.TransientSolution[0].TotalFloatingBmbScaled,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].IceVolume,
+                md.results.TransientSolution[1].IceVolumeScaled,
+                md.results.TransientSolution[1].GroundedArea,
+                md.results.TransientSolution[1].GroundedAreaScaled,
+                md.results.TransientSolution[1].FloatingArea,
+                md.results.TransientSolution[1].FloatingAreaScaled,
+                md.results.TransientSolution[1].TotalSmb,
+                md.results.TransientSolution[1].TotalSmbScaled,
+                md.results.TransientSolution[1].TotalFloatingBmb,
+                md.results.TransientSolution[1].TotalFloatingBmbScaled]
Index: /issm/trunk/test/NightlyRun/test505.py
===================================================================
--- /issm/trunk/test/NightlyRun/test505.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test505.py	(revision 24313)
@@ -9,37 +9,35 @@
 
 
-md=triangle(model(),'../Exp/Pig.exp',30000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Pig.exp', 30000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 # Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
-        'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2']
-field_tolerances=[1e-12,1e-12,3e-10,1e-12,1e-13,1e-11,5e-12,9e-12,1e-13,5e-9, \
-        5e-11,5e-11,1e-10,2e-11,7e-12,1e-11,1e-11,5e-12,1e-11,2e-8]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vz,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vz,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2']
+field_tolerances = [1e-12, 1e-12, 3e-10, 1e-12, 1e-13, 1e-11, 5e-12, 9e-12, 1e-13, 5e-9,
+                    5e-11, 5e-11, 1e-10, 2e-11, 7e-12, 1e-11, 1e-11, 5e-12, 1e-11, 2e-8]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test506.py
===================================================================
--- /issm/trunk/test/NightlyRun/test506.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test506.py	(revision 24313)
@@ -9,59 +9,57 @@
 
 
-md=triangle(model(),'../Exp/Pig.exp',30000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
-md.mesh.scale_factor=0.9*np.ones((md.mesh.numberofvertices))
-md.extrude(2,1.)
-md=setflowequation(md,'HO','all')
-md.transient.requested_outputs=['default','IceVolume','IceVolumeScaled','GroundedArea','GroundedAreaScaled','FloatingArea','FloatingAreaScaled','TotalSmb','TotalSmbScaled','TotalFloatingBmb','TotalFloatingBmbScaled']
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Pig.exp', 30000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md.mesh.scale_factor = 0.9 * np.ones((md.mesh.numberofvertices))
+md.extrude(2, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.transient.requested_outputs = ['default', 'IceVolume', 'IceVolumeScaled', 'GroundedArea', 'GroundedAreaScaled', 'FloatingArea', 'FloatingAreaScaled', 'TotalSmb', 'TotalSmbScaled', 'TotalFloatingBmb', 'TotalFloatingBmbScaled']
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 # Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1','IceVolume1','IceVolumeScaled1','GroundedArea1','GroundedAreaScaled1','FloatingArea1','FloatingAreaScaled1','TotalSmb1','TotalSmbScaled1','TotalFloatingBmb1','TotalFloatingBmbScaled1', \
-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2','IceVolume2','IceVolumeScaled2','GroundedArea2','GroundedAreaScaled2','FloatingArea2','FloatingAreaScaled2','TotalSmb2','TotalSmbScaled2','TotalFloatingBmb2','TotalFloatingBmbScaled2']
-field_tolerances=[1e-10,1e-10,1e-10,1e-10,1e-12,1e-11,2e-12,1e-11,1e-12,1e-09,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
-						1e-11,1e-11,1e-09,1e-11,1e-11,1e-10,1e-11,1e-10,1e-11,2e-08,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vz,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[0].IceVolume,\
-	md.results.TransientSolution[0].IceVolumeScaled,\
-	md.results.TransientSolution[0].GroundedArea,\
-	md.results.TransientSolution[0].GroundedAreaScaled,\
-	md.results.TransientSolution[0].FloatingArea,\
-	md.results.TransientSolution[0].FloatingAreaScaled,\
-	md.results.TransientSolution[0].TotalSmb,\
-	md.results.TransientSolution[0].TotalSmbScaled,\
-	md.results.TransientSolution[0].TotalFloatingBmb,\
-	md.results.TransientSolution[0].TotalFloatingBmbScaled,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vz,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[1].IceVolume,\
-	md.results.TransientSolution[1].IceVolumeScaled,\
-	md.results.TransientSolution[1].GroundedArea,\
-	md.results.TransientSolution[1].GroundedAreaScaled,\
-	md.results.TransientSolution[1].FloatingArea,\
-	md.results.TransientSolution[1].FloatingAreaScaled,\
-	md.results.TransientSolution[1].TotalSmb,\
-	md.results.TransientSolution[1].TotalSmbScaled,\
-	md.results.TransientSolution[1].TotalFloatingBmb,\
-	md.results.TransientSolution[1].TotalFloatingBmbScaled,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1', 'IceVolume1', 'IceVolumeScaled1', 'GroundedArea1', 'GroundedAreaScaled1', 'FloatingArea1', 'FloatingAreaScaled1', 'TotalSmb1', 'TotalSmbScaled1', 'TotalFloatingBmb1', 'TotalFloatingBmbScaled1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2', 'IceVolume2', 'IceVolumeScaled2', 'GroundedArea2', 'GroundedAreaScaled2', 'FloatingArea2', 'FloatingAreaScaled2', 'TotalSmb2', 'TotalSmbScaled2', 'TotalFloatingBmb2', 'TotalFloatingBmbScaled2']
+field_tolerances = [1e-10, 1e-10, 1e-10, 1e-10, 1e-12, 1e-11, 2e-12, 1e-11, 1e-12, 1e-09, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-11, 1e-11, 1e-09, 1e-11, 1e-11, 1e-10, 1e-11, 1e-10, 1e-11, 2e-08, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[0].IceVolume,
+                md.results.TransientSolution[0].IceVolumeScaled,
+                md.results.TransientSolution[0].GroundedArea,
+                md.results.TransientSolution[0].GroundedAreaScaled,
+                md.results.TransientSolution[0].FloatingArea,
+                md.results.TransientSolution[0].FloatingAreaScaled,
+                md.results.TransientSolution[0].TotalSmb,
+                md.results.TransientSolution[0].TotalSmbScaled,
+                md.results.TransientSolution[0].TotalFloatingBmb,
+                md.results.TransientSolution[0].TotalFloatingBmbScaled,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].IceVolume,
+                md.results.TransientSolution[1].IceVolumeScaled,
+                md.results.TransientSolution[1].GroundedArea,
+                md.results.TransientSolution[1].GroundedAreaScaled,
+                md.results.TransientSolution[1].FloatingArea,
+                md.results.TransientSolution[1].FloatingAreaScaled,
+                md.results.TransientSolution[1].TotalSmb,
+                md.results.TransientSolution[1].TotalSmbScaled,
+                md.results.TransientSolution[1].TotalFloatingBmb,
+                md.results.TransientSolution[1].TotalFloatingBmbScaled]
Index: /issm/trunk/test/NightlyRun/test507.m
===================================================================
--- /issm/trunk/test/NightlyRun/test507.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test507.m	(revision 24313)
@@ -12,5 +12,5 @@
 field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', ...
 				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2'};
-field_tolerances={1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06,1e-06,1e-06,1e-06,1e-06,1e-06,1e-06,1e-06,3e-06,1e-06};
+field_tolerances={1e-08,1e-08,1e-08,1e-08,1e-08,7e-08,4e-07,2e-07,1e-08,1e-08,4e-06,4e-06,5e-06,5e-06,1e-06,1e-06,2e-06,1e-06,3e-06,1e-06};
 field_values={...
 	(md.results.TransientSolution(1).Vx),...
@@ -34,3 +34,3 @@
 	(md.results.TransientSolution(2).Temperature),...
 	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
-	};
+};
Index: /issm/trunk/test/NightlyRun/test507.py
===================================================================
--- /issm/trunk/test/NightlyRun/test507.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test507.py	(revision 24313)
@@ -9,37 +9,35 @@
 
 
-md=triangle(model(),'../Exp/Pig.exp',30000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
-md.extrude(2,1.)
-md=setflowequation(md,'FS','all')
-md.groundingline.melt_interpolation='FullMeltOnPartiallyFloating'
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Pig.exp', 30000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md.extrude(2, 1.)
+md = setflowequation(md, 'FS', 'all')
+md.groundingline.melt_interpolation = 'FullMeltOnPartiallyFloating'
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Transient')
 
 # Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2']
-field_tolerances=[1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06,1e-06,1e-06,1e-06,1e-06,1e-06,1e-06,1e-06,1e-06,1e-06]
-field_values=[\
-	md.results.TransientSolution[0].Vx,\
-	md.results.TransientSolution[0].Vy,\
-	md.results.TransientSolution[0].Vz,\
-	md.results.TransientSolution[0].Vel,\
-	md.results.TransientSolution[0].Pressure,\
-	md.results.TransientSolution[0].Base,\
-	md.results.TransientSolution[0].Surface,\
-	md.results.TransientSolution[0].Thickness,\
-	md.results.TransientSolution[0].Temperature,\
-	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
-	md.results.TransientSolution[1].Vx,\
-	md.results.TransientSolution[1].Vy,\
-	md.results.TransientSolution[1].Vz,\
-	md.results.TransientSolution[1].Vel,\
-	md.results.TransientSolution[1].Pressure,\
-	md.results.TransientSolution[1].Base,\
-	md.results.TransientSolution[1].Surface,\
-	md.results.TransientSolution[1].Thickness,\
-	md.results.TransientSolution[1].Temperature,\
-	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Vx1', 'Vy1', 'Vz1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'Temperature1', 'BasalforcingsGroundediceMeltingRate1',
+               'Vx2', 'Vy2', 'Vz2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'Temperature2', 'BasalforcingsGroundediceMeltingRate2']
+field_tolerances = [1e-08, 1e-08, 1e-08, 1e-08, 1e-08, 7e-08, 4e-07, 2e-07, 1e-08, 1e-08, 4e-06, 4e-06, 5e-06, 5e-06, 1e-06, 1e-06, 2e-06, 1e-06, 3e-06, 1e-06]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vz,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vz,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test508.py
===================================================================
--- /issm/trunk/test/NightlyRun/test508.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test508.py	(revision 24313)
@@ -9,23 +9,21 @@
 
 
-md=triangle(model(),'../Exp/Pig.exp',35000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
-md.extrude(3,1.1)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.timestepping.time_step=0.
-md=solve(md,'Steadystate')
+md = triangle(model(), '../Exp/Pig.exp', 35000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md.extrude(3, 1.1)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.timestepping.time_step = 0.
+md = solve(md, 'Steadystate')
 
 # Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[5e-08,1.6e-08,5e-08,5e-08,1e-09,6e-08,5e-07]
-field_values=[\
-	md.results.SteadystateSolution.Vx,\
-	md.results.SteadystateSolution.Vy,\
-	md.results.SteadystateSolution.Vz,\
-	md.results.SteadystateSolution.Vel,\
-	md.results.SteadystateSolution.Pressure,\
-	md.results.SteadystateSolution.Temperature,\
-	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure', 'Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [5e-08, 1.6e-08, 5e-08, 5e-08, 1e-09, 6e-08, 5e-07]
+field_values = [md.results.SteadystateSolution.Vx,
+                md.results.SteadystateSolution.Vy,
+                md.results.SteadystateSolution.Vz,
+                md.results.SteadystateSolution.Vel,
+                md.results.SteadystateSolution.Pressure,
+                md.results.SteadystateSolution.Temperature,
+                md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test509.m
===================================================================
--- /issm/trunk/test/NightlyRun/test509.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test509.m	(revision 24313)
@@ -12,5 +12,5 @@
 %Fields and tolerances to track changes
 field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate'};
-field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06
+field_tolerances={1e-09,1e-09,5e-08,5e-08,1e-09,6e-09,1e-06
 };
 field_values={...
Index: /issm/trunk/test/NightlyRun/test509.py
===================================================================
--- /issm/trunk/test/NightlyRun/test509.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test509.py	(revision 24313)
@@ -9,24 +9,22 @@
 
 
-md=triangle(model(),'../Exp/Pig.exp',30000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.timestepping.time_step=0.
-md.thermal.penalty_threshold=7
-md=solve(md,'Steadystate')
+md = triangle(model(), '../Exp/Pig.exp', 30000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.timestepping.time_step = 0.
+md.thermal.penalty_threshold = 7
+md = solve(md, 'Steadystate')
 
 # Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06]
-field_values=[\
-	md.results.SteadystateSolution.Vx,\
-	md.results.SteadystateSolution.Vy,\
-	md.results.SteadystateSolution.Vz,\
-	md.results.SteadystateSolution.Vel,\
-	md.results.SteadystateSolution.Pressure,\
-	md.results.SteadystateSolution.Temperature,\
-	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure', 'Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-09, 1e-09, 5e-08, 5e-08, 1e-09, 6e-09, 1e-06]
+field_values = [md.results.SteadystateSolution.Vx,
+                md.results.SteadystateSolution.Vy,
+                md.results.SteadystateSolution.Vz,
+                md.results.SteadystateSolution.Vel,
+                md.results.SteadystateSolution.Pressure,
+                md.results.SteadystateSolution.Temperature,
+                md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test510.py
===================================================================
--- /issm/trunk/test/NightlyRun/test510.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test510.py	(revision 24313)
@@ -9,23 +9,21 @@
 
 
-md=triangle(model(),'../Exp/Pig.exp',20000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
-md.extrude(2,1.)
-md=setflowequation(md,'FS','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md.timestepping.time_step=0.
-md=solve(md,'Steadystate')
+md = triangle(model(), '../Exp/Pig.exp', 20000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md.extrude(2, 1.)
+md = setflowequation(md, 'FS', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.timestepping.time_step = 0.
+md = solve(md, 'Steadystate')
 
 # Fields and tolerances to track changes
-field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06]
-field_values=[\
-	md.results.SteadystateSolution.Vx,\
-	md.results.SteadystateSolution.Vy,\
-	md.results.SteadystateSolution.Vz,\
-	md.results.SteadystateSolution.Vel,\
-	md.results.SteadystateSolution.Pressure,\
-	md.results.SteadystateSolution.Temperature,\
-	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Vx', 'Vy', 'Vz', 'Vel', 'Pressure', 'Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-08, 1e-08, 1e-08, 1e-08, 1e-08, 1e-08, 1e-06]
+field_values = [md.results.SteadystateSolution.Vx,
+                md.results.SteadystateSolution.Vy,
+                md.results.SteadystateSolution.Vz,
+                md.results.SteadystateSolution.Vel,
+                md.results.SteadystateSolution.Pressure,
+                md.results.SteadystateSolution.Temperature,
+                md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test511.py
===================================================================
--- /issm/trunk/test/NightlyRun/test511.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test511.py	(revision 24313)
@@ -9,42 +9,40 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Pig.exp',11000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
+md = triangle(model(), '../Exp/Pig.exp', 11000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
 
 #impose hydrostatic equilibrium (required by Stokes)
-md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
-md.geometry.surface=md.geometry.base+md.geometry.thickness
-md.extrude(3,1.)
-md=setflowequation(md,'FS','all')
-md=md.extract(md.mask.groundedice_levelset<0.)
+md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
+md.geometry.surface = md.geometry.base + md.geometry.thickness
+md.extrude(3, 1.)
+md = setflowequation(md, 'FS', 'all')
+md = md.extract(md.mask.groundedice_levelset < 0.)
 
 #control parameters
-md.inversion.iscontrol=1
-md.inversion.control_parameters=['MaterialsRheologyBbar']
-md.inversion.min_parameters=10.**6*np.ones((md.mesh.numberofvertices))
-md.inversion.max_parameters=2.*10**9*np.ones((md.mesh.numberofvertices))
-md.inversion.nsteps=2
-md.inversion.cost_functions=[101]
-md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices))
-md.inversion.gradient_scaling=10.**8*np.ones((md.inversion.nsteps))
-md.inversion.maxiter_per_step=2.*np.ones((md.inversion.nsteps))
-md.inversion.step_threshold=0.99*np.ones((md.inversion.nsteps))
-md.inversion.vx_obs=md.initialization.vx
-md.inversion.vy_obs=md.initialization.vy
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['MaterialsRheologyBbar']
+md.inversion.min_parameters = 10.**6 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 2. * 10**9 * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.nsteps = 2
+md.inversion.cost_functions = [101]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, len(md.inversion.cost_functions)))
+md.inversion.gradient_scaling = 10.**8 * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
+md.inversion.maxiter_per_step = 2. * np.ones((md.inversion.nsteps))
+md.inversion.step_threshold = 0.99 * np.ones((md.inversion.nsteps))
+md.inversion.vx_obs = md.initialization.vx
+md.inversion.vy_obs = md.initialization.vy
 
-md.cluster=generic('name',gethostname(),'np',1)
-md=solve(md,'Stressbalance')
+md.cluster = generic('name', gethostname(), 'np', 1)
+md = solve(md, 'Stressbalance')
 
 #Fields and tolerances to track changes
-field_names     =['Gradient','Misfits','MaterialsRheologyB','Pressure','Vel','Vx','Vy']
-field_tolerances=[5e-11,5e-11,5e-11,1e-09,1e-11,5e-11,1e-11]
-field_values=[
-	md.results.StressbalanceSolution.Gradient1,
-	md.results.StressbalanceSolution.J,
-	md.results.StressbalanceSolution.MaterialsRheologyBbar,
-	md.results.StressbalanceSolution.Pressure,
-	md.results.StressbalanceSolution.Vel,
-	md.results.StressbalanceSolution.Vx,
-	md.results.StressbalanceSolution.Vy,
-]
+field_names = ['Gradient', 'Misfits', 'MaterialsRheologyB', 'Pressure', 'Vel', 'Vx', 'Vy']
+field_tolerances = [5e-11, 5e-11, 5e-11, 1e-09, 1e-11, 5e-11, 1e-11]
+field_values = [md.results.StressbalanceSolution.Gradient1,
+                md.results.StressbalanceSolution.J,
+                md.results.StressbalanceSolution.MaterialsRheologyBbar,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy]
Index: /issm/trunk/test/NightlyRun/test512.py
===================================================================
--- /issm/trunk/test/NightlyRun/test512.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test512.py	(revision 24313)
@@ -10,38 +10,37 @@
 
 
-md=triangle(model(),'../Exp/Pig.exp',20000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
+md = triangle(model(), '../Exp/Pig.exp', 20000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
 
 # control parameters
-md.inversion.iscontrol=1
-md.inversion.control_parameters=['FrictionCoefficient']
-md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
-md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
-md.inversion.nsteps=2
-md.inversion.cost_functions=[103,501]
-md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
-md.inversion.cost_functions_coefficients[:,1]=2.*10**-7
-md.inversion.gradient_scaling=3.*np.ones((md.inversion.nsteps))
-md.inversion.maxiter_per_step=2.*np.ones((md.inversion.nsteps))
-md.inversion.step_threshold=2.99*np.ones((md.inversion.nsteps))
-md.inversion.vx_obs=md.initialization.vx
-md.inversion.vy_obs=md.initialization.vy
 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Stressbalance')
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['FrictionCoefficient']
+md.inversion.min_parameters = 1. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 200. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.nsteps = 2
+md.inversion.cost_functions = [103, 501]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
+md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
+md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
+md.inversion.maxiter_per_step = 2. * np.ones((md.inversion.nsteps))
+md.inversion.step_threshold = 2.99 * np.ones((md.inversion.nsteps))
+md.inversion.vx_obs = md.initialization.vx
+md.inversion.vy_obs = md.initialization.vy
+
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Stressbalance')
 
 # Fields and tolerances to track changes
-field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy']
-field_tolerances=[1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11]
-field_values=[\
-	md.results.StressbalanceSolution.Gradient1,\
-	md.results.StressbalanceSolution.J,\
-	md.results.StressbalanceSolution.FrictionCoefficient,\
-	md.results.StressbalanceSolution.Pressure,\
-	md.results.StressbalanceSolution.Vel,\
-	md.results.StressbalanceSolution.Vx,\
-	md.results.StressbalanceSolution.Vy
-]
+field_names = ['Gradient', 'Misfits', 'FrictionCoefficient', 'Pressure', 'Vel', 'Vx', 'Vy']
+field_tolerances = [1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11]
+field_values = [md.results.StressbalanceSolution.Gradient1,
+                md.results.StressbalanceSolution.J,
+                md.results.StressbalanceSolution.FrictionCoefficient,
+                md.results.StressbalanceSolution.Pressure,
+                md.results.StressbalanceSolution.Vel,
+                md.results.StressbalanceSolution.Vx,
+                md.results.StressbalanceSolution.Vy]
Index: /issm/trunk/test/NightlyRun/test513.py
===================================================================
--- /issm/trunk/test/NightlyRun/test513.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test513.py	(revision 24313)
@@ -9,43 +9,40 @@
 
 
-md=triangle(model(),'../Exp/Pig.exp',30000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
-md.extrude(3,1.)
-md=setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/Pig.exp', 30000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'SSA', 'all')
 
 # control parameters
-md.inversion.iscontrol=1
-md.inversion.control_parameters=['FrictionCoefficient']
-md.inversion.min_parameters=1.*np.ones((md.mesh.numberofvertices))
-md.inversion.max_parameters=200.*np.ones((md.mesh.numberofvertices))
-md.inversion.nsteps=2
-md.inversion.cost_functions=[103,501]
-md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices,2))
-md.inversion.cost_functions_coefficients[:,1]=2.*10**-7
-md.inversion.gradient_scaling=3.*np.ones((md.inversion.nsteps))
-md.inversion.maxiter_per_step=2.*np.ones((md.inversion.nsteps))
-md.inversion.step_threshold=0.99*np.ones((md.inversion.nsteps))
-md.inversion.vx_obs=md.initialization.vx
-md.inversion.vy_obs=md.initialization.vy
-md.timestepping.time_step=0.
-
-md.thermal.penalty_lock=5
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Steadystate')
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['FrictionCoefficient']
+md.inversion.min_parameters = 1. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 200. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.nsteps = 2
+md.inversion.cost_functions = [103, 501]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, 2))
+md.inversion.cost_functions_coefficients[:, 1] = 2. * 10**-7
+md.inversion.gradient_scaling = 3. * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
+md.inversion.maxiter_per_step = 2. * np.ones((md.inversion.nsteps))
+md.inversion.step_threshold = 0.99 * np.ones((md.inversion.nsteps))
+md.inversion.vx_obs = md.initialization.vx
+md.inversion.vy_obs = md.initialization.vy
+md.timestepping.time_step = 0.
+md.thermal.penalty_lock = 5
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Steadystate')
 
 # Fields and tolerances to track changes
-field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[5e-08,4e-10,1e-10,1e-10,3e-6,4e-6,3.4e-6,3e-6,2e-6,2e-06]
-field_values=[\
-	md.results.SteadystateSolution.Gradient1,\
-	md.results.SteadystateSolution.J,\
-	md.results.SteadystateSolution.FrictionCoefficient,\
-	md.results.SteadystateSolution.Pressure,\
-	md.results.SteadystateSolution.Vel,\
-	md.results.SteadystateSolution.Vx,\
-	md.results.SteadystateSolution.Vy,\
-	md.results.SteadystateSolution.Vz,\
-	md.results.SteadystateSolution.Temperature,\
-	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate
-]
+field_names = ['Gradient', 'Misfits', 'FrictionCoefficient', 'Pressure', 'Vel', 'Vx', 'Vy', 'Vz', 'Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [5e-08, 4e-10, 1e-10, 1e-10, 3e-6, 4e-6, 3.4e-6, 3e-6, 2e-6, 2e-06]
+field_values = [md.results.SteadystateSolution.Gradient1,
+                md.results.SteadystateSolution.J,
+                md.results.SteadystateSolution.FrictionCoefficient,
+                md.results.SteadystateSolution.Pressure,
+                md.results.SteadystateSolution.Vel,
+                md.results.SteadystateSolution.Vx,
+                md.results.SteadystateSolution.Vy,
+                md.results.SteadystateSolution.Vz,
+                md.results.SteadystateSolution.Temperature,
+                md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test514.py
===================================================================
--- /issm/trunk/test/NightlyRun/test514.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test514.py	(revision 24313)
@@ -3,5 +3,4 @@
 import copy
 from model import *
-from socket import gethostname
 from bamg import *
 from setmask import *
@@ -12,49 +11,49 @@
 
 #Simple mesh 1
-hVertices=10000.*np.ones((27))
-hVertices[0:5]=1000.
-md=bamg(model(),'domain','../Exp/Pig.exp','hmax',20000.,'hVertices',hVertices,'gradation',3.)
-x1=md.mesh.x
-y1=md.mesh.y
+hVertices = 10000. * np.ones((27))
+hVertices[0:5] = 1000.
+md = bamg(model(), 'domain', '../Exp/Pig.exp', 'hmax', 20000., 'hVertices', hVertices, 'gradation', 3.)
+x1 = md.mesh.x
+y1 = md.mesh.y
 
 #Simple mesh 2
-md=bamg(model(),'domain','../Exp/Pig.exp','hmax',10000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
-x2=md.mesh.x
-y2=md.mesh.y
+md = bamg(model(), 'domain', '../Exp/Pig.exp', 'hmax', 10000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+x2 = md.mesh.x
+y2 = md.mesh.y
 
 #refine existing mesh 1
-hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,md.inversion.vy_obs,'node')
-metric=ComputeMetric(hessian,2./9.,1.,1000.,25.*10.**3,[])
-md.miscellaneous.dummy=metric
-md2=bamg(copy.deepcopy(md),'metric',md.miscellaneous.dummy,'hmin',1000.,'hmax',20000.,'gradation',3.)
-x3=md2.mesh.x
-y3=md2.mesh.y
+hessian = ComputeHessian(md.mesh.elements, md.mesh.x, md.mesh.y, md.inversion.vy_obs, 'node')
+metric = ComputeMetric(hessian, 2. / 9., 1., 1000., 25. * 10.**3, [])
+md.miscellaneous.dummy = metric
+md2 = bamg(copy.deepcopy(md), 'metric', md.miscellaneous.dummy, 'hmin', 1000., 'hmax', 20000., 'gradation', 3.)
+x3 = md2.mesh.x
+y3 = md2.mesh.y
 
 #refine existing mesh 2
-md2=bamg(copy.deepcopy(md),'metric',md.miscellaneous.dummy,'hmin',1000.,'hmax',20000.,'gradation',3.,'anisomax',1.)
-x4=md2.mesh.x
-y4=md2.mesh.y
+md2 = bamg(copy.deepcopy(md), 'metric', md.miscellaneous.dummy, 'hmin', 1000., 'hmax', 20000., 'gradation', 3., 'anisomax', 1.)
+x4 = md2.mesh.x
+y4 = md2.mesh.y
 
 #refine existing mesh 3
-hVertices=np.nan*np.ones((md.mesh.numberofvertices))
-hVertices[np.nonzero(md.mesh.vertexonboundary)]=500.
-md2=bamg(copy.deepcopy(md),'metric',md.miscellaneous.dummy,'hmin',1000.,'hmax',20000.,'gradation',3.,'anisomax',1.,'hVertices',hVertices)
-x5=md2.mesh.x
-y5=md2.mesh.y
+hVertices = np.nan * np.ones((md.mesh.numberofvertices))
+hVertices[np.nonzero(md.mesh.vertexonboundary)] = 500.
+md2 = bamg(copy.deepcopy(md), 'metric', md.miscellaneous.dummy, 'hmin', 1000., 'hmax', 20000., 'gradation', 3., 'anisomax', 1., 'hVertices', hVertices)
+x5 = md2.mesh.x
+y5 = md2.mesh.y
 
 #refine existing mesh 4
-md2=bamg(copy.deepcopy(md),'field',md.inversion.vy_obs,'hmin',1000.,'hmax',20000.,'gradation',3.,'Hessiantype',0,'err',np.array([1.]))
-x6=md2.mesh.x
-y6=md2.mesh.y
+md2 = bamg(copy.deepcopy(md), 'field', md.inversion.vy_obs, 'hmin', 1000., 'hmax', 20000., 'gradation', 3., 'Hessiantype', 0, 'err', np.array([1.]))
+x6 = md2.mesh.x
+y6 = md2.mesh.y
 
 #refine existing mesh 5
-md2=bamg(copy.deepcopy(md),'field',np.vstack((md.inversion.vy_obs,md.geometry.thickness)).T,'hmin',1000.,'hmax',20000.,'gradation',3.,'Hessiantype',1,'err',np.array([[10.,100.]]))
-x7=md2.mesh.x
-y7=md2.mesh.y
+md2 = bamg(copy.deepcopy(md), 'field', np.vstack((md.inversion.vy_obs, md.geometry.thickness)).T, 'hmin', 1000., 'hmax', 20000., 'gradation', 3., 'Hessiantype', 1, 'err', np.array([[10., 100.]]))
+x7 = md2.mesh.x
+y7 = md2.mesh.y
 
 #Fields and tolerances to track changes
-field_names     =['x1','y1','x2','y2','x3','y3','x4','y4','x5','y5','x6','y6','x7','y7']
-field_tolerances = [2e-10,7e-10,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[x1, y1,x2, y2,	x3, y3,	x4, y4,	x5, y5,	x6, y6,	x7, y7]
+field_names = ['x1', 'y1', 'x2', 'y2', 'x3', 'y3', 'x4', 'y4', 'x5', 'y5', 'x6', 'y6', 'x7', 'y7']
+field_tolerances = [2e-10, 7e-10, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6, x7, y7]
Index: /issm/trunk/test/NightlyRun/test515.py
===================================================================
--- /issm/trunk/test/NightlyRun/test515.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test515.py	(revision 24313)
@@ -9,24 +9,24 @@
 
 
-md=triangle(model(),'../Exp/Pig.exp',30000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
-md.thermal.stabilization=2
-md.cluster=generic('name',gethostname(),'np',3)
-md.transient.isstressbalance=False
-md.transient.ismasstransport=False
-md.transient.issmb=True
-md.transient.isthermal=True
-md.transient.isgroundingline=False
-md=solve(md,'Transient')
+md = triangle(model(), '../Exp/Pig.exp', 30000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.thermal.stabilization = 2
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.transient.isstressbalance = False
+md.transient.ismasstransport = False
+md.transient.issmb = True
+md.transient.isthermal = True
+md.transient.isgroundingline = False
+md = solve(md, 'Transient')
 
 # Fields and tolerances to track changes
-field_names     =['Temperature1','BasalforcingsGroundediceMeltingRate1',
-									'Temperature2','BasalforcingsGroundediceMeltingRate2']
-field_tolerances=[1e-13,1e-8,1e-13,5e-8]
-field_values=[md.results.TransientSolution[0].Temperature,
-							md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
-							md.results.TransientSolution[1].Temperature,
-							md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate]
+field_names = ['Temperature1', 'BasalforcingsGroundediceMeltingRate1',
+               'Temperature2', 'BasalforcingsGroundediceMeltingRate2']
+field_tolerances = [1e-13, 1e-8, 1e-13, 5e-8]
+field_values = [md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test516.py
===================================================================
--- /issm/trunk/test/NightlyRun/test516.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test516.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: PigTherSteaSUPG
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,20 +9,18 @@
 from solve import *
 
-md=triangle(model(),'../Exp/Pig.exp',30000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
-md.extrude(3,1.)
-md=setflowequation(md,'HO','all')
-md.thermal.stabilization=2
-md.cluster=generic('name',gethostname(),'np',3)
-md.timestepping.time_step=0
-md.thermal.penalty_threshold=40
-md=solve(md,'Thermal')
+md = triangle(model(), '../Exp/Pig.exp', 30000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md.extrude(3, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.thermal.stabilization = 2
+md.cluster = generic('name', gethostname(), 'np', 3)
+md.timestepping.time_step = 0
+md.thermal.penalty_threshold = 40
+md = solve(md, 'Thermal')
 
 #Fields and tolerances to track changes
-field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
-field_tolerances=[1e-11,1e-11]
-field_values=[\
-	md.results.ThermalSolution.Temperature,\
-	md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate,\
-	]
+field_names = ['Temperature', 'BasalforcingsGroundediceMeltingRate']
+field_tolerances = [1e-11, 1e-11]
+field_values = [md.results.ThermalSolution.Temperature,
+                md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate]
Index: /issm/trunk/test/NightlyRun/test530.py
===================================================================
--- /issm/trunk/test/NightlyRun/test530.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test530.py	(revision 24313)
@@ -9,17 +9,15 @@
 
 
-md=triangle(model(),'../Exp/Pig.exp',20000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Balancevelocity')
+md = triangle(model(), '../Exp/Pig.exp', 20000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Balancevelocity')
 
 # Fields and tolerances to track changes
-field_names     =['DrivingStressX','DrivingStressY','Vel']
-field_tolerances=[1e-13,1e-13,1e-13]
-field_values=[\
-		md.results.BalancevelocitySolution.DrivingStressX,\
-		md.results.BalancevelocitySolution.DrivingStressY,\
-		md.results.BalancevelocitySolution.Vel,\
-		]
+field_names = ['DrivingStressX', 'DrivingStressY', 'Vel']
+field_tolerances = [1e-13, 1e-13, 1e-13]
+field_values = [md.results.BalancevelocitySolution.DrivingStressX,
+                md.results.BalancevelocitySolution.DrivingStressY,
+                md.results.BalancevelocitySolution.Vel]
Index: /issm/trunk/test/NightlyRun/test531.py
===================================================================
--- /issm/trunk/test/NightlyRun/test531.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test531.py	(revision 24313)
@@ -9,19 +9,17 @@
 
 
-md=triangle(model(),'../Exp/Pig.exp',20000.)
-md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md=parameterize(md,'../Par/Pig.py')
-md.initialization.vx[:]=0.
-md.initialization.vy[:]=0.
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Balancevelocity')
+md = triangle(model(), '../Exp/Pig.exp', 20000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md.initialization.vx[:] = 0.
+md.initialization.vy[:] = 0.
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Balancevelocity')
 
 # Fields and tolerances to track changes
-field_names     =['DrivingStressX','DrivingStressY','Vel']
-field_tolerances=[1e-13,1e-13,1e-13]
-field_values=[\
-		md.results.BalancevelocitySolution.DrivingStressX,\
-		md.results.BalancevelocitySolution.DrivingStressY,\
-		md.results.BalancevelocitySolution.Vel,\
-		]
+field_names = ['DrivingStressX', 'DrivingStressY', 'Vel']
+field_tolerances = [1e-13, 1e-13, 1e-13]
+field_values = [md.results.BalancevelocitySolution.DrivingStressX,
+                md.results.BalancevelocitySolution.DrivingStressY,
+                md.results.BalancevelocitySolution.Vel]
Index: /issm/trunk/test/NightlyRun/test540.m
===================================================================
--- /issm/trunk/test/NightlyRun/test540.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test540.m	(revision 24313)
@@ -10,6 +10,7 @@
 md.mask.ice_levelset = 1e4*(md.mask.ice_levelset + 0.5);
 md.calving=calvingvonmises();
-md.calving.meltingrate = zeros(md.mesh.numberofvertices,1);
+md.frontalforcings.meltingrate = zeros(md.mesh.numberofvertices,1);
 md.transient.ismovingfront = 1;
+md.transient.isgroundingline = 1;
 md.levelset.spclevelset = NaN(md.mesh.numberofvertices,1);
 pos = find(md.mesh.vertexonboundary);
Index: /issm/trunk/test/NightlyRun/test540.py
===================================================================
--- /issm/trunk/test/NightlyRun/test540.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test540.py	(revision 24313)
@@ -9,8 +9,8 @@
 from calvingvonmises import *
 
-md = triangle(model(),'../Exp/Pig.exp',10000.)
-md = setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
-md = parameterize(md,'../Par/Pig.py')
-md = setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/Pig.exp', 10000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md = setflowequation(md, 'SSA', 'all')
 md.timestepping.time_step = 2
 md.timestepping.final_time = 50
@@ -19,50 +19,45 @@
 md.mask.ice_levelset = 1e4 * (md.mask.ice_levelset + 0.5)
 md.calving = calvingvonmises()
-md.calving.meltingrate = np.zeros((md.mesh.numberofvertices,))
+md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, ))
 md.transient.ismovingfront = 1
-md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices,))
+md.transient.isgroundingline = 1
+md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices, ))
 pos = np.where(md.mesh.vertexonboundary)
 md.levelset.spclevelset[pos] = md.mask.ice_levelset[pos]
 
 #Force MUMPS sequential analysis
-md.toolkits.DefaultAnalysis.mat_mumps_icntl_28=1
-md.cluster = generic('name',gethostname(),'np',2)
-md = solve(md,'Transient')
+md.toolkits.DefaultAnalysis.mat_mumps_icntl_28 = 1
+md.cluster = generic('name', gethostname(), 'np', 2)
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names = [
-	'Vx1' ,'Vy1' ,'Vel1' ,'Pressure1' ,'Bed1' ,'Surface1' ,'Thickness1' ,'MaskIceLevelset1' ,
-	'Vx2' ,'Vy2' ,'Vel2' ,'Pressure2' ,'Bed2' ,'Surface2' ,'Thickness2' ,'MaskIceLevelset2' ,
-	'Vx10','Vy10','Vel10','Pressure10','Bed10','Surface10','Thickness10','MaskIceLevelset10',
-	]
-field_tolerances = [
-	1e-12,2e-12,2e-12,1e-13,1e-13,1e-13,1e-13,1e-13,
-	1e-12,1e-12,1e-12,1e-13,1e-13,1e-13,1e-13,1e-12,
-	1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-9,
-	]
-field_values = [
-	md.results.TransientSolution[0].Vx,
-	md.results.TransientSolution[0].Vy,
-	md.results.TransientSolution[0].Vel,
-	md.results.TransientSolution[0].Pressure,
-	md.results.TransientSolution[0].Base,
-	md.results.TransientSolution[0].Surface,
-	md.results.TransientSolution[0].Thickness,
-	md.results.TransientSolution[0].MaskIceLevelset,
-	md.results.TransientSolution[1].Vx,
-	md.results.TransientSolution[1].Vy,
-	md.results.TransientSolution[1].Vel,
-	md.results.TransientSolution[1].Pressure,
-	md.results.TransientSolution[1].Base,
-	md.results.TransientSolution[1].Surface,
-	md.results.TransientSolution[1].Thickness,
-	md.results.TransientSolution[1].MaskIceLevelset,
-	md.results.TransientSolution[9].Vx,
-	md.results.TransientSolution[9].Vy,
-	md.results.TransientSolution[9].Vel,
-	md.results.TransientSolution[9].Pressure,
-	md.results.TransientSolution[9].Base,
-	md.results.TransientSolution[9].Surface,
-	md.results.TransientSolution[9].Thickness,
-	md.results.TransientSolution[9].MaskIceLevelset,
-	]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'MaskIceLevelset1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'MaskIceLevelset2',
+               'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Bed10', 'Surface10', 'Thickness10', 'MaskIceLevelset10']
+field_tolerances = [1e-12, 2e-12, 2e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    1e-12, 1e-12, 1e-12, 1e-13, 1e-13, 1e-13, 1e-13, 1e-12,
+                    1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-9]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].MaskIceLevelset,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].MaskIceLevelset,
+                md.results.TransientSolution[9].Vx,
+                md.results.TransientSolution[9].Vy,
+                md.results.TransientSolution[9].Vel,
+                md.results.TransientSolution[9].Pressure,
+                md.results.TransientSolution[9].Base,
+                md.results.TransientSolution[9].Surface,
+                md.results.TransientSolution[9].Thickness,
+                md.results.TransientSolution[9].MaskIceLevelset]
Index: /issm/trunk/test/NightlyRun/test541.m
===================================================================
--- /issm/trunk/test/NightlyRun/test541.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test541.m	(revision 24313)
@@ -0,0 +1,60 @@
+%Test Name: PigTranCalvingDevHO3d
+md=triangle(model(),'../Exp/Pig.exp',10000.);
+md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+md=parameterize(md,'../Par/Pig.par');
+md=extrude(md,5,1);
+md=setflowequation(md,'HO','all');
+md.timestepping.time_step=2;
+md.timestepping.final_time=50;
+
+%calving parameters
+md.mask.ice_levelset = 1e4*(md.mask.ice_levelset + 0.5);
+md.calving=calvingvonmises();
+md.frontalforcings.meltingrate = zeros(md.mesh.numberofvertices,1);
+md.transient.ismovingfront = 1;
+md.levelset.spclevelset = NaN(md.mesh.numberofvertices,1);
+pos = find(md.mesh.vertexonboundary);
+md.levelset.spclevelset(pos) = md.mask.ice_levelset(pos);
+
+%Force MUMPS sequential analysis
+md.toolkits.DefaultAnalysis.mat_mumps_icntl_28=1;
+md.cluster=generic('name',oshostname(),'np',2);
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names ={...
+	'Vx1' ,'Vy1' ,'Vel1' ,'Pressure1' ,'Bed1' ,'Surface1' ,'Thickness1' ,'MaskIceLevelset1' ,...
+	'Vx2' ,'Vy2' ,'Vel2' ,'Pressure2' ,'Bed2' ,'Surface2' ,'Thickness2' ,'MaskIceLevelset2' ,...
+	'Vx10','Vy10','Vel10','Pressure10','Bed10','Surface10','Thickness10','MaskIceLevelset10',...
+	};
+field_tolerances={...
+	1e-11,2e-11,2e-11,1e-12,2e-11,6e-12,9e-12,1e-12,...
+	2e-11,1e-11,1e-11,9e-12,2e-1,2e-11,2e-11,1e-11,...
+	2e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,...
+	};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Base),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).MaskIceLevelset),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).Base),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).MaskIceLevelset),...
+	(md.results.TransientSolution(10).Vx),...
+	(md.results.TransientSolution(10).Vy),...
+	(md.results.TransientSolution(10).Vel),...
+	(md.results.TransientSolution(10).Pressure),...
+	(md.results.TransientSolution(10).Base),...
+	(md.results.TransientSolution(10).Surface),...
+	(md.results.TransientSolution(10).Thickness),...
+	(md.results.TransientSolution(10).MaskIceLevelset),...
+	};
Index: /issm/trunk/test/NightlyRun/test541.py
===================================================================
--- /issm/trunk/test/NightlyRun/test541.py	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test541.py	(revision 24313)
@@ -0,0 +1,63 @@
+#Test Name: PigTranCalvingDevd
+from model import *
+from socket import gethostname
+from triangle import *
+from setmask import *
+from parameterize import *
+from setflowequation import *
+from solve import *
+from calvingvonmises import *
+
+md = triangle(model(), '../Exp/Pig.exp', 10000.)
+md = setmask(md, '../Exp/PigShelves.exp', '../Exp/PigIslands.exp')
+md = parameterize(md, '../Par/Pig.py')
+md.extrude(5, 1.)
+md = setflowequation(md, 'HO', 'all')
+md.timestepping.time_step = 2
+md.timestepping.final_time = 50
+
+#calving parameters
+md.mask.ice_levelset = 1e4 * (md.mask.ice_levelset + 0.5)
+md.calving = calvingvonmises()
+md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, ))
+md.transient.ismovingfront = 1
+md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices, ))
+pos = np.where(md.mesh.vertexonboundary)
+md.levelset.spclevelset[pos] = md.mask.ice_levelset[pos]
+
+#Force MUMPS sequential analysis
+md.toolkits.DefaultAnalysis.mat_mumps_icntl_28 = 1
+md.cluster = generic('name', gethostname(), 'np', 2)
+md = solve(md, 'Transient')
+
+#Fields and tolerances to track changes
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'MaskIceLevelset1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'MaskIceLevelset2',
+               'Vx10', 'Vy10', 'Vel10', 'Pressure10', 'Bed10', 'Surface10', 'Thickness10', 'MaskIceLevelset10']
+field_tolerances = [1e-11, 2e-11, 2e-11, 1e-12, 2e-11, 6e-12, 9e-12, 1e-12,
+                    2e-11, 1e-11, 1e-11, 9e-12, 2e-1, 2e-11, 2e-11, 1e-11,
+                    2e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].MaskIceLevelset,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].MaskIceLevelset,
+                md.results.TransientSolution[9].Vx,
+                md.results.TransientSolution[9].Vy,
+                md.results.TransientSolution[9].Vel,
+                md.results.TransientSolution[9].Pressure,
+                md.results.TransientSolution[9].Base,
+                md.results.TransientSolution[9].Surface,
+                md.results.TransientSolution[9].Thickness,
+                md.results.TransientSolution[9].MaskIceLevelset]
Index: /issm/trunk/test/NightlyRun/test601.py
===================================================================
--- /issm/trunk/test/NightlyRun/test601.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test601.py	(revision 24313)
@@ -9,13 +9,13 @@
 from solve import *
 
-md=triangle(model(),'../Exp/79North.exp',10000.)
-md=setmask(md,'../Exp/79NorthShelf.exp','')
-md=parameterize(md,'../Par/79North.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Masstransport')
+md = triangle(model(), '../Exp/79North.exp', 10000.)
+md = setmask(md, '../Exp/79NorthShelf.exp', '')
+md = parameterize(md, '../Par/79North.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Masstransport')
 
 #Fields and tolerances to track changes
-field_names     =['Thickness']
-field_tolerances=[1e-13]
-field_values=[md.results.MasstransportSolution.Thickness]
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test602.py
===================================================================
--- /issm/trunk/test/NightlyRun/test602.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test602.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: 79NorthMasstransp2dDG
-import numpy as np
 from model import *
 from socket import gethostname
@@ -11,18 +10,16 @@
 from solve import *
 
-md=triangle(model(),'../Exp/79North.exp',10000.)
-md=meshconvert(md)
-md=setmask(md,'../Exp/79NorthShelf.exp','')
-md=parameterize(md,'../Par/79North.py')
-md=setflowequation(md,'SSA','all')
-md.masstransport.stabilization=3
-md.masstransport.spcthickness=md.geometry.thickness
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Masstransport')
+md = triangle(model(), '../Exp/79North.exp', 10000.)
+md = meshconvert(md)
+md = setmask(md, '../Exp/79NorthShelf.exp', '')
+md = parameterize(md, '../Par/79North.py')
+md = setflowequation(md, 'SSA', 'all')
+md.masstransport.stabilization = 3
+md.masstransport.spcthickness = md.geometry.thickness
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Masstransport')
 
 #Fields and tolerances to track changes
-field_names     =['Thickness']
-field_tolerances=[1e-13]
-field_values=[\
-	md.results.MasstransportSolution.Thickness,\
-	]
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test603.py
===================================================================
--- /issm/trunk/test/NightlyRun/test603.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test603.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: 79NorthMasstransp3d
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,16 +9,14 @@
 from solve import *
 
-md=triangle(model(),'../Exp/79North.exp',10000.)
-md=setmask(md,'../Exp/79NorthShelf.exp','')
-md=parameterize(md,'../Par/79North.py')
-md.extrude(6,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Masstransport')
+md = triangle(model(), '../Exp/79North.exp', 10000.)
+md = setmask(md, '../Exp/79NorthShelf.exp', '')
+md = parameterize(md, '../Par/79North.py')
+md.extrude(6, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Masstransport')
 
 #Fields and tolerances to track changes
-field_names     =['Thickness']
-field_tolerances=[1e-13]
-field_values=[\
-	md.results.MasstransportSolution.Thickness,\
-	]
+field_names = ['Thickness']
+field_tolerances = [1e-13]
+field_values = [md.results.MasstransportSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test604.py
===================================================================
--- /issm/trunk/test/NightlyRun/test604.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test604.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: 79NorthSurfSlop2d
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,16 +9,14 @@
 from solve import *
 
-md=triangle(model(),'../Exp/79North.exp',10000.)
-md=setmask(md,'../Exp/79NorthShelf.exp','')
-md=parameterize(md,'../Par/79North.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'SurfaceSlope')
+md = triangle(model(), '../Exp/79North.exp', 10000.)
+md = setmask(md, '../Exp/79NorthShelf.exp', '')
+md = parameterize(md, '../Par/79North.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'SurfaceSlope')
 
 #Fields and tolerances to track changes
-field_names     =['SurfaceSlopeX','SurfaceSlopeY']
-field_tolerances=[1e-13,1e-13]
-field_values=[\
-	md.results.SurfaceSlopeSolution.SurfaceSlopeX,\
-	md.results.SurfaceSlopeSolution.SurfaceSlopeY,\
-	]
+field_names = ['SurfaceSlopeX', 'SurfaceSlopeY']
+field_tolerances = [1e-13, 1e-13]
+field_values = [md.results.SurfaceSlopeSolution.SurfaceSlopeX,
+                md.results.SurfaceSlopeSolution.SurfaceSlopeY]
Index: /issm/trunk/test/NightlyRun/test605.py
===================================================================
--- /issm/trunk/test/NightlyRun/test605.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test605.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: 79NorthSurfSlop3d
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,17 +9,15 @@
 from solve import *
 
-md=triangle(model(),'../Exp/79North.exp',10000.)
-md=setmask(md,'../Exp/79NorthShelf.exp','')
-md=parameterize(md,'../Par/79North.py')
-md.extrude(5,1.5)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'SurfaceSlope')
+md = triangle(model(), '../Exp/79North.exp', 10000.)
+md = setmask(md, '../Exp/79NorthShelf.exp', '')
+md = parameterize(md, '../Par/79North.py')
+md.extrude(5, 1.5)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'SurfaceSlope')
 
 #Fields and tolerances to track changes
-field_names     =['SurfaceSlopeX','SurfaceSlopeY']
-field_tolerances=[1e-13,1e-13]
-field_values=[\
-	md.results.SurfaceSlopeSolution.SurfaceSlopeX,\
-	md.results.SurfaceSlopeSolution.SurfaceSlopeY,\
-	]
+field_names = ['SurfaceSlopeX', 'SurfaceSlopeY']
+field_tolerances = [1e-13, 1e-13]
+field_values = [md.results.SurfaceSlopeSolution.SurfaceSlopeX,
+                md.results.SurfaceSlopeSolution.SurfaceSlopeY]
Index: /issm/trunk/test/NightlyRun/test606.py
===================================================================
--- /issm/trunk/test/NightlyRun/test606.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test606.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: 79NorthBedSlop2d
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,16 +9,14 @@
 from solve import *
 
-md=triangle(model(),'../Exp/79North.exp',10000.)
-md=setmask(md,'../Exp/79NorthShelf.exp','')
-md=parameterize(md,'../Par/79North.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'BedSlope')
+md = triangle(model(), '../Exp/79North.exp', 10000.)
+md = setmask(md, '../Exp/79NorthShelf.exp', '')
+md = parameterize(md, '../Par/79North.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'BedSlope')
 
 #Fields and tolerances to track changes
-field_names     =['BedSlopeX','BedSlopeY']
-field_tolerances=[1e-13,1e-13]
-field_values=[\
-	md.results.BedSlopeSolution.BedSlopeX,\
-	md.results.BedSlopeSolution.BedSlopeY,\
-	]
+field_names = ['BedSlopeX', 'BedSlopeY']
+field_tolerances = [1e-13, 1e-13]
+field_values = [md.results.BedSlopeSolution.BedSlopeX,
+                md.results.BedSlopeSolution.BedSlopeY]
Index: /issm/trunk/test/NightlyRun/test607.py
===================================================================
--- /issm/trunk/test/NightlyRun/test607.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test607.py	(revision 24313)
@@ -1,7 +1,5 @@
 #Test Name: 79NorthBedSlop3d
-import numpy as np
 from model import *
 from socket import gethostname
-
 from triangle import *
 from setmask import *
@@ -10,17 +8,15 @@
 from solve import *
 
-md=triangle(model(),'../Exp/79North.exp',10000.)
-md=setmask(md,'../Exp/79NorthShelf.exp','')
-md=parameterize(md,'../Par/79North.py')
-md.extrude(2,1.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'BedSlope')
+md = triangle(model(), '../Exp/79North.exp', 10000.)
+md = setmask(md, '../Exp/79NorthShelf.exp', '')
+md = parameterize(md, '../Par/79North.py')
+md.extrude(2, 1.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'BedSlope')
 
 #Fields and tolerances to track changes
-field_names     =['BedSlopeX','BedSlopeY']
-field_tolerances=[1e-13,1e-13]
-field_values=[\
-	md.results.BedSlopeSolution.BedSlopeX,\
-	md.results.BedSlopeSolution.BedSlopeY,\
-	]
+field_names = ['BedSlopeX', 'BedSlopeY']
+field_tolerances = [1e-13, 1e-13]
+field_values = [md.results.BedSlopeSolution.BedSlopeX,
+                md.results.BedSlopeSolution.BedSlopeY]
Index: /issm/trunk/test/NightlyRun/test608.py
===================================================================
--- /issm/trunk/test/NightlyRun/test608.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test608.py	(revision 24313)
@@ -1,4 +1,3 @@
 #Test Name: 79NorthBalThic2d
-import numpy as np
 from model import *
 from socket import gethostname
@@ -10,15 +9,13 @@
 from solve import *
 
-md=triangle(model(),'../Exp/79North.exp',10000.)
-md=setmask(md,'../Exp/79NorthShelf.exp','')
-md=parameterize(md,'../Par/79North.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Balancethickness')
+md = triangle(model(), '../Exp/79North.exp', 10000.)
+md = setmask(md, '../Exp/79NorthShelf.exp', '')
+md = parameterize(md, '../Par/79North.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Balancethickness')
 
 #Fields and tolerances to track changes
-field_names     =['Thickness']
-field_tolerances=[1e-12]
-field_values=[\
-	md.results.BalancethicknessSolution.Thickness,\
-	]
+field_names = ['Thickness']
+field_tolerances = [1e-12]
+field_values = [md.results.BalancethicknessSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test611.py
===================================================================
--- /issm/trunk/test/NightlyRun/test611.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test611.py	(revision 24313)
@@ -3,5 +3,4 @@
 from model import *
 from socket import gethostname
-
 from triangle import *
 from setmask import *
@@ -10,31 +9,31 @@
 from solve import *
 
-md=triangle(model(),'../Exp/79North.exp',10000.)
-md=setmask(md,'../Exp/79NorthShelf.exp','')
-md=parameterize(md,'../Par/79North.py')
-md=setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/79North.exp', 10000.)
+md = setmask(md, '../Exp/79NorthShelf.exp', '')
+md = parameterize(md, '../Par/79North.py')
+md = setflowequation(md, 'SSA', 'all')
 
 #control parameters
-md.inversion.nsteps=2
-md.masstransport.stabilization=1
-md.inversion.iscontrol=1
-md.inversion.control_parameters=['BalancethicknessThickeningRate']
-md.inversion.thickness_obs=md.geometry.thickness
-md.inversion.min_parameters=-50.*np.ones((md.mesh.numberofvertices))
-md.inversion.max_parameters=50.*np.ones((md.mesh.numberofvertices))
-md.inversion.cost_functions=[201]
-md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices))
-md.inversion.gradient_scaling=10./md.constants.yts*np.ones((md.inversion.nsteps))
-md.inversion.maxiter_per_step=4*np.ones((md.inversion.nsteps))
-md.inversion.step_threshold=0.99*np.ones((md.inversion.nsteps))
+md.inversion.nsteps = 2
+md.masstransport.stabilization = 1
+md.inversion.iscontrol = 1
+md.inversion.control_parameters = ['BalancethicknessThickeningRate']
+md.inversion.thickness_obs = md.geometry.thickness
+md.inversion.min_parameters = -50. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.max_parameters = 50. * np.ones((md.mesh.numberofvertices, len(md.inversion.control_parameters)))
+md.inversion.cost_functions = [201]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, len(md.inversion.cost_functions)))
+md.inversion.gradient_scaling = 10. / md.constants.yts * np.ones((md.inversion.nsteps, len(md.inversion.control_parameters)))
+md.inversion.maxiter_per_step = 4 * np.ones((md.inversion.nsteps))
+md.inversion.step_threshold = 0.99 * np.ones((md.inversion.nsteps))
 
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Balancethickness')
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Balancethickness')
 
 #Fields and tolerances to track changes
-field_names     =['Gradient','Misfits','BalancethicknessThickeningRate','Thickness']
-field_tolerances=[1e-12,1e-12,1e-12,1e-12,1e-12,1e-12]
-field_values=[md.results.BalancethicknessSolution.Gradient1,
-							md.results.BalancethicknessSolution.J,
-							md.results.BalancethicknessSolution.BalancethicknessThickeningRate,
-							md.results.BalancethicknessSolution.Thickness]
+field_names = ['Gradient', 'Misfits', 'BalancethicknessThickeningRate', 'Thickness']
+field_tolerances = [1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12]
+field_values = [md.results.BalancethicknessSolution.Gradient1,
+                md.results.BalancethicknessSolution.J,
+                md.results.BalancethicknessSolution.BalancethicknessThickeningRate,
+                md.results.BalancethicknessSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test613.py
===================================================================
--- /issm/trunk/test/NightlyRun/test613.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test613.py	(revision 24313)
@@ -12,40 +12,40 @@
 
 
-md=triangle(model(),'../Exp/79North.exp',10000.)
-md=meshconvert(md)
-md=setmask(md,'../Exp/79NorthShelf.exp','')
-md=parameterize(md,'../Par/79North.py')
-md=setflowequation(md,'SSA','all')
+md = triangle(model(), '../Exp/79North.exp', 10000.)
+md = meshconvert(md)
+md = setmask(md, '../Exp/79NorthShelf.exp', '')
+md = parameterize(md, '../Par/79North.py')
+md = setflowequation(md, 'SSA', 'all')
 
 #Ice sheet only
-md=model.extract(md,md.mask.groundedice_levelset>0.)
-pos=np.nonzero(md.mesh.vertexonboundary)
-md.balancethickness.spcthickness[pos]=md.geometry.thickness[pos]
+md = model.extract(md, md.mask.groundedice_levelset > 0.)
+pos = np.nonzero(md.mesh.vertexonboundary)
+md.balancethickness.spcthickness[pos] = md.geometry.thickness[pos]
 
 #control parameters
-md.inversion.thickness_obs=copy.deepcopy(md.geometry.thickness)
-md.inversion.iscontrol=1
-md.inversion.nsteps=2
-md.inversion.control_parameters=['Vx','Vy']
-md.balancethickness.stabilization=1
-md.inversion.gradient_scaling=np.vstack((10./md.constants.yts*np.ones((md.inversion.nsteps)),10./md.constants.yts*np.ones((md.inversion.nsteps)))).T
-md.inversion.min_parameters=np.vstack((-2000.*np.ones((md.mesh.numberofvertices)),-2000.*np.ones((md.mesh.numberofvertices)))).T
-md.inversion.max_parameters=np.vstack((+2000.*np.ones((md.mesh.numberofvertices)),+2000.*np.ones((md.mesh.numberofvertices)))).T
-md.inversion.cost_functions=[201]
-md.inversion.cost_functions_coefficients=np.ones((md.mesh.numberofvertices))
-md.inversion.maxiter_per_step=4*np.ones((md.inversion.nsteps))
-md.inversion.step_threshold=0.99*np.ones((md.inversion.nsteps))
+md.inversion.thickness_obs = copy.deepcopy(md.geometry.thickness)
+md.inversion.iscontrol = 1
+md.inversion.nsteps = 2
+md.inversion.control_parameters = ['Vx', 'Vy']
+md.balancethickness.stabilization = 1
+md.inversion.gradient_scaling = np.vstack((10. / md.constants.yts * np.ones((md.inversion.nsteps)), 10. / md.constants.yts * np.ones((md.inversion.nsteps)))).T
+md.inversion.min_parameters = np.vstack((-2000. * np.ones((md.mesh.numberofvertices)), -2000. * np.ones((md.mesh.numberofvertices)))).T
+md.inversion.max_parameters = np.vstack((+ 2000. * np.ones((md.mesh.numberofvertices)), +2000. * np.ones((md.mesh.numberofvertices)))).T
+md.inversion.cost_functions = [201]
+md.inversion.cost_functions_coefficients = np.ones((md.mesh.numberofvertices, len(md.inversion.cost_functions)))
+md.inversion.maxiter_per_step = 4 * np.ones((md.inversion.nsteps))
+md.inversion.step_threshold = 0.99 * np.ones((md.inversion.nsteps))
 
-md.verbose.control=1
-md.cluster=generic('name',gethostname(),'np',3)
-md=solve(md,'Balancethickness')
+md.verbose.control = 1
+md.cluster = generic('name', gethostname(), 'np', 3)
+md = solve(md, 'Balancethickness')
 
 #Fields and tolerances to track changes
-field_names     =['Gradient1','Gradient2','Misfits','Vx','Vy','Thickness']
-field_tolerances=[1e-12,1e-12,1e-12,1e-12,1e-12,1e-12]
-field_values=[md.results.BalancethicknessSolution.Gradient1,
-							md.results.BalancethicknessSolution.Gradient2,
-							md.results.BalancethicknessSolution.J,
-							md.results.BalancethicknessSolution.Vx,
-							md.results.BalancethicknessSolution.Vy,
-							md.results.BalancethicknessSolution.Thickness]
+field_names = ['Gradient1', 'Gradient2', 'Misfits', 'Vx', 'Vy', 'Thickness']
+field_tolerances = [1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12]
+field_values = [md.results.BalancethicknessSolution.Gradient1,
+                md.results.BalancethicknessSolution.Gradient2,
+                md.results.BalancethicknessSolution.J,
+                md.results.BalancethicknessSolution.Vx,
+                md.results.BalancethicknessSolution.Vy,
+                md.results.BalancethicknessSolution.Thickness]
Index: /issm/trunk/test/NightlyRun/test701.py
===================================================================
--- /issm/trunk/test/NightlyRun/test701.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test701.py	(revision 24313)
@@ -7,43 +7,47 @@
 from paterson import *
 
-x = np.arange(1,3001,100).T
-h = np.linspace(1000,300,np.size(x)).T
-b = -917./1023.*h
+x = np.arange(1, 3001, 100).T
+h = np.linspace(1000, 300, np.size(x)).T
+b = -917. / 1023. * h
 
-md = bamgflowband(model(),x,b+h,b,'hmax',80.)
+md = bamgflowband(model(), x, b + h, b, 'hmax', 80.)
 
-#Geometry	    #interp1d returns a function to be called on md.mesh.x
-md.geometry.surface = np.interp(md.mesh.x,x,b+h)
-md.geometry.base = np.interp(md.mesh.x,x,b)
-md.geometry.thickness = md.geometry.surface-md.geometry.base
+print(isinstance(md, model))
+
+#Geometry  #interp1d returns a function to be called on md.mesh.x
+md.geometry.surface = np.interp(md.mesh.x, x, b + h)
+md.geometry.base = np.interp(md.mesh.x, x, b)
+md.geometry.thickness = md.geometry.surface - md.geometry.base
 
 #mask
-md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices,))
+md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices, ))
 md.mask.ice_levelset[np.where(md.mesh.vertexflags(2))] = 0.
-md.mask.groundedice_levelset = np.zeros((md.mesh.numberofvertices,)) - 0.5
+md.mask.groundedice_levelset = np.zeros((md.mesh.numberofvertices, )) - 0.5
 
 #materials
-md.initialization.temperature = (273.-20.)*np.ones((md.mesh.numberofvertices,))
+md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, ))
 md.materials.rheology_B = paterson(md.initialization.temperature)
-md.materials.rheology_n = 3.*np.ones((md.mesh.numberofelements,))
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements, ))
 
 #friction
-md.friction.coefficient = np.zeros((md.mesh.numberofvertices,))
+md.friction.coefficient = np.zeros((md.mesh.numberofvertices, ))
 md.friction.coefficient[np.where(md.mesh.vertexflags(1))] = 20.
-md.friction.p = np.ones((md.mesh.numberofelements,))
-md.friction.q = np.ones((md.mesh.numberofelements,))
+md.friction.p = np.ones((md.mesh.numberofelements, ))
+md.friction.q = np.ones((md.mesh.numberofelements, ))
 
 #Boundary conditions
-md.stressbalance.referential = np.nan*np.ones((md.mesh.numberofvertices,6))
-md.stressbalance.loadingforce = 0. * np.ones((md.mesh.numberofvertices,3))
-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))
+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[np.where(md.mesh.vertexflags(4))] = 0.
 md.stressbalance.spcvy[np.where(md.mesh.vertexflags(4))] = 0.
-md.basalforcings.floatingice_melting_rate=np.zeros((md.mesh.numberofvertices,))
+md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
 
 #Misc
-md = setflowequation(md,'FS','all')
+print(isinstance(md, model))
+print(type(md))
+md = setflowequation(md, 'FS', 'all')
 md.stressbalance.abstol = np.nan
 #md.stressbalance.reltol = 10**-16
@@ -51,8 +55,8 @@
 md.stressbalance.maxiter = 20
 md.flowequation.augmented_lagrangian_r = 10000.
-md.miscellaneous.name  =  'test701'
-md.verbose = verbose('convergence',True)
-md.cluster = generic('np',2)
-md.groundingline.migration='None'
+md.miscellaneous.name = 'test701'
+md.verbose = verbose('convergence', True)
+md.cluster = generic('np', 2)
+md.groundingline.migration = 'None'
 
 #Go solve
@@ -60,14 +64,14 @@
 field_tolerances = []
 field_values = []
-#md.initialization.pressure = md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.y)
-for i in ['MINI','MINIcondensed','TaylorHood','LATaylorHood','CrouzeixRaviart','LACrouzeixRaviart']:
-	print ' '
-	print '======Testing ' +i+ ' Full-Stokes Finite element====='
-	md.flowequation.fe_FS = i
-	md = solve(md,'Stressbalance')
-	field_names = field_names + [['Vx'+i],['Vy'+i],['Vel'+i],['Pressure'+i]]
-	field_tolerances = field_tolerances + [9e-5,9e-5,9e-5,1e-10]
-	field_values = field_values + [md.results.StressbalanceSolution.Vx,
-																 md.results.StressbalanceSolution.Vy,
-																 md.results.StressbalanceSolution.Vel,
-																 md.results.StressbalanceSolution.Pressure]
+#md.initialization.pressure = md.constants.g * md.materials.rho_ice * (md.geometry.surface - md.mesh.y)
+for i in ['MINI', 'MINIcondensed', 'TaylorHood', 'LATaylorHood', 'CrouzeixRaviart', 'LACrouzeixRaviart']:
+    print(' ')
+    print(' == == == Testing ' + i + ' Full - Stokes Finite element == == = ')
+    md.flowequation.fe_FS = i
+    md = solve(md, 'Stressbalance')
+    field_names = field_names + [['Vx' + i], ['Vy' + i], ['Vel' + i], ['Pressure' + i]]
+    field_tolerances = field_tolerances + [9e-5, 9e-5, 9e-5, 1e-10]
+    field_values = field_values + [md.results.StressbalanceSolution.Vx,
+                                   md.results.StressbalanceSolution.Vy,
+                                   md.results.StressbalanceSolution.Vel,
+                                   md.results.StressbalanceSolution.Pressure]
Index: /issm/trunk/test/NightlyRun/test702.py
===================================================================
--- /issm/trunk/test/NightlyRun/test702.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test702.py	(revision 24313)
@@ -2,7 +2,7 @@
 import numpy as np
 #from scipy.interpolate import interp1d
-from model import  * 
-from setflowequation import  * 
-from solve import  *
+from model import *
+from setflowequation import *
+from solve import *
 from NowickiProfile import *
 from bamgflowband import *
@@ -10,51 +10,51 @@
 
 #mesh parameters
-x = np.arange(-5,5.5,.5).T
-[b,h,sea] = NowickiProfile(x)
+x = np.arange(-5, 5.5, .5).T
+[b, h, sea] = NowickiProfile(x)
 x = x * 10**3
 h = h * 10**3
-b = (b-sea) * 10**3
+b = (b - sea) * 10**3
 
 #mesh domain
-md = bamgflowband(model(),x,b+h,b,'hmax',150.)
+md = bamgflowband(model(), x, b + h, b, 'hmax', 150.)
 
 #parameterize
-md.geometry.surface = np.interp(md.mesh.x,x,b+h)
-md.geometry.base = np.interp(md.mesh.x,x,b)
+md.geometry.surface = np.interp(md.mesh.x, x, b + h)
+md.geometry.base = np.interp(md.mesh.x, x, b)
 md.geometry.thickness = md.geometry.surface - md.geometry.base
 
 #mask
-md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices,))
+md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices, ))
 md.mask.ice_levelset[np.where(md.mesh.vertexflags(2))] = 0
-md.mask.groundedice_levelset = -0.5*np.ones((md.mesh.numberofvertices))
-md.mask.groundedice_levelset[np.where(md.mesh.x<0)]=0.5
+md.mask.groundedice_levelset = -0.5 * np.ones((md.mesh.numberofvertices))
+md.mask.groundedice_levelset[np.where(md.mesh.x < 0)] = 0.5
 
 #materials
-md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices,))
+md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, ))
 md.materials.rheology_B = paterson(md.initialization.temperature)
-md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements,))
+md.materials.rheology_n = 3 * np.ones((md.mesh.numberofelements, ))
 
 #damage
-md.damage.D = np.zeros((md.mesh.numberofvertices,))
-md.damage.spcdamage = float('NaN') * np.ones((md.mesh.numberofvertices,))
+md.damage.D = np.zeros((md.mesh.numberofvertices, ))
+md.damage.spcdamage = float('NaN') * np.ones((md.mesh.numberofvertices, ))
 
 #friciton
-md.friction.coefficient = np.zeros((md.mesh.numberofvertices,))
+md.friction.coefficient = np.zeros((md.mesh.numberofvertices, ))
 md.friction.coefficient[np.where(md.mesh.vertexflags(1))] = 20
-md.friction.p = np.ones((md.mesh.numberofelements,))
-md.friction.q = np.ones((md.mesh.numberofelements,))
+md.friction.p = np.ones((md.mesh.numberofelements, ))
+md.friction.q = np.ones((md.mesh.numberofelements, ))
 
 #boundary conditions
-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.loadingforce = np.zeros((md.mesh.numberofvertices,3))
+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.loadingforce = np.zeros((md.mesh.numberofvertices, 3))
 md.stressbalance.spcvx[np.where(md.mesh.vertexflags(4))] = 800.
 md.stressbalance.spcvy[np.where(md.mesh.vertexflags(4))] = 0.
-md.basalforcings.floatingice_melting_rate=np.zeros((md.mesh.numberofvertices,))
+md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices, ))
 
 #misc
-md = setflowequation(md,'FS','all')
+md = setflowequation(md, 'FS', 'all')
 md.stressbalance.abstol = float('NaN')
 md.stressbalance.FSreconditioning = 1
@@ -65,5 +65,5 @@
 md.miscellaneous.name = 'test702'
 md.groundingline.migration = 'None'
-md.cluster = generic('np',2)
+md.cluster = generic('np', 2)
 
 #Fields and tolerances to track changes
@@ -71,15 +71,13 @@
 field_tolerances = []
 field_values = []
-for i in ['MINI','MINIcondensed','TaylorHood','XTaylorHood','LATaylorHood']:
-	print ' '
-	print '======Testing ' +i+ ' Full-Stokes Finite element====='
-	md.flowequation.fe_FS = i
-	md = solve(md,'Stressbalance')
-	field_names.extend(['Vx'+i,'Vy'+i,'Vel'+i,'Pressure'+i])
-	field_tolerances.extend([8e-5,8e-5,8e-5,1e-08])
-	field_values.extend([
-		md.results.StressbalanceSolution.Vx,
-		md.results.StressbalanceSolution.Vy,
-		md.results.StressbalanceSolution.Vel,
-		md.results.StressbalanceSolution.Pressure
-		])
+for i in ['MINI', 'MINIcondensed', 'TaylorHood', 'XTaylorHood', 'LATaylorHood']:
+    print(' ')
+    print(' == == == Testing ' + i + ' Full - Stokes Finite element == == = ')
+    md.flowequation.fe_FS = i
+    md = solve(md, 'Stressbalance')
+    field_names.extend(['Vx' + i, 'Vy' + i, 'Vel' + i, 'Pressure' + i])
+    field_tolerances.extend([8e-5, 8e-5, 8e-5, 1e-08])
+    field_values.extend([md.results.StressbalanceSolution.Vx,
+                         md.results.StressbalanceSolution.Vy,
+                         md.results.StressbalanceSolution.Vel,
+                         md.results.StressbalanceSolution.Pressure])
Index: /issm/trunk/test/NightlyRun/test703.py
===================================================================
--- /issm/trunk/test/NightlyRun/test703.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test703.py	(revision 24313)
@@ -1,7 +1,7 @@
 #Test Name: FlowbandFSsheetshelfTrans
 import numpy as np
-from model import  *
-from setflowequation import  *
-from solve import  *
+from model import *
+from setflowequation import *
+from solve import *
 from NowickiProfile import *
 from bamgflowband import *
@@ -9,17 +9,17 @@
 
 #mesh parameters
-x = np.arange(-5,5.5,.5).T
-[b,h,sea] = NowickiProfile(x)
+x = np.arange(-5, 5.5, .5).T
+[b, h, sea] = NowickiProfile(x)
 x = x * 10**3
 h = h * 10**3
-b = (b-sea) * 10**3
+b = (b - sea) * 10**3
 
 #for i in x:
-	#print i
+#print i
 
 #for i in b:
-	#print '%.12f' % i
+#print '%.12f' % i
 #for i in h:
-	#print '%.11f' % i
+#print '%.11f' % i
 #print '%.12f' % sea
 
@@ -30,9 +30,9 @@
 
 #mesh domain
-md = bamgflowband(model(),x,b+h,b,'hmax',150.)
+md = bamgflowband(model(), x, b + h, b, 'hmax', 150.)
 
 #geometry
-md.geometry.surface = np.interp(md.mesh.x,x,b+h)
-md.geometry.base = np.interp(md.mesh.x,x,b)
+md.geometry.surface = np.interp(md.mesh.x, x, b + h)
+md.geometry.base = np.interp(md.mesh.x, x, b)
 md.geometry.thickness = md.geometry.surface - md.geometry.base
 
@@ -40,6 +40,6 @@
 md.mask.ice_levelset = -np.ones((md.mesh.numberofvertices))
 md.mask.ice_levelset[np.where(md.mesh.vertexflags(2))] = 0
-md.mask.groundedice_levelset = -0.5*np.ones((md.mesh.numberofvertices))
-md.mask.groundedice_levelset[np.where(md.mesh.x<0)]=0.5
+md.mask.groundedice_levelset = -0.5 * np.ones((md.mesh.numberofvertices))
+md.mask.groundedice_levelset[np.where(md.mesh.x < 0)] = 0.5
 
 #materials
@@ -58,11 +58,11 @@
 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 = np.zeros((md.mesh.numberofvertices,3))
+md.stressbalance.referential = np.nan * np.ones((md.mesh.numberofvertices, 6))
+md.stressbalance.loadingforce = np.zeros((md.mesh.numberofvertices, 3))
 md.stressbalance.spcvx[np.where(md.mesh.vertexflags(4))] = 800.
 md.stressbalance.spcvy[np.where(md.mesh.vertexflags(4))] = 0.
 
 #Misc
-md = setflowequation(md,'FS','all')
+md = setflowequation(md, 'FS', 'all')
 md.flowequation.fe_FS = 'TaylorHood'
 md.stressbalance.abstol = np.nan
@@ -77,5 +77,5 @@
 md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices))
 md.basalforcings.geothermalflux = np.zeros((md.mesh.numberofvertices))
-posb = np.where(np.logical_and(md.mesh.x > 0.,md.mesh.vertexonbase))[0]
+posb = np.where(np.logical_and(md.mesh.x > 0., md.mesh.vertexonbase))[0]
 md.basalforcings.groundedice_melting_rate[posb] = 18.
 md.basalforcings.floatingice_melting_rate[posb] = 18.
@@ -87,68 +87,68 @@
 md.transient.isthermal = 0
 md.masstransport.isfreesurface = 1
-md.groundingline.migration='None'
+md.groundingline.migration = 'None'
 
 #Go solve
-md.cluster = generic('np',3)
+md.cluster = generic('np', 3)
 md.stressbalance.shelf_dampening = 1
-md1=copy.deepcopy(md)
-md1 = solve(md1,'Transient')
+md1 = copy.deepcopy(md)
+md1 = solve(md1, 'Transient')
 
 md.stressbalance.shelf_dampening = 0
-md = solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names      = ['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1',
-										'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2',
-										'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3',
-										'Vx1_damp','Vy1_damp','Vel1_damp','Pressure1_damp','Bed1_damp','Surface1_damp','Thickness1_damp',
-										'Vx2_damp','Vy2_damp','Vel2_damp','Pressure2_damp','Bed2_damp','Surface2_damp','Thickness2_damp',
-										'Vx3_damp','Vy3_damp','Vel3_damp','Pressure3_damp','Bed3_damp','Surface3_damp','Thickness3_damp']
-field_tolerances = [2e-08,2e-08,2e-08,1e-08,1e-10,1e-10,1e-10,
-										2e-08,2e-08,2e-08,1e-08,1e-10,1e-10,1e-10,
-										2e-08,2e-08,2e-08,1e-08,1e-10,1e-10,1e-10,
-										5e-08,5e-08,5e-08,1e-08,1e-10,1e-10,1e-10,
-										5e-08,5e-08,5e-08,1e-08,1e-10,1e-10,1e-10,
-										5e-08,5e-08,5e-08,1e-08,1e-10,1e-10,1e-10]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3',
+               'Vx1_damp', 'Vy1_damp', 'Vel1_damp', 'Pressure1_damp', 'Bed1_damp', 'Surface1_damp', 'Thickness1_damp',
+               'Vx2_damp', 'Vy2_damp', 'Vel2_damp', 'Pressure2_damp', 'Bed2_damp', 'Surface2_damp', 'Thickness2_damp',
+               'Vx3_damp', 'Vy3_damp', 'Vel3_damp', 'Pressure3_damp', 'Bed3_damp', 'Surface3_damp', 'Thickness3_damp']
+field_tolerances = [2e-08, 2e-08, 2e-08, 1e-08, 1e-10, 1e-10, 1e-10,
+                    2e-08, 2e-08, 2e-08, 1e-08, 1e-10, 1e-10, 1e-10,
+                    2e-08, 2e-08, 2e-08, 1e-08, 1e-10, 1e-10, 1e-10,
+                    5e-08, 5e-08, 5e-08, 1e-08, 1e-10, 1e-10, 1e-10,
+                    5e-08, 5e-08, 5e-08, 1e-08, 1e-10, 1e-10, 1e-10,
+                    5e-08, 5e-08, 5e-08, 1e-08, 1e-10, 1e-10, 1e-10]
 field_values = [md.results.TransientSolution[0].Vx,
-								md.results.TransientSolution[0].Vy,
-								md.results.TransientSolution[0].Vel,
-								md.results.TransientSolution[0].Pressure,
-								md.results.TransientSolution[0].Base,
-								md.results.TransientSolution[0].Surface,
-								md.results.TransientSolution[0].Thickness,
-								md.results.TransientSolution[1].Vx,
-								md.results.TransientSolution[1].Vy,
-								md.results.TransientSolution[1].Vel,
-								md.results.TransientSolution[1].Pressure,
-								md.results.TransientSolution[1].Base,
-								md.results.TransientSolution[1].Surface,
-								md.results.TransientSolution[1].Thickness,
-								md.results.TransientSolution[2].Vx,
-								md.results.TransientSolution[2].Vy,
-								md.results.TransientSolution[2].Vel,
-								md.results.TransientSolution[2].Pressure,
-								md.results.TransientSolution[2].Base,
-								md.results.TransientSolution[2].Surface,
-								md.results.TransientSolution[2].Thickness,
-								md1.results.TransientSolution[0].Vx,
-								md1.results.TransientSolution[0].Vy,
-								md1.results.TransientSolution[0].Vel,
-								md1.results.TransientSolution[0].Pressure,
-								md1.results.TransientSolution[0].Base,
-								md1.results.TransientSolution[0].Surface,
-								md1.results.TransientSolution[0].Thickness,
-								md1.results.TransientSolution[1].Vx,
-								md1.results.TransientSolution[1].Vy,
-								md1.results.TransientSolution[1].Vel,
-								md1.results.TransientSolution[1].Pressure,
-								md1.results.TransientSolution[1].Base,
-								md1.results.TransientSolution[1].Surface,
-								md1.results.TransientSolution[1].Thickness,
-								md1.results.TransientSolution[2].Vx,
-								md1.results.TransientSolution[2].Vy,
-								md1.results.TransientSolution[2].Vel,
-								md1.results.TransientSolution[2].Pressure,
-								md1.results.TransientSolution[2].Base,
-								md1.results.TransientSolution[2].Surface,
-								md1.results.TransientSolution[2].Thickness]
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Base,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Base,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Base,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].Thickness,
+                md1.results.TransientSolution[0].Vx,
+                md1.results.TransientSolution[0].Vy,
+                md1.results.TransientSolution[0].Vel,
+                md1.results.TransientSolution[0].Pressure,
+                md1.results.TransientSolution[0].Base,
+                md1.results.TransientSolution[0].Surface,
+                md1.results.TransientSolution[0].Thickness,
+                md1.results.TransientSolution[1].Vx,
+                md1.results.TransientSolution[1].Vy,
+                md1.results.TransientSolution[1].Vel,
+                md1.results.TransientSolution[1].Pressure,
+                md1.results.TransientSolution[1].Base,
+                md1.results.TransientSolution[1].Surface,
+                md1.results.TransientSolution[1].Thickness,
+                md1.results.TransientSolution[2].Vx,
+                md1.results.TransientSolution[2].Vy,
+                md1.results.TransientSolution[2].Vel,
+                md1.results.TransientSolution[2].Pressure,
+                md1.results.TransientSolution[2].Base,
+                md1.results.TransientSolution[2].Surface,
+                md1.results.TransientSolution[2].Thickness]
Index: /issm/trunk/test/NightlyRun/test801.py
===================================================================
--- /issm/trunk/test/NightlyRun/test801.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test801.py	(revision 24313)
@@ -8,49 +8,48 @@
 from solve import *
 
-
-md=triangle(model(),'../Exp/Square.exp',50000)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/ValleyGlacierShelf.py')
-md.levelset.stabilization=2
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 50000)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/ValleyGlacierShelf.py')
+md.levelset.stabilization = 2
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 #Transient
-md.transient.isstressbalance=True
-md.transient.ismovingfront=True
-md.transient.ismasstransport=True
-md.transient.issmb=True
-md.transient.isthermal=False
-md.transient.isgroundingline=True
-md.transient.isgia=False
+md.transient.isstressbalance = True
+md.transient.ismovingfront = True
+md.transient.ismasstransport = True
+md.transient.issmb = True
+md.transient.isthermal = False
+md.transient.isgroundingline = True
+md.transient.isgia = False
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1',
-									'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2',
-									'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3']
-field_tolerances=[1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,
-									1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,
-									1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].MaskIceLevelset,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].MaskIceLevelset,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].MaskIceLevelset]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Thickness1', 'Surface1', 'MaskIceLevelset1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Thickness2', 'Surface2', 'MaskIceLevelset2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Thickness3', 'Surface3', 'MaskIceLevelset3']
+field_tolerances = [1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12,
+                    1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12,
+                    1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].MaskIceLevelset,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].MaskIceLevelset,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].MaskIceLevelset]
Index: /issm/trunk/test/NightlyRun/test802.py
===================================================================
--- /issm/trunk/test/NightlyRun/test802.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test802.py	(revision 24313)
@@ -9,56 +9,56 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',50000)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/ValleyGlacierShelf.py')
-md.extrude(3,2.)
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 50000)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/ValleyGlacierShelf.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 #Thermal model
-pos_surf=np.nonzero(md.mesh.vertexonsurface)[0]
-md.thermal.spctemperature[pos_surf]=md.initialization.temperature[pos_surf]
+pos_surf = np.nonzero(md.mesh.vertexonsurface)[0]
+md.thermal.spctemperature[pos_surf] = md.initialization.temperature[pos_surf]
 
 #Transient
-md.transient.isstressbalance=True
-md.transient.ismovingfront=True
-md.transient.ismasstransport=True
-md.transient.issmb=True
-md.transient.isthermal=True
-md.transient.isgroundingline=True
-md.transient.isgia=False
-md.groundingline.melt_interpolation='SubelementMelt1'
+md.transient.isstressbalance = True
+md.transient.ismovingfront = True
+md.transient.ismasstransport = True
+md.transient.issmb = True
+md.transient.isthermal = True
+md.transient.isgroundingline = True
+md.transient.isgia = False
+md.groundingline.melt_interpolation = 'SubelementMelt1'
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1','Temperature1',
-									'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2','Temperature2',
-									'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3','Temperature3']
-field_tolerances=[1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,1e-12,
-									1e-9,1e-9,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,
-									1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].MaskIceLevelset,
-							md.results.TransientSolution[0].Temperature,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].MaskIceLevelset,
-							md.results.TransientSolution[1].Temperature,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].MaskIceLevelset,
-							md.results.TransientSolution[2].Temperature]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Thickness1', 'Surface1', 'MaskIceLevelset1', 'Temperature1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Thickness2', 'Surface2', 'MaskIceLevelset2', 'Temperature2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Thickness3', 'Surface3', 'MaskIceLevelset3', 'Temperature3']
+field_tolerances = [1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12, 1e-12,
+                    1e-9, 1e-9, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9,
+                    1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].MaskIceLevelset,
+                md.results.TransientSolution[0].Temperature,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].MaskIceLevelset,
+                md.results.TransientSolution[1].Temperature,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].MaskIceLevelset,
+                md.results.TransientSolution[2].Temperature]
Index: /issm/trunk/test/NightlyRun/test803.py
===================================================================
--- /issm/trunk/test/NightlyRun/test803.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test803.py	(revision 24313)
@@ -9,61 +9,61 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',50000)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/ValleyGlacierShelf.py')
-md.extrude(3,2.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 50000)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/ValleyGlacierShelf.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 #Thermal model
-pos_surf=np.where(md.mesh.vertexonsurface)[0]
-md.thermal.spctemperature[pos_surf]=md.initialization.temperature[pos_surf]
-md.thermal.isenthalpy=True
-md.thermal.isdynamicbasalspc=True
+pos_surf = np.where(md.mesh.vertexonsurface)[0]
+md.thermal.spctemperature[pos_surf] = md.initialization.temperature[pos_surf]
+md.thermal.isenthalpy = True
+md.thermal.isdynamicbasalspc = True
 
 #Transient
-md.transient.isstressbalance=True
-md.transient.ismovingfront=True
-md.transient.ismasstransport=True
-md.transient.issmb=True
-md.transient.isthermal=True
-md.transient.isgroundingline=True
-md.transient.isgia=False
-md.groundingline.melt_interpolation='SubelementMelt1'
+md.transient.isstressbalance = True
+md.transient.ismovingfront = True
+md.transient.ismasstransport = True
+md.transient.issmb = True
+md.transient.isthermal = True
+md.transient.isgroundingline = True
+md.transient.isgia = False
+md.groundingline.melt_interpolation = 'SubelementMelt1'
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1','Enthalpy1','Watercolumn1',
-        'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2','Enthalpy2','Watercolumn2',
-        'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3','Enthalpy3','Watercolumn3']
-field_tolerances=[1e-10,1e-10,1e-10,1e-13,1e-12,1e-12,1e-13,1e-13,1e-13,
-        1e-9,1e-9,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,1e-10,
-        1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
-field_values=[md.results.TransientSolution[0].Vx,
-        md.results.TransientSolution[0].Vy,
-        md.results.TransientSolution[0].Vel,
-        md.results.TransientSolution[0].Pressure,
-        md.results.TransientSolution[0].Thickness,
-        md.results.TransientSolution[0].Surface,
-        md.results.TransientSolution[0].MaskIceLevelset,
-        md.results.TransientSolution[0].Enthalpy,
-        md.results.TransientSolution[0].Watercolumn,
-        md.results.TransientSolution[1].Vx,
-        md.results.TransientSolution[1].Vy,
-        md.results.TransientSolution[1].Vel,
-        md.results.TransientSolution[1].Pressure,
-        md.results.TransientSolution[1].Thickness,
-        md.results.TransientSolution[1].Surface,
-        md.results.TransientSolution[1].MaskIceLevelset,
-        md.results.TransientSolution[1].Enthalpy,
-        md.results.TransientSolution[1].Watercolumn,
-        md.results.TransientSolution[2].Vx,
-        md.results.TransientSolution[2].Vy,
-        md.results.TransientSolution[2].Vel,
-        md.results.TransientSolution[2].Pressure,
-        md.results.TransientSolution[2].Thickness,
-        md.results.TransientSolution[2].Surface,
-        md.results.TransientSolution[2].MaskIceLevelset,
-        md.results.TransientSolution[2].Enthalpy,
-        md.results.TransientSolution[2].Watercolumn]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Thickness1', 'Surface1', 'MaskIceLevelset1', 'Enthalpy1', 'Watercolumn1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Thickness2', 'Surface2', 'MaskIceLevelset2', 'Enthalpy2', 'Watercolumn2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Thickness3', 'Surface3', 'MaskIceLevelset3', 'Enthalpy3', 'Watercolumn3']
+field_tolerances = [1e-10, 1e-10, 1e-10, 1e-13, 1e-12, 1e-12, 1e-13, 1e-13, 1e-13,
+                    1e-9, 1e-9, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9, 1e-10,
+                    1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].MaskIceLevelset,
+                md.results.TransientSolution[0].Enthalpy,
+                md.results.TransientSolution[0].Watercolumn,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].MaskIceLevelset,
+                md.results.TransientSolution[1].Enthalpy,
+                md.results.TransientSolution[1].Watercolumn,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].MaskIceLevelset,
+                md.results.TransientSolution[2].Enthalpy,
+                md.results.TransientSolution[2].Watercolumn]
Index: /issm/trunk/test/NightlyRun/test804.m
===================================================================
--- /issm/trunk/test/NightlyRun/test804.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test804.m	(revision 24313)
@@ -16,5 +16,5 @@
 
 md.calving.calvingrate=1000.*ones(md.mesh.numberofvertices,1);
-md.calving.meltingrate=zeros(md.mesh.numberofvertices,1);
+md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
 
 md=solve(md,'Transient');
Index: /issm/trunk/test/NightlyRun/test804.py
===================================================================
--- /issm/trunk/test/NightlyRun/test804.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test804.py	(revision 24313)
@@ -9,50 +9,50 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',50000)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/ValleyGlacierShelf.py')
-md=setflowequation(md,'SIA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 50000)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/ValleyGlacierShelf.py')
+md = setflowequation(md, 'SIA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 #Transient
-md.transient.isstressbalance=True
-md.transient.ismasstransport=True
-md.transient.issmb=True
-md.transient.isthermal=False
-md.transient.isgroundingline=True
-md.transient.isgia=False
-md.transient.ismovingfront=True
+md.transient.isstressbalance = True
+md.transient.ismasstransport = True
+md.transient.issmb = True
+md.transient.isthermal = False
+md.transient.isgroundingline = True
+md.transient.isgia = False
+md.transient.ismovingfront = True
 
-md.calving.calvingrate=1000.*np.ones((md.mesh.numberofvertices))
-md.calving.meltingrate=np.zeros((md.mesh.numberofvertices))
+md.calving.calvingrate = 1000. * np.ones((md.mesh.numberofvertices))
+md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices))
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1',
-									'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2',
-									'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3']
-field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,
-									2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,
-									2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].MaskIceLevelset,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].MaskIceLevelset,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].MaskIceLevelset]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Thickness1', 'Surface1', 'MaskIceLevelset1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Thickness2', 'Surface2', 'MaskIceLevelset2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Thickness3', 'Surface3', 'MaskIceLevelset3']
+field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13,
+                    2e-13, 2e-13, 2e-13, 1e-13, 1e-13, 1e-13, 1e-13]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].MaskIceLevelset,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].MaskIceLevelset,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].MaskIceLevelset]
Index: /issm/trunk/test/NightlyRun/test805.m
===================================================================
--- /issm/trunk/test/NightlyRun/test805.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test805.m	(revision 24313)
@@ -23,5 +23,5 @@
 
 md.calving.calvingrate=1000.*ones(md.mesh.numberofvertices,1);
-md.calving.meltingrate=zeros(md.mesh.numberofvertices,1);
+md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
 md.groundingline.melt_interpolation='SubelementMelt1';
 md.levelset.stabilization=2;
Index: /issm/trunk/test/NightlyRun/test805.py
===================================================================
--- /issm/trunk/test/NightlyRun/test805.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test805.py	(revision 24313)
@@ -9,65 +9,65 @@
 
 
-md=triangle(model(),'../Exp/Square.exp',50000)
-md=setmask(md,'','')
-md=parameterize(md,'../Par/ValleyGlacierShelf.py')
-md.extrude(3,2.)
-md=setflowequation(md,'HO','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 50000)
+md = setmask(md, '', '')
+md = parameterize(md, '../Par/ValleyGlacierShelf.py')
+md.extrude(3, 2.)
+md = setflowequation(md, 'HO', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 #Thermal model
-pos_surf=np.nonzero(md.mesh.vertexonsurface)[0]
-md.thermal.spctemperature[pos_surf]=md.initialization.temperature[pos_surf]
-md.thermal.isenthalpy=True
-md.thermal.isdynamicbasalspc=True
+pos_surf = np.nonzero(md.mesh.vertexonsurface)[0]
+md.thermal.spctemperature[pos_surf] = md.initialization.temperature[pos_surf]
+md.thermal.isenthalpy = True
+md.thermal.isdynamicbasalspc = True
 
 #Transient
-md.transient.isstressbalance=True
-md.transient.ismasstransport=True
-md.transient.issmb=True
-md.transient.isthermal=True
-md.transient.isgroundingline=True
-md.transient.isgia=False
-md.transient.ismovingfront=True
+md.transient.isstressbalance = True
+md.transient.ismasstransport = True
+md.transient.issmb = True
+md.transient.isthermal = True
+md.transient.isgroundingline = True
+md.transient.isgia = False
+md.transient.ismovingfront = True
 
-md.calving.calvingrate=1000.*np.ones((md.mesh.numberofvertices))
-md.calving.meltingrate=np.zeros((md.mesh.numberofvertices))
-md.groundingline.melt_interpolation='SubelementMelt1'
-md.levelset.stabilization=2
+md.calving.calvingrate = 1000. * np.ones((md.mesh.numberofvertices))
+md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices))
+md.groundingline.melt_interpolation = 'SubelementMelt1'
+md.levelset.stabilization = 2
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1','Enthalpy1','Watercolumn1',
-									'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2','Enthalpy2','Watercolumn2',
-									'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3','Enthalpy3','Watercolumn3']
-field_tolerances=[1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,
-									1e-9,1e-9,1e-10,1e-10,1e-10,1e-10,1e-10,1e-9,1e-10,
-									1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].MaskIceLevelset,
-							md.results.TransientSolution[0].Enthalpy,
-							md.results.TransientSolution[0].Watercolumn,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].MaskIceLevelset,
-							md.results.TransientSolution[1].Enthalpy,
-							md.results.TransientSolution[1].Watercolumn,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].MaskIceLevelset,
-							md.results.TransientSolution[2].Enthalpy,
-							md.results.TransientSolution[2].Watercolumn]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Thickness1', 'Surface1', 'MaskIceLevelset1', 'Enthalpy1', 'Watercolumn1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Thickness2', 'Surface2', 'MaskIceLevelset2', 'Enthalpy2', 'Watercolumn2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Thickness3', 'Surface3', 'MaskIceLevelset3', 'Enthalpy3', 'Watercolumn3']
+field_tolerances = [1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11,
+                    1e-9, 1e-9, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-9, 1e-10,
+                    1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10, 1e-10]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].MaskIceLevelset,
+                md.results.TransientSolution[0].Enthalpy,
+                md.results.TransientSolution[0].Watercolumn,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].MaskIceLevelset,
+                md.results.TransientSolution[1].Enthalpy,
+                md.results.TransientSolution[1].Watercolumn,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].MaskIceLevelset,
+                md.results.TransientSolution[2].Enthalpy,
+                md.results.TransientSolution[2].Watercolumn]
Index: /issm/trunk/test/NightlyRun/test806.m
===================================================================
--- /issm/trunk/test/NightlyRun/test806.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test806.m	(revision 24313)
@@ -5,4 +5,7 @@
 md=setflowequation(md,'SSA','all');
 md.cluster=generic('name',oshostname(),'np',3);
+
+%Do not kill ice bergs as all is floating
+md.levelset.kill_icebergs=0;
 
 x = md.mesh.x;
@@ -27,5 +30,5 @@
 md.calving=calvinglevermann();
 md.calving.coeff=4.89e13*ones(md.mesh.numberofvertices,1);
-md.calving.meltingrate=zeros(md.mesh.numberofvertices,1);
+md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
 md.levelset.spclevelset=NaN(md.mesh.numberofvertices,1);
 
Index: /issm/trunk/test/NightlyRun/test806.py
===================================================================
--- /issm/trunk/test/NightlyRun/test806.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test806.py	(revision 24313)
@@ -10,73 +10,76 @@
 import numpy as np
 
-md=triangle(model(),'../Exp/Square.exp',50000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 50000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 x = md.mesh.x
 xmin = min(x)
 xmax = max(x)
-Lx = (xmax-xmin)
-alpha = 2./3.
-md.mask.ice_levelset = np.float_((x - alpha*Lx)>0) - np.float_((x - alpha*Lx)<0)
+Lx = (xmax - xmin)
+alpha = 2. / 3.
+md.mask.ice_levelset = np.float_((x - alpha * Lx) > 0) - np.float_((x - alpha * Lx) < 0)
 
-md.timestepping.time_step=10
-md.timestepping.final_time=30
+#Do not kill ice bergs as all is floating
+md.levelset.kill_icebergs = 0
+
+md.timestepping.time_step = 10
+md.timestepping.final_time = 30
 
 #Transient
-md.transient.isstressbalance=True
-md.transient.ismasstransport=True
-md.transient.issmb=True
-md.transient.isthermal=False
-md.transient.isgroundingline=False
-md.transient.isgia=False
-md.transient.ismovingfront=True
+md.transient.isstressbalance = True
+md.transient.ismasstransport = True
+md.transient.issmb = True
+md.transient.isthermal = False
+md.transient.isgroundingline = False
+md.transient.isgia = False
+md.transient.ismovingfront = True
 
-md.calving=calvinglevermann()
-md.calving.coeff=4.89e13*np.ones((md.mesh.numberofvertices))
-md.calving.meltingrate=np.zeros((md.mesh.numberofvertices))
-md.levelset.spclevelset=np.nan*np.ones((md.mesh.numberofvertices))
+md.calving = calvinglevermann()
+md.calving.coeff = 4.89e13 * np.ones((md.mesh.numberofvertices))
+md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices))
+md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices))
 
-md.transient.requested_outputs=['default','StrainRateparallel','StrainRateperpendicular','Calvingratex','Calvingratey','CalvingCalvingrate']
+md.transient.requested_outputs = ['default', 'StrainRateparallel', 'StrainRateperpendicular', 'Calvingratex', 'Calvingratey', 'CalvingCalvingrate']
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1','StrainRateparallel1','StrainRateperpendicular1','CalvingCalvingrate1',
-									'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2','StrainRateparallel2','StrainRateperpendicular2','CalvingCalvingrate2',
-									'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3','StrainRateparallel3','StrainRateperpendicular3','CalvingCalvingrate3']
-field_tolerances=[1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,
-									2e-11,2e-11,2e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,
-									2e-11,2e-11,2e-11,1e-11,1e-11,1e-11,1e-11,5e-11,5e-11,1e-11]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].MaskIceLevelset,
-							md.results.TransientSolution[0].StrainRateparallel,
-							md.results.TransientSolution[0].StrainRateperpendicular,
-							md.results.TransientSolution[0].CalvingCalvingrate,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].MaskIceLevelset,
-							md.results.TransientSolution[1].StrainRateparallel,
-							md.results.TransientSolution[1].StrainRateperpendicular,
-							md.results.TransientSolution[1].CalvingCalvingrate,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].MaskIceLevelset,
-							md.results.TransientSolution[2].StrainRateparallel,
-							md.results.TransientSolution[2].StrainRateperpendicular,
-							md.results.TransientSolution[2].CalvingCalvingrate]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Thickness1', 'Surface1', 'MaskIceLevelset1', 'StrainRateparallel1', 'StrainRateperpendicular1', 'CalvingCalvingrate1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Thickness2', 'Surface2', 'MaskIceLevelset2', 'StrainRateparallel2', 'StrainRateperpendicular2', 'CalvingCalvingrate2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Thickness3', 'Surface3', 'MaskIceLevelset3', 'StrainRateparallel3', 'StrainRateperpendicular3', 'CalvingCalvingrate3']
+field_tolerances = [1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11,
+                    2e-11, 2e-11, 2e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11,
+                    2e-11, 2e-11, 2e-11, 1e-11, 1e-11, 1e-11, 1e-11, 5e-11, 5e-11, 1e-11]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].MaskIceLevelset,
+                md.results.TransientSolution[0].StrainRateparallel,
+                md.results.TransientSolution[0].StrainRateperpendicular,
+                md.results.TransientSolution[0].CalvingCalvingrate,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].MaskIceLevelset,
+                md.results.TransientSolution[1].StrainRateparallel,
+                md.results.TransientSolution[1].StrainRateperpendicular,
+                md.results.TransientSolution[1].CalvingCalvingrate,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].MaskIceLevelset,
+                md.results.TransientSolution[2].StrainRateparallel,
+                md.results.TransientSolution[2].StrainRateperpendicular,
+                md.results.TransientSolution[2].CalvingCalvingrate]
Index: /issm/trunk/test/NightlyRun/test807.m
===================================================================
--- /issm/trunk/test/NightlyRun/test807.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test807.m	(revision 24313)
@@ -13,4 +13,7 @@
 md.mask.ice_levelset = ((x - alpha*Lx)>0) - ((x - alpha*Lx)<0);
 
+%Do not kill ice bergs as all is floating
+md.levelset.kill_icebergs=0;
+
 md.timestepping.time_step=10;
 md.timestepping.final_time=30;
@@ -26,5 +29,5 @@
 
 md.calving.calvingrate=zeros(md.mesh.numberofvertices,1);
-md.calving.meltingrate=10000*ones(md.mesh.numberofvertices,1);
+md.frontalforcings.meltingrate=10000*ones(md.mesh.numberofvertices,1);
 md.levelset.spclevelset=NaN(md.mesh.numberofvertices,1);
 
Index: /issm/trunk/test/NightlyRun/test807.py
===================================================================
--- /issm/trunk/test/NightlyRun/test807.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test807.py	(revision 24313)
@@ -10,61 +10,64 @@
 import numpy as np
 
-md=triangle(model(),'../Exp/Square.exp',50000.)
-md=setmask(md,'all','')
-md=parameterize(md,'../Par/SquareShelf.py')
-md=setflowequation(md,'SSA','all')
-md.cluster=generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 50000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
 
 x = md.mesh.x
 xmin = min(x)
 xmax = max(x)
-Lx = (xmax-xmin)
-alpha = 2./3.
-md.mask.ice_levelset = np.float_((x - alpha*Lx)>0) - np.float_((x - alpha*Lx)<0)
+Lx = (xmax - xmin)
+alpha = 2. / 3.
+md.mask.ice_levelset = np.float_((x - alpha * Lx) > 0) - np.float_((x - alpha * Lx) < 0)
 
-md.timestepping.time_step=10
-md.timestepping.final_time=30
+#Do not kill ice bergs as all is floating
+md.levelset.kill_icebergs = 0
+
+md.timestepping.time_step = 10
+md.timestepping.final_time = 30
 
 #Transient
-md.transient.isstressbalance=True
-md.transient.ismasstransport=True
-md.transient.issmb=True
-md.transient.isthermal=False
-md.transient.isgroundingline=False
-md.transient.isgia=False
-md.transient.ismovingfront=True
+md.transient.isstressbalance = True
+md.transient.ismasstransport = True
+md.transient.issmb = True
+md.transient.isthermal = False
+md.transient.isgroundingline = False
+md.transient.isgia = False
+md.transient.ismovingfront = True
 
-md.calving.calvingrate=np.zeros((md.mesh.numberofvertices))
-md.calving.meltingrate=10000*np.ones((md.mesh.numberofvertices))
-md.levelset.spclevelset=np.nan*np.ones((md.mesh.numberofvertices))
+md.calving.calvingrate = np.zeros((md.mesh.numberofvertices))
+md.frontalforcings.meltingrate = 10000 * np.ones((md.mesh.numberofvertices))
+md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices))
 
-md=solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names     =['Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1',
-									'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2',
-									'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3']
-field_tolerances=[1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,1e-11,
-									2e-11,2e-11,2e-11,1e-11,1e-11,1e-11,5e-11,
-									2e-11,2e-11,2e-11,1e-11,1e-11,1e-11,5e-11]
-field_values=[md.results.TransientSolution[0].Vx,
-							md.results.TransientSolution[0].Vy,
-							md.results.TransientSolution[0].Vel,
-							md.results.TransientSolution[0].Pressure,
-							md.results.TransientSolution[0].Thickness,
-							md.results.TransientSolution[0].Surface,
-							md.results.TransientSolution[0].MaskIceLevelset,
-							md.results.TransientSolution[1].Vx,
-							md.results.TransientSolution[1].Vy,
-							md.results.TransientSolution[1].Vel,
-							md.results.TransientSolution[1].Pressure,
-							md.results.TransientSolution[1].Thickness,
-							md.results.TransientSolution[1].Surface,
-							md.results.TransientSolution[1].MaskIceLevelset,
-							md.results.TransientSolution[2].Vx,
-							md.results.TransientSolution[2].Vy,
-							md.results.TransientSolution[2].Vel,
-							md.results.TransientSolution[2].Pressure,
-							md.results.TransientSolution[2].Thickness,
-							md.results.TransientSolution[2].Surface,
-							md.results.TransientSolution[2].MaskIceLevelset]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Thickness1', 'Surface1', 'MaskIceLevelset1',
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Thickness2', 'Surface2', 'MaskIceLevelset2',
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Thickness3', 'Surface3', 'MaskIceLevelset3']
+field_tolerances = [1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11, 1e-11,
+                    2e-11, 2e-11, 2e-11, 1e-11, 1e-11, 1e-11, 5e-11,
+                    2e-11, 2e-11, 2e-11, 1e-11, 1e-11, 1e-11, 5e-11]
+field_values = [md.results.TransientSolution[0].Vx,
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].MaskIceLevelset,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].MaskIceLevelset,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].MaskIceLevelset]
Index: /issm/trunk/test/NightlyRun/test808.m
===================================================================
--- /issm/trunk/test/NightlyRun/test808.m	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test808.m	(revision 24313)
@@ -12,4 +12,7 @@
 alpha = 2./3.;
 md.mask.ice_levelset = -1+2*(md.mesh.y>9e5);
+
+%Do not kill ice bergs as all is floating
+md.levelset.kill_icebergs=0;
 
 md.timestepping.time_step=1;
@@ -27,5 +30,5 @@
 md.calving=calvingminthickness();
 md.calving.min_thickness=400;
-md.calving.meltingrate=zeros(md.mesh.numberofvertices,1);
+md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
 md.levelset.spclevelset=NaN(md.mesh.numberofvertices,1);
 md.levelset.reinit_frequency=1;
Index: /issm/trunk/test/NightlyRun/test808.py
===================================================================
--- /issm/trunk/test/NightlyRun/test808.py	(revision 24312)
+++ /issm/trunk/test/NightlyRun/test808.py	(revision 24313)
@@ -10,9 +10,12 @@
 from calvingminthickness import *
 
-md = triangle(model(),'../Exp/Square.exp',30000.)
-md = setmask(md,'all','')
-md = parameterize(md,'../Par/SquareShelf.py')
-md = setflowequation(md,'SSA','all')
-md.cluster = generic('name',gethostname(),'np',3)
+md = triangle(model(), '../Exp/Square.exp', 30000.)
+md = setmask(md, 'all', '')
+md = parameterize(md, '../Par/SquareShelf.py')
+md = setflowequation(md, 'SSA', 'all')
+md.cluster = generic('name', gethostname(), 'np', 3)
+
+#Do not kill ice bergs as all is floating
+md.levelset.kill_icebergs = 0
 
 x = md.mesh.x
@@ -37,36 +40,36 @@
 md.calving = calvingminthickness()
 md.calving.min_thickness = 400
-md.calving.meltingrate = np.zeros((md.mesh.numberofvertices,))
-md.levelset.spclevelset = float('NaN')* np.ones((md.mesh.numberofvertices,))
+md.frontalforcings.meltingrate = np.zeros((md.mesh.numberofvertices, ))
+md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices, ))
 md.levelset.reinit_frequency = 1
 
-md = solve(md,'Transient')
+md = solve(md, 'Transient')
 
 #Fields and tolerances to track changes
-field_names = [	'Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1'
-								'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2'
-								'Vx3','Vy3','Vel3','Pressure3','Thickness3','Surface3','MaskIceLevelset3']
-field_tolerances = [1e-8,1e-8,1e-8,1e-9,1e-9,1e-9,3e-9,
-										1e-8,1e-8,1e-8,1e-9,1e-9,1e-9,3e-9,
-										1e-8,1e-8,1e-8,1e-9,1e-9,1e-9,3e-9]
+field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Thickness1', 'Surface1', 'MaskIceLevelset1'
+               'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Thickness2', 'Surface2', 'MaskIceLevelset2'
+               'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Thickness3', 'Surface3', 'MaskIceLevelset3']
+field_tolerances = [1e-8, 1e-8, 1e-8, 1e-9, 1e-9, 1e-9, 3e-9,
+                    1e-8, 1e-8, 1e-8, 1e-9, 1e-9, 1e-9, 3e-9,
+                    1e-8, 1e-8, 1e-8, 1e-9, 1e-9, 1e-9, 3e-9]
 field_values = [md.results.TransientSolution[0].Vx,
-								md.results.TransientSolution[0].Vy,
-								md.results.TransientSolution[0].Vel,
-								md.results.TransientSolution[0].Pressure,
-								md.results.TransientSolution[0].Thickness,
-								md.results.TransientSolution[0].Surface,
-								md.results.TransientSolution[0].MaskIceLevelset,
-								md.results.TransientSolution[1].Vx,
-								md.results.TransientSolution[1].Vy,
-								md.results.TransientSolution[1].Vel,
-								md.results.TransientSolution[1].Pressure,
-								md.results.TransientSolution[1].Thickness,
-								md.results.TransientSolution[1].Surface,
-								md.results.TransientSolution[1].MaskIceLevelset,
-								md.results.TransientSolution[2].Vx,
-								md.results.TransientSolution[2].Vy,
-								md.results.TransientSolution[2].Vel,
-								md.results.TransientSolution[2].Pressure,
-								md.results.TransientSolution[2].Thickness,
-								md.results.TransientSolution[2].Surface,
-								md.results.TransientSolution[2].MaskIceLevelset]
+                md.results.TransientSolution[0].Vy,
+                md.results.TransientSolution[0].Vel,
+                md.results.TransientSolution[0].Pressure,
+                md.results.TransientSolution[0].Thickness,
+                md.results.TransientSolution[0].Surface,
+                md.results.TransientSolution[0].MaskIceLevelset,
+                md.results.TransientSolution[1].Vx,
+                md.results.TransientSolution[1].Vy,
+                md.results.TransientSolution[1].Vel,
+                md.results.TransientSolution[1].Pressure,
+                md.results.TransientSolution[1].Thickness,
+                md.results.TransientSolution[1].Surface,
+                md.results.TransientSolution[1].MaskIceLevelset,
+                md.results.TransientSolution[2].Vx,
+                md.results.TransientSolution[2].Vy,
+                md.results.TransientSolution[2].Vel,
+                md.results.TransientSolution[2].Pressure,
+                md.results.TransientSolution[2].Thickness,
+                md.results.TransientSolution[2].Surface,
+                md.results.TransientSolution[2].MaskIceLevelset]
Index: /issm/trunk/test/NightlyRun/test809.m
===================================================================
--- /issm/trunk/test/NightlyRun/test809.m	(revision 24313)
+++ /issm/trunk/test/NightlyRun/test809.m	(revision 24313)
@@ -0,0 +1,59 @@
+%Test Name: ValleyGlacierLevelsetCalvingSSA2dCrevassedepth
+md=triangle(model(),'../Exp/Square.exp',50000);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/ValleyGlacierShelf.par');
+md=setflowequation(md,'SSA','all');
+md.timestepping.time_step=2;
+md.timestepping.final_time=50;
+md.cluster=generic('name',oshostname(),'np',3);
+
+%Transient;
+md.transient.isstressbalance=1;
+md.transient.ismovingfront=1;
+md.transient.ismasstransport=1;
+md.transient.issmb=1;
+md.transient.isthermal=0;
+md.transient.isgroundingline=1;
+md.transient.isgia=0;
+
+md.calving=calvingcrevassedepth();
+md.calving.crevasse_opening_stress=1;
+md.calving.water_height=50*ones(md.mesh.numberofvertices,1);
+md.frontalforcings.meltingrate=zeros(md.mesh.numberofvertices,1);
+md.levelset.spclevelset=NaN(md.mesh.numberofvertices,1);
+md.levelset.reinit_frequency=1;
+
+md=solve(md,'Transient');
+
+%Fields and tolerances to track changes
+field_names ={...
+	'Vx1','Vy1','Vel1','Pressure1','Thickness1','Surface1','MaskIceLevelset1'...
+	'Vx2','Vy2','Vel2','Pressure2','Thickness2','Surface2','MaskIceLevelset2'...
+	'Vx10','Vy10','Vel10','Pressure10','Thickness10','Surface10','MaskIceLevelset10'};
+field_tolerances={...
+	1e-8,1e-8,1e-8,1e-9,1e-9,1e-9,3e-9,...
+	1e-8,1e-8,1e-8,1e-9,1e-9,1e-9,3e-9,...
+	1e-8,1e-8,1e-8,1e-9,1e-9,1e-9,3e-9};
+field_values={...
+	md.results.TransientSolution(1).Vx,...
+	md.results.TransientSolution(1).Vy,...
+	md.results.TransientSolution(1).Vel,...
+	md.results.TransientSolution(1).Pressure,...
+	md.results.TransientSolution(1).Thickness,...
+	md.results.TransientSolution(1).Surface,...
+	md.results.TransientSolution(1).MaskIceLevelset,...
+	md.results.TransientSolution(2).Vx,...
+	md.results.TransientSolution(2).Vy,...
+	md.results.TransientSolution(2).Vel,...
+	md.results.TransientSolution(2).Pressure,...
+	md.results.TransientSolution(2).Thickness,...
+	md.results.TransientSolution(2).Surface,...
+	md.results.TransientSolution(2).MaskIceLevelset,...
+	md.results.TransientSolution(10).Vx,...
+	md.results.TransientSolution(10).Vy,...
+	md.results.TransientSolution(10).Vel,...
+	md.results.TransientSolution(10).Pressure,...
+	md.results.TransientSolution(10).Thickness,...
+	md.results.TransientSolution(10).Surface,...
+	md.results.TransientSolution(10).MaskIceLevelset,...
+	};
Index: /issm/trunk/test/Par/79North.py
===================================================================
--- /issm/trunk/test/Par/79North.py	(revision 24312)
+++ /issm/trunk/test/Par/79North.py	(revision 24313)
@@ -11,56 +11,56 @@
 
 #Geometry and observation
-x         = numpy.array(archread('../Data/79North.arch','x'))
-y         = numpy.array(archread('../Data/79North.arch','y'))
-vx        = numpy.array(archread('../Data/79North.arch','vx'));
-vy        = numpy.array(archread('../Data/79North.arch','vy'));
-index     = numpy.array(archread('../Data/79North.arch','index')).astype(int);
-surface   = numpy.array(archread('../Data/79North.arch','surface'));
-thickness = numpy.array(archread('../Data/79North.arch','thickness'));
+x = numpy.array(archread('../Data/79North.arch', 'x'))
+y = numpy.array(archread('../Data/79North.arch', 'y'))
+vx = numpy.array(archread('../Data/79North.arch', 'vx'))
+vy = numpy.array(archread('../Data/79North.arch', 'vy'))
+index = numpy.array(archread('../Data/79North.arch', 'index')).astype(int)
+surface = numpy.array(archread('../Data/79North.arch', 'surface'))
+thickness = numpy.array(archread('../Data/79North.arch', 'thickness'))
 
-md.initialization.vx  = InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)[0][:,0]
-md.initialization.vy  = InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)[0][:,0]
-md.geometry.surface   = InterpFromMeshToMesh2d(index,x,y,surface,md.mesh.x,md.mesh.y)[0][:,0]
-md.geometry.thickness = InterpFromMeshToMesh2d(index,x,y,thickness,md.mesh.x,md.mesh.y)[0][:,0]
-md.geometry.base      = md.geometry.surface-md.geometry.thickness
+md.initialization.vx = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)[0][:, 0]
+md.initialization.vy = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)[0][:, 0]
+md.geometry.surface = InterpFromMeshToMesh2d(index, x, y, surface, md.mesh.x, md.mesh.y)[0][:, 0]
+md.geometry.thickness = InterpFromMeshToMesh2d(index, x, y, thickness, md.mesh.x, md.mesh.y)[0][:, 0]
+md.geometry.base = md.geometry.surface - md.geometry.thickness
 
 #Materials
-md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
-md.materials.rheology_B=paterson(md.initialization.temperature)
-md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
-md.initialization.temperature=md.initialization.temperature
+md.initialization.temperature = (273. - 20.) * numpy.ones((md.mesh.numberofvertices))
+md.materials.rheology_B = paterson(md.initialization.temperature)
+md.materials.rheology_n = 3. * numpy.ones((md.mesh.numberofelements))
+md.initialization.temperature = md.initialization.temperature
 
 #Friction
-md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices))
-md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
-md.friction.p=numpy.ones((md.mesh.numberofelements))
-md.friction.q=numpy.ones((md.mesh.numberofelements))
+md.friction.coefficient = 50. * numpy.ones((md.mesh.numberofvertices))
+md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
+md.friction.p = numpy.ones((md.mesh.numberofelements))
+md.friction.q = numpy.ones((md.mesh.numberofelements))
 
 #Ice shelf melting and surface mass balance
-md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
-md.basalforcings.floatingice_melting_rate[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
-md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
-md.smb.mass_balance=15*numpy.ones((md.mesh.numberofvertices))
+md.basalforcings.floatingice_melting_rate = numpy.zeros((md.mesh.numberofvertices))
+md.basalforcings.floatingice_melting_rate[numpy.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
+md.basalforcings.groundedice_melting_rate = numpy.zeros((md.mesh.numberofvertices))
+md.smb.mass_balance = 15 * numpy.ones((md.mesh.numberofvertices))
 
 #Numerical parameters
-md.masstransport.stabilization=1
-md.thermal.stabilization=1
-md.verbose=verbose(0)
-md.settings.waitonlock=30
-md.timestepping.time_step=1.
-md.timestepping.final_time=3.
-md.stressbalance.restol=0.05
-md.stressbalance.reltol=0.005
-md.steadystate.reltol=0.005
-md.stressbalance.abstol=float('NaN')
-md.groundingline.migration='None'
+md.masstransport.stabilization = 1
+md.thermal.stabilization = 1
+md.verbose = verbose(0)
+md.settings.waitonlock = 30
+md.timestepping.time_step = 1.
+md.timestepping.final_time = 3.
+md.stressbalance.restol = 0.05
+md.stressbalance.reltol = 0.005
+md.steadystate.reltol = 0.005
+md.stressbalance.abstol = float('NaN')
+md.groundingline.migration = 'None'
 
 #Boundary conditions:
-md=SetMarineIceSheetBC(md)
-pos=numpy.nonzero(md.mesh.vertexonboundary)
-md.balancethickness.spcthickness[pos]=md.geometry.thickness[pos]
-md.masstransport.spcthickness[pos]=md.geometry.thickness[pos]
+md = SetMarineIceSheetBC(md)
+pos = numpy.nonzero(md.mesh.vertexonboundary)
+md.balancethickness.spcthickness[pos] = md.geometry.thickness[pos]
+md.masstransport.spcthickness[pos] = md.geometry.thickness[pos]
 
 #Change name so that no test have the same name
 if len(inspect.stack()) > 2:
-	md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
+    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
Index: /issm/trunk/test/Par/GiaIvinsBenchmarksAB.py
===================================================================
--- /issm/trunk/test/Par/GiaIvinsBenchmarksAB.py	(revision 24312)
+++ /issm/trunk/test/Par/GiaIvinsBenchmarksAB.py	(revision 24313)
@@ -13,57 +13,57 @@
 nv = md.mesh.numberofvertices
 if (np.isnan(md.geometry.thickness)):
-	md.geometry.thickness = np.zeros((md.mesh.numberofvertices,))
+    md.geometry.thickness = np.zeros((md.mesh.numberofvertices, ))
 for i in range(nv):
-	dist = np.sqrt(md.mesh.x[i]**2 + md.mesh.y[i]**2)
-	if (dist <= rad):
-		md.geometry.thickness[i] = 2000.0
-	else:
-		md.geometry.thickness[i] = 1.0 # non-zero thickness
+    dist = np.sqrt(md.mesh.x[i]**2 + md.mesh.y[i]**2)
+    if (dist <= rad):
+        md.geometry.thickness[i] = 2000.0
+    else:
+        md.geometry.thickness[i] = 1.0  # non - zero thickness
 
-md.geometry.thickness = md.geometry.thickness.reshape(-1,1)
-md.geometry.base = np.zeros((md.mesh.numberofvertices,))
-md.geometry.surface = md.geometry.thickness + md.geometry.base.reshape(-1,1) #would otherwise create a 91x91 matrix
+md.geometry.thickness = md.geometry.thickness.reshape(-1, 1)
+md.geometry.base = np.zeros((md.mesh.numberofvertices, ))
+md.geometry.surface = md.geometry.thickness + md.geometry.base.reshape(-1, 1)  #would otherwise create a 91x91 matrix
 
-#Ice density used for benchmarking, not 917 kg/m^3
-md.materials.rho_ice = 1000 #kg m^3
+#Ice density used for benchmarking, not 917 kg / m^3
+md.materials.rho_ice = 1000  #kg m^3
 
 #GIA parameters specific to Experiments A  and B
-md.gia.mantle_viscosity = 1e21 * np.ones((md.mesh.numberofvertices,))		#in Pa.s
-md.gia.lithosphere_thickness = 100 * np.ones((md.mesh.numberofvertices,))	#in km
-md.materials.lithosphere_shear_modulus = 6.7*1e10				#in Pa
-md.materials.lithosphere_density = 3.36						#in g/cm^3
-md.materials.mantle_shear_modulus = 1.45*1e11					#in Pa
-md.materials.mantle_density = 3.38						#in g/cm^3
+md.gia.mantle_viscosity = 1e21 * np.ones((md.mesh.numberofvertices, ))  #in Pa.s
+md.gia.lithosphere_thickness = 100 * np.ones((md.mesh.numberofvertices, ))  #in km
+md.materials.lithosphere_shear_modulus = 6.7 * 1e10  #in Pa
+md.materials.lithosphere_density = 3.36  #in g / cm^3
+md.materials.mantle_shear_modulus = 1.45 * 1e11  #in Pa
+md.materials.mantle_density = 3.38  #in g / cm^3
 
-#Initial velocity 
-x     = archread('../Data/SquareSheetConstrained.arch','x')
-y     = archread('../Data/SquareSheetConstrained.arch','y')
-vx    = archread('../Data/SquareSheetConstrained.arch','vx')
-vy    = archread('../Data/SquareSheetConstrained.arch','vy')
-index = archread('../Data/SquareSheetConstrained.arch','index').astype(int)
+#Initial velocity
+x = archread('../Data/SquareSheetConstrained.arch', 'x')
+y = archread('../Data/SquareSheetConstrained.arch', 'y')
+vx = archread('../Data/SquareSheetConstrained.arch', 'vx')
+vy = archread('../Data/SquareSheetConstrained.arch', 'vy')
+index = archread('../Data/SquareSheetConstrained.arch', 'index').astype(int)
 
-md.initialization.vx = np.array(InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)).reshape(-1,1)
-md.initialization.vy = np.array(InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)).reshape(-1,1)
-vx    = None
-vy    = None
-x     = None
-y     = None
+md.initialization.vx = np.array(InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)).reshape(-1, 1)
+md.initialization.vy = np.array(InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)).reshape(-1, 1)
+vx = None
+vy = None
+x = None
+y = None
 index = None
-md.initialization.vz = np.zeros((md.mesh.numberofvertices,))
-md.initialization.pressure = np.zeros((md.mesh.numberofvertices,))
+md.initialization.vz = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices, ))
 
 #Materials
-md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices,))
+md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, ))
 md.materials.rheology_B = paterson(md.initialization.temperature)
-md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements,))
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements, ))
 
 #Friction
-md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices,))
+md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices, ))
 md.friction.coefficient[np.where(md.mask.groundedice_levelset < 0.)] = 0.
-md.friction.p = np.ones((md.mesh.numberofelements,))
-md.friction.q = np.ones((md.mesh.numberofelements,))
+md.friction.p = np.ones((md.mesh.numberofelements, ))
+md.friction.q = np.ones((md.mesh.numberofelements, ))
 
 #Numerical parameters
-md.groundingline.migration='None'
+md.groundingline.migration = 'None'
 md.masstransport.stabilization = 1
 md.thermal.stabilization = 1.
@@ -82,3 +82,3 @@
 #Change name so that no test have the same name
 if len(inspect.stack()) > 2:
-	md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
+    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
Index: /issm/trunk/test/Par/GiaIvinsBenchmarksCD.py
===================================================================
--- /issm/trunk/test/Par/GiaIvinsBenchmarksCD.py	(revision 24312)
+++ /issm/trunk/test/Par/GiaIvinsBenchmarksCD.py	(revision 24313)
@@ -13,57 +13,57 @@
 nv = md.mesh.numberofvertices
 if (np.isnan(md.geometry.thickness)):
-	md.geometry.thickness = np.zeros((md.mesh.numberofvertices,))
+    md.geometry.thickness = np.zeros((md.mesh.numberofvertices, ))
 for i in range(nv):
-	dist = np.sqrt(md.mesh.x[i]**2 + md.mesh.y[i]**2)
-	if (dist <= rad):
-		md.geometry.thickness[i] = 3000.0
-	else:
-		md.geometry.thickness[i] = 1.0 # non-zero thickness
+    dist = np.sqrt(md.mesh.x[i]**2 + md.mesh.y[i]**2)
+    if (dist <= rad):
+        md.geometry.thickness[i] = 3000.0
+    else:
+        md.geometry.thickness[i] = 1.0  # non - zero thickness
 
-md.geometry.thickness = md.geometry.thickness.reshape(-1,1)
-md.geometry.base = np.zeros((md.mesh.numberofvertices,))
-md.geometry.surface = md.geometry.thickness + md.geometry.base.reshape(-1,1) #would otherwise create a 91x91 matrix
+md.geometry.thickness = md.geometry.thickness.reshape(-1, 1)
+md.geometry.base = np.zeros((md.mesh.numberofvertices, ))
+md.geometry.surface = md.geometry.thickness + md.geometry.base.reshape(-1, 1)  #would otherwise create a 91x91 matrix
 
-#Ice density used for benchmarking, not 917 kg/m^3
-md.materials.rho_ice = 1000 #kg m^3
+#Ice density used for benchmarking, not 917 kg / m^3
+md.materials.rho_ice = 1000  #kg m^3
 
 #GIA parameters specific to Experiments A  and B
-md.gia.mantle_viscosity = 1e21 * np.ones((md.mesh.numberofvertices,))		#in Pa.s
-md.gia.lithosphere_thickness = 100 * np.ones((md.mesh.numberofvertices,))	#in km
-md.materials.lithosphere_shear_modulus = 6.7*1e10				#in Pa
-md.materials.lithosphere_density = 3.32						#in g/cm^3
-md.materials.mantle_shear_modulus = 1.45*1e11					#in Pa
-md.materials.mantle_density = 3.34						#in g/cm^3
+md.gia.mantle_viscosity = 1e21 * np.ones((md.mesh.numberofvertices, ))  #in Pa.s
+md.gia.lithosphere_thickness = 100 * np.ones((md.mesh.numberofvertices, ))  #in km
+md.materials.lithosphere_shear_modulus = 6.7 * 1e10  #in Pa
+md.materials.lithosphere_density = 3.32  #in g / cm^3
+md.materials.mantle_shear_modulus = 1.45 * 1e11  #in Pa
+md.materials.mantle_density = 3.34  #in g / cm^3
 
-#Initial velocity 
-x     = archread('../Data/SquareSheetConstrained.arch','x')
-y     = archread('../Data/SquareSheetConstrained.arch','y')
-vx    = archread('../Data/SquareSheetConstrained.arch','vx')
-vy    = archread('../Data/SquareSheetConstrained.arch','vy')
-index = archread('../Data/SquareSheetConstrained.arch','index').astype(int)
+#Initial velocity
+x = archread('../Data/SquareSheetConstrained.arch', 'x')
+y = archread('../Data/SquareSheetConstrained.arch', 'y')
+vx = archread('../Data/SquareSheetConstrained.arch', 'vx')
+vy = archread('../Data/SquareSheetConstrained.arch', 'vy')
+index = archread('../Data/SquareSheetConstrained.arch', 'index').astype(int)
 
-md.initialization.vx = np.array(InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)).reshape(-1,1)
-md.initialization.vy = np.array(InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)).reshape(-1,1)
-vx    = None
-vy    = None
-x     = None
-y     = None
+md.initialization.vx = np.array(InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)).reshape(-1, 1)
+md.initialization.vy = np.array(InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)).reshape(-1, 1)
+vx = None
+vy = None
+x = None
+y = None
 index = None
-md.initialization.vz = np.zeros((md.mesh.numberofvertices,))
-md.initialization.pressure = np.zeros((md.mesh.numberofvertices,))
+md.initialization.vz = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices, ))
 
 #Materials
-md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices,))
+md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices, ))
 md.materials.rheology_B = paterson(md.initialization.temperature)
-md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements,))
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements, ))
 
 #Friction
-md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices,))
+md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices, ))
 md.friction.coefficient[np.where(md.mask.groundedice_levelset < 0.)] = 0.
-md.friction.p = np.ones((md.mesh.numberofelements,))
-md.friction.q = np.ones((md.mesh.numberofelements,))
+md.friction.p = np.ones((md.mesh.numberofelements, ))
+md.friction.q = np.ones((md.mesh.numberofelements, ))
 
 #Numerical parameters
-md.groundingline.migration='None'
+md.groundingline.migration = 'None'
 md.masstransport.stabilization = 1.
 md.thermal.stabilization = 1.
@@ -82,3 +82,3 @@
 #Change name so that no test have the same name
 if len(inspect.stack()) > 2:
-	md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
+    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
Index: /issm/trunk/test/Par/ISMIPA.py
===================================================================
--- /issm/trunk/test/Par/ISMIPA.py	(revision 24312)
+++ /issm/trunk/test/Par/ISMIPA.py	(revision 24313)
@@ -1,23 +1,23 @@
-import numpy
+import numpy as np
 from SetIceSheetBC import SetIceSheetBC
 
 #Ok, start defining model parameters here
 
-print "      creating thickness"
-md.geometry.surface=-md.mesh.x*numpy.tan(0.5*numpy.pi/180.)
-md.geometry.base=md.geometry.surface-1000.+500.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x))*numpy.sin(md.mesh.y*2.*numpy.pi/numpy.max(md.mesh.x))
-md.geometry.thickness=md.geometry.surface-md.geometry.base
+print("      creating thickness")
+md.geometry.surface = -md.mesh.x * np.tan(0.5 * np.pi / 180.)
+md.geometry.base = md.geometry.surface - 1000. + 500. * np.sin(md.mesh.x * 2. * np.pi / np.max(md.mesh.x)) * np.sin(md.mesh.y * 2. * np.pi / np.max(md.mesh.x))
+md.geometry.thickness = md.geometry.surface - md.geometry.base
 
-print "      creating drag"
-md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices))
-md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
-md.friction.p=numpy.ones((md.mesh.numberofelements))
-md.friction.q=numpy.ones((md.mesh.numberofelements))
+print("      creating drag")
+md.friction.coefficient = 200. * np.ones((md.mesh.numberofvertices))
+md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
+md.friction.p = np.ones((md.mesh.numberofelements))
+md.friction.q = np.ones((md.mesh.numberofelements))
 
-print "      creating flow law parameter"
-md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices))
-md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
+print("      creating flow law parameter")
+md.materials.rheology_B = 6.8067 * 10**7 * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
 
-print "      boundary conditions for stressbalance model"
+print("      boundary conditions for stressbalance model")
 #Create node on boundary first (because we cannot use mesh)
-md=SetIceSheetBC(md)
+md = SetIceSheetBC(md)
Index: /issm/trunk/test/Par/ISMIPB.py
===================================================================
--- /issm/trunk/test/Par/ISMIPB.py	(revision 24312)
+++ /issm/trunk/test/Par/ISMIPB.py	(revision 24313)
@@ -1,23 +1,23 @@
-import numpy
+import numpy as np
 from SetIceSheetBC import SetIceSheetBC
 
 #Ok, start defining model parameters here
 
-print "      creating thickness"
-md.geometry.surface=-md.mesh.x*numpy.tan(0.5*numpy.pi/180.)
-md.geometry.base=md.geometry.surface-1000.+500.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x))
-md.geometry.thickness=md.geometry.surface-md.geometry.base
+print("      creating thickness")
+md.geometry.surface = -md.mesh.x * np.tan(0.5 * np.pi / 180.)
+md.geometry.base = md.geometry.surface - 1000. + 500. * np.sin(md.mesh.x * 2. * np.pi / np.max(md.mesh.x))
+md.geometry.thickness = md.geometry.surface - md.geometry.base
 
-print "      creating drag"
-md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices))
-md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
-md.friction.p=numpy.ones((md.mesh.numberofelements))
-md.friction.q=numpy.ones((md.mesh.numberofelements))
+print("      creating drag")
+md.friction.coefficient = 200. * np.ones((md.mesh.numberofvertices))
+md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
+md.friction.p = np.ones((md.mesh.numberofelements))
+md.friction.q = np.ones((md.mesh.numberofelements))
 
-print "      creating flow law parameter"
-md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices))
-md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
+print("      creating flow law parameter")
+md.materials.rheology_B = 6.8067 * 10**7 * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
 
-print "      boundary conditions for stressbalance model"
+print("      boundary conditions for stressbalance model")
 #Create node on boundary first (because we cannot use mesh)
-md=SetIceSheetBC(md)
+md = SetIceSheetBC(md)
Index: /issm/trunk/test/Par/ISMIPC.py
===================================================================
--- /issm/trunk/test/Par/ISMIPC.py	(revision 24312)
+++ /issm/trunk/test/Par/ISMIPC.py	(revision 24313)
@@ -1,24 +1,24 @@
-import numpy
+import numpy as np
 from SetIceSheetBC import SetIceSheetBC
 
 #Ok, start defining model parameters here
 
-print "      creating thickness"
-md.geometry.surface=2000.-md.mesh.x*numpy.tan(0.1*numpy.pi/180.)    #to have z>0
-md.geometry.base=md.geometry.surface-1000.
-md.geometry.thickness=md.geometry.surface-md.geometry.base
+print("      creating thickness")
+md.geometry.surface = 2000. - md.mesh.x * np.tan(0.1 * np.pi / 180.)  #to have z > 0
+md.geometry.base = md.geometry.surface - 1000.
+md.geometry.thickness = md.geometry.surface - md.geometry.base
 
-print "      creating drag"
-#md.friction.coefficient=sqrt(md.constants.yts.*(1000.+1000.*sin(md.mesh.x*2.*pi/max(md.mesh.x/2.)).*sin(md.mesh.y*2.*pi/max(md.mesh.x/2.)))./(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.base)));
-md.friction.coefficient=numpy.sqrt(md.constants.yts*(1000.+1000.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x))*numpy.sin(md.mesh.y*2.*numpy.pi/numpy.max(md.mesh.x))))
-md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
-md.friction.p=numpy.ones((md.mesh.numberofelements))
-md.friction.q=numpy.zeros((md.mesh.numberofelements))
+print("      creating drag")
+#md.friction.coefficient = sqrt(md.constants.yts. * (1000. + 1000. * sin(md.mesh.x * 2. * pi / max(md.mesh.x / 2.)). * sin(md.mesh.y * 2. * pi / max(md.mesh.x / 2.))). / (md.constants.g * (md.materials.rho_ice * md.geometry.thickness + md.materials.rho_water * md.geometry.base)))
+md.friction.coefficient = np.sqrt(md.constants.yts * (1000. + 1000. * np.sin(md.mesh.x * 2. * np.pi / np.max(md.mesh.x)) * np.sin(md.mesh.y * 2. * np.pi / np.max(md.mesh.x))))
+md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
+md.friction.p = np.ones((md.mesh.numberofelements))
+md.friction.q = np.zeros((md.mesh.numberofelements))
 
-print "      creating flow law parameter"
-md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices))
-md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
+print("      creating flow law parameter")
+md.materials.rheology_B = 6.8067 * 10**7 * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
 
-print "      boundary conditions for stressbalance model:"
+print("      boundary conditions for stressbalance model:")
 #Create node on boundary first (because we can not use mesh)
-md=SetIceSheetBC(md)
+md = SetIceSheetBC(md)
Index: /issm/trunk/test/Par/ISMIPD.py
===================================================================
--- /issm/trunk/test/Par/ISMIPD.py	(revision 24312)
+++ /issm/trunk/test/Par/ISMIPD.py	(revision 24313)
@@ -1,23 +1,23 @@
-import numpy
+import numpy as np
 from SetIceSheetBC import SetIceSheetBC
 
 #Ok, start defining model parameters here
 
-print "      creating thickness"
-md.geometry.surface=2000.-md.mesh.x*numpy.tan(0.1*numpy.pi/180.)    #to have z>0
-md.geometry.base=md.geometry.surface-1000.
-md.geometry.thickness=md.geometry.surface-md.geometry.base
+print("      creating thickness")
+md.geometry.surface = 2000. - md.mesh.x * np.tan(0.1 * np.pi / 180.)  #to have z > 0
+md.geometry.base = md.geometry.surface - 1000.
+md.geometry.thickness = md.geometry.surface - md.geometry.base
 
-print "      creating drag"
-md.friction.coefficient=numpy.sqrt(md.constants.yts*(1000.+1000.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x))))
-md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
-md.friction.p=numpy.ones((md.mesh.numberofelements))
-md.friction.q=numpy.zeros((md.mesh.numberofelements))
+print("      creating drag")
+md.friction.coefficient = np.sqrt(md.constants.yts * (1000. + 1000. * np.sin(md.mesh.x * 2. * np.pi / np.max(md.mesh.x))))
+md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
+md.friction.p = np.ones((md.mesh.numberofelements))
+md.friction.q = np.zeros((md.mesh.numberofelements))
 
-print "      creating flow law parameter"
-md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices))
-md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
+print("      creating flow law parameter")
+md.materials.rheology_B = 6.8067 * 10**7 * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
 
-print "      boundary conditions for stressbalance model:"
+print("      boundary conditions for stressbalance model:")
 #Create node on boundary first (because we can not use mesh)
-md=SetIceSheetBC(md)
+md = SetIceSheetBC(md)
Index: /issm/trunk/test/Par/ISMIPE.py
===================================================================
--- /issm/trunk/test/Par/ISMIPE.py	(revision 24312)
+++ /issm/trunk/test/Par/ISMIPE.py	(revision 24313)
@@ -1,3 +1,3 @@
-import numpy
+import numpy as np
 from arch import *
 from SetIceSheetBC import SetIceSheetBC
@@ -5,30 +5,30 @@
 #Ok, start defining model parameters here
 
-print "      creating thickness"
-data = numpy.array(archread('../Data/ISMIPE.arch','data'));
-md.geometry.surface=numpy.zeros((md.mesh.numberofvertices))
-md.geometry.base=numpy.zeros((md.mesh.numberofvertices))
-for i in xrange(0,md.mesh.numberofvertices):
-	y=md.mesh.y[i]
-	point1=numpy.floor(y/100.)
-	point2=numpy.minimum(point1+1,50)
-	coeff=(y-(point1)*100.)/100.
-	md.geometry.base[i]=(1.-coeff)*data[point1,1]+coeff*data[point2,1]
-	md.geometry.surface[i]=(1.-coeff)*data[point1,2]+coeff*data[point2,2]
+print("      creating thickness")
+data = np.array(archread('../Data/ISMIPE.arch', 'data'))
+md.geometry.surface = np.zeros((md.mesh.numberofvertices))
+md.geometry.base = np.zeros((md.mesh.numberofvertices))
+for i in range(0, md.mesh.numberofvertices):
+    y = md.mesh.y[i]
+    point1 = int(np.floor(y / 100.))
+    point2 = int(np.minimum(point1 + 1, 50))
+    coeff = int((y - (point1) * 100.) / 100.)
+    md.geometry.base[i] = (1. - coeff) * data[point1, 1] + coeff * data[point2, 1]
+    md.geometry.surface[i] = (1. - coeff) * data[point1, 2] + coeff * data[point2, 2]
 
-md.geometry.thickness=md.geometry.surface-md.geometry.base
-md.geometry.thickness[numpy.nonzero(numpy.logical_not(md.geometry.thickness))]=0.01
-md.geometry.base=md.geometry.surface-md.geometry.thickness
+md.geometry.thickness = md.geometry.surface - md.geometry.base
+md.geometry.thickness[np.nonzero(np.logical_not(md.geometry.thickness))] = 0.01
+md.geometry.base = md.geometry.surface - md.geometry.thickness
 
-print "      creating drag"
-md.friction.coefficient=numpy.zeros((md.mesh.numberofvertices))
-md.friction.p=numpy.ones((md.mesh.numberofelements))
-md.friction.q=numpy.ones((md.mesh.numberofelements))
+print("      creating drag")
+md.friction.coefficient = np.zeros((md.mesh.numberofvertices))
+md.friction.p = np.ones((md.mesh.numberofelements))
+md.friction.q = np.ones((md.mesh.numberofelements))
 
-print "      creating flow law parameter"
-md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices))
-md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
+print("      creating flow law parameter")
+md.materials.rheology_B = 6.8067 * 10**7 * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
 
-print "      boundary conditions for stressbalance model:"
+print("      boundary conditions for stressbalance model:")
 #Create node on boundary first (because we can not use mesh)
-md=SetIceSheetBC(md)
+md = SetIceSheetBC(md)
Index: /issm/trunk/test/Par/ISMIPF.py
===================================================================
--- /issm/trunk/test/Par/ISMIPF.py	(revision 24312)
+++ /issm/trunk/test/Par/ISMIPF.py	(revision 24313)
@@ -1,50 +1,50 @@
-import numpy
+import numpy as np
 from SetIceSheetBC import SetIceSheetBC
 
 #Ok, start defining model parameters here
-md.verbose=2
+md.verbose = 2
 
-print "      creating thickness"
-md.geometry.surface=-md.mesh.x*numpy.tan(3.*numpy.pi/180.)
-#md.geometry.base=md.geometry.surface-1000.
-md.geometry.base=md.geometry.surface-1000.+100.*numpy.exp(-((md.mesh.x-numpy.max(md.mesh.x)/2.)**2+(md.mesh.y-numpy.max(md.mesh.y)/2.)**2)/(10000.**2))
-md.geometry.thickness=md.geometry.surface-md.geometry.base
+print("      creating thickness")
+md.geometry.surface = -md.mesh.x * np.tan(3. * np.pi / 180.)
+#md.geometry.base = md.geometry.surface-1000.
+md.geometry.base = md.geometry.surface - 1000. + 100. * np.exp(-((md.mesh.x - np.max(md.mesh.x) / 2.)**2 + (md.mesh.y - np.max(md.mesh.y) / 2.)**2) / (10000.**2))
+md.geometry.thickness = md.geometry.surface - md.geometry.base
 
-print "      creating drag"
-md.friction.coefficient=numpy.sqrt(md.constants.yts/(2.140373*10**-7*1000.))*numpy.ones((md.mesh.numberofvertices))
-md.friction.p=numpy.ones((md.mesh.numberofelements))
-md.friction.q=numpy.zeros((md.mesh.numberofelements))
+print("      creating drag")
+md.friction.coefficient = np.sqrt(md.constants.yts / (2.140373 * 10**-7 * 1000.)) * np.ones((md.mesh.numberofvertices))
+md.friction.p = np.ones((md.mesh.numberofelements))
+md.friction.q = np.zeros((md.mesh.numberofelements))
 
-print "      creating flow law parameter"
-md.materials.rheology_B=1.4734*10**14*numpy.ones((md.mesh.numberofvertices))
-md.materials.rheology_n=1.*numpy.ones((md.mesh.numberofelements))
-md.materials.rheology_law='None'
+print("      creating flow law parameter")
+md.materials.rheology_B = 1.4734 * 10**14 * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_n = 1. * np.ones((md.mesh.numberofelements))
+md.materials.rheology_law = 'None'
 
-print "      boundary conditions for stressbalance model"
+print("      boundary conditions for stressbalance model")
 #Create node on boundary first (because we cannot use mesh)
-md=SetIceSheetBC(md)
-md.stressbalance.spcvx=100.*numpy.ones((md.mesh.numberofvertices))
-md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.vel=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.temperature=255.*numpy.ones((md.mesh.numberofvertices))
-pos=numpy.nonzero(numpy.logical_or(numpy.logical_or(md.mesh.x==numpy.min(md.mesh.x),md.mesh.x==numpy.max(md.mesh.x)),numpy.logical_or(md.mesh.y==numpy.min(md.mesh.y),md.mesh.y==numpy.max(md.mesh.y))))
-md.balancethickness.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices))
-md.balancethickness.spcthickness[pos]=md.geometry.thickness[pos]
-md.masstransport.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices))
-md.masstransport.spcthickness[pos]=md.geometry.thickness[pos]
-md.thermal.spctemperature=255.*numpy.ones((md.mesh.numberofvertices))
-md.basalforcings.geothermalflux=0.4*numpy.ones((md.mesh.numberofvertices))
+md = SetIceSheetBC(md)
+md.stressbalance.spcvx = 100. * np.ones((md.mesh.numberofvertices))
+md.initialization.vx = np.zeros((md.mesh.numberofvertices))
+md.initialization.vy = np.zeros((md.mesh.numberofvertices))
+md.initialization.vz = np.zeros((md.mesh.numberofvertices))
+md.initialization.vel = np.zeros((md.mesh.numberofvertices))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
+md.initialization.temperature = 255. * np.ones((md.mesh.numberofvertices))
+pos = np.nonzero(np.logical_or(np.logical_or(md.mesh.x == np.min(md.mesh.x), md.mesh.x == np.max(md.mesh.x)), np.logical_or(md.mesh.y == np.min(md.mesh.y), md.mesh.y == np.max(md.mesh.y))))
+md.balancethickness.spcthickness = float('NaN') * np.ones((md.mesh.numberofvertices))
+md.balancethickness.spcthickness[pos] = md.geometry.thickness[pos]
+md.masstransport.spcthickness = float('NaN') * np.ones((md.mesh.numberofvertices))
+md.masstransport.spcthickness[pos] = md.geometry.thickness[pos]
+md.thermal.spctemperature = 255. * np.ones((md.mesh.numberofvertices))
+md.basalforcings.geothermalflux = 0.4 * np.ones((md.mesh.numberofvertices))
 
 #Parallel options
-md.mesh.average_vertex_connectivity=200
+md.mesh.average_vertex_connectivity = 200
 
 #Transient options
-md.timestepping.time_step=1.
-md.timestepping.final_time=10.
-md.masstransport.stabilization=1
-md.thermal.stabilization=1
-md.thermal.penalty_threshold=10**5
-md.transient.isthermal=0
+md.timestepping.time_step = 1.
+md.timestepping.final_time = 10.
+md.masstransport.stabilization = 1
+md.thermal.stabilization = 1
+md.thermal.penalty_threshold = 10**5
+md.transient.isthermal = 0
Index: /issm/trunk/test/Par/IceCube.py
===================================================================
--- /issm/trunk/test/Par/IceCube.py	(revision 24312)
+++ /issm/trunk/test/Par/IceCube.py	(revision 24313)
@@ -3,5 +3,4 @@
 import inspect
 from verbose import verbose
-from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
 from paterson import paterson
 from SetIceSheetBC import SetIceSheetBC
@@ -11,45 +10,45 @@
 
 #Geometry
-md.geometry.thickness=1000.0*np.ones((md.mesh.numberofvertices))
-md.geometry.base=np.zeros((md.mesh.numberofvertices))
-md.geometry.surface=md.geometry.base+md.geometry.thickness
+md.geometry.thickness = 1000.0 * np.ones((md.mesh.numberofvertices))
+md.geometry.base = np.zeros((md.mesh.numberofvertices))
+md.geometry.surface = md.geometry.base + md.geometry.thickness
 
-md.initialization.vx=np.zeros((md.mesh.numberofvertices))
-md.initialization.vy=np.zeros((md.mesh.numberofvertices))
-md.initialization.vz=np.zeros((md.mesh.numberofvertices))
-md.initialization.pressure=np.zeros((md.mesh.numberofvertices))
+md.initialization.vx = np.zeros((md.mesh.numberofvertices))
+md.initialization.vy = np.zeros((md.mesh.numberofvertices))
+md.initialization.vz = np.zeros((md.mesh.numberofvertices))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
 
 #Materials
-md.initialization.temperature=(273.-20.)*np.ones((md.mesh.numberofvertices))
-md.materials.rheology_B=paterson(md.initialization.temperature)
-md.materials.rheology_n=3.*np.ones((md.mesh.numberofelements))
+md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_B = paterson(md.initialization.temperature)
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
 
 #Calving
-md.calving.calvingrate=np.zeros((md.mesh.numberofvertices))
-md.levelset.spclevelset=np.nan*np.ones((md.mesh.numberofvertices))
+md.calving.calvingrate = np.zeros((md.mesh.numberofvertices))
+md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices))
 
 #Friction
-md.friction.coefficient=20.*np.ones((md.mesh.numberofvertices))
-md.friction.coefficient[np.where(md.mask.groundedice_levelset<0.)[0]]=0.
-md.friction.p=np.ones((md.mesh.numberofelements))
-md.friction.q=np.ones((md.mesh.numberofelements))
+md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
+md.friction.coefficient[np.where(md.mask.groundedice_levelset < 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.verbose=verbose(0)
-md.settings.waitonlock=30
-md.stressbalance.restol=0.05
-md.steadystate.reltol=0.05
-md.stressbalance.reltol=0.05
-md.stressbalance.abstol=float('NaN')
-md.timestepping.time_step=1.
-md.timestepping.final_time=3.
-md.groundingline.migration='None'
+md.masstransport.stabilization = 1.
+md.thermal.stabilization = 1.
+md.verbose = verbose(0)
+md.settings.waitonlock = 30
+md.stressbalance.restol = 0.05
+md.steadystate.reltol = 0.05
+md.stressbalance.reltol = 0.05
+md.stressbalance.abstol = float('NaN')
+md.timestepping.time_step = 1.
+md.timestepping.final_time = 3.
+md.groundingline.migration = 'None'
 
 #Boundary conditions:
-md=SetIceSheetBC(md)
+md = SetIceSheetBC(md)
 
 #Change name so that no test have the same name
 if len(inspect.stack()) > 2:
-	md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
+    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
Index: /issm/trunk/test/Par/Pig.par
===================================================================
--- /issm/trunk/test/Par/Pig.par	(revision 24312)
+++ /issm/trunk/test/Par/Pig.par	(revision 24313)
@@ -9,4 +9,5 @@
 surface   = archread('../Data/Pig.arch','surface');
 thickness = archread('../Data/Pig.arch','thickness');
+bed       = archread('../Data/Pig.arch','bed');
 
 x			 = x{1};
@@ -17,4 +18,5 @@
 surface	 = surface{1};
 thickness = thickness{1};
+bed       = bed{1};
 
 md.inversion.vx_obs   =InterpFromMeshToMesh2d(index,x,y,vx_obs,md.mesh.x,md.mesh.y);
@@ -23,4 +25,7 @@
 md.geometry.thickness=InterpFromMeshToMesh2d(index,x,y,thickness,md.mesh.x,md.mesh.y);
 md.geometry.base=md.geometry.surface-md.geometry.thickness;
+md.geometry.bed =md.geometry.base;
+pos = find(md.mask.groundedice_levelset<0);
+md.geometry.bed(pos) =InterpFromMeshToMesh2d(index,x,y,bed,md.mesh.x(pos),md.mesh.y(pos));
 clear surface thickness vx_obs vy_obs x y index;
 md.initialization.vx=md.inversion.vx_obs;
Index: /issm/trunk/test/Par/Pig.py
===================================================================
--- /issm/trunk/test/Par/Pig.py	(revision 24312)
+++ /issm/trunk/test/Par/Pig.py	(revision 24313)
@@ -2,5 +2,5 @@
 import inspect
 from arch import *
-import numpy
+import numpy as np
 from verbose import verbose
 from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
@@ -11,50 +11,54 @@
 
 #Geometry and observation
-x         = numpy.array(archread('../Data/Pig.arch','x'))
-y         = numpy.array(archread('../Data/Pig.arch','y'))
-vx_obs    = numpy.array(archread('../Data/Pig.arch','vx_obs'))
-vy_obs    = numpy.array(archread('../Data/Pig.arch','vy_obs'))
-index     = numpy.array(archread('../Data/Pig.arch','index')).astype(int)
-surface   = numpy.array(archread('../Data/Pig.arch','surface'))
-thickness = numpy.array(archread('../Data/Pig.arch','thickness'))
+x = np.array(archread('../Data/Pig.arch', 'x'))
+y = np.array(archread('../Data/Pig.arch', 'y'))
+vx_obs = np.array(archread('../Data/Pig.arch', 'vx_obs'))
+vy_obs = np.array(archread('../Data/Pig.arch', 'vy_obs'))
+index = np.array(archread('../Data/Pig.arch', 'index')).astype(int)
+surface = np.array(archread('../Data/Pig.arch', 'surface'))
+thickness = np.array(archread('../Data/Pig.arch', 'thickness'))
+bed = np.array(archread('../Data/Pig.arch', 'bed'))
 
-md.inversion.vx_obs   =InterpFromMeshToMesh2d(index,x,y,vx_obs,md.mesh.x,md.mesh.y)[0][:,0]
-md.inversion.vy_obs   =InterpFromMeshToMesh2d(index,x,y,vy_obs,md.mesh.x,md.mesh.y)[0][:,0]
-md.geometry.surface  =InterpFromMeshToMesh2d(index,x,y,surface,md.mesh.x,md.mesh.y)[0][:,0]
-md.geometry.thickness=InterpFromMeshToMesh2d(index,x,y,thickness,md.mesh.x,md.mesh.y)[0][:,0]
-md.geometry.base=md.geometry.surface-md.geometry.thickness
-md.initialization.vx=md.inversion.vx_obs
-md.initialization.vy=md.inversion.vy_obs
-md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
+md.inversion.vx_obs = InterpFromMeshToMesh2d(index, x, y, vx_obs, md.mesh.x, md.mesh.y)[0][:, 0]
+md.inversion.vy_obs = InterpFromMeshToMesh2d(index, x, y, vy_obs, md.mesh.x, md.mesh.y)[0][:, 0]
+md.geometry.surface = InterpFromMeshToMesh2d(index, x, y, surface, md.mesh.x, md.mesh.y)[0][:, 0]
+md.geometry.thickness = InterpFromMeshToMesh2d(index, x, y, thickness, md.mesh.x, md.mesh.y)[0][:, 0]
+md.geometry.base = md.geometry.surface - md.geometry.thickness
+md.geometry.bed = np.array(md.geometry.base)
+pos = np.where(md.mask.groundedice_levelset < 0.)
+md.geometry.bed[pos] = InterpFromMeshToMesh2d(index, x, y, bed, md.mesh.x[pos], md.mesh.y[pos])[0][:, 0]
+md.initialization.vx = md.inversion.vx_obs
+md.initialization.vy = md.inversion.vy_obs
+md.initialization.vz = np.zeros((md.mesh.numberofvertices))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
 
 #Materials
-md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
-md.materials.rheology_B=paterson(md.initialization.temperature)
-md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
-md.initialization.temperature=md.initialization.temperature
+md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_B = paterson(md.initialization.temperature)
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
+md.initialization.temperature = md.initialization.temperature
 
 #Friction
-md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices))
-md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
-md.friction.p=numpy.ones((md.mesh.numberofelements))
-md.friction.q=numpy.ones((md.mesh.numberofelements))
+md.friction.coefficient = 50. * np.ones((md.mesh.numberofvertices))
+md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 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.verbose=verbose(0)
-md.settings.waitonlock=30
-md.timestepping.time_step=1.
-md.timestepping.final_time=2.
-md.stressbalance.restol=0.05
-md.stressbalance.reltol=1.
-md.steadystate.reltol=1.
-md.stressbalance.abstol=float('nan')
-md.groundingline.migration='None'
+md.masstransport.stabilization = 1.
+md.verbose = verbose(0)
+md.settings.waitonlock = 30
+md.timestepping.time_step = 1.
+md.timestepping.final_time = 2.
+md.stressbalance.restol = 0.05
+md.stressbalance.reltol = 1.
+md.steadystate.reltol = 1.
+md.stressbalance.abstol = float('nan')
+md.groundingline.migration = 'None'
 
 #Boundary conditions:
-md=SetMarineIceSheetBC(md)
+md = SetMarineIceSheetBC(md)
 
 #Change name so that no test have the same name
 if len(inspect.stack()) > 2:
-	md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
+    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
Index: /issm/trunk/test/Par/RoundSheetEISMINT.py
===================================================================
--- /issm/trunk/test/Par/RoundSheetEISMINT.py	(revision 24312)
+++ /issm/trunk/test/Par/RoundSheetEISMINT.py	(revision 24313)
@@ -3,61 +3,61 @@
 
 #Ok, start defining model parameters here
-print "      creating thickness"
-md.geometry.thickness=10.*numpy.ones((md.mesh.numberofvertices))
-md.geometry.base=numpy.zeros((md.mesh.numberofvertices))
-md.geometry.surface=md.geometry.base+md.geometry.thickness
+print("      creating thickness")
+md.geometry.thickness = 10. * numpy.ones((md.mesh.numberofvertices))
+md.geometry.base = numpy.zeros((md.mesh.numberofvertices))
+md.geometry.surface = md.geometry.base + md.geometry.thickness
 
-print "      creating drag"
-md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices)) 
-md.friction.p=numpy.ones((md.mesh.numberofelements))
-md.friction.q=numpy.ones((md.mesh.numberofelements))
+print("      creating drag")
+md.friction.coefficient = 20. * numpy.ones((md.mesh.numberofvertices))
+md.friction.p = numpy.ones((md.mesh.numberofelements))
+md.friction.q = numpy.ones((md.mesh.numberofelements))
 
-print "      creating temperatures"
-tmin=238.15    #K
-st=1.67*10**-2/1000.    #k/m
-radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2)
-md.initialization.temperature=tmin+st*radius
-md.basalforcings.geothermalflux=4.2*10**-2*numpy.ones((md.mesh.numberofvertices))
+print("      creating temperatures")
+tmin = 238.15  #K
+st = 1.67 * 10**-2 / 1000.  #k / m
+radius = numpy.sqrt((md.mesh.x)**2 + (md.mesh.y)**2)
+md.initialization.temperature = tmin + st * radius
+md.basalforcings.geothermalflux = 4.2 * 10**-2 * numpy.ones((md.mesh.numberofvertices))
 
-print "      creating flow law parameter"
-md.materials.rheology_B=6.81*10**7*numpy.ones((md.mesh.numberofvertices))    #to have the same B as the analytical solution 
-md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
+print("      creating flow law parameter")
+md.materials.rheology_B = 6.81 * 10**7 * numpy.ones((md.mesh.numberofvertices))  #to have the same B as the analytical solution
+md.materials.rheology_n = 3. * numpy.ones((md.mesh.numberofelements))
 
-print "      creating surface mass balance"
-smb_max=0.5    #m/yr
-sb=10**-2/1000.    #m/yr/m
-rel=450.*1000.    #m
-md.smb.mass_balance=numpy.minimum(smb_max*numpy.ones_like(radius),sb*(rel-radius))
+print("      creating surface mass balance")
+smb_max = 0.5  #m / yr
+sb = 10**-2 / 1000.  #m / yr / m
+rel = 450. * 1000.  #m
+md.smb.mass_balance = numpy.minimum(smb_max * numpy.ones_like(radius), sb * (rel - radius))
 
-print "      creating velocities"
-constant=0.3
-md.inversion.vx_obs=constant/2.*md.mesh.x*(md.geometry.thickness)**-1
-md.inversion.vy_obs=constant/2.*md.mesh.y*(md.geometry.thickness)**-1
-md.inversion.vel_obs=numpy.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2)
-md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
+print("      creating velocities")
+constant = 0.3
+md.inversion.vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**- 1
+md.inversion.vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**- 1
+md.inversion.vel_obs = numpy.sqrt((md.inversion.vx_obs)**2 + (md.inversion.vy_obs)**2)
+md.initialization.vx = numpy.zeros((md.mesh.numberofvertices))
+md.initialization.vy = numpy.zeros((md.mesh.numberofvertices))
+md.initialization.vz = numpy.zeros((md.mesh.numberofvertices))
+md.initialization.pressure = numpy.zeros((md.mesh.numberofvertices))
 
 #Deal with boundary conditions:
-print "      boundary conditions for stressbalance model:"
-md=SetMarineIceSheetBC(md,'../Exp/RoundFrontEISMINT.exp')
+print("      boundary conditions for stressbalance model:")
+md = SetMarineIceSheetBC(md, '../Exp/RoundFrontEISMINT.exp')
 
-radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2)
-pos=numpy.nonzero(radius==numpy.min(radius))[0]
-md.mesh.x[pos]=0.
-md.mesh.y[pos]=0.    #the closest node to the center is changed to be exactly at the center
+radius = numpy.sqrt((md.mesh.x)**2 + (md.mesh.y)**2)
+pos = numpy.nonzero(radius == numpy.min(radius))[0]
+md.mesh.x[pos] = 0.
+md.mesh.y[pos] = 0.  #the closest node to the center is changed to be exactly at the center
 
-md.stressbalance.spcvx[pos]=0.
-md.stressbalance.spcvy[pos]=0.
-md.stressbalance.spcvz[pos]=0.
+md.stressbalance.spcvx[pos] = 0.
+md.stressbalance.spcvy[pos] = 0.
+md.stressbalance.spcvz[pos] = 0.
 
 #parallel options
-md.timestepping.final_time=50000.
+md.timestepping.final_time = 50000.
 
 #Constants
-md.materials.rho_ice=910.
-md.materials.thermalconductivity=2.1
-md.materials.latentheat=3.35*10**5
-md.materials.beta=8.66*10**-4/(md.materials.rho_ice*md.constants.g)    #conversion from K/m to K/Pa
-md.constants.yts=31556926.
+md.materials.rho_ice = 910.
+md.materials.thermalconductivity = 2.1
+md.materials.latentheat = 3.35 * 10**5
+md.materials.beta = 8.66 * 10**-4 / (md.materials.rho_ice * md.constants.g)  #conversion from K / m to K / Pa
+md.constants.yts = 31556926.
Index: /issm/trunk/test/Par/RoundSheetShelf.py
===================================================================
--- /issm/trunk/test/Par/RoundSheetShelf.py	(revision 24312)
+++ /issm/trunk/test/Par/RoundSheetShelf.py	(revision 24313)
@@ -1,4 +1,4 @@
 import os.path
-import numpy
+import numpy as np
 import copy
 import inspect
@@ -8,121 +8,121 @@
 #Start defining model parameters here
 
-di=md.materials.rho_ice/md.materials.rho_water
-rad=1.e6
-shelfextent=2.e5
+di = md.materials.rho_ice / md.materials.rho_water
+rad = 1.e6
+shelfextent = 2.e5
 #Geometry
-hmin=300.
-hmax=1000.
-radius=numpy.sqrt(md.mesh.x*md.mesh.x+md.mesh.y*md.mesh.y.reshape(-1))
-ymin=numpy.min(radius)
-ymax=numpy.max(radius)
-md.geometry.thickness=hmax+(hmin-hmax)*(radius-ymin)/(ymax-ymin)
-md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
+hmin = 300.
+hmax = 1000.
+radius = np.sqrt(md.mesh.x * md.mesh.x + md.mesh.y * md.mesh.y.reshape(-1))
+ymin = np.min(radius)
+ymax = np.max(radius)
+md.geometry.thickness = hmax + (hmin - hmax) * (radius - ymin) / (ymax - ymin)
+md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
 
-pos=numpy.nonzero(md.mask.groundedice_levelset>0.)[0]
-md.geometry.base[pos]=md.geometry.base[pos]-300.*(radius[pos]-(rad-shelfextent))/(rad-shelfextent)
-md.geometry.surface=md.geometry.base+md.geometry.thickness
+pos = np.nonzero(md.mask.groundedice_levelset > 0.)[0]
+md.geometry.base[pos] = md.geometry.base[pos] - 300. * (radius[pos] - (rad - shelfextent)) / (rad - shelfextent)
+md.geometry.surface = md.geometry.base + md.geometry.thickness
 
-pos=numpy.nonzero(radius<200000.)
-md.geometry.thickness[pos]=100.
-md.geometry.base[pos]=-di*md.geometry.thickness[pos]-20.
-md.geometry.surface[pos]=md.geometry.base[pos]+md.geometry.thickness[pos]
+pos = np.nonzero(radius < 200000.)
+md.geometry.thickness[pos] = 100.
+md.geometry.base[pos] = -di * md.geometry.thickness[pos] - 20.
+md.geometry.surface[pos] = md.geometry.base[pos] + md.geometry.thickness[pos]
 
-pos=numpy.nonzero(numpy.logical_and(numpy.logical_and(md.mesh.x<0.2*1.e6,md.mesh.x>-0.2*1.e6),md.mesh.y>0.))
-md.geometry.thickness[pos]=100.
-md.geometry.base[pos]=-di*md.geometry.thickness[pos]-20.
-md.geometry.surface[pos]=md.geometry.base[pos]+md.geometry.thickness[pos]
+pos = np.nonzero(np.logical_and(np.logical_and(md.mesh.x < 0.2 * 1.e6, md.mesh.x > -0.2 * 1.e6), md.mesh.y > 0.))
+md.geometry.thickness[pos] = 100.
+md.geometry.base[pos] = -di * md.geometry.thickness[pos] - 20.
+md.geometry.surface[pos] = md.geometry.base[pos] + md.geometry.thickness[pos]
 
-pos=numpy.nonzero(numpy.logical_and(numpy.logical_and(md.mesh.x<0.1*1.e6,md.mesh.x>-0.1*1.e6),numpy.logical_and(md.mesh.y<-0.5*1.e6,md.mesh.y>-0.6*1.e6)))
-md.geometry.thickness[pos]=100.
-md.geometry.base[pos]=-di*md.geometry.thickness[pos]-20.
-md.geometry.surface[pos]=md.geometry.base[pos]+md.geometry.thickness[pos]
+pos = np.nonzero(np.logical_and(np.logical_and(md.mesh.x < 0.1 * 1.e6, md.mesh.x > -0.1 * 1.e6), np.logical_and(md.mesh.y < -0.5 * 1.e6, md.mesh.y > -0.6 * 1.e6)))
+md.geometry.thickness[pos] = 100.
+md.geometry.base[pos] = -di * md.geometry.thickness[pos] - 20.
+md.geometry.surface[pos] = md.geometry.base[pos] + md.geometry.thickness[pos]
 
-#plug holes into the ice sheet, to test for grounding line migration. 
-di=md.materials.rho_ice/md.materials.rho_water
-rad=numpy.sqrt(md.mesh.x**2+md.mesh.y**2)
-pos=numpy.nonzero(rad<200000.)
-md.geometry.thickness[pos]=100.
-md.geometry.base[pos]=-di*md.geometry.thickness[pos]-20.
-md.geometry.surface[pos]=md.geometry.base[pos]+md.geometry.thickness[pos]
+#plug holes into the ice sheet, to test for grounding line migration.
+di = md.materials.rho_ice / md.materials.rho_water
+rad = np.sqrt(md.mesh.x**2 + md.mesh.y**2)
+pos = np.nonzero(rad < 200000.)
+md.geometry.thickness[pos] = 100.
+md.geometry.base[pos] = -di * md.geometry.thickness[pos] - 20.
+md.geometry.surface[pos] = md.geometry.base[pos] + md.geometry.thickness[pos]
 
-pos=numpy.nonzero(numpy.logical_and(numpy.logical_and(md.mesh.x<0.2*1.e6,md.mesh.x>-0.2*1.e6),md.mesh.y>0.))
-md.geometry.thickness[pos]=100.
-md.geometry.base[pos]=-di*md.geometry.thickness[pos]-20.
-md.geometry.surface[pos]=md.geometry.base[pos]+md.geometry.thickness[pos]
+pos = np.nonzero(np.logical_and(np.logical_and(md.mesh.x < 0.2 * 1.e6, md.mesh.x > -0.2 * 1.e6), md.mesh.y > 0.))
+md.geometry.thickness[pos] = 100.
+md.geometry.base[pos] = -di * md.geometry.thickness[pos] - 20.
+md.geometry.surface[pos] = md.geometry.base[pos] + md.geometry.thickness[pos]
 
-pos=numpy.nonzero(numpy.logical_and(numpy.logical_and(md.mesh.x<0.1*1.e6,md.mesh.x>-0.1*1.e6),numpy.logical_and(md.mesh.y<-0.5*1.e6,md.mesh.y>-0.6*1.e6)))
-md.geometry.thickness[pos]=100.
-md.geometry.base[pos]=-di*md.geometry.thickness[pos]-20.
-md.geometry.surface[pos]=md.geometry.base[pos]+md.geometry.thickness[pos]
+pos = np.nonzero(np.logical_and(np.logical_and(md.mesh.x < 0.1 * 1.e6, md.mesh.x > -0.1 * 1.e6), np.logical_and(md.mesh.y < -0.5 * 1.e6, md.mesh.y > -0.6 * 1.e6)))
+md.geometry.thickness[pos] = 100.
+md.geometry.base[pos] = -di * md.geometry.thickness[pos] - 20.
+md.geometry.surface[pos] = md.geometry.base[pos] + md.geometry.thickness[pos]
 
-#Initial velocity 
-md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
+#Initial velocity
+md.initialization.vx = np.zeros((md.mesh.numberofvertices))
+md.initialization.vy = np.zeros((md.mesh.numberofvertices))
+md.initialization.vz = np.zeros((md.mesh.numberofvertices))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
 
 #Materials
-md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
-md.materials.rheology_B=paterson(md.initialization.temperature)
-md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
+md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_B = paterson(md.initialization.temperature)
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
 
 #Surface mass balance and basal melting
-md.smb.mass_balance=-10.*numpy.ones((md.mesh.numberofvertices))
-md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
-pos=numpy.nonzero(md.mask.groundedice_levelset>0.)[0]
-md.basalforcings.groundedice_melting_rate[pos]=10.
-md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
-md.basalforcings.geothermalflux=numpy.ones((md.mesh.numberofvertices))
+md.smb.mass_balance = -10. * np.ones((md.mesh.numberofvertices))
+md.basalforcings.groundedice_melting_rate = np.zeros((md.mesh.numberofvertices))
+pos = np.nonzero(md.mask.groundedice_levelset > 0.)[0]
+md.basalforcings.groundedice_melting_rate[pos] = 10.
+md.basalforcings.floatingice_melting_rate = np.zeros((md.mesh.numberofvertices))
+md.basalforcings.geothermalflux = np.ones((md.mesh.numberofvertices))
 
 #Friction
-radius=1.e6
-shelfextent=2.e5
-md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices))
-xelem=numpy.mean(md.mesh.x[md.mesh.elements.astype(int)-1],axis=1)
-yelem=numpy.mean(md.mesh.y[md.mesh.elements.astype(int)-1],axis=1)
-rad=numpy.sqrt(xelem**2+yelem**2)
-flags=numpy.zeros(md.mesh.numberofelements)
-pos=numpy.nonzero(rad>=(radius-shelfextent))
-md.friction.coefficient[md.mesh.elements[pos,:]-1]=0.
-md.friction.p=numpy.ones((md.mesh.numberofelements))
-md.friction.q=numpy.ones((md.mesh.numberofelements))
+radius = 1.e6
+shelfextent = 2.e5
+md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
+xelem = np.mean(md.mesh.x[md.mesh.elements.astype(int) - 1], axis=1)
+yelem = np.mean(md.mesh.y[md.mesh.elements.astype(int) - 1], axis=1)
+rad = np.sqrt(xelem**2 + yelem**2)
+flags = np.zeros(md.mesh.numberofelements)
+pos = np.nonzero(rad >= (radius - shelfextent))
+md.friction.coefficient[md.mesh.elements[pos, :] - 1] = 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.verbose=verbose(0)
-md.settings.waitonlock=30
-md.stressbalance.restol=0.05
-md.stressbalance.reltol=0.05
-md.steadystate.reltol=0.05
-md.stressbalance.abstol=float('nan')
-md.timestepping.time_step=5.
-md.timestepping.final_time=5.
+md.masstransport.stabilization = 1
+md.thermal.stabilization = 1
+md.verbose = verbose(0)
+md.settings.waitonlock = 30
+md.stressbalance.restol = 0.05
+md.stressbalance.reltol = 0.05
+md.steadystate.reltol = 0.05
+md.stressbalance.abstol = float('nan')
+md.timestepping.time_step = 5.
+md.timestepping.final_time = 5.
 
 #bathymetry and grounding line migration:
-md.groundingline.migration='AggressiveMigration'
-md.geometry.bed=copy.deepcopy(md.geometry.base)
-pos=numpy.nonzero(md.mask.groundedice_levelset<0.)[0]
-md.geometry.bed[pos]=md.geometry.base[pos]-900.
+md.groundingline.migration = 'AggressiveMigration'
+md.geometry.bed = copy.deepcopy(md.geometry.base)
+pos = np.nonzero(md.mask.groundedice_levelset < 0.)[0]
+md.geometry.bed[pos] = md.geometry.base[pos] - 900.
 
 #Deal with boundary conditions:
-md.stressbalance.spcvx=float('nan')*numpy.ones((md.mesh.numberofvertices))
-md.stressbalance.spcvy=float('nan')*numpy.ones((md.mesh.numberofvertices))
-md.stressbalance.spcvz=float('nan')*numpy.ones((md.mesh.numberofvertices))
+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))
 
-pos=numpy.nonzero(numpy.logical_and(md.mesh.x==0,md.mesh.y==0))
-md.stressbalance.spcvx[pos]=0
-md.stressbalance.spcvy[pos]=0
+pos = np.nonzero(np.logical_and(md.mesh.x == 0, md.mesh.y == 0))
+md.stressbalance.spcvx[pos] = 0
+md.stressbalance.spcvy[pos] = 0
 
-pos=numpy.nonzero(md.mesh.vertexonboundary)
-md.mask.ice_levelset[pos]=0
-md.balancethickness.spcthickness=float('nan')*numpy.ones((md.mesh.numberofvertices))
-md.masstransport.spcthickness=float('nan')*numpy.ones((md.mesh.numberofvertices))
-md.stressbalance.referential=float('nan')*numpy.ones((md.mesh.numberofvertices,6))
-md.stressbalance.loadingforce=0*numpy.ones((md.mesh.numberofvertices,3))
-md.thermal.spctemperature=737.*numpy.ones((md.mesh.numberofvertices))
+pos = np.nonzero(md.mesh.vertexonboundary)
+md.mask.ice_levelset[pos] = 0
+md.balancethickness.spcthickness = float('nan') * np.ones((md.mesh.numberofvertices))
+md.masstransport.spcthickness = float('nan') * np.ones((md.mesh.numberofvertices))
+md.stressbalance.referential = float('nan') * np.ones((md.mesh.numberofvertices, 6))
+md.stressbalance.loadingforce = 0 * np.ones((md.mesh.numberofvertices, 3))
+md.thermal.spctemperature = 737. * np.ones((md.mesh.numberofvertices))
 
 #Change name so that no test have the same name
 if len(inspect.stack()) > 2:
-	md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
+    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
Index: /issm/trunk/test/Par/RoundSheetStaticEISMINT.par
===================================================================
--- /issm/trunk/test/Par/RoundSheetStaticEISMINT.par	(revision 24312)
+++ /issm/trunk/test/Par/RoundSheetStaticEISMINT.par	(revision 24313)
@@ -22,5 +22,5 @@
 
 disp('      creating flow law parameter');
-md.materials.rheology_B=6.81*10^7*ones(md.mesh.numberofvertices,1); %to have the same B as the analytical solution 
+md.materials.rheology_B=6.81*10^7*ones(md.mesh.numberofvertices,1); %to have the same B as the analytical solution
 md.materials.rheology_n=3.*ones(md.mesh.numberofelements,1);
 
Index: /issm/trunk/test/Par/RoundSheetStaticEISMINT.py
===================================================================
--- /issm/trunk/test/Par/RoundSheetStaticEISMINT.py	(revision 24312)
+++ /issm/trunk/test/Par/RoundSheetStaticEISMINT.py	(revision 24313)
@@ -2,56 +2,56 @@
 from SetMarineIceSheetBC import SetMarineIceSheetBC
 
-print "      creating thickness"
-hmin=0.01
-hmax=2756.7
-radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2)
-radiusmax=numpy.max(radius)
-radius[numpy.nonzero(radius>(1.-10**-9)*radiusmax)]=radiusmax    #eliminate roundoff issues in next statement
-md.geometry.thickness=hmin*numpy.ones((numpy.size(md.mesh.x)))+hmax*(4.*((1./2.)**(4./3.)*numpy.ones((numpy.size(md.mesh.x)))-((radius)/(2.*radiusmax))**(4./3.)))**(3./8.)
-md.geometry.base=0.*md.geometry.thickness
-md.geometry.surface=md.geometry.base+md.geometry.thickness
+print("      creating thickness")
+hmin = 0.01
+hmax = 2756.7
+radius = numpy.sqrt((md.mesh.x)**2 + (md.mesh.y)**2)
+radiusmax = numpy.max(radius)
+radius[numpy.nonzero(radius > (1. - 10**-9) * radiusmax)] = radiusmax  #eliminate roundoff issues in next statement
+md.geometry.thickness = hmin * numpy.ones((numpy.size(md.mesh.x))) + hmax * (4. * ((1. / 2.)**(4. / 3.) * numpy.ones((numpy.size(md.mesh.x))) - ((radius) / (2. * radiusmax))**(4. / 3.)))**(3. / 8.)
+md.geometry.base = 0. * md.geometry.thickness
+md.geometry.surface = md.geometry.base + md.geometry.thickness
 
-print "      creating drag"
-md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices))
-md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
-md.friction.p=numpy.ones((md.mesh.numberofelements))
-md.friction.q=numpy.ones((md.mesh.numberofelements))
+print("      creating drag")
+md.friction.coefficient = 20. * numpy.ones((md.mesh.numberofvertices))
+md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
+md.friction.p = numpy.ones((md.mesh.numberofelements))
+md.friction.q = numpy.ones((md.mesh.numberofelements))
 
-print "      creating temperatures"
-tmin=238.15    #K
-st=1.67*10**-2/1000.    #k/m
-md.initialization.temperature=tmin+st*radius
-md.basalforcings.geothermalflux=4.2*10**-2*numpy.ones((md.mesh.numberofvertices))
+print("      creating temperatures")
+tmin = 238.15  #K
+st = 1.67 * 10**-2 / 1000.  #k / m
+md.initialization.temperature = tmin + st * radius
+md.basalforcings.geothermalflux = 4.2 * 10**-2 * numpy.ones((md.mesh.numberofvertices))
 
-print "      creating flow law parameter"
-md.materials.rheology_B=6.81*10**7*numpy.ones((md.mesh.numberofvertices))    #to have the same B as the analytical solution 
-md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
+print("      creating flow law parameter")
+md.materials.rheology_B = 6.81 * 10**7 * numpy.ones((md.mesh.numberofvertices))  #to have the same B as the analytical solution
+md.materials.rheology_n = 3. * numpy.ones((md.mesh.numberofelements))
 
-print "      creating surface mass balance"
-smb_max=0.5    #m/yr
-sb=10**-2/1000.    #m/yr/m
-rel=450.*1000.    #m
-md.smb.mass_balance=numpy.minimum(smb_max*numpy.ones_like(radius),sb*(rel-radius))
+print("      creating surface mass balance")
+smb_max = 0.5  #m / yr
+sb = 10**-2 / 1000.  #m / yr / m
+rel = 450. * 1000.  #m
+md.smb.mass_balance = numpy.minimum(smb_max * numpy.ones_like(radius), sb * (rel - radius))
 
-print "      creating velocities"
-constant=0.3
-md.inversion.vx_obs=constant/2.*md.mesh.x*(md.geometry.thickness)**-1
-md.inversion.vy_obs=constant/2.*md.mesh.y*(md.geometry.thickness)**-1
-md.inversion.vel_obs=numpy.sqrt((md.inversion.vx_obs)**2+(md.inversion.vy_obs)**2)
-md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
+print("      creating velocities")
+constant = 0.3
+md.inversion.vx_obs = constant / 2. * md.mesh.x * (md.geometry.thickness)**- 1
+md.inversion.vy_obs = constant / 2. * md.mesh.y * (md.geometry.thickness)**- 1
+md.inversion.vel_obs = numpy.sqrt((md.inversion.vx_obs)**2 + (md.inversion.vy_obs)**2)
+md.initialization.vx = numpy.zeros((md.mesh.numberofvertices))
+md.initialization.vy = numpy.zeros((md.mesh.numberofvertices))
+md.initialization.vz = numpy.zeros((md.mesh.numberofvertices))
+md.initialization.pressure = numpy.zeros((md.mesh.numberofvertices))
 
 #Deal with boundary conditions:
-print "      boundary conditions for stressbalance model:"
-md=SetMarineIceSheetBC(md,'../Exp/RoundFrontEISMINT.exp')
+print("      boundary conditions for stressbalance model:")
+md = SetMarineIceSheetBC(md, '../Exp/RoundFrontEISMINT.exp')
 
-radius=numpy.sqrt((md.mesh.x)**2+(md.mesh.y)**2)
-pos=numpy.nonzero(radius==numpy.min(radius))[0]
-md.mesh.x[pos]=0.
-md.mesh.y[pos]=0.    #the closest node to the center is changed to be exactly at the center
+radius = numpy.sqrt((md.mesh.x)**2 + (md.mesh.y)**2)
+pos = numpy.nonzero(radius == numpy.min(radius))[0]
+md.mesh.x[pos] = 0.
+md.mesh.y[pos] = 0.  #the closest node to the center is changed to be exactly at the center
 
-md.stressbalance.spcvx[pos]=0.
-md.stressbalance.spcvy[pos]=0.
-md.stressbalance.spcvz[pos]=0.
+md.stressbalance.spcvx[pos] = 0.
+md.stressbalance.spcvy[pos] = 0.
+md.stressbalance.spcvz[pos] = 0.
Index: /issm/trunk/test/Par/SquareEISMINT.py
===================================================================
--- /issm/trunk/test/Par/SquareEISMINT.py	(revision 24312)
+++ /issm/trunk/test/Par/SquareEISMINT.py	(revision 24313)
@@ -1,48 +1,48 @@
-import numpy
+import numpy as np
 from SetMarineIceSheetBC import SetMarineIceSheetBC
 
 #Ok, start defining model parameters here
 
-print "      creating thickness"
-ymin=numpy.min(md.mesh.y)
-ymax=numpy.max(md.mesh.y)
-md.geometry.thickness=500.*numpy.ones((md.mesh.numberofvertices))
-md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness
-md.geometry.surface=md.geometry.base+md.geometry.thickness
+print("      creating thickness")
+ymin = np.min(md.mesh.y)
+ymax = np.max(md.mesh.y)
+md.geometry.thickness = 500. * np.ones((md.mesh.numberofvertices))
+md.geometry.base = -md.materials.rho_ice / md.materials.rho_water * md.geometry.thickness
+md.geometry.surface = md.geometry.base + md.geometry.thickness
 
-print "      creating drag"
-md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices))
-md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
-md.friction.p=numpy.ones((md.mesh.numberofelements))
-md.friction.q=numpy.ones((md.mesh.numberofelements))
+print("      creating drag")
+md.friction.coefficient = 200. * np.ones((md.mesh.numberofvertices))
+md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
+md.friction.p = np.ones((md.mesh.numberofelements))
+md.friction.q = np.ones((md.mesh.numberofelements))
 
-print "      creating initial values"
-md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
-md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.vel=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
+print("      creating initial values")
+md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
+md.initialization.vx = np.zeros((md.mesh.numberofvertices))
+md.initialization.vy = np.zeros((md.mesh.numberofvertices))
+md.initialization.vz = np.zeros((md.mesh.numberofvertices))
+md.initialization.vel = np.zeros((md.mesh.numberofvertices))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
 
-print "      creating flow law parameter"
-md.materials.rheology_B=1.7687*10**8*numpy.ones((md.mesh.numberofvertices))
-md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
+print("      creating flow law parameter")
+md.materials.rheology_B = 1.7687 * 10**8 * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
 
-print "      creating surface mass balance"
-md.smb.mass_balance=0.2*numpy.ones((md.mesh.numberofvertices))    #0m/a
-md.basalforcings.floatingice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices))    #0m/a
-md.basalforcings.groundedice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices))    #0m/a
+print("      creating surface mass balance")
+md.smb.mass_balance = 0.2 * np.ones((md.mesh.numberofvertices))  #0m / a
+md.basalforcings.floatingice_melting_rate = 0. * np.ones((md.mesh.numberofvertices))  #0m / a
+md.basalforcings.groundedice_melting_rate = 0. * np.ones((md.mesh.numberofvertices))  #0m / a
 
-print "      boundary conditions"
-md=SetMarineIceSheetBC(md,'../Exp/SquareFrontEISMINT.exp')
+print("      boundary conditions")
+md = SetMarineIceSheetBC(md, '../Exp/SquareFrontEISMINT.exp')
 
 #Evolution of the ice shelf
-pos=numpy.nonzero(md.mesh.y==200000.)    #nodes on the upper boundary condition
-md.balancethickness.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices))
-md.balancethickness.spcthickness[pos]=500.
-md.masstransport.spcthickness=float('NaN')*numpy.ones((md.mesh.numberofvertices))
-md.masstransport.spcthickness[pos]=500.
-md.masstransport.stabilization=0    #Better result with no artificial diffusivity
-md.thermal.stabilization=0
-md.timestepping.final_time=500.
-md.timestepping.time_step=1
+pos = np.nonzero(md.mesh.y == 200000.)  #nodes on the upper boundary condition
+md.balancethickness.spcthickness = float('NaN') * np.ones((md.mesh.numberofvertices))
+md.balancethickness.spcthickness[pos] = 500.
+md.masstransport.spcthickness = float('NaN') * np.ones((md.mesh.numberofvertices))
+md.masstransport.spcthickness[pos] = 500.
+md.masstransport.stabilization = 0  #Better result with no artificial diffusivity
+md.thermal.stabilization = 0
+md.timestepping.final_time = 500.
+md.timestepping.time_step = 1
Index: /issm/trunk/test/Par/SquareSheetConstrained.py
===================================================================
--- /issm/trunk/test/Par/SquareSheetConstrained.py	(revision 24312)
+++ /issm/trunk/test/Par/SquareSheetConstrained.py	(revision 24313)
@@ -11,66 +11,66 @@
 
 #Geometry
-hmin=300.
-hmax=1000.
-ymin=np.min(md.mesh.y)
-ymax=np.max(md.mesh.y)
-xmin=np.min(md.mesh.x)
-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.surface=md.geometry.base+md.geometry.thickness
+hmin = 300.
+hmax = 1000.
+ymin = np.min(md.mesh.y)
+ymax = np.max(md.mesh.y)
+xmin = np.min(md.mesh.x)
+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.surface = md.geometry.base + md.geometry.thickness
 
-#Initial velocity 
-x         = np.array(archread('../Data/SquareSheetConstrained.arch','x'))
-y         = np.array(archread('../Data/SquareSheetConstrained.arch','y'))
-vx        = np.array(archread('../Data/SquareSheetConstrained.arch','vx'));
-vy        = np.array(archread('../Data/SquareSheetConstrained.arch','vy'));
-index     = archread('../Data/SquareSheetConstrained.arch','index').astype(int);
+#Initial velocity
+x = np.array(archread('../Data/SquareSheetConstrained.arch', 'x'))
+y = np.array(archread('../Data/SquareSheetConstrained.arch', 'y'))
+vx = np.array(archread('../Data/SquareSheetConstrained.arch', 'vx'))
+vy = np.array(archread('../Data/SquareSheetConstrained.arch', 'vy'))
+index = archread('../Data/SquareSheetConstrained.arch', 'index').astype(int)
 
-md.initialization.vx=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)[0]
-md.initialization.vy=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)[0]
-md.initialization.vz=np.zeros((md.mesh.numberofvertices))
-md.initialization.pressure=np.zeros((md.mesh.numberofvertices))
+md.initialization.vx = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)[0]
+md.initialization.vy = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)[0]
+md.initialization.vz = np.zeros((md.mesh.numberofvertices))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
 
 #Materials
-md.initialization.temperature=(273.-20.)*np.ones((md.mesh.numberofvertices))
-md.materials.rheology_B=paterson(md.initialization.temperature)
-md.materials.rheology_n=3.*np.ones((md.mesh.numberofelements))
+md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_B = paterson(md.initialization.temperature)
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
 
 #Calving
-md.calving.calvingrate=np.zeros((md.mesh.numberofvertices))
-md.levelset.spclevelset=np.nan*np.ones((md.mesh.numberofvertices))
+md.calving.calvingrate = np.zeros((md.mesh.numberofvertices))
+md.levelset.spclevelset = np.nan * np.ones((md.mesh.numberofvertices))
 
 #Friction
-md.friction.coefficient=20.*np.ones((md.mesh.numberofvertices))
-md.friction.coefficient[np.where(md.mask.groundedice_levelset<0.)[0]]=0.
-md.friction.p=np.ones((md.mesh.numberofelements))
-md.friction.q=np.ones((md.mesh.numberofelements))
+md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
+md.friction.coefficient[np.where(md.mask.groundedice_levelset < 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.verbose=verbose(0)
-md.settings.waitonlock=30
-md.stressbalance.restol=0.05
-md.steadystate.reltol=0.05
-md.stressbalance.reltol=0.05
-md.stressbalance.abstol=np.nan
-md.timestepping.time_step=1.
-md.timestepping.final_time=3.
-md.groundingline.migration='None'
+md.masstransport.stabilization = 1.
+md.thermal.stabilization = 1.
+md.verbose = verbose(0)
+md.settings.waitonlock = 30
+md.stressbalance.restol = 0.05
+md.steadystate.reltol = 0.05
+md.stressbalance.reltol = 0.05
+md.stressbalance.abstol = np.nan
+md.timestepping.time_step = 1.
+md.timestepping.final_time = 3.
+md.groundingline.migration = 'None'
 
 #GIA:
-md.gia.lithosphere_thickness=100.*np.ones((md.mesh.numberofvertices)); # in km
-md.gia.mantle_viscosity=1.*10**21*np.ones((md.mesh.numberofvertices)); # in Pa.s
-md.materials.lithosphere_shear_modulus=6.7*10**10;                          # in Pa
-md.materials.lithosphere_density=3.32;                                      # in g/cm^-3
-md.materials.mantle_shear_modulus=1.45*10**11;                              # in Pa
-md.materials.mantle_density=3.34;                                           # in g/cm^-3
+md.gia.lithosphere_thickness = 100. * np.ones((md.mesh.numberofvertices))  # in km
+md.gia.mantle_viscosity = 1. * 10**21 * np.ones((md.mesh.numberofvertices))  # in Pa.s
+md.materials.lithosphere_shear_modulus = 6.7 * 10**10  # in Pa
+md.materials.lithosphere_density = 3.32  # in g / cm^ - 3
+md.materials.mantle_shear_modulus = 1.45 * 10**11  # in Pa
+md.materials.mantle_density = 3.34  # in g / cm^ - 3
 
 #Boundary conditions:
-md=SetIceSheetBC(md)
+md = SetIceSheetBC(md)
 
 #Change name so that no test have the same name
 if len(inspect.stack()) > 2:
-	md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
+    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
Index: /issm/trunk/test/Par/SquareSheetConstrainedCO2.par
===================================================================
--- /issm/trunk/test/Par/SquareSheetConstrainedCO2.par	(revision 24313)
+++ /issm/trunk/test/Par/SquareSheetConstrainedCO2.par	(revision 24313)
@@ -0,0 +1,77 @@
+%Start defining model parameters here
+CO2_temp = 150; CO2_n = 7;
+CO2_meltingPoint = 195; CO2_latentHeat = 199000;
+CO2_rhoIce = 1562; CO2_heatCapacity = 700; CO2_thermalCond = 0.5;
+CO2_dynViscosity = 13.72e-6; CO2_rhoLiquidZeroDeg = 929;
+md.materials.rho_ice = CO2_rhoIce;
+md.materials.rho_freshwater = CO2_rhoLiquidZeroDeg;
+md.materials.thermalconductivity = CO2_thermalCond;
+md.materials.heatcapacity = CO2_heatCapacity;
+md.materials.meltingpoint = CO2_meltingPoint;
+md.materials.latentheat = CO2_latentHeat;
+md.materials.mu_water = CO2_dynViscosity; 
+
+%Geometry
+hmin=300;
+hmax=1000;
+ymin=min(md.mesh.y);
+ymax=max(md.mesh.y);
+xmin=min(md.mesh.x);
+xmax=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.surface=md.geometry.base+md.geometry.thickness;
+
+%Initial velocity 
+x     = archread('../Data/SquareSheetConstrained.arch','x');
+y     = archread('../Data/SquareSheetConstrained.arch','y');
+vx    = archread('../Data/SquareSheetConstrained.arch','vx');
+vy    = archread('../Data/SquareSheetConstrained.arch','vy');
+index = archread('../Data/SquareSheetConstrained.arch','index');
+
+x = x{1};
+y = y{1};
+vx = vx{1};
+vy = vy{1};
+index = index{1};
+md.initialization.vx=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y);
+md.initialization.vy=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y);
+clear vx vy x y index;
+md.initialization.vz=zeros(md.mesh.numberofvertices,1);
+md.initialization.pressure=zeros(md.mesh.numberofvertices,1);
+
+%Materials
+md.initialization.temperature=CO2_temp*ones(md.mesh.numberofvertices,1);
+md.materials.rheology_B=nye(md.initialization.temperature,1);
+md.materials.rheology_n=CO2_n*ones(md.mesh.numberofelements,1);
+
+%Surface mass balance and basal melting
+md.smb.mass_balance=10*ones(md.mesh.numberofvertices,1);
+md.basalforcings.floatingice_melting_rate=5*ones(md.mesh.numberofvertices,1);
+md.basalforcings.groundedice_melting_rate=5*ones(md.mesh.numberofvertices,1);
+
+%Friction
+md.friction.coefficient=20*ones(md.mesh.numberofvertices,1);
+md.friction.coefficient(find(md.mask.groundedice_levelset<0.))=0.;
+md.friction.p=ones(md.mesh.numberofelements,1);
+md.friction.q=ones(md.mesh.numberofelements,1);
+
+%Numerical parameters
+md.masstransport.stabilization=1;
+md.thermal.stabilization=1;
+md.verbose=verbose(0);
+md.settings.waitonlock=30;
+md.stressbalance.restol=0.05;
+md.stressbalance.reltol=0.05;
+md.steadystate.reltol=0.05;
+md.stressbalance.abstol=NaN;
+md.timestepping.time_step=1;
+md.timestepping.final_time=3;
+md.groundingline.migration='None';
+
+%Deal with boundary conditions:
+md=SetIceSheetBC(md);
+
+%Change name so that no tests have the same name
+A=dbstack;
+if (length(A)>2), md.miscellaneous.name=A(3).file(1:end-2); end
Index: /issm/trunk/test/Par/SquareSheetConstrainedCO2.py
===================================================================
--- /issm/trunk/test/Par/SquareSheetConstrainedCO2.py	(revision 24313)
+++ /issm/trunk/test/Par/SquareSheetConstrainedCO2.py	(revision 24313)
@@ -0,0 +1,85 @@
+import os.path
+from arch import archread
+import numpy as np
+import inspect
+from verbose import verbose
+from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
+from nye import nye
+from SetIceSheetBC import SetIceSheetBC
+
+#Start defining model parameters here
+CO2_temp = 150.
+CO2_n = 7.
+CO2_meltingPoint = 195.
+CO2_latentHeat = 199000.
+CO2_rhoIce = 1562.
+CO2_heatCapacity = 700.
+CO2_thermalCond = 0.5
+CO2_dynViscosity = 13.72 * 10**-6
+CO2_rhoLiquidZeroDeg = 929.
+md.materials.rho_ice = CO2_rhoIce
+md.materials.rho_freshwater = CO2_rhoLiquidZeroDeg
+md.materials.thermalconductivity = CO2_thermalCond
+md.materials.heatcapacity = CO2_heatCapacity
+md.materials.meltingpoint = CO2_meltingPoint
+md.materials.latentheat = CO2_latentHeat
+md.materials.mu_water = CO2_dynViscosity
+
+#Geometry
+hmin = 300.
+hmax = 1000.
+ymin = np.min(md.mesh.y)
+ymax = np.max(md.mesh.y)
+xmin = min(md.mesh.x)
+xmax = 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.surface = md.geometry.base + md.geometry.thickness
+
+#Initial velocity
+x = np.array(archread('../Data/SquareSheetConstrained.arch', 'x'))
+y = np.array(archread('../Data/SquareSheetConstrained.arch', 'y'))
+vx = np.array(archread('../Data/SquareSheetConstrained.arch', 'vx'))
+vy = np.array(archread('../Data/SquareSheetConstrained.arch', 'vy'))
+index = archread('../Data/SquareSheetConstrained.arch', 'index').astype(int)
+
+[md.initialization.vx] = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)
+[md.initialization.vy] = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)
+md.initialization.vz = np.zeros((md.mesh.numberofvertices))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
+
+#Materials
+md.initialization.temperature = CO2_temp * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_B = nye(md.initialization.temperature, 1)
+md.materials.rheology_n = CO2_n * np.ones((md.mesh.numberofelements))
+
+#Surface mass balance and basal melting
+md.smb.mass_balance = 10. * np.ones((md.mesh.numberofvertices))
+md.basalforcings.groundedice_melting_rate = 5. * np.ones((md.mesh.numberofvertices))
+md.basalforcings.floatingice_melting_rate = 5. * np.ones((md.mesh.numberofvertices))
+
+#Friction
+md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
+md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 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.verbose = verbose(0)
+md.settings.waitonlock = 30
+md.stressbalance.restol = 0.05
+md.stressbalance.reltol = 0.05
+md.steadystate.reltol = 0.05
+md.stressbalance.abstol = float('nan')
+md.timestepping.time_step = 1.
+md.timestepping.final_time = 3.
+md.groundingline.migration = 'None'
+
+#Deal with boundary conditions:
+md = SetIceSheetBC(md)
+
+#Change name so that no tests have the same name
+if len(inspect.stack()) > 2:
+    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
Index: /issm/trunk/test/Par/SquareSheetShelf.py
===================================================================
--- /issm/trunk/test/Par/SquareSheetShelf.py	(revision 24312)
+++ /issm/trunk/test/Par/SquareSheetShelf.py	(revision 24313)
@@ -2,8 +2,8 @@
 import inspect
 from arch import *
-import numpy
+import numpy as np
 from verbose import verbose
 from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
-from paterson import paterson 
+from paterson import paterson
 from SetMarineIceSheetBC import SetMarineIceSheetBC
 
@@ -11,62 +11,62 @@
 
 #Geometry
-hmin=300.
-hmax=1000.
-ymin=min(md.mesh.y)
-ymax=max(md.mesh.y)
-xmin=min(md.mesh.x)
-xmax=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
-bed_sheet=-md.materials.rho_ice/md.materials.rho_water*(hmax+(hmin-hmax)*(ymax/2-ymin)/(ymax-ymin))
-pos=numpy.nonzero(md.mesh.y<=ymax/2.)
-md.geometry.base[pos]=bed_sheet
-md.geometry.surface=md.geometry.base+md.geometry.thickness
+hmin = 300.
+hmax = 1000.
+ymin = min(md.mesh.y)
+ymax = max(md.mesh.y)
+xmin = min(md.mesh.x)
+xmax = 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
+bed_sheet = -md.materials.rho_ice / md.materials.rho_water * (hmax + (hmin - hmax) * (ymax / 2 - ymin) / (ymax - ymin))
+pos = np.nonzero(md.mesh.y <= ymax / 2.)
+md.geometry.base[pos] = bed_sheet
+md.geometry.surface = md.geometry.base + md.geometry.thickness
 
-#Initial velocity 
-x         = numpy.array(archread('../Data/SquareSheetShelf.arch','x'))
-y         = numpy.array(archread('../Data/SquareSheetShelf.arch','y'))
-vx        = numpy.array(archread('../Data/SquareSheetShelf.arch','vx'));
-vy        = numpy.array(archread('../Data/SquareSheetShelf.arch','vy'));
-index     = numpy.array(archread('../Data/SquareSheetShelf.arch','index')).astype(int);
+#Initial velocity
+x = np.array(archread('../Data/SquareSheetShelf.arch', 'x'))
+y = np.array(archread('../Data/SquareSheetShelf.arch', 'y'))
+vx = np.array(archread('../Data/SquareSheetShelf.arch', 'vx'))
+vy = np.array(archread('../Data/SquareSheetShelf.arch', 'vy'))
+index = np.array(archread('../Data/SquareSheetShelf.arch', 'index')).astype(int)
 
-[md.initialization.vx]  = InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
-[md.initialization.vy]  = InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
-md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
+[md.initialization.vx] = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)
+[md.initialization.vy] = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)
+md.initialization.vz = np.zeros((md.mesh.numberofvertices))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
 
 #Materials
-md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
-md.materials.rheology_B=paterson(md.initialization.temperature)
-md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
+md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_B = paterson(md.initialization.temperature)
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
 
 #Accumulation and melting
-md.smb.mass_balance=10.*numpy.ones((md.mesh.numberofvertices))
-md.basalforcings.groundedice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices))
-md.basalforcings.floatingice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices))
+md.smb.mass_balance = 10. * np.ones((md.mesh.numberofvertices))
+md.basalforcings.groundedice_melting_rate = 5. * np.ones((md.mesh.numberofvertices))
+md.basalforcings.floatingice_melting_rate = 5. * np.ones((md.mesh.numberofvertices))
 
 #Friction
-md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices))
-md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
-md.friction.p=numpy.ones((md.mesh.numberofelements))
-md.friction.q=numpy.ones((md.mesh.numberofelements))
+md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
+md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 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.verbose=verbose(0)
-md.settings.waitonlock=30
-md.stressbalance.restol=0.05
-md.steadystate.reltol=0.05
-md.stressbalance.reltol=0.05
-md.stressbalance.abstol=float('NaN')
-md.timestepping.time_step=1.
-md.timestepping.final_time=3.
-md.groundingline.migration='None'
+md.masstransport.stabilization = 1
+md.thermal.stabilization = 1
+md.verbose = verbose(0)
+md.settings.waitonlock = 30
+md.stressbalance.restol = 0.05
+md.steadystate.reltol = 0.05
+md.stressbalance.reltol = 0.05
+md.stressbalance.abstol = float('NaN')
+md.timestepping.time_step = 1.
+md.timestepping.final_time = 3.
+md.groundingline.migration = 'None'
 
 #Deal with boundary conditions:
-md=SetMarineIceSheetBC(md,'../Exp/SquareFront.exp')
+md = SetMarineIceSheetBC(md, '../Exp/SquareFront.exp')
 
 #Change name so that no test have the same name
 if len(inspect.stack()) > 2:
-	md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
+    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
Index: /issm/trunk/test/Par/SquareShelf.par
===================================================================
--- /issm/trunk/test/Par/SquareShelf.par	(revision 24312)
+++ /issm/trunk/test/Par/SquareShelf.par	(revision 24313)
@@ -11,4 +11,5 @@
 md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness;
 md.geometry.surface=md.geometry.base+md.geometry.thickness;
+md.geometry.bed = md.geometry.base-500.;
 
 %Initial velocity and pressure
Index: /issm/trunk/test/Par/SquareShelf.py
===================================================================
--- /issm/trunk/test/Par/SquareShelf.py	(revision 24312)
+++ /issm/trunk/test/Par/SquareShelf.py	(revision 24313)
@@ -2,5 +2,5 @@
 import inspect
 from arch import *
-import numpy
+import numpy as np
 from verbose import verbose
 from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
@@ -10,31 +10,32 @@
 #Start defining model parameters here
 #Geometry
-hmin=300.
-hmax=1000.
-ymin=min(md.mesh.y)
-ymax=max(md.mesh.y)
-xmin=min(md.mesh.x)
-xmax=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
-md.geometry.surface=md.geometry.base+md.geometry.thickness
+hmin = 300.
+hmax = 1000.
+ymin = min(md.mesh.y)
+ymax = max(md.mesh.y)
+xmin = min(md.mesh.x)
+xmax = 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
+md.geometry.surface = md.geometry.base + md.geometry.thickness
+md.geometry.bed = md.geometry.base - 500.
 
 #Initial velocity and pressure
-x         = numpy.array(archread('../Data/SquareShelf.arch','x'))
-y         = numpy.array(archread('../Data/SquareShelf.arch','y'))
-vx        = numpy.array(archread('../Data/SquareShelf.arch','vx'));
-vy        = numpy.array(archread('../Data/SquareShelf.arch','vy'));
-index     = archread('../Data/SquareShelf.arch','index').astype(int);
+x = np.array(archread('../Data/SquareShelf.arch', 'x'))
+y = np.array(archread('../Data/SquareShelf.arch', 'y'))
+vx = np.array(archread('../Data/SquareShelf.arch', 'vx'))
+vy = np.array(archread('../Data/SquareShelf.arch', 'vy'))
+index = archread('../Data/SquareShelf.arch', 'index').astype(int)
 
 #dbg - begin
-# #print 'vars in SquareShelf.nc:'
-# #for v in iVelF.variables:
-# #	print v
-#dbg - end 
+#  #print 'vars in SquareShelf.nc:'
+#  #for v in iVelF.variables:
+#  #    print v
+#dbg - end
 
-[md.initialization.vx]=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
-[md.initialization.vy]=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
-md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
+[md.initialization.vx] = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)
+[md.initialization.vy] = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)
+md.initialization.vz = np.zeros((md.mesh.numberofvertices))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
 
 #dbg - begin
@@ -43,21 +44,21 @@
 #print '...vy:'
 #print md.initialization.vy
-##print '...vz:'
-##print md.initialization.vz
-##print '...pressure:'
-##print md.initialization.pressure
-#dbg - end 
+#  #print '...vz:'
+#  #print md.initialization.vz
+#  #print '...pressure:'
+#  #print md.initialization.pressure
+#dbg - end
 
 
 #Materials
-md.initialization.temperature = (273.-20.)*numpy.ones((md.mesh.numberofvertices))
+md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
 md.materials.rheology_B = paterson(md.initialization.temperature)
-md.materials.rheology_n = 3.*numpy.ones((md.mesh.numberofelements))
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
 
 #Friction
-md.friction.coefficient = 20.*numpy.ones((md.mesh.numberofvertices))
-md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
-md.friction.p = numpy.ones((md.mesh.numberofelements))
-md.friction.q = numpy.ones((md.mesh.numberofelements))
+md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
+md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
+md.friction.p = np.ones((md.mesh.numberofelements))
+md.friction.q = np.ones((md.mesh.numberofelements))
 
 #Numerical parameters
@@ -65,5 +66,5 @@
 md.thermal.stabilization = 1.
 md.settings.waitonlock = 30
-md.verbose=verbose()
+md.verbose = verbose()
 md.stressbalance.restol = 0.10
 md.steadystate.reltol = 0.02
@@ -75,8 +76,8 @@
 
 #Boundary conditions:
-# #md=SetIceShelfBC(md)
-md=SetIceShelfBC(md,'../Exp/SquareFront.exp')
+#  #md = SetIceShelfBC(md)
+md = SetIceShelfBC(md, '../Exp/SquareFront.exp')
 
 #Change name so that no test have the same name
 if len(inspect.stack()) > 2:
-	md.miscellaneous.name=os.path.basename(inspect.stack()[2][1]).split('.')[0]
+    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
Index: /issm/trunk/test/Par/SquareShelf2.py
===================================================================
--- /issm/trunk/test/Par/SquareShelf2.py	(revision 24312)
+++ /issm/trunk/test/Par/SquareShelf2.py	(revision 24313)
@@ -2,5 +2,5 @@
 import inspect
 from arch import *
-import numpy
+import numpy as np
 from verbose import verbose
 from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
@@ -10,30 +10,30 @@
 #Start defining model parameters here
 #Geometry
-hmin=300.
-hmax=1000.
-ymin=min(md.mesh.y)
-ymax=max(md.mesh.y)
-xmin=min(md.mesh.x)
-xmax=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
-md.geometry.surface=md.geometry.base+md.geometry.thickness
+hmin = 300.
+hmax = 1000.
+ymin = min(md.mesh.y)
+ymax = max(md.mesh.y)
+xmin = min(md.mesh.x)
+xmax = 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
+md.geometry.surface = md.geometry.base + md.geometry.thickness
 
 #Initial velocity and pressure
-x         = numpy.array(archread('../Data/SquareShelf.arch','x'))
-y         = numpy.array(archread('../Data/SquareShelf.arch','y'))
-vx        = numpy.array(archread('../Data/SquareShelf.arch','vx'));
-vy        = numpy.array(archread('../Data/SquareShelf.arch','vy'));
-index     = archread('../Data/SquareShelf.arch','index').astype(int);
+x = np.array(archread('../Data/SquareShelf.arch', 'x'))
+y = np.array(archread('../Data/SquareShelf.arch', 'y'))
+vx = np.array(archread('../Data/SquareShelf.arch', 'vx'))
+vy = np.array(archread('../Data/SquareShelf.arch', 'vy'))
+index = archread('../Data/SquareShelf.arch', 'index').astype(int)
 #dbg - begin
-# #print 'vars in SquareShelf.nc:'
-# #for v in iVelF.variables:
-# #	print v
-#dbg - end 
+#  #print 'vars in SquareShelf.nc:'
+#  #for v in iVelF.variables:
+#  #    print v
+#dbg - end
 
-[md.initialization.vx]=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
-[md.initialization.vy]=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
-md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
+[md.initialization.vx] = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)
+[md.initialization.vy] = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)
+md.initialization.vz = np.zeros((md.mesh.numberofvertices))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
 
 #dbg - begin
@@ -42,21 +42,21 @@
 #print '...vy:'
 #print md.initialization.vy
-##print '...vz:'
-##print md.initialization.vz
-##print '...pressure:'
-##print md.initialization.pressure
-#dbg - end 
+#  #print '...vz:'
+#  #print md.initialization.vz
+#  #print '...pressure:'
+#  #print md.initialization.pressure
+#dbg - end
 
 
 #Materials
-md.initialization.temperature = (273.-20.)*numpy.ones((md.mesh.numberofvertices))
+md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
 md.materials.rheology_B = paterson(md.initialization.temperature)
-md.materials.rheology_n = 3.*numpy.ones((md.mesh.numberofelements))
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
 
 #Friction
-md.friction.coefficient = 20.*numpy.ones((md.mesh.numberofvertices))
-md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
-md.friction.p = numpy.ones((md.mesh.numberofelements))
-md.friction.q = numpy.ones((md.mesh.numberofelements))
+md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
+md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
+md.friction.p = np.ones((md.mesh.numberofelements))
+md.friction.q = np.ones((md.mesh.numberofelements))
 
 #Numerical parameters
@@ -64,5 +64,5 @@
 md.thermal.stabilization = 1.
 md.settings.waitonlock = 30
-md.verbose=verbose()
+md.verbose = verbose()
 md.stressbalance.restol = 0.10
 md.steadystate.reltol = 0.02
@@ -71,11 +71,11 @@
 md.timestepping.time_step = 1.
 md.timestepping.final_time = 3.
-md.groundingline.migration= 'None'
+md.groundingline.migration = 'None'
 
 #Boundary conditions:
-# #md=SetIceShelfBC(md)
-md=SetIceShelfBC(md,'../Exp/SquareFront2.exp')
+#  #md = SetIceShelfBC(md)
+md = SetIceShelfBC(md, '../Exp/SquareFront2.exp')
 
 #Change name so that no test have the same name
 if len(inspect.stack()) > 2:
-	md.miscellaneous.name=os.path.basename(inspect.stack()[2][1]).split('.')[0]
+    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
Index: /issm/trunk/test/Par/SquareShelfConstrained.py
===================================================================
--- /issm/trunk/test/Par/SquareShelfConstrained.py	(revision 24312)
+++ /issm/trunk/test/Par/SquareShelfConstrained.py	(revision 24313)
@@ -1,4 +1,4 @@
 import os.path
-from arch import *
+from arch import archread
 import numpy as np
 import inspect
@@ -10,56 +10,54 @@
 #Start defining model parameters here
 #Geometry
-hmin=300.
-hmax=1000.
-ymin=np.min(md.mesh.y)
-ymax=np.max(md.mesh.y)
-xmin=min(md.mesh.x)
-xmax=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
-md.geometry.surface=md.geometry.base+md.geometry.thickness
-md.geometry.bed=md.geometry.base-10;
+hmin = 300.
+hmax = 1000.
+ymin = np.min(md.mesh.y)
+ymax = np.max(md.mesh.y)
+xmin = min(md.mesh.x)
+xmax = 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
+md.geometry.surface = md.geometry.base + md.geometry.thickness
+md.geometry.bed = md.geometry.base - 10
 
-#Initial velocity 
-#x         = np.reshape(np.array(archread('../Data/SquareShelfConstrained.arch','x')),(-1))
-#y         = np.reshape(np.array(archread('../Data/SquareShelfConstrained.arch','y')),(-1))
-x         = np.array(archread('../Data/SquareShelfConstrained.arch','x'))
-y         = np.array(archread('../Data/SquareShelfConstrained.arch','y'))
-vx        = np.array(archread('../Data/SquareShelfConstrained.arch','vx'))
-vy        = np.array(archread('../Data/SquareShelfConstrained.arch','vy'))
-index     = np.array(archread('../Data/SquareShelfConstrained.arch','index').astype(int))
+#Initial velocity
+x = np.array(archread('../Data/SquareShelfConstrained.arch', 'x'))
+y = np.array(archread('../Data/SquareShelfConstrained.arch', 'y'))
+vx = np.array(archread('../Data/SquareShelfConstrained.arch', 'vx'))
+vy = np.array(archread('../Data/SquareShelfConstrained.arch', 'vy'))
+index = np.array(archread('../Data/SquareShelfConstrained.arch', 'index').astype(int))
 
-[md.initialization.vx]=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
-[md.initialization.vy]=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
-md.initialization.vz=np.zeros((md.mesh.numberofvertices))
-md.initialization.pressure=np.zeros((md.mesh.numberofvertices))
+[md.initialization.vx] = InterpFromMeshToMesh2d(index, x, y, vx, md.mesh.x, md.mesh.y)
+[md.initialization.vy] = InterpFromMeshToMesh2d(index, x, y, vy, md.mesh.x, md.mesh.y)
+md.initialization.vz = np.zeros((md.mesh.numberofvertices))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
 
 #Materials
-md.initialization.temperature=(273.-20.)*np.ones((md.mesh.numberofvertices))
-md.materials.rheology_B=paterson(md.initialization.temperature)
-md.materials.rheology_n=3.*np.ones((md.mesh.numberofelements))
+md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
+md.materials.rheology_B = paterson(md.initialization.temperature)
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
 
 #Surface mass balance and basal melting
-md.smb.mass_balance=10.*np.ones((md.mesh.numberofvertices))
-md.basalforcings.groundedice_melting_rate=5.*np.ones((md.mesh.numberofvertices))
-md.basalforcings.floatingice_melting_rate=5.*np.ones((md.mesh.numberofvertices))
+md.smb.mass_balance = 10. * np.ones((md.mesh.numberofvertices))
+md.basalforcings.groundedice_melting_rate = 5. * np.ones((md.mesh.numberofvertices))
+md.basalforcings.floatingice_melting_rate = 5. * np.ones((md.mesh.numberofvertices))
 
 #Friction
-md.friction.coefficient=20.*np.ones((md.mesh.numberofvertices))
-md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
-md.friction.p=np.ones((md.mesh.numberofelements))
-md.friction.q=np.ones((md.mesh.numberofelements))
+md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
+md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 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
+md.thermal.stabilization = 1
 md.verbose = verbose(0)
-md.settings.waitonlock=30
-md.stressbalance.restol=0.05
-md.stressbalance.reltol=0.05
-md.steadystate.reltol=0.05
-md.stressbalance.abstol=float('nan')
-md.timestepping.time_step=1.
-md.timestepping.final_time=3.
+md.settings.waitonlock = 30
+md.stressbalance.restol = 0.05
+md.stressbalance.reltol = 0.05
+md.steadystate.reltol = 0.05
+md.stressbalance.abstol = float('nan')
+md.timestepping.time_step = 1.
+md.timestepping.final_time = 3.
 
 #Deal with boundary conditions:
@@ -68,3 +66,3 @@
 #Change name so that no tests have the same name
 if len(inspect.stack()) > 2:
-	md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
+    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
Index: /issm/trunk/test/Par/SquareThermal.py
===================================================================
--- /issm/trunk/test/Par/SquareThermal.py	(revision 24312)
+++ /issm/trunk/test/Par/SquareThermal.py	(revision 24313)
@@ -1,3 +1,3 @@
-import numpy
+import numpy as np
 from paterson import paterson
 from SetMarineIceSheetBC import SetMarineIceSheetBC
@@ -5,47 +5,47 @@
 #Ok, start defining model parameters here
 
-md.timestepping.time_step=0
-md.groundingline.migration='None'
+md.timestepping.time_step = 0
+md.groundingline.migration = 'None'
 
-print "      creating thickness"
-h=1000.
-md.geometry.thickness=h*numpy.ones((md.mesh.numberofvertices))
-md.geometry.base=-1000.*numpy.ones((md.mesh.numberofvertices))
-md.geometry.surface=md.geometry.base+md.geometry.thickness;
+print("      creating thickness")
+h = 1000.
+md.geometry.thickness = h * np.ones((md.mesh.numberofvertices))
+md.geometry.base = -1000. * np.ones((md.mesh.numberofvertices))
+md.geometry.surface = md.geometry.base + md.geometry.thickness
 
-print "      creating velocities"
-md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
+print("      creating velocities")
+md.initialization.vx = np.zeros((md.mesh.numberofvertices))
+md.initialization.vy = np.zeros((md.mesh.numberofvertices))
+md.initialization.vz = np.zeros((md.mesh.numberofvertices))
 
-print "      creating drag"
-md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices))
-md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
-md.friction.p=numpy.ones((md.mesh.numberofelements))
-md.friction.q=numpy.ones((md.mesh.numberofelements))
+print("      creating drag")
+md.friction.coefficient = 200. * np.ones((md.mesh.numberofvertices))
+md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
+md.friction.p = np.ones((md.mesh.numberofelements))
+md.friction.q = np.ones((md.mesh.numberofelements))
 
-print "      creating temperatures"
-md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
-md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,))
-md.initialization.waterfraction=numpy.zeros((md.mesh.numberofvertices,))
-md.initialization.watercolumn=numpy.zeros((md.mesh.numberofvertices,))
+print("      creating temperatures")
+md.initialization.temperature = (273. - 20.) * np.ones((md.mesh.numberofvertices))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices, ))
+md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices, ))
 
-print "      creating flow law parameter"
-md.materials.rheology_B=paterson(md.initialization.temperature)
-md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
+print("      creating flow law parameter")
+md.materials.rheology_B = paterson(md.initialization.temperature)
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
 
-print "      creating surface mass balance"
-md.smb.mass_balance=numpy.ones((md.mesh.numberofvertices))/md.constants.yts    #1m/a
-#md.basalforcings.melting_rate=0.*numpy.ones((md.mesh.numberofvertices))/md.constants.yts    #1m/a
-md.basalforcings.groundedice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices))/md.constants.yts    #1m/a
-md.basalforcings.floatingice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices))/md.constants.yts    #1m/a
+print("      creating surface mass balance")
+md.smb.mass_balance = np.ones((md.mesh.numberofvertices)) / md.constants.yts  #1m / a
+#md.basalforcings.melting_rate = 0. * np.ones((md.mesh.numberofvertices)) / md.constants.yts  #1m / a
+md.basalforcings.groundedice_melting_rate = 0. * np.ones((md.mesh.numberofvertices)) / md.constants.yts  #1m / a
+md.basalforcings.floatingice_melting_rate = 0. * np.ones((md.mesh.numberofvertices)) / md.constants.yts  #1m / a
 
 #Deal with boundary conditions:
 
-print "      boundary conditions for stressbalance model"
-md=SetMarineIceSheetBC(md,'../Exp/SquareFront.exp')
+print("      boundary conditions for stressbalance model")
+md = SetMarineIceSheetBC(md, '../Exp/SquareFront.exp')
 
-print "      boundary conditions for thermal model"
-md.thermal.spctemperature[:]=md.initialization.temperature
-md.basalforcings.geothermalflux=numpy.zeros((md.mesh.numberofvertices)) 
-md.basalforcings.geothermalflux[numpy.nonzero(md.mask.groundedice_levelset>0.)[0]]=1.*10**-3    #1 mW/m^2
+print("      boundary conditions for thermal model")
+md.thermal.spctemperature[:] = md.initialization.temperature
+md.basalforcings.geothermalflux = np.zeros((md.mesh.numberofvertices))
+md.basalforcings.geothermalflux[np.nonzero(md.mask.groundedice_levelset > 0.)[0]] = 1. * 10**-3  #1 mW / m^2
Index: /issm/trunk/test/Par/ValleyGlacierShelf.par
===================================================================
--- /issm/trunk/test/Par/ValleyGlacierShelf.par	(revision 24312)
+++ /issm/trunk/test/Par/ValleyGlacierShelf.par	(revision 24313)
@@ -75,5 +75,5 @@
 %Masstransport;
 md.calving.calvingrate = 0.*ones(md.mesh.numberofvertices,1);
-md.calving.meltingrate = 0.*ones(md.mesh.numberofvertices,1);
+md.frontalforcings.meltingrate = 0.*ones(md.mesh.numberofvertices,1);
 md.levelset.spclevelset=NaN(md.mesh.numberofvertices,1);
 md.masstransport.stabilization = 1.;
Index: /issm/trunk/test/Par/ValleyGlacierShelf.py
===================================================================
--- /issm/trunk/test/Par/ValleyGlacierShelf.py	(revision 24312)
+++ /issm/trunk/test/Par/ValleyGlacierShelf.py	(revision 24313)
@@ -1,95 +1,93 @@
 import os.path
 from arch import *
-import numpy
+import numpy as np
 import inspect
-import math
 from verbose import verbose
-from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
 from paterson import paterson
 from SetIceShelfBC import SetIceShelfBC
 
 #Start defining model parameters here
-x=md.mesh.x
-y=md.mesh.y
+x = md.mesh.x
+y = md.mesh.y
 xmin, xmax = min(x), max(x)
 ymin, ymax = min(y), max(y)
-Lx=(xmax-xmin)
-Ly=(ymax-ymin)
-xm,ym = (xmin+xmax)/2., (ymin+ymax)/2.
+Lx = (xmax - xmin)
+Ly = (ymax - ymin)
+xm, ym = (xmin + xmax) / 2., (ymin + ymax) / 2.
 
-#Geometry: U-shaped valley in y direction
+#Geometry: U - shaped valley in y direction
 thk_center = 1000.
-thk_margin = 0.5*thk_center
-bmax=0.
-bmin=-thk_center*md.materials.rho_ice/md.materials.rho_water
+thk_margin = 0.5 * thk_center
+bmax = 0.
+bmin = -thk_center * md.materials.rho_ice / md.materials.rho_water
 
-alpha=2./3.
-slope = 0.9*(bmin-bmax)*(x-xmin)/(Lx*alpha) + 0.1*(bmin-bmax)*(y-ymin)/(Ly) + bmax
-md.geometry.surface= (thk_center+bmax) + slope 
-md.geometry.base=bmax + slope + 4./Ly**2*(thk_center-thk_margin)*(numpy.power(y-ym,2))
-md.geometry.thickness=md.geometry.surface - md.geometry.base
+alpha = 2. / 3.
+slope = 0.9 * (bmin - bmax) * (x - xmin) / (Lx * alpha) + 0.1 * (bmin - bmax) * (y - ymin) / (Ly) + bmax
+md.geometry.surface = (thk_center + bmax) + slope
+md.geometry.base = bmax + slope + 4. / Ly**2 * (thk_center - thk_margin) * (np.power(y - ym, 2))
+md.geometry.thickness = md.geometry.surface - md.geometry.base
 md.geometry.bed = md.geometry.base
 
 #Mask
-md.mask.ice_levelset=x - alpha*Lx
-md.mask.groundedice_levelset= numpy.ones((md.mesh.numberofvertices))
+md.mask.ice_levelset = x - alpha * Lx
+md.mask.groundedice_levelset = np.ones((md.mesh.numberofvertices))
 
-#Initial velocity 
-md.initialization.vx=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.vy=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
+#Initial velocity
+md.initialization.vx = np.zeros((md.mesh.numberofvertices))
+md.initialization.vy = np.zeros((md.mesh.numberofvertices))
+md.initialization.vz = np.zeros((md.mesh.numberofvertices))
+md.initialization.pressure = np.zeros((md.mesh.numberofvertices))
 
 #Materials
-md.initialization.temperature=(273.15-5.)*numpy.ones((md.mesh.numberofvertices))
-md.initialization.waterfraction=numpy.zeros((md.mesh.numberofvertices))
-md.initialization.watercolumn=numpy.zeros((md.mesh.numberofvertices))
-md.materials.rheology_B=paterson(md.initialization.temperature)
-md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
+md.initialization.temperature = (273.15 - 5.) * np.ones((md.mesh.numberofvertices))
+md.initialization.waterfraction = np.zeros((md.mesh.numberofvertices))
+md.initialization.watercolumn = np.zeros((md.mesh.numberofvertices))
+md.materials.rheology_B = paterson(md.initialization.temperature)
+md.materials.rheology_n = 3. * np.ones((md.mesh.numberofelements))
 
 #Thermal
-md.thermal.isenthalpy=False
-md.thermal.spctemperature=float('nan')*numpy.ones((md.mesh.numberofvertices))
+md.thermal.isenthalpy = False
+md.thermal.spctemperature = float('nan') * np.ones((md.mesh.numberofvertices))
 
 #Groundingline
-md.groundingline.migration='SubelementMigration'
+md.groundingline.migration = 'SubelementMigration'
 
 #Surface mass balance and basal melting
-md.smb.mass_balance=0.3*numpy.ones((md.mesh.numberofvertices))
-md.basalforcings.groundedice_melting_rate=md.smb.mass_balance
-md.basalforcings.floatingice_melting_rate=md.smb.mass_balance
+md.smb.mass_balance = 0.3 * np.ones((md.mesh.numberofvertices))
+md.basalforcings.groundedice_melting_rate = md.smb.mass_balance
+md.basalforcings.floatingice_melting_rate = md.smb.mass_balance
 
 #Friction
-md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices))
-md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
-md.friction.p=numpy.ones((md.mesh.numberofelements))
-md.friction.q=numpy.ones((md.mesh.numberofelements))
+md.friction.coefficient = 20. * np.ones((md.mesh.numberofvertices))
+md.friction.coefficient[np.nonzero(md.mask.groundedice_levelset < 0.)[0]] = 0.
+md.friction.p = np.ones((md.mesh.numberofelements))
+md.friction.q = np.ones((md.mesh.numberofelements))
 
 #Transient
-md.transient.isstressbalance=True
-md.transient.ismovingfront=True
-md.transient.ismasstransport=False
-md.transient.isthermal=False
-md.transient.isgroundingline=True
-md.transient.isgia=False
+md.transient.isstressbalance = True
+md.transient.ismovingfront = True
+md.transient.ismasstransport = False
+md.transient.isthermal = False
+md.transient.isgroundingline = True
+md.transient.isgia = False
 
 #Stressbalance
-md.stressbalance.maxiter=100
-md.stressbalance.restol=0.05
-md.stressbalance.reltol=0.05
-md.stressbalance.abstol=float('nan')
+md.stressbalance.maxiter = 100
+md.stressbalance.restol = 0.05
+md.stressbalance.reltol = 0.05
+md.stressbalance.abstol = float('nan')
 
 #Masstransport
-md.calving.calvingrate=0.*numpy.ones((md.mesh.numberofvertices))
-md.calving.meltingrate=0.*numpy.ones((md.mesh.numberofvertices))
-md.levelset.spclevelset=float('NaN')*numpy.ones((md.mesh.numberofvertices))
-md.masstransport.stabilization=1.
+md.calving.calvingrate = 0. * np.ones((md.mesh.numberofvertices))
+md.frontalforcings.meltingrate = 0. * np.ones((md.mesh.numberofvertices))
+md.levelset.spclevelset = float('NaN') * np.ones((md.mesh.numberofvertices))
+md.masstransport.stabilization = 1.
 
 #Numerical parameters
-md.thermal.stabilization=1.
-md.settings.waitonlock=30
-md.steadystate.reltol=0.05
-md.timestepping.time_step=1.
-md.timestepping.final_time=3.
+md.thermal.stabilization = 1.
+md.settings.waitonlock = 30
+md.steadystate.reltol = 0.05
+md.timestepping.time_step = 1.
+md.timestepping.final_time = 3.
 
 #Verbose
@@ -101,3 +99,3 @@
 #Change name so that no tests have the same name
 if len(inspect.stack()) > 2:
-	md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
+    md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
